var TF_Slideshow=function(){function e(e){this.id=e,this.selector="#"+this.id,this.thumbs_selector="#thumbs_"+this.id,this.wrapper=document.querySelector(this.selector),this.options=JSON.parse(this.wrapper.dataset.options),this.maybeLoadLightbox(),this.swiper=null,this.thumbsSwiper=null}var t=e.prototype;return t.init=function(){var e,i=this,o=this.wrapper.querySelector(".autoplay-progress-circle svg")||!1,r=this.wrapper.querySelector(".autoplay-progress-circle span")||!1,n=parseFloat(getComputedStyle(this.wrapper).getPropertyValue("--slideshow-slides-per-view")||1),p=parseFloat(getComputedStyle(this.wrapper).getPropertyValue("--slideshow-space-between-slides")||0),t=(1===n&&(p=0),this.options.transition_effect),t=(1<n&&"slide"!==t&&(t="slide",this.wrapper.querySelector(".swiper-cube-shadow"))&&this.wrapper.querySelector(".swiper-cube-shadow").remove(),{spaceBetween:p,loop:this.options.infinite_loop,effect:t,slidesPerView:n,on:{autoplayTimeLeft:function(e,t,s){i.options.autoplay_progress&&(o.style.setProperty("--progress",1-s),r.textContent=Math.ceil(t/1e3)+"s")},resize:function(e){var t=parseFloat(getComputedStyle(i.wrapper).getPropertyValue("--slideshow-slides-per-view")||1),s=parseFloat(getComputedStyle(i.wrapper).getPropertyValue("--slideshow-space-between-slides")||0);n===t&&p===s||(i.thumbsSwiper.destroy(),i.swiper.destroy(),i.init())}}});this.options.autoplay&&(t.autoplay={delay:parseInt(this.options.autoplay_delay),disableOnInteraction:!1}),"arrows"===this.options.nav_controls||"arrows_dots"===this.options.nav_controls?t.navigation={nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}:t.navigation={enabled:!1},"dots"===this.options.nav_controls||"arrows_dots"===this.options.nav_controls?t.pagination={el:".swiper-pagination",clickable:!0}:t.pagination={enabled:!1},this.options.keyboard_control&&(t.keyboard={enabled:!0}),this.options.show_thumbnails&&(e={spaceBetween:10,slidesPerView:"auto",loop:!0},this.options.show_thumbnails_arrows&&(e.navigation={nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}),this.thumbsSwiper=new Swiper(this.thumbs_selector,e),t.thumbs={swiper:this.thumbsSwiper}),this.swiper=new Swiper(this.selector,t)},t.maybeLoadLightbox=function(){var e;this.options.lightbox&&(e={selector:".tf-gallery-lightbox-item."+this.id,touchNavigation:!0},GLightbox(e))},e}(),TF_Slideshows=function(){function e(){this.init()}var t=e.prototype;return t.init=function(){this.getSlideshows().forEach(function(e){new TF_Slideshow(e.id).init()})},t.getSlideshows=function(){return document.querySelectorAll(".nrf-widget.tf-slideshow-wrapper")},e}();document.addEventListener("DOMContentLoaded",function(e){new TF_Slideshows});

