PageSourceSearch

https://www.lavera.ch/cdn/shop/t/4/assets/product-notification.js?v=74719083596512824261778140148

js lavera.ch collected 2026-10-08 02:01:41 UTC 2,507 bytes, 2 lines download raw bytes

1(function(){"use strict";const POPUP_SELECTOR="popup-component",POPUP_CLOSE_SELECTOR="[data-popup-close]",NOTIFICATION_FORM_SELECTOR="[data-notification-form]",NOTIFICATION_HEADING_SELECTOR="[data-product-notification-heading]",HAS_SUCCESS_CLASS="has-success";customElements.get("product-notification")||customElements.define("product-notification",class extends HTMLElement{constructor(){super(),this.notificationForm=this.querySelector(NOTIFICATION_FORM_SELECTOR),this.popup=this.closest("dialog"),this.popupClose=this.popup.querySelector(POPUP_CLOSE_SELECTOR)}connectedCallback(){this.notificationForm.addEventListener("submit",ev=>this.handleSubmit(ev)),this.popupClose.addEventListener("click",()=>this.resetStorage())}async handleSubmit(ev){ev.preventDefault();const form=this.notificationForm,emailInput=form.querySelector('input[name="email"]'),email=emailInput?emailInput.value.trim():"",variantId=form.dataset.variantId,publicKey=form.dataset.klaviyoPublicKey;if(!email||!variantId||!publicKey)return;const submitBtn=form.querySelector('[type="submit"]');submitBtn.disabled=!0;const payload={data:{type:"back-in-stock-subscription",attributes:{channels:["EMAIL"],profile:{data:{type:"profile",attributes:{email}}}},relationships:{variant:{data:{type:"catalog-variant",id:"$shopify:::$default:::"+variantId}}}}};try{const response=await fetch("https://a.klaviyo.com/client/back-in-stock-subscriptions/?company_id="+encodeURIComponent(publicKey),{method:"POST",headers:{"Content-Type":"application/json",revision:"2024-10-15"},body:JSON.stringify(payload),keepalive:!0});if(response.ok||response.status===202){const heading=this.querySelector(NOTIFICATION_HEADING_SELECTOR);heading&&(heading.style.display="none");const successMsg=this.querySelector("[data-notification-success]");successMsg&&(successMsg.style.display="");const popupComponent=this.closest(POPUP_SELECTOR);popupComponent&&popupComponent.classList.add(HAS_SUCCESS_CLASS),this.writeStorage(form.id)}else{const errorMsg=this.querySelector("[data-notification-error]");errorMsg&&(errorMsg.style.display="")}}catch{const errorMsg=this.querySelector("[data-notification-error]");errorMsg&&(errorMsg.style.display="")}finally{submitBtn.disabled=!1}}writeStorage(id){typeof window.sessionStorage<"u"&&window.sessionStorage.setItem("notification_form_id",id)}resetStorage(){window.sessionStorage.removeItem("notification_form_id")}})})();
2//# sourceMappingURL=/cdn/shop/t/4/assets/product-notification.js.map?v=74719083596512824261778140148

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.