{"version":3,"file":"LogoCycler.DSGSevxB.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/mCrxeakGMZe3iCB0ZXV9/oxUMste3neR8dcVmzwaE/LogoCycler.js"],"sourcesContent":["// Logo Carousel that cycles through 3 CMS-connected logos\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * Logo Carousel\n *\n * Cycles through 3 logo images, each connected via ResponsiveImage for CMS support.\n *\n * @framerIntrinsicWidth 120\n * @framerIntrinsicHeight 60\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function LogoCycler(props){const defaultLogos=[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Logo 1\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Logo 2\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Logo 3\"},{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Logo 4\"},{src:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",alt:\"Logo 5\"}];const{logos=[],interval=5e3,groupId=0,groupCount=2,style}=props;// Only use provided logos with a src, fallback to defaults if none set\nconst filteredLogos=(logos&&logos.length>0?logos.filter(l=>l&&l.src):[]).slice(0,5);const safeLogos=filteredLogos.length>0?filteredLogos:defaultLogos;// Shuffle order per instance\nconst[order,setOrder]=useState([]);const[logoIndex,setLogoIndex]=useState(0);const[globalStep,setGlobalStep]=useState(0);const isStatic=useIsStaticRenderer();// Shuffle function\nfunction shuffleArray(arr){const a=arr.slice();for(let i=a.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[a[i],a[j]]=[a[j],a[i]];}return a;}// On mount or when safeLogos changes, shuffle order\nuseEffect(()=>{if(safeLogos.length===0)return;// Create an array of indices\nconst indices=[...Array(safeLogos.length).keys()];// Always keep the first logo at the beginning for the initial view\n// but shuffle the rest for the cycling order\nconst initialOrder=[0,...shuffleArray(indices.slice(1))];setOrder(initialOrder);setLogoIndex(0);},[safeLogos.length]);// Global step timer\nuseEffect(()=>{if(isStatic)return;if(safeLogos.length<=1)return;const id=window.setInterval(()=>{setGlobalStep(prev=>prev+1);},interval);return()=>clearInterval(id);},[interval,safeLogos.length,isStatic]);// Only update logoIndex if it's this group's turn (sequential, no groupSequence)\nuseEffect(()=>{if(safeLogos.length<=1)return;if(groupCount<1)return;if(groupId===globalStep%groupCount){setLogoIndex(prev=>(prev+1)%safeLogos.length);}},[globalStep,groupId,groupCount,safeLogos.length]);// Always show the first logo immediately on mount\nuseEffect(()=>{setLogoIndex(0);},[safeLogos.length,groupId,groupCount]);// Get the current logo based on the shuffled order\nconst currentOrderIndex=order.length>0?order[logoIndex%order.length]:0;const logo=safeLogos[currentOrderIndex]||defaultLogos[0];return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"visible\",background:\"transparent\",position:\"relative\"},children:/*#__PURE__*/_jsx(AnimatePresence,{mode:\"sync\",initial:false,children:/*#__PURE__*/_jsx(motion.img,{src:logo.src,srcSet:logo.srcSet,alt:logo.alt||\"Logo\",style:{maxWidth:\"100%\",maxHeight:\"100%\",objectFit:\"contain\",display:\"block\",position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\",pointerEvents:\"none\"},initial:{opacity:0,filter:\"blur(16px)\"},animate:{opacity:1,zIndex:2,filter:\"blur(0px)\"},exit:{opacity:0,zIndex:1,filter:\"blur(16px)\"},transition:{opacity:{duration:1.2,ease:props.fadeEasing,delay:.4},filter:{duration:1.2,ease:props.fadeEasing,delay:.4},// Outgoing logo fades out and blurs with same duration/easing as fade in\nexit:{duration:1.2,ease:props.fadeEasing,delay:0}}},logo.src)})});}addPropertyControls(LogoCycler,{logos:{type:ControlType.Array,title:\"Logos\",control:{type:ControlType.ResponsiveImage},maxCount:5},interval:{type:ControlType.Number,title:\"Interval (ms)\",defaultValue:5e3,min:1e3,max:2e4,step:500},groupId:{type:ControlType.Number,title:\"Group ID\",defaultValue:0,min:0,max:10,step:1,displayStepper:true},groupCount:{type:ControlType.Number,title:\"Group Count\",defaultValue:2,min:1,max:20,step:1,displayStepper:true},fadeEasing:{type:ControlType.Enum,title:\"Fade Easing\",defaultValue:\"easeInOut\",options:[\"linear\",\"easeIn\",\"easeOut\",\"easeInOut\",\"circIn\",\"circOut\",\"circInOut\",\"backIn\",\"backOut\",\"backInOut\",\"anticipate\"],optionTitles:[\"Linear\",\"Ease In\",\"Ease Out\",\"Ease In Out\",\"Circ In\",\"Circ Out\",\"Circ In Out\",\"Back In\",\"Back Out\",\"Back In Out\",\"Anticipate\"]}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LogoCycler\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"60\",\"framerIntrinsicWidth\":\"120\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LogoCycler.map"],"mappings":"gbAWG,SAAwB,EAAW,EAAM,CAAC,IAAM,EAAa,CAAC,CAAC,IAAI,sEAAsE,IAAI,SAAS,CAAC,CAAC,IAAI,oEAAoE,IAAI,SAAS,CAAC,CAAC,IAAI,uEAAuE,IAAI,SAAS,CAAC,CAAC,IAAI,oEAAoE,IAAI,SAAS,CAAC,CAAC,IAAI,sEAAsE,IAAI,SAAS,CAAC,CAAM,CAAC,QAAM,EAAE,CAAC,WAAS,IAAI,UAAQ,EAAE,aAAW,EAAE,SAAO,EAChjB,G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