1window.Eurus.loadedScript.includes("product-cart.js")||(window.Eurus.loadedScript.push("product-cart.js"),requestAnimationFrame(()=>{document.addEventListener("alpine:init",()=>{Alpine.data("xProductCart",(wrappringVariantId,engravingVariantId)=>({loading:!1,errorMessage:!1,mainHasError:!1,buttonSubmit:"",error_message_wrapper:{},stopAction:!1,async addToCart(e,required,quickView){if(e.preventDefault(),required){var productInfo=this.$el.closest(".product-info");if(productInfo){var propertiesInput=productInfo.querySelectorAll(".customization-picker");this.stopAction=!1,propertiesInput.length&&propertiesInput.forEach(input=>{(input.required&&input.value.trim()==""||input.classList.contains("validate-checkbox"))&&(input.classList.add("required-picker"),this.stopAction=!0)})}if(this.stopAction)return!0}this.loading=!0,this.$refs.engraving_text&&engravingVariantId&&(this.$refs.engraving_text.value.trim()?this.$refs.engraving_text.hasAttribute("name")||this.$refs.engraving_text.setAttribute("name",this.$refs.text_area_name.value):this.$refs.engraving_text.hasAttribute("name")&&this.$refs.engraving_text.removeAttribute("name"));var productForm=this.$el.closest(".product-info")||this.$el.closest("form"),edt_element=productForm?productForm.querySelector(".hidden.cart-edt-properties"):null;edt_element&&(edt_element.value=edt_element.value.replace("time_to_cut_off",Alpine.store("xEstimateDelivery").noti));let formData=new FormData(this.$refs.product_form);formData.append("sections",Alpine.store("xCartHelper").getSectionsToRender().map(section=>section.id)),formData.append("sections_url",window.location.pathname),await fetch(`${Eurus.cart_add_url}`,{method:"POST",headers:{Accept:"application/javascript","X-Requested-With":"XMLHttpRequest"},body:formData}).then(reponse=>reponse.json()).then(async response=>{if(response.status=="422")typeof response.errors=="object"?(this.error_message_wrapper=response.errors,document.querySelector(".recipient-error-message").classList.remove("hidden")):(this.errorMessage=!0,this.$refs.error_message&&(this.$refs.error_message.textContent=response.description),this.$refs.error_message_mobile&&(this.$refs.error_message_mobile.textContent=response.description)),Alpine.store("xMiniCart")&&Alpine.store("xMiniCart").reLoad();else if(this.$refs.gift_wrapping_checkbox&&this.$refs.gift_wrapping_checkbox.checked&&wrappringVariantId||this.$refs.engraving_text&&engravingVariantId&&this.$refs.engraving_text.value.trim()){let additionalOptionData={items:[],sections:Alpine.store("xCartHelper").getSectionsToRender().map(section=>section.id)};this.$refs.gift_wrapping_checkbox&&this.$refs.gift_wrapping_checkbox.checked&&wrappringVariantId&&additionalOptionData.items.push({id:wrappringVariantId,quantity:1}),this.$refs.engraving_text&&engravingVariantId&&this.$refs.engraving_text.value.trim()&&additionalOptionData.items.push({id:engravingVariantId,quantity:1}),await window.fetch("/cart/add.js",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify(additionalOptionData)}).then(response2=>response2.json()).then(response2=>{document.querySelector(".recipient-error-message")&&document.querySelector(".recipient-error-message").classList.add("hidden"),this.error_message_wrapper={},Alpine.store("xQuickView")&&Alpine.store("xQuickView").show&&(Alpine.store("xQuickView").show=!1),Alpine.store("xPopup").close(),quickView&&Alpine.store("xQuickView").buttonQuickView&&Alpine.store("xQuickView").buttonQuickView.dataset.addAsBundle||!quickView&&this.$refs.product_form&&this.$refs.product_form.querySelector('[data-add-as-bundle="true"]')?document.dispatchEvent(new CustomEvent("eurus:cart:add-as-bundle")):(Alpine.store("xCartHelper").getSectionsToRender().forEach((section=>{const sectionElement=document.querySelector(section.selector);sectionElement&&response2.sections[section.id]&&(sectionElement.innerHTML=getSectionInnerHTML(response2.sections[section.id],section.selector))})),setTimeout(()=>{Alpine.store("xMiniCart").openCart()},500),Alpine.store("xCartHelper").currentItemCount=parseInt(document.querySelector("#cart-icon-bubble span").innerHTML),document.dispatchEvent(new CustomEvent("eurus:cart:items-changed")))})}else document.querySelector(".recipient-error-message")&&document.querySelector(".recipient-error-message").classList.add("hidden"),this.error_message_wrapper={},Alpine.store("xQuickView")&&Alpine.store("xQuickView").show&&(Alpine.store("xQuickView").show=!1),Alpine.store("xPopup").close(),quickView&&Alpine.store("xQuickView").buttonQuickView&&Alpine.store("xQuickView").buttonQuickView.dataset.addAsBundle||!quickView&&this.$refs.product_form&&this.$refs.product_form.querySelector('[data-add-as-bundle="true"]')?document.dispatchEvent(new CustomEvent("eurus:cart:add-as-bundle")):(Alpine.store("xCartHelper").getSectionsToRender().forEac
1h((section=>{const sectionElement=document.querySelector(section.selector);sectionElement&&response.sections[section.id]&&(sectionElement.innerHTML=getSectionInnerHTML(response.sections[section.id],section.selector))})),Alpine.store("xMiniCart").openCart(),Alpine.store("xCartHelper").currentItemCount=parseInt(document.querySelector("#cart-icon-bubble span").innerHTML),document.dispatchEvent(new CustomEvent("eurus:cart:items-changed")))}).catch(error=>{console.error("Error:",error)}).finally(()=>{this.loading=!1,(quickView&&Alpine.store("xQuickView").buttonQuickView&&!Alpine.store("xQuickView").buttonQuickView.dataset.addAsBundle||!quickView&&this.$refs.product_form&&!this.$refs.product_form.querySelector('[data-add-as-bundle="true"]'))&&this.$refs.gift_wrapping_checkbox&&(this.$refs.gift_wrapping_checkbox.checked=!1)})}}))})})); 2//# sourceMappingURL=/cdn/shop/t/99/assets/product-cart.js.map?v=34845180909394404171789636612
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.