@australiangreens/ag-internal-components 0.1.25 → 0.2.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.
- package/README.md +20 -7
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/AgDialog/AgDialog.d.ts.map +1 -1
- package/dist/components/FetchAutocomplete/FetchAutocomplete.d.ts.map +1 -1
- package/dist/components/NavBar/NavBarContext.d.ts.map +1 -1
- package/dist/components/SessionExpiryDialog/index.d.ts.map +1 -1
- package/dist/components/SingleAutocomplete/index.d.ts.map +1 -1
- package/dist/domainCode/DomainCodeDialog.d.ts.map +1 -1
- package/dist/esm/index.js +252 -247
- package/dist/esm/index.js.map +1 -1
- package/dist/layouts/AppLayout/AppLayout.d.ts.map +1 -1
- package/dist/layouts/AppLayout/NavBar/Styling.d.ts +1 -1
- package/dist/layouts/AppLayout/NavBar/Styling.d.ts.map +1 -1
- package/dist/testHelpers/testBuilders.d.ts.map +1 -1
- package/dist/testing/wrappers.d.ts.map +1 -1
- package/dist/utils/{determineUserLevel.d.ts → auth.d.ts} +2 -1
- package/dist/utils/auth.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +52 -51
- package/dist/utils/determineUserLevel.d.ts.map +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var rt = Object.defineProperty, at = Object.defineProperties;
|
|
2
|
+
var st = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var G = Object.getOwnPropertySymbols;
|
|
4
4
|
var ue = Object.prototype.hasOwnProperty, pe = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var j = (e, t, o) => t in e ?
|
|
5
|
+
var j = (e, t, o) => t in e ? rt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, d = (e, t) => {
|
|
6
6
|
for (var o in t || (t = {}))
|
|
7
7
|
ue.call(t, o) && j(e, o, t[o]);
|
|
8
8
|
if (G)
|
|
9
9
|
for (var o of G(t))
|
|
10
10
|
pe.call(t, o) && j(e, o, t[o]);
|
|
11
11
|
return e;
|
|
12
|
-
}, D = (e, t) =>
|
|
12
|
+
}, D = (e, t) => at(e, st(t));
|
|
13
13
|
var he = (e, t) => {
|
|
14
14
|
var o = {};
|
|
15
15
|
for (var i in e)
|
|
@@ -36,27 +36,28 @@ var N = (e, t, o) => new Promise((i, r) => {
|
|
|
36
36
|
}, s = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(a, c);
|
|
37
37
|
s((o = o.apply(e, t)).next());
|
|
38
38
|
});
|
|
39
|
-
import { jsxs as m, Fragment as
|
|
40
|
-
import { useState as
|
|
41
|
-
import { Typography as _, Button as W, Paper as
|
|
42
|
-
import
|
|
43
|
-
import { styled as z, createTheme as
|
|
39
|
+
import { jsxs as m, Fragment as T, jsx as n } from "react/jsx-runtime";
|
|
40
|
+
import { useState as L, createContext as Me, useCallback as K, useContext as Te, createElement as oe, useEffect as ne, useMemo as lt, useRef as ee } from "react";
|
|
41
|
+
import { Typography as _, Button as W, Paper as Le, Box as E, Drawer as Be, useTheme as J, useMediaQuery as ct, Collapse as dt, Avatar as me, Fade as ut, Skeleton as ge, Toolbar as pt, Divider as xe, Container as ht, IconButton as ft, Dialog as Pe, LinearProgress as Re, DialogTitle as Oe, DialogContent as He, DialogActions as Ue, Autocomplete as ie, TextField as re, CircularProgress as ae, Chip as mt, Tooltip as gt, Stack as xt, Snackbar as vt, Alert as Ct, FormHelperText as At } from "@mui/material";
|
|
42
|
+
import We from "@mui/material/CssBaseline";
|
|
43
|
+
import { styled as z, createTheme as ze, alpha as te } from "@mui/material/styles";
|
|
44
44
|
import { createHelper as se } from "souvlaki";
|
|
45
45
|
import { BrowserRouter as wt } from "react-router-dom";
|
|
46
|
-
import
|
|
46
|
+
import Ve from "@mui/material/List";
|
|
47
47
|
import { ViewHeadline as St, Cancel as bt, ArrowDropDown as kt } from "@mui/icons-material";
|
|
48
|
-
import { atom as M, useSetAtom as
|
|
48
|
+
import { atom as M, useSetAtom as qe, useAtomValue as ve, useAtom as O } from "jotai";
|
|
49
|
+
import Ce from "@mui/material/Box";
|
|
49
50
|
import { useHydrateAtoms as yt } from "jotai/utils";
|
|
50
|
-
import
|
|
51
|
+
import Ae from "react-avatar";
|
|
51
52
|
import { useAuth0 as le } from "@auth0/auth0-react";
|
|
52
|
-
import { useQuery as
|
|
53
|
+
import { useQuery as Ge } from "@tanstack/react-query";
|
|
53
54
|
import Dt from "autosuggest-highlight/match";
|
|
54
55
|
import It from "autosuggest-highlight/parse";
|
|
55
56
|
import { Buffer as $t } from "buffer";
|
|
56
57
|
import Ft from "@mui/material/Skeleton";
|
|
57
|
-
function
|
|
58
|
-
const [t, o] =
|
|
59
|
-
return /* @__PURE__ */ m(
|
|
58
|
+
function Wo({ text: e }) {
|
|
59
|
+
const [t, o] = L(0);
|
|
60
|
+
return /* @__PURE__ */ m(T, { children: [
|
|
60
61
|
/* @__PURE__ */ n(_, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
|
|
61
62
|
/* @__PURE__ */ n(_, { variant: "caption", display: "block", children: /* @__PURE__ */ n("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
|
|
62
63
|
/* @__PURE__ */ n(
|
|
@@ -72,21 +73,21 @@ function Uo({ text: e }) {
|
|
|
72
73
|
"This is some text: ",
|
|
73
74
|
/* @__PURE__ */ n("span", { children: e })
|
|
74
75
|
] }),
|
|
75
|
-
/* @__PURE__ */ m(
|
|
76
|
+
/* @__PURE__ */ m(Le, { children: [
|
|
76
77
|
"This number will incremember when button pressed: ",
|
|
77
78
|
t
|
|
78
79
|
] })
|
|
79
80
|
] });
|
|
80
81
|
}
|
|
81
|
-
const
|
|
82
|
-
root: `${
|
|
83
|
-
menuButton: `${
|
|
84
|
-
hide: `${
|
|
85
|
-
content: `${
|
|
86
|
-
userInfoHolder: `${
|
|
87
|
-
settings: `${
|
|
88
|
-
pieChartIcon: `${
|
|
89
|
-
}, Et = z(
|
|
82
|
+
const Xe = 330, Ye = 73, B = "Navbar", H = {
|
|
83
|
+
root: `${B}-root`,
|
|
84
|
+
menuButton: `${B}-menuButton`,
|
|
85
|
+
hide: `${B}-hide`,
|
|
86
|
+
content: `${B}-content`,
|
|
87
|
+
userInfoHolder: `${B}-userInfoHolder`,
|
|
88
|
+
settings: `${B}-settings`,
|
|
89
|
+
pieChartIcon: `${B}-pieChartIcon`
|
|
90
|
+
}, Et = z(E, {
|
|
90
91
|
name: "NavBar"
|
|
91
92
|
})(({ theme: e }) => ({
|
|
92
93
|
[`&.${H.root}`]: {
|
|
@@ -107,7 +108,7 @@ const qe = 330, Ge = 73, L = "Navbar", H = {
|
|
|
107
108
|
marginTop: "64px",
|
|
108
109
|
marginBottom: "16px"
|
|
109
110
|
}
|
|
110
|
-
})),
|
|
111
|
+
})), Ke = () => ({
|
|
111
112
|
position: "absolute",
|
|
112
113
|
height: "100%",
|
|
113
114
|
overflowX: "hidden",
|
|
@@ -116,13 +117,13 @@ const qe = 330, Ge = 73, L = "Navbar", H = {
|
|
|
116
117
|
backgroundColor: "black"
|
|
117
118
|
// backgroundColor: '#e8e8e8',
|
|
118
119
|
}), Nt = () => d({
|
|
119
|
-
width:
|
|
120
|
-
},
|
|
121
|
-
width:
|
|
122
|
-
},
|
|
120
|
+
width: Xe
|
|
121
|
+
}, Ke()), _t = () => d({
|
|
122
|
+
width: Ye
|
|
123
|
+
}, Ke()), Mt = z(Be, {
|
|
123
124
|
shouldForwardProp: (e) => e !== "open"
|
|
124
125
|
})(({ theme: e, open: t }) => d(d({
|
|
125
|
-
width: t ?
|
|
126
|
+
width: t ? Xe : Ye,
|
|
126
127
|
flexShrink: 0,
|
|
127
128
|
whiteSpace: "nowrap",
|
|
128
129
|
boxSizing: "border-box",
|
|
@@ -135,12 +136,12 @@ const qe = 330, Ge = 73, L = "Navbar", H = {
|
|
|
135
136
|
class ce extends Error {
|
|
136
137
|
}
|
|
137
138
|
fe(ce, "errorName", "ContextError");
|
|
138
|
-
const
|
|
139
|
+
const Qe = Me(null), Tt = {}, Lt = {}, Bt = ({
|
|
139
140
|
overrideState: e = Tt,
|
|
140
141
|
overrideActions: t = Lt,
|
|
141
142
|
children: o
|
|
142
143
|
}) => {
|
|
143
|
-
const [{ open: i }, r] =
|
|
144
|
+
const [{ open: i }, r] = L({ open: !0 }), a = K((l) => {
|
|
144
145
|
r({ open: l });
|
|
145
146
|
}, []), c = K(() => {
|
|
146
147
|
r((l) => D(d({}, l), { open: !l.open }));
|
|
@@ -149,17 +150,17 @@ const Ye = _e(null), Tt = {}, Lt = {}, Bt = ({
|
|
|
149
150
|
setOpen: a,
|
|
150
151
|
toggleOpen: c
|
|
151
152
|
}, e), t);
|
|
152
|
-
return /* @__PURE__ */ n(
|
|
153
|
+
return /* @__PURE__ */ n(Qe.Provider, { value: s, children: o });
|
|
153
154
|
}, Pt = () => {
|
|
154
|
-
const e =
|
|
155
|
+
const e = Te(Qe);
|
|
155
156
|
if (e === null)
|
|
156
157
|
throw new ce("Error: Tried to useNavBar outside of a <NavBarProvider>");
|
|
157
158
|
return e;
|
|
158
159
|
}, Rt = (e = {}) => d({
|
|
159
160
|
open: !0
|
|
160
|
-
}, e),
|
|
161
|
+
}, e), zo = se(
|
|
161
162
|
(e = Rt(), t = {}) => ({ children: o }) => /* @__PURE__ */ n(Bt, { overrideState: e, overrideActions: t, children: o })
|
|
162
|
-
),
|
|
163
|
+
), Vo = se(() => ({ children: e }) => /* @__PURE__ */ n(wt, { children: e })), we = 7, qo = z(Ve)(({ theme: e }) => ({
|
|
163
164
|
backgroundColor: "black",
|
|
164
165
|
color: "white",
|
|
165
166
|
"& .MuiListItem-root": {
|
|
@@ -168,7 +169,7 @@ const Ye = _e(null), Tt = {}, Lt = {}, Bt = ({
|
|
|
168
169
|
"& .MuiListItemButton-root": {
|
|
169
170
|
" .MuiListItemIcon-root": {
|
|
170
171
|
color: "white",
|
|
171
|
-
padding: `${
|
|
172
|
+
padding: `${we}px`
|
|
172
173
|
},
|
|
173
174
|
// Focus state
|
|
174
175
|
"&.Mui-focusVisible": {
|
|
@@ -179,7 +180,7 @@ const Ye = _e(null), Tt = {}, Lt = {}, Bt = ({
|
|
|
179
180
|
borderLeftStyle: "solid",
|
|
180
181
|
borderLeftWidth: "7px",
|
|
181
182
|
borderLeftColor: e.palette.primary.main,
|
|
182
|
-
paddingLeft: `calc(${e.spacing(2)} - ${
|
|
183
|
+
paddingLeft: `calc(${e.spacing(2)} - ${we}px)`
|
|
183
184
|
},
|
|
184
185
|
// Hover state
|
|
185
186
|
"&:hover": {
|
|
@@ -197,7 +198,7 @@ const Ye = _e(null), Tt = {}, Lt = {}, Bt = ({
|
|
|
197
198
|
// '&.Mui-selected.Mui-focusVisible:hover': {
|
|
198
199
|
// },
|
|
199
200
|
}
|
|
200
|
-
})),
|
|
201
|
+
})), Se = 7, Go = z(Ve)(({ theme: e }) => ({
|
|
201
202
|
backgroundColor: "#e8e8e8",
|
|
202
203
|
color: "inherit",
|
|
203
204
|
"& .MuiListItem-root": {
|
|
@@ -206,7 +207,7 @@ const Ye = _e(null), Tt = {}, Lt = {}, Bt = ({
|
|
|
206
207
|
"& .MuiListItemButton-root": {
|
|
207
208
|
" .MuiListItemIcon-root": {
|
|
208
209
|
color: "inherit",
|
|
209
|
-
padding: `${
|
|
210
|
+
padding: `${Se}px`
|
|
210
211
|
},
|
|
211
212
|
// Focus state
|
|
212
213
|
"&.Mui-focusVisible": {
|
|
@@ -217,7 +218,7 @@ const Ye = _e(null), Tt = {}, Lt = {}, Bt = ({
|
|
|
217
218
|
borderLeftStyle: "solid",
|
|
218
219
|
borderLeftWidth: "7px",
|
|
219
220
|
borderLeftColor: e.palette.primary.main,
|
|
220
|
-
paddingLeft: `calc(${e.spacing(2)} - ${
|
|
221
|
+
paddingLeft: `calc(${e.spacing(2)} - ${Se}px)`
|
|
221
222
|
},
|
|
222
223
|
// Hover state
|
|
223
224
|
"&:hover": {
|
|
@@ -236,13 +237,13 @@ const Ye = _e(null), Tt = {}, Lt = {}, Bt = ({
|
|
|
236
237
|
// },
|
|
237
238
|
}
|
|
238
239
|
}));
|
|
239
|
-
function
|
|
240
|
+
function Xo({
|
|
240
241
|
"data-testid": e,
|
|
241
242
|
children: t
|
|
242
243
|
}) {
|
|
243
244
|
const { open: o } = Pt();
|
|
244
245
|
return /* @__PURE__ */ m(Et, { className: H.root, "data-testid": e, children: [
|
|
245
|
-
/* @__PURE__ */ n(
|
|
246
|
+
/* @__PURE__ */ n(We, {}),
|
|
246
247
|
/* @__PURE__ */ n(
|
|
247
248
|
Mt,
|
|
248
249
|
{
|
|
@@ -255,10 +256,10 @@ function Go({
|
|
|
255
256
|
)
|
|
256
257
|
] });
|
|
257
258
|
}
|
|
258
|
-
const
|
|
259
|
+
const Je = () => {
|
|
259
260
|
const e = J();
|
|
260
|
-
return
|
|
261
|
-
}, Ot = 64, Ht = 72, Ut = 256, Q = M(!0), Wt = M(Ut), zt = M(Ht),
|
|
261
|
+
return ct(e.breakpoints.down("sm"));
|
|
262
|
+
}, Ot = 64, Ht = 72, Ut = 256, Q = M(!0), Wt = M(Ut), zt = M(Ht), be = M(""), Vt = M(void 0), qt = M(Ot), Gt = M(void 0);
|
|
262
263
|
function Xt({ links: e }) {
|
|
263
264
|
return /* @__PURE__ */ n("div", { children: "LinksMenu not implemented yet" });
|
|
264
265
|
}
|
|
@@ -270,7 +271,7 @@ const X = "Navbar", q = {
|
|
|
270
271
|
// userInfoHolder: `${PREFIX}-userInfoHolder`,
|
|
271
272
|
// settings: `${PREFIX}-settings`,
|
|
272
273
|
// pieChartIcon: `${PREFIX}-pieChartIcon`,
|
|
273
|
-
}, Yt = z(
|
|
274
|
+
}, Yt = z(E, { name: "NavBar" })(({ theme: e }) => ({
|
|
274
275
|
[`&.${q.root}`]: {
|
|
275
276
|
display: "flex"
|
|
276
277
|
},
|
|
@@ -295,7 +296,7 @@ const X = "Navbar", q = {
|
|
|
295
296
|
}), Kt = (e) => {
|
|
296
297
|
const t = J();
|
|
297
298
|
return /* @__PURE__ */ n(
|
|
298
|
-
|
|
299
|
+
dt,
|
|
299
300
|
d({
|
|
300
301
|
easing: t.transitions.easing.sharp,
|
|
301
302
|
timeout: {
|
|
@@ -304,7 +305,7 @@ const X = "Navbar", q = {
|
|
|
304
305
|
}
|
|
305
306
|
}, e)
|
|
306
307
|
);
|
|
307
|
-
},
|
|
308
|
+
}, Ze = (e) => {
|
|
308
309
|
var t, o;
|
|
309
310
|
return {
|
|
310
311
|
overflowX: "hidden",
|
|
@@ -312,13 +313,13 @@ const X = "Navbar", q = {
|
|
|
312
313
|
backgroundColor: (o = (t = e == null ? void 0 : e.navBar) == null ? void 0 : t.backgroundColor) != null ? o : "white"
|
|
313
314
|
// Provide default so tests don't need to wrap theme provider
|
|
314
315
|
};
|
|
315
|
-
},
|
|
316
|
+
}, ke = (e, t) => d({
|
|
316
317
|
width: t,
|
|
317
318
|
transition: U(e, "width", "entering")
|
|
318
|
-
},
|
|
319
|
+
}, Ze(e)), ye = (e, t) => d({
|
|
319
320
|
width: t,
|
|
320
321
|
transition: U(e, "width", "leaving")
|
|
321
|
-
},
|
|
322
|
+
}, Ze(e)), Qt = z(Be, {
|
|
322
323
|
shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
|
|
323
324
|
})(({ theme: e, open: t, widthOpen: o, widthClosed: i, isSmallScreen: r }) => d(d({
|
|
324
325
|
flexShrink: 0,
|
|
@@ -326,46 +327,20 @@ const X = "Navbar", q = {
|
|
|
326
327
|
boxSizing: "border-box",
|
|
327
328
|
display: "flex",
|
|
328
329
|
flexDirection: "column"
|
|
329
|
-
}, t && D(d({},
|
|
330
|
+
}, t && D(d({}, ke(e, o)), {
|
|
330
331
|
backgroundColor: "",
|
|
331
|
-
"& .MuiDrawer-paper":
|
|
332
|
-
})), !t && D(d({},
|
|
332
|
+
"& .MuiDrawer-paper": ke(e, o)
|
|
333
|
+
})), !t && D(d({}, ye(e, r ? o : i)), {
|
|
333
334
|
backgroundColor: "",
|
|
334
|
-
"& .MuiDrawer-paper":
|
|
335
|
-
})))
|
|
336
|
-
|
|
337
|
-
error: console.error.bind(console),
|
|
338
|
-
warn: console.warn.bind(console),
|
|
339
|
-
info: console.info.bind(console),
|
|
340
|
-
debug: console.debug.bind(console)
|
|
341
|
-
};
|
|
342
|
-
function Xo(e, t) {
|
|
343
|
-
console[e] = (...o) => {
|
|
344
|
-
for (const i of t)
|
|
345
|
-
if (typeof i == "function") {
|
|
346
|
-
if (i(...o)) return;
|
|
347
|
-
} else if (i instanceof RegExp && o.length > 0) {
|
|
348
|
-
for (const r of o)
|
|
349
|
-
if (typeof r == "string" && i.test(r))
|
|
350
|
-
return;
|
|
351
|
-
}
|
|
352
|
-
Y[e](o);
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
function Yo(e) {
|
|
356
|
-
if (e)
|
|
357
|
-
console[e] = Y[e];
|
|
358
|
-
else
|
|
359
|
-
for (const t of Object.keys(Y))
|
|
360
|
-
console[t] = Y[t];
|
|
361
|
-
}
|
|
362
|
-
function Je(e) {
|
|
335
|
+
"& .MuiDrawer-paper": ye(e, r ? o : i)
|
|
336
|
+
})));
|
|
337
|
+
function je(e) {
|
|
363
338
|
return e.replace(
|
|
364
339
|
/(^|-)([a-z])/g,
|
|
365
340
|
(t, o, i) => o === "-" ? " " + i.toUpperCase() : i.toUpperCase()
|
|
366
341
|
);
|
|
367
342
|
}
|
|
368
|
-
function
|
|
343
|
+
function Yo(e, t, o, i) {
|
|
369
344
|
var c;
|
|
370
345
|
if (!e) return "None";
|
|
371
346
|
const a = Object.entries(e).filter(
|
|
@@ -373,27 +348,56 @@ function Ko(e, t, o, i) {
|
|
|
373
348
|
).map(
|
|
374
349
|
([s]) => {
|
|
375
350
|
var l;
|
|
376
|
-
return
|
|
351
|
+
return je((l = s.split("/").at(-1)) != null ? l : "");
|
|
377
352
|
}
|
|
378
353
|
);
|
|
379
354
|
return (c = i.find(
|
|
380
355
|
(s) => o[s].some((l) => a.includes(l))
|
|
381
356
|
)) != null ? c : "None";
|
|
382
357
|
}
|
|
383
|
-
const
|
|
358
|
+
const Ko = (e) => {
|
|
384
359
|
const { getIdTokenClaims: t, user: o } = le();
|
|
385
|
-
return
|
|
360
|
+
return Ge({
|
|
386
361
|
queryKey: ["availableDomains", o == null ? void 0 : o.sub],
|
|
387
|
-
queryFn: () => N(
|
|
362
|
+
queryFn: () => N(null, null, function* () {
|
|
388
363
|
const i = yield t();
|
|
389
364
|
return i ? Object.entries(i).reduce((r, [a, c]) => {
|
|
390
365
|
var u;
|
|
391
|
-
const s =
|
|
366
|
+
const s = je((u = a.split("/").at(-1)) != null ? u : ""), l = a.startsWith("https://greens.org.au/roles/") && e.includes(s) ? c : [];
|
|
392
367
|
return [.../* @__PURE__ */ new Set([...r, ...l])];
|
|
393
368
|
}, []) : [];
|
|
394
369
|
})
|
|
395
370
|
});
|
|
371
|
+
}, Qo = (e) => Object.values(e).reduce(
|
|
372
|
+
(t, o) => [.../* @__PURE__ */ new Set([...t, ...o])],
|
|
373
|
+
[]
|
|
374
|
+
), Y = {
|
|
375
|
+
log: console.warn.bind(console),
|
|
376
|
+
error: console.error.bind(console),
|
|
377
|
+
warn: console.warn.bind(console),
|
|
378
|
+
info: console.info.bind(console),
|
|
379
|
+
debug: console.debug.bind(console)
|
|
396
380
|
};
|
|
381
|
+
function Jo(e, t) {
|
|
382
|
+
console[e] = (...o) => {
|
|
383
|
+
for (const i of t)
|
|
384
|
+
if (typeof i == "function") {
|
|
385
|
+
if (i(...o)) return;
|
|
386
|
+
} else if (i instanceof RegExp && o.length > 0) {
|
|
387
|
+
for (const r of o)
|
|
388
|
+
if (typeof r == "string" && i.test(r))
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
Y[e](o);
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
function Zo(e) {
|
|
395
|
+
if (e)
|
|
396
|
+
console[e] = Y[e];
|
|
397
|
+
else
|
|
398
|
+
for (const t of Object.keys(Y))
|
|
399
|
+
console[t] = Y[t];
|
|
400
|
+
}
|
|
397
401
|
function Jt(e) {
|
|
398
402
|
let t = 0;
|
|
399
403
|
for (let o = 0, i = e.length; o < i; o++) {
|
|
@@ -402,11 +406,11 @@ function Jt(e) {
|
|
|
402
406
|
}
|
|
403
407
|
return t;
|
|
404
408
|
}
|
|
405
|
-
const
|
|
409
|
+
const De = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Ie = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
|
|
406
410
|
function Zt({ user: e, domainCode: t, open: o, useNewAvatar: i = !1 }) {
|
|
407
411
|
const r = J();
|
|
408
412
|
return /* @__PURE__ */ m(
|
|
409
|
-
|
|
413
|
+
E,
|
|
410
414
|
{
|
|
411
415
|
sx: {
|
|
412
416
|
paddingTop: 3,
|
|
@@ -417,44 +421,44 @@ function Zt({ user: e, domainCode: t, open: o, useNewAvatar: i = !1 }) {
|
|
|
417
421
|
},
|
|
418
422
|
children: [
|
|
419
423
|
!i && /* @__PURE__ */ n(
|
|
420
|
-
|
|
424
|
+
E,
|
|
421
425
|
{
|
|
422
426
|
sx: {
|
|
423
427
|
width: o ? "5rem" : "2rem",
|
|
424
428
|
transition: o ? U(r, ["width", "height"], "entering") : U(r, ["width", "height"], "leaving"),
|
|
425
429
|
aspectRatio: 1
|
|
426
430
|
},
|
|
427
|
-
children: e != null && e.name ? /* @__PURE__ */ n(
|
|
431
|
+
children: e != null && e.name ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(
|
|
428
432
|
me,
|
|
429
433
|
{
|
|
430
434
|
src: e == null ? void 0 : e.picture,
|
|
431
435
|
sx: {
|
|
432
436
|
width: "100%",
|
|
433
437
|
height: "100%",
|
|
434
|
-
bgcolor:
|
|
438
|
+
bgcolor: De[Math.abs(Jt(e == null ? void 0 : e.name)) % De.length]
|
|
435
439
|
},
|
|
436
|
-
children:
|
|
440
|
+
children: Ie(e == null ? void 0 : e.name)
|
|
437
441
|
}
|
|
438
442
|
) }) : /* @__PURE__ */ n(me, { sx: { width: "100%", height: "100%" } })
|
|
439
443
|
}
|
|
440
444
|
),
|
|
441
445
|
i && /* @__PURE__ */ n(
|
|
442
|
-
|
|
446
|
+
E,
|
|
443
447
|
{
|
|
444
448
|
sx: {
|
|
445
449
|
width: o ? "5rem" : "2rem",
|
|
446
450
|
transition: o ? U(r, ["width", "height"], "entering") : U(r, ["width", "height"], "leaving"),
|
|
447
451
|
aspectRatio: 1
|
|
448
452
|
},
|
|
449
|
-
children: e != null && e.name ? /* @__PURE__ */ n(
|
|
453
|
+
children: e != null && e.name ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ m(Ae, { src: e == null ? void 0 : e.picture, name: e == null ? void 0 : e.name, round: !0, size: o ? "80" : "32", children: [
|
|
450
454
|
" ",
|
|
451
|
-
|
|
455
|
+
Ie(e == null ? void 0 : e.name),
|
|
452
456
|
" ",
|
|
453
457
|
"ab"
|
|
454
|
-
] }) }) : /* @__PURE__ */ n(
|
|
458
|
+
] }) }) : /* @__PURE__ */ n(Ae, {})
|
|
455
459
|
}
|
|
456
460
|
),
|
|
457
|
-
/* @__PURE__ */ n(Kt, { sx: { width: "100%" }, in: o, children: /* @__PURE__ */ n(
|
|
461
|
+
/* @__PURE__ */ n(Kt, { sx: { width: "100%" }, in: o, children: /* @__PURE__ */ n(ut, { in: o, children: /* @__PURE__ */ m(E, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
|
|
458
462
|
e != null && e.name ? /* @__PURE__ */ n(_, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ n(ge, { animation: !1, width: "50%" }),
|
|
459
463
|
t ? /* @__PURE__ */ n(_, { children: t.toUpperCase() }) : /* @__PURE__ */ n(ge, { animation: !1, width: "25%" })
|
|
460
464
|
] }) }) })
|
|
@@ -474,7 +478,7 @@ function jt({
|
|
|
474
478
|
domainCode: l,
|
|
475
479
|
useNewAvatar: u = !1
|
|
476
480
|
}) {
|
|
477
|
-
const g =
|
|
481
|
+
const g = Je(), S = qe(Q);
|
|
478
482
|
return /* @__PURE__ */ n(Yt, { className: q.root, "data-testid": i, children: /* @__PURE__ */ m(
|
|
479
483
|
Qt,
|
|
480
484
|
{
|
|
@@ -491,16 +495,16 @@ function jt({
|
|
|
491
495
|
},
|
|
492
496
|
isSmallScreen: g,
|
|
493
497
|
children: [
|
|
494
|
-
!g && /* @__PURE__ */ n(
|
|
495
|
-
r && /* @__PURE__ */ m(
|
|
498
|
+
!g && /* @__PURE__ */ n(pt, {}),
|
|
499
|
+
r && /* @__PURE__ */ m(E, { flexGrow: "0", children: [
|
|
496
500
|
r,
|
|
497
501
|
/* @__PURE__ */ n(xe, { variant: "middle", sx: { marginY: "0.5rem" } })
|
|
498
502
|
] }),
|
|
499
|
-
/* @__PURE__ */ n(
|
|
500
|
-
/* @__PURE__ */ m(
|
|
503
|
+
/* @__PURE__ */ n(E, { flexGrow: "1", children: Array.isArray(a) ? /* @__PURE__ */ n(Xt, { links: a }) : a }),
|
|
504
|
+
/* @__PURE__ */ m(E, { flexGrow: "0", children: [
|
|
501
505
|
/* @__PURE__ */ n(xe, { variant: "middle", sx: { marginY: "0.5rem" } }),
|
|
502
506
|
/* @__PURE__ */ n(Zt, { user: s, domainCode: l, open: e, useNewAvatar: u }),
|
|
503
|
-
c && /* @__PURE__ */ n(
|
|
507
|
+
c && /* @__PURE__ */ n(T, { children: c })
|
|
504
508
|
] })
|
|
505
509
|
]
|
|
506
510
|
}
|
|
@@ -513,15 +517,15 @@ function eo({
|
|
|
513
517
|
noPadding: i
|
|
514
518
|
}) {
|
|
515
519
|
return /* @__PURE__ */ n(
|
|
516
|
-
|
|
520
|
+
E,
|
|
517
521
|
{
|
|
518
522
|
sx: {
|
|
519
523
|
overflow: "auto",
|
|
520
524
|
height: `calc(100vh - ${t}px)`,
|
|
521
525
|
flexGrow: 1
|
|
522
526
|
},
|
|
523
|
-
children: i ? /* @__PURE__ */ n(
|
|
524
|
-
|
|
527
|
+
children: i ? /* @__PURE__ */ n(E, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ n(
|
|
528
|
+
ht,
|
|
525
529
|
{
|
|
526
530
|
component: "main",
|
|
527
531
|
id: "main-content",
|
|
@@ -542,9 +546,9 @@ function no({
|
|
|
542
546
|
"data-testid": o,
|
|
543
547
|
middle: i
|
|
544
548
|
}) {
|
|
545
|
-
const r =
|
|
549
|
+
const r = qe(Q), a = () => r((l) => !l), c = J(), s = Je();
|
|
546
550
|
return /* @__PURE__ */ n("header", { "data-testid": o, children: /* @__PURE__ */ m(
|
|
547
|
-
|
|
551
|
+
Le,
|
|
548
552
|
{
|
|
549
553
|
square: !0,
|
|
550
554
|
elevation: 0,
|
|
@@ -562,7 +566,7 @@ function no({
|
|
|
562
566
|
},
|
|
563
567
|
children: [
|
|
564
568
|
/* @__PURE__ */ n(
|
|
565
|
-
|
|
569
|
+
ft,
|
|
566
570
|
{
|
|
567
571
|
size: "medium",
|
|
568
572
|
color: "inherit",
|
|
@@ -577,7 +581,7 @@ function no({
|
|
|
577
581
|
}
|
|
578
582
|
) });
|
|
579
583
|
}
|
|
580
|
-
function
|
|
584
|
+
function jo({
|
|
581
585
|
children: e,
|
|
582
586
|
initialTitleText: t,
|
|
583
587
|
initialNavBarOpen: o,
|
|
@@ -593,11 +597,11 @@ function Jo({
|
|
|
593
597
|
}) {
|
|
594
598
|
yt([
|
|
595
599
|
[Q, o != null ? o : !0],
|
|
596
|
-
[
|
|
600
|
+
[be, t != null ? t : ""]
|
|
597
601
|
]);
|
|
598
|
-
const A =
|
|
599
|
-
return /* @__PURE__ */ m(
|
|
600
|
-
/* @__PURE__ */ n(
|
|
602
|
+
const A = ve(Q), [f] = O(Wt), [b] = O(zt), y = ve(be), [p] = O(qt), [k] = O(Vt), [I] = O(Gt);
|
|
603
|
+
return /* @__PURE__ */ m(Ce, { children: [
|
|
604
|
+
/* @__PURE__ */ n(We, {}),
|
|
601
605
|
/* @__PURE__ */ n(
|
|
602
606
|
no,
|
|
603
607
|
{
|
|
@@ -607,7 +611,7 @@ function Jo({
|
|
|
607
611
|
middle: k
|
|
608
612
|
}
|
|
609
613
|
),
|
|
610
|
-
/* @__PURE__ */ m(
|
|
614
|
+
/* @__PURE__ */ m(Ce, { sx: { display: "flex" }, children: [
|
|
611
615
|
/* @__PURE__ */ n(
|
|
612
616
|
jt,
|
|
613
617
|
{
|
|
@@ -636,7 +640,7 @@ function Jo({
|
|
|
636
640
|
] })
|
|
637
641
|
] });
|
|
638
642
|
}
|
|
639
|
-
const
|
|
643
|
+
const et = ({
|
|
640
644
|
isOpen: e,
|
|
641
645
|
dialogTitle: t,
|
|
642
646
|
children: o,
|
|
@@ -651,12 +655,12 @@ const Ze = ({
|
|
|
651
655
|
isLoading: S = !1
|
|
652
656
|
}) => {
|
|
653
657
|
var b, y;
|
|
654
|
-
const [A, f] =
|
|
658
|
+
const [A, f] = L(!1);
|
|
655
659
|
return /* @__PURE__ */ m(
|
|
656
|
-
|
|
660
|
+
Pe,
|
|
657
661
|
{
|
|
658
662
|
open: e,
|
|
659
|
-
onClose: (p, k) => N(
|
|
663
|
+
onClose: (p, k) => N(null, null, function* () {
|
|
660
664
|
g && (k === "backdropClick" || k === "escapeKeyDown") || A || (a != null && a.onClick ? yield a.onClick() : s());
|
|
661
665
|
}),
|
|
662
666
|
fullWidth: !0,
|
|
@@ -664,10 +668,10 @@ const Ze = ({
|
|
|
664
668
|
"data-testid": u,
|
|
665
669
|
sx: l,
|
|
666
670
|
children: [
|
|
667
|
-
S && /* @__PURE__ */ n(
|
|
668
|
-
/* @__PURE__ */ n(
|
|
669
|
-
/* @__PURE__ */ n(
|
|
670
|
-
/* @__PURE__ */ m(
|
|
671
|
+
S && /* @__PURE__ */ n(Re, { sx: { height: "4px", marginBottom: "-4px" } }),
|
|
672
|
+
/* @__PURE__ */ n(Oe, { children: t }),
|
|
673
|
+
/* @__PURE__ */ n(He, { sx: { "& > :last-child": { marginBottom: 0 } }, children: o }),
|
|
674
|
+
/* @__PURE__ */ m(Ue, { children: [
|
|
671
675
|
/* @__PURE__ */ n(
|
|
672
676
|
W,
|
|
673
677
|
{
|
|
@@ -695,7 +699,7 @@ const Ze = ({
|
|
|
695
699
|
r && /* @__PURE__ */ n(
|
|
696
700
|
W,
|
|
697
701
|
{
|
|
698
|
-
onClick: () => N(
|
|
702
|
+
onClick: () => N(null, null, function* () {
|
|
699
703
|
var p;
|
|
700
704
|
f(!0), yield (p = r.onClick) == null ? void 0 : p.call(r), f(!1);
|
|
701
705
|
}),
|
|
@@ -709,20 +713,20 @@ const Ze = ({
|
|
|
709
713
|
]
|
|
710
714
|
}
|
|
711
715
|
);
|
|
712
|
-
},
|
|
716
|
+
}, tt = ({
|
|
713
717
|
minLength: e,
|
|
714
718
|
preLoadedOptions: t,
|
|
715
719
|
lookup: o,
|
|
716
720
|
label: i,
|
|
717
721
|
inputValue: r
|
|
718
|
-
}) =>
|
|
722
|
+
}) => Ge({
|
|
719
723
|
queryFn: () => e && r.length < e ? t != null ? t : [] : t ? t.filter(
|
|
720
724
|
(a) => a.label.toLowerCase().includes(r.toLowerCase())
|
|
721
725
|
) : o(r),
|
|
722
726
|
queryKey: ["autocomplete", i, r]
|
|
723
727
|
});
|
|
724
|
-
function
|
|
725
|
-
lookup: e = () => N(
|
|
728
|
+
function en({
|
|
729
|
+
lookup: e = () => N(null, null, function* () {
|
|
726
730
|
}),
|
|
727
731
|
enableHighlighting: t = !0,
|
|
728
732
|
onChange: o,
|
|
@@ -743,16 +747,16 @@ function Zo({
|
|
|
743
747
|
disablePortal: k = !1,
|
|
744
748
|
disableIconFlip: I = !1
|
|
745
749
|
}) {
|
|
746
|
-
const [
|
|
747
|
-
const
|
|
748
|
-
o(
|
|
749
|
-
}, { data: x, isLoading: $ } =
|
|
750
|
-
inputValue:
|
|
750
|
+
const [F, V] = L(""), P = (h, v) => {
|
|
751
|
+
const C = a.filter((w) => w.id !== v);
|
|
752
|
+
o(C, "delete", h);
|
|
753
|
+
}, { data: x, isLoading: $ } = tt({
|
|
754
|
+
inputValue: F,
|
|
751
755
|
label: r,
|
|
752
756
|
lookup: e,
|
|
753
757
|
minLength: i,
|
|
754
758
|
preLoadedOptions: p
|
|
755
|
-
}), R =
|
|
759
|
+
}), R = F.length >= i;
|
|
756
760
|
return /* @__PURE__ */ m("div", { "data-testid": c, children: [
|
|
757
761
|
/* @__PURE__ */ n(
|
|
758
762
|
ie,
|
|
@@ -767,10 +771,10 @@ function Zo({
|
|
|
767
771
|
filterSelectedOptions: !0,
|
|
768
772
|
includeInputInList: !0,
|
|
769
773
|
value: a,
|
|
770
|
-
onChange: (h,
|
|
771
|
-
o(
|
|
774
|
+
onChange: (h, v, C) => {
|
|
775
|
+
o(v, C, h);
|
|
772
776
|
},
|
|
773
|
-
onInputChange: (h,
|
|
777
|
+
onInputChange: (h, v) => V(v),
|
|
774
778
|
noOptionsText: R ? A : "Start typing to search",
|
|
775
779
|
loadingText: S,
|
|
776
780
|
popupIcon: f,
|
|
@@ -783,33 +787,33 @@ function Zo({
|
|
|
783
787
|
error: b,
|
|
784
788
|
helperText: y,
|
|
785
789
|
InputProps: D(d({}, h.InputProps), {
|
|
786
|
-
endAdornment: /* @__PURE__ */ m(
|
|
790
|
+
endAdornment: /* @__PURE__ */ m(T, { children: [
|
|
787
791
|
$ ? /* @__PURE__ */ n(ae, { color: "inherit", size: 20 }) : null,
|
|
788
792
|
h.InputProps.endAdornment
|
|
789
793
|
] })
|
|
790
794
|
}),
|
|
791
795
|
"data-testid": c ? `${c}:Autocomplete:TextField` : void 0,
|
|
792
|
-
onKeyDown: (
|
|
793
|
-
(
|
|
796
|
+
onKeyDown: (v) => {
|
|
797
|
+
(v.key === "Backspace" || v.key === "Delete") && v.stopPropagation();
|
|
794
798
|
},
|
|
795
799
|
color: u
|
|
796
800
|
})
|
|
797
801
|
),
|
|
798
802
|
renderTags: () => null,
|
|
799
|
-
isOptionEqualToValue: (h,
|
|
800
|
-
renderOption: (h,
|
|
803
|
+
isOptionEqualToValue: (h, v) => h.id === v.id,
|
|
804
|
+
renderOption: (h, v, C) => {
|
|
801
805
|
if (t) {
|
|
802
|
-
const w = Dt(
|
|
806
|
+
const w = Dt(v.label, C.inputValue, {
|
|
803
807
|
insideWords: !0,
|
|
804
808
|
findAllOccurrences: !0
|
|
805
|
-
}), Z = It(
|
|
809
|
+
}), Z = It(v.label, w);
|
|
806
810
|
return /* @__PURE__ */ oe(
|
|
807
811
|
"li",
|
|
808
812
|
D(d({}, h), {
|
|
809
|
-
key:
|
|
810
|
-
"data-testid": c ? `${c}:Autocomplete:option(${
|
|
813
|
+
key: v.id,
|
|
814
|
+
"data-testid": c ? `${c}:Autocomplete:option(${v.id.toString()})` : void 0
|
|
811
815
|
}),
|
|
812
|
-
/* @__PURE__ */ n("div", { children: Z.map((de,
|
|
816
|
+
/* @__PURE__ */ n("div", { children: Z.map((de, it) => /* @__PURE__ */ n(
|
|
813
817
|
"span",
|
|
814
818
|
{
|
|
815
819
|
style: {
|
|
@@ -817,23 +821,23 @@ function Zo({
|
|
|
817
821
|
},
|
|
818
822
|
children: de.text
|
|
819
823
|
},
|
|
820
|
-
|
|
824
|
+
it
|
|
821
825
|
)) })
|
|
822
826
|
);
|
|
823
827
|
} else
|
|
824
828
|
return /* @__PURE__ */ oe(
|
|
825
829
|
"li",
|
|
826
830
|
D(d({}, h), {
|
|
827
|
-
key:
|
|
828
|
-
"data-testid": c ? `${c}:option(${
|
|
831
|
+
key: v.id,
|
|
832
|
+
"data-testid": c ? `${c}:option(${v.id.toString()})` : void 0
|
|
829
833
|
}),
|
|
830
|
-
|
|
834
|
+
v.label
|
|
831
835
|
);
|
|
832
836
|
}
|
|
833
837
|
}
|
|
834
838
|
),
|
|
835
|
-
a.length > 0 && /* @__PURE__ */ n(
|
|
836
|
-
|
|
839
|
+
a.length > 0 && /* @__PURE__ */ n(E, { sx: l, children: a.map((h) => /* @__PURE__ */ n(
|
|
840
|
+
mt,
|
|
837
841
|
{
|
|
838
842
|
sx: {
|
|
839
843
|
marginTop: 1,
|
|
@@ -841,7 +845,7 @@ function Zo({
|
|
|
841
845
|
height: "auto"
|
|
842
846
|
},
|
|
843
847
|
label: /* @__PURE__ */ n(
|
|
844
|
-
|
|
848
|
+
gt,
|
|
845
849
|
{
|
|
846
850
|
title: h.tooltipContent || "",
|
|
847
851
|
placement: "bottom-start",
|
|
@@ -859,7 +863,7 @@ function Zo({
|
|
|
859
863
|
}
|
|
860
864
|
),
|
|
861
865
|
"data-testid": c ? `${c}:Chip(${h.id.toString()})` : void 0,
|
|
862
|
-
onDelete: (
|
|
866
|
+
onDelete: (v) => P(v, h.id),
|
|
863
867
|
deleteIcon: /* @__PURE__ */ n(
|
|
864
868
|
bt,
|
|
865
869
|
{
|
|
@@ -871,8 +875,8 @@ function Zo({
|
|
|
871
875
|
)) })
|
|
872
876
|
] });
|
|
873
877
|
}
|
|
874
|
-
const
|
|
875
|
-
lookup: e = () => N(
|
|
878
|
+
const tn = /MUI: The value provided to.*is invalid/i, on = ({
|
|
879
|
+
lookup: e = () => N(null, null, function* () {
|
|
876
880
|
}),
|
|
877
881
|
onChange: t,
|
|
878
882
|
label: o,
|
|
@@ -891,20 +895,20 @@ const jo = /MUI: The value provided to.*is invalid/i, en = ({
|
|
|
891
895
|
popupIcon: y,
|
|
892
896
|
disableIconFlip: p
|
|
893
897
|
}) => {
|
|
894
|
-
const [k, I] =
|
|
898
|
+
const [k, I] = L(""), { data: F, isLoading: V } = tt({
|
|
895
899
|
inputValue: k,
|
|
896
900
|
label: o,
|
|
897
901
|
lookup: e,
|
|
898
902
|
minLength: g != null ? g : 0,
|
|
899
903
|
preLoadedOptions: A
|
|
900
904
|
}), P = k.length >= g;
|
|
901
|
-
return /* @__PURE__ */ n("div", { "data-testid": l, children: /* @__PURE__ */ n(
|
|
905
|
+
return /* @__PURE__ */ n("div", { "data-testid": l, children: /* @__PURE__ */ n(xt, { direction: "row", spacing: 1, children: /* @__PURE__ */ n(
|
|
902
906
|
ie,
|
|
903
907
|
{
|
|
904
908
|
sx: d(d({}, r), p ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
|
|
905
909
|
"data-testid": l ? `${l}:Autocomplete` : void 0,
|
|
906
910
|
loading: P ? V : !1,
|
|
907
|
-
options:
|
|
911
|
+
options: F != null ? F : [],
|
|
908
912
|
onChange: (x, $, R) => {
|
|
909
913
|
t(x, $, R);
|
|
910
914
|
},
|
|
@@ -954,25 +958,25 @@ const jo = /MUI: The value provided to.*is invalid/i, en = ({
|
|
|
954
958
|
} catch (t) {
|
|
955
959
|
return -1;
|
|
956
960
|
}
|
|
957
|
-
},
|
|
961
|
+
}, nn = ({
|
|
958
962
|
open: e = !1,
|
|
959
963
|
closeHandler: t,
|
|
960
964
|
setAuth0ExpiryTime: o
|
|
961
965
|
}) => {
|
|
962
|
-
const { logout: i, getAccessTokenSilently: r } = le(), [a, c] =
|
|
966
|
+
const { logout: i, getAccessTokenSilently: r } = le(), [a, c] = L(0), s = () => N(null, null, function* () {
|
|
963
967
|
i({ logoutParams: { returnTo: `${window.location.origin}` } });
|
|
964
|
-
}), l = () => N(
|
|
968
|
+
}), l = () => N(null, null, function* () {
|
|
965
969
|
c(a + 1), t();
|
|
966
970
|
});
|
|
967
971
|
return ne(() => {
|
|
968
|
-
N(
|
|
972
|
+
N(null, null, function* () {
|
|
969
973
|
if (a > 0) {
|
|
970
974
|
const A = yield r({ cacheMode: "off" }), f = io(A) * 1e3;
|
|
971
975
|
o(f);
|
|
972
976
|
}
|
|
973
977
|
});
|
|
974
978
|
}, [a, r, o]), /* @__PURE__ */ n(
|
|
975
|
-
|
|
979
|
+
et,
|
|
976
980
|
{
|
|
977
981
|
isOpen: e,
|
|
978
982
|
primaryButton: {
|
|
@@ -1014,7 +1018,7 @@ function lo(e) {
|
|
|
1014
1018
|
const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
|
|
1015
1019
|
return t === "access_denied" && o.match(/Script.*time.*exceeded/);
|
|
1016
1020
|
}
|
|
1017
|
-
function
|
|
1021
|
+
function rn({
|
|
1018
1022
|
children: e,
|
|
1019
1023
|
appName: t = "the app",
|
|
1020
1024
|
throwErrors: o = "none",
|
|
@@ -1027,7 +1031,7 @@ function on({
|
|
|
1027
1031
|
ne(() => {
|
|
1028
1032
|
s && r(s);
|
|
1029
1033
|
}, [s, r]);
|
|
1030
|
-
const g =
|
|
1034
|
+
const g = lt(
|
|
1031
1035
|
() => ({
|
|
1032
1036
|
appState: {
|
|
1033
1037
|
returnTo: `${window.location.pathname}${window.location.search}`
|
|
@@ -1055,9 +1059,9 @@ function on({
|
|
|
1055
1059
|
const y = localStorage.getItem("auth0_redirect_count");
|
|
1056
1060
|
y ? y && parseInt(y) < 2 && (localStorage.setItem("auth0_redirect_count", String(parseInt(y) + 1)), l(g)) : (localStorage.setItem("auth0_redirect_count", "1"), l(g));
|
|
1057
1061
|
} else if (o === "unknown") throw s;
|
|
1058
|
-
return /* @__PURE__ */ m(
|
|
1059
|
-
/* @__PURE__ */ n(
|
|
1060
|
-
/* @__PURE__ */ m(
|
|
1062
|
+
return /* @__PURE__ */ m(Pe, { open: !0, children: [
|
|
1063
|
+
/* @__PURE__ */ n(Oe, { children: f }),
|
|
1064
|
+
/* @__PURE__ */ m(He, { children: [
|
|
1061
1065
|
/* @__PURE__ */ n(_, { children: b }),
|
|
1062
1066
|
/* @__PURE__ */ n("br", {}),
|
|
1063
1067
|
/* @__PURE__ */ n(_, { variant: "subtitle2", children: "Details from Auth0" }),
|
|
@@ -1070,14 +1074,14 @@ function on({
|
|
|
1070
1074
|
(A = s == null ? void 0 : s.error_description) != null ? A : "N/A"
|
|
1071
1075
|
] })
|
|
1072
1076
|
] }),
|
|
1073
|
-
/* @__PURE__ */ m(
|
|
1077
|
+
/* @__PURE__ */ m(Ue, { children: [
|
|
1074
1078
|
f === "Auth0 script execution time exceeded" && /* @__PURE__ */ n(W, { href: window.location.origin + window.location.pathname, children: "Reload" }),
|
|
1075
1079
|
/* @__PURE__ */ n(W, { onClick: () => u({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" })
|
|
1076
1080
|
] })
|
|
1077
1081
|
] });
|
|
1078
1082
|
} else if (o === "unknown") throw s;
|
|
1079
1083
|
}
|
|
1080
|
-
return a ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */ n(
|
|
1084
|
+
return a ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */ n(T, { children: e })) : /* @__PURE__ */ n(Ft, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
|
|
1081
1085
|
}
|
|
1082
1086
|
const co = {
|
|
1083
1087
|
autoHideDuration: 6e3,
|
|
@@ -1087,19 +1091,19 @@ const co = {
|
|
|
1087
1091
|
disableWindowBlurListener: !1
|
|
1088
1092
|
}, uo = {
|
|
1089
1093
|
shouldClose: (e, t) => t !== "clickaway"
|
|
1090
|
-
},
|
|
1094
|
+
}, $e = {
|
|
1091
1095
|
message: "",
|
|
1092
1096
|
severity: "info",
|
|
1093
1097
|
variant: "standard",
|
|
1094
1098
|
progressIndicator: void 0
|
|
1095
1099
|
// Can use 'circular' or 'linear'
|
|
1096
|
-
},
|
|
1100
|
+
}, Fe = 100, Ee = 2e3, po = 2e3, ho = /* @__PURE__ */ (() => {
|
|
1097
1101
|
let e = 0;
|
|
1098
1102
|
return () => (e += 1, e);
|
|
1099
1103
|
})(), fo = {
|
|
1100
1104
|
borderBottomLeftRadius: "0px",
|
|
1101
1105
|
borderBottomRightRadius: "0px"
|
|
1102
|
-
}, mo = {}, go = {},
|
|
1106
|
+
}, mo = {}, go = {}, ot = Me(null);
|
|
1103
1107
|
function xo(a) {
|
|
1104
1108
|
var c = a, {
|
|
1105
1109
|
overrideState: e = mo,
|
|
@@ -1112,27 +1116,27 @@ function xo(a) {
|
|
|
1112
1116
|
"shouldClose",
|
|
1113
1117
|
"children"
|
|
1114
1118
|
]);
|
|
1115
|
-
var
|
|
1116
|
-
const [{ open: s }, l] =
|
|
1117
|
-
l({ open:
|
|
1118
|
-
}, []), f = K((
|
|
1119
|
-
S.current += 1, u.current.length >=
|
|
1120
|
-
`SaladBarProvider: MAX_QUEUE_LENGTH (${
|
|
1119
|
+
var v;
|
|
1120
|
+
const [{ open: s }, l] = L({ open: !1 }), u = ee([]), g = ee(Date.now()), S = ee(0), A = K((C) => {
|
|
1121
|
+
l({ open: C });
|
|
1122
|
+
}, []), f = K((C = {}) => {
|
|
1123
|
+
S.current += 1, u.current.length >= Fe && Date.now() - g.current >= Ee && (g.current = Date.now(), console.error(
|
|
1124
|
+
`SaladBarProvider: MAX_QUEUE_LENGTH (${Fe}) hit ${S.current} times in last ${Ee}ms)`
|
|
1121
1125
|
), S.current = 0);
|
|
1122
|
-
const w = d(D(d({},
|
|
1126
|
+
const w = d(D(d({}, $e), {
|
|
1123
1127
|
key: ho()
|
|
1124
|
-
}),
|
|
1128
|
+
}), C);
|
|
1125
1129
|
return u.current.push(w), u.current.length === 1 && l({ open: !0 }), w.key;
|
|
1126
|
-
}, []), b = (
|
|
1127
|
-
const w = u.current.findIndex((Z) => Z.key ===
|
|
1130
|
+
}, []), b = (C = "", w = {}) => f(d({ message: C, severity: "success" }, w)), y = (C = "", w = {}) => f(d({ message: C, severity: "info" }, w)), p = (C = "", w = {}) => f(d({ message: C, severity: "warning" }, w)), k = (C = "", w = {}) => f(d({ message: C, severity: "error" }, w)), I = (C) => {
|
|
1131
|
+
const w = u.current.findIndex((Z) => Z.key === C);
|
|
1128
1132
|
if (w !== -1)
|
|
1129
1133
|
return w === 0 ? (l({ open: !1 }), u.current[0]) : u.current.splice(w, 1);
|
|
1130
|
-
},
|
|
1131
|
-
o(
|
|
1134
|
+
}, F = (C, w) => {
|
|
1135
|
+
o(C, w) && l({ open: !1 });
|
|
1132
1136
|
}, V = () => {
|
|
1133
1137
|
}, P = () => {
|
|
1134
1138
|
u.current.shift(), u.current.length > 0 && l({ open: !0 });
|
|
1135
|
-
}, x = (
|
|
1139
|
+
}, x = (v = u.current[0]) != null ? v : d({}, $e), $ = {};
|
|
1136
1140
|
"autoHideDuration" in x && ($.autoHideDuration = x.autoHideDuration);
|
|
1137
1141
|
const R = d(d({}, co), r), h = d(d({
|
|
1138
1142
|
open: s,
|
|
@@ -1144,13 +1148,13 @@ function xo(a) {
|
|
|
1144
1148
|
enqueueErrorNotification: k,
|
|
1145
1149
|
removeNotification: I
|
|
1146
1150
|
}, e), t);
|
|
1147
|
-
return /* @__PURE__ */ m(
|
|
1151
|
+
return /* @__PURE__ */ m(ot.Provider, { value: h, children: [
|
|
1148
1152
|
i,
|
|
1149
1153
|
/* @__PURE__ */ n(
|
|
1150
|
-
|
|
1154
|
+
vt,
|
|
1151
1155
|
D(d(d({}, R), $), {
|
|
1152
1156
|
open: s,
|
|
1153
|
-
onClose:
|
|
1157
|
+
onClose: F,
|
|
1154
1158
|
TransitionProps: {
|
|
1155
1159
|
onExited: P,
|
|
1156
1160
|
onExit: V
|
|
@@ -1160,7 +1164,7 @@ function xo(a) {
|
|
|
1160
1164
|
/* @__PURE__ */ n(
|
|
1161
1165
|
Ct,
|
|
1162
1166
|
{
|
|
1163
|
-
onClose: (
|
|
1167
|
+
onClose: (C) => F(C, "closeAlert"),
|
|
1164
1168
|
severity: x.severity,
|
|
1165
1169
|
variant: "filled",
|
|
1166
1170
|
icon: x.progressIndicator === "circular" ? /* @__PURE__ */ n(ae, { size: "1em" }) : void 0,
|
|
@@ -1168,28 +1172,28 @@ function xo(a) {
|
|
|
1168
1172
|
children: x.message
|
|
1169
1173
|
}
|
|
1170
1174
|
),
|
|
1171
|
-
x.progressIndicator === "linear" && /* @__PURE__ */ n(
|
|
1175
|
+
x.progressIndicator === "linear" && /* @__PURE__ */ n(Re, { color: "primary" })
|
|
1172
1176
|
] })
|
|
1173
1177
|
})
|
|
1174
1178
|
)
|
|
1175
1179
|
] });
|
|
1176
1180
|
}
|
|
1177
|
-
function
|
|
1178
|
-
const e =
|
|
1181
|
+
function vo() {
|
|
1182
|
+
const e = Te(ot);
|
|
1179
1183
|
if (e === null)
|
|
1180
1184
|
throw new ce("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
|
|
1181
1185
|
return e;
|
|
1182
1186
|
}
|
|
1183
|
-
const
|
|
1184
|
-
(e = { autoHideDuration: 1 }, t = {}, o = {}) => ({ children: i }) => /* @__PURE__ */ n(xo, D(d({}, e), { overrideState: t, overrideActions: o, children: i }))
|
|
1185
|
-
),
|
|
1186
|
-
var
|
|
1187
|
-
const
|
|
1188
|
-
JSON.parse((
|
|
1189
|
-
),
|
|
1190
|
-
(e) => e(
|
|
1187
|
+
const an = se(
|
|
1188
|
+
(e = { autoHideDuration: 1 }, t = {}, o = {}) => ({ children: i }) => /* @__PURE__ */ n(xo, D(d({}, e), { overrideState: t, overrideActions: o, children: /* @__PURE__ */ n(T, { children: i }) }))
|
|
1189
|
+
), nt = "domainCode";
|
|
1190
|
+
var _e;
|
|
1191
|
+
const Ne = M(
|
|
1192
|
+
JSON.parse((_e = localStorage.getItem(nt)) != null ? _e : '{"domainCode": ""}').domainCode
|
|
1193
|
+
), Co = M(
|
|
1194
|
+
(e) => e(Ne),
|
|
1191
1195
|
(e, t, o) => {
|
|
1192
|
-
t(
|
|
1196
|
+
t(Ne, o), localStorage.setItem(nt, JSON.stringify({ domainCode: o }));
|
|
1193
1197
|
}
|
|
1194
1198
|
), Ao = {
|
|
1195
1199
|
act: "ACT",
|
|
@@ -1206,7 +1210,7 @@ const Ee = M(
|
|
|
1206
1210
|
}, wo = (e) => {
|
|
1207
1211
|
var t;
|
|
1208
1212
|
return e === null ? "N/A" : (t = Ao[e]) != null ? t : "";
|
|
1209
|
-
},
|
|
1213
|
+
}, sn = ({
|
|
1210
1214
|
isLoading: e,
|
|
1211
1215
|
isOpen: t,
|
|
1212
1216
|
onClose: o,
|
|
@@ -1215,14 +1219,14 @@ const Ee = M(
|
|
|
1215
1219
|
applicationName: a,
|
|
1216
1220
|
handleLogout: c
|
|
1217
1221
|
}) => {
|
|
1218
|
-
const [s, l] = O(
|
|
1222
|
+
const [s, l] = O(Co), [u, g] = L(s), { enqueueSuccessNotification: S } = vo(), A = r.length === 0, f = !!s && !r.includes(s) && !r.includes(u), b = !s || A || f, y = () => N(null, null, function* () {
|
|
1219
1223
|
u ? (l(u), i == null || i(u), S(`Set organisation to ${u}`), o()) : (l(""), i == null || i(""));
|
|
1220
|
-
}), p = () => N(
|
|
1224
|
+
}), p = () => N(null, null, function* () {
|
|
1221
1225
|
s && !A && !f ? (g(s), o()) : b && c();
|
|
1222
1226
|
});
|
|
1223
1227
|
let k;
|
|
1224
1228
|
return A ? k = "Unable to retrieve your active organisations. Try logging in again." : f && (k = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ m(
|
|
1225
|
-
|
|
1229
|
+
et,
|
|
1226
1230
|
{
|
|
1227
1231
|
isOpen: t,
|
|
1228
1232
|
dialogTitle: "Select an organisation",
|
|
@@ -1251,7 +1255,7 @@ const Ee = M(
|
|
|
1251
1255
|
multiple: !1,
|
|
1252
1256
|
disableClearable: !1,
|
|
1253
1257
|
value: u !== "" ? u : null,
|
|
1254
|
-
onChange: (I,
|
|
1258
|
+
onChange: (I, F) => g(F != null ? F : ""),
|
|
1255
1259
|
getOptionLabel: wo,
|
|
1256
1260
|
options: [...r],
|
|
1257
1261
|
renderInput: (I) => /* @__PURE__ */ n(
|
|
@@ -1260,7 +1264,7 @@ const Ee = M(
|
|
|
1260
1264
|
variant: "filled",
|
|
1261
1265
|
label: "Select organisation",
|
|
1262
1266
|
InputProps: D(d({}, I.InputProps), {
|
|
1263
|
-
endAdornment: /* @__PURE__ */ m(
|
|
1267
|
+
endAdornment: /* @__PURE__ */ m(T, { children: [
|
|
1264
1268
|
e ? /* @__PURE__ */ n(ae, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
|
|
1265
1269
|
I.InputProps.endAdornment
|
|
1266
1270
|
] })
|
|
@@ -1269,11 +1273,11 @@ const Ee = M(
|
|
|
1269
1273
|
)
|
|
1270
1274
|
}
|
|
1271
1275
|
),
|
|
1272
|
-
k && /* @__PURE__ */ n(
|
|
1276
|
+
k && /* @__PURE__ */ n(At, { error: !0, children: k })
|
|
1273
1277
|
]
|
|
1274
1278
|
}
|
|
1275
1279
|
);
|
|
1276
|
-
},
|
|
1280
|
+
}, ln = ze({
|
|
1277
1281
|
palette: {
|
|
1278
1282
|
primary: {
|
|
1279
1283
|
dark: "#00A651",
|
|
@@ -1324,7 +1328,7 @@ const Ee = M(
|
|
|
1324
1328
|
navBar: {
|
|
1325
1329
|
backgroundColor: "#E8E8E8"
|
|
1326
1330
|
}
|
|
1327
|
-
}),
|
|
1331
|
+
}), cn = ze({
|
|
1328
1332
|
palette: {
|
|
1329
1333
|
primary: {
|
|
1330
1334
|
main: "#007236",
|
|
@@ -1420,47 +1424,48 @@ const Ee = M(
|
|
|
1420
1424
|
}
|
|
1421
1425
|
});
|
|
1422
1426
|
export {
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
+
et as AgDialog,
|
|
1428
|
+
jo as AppLayout,
|
|
1429
|
+
rn as AuthGuard,
|
|
1430
|
+
ot as Context,
|
|
1427
1431
|
ce as ContextError,
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1432
|
+
sn as DomainCodeDialog,
|
|
1433
|
+
Wo as ExampleComponent,
|
|
1434
|
+
en as FetchAutocomplete,
|
|
1435
|
+
tn as MUI_AUTOCOMPLETE_VALUE_WARNING_REGEX,
|
|
1436
|
+
Ye as NAVBAR_WIDTH_CLOSED,
|
|
1437
|
+
Xe as NAVBAR_WIDTH_OPENED,
|
|
1438
|
+
Xo as NavBar,
|
|
1439
|
+
qo as NavBarDarkStyledList,
|
|
1440
|
+
Go as NavBarLightStyledList,
|
|
1437
1441
|
Bt as NavBarProvider,
|
|
1438
1442
|
xo as SaladBarProvider,
|
|
1439
|
-
|
|
1440
|
-
|
|
1443
|
+
nn as SessionExpiryDialog,
|
|
1444
|
+
on as SingleAutocomplete,
|
|
1441
1445
|
Rt as buildNavBarState,
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1446
|
+
Yo as determineUserLevelFromClaims,
|
|
1447
|
+
Co as domainCodeAtom,
|
|
1448
|
+
ln as fed21Theme,
|
|
1445
1449
|
io as getAuth0Expiry,
|
|
1446
|
-
|
|
1450
|
+
Qo as getValidBusinessRoles,
|
|
1451
|
+
cn as internalAgSystemsTheme,
|
|
1447
1452
|
H as navBarClasses,
|
|
1448
1453
|
Q as navBarOpenAtom,
|
|
1449
1454
|
Gt as navBarTopAtom,
|
|
1450
1455
|
zt as navBarWidthClosedAtom,
|
|
1451
1456
|
Wt as navBarWidthOpenAtom,
|
|
1452
1457
|
Jt as simpleHashCode,
|
|
1453
|
-
|
|
1454
|
-
|
|
1458
|
+
Jo as suppressConsole,
|
|
1459
|
+
be as titleTextAtom,
|
|
1455
1460
|
qt as topBarHeightAtom,
|
|
1456
1461
|
Vt as topBarMiddleAtom,
|
|
1457
|
-
|
|
1458
|
-
|
|
1462
|
+
Zo as unsuppressConsole,
|
|
1463
|
+
tt as useAutocompleteOptions,
|
|
1459
1464
|
Pt as useNavBar,
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
+
vo as useSaladBar,
|
|
1466
|
+
Ko as useValidDomains,
|
|
1467
|
+
Vo as withBrowserRouter,
|
|
1468
|
+
zo as withNavBarProvider,
|
|
1469
|
+
an as withSaladBarProvider
|
|
1465
1470
|
};
|
|
1466
1471
|
//# sourceMappingURL=index.js.map
|