PageSourceSearch

https://shop.ivimhealth.com/cdn/shop/t/12/assets/component-product-form.js?v=183002867947814813321789746986

js ivimhealth.com collected 2026-09-25 02:30:04 UTC 26,975 bytes, 2 lines download raw bytes

1if(typeof ProductVariants!="function"){class ProductVariants2 extends HTMLElement{constructor(){super(),this._cachedOptions=new Map,this._loadingOptions=new Set,this._debounceTimers={},this._prefetchedUrls=new Set,this.observer=null,this.CACHE_LIMIT=100,this.init()}init(){if(this.hasAttribute("data-enable-skeleton")){const skeleton=this.closest(".has-skeleton").querySelector("[data-js-product-item-skeleton]");this.skeletonElements=[...skeleton.querySelector(".product-item__text").children],this.skeletonSettings=JSON.parse(skeleton.querySelector("[data-product-skeleton-settings]").textContent)}this._event=new Event("VARIANT_CHANGE"),this.productPage=this.closest("[data-js-product-component]"),this.productForm=document.querySelector(`#product-form-${this.dataset.id}`),this.productForm&&(this.productQty=this.productForm.querySelector("[data-js-product-quantity]"),this.addToCart=this.productForm.querySelector("[data-js-product-add-to-cart]"),this.addToCartText=this.productForm.querySelector("[data-js-product-add-to-cart-text]")),this.addEventListener("change",this.onOptionChange.bind(this));let initVariantChange=!1;if(this.hasAttribute("data-variant-required"))if(this.variantRequired=!0,this.noVariantSelectedYet=!0,this.fauxVariant=JSON.parse(this.querySelector("[data-js-variant-data]").textContent),document.location.search.includes("variant"))parseInt(new URLSearchParams(document.location.search).get("variant"))&&(this.updateCurrentVariant(),this.variantRequired=!1,this.noVariantSelectedYet=!1,initVariantChange=!0,this.classList.add("variant-selected"),this.productPage.classList.add("variant-selected"),this.querySelectorAll("[data-option-value-id][data-selected]").forEach(elm=>{elm.tagName==="OPTION"?elm.setAttribute("selected","selected"):elm.setAttribute("checked","checked")}));else{this.querySelectorAll("[disabled]").forEach(elm=>{elm.hasAttribute("data-disabled")||elm.removeAttribute("disabled")}),this.querySelectorAll(".disabled").forEach(elm=>{elm.classList.remove("disabled")}),this.querySelectorAll("[data-silent-selected]").forEach(elm=>{elm.dataset.productUrl==this.dataset.url&&(elm.removeAttribute("data-silent-selected"),elm.tagName==="OPTION"?elm.setAttribute("selected","selected"):elm.setAttribute("checked","checked"),parseInt(this.dataset.variants)==1&&(this.variantRequired=!1,this.noVariantSelectedYet=!1,this.classList.add("variant-selected"),this.productPage.classList.add("variant-selected"),initVariantChange=!0),this.checkIfSelectedVariant(),this.updateCurrentVariant())});const combination2=[];this.querySelectorAll("[data-option-value-id][data-selected]").forEach(elm=>{combination2.push(elm.dataset.optionValueId)}),this.debounceOptionLoad(combination2.join(",").replace(/,/g,"-"),1)}else this.variantRequired=!1,this.noVariantSelectedYet=!1,this.classList.add("variant-selected"),this.productPage.classList.add("variant-selected"),this.updateCurrentVariant();if(this.productStock=document.querySelector(`#product-${this.dataset.id} [data-js-variant-quantity]`),this.productStockProgress=document.querySelector(`#product-${this.dataset.id} [data-js-variant-quantity-progress]`),this.productStock&&document.querySelector(`#product-${this.dataset.id} [data-js-variant-quantity-data]`)&&this.updateStock(JSON.parse(document.querySelector(`#product-${this.dataset.id} [data-js-variant-quantity-data]`).getAttribute("data-inventory"))),initVariantChange){const combination2=[];this.querySelectorAll("[data-option-value-id][data-selected]").forEach(elm=>{combination2.push(elm.dataset.optionValueId)}),this.fetchProductUpdates(combination2.join(",").replace(/,/g,"-"),this.renderProductUpdates.bind(this),!1,!0)}new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting&&(this.getPossibleCombinations().forEach(combination2=>{this.debounceOptionLoad(combination2.join(",").replace(/,/g,"-"))}),this.querySelectorAll("[data-product-url]").forEach(elm=>{this.prefetchPage(elm.dataset.productUrl)}))})},{rootMargin:"0px",threshold:.1}).observe(this),new MutationObserver(()=>{this.getPossibleCombinations().forEach(combination2=>{this.debounceOptionLoad(combination2.join(",").replace(/,/g,"-"))}),this.querySelectorAll("[data-product-url]").forEach(elm=>{this.prefetchPage(elm.dataset.productUrl)})}).observe(this.querySelector("[data-js-variant-data]"),{attributes:!1,childList:!0,subtree:!1}),this.addEventListeners()}addEventListeners(){this.querySelectorAll("[data-option-value-id]").forEach(elm=>{elm.addEventListener("mouseover",e=>{if(e.stopPropagation(),!e.target.hasAttribute("data-selected")&&!e.target.hasAttribute("data-product-url")){const combination2=this.getSpecificCombinations(e.target,e.target.closest("[data-js-product-variant-container]"));this.debounceOptionLoad(combination2.join(",").replace(/,/g,"-"),1)}else e.target.hasAttribute("data-custom-product-url")&&this.debounceOptionLoad(combination.join(",").replace(/,/g,"-"),1,e.target.getAttribute("data-custom-product-url"))}),elm.addEventListener("touchstart",e=>{if(e.stopPropagation(),!e.target.hasAttribute("data-selected")&&!e.target.hasAttribute("data-product-url")){const combination2=this.getSpecificCombinations(e.target,e.target.closest("[data-js-product-variant-container]"));this.debounceOptionLoad(combination2.join(",").replace(/,/g,"-"),1)}else e.target.hasAttribute("data-custom-product-url")&&this.debounceOptionLoad(combination.join(",").replace(/,/g,"-"),1,e.target.getAttribute("data-custom-product-url"))})})}debounceOptionLoad(optionValuesHash,delay=20){this._debounceTimers[optionValuesHash]&&clearTimeout(this._debounceTimers[optionValuesHash]),this._debounceTimers[optionValuesHash]=setTimeout(()=>{!this._cachedOptions.has(optionValuesHash)&&!this._loadingOptions.has(optionValuesHash)&&this.preloadOption(optionValuesHash)},delay)}preloadOption(optionValuesHash){this._loadingOptions.add(optionValuesHash),this.fetchProductUpdates(optionValuesHash,html=>{this.cacheProductUpdates(html,optionValuesHash),this._loadingOptions.delete(optionValuesHash)})}prefetchPage(url){if(!this._prefetchedUrls.has(url)&&url!==window.location.pathname){const link=document.createElement("link");link.rel="prefetch",link.href=url,document.head.appendChild(link),this._prefetchedUrls.add(url)}}getSelectedOptionHash(){return[...this.querySelectorAll("select[data-js-product-variant-container], input
1:checked")].map(el=>el.dataset.optionValueId||el.selectedOptions[0]?.dataset.optionValueId).filter(value=>value!==void 0).join(",").replace(/,/g,"-")}getPossibleCombinations(){const currentSelections=[],options=[];this.querySelectorAll("[data-js-product-variant-container]").forEach(row=>{const rowOptions=[];let currentSelection=null;if(row.querySelectorAll("[data-option-value-id]").forEach(option=>{rowOptions.push(option.getAttribute("data-option-value-id")),option.hasAttribute("data-selected")&&(currentSelection=option.getAttribute("data-option-value-id"))}),currentSelection===null){console.error("No selected option found in one of the rows");return}options.push(rowOptions),currentSelections.push(currentSelection)});function generatePossibleCombinations(currentSelections2,options2){const possibleCombinations=[];for(let i=0;i<currentSelections2.length;i++){const newCombination=[...currentSelections2];options2[i].forEach(option=>{option!==currentSelections2[i]&&!this.querySelector(`[data-option-value-id="${option}"]`).hasAttribute("data-product-url")&&(newCombination[i]=option,possibleCombinations.push([...newCombination]))})}return possibleCombinations}return generatePossibleCombinations.call(this,currentSelections,options)}getSpecificCombinations(hoveredOption,hoveredRow){const newCombination=[];return this.querySelectorAll("[data-js-product-variant-container]").forEach(row=>{row===hoveredRow?newCombination.push(hoveredOption.dataset.optionValueId):newCombination.push(row.querySelector("[data-selected]").dataset.optionValueId)}),newCombination}async fetchProductUpdates(optionValuesHash,callback,checkHash=!1,force=!1,priority="auto"){try{const responseText=await(await fetch(`${this.dataset.url}${this.dataset.url.includes("?")?"&":"?"}section_id=${this.dataset.helperId}&option_values=${optionValuesHash.replace(/-/g,",")}`,{prioirty:priority})).text(),html=new DOMParser().parseFromString(responseText,"text/html");(optionValuesHash===this.currentOptionValueHash||checkHash===!1||force)&&callback(html,optionValuesHash)}catch(error){console.error(`Error fetching options ${optionValuesHash}:`,error),this._loadingOptions.delete(optionValuesHash)}}async fetchAndReloadProductItem(url,productItem){productItem.classList.add("loading");try{let responseText=await(await fetch(`${url}${url.includes("?")?"&":"?"}section_id=helper-product-item`)).text();const responseId=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`;responseText=responseText.replaceAll(/UNIQUE_ID/g,responseId);const html=new DOMParser().parseFromString(responseText,"text/html");KROWN.productItemUpdateHelper(productItem,responseId,html,{elements:this.skeletonElements,settings:this.skeletonSettings}),productItem.classList.remove("loading"),productItem.dispatchEvent(new Event("reload",{bubbles:!0}))}catch(error){console.error("Error",error),productItem.classList.remove("loading")}}async fetchAndReloadProductPage(url,productPage){productPage.classList.add("loading");try{let responseText=await(await fetch(`${url}${url.includes("?")?"&":"?"}view=quick-view`)).text();const quickViewHTML=new DOMParser().parseFromString(responseText,"text/html").querySelector("#product-quick-view");productPage.innerHTML=quickViewHTML.innerHTML,productPage.classList.remove("loading"),productPage.dispatchEvent(new Event("reload",{bubbles:!0}))}catch(error){console.error("Error",error),productPage.classList.remove("loading")}}cacheProductUpdates(html,optionValuesHash){if(this._cachedOptions.size>=this.CACHE_LIMIT){const oldestKey=this._cachedOptions.keys().next().value;this._cachedOptions.delete(oldestKey)}this._cachedOptions.set(optionValuesHash,html),this._updateCacheOrder(optionValuesHash)}_updateCacheOrder(optionValuesHash){const value=this._cachedOptions.get(optionValuesHash);this._cachedOptions.delete(optionValuesHash),this._cachedOptions.set(optionValuesHash,value)}onOptionChange(e){const variant=e.target,targetUrl=variant instanceof HTMLSelectElement?variant.selectedOptions[0].dataset.productUrl:variant.dataset.productUrl,variantId=variant.dataset.variantId,optionValuesHash=this.getSelectedOptionHash();this.currentOptionValueHash=optionValuesHash,this.addEventListeners(),targetUrl!==""&&targetUrl!==void 0&&targetUrl!==this.dataset.url?variant.hasAttribute("data-product-custom-url")||variant instanceof HTMLSelectElement&&variant.selectedOptions[0].hasAttribute("data-product-custom-url")?variant.dataset.productCustomUrl=="product"?this.fetchAndReloadProductItem(targetUrl,variant.closest("[data-js-product-item]")):this.fetchAndReloadProductPage(targetUrl,variant.closest("[data-js-product-page]")):window.location.assign(targetUrl):(this.variantRequired&&this.noVariantSelectedYet&&this.checkIfSelectedVariant(),this.noVariantSelectedYet==!1&&(this._cachedOptions.has(optionValuesHash)?(this.renderProductUpdates(this._cachedOptions.get(optionValuesHash)),this._updateCacheOrder(optionValuesHash)):this.fetchProductUpdates(optionValuesHash,this.renderProductUpdates.bind(this),!0,!1,"high"),this.updateURL(variantId)))}renderProductUpdates(html){html.querySelectorAll("[data-update-block]").forEach(elm=>{this.productPage.querySelector(`[data-update-block="${elm.dataset.updateBlock}"]`).innerHTML=elm.innerHTML}),this.updateCurrentVariant(),this.updateOptions(html.querySelectorAll("[data-main-product-variants] [data-option-value-id]")),this.productStock&&html.querySelector("[data-js-variant-quantity-data]")&&this.updateStock(JSON.parse(html.querySelector("[data-js-variant-quantity-data]").getAttribute("data-inventory"))),this.updateOutOfStockVariants(),this.updateBuyButtons(),this.dispatchEvent(this._event)}updateOptions(optionsData){optionsData.forEach(option=>{const optionElm=this.querySelector(`[data-option-value-id="${option.dataset.optionValueId}"]`);optionElm.setAttribute("data-available",option.dataset.available),optionElm.setAttribute("data-variant-id",option.dataset.variantId),option.hasAttribute("data-product-url")!=""?optionElm.setAttribute("data-product-url",option.dataset.productUrl):optionElm.removeAttribute("data-product-url"),option.hasAttribute("data-selected")?(optionElm.setAttribute("data-selected",""),optionElm.setAttribute(`${optionElm instanceof HTMLOptionElement?"selected":"checked"}`,"")):(optionElm.removeAttribute("data-selected"),optionElm.removeAttribute(`${optionElm instanceof HTMLOptionElement?"selected":"checked"}`,"")),this.dataset.unavailableVariants!="show"&&option.dataset.available=="false"&&!optionElm.hasAttribute("data-product-url")?optionElm.setAttribute("disabled","disabled"):optionElm.hasAttribute("data-disabled")||optionElm.removeAttribute("disabled"),option.dataset.available=="true"?optionElm instanceof HTMLOptionElement||(optionElm.classList.remove("disabled"),optionElm.closest(".product-variant__item").classList.remove("disabled")):optionElm.hasAttribute("data-product-url")||optionElm instanceof HTMLOptionElement||(optionElm.classList.add("disabled"),optionElm.closest(".product-variant__item").classList.add("disabled"))})}updateBuyButtons(){this.productForm&&(!this.currentVariant||!this.currentVariant.available?(this.productQty&&(this.productQty.style.display="none"),this.addToCart.classList.add("disabled"),this.productForm.classList.add("disabled-cart"),this.addToCartText.textContent=KROWN.settings.locales.products_sold_out_variant):(this.productQty&&(this.productQty.style.display=""),this.addToCart.classList.remove("disabled"),this.productForm.classList.remove("disabled-cart"),this.addToCartText.textContent=this.hasAttribute("data-show-bundle-wording")?KROWN.settings.locales.products_add_to_bundle_button:this.addToCartText.hasAttribute("data-show-preorder-wording")?KROWN.settings.locales.products_preorder_button:KROWN.settings.locales.products_add_to_cart_button),this.currentVariant?this.productForm.classList.remove("unavailable-variant"):(this.productForm.classList.add("unavailable-variant"),this.addToCartText.textContent=this.variantRequired&&this.noVariantSelectedYet?KROWN.settings.locales.products_variant_required:KROWN.settings.locales.products_unavailable_variant))}updateCurrentVariant(){this.currentVariant=JSON.parse(this.querySelector("[data-js-variant-data]").textContent),this.currentVariant==null&&(this.currentVariant=!1)}updateStock(productStockData){if(this.productStock){if(!this.currentVariant)this.productStock&&(this.productStock.innerHTML="");else if(this.productStock&&productStockData[0]){let currentVariant=productStockData[0];if(this.productStock.innerHTML="",currentVariant&&(currentVariant.quantity<=0?currentVariant.inventory=="continue"?(this.productStock.innerHTML=KROWN.settings.locales.products_preorder,this.productStock.setAttribute("data-stock","pre-order")):currentVariant.inventory=="deny"&&(this.productStock.innerHTML=KROWN.settings.locales.products_no_products,this.productStock.setAttribute("data-stock","out-of-stock")):currentVariant.quantity=="1"?(this.productStock.innerHTML=KROWN.settings.locales.products_one_product,this.productStock.setAttribute("data-stock","one-item-stock")):currentVariant.quantity<=parseInt(this.productStock.dataset.lowStock)?(this.productStock.innerHTML=KROWN.settings.locales.products_few_products.replace("{{ count }}",currentVariant.quantity),this.productStock.setAttribute("data-stock","little-stock")):currentVariant.unavailable?(this.productStock.innerHTML=KROWN.settings.locales.products_no_products,this.productStock.setAttribute("data-stock","out-of-stock")):currentVariant.quantity>parseInt(this.productStock.dataset.lowStock)&&this.productStock.dataset.type=="always"?(this.productStock.innerHTML=KROWN.settings.locales.products_many_products.replace("{{ count }}",currentVariant.quantity),this.productStock.setAttribute("data-stock","in-stock")):!currentVariant.quantity&&this.productStock.dataset.type=="always"&&(this.productStock.innerHTML=KROWN.settings.locales.products_enough_products,this.productStock.setAttribute("data-stock","in-stock")),this.productStockProgress)){let progressQty=0;currentVariant.quantity<=0&&currentVariant.inventory=="continue"||typeof currentVariant.quantity>"u"?progressQty=parseInt(this.productStock.dataset.highStock):currentVariant.quantity>0&&(progressQty=currentVariant.quantity),progressQty>=parseInt(this.productStock.dataset.highStock)?this.productStockProgress.style.width="100%":this.productStockProgress.style.width=`${100*progressQty/parseInt(this.productStock.dataset.highStock)}%`}}}}updateOutOfStockVariants(){this.querySelectorAll("[data-js-product-variant]").forEach(variant=>{let allDisabled=!0;variant.classList.remove("product-variant--all-disabled"),variant.querySelector(".product-variant__out-of-stock")?.classList.add("hide"),variant.querySelector(".product-variant__out-of-stock")?.setAttribute("aria-hidden","true"),variant.querySelectorAll(".product-variant-value").forEach(variantInput=>{variantInput.hasAttribute("disabled")||variantInput.classList.contains("disabled")||(allDisabled=!1)}),allDisabled&&(variant.classList.add("product-variant--all-disabled"),variant.querySelector(".product-variant__out-of-stock")?.classList.remove("hide"),variant.querySelector(".product-variant__out-of-stock")?.removeAttribute("aria-hidden"))})}updateURL(variantId=""){!this.hasAttribute("data-no-history")&&variantId!==""&&window.history.replaceState({},"",`${this.dataset.url}?variant=${variantId}`)}checkIfSelectedVariant(){this.options=[],this.querySelectorAll("[data-js-product-variant-container]").forEach(elm=>{elm.dataset.jsProductVariantContainer=="radio"?elm.querySelectorAll(".product-variant__input").forEach(el=>{el.checked&&this.options.push(el.value)}):this.variantRequired&&elm.selectedIndex==0||this.options.push(elm.value)}),this.variantRequired&&this.noVariantSelectedYet&&this.options.length>=parseInt(this.dataset.variants)&&(this.noVariantSelectedYet=!1,this.classList.add("variant-selected"),this.productPage.classList.add("variant-selected"))}}typeof customElements.get("product-variants")>"u"&&customElements.define("product-variants",ProductVariants2)}if(typeof ProductForm!="function"){class ProductForm2 extends HTMLElement{constructor(){super(),this.init()}init(){if(this.cartType=this.hasAttribute("data-ajax-cart")?"ajax":"page",(!document.body.classList.contains("template-cart")||this.hasAttribute("data-force-form"))&&(this.form=this.querySelector("form"),this.form.addEventListener("submit",this.onSubmitHandler.bind(this)),this.ADD_TO_CART=new Event("add-to-cart")),document.body.classList.contains("touchevents")){const submitButton=this.querySelector('[type="submit"]');submitButton&&submitButton.addEventListener("touchend",e=>{})}}onSubmitHandler(e){e.preventDefault();const submitButton=this.querySelector('[type="submit"]');submitButton.classList.add("working");const body=this._serializeForm(this.form);let alert="";fetch(`${KROWN.settings.routes.cart_add_url}.js`,{body,headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},method:"POST"}).then(response=>response.json()).then(response=>response.status==422?(alert=document.createElement("span"),alert.className="alert alert--error",typeof response.description=="str
1ing"?alert.innerHTML=response.description:alert.innerHTML=response.message,this.cartType=="page"?(document.getElementById("product-page-form-error-cart-alert")&&document.getElementById("product-page-form-error-cart-alert").remove(),alert.style.marginTop="1em",alert.style.marginBottom="0",alert.id="product-page-form-error-cart-alert",this.form.parentElement.append(alert),!1):fetch("?section_id=helper-cart")):this.cartType=="page"?(document.location.href=KROWN.settings.routes.cart_url,!1):fetch("?section_id=helper-cart")).then(response=>response.text()).then(text=>{const sectionInnerHTML=new DOMParser().parseFromString(text,"text/html"),cartFormInnerHTML=sectionInnerHTML.getElementById("AjaxCartForm").innerHTML,cartSubtotalInnerHTML=sectionInnerHTML.getElementById("AjaxCartSubtotal").innerHTML;if(document.getElementById("AjaxCartForm")){const cartItems=document.getElementById("AjaxCartForm");cartItems.innerHTML=cartFormInnerHTML,cartItems.ajaxifyCartItems(),alert!=""&&document.getElementById("AjaxCartForm").querySelector("form").prepend(alert),document.getElementById("AjaxCartSubtotal").innerHTML=cartSubtotalInnerHTML,document.querySelectorAll("[data-header-cart-count]").forEach(elm=>{elm.textContent=document.querySelector("#AjaxCartForm [data-cart-count]").textContent}),document.querySelectorAll("[data-header-cart-total").forEach(elm=>{elm.textContent=document.querySelector("#AjaxCartForm [data-cart-total]").textContent})}this.dispatchEvent(this.ADD_TO_CART),document.getElementById("screen-reader-info")&&(document.getElementById("screen-reader-info").innerText=`${KROWN.settings.locales.cart_announcement}`,setTimeout(()=>{document.getElementById("screen-reader-info").innerText=""},1e3))}).catch(e2=>{console.log(e2)}).finally(()=>{submitButton.classList.remove("working")})}_serializeForm(form){let arr=[];return Array.prototype.slice.call(form.elements).forEach(function(field){if(!(!field.name||field.disabled||["file","reset","submit","button"].indexOf(field.type)>-1)){if(field.type==="select-multiple"){Array.prototype.slice.call(field.options).forEach(function(option){option.selected&&arr.push(encodeURIComponent(field.name)+"="+encodeURIComponent(option.value))});return}["checkbox","radio"].indexOf(field.type)>-1&&!field.checked||arr.push(encodeURIComponent(field.name)+"="+encodeURIComponent(field.value))}}),arr.join("&")}}typeof customElements.get("product-form")>"u"&&customElements.define("product-form",ProductForm2)}if(typeof ProductRecommendations!="function"){class ProductRecommendations2 extends HTMLElement{constructor(){super();const SUCCESS=new Event("product-recommendations-loaded"),FAIL=new Event("product-recommendations-error"),handleIntersection=(entries,observer)=>{entries[0].isIntersecting&&(observer.unobserve(this),fetch(this.dataset.url).then(response=>response.text()).then(text=>{const innerHTML=new DOMParser().parseFromString(text,"text/html").querySelector("product-recommendations");
1innerHTML&&innerHTML.querySelectorAll("[data-js-product-item]").length>0?(this.innerHTML=innerHTML.innerHTML,this.querySelectorAll("form").forEach(elm=>{elm.querySelector("template")&&elm.append(elm.querySelector("template").content.cloneNode(!0))}),this.dispatchEvent(SUCCESS)):this.dispatchEvent(FAIL)}).catch(e=>{this.dispatchEvent(FAIL)}))};new IntersectionObserver(handleIntersection.bind(this),{rootMargin:"0px 0px 400px 0px"}).observe(this)}}typeof customElements.get("product-recommendations")>"u"&&customElements.define("product-recommendations",ProductRecommendations2)}if(typeof GiftCardRecipient!="function"){class GiftCardRecipient2 extends HTMLElement{constructor(){super();const properties=Array.from(this.querySelectorAll('[name*="properties"]')),checkboxPropertyName="properties[__shopify_send_gift_card_to_recipient]";this.recipientCheckbox=properties.find(input=>input.name===checkboxPropertyName),this.recipientOtherProperties=properties.filter(input=>input.name!==checkboxPropertyName),this.recipientFieldsContainer=this.querySelector(".gift-card-recipient__fields"),this.recipientCheckbox&&this.recipientCheckbox.addEventListener("change",this.synchronizeProperties.bind(this)),this.synchronizeProperties()}synchronizeProperties(){this.recipientOtherProperties.forEach(property=>property.disabled=!this.recipientCheckbox.checked),this.recipientFieldsContainer.classList.toggle("hide",!this.recipientCheckbox.checked)}}typeof customElements.get("gift-card-recipient")>"u"&&customElements.define("gift-card-recipient",GiftCardRecipient2)}if(typeof StickyAddToCart!="function"){class StickyAddToCart2 extends HTMLElement{constructor(){super();const productPage=document.getElementById(this.dataset.id);this.hasAttribute("data-append-to")?document.querySelector(this.dataset.appendTo).appendChild(this):document.body.appendChild(this);const productButton=productPage.querySelector("[data-js-product-add-to-cart]"),stickyBar=this;function toggleStickyBarOnScroll(){const rect=productButton.getBoundingClientRect(),isInViewport=rect.top>=0&&rect.left>=0&&rect.bottom-80<=(window.innerHeight||document.documentElement.clientHeight)&&rect.right<=(window.innerWidth||document.documentElement.clientWidth),isMobile=window.innerWidth<728;!isMobile&&rect.top<0||isMobile&&!isInViewport?stickyBar.classList.add("visible"):stickyBar.classList.remove("visible")}if(window.addEventListener("scroll",toggleStickyBarOnScroll),toggleStickyBarOnScroll(),this.hasAttribute("data-single")){const stickyButton=this.querySelector("button[data-js-atc]");stickyButton.addEventListener("click",()=>{productButton.click(),stickyButton.classList.add("working")}),new MutationObserver(()=>{productButton.classList.contains("working")?stickyButton.classList.add("working"):stickyButton.classList.remove("working")}).observe(productButton,{attributes:!0,childList:!1,subtree:!1})}else this.querySelector("button[data-js-choose]").addEventListener("click",()=>{productButton.scrollIntoView({behavior:"smooth",block:"center"})})}}typeof customElements.get("sticky-add-to-cart")>"u"&&customElements.define("sticky-add-to-cart",StickyAddToCart2)}if(typeof PickupAvailabilityWidget!="function"){class PickupAvailabilityWidget2 extends HTMLElement{constructor(){if(super(),this.querySelector("template")){const pickupSidebar=this.querySelector("template").content.firstElementChild.cloneNode(!0);pickupSidebar.id=`site-availability-sidebar-${this.dataset.id}`,document.body.append(pickupSidebar);const openSidebarButton=this.querySelector(".pickup-availability-widget__more");openSidebarButton.setAttribute("aria-controls",pickupSidebar.id),openSidebarButton.setAttribute("aria-expanded","false"),this.querySelector("[data-js-open-site-availability-sidebar]").addEventListener("click",e=>{pickupSidebar.show()});const observer=new MutationObserver(()=>{pickupSidebar.remove(),observer.disconnect()});observer.observe(this.parentElement,{attributes:!1,childList:!0,subtree:!1})}this.querySelectorAll(".pickup-availability-widget__location-view").forEach(elm=>{elm.addEventListener("click",()=>{document.getElementById(`${elm.getAttribute("aria-controls")}`)?.classList.toggle("opened"),elm.setAttribute("aria-selected",elm.getAttribute("aria-selected")=="true"?"false":"true")})})}}typeof customElements.get("pickup-availability-widget")>"u"&&customElements.define("pickup-availability-widget",PickupAvailabilityWidget2)}
2//# sourceMappingURL=/cdn/shop/t/12/assets/component-product-form.js.map?v=183002867947814813321789746986

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.