@erpsquad/common 1.10.64 → 1.10.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/chunks/{android-12-switch-CQqq1bod.js → android-12-switch-BP2CP-ah.js} +43 -7
  2. package/dist/chunks/android-12-switch-BP2CP-ah.js.map +1 -0
  3. package/dist/chunks/{android-12-switch-DMpKRS49.esm.js → android-12-switch-CrpXnQsd.esm.js} +43 -7
  4. package/dist/chunks/android-12-switch-CrpXnQsd.esm.js.map +1 -0
  5. package/dist/chunks/{appbar-GvhMl2LR.js → appbar-Bb4MdbyO.js} +6 -6
  6. package/dist/chunks/{appbar-GvhMl2LR.js.map → appbar-Bb4MdbyO.js.map} +1 -1
  7. package/dist/chunks/{appbar-BPTUcuZH.esm.js → appbar-CHxm7L_f.esm.js} +6 -6
  8. package/dist/chunks/{appbar-BPTUcuZH.esm.js.map → appbar-CHxm7L_f.esm.js.map} +1 -1
  9. package/dist/chunks/{default-data-c7qJW0S-.esm.js → default-data-7fDwUquk.esm.js} +3 -3
  10. package/dist/chunks/{default-data-c7qJW0S-.esm.js.map → default-data-7fDwUquk.esm.js.map} +1 -1
  11. package/dist/chunks/{default-data-C3gd1olF.js → default-data-WODnnwD5.js} +3 -3
  12. package/dist/chunks/{default-data-C3gd1olF.js.map → default-data-WODnnwD5.js.map} +1 -1
  13. package/dist/chunks/{fullScreen-BvWfY0hb.js → fullScreen-BJR97bsP.js} +2 -2
  14. package/dist/chunks/{fullScreen-BvWfY0hb.js.map → fullScreen-BJR97bsP.js.map} +1 -1
  15. package/dist/chunks/{fullScreen-CEK_HZnP.esm.js → fullScreen-uN74Cs7z.esm.js} +2 -2
  16. package/dist/chunks/{fullScreen-CEK_HZnP.esm.js.map → fullScreen-uN74Cs7z.esm.js.map} +1 -1
  17. package/dist/chunks/{sidebar-PQ4JubXM.esm.js → sidebar-C_fhINvI.esm.js} +2 -2
  18. package/dist/chunks/{sidebar-PQ4JubXM.esm.js.map → sidebar-C_fhINvI.esm.js.map} +1 -1
  19. package/dist/chunks/{sidebar-C3G058lH.js → sidebar-Df3O8Xw6.js} +2 -2
  20. package/dist/chunks/{sidebar-C3G058lH.js.map → sidebar-Df3O8Xw6.js.map} +1 -1
  21. package/dist/chunks/{sidebarScreen-fIj--OhC.js → sidebarScreen-BbczvGnM.js} +3 -3
  22. package/dist/chunks/{sidebarScreen-fIj--OhC.js.map → sidebarScreen-BbczvGnM.js.map} +1 -1
  23. package/dist/chunks/{sidebarScreen-DC7R30eg.esm.js → sidebarScreen-Df0FcbCe.esm.js} +3 -3
  24. package/dist/chunks/{sidebarScreen-DC7R30eg.esm.js.map → sidebarScreen-Df0FcbCe.esm.js.map} +1 -1
  25. package/dist/chunks/{uom-field-wrapper-BlJaV_Jd.esm.js → uom-field-wrapper-BN-gHLZh.esm.js} +43 -7
  26. package/dist/chunks/uom-field-wrapper-BN-gHLZh.esm.js.map +1 -0
  27. package/dist/chunks/{uom-field-wrapper-BMejbao3.js → uom-field-wrapper-DQKUL4a5.js} +43 -7
  28. package/dist/chunks/uom-field-wrapper-DQKUL4a5.js.map +1 -0
  29. package/dist/components/index.esm.js +4 -4
  30. package/dist/components/index.js +4 -4
  31. package/dist/components/parties-modal/utils/constant.d.ts +7 -4
  32. package/dist/index.esm.js +7 -7
  33. package/dist/index.js +7 -7
  34. package/dist/layout/index.esm.js +2 -2
  35. package/dist/layout/index.js +2 -2
  36. package/dist/src/components/parties-modal/utils/constant.d.ts +7 -4
  37. package/dist/style.css +11 -1
  38. package/dist/views/index.esm.js +5 -5
  39. package/dist/views/index.js +4 -4
  40. package/package.json +1 -1
  41. package/dist/chunks/android-12-switch-CQqq1bod.js.map +0 -1
  42. package/dist/chunks/android-12-switch-DMpKRS49.esm.js.map +0 -1
  43. package/dist/chunks/uom-field-wrapper-BMejbao3.js.map +0 -1
  44. package/dist/chunks/uom-field-wrapper-BlJaV_Jd.esm.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("./jsx-runtime-B6vEU3CM.js");
3
3
  const React = require("react");
4
- const appbar = require("./appbar-GvhMl2LR.js");
5
- const sidebar = require("./sidebar-C3G058lH.js");
4
+ const appbar = require("./appbar-Bb4MdbyO.js");
5
+ const sidebar = require("./sidebar-Df3O8Xw6.js");
6
6
  const mui_constants = require("./mui.constants-CJEIUmWO.js");
7
7
  const useLangauge = require("./useLangauge-C5Vve5I7.js");
8
8
  const common = require("./common-Bj4EONF-.js");
@@ -196,4 +196,4 @@ const SidebarLayout = (props) => {
196
196
  );
197
197
  };
198
198
  exports.SidebarLayout = SidebarLayout;
199
- //# sourceMappingURL=sidebarScreen-fIj--OhC.js.map
199
+ //# sourceMappingURL=sidebarScreen-BbczvGnM.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sidebarScreen-fIj--OhC.js","sources":["../../src/layout/sidebarScreen/sidebarScreen.tsx"],"sourcesContent":["import { useEffect, useState, useCallback, useMemo } from 'react';\n\nimport { useTheme } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\n\nimport AppBar from '../../components/appbar/appbar';\nimport SideBar from '../../components/sidebar/sidebar';\nimport ActivityArea from '../../components/activityArea/activityArea';\nimport ChatBot from '../../components/chat-bot/chat-bot';\n\nimport drawerWidth from '../../constants/mui.constants';\n// const drawerWidth = 240;\nimport { useLanguage } from '../../hooks/useLangauge';\nimport { getToken } from '@/utils';\nimport { getV1Settings } from '../../api-client/api.manufacturing/api';\nimport { useLocation } from 'react-router-dom';\n\n// Local storage key for drawer state\nconst DRAWER_STATE_KEY = '_is_drawer_open';\n\n// Interface for better type safety\nexport interface ISidebarLayoutProps {\n\tmenu: any[];\n\tchildren: React.ReactNode;\n\tdashboardPath?: string;\n}\n\nexport const SidebarLayout = (props: ISidebarLayoutProps) => {\n\tconst theme = useTheme();\n\tconst { currentLanguage } = useLanguage();\n\tconst isRtl = useMemo(\n\t\t() => currentLanguage?.direction === 'rtl',\n\t\t[currentLanguage]\n\t);\n\t// Enhanced state management\n\tconst [forcedOpen, setForcedOpen] = useState(true);\n\tconst [hoverOpen, setHoverOpen] = useState(false);\n\tconst [isInitialized, setIsInitialized] = useState(false);\n\tconst location = useLocation();\n\tconst curPathName = useMemo(() => location.pathname, [location.pathname])\n\n\t// Memoized computed state for actual drawer open status\n\tconst isDrawerOpen = forcedOpen || (!forcedOpen && hoverOpen);\n\n\t// Enhanced drawer control functions with better state management\n\tconst handleDrawerOpen = useCallback(() => {\n\t\tsetForcedOpen(true);\n\t\tsetHoverOpen(false); // Clear hover state when forcing open\n\t\ttry {\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'true');\n\t\t} catch (error) {\n\t\t\tconsole.warn('Failed to save drawer state to localStorage:', error);\n\t\t}\n\t}, []);\n\n\tconst handleDrawerClose = useCallback(() => {\n\t\tsetForcedOpen(false);\n\t\twindow.localStorage.setItem('_is_drawer_open', 'false');\n\t}, []);\n\n\tconst [wipSettingsData, setWipSettingsData] = useState<any>(null);\n\n\tconst getSettings = useCallback(async () => {\n\t\t// getToken returns { \"x-token\": string; \"x-timezone\": number }, but API expects string type for \"x-timezone\"\n\t\tconst tokenData = getToken();\n\t\tconst apiParams = {\n\t\t\t'x-token': tokenData['x-token'],\n\t\t\t'x-timezone': String(tokenData['x-timezone'])\n\t\t};\n\t\tconst response = await getV1Settings(apiParams);\n\t\t// The \"data\" property may not exist on GetV1SettingsResponses, so check existence safely\n\t\tconst data = (response && (response as any)?.data?.settings?.[0]) || null;\n\t\tsetWipSettingsData(data);\n\t\tlocalStorage.setItem('wip_settings_data', JSON.stringify(data));\n\t}, []);\n\tuseEffect(() => {\n\t\tif(curPathName?.includes('manufacturing')) {\n\t\t\tgetSettings();\n\t\t}\n\t}, [getSettings, curPathName]);\n\n\tconst [manufacturingSubmenu, setManufacturingSubmenu] = useState<any>(\n\t\tprops.menu\n\t);\n\n\tuseEffect(() => {\n\t\tif (wipSettingsData && Array.isArray(props?.menu)) {\n\t\t\tconsole.log('wipSettingsData: ', wipSettingsData);\n\t\t\tconst _new = props.menu.filter((item) => {\n\t\t\t\tif (!wipSettingsData?.enable_production_planning) {\n\t\t\t\t\treturn item.label !== 'Plans';\n\t\t\t\t} else {\n\t\t\t\t\treturn item;\n\t\t\t\t}\n\t\t\t});\n\t\t\tsetManufacturingSubmenu(_new);\n\t\t}\n\t}, [wipSettingsData, props.menu]);\n\t// const module_type = '';\n\n\tconst handleMouseEnter = () => {\n\t\tif (!forcedOpen) {\n\t\t\t// setOpen(true);\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'true');\n\t\t}\n\t};\n\n\tconst handleMouseLeave = useCallback(() => {\n\t\tif (!forcedOpen && isInitialized) {\n\t\t\tsetHoverOpen(false);\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'false');\n\t\t}\n\t}, [forcedOpen, isInitialized]);\n\n\t// Toggle function for programmatic control\n\tconst toggleDrawer = useCallback(() => {\n\t\tif (forcedOpen) {\n\t\t\thandleDrawerClose();\n\t\t} else {\n\t\t\thandleDrawerOpen();\n\t\t}\n\t}, [forcedOpen, handleDrawerClose, handleDrawerOpen]);\n\n\t// Enhanced initialization with error handling\n\tuseEffect(() => {\n\t\tconst initializeDrawerState = () => {\n\t\t\ttry {\n\t\t\t\tif (typeof window !== 'undefined' && window.localStorage) {\n\t\t\t\t\tconst savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\n\t\t\t\t\tconst shouldBeOpen = savedState === 'true';\n\n\t\t\t\t\tsetForcedOpen(shouldBeOpen);\n\t\t\t\t\tsetHoverOpen(false); // Ensure hover state is reset\n\t\t\t\t\tsetIsInitialized(true);\n\t\t\t\t} else {\n\t\t\t\t\t// Fallback for environments without localStorage\n\t\t\t\t\tsetForcedOpen(true);\n\t\t\t\t\tsetIsInitialized(true);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn('Failed to read drawer state from localStorage:', error);\n\t\t\t\t// Fallback to default state\n\t\t\t\tsetForcedOpen(true);\n\t\t\t\tsetIsInitialized(true);\n\t\t\t}\n\t\t};\n\n\t\tinitializeDrawerState();\n\t}, []);\n\n\t// Handle window focus to sync state across tabs\n\tuseEffect(() => {\n\t\tconst handleWindowFocus = () => {\n\t\t\ttry {\n\t\t\t\tif (typeof window !== 'undefined' && window.localStorage) {\n\t\t\t\t\tconst savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\n\t\t\t\t\tconst shouldBeOpen = savedState === 'true';\n\n\t\t\t\t\tif (shouldBeOpen !== forcedOpen) {\n\t\t\t\t\t\tsetForcedOpen(shouldBeOpen);\n\t\t\t\t\t\tsetHoverOpen(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn('Failed to sync drawer state on window focus:', error);\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener('focus', handleWindowFocus);\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener('focus', handleWindowFocus);\n\t\t};\n\t}, [forcedOpen]);\n\n\t// Prevent rendering until initialization is complete\n\tif (!isInitialized) {\n\t\treturn (\n\t\t\t<Box\n\t\t\t\tsx={{\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tminHeight: '100vh',\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tjustifyContent: 'center'\n\t\t\t\t}}>\n\t\t\t\t{/* Optional loading indicator */}\n\t\t\t\t<Box>Loading...</Box>\n\t\t\t</Box>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Box\n\t\t\tsx={{\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tminHeight: '100vh',\n\t\t\t\tdirection: isRtl ? 'rtl' : 'ltr'\n\t\t\t}}>\n\t\t\t<AppBar\n\t\t\t\topen={forcedOpen}\n\t\t\t\thandleDrawerOpen={handleDrawerOpen}\n\t\t\t\thandleDrawerClose={handleDrawerClose}\n\t\t\t\ttoggleDrawer={toggleDrawer}\n\t\t\t\twidth={drawerWidth}\n\t\t\t\tforcedOpen={forcedOpen}\n\t\t\t\thoverOpen={hoverOpen}\n\t\t\t/>\n\n\t\t\t<SideBar\n\t\t\t\topen={forcedOpen}\n\t\t\t\tforcedOpen={forcedOpen}\n\t\t\t\thoverOpen={hoverOpen}\n\t\t\t\thandleDrawerClose={handleDrawerClose}\n\t\t\t\thandleDrawerOpen={handleDrawerOpen}\n\t\t\t\ttoggleDrawer={toggleDrawer}\n\t\t\t\twidth={drawerWidth}\n\t\t\t\ttheme={theme}\n\t\t\t\tmenu={manufacturingSubmenu}\n\t\t\t\thandleMouseEnter={handleMouseEnter}\n\t\t\t\thandleMouseLeave={handleMouseLeave}\n\t\t\t\tisInitialized={isInitialized}\n\t\t\t\tdashboardPath={props.dashboardPath}\n\t\t\t/>\n\n\t\t\t<ActivityArea\n\t\t\t\tisDrawerOpen={isDrawerOpen}\n\t\t\t\tdrawerWidth={drawerWidth}\n\t\t\t\tforcedOpen={forcedOpen}>\n\t\t\t\t{props.children}\n\t\t\t</ActivityArea>\n\t\t\t<ChatBot />\n\t\t</Box>\n\t);\n};\n\nexport default SidebarLayout;\n"],"names":["useTheme","useLanguage","useMemo","useState","useLocation","useCallback","getToken","getV1Settings","useEffect","jsx","Box","jsxs","AppBar","drawerWidth","SideBar","ActivityArea","ChatBot"],"mappings":";;;;;;;;;;AAkBA,MAAM,mBAAmB;AASlB,MAAM,gBAAgB,CAAC,UAA+B;AAC5D,QAAM,QAAQA,OAAAA,SAAA;AACd,QAAM,EAAE,gBAAA,IAAoBC,wBAAA;AAC5B,QAAM,QAAQC,MAAAA;AAAAA,IACb,OAAM,mDAAiB,eAAc;AAAA,IACrC,CAAC,eAAe;AAAA,EAAA;AAGjB,QAAM,CAAC,YAAY,aAAa,IAAIC,MAAAA,SAAS,IAAI;AACjD,QAAM,CAAC,WAAW,YAAY,IAAIA,MAAAA,SAAS,KAAK;AAChD,QAAM,CAAC,eAAe,gBAAgB,IAAIA,MAAAA,SAAS,KAAK;AACxD,QAAM,WA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,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAOD,cAAAA;AAAAA,YACP;AAAA,YACA,MAAM;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA,eAAe,MAAM;AAAA,UAAA;AAAA,QAAA;AAAA,QAGtBJ,2BAAAA,kBAAAA;AAAAA,UAACM,OAAAA;AAAAA,UAAA;AAAA,YACA;AAAA,YAAA,aACAF,cAAAA;AAAAA,YACA;AAAA,YACC,UAAA,MAAM;AAAA,UAAA;AAAA,QAAA;AAAA,yDAEPG,OAAAA,SAAA,CAAA,CAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ;;"}
1
+ {"version":3,"file":"sidebarScreen-BbczvGnM.js","sources":["../../src/layout/sidebarScreen/sidebarScreen.tsx"],"sourcesContent":["import { useEffect, useState, useCallback, useMemo } from 'react';\n\nimport { useTheme } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\n\nimport AppBar from '../../components/appbar/appbar';\nimport SideBar from '../../components/sidebar/sidebar';\nimport ActivityArea from '../../components/activityArea/activityArea';\nimport ChatBot from '../../components/chat-bot/chat-bot';\n\nimport drawerWidth from '../../constants/mui.constants';\n// const drawerWidth = 240;\nimport { useLanguage } from '../../hooks/useLangauge';\nimport { getToken } from '@/utils';\nimport { getV1Settings } from '../../api-client/api.manufacturing/api';\nimport { useLocation } from 'react-router-dom';\n\n// Local storage key for drawer state\nconst DRAWER_STATE_KEY = '_is_drawer_open';\n\n// Interface for better type safety\nexport interface ISidebarLayoutProps {\n\tmenu: any[];\n\tchildren: React.ReactNode;\n\tdashboardPath?: string;\n}\n\nexport const SidebarLayout = (props: ISidebarLayoutProps) => {\n\tconst theme = useTheme();\n\tconst { currentLanguage } = useLanguage();\n\tconst isRtl = useMemo(\n\t\t() => currentLanguage?.direction === 'rtl',\n\t\t[currentLanguage]\n\t);\n\t// Enhanced state management\n\tconst [forcedOpen, setForcedOpen] = useState(true);\n\tconst [hoverOpen, setHoverOpen] = useState(false);\n\tconst [isInitialized, setIsInitialized] = useState(false);\n\tconst location = useLocation();\n\tconst curPathName = useMemo(() => location.pathname, [location.pathname])\n\n\t// Memoized computed state for actual drawer open status\n\tconst isDrawerOpen = forcedOpen || (!forcedOpen && hoverOpen);\n\n\t// Enhanced drawer control functions with better state management\n\tconst handleDrawerOpen = useCallback(() => {\n\t\tsetForcedOpen(true);\n\t\tsetHoverOpen(false); // Clear hover state when forcing open\n\t\ttry {\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'true');\n\t\t} catch (error) {\n\t\t\tconsole.warn('Failed to save drawer state to localStorage:', error);\n\t\t}\n\t}, []);\n\n\tconst handleDrawerClose = useCallback(() => {\n\t\tsetForcedOpen(false);\n\t\twindow.localStorage.setItem('_is_drawer_open', 'false');\n\t}, []);\n\n\tconst [wipSettingsData, setWipSettingsData] = useState<any>(null);\n\n\tconst getSettings = useCallback(async () => {\n\t\t// getToken returns { \"x-token\": string; \"x-timezone\": number }, but API expects string type for \"x-timezone\"\n\t\tconst tokenData = getToken();\n\t\tconst apiParams = {\n\t\t\t'x-token': tokenData['x-token'],\n\t\t\t'x-timezone': String(tokenData['x-timezone'])\n\t\t};\n\t\tconst response = await getV1Settings(apiParams);\n\t\t// The \"data\" property may not exist on GetV1SettingsResponses, so check existence safely\n\t\tconst data = (response && (response as any)?.data?.settings?.[0]) || null;\n\t\tsetWipSettingsData(data);\n\t\tlocalStorage.setItem('wip_settings_data', JSON.stringify(data));\n\t}, []);\n\tuseEffect(() => {\n\t\tif(curPathName?.includes('manufacturing')) {\n\t\t\tgetSettings();\n\t\t}\n\t}, [getSettings, curPathName]);\n\n\tconst [manufacturingSubmenu, setManufacturingSubmenu] = useState<any>(\n\t\tprops.menu\n\t);\n\n\tuseEffect(() => {\n\t\tif (wipSettingsData && Array.isArray(props?.menu)) {\n\t\t\tconsole.log('wipSettingsData: ', wipSettingsData);\n\t\t\tconst _new = props.menu.filter((item) => {\n\t\t\t\tif (!wipSettingsData?.enable_production_planning) {\n\t\t\t\t\treturn item.label !== 'Plans';\n\t\t\t\t} else {\n\t\t\t\t\treturn item;\n\t\t\t\t}\n\t\t\t});\n\t\t\tsetManufacturingSubmenu(_new);\n\t\t}\n\t}, [wipSettingsData, props.menu]);\n\t// const module_type = '';\n\n\tconst handleMouseEnter = () => {\n\t\tif (!forcedOpen) {\n\t\t\t// setOpen(true);\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'true');\n\t\t}\n\t};\n\n\tconst handleMouseLeave = useCallback(() => {\n\t\tif (!forcedOpen && isInitialized) {\n\t\t\tsetHoverOpen(false);\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'false');\n\t\t}\n\t}, [forcedOpen, isInitialized]);\n\n\t// Toggle function for programmatic control\n\tconst toggleDrawer = useCallback(() => {\n\t\tif (forcedOpen) {\n\t\t\thandleDrawerClose();\n\t\t} else {\n\t\t\thandleDrawerOpen();\n\t\t}\n\t}, [forcedOpen, handleDrawerClose, handleDrawerOpen]);\n\n\t// Enhanced initialization with error handling\n\tuseEffect(() => {\n\t\tconst initializeDrawerState = () => {\n\t\t\ttry {\n\t\t\t\tif (typeof window !== 'undefined' && window.localStorage) {\n\t\t\t\t\tconst savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\n\t\t\t\t\tconst shouldBeOpen = savedState === 'true';\n\n\t\t\t\t\tsetForcedOpen(shouldBeOpen);\n\t\t\t\t\tsetHoverOpen(false); // Ensure hover state is reset\n\t\t\t\t\tsetIsInitialized(true);\n\t\t\t\t} else {\n\t\t\t\t\t// Fallback for environments without localStorage\n\t\t\t\t\tsetForcedOpen(true);\n\t\t\t\t\tsetIsInitialized(true);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn('Failed to read drawer state from localStorage:', error);\n\t\t\t\t// Fallback to default state\n\t\t\t\tsetForcedOpen(true);\n\t\t\t\tsetIsInitialized(true);\n\t\t\t}\n\t\t};\n\n\t\tinitializeDrawerState();\n\t}, []);\n\n\t// Handle window focus to sync state across tabs\n\tuseEffect(() => {\n\t\tconst handleWindowFocus = () => {\n\t\t\ttry {\n\t\t\t\tif (typeof window !== 'undefined' && window.localStorage) {\n\t\t\t\t\tconst savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\n\t\t\t\t\tconst shouldBeOpen = savedState === 'true';\n\n\t\t\t\t\tif (shouldBeOpen !== forcedOpen) {\n\t\t\t\t\t\tsetForcedOpen(shouldBeOpen);\n\t\t\t\t\t\tsetHoverOpen(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn('Failed to sync drawer state on window focus:', error);\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener('focus', handleWindowFocus);\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener('focus', handleWindowFocus);\n\t\t};\n\t}, [forcedOpen]);\n\n\t// Prevent rendering until initialization is complete\n\tif (!isInitialized) {\n\t\treturn (\n\t\t\t<Box\n\t\t\t\tsx={{\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tminHeight: '100vh',\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tjustifyContent: 'center'\n\t\t\t\t}}>\n\t\t\t\t{/* Optional loading indicator */}\n\t\t\t\t<Box>Loading...</Box>\n\t\t\t</Box>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Box\n\t\t\tsx={{\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tminHeight: '100vh',\n\t\t\t\tdirection: isRtl ? 'rtl' : 'ltr'\n\t\t\t}}>\n\t\t\t<AppBar\n\t\t\t\topen={forcedOpen}\n\t\t\t\thandleDrawerOpen={handleDrawerOpen}\n\t\t\t\thandleDrawerClose={handleDrawerClose}\n\t\t\t\ttoggleDrawer={toggleDrawer}\n\t\t\t\twidth={drawerWidth}\n\t\t\t\tforcedOpen={forcedOpen}\n\t\t\t\thoverOpen={hoverOpen}\n\t\t\t/>\n\n\t\t\t<SideBar\n\t\t\t\topen={forcedOpen}\n\t\t\t\tforcedOpen={forcedOpen}\n\t\t\t\thoverOpen={hoverOpen}\n\t\t\t\thandleDrawerClose={handleDrawerClose}\n\t\t\t\thandleDrawerOpen={handleDrawerOpen}\n\t\t\t\ttoggleDrawer={toggleDrawer}\n\t\t\t\twidth={drawerWidth}\n\t\t\t\ttheme={theme}\n\t\t\t\tmenu={manufacturingSubmenu}\n\t\t\t\thandleMouseEnter={handleMouseEnter}\n\t\t\t\thandleMouseLeave={handleMouseLeave}\n\t\t\t\tisInitialized={isInitialized}\n\t\t\t\tdashboardPath={props.dashboardPath}\n\t\t\t/>\n\n\t\t\t<ActivityArea\n\t\t\t\tisDrawerOpen={isDrawerOpen}\n\t\t\t\tdrawerWidth={drawerWidth}\n\t\t\t\tforcedOpen={forcedOpen}>\n\t\t\t\t{props.children}\n\t\t\t</ActivityArea>\n\t\t\t<ChatBot />\n\t\t</Box>\n\t);\n};\n\nexport default SidebarLayout;\n"],"names":["useTheme","useLanguage","useMemo","useState","useLocation","useCallback","getToken","getV1Settings","useEffect","jsx","Box","jsxs","AppBar","drawerWidth","SideBar","ActivityArea","ChatBot"],"mappings":";;;;;;;;;;AAkBA,MAAM,mBAAmB;AASlB,MAAM,gBAAgB,CAAC,UAA+B;AAC5D,QAAM,QAAQA,OAAAA,SAAA;AACd,QAAM,EAAE,gBAAA,IAAoBC,wBAAA;AAC5B,QAAM,QAAQC,MAAAA;AAAAA,IACb,OAAM,mDAAiB,eAAc;AAAA,IACrC,CAAC,eAAe;AAAA,EAAA;AAGjB,QAAM,CAAC,YAAY,aAAa,IAAIC,MAAAA,SAAS,IAAI;AACjD,QAAM,CAAC,WAAW,YAAY,IAAIA,MAAAA,SAAS,KAAK;AAChD,QAAM,CAAC,eAAe,gBAAgB,IAAIA,MAAAA,SAAS,KAAK;AACxD,QAAM,WAAWC,eAAAA,YAAA;AACjB,QAAM,cAAcF,MAAAA,QAAQ,MAAM,SAAS,UAAU,CAAC,SAAS,QAAQ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AAM;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA,eAAe,MAAM;AAAA,UAAA;AAAA,QAAA;AAAA,QAGtBJ,2BAAAA,kBAAAA;AAAAA,UAACM,OAAAA;AAAAA,UAAA;AAAA,YACA;AAAA,YAAA,aACAF,cAAAA;AAAAA,YACA;AAAA,YACC,UAAA,MAAM;AAAA,UAAA;AAAA,QAAA;AAAA,yDAEPG,OAAAA,SAAA,CAAA,CAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ;;"}
@@ -1,7 +1,7 @@
1
1
  import { j as jsxRuntimeExports } from "./jsx-runtime-ClFauRgV.esm.js";
2
2
  import { useMemo, useState, useCallback, useEffect } from "react";
3
- import { u as useTheme, f as Box, a as AppBarWrapper, A as ActivityArea, C as ChatBot } from "./appbar-BPTUcuZH.esm.js";
4
- import { S as Sidebar } from "./sidebar-PQ4JubXM.esm.js";
3
+ import { u as useTheme, f as Box, a as AppBarWrapper, A as ActivityArea, C as ChatBot } from "./appbar-CHxm7L_f.esm.js";
4
+ import { S as Sidebar } from "./sidebar-C_fhINvI.esm.js";
5
5
  import { d as drawerWidth } from "./mui.constants-BFBzxaiA.esm.js";
6
6
  import { u as useLanguage } from "./useLangauge-Cb9mu6cS.esm.js";
7
7
  import { at as getToken } from "./common-BrAjOeOq.esm.js";
@@ -197,4 +197,4 @@ const SidebarLayout = (props) => {
197
197
  export {
198
198
  SidebarLayout as S
199
199
  };
200
- //# sourceMappingURL=sidebarScreen-DC7R30eg.esm.js.map
200
+ //# sourceMappingURL=sidebarScreen-Df0FcbCe.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sidebarScreen-DC7R30eg.esm.js","sources":["../../src/layout/sidebarScreen/sidebarScreen.tsx"],"sourcesContent":["import { useEffect, useState, useCallback, useMemo } from 'react';\n\nimport { useTheme } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\n\nimport AppBar from '../../components/appbar/appbar';\nimport SideBar from '../../components/sidebar/sidebar';\nimport ActivityArea from '../../components/activityArea/activityArea';\nimport ChatBot from '../../components/chat-bot/chat-bot';\n\nimport drawerWidth from '../../constants/mui.constants';\n// const drawerWidth = 240;\nimport { useLanguage } from '../../hooks/useLangauge';\nimport { getToken } from '@/utils';\nimport { getV1Settings } from '../../api-client/api.manufacturing/api';\nimport { useLocation } from 'react-router-dom';\n\n// Local storage key for drawer state\nconst DRAWER_STATE_KEY = '_is_drawer_open';\n\n// Interface for better type safety\nexport interface ISidebarLayoutProps {\n\tmenu: any[];\n\tchildren: React.ReactNode;\n\tdashboardPath?: string;\n}\n\nexport const SidebarLayout = (props: ISidebarLayoutProps) => {\n\tconst theme = useTheme();\n\tconst { currentLanguage } = useLanguage();\n\tconst isRtl = useMemo(\n\t\t() => currentLanguage?.direction === 'rtl',\n\t\t[currentLanguage]\n\t);\n\t// Enhanced state management\n\tconst [forcedOpen, setForcedOpen] = useState(true);\n\tconst [hoverOpen, setHoverOpen] = useState(false);\n\tconst [isInitialized, setIsInitialized] = useState(false);\n\tconst location = useLocation();\n\tconst curPathName = useMemo(() => location.pathname, [location.pathname])\n\n\t// Memoized computed state for actual drawer open status\n\tconst isDrawerOpen = forcedOpen || (!forcedOpen && hoverOpen);\n\n\t// Enhanced drawer control functions with better state management\n\tconst handleDrawerOpen = useCallback(() => {\n\t\tsetForcedOpen(true);\n\t\tsetHoverOpen(false); // Clear hover state when forcing open\n\t\ttry {\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'true');\n\t\t} catch (error) {\n\t\t\tconsole.warn('Failed to save drawer state to localStorage:', error);\n\t\t}\n\t}, []);\n\n\tconst handleDrawerClose = useCallback(() => {\n\t\tsetForcedOpen(false);\n\t\twindow.localStorage.setItem('_is_drawer_open', 'false');\n\t}, []);\n\n\tconst [wipSettingsData, setWipSettingsData] = useState<any>(null);\n\n\tconst getSettings = useCallback(async () => {\n\t\t// getToken returns { \"x-token\": string; \"x-timezone\": number }, but API expects string type for \"x-timezone\"\n\t\tconst tokenData = getToken();\n\t\tconst apiParams = {\n\t\t\t'x-token': tokenData['x-token'],\n\t\t\t'x-timezone': String(tokenData['x-timezone'])\n\t\t};\n\t\tconst response = await getV1Settings(apiParams);\n\t\t// The \"data\" property may not exist on GetV1SettingsResponses, so check existence safely\n\t\tconst data = (response && (response as any)?.data?.settings?.[0]) || null;\n\t\tsetWipSettingsData(data);\n\t\tlocalStorage.setItem('wip_settings_data', JSON.stringify(data));\n\t}, []);\n\tuseEffect(() => {\n\t\tif(curPathName?.includes('manufacturing')) {\n\t\t\tgetSettings();\n\t\t}\n\t}, [getSettings, curPathName]);\n\n\tconst [manufacturingSubmenu, setManufacturingSubmenu] = useState<any>(\n\t\tprops.menu\n\t);\n\n\tuseEffect(() => {\n\t\tif (wipSettingsData && Array.isArray(props?.menu)) {\n\t\t\tconsole.log('wipSettingsData: ', wipSettingsData);\n\t\t\tconst _new = props.menu.filter((item) => {\n\t\t\t\tif (!wipSettingsData?.enable_production_planning) {\n\t\t\t\t\treturn item.label !== 'Plans';\n\t\t\t\t} else {\n\t\t\t\t\treturn item;\n\t\t\t\t}\n\t\t\t});\n\t\t\tsetManufacturingSubmenu(_new);\n\t\t}\n\t}, [wipSettingsData, props.menu]);\n\t// const module_type = '';\n\n\tconst handleMouseEnter = () => {\n\t\tif (!forcedOpen) {\n\t\t\t// setOpen(true);\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'true');\n\t\t}\n\t};\n\n\tconst handleMouseLeave = useCallback(() => {\n\t\tif (!forcedOpen && isInitialized) {\n\t\t\tsetHoverOpen(false);\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'false');\n\t\t}\n\t}, [forcedOpen, isInitialized]);\n\n\t// Toggle function for programmatic control\n\tconst toggleDrawer = useCallback(() => {\n\t\tif (forcedOpen) {\n\t\t\thandleDrawerClose();\n\t\t} else {\n\t\t\thandleDrawerOpen();\n\t\t}\n\t}, [forcedOpen, handleDrawerClose, handleDrawerOpen]);\n\n\t// Enhanced initialization with error handling\n\tuseEffect(() => {\n\t\tconst initializeDrawerState = () => {\n\t\t\ttry {\n\t\t\t\tif (typeof window !== 'undefined' && window.localStorage) {\n\t\t\t\t\tconst savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\n\t\t\t\t\tconst shouldBeOpen = savedState === 'true';\n\n\t\t\t\t\tsetForcedOpen(shouldBeOpen);\n\t\t\t\t\tsetHoverOpen(false); // Ensure hover state is reset\n\t\t\t\t\tsetIsInitialized(true);\n\t\t\t\t} else {\n\t\t\t\t\t// Fallback for environments without localStorage\n\t\t\t\t\tsetForcedOpen(true);\n\t\t\t\t\tsetIsInitialized(true);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn('Failed to read drawer state from localStorage:', error);\n\t\t\t\t// Fallback to default state\n\t\t\t\tsetForcedOpen(true);\n\t\t\t\tsetIsInitialized(true);\n\t\t\t}\n\t\t};\n\n\t\tinitializeDrawerState();\n\t}, []);\n\n\t// Handle window focus to sync state across tabs\n\tuseEffect(() => {\n\t\tconst handleWindowFocus = () => {\n\t\t\ttry {\n\t\t\t\tif (typeof window !== 'undefined' && window.localStorage) {\n\t\t\t\t\tconst savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\n\t\t\t\t\tconst shouldBeOpen = savedState === 'true';\n\n\t\t\t\t\tif (shouldBeOpen !== forcedOpen) {\n\t\t\t\t\t\tsetForcedOpen(shouldBeOpen);\n\t\t\t\t\t\tsetHoverOpen(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn('Failed to sync drawer state on window focus:', error);\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener('focus', handleWindowFocus);\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener('focus', handleWindowFocus);\n\t\t};\n\t}, [forcedOpen]);\n\n\t// Prevent rendering until initialization is complete\n\tif (!isInitialized) {\n\t\treturn (\n\t\t\t<Box\n\t\t\t\tsx={{\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tminHeight: '100vh',\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tjustifyContent: 'center'\n\t\t\t\t}}>\n\t\t\t\t{/* Optional loading indicator */}\n\t\t\t\t<Box>Loading...</Box>\n\t\t\t</Box>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Box\n\t\t\tsx={{\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tminHeight: '100vh',\n\t\t\t\tdirection: isRtl ? 'rtl' : 'ltr'\n\t\t\t}}>\n\t\t\t<AppBar\n\t\t\t\topen={forcedOpen}\n\t\t\t\thandleDrawerOpen={handleDrawerOpen}\n\t\t\t\thandleDrawerClose={handleDrawerClose}\n\t\t\t\ttoggleDrawer={toggleDrawer}\n\t\t\t\twidth={drawerWidth}\n\t\t\t\tforcedOpen={forcedOpen}\n\t\t\t\thoverOpen={hoverOpen}\n\t\t\t/>\n\n\t\t\t<SideBar\n\t\t\t\topen={forcedOpen}\n\t\t\t\tforcedOpen={forcedOpen}\n\t\t\t\thoverOpen={hoverOpen}\n\t\t\t\thandleDrawerClose={handleDrawerClose}\n\t\t\t\thandleDrawerOpen={handleDrawerOpen}\n\t\t\t\ttoggleDrawer={toggleDrawer}\n\t\t\t\twidth={drawerWidth}\n\t\t\t\ttheme={theme}\n\t\t\t\tmenu={manufacturingSubmenu}\n\t\t\t\thandleMouseEnter={handleMouseEnter}\n\t\t\t\thandleMouseLeave={handleMouseLeave}\n\t\t\t\tisInitialized={isInitialized}\n\t\t\t\tdashboardPath={props.dashboardPath}\n\t\t\t/>\n\n\t\t\t<ActivityArea\n\t\t\t\tisDrawerOpen={isDrawerOpen}\n\t\t\t\tdrawerWidth={drawerWidth}\n\t\t\t\tforcedOpen={forcedOpen}>\n\t\t\t\t{props.children}\n\t\t\t</ActivityArea>\n\t\t\t<ChatBot />\n\t\t</Box>\n\t);\n};\n\nexport default SidebarLayout;\n"],"names":["jsx","jsxs","AppBar","SideBar"],"mappings":";;;;;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;AAAA,YACA;AAAA,YACA,OAAO;AAAA,YACP;AAAA,YACA;AAAA,UAAA;AAAA,QAAA;AAAA,QAGDF,kCAAAA;AAAAA,UAACG;AAAAA,UAAA;AAAA,YACA,MAAM;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO;AAAA,YACP;AAAA,YACA,MAAM;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA,eAAe,MAAM;AAAA,UAAA;AAAA,QAAA;AAAA,QAGtBH,kCAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACC,UAAA,MAAM;AAAA,UAAA;AAAA,QAAA;AAAA,8CAEP,SAAA,CAAA,CAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
1
+ {"version":3,"file":"sidebarScreen-Df0FcbCe.esm.js","sources":["../../src/layout/sidebarScreen/sidebarScreen.tsx"],"sourcesContent":["import { useEffect, useState, useCallback, useMemo } from 'react';\n\nimport { useTheme } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\n\nimport AppBar from '../../components/appbar/appbar';\nimport SideBar from '../../components/sidebar/sidebar';\nimport ActivityArea from '../../components/activityArea/activityArea';\nimport ChatBot from '../../components/chat-bot/chat-bot';\n\nimport drawerWidth from '../../constants/mui.constants';\n// const drawerWidth = 240;\nimport { useLanguage } from '../../hooks/useLangauge';\nimport { getToken } from '@/utils';\nimport { getV1Settings } from '../../api-client/api.manufacturing/api';\nimport { useLocation } from 'react-router-dom';\n\n// Local storage key for drawer state\nconst DRAWER_STATE_KEY = '_is_drawer_open';\n\n// Interface for better type safety\nexport interface ISidebarLayoutProps {\n\tmenu: any[];\n\tchildren: React.ReactNode;\n\tdashboardPath?: string;\n}\n\nexport const SidebarLayout = (props: ISidebarLayoutProps) => {\n\tconst theme = useTheme();\n\tconst { currentLanguage } = useLanguage();\n\tconst isRtl = useMemo(\n\t\t() => currentLanguage?.direction === 'rtl',\n\t\t[currentLanguage]\n\t);\n\t// Enhanced state management\n\tconst [forcedOpen, setForcedOpen] = useState(true);\n\tconst [hoverOpen, setHoverOpen] = useState(false);\n\tconst [isInitialized, setIsInitialized] = useState(false);\n\tconst location = useLocation();\n\tconst curPathName = useMemo(() => location.pathname, [location.pathname])\n\n\t// Memoized computed state for actual drawer open status\n\tconst isDrawerOpen = forcedOpen || (!forcedOpen && hoverOpen);\n\n\t// Enhanced drawer control functions with better state management\n\tconst handleDrawerOpen = useCallback(() => {\n\t\tsetForcedOpen(true);\n\t\tsetHoverOpen(false); // Clear hover state when forcing open\n\t\ttry {\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'true');\n\t\t} catch (error) {\n\t\t\tconsole.warn('Failed to save drawer state to localStorage:', error);\n\t\t}\n\t}, []);\n\n\tconst handleDrawerClose = useCallback(() => {\n\t\tsetForcedOpen(false);\n\t\twindow.localStorage.setItem('_is_drawer_open', 'false');\n\t}, []);\n\n\tconst [wipSettingsData, setWipSettingsData] = useState<any>(null);\n\n\tconst getSettings = useCallback(async () => {\n\t\t// getToken returns { \"x-token\": string; \"x-timezone\": number }, but API expects string type for \"x-timezone\"\n\t\tconst tokenData = getToken();\n\t\tconst apiParams = {\n\t\t\t'x-token': tokenData['x-token'],\n\t\t\t'x-timezone': String(tokenData['x-timezone'])\n\t\t};\n\t\tconst response = await getV1Settings(apiParams);\n\t\t// The \"data\" property may not exist on GetV1SettingsResponses, so check existence safely\n\t\tconst data = (response && (response as any)?.data?.settings?.[0]) || null;\n\t\tsetWipSettingsData(data);\n\t\tlocalStorage.setItem('wip_settings_data', JSON.stringify(data));\n\t}, []);\n\tuseEffect(() => {\n\t\tif(curPathName?.includes('manufacturing')) {\n\t\t\tgetSettings();\n\t\t}\n\t}, [getSettings, curPathName]);\n\n\tconst [manufacturingSubmenu, setManufacturingSubmenu] = useState<any>(\n\t\tprops.menu\n\t);\n\n\tuseEffect(() => {\n\t\tif (wipSettingsData && Array.isArray(props?.menu)) {\n\t\t\tconsole.log('wipSettingsData: ', wipSettingsData);\n\t\t\tconst _new = props.menu.filter((item) => {\n\t\t\t\tif (!wipSettingsData?.enable_production_planning) {\n\t\t\t\t\treturn item.label !== 'Plans';\n\t\t\t\t} else {\n\t\t\t\t\treturn item;\n\t\t\t\t}\n\t\t\t});\n\t\t\tsetManufacturingSubmenu(_new);\n\t\t}\n\t}, [wipSettingsData, props.menu]);\n\t// const module_type = '';\n\n\tconst handleMouseEnter = () => {\n\t\tif (!forcedOpen) {\n\t\t\t// setOpen(true);\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'true');\n\t\t}\n\t};\n\n\tconst handleMouseLeave = useCallback(() => {\n\t\tif (!forcedOpen && isInitialized) {\n\t\t\tsetHoverOpen(false);\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'false');\n\t\t}\n\t}, [forcedOpen, isInitialized]);\n\n\t// Toggle function for programmatic control\n\tconst toggleDrawer = useCallback(() => {\n\t\tif (forcedOpen) {\n\t\t\thandleDrawerClose();\n\t\t} else {\n\t\t\thandleDrawerOpen();\n\t\t}\n\t}, [forcedOpen, handleDrawerClose, handleDrawerOpen]);\n\n\t// Enhanced initialization with error handling\n\tuseEffect(() => {\n\t\tconst initializeDrawerState = () => {\n\t\t\ttry {\n\t\t\t\tif (typeof window !== 'undefined' && window.localStorage) {\n\t\t\t\t\tconst savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\n\t\t\t\t\tconst shouldBeOpen = savedState === 'true';\n\n\t\t\t\t\tsetForcedOpen(shouldBeOpen);\n\t\t\t\t\tsetHoverOpen(false); // Ensure hover state is reset\n\t\t\t\t\tsetIsInitialized(true);\n\t\t\t\t} else {\n\t\t\t\t\t// Fallback for environments without localStorage\n\t\t\t\t\tsetForcedOpen(true);\n\t\t\t\t\tsetIsInitialized(true);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn('Failed to read drawer state from localStorage:', error);\n\t\t\t\t// Fallback to default state\n\t\t\t\tsetForcedOpen(true);\n\t\t\t\tsetIsInitialized(true);\n\t\t\t}\n\t\t};\n\n\t\tinitializeDrawerState();\n\t}, []);\n\n\t// Handle window focus to sync state across tabs\n\tuseEffect(() => {\n\t\tconst handleWindowFocus = () => {\n\t\t\ttry {\n\t\t\t\tif (typeof window !== 'undefined' && window.localStorage) {\n\t\t\t\t\tconst savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\n\t\t\t\t\tconst shouldBeOpen = savedState === 'true';\n\n\t\t\t\t\tif (shouldBeOpen !== forcedOpen) {\n\t\t\t\t\t\tsetForcedOpen(shouldBeOpen);\n\t\t\t\t\t\tsetHoverOpen(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn('Failed to sync drawer state on window focus:', error);\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener('focus', handleWindowFocus);\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener('focus', handleWindowFocus);\n\t\t};\n\t}, [forcedOpen]);\n\n\t// Prevent rendering until initialization is complete\n\tif (!isInitialized) {\n\t\treturn (\n\t\t\t<Box\n\t\t\t\tsx={{\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tminHeight: '100vh',\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tjustifyContent: 'center'\n\t\t\t\t}}>\n\t\t\t\t{/* Optional loading indicator */}\n\t\t\t\t<Box>Loading...</Box>\n\t\t\t</Box>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Box\n\t\t\tsx={{\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tminHeight: '100vh',\n\t\t\t\tdirection: isRtl ? 'rtl' : 'ltr'\n\t\t\t}}>\n\t\t\t<AppBar\n\t\t\t\topen={forcedOpen}\n\t\t\t\thandleDrawerOpen={handleDrawerOpen}\n\t\t\t\thandleDrawerClose={handleDrawerClose}\n\t\t\t\ttoggleDrawer={toggleDrawer}\n\t\t\t\twidth={drawerWidth}\n\t\t\t\tforcedOpen={forcedOpen}\n\t\t\t\thoverOpen={hoverOpen}\n\t\t\t/>\n\n\t\t\t<SideBar\n\t\t\t\topen={forcedOpen}\n\t\t\t\tforcedOpen={forcedOpen}\n\t\t\t\thoverOpen={hoverOpen}\n\t\t\t\thandleDrawerClose={handleDrawerClose}\n\t\t\t\thandleDrawerOpen={handleDrawerOpen}\n\t\t\t\ttoggleDrawer={toggleDrawer}\n\t\t\t\twidth={drawerWidth}\n\t\t\t\ttheme={theme}\n\t\t\t\tmenu={manufacturingSubmenu}\n\t\t\t\thandleMouseEnter={handleMouseEnter}\n\t\t\t\thandleMouseLeave={handleMouseLeave}\n\t\t\t\tisInitialized={isInitialized}\n\t\t\t\tdashboardPath={props.dashboardPath}\n\t\t\t/>\n\n\t\t\t<ActivityArea\n\t\t\t\tisDrawerOpen={isDrawerOpen}\n\t\t\t\tdrawerWidth={drawerWidth}\n\t\t\t\tforcedOpen={forcedOpen}>\n\t\t\t\t{props.children}\n\t\t\t</ActivityArea>\n\t\t\t<ChatBot />\n\t\t</Box>\n\t);\n};\n\nexport default SidebarLayout;\n"],"names":["jsx","jsxs","AppBar","SideBar"],"mappings":";;;;;;;;;AAkBA,MAAM,mBAAmB;AASlB,MAAM,gBAAgB,CAAC,UAA+B;AAC5D,QAAM,QAAQ,SAAA;AACd,QAAM,EAAE,gBAAA,IAAoB,YAAA;AAC5B,QAAM,QAAQ;AAAA,IACb,OAAM,mDAAiB,eAAc;AAAA,IACrC,CAAC,eAAe;AAAA,EAAA;AAGjB,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,IAAI;AACjD,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,KAAK;AACxD,QAAM,WAAW,YAAA;AACjB,QAAM,cAAc,QAAQ,MAAM,SAAS,UAAU,CAAC,SAAS,QAAQ,CAAC;AAGxE,QAAM,eAAe,cAAe,CAA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A,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
@@ -2,8 +2,8 @@ import { j as jsxRuntimeExports } from "./jsx-runtime-ClFauRgV.esm.js";
2
2
  import { useFieldArray, Controller, useForm, useWatch, useFormContext } from "react-hook-form";
3
3
  import { P as PropTypes, e as _objectWithoutPropertiesLoose, _ as _extends$1, g as generateUtilityClass, j as capitalize, u as useDefaultProps, k as interopRequireDefaultExports, y as lighten_1, z as darken_1, f as alpha_1 } from "./identifier-0SZUhw_A.esm.js";
4
4
  import { i as default_1$3, T as Typography, e as useForkRef, o as ownerWindow, d as useEnhancedEffect, h as debounce, p as isMuiElement, u as useAuth, q as useControlled, r as requireCreateSvgIcon } from "./useAuth-BVQ2r4xx.esm.js";
5
- import { aq as default_1$4, w as DynamicSelect, h as DateTimePicker, D as DatePicker$1, ar as useThemeProps, A as Accordion$1, a8 as Select, f as ChipOrPlaceholder$1, i as DropdownButton, s as DynamicPhone, u as DynamicSearchSelect, k as DynamicCheckBox, af as TitleDropdownButton, T as HeaderCard, ad as TabBar, as as default_1$5, a7 as SearchableSelect, at as Chip$1, ae as TimePicker, aj as UploadMedia, a3 as PhoneInput, Z as ModalLoader, Y as MaterialTable, m as DynamicDate, z as DynamicTime, C as ChipGenerator, M as Footer, F as Fallback, au as IconButton$1, av as TabContext, aw as TabList, ax as Tab, ay as TabPanel, az as default_1$9, a as ActionBar, aA as SwitchBase } from "./android-12-switch-DMpKRS49.esm.js";
6
- import { D as DynamicInput, E as Typography$1, b as Avatar, G as o, M as Modal, B as Button, c as ConfirmPopUp, f as Box$1, d as Toast, u as useTheme$1, S as SearchBar, I as resolveComponentProps, J as mergeSlotProps, K as appendOwnerState, P as Paper$1, o as chainPropTypes, h as ButtonBase$1, y as default_1$6, T as TextField$1, e as Tooltip$1, F as default_1$7, x as default_1$8, N as Menu$2, O as MenuItem$1, q as useRtl, z as List$1, v as ListItem, Q as ListItemText$1, U as refType } from "./appbar-BPTUcuZH.esm.js";
5
+ import { aq as default_1$4, w as DynamicSelect, h as DateTimePicker, D as DatePicker$1, ar as useThemeProps, A as Accordion$1, a8 as Select, f as ChipOrPlaceholder$1, i as DropdownButton, s as DynamicPhone, u as DynamicSearchSelect, k as DynamicCheckBox, af as TitleDropdownButton, T as HeaderCard, ad as TabBar, as as default_1$5, a7 as SearchableSelect, at as Chip$1, ae as TimePicker, aj as UploadMedia, a3 as PhoneInput, Z as ModalLoader, Y as MaterialTable, m as DynamicDate, z as DynamicTime, C as ChipGenerator, M as Footer, F as Fallback, au as IconButton$1, av as TabContext, aw as TabList, ax as Tab, ay as TabPanel, az as default_1$9, a as ActionBar, aA as SwitchBase } from "./android-12-switch-CrpXnQsd.esm.js";
6
+ import { D as DynamicInput, E as Typography$1, b as Avatar, G as o, M as Modal, B as Button, c as ConfirmPopUp, f as Box$1, d as Toast, u as useTheme$1, S as SearchBar, I as resolveComponentProps, J as mergeSlotProps, K as appendOwnerState, P as Paper$1, o as chainPropTypes, h as ButtonBase$1, y as default_1$6, T as TextField$1, e as Tooltip$1, F as default_1$7, x as default_1$8, N as Menu$2, O as MenuItem$1, q as useRtl, z as List$1, v as ListItem, Q as ListItemText$1, U as refType } from "./appbar-CHxm7L_f.esm.js";
7
7
  import * as React from "react";
8
8
  import React__default, { useState, lazy, useMemo, useRef, useEffect, useCallback, useLayoutEffect, useContext, createElement, createContext, cloneElement } from "react";
9
9
  import DatePicker from "react-datepicker";
@@ -51,7 +51,7 @@ import { v as viewTypes } from "./action-bar-BsXTcYpL.esm.js";
51
51
  import DataEditor, { GridCellKind } from "@glideapps/glide-data-grid";
52
52
  import { useExtraCells } from "@glideapps/glide-data-grid-cells";
53
53
  import { createPortal } from "react-dom";
54
- import { C as Collapse$1 } from "./sidebar-PQ4JubXM.esm.js";
54
+ import { C as Collapse$1 } from "./sidebar-C_fhINvI.esm.js";
55
55
  import { useMaterialReactTable, MaterialReactTable } from "material-react-table";
56
56
  import { R as RecgtangleIcon, C as CheckBoxIcon$1, T as Trash, E as Edit } from "./trash-Dgfsw2UY.esm.js";
57
57
  import _$1 from "lodash";
@@ -4013,10 +4013,13 @@ const AddressModal = ({
4013
4013
  "addresses.street_1",
4014
4014
  "addresses.street_2",
4015
4015
  "addresses.street_3",
4016
+ "addresses.street_name",
4016
4017
  "addresses.building_no",
4017
4018
  "addresses.additional_no",
4019
+ "addresses.national_address",
4018
4020
  "addresses.zip_code",
4019
4021
  "addresses.city",
4022
+ "addresses.district_name",
4020
4023
  "addresses.state",
4021
4024
  "addresses.country"
4022
4025
  ]
@@ -4128,15 +4131,15 @@ const AddressModal = ({
4128
4131
  const summaryVal = watchedValues.reduce((ele, ele2, index) => {
4129
4132
  if (!ele2) return ele;
4130
4133
  if (!ele) return ele2;
4131
- if (index === 8) {
4134
+ if (index === 11) {
4132
4135
  ele2 = state_data;
4133
4136
  }
4134
- if (index === 9) {
4137
+ if (index === 12) {
4135
4138
  ele2 = country_data;
4136
4139
  }
4137
4140
  ele = (ele == null ? void 0 : ele.name) || ele;
4138
4141
  ele2 = (ele2 == null ? void 0 : ele2.name) || ele2;
4139
- if ([2, 3, 4, 5].includes(index)) {
4142
+ if ([2, 3, 4, 5, 6, 7].includes(index)) {
4140
4143
  return ele + " " + ele2;
4141
4144
  }
4142
4145
  return ele + ", \n" + ele2;
@@ -4261,7 +4264,29 @@ const AddressModal = ({
4261
4264
  placeholder: t(`accounting.${translationKey}.addressModal.address3_placeholder`)
4262
4265
  }
4263
4266
  ) }),
4267
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4268
+ DynamicInput,
4269
+ {
4270
+ type: "text",
4271
+ formControl: control,
4272
+ label: t(`accounting.${translationKey}.addressModal.streetName_label`),
4273
+ name: "street_name",
4274
+ fieldArrayName: "addresses",
4275
+ placeholder: t(`accounting.${translationKey}.addressModal.streetName_placeholder`)
4276
+ }
4277
+ ) }),
4264
4278
  isKSA,
4279
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4280
+ DynamicInput,
4281
+ {
4282
+ type: "text",
4283
+ formControl: control,
4284
+ label: t(`accounting.${translationKey}.addressModal.nationalAddress_label`),
4285
+ name: "national_address",
4286
+ fieldArrayName: "addresses",
4287
+ placeholder: t(`accounting.${translationKey}.addressModal.nationalAddress_placeholder`)
4288
+ }
4289
+ ) }),
4265
4290
  /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4266
4291
  DynamicInput,
4267
4292
  {
@@ -4311,6 +4336,17 @@ const AddressModal = ({
4311
4336
  formControl: control
4312
4337
  }
4313
4338
  ) }),
4339
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4340
+ DynamicInput,
4341
+ {
4342
+ type: "text",
4343
+ formControl: control,
4344
+ label: t(`accounting.${translationKey}.addressModal.districtName_label`),
4345
+ name: "district_name",
4346
+ fieldArrayName: "addresses",
4347
+ placeholder: t(`accounting.${translationKey}.addressModal.districtName_placeholder`)
4348
+ }
4349
+ ) }),
4314
4350
  /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4315
4351
  DynamicInput,
4316
4352
  {
@@ -16815,4 +16851,4 @@ export {
16815
16851
  DyanmicTextEditor as y,
16816
16852
  DynamicDateRange as z
16817
16853
  };
16818
- //# sourceMappingURL=uom-field-wrapper-BlJaV_Jd.esm.js.map
16854
+ //# sourceMappingURL=uom-field-wrapper-BN-gHLZh.esm.js.map