1import{utils,LitElement,html,broadcastReceiver}from"@hh/global.js";const{serializeForm,addToCart,reRenderShopifySections,toggle}=utils;class HHProductForm extends LitElement{constructor(){super(),this.form=this.querySelector("form"),this.quanityInput=this.querySelector('[name="quantity"]'),this.submitButton=this.querySelector('[type="submit"]'),this.form.addEventListener("submit",this.onSubmitHandler.bind(this))}connectedCallback(){super.connectedCallback(),this.receiver=broadcastReceiver("quantity",(...args)=>{this.getQuantityFromDocument(...args)})}disconnectedCallback(){super.disconnectedCallback(),this.receiver.disconnect()}getQuantityFromDocument(data){this.quanityInput&&(this.quanityInput.value=data.value||1)}async onSubmitHandler(event){event.preventDefault(),this.submitButton.setAttribute("disabled",!0),this.submitButton.classList.add("loading"),reRenderShopifySections(await addToCart(JSON.parse(serializeForm(this.form)))),this.submitButton.removeAttribute("disabled"),this.submitButton.classList.remove("loading"),toggle(document.body,["mini-cart-is-active"]),document.querySelectorAll("s-header").forEach(header=>{header.connectedCallback()})}render(){return html`<slot></slot>`}}customElements.define("hh-product-form",HHProductForm); 2//# sourceMappingURL=/cdn/shop/t/725/assets/component-product-form.js.map?v=23660522054771442341776706983
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.