PageSourceSearch

https://bkconnection.com/cdn/shop/t/4/assets/product-cart.js?v=151054666797078970371747335364

js bkconnection.com collected 2026-09-24 07:27:53 UTC 8,370 bytes, 2 lines download raw bytes

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,insuranceVariantId:"",loadInsurance(id){this.insuranceVariantId==""&&(this.insuranceVariantId=id)},scrollToAtcBtn(btnId){document.querySelector(`#${btnId}`).scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},async hashProperties(formData){let result=[];for(let[key,value]of formData.entries())key.match(/^properties\[(.+)\]$/)&&(value instanceof File?result.push(`${value.name}:${value.size}:${value.type}`):result.push(value));result.push(formData.get("id")),result.sort();let data=result.join("|");const dataBuffer=new TextEncoder().encode(data),hashBuffer=await crypto.subtle.digest("SHA-256",dataBuffer);return Array.from(new Uint8Array(hashBuffer)).map(b=>b.toString(16).padStart(2,"0")).join("")},async addToCart(e,required,quickView,sticky){this.loading=!0,e.preventDefault(),setTimeout(async()=>{if(required){var productInfo=this.$el.closest(".product-info");if(sticky&&(productInfo=document.querySelector(".product-info")),productInfo){var propertiesInput=productInfo.querySelectorAll(".customization-picker");this.stopAction=!1;let scrollStatus=!1;propertiesInput.length&&propertiesInput.forEach(input=>{(input.required&&input.value.trim()==""||input.classList.contains("validate-checkbox"))&&(input.classList.add("required-picker"),this.stopAction=!0,scrollStatus||(input.parentElement.querySelector(".text-required").scrollIntoView({behavior:"smooth",block:"center"}),scrollStatus=!0))})}if(this.stopAction)return setTimeout(()=>{this.loading=!1},500),!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);this.$refs.gift_wrapping_checkbox&&this.$refs.gift_wrapping_checkbox.checked&&wrappringVariantId&&this.$refs.gift_wrapping_id&&await this.hashProperties(formData).then(hashHex=>{this.$refs.gift_wrapping_id.value=hashHex,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);const newFormData=new FormData;for(let[key,value]of formData.entries())value!==""&&newFormData.append(key,value);await fetch(`${Eurus.cart_add_url}`,{method:"POST",headers:{Accept:"application/javascript","X-Requested-With":"XMLHttpRequest"},body:newFormData}).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,setTimeout(()=>{this.errorMessage=!1},3e3),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{Alpine.store("xCartNoti")&&Alpine.store("xCartNoti").enable&&Alpine.store("xCartNoti").setItem(response);let match=document.cookie.match("(^|;)\\s*eurus_insurance\\s*=\\s*([^;]+)");if(this.$refs.gift_wrapping_checkbox&&this.$refs.gift_wrapping_checkbox.checked&&wrappringVariantId||this.$refs.engraving_text&&engravingVariantId&&this.$refs.engraving_text.value.trim()||this.insuranceVariantId&&!localStorage.getItem("insuranceRemoved")&&(!match||match[1].trim()==="")){let additionalOptionData={items:[],sections:Alpine.store("xCartHelper").getSectionsToRender().map(section=>section.id)};if(this.$refs.gift_wrapping_checkbox&&this.$refs.gift_wrapping_checkbox.checked&&wrappringVariantId&&response.properties._gift_wrapping_id&&additionalOptionData.items.push({id:wrappringVariantId,quantity:1,properties:{For:response.title,_key_link:response.properties._gift_wrapping_id}}),this.$refs.engraving_text&&engravingVariantId&&this.$refs.engraving_text.value.trim()&&additionalOptionData.items.push({id:engravingVariantId,quantity:1}),this.insuranceVariantId&&!localStorage.getItem("insuranceRemoved")){let match2=document.cookie.match("(^|;)\\s*eurus_insurance\\s*=\\s*([^;]+)");(!match2||match2[1].trim()==="")&&additionalOptionData.items.push({id:this.insuranceVariantId,quantity:1})}additionalOptionData.items.length!==0&&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().forEac
1h((section=>{const sectionElement=document.querySelector(section.selector);sectionElement&&response2.sections[section.id]&&(sectionElement.innerHTML=getSectionInnerHTML(response2.sections[section.id],section.selector))})),(!Alpine.store("xCartNoti")||!Alpine.store("xCartNoti").enable)&&(setTimeout(()=>{Alpine.store("xMiniCart").openCart()},500),document.dispatchEvent(new CustomEvent("eurus:cart:redirect"))),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().forEach((section=>{const sectionElement=document.querySelector(section.selector);sectionElement&&response.sections[section.id]&&(sectionElement.innerHTML=getSectionInnerHTML(response.sections[section.id],section.selector))})),(!Alpine.store("xCartNoti")||!Alpine.store("xCartNoti").enable)&&Alpine.store("xMiniCart").openCart(),Alpine.store("xCartHelper").currentItemCount=parseInt(document.querySelector("#cart-icon-bubble span").innerHTML),document.dispatchEvent(new CustomEvent("eurus:cart:items-changed")),document.dispatchEvent(new CustomEvent("eurus:cart:redirect")))}}).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),this.$refs.gift_wrapping_id&&(this.$refs.gift_wrapping_id.value="")),document.cookie=`eurus_insurance=${this.insuranceVariantId}; path=/`})},0)}}))})}));
2//# sourceMappingURL=/cdn/shop/t/4/assets/product-cart.js.map?v=151054666797078970371747335364

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.