{"version":3,"file":"Sidebar.DuA2aLBT.mjs","names":[],"sources":["https:/framerusercontent.com/modules/0ZlLgzxShyqu8F1ANKtR/o29IgQEFndRYNUEbXXmV/Sidebar.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{atom,useAtom}from\"jotai\";import{atomWithStorage}from\"jotai/utils\";import React from\"react\";// Create an atom for sidebar state\n// false = expanded, true = collapsed\nconst sidebarStateAtom=atomWithStorage(\"dashfolioSidebarState\",false);// Create an atom for window width\nconst windowWidthAtom=typeof window!==\"undefined\"?atom(window.innerWidth):atom(0);export const withSaveSidebarState=Component=>{return props=>{const[sidebarSate,setSidebarState]=useAtom(sidebarStateAtom);const handleClick=()=>{let newSidebarState=!sidebarSate;setSidebarState(newSidebarState);window.dispatchEvent(new Event(\"sidebarStateChanged\"));};return /*#__PURE__*/ _jsx(Component,{...props,onClick:handleClick});};};export const withSidebarSate=Component=>{return props=>{const[sidebarSate,setSidebarState]=useAtom(sidebarStateAtom);const[windowWidth,setWindowWidth]=useAtom(windowWidthAtom);if(typeof window!==\"undefined\"){React.useEffect(()=>{const handleResize=()=>{setWindowWidth(window.innerWidth);};window.addEventListener(\"resize\",handleResize);// Cleanup\nreturn()=>{window.removeEventListener(\"resize\",handleResize);};},[]);}if(sidebarSate&&windowWidth>=1200){return /*#__PURE__*/ _jsx(Component,{...props,variant:\"Collapsed\"});}else{return /*#__PURE__*/ _jsx(Component,{...props});}};};\nexport const __FramerMetadata__ = {\"exports\":{\"withSaveSidebarState\":{\"type\":\"reactHoc\",\"name\":\"withSaveSidebarState\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSidebarSate\":{\"type\":\"reactHoc\",\"name\":\"withSidebarSate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Sidebar.map"],"mappings":"8NAA0C,IAAgC,IAAyC,IAAyB,EAEtI,EAAiB,EAAgB,wBAAwB,EAAK,EAC9D,EAAoE,EAA7C,IAAS,OAAyC,EAAxB,EAAO,UAAkB,EAAmW,EAAgB,GAAmB,GAAO,CAAC,GAAK,CAAC,EAAY,GAAiB,EAAQ,CAAgB,EAAO,CAAC,EAAY,GAAgB,EAAQ,CAAe,EACja,OAD6a,IAAS,QAAa,EAAM,cAAc,CAAC,IAAM,MAAiB,CAAC,EAAe,EAAO,UAAU,CAAE,EACrsB,OADusB,EAAO,iBAAiB,SAAS,CAAY,MAC1uB,CAAC,EAAO,oBAAoB,SAAS,CAAY,CAAE,CAAE,EAAE,CAAC,CAAC,EAAM,GAAa,GAAa,KAA2B,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,WAAW,CAAC,EAA6B,EAAK,EAAU,CAAC,GAAG,CAAK,CAAC,CAAG"}