@australiangreens/ag-internal-components 0.0.87 → 0.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/NavBar/NavBarLink.d.ts +16 -0
- package/dist/components/NavBar/NavBarLink.d.ts.map +1 -0
- package/dist/components/NavBar/NavBarLink.unit.test.d.ts +2 -0
- package/dist/components/NavBar/NavBarLink.unit.test.d.ts.map +1 -0
- package/dist/components/NavBar/index.d.ts +2 -1
- package/dist/components/NavBar/index.d.ts.map +1 -1
- package/dist/components/NavBar/testWrappers.d.ts +1 -0
- package/dist/components/NavBar/testWrappers.d.ts.map +1 -1
- package/dist/components/SingleAutocomplete/index.d.ts +2 -1
- package/dist/components/SingleAutocomplete/index.d.ts.map +1 -1
- package/dist/esm/index.js +884 -880
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var pe = (e, t, n) => t in e ? Pt(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
10
10
|
Oe.call(t, n) && pe(e, n, t[n]);
|
|
11
11
|
return e;
|
|
12
12
|
}, S = (e, t) => Nt(e, Lt(t));
|
|
13
|
-
var
|
|
13
|
+
var Be = (e, t) => {
|
|
14
14
|
var n = {};
|
|
15
15
|
for (var i in e)
|
|
16
16
|
Te.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
|
|
@@ -19,8 +19,8 @@ var Ee = (e, t) => {
|
|
|
19
19
|
t.indexOf(i) < 0 && Oe.call(e, i) && (n[i] = e[i]);
|
|
20
20
|
return n;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
23
|
-
var
|
|
22
|
+
var Ee = (e, t, n) => (pe(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
23
|
+
var N = (e, t, n) => new Promise((i, r) => {
|
|
24
24
|
var a = (l) => {
|
|
25
25
|
try {
|
|
26
26
|
d(n.next(l));
|
|
@@ -36,28 +36,29 @@ var P = (e, t, n) => new Promise((i, r) => {
|
|
|
36
36
|
}, d = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(a, c);
|
|
37
37
|
d((n = n.apply(e, t)).next());
|
|
38
38
|
});
|
|
39
|
-
import { jsxs as p, Fragment as
|
|
40
|
-
import { useState as E, createContext as Qe, useCallback as ne, useContext as Ye,
|
|
41
|
-
import { Typography as
|
|
39
|
+
import { jsxs as p, Fragment as M, jsx as o } from "react/jsx-runtime";
|
|
40
|
+
import { useState as E, createContext as Qe, useCallback as ne, useContext as Ye, useEffect as oe, createElement as Ce, useRef as he } from "react";
|
|
41
|
+
import { Typography as P, Button as ie, Paper as Ke, Box as $, Drawer as ve, styled as we, IconButton as Y, Container as Je, useTheme as ae, useMediaQuery as _t, Collapse as Mt, Avatar as Fe, Fade as Rt, Skeleton as Pe, Toolbar as Ht, Divider as Ne, CssBaseline as Wt, Dialog as Ze, LinearProgress as je, DialogTitle as et, DialogContent as tt, DialogActions as nt, Autocomplete as Ae, TextField as be, CircularProgress as Se, Chip as zt, Tooltip as Ut, Stack as Gt, Snackbar as Vt, Alert as qt, FormHelperText as Xt } from "@mui/material";
|
|
42
42
|
import Qt from "@mui/material/CssBaseline";
|
|
43
|
-
import { styled as
|
|
43
|
+
import { styled as H, createTheme as ot, alpha as ge } from "@mui/material/styles";
|
|
44
44
|
import { AgError as Yt } from "@australiangreens/ag-error";
|
|
45
|
-
import { createHelper as
|
|
45
|
+
import { createHelper as X } from "souvlaki";
|
|
46
|
+
import { BrowserRouter as Kt } from "react-router-dom";
|
|
46
47
|
import it from "@mui/material/List";
|
|
47
|
-
import {
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import {
|
|
53
|
-
import
|
|
54
|
-
import {
|
|
55
|
-
import
|
|
56
|
-
function
|
|
48
|
+
import { ArrowForward as rt, ArrowBack as at, ViewHeadline as Jt, Cancel as Zt, ArrowDropDown as jt } from "@mui/icons-material";
|
|
49
|
+
import { atom as R, useSetAtom as st, useAtomValue as Le, useAtom as V, getDefaultStore as en, Provider as lt } from "jotai";
|
|
50
|
+
import { useHydrateAtoms as ct } from "jotai/utils";
|
|
51
|
+
import tn from "autosuggest-highlight/match";
|
|
52
|
+
import nn from "autosuggest-highlight/parse";
|
|
53
|
+
import { useQuery as on, QueryClient as rn, QueryClientProvider as an } from "@tanstack/react-query";
|
|
54
|
+
import { useAuth0 as dt } from "@auth0/auth0-react";
|
|
55
|
+
import { Buffer as sn } from "buffer";
|
|
56
|
+
import ln from "@mui/material/Skeleton";
|
|
57
|
+
function $o({ text: e }) {
|
|
57
58
|
const [t, n] = E(0);
|
|
58
|
-
return /* @__PURE__ */ p(
|
|
59
|
-
/* @__PURE__ */ o(
|
|
60
|
-
/* @__PURE__ */ o(
|
|
59
|
+
return /* @__PURE__ */ p(M, { children: [
|
|
60
|
+
/* @__PURE__ */ o(P, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
|
|
61
|
+
/* @__PURE__ */ o(P, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
|
|
61
62
|
/* @__PURE__ */ o(
|
|
62
63
|
ie,
|
|
63
64
|
{
|
|
@@ -85,7 +86,7 @@ const ut = 330, pt = 73, U = "Navbar", q = {
|
|
|
85
86
|
userInfoHolder: `${U}-userInfoHolder`,
|
|
86
87
|
settings: `${U}-settings`,
|
|
87
88
|
pieChartIcon: `${U}-pieChartIcon`
|
|
88
|
-
},
|
|
89
|
+
}, cn = H($, {
|
|
89
90
|
name: "NavBar"
|
|
90
91
|
})(({ theme: e }) => ({
|
|
91
92
|
[`&.${q.root}`]: {
|
|
@@ -114,11 +115,11 @@ const ut = 330, pt = 73, U = "Navbar", q = {
|
|
|
114
115
|
color: "white",
|
|
115
116
|
backgroundColor: "black"
|
|
116
117
|
// backgroundColor: '#e8e8e8',
|
|
117
|
-
}),
|
|
118
|
+
}), dn = () => s({
|
|
118
119
|
width: ut
|
|
119
|
-
}, ht()),
|
|
120
|
+
}, ht()), un = () => s({
|
|
120
121
|
width: pt
|
|
121
|
-
}, ht()),
|
|
122
|
+
}, ht()), pn = H(ve, {
|
|
122
123
|
shouldForwardProp: (e) => e !== "open"
|
|
123
124
|
})(({ theme: e, open: t }) => s(s({
|
|
124
125
|
width: t ? ut : pt,
|
|
@@ -127,16 +128,16 @@ const ut = 330, pt = 73, U = "Navbar", q = {
|
|
|
127
128
|
boxSizing: "border-box",
|
|
128
129
|
zIndex: e.zIndex.drawer + 100
|
|
129
130
|
}, t && {
|
|
130
|
-
"& .MuiDrawer-paper": cn()
|
|
131
|
-
}), !t && {
|
|
132
131
|
"& .MuiDrawer-paper": dn()
|
|
132
|
+
}), !t && {
|
|
133
|
+
"& .MuiDrawer-paper": un()
|
|
133
134
|
}));
|
|
134
135
|
class ke extends Yt {
|
|
135
136
|
}
|
|
136
|
-
|
|
137
|
-
const gt = Qe(null),
|
|
138
|
-
overrideState: e =
|
|
139
|
-
overrideActions: t =
|
|
137
|
+
Ee(ke, "errorName", "ContextError");
|
|
138
|
+
const gt = Qe(null), hn = {}, gn = {}, fn = ({
|
|
139
|
+
overrideState: e = hn,
|
|
140
|
+
overrideActions: t = gn,
|
|
140
141
|
children: n
|
|
141
142
|
}) => {
|
|
142
143
|
const [{ open: i }, r] = E({ open: !0 }), a = ne((l) => {
|
|
@@ -149,16 +150,16 @@ const gt = Qe(null), pn = {}, hn = {}, gn = ({
|
|
|
149
150
|
toggleOpen: c
|
|
150
151
|
}, e), t);
|
|
151
152
|
return /* @__PURE__ */ o(gt.Provider, { value: d, children: n });
|
|
152
|
-
},
|
|
153
|
+
}, mn = () => {
|
|
153
154
|
const e = Ye(gt);
|
|
154
155
|
if (e === null)
|
|
155
156
|
throw new ke("Error: Tried to useNavBar outside of a <NavBarProvider>");
|
|
156
157
|
return e;
|
|
157
|
-
},
|
|
158
|
+
}, Cn = (e = {}) => s({
|
|
158
159
|
open: !0
|
|
159
|
-
}, e),
|
|
160
|
-
(e =
|
|
161
|
-
), _e = 7,
|
|
160
|
+
}, e), Io = X(
|
|
161
|
+
(e = Cn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(fn, { overrideState: e, overrideActions: t, children: n })
|
|
162
|
+
), To = X(() => ({ children: e }) => /* @__PURE__ */ o(Kt, { children: e })), _e = 7, Oo = H(it)(({ theme: e }) => ({
|
|
162
163
|
backgroundColor: "black",
|
|
163
164
|
color: "white",
|
|
164
165
|
"& .MuiListItem-root": {
|
|
@@ -196,7 +197,7 @@ const gt = Qe(null), pn = {}, hn = {}, gn = ({
|
|
|
196
197
|
// '&.Mui-selected.Mui-focusVisible:hover': {
|
|
197
198
|
// },
|
|
198
199
|
}
|
|
199
|
-
})), Me = 7,
|
|
200
|
+
})), Me = 7, Bo = H(it)(({ theme: e }) => ({
|
|
200
201
|
backgroundColor: "#e8e8e8",
|
|
201
202
|
color: "inherit",
|
|
202
203
|
"& .MuiListItem-root": {
|
|
@@ -235,15 +236,15 @@ const gt = Qe(null), pn = {}, hn = {}, gn = ({
|
|
|
235
236
|
// },
|
|
236
237
|
}
|
|
237
238
|
}));
|
|
238
|
-
function
|
|
239
|
+
function Eo({
|
|
239
240
|
"data-testid": e,
|
|
240
241
|
children: t
|
|
241
242
|
}) {
|
|
242
|
-
const { open: n } =
|
|
243
|
-
return /* @__PURE__ */ p(
|
|
243
|
+
const { open: n } = mn();
|
|
244
|
+
return /* @__PURE__ */ p(cn, { className: q.root, "data-testid": e, children: [
|
|
244
245
|
/* @__PURE__ */ o(Qt, {}),
|
|
245
246
|
/* @__PURE__ */ o(
|
|
246
|
-
|
|
247
|
+
pn,
|
|
247
248
|
{
|
|
248
249
|
variant: "permanent",
|
|
249
250
|
anchor: "left",
|
|
@@ -254,486 +255,109 @@ function To({
|
|
|
254
255
|
)
|
|
255
256
|
] });
|
|
256
257
|
}
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
258
|
+
const xn = 24, vn = 64, G = "TopBar", B = {
|
|
259
|
+
topStripe: `${G}-topStripe`,
|
|
260
|
+
titleBar: `${G}-titleBar`,
|
|
261
|
+
titleSlider: `${G}-titleSlider`,
|
|
262
|
+
titleText: `${G}-titleText`,
|
|
263
|
+
leftPanelButton: `${G}-leftPanelButton`,
|
|
264
|
+
rightPanelButton: `${G}-leftPanelButton`
|
|
265
|
+
}, wn = we("div", {
|
|
266
|
+
shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
|
|
267
|
+
name: G
|
|
268
|
+
})(({ theme: e, leftPanel: t, rightPanel: n }) => {
|
|
269
|
+
var i, r;
|
|
270
|
+
return {
|
|
271
|
+
width: "100%",
|
|
272
|
+
[`& .${B.topStripe}`]: {
|
|
273
|
+
width: "100%",
|
|
274
|
+
height: `${xn}px`,
|
|
275
|
+
backgroundColor: e.palette.primary.main
|
|
276
|
+
},
|
|
277
|
+
[`& .${B.titleBar}`]: {
|
|
278
|
+
backgroundColor: e.palette.primary.light,
|
|
279
|
+
height: `${vn}px`,
|
|
280
|
+
padding: e.spacing(0, 3),
|
|
281
|
+
width: "100%"
|
|
282
|
+
},
|
|
283
|
+
[`& .${B.titleSlider}`]: s(s({
|
|
284
|
+
height: "100%",
|
|
285
|
+
display: "flex",
|
|
286
|
+
alignItems: "center",
|
|
287
|
+
color: "white",
|
|
288
|
+
transition: e.transitions.create("margin", {
|
|
289
|
+
easing: e.transitions.easing.sharp,
|
|
290
|
+
duration: e.transitions.duration.leavingScreen
|
|
278
291
|
}),
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
A(!0), yield (b = r.onClick) == null ? void 0 : b.call(r), A(!1);
|
|
304
|
-
}),
|
|
305
|
-
"data-testid": r.testId,
|
|
306
|
-
disabled: r.disabled || C,
|
|
307
|
-
color: r == null ? void 0 : r.buttonColor,
|
|
308
|
-
children: r.text
|
|
309
|
-
}
|
|
310
|
-
)
|
|
311
|
-
] })
|
|
312
|
-
]
|
|
313
|
-
}
|
|
314
|
-
);
|
|
315
|
-
}, mt = ({
|
|
316
|
-
minLength: e,
|
|
317
|
-
preLoadedOptions: t,
|
|
318
|
-
lookup: n,
|
|
319
|
-
label: i,
|
|
320
|
-
inputValue: r
|
|
321
|
-
}) => tn({
|
|
322
|
-
queryFn: () => e && r.length < e ? t != null ? t : [] : t ? t.filter(
|
|
323
|
-
(a) => a.label.toLowerCase().includes(r.toLowerCase())
|
|
324
|
-
) : n(r),
|
|
325
|
-
queryKey: ["autocomplete", i, r]
|
|
292
|
+
[`& .${B.leftPanelButton}`]: {
|
|
293
|
+
marginRight: e.spacing(2),
|
|
294
|
+
flexGrow: 0
|
|
295
|
+
},
|
|
296
|
+
[`& .${B.titleText}`]: {
|
|
297
|
+
flexGrow: 1
|
|
298
|
+
},
|
|
299
|
+
[`& .${B.rightPanelButton}`]: {
|
|
300
|
+
flexGrow: 0
|
|
301
|
+
}
|
|
302
|
+
}, (t == null ? void 0 : t.open) && {
|
|
303
|
+
transition: e.transitions.create("margin", {
|
|
304
|
+
easing: e.transitions.easing.easeOut,
|
|
305
|
+
duration: e.transitions.duration.enteringScreen
|
|
306
|
+
}),
|
|
307
|
+
marginLeft: `${(i = t == null ? void 0 : t.width) != null ? i : 0}px`
|
|
308
|
+
}), (n == null ? void 0 : n.open) && {
|
|
309
|
+
transition: e.transitions.create("margin", {
|
|
310
|
+
easing: e.transitions.easing.easeOut,
|
|
311
|
+
duration: e.transitions.duration.enteringScreen
|
|
312
|
+
}),
|
|
313
|
+
marginRight: `${(r = n == null ? void 0 : n.width) != null ? r : 0}px`
|
|
314
|
+
})
|
|
315
|
+
};
|
|
326
316
|
});
|
|
327
|
-
function
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
minLength: i = 0,
|
|
333
|
-
label: r,
|
|
334
|
-
value: a,
|
|
335
|
-
"data-testid": c,
|
|
336
|
-
sx: d,
|
|
337
|
-
boxSx: l,
|
|
338
|
-
textFieldColor: u,
|
|
339
|
-
textFieldVariant: w = "filled",
|
|
340
|
-
loadingText: C = "Loading...",
|
|
341
|
-
noOptionsText: A = "No options",
|
|
342
|
-
popupIcon: g = /* @__PURE__ */ o(Jt, {}),
|
|
343
|
-
error: k = !1,
|
|
344
|
-
helperText: b = "",
|
|
345
|
-
preLoadedOptions: D = void 0,
|
|
346
|
-
disablePortal: I = !1
|
|
317
|
+
function An({
|
|
318
|
+
titleText: e = "",
|
|
319
|
+
leftPanel: t,
|
|
320
|
+
rightPanel: n,
|
|
321
|
+
"data-testid": i
|
|
347
322
|
}) {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
disablePortal: I,
|
|
365
|
-
multiple: !0,
|
|
366
|
-
getOptionLabel: (h) => typeof h == "string" ? h : h.label,
|
|
367
|
-
loading: W ? T : !1,
|
|
368
|
-
options: [...a, ...N != null ? N : []],
|
|
369
|
-
filterSelectedOptions: !0,
|
|
370
|
-
includeInputInList: !0,
|
|
371
|
-
value: a,
|
|
372
|
-
onChange: (h, f, B) => {
|
|
373
|
-
n(f, B, h);
|
|
374
|
-
},
|
|
375
|
-
onInputChange: (h, f) => y(f),
|
|
376
|
-
noOptionsText: W ? A : "Start typing to search",
|
|
377
|
-
loadingText: C,
|
|
378
|
-
popupIcon: g,
|
|
379
|
-
renderInput: (h) => /* @__PURE__ */ o(
|
|
380
|
-
Ae,
|
|
381
|
-
S(s({}, h), {
|
|
382
|
-
label: r,
|
|
383
|
-
fullWidth: !0,
|
|
384
|
-
variant: w,
|
|
385
|
-
error: k,
|
|
386
|
-
helperText: b,
|
|
387
|
-
InputProps: S(s({}, h.InputProps), {
|
|
388
|
-
endAdornment: /* @__PURE__ */ p(_, { children: [
|
|
389
|
-
T ? /* @__PURE__ */ o(be, { color: "inherit", size: 20 }) : null,
|
|
390
|
-
h.InputProps.endAdornment
|
|
391
|
-
] })
|
|
392
|
-
}),
|
|
393
|
-
"data-testid": c ? `${c}:Autocomplete:TextField` : void 0,
|
|
394
|
-
onKeyDown: (f) => {
|
|
395
|
-
(f.key === "Backspace" || f.key === "Delete") && f.stopPropagation();
|
|
396
|
-
},
|
|
397
|
-
color: u
|
|
398
|
-
})
|
|
399
|
-
),
|
|
400
|
-
renderTags: () => null,
|
|
401
|
-
isOptionEqualToValue: (h, f) => h.id === f.id,
|
|
402
|
-
renderOption: (h, f, B) => {
|
|
403
|
-
if (t) {
|
|
404
|
-
const m = jt(f.label, B.inputValue, {
|
|
405
|
-
insideWords: !0,
|
|
406
|
-
findAllOccurrences: !0
|
|
407
|
-
}), v = en(f.label, m);
|
|
408
|
-
return /* @__PURE__ */ Ce(
|
|
409
|
-
"li",
|
|
410
|
-
S(s({}, h), {
|
|
411
|
-
key: f.id,
|
|
412
|
-
"data-testid": c ? `${c}:Autocomplete:option(${f.id.toString()})` : void 0
|
|
413
|
-
}),
|
|
414
|
-
/* @__PURE__ */ o("div", { children: v.map((L, se) => /* @__PURE__ */ o(
|
|
415
|
-
"span",
|
|
416
|
-
{
|
|
417
|
-
style: {
|
|
418
|
-
fontWeight: L.highlight ? 700 : 400
|
|
419
|
-
},
|
|
420
|
-
children: L.text
|
|
421
|
-
},
|
|
422
|
-
se
|
|
423
|
-
)) })
|
|
424
|
-
);
|
|
425
|
-
} else
|
|
426
|
-
return /* @__PURE__ */ Ce(
|
|
427
|
-
"li",
|
|
428
|
-
S(s({}, h), {
|
|
429
|
-
key: f.id,
|
|
430
|
-
"data-testid": c ? `${c}:option(${f.id.toString()})` : void 0
|
|
431
|
-
}),
|
|
432
|
-
f.label
|
|
433
|
-
);
|
|
323
|
+
return /* @__PURE__ */ p(wn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
|
|
324
|
+
/* @__PURE__ */ o("div", { className: B.topStripe }),
|
|
325
|
+
/* @__PURE__ */ o("div", { className: B.titleBar, children: /* @__PURE__ */ p($, { className: B.titleSlider, children: [
|
|
326
|
+
t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ p(
|
|
327
|
+
Y,
|
|
328
|
+
{
|
|
329
|
+
className: B.leftPanelButton,
|
|
330
|
+
color: "inherit",
|
|
331
|
+
"aria-label": "Open left side panel",
|
|
332
|
+
onClick: t == null ? void 0 : t.onOpen,
|
|
333
|
+
edge: "start",
|
|
334
|
+
size: "large",
|
|
335
|
+
children: [
|
|
336
|
+
" ",
|
|
337
|
+
/* @__PURE__ */ o(rt, {})
|
|
338
|
+
]
|
|
434
339
|
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
name: "offset",
|
|
454
|
-
options: {
|
|
455
|
-
offset: [115, -15]
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
]
|
|
459
|
-
},
|
|
460
|
-
children: /* @__PURE__ */ o(F, { style: { whiteSpace: "normal" }, children: h.chipLabel ? h.chipLabel : h.label })
|
|
461
|
-
}
|
|
462
|
-
),
|
|
463
|
-
"data-testid": c ? `${c}:Chip(${h.id.toString()})` : void 0,
|
|
464
|
-
onDelete: (f) => H(f, h.id),
|
|
465
|
-
deleteIcon: /* @__PURE__ */ o(
|
|
466
|
-
Kt,
|
|
467
|
-
{
|
|
468
|
-
"data-testid": c ? `${c}:Chip(${h.id.toString()}):deleteIcon` : void 0
|
|
469
|
-
}
|
|
470
|
-
)
|
|
471
|
-
},
|
|
472
|
-
h.id
|
|
473
|
-
)) })
|
|
340
|
+
),
|
|
341
|
+
/* @__PURE__ */ o(P, { className: B.titleText, variant: "h6", noWrap: !0, children: e }),
|
|
342
|
+
n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ p(
|
|
343
|
+
Y,
|
|
344
|
+
{
|
|
345
|
+
className: B.rightPanelButton,
|
|
346
|
+
color: "inherit",
|
|
347
|
+
"aria-label": "Open right side panel",
|
|
348
|
+
onClick: n == null ? void 0 : n.onOpen,
|
|
349
|
+
edge: "end",
|
|
350
|
+
size: "large",
|
|
351
|
+
children: [
|
|
352
|
+
" ",
|
|
353
|
+
/* @__PURE__ */ o(at, {})
|
|
354
|
+
]
|
|
355
|
+
}
|
|
356
|
+
)
|
|
357
|
+
] }) })
|
|
474
358
|
] });
|
|
475
359
|
}
|
|
476
|
-
const
|
|
477
|
-
lookup: e = () => P(void 0, null, function* () {
|
|
478
|
-
}),
|
|
479
|
-
onChange: t,
|
|
480
|
-
label: n,
|
|
481
|
-
value: i,
|
|
482
|
-
sx: r,
|
|
483
|
-
textFieldColor: a,
|
|
484
|
-
textFieldVariant: c = "filled",
|
|
485
|
-
"data-testid": d,
|
|
486
|
-
noOptionsText: l = "No options",
|
|
487
|
-
minLength: u = 3,
|
|
488
|
-
disablePortal: w = !1,
|
|
489
|
-
preLoadedOptions: C,
|
|
490
|
-
helperText: A = ""
|
|
491
|
-
}) => {
|
|
492
|
-
const [g, k] = E(""), { data: b, isLoading: D } = mt({
|
|
493
|
-
inputValue: g,
|
|
494
|
-
label: n,
|
|
495
|
-
lookup: e,
|
|
496
|
-
minLength: u != null ? u : 0,
|
|
497
|
-
preLoadedOptions: C
|
|
498
|
-
}), I = g.length >= u;
|
|
499
|
-
return /* @__PURE__ */ o("div", { "data-testid": d, children: /* @__PURE__ */ o(Rt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
|
|
500
|
-
we,
|
|
501
|
-
{
|
|
502
|
-
sx: r,
|
|
503
|
-
"data-testid": d ? `${d}:Autocomplete` : void 0,
|
|
504
|
-
loading: I ? D : !1,
|
|
505
|
-
options: b != null ? b : [],
|
|
506
|
-
onChange: (x, y) => {
|
|
507
|
-
t(x, y);
|
|
508
|
-
},
|
|
509
|
-
disablePortal: w,
|
|
510
|
-
filterOptions: (x) => x,
|
|
511
|
-
value: i,
|
|
512
|
-
noOptionsText: I ? l : "Start typing to search",
|
|
513
|
-
getOptionLabel: (x) => x.label,
|
|
514
|
-
renderInput: (x) => /* @__PURE__ */ o(
|
|
515
|
-
Ae,
|
|
516
|
-
S(s({
|
|
517
|
-
"data-testid": d ? `${d}:Autocomplete:TextField` : void 0
|
|
518
|
-
}, x), {
|
|
519
|
-
variant: c,
|
|
520
|
-
label: n,
|
|
521
|
-
color: a,
|
|
522
|
-
helperText: A
|
|
523
|
-
})
|
|
524
|
-
),
|
|
525
|
-
isOptionEqualToValue: (x, y) => x.id === y.id,
|
|
526
|
-
onInputChange: (x, y) => {
|
|
527
|
-
k(y);
|
|
528
|
-
},
|
|
529
|
-
renderOption: (x, y) => /* @__PURE__ */ Ce(
|
|
530
|
-
"li",
|
|
531
|
-
S(s({}, x), {
|
|
532
|
-
key: y.id,
|
|
533
|
-
"data-testid": d ? `${d}:Autocomplete:option(${y.id.toString()})` : void 0
|
|
534
|
-
}),
|
|
535
|
-
y.label
|
|
536
|
-
)
|
|
537
|
-
}
|
|
538
|
-
) }) });
|
|
539
|
-
}, Cn = (e) => {
|
|
540
|
-
if (!e)
|
|
541
|
-
return -1;
|
|
542
|
-
try {
|
|
543
|
-
const n = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), i = decodeURIComponent(
|
|
544
|
-
rn.from(n, "base64").toString("utf8").split("").map(function(a) {
|
|
545
|
-
return "%" + ("00" + a.charCodeAt(0).toString(16)).slice(-2);
|
|
546
|
-
}).join("")
|
|
547
|
-
), r = JSON.parse(i);
|
|
548
|
-
return r != null && r.exp ? r.exp : -1;
|
|
549
|
-
} catch (t) {
|
|
550
|
-
return -1;
|
|
551
|
-
}
|
|
552
|
-
}, Bo = ({
|
|
553
|
-
open: e = !1,
|
|
554
|
-
closeHandler: t,
|
|
555
|
-
setAuth0ExpiryTime: n
|
|
556
|
-
}) => {
|
|
557
|
-
const { logout: i, getAccessTokenSilently: r } = st(), [a, c] = E(0), d = () => P(void 0, null, function* () {
|
|
558
|
-
i({ logoutParams: { returnTo: `${window.location.origin}` } });
|
|
559
|
-
}), l = () => P(void 0, null, function* () {
|
|
560
|
-
c(a + 1), t();
|
|
561
|
-
});
|
|
562
|
-
return oe(() => {
|
|
563
|
-
(() => P(void 0, null, function* () {
|
|
564
|
-
if (a > 0) {
|
|
565
|
-
const A = yield r({ cacheMode: "off" }), g = Cn(A) * 1e3;
|
|
566
|
-
n(g);
|
|
567
|
-
}
|
|
568
|
-
}))();
|
|
569
|
-
}, [a, r, n]), /* @__PURE__ */ o(
|
|
570
|
-
ft,
|
|
571
|
-
{
|
|
572
|
-
isOpen: e,
|
|
573
|
-
primaryButton: {
|
|
574
|
-
text: "Continue",
|
|
575
|
-
onClick: l,
|
|
576
|
-
disabled: !1,
|
|
577
|
-
testId: "PreferencesDialog",
|
|
578
|
-
buttonColor: "secondary"
|
|
579
|
-
},
|
|
580
|
-
secondaryButton: {
|
|
581
|
-
text: "Log out",
|
|
582
|
-
onClick: d,
|
|
583
|
-
disabled: !1,
|
|
584
|
-
testId: "PreferencesDialog",
|
|
585
|
-
buttonColor: "secondary"
|
|
586
|
-
},
|
|
587
|
-
onClose: t,
|
|
588
|
-
dialogTitle: "Session expiry",
|
|
589
|
-
disableCloseOnBackdropOrEscape: !0,
|
|
590
|
-
children: /* @__PURE__ */ o("p", { style: { marginBottom: 0 }, children: "Your session is about to time out due to inactivity. Do you want to continue?" })
|
|
591
|
-
}
|
|
592
|
-
);
|
|
593
|
-
};
|
|
594
|
-
function xn(e) {
|
|
595
|
-
return "error" in e;
|
|
596
|
-
}
|
|
597
|
-
function vn(e) {
|
|
598
|
-
return e.error === "access_denied";
|
|
599
|
-
}
|
|
600
|
-
function wn(e) {
|
|
601
|
-
var i;
|
|
602
|
-
const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
|
|
603
|
-
return t === "access_denied" && n.startsWith("You do not have the required authorization");
|
|
604
|
-
}
|
|
605
|
-
function An(e) {
|
|
606
|
-
var i;
|
|
607
|
-
const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
|
|
608
|
-
return t === "access_denied" && n.startsWith("User did not authorize the request");
|
|
609
|
-
}
|
|
610
|
-
function Fo({
|
|
611
|
-
children: e,
|
|
612
|
-
appName: t = "the app"
|
|
613
|
-
}) {
|
|
614
|
-
const { isAuthenticated: n, isLoading: i, error: r, loginWithRedirect: a, logout: c } = st();
|
|
615
|
-
if (oe(() => {
|
|
616
|
-
if (i || n || r)
|
|
617
|
-
return;
|
|
618
|
-
const d = {
|
|
619
|
-
appState: {
|
|
620
|
-
returnTo: `${window.location.pathname}${window.location.search}`
|
|
621
|
-
}
|
|
622
|
-
};
|
|
623
|
-
a(d);
|
|
624
|
-
}, [i, n, r, a]), r && xn(r)) {
|
|
625
|
-
let d = "Auth error", l = "An unknown Auth0 error occurred.";
|
|
626
|
-
return wn(r) ? (d = "Unauthorised", l = `You are not authorised to access ${t}.`) : An(r) ? (d = "App not authorised", l = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`) : vn(r) && (d = "Unauthorised", l = "Authorisation with auth0 failed for an unknown reason."), /* @__PURE__ */ p(Je, { open: !0, children: [
|
|
627
|
-
/* @__PURE__ */ o(je, { children: d }),
|
|
628
|
-
/* @__PURE__ */ o(et, { children: /* @__PURE__ */ o(F, { children: l }) }),
|
|
629
|
-
/* @__PURE__ */ o(tt, { children: /* @__PURE__ */ o(ie, { onClick: () => c({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
|
|
630
|
-
] });
|
|
631
|
-
}
|
|
632
|
-
return n ? /* @__PURE__ */ o(_, { children: e }) : /* @__PURE__ */ o(an, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
|
|
633
|
-
}
|
|
634
|
-
const bn = 24, Sn = 64, G = "TopBar", O = {
|
|
635
|
-
topStripe: `${G}-topStripe`,
|
|
636
|
-
titleBar: `${G}-titleBar`,
|
|
637
|
-
titleSlider: `${G}-titleSlider`,
|
|
638
|
-
titleText: `${G}-titleText`,
|
|
639
|
-
leftPanelButton: `${G}-leftPanelButton`,
|
|
640
|
-
rightPanelButton: `${G}-leftPanelButton`
|
|
641
|
-
}, kn = Se("div", {
|
|
642
|
-
shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
|
|
643
|
-
name: G
|
|
644
|
-
})(({ theme: e, leftPanel: t, rightPanel: n }) => {
|
|
645
|
-
var i, r;
|
|
646
|
-
return {
|
|
647
|
-
width: "100%",
|
|
648
|
-
[`& .${O.topStripe}`]: {
|
|
649
|
-
width: "100%",
|
|
650
|
-
height: `${bn}px`,
|
|
651
|
-
backgroundColor: e.palette.primary.main
|
|
652
|
-
},
|
|
653
|
-
[`& .${O.titleBar}`]: {
|
|
654
|
-
backgroundColor: e.palette.primary.light,
|
|
655
|
-
height: `${Sn}px`,
|
|
656
|
-
padding: e.spacing(0, 3),
|
|
657
|
-
width: "100%"
|
|
658
|
-
},
|
|
659
|
-
[`& .${O.titleSlider}`]: s(s({
|
|
660
|
-
height: "100%",
|
|
661
|
-
display: "flex",
|
|
662
|
-
alignItems: "center",
|
|
663
|
-
color: "white",
|
|
664
|
-
transition: e.transitions.create("margin", {
|
|
665
|
-
easing: e.transitions.easing.sharp,
|
|
666
|
-
duration: e.transitions.duration.leavingScreen
|
|
667
|
-
}),
|
|
668
|
-
[`& .${O.leftPanelButton}`]: {
|
|
669
|
-
marginRight: e.spacing(2),
|
|
670
|
-
flexGrow: 0
|
|
671
|
-
},
|
|
672
|
-
[`& .${O.titleText}`]: {
|
|
673
|
-
flexGrow: 1
|
|
674
|
-
},
|
|
675
|
-
[`& .${O.rightPanelButton}`]: {
|
|
676
|
-
flexGrow: 0
|
|
677
|
-
}
|
|
678
|
-
}, (t == null ? void 0 : t.open) && {
|
|
679
|
-
transition: e.transitions.create("margin", {
|
|
680
|
-
easing: e.transitions.easing.easeOut,
|
|
681
|
-
duration: e.transitions.duration.enteringScreen
|
|
682
|
-
}),
|
|
683
|
-
marginLeft: `${(i = t == null ? void 0 : t.width) != null ? i : 0}px`
|
|
684
|
-
}), (n == null ? void 0 : n.open) && {
|
|
685
|
-
transition: e.transitions.create("margin", {
|
|
686
|
-
easing: e.transitions.easing.easeOut,
|
|
687
|
-
duration: e.transitions.duration.enteringScreen
|
|
688
|
-
}),
|
|
689
|
-
marginRight: `${(r = n == null ? void 0 : n.width) != null ? r : 0}px`
|
|
690
|
-
})
|
|
691
|
-
};
|
|
692
|
-
});
|
|
693
|
-
function Dn({
|
|
694
|
-
titleText: e = "",
|
|
695
|
-
leftPanel: t,
|
|
696
|
-
rightPanel: n,
|
|
697
|
-
"data-testid": i
|
|
698
|
-
}) {
|
|
699
|
-
return /* @__PURE__ */ p(kn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
|
|
700
|
-
/* @__PURE__ */ o("div", { className: O.topStripe }),
|
|
701
|
-
/* @__PURE__ */ o("div", { className: O.titleBar, children: /* @__PURE__ */ p($, { className: O.titleSlider, children: [
|
|
702
|
-
t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ p(
|
|
703
|
-
Q,
|
|
704
|
-
{
|
|
705
|
-
className: O.leftPanelButton,
|
|
706
|
-
color: "inherit",
|
|
707
|
-
"aria-label": "Open left side panel",
|
|
708
|
-
onClick: t == null ? void 0 : t.onOpen,
|
|
709
|
-
edge: "start",
|
|
710
|
-
size: "large",
|
|
711
|
-
children: [
|
|
712
|
-
" ",
|
|
713
|
-
/* @__PURE__ */ o(rt, {})
|
|
714
|
-
]
|
|
715
|
-
}
|
|
716
|
-
),
|
|
717
|
-
/* @__PURE__ */ o(F, { className: O.titleText, variant: "h6", noWrap: !0, children: e }),
|
|
718
|
-
n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ p(
|
|
719
|
-
Q,
|
|
720
|
-
{
|
|
721
|
-
className: O.rightPanelButton,
|
|
722
|
-
color: "inherit",
|
|
723
|
-
"aria-label": "Open right side panel",
|
|
724
|
-
onClick: n == null ? void 0 : n.onOpen,
|
|
725
|
-
edge: "end",
|
|
726
|
-
size: "large",
|
|
727
|
-
children: [
|
|
728
|
-
" ",
|
|
729
|
-
/* @__PURE__ */ o(at, {})
|
|
730
|
-
]
|
|
731
|
-
}
|
|
732
|
-
)
|
|
733
|
-
] }) })
|
|
734
|
-
] });
|
|
735
|
-
}
|
|
736
|
-
const Ct = 400, yn = Se(ve, {
|
|
360
|
+
const ft = 400, bn = we(ve, {
|
|
737
361
|
shouldForwardProp: (e) => (
|
|
738
362
|
// Note we do want anchor to be forwarded to the Drawer component
|
|
739
363
|
![
|
|
@@ -763,7 +387,7 @@ const Ct = 400, yn = Se(ve, {
|
|
|
763
387
|
marginLeft: `${r}px`
|
|
764
388
|
}))
|
|
765
389
|
})
|
|
766
|
-
),
|
|
390
|
+
), Sn = we($, {
|
|
767
391
|
shouldForwardProp: (e) => !["anchor"].includes(e)
|
|
768
392
|
})(({ theme: e, anchor: t }) => S(s({
|
|
769
393
|
display: "flex",
|
|
@@ -790,23 +414,23 @@ function Re({
|
|
|
790
414
|
onClose: i = () => {
|
|
791
415
|
},
|
|
792
416
|
titleText: r = "",
|
|
793
|
-
width: a =
|
|
417
|
+
width: a = ft,
|
|
794
418
|
showCloseArrow: c = !0,
|
|
795
419
|
debugOpacity: d = !1,
|
|
796
420
|
headerBoxProps: l = {},
|
|
797
421
|
onOpened: u,
|
|
798
|
-
onClosed:
|
|
422
|
+
onClosed: v,
|
|
799
423
|
"data-testid": C,
|
|
800
|
-
navBarOpen:
|
|
424
|
+
navBarOpen: w = !1,
|
|
801
425
|
navBarWidthOpen: g = 0,
|
|
802
|
-
navBarWidthClosed:
|
|
426
|
+
navBarWidthClosed: D = 0
|
|
803
427
|
}) {
|
|
804
428
|
return /* @__PURE__ */ p(
|
|
805
|
-
|
|
429
|
+
bn,
|
|
806
430
|
{
|
|
807
431
|
SlideProps: {
|
|
808
432
|
onEntered: () => u == null ? void 0 : u(),
|
|
809
|
-
onExited: () =>
|
|
433
|
+
onExited: () => v == null ? void 0 : v()
|
|
810
434
|
},
|
|
811
435
|
variant: "persistent",
|
|
812
436
|
anchor: t,
|
|
@@ -814,29 +438,29 @@ function Re({
|
|
|
814
438
|
width: a,
|
|
815
439
|
debugOpacity: d,
|
|
816
440
|
"data-testid": C,
|
|
817
|
-
navBarOpen:
|
|
441
|
+
navBarOpen: w,
|
|
818
442
|
navBarWidthOpen: g,
|
|
819
|
-
navBarWidthClosed:
|
|
443
|
+
navBarWidthClosed: D,
|
|
820
444
|
children: [
|
|
821
|
-
/* @__PURE__ */ o(
|
|
822
|
-
/* @__PURE__ */ o(
|
|
823
|
-
c && /* @__PURE__ */ p(
|
|
445
|
+
/* @__PURE__ */ o(Sn, S(s({ anchor: t }, l), { children: t === "left" ? /* @__PURE__ */ p(M, { children: [
|
|
446
|
+
/* @__PURE__ */ o(P, { variant: "h6", color: "inherit", component: "div", children: r }),
|
|
447
|
+
c && /* @__PURE__ */ p(Y, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
|
|
824
448
|
/* @__PURE__ */ o(at, { "data-testid": "arrowbackicon" }),
|
|
825
449
|
" "
|
|
826
450
|
] })
|
|
827
|
-
] }) : /* @__PURE__ */ p(
|
|
828
|
-
c && /* @__PURE__ */ p(
|
|
451
|
+
] }) : /* @__PURE__ */ p(M, { children: [
|
|
452
|
+
c && /* @__PURE__ */ p(Y, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
|
|
829
453
|
/* @__PURE__ */ o(rt, {}),
|
|
830
454
|
" "
|
|
831
455
|
] }),
|
|
832
|
-
/* @__PURE__ */ o(
|
|
456
|
+
/* @__PURE__ */ o(P, { variant: "h6", color: "inherit", component: "div", children: r })
|
|
833
457
|
] }) })),
|
|
834
458
|
e
|
|
835
459
|
]
|
|
836
460
|
}
|
|
837
461
|
);
|
|
838
462
|
}
|
|
839
|
-
const
|
|
463
|
+
const kn = H($, {
|
|
840
464
|
shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
|
|
841
465
|
name: "PanelAwareMargins"
|
|
842
466
|
})(({ theme: e, leftPanel: t, rightPanel: n }) => {
|
|
@@ -859,7 +483,7 @@ const In = R($, {
|
|
|
859
483
|
}),
|
|
860
484
|
marginRight: `${(r = n == null ? void 0 : n.width) != null ? r : 0}px`
|
|
861
485
|
});
|
|
862
|
-
}),
|
|
486
|
+
}), Dn = H(Je, {
|
|
863
487
|
name: "PageContainer"
|
|
864
488
|
})(({ theme: e }) => ({
|
|
865
489
|
// Horizontal padding comes from the Container's gutter
|
|
@@ -869,17 +493,17 @@ const In = R($, {
|
|
|
869
493
|
})), fe = !1, me = !1, ee = {
|
|
870
494
|
titleText: "",
|
|
871
495
|
flavour: "push",
|
|
872
|
-
width:
|
|
496
|
+
width: ft,
|
|
873
497
|
arrowButtons: "both",
|
|
874
498
|
startOpen: !1,
|
|
875
499
|
open: void 0,
|
|
876
500
|
onChangeOpen: void 0,
|
|
877
|
-
content: /* @__PURE__ */ o(
|
|
501
|
+
content: /* @__PURE__ */ o(M, {}),
|
|
878
502
|
onOpened: void 0,
|
|
879
503
|
onClosed: void 0,
|
|
880
504
|
dataTestId: void 0
|
|
881
505
|
};
|
|
882
|
-
function
|
|
506
|
+
function Fo({
|
|
883
507
|
children: e,
|
|
884
508
|
titleText: t = "",
|
|
885
509
|
leftPanel: n,
|
|
@@ -890,18 +514,18 @@ function Po({
|
|
|
890
514
|
pageContentDataTestId: d,
|
|
891
515
|
topBarDataTestId: l,
|
|
892
516
|
navBarOpen: u,
|
|
893
|
-
navBarWidthOpen:
|
|
517
|
+
navBarWidthOpen: v,
|
|
894
518
|
navBarWidthClosed: C
|
|
895
519
|
}) {
|
|
896
|
-
const [
|
|
897
|
-
titleText:
|
|
520
|
+
const [w, g] = E(fe), [D, A] = E(me), [k, I] = E(fe), [T, b] = E(me), y = n !== void 0, L = i !== void 0, {
|
|
521
|
+
titleText: O,
|
|
898
522
|
content: W,
|
|
899
523
|
flavour: h,
|
|
900
524
|
open: f,
|
|
901
|
-
onChangeOpen:
|
|
525
|
+
onChangeOpen: F,
|
|
902
526
|
width: m,
|
|
903
|
-
arrowButtons:
|
|
904
|
-
startOpen:
|
|
527
|
+
arrowButtons: x,
|
|
528
|
+
startOpen: _,
|
|
905
529
|
onOpened: se,
|
|
906
530
|
onClosed: $t,
|
|
907
531
|
dataTestId: It
|
|
@@ -914,22 +538,22 @@ function Po({
|
|
|
914
538
|
width: ce,
|
|
915
539
|
arrowButtons: J,
|
|
916
540
|
startOpen: Z,
|
|
917
|
-
onOpened:
|
|
918
|
-
onClosed:
|
|
541
|
+
onOpened: Bt,
|
|
542
|
+
onClosed: Et,
|
|
919
543
|
dataTestId: Ft
|
|
920
544
|
} = i ? s(s({}, ee), i) : s({}, ee);
|
|
921
545
|
oe(() => {
|
|
922
|
-
|
|
923
|
-
}, [
|
|
924
|
-
Z !== me && (
|
|
546
|
+
_ !== fe && (g(_), I(_));
|
|
547
|
+
}, [_]), oe(() => {
|
|
548
|
+
Z !== me && (A(Z), b(Z));
|
|
925
549
|
}, [Z]);
|
|
926
|
-
const de = f === void 0 ?
|
|
927
|
-
f === void 0 && (g(z), r &&
|
|
550
|
+
const de = f === void 0 ? w : f, ue = le === void 0 ? D : le, $e = (z) => {
|
|
551
|
+
f === void 0 && (g(z), r && L && (z ? (A(!1), b(D)) : A(T))), F && F(z);
|
|
928
552
|
}, Ie = (z) => {
|
|
929
|
-
le === void 0 && (
|
|
553
|
+
le === void 0 && (A(z), r && y && (z ? (g(!1), I(w)) : g(k))), ye && ye(z);
|
|
930
554
|
};
|
|
931
555
|
return /* @__PURE__ */ p($, { children: [
|
|
932
|
-
|
|
556
|
+
y && /* @__PURE__ */ o(
|
|
933
557
|
Re,
|
|
934
558
|
{
|
|
935
559
|
"data-testid": It,
|
|
@@ -937,18 +561,18 @@ function Po({
|
|
|
937
561
|
open: de,
|
|
938
562
|
onClose: () => $e(!1),
|
|
939
563
|
width: m,
|
|
940
|
-
titleText:
|
|
564
|
+
titleText: O,
|
|
941
565
|
debugOpacity: a,
|
|
942
|
-
showCloseArrow:
|
|
566
|
+
showCloseArrow: x === "both" || x === "close",
|
|
943
567
|
onOpened: se,
|
|
944
568
|
onClosed: $t,
|
|
945
569
|
navBarOpen: u,
|
|
946
|
-
navBarWidthOpen:
|
|
570
|
+
navBarWidthOpen: v,
|
|
947
571
|
navBarWidthClosed: C,
|
|
948
572
|
children: W
|
|
949
573
|
}
|
|
950
574
|
),
|
|
951
|
-
|
|
575
|
+
L && /* @__PURE__ */ o(
|
|
952
576
|
Re,
|
|
953
577
|
{
|
|
954
578
|
"data-testid": Ft,
|
|
@@ -959,27 +583,27 @@ function Po({
|
|
|
959
583
|
titleText: Tt,
|
|
960
584
|
debugOpacity: a,
|
|
961
585
|
showCloseArrow: J === "both" || J === "close",
|
|
962
|
-
onOpened:
|
|
963
|
-
onClosed:
|
|
586
|
+
onOpened: Bt,
|
|
587
|
+
onClosed: Et,
|
|
964
588
|
navBarOpen: u,
|
|
965
|
-
navBarWidthOpen:
|
|
589
|
+
navBarWidthOpen: v,
|
|
966
590
|
navBarWidthClosed: C,
|
|
967
591
|
children: Ot
|
|
968
592
|
}
|
|
969
593
|
),
|
|
970
594
|
/* @__PURE__ */ o(
|
|
971
|
-
|
|
595
|
+
An,
|
|
972
596
|
s(s({
|
|
973
597
|
titleText: t,
|
|
974
598
|
"data-testid": l
|
|
975
|
-
},
|
|
599
|
+
}, y && h === "push" ? {
|
|
976
600
|
leftPanel: {
|
|
977
601
|
open: de,
|
|
978
602
|
width: m,
|
|
979
603
|
onOpen: () => $e(!0),
|
|
980
|
-
showOpenArrow:
|
|
604
|
+
showOpenArrow: x === "both" || x === "open"
|
|
981
605
|
}
|
|
982
|
-
} : {}),
|
|
606
|
+
} : {}), L && De === "push" ? {
|
|
983
607
|
rightPanel: {
|
|
984
608
|
open: ue,
|
|
985
609
|
width: ce,
|
|
@@ -989,7 +613,7 @@ function Po({
|
|
|
989
613
|
} : {})
|
|
990
614
|
),
|
|
991
615
|
/* @__PURE__ */ o(
|
|
992
|
-
|
|
616
|
+
kn,
|
|
993
617
|
S(s(s({}, h === "push" ? {
|
|
994
618
|
leftPanel: {
|
|
995
619
|
open: de,
|
|
@@ -1001,19 +625,19 @@ function Po({
|
|
|
1001
625
|
width: ce
|
|
1002
626
|
}
|
|
1003
627
|
} : {}), {
|
|
1004
|
-
children: /* @__PURE__ */ o(
|
|
628
|
+
children: /* @__PURE__ */ o(Dn, S(s({ "data-testid": d }, c), { children: e }))
|
|
1005
629
|
})
|
|
1006
630
|
)
|
|
1007
631
|
] });
|
|
1008
632
|
}
|
|
1009
|
-
const
|
|
633
|
+
const mt = () => {
|
|
1010
634
|
const e = ae();
|
|
1011
|
-
return
|
|
1012
|
-
},
|
|
1013
|
-
function
|
|
635
|
+
return _t(e.breakpoints.down("sm"));
|
|
636
|
+
}, yn = 64, $n = 72, In = 256, K = R(!0), Ct = R(In), xt = R($n), xe = R(""), Tn = R(void 0), vt = R(yn), wt = R(void 0);
|
|
637
|
+
function On({ links: e }) {
|
|
1014
638
|
return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
|
|
1015
639
|
}
|
|
1016
|
-
const te = "Navbar",
|
|
640
|
+
const te = "Navbar", Q = {
|
|
1017
641
|
root: `${te}-root`,
|
|
1018
642
|
menuButton: `${te}-menuButton`,
|
|
1019
643
|
hide: `${te}-hide`,
|
|
@@ -1021,17 +645,17 @@ const te = "Navbar", X = {
|
|
|
1021
645
|
// userInfoHolder: `${PREFIX}-userInfoHolder`,
|
|
1022
646
|
// settings: `${PREFIX}-settings`,
|
|
1023
647
|
// pieChartIcon: `${PREFIX}-pieChartIcon`,
|
|
1024
|
-
},
|
|
1025
|
-
[`&.${
|
|
648
|
+
}, Bn = H($, { name: "NavBar" })(({ theme: e }) => ({
|
|
649
|
+
[`&.${Q.root}`]: {
|
|
1026
650
|
display: "flex"
|
|
1027
651
|
},
|
|
1028
|
-
[`& .${
|
|
652
|
+
[`& .${Q.menuButton}`]: {
|
|
1029
653
|
marginRight: 36
|
|
1030
654
|
},
|
|
1031
|
-
[`& .${
|
|
655
|
+
[`& .${Q.hide}`]: {
|
|
1032
656
|
display: "none"
|
|
1033
657
|
},
|
|
1034
|
-
[`& .${
|
|
658
|
+
[`& .${Q.content}`]: {
|
|
1035
659
|
flexGrow: 1,
|
|
1036
660
|
padding: e.spacing(3)
|
|
1037
661
|
}
|
|
@@ -1043,10 +667,10 @@ const te = "Navbar", X = {
|
|
|
1043
667
|
})), re = (e, t, n) => e.transitions.create(t, {
|
|
1044
668
|
easing: e.transitions.easing.sharp,
|
|
1045
669
|
duration: n === "leaving" ? e.transitions.duration.leavingScreen : e.transitions.duration.enteringScreen
|
|
1046
|
-
}),
|
|
670
|
+
}), En = (e) => {
|
|
1047
671
|
const t = ae();
|
|
1048
672
|
return /* @__PURE__ */ o(
|
|
1049
|
-
|
|
673
|
+
Mt,
|
|
1050
674
|
s({
|
|
1051
675
|
easing: t.transitions.easing.sharp,
|
|
1052
676
|
timeout: {
|
|
@@ -1055,7 +679,7 @@ const te = "Navbar", X = {
|
|
|
1055
679
|
}
|
|
1056
680
|
}, e)
|
|
1057
681
|
);
|
|
1058
|
-
},
|
|
682
|
+
}, At = (e) => {
|
|
1059
683
|
var t, n;
|
|
1060
684
|
return {
|
|
1061
685
|
overflowX: "hidden",
|
|
@@ -1066,10 +690,10 @@ const te = "Navbar", X = {
|
|
|
1066
690
|
}, He = (e, t) => s({
|
|
1067
691
|
width: t,
|
|
1068
692
|
transition: re(e, "width", "entering")
|
|
1069
|
-
},
|
|
693
|
+
}, At(e)), We = (e, t) => s({
|
|
1070
694
|
width: t,
|
|
1071
695
|
transition: re(e, "width", "leaving")
|
|
1072
|
-
},
|
|
696
|
+
}, At(e)), Fn = H(ve, {
|
|
1073
697
|
shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
|
|
1074
698
|
})(({ theme: e, open: t, widthOpen: n, widthClosed: i, isSmallScreen: r }) => s(s({
|
|
1075
699
|
flexShrink: 0,
|
|
@@ -1084,7 +708,7 @@ const te = "Navbar", X = {
|
|
|
1084
708
|
backgroundColor: "",
|
|
1085
709
|
"& .MuiDrawer-paper": We(e, r ? n : i)
|
|
1086
710
|
})));
|
|
1087
|
-
function
|
|
711
|
+
function Pn(e) {
|
|
1088
712
|
let t = 0;
|
|
1089
713
|
for (let n = 0, i = e.length; n < i; n++) {
|
|
1090
714
|
const r = e.charCodeAt(n);
|
|
@@ -1092,8 +716,8 @@ function Mn(e) {
|
|
|
1092
716
|
}
|
|
1093
717
|
return t;
|
|
1094
718
|
}
|
|
1095
|
-
const ze = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"],
|
|
1096
|
-
function
|
|
719
|
+
const ze = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Nn = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
|
|
720
|
+
function Ln({ user: e, domainCode: t, open: n }) {
|
|
1097
721
|
const i = ae();
|
|
1098
722
|
return /* @__PURE__ */ p(
|
|
1099
723
|
$,
|
|
@@ -1114,208 +738,587 @@ function Hn({ user: e, domainCode: t, open: n }) {
|
|
|
1114
738
|
transition: n ? re(i, ["width", "height"], "entering") : re(i, ["width", "height"], "leaving"),
|
|
1115
739
|
aspectRatio: 1
|
|
1116
740
|
},
|
|
1117
|
-
children: e != null && e.name ? /* @__PURE__ */ o(
|
|
1118
|
-
Fe,
|
|
1119
|
-
{
|
|
1120
|
-
src: e == null ? void 0 : e.picture,
|
|
1121
|
-
sx: {
|
|
1122
|
-
width: "100%",
|
|
1123
|
-
height: "100%",
|
|
1124
|
-
bgcolor: ze[Math.abs(
|
|
1125
|
-
},
|
|
1126
|
-
children:
|
|
1127
|
-
}
|
|
1128
|
-
) : /* @__PURE__ */ o(Fe, { sx: { width: "100%", height: "100%" } })
|
|
741
|
+
children: e != null && e.name ? /* @__PURE__ */ o(
|
|
742
|
+
Fe,
|
|
743
|
+
{
|
|
744
|
+
src: e == null ? void 0 : e.picture,
|
|
745
|
+
sx: {
|
|
746
|
+
width: "100%",
|
|
747
|
+
height: "100%",
|
|
748
|
+
bgcolor: ze[Math.abs(Pn(e.name)) % ze.length]
|
|
749
|
+
},
|
|
750
|
+
children: Nn(e.name)
|
|
751
|
+
}
|
|
752
|
+
) : /* @__PURE__ */ o(Fe, { sx: { width: "100%", height: "100%" } })
|
|
753
|
+
}
|
|
754
|
+
),
|
|
755
|
+
/* @__PURE__ */ o(En, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Rt, { in: n, children: /* @__PURE__ */ p($, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
|
|
756
|
+
e != null && e.name ? /* @__PURE__ */ o(P, { children: e.name }) : /* @__PURE__ */ o(Pe, { animation: !1, width: "50%" }),
|
|
757
|
+
t ? /* @__PURE__ */ o(P, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Pe, { animation: !1, width: "25%" })
|
|
758
|
+
] }) }) })
|
|
759
|
+
]
|
|
760
|
+
}
|
|
761
|
+
);
|
|
762
|
+
}
|
|
763
|
+
function _n({
|
|
764
|
+
open: e,
|
|
765
|
+
widthClosed: t,
|
|
766
|
+
widthOpen: n,
|
|
767
|
+
"data-testid": i,
|
|
768
|
+
top: r,
|
|
769
|
+
middle: a,
|
|
770
|
+
bottom: c,
|
|
771
|
+
user: d,
|
|
772
|
+
domainCode: l
|
|
773
|
+
}) {
|
|
774
|
+
const u = mt(), v = st(K);
|
|
775
|
+
return /* @__PURE__ */ o(Bn, { className: Q.root, "data-testid": i, children: /* @__PURE__ */ p(
|
|
776
|
+
Fn,
|
|
777
|
+
{
|
|
778
|
+
open: e,
|
|
779
|
+
widthOpen: n,
|
|
780
|
+
widthClosed: t,
|
|
781
|
+
anchor: "left",
|
|
782
|
+
variant: u ? "temporary" : "permanent",
|
|
783
|
+
PaperProps: {
|
|
784
|
+
component: "nav"
|
|
785
|
+
},
|
|
786
|
+
onClose: () => {
|
|
787
|
+
v(!1);
|
|
788
|
+
},
|
|
789
|
+
isSmallScreen: u,
|
|
790
|
+
children: [
|
|
791
|
+
!u && /* @__PURE__ */ o(Ht, {}),
|
|
792
|
+
r && /* @__PURE__ */ p($, { flexGrow: "0", children: [
|
|
793
|
+
r,
|
|
794
|
+
/* @__PURE__ */ o(Ne, { variant: "middle", sx: { marginY: "0.5rem" } })
|
|
795
|
+
] }),
|
|
796
|
+
/* @__PURE__ */ o($, { flexGrow: "1", children: Array.isArray(a) ? /* @__PURE__ */ o(On, { links: a }) : a }),
|
|
797
|
+
/* @__PURE__ */ p($, { flexGrow: "0", children: [
|
|
798
|
+
/* @__PURE__ */ o(Ne, { variant: "middle", sx: { marginY: "0.5rem" } }),
|
|
799
|
+
/* @__PURE__ */ o(Ln, { user: d, domainCode: l, open: e }),
|
|
800
|
+
c && /* @__PURE__ */ o(M, { children: c })
|
|
801
|
+
] })
|
|
802
|
+
]
|
|
803
|
+
}
|
|
804
|
+
) });
|
|
805
|
+
}
|
|
806
|
+
function Mn({
|
|
807
|
+
children: e,
|
|
808
|
+
topBarHeight: t,
|
|
809
|
+
maxWidth: n = !1,
|
|
810
|
+
noPadding: i
|
|
811
|
+
}) {
|
|
812
|
+
return /* @__PURE__ */ o(
|
|
813
|
+
$,
|
|
814
|
+
{
|
|
815
|
+
sx: {
|
|
816
|
+
overflow: "auto",
|
|
817
|
+
height: `calc(100vh - ${t}px)`,
|
|
818
|
+
scrollbarGutter: "stable",
|
|
819
|
+
// scrollbarGutter: 'stable both-edges',
|
|
820
|
+
flexGrow: 1
|
|
821
|
+
},
|
|
822
|
+
children: i ? /* @__PURE__ */ o($, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ o(
|
|
823
|
+
Je,
|
|
824
|
+
{
|
|
825
|
+
component: "main",
|
|
826
|
+
id: "main-content",
|
|
827
|
+
maxWidth: n,
|
|
828
|
+
sx: { paddingTop: 3, paddingBottom: 3, flexGrow: 1 },
|
|
829
|
+
children: e
|
|
830
|
+
}
|
|
831
|
+
)
|
|
832
|
+
}
|
|
833
|
+
);
|
|
834
|
+
}
|
|
835
|
+
const Rn = "TopBar", Hn = {
|
|
836
|
+
titleText: `${Rn}-titleText`
|
|
837
|
+
};
|
|
838
|
+
function Wn({
|
|
839
|
+
titleText: e = "",
|
|
840
|
+
height: t,
|
|
841
|
+
"data-testid": n,
|
|
842
|
+
middle: i
|
|
843
|
+
}) {
|
|
844
|
+
const r = st(K), a = () => r((l) => !l), c = ae(), d = mt();
|
|
845
|
+
return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ p(
|
|
846
|
+
Ke,
|
|
847
|
+
{
|
|
848
|
+
square: !0,
|
|
849
|
+
elevation: 0,
|
|
850
|
+
sx: {
|
|
851
|
+
width: "100%",
|
|
852
|
+
position: "sticky",
|
|
853
|
+
color: "primary.contrastText",
|
|
854
|
+
backgroundColor: "primary.main",
|
|
855
|
+
display: "flex",
|
|
856
|
+
alignItems: "center",
|
|
857
|
+
gap: 2,
|
|
858
|
+
flexShrink: 0,
|
|
859
|
+
height: t,
|
|
860
|
+
zIndex: d ? 0 : c.zIndex.drawer + 1
|
|
861
|
+
},
|
|
862
|
+
children: [
|
|
863
|
+
/* @__PURE__ */ o(
|
|
864
|
+
Y,
|
|
865
|
+
{
|
|
866
|
+
size: "medium",
|
|
867
|
+
color: "inherit",
|
|
868
|
+
sx: { padding: 1.5, marginLeft: "12px" },
|
|
869
|
+
onClick: a,
|
|
870
|
+
children: /* @__PURE__ */ o(Jt, { fontSize: "medium" })
|
|
871
|
+
}
|
|
872
|
+
),
|
|
873
|
+
/* @__PURE__ */ o(P, { className: Hn.titleText, variant: "h6", children: e }),
|
|
874
|
+
i
|
|
875
|
+
]
|
|
876
|
+
}
|
|
877
|
+
) });
|
|
878
|
+
}
|
|
879
|
+
function Po({
|
|
880
|
+
children: e,
|
|
881
|
+
initialTitleText: t,
|
|
882
|
+
initialNavBarOpen: n,
|
|
883
|
+
pageContainerProps: i,
|
|
884
|
+
pageContentDataTestId: r,
|
|
885
|
+
topBarDataTestId: a,
|
|
886
|
+
navBarDataTestId: c,
|
|
887
|
+
navBarMiddle: d,
|
|
888
|
+
navBarBottom: l,
|
|
889
|
+
user: u,
|
|
890
|
+
domainCode: v
|
|
891
|
+
}) {
|
|
892
|
+
ct([
|
|
893
|
+
[K, n != null ? n : !0],
|
|
894
|
+
[xe, t != null ? t : ""]
|
|
895
|
+
]);
|
|
896
|
+
const C = Le(K), [w] = V(Ct), [g] = V(xt), D = Le(xe), [A] = V(vt), [k] = V(Tn), [I] = V(wt);
|
|
897
|
+
return /* @__PURE__ */ p($, { children: [
|
|
898
|
+
/* @__PURE__ */ o(Wt, {}),
|
|
899
|
+
/* @__PURE__ */ o(
|
|
900
|
+
Wn,
|
|
901
|
+
{
|
|
902
|
+
titleText: D,
|
|
903
|
+
"data-testid": a,
|
|
904
|
+
height: A,
|
|
905
|
+
middle: k
|
|
906
|
+
}
|
|
907
|
+
),
|
|
908
|
+
/* @__PURE__ */ p($, { sx: { display: "flex" }, children: [
|
|
909
|
+
/* @__PURE__ */ o(
|
|
910
|
+
_n,
|
|
911
|
+
{
|
|
912
|
+
open: C,
|
|
913
|
+
top: I,
|
|
914
|
+
middle: d,
|
|
915
|
+
bottom: l,
|
|
916
|
+
user: u,
|
|
917
|
+
domainCode: v,
|
|
918
|
+
widthOpen: w,
|
|
919
|
+
widthClosed: g,
|
|
920
|
+
offsetTop: A,
|
|
921
|
+
"data-testid": c
|
|
922
|
+
}
|
|
923
|
+
),
|
|
924
|
+
/* @__PURE__ */ o(
|
|
925
|
+
Mn,
|
|
926
|
+
S(s({
|
|
927
|
+
"data-testid": r,
|
|
928
|
+
topBarHeight: A
|
|
929
|
+
}, i), {
|
|
930
|
+
children: e
|
|
931
|
+
})
|
|
932
|
+
)
|
|
933
|
+
] })
|
|
934
|
+
] });
|
|
935
|
+
}
|
|
936
|
+
const bt = ({
|
|
937
|
+
isOpen: e,
|
|
938
|
+
dialogTitle: t,
|
|
939
|
+
children: n,
|
|
940
|
+
maxWidth: i,
|
|
941
|
+
primaryButton: r,
|
|
942
|
+
secondaryButton: a,
|
|
943
|
+
onClose: c,
|
|
944
|
+
sx: d,
|
|
945
|
+
"data-testid": l,
|
|
946
|
+
disableCloseOnBackdropOrEscape: u = !1,
|
|
947
|
+
isLoading: v = !1
|
|
948
|
+
}) => {
|
|
949
|
+
var g, D;
|
|
950
|
+
const [C, w] = E(!1);
|
|
951
|
+
return /* @__PURE__ */ p(
|
|
952
|
+
Ze,
|
|
953
|
+
{
|
|
954
|
+
open: e,
|
|
955
|
+
onClose: (A, k) => N(void 0, null, function* () {
|
|
956
|
+
u && (k === "backdropClick" || k === "escapeKeyDown") || C || (a != null && a.onClick ? yield a.onClick() : c());
|
|
957
|
+
}),
|
|
958
|
+
fullWidth: !0,
|
|
959
|
+
maxWidth: i != null ? i : "xs",
|
|
960
|
+
"data-testid": l,
|
|
961
|
+
sx: d,
|
|
962
|
+
children: [
|
|
963
|
+
v && /* @__PURE__ */ o(je, { sx: { height: "4px", marginBottom: "-4px" } }),
|
|
964
|
+
/* @__PURE__ */ o(et, { children: t }),
|
|
965
|
+
/* @__PURE__ */ o(tt, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
|
|
966
|
+
/* @__PURE__ */ p(nt, { children: [
|
|
967
|
+
/* @__PURE__ */ o(
|
|
968
|
+
ie,
|
|
969
|
+
{
|
|
970
|
+
onClick: (g = a == null ? void 0 : a.onClick) != null ? g : c,
|
|
971
|
+
"data-testid": a == null ? void 0 : a.testId,
|
|
972
|
+
disabled: (a == null ? void 0 : a.disabled) || C,
|
|
973
|
+
color: a == null ? void 0 : a.buttonColor,
|
|
974
|
+
children: (D = a == null ? void 0 : a.text) != null ? D : "Cancel"
|
|
975
|
+
}
|
|
976
|
+
),
|
|
977
|
+
r && /* @__PURE__ */ o(
|
|
978
|
+
ie,
|
|
979
|
+
{
|
|
980
|
+
onClick: () => N(void 0, null, function* () {
|
|
981
|
+
var A;
|
|
982
|
+
w(!0), yield (A = r.onClick) == null ? void 0 : A.call(r), w(!1);
|
|
983
|
+
}),
|
|
984
|
+
"data-testid": r.testId,
|
|
985
|
+
disabled: r.disabled || C,
|
|
986
|
+
color: r == null ? void 0 : r.buttonColor,
|
|
987
|
+
children: r.text
|
|
988
|
+
}
|
|
989
|
+
)
|
|
990
|
+
] })
|
|
991
|
+
]
|
|
992
|
+
}
|
|
993
|
+
);
|
|
994
|
+
}, St = ({
|
|
995
|
+
minLength: e,
|
|
996
|
+
preLoadedOptions: t,
|
|
997
|
+
lookup: n,
|
|
998
|
+
label: i,
|
|
999
|
+
inputValue: r
|
|
1000
|
+
}) => on({
|
|
1001
|
+
queryFn: () => e && r.length < e ? t != null ? t : [] : t ? t.filter(
|
|
1002
|
+
(a) => a.label.toLowerCase().includes(r.toLowerCase())
|
|
1003
|
+
) : n(r),
|
|
1004
|
+
queryKey: ["autocomplete", i, r]
|
|
1005
|
+
});
|
|
1006
|
+
function No({
|
|
1007
|
+
lookup: e = () => N(this, null, function* () {
|
|
1008
|
+
}),
|
|
1009
|
+
enableHighlighting: t = !0,
|
|
1010
|
+
onChange: n,
|
|
1011
|
+
minLength: i = 0,
|
|
1012
|
+
label: r,
|
|
1013
|
+
value: a,
|
|
1014
|
+
"data-testid": c,
|
|
1015
|
+
sx: d,
|
|
1016
|
+
boxSx: l,
|
|
1017
|
+
textFieldColor: u,
|
|
1018
|
+
textFieldVariant: v = "filled",
|
|
1019
|
+
loadingText: C = "Loading...",
|
|
1020
|
+
noOptionsText: w = "No options",
|
|
1021
|
+
popupIcon: g = /* @__PURE__ */ o(jt, {}),
|
|
1022
|
+
error: D = !1,
|
|
1023
|
+
helperText: A = "",
|
|
1024
|
+
preLoadedOptions: k = void 0,
|
|
1025
|
+
disablePortal: I = !1
|
|
1026
|
+
}) {
|
|
1027
|
+
const [T, b] = E(""), y = (h, f) => {
|
|
1028
|
+
const F = a.filter((m) => m.id !== f);
|
|
1029
|
+
n(F, "delete", h);
|
|
1030
|
+
}, { data: L, isLoading: O } = St({
|
|
1031
|
+
inputValue: T,
|
|
1032
|
+
label: r,
|
|
1033
|
+
lookup: e,
|
|
1034
|
+
minLength: i,
|
|
1035
|
+
preLoadedOptions: k
|
|
1036
|
+
}), W = T.length >= i;
|
|
1037
|
+
return /* @__PURE__ */ p("div", { "data-testid": c, children: [
|
|
1038
|
+
/* @__PURE__ */ o(
|
|
1039
|
+
Ae,
|
|
1040
|
+
{
|
|
1041
|
+
sx: d,
|
|
1042
|
+
"data-testid": c ? `${c}:Autocomplete` : void 0,
|
|
1043
|
+
disablePortal: I,
|
|
1044
|
+
multiple: !0,
|
|
1045
|
+
getOptionLabel: (h) => typeof h == "string" ? h : h.label,
|
|
1046
|
+
loading: W ? O : !1,
|
|
1047
|
+
options: [...a, ...L != null ? L : []],
|
|
1048
|
+
filterSelectedOptions: !0,
|
|
1049
|
+
includeInputInList: !0,
|
|
1050
|
+
value: a,
|
|
1051
|
+
onChange: (h, f, F) => {
|
|
1052
|
+
n(f, F, h);
|
|
1053
|
+
},
|
|
1054
|
+
onInputChange: (h, f) => b(f),
|
|
1055
|
+
noOptionsText: W ? w : "Start typing to search",
|
|
1056
|
+
loadingText: C,
|
|
1057
|
+
popupIcon: g,
|
|
1058
|
+
renderInput: (h) => /* @__PURE__ */ o(
|
|
1059
|
+
be,
|
|
1060
|
+
S(s({}, h), {
|
|
1061
|
+
label: r,
|
|
1062
|
+
fullWidth: !0,
|
|
1063
|
+
variant: v,
|
|
1064
|
+
error: D,
|
|
1065
|
+
helperText: A,
|
|
1066
|
+
InputProps: S(s({}, h.InputProps), {
|
|
1067
|
+
endAdornment: /* @__PURE__ */ p(M, { children: [
|
|
1068
|
+
O ? /* @__PURE__ */ o(Se, { color: "inherit", size: 20 }) : null,
|
|
1069
|
+
h.InputProps.endAdornment
|
|
1070
|
+
] })
|
|
1071
|
+
}),
|
|
1072
|
+
"data-testid": c ? `${c}:Autocomplete:TextField` : void 0,
|
|
1073
|
+
onKeyDown: (f) => {
|
|
1074
|
+
(f.key === "Backspace" || f.key === "Delete") && f.stopPropagation();
|
|
1075
|
+
},
|
|
1076
|
+
color: u
|
|
1077
|
+
})
|
|
1078
|
+
),
|
|
1079
|
+
renderTags: () => null,
|
|
1080
|
+
isOptionEqualToValue: (h, f) => h.id === f.id,
|
|
1081
|
+
renderOption: (h, f, F) => {
|
|
1082
|
+
if (t) {
|
|
1083
|
+
const m = tn(f.label, F.inputValue, {
|
|
1084
|
+
insideWords: !0,
|
|
1085
|
+
findAllOccurrences: !0
|
|
1086
|
+
}), x = nn(f.label, m);
|
|
1087
|
+
return /* @__PURE__ */ Ce(
|
|
1088
|
+
"li",
|
|
1089
|
+
S(s({}, h), {
|
|
1090
|
+
key: f.id,
|
|
1091
|
+
"data-testid": c ? `${c}:Autocomplete:option(${f.id.toString()})` : void 0
|
|
1092
|
+
}),
|
|
1093
|
+
/* @__PURE__ */ o("div", { children: x.map((_, se) => /* @__PURE__ */ o(
|
|
1094
|
+
"span",
|
|
1095
|
+
{
|
|
1096
|
+
style: {
|
|
1097
|
+
fontWeight: _.highlight ? 700 : 400
|
|
1098
|
+
},
|
|
1099
|
+
children: _.text
|
|
1100
|
+
},
|
|
1101
|
+
se
|
|
1102
|
+
)) })
|
|
1103
|
+
);
|
|
1104
|
+
} else
|
|
1105
|
+
return /* @__PURE__ */ Ce(
|
|
1106
|
+
"li",
|
|
1107
|
+
S(s({}, h), {
|
|
1108
|
+
key: f.id,
|
|
1109
|
+
"data-testid": c ? `${c}:option(${f.id.toString()})` : void 0
|
|
1110
|
+
}),
|
|
1111
|
+
f.label
|
|
1112
|
+
);
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
),
|
|
1116
|
+
a.length > 0 && /* @__PURE__ */ o($, { sx: l, children: a.map((h) => /* @__PURE__ */ o(
|
|
1117
|
+
zt,
|
|
1118
|
+
{
|
|
1119
|
+
sx: {
|
|
1120
|
+
marginTop: 1,
|
|
1121
|
+
marginRight: 1,
|
|
1122
|
+
height: "auto"
|
|
1123
|
+
},
|
|
1124
|
+
label: /* @__PURE__ */ o(
|
|
1125
|
+
Ut,
|
|
1126
|
+
{
|
|
1127
|
+
title: h.tooltipContent || "",
|
|
1128
|
+
placement: "bottom-start",
|
|
1129
|
+
PopperProps: {
|
|
1130
|
+
modifiers: [
|
|
1131
|
+
{
|
|
1132
|
+
name: "offset",
|
|
1133
|
+
options: {
|
|
1134
|
+
offset: [115, -15]
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
]
|
|
1138
|
+
},
|
|
1139
|
+
children: /* @__PURE__ */ o(P, { style: { whiteSpace: "normal" }, children: h.chipLabel ? h.chipLabel : h.label })
|
|
1129
1140
|
}
|
|
1130
1141
|
),
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1142
|
+
"data-testid": c ? `${c}:Chip(${h.id.toString()})` : void 0,
|
|
1143
|
+
onDelete: (f) => y(f, h.id),
|
|
1144
|
+
deleteIcon: /* @__PURE__ */ o(
|
|
1145
|
+
Zt,
|
|
1146
|
+
{
|
|
1147
|
+
"data-testid": c ? `${c}:Chip(${h.id.toString()}):deleteIcon` : void 0
|
|
1148
|
+
}
|
|
1149
|
+
)
|
|
1150
|
+
},
|
|
1151
|
+
h.id
|
|
1152
|
+
)) })
|
|
1153
|
+
] });
|
|
1138
1154
|
}
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1155
|
+
const Lo = ({
|
|
1156
|
+
lookup: e = () => N(void 0, null, function* () {
|
|
1157
|
+
}),
|
|
1158
|
+
onChange: t,
|
|
1159
|
+
label: n,
|
|
1160
|
+
value: i,
|
|
1161
|
+
sx: r,
|
|
1162
|
+
textFieldColor: a,
|
|
1163
|
+
textFieldVariant: c = "filled",
|
|
1164
|
+
"data-testid": d,
|
|
1165
|
+
noOptionsText: l = "No options",
|
|
1166
|
+
minLength: u = 3,
|
|
1167
|
+
disablePortal: v = !1,
|
|
1168
|
+
preLoadedOptions: C,
|
|
1169
|
+
helperText: w = "",
|
|
1170
|
+
disabled: g
|
|
1171
|
+
}) => {
|
|
1172
|
+
const [D, A] = E(""), { data: k, isLoading: I } = St({
|
|
1173
|
+
inputValue: D,
|
|
1174
|
+
label: n,
|
|
1175
|
+
lookup: e,
|
|
1176
|
+
minLength: u != null ? u : 0,
|
|
1177
|
+
preLoadedOptions: C
|
|
1178
|
+
}), T = D.length >= u;
|
|
1179
|
+
return /* @__PURE__ */ o("div", { "data-testid": d, children: /* @__PURE__ */ o(Gt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
|
|
1180
|
+
Ae,
|
|
1153
1181
|
{
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
component: "nav"
|
|
1182
|
+
sx: r,
|
|
1183
|
+
"data-testid": d ? `${d}:Autocomplete` : void 0,
|
|
1184
|
+
loading: T ? I : !1,
|
|
1185
|
+
options: k != null ? k : [],
|
|
1186
|
+
onChange: (b, y) => {
|
|
1187
|
+
t(b, y);
|
|
1161
1188
|
},
|
|
1162
|
-
|
|
1163
|
-
|
|
1189
|
+
disablePortal: v,
|
|
1190
|
+
filterOptions: (b) => b,
|
|
1191
|
+
value: i,
|
|
1192
|
+
noOptionsText: T ? l : "Start typing to search",
|
|
1193
|
+
getOptionLabel: (b) => b.label,
|
|
1194
|
+
renderInput: (b) => /* @__PURE__ */ o(
|
|
1195
|
+
be,
|
|
1196
|
+
S(s({
|
|
1197
|
+
"data-testid": d ? `${d}:Autocomplete:TextField` : void 0
|
|
1198
|
+
}, b), {
|
|
1199
|
+
variant: c,
|
|
1200
|
+
label: n,
|
|
1201
|
+
color: a,
|
|
1202
|
+
helperText: w
|
|
1203
|
+
})
|
|
1204
|
+
),
|
|
1205
|
+
isOptionEqualToValue: (b, y) => b.id === y.id,
|
|
1206
|
+
onInputChange: (b, y) => {
|
|
1207
|
+
A(y);
|
|
1164
1208
|
},
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
/* @__PURE__ */ o(Ne, { variant: "middle", sx: { marginY: "0.5rem" } }),
|
|
1175
|
-
/* @__PURE__ */ o(Hn, { user: d, domainCode: l, open: e }),
|
|
1176
|
-
c && /* @__PURE__ */ o(_, { children: c })
|
|
1177
|
-
] })
|
|
1178
|
-
]
|
|
1209
|
+
renderOption: (b, y) => /* @__PURE__ */ Ce(
|
|
1210
|
+
"li",
|
|
1211
|
+
S(s({}, b), {
|
|
1212
|
+
key: y.id,
|
|
1213
|
+
"data-testid": d ? `${d}:Autocomplete:option(${y.id.toString()})` : void 0
|
|
1214
|
+
}),
|
|
1215
|
+
y.label
|
|
1216
|
+
),
|
|
1217
|
+
disabled: g
|
|
1179
1218
|
}
|
|
1180
|
-
) });
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1219
|
+
) }) });
|
|
1220
|
+
}, zn = (e) => {
|
|
1221
|
+
if (!e)
|
|
1222
|
+
return -1;
|
|
1223
|
+
try {
|
|
1224
|
+
const n = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), i = decodeURIComponent(
|
|
1225
|
+
sn.from(n, "base64").toString("utf8").split("").map(function(a) {
|
|
1226
|
+
return "%" + ("00" + a.charCodeAt(0).toString(16)).slice(-2);
|
|
1227
|
+
}).join("")
|
|
1228
|
+
), r = JSON.parse(i);
|
|
1229
|
+
return r != null && r.exp ? r.exp : -1;
|
|
1230
|
+
} catch (t) {
|
|
1231
|
+
return -1;
|
|
1232
|
+
}
|
|
1233
|
+
}, _o = ({
|
|
1234
|
+
open: e = !1,
|
|
1235
|
+
closeHandler: t,
|
|
1236
|
+
setAuth0ExpiryTime: n
|
|
1237
|
+
}) => {
|
|
1238
|
+
const { logout: i, getAccessTokenSilently: r } = dt(), [a, c] = E(0), d = () => N(void 0, null, function* () {
|
|
1239
|
+
i({ logoutParams: { returnTo: `${window.location.origin}` } });
|
|
1240
|
+
}), l = () => N(void 0, null, function* () {
|
|
1241
|
+
c(a + 1), t();
|
|
1242
|
+
});
|
|
1243
|
+
return oe(() => {
|
|
1244
|
+
(() => N(void 0, null, function* () {
|
|
1245
|
+
if (a > 0) {
|
|
1246
|
+
const w = yield r({ cacheMode: "off" }), g = zn(w) * 1e3;
|
|
1247
|
+
n(g);
|
|
1248
|
+
}
|
|
1249
|
+
}))();
|
|
1250
|
+
}, [a, r, n]), /* @__PURE__ */ o(
|
|
1251
|
+
bt,
|
|
1190
1252
|
{
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1253
|
+
isOpen: e,
|
|
1254
|
+
primaryButton: {
|
|
1255
|
+
text: "Continue",
|
|
1256
|
+
onClick: l,
|
|
1257
|
+
disabled: !1,
|
|
1258
|
+
testId: "PreferencesDialog",
|
|
1259
|
+
buttonColor: "secondary"
|
|
1197
1260
|
},
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1261
|
+
secondaryButton: {
|
|
1262
|
+
text: "Log out",
|
|
1263
|
+
onClick: d,
|
|
1264
|
+
disabled: !1,
|
|
1265
|
+
testId: "PreferencesDialog",
|
|
1266
|
+
buttonColor: "secondary"
|
|
1267
|
+
},
|
|
1268
|
+
onClose: t,
|
|
1269
|
+
dialogTitle: "Session expiry",
|
|
1270
|
+
disableCloseOnBackdropOrEscape: !0,
|
|
1271
|
+
children: /* @__PURE__ */ o("p", { style: { marginBottom: 0 }, children: "Your session is about to time out due to inactivity. Do you want to continue?" })
|
|
1208
1272
|
}
|
|
1209
1273
|
);
|
|
1210
|
-
}
|
|
1211
|
-
const Un = "TopBar", Gn = {
|
|
1212
|
-
titleText: `${Un}-titleText`
|
|
1213
1274
|
};
|
|
1214
|
-
function
|
|
1215
|
-
|
|
1216
|
-
height: t,
|
|
1217
|
-
"data-testid": n,
|
|
1218
|
-
middle: i
|
|
1219
|
-
}) {
|
|
1220
|
-
const r = lt(Y), a = () => r((l) => !l), c = ae(), d = xt();
|
|
1221
|
-
return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ p(
|
|
1222
|
-
Ke,
|
|
1223
|
-
{
|
|
1224
|
-
square: !0,
|
|
1225
|
-
elevation: 0,
|
|
1226
|
-
sx: {
|
|
1227
|
-
width: "100%",
|
|
1228
|
-
position: "sticky",
|
|
1229
|
-
color: "primary.contrastText",
|
|
1230
|
-
backgroundColor: "primary.main",
|
|
1231
|
-
display: "flex",
|
|
1232
|
-
alignItems: "center",
|
|
1233
|
-
gap: 2,
|
|
1234
|
-
flexShrink: 0,
|
|
1235
|
-
height: t,
|
|
1236
|
-
zIndex: d ? 0 : c.zIndex.drawer + 1
|
|
1237
|
-
},
|
|
1238
|
-
children: [
|
|
1239
|
-
/* @__PURE__ */ o(
|
|
1240
|
-
Q,
|
|
1241
|
-
{
|
|
1242
|
-
size: "medium",
|
|
1243
|
-
color: "inherit",
|
|
1244
|
-
sx: { padding: 1.5, marginLeft: "12px" },
|
|
1245
|
-
onClick: a,
|
|
1246
|
-
children: /* @__PURE__ */ o(Zt, { fontSize: "medium" })
|
|
1247
|
-
}
|
|
1248
|
-
),
|
|
1249
|
-
/* @__PURE__ */ o(F, { className: Gn.titleText, variant: "h6", children: e }),
|
|
1250
|
-
i
|
|
1251
|
-
]
|
|
1252
|
-
}
|
|
1253
|
-
) });
|
|
1275
|
+
function Un(e) {
|
|
1276
|
+
return "error" in e;
|
|
1254
1277
|
}
|
|
1255
|
-
function
|
|
1278
|
+
function Gn(e) {
|
|
1279
|
+
return e.error === "access_denied";
|
|
1280
|
+
}
|
|
1281
|
+
function Vn(e) {
|
|
1282
|
+
var i;
|
|
1283
|
+
const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
|
|
1284
|
+
return t === "access_denied" && n.startsWith("You do not have the required authorization");
|
|
1285
|
+
}
|
|
1286
|
+
function qn(e) {
|
|
1287
|
+
var i;
|
|
1288
|
+
const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
|
|
1289
|
+
return t === "access_denied" && n.startsWith("User did not authorize the request");
|
|
1290
|
+
}
|
|
1291
|
+
function Mo({
|
|
1256
1292
|
children: e,
|
|
1257
|
-
|
|
1258
|
-
initialNavBarOpen: n,
|
|
1259
|
-
pageContainerProps: i,
|
|
1260
|
-
pageContentDataTestId: r,
|
|
1261
|
-
topBarDataTestId: a,
|
|
1262
|
-
navBarDataTestId: c,
|
|
1263
|
-
navBarMiddle: d,
|
|
1264
|
-
navBarBottom: l,
|
|
1265
|
-
user: u,
|
|
1266
|
-
domainCode: w
|
|
1293
|
+
appName: t = "the app"
|
|
1267
1294
|
}) {
|
|
1268
|
-
dt(
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
/* @__PURE__ */ o(
|
|
1276
|
-
Vn,
|
|
1277
|
-
{
|
|
1278
|
-
titleText: k,
|
|
1279
|
-
"data-testid": a,
|
|
1280
|
-
height: b,
|
|
1281
|
-
middle: D
|
|
1295
|
+
const { isAuthenticated: n, isLoading: i, error: r, loginWithRedirect: a, logout: c } = dt();
|
|
1296
|
+
if (oe(() => {
|
|
1297
|
+
if (i || n || r)
|
|
1298
|
+
return;
|
|
1299
|
+
const d = {
|
|
1300
|
+
appState: {
|
|
1301
|
+
returnTo: `${window.location.pathname}${window.location.search}`
|
|
1282
1302
|
}
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
widthOpen: A,
|
|
1295
|
-
widthClosed: g,
|
|
1296
|
-
offsetTop: b,
|
|
1297
|
-
"data-testid": c
|
|
1298
|
-
}
|
|
1299
|
-
),
|
|
1300
|
-
/* @__PURE__ */ o(
|
|
1301
|
-
zn,
|
|
1302
|
-
S(s({
|
|
1303
|
-
"data-testid": r,
|
|
1304
|
-
topBarHeight: b
|
|
1305
|
-
}, i), {
|
|
1306
|
-
children: e
|
|
1307
|
-
})
|
|
1308
|
-
)
|
|
1309
|
-
] })
|
|
1310
|
-
] });
|
|
1303
|
+
};
|
|
1304
|
+
a(d);
|
|
1305
|
+
}, [i, n, r, a]), r && Un(r)) {
|
|
1306
|
+
let d = "Auth error", l = "An unknown Auth0 error occurred.";
|
|
1307
|
+
return Vn(r) ? (d = "Unauthorised", l = `You are not authorised to access ${t}.`) : qn(r) ? (d = "App not authorised", l = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`) : Gn(r) && (d = "Unauthorised", l = "Authorisation with auth0 failed for an unknown reason."), /* @__PURE__ */ p(Ze, { open: !0, children: [
|
|
1308
|
+
/* @__PURE__ */ o(et, { children: d }),
|
|
1309
|
+
/* @__PURE__ */ o(tt, { children: /* @__PURE__ */ o(P, { children: l }) }),
|
|
1310
|
+
/* @__PURE__ */ o(nt, { children: /* @__PURE__ */ o(ie, { onClick: () => c({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
|
|
1311
|
+
] });
|
|
1312
|
+
}
|
|
1313
|
+
return n ? /* @__PURE__ */ o(M, { children: e }) : /* @__PURE__ */ o(ln, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
|
|
1311
1314
|
}
|
|
1312
|
-
const
|
|
1315
|
+
const Xn = {
|
|
1313
1316
|
autoHideDuration: 6e3,
|
|
1314
1317
|
anchorOrigin: { vertical: "top", horizontal: "center" },
|
|
1315
1318
|
// The default is false. If we prefer timer to continue when window loses
|
|
1316
1319
|
// focus, change to true
|
|
1317
1320
|
disableWindowBlurListener: !1
|
|
1318
|
-
},
|
|
1321
|
+
}, Qn = {
|
|
1319
1322
|
shouldClose: (e, t) => t !== "clickaway"
|
|
1320
1323
|
}, Ue = {
|
|
1321
1324
|
message: "",
|
|
@@ -1323,56 +1326,56 @@ const qn = {
|
|
|
1323
1326
|
variant: "standard",
|
|
1324
1327
|
progressIndicator: void 0
|
|
1325
1328
|
// Can use 'circular' or 'linear'
|
|
1326
|
-
}, Ge = 100, Ve = 2e3,
|
|
1329
|
+
}, Ge = 100, Ve = 2e3, Yn = 2e3, Kn = (() => {
|
|
1327
1330
|
let e = 0;
|
|
1328
1331
|
return () => (e += 1, e);
|
|
1329
|
-
})(),
|
|
1332
|
+
})(), Jn = {
|
|
1330
1333
|
borderBottomLeftRadius: "0px",
|
|
1331
1334
|
borderBottomRightRadius: "0px"
|
|
1332
|
-
},
|
|
1333
|
-
function
|
|
1335
|
+
}, Zn = {}, jn = {}, kt = Qe(null);
|
|
1336
|
+
function eo(a) {
|
|
1334
1337
|
var c = a, {
|
|
1335
|
-
overrideState: e =
|
|
1336
|
-
overrideActions: t =
|
|
1337
|
-
shouldClose: n =
|
|
1338
|
+
overrideState: e = Zn,
|
|
1339
|
+
overrideActions: t = jn,
|
|
1340
|
+
shouldClose: n = Qn.shouldClose,
|
|
1338
1341
|
children: i
|
|
1339
|
-
} = c, r =
|
|
1342
|
+
} = c, r = Be(c, [
|
|
1340
1343
|
"overrideState",
|
|
1341
1344
|
"overrideActions",
|
|
1342
1345
|
"shouldClose",
|
|
1343
1346
|
"children"
|
|
1344
1347
|
]);
|
|
1345
|
-
var
|
|
1346
|
-
const [{ open: d }, l] = E({ open: !1 }), u = he([]),
|
|
1348
|
+
var F;
|
|
1349
|
+
const [{ open: d }, l] = E({ open: !1 }), u = he([]), v = he(Date.now()), C = he(0), w = ne((m) => {
|
|
1347
1350
|
l({ open: m });
|
|
1348
1351
|
}, []), g = ne((m = {}) => {
|
|
1349
|
-
C.current += 1, u.current.length >= Ge && Date.now() -
|
|
1352
|
+
C.current += 1, u.current.length >= Ge && Date.now() - v.current >= Ve && (v.current = Date.now(), console.error(
|
|
1350
1353
|
`SaladBarProvider: MAX_QUEUE_LENGTH (${Ge}) hit ${C.current} times in last ${Ve}ms)`
|
|
1351
1354
|
), C.current = 0);
|
|
1352
|
-
const
|
|
1353
|
-
key:
|
|
1355
|
+
const x = s(S(s({}, Ue), {
|
|
1356
|
+
key: Kn()
|
|
1354
1357
|
}), m);
|
|
1355
|
-
return u.current.push(
|
|
1356
|
-
}, []),
|
|
1357
|
-
const
|
|
1358
|
-
if (
|
|
1359
|
-
return
|
|
1360
|
-
},
|
|
1361
|
-
n(m,
|
|
1362
|
-
},
|
|
1363
|
-
},
|
|
1358
|
+
return u.current.push(x), u.current.length === 1 && l({ open: !0 }), x.key;
|
|
1359
|
+
}, []), D = (m = "", x = {}) => g(s({ message: m, severity: "success" }, x)), A = (m = "", x = {}) => g(s({ message: m, severity: "info" }, x)), k = (m = "", x = {}) => g(s({ message: m, severity: "warning" }, x)), I = (m = "", x = {}) => g(s({ message: m, severity: "error" }, x)), T = (m) => {
|
|
1360
|
+
const x = u.current.findIndex((_) => _.key === m);
|
|
1361
|
+
if (x !== -1)
|
|
1362
|
+
return x === 0 ? (l({ open: !1 }), u.current[0]) : u.current.splice(x, 1);
|
|
1363
|
+
}, b = (m, x) => {
|
|
1364
|
+
n(m, x) && l({ open: !1 });
|
|
1365
|
+
}, y = () => {
|
|
1366
|
+
}, L = () => {
|
|
1364
1367
|
u.current.shift(), u.current.length > 0 && l({ open: !0 });
|
|
1365
|
-
},
|
|
1366
|
-
"autoHideDuration" in
|
|
1367
|
-
const h = s(s({},
|
|
1368
|
+
}, O = (F = u.current[0]) != null ? F : s({}, Ue), W = {};
|
|
1369
|
+
"autoHideDuration" in O && (W.autoHideDuration = O.autoHideDuration);
|
|
1370
|
+
const h = s(s({}, Xn), r), f = s(s({
|
|
1368
1371
|
open: d,
|
|
1369
|
-
setOpen:
|
|
1372
|
+
setOpen: w,
|
|
1370
1373
|
enqueueNotification: g,
|
|
1371
|
-
enqueueSuccessNotification:
|
|
1372
|
-
enqueueInfoNotification:
|
|
1373
|
-
enqueueWarningNotification:
|
|
1374
|
+
enqueueSuccessNotification: D,
|
|
1375
|
+
enqueueInfoNotification: A,
|
|
1376
|
+
enqueueWarningNotification: k,
|
|
1374
1377
|
enqueueErrorNotification: I,
|
|
1375
|
-
removeNotification:
|
|
1378
|
+
removeNotification: T
|
|
1376
1379
|
}, e), t);
|
|
1377
1380
|
return /* @__PURE__ */ p(kt.Provider, { value: f, children: [
|
|
1378
1381
|
i,
|
|
@@ -1380,51 +1383,51 @@ function jn(a) {
|
|
|
1380
1383
|
Vt,
|
|
1381
1384
|
S(s(s({}, h), W), {
|
|
1382
1385
|
open: d,
|
|
1383
|
-
onClose:
|
|
1386
|
+
onClose: b,
|
|
1384
1387
|
TransitionProps: {
|
|
1385
|
-
onExited:
|
|
1386
|
-
onExit:
|
|
1388
|
+
onExited: L,
|
|
1389
|
+
onExit: y
|
|
1387
1390
|
},
|
|
1388
|
-
sx: { zIndex:
|
|
1391
|
+
sx: { zIndex: Yn },
|
|
1389
1392
|
children: /* @__PURE__ */ p("div", { children: [
|
|
1390
1393
|
/* @__PURE__ */ o(
|
|
1391
1394
|
qt,
|
|
1392
1395
|
{
|
|
1393
|
-
onClose: (m) =>
|
|
1394
|
-
severity:
|
|
1396
|
+
onClose: (m) => b(m, "closeAlert"),
|
|
1397
|
+
severity: O.severity,
|
|
1395
1398
|
variant: "filled",
|
|
1396
|
-
icon:
|
|
1397
|
-
style:
|
|
1398
|
-
children:
|
|
1399
|
+
icon: O.progressIndicator === "circular" ? /* @__PURE__ */ o(Se, { size: "1em" }) : void 0,
|
|
1400
|
+
style: O.progressIndicator === "linear" ? Jn : void 0,
|
|
1401
|
+
children: O.message
|
|
1399
1402
|
}
|
|
1400
1403
|
),
|
|
1401
|
-
|
|
1404
|
+
O.progressIndicator === "linear" && /* @__PURE__ */ o(je, { color: "primary" })
|
|
1402
1405
|
] })
|
|
1403
1406
|
})
|
|
1404
1407
|
)
|
|
1405
1408
|
] });
|
|
1406
1409
|
}
|
|
1407
|
-
function
|
|
1410
|
+
function to() {
|
|
1408
1411
|
const e = Ye(kt);
|
|
1409
1412
|
if (e === null)
|
|
1410
1413
|
throw new ke("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
|
|
1411
1414
|
return e;
|
|
1412
1415
|
}
|
|
1413
|
-
const
|
|
1414
|
-
(e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(
|
|
1415
|
-
),
|
|
1416
|
+
const Ro = X(
|
|
1417
|
+
(e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(eo, S(s({}, e), { overrideState: t, overrideActions: n, children: i }))
|
|
1418
|
+
), no = en(), Ho = ({
|
|
1416
1419
|
children: e,
|
|
1417
1420
|
store: t
|
|
1418
|
-
}) => /* @__PURE__ */ o(
|
|
1421
|
+
}) => /* @__PURE__ */ o(lt, { store: t != null ? t : no, children: e }), Dt = "domainCode";
|
|
1419
1422
|
var Xe;
|
|
1420
|
-
const qe =
|
|
1423
|
+
const qe = R(
|
|
1421
1424
|
JSON.parse((Xe = localStorage.getItem(Dt)) != null ? Xe : '{"domainCode": ""}').domainCode
|
|
1422
|
-
), yt =
|
|
1425
|
+
), yt = R(
|
|
1423
1426
|
(e) => e(qe),
|
|
1424
1427
|
(e, t, n) => {
|
|
1425
1428
|
t(qe, n), localStorage.setItem(Dt, JSON.stringify({ domainCode: n }));
|
|
1426
1429
|
}
|
|
1427
|
-
),
|
|
1430
|
+
), oo = {
|
|
1428
1431
|
act: "ACT",
|
|
1429
1432
|
nsw: "NSW",
|
|
1430
1433
|
nt: "NT",
|
|
@@ -1436,10 +1439,10 @@ const qe = M(
|
|
|
1436
1439
|
ag: "AG",
|
|
1437
1440
|
fedmps: "Fedmps",
|
|
1438
1441
|
"": ""
|
|
1439
|
-
},
|
|
1442
|
+
}, io = (e) => {
|
|
1440
1443
|
var t;
|
|
1441
|
-
return e === null ? "N/A" : (t =
|
|
1442
|
-
},
|
|
1444
|
+
return e === null ? "N/A" : (t = oo[e]) != null ? t : "";
|
|
1445
|
+
}, Wo = ({
|
|
1443
1446
|
isLoading: e,
|
|
1444
1447
|
isOpen: t,
|
|
1445
1448
|
onClose: n,
|
|
@@ -1447,53 +1450,53 @@ const qe = M(
|
|
|
1447
1450
|
applicationName: r,
|
|
1448
1451
|
handleLogout: a
|
|
1449
1452
|
}) => {
|
|
1450
|
-
const [c, d] = V(yt), [l, u] = E(c), { enqueueSuccessNotification:
|
|
1451
|
-
l ? (d(l),
|
|
1452
|
-
}),
|
|
1453
|
-
c && !C && !
|
|
1453
|
+
const [c, d] = V(yt), [l, u] = E(c), { enqueueSuccessNotification: v } = to(), C = i.length === 0, w = !!c && !i.includes(c) && !i.includes(l), g = !c || C || w, D = () => N(void 0, null, function* () {
|
|
1454
|
+
l ? (d(l), v(`Set domain to ${l}`), n()) : d("");
|
|
1455
|
+
}), A = () => N(void 0, null, function* () {
|
|
1456
|
+
c && !C && !w ? (u(c), n()) : g && a();
|
|
1454
1457
|
});
|
|
1455
|
-
let
|
|
1456
|
-
return C ?
|
|
1457
|
-
|
|
1458
|
+
let k;
|
|
1459
|
+
return C ? k = "Unable to retrieve your active organisations. Try logging in again." : w && (k = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ p(
|
|
1460
|
+
bt,
|
|
1458
1461
|
{
|
|
1459
1462
|
isOpen: t,
|
|
1460
1463
|
dialogTitle: "Select an organisation",
|
|
1461
1464
|
primaryButton: {
|
|
1462
1465
|
text: "Confirm",
|
|
1463
|
-
onClick:
|
|
1464
|
-
disabled: !l || C ||
|
|
1466
|
+
onClick: D,
|
|
1467
|
+
disabled: !l || C || w,
|
|
1465
1468
|
buttonColor: "primary"
|
|
1466
1469
|
},
|
|
1467
1470
|
secondaryButton: {
|
|
1468
1471
|
text: g ? "Logout" : "Cancel",
|
|
1469
|
-
onClick:
|
|
1472
|
+
onClick: A
|
|
1470
1473
|
},
|
|
1471
1474
|
onClose: g ? () => {
|
|
1472
1475
|
} : n,
|
|
1473
1476
|
children: [
|
|
1474
|
-
/* @__PURE__ */ p(
|
|
1477
|
+
/* @__PURE__ */ p(P, { marginBottom: 2, children: [
|
|
1475
1478
|
"Select the default organisation that you want to use with the ",
|
|
1476
1479
|
r,
|
|
1477
1480
|
"."
|
|
1478
1481
|
] }),
|
|
1479
1482
|
/* @__PURE__ */ o(
|
|
1480
|
-
|
|
1483
|
+
Ae,
|
|
1481
1484
|
{
|
|
1482
1485
|
loading: e,
|
|
1483
1486
|
multiple: !1,
|
|
1484
1487
|
disableClearable: !1,
|
|
1485
1488
|
value: l !== "" ? l : null,
|
|
1486
|
-
onChange: (I,
|
|
1487
|
-
getOptionLabel:
|
|
1489
|
+
onChange: (I, T) => u(T != null ? T : ""),
|
|
1490
|
+
getOptionLabel: io,
|
|
1488
1491
|
options: [...i],
|
|
1489
1492
|
renderInput: (I) => /* @__PURE__ */ o(
|
|
1490
|
-
|
|
1493
|
+
be,
|
|
1491
1494
|
S(s({}, I), {
|
|
1492
1495
|
variant: "filled",
|
|
1493
1496
|
label: "Select organisation",
|
|
1494
1497
|
InputProps: S(s({}, I.InputProps), {
|
|
1495
|
-
endAdornment: /* @__PURE__ */ p(
|
|
1496
|
-
e ? /* @__PURE__ */ o(
|
|
1498
|
+
endAdornment: /* @__PURE__ */ p(M, { children: [
|
|
1499
|
+
e ? /* @__PURE__ */ o(Se, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
|
|
1497
1500
|
I.InputProps.endAdornment
|
|
1498
1501
|
] })
|
|
1499
1502
|
})
|
|
@@ -1501,11 +1504,11 @@ const qe = M(
|
|
|
1501
1504
|
)
|
|
1502
1505
|
}
|
|
1503
1506
|
),
|
|
1504
|
-
|
|
1507
|
+
k && /* @__PURE__ */ o(Xt, { error: !0, children: k })
|
|
1505
1508
|
]
|
|
1506
1509
|
}
|
|
1507
1510
|
);
|
|
1508
|
-
},
|
|
1511
|
+
}, zo = ot({
|
|
1509
1512
|
palette: {
|
|
1510
1513
|
primary: {
|
|
1511
1514
|
dark: "#00A651",
|
|
@@ -1556,7 +1559,7 @@ const qe = M(
|
|
|
1556
1559
|
navBar: {
|
|
1557
1560
|
backgroundColor: "#E8E8E8"
|
|
1558
1561
|
}
|
|
1559
|
-
}),
|
|
1562
|
+
}), Uo = ot({
|
|
1560
1563
|
palette: {
|
|
1561
1564
|
primary: {
|
|
1562
1565
|
main: "#007236",
|
|
@@ -1647,76 +1650,77 @@ const qe = M(
|
|
|
1647
1650
|
navBar: {
|
|
1648
1651
|
backgroundColor: "#E8E8E8"
|
|
1649
1652
|
}
|
|
1650
|
-
}),
|
|
1653
|
+
}), ro = {
|
|
1651
1654
|
domainCode: yt,
|
|
1652
|
-
navBarOpen:
|
|
1653
|
-
navBarWidthOpen:
|
|
1654
|
-
navBarWidthClosed:
|
|
1655
|
+
navBarOpen: K,
|
|
1656
|
+
navBarWidthOpen: Ct,
|
|
1657
|
+
navBarWidthClosed: xt,
|
|
1655
1658
|
titleText: xe,
|
|
1656
|
-
topBarHeight:
|
|
1657
|
-
navBarTop:
|
|
1658
|
-
},
|
|
1659
|
+
topBarHeight: vt,
|
|
1660
|
+
navBarTop: wt
|
|
1661
|
+
}, Go = X(() => ({ children: e }) => /* @__PURE__ */ o(lt, { children: e })), ao = ({
|
|
1659
1662
|
initialValues: e,
|
|
1660
1663
|
children: t
|
|
1661
|
-
}) => (
|
|
1664
|
+
}) => (ct(e), /* @__PURE__ */ o(M, { children: t })), Vo = X(
|
|
1662
1665
|
(e) => ({ children: t }) => /* @__PURE__ */ o(
|
|
1663
|
-
|
|
1666
|
+
ao,
|
|
1664
1667
|
{
|
|
1665
1668
|
initialValues: Object.entries(e).map(
|
|
1666
1669
|
([n, i]) => [
|
|
1667
|
-
|
|
1670
|
+
ro[n],
|
|
1668
1671
|
i
|
|
1669
1672
|
]
|
|
1670
1673
|
),
|
|
1671
1674
|
children: t
|
|
1672
1675
|
}
|
|
1673
1676
|
)
|
|
1674
|
-
),
|
|
1675
|
-
const t = new
|
|
1676
|
-
return /* @__PURE__ */ o(
|
|
1677
|
+
), qo = X(() => ({ children: e }) => {
|
|
1678
|
+
const t = new rn();
|
|
1679
|
+
return /* @__PURE__ */ o(an, { client: t, children: e });
|
|
1677
1680
|
});
|
|
1678
1681
|
export {
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1682
|
+
bt as AgDialog,
|
|
1683
|
+
Po as AppLayout,
|
|
1684
|
+
Ho as AtomProvider,
|
|
1685
|
+
Mo as AuthGuard,
|
|
1683
1686
|
kt as Context,
|
|
1684
1687
|
ke as ContextError,
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1688
|
+
Wo as DomainCodeDialog,
|
|
1689
|
+
$o as ExampleComponent,
|
|
1690
|
+
No as FetchAutocomplete,
|
|
1691
|
+
ao as HydrateAtoms,
|
|
1689
1692
|
pt as NAVBAR_WIDTH_CLOSED,
|
|
1690
1693
|
ut as NAVBAR_WIDTH_OPENED,
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1694
|
+
Eo as NavBar,
|
|
1695
|
+
Oo as NavBarDarkStyledList,
|
|
1696
|
+
Bo as NavBarLightStyledList,
|
|
1697
|
+
fn as NavBarProvider,
|
|
1698
|
+
Fo as PageLayout,
|
|
1699
|
+
eo as SaladBarProvider,
|
|
1700
|
+
_o as SessionExpiryDialog,
|
|
1701
|
+
Lo as SingleAutocomplete,
|
|
1702
|
+
no as atomStore,
|
|
1703
|
+
Cn as buildNavBarState,
|
|
1701
1704
|
yt as domainCodeAtom,
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
+
zo as fed21Theme,
|
|
1706
|
+
zn as getAuth0Expiry,
|
|
1707
|
+
Uo as internalAgSystemsTheme,
|
|
1705
1708
|
q as navBarClasses,
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1709
|
+
K as navBarOpenAtom,
|
|
1710
|
+
wt as navBarTopAtom,
|
|
1711
|
+
xt as navBarWidthClosedAtom,
|
|
1712
|
+
Ct as navBarWidthOpenAtom,
|
|
1710
1713
|
xe as titleTextAtom,
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1714
|
+
vt as topBarHeightAtom,
|
|
1715
|
+
Tn as topBarMiddleAtom,
|
|
1716
|
+
St as useAutocompleteOptions,
|
|
1717
|
+
mn as useNavBar,
|
|
1718
|
+
to as useSaladBar,
|
|
1719
|
+
Go as withAtomProvider,
|
|
1720
|
+
To as withBrowserRouter,
|
|
1721
|
+
Io as withNavBarProvider,
|
|
1722
|
+
Vo as withOverrideDefaults,
|
|
1723
|
+
qo as withQueryClient,
|
|
1724
|
+
Ro as withSaladBarProvider
|
|
1721
1725
|
};
|
|
1722
1726
|
//# sourceMappingURL=index.js.map
|