!function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=99)}({99:function(e,t){for(var i=[{label:"xs",value:0},{label:"sm",value:580},{label:"md",value:768},{label:"lg",value:992},{label:"xl",value:1200},{label:"xxl",value:3e3}],n=[],s=0;s<i.length;s++)n.push(i[s].label);var o=window.innerWidth;function r(e,t){clearTimeout(e.timeId),e.timeId=setTimeout((function(){e()}),t)}function a(e){this.selector=e,this.isMinified=!1,this.isSticky=!1,this.element=document.getElementById(e),this.header=document.getElementById("hdr"),this.wrapper=document.getElementById("header"),this.inner=document.getElementById("header-inner"),this.customTopOffest=200}function l(){var e=document.getElementById("header-top-region"),t=e?e.offsetHeight:0,i=document.getElementsByClassName("header-inner"),n=i.length>0?i[0].offsetHeight:0,s=document.getElementById("offcanvas-content"),o=document.getElementById("header");if(o&&o.classList.contains("header-minify")&&s)s.style.marginTop=n+"px";else{var r=t+n;s&&(s.style.marginTop=r+"px")}}a.prototype.handleScroll=function(){var e=document.body.classList.contains("page-no-scrolling");if(!document.body.classList.contains("page-overlay-on")&&!e){var t=this.wrapper.offsetHeight+this.wrapper.offsetTop;console.error(window.scrollY+" "+t),window.scrollY>t?this.minify():this.unminify(),window.scrollY>t+this.customTopOffest?this.sticky():this.unsticky()}},a.prototype.handleResize=function(){this.setWrapper();var e=window.innerWidth;e!==o&&(this.setState(),this.handleScroll(),o=e)},a.prototype.minify=function(){this.isMinified||(this.isMinified=!0,this.element.dataset.isMinified=!0,this.wrapper.classList.add("header-minify"))},a.prototype.unminify=function(){this.isMinified&&(this.isMinified=!1,this.element.dataset.isMinified=!1,this.wrapper.classList.remove("header-minify"))},a.prototype.sticky=function(){this.isSticky||(this.isSticky=!0,this.element.dataset.isSticky=!0,this.wrapper.classList.add("header-sticky"))},a.prototype.unsticky=function(){this.isSticky&&(this.isSticky=!1,this.element.dataset.isSticky=!1,this.wrapper.classList.remove("header-sticky"))},a.prototype.setState=function(){var e=function(){for(var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=0;t<i.length;t++){var n=i[t].value,s=1e4;if(i[t+1]&&(s=i[t+1].value),e>=n&&e<s)return i[t].label}return!1}();this.isTablet=!1,this.isMobile=!1,this.isDesktop=!1,"lg"===e||"xl"===e||"xxl"===e?this.isDesktop=!0:"md"===e?this.isTablet=!0:"sm"!==e&&"xs"!==e||(this.isMobile=!0)},a.prototype.setListeners=function(){var e=this;window.addEventListener("scroll",(function(){r((function(){e.handleScroll()}),100)})),window.addEventListener("resize",(function(){r((function(){e.handleResize()}),100)}))},a.prototype.setWrapper=function(){this.wrapper.style.height=this.header.offsetHeight+"px",this.wrapper.style.maxHeight=this.header.offsetHeight+"px"},a.prototype.constructMe=function(){this.setWrapper(),this.setState(),this.setListeners()},function(e,t){e.behaviors.pageMinfier={attach:function(e){l(),window.addEventListener("resize",l),window.addEventListener("click",l),console.log("Loaded -- Page minifier"),t("journeyPlanner","html",document).forEach((function(e){document.getElementById("hdr")&&new a("hdr").constructMe()}))}}}(Drupal,once)}});
//# sourceMappingURL=minifier.js.map