{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/LQcy96kraZrp4lWST6hR/tZ0ZCluTYFzU6z7UsTGF/CMS_Shuffler.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,Children}from\"react\";// @ts-ignore\nimport{useQueryData}from\"framer\";function shuffleArray(array){for(let i=array.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[array[i],array[j]]=[array[j],array[i]];}return array;}// Shuffle the children of a stack or grid layout\nexport function Shuffle(Component){return props=>{const{children,...otherProps}=props;const childrenArray=Children.toArray(children);const[shuffledChildren,setShuffledChildren]=useState([]);useEffect(()=>{setShuffledChildren(shuffleArray(childrenArray));},[]);return /*#__PURE__*/_jsx(Component,{...otherProps,children:shuffledChildren});};}// Shuffle the children of a CMS Collection List\nexport function ShuffleCMSCollectionList(Component){return props=>{var _props_children_props,_props_children,_query_from,_props_children_props1,_props_children1;const query=(_props_children=props.children)===null||_props_children===void 0?void 0:(_props_children_props=_props_children.props)===null||_props_children_props===void 0?void 0:_props_children_props.query;const[shuffledData,setShuffledData]=useState((query===null||query===void 0?void 0:(_query_from=query.from)===null||_query_from===void 0?void 0:_query_from.data)||[]);if(!query){return /*#__PURE__*/_jsx(Component,{...props});}useEffect(()=>{var _query_from;const data=query===null||query===void 0?void 0:(_query_from=query.from)===null||_query_from===void 0?void 0:_query_from.data;if(data){const newData=[];for(const i in data){newData[i]=data[i];}setShuffledData(shuffleArray(newData));}},[]);return /*#__PURE__*/_jsx(Component,{...props,children:(_props_children1=props.children)===null||_props_children1===void 0?void 0:(_props_children_props1=_props_children1.props)===null||_props_children_props1===void 0?void 0:_props_children_props1.children(useQueryData({...query,from:{...query===null||query===void 0?void 0:query.from,data:shuffledData}}))});};}\nexport const __FramerMetadata__ = {\"exports\":{\"ShuffleCMSCollectionList\":{\"type\":\"reactHoc\",\"name\":\"ShuffleCMSCollectionList\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Shuffle\":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CAAC,GAAGV,EAAM,KAAK,CAAC,GAAuCA,GAAM,KAAK,KAAKC,CAAY,CAAC,CAAC,CAAC,CAAC,CAAC,GAA9oBQ,EAAKhB,EAAU,CAAC,GAAGC,CAAK,CAAC,CAAunB,CAAE",
  "names": ["shuffleArray", "array", "i", "j", "ShuffleCMSCollectionList", "Component", "props", "_props_children_props", "_props_children", "_query_from", "_props_children_props1", "_props_children1", "query", "shuffledData", "setShuffledData", "ye", "ue", "data", "newData", "i", "shuffleArray", "p", "useQueryData"]
}
