{"version":3,"file":"Slideshow_1.CjoscDhp.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/knEZRDVkZ1fXsZDvM2Pi/NyN1RMPy5v3kAmV6mfY9/Slideshow_1.js"],"sourcesContent":["// Cinematic looping slideshow component with zoom-out effect and smooth crossfades.\n// Uses ComponentInstance array for drag-and-drop image layers from canvas.\n// No placeholder images - renders nothing if no images are linked.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * Cinematic Slideshow\n *\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 600\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function Slideshow(props){const{images=[],zoomStart,zoomEnd,zoomDuration,fadeDuration,easing,slideDirection,slideDistance,style}=props;const[currentIndex,setCurrentIndex]=useState(0);const[isZooming,setIsZooming]=useState(true);// Filter out null, undefined, or hidden children ONCE\nconst visibleImages=images.filter(img=>{// Check if image exists and is not explicitly hidden\nif(!img)return false;// If it's a React element with props, check if it's hidden\nif(img.props&&img.props.style&&img.props.style.display===\"none\")return false;if(img.props&&img.props.style&&img.props.style.visibility===\"hidden\")return false;if(img.props&&img.props.hidden===true)return false;// Check for actual image content (mobile-specific)\nif(img.props){// Check if image has src or background\nconst hasImageSrc=img.props.src||img.props.image||img.props.background;const hasChildren=img.props.children;// If no src/image/background and no children, filter it out\nif(!hasImageSrc&&!hasChildren)return false;// Check for empty string src\nif(img.props.src===\"\"||img.props.image===\"\"||img.props.background===\"\")return false;}return true;});const hasImages=visibleImages&&visibleImages.length>0;useEffect(()=>{if(!hasImages)return;const zoomTimer=setTimeout(()=>{startTransition(()=>setIsZooming(false));},zoomDuration*1e3);return()=>clearTimeout(zoomTimer);},[currentIndex,zoomDuration,hasImages]);useEffect(()=>{if(!hasImages||isZooming)return;const fadeTimer=setTimeout(()=>{startTransition(()=>{// Cycle to next index in the VISIBLE images array only\nsetCurrentIndex(prev=>{const nextIndex=(prev+1)%visibleImages.length;return nextIndex;});setIsZooming(true);});},fadeDuration*1e3);return()=>clearTimeout(fadeTimer);},[isZooming,fadeDuration,visibleImages.length,hasImages]);// Calculate directional offset based on index (sequential pattern: right, left, top, bottom)\nconst getDirectionalOffset=index=>{if(!slideDirection)return{x:0,y:0};const pattern=index%2;switch(pattern){case 0:return{x:slideDistance,y:0};case 1:return{x:-slideDistance,y:0};default:return{x:0,y:0};}};if(!hasImages){return null;}// Ensure currentIndex is within bounds of visibleImages\nconst safeIndex=currentIndex>=visibleImages.length?0:currentIndex;const offset=getDirectionalOffset(safeIndex);// Calculate the scale needed to cover the slide offset\n// We need to ensure the image is large enough to fill the container even when offset\nconst containerWidth=typeof style?.width===\"number\"?style.width:800;const containerHeight=typeof style?.height===\"number\"?style.height:600;// Calculate how much extra scale we need based on the offset\n// Use a more aggressive calculation to ensure full coverage\nconst xScaleNeeded=Math.abs(offset.x)/containerWidth;const yScaleNeeded=Math.abs(offset.y)/containerHeight;const extraScale=Math.max(xScaleNeeded,yScaleNeeded)*2+.1;// Add the extra scale to the base zoomStart\nconst adjustedZoomStart=zoomStart+extraScale;return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",backgroundColor:\"#000\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n\t\t\t\t.slideshow-image-container > * {\n\t\t\t\t\twidth: 100% !important;\n\t\t\t\t\theight: 100% !important;\n\t\t\t\t\tobject-fit: cover !important;\n\t\t\t\t\tdisplay: block !important;\n\t\t\t\t}\n\t\t\t\t.slideshow-image-container img {\n\t\t\t\t\twidth: 100% !important;\n\t\t\t\t\theight: 100% !important;\n\t\t\t\t\tobject-fit: cover !important;\n\t\t\t\t}\n\t\t\t`}),/*#__PURE__*/_jsx(AnimatePresence,{mode:\"sync\",children:/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0,scale:adjustedZoomStart},animate:{opacity:1,scale:zoomEnd},exit:{opacity:0},transition:{scale:{duration:zoomDuration,ease:[.33,0,.9,1]},opacity:{duration:fadeDuration,ease:easing}},style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(motion.div,{className:\"slideshow-image-container\",initial:{x:offset.x,y:offset.y},animate:{x:0,y:0},transition:{x:{duration:zoomDuration,ease:easing},y:{duration:zoomDuration,ease:easing}},style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:visibleImages[safeIndex]})},safeIndex)})]});}addPropertyControls(Slideshow,{images:{type:ControlType.Array,title:\"Images\",control:{type:ControlType.ComponentInstance},maxCount:20},zoomStart:{type:ControlType.Number,title:\"Zoom Start\",defaultValue:1.05,min:1,max:1.5,step:.01,displayStepper:true},zoomEnd:{type:ControlType.Number,title:\"Zoom End\",defaultValue:1,min:.8,max:1.2,step:.01,displayStepper:true},zoomDuration:{type:ControlType.Number,title:\"Zoom Duration\",defaultValue:18,min:1,max:20,step:.1,unit:\"s\"},fadeDuration:{type:ControlType.Number,title:\"Fade Duration\",defaultValue:2,min:.1,max:5,step:.1,unit:\"s\"},easing:{type:ControlType.String,title:\"Easing\",defaultValue:\"cubic-bezier(0.33, 0.0, 0.2, 1.0)\",placeholder:\"cubic-bezier(...)\"},slideDirection:{type:ControlType.Boolean,title:\"Slide Direction\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},slideDistance:{type:ControlType.Number,title:\"Slide Distance\",defaultValue:100,min:0,max:500,step:10,unit:\"px\",hidden:props=>!props.slideDirection}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Slideshow\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"600\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutW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