PageSourceSearch

https://laboutiquedusoudeur.com/cdn/shop/t/3/assets/cart-countdown-timer.js?v=94030407780346628191785414861

js laboutiquedusoudeur.com collected 2026-09-24 13:18:28 UTC 3,113 bytes, 2 lines download raw bytes

1window.Eurus.loadedScript.has("cart-countdown-timer.js")||(window.Eurus.loadedScript.add("cart-countdown-timer.js"),requestAnimationFrame(()=>{document.addEventListener("alpine:init",()=>{Alpine.data("xCartCountdownTimer",(messageTemplate,minutes,expireAction)=>({timeLeft:null,timestamp:null,interval:null,formattedMessage:"",message:messageTemplate,countdownTime:minutes*60,action:expireAction,loadingClearCart:!1,errorMessage:!1,clearSuccess:!1,minutesText:"",initCountdown(minutesText){this.minutesText=minutesText;const savedState=this.loadState();(this.timeLeft===null||savedState.timeLeft===0)&&this.sync(this.countdownTime),this.handleCountdown(),this.clearInterval(),this.startCountdown()},sync(countdownTime){const savedState=this.loadState();if(savedState&&savedState.timeLeft>0){const elapsed=Math.floor((Date.now()-savedState.timestamp)/1e3);this.timeLeft=Math.max(0,savedState.timeLeft-elapsed)}else this.timeLeft=countdownTime;this.timestamp=Date.now(),this.saveState()},reset(countdownTime){this.timeLeft=countdownTime,this.timestamp=Date.now(),this.saveState()},clearInterval(){this.interval&&(clearInterval(this.interval),this.interval=null)},clearLocalStorage(){localStorage.removeItem("cartCountdown")},saveState(){localStorage.setItem("cartCountdown",JSON.stringify({timeLeft:this.timeLeft,timestamp:this.timestamp}))},loadState(){const savedState=localStorage.getItem("cartCountdown");return savedState?JSON.parse(savedState):null},startCountdown(){this.interval=setInterval(()=>{this.timeLeft>0?(this.timeLeft--,this.handleCountdown()):(this.clearInterval(),this.handleExpireAction())},1e3)},handleCountdown(){const minutes2=Math.floor(this.timeLeft/60),seconds=this.timeLeft%60,formattedTime=`<span class="font-bold">${String(minutes2).padStart(2,"0")}:${String(seconds).padStart(2,"0")} ${this.minutesText}!</span>`;this.formattedMessage=this.message.replace("{timer}",formattedTime)},clearCart(){this.loadingClearCart=!0,this.errorMessage=!1,fetch(window.Shopify.routes.root+"cart/clear.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sections:Alpine.store("xCartHelper").getSectionsToRender().map(section=>section.id)})}).then(response=>response.json()).then(response=>{this.clearSuccess=!0,Alpine.store("xCartHelper").reRenderSections(response.sections),Alpine.store("xCartHelper").currentItemCount=parseInt(document.querySelector("#cart-icon-bubble span").innerHTML),document.dispatchEvent(new CustomEvent("eurus:cart:items-changed"))}).catch(error=>{console.error("Error:",error)}).finally(()=>{this.loadingClearCart=!1})},handleExpireAction(){switch(this.action){case"repeat_countdown":this.reset(this.countdownTime),this.clearInterval(),this.startCountdown();break;case"hide_message":document.getElementById("x-cart-countdown-timer")&&(document.getElementById("x-cart-countdown-timer").style.display="none",this.clearLocalStorage());break;case"clear_cart":this.clearCart();break;default:console.error("Unknown action:",this.action)}}}))})}));
2//# sourceMappingURL=/cdn/shop/t/3/assets/cart-countdown-timer.js.map?v=94030407780346628191785414861

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.