"use strict";class kinseySwiperBase extends elementorModules.frontend.handlers.Base{getDefaultSettings(){return{selectors:{carousel:`.${elementorFrontend.config.swiperClass}`,slideContent:".swiper-slide"}}}getDefaultElements(){var e=this.getSettings("selectors");const t={$swiperContainer:this.$element.find(e.carousel)};return t.$slides=t.$swiperContainer.find(e.slideContent),t}getSwiperSettings(){const s=this.getElementSettings(),e=s.slides_to_show||("vertical"===s.direction?"1":"3"),t="1"===e,i=elementorFrontend.config.responsive.activeBreakpoints,n={mobile:1,tablet:t?1:2},a={slidesPerView:e,loop:"yes"===s.infinite,speed:s.speed,handleElementorBreakpoints:!0,watchSlidesProgress:!0,breakpoints:{}};let r=e,o=30;if(s.spaceBetween&&(a.spaceBetween=s.spaceBetween.size,o=s.spaceBetween.size||30),Object.keys(i).reverse().forEach(e=>{var t=n[e]||r;a.breakpoints[i[e].value]={slidesPerView:+s["slides_to_show_"+e]||t,slidesPerGroup:+s["slides_to_scroll_"+e]||1},r=+s["slides_to_show_"+e]||t,void 0!==s["spaceBetween_"+e]&&(a.breakpoints[i[e].value].spaceBetween=+s["spaceBetween_"+e].size||o,o=+s["spaceBetween_"+e].size||30)}),"yes"!==s.autoplay||this.hasNesting()&&elementorFrontend.isEditMode()||(a.autoplay={delay:s.autoplay_speed,disableOnInteraction:"yes"===s.pause_on_interaction}),"yes"===s.mousewheel&&(a.mousewheel=!0),void 0===s.allowTouchMove&&(a.allowTouchMove=!1),"yes"===s.autoheight?a.autoHeight=!0:a.autoHeight=!1,"yes"===s.lazyload&&(a.lazy=!0),t)switch(s.effect){case"fade":a.effect="fade",a.fadeEffect={crossFade:!0};break;case"flip":a.effect="flip",a.flipEffect={slideShadows:!1};break;case"cube":a.effect="cube",a.cubeEffect={slideShadows:!1};break;case"creative":a.effect="creative",a.creativeEffect={prev:{translate:[0,0,-400]},next:{translate:["100%",0,0]}};break;case"cards":a.loop=!1,a.rewind="yes"===s.infinite,a.effect="cards",a.cardsEffect={slideShadows:!1};break;case"coverflow":var l=this.elements.$swiperContainer.find(".swiper-slide").length,l=l%2==0?(l-1)/2:Math.floor(l/2);a.initialSlide=l,a.effect="coverflow",a.coverflowEffect={depth:500,rotate:20,slideShadows:!0};break;case"marquee":a.loop=!0,a.speed=Math.abs(s.marquee_speed-1e4)||5e3,a.allowTouchMove=!1,a.direction="vertical"===s.direction?"vertical":"horizontal",a.autoHeight="vertical"===s.direction,a.autoplay={delay:0,disableOnInteraction:!1,reverseDirection:Boolean(s.reverse)};break;default:a.effect="slide",a.watchSlidesProgress=!0,a.speed=500}else a.slidesPerGroup=+s.slides_to_scroll||1;var c="arrows"===s.navigation||"both"===s.navigation,d="dots"===s.navigation||"both"===s.navigation||"custom"===s.navigation;if(c&&(a.navigation={prevEl:this.$element.find(".elementor-swiper-button-prev").get(0),nextEl:this.$element.find(".elementor-swiper-button-next").get(0)}),d){let e=this.$element.find(".swiper-pagination").get(0);"number"==s.navigation_type?(a.pagination={el:e,clickable:!0,bulletClass:"swiper-pagination-number",bulletActiveClass:"swiper-pagination-number-active",renderBullet:function(e,t){return''+("0"+(e+1)).slice(-2)+""}},e.classList+=" swiper-pagination-numbers"):"fraction"==s.navigation_type?a.pagination={el:e,type:"fraction",formatFractionCurrent:function(e){return e<10?"0"+e:e},formatFractionTotal:function(e){return e<10?"0"+e:e},renderFraction:function(e,t){return''}}:a.pagination={el:e,type:s.navigation_type,clickable:!0}}return void 0!==s.enable_scrollbar&&"yes"===s.enable_scrollbar&&(a.scrollbar={el:this.$element.find(".swiper-scrollbar").get(0),hide:!1,draggable:!0}),this.hasNesting()&&elementorFrontend.isEditMode()&&(a.loop=!1),"vertical"===s.direction&&(a.direction="vertical",a.slidesPerView=1,a.breakpoints={},a.fadeEffect={crossFade:!1},a.on={init:function(e){var t=e.slides[e.activeIndex].children[0];jQuery(e.$el).css({height:t.clientHeight})},slideChange:function(e){var t=e.slides[e.activeIndex].children[0];jQuery(e.$el).css({height:t.clientHeight})}}),a}updateSwiperOption(e){const t=this.getElementSettings(),s=t[e],i=this.swiper.params;switch(e){case"image_spacing_custom":i.spaceBetween=s.size||0;break;case"autoplay_speed":i.autoplay.delay=s;break;case"speed":i.speed=s}this.swiper.update()}getChangeableProperties(){return{pause_on_hover:"pauseOnHover",autoplay_speed:"delay",speed:"speed",image_spacing_custom:"spaceBetween"}}onElementChange(e){var t;this.getChangeableProperties()[e]&&("pause_on_hover"===e?(t=this.getElementSettings("pause_on_hover"),this.togglePauseOnHover("yes"===t)):this.updateSwiperOption(e))}onEditSettingsChange(e){"activeItemIndex"===e&&this.swiper.slideToLoop(this.getEditSettings("activeItemIndex")-1)}async onInit(){if(super.onInit(...arguments),await this.wrapNestedContainers(),this.elements.$slides=this.elements.$swiperContainer.find(this.getSettings("selectors").slideContent),this.elements.$swiperContainer.length&&!(this.elements.$slides.length<1)){const e=elementorFrontend.utils.swiper;try{this.swiper||(this.swiper=await new e(this.elements.$swiperContainer,this.getSwiperSettings()),this.elements.$swiperContainer.trigger("swiperInit"),this.elements.$swiperContainer.data("swiper",this.swiper)),"yes"===this.getElementSettings().pause_on_hover&&this.togglePauseOnHover(!0),this.hasNesting()&&elementorFrontend.isEditMode()&&this.swiper.update(),this.triggerElements(this.swiper)}catch(e){console.error("Swiper initialization failed:",e)}}}hasNesting(){return["VartexCapital-nested-slide"].includes(this.getWidgetType())}async wrapNestedContainers(){return this.hasNesting()&&elementorFrontend.isEditMode()?new Promise(e=>{this.elements.$swiperContainer.find('[data-nesting-level="0"]').each(function(){const e=jQuery(this);e.parent().hasClass("swiper-slide")||e.wrap('
')}),e()}):Promise.resolve()}togglePauseOnHover(e){e?this.elements.$swiperContainer.on({mouseenter:()=>{this.swiper.autoplay.stop()},mouseleave:()=>{this.swiper.autoplay.start()}}):this.elements.$swiperContainer.off("mouseenter mouseleave")}triggerElements(t){this.hasNesting()&&t.on("slideChange",()=>{t.slides.forEach(e=>{jQuery(e).find(".elementor-element.animated").each(function(){const e=jQuery(this),t=e.attr("data-settings");let s=null;if(t)try{var i=t.replace(/(\w+):/g,'"$1":').replace(/'/g,'"'),n=JSON.parse(i);s=n._animation||n.animation}catch(e){console.warn("error parse data-settings:",t)}e.addClass("elementor-invisible").removeClass("animated"),s&&e.removeClass(s)})});var e=t.slides[t.activeIndex];jQuery(e).find(".elementor-element").each(function(){elementorFrontend.elementsHandler.runReadyTrigger(jQuery(this))})})}}