{"version":3,"file":"Sidebar.Bfk-cyDL.mjs","names":[],"sources":["https:/framerusercontent.com/modules/2QjsedSWSTgQns4mygFj/h3Sp55wz1zzz2UR4ugE4/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":"kOAA2C,IAAgC,IAAyC,IAAyB,CAEvI,EAAiB,EAAgB,wBAAwB,GAAM,CAC/D,EAAoE,EAA7C,IAAS,OAAyC,EAAxB,EAAO,WAAmB,CAAc,EAAqB,GAAmB,GAAO,CAAC,GAAK,CAAC,EAAY,GAAiB,EAAQ,EAAiB,CAAO,MAAgB,CAAkC,EAAb,CAAC,EAA4C,CAAC,EAAO,cAAc,IAAI,MAAM,sBAAsB,CAAC,EAAG,OAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,EAAY,CAAC,EAAkB,EAAgB,GAAmB,GAAO,CAAC,GAAK,CAAC,EAAY,GAAiB,EAAQ,EAAiB,CAAM,CAAC,EAAY,GAAgB,EAAQ,EAAgB,CACla,OAD6a,IAAS,QAAa,EAAM,cAAc,CAAC,IAAM,MAAiB,CAAC,EAAe,EAAO,WAAW,EACpsB,OADusB,EAAO,iBAAiB,SAAS,EAAa,KAC3uB,CAAC,EAAO,oBAAoB,SAAS,EAAa,GAAK,EAAE,CAAC,CAAK,GAAa,GAAa,KAA2B,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,YAAY,CAAC,CAA4B,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC"}