PageSourceSearch

https://drinktrevi.com/cdn/shop/t/151/assets/trevi-cart-feedback.js?v=53817926262684143221791081182

js drinktrevi.com collected 2026-10-05 07:05:00 UTC 4,062 bytes, 2 lines download raw bytes

1const coinAssetUrl=document.querySelector("script[data-trevi-coin-url]").dataset.treviCoinUrl;if(!window.treviCartCoinInitialized){window.treviCartCoinInitialized=!0,window.treviWaitForCartFeedback=async()=>{window.treviCartCoinAnimation&&await window.treviCartCoinAnimation,await new Promise(resolve=>setTimeout(resolve,180))};let drawerRequestPending=!1;document.addEventListener("theme:cart_drawer_open_request",event=>{event.detail?.treviCoinComplete||(event.stopImmediatePropagation(),!drawerRequestPending&&(drawerRequestPending=!0,requestAnimationFrame(async()=>{await window.treviWaitForCartFeedback(),drawerRequestPending=!1,document.dispatchEvent(new CustomEvent("theme:cart_drawer_open_request",{detail:{treviCoinComplete:!0}}))})))},!0);const treviCoinPreload=new Image;treviCoinPreload.src=coinAssetUrl,document.addEventListener("trevi:cart-added",()=>{if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;const bag=document.querySelector(".mod_new_header_7IIh-q_header-new__cart-button-count-icon");if(!bag)return;let rect=bag.getBoundingClientRect();if(!rect.width)return;let floatingBag=null;(rect.bottom<0||rect.top>window.innerHeight)&&(floatingBag=bag.cloneNode(!0),floatingBag.style.cssText="position:fixed;right:24px;top:80px;width:24px;height:24px;z-index:10004;background:white;border-radius:4px;pointer-events:none",floatingBag.setAttribute("aria-hidden","true"),document.body.appendChild(floatingBag),rect=floatingBag.getBoundingClientRect());const coin=document.createElement("img");coin.src=coinAssetUrl,coin.className="trevi-cart-coin",coin.alt="",coin.setAttribute("aria-hidden","true"),coin.style.left=rect.left+rect.width/2+"px",coin.style.top=rect.top-12+"px",window.treviCartCoinAnimation=new Promise(resolve=>{const finish=()=>{coin.remove(),floatingBag?.remove(),resolve()};coin.addEventListener("animationend",finish,{once:!0}),setTimeout(finish,2e3)}),document.body.appendChild(coin)})}const treviHeaderLock=document.querySelector(".trevi-mobile-header-lock");if(treviHeaderLock){const updateTreviHeaderScroll=()=>treviHeaderLock.classList.toggle("trevi-mobile-header-scrolled",window.scrollY>0);updateTreviHeaderScroll(),window.addEventListener("scroll",updateTreviHeaderScroll,{passive:!0}),window.addEventListener("pageshow",updateTreviHeaderScroll)}let treviCartViewportFrame;const updateTreviCartViewport=()=>{cancelAnimationFrame(treviCartViewportFrame),treviCartViewportFrame=requestAnimationFrame(()=>{const drawer=document.querySelector(".OffcanvasCart");if(!drawer)return;const viewport=window.visualViewport,mobile=window.innerWidth<1024,height=viewport?.height||window.innerHeight;drawer.style.setProperty("--trevi-cart-visible-height",height+"px"),drawer.style.setProperty("--trevi-cart-visible-top",(viewport?.offsetTop||0)+"px");const input=document.getElementById("trevi-cart-promo-code"),typing=mobile&&document.activeElement===input;drawer.classList.toggle("trevi-cart-keyboard-open",typing&&height<window.innerHeight-100);const summary=drawer.querySelector(".CartDrawer-summary"),content=drawer.querySelector(".Offcanvas-content");if(summary&&content&&(content.style.paddingBottom=summary.offsetHeight+"px"),typing&&summary){const field=input.getBoundingClientRect(),box=summary.getBoundingClientRect();field.bottom>box.bottom-12?summary.scrollTop+=field.bottom-box.bottom+12:field.top<box.top+12&&(summary.scrollTop+=field.top-box.top-12)}})};window.visualViewport?.addEventListener("resize",updateTreviCartViewport),window.visualViewport?.addEventListener("scroll",updateTreviCartViewport),window.addEventListener("resize",updateTreviCartViewport),document.addEventListener("focusin",updateTreviCartViewport),document.addEventListener("focusout",updateTreviCartViewport),document.addEventListener("toggle",event=>{event.target.matches?.(".trevi-cart-promo")&&(event.target.open||event.target.querySelector("input")?.blur(),updateTreviCartViewport())},!0),updateTreviCartViewport();
2//# sourceMappingURL=/cdn/shop/t/151/assets/trevi-cart-feedback.js.map?v=53817926262684143221791081182

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.