const CURRENT_PRODUCT=window.essentialOrderValueBoosterMeta?JSON.parse(window.essentialOrderValueBoosterMeta.productData):null,CART_PRODUCTS=window.essentialOrderValueBoosterMeta&&window.essentialOrderValueBoosterMeta.cartProducts?window.essentialOrderValueBoosterMeta.cartProducts.map(e=>{let t;try{t=JSON.parse(e)}catch(r){console.log(r)}return t}):[],SELECTED_PRODUCTS=window.essentialOrderValueBoosterProductsData?window.essentialOrderValueBoosterProductsData.map(e=>{let t;try{t=JSON.parse(e)}catch(r){console.log(r)}return t}):[];function moneyFormatEssentialApps(e,t){let r,i=Number.parseFloat(t).toFixed(2),o=window.Shopify?.shop;return o&&("jelt-2828.myshopify.com"===o||"maleia-studio.myshopify.com"===o||"capconstructoraandrespinzon.myshopify.com"===o)?e.replace("{{amount_with_comma_separator}}",new Intl.NumberFormat("de-DE").format(Number.parseFloat(t).toFixed())):o&&"0ef04d-2c.myshopify.com"===o?e.replace("{{amount_no_decimals}}",new Intl.NumberFormat("en-NG").format(Number.parseFloat(t).toFixed())):o&&"9a7c2a-3.myshopify.com"===o?e.replace("{{amount_with_comma_separator}}",new Intl.NumberFormat("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2}).format(t)):(r=e.replace("{{amount}}",Number.parseFloat(t).toFixed(2)),o&&"vaperaliamexico.myshopify.com"===o&&(r=e.replace("{{amount}}",new Intl.NumberFormat("es-MX",{minimumFractionDigits:2,maximumFractionDigits:2}).format(Number.parseFloat(t)))),r=(r=(r=(r=(r=(r=r.replace("{{amount_with_comma_separator}}",i.replace(".",","))).replace("{{amount_with_dot_separator}}",i)).replace("{{amount_no_decimals}}",new Intl.NumberFormat("de-DE").format(Number.parseFloat(t).toFixed()))).replace("{{amount_no_decimals_with_comma_separator}}",new Intl.NumberFormat("de-DE").format(Number.parseFloat(t).toFixed()))).replace("{{amount_no_decimals_with_space_separator}}",new Intl.NumberFormat("hu-HU").format(Number.parseFloat(t).toFixed()))).replace("{{amount_with_space_separator}}",new Intl.NumberFormat("hu-HU").format(t)),o&&("paulandmike-co.myshopify.com"===o||"cardinal-trading-retail.myshopify.com"===o||"grino-store.myshopify.com"===o||"sootang.myshopify.com"===o||"https-huxley-jp.myshopify.com"===o||"bungubox.myshopify.com"===o||"qbtidr-fy.myshopify.com"===o)&&(r=r.replace(".",",")),o&&"dsg-jp.myshopify.com"===o&&(r=r.replace(".","")),o&&"elemood.myshopify.com"===o&&(r=t.toLocaleString("de-DE",{minimumFractionDigits:2})),o&&"mja-shoes.myshopify.com"===o&&(r=`$${r=parseInt(t).toLocaleString("de-DE")}`),r)}function cardTitleEssentialApps(e,t=0){let r=moneyFormatEssentialApps(e.moneyFormat,e.goal-t);return t?t>0&&t=e.goal?e.reachedTitle:void 0:e.title.replace("{order-value}",r)}function updateTotalOnClick(e,t){let r=document.querySelectorAll('form a, form button, form input[type="submit"], button.productitem--action-trigger');if(r){let i=()=>{setTimeout(()=>{pollCartTotalEssentialApps()},500),setTimeout(()=>{pollCartTotalEssentialApps()},1e3),Shopify?.shop==="hawaiiansouthshore.myshopify.com"&&setTimeout(()=>{pollCartTotalEssentialApps()},3e3)};"cart-page"===e.type&&!t||window.freeShippingBarConfigs.clickEvents||window.freeShippingBarConfigs.observer||(r.forEach(e=>{e.addEventListener("click",i,{passive:!0})}),document.addEventListener("booster:cart:update",()=>{i()}),window.freeShippingBarConfigs.clickEvents=!0)}}async function getProductEssentialApps(e){let t=await fetch(`/products/${e}.js`,{headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>e).catch(e=>{console.error("Error:",e)});return t}function pollCartTotalEssentialApps(){if(window.freeShippingBarConfigs.threshold)return;{let e="barista-och-espresso.myshopify.com"===window.Shopify.shop?100:300;window.freeShippingBarConfigs.threshold=!0,setTimeout(()=>{window.freeShippingBarConfigs.threshold=!1},e)}let t=window?.Shopify?.routes?.root||"/",r="pizzalover-ch.myshopify.com"===window.Shopify.shop?`?timestamp=${Date.now()}`:"";fetch(t+"cart.js"+r).then(e=>e.json()).then(e=>{let t="8c20e7-2.myshopify.com"===window.Shopify.shop||"healingshilajit-com.myshopify.com"===window.Shopify.shop||"5a3970-4.myshopify.com"===window.Shopify.shop||"el-buho-nocturno.myshopify.com"===window.Shopify.shop||"appfit-australia.myshopify.com"===window.Shopify.shop||window.useOriginalTotalPrice?e.original_total_price:e.total_price;window.freeShippingBarConfigs.prevCartTotalPrice=t/100,e.items&&e.items.length>0?window.essentialOrderValueBoosterMeta.cartItems=e.items:window.essentialOrderValueBoosterMeta.cartItems=[],window.freeShippingBarConfigs&&window.freeShippingBarConfigs.forEach(r=>{if("turtletags.myshopify.com"===window.Shopify.shop&&e?.currency!==r.currency)return;let i=t;if(r.excludeProducts&&r.excludeProducts.length>0&&e.items.forEach(e=>{r.excludeProducts.find(t=>t.handle===e.handle)&&(i-=e.final_line_price)}),r.excludeProductTags&&r.excludeProductTags.length>0&&e.items.forEach(e=>{let t=CART_PRODUCTS;if(CURRENT_PRODUCT){let o=t.find(e=>e.id===CURRENT_PRODUCT.id);o||t.push(CURRENT_PRODUCT)}let a=t.find(t=>t.id===e.product_id);a||getProductEssentialApps(e.handle).then(e=>{t.push(e)});let n=t.find(t=>t.id===e.product_id),p=n?.tags||[],s=p.map(e=>e.toLowerCase()),l=r.excludeProductTags.some(e=>s.includes(e.toLowerCase()));l&&(i-=e.final_line_price)}),"barista-store.myshopify.com"===Shopify.shop&&(i+=.2*i),document.querySelector(`.free_shipping_card_wrapper_${r.id}`)){let o=document.querySelectorAll(`.free_shipping_card_title_${r.id}`),a=document.querySelectorAll(`.free_shipping_card_progress_bar_${r.id}`),n=document.querySelectorAll(`.free_shipping_card_wrapper_${r.id}`);0!=o.length&&o.forEach(e=>{e.textContent=cardTitleEssentialApps(r,i/100)});let p=i/r.goal;p>100?p=100:0===p&&(p=2.5),a.forEach(e=>{e.style.width=`${p}%`}),n.forEach(e=>{e.style.display="flex"})}if(document.querySelector(`.free_shipping_bar_wrapper_${r.id}`)){let s=document.querySelector(`.free_shipping_bar_title_${r.id}`),l=document.querySelector(`.free_shipping_bar_wrapper_${r.id}`);s.textContent=cardTitleEssentialApps(r,i/100),l.style.display="flex"}});let r=window.location&&window.location.pathname.endsWith("/cart")&&!window.location.pathname.includes("/products/");r&&("pinkblackpalermo.myshopify.com"===Shopify.shop||"essential-freshness.myshopify.com"===Shopify.shop)&&setTimeout(()=>{window.freeShippingBarConfigs.clickEvents=!1,updateTotalOnClick({type:"not-cart-page"},!0)},300),setTimeout(()=>{countViews()},700)})}function triggerSideCart(e){if("baybella1.myshopify.com"===Shopify.shop||"dow-shelly.myshopify.com"===Shopify.shop||"stickerplanetla.myshopify.com"===Shopify.shop){window.location.reload();return}if("qjzutk-2h.myshopify.com"===Shopify.shop){let t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}cart`}if("creating-numbers-gmbh.myshopify.com"===Shopify.shop&&window.upcartRefreshCart){upcartRefreshCart().then(()=>{upcartOpenCart()});return}if("rainsisters.myshopify.com"===Shopify.shop){publish(PUB_SUB_EVENTS.cartUpdate,{source:"external"});return}if(document.dispatchEvent(new CustomEvent("cart:build")),"blingmyride.myshopify.com"===Shopify.shop){let r=new theme.CartDrawer;r.init();return}let i=window?.Shopify?.routes?.root||"/",o=document.querySelectorAll(`form[action="${i}cart/add"]`),a=window.location&&window.location.pathname.includes("/products/"),n=o[o.length-1];if("55c4f2-6.myshopify.com"===Shopify.shop&&(n=document.querySelector('form[data-type="add-to-cart-form"]')),!n){let p=window.freeShippingBarConfigs.find(t=>t.id===e);p&&p.createdAt&&new Date(p.createdAt).getTime()>1724239746e3&&window.location.reload();return}let s;(s=n.querySelector('button[type="submit"]'))&&!s.disabled||o.forEach(e=>{e.querySelector('button[type="submit"]:not([disabled])')&&(n=e,s=e.querySelector('button[type="submit"]'))});let l=n.querySelector('input[name="quantity"]'),c=n.querySelector('button[name="minus"]'),d=n.querySelector('button[name="plus"]');if(!s)return;let u=document.createElement("input");if(u.setAttribute("type","hidden"),u.setAttribute("value","0"),u.setAttribute("name","quantity"),!l&&a&&"kingsmaycompany.myshopify.com"===Shopify.shop){let h=document.querySelector('input[name="quantity"]'),m=h.value;h.value=0,s.click(),h.value=m;return}if(!l){n.appendChild(u),s.click(),u.remove();return}let f=l.getAttribute("value");l.setAttribute("min",0),l.setAttribute("value",0),("18684b-47.myshopify.com"===Shopify.shop||"dedbdx-mh.myshopify.com"===Shopify.shop)&&(c.disabled=!1,c.click()),s.click(),("18684b-47.myshopify.com"===Shopify.shop||"dedbdx-mh.myshopify.com"===Shopify.shop)&&d.click(),l.setAttribute("min",1),l.setAttribute("value",f||1)}function addToCartEssentialApps(e,t){fetch(window?.Shopify?.routes?.root+"cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:[{id:e,quantity:1},]})}).then(e=>{if(window.freeShippingBarConfigs&&200===e.status){let r=window.location&&window.location.pathname.endsWith("/cart")&&!window.location.pathname.includes("/products/");r?r&&window.location.reload():(window.Shopify?.shop!=="atrangi-studio.myshopify.com"&&window.Shopify?.shop!=="bouqie.myshopify.com"&&triggerSideCart(t),pollCartTotalEssentialApps())}else console.log(e);return e.json()}).then(e=>{if(e.items){let r=0;window.Shopify.currency&&window.Shopify.currency.rate&&e.items[0]?.price&&(r=Math.round(e.items[0]?.price/window.Shopify.currency.rate));let i=window?.Shopify?.currency?.active||"";fetch("https://essential-apps-analytics.herokuapp.com/add_to_cart",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shop:window.Shopify.shop,booster:t,currency:i,price:e.items[0]?.price,mainCurrency:window.essentialOrderValueBoosterMeta?.mainCurrency,total:r})})}}).catch(e=>{console.error("Error:",e)})}function countViews(){if(window.essentialBoosterViewCounted)return;window.essentialBoosterViewCounted=!0;let e=window.Shopify?window.Shopify.shop:window.location.origin,t=document.querySelectorAll(".essential_free_shipping_bar_wrapper"),r=document.querySelectorAll(".free_shipping_card"),i=t&&1===t.length,o=r&&r.length>0?r.length:0;i&&(o+=1),e&&0!==o&&"lime-blue-coffee.myshopify.com"!==e&&fetch("https://essential-apps-analytics.herokuapp.com/event",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shop:e,views:o})})}function essentialCloseFreeShippingBar(e,t){let r=document.querySelector(`.free_shipping_bar_wrapper_${e}`);if(r){r.parentNode.removeChild(r);try{window.localStorage.setItem("freeShippingBarClosed",JSON.stringify({value:!0,id:e,updatedAt:t}))}catch(i){console.log(i)}}}function essentialFreeShippingInitSlider(e,t){let r=document.getElementById(`essential_product_slider_${e.id}`),i=window.location&&window.location.pathname.includes("/cart")&&!window.location.pathname.includes("/products/");if(r&&window.Glide){let o=r.offsetWidth,a;a=o>768||0===o?3:o<=768&&o>=480?2:1,0===o&&r.closest(".cart__total-container")&&(a=1),Shopify?.shop==="flexeoshop.myshopify.com"&&r.closest(".cart-footer")&&(a=1);let n=new Glide(`#essential_product_slider_${e.id}`,{type:"carousel",focusAt:0,gap:30,peek:0,perView:"cart-page"===e.type&&i?a:1,breakpoints:{768:{perView:"cart-page"===e.type&&i?a:1},480:{perView:1}}}),p=document.querySelectorAll(".essential_product_slider_glide__arrow");p.forEach(e=>{e.addEventListener("click",()=>{n.go(e.dataset.glideDir)})});let s=new ResizeObserver(()=>{n.update()});s.observe(document.getElementById(`essential_product_slider_${e.id}`)),n.mount(),"complete"!==document.readyState?document.addEventListener("readystatechange",()=>{"complete"===document.readyState&&(r.classList.add("initialized"),n.update())}):t?setTimeout(()=>{n.update(),r.classList.add("initialized")},300):r.classList.add("initialized")}}function essentialFreeShippingGetVariant(e,t){let r=null;t.variants.find(i=>{let o=e.selectedProducts.find(e=>{let r=e.id.split("/"),i=parseInt(r[r.length-1]);return t.id===i});if(!o)return!1;let a=o.variants[0].id.split("/"),n=parseInt(a[a.length-1]);i.id===n&&(r=i.id)});let i=t.variants.find(e=>e.id===r);return i}async function essentialFreeShippingFetchProductRecommendations(e){if(e){let t=window?.Shopify?.routes?.root||"/",r=await fetch(`${t}recommendations/products.json?product_id=${e}&limit=4&intent=related`).then(e=>e.json()).then(e=>e);return r}}!function(){let e=null;async function t(){let t=window.Shopify?window.Shopify.shop:window.location.origin,r=window.essentialOrderValueBoosterConfigs,i=`https://freeshipping-essential-apps.uk/config/${t}`;if(r){let o=r.find(e=>e.locationType&&"on-countries"===e.locationType);return o&&await fetch("https://freeshipping-essential-apps.uk/config/geolocation").then(t=>{t.headers.has("country")&&(e=t.headers.get("country"),console.log("FSB client country:",e))}),new Promise(e=>{e(r)})}return fetch(i).then(t=>(t.headers.has("country")&&(e=t.headers.get("country")),t.json()))}function r(e,t){let r=document.getElementsByTagName("head")[0],i=document.createElement("style");i.setAttribute("type","text/css"),i.setAttribute("data-id",t),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e)),r.appendChild(i)}function i(e){return""!==e.font&&e.font?`font-family: ${e.font}; `:""}function o(e,t,r=!1,i){let o,a,n,p;if(i){let s=t.variants[0].id.split("/"),l=s[s.length-1];o={id:l},a=t.image,n=100*t.price,p=t.compareAtPrice?100*t.compareAtPrice:null}else a=(o=r?t.variants.find(e=>e.available):essentialFreeShippingGetVariant(e,t))?.featured_image?.src||t.featured_image,n=o&&o.price?o.price:t.price,p=o?.compare_at_price;let c=window?.Shopify?.routes?.root||"/",d=document.createElement("div");d.className=`free_shipping_card_product_${e.id}`,"cart-page"===e.type&&(d.className+=" cart_page");let u=document.createElement("img");if(a){let h=a.split(".png").length>2,m=a.split(".jpg").length>2,f=a.split(".webp").length>1;u.className=`free_shipping_card_product_image_${e.id}`,"moki-store-27.myshopify.com"===Shopify.shop||"callistowatches.myshopify.com"===Shopify.shop||"bluefire-fitness-6890.myshopify.com"===Shopify.shop||"mimmo-489.myshopify.com"===Shopify.shop||"0aeed7.myshopify.com"===Shopify.shop||"94ddf0.myshopify.com"===Shopify.shop||f||h||m?u.setAttribute("src",a):u.setAttribute("src",a.replace(".jpg","_120x.jpg").replace(".png","_120x.png")),u.setAttribute("alt",t.title),u.setAttribute("onclick",`location.href = "${c}products/${t.handle}"`)}d.append(u);let g=document.createElement("div");g.className=`free_shipping_card_product_meta_${e.id}`;let y=document.createElement("div");y.className=`free_shipping_card_product_title_${e.id}`,y.textContent+=t.title,y.setAttribute("onclick",`location.href = "${c}products/${t.handle}"`);let $=document.createElement("div"),b=document.createElement("div"),S=document.createElement("div");$.className=`free_shipping_card_product_prices_wrapper_${e.id}`,b.className=`free_shipping_card_product_price_${e.id}`,S.className=`free_shipping_card_product_compare_at_price_${e.id}`;let w=moneyFormatEssentialApps(e.moneyFormat,n/100);b.textContent+=w,$.appendChild(b);let C=p&&n{let a=`
    `,n=document.createElement("div");n.innerHTML=a;let p=n.getElementsByClassName("essential_product_slider_glide__slides")[0],s=n.getElementsByClassName("essential_product_slider_glide__arrow--left")[0],l=n.getElementsByClassName("essential_product_slider_glide__arrow--right")[0];return s.append(prevArrowButtonIconSVG(e.style.arrowIconColor)),l.append(prevArrowButtonIconSVG(e.style.arrowIconColor)),t.forEach(t=>{let a=document.createElement("li");a.className="essential_product_slider_glide__slide",a.append(o(e,t,r,i)),p.append(a)}),n};async function n(){window.freeShippingBarConfigs.threshold=!0;let e=window?.Shopify?.routes?.root||"/";return fetch(e+"cart.js").then(e=>e.json()).then(e=>(setTimeout(()=>{window.freeShippingBarConfigs.threshold=!1},300),e.items&&e.items.length>0)?(window.essentialOrderValueBoosterMeta.cartItems=e.items,e):(window.essentialOrderValueBoosterMeta.cartItems=[],e))}async function p(e,t,p,s){let l=window?.Shopify?.currency?.active||"",c=e.currency||"",d;d=e?.updatedAt&&new Date(e.updatedAt).getTime()>1706182359e3?1:"product-page"===e.type||p?1:3;let u=e.upsellType||"",h=[],m,f=[],g=!1,y=null;if("frequently-bought"===u){let $;if("cart-page"===e.type&&window.essentialOrderValueBoosterMeta.cartItems&&window.essentialOrderValueBoosterMeta.cartItems[0]?$=window.essentialOrderValueBoosterMeta.cartItems[0].product_id:CURRENT_PRODUCT&&"undefined"!==CURRENT_PRODUCT&&"null"!==CURRENT_PRODUCT&&($=CURRENT_PRODUCT.id),!$&&p&&("testrial-6310-3.myshopify.com"===Shopify.shop||"essential-freshness.myshopify.com"===Shopify.shop)){let b=await n();b.items&&b.items[0]&&($=b.items[0].product_id),y=b.total_price}window.freeShippingBarRecommendedProducts?window.freeShippingBarRecommendedProducts[$]&&(f=window.freeShippingBarRecommendedProducts[$]):window.freeShippingBarRecommendedProducts=[],0===f.length&&(m=await essentialFreeShippingFetchProductRecommendations($))&&(f=m.products,e.excludeProducts&&e.excludeProducts.length>0&&(f=f.filter(t=>{let r=e.excludeProducts.find(e=>{if("vecchio-borgo-tartufi-funghi.myshopify.com"===Shopify.shop){let r=e.id.split("/").pop();return r==t.id}return e.handle===t.handle});return!r})),e.excludeProductTags&&e.excludeProductTags.length>0&&(f=f.filter(t=>{let r=e.excludeProductTags.find(e=>t.tags.includes(e));return!r})),window.freeShippingBarRecommendedProducts[$]=m.products)}let S=SELECTED_PRODUCTS.filter(t=>{let r=e.selectedProducts.find(e=>{if("glapru-amsterdam.myshopify.com"!==Shopify.shop&&"vecchio-borgo-tartufi-funghi.myshopify.com"!==Shopify.shop)return e.handle===t.handle;{let r=e.id.split("/").pop();return r==t.id}});return r});if(("products"===u||""===u&&S&&S.length>0)&&(h=S.filter(e=>{let t=window.essentialOrderValueBoosterMeta.cartItems.find(t=>"glapru-amsterdam.myshopify.com"===Shopify.shop||"vecchio-borgo-tartufi-funghi.myshopify.com"===Shopify.shop?t.product_id==e.id:t.handle===e.handle);return!t}).filter(t=>{let r=essentialFreeShippingGetVariant(e,t);return!r||r.available}).filter(e=>!CURRENT_PRODUCT||("glapru-amsterdam.myshopify.com"===Shopify.shop||"vecchio-borgo-tartufi-funghi.myshopify.com"===Shopify.shop?e.id!==CURRENT_PRODUCT.id:e.handle!==CURRENT_PRODUCT.handle))),c&&c!==l)return;let w=window.location&&window.location.pathname.includes("/cart")&&!window.location.pathname.includes("/products/");if(e.placement&&("cart-page"===e.type&&!w||"product-page"===e.type&&"all-products"===e.placement&&!window.location.pathname.includes("/products/")))return;let C=document.createElement("div");p?C.className=`free_shipping_card_wrapper_${e.id} placement_side_cart`:C.className=`free_shipping_card free_shipping_card_wrapper_${e.id}`,"cart-page"===e.type&&(C.className+=" cart_page"),p&&(C.style.display="flex");let x=document.createElement("div");x.className=`free_shipping_card_title_${e.id} h2`,null!==y?x.textContent+=cardTitleEssentialApps(e,y):x.textContent+=cardTitleEssentialApps(e,s),C.append(x);let _=document.createElement("div");_.className=`free_shipping_card_progress_${e.id}`;let v=document.createElement("div");v.className=`free_shipping_card_progress_bar_${e.id}`,v.style.width="0",_.append(v),C.append(_);let T=document.createElement("div");if(T.className=`free_shipping_products_wrapper_${e.id}`,"product-page"===e.type&&(T.className+=" product_page"),"cart-page"===e.type&&(T.className+=" cart_page"),p&&(T.className+=" side_cart"),S&&S.length>0&&"thumbprint-soap.myshopify.com"!==Shopify.shop){let E=h;if(E.length>d){T.className+=" upsell_products";let A=a(e,E);g=!0,T.append(A)}else E.length>0&&(p&&E[0]&&(E=Array(E[0])),E.forEach(t=>{let r=o(e,t);T.append(r)}));C.append(T)}else if(f&&f.length>0){if(T.className+=" upsell_products",f.length>1){let N=a(e,f,!0);g=!0,T.append(N)}else{let P=o(e,f[0],!0);T.append(P)}C.append(T)}else if(e.selectedProducts&&e.selectedProducts.length>0){let B=e.selectedProducts;if(p&&e.selectedProducts&&"kravitz2.myshopify.com"!==Shopify.shop&&(B=Array(e.selectedProducts[0])),B.length>d){T.className+=" upsell_products";let k=a(e,B,!1,!0);g=!0,T.append(k)}else B.forEach(t=>{let r=o(e,t,!1,!0);T.append(r)});C.append(T)}else C.className+=" no_products";!function e(t){let o=t.style,a=document.querySelector(`[data-id="${t.id}"]`);if(a)return;let n="gradientBackground"===o.backgroundType?`linear-gradient(${o.gradientTurn}deg, ${o.gradientStart}, ${o.gradientEnd})`:o.singleColor,p=` .free_shipping_card_wrapper_${t.id} { display: none; flex-flow: column; ${i(o)}background: ${n}; margin-top: ${o.outsideTopSpacing}px; margin-bottom: ${o.outsideBottomSpacing}px; padding: 0 16px; padding-top: ${o.insideTopSpacing}px; padding-bottom: ${o.insideBottomSpacing}px; border-radius: ${o.borderRadius}px; border: ${o.borderColor} solid ${o.borderSize}px; text-align: center; flex: auto; align-items: center; } .free_shipping_card_wrapper_${t.id}.placement_side_cart { flex: none; } .free_shipping_card_wrapper_${t.id}.placement_side_cart + .free_shipping_card_wrapper_${t.id}.placement_side_cart { display: none !important; } cart-drawer-component dialog.cart-drawer--empty .placement_side_cart { display: none !important; } .free_shipping_card_wrapper_${t.id}.cart_page { width: 100%; } .free_shipping_card_title_${t.id}.h2 { ${i(o)}font-weight: bold; font-size: ${o.titleSize}px; color: ${o.titleColor}; margin: 0; padding: 0; line-height: 1.5; letter-spacing: normal; text-transform: none; text-align: center; } .free_shipping_card_progress_${t.id} { position: relative; max-width: 620px; margin-left: auto; margin-right: auto; margin-top: 15px; width: 100%; height: 8px; background: ${o.progressBackgroundColor}; border-radius: ${o.progressBorderRadius}px; } .no_products .free_shipping_card_progress_${t.id} { margin-bottom: 6px; } .free_shipping_card_progress_bar_${t.id} { position: absolute; left: 0px; display: block !important; height: 8px; background: ${o.progressBarBackgroundColor}; transition: width 2s; border-radius: ${o.progressBorderRadius}px; } .free_shipping_products_wrapper_${t.id}.product_page { width:100%; position: relative; } .free_shipping_products_wrapper_${t.id}.cart_page { display: flex; width: 100%; padding: 0px; margin-top: 18px; justify-content: center; flex-wrap: nowrap; position: relative; } .free_shipping_products_wrapper_${t.id}.upsell_products { margin-top: 18px; max-width: 1040px; display: block; position: relative; } @media(max-width: 1260px) { .free_shipping_products_wrapper_${t.id}.cart_page > div:nth-child(3) { display: none; } } @media(max-width: 750px) { .free_shipping_products_wrapper_${t.id}.cart_page > div:nth-child(2) { display: none; } } .free_shipping_card_product_${t.id} { display: flex; padding-top: 18px; width: 100%; max-width: 620px; margin: 0 auto; min-width: 0; justify-content: center; align-items: center; } .free_shipping_card_product_${t.id}.cart_page { padding: 4px 20px; border-radius: 8px; max-width: 420px; } .free_shipping_card_product_image_${t.id} { width: 44px; height: 44px; flex-shrink: 0; object-fit: cover; cursor: pointer; border-radius: 4px; overflow: hidden; } .free_shipping_card_product_meta_${t.id} { display: block; text-align: left; height: 100%; padding: 0 8px; width: 100%; min-width: 0; } .free_shipping_card_product_title_${t.id} { font-size: ${o.productTitleSize}px; color: ${o.productTitleColor}; white-space: nowrap; overflow: hidden; cursor: pointer; text-overflow: ellipsis; line-height: 1.5; } .free_shipping_card_product_prices_wrapper_${t.id} { display: flex; gap: 4px; align-items: baseline; } .free_shipping_card_product_price_${t.id} { font-size: ${o.productPriceSize}px; color: ${o.productPriceColor}; text-overflow: ellipsis; overflow: hidden; line-height: 1.5; } .free_shipping_card_product_compare_at_price_${t.id} { ${o.productCompareAtPriceSize&&o.productCompareAtPriceColor?"":"display: none;"} font-size: ${o.productCompareAtPriceSize}px; color: ${o.productCompareAtPriceColor}; text-overflow: ellipsis; overflow: hidden; line-height: 1.5; text-decoration: line-through; } .free_shipping_card_product_cta_${t.id} { display: block; background-color: transparent; cursor: pointer !important; font-size: ${o.buttonTextSize}px; color: ${o.buttonTextColor}; border: 1px solid ${o.buttonBorderColor}; border-radius: ${o.buttonRadius}px; padding: 8px 12px; line-height: 1.2; cursor: pointer; white-space: nowrap; text-decoration: none; } .cart_page .free_shipping_card_product_${t.id} { padding: 4px 22px; } .side_cart .free_shipping_card_product_${t.id} { padding: 4px 0 !important; } .essential_product_slider_glide .free_shipping_card_product_${t.id} { padding: 0; width: 100%; margin: 0; max-width: 100%; justify-content: center; align-items: center; } @media(max-width: 420px) { .cart_page .free_shipping_card_product_${t.id} { padding: 0px; } } `;r(p,t.id)}(e),t&&("cart-page"===e.type?(document.querySelector(`.free_shipping_card_wrapper_${e.id}`)||t.prepend(C),window.freeShippingCardInitiated=!1):t.append(C),g&&(w?setTimeout(()=>{essentialFreeShippingInitSlider(e)},300):essentialFreeShippingInitSlider(e,p))),(s||f)&&null===y&&(window.freeShippingBarConfigs.threshold=!1),pollCartTotalEssentialApps(),updateTotalOnClick(e);let O=document.querySelector("cart-items-component");if("cart-page"===e.type){if("pinkblackpalermo.myshopify.com"===Shopify.shop||"essential-freshness.myshopify.com"===Shopify.shop||"1734a3-61.myshopify.com"===Shopify.shop||Shopify?.shop==="mdrvqz-i1.myshopify.com"||Shopify?.shop==="1sh0fc-r3.myshopify.com"||O)setTimeout(()=>{updateTotalOnClick(e,!0)},500);else{let R=()=>{pollCartTotalEssentialApps()};window.freeShippingBarConfigs.polling||!w||p||(setInterval(R,2e3),window.freeShippingBarConfigs.polling=!0)}}}let s=(e,t,r)=>{if(e.type!==t||r&&"custom"===e.timerPlacement)return!1;if(e.showOnCollections&&0!==e.showOnCollections.length){let i=decodeURI(window.location.pathname),o=e.showOnCollections.find(e=>i.includes(`collections/${e.handle}`));if(!o)return!1}return!0};function l(e,t){if(e.type!==t)return!1;let r=window.location&&window.location.pathname.includes("/cart")&&!window.location.pathname.includes("/products/");if(r&&"top-bar"!==e.type)return!1;if(e.showOnProducts&&0!==e.showOnProducts.length){let i=decodeURI(window.location.pathname),o=CURRENT_PRODUCT?.id,a=e.showOnProducts.find(t=>o&&("filippagourmet.myshopify.com"===Shopify.shop||"shopforoutdoors-com.myshopify.com"===Shopify.shop||new Date(e?.createdAt).getTime()>1764075671e3)?t.id.includes(o):i.includes(`products/${t.handle}`));if(!a)return!1}if(e.showOnProductsInCollections&&0!==e.showOnProductsInCollections.length){let n=window.essentialOrderValueBoosterMeta.productCollections||[],p=e.showOnProductsInCollections.find(e=>{let t=Number(e.id.split("/").pop());return n.some(e=>e.id===t)});if(!p)return!1}if(e.excludeProducts&&0!==e.excludeProducts.length){let s=decodeURI(window.location.pathname),l=e.excludeProducts.find(e=>s.includes(`products/${e.handle}`));if(l)return!1}let c=CURRENT_PRODUCT?CURRENT_PRODUCT.tags:[],d=c.map(e=>e.toLowerCase());if(e.excludeProductTags&&e.excludeProductTags.length>0){let u=e.excludeProductTags.some(e=>d.includes(e.toLowerCase()));if(u)return!1}if(e.productTags&&e.productTags.length>0){let h=e.productTags.some(e=>d.includes(e.toLowerCase()));if(!h)return!1}return!0}function c(){let e,t=window?.Shopify?.routes?.root||"/",r=document.querySelector(`form[action="${t}cart"]`),i=document.querySelectorAll("cart-notification .cart-notification__links");Shopify?.theme?.name&&Shopify?.theme?.name.toLowerCase().includes("prestige")&&(i=document.querySelectorAll("cart-drawer.cart-drawer.drawer"));let o=document.querySelectorAll(".side-cart, cart-items-component .cart-items__wrapper"),a=document.querySelector(".order-value-booster-side-cart");return a?e=a:i.length>0?e=i[i.length-1]:r?e=r:o.length>0&&(e=o[o.length-1]),e}!function o(){let a=window?.Shopify?.routes?.root||"/",n=[],d,u=document.querySelectorAll("div.order-value-booster-block"),h=document.querySelectorAll(`form[action="${a}cart/add"]`),m=document.querySelector(".essential-order-value-booster-placement"),f=document.querySelector(`form[action="${a}cart"]`),g=window.location&&window.location.pathname.includes("/cart")&&!window.location.pathname.includes("/products/");if(g&&f){let y=document.querySelectorAll(`form[action="${a}cart"]`);d=y[y.length-1]}let $=window.location&&window.location.pathname.includes("/products/");u&&u.length>0&&(n=Array.from(u).filter(e=>e&&""!==e.getAttribute("id"))),t().then(t=>{if(t&&!Array.isArray(t)||0===t.length)return null;let o=t.reduce((e,t)=>t.showInCountries&&t.showInCountries.length?[...e,...t.showInCountries]:e,[]),a=t.find(e=>e.locationType&&"on-countries"===e.locationType),u=t.filter(t=>{if(!a||!(o.length>0))return t;if("on-countries"===t.locationType){if(!e)return;return t.showInCountries.includes(e)}if(!o.includes(e))return t});u.forEach(e=>{if(e.translations&&e.translations.length>0){let t=e.translations.find(e=>e.locale===Shopify?.locale);t&&Object.assign(e,t)}}),window.freeShippingBarConfigs=u;let f=u.filter(e=>"top-bar"===e.type);f.forEach(e=>{e&&l(e,"top-bar")&&s(e,"top-bar")&&function e(t,o){let a=window?.Shopify?.currency?.active||"",n=t.currency||"";if(n&&n!==a)return;let p=document.querySelector(".essential_free_shipping_bar_wrapper");if(p)return;if(t.placement){let s=window.location.pathname;if("home-page"===t.placement&&"/"!==s||"all-products"===t.placement&&!window.location.pathname.includes("/products/")||"all-collections"===t.placement&&!window.location.pathname.includes("/collections/"))return}let l=document.createElement("div");l.className=`essential_free_shipping_bar_wrapper free_shipping_bar_wrapper_${t.id}`;try{let c=window.localStorage.getItem("freeShippingBarClosed");if((c=JSON.parse(c))&&c.id===t.id&&c.updatedAt===t.updatedAt&&c.value)return}catch(d){console.log(d)}"top-page"===t.style.position&&t.style.stickyBar&&(l.className+=" top_page"),"bottom-page"===t.style.position&&(l.className+=" bottom_page");let u=document.createElement("div");u.className+=`free_shipping_bar_title_${t.id} h2`,u.textContent+=cardTitleEssentialApps(t);let h=document.createElement("div");h.append(u);let m=document.createElement("button");m.className=`free_shipping_bar_close_button_${t.id}`,m.setAttribute("onclick",`essentialCloseFreeShippingBar("${t.id}", "${t.updatedAt}")`),m.append(function e(t){let r=document.createElementNS("http://www.w3.org/2000/svg","svg"),i=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("width",12),r.setAttribute("height",12),r.setAttribute("fill","none"),i.setAttribute("d","m7.414 6 4.293-4.293A.999.999 0 1 0 10.293.293L6 4.586 1.707.293A.999.999 0 1 0 .293 1.707L4.586 6 .293 10.293a.999.999 0 1 0 1.414 1.414L6 7.414l4.293 4.293a.997.997 0 0 0 1.414 0 .999.999 0 0 0 0-1.414L7.414 6Z"),i.setAttribute("fill",t),r.append(i),r}(t.style.closeIconColor)),l.append(h),t.closeButton&&l.append(m),function e(t){let o=t.style,a="gradientBackground"===o.backgroundType?`linear-gradient(${o.gradientTurn}deg, ${o.gradientStart}, ${o.gradientEnd})`:o.singleColor,n=` .free_shipping_bar_wrapper_${t.id} { position: relative; ${i(o)}background: ${a}; z-index: 100; display: none; width: 100%; flex-wrap: wrap; ${"seperate-centered"===o.announcementBarStyle?`flex-flow: column; justify-items: center;`:""} align-items: center; justify-content: center; padding: 10px; column-gap: 26px; row-gap: 10px; border-bottom: ${o.borderColor} solid ${o.borderSize}px; } .free_shipping_bar_wrapper_${t.id}.top_page { position: sticky; top: 0; } .free_shipping_bar_wrapper_${t.id}.bottom_page { bottom: 0; left: 0; position: fixed; width: 100%; border-bottom: none; border-top: ${o.borderColor} solid ${o.borderSize}px; } .free_shipping_bar_title_${t.id}.h2 { ${i(o)}font-weight: bold; font-size: ${o.titleSize}px; color: ${o.titleColor}; margin: 0; padding: 0; line-height: 1.2; letter-spacing: normal; text-transform: none; text-align: center; } .free_shipping_bar_close_button_${t.id} { position: absolute; display: block; border: none; background: none; padding: 6px; cursor: pointer; top: 50%; right: 10px; transform: translate(0, -50%); } .free_shipping_bar_close_button_${t.id} svg { width: 12px; height: 12px; display: block; } @media (max-width: 430px) { .free_shipping_bar_wrapper_${t.id} { justify-items: center; text-align: center; padding: 10px 15px; } .free_shipping_bar_close_button_${t.id} { position: absolute; padding: 0; transform: none; top: 5px; right: 5px; } .free_shipping_bar_title_${t.id} { text-align: center; } } `;r(n,t.id)}(t);let f=document.querySelector(".essential-free-shipping-bar");f?f.append(l):document.querySelector("body").prepend(l),pollCartTotalEssentialApps(),updateTotalOnClick(t);let g=window.location&&window.location.pathname.includes("/cart")&&!window.location.pathname.includes("/products/");if(g&&"1734a3-61.myshopify.com"!==Shopify.shop&&Shopify?.shop!=="mdrvqz-i1.myshopify.com"&&Shopify?.shop!=="1sh0fc-r3.myshopify.com"){let y=()=>{pollCartTotalEssentialApps()};!window.freeShippingBarConfigs.polling&&g&&(setInterval(y,2e3),console.log("FSB polling started"),window.freeShippingBarConfigs.polling=!0)}}(e)});let y;if(y=m||h[h.length-1],Shopify?.theme?.name&&Shopify.theme.name.toLowerCase().includes("debutify")&&!m){let b=document.querySelector("form.product-single__form"),S=document.querySelector('product-form form[action="/cart/add"]');b?y=b:S&&(y=S)}u.forEach(e=>{l(e,"product-page")&&$&&y&&"custom"!==e.placement&&0===n.length&&p(e,y)}),n.forEach(e=>{let t=e.getAttribute("id"),r=u.find(e=>e.id===t);r&&l(r,"product-page")&&e&&p(r,e)});let w=window?.Shopify?.currency?.active||"";if(c()&&!g){let C=c(),x=u.find(e=>{let t=e.currency||"";return"cart-page"===e.type&&(""===t||t===w)});if(x){"frequently-bought"===x.upsellType?window.freeShippingCardInitiated=!0:window.freeShippingCardInitiated=!1,p(x,C,!0),Shopify?.theme?.name&&Shopify?.theme?.name.toLowerCase().includes("prestige")&&C.classList&&C.classList.contains("cart-drawer")&&C.classList.contains("drawer")&&document.addEventListener("cart-drawer:refreshed",()=>{let e=c();p(x,e,!0,window.freeShippingBarConfigs.prevCartTotalPrice)});let _=new MutationObserver(e=>{if(e?.[0]?.removedNodes?.length&&e[0]?.removedNodes[0]?.className==="cart-page-inline-timer h2"||e[0]?.target?.className.includes("slider_glide")||e[0]?.target?.className.includes("free_shipping_card_title"))return;let t=document.querySelector(`.free_shipping_card_wrapper_${x.id}`),r=c();window.freeShippingCardInitiated||(t?pollCartTotalEssentialApps():(window.freeShippingBarConfigs.prevCartTotalPrice||(window.freeShippingBarConfigs.prevCartTotalPrice=1),p(x,r,!0,window.freeShippingBarConfigs.prevCartTotalPrice)))});if(!window.freeShippingBarConfigs.observer&&C){let v;v=C.parentNode.parentNode.parentNode&&"BODY"!==C.parentNode.parentNode.parentNode.tagName&&"HTML"!==C.parentNode.parentNode.parentNode.tagName?C.parentNode.parentNode.parentNode:C.parentNode.parentNode&&"BODY"!==C.parentNode.parentNode.tagName&&"HTML"!==C.parentNode.parentNode.tagName?C.parentNode.parentNode:C.parentNode,Shopify?.theme?.name&&Shopify.theme.name.toLowerCase().includes("debutify")&&x?.createdAt&&new Date(x.createdAt).getTime()>1752045717e3&&(cardDrawerNode=document.querySelector("cart-drawer"))&&(v=cardDrawerNode),Shopify?.shop==="voidsa.myshopify.com"&&(v=document.querySelector("cart-drawer.cart-drawer")),_.observe(v,{childList:!0,subtree:!0}),window.freeShippingBarConfigs.observer=!0}}}if(g){if(function e(t,r){let i=document.querySelector("cart-items-component");if(!i||window.freeShippingBarConfigs.cartPageObserver)return;let o=new MutationObserver(()=>{!function e(t,r){if(window.freeShippingBarConfigs.cartPageObserverProcessing)return;let i=window?.Shopify?.routes?.root||"/",o=document.querySelectorAll("div.order-value-booster-block"),a=Array.from(o).filter(e=>""!==e.getAttribute("id"));if(a.forEach(e=>{let r=e.getAttribute("id"),i=t.find(e=>e.id===r),o=document.querySelector(`.free_shipping_card_wrapper_${r}`);i&&!o&&p(i,e)}),a.length>0)return;let n=t.find(e=>{let t=e.currency||"";return"cart-page"===e.type&&(""===t||t===r)});if(!n)return;let s=document.querySelector(`.free_shipping_card_wrapper_${n.id}`);if(s)return;window.freeShippingBarConfigs.cartPageObserverProcessing=!0;let l=document.querySelectorAll(`form[action="${i}cart"]`),c=l[l.length-1];c&&p(n,c.parentNode,!1,window.freeShippingBarConfigs.prevCartTotalPrice),setTimeout(()=>{window.freeShippingBarConfigs.cartPageObserverProcessing=!1},100)}(t,r)});o.observe(i,{childList:!0,subtree:!0}),window.freeShippingBarConfigs.cartPageObserver=!0}(u,w),0===n.length){let T=u.find(e=>{let t=e.currency||"";return"cart-page"===e.type&&(""===t||t===w)});T&&d&&p(T,d.parentNode)}else n.forEach(e=>{let t=e.getAttribute("id"),r=u.find(e=>e.id===t);r&&e&&p(r,e)})}})}()}();