{"version":3,"file":"Carousel.BEdEBld5.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/xxj4QJxGWKuBIOkgt0w6/UJINElL0Te7U9zIRsSBr/Carousel.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/components/auto-sizing\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function Carousel({firstImage,secondImage,thirdImage,fourthImage,fifthImage,objectFit,progressBar,prograssBarMargin,style}){const images=[firstImage,secondImage,thirdImage,fourthImage,fifthImage].filter(Boolean);const totalSlides=images.length;const extendedImages=[images[totalSlides-1],...images,images[0]];const[currentIndex,setCurrentIndex]=useState(1);const[isTransitioning,setIsTransitioning]=useState(false);useEffect(()=>{if(currentIndex===0){setTimeout(()=>{setIsTransitioning(false);setCurrentIndex(totalSlides);},500);}else if(currentIndex===totalSlides+1){setTimeout(()=>{setIsTransitioning(false);setCurrentIndex(1);},500);}},[currentIndex,totalSlides]);const nextSlide=()=>{setIsTransitioning(true);setCurrentIndex(prevIndex=>prevIndex+1);};const prevSlide=()=>{setIsTransitioning(true);setCurrentIndex(prevIndex=>prevIndex-1);};const showButton=totalSlides>1;return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsxs(motion.div,{style:{...style,display:\"flex\",alignItems:\"center\",overflow:\"hidden\",borderRadius:\"24px\",position:\"relative\",width:\"100%\"},children:[showButton&&/*#__PURE__*/_jsx(\"button\",{onClick:prevSlide,style:{position:\"absolute\",top:\"50%\",left:\"10px\",background:\"transparent\",height:\"fit-content\",width:\"fit-content\",border:\"none\",cursor:\"pointer\",transform:\"translateY(-50%)\",zIndex:1},children:/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",fill:\"#FFFFFFB2\",width:\"36px\",height:\"36px\",viewBox:\"0 0 340 340\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M165,0C74.019,0,0,74.019,0,165s74.019,165,165,165s165-74.019,165-165S255.981,0,165,0z M205.606,234.394   c5.858,5.857,5.858,15.355,0,21.213C202.678,258.535,198.839,260,195,260s-7.678-1.464-10.606-4.394l-80-79.998   c-2.813-2.813-4.394-6.628-4.394-10.606c0-3.978,1.58-7.794,4.394-10.607l80-80.002c5.857-5.858,15.355-5.858,21.213,0   c5.858,5.857,5.858,15.355,0,21.213l-69.393,69.396L205.606,234.394z\"})})}),/*#__PURE__*/_jsx(\"div\",{style:{...style,display:\"flex\",alignItems:\"center\",transition:isTransitioning?\"transform 0.5s ease-in-out\":\"none\",transform:`translateX(-${currentIndex*100}%)`,width:\"100%\"},children:extendedImages.map((item,index)=>item?.src&&/*#__PURE__*/_jsx(\"img\",{src:item.src,alt:`Slide ${index}`,style:{objectFit,width:\"100%\",height:\"100%\",flexShrink:0}},index))}),showButton&&/*#__PURE__*/_jsx(\"button\",{onClick:nextSlide,style:{position:\"absolute\",top:\"50%\",right:\"10px\",background:\"transparent\",height:\"fit-content\",width:\"fit-content\",border:\"none\",cursor:\"pointer\",transform:\"translateY(-50%)\",zIndex:1},children:/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",fill:\"#FFFFFFB2\",height:\"36px\",width:\"36px\",viewBox:\"0 0 340 340\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M165,0C74.019,0,0,74.019,0,165s74.019,165,165,165s165-74.019,165-165S255.981,0,165,0z M225.606,175.605  l-80,80.002C142.678,258.535,138.839,260,135,260s-7.678-1.464-10.606-4.394c-5.858-5.857-5.858-15.355,0-21.213l69.393-69.396  l-69.393-69.392c-5.858-5.857-5.858-15.355,0-21.213c5.857-5.858,15.355-5.858,21.213,0l80,79.998  c2.814,2.813,4.394,6.628,4.394,10.606C230,168.976,228.42,172.792,225.606,175.605z\"})})})]}),progressBar&&images.length>0&&/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",justifyContent:\"center\",margin:\"0 auto\",marginTop:`${prograssBarMargin}px`,width:\"90%\"},children:images.map((_,index)=>/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"2px\",borderRadius:!index?\"2px 0 0 2px\":index===images.length-1?\"0 2px 2px 0\":0,backgroundColor:currentIndex-1===index?\"#000000\":\"#CCCCCC\",transition:\"background-color 0.3s ease-in-out\"}},index))})]});}addPropertyControls(Carousel,{firstImage:{type:ControlType.ResponsiveImage},secondImage:{type:ControlType.ResponsiveImage},thirdImage:{type:ControlType.ResponsiveImage},fourthImage:{type:ControlType.ResponsiveImage},fifthImage:{type:ControlType.ResponsiveImage},progressBar:{type:ControlType.Boolean,defaultValue:false},prograssBarMargin:{type:ControlType.Number,defaultValue:24},objectFit:{type:ControlType.Enum,options:[\"fill\",\"contain\",\"cover\",\"none\",\"scale-down\"],defaultValue:\"cover\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Carousel\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Carousel.map"],"mappings":"yOAMG,SAAwB,EAAS,CAAC,aAAW,cAAY,aAAW,cAAY,aAAW,YAAU,cAAY,oBAAkB,SAAO,CAAC,IAAM,EAAO,CAAC,EAAW,EAAY,EAAW,EAAY,CAAU,CAAC,CAAC,OAAO,OAAO,EAAQ,EAAY,EAAO,OAAa,EAAe,CAAC,EAAO,EAAY,GAAG,GAAG,EAAO,EAAO,EAAE,EAAO,CAAC,EAAa,GAAiBA,EAAS,CAAC,EAAO,CAAC,EAAgB,GAAoBA,EAAS,EAAK,EAAE,MAAc,CAAI,IAAe,EAAG,eAAe,CAAC,EAAmB,EAAK,EAAE,EAA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