https://shop.ivimhealth.com/cdn/shop/t/12/assets/component-pickup-…?v=177086145694380957371789746986
1if(typeof PickupAvailabilityCompact!="function"){class PickupAvailabilityCompact2 extends HTMLElement{constructor(){if(super(),this.classList.add("active"),this.storeSelector=document.querySelector("store-selector[data-main-selector]"),this.storeSelector){const STORE_CHANGED_EVENT=()=>{this.fetchAvailability(this.dataset.variantId,!0)};this.storeSelector.addEventListener("storechanged",STORE_CHANGED_EVENT);const observer=new MutationObserver(()=>{this.storeSelector.removeEventListener("storechanged",STORE_CHANGED_EVENT),observer.disconnect()});observer.observe(this.parentElement,{attributes:!1,childList:!0,subtree:!1})}if(this.hasAttribute("data-static"))this.fetchAvailability(this.dataset.variantId);else{const widgetIntersection=(entries,observer)=>{entries[0].isIntersecting&&(observer.unobserve(this),this.fetchAvailability(this.dataset.variantId))};new IntersectionObserver(widgetIntersection.bind(this),{rootMargin:"0px 0px 50px 0px"}).observe(this)}}fetchAvailability(variantId,forceFetch=!1){const pickupAvailabilityData=this.querySelector("[data-js-pickup-availability-data]");if(pickupAvailabilityData&&!forceFetch)this.renderPreview(pickupAvailabilityData);else{const variantSectionUrl=`${this.dataset.baseUrl.endsWith("/")?this.dataset.baseUrl:`${this.dataset.baseUrl}/`}variants/${variantId}/?section_id=helper-pickup-availability-compact`;fetch(variantSectionUrl).then(response=>response.text()).then(text=>{const sectionInnerHTML=new DOMParser().parseFromString(text,"text/html").querySelector(".shopify-section");this.renderPreview(sectionInnerHTML)}).catch(e=>{console.log(e)})}}renderPreview(sectionInnerHTML){const selectedStore=localStorage.getItem("selected-store");if(this.storeSelector&&selectedStore&&this.storeSelector.storesList[selectedStore]){let storeFound=!1;selectedStore&§ionInnerHTML.querySelectorAll(".pickup-availability-alert").forEach(elm=>{selectedStore==elm.dataset.store&&(this.innerHTML=elm.innerHTML.replace("{{ store }}",this.storeSelector.storesList[selectedStore]),storeFound=!0)}),storeFound||(this.innerHTML=sectionInnerHTML.querySelector(".pickup-availability-alert[data-default-unavailable]").innerHTML.replace("{{ store }}",this.storeSelector.storesList[selectedStore]),storeFound=!0),(!selectedStore||!storeFound)&&(this.innerHTML="")}else this.innerHTML=sectionInnerHTML.querySelector(".pickup-availability-alert[data-default-store]").innerHTML}}typeof customElements.get("pickup-availability-compact")>"u"&&customElements.define("pickup-availability-compact",PickupAvailabilityCompact2)} 2//# sourceMappingURL=/cdn/shop/t/12/assets/component-pickup-availability.js.map?v=177086145694380957371789746986
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.