1if(customElements.get("quick-add-modal")||customElements.define("quick-add-modal",class extends ModalDialog{constructor(){super(),this.modalContent=this.querySelector('[id^="QuickAddInfo-"]')}}),!customElements.get("quick-add-opener")){class QuickAddOpener extends ModalOpener{constructor(){super();const url=new URL(this.button.dataset.productUrl.startsWith("/")?window.location.origin+this.button.dataset.productUrl:this.button.dataset.productUrl),params=url.searchParams;params.set("view","modal-quick-add"),url.search=params.toString(),this.url=url}openModal(trigger){const modal=document.querySelector(this.getAttribute("data-modal"));modal?modal.show(trigger):this.renderModal(trigger)}renderModal(trigger){this.url&&(trigger.setAttribute("aria-disabled",!0),trigger.classList.add("loading"),trigger.querySelector(".loading__spinner").classList.remove("hidden"),fetch(this.url).then(response=>response.text()).then(responseText=>{const responseHTML=new DOMParser().parseFromString(responseText,"text/html");this.productQuickAdd=responseHTML.querySelector(".section--product-modal-quick-add"),this.removeDOMElements(),this.preventDuplicatedIDs(),setTimeout(()=>{this.setHTML(this.productQuickAdd),window.Shopify&&Shopify.PaymentButton&&Shopify.PaymentButton.init(),window.ProductModel&&window.ProductModel.loadShopifyXR(),this.preventVariantURLSwitching()})}).finally(()=>{setTimeout(()=>{const modal=document.querySelector(this.getAttribute("data-modal"));modal&&modal.show(trigger),trigger.removeAttribute("aria-disabled"),trigger.classList.remove("loading"),trigger.querySelector(".loading__spinner").classList.add("hidden"),this.productInfo=this.querySelector("product-info"),this.restockButton=this.querySelector(".restock-custom-button"),this.restockJson=this.querySelector(".restock-json"),this.restockJson&&(this.restockProductInfo=JSON.parse(this.restockJson.textContent)),this.restockButton&&this.restockButton.addEventListener("click",this.bindTriggerRestockModal),typeof window._RestockRocket>"u"&&this.restockButton&&this.restockButton.classList.add("hidden")},300)}))}setHTML(html){this.modals=this.productQuickAdd.querySelectorAll("quick-add-modal, .quick-add-modal--modal");const scripts=Array.from(html.querySelectorAll("script"));this.modals.forEach(element=>{document.body.appendChild(element)}),scripts.filter(tag=>
1!tag.classList.contains("klaviyo-skip-script")).forEach(scriptTag=>{const newScriptTag=document.createElement("script");Array.from(scriptTag.attributes).forEach(attribute=>{newScriptTag.setAttribute(attribute.name,attribute.value)}),newScriptTag.appendChild(document.createTextNode(scriptTag.innerHTML)),document.body.appendChild(newScriptTag)})}removeDOMElements(){this.productQuickAdd.querySelector("quick-add-modal").classList.remove("quick-add-modal-section")}preventVariantURLSwitching(){const variantPicker=this.productQuickAdd.querySelector("variant-selects");variantPicker&&variantPicker.setAttribute("data-update-url","false")}preventDuplicatedIDs(){const sectionId=this.productQuickAdd.querySelector("quick-add-modal").dataset.section;this.productQuickAdd.innerHTML=this.productQuickAdd.innerHTML.replaceAll(sectionId,`quickadd-${sectionId}`),this.productQuickAdd.querySelectorAll("variant-selects, product-info").forEach(element=>{sectionId!=null&&(element.dataset.originalSection=sectionId)})}}customElements.define("quick-add-opener",QuickAddOpener)} 2//# sourceMappingURL=/cdn/shop/t/23/assets/quick-add.js.map?v=34714975005891932921780053309
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.