1import{LitElement,html,utils}from"@hh/global.js";const{toggle,reRenderShopifySections,addToCart}=utils;class HHGiftNote extends LitElement{connectedCallback(){super.connectedCallback(),this.giftItemTextArea=this.querySelector(".mini-cart__gift-note-body-input textarea"),this.giftItemCTA=this.querySelector(".mini-cart__gift-note-body-input button"),this.addGiftItem()}onToggleGiftNote(){toggle(this.parentNode,["mini-cart__footer--expanded"])}onValidateInput(){this.giftItemCTA.disabled=this.giftItemTextArea.value===""}addGiftItem(){this.giftItemCTA&&this.giftItemTextArea&&(this.onValidateInput(),["input","change","keyup"].forEach(event=>this.giftItemTextArea.addEventListener(event,this.onValidateInput.bind(this))),this.giftItemCTA.addEventListener("click",async e=>{e.preventDefault();const giftProduct=this.giftItemCTA.dataset.gift,giftProductInCart=this.giftItemCTA.dataset.giftIncart,giftProductIndex=this.giftItemCTA.dataset.giftIndex;giftProductInCart!="false"?this.dispatchEvent(new CustomEvent("updateGiftItem",{bubbles:!0,composed:!0,detail:{key:giftProductIndex,value:1,note:this.giftItemTextArea.value.trim()}})):this.dispatchEvent(new CustomEvent("addGiftItem",{bubbles:!0,composed:!0,detail:{key:giftProduct,value:this.giftItemTextArea.value.trim()}}))}))}render(){return html` 2 <div class="giftnote"> 3 <slot @toggleCart="${this.onToggleGiftNote}"></slot> 4 </div>`}}customElements.define("hh-gift-note",HHGiftNote); 5//# sourceMappingURL=/cdn/shop/t/495/assets/component-giftnote.js.map?v=151226159582511628271790831518
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.