PageSourceSearch

https://topofthemornincoffee.com/cdn/shop/t/192/assets/rebuy.js?v=37449189589653014541790873584

js topofthemornincoffee.com collected 2026-10-02 04:18:28 UTC 3,492 bytes, 1 lines download raw bytes

1(function(){class d{constructor(){this.ReBuy=!1,this.Cart=!1,this.SmartCart=!1}onLoad(){typeof window.Rebuy!="object"?document.addEventListener("rebuy:smartcart.ready",()=>{this.initRebuy()}):this.initRebuy()}initRebuy(){this.ReBuy=window.Rebuy,this.Cart=this.ReBuy.Cart,this.SmartCart=this.ReBuy.SmartCart,this.smartCartListeners(),this.freeMugOver60Check()}smartCartListeners(){const t=document.querySelector("[data-cart-trigger]");typeof t=="object"&&t!=="undefined"&&t.addEventListener("click",e=>{e.preventDefault(),this.SmartCart?this.SmartCart.show():document.addEventListener("rebuy:smartcart.ready",()=>{this.SmartCart.show()})}),document.addEventListener("rebuy:smartcart.show",e=>{}),document.addEventListener("rebuy:cart.change",e=>{this.klaviyoUpdate(e.detail.cart.cart)})}async getCartData(){var t;try{const e=await fetch("/cart.js");if(!e.ok)throw new Error(`Error fetching cart data: ${e.statusText}`);const r=await e.json(),n=await Promise.all((t=r.items)==null?void 0:t.map(async a=>{const c=await fetch(`/products/${a.handle}.js`);if(!c.ok)throw new Error(`Error fetching product data for ${a.handle}: ${c.statusText}`);const s=(await c.json()).variants.find(o=>o.id===a.variant_id);return{...a,compareAtPrice:(s==null?void 0:s.compare_at_price)||null}}));return{...r,items:n}}catch(e){throw console.error("Error in getCartData:",e),e}}klaviyoUpdate(t){window._learnq=_learnq||[];const e={total_price:t.total_price/100,$value:t.total_price/100,total_discount:t.total_discount,original_total_price:t.original_total_price/100,items:t.items};window._learnq.push(["track","Added to Cart",e])}freeMugOver60Check(){var t;(t=this.Cart.cart.items)==null||t.forEach(e=>{var r,n;((r=e.properties)==null?void 0:r._widget_id)&&((n=e.properties)==null?void 0:n._widget_id)==="87820"&&window.FreeMugPromo!=="us"&&this.Cart.removeItem(e)})}subscriptionShippingCheck(t){var c;let e=0;(c=t.items)==null||c.forEach(i=>{var s,o;(o=(s=i.selling_plan_allocation)==null?void 0:s.selling_plan)!=null&&o.id&&(e+=i==null?void 0:i.quantity)});const r=document.querySelector(".rebuy-cart__progress-bar-meter-fill");r&&(e>=2?r.classList.add("override"):r.classList.remove("override")),document.getElementById("rebuy-cart__progress-bar-meter-label")&&(e>=2?r.classList.add("override"):r.classList.remove("override"));const a=document.querySelector(".rebuy-cart__progress-bar-wrapper");if(a){const i=document.getElementById("rebuy-cart__progress-bar-meter-label"),s=document.getElementById("ux-rebuy-message");if(s&&s.remove(),e>=2){i.classList.add("override");const o=document.createElement("div");o.classList.add("rebuy-cart__progress-bar-prompt"),o.id="ux-rebuy-message",o.innerHTML="\u{1F389} Congrats! You've unlocked <b>FREE SHIPPING!</b>",a.append(o)}else i.classList.remove("override")}}}new d().onLoad()})();document.addEventListener("DOMContentLoaded",()=>{const d=()=>{window.Rebuy?window.Rebuy.SmartCart?window.Rebuy.SmartCart.show():document.addEventListener("rebuy:smartcart.ready",()=>{window.Rebuy.SmartCart.show()}):window.location.href="/cart"},u=document.querySelector("[data-cart-trigger]");u&&u.addEventListener("click",t=>{t.preventDefault(),d()}),document.querySelectorAll(".add-to-cart-btn").forEach(t=>{t.addEventListener("click",e=>{e.preventDefault();const r=t.closest("form");if(r){const n=new FormData(r);fetch("/cart/add.js",{method:"POST",body:n}).then(a=>a.json()).then(()=>{const a=new CustomEvent("cart:added",{detail:{data:n}});document.dispatchEvent(a),d()})}})})});

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.