"use strict";const C=require("react/jsx-runtime"),o=require("react"),c=require("../tools/tools.cjs"),E=function(I){const{active:t=!1,as:q="div",carouselItemEnd:n=!1,carouselItemNext:u=!1,carouselItemPrev:m=!1,carouselItemStart:a=!1,className:d,dropOldClass:f,style:v,variables:L,...x}=I,y=o.useRef(null),A=o.useMemo(()=>{const e=c.classx(!f&&"carousel-item",d),r=c.stylex((s,i)=>({tKey:c.convertBsKeyToVar(i)}),L,v);return{className:e,style:r}},[d,f,v,L]);return o.useEffect(()=>{const e=y.current;if(!e)return;const r=(i,F,B)=>{i&&e.classList.add("active"),F.forEach(l=>e.classList.remove(l)),B.forEach(l=>e.classList.add(l))},s=()=>{t?r(!1,a?["active","carousel-item-start"]:["active","carousel-item-end"],[]):r(!0,a?["carousel-item-next","carousel-item-start"]:["carousel-item-prev","carousel-item-end"],[])};if(t&&a)requestAnimationFrame(()=>{e.addEventListener("transitionend",s),requestAnimationFrame(()=>{e.classList.add("active","carousel-item-start")})});else if(!t&&u&&a)requestAnimationFrame(()=>{e.addEventListener("transitionend",s),e.classList.add("carousel-item-next"),requestAnimationFrame(()=>{e.classList.add("carousel-item-start")})});else if(t&&n)requestAnimationFrame(()=>{e.addEventListener("transitionend",s),requestAnimationFrame(()=>{e.classList.add("active","carousel-item-end")})});else if(!t&&m&&n)requestAnimationFrame(()=>{e.addEventListener("transitionend",s),e.classList.add("carousel-item-prev"),requestAnimationFrame(()=>{e.classList.add("carousel-item-end")})});else{r(t,[],[]);return}return()=>{s(),e.removeEventListener("transitionend",s)}},[t,n,u,m,a]),C.jsx(q,{...x,...A,ref:y})};E.displayName="BRL.CarouselItem";exports.CarouselItem=E;
//# sourceMappingURL=carousel-item.cjs.map
