PageSourceSearch

https://www.lovisa.co.uk/cdn/shop/t/811/assets/header.js?v=47070694574841030931789977862

js lovisa.co.uk collected 2026-09-26 13:25:24 UTC 47,052 bytes, 45 lines download raw bytes

1window.theme._registeredSections.header||(theme.Header=(function(){function Header(container){this.mobileNav=document.querySelector(".header__navigation"),this.header=container.querySelector(".header"),this.header.classList.contains("header--fixed")?this.isFixed=!0:this.isFixed=!1,this.mainContent;const self=this;this.isAnnouncement=!1,this.filterBarElement=document.querySelector(".collection__tabs"),this.headerElement=document.querySelector("#shopify-section-header"),this.headerElementHeight=this.headerElement?this.headerElement.getBoundingClientRect().height:0,this.categorySubnavElement=document.querySelector("#shopify-section-category-subnav"),this.categorySubnavElementHeight=this.categorySubnavElement?this.categorySubnavElement.getBoundingClientRect().height:0,this.headerHeight=this.headerElementHeight+this.categorySubnavElementHeight-2,this.isFixed&&(this.shopifyHeaderSection=stickybits("#shopify-section-header",{useStickyClasses:!0}),window.theme._sb_headerSection=this.shopifyHeaderSection,self.filterBarElement&&window.innerWidth<theme.settings.grid_medium&&(this.filterBar=stickybits(".collection__tabs",{stickyBitStickyOffset:this.headerHeight,useStickyClasses:!0,useGetBoundingClientRect:!0})),self.filterBarElement&&window.innerWidth<theme.settings.grid_medium&&(self.shopifyHeaderSection=stickybits("#shopify-section-header",{useStickyClasses:!0}),window.theme._sb_headerSection=this.shopifyHeaderSection),window.addEventListener("scroll",function(){self.filterBarElement&&window.innerWidth<theme.settings.grid_medium&&(self.shopifyHeaderSection=stickybits("#shopify-section-header",{useStickyClasses:!0}),window.theme._sb_headerSection=this.shopifyHeaderSection)}),window.addEventListener("resize",()=>{self.shopifyHeaderSection&&self.shopifyHeaderSection.cleanup(),self.shopifyHeaderSection=stickybits("#shopify-section-header",{useStickyClasses:!0}),window.theme._sb_headerSection=this.shopifyHeaderSection}),window.addEventListener("collection:rendered",()=>{self.shopifyHeaderSection&&self.shopifyHeaderSection.cleanup(),self.shopifyHeaderSection=stickybits("#shopify-section-header",{useStickyClasses:!0}),window.theme._sb_headerSection=this.shopifyHeaderSection})),window.addEventListener("resize",function(){window.innerWidth>theme.settings.grid_large&&bodyScrollLock.clearAllBodyScrollLocks(),self.filterBarElement&&(window.innerWidth<theme.settings.grid_medium?this.filterBar=stickybits(".collection__tabs",{stickyBitStickyOffset:this.headerHeight,useStickyClasses:!0,useGetBoundingClientRect:!0}):this.filterBar&&this.filterBar.cleanup())});var btnMenuToggles=container.querySelectorAll(".hamburger--toggle");Array.from(btnMenuToggles).forEach(btnMenuToggle=>{btnMenuToggle.addEventListener("click",this.btnMenuToggleHandler.bind(self))}),this.bindKeyboardEvents(),document.addEventListener("click",function(event){const nav=document.querySelector(".header__navigation"),btnMenuToggle=document.querySelector(".hamburger--toggle"),body=document.body,isClickInsideNav=nav.contains(event.target),isClickOnToggle=btnMenuToggle.contains(event.target),announcementSection=document.getElementById("shopify-section-announcement"),isClickInsideAnnouncement=!!(announcementSection&&announcementSection.contains(event.target));!isClickInsideNav&&!isClickOnToggle&&!isClickInsideAnnouncement&&body.classList.contains("menu-is-expanded")&&(body.classList.remove("menu-is-expanded"),btnMenuToggle.setAttribute("aria-expanded","false"),bodyScrollLock.enableBodyScroll(nav))});var btnSearch=container.querySelector(".header__btn--search");$(document).on("keydown:escape",function(e){e.preventDefault(),e.stopPropagation(),theme.SearchApp.hideModal(),self.btnMenuClickCloseHandler(),self.collapseDropdown()}),btnSearch.addEventListener("click",function(evt){theme.SearchApp.toggleModal(),self.btnMenuClickCloseHandler(),self.collapseDropdown(),evt.currentTarget.setAttribute("aria-expanded",evt.currentTarget.getAttribute("aria-expanded")==="false"?"true":"false")}),document.querySelectorAll("#nav--two").forEach(function(ul2){ul2.querySelectorAll("li.has-child").length>4&&ul2.querySelectorAll("li.has-child").forEach(function(li){li.classList.add("moreThanFour")})});let banner;if(theme.template.name==="index"){const firstSection=document.querySelector("#MainContent .shopify-section");firstSection.classList.contains("hero-slider-section")&&(banner=firstSection)}else banner=document.querySelector(".banner:not(.banner--no-image)");var menuDropdowns=document.querySelectorAll(".header__navigation--mobile .nav__dropdown");menuDropdowns&&menuDropdowns.forEach(menuDropdown=>{menuDropdown.addEventListener("click",function(event){event.stopPropagation()})});var navHeading=".header__navigation li h5";theme.CurrencySwitcher.switchCurrency(navHeading,!0);var navlinks=".header__navigation li a span";theme.CurrencySwitcher.switchCurrency(navlinks,!0);const mobileCheck=function(){let check=!1;return(function(a){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
1sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))&&(check=!0)})(navigator.userAgent||navigator.vendor||window.opera),check},gtaNavlinks=document.querySelectorAll(".nav-image-gta-el");gtaNavlinks&&gtaNavlinks.forEach(function(navlink){navlink.addEventListener("click",function(el){let item_image_alt=null,item_image_src=null;mobileCheck()?(item_image_alt=this.dataset.item_image_alt_mobile,item_image_src=this.dataset.item_image_src_mobile):(item_image_alt=this.dataset.item_image_alt_desktop,item_image_src=this.dataset.item_image_src_desktop);const menuNavEventData={event:"menu_navigation_action",interaction_type:"Click",interaction_element:this.dataset.interaction_element,menu_navigation_state:{item_name:this.dataset.item_name,item_hostname:this.dataset.hostname,item_pathname:this.dataset.item_pathname,item_level:this.dataset.item_level,item_image_alt,item_image_src}};window.ga4NavigationClick=menuNavEventData,window.pushEvent(menuNavEventData),localStorage.setItem("ga4-navigationClick",JSON.stringify(window.ga4NavigationClick))})})}return Header.prototype.collapseDropdown=function(){var activeDropdowns=this.header.querySelectorAll(".nav__item.has-child.is-expanded");activeDropdowns.forEach(function(el){el&&el.classList.remove("is-expanded")})},Header.prototype.btnMenuClickOpenHandler=function(){document.body.classList.add("menu-is-expanded")},Header.prototype.btnMenuClickCloseHandler=function(){document.body.classList.remove("menu-is-expanded")},Header.prototype.bindKeyboardEvents=function(){var self=this;$(document).on("keydown:escape",function(e){self.navLinkClose(e)}),document.querySelectorAll(".nav__item--toggle").forEach(el=>{el.addEventListener("keydown",e=>{(e.key==="Enter"||e.key==="Space")&&el.parentElement&&el.parentElement.classList.contains("has-child")&&(e.preventDefault(),e.stopPropagation(),self.navLinkClickHandler(e))}),el.addEventListener("focus",e=>{self.navLinkClose(e)})})},Header.prototype.syncMobileDrawerOffset=function(){if(!(!this.mobileNav||window.innerWidth>=Number(theme.settings.grid_medium))){var headerSection=document.getElementById("shopify-section-header")||this.container,bottom=Math.max(Math.round(headerSection.getBoundingClientRect().bottom),0);this.mobileNav.style.setProperty("--mobile-drawer-top",bottom+"px")}},Header.prototype.bindDrawerOffsetResync=function(){if(!this.drawerOffsetResyncBound){this.drawerOffsetResyncBound=!0;var self=this;window.addEventListener("resize",function(){document.body.classList.contains("menu-is-expanded")&&self.syncMobileDrawerOffset()})}},Header.prototype.btnMenuToggleHandler=function(){const btnMenuToggles=this.container.querySelectorAll(".hamburger--toggle");document.body.classList.contains("menu-is-expanded")?(document.body.classList.remove("menu-is-expanded"),Array.from(btnMenuToggles).forEach(btnMenuToggle=>{btnMenuToggle.setAttribute("aria-expanded","false")}),bodyScrollLock.enableBodyScroll(this.mobileNav)):(document.body.classList.add("menu-is-expanded"),Array.from(btnMenuToggles).forEach(btnMenuToggle=>{btnMenuToggle.setAttribute("aria-expanded","true")}),window.innerWidth<theme.settings.grid_large&&bodyScrollLock.disableBodyScroll(this.mobileNav),this.syncMobileDrawerOffset(),this.bindDrawerOffsetResync()),theme.Announcement();var self=this;this.navLinkClickHandlerBound||(this.navLinkClickHandlerBound=this.navLinkClickHandler.bind(this)),this.navLinkCloseBound||(this.navLinkCloseBound=this.navLinkClose.bind(this));var navLinks=this.container.querySelectorAll(".nav__item--toggle");navLinks.forEach(function(el){el.addEventListener("click",self.navLinkClickHandlerBound)}),document.body.addEventListener("click",self.navLinkCloseBound),theme.SearchApp&&theme.SearchApp.isVisible&&theme.SearchApp.hideModal()},Header.prototype.navLinkClickHandler=function(event){const clientWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0),navItem=event.currentTarget.parentElement,navItemLink=event.currentTarget;var self=this;if(self.navLinkCloseBound||(self.navLinkCloseBound=self.navLinkClose.bind(self)),clientWidth>=Number(theme.settings.grid_medium)&&navItem.classList.contains("has-hover"))return!1;theme.SearchApp&&theme.SearchApp.isVisible&&theme.SearchApp.hideModal();var navLinks=document.querySelectorAll(".nav__item--toggle");if(event.preventDefault(),event.stopPropagation(),navItem.classList.contains("is-expanded"))navItem.classList.remove("is-expanded"),document.body.classList.remove("dropdown-is-active"),navLinks.forEach(el=>el.setAttribute("aria-expanded",!1)),window.theme.lastActiveElement&&(window.theme.lastActiveElement.focus(),window.theme.lastActiveElement=null),$(document).off("keydown:escape",self.navLinkCloseBound);else{window.theme.lastActiveElement=document.activeElement,navLinks.forEach(el=>el.parentElement.classList.remove("is-expanded")),navItem.classList.add("is-expanded"),document.body.classList.add("dropdown-is-active"),navItemLink.setAttribute("aria-expanded",!0);const firstDropdownItem=navItem.querySelector(".nav__dropdown a");firstDropdownItem&&firstDropdownItem.focus(),$(document).on("keydown:escape",self.navLinkCloseBound)}return!0}
1,Header.prototype.navLinkClose=function(event){(!event||!event.target||typeof event.target.closest!="function"||!event.target.closest(".header__navigation"))&&document.querySelectorAll(".nav__item.has-child.is-expanded").forEach(el=>el.classList.remove("is-expanded"))},Header.prototype.navButtonKeyHandler=function(event){const clientWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0),navItem=event.currentTarget.parentElement,siblingAnchor=navItem.childNodes[1],thisButton=event.currentTarget;if(this.navLinkCloseBound||(this.navLinkCloseBound=this.navLinkClose.bind(this)),clientWidth<Number(theme.settings.grid_medium))return!1;theme.Search&&theme.Search.isVisible&&theme.Search.hideModal();var navLinks=document.querySelectorAll(".nav__item--toggle");if(event.preventDefault(),event.stopPropagation(),navItem.classList.contains("is-expanded"))navItem.classList.remove("is-expanded"),siblingAnchor.setAttribute("aria-expanded",!1),thisButton.setAttribute("aria-expanded",!1),window.theme.lastActiveElement&&(window.theme.lastActiveElement.focus(),window.theme.lastActiveElement=null),$(document).off("keydown:escape",this.navLinkCloseBound);else{window.theme.lastActiveElement=document.activeElement,navLinks.forEach(el=>el.parentElement.classList.remove("is-expanded")),navItem.classList.add("is-expanded"),siblingAnchor.setAttribute("aria-expanded",!0),thisButton.setAttribute("aria-expanded",!0);const firstDropdownItem=navItem.querySelector(".nav__dropdown a");firstDropdownItem&&firstDropdownItem.focus(),$(document).on("keydown:escape",this.navLinkCloseBound)}return!0},Header.prototype.headerOffset=function(){var headerHeight=this.header.offsetHeight+this.header.offsetTop,mainContent=document.getElementById("MainContent");window.innerWidth>=Number(theme.settings.grid_large)?mainContent.style.paddingTop=headerHeight+"px":mainContent.style.paddingTop=0},Header.prototype.fixProductForm=function(){const formFiller=document.querySelector(".product-form__filler"),formWrapper=document.querySelector(".product-form__wrapper");if(formFiller){let topOfForm=formFiller.offsetTop;window.scrollY>=topOfForm?(formWrapper.classList.add("is-fixed"),formFiller.style.height=formWrapper.offsetHeight+"px"):(formWrapper.classList.remove("is-fixed"),formFiller.style.height="0px")}},Header.prototype.bopisStoreFinder=function(){if(!window.theme.bopis.enable)return;let bopisStoresObj={distanceUnit:window.theme.bopis.distanceUnit,selectedCountryCode:window.theme.bopis.selectedCountryCode,selectedCountryUnit:window.theme.bopis.selectedCountryUnit,defaultStoreID:window.theme.bopis.defaultStore,stores:[],closestStores:[],searchRadius:window.theme.bopis.searchRadius,defaultStoreDetails:[],maxSearchRadius:5e4,fiftyPlusRange:12756e3,fiftyPlusResultLimit:1,storeResultLimit:50,nearestResultShown:!1,bopisLocationApiURL:window.theme.bopis.locationApiURL,bopisStockApiURL:window.theme.bopis.stockApiURL,stockBuffer:window.theme.settings.bopis_onestock_buffer?window.theme.settings.bopis_onestock_buffer:-1};const hasLocationApi=!!bopisStoresObj.bopisLocationApiURL,hasStockApi=!!bopisStoresObj.bopisStockApiURL,hasShippingApi=!!window.theme.bopis.shippingStockApiURL;let stockDataString=$(".bopis-store-finder-modal").data("bopis-product-stock");const productSkuStockMap={};stockDataString&&stockDataString.split(",").forEach(pair=>{let parts=pair.split(":");if(parts.length===2){const sku=parts[0].trim(),stock=parseInt(parts[1].trim(),10);productSkuStockMap[sku]=stock}}),console.log("minicart check stock",productSkuStockMap);let noStoresMessage={showing:!1,htmlID:"no-stores-available",htmlInsertLocation:document.querySelector(".bopis-result-content-wrapper")},searchInfo={search_term:"",search_obj:"",stores:[],selected:"",defaultLocation:"",search_type:"normal",search_radius:"50km",is_fifty_plus:!1},locationSet=!1;localStorage.setItem("userGeolocation",!1);let coordinates="";switch(window.theme.store){case"US":coordinates="39.946763,-98.639272";break;case"CH":coordinates="46.818200,8.227500";break;case"EU":coordinates="48.858951,2.277020";break;case"GB":coordinates="52.355500,-1.174300";break;case"SG":coordinates="1.355758,103.863525";break;case"ZA":coordinates="-30.559500, 22.937500";break;default:coordinates="-24.994167, 134.866944"}let coord=coordinates.trim().split(","),defaultLocation={lat:Number(coord[0]),lng:Number(coord[1])};function toggleBopis(){let modal=$("[data-bopis-store-finder-modal]"),rcTriggers="[data-bopis-store-finder-trigger]",closeModalButtons="[data-close-bopis-store-finder]";
1!modal.length||!$(rcTriggers).length||($(document).on("click","[data-bopis-store-finder-trigger]",function(e){e.preventDefault(),modal.addClass("bopis-store-finder-modal--visible"),$(".bopis-store-finder-modal__content-search-result-block").removeClass("show-result"),$("body").addClass("stopScrolling"),bopisAutoload()}),$(document).on("click",closeModalButtons,function(){modal.removeClass("bopis-store-finder-modal--visible"),$(".bopis-store-finder-modal__content-search-result-block").removeClass("show-result"),$("body").removeClass("stopScrolling"),$(".bopis-search-cta").text("Search")}))}function bopisAutoload(){let _bopisStores=getBopisStoresInfo("_bopisSearchInfo");if(_bopisStores){let searchRadius=parseInt(_bopisStores.search_obj.near.distance/1e3);searchRadius=searchRadius<51?searchRadius:50,$(".bopis-address-input-box").val(_bopisStores.search_term),$(".bopis-search-result-range").val(searchRadius),$(".bopis-search--range-value").val(searchRadius),bopisStoresObj.stores=_bopisStores.stores,defaultLocation.lat=_bopisStores.defaultLocation.lat,defaultLocation.lng=_bopisStores.defaultLocation.lng,renderNearbyStoresBOPIS(defaultLocation);const rangeSlider=document.querySelector(".bopis-search-result-range"),rangeValueDisplay=document.querySelector(".bopis-search--range-value");rangeSlider&&rangeValueDisplay&&rangeSlider.addEventListener("input",function(){rangeValueDisplay.value=this.value})}}function getSkuNumber(){const skuParagraph=$("#tab-pd").find("p.product-sku");if(skuParagraph.length===0)return console.log("cannot find sku"),null;const skuAttr=skuParagraph.attr("data-sku");if(skuAttr&&skuAttr.toString().trim())return{skus:[skuAttr.toString().trim()],countryCode:window.theme.bopis.selectedCountryCode};const skuContent=skuParagraph.text(),fullText=skuContent?skuContent.toString():"";if(!fullText.startsWith("SKU"))return console.log("can not find sku number div"),null;const skuNumberString=fullText.replace(/^\s*SKU\s*[:\-]?\s*/,"").trim();return skuNumberString?{skus:[skuNumberString],countryCode:window.theme.bopis.selectedCountryCode}:null}function saveInventoryToLocal(countryCode,skusArray){const STORAGE_KEY=`_bopisShippingInventory_${countryCode}`;let storedData=localStorage.getItem(STORAGE_KEY),saveInventoryToStorage=storedData?JSON.parse(storedData):{skus:{}};skusArray&&skusArray.length&&skusArray.forEach(skuEle=>{saveInventoryToStorage.skus[skuEle.item_id]={quantity:skuEle.quantity,timestamp:Date.now()}}),localStorage.setItem(STORAGE_KEY,JSON.stringify(saveInventoryToStorage))}function getShippingInventoryFromLocal(countryCode,skusArray){const STORAGE_KEY=`_bopisShippingInventory_${countryCode}`,storedData=localStorage.getItem(STORAGE_KEY),TEN_MINUTES_IN_MS=900*1e3;let inventoryData=null;if(storedData)try{const parsedData=JSON.parse(storedData);if(skusArray&&skusArray.length&&parsedData&&parsedData.skus){let readStockData=[];skusArray.forEach(skuEle=>{parsedData.skus[skuEle]&&parsedData.skus[skuEle].timestamp&&Date.now()-parsedData.skus[skuEle].timestamp<TEN_MINUTES_IN_MS&&readStockData.push({item_id:skuEle,quantity:parsedData.skus[skuEle].quantity,timestamp:parsedData.skus[skuEle].timestamp})}),inventoryData=readStockData}else console.log("Cached inventory data is expired. Fetching new data.")}catch(e){console.error("Error parsing stored inventory data:",e)}return(!inventoryData||inventoryData.length===0)&&(inventoryData=null,console.log("No inventory data fetched.")),inventoryData}function getSfsInventoryFromApi(defaulSfsBranch,skuArray){if(!bopisStoresObj.bopisStockApiURL)return;const sfsRequestBody={aggregates:{"*":{endpoint_filter:{ids:[defaulSfsBranch]},item_filter:{ids:skuArray}}},request_name:"in_stock"};$.ajax({type:"POST",url:bopisStoresObj.bopisStockApiURL,contentType:"application/json",data:JSON.stringify(sfsRequestBody),success:function(rawResponse){let sfsResult=rawResponse;typeof rawResponse=="string"&&(sfsResult=JSON.parse(rawResponse));let sfsSkuStockStatus="";sfsResult.stocks.forEach(checkItem=>{if(checkItem){const checkStockAndBuffer=parseInt(checkItem.quantity)+bopisStoresObj.stockBuffer,checkStock=Math.max(0,checkStockAndBuffer);checkStock<=0?sfsSkuStockStatus="out-of-stock":checkStock<=2?sfsSkuStockStatus="low-stock":sfsSkuStockStatus="in-stock";return}}),displayStockStatus(sfsSkuStockStatus)},error:function(jqXHR,textStatus,errorThrown){console.error("shipping branch api failed")}})}function getStockFromSKU(){if(!window.theme.bopis.shippingStockApiURL&&!bopisStoresObj.bopisStockApiURL)return;const shippingStockQryObj=getSkuNumber(),bopisShippingStockApiURL=window.theme.bopis.shippingStockApiURL,bopisDefaultShippingBranch=window.theme.bopis.defaultShippingBranch?window.theme.bopis.defaultShippingBranch:"";if(shippingStockQryObj&&shippingStockQryObj.skus&&shippingStockQryObj.countryCode&&bopisShippingStockApiURL){let inventoryDataCache=getShippingInventoryFromLocal(shippingStockQryObj.countryCode,shippingStockQryObj.skus);if(inventoryDataCache&&inventoryDataCache.length>0){let skuStockStatusFromCache="";const skuParagraph=$("#tab-pd").find("p.product-sku");if(skuParagraph.length===0)return console.log("cannot find sku"),null;inventoryDataCache.forEach(checkItem=>{if(checkItem){const checkStock=checkItem.quantity;skuParagraph.data("shipping-stock-qty",checkStock),checkStock<=0?skuStockStatusFromCache="out-of-stock":checkStock<=2?skuStockStatusFromCache="low-stock":skuStockStatusFromCache="in-stock";return}}),shippingStockQryObj&&shippingStockQryObj.skus&&bopisDefaultShippingBranch?getSfsInventoryFromApi(bopisDefaultShippingBranch,shippingStockQryObj.skus):displayStockStatus(skuStockStatusFromCache);
1const qtySelectors=document.querySelectorAll('.quantity-selector[data-component="QuantitySelector"]');Array.from(qtySelectors).forEach(qtySelector=>{qtySelector.dispatchEvent(new CustomEvent("updateQuantity",{bubbles:!0,cancelable:!1}))})}else $.ajax({type:"POST",url:bopisShippingStockApiURL,contentType:"application/json",data:JSON.stringify(shippingStockQryObj),success:function(response){const shippingStockProcess=response.processData.map(skuItem=>({item_id:skuItem.sku,quantity:skuItem.inventoryLevels.reduce((sum,level)=>{const levelQuantitySum=(level.quantities||[]).reduce((levelSum,item)=>levelSum+(typeof item.quantity=="number"?item.quantity:0),0);return sum+levelQuantitySum},0)}));let skuStockStatus="";const skuParagraph=$("#tab-pd").find("p.product-sku");if(skuParagraph.length===0)return console.log("cannot find sku"),null;saveInventoryToLocal(shippingStockQryObj.countryCode,shippingStockProcess),shippingStockProcess.forEach(checkItem=>{if(checkItem){const checkStock=checkItem.quantity;skuParagraph.data("shipping-stock-qty",checkStock),checkStock<=0?skuStockStatus="out-of-stock":checkStock<=2?skuStockStatus="low-stock":skuStockStatus="in-stock";return}});
1const qtySelectors=document.querySelectorAll('.quantity-selector[data-component="QuantitySelector"]');Array.from(qtySelectors).forEach(qtySelector=>{qtySelector.dispatchEvent(new CustomEvent("updateQuantity",{bubbles:!0,cancelable:!1}))}),shippingStockQryObj&&shippingStockQryObj.skus&&bopisDefaultShippingBranch?getSfsInventoryFromApi(bopisDefaultShippingBranch,shippingStockQryObj.skus):displayStockStatus(skuStockStatus)},error:function(jqXHR,textStatus,errorThrown){console.error("inventory api failed")}})}}function displayStockStatus(newStatus){const $stockStatusContainer=window.theme.settings.enable_aftership_eta&&$("body").hasClass("template-product")?$(".description").find("#bopis-store--shipping-stock-status-pdp-aftership"):$("#location-result").find(".bopis-store--shipping-stock-status");if($stockStatusContainer.length===0){console.log("Stock status container not found. Check your HTML structure or selector.");return}newStatus==="in-stock"?($stockStatusContainer.removeClass("low-stock out-of-stock").addClass("hide-in-stock"),$stockStatusContainer.find(".bopis-stock-status + span").text("")):newStatus==="low-stock"?($stockStatusContainer.removeClass("hide-in-stock out-of-stock").addClass("low-stock"),$stockStatusContainer.find(".icon-stock-status circle").attr("fill","#FFA500"),$stockStatusContainer.find(".bopis-stock-status + span").text("Low stock")):newStatus==="out-of-stock"?($stockStatusContainer.removeClass("hide-in-stock low-stock").addClass("out-of-stock"),$stockStatusContainer.find(".icon-stock-status circle").attr("fill","#D2140A"),$stockStatusContainer.find(".bopis-stock-status + span").text("Out of stock")):console.log("WARN: Invalid stock status provided: "+newStatus)}function autoloadBopisUSP(){getStockFromSKU();var _bopisStores=getBopisStoresInfo("_bopisSearchInfo"),selectedStore=[],selectedStoreID=[];if(_bopisStores&&_bopisStores.selected!="")selectedStore=_bopisStores.stores.filter(function(store){if(store.id==_bopisStores.selected)return selectedStoreID.push(store.id),store});else{if(!bopisStoresObj.defaultStoreID||!bopisStoresObj.bopisLocationApiURL)return;let nearQryObj={classification:[{endpoint_type:[["store"]]}],address:{regions:{country:{code:bopisStoresObj.selectedCountryCode}}},near:{endpoint_id:bopisStoresObj.defaultStoreID,distance:bopisStoresObj.searchRadius},pagination:{start:0,limit:1}};selectedStoreID.push(bopisStoresObj.defaultStoreID),$.ajax({type:"POST",url:bopisStoresObj.bopisLocationApiURL,contentType:"application/json",data:JSON.stringify(nearQryObj),async:!1,success:function(response){const resultJson=response&&JSON.parse(response)?JSON.parse(response):{};selectedStore=resultJson.endpoints?resultJson.endpoints:[]},error:function(err){}})}let uspContent="",uspContentShortInfo="",bopis_usp_short_description=window.theme.bopis.usp_short_description?window.theme.bopis.usp_short_description:"",changeStoreText="",changeStoreContent="";const bopis_usp_ckc_unavailable_short_desc=window.theme.settings.bopis_usp_unavailable_short_desc?window.theme.settings.bopis_usp_unavailable_short_desc:"",bopis_usp_ckc_unavailable_desc=window.theme.settings.bopis_usp_unavailable_desc?window.theme.settings.bopis_usp_unavailable_desc:"",pdp_shipping_usp_desc=window.theme.settings.bopis_usp_description?window.theme.settings.bopis_usp_description:"";let isStoreCkc=!1;selectedStore.forEach(function(store){uspContentShortInfo=`${bopis_usp_short_description}`,isStoreCkc=store&&store.modules&&store.modules.ckc?store.modules.ckc:!1,uspContent=`
2          <div class="bopis-store--stock-status bopis-store--${store.id}"></div>
3          `,changeStoreText=`${store.name}`,changeStoreContent=`<div class="bopis-store--stock-status bopis-store--${store.id}"></div>`}),$(".bopis-selected-store-short-info a.bopis-change-store-cta.detail").text(changeStoreText),$(".bopis-block-wrapper .bopis-selected-store-info").html(changeStoreContent),getStoreStockStatus(selectedStoreID),$(".bopis-block-wrapper .bopis-selected-store-info").find(".bopis-store--stock-status").length>0&&!isStoreCkc?($(".bopis-block-wrapper .bopis-selected-store-short-info .bopis-selected-store-short-info-text").text(bopis_usp_ckc_unavailable_short_desc),$(".bopis-block-wrapper .bopis-selected-store-info").find(".bopis-store--stock-status").css("display","none")):$(".bopis-block-wrapper .bopis-selected-store-short-info .bopis-selected-store-short-info-text").text(uspContentShortInfo),isStoreCkc?$(".bopis-selected-store-added-info .bopis-selected-store-added-info-text").text(pdp_shipping_usp_desc):$(".bopis-selected-store-added-info .bopis-selected-store-added-info-text").text(bopis_usp_ckc_unavailable_desc)}function setNearbyStoresDetails(nearbyStores,searchInfo2){bopisStoresObj.stores=nearbyStores.endpoints,searchInfo2.stores=nearbyStores.endpoints,setBopisStoresInfo(searchInfo2,"_bopisSearchInfo"),searchInfo2.
3is_fifty_plus,renderNearbyStoresBOPIS(defaultLocation)}function getNearbyStoresDetailsBOPIS(defaultLocation2,searchTerm="",isCKCEnable=!1){if(!bopisStoresObj.bopisLocationApiURL)return;var _bopisStores=getBopisStoresInfo("_bopisSearchInfo");let nearQryObj={classification:[{endpoint_type:[["store"]]}],address:{regions:{country:{code:bopisStoresObj.selectedCountryCode}}},near:{centre_coordinates:{lat:parseFloat(defaultLocation2.lat),lon:parseFloat(defaultLocation2.lng)},distance:bopisStoresObj.searchRadius},pagination:{start:0,limit:bopisStoresObj.storeResultLimit}};isCKCEnable&&(nearQryObj={classification:[{endpoint_type:[["store"]]}],address:{regions:{country:{code:bopisStoresObj.selectedCountryCode}}},near:{centre_coordinates:{lat:parseFloat(defaultLocation2.lat),lon:parseFloat(defaultLocation2.lng)},distance:bopisStoresObj.searchRadius},modules:{ckc:!0},pagination:{start:0,limit:bopisStoresObj.storeResultLimit}}),searchInfo.search_term=searchTerm,searchInfo.defaultLocation=defaultLocation2,searchInfo.search_obj=nearQryObj,searchInfo.search_type="normal",searchInfo.is_fifty_plus=!1,searchInfo.selected=_bopisStores&&_bopisStores.selected!=""?_bopisStores.selected:"",$.ajax({type:"POST",url:bopisStoresObj.bopisLocationApiURL,contentType:"application/json",data:JSON.stringify(nearQryObj),success:function(response){const resultJson=response&&JSON.parse(response)?JSON.parse(response):{};if(resultJson&&resultJson.endpoints.length==0&&bopisStoresObj.searchRadius==bopisStoresObj.maxSearchRadius)getFiftyPlusRangeStore(defaultLocation2,searchTerm,isCKCEnable);else{const resultJson2=response&&JSON.parse(response)?JSON.parse(response):{};isCKCEnable&&searchInfo.search_obj&&searchInfo.search_obj.hasOwnProperty("modules")&&delete searchInfo.search_obj.modules,setNearbyStoresDetails(resultJson2,searchInfo)}},error:function(err){}})}function getProductMetafieldsInfo(){function stringToBoolean(value){return value==="true"?!0:value==="false"||value===""?!1:value}try{return document.querySelector(".bopis-store-finder-modal").dataset.activeSfs.split(",").map(str=>str.trim()).reduce((acc,str)=>{let[key,value]=str.split(":").map(s=>s.trim().replace(/"/g,""));return acc[key]=stringToBoolean(value),acc},{})}catch{return{}}}function getStoreStockStatus(processedStoreIds){if(!bopisStoresObj.bopisStockApiURL)return;let active_ckc=getProductMetafieldsInfo(),productSKU=document.querySelector(".bopis-store-finder-modal").dataset.bopisProductSku,storeIds=[...processedStoreIds];const isValidStoreIds=storeIds&&storeIds.length?storeIds.filter(storeId=>storeId):[];if(isValidStoreIds&&isValidStoreIds.length===0)return;let _bopisStores=getBopisStoresInfo("_bopisSearchInfo"),stockIcon='<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-stock-status" viewBox="0 0 8 8"><circle cx="4" cy="4" r="4" fill="#D2140A"/></svg>',stockQryObj={aggregates:{"*":{endpoint_filter:{ids:storeIds},item_filter:{ids:[productSKU]}}},request_name:"in_stock"};active_ckc[productSKU]==!1?storeIds.forEach(function(storeId){let stockInfo=`<div class="bopis-store--stock-status bopis-store--${storeId} shipping-only">
4              <span class="bopis-stock-status">${stockIcon}</span>
5              <span>Unavailable for Click & Collect</span></div>`,stockEl=`.bopis-store--${storeId}`;$(stockEl).html(stockInfo)}):$.ajax({type:"POST",url:bopisStoresObj.bopisStockApiURL,contentType:"application/json",data:JSON.stringify(stockQryObj),success:function(response){if(typeof response=="string")var res=JSON.parse(response);let stocks=res.stocks;storeIds.forEach(function(storeId){let currentStoreStock=[];stocks.length&&(currentStoreStock=stocks.filter(store=>store.endpoint_id==storeId));let stockQuantity=0,stockInfo=`<div class="bopis-store--stock-status bopis-store--${storeId} out-of-stock">
6                    <span class="bopis-stock-status">${stockIcon}</span>
7                    <span>Out of stock</span></div>`,stockEl=`.bopis-store--${storeId}`;currentStoreStock.length&&(stockQuantity=parseInt(currentStoreStock[0].quantity)+bopisStoresObj.stockBuffer,stockQuantity==0?stockInfo=`<div class="bopis-store--stock-status bo
7pis-store--${storeId} out-of-stock">
8                    <span class="bopis-stock-status">${stockIcon}</span>
9                    <span>Out of stock</span></div>`:stockQuantity<3?stockInfo=`<div class="bopis-store--stock-status bopis-store--${storeId} low-stock">
10                        <span class="bopis-stock-status">${stockIcon}</span>
11                        <span>Low stock</span></div>`:stockInfo=""),$(stockEl).html(stockInfo);let ckcStoreTargetSelector=`div.bopis-store--${storeId}[data-store-ckc="true"]`,ckcUnavailableTargetSelector=`div.bopis-store--${storeId}[data-store-ckc="false"]`;const $stockStatusElement=$(ckcStoreTargetSelector);$stockStatusElement.length>0?$stockStatusElement.html(stockInfo):(stockInfo=`<div class="bopis-store--stock-status bopis-store--${storeId} shipping-only">
12                        <span class="bopis-stock-status">${stockIcon}</span>
13                        <span>Unavailable for Click & Collect</span></div>`,$(ckcUnavailableTargetSelector).html(stockInfo))})},error:function(err){}})}function getFiftyPlusRangeStore(defaultLocation2,searchTerm="",isCKCEnable=!1){if(!bopisStoresObj.bopisLocationApiURL)return;let nearQryObj={classification:[{endpoint_type:[["store"]]}],address:{regions:{country:{code:bopisStoresObj.selectedCountryCode}}},near:{endpoint_id:null,centre_coordinates:{lat:defaultLocation2.lat,lng:defaultLocation2.lng},distance:bopisStoresObj.fiftyPlusRange},pagination:{start:0,limit:bopisStoresObj.fiftyPlusResultLimit}};isCKCEnable&&(nearQryObj={classification:[{endpoint_type:[["store"]]}],address:{regions:{country:{code:bopisStoresObj.selectedCountryCode}}},near:{endpoint_id:null,centre_coordinates:{lat:defaultLocation2.lat,lng:defaultLocation2.lng},distance:bopisStoresObj.fiftyPlusRange},modules:{ckc:!0},pagination:{start:0,limit:bopisStoresObj.fiftyPlusResultLimit}}),searchInfo.search_term=searchTerm,searchInfo.defaultLocation=defaultLocation2,searchInfo.search_obj=nearQryObj,searchInfo.search_type="fiftyPlus",searchInfo.is_fifty_plus=!0,$.ajax({type:"POST",url:bopisStoresObj.bopisLocationApiURL,contentType:"application/json",data:JSON.stringify(nearQryObj),success:function(response){isCKCEnable&&searchInfo.search_obj&&searchInfo.search_obj.hasOwnProperty("modules")&&delete searchInfo.search_obj.modules;const resultJson=response&&JSON.parse(response)?JSON.parse(response):{};setNearbyStoresDetails(resultJson,searchInfo)},error:function(err){}})}function renderNearbyStoresBOPIS(defaultLocation2){var _bopisStores=getBopisStoresInfo("_bopisSearchInfo"),bopisstores=_bopisStores.stores,kmRadius=_bopisStores.is_fifty_plus?bopisStoresObj.fiftyPlusRange:bopisStoresObj.searchRadius,radiusInMeters;bopisStoresObj.selectedCountryUnit==="miles"?radiusInMeters=kmRadius*1609.34:radiusInMeters=kmRadius*1e3;var closestStores=[],allStores=document.querySelectorAll(".bopis-store--address-container"),storeWrapper=document.querySelector(".bopis-result-content-wrapper"),resultcount=document.querySelector(".bopis-search-result-count"),storeContent="";allStores&&allStores.forEach(function(store){store.style.display="none"});var currentLocation=new google.maps.LatLng(defaultLocation2.lat,defaultLocation2.lng);if(bopisstores.forEach(function(store){var storeLocation=new google.maps.LatLng(store.address.coordinates.lat,store.address.coordinates.lon),currentDistance=google.maps.geometry.spherical.computeDistanceBetween(currentLocation,storeLocation),storeDetails,storeDistance;if(currentDistance<radiusInMeters){var displayDistance=bopisStoresObj.selectedCountryUnit==="miles"?(currentDistance*.000621371192).toFixed(2):(currentDistance/1e3).toFixed(2);closestStores.push({store,distance:displayDistance})}}),closestStores.length){noStoresMessage.showing&&($("#"+noStoresMessage.htmlID).hide(),noStoresMessage.showing=!1);var sortedStores=closestStores.sort(function(a,b){return parseFloat(a.distance)-parseFloat(b.distance)}),processedStoreIds=new Set;sortedStores.forEach(sortedStore=>{if(processedStoreIds.has(sortedStore.store.id))return;processedStoreIds.add(sortedStore.store.id);let{id,name,address,open}=sortedStore.store,{distance}=sortedStore,_selectedStore=_bopisStores&&_bopisStores.selected==id?" active":"";storeContent+=`
14              <div class="bopis-store--address-container${_selectedStore}" data-storeid="${id}">
15                <div class="bopis-store--address-block">
16                  <div class="bopis-store--address-block-info">
17                    <input type="radio" id="bopis-radio-store-${id}" ${_bopisStores&&_bopisStores.selected==id?"checked":""}
17 class="bopis-radio-store-address" name="store-address" value="${id}">
18                    <label for="bopis-radio-store-${id}"></label>
19                  </div>
20                  <div class="bopis-store--address-block-display">
21                    <div class="bopis-store--address-block-header">
22                      <span class="bopis-store--address-name">${name}</span>
23                      <span class="bopis-store--address-distance">${distance}${bopisStoresObj.selectedCountryUnit}</span>
24                    </div>
25                    <div class="bopis-store--address-details">
26                      <div class="bopis-store--address-info">
27                      ${address.lines}, ${address.city}, ${address.zip_code}
28                      </div>
29                    </div>
30                    ${sortedStore.store&&sortedStore.store.modules&&sortedStore.store.modules.ckc?`<div class="bopis-store--address-details-tag"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="stroke: unset;">
31                      <rect x="0.4" y="0.4" width="23.2" height="23.2" rx="11.6" stroke="#999999" stroke-width="0.8"/>
32                      <path d="M10.8215 11.6391C10.7243 11.2816 11.0905 10.9744 11.4256 11.1322L16.4532 13.4989C16.74 13.6339 16.7902 14.0208 16.5474 14.2246L12.9775 17.22C12.7347 17.4238 12.3624 17.3072 12.2792 17.0013L10.8215 11.6391Z" fill="white"/>
33                      <path fill-rule="evenodd" clip-rule="evenodd" d="M11.6262 10.5496C10.7884 10.1552 9.87307 10.9233 10.116 11.8168L11.5738 17.179C11.7817 17.9438 12.7123 18.2354 13.3195 17.726L14.6054 16.6469L15.75 18.011C15.9813 18.2866 16.3922 18.3226 16.6679 18.0913C16.9435 17.86 16.9794 17.4491 16.7482 17.1735L15.6036 15.8094L16.8893 14.7305C17.4964 14.2211 17.3709 13.2539 16.6538 12.9163L11.6262 10.5496ZM12.742 16.5096L11.4967 11.9287L15.7917 13.9506L12.742 16.5096Z" fill="#999999"/>
34                      <path fill-rule="evenodd" clip-rule="evenodd" d="M8.30161 6.34021C8.52211 6.15519 8.85085 6.18395 9.03587 6.40445L10.4892 8.1364C10.6742 8.3569 10.6454 8.68564 10.4249 8.87066C10.2044 9.05569 9.87567 9.02692 9.69065 8.80642L8.23737 7.07447C8.05235 6.85397 8.08111 6.52523 8.30161 6.34021ZM6.67563 9.38238C6.79718 9.12146 7.10723 9.00847 7.36815 9.13002L8.90552 9.84616C9.16645 9.96771 9.27943 10.2778 9.15789 10.5387C9.03635 10.7996 8.7263 10.9126 8.46537 10.791L6.928 10.0749C6.66708 9.95336 6.55409 9.6433 6.67563 9.38238ZM11.5799 5.26718C11.858 5.19279 12.1437 5.3579 12.2181 5.63597L12.6564 7.27434C12.7308 7.55241 12.5657 7.83813 12.2876 7.91251C12.0096 7.9869 11.7238 7.82179 11.6495 7.54373L11.2112 5.90535C11.1368 5.62729 11.3019 5.34157 11.5799 5.26718ZM6.60606 13.3758C6.50753 13.1053 6.64689 12.8062 6.91734 12.7076L7.98046 12.3203C8.25091 12.2218 8.55004 12.3611 8.64857 12.6316C8.74711 12.902 8.60775 13.2012 8.3373 13.2997L7.27418 13.687C7.00373 13.7856 6.7046 13.6462 6.60606 13.3758ZM15.3415 6.04583C15.5908 6.18984 15.6761 6.50862 15.5321 6.75785L14.966 7.73756C14.822 7.98679 14.5032 8.07209 14.254 7.92809C14.0047 7.78408 13.9194 7.4653 14.0634 7.21607L14.6295 6.23637C14.7735 5.98713 15.0923 5.90183 15.3415 6.04583Z" fill="#999999"/>
35                      </svg>
36                    </div>`:""}
37                <div class="bopis-store--${id}" data-store-ckc="${!!(sortedStore.store&&sortedStore.store.modules&&sortedStore.store.modules.ckc)}" ></div>
38                <div class="bopis-store--address-details-cta-block">
39                  <a href="/pages/store-locator" class="bopis-store--address-details-cta">Store details</a>
40                </div>
41              </div>
42            </div>
43          </div>
44        `,processedStoreIds.add(sortedStore.store.id)}),resultcount.innerHTML=`${closestStores.length} stores near you`,storeWrapper.innerHTML=storeContent,$("body").hasClass("template-product")&&getStoreStockStatus(processedStoreIds),$(document).on("click",".bopis-store--address-container",function(){let _selectedStoreID=$(this).data("storeid"),_bopisStores2=getBopisStoresInfo("_bopisSearchInfo");_bopisStores2.selected=_selectedStoreID,setBopisStoresInfo(_bopisStores2,"_bopisSearchInfo"),$(".bopis-store--address-container").removeClass("active"),$(".bopis-radio-store-address").prop("checked",!1).attr("checked",!1),$(this).addClass("active"),$(this).find(".bopis-radio-store-address").prop("checked",!0).attr("checked",!0)})}else{var rawRadius=bopisStoresObj.searchRadius,isMiles=bopisStoresObj.selectedCountryUnit==="miles",displayRadius=Math.floor(isMiles?rawRadius*63e-5:rawRadius/1e3),unit=isMiles?"miles":"km";resultcount.innerHTML=`${closestStores.length} stores near you`,storeWrapper.innerHTML=storeContent,noStoresMessage.htmlInsertLocation.innerHTML=`<div class="bopis-store--address-container" id="no-stores-available" style="width:100%; text-align:center;"> Apologies, no stores are available within ${displayRadius} ${unit} of your location</div>`,$("#"+noStoresMessage.htmlID).show(),noStoresMessage.showing=!0}$(".bopis-search-cta").text("Select Store"),$(".bopis-store-finder-modal--visible .bopis-store-finder-modal__content-search-result-block").addClass("show-result")}function setBopisStoresInfo(store,key){localStorage.setItem(key,JSON.stringify(store))}function getBopisStoresInfo(key){return JSON.parse(localStorage.getItem(key))}let bopisInputBox=document.querySelector(".bopis-address-input-box"),bopisAutocomplete=new google.maps.places.Autocomplete(bopisInputBox),ckcFilterEnable=!1;bopisAutocomplete.addListener("place_changed",function(){locationSet=!0;let place=bopisAutocomplete.getPlace();defaultLocation.lat=place.geometry.location.lat(),defaultLocation.lng=place.geometry.location.lng();let addcomponents=place.address_components;setBopisStoresInfo(addcomponents,"_addComponents"),getNearbyStoresDetailsBOPIS(defaultLocation,place.formatted_address,ckcFilterEnable)}),$(function(){$(".product-size-option").on("change",'input[type="radio"]',function(){setTimeout(()=>{getStockFromSKU()},100)})}),$(document).on("click",".bopis-search-cta",function(e){if(e.preventDefault(),$(".bopis-store--address-container").hasClass("active")){let _selectedStoreID=$(".bopis-store--address-container.active").data("storeid"),_bopisStores=getBopisStoresInfo("_bopisSearchInfo"),_bopisInteractionCount=localStorage.getItem("_bopisInteractionCount"),_addComponents=getBopisStoresInfo("_addComponents"),_locationData={};_addComponents&&_addComponents.filter(function(parts){(parts.types.includes("postal_code")||parts.types.includes("country"))&&(parts.types.includes("postal_code")?_locationData.zip=parts.short_name:_locationData.region=parts.short_name)}),window.pushEvent({event:"delivery_estimate_action",interaction_type:"Location Added",delivery_estimate_state:{interaction_count:_bopisInteractionCount?parseInt(_bopisInteractionCount)+1:1,option_name:"Click & Collect",location_data:_locationData}}),localStorage.setItem("_bopisInteractionCount",_bopisInteractionCount?parseInt(_bopisInteractionCount)+1:1),_bopisStores.selected=_selectedStoreID,setBopisStoresInfo(_bopisStores,"_bopisSearchInfo"),$("body").hasClass("template-product")&&autoloadBopisUSP(),window.location.pathname&&window.location.pathname==="/cart"&&theme.cartPage.refreshStockData("click-and-collect",!0),$("[data-close-bopis-store-finder]").trigger("click")}}),$(document).on("click",".bopis-use-current-location-cta",function(e){e.preventDefault(),navigator.geolocation?navigator.geolocation.getCurrentPosition(function(position){defaultLocation={lat:position.coords.latitude,lng:position.coords.longitude},localStorage.setItem("userGeolocation",!0),localStorage.setItem("userCoordinates",JSON.stringify(defaultLocation)),getNearbyStoresDetailsBOPIS(defaultLocation,"",ckcFilterEnable)}):localStorage.setItem("userGeolocation",!1)}),$(document).on("change",".bopis-search-result-range",function(e){const rawValue=parseInt(this.value),unit=bopisStoresObj.selectedCountryUnit;$(".bopis-search--range-value").val(rawValue),unit==="miles"?bopisStoresObj.searchRadius=rawValue*1609:bopisStoresObj.searchRadius=rawValue*1e3;const searchTerm=$(".bopis-address-input-box").val();getNearbyStoresDetailsBOPIS(defaultLocation,searchTerm,ckcFilterEnable)}),$(document).on("click","#myClickButton",function(e){e.preventDefault(),$(this).toggleClass("active");const _bopisStores=getBopisStoresInfo("_bopisSearchInfo"),isValidCoordinates=_bopisStores&&_bopisStores.search_obj&&_bopisStores.search_obj.near&&_bopisStores.search_obj.near.centre_coordinates?_bopisStores.search_obj.near.centre_coordinates:null,isValidCoordinatesObj=isValidCoordinates&&(isValidCoordinates.lat&&isValidCoordinates.lon||isValidCoordinates.lat&&isValidCoordinates.lng)?{lat:isValidCoordinates.lat,lng:isValidCoordinates.lon||isValidCoordinates.lng}:null;$("#myClickButton").hasClass("active")?(isValidCoordinatesObj&&getNearbyStoresDetailsBOPIS(isValidCoordinatesObj,"",!0),ckcFilterEnable=!0):(isValidCoordinatesObj&&getNearbyStoresDetailsBOPIS(isValidCoordinatesObj,"",!1),ckcFilterEnable=!1)}),toggleBopis(),$("body").hasClass("template-product")&&autoloadBopisUSP()},Header})(),window.theme.sections.register("header",theme.Header),window.theme._registeredSections.header=!0),(function(){var filterBarSticky=null;function getHeaderOffset(){var height=typeof theme.getStickyHeaderHeight=="function"?theme.getStickyHeaderHeight():0;return Math.max(height-2,0)}function initFilterBarSticky(){var filterBar=document.querySelector(".collection__tabs");if(!filterBar||window.innerWidth>=theme.settings.grid_medium){filterBarSticky&&(filterBarSticky.cleanup(),filterBarSticky=null);return}filterBarSticky&&filterBarSticky.cleanup(),filterBarSticky=stickybits(".collection__tabs",{stickyBitStickyOffset:getHeaderOffset(),use
44StickyClasses:!0,useGetBoundingClientRect:!0})}document.addEventListener("DOMContentLoaded",initFilterBarSticky),window.addEventListener("resize",initFilterBarSticky),window.addEventListener("collection:rendered",initFilterBarSticky),document.addEventListener("header:metrics-updated",initFilterBarSticky)})();
45//# sourceMappingURL=/cdn/shop/t/811/assets/header.js.map?v=47070694574841030931789977862

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.