1(function(){"use strict";if(customElements.get("edj-product-sticky-atc"))return;const MOBILE_MQ=window.matchMedia("(max-width: 767px)");class EdjProductStickyAtc extends HTMLElement{connectedCallback(){this._setup(),MOBILE_MQ.addEventListener?.("change",this._setup.bind(this))}disconnectedCallback(){this._teardown()}_setup(){if(this._teardown(),!MOBILE_MQ.matches)return;const sel=this.dataset.targetSelector||"[data-edj-cta-row]";this.target=document.querySelector(sel),this.target&&(this.removeAttribute("hidden"),this.observer=new IntersectionObserver(([entry])=>{this.classList.toggle("is-visible",!entry.isIntersecting)},{rootMargin:"0px 0px -60px 0px",threshold:0}),this.observer.observe(this.target),this.addBtn=this.querySelector("[data-edj-sticky-add]"),this._onAddClick=this._onAddClick.bind(this),this.addBtn?.addEventListener("click",this._onAddClick),this._onVariant=this._onVariant.bind(this),document.addEventListener("edj:variant:change",this._onVariant),this._onAdded=this._onAdded.bind(this),document.addEventListener("cart:added",this._onAdded))}_teardown(){this.observer?.disconnect(),this.observer=null,this.addBtn?.removeEventListener("click",this._onAddClick),document.removeEventListener("edj:variant:change",this._onVariant),document.removeEventListener("cart:added",this._onAdded),this.classList.remove("is-visible")}_onAddClick(e){e.preventDefault();const form=document.querySelector("[data-edj-product-form]");form&&(typeof form.requestSubmit=="function"?form.requestSubmit():form.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0})))}_onVariant(e){const v=(e.detail||{}).variant;if(!v)return;this.addBtn&&(this.addBtn.disabled=!v.available);const priceEl=this.querySelector("[data-edj-sticky-price]"),variantEl=this.querySelector("[data-edj-sticky-variant]"),labelEl=this.querySelector("[data-edj-sticky-label]");priceEl&&typeof v.price=="number"&&(priceEl.textContent=formatMoney(v.price)),variantEl&&v.title&&(variantEl.textContent=v.title),labelEl&&(labelEl.textContent=v.available?"Ajouter":"\xC9puis\xE9")}_onAdded(){if(!this.addBtn)return;this.addBtn.classList.add("is-added");const labelEl=this.querySelector("[data-edj-sticky-label]"),prev=labelEl?.textContent;labelEl&&(labelEl.textContent="\u2713"),setTimeout(()=>{this.addBtn.classList.remove("is-added"),labelEl&&prev&&(labelEl.textContent=prev)},2e3)}}function formatMoney(cents){if(window.Shopify&&typeof window.Shopify.formatMoney=="function")try{return window.Shopify.formatMoney(cents,"\u20AC{{amount_no_decimals_with_comma_separator}}")}catch{}return(cents/100).toLocaleString("fr-FR",{minimumFractionDigits:0,maximumFractionDigits:2})+" \u20AC"}customElements.define("edj-product-sticky-atc",EdjProductStickyAtc)})(); 2//# sourceMappingURL=/cdn/shop/t/10/assets/component-product-sticky-atc.js.map?v=77427629132869082521779553439
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.