!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=102)}({102:function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}!function(t,e,r){e.behaviors.tourismHub={attach:function(e){var n=document.getElementsByClassName("th-scrollable");n&&r("tourismHubSetScrollable",n).forEach((function(e){var n=new i(e);function r(e){var n=t(e),r=n.closest(".card-header");n.css("height",r.css("height"))}t(e).find(".scroller-ctrl").each((function(e,i){i.classList.contains("left")?i.addEventListener("click",(function(t){t.preventDefault(),n.scrollLeft()}),!1):i.classList.contains("right")&&i.addEventListener("click",(function(t){t.preventDefault(),n.scrollRight()}),!1),r(i),t(i).closest(".card-header").find("img").on("load",(function(){r(i)}))})),window.addEventListener("resize",(function(){t(e).find(".scroller-ctrl").each((function(t,e){r(e)}))}))}));var o=document.querySelectorAll('#ac-th-filter-accordion [data-bs-parent="#ac-th-filter-accordion"]');if(o){var s=document.getElementById("ac-th-filter-accordion");r("tourismHubTabcordion",o).forEach((function(t){t.addEventListener("show.bs.collapse",(function(){s.classList.add("open")})),t.addEventListener("hide.bs.collapse",(function(){s.classList.remove("open")}))}))}}};var i=function(){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.$elem=t(n),this.$row=this.$elem.find(".row"),this.$elements=this.$row.find(".th-card"),this.$leftButton=this.$elem.find(".scroller-ctrl.left"),this.$rightButton=this.$elem.find(".scroller-ctrl.right"),this.currentIndex=0,this.lastIndex=this.$elements.length-1,this.scrollToIndex=function(t){var e=this.$elements[t],n=this.$row.css("marginLeft"),r=parseInt(n,10),i=e.offsetLeft-r;this.$row.animate({scrollLeft:i},500)}}var r,i,o;return r=e,(i=[{key:"scrollLeft",value:function(){if(this.$rightButton.show(),this.currentIndex<=0)return this.currentIndex=0,null;this.currentIndex=Math.max(this.currentIndex-2,0),0===this.currentIndex&&this.$leftButton.hide(),this.scrollToIndex(this.currentIndex)}},{key:"scrollRight",value:function(){if(this.$leftButton.show(),this.currentIndex>=this.lastIndex)return this.currentIndex=this.lastIndex,null;this.currentIndex=Math.min(this.currentIndex+2,this.lastIndex-2),this.currentIndex===this.lastIndex-2&&this.$rightButton.hide(),this.scrollToIndex(this.currentIndex)}}])&&n(r.prototype,i),o&&n(r,o),e}()}(jQuery,Drupal,once)}});
//# sourceMappingURL=tourism-hub.js.map