"use strict";(()=>{(self.webpackChunkFalcon_theme=self.webpackChunkFalcon_theme||[]).push([[333],{8333:(g,b,o)=>{o.r(b),o.d(b,{default:()=>S});var x=o(7628),p=o(9482);function S({swiper:e,extendParams:I,on:m}){I({thumbs:{swiper:null,multipleActiveThumbs:!0,autoScrollOffset:0,slideThumbActiveClass:"swiper-slide-thumb-active",thumbsContainerClass:"swiper-thumbs"}});let T=!1,v=!1;e.thumbs={swiper:null};function w(){const t=e.thumbs.swiper;if(!t||t.destroyed)return;const s=t.clickedIndex,i=t.clickedSlide;if(i&&i.classList.contains(e.params.thumbs.slideThumbActiveClass)||typeof s=="undefined"||s===null)return;let a;t.params.loop?a=parseInt(t.clickedSlide.getAttribute("data-swiper-slide-index"),10):a=s,e.params.loop?e.slideToLoop(a):e.slideTo(a)}function c(){const{thumbs:t}=e.params;if(T)return!1;T=!0;const s=e.constructor;if(t.swiper instanceof s)e.thumbs.swiper=t.swiper,Object.assign(e.thumbs.swiper.originalParams,{watchSlidesProgress:!0,slideToClickedSlide:!1}),Object.assign(e.thumbs.swiper.params,{watchSlidesProgress:!0,slideToClickedSlide:!1}),e.thumbs.swiper.update();else if((0,p.Kn)(t.swiper)){const i=Object.assign({},t.swiper);Object.assign(i,{watchSlidesProgress:!0,slideToClickedSlide:!1}),e.thumbs.swiper=new s(i),v=!0}return e.thumbs.swiper.el.classList.add(e.params.thumbs.thumbsContainerClass),e.thumbs.swiper.on("tap",w),!0}function u(t){const s=e.thumbs.swiper;if(!s||s.destroyed)return;const i=s.params.slidesPerView==="auto"?s.slidesPerViewDynamic():s.params.slidesPerView;let a=1;const n=e.params.thumbs.slideThumbActiveClass;if(e.params.slidesPerView>1&&!e.params.centeredSlides&&(a=e.params.slidesPerView),e.params.thumbs.multipleActiveThumbs||(a=1),a=Math.floor(a),s.slides.forEach(r=>r.classList.remove(n)),s.params.loop||s.params.virtual&&s.params.virtual.enabled)for(let r=0;r<a;r+=1)(0,p.gD)(s.slidesEl,`[data-swiper-slide-index="${e.realIndex+r}"]`).forEach(l=>{l.classList.add(n)});else for(let r=0;r<a;r+=1)s.slides[e.realIndex+r]&&s.slides[e.realIndex+r].classList.add(n);const d=e.params.thumbs.autoScrollOffset,f=d&&!s.params.loop;if(e.realIndex!==s.realIndex||f){const r=s.activeIndex;let l,h;if(s.params.loop){const C=s.slides.filter(P=>P.getAttribute("data-swiper-slide-index")===`${e.realIndex}`)[0];l=s.slides.indexOf(C),h=e.activeIndex>e.previousIndex?"next":"prev"}else l=e.realIndex,h=l>e.previousIndex?"next":"prev";f&&(l+=h==="next"?d:-1*d),s.visibleSlidesIndexes&&s.visibleSlidesIndexes.indexOf(l)<0&&(s.params.centeredSlides?l>r?l=l-Math.floor(i/2)+1:l=l+Math.floor(i/2)-1:l>r&&s.params.slidesPerGroup,s.slideTo(l,t?0:void 0))}}m("beforeInit",()=>{const{thumbs:t}=e.params;if(!(!t||!t.swiper))if(typeof t.swiper=="string"||t.swiper instanceof HTMLElement){const s=(0,x.Me)(),i=()=>{const n=typeof t.swiper=="string"?s.querySelector(t.swiper):t.swiper;if(n&&n.swiper)t.swiper=n.swiper,c(),u(!0);else if(n){const d=f=>{t.swiper=f.detail[0],n.removeEventListener("init",d),c(),u(!0),t.swiper.update(),e.update()};n.addEventListener("init",d)}return n},a=()=>{if(e.destroyed)return;i()||requestAnimationFrame(a)};requestAnimationFrame(a)}else c(),u(!0)}),m("slideChange update resize observerUpdate",()=>{u()}),m("setTransition",(t,s)=>{const i=e.thumbs.swiper;!i||i.destroyed||i.setTransition(s)}),m("beforeDestroy",()=>{const t=e.thumbs.swiper;!t||t.destroyed||v&&t.destroy()}),Object.assign(e.thumbs,{init:c,update:u})}}}]);})();
