react-luminus-components 1.3.184 → 1.3.185

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 (32) hide show
  1. package/README.md +349 -349
  2. package/dist/.vite/manifest.json +52 -52
  3. package/dist/Loading-C4Zoc7RU.cjs +1 -0
  4. package/dist/{Loading-B4je8S-e.js → Loading-ClfDUtqs.js} +1 -1
  5. package/dist/contexts.cjs.js +1 -1
  6. package/dist/contexts.es.js +48 -48
  7. package/dist/hooks.cjs.js +1 -1
  8. package/dist/hooks.es.js +20 -20
  9. package/dist/layout.cjs.js +1 -1
  10. package/dist/layout.es.js +8 -8
  11. package/dist/main.cjs.js +2 -2
  12. package/dist/main.es.js +2722 -2722
  13. package/dist/{ShortcutLinksContext-BwGYXGO6.cjs → nivo-bar.es-CbxxQBpL.cjs} +5 -5
  14. package/dist/{ShortcutLinksContext-BU8EEAxv.js → nivo-bar.es-dpxJHky8.js} +9972 -9974
  15. package/dist/searchUtils-CsX2wi5_.cjs +1 -0
  16. package/dist/{searchUtils-DtwPe7Fi.js → searchUtils-D3hbf2-a.js} +1 -1
  17. package/dist/style.css +1 -1
  18. package/dist/{useClipboard-DzqY3ual.js → useClipboard-B-kckvnR.js} +1 -1
  19. package/dist/useClipboard-CZ_hcUoH.cjs +1 -0
  20. package/dist/useLocalStorageState-Dk99sIDN.cjs +1 -0
  21. package/dist/{useLocalStorageState-eavHUAXf.js → useLocalStorageState-UeBFsOvS.js} +5 -5
  22. package/dist/{usePermissions-BFLauTCy.js → usePermissions-CQBhLlye.js} +3 -3
  23. package/dist/usePermissions-lUbVOzMf.cjs +1 -0
  24. package/dist/utils.cjs.js +1 -1
  25. package/dist/utils.es.js +24 -24
  26. package/dist/variables.scss +165 -165
  27. package/package.json +116 -116
  28. package/dist/Loading-CqwJLxrt.cjs +0 -1
  29. package/dist/searchUtils-D2VF4fZJ.cjs +0 -1
  30. package/dist/useClipboard-E93qAl2u.cjs +0 -1
  31. package/dist/useLocalStorageState-BPSmbE8f.cjs +0 -1
  32. package/dist/usePermissions-CV4qKyE9.cjs +0 -1
@@ -1,80 +1,80 @@
1
1
  {
2
- "_Loading-B4je8S-e.js": {
3
- "file": "Loading-B4je8S-e.js",
2
+ "_Loading-C4Zoc7RU.cjs": {
3
+ "file": "Loading-C4Zoc7RU.cjs",
4
4
  "name": "Loading",
5
5
  "imports": [
6
- "_ShortcutLinksContext-BU8EEAxv.js"
6
+ "_nivo-bar.es-CbxxQBpL.cjs"
7
7
  ]
8
8
  },
9
- "_Loading-CqwJLxrt.cjs": {
10
- "file": "Loading-CqwJLxrt.cjs",
9
+ "_Loading-ClfDUtqs.js": {
10
+ "file": "Loading-ClfDUtqs.js",
11
11
  "name": "Loading",
12
12
  "imports": [
13
- "_ShortcutLinksContext-BwGYXGO6.cjs"
13
+ "_nivo-bar.es-dpxJHky8.js"
14
14
  ]
15
15
  },
16
- "_ShortcutLinksContext-BU8EEAxv.js": {
17
- "file": "ShortcutLinksContext-BU8EEAxv.js",
18
- "name": "ShortcutLinksContext"
16
+ "_nivo-bar.es-CbxxQBpL.cjs": {
17
+ "file": "nivo-bar.es-CbxxQBpL.cjs",
18
+ "name": "nivo-bar.es"
19
19
  },
20
- "_ShortcutLinksContext-BwGYXGO6.cjs": {
21
- "file": "ShortcutLinksContext-BwGYXGO6.cjs",
22
- "name": "ShortcutLinksContext"
20
+ "_nivo-bar.es-dpxJHky8.js": {
21
+ "file": "nivo-bar.es-dpxJHky8.js",
22
+ "name": "nivo-bar.es"
23
23
  },
24
- "_searchUtils-D2VF4fZJ.cjs": {
25
- "file": "searchUtils-D2VF4fZJ.cjs",
24
+ "_searchUtils-CsX2wi5_.cjs": {
25
+ "file": "searchUtils-CsX2wi5_.cjs",
26
26
  "name": "searchUtils",
27
27
  "imports": [
28
- "_ShortcutLinksContext-BwGYXGO6.cjs"
28
+ "_nivo-bar.es-CbxxQBpL.cjs"
29
29
  ]
30
30
  },
31
- "_searchUtils-DtwPe7Fi.js": {
32
- "file": "searchUtils-DtwPe7Fi.js",
31
+ "_searchUtils-D3hbf2-a.js": {
32
+ "file": "searchUtils-D3hbf2-a.js",
33
33
  "name": "searchUtils",
34
34
  "imports": [
35
- "_ShortcutLinksContext-BU8EEAxv.js"
35
+ "_nivo-bar.es-dpxJHky8.js"
36
36
  ]
37
37
  },
38
- "_useClipboard-DzqY3ual.js": {
39
- "file": "useClipboard-DzqY3ual.js",
38
+ "_useClipboard-B-kckvnR.js": {
39
+ "file": "useClipboard-B-kckvnR.js",
40
40
  "name": "useClipboard",
41
41
  "imports": [
42
- "_ShortcutLinksContext-BU8EEAxv.js"
42
+ "_nivo-bar.es-dpxJHky8.js"
43
43
  ]
44
44
  },
45
- "_useClipboard-E93qAl2u.cjs": {
46
- "file": "useClipboard-E93qAl2u.cjs",
45
+ "_useClipboard-CZ_hcUoH.cjs": {
46
+ "file": "useClipboard-CZ_hcUoH.cjs",
47
47
  "name": "useClipboard",
48
48
  "imports": [
49
- "_ShortcutLinksContext-BwGYXGO6.cjs"
49
+ "_nivo-bar.es-CbxxQBpL.cjs"
50
50
  ]
51
51
  },
52
- "_useLocalStorageState-BPSmbE8f.cjs": {
53
- "file": "useLocalStorageState-BPSmbE8f.cjs",
52
+ "_useLocalStorageState-Dk99sIDN.cjs": {
53
+ "file": "useLocalStorageState-Dk99sIDN.cjs",
54
54
  "name": "useLocalStorageState",
55
55
  "imports": [
56
- "_ShortcutLinksContext-BwGYXGO6.cjs"
56
+ "_nivo-bar.es-CbxxQBpL.cjs"
57
57
  ]
58
58
  },
59
- "_useLocalStorageState-eavHUAXf.js": {
60
- "file": "useLocalStorageState-eavHUAXf.js",
59
+ "_useLocalStorageState-UeBFsOvS.js": {
60
+ "file": "useLocalStorageState-UeBFsOvS.js",
61
61
  "name": "useLocalStorageState",
62
62
  "imports": [
63
- "_ShortcutLinksContext-BU8EEAxv.js"
63
+ "_nivo-bar.es-dpxJHky8.js"
64
64
  ]
65
65
  },
66
- "_usePermissions-BFLauTCy.js": {
67
- "file": "usePermissions-BFLauTCy.js",
66
+ "_usePermissions-CQBhLlye.js": {
67
+ "file": "usePermissions-CQBhLlye.js",
68
68
  "name": "usePermissions",
69
69
  "imports": [
70
- "_ShortcutLinksContext-BU8EEAxv.js"
70
+ "_nivo-bar.es-dpxJHky8.js"
71
71
  ]
72
72
  },
73
- "_usePermissions-CV4qKyE9.cjs": {
74
- "file": "usePermissions-CV4qKyE9.cjs",
73
+ "_usePermissions-lUbVOzMf.cjs": {
74
+ "file": "usePermissions-lUbVOzMf.cjs",
75
75
  "name": "usePermissions",
76
76
  "imports": [
77
- "_ShortcutLinksContext-BwGYXGO6.cjs"
77
+ "_nivo-bar.es-CbxxQBpL.cjs"
78
78
  ]
79
79
  },
80
80
  "_useWindowSize-CE6DJWzn.cjs": {
@@ -91,9 +91,9 @@
91
91
  "src": "src/contexts/index.ts",
92
92
  "isEntry": true,
93
93
  "imports": [
94
- "_ShortcutLinksContext-BwGYXGO6.cjs",
95
- "_Loading-CqwJLxrt.cjs",
96
- "_useLocalStorageState-BPSmbE8f.cjs"
94
+ "_nivo-bar.es-CbxxQBpL.cjs",
95
+ "_Loading-C4Zoc7RU.cjs",
96
+ "_useLocalStorageState-Dk99sIDN.cjs"
97
97
  ]
98
98
  },
99
99
  "src/hooks/index.ts": {
@@ -102,11 +102,11 @@
102
102
  "src": "src/hooks/index.ts",
103
103
  "isEntry": true,
104
104
  "imports": [
105
- "_ShortcutLinksContext-BwGYXGO6.cjs",
105
+ "_nivo-bar.es-CbxxQBpL.cjs",
106
106
  "_useWindowSize-CE6DJWzn.cjs",
107
- "_usePermissions-CV4qKyE9.cjs",
108
- "_useClipboard-E93qAl2u.cjs",
109
- "_useLocalStorageState-BPSmbE8f.cjs"
107
+ "_usePermissions-lUbVOzMf.cjs",
108
+ "_useClipboard-CZ_hcUoH.cjs",
109
+ "_useLocalStorageState-Dk99sIDN.cjs"
110
110
  ]
111
111
  },
112
112
  "src/layout/index.ts": {
@@ -115,9 +115,9 @@
115
115
  "src": "src/layout/index.ts",
116
116
  "isEntry": true,
117
117
  "imports": [
118
- "_ShortcutLinksContext-BwGYXGO6.cjs",
118
+ "_nivo-bar.es-CbxxQBpL.cjs",
119
119
  "_useWindowSize-CE6DJWzn.cjs",
120
- "_usePermissions-CV4qKyE9.cjs"
120
+ "_usePermissions-lUbVOzMf.cjs"
121
121
  ]
122
122
  },
123
123
  "src/main.ts": {
@@ -126,12 +126,12 @@
126
126
  "src": "src/main.ts",
127
127
  "isEntry": true,
128
128
  "imports": [
129
- "_ShortcutLinksContext-BwGYXGO6.cjs",
130
- "_Loading-CqwJLxrt.cjs",
129
+ "_nivo-bar.es-CbxxQBpL.cjs",
130
+ "_Loading-C4Zoc7RU.cjs",
131
131
  "_useWindowSize-CE6DJWzn.cjs",
132
- "_searchUtils-D2VF4fZJ.cjs",
133
- "_useClipboard-E93qAl2u.cjs",
134
- "_useLocalStorageState-BPSmbE8f.cjs"
132
+ "_searchUtils-CsX2wi5_.cjs",
133
+ "_useClipboard-CZ_hcUoH.cjs",
134
+ "_useLocalStorageState-Dk99sIDN.cjs"
135
135
  ]
136
136
  },
137
137
  "src/utils/index.ts": {
@@ -140,8 +140,8 @@
140
140
  "src": "src/utils/index.ts",
141
141
  "isEntry": true,
142
142
  "imports": [
143
- "_ShortcutLinksContext-BwGYXGO6.cjs",
144
- "_searchUtils-D2VF4fZJ.cjs"
143
+ "_nivo-bar.es-CbxxQBpL.cjs",
144
+ "_searchUtils-CsX2wi5_.cjs"
145
145
  ]
146
146
  },
147
147
  "style.css": {
@@ -0,0 +1 @@
1
+ "use strict";const s=require("./nivo-bar.es-CbxxQBpL.cjs"),r="_loading_rgybp_1",o="_spinner-grow_rgybp_10",e="_second_rgybp_14",i="_third_rgybp_17",a="_loadingBlock_rgybp_21",n={loading:r,"spinner-grow":"_spinner-grow_rgybp_10",spinnerGrow:o,second:e,third:i,loadingBlock:a},t=()=>s.jsxRuntimeExports.jsxs("div",{className:s.classNames("luminus-loading",n.loading),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("spinner-grow",n.spinnerGrow,"text-primary"),role:"status"}),s.jsxRuntimeExports.jsx("div",{className:s.classNames("spinner-grow",n.spinnerGrow,"text-primary",n.second),role:"status"}),s.jsxRuntimeExports.jsx("div",{className:s.classNames("spinner-grow",n.spinnerGrow,"text-primary",n.third),role:"status"})]});exports.Loading=t;exports.classes=n;
@@ -1,4 +1,4 @@
1
- import { j as r, c as n } from "./ShortcutLinksContext-BU8EEAxv.js";
1
+ import { j as r, c as n } from "./nivo-bar.es-dpxJHky8.js";
2
2
  const o = "_loading_rgybp_1", i = "_spinner-grow_rgybp_10", e = "_second_rgybp_14", a = "_third_rgybp_17", t = "_loadingBlock_rgybp_21", s = {
3
3
  loading: o,
4
4
  "spinner-grow": "_spinner-grow_rgybp_10",
@@ -1 +1 @@
1
- "use strict";var ie=Object.defineProperty;var le=(e,t,r)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var C=(e,t,r)=>le(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./ShortcutLinksContext-BwGYXGO6.cjs"),u=require("react"),N=require("@azure/msal-browser"),ue=require("@azure/msal-react");require("react-router-dom");require("react-hook-form");require("react-flexmonster");const ce=require("./Loading-CqwJLxrt.cjs"),V=require("./useLocalStorageState-BPSmbE8f.cjs");function fe(e){const t=o.toDate(e);return t.setHours(23,59,59,999),t}function de(){return fe(Date.now())}function me(e,t){const r=+o.toDate(e),[n,s]=[+o.toDate(t.start),+o.toDate(t.end)].sort((a,c)=>a-c);return r>=n&&r<=s}function pe(){return o.startOfDay(Date.now())}const he=({children:e})=>{const[t,r]=u.useState(!1),[n,s]=u.useState(""),a=u.useCallback(f=>{r(!0),s(f)},[]),c=u.useCallback(()=>{r(!1)},[]),i=u.useMemo(()=>({show:t,text:n,showConfirm:a,hideConfirm:c}),[t,n,a,c]);return o.jsxRuntimeExports.jsxs(o.ConfirmContext.Provider,{value:i,children:[o.jsxRuntimeExports.jsx(Ze,{}),e]})},xe=()=>{const{texts:{confirm:e}}=u.useContext(o.LuminusComponentsContext),{isShown:t,text:r,onFinish:n}=o.usePrompt(),{options:s}=u.useContext(o.PromptContext),[a,c]=u.useState(s.defaultValue??""),i=u.useCallback(()=>{n(null)},[n]),f=u.useCallback(d=>{d.preventDefault(),!(s.required&&!a)&&n(a)},[n,s.required,a]);u.useEffect(()=>{t===!0&&c(s.defaultValue??"")},[t,s.defaultValue]);const l=u.useMemo(()=>({value:a,onChange:d=>c(d.currentTarget.value),className:"w-100",autoFocus:!0,tabIndex:0}),[a]);return o.jsxRuntimeExports.jsxs(o.Modal,{show:t,size:"sm",centered:!0,onHide:i,children:[o.jsxRuntimeExports.jsx(o.Modal.Header,{className:"justify-content-center",children:o.jsxRuntimeExports.jsx(o.Modal.Title,{children:r})}),o.jsxRuntimeExports.jsxs("form",{onSubmit:f,children:[o.jsxRuntimeExports.jsxs(o.Modal.Body,{children:[s.input==="textarea"?o.jsxRuntimeExports.jsx("textarea",{...l,rows:5}):void 0,s.input==="input"?o.jsxRuntimeExports.jsx(o.FormControl,{...l,type:s.type}):void 0]}),o.jsxRuntimeExports.jsxs(o.Modal.Footer,{className:"w-100 d-flex gap-5",children:[o.jsxRuntimeExports.jsx(o.PrimaryButton,{variant:"outlined",color:"secondary",onClick:i,className:"flex-grow-1",children:e.cancel}),o.jsxRuntimeExports.jsx(o.PrimaryButton,{color:"primary",disabled:s.required&&!a,type:"submit",className:"flex-grow-1",children:e.confirm})]})]})]})},ge=({children:e})=>{const[t,r]=u.useState(!1),[n,s]=u.useState(""),[a,c]=u.useState({input:"textarea",type:"text"}),i=u.useRef(()=>{}),f=u.useCallback(m=>{s(m),r(!0)},[]),l=u.useCallback(()=>{r(!1)},[]),d=u.useMemo(()=>({isShown:t,text:n,showPrompt:f,hidePrompt:l,resolveRef:i,options:a,setOptions:c}),[t,n,f,l,a]);return o.jsxRuntimeExports.jsxs(o.PromptContext.Provider,{value:d,children:[e,o.jsxRuntimeExports.jsx(xe,{})]})},ye=({cookieDomain:e,axiosOptions:t,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:c,children:i})=>{const f=u.useMemo(()=>({axiosOptions:t,cookieDomain:e,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:c}),[t,e,r,s,a,n,c]);return o.jsxRuntimeExports.jsx(o.LuminusComponentsContext.Provider,{value:f,children:o.jsxRuntimeExports.jsx(he,{children:o.jsxRuntimeExports.jsxs(ge,{children:[o.jsxRuntimeExports.jsx(o.Ie,{}),i]})})})},ve=({children:e})=>{const[t,r]=u.useState(!1),[n]=u.useState(new Set),s=u.useCallback(i=>{n.add(i),r(!0)},[n]),a=u.useCallback(i=>{n.delete(i),n.size===0&&r(!1)},[n]),c=u.useMemo(()=>({isLoading:t,startLoading:s,stopLoading:a}),[t,s,a]);return o.jsxRuntimeExports.jsxs(o.LoadingContext.Provider,{value:c,children:[t&&o.jsxRuntimeExports.jsx(ce.Loading,{}),e]})},Te=({children:e})=>{const t=o.useAxios(),{msalInstance:r}=u.useContext(o.AuthContext),{delegation:n,setDelegation:s,setAvailableDelegations:a,refreshAvailableDelegations:c}=u.useContext(o.DelegationContext),{getToken:i}=o.useAuth(),[f,l]=u.useState(null),d=u.useCallback(async()=>{const x=await i();x&&l(x)},[i]);u.useEffect(()=>{d()},[d]);const h=u.useCallback(()=>{const x=localStorage.getItem("user")??null;return x?JSON.parse(x??""):null},[])(),[p,g]=u.useState({state:h?o.LoginState.LOGGED_IN:o.LoginState.LOGGING_IN,user:h}),P=u.useCallback(async x=>{let v=null;return await t.get("/user/detail",x?{headers:{Authorization:`Bearer ${x}`}}:void 0).then(M=>{v=M.data}).catch(()=>{v=null}),v},[t]),S=u.useCallback(()=>{localStorage.removeItem("user"),g({state:o.LoginState.LOGGED_OUT,user:null}),s(null),a(null)},[a,s]),E=u.useCallback(async x=>{g({state:o.LoginState.LOGGING_IN,user:null});const v=await P(x);return v?(g({state:o.LoginState.LOGGED_IN,user:v}),localStorage.setItem("user",JSON.stringify(v)),await c(),!0):(g({state:o.LoginState.LOGIN_FAILED,user:null}),!1)},[P,c]),b=u.useCallback(()=>{S()},[S]);u.useEffect(()=>{if(r){const x=r.addEventCallback(v=>{if(v.eventType===N.EventType.LOGIN_SUCCESS&&v.payload){const M=v.payload;l(M.accessToken)}});return()=>{x&&r.removeEventCallback(x)}}return()=>{}},[r,E,b]);const K=u.useCallback(async x=>{x&&await E(x).catch(()=>{b(),s(null)})},[E,b,s]);u.useEffect(()=>{K(f)},[f,n==null?void 0:n.id,K]);const ae=u.useMemo(()=>({user:p.user,userLoginState:p,loginUser:E,logoutUser:b}),[p,E,b]);return o.jsxRuntimeExports.jsx(o.UserContext.Provider,{value:ae,children:e})},Ce=({...e})=>{const{cookieDomain:t}=u.useContext(o.LuminusComponentsContext),[,r]=o.useCookies(["Authorization"]),n=u.useMemo(()=>({useMsal:e.useMsal??!1,msalInstance:e.useMsal?e.msalInstance??null:null,msalScopes:e.useMsal?e.msalScopes??[]:[],msalExtraScopes:e.useMsal?e.msalExtraScopes??[]:[]}),[e]);return u.useEffect(()=>{if(e.useMsal){const s=e.msalInstance.addEventCallback(a=>{if(a.eventType===N.EventType.LOGIN_SUCCESS||a.eventType===N.EventType.ACQUIRE_TOKEN_SUCCESS&&a.payload){const c=a.payload,i=c.account;e.msalInstance.setActiveAccount(i);const f=c.accessToken,l=c.expiresOn;r("Authorization",f,{path:"/",secure:!0,sameSite:"none",domain:t,expires:l??void 0})}a.error&&console.error("AuthProvider MSAL Error",a)});return()=>{s&&e.msalInstance.removeEventCallback(s)}}return()=>{}},[e,r,t]),o.jsxRuntimeExports.jsx(o.AuthContext.Provider,{value:n,children:e.useMsal?o.jsxRuntimeExports.jsx(ue.MsalProvider,{instance:e.msalInstance,children:e.children}):e.children})},Ee=({children:e,relativeEndpoint:t})=>{const[r,n,s]=V.useLocalStorageState("user-delegation",null),a=u.useMemo(()=>{if(!r)return null;const m=r.from?o.parseISO(r.from):pe(),h=r.to?o.parseISO(r.to):de();return me(new Date(Date.now()),{start:m,end:h})?r:(n(null),null)},[r,n]),{data:c,setData:i,reloadData:f}=V.useGetApiData(t,{nullStateBeforeLoad:!1,nullStateOnFail:!0}),l=u.useRef(null);u.useEffect(()=>{const m=()=>{f(),l.current=window.setTimeout(m,o.msToStartOfNextDay()+5e3)};return m(),()=>{l.current!==null&&window.clearTimeout(l.current)}},[f]),u.useEffect(()=>{const m=()=>{s()};return window.addEventListener("focus",m),()=>{window.removeEventListener("focus",m)}},[s,f]);const d=u.useMemo(()=>({delegation:a,setDelegation:n,availableDelegations:c,setAvailableDelegations:i,refreshAvailableDelegations:f}),[a,n,c,i,f]);return o.jsxRuntimeExports.jsx(o.DelegationContext.Provider,{value:d,children:e})};var Se=typeof Element<"u",be=typeof Map=="function",Ae=typeof Set=="function",je=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function D(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!D(e[n],t[n]))return!1;return!0}var a;if(be&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;for(a=e.entries();!(n=a.next()).done;)if(!D(n.value[1],t.get(n.value[0])))return!1;return!0}if(Ae&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(je&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;if(Se&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!D(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var Oe=function(t,r){try{return D(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const we=o.getDefaultExportFromCjs(Oe);var Pe=function(t,r,n,s){var a=n?n.call(s,t,r):void 0;if(a!==void 0)return!!a;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var c=Object.keys(t),i=Object.keys(r);if(c.length!==i.length)return!1;for(var f=Object.prototype.hasOwnProperty.bind(r),l=0;l<c.length;l++){var d=c[l];if(!f(d))return!1;var m=t[d],h=r[d];if(a=n?n.call(s,m,h,d):void 0,a===!1||a===void 0&&m!==h)return!1}return!0};const Re=o.getDefaultExportFromCjs(Pe);var X=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(X||{}),H={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},Y=Object.values(X),B={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Ie=Object.entries(B).reduce((e,[t,r])=>(e[r]=t,e),{}),T="data-rh",O={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},w=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},ke=e=>{let t=w(e,"title");const r=w(e,O.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=w(e,O.DEFAULT_TITLE);return t||n||void 0},De=e=>w(e,O.ON_CHANGE_CLIENT_STATE)||(()=>{}),$=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),Le=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const s=Object.keys(n);for(let a=0;a<s.length;a+=1){const i=s[a].toLowerCase();if(e.indexOf(i)!==-1&&n[i])return r.concat(n)}}return r},[]),Me=e=>console&&typeof console.warn=="function"&&console.warn(e),R=(e,t,r)=>{const n={};return r.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&Me(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,a)=>{const c={};a.filter(f=>{let l;const d=Object.keys(f);for(let h=0;h<d.length;h+=1){const p=d[h],g=p.toLowerCase();t.indexOf(g)!==-1&&!(l==="rel"&&f[l].toLowerCase()==="canonical")&&!(g==="rel"&&f[g].toLowerCase()==="stylesheet")&&(l=g),t.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(l=p)}if(!l||!f[l])return!1;const m=f[l].toLowerCase();return n[l]||(n[l]={}),c[l]||(c[l]={}),n[l][m]?!1:(c[l][m]=!0,!0)}).reverse().forEach(f=>s.push(f));const i=Object.keys(c);for(let f=0;f<i.length;f+=1){const l=i[f],d={...n[l],...c[l]};n[l]=d}return s},[]).reverse()},He=(e,t)=>{if(Array.isArray(e)&&e.length){for(let r=0;r<e.length;r+=1)if(e[r][t])return!0}return!1},$e=e=>({baseTag:Le(["href"],e),bodyAttributes:$("bodyAttributes",e),defer:w(e,O.DEFER),encode:w(e,O.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:$("htmlAttributes",e),linkTags:R("link",["rel","href"],e),metaTags:R("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:R("noscript",["innerHTML"],e),onChangeClientState:De(e),scriptTags:R("script",["src","innerHTML"],e),styleTags:R("style",["cssText"],e),title:ke(e),titleAttributes:$("titleAttributes",e),prioritizeSeoTags:He(e,O.PRIORITIZE_SEO_TAGS)}),ee=e=>Array.isArray(e)?e.join(""):e,_e=(e,t)=>{const r=Object.keys(e);for(let n=0;n<r.length;n+=1)if(t[r[n]]&&t[r[n]].includes(e[r[n]]))return!0;return!1},_=(e,t)=>Array.isArray(e)?e.reduce((r,n)=>(_e(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},J=(e,t)=>({...e,[t]:void 0}),Ue=["noscript","script","style"],q=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),te=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),Ne=(e,t,r,n)=>{const s=te(r),a=ee(t);return s?`<${e} ${T}="true" ${s}>${q(a,n)}</${e}>`:`<${e} ${T}="true">${q(a,n)}</${e}>`},qe=(e,t,r=!0)=>t.reduce((n,s)=>{const a=s,c=Object.keys(a).filter(l=>!(l==="innerHTML"||l==="cssText")).reduce((l,d)=>{const m=typeof a[d]>"u"?d:`${d}="${q(a[d],r)}"`;return l?`${l} ${m}`:m},""),i=a.innerHTML||a.cssText||"",f=Ue.indexOf(e)===-1;return`${n}<${e} ${T}="true" ${c}${f?"/>":`>${i}</${e}>`}`},""),re=(e,t={})=>Object.keys(e).reduce((r,n)=>{const s=B[n];return r[s||n]=e[n],r},t),Fe=(e,t,r)=>{const n={key:t,[T]:!0},s=re(r,n);return[u.createElement("title",s,t)]},L=(e,t)=>t.map((r,n)=>{const s={key:n,[T]:!0};return Object.keys(r).forEach(a=>{const i=B[a]||a;if(i==="innerHTML"||i==="cssText"){const f=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:f}}else s[i]=r[a]}),u.createElement(e,s)}),y=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>Fe(e,t.title,t.titleAttributes),toString:()=>Ne(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>re(t),toString:()=>te(t)};default:return{toComponent:()=>L(e,t),toString:()=>qe(e,t,r)}}},Ge=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const s=_(e,H.meta),a=_(t,H.link),c=_(r,H.script);return{priorityMethods:{toComponent:()=>[...L("meta",s.priority),...L("link",a.priority),...L("script",c.priority)],toString:()=>`${y("meta",s.priority,n)} ${y("link",a.priority,n)} ${y("script",c.priority,n)}`},metaTags:s.default,linkTags:a.default,scriptTags:c.default}},ze=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:a,styleTags:c,title:i="",titleAttributes:f,prioritizeSeoTags:l}=e;let{linkTags:d,metaTags:m,scriptTags:h}=e,p={toComponent:()=>{},toString:()=>""};return l&&({priorityMethods:p,linkTags:d,metaTags:m,scriptTags:h}=Ge(e)),{priority:p,base:y("base",t,n),bodyAttributes:y("bodyAttributes",r,n),htmlAttributes:y("htmlAttributes",s,n),link:y("link",d,n),meta:y("meta",m,n),noscript:y("noscript",a,n),script:y("script",h,n),style:y("style",c,n),title:y("title",{title:i,titleAttributes:f},n)}},F=ze,k=[],ne=!!(typeof window<"u"&&window.document&&window.document.createElement),G=class{constructor(e,t){C(this,"instances",[]);C(this,"canUseDOM",ne);C(this,"context");C(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?k:this.instances,add:e=>{(this.canUseDOM?k:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?k:this.instances).indexOf(e);(this.canUseDOM?k:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=F({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Be={},se=u.createContext(Be),A,oe=(A=class extends u.Component{constructor(r){super(r);C(this,"helmetData");this.helmetData=new G(this.props.context||{},A.canUseDOM)}render(){return u.createElement(se.Provider,{value:this.helmetData.value},this.props.children)}},C(A,"canUseDOM",ne),A),j=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${T}]`),s=[].slice.call(n),a=[];let c;return t&&t.length&&t.forEach(i=>{const f=document.createElement(e);for(const l in i)if(Object.prototype.hasOwnProperty.call(i,l))if(l==="innerHTML")f.innerHTML=i.innerHTML;else if(l==="cssText")f.styleSheet?f.styleSheet.cssText=i.cssText:f.appendChild(document.createTextNode(i.cssText));else{const d=l,m=typeof i[d]>"u"?"":i[d];f.setAttribute(l,m)}f.setAttribute(T,"true"),s.some((l,d)=>(c=d,f.isEqualNode(l)))?s.splice(c,1):a.push(f)}),s.forEach(i=>{var f;return(f=i.parentNode)==null?void 0:f.removeChild(i)}),a.forEach(i=>r.appendChild(i)),{oldTags:s,newTags:a}},z=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(T),s=n?n.split(","):[],a=[...s],c=Object.keys(t);for(const i of c){const f=t[i]||"";r.getAttribute(i)!==f&&r.setAttribute(i,f),s.indexOf(i)===-1&&s.push(i);const l=a.indexOf(i);l!==-1&&a.splice(l,1)}for(let i=a.length-1;i>=0;i-=1)r.removeAttribute(a[i]);s.length===a.length?r.removeAttribute(T):r.getAttribute(T)!==c.join(",")&&r.setAttribute(T,c.join(","))},Ke=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=ee(e)),z("title",t)},W=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:a,metaTags:c,noscriptTags:i,onChangeClientState:f,scriptTags:l,styleTags:d,title:m,titleAttributes:h}=e;z("body",n),z("html",s),Ke(m,h);const p={baseTag:j("base",r),linkTags:j("link",a),metaTags:j("meta",c),noscriptTags:j("noscript",i),scriptTags:j("script",l),styleTags:j("style",d)},g={},P={};Object.keys(p).forEach(S=>{const{newTags:E,oldTags:b}=p[S];E.length&&(g[S]=E),b.length&&(P[S]=p[S].oldTags)}),t&&t(),f(e,g,P)},I=null,Ve=e=>{I&&cancelAnimationFrame(I),e.defer?I=requestAnimationFrame(()=>{W(e,()=>{I=null})}):(W(e),I=null)},Ye=Ve,Z=class extends u.Component{constructor(){super(...arguments);C(this,"rendered",!1)}shouldComponentUpdate(t){return!Re(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const s=$e(t.get().map(a=>{const c={...a.props};return delete c.context,c}));oe.canUseDOM?Ye(s):F&&(n=F(s)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},U,Je=(U=class extends u.Component{shouldComponentUpdate(e){return!we(J(this.props,"helmetData"),J(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return o.invariant(Y.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${Y.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),o.invariant(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return u.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:s,...a}=n.props,c=Object.keys(a).reduce((f,l)=>(f[Ie[l]||l]=a[l],f),{});let{type:i}=n;switch(typeof i=="symbol"?i=i.toString():this.warnOnInvalidChildren(n,s),i){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,c,s);break;default:t=this.mapObjectTypeChildren(n,t,c,s);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof G)){const s=n;n=new G(s.context,!0),delete r.helmetData}return n?u.createElement(Z,{...r,context:n.value}):u.createElement(se.Consumer,null,s=>u.createElement(Z,{...r,context:s}))}},C(U,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),U);const Q=(e,t)=>e?`${e} | ${t}`:t,We=({defaultHelmet:e,children:t,helmetPrefix:r})=>{const[n,s]=u.useState([Q(r??"",e)]),a=u.useCallback(l=>{s(d=>[...d,Q(r??"",l)])},[r]),c=u.useCallback(()=>{s(l=>l.length>1?l.slice(0,-1):l)},[s]),i=u.useMemo(()=>n.at(-1)??"",[n]),f=u.useMemo(()=>({addHelmet:a,removeHelmet:c}),[a,c]);return o.jsxRuntimeExports.jsx(o.HelmetContext.Provider,{value:f,children:o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(Je,{defer:!1,children:o.jsxRuntimeExports.jsx("title",{children:i})}),t]})})},Ze=()=>{const{texts:{confirm:e}}=u.useContext(o.LuminusComponentsContext),{onConfirm:t,onCancel:r,text:n,show:s}=o.useConfirm();return o.jsxRuntimeExports.jsxs(o.Modal,{show:s,size:"sm",centered:!0,onHide:r,children:[o.jsxRuntimeExports.jsx(o.Modal.Header,{className:"justify-content-center",children:o.jsxRuntimeExports.jsx(o.Modal.Title,{children:n})}),o.jsxRuntimeExports.jsx(o.Modal.Body,{children:o.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[o.jsxRuntimeExports.jsx(o.PrimaryButton,{type:"button",variant:"outlined",color:"secondary",className:"w-100",onClick:r,children:e.no}),o.jsxRuntimeExports.jsx(o.PrimaryButton,{type:"button",color:"primary",onClick:t,className:"w-100 ml",children:e.yes})]})})]})};exports.AuthContext=o.AuthContext;exports.DelegationContext=o.DelegationContext;exports.HelmetContext=o.HelmetContext;exports.LoadingContext=o.LoadingContext;exports.LuminusComponentsContext=o.LuminusComponentsContext;exports.UserContext=o.UserContext;exports.AuthProvider=Ce;exports.DelegationProvider=Ee;exports.HelmetProvider=We;exports.LoadingProvider=ve;exports.LuminusComponentsProvider=ye;exports.UserProvider=Te;
1
+ "use strict";var ie=Object.defineProperty;var le=(e,t,r)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var C=(e,t,r)=>le(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./nivo-bar.es-CbxxQBpL.cjs"),u=require("react"),N=require("@azure/msal-browser"),ue=require("@azure/msal-react");require("react-router-dom");require("react-hook-form");require("react-flexmonster");const ce=require("./Loading-C4Zoc7RU.cjs"),V=require("./useLocalStorageState-Dk99sIDN.cjs");function fe(e){const t=o.toDate(e);return t.setHours(23,59,59,999),t}function de(){return fe(Date.now())}function me(e,t){const r=+o.toDate(e),[n,s]=[+o.toDate(t.start),+o.toDate(t.end)].sort((a,c)=>a-c);return r>=n&&r<=s}function pe(){return o.startOfDay(Date.now())}const he=({children:e})=>{const[t,r]=u.useState(!1),[n,s]=u.useState(""),a=u.useCallback(f=>{r(!0),s(f)},[]),c=u.useCallback(()=>{r(!1)},[]),i=u.useMemo(()=>({show:t,text:n,showConfirm:a,hideConfirm:c}),[t,n,a,c]);return o.jsxRuntimeExports.jsxs(o.ConfirmContext.Provider,{value:i,children:[o.jsxRuntimeExports.jsx(Ze,{}),e]})},xe=()=>{const{texts:{confirm:e}}=u.useContext(o.LuminusComponentsContext),{isShown:t,text:r,onFinish:n}=o.usePrompt(),{options:s}=u.useContext(o.PromptContext),[a,c]=u.useState(s.defaultValue??""),i=u.useCallback(()=>{n(null)},[n]),f=u.useCallback(d=>{d.preventDefault(),!(s.required&&!a)&&n(a)},[n,s.required,a]);u.useEffect(()=>{t===!0&&c(s.defaultValue??"")},[t,s.defaultValue]);const l=u.useMemo(()=>({value:a,onChange:d=>c(d.currentTarget.value),className:"w-100",autoFocus:!0,tabIndex:0}),[a]);return o.jsxRuntimeExports.jsxs(o.Modal,{show:t,size:"sm",centered:!0,onHide:i,children:[o.jsxRuntimeExports.jsx(o.Modal.Header,{className:"justify-content-center",children:o.jsxRuntimeExports.jsx(o.Modal.Title,{children:r})}),o.jsxRuntimeExports.jsxs("form",{onSubmit:f,children:[o.jsxRuntimeExports.jsxs(o.Modal.Body,{children:[s.input==="textarea"?o.jsxRuntimeExports.jsx("textarea",{...l,rows:5}):void 0,s.input==="input"?o.jsxRuntimeExports.jsx(o.FormControl,{...l,type:s.type}):void 0]}),o.jsxRuntimeExports.jsxs(o.Modal.Footer,{className:"w-100 d-flex gap-5",children:[o.jsxRuntimeExports.jsx(o.PrimaryButton,{variant:"outlined",color:"secondary",onClick:i,className:"flex-grow-1",children:e.cancel}),o.jsxRuntimeExports.jsx(o.PrimaryButton,{color:"primary",disabled:s.required&&!a,type:"submit",className:"flex-grow-1",children:e.confirm})]})]})]})},ge=({children:e})=>{const[t,r]=u.useState(!1),[n,s]=u.useState(""),[a,c]=u.useState({input:"textarea",type:"text"}),i=u.useRef(()=>{}),f=u.useCallback(m=>{s(m),r(!0)},[]),l=u.useCallback(()=>{r(!1)},[]),d=u.useMemo(()=>({isShown:t,text:n,showPrompt:f,hidePrompt:l,resolveRef:i,options:a,setOptions:c}),[t,n,f,l,a]);return o.jsxRuntimeExports.jsxs(o.PromptContext.Provider,{value:d,children:[e,o.jsxRuntimeExports.jsx(xe,{})]})},ye=({cookieDomain:e,axiosOptions:t,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:c,children:i})=>{const f=u.useMemo(()=>({axiosOptions:t,cookieDomain:e,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:c}),[t,e,r,s,a,n,c]);return o.jsxRuntimeExports.jsx(o.LuminusComponentsContext.Provider,{value:f,children:o.jsxRuntimeExports.jsx(he,{children:o.jsxRuntimeExports.jsxs(ge,{children:[o.jsxRuntimeExports.jsx(o.Ie,{}),i]})})})},ve=({children:e})=>{const[t,r]=u.useState(!1),[n]=u.useState(new Set),s=u.useCallback(i=>{n.add(i),r(!0)},[n]),a=u.useCallback(i=>{n.delete(i),n.size===0&&r(!1)},[n]),c=u.useMemo(()=>({isLoading:t,startLoading:s,stopLoading:a}),[t,s,a]);return o.jsxRuntimeExports.jsxs(o.LoadingContext.Provider,{value:c,children:[t&&o.jsxRuntimeExports.jsx(ce.Loading,{}),e]})},Te=({children:e})=>{const t=o.useAxios(),{msalInstance:r}=u.useContext(o.AuthContext),{delegation:n,setDelegation:s,setAvailableDelegations:a,refreshAvailableDelegations:c}=u.useContext(o.DelegationContext),{getToken:i}=o.useAuth(),[f,l]=u.useState(null),d=u.useCallback(async()=>{const x=await i();x&&l(x)},[i]);u.useEffect(()=>{d()},[d]);const h=u.useCallback(()=>{const x=localStorage.getItem("user")??null;return x?JSON.parse(x??""):null},[])(),[p,g]=u.useState({state:h?o.LoginState.LOGGED_IN:o.LoginState.LOGGING_IN,user:h}),P=u.useCallback(async x=>{let v=null;return await t.get("/user/detail",x?{headers:{Authorization:`Bearer ${x}`}}:void 0).then(M=>{v=M.data}).catch(()=>{v=null}),v},[t]),S=u.useCallback(()=>{localStorage.removeItem("user"),g({state:o.LoginState.LOGGED_OUT,user:null}),s(null),a(null)},[a,s]),E=u.useCallback(async x=>{g({state:o.LoginState.LOGGING_IN,user:null});const v=await P(x);return v?(g({state:o.LoginState.LOGGED_IN,user:v}),localStorage.setItem("user",JSON.stringify(v)),await c(),!0):(g({state:o.LoginState.LOGIN_FAILED,user:null}),!1)},[P,c]),b=u.useCallback(()=>{S()},[S]);u.useEffect(()=>{if(r){const x=r.addEventCallback(v=>{if(v.eventType===N.EventType.LOGIN_SUCCESS&&v.payload){const M=v.payload;l(M.accessToken)}});return()=>{x&&r.removeEventCallback(x)}}return()=>{}},[r,E,b]);const K=u.useCallback(async x=>{x&&await E(x).catch(()=>{b(),s(null)})},[E,b,s]);u.useEffect(()=>{K(f)},[f,n==null?void 0:n.id,K]);const ae=u.useMemo(()=>({user:p.user,userLoginState:p,loginUser:E,logoutUser:b}),[p,E,b]);return o.jsxRuntimeExports.jsx(o.UserContext.Provider,{value:ae,children:e})},Ce=({...e})=>{const{cookieDomain:t}=u.useContext(o.LuminusComponentsContext),[,r]=o.useCookies(["Authorization"]),n=u.useMemo(()=>({useMsal:e.useMsal??!1,msalInstance:e.useMsal?e.msalInstance??null:null,msalScopes:e.useMsal?e.msalScopes??[]:[],msalExtraScopes:e.useMsal?e.msalExtraScopes??[]:[]}),[e]);return u.useEffect(()=>{if(e.useMsal){const s=e.msalInstance.addEventCallback(a=>{if(a.eventType===N.EventType.LOGIN_SUCCESS||a.eventType===N.EventType.ACQUIRE_TOKEN_SUCCESS&&a.payload){const c=a.payload,i=c.account;e.msalInstance.setActiveAccount(i);const f=c.accessToken,l=c.expiresOn;r("Authorization",f,{path:"/",secure:!0,sameSite:"none",domain:t,expires:l??void 0})}a.error&&console.error("AuthProvider MSAL Error",a)});return()=>{s&&e.msalInstance.removeEventCallback(s)}}return()=>{}},[e,r,t]),o.jsxRuntimeExports.jsx(o.AuthContext.Provider,{value:n,children:e.useMsal?o.jsxRuntimeExports.jsx(ue.MsalProvider,{instance:e.msalInstance,children:e.children}):e.children})},Ee=({children:e,relativeEndpoint:t})=>{const[r,n,s]=V.useLocalStorageState("user-delegation",null),a=u.useMemo(()=>{if(!r)return null;const m=r.from?o.parseISO(r.from):pe(),h=r.to?o.parseISO(r.to):de();return me(new Date(Date.now()),{start:m,end:h})?r:(n(null),null)},[r,n]),{data:c,setData:i,reloadData:f}=V.useGetApiData(t,{nullStateBeforeLoad:!1,nullStateOnFail:!0}),l=u.useRef(null);u.useEffect(()=>{const m=()=>{f(),l.current=window.setTimeout(m,o.msToStartOfNextDay()+5e3)};return m(),()=>{l.current!==null&&window.clearTimeout(l.current)}},[f]),u.useEffect(()=>{const m=()=>{s()};return window.addEventListener("focus",m),()=>{window.removeEventListener("focus",m)}},[s,f]);const d=u.useMemo(()=>({delegation:a,setDelegation:n,availableDelegations:c,setAvailableDelegations:i,refreshAvailableDelegations:f}),[a,n,c,i,f]);return o.jsxRuntimeExports.jsx(o.DelegationContext.Provider,{value:d,children:e})};var Se=typeof Element<"u",be=typeof Map=="function",Ae=typeof Set=="function",je=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function k(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!k(e[n],t[n]))return!1;return!0}var a;if(be&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;for(a=e.entries();!(n=a.next()).done;)if(!k(n.value[1],t.get(n.value[0])))return!1;return!0}if(Ae&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(je&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;if(Se&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!k(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var Oe=function(t,r){try{return k(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const we=o.getDefaultExportFromCjs(Oe);var Pe=function(t,r,n,s){var a=n?n.call(s,t,r):void 0;if(a!==void 0)return!!a;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var c=Object.keys(t),i=Object.keys(r);if(c.length!==i.length)return!1;for(var f=Object.prototype.hasOwnProperty.bind(r),l=0;l<c.length;l++){var d=c[l];if(!f(d))return!1;var m=t[d],h=r[d];if(a=n?n.call(s,m,h,d):void 0,a===!1||a===void 0&&m!==h)return!1}return!0};const Re=o.getDefaultExportFromCjs(Pe);var X=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(X||{}),H={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},Y=Object.values(X),B={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Ie=Object.entries(B).reduce((e,[t,r])=>(e[r]=t,e),{}),T="data-rh",O={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},w=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},De=e=>{let t=w(e,"title");const r=w(e,O.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=w(e,O.DEFAULT_TITLE);return t||n||void 0},ke=e=>w(e,O.ON_CHANGE_CLIENT_STATE)||(()=>{}),$=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),Le=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const s=Object.keys(n);for(let a=0;a<s.length;a+=1){const i=s[a].toLowerCase();if(e.indexOf(i)!==-1&&n[i])return r.concat(n)}}return r},[]),Me=e=>console&&typeof console.warn=="function"&&console.warn(e),R=(e,t,r)=>{const n={};return r.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&Me(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,a)=>{const c={};a.filter(f=>{let l;const d=Object.keys(f);for(let h=0;h<d.length;h+=1){const p=d[h],g=p.toLowerCase();t.indexOf(g)!==-1&&!(l==="rel"&&f[l].toLowerCase()==="canonical")&&!(g==="rel"&&f[g].toLowerCase()==="stylesheet")&&(l=g),t.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(l=p)}if(!l||!f[l])return!1;const m=f[l].toLowerCase();return n[l]||(n[l]={}),c[l]||(c[l]={}),n[l][m]?!1:(c[l][m]=!0,!0)}).reverse().forEach(f=>s.push(f));const i=Object.keys(c);for(let f=0;f<i.length;f+=1){const l=i[f],d={...n[l],...c[l]};n[l]=d}return s},[]).reverse()},He=(e,t)=>{if(Array.isArray(e)&&e.length){for(let r=0;r<e.length;r+=1)if(e[r][t])return!0}return!1},$e=e=>({baseTag:Le(["href"],e),bodyAttributes:$("bodyAttributes",e),defer:w(e,O.DEFER),encode:w(e,O.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:$("htmlAttributes",e),linkTags:R("link",["rel","href"],e),metaTags:R("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:R("noscript",["innerHTML"],e),onChangeClientState:ke(e),scriptTags:R("script",["src","innerHTML"],e),styleTags:R("style",["cssText"],e),title:De(e),titleAttributes:$("titleAttributes",e),prioritizeSeoTags:He(e,O.PRIORITIZE_SEO_TAGS)}),ee=e=>Array.isArray(e)?e.join(""):e,_e=(e,t)=>{const r=Object.keys(e);for(let n=0;n<r.length;n+=1)if(t[r[n]]&&t[r[n]].includes(e[r[n]]))return!0;return!1},_=(e,t)=>Array.isArray(e)?e.reduce((r,n)=>(_e(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},J=(e,t)=>({...e,[t]:void 0}),Ue=["noscript","script","style"],q=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),te=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),Ne=(e,t,r,n)=>{const s=te(r),a=ee(t);return s?`<${e} ${T}="true" ${s}>${q(a,n)}</${e}>`:`<${e} ${T}="true">${q(a,n)}</${e}>`},qe=(e,t,r=!0)=>t.reduce((n,s)=>{const a=s,c=Object.keys(a).filter(l=>!(l==="innerHTML"||l==="cssText")).reduce((l,d)=>{const m=typeof a[d]>"u"?d:`${d}="${q(a[d],r)}"`;return l?`${l} ${m}`:m},""),i=a.innerHTML||a.cssText||"",f=Ue.indexOf(e)===-1;return`${n}<${e} ${T}="true" ${c}${f?"/>":`>${i}</${e}>`}`},""),re=(e,t={})=>Object.keys(e).reduce((r,n)=>{const s=B[n];return r[s||n]=e[n],r},t),Fe=(e,t,r)=>{const n={key:t,[T]:!0},s=re(r,n);return[u.createElement("title",s,t)]},L=(e,t)=>t.map((r,n)=>{const s={key:n,[T]:!0};return Object.keys(r).forEach(a=>{const i=B[a]||a;if(i==="innerHTML"||i==="cssText"){const f=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:f}}else s[i]=r[a]}),u.createElement(e,s)}),y=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>Fe(e,t.title,t.titleAttributes),toString:()=>Ne(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>re(t),toString:()=>te(t)};default:return{toComponent:()=>L(e,t),toString:()=>qe(e,t,r)}}},Ge=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const s=_(e,H.meta),a=_(t,H.link),c=_(r,H.script);return{priorityMethods:{toComponent:()=>[...L("meta",s.priority),...L("link",a.priority),...L("script",c.priority)],toString:()=>`${y("meta",s.priority,n)} ${y("link",a.priority,n)} ${y("script",c.priority,n)}`},metaTags:s.default,linkTags:a.default,scriptTags:c.default}},ze=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:a,styleTags:c,title:i="",titleAttributes:f,prioritizeSeoTags:l}=e;let{linkTags:d,metaTags:m,scriptTags:h}=e,p={toComponent:()=>{},toString:()=>""};return l&&({priorityMethods:p,linkTags:d,metaTags:m,scriptTags:h}=Ge(e)),{priority:p,base:y("base",t,n),bodyAttributes:y("bodyAttributes",r,n),htmlAttributes:y("htmlAttributes",s,n),link:y("link",d,n),meta:y("meta",m,n),noscript:y("noscript",a,n),script:y("script",h,n),style:y("style",c,n),title:y("title",{title:i,titleAttributes:f},n)}},F=ze,D=[],ne=!!(typeof window<"u"&&window.document&&window.document.createElement),G=class{constructor(e,t){C(this,"instances",[]);C(this,"canUseDOM",ne);C(this,"context");C(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?D:this.instances,add:e=>{(this.canUseDOM?D:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?D:this.instances).indexOf(e);(this.canUseDOM?D:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=F({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Be={},se=u.createContext(Be),A,oe=(A=class extends u.Component{constructor(r){super(r);C(this,"helmetData");this.helmetData=new G(this.props.context||{},A.canUseDOM)}render(){return u.createElement(se.Provider,{value:this.helmetData.value},this.props.children)}},C(A,"canUseDOM",ne),A),j=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${T}]`),s=[].slice.call(n),a=[];let c;return t&&t.length&&t.forEach(i=>{const f=document.createElement(e);for(const l in i)if(Object.prototype.hasOwnProperty.call(i,l))if(l==="innerHTML")f.innerHTML=i.innerHTML;else if(l==="cssText")f.styleSheet?f.styleSheet.cssText=i.cssText:f.appendChild(document.createTextNode(i.cssText));else{const d=l,m=typeof i[d]>"u"?"":i[d];f.setAttribute(l,m)}f.setAttribute(T,"true"),s.some((l,d)=>(c=d,f.isEqualNode(l)))?s.splice(c,1):a.push(f)}),s.forEach(i=>{var f;return(f=i.parentNode)==null?void 0:f.removeChild(i)}),a.forEach(i=>r.appendChild(i)),{oldTags:s,newTags:a}},z=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(T),s=n?n.split(","):[],a=[...s],c=Object.keys(t);for(const i of c){const f=t[i]||"";r.getAttribute(i)!==f&&r.setAttribute(i,f),s.indexOf(i)===-1&&s.push(i);const l=a.indexOf(i);l!==-1&&a.splice(l,1)}for(let i=a.length-1;i>=0;i-=1)r.removeAttribute(a[i]);s.length===a.length?r.removeAttribute(T):r.getAttribute(T)!==c.join(",")&&r.setAttribute(T,c.join(","))},Ke=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=ee(e)),z("title",t)},W=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:a,metaTags:c,noscriptTags:i,onChangeClientState:f,scriptTags:l,styleTags:d,title:m,titleAttributes:h}=e;z("body",n),z("html",s),Ke(m,h);const p={baseTag:j("base",r),linkTags:j("link",a),metaTags:j("meta",c),noscriptTags:j("noscript",i),scriptTags:j("script",l),styleTags:j("style",d)},g={},P={};Object.keys(p).forEach(S=>{const{newTags:E,oldTags:b}=p[S];E.length&&(g[S]=E),b.length&&(P[S]=p[S].oldTags)}),t&&t(),f(e,g,P)},I=null,Ve=e=>{I&&cancelAnimationFrame(I),e.defer?I=requestAnimationFrame(()=>{W(e,()=>{I=null})}):(W(e),I=null)},Ye=Ve,Z=class extends u.Component{constructor(){super(...arguments);C(this,"rendered",!1)}shouldComponentUpdate(t){return!Re(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const s=$e(t.get().map(a=>{const c={...a.props};return delete c.context,c}));oe.canUseDOM?Ye(s):F&&(n=F(s)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},U,Je=(U=class extends u.Component{shouldComponentUpdate(e){return!we(J(this.props,"helmetData"),J(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return o.invariant(Y.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${Y.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),o.invariant(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return u.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:s,...a}=n.props,c=Object.keys(a).reduce((f,l)=>(f[Ie[l]||l]=a[l],f),{});let{type:i}=n;switch(typeof i=="symbol"?i=i.toString():this.warnOnInvalidChildren(n,s),i){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,c,s);break;default:t=this.mapObjectTypeChildren(n,t,c,s);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof G)){const s=n;n=new G(s.context,!0),delete r.helmetData}return n?u.createElement(Z,{...r,context:n.value}):u.createElement(se.Consumer,null,s=>u.createElement(Z,{...r,context:s}))}},C(U,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),U);const Q=(e,t)=>e?`${e} | ${t}`:t,We=({defaultHelmet:e,children:t,helmetPrefix:r})=>{const[n,s]=u.useState([Q(r??"",e)]),a=u.useCallback(l=>{s(d=>[...d,Q(r??"",l)])},[r]),c=u.useCallback(()=>{s(l=>l.length>1?l.slice(0,-1):l)},[s]),i=u.useMemo(()=>n.at(-1)??"",[n]),f=u.useMemo(()=>({addHelmet:a,removeHelmet:c}),[a,c]);return o.jsxRuntimeExports.jsx(o.HelmetContext.Provider,{value:f,children:o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(Je,{defer:!1,children:o.jsxRuntimeExports.jsx("title",{children:i})}),t]})})},Ze=()=>{const{texts:{confirm:e}}=u.useContext(o.LuminusComponentsContext),{onConfirm:t,onCancel:r,text:n,show:s}=o.useConfirm();return o.jsxRuntimeExports.jsxs(o.Modal,{show:s,size:"sm",centered:!0,onHide:r,children:[o.jsxRuntimeExports.jsx(o.Modal.Header,{className:"justify-content-center",children:o.jsxRuntimeExports.jsx(o.Modal.Title,{children:n})}),o.jsxRuntimeExports.jsx(o.Modal.Body,{children:o.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[o.jsxRuntimeExports.jsx(o.PrimaryButton,{type:"button",variant:"outlined",color:"secondary",className:"w-100",onClick:r,children:e.no}),o.jsxRuntimeExports.jsx(o.PrimaryButton,{type:"button",color:"primary",onClick:t,className:"w-100 ml",children:e.yes})]})})]})};exports.AuthContext=o.AuthContext;exports.DelegationContext=o.DelegationContext;exports.HelmetContext=o.HelmetContext;exports.LoadingContext=o.LoadingContext;exports.LuminusComponentsContext=o.LuminusComponentsContext;exports.UserContext=o.UserContext;exports.AuthProvider=Ce;exports.DelegationProvider=Ee;exports.HelmetProvider=We;exports.LoadingProvider=ve;exports.LuminusComponentsProvider=ye;exports.UserProvider=Te;
@@ -1,15 +1,15 @@
1
- var Se = Object.defineProperty;
2
- var Oe = (e, t, r) => t in e ? Se(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var A = (e, t, r) => Oe(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { t as N, bj as Ee, j as f, bk as we, $ as z, b3 as Ie, bl as fe, ab as S, b2 as je, a0 as G, bm as De, aT as Pe, as as ke, aA as de, bn as me, aB as Le, aD as P, aC as He, bo as $e, aR as se, bp as _e, bq as pe, br as oe, bs as Me, aV as Re } from "./ShortcutLinksContext-BU8EEAxv.js";
5
- import E, { useState as C, useCallback as p, useMemo as b, useContext as $, useEffect as D, useRef as he, Component as te } from "react";
6
- import { EventType as W } from "@azure/msal-browser";
1
+ var be = Object.defineProperty;
2
+ var Oe = (e, t, r) => t in e ? be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var S = (e, t, r) => Oe(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { t as N, bj as Ee, j as f, bk as we, $ as z, an as Ie, bl as fe, at as b, ak as je, a0 as G, bm as De, ar as Pe, ap as ke, aV as de, bn as me, aW as Le, aX as P, aq as He, bo as $e, aD as se, bp as _e, bq as pe, br as oe, bs as Me, ao as Re } from "./nivo-bar.es-dpxJHky8.js";
5
+ import E, { useState as C, useCallback as p, useMemo as A, useContext as $, useEffect as D, useRef as he, Component as te } from "react";
6
+ import { EventType as J } from "@azure/msal-browser";
7
7
  import { MsalProvider as Ue } from "@azure/msal-react";
8
8
  import "react-router-dom";
9
9
  import "react-hook-form";
10
10
  import "react-flexmonster";
11
- import { L as Ne } from "./Loading-B4je8S-e.js";
12
- import { a as Fe, u as qe } from "./useLocalStorageState-eavHUAXf.js";
11
+ import { L as Ne } from "./Loading-ClfDUtqs.js";
12
+ import { a as Fe, u as qe } from "./useLocalStorageState-UeBFsOvS.js";
13
13
  function Ge(e) {
14
14
  const t = N(e);
15
15
  return t.setHours(23, 59, 59, 999), t;
@@ -32,9 +32,9 @@ const Be = ({ children: e }) => {
32
32
  r(!0), s(c);
33
33
  }, []), l = p(() => {
34
34
  r(!1);
35
- }, []), a = b(() => ({ show: t, text: n, showConfirm: o, hideConfirm: l }), [t, n, o, l]);
35
+ }, []), a = A(() => ({ show: t, text: n, showConfirm: o, hideConfirm: l }), [t, n, o, l]);
36
36
  return /* @__PURE__ */ f.jsxs(we.Provider, { value: a, children: [
37
- /* @__PURE__ */ f.jsx(At, {}),
37
+ /* @__PURE__ */ f.jsx(St, {}),
38
38
  e
39
39
  ] });
40
40
  }, Ye = () => {
@@ -46,33 +46,33 @@ const Be = ({ children: e }) => {
46
46
  D(() => {
47
47
  t === !0 && l(s.defaultValue ?? "");
48
48
  }, [t, s.defaultValue]);
49
- const i = b(() => ({
49
+ const i = A(() => ({
50
50
  value: o,
51
51
  onChange: (u) => l(u.currentTarget.value),
52
52
  className: "w-100",
53
53
  autoFocus: !0,
54
54
  tabIndex: 0
55
55
  }), [o]);
56
- return /* @__PURE__ */ f.jsxs(S, { show: t, size: "sm", centered: !0, onHide: a, children: [
57
- /* @__PURE__ */ f.jsx(S.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(S.Title, { children: r }) }),
56
+ return /* @__PURE__ */ f.jsxs(b, { show: t, size: "sm", centered: !0, onHide: a, children: [
57
+ /* @__PURE__ */ f.jsx(b.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(b.Title, { children: r }) }),
58
58
  /* @__PURE__ */ f.jsxs("form", { onSubmit: c, children: [
59
- /* @__PURE__ */ f.jsxs(S.Body, { children: [
59
+ /* @__PURE__ */ f.jsxs(b.Body, { children: [
60
60
  s.input === "textarea" ? /* @__PURE__ */ f.jsx("textarea", { ...i, rows: 5 }) : void 0,
61
61
  s.input === "input" ? /* @__PURE__ */ f.jsx(je, { ...i, type: s.type }) : void 0
62
62
  ] }),
63
- /* @__PURE__ */ f.jsxs(S.Footer, { className: "w-100 d-flex gap-5", children: [
63
+ /* @__PURE__ */ f.jsxs(b.Footer, { className: "w-100 d-flex gap-5", children: [
64
64
  /* @__PURE__ */ f.jsx(G, { variant: "outlined", color: "secondary", onClick: a, className: "flex-grow-1", children: e.cancel }),
65
65
  /* @__PURE__ */ f.jsx(G, { color: "primary", disabled: s.required && !o, type: "submit", className: "flex-grow-1", children: e.confirm })
66
66
  ] })
67
67
  ] })
68
68
  ] });
69
- }, Je = ({ children: e }) => {
69
+ }, We = ({ children: e }) => {
70
70
  const [t, r] = C(!1), [n, s] = C(""), [o, l] = C({ input: "textarea", type: "text" }), a = he(() => {
71
71
  }), c = p((d) => {
72
72
  s(d), r(!0);
73
73
  }, []), i = p(() => {
74
74
  r(!1);
75
- }, []), u = b(() => ({
75
+ }, []), u = A(() => ({
76
76
  isShown: t,
77
77
  text: n,
78
78
  showPrompt: c,
@@ -86,7 +86,7 @@ const Be = ({ children: e }) => {
86
86
  /* @__PURE__ */ f.jsx(Ye, {})
87
87
  ] });
88
88
  }, Ht = ({ cookieDomain: e, axiosOptions: t, language: r, texts: n, ProjectIconComponent: s, localizationContext: o, chartColorPalette: l, children: a }) => {
89
- const c = b(() => ({
89
+ const c = A(() => ({
90
90
  axiosOptions: t,
91
91
  cookieDomain: e,
92
92
  language: r,
@@ -103,7 +103,7 @@ const Be = ({ children: e }) => {
103
103
  n,
104
104
  l
105
105
  ]);
106
- return /* @__PURE__ */ f.jsx(z.Provider, { value: c, children: /* @__PURE__ */ f.jsx(Be, { children: /* @__PURE__ */ f.jsxs(Je, { children: [
106
+ return /* @__PURE__ */ f.jsx(z.Provider, { value: c, children: /* @__PURE__ */ f.jsx(Be, { children: /* @__PURE__ */ f.jsxs(We, { children: [
107
107
  /* @__PURE__ */ f.jsx(De, {}),
108
108
  a
109
109
  ] }) }) });
@@ -112,7 +112,7 @@ const Be = ({ children: e }) => {
112
112
  n.add(a), r(!0);
113
113
  }, [n]), o = p((a) => {
114
114
  n.delete(a), n.size === 0 && r(!1);
115
- }, [n]), l = b(() => ({ isLoading: t, startLoading: s, stopLoading: o }), [t, s, o]);
115
+ }, [n]), l = A(() => ({ isLoading: t, startLoading: s, stopLoading: o }), [t, s, o]);
116
116
  return /* @__PURE__ */ f.jsxs(Pe.Provider, { value: l, children: [
117
117
  t && /* @__PURE__ */ f.jsx(Ne, {}),
118
118
  e
@@ -162,7 +162,7 @@ const Be = ({ children: e }) => {
162
162
  D(() => {
163
163
  if (r) {
164
164
  const y = r.addEventCallback((v) => {
165
- if (v.eventType === W.LOGIN_SUCCESS && v.payload) {
165
+ if (v.eventType === J.LOGIN_SUCCESS && v.payload) {
166
166
  const K = v.payload;
167
167
  i(K.accessToken);
168
168
  }
@@ -182,15 +182,15 @@ const Be = ({ children: e }) => {
182
182
  D(() => {
183
183
  ne(c);
184
184
  }, [c, n == null ? void 0 : n.id, ne]);
185
- const Ae = b(() => ({
185
+ const Se = A(() => ({
186
186
  user: m.user,
187
187
  userLoginState: m,
188
188
  loginUser: O,
189
189
  logoutUser: I
190
190
  }), [m, O, I]);
191
- return /* @__PURE__ */ f.jsx(He.Provider, { value: Ae, children: e });
191
+ return /* @__PURE__ */ f.jsx(He.Provider, { value: Se, children: e });
192
192
  }, Mt = ({ ...e }) => {
193
- const { cookieDomain: t } = $(z), [, r] = $e(["Authorization"]), n = b(() => ({
193
+ const { cookieDomain: t } = $(z), [, r] = $e(["Authorization"]), n = A(() => ({
194
194
  useMsal: e.useMsal ?? !1,
195
195
  msalInstance: e.useMsal ? e.msalInstance ?? null : null,
196
196
  msalScopes: e.useMsal ? e.msalScopes ?? [] : [],
@@ -199,7 +199,7 @@ const Be = ({ children: e }) => {
199
199
  return D(() => {
200
200
  if (e.useMsal) {
201
201
  const s = e.msalInstance.addEventCallback((o) => {
202
- if (o.eventType === W.LOGIN_SUCCESS || o.eventType === W.ACQUIRE_TOKEN_SUCCESS && o.payload) {
202
+ if (o.eventType === J.LOGIN_SUCCESS || o.eventType === J.ACQUIRE_TOKEN_SUCCESS && o.payload) {
203
203
  const l = o.payload, a = l.account;
204
204
  e.msalInstance.setActiveAccount(a);
205
205
  const c = l.accessToken, i = l.expiresOn;
@@ -221,7 +221,7 @@ const Be = ({ children: e }) => {
221
221
  };
222
222
  }, [e, r, t]), /* @__PURE__ */ f.jsx(de.Provider, { value: n, children: e.useMsal ? /* @__PURE__ */ f.jsx(Ue, { instance: e.msalInstance, children: e.children }) : e.children });
223
223
  }, Rt = ({ children: e, relativeEndpoint: t }) => {
224
- const [r, n, s] = Fe("user-delegation", null), o = b(() => {
224
+ const [r, n, s] = Fe("user-delegation", null), o = A(() => {
225
225
  if (!r)
226
226
  return null;
227
227
  const d = r.from ? se(r.from) : Ve(), h = r.to ? se(r.to) : ze();
@@ -245,7 +245,7 @@ const Be = ({ children: e }) => {
245
245
  window.removeEventListener("focus", d);
246
246
  };
247
247
  }, [s, c]);
248
- const u = b(() => ({
248
+ const u = A(() => ({
249
249
  delegation: o,
250
250
  setDelegation: n,
251
251
  availableDelegations: l,
@@ -260,7 +260,7 @@ const Be = ({ children: e }) => {
260
260
  ]);
261
261
  return /* @__PURE__ */ f.jsx(me.Provider, { value: u, children: e });
262
262
  };
263
- var We = typeof Element < "u", Ze = typeof Map == "function", Qe = typeof Set == "function", Xe = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
263
+ var Je = typeof Element < "u", Ze = typeof Map == "function", Qe = typeof Set == "function", Xe = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
264
264
  function F(e, t) {
265
265
  if (e === t) return !0;
266
266
  if (e && t && typeof e == "object" && typeof t == "object") {
@@ -299,7 +299,7 @@ function F(e, t) {
299
299
  if (s = Object.keys(e), r = s.length, r !== Object.keys(t).length) return !1;
300
300
  for (n = r; n-- !== 0; )
301
301
  if (!Object.prototype.hasOwnProperty.call(t, s[n])) return !1;
302
- if (We && e instanceof Element) return !1;
302
+ if (Je && e instanceof Element) return !1;
303
303
  for (n = r; n-- !== 0; )
304
304
  if (!((s[n] === "_owner" || s[n] === "__v" || s[n] === "__o") && e.$$typeof) && !F(e[s[n]], t[s[n]]))
305
305
  return !1;
@@ -626,10 +626,10 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
626
626
  };
627
627
  }, Q = gt, U = [], xe = !!(typeof window < "u" && window.document && window.document.createElement), X = class {
628
628
  constructor(e, t) {
629
- A(this, "instances", []);
630
- A(this, "canUseDOM", xe);
631
- A(this, "context");
632
- A(this, "value", {
629
+ S(this, "instances", []);
630
+ S(this, "canUseDOM", xe);
631
+ S(this, "context");
632
+ S(this, "value", {
633
633
  setHelmet: (e) => {
634
634
  this.context.helmet = e;
635
635
  },
@@ -658,16 +658,16 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
658
658
  titleAttributes: {}
659
659
  }));
660
660
  }
661
- }, Tt = {}, Ce = E.createContext(Tt), j, be = (j = class extends te {
661
+ }, Tt = {}, Ce = E.createContext(Tt), j, Ae = (j = class extends te {
662
662
  constructor(r) {
663
663
  super(r);
664
- A(this, "helmetData");
664
+ S(this, "helmetData");
665
665
  this.helmetData = new X(this.props.context || {}, j.canUseDOM);
666
666
  }
667
667
  render() {
668
668
  return /* @__PURE__ */ E.createElement(Ce.Provider, { value: this.helmetData.value }, this.props.children);
669
669
  }
670
- }, A(j, "canUseDOM", xe), j), k = (e, t) => {
670
+ }, S(j, "canUseDOM", xe), j), k = (e, t) => {
671
671
  const r = document.head || document.querySelector(
672
672
  "head"
673
673
  /* HEAD */
@@ -745,7 +745,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
745
745
  }, Ct = xt, ce = class extends te {
746
746
  constructor() {
747
747
  super(...arguments);
748
- A(this, "rendered", !1);
748
+ S(this, "rendered", !1);
749
749
  }
750
750
  shouldComponentUpdate(t) {
751
751
  return !nt(t, this.props);
@@ -766,7 +766,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
766
766
  return delete l.context, l;
767
767
  })
768
768
  );
769
- be.canUseDOM ? Ct(s) : Q && (n = Q(s)), r(n);
769
+ Ae.canUseDOM ? Ct(s) : Q && (n = Q(s)), r(n);
770
770
  }
771
771
  // componentWillMount will be deprecated
772
772
  // for SSR, initialize on first render
@@ -781,7 +781,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
781
781
  render() {
782
782
  return this.init(), null;
783
783
  }
784
- }, J, bt = (J = class extends te {
784
+ }, W, At = (W = class extends te {
785
785
  shouldComponentUpdate(e) {
786
786
  return !tt(ie(this.props, "helmetData"), ie(e, "helmetData"));
787
787
  }
@@ -899,11 +899,11 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
899
899
  }
900
900
  return n ? /* @__PURE__ */ E.createElement(ce, { ...r, context: n.value }) : /* @__PURE__ */ E.createElement(Ce.Consumer, null, (s) => /* @__PURE__ */ E.createElement(ce, { ...r, context: s }));
901
901
  }
902
- }, A(J, "defaultProps", {
902
+ }, S(W, "defaultProps", {
903
903
  defer: !0,
904
904
  encodeSpecialCharacters: !0,
905
905
  prioritizeSeoTags: !1
906
- }), J);
906
+ }), W);
907
907
  const ue = (e, t) => e ? `${e} | ${t}` : t, Ut = ({ defaultHelmet: e, children: t, helmetPrefix: r }) => {
908
908
  const [n, s] = C([
909
909
  ue(r ?? "", e)
@@ -911,16 +911,16 @@ const ue = (e, t) => e ? `${e} | ${t}` : t, Ut = ({ defaultHelmet: e, children:
911
911
  s((u) => [...u, ue(r ?? "", i)]);
912
912
  }, [r]), l = p(() => {
913
913
  s((i) => i.length > 1 ? i.slice(0, -1) : i);
914
- }, [s]), a = b(() => n.at(-1) ?? "", [n]), c = b(() => ({ addHelmet: o, removeHelmet: l }), [o, l]);
915
- return /* @__PURE__ */ f.jsx(Me.Provider, { value: c, children: /* @__PURE__ */ f.jsxs(be, { children: [
916
- /* @__PURE__ */ f.jsx(bt, { defer: !1, children: /* @__PURE__ */ f.jsx("title", { children: a }) }),
914
+ }, [s]), a = A(() => n.at(-1) ?? "", [n]), c = A(() => ({ addHelmet: o, removeHelmet: l }), [o, l]);
915
+ return /* @__PURE__ */ f.jsx(Me.Provider, { value: c, children: /* @__PURE__ */ f.jsxs(Ae, { children: [
916
+ /* @__PURE__ */ f.jsx(At, { defer: !1, children: /* @__PURE__ */ f.jsx("title", { children: a }) }),
917
917
  t
918
918
  ] }) });
919
- }, At = () => {
919
+ }, St = () => {
920
920
  const { texts: { confirm: e } } = $(z), { onConfirm: t, onCancel: r, text: n, show: s } = Re();
921
- return /* @__PURE__ */ f.jsxs(S, { show: s, size: "sm", centered: !0, onHide: r, children: [
922
- /* @__PURE__ */ f.jsx(S.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(S.Title, { children: n }) }),
923
- /* @__PURE__ */ f.jsx(S.Body, { children: /* @__PURE__ */ f.jsxs("div", { className: "w-100 d-flex gap-5", children: [
921
+ return /* @__PURE__ */ f.jsxs(b, { show: s, size: "sm", centered: !0, onHide: r, children: [
922
+ /* @__PURE__ */ f.jsx(b.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(b.Title, { children: n }) }),
923
+ /* @__PURE__ */ f.jsx(b.Body, { children: /* @__PURE__ */ f.jsxs("div", { className: "w-100 d-flex gap-5", children: [
924
924
  /* @__PURE__ */ f.jsx(G, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: r, children: e.no }),
925
925
  /* @__PURE__ */ f.jsx(G, { type: "button", color: "primary", onClick: t, className: "w-100 ml", children: e.yes })
926
926
  ] }) })
package/dist/hooks.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./ShortcutLinksContext-BwGYXGO6.cjs"),P=require("./useWindowSize-CE6DJWzn.cjs"),T=require("./usePermissions-CV4qKyE9.cjs"),d=require("./useClipboard-E93qAl2u.cjs"),k=require("./useLocalStorageState-BPSmbE8f.cjs"),c=require("react");require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const L=r=>{let e="pending",a;const t=r.then(s=>{e="success",a=s},s=>{e="error",a=s});return()=>{switch(e){case"pending":throw t;case"success":return a;case"error":throw a;default:throw new Error("Unknown status")}}};function B(r,e){const a=u.useAxios({silent:!0,differentBaseUrl:e==null?void 0:e.customBaseUrl,customToken:e==null?void 0:e.customToken}),[t,s]=c.useState(null);return c.useEffect(()=>{(async()=>{const n=a.get(r).then(o=>o.data);s(L(n))})()},[a,r]),t}const E=(r,e,a)=>{let t="pending",s;const l=r.then(n=>{t="success",s=n},n=>{const o=n==null?void 0:n.response;(o==null?void 0:o.status)===404&&a?(t="error-404",s=n):(t="error",s=n)});return()=>{switch(t){case"pending":throw l;case"success":return s;case"error":return null;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},i={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},G=(r,{loadOnInit:e=i.loadOnInit,enabled:a=i.enabled,silent:t=i.silent,nullStateBeforeLoad:s=i.nullStateBeforeLoad,nullStateOnFail:l=i.nullStateOnFail,customApiUrl:n,customBearerToken:o,dataTransformer:h,errorBoundaryOn404:S}=i)=>{const g=u.useAxios({silent:t,customToken:o,differentBaseUrl:n,noToastOnStatus:S?[404]:void 0}),{startLoading:w,stopLoading:D}=c.useContext(u.LoadingContext),q=c.useRef(0),{isAuthenticated:C}=u.useAuth(),[b,m]=c.useState(null),p=c.useCallback(async(f,y)=>{if(!C()||a===!1)return;!t&&w(`loadData-${r}-${y}`),s&&m(null);const x=g.get(r,{signal:f}).then(A=>h?h(A.data):A.data).finally(()=>!t&&D(`loadData-${r}-${y}`));m(E(x,l??!1,S??!1))},[C,a,t,w,r,s,g,h,D,l,S]);return c.useEffect(()=>{if(e===!1)return;const f=new AbortController;return p(f.signal,++q.current),()=>{f.abort()}},[p,e]),{data:b,setData:m,reloadData:p}};exports.cancelToken=u.cancelToken;exports.useAuth=u.useAuth;exports.useAxios=u.useAxios;exports.useConfirm=u.useConfirm;exports.useFormControlType=u.useFormControlType;exports.useNotifications=u.useNotifications;exports.usePrompt=u.usePrompt;exports.useZodSchemaTypes=u.useZodSchemaTypes;exports.useClickOutside=P.useClickOutside;exports.useWindowSize=P.useWindowSize;exports.usePermissions=T.usePermissions;exports.useClipboard=d.useClipboard;exports.useEmployeePhotoPath=d.useEmployeePhotoPath;exports.useKeyPress=d.useKeyPress;exports.useSearchQuery=d.useSearchQuery;exports.useSearchQueryState=d.useSearchQueryState;exports.useGetApiData=k.useGetApiData;exports.useLocalStorageState=k.useLocalStorageState;exports.useGetApiDataBound=G;exports.useGetDataBound=B;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./nivo-bar.es-CbxxQBpL.cjs"),P=require("./useWindowSize-CE6DJWzn.cjs"),x=require("./usePermissions-lUbVOzMf.cjs"),d=require("./useClipboard-CZ_hcUoH.cjs"),q=require("./useLocalStorageState-Dk99sIDN.cjs"),c=require("react");require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const B=r=>{let e="pending",a;const t=r.then(s=>{e="success",a=s},s=>{e="error",a=s});return()=>{switch(e){case"pending":throw t;case"success":return a;case"error":throw a;default:throw new Error("Unknown status")}}};function L(r,e){const a=u.useAxios({silent:!0,differentBaseUrl:e==null?void 0:e.customBaseUrl,customToken:e==null?void 0:e.customToken}),[t,s]=c.useState(null);return c.useEffect(()=>{(async()=>{const n=a.get(r).then(o=>o.data);s(B(n))})()},[a,r]),t}const E=(r,e,a)=>{let t="pending",s;const l=r.then(n=>{t="success",s=n},n=>{const o=n==null?void 0:n.response;(o==null?void 0:o.status)===404&&a?(t="error-404",s=n):(t="error",s=n)});return()=>{switch(t){case"pending":throw l;case"success":return s;case"error":return null;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},i={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},G=(r,{loadOnInit:e=i.loadOnInit,enabled:a=i.enabled,silent:t=i.silent,nullStateBeforeLoad:s=i.nullStateBeforeLoad,nullStateOnFail:l=i.nullStateOnFail,customApiUrl:n,customBearerToken:o,dataTransformer:h,errorBoundaryOn404:S}=i)=>{const g=u.useAxios({silent:t,customToken:o,differentBaseUrl:n,noToastOnStatus:S?[404]:void 0}),{startLoading:w,stopLoading:D}=c.useContext(u.LoadingContext),b=c.useRef(0),{isAuthenticated:y}=u.useAuth(),[k,m]=c.useState(null),p=c.useCallback(async(f,C)=>{if(!y()||a===!1)return;!t&&w(`loadData-${r}-${C}`),s&&m(null);const T=g.get(r,{signal:f}).then(A=>h?h(A.data):A.data).finally(()=>!t&&D(`loadData-${r}-${C}`));m(E(T,l??!1,S??!1))},[y,a,t,w,r,s,g,h,D,l,S]);return c.useEffect(()=>{if(e===!1)return;const f=new AbortController;return p(f.signal,++b.current),()=>{f.abort()}},[p,e]),{data:k,setData:m,reloadData:p}};exports.cancelToken=u.cancelToken;exports.useAuth=u.useAuth;exports.useAxios=u.useAxios;exports.useConfirm=u.useConfirm;exports.useFormControlType=u.useFormControlType;exports.useNotifications=u.useNotifications;exports.usePrompt=u.usePrompt;exports.useZodSchemaTypes=u.useZodSchemaTypes;exports.useClickOutside=P.useClickOutside;exports.useWindowSize=P.useWindowSize;exports.usePermissions=x.usePermissions;exports.useClipboard=d.useClipboard;exports.useEmployeePhotoPath=d.useEmployeePhotoPath;exports.useKeyPress=d.useKeyPress;exports.useSearchQuery=d.useSearchQuery;exports.useSearchQueryState=d.useSearchQueryState;exports.useGetApiData=q.useGetApiData;exports.useLocalStorageState=q.useLocalStorageState;exports.useGetApiDataBound=G;exports.useGetDataBound=L;