1import{M as t}from"./bluetti.messageapi.DKPhkxLG.min.js";import{s as e}from"./bluetti.utils.DYeYmWQ1.min.js";import"./bluetti.fetch.is34mlrL.min.js";import"./bluetti.constants.C9R5cfQ-.min.js";class s extends window.HTMLElement{constructor(){super(),this.messageapi=new t,this.gtagConfig={sendTo:this.dataset.gaSendTo||"",value:this.dataset.gaValue||1,currency:this.dataset.gaCurrency||window.Shopify.currency.active||"USD"}}connectedCallback(){this.querySelector(".toast-form-submit").addEventListener("submit",this.submitForm.bind(this),!1)}gtagReportConversion(){}async submitForm(t){t.preventDefault();const s=this.querySelector('[type="email"]').value,i=t.target.querySelector('[name="tags"]').value,o=t.target.querySelector('[name="id"]').value,a=this.querySelector('[type="submit"]');if(""===s)return;this.gtagReportConversion();const r={email:s,shop:window.Shopify.shop.split(".myshopify")[0],tag:i,id:o};a.disabled=!0,a.classList.add("loading");const n=await this.messageapi.subscribeKlaviyo(r);if(0===n.code||10001===n.code)this.interactionSuccess();else{const t=this.getAttribute("data-error-message");e("error",t||n.msg)}t.target.reset();const c=t.target.querySelector('[name="form-checkbox"]');if(c){const t=c.hasAttribute("checked");c.checked=t}a.disabled=!1,a.classList.remove("loading");t.target.querySelectorAll("input").forEach(t=>{t.setCustomValidity(""),t.classList.remove("invalid")})}interactionSuccess(){const t=this.getAttribute("data-interaction-type"),s=this.getAttribute("data-success-message");this.dispatchEvent(new CustomEvent("subscribe-success",{bubbles:!0,detail:{interactionType:t}})),"klaviyo_popup"===t?this.openKlaviyoPopup():e("success",s||"Thank you for subscribing!")}openKlaviyoPopup(){const t=this.getAttribute("data-klaviyo-popup-id");if(!t){const t=this.getAttribute("data-success-message");return void e("success",t||"Thank you for subscribing!")}window._klOnsite=window._klOnsite||[],window._klOnsite.push(["openForm",t])}}window.customElements.define("elite-subscribe",s);
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.