@campxdev/campx-web-utils 0.6.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/README.md +46 -0
  2. package/dist/cjs/index.js +4 -0
  3. package/dist/cjs/index.js.map +1 -0
  4. package/dist/cjs/types/src/App.d.ts +1 -0
  5. package/dist/cjs/types/src/AppContent.d.ts +2 -0
  6. package/dist/cjs/types/src/components/ActivityLog.d.ts +13 -0
  7. package/dist/cjs/types/src/components/ChangePassword.d.ts +9 -0
  8. package/dist/cjs/types/src/config/axios.d.ts +12 -0
  9. package/dist/cjs/types/src/context/ConfirmDialogProvider.d.ts +4 -0
  10. package/dist/cjs/types/src/context/ErrorBoundary/ErrorBoundary.d.ts +5 -0
  11. package/dist/cjs/types/src/context/ErrorBoundary/Login.d.ts +17 -0
  12. package/dist/cjs/types/src/context/Providers.d.ts +9 -0
  13. package/dist/cjs/types/src/context/SnackbarProvider.d.ts +6 -0
  14. package/dist/cjs/types/src/context/application-store.d.ts +65 -0
  15. package/dist/cjs/types/src/hooks/useConfirm.d.ts +8 -0
  16. package/dist/cjs/types/src/index.d.ts +1 -0
  17. package/dist/cjs/types/src/layout/AppLayout/AppLayout.d.ts +23 -0
  18. package/dist/cjs/types/src/layout/AppLayout/components/HelpDocs.d.ts +11 -0
  19. package/dist/cjs/types/src/reportWebVitals.d.ts +3 -0
  20. package/dist/cjs/types/src/routes/main.d.ts +13 -0
  21. package/dist/cjs/types/src/selectors/BatchSelector.d.ts +2 -0
  22. package/dist/cjs/types/src/selectors/CourseSelector.d.ts +2 -0
  23. package/dist/cjs/types/src/selectors/DepartmentSelector.d.ts +2 -0
  24. package/dist/cjs/types/src/selectors/EmployeesSelector.d.ts +2 -0
  25. package/dist/cjs/types/src/selectors/FeeTypeSelector.d.ts +2 -0
  26. package/dist/cjs/types/src/selectors/HostelFloorSelector.d.ts +2 -0
  27. package/dist/cjs/types/src/selectors/HostelRoomSelector.d.ts +2 -0
  28. package/dist/cjs/types/src/selectors/PrintFormatSelector.d.ts +2 -0
  29. package/dist/cjs/types/src/selectors/ProgramSelector.d.ts +2 -0
  30. package/dist/cjs/types/src/selectors/RegulationSelector.d.ts +2 -0
  31. package/dist/cjs/types/src/selectors/SemesterSelector.d.ts +2 -0
  32. package/dist/cjs/types/src/selectors/YearRangeSelector.d.ts +7 -0
  33. package/dist/cjs/types/src/selectors/utils.d.ts +9 -0
  34. package/dist/cjs/types/src/setupTests.d.ts +1 -0
  35. package/dist/cjs/types/src/utils/constants.d.ts +4 -0
  36. package/dist/esm/index.js +4 -0
  37. package/dist/esm/index.js.map +1 -0
  38. package/dist/esm/types/src/App.d.ts +1 -0
  39. package/dist/esm/types/src/AppContent.d.ts +2 -0
  40. package/dist/esm/types/src/components/ActivityLog.d.ts +13 -0
  41. package/dist/esm/types/src/components/ChangePassword.d.ts +9 -0
  42. package/dist/esm/types/src/config/axios.d.ts +12 -0
  43. package/dist/esm/types/src/context/ConfirmDialogProvider.d.ts +4 -0
  44. package/dist/esm/types/src/context/ErrorBoundary/ErrorBoundary.d.ts +5 -0
  45. package/dist/esm/types/src/context/ErrorBoundary/Login.d.ts +17 -0
  46. package/dist/esm/types/src/context/Providers.d.ts +9 -0
  47. package/dist/esm/types/src/context/SnackbarProvider.d.ts +6 -0
  48. package/dist/esm/types/src/context/application-store.d.ts +65 -0
  49. package/dist/esm/types/src/context/export.d.ts +5 -0
  50. package/dist/esm/types/src/hooks/export.d.ts +1 -0
  51. package/dist/esm/types/src/hooks/useConfirm.d.ts +8 -0
  52. package/dist/esm/types/src/index.d.ts +1 -0
  53. package/dist/esm/types/src/layout/AppLayout/AppLayout.d.ts +23 -0
  54. package/dist/esm/types/src/layout/AppLayout/components/HelpDocs.d.ts +11 -0
  55. package/dist/esm/types/src/reportWebVitals.d.ts +3 -0
  56. package/dist/esm/types/src/routes/main.d.ts +13 -0
  57. package/dist/esm/types/src/selectors/BatchSelector.d.ts +2 -0
  58. package/dist/esm/types/src/selectors/CourseSelector.d.ts +2 -0
  59. package/dist/esm/types/src/selectors/DepartmentSelector.d.ts +2 -0
  60. package/dist/esm/types/src/selectors/EmployeesSelector.d.ts +2 -0
  61. package/dist/esm/types/src/selectors/FeeTypeSelector.d.ts +2 -0
  62. package/dist/esm/types/src/selectors/HostelFloorSelector.d.ts +2 -0
  63. package/dist/esm/types/src/selectors/HostelRoomSelector.d.ts +2 -0
  64. package/dist/esm/types/src/selectors/PrintFormatSelector.d.ts +2 -0
  65. package/dist/esm/types/src/selectors/ProgramSelector.d.ts +2 -0
  66. package/dist/esm/types/src/selectors/RegulationSelector.d.ts +2 -0
  67. package/dist/esm/types/src/selectors/SemesterSelector.d.ts +2 -0
  68. package/dist/esm/types/src/selectors/YearRangeSelector.d.ts +7 -0
  69. package/dist/esm/types/src/selectors/export.d.ts +12 -0
  70. package/dist/esm/types/src/selectors/utils.d.ts +9 -0
  71. package/dist/esm/types/src/setupTests.d.ts +1 -0
  72. package/dist/esm/types/src/utils/constants.d.ts +4 -0
  73. package/dist/index.d.ts +193 -0
  74. package/package.json +50 -17
  75. package/.prettierrc +0 -7
  76. package/craco.config.js +0 -22
  77. package/export.ts +0 -7
  78. package/public/favicon.ico +0 -0
  79. package/public/index.html +0 -43
  80. package/public/logo192.png +0 -0
  81. package/public/logo512.png +0 -0
  82. package/public/manifest.json +0 -25
  83. package/public/robots.txt +0 -3
  84. package/src/App.css +0 -38
  85. package/src/App.tsx +0 -16
  86. package/src/AppContent.tsx +0 -30
  87. package/src/components/ActivityLog.tsx +0 -96
  88. package/src/components/ChangePassword.tsx +0 -169
  89. package/src/config/axios.ts +0 -92
  90. package/src/context/ConfirmDialogProvider.tsx +0 -78
  91. package/src/context/ErrorBoundary/ErrorBoundary.tsx +0 -131
  92. package/src/context/ErrorBoundary/Login.tsx +0 -202
  93. package/src/context/Providers.tsx +0 -64
  94. package/src/context/SnackbarProvider.tsx +0 -42
  95. package/src/context/application-store.ts +0 -87
  96. package/src/hooks/useConfirm.ts +0 -57
  97. package/src/index.css +0 -13
  98. package/src/index.tsx +0 -19
  99. package/src/layout/AppLayout/AppLayout.tsx +0 -151
  100. package/src/layout/AppLayout/components/HelpDocs.tsx +0 -123
  101. package/src/logo.svg +0 -1
  102. package/src/react-app-env.d.ts +0 -1
  103. package/src/reportWebVitals.ts +0 -15
  104. package/src/routes/main.tsx +0 -27
  105. package/src/selectors/BatchSelector.tsx +0 -15
  106. package/src/selectors/CourseSelector.tsx +0 -16
  107. package/src/selectors/DepartmentSelector.tsx +0 -19
  108. package/src/selectors/EmployeesSelector.tsx +0 -20
  109. package/src/selectors/FeeTypeSelector.tsx +0 -15
  110. package/src/selectors/HostelFloorSelector.tsx +0 -19
  111. package/src/selectors/HostelRoomSelector.tsx +0 -20
  112. package/src/selectors/PrintFormatSelector.tsx +0 -17
  113. package/src/selectors/ProgramSelector.tsx +0 -16
  114. package/src/selectors/RegulationSelector.tsx +0 -19
  115. package/src/selectors/SemesterSelector.tsx +0 -16
  116. package/src/selectors/YearRangeSelector.tsx +0 -26
  117. package/src/selectors/utils.tsx +0 -39
  118. package/src/setupTests.ts +0 -5
  119. package/src/utils/constants.ts +0 -18
  120. package/tsconfig.json +0 -22
  121. /package/{src/context/export.ts → dist/cjs/types/src/context/export.d.ts} +0 -0
  122. /package/{src/hooks/export.ts → dist/cjs/types/src/hooks/export.d.ts} +0 -0
  123. /package/{src/selectors/export.ts → dist/cjs/types/src/selectors/export.d.ts} +0 -0
  124. /package/{types → dist/types}/theme.d.ts +0 -0
@@ -0,0 +1,65 @@
1
+ import { ConfirmDialogType, Severity } from '@campxdev/react-blueprint';
2
+ import { Store } from 'pullstate';
3
+ type Classroom = {
4
+ id: number;
5
+ batchName?: string;
6
+ branchCode?: string;
7
+ courseId: number;
8
+ currentSemester: number;
9
+ name: string;
10
+ programId: number;
11
+ regulationId?: number;
12
+ section?: string;
13
+ timetableSlotTemplateId?: number;
14
+ };
15
+ export type ApplicationStoreType = {
16
+ isLoginDialogOpen: boolean;
17
+ snackbar: {
18
+ open: boolean;
19
+ message: string;
20
+ severity: Severity;
21
+ };
22
+ confirmDialog: {
23
+ isOpen: boolean;
24
+ title: string;
25
+ message: string;
26
+ onConfirm: () => void;
27
+ onCancel: () => void;
28
+ type: ConfirmDialogType;
29
+ confirmButtonText?: string;
30
+ cancelButtonText?: string;
31
+ };
32
+ user?: {
33
+ id: number;
34
+ fullName: string;
35
+ semNo?: number;
36
+ rollNo?: string;
37
+ courseId?: number;
38
+ branchCode?: string;
39
+ classroom?: Classroom;
40
+ email?: string;
41
+ employeeId?: string;
42
+ departmentIds?: string[];
43
+ designationId?: string;
44
+ institutionIds: number[];
45
+ isAdminUser?: boolean;
46
+ isSuperUser?: boolean;
47
+ studentId?: number;
48
+ admissionId?: string;
49
+ mStudentId?: string;
50
+ };
51
+ institution?: {
52
+ institutions?: [];
53
+ loading?: boolean;
54
+ error?: any;
55
+ current?: any;
56
+ };
57
+ asset?: {
58
+ favIcon?: string;
59
+ institutionLogo?: string;
60
+ institutionName?: string;
61
+ };
62
+ };
63
+ export declare const initialApplicationState: ApplicationStoreType;
64
+ export declare const ApplicationStore: Store<ApplicationStoreType>;
65
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ConfirmDialogType } from '@campxdev/react-blueprint';
2
+ export declare const useConfirm: () => ({ title, message, confirmButtonText, cancelButtonText, type, }: {
3
+ title: string;
4
+ message: string;
5
+ confirmButtonText?: string;
6
+ cancelButtonText?: string;
7
+ type?: ConfirmDialogType;
8
+ }) => Promise<boolean>;
@@ -0,0 +1 @@
1
+ import './index.css';
@@ -0,0 +1,23 @@
1
+ import { SideMenuItemProps } from '@campxdev/react-blueprint';
2
+ import { ReactNode } from 'react';
3
+ type Props = {
4
+ actions?: ReactNode[];
5
+ profileActions?: ReactNode[];
6
+ children?: ReactNode;
7
+ menu: SideMenuItemProps[];
8
+ mainContainerSx?: any;
9
+ handleLogout?: any;
10
+ userName?: string;
11
+ designation?: string;
12
+ clientName?: string;
13
+ institutionData?: any[];
14
+ defaultCollapsed?: boolean;
15
+ helpDocsConfig?: Record<string, {
16
+ actions: {
17
+ name: string;
18
+ onClick: () => void;
19
+ }[];
20
+ }>;
21
+ };
22
+ export declare const AppLayout: React.FC<Props>;
23
+ export {};
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ interface HelpDocsActionType {
3
+ name: string;
4
+ onClick?: () => void;
5
+ backgroundColor?: string;
6
+ }
7
+ interface HelpDocsProps {
8
+ actions: HelpDocsActionType[];
9
+ }
10
+ export declare const HelpDocs: React.FC<HelpDocsProps>;
11
+ export {};
@@ -0,0 +1,3 @@
1
+ import { ReportHandler } from 'web-vitals';
2
+ declare const reportWebVitals: (onPerfEntry?: ReportHandler) => void;
3
+ export default reportWebVitals;
@@ -0,0 +1,13 @@
1
+ export declare const mainRoutes: {
2
+ path: string;
3
+ element: import("react/jsx-runtime").JSX.Element;
4
+ children: ({
5
+ index: boolean;
6
+ element: import("react/jsx-runtime").JSX.Element;
7
+ path?: undefined;
8
+ } | {
9
+ path: string;
10
+ element: import("react/jsx-runtime").JSX.Element;
11
+ index?: undefined;
12
+ })[];
13
+ }[];
@@ -0,0 +1,2 @@
1
+ import { SingleSelectProps } from '@campxdev/react-blueprint';
2
+ export declare const BatchSelector: (props: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SingleSelectProps } from '@campxdev/react-blueprint';
2
+ export declare const CourseSelector: (props: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SingleSelectProps } from '@campxdev/react-blueprint';
2
+ export declare const DepartmentSelector: (props: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SingleSelectProps } from '@campxdev/react-blueprint';
2
+ export declare const EmployeesSelector: (props: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SingleSelectProps } from '@campxdev/react-blueprint';
2
+ export declare const FeeTypeSelector: (props: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SingleSelectProps } from '@campxdev/react-blueprint';
2
+ export declare const HostelFloorSelector: (props: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SingleSelectProps } from '@campxdev/react-blueprint';
2
+ export declare const HostelRoomSelector: (props: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SingleSelectProps } from '@campxdev/react-blueprint';
2
+ export declare const PrintFormatSelector: (props: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SingleSelectProps } from '@campxdev/react-blueprint';
2
+ export declare const ProgramSelector: (props: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SingleSelectProps } from '@campxdev/react-blueprint';
2
+ export declare const RegulationSelector: (props: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SingleSelectProps } from '@campxdev/react-blueprint';
2
+ export declare const SemesterSelector: (props: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { SingleSelectProps } from '@campxdev/react-blueprint';
2
+ interface YearRangeSelectorProps extends SingleSelectProps {
3
+ suffix?: string | null;
4
+ valueKey?: 'yearRange' | 'year';
5
+ }
6
+ export declare const YearRangeSelector: ({ suffix, valueKey, ...props }: YearRangeSelectorProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare const FeeTypes: {
2
+ label: string;
3
+ value: string;
4
+ }[];
5
+ export declare const years: number[];
6
+ export declare const batchOptions: {
7
+ label: string;
8
+ value: string;
9
+ }[];
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,4 @@
1
+ export declare const isLocal: boolean;
2
+ export declare const isDevelopment: boolean;
3
+ export declare const tenantCode: string;
4
+ export declare const institutionCode: string;
@@ -0,0 +1,4 @@
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{styled as o,MenuItem as r,Stack as i,InputAdornment as a,IconButton as s,CircularProgress as c,Box as u,Alert as l,useTheme as d,Backdrop as p,useMediaQuery as f}from"@mui/material";import*as h from"react";import{useState as m,createContext as y,useEffect as v,Suspense as b}from"react";import{useForm as g,appendErrors as w,Controller as x}from"react-hook-form";import{FormControlWrapper as E,TextField as k,Button as O,DialogButton as N,ConfirmDialog as _,Icons as C,PageNotFound as D,InternalServerError as P,NoInterneConnection as S,UnAuthorized as j,Dialog as A,Snackbar as I,MuiThemeProvider as T,lightTheme as V,Sidebar as R,AppHeader as B,Spinner as $,SingleSelect as L}from"@campxdev/react-blueprint";import{Visibility as M,VisibilityOff as F}from"@mui/icons-material";import{toast as K}from"react-toastify";import z from"axios";import{Store as U}from"pullstate";import{useMutation as q,QueryErrorResetBoundary as W,QueryClient as Y,QueryClientProvider as H}from"react-query";import{useLocation as X,useNavigate as J,BrowserRouter as G}from"react-router-dom";export{BrowserRouter}from"react-router-dom";import{validateFieldsNatively as Q,toNestError as Z}from"@hookform/resolvers";import ee from"device-detector-js";import*as te from"yup";import{LocalizationProvider as ne}from"@mui/x-date-pickers";import{AdapterDateFns as oe}from"@mui/x-date-pickers/AdapterDateFns";import{Provider as re}from"react-redux";import{motion as ie}from"framer-motion";import ae from"@mui/material/Box";import se from"@mui/material/SpeedDial";import ce from"@mui/material/SpeedDialAction";var ue=function(){return ue=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},ue.apply(this,arguments)};function le(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))}function de(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(6===s[0]&&i.label<r[1]){i.label=r[1],r=s;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(s);break}r[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function pe(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}
2
+ /*! js-cookie v3.0.5 | MIT */
3
+ function fe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}"function"==typeof SuppressedError&&SuppressedError;var he=function e(t,n){function o(e,o,r){if("undefined"!=typeof document){"number"==typeof(r=fe({},n,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in r)r[a]&&(i+="; "+a,!0!==r[a]&&(i+="="+r[a].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+i}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],o={},r=0;r<n.length;r++){var i=n[r].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(o[s]=t.read(a,s),e===s)break}catch(e){}}return e?o[e]:o}},remove:function(e,t){o(e,"",fe({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,fe({},this.attributes,t))},withConverter:function(t){return e(fe({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),me={isLoginDialogOpen:!1,snackbar:{open:!1,message:"",severity:"success"},confirmDialog:{isOpen:!1,title:"",message:"",onConfirm:function(){},onCancel:function(){},type:"confirm"},user:void 0,institution:void 0,asset:void 0},ye=new U(me),ve=he.get("campx_tenant"),be=he.get("campx_institution"),ge="localhost"===window.location.hostname,we="development"===process.env.NODE_ENV||ge,xe=ge?ve:window.location.hostname.split(".")[0],Ee=""!==window.location.pathname.split("/")[1]?window.location.pathname.split("/")[1]:be,ke=function(){return void 0!==import.meta&&import.meta.env?import.meta.env.VITE_APP_API_HOST||"":process.env.REACT_APP_API_HOST||""},Oe=function(e){var t;return Object.fromEntries(null===(t=Object.entries(null!=e?e:{}))||void 0===t?void 0:t.map((function(e){return[e[0],"__empty__"===e[1]?"":e[1]]})))},Ne=z.create({baseURL:ke(),withCredentials:!0,headers:{"x-tenant-id":xe,"x-institution-code":Ee}});Ne.interceptors.request.use((function(e){var t=Oe(null==e?void 0:e.params),n=he.get("campx_session_key"),o=he.get("campx_open_payments_key"),r=he.get("campx_student_key");return we&&n&&e.headers.set("campx_session_key",n),we&&r&&e.headers.set("campx_student_key",r),o&&e.headers.set("campx_open_payments_key",o),ue(ue({},e),{params:t})}),(function(e){return Promise.reject(e)})),Ne.interceptors.response.use((function(e){return e.config.method&&["put","post","delete","patch"].includes(e.config.method)&&[200,201,202].includes(e.status)&&ye.update((function(t){t.snackbar.open=!0,t.snackbar.message=e.data.message,t.snackbar.severity="success"})),e}),(function(e){return[400,422].includes(e.response.status)&&ye.update((function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Bad Request",t.snackbar.severity="error"})),e.response.config.method&&["put","post","delete","patch"].includes(e.response.config.method)&&[404].includes(e.response.status)&&ye.update((function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message,t.snackbar.severity="error"})),Promise.reject(e)}));var _e=o(r)((function(){return{display:"flex",alignItems:"center",gap:"5px","& .MuiListItemIcon-root":{minWidth:"24px"},"& .MuiSvgIcon-root":{height:"14px",width:"14px"}}}));function Ce(o){var r=this,u=o.close,l=m({oldPassword:!1,newPassword:!1,confirmPassword:!1}),d=l[0],p=l[1],f=m(!1),h=f[0],y=f[1],v=g(),b=v.handleSubmit,w=v.control,x=v.reset;return e("form",{onSubmit:b((function(e){return le(r,void 0,void 0,(function(){var t,n,o,r;return de(this,(function(i){switch(i.label){case 0:if(y(!0),t=e.oldPassword,n=e.newPassword,o=e.confirmPassword,n!==o)return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Ne.post(we?"https://api.campx.dev/auth-server/auth/change-password":"https://api.campx.in/auth-server/auth/change-password",{oldPassword:t,newPassword:n})];case 2:return i.sent(),K.success("Password Changed Successfully"),y(!1),x(),u(),[3,4];case 3:return r=i.sent(),console.log(r,"this is error"),y(!1),[3,4];case 4:return[3,6];case 5:K.error("New Password, Confirm Password must be same"),y(!1),i.label=6;case 6:return[2]}}))}))})),children:e(E,{control:w,children:t(i,{gap:1,direction:"column",children:[[{label:"Old Password",name:"oldPassword"},{label:"New Password",name:"newPassword"},{label:"Confirm Password",name:"confirmPassword"}].map((function(t){return e(n,{children:e(k,{label:t.label,name:t.name,type:d[t.name]?"text":"password",required:!0,InputProps:{endAdornment:e(a,{position:"end",children:e(s,{size:"small",onClick:function(){return p((function(e){var n;return ue(ue({},e),((n={})[t.name]=!e[t.name],n))}))},edge:"end",children:d[t.name]?e(M,{}):e(F,{})})})}})})})),t(i,{direction:"row",gap:2,sx:{marginTop:"15px"},children:[e(O,{variant:"outlined",onClick:u,children:"Cancel"}),e(O,{type:"submit",variant:"contained",endIcon:h&&e(c,{style:{color:"white"},size:"30px",thickness:1.7}),children:"Submit"})]})]})})})}var De=function(){return e(n,{children:e(N,{anchor:function(t){var n=t.open;return e(_e,{onClick:function(){n()},children:"Change Password"})},content:function(t){var n=t.close;return e(Ce,{close:n})},title:"Change Password"})})},Pe=y({showConfirmDialog:function(){}}),Se=function(n){var o=n.children,r=ye.useState((function(e){return e.confirmDialog})),i=function(){ye.update((function(e){e.confirmDialog.isOpen=!1}))};return t(Pe.Provider,{value:{showConfirmDialog:function(e,t,n,o,r,i,a){void 0===r&&(r="confirm"),ye.update((function(s){s.confirmDialog={isOpen:!0,title:e,message:t,onConfirm:n,onCancel:o,type:r,confirmButtonText:i,cancelButtonText:a}}))}},children:[o,e(_,{isOpen:r.isOpen,title:r.title,message:r.message,type:r.type,confirmButtonText:r.confirmButtonText,cancelButtonText:r.cancelButtonText,onConfirm:function(){r.onConfirm(),i()},onCancel:function(){r.onCancel(),i()}})]})};function je(e,t){return je=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},je(e,t)}var Ae={error:null},Ie=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(t=e.call.apply(e,[this].concat(o))||this).state=Ae,t.resetErrorBoundary=function(){for(var e,n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];null==t.props.onReset||(e=t.props).onReset.apply(e,o),t.reset()},t}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,je(e,t)}(t,e),t.getDerivedStateFromError=function(e){return{error:e}};var n=t.prototype;return n.reset=function(){this.setState(Ae)},n.componentDidCatch=function(e,t){var n,o;null==(n=(o=this.props).onError)||n.call(o,e,t)},n.componentDidUpdate=function(e,t){var n,o,r,i,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==t.error&&(void 0===(r=e.resetKeys)&&(r=[]),void 0===(i=s)&&(i=[]),r.length!==i.length||r.some((function(e,t){return!Object.is(e,i[t])})))&&(null==(n=(o=this.props).onResetKeysChange)||n.call(o,e.resetKeys,s),this.reset())},n.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,o=t.FallbackComponent,r=t.fallback;if(null!==e){var i={error:e,resetErrorBoundary:this.resetErrorBoundary};if(h.isValidElement(r))return r;if("function"==typeof n)return n(i);if(o)return h.createElement(o,i);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(h.Component),Te=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),function(o,r,i){try{return Promise.resolve(function(a,s){try{var c=(t.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(e["sync"===n.mode?"validateSync":"validate"](o,Object.assign({abortEarly:!1},t,{context:r}))).then((function(e){return i.shouldUseNativeValidation&&Q({},i),{values:n.rawValues?o:e,errors:{}}})))}catch(e){return s(e)}return c&&c.then?c.then(void 0,s):c}(0,(function(e){if(!e.inner)throw e;return{values:{},errors:Z((t=e,n=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,(t.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,r=o&&o[t.type];e[t.path]=w(t.path,n,e,t.type,r?[].concat(r,t.message):t.message)}return e}),{})),i)};var t,n})))}catch(e){return Promise.reject(e)}}},Ve=function(e){return le(void 0,void 0,void 0,(function(){var t;return de(this,(function(n){switch(n.label){case 0:return e.latitude&&e.longitude?[3,3]:[4,fetch("https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyB2YCpo1yi107RYj1LdZu2DCcpcO93reFY",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({considerIp:"true"})})];case 1:return[4,n.sent().json()];case 2:t=n.sent(),e.latitude=t.location.lat,e.longitude=t.location.lng,n.label=3;case 3:return[2,Ne.post("/auth-server/auth/login",e).then((function(e){return e.data}))]}}))}))},Re=te.object().shape({username:te.string().required("Username is required"),password:te.string().required("Password is required")}),Be=function(o){var r=o.close,a=m({deviceInformation:{deviceType:"browser",clientName:"unknown",os:"unknown",osVersion:"unknown",latitude:null,longitude:null,tokenType:"WEB"},isLocationAllowed:!0}),s=a[0],c=a[1];v((function(){navigator.geolocation.getCurrentPosition((function(e){c((function(t){return ue(ue({},t),{deviceInformation:ue(ue({},t.deviceInformation),{latitude:e.coords.latitude,longitude:e.coords.longitude})})}))})),navigator.permissions.query({name:"geolocation"}).then((function(e){"denied"===e.state&&c((function(e){return ue(ue({},e),{isLocationAllowed:!1})}))}));var e=(new ee).parse(navigator.userAgent);c((function(t){var n,o,r;return ue(ue({},t),{deviceInformation:ue(ue({},t.deviceInformation),{clientName:(null===(n=e.client)||void 0===n?void 0:n.name)||t.deviceInformation.clientName,os:(null===(o=e.os)||void 0===o?void 0:o.name)||t.deviceInformation.os,osVersion:(null===(r=e.os)||void 0===r?void 0:r.version)||t.deviceInformation.osVersion})})}))}),[]);var l=g({resolver:Te(Re)}),d=l.handleSubmit,p=l.control,f=l.formState.errors,h=q(Ve,{onSuccess:function(e){e.loginSuccessful&&(he.remove("campx_session_key"),he.remove("campx_tenant"),he.remove("campx_institution"),he.set("campx_session_key",null==e?void 0:e.token),he.set("campx_tenant",null==e?void 0:e.subDomain),he.set("campx_institution",null==e?void 0:e.institutionCode),r(),window.location.reload())}}),y=h.mutate,b=h.isLoading;return e(n,{children:t(i,{gap:"16px",justifyContent:"space-between",alignItems:"center",children:[e(u,{height:"36px",width:"194.8px",children:e(C.CampxFullLogoIcon,{})}),t(i,{gap:"10px",justifyContent:"center",alignItems:"center",children:[e(x,{control:p,render:function(t){var n=t.field;return e(k,{size:"medium",name:"username",sx:{width:"400px"},placeholder:"Enter Username or Email",containerProps:{my:"0"},onChange:n.onChange,label:"Username or Email",error:!!f.username,required:!0})},name:"username"}),e(x,{control:p,render:function(t){var n=t.field;return e(k,{size:"medium",name:"password",sx:{width:"400px"},placeholder:"Enter password",onChange:n.onChange,containerProps:{my:"0"},label:"Password",type:"password",error:!!f.password,required:!0})},name:"password"}),e(O,{type:"submit",color:"primary",variant:"contained",sx:{width:"400px"},onClick:d((function(e){return le(void 0,void 0,void 0,(function(){return de(this,(function(t){return y(ue(ue({},e),s.deviceInformation)),[2]}))}))})),disabled:b,loading:b,children:"Login"})]})]})})},$e=o(l)((function(e){var t=e.theme;return{height:"60px",border:"1px solid ".concat(t.palette.error.main),display:"flex",alignItems:"center","& .MuiAlert-message":{padding:0},"& .MuiTypography-root":{margin:0},position:"relative","& .retryBtn":{color:"#661B2A",position:"absolute",right:8,top:8}}})),Le=function(t){var n=X();return e(W,{children:function(o){var r=o.reset;return e(Ie,{onReset:r,FallbackComponent:Me,children:t.children},null==n?void 0:n.pathname)}})},Me=function(n){var o,r,i,a,s,c=n.error,l=n.resetErrorBoundary;if(null===(o=null==c?void 0:c.response)||void 0===o?void 0:o.status)switch(null===(r=null==c?void 0:c.response)||void 0===r?void 0:r.status){case 401:return e(Fe,{});case 500:return e(P,{resetBoundary:l});case 404:return e(D,{})}return"ERR_NETWORK"===(null==c?void 0:c.code)?e(S,{resetBoundary:l}):e(u,{sx:{marginTop:"16px",padding:"20px"},children:t($e,{severity:"error",children:[null!==(s=null===(a=null===(i=null==c?void 0:c.response)||void 0===i?void 0:i.data)||void 0===a?void 0:a.message)&&void 0!==s?s:null==c?void 0:c.message,e(O,{className:"retryBtn",onClick:function(){return l()},size:"small",color:"error",variant:"outlined",children:"Try Again"})]})})},Fe=function(){var o=J(),r=m(!1),i=r[0],a=r[1],s=he.get("campx_session_key");return e(j,{component:t(n,{children:[e(O,{sx:{marginTop:"20px"},variant:"contained",onClick:function(){"localhost"===window.location.hostname?a(!0):s||o("/auth/login")},children:"Click Here To Login"}),e(A,{open:i,onClose:function(){return a(!1)},content:function(t){var n=t.close;return e(Be,{close:n})}})]})})};function Ke(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ze=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),Ue=()=>Math.random().toString(36).substring(7).split("").join("."),qe={INIT:`@@redux/INIT${Ue()}`,REPLACE:`@@redux/REPLACE${Ue()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ue()}`};function We(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function Ye(e){if(void 0===e)return"undefined";if(null===e)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";const n=function(e){return"function"==typeof e.constructor?e.constructor.name:null}(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function He(e){let t=typeof e;return"production"!==process.env.NODE_ENV&&(t=Ye(e)),t}function Xe(e,t,n){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?Ke(2):`Expected the root reducer to be a function. Instead, received: '${He(e)}'`);if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"===process.env.NODE_ENV?Ke(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("production"===process.env.NODE_ENV?Ke(1):`Expected the enhancer to be a function. Instead, received: '${He(n)}'`);return n(Xe)(e,t)}let o=e,r=t,i=new Map,a=i,s=0,c=!1;function u(){a===i&&(a=new Map,i.forEach(((e,t)=>{a.set(t,e)})))}function l(){if(c)throw new Error("production"===process.env.NODE_ENV?Ke(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return r}function d(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?Ke(4):`Expected the listener to be a function. Instead, received: '${He(e)}'`);if(c)throw new Error("production"===process.env.NODE_ENV?Ke(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let t=!0;u();const n=s++;return a.set(n,e),function(){if(t){if(c)throw new Error("production"===process.env.NODE_ENV?Ke(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");t=!1,u(),a.delete(n),i=null}}}function p(e){if(!We(e))throw new Error("production"===process.env.NODE_ENV?Ke(7):`Actions must be plain objects. Instead, the actual type was: '${He(e)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(void 0===e.type)throw new Error("production"===process.env.NODE_ENV?Ke(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if("string"!=typeof e.type)throw new Error("production"===process.env.NODE_ENV?Ke(17):`Action "type" property must be a string. Instead, the actual type was: '${He(e.type)}'. Value was: '${e.type}' (stringified)`);if(c)throw new Error("production"===process.env.NODE_ENV?Ke(9):"Reducers may not dispatch actions.");try{c=!0,r=o(r,e)}finally{c=!1}return(i=a).forEach((e=>{e()})),e}p({type:qe.INIT});return{dispatch:p,subscribe:d,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?Ke(10):`Expected the nextReducer to be a function. Instead, received: '${He(e)}`);o=e,p({type:qe.REPLACE})},[ze]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error("production"===process.env.NODE_ENV?Ke(11):`Expected the observer to be an object. Instead, received: '${He(t)}'`);function n(){const e=t;e.next&&e.next(l())}n();return{unsubscribe:e(n)}},[ze](){return this}}}}}function Je(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}function Ge(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const r=t[o];"production"!==process.env.NODE_ENV&&void 0===e[r]&&Je(`No reducer provided for key "${r}"`),"function"==typeof e[r]&&(n[r]=e[r])}const o=Object.keys(n);let r,i;"production"!==process.env.NODE_ENV&&(r={});try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:qe.INIT}))throw new Error("production"===process.env.NODE_ENV?Ke(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(void 0===n(void 0,{type:qe.PROBE_UNKNOWN_ACTION()}))throw new Error("production"===process.env.NODE_ENV?Ke(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${qe.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)}))}(n)}catch(e){i=e}return function(e={},t){if(i)throw i;if("production"!==process.env.NODE_ENV){const o=function(e,t,n,o){const r=Object.keys(t),i=n&&n.type===qe.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===r.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!We(e))return`The ${i} has unexpected type of "${He(e)}". Expected argument to be an object with the following keys: "${r.join('", "')}"`;const a=Object.keys(e).filter((e=>!t.hasOwnProperty(e)&&!o[e]));return a.forEach((e=>{o[e]=!0})),n&&n.type===qe.REPLACE?void 0:a.length>0?`Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${i}. Expected to find one of the known reducer keys instead: "${r.join('", "')}". Unexpected keys will be ignored.`:void 0}(e,n,t,r);o&&Je(o)}let a=!1;const s={};for(let r=0;r<o.length;r++){const i=o[r],c=n[i],u=e[i],l=c(u,t);if(void 0===l){const e=t&&t.type;throw new Error("production"===process.env.NODE_ENV?Ke(14):`When called with an action of type ${e?`"${String(e)}"`:"(unknown type)"}, the slice reducer for key "${i}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}s[i]=l,a=a||l!==u}return a=a||o.length!==Object.keys(e).length,a?s:e}}function Qe(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function Ze(e){return({dispatch:t,getState:n})=>o=>r=>"function"==typeof r?r(t,n,e):o(r)}var et=Ze(),tt=Ze,nt="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Qe:Qe.apply(null,arguments)};function ot(e){return"function"==typeof e&&"type"in e&&((t=e)&&"function"==typeof t.match);var t}function rt(e,t){let n=0;return{measureTime(e){const t=Date.now();try{return e()}finally{const e=Date.now();n+=e-t}},warnIfExceeded(){n>e&&console.warn(`${t} took ${n}ms, which is more than the warning threshold of ${e}ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.`)}}}var it=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function at(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function st(e,t,n){const o=ct(e,t,n);return{detectMutations:()=>ut(e,t,o,n)}}function ct(e,t=[],n,o="",r=new Set){const i={value:n};if(!e(n)&&!r.has(n)){r.add(n),i.children={};for(const r in n){const a=o?o+"."+r:r;t.length&&-1!==t.indexOf(a)||(i.children[r]=ct(e,t,n[r],a))}}return i}function ut(e,t=[],n,o,r=!1,i=""){const a=n?n.value:void 0,s=a===o;if(r&&!s&&!Number.isNaN(o))return{wasMutated:!0,path:i};if(e(a)||e(o))return{wasMutated:!1};const c={};for(let e in n.children)c[e]=!0;for(let e in o)c[e]=!0;const u=t.length>0;for(let r in c){const a=i?i+"."+r:r;if(u){if(t.some((e=>e instanceof RegExp?e.test(a):a===e)))continue}const c=ut(e,t,n.children[r],o[r],s,a);if(c.wasMutated)return c}return{wasMutated:!1}}function lt(e){const t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||We(e)}function dt(e,t="",n=lt,o,r=[],i){let a;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(i?.has(e))return!1;const s=null!=o?o(e):Object.entries(e),c=r.length>0;for(const[e,u]of s){const s=t?t+"."+e:e;if(c){if(r.some((e=>e instanceof RegExp?e.test(s):s===e)))continue}if(!n(u))return{keyPath:s,value:u};if("object"==typeof u&&(a=dt(u,s,n,o,r,i),a))return a}return i&&pt(e)&&i.add(e),!1}function pt(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if("object"==typeof t&&null!==t&&!pt(t))return!1;return!0}function ft(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{const{isSerializable:t=lt,getEntries:n,ignoredActions:o=[],ignoredActionPaths:r=["meta.arg","meta.baseQueryMeta"],ignoredPaths:i=[],warnAfter:a=32,ignoreState:s=!1,ignoreActions:c=!1,disableCache:u=!1}=e,l=!u&&WeakSet?new WeakSet:void 0;return e=>u=>d=>{if(!function(e){return We(e)&&"type"in e&&"string"==typeof e.type}(d))return u(d);const p=u(d),f=rt(a,"SerializableStateInvariantMiddleware");return c||o.length&&-1!==o.indexOf(d.type)||f.measureTime((()=>{const e=dt(d,"",t,n,r,l);if(e){const{keyPath:t,value:n}=e;console.error(`A non-serializable value was detected in an action, in the path: \`${t}\`. Value:`,n,"\nTake a look at the logic that dispatched this action: ",d,"\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)","\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)")}})),s||(f.measureTime((()=>{const o=dt(e.getState(),"",t,n,i,l);if(o){const{keyPath:e,value:t}=o;console.error(`A non-serializable value was detected in the state, in the path: \`${e}\`. Value:`,t,`\nTake a look at the reducer(s) handling this action type: ${d.type}.\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}})),f.warnIfExceeded()),p}}}function ht(e){return"boolean"==typeof e}var mt=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:r=!0}=e??{};let i=new it;if(t&&(ht(t)?i.push(et):i.push(tt(t.extraArgument))),"production"!==process.env.NODE_ENV){if(n){let e={};ht(n)||(e=n),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{let t=function(e,t,o,r){return JSON.stringify(e,n(t,r),o)},n=function(e,t){let n=[],o=[];return t||(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,n.indexOf(t)).join(".")+"]"}),function(r,i){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?o.splice(a,1/0,r):o.push(r),~n.indexOf(i)&&(i=t.call(this,r,i))}else n.push(i);return null==e?i:e.call(this,r,i)}},{isImmutable:o=at,ignoredPaths:r,warnAfter:i=32}=e;const a=st.bind(null,o,r);return({getState:e})=>{let n,o=e(),r=a(o);return s=>c=>{const u=rt(i,"ImmutableStateInvariantMiddleware");u.measureTime((()=>{if(o=e(),n=r.detectMutations(),r=a(o),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?gt(19):`A state mutation was detected between dispatches, in the path '${n.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}));const l=s(c);return u.measureTime((()=>{if(o=e(),n=r.detectMutations(),r=a(o),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?gt(20):`A state mutation was detected inside a dispatch, in the path: ${n.path||""}. Take a look at the reducer(s) handling the action ${t(c)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)})),u.warnIfExceeded(),l}}}}(e))}if(o){let e={};ht(o)||(e=o),i.push(ft(e))}if(r){let e={};ht(r)||(e=r),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);const{isActionCreator:t=ot}=e;return()=>e=>n=>(t(n)&&console.warn(function(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}(n.type)),e(n))}(e))}}return i},yt=e=>t=>{setTimeout(t,e)},vt=e=>function(t){const{autoBatch:n=!0}=t??{};let o=new it(e);return n&&o.push(((e={type:"raf"})=>t=>(...n)=>{const o=t(...n);let r=!0,i=!1,a=!1;const s=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:yt(10):"callback"===e.type?e.queueNotification:yt(e.timeout),u=()=>{a=!1,i&&(i=!1,s.forEach((e=>e())))};return Object.assign({},o,{subscribe(e){const t=o.subscribe((()=>r&&e()));return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return r=!e?.meta?.RTK_autoBatch,i=!r,i&&(a||(a=!0,c(u))),o.dispatch(e)}finally{r=!0}}})})("object"==typeof n?n:void 0)),o};function bt(e){const t=mt(),{reducer:n,middleware:o,devTools:r=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a,enhancers:s}=e||{};let c,u;if("function"==typeof n)c=n;else{if(!We(n))throw new Error("production"===process.env.NODE_ENV?gt(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");c=Ge(n)}if("production"!==process.env.NODE_ENV&&o&&"function"!=typeof o)throw new Error("production"===process.env.NODE_ENV?gt(2):"`middleware` field must be a callback");if("function"==typeof o){if(u=o(t),"production"!==process.env.NODE_ENV&&!Array.isArray(u))throw new Error("production"===process.env.NODE_ENV?gt(3):"when using a middleware builder function, an array of middleware must be returned")}else u=t();if("production"!==process.env.NODE_ENV&&u.some((e=>"function"!=typeof e)))throw new Error("production"===process.env.NODE_ENV?gt(4):"each middleware provided to configureStore must be a function");if("production"!==process.env.NODE_ENV&&i){let e=new Set;u.forEach((t=>{if(e.has(t))throw new Error("production"===process.env.NODE_ENV?gt(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");e.add(t)}))}let l=Qe;r&&(l=nt({trace:"production"!==process.env.NODE_ENV,..."object"==typeof r&&r}));const d=function(...e){return t=>(n,o)=>{const r=t(n,o);let i=()=>{throw new Error("production"===process.env.NODE_ENV?Ke(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const a={getState:r.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map((e=>e(a)));return i=Qe(...s)(r.dispatch),{...r,dispatch:i}}}(...u),p=vt(d);if("production"!==process.env.NODE_ENV&&s&&"function"!=typeof s)throw new Error("production"===process.env.NODE_ENV?gt(5):"`enhancers` field must be a callback");let f="function"==typeof s?s(p):p();if("production"!==process.env.NODE_ENV&&!Array.isArray(f))throw new Error("production"===process.env.NODE_ENV?gt(6):"`enhancers` callback must return an array");if("production"!==process.env.NODE_ENV&&f.some((e=>"function"!=typeof e)))throw new Error("production"===process.env.NODE_ENV?gt(7):"each enhancer provided to configureStore must be a function");"production"!==process.env.NODE_ENV&&u.length&&!f.includes(d)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");return Xe(c,a,l(...f))}function gt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var wt=y(void 0),xt=function(n){var o=n.children,r=ye.useState((function(e){return e.snackbar}));return t(wt.Provider,{value:{showSnackbar:function(e,t){void 0===t&&(t="info"),ye.update((function(n){n.snackbar.open=!0,n.snackbar.message=e,n.snackbar.severity=t}))}},children:[o,e(I,{open:r.open,message:r.message,severity:r.severity,autoHideDuration:1500,onClose:function(){ye.update((function(e){e.snackbar.open=!1}))}})]})},Et=function(t){var n=t.children,o=t.basename,r=t.theme,i=void 0===r?V:r,a=t.reducers,s=void 0===a?{}:a,c=new Y({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,useErrorBoundary:!0}}}),u=xe&&Ee?"/".concat(Ee):"/";v((function(){"/"===window.location.pathname&&Ee&&xe&&window.location.replace(window.location.origin+"/".concat(Ee))}),[Ee,xe]);var l=bt({reducer:Ge(s)});return e(re,{store:l,children:e(G,{basename:null!=o?o:u,children:e(H,{client:c,children:e(T,{theme:i,children:e(xt,{children:e(ne,{dateAdapter:oe,children:e(Se,{children:n})})})})})})})},kt={isOpen:!1,title:"",message:"",confirmButtonText:"",cancelButtonText:"",type:"confirm",onConfirm:function(){},onCancel:function(){}},Ot=function(){var e=function(){ye.update((function(e){e.confirmDialog=kt}))};return function(t){var n=t.title,o=t.message,r=t.confirmButtonText,i=t.cancelButtonText,a=t.type,s=void 0===a?"confirm":a;return new Promise((function(t){ye.update((function(a){a.confirmDialog={isOpen:!0,title:n,message:o,confirmButtonText:r,cancelButtonText:i,type:s,onConfirm:function(){t(!0),e()},onCancel:function(){t(!1),e()}}}))}))}},Nt=function(n){var o=n.actions,r=d(),i=h.useState(!1),a=i[0],s=i[1],c=function(){return s(!1)};return t(ae,{sx:{position:"fixed",bottom:26,right:0,zIndex:1e3},children:[e(p,{open:a}),e(se,{ariaLabel:"Custom Help Docs",sx:{position:"absolute",bottom:0,right:40,display:"flex",alignItems:"flex-end","& .MuiFab-primary":{backgroundColor:r.palette.highlight.highlightBlue,borderRadius:"8px",width:"50px",height:"50px",display:"flex",justifyContent:"center",alignItems:"center","&:hover":{backgroundColor:r.palette.highlight.highlightBlue}},"& .MuiSpeedDialAction-fab":{margin:"0 0 16px 0","&:not(:last-child)":{marginBottom:"8px"}}},icon:e(C.HelpDocsIcon,{size:20}),onClose:c,onOpen:function(){return s(!0)},open:a,direction:"up",children:o.map((function(t){return e(ce,{onClick:function(){var e;null===(e=t.onClick)||void 0===e||e.call(t),c()},icon:e("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",fontWeight:"bold",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),FabProps:{sx:{width:"auto",minWidth:"180px",maxWidth:"280px",padding:"8px 12px",boxShadow:"none",height:"40px",borderRadius:"8px",backgroundColor:r.palette.surface.defaultBackground,color:r.palette.text.primary,fontWeight:500,fontFamily:"Heebo",fontSize:"12px",whiteSpace:"nowrap",textAlign:"right",display:"flex",justifyContent:"flex-end",alignItems:"center","&:hover":{backgroundColor:r.palette.surface.defaultBackground}}}},t.name)}))})]})},_t=function(n){var o,r=n.actions,i=void 0===r?[]:r,a=n.profileActions,s=void 0===a?[]:a,c=n.children,u=n.institutionData,l=void 0===u?[]:u,p=n.menu,h=n.mainContainerSx,y=n.handleLogout,v=n.userName,g=void 0===v?"":v,w=n.designation,x=void 0===w?"":w,E=n.clientName,k=void 0===E?"":E,O=n.defaultCollapsed,N=void 0===O||O,_=n.helpDocsConfig,C=m(N),D=C[0],P=C[1],S=d(),j=f(S.breakpoints.down("md"));var A=window.location.pathname.split("/").filter(Boolean).slice(1).join("/").replace(/\/\d+/g,"/:id"),I=(null===(o=null==_?void 0:_["/".concat(A)])||void 0===o?void 0:o.actions)||[];return t(Ct,{children:[e(R,{menu:p,collapsed:D,setCollapsed:P}),t(ie.div,{animate:{width:D?"calc(100% - 84px)":"calc(100% - 278px)"},transition:{duration:.3,ease:"circOut"},style:{margin:"12px 12px 12px 0px",width:j?"100%":"calc(100% - 84px)",display:j?"contents":"block"},children:[e(B,ue({clientName:k,userFullName:g,designation:x,actions:i,profileActions:pe([e(De,{})],s,!0),collapsed:D,showActiveDevices:!1,onLogoutClick:null!=y?y:function(){Ne.post("/auth-server/auth/logout").then((function(e){he.remove("campx_tenant"),he.remove("campx_session_key"),he.remove("campx_institution"),window.location.href="/"})).catch((function(e){}))},institutionsData:l},j&&{profileSx:{width:32,height:32,fontSize:"12px"}})),_&&I.length>0&&e(Nt,{actions:I}),e(Dt,{sx:ue({margin:"12px 0px 0px 0px",backgroundColor:S.palette.surface.paperBackground},h),onClick:function(){P(!0)},children:e(b,{fallback:e($,{}),children:e(Le,{children:c})})})]})]})},Ct=o(i)((function(e){var t,n=e.theme;return(t={flexDirection:"row",backgroundColor:n.palette.surface.defaultBackground})[n.breakpoints.down("md")]={flexWrap:"wrap"},t})),Dt=o(u)((function(e){var t,n=e.theme;return(t={borderRadius:"8px",height:"calc(100vh - 96px)",overflowY:"scroll",width:"100%","&::-webkit-scrollbar":{width:"0.5em",height:"0.2em",backgroundColor:n.palette.surface.defaultBackground},"&::-webkit-scrollbar-thumb":{backgroundColor:n.palette.primary.light,borderRadius:"3px","&:hover":{backgroundColor:n.palette.primary.main}}})[n.breakpoints.down("md")]={margin:"0px 12px 12px 12px",height:"calc(100vh - 118px)","&::-webkit-scrollbar":{display:"none"}},t})),Pt=[{label:"Tuition Fee",value:"tuition_fee"},{label:"Admission Fee",value:"admission_fee"},{label:"Hostel Fee",value:"hostel_fee"},{label:"Transport Fee",value:"transport_fee"},{label:"Exam Fee",value:"exam_fee"},{label:"Other Fee",value:"other_fee"}],St=Array.from({length:6},(function(e,t){return(new Date).getFullYear()-t})),jt=Array.from({length:12},(function(e,t){return{label:"".concat((new Date).getFullYear()-t," - ").concat((new Date).getFullYear()-t+1),value:"".concat((new Date).getFullYear()-t," - ").concat((new Date).getFullYear()-t+1)}})),At=function(t){return e(L,ue({label:"Batch",options:null==jt?void 0:jt.map((function(e){return{label:e.label,value:e.value}}))},t))},It=function(t){return e(L,ue({dbLabelProps:{labelKey:"courseName",subLabelKey:"level"}},t,{externalAxios:Ne,optionsApiEndPoint:"/dropdowns/courses"}))},Tt=function(t){return e(L,ue({dbLabelProps:{labelKey:"name"},dbValueProps:{valueKey:"_id",isObjectId:!0}},t,{externalAxios:Ne,optionsApiEndPoint:"/dropdowns/departments"}))},Vt=function(t){return e(L,ue({dbValueProps:{valueKey:"_id",isObjectId:!0},dbLabelProps:{labelKey:"fullName",subLabelKey:"employeeId"}},t,{externalAxios:Ne,optionsApiEndPoint:"/dropdowns/employees"}))},Rt=function(t){return e(L,ue({label:"Fee Type",options:null==Pt?void 0:Pt.map((function(e){return{label:e.label,value:e.value}}))},t))},Bt=function(t){return e(L,ue({label:"Hostel Room No.",dbValueProps:{valueKey:"floor"},dbLabelProps:{labelKey:"floor"}},t,{externalAxios:Ne,optionsApiEndPoint:"dropdowns/floors"}))},$t=function(t){return e(L,ue({label:"Hostel Room No.",dbValueProps:{valueKey:"id"},dbLabelProps:{labelKey:"room_number",subLabelKey:"floor"}},t,{optionsApiEndPoint:"dropdowns/hostel-rooms",externalAxios:Ne}))},Lt=function(t){return e(L,ue({dbLabelProps:{labelKey:"name",subLabelKey:"type",useSubLabelStartCase:!0}},t,{externalAxios:Ne,optionsApiEndPoint:"/dropdowns/print-formats"}))},Mt=function(t){return e(L,ue({dbLabelProps:{labelKey:"branchCode",subLabelKey:"branchDisplay"}},t,{externalAxios:Ne,optionsApiEndPoint:"/dropdowns/programs"}))},Ft=function(t){return e(L,ue({label:"Regulation",dbValueProps:{valueKey:"regulation_id"},dbLabelProps:{labelKey:"r.name"}},t,{optionsApiEndPoint:"dropdowns/regulations",externalAxios:Ne}))},Kt=function(t){return e(L,ue({dbLabelProps:{labelKey:"name",subLabelKey:"year"}},t,{optionsApiEndPoint:"/dropdowns/semesters",externalAxios:Ne}))},zt=function(t){var n=t.suffix,o=void 0===n?null:n,r=t.valueKey,i=void 0===r?"yearRange":r,a=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(t,["suffix","valueKey"]);return e(L,ue({label:"Year Range",options:null==St?void 0:St.map((function(e){return{label:o?"".concat(o," ").concat(e," - ").concat(e+1):"".concat(e," - ").concat(e+1),value:"yearRange"===i?"".concat(e," - ").concat(e+1):e}}))},a))};export{_t as AppLayout,ye as ApplicationStore,At as BatchSelector,Ce as ChangePassword,De as ChangePasswordDialog,Se as ConfirmDialogProvider,It as CourseSelector,Tt as DepartmentSelector,Vt as EmployeesSelector,Le as ErrorBoundary,Rt as FeeTypeSelector,Nt as HelpDocs,Bt as HostelFloorSelector,$t as HostelRoomSelector,Lt as PrintFormatSelector,Mt as ProgramSelector,Et as Providers,Ft as RegulationSelector,Kt as SemesterSelector,xt as SnackbarProvider,_e as StyledMenuItem,zt as YearRangeSelector,Ne as axios,Oe as formatParams,ke as getBaseUrl,me as initialApplicationState,Ee as institutionCode,we as isDevelopment,ge as isLocal,xe as tenantCode,Ot as useConfirm};
4
+ //# sourceMappingURL=index.js.map