PageSourceSearch

https://tewines.com/cdn/shop/t/3/assets/notification.js?v=17308421196755404191759117593&cv=35e504a

js tewines.com collected 2026-10-09 18:25:28 UTC 3,676 bytes, 2 lines download raw bytes

1import{t as throttle}from"./lodash-utils.js";import{s as slideUp,a as slideDown}from"./slide.js";import{p as pubsub}from"./shared-utilities.js";import{l as layout}from"./layout-store.js";const calculateMilliseconds=(hours,mins=0,seconds=0)=>(hours*60*60+mins*60+seconds)*1e3;class CreateNotification{constructor(elementId,type="bar",timeIn=0,trigger=!1){this.type="bar",this.handleCloseBar=()=>{this.notificationEl.parentNode.classList.remove("bar-open"),document.body.style.removeProperty("--height-screen"),document.body.style.removeProperty("--notificationOffset"),slideUp(this.notificationEl,{duration:this.animationTiming},()=>{pubsub.emit("notificationBarState"),pubsub.off("mainNavOpen",this.handleCloseBar),pubsub.off("megaMenuOpen",this.handleCloseBar)})},this.handleCloseNotification=()=>{this.open=!1;const timestamp=Date.now();window.localStorage.setItem(`notification-${this.elementId}`,timestamp.toString()),this.type==="bar"&&this.handleCloseBar(),(this.type=="fade"||this.type=="age-gate")&&(this.notificationEl.classList.add("fade-out"),this.notificationEl.classList.remove("fade-in")),document.dispatchEvent(new CustomEvent("notificationClose",{detail:{elementId:this.elementId,type:this.t
1ype}})),document.body.style.removeProperty("overflow"),setTimeout(()=>{this.notificationEl.remove()},this.animationTiming)},this.elementId=elementId,this.type=type,this.notificationEl=document.getElementById(elementId),this.animationTiming=300,this.closeButton,this.open=!1,this.timeout=calculateMilliseconds(24),this.notificationEl&&(this.timein=this.notificationEl.dataset.timein?calculateMilliseconds(0,0,Number(this.notificationEl.dataset.timein)):timeIn||0,this.checkCookieStatus()?this.notificationEl.remove():setTimeout(()=>{this.initializeEvents()},this.timein)),this.canOpen=!(this.timein&&this.timein>0),this.trigger=trigger}checkCookieStatus(){const originalCookie=window.localStorage.getItem(`notification-${this.elementId}`),now=Date.now();return originalCookie!=null&&Number(originalCookie)+this.timeout>now}handleOpenBar(){this.notificationEl.parentNode.classList.add("bar-open"),console.log("bar-open"),slideDown(this.notificationEl,{duration:this.animationTiming},()=>{document.body.style.setProperty("--height-screen",`calc(100vh - ${this.notificationEl.offsetHeight}px)`),document.body.style.setProperty("--notificationOffset",`${this.notificationEl.offsetHeight}px`),pubsub.emit("notificationBarState")}),pubsub.on("mainNavOpen",this.handleCloseBar),pubsub.on("megaMenuOpen",this.handleCloseBar)}initializeEvents(){if(this.canOpen?(this.type==="bar"?this.handleOpenBar():this.type==="modal"?(layout.modal.value=this.elementId,this.notificationEl.addEventListener("close",this.handleCloseNotification)):this.type==="fade"&&(this.notificationEl.classList.remove("hidden"),this.notificationEl.classList.add("fade-in"),this.notificationEl.classList.add("active")),this.closeButton=this.notificationEl.querySelector(".js-close"),this.closeButton&&this.closeButton.addEventListener("click",this.handleCloseNotification),document.dispatchEvent(new CustomEvent("notificationOpen",{detail:{elementId:this.elementId,type:this.t
1ype}}))):setTimeout(()=>{this.canOpen=!0,this.initializeEvents()},this.timein),this.notificationEl.getAttribute("hide-scroll")&&document.addEventListener("scroll",throttle(e=>{window.scrollY>400&&this.handleCloseNotification()},200)),this.trigger){const triggerEl=this.notificationEl.querySelector("button");triggerEl&&triggerEl.addEventListener("click",()=>{this.handleCloseNotification()})}}}export{CreateNotification as C};
2//# sourceMappingURL=/cdn/shop/t/3/assets/notification.js.map?cv=98c0fa9&v=17308421196755404191759117593

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.