1export class CopyDiscountCode extends HTMLElement{connectedCallback(){this.button=this.querySelector("[data-discount-code"),this.template=this.querySelector("template"),this.wrapper=this,this.button?.addEventListener("click",()=>this.copyCode())}copyCode(){const codeText=this.querySelector("[data-coupon-text]")?.innerText;codeText&&this.safeCopy(codeText).then(()=>{this.showMessage()})}async safeCopy(text){try{navigator.clipboard&&window.isSecureContext?await navigator.clipboard.writeText(text):this.fallbackCopy(text)}catch{this.fallbackCopy(text)}}fallbackCopy(text){const area=document.createElement("textarea");area.value=text,area.style.position="fixed",area.style.opacity="0",document.body.appendChild(area),area.select(),document.execCommand("copy"),document.body.removeChild(area)}showMessage(){const oldMsg=this.wrapper.querySelector("[copy-code-tooltip]");oldMsg&&oldMsg.remove();const cloned=this.template.content.cloneNode(!0);console.log("cloned",cloned),this.wrapper.appendChild(cloned);const successElement=this.wrapper.querySelector("[copy-code-tooltip]");setTimeout(()=>{successElement?.remove()},3e3)}}customElements.define("copy-discount",CopyDiscountCode); 2//# sourceMappingURL=/cdn/shop/t/18/assets/copy-discount.js.map?v=63520283755145268441783331058
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.