function xStickyHeader(){let e=document.querySelector(".x-header_sticky");if(!e)return;let t=e.dataset.xBreak,i=e.dataset.xScroll,r=e.offsetHeight,a=!1;if(e.querySelector(".brxe-xnotificationbar")){let o=e.querySelector(".brxe-xnotificationbar"),s=o.offsetHeight,c=o.getAttribute("data-x-notification"),n=c?JSON.parse(c):{},d=n.slideDuration;o.addEventListener("x_notification:close",function(){if("show"!==o.getAttribute("data-x-sticky")&&"overlay"!==getComputedStyle(e).getPropertyValue("--x-header-position").split(" ").join("")){if(o.closest(".x-header_sticky:not(.x-header_sticky-active)"))setTimeout(function(){r=e.offsetHeight},d+10);else if(o.closest(".x-header_sticky.x-header_sticky-active")){var t=s/d,i=r;function a(e){void 0===v&&(v=e);var r=e-v;document.body.style.marginTop=i-t*r+"px",document.documentElement.style.setProperty("--x-header-height",i-t*r+"px"),r>=d||window.requestAnimationFrame(a)}r=e.offsetHeight-s,window.requestAnimationFrame(a)}}})}let l=!1;function y(){let t=window.pageYOffset;e.classList.remove("x-header_sticky-hidden"),t>i?(e.classList.add("x-header_sticky-active"),e.classList.remove("x-header_sticky-inactive"),e.querySelectorAll("[data-x-sticky]:not([data-x-sticky=hide])").forEach(e=>{e.setAttribute("data-x-sticky-active","true")}),"absolute"!=getComputedStyle(e).position&&e.classList.contains("x-header_sticky-active")&&"overlay"!==getComputedStyle(e).getPropertyValue("--x-header-position").split(" ").join("")&&(document.body.style.marginTop=r+"px",document.documentElement.style.setProperty("--x-header-height",r+"px")),l||(window.dispatchEvent(new Event("resize")),e.dispatchEvent(new Event("x_sticky_header:active")),l=!0)):(document.body.style.marginTop="0",document.documentElement.style.setProperty("--x-header-height","0px"),e.classList.remove("x-header_sticky-active"),e.classList.add("x-header_sticky-inactive"),e.querySelectorAll("[data-x-sticky-active*=true]").forEach(e=>{e.removeAttribute("data-x-sticky-active")}),l&&(window.dispatchEvent(new Event("resize")),e.dispatchEvent(new Event("x_sticky_header:inactive")),l=!1))}var x,h,u,v,f=function(){window.innerWidth>=t?a||(window.addEventListener("scroll",y),a=!0):(a&&(document.body.style.marginTop="0",document.documentElement.style.setProperty("--x-header-height","0px"),e.classList.remove("x-header_sticky-active"),e.querySelectorAll("[data-x-sticky-active*=true]").forEach(e=>{e.removeAttribute("data-x-sticky-active")}),window.removeEventListener("scroll",y)),a=!1)};if(e.querySelector(".brxe-logo img")&&e.querySelector(".brxe-logo").getAttribute("data-x-logo-inverse")){let g=e.querySelector(".brxe-logo img").src,p=e.querySelector(".brxe-logo").getAttribute("data-x-logo-inverse");e.addEventListener("x_sticky_header:active",function(){e.querySelector(".brxe-logo img").setAttribute("srcset",""),e.querySelector(".brxe-logo img").src=p}),e.addEventListener("x_sticky_header:inactive",function(){e.querySelector(".brxe-logo img").src=g})}f(),window.addEventListener("resize",(x=()=>{f()},h=h||100,function e(){clearTimeout(u);var t=arguments,i=this;u=setTimeout(function e(){x.apply(i,t)},h)}))}document.addEventListener("DOMContentLoaded",function(e){bricksIsFrontend&&xStickyHeader()});