{"version":3,"file":"RandomSort.D22x1ihC.mjs","names":["useRef","__esmMin","init_npm_react_18_3_1","ce","init_jsx_runtime","c","de","withShuffledItems","init_RandomSort","componentRef","shuffleAndDisplayItems","container","items","i","j","item","Component","props"],"sources":["https:/framerusercontent.com/modules/5TGgM0oYWJHiA9TqBHdF/Sx9X9wJaB5Bh0uZbQf2f/RandomSort.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";export const withShuffledItems=Component=>{const ShuffledComponent=props=>{const componentRef=useRef(null);const shuffleAndDisplayItems=()=>{const container=componentRef.current;if(!container)return;// get child nodes of our collection\nlet items=Array.from(container.children);// Shuffle the array\nfor(let i=items.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[items[i],items[j]]=[items[j],items[i]];}// Re-append items to the container to reflect the new order in the DOM\nitems.forEach(item=>{// Move item to the end of the container, effectively reordering them\ncontainer.appendChild(item);});};useEffect(()=>{shuffleAndDisplayItems()// Shuffle and display items on component mount\n;},[])// Empty dependency array ensures this runs once after the initial render\n;return /*#__PURE__*/_jsx(Component,{ref:componentRef,...props});};return ShuffledComponent;};\nexport const __FramerMetadata__ = {\"exports\":{\"withShuffledItems\":{\"type\":\"reactHoc\",\"name\":\"withShuffledItems\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RandomSort.map"],"mappings":"A,qKAA4F,EAAkB,GAAoC,GAAO,CAAC,IAAMS,EAAaT,EAAO,IAAI,EAAQU,MAA2B,CAAC,IAAMC,EAAUF,EAAa,QAAQ,GAAG,CAACE,EAAU,OAC/Q,IAAIC,EAAM,MAAM,KAAKD,EAAU,QAAQ,EACvC,IAAI,IAAIE,EAAED,EAAM,OAAO,EAAEC,EAAE,EAAE,IAAI,CAAC,IAAMC,EAAE,KAAK,MAAM,KAAK,OAAO,GAAGD,EAAE,EAAE,EAAE,CAACD,EAAMC,GAAGD,EAAME,IAAI,CAACF,EAAME,GAAGF,EAAMC,EAAE,CAAE,CAClHD,EAAM,QAAQ,GAAM,CACpBD,EAAU,YAAYI,CAAI,CAAE,CAAC,CAAE,EAE9B,OAFgCZ,MAAc,CAACO,EAAuB,CACtE,EAAE,CAAC,CAAC,EACgB,gBAAKM,EAAU,CAAC,IAAIP,EAAa,GAAGQ,CAAK,CAAC,CAAE,C"}