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&&"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)&&(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"]');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?e.total_price:e.original_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),s=n?.tags||[],p=s.map(e=>e.toLowerCase()),l=r.excludeProductTags.some(e=>p.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 s=i/r.goal;s>100?s=100:0===s&&(s=2.5),a.forEach(e=>{e.style.width=`${s}%`}),n.forEach(e=>{e.style.display="flex"})}if(document.querySelector(`.free_shipping_bar_wrapper_${r.id}`)){let p=document.querySelector(`.free_shipping_bar_title_${r.id}`),l=document.querySelector(`.free_shipping_bar_wrapper_${r.id}`);p.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(document.dispatchEvent(new CustomEvent("cart:build")),"blingmyride.myshopify.com"===Shopify.shop){let t=new theme.CartDrawer;t.init();return}let r=window?.Shopify?.routes?.root||"/",i=document.querySelectorAll(`form[action="${r}cart/add"]`),o=window.location&&window.location.pathname.includes("/products/"),a=i[i.length-1];if("55c4f2-6.myshopify.com"===Shopify.shop&&(a=document.querySelector('form[data-type="add-to-cart-form"]')),!a){let n=window.freeShippingBarConfigs.find(t=>t.id===e);n&&n.createdAt&&new Date(n.createdAt).getTime()>1724239746e3&&window.location.reload();return}let s;(s=a.querySelector('button[type="submit"]'))||i.forEach(e=>{e.querySelector('button[type="submit"]')&&(a=e,s=e.querySelector('button[type="submit"]'))});let p=a.querySelector('input[name="quantity"]'),l=a.querySelector('button[name="minus"]'),d=a.querySelector('button[name="plus"]');if(!s)return;let c=document.createElement("input");if(c.setAttribute("type","hidden"),c.setAttribute("value","0"),c.setAttribute("name","quantity"),!p&&o&&"kingsmaycompany.myshopify.com"===Shopify.shop){let u=document.querySelector('input[name="quantity"]'),h=u.value;u.value=0,s.click(),u.value=h;return}if(!p){a.appendChild(c),s.click(),c.remove();return}let m=p.getAttribute("value");p.setAttribute("min",0),p.setAttribute("value",0),("18684b-47.myshopify.com"===Shopify.shop||"dedbdx-mh.myshopify.com"===Shopify.shop)&&(l.disabled=!1,l.click()),s.click(),("18684b-47.myshopify.com"===Shopify.shop||"dedbdx-mh.myshopify.com"===Shopify.shop)&&d.click(),p.setAttribute("min",1),p.setAttribute("value",m||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;let n=new Glide(`#essential_product_slider_${e.id}`,{type:"carousel",focusAt:0,gap:"callistowatches.myshopify.com"===Shopify.shop?"10":"30",peek:"callistowatches.myshopify.com"===Shopify.shop?{before:0,after:50}:0,perView:"cart-page"===e.type&&i?a:1,breakpoints:{768:{perView:"cart-page"===e.type&&i?a:1},480:{perView:1}}}),s=document.querySelectorAll(".essential_product_slider_glide__arrow");s.forEach(e=>{e.addEventListener("click",()=>{n.go(e.dataset.glideDir)})});let p=new ResizeObserver(()=>{n.update()});p.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;if(i){let s=t.variants[0].id.split("/"),p=s[s.length-1];o={id:p},a=t.image,n=100*t.price}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;let l=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 c=document.createElement("img");if(a){let u=a.split(".png").length>2,h=a.split(".jpg").length>2,m=a.split(".webp").length>1;c.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||m||u||h?c.setAttribute("src",a):c.setAttribute("src",a.replace(".jpg","_120x.jpg").replace(".png","_120x.png")),c.setAttribute("alt",t.title),c.setAttribute("onclick",`location.href = "${l}products/${t.handle}"`)}d.append(c);let f=document.createElement("div");f.className=`free_shipping_card_product_meta_${e.id}`;let g=document.createElement("div");g.className=`free_shipping_card_product_title_${e.id}`,g.textContent+=t.title,g.setAttribute("onclick",`location.href = "${l}products/${t.handle}"`);let y=document.createElement("div");y.className=`free_shipping_card_product_price_${e.id}`;let $=moneyFormatEssentialApps(e.moneyFormat,n/100);y.textContent+=$;let b=document.createElement("a");return b.className=`free_shipping_card_product_cta_${e.id}`,b.textContent+=e.buttonText,"view-product"===e.CTAType?b.setAttribute("href",`${l}products/${t.handle}`):o&&(b.setAttribute("onclick",`addToCartEssentialApps("${o.id}", "${e.id}")`),Shopify?.shop==="pugghia-1239.myshopify.com"?(b.setAttribute("onclick",`event.preventDefault(); addToCartEssentialApps("${o.id}", "${e.id}")`),b.setAttribute("href",`${l}products/${t.handle}`)):Shopify?.shop!=="limonana-6483.myshopify.com"&&b.setAttribute("href","javascript:void(0);")),f.append(g),f.append(y),d.append(f),d.append(b),d}let a=(e,t,r,i)=>{let a=`
    `,n=document.createElement("div");n.innerHTML=a;let s=n.getElementsByClassName("essential_product_slider_glide__slides")[0],p=n.getElementsByClassName("essential_product_slider_glide__arrow--left")[0],l=n.getElementsByClassName("essential_product_slider_glide__arrow--right")[0];return p.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)),s.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 s(e,t,s,p){let l=window?.Shopify?.currency?.active||"",d=e.currency||"",c;c=e?.updatedAt&&new Date(e.updatedAt).getTime()>1706182359e3?1:"product-page"===e.type||s?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),!$&&s&&("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 w=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&&w&&w.length>0)&&(h=w.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))),d&&d!==l)return;let C=window.location&&window.location.pathname.includes("/cart")&&!window.location.pathname.includes("/products/");if(e.placement&&("cart-page"===e.type&&!C||"product-page"===e.type&&"all-products"===e.placement&&!window.location.pathname.includes("/products/")))return;let S=document.createElement("div");s?S.className=`free_shipping_card_wrapper_${e.id} placement_side_cart`:S.className=`free_shipping_card free_shipping_card_wrapper_${e.id}`,"cart-page"===e.type&&(S.className+=" cart_page"),s&&(S.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,p),S.append(x);let _=document.createElement("div");_.className=`free_shipping_card_progress_${e.id}`;let T=document.createElement("div");T.className=`free_shipping_card_progress_bar_${e.id}`,T.style.width="0",_.append(T),S.append(_);let E=document.createElement("div");if(E.className=`free_shipping_products_wrapper_${e.id}`,"product-page"===e.type&&(E.className+=" product_page"),"cart-page"===e.type&&(E.className+=" cart_page"),s&&(E.className+=" side_cart"),w&&w.length>0&&"thumbprint-soap.myshopify.com"!==Shopify.shop){let v=h;if(v.length>c){E.className+=" upsell_products";let N=a(e,v);g=!0,E.append(N)}else v.length>0&&(s&&v[0]&&(v=Array(v[0])),v.forEach(t=>{let r=o(e,t);E.append(r)}));S.append(E)}else if(f&&f.length>0){if(E.className+=" upsell_products",f.length>1){let A=a(e,f,!0);g=!0,E.append(A)}else{let B=o(e,f[0],!0);E.append(B)}S.append(E)}else if(e.selectedProducts&&e.selectedProducts.length>0){let P=e.selectedProducts;if(s&&e.selectedProducts&&"kravitz2.myshopify.com"!==Shopify.shop&&(P=Array(e.selectedProducts[0])),P.length>c){E.className+=" upsell_products";let k=a(e,P,!1,!0);g=!0,E.append(k)}else P.forEach(t=>{let r=o(e,t,!1,!0);E.append(r)});S.append(E)}else S.className+=" no_products";if(!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,s=` .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; } .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_price_${t.id} { font-size: ${o.productPriceSize}px; color: ${o.productPriceColor}; text-overflow: ellipsis; overflow: hidden; line-height: 1.5; } .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(s,t.id)}(e),t&&("cart-page"===e.type?(document.querySelector(`.free_shipping_card_wrapper_${e.id}`)||t.prepend(S),window.freeShippingCardInitiated=!1):t.append(S),g&&(C?setTimeout(()=>{essentialFreeShippingInitSlider(e)},300):essentialFreeShippingInitSlider(e,s))),(p||f)&&null===y&&(window.freeShippingBarConfigs.threshold=!1),pollCartTotalEssentialApps(),updateTotalOnClick(e),"cart-page"===e.type){if("pinkblackpalermo.myshopify.com"!==Shopify.shop&&"essential-freshness.myshopify.com"!==Shopify.shop&&"1734a3-61.myshopify.com"!==Shopify.shop){let R=()=>{pollCartTotalEssentialApps()};window.freeShippingBarConfigs.polling||!C||s||(setInterval(R,2e3),window.freeShippingBarConfigs.polling=!0)}else setTimeout(()=>{updateTotalOnClick(e,!0)},500)}}let p=(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(e=>o&&"filippagourmet.myshopify.com"===Shopify.shop?e.id.includes(o):i.includes(`products/${e.handle}`));if(!a)return!1}if(e.showOnProductsInCollections&&0!==e.showOnProductsInCollections.length){let n=window.essentialOrderValueBoosterMeta.productCollections||[],s=e.showOnProductsInCollections.find(e=>{let t=Number(e.id.split("/").pop());return n.some(e=>e.id===t)});if(!s)return!1}if(e.excludeProducts&&0!==e.excludeProducts.length){let p=decodeURI(window.location.pathname),l=e.excludeProducts.find(e=>p.includes(`products/${e.handle}`));if(l)return!1}let d=CURRENT_PRODUCT?CURRENT_PRODUCT.tags:[],c=d.map(e=>e.toLowerCase());if(e.excludeProductTags&&e.excludeProductTags.length>0){let u=e.excludeProductTags.some(e=>c.includes(e.toLowerCase()));if(u)return!1}if(e.productTags&&e.productTags.length>0){let h=e.productTags.some(e=>c.includes(e.toLowerCase()));if(!h)return!1}return!0}function d(){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"),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=[],c,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"]`);c=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")&&p(e,"top-bar")&&function e(t,o){let a=window?.Shopify?.currency?.active||"",n=t.currency||"";if(n&&n!==a)return;let s=document.querySelector(".essential_free_shipping_bar_wrapper");if(s)return;if(t.placement){let p=window.location.pathname;if("home-page"===t.placement&&"/"!==p||"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 d=window.localStorage.getItem("freeShippingBarClosed");if((d=JSON.parse(d))&&d.id===t.id&&d.updatedAt===t.updatedAt&&d.value)return}catch(c){console.log(c)}"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){let y=()=>{pollCartTotalEssentialApps()};!window.freeShippingBarConfigs.polling&&g&&(setInterval(y,2e3),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"),w=document.querySelector('product-form form[action="/cart/add"]');b?y=b:w&&(y=w)}u.forEach(e=>{l(e,"product-page")&&$&&y&&"custom"!==e.placement&&0===n.length&&s(e,y)}),n.forEach(e=>{let t=e.getAttribute("id"),r=u.find(e=>e.id===t);r&&l(r,"product-page")&&e&&s(r,e)});let C=window?.Shopify?.currency?.active||"";if(d()&&!g){let S=d(),x=u.find(e=>{let t=e.currency||"";return"cart-page"===e.type&&(""===t||t===C)});if(x){"frequently-bought"===x.upsellType?window.freeShippingCardInitiated=!0:window.freeShippingCardInitiated=!1,s(x,S,!0),Shopify?.theme?.name&&Shopify?.theme?.name.toLowerCase().includes("prestige")&&S.classList&&S.classList.contains("cart-drawer")&&S.classList.contains("drawer")&&document.addEventListener("cart-drawer:refreshed",()=>{let e=d();s(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=d();window.freeShippingCardInitiated||(t?pollCartTotalEssentialApps():(window.freeShippingBarConfigs.prevCartTotalPrice||(window.freeShippingBarConfigs.prevCartTotalPrice=1),s(x,r,!0,window.freeShippingBarConfigs.prevCartTotalPrice)))});if(!window.freeShippingBarConfigs.observer&&S){let T;T=S.parentNode.parentNode.parentNode&&"BODY"!==S.parentNode.parentNode.parentNode.tagName&&"HTML"!==S.parentNode.parentNode.parentNode.tagName?S.parentNode.parentNode.parentNode:S.parentNode.parentNode&&"BODY"!==S.parentNode.parentNode.tagName&&"HTML"!==S.parentNode.parentNode.tagName?S.parentNode.parentNode:S.parentNode,Shopify?.theme?.name&&Shopify.theme.name.toLowerCase().includes("debutify")&&x?.createdAt&&new Date(x.createdAt).getTime()>1752045717e3&&(cardDrawerNode=document.querySelector("cart-drawer"))&&(T=cardDrawerNode),_.observe(T,{childList:!0,subtree:!0}),window.freeShippingBarConfigs.observer=!0}}}if(g){if(0===n.length){let E=u.find(e=>{let t=e.currency||"";return"cart-page"===e.type&&(""===t||t===C)});E&&c&&s(E,c.parentNode)}else n.forEach(e=>{let t=e.getAttribute("id"),r=u.find(e=>e.id===t);r&&e&&s(r,e)})}})}()}();