1import{Component}from"@theme/component";import{morph}from"@theme/morph";import{StandardEvents}from"@shopify/events";class LocalPickup extends Component{#activeFetch;#pickupDrawer=null;connectedCallback(){super.connectedCallback();const drawer=this.nextElementSibling instanceof HTMLElement&&this.nextElementSibling.matches("theme-drawer.pickup-drawer")?this.nextElementSibling:null;drawer&&(this.#pickupDrawer=drawer,document.body.appendChild(drawer));const closestSection=this.closest(".shopify-section, dialog"),handleProductSelect=event=>{!(event.target instanceof Element)||event.target.closest("product-card")||event.promise.then(({detail})=>{if(!detail)return;const{newProduct,resource}=detail;newProduct&&(this.dataset.productUrl=newProduct.url);const variantId=resource?resource.id:null,variantAvailable=resource?resource.available:null;variantId!==this.dataset.variantId&&(variantId&&variantAvailable?(this.removeAttribute("hidden"),this.dataset.variantId=variantId,this.#fetchAvailability(variantId)):this.setAttribute("hidden",""))}).catch(error=>{error?.name!=="AbortError"&&console.warn("[local-pickup] Event promise rejected:",error)})};closestSection?.addEventListener(StandardEvents.productSelect,handleProductSelect),this.disconnectedCallback=()=>{closestSection?.removeEventListener(StandardEvents.productSelect,handleProductSelect),this.#pickupDrawer?.remove(),this.#pickupDrawer=null}}#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}"]`);if(wrapper){this.removeAttribute("hidden"),morph(this,wrapper);const newDrawer=wrapper.nextElementSibling instanceof HTMLElement&&wrapper.nextElementSibling.matches("theme-drawer.pickup-drawer")?wrapper.nextElementSibling:null;newDrawer&&(this.#pickupDrawer?morph(this.#pickupDrawer,newDrawer):(this.#pickupDrawer=newDrawer,document.body.appendChild(this.#pickupDrawer)))}else 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/142/assets/local-pickup.js.map?v=171266039603431529201787884727
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.