1class StickyHeader extends HTMLElement{constructor(){super()}connectedCallback(){this.header=document.querySelector(".section-header"),this.headerIsAlwaysSticky=this.getAttribute("data-sticky-type")==="always",this.headerInner=this.header.querySelector(".header"),this.uspBar=this.header.querySelector(".header__usp"),this.headerBounds={},this.setHeaderHeight(),this.setUspHeight(),this.boundUspMarquee=this.setupUspMarquee.bind(this),this.boundUspMarquee(),document.fonts&&document.fonts.ready&&document.fonts.ready.then(this.boundUspMarquee),window.addEventListener("resize",this.boundUspMarquee),this.headerIsAlwaysSticky&&this.header.classList.add("shopify-section-header-sticky"),this.currentScrollTop=0,this.preventReveal=!1,this.predictiveSearch=this.querySelector("predictive-search"),this.onScrollHandler=this.onScroll.bind(this),this.hideHeaderOnScrollUp=()=>this.preventReveal=!0,this.addEventListener("preventHeaderReveal",this.hideHeaderOnScrollUp),window.addEventListener("scroll",this.onScrollHandler,!1),this.boundCreateObserver=this.createObserver.bind(this),this.createObserver(),window.addEventListener("resize",this.boundCreateObserver)}setHeaderHeight(){if(this.headerResizeObserver)return;const writeHeaderHeight=()=>{var wrapper=this.headerInner.closest(".header-wrapper");wrapper&&(wrapper.classList.contains("drawer-open")||wrapper.classList.contains("drawer-closing"))||document.documentElement.style.setProperty("--header-height",`${this.headerInner.offsetHeight}px`)};this.headerResizeObserver=new ResizeObserver(writeHeaderHeight),this.headerResizeObserver.observe(this.headerInner);const drawerEl=this.headerInner.closest(".header-wrapper")?.querySelector("nav-drawer");drawerEl&&drawerEl.addEventListener("drawer-height-changed",writeHeaderHeight)}setupUspMarquee(){const bar=this.uspBar;if(!bar)return;const viewport=bar.querySelector(".header__usp-viewport"),track=bar.querySelector(".header__usp-track"),text=bar.querySelector(".header__usp-text");if(!viewport||!track||!text)return;track.querySelectorAll(".header__usp-text[aria-hidden]").forEach(n=>n.remove()),bar.classList.remove("is-overflowing"),track.style.removeProperty("--usp-scroll-distance"),track.style.removeProperty("--usp-marquee-duration");const textWidth=text.scrollWidth;if(textWidth<=viewport.clientWidth)return;const copy=text.cloneNode(!0);copy.setAttribute("aria-hidden","true"),copy.querySelectorAll("a").forEach(a=>a.setAttribute("tabindex","-1")),track.appendChild(copy);const gap=parseFloat(getComputedStyle(track).columnGap)||0,distance=textWidth+gap,SPEED_PX_PER_S=40;track.style.setProperty("--usp-scroll-distance",distance+"px"),track.style.setProperty("--usp-marquee-duration",distance/SPEED_PX_PER_S+"s"),bar.classList.add("is-overflowing")}setUspHeight(){if(!this.uspBar){this.header.style.setProperty("--usp-height","0px"),document.documentElement.style.setProperty("--usp-height","0px");return}new ResizeObserver(()=>{this.header.style.setProperty("--usp-height",`${this.uspBar.offsetHeight}px`),document.documentElement.style.setProperty("--usp-height",`${this.uspBar.offsetHeight}px`)}).observe(this.uspBar)}disconnectedCallback(){this.removeEventListener("preventHeaderReveal",this.hideHeaderOnScrollUp),window.removeEventListener("scroll",this.onScrollHandler),window.removeEventListener("resize",this.boundCreateObserver),window.removeEventListener("resize",this.boundUspMarquee)}createObserver(){this.intersectionObserver&&this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(entries=>{this.headerBounds=entries[0].intersectionRect},{threshold:[0]}),this.intersectionObserver.observe(this.header)}onScroll(){this.scrollRafPending||(this.scrollRafPending=!0,requestAnimationFrame(()=>{this.scrollRafPending=!1;const scrollTop=window.pageYOffset||document.documentElement.scrollTop;this.predictiveSearch&&this.predictiveSearch.isOpen||(scrollTop>this.currentScrollTop&&scrollTop>this.headerBounds.bottom?(this.header.classList.add("scrolled-past-header"),this.headerInner.classList.add("is-sticky"),this.header.classList.remove("usp-revealed"),this.hide()):scrollTop<this.currentScrollTop&&scrollTop>this.headerBounds.bottom?(this.header.classList.add("scrolled-past-header"),this.headerInner.classList.add("is-sticky"),this.preventReveal?(window.clearTimeout(this.isScrolling),this.isScrolling=setTimeout(()=>{this.preventReveal=!1},66),this.header.classList.remove("usp-revealed"),this.hide()):(this.header.classList.add("usp-revealed"),this.reveal())):scrollTop<=this.headerBounds.top&&(this.header.classList.remove("scrolled-past-header"),this.headerInner.classList.remove("is-sticky"),this.header.classList.remove("usp-revealed"),this.reset()),this.currentScrollTop=scrollTop)}))}hide(){this.headerIsAlwaysSticky||this.header.classList.add("shopify-section-header-hidden","shopify-section-header-sticky")}reveal(){this.headerIsAlwaysSticky||(this.header.classList.remove("shopify-section-header-hidden"),this.header.classList.add("shopify-section-header-sticky","animate"))}reset(){this.headerIsAlwaysSticky||this.header.classList.remove("shopify-section-header-hidden","shopify-section-header-sticky","animate")}}customElements.define("sticky-header",StickyHeader),(function(){const announcementScrollingHeight=document.querySelector(".shopify-section-group-header-group")?.querySelector(".section-scrolling-text")?.clientHeight;announcementScrollingHeight&&document.documentElement.style.setProperty("--announcement-scrolling-height",`${announcementScrollingHeight}px`);var burgerBtn=document.querySelector(".header__burger"),navDrawer=document.querySelector("nav
1-drawer");burgerBtn&&navDrawer&&burgerBtn.addEventListener("click",function(){navDrawer.toggle(burgerBtn)});const bgLayer=document.querySelector(".header__bg-layer");if(bgLayer){let setDrawerH2=function(px){if(px!==lastDrawerH){lastDrawerH=px;var value=px+"px";bgLayer.style.setProperty("--drawer-h",value),bgLine&&bgLine.style.setProperty("--drawer-h",value),gradientShadow&&gradientShadow.style.setProperty("--drawer-h",value)}},measureLogoBase2=function(){!logoEl||headerWrapper.classList.contains("flyout-open")||(logoBaseTop=logoEl.getBoundingClientRect().top-headerWrapper.getBoundingClientRect().top)},setKeyboardMode2=function(on){headerWrapper.classList.contains("using-keyboard")!==on&&(headerWrapper.classList.toggle("using-keyboard",on),wakeSync2())},notchClip2=function(height,isDesktop){var outerHalf=isDesktop?60:50,innerHalf=isDesktop?33:27,notchH=isDesktop?40:35;return"polygon(0 0,100% 0,100% "+height+"px,calc(var(--notch-cx,50%) + "+outerHalf+"px) "+height+"px,calc(var(--notch-cx,50%) + "+innerHalf+"px) "+(height-notchH)+"px,calc(var(--notch-cx,50%) - "+innerHalf+"px) "+(height-notchH)+"px,calc(var(--notch-cx,50%) - "+outerHalf+"px) "+height+"px,0 "+height+"px)"},notchClipFlipped2=function(stripH,isDesktop){var outerHalf=isDesktop?60:50,innerHalf=isDesktop?33:27,notchH=isDesktop?40:35,tip=stripH+notchH;return"polygon(0 0,100% 0,100% "+stripH+"px,calc(var(--notch-cx,50%) + "+outerHalf+"px) "+stripH+"px,calc(var(--notch-cx,50%) + "+innerHalf+"px) "+tip+"px,calc(var(--notch-cx,50%) - "+innerHalf+"px) "+tip+"px,calc(var(--notch-cx,50%) - "+outerHalf+"px) "+stripH+"px,0 "+stripH+"px)"},startFlyoutClose2=function(){flyoutCloseIntent=null,flyoutCloseStartedAt=performance.now(),headerWrapper.classList.remove("flyout-open","flyout-resizing","flyout-switching"),headerWrapper.classList.add("flyout-closing"),openMegaItem&&setItemExpanded2(openMegaItem,!1),flyoutCloseTimer&&clearTimeout(flyoutCloseTimer),flyoutCloseTimer=setTimeout(function(){headerWrapper.classList.remove("flyout-closing","flyout-rescue"),flyoutCloseTimer=null,openMegaItem&&openMegaItem.classList.remove("is-mega-open"),openMegaItem=null,releaseFlyoutHold2(),measureLogoBase2()},600),wakeSync2()},syncBgLayer2=function(){var wrapperRect=headerWrapper.getBoundingClientRect(),wrapperTop=wrapperRect.top,headerBottom=header.getBoundingClientRect().bottom,isDesktop=desktopMQ.matches,notchCx=0;if(logoNotchEl){var logoNotchRect=logoNotchEl.getBoundingClientRect();logoNotchRect.width>0&&(notchCx=Math.round(logoNotchRect.left+logoNotchRect.width/2-wrapperRect.left),headerWrapper.style.setProperty("--notch-cx",notchCx+"px"))}var stickyEl=document.querySelector("sticky-header"),blurDesktop=parseInt(stickyEl&&stickyEl.dataset.blurHeightDesktop,10),blurMobile=parseInt(stickyEl&&stickyEl.dataset.blurHeightMobile,10);isNaN(blurDesktop)&&(blurDesktop=80),isNaN(blurMobile)&&(blurMobile=60);var closedH=isDesktop?blurDesktop:blurMobile,uspEl=headerWrapper.querySelector(".header__usp"),uspH=uspEl?uspEl.offsetHeight:0;document.documentElement.style.setProperty("--header-blur-h",closedH+uspH+"px");var notchH=isDesktop?40:35;closedSheet&&(closedSheet.style.height=uspH+notchH+"px",closedSheet.style.clipPath=notchClipFlipped2(uspH,isDesktop));var megaSel=headerWrapper.classList.contains("using-keyboard")?".list-menu__has-mega:focus-within .atomic-mega, .list-menu__has-mega.is-held .atomic-mega":".list-menu__has-mega.is-hover-open:not(.is-dismissed) .atomic-mega, .list-menu__has-mega.is-held:not(.is-dismissed) .atomic-mega",megaBottom=headerBottom;header.querySelectorAll(megaSel).forEach(function(m){var b=m.getBoundingClientRect().bottom;b>megaBottom&&(megaBottom=b)});var drawerEl=headerWrapper.querySelector("nav-drawer.is-open"),drawerBottom=headerBottom,drawerRectBottom=headerBottom;if(drawerEl){var db=drawerEl.getBoundingClientRect().bottom;drawerRectBottom=db,db>drawerBottom&&(drawerBottom=db)}var drawerOpen=drawerBottom>headerBottom+2,megaOpen=megaBottom>headerBottom+2;if(drawerOpen){var dh=drawerBottom-wrapperTop;bgLayer.style.height=dh+"px",bgLayer.style.clipPath=notchClip2(dh,isDesktop),bgLine&&(bgLine.style.height=dh+"px"),gradientShadow&&(gradientShadow.style.top=dh-(notchH+1)+"px"),setDrawerH2(dh)}
1else headerWrapper.classList.contains("drawer-closing")||(bgLayer.style.height=closedH+uspH+"px",bgLayer.style.clipPath="");if(megaOpen){var wasFlyoutOpen=headerWrapper.classList.contains("flyout-open"),mh=megaBottom-wrapperTop;headerWrapper.style.setProperty("--flyout-h",mh+"px"),headerWrapper.style.setProperty("--flyout-clip",notchClip2(mh,isDesktop)),headerWrapper.style.setProperty("--logo-translate",mh-notchH-logoBaseTop+"px"),flyoutSheet&&(flyoutSheet.style.height=mh+"px"),!drawerOpen&&bgLine&&(bgLine.style.height=mh+"px"),!drawerOpen&&gradientShadow&&(gradientShadow.style.top=mh-(notchH+1)+"px"),flyoutCloseIntent&&(clearTimeout(flyoutCloseIntent),flyoutCloseIntent=null),flyoutCloseTimer&&(clearTimeout(flyoutCloseTimer),flyoutCloseTimer=null),!wasFlyoutOpen&&headerWrapper.classList.contains("flyout-closing")&&(performance.now()-flyoutCloseStartedAt<150?headerWrapper.classList.add("flyout-rescue"):(headerWrapper.classList.remove("flyout-rescue","flyout-switching"),openMegaItem&&(openMegaItem.classList.remove("is-mega-open"),openMegaItem.offsetWidth,openMegaItem.classList.add("is-mega-open"))),openMegaItem&&setItemExpanded2(openMegaItem,!0)),headerWrapper.classList.remove("flyout-closing"),headerWrapper.classList.add("flyout-open"),headerWrapper.classList.toggle("flyout-resizing",wasFlyoutOpen)}else headerWrapper.classList.contains("flyout-open")&&(flyoutCloseIntent||(flyoutCloseIntent=setTimeout(startFlyoutClose2,150)));return(isDesktop?"d":"m")+","+Math.round(wrapperTop)+","+Math.round(headerBottom)+","+Math.round(megaBottom)+","+Math.round(drawerRectBottom)+","+notchCx+","+(headerWrapper.classList.contains("using-keyboard")?"k":"")},loop2=function(){var sig=syncBgLayer2();if(sig===lastSig){if(++stableFrames>=2){rafId=null;return}}else stableFrames=0,lastSig=sig;rafId=requestAnimationFrame(loop2)},wakeSync2=function(){lastSig=null,stableFrames=0,rafId===null&&(rafId=requestAnimationFrame(loop2))},setItemExpanded2=function(item,expanded){var link=item&&item.querySelector(".header__menu-item");link&&link.setAttribute("aria-expanded",expanded?"true":"false")},onItemOpen2=function(e){var item=e.currentTarget;item!==openMegaItem&&(openMegaItem&&(setItemExpanded2(openMegaItem,!1),openMegaItem.classList.remove("is-mega-open")),headerWrapper.classList.toggle("flyout-switching",headerWrapper.classList.contains("flyout-open")));var isNewPanel=item!==openMegaItem;if(openMegaItem=item,item.classList.add("is-mega-open"),item.classList.remove("is-dismissed"),isNewPanel){var capScroller=item.querySelector(".atomic-mega__content-wrapper");capScroller&&(capScroller.scrollTop=0)}setItemExpanded2(item,!0),releaseFlyoutHold2(),wakeSync2()},cancelHoverIntent2=function(){hoverIntentTimer!==null&&(clearTimeout(hoverIntentTimer),hoverIntentTimer=null)},armHoverOpen2=function(item){cancelHoverIntent2(),headerWrapper.querySelectorAll(".list-menu__has-mega.is-hover-open").forEach(function(other){other!==item&&other.classList.remove("is-hover-open")}),item.classList.add("is-hover-open"),onItemOpen2({currentTarget:item})},onItemPointerEnter2=function(e){var item=e.currentTarget,inMenuAlready=headerWrapper.classList.contains("flyout-open")||headerWrapper.classList.contains("flyout-closing");if(e.pointerType!=="mouse"||inMenuAlready){armHoverOpen2(item);return}cancelHoverIntent2(),hoverIntentTimer=setTimeout(function(){hoverIntentTimer=null,armHoverOpen2(item)},HOVER_INTENT_MS)},holdFlyoutOpen2=function(){!openMegaItem||!headerWrapper.classList.contains("flyout-open")||(openMegaItem.classList.add("is-held"),wakeSync2())},releaseFlyoutHold2=function(){headerWrapper.querySelectorAll(".list-menu__has-mega.is-held").forEach(function(item){item.classList.remove("is-held")}),wakeSync2()},isTouchNav2=function(){return desktopMQ.matches?coarseMQ.matches||lastPointerType==="touch":!1},closeTapFlyout2=function(){tapOpenItem&&(tapOpenItem.classList.remove("is-held","is-hover-open"),setItemExpanded2(tapOpenItem,!1),tapOpenItem=null,wakeSync2())},tapIsInsideFlyoutUI2=function(target){return!!(tapOpenItem&&tapOpenItem.contains(target)||target.closest&&target.closest(".list-menu__has-mega")||flyoutActions&&flyoutActions.contains(target)||logoEl&&logoEl.contains(target))};var setDrawerH=setDrawerH2,measureLogoBase=measureLogoBase2,setKeyboardMode=setKeyboardMode2,notchClip=notchClip2,notchClipFlipped=notchClipFlipped2,startFlyoutClose=startFlyoutClose2,syncBgLayer=syncBgLayer2,loop=loop2,wakeSync=wakeSync2,setItemExpanded=setItemExpanded2,onItemOpen=onItemOpen2,cancelHoverIntent=cancelHoverIntent2,armHoverOpen=armHoverOpen2,onItemPointerEnter=onItemPointerEnter2,holdFlyoutOpen=holdFlyoutOpen2,releaseFlyoutHold=releaseFlyoutHold2,isTouchNav=isTouchNav2,closeTapFlyout=closeTapFlyout2,tapIsInsideFlyoutUI=tapIsInsideFlyoutUI2;const headerWrapper=bgLayer.parentElement;var header=headerWrapper.querySelector(".header"),gradientShadow=headerWrapper.querySelector(".header__gradient-shadow"),bgLine=headerWrapper.querySelector(".header__bg-line"),flyoutSheet=headerWrapper.querySelector(".header__flyout-sheet"),closedSheet=headerWrapper.querySelector(".header__closed-sheet"),lastDrawerH=null,logoEl=headerWrapper.querySelector(".header__heading-link"),logoNotchEl=headerWrapper.querySelector(".header__logo-notch"),flyoutCloseTimer=null,flyoutCloseIntent=null,flyoutCloseStartedAt=0,logoBaseTop=0;measureLogoBase2(),window.addEventListener("keydown",function(e){e.key==="Tab"&&setKeyboardMode2(!0)});var lastPointerType="mouse";window.addEventListener("pointerdown",function(e){e.pointerType&&(lastPointerType=e.pointerType),setKeyboardMode2(!1)}),window.addEventListener("pointermove",function(){setKeyboardMode2(!1)});var desktopMQ=window.matchMedia("(min-width: 990px)"),rafId=null,lastSig=null,stableFrames=0;if(window.addEventListener("pageshow",function(){var focused=document.activeElement;focused&&focused.closest&&focused.closest(".list-menu__has-mega")&&focused.blur();var stale=headerWrapper.querySelectorAll(".list-menu__has-mega.is-hover-open");stale.forEach(function(item){item.classList.remove("is-hover-open")}),stale.length&&wakeSync2()}),"ResizeObserver"in window){var panelRO=new ResizeObserver(wakeSync2);header.querySelectorAll(".atomic-mega").forEach(function(m){panelRO.observe(m)}),navDrawer&&panelRO.observe(navDrawer)}var openMegaItem=null,HOVER_INTENT_MS=120,hoverIntentTimer=null;headerWrapper.querySelectorAll(".list-menu__has-mega").forEach(function(item){item.addEventListener("pointerenter",onItemPointerEnter2),item.addEventListener("pointerleave",function(){cancelHoverIntent2(),item.classList.remove("is-hover-open"),item.classList.remove("is-dismissed"),wakeSync2()});var dismissLabel=item.querySelector(".header__menu-item");dismissLabel&&dismissLabel.addEventListener("pointerenter",function(){item.classList.contains("is-dismissed")&&(item.classList.remove("is-dismissed"),wakeSync2())}),item.addEventListener("focusin",onItemOpen2),item.addEventListener("focusout",function(e){item.contains(e.relatedTarget)||wakeSync2()})});var holdZones=[],actionsLinks=headerWrapper.querySelector(".header__flyout-actions .atomic-mega__bottom-links");actionsLinks&&holdZones.push(actionsLinks),logoEl&&holdZones.push(logoEl),holdZones.forEac
1h(function(zone){zone.addEventListener("pointerenter",holdFlyoutOpen2),zone.addEventListener("pointerleave",releaseFlyoutHold2),zone.addEventListener("focusin",holdFlyoutOpen2),zone.addEventListener("focusout",function(e){zone.contains(e.relatedTarget)||releaseFlyoutHold2()}),zone.addEventListener("click",releaseFlyoutHold2)});var tapOpenItem=null,coarseMQ=window.matchMedia("(hover: none), (pointer: coarse)");headerWrapper.querySelectorAll(".list-menu__has-mega").forEach(function(item){var link=item.querySelector(".header__menu-item");link&&link.addEventListener("click",function(e){if(isTouchNav2()){if(item===tapOpenItem){closeTapFlyout2();return}e.preventDefault(),tapOpenItem&&tapOpenItem!==item&&closeTapFlyout2(),onItemOpen2({currentTarget:item}),item.classList.add("is-held"),tapOpenItem=item,wakeSync2()}})});var flyoutActions=headerWrapper.querySelector(".header__flyout-actions");document.addEventListener("click",function(e){tapOpenItem&&(tapIsInsideFlyoutUI2(e.target)||(e.preventDefault(),e.stopImmediatePropagation(),closeTapFlyout2()))},!0),headerWrapper.addEventListener("click",function(e){if(e.target.closest){var mega=e.target.closest(".mega-menu__content");if(mega&&!e.target.closest("a, button, input, select, textarea, summary")){var item=mega.closest(".list-menu__has-mega");item&&(item.classList.add("is-dismissed"),item.classList.remove("is-held"),item.contains(document.activeElement)&&document.activeElement.blur(),tapOpenItem===item&&closeTapFlyout2(),wakeSync2())}}}),headerWrapper.querySelectorAll(".atomic-mega__content-wrapper").forEach(function(scroller){function updateScrollFade(){var maxScroll=scroller.scrollHeight-scroller.clientHeight;scroller.classList.toggle("can-scroll-more",maxScroll>1&&scroller.scrollTop<maxScroll-1),scroller.classList.toggle("can-scroll-back",maxScroll>1&&scroller.scrollTop>1)}if(scroller.addEventListener("scroll",updateScrollFade,{passive:!0}),"ResizeObserver"in window){var fadeRO=new ResizeObserver(updateScrollFade);fadeRO.observe(scroller);var colGrid=scroller.querySelector(".atomic-mega__columns");colGrid&&fadeRO.observe(colGrid)}updateScrollFade()}),navDrawer&&(navDrawer.addEventListener("drawer-height-changed",wakeSync2),navDrawer.addEventListener("transitionend",function(e){e.target===navDrawer&&wakeSync2()})),wakeSync2(),window.addEventListener("resize",function(){measureLogoBase2(),wakeSync2()})}})(); 2//# sourceMappingURL=/cdn/shop/t/38/assets/header-sticky.js.map?v=6500426100007300141789485353
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.