/**
 * UI Initiative Carousel Slider
 *
 * Infinite 3D carousel slider
 *
 * https://uiinitiative.com
 *
 * Copyright 2024 UI Initiative
 *
 * Released under the UI Initiative Regular License
 *
 * September 12, 2024
 */

!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s():"function"==typeof define&&define.amd?define(s):(e="undefined"!=typeof globalThis?globalThis:e||self).EffectCarousel=s()}(this,(function(){"use strict";return function({swiper:e,on:s,extendParams:t}){t({carouselEffect:{opacityStep:.33,scaleStep:.2,sideSlides:2}}),s("beforeInit",(()=>{if("carousel"!==e.params.effect)return;e.classNames.push(`${e.params.containerModifierClass}carousel`);const s={watchSlidesProgress:!0,centeredSlides:!0};Object.assign(e.params,s),Object.assign(e.originalParams,s)})),s("progress",(()=>{if("carousel"!==e.params.effect)return;const{scaleStep:s,opacityStep:t}=e.params.carouselEffect,a=Math.max(Math.min(e.params.carouselEffect.sideSlides,3),1),r={1:2,2:1,3:.2}[a],i={1:50,2:50,3:67}[a],o=e.slides.length;for(let l=0;l<e.slides.length;l+=1){const n=e.slides[l],c=e.slides[l].progress,f=Math.abs(c);let u=1;f>1&&(u=.3*(f-1)*r+1);const d=n.querySelectorAll(".swiper-carousel-animate-opacity"),p=c*u*i*(e.rtlTranslate?-1:1)+"%",m=1-f*s,y=o-Math.abs(Math.round(c));n.style.transform=`translateX(${p}) scale(${m})`,n.style.zIndex=y,n.style.opacity=f>a+1?0:1,d.forEach((e=>{e.style.opacity=1-f*t}))}})),s("resize",(()=>{e.virtual&&e.params.virtual&&e.params.virtual.enabled&&requestAnimationFrame((()=>{e.destroyed||(e.updateSlides(),e.updateProgress())}))})),s("setTransition",((s,t)=>{if("carousel"===e.params.effect)for(let s=0;s<e.slides.length;s+=1){const a=e.slides[s],r=a.querySelectorAll(".swiper-carousel-animate-opacity");a.style.transitionDuration=`${t}ms`,r.forEach((e=>{e.style.transitionDuration=`${t}ms`}))}}))}}));
//# sourceMappingURL=effect-carousel.min.js.map