{"version":3,"file":"Carousel_test.5fe2SPdO.mjs","names":["useState","useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/51JAxA2jkpAA8GmvPGBI/CJM046v8cCDMunCW9Nbq/Carousel_test.js"],"sourcesContent":["// Carousel component with directly-attached slides, built-in styled arrows, and responsive configuration\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef,useState,startTransition}from\"react\";import React from\"react\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function StaticSwiper(props){const{slides:slidesProp,slidesPerViewDesktop=3,slidesPerViewMobile=1,slideGap=20,enableDrag=true,overflow=\"hidden\",stretchSlides=true,componentGapDesktop=40,componentGapMobile=24,autoplay=false,autoplayDelay=3e3,arrowSize=56,arrowBackground=\"#F2F2F0\",arrowColor=\"#1A2B3C\",arrowPosition=\"topRight\"}=props;const[currentIndex,setCurrentIndex]=useState(0);const[isDragging,setIsDragging]=useState(false);const[startX,setStartX]=useState(0);const[translateX,setTranslateX]=useState(0);const[dragOffset,setDragOffset]=useState(0);const[isMobile,setIsMobile]=useState(false);const containerRef=useRef(null);const slidesRef=useRef(null);const isCanvas=RenderTarget.current()===RenderTarget.canvas;// Slides are attached directly as an array of component instances\nconst slides=Array.isArray(slidesProp)?slidesProp.filter(Boolean):[];const totalSlides=slides.length;useEffect(()=>{if(typeof window===\"undefined\")return;const checkMobile=()=>{startTransition(()=>setIsMobile(window.innerWidth<768));};checkMobile();window.addEventListener(\"resize\",checkMobile);return()=>window.removeEventListener(\"resize\",checkMobile);},[]);const slidesPerView=isMobile?slidesPerViewMobile:slidesPerViewDesktop;const maxIndex=Math.max(0,totalSlides-slidesPerView);const componentGap=isMobile?componentGapMobile:componentGapDesktop;useEffect(()=>{if(containerRef.current){const containerWidth=containerRef.current.offsetWidth;const totalGapWidth=slideGap*(slidesPerView-1);const slideWidth=(containerWidth-totalGapWidth)/slidesPerView;const newTranslate=-(currentIndex*(slideWidth+slideGap));startTransition(()=>setTranslateX(newTranslate));}},[currentIndex,slidesPerView,slideGap,isMobile]);// Autoplay functionality\nuseEffect(()=>{if(!autoplay||isDragging)return;const interval=setInterval(()=>{setCurrentIndex(prev=>{if(prev>=maxIndex){return 0;}return prev+1;});},autoplayDelay);return()=>clearInterval(interval);},[autoplay,autoplayDelay,maxIndex,isDragging]);const handlePrevious=()=>{startTransition(()=>setCurrentIndex(prev=>Math.max(0,prev-1)));};const handleNext=()=>{startTransition(()=>setCurrentIndex(prev=>Math.min(maxIndex,prev+1)));};const handleMouseDown=e=>{if(!enableDrag)return;setIsDragging(true);setStartX(e.clientX);setDragOffset(0);};const handleMouseMove=e=>{if(!isDragging||!enableDrag)return;const diff=e.clientX-startX;setDragOffset(diff);};const handleMouseUp=()=>{if(!isDragging||!enableDrag)return;setIsDragging(false);const threshold=50;if(Math.abs(dragOffset)>threshold){if(dragOffset>0){handlePrevious();}else{handleNext();}}setDragOffset(0);};const handleTouchStart=e=>{if(!enableDrag)return;setIsDragging(true);setStartX(e.touches[0].clientX);setDragOffset(0);};const handleTouchMove=e=>{if(!isDragging||!enableDrag)return;const diff=e.touches[0].clientX-startX;setDragOffset(diff);};const handleTouchEnd=()=>{if(!isDragging||!enableDrag)return;setIsDragging(false);const threshold=50;if(Math.abs(dragOffset)>threshold){if(dragOffset>0){handlePrevious();}else{handleNext();}}setDragOffset(0);};// Built-in styled arrow button\nconst ArrowButton=({direction,onClick,disabled})=>/*#__PURE__*/_jsx(\"div\",{onClick:disabled?undefined:onClick,style:{width:arrowSize,height:arrowSize,borderRadius:\"50%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:arrowBackground,color:arrowColor,cursor:disabled?\"not-allowed\":\"pointer\",opacity:disabled?.35:1,pointerEvents:disabled?\"none\":\"auto\",transition:\"opacity 0.2s ease\",flexShrink:0},children:/*#__PURE__*/_jsx(\"svg\",{width:Math.round(arrowSize*.4),height:Math.round(arrowSize*.4),viewBox:\"0 0 24 24\",fill:\"none\",children:/*#__PURE__*/_jsx(\"path\",{d:direction===\"left\"?\"M19 12H5M5 12L12 19M5 12L12 5\":\"M5 12H19M19 12L12 5M19 12L12 19\",stroke:\"currentColor\",strokeWidth:2,strokeLinecap:\"round\",strokeLinejoin:\"round\"})})});// Arrow row alignment + placement based on position prop\nconst arrowsOnTop=arrowPosition===\"topRight\";const arrowJustify=arrowPosition===\"bottomLeft\"?\"flex-start\":arrowPosition===\"bottomCenter\"?\"center\":\"flex-end\";const controlsRow=/*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",display:\"flex\",justifyContent:arrowJustify,alignItems:\"center\",gap:12},children:[/*#__PURE__*/_jsx(ArrowButton,{direction:\"left\",onClick:handlePrevious,disabled:currentIndex<=0}),/*#__PURE__*/_jsx(ArrowButton,{direction:\"right\",onClick:handleNext,disabled:currentIndex>=maxIndex})]});const track=/*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:\"100%\",overflow:overflow,position:\"relative\"},children:totalSlides===0?/*#__PURE__*/_jsx(\"div\",{style:{padding:\"40px\",textAlign:\"center\",background:\"#f5f5f5\",borderRadius:\"8px\",color:\"#666\"},children:\"No slides found. Add slides in the “Slides” property.\"}):/*#__PURE__*/_jsx(\"div\",{ref:slidesRef,onMouseDown:handleMouseDown,onMouseMove:handleMouseMove,onMouseUp:handleMouseUp,onMouseLeave:handleMouseUp,onTouchStart:handleTouchStart,onTouchMove:handleTouchMove,onTouchEnd:handleTouchEnd,style:{display:\"flex\",alignItems:stretchSlides?\"stretch\":\"flex-start\",gap:slideGap,transform:`translateX(${translateX+dragOffset}px)`,transition:isDragging?\"none\":\"transform 0.3s ease-out\",cursor:enableDrag?isDragging?\"grabbing\":\"grab\":\"default\",userSelect:\"none\"},children:slides.map((slide,index)=>/*#__PURE__*/_jsx(\"div\",{style:{flex:`0 0 calc((100% - ${slideGap*(slidesPerView-1)}px) / ${slidesPerView})`,minWidth:0,maxWidth:`calc((100% - ${slideGap*(slidesPerView-1)}px) / ${slidesPerView})`,display:\"flex\",flexDirection:\"column\",height:stretchSlides?\"100%\":\"auto\"},children:/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:stretchSlides?\"100%\":\"auto\",display:\"flex\",flexDirection:\"column\"},children:/*#__PURE__*/React.isValidElement(slide)?/*#__PURE__*/React.cloneElement(slide,{style:{...slide.props.style||{},width:\"100%\",height:stretchSlides?\"100%\":undefined,flex:stretchSlides?1:undefined}}):slide})},index))})});return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",display:\"flex\",flexDirection:\"column\",gap:componentGap},children:arrowsOnTop?/*#__PURE__*/_jsxs(_Fragment,{children:[controlsRow,track]}):/*#__PURE__*/_jsxs(_Fragment,{children:[track,controlsRow]})});}StaticSwiper.displayName=\"Static Swiper\";addPropertyControls(StaticSwiper,{slides:{type:ControlType.Array,title:\"Slides\",control:{type:ControlType.ComponentInstance},defaultValue:[]},slidesPerViewDesktop:{type:ControlType.Number,title:\"Slides (Desktop)\",defaultValue:3,min:1,max:10,step:.1,displayStepper:true},slidesPerViewMobile:{type:ControlType.Number,title:\"Slides (Mobile)\",defaultValue:1,min:1,max:5,step:.1,displayStepper:true},slideGap:{type:ControlType.Number,title:\"Slide Gap\",defaultValue:20,min:0,max:100,step:1,unit:\"px\"},enableDrag:{type:ControlType.Boolean,title:\"Enable Drag\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},overflow:{type:ControlType.Enum,title:\"Overflow\",options:[\"visible\",\"hidden\"],optionTitles:[\"Visible (peek)\",\"Hidden (clip)\"],defaultValue:\"hidden\",displaySegmentedControl:true},stretchSlides:{type:ControlType.Boolean,title:\"Stretch Slides\",defaultValue:true,enabledTitle:\"Fill\",disabledTitle:\"Auto\"},arrowSize:{type:ControlType.Number,title:\"Arrow Size\",defaultValue:56,min:24,max:120,step:1,unit:\"px\"},arrowBackground:{type:ControlType.Color,title:\"Arrow BG\",defaultValue:\"#F2F2F0\"},arrowColor:{type:ControlType.Color,title:\"Arrow Color\",defaultValue:\"#1A2B3C\"},arrowPosition:{type:ControlType.Enum,title:\"Arrow Position\",options:[\"topRight\",\"bottomRight\",\"bottomLeft\",\"bottomCenter\"],optionTitles:[\"Top Right\",\"Bottom Right\",\"Bottom Left\",\"Bottom Center\"],defaultValue:\"topRight\"},componentGapDesktop:{type:ControlType.Number,title:\"Component Gap (Desktop)\",defaultValue:40,min:0,max:100,step:1,unit:\"px\"},componentGapMobile:{type:ControlType.Number,title:\"Component Gap (Mobile)\",defaultValue:24,min:0,max:100,step:1,unit:\"px\"},autoplay:{type:ControlType.Boolean,title:\"Autoplay\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},autoplayDelay:{type:ControlType.Number,title:\"Autoplay Delay\",defaultValue:3e3,min:500,max:1e4,step:100,unit:\"ms\",hidden:props=>!props.autoplay}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StaticSwiper\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Carousel_test.map"],"mappings":"0OAIG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,OAAO,EAAW,uBAAqB,EAAE,sBAAoB,EAAE,WAAS,GAAG,aAAW,GAAK,WAAS,SAAS,gBAAc,GAAK,sBAAoB,GAAG,qBAAmB,GAAG,WAAS,GAAM,gBAAc,IAAI,YAAU,GAAG,kBAAgB,UAAU,aAAW,UAAU,gBAAc,YAAY,EAAW,CAAC,EAAa,GAAiBA,EAAS,CAAC,EAAO,CAAC,EAAW,GAAeA,EAAS,EAAK,EAAO,CAAC,EAAO,GAAWA,EAAS,CAAC,EAAO,CAAC,EAAW,GAAeA,EAAS,CAAC,EAAO,CAAC,EAAW,GAAeA,EAAS,CAAC,EAAO,C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