!function(t){var e={};function i(s){if(e[s])return e[s].exports;var n=e[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(s,n,function(e){return t[e]}.bind(null,n));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=41)}({41:function(t,e){const 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}],s=[];for(let t=0;t<i.length;t++)s.push(i[t].label);let n=window.innerWidth;function o(t,e){clearTimeout(t.timeId),t.timeId=setTimeout(()=>{t()},e)}function a(t){this.selector=t,this.isCollapsed=!1,this.isTablet=!1,this.isMobile=!1,this.isDesktop=!1,this.isAtTop=!0,this.hasScrolled=!1,this.isMinified=!1,this.hasOverlay=!1,this.lastActiveTab=null,this.tabsClosed=!0,this.isInlineBKF=document.querySelector(".btf-mobile-inline"),this.element=document.getElementById(t),this.header=document.getElementById("header"),this.tabsWrapper=document.getElementById("nav-btld"),this.tabs=this.getJPBTabs()}a.prototype.getJPBTabs=function(){const t=[];if(this.tabsWrapper){const e=this.tabsWrapper.querySelectorAll('a[data-bs-toggle="tab"]');e&&e.forEach(e=>{const i=e.id.replace("tbt-","");"tbh-btld"!==i&&t.push(i)})}return t},a.prototype.handleScroll=function(){const t=document.body.classList.contains("page-no-scrolling");document.body.classList.contains("page-overlay-on")||t||this.isMobile&&this.isInlineBKF||this.tabsWrapper&&(window.scrollY>this.tabsWrapper.offsetHeight?this.minify():this.unminify())},a.prototype.handleResize=function(){const t=window.innerWidth;t!==n&&(this.setState(),this.showLastActiveTab(),this.hideLastActiveTab(),this.handleScroll(),n=t)},a.prototype.minify=function(){this.isMinified||(this.isMinified=!0,this.element.dataset.isMinified=!0,this.header.classList.add("header-minify"),this.hideLastActiveTab(!0))},a.prototype.unminify=function(){this.isMinified&&(this.isMinified=!1,this.element.dataset.isMinified=!1,this.header.classList.remove("header-minify"),this.showLastActiveTab())},a.prototype.setState=function(){const t=function(){const t=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;for(let e=0;e<i.length;e++){const s=i[e].value;let n=1e4;if(i[e+1]&&(n=i[e+1].value),t>=s&&t<n)return i[e].label}return!1}();this.isTablet=!1,this.isMobile=!1,this.isDesktop=!1,"lg"===t||"xl"===t||"xxl"===t?this.isDesktop=!0:"md"===t?this.isTablet=!0:"sm"!==t&&"xs"!==t||(this.isMobile=!0)},a.prototype.showLastActiveTab=function(){if(this.isDesktop||this.isInlineBKF){let t=!1;t=this.lastActiveTab?this.tabs[this.lastActiveTab]:this.tabs[0];const e=document.getElementById("tbt-"+t);t&&e&&(this.tabsClosed=!1,new window.Tab(e).show())}},a.prototype.hideLastActiveTab=function(t=!1){if(this.tabsClosed=!1,this.isMobile||this.isTablet||t){const t=document.getElementById("tbt-tbh-btld");t&&(t.classList.contains("active")||(new window.Tab(t).show(),(this.isMobile||this.isTablet)&&(this.tabsClosed=!0)))}},a.prototype.setListeners=function(){const t=this;window.addEventListener("scroll",()=>{o(()=>{t.handleScroll()},100)}),window.addEventListener("resize",()=>{o(()=>{t.handleResize()},100)}),this.tabs.forEach((e,i)=>{const s=document.getElementById("tbt-"+e);s&&(s.addEventListener("mousedown",e=>{(this.isMobile||this.isTablet)&&(t.lastActiveTab!==i||t.tabsClosed?(t.tabsClosed=!1,t.lastActiveTab=null):(t.hideLastActiveTab(),e.preventDefault())),this.isMobile&&this.isInlineBKF&&0!==window.scrollY&&(window.scrollToTop(200),t.tabsClosed&&this.showLastActiveTab())}),s.addEventListener("show.bs.tab",e=>{if(this.isMobile||this.isTablet){if(t.lastActiveTab===i&&t.tabsClosed)return void e.preventDefault();document.body.classList.add("page-overlay-on")}t.lastActiveTab=i}),s.addEventListener("hide.bs.tab",()=>{(this.isMobile||this.isTablet)&&document.body.classList.remove("page-overlay-on")}))})},a.prototype.constructMe=function(){this.setState(),this.setListeners(),this.showLastActiveTab(),this.isMobile&&!this.isInlineBKF&&this.hideLastActiveTab()},function(t,e){t.behaviors.journeyPlannerBar={attach(t){console.log("Loaded -- Journey Panner Bar"),e("journeyPlanner","html",document).forEach(t=>{new a("hdr").constructMe()})}}}(Drupal,once)}});
//# sourceMappingURL=journey-planner-bar.js.map