@erpsquad/common 1.10.29 → 1.10.31

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 (75) hide show
  1. package/dist/chunks/{ERPUIProvider-CLg_Yo12.esm.js → ERPUIProvider-CIzXMsuV.esm.js} +8 -8
  2. package/dist/chunks/{ERPUIProvider-CLg_Yo12.esm.js.map → ERPUIProvider-CIzXMsuV.esm.js.map} +1 -1
  3. package/dist/chunks/{actionCreator-C8cLIOap.esm.js → actionCreator-BzPZv2rR.esm.js} +2 -2
  4. package/dist/chunks/{actionCreator-C8cLIOap.esm.js.map → actionCreator-BzPZv2rR.esm.js.map} +1 -1
  5. package/dist/chunks/{android-12-switch-DM9s0XTb.js → android-12-switch-BILQvv4G.js} +170 -5
  6. package/dist/chunks/android-12-switch-BILQvv4G.js.map +1 -0
  7. package/dist/chunks/{android-12-switch-eTZOAHAa.esm.js → android-12-switch-DpJE56Wi.esm.js} +212 -47
  8. package/dist/chunks/android-12-switch-DpJE56Wi.esm.js.map +1 -0
  9. package/dist/chunks/{appbar-DtROOKgm.esm.js → appbar-5rP5iXcS.esm.js} +4 -4
  10. package/dist/chunks/{appbar-DtROOKgm.esm.js.map → appbar-5rP5iXcS.esm.js.map} +1 -1
  11. package/dist/chunks/{common-Nn4SUfK7.esm.js → common-D59u5rE6.esm.js} +2 -2
  12. package/dist/chunks/{common-Nn4SUfK7.esm.js.map → common-D59u5rE6.esm.js.map} +1 -1
  13. package/dist/chunks/{custom-editor-B-mleFzm.esm.js → custom-editor-UhZu0Svw.esm.js} +2 -2
  14. package/dist/chunks/{custom-editor-B-mleFzm.esm.js.map → custom-editor-UhZu0Svw.esm.js.map} +1 -1
  15. package/dist/chunks/{default-data-BjzCfuoR.js → default-data-B2-JPE4u.js} +9 -11
  16. package/dist/chunks/{default-data-BjzCfuoR.js.map → default-data-B2-JPE4u.js.map} +1 -1
  17. package/dist/chunks/{default-data-C8B-fYa8.esm.js → default-data-DLCnpyaM.esm.js} +19 -21
  18. package/dist/chunks/{default-data-C8B-fYa8.esm.js.map → default-data-DLCnpyaM.esm.js.map} +1 -1
  19. package/dist/chunks/{form-builder-conversion-yi03Elpa.esm.js → form-builder-conversion-gLJCNqSQ.esm.js} +2 -2
  20. package/dist/chunks/{form-builder-conversion-yi03Elpa.esm.js.map → form-builder-conversion-gLJCNqSQ.esm.js.map} +1 -1
  21. package/dist/chunks/{form-builder-deconversion-CFtHF1hm.esm.js → form-builder-deconversion-DNGMsAEj.esm.js} +3 -3
  22. package/dist/chunks/{form-builder-deconversion-CFtHF1hm.esm.js.map → form-builder-deconversion-DNGMsAEj.esm.js.map} +1 -1
  23. package/dist/chunks/{fullScreen-Xv8AR914.esm.js → fullScreen-C8Qnoyrr.esm.js} +2 -2
  24. package/dist/chunks/{fullScreen-Xv8AR914.esm.js.map → fullScreen-C8Qnoyrr.esm.js.map} +1 -1
  25. package/dist/chunks/{languageContext-cweJTzn0.esm.js → languageContext-ffrxXJkr.esm.js} +3 -3
  26. package/dist/chunks/{languageContext-cweJTzn0.esm.js.map → languageContext-ffrxXJkr.esm.js.map} +1 -1
  27. package/dist/chunks/{migration-utils-llqrdBh8.esm.js → migration-utils-BJsX1G2n.esm.js} +2 -2
  28. package/dist/chunks/{migration-utils-llqrdBh8.esm.js.map → migration-utils-BJsX1G2n.esm.js.map} +1 -1
  29. package/dist/chunks/{page-context-BbQNncGA.esm.js → page-context-BlGcwtdZ.esm.js} +3 -3
  30. package/dist/chunks/{page-context-BbQNncGA.esm.js.map → page-context-BlGcwtdZ.esm.js.map} +1 -1
  31. package/dist/chunks/{reducer-DRkUwBHb.esm.js → reducer-D6_f0R4C.esm.js} +2 -2
  32. package/dist/chunks/{reducer-DRkUwBHb.esm.js.map → reducer-D6_f0R4C.esm.js.map} +1 -1
  33. package/dist/chunks/{shareSlice-H0nwzQZv.esm.js → shareSlice-Bxrgfv7o.esm.js} +2 -2
  34. package/dist/chunks/{shareSlice-H0nwzQZv.esm.js.map → shareSlice-Bxrgfv7o.esm.js.map} +1 -1
  35. package/dist/chunks/{sidebar-CdhW0PKj.esm.js → sidebar-n5_ky6G7.esm.js} +4 -4
  36. package/dist/chunks/{sidebar-CdhW0PKj.esm.js.map → sidebar-n5_ky6G7.esm.js.map} +1 -1
  37. package/dist/chunks/{sidebarScreen-DbfP32Xx.esm.js → sidebarScreen-BwkiIBud.esm.js} +5 -6
  38. package/dist/chunks/sidebarScreen-BwkiIBud.esm.js.map +1 -0
  39. package/dist/chunks/{sidebarScreen-figZp_Ln.js → sidebarScreen-Cm763s1P.js} +1 -2
  40. package/dist/chunks/sidebarScreen-Cm763s1P.js.map +1 -0
  41. package/dist/chunks/{store-C2XaFCA_.esm.js → store-OqHSsVaz.esm.js} +3 -3
  42. package/dist/chunks/{store-C2XaFCA_.esm.js.map → store-OqHSsVaz.esm.js.map} +1 -1
  43. package/dist/chunks/{translations-DJZgOpfH.esm.js → translations-GFvlFdi5.esm.js} +2 -2
  44. package/dist/chunks/{translations-DJZgOpfH.esm.js.map → translations-GFvlFdi5.esm.js.map} +1 -1
  45. package/dist/chunks/{uom-field-wrapper-DKN31prP.esm.js → uom-field-wrapper-CgYTONsG.esm.js} +33 -158
  46. package/dist/chunks/uom-field-wrapper-CgYTONsG.esm.js.map +1 -0
  47. package/dist/chunks/{uom-field-wrapper-NNhtGgqI.js → uom-field-wrapper-DoyshtE9.js} +2 -127
  48. package/dist/chunks/uom-field-wrapper-DoyshtE9.js.map +1 -0
  49. package/dist/chunks/{useAccountSetting-CAUDy8rg.esm.js → useAccountSetting-D1Ze8r-T.esm.js} +3 -3
  50. package/dist/chunks/{useAccountSetting-CAUDy8rg.esm.js.map → useAccountSetting-D1Ze8r-T.esm.js.map} +1 -1
  51. package/dist/chunks/{useAdditionalDiscountAutoCalc-DbyTG80U.esm.js → useAdditionalDiscountAutoCalc-PhSfzd5X.esm.js} +5 -5
  52. package/dist/chunks/{useAdditionalDiscountAutoCalc-DbyTG80U.esm.js.map → useAdditionalDiscountAutoCalc-PhSfzd5X.esm.js.map} +1 -1
  53. package/dist/chunks/{useAuth-BaUSGWbL.esm.js → useAuth-DhzbULWV.esm.js} +2 -2
  54. package/dist/chunks/{useAuth-BaUSGWbL.esm.js.map → useAuth-DhzbULWV.esm.js.map} +1 -1
  55. package/dist/chunks/{useLangauge-BUF4epYu.esm.js → useLangauge-CbMaEsdS.esm.js} +2 -2
  56. package/dist/chunks/{useLangauge-BUF4epYu.esm.js.map → useLangauge-CbMaEsdS.esm.js.map} +1 -1
  57. package/dist/components/index.esm.js +53 -53
  58. package/dist/components/index.js +4 -4
  59. package/dist/contexts/index.esm.js +3 -3
  60. package/dist/hooks/index.esm.js +5 -5
  61. package/dist/index.esm.js +90 -90
  62. package/dist/index.js +6 -6
  63. package/dist/layout/index.esm.js +2 -2
  64. package/dist/layout/index.js +1 -1
  65. package/dist/redux/index.esm.js +4 -4
  66. package/dist/utils/index.esm.js +7 -7
  67. package/dist/views/index.esm.js +9 -9
  68. package/dist/views/index.js +2 -2
  69. package/package.json +1 -1
  70. package/dist/chunks/android-12-switch-DM9s0XTb.js.map +0 -1
  71. package/dist/chunks/android-12-switch-eTZOAHAa.esm.js.map +0 -1
  72. package/dist/chunks/sidebarScreen-DbfP32Xx.esm.js.map +0 -1
  73. package/dist/chunks/sidebarScreen-figZp_Ln.js.map +0 -1
  74. package/dist/chunks/uom-field-wrapper-DKN31prP.esm.js.map +0 -1
  75. package/dist/chunks/uom-field-wrapper-NNhtGgqI.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useAuth-BaUSGWbL.esm.js","sources":["../../src/utils/route-utils.ts","../../node_modules/@mui/utils/esm/createChainedFunction/createChainedFunction.js","../../node_modules/@mui/utils/esm/debounce/debounce.js","../../node_modules/@mui/utils/esm/deprecatedPropType/deprecatedPropType.js","../../node_modules/@mui/utils/esm/isMuiElement/isMuiElement.js","../../node_modules/@mui/utils/esm/ownerDocument/ownerDocument.js","../../node_modules/@mui/utils/esm/ownerWindow/ownerWindow.js","../../node_modules/@mui/utils/esm/requirePropFactory/requirePropFactory.js","../../node_modules/@mui/utils/esm/setRef/setRef.js","../../node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js","../../node_modules/@mui/utils/esm/useId/useId.js","../../node_modules/@mui/utils/esm/unsupportedProp/unsupportedProp.js","../../node_modules/@mui/utils/esm/useControlled/useControlled.js","../../node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js","../../node_modules/@mui/utils/esm/useForkRef/useForkRef.js","../../node_modules/@mui/utils/esm/useLazyRef/useLazyRef.js","../../node_modules/@mui/utils/esm/useOnMount/useOnMount.js","../../node_modules/@mui/utils/esm/useTimeout/useTimeout.js","../../node_modules/@mui/utils/esm/useIsFocusVisible/useIsFocusVisible.js","../../node_modules/@mui/material/utils/index.js","../../node_modules/@mui/icons-material/utils/createSvgIcon.js","../../node_modules/@mui/icons-material/Close.js","../../src/components/typography/typography.tsx","../../src/components/custom-snackbar/custom-snackbar.tsx","../../src/contexts/AuthContext.tsx","../../src/hooks/useAuth.ts"],"sourcesContent":["\nexport const convertRoutesToUseIdParams = (routes: Record<string, string>): Record<string, string> => {\n const updatedRoutes: Record<string, string> = { ...routes };\n \n // Identify patterns for view/edit/detail routes\n Object.keys(updatedRoutes).forEach(key => {\n // Common patterns for detail views\n if (\n key.startsWith('VIEW_') || \n key.startsWith('EDIT_') || \n key.startsWith('DETAIL_') ||\n key.includes('_VIEW_') || \n key.includes('_EDIT_') || \n key.includes('_DETAIL_')\n ) {\n if (!updatedRoutes[key].includes(':')) {\n updatedRoutes[key] = `${updatedRoutes[key]}/:id`;\n }\n }\n });\n \n return updatedRoutes;\n};\n\n\nexport const generateRouteWithId = (basePath: string, id: string | number | Record<string, any>): string => {\n if(id && typeof id === 'object') {\n Object.entries(id).map(([key, value]) => {\n basePath = basePath.replace(`:${key}`, value?.toString());\n })\n } else if (basePath.includes(':id')) {\n return basePath.replace(':id', id?.toString());\n }\n \n // If the path doesn't have an :id parameter, append it\n return `${basePath}`;\n};\n\n\nexport const updatePathnameWithIdParams = <T extends Record<string, string>>(pathnameObject: T): T => {\n return convertRoutesToUseIdParams(pathnameObject) as T;\n}; \n\n// Added utility for navigating to views with id parameter\nexport const navigateToRouteWithId = (\n navigate: any,\n route: string, \n id: string | number,\n state?: any\n) => {\n const path = generateRouteWithId(route, id);\n navigate(path, { state });\n}; ","/**\n * Safe chained function.\n *\n * Will only create a new function if needed,\n * otherwise will pass back existing functions or null.\n */\nexport default function createChainedFunction(...funcs) {\n return funcs.reduce((acc, func) => {\n if (func == null) {\n return acc;\n }\n return function chainedFunction(...args) {\n acc.apply(this, args);\n func.apply(this, args);\n };\n }, () => {});\n}","// Corresponds to 10 frames at 60 Hz.\n// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.\nexport default function debounce(func, wait = 166) {\n let timeout;\n function debounced(...args) {\n const later = () => {\n // @ts-ignore\n func.apply(this, args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n debounced.clear = () => {\n clearTimeout(timeout);\n };\n return debounced;\n}","export default function deprecatedPropType(validator, reason) {\n if (process.env.NODE_ENV === 'production') {\n return () => null;\n }\n return (props, propName, componentName, location, propFullName) => {\n const componentNameSafe = componentName || '<<anonymous>>';\n const propFullNameSafe = propFullName || propName;\n if (typeof props[propName] !== 'undefined') {\n return new Error(`The ${location} \\`${propFullNameSafe}\\` of ` + `\\`${componentNameSafe}\\` is deprecated. ${reason}`);\n }\n return null;\n };\n}","import * as React from 'react';\nexport default function isMuiElement(element, muiNames) {\n var _muiName, _element$type;\n return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf( // For server components `muiName` is avaialble in element.type._payload.value.muiName\n // relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45\n // eslint-disable-next-line no-underscore-dangle\n (_muiName = element.type.muiName) != null ? _muiName : (_element$type = element.type) == null || (_element$type = _element$type._payload) == null || (_element$type = _element$type.value) == null ? void 0 : _element$type.muiName) !== -1;\n}","export default function ownerDocument(node) {\n return node && node.ownerDocument || document;\n}","import ownerDocument from '../ownerDocument';\nexport default function ownerWindow(node) {\n const doc = ownerDocument(node);\n return doc.defaultView || window;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nexport default function requirePropFactory(componentNameInError, Component) {\n if (process.env.NODE_ENV === 'production') {\n return () => null;\n }\n\n // eslint-disable-next-line react/forbid-foreign-prop-types\n const prevPropTypes = Component ? _extends({}, Component.propTypes) : null;\n const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {\n const propFullNameSafe = propFullName || propName;\n const defaultTypeChecker = prevPropTypes == null ? void 0 : prevPropTypes[propFullNameSafe];\n if (defaultTypeChecker) {\n const typeCheckerResult = defaultTypeChecker(props, propName, componentName, location, propFullName, ...args);\n if (typeCheckerResult) {\n return typeCheckerResult;\n }\n }\n if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {\n return new Error(`The prop \\`${propFullNameSafe}\\` of ` + `\\`${componentNameInError}\\` can only be used together with the \\`${requiredProp}\\` prop.`);\n }\n return null;\n };\n return requireProp;\n}","/**\n * TODO v5: consider making it private\n *\n * passes {value} to {ref}\n *\n * WARNING: Be sure to only call this inside a callback that is passed as a ref.\n * Otherwise, make sure to cleanup the previous {ref} if it changes. See\n * https://github.com/mui/material-ui/issues/13539\n *\n * Useful if you want to expose the ref of an inner component to the public API\n * while still using it inside the component.\n * @param ref A ref callback or ref object. If anything falsy, this is a no-op.\n */\nexport default function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}","'use client';\n\nimport * as React from 'react';\n\n/**\n * A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.\n * This is useful for effects that are only needed for client-side rendering but not for SSR.\n *\n * Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\n * and confirm it doesn't apply to your use-case.\n */\nconst useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nexport default useEnhancedEffect;","'use client';\n\nimport * as React from 'react';\nlet globalId = 0;\nfunction useGlobalId(idOverride) {\n const [defaultId, setDefaultId] = React.useState(idOverride);\n const id = idOverride || defaultId;\n React.useEffect(() => {\n if (defaultId == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n setDefaultId(`mui-${globalId}`);\n }\n }, [defaultId]);\n return id;\n}\n\n// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814\nconst maybeReactUseId = React['useId'.toString()];\n/**\n *\n * @example <div id={useId()} />\n * @param idOverride\n * @returns {string}\n */\nexport default function useId(idOverride) {\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride != null ? idOverride : reactId;\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride);\n}","export default function unsupportedProp(props, propName, componentName, location, propFullName) {\n if (process.env.NODE_ENV === 'production') {\n return null;\n }\n const propFullNameSafe = propFullName || propName;\n if (typeof props[propName] !== 'undefined') {\n return new Error(`The prop \\`${propFullNameSafe}\\` is not supported. Please remove it.`);\n }\n return null;\n}","'use client';\n\n/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nexport default function useControlled({\n controlled,\n default: defaultProp,\n name,\n state = 'value'\n}) {\n // isControlled is ignored in the hook dependency lists as it should never change.\n const {\n current: isControlled\n } = React.useRef(controlled !== undefined);\n const [valueState, setValue] = React.useState(defaultProp);\n const value = isControlled ? controlled : valueState;\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n if (isControlled !== (controlled !== undefined)) {\n console.error([`MUI: A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [state, name, controlled]);\n const {\n current: defaultValue\n } = React.useRef(defaultProp);\n React.useEffect(() => {\n if (!isControlled && !Object.is(defaultValue, defaultProp)) {\n console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\\n'));\n }\n }, [JSON.stringify(defaultProp)]);\n }\n const setValueIfUncontrolled = React.useCallback(newValue => {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}","'use client';\n\nimport * as React from 'react';\nimport useEnhancedEffect from '../useEnhancedEffect';\n\n/**\n * Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892\n * See RFC in https://github.com/reactjs/rfcs/pull/220\n */\n\nfunction useEventCallback(fn) {\n const ref = React.useRef(fn);\n useEnhancedEffect(() => {\n ref.current = fn;\n });\n return React.useRef((...args) =>\n // @ts-expect-error hide `this`\n (0, ref.current)(...args)).current;\n}\nexport default useEventCallback;","'use client';\n\nimport * as React from 'react';\nimport setRef from '../setRef';\nexport default function useForkRef(...refs) {\n /**\n * This will create a new function if the refs passed to this hook change and are all defined.\n * This means react will call the old forkRef with `null` and the new forkRef\n * with the ref. Cleanup naturally emerges from this behavior.\n */\n return React.useMemo(() => {\n if (refs.every(ref => ref == null)) {\n return null;\n }\n return instance => {\n refs.forEach(ref => {\n setRef(ref, instance);\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n}","'use client';\n\nimport * as React from 'react';\nconst UNINITIALIZED = {};\n\n/**\n * A React.useRef() that is initialized lazily with a function. Note that it accepts an optional\n * initialization argument, so the initialization function doesn't need to be an inline closure.\n *\n * @usage\n * const ref = useLazyRef(sortColumns, columns)\n */\nexport default function useLazyRef(init, initArg) {\n const ref = React.useRef(UNINITIALIZED);\n if (ref.current === UNINITIALIZED) {\n ref.current = init(initArg);\n }\n return ref;\n}","'use client';\n\nimport * as React from 'react';\nconst EMPTY = [];\n\n/**\n * A React.useEffect equivalent that runs once, when the component is mounted.\n */\nexport default function useOnMount(fn) {\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(fn, EMPTY);\n /* eslint-enable react-hooks/exhaustive-deps */\n}","'use client';\n\nimport useLazyRef from '../useLazyRef/useLazyRef';\nimport useOnMount from '../useOnMount/useOnMount';\nexport class Timeout {\n constructor() {\n this.currentId = null;\n this.clear = () => {\n if (this.currentId !== null) {\n clearTimeout(this.currentId);\n this.currentId = null;\n }\n };\n this.disposeEffect = () => {\n return this.clear;\n };\n }\n static create() {\n return new Timeout();\n }\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n start(delay, fn) {\n this.clear();\n this.currentId = setTimeout(() => {\n this.currentId = null;\n fn();\n }, delay);\n }\n}\nexport default function useTimeout() {\n const timeout = useLazyRef(Timeout.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}","'use client';\n\n// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js\nimport * as React from 'react';\nimport { Timeout } from '../useTimeout/useTimeout';\nlet hadKeyboardEvent = true;\nlet hadFocusVisibleRecently = false;\nconst hadFocusVisibleRecentlyTimeout = new Timeout();\nconst inputTypesWhitelist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n};\n\n/**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} node\n * @returns {boolean}\n */\nfunction focusTriggersKeyboardModality(node) {\n const {\n type,\n tagName\n } = node;\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {\n return true;\n }\n if (tagName === 'TEXTAREA' && !node.readOnly) {\n return true;\n }\n if (node.isContentEditable) {\n return true;\n }\n return false;\n}\n\n/**\n * Keep track of our keyboard modality state with `hadKeyboardEvent`.\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * @param {KeyboardEvent} event\n */\nfunction handleKeyDown(event) {\n if (event.metaKey || event.altKey || event.ctrlKey) {\n return;\n }\n hadKeyboardEvent = true;\n}\n\n/**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n */\nfunction handlePointerDown() {\n hadKeyboardEvent = false;\n}\nfunction handleVisibilityChange() {\n if (this.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n }\n}\nfunction prepare(doc) {\n doc.addEventListener('keydown', handleKeyDown, true);\n doc.addEventListener('mousedown', handlePointerDown, true);\n doc.addEventListener('pointerdown', handlePointerDown, true);\n doc.addEventListener('touchstart', handlePointerDown, true);\n doc.addEventListener('visibilitychange', handleVisibilityChange, true);\n}\nexport function teardown(doc) {\n doc.removeEventListener('keydown', handleKeyDown, true);\n doc.removeEventListener('mousedown', handlePointerDown, true);\n doc.removeEventListener('pointerdown', handlePointerDown, true);\n doc.removeEventListener('touchstart', handlePointerDown, true);\n doc.removeEventListener('visibilitychange', handleVisibilityChange, true);\n}\nfunction isFocusVisible(event) {\n const {\n target\n } = event;\n try {\n return target.matches(':focus-visible');\n } catch (error) {\n // Browsers not implementing :focus-visible will throw a SyntaxError.\n // We use our own heuristic for those browsers.\n // Rethrow might be better if it's not the expected error but do we really\n // want to crash if focus-visible malfunctioned?\n }\n\n // No need for validFocusTarget check. The user does that by attaching it to\n // focusable events only.\n return hadKeyboardEvent || focusTriggersKeyboardModality(target);\n}\nexport default function useIsFocusVisible() {\n const ref = React.useCallback(node => {\n if (node != null) {\n prepare(node.ownerDocument);\n }\n }, []);\n const isFocusVisibleRef = React.useRef(false);\n\n /**\n * Should be called if a blur event is fired\n */\n function handleBlurVisible() {\n // checking against potential state variable does not suffice if we focus and blur synchronously.\n // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.\n // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.\n // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751\n // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).\n if (isFocusVisibleRef.current) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n hadFocusVisibleRecentlyTimeout.start(100, () => {\n hadFocusVisibleRecently = false;\n });\n isFocusVisibleRef.current = false;\n return true;\n }\n return false;\n }\n\n /**\n * Should be called if a blur event is fired\n */\n function handleFocusVisible(event) {\n if (isFocusVisible(event)) {\n isFocusVisibleRef.current = true;\n return true;\n }\n return false;\n }\n return {\n isFocusVisibleRef,\n onFocus: handleFocusVisible,\n onBlur: handleBlurVisible,\n ref\n };\n}","'use client';\n\nimport { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/utils';\nexport { default as capitalize } from './capitalize';\nexport { default as createChainedFunction } from './createChainedFunction';\nexport { default as createSvgIcon } from './createSvgIcon';\nexport { default as debounce } from './debounce';\nexport { default as deprecatedPropType } from './deprecatedPropType';\nexport { default as isMuiElement } from './isMuiElement';\nexport { default as ownerDocument } from './ownerDocument';\nexport { default as ownerWindow } from './ownerWindow';\nexport { default as requirePropFactory } from './requirePropFactory';\nexport { default as setRef } from './setRef';\nexport { default as unstable_useEnhancedEffect } from './useEnhancedEffect';\nexport { default as unstable_useId } from './useId';\nexport { default as unsupportedProp } from './unsupportedProp';\nexport { default as useControlled } from './useControlled';\nexport { default as useEventCallback } from './useEventCallback';\nexport { default as useForkRef } from './useForkRef';\nexport { default as useIsFocusVisible } from './useIsFocusVisible';\n// TODO: remove this export once ClassNameGenerator is stable\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const unstable_ClassNameGenerator = {\n configure: generator => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(['MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.', '', \"You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead\", '', 'The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401', '', 'The updated documentation: https://mui.com/guides/classname-generator/'].join('\\n'));\n }\n ClassNameGenerator.configure(generator);\n }\n};","\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _utils.createSvgIcon;\n }\n});\nvar _utils = require(\"@mui/material/utils\");","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n}), 'Close');","import {\n Typography as MUITypography,\n TypographyProps,\n styled,\n} from \"@mui/material\";\n\nexport interface ITypography extends TypographyProps {\n type?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"s1\" | \"s2\" | \"s3\" | \"s4\" | \"s5\";\n weight?: \"normal\" | \"medium\" | \"bold\";\n}\n\nconst StyledTypography = styled(MUITypography)<ITypography>(\n ({ theme: { palette }, color }) => ({\n color: color || palette.theme?.primary[800],\n }),\n);\n\nexport function Typography(props: ITypography) {\n const {\n children,\n type = \"h5\",\n weight = \"normal\",\n className,\n ...rest\n } = props;\n\n return (\n <StyledTypography className={`${type} ${weight} ${className}`} {...rest}>\n {children}\n </StyledTypography>\n );\n}\n\nexport default Typography;\n","import React from 'react';\nimport { SnackbarContent, useSnackbar } from 'notistack';\nimport { Avatar, Box, IconButton } from '@mui/material';\nimport CloseIcon from '@mui/icons-material/Close';\nimport { useNavigate } from 'react-router-dom';\nimport { Notification } from '../icons';\nimport Typography from '../typography/typography';\nimport images from '../../assets/images';\nimport \"./custom-snackbar.scss\"\n\ninterface CustomSnackbarProps {\n message: string;\n variant?: 'default' | 'error' | 'success' | 'warning' | 'info';\n linkUrl?: string;\n snackbarKey: string | number;\n}\n\nconst mainModuleIcons = {\n rbac: images.user,\n document: images.document,\n 'accounts-and-finance': images.accounting,\n inventory: images.inventory,\n manufacturing: images.manufacturing,\n sales: images.crm,\n rental: images.rental,\n user: images.user,\n purchase: images.procurement,\n hrms: images.hrms\n}\nconst mainModuleBgColors = {\n rbac: '#F3E5F5',\n document: '#FFF8E1',\n 'accounts-and-finance': '#E8F5E8',\n inventory: '#E3F2FD',\n manufacturing: '#FFF3E0',\n sales: '#F3E5F5',\n rental: '#E8F5E8',\n user: '#F3E5F5',\n purchase: '#FCE4EC',\n hrms: '#fcfcfc'\n}\n\nconst CustomSnackbar = React.forwardRef<HTMLDivElement, CustomSnackbarProps>(\n ({ message, variant = 'default', linkUrl, snackbarKey, data }, ref) => {\n const { closeSnackbar } = useSnackbar();\n const navigate = useNavigate();\n\n const backgroundColorMap: Record<string, string> = {\n success: '#f0fdf4',\n error: '#fef2f2',\n warning: '#fff7ed',\n info: '#eff6ff',\n default: '#fff',\n };\n\n const textColorMap: Record<string, string> = {\n success: '#166534',\n error: '#991b1b',\n warning: '#92400e',\n info: '#1e40af',\n default: '#27272a',\n };\n\n const handleClick = () => {\n if (linkUrl) navigate(linkUrl);\n closeSnackbar(snackbarKey);\n };\n\n const handleCloseClick = (e: React.MouseEvent) => {\n e.stopPropagation(); // Prevent triggering link\n closeSnackbar(snackbarKey);\n };\n\n return (\n <SnackbarContent\n ref={ref}\n style={{\n backgroundColor: backgroundColorMap[variant],\n color: textColorMap[variant],\n }}\n className='SnackBar'\n onClick={handleClick}\n >\n <Box display=\"flex\" alignItems=\"center\" p={2} position=\"relative\" gap={2} width='100%'>\n {mainModuleIcons?.[data.module] ?\n <Avatar sx={{ \n width: 45, \n height: 45, \n fontSize: '0.875rem',\n bgcolor: mainModuleBgColors[data.module] || 'primary.main',\n color: 'white',\n borderRadius: '8px',\n '& img': { \n width: '35px', \n height: '35px', \n objectFit: 'contain'\n }\n }} src={mainModuleIcons?.[data.module]} /> :\n <Notification\n style={{\n color: textColorMap[variant],\n marginTop: 2,\n }}\n />\n }\n <Box display=\"flex\" alignItems=\"center\" width='100%'>\n <Box flex=\"1\">\n <Typography type='h5' color={'inherit'} weight='bold'>\n New Notification\n </Typography>\n <Typography type='s3' mt={0.5} color={'inherit'}>\n {message}\n </Typography>\n </Box>\n\n <IconButton\n size=\"small\"\n onClick={handleCloseClick}\n // style={{\n // position: 'absolute',\n // top: 4,\n // right: 4,\n // color: textColorMap[variant],\n // }}\n >\n <CloseIcon fontSize=\"small\" />\n </IconButton>\n </Box>\n </Box>\n </SnackbarContent>\n );\n }\n);\n\nexport { CustomSnackbar };\nexport default CustomSnackbar;\n","import React, { createContext, useEffect, useRef, useState } from 'react';\nimport {\n\tpostV1AuthChangePassword,\n\tpostV1AuthForgotPassword,\n\tpostV1AuthChangeUserPassword,\n\t// getV1UserId,\n\tpostV1AuthLogin,\n\tpostV1AuthResetPassword,\n\tsetBaseUrl,\n\tpostV1AuthChangeUserPasswordByAdmin\n} from '../api-client/api.rbac/api';\nimport { auth } from '../constants/auth';\nimport { useLocation, matchRoutes, useNavigate } from 'react-router-dom';\nimport { Pathname } from '../constants/pathnames/pathname'; // Removed - should be passed as props or configured by consuming app\nimport { getToken } from '../utils/common';\nimport { enqueueSnackbar } from 'notistack';\nimport { Socket, io } from 'socket.io-client';\nimport { generateRouteWithId } from '../utils/route-utils';\nimport { getApiConfig } from '../utils/api-config';\nimport {\n\tPathnameAccounting,\n\tPathnameGenerator\n} from '../constants/pathnames/pathname.accounting';\n\nimport {\n\tPathnameInventory,\n\tPathnameGenerator as PathnameGeneratorInventory\n} from '../constants/pathnames/pathname.inventory';\n\nimport {\n\tPathnameManufacturing,\n\tPathnameGenerator as PathnameGeneratorManufacuring\n} from '../constants/pathnames/pathname.manufacturing';\n\nimport {\n\tPathnamePurchase,\n\tPathnameGenerator as PathnameGeneratorPurchase\n} from '../constants/pathnames/pathname.procurement';\n\nimport {\n\tPathnameCrm,\n\tPathnameGenerator as PathnameGeneratorCrm\n} from '../constants/pathnames/pathname.crm';\n\nimport {\n\tPathnameRental,\n\tPathnameGenerator as PathnameGeneratorRental\n} from '../constants/pathnames/pathname.rental';\n\nimport { ROUTES as RENTALROUTES } from '../constants/pathnames/pathname.rental';\n\nimport CustomSnackbar from '../components/custom-snackbar/custom-snackbar.tsx';\nimport { RbacApi } from '@/api-client/index.ts';\nexport interface LoginFormValues {\n\temail: string;\n\tpassword: string;\n}\n\nexport interface resetFormValues {\n\temail: string;\n}\n\nexport interface resetPasswordValues {\n\ttoken: string;\n}\n\nexport interface changePasswordValues {\n\tpassword: string;\n}\n\nexport interface changeUserPasswordValues {\n\tpassword: string;\n}\n\ninterface ERPApiUser {\n\tid: string | number;\n\tfirst_name: string;\n\tlast_name: string;\n\tmiddle_name: string;\n\tcountry_code: string;\n\temail: string;\n\tcreated_by: any;\n\tupdated_by: any;\n\tcreated_at: string;\n\tupdated_at: string;\n\trole_id: string;\n\tdepartment_id: number;\n\tis_deleted: number;\n\tdeleted_at: string | null;\n\tdeleted_by: any;\n\ttoken: string;\n\tprofile_image: string;\n\tcompany_id: number | string;\n\tcurrency_data?: {\n\t\tid: number;\n\t\tsymbol: string;\n\t\tcurrency_name: string;\n\t\tnumber_format: string;\n\t\tposition: string | null;\n\t\tfraction_unit: string | null\n\t};\n\taccessCompanies?: any[]\n}\ninterface ERPUser extends Omit<ERPApiUser, 'token'> {\n\tfull_name: string;\n}\n\nexport interface DefaultProviderProps {\n\tuser: ERPUser | null;\n\tloading: boolean;\n\tauthToken: string;\n\tsetUser: React.Dispatch<React.SetStateAction<ERPUser | null>>;\n\tsetLoading: React.Dispatch<React.SetStateAction<boolean>>;\n\tlogin: (\n\t\tparams: LoginFormValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tlogout: () => Promise<void>;\n\tforgotPassword: (\n\t\tparams: resetFormValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tresetPassword: (\n\t\tparams: resetPasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tchangePassword: (\n\t\tparams: changePasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tchangeUserPassword: (\n\t\tparams: changeUserPasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n}\n\nconst defaultProvider: DefaultProviderProps = {\n\tuser: null,\n\tloading: true,\n\tauthToken: '',\n\tsetUser: () => null,\n\tsetLoading: () => Boolean,\n\tlogin: () => Promise.resolve(),\n\tlogout: () => Promise.resolve(),\n\tforgotPassword: () => Promise.resolve(),\n\tresetPassword: () => Promise.resolve(),\n\tchangePassword: () => Promise.resolve(),\n\tchangeUserPassword: () => Promise.resolve()\n};\n\nconst AuthContext = createContext<DefaultProviderProps>(defaultProvider);\n\ninterface AuthProviderProps {\n\tchildren: React.ReactNode;\n\tpublicRoutes?: string[]; // Optional prop to allow customization of public routes\n}\n\n// Base URL will be set at runtime via ERPUIProvider\n\nconst AuthProvider: React.FC<AuthProviderProps> = ({ children, publicRoutes = [] }) => {\n\t// ** States\n\tconst [user, setUser] = useState(defaultProvider.user);\n\tconst [authToken, setAuthToken] = useState<string>('');\n\tconst [loading, setLoading] = useState(defaultProvider.loading);\n\tconst socketRef = useRef<Socket | null>(null);\n\n\t// ** Hooks\n\tconst navigate = useNavigate();\n\tconst location = useLocation();\n\tconst isJsonParse = (string?: string | null) => {\n\t\tif (!string) return false;\n\n\t\ttry {\n\t\t\treturn JSON.parse(string);\n\t\t} catch (error) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tconst getNotificationUrl = (data: any) => {\n\t\tconst { moduleName = '', moduleId = '', notificationData = {} } = data;\n\t\tconst key = moduleName.toLowerCase();\n\n\t\tconst routeMap: Record<string, () => string> = {\n\t\t\t'sales invoice': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_SALES_INVOICES), moduleId.toString()),\n\n\t\t\t'asset transfers': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_ASSET_TRANSFER), moduleId.toString()),\n\n\t\t\t'budgets': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_BUDGET), moduleId.toString()),\n\n\t\t\t'cash expense': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_CASH_EXPENSE), moduleId.toString()),\n\n\t\t\t'credit notes': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_CREDIT_NOTE), moduleId.toString()),\n\n\t\t\t'debit notes': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_DEBIT_NOTE), moduleId.toString()),\n\n\t\t\t'expense reimbursement': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_EXPENSE_REIMBURSEMENT), moduleId.toString()),\n\n\t\t\t'journal entries': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_JOURNAL_ENTRY), moduleId.toString()),\n\n\t\t\t'payment entries': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_PAYMENT_ENTRY), moduleId.toString()),\n\n\t\t\t'purchase invoice': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_PURCHASE_INVOICE), moduleId.toString()),\n\n\t\t\t'stock transfer': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorInventory(PathnameInventory.VIEW_STOCK_TRANSFER), moduleId.toString()),\n\n\t\t\t'bills of materials': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorManufacuring(PathnameManufacturing.VIEW_BILL_OF_MATERIAL), moduleId.toString()),\n\n\t\t\t'purchase agreement': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_AGREEMENT), moduleId.toString()),\n\n\t\t\t'purchase orders': () =>\n\t\t\t\tgenerateRouteWithId(notificationData?.data?.is_rental == 1 ? RENTALROUTES.VIEW : PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_ORDER), moduleId.toString()),\n\n\t\t\t'purchase request': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_ORDER), moduleId.toString()),\n\n\t\t\t'vra': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_VENDOR_RETURNS), moduleId.toString()),\n\n\t\t\t'sl customer returns': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorCrm(PathnameCrm.VIEW_CUSTOMER_RETURNS), moduleId.toString()),\n\n\t\t\t'sales order': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorCrm(PathnameCrm.VIEW_SALES_ORDER), moduleId.toString()),\n\n\t\t\t'rental order': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_RENTAL_ORDER), moduleId.toString()),\n\n\t\t\t'replacement order': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_RENTAL_ORDER), moduleId.toString()),\n\n\t\t\t'rental agreement': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_AGREEMENT), moduleId.toString()),\n\n\t\t\t'cross hire order': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_CROSS_HIRE_ORDER), moduleId.toString()),\n\n\t\t\t'cross hire request': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_CROSS_HIRE_REQUEST), moduleId.toString()),\n\t\t};\n\n\t\treturn routeMap[key]?.() || '/dashboard';\n\t};\n\n\tuseEffect(() => {\n\t\tsetLoading(true);\n\t\t// initAuth()\n\t\tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t\tconst storedUser =\n\t\t\tisJsonParse(window.localStorage.getItem(auth.storageUserKeyName)) ?? null;\n\t\tconst allPublicRoutes = [Pathname.LOGIN, Pathname.FORGOT_PASSWORD, Pathname.RESET_PASSWORD, Pathname.CHANGE_PASSWORD, ...publicRoutes];\n\t\tconst currentPath = window.location.pathname;\n\t\tif (!storedToken && !storedUser) {\n\t\t\tconsole.log('allPublicRoutes..', allPublicRoutes, 'currentPath..', currentPath)\n\t\t\t// if (!allPublicRoutes.includes(currentPath)) {\n\t\t\tif (Boolean(!matchRoutes(allPublicRoutes.map((route) => ({ path: route })), location))) {\n\t\t\t\tnavigate(Pathname.LOGIN);\n\t\t\t}\n\t\t\tsetLoading(false);\n\t\t} else {\n\t\t\tsetUser(storedUser);\n\t\t\tsetAuthToken(storedToken || '');\n\t\t\tsetLoading(false);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!authToken) {\n\t\t\tif (socketRef.current) {\n\t\t\t\tsocketRef.current?.disconnect();\n\t\t\t\tsocketRef.current = null\n\t\t\t}\n\t\t\tconsole.warn(\"No auth token found, not connecting to socket.\");\n\t\t\treturn;\n\t\t}\n\n\t\tconst config = getApiConfig();\n\t\tconst socket = io(config.socketBaseUrl, {\n\t\t\ttransports: [\"websocket\"],\n\t\t\tauth: { token: authToken },\n\t\t\tpath: \"/socket.io/\",\n\n\t\t});\n\t\tsocketRef.current = socket;\n\n\t\tsocket.on(\"connect\", () => {\n\t\t\tconsole.log(\"Socket connected:\", socket.id);\n\t\t\tsocket.onAny((event, ...args) => {\n\t\t\t\tconsole.log(`Received event: ${event}`, args);\n\t\t\t});\n\t\t});\n\n\t\t// socket event handler\n\t\tsocket.on('notification', (data) => {\n\t\t\tconst { message, notificationData } = data || {};\n\t\t\tlet notificationContent: React.ReactNode = message;\n\t\t\tconst url = getNotificationUrl(data);\n\n\t\t\tif (notificationData) {\n\t\t\t\tconst { notification_type } = notificationData;\n\n\t\t\t\tswitch (notification_type) {\n\t\t\t\t\tcase 'addApprovers': {\n\n\t\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'change_approval_status': {\n\t\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tenqueueSnackbar(String(message), {\n\t\t\t\tvariant: 'default',\n\t\t\t\tanchorOrigin: { vertical: 'top', horizontal: 'center' },\n\t\t\t\tautoHideDuration: 5000,\n\t\t\t\tcontent: (key) => (\n\t\t\t\t\t<CustomSnackbar snackbarKey={key} message={notificationContent} data={notificationData} variant=\"default\" linkUrl={url} />\n\t\t\t\t),\n\t\t\t});\n\t\t});\n\n\n\t\tsocket.on(\"sales_invoice_viewed\", (data) => {\n\t\t\tconsole.log(\"Invoice viewed:\", data.invoiceId, \"by user:\", data.userId);\n\t\t});\n\n\t\tsocket.on(\"error\", (errMsg) => {\n\t\t\tenqueueSnackbar(`Socket error: ${errMsg}`, { variant: \"error\" });\n\t\t\tconsole.error(\"Socket error:\", errMsg);\n\t\t});\n\n\t\t// Clean up on unmount\n\t\treturn () => {\n\t\t\tif (socketRef.current) {\n\t\t\t\tsocketRef.current.disconnect();\n\t\t\t\tsocketRef.current = null\n\t\t\t}\n\t\t};\n\t}, [authToken]);\n\n\tconst fetchRolesByUserId = async (userId: number | string, token: string) => {\n\t\tconst response = await RbacApi.getV1RoleUserId({ id: userId, ...getToken(token) } as any);\n\t\tconst perm = response?.data?.role || [];\n\t\treturn JSON.stringify(perm);\n\t}\n\n\tconst handleLogin = async (\n\t\tparams: LoginFormValues,\n\t\tcallback: (err: string) => void,\n\t\tshoudRedirect: boolean = true,\n\t\tredirectPath: string = Pathname.DASHBOARD\n\t) => {\n\t\tsetLoading(true);\n\t\tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t\tif (storedToken && user) {\n\t\t\treturn navigate(Pathname.DASHBOARD);\n\t\t}\n\n\t\ttry {\n\t\t\tconst loginUser = await postV1AuthLogin({ ...params, ...getToken() });\n\t\t\tif (loginUser.success) {\n\t\t\t\tconst data: ERPApiUser | null = loginUser?.data?.login || null;\n\t\t\t\tif (data) {\n\t\t\t\t\tconst userData: ERPUser = {\n\t\t\t\t\t\t...data,\n\t\t\t\t\t\tfull_name: `${data.first_name} ${data.last_name}`\n\t\t\t\t\t};\n\t\t\t\t\tconst rolePermission = await fetchRolesByUserId(userData.id, data.token);\n\t\t\t\t\t\n\t\t\t\t\tglobalThis.localStorage.setItem(auth.storageTokenKeyName, data.token);\n\t\t\t\t\twindow.localStorage.setItem(auth.storageUserKeyName, JSON.stringify(userData));\n\t\t\t\t\twindow.localStorage.setItem(auth.storageRolePermissionKeyName, rolePermission);\n\t\t\t\t\twindow.dispatchEvent(new Event(\"role-permission-changed\"));\n\n\t\t\t\t\tsetUser(userData);\n\t\t\t\t\tsetAuthToken(data.token);\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tshoudRedirect && navigate(redirectPath);\n\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t\tdelete data.token;\n\t\t\t\t\t}, 1000);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t}\n\t\t\tsetLoading(false);\n\t\t\tcallback(message);\n\t\t}\n\t};\n\n\tconst handleLogout = async () => {\n\t\twindow.localStorage.removeItem(auth.storageTokenKeyName);\n\t\twindow.localStorage.removeItem(auth.storageUserKeyName);\n\t\twindow.localStorage.removeItem(auth.storageRolePermissionKeyName);\n\t\twindow.dispatchEvent(new Event(\"role-permission-changed\"));\n\t\tsetUser(null);\n\t\tsetAuthToken('');\n\t\tnavigate(Pathname.LOGIN);\n\t};\n\n\tconst handleForgotPassword = async (params: resetFormValues,\n\t\tcallback: (type: boolean, err: string) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthForgotPassword({ ...params, ...getToken() });\n\t\t\tcallback(true, \"Reset Link sent to your email\");\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t}\n\n\t\t\tcallback(false, message);\n\t\t}\n\t};\n\n\tconst handleResetPassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string) => void) => {\n\t\ttry {\n\t\t\tconst response = await postV1AuthResetPassword({ ...params, ...getToken() });\n\t\t\tcallback(response);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tconsole.log(\"Error \", error)\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst handleChangePassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangePassword({ ...params, ...getToken() });\n\t\t\tcallback(null);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tconsole.log(\"Error \", error)\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message);\n\t\t\t}\n\t\t}\n\t\tcallback(\"reset\");\n\t}\n\n\tconst handleChangeUserPassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string, resType: boolean) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangeUserPassword({ ...params, ...getToken() });\n\t\t\tcallback('Password Changed Successfully', true);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message, false);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst handleChangeUserPasswordByAdmin = async (params: changePasswordValues,\n\t\tcallback: (err: string, resType: boolean) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangeUserPasswordByAdmin({ ...params, ...getToken() });\n\t\t\tcallback('Password Changed Successfully', true);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message, false);\n\t\t\t}\n\t\t}\n\t}\n\n\n\tconst values = {\n\t\tuser,\n\t\tauthToken,\n\t\tloading,\n\t\tsetUser,\n\t\tsetLoading,\n\t\tlogin: handleLogin,\n\t\tlogout: handleLogout,\n\t\tforgotPassword: handleForgotPassword,\n\t\tresetPassword: handleResetPassword,\n\t\tchangePassword: handleChangePassword,\n\t\tchangeUserPassword: handleChangeUserPassword,\n\t\tchangeUserPasswordByAdmin: handleChangeUserPasswordByAdmin\n\t};\n\n\treturn <AuthContext.Provider value={values}>{children}</AuthContext.Provider>;\n};\n\nexport { AuthContext, AuthProvider };\n","import { useContext } from \"react\";\nimport { AuthContext, DefaultProviderProps } from \"../contexts/AuthContext\";\n\nexport const useAuth = (): DefaultProviderProps => useContext(AuthContext);\n"],"names":["require$$0","require$$1","require$$2","MUITypography","jsx","React","jsxs","CloseIcon","PathnameGenerator","PathnameGeneratorInventory","PathnameGeneratorManufacuring","PathnameGeneratorPurchase","_a","RENTALROUTES","PathnameGeneratorCrm","PathnameGeneratorRental","RbacApi.getV1RoleUserId"],"mappings":";;;;;;;;;;;;;;;;AACO,MAAM,6BAA6B,CAAC,WAA2D;AACpG,QAAM,gBAAwC,EAAE,GAAG,OAAA;AAGnD,SAAO,KAAK,aAAa,EAAE,QAAQ,CAAA,QAAO;AAExC,QACE,IAAI,WAAW,OAAO,KACtB,IAAI,WAAW,OAAO,KACtB,IAAI,WAAW,SAAS,KACxB,IAAI,SAAS,QAAQ,KACrB,IAAI,SAAS,QAAQ,KACrB,IAAI,SAAS,UAAU,GACvB;AACA,UAAI,CAAC,cAAc,GAAG,EAAE,SAAS,GAAG,GAAG;AACrC,sBAAc,GAAG,IAAI,GAAG,cAAc,GAAG,CAAC;AAAA,MAC5C;AAAA,IACF;AAAA,EACF,CAAC;AAED,SAAO;AACT;AAGO,MAAM,sBAAsB,CAAC,UAAkB,OAAsD;AAC1G,MAAG,MAAM,OAAO,OAAO,UAAU;AAC/B,WAAO,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AACvC,iBAAW,SAAS,QAAQ,IAAI,GAAG,IAAI,+BAAO,UAAU;AAAA,IAC1D,CAAC;AAAA,EACH,WAAW,SAAS,SAAS,KAAK,GAAG;AACnC,WAAO,SAAS,QAAQ,OAAO,yBAAI,UAAU;AAAA,EAC/C;AAGA,SAAO,GAAG,QAAQ;AACpB;AAGO,MAAM,6BAA6B,CAAmC,mBAAyB;AACpG,SAAO,2BAA2B,cAAc;AAClD;AAGO,MAAM,wBAAwB,CACnC,UACA,OACA,IACA,UACG;AACH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21]}
1
+ {"version":3,"file":"useAuth-DhzbULWV.esm.js","sources":["../../src/utils/route-utils.ts","../../node_modules/@mui/utils/esm/createChainedFunction/createChainedFunction.js","../../node_modules/@mui/utils/esm/debounce/debounce.js","../../node_modules/@mui/utils/esm/deprecatedPropType/deprecatedPropType.js","../../node_modules/@mui/utils/esm/isMuiElement/isMuiElement.js","../../node_modules/@mui/utils/esm/ownerDocument/ownerDocument.js","../../node_modules/@mui/utils/esm/ownerWindow/ownerWindow.js","../../node_modules/@mui/utils/esm/requirePropFactory/requirePropFactory.js","../../node_modules/@mui/utils/esm/setRef/setRef.js","../../node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js","../../node_modules/@mui/utils/esm/useId/useId.js","../../node_modules/@mui/utils/esm/unsupportedProp/unsupportedProp.js","../../node_modules/@mui/utils/esm/useControlled/useControlled.js","../../node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js","../../node_modules/@mui/utils/esm/useForkRef/useForkRef.js","../../node_modules/@mui/utils/esm/useLazyRef/useLazyRef.js","../../node_modules/@mui/utils/esm/useOnMount/useOnMount.js","../../node_modules/@mui/utils/esm/useTimeout/useTimeout.js","../../node_modules/@mui/utils/esm/useIsFocusVisible/useIsFocusVisible.js","../../node_modules/@mui/material/utils/index.js","../../node_modules/@mui/icons-material/utils/createSvgIcon.js","../../node_modules/@mui/icons-material/Close.js","../../src/components/typography/typography.tsx","../../src/components/custom-snackbar/custom-snackbar.tsx","../../src/contexts/AuthContext.tsx","../../src/hooks/useAuth.ts"],"sourcesContent":["\nexport const convertRoutesToUseIdParams = (routes: Record<string, string>): Record<string, string> => {\n const updatedRoutes: Record<string, string> = { ...routes };\n \n // Identify patterns for view/edit/detail routes\n Object.keys(updatedRoutes).forEach(key => {\n // Common patterns for detail views\n if (\n key.startsWith('VIEW_') || \n key.startsWith('EDIT_') || \n key.startsWith('DETAIL_') ||\n key.includes('_VIEW_') || \n key.includes('_EDIT_') || \n key.includes('_DETAIL_')\n ) {\n if (!updatedRoutes[key].includes(':')) {\n updatedRoutes[key] = `${updatedRoutes[key]}/:id`;\n }\n }\n });\n \n return updatedRoutes;\n};\n\n\nexport const generateRouteWithId = (basePath: string, id: string | number | Record<string, any>): string => {\n if(id && typeof id === 'object') {\n Object.entries(id).map(([key, value]) => {\n basePath = basePath.replace(`:${key}`, value?.toString());\n })\n } else if (basePath.includes(':id')) {\n return basePath.replace(':id', id?.toString());\n }\n \n // If the path doesn't have an :id parameter, append it\n return `${basePath}`;\n};\n\n\nexport const updatePathnameWithIdParams = <T extends Record<string, string>>(pathnameObject: T): T => {\n return convertRoutesToUseIdParams(pathnameObject) as T;\n}; \n\n// Added utility for navigating to views with id parameter\nexport const navigateToRouteWithId = (\n navigate: any,\n route: string, \n id: string | number,\n state?: any\n) => {\n const path = generateRouteWithId(route, id);\n navigate(path, { state });\n}; ","/**\n * Safe chained function.\n *\n * Will only create a new function if needed,\n * otherwise will pass back existing functions or null.\n */\nexport default function createChainedFunction(...funcs) {\n return funcs.reduce((acc, func) => {\n if (func == null) {\n return acc;\n }\n return function chainedFunction(...args) {\n acc.apply(this, args);\n func.apply(this, args);\n };\n }, () => {});\n}","// Corresponds to 10 frames at 60 Hz.\n// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.\nexport default function debounce(func, wait = 166) {\n let timeout;\n function debounced(...args) {\n const later = () => {\n // @ts-ignore\n func.apply(this, args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n debounced.clear = () => {\n clearTimeout(timeout);\n };\n return debounced;\n}","export default function deprecatedPropType(validator, reason) {\n if (process.env.NODE_ENV === 'production') {\n return () => null;\n }\n return (props, propName, componentName, location, propFullName) => {\n const componentNameSafe = componentName || '<<anonymous>>';\n const propFullNameSafe = propFullName || propName;\n if (typeof props[propName] !== 'undefined') {\n return new Error(`The ${location} \\`${propFullNameSafe}\\` of ` + `\\`${componentNameSafe}\\` is deprecated. ${reason}`);\n }\n return null;\n };\n}","import * as React from 'react';\nexport default function isMuiElement(element, muiNames) {\n var _muiName, _element$type;\n return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf( // For server components `muiName` is avaialble in element.type._payload.value.muiName\n // relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45\n // eslint-disable-next-line no-underscore-dangle\n (_muiName = element.type.muiName) != null ? _muiName : (_element$type = element.type) == null || (_element$type = _element$type._payload) == null || (_element$type = _element$type.value) == null ? void 0 : _element$type.muiName) !== -1;\n}","export default function ownerDocument(node) {\n return node && node.ownerDocument || document;\n}","import ownerDocument from '../ownerDocument';\nexport default function ownerWindow(node) {\n const doc = ownerDocument(node);\n return doc.defaultView || window;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nexport default function requirePropFactory(componentNameInError, Component) {\n if (process.env.NODE_ENV === 'production') {\n return () => null;\n }\n\n // eslint-disable-next-line react/forbid-foreign-prop-types\n const prevPropTypes = Component ? _extends({}, Component.propTypes) : null;\n const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {\n const propFullNameSafe = propFullName || propName;\n const defaultTypeChecker = prevPropTypes == null ? void 0 : prevPropTypes[propFullNameSafe];\n if (defaultTypeChecker) {\n const typeCheckerResult = defaultTypeChecker(props, propName, componentName, location, propFullName, ...args);\n if (typeCheckerResult) {\n return typeCheckerResult;\n }\n }\n if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {\n return new Error(`The prop \\`${propFullNameSafe}\\` of ` + `\\`${componentNameInError}\\` can only be used together with the \\`${requiredProp}\\` prop.`);\n }\n return null;\n };\n return requireProp;\n}","/**\n * TODO v5: consider making it private\n *\n * passes {value} to {ref}\n *\n * WARNING: Be sure to only call this inside a callback that is passed as a ref.\n * Otherwise, make sure to cleanup the previous {ref} if it changes. See\n * https://github.com/mui/material-ui/issues/13539\n *\n * Useful if you want to expose the ref of an inner component to the public API\n * while still using it inside the component.\n * @param ref A ref callback or ref object. If anything falsy, this is a no-op.\n */\nexport default function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}","'use client';\n\nimport * as React from 'react';\n\n/**\n * A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.\n * This is useful for effects that are only needed for client-side rendering but not for SSR.\n *\n * Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\n * and confirm it doesn't apply to your use-case.\n */\nconst useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nexport default useEnhancedEffect;","'use client';\n\nimport * as React from 'react';\nlet globalId = 0;\nfunction useGlobalId(idOverride) {\n const [defaultId, setDefaultId] = React.useState(idOverride);\n const id = idOverride || defaultId;\n React.useEffect(() => {\n if (defaultId == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n setDefaultId(`mui-${globalId}`);\n }\n }, [defaultId]);\n return id;\n}\n\n// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814\nconst maybeReactUseId = React['useId'.toString()];\n/**\n *\n * @example <div id={useId()} />\n * @param idOverride\n * @returns {string}\n */\nexport default function useId(idOverride) {\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride != null ? idOverride : reactId;\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride);\n}","export default function unsupportedProp(props, propName, componentName, location, propFullName) {\n if (process.env.NODE_ENV === 'production') {\n return null;\n }\n const propFullNameSafe = propFullName || propName;\n if (typeof props[propName] !== 'undefined') {\n return new Error(`The prop \\`${propFullNameSafe}\\` is not supported. Please remove it.`);\n }\n return null;\n}","'use client';\n\n/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nexport default function useControlled({\n controlled,\n default: defaultProp,\n name,\n state = 'value'\n}) {\n // isControlled is ignored in the hook dependency lists as it should never change.\n const {\n current: isControlled\n } = React.useRef(controlled !== undefined);\n const [valueState, setValue] = React.useState(defaultProp);\n const value = isControlled ? controlled : valueState;\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n if (isControlled !== (controlled !== undefined)) {\n console.error([`MUI: A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [state, name, controlled]);\n const {\n current: defaultValue\n } = React.useRef(defaultProp);\n React.useEffect(() => {\n if (!isControlled && !Object.is(defaultValue, defaultProp)) {\n console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\\n'));\n }\n }, [JSON.stringify(defaultProp)]);\n }\n const setValueIfUncontrolled = React.useCallback(newValue => {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}","'use client';\n\nimport * as React from 'react';\nimport useEnhancedEffect from '../useEnhancedEffect';\n\n/**\n * Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892\n * See RFC in https://github.com/reactjs/rfcs/pull/220\n */\n\nfunction useEventCallback(fn) {\n const ref = React.useRef(fn);\n useEnhancedEffect(() => {\n ref.current = fn;\n });\n return React.useRef((...args) =>\n // @ts-expect-error hide `this`\n (0, ref.current)(...args)).current;\n}\nexport default useEventCallback;","'use client';\n\nimport * as React from 'react';\nimport setRef from '../setRef';\nexport default function useForkRef(...refs) {\n /**\n * This will create a new function if the refs passed to this hook change and are all defined.\n * This means react will call the old forkRef with `null` and the new forkRef\n * with the ref. Cleanup naturally emerges from this behavior.\n */\n return React.useMemo(() => {\n if (refs.every(ref => ref == null)) {\n return null;\n }\n return instance => {\n refs.forEach(ref => {\n setRef(ref, instance);\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n}","'use client';\n\nimport * as React from 'react';\nconst UNINITIALIZED = {};\n\n/**\n * A React.useRef() that is initialized lazily with a function. Note that it accepts an optional\n * initialization argument, so the initialization function doesn't need to be an inline closure.\n *\n * @usage\n * const ref = useLazyRef(sortColumns, columns)\n */\nexport default function useLazyRef(init, initArg) {\n const ref = React.useRef(UNINITIALIZED);\n if (ref.current === UNINITIALIZED) {\n ref.current = init(initArg);\n }\n return ref;\n}","'use client';\n\nimport * as React from 'react';\nconst EMPTY = [];\n\n/**\n * A React.useEffect equivalent that runs once, when the component is mounted.\n */\nexport default function useOnMount(fn) {\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(fn, EMPTY);\n /* eslint-enable react-hooks/exhaustive-deps */\n}","'use client';\n\nimport useLazyRef from '../useLazyRef/useLazyRef';\nimport useOnMount from '../useOnMount/useOnMount';\nexport class Timeout {\n constructor() {\n this.currentId = null;\n this.clear = () => {\n if (this.currentId !== null) {\n clearTimeout(this.currentId);\n this.currentId = null;\n }\n };\n this.disposeEffect = () => {\n return this.clear;\n };\n }\n static create() {\n return new Timeout();\n }\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n start(delay, fn) {\n this.clear();\n this.currentId = setTimeout(() => {\n this.currentId = null;\n fn();\n }, delay);\n }\n}\nexport default function useTimeout() {\n const timeout = useLazyRef(Timeout.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}","'use client';\n\n// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js\nimport * as React from 'react';\nimport { Timeout } from '../useTimeout/useTimeout';\nlet hadKeyboardEvent = true;\nlet hadFocusVisibleRecently = false;\nconst hadFocusVisibleRecentlyTimeout = new Timeout();\nconst inputTypesWhitelist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n};\n\n/**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} node\n * @returns {boolean}\n */\nfunction focusTriggersKeyboardModality(node) {\n const {\n type,\n tagName\n } = node;\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {\n return true;\n }\n if (tagName === 'TEXTAREA' && !node.readOnly) {\n return true;\n }\n if (node.isContentEditable) {\n return true;\n }\n return false;\n}\n\n/**\n * Keep track of our keyboard modality state with `hadKeyboardEvent`.\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * @param {KeyboardEvent} event\n */\nfunction handleKeyDown(event) {\n if (event.metaKey || event.altKey || event.ctrlKey) {\n return;\n }\n hadKeyboardEvent = true;\n}\n\n/**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n */\nfunction handlePointerDown() {\n hadKeyboardEvent = false;\n}\nfunction handleVisibilityChange() {\n if (this.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n }\n}\nfunction prepare(doc) {\n doc.addEventListener('keydown', handleKeyDown, true);\n doc.addEventListener('mousedown', handlePointerDown, true);\n doc.addEventListener('pointerdown', handlePointerDown, true);\n doc.addEventListener('touchstart', handlePointerDown, true);\n doc.addEventListener('visibilitychange', handleVisibilityChange, true);\n}\nexport function teardown(doc) {\n doc.removeEventListener('keydown', handleKeyDown, true);\n doc.removeEventListener('mousedown', handlePointerDown, true);\n doc.removeEventListener('pointerdown', handlePointerDown, true);\n doc.removeEventListener('touchstart', handlePointerDown, true);\n doc.removeEventListener('visibilitychange', handleVisibilityChange, true);\n}\nfunction isFocusVisible(event) {\n const {\n target\n } = event;\n try {\n return target.matches(':focus-visible');\n } catch (error) {\n // Browsers not implementing :focus-visible will throw a SyntaxError.\n // We use our own heuristic for those browsers.\n // Rethrow might be better if it's not the expected error but do we really\n // want to crash if focus-visible malfunctioned?\n }\n\n // No need for validFocusTarget check. The user does that by attaching it to\n // focusable events only.\n return hadKeyboardEvent || focusTriggersKeyboardModality(target);\n}\nexport default function useIsFocusVisible() {\n const ref = React.useCallback(node => {\n if (node != null) {\n prepare(node.ownerDocument);\n }\n }, []);\n const isFocusVisibleRef = React.useRef(false);\n\n /**\n * Should be called if a blur event is fired\n */\n function handleBlurVisible() {\n // checking against potential state variable does not suffice if we focus and blur synchronously.\n // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.\n // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.\n // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751\n // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).\n if (isFocusVisibleRef.current) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n hadFocusVisibleRecentlyTimeout.start(100, () => {\n hadFocusVisibleRecently = false;\n });\n isFocusVisibleRef.current = false;\n return true;\n }\n return false;\n }\n\n /**\n * Should be called if a blur event is fired\n */\n function handleFocusVisible(event) {\n if (isFocusVisible(event)) {\n isFocusVisibleRef.current = true;\n return true;\n }\n return false;\n }\n return {\n isFocusVisibleRef,\n onFocus: handleFocusVisible,\n onBlur: handleBlurVisible,\n ref\n };\n}","'use client';\n\nimport { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/utils';\nexport { default as capitalize } from './capitalize';\nexport { default as createChainedFunction } from './createChainedFunction';\nexport { default as createSvgIcon } from './createSvgIcon';\nexport { default as debounce } from './debounce';\nexport { default as deprecatedPropType } from './deprecatedPropType';\nexport { default as isMuiElement } from './isMuiElement';\nexport { default as ownerDocument } from './ownerDocument';\nexport { default as ownerWindow } from './ownerWindow';\nexport { default as requirePropFactory } from './requirePropFactory';\nexport { default as setRef } from './setRef';\nexport { default as unstable_useEnhancedEffect } from './useEnhancedEffect';\nexport { default as unstable_useId } from './useId';\nexport { default as unsupportedProp } from './unsupportedProp';\nexport { default as useControlled } from './useControlled';\nexport { default as useEventCallback } from './useEventCallback';\nexport { default as useForkRef } from './useForkRef';\nexport { default as useIsFocusVisible } from './useIsFocusVisible';\n// TODO: remove this export once ClassNameGenerator is stable\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const unstable_ClassNameGenerator = {\n configure: generator => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(['MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.', '', \"You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead\", '', 'The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401', '', 'The updated documentation: https://mui.com/guides/classname-generator/'].join('\\n'));\n }\n ClassNameGenerator.configure(generator);\n }\n};","\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _utils.createSvgIcon;\n }\n});\nvar _utils = require(\"@mui/material/utils\");","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n}), 'Close');","import {\n Typography as MUITypography,\n TypographyProps,\n styled,\n} from \"@mui/material\";\n\nexport interface ITypography extends TypographyProps {\n type?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"s1\" | \"s2\" | \"s3\" | \"s4\" | \"s5\";\n weight?: \"normal\" | \"medium\" | \"bold\";\n}\n\nconst StyledTypography = styled(MUITypography)<ITypography>(\n ({ theme: { palette }, color }) => ({\n color: color || palette.theme?.primary[800],\n }),\n);\n\nexport function Typography(props: ITypography) {\n const {\n children,\n type = \"h5\",\n weight = \"normal\",\n className,\n ...rest\n } = props;\n\n return (\n <StyledTypography className={`${type} ${weight} ${className}`} {...rest}>\n {children}\n </StyledTypography>\n );\n}\n\nexport default Typography;\n","import React from 'react';\nimport { SnackbarContent, useSnackbar } from 'notistack';\nimport { Avatar, Box, IconButton } from '@mui/material';\nimport CloseIcon from '@mui/icons-material/Close';\nimport { useNavigate } from 'react-router-dom';\nimport { Notification } from '../icons';\nimport Typography from '../typography/typography';\nimport images from '../../assets/images';\nimport \"./custom-snackbar.scss\"\n\ninterface CustomSnackbarProps {\n message: string;\n variant?: 'default' | 'error' | 'success' | 'warning' | 'info';\n linkUrl?: string;\n snackbarKey: string | number;\n}\n\nconst mainModuleIcons = {\n rbac: images.user,\n document: images.document,\n 'accounts-and-finance': images.accounting,\n inventory: images.inventory,\n manufacturing: images.manufacturing,\n sales: images.crm,\n rental: images.rental,\n user: images.user,\n purchase: images.procurement,\n hrms: images.hrms\n}\nconst mainModuleBgColors = {\n rbac: '#F3E5F5',\n document: '#FFF8E1',\n 'accounts-and-finance': '#E8F5E8',\n inventory: '#E3F2FD',\n manufacturing: '#FFF3E0',\n sales: '#F3E5F5',\n rental: '#E8F5E8',\n user: '#F3E5F5',\n purchase: '#FCE4EC',\n hrms: '#fcfcfc'\n}\n\nconst CustomSnackbar = React.forwardRef<HTMLDivElement, CustomSnackbarProps>(\n ({ message, variant = 'default', linkUrl, snackbarKey, data }, ref) => {\n const { closeSnackbar } = useSnackbar();\n const navigate = useNavigate();\n\n const backgroundColorMap: Record<string, string> = {\n success: '#f0fdf4',\n error: '#fef2f2',\n warning: '#fff7ed',\n info: '#eff6ff',\n default: '#fff',\n };\n\n const textColorMap: Record<string, string> = {\n success: '#166534',\n error: '#991b1b',\n warning: '#92400e',\n info: '#1e40af',\n default: '#27272a',\n };\n\n const handleClick = () => {\n if (linkUrl) navigate(linkUrl);\n closeSnackbar(snackbarKey);\n };\n\n const handleCloseClick = (e: React.MouseEvent) => {\n e.stopPropagation(); // Prevent triggering link\n closeSnackbar(snackbarKey);\n };\n\n return (\n <SnackbarContent\n ref={ref}\n style={{\n backgroundColor: backgroundColorMap[variant],\n color: textColorMap[variant],\n }}\n className='SnackBar'\n onClick={handleClick}\n >\n <Box display=\"flex\" alignItems=\"center\" p={2} position=\"relative\" gap={2} width='100%'>\n {mainModuleIcons?.[data.module] ?\n <Avatar sx={{ \n width: 45, \n height: 45, \n fontSize: '0.875rem',\n bgcolor: mainModuleBgColors[data.module] || 'primary.main',\n color: 'white',\n borderRadius: '8px',\n '& img': { \n width: '35px', \n height: '35px', \n objectFit: 'contain'\n }\n }} src={mainModuleIcons?.[data.module]} /> :\n <Notification\n style={{\n color: textColorMap[variant],\n marginTop: 2,\n }}\n />\n }\n <Box display=\"flex\" alignItems=\"center\" width='100%'>\n <Box flex=\"1\">\n <Typography type='h5' color={'inherit'} weight='bold'>\n New Notification\n </Typography>\n <Typography type='s3' mt={0.5} color={'inherit'}>\n {message}\n </Typography>\n </Box>\n\n <IconButton\n size=\"small\"\n onClick={handleCloseClick}\n // style={{\n // position: 'absolute',\n // top: 4,\n // right: 4,\n // color: textColorMap[variant],\n // }}\n >\n <CloseIcon fontSize=\"small\" />\n </IconButton>\n </Box>\n </Box>\n </SnackbarContent>\n );\n }\n);\n\nexport { CustomSnackbar };\nexport default CustomSnackbar;\n","import React, { createContext, useEffect, useRef, useState } from 'react';\nimport {\n\tpostV1AuthChangePassword,\n\tpostV1AuthForgotPassword,\n\tpostV1AuthChangeUserPassword,\n\t// getV1UserId,\n\tpostV1AuthLogin,\n\tpostV1AuthResetPassword,\n\tsetBaseUrl,\n\tpostV1AuthChangeUserPasswordByAdmin\n} from '../api-client/api.rbac/api';\nimport { auth } from '../constants/auth';\nimport { useLocation, matchRoutes, useNavigate } from 'react-router-dom';\nimport { Pathname } from '../constants/pathnames/pathname'; // Removed - should be passed as props or configured by consuming app\nimport { getToken } from '../utils/common';\nimport { enqueueSnackbar } from 'notistack';\nimport { Socket, io } from 'socket.io-client';\nimport { generateRouteWithId } from '../utils/route-utils';\nimport { getApiConfig } from '../utils/api-config';\nimport {\n\tPathnameAccounting,\n\tPathnameGenerator\n} from '../constants/pathnames/pathname.accounting';\n\nimport {\n\tPathnameInventory,\n\tPathnameGenerator as PathnameGeneratorInventory\n} from '../constants/pathnames/pathname.inventory';\n\nimport {\n\tPathnameManufacturing,\n\tPathnameGenerator as PathnameGeneratorManufacuring\n} from '../constants/pathnames/pathname.manufacturing';\n\nimport {\n\tPathnamePurchase,\n\tPathnameGenerator as PathnameGeneratorPurchase\n} from '../constants/pathnames/pathname.procurement';\n\nimport {\n\tPathnameCrm,\n\tPathnameGenerator as PathnameGeneratorCrm\n} from '../constants/pathnames/pathname.crm';\n\nimport {\n\tPathnameRental,\n\tPathnameGenerator as PathnameGeneratorRental\n} from '../constants/pathnames/pathname.rental';\n\nimport { ROUTES as RENTALROUTES } from '../constants/pathnames/pathname.rental';\n\nimport CustomSnackbar from '../components/custom-snackbar/custom-snackbar.tsx';\nimport { RbacApi } from '@/api-client/index.ts';\nexport interface LoginFormValues {\n\temail: string;\n\tpassword: string;\n}\n\nexport interface resetFormValues {\n\temail: string;\n}\n\nexport interface resetPasswordValues {\n\ttoken: string;\n}\n\nexport interface changePasswordValues {\n\tpassword: string;\n}\n\nexport interface changeUserPasswordValues {\n\tpassword: string;\n}\n\ninterface ERPApiUser {\n\tid: string | number;\n\tfirst_name: string;\n\tlast_name: string;\n\tmiddle_name: string;\n\tcountry_code: string;\n\temail: string;\n\tcreated_by: any;\n\tupdated_by: any;\n\tcreated_at: string;\n\tupdated_at: string;\n\trole_id: string;\n\tdepartment_id: number;\n\tis_deleted: number;\n\tdeleted_at: string | null;\n\tdeleted_by: any;\n\ttoken: string;\n\tprofile_image: string;\n\tcompany_id: number | string;\n\tcurrency_data?: {\n\t\tid: number;\n\t\tsymbol: string;\n\t\tcurrency_name: string;\n\t\tnumber_format: string;\n\t\tposition: string | null;\n\t\tfraction_unit: string | null\n\t};\n\taccessCompanies?: any[]\n}\ninterface ERPUser extends Omit<ERPApiUser, 'token'> {\n\tfull_name: string;\n}\n\nexport interface DefaultProviderProps {\n\tuser: ERPUser | null;\n\tloading: boolean;\n\tauthToken: string;\n\tsetUser: React.Dispatch<React.SetStateAction<ERPUser | null>>;\n\tsetLoading: React.Dispatch<React.SetStateAction<boolean>>;\n\tlogin: (\n\t\tparams: LoginFormValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tlogout: () => Promise<void>;\n\tforgotPassword: (\n\t\tparams: resetFormValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tresetPassword: (\n\t\tparams: resetPasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tchangePassword: (\n\t\tparams: changePasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tchangeUserPassword: (\n\t\tparams: changeUserPasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n}\n\nconst defaultProvider: DefaultProviderProps = {\n\tuser: null,\n\tloading: true,\n\tauthToken: '',\n\tsetUser: () => null,\n\tsetLoading: () => Boolean,\n\tlogin: () => Promise.resolve(),\n\tlogout: () => Promise.resolve(),\n\tforgotPassword: () => Promise.resolve(),\n\tresetPassword: () => Promise.resolve(),\n\tchangePassword: () => Promise.resolve(),\n\tchangeUserPassword: () => Promise.resolve()\n};\n\nconst AuthContext = createContext<DefaultProviderProps>(defaultProvider);\n\ninterface AuthProviderProps {\n\tchildren: React.ReactNode;\n\tpublicRoutes?: string[]; // Optional prop to allow customization of public routes\n}\n\n// Base URL will be set at runtime via ERPUIProvider\n\nconst AuthProvider: React.FC<AuthProviderProps> = ({ children, publicRoutes = [] }) => {\n\t// ** States\n\tconst [user, setUser] = useState(defaultProvider.user);\n\tconst [authToken, setAuthToken] = useState<string>('');\n\tconst [loading, setLoading] = useState(defaultProvider.loading);\n\tconst socketRef = useRef<Socket | null>(null);\n\n\t// ** Hooks\n\tconst navigate = useNavigate();\n\tconst location = useLocation();\n\tconst isJsonParse = (string?: string | null) => {\n\t\tif (!string) return false;\n\n\t\ttry {\n\t\t\treturn JSON.parse(string);\n\t\t} catch (error) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tconst getNotificationUrl = (data: any) => {\n\t\tconst { moduleName = '', moduleId = '', notificationData = {} } = data;\n\t\tconst key = moduleName.toLowerCase();\n\n\t\tconst routeMap: Record<string, () => string> = {\n\t\t\t'sales invoice': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_SALES_INVOICES), moduleId.toString()),\n\n\t\t\t'asset transfers': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_ASSET_TRANSFER), moduleId.toString()),\n\n\t\t\t'budgets': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_BUDGET), moduleId.toString()),\n\n\t\t\t'cash expense': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_CASH_EXPENSE), moduleId.toString()),\n\n\t\t\t'credit notes': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_CREDIT_NOTE), moduleId.toString()),\n\n\t\t\t'debit notes': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_DEBIT_NOTE), moduleId.toString()),\n\n\t\t\t'expense reimbursement': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_EXPENSE_REIMBURSEMENT), moduleId.toString()),\n\n\t\t\t'journal entries': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_JOURNAL_ENTRY), moduleId.toString()),\n\n\t\t\t'payment entries': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_PAYMENT_ENTRY), moduleId.toString()),\n\n\t\t\t'purchase invoice': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_PURCHASE_INVOICE), moduleId.toString()),\n\n\t\t\t'stock transfer': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorInventory(PathnameInventory.VIEW_STOCK_TRANSFER), moduleId.toString()),\n\n\t\t\t'bills of materials': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorManufacuring(PathnameManufacturing.VIEW_BILL_OF_MATERIAL), moduleId.toString()),\n\n\t\t\t'purchase agreement': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_AGREEMENT), moduleId.toString()),\n\n\t\t\t'purchase orders': () =>\n\t\t\t\tgenerateRouteWithId(notificationData?.data?.is_rental == 1 ? RENTALROUTES.VIEW : PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_ORDER), moduleId.toString()),\n\n\t\t\t'purchase request': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_ORDER), moduleId.toString()),\n\n\t\t\t'vra': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_VENDOR_RETURNS), moduleId.toString()),\n\n\t\t\t'sl customer returns': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorCrm(PathnameCrm.VIEW_CUSTOMER_RETURNS), moduleId.toString()),\n\n\t\t\t'sales order': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorCrm(PathnameCrm.VIEW_SALES_ORDER), moduleId.toString()),\n\n\t\t\t'rental order': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_RENTAL_ORDER), moduleId.toString()),\n\n\t\t\t'replacement order': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_RENTAL_ORDER), moduleId.toString()),\n\n\t\t\t'rental agreement': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_AGREEMENT), moduleId.toString()),\n\n\t\t\t'cross hire order': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_CROSS_HIRE_ORDER), moduleId.toString()),\n\n\t\t\t'cross hire request': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_CROSS_HIRE_REQUEST), moduleId.toString()),\n\t\t};\n\n\t\treturn routeMap[key]?.() || '/dashboard';\n\t};\n\n\tuseEffect(() => {\n\t\tsetLoading(true);\n\t\t// initAuth()\n\t\tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t\tconst storedUser =\n\t\t\tisJsonParse(window.localStorage.getItem(auth.storageUserKeyName)) ?? null;\n\t\tconst allPublicRoutes = [Pathname.LOGIN, Pathname.FORGOT_PASSWORD, Pathname.RESET_PASSWORD, Pathname.CHANGE_PASSWORD, ...publicRoutes];\n\t\tconst currentPath = window.location.pathname;\n\t\tif (!storedToken && !storedUser) {\n\t\t\tconsole.log('allPublicRoutes..', allPublicRoutes, 'currentPath..', currentPath)\n\t\t\t// if (!allPublicRoutes.includes(currentPath)) {\n\t\t\tif (Boolean(!matchRoutes(allPublicRoutes.map((route) => ({ path: route })), location))) {\n\t\t\t\tnavigate(Pathname.LOGIN);\n\t\t\t}\n\t\t\tsetLoading(false);\n\t\t} else {\n\t\t\tsetUser(storedUser);\n\t\t\tsetAuthToken(storedToken || '');\n\t\t\tsetLoading(false);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!authToken) {\n\t\t\tif (socketRef.current) {\n\t\t\t\tsocketRef.current?.disconnect();\n\t\t\t\tsocketRef.current = null\n\t\t\t}\n\t\t\tconsole.warn(\"No auth token found, not connecting to socket.\");\n\t\t\treturn;\n\t\t}\n\n\t\tconst config = getApiConfig();\n\t\tconst socket = io(config.socketBaseUrl, {\n\t\t\ttransports: [\"websocket\"],\n\t\t\tauth: { token: authToken },\n\t\t\tpath: \"/socket.io/\",\n\n\t\t});\n\t\tsocketRef.current = socket;\n\n\t\tsocket.on(\"connect\", () => {\n\t\t\tconsole.log(\"Socket connected:\", socket.id);\n\t\t\tsocket.onAny((event, ...args) => {\n\t\t\t\tconsole.log(`Received event: ${event}`, args);\n\t\t\t});\n\t\t});\n\n\t\t// socket event handler\n\t\tsocket.on('notification', (data) => {\n\t\t\tconst { message, notificationData } = data || {};\n\t\t\tlet notificationContent: React.ReactNode = message;\n\t\t\tconst url = getNotificationUrl(data);\n\n\t\t\tif (notificationData) {\n\t\t\t\tconst { notification_type } = notificationData;\n\n\t\t\t\tswitch (notification_type) {\n\t\t\t\t\tcase 'addApprovers': {\n\n\t\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'change_approval_status': {\n\t\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tenqueueSnackbar(String(message), {\n\t\t\t\tvariant: 'default',\n\t\t\t\tanchorOrigin: { vertical: 'top', horizontal: 'center' },\n\t\t\t\tautoHideDuration: 5000,\n\t\t\t\tcontent: (key) => (\n\t\t\t\t\t<CustomSnackbar snackbarKey={key} message={notificationContent} data={notificationData} variant=\"default\" linkUrl={url} />\n\t\t\t\t),\n\t\t\t});\n\t\t});\n\n\n\t\tsocket.on(\"sales_invoice_viewed\", (data) => {\n\t\t\tconsole.log(\"Invoice viewed:\", data.invoiceId, \"by user:\", data.userId);\n\t\t});\n\n\t\tsocket.on(\"error\", (errMsg) => {\n\t\t\tenqueueSnackbar(`Socket error: ${errMsg}`, { variant: \"error\" });\n\t\t\tconsole.error(\"Socket error:\", errMsg);\n\t\t});\n\n\t\t// Clean up on unmount\n\t\treturn () => {\n\t\t\tif (socketRef.current) {\n\t\t\t\tsocketRef.current.disconnect();\n\t\t\t\tsocketRef.current = null\n\t\t\t}\n\t\t};\n\t}, [authToken]);\n\n\tconst fetchRolesByUserId = async (userId: number | string, token: string) => {\n\t\tconst response = await RbacApi.getV1RoleUserId({ id: userId, ...getToken(token) } as any);\n\t\tconst perm = response?.data?.role || [];\n\t\treturn JSON.stringify(perm);\n\t}\n\n\tconst handleLogin = async (\n\t\tparams: LoginFormValues,\n\t\tcallback: (err: string) => void,\n\t\tshoudRedirect: boolean = true,\n\t\tredirectPath: string = Pathname.DASHBOARD\n\t) => {\n\t\tsetLoading(true);\n\t\tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t\tif (storedToken && user) {\n\t\t\treturn navigate(Pathname.DASHBOARD);\n\t\t}\n\n\t\ttry {\n\t\t\tconst loginUser = await postV1AuthLogin({ ...params, ...getToken() });\n\t\t\tif (loginUser.success) {\n\t\t\t\tconst data: ERPApiUser | null = loginUser?.data?.login || null;\n\t\t\t\tif (data) {\n\t\t\t\t\tconst userData: ERPUser = {\n\t\t\t\t\t\t...data,\n\t\t\t\t\t\tfull_name: `${data.first_name} ${data.last_name}`\n\t\t\t\t\t};\n\t\t\t\t\tconst rolePermission = await fetchRolesByUserId(userData.id, data.token);\n\t\t\t\t\t\n\t\t\t\t\tglobalThis.localStorage.setItem(auth.storageTokenKeyName, data.token);\n\t\t\t\t\twindow.localStorage.setItem(auth.storageUserKeyName, JSON.stringify(userData));\n\t\t\t\t\twindow.localStorage.setItem(auth.storageRolePermissionKeyName, rolePermission);\n\t\t\t\t\twindow.dispatchEvent(new Event(\"role-permission-changed\"));\n\n\t\t\t\t\tsetUser(userData);\n\t\t\t\t\tsetAuthToken(data.token);\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tshoudRedirect && navigate(redirectPath);\n\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t\tdelete data.token;\n\t\t\t\t\t}, 1000);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t}\n\t\t\tsetLoading(false);\n\t\t\tcallback(message);\n\t\t}\n\t};\n\n\tconst handleLogout = async () => {\n\t\twindow.localStorage.removeItem(auth.storageTokenKeyName);\n\t\twindow.localStorage.removeItem(auth.storageUserKeyName);\n\t\twindow.localStorage.removeItem(auth.storageRolePermissionKeyName);\n\t\twindow.dispatchEvent(new Event(\"role-permission-changed\"));\n\t\tsetUser(null);\n\t\tsetAuthToken('');\n\t\tnavigate(Pathname.LOGIN);\n\t};\n\n\tconst handleForgotPassword = async (params: resetFormValues,\n\t\tcallback: (type: boolean, err: string) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthForgotPassword({ ...params, ...getToken() });\n\t\t\tcallback(true, \"Reset Link sent to your email\");\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t}\n\n\t\t\tcallback(false, message);\n\t\t}\n\t};\n\n\tconst handleResetPassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string) => void) => {\n\t\ttry {\n\t\t\tconst response = await postV1AuthResetPassword({ ...params, ...getToken() });\n\t\t\tcallback(response);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tconsole.log(\"Error \", error)\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst handleChangePassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangePassword({ ...params, ...getToken() });\n\t\t\tcallback(null);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tconsole.log(\"Error \", error)\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message);\n\t\t\t}\n\t\t}\n\t\tcallback(\"reset\");\n\t}\n\n\tconst handleChangeUserPassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string, resType: boolean) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangeUserPassword({ ...params, ...getToken() });\n\t\t\tcallback('Password Changed Successfully', true);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message, false);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst handleChangeUserPasswordByAdmin = async (params: changePasswordValues,\n\t\tcallback: (err: string, resType: boolean) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangeUserPasswordByAdmin({ ...params, ...getToken() });\n\t\t\tcallback('Password Changed Successfully', true);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message, false);\n\t\t\t}\n\t\t}\n\t}\n\n\n\tconst values = {\n\t\tuser,\n\t\tauthToken,\n\t\tloading,\n\t\tsetUser,\n\t\tsetLoading,\n\t\tlogin: handleLogin,\n\t\tlogout: handleLogout,\n\t\tforgotPassword: handleForgotPassword,\n\t\tresetPassword: handleResetPassword,\n\t\tchangePassword: handleChangePassword,\n\t\tchangeUserPassword: handleChangeUserPassword,\n\t\tchangeUserPasswordByAdmin: handleChangeUserPasswordByAdmin\n\t};\n\n\treturn <AuthContext.Provider value={values}>{children}</AuthContext.Provider>;\n};\n\nexport { AuthContext, AuthProvider };\n","import { useContext } from \"react\";\nimport { AuthContext, DefaultProviderProps } from \"../contexts/AuthContext\";\n\nexport const useAuth = (): DefaultProviderProps => useContext(AuthContext);\n"],"names":["require$$0","require$$1","require$$2","MUITypography","jsx","React","jsxs","CloseIcon","PathnameGenerator","PathnameGeneratorInventory","PathnameGeneratorManufacuring","PathnameGeneratorPurchase","_a","RENTALROUTES","PathnameGeneratorCrm","PathnameGeneratorRental","RbacApi.getV1RoleUserId"],"mappings":";;;;;;;;;;;;;;;;AACO,MAAM,6BAA6B,CAAC,WAA2D;AACpG,QAAM,gBAAwC,EAAE,GAAG,OAAA;AAGnD,SAAO,KAAK,aAAa,EAAE,QAAQ,CAAA,QAAO;AAExC,QACE,IAAI,WAAW,OAAO,KACtB,IAAI,WAAW,OAAO,KACtB,IAAI,WAAW,SAAS,KACxB,IAAI,SAAS,QAAQ,KACrB,IAAI,SAAS,QAAQ,KACrB,IAAI,SAAS,UAAU,GACvB;AACA,UAAI,CAAC,cAAc,GAAG,EAAE,SAAS,GAAG,GAAG;AACrC,sBAAc,GAAG,IAAI,GAAG,cAAc,GAAG,CAAC;AAAA,MAC5C;AAAA,IACF;AAAA,EACF,CAAC;AAED,SAAO;AACT;AAGO,MAAM,sBAAsB,CAAC,UAAkB,OAAsD;AAC1G,MAAG,MAAM,OAAO,OAAO,UAAU;AAC/B,WAAO,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AACvC,iBAAW,SAAS,QAAQ,IAAI,GAAG,IAAI,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P,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,oBAAoB;AAAA,IACpB,2BAA2B;AAAA,EAAA;AAG5B,+CAAQ,YAAY,UAAZ,EAAqB,OAAO,QAAS,UAAS;AACvD;AClgBO,MAAM,UAAU,MAA4B,WAAW,WAAW;","x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]}
@@ -1,5 +1,5 @@
1
1
  import { useContext, useMemo } from "react";
2
- import { L as LanguageContext } from "./languageContext-cweJTzn0.esm.js";
2
+ import { L as LanguageContext } from "./languageContext-ffrxXJkr.esm.js";
3
3
  const createFallbackLanguage = () => ({
4
4
  code: "en",
5
5
  label: "English",
@@ -46,4 +46,4 @@ const useLanguage = () => {
46
46
  export {
47
47
  useLanguage as u
48
48
  };
49
- //# sourceMappingURL=useLangauge-BUF4epYu.esm.js.map
49
+ //# sourceMappingURL=useLangauge-CbMaEsdS.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLangauge-BUF4epYu.esm.js","sources":["../../src/hooks/useLangauge.ts"],"sourcesContent":["// hooks/useLanguage.ts\nimport { useContext, useMemo } from \"react\";\nimport LanguageContext, { LanguageContextType } from \"../contexts/languageContext\";\n\n// Fallback language object\nconst createFallbackLanguage = () => ({\n code: 'en',\n label: 'English',\n direction: 'ltr' as const,\n});\n\n// Fallback context value when provider is not available\nconst fallbackContextValue = {\n languages: [createFallbackLanguage()],\n currentLanguage: createFallbackLanguage(),\n isLoading: false,\n error: null,\n isFallbackActive: true,\n changeLanguage: (langCode: string) => {\n console.warn(`useLanguage: changeLanguage called but LanguageProvider is not available. Language code: ${langCode}`);\n },\n fetchLanguages: async () => {\n console.warn('useLanguage: fetchLanguages called but LanguageProvider is not available.');\n },\n direction: 'ltr' as const,\n isRtl: false,\n isLtr: true,\n};\n\nexport const useLanguage = (): LanguageContextType => {\n const context = useContext(LanguageContext);\n \n // If context is undefined, provider is not available - use fallback\n if (context === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n 'useLanguage: LanguageProvider is not available. Using fallback values. ' +\n 'To enable full language functionality, wrap your app with <ERPUIProvider> or <LanguageProvider>.'\n );\n }\n \n return fallbackContextValue;\n }\n \n const computedValues = useMemo(() => {\n const direction = context.currentLanguage?.direction || 'ltr';\n const isRtl = direction === 'rtl';\n const isLtr = direction === 'ltr';\n \n return { direction, isRtl, isLtr };\n }, [context.currentLanguage]);\n \n return {\n ...context,\n ...computedValues,\n };\n};\n// const withLanguage = <P extends object>(\n// Component: React.ComponentType<P>\n// ) => {\n// return (props: P) => {\n// const languageContext = useLanguage();\n// return <Component {...props} languageContext={languageContext} />;\n// };\n// };\n\n"],"names":[],"mappings":";;AAKA,MAAM,yBAAyB,OAAO;AAAA,EACpC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,WAAW;AACb;AAGA,MAAM,uBAAuB;AAAA,EAC3B,WAAW,CAAC,wBAAwB;AAAA,EACpC,iBAAiB,uBAAA;AAAA,EACjB,WAAW;AAAA,EACX,OAAO;AAAA,EACP,kBAAkB;AAAA,EAClB,gBAAgB,CAAC,aAAqB;AACpC,YAAQ,KAAK,4FAA4F,QAAQ,EAAE;AAAA,EACrH;AAAA,EACA,gBAAgB,YAAY;AAC1B,YAAQ,KAAK,2EAA2E;AAAA,EAC1F;AAAA,EACA,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;AACT;AAEO,MAAM,cAAc,MAA2B;AACpD,QAAM,UAAU,WAAW,eAAe;AAG1C,MAAI,YAAY,QAAW;AACzB,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,cAAQ;AAAA,QACN;AAAA,MAAA;AAAA,IAGJ;AAEA,WAAO;AAAA,EACT;AAEA,QAAM,iBAAiB,QAAQ,MAAM;;AACnC,UAAM,cAAY,aAAQ,oBAAR,mBAAyB,cAAa;AACxD,UAAM,QAAQ,cAAc;AAC5B,UAAM,QAAQ,cAAc;AAE5B,WAAO,EAAE,WAAW,OAAO,MAAA;AAAA,EAC7B,GAAG,CAAC,QAAQ,eAAe,CAAC;AAE5B,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,EAAA;AAEP;"}
1
+ {"version":3,"file":"useLangauge-CbMaEsdS.esm.js","sources":["../../src/hooks/useLangauge.ts"],"sourcesContent":["// hooks/useLanguage.ts\nimport { useContext, useMemo } from \"react\";\nimport LanguageContext, { LanguageContextType } from \"../contexts/languageContext\";\n\n// Fallback language object\nconst createFallbackLanguage = () => ({\n code: 'en',\n label: 'English',\n direction: 'ltr' as const,\n});\n\n// Fallback context value when provider is not available\nconst fallbackContextValue = {\n languages: [createFallbackLanguage()],\n currentLanguage: createFallbackLanguage(),\n isLoading: false,\n error: null,\n isFallbackActive: true,\n changeLanguage: (langCode: string) => {\n console.warn(`useLanguage: changeLanguage called but LanguageProvider is not available. Language code: ${langCode}`);\n },\n fetchLanguages: async () => {\n console.warn('useLanguage: fetchLanguages called but LanguageProvider is not available.');\n },\n direction: 'ltr' as const,\n isRtl: false,\n isLtr: true,\n};\n\nexport const useLanguage = (): LanguageContextType => {\n const context = useContext(LanguageContext);\n \n // If context is undefined, provider is not available - use fallback\n if (context === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n 'useLanguage: LanguageProvider is not available. Using fallback values. ' +\n 'To enable full language functionality, wrap your app with <ERPUIProvider> or <LanguageProvider>.'\n );\n }\n \n return fallbackContextValue;\n }\n \n const computedValues = useMemo(() => {\n const direction = context.currentLanguage?.direction || 'ltr';\n const isRtl = direction === 'rtl';\n const isLtr = direction === 'ltr';\n \n return { direction, isRtl, isLtr };\n }, [context.currentLanguage]);\n \n return {\n ...context,\n ...computedValues,\n };\n};\n// const withLanguage = <P extends object>(\n// Component: React.ComponentType<P>\n// ) => {\n// return (props: P) => {\n// const languageContext = useLanguage();\n// return <Component {...props} languageContext={languageContext} />;\n// };\n// };\n\n"],"names":[],"mappings":";;AAKA,MAAM,yBAAyB,OAAO;AAAA,EACpC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,WAAW;AACb;AAGA,MAAM,uBAAuB;AAAA,EAC3B,WAAW,CAAC,wBAAwB;AAAA,EACpC,iBAAiB,uBAAA;AAAA,EACjB,WAAW;AAAA,EACX,OAAO;AAAA,EACP,kBAAkB;AAAA,EAClB,gBAAgB,CAAC,aAAqB;AACpC,YAAQ,KAAK,4FAA4F,QAAQ,EAAE;AAAA,EACrH;AAAA,EACA,gBAAgB,YAAY;AAC1B,YAAQ,KAAK,2EAA2E;AAAA,EAC1F;AAAA,EACA,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;AACT;AAEO,MAAM,cAAc,MAA2B;AACpD,QAAM,UAAU,WAAW,eAAe;AAG1C,MAAI,YAAY,QAAW;AACzB,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,cAAQ;AAAA,QACN;AAAA,MAAA;AAAA,IAGJ;AAEA,WAAO;AAAA,EACT;AAEA,QAAM,iBAAiB,QAAQ,MAAM;;AACnC,UAAM,cAAY,aAAQ,oBAAR,mBAAyB,cAAa;AACxD,UAAM,QAAQ,cAAc;AAC5B,UAAM,QAAQ,cAAc;AAE5B,WAAO,EAAE,WAAW,OAAO,MAAA;AAAA,EAC7B,GAAG,CAAC,QAAQ,eAAe,CAAC;AAE5B,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,EAAA;AAEP;"}
@@ -1,18 +1,18 @@
1
- import { A, a, a as a2, b, d, C, f, f as f2, g, i, p, R, S, T, s, t } from "../chunks/appbar-DtROOKgm.esm.js";
2
- import { A as A2, a as a3, d as d2, e, f as f3, g as g2, g as g3, B, C as C2, i as i2, j, k, D, n, o, p as p2, q, r, s as s2, t as t2, u, v, w, x, y, z, E, F, G, H, I, J, K, M, b as b2, c, l, L, _, a4, a5, ap, N, O, P, Q, R as R2, S as S2, U, V, W, W as W2, X, Y, Z, Z as Z2, $, a0, a1, m, a2 as a22, a3 as a32, a6, a7, a8, a9, a9 as a92, aa, ab, ac, af, af as af2, aj, ak, al, am, an, ao, aq, ar, aw } from "../chunks/android-12-switch-eTZOAHAa.esm.js";
3
- import { A as A3, a as a10, b as b3, B as B2, u as u2, c as c2, d as d3, e as e2, f as f4, g as g4, h, i as i3, i as i4, C as C3, j as j2, j as j3, k as k2, l as l2, m as m2, n as n2, o as o2, p as p3, N as N2, q as q2, r as r2, D as D2, s as s3, D as D3, s as s4, t as t3, v as v2, w as w2, x as x2, y as y2, z as z2, E as E2, F as F2, G as G2, H as H2, I as I2, J as J2, K as K2, L as L2, L as L3, O as O2, P as P2, Q as Q2, R as R3, S as S3, T as T2, U as U2, V as V2, W as W3, X as X2, Y as Y2, Z as Z3, Z as Z4, _ as _2, $ as $2, a0 as a02, a1 as a12, $ as $3, a2 as a23, a3 as a33, a4 as a42, a5 as a52, a6 as a62, a7 as a72, V as V3, M as M2, a8 as a82, a9 as a93, aa as aa2, ab as ab2, ab as ab3, ac as ac2, ad, ae, af as af3, ag, ah, ai, aj as aj2, ak as ak2, L as L4, al as al2, am as am2 } from "../chunks/uom-field-wrapper-DKN31prP.esm.js";
4
- import { C as C4, D as D4, M as M3, V as V4 } from "../chunks/form-builder-deconversion-CFtHF1hm.esm.js";
5
- import { C as C5, T as T3 } from "../chunks/useAuth-BaUSGWbL.esm.js";
6
- import { CustomEditor, CustomEditor as CustomEditor2 } from "../chunks/custom-editor-B-mleFzm.esm.js";
7
- import { S as S4 } from "../chunks/sidebar-CdhW0PKj.esm.js";
1
+ import { A, a, a as a2, b, d, C, f, f as f2, g, i, p, R, S, T, s, t } from "../chunks/appbar-5rP5iXcS.esm.js";
2
+ import { A as A2, a as a3, d as d2, e, f as f3, g as g2, g as g3, B, C as C2, i as i2, j, k, D, n, o, p as p2, q, r, s as s2, t as t2, u, v, w, x, y, z, E, F, G, H, I, J, K, M, b as b2, c, l, L, _, a5, a6, aq, N, O, P, Q, R as R2, S as S2, U, V, W, W as W2, X, Y, Z, Z as Z2, $, a0, a1, m, a2 as a22, a3 as a32, a4, a7, a8, a9, aa, aa as aa2, ab, ac, ad, ag, ag as ag2, ak, al, am, an, ao, ap, ar, as, at, ay } from "../chunks/android-12-switch-DpJE56Wi.esm.js";
3
+ import { A as A3, a as a10, b as b3, B as B2, u as u2, c as c2, d as d3, e as e2, f as f4, g as g4, h, i as i3, i as i4, C as C3, j as j2, j as j3, k as k2, l as l2, m as m2, n as n2, o as o2, p as p3, N as N2, q as q2, r as r2, D as D2, s as s3, D as D3, s as s4, t as t3, v as v2, w as w2, x as x2, y as y2, z as z2, E as E2, F as F2, G as G2, H as H2, I as I2, J as J2, K as K2, L as L2, L as L3, O as O2, P as P2, Q as Q2, R as R3, S as S3, T as T2, U as U2, V as V2, W as W3, X as X2, Y as Y2, Z as Z3, Z as Z4, _ as _2, $ as $2, a0 as a02, a1 as a12, $ as $3, a2 as a23, a3 as a33, a4 as a42, a5 as a52, a6 as a62, V as V3, M as M2, a7 as a72, a8 as a82, a9 as a92, aa as aa3, aa as aa4, ab as ab2, ac as ac2, ad as ad2, ae, af, ag as ag3, ah, ai, L as L4, aj, ak as ak2 } from "../chunks/uom-field-wrapper-CgYTONsG.esm.js";
4
+ import { C as C4, D as D4, M as M3, V as V4 } from "../chunks/form-builder-deconversion-DNGMsAEj.esm.js";
5
+ import { C as C5, T as T3 } from "../chunks/useAuth-DhzbULWV.esm.js";
6
+ import { CustomEditor, CustomEditor as CustomEditor2 } from "../chunks/custom-editor-UhZu0Svw.esm.js";
7
+ import { S as S4 } from "../chunks/sidebar-n5_ky6G7.esm.js";
8
8
  import { A as A4, a as a11, b as b4, c as c3, d as d4, e as e3, f as f5, g as g5, B as B3, C as C6, h as h2, i as i5, j as j4, k as k3, l as l3, m as m3, n as n3, D as D5, E as E3, I as I3, L as L5, o as o3, p as p4, O as O3, q as q3, P as P3, r as r3, s as s5, t as t4, R as R4, u as u3, v as v3, w as w3, x as x3, y as y3, S as S5, z as z3, F as F3, G as G3, H as H3, J as J3, T as T4, K as K3, M as M4, W as W4, N as N3 } from "../chunks/arrow-up-Dmnh_633.esm.js";
9
9
  import { A as A5, a as a13, b as b5, c as c4, B as B4, d as d5, e as e4, f as f6, g as g6, D as D6, h as h3, E as E4, i as i6, j as j5, F as F4, l as l4, m as m4, G as G4, H as H4, I as I4, n as n4, o as o4, L as L6, p as p5, q as q4, M as M5, P as P4, r as r4, s as s6, R as R5, t as t5, S as S6, T as T5 } from "../chunks/trash-DDBuxxtn.esm.js";
10
10
  import { N as N4, S as S7 } from "../chunks/notification-DCKWI861.esm.js";
11
11
  import { D as D7 } from "../chunks/dashboard-7SLflMg4.esm.js";
12
12
  import { D as D8 } from "../chunks/document-DvJ4lKkH.esm.js";
13
13
  import { E as E5, a as a14, S as S8, b as b6, T as T6 } from "../chunks/tick-DGRjM86F.esm.js";
14
- import { E as E6, b as b7 } from "../chunks/ERPUIProvider-CLg_Yo12.esm.js";
15
- import { E as E7 } from "../chunks/page-context-BbQNncGA.esm.js";
14
+ import { E as E6, b as b7 } from "../chunks/ERPUIProvider-CIzXMsuV.esm.js";
15
+ import { E as E7 } from "../chunks/page-context-BlGcwtdZ.esm.js";
16
16
  export {
17
17
  A3 as AISummaryPanel,
18
18
  A2 as Accordion,
@@ -147,9 +147,9 @@ export {
147
147
  L as FilterFieldSelect,
148
148
  _ as FilterOperatorSelect,
149
149
  l4 as FilterRemove,
150
- a4 as FilterRemoveAction,
151
- a5 as FilterRemoveGroupAction,
152
- ap as FilterValueEditor,
150
+ a5 as FilterRemoveAction,
151
+ a6 as FilterRemoveGroupAction,
152
+ aq as FilterValueEditor,
153
153
  m4 as FolderSave,
154
154
  N as Footer,
155
155
  I2 as FormData,
@@ -220,9 +220,9 @@ export {
220
220
  r3 as Printer,
221
221
  s5 as ProcessCalendar,
222
222
  t4 as Promotion,
223
- a33 as ProtectedRoute,
224
- a42 as QuickApprovalModal,
225
- a32 as Radio,
223
+ a32 as ProtectedRoute,
224
+ a33 as QuickApprovalModal,
225
+ a4 as Radio,
226
226
  R5 as RadioButton,
227
227
  R4 as Receipt,
228
228
  u3 as ReceiptFilled,
@@ -231,72 +231,72 @@ export {
231
231
  w3 as RectangleFilledIcon,
232
232
  x3 as Refresh,
233
233
  y3 as Replace,
234
- a52 as ReportButtons,
235
- a62 as ReportTable,
236
- a72 as ReportsTitleBar,
234
+ a42 as ReportButtons,
235
+ a52 as ReportTable,
236
+ a62 as ReportsTitleBar,
237
237
  R as ResetPasswordModal,
238
238
  V3 as RfqResponse,
239
239
  S6 as Save,
240
- a6 as SaveFilterModal,
240
+ a7 as SaveFilterModal,
241
241
  M2 as ScheduleReport,
242
- a82 as ScheduleReportModal,
242
+ a72 as ScheduleReportModal,
243
243
  S8 as Search,
244
244
  S as SearchBar,
245
245
  b6 as SearchStatus,
246
- a7 as SearchableSelect,
247
- a8 as Select,
246
+ a8 as SearchableSelect,
247
+ a9 as Select,
248
248
  S5 as SettingsFallback,
249
249
  z3 as SettingsFallbackIcon,
250
250
  F3 as Share,
251
- a9 as ShareModal,
252
- a92 as SharePopUp,
253
- aa as SharedPageModal,
254
- ab as SharedPageView,
251
+ aa as ShareModal,
252
+ aa2 as SharePopUp,
253
+ ab as SharedPageModal,
254
+ ac as SharedPageView,
255
255
  S4 as Sidebar,
256
- a93 as Snackbar,
256
+ a82 as Snackbar,
257
257
  G3 as SortActionArrow,
258
- ac as SourceTypeAddModal,
258
+ ad as SourceTypeAddModal,
259
259
  H3 as StackedLayer,
260
260
  J3 as StartFilled,
261
261
  S7 as Styled,
262
- aa2 as SubHeaderDoc,
263
- af as TabBar,
264
- ab2 as TabBarUI,
265
- ab3 as TabBarUi,
266
- af2 as Tabs,
267
- ac2 as TextArea,
262
+ a92 as SubHeaderDoc,
263
+ ag as TabBar,
264
+ aa3 as TabBarUI,
265
+ aa4 as TabBarUi,
266
+ ag2 as Tabs,
267
+ ab2 as TextArea,
268
268
  T as TextField,
269
269
  T4 as ThreeDotIcon,
270
270
  T6 as Tick,
271
271
  K3 as TickCircle,
272
272
  M4 as TickCircleFilled,
273
- aj as TimePicker,
274
- ad as TimeRangePicker,
275
- ak as TitleDropdownButton,
273
+ ak as TimePicker,
274
+ ac2 as TimeRangePicker,
275
+ al as TitleDropdownButton,
276
276
  s as Toast,
277
- al as Toggle,
278
- am as ToggleSwitch,
277
+ am as Toggle,
278
+ an as ToggleSwitch,
279
279
  t as Tooltip,
280
280
  T5 as Trash,
281
281
  T3 as Typography,
282
- ae as UomFieldWrapper,
283
- af3 as Upload,
284
- an as UploadExcel,
285
- ao as UploadMedia,
286
- ag as UserDropdown,
282
+ ad2 as UomFieldWrapper,
283
+ ae as Upload,
284
+ ao as UploadExcel,
285
+ ap as UploadMedia,
286
+ af as UserDropdown,
287
287
  V4 as ValueField,
288
- aq as ViewModal,
288
+ ar as ViewModal,
289
289
  W4 as Wave,
290
290
  N3 as WorkCentre,
291
- ah as calculateOptimalSizes,
292
- ar as createApiThunk,
293
- ai as createPermissionConfig,
294
- aj2 as dynamicFields,
295
- aw as dynamicSelectAdd,
296
- ak2 as fields,
291
+ ag3 as calculateOptimalSizes,
292
+ as as createApiThunk,
293
+ at as createPermissionConfig,
294
+ ah as dynamicFields,
295
+ ay as dynamicSelectAdd,
296
+ ai as fields,
297
297
  L4 as ganttData,
298
- al2 as useDynamicLayout,
298
+ aj as useDynamicLayout,
299
299
  b7 as useERPUI,
300
- am2 as validator
300
+ ak2 as validator
301
301
  };
302
302
  //# sourceMappingURL=index.esm.js.map
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const appbar = require("../chunks/appbar-DB5SgIHS.js");
4
- const android12Switch = require("../chunks/android-12-switch-DM9s0XTb.js");
5
- const uomFieldWrapper = require("../chunks/uom-field-wrapper-NNhtGgqI.js");
4
+ const android12Switch = require("../chunks/android-12-switch-BILQvv4G.js");
5
+ const uomFieldWrapper = require("../chunks/uom-field-wrapper-DoyshtE9.js");
6
6
  const formBuilderDeconversion = require("../chunks/form-builder-deconversion-DsRVTy3F.js");
7
7
  const useAuth = require("../chunks/useAuth-L64u9PZT.js");
8
8
  const customEditor = require("../chunks/custom-editor-DaMT56F3.js");
@@ -92,6 +92,7 @@ exports.PageNavigator = android12Switch.PageNavigator;
92
92
  exports.Pagination = android12Switch.Pagination;
93
93
  exports.PartiesModal = android12Switch.CustomerVendorModal;
94
94
  exports.PhoneInput = android12Switch.PhoneInput;
95
+ exports.ProtectedRoute = android12Switch.ProtectedRoute;
95
96
  exports.Radio = android12Switch.Radio;
96
97
  exports.SaveFilterModal = android12Switch.SaveFilterModal;
97
98
  exports.SearchableSelect = android12Switch.SearchableSelect;
@@ -111,6 +112,7 @@ exports.UploadExcel = android12Switch.UploadExcel;
111
112
  exports.UploadMedia = android12Switch.UploadMedia;
112
113
  exports.ViewModal = android12Switch.ViewModal;
113
114
  exports.createApiThunk = android12Switch.createApiThunk;
115
+ exports.createPermissionConfig = android12Switch.createPermissionConfig;
114
116
  exports.dynamicSelectAdd = android12Switch.dynamicSelectAdd;
115
117
  exports.AISummaryPanel = uomFieldWrapper.AISummaryPanel;
116
118
  exports.ActivityLog = uomFieldWrapper.ActivityTag;
@@ -175,7 +177,6 @@ exports.MultiLineChart = uomFieldWrapper.MultiLineChart;
175
177
  exports.MultiSelect = uomFieldWrapper.MultiSelect;
176
178
  exports.Multiline = uomFieldWrapper.MultiLine;
177
179
  exports.PageLoader = uomFieldWrapper.PageLoader;
178
- exports.ProtectedRoute = uomFieldWrapper.ProtectedRoute;
179
180
  exports.QuickApprovalModal = uomFieldWrapper.QuickApprovalModal;
180
181
  exports.ReportButtons = uomFieldWrapper.ReportButtons;
181
182
  exports.ReportTable = uomFieldWrapper.ReportTable;
@@ -193,7 +194,6 @@ exports.UomFieldWrapper = uomFieldWrapper.UomFieldWrapper;
193
194
  exports.Upload = uomFieldWrapper.Upload;
194
195
  exports.UserDropdown = uomFieldWrapper.UserDropdown;
195
196
  exports.calculateOptimalSizes = uomFieldWrapper.calculateOptimalSizes;
196
- exports.createPermissionConfig = uomFieldWrapper.createPermissionConfig;
197
197
  exports.dynamicFields = uomFieldWrapper.dynamicFields;
198
198
  exports.fields = uomFieldWrapper.fields;
199
199
  exports.ganttData = uomFieldWrapper.GanttChart;
@@ -1,6 +1,6 @@
1
- import { A, a } from "../chunks/useAuth-BaUSGWbL.esm.js";
2
- import { L, a as a2 } from "../chunks/languageContext-cweJTzn0.esm.js";
3
- import { P, a as a3, b, c, d, i } from "../chunks/page-context-BbQNncGA.esm.js";
1
+ import { A, a } from "../chunks/useAuth-DhzbULWV.esm.js";
2
+ import { L, a as a2 } from "../chunks/languageContext-ffrxXJkr.esm.js";
3
+ import { P, a as a3, b, c, d, i } from "../chunks/page-context-BlGcwtdZ.esm.js";
4
4
  export {
5
5
  A as AuthContext,
6
6
  a as AuthProvider,
@@ -1,8 +1,8 @@
1
- import { a, c, b, d, f, e, g, h, i, r, j, s, u, k, l, m, n, o, p, v, q } from "../chunks/useAdditionalDiscountAutoCalc-DbyTG80U.esm.js";
2
- import { i as i2, u as u2, a as a2, b as b2, c as c2, d as d2, e as e2, f as f2, g as g2 } from "../chunks/useAccountSetting-CAUDy8rg.esm.js";
3
- import { a as a3, u as u3, c as c3, d as d3 } from "../chunks/ERPUIProvider-CLg_Yo12.esm.js";
4
- import { j as j2 } from "../chunks/useAuth-BaUSGWbL.esm.js";
5
- import { u as u4 } from "../chunks/useLangauge-BUF4epYu.esm.js";
1
+ import { a, c, b, d, f, e, g, h, i, r, j, s, u, k, l, m, n, o, p, v, q } from "../chunks/useAdditionalDiscountAutoCalc-PhSfzd5X.esm.js";
2
+ import { i as i2, u as u2, a as a2, b as b2, c as c2, d as d2, e as e2, f as f2, g as g2 } from "../chunks/useAccountSetting-D1Ze8r-T.esm.js";
3
+ import { a as a3, u as u3, c as c3, d as d3 } from "../chunks/ERPUIProvider-CIzXMsuV.esm.js";
4
+ import { j as j2 } from "../chunks/useAuth-DhzbULWV.esm.js";
5
+ import { u as u4 } from "../chunks/useLangauge-CbMaEsdS.esm.js";
6
6
  import { useTranslation } from "react-i18next";
7
7
  export {
8
8
  a3 as apiHelper,