1!function(){"use strict";const t="[data-store-availability-list]",e={close:".js-modal-close",open:".js-modal-open-store-availability-modal",openClass:"modal--is-active",openBodyClass:"modal--is-visible",closeModalOnClick:!1,scrollIntoView:!1};class i{constructor(t,i){if(this.modal=document.getElementById(t),!this.modal)return!1;this.nodes={parents:[document.querySelector("html"),document.body]},this.config=Object.assign(e,i),this.modalIsOpen=!1,this.focusOnOpen=this.config.focusOnOpen?document.getElementById(this.config.focusOnOpen):this.modal,this.openElement=document.querySelector(this.config.open),this.a11y=window.theme.a11y,this.init()}init(){this.openElement.addEventListener("click",this.open.bind(this)),this.modal.querySelector(this.config.close).addEventListener("click",this.closeModal.bind(this))}open(e){let i=!1;if(e?e.preventDefault():i=!0,this.modalIsOpen&&!i)return void this.closeModal();window.theme.closeAllTooltips(),this.modal.classList.add(this.config.openClass),this.nodes.parents.forEach((t=>{t.classList.add(this.config.openBodyClass)})),this.modalIsOpen=!0;const s=document.querySelector(t);document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:s})),this.config.scrollIntoView&&this.scrollIntoView(),this.bindEvents(),this.a11y.trapFocus({container:this.modal})}closeModal(){if(!this.modalIsOpen)return;document.activeElement.blur(),this.modal.classList.remove(this.config.openClass);var t=this;this.nodes.parents.forEach((function(e){e.classList.remove(t.config.openBodyClass)})),this.modalIsOpen=!1,this.openElement.focus(),this.unbindEvents(),this.a11y.removeTrapFocus({container:this.modal});document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0,detail:400}))}bindEvents(){this.keyupHandler=this.keyupHandler.bind(this),this.clickHandler=this.clickHandler.bind(this),document.body.addEventListener("keyup",this.keyupHandler),document.body.addEventListener("click",this.clickHandler)}unbindEvents(){document.body.removeEventListener("keyup",this.keyupHandler),document.body.removeEventListener("click",this.clickHandler)}keyupHandler(t){t.code===theme.keyboardKeys.ESCAPE&&this.closeModal()}clickHandler(t){!this.config.closeModalOnClick||this.modal.contains(t.target)||t.target.matches(this.config.open)||this.closeModal()}scrollIntoView(){this.focusOnOpen.scrollIntoView({behavior:"smooth"})}}class s extends HTMLElement{constructor(){super()}connectedCallback(){this.container=this.closest("[data-section-type]"),this.fetchStoreAvailabilities(this.dataset.variantId)}update(t){t?.available&&this.fetchStoreAvailabilities(t.id)}clearContent(){this.innerHTML=""}_initModal(){return new i("StoreAvailabilityModal",{close:"[data-store-availability-modal-close]",open:"[data-store-availability-modal-open]",closeModalOnClick:!0,openClass:"store-availabilities-modal--active",scrollIntoView:!1})}fetchStoreAvailabilities(t){const e=`/variants/${t}/?section_id=store-availability`;this.clearContent(),fetch(e).then((t=>t.text())).then((t=>{const e=document.querySelector("body");let i=e.querySelector("[data-store-availability-modal]");if(i&&i.remove(),this.innerHTML=t,this.innerHTML=this.firstElementChild.innerHTML,""===this.firstElementChild.innerHTML.trim())return void this.clearContent();this.querySelector("[data-store-availability-modal-open]")&&(this.modal=this._initModal(),this._updateProductTitle(),i=this.querySelector("[data-store-availability-modal]"),i&&e.appendChild(i))}))}_updateProductTitle(){this.querySelector("[data-store-availability-modal-product__title]").textContent=this.dataset.variantTitle}}customElements.get("pickup-availability")||customElements.define("pickup-availability",s)}();
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.