{"version":3,"file":"CustomScrollbar.B7fP57rH.mjs","names":["useContext","useMemo"],"sources":["https:/framerusercontent.com/modules/nBCYQf5hXk5kdmW7OIXm/zZHH95dNBZYPJPjB1eUm/CustomScrollbar.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,createContext,useContext,useMemo}from\"react\";// Theme context to avoid prop drilling and reduce rerenders\nconst ThemeContext=/*#__PURE__*/createContext(\"light\");// Memoized theme styles to prevent regeneration\nconst createThemeStyles=theme=>{const colors={light:{thumb:\"#C1C1C1\",track:\"#F1F1F1\",hover:\"#A1A1A1\",border:\"#E1E1E1\"},dark:{thumb:\"#4A4A4A\",track:\"#1A1A1A\",hover:\"#666666\",border:\"#333333\"}}[theme];return`\n        @supports selector(::-webkit-scrollbar) {\n            *::-webkit-scrollbar {\n                width: 8px;\n                border-left: 1px solid ${colors.border};\n            }\n            \n            *::-webkit-scrollbar-thumb {\n                background: ${colors.thumb};\n                border-radius: 4px;\n                transition: background 0.2s ease;\n                background-clip: padding-box;\n                border: 2px solid transparent;\n            }\n            \n            *::-webkit-scrollbar-thumb:hover {\n                background: ${colors.hover};\n                background-clip: padding-box;\n            }\n            \n            *::-webkit-scrollbar-track {\n                background: ${colors.track};\n                border-left: 1px solid ${colors.border};\n                padding: 2px;\n            }\n        }\n\n        * {\n            scrollbar-width: thin;\n            scrollbar-color: ${colors.thumb} ${colors.track};\n        }\n\n        .scroll-container {\n            -webkit-overflow-scrolling: touch;\n        }\n        \n        @supports (-webkit-overflow-scrolling: touch) {\n            .scroll-container::-webkit-scrollbar {\n                -webkit-appearance: none;\n                width: 8px;\n            }\n        }\n    `;};// Global theme provider that handles theme detection and updates\nexport const ThemeProvider=({children})=>{const[theme,setTheme]=useState(()=>{var _window_matchMedia,_window;// Run on initial render only\nif(typeof window===\"undefined\")return\"light\";const stored=localStorage.getItem(\"currentToggleState\");if(stored)return stored;return((_window_matchMedia=(_window=window).matchMedia)===null||_window_matchMedia===void 0?void 0:_window_matchMedia.call(_window,\"(prefers-color-scheme: dark)\").matches)?\"dark\":\"light\";});useEffect(()=>{// Theme change handlers\nconst handleStorage=e=>{if(e.key===\"currentToggleState\"){setTheme(e.newValue||(window.matchMedia(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"));}};const handleSystem=e=>{if(!localStorage.getItem(\"currentToggleState\")){setTheme(e.matches?\"dark\":\"light\");}};const mediaQuery=window.matchMedia(\"(prefers-color-scheme: dark)\");window.addEventListener(\"storage\",handleStorage);mediaQuery.addEventListener(\"change\",handleSystem);return()=>{window.removeEventListener(\"storage\",handleStorage);mediaQuery.removeEventListener(\"change\",handleSystem);};},[]);// Memoize styles to prevent regeneration\nconst styles=useMemo(()=>createThemeStyles(theme),[theme]);return /*#__PURE__*/_jsxs(ThemeContext.Provider,{value:theme,children:[/*#__PURE__*/_jsx(\"style\",{children:styles}),children]});};// Optimized HOC that doesn't manage theme state\nexport const withCustomScrollbar=Component=>{return props=>{const theme=useContext(ThemeContext);if(!theme){console.warn(\"withCustomScrollbar must be used within a ThemeProvider\");}return /*#__PURE__*/_jsx(Component,{...props});};};// Memoized base component\nconst BaseScrollableComponent=({children,className=\"\"})=>{const combinedClassName=useMemo(()=>`overflow-auto scroll-container ${className}`.trim(),[className]);return /*#__PURE__*/_jsx(\"div\",{className:combinedClassName,children:children});};export const ScrollableComponent=withCustomScrollbar(BaseScrollableComponent);\nexport const __FramerMetadata__ = {\"exports\":{\"ScrollableComponent\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ThemeProvider\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCustomScrollbar\":{\"type\":\"reactHoc\",\"name\":\"withCustomScrollbar\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomScrollbar.map"],"mappings":"kKAAyD,IAAuE,CAC1H,EAA0B,EAAc,QAAQ,CAgDzC,EAAoB,GAAmB,IAAoBA,EAAW,EAAa,EAAY,QAAQ,KAAK,0DAA0D,CAAsB,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC,EAC7N,GAAyB,CAAC,WAAS,YAAU,MAAiI,EAAK,MAAM,CAAC,UAA9GC,MAAY,kCAAkC,IAAY,MAAM,CAAC,CAAC,EAAU,CAAC,CAAsE,WAAS,CAAC,CAAoC,EAAoB,EAAwB"}