PageSourceSearch

https://www.cambridgesatchel.com/cdn/shop/t/628/assets/klaviyo-bis.min.js

js cambridgesatchel.com collected 2026-10-02 04:10:44 UTC 2,283 bytes, 15 lines download raw bytes

1import{P as r,f as p}from"./utilities.min.js";import"./vendor.min.js";class s extends HTMLElement{constructor(){super(),this.initialise()}initialise(){this.querySelector("[data-open-bis]").addEventListener("click",this.onOpenBisClick.bind(this))}async onOpenBisClick(t){t.preventDefault(),this.popup=new r;const e=await p(`/products/${this.dataset.productHandle}?section_id=product-notifyme`).then(a=>a.innerHTML);this.popup.insertContent(e),this.popup.el.addEventListener("submit",this.onFormSubmit.bind(this))}onFormSubmit(t){t.target.matches("[data-shopify-cart-notify-form]")&&(t.preventDefault(),t.target.querySelector('button[type="submit"]').innerHTML=`
2      <svg class="w-5 h-5 text-black animate-spin" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
3        <g fill="currentColor"><g><path d="M24 47a23 23 0 1 1 23-23 23.025 23.025 0 0 1-23 23zm0-42a19 19 0 1 0 19 19A19.021 19.021 0 0 0 24 5z" opacity=".4"></path><path d="M47 24h-4A19.021 19.021 0 0 0 24 5V1a23.025 23.025 0 0 1 23 23z"></path></g></g>
4      </svg>
5    `,this.createNotification(t.target))}createNotification(t){const e=new FormData(t),o=`https://a.klaviyo.com/client/back-in-stock-subscriptions?company_id=${this.dataset.klaviyoKey}`,n={method:"POST",headers:{accept:"application/vnd.api+json",revision:"2025-01-15","content-type":"application/vnd.api+json"},body:JSON.stringify({data:{type:"back-in-stock-subscription",attributes:{profile:{data:{type:"profile",attributes:{email:e.get("email")}}},channels:["EMAIL"]},relationships:{variant:{data:{type:"catalog-variant",id:`$shopify:::$default:::${e.get("variant_id")}`}}}}})};fetch(o,n).then(i=>{if(i.status!==202)throw new Error("Failed to subscribe");this.popup.replaceContent(`
6          <div class="p-6">
7            <p>
7You're in! We'll let you know when it's back.</p>
8          </div>
9        `)}).catch(i=>{console.error("Error:",i),this.popup.replaceContent(`
10          <div class="p-6">
11            <h3 class="mb-2 text-[28px]">Error</h3>
12            <p class="mb-2 text-sm md:text-base">Unable to process your request. Please try again.</p>
13            <button type="button" class="btn-black" data-popup-close>Close</button>
14          </div>
15        `)})}}customElements.get("klaviyo-bis",s)||customElements.define("klaviyo-bis",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.