@erpsquad/common 1.10.8-test → 1.10.9-test
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.
- package/dist/chunks/{ai-summary-D9QajB4_.js → ai-summary-4NVNEHfi.js} +2 -2
- package/dist/chunks/{ai-summary-D9QajB4_.js.map → ai-summary-4NVNEHfi.js.map} +1 -1
- package/dist/chunks/{ai-summary-FqAUpafL.esm.js → ai-summary-f8clWLbW.esm.js} +65 -44
- package/dist/chunks/{ai-summary-FqAUpafL.esm.js.map → ai-summary-f8clWLbW.esm.js.map} +1 -1
- package/dist/chunks/{android-12-switch-BVabRCje.esm.js → android-12-switch-BUbQYnRQ.esm.js} +53 -35
- package/dist/chunks/{android-12-switch-BVabRCje.esm.js.map → android-12-switch-BUbQYnRQ.esm.js.map} +1 -1
- package/dist/chunks/android-12-switch-CphTHRb8.js +2 -0
- package/dist/chunks/{android-12-switch-DMaoWQwq.js.map → android-12-switch-CphTHRb8.js.map} +1 -1
- package/dist/chunks/{appbar-6Ucw59ku.js → appbar-C6Es9HGk.js} +2 -2
- package/dist/chunks/{appbar-6Ucw59ku.js.map → appbar-C6Es9HGk.js.map} +1 -1
- package/dist/chunks/{appbar-mDf1LZ0u.esm.js → appbar-CKrHdx9n.esm.js} +2 -2
- package/dist/chunks/{appbar-mDf1LZ0u.esm.js.map → appbar-CKrHdx9n.esm.js.map} +1 -1
- package/dist/chunks/{default-data-CwLgBvlI.esm.js → default-data-BsZWgQGR.esm.js} +3 -3
- package/dist/chunks/{default-data-CwLgBvlI.esm.js.map → default-data-BsZWgQGR.esm.js.map} +1 -1
- package/dist/chunks/{default-data-D2cqOmp4.js → default-data-Dsjlvwev.js} +2 -2
- package/dist/chunks/{default-data-D2cqOmp4.js.map → default-data-Dsjlvwev.js.map} +1 -1
- package/dist/chunks/{fullScreen-VlXxoepU.js → fullScreen-BBpaDn-A.js} +2 -2
- package/dist/chunks/{fullScreen-VlXxoepU.js.map → fullScreen-BBpaDn-A.js.map} +1 -1
- package/dist/chunks/{fullScreen-B9d2_kak.esm.js → fullScreen-Dn-3Tkwm.esm.js} +2 -2
- package/dist/chunks/{fullScreen-B9d2_kak.esm.js.map → fullScreen-Dn-3Tkwm.esm.js.map} +1 -1
- package/dist/chunks/index-B9CFxEZ9.js +2 -0
- package/dist/chunks/index-B9CFxEZ9.js.map +1 -0
- package/dist/chunks/{index-iPYNYnNP.esm.js → index-wf5q5BST.esm.js} +73 -66
- package/dist/chunks/{index-iPYNYnNP.esm.js.map → index-wf5q5BST.esm.js.map} +1 -1
- package/dist/chunks/{migration-utils-TYitNMC7.js → migration-utils-9IXhe_fj.js} +2 -2
- package/dist/chunks/{migration-utils-TYitNMC7.js.map → migration-utils-9IXhe_fj.js.map} +1 -1
- package/dist/chunks/{migration-utils-BRjncD-b.esm.js → migration-utils-DGoEzQUj.esm.js} +2 -2
- package/dist/chunks/{migration-utils-BRjncD-b.esm.js.map → migration-utils-DGoEzQUj.esm.js.map} +1 -1
- package/dist/chunks/{sidebar-DJREtRnK.js → sidebar-B3SExDRU.js} +2 -2
- package/dist/chunks/{sidebar-DJREtRnK.js.map → sidebar-B3SExDRU.js.map} +1 -1
- package/dist/chunks/{sidebar-D_3INLNa.esm.js → sidebar-n9Y25HU-.esm.js} +2 -2
- package/dist/chunks/{sidebar-D_3INLNa.esm.js.map → sidebar-n9Y25HU-.esm.js.map} +1 -1
- package/dist/chunks/{sidebarScreen-CUf5Onkp.js → sidebarScreen-Dxb_e58p.js} +2 -2
- package/dist/chunks/{sidebarScreen-CUf5Onkp.js.map → sidebarScreen-Dxb_e58p.js.map} +1 -1
- package/dist/chunks/{sidebarScreen-CLjYZOzQ.esm.js → sidebarScreen-_Zt2pSOx.esm.js} +3 -3
- package/dist/chunks/{sidebarScreen-CLjYZOzQ.esm.js.map → sidebarScreen-_Zt2pSOx.esm.js.map} +1 -1
- package/dist/components/index.esm.js +121 -103
- package/dist/components/index.js +1 -1
- package/dist/index.esm.js +218 -200
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/layout/index.esm.js +2 -2
- package/dist/layout/index.js +1 -1
- package/dist/src/components/index.d.ts +18 -1
- package/dist/utils/index.esm.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/views/index.esm.js +5 -5
- package/dist/views/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/android-12-switch-DMaoWQwq.js +0 -2
- package/dist/chunks/index-BQ2NBHDS.js +0 -2
- package/dist/chunks/index-BQ2NBHDS.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appbar-6Ucw59ku.js","sources":["../../src/components/button/button.tsx","../../src/components/modal/modal.tsx","../../src/components/select/select-search.tsx","../../src/components/select/select.tsx","../../src/components/search-bar/search-bar.tsx","../../src/components/text-field/text-field.tsx","../../src/components/form-control/form-builder/form-builder-element/text.tsx","../../node_modules/@hookform/resolvers/yup/dist/yup.mjs","../../src/components/tooltip/Tooltip.tsx","../../src/components/confirm-modal/confirm-modal.tsx","../../src/components/toast/toast.tsx","../../src/components/avatar/avatar.tsx","../../src/components/reset-password-modal/reset-password-modal.tsx","../../src/components/header/components/notification-menu/notification-menu.tsx","../../src/components/header/header.tsx","../../src/components/appbar/appbar.tsx","../../src/components/activityArea/activityArea.tsx"],"sourcesContent":["import { Button as MUIButton, ButtonProps, styled } from '@mui/material';\r\n\r\nconst StyledButton = styled(MUIButton)(\r\n\t({ theme: { palette, } /* , variant */ }) => ({\r\n\t\tfontSize: '.875rem',\r\n\t\ttextTransform: 'none',\r\n\t\tminHeight: '0rem',\r\n\t\tminWidth: '0rem',\r\n\t\tpadding: '0.25rem .75rem',\r\n\t\tfontWeight: '500',\r\n\t\tlineHeight: '1.25rem',\r\n\t\tletterSpacing: '-0.01875rem',\r\n\r\n\t\t'&.MuiButton-startIcon': {\r\n\t\t\tbackgroundColor: 'red'\r\n\t\t},\r\n\r\n\t\t'&.MuiButton-contained': {\r\n\t\t\tbackgroundColor: palette.theme?.primary[700],\r\n\t\t\t// boxShadow: '0px 0px 2px 0px #E0E0E0, 0px 1px 4px -2px rgba(24, 39, 75, 0.02), 0px 4px 4px -2px rgba(24, 39, 75, 0.06)',\r\n\t\t\t'&:hover': {\r\n\t\t\t\tbackgroundColor: palette.theme?.primary[800]\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t'&.MuiButton-outlined': {\r\n\t\t\tborder: 'none',\r\n\t\t\tboxShadow: '0px 0px 2px 0px #E0E0E0, 0px 1px 4px -2px rgba(24, 39, 75, 0.02), 0px 4px 4px -2px rgba(24, 39, 75, 0.06)',\r\n\t\t\tcolor: palette.theme?.primary[700]\r\n\t\t},\r\n\r\n\t\t'&.MuiButton-text': {\r\n\t\t\tcolor: palette.theme?.secondary[1000],\r\n\t\t\tbackgroundColor: 'white',\r\n\t\t\t'&:hover': {\r\n\t\t\t\tcolor: palette.theme?.primary[700]\r\n\t\t\t},\r\n\t\t\t'& .MuiButton-startIcon': {\r\n\t\t\t\t// background: palette.theme?.primary[400],\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t'&.MuiButton-containedError': {\r\n\t\t\tbackgroundColor: palette.theme?.error[500],\r\n\t\t\t'&:hover': {\r\n\t\t\t\tbackgroundColor: palette.theme?.error[600]\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t'&.Mui-disabled': {\r\n\t\t\topacity: 0.5\r\n\t\t}\r\n\t})\r\n);\r\n\r\nconst Button = (props: ButtonProps) => {\r\n\tconst { children, variant = 'contained', ...rest } = props;\r\n\r\n\treturn (\r\n\t\t<StyledButton variant={variant} {...rest}>\r\n\t\t\t{children}\r\n\t\t</StyledButton>\r\n\t);\r\n};\r\n\r\nexport { Button };\r\nexport default Button;\r\n","import { Dialog, DialogProps, styled } from \"@mui/material\";\r\n\r\nconst StyledDialog = styled(Dialog)(() => ({\r\n \".MuiDialog-paper\": {\r\n borderRadius: \"1rem\",\r\n },\r\n\r\n \".MuiDialogTitle-root\": {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"space-between\",\r\n padding: \"0.5rem 1.5rem\",\r\n },\r\n\r\n \".MuiDialogContent-root\": {\r\n padding: \"1.5rem\",\r\n },\r\n\r\n \".MuiDialogActions-root\": {\r\n padding: \"0.5rem 1rem\",\r\n },\r\n}));\r\n\r\nconst Modal = ({ children, open, onClose, ...rest }: DialogProps) => {\r\n return (\r\n <StyledDialog open={open} onClose={onClose} {...rest}>\r\n {children}\r\n </StyledDialog>\r\n );\r\n};\r\n\r\nexport { Modal };\r\nexport default Modal;\r\n","/* eslint-disable @typescript-eslint/no-unused-vars */\r\n/* eslint-disable unused-imports/no-unused-imports */\r\nimport { InputAdornment, TextField, styled } from \"@mui/material\";\r\nimport SearchIcon from \"@mui/icons-material/Search\";\r\nimport React, { forwardRef } from 'react';\r\n\r\nconst StyledSearch = styled(TextField)(({ theme: { palette } }) => ({\r\n padding: \"0rem 0.75rem 0.5rem 0.75rem\",\r\n borderBottom: `1px solid ${palette.theme?.secondary[200]}`,\r\n input: {\r\n padding: \"0.5rem 0rem\",\r\n },\r\n \".MuiOutlinedInput-notchedOutline\": {\r\n border: 0,\r\n },\r\n \"& .MuiOutlinedInput-root\": {\r\n fontSize: \"0.8125rem\",\r\n paddingLeft: \"0.5rem\",\r\n color: palette.theme?.secondary[800],\r\n // backgroundColor: palette.theme?.secondary[200],\r\n border: \"1px solid #F5F6F5\",\r\n borderRadius: \"0.5rem\",\r\n \":hover .MuiOutlinedInput-notchedOutline\": {\r\n border: 1,\r\n },\r\n \"&.Mui-focused fieldset\": {\r\n border: 0,\r\n },\r\n },\r\n}));\r\n\r\nconst SelectSearch = forwardRef<HTMLInputElement, any>(\r\n ({ searchPlaceholder, handleSearch, value, ...rest }, ref) => (\r\n <StyledSearch\r\n inputRef={ref} // Attach the ref here for focusing\r\n placeholder={searchPlaceholder}\r\n onChange={handleSearch}\r\n value={value}\r\n fullWidth\r\n variant=\"outlined\"\r\n InputProps={{\r\n startAdornment: (\r\n <InputAdornment position=\"start\">\r\n <SearchIcon fontSize=\"small\" />\r\n </InputAdornment>\r\n ),\r\n }}\r\n {...rest}\r\n />\r\n )\r\n);\r\n\r\nexport { SelectSearch };\r\nexport default SelectSearch;\r\n","/* eslint-disable no-mixed-spaces-and-tabs */\r\n\r\nimport {\r\n Box,\r\n\tCircularProgress,\r\n\tFormHelperText,\r\n\tSelect as MUISelect,\r\n\tstyled\r\n} from '@mui/material';\r\nimport Typography from '../typography/typography';\r\nimport SelectSearch from './select-search';\r\nimport { memo, useRef } from 'react';\r\nimport './controller/controller-select.scss'\r\nimport { ArrowDown } from '../icons';\r\nconst StyledSelect = styled(MUISelect)(({ theme: { palette } }) => ({\r\n\tcolor: palette.theme?.secondary[800],\r\n\tfontSize: ' 0.875rem',\r\n\t'.MuiOutlinedInput-notchedOutline': {\r\n\t\tborderColor: palette.theme?.secondary[300]\r\n\t},\r\n\t'&.Mui-focused .MuiOutlinedInput-notchedOutline': {\r\n\t\tborderWidth: '0.0625rem',\r\n\t\tborderColor: palette.theme?.primary[700]\r\n\t},\r\n\t'&.Mui-focused.Mui-error .MuiOutlinedInput-notchedOutline': {\r\n\t\tborderWidth: '0.0625rem',\r\n\t\tborderColor: palette.theme?.error[600]\r\n\t},\r\n\t'&:hover .MuiOutlinedInput-notchedOutline': {\r\n\t\tborderColor: palette.theme?.secondary[400]\r\n\t},\r\n\t'&.Mui-error:hover .MuiOutlinedInput-notchedOutline': {\r\n\t\tborderColor: palette.theme?.error[600]\r\n\t},\r\n\t'&.Mui-disabled': {\r\n\t\tbackground: palette.theme?.secondary[200],\r\n\t\tcolor: palette.theme?.secondary[800]\r\n\t},\r\n\r\n\t'.MuiMenuItem-root': {\r\n\t\tfontSize: '10px'\r\n\t},\r\n\t'&.Mui-error': {\r\n\t\tcolor: palette.theme?.error[600],\r\n\t\t'&fieldset': {\r\n\t\t\tborderColor: 'grey'\r\n\t\t}\r\n\t}\r\n}));\r\n\r\nconst Select = memo((props: any) => {\r\n\tconst searchInputRef = useRef<HTMLInputElement>(null);\r\n\tconst {\r\n\t\tchildren,\r\n\t\tlabel,\r\n\t\thandleSearch,\r\n\t\tdataPosition,\r\n\t\tdataName,\r\n\t\tplaceholder,\r\n\t\tsearchPlaceholder,\r\n\t\trequired,\r\n\t\tsearchValue,\r\n\t\tfullWidth = false,\r\n\t\tonChange,\r\n\t\trenderValue,\r\n\t\terror,\r\n\t\thelperText,\r\n\t\tloading = false,\r\n\t\tCustomDropdownIcon = ArrowDown,\r\n\t\t...rest\r\n\t} = props;\r\n\r\n\t\r\n\tconst handleOpen = () => {\r\n setTimeout(() => {\r\n if (searchInputRef.current) {\r\n searchInputRef.current.focus(); // Focus the search input\r\n }\r\n }, 0);\r\n };\r\n\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{label && (\r\n\t\t\t\t<Typography\r\n\t\t\t\t\ttype='s5'\r\n\t\t\t\t\tweight='medium'\r\n\t\t\t\t\tdata-position={dataPosition}\r\n\t\t\t\t\tdata-name={dataName}\r\n\t\t\t\t\tmb={0.5}\r\n\t\t\t\t\tcolor={error ? 'theme.error.600' : 'theme.secondary.800'}>\r\n\t\t\t\t\t{label} {required && <span style={{ color: '#c64d4d' }}>*</span>}\r\n\t\t\t\t</Typography>\r\n\t\t\t)}\r\n<StyledSelect\r\n IconComponent={(iconProps) => <CustomDropdownIcon {...iconProps} fontSize='small' />}\r\n MenuProps={{\r\n PaperProps: {\r\n sx: {\r\n maxHeight: 300, // Scrollable area for dropdown\r\n overflowY: 'auto',\r\n },\r\n },\r\n anchorOrigin: {\r\n vertical: 'bottom',\r\n horizontal: 'center',\r\n },\r\n }}\r\n displayEmpty\r\n fullWidth={fullWidth}\r\n renderValue={\r\n renderValue ??\r\n ((value: any) =>\r\n value !== '' ? (\r\n (value as any)\r\n ) : (\r\n <Typography color='inherit' type='s3'>\r\n {placeholder}\r\n </Typography>\r\n ))\r\n }\r\n onChange={onChange}\r\n error={error}\r\n\tonOpen={handleOpen} \r\n {...rest}\r\n>\r\n {handleSearch && (\r\n <Box\r\n sx={{\r\n position: 'sticky',\r\n top: 0,\r\n zIndex: 1, // Ensure it's above the dropdown items\r\n backgroundColor: '#fff',\r\n // padding: '0.5rem',\r\n\t\t\t\tmargin: '-4px -4px 0 -4px',\r\n\t\t\t\tmb: 0.5\r\n }}\r\n >\r\n <SelectSearch\r\n\t\t\t\tref={searchInputRef}\r\n searchPlaceholder={searchPlaceholder}\r\n handleSearch={(e: any) => handleSearch(e.target.value)}\r\n value={searchValue}\r\n onClick={(e) => e.stopPropagation()}\r\n onKeyDown={(e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tif (props?.value) {\r\n\t\t\t\t\t\tsetTimeout(() => searchInputRef.current?.focus(), 0); \r\n\t\t\t\t\t}\r\n\t\t \t}}\r\n\t\t\t\tsx={{\r\n\t\t\t\t\tp: 1,\r\n\t\t\t\t}}\r\n />\r\n </Box>\r\n )}\r\n {loading ? (\r\n <Box\r\n sx={{\r\n display: 'flex',\r\n width: '100%',\r\n p: 2,\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n }}\r\n >\r\n <CircularProgress size={30} color='inherit' />\r\n </Box>\r\n ) : (\r\n children\r\n )}\r\n</StyledSelect>\r\n\r\n\t\t\t{helperText && <FormHelperText error={error}>{helperText}</FormHelperText>}\r\n\t\t</>\r\n\t);\r\n});\r\n\r\nexport { Select };\r\nexport default Select;\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport { debounce } from \"lodash\";\r\nimport React, { useState, useEffect, useRef } from \"react\";\r\nimport { SxProps, TextField, styled, Theme } from \"@mui/material\";\r\n// import images from \"../../assets/images\";\r\n\r\nimport \"./search-bar.scss\";\r\nimport { Search, SearchStatus } from \"../icons\";\r\n\r\nconst StyledSearch = styled(TextField)(({ theme: { palette } }) => ({\r\n \"&.MuiTextField-root\": {\r\n backgroundColor: palette.theme?.secondary[200],\r\n borderRadius: \"0.5rem\",\r\n padding: \"0.375rem 0.75rem\",\r\n },\r\n \"& .MuiOutlinedInput-input\": {\r\n fontSize: \"0.875rem\",\r\n padding: \"0rem\",\r\n paddingLeft: \"1.375rem\",\r\n },\r\n \".MuiOutlinedInput-notchedOutline\": {\r\n border: \"none\",\r\n },\r\n}));\r\n\r\ninterface ISearchBar {\r\n placeholder?: string;\r\n handleSearch: (key: string) => void;\r\n debounceTime?: number;\r\n className?: string;\r\n InputProps?: any;\r\n sx?: SxProps<Theme>;\r\n isDrivePage?: boolean;\r\n searchText?:string\r\n}\r\n\r\nconst SearchBar = ({\r\n handleSearch,\r\n debounceTime = 300,\r\n className,\r\n InputProps,\r\n isDrivePage,\r\n searchText,\r\n value = '',\r\n ...rest\r\n}: ISearchBar) => {\r\n const [searchTerm, setSearchTerm] = useState(\"\");\r\n\r\n const debouncedSearchRef = useRef<(value: string) => void>();\r\n\r\n // Set `searchTerm` from localStorage on mount and clear `localStorage` if needed\r\n useEffect(() => {\r\n const initialSearchTerm = isDrivePage ? localStorage.getItem(\"searchTerm\") || \"\" : \"\";\r\n setSearchTerm(initialSearchTerm);\r\n\r\n // Set `localStorage` to an empty string on the first render\r\n if (isDrivePage) {\r\n localStorage.setItem(\"searchTerm\", \"\");\r\n }\r\n }, [isDrivePage]);\r\n\r\n useEffect(() => {\r\n setSearchTerm((typeof searchText=='string' && searchText) || '')\r\n }, [searchText])\r\n\r\n // Initialize the debounced function only once\r\n useEffect(() => {\r\n debouncedSearchRef.current = debounce((value: string) => handleSearch(value), debounceTime);\r\n \r\n // Cleanup function to cancel debounced call on component unmount\r\n return () => {\r\n debouncedSearchRef.current?.cancel();\r\n };\r\n }, [handleSearch, debounceTime]);\r\n\r\n useEffect(() => {\r\n setSearchTerm(value || '')\r\n }, [])\r\n\r\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n const value = e.target.value;\r\n setSearchTerm(value);\r\n if (isDrivePage) {\r\n localStorage.setItem(\"searchTerm\", value);\r\n }\r\n\r\n // Call the debounced search function\r\n if (debouncedSearchRef.current) {\r\n debouncedSearchRef.current(value);\r\n }\r\n };\r\n\r\n const handleKeyDown = (event: any) => {\r\n event.stopPropagation();\r\n };\r\n\r\n const handleClick = (event: any) => {\r\n event.stopPropagation();\r\n };\r\n\r\n return (\r\n <div className={`${className} search-wrapper`}>\r\n <StyledSearch\r\n fullWidth\r\n className=\"s3\"\r\n value={searchTerm}\r\n onChange={handleChange}\r\n onKeyDown={handleKeyDown}\r\n onClick={handleClick}\r\n autoComplete=\"off\"\r\n InputProps={InputProps}\r\n {...rest}\r\n />\r\n <span className=\"search-icon\">\r\n {\r\n searchTerm ?\r\n <SearchStatus fontSize=\"small\" sx={{ color: searchTerm ? \"grey.900\": \"grey.700\" }}/> : \r\n <Search fontSize=\"small\" sx={{ color: searchTerm ? \"grey.900\": \"grey.700\" }}/>\r\n }\r\n </span>\r\n {/* <img src={images.search} alt=\"search icon\" /> */}\r\n </div>\r\n );\r\n};\r\n\r\nexport { SearchBar };\r\nexport default SearchBar;\r\n","import {\r\n TextField as MUITextField,\r\n // TextFieldProps,\r\n styled,\r\n} from \"@mui/material\";\r\nimport \"./text-field.scss\";\r\nimport Typography from \"../typography/typography\";\r\nimport { memo } from \"react\";\r\n\r\nconst StyledTextField = styled(MUITextField)(({ theme: { palette } }) => ({\r\n \"& .MuiOutlinedInput-root\": {\r\n padding: \"0\",\r\n color: palette.theme?.secondary[800],\r\n \"& fieldset\": {\r\n borderColor: palette.theme?.secondary[400],\r\n },\r\n \"&:hover fieldset\": {\r\n borderColor: palette.theme?.secondary[500],\r\n },\r\n \"&.Mui-focused fieldset\": {\r\n borderWidth: \"0.0625rem\",\r\n borderStyle: \"solid\",\r\n borderColor: palette.theme?.primary[700],\r\n },\r\n \"&.Mui-error fieldset\": {\r\n borderColor: palette.theme?.error[600],\r\n },\r\n \"&.Mui-error .MuiInputBase-input::placeholder\": {\r\n color: palette.theme?.error[600],\r\n },\r\n \"&.Mui-disabled\": {\r\n background: palette.theme?.secondary[200],\r\n color: palette.theme?.secondary[800],\r\n },\r\n \"& .MuiInputBase-input::placeholder\": {\r\n color: palette.theme?.secondary[800],\r\n opacity: 1,\r\n },\r\n },\r\n \"& .MuiFormHelperText-root\": {\r\n marginLeft: 0,\r\n color: palette.theme?.secondary[800],\r\n \"&.Mui-error\": {\r\n color: palette.theme?.error[600],\r\n },\r\n },\r\n \"& .MuiIconButton-root\": {\r\n marginRight: 0,\r\n },\r\n}));\r\n\r\nconst TextField = memo((props: any) => {\r\n const {\r\n required,\r\n placeholder,\r\n label,\r\n error = false,\r\n dataPosition,\r\n dataName,\r\n hidden,\r\n ...rest\r\n } = props;\r\n return (\r\n <>\r\n {label && !hidden && (\r\n <Typography\r\n type=\"s5\"\r\n weight={\"medium\"}\r\n mb={0.5}\r\n color={error ? \"theme.error.600\" : \"theme.secondary.800\"}\r\n data-position={dataPosition}\r\n data-name={dataName}\r\n >\r\n {label} {required && <span className=\"requiredStar\">*</span>}\r\n </Typography>\r\n )}\r\n <StyledTextField\r\n error={error}\r\n placeholder={placeholder}\r\n className=\"textfield\"\r\n hidden={hidden}\r\n {...rest}\r\n />\r\n </>\r\n );\r\n});\r\n\r\nexport { TextField };\r\nexport default TextField;\r\n","import { Controller } from \"react-hook-form\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nimport TextField from \"../../../text-field/text-field\";\r\n\r\nimport \"./element.scss\";\r\nimport { IconButton, InputAdornment } from \"@mui/material\";\r\nimport React from \"react\";\r\n\r\nconst DynamicInput = React.memo((props: any) => {\r\n\r\n return (\r\n <Controller\r\n control={props.formControl}\r\n name={`${props.fieldArrayName}.${props.name}`}\r\n // defaultValue={props.defaultValue || \"\"}\r\n render={({ field, fieldState }) => (\r\n <TextField\r\n {...field}\r\n dataPosition={props.position}\r\n dataName={`${props.fieldArrayName}.${props.name}`}\r\n fullWidth\r\n label={props.label}\r\n defaultValue={\r\n props.type === \"number\" ||\r\n props.type === \"currency\" ||\r\n props.type === \"geoLocation\"\r\n ? typeof props.defaultValue === 'string' ? props.defaultValue.replace(/[^0-9]/g, \"\") : props.defaultValue\r\n : props.defaultValue || \"\"\r\n }\r\n // value={props.formType === \"builder\" ? props.defaultValue : \"\"}\r\n placeholder={props.placeholder}\r\n // onChange={(e) => {\r\n // field.onChange(e);\r\n // props.formControl.fieldArrayDirty[props.fieldArrayName] = true;\r\n // }}\r\n type={\r\n props.type === \"currency\" ||\r\n props.type === \"geoLocation\" ||\r\n props.type === \"relation\"\r\n ? \"text\"\r\n : props.type || \"text\"\r\n }\r\n // value={\r\n // props.type === \"number\" && typeof field.value === 'number'\r\n // ? (props?.shouldApplyPrecission === false || ['exchange_rate'].includes(props.name)) ? field.value : field.value.toFixed(2)\r\n // : field.value || \"\"\r\n // }\r\n value={\r\n props.type === \"number\" && typeof field.value === 'number'\r\n ? (props?.shouldApplyPrecission === false || ['exchange_rate'].includes(props.name)) \r\n ? field.value \r\n : (() => {\r\n const step = props?.float_step\r\n const decimalPlaces = step && step !== 'any' \r\n ? (String(step).split('.')[1]?.length ?? 2)\r\n : 2\r\n console.log(\"+++++++\", field.value, decimalPlaces)\r\n return Number(field.value.toFixed(decimalPlaces)).toString()\r\n })()\r\n : field.value || \"\"\r\n }\r\n multiline={props.is_multiline || false}\r\n minRows={4}\r\n required={props.formType === \"builder\" ? false : props.required}\r\n // onChange={(e) => {\r\n // return;\r\n // }}\r\n InputProps={{\r\n // inputMode: 'numeric',\r\n // pattern: '[0-9]*',\r\n minLength: props.min || 1,\r\n // maxLength: props.max || 255,\r\n // step: props?.float_step || \"0\",\r\n endAdornment: props.endIcon ? (\r\n <InputAdornment position=\"end\">\r\n <IconButton edge=\"end\" onClick={props?.onIconClick}>\r\n {props.endIcon}\r\n </IconButton>\r\n </InputAdornment>\r\n ) : undefined,\r\n ...props.InputProps,\r\n }}\r\n inputProps={{\r\n step: props?.float_step || 'any',\r\n min: props.min_length || undefined,\r\n // max: props.max_length,\r\n }}\r\n disabled={props.disabled}\r\n hidden={props.hidden}\r\n error={Boolean(fieldState.error?.message)}\r\n helperText={fieldState.error?.message || \"\"}\r\n onBlur={(e: any) => {\r\n field.onBlur(e)\r\n if (props.onBlur && typeof props.onBlur === 'function') {\r\n props.onBlur(e)\r\n }\r\n }}\r\n />\r\n )}\r\n />\r\n );\r\n});\r\n\r\nDynamicInput.propTypes = {\r\n formControl: PropTypes.shape({\r\n register: PropTypes.func.isRequired,\r\n setValue: PropTypes.func,\r\n _formState: PropTypes.object.isRequired,\r\n }).isRequired,\r\n name: PropTypes.string.isRequired,\r\n placeholder: PropTypes.string.isRequired,\r\n label: PropTypes.node.isRequired,\r\n fieldArrayName: PropTypes.string,\r\n defaultValue: PropTypes.string,\r\n type: PropTypes.string,\r\n required: PropTypes.bool,\r\n is_multiline: PropTypes.bool,\r\n min: PropTypes.number,\r\n max: PropTypes.number,\r\n min_length: PropTypes.number,\r\n max_length: PropTypes.number,\r\n float_step: PropTypes.string,\r\n position: PropTypes.number,\r\n formType: PropTypes.string,\r\n disabled: PropTypes.bool,\r\n typeOfField: PropTypes.string,\r\n endIcon: PropTypes.node,\r\n onIconClick: PropTypes.func,\r\n onBlur: PropTypes.func, // This should be optional\r\n hidden: PropTypes.bool,\r\n InputProps: PropTypes.object,\r\n shouldApplyPrecission: PropTypes.bool\r\n};\r\nDynamicInput.defaultProps = {\r\n onBlur: () => { }\r\n};\r\n\r\n\r\n\r\n\r\nexport { DynamicInput };\r\nexport default DynamicInput;","import{validateFieldsNatively as e,toNestErrors as t}from\"@hookform/resolvers\";import{appendErrors as r}from\"react-hook-form\";function o(o,n,a){return void 0===n&&(n={}),void 0===a&&(a={}),function(s,i,c){try{return Promise.resolve(function(t,r){try{var u=(n.context&&\"development\"===process.env.NODE_ENV&&console.warn(\"You should not used the yup options context. Please, use the 'useForm' context object instead\"),Promise.resolve(o[\"sync\"===a.mode?\"validateSync\":\"validate\"](s,Object.assign({abortEarly:!1},n,{context:i}))).then(function(t){return c.shouldUseNativeValidation&&e({},c),{values:a.raw?s:t,errors:{}}}))}catch(e){return r(e)}return u&&u.then?u.then(void 0,r):u}(0,function(e){if(!e.inner)throw e;return{values:{},errors:t((o=e,n=!c.shouldUseNativeValidation&&\"all\"===c.criteriaMode,(o.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,a=o&&o[t.type];e[t.path]=r(t.path,n,e,t.type,a?[].concat(a,t.message):t.message)}return e},{})),c)};var o,n}))}catch(e){return Promise.reject(e)}}}export{o as yupResolver};\n//# sourceMappingURL=yup.module.js.map\n","import { Tooltip as MUITooltip, TooltipProps } from \"@mui/material\";\n\nconst Tooltip = ({ title, children, sx, ...rest }: TooltipProps) => {\n return (\n <MUITooltip\n componentsProps={{\n tooltip: {\n sx: {\n padding: \"0.5rem 0.75rem\",\n backgroundColor: \"#393B3E\",\n maxWidth: \"12rem\",\n '& .MuiTooltip-arrow': {\n color: \"#393B3E\"\n },\n ...sx\n },\n },\n }}\n title={title}\n {...rest}\n >\n {children}\n </MUITooltip>\n );\n};\n\nexport { Tooltip };\nexport default Tooltip;\n","import {\n\tBox,\n\tCircularProgress,\n\tDialog,\n\tDialogActions,\n\tDialogContent,\n\tDialogProps,\n\tDialogTitle,\n\tDivider,\n\tIconButton\n} from '@mui/material';\nimport CloseIcon from '@mui/icons-material/Close';\nimport Typography from '../typography/typography';\nimport Button from '../button/button';\nimport './confirm-modal.scss';\nimport images from '../../assets/images';\nimport { useLanguage } from '../../hooks/useLangauge';\nimport { useTranslation } from 'react-i18next';\n\ninterface ConfirmPopUpProps extends DialogProps {\n\ttitle: string;\n\tdescription: string | JSX.Element;\n\tonClose: () => void;\n\tonConfirm: () => void;\n\tbuttonTexts?: {\n\t\tconfirm: string;\n\t\tcancel: string;\n\t};\n\tbuttonColors?: {\n\t\tconfirm: string;\n\t\tcancel?: string;\n\t};\n\tmodalType?: 'alert' | 'info';\n\tloading?: boolean;\n\tshowAction?: boolean;\n}\n\nexport const ConfirmPopUp = (props: ConfirmPopUpProps) => {\n\tconst { t } = useTranslation();\n\tconst {\n\t\topen,\n\t\ttitle,\n\t\tdescription,\n\t\tonClose,\n\t\tonConfirm,\n\t\tmodalType = 'alert',\n\t\tbuttonTexts = { confirm: t('common.delete'), cancel: t('common.cancel') },\n\t\tbuttonColors = { confirm: 'error' },\n\t\tloading = false,\n\t\tshowAction=true,\n\t\t...rest\n\t} = props;\n\n\tconst icon = modalType === 'info' ? images.info : images.alert;\n const {isRtl}=useLanguage();\n\treturn (\n\t\t<>\n\t\t\t<Dialog open={open} onClose={onClose} className='confirm' {...rest}>\n\t\t\t\t<DialogTitle className='confirm--head'>\n\t\t\t\t\t<Box className='confirm--title'>\n\t\t\t\t\t\t<img src={icon} alt='alert icon' />{' '}\n\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\ttype='s3'\n\t\t\t\t\t\t\tml={1}\n\t\t\t\t\t\t\tweight='medium'\n\t\t\t\t\t\t\tcolor='theme.secondary.1000'>\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t</Box>\n\t\t\t\t\t<IconButton disableRipple onClick={onClose} disabled={loading}>\n\t\t\t\t\t\t<CloseIcon />\n\t\t\t\t\t</IconButton>\n\t\t\t\t</DialogTitle>\n\t\t\t\t<Divider />\n\t\t\t\t<DialogContent className='confirm--content'>\n\t\t\t\t\t<Typography type='s3' color='theme.secondary.1000'>\n\t\t\t\t\t\t{description}\n\t\t\t\t\t</Typography>\n\t\t\t\t</DialogContent>\n\t\t\t\t<Divider />\n\t\t\t\t{showAction &&<DialogActions\n\t\t\t\t\tclassName='confirm--actions'\n\t\t\t\t\tsx={{ backgroundColor: 'theme.secondary.200' }}>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant='text'\n\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\tcolor={buttonColors?.cancel}\n\t\t\t\t\t\tdisabled={loading}>\n\t\t\t\t\t\t{buttonTexts.cancel}\n\t\t\t\t\t</Button>\n\t\t\t\t{buttonTexts.confirm &&<Button\n\t\t\t\t\t\tcolor={buttonColors.confirm}\n\t\t\t\t\t\tonClick={onConfirm}\n\t\t\t\t\t\tsx={isRtl?{mr: 1}:{}}\n\t\t\t\t\t\tendIcon={loading && <CircularProgress size={18} color='inherit' />}\n\t\t\t\t\t\tdisabled={loading}>\n\t\t\t\t\t\t{buttonTexts.confirm}\n\t\t\t\t\t</Button>}\n\t\t\t\t</DialogActions>}\n\t\t\t</Dialog>\n\t\t</>\n\t);\n};\n\nexport default ConfirmPopUp;\n","import Close from \"@mui/icons-material/Close\";\r\nimport {\r\n Alert as MUIAlert,\r\n IconButton,\r\n Snackbar,\r\n SnackbarProps,\r\n styled,\r\n} from \"@mui/material\";\r\nimport WarningAmberIcon from \"@mui/icons-material/WarningAmber\";\r\nimport CheckCircleOutlineIcon from \"@mui/icons-material/CheckCircleOutline\";\r\nimport \"./toast.scss\";\r\nimport Typography from \"../typography/typography\";\r\n\r\ninterface IToast extends SnackbarProps {\r\n handleClose: () => void;\r\n type?: \"normal\" | \"alert\";\r\n handleUndo?: () => void;\r\n}\r\n\r\nconst StyledAlert = styled(MUIAlert)(({ theme: { palette } }) => ({\r\n color: \"white\",\r\n height: \"2.5rem\",\r\n padding: \"0rem 1rem\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n\r\n \"&.MuiAlert-standardWarning\": {\r\n backgroundColor: palette.theme?.error[600],\r\n },\r\n\r\n \"&.MuiAlert-standardInfo\": {\r\n backgroundColor: palette.theme?.secondary[900],\r\n },\r\n\r\n \".MuiAlert-action\": {\r\n padding: \"0rem\",\r\n marginLeft: \"0.5rem\",\r\n },\r\n\r\n \".MuiAlert-icon\": {\r\n marginRight: \"0.5rem\",\r\n },\r\n}));\r\n\r\nconst Toast = (props: IToast) => {\r\n const {\r\n open,\r\n message,\r\n type = \"alert\",\r\n handleUndo,\r\n handleClose,\r\n ...rest\r\n } = props;\r\n\r\n const action = (\r\n <>\r\n {handleUndo ? (\r\n <Typography\r\n className=\"toast-undo\"\r\n type=\"s4\"\r\n color={type === \"normal\" ? \"theme.primary.600\" : \"white\"}\r\n onClick={handleUndo}\r\n >\r\n Undo\r\n </Typography>\r\n ) : (\r\n <IconButton color=\"inherit\" className=\"icon\" onClick={handleClose}>\r\n <Close fontSize=\"inherit\" />\r\n </IconButton>\r\n )}\r\n </>\r\n );\r\n\r\n return (\r\n <>\r\n <Snackbar\r\n open={open}\r\n autoHideDuration={300000}\r\n onClose={handleClose}\r\n {...rest}\r\n >\r\n <StyledAlert\r\n action={action}\r\n onClose={handleClose}\r\n severity={type === \"normal\" ? \"info\" : \"warning\"}\r\n icon={\r\n type === \"normal\" ? (\r\n <CheckCircleOutlineIcon htmlColor=\"white\" className=\"icon\" />\r\n ) : (\r\n <WarningAmberIcon htmlColor=\"white\" className=\"icon\" />\r\n )\r\n }\r\n >\r\n <Typography color=\"inherit\" type=\"s4\">\r\n {message}\r\n </Typography>\r\n </StyledAlert>\r\n </Snackbar>\r\n </>\r\n );\r\n};\r\n\r\nexport { Toast };\r\nexport default Toast;\r\n","import { Avatar as AvatarMUI, SvgIcon } from \"@mui/material\";\nimport Person2OutlinedIcon from \"@mui/icons-material/Person2Outlined\";\nimport \"./avatar.scss\";\n\nexport const Avatar = (props: any) => {\n const { icon, badge, src, alt, size, altIcon, ...rest } = props;\n const avatarStyle = {\n height: size,\n width: size,\n };\n\n const fontSize = size * (alt && alt.split(\" \").length > 1 ? 0.025 : 0.035);\n const badgeSize = size * 0.0225;\n const badgeBorder = size * 0.004;\n let altFirstChar = \"\";\n\n if (alt && alt.length > 0) {\n const words = alt.split(\" \");\n altFirstChar = words.map((word: string) => word.charAt(0)).join(\"\");\n }\n\n return (\n <div className=\"Avatar\">\n <AvatarMUI\n alt={alt}\n src={src ? src : undefined}\n style={avatarStyle}\n {...rest}\n >\n {icon && (!src || (alt && alt.length === 0)) && (\n <>\n {altIcon ? (\n <SvgIcon>{altIcon}</SvgIcon>\n ) : (\n <Person2OutlinedIcon\n style={{ fontSize: `${fontSize + 0.8}rem` }}\n />\n )}\n </>\n )}\n {!icon && !src && (\n <span\n className=\"Avatar--FirstChar\"\n style={{ fontSize: `${fontSize}rem` }}\n >\n {altFirstChar}\n </span>\n )}\n </AvatarMUI>\n\n {badge && (\n <div\n className=\"Avatar--Badge\"\n style={{\n width: `${badgeSize}rem`,\n height: `${badgeSize}rem`,\n border: `${badgeBorder}rem solid #ffffff`,\n }}\n />\n )}\n </div>\n );\n};\n\nexport default Avatar;\n","import { useState } from \"react\";\r\nimport Modal from \"../modal/modal\";\r\nimport { useForm } from \"react-hook-form\";\r\nimport { LoginFormValues } from \"../../contexts/AuthContext\";\r\nimport { yupResolver } from \"@hookform/resolvers/yup\";\r\nimport * as Yup from \"yup\";\r\nimport { useAuth } from \"../../hooks/useAuth\";\r\nimport { styled } from '@mui/material/styles';\r\nimport Box from \"@mui/material/Box\";\r\nimport Typography from \"../typography/typography\";\r\nimport DynamicInput from \"../form-control/form-builder/form-builder-element/text\";\r\nimport { Eye, EyeOff } from \"../icons\";\r\nimport Button from \"../button/button\";\r\nimport Toast from \"../toast/toast\";\r\n\r\n\r\nconst validationSchema = Yup.object({\r\n login: Yup.object({\r\n current_password: Yup.string().required(\"Please enter current password\"),\r\n password: Yup.string()\r\n .required(\"Please enter password\")\r\n .min(8, \"Password must be at least 8 characters\")\r\n .matches(/[A-Z]/, \"Password must contain at least one uppercase letter\")\r\n .matches(/[!@#$%^&*(),.?\":{}|<>]/, \"Password must contain at least one special character\"),\r\n confirm_password: Yup.string().required(\"Please enter confirm password\").oneOf([Yup.ref('password')], \"Passwords must match\"),\r\n }),\r\n});\r\n\r\n\r\n\r\nconst ResetPasswordModal = ({showModal, setShowModal}) => {\r\n const { changeUserPassword } = useAuth();\r\n\r\n // const [showModal, setShowModal] = useState(false);\r\n const [toast, setToast] = useState<IToast | null>(null);\r\n\r\n interface FormValeus {\r\n login: LoginFormValues;\r\n }\r\n\r\n const { control, handleSubmit, trigger } = useForm<FormValeus>({\r\n resolver: yupResolver(validationSchema),\r\n mode: \"all\",\r\n });\r\n\r\n const onSubmit = async (values: FormValeus) => {\r\n const isValid = await trigger();\r\n if (!isValid) return;\r\n await changeUserPassword(values.login, (message, type) => {\r\n if (type) {\r\n setToast({ message: message, type: \"normal\" });\r\n setShowModal(false);\r\n } else {\r\n setToast({ message: message, type: \"alert\" });\r\n }\r\n // make logout\r\n });\r\n return values; \r\n };\r\n\r\n const [showPassword, setShowPassword] = useState<boolean>(false);\r\n const handleShowPassword = () => setShowPassword(!showPassword);\r\n\r\n const [showCurrentPassword, setShowCurrentPassword] = useState<boolean>(false);\r\n const handleShowCurrentPassword = () => setShowCurrentPassword(!showCurrentPassword);\r\n\r\n const [showConfirmPassword, setShowConfirmPassword] = useState<boolean>(false);\r\n const handleShowConfirmPassword = () => setShowConfirmPassword(!showConfirmPassword);\r\n\r\n const FlexBox = styled(Box)(() => ({\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n }));\r\n\r\n return (\r\n <>\r\n <Modal \r\n open={showModal}\r\n onClose={() => setShowModal(false)} \r\n children={\r\n <>\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n <FlexBox gap={4} className=\"popup-change-pass\">\r\n <FlexBox gap={2}>\r\n <Box>\r\n <Typography\r\n align=\"center\"\r\n type=\"h1\"\r\n weight=\"medium\"\r\n color=\"theme.secondary.1000\"\r\n >\r\n Change Password\r\n </Typography>\r\n <Typography\r\n align=\"center\"\r\n type=\"h5\"\r\n weight=\"normal\"\r\n color=\"theme.secondary81000\"\r\n >\r\n Enter Details below\r\n </Typography>\r\n </Box>\r\n <FlexBox gap={2}>\r\n <Box>\r\n <DynamicInput\r\n formControl={control}\r\n label=\"Current Password\"\r\n name=\"current_password\"\r\n type={showCurrentPassword ? \"text\" : \"password\"}\r\n placeholder=\"Enter Current Password\"\r\n fieldArrayName=\"login\"\r\n endIcon={\r\n <>\r\n {showCurrentPassword ? (\r\n <Eye fontSize=\"small\" htmlColor=\"#292D32\" />\r\n ) : (\r\n <EyeOff fontSize=\"small\" htmlColor=\"#292D32\" />\r\n )}\r\n </>\r\n }\r\n onIconClick={handleShowCurrentPassword}\r\n />\r\n </Box>\r\n <Box>\r\n <DynamicInput\r\n formControl={control}\r\n label=\"Password\"\r\n name=\"password\"\r\n type={showPassword ? \"text\" : \"password\"}\r\n placeholder=\"Enter Password\"\r\n fieldArrayName=\"login\"\r\n endIcon={\r\n <>\r\n {showPassword ? (\r\n <Eye fontSize=\"small\" htmlColor=\"#292D32\" />\r\n ) : (\r\n <EyeOff fontSize=\"small\" htmlColor=\"#292D32\" />\r\n )}\r\n </>\r\n }\r\n onIconClick={handleShowPassword}\r\n />\r\n </Box>\r\n <Box>\r\n <DynamicInput\r\n formControl={control}\r\n label=\"Confirm Password\"\r\n name=\"confirm_password\"\r\n type={showConfirmPassword ? \"text\" : \"password\"}\r\n fieldArrayName=\"login\"\r\n endIcon={\r\n <>\r\n {showConfirmPassword ? (\r\n <Eye fontSize=\"small\" htmlColor=\"#292D32\" />\r\n ) : (\r\n <EyeOff fontSize=\"small\" htmlColor=\"#292D32\" />\r\n )}\r\n </>\r\n }\r\n onIconClick={handleShowConfirmPassword} \r\n placeholder=\"Enter confirm password\"\r\n />\r\n </Box>\r\n </FlexBox>\r\n </FlexBox>\r\n <FlexBox gap={2}>\r\n <Button type=\"button\" onClick={handleSubmit(onSubmit)} size=\"large\" variant=\"contained\">\r\n Change Password\r\n </Button>\r\n </FlexBox>\r\n </FlexBox>\r\n </form> \r\n </>\r\n }\r\n />\r\n <Toast\r\n open={Boolean(toast)}\r\n message={toast?.message}\r\n type={toast?.type}\r\n handleClose={() => setToast(null)}\r\n anchorOrigin={{ horizontal: \"right\", vertical: \"bottom\" }}\r\n autoHideDuration={3000}\r\n />\r\n </>\r\n );\r\n}\r\n\r\nexport { ResetPasswordModal };\r\nexport default ResetPasswordModal;","import React, { useState, useCallback, useRef, useEffect } from 'react'\r\nimport {\r\n\tIconButton,\r\n\tMenu,\r\n\tMenuItem,\r\n\tBadge,\r\n\tBox,\r\n\tCircularProgress,\r\n\tAvatar,\r\n\tListItemText,\r\n\tListItemAvatar,\r\n\tAlert,\r\n\tSkeleton,\r\n} from '@mui/material'\r\nimport {\r\n\tPerson as PersonIcon,\r\n\tEmail as EmailIcon,\r\n\tWarning as WarningIcon,\r\n\tCheckCircle as CheckCircleIcon,\r\n\tAssignment as AssignmentIcon,\r\n\tAccountBalance as AccountBalanceIcon,\r\n\tHourglassEmpty as HourglassEmptyIcon,\r\n\tCancel as CancelIcon,\r\n} from '@mui/icons-material'\r\nimport {\r\n\tgetV1Notification,\r\n\tgetV1NotificationMarkAllAsRead,\r\n\tpatchV1NotificationMarkAsReadId,\r\n} from '../../../../api-client/api.system-feature/api'\r\nimport { getErrorMessage, getToken } from '../../../../utils/common'\r\nimport formatText, { convertToUnderscore, formatLabel } from '../../../../utils/format-text'\r\nimport Typography from '../../../typography/typography'\r\nimport images from '../../../../assets/images'\r\nimport { generateRouteWithId } from '../../../../utils/route-utils'\r\nimport { PathnameGenerator, PathnameAccounting } from '../../../../constants/pathnames/pathname.accounting'\r\nimport { ROUTES as RENTALROUTES } from '../../../../constants/pathnames/pathname.rental'\r\n\r\nimport { PathnameInventory, PathnameGenerator as PathnameGeneratorInventory } from '../../../../constants/pathnames/pathname.inventory'\r\n\r\nimport {\r\n\tPathnameManufacturing,\r\n\tPathnameGenerator as PathnameGeneratorManufacuring,\r\n} from '../../../../constants/pathnames/pathname.manufacturing.ts'\r\n\r\nimport {\r\n\tPathnamePurchase,\r\n\tPathnameGenerator as PathnameGeneratorPurchase,\r\n} from '../../../../constants/pathnames/pathname.procurement.ts'\r\n\r\nimport { PathnameCrm, PathnameGenerator as PathnameGeneratorCrm } from '../../../../constants/pathnames/pathname.crm.ts'\r\n\r\nimport { PathnameRental, PathnameGenerator as PathnameGeneratorRental } from '../../../../constants/pathnames/pathname.rental.ts'\r\n\r\nimport { useNavigate } from 'react-router-dom'\r\nimport { Notification, Tick } from '../../../icons'\r\nimport Button from '../../../button/button'\r\nimport { enqueueSnackbar } from 'notistack'\r\n\r\nconst getNotificationUrl = (data: any) => {\r\n\tconst { moduleName = '', moduleId = '', notificationData = {} } = data\r\n\tconst key = convertToUnderscore(moduleName)\r\n\r\n\tconst routeMap: Record<string, () => string> = {\r\n\t\tsales_invoice: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_SALES_INVOICES), moduleId.toString()),\r\n\r\n\t\tasset_transfers: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_ASSET_TRANSFER), moduleId.toString()),\r\n\r\n\t\tbudgets: () => generateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_BUDGET), moduleId.toString()),\r\n\r\n\t\tcash_expense: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_CASH_EXPENSE), moduleId.toString()),\r\n\r\n\t\tcredit_notes: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_CREDIT_NOTE), moduleId.toString()),\r\n\r\n\t\tdebit_notes: () => generateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_DEBIT_NOTE), moduleId.toString()),\r\n\r\n\t\texpense_reimbursement: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_EXPENSE_REIMBURSEMENT), moduleId.toString()),\r\n\r\n\t\tjournal_entries: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_JOURNAL_ENTRY), moduleId.toString()),\r\n\r\n\t\tpayment_entries: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_PAYMENT_ENTRY), moduleId.toString()),\r\n\r\n\t\tpurchase_invoice: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_PURCHASE_INVOICE), moduleId.toString()),\r\n\r\n\t\tstock_transfer: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorInventory(PathnameInventory.VIEW_STOCK_TRANSFER), moduleId.toString()),\r\n\r\n\t\tbills_of_materials: () =>\r\n\t\t\tgenerateRouteWithId(\r\n\t\t\t\tPathnameGeneratorManufacuring(PathnameManufacturing.VIEW_BILL_OF_MATERIAL),\r\n\t\t\t\tmoduleId.toString()\r\n\t\t\t),\r\n\r\n\t\tpurchase_agreement: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_AGREEMENT), moduleId.toString()),\r\n\r\n\t\tpurchase_orders: () =>\r\n\t\t\tgenerateRouteWithId(\r\n\t\t\t\tnotificationData?.data?.is_rental == 1\r\n\t\t\t\t\t? RENTALROUTES.VIEW\r\n\t\t\t\t\t: PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_ORDER),\r\n\t\t\t\tmoduleId.toString()\r\n\t\t\t),\r\n\r\n\t\tpurchase_request: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_ORDER), moduleId.toString()),\r\n\r\n\t\tvra: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_VENDOR_RETURNS), moduleId.toString()),\r\n\r\n\t\tsales_customer_returns: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorCrm(PathnameCrm.VIEW_CUSTOMER_RETURNS), moduleId.toString()),\r\n\r\n\t\tsales_order: () => generateRouteWithId(PathnameGeneratorCrm(PathnameCrm.VIEW_SALES_ORDER), moduleId.toString()),\r\n\r\n\t\trental_order: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_RENTAL_ORDER), moduleId.toString()),\r\n\r\n\t\treplacement_order: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_RENTAL_ORDER), moduleId.toString()),\r\n\r\n\t\trental_agreement: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_AGREEMENT), moduleId.toString()),\r\n\r\n\t\tcross_hire_order: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_CROSS_HIRE_ORDER), moduleId.toString()),\r\n\r\n\t\tcross_hire_request: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_CROSS_HIRE_REQUEST), moduleId.toString()),\r\n\t}\r\n\r\n\treturn routeMap[key]?.() || '/dashboard'\r\n}\r\n\r\nconst mainModuleIcons = {\r\n\trbac: images.user,\r\n\tdocument: images.document,\r\n\t'accounts-and-finance': images.accounting,\r\n\tinventory: images.inventory,\r\n\tmanufacturing: images.manufacturing,\r\n\tsales: images.crm,\r\n\trental: images.rental,\r\n\tuser: images.user,\r\n\tpurchase: images.procurement,\r\n\thrms: images.hrms,\r\n}\r\nconst mainModuleBgColors = {\r\n\trbac: '#F3E5F5',\r\n\tdocument: '#FFF8E1',\r\n\t'accounts-and-finance': '#E8F5E8',\r\n\tinventory: '#E3F2FD',\r\n\tmanufacturing: '#FFF3E0',\r\n\tsales: '#F3E5F5',\r\n\trental: '#E8F5E8',\r\n\tuser: '#F3E5F5',\r\n\tpurchase: '#FCE4EC',\r\n\thrms: '#fcfcfc',\r\n}\r\n\r\nconst NotificationMenu = () => {\r\n\tconst [anchorEl, setAnchorEl] = useState(null)\r\n\tconst [notifications, setNotifications] = useState([])\r\n\tconst [loading, setLoading] = useState(false)\r\n\tconst [loadingMore, setLoadingMore] = useState(false)\r\n\tconst [error, setError] = useState(null)\r\n\tconst [unreadCount, setUnreadCount] = useState(0)\r\n\tconst [markingAllAsRead, setMarkingAllAsRead] = useState(false)\r\n\tconst [pagination, setPagination] = useState({\r\n\t\tskip: 0,\r\n\t\tlimit: 10,\r\n\t\ttotalCount: 0,\r\n\t\thasMore: true,\r\n\t})\r\n\r\n\tconst navigate = useNavigate()\r\n\r\n\tconst menuRef = useRef(null)\r\n\tconst isLoadingMoreRef = useRef(false)\r\n\tconst open = Boolean(anchorEl)\r\n\r\n\t// Transform API notification to display format\r\n\tconst transformNotification = (apiNotification) => {\r\n\t\tconst moduleIcons = {\r\n\t\t\t'accounts-and-finance': <AccountBalanceIcon color=\"primary\" />,\r\n\t\t\tuser: <PersonIcon color=\"action\" />,\r\n\t\t\tapproval: <AssignmentIcon color=\"warning\" />,\r\n\t\t}\r\n\r\n\t\tconst getInitials = (performedUser) => {\r\n\t\t\tif (!performedUser) return null\r\n\t\t\tconst firstName = performedUser.first_name || ''\r\n\t\t\tconst lastName = performedUser.last_name || ''\r\n\t\t\tif (!firstName && !lastName) return null\r\n\t\t\treturn (firstName.charAt(0) + lastName.charAt(0)).toUpperCase()\r\n\t\t}\r\n\r\n\t\tconst getFullName = (performedUser) => {\r\n\t\t\tif (!performedUser) return null\r\n\t\t\tconst firstName = performedUser.first_name || ''\r\n\t\t\tconst lastName = performedUser.last_name || ''\r\n\t\t\treturn `${firstName} ${lastName}`.trim() || null\r\n\t\t}\r\n\r\n\t\tconst formatTimestamp = (dateString) => {\r\n\t\t\tconst date = new Date(dateString)\r\n\t\t\tconst now = new Date()\r\n\t\t\tconst diffMs = now - date\r\n\t\t\tconst diffMins = Math.floor(diffMs / 60000)\r\n\t\t\tconst diffHours = Math.floor(diffMs / 3600000)\r\n\t\t\tconst diffDays = Math.floor(diffMs / 86400000)\r\n\r\n\t\t\tif (diffMins < 1) return 'Just now'\r\n\t\t\tif (diffMins < 60) return `${diffMins} minute${diffMins > 1 ? 's' : ''} ago`\r\n\t\t\tif (diffHours < 24) return `${diffHours} hour${diffHours > 1 ? 's' : ''} ago`\r\n\t\t\tif (diffDays < 7) return `${diffDays} day${diffDays > 1 ? 's' : ''} ago`\r\n\t\t\treturn date.toLocaleDateString()\r\n\t\t}\r\n\r\n\t\tconst subData = apiNotification.sub_module_data || {}\r\n\r\n\t\treturn {\r\n\t\t\tid: apiNotification.id,\r\n\t\t\ttype: apiNotification.action || apiNotification.notification_type || 'info',\r\n\t\t\ttitle: formatText(apiNotification.title),\r\n\t\t\tmessage: apiNotification.message,\r\n\t\t\ttimestamp: formatTimestamp(apiNotification.created_at),\r\n\t\t\tread: apiNotification.status === 'read',\r\n\t\t\tavatar: getInitials(apiNotification.performed_user),\r\n\t\t\tperformedByName: getFullName(apiNotification.performed_user),\r\n\t\t\tmodule: apiNotification.module,\r\n\t\t\tsubModule: apiNotification.sub_module,\r\n\t\t\tsubModuleId: apiNotification.sub_module_id,\r\n\t\t\tstatus: apiNotification.status,\r\n\t\t\tseriesNumber: subData.series_number || null,\r\n\t\t\tdocumentStatus: subData.status || null,\r\n\t\t\tcustomerName: subData.customer_name || null,\r\n\t\t\ticon: moduleIcons[apiNotification.module] || moduleIcons[apiNotification.action] || <PersonIcon color=\"action\" />,\r\n\t\t}\r\n\t}\r\n\r\n\t// Fetch notifications with pagination\r\n\tconst fetchNotifications = useCallback(async (isLoadMore = false) => {\r\n\t\t// Prevent multiple simultaneous load more requests\r\n\t\tif (isLoadMore && isLoadingMoreRef.current) {\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\tif (isLoadMore) {\r\n\t\t\tisLoadingMoreRef.current = true\r\n\t\t\tsetLoadingMore(true)\r\n\t\t} else {\r\n\t\t\tsetLoading(true)\r\n\t\t\t// Reset pagination when loading fresh data\r\n\t\t\tsetPagination((prev) => ({\r\n\t\t\t\t...prev,\r\n\t\t\t\tskip: 0,\r\n\t\t\t\thasMore: true,\r\n\t\t\t}))\r\n\t\t}\r\n\t\tsetError(null)\r\n\r\n\t\ttry {\r\n\t\t\tconst currentSkip = isLoadMore ? pagination.skip : 0\r\n\t\t\tconst response = await getV1Notification({\r\n\t\t\t\tskip: currentSkip,\r\n\t\t\t\tlimit: pagination.limit,\r\n\t\t\t\t...getToken(),\r\n\t\t\t})\r\n\r\n\t\t\tif (response.success && response.data) {\r\n\t\t\t\tconst transformedNotifications = response.data.notifications.map(transformNotification)\r\n\r\n\t\t\t\tif (isLoadMore) {\r\n\t\t\t\t\tsetNotifications((prev) => [...prev, ...transformedNotifications])\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsetNotifications(transformedNotifications)\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Update pagination\r\n\t\t\t\tconst newSkip = currentSkip + response.data.notifications.length\r\n\t\t\t\tconst hasMore = newSkip < response.data.pagination.totalCount\r\n\r\n\t\t\t\tsetPagination((prev) => ({\r\n\t\t\t\t\t...prev,\r\n\t\t\t\t\tskip: newSkip,\r\n\t\t\t\t\ttotalCount: response.data.pagination.totalCount,\r\n\t\t\t\t\thasMore,\r\n\t\t\t\t}))\r\n\r\n\t\t\t\t// Calculate unread count (assuming 'pending' status means unread)\r\n\t\t\t\tif (!isLoadMore) {\r\n\t\t\t\t\tconst unread = response.data.pagination.unreadCount\r\n\t\t\t\t\tsetUnreadCount(unread)\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsetUnreadCount(0)\r\n\t\t\t\tthrow new Error(response.message || 'Failed to load notifications')\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tsetError('Failed to load notifications')\r\n\t\t} finally {\r\n\t\t\tsetLoading(false)\r\n\t\t\tsetLoadingMore(false)\r\n\t\t\tif (isLoadMore) {\r\n\t\t\t\tisLoadingMoreRef.current = false\r\n\t\t\t}\r\n\t\t}\r\n\t}, [pagination.limit, pagination.skip])\r\n\r\n\t// Handle scroll for infinite loading\r\n\tconst handleScroll = useCallback(\r\n\t\t(event) => {\r\n\t\t\tconst { scrollTop, scrollHeight, clientHeight } = event.target\r\n\t\t\tconst isNearBottom = scrollTop + clientHeight >= scrollHeight - 50 // Increased threshold\r\n\r\n\t\t\tif (isNearBottom && !isLoadingMoreRef.current && !loading && pagination.hasMore) {\r\n\t\t\t\tfetchNotifications(true)\r\n\t\t\t}\r\n\t\t},\r\n\t\t[fetchNotifications, loading, pagination.hasMore]\r\n\t)\r\n\r\n\tconst handleClick = (event) => {\r\n\t\tsetAnchorEl(event.currentTarget)\r\n\t\tif (notifications.length === 0) {\r\n\t\t\tfetchNotifications()\r\n\t\t}\r\n\t}\r\n\r\n\tconst handleClose = () => {\r\n\t\tsetAnchorEl(null)\r\n\r\n\t\t// Don't clear notifications immediately to avoid flickering\r\n\t\t// They will be refreshed when menu is opened again\r\n\t}\r\n\r\n\tconst handleNotificationClick = async (notificationId) => {\r\n\t\t// Mark notification as read\r\n\t\tconst n = notifications.find((n) => {\r\n\t\t\treturn n.id === notificationId\r\n\t\t})\r\n\t\tif (!n) return\r\n\r\n\t\thandleClose()\r\n\r\n\t\tif (n.status === 'pending') {\r\n\t\t\tawait patchV1NotificationMarkAsReadId({\r\n\t\t\t\tid: notificationId,\r\n\t\t\t\t...getToken(),\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tsetNotifications((prev) => prev.map((n) => (n.id === notificationId ? { ...n, read: true } : n)))\r\n\t\tsetUnreadCount((prev) => Math.max(0, prev - 1))\r\n\t\tconst url = getNotificationUrl({\r\n\t\t\tmoduleName: n.subModule,\r\n\t\t\tmoduleId: n.subModuleId,\r\n\t\t\tnotificationData: n,\r\n\t\t})\r\n setTimeout(() => {\r\n navigate(url)\r\n }, 300)\r\n\t}\r\n\r\n\tconst getNotificationIcon = (notification) => {\r\n\t\tif (notification.icon) {\r\n\t\t\treturn notification.icon\r\n\t\t}\r\n\r\n\t\tswitch (notification.type) {\r\n\t\t\tcase 'approval':\r\n\t\t\t\treturn <AssignmentIcon color=\"warning\" />\r\n\t\t\tcase 'user':\r\n\t\t\t\treturn <PersonIcon color=\"action\" />\r\n\t\t\tcase 'message':\r\n\t\t\t\treturn <EmailIcon color=\"primary\" />\r\n\t\t\tcase 'warning':\r\n\t\t\t\treturn <WarningIcon color=\"warning\" />\r\n\t\t\tcase 'success':\r\n\t\t\t\treturn <CheckCircleIcon color=\"success\" />\r\n\t\t\tdefault:\r\n\t\t\t\treturn <PersonIcon color=\"action\" />\r\n\t\t}\r\n\t}\r\n\r\n\tconst handleMarkAllAsRead = useCallback(async () => {\r\n\t\tif (markingAllAsRead) return // Prevent multiple calls\r\n\r\n\t\tsetMarkingAllAsRead(true)\r\n\r\n\t\tif (!unreadCount) {\r\n\t\t\tenqueueSnackbar('No unread notifications!')\r\n\t\t\tsetMarkingAllAsRead(false)\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tawait getV1NotificationMarkAllAsRead({ ...getToken() })\r\n\t\t\t// Update local state immediately for better UX\r\n\t\t\tsetNotifications((prev) => prev.map((n) => ({ ...n, read: true, status: 'read' })))\r\n\t\t\tsetUnreadCount(0)\r\n\t\t} catch (error) {\r\n\t\t\tconst m = getErrorMessage(error.message)\r\n\t\t\tenqueueSnackbar(m, { variant: 'error' })\r\n\t\t} finally {\r\n\t\t\tsetMarkingAllAsRead(false)\r\n\t\t}\r\n\t}, [markingAllAsRead, unreadCount])\r\n\r\n\t// Remove the problematic useEffect that was causing extra API calls\r\n\r\n useEffect(() => {\r\n if(!open) {\r\n setTimeout(() => {\r\n setNotifications([])\r\n }, 500)\r\n }\r\n }, [open])\r\n\r\n\tconst getPerformerLabel = (action: string) => {\r\n\t\tswitch (action?.toLowerCase()) {\r\n\t\t\tcase 'approved':\r\n\t\t\t\treturn 'Approved by'\r\n\t\t\tcase 'rejected':\r\n\t\t\tcase 'reject':\r\n\t\t\t\treturn 'Rejected by'\r\n\t\t\tdefault:\r\n\t\t\t\treturn 'Request to'\r\n\t\t}\r\n\t}\r\n\r\n\tconst getStatusIcon = (action: string) => {\r\n\t\tswitch (action?.toLowerCase()) {\r\n\t\t\tcase 'approved':\r\n\t\t\t\treturn <CheckCircleIcon sx={{ fontSize: '0.9rem', color: 'success.main' }} />\r\n\t\t\tcase 'rejected':\r\n\t\t\tcase 'reject':\r\n\t\t\t\treturn <CancelIcon sx={{ fontSize: '0.9rem', color: 'error.main' }} />\r\n\t\t\tdefault:\r\n\t\t\t\treturn <HourglassEmptyIcon sx={{ fontSize: '0.9rem', color: 'warning.main' }} />\r\n\t\t}\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Box>\r\n\t\t\t<IconButton\r\n\t\t\t\t// size=\"small\"\r\n\t\t\t\taria-label=\"notifications\"\r\n\t\t\t\taria-controls={open ? 'notification-menu' : undefined}\r\n\t\t\t\taria-haspopup=\"true\"\r\n\t\t\t\taria-expanded={open ? 'true' : undefined}\r\n\t\t\t\tonClick={handleClick}\r\n\t\t\t>\r\n\t\t\t\t<Badge badgeContent={unreadCount} color=\"error\">\r\n\t\t\t\t\t<Notification fontSize=\"medium\" />\r\n\t\t\t\t</Badge>\r\n\t\t\t</IconButton>\r\n\r\n\t\t\t<Menu\r\n\t\t\t\tid=\"notification-menu\"\r\n\t\t\t\tanchorEl={anchorEl}\r\n\t\t\t\topen={open}\r\n\t\t\t\tonClose={handleClose}\r\n\t\t\t\tref={menuRef}\r\n\t\t\t\tslotProps={{\r\n\t\t\t\t\tpaper: {\r\n\t\t\t\t\t\tsx: {\r\n\t\t\t\t\t\t\toverflow: 'visible',\r\n\t\t\t\t\t\t\tminWidth: 400,\r\n\t\t\t\t\t\t\tmaxWidth: 450,\r\n\t\t\t\t\t\t\tmaxHeight: 520,\r\n\t\t\t\t\t\t\t'&:before': {\r\n\t\t\t\t\t\t\t\tcontent: '\"\"',\r\n\t\t\t\t\t\t\t\tdisplay: 'block',\r\n\t\t\t\t\t\t\t\tposition: 'absolute',\r\n\t\t\t\t\t\t\t\ttop: 0,\r\n\t\t\t\t\t\t\t\tright: '50%',\r\n\t\t\t\t\t\t\t\twidth: 10,\r\n\t\t\t\t\t\t\t\theight: 10,\r\n\t\t\t\t\t\t\t\tbgcolor: 'background.paper',\r\n\t\t\t\t\t\t\t\ttransform: 'translateY(-50%) translateX(50%) rotate(45deg)',\r\n\t\t\t\t\t\t\t\tzIndex: 0,\r\n\t\t\t\t\t\t\t\tborder: '1px solid',\r\n\t\t\t\t\t\t\t\tborderColor: ({ palette }) => palette.grey[300],\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t},\r\n\t\t\t\t}}\r\n\t\t\t\tsx={{\r\n\t\t\t\t\t'& .MuiList-root': {\r\n\t\t\t\t\t\tborderRadius: '8px',\r\n\t\t\t\t\t\tmaxHeight: 520,\r\n\t\t\t\t\t\toverflowY: 'auto',\r\n\t\t\t\t\t\tpadding: 0,\r\n\t\t\t\t\t},\r\n\t\t\t\t}}\r\n\t\t\t\ttransformOrigin={{ horizontal: 'center', vertical: 'top' }}\r\n\t\t\t\tanchorOrigin={{ horizontal: 'center', vertical: 'bottom' }}\r\n\t\t\t\tonScroll={handleScroll}\r\n\t\t\t>\r\n\t\t\t\t{/* Header */}\r\n\t\t\t\t<Box sx={{ px: 2, py: 1, borderBottom: '1px solid #e0e0e0', backgroundColor: '#fafafa' }}>\r\n\t\t\t\t\t<Typography type=\"h5\" weight=\"bold\" color=\"grey.1000\">\r\n\t\t\t\t\t\tNotifications\r\n\t\t\t\t\t</Typography>\r\n\t\t\t\t\t{unreadCount > 0 && (\r\n\t\t\t\t\t\t<Box sx={{ display: 'flex', justifyContent: 'space-between', width: '100%', alignItems: 'center' }}>\r\n\t\t\t\t\t\t\t<Typography type=\"s4\" color=\"grey.800\">\r\n\t\t\t\t\t\t\t\tYou have {unreadCount} unread notification{unreadCount > 1 ? 's' : ''}\r\n\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\tvariant=\"text\"\r\n\t\t\t\t\t\t\t\tstartIcon={\r\n\t\t\t\t\t\t\t\t\tmarkingAllAsRead ? (\r\n\t\t\t\t\t\t\t\t\t\t<CircularProgress size={15} color=\"inherit\" />\r\n\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t<Tick sx={{ fontSize: '0.75rem !important' }} color=\"grey.900\" />\r\n\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tsx={{ p: 0 }}\r\n\t\t\t\t\t\t\t\tonClick={handleMarkAllAsRead}\r\n\t\t\t\t\t\t\t\tdisabled={unreadCount <= 0 || markingAllAsRead}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t<Typography type=\"s4\" color=\"grey.900\">\r\n\t\t\t\t\t\t\t\t\tMark all as read\r\n\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t)}\r\n\t\t\t\t</Box>\r\n\r\n\t\t\t\t{/* Loading State */}\r\n\t\t\t\t{loading && notifications.length === 0 && (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<Box\r\n\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\t\t\tflexDirection: 'column',\r\n\t\t\t\t\t\t\t\tgap: 1,\r\n\t\t\t\t\t\t\t\tjustifyContent: 'center',\r\n\t\t\t\t\t\t\t\tminWidth: 400,\r\n\t\t\t\t\t\t\t\tp: 1,\r\n\t\t\t\t\t\t\t\tm: 1,\r\n\t\t\t\t\t\t\t\tbackgroundColor: 'grey.200',\r\n\t\t\t\t\t\t\t\tborderRadius: '8px',\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<Box sx={{ display: 'flex', gap: 1 }}>\r\n\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={40} height={40} />\r\n\t\t\t\t\t\t\t\t<Box sx={{ display: 'flex', flexDirection: 'column', gap: 0.5 }}>\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={25} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={150} height={11} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={11} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={11} />\r\n\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t<Box\r\n\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\t\t\tflexDirection: 'column',\r\n\t\t\t\t\t\t\t\tgap: 1,\r\n\t\t\t\t\t\t\t\tjustifyContent: 'center',\r\n\t\t\t\t\t\t\t\tminWidth: 400,\r\n\t\t\t\t\t\t\t\tp: 1,\r\n\t\t\t\t\t\t\t\tm: 1,\r\n\t\t\t\t\t\t\t\tbackgroundColor: 'grey.200',\r\n\t\t\t\t\t\t\t\tborderRadius: '8px',\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<Box sx={{ display: 'flex', gap: 1 }}>\r\n\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={40} height={40} />\r\n\t\t\t\t\t\t\t\t<Box sx={{ display: 'flex', flexDirection: 'column', gap: 0.5 }}>\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={25} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={150} height={11} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={11} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={11} />\r\n\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t<Box\r\n\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\t\t\tflexDirection: 'column',\r\n\t\t\t\t\t\t\t\tgap: 1,\r\n\t\t\t\t\t\t\t\tjustifyContent: 'center',\r\n\t\t\t\t\t\t\t\tminWidth: 400,\r\n\t\t\t\t\t\t\t\tp: 1,\r\n\t\t\t\t\t\t\t\tm: 1,\r\n\t\t\t\t\t\t\t\tbackgroundColor: 'grey.200',\r\n\t\t\t\t\t\t\t\tborderRadius: '8px',\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<Box sx={{ display: 'flex', gap: 1 }}>\r\n\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={40} height={40} />\r\n\t\t\t\t\t\t\t\t<Box sx={{ display: 'flex', flexDirection: 'column', gap: 0.5 }}>\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={25} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={150} height={11} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={11} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={11} />\r\n\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t</>\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t{/* Error State */}\r\n\t\t\t\t{error && (\r\n\t\t\t\t\t<Box sx={{ p: 2 }}>\r\n\t\t\t\t\t\t<Alert severity=\"error\">{error}</Alert>\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t{/* Notifications List */}\r\n\t\t\t\t{!loading && !error && notifications.length > 0 && (\r\n\t\t\t\t\t<Box sx={{ maxHeight: 420, overflowY: 'auto', p: 1 }} onScroll={handleScroll}>\r\n\t\t\t\t\t\t{notifications.map((notification) => (\r\n\t\t\t\t\t\t\t<div key={notification.id}>\r\n\t\t\t\t\t\t\t\t<MenuItem\r\n\t\t\t\t\t\t\t\t\tonClick={() => handleNotificationClick(notification.id)}\r\n\t\t\t\t\t\t\t\t\tsx={({ palette }) => ({\r\n\t\t\t\t\t\t\t\t\t\tpy: 1,\r\n\t\t\t\t\t\t\t\t\t\tpx: 1,\r\n\t\t\t\t\t\t\t\t\t\tbackgroundColor: !notification.read ? palette.theme.grey[200] : 'transparent',\r\n\t\t\t\t\t\t\t\t\t\tborder: `1px solid ${palette.grey[200]}`,\r\n\t\t\t\t\t\t\t\t\t\tmarginBottom: '4px !important',\r\n\t\t\t\t\t\t\t\t\t\t'&:hover': {\r\n\t\t\t\t\t\t\t\t\t\t\tbackgroundColor: palette.theme.grey[200],\r\n\t\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t\talignItems: 'flex-start',\r\n\t\t\t\t\t\t\t\t\t\tminHeight: 'auto',\r\n\t\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<ListItemAvatar sx={{ minWidth: 48, mt: 0 }}>\r\n\t\t\t\t\t\t\t\t\t\t{mainModuleIcons?.[notification.module] ? (\r\n\t\t\t\t\t\t\t\t\t\t\t<Avatar\r\n\t\t\t\t\t\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 40,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\theight: 40,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tfontSize: '0.875rem',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbgcolor: mainModuleBgColors[notification.module] || 'primary.main',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: 'white',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tborderRadius: '8px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tboxShadow: '0 2px 8px rgba(0,0,0,0.1)',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'& img': {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '28px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: '28px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tobjectFit: 'contain',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t\tsrc={mainModuleIcons?.[notification.module]}\r\n\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t\t{notification.avatar ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Avatar\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 40,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: 40,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfontSize: '0.875rem',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbgcolor: 'primary.main',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: 'white',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tborderRadius: '8px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tboxShadow: '0 2px 8px rgba(0,0,0,0.1)',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{notification.avatar}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Avatar>\r\n\t\t\t\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Avatar\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 36,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: 36,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbgcolor: 'grey.100',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: 'grey.600',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tborderRadius: '8px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tboxShadow: '0 2px 8px rgba(0,0,0,0.1)',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{getNotificationIcon(notification)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Avatar>\r\n\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t</ListItemAvatar>\r\n\t\t\t\t\t\t\t\t\t<ListItemText\r\n\t\t\t\t\t\t\t\t\t\tsx={{ margin: 0, pr: 1 }}\r\n\t\t\t\t\t\t\t\t\t\tprimary={\r\n\t\t\t\t\t\t\t\t\t\t\t// Line 1: title seriesNumber statusIcon\r\n\t\t\t\t\t\t\t\t\t\t\t<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, flexWrap: 'wrap', mb: 0.25 }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<Typography type=\"s3\" weight=\"bold\" color=\"grey.1000\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{notification.title}\r\n\t\t\t\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t\t{notification.seriesNumber && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Typography type=\"s4\" sx={{ color: 'text.secondary', fontWeight: 500 }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{notification.seriesNumber}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t{getStatusIcon(notification.type)}\r\n\t\t\t\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tsecondary={\r\n\t\t\t\t\t\t\t\t\t\t\t<Box>\r\n\t\t\t\t\t\t\t\t\t\t\t\t{/* Line 2: Customer / Vendor label + name */}\r\n\t\t\t\t\t\t\t\t\t\t\t\t{notification.customerName && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Typography type=\"s4\" color=\"grey.800\" sx={{ display: 'block', mb: 0.25 }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Typography component=\"span\" type=\"s5\" sx={{ fontSize: '0.7rem !important', color: 'text.secondary', mr: 0.5 }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{notification.module === 'purchase' ? 'Vendor:' : 'Customer:'}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{notification.customerName}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t{/* Line 3: Approved by {name} · timestamp */}\r\n\t\t\t\t\t\t\t\t\t\t\t\t<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, flexWrap: 'wrap' }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{notification.performedByName && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Typography type=\"s5\" sx={{ fontSize: '0.7rem !important', color: 'text.secondary' }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{getPerformerLabel(notification.type)} {notification.performedByName}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{notification.performedByName && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Box sx={{ height: 4, width: 4, borderRadius: '100%', backgroundColor: 'grey.400', flexShrink: 0 }} />\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Typography type=\"s5\" color=\"primary\" sx={{ fontSize: '0.65rem !important' }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{notification.timestamp}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t{!notification.read && (\r\n\t\t\t\t\t\t\t\t\t\t<Box\r\n\t\t\t\t\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\t\t\t\t\twidth: 10,\r\n\t\t\t\t\t\t\t\t\t\t\t\theight: 10,\r\n\t\t\t\t\t\t\t\t\t\t\t\tborderRadius: '50%',\r\n\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor: 'primary.main',\r\n\t\t\t\t\t\t\t\t\t\t\t\tflexShrink: 0,\r\n\t\t\t\t\t\t\t\t\t\t\t\tmt: 0.5,\r\n\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t))}\r\n\r\n\t\t\t\t\t\t{/* Loading More Indicator */}\r\n\t\t\t\t\t\t{loadingMore && (\r\n\t\t\t\t\t\t\t<Box sx={{ display: 'flex', justifyContent: 'center', py: 2.5, px: 3 }}>\r\n\t\t\t\t\t\t\t\t<CircularProgress size={20} />\r\n\t\t\t\t\t\t\t\t<Typography variant=\"body2\" sx={{ ml: 1.5, color: 'text.secondary' }}>\r\n\t\t\t\t\t\t\t\t\tLoading more...\r\n\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t{/* End of List Indicator */}\r\n\t\t\t\t\t\t{!pagination.hasMore && notifications.length > 0 && (\r\n\t\t\t\t\t\t\t<Box sx={{ textAlign: 'center', py: 1.5, px: 2 }}>\r\n\t\t\t\t\t\t\t\t<Typography type=\"s3\" color=\"grey.800\" textAlign=\"center\">\r\n\t\t\t\t\t\t\t\t\tNo more notifications\r\n\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t{/* Empty State */}\r\n\t\t\t\t{!loading && !error && notifications.length === 0 && (\r\n\t\t\t\t\t<Box sx={{ p: 4, textAlign: 'center' }}>\r\n\t\t\t\t\t\t<Notification sx={{ fontSize: 56, color: 'text.secondary', mb: 2 }} />\r\n\t\t\t\t\t\t<Typography type=\"s1\" color=\"grey.800\" sx={{ mb: 1 }} textAlign=\"center\">\r\n\t\t\t\t\t\t\tNo notifications yet\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t)}\r\n\t\t\t</Menu>\r\n\t\t</Box>\r\n\t)\r\n}\r\n\r\nexport { NotificationMenu };\r\nexport default NotificationMenu\r\n","// components/header/Header.tsx - Complete updated version with English fallback\r\nimport React, { useState, useCallback, useMemo } from \"react\";\r\nimport { Link, matchRoutes, useLocation, useNavigate } from \"react-router-dom\";\r\nimport Box from \"@mui/material/Box\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport LockIcon from \"@mui/icons-material/Lock\";\r\nimport IconButton from \"@mui/material/IconButton\";\r\nimport MenuItem from \"@mui/material/MenuItem\";\r\nimport Menu from \"@mui/material/Menu\";\r\nimport KeyboardBackspaceIcon from \"@mui/icons-material/KeyboardBackspace\";\r\nimport ListItemText from \"@mui/material/ListItemText\";\r\nimport Divider from \"@mui/material/Divider\";\r\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\r\n\r\n\r\nimport { Pathname } from \"../../constants/pathnames/pathname\"; // Removed - should be passed as props\r\nimport Typography from \"../typography/typography\";\r\nimport logo, { images } from \"../../assets/images\";\r\nimport Select from \"../select/select\";\r\nimport modules from \"../../constants/modules\"; // Removed - should be passed as props\r\nimport Avatar from \"../avatar/avatar\";\r\nimport { useAuth } from \"../../hooks/useAuth\";\r\nimport ConfirmPopUp from \"../confirm-modal/confirm-modal\";\r\nimport formatText from \"../../utils/format-text\";\r\nimport \"./header.scss\";\r\nimport { useLanguage } from \"../../hooks/useLangauge\";\r\nimport { Eye } from \"../icons\";\r\nimport ResetPasswordModal from \"../reset-password-modal/reset-password-modal\";\r\nimport NotificationMenu from \"./components/notification-menu/notification-menu\";\r\nimport { getApiConfig } from \"@/utils\";\r\n\r\ninterface ILanguage {\r\n label: string;\r\n code: string;\r\n direction: string;\r\n}\r\n\r\ninterface IModule {\r\n label: any;\r\n link: string;\r\n sidebar: string;\r\n icon: string;\r\n permission: string;\r\n bg: string;\r\n connectedRoutes: string[];\r\n translationModule: string;\r\n}\r\n\r\n\r\nexport function Header(props: any): React.ReactElement {\r\n const navigate = useNavigate();\r\n const { t } = useTranslation();\r\n const location = useLocation();\r\n const { logout, user } = useAuth();\r\n const config = getApiConfig();\r\n\r\n const {\r\n languages,\r\n currentLanguage,\r\n changeLanguage,\r\n isLoading: languagesLoading,\r\n error: languageContextError,\r\n isFallbackActive,\r\n fetchLanguages,\r\n isRtl\r\n } = useLanguage();\r\n\r\n const { pathname } = location;\r\n const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);\r\n const [logoutConfirmation, setLogoutConfirmation] = useState<boolean>(false);\r\n const [localLanguageError, setLocalLanguageError] = useState<string | null>(null);\r\n const [showModal, setShowModal] = useState(false);\r\n\r\n const u_data = localStorage.getItem(\"_u_data\") || undefined;\r\n const userData = u_data ? JSON.parse(u_data) : \"\";\r\n const isMenuOpen = Boolean(anchorEl);\r\n\r\n const handleLogoutConfirmation = () =>\r\n setLogoutConfirmation(!logoutConfirmation);\r\n\r\n const checkMatchedRoutes = useCallback(\r\n (paths: string[] | string) => {\r\n const shouldMatch: { path: string }[] = Array.isArray(paths)\r\n ? paths.map((path: string) => ({ path }))\r\n : [{ path: paths }];\r\n\r\n return Boolean(matchRoutes(shouldMatch, location));\r\n },\r\n [location],\r\n );\r\n\r\n const erp_modules = useMemo<IModule[]>(() => modules(t), [t]);\r\n\r\n const selectedModule = useMemo<IModule | null>(() => {\r\n return (\r\n erp_modules.find(\r\n (module: IModule) =>\r\n module?.link?.toLowerCase() === pathname.toLowerCase() ||\r\n checkMatchedRoutes(module.connectedRoutes),\r\n ) || null\r\n );\r\n }, [erp_modules, pathname, checkMatchedRoutes]);\r\n\r\n const handleChangePasswordView = () => {\r\n setShowModal(true);\r\n }\r\n\r\n // Enhanced language change handler with validation and error handling\r\n const onChangeLang = (e: React.ChangeEvent<HTMLSelectElement>) => {\r\n const lang_code = e.target.value;\r\n\r\n // Clear any previous errors\r\n setLocalLanguageError(null);\r\n\r\n // Validate the language exists before changing\r\n if (!languages || languages.length === 0) {\r\n const errorMsg = t('header.language_not_available') || 'Languages not available';\r\n setLocalLanguageError(errorMsg);\r\n return;\r\n }\r\n\r\n const languageExists = languages.some((lang: ILanguage) => lang.code === lang_code);\r\n\r\n if (languageExists) {\r\n try {\r\n changeLanguage(lang_code);\r\n } catch (error) {\r\n const errorMsg = error instanceof Error ? error.message : 'Failed to change language';\r\n setLocalLanguageError(errorMsg);\r\n }\r\n } else {\r\n const errorMsg = t('header.language_not_found', { language: lang_code }) ||\r\n `Selected language \"${lang_code}\" is not available`;\r\n setLocalLanguageError(errorMsg);\r\n }\r\n };\r\n\r\n // Retry language loading\r\n const handleRetryLanguages = async () => {\r\n setLocalLanguageError(null);\r\n try {\r\n await fetchLanguages();\r\n } catch (error) {\r\n const errorMsg = 'Failed to reload languages';\r\n setLocalLanguageError(errorMsg);\r\n }\r\n };\r\n\r\n\r\n const handleProfileMenuOpen = (event: React.MouseEvent<HTMLElement>) =>\r\n setAnchorEl(event.currentTarget);\r\n\r\n const handleMenuClose = () => {\r\n setAnchorEl(null);\r\n };\r\n\r\n const handleChange = (event: any) => {\r\n const selectedLink = event.target.value;\r\n setTimeout(() => {\r\n navigate(selectedLink);\r\n }, 300);\r\n };\r\n\r\n const handleBackButton = () => {\r\n window.history.back();\r\n };\r\n\r\n // Get current language display value with fallback indication\r\n const getCurrentLanguageDisplay = (): string => {\r\n if (!currentLanguage) return t('header.select_language') || 'Select Language';\r\n\r\n // Show fallback indicator for better UX\r\n if (isFallbackActive || languageContextError) {\r\n return `${currentLanguage.label}`;\r\n }\r\n\r\n return currentLanguage.label;\r\n };\r\n\r\n // Create English fallback for consistent display\r\n const createEnglishFallback = (): ILanguage => ({\r\n code: 'en',\r\n label: 'English',\r\n direction: 'ltr'\r\n });\r\n\r\n // Get languages for dropdown - ensure English is always available\r\n const getLanguagesForDropdown = (): ILanguage[] => {\r\n if (!languages || languages.length === 0) {\r\n // If no languages available, show only English\r\n return [createEnglishFallback()];\r\n }\r\n\r\n // Ensure English is in the list\r\n const hasEnglish = languages.some(lang => lang.code === 'en');\r\n if (!hasEnglish) {\r\n return [createEnglishFallback(), ...languages];\r\n }\r\n\r\n return languages;\r\n };\r\n\r\n // Render language selector based on different states\r\n const renderLanguageSelector = () => {\r\n const availableLanguages = getLanguagesForDropdown();\r\n const displayValue = currentLanguage?.code || 'en'; // Default to English\r\n\r\n // Loading state\r\n if (languagesLoading) {\r\n return (\r\n <Box className=\"language-loading\">\r\n <Typography variant=\"body2\" color=\"text.secondary\">\r\n {'Loading...'}\r\n </Typography>\r\n </Box>\r\n );\r\n }\r\n\r\n // Always show dropdown with at least English available\r\n return (\r\n <Select\r\n onChange={onChangeLang}\r\n size=\"small\"\r\n value={displayValue}\r\n renderValue={() => getCurrentLanguageDisplay()}\r\n error={!!localLanguageError}\r\n className={`language-select ${isFallbackActive || languageContextError ? 'language-fallback-active' : ''}`}\r\n\r\n >\r\n {availableLanguages.map(({ code, label }: ILanguage) => (\r\n <MenuItem key={code} value={code}>\r\n <Typography\r\n type=\"s4\"\r\n weight=\"medium\"\r\n color=\"theme.secondary.1000\"\r\n\r\n >\r\n {label}\r\n {/* Show fallback indicator in dropdown */}\r\n {/* {(isFallbackActive || languageContextError) && code === 'en' && \r\n ` (${t('header.fallback') || 'Fallback'})`\r\n } */}\r\n </Typography>\r\n </MenuItem>\r\n ))}\r\n\r\n {/* Show retry option if there's an error */}\r\n {languageContextError && (\r\n <MenuItem onClick={handleRetryLanguages} style={{ fontStyle: 'italic' }}>\r\n <Typography\r\n type=\"s4\"\r\n weight=\"medium\"\r\n color=\"theme.secondary.500\"\r\n >\r\n 🔄 {t('header.retry_languages') || 'Retry loading languages'}\r\n </Typography>\r\n </MenuItem>\r\n )}\r\n </Select>\r\n );\r\n };\r\n\r\n const menuId = \"primary-search-account-menu\";\r\n const renderMenu = (\r\n <Menu\r\n className=\"main-profile-menu\"\r\n anchorEl={anchorEl}\r\n id={menuId}\r\n keepMounted\r\n open={isMenuOpen}\r\n onClose={handleMenuClose}\r\n >\r\n <MenuItem className=\"user-assigned\">\r\n <span>{t('common.assigned_roles') || 'Assigned roles'}</span>\r\n </MenuItem>\r\n <MenuItem className=\"user-data-wrap\" value={userData.role_id}>\r\n <ListItemIcon>\r\n <Avatar size={27} alt={userData.role_name} />\r\n </ListItemIcon>\r\n <ListItemText className=\"size15\">\r\n {userData.role_name}\r\n </ListItemText>\r\n <Typography variant=\"body2\" color=\"text.secondary\">\r\n <img src={images.tickicon} alt=\"Active\" />\r\n </Typography>\r\n </MenuItem>\r\n <Divider />\r\n <MenuItem\r\n className=\"user-assigned\"\r\n onClick={() => {\r\n handleChangePasswordView();\r\n setAnchorEl(null);\r\n }}\r\n >\r\n <ListItemIcon>\r\n <Eye fontSize=\"medium\" width={20} height={20} htmlColor=\"#292D32\" />\r\n </ListItemIcon>\r\n <ListItemText className=\"size15\">{t(\"common.change_password\")}</ListItemText>\r\n </MenuItem>\r\n <Divider />\r\n <MenuItem\r\n className=\"menu-item-color\"\r\n onClick={() => {\r\n handleLogoutConfirmation();\r\n setAnchorEl(null);\r\n }}\r\n >\r\n <ListItemIcon>\r\n <img src={images.logout} alt=\"logout\" />\r\n </ListItemIcon>\r\n <ListItemText className=\"size15\">{t(\"common.logout\")}</ListItemText>\r\n </MenuItem>\r\n </Menu>\r\n );\r\n\r\n const appLogo = getApiConfig().appLogo || images.logo\r\n\r\n return (\r\n <>\r\n <Box className=\"main-box\">\r\n {!props.isDropdownShow && (\r\n <Link to={user ? Pathname.DASHBOARD : Pathname.LOGIN}>\r\n <img src={appLogo} alt=\"logo\" height={55}/>\r\n </Link>\r\n )}\r\n <Box className=\"second-box\">\r\n {props.isDropdownShow && (\r\n <>\r\n <IconButton onClick={handleBackButton}>\r\n <KeyboardBackspaceIcon\r\n className={isRtl ? \"arrow-pointer_rtl\" : \"arrow-pointer\"}\r\n />\r\n </IconButton>\r\n <Box width={250}>\r\n <Select\r\n fullWidth\r\n placeholder=\"Placeholder\"\r\n size={\"small\"}\r\n value={selectedModule?.link || \"\"}\r\n onChange={handleChange}\r\n className=\"select-box\"\r\n variant=\"outlined\"\r\n renderValue={(value: string) => (\r\n <>\r\n {selectedModule ? (\r\n <Box className=\"selected-menu-box\">\r\n <img\r\n src={selectedModule.icon}\r\n alt={selectedModule.label}\r\n />\r\n {selectedModule.label}\r\n </Box>\r\n ) : (\r\n value\r\n )}\r\n </>\r\n )}\r\n >\r\n {erp_modules.map((module: any, index: number) => (\r\n <MenuItem\r\n className=\"select-box-menu-item\"\r\n value={module.link}\r\n key={index}\r\n >\r\n <img src={module.icon} alt={module.label} />\r\n {module.label}\r\n </MenuItem>\r\n ))}\r\n </Select>\r\n </Box>\r\n </>\r\n )}\r\n </Box>\r\n <Box className=\"header-right-wrap\">\r\n {/* Language Selector with Enhanced Fallback Support */}\r\n <Box className=\"language-selector-wrapper\">\r\n {renderLanguageSelector()}\r\n </Box>\r\n\r\n {/* <IconButton\r\n size=\"small\"\r\n aria-label=\"notification bell\"\r\n className=\"p-0\"\r\n >\r\n <img src={logo.notification} alt=\"notification icon\" />\r\n </IconButton> */}\r\n <NotificationMenu />\r\n <IconButton\r\n size=\"small\"\r\n aria-label=\"help\"\r\n className=\"p-0\"\r\n >\r\n <img src={logo.question} alt=\"question icon\" />\r\n </IconButton>\r\n <img src={logo.vdivider} alt=\"divider icon\" />\r\n {localStorage.getItem(\"_tid\") ? (\r\n <Box className=\"user-profile-box\" onClick={handleProfileMenuOpen}>\r\n <Avatar\r\n size={32}\r\n src={user?.profile_image ? `${config?.s3BucketUrl}${user?.profile_image}` : undefined}\r\n alt={formatText(user?.full_name)}\r\n className=\"avatar-class\"\r\n />\r\n <div>\r\n <Typography className=\"profile-name\">\r\n {user?.full_name}\r\n </Typography>\r\n <Typography className=\"user-auth\">\r\n {user?.role_name}\r\n </Typography>\r\n </div>\r\n </Box>\r\n ) : (\r\n <IconButton\r\n size=\"large\"\r\n edge=\"end\"\r\n aria-label=\"account of current user\"\r\n aria-controls={menuId}\r\n aria-haspopup=\"true\"\r\n component={Link}\r\n to={Pathname.LOGIN}\r\n color=\"inherit\"\r\n >\r\n <LockIcon className=\"icon-btn\" />\r\n </IconButton>\r\n )}\r\n </Box>\r\n {renderMenu}\r\n </Box>\r\n\r\n {/* Logout Confirmation Dialog */}\r\n <ConfirmPopUp\r\n open={logoutConfirmation}\r\n title={t(\"common.logout\")}\r\n description={t('common.logout_confirmation') || \"Are you sure, you want to logout?\"}\r\n onConfirm={() => logout()}\r\n onClose={handleLogoutConfirmation}\r\n fullWidth\r\n maxWidth=\"xs\"\r\n buttonTexts={{\r\n confirm: t(\"common.logout\"),\r\n cancel: t(\"common.cancel\"),\r\n }}\r\n />\r\n\r\n <ResetPasswordModal showModal={showModal} setShowModal={setShowModal} />\r\n\r\n </>\r\n );\r\n}\r\n\r\nexport default Header;","import { styled } from \"@mui/material/styles\";\nimport MuiAppBar, { AppBarProps as MuiAppBarProps } from \"@mui/material/AppBar\";\nimport Toolbar from \"@mui/material/Toolbar\";\n// import MenuIcon from \"@mui/icons-material/Menu\";\nimport IconButton from \"@mui/material/IconButton\";\n\n// import { Box, FormControl, FormControlLabel, FormLabel, Radio, RadioGroup, ThemeProvider } from '@mui/material';\n\nimport Header from \"../header/header\";\n// import ThemeSelector from \"../../utils/themeSelector\";\n\nimport \"./appbar.scss\";\nimport images from \"../../assets/images\";\n// import { Box } from \"@mui/material\";\n\nlet drawerWidth: any;\n\ninterface AppBarProps extends MuiAppBarProps {\n open?: boolean;\n}\n\n// const getTheme = (selectedTheme: any) => {\n// switch (selectedTheme) {\n// case ThemeSelector.PRIMARY:\n// return themes.redStone;\n// case ThemeSelector.SECONDARY:\n// return themes.blueNavy;\n// case ThemeSelector.TERTIARY:\n// return themes.oliveGreen;\n// default:\n// return themes.redStone;\n// }\n// };\n\nconst AppBar = styled(MuiAppBar, {\n shouldForwardProp: (prop) => prop !== \"open\",\n})<AppBarProps>(({ theme, open }) => ({\n zIndex: theme.zIndex.drawer + 1,\n transition: theme.transitions.create([\"width\", \"margin\"], {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.leavingScreen,\n }),\n ...(open && {\n marginLeft: document.body.dir === \"ltr\" ? drawerWidth : 0,\n marginRight: document.body.dir === \"rtl\" ? drawerWidth : 0,\n width: `calc(100% - ${drawerWidth}px)`,\n transition: theme.transitions.create([\"width\", \"margin\"], {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.enteringScreen,\n }),\n }),\n boxShadow: \"none\",\n}));\n\nexport const AppBarWrapper = (props: any) => {\n drawerWidth = props.width;\n\n // const handleThemeChange = (e: any) => setSelectedTheme(e.target.value);\n\n return (\n <AppBar\n position=\"fixed\"\n open={props?.open}\n sx={(theme) => ({\n borderBottom: \"1px solid\",\n borderColor: theme.palette.theme?.secondary[200],\n backgroundColor: theme.palette.theme?.secondary[100],\n })}\n >\n {/* <FormControl>\n <FormLabel id=\"theme-radio-buttons-group-label\">Theme</FormLabel>\n <RadioGroup\n row\n value={selectedTheme}\n onChange={handleThemeChange}\n aria-labelledby=\"theme-radio-buttons-group-label\"\n name=\"row-radio-buttons-group\"\n >\n {Object.keys(ThemeSelector)?.map((variant: any, index: any) => (\n <FormControlLabel\n key={index}\n value={ThemeSelector[variant]}\n control={<Radio />}\n label={ThemeSelector[variant]}\n sx={{\n '.MuiFormControlLabel-label': {\n color: 'theme.text',\n },\n }}\n />\n ))}\n </RadioGroup>\n </FormControl> */}\n <Toolbar sx={{ backgroundColor: 'grey.100'}}>\n {props?.handleDrawerOpen ? (\n <>\n <IconButton\n color=\"inherit\"\n aria-label=\"open drawer\"\n // onClick={props.handleDrawerOpen}\n edge=\"start\"\n sx={{\n marginRight: 5,\n ...(props.open && { display: \"none\" }),\n }}\n >\n {/* <MenuIcon sx={{ color: \"theme.secondary.1000\" }} /> */}\n <img src={images.favicon} height={30} width={30}></img>\n </IconButton>\n {/* {!props.open && ( \n <Box marginRight={5}>\n <img src={images.favicon} height={30} width={30}></img>\n </Box>\n )} */}\n <Header isDropdownShow={true} />\n </>\n ) : (\n <>\n <Header isDropdownShow={false} />\n </>\n )}\n </Toolbar>\n {/* <Header /> */}\n </AppBar>\n );\n};\n\nexport default AppBarWrapper;\n","import Box from \"@mui/material/Box\";\r\nimport \"./activityArea.scss\";\r\n\r\nexport const ActivityArea = (props: any) => {\r\n return (\r\n <Box\r\n className=\"main-wrapper\"\r\n component=\"main\"\r\n width={\"100%\"}\r\n // sx={{ flexGrow: 1, p: 3, flexWrap: \"wrap\" }}\r\n marginTop=\"4.6875rem\"\r\n >\r\n {props.children}\r\n </Box>\r\n );\r\n};\r\n\r\nexport default ActivityArea;\r\n"],"names":["StyledButton","styled","MUIButton","theme","palette","fontSize","textTransform","minHeight","minWidth","padding","fontWeight","lineHeight","letterSpacing","backgroundColor","_a","primary","_b","border","boxShadow","color","_c","_d","secondary","_e","_f","error","_g","opacity","Button","props","children","variant","rest","jsx","StyledDialog","Dialog","borderRadius","display","alignItems","justifyContent","Modal","open","onClose","StyledSearch","TextField","borderBottom","input","paddingLeft","SelectSearch","forwardRef","searchPlaceholder","handleSearch","value","ref","inputRef","placeholder","onChange","fullWidth","InputProps","startAdornment","InputAdornment","position","SearchIcon","StyledSelect","MUISelect","borderColor","borderWidth","background","_h","_i","Select","memo","searchInputRef","useRef","label","dataPosition","dataName","required","searchValue","renderValue","helperText","loading","CustomDropdownIcon","ArrowDown","jsxs","Fragment","Typography","type","weight","mb","style","IconComponent","iconProps","MenuProps","PaperProps","sx","maxHeight","overflowY","anchorOrigin","vertical","horizontal","displayEmpty","onOpen","setTimeout","current","focus","Box","top","zIndex","margin","e","target","onClick","stopPropagation","onKeyDown","p","width","CircularProgress","size","FormHelperText","StyledTextField","MUITextField","borderStyle","marginLeft","_j","_k","marginRight","hidden","className","DynamicInput","React","Controller","control","formControl","name","fieldArrayName","render","field","fieldState","defaultValue","replace","shouldApplyPrecission","includes","step","float_step","decimalPlaces","String","split","length","console","log","Number","toFixed","toString","multiline","is_multiline","minRows","formType","minLength","min","endAdornment","endIcon","IconButton","edge","onIconClick","inputProps","min_length","disabled","Boolean","message","onBlur","o","n","a","s","i","c","Promise","resolve","t","r","u","context","process","env","NODE_ENV","warn","mode","Object","assign","abortEarly","then","shouldUseNativeValidation","values","raw","errors","inner","criteriaMode","reduce","path","types","concat","reject","propTypes","PropTypes","shape","register","func","isRequired","setValue","_formState","object","string","node","bool","number","max","max_length","typeOfField","defaultProps","ConfirmPopUp","useTranslation","title","description","onConfirm","modalType","buttonTexts","confirm","cancel","buttonColors","showAction","icon","images","info","alert","isRtl","useLanguage","DialogTitle","src","alt","ml","disableRipple","CloseIcon","Divider","DialogContent","DialogActions","mr","StyledAlert","MUIAlert","height","Toast","handleUndo","handleClose","action","Close","Snackbar","autoHideDuration","severity","CheckCircleOutlineIcon","htmlColor","WarningAmberIcon","Avatar","badge","altIcon","avatarStyle","badgeSize","badgeBorder","altFirstChar","map","word","charAt","join","AvatarMUI","SvgIcon","Person2OutlinedIcon","validationSchema","Yup","login","current_password","password","matches","confirm_password","oneOf","ResetPasswordModal","showModal","setShowModal","changeUserPassword","useAuth","toast","setToast","useState","handleSubmit","trigger","useForm","resolver","yupResolver","onSubmit","async","showPassword","setShowPassword","showCurrentPassword","setShowCurrentPassword","showConfirmPassword","setShowConfirmPassword","FlexBox","flexDirection","gap","align","Eye","EyeOff","mainModuleIcons","rbac","user","document","accounting","inventory","manufacturing","sales","crm","rental","purchase","procurement","hrms","mainModuleBgColors","NotificationMenu","anchorEl","setAnchorEl","notifications","setNotifications","setLoading","loadingMore","setLoadingMore","setError","unreadCount","setUnreadCount","markingAllAsRead","setMarkingAllAsRead","pagination","setPagination","skip","limit","totalCount","hasMore","navigate","useNavigate","menuRef","isLoadingMoreRef","transformNotification","apiNotification","moduleIcons","AccountBalanceIcon","PersonIcon","approval","AssignmentIcon","subData","sub_module_data","id","notification_type","formatText","timestamp","dateString","date","Date","diffMs","diffMins","Math","floor","diffHours","diffDays","toLocaleDateString","formatTimestamp","created_at","read","status","avatar","performedUser","firstName","first_name","lastName","last_name","toUpperCase","getInitials","performed_user","performedByName","trim","module","subModule","sub_module","subModuleId","sub_module_id","seriesNumber","series_number","documentStatus","customerName","customer_name","fetchNotifications","useCallback","isLoadMore","prev","currentSkip","response","getV1Notification","getToken","success","data","Error","transformedNotifications","newSkip","unread","err","handleScroll","event","scrollTop","scrollHeight","clientHeight","getNotificationIcon","notification","EmailIcon","WarningIcon","CheckCircleIcon","handleMarkAllAsRead","enqueueSnackbar","getV1NotificationMarkAllAsRead","m","getErrorMessage","useEffect","getPerformerLabel","toLowerCase","getStatusIcon","CancelIcon","HourglassEmptyIcon","currentTarget","Badge","badgeContent","Notification","Menu","slotProps","paper","overflow","maxWidth","content","right","bgcolor","transform","grey","transformOrigin","onScroll","px","py","startIcon","Tick","Skeleton","Alert","MenuItem","notificationId","find","patchV1NotificationMarkAsReadId","url","moduleName","moduleId","notificationData","routeMap","sales_invoice","generateRouteWithId","PathnameGenerator","PathnameAccounting","VIEW_SALES_INVOICES","asset_transfers","VIEW_ASSET_TRANSFER","budgets","VIEW_BUDGET","cash_expense","VIEW_CASH_EXPENSE","credit_notes","VIEW_CREDIT_NOTE","debit_notes","VIEW_DEBIT_NOTE","expense_reimbursement","VIEW_EXPENSE_REIMBURSEMENT","journal_entries","VIEW_JOURNAL_ENTRY","payment_entries","VIEW_PAYMENT_ENTRY","purchase_invoice","VIEW_PURCHASE_INVOICE","stock_transfer","PathnameGeneratorInventory","PathnameInventory","VIEW_STOCK_TRANSFER","bills_of_materials","PathnameGeneratorManufacuring","PathnameManufacturing","VIEW_BILL_OF_MATERIAL","purchase_agreement","PathnameGeneratorPurchase","PathnamePurchase","VIEW_PURCHASE_AGREEMENT","purchase_orders","is_rental","RENTALROUTES","VIEW","VIEW_PURCHASE_ORDER","purchase_request","vra","VIEW_VENDOR_RETURNS","sales_customer_returns","PathnameGeneratorCrm","PathnameCrm","VIEW_CUSTOMER_RETURNS","sales_order","VIEW_SALES_ORDER","rental_order","PathnameGeneratorRental","PathnameRental","VIEW_RENTAL_ORDER","replacement_order","rental_agreement","VIEW_AGREEMENT","cross_hire_order","VIEW_CROSS_HIRE_ORDER","cross_hire_request","VIEW_CROSS_HIRE_REQUEST","convertToUnderscore","call","getNotificationUrl","handleNotificationClick","marginBottom","ListItemAvatar","mt","objectFit","ListItemText","pr","flexWrap","component","flexShrink","textAlign","Header","location","useLocation","logout","config","getApiConfig","languages","currentLanguage","changeLanguage","isLoading","languagesLoading","languageContextError","isFallbackActive","fetchLanguages","pathname","logoutConfirmation","setLogoutConfirmation","localLanguageError","setLocalLanguageError","u_data","localStorage","getItem","userData","JSON","parse","isMenuOpen","handleLogoutConfirmation","checkMatchedRoutes","paths","shouldMatch","Array","isArray","matchRoutes","erp_modules","useMemo","modules","selectedModule","link","connectedRoutes","onChangeLang","lang_code","errorMsg","some","lang","code","language","handleRetryLanguages","menuId","renderMenu","keepMounted","role_id","ListItemIcon","role_name","tickicon","appLogo","logo","isDropdownShow","Link","to","Pathname","DASHBOARD","LOGIN","window","history","back","KeyboardBackspaceIcon","selectedLink","index","availableLanguages","direction","displayValue","fontStyle","renderLanguageSelector","question","vdivider","profile_image","s3BucketUrl","full_name","LockIcon","drawerWidth","AppBar","MuiAppBar","shouldForwardProp","prop","drawer","transition","transitions","create","easing","sharp","duration","leavingScreen","body","dir","enteringScreen","marginTop","Toolbar","handleDrawerOpen","favicon","debounceTime","isDrivePage","searchText","searchTerm","setSearchTerm","debouncedSearchRef","initialSearchTerm","setItem","debounce","autoComplete","SearchStatus","Search","MUITooltip","componentsProps","tooltip"],"mappings":"0pDAEMA,EAAeC,EAAAA,OAAOC,SAAPD,CACpB,EAAGE,OAASC,iCAAmC,MAAA,CAC9CC,SAAU,UACVC,cAAe,OACfC,UAAW,OACXC,SAAU,OACVC,QAAS,iBACTC,WAAY,MACZC,WAAY,UACZC,cAAe,cAEf,wBAAyB,CACxBC,gBAAiB,OAGlB,wBAAyB,CACxBA,gBAAiB,OAAAC,EAAAV,EAAQD,YAAR,EAAAW,EAAeC,QAAQ,KAExC,UAAW,CACVF,gBAAiB,OAAAG,EAAAZ,EAAQD,YAAR,EAAAa,EAAeD,QAAQ,OAI1C,uBAAwB,CACvBE,OAAQ,OACRC,UAAW,4GACXC,MAAO,OAAAC,EAAAhB,EAAQD,YAAR,EAAAiB,EAAeL,QAAQ,MAG/B,mBAAoB,CACnBI,MAAO,OAAAE,EAAAjB,EAAQD,YAAR,EAAAkB,EAAeC,UAAU,KAChCT,gBAAiB,QACjB,UAAW,CACVM,MAAO,OAAAI,EAAAnB,EAAQD,YAAR,EAAAoB,EAAeR,QAAQ,MAE/B,yBAA0B,CAAA,GAK3B,6BAA8B,CAC7BF,gBAAiB,OAAAW,EAAApB,EAAQD,YAAR,EAAAqB,EAAeC,MAAM,KACtC,UAAW,CACVZ,gBAAiB,OAAAa,EAAAtB,EAAQD,YAAR,EAAAuB,EAAeD,MAAM,OAIxC,iBAAkB,CACjBE,QAAS,OAKN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AIjC4kB,EAAmBxhB,SACrBwhB,EAAmBxhB,QAAQpD,IAmBzB8D,UAfiByS,IACrBA,EAAM1S,mBAeFD,QAZe2S,IACnBA,EAAM1S,mBAYFmhB,aAAa,MACb1kB,gBACI1B,MAENC,IAAC,OAAA,CAAK+F,UAAU,cAEZlG,SAAAgmB,EACA7lB,EAAAA,IAAComB,EAAAA,aAAA,CAAahoB,SAAS,QAAQ0F,GAAI,CAAE5E,MAAO2mB,EAAa,WAAY,cACrE7lB,EAAAA,IAACqmB,EAAAA,OAAA,CAAOjoB,SAAS,QAAQ0F,GAAI,CAAE5E,MAAO2mB,EAAa,WAAY,0FInHzD,EAAGha,QAAOhM,WAAUiE,QAAO/D,KAEvCC,EAAAA,IAACsmB,EAAAA,QAAA,CACCC,gBAAiB,CACfC,QAAS,CACP1iB,GAAI,CACFtF,QAAS,iBACTI,gBAAiB,UACjB0a,SAAU,QACV,sBAAuB,CACrBpa,MAAO,cAEN4E,KAIT+H,WACI9L,EAEHF","x_google_ignoreList":[7]}
|
|
1
|
+
{"version":3,"file":"appbar-C6Es9HGk.js","sources":["../../src/components/button/button.tsx","../../src/components/modal/modal.tsx","../../src/components/select/select-search.tsx","../../src/components/select/select.tsx","../../src/components/search-bar/search-bar.tsx","../../src/components/text-field/text-field.tsx","../../src/components/form-control/form-builder/form-builder-element/text.tsx","../../node_modules/@hookform/resolvers/yup/dist/yup.mjs","../../src/components/tooltip/Tooltip.tsx","../../src/components/confirm-modal/confirm-modal.tsx","../../src/components/toast/toast.tsx","../../src/components/avatar/avatar.tsx","../../src/components/reset-password-modal/reset-password-modal.tsx","../../src/components/header/components/notification-menu/notification-menu.tsx","../../src/components/header/header.tsx","../../src/components/appbar/appbar.tsx","../../src/components/activityArea/activityArea.tsx"],"sourcesContent":["import { Button as MUIButton, ButtonProps, styled } from '@mui/material';\r\n\r\nconst StyledButton = styled(MUIButton)(\r\n\t({ theme: { palette, } /* , variant */ }) => ({\r\n\t\tfontSize: '.875rem',\r\n\t\ttextTransform: 'none',\r\n\t\tminHeight: '0rem',\r\n\t\tminWidth: '0rem',\r\n\t\tpadding: '0.25rem .75rem',\r\n\t\tfontWeight: '500',\r\n\t\tlineHeight: '1.25rem',\r\n\t\tletterSpacing: '-0.01875rem',\r\n\r\n\t\t'&.MuiButton-startIcon': {\r\n\t\t\tbackgroundColor: 'red'\r\n\t\t},\r\n\r\n\t\t'&.MuiButton-contained': {\r\n\t\t\tbackgroundColor: palette.theme?.primary[700],\r\n\t\t\t// boxShadow: '0px 0px 2px 0px #E0E0E0, 0px 1px 4px -2px rgba(24, 39, 75, 0.02), 0px 4px 4px -2px rgba(24, 39, 75, 0.06)',\r\n\t\t\t'&:hover': {\r\n\t\t\t\tbackgroundColor: palette.theme?.primary[800]\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t'&.MuiButton-outlined': {\r\n\t\t\tborder: 'none',\r\n\t\t\tboxShadow: '0px 0px 2px 0px #E0E0E0, 0px 1px 4px -2px rgba(24, 39, 75, 0.02), 0px 4px 4px -2px rgba(24, 39, 75, 0.06)',\r\n\t\t\tcolor: palette.theme?.primary[700]\r\n\t\t},\r\n\r\n\t\t'&.MuiButton-text': {\r\n\t\t\tcolor: palette.theme?.secondary[1000],\r\n\t\t\tbackgroundColor: 'white',\r\n\t\t\t'&:hover': {\r\n\t\t\t\tcolor: palette.theme?.primary[700]\r\n\t\t\t},\r\n\t\t\t'& .MuiButton-startIcon': {\r\n\t\t\t\t// background: palette.theme?.primary[400],\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t'&.MuiButton-containedError': {\r\n\t\t\tbackgroundColor: palette.theme?.error[500],\r\n\t\t\t'&:hover': {\r\n\t\t\t\tbackgroundColor: palette.theme?.error[600]\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t'&.Mui-disabled': {\r\n\t\t\topacity: 0.5\r\n\t\t}\r\n\t})\r\n);\r\n\r\nconst Button = (props: ButtonProps) => {\r\n\tconst { children, variant = 'contained', ...rest } = props;\r\n\r\n\treturn (\r\n\t\t<StyledButton variant={variant} {...rest}>\r\n\t\t\t{children}\r\n\t\t</StyledButton>\r\n\t);\r\n};\r\n\r\nexport { Button };\r\nexport default Button;\r\n","import { Dialog, DialogProps, styled } from \"@mui/material\";\r\n\r\nconst StyledDialog = styled(Dialog)(() => ({\r\n \".MuiDialog-paper\": {\r\n borderRadius: \"1rem\",\r\n },\r\n\r\n \".MuiDialogTitle-root\": {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"space-between\",\r\n padding: \"0.5rem 1.5rem\",\r\n },\r\n\r\n \".MuiDialogContent-root\": {\r\n padding: \"1.5rem\",\r\n },\r\n\r\n \".MuiDialogActions-root\": {\r\n padding: \"0.5rem 1rem\",\r\n },\r\n}));\r\n\r\nconst Modal = ({ children, open, onClose, ...rest }: DialogProps) => {\r\n return (\r\n <StyledDialog open={open} onClose={onClose} {...rest}>\r\n {children}\r\n </StyledDialog>\r\n );\r\n};\r\n\r\nexport { Modal };\r\nexport default Modal;\r\n","/* eslint-disable @typescript-eslint/no-unused-vars */\r\n/* eslint-disable unused-imports/no-unused-imports */\r\nimport { InputAdornment, TextField, styled } from \"@mui/material\";\r\nimport SearchIcon from \"@mui/icons-material/Search\";\r\nimport React, { forwardRef } from 'react';\r\n\r\nconst StyledSearch = styled(TextField)(({ theme: { palette } }) => ({\r\n padding: \"0rem 0.75rem 0.5rem 0.75rem\",\r\n borderBottom: `1px solid ${palette.theme?.secondary[200]}`,\r\n input: {\r\n padding: \"0.5rem 0rem\",\r\n },\r\n \".MuiOutlinedInput-notchedOutline\": {\r\n border: 0,\r\n },\r\n \"& .MuiOutlinedInput-root\": {\r\n fontSize: \"0.8125rem\",\r\n paddingLeft: \"0.5rem\",\r\n color: palette.theme?.secondary[800],\r\n // backgroundColor: palette.theme?.secondary[200],\r\n border: \"1px solid #F5F6F5\",\r\n borderRadius: \"0.5rem\",\r\n \":hover .MuiOutlinedInput-notchedOutline\": {\r\n border: 1,\r\n },\r\n \"&.Mui-focused fieldset\": {\r\n border: 0,\r\n },\r\n },\r\n}));\r\n\r\nconst SelectSearch = forwardRef<HTMLInputElement, any>(\r\n ({ searchPlaceholder, handleSearch, value, ...rest }, ref) => (\r\n <StyledSearch\r\n inputRef={ref} // Attach the ref here for focusing\r\n placeholder={searchPlaceholder}\r\n onChange={handleSearch}\r\n value={value}\r\n fullWidth\r\n variant=\"outlined\"\r\n InputProps={{\r\n startAdornment: (\r\n <InputAdornment position=\"start\">\r\n <SearchIcon fontSize=\"small\" />\r\n </InputAdornment>\r\n ),\r\n }}\r\n {...rest}\r\n />\r\n )\r\n);\r\n\r\nexport { SelectSearch };\r\nexport default SelectSearch;\r\n","/* eslint-disable no-mixed-spaces-and-tabs */\r\n\r\nimport {\r\n Box,\r\n\tCircularProgress,\r\n\tFormHelperText,\r\n\tSelect as MUISelect,\r\n\tstyled\r\n} from '@mui/material';\r\nimport Typography from '../typography/typography';\r\nimport SelectSearch from './select-search';\r\nimport { memo, useRef } from 'react';\r\nimport './controller/controller-select.scss'\r\nimport { ArrowDown } from '../icons';\r\nconst StyledSelect = styled(MUISelect)(({ theme: { palette } }) => ({\r\n\tcolor: palette.theme?.secondary[800],\r\n\tfontSize: ' 0.875rem',\r\n\t'.MuiOutlinedInput-notchedOutline': {\r\n\t\tborderColor: palette.theme?.secondary[300]\r\n\t},\r\n\t'&.Mui-focused .MuiOutlinedInput-notchedOutline': {\r\n\t\tborderWidth: '0.0625rem',\r\n\t\tborderColor: palette.theme?.primary[700]\r\n\t},\r\n\t'&.Mui-focused.Mui-error .MuiOutlinedInput-notchedOutline': {\r\n\t\tborderWidth: '0.0625rem',\r\n\t\tborderColor: palette.theme?.error[600]\r\n\t},\r\n\t'&:hover .MuiOutlinedInput-notchedOutline': {\r\n\t\tborderColor: palette.theme?.secondary[400]\r\n\t},\r\n\t'&.Mui-error:hover .MuiOutlinedInput-notchedOutline': {\r\n\t\tborderColor: palette.theme?.error[600]\r\n\t},\r\n\t'&.Mui-disabled': {\r\n\t\tbackground: palette.theme?.secondary[200],\r\n\t\tcolor: palette.theme?.secondary[800]\r\n\t},\r\n\r\n\t'.MuiMenuItem-root': {\r\n\t\tfontSize: '10px'\r\n\t},\r\n\t'&.Mui-error': {\r\n\t\tcolor: palette.theme?.error[600],\r\n\t\t'&fieldset': {\r\n\t\t\tborderColor: 'grey'\r\n\t\t}\r\n\t}\r\n}));\r\n\r\nconst Select = memo((props: any) => {\r\n\tconst searchInputRef = useRef<HTMLInputElement>(null);\r\n\tconst {\r\n\t\tchildren,\r\n\t\tlabel,\r\n\t\thandleSearch,\r\n\t\tdataPosition,\r\n\t\tdataName,\r\n\t\tplaceholder,\r\n\t\tsearchPlaceholder,\r\n\t\trequired,\r\n\t\tsearchValue,\r\n\t\tfullWidth = false,\r\n\t\tonChange,\r\n\t\trenderValue,\r\n\t\terror,\r\n\t\thelperText,\r\n\t\tloading = false,\r\n\t\tCustomDropdownIcon = ArrowDown,\r\n\t\t...rest\r\n\t} = props;\r\n\r\n\t\r\n\tconst handleOpen = () => {\r\n setTimeout(() => {\r\n if (searchInputRef.current) {\r\n searchInputRef.current.focus(); // Focus the search input\r\n }\r\n }, 0);\r\n };\r\n\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{label && (\r\n\t\t\t\t<Typography\r\n\t\t\t\t\ttype='s5'\r\n\t\t\t\t\tweight='medium'\r\n\t\t\t\t\tdata-position={dataPosition}\r\n\t\t\t\t\tdata-name={dataName}\r\n\t\t\t\t\tmb={0.5}\r\n\t\t\t\t\tcolor={error ? 'theme.error.600' : 'theme.secondary.800'}>\r\n\t\t\t\t\t{label} {required && <span style={{ color: '#c64d4d' }}>*</span>}\r\n\t\t\t\t</Typography>\r\n\t\t\t)}\r\n<StyledSelect\r\n IconComponent={(iconProps) => <CustomDropdownIcon {...iconProps} fontSize='small' />}\r\n MenuProps={{\r\n PaperProps: {\r\n sx: {\r\n maxHeight: 300, // Scrollable area for dropdown\r\n overflowY: 'auto',\r\n },\r\n },\r\n anchorOrigin: {\r\n vertical: 'bottom',\r\n horizontal: 'center',\r\n },\r\n }}\r\n displayEmpty\r\n fullWidth={fullWidth}\r\n renderValue={\r\n renderValue ??\r\n ((value: any) =>\r\n value !== '' ? (\r\n (value as any)\r\n ) : (\r\n <Typography color='inherit' type='s3'>\r\n {placeholder}\r\n </Typography>\r\n ))\r\n }\r\n onChange={onChange}\r\n error={error}\r\n\tonOpen={handleOpen} \r\n {...rest}\r\n>\r\n {handleSearch && (\r\n <Box\r\n sx={{\r\n position: 'sticky',\r\n top: 0,\r\n zIndex: 1, // Ensure it's above the dropdown items\r\n backgroundColor: '#fff',\r\n // padding: '0.5rem',\r\n\t\t\t\tmargin: '-4px -4px 0 -4px',\r\n\t\t\t\tmb: 0.5\r\n }}\r\n >\r\n <SelectSearch\r\n\t\t\t\tref={searchInputRef}\r\n searchPlaceholder={searchPlaceholder}\r\n handleSearch={(e: any) => handleSearch(e.target.value)}\r\n value={searchValue}\r\n onClick={(e) => e.stopPropagation()}\r\n onKeyDown={(e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tif (props?.value) {\r\n\t\t\t\t\t\tsetTimeout(() => searchInputRef.current?.focus(), 0); \r\n\t\t\t\t\t}\r\n\t\t \t}}\r\n\t\t\t\tsx={{\r\n\t\t\t\t\tp: 1,\r\n\t\t\t\t}}\r\n />\r\n </Box>\r\n )}\r\n {loading ? (\r\n <Box\r\n sx={{\r\n display: 'flex',\r\n width: '100%',\r\n p: 2,\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n }}\r\n >\r\n <CircularProgress size={30} color='inherit' />\r\n </Box>\r\n ) : (\r\n children\r\n )}\r\n</StyledSelect>\r\n\r\n\t\t\t{helperText && <FormHelperText error={error}>{helperText}</FormHelperText>}\r\n\t\t</>\r\n\t);\r\n});\r\n\r\nexport { Select };\r\nexport default Select;\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport { debounce } from \"lodash\";\r\nimport React, { useState, useEffect, useRef } from \"react\";\r\nimport { SxProps, TextField, styled, Theme } from \"@mui/material\";\r\n// import images from \"../../assets/images\";\r\n\r\nimport \"./search-bar.scss\";\r\nimport { Search, SearchStatus } from \"../icons\";\r\n\r\nconst StyledSearch = styled(TextField)(({ theme: { palette } }) => ({\r\n \"&.MuiTextField-root\": {\r\n backgroundColor: palette.theme?.secondary[200],\r\n borderRadius: \"0.5rem\",\r\n padding: \"0.375rem 0.75rem\",\r\n },\r\n \"& .MuiOutlinedInput-input\": {\r\n fontSize: \"0.875rem\",\r\n padding: \"0rem\",\r\n paddingLeft: \"1.375rem\",\r\n },\r\n \".MuiOutlinedInput-notchedOutline\": {\r\n border: \"none\",\r\n },\r\n}));\r\n\r\ninterface ISearchBar {\r\n placeholder?: string;\r\n handleSearch: (key: string) => void;\r\n debounceTime?: number;\r\n className?: string;\r\n InputProps?: any;\r\n sx?: SxProps<Theme>;\r\n isDrivePage?: boolean;\r\n searchText?:string\r\n}\r\n\r\nconst SearchBar = ({\r\n handleSearch,\r\n debounceTime = 300,\r\n className,\r\n InputProps,\r\n isDrivePage,\r\n searchText,\r\n value = '',\r\n ...rest\r\n}: ISearchBar) => {\r\n const [searchTerm, setSearchTerm] = useState(\"\");\r\n\r\n const debouncedSearchRef = useRef<(value: string) => void>();\r\n\r\n // Set `searchTerm` from localStorage on mount and clear `localStorage` if needed\r\n useEffect(() => {\r\n const initialSearchTerm = isDrivePage ? localStorage.getItem(\"searchTerm\") || \"\" : \"\";\r\n setSearchTerm(initialSearchTerm);\r\n\r\n // Set `localStorage` to an empty string on the first render\r\n if (isDrivePage) {\r\n localStorage.setItem(\"searchTerm\", \"\");\r\n }\r\n }, [isDrivePage]);\r\n\r\n useEffect(() => {\r\n setSearchTerm((typeof searchText=='string' && searchText) || '')\r\n }, [searchText])\r\n\r\n // Initialize the debounced function only once\r\n useEffect(() => {\r\n debouncedSearchRef.current = debounce((value: string) => handleSearch(value), debounceTime);\r\n \r\n // Cleanup function to cancel debounced call on component unmount\r\n return () => {\r\n debouncedSearchRef.current?.cancel();\r\n };\r\n }, [handleSearch, debounceTime]);\r\n\r\n useEffect(() => {\r\n setSearchTerm(value || '')\r\n }, [])\r\n\r\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n const value = e.target.value;\r\n setSearchTerm(value);\r\n if (isDrivePage) {\r\n localStorage.setItem(\"searchTerm\", value);\r\n }\r\n\r\n // Call the debounced search function\r\n if (debouncedSearchRef.current) {\r\n debouncedSearchRef.current(value);\r\n }\r\n };\r\n\r\n const handleKeyDown = (event: any) => {\r\n event.stopPropagation();\r\n };\r\n\r\n const handleClick = (event: any) => {\r\n event.stopPropagation();\r\n };\r\n\r\n return (\r\n <div className={`${className} search-wrapper`}>\r\n <StyledSearch\r\n fullWidth\r\n className=\"s3\"\r\n value={searchTerm}\r\n onChange={handleChange}\r\n onKeyDown={handleKeyDown}\r\n onClick={handleClick}\r\n autoComplete=\"off\"\r\n InputProps={InputProps}\r\n {...rest}\r\n />\r\n <span className=\"search-icon\">\r\n {\r\n searchTerm ?\r\n <SearchStatus fontSize=\"small\" sx={{ color: searchTerm ? \"grey.900\": \"grey.700\" }}/> : \r\n <Search fontSize=\"small\" sx={{ color: searchTerm ? \"grey.900\": \"grey.700\" }}/>\r\n }\r\n </span>\r\n {/* <img src={images.search} alt=\"search icon\" /> */}\r\n </div>\r\n );\r\n};\r\n\r\nexport { SearchBar };\r\nexport default SearchBar;\r\n","import {\r\n TextField as MUITextField,\r\n // TextFieldProps,\r\n styled,\r\n} from \"@mui/material\";\r\nimport \"./text-field.scss\";\r\nimport Typography from \"../typography/typography\";\r\nimport { memo } from \"react\";\r\n\r\nconst StyledTextField = styled(MUITextField)(({ theme: { palette } }) => ({\r\n \"& .MuiOutlinedInput-root\": {\r\n padding: \"0\",\r\n color: palette.theme?.secondary[800],\r\n \"& fieldset\": {\r\n borderColor: palette.theme?.secondary[400],\r\n },\r\n \"&:hover fieldset\": {\r\n borderColor: palette.theme?.secondary[500],\r\n },\r\n \"&.Mui-focused fieldset\": {\r\n borderWidth: \"0.0625rem\",\r\n borderStyle: \"solid\",\r\n borderColor: palette.theme?.primary[700],\r\n },\r\n \"&.Mui-error fieldset\": {\r\n borderColor: palette.theme?.error[600],\r\n },\r\n \"&.Mui-error .MuiInputBase-input::placeholder\": {\r\n color: palette.theme?.error[600],\r\n },\r\n \"&.Mui-disabled\": {\r\n background: palette.theme?.secondary[200],\r\n color: palette.theme?.secondary[800],\r\n },\r\n \"& .MuiInputBase-input::placeholder\": {\r\n color: palette.theme?.secondary[800],\r\n opacity: 1,\r\n },\r\n },\r\n \"& .MuiFormHelperText-root\": {\r\n marginLeft: 0,\r\n color: palette.theme?.secondary[800],\r\n \"&.Mui-error\": {\r\n color: palette.theme?.error[600],\r\n },\r\n },\r\n \"& .MuiIconButton-root\": {\r\n marginRight: 0,\r\n },\r\n}));\r\n\r\nconst TextField = memo((props: any) => {\r\n const {\r\n required,\r\n placeholder,\r\n label,\r\n error = false,\r\n dataPosition,\r\n dataName,\r\n hidden,\r\n ...rest\r\n } = props;\r\n return (\r\n <>\r\n {label && !hidden && (\r\n <Typography\r\n type=\"s5\"\r\n weight={\"medium\"}\r\n mb={0.5}\r\n color={error ? \"theme.error.600\" : \"theme.secondary.800\"}\r\n data-position={dataPosition}\r\n data-name={dataName}\r\n >\r\n {label} {required && <span className=\"requiredStar\">*</span>}\r\n </Typography>\r\n )}\r\n <StyledTextField\r\n error={error}\r\n placeholder={placeholder}\r\n className=\"textfield\"\r\n hidden={hidden}\r\n {...rest}\r\n />\r\n </>\r\n );\r\n});\r\n\r\nexport { TextField };\r\nexport default TextField;\r\n","import { Controller } from \"react-hook-form\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nimport TextField from \"../../../text-field/text-field\";\r\n\r\nimport \"./element.scss\";\r\nimport { IconButton, InputAdornment } from \"@mui/material\";\r\nimport React from \"react\";\r\n\r\nconst DynamicInput = React.memo((props: any) => {\r\n\r\n return (\r\n <Controller\r\n control={props.formControl}\r\n name={`${props.fieldArrayName}.${props.name}`}\r\n // defaultValue={props.defaultValue || \"\"}\r\n render={({ field, fieldState }) => (\r\n <TextField\r\n {...field}\r\n dataPosition={props.position}\r\n dataName={`${props.fieldArrayName}.${props.name}`}\r\n fullWidth\r\n label={props.label}\r\n defaultValue={\r\n props.type === \"number\" ||\r\n props.type === \"currency\" ||\r\n props.type === \"geoLocation\"\r\n ? typeof props.defaultValue === 'string' ? props.defaultValue.replace(/[^0-9]/g, \"\") : props.defaultValue\r\n : props.defaultValue || \"\"\r\n }\r\n // value={props.formType === \"builder\" ? props.defaultValue : \"\"}\r\n placeholder={props.placeholder}\r\n // onChange={(e) => {\r\n // field.onChange(e);\r\n // props.formControl.fieldArrayDirty[props.fieldArrayName] = true;\r\n // }}\r\n type={\r\n props.type === \"currency\" ||\r\n props.type === \"geoLocation\" ||\r\n props.type === \"relation\"\r\n ? \"text\"\r\n : props.type || \"text\"\r\n }\r\n // value={\r\n // props.type === \"number\" && typeof field.value === 'number'\r\n // ? (props?.shouldApplyPrecission === false || ['exchange_rate'].includes(props.name)) ? field.value : field.value.toFixed(2)\r\n // : field.value || \"\"\r\n // }\r\n value={\r\n props.type === \"number\" && typeof field.value === 'number'\r\n ? (props?.shouldApplyPrecission === false || ['exchange_rate'].includes(props.name)) \r\n ? field.value \r\n : (() => {\r\n const step = props?.float_step\r\n const decimalPlaces = step && step !== 'any' \r\n ? (String(step).split('.')[1]?.length ?? 2)\r\n : 2\r\n console.log(\"+++++++\", field.value, decimalPlaces)\r\n return Number(field.value.toFixed(decimalPlaces)).toString()\r\n })()\r\n : field.value || \"\"\r\n }\r\n multiline={props.is_multiline || false}\r\n minRows={4}\r\n required={props.formType === \"builder\" ? false : props.required}\r\n // onChange={(e) => {\r\n // return;\r\n // }}\r\n InputProps={{\r\n // inputMode: 'numeric',\r\n // pattern: '[0-9]*',\r\n minLength: props.min || 1,\r\n // maxLength: props.max || 255,\r\n // step: props?.float_step || \"0\",\r\n endAdornment: props.endIcon ? (\r\n <InputAdornment position=\"end\">\r\n <IconButton edge=\"end\" onClick={props?.onIconClick}>\r\n {props.endIcon}\r\n </IconButton>\r\n </InputAdornment>\r\n ) : undefined,\r\n ...props.InputProps,\r\n }}\r\n inputProps={{\r\n step: props?.float_step || 'any',\r\n min: props.min_length || undefined,\r\n // max: props.max_length,\r\n }}\r\n disabled={props.disabled}\r\n hidden={props.hidden}\r\n error={Boolean(fieldState.error?.message)}\r\n helperText={fieldState.error?.message || \"\"}\r\n onBlur={(e: any) => {\r\n field.onBlur(e)\r\n if (props.onBlur && typeof props.onBlur === 'function') {\r\n props.onBlur(e)\r\n }\r\n }}\r\n />\r\n )}\r\n />\r\n );\r\n});\r\n\r\nDynamicInput.propTypes = {\r\n formControl: PropTypes.shape({\r\n register: PropTypes.func.isRequired,\r\n setValue: PropTypes.func,\r\n _formState: PropTypes.object.isRequired,\r\n }).isRequired,\r\n name: PropTypes.string.isRequired,\r\n placeholder: PropTypes.string.isRequired,\r\n label: PropTypes.node.isRequired,\r\n fieldArrayName: PropTypes.string,\r\n defaultValue: PropTypes.string,\r\n type: PropTypes.string,\r\n required: PropTypes.bool,\r\n is_multiline: PropTypes.bool,\r\n min: PropTypes.number,\r\n max: PropTypes.number,\r\n min_length: PropTypes.number,\r\n max_length: PropTypes.number,\r\n float_step: PropTypes.string,\r\n position: PropTypes.number,\r\n formType: PropTypes.string,\r\n disabled: PropTypes.bool,\r\n typeOfField: PropTypes.string,\r\n endIcon: PropTypes.node,\r\n onIconClick: PropTypes.func,\r\n onBlur: PropTypes.func, // This should be optional\r\n hidden: PropTypes.bool,\r\n InputProps: PropTypes.object,\r\n shouldApplyPrecission: PropTypes.bool\r\n};\r\nDynamicInput.defaultProps = {\r\n onBlur: () => { }\r\n};\r\n\r\n\r\n\r\n\r\nexport { DynamicInput };\r\nexport default DynamicInput;","import{validateFieldsNatively as e,toNestErrors as t}from\"@hookform/resolvers\";import{appendErrors as r}from\"react-hook-form\";function o(o,n,a){return void 0===n&&(n={}),void 0===a&&(a={}),function(s,i,c){try{return Promise.resolve(function(t,r){try{var u=(n.context&&\"development\"===process.env.NODE_ENV&&console.warn(\"You should not used the yup options context. Please, use the 'useForm' context object instead\"),Promise.resolve(o[\"sync\"===a.mode?\"validateSync\":\"validate\"](s,Object.assign({abortEarly:!1},n,{context:i}))).then(function(t){return c.shouldUseNativeValidation&&e({},c),{values:a.raw?s:t,errors:{}}}))}catch(e){return r(e)}return u&&u.then?u.then(void 0,r):u}(0,function(e){if(!e.inner)throw e;return{values:{},errors:t((o=e,n=!c.shouldUseNativeValidation&&\"all\"===c.criteriaMode,(o.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,a=o&&o[t.type];e[t.path]=r(t.path,n,e,t.type,a?[].concat(a,t.message):t.message)}return e},{})),c)};var o,n}))}catch(e){return Promise.reject(e)}}}export{o as yupResolver};\n//# sourceMappingURL=yup.module.js.map\n","import { Tooltip as MUITooltip, TooltipProps } from \"@mui/material\";\n\nconst Tooltip = ({ title, children, sx, ...rest }: TooltipProps) => {\n return (\n <MUITooltip\n componentsProps={{\n tooltip: {\n sx: {\n padding: \"0.5rem 0.75rem\",\n backgroundColor: \"#393B3E\",\n maxWidth: \"12rem\",\n '& .MuiTooltip-arrow': {\n color: \"#393B3E\"\n },\n ...sx\n },\n },\n }}\n title={title}\n {...rest}\n >\n {children}\n </MUITooltip>\n );\n};\n\nexport { Tooltip };\nexport default Tooltip;\n","import {\n\tBox,\n\tCircularProgress,\n\tDialog,\n\tDialogActions,\n\tDialogContent,\n\tDialogProps,\n\tDialogTitle,\n\tDivider,\n\tIconButton\n} from '@mui/material';\nimport CloseIcon from '@mui/icons-material/Close';\nimport Typography from '../typography/typography';\nimport Button from '../button/button';\nimport './confirm-modal.scss';\nimport images from '../../assets/images';\nimport { useLanguage } from '../../hooks/useLangauge';\nimport { useTranslation } from 'react-i18next';\n\ninterface ConfirmPopUpProps extends DialogProps {\n\ttitle: string;\n\tdescription: string | JSX.Element;\n\tonClose: () => void;\n\tonConfirm: () => void;\n\tbuttonTexts?: {\n\t\tconfirm: string;\n\t\tcancel: string;\n\t};\n\tbuttonColors?: {\n\t\tconfirm: string;\n\t\tcancel?: string;\n\t};\n\tmodalType?: 'alert' | 'info';\n\tloading?: boolean;\n\tshowAction?: boolean;\n}\n\nexport const ConfirmPopUp = (props: ConfirmPopUpProps) => {\n\tconst { t } = useTranslation();\n\tconst {\n\t\topen,\n\t\ttitle,\n\t\tdescription,\n\t\tonClose,\n\t\tonConfirm,\n\t\tmodalType = 'alert',\n\t\tbuttonTexts = { confirm: t('common.delete'), cancel: t('common.cancel') },\n\t\tbuttonColors = { confirm: 'error' },\n\t\tloading = false,\n\t\tshowAction=true,\n\t\t...rest\n\t} = props;\n\n\tconst icon = modalType === 'info' ? images.info : images.alert;\n const {isRtl}=useLanguage();\n\treturn (\n\t\t<>\n\t\t\t<Dialog open={open} onClose={onClose} className='confirm' {...rest}>\n\t\t\t\t<DialogTitle className='confirm--head'>\n\t\t\t\t\t<Box className='confirm--title'>\n\t\t\t\t\t\t<img src={icon} alt='alert icon' />{' '}\n\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\ttype='s3'\n\t\t\t\t\t\t\tml={1}\n\t\t\t\t\t\t\tweight='medium'\n\t\t\t\t\t\t\tcolor='theme.secondary.1000'>\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t</Box>\n\t\t\t\t\t<IconButton disableRipple onClick={onClose} disabled={loading}>\n\t\t\t\t\t\t<CloseIcon />\n\t\t\t\t\t</IconButton>\n\t\t\t\t</DialogTitle>\n\t\t\t\t<Divider />\n\t\t\t\t<DialogContent className='confirm--content'>\n\t\t\t\t\t<Typography type='s3' color='theme.secondary.1000'>\n\t\t\t\t\t\t{description}\n\t\t\t\t\t</Typography>\n\t\t\t\t</DialogContent>\n\t\t\t\t<Divider />\n\t\t\t\t{showAction &&<DialogActions\n\t\t\t\t\tclassName='confirm--actions'\n\t\t\t\t\tsx={{ backgroundColor: 'theme.secondary.200' }}>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant='text'\n\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\tcolor={buttonColors?.cancel}\n\t\t\t\t\t\tdisabled={loading}>\n\t\t\t\t\t\t{buttonTexts.cancel}\n\t\t\t\t\t</Button>\n\t\t\t\t{buttonTexts.confirm &&<Button\n\t\t\t\t\t\tcolor={buttonColors.confirm}\n\t\t\t\t\t\tonClick={onConfirm}\n\t\t\t\t\t\tsx={isRtl?{mr: 1}:{}}\n\t\t\t\t\t\tendIcon={loading && <CircularProgress size={18} color='inherit' />}\n\t\t\t\t\t\tdisabled={loading}>\n\t\t\t\t\t\t{buttonTexts.confirm}\n\t\t\t\t\t</Button>}\n\t\t\t\t</DialogActions>}\n\t\t\t</Dialog>\n\t\t</>\n\t);\n};\n\nexport default ConfirmPopUp;\n","import Close from \"@mui/icons-material/Close\";\r\nimport {\r\n Alert as MUIAlert,\r\n IconButton,\r\n Snackbar,\r\n SnackbarProps,\r\n styled,\r\n} from \"@mui/material\";\r\nimport WarningAmberIcon from \"@mui/icons-material/WarningAmber\";\r\nimport CheckCircleOutlineIcon from \"@mui/icons-material/CheckCircleOutline\";\r\nimport \"./toast.scss\";\r\nimport Typography from \"../typography/typography\";\r\n\r\ninterface IToast extends SnackbarProps {\r\n handleClose: () => void;\r\n type?: \"normal\" | \"alert\";\r\n handleUndo?: () => void;\r\n}\r\n\r\nconst StyledAlert = styled(MUIAlert)(({ theme: { palette } }) => ({\r\n color: \"white\",\r\n height: \"2.5rem\",\r\n padding: \"0rem 1rem\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n\r\n \"&.MuiAlert-standardWarning\": {\r\n backgroundColor: palette.theme?.error[600],\r\n },\r\n\r\n \"&.MuiAlert-standardInfo\": {\r\n backgroundColor: palette.theme?.secondary[900],\r\n },\r\n\r\n \".MuiAlert-action\": {\r\n padding: \"0rem\",\r\n marginLeft: \"0.5rem\",\r\n },\r\n\r\n \".MuiAlert-icon\": {\r\n marginRight: \"0.5rem\",\r\n },\r\n}));\r\n\r\nconst Toast = (props: IToast) => {\r\n const {\r\n open,\r\n message,\r\n type = \"alert\",\r\n handleUndo,\r\n handleClose,\r\n ...rest\r\n } = props;\r\n\r\n const action = (\r\n <>\r\n {handleUndo ? (\r\n <Typography\r\n className=\"toast-undo\"\r\n type=\"s4\"\r\n color={type === \"normal\" ? \"theme.primary.600\" : \"white\"}\r\n onClick={handleUndo}\r\n >\r\n Undo\r\n </Typography>\r\n ) : (\r\n <IconButton color=\"inherit\" className=\"icon\" onClick={handleClose}>\r\n <Close fontSize=\"inherit\" />\r\n </IconButton>\r\n )}\r\n </>\r\n );\r\n\r\n return (\r\n <>\r\n <Snackbar\r\n open={open}\r\n autoHideDuration={300000}\r\n onClose={handleClose}\r\n {...rest}\r\n >\r\n <StyledAlert\r\n action={action}\r\n onClose={handleClose}\r\n severity={type === \"normal\" ? \"info\" : \"warning\"}\r\n icon={\r\n type === \"normal\" ? (\r\n <CheckCircleOutlineIcon htmlColor=\"white\" className=\"icon\" />\r\n ) : (\r\n <WarningAmberIcon htmlColor=\"white\" className=\"icon\" />\r\n )\r\n }\r\n >\r\n <Typography color=\"inherit\" type=\"s4\">\r\n {message}\r\n </Typography>\r\n </StyledAlert>\r\n </Snackbar>\r\n </>\r\n );\r\n};\r\n\r\nexport { Toast };\r\nexport default Toast;\r\n","import { Avatar as AvatarMUI, SvgIcon } from \"@mui/material\";\nimport Person2OutlinedIcon from \"@mui/icons-material/Person2Outlined\";\nimport \"./avatar.scss\";\n\nexport const Avatar = (props: any) => {\n const { icon, badge, src, alt, size, altIcon, ...rest } = props;\n const avatarStyle = {\n height: size,\n width: size,\n };\n\n const fontSize = size * (alt && alt.split(\" \").length > 1 ? 0.025 : 0.035);\n const badgeSize = size * 0.0225;\n const badgeBorder = size * 0.004;\n let altFirstChar = \"\";\n\n if (alt && alt.length > 0) {\n const words = alt.split(\" \");\n altFirstChar = words.map((word: string) => word.charAt(0)).join(\"\");\n }\n\n return (\n <div className=\"Avatar\">\n <AvatarMUI\n alt={alt}\n src={src ? src : undefined}\n style={avatarStyle}\n {...rest}\n >\n {icon && (!src || (alt && alt.length === 0)) && (\n <>\n {altIcon ? (\n <SvgIcon>{altIcon}</SvgIcon>\n ) : (\n <Person2OutlinedIcon\n style={{ fontSize: `${fontSize + 0.8}rem` }}\n />\n )}\n </>\n )}\n {!icon && !src && (\n <span\n className=\"Avatar--FirstChar\"\n style={{ fontSize: `${fontSize}rem` }}\n >\n {altFirstChar}\n </span>\n )}\n </AvatarMUI>\n\n {badge && (\n <div\n className=\"Avatar--Badge\"\n style={{\n width: `${badgeSize}rem`,\n height: `${badgeSize}rem`,\n border: `${badgeBorder}rem solid #ffffff`,\n }}\n />\n )}\n </div>\n );\n};\n\nexport default Avatar;\n","import { useState } from \"react\";\r\nimport Modal from \"../modal/modal\";\r\nimport { useForm } from \"react-hook-form\";\r\nimport { LoginFormValues } from \"../../contexts/AuthContext\";\r\nimport { yupResolver } from \"@hookform/resolvers/yup\";\r\nimport * as Yup from \"yup\";\r\nimport { useAuth } from \"../../hooks/useAuth\";\r\nimport { styled } from '@mui/material/styles';\r\nimport Box from \"@mui/material/Box\";\r\nimport Typography from \"../typography/typography\";\r\nimport DynamicInput from \"../form-control/form-builder/form-builder-element/text\";\r\nimport { Eye, EyeOff } from \"../icons\";\r\nimport Button from \"../button/button\";\r\nimport Toast from \"../toast/toast\";\r\n\r\n\r\nconst validationSchema = Yup.object({\r\n login: Yup.object({\r\n current_password: Yup.string().required(\"Please enter current password\"),\r\n password: Yup.string()\r\n .required(\"Please enter password\")\r\n .min(8, \"Password must be at least 8 characters\")\r\n .matches(/[A-Z]/, \"Password must contain at least one uppercase letter\")\r\n .matches(/[!@#$%^&*(),.?\":{}|<>]/, \"Password must contain at least one special character\"),\r\n confirm_password: Yup.string().required(\"Please enter confirm password\").oneOf([Yup.ref('password')], \"Passwords must match\"),\r\n }),\r\n});\r\n\r\n\r\n\r\nconst ResetPasswordModal = ({showModal, setShowModal}) => {\r\n const { changeUserPassword } = useAuth();\r\n\r\n // const [showModal, setShowModal] = useState(false);\r\n const [toast, setToast] = useState<IToast | null>(null);\r\n\r\n interface FormValeus {\r\n login: LoginFormValues;\r\n }\r\n\r\n const { control, handleSubmit, trigger } = useForm<FormValeus>({\r\n resolver: yupResolver(validationSchema),\r\n mode: \"all\",\r\n });\r\n\r\n const onSubmit = async (values: FormValeus) => {\r\n const isValid = await trigger();\r\n if (!isValid) return;\r\n await changeUserPassword(values.login, (message, type) => {\r\n if (type) {\r\n setToast({ message: message, type: \"normal\" });\r\n setShowModal(false);\r\n } else {\r\n setToast({ message: message, type: \"alert\" });\r\n }\r\n // make logout\r\n });\r\n return values; \r\n };\r\n\r\n const [showPassword, setShowPassword] = useState<boolean>(false);\r\n const handleShowPassword = () => setShowPassword(!showPassword);\r\n\r\n const [showCurrentPassword, setShowCurrentPassword] = useState<boolean>(false);\r\n const handleShowCurrentPassword = () => setShowCurrentPassword(!showCurrentPassword);\r\n\r\n const [showConfirmPassword, setShowConfirmPassword] = useState<boolean>(false);\r\n const handleShowConfirmPassword = () => setShowConfirmPassword(!showConfirmPassword);\r\n\r\n const FlexBox = styled(Box)(() => ({\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n }));\r\n\r\n return (\r\n <>\r\n <Modal \r\n open={showModal}\r\n onClose={() => setShowModal(false)} \r\n children={\r\n <>\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n <FlexBox gap={4} className=\"popup-change-pass\">\r\n <FlexBox gap={2}>\r\n <Box>\r\n <Typography\r\n align=\"center\"\r\n type=\"h1\"\r\n weight=\"medium\"\r\n color=\"theme.secondary.1000\"\r\n >\r\n Change Password\r\n </Typography>\r\n <Typography\r\n align=\"center\"\r\n type=\"h5\"\r\n weight=\"normal\"\r\n color=\"theme.secondary81000\"\r\n >\r\n Enter Details below\r\n </Typography>\r\n </Box>\r\n <FlexBox gap={2}>\r\n <Box>\r\n <DynamicInput\r\n formControl={control}\r\n label=\"Current Password\"\r\n name=\"current_password\"\r\n type={showCurrentPassword ? \"text\" : \"password\"}\r\n placeholder=\"Enter Current Password\"\r\n fieldArrayName=\"login\"\r\n endIcon={\r\n <>\r\n {showCurrentPassword ? (\r\n <Eye fontSize=\"small\" htmlColor=\"#292D32\" />\r\n ) : (\r\n <EyeOff fontSize=\"small\" htmlColor=\"#292D32\" />\r\n )}\r\n </>\r\n }\r\n onIconClick={handleShowCurrentPassword}\r\n />\r\n </Box>\r\n <Box>\r\n <DynamicInput\r\n formControl={control}\r\n label=\"Password\"\r\n name=\"password\"\r\n type={showPassword ? \"text\" : \"password\"}\r\n placeholder=\"Enter Password\"\r\n fieldArrayName=\"login\"\r\n endIcon={\r\n <>\r\n {showPassword ? (\r\n <Eye fontSize=\"small\" htmlColor=\"#292D32\" />\r\n ) : (\r\n <EyeOff fontSize=\"small\" htmlColor=\"#292D32\" />\r\n )}\r\n </>\r\n }\r\n onIconClick={handleShowPassword}\r\n />\r\n </Box>\r\n <Box>\r\n <DynamicInput\r\n formControl={control}\r\n label=\"Confirm Password\"\r\n name=\"confirm_password\"\r\n type={showConfirmPassword ? \"text\" : \"password\"}\r\n fieldArrayName=\"login\"\r\n endIcon={\r\n <>\r\n {showConfirmPassword ? (\r\n <Eye fontSize=\"small\" htmlColor=\"#292D32\" />\r\n ) : (\r\n <EyeOff fontSize=\"small\" htmlColor=\"#292D32\" />\r\n )}\r\n </>\r\n }\r\n onIconClick={handleShowConfirmPassword} \r\n placeholder=\"Enter confirm password\"\r\n />\r\n </Box>\r\n </FlexBox>\r\n </FlexBox>\r\n <FlexBox gap={2}>\r\n <Button type=\"button\" onClick={handleSubmit(onSubmit)} size=\"large\" variant=\"contained\">\r\n Change Password\r\n </Button>\r\n </FlexBox>\r\n </FlexBox>\r\n </form> \r\n </>\r\n }\r\n />\r\n <Toast\r\n open={Boolean(toast)}\r\n message={toast?.message}\r\n type={toast?.type}\r\n handleClose={() => setToast(null)}\r\n anchorOrigin={{ horizontal: \"right\", vertical: \"bottom\" }}\r\n autoHideDuration={3000}\r\n />\r\n </>\r\n );\r\n}\r\n\r\nexport { ResetPasswordModal };\r\nexport default ResetPasswordModal;","import React, { useState, useCallback, useRef, useEffect } from 'react'\r\nimport {\r\n\tIconButton,\r\n\tMenu,\r\n\tMenuItem,\r\n\tBadge,\r\n\tBox,\r\n\tCircularProgress,\r\n\tAvatar,\r\n\tListItemText,\r\n\tListItemAvatar,\r\n\tAlert,\r\n\tSkeleton,\r\n} from '@mui/material'\r\nimport {\r\n\tPerson as PersonIcon,\r\n\tEmail as EmailIcon,\r\n\tWarning as WarningIcon,\r\n\tCheckCircle as CheckCircleIcon,\r\n\tAssignment as AssignmentIcon,\r\n\tAccountBalance as AccountBalanceIcon,\r\n\tHourglassEmpty as HourglassEmptyIcon,\r\n\tCancel as CancelIcon,\r\n} from '@mui/icons-material'\r\nimport {\r\n\tgetV1Notification,\r\n\tgetV1NotificationMarkAllAsRead,\r\n\tpatchV1NotificationMarkAsReadId,\r\n} from '../../../../api-client/api.system-feature/api'\r\nimport { getErrorMessage, getToken } from '../../../../utils/common'\r\nimport formatText, { convertToUnderscore, formatLabel } from '../../../../utils/format-text'\r\nimport Typography from '../../../typography/typography'\r\nimport images from '../../../../assets/images'\r\nimport { generateRouteWithId } from '../../../../utils/route-utils'\r\nimport { PathnameGenerator, PathnameAccounting } from '../../../../constants/pathnames/pathname.accounting'\r\nimport { ROUTES as RENTALROUTES } from '../../../../constants/pathnames/pathname.rental'\r\n\r\nimport { PathnameInventory, PathnameGenerator as PathnameGeneratorInventory } from '../../../../constants/pathnames/pathname.inventory'\r\n\r\nimport {\r\n\tPathnameManufacturing,\r\n\tPathnameGenerator as PathnameGeneratorManufacuring,\r\n} from '../../../../constants/pathnames/pathname.manufacturing.ts'\r\n\r\nimport {\r\n\tPathnamePurchase,\r\n\tPathnameGenerator as PathnameGeneratorPurchase,\r\n} from '../../../../constants/pathnames/pathname.procurement.ts'\r\n\r\nimport { PathnameCrm, PathnameGenerator as PathnameGeneratorCrm } from '../../../../constants/pathnames/pathname.crm.ts'\r\n\r\nimport { PathnameRental, PathnameGenerator as PathnameGeneratorRental } from '../../../../constants/pathnames/pathname.rental.ts'\r\n\r\nimport { useNavigate } from 'react-router-dom'\r\nimport { Notification, Tick } from '../../../icons'\r\nimport Button from '../../../button/button'\r\nimport { enqueueSnackbar } from 'notistack'\r\n\r\nconst getNotificationUrl = (data: any) => {\r\n\tconst { moduleName = '', moduleId = '', notificationData = {} } = data\r\n\tconst key = convertToUnderscore(moduleName)\r\n\r\n\tconst routeMap: Record<string, () => string> = {\r\n\t\tsales_invoice: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_SALES_INVOICES), moduleId.toString()),\r\n\r\n\t\tasset_transfers: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_ASSET_TRANSFER), moduleId.toString()),\r\n\r\n\t\tbudgets: () => generateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_BUDGET), moduleId.toString()),\r\n\r\n\t\tcash_expense: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_CASH_EXPENSE), moduleId.toString()),\r\n\r\n\t\tcredit_notes: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_CREDIT_NOTE), moduleId.toString()),\r\n\r\n\t\tdebit_notes: () => generateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_DEBIT_NOTE), moduleId.toString()),\r\n\r\n\t\texpense_reimbursement: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_EXPENSE_REIMBURSEMENT), moduleId.toString()),\r\n\r\n\t\tjournal_entries: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_JOURNAL_ENTRY), moduleId.toString()),\r\n\r\n\t\tpayment_entries: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_PAYMENT_ENTRY), moduleId.toString()),\r\n\r\n\t\tpurchase_invoice: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_PURCHASE_INVOICE), moduleId.toString()),\r\n\r\n\t\tstock_transfer: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorInventory(PathnameInventory.VIEW_STOCK_TRANSFER), moduleId.toString()),\r\n\r\n\t\tbills_of_materials: () =>\r\n\t\t\tgenerateRouteWithId(\r\n\t\t\t\tPathnameGeneratorManufacuring(PathnameManufacturing.VIEW_BILL_OF_MATERIAL),\r\n\t\t\t\tmoduleId.toString()\r\n\t\t\t),\r\n\r\n\t\tpurchase_agreement: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_AGREEMENT), moduleId.toString()),\r\n\r\n\t\tpurchase_orders: () =>\r\n\t\t\tgenerateRouteWithId(\r\n\t\t\t\tnotificationData?.data?.is_rental == 1\r\n\t\t\t\t\t? RENTALROUTES.VIEW\r\n\t\t\t\t\t: PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_ORDER),\r\n\t\t\t\tmoduleId.toString()\r\n\t\t\t),\r\n\r\n\t\tpurchase_request: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_ORDER), moduleId.toString()),\r\n\r\n\t\tvra: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_VENDOR_RETURNS), moduleId.toString()),\r\n\r\n\t\tsales_customer_returns: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorCrm(PathnameCrm.VIEW_CUSTOMER_RETURNS), moduleId.toString()),\r\n\r\n\t\tsales_order: () => generateRouteWithId(PathnameGeneratorCrm(PathnameCrm.VIEW_SALES_ORDER), moduleId.toString()),\r\n\r\n\t\trental_order: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_RENTAL_ORDER), moduleId.toString()),\r\n\r\n\t\treplacement_order: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_RENTAL_ORDER), moduleId.toString()),\r\n\r\n\t\trental_agreement: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_AGREEMENT), moduleId.toString()),\r\n\r\n\t\tcross_hire_order: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_CROSS_HIRE_ORDER), moduleId.toString()),\r\n\r\n\t\tcross_hire_request: () =>\r\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_CROSS_HIRE_REQUEST), moduleId.toString()),\r\n\t}\r\n\r\n\treturn routeMap[key]?.() || '/dashboard'\r\n}\r\n\r\nconst mainModuleIcons = {\r\n\trbac: images.user,\r\n\tdocument: images.document,\r\n\t'accounts-and-finance': images.accounting,\r\n\tinventory: images.inventory,\r\n\tmanufacturing: images.manufacturing,\r\n\tsales: images.crm,\r\n\trental: images.rental,\r\n\tuser: images.user,\r\n\tpurchase: images.procurement,\r\n\thrms: images.hrms,\r\n}\r\nconst mainModuleBgColors = {\r\n\trbac: '#F3E5F5',\r\n\tdocument: '#FFF8E1',\r\n\t'accounts-and-finance': '#E8F5E8',\r\n\tinventory: '#E3F2FD',\r\n\tmanufacturing: '#FFF3E0',\r\n\tsales: '#F3E5F5',\r\n\trental: '#E8F5E8',\r\n\tuser: '#F3E5F5',\r\n\tpurchase: '#FCE4EC',\r\n\thrms: '#fcfcfc',\r\n}\r\n\r\nconst NotificationMenu = () => {\r\n\tconst [anchorEl, setAnchorEl] = useState(null)\r\n\tconst [notifications, setNotifications] = useState([])\r\n\tconst [loading, setLoading] = useState(false)\r\n\tconst [loadingMore, setLoadingMore] = useState(false)\r\n\tconst [error, setError] = useState(null)\r\n\tconst [unreadCount, setUnreadCount] = useState(0)\r\n\tconst [markingAllAsRead, setMarkingAllAsRead] = useState(false)\r\n\tconst [pagination, setPagination] = useState({\r\n\t\tskip: 0,\r\n\t\tlimit: 10,\r\n\t\ttotalCount: 0,\r\n\t\thasMore: true,\r\n\t})\r\n\r\n\tconst navigate = useNavigate()\r\n\r\n\tconst menuRef = useRef(null)\r\n\tconst isLoadingMoreRef = useRef(false)\r\n\tconst open = Boolean(anchorEl)\r\n\r\n\t// Transform API notification to display format\r\n\tconst transformNotification = (apiNotification) => {\r\n\t\tconst moduleIcons = {\r\n\t\t\t'accounts-and-finance': <AccountBalanceIcon color=\"primary\" />,\r\n\t\t\tuser: <PersonIcon color=\"action\" />,\r\n\t\t\tapproval: <AssignmentIcon color=\"warning\" />,\r\n\t\t}\r\n\r\n\t\tconst getInitials = (performedUser) => {\r\n\t\t\tif (!performedUser) return null\r\n\t\t\tconst firstName = performedUser.first_name || ''\r\n\t\t\tconst lastName = performedUser.last_name || ''\r\n\t\t\tif (!firstName && !lastName) return null\r\n\t\t\treturn (firstName.charAt(0) + lastName.charAt(0)).toUpperCase()\r\n\t\t}\r\n\r\n\t\tconst getFullName = (performedUser) => {\r\n\t\t\tif (!performedUser) return null\r\n\t\t\tconst firstName = performedUser.first_name || ''\r\n\t\t\tconst lastName = performedUser.last_name || ''\r\n\t\t\treturn `${firstName} ${lastName}`.trim() || null\r\n\t\t}\r\n\r\n\t\tconst formatTimestamp = (dateString) => {\r\n\t\t\tconst date = new Date(dateString)\r\n\t\t\tconst now = new Date()\r\n\t\t\tconst diffMs = now - date\r\n\t\t\tconst diffMins = Math.floor(diffMs / 60000)\r\n\t\t\tconst diffHours = Math.floor(diffMs / 3600000)\r\n\t\t\tconst diffDays = Math.floor(diffMs / 86400000)\r\n\r\n\t\t\tif (diffMins < 1) return 'Just now'\r\n\t\t\tif (diffMins < 60) return `${diffMins} minute${diffMins > 1 ? 's' : ''} ago`\r\n\t\t\tif (diffHours < 24) return `${diffHours} hour${diffHours > 1 ? 's' : ''} ago`\r\n\t\t\tif (diffDays < 7) return `${diffDays} day${diffDays > 1 ? 's' : ''} ago`\r\n\t\t\treturn date.toLocaleDateString()\r\n\t\t}\r\n\r\n\t\tconst subData = apiNotification.sub_module_data || {}\r\n\r\n\t\treturn {\r\n\t\t\tid: apiNotification.id,\r\n\t\t\ttype: apiNotification.action || apiNotification.notification_type || 'info',\r\n\t\t\ttitle: formatText(apiNotification.title),\r\n\t\t\tmessage: apiNotification.message,\r\n\t\t\ttimestamp: formatTimestamp(apiNotification.created_at),\r\n\t\t\tread: apiNotification.status === 'read',\r\n\t\t\tavatar: getInitials(apiNotification.performed_user),\r\n\t\t\tperformedByName: getFullName(apiNotification.performed_user),\r\n\t\t\tmodule: apiNotification.module,\r\n\t\t\tsubModule: apiNotification.sub_module,\r\n\t\t\tsubModuleId: apiNotification.sub_module_id,\r\n\t\t\tstatus: apiNotification.status,\r\n\t\t\tseriesNumber: subData.series_number || null,\r\n\t\t\tdocumentStatus: subData.status || null,\r\n\t\t\tcustomerName: subData.customer_name || null,\r\n\t\t\ticon: moduleIcons[apiNotification.module] || moduleIcons[apiNotification.action] || <PersonIcon color=\"action\" />,\r\n\t\t}\r\n\t}\r\n\r\n\t// Fetch notifications with pagination\r\n\tconst fetchNotifications = useCallback(async (isLoadMore = false) => {\r\n\t\t// Prevent multiple simultaneous load more requests\r\n\t\tif (isLoadMore && isLoadingMoreRef.current) {\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\tif (isLoadMore) {\r\n\t\t\tisLoadingMoreRef.current = true\r\n\t\t\tsetLoadingMore(true)\r\n\t\t} else {\r\n\t\t\tsetLoading(true)\r\n\t\t\t// Reset pagination when loading fresh data\r\n\t\t\tsetPagination((prev) => ({\r\n\t\t\t\t...prev,\r\n\t\t\t\tskip: 0,\r\n\t\t\t\thasMore: true,\r\n\t\t\t}))\r\n\t\t}\r\n\t\tsetError(null)\r\n\r\n\t\ttry {\r\n\t\t\tconst currentSkip = isLoadMore ? pagination.skip : 0\r\n\t\t\tconst response = await getV1Notification({\r\n\t\t\t\tskip: currentSkip,\r\n\t\t\t\tlimit: pagination.limit,\r\n\t\t\t\t...getToken(),\r\n\t\t\t})\r\n\r\n\t\t\tif (response.success && response.data) {\r\n\t\t\t\tconst transformedNotifications = response.data.notifications.map(transformNotification)\r\n\r\n\t\t\t\tif (isLoadMore) {\r\n\t\t\t\t\tsetNotifications((prev) => [...prev, ...transformedNotifications])\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsetNotifications(transformedNotifications)\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Update pagination\r\n\t\t\t\tconst newSkip = currentSkip + response.data.notifications.length\r\n\t\t\t\tconst hasMore = newSkip < response.data.pagination.totalCount\r\n\r\n\t\t\t\tsetPagination((prev) => ({\r\n\t\t\t\t\t...prev,\r\n\t\t\t\t\tskip: newSkip,\r\n\t\t\t\t\ttotalCount: response.data.pagination.totalCount,\r\n\t\t\t\t\thasMore,\r\n\t\t\t\t}))\r\n\r\n\t\t\t\t// Calculate unread count (assuming 'pending' status means unread)\r\n\t\t\t\tif (!isLoadMore) {\r\n\t\t\t\t\tconst unread = response.data.pagination.unreadCount\r\n\t\t\t\t\tsetUnreadCount(unread)\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsetUnreadCount(0)\r\n\t\t\t\tthrow new Error(response.message || 'Failed to load notifications')\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tsetError('Failed to load notifications')\r\n\t\t} finally {\r\n\t\t\tsetLoading(false)\r\n\t\t\tsetLoadingMore(false)\r\n\t\t\tif (isLoadMore) {\r\n\t\t\t\tisLoadingMoreRef.current = false\r\n\t\t\t}\r\n\t\t}\r\n\t}, [pagination.limit, pagination.skip])\r\n\r\n\t// Handle scroll for infinite loading\r\n\tconst handleScroll = useCallback(\r\n\t\t(event) => {\r\n\t\t\tconst { scrollTop, scrollHeight, clientHeight } = event.target\r\n\t\t\tconst isNearBottom = scrollTop + clientHeight >= scrollHeight - 50 // Increased threshold\r\n\r\n\t\t\tif (isNearBottom && !isLoadingMoreRef.current && !loading && pagination.hasMore) {\r\n\t\t\t\tfetchNotifications(true)\r\n\t\t\t}\r\n\t\t},\r\n\t\t[fetchNotifications, loading, pagination.hasMore]\r\n\t)\r\n\r\n\tconst handleClick = (event) => {\r\n\t\tsetAnchorEl(event.currentTarget)\r\n\t\tif (notifications.length === 0) {\r\n\t\t\tfetchNotifications()\r\n\t\t}\r\n\t}\r\n\r\n\tconst handleClose = () => {\r\n\t\tsetAnchorEl(null)\r\n\r\n\t\t// Don't clear notifications immediately to avoid flickering\r\n\t\t// They will be refreshed when menu is opened again\r\n\t}\r\n\r\n\tconst handleNotificationClick = async (notificationId) => {\r\n\t\t// Mark notification as read\r\n\t\tconst n = notifications.find((n) => {\r\n\t\t\treturn n.id === notificationId\r\n\t\t})\r\n\t\tif (!n) return\r\n\r\n\t\thandleClose()\r\n\r\n\t\tif (n.status === 'pending') {\r\n\t\t\tawait patchV1NotificationMarkAsReadId({\r\n\t\t\t\tid: notificationId,\r\n\t\t\t\t...getToken(),\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tsetNotifications((prev) => prev.map((n) => (n.id === notificationId ? { ...n, read: true } : n)))\r\n\t\tsetUnreadCount((prev) => Math.max(0, prev - 1))\r\n\t\tconst url = getNotificationUrl({\r\n\t\t\tmoduleName: n.subModule,\r\n\t\t\tmoduleId: n.subModuleId,\r\n\t\t\tnotificationData: n,\r\n\t\t})\r\n setTimeout(() => {\r\n navigate(url)\r\n }, 300)\r\n\t}\r\n\r\n\tconst getNotificationIcon = (notification) => {\r\n\t\tif (notification.icon) {\r\n\t\t\treturn notification.icon\r\n\t\t}\r\n\r\n\t\tswitch (notification.type) {\r\n\t\t\tcase 'approval':\r\n\t\t\t\treturn <AssignmentIcon color=\"warning\" />\r\n\t\t\tcase 'user':\r\n\t\t\t\treturn <PersonIcon color=\"action\" />\r\n\t\t\tcase 'message':\r\n\t\t\t\treturn <EmailIcon color=\"primary\" />\r\n\t\t\tcase 'warning':\r\n\t\t\t\treturn <WarningIcon color=\"warning\" />\r\n\t\t\tcase 'success':\r\n\t\t\t\treturn <CheckCircleIcon color=\"success\" />\r\n\t\t\tdefault:\r\n\t\t\t\treturn <PersonIcon color=\"action\" />\r\n\t\t}\r\n\t}\r\n\r\n\tconst handleMarkAllAsRead = useCallback(async () => {\r\n\t\tif (markingAllAsRead) return // Prevent multiple calls\r\n\r\n\t\tsetMarkingAllAsRead(true)\r\n\r\n\t\tif (!unreadCount) {\r\n\t\t\tenqueueSnackbar('No unread notifications!')\r\n\t\t\tsetMarkingAllAsRead(false)\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tawait getV1NotificationMarkAllAsRead({ ...getToken() })\r\n\t\t\t// Update local state immediately for better UX\r\n\t\t\tsetNotifications((prev) => prev.map((n) => ({ ...n, read: true, status: 'read' })))\r\n\t\t\tsetUnreadCount(0)\r\n\t\t} catch (error) {\r\n\t\t\tconst m = getErrorMessage(error.message)\r\n\t\t\tenqueueSnackbar(m, { variant: 'error' })\r\n\t\t} finally {\r\n\t\t\tsetMarkingAllAsRead(false)\r\n\t\t}\r\n\t}, [markingAllAsRead, unreadCount])\r\n\r\n\t// Remove the problematic useEffect that was causing extra API calls\r\n\r\n useEffect(() => {\r\n if(!open) {\r\n setTimeout(() => {\r\n setNotifications([])\r\n }, 500)\r\n }\r\n }, [open])\r\n\r\n\tconst getPerformerLabel = (action: string) => {\r\n\t\tswitch (action?.toLowerCase()) {\r\n\t\t\tcase 'approved':\r\n\t\t\t\treturn 'Approved by'\r\n\t\t\tcase 'rejected':\r\n\t\t\tcase 'reject':\r\n\t\t\t\treturn 'Rejected by'\r\n\t\t\tdefault:\r\n\t\t\t\treturn 'Request to'\r\n\t\t}\r\n\t}\r\n\r\n\tconst getStatusIcon = (action: string) => {\r\n\t\tswitch (action?.toLowerCase()) {\r\n\t\t\tcase 'approved':\r\n\t\t\t\treturn <CheckCircleIcon sx={{ fontSize: '0.9rem', color: 'success.main' }} />\r\n\t\t\tcase 'rejected':\r\n\t\t\tcase 'reject':\r\n\t\t\t\treturn <CancelIcon sx={{ fontSize: '0.9rem', color: 'error.main' }} />\r\n\t\t\tdefault:\r\n\t\t\t\treturn <HourglassEmptyIcon sx={{ fontSize: '0.9rem', color: 'warning.main' }} />\r\n\t\t}\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Box>\r\n\t\t\t<IconButton\r\n\t\t\t\t// size=\"small\"\r\n\t\t\t\taria-label=\"notifications\"\r\n\t\t\t\taria-controls={open ? 'notification-menu' : undefined}\r\n\t\t\t\taria-haspopup=\"true\"\r\n\t\t\t\taria-expanded={open ? 'true' : undefined}\r\n\t\t\t\tonClick={handleClick}\r\n\t\t\t>\r\n\t\t\t\t<Badge badgeContent={unreadCount} color=\"error\">\r\n\t\t\t\t\t<Notification fontSize=\"medium\" />\r\n\t\t\t\t</Badge>\r\n\t\t\t</IconButton>\r\n\r\n\t\t\t<Menu\r\n\t\t\t\tid=\"notification-menu\"\r\n\t\t\t\tanchorEl={anchorEl}\r\n\t\t\t\topen={open}\r\n\t\t\t\tonClose={handleClose}\r\n\t\t\t\tref={menuRef}\r\n\t\t\t\tslotProps={{\r\n\t\t\t\t\tpaper: {\r\n\t\t\t\t\t\tsx: {\r\n\t\t\t\t\t\t\toverflow: 'visible',\r\n\t\t\t\t\t\t\tminWidth: 400,\r\n\t\t\t\t\t\t\tmaxWidth: 450,\r\n\t\t\t\t\t\t\tmaxHeight: 520,\r\n\t\t\t\t\t\t\t'&:before': {\r\n\t\t\t\t\t\t\t\tcontent: '\"\"',\r\n\t\t\t\t\t\t\t\tdisplay: 'block',\r\n\t\t\t\t\t\t\t\tposition: 'absolute',\r\n\t\t\t\t\t\t\t\ttop: 0,\r\n\t\t\t\t\t\t\t\tright: '50%',\r\n\t\t\t\t\t\t\t\twidth: 10,\r\n\t\t\t\t\t\t\t\theight: 10,\r\n\t\t\t\t\t\t\t\tbgcolor: 'background.paper',\r\n\t\t\t\t\t\t\t\ttransform: 'translateY(-50%) translateX(50%) rotate(45deg)',\r\n\t\t\t\t\t\t\t\tzIndex: 0,\r\n\t\t\t\t\t\t\t\tborder: '1px solid',\r\n\t\t\t\t\t\t\t\tborderColor: ({ palette }) => palette.grey[300],\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t},\r\n\t\t\t\t}}\r\n\t\t\t\tsx={{\r\n\t\t\t\t\t'& .MuiList-root': {\r\n\t\t\t\t\t\tborderRadius: '8px',\r\n\t\t\t\t\t\tmaxHeight: 520,\r\n\t\t\t\t\t\toverflowY: 'auto',\r\n\t\t\t\t\t\tpadding: 0,\r\n\t\t\t\t\t},\r\n\t\t\t\t}}\r\n\t\t\t\ttransformOrigin={{ horizontal: 'center', vertical: 'top' }}\r\n\t\t\t\tanchorOrigin={{ horizontal: 'center', vertical: 'bottom' }}\r\n\t\t\t\tonScroll={handleScroll}\r\n\t\t\t>\r\n\t\t\t\t{/* Header */}\r\n\t\t\t\t<Box sx={{ px: 2, py: 1, borderBottom: '1px solid #e0e0e0', backgroundColor: '#fafafa' }}>\r\n\t\t\t\t\t<Typography type=\"h5\" weight=\"bold\" color=\"grey.1000\">\r\n\t\t\t\t\t\tNotifications\r\n\t\t\t\t\t</Typography>\r\n\t\t\t\t\t{unreadCount > 0 && (\r\n\t\t\t\t\t\t<Box sx={{ display: 'flex', justifyContent: 'space-between', width: '100%', alignItems: 'center' }}>\r\n\t\t\t\t\t\t\t<Typography type=\"s4\" color=\"grey.800\">\r\n\t\t\t\t\t\t\t\tYou have {unreadCount} unread notification{unreadCount > 1 ? 's' : ''}\r\n\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\tvariant=\"text\"\r\n\t\t\t\t\t\t\t\tstartIcon={\r\n\t\t\t\t\t\t\t\t\tmarkingAllAsRead ? (\r\n\t\t\t\t\t\t\t\t\t\t<CircularProgress size={15} color=\"inherit\" />\r\n\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t<Tick sx={{ fontSize: '0.75rem !important' }} color=\"grey.900\" />\r\n\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tsx={{ p: 0 }}\r\n\t\t\t\t\t\t\t\tonClick={handleMarkAllAsRead}\r\n\t\t\t\t\t\t\t\tdisabled={unreadCount <= 0 || markingAllAsRead}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t<Typography type=\"s4\" color=\"grey.900\">\r\n\t\t\t\t\t\t\t\t\tMark all as read\r\n\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t)}\r\n\t\t\t\t</Box>\r\n\r\n\t\t\t\t{/* Loading State */}\r\n\t\t\t\t{loading && notifications.length === 0 && (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<Box\r\n\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\t\t\tflexDirection: 'column',\r\n\t\t\t\t\t\t\t\tgap: 1,\r\n\t\t\t\t\t\t\t\tjustifyContent: 'center',\r\n\t\t\t\t\t\t\t\tminWidth: 400,\r\n\t\t\t\t\t\t\t\tp: 1,\r\n\t\t\t\t\t\t\t\tm: 1,\r\n\t\t\t\t\t\t\t\tbackgroundColor: 'grey.200',\r\n\t\t\t\t\t\t\t\tborderRadius: '8px',\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<Box sx={{ display: 'flex', gap: 1 }}>\r\n\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={40} height={40} />\r\n\t\t\t\t\t\t\t\t<Box sx={{ display: 'flex', flexDirection: 'column', gap: 0.5 }}>\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={25} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={150} height={11} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={11} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={11} />\r\n\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t<Box\r\n\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\t\t\tflexDirection: 'column',\r\n\t\t\t\t\t\t\t\tgap: 1,\r\n\t\t\t\t\t\t\t\tjustifyContent: 'center',\r\n\t\t\t\t\t\t\t\tminWidth: 400,\r\n\t\t\t\t\t\t\t\tp: 1,\r\n\t\t\t\t\t\t\t\tm: 1,\r\n\t\t\t\t\t\t\t\tbackgroundColor: 'grey.200',\r\n\t\t\t\t\t\t\t\tborderRadius: '8px',\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<Box sx={{ display: 'flex', gap: 1 }}>\r\n\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={40} height={40} />\r\n\t\t\t\t\t\t\t\t<Box sx={{ display: 'flex', flexDirection: 'column', gap: 0.5 }}>\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={25} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={150} height={11} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={11} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={11} />\r\n\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t<Box\r\n\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\t\t\tflexDirection: 'column',\r\n\t\t\t\t\t\t\t\tgap: 1,\r\n\t\t\t\t\t\t\t\tjustifyContent: 'center',\r\n\t\t\t\t\t\t\t\tminWidth: 400,\r\n\t\t\t\t\t\t\t\tp: 1,\r\n\t\t\t\t\t\t\t\tm: 1,\r\n\t\t\t\t\t\t\t\tbackgroundColor: 'grey.200',\r\n\t\t\t\t\t\t\t\tborderRadius: '8px',\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<Box sx={{ display: 'flex', gap: 1 }}>\r\n\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={40} height={40} />\r\n\t\t\t\t\t\t\t\t<Box sx={{ display: 'flex', flexDirection: 'column', gap: 0.5 }}>\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={25} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={150} height={11} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={11} />\r\n\t\t\t\t\t\t\t\t\t<Skeleton variant=\"rounded\" width={360} height={11} />\r\n\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t</>\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t{/* Error State */}\r\n\t\t\t\t{error && (\r\n\t\t\t\t\t<Box sx={{ p: 2 }}>\r\n\t\t\t\t\t\t<Alert severity=\"error\">{error}</Alert>\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t{/* Notifications List */}\r\n\t\t\t\t{!loading && !error && notifications.length > 0 && (\r\n\t\t\t\t\t<Box sx={{ maxHeight: 420, overflowY: 'auto', p: 1 }} onScroll={handleScroll}>\r\n\t\t\t\t\t\t{notifications.map((notification) => (\r\n\t\t\t\t\t\t\t<div key={notification.id}>\r\n\t\t\t\t\t\t\t\t<MenuItem\r\n\t\t\t\t\t\t\t\t\tonClick={() => handleNotificationClick(notification.id)}\r\n\t\t\t\t\t\t\t\t\tsx={({ palette }) => ({\r\n\t\t\t\t\t\t\t\t\t\tpy: 1,\r\n\t\t\t\t\t\t\t\t\t\tpx: 1,\r\n\t\t\t\t\t\t\t\t\t\tbackgroundColor: !notification.read ? palette.theme.grey[200] : 'transparent',\r\n\t\t\t\t\t\t\t\t\t\tborder: `1px solid ${palette.grey[200]}`,\r\n\t\t\t\t\t\t\t\t\t\tmarginBottom: '4px !important',\r\n\t\t\t\t\t\t\t\t\t\t'&:hover': {\r\n\t\t\t\t\t\t\t\t\t\t\tbackgroundColor: palette.theme.grey[200],\r\n\t\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t\talignItems: 'flex-start',\r\n\t\t\t\t\t\t\t\t\t\tminHeight: 'auto',\r\n\t\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<ListItemAvatar sx={{ minWidth: 48, mt: 0 }}>\r\n\t\t\t\t\t\t\t\t\t\t{mainModuleIcons?.[notification.module] ? (\r\n\t\t\t\t\t\t\t\t\t\t\t<Avatar\r\n\t\t\t\t\t\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 40,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\theight: 40,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tfontSize: '0.875rem',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbgcolor: mainModuleBgColors[notification.module] || 'primary.main',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: 'white',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tborderRadius: '8px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tboxShadow: '0 2px 8px rgba(0,0,0,0.1)',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'& img': {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '28px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: '28px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tobjectFit: 'contain',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t\tsrc={mainModuleIcons?.[notification.module]}\r\n\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t\t{notification.avatar ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Avatar\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 40,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: 40,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfontSize: '0.875rem',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbgcolor: 'primary.main',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: 'white',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tborderRadius: '8px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tboxShadow: '0 2px 8px rgba(0,0,0,0.1)',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{notification.avatar}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Avatar>\r\n\t\t\t\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Avatar\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 36,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: 36,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbgcolor: 'grey.100',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: 'grey.600',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tborderRadius: '8px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tboxShadow: '0 2px 8px rgba(0,0,0,0.1)',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{getNotificationIcon(notification)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Avatar>\r\n\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t</ListItemAvatar>\r\n\t\t\t\t\t\t\t\t\t<ListItemText\r\n\t\t\t\t\t\t\t\t\t\tsx={{ margin: 0, pr: 1 }}\r\n\t\t\t\t\t\t\t\t\t\tprimary={\r\n\t\t\t\t\t\t\t\t\t\t\t// Line 1: title seriesNumber statusIcon\r\n\t\t\t\t\t\t\t\t\t\t\t<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, flexWrap: 'wrap', mb: 0.25 }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<Typography type=\"s3\" weight=\"bold\" color=\"grey.1000\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{notification.title}\r\n\t\t\t\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t\t{notification.seriesNumber && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Typography type=\"s4\" sx={{ color: 'text.secondary', fontWeight: 500 }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{notification.seriesNumber}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t{getStatusIcon(notification.type)}\r\n\t\t\t\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tsecondary={\r\n\t\t\t\t\t\t\t\t\t\t\t<Box>\r\n\t\t\t\t\t\t\t\t\t\t\t\t{/* Line 2: Customer / Vendor label + name */}\r\n\t\t\t\t\t\t\t\t\t\t\t\t{notification.customerName && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Typography type=\"s4\" color=\"grey.800\" sx={{ display: 'block', mb: 0.25 }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Typography component=\"span\" type=\"s5\" sx={{ fontSize: '0.7rem !important', color: 'text.secondary', mr: 0.5 }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{notification.module === 'purchase' ? 'Vendor:' : 'Customer:'}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{notification.customerName}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t{/* Line 3: Approved by {name} · timestamp */}\r\n\t\t\t\t\t\t\t\t\t\t\t\t<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, flexWrap: 'wrap' }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{notification.performedByName && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Typography type=\"s5\" sx={{ fontSize: '0.7rem !important', color: 'text.secondary' }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{getPerformerLabel(notification.type)} {notification.performedByName}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{notification.performedByName && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Box sx={{ height: 4, width: 4, borderRadius: '100%', backgroundColor: 'grey.400', flexShrink: 0 }} />\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Typography type=\"s5\" color=\"primary\" sx={{ fontSize: '0.65rem !important' }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{notification.timestamp}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t{!notification.read && (\r\n\t\t\t\t\t\t\t\t\t\t<Box\r\n\t\t\t\t\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\t\t\t\t\twidth: 10,\r\n\t\t\t\t\t\t\t\t\t\t\t\theight: 10,\r\n\t\t\t\t\t\t\t\t\t\t\t\tborderRadius: '50%',\r\n\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor: 'primary.main',\r\n\t\t\t\t\t\t\t\t\t\t\t\tflexShrink: 0,\r\n\t\t\t\t\t\t\t\t\t\t\t\tmt: 0.5,\r\n\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t))}\r\n\r\n\t\t\t\t\t\t{/* Loading More Indicator */}\r\n\t\t\t\t\t\t{loadingMore && (\r\n\t\t\t\t\t\t\t<Box sx={{ display: 'flex', justifyContent: 'center', py: 2.5, px: 3 }}>\r\n\t\t\t\t\t\t\t\t<CircularProgress size={20} />\r\n\t\t\t\t\t\t\t\t<Typography variant=\"body2\" sx={{ ml: 1.5, color: 'text.secondary' }}>\r\n\t\t\t\t\t\t\t\t\tLoading more...\r\n\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t{/* End of List Indicator */}\r\n\t\t\t\t\t\t{!pagination.hasMore && notifications.length > 0 && (\r\n\t\t\t\t\t\t\t<Box sx={{ textAlign: 'center', py: 1.5, px: 2 }}>\r\n\t\t\t\t\t\t\t\t<Typography type=\"s3\" color=\"grey.800\" textAlign=\"center\">\r\n\t\t\t\t\t\t\t\t\tNo more notifications\r\n\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t{/* Empty State */}\r\n\t\t\t\t{!loading && !error && notifications.length === 0 && (\r\n\t\t\t\t\t<Box sx={{ p: 4, textAlign: 'center' }}>\r\n\t\t\t\t\t\t<Notification sx={{ fontSize: 56, color: 'text.secondary', mb: 2 }} />\r\n\t\t\t\t\t\t<Typography type=\"s1\" color=\"grey.800\" sx={{ mb: 1 }} textAlign=\"center\">\r\n\t\t\t\t\t\t\tNo notifications yet\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t)}\r\n\t\t\t</Menu>\r\n\t\t</Box>\r\n\t)\r\n}\r\n\r\nexport { NotificationMenu };\r\nexport default NotificationMenu\r\n","// components/header/Header.tsx - Complete updated version with English fallback\r\nimport React, { useState, useCallback, useMemo } from \"react\";\r\nimport { Link, matchRoutes, useLocation, useNavigate } from \"react-router-dom\";\r\nimport Box from \"@mui/material/Box\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport LockIcon from \"@mui/icons-material/Lock\";\r\nimport IconButton from \"@mui/material/IconButton\";\r\nimport MenuItem from \"@mui/material/MenuItem\";\r\nimport Menu from \"@mui/material/Menu\";\r\nimport KeyboardBackspaceIcon from \"@mui/icons-material/KeyboardBackspace\";\r\nimport ListItemText from \"@mui/material/ListItemText\";\r\nimport Divider from \"@mui/material/Divider\";\r\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\r\n\r\n\r\nimport { Pathname } from \"../../constants/pathnames/pathname\"; // Removed - should be passed as props\r\nimport Typography from \"../typography/typography\";\r\nimport logo, { images } from \"../../assets/images\";\r\nimport Select from \"../select/select\";\r\nimport modules from \"../../constants/modules\"; // Removed - should be passed as props\r\nimport Avatar from \"../avatar/avatar\";\r\nimport { useAuth } from \"../../hooks/useAuth\";\r\nimport ConfirmPopUp from \"../confirm-modal/confirm-modal\";\r\nimport formatText from \"../../utils/format-text\";\r\nimport \"./header.scss\";\r\nimport { useLanguage } from \"../../hooks/useLangauge\";\r\nimport { Eye } from \"../icons\";\r\nimport ResetPasswordModal from \"../reset-password-modal/reset-password-modal\";\r\nimport NotificationMenu from \"./components/notification-menu/notification-menu\";\r\nimport { getApiConfig } from \"@/utils\";\r\n\r\ninterface ILanguage {\r\n label: string;\r\n code: string;\r\n direction: string;\r\n}\r\n\r\ninterface IModule {\r\n label: any;\r\n link: string;\r\n sidebar: string;\r\n icon: string;\r\n permission: string;\r\n bg: string;\r\n connectedRoutes: string[];\r\n translationModule: string;\r\n}\r\n\r\n\r\nexport function Header(props: any): React.ReactElement {\r\n const navigate = useNavigate();\r\n const { t } = useTranslation();\r\n const location = useLocation();\r\n const { logout, user } = useAuth();\r\n const config = getApiConfig();\r\n\r\n const {\r\n languages,\r\n currentLanguage,\r\n changeLanguage,\r\n isLoading: languagesLoading,\r\n error: languageContextError,\r\n isFallbackActive,\r\n fetchLanguages,\r\n isRtl\r\n } = useLanguage();\r\n\r\n const { pathname } = location;\r\n const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);\r\n const [logoutConfirmation, setLogoutConfirmation] = useState<boolean>(false);\r\n const [localLanguageError, setLocalLanguageError] = useState<string | null>(null);\r\n const [showModal, setShowModal] = useState(false);\r\n\r\n const u_data = localStorage.getItem(\"_u_data\") || undefined;\r\n const userData = u_data ? JSON.parse(u_data) : \"\";\r\n const isMenuOpen = Boolean(anchorEl);\r\n\r\n const handleLogoutConfirmation = () =>\r\n setLogoutConfirmation(!logoutConfirmation);\r\n\r\n const checkMatchedRoutes = useCallback(\r\n (paths: string[] | string) => {\r\n const shouldMatch: { path: string }[] = Array.isArray(paths)\r\n ? paths.map((path: string) => ({ path }))\r\n : [{ path: paths }];\r\n\r\n return Boolean(matchRoutes(shouldMatch, location));\r\n },\r\n [location],\r\n );\r\n\r\n const erp_modules = useMemo<IModule[]>(() => modules(t), [t]);\r\n\r\n const selectedModule = useMemo<IModule | null>(() => {\r\n return (\r\n erp_modules.find(\r\n (module: IModule) =>\r\n module?.link?.toLowerCase() === pathname.toLowerCase() ||\r\n checkMatchedRoutes(module.connectedRoutes),\r\n ) || null\r\n );\r\n }, [erp_modules, pathname, checkMatchedRoutes]);\r\n\r\n const handleChangePasswordView = () => {\r\n setShowModal(true);\r\n }\r\n\r\n // Enhanced language change handler with validation and error handling\r\n const onChangeLang = (e: React.ChangeEvent<HTMLSelectElement>) => {\r\n const lang_code = e.target.value;\r\n\r\n // Clear any previous errors\r\n setLocalLanguageError(null);\r\n\r\n // Validate the language exists before changing\r\n if (!languages || languages.length === 0) {\r\n const errorMsg = t('header.language_not_available') || 'Languages not available';\r\n setLocalLanguageError(errorMsg);\r\n return;\r\n }\r\n\r\n const languageExists = languages.some((lang: ILanguage) => lang.code === lang_code);\r\n\r\n if (languageExists) {\r\n try {\r\n changeLanguage(lang_code);\r\n } catch (error) {\r\n const errorMsg = error instanceof Error ? error.message : 'Failed to change language';\r\n setLocalLanguageError(errorMsg);\r\n }\r\n } else {\r\n const errorMsg = t('header.language_not_found', { language: lang_code }) ||\r\n `Selected language \"${lang_code}\" is not available`;\r\n setLocalLanguageError(errorMsg);\r\n }\r\n };\r\n\r\n // Retry language loading\r\n const handleRetryLanguages = async () => {\r\n setLocalLanguageError(null);\r\n try {\r\n await fetchLanguages();\r\n } catch (error) {\r\n const errorMsg = 'Failed to reload languages';\r\n setLocalLanguageError(errorMsg);\r\n }\r\n };\r\n\r\n\r\n const handleProfileMenuOpen = (event: React.MouseEvent<HTMLElement>) =>\r\n setAnchorEl(event.currentTarget);\r\n\r\n const handleMenuClose = () => {\r\n setAnchorEl(null);\r\n };\r\n\r\n const handleChange = (event: any) => {\r\n const selectedLink = event.target.value;\r\n setTimeout(() => {\r\n navigate(selectedLink);\r\n }, 300);\r\n };\r\n\r\n const handleBackButton = () => {\r\n window.history.back();\r\n };\r\n\r\n // Get current language display value with fallback indication\r\n const getCurrentLanguageDisplay = (): string => {\r\n if (!currentLanguage) return t('header.select_language') || 'Select Language';\r\n\r\n // Show fallback indicator for better UX\r\n if (isFallbackActive || languageContextError) {\r\n return `${currentLanguage.label}`;\r\n }\r\n\r\n return currentLanguage.label;\r\n };\r\n\r\n // Create English fallback for consistent display\r\n const createEnglishFallback = (): ILanguage => ({\r\n code: 'en',\r\n label: 'English',\r\n direction: 'ltr'\r\n });\r\n\r\n // Get languages for dropdown - ensure English is always available\r\n const getLanguagesForDropdown = (): ILanguage[] => {\r\n if (!languages || languages.length === 0) {\r\n // If no languages available, show only English\r\n return [createEnglishFallback()];\r\n }\r\n\r\n // Ensure English is in the list\r\n const hasEnglish = languages.some(lang => lang.code === 'en');\r\n if (!hasEnglish) {\r\n return [createEnglishFallback(), ...languages];\r\n }\r\n\r\n return languages;\r\n };\r\n\r\n // Render language selector based on different states\r\n const renderLanguageSelector = () => {\r\n const availableLanguages = getLanguagesForDropdown();\r\n const displayValue = currentLanguage?.code || 'en'; // Default to English\r\n\r\n // Loading state\r\n if (languagesLoading) {\r\n return (\r\n <Box className=\"language-loading\">\r\n <Typography variant=\"body2\" color=\"text.secondary\">\r\n {'Loading...'}\r\n </Typography>\r\n </Box>\r\n );\r\n }\r\n\r\n // Always show dropdown with at least English available\r\n return (\r\n <Select\r\n onChange={onChangeLang}\r\n size=\"small\"\r\n value={displayValue}\r\n renderValue={() => getCurrentLanguageDisplay()}\r\n error={!!localLanguageError}\r\n className={`language-select ${isFallbackActive || languageContextError ? 'language-fallback-active' : ''}`}\r\n\r\n >\r\n {availableLanguages.map(({ code, label }: ILanguage) => (\r\n <MenuItem key={code} value={code}>\r\n <Typography\r\n type=\"s4\"\r\n weight=\"medium\"\r\n color=\"theme.secondary.1000\"\r\n\r\n >\r\n {label}\r\n {/* Show fallback indicator in dropdown */}\r\n {/* {(isFallbackActive || languageContextError) && code === 'en' && \r\n ` (${t('header.fallback') || 'Fallback'})`\r\n } */}\r\n </Typography>\r\n </MenuItem>\r\n ))}\r\n\r\n {/* Show retry option if there's an error */}\r\n {languageContextError && (\r\n <MenuItem onClick={handleRetryLanguages} style={{ fontStyle: 'italic' }}>\r\n <Typography\r\n type=\"s4\"\r\n weight=\"medium\"\r\n color=\"theme.secondary.500\"\r\n >\r\n 🔄 {t('header.retry_languages') || 'Retry loading languages'}\r\n </Typography>\r\n </MenuItem>\r\n )}\r\n </Select>\r\n );\r\n };\r\n\r\n const menuId = \"primary-search-account-menu\";\r\n const renderMenu = (\r\n <Menu\r\n className=\"main-profile-menu\"\r\n anchorEl={anchorEl}\r\n id={menuId}\r\n keepMounted\r\n open={isMenuOpen}\r\n onClose={handleMenuClose}\r\n >\r\n <MenuItem className=\"user-assigned\">\r\n <span>{t('common.assigned_roles') || 'Assigned roles'}</span>\r\n </MenuItem>\r\n <MenuItem className=\"user-data-wrap\" value={userData.role_id}>\r\n <ListItemIcon>\r\n <Avatar size={27} alt={userData.role_name} />\r\n </ListItemIcon>\r\n <ListItemText className=\"size15\">\r\n {userData.role_name}\r\n </ListItemText>\r\n <Typography variant=\"body2\" color=\"text.secondary\">\r\n <img src={images.tickicon} alt=\"Active\" />\r\n </Typography>\r\n </MenuItem>\r\n <Divider />\r\n <MenuItem\r\n className=\"user-assigned\"\r\n onClick={() => {\r\n handleChangePasswordView();\r\n setAnchorEl(null);\r\n }}\r\n >\r\n <ListItemIcon>\r\n <Eye fontSize=\"medium\" width={20} height={20} htmlColor=\"#292D32\" />\r\n </ListItemIcon>\r\n <ListItemText className=\"size15\">{t(\"common.change_password\")}</ListItemText>\r\n </MenuItem>\r\n <Divider />\r\n <MenuItem\r\n className=\"menu-item-color\"\r\n onClick={() => {\r\n handleLogoutConfirmation();\r\n setAnchorEl(null);\r\n }}\r\n >\r\n <ListItemIcon>\r\n <img src={images.logout} alt=\"logout\" />\r\n </ListItemIcon>\r\n <ListItemText className=\"size15\">{t(\"common.logout\")}</ListItemText>\r\n </MenuItem>\r\n </Menu>\r\n );\r\n\r\n const appLogo = getApiConfig().appLogo || images.logo\r\n\r\n return (\r\n <>\r\n <Box className=\"main-box\">\r\n {!props.isDropdownShow && (\r\n <Link to={user ? Pathname.DASHBOARD : Pathname.LOGIN}>\r\n <img src={appLogo} alt=\"logo\" height={55}/>\r\n </Link>\r\n )}\r\n <Box className=\"second-box\">\r\n {props.isDropdownShow && (\r\n <>\r\n <IconButton onClick={handleBackButton}>\r\n <KeyboardBackspaceIcon\r\n className={isRtl ? \"arrow-pointer_rtl\" : \"arrow-pointer\"}\r\n />\r\n </IconButton>\r\n <Box width={250}>\r\n <Select\r\n fullWidth\r\n placeholder=\"Placeholder\"\r\n size={\"small\"}\r\n value={selectedModule?.link || \"\"}\r\n onChange={handleChange}\r\n className=\"select-box\"\r\n variant=\"outlined\"\r\n renderValue={(value: string) => (\r\n <>\r\n {selectedModule ? (\r\n <Box className=\"selected-menu-box\">\r\n <img\r\n src={selectedModule.icon}\r\n alt={selectedModule.label}\r\n />\r\n {selectedModule.label}\r\n </Box>\r\n ) : (\r\n value\r\n )}\r\n </>\r\n )}\r\n >\r\n {erp_modules.map((module: any, index: number) => (\r\n <MenuItem\r\n className=\"select-box-menu-item\"\r\n value={module.link}\r\n key={index}\r\n >\r\n <img src={module.icon} alt={module.label} />\r\n {module.label}\r\n </MenuItem>\r\n ))}\r\n </Select>\r\n </Box>\r\n </>\r\n )}\r\n </Box>\r\n <Box className=\"header-right-wrap\">\r\n {/* Language Selector with Enhanced Fallback Support */}\r\n <Box className=\"language-selector-wrapper\">\r\n {renderLanguageSelector()}\r\n </Box>\r\n\r\n {/* <IconButton\r\n size=\"small\"\r\n aria-label=\"notification bell\"\r\n className=\"p-0\"\r\n >\r\n <img src={logo.notification} alt=\"notification icon\" />\r\n </IconButton> */}\r\n <NotificationMenu />\r\n <IconButton\r\n size=\"small\"\r\n aria-label=\"help\"\r\n className=\"p-0\"\r\n >\r\n <img src={logo.question} alt=\"question icon\" />\r\n </IconButton>\r\n <img src={logo.vdivider} alt=\"divider icon\" />\r\n {localStorage.getItem(\"_tid\") ? (\r\n <Box className=\"user-profile-box\" onClick={handleProfileMenuOpen}>\r\n <Avatar\r\n size={32}\r\n src={user?.profile_image ? `${config?.s3BucketUrl}${user?.profile_image}` : undefined}\r\n alt={formatText(user?.full_name)}\r\n className=\"avatar-class\"\r\n />\r\n <div>\r\n <Typography className=\"profile-name\">\r\n {user?.full_name}\r\n </Typography>\r\n <Typography className=\"user-auth\">\r\n {user?.role_name}\r\n </Typography>\r\n </div>\r\n </Box>\r\n ) : (\r\n <IconButton\r\n size=\"large\"\r\n edge=\"end\"\r\n aria-label=\"account of current user\"\r\n aria-controls={menuId}\r\n aria-haspopup=\"true\"\r\n component={Link}\r\n to={Pathname.LOGIN}\r\n color=\"inherit\"\r\n >\r\n <LockIcon className=\"icon-btn\" />\r\n </IconButton>\r\n )}\r\n </Box>\r\n {renderMenu}\r\n </Box>\r\n\r\n {/* Logout Confirmation Dialog */}\r\n <ConfirmPopUp\r\n open={logoutConfirmation}\r\n title={t(\"common.logout\")}\r\n description={t('common.logout_confirmation') || \"Are you sure, you want to logout?\"}\r\n onConfirm={() => logout()}\r\n onClose={handleLogoutConfirmation}\r\n fullWidth\r\n maxWidth=\"xs\"\r\n buttonTexts={{\r\n confirm: t(\"common.logout\"),\r\n cancel: t(\"common.cancel\"),\r\n }}\r\n />\r\n\r\n <ResetPasswordModal showModal={showModal} setShowModal={setShowModal} />\r\n\r\n </>\r\n );\r\n}\r\n\r\nexport default Header;","import { styled } from \"@mui/material/styles\";\nimport MuiAppBar, { AppBarProps as MuiAppBarProps } from \"@mui/material/AppBar\";\nimport Toolbar from \"@mui/material/Toolbar\";\n// import MenuIcon from \"@mui/icons-material/Menu\";\nimport IconButton from \"@mui/material/IconButton\";\n\n// import { Box, FormControl, FormControlLabel, FormLabel, Radio, RadioGroup, ThemeProvider } from '@mui/material';\n\nimport Header from \"../header/header\";\n// import ThemeSelector from \"../../utils/themeSelector\";\n\nimport \"./appbar.scss\";\nimport images from \"../../assets/images\";\n// import { Box } from \"@mui/material\";\n\nlet drawerWidth: any;\n\ninterface AppBarProps extends MuiAppBarProps {\n open?: boolean;\n}\n\n// const getTheme = (selectedTheme: any) => {\n// switch (selectedTheme) {\n// case ThemeSelector.PRIMARY:\n// return themes.redStone;\n// case ThemeSelector.SECONDARY:\n// return themes.blueNavy;\n// case ThemeSelector.TERTIARY:\n// return themes.oliveGreen;\n// default:\n// return themes.redStone;\n// }\n// };\n\nconst AppBar = styled(MuiAppBar, {\n shouldForwardProp: (prop) => prop !== \"open\",\n})<AppBarProps>(({ theme, open }) => ({\n zIndex: theme.zIndex.drawer + 1,\n transition: theme.transitions.create([\"width\", \"margin\"], {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.leavingScreen,\n }),\n ...(open && {\n marginLeft: document.body.dir === \"ltr\" ? drawerWidth : 0,\n marginRight: document.body.dir === \"rtl\" ? drawerWidth : 0,\n width: `calc(100% - ${drawerWidth}px)`,\n transition: theme.transitions.create([\"width\", \"margin\"], {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.enteringScreen,\n }),\n }),\n boxShadow: \"none\",\n}));\n\nexport const AppBarWrapper = (props: any) => {\n drawerWidth = props.width;\n\n // const handleThemeChange = (e: any) => setSelectedTheme(e.target.value);\n\n return (\n <AppBar\n position=\"fixed\"\n open={props?.open}\n sx={(theme) => ({\n borderBottom: \"1px solid\",\n borderColor: theme.palette.theme?.secondary[200],\n backgroundColor: theme.palette.theme?.secondary[100],\n })}\n >\n {/* <FormControl>\n <FormLabel id=\"theme-radio-buttons-group-label\">Theme</FormLabel>\n <RadioGroup\n row\n value={selectedTheme}\n onChange={handleThemeChange}\n aria-labelledby=\"theme-radio-buttons-group-label\"\n name=\"row-radio-buttons-group\"\n >\n {Object.keys(ThemeSelector)?.map((variant: any, index: any) => (\n <FormControlLabel\n key={index}\n value={ThemeSelector[variant]}\n control={<Radio />}\n label={ThemeSelector[variant]}\n sx={{\n '.MuiFormControlLabel-label': {\n color: 'theme.text',\n },\n }}\n />\n ))}\n </RadioGroup>\n </FormControl> */}\n <Toolbar sx={{ backgroundColor: 'grey.100'}}>\n {props?.handleDrawerOpen ? (\n <>\n <IconButton\n color=\"inherit\"\n aria-label=\"open drawer\"\n // onClick={props.handleDrawerOpen}\n edge=\"start\"\n sx={{\n marginRight: 5,\n ...(props.open && { display: \"none\" }),\n }}\n >\n {/* <MenuIcon sx={{ color: \"theme.secondary.1000\" }} /> */}\n <img src={images.favicon} height={30} width={30}></img>\n </IconButton>\n {/* {!props.open && ( \n <Box marginRight={5}>\n <img src={images.favicon} height={30} width={30}></img>\n </Box>\n )} */}\n <Header isDropdownShow={true} />\n </>\n ) : (\n <>\n <Header isDropdownShow={false} />\n </>\n )}\n </Toolbar>\n {/* <Header /> */}\n </AppBar>\n );\n};\n\nexport default AppBarWrapper;\n","import Box from \"@mui/material/Box\";\r\nimport \"./activityArea.scss\";\r\n\r\nexport const ActivityArea = (props: any) => {\r\n return (\r\n <Box\r\n className=\"main-wrapper\"\r\n component=\"main\"\r\n width={\"100%\"}\r\n // sx={{ flexGrow: 1, p: 3, flexWrap: \"wrap\" }}\r\n marginTop=\"4.6875rem\"\r\n >\r\n {props.children}\r\n </Box>\r\n );\r\n};\r\n\r\nexport default ActivityArea;\r\n"],"names":["StyledButton","styled","MUIButton","theme","palette","fontSize","textTransform","minHeight","minWidth","padding","fontWeight","lineHeight","letterSpacing","backgroundColor","_a","primary","_b","border","boxShadow","color","_c","_d","secondary","_e","_f","error","_g","opacity","Button","props","children","variant","rest","jsx","StyledDialog","Dialog","borderRadius","display","alignItems","justifyContent","Modal","open","onClose","StyledSearch","TextField","borderBottom","input","paddingLeft","SelectSearch","forwardRef","searchPlaceholder","handleSearch","value","ref","inputRef","placeholder","onChange","fullWidth","InputProps","startAdornment","InputAdornment","position","SearchIcon","StyledSelect","MUISelect","borderColor","borderWidth","background","_h","_i","Select","memo","searchInputRef","useRef","label","dataPosition","dataName","required","searchValue","renderValue","helperText","loading","CustomDropdownIcon","ArrowDown","jsxs","Fragment","Typography","type","weight","mb","style","IconComponent","iconProps","MenuProps","PaperProps","sx","maxHeight","overflowY","anchorOrigin","vertical","horizontal","displayEmpty","onOpen","setTimeout","current","focus","Box","top","zIndex","margin","e","target","onClick","stopPropagation","onKeyDown","p","width","CircularProgress","size","FormHelperText","StyledTextField","MUITextField","borderStyle","marginLeft","_j","_k","marginRight","hidden","className","DynamicInput","React","Controller","control","formControl","name","fieldArrayName","render","field","fieldState","defaultValue","replace","shouldApplyPrecission","includes","step","float_step","decimalPlaces","String","split","length","console","log","Number","toFixed","toString","multiline","is_multiline","minRows","formType","minLength","min","endAdornment","endIcon","IconButton","edge","onIconClick","inputProps","min_length","disabled","Boolean","message","onBlur","o","n","a","s","i","c","Promise","resolve","t","r","u","context","process","env","NODE_ENV","warn","mode","Object","assign","abortEarly","then","shouldUseNativeValidation","values","raw","errors","inner","criteriaMode","reduce","path","types","concat","reject","propTypes","PropTypes","shape","register","func","isRequired","setValue","_formState","object","string","node","bool","number","max","max_length","typeOfField","defaultProps","ConfirmPopUp","useTranslation","title","description","onConfirm","modalType","buttonTexts","confirm","cancel","buttonColors","showAction","icon","images","info","alert","isRtl","useLanguage","DialogTitle","src","alt","ml","disableRipple","CloseIcon","Divider","DialogContent","DialogActions","mr","StyledAlert","MUIAlert","height","Toast","handleUndo","handleClose","action","Close","Snackbar","autoHideDuration","severity","CheckCircleOutlineIcon","htmlColor","WarningAmberIcon","Avatar","badge","altIcon","avatarStyle","badgeSize","badgeBorder","altFirstChar","map","word","charAt","join","AvatarMUI","SvgIcon","Person2OutlinedIcon","validationSchema","Yup","login","current_password","password","matches","confirm_password","oneOf","ResetPasswordModal","showModal","setShowModal","changeUserPassword","useAuth","toast","setToast","useState","handleSubmit","trigger","useForm","resolver","yupResolver","onSubmit","async","showPassword","setShowPassword","showCurrentPassword","setShowCurrentPassword","showConfirmPassword","setShowConfirmPassword","FlexBox","flexDirection","gap","align","Eye","EyeOff","mainModuleIcons","rbac","user","document","accounting","inventory","manufacturing","sales","crm","rental","purchase","procurement","hrms","mainModuleBgColors","NotificationMenu","anchorEl","setAnchorEl","notifications","setNotifications","setLoading","loadingMore","setLoadingMore","setError","unreadCount","setUnreadCount","markingAllAsRead","setMarkingAllAsRead","pagination","setPagination","skip","limit","totalCount","hasMore","navigate","useNavigate","menuRef","isLoadingMoreRef","transformNotification","apiNotification","moduleIcons","AccountBalanceIcon","PersonIcon","approval","AssignmentIcon","subData","sub_module_data","id","notification_type","formatText","timestamp","dateString","date","Date","diffMs","diffMins","Math","floor","diffHours","diffDays","toLocaleDateString","formatTimestamp","created_at","read","status","avatar","performedUser","firstName","first_name","lastName","last_name","toUpperCase","getInitials","performed_user","performedByName","trim","module","subModule","sub_module","subModuleId","sub_module_id","seriesNumber","series_number","documentStatus","customerName","customer_name","fetchNotifications","useCallback","isLoadMore","prev","currentSkip","response","getV1Notification","getToken","success","data","Error","transformedNotifications","newSkip","unread","err","handleScroll","event","scrollTop","scrollHeight","clientHeight","getNotificationIcon","notification","EmailIcon","WarningIcon","CheckCircleIcon","handleMarkAllAsRead","enqueueSnackbar","getV1NotificationMarkAllAsRead","m","getErrorMessage","useEffect","getPerformerLabel","toLowerCase","getStatusIcon","CancelIcon","HourglassEmptyIcon","currentTarget","Badge","badgeContent","Notification","Menu","slotProps","paper","overflow","maxWidth","content","right","bgcolor","transform","grey","transformOrigin","onScroll","px","py","startIcon","Tick","Skeleton","Alert","MenuItem","notificationId","find","patchV1NotificationMarkAsReadId","url","moduleName","moduleId","notificationData","routeMap","sales_invoice","generateRouteWithId","PathnameGenerator","PathnameAccounting","VIEW_SALES_INVOICES","asset_transfers","VIEW_ASSET_TRANSFER","budgets","VIEW_BUDGET","cash_expense","VIEW_CASH_EXPENSE","credit_notes","VIEW_CREDIT_NOTE","debit_notes","VIEW_DEBIT_NOTE","expense_reimbursement","VIEW_EXPENSE_REIMBURSEMENT","journal_entries","VIEW_JOURNAL_ENTRY","payment_entries","VIEW_PAYMENT_ENTRY","purchase_invoice","VIEW_PURCHASE_INVOICE","stock_transfer","PathnameGeneratorInventory","PathnameInventory","VIEW_STOCK_TRANSFER","bills_of_materials","PathnameGeneratorManufacuring","PathnameManufacturing","VIEW_BILL_OF_MATERIAL","purchase_agreement","PathnameGeneratorPurchase","PathnamePurchase","VIEW_PURCHASE_AGREEMENT","purchase_orders","is_rental","RENTALROUTES","VIEW","VIEW_PURCHASE_ORDER","purchase_request","vra","VIEW_VENDOR_RETURNS","sales_customer_returns","PathnameGeneratorCrm","PathnameCrm","VIEW_CUSTOMER_RETURNS","sales_order","VIEW_SALES_ORDER","rental_order","PathnameGeneratorRental","PathnameRental","VIEW_RENTAL_ORDER","replacement_order","rental_agreement","VIEW_AGREEMENT","cross_hire_order","VIEW_CROSS_HIRE_ORDER","cross_hire_request","VIEW_CROSS_HIRE_REQUEST","convertToUnderscore","call","getNotificationUrl","handleNotificationClick","marginBottom","ListItemAvatar","mt","objectFit","ListItemText","pr","flexWrap","component","flexShrink","textAlign","Header","location","useLocation","logout","config","getApiConfig","languages","currentLanguage","changeLanguage","isLoading","languagesLoading","languageContextError","isFallbackActive","fetchLanguages","pathname","logoutConfirmation","setLogoutConfirmation","localLanguageError","setLocalLanguageError","u_data","localStorage","getItem","userData","JSON","parse","isMenuOpen","handleLogoutConfirmation","checkMatchedRoutes","paths","shouldMatch","Array","isArray","matchRoutes","erp_modules","useMemo","modules","selectedModule","link","connectedRoutes","onChangeLang","lang_code","errorMsg","some","lang","code","language","handleRetryLanguages","menuId","renderMenu","keepMounted","role_id","ListItemIcon","role_name","tickicon","appLogo","logo","isDropdownShow","Link","to","Pathname","DASHBOARD","LOGIN","window","history","back","KeyboardBackspaceIcon","selectedLink","index","availableLanguages","direction","displayValue","fontStyle","renderLanguageSelector","question","vdivider","profile_image","s3BucketUrl","full_name","LockIcon","drawerWidth","AppBar","MuiAppBar","shouldForwardProp","prop","drawer","transition","transitions","create","easing","sharp","duration","leavingScreen","body","dir","enteringScreen","marginTop","Toolbar","handleDrawerOpen","favicon","debounceTime","isDrivePage","searchText","searchTerm","setSearchTerm","debouncedSearchRef","initialSearchTerm","setItem","debounce","autoComplete","SearchStatus","Search","MUITooltip","componentsProps","tooltip"],"mappings":"0pDAEMA,EAAeC,EAAAA,OAAOC,SAAPD,CACpB,EAAGE,OAASC,iCAAmC,MAAA,CAC9CC,SAAU,UACVC,cAAe,OACfC,UAAW,OACXC,SAAU,OACVC,QAAS,iBACTC,WAAY,MACZC,WAAY,UACZC,cAAe,cAEf,wBAAyB,CACxBC,gBAAiB,OAGlB,wBAAyB,CACxBA,gBAAiB,OAAAC,EAAAV,EAAQD,YAAR,EAAAW,EAAeC,QAAQ,KAExC,UAAW,CACVF,gBAAiB,OAAAG,EAAAZ,EAAQD,YAAR,EAAAa,EAAeD,QAAQ,OAI1C,uBAAwB,CACvBE,OAAQ,OACRC,UAAW,4GACXC,MAAO,OAAAC,EAAAhB,EAAQD,YAAR,EAAAiB,EAAeL,QAAQ,MAG/B,mBAAoB,CACnBI,MAAO,OAAAE,EAAAjB,EAAQD,YAAR,EAAAkB,EAAeC,UAAU,KAChCT,gBAAiB,QACjB,UA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