1import{Component}from"@theme/component";import{morph}from"@theme/morph";import{ThemeEvents}from"@theme/events";class LocalPickup extends Component{#activeFetch;connectedCallback(){super.connectedCallback();const closestSection=this.closest(".shopify-section, dialog"),variantUpdated=event=>{event.detail.data.newProduct&&(this.dataset.productUrl=event.detail.data.newProduct.url);const variantId=event.detail.resource?event.detail.resource.id:null,variantAvailable=event.detail.resource?event.detail.resource.available:null;variantId!==this.dataset.variantId&&(variantId&&variantAvailable?(this.removeAttribute("hidden"),this.dataset.variantId=variantId,this.#fetchAvailability(variantId)):this.setAttribute("hidden",""))};closestSection?.addEventListener(ThemeEvents.variantUpdate,variantUpdated),this.disconnectedCallback=()=>{closestSection?.removeEventListener(ThemeEvents.variantUpdate,variantUpdated)}}#createAbortController(){return this.#activeFetch&&this.#activeFetch.abort(),this.#activeFetch=new AbortController,this.#activeFetch}#fetchAvailability=variantId=>{if(!variantId)return;const abortController=this.#createAbortController(),url=this.dataset.productUrl;fetch(`${url}?variant=${variantId}§ion_id=${this.dataset.sectionId}`,{signal:abortController.signal}).then(response=>response.text()).then(text=>{if(abortController.signal.aborted)return;const wrapper=new DOMParser().parseFromString(text,"text/html").querySelector(`local-pickup[data-variant-id="${variantId}"]`);wrapper?(this.removeAttribute("hidden"),morph(this,wrapper)):this.setAttribute("hidden","")}).catch(_e=>{abortController.signal.aborted||this.setAttribute("hidden","")})}}customElements.get("local-pickup")||customElements.define("local-pickup",LocalPickup); 2//# sourceMappingURL=/cdn/shop/t/46/assets/local-pickup.js.map?v=174082968859338016381784564601
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.