@australiangreens/ag-internal-components 0.0.90 → 0.0.92
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/SingleAutocomplete/index.d.ts +3 -1
- package/dist/components/SingleAutocomplete/index.d.ts.map +1 -1
- package/dist/esm/index.js +193 -192
- package/dist/esm/index.js.map +1 -1
- package/dist/layouts/AppLayout/PageContainer.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var he = (e, t, n) => t in e ? Pt(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
9
9
|
for (var n of ee(t))
|
|
10
10
|
Be.call(t, n) && he(e, n, t[n]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
12
|
+
}, k = (e, t) => Nt(e, Lt(t));
|
|
13
13
|
var Ee = (e, t) => {
|
|
14
14
|
var n = {};
|
|
15
15
|
for (var i in e)
|
|
@@ -20,7 +20,7 @@ var Ee = (e, t) => {
|
|
|
20
20
|
return n;
|
|
21
21
|
};
|
|
22
22
|
var Fe = (e, t, n) => (he(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
23
|
-
var
|
|
23
|
+
var N = (e, t, n) => new Promise((i, r) => {
|
|
24
24
|
var s = (l) => {
|
|
25
25
|
try {
|
|
26
26
|
d(n.next(l));
|
|
@@ -36,17 +36,17 @@ var P = (e, t, n) => new Promise((i, r) => {
|
|
|
36
36
|
}, d = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(s, c);
|
|
37
37
|
d((n = n.apply(e, t)).next());
|
|
38
38
|
});
|
|
39
|
-
import { jsxs as h, Fragment as
|
|
40
|
-
import { useState as
|
|
41
|
-
import { Typography as
|
|
39
|
+
import { jsxs as h, Fragment as L, jsx as o } from "react/jsx-runtime";
|
|
40
|
+
import { useState as B, createContext as Ye, useCallback as oe, useContext as Ke, useEffect as ie, createElement as xe, useRef as ge } from "react";
|
|
41
|
+
import { Typography as E, Button as re, Paper as Je, Box as $, Drawer as we, styled as Ae, IconButton as Y, Container as Ze, useTheme as se, useMediaQuery as _t, Collapse as Mt, Avatar as Pe, Fade as Rt, Skeleton as Ne, Toolbar as Ht, Divider as Le, CssBaseline as Wt, Dialog as je, LinearProgress as et, DialogTitle as tt, DialogContent as nt, DialogActions as ot, Autocomplete as be, TextField as Se, CircularProgress as ke, 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 R, createTheme as it, alpha as fe } from "@mui/material/styles";
|
|
44
44
|
import { AgError as Yt } from "@australiangreens/ag-error";
|
|
45
45
|
import { createHelper as X } from "souvlaki";
|
|
46
46
|
import { BrowserRouter as Kt } from "react-router-dom";
|
|
47
47
|
import rt from "@mui/material/List";
|
|
48
48
|
import { ArrowForward as at, ArrowBack as st, ViewHeadline as Jt, Cancel as Zt, ArrowDropDown as jt } from "@mui/icons-material";
|
|
49
|
-
import { atom as
|
|
49
|
+
import { atom as _, useSetAtom as lt, useAtomValue as _e, useAtom as V, getDefaultStore as en, Provider as ct } from "jotai";
|
|
50
50
|
import { useHydrateAtoms as dt } from "jotai/utils";
|
|
51
51
|
import tn from "autosuggest-highlight/match";
|
|
52
52
|
import nn from "autosuggest-highlight/parse";
|
|
@@ -55,10 +55,10 @@ import { useAuth0 as ut } from "@auth0/auth0-react";
|
|
|
55
55
|
import { Buffer as sn } from "buffer";
|
|
56
56
|
import ln from "@mui/material/Skeleton";
|
|
57
57
|
function $o({ text: e }) {
|
|
58
|
-
const [t, n] =
|
|
59
|
-
return /* @__PURE__ */ h(
|
|
60
|
-
/* @__PURE__ */ o(
|
|
61
|
-
/* @__PURE__ */ o(
|
|
58
|
+
const [t, n] = B(0);
|
|
59
|
+
return /* @__PURE__ */ h(L, { children: [
|
|
60
|
+
/* @__PURE__ */ o(E, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
|
|
61
|
+
/* @__PURE__ */ o(E, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
|
|
62
62
|
/* @__PURE__ */ o(
|
|
63
63
|
re,
|
|
64
64
|
{
|
|
@@ -86,7 +86,7 @@ const pt = 330, ht = 73, U = "Navbar", q = {
|
|
|
86
86
|
userInfoHolder: `${U}-userInfoHolder`,
|
|
87
87
|
settings: `${U}-settings`,
|
|
88
88
|
pieChartIcon: `${U}-pieChartIcon`
|
|
89
|
-
}, cn =
|
|
89
|
+
}, cn = R($, {
|
|
90
90
|
name: "NavBar"
|
|
91
91
|
})(({ theme: e }) => ({
|
|
92
92
|
[`&.${q.root}`]: {
|
|
@@ -119,7 +119,7 @@ const pt = 330, ht = 73, U = "Navbar", q = {
|
|
|
119
119
|
width: pt
|
|
120
120
|
}, gt()), un = () => a({
|
|
121
121
|
width: ht
|
|
122
|
-
}, gt()), pn =
|
|
122
|
+
}, gt()), pn = R(we, {
|
|
123
123
|
shouldForwardProp: (e) => e !== "open"
|
|
124
124
|
})(({ theme: e, open: t }) => a(a({
|
|
125
125
|
width: t ? pt : ht,
|
|
@@ -140,10 +140,10 @@ const ft = Ye(null), hn = {}, gn = {}, fn = ({
|
|
|
140
140
|
overrideActions: t = gn,
|
|
141
141
|
children: n
|
|
142
142
|
}) => {
|
|
143
|
-
const [{ open: i }, r] =
|
|
143
|
+
const [{ open: i }, r] = B({ open: !0 }), s = oe((l) => {
|
|
144
144
|
r({ open: l });
|
|
145
145
|
}, []), c = oe(() => {
|
|
146
|
-
r((l) =>
|
|
146
|
+
r((l) => k(a({}, l), { open: !l.open }));
|
|
147
147
|
}, []), d = a(a({
|
|
148
148
|
open: i,
|
|
149
149
|
setOpen: s,
|
|
@@ -159,7 +159,7 @@ const ft = Ye(null), hn = {}, gn = {}, fn = ({
|
|
|
159
159
|
open: !0
|
|
160
160
|
}, e), Io = X(
|
|
161
161
|
(e = Cn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(fn, { overrideState: e, overrideActions: t, children: n })
|
|
162
|
-
), Oo = X(() => ({ children: e }) => /* @__PURE__ */ o(Kt, { children: e })), Me = 7, To =
|
|
162
|
+
), Oo = X(() => ({ children: e }) => /* @__PURE__ */ o(Kt, { children: e })), Me = 7, To = R(rt)(({ theme: e }) => ({
|
|
163
163
|
backgroundColor: "black",
|
|
164
164
|
color: "white",
|
|
165
165
|
"& .MuiListItem-root": {
|
|
@@ -197,7 +197,7 @@ const ft = Ye(null), hn = {}, gn = {}, fn = ({
|
|
|
197
197
|
// '&.Mui-selected.Mui-focusVisible:hover': {
|
|
198
198
|
// },
|
|
199
199
|
}
|
|
200
|
-
})), Re = 7, Bo =
|
|
200
|
+
})), Re = 7, Bo = R(rt)(({ theme: e }) => ({
|
|
201
201
|
backgroundColor: "#e8e8e8",
|
|
202
202
|
color: "inherit",
|
|
203
203
|
"& .MuiListItem-root": {
|
|
@@ -255,7 +255,7 @@ function Eo({
|
|
|
255
255
|
)
|
|
256
256
|
] });
|
|
257
257
|
}
|
|
258
|
-
const xn = 24, vn = 64, G = "TopBar",
|
|
258
|
+
const xn = 24, vn = 64, G = "TopBar", T = {
|
|
259
259
|
topStripe: `${G}-topStripe`,
|
|
260
260
|
titleBar: `${G}-titleBar`,
|
|
261
261
|
titleSlider: `${G}-titleSlider`,
|
|
@@ -269,18 +269,18 @@ const xn = 24, vn = 64, G = "TopBar", B = {
|
|
|
269
269
|
var i, r;
|
|
270
270
|
return {
|
|
271
271
|
width: "100%",
|
|
272
|
-
[`& .${
|
|
272
|
+
[`& .${T.topStripe}`]: {
|
|
273
273
|
width: "100%",
|
|
274
274
|
height: `${xn}px`,
|
|
275
275
|
backgroundColor: e.palette.primary.main
|
|
276
276
|
},
|
|
277
|
-
[`& .${
|
|
277
|
+
[`& .${T.titleBar}`]: {
|
|
278
278
|
backgroundColor: e.palette.primary.light,
|
|
279
279
|
height: `${vn}px`,
|
|
280
280
|
padding: e.spacing(0, 3),
|
|
281
281
|
width: "100%"
|
|
282
282
|
},
|
|
283
|
-
[`& .${
|
|
283
|
+
[`& .${T.titleSlider}`]: a(a({
|
|
284
284
|
height: "100%",
|
|
285
285
|
display: "flex",
|
|
286
286
|
alignItems: "center",
|
|
@@ -289,14 +289,14 @@ const xn = 24, vn = 64, G = "TopBar", B = {
|
|
|
289
289
|
easing: e.transitions.easing.sharp,
|
|
290
290
|
duration: e.transitions.duration.leavingScreen
|
|
291
291
|
}),
|
|
292
|
-
[`& .${
|
|
292
|
+
[`& .${T.leftPanelButton}`]: {
|
|
293
293
|
marginRight: e.spacing(2),
|
|
294
294
|
flexGrow: 0
|
|
295
295
|
},
|
|
296
|
-
[`& .${
|
|
296
|
+
[`& .${T.titleText}`]: {
|
|
297
297
|
flexGrow: 1
|
|
298
298
|
},
|
|
299
|
-
[`& .${
|
|
299
|
+
[`& .${T.rightPanelButton}`]: {
|
|
300
300
|
flexGrow: 0
|
|
301
301
|
}
|
|
302
302
|
}, (t == null ? void 0 : t.open) && {
|
|
@@ -321,12 +321,12 @@ function An({
|
|
|
321
321
|
"data-testid": i
|
|
322
322
|
}) {
|
|
323
323
|
return /* @__PURE__ */ h(wn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
|
|
324
|
-
/* @__PURE__ */ o("div", { className:
|
|
325
|
-
/* @__PURE__ */ o("div", { className:
|
|
324
|
+
/* @__PURE__ */ o("div", { className: T.topStripe }),
|
|
325
|
+
/* @__PURE__ */ o("div", { className: T.titleBar, children: /* @__PURE__ */ h($, { className: T.titleSlider, children: [
|
|
326
326
|
t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ h(
|
|
327
327
|
Y,
|
|
328
328
|
{
|
|
329
|
-
className:
|
|
329
|
+
className: T.leftPanelButton,
|
|
330
330
|
color: "inherit",
|
|
331
331
|
"aria-label": "Open left side panel",
|
|
332
332
|
onClick: t == null ? void 0 : t.onOpen,
|
|
@@ -338,11 +338,11 @@ function An({
|
|
|
338
338
|
]
|
|
339
339
|
}
|
|
340
340
|
),
|
|
341
|
-
/* @__PURE__ */ o(
|
|
341
|
+
/* @__PURE__ */ o(E, { className: T.titleText, variant: "h6", noWrap: !0, children: e }),
|
|
342
342
|
n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ h(
|
|
343
343
|
Y,
|
|
344
344
|
{
|
|
345
|
-
className:
|
|
345
|
+
className: T.rightPanelButton,
|
|
346
346
|
color: "inherit",
|
|
347
347
|
"aria-label": "Open right side panel",
|
|
348
348
|
onClick: n == null ? void 0 : n.onOpen,
|
|
@@ -389,7 +389,7 @@ const mt = 400, bn = Ae(we, {
|
|
|
389
389
|
})
|
|
390
390
|
), Sn = Ae($, {
|
|
391
391
|
shouldForwardProp: (e) => !["anchor"].includes(e)
|
|
392
|
-
})(({ theme: e, anchor: t }) =>
|
|
392
|
+
})(({ theme: e, anchor: t }) => k(a({
|
|
393
393
|
display: "flex",
|
|
394
394
|
alignItems: "center",
|
|
395
395
|
padding: e.spacing(2)
|
|
@@ -419,18 +419,18 @@ function He({
|
|
|
419
419
|
debugOpacity: d = !1,
|
|
420
420
|
headerBoxProps: l = {},
|
|
421
421
|
onOpened: u,
|
|
422
|
-
onClosed:
|
|
422
|
+
onClosed: w,
|
|
423
423
|
"data-testid": x,
|
|
424
|
-
navBarOpen:
|
|
424
|
+
navBarOpen: A = !1,
|
|
425
425
|
navBarWidthOpen: g = 0,
|
|
426
|
-
navBarWidthClosed:
|
|
426
|
+
navBarWidthClosed: y = 0
|
|
427
427
|
}) {
|
|
428
428
|
return /* @__PURE__ */ h(
|
|
429
429
|
bn,
|
|
430
430
|
{
|
|
431
431
|
SlideProps: {
|
|
432
432
|
onEntered: () => u == null ? void 0 : u(),
|
|
433
|
-
onExited: () =>
|
|
433
|
+
onExited: () => w == null ? void 0 : w()
|
|
434
434
|
},
|
|
435
435
|
variant: "persistent",
|
|
436
436
|
anchor: t,
|
|
@@ -438,29 +438,29 @@ function He({
|
|
|
438
438
|
width: s,
|
|
439
439
|
debugOpacity: d,
|
|
440
440
|
"data-testid": x,
|
|
441
|
-
navBarOpen:
|
|
441
|
+
navBarOpen: A,
|
|
442
442
|
navBarWidthOpen: g,
|
|
443
|
-
navBarWidthClosed:
|
|
443
|
+
navBarWidthClosed: y,
|
|
444
444
|
children: [
|
|
445
|
-
/* @__PURE__ */ o(Sn,
|
|
446
|
-
/* @__PURE__ */ o(
|
|
445
|
+
/* @__PURE__ */ o(Sn, k(a({ anchor: t }, l), { children: t === "left" ? /* @__PURE__ */ h(L, { children: [
|
|
446
|
+
/* @__PURE__ */ o(E, { variant: "h6", color: "inherit", component: "div", children: r }),
|
|
447
447
|
c && /* @__PURE__ */ h(Y, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
|
|
448
448
|
/* @__PURE__ */ o(st, { "data-testid": "arrowbackicon" }),
|
|
449
449
|
" "
|
|
450
450
|
] })
|
|
451
|
-
] }) : /* @__PURE__ */ h(
|
|
451
|
+
] }) : /* @__PURE__ */ h(L, { children: [
|
|
452
452
|
c && /* @__PURE__ */ h(Y, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
|
|
453
453
|
/* @__PURE__ */ o(at, {}),
|
|
454
454
|
" "
|
|
455
455
|
] }),
|
|
456
|
-
/* @__PURE__ */ o(
|
|
456
|
+
/* @__PURE__ */ o(E, { variant: "h6", color: "inherit", component: "div", children: r })
|
|
457
457
|
] }) })),
|
|
458
458
|
e
|
|
459
459
|
]
|
|
460
460
|
}
|
|
461
461
|
);
|
|
462
462
|
}
|
|
463
|
-
const kn =
|
|
463
|
+
const kn = R($, {
|
|
464
464
|
shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
|
|
465
465
|
name: "PanelAwareMargins"
|
|
466
466
|
})(({ theme: e, leftPanel: t, rightPanel: n }) => {
|
|
@@ -483,7 +483,7 @@ const kn = M($, {
|
|
|
483
483
|
}),
|
|
484
484
|
marginRight: `${(r = n == null ? void 0 : n.width) != null ? r : 0}px`
|
|
485
485
|
});
|
|
486
|
-
}), Dn =
|
|
486
|
+
}), Dn = R(Ze, {
|
|
487
487
|
name: "PageContainer"
|
|
488
488
|
})(({ theme: e }) => ({
|
|
489
489
|
// Horizontal padding comes from the Container's gutter
|
|
@@ -498,7 +498,7 @@ const kn = M($, {
|
|
|
498
498
|
startOpen: !1,
|
|
499
499
|
open: void 0,
|
|
500
500
|
onChangeOpen: void 0,
|
|
501
|
-
content: /* @__PURE__ */ o(
|
|
501
|
+
content: /* @__PURE__ */ o(L, {}),
|
|
502
502
|
onOpened: void 0,
|
|
503
503
|
onClosed: void 0,
|
|
504
504
|
dataTestId: void 0
|
|
@@ -514,18 +514,18 @@ function Fo({
|
|
|
514
514
|
pageContentDataTestId: d,
|
|
515
515
|
topBarDataTestId: l,
|
|
516
516
|
navBarOpen: u,
|
|
517
|
-
navBarWidthOpen:
|
|
517
|
+
navBarWidthOpen: w,
|
|
518
518
|
navBarWidthClosed: x
|
|
519
519
|
}) {
|
|
520
|
-
const [
|
|
521
|
-
titleText:
|
|
520
|
+
const [A, g] = B(me), [y, b] = B(Ce), [D, I] = B(me), [O, F] = B(Ce), P = n !== void 0, S = i !== void 0, {
|
|
521
|
+
titleText: v,
|
|
522
522
|
content: H,
|
|
523
523
|
flavour: W,
|
|
524
524
|
open: p,
|
|
525
525
|
onChangeOpen: f,
|
|
526
526
|
width: m,
|
|
527
527
|
arrowButtons: C,
|
|
528
|
-
startOpen:
|
|
528
|
+
startOpen: M,
|
|
529
529
|
onOpened: J,
|
|
530
530
|
onClosed: le,
|
|
531
531
|
dataTestId: It
|
|
@@ -543,17 +543,17 @@ function Fo({
|
|
|
543
543
|
dataTestId: Ft
|
|
544
544
|
} = i ? a(a({}, te), i) : a({}, te);
|
|
545
545
|
ie(() => {
|
|
546
|
-
|
|
547
|
-
}, [
|
|
548
|
-
j !== Ce && (b(j),
|
|
546
|
+
M !== me && (g(M), I(M));
|
|
547
|
+
}, [M]), ie(() => {
|
|
548
|
+
j !== Ce && (b(j), F(j));
|
|
549
549
|
}, [j]);
|
|
550
|
-
const ue = p === void 0 ?
|
|
551
|
-
p === void 0 && (g(z), r &&
|
|
550
|
+
const ue = p === void 0 ? A : p, pe = ce === void 0 ? y : ce, Ie = (z) => {
|
|
551
|
+
p === void 0 && (g(z), r && S && (z ? (b(!1), F(y)) : b(O))), f && f(z);
|
|
552
552
|
}, Oe = (z) => {
|
|
553
|
-
ce === void 0 && (b(z), r &&
|
|
553
|
+
ce === void 0 && (b(z), r && P && (z ? (g(!1), I(A)) : g(D))), $e && $e(z);
|
|
554
554
|
};
|
|
555
555
|
return /* @__PURE__ */ h($, { children: [
|
|
556
|
-
|
|
556
|
+
P && /* @__PURE__ */ o(
|
|
557
557
|
He,
|
|
558
558
|
{
|
|
559
559
|
"data-testid": It,
|
|
@@ -561,18 +561,18 @@ function Fo({
|
|
|
561
561
|
open: ue,
|
|
562
562
|
onClose: () => Ie(!1),
|
|
563
563
|
width: m,
|
|
564
|
-
titleText:
|
|
564
|
+
titleText: v,
|
|
565
565
|
debugOpacity: s,
|
|
566
566
|
showCloseArrow: C === "both" || C === "close",
|
|
567
567
|
onOpened: J,
|
|
568
568
|
onClosed: le,
|
|
569
569
|
navBarOpen: u,
|
|
570
|
-
navBarWidthOpen:
|
|
570
|
+
navBarWidthOpen: w,
|
|
571
571
|
navBarWidthClosed: x,
|
|
572
572
|
children: H
|
|
573
573
|
}
|
|
574
574
|
),
|
|
575
|
-
|
|
575
|
+
S && /* @__PURE__ */ o(
|
|
576
576
|
He,
|
|
577
577
|
{
|
|
578
578
|
"data-testid": Ft,
|
|
@@ -586,7 +586,7 @@ function Fo({
|
|
|
586
586
|
onOpened: Bt,
|
|
587
587
|
onClosed: Et,
|
|
588
588
|
navBarOpen: u,
|
|
589
|
-
navBarWidthOpen:
|
|
589
|
+
navBarWidthOpen: w,
|
|
590
590
|
navBarWidthClosed: x,
|
|
591
591
|
children: Tt
|
|
592
592
|
}
|
|
@@ -596,14 +596,14 @@ function Fo({
|
|
|
596
596
|
a(a({
|
|
597
597
|
titleText: t,
|
|
598
598
|
"data-testid": l
|
|
599
|
-
},
|
|
599
|
+
}, P && W === "push" ? {
|
|
600
600
|
leftPanel: {
|
|
601
601
|
open: ue,
|
|
602
602
|
width: m,
|
|
603
603
|
onOpen: () => Ie(!0),
|
|
604
604
|
showOpenArrow: C === "both" || C === "open"
|
|
605
605
|
}
|
|
606
|
-
} : {}),
|
|
606
|
+
} : {}), S && ye === "push" ? {
|
|
607
607
|
rightPanel: {
|
|
608
608
|
open: pe,
|
|
609
609
|
width: de,
|
|
@@ -614,7 +614,7 @@ function Fo({
|
|
|
614
614
|
),
|
|
615
615
|
/* @__PURE__ */ o(
|
|
616
616
|
kn,
|
|
617
|
-
|
|
617
|
+
k(a(a({}, W === "push" ? {
|
|
618
618
|
leftPanel: {
|
|
619
619
|
open: ue,
|
|
620
620
|
width: m
|
|
@@ -625,7 +625,7 @@ function Fo({
|
|
|
625
625
|
width: de
|
|
626
626
|
}
|
|
627
627
|
} : {}), {
|
|
628
|
-
children: /* @__PURE__ */ o(Dn,
|
|
628
|
+
children: /* @__PURE__ */ o(Dn, k(a({ "data-testid": d }, c), { children: e }))
|
|
629
629
|
})
|
|
630
630
|
)
|
|
631
631
|
] });
|
|
@@ -633,7 +633,7 @@ function Fo({
|
|
|
633
633
|
const Ct = () => {
|
|
634
634
|
const e = se();
|
|
635
635
|
return _t(e.breakpoints.down("sm"));
|
|
636
|
-
}, yn = 64, $n = 72, In = 256, K =
|
|
636
|
+
}, yn = 64, $n = 72, In = 256, K = _(!0), xt = _(In), vt = _($n), ve = _(""), On = _(void 0), wt = _(yn), At = _(void 0);
|
|
637
637
|
function Tn({ links: e }) {
|
|
638
638
|
return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
|
|
639
639
|
}
|
|
@@ -645,7 +645,7 @@ const ne = "Navbar", Q = {
|
|
|
645
645
|
// userInfoHolder: `${PREFIX}-userInfoHolder`,
|
|
646
646
|
// settings: `${PREFIX}-settings`,
|
|
647
647
|
// pieChartIcon: `${PREFIX}-pieChartIcon`,
|
|
648
|
-
}, Bn =
|
|
648
|
+
}, Bn = R($, { name: "NavBar" })(({ theme: e }) => ({
|
|
649
649
|
[`&.${Q.root}`]: {
|
|
650
650
|
display: "flex"
|
|
651
651
|
},
|
|
@@ -693,7 +693,7 @@ const ne = "Navbar", Q = {
|
|
|
693
693
|
}, bt(e)), ze = (e, t) => a({
|
|
694
694
|
width: t,
|
|
695
695
|
transition: ae(e, "width", "leaving")
|
|
696
|
-
}, bt(e)), Fn =
|
|
696
|
+
}, bt(e)), Fn = R(we, {
|
|
697
697
|
shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
|
|
698
698
|
})(({ theme: e, open: t, widthOpen: n, widthClosed: i, isSmallScreen: r }) => a(a({
|
|
699
699
|
flexShrink: 0,
|
|
@@ -701,10 +701,10 @@ const ne = "Navbar", Q = {
|
|
|
701
701
|
boxSizing: "border-box",
|
|
702
702
|
display: "flex",
|
|
703
703
|
flexDirection: "column"
|
|
704
|
-
}, t &&
|
|
704
|
+
}, t && k(a({}, We(e, n)), {
|
|
705
705
|
backgroundColor: "",
|
|
706
706
|
"& .MuiDrawer-paper": We(e, n)
|
|
707
|
-
})), !t &&
|
|
707
|
+
})), !t && k(a({}, ze(e, r ? n : i)), {
|
|
708
708
|
backgroundColor: "",
|
|
709
709
|
"& .MuiDrawer-paper": ze(e, r ? n : i)
|
|
710
710
|
})));
|
|
@@ -753,8 +753,8 @@ function Ln({ user: e, domainCode: t, open: n }) {
|
|
|
753
753
|
}
|
|
754
754
|
),
|
|
755
755
|
/* @__PURE__ */ o(En, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Rt, { in: n, children: /* @__PURE__ */ h($, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
|
|
756
|
-
e != null && e.name ? /* @__PURE__ */ o(
|
|
757
|
-
t ? /* @__PURE__ */ o(
|
|
756
|
+
e != null && e.name ? /* @__PURE__ */ o(E, { children: e.name }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "50%" }),
|
|
757
|
+
t ? /* @__PURE__ */ o(E, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "25%" })
|
|
758
758
|
] }) }) })
|
|
759
759
|
]
|
|
760
760
|
}
|
|
@@ -771,7 +771,7 @@ function _n({
|
|
|
771
771
|
user: d,
|
|
772
772
|
domainCode: l
|
|
773
773
|
}) {
|
|
774
|
-
const u = Ct(),
|
|
774
|
+
const u = Ct(), w = lt(K);
|
|
775
775
|
return /* @__PURE__ */ o(Bn, { className: Q.root, "data-testid": i, children: /* @__PURE__ */ h(
|
|
776
776
|
Fn,
|
|
777
777
|
{
|
|
@@ -784,7 +784,7 @@ function _n({
|
|
|
784
784
|
component: "nav"
|
|
785
785
|
},
|
|
786
786
|
onClose: () => {
|
|
787
|
-
|
|
787
|
+
w(!1);
|
|
788
788
|
},
|
|
789
789
|
isSmallScreen: u,
|
|
790
790
|
children: [
|
|
@@ -797,7 +797,7 @@ function _n({
|
|
|
797
797
|
/* @__PURE__ */ h($, { flexGrow: "0", children: [
|
|
798
798
|
/* @__PURE__ */ o(Le, { variant: "middle", sx: { marginY: "0.5rem" } }),
|
|
799
799
|
/* @__PURE__ */ o(Ln, { user: d, domainCode: l, open: e }),
|
|
800
|
-
c && /* @__PURE__ */ o(
|
|
800
|
+
c && /* @__PURE__ */ o(L, { children: c })
|
|
801
801
|
] })
|
|
802
802
|
]
|
|
803
803
|
}
|
|
@@ -815,8 +815,6 @@ function Mn({
|
|
|
815
815
|
sx: {
|
|
816
816
|
overflow: "auto",
|
|
817
817
|
height: `calc(100vh - ${t}px)`,
|
|
818
|
-
scrollbarGutter: "stable",
|
|
819
|
-
// scrollbarGutter: 'stable both-edges',
|
|
820
818
|
flexGrow: 1
|
|
821
819
|
},
|
|
822
820
|
children: i ? /* @__PURE__ */ o($, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ o(
|
|
@@ -870,7 +868,7 @@ function Wn({
|
|
|
870
868
|
children: /* @__PURE__ */ o(Jt, { fontSize: "medium" })
|
|
871
869
|
}
|
|
872
870
|
),
|
|
873
|
-
/* @__PURE__ */ o(
|
|
871
|
+
/* @__PURE__ */ o(E, { className: Hn.titleText, variant: "h6", children: e }),
|
|
874
872
|
i
|
|
875
873
|
]
|
|
876
874
|
}
|
|
@@ -887,22 +885,22 @@ function Po({
|
|
|
887
885
|
navBarMiddle: d,
|
|
888
886
|
navBarBottom: l,
|
|
889
887
|
user: u,
|
|
890
|
-
domainCode:
|
|
888
|
+
domainCode: w
|
|
891
889
|
}) {
|
|
892
890
|
dt([
|
|
893
891
|
[K, n != null ? n : !0],
|
|
894
892
|
[ve, t != null ? t : ""]
|
|
895
893
|
]);
|
|
896
|
-
const x = _e(K), [
|
|
894
|
+
const x = _e(K), [A] = V(xt), [g] = V(vt), y = _e(ve), [b] = V(wt), [D] = V(On), [I] = V(At);
|
|
897
895
|
return /* @__PURE__ */ h($, { children: [
|
|
898
896
|
/* @__PURE__ */ o(Wt, {}),
|
|
899
897
|
/* @__PURE__ */ o(
|
|
900
898
|
Wn,
|
|
901
899
|
{
|
|
902
|
-
titleText:
|
|
900
|
+
titleText: y,
|
|
903
901
|
"data-testid": s,
|
|
904
902
|
height: b,
|
|
905
|
-
middle:
|
|
903
|
+
middle: D
|
|
906
904
|
}
|
|
907
905
|
),
|
|
908
906
|
/* @__PURE__ */ h($, { sx: { display: "flex" }, children: [
|
|
@@ -914,8 +912,8 @@ function Po({
|
|
|
914
912
|
middle: d,
|
|
915
913
|
bottom: l,
|
|
916
914
|
user: u,
|
|
917
|
-
domainCode:
|
|
918
|
-
widthOpen:
|
|
915
|
+
domainCode: w,
|
|
916
|
+
widthOpen: A,
|
|
919
917
|
widthClosed: g,
|
|
920
918
|
offsetTop: b,
|
|
921
919
|
"data-testid": c
|
|
@@ -923,7 +921,7 @@ function Po({
|
|
|
923
921
|
),
|
|
924
922
|
/* @__PURE__ */ o(
|
|
925
923
|
Mn,
|
|
926
|
-
|
|
924
|
+
k(a({
|
|
927
925
|
"data-testid": r,
|
|
928
926
|
topBarHeight: b
|
|
929
927
|
}, i), {
|
|
@@ -944,23 +942,23 @@ const St = ({
|
|
|
944
942
|
sx: d,
|
|
945
943
|
"data-testid": l,
|
|
946
944
|
disableCloseOnBackdropOrEscape: u = !1,
|
|
947
|
-
isLoading:
|
|
945
|
+
isLoading: w = !1
|
|
948
946
|
}) => {
|
|
949
|
-
var g,
|
|
950
|
-
const [x,
|
|
947
|
+
var g, y;
|
|
948
|
+
const [x, A] = B(!1);
|
|
951
949
|
return /* @__PURE__ */ h(
|
|
952
950
|
je,
|
|
953
951
|
{
|
|
954
952
|
open: e,
|
|
955
|
-
onClose: (b,
|
|
956
|
-
u && (
|
|
953
|
+
onClose: (b, D) => N(void 0, null, function* () {
|
|
954
|
+
u && (D === "backdropClick" || D === "escapeKeyDown") || x || (s != null && s.onClick ? yield s.onClick() : c());
|
|
957
955
|
}),
|
|
958
956
|
fullWidth: !0,
|
|
959
957
|
maxWidth: i != null ? i : "xs",
|
|
960
958
|
"data-testid": l,
|
|
961
959
|
sx: d,
|
|
962
960
|
children: [
|
|
963
|
-
|
|
961
|
+
w && /* @__PURE__ */ o(et, { sx: { height: "4px", marginBottom: "-4px" } }),
|
|
964
962
|
/* @__PURE__ */ o(tt, { children: t }),
|
|
965
963
|
/* @__PURE__ */ o(nt, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
|
|
966
964
|
/* @__PURE__ */ h(ot, { children: [
|
|
@@ -971,15 +969,15 @@ const St = ({
|
|
|
971
969
|
"data-testid": s == null ? void 0 : s.testId,
|
|
972
970
|
disabled: (s == null ? void 0 : s.disabled) || x,
|
|
973
971
|
color: s == null ? void 0 : s.buttonColor,
|
|
974
|
-
children: (
|
|
972
|
+
children: (y = s == null ? void 0 : s.text) != null ? y : "Cancel"
|
|
975
973
|
}
|
|
976
974
|
),
|
|
977
975
|
r && /* @__PURE__ */ o(
|
|
978
976
|
re,
|
|
979
977
|
{
|
|
980
|
-
onClick: () =>
|
|
978
|
+
onClick: () => N(void 0, null, function* () {
|
|
981
979
|
var b;
|
|
982
|
-
|
|
980
|
+
A(!0), yield (b = r.onClick) == null ? void 0 : b.call(r), A(!1);
|
|
983
981
|
}),
|
|
984
982
|
"data-testid": r.testId,
|
|
985
983
|
disabled: r.disabled || x,
|
|
@@ -1004,7 +1002,7 @@ const St = ({
|
|
|
1004
1002
|
queryKey: ["autocomplete", i, r]
|
|
1005
1003
|
});
|
|
1006
1004
|
function No({
|
|
1007
|
-
lookup: e = () =>
|
|
1005
|
+
lookup: e = () => N(this, null, function* () {
|
|
1008
1006
|
}),
|
|
1009
1007
|
enableHighlighting: t = !0,
|
|
1010
1008
|
onChange: n,
|
|
@@ -1015,57 +1013,57 @@ function No({
|
|
|
1015
1013
|
sx: d,
|
|
1016
1014
|
boxSx: l,
|
|
1017
1015
|
textFieldColor: u,
|
|
1018
|
-
textFieldVariant:
|
|
1016
|
+
textFieldVariant: w = "filled",
|
|
1019
1017
|
loadingText: x = "Loading...",
|
|
1020
|
-
noOptionsText:
|
|
1018
|
+
noOptionsText: A = "No options",
|
|
1021
1019
|
popupIcon: g = /* @__PURE__ */ o(jt, {}),
|
|
1022
|
-
error:
|
|
1020
|
+
error: y = !1,
|
|
1023
1021
|
helperText: b = "",
|
|
1024
|
-
preLoadedOptions:
|
|
1022
|
+
preLoadedOptions: D = void 0,
|
|
1025
1023
|
disablePortal: I = !1,
|
|
1026
|
-
disableIconFlip:
|
|
1024
|
+
disableIconFlip: O = !1
|
|
1027
1025
|
}) {
|
|
1028
|
-
const [
|
|
1026
|
+
const [F, P] = B(""), S = (p, f) => {
|
|
1029
1027
|
const m = s.filter((C) => C.id !== f);
|
|
1030
1028
|
n(m, "delete", p);
|
|
1031
|
-
}, { data:
|
|
1032
|
-
inputValue:
|
|
1029
|
+
}, { data: v, isLoading: H } = kt({
|
|
1030
|
+
inputValue: F,
|
|
1033
1031
|
label: r,
|
|
1034
1032
|
lookup: e,
|
|
1035
1033
|
minLength: i,
|
|
1036
|
-
preLoadedOptions:
|
|
1037
|
-
}), W =
|
|
1034
|
+
preLoadedOptions: D
|
|
1035
|
+
}), W = F.length >= i;
|
|
1038
1036
|
return /* @__PURE__ */ h("div", { "data-testid": c, children: [
|
|
1039
1037
|
/* @__PURE__ */ o(
|
|
1040
1038
|
be,
|
|
1041
1039
|
{
|
|
1042
|
-
sx: a(a({}, d),
|
|
1040
|
+
sx: a(a({}, d), O ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
|
|
1043
1041
|
"data-testid": c ? `${c}:Autocomplete` : void 0,
|
|
1044
1042
|
disablePortal: I,
|
|
1045
1043
|
multiple: !0,
|
|
1046
1044
|
getOptionLabel: (p) => typeof p == "string" ? p : p.label,
|
|
1047
1045
|
loading: W ? H : !1,
|
|
1048
|
-
options: [...s, ...
|
|
1046
|
+
options: [...s, ...v != null ? v : []],
|
|
1049
1047
|
filterSelectedOptions: !0,
|
|
1050
1048
|
includeInputInList: !0,
|
|
1051
1049
|
value: s,
|
|
1052
1050
|
onChange: (p, f, m) => {
|
|
1053
1051
|
n(f, m, p);
|
|
1054
1052
|
},
|
|
1055
|
-
onInputChange: (p, f) =>
|
|
1056
|
-
noOptionsText: W ?
|
|
1053
|
+
onInputChange: (p, f) => P(f),
|
|
1054
|
+
noOptionsText: W ? A : "Start typing to search",
|
|
1057
1055
|
loadingText: x,
|
|
1058
1056
|
popupIcon: g,
|
|
1059
1057
|
renderInput: (p) => /* @__PURE__ */ o(
|
|
1060
1058
|
Se,
|
|
1061
|
-
|
|
1059
|
+
k(a({}, p), {
|
|
1062
1060
|
label: r,
|
|
1063
1061
|
fullWidth: !0,
|
|
1064
|
-
variant:
|
|
1065
|
-
error:
|
|
1062
|
+
variant: w,
|
|
1063
|
+
error: y,
|
|
1066
1064
|
helperText: b,
|
|
1067
|
-
InputProps:
|
|
1068
|
-
endAdornment: /* @__PURE__ */ h(
|
|
1065
|
+
InputProps: k(a({}, p.InputProps), {
|
|
1066
|
+
endAdornment: /* @__PURE__ */ h(L, { children: [
|
|
1069
1067
|
H ? /* @__PURE__ */ o(ke, { color: "inherit", size: 20 }) : null,
|
|
1070
1068
|
p.InputProps.endAdornment
|
|
1071
1069
|
] })
|
|
@@ -1084,14 +1082,14 @@ function No({
|
|
|
1084
1082
|
const C = tn(f.label, m.inputValue, {
|
|
1085
1083
|
insideWords: !0,
|
|
1086
1084
|
findAllOccurrences: !0
|
|
1087
|
-
}),
|
|
1085
|
+
}), M = nn(f.label, C);
|
|
1088
1086
|
return /* @__PURE__ */ xe(
|
|
1089
1087
|
"li",
|
|
1090
|
-
|
|
1088
|
+
k(a({}, p), {
|
|
1091
1089
|
key: f.id,
|
|
1092
1090
|
"data-testid": c ? `${c}:Autocomplete:option(${f.id.toString()})` : void 0
|
|
1093
1091
|
}),
|
|
1094
|
-
/* @__PURE__ */ o("div", { children:
|
|
1092
|
+
/* @__PURE__ */ o("div", { children: M.map((J, le) => /* @__PURE__ */ o(
|
|
1095
1093
|
"span",
|
|
1096
1094
|
{
|
|
1097
1095
|
style: {
|
|
@@ -1105,7 +1103,7 @@ function No({
|
|
|
1105
1103
|
} else
|
|
1106
1104
|
return /* @__PURE__ */ xe(
|
|
1107
1105
|
"li",
|
|
1108
|
-
|
|
1106
|
+
k(a({}, p), {
|
|
1109
1107
|
key: f.id,
|
|
1110
1108
|
"data-testid": c ? `${c}:option(${f.id.toString()})` : void 0
|
|
1111
1109
|
}),
|
|
@@ -1137,11 +1135,11 @@ function No({
|
|
|
1137
1135
|
}
|
|
1138
1136
|
]
|
|
1139
1137
|
},
|
|
1140
|
-
children: /* @__PURE__ */ o(
|
|
1138
|
+
children: /* @__PURE__ */ o(E, { style: { whiteSpace: "normal" }, children: p.chipLabel ? p.chipLabel : p.label })
|
|
1141
1139
|
}
|
|
1142
1140
|
),
|
|
1143
1141
|
"data-testid": c ? `${c}:Chip(${p.id.toString()})` : void 0,
|
|
1144
|
-
onDelete: (f) =>
|
|
1142
|
+
onDelete: (f) => S(f, p.id),
|
|
1145
1143
|
deleteIcon: /* @__PURE__ */ o(
|
|
1146
1144
|
Zt,
|
|
1147
1145
|
{
|
|
@@ -1154,7 +1152,7 @@ function No({
|
|
|
1154
1152
|
] });
|
|
1155
1153
|
}
|
|
1156
1154
|
const Lo = ({
|
|
1157
|
-
lookup: e = () =>
|
|
1155
|
+
lookup: e = () => N(void 0, null, function* () {
|
|
1158
1156
|
}),
|
|
1159
1157
|
onChange: t,
|
|
1160
1158
|
label: n,
|
|
@@ -1165,55 +1163,58 @@ const Lo = ({
|
|
|
1165
1163
|
"data-testid": d,
|
|
1166
1164
|
noOptionsText: l = "No options",
|
|
1167
1165
|
minLength: u = 3,
|
|
1168
|
-
disablePortal:
|
|
1166
|
+
disablePortal: w = !1,
|
|
1169
1167
|
preLoadedOptions: x,
|
|
1170
|
-
helperText:
|
|
1171
|
-
disabled: g
|
|
1168
|
+
helperText: A = "",
|
|
1169
|
+
disabled: g,
|
|
1170
|
+
popupIcon: y,
|
|
1171
|
+
disableIconFlip: b
|
|
1172
1172
|
}) => {
|
|
1173
|
-
const [D,
|
|
1173
|
+
const [D, I] = B(""), { data: O, isLoading: F } = kt({
|
|
1174
1174
|
inputValue: D,
|
|
1175
1175
|
label: n,
|
|
1176
1176
|
lookup: e,
|
|
1177
1177
|
minLength: u != null ? u : 0,
|
|
1178
1178
|
preLoadedOptions: x
|
|
1179
|
-
}),
|
|
1179
|
+
}), P = D.length >= u;
|
|
1180
1180
|
return /* @__PURE__ */ o("div", { "data-testid": d, children: /* @__PURE__ */ o(Gt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
|
|
1181
1181
|
be,
|
|
1182
1182
|
{
|
|
1183
|
-
sx: r,
|
|
1183
|
+
sx: a(a({}, r), b ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
|
|
1184
1184
|
"data-testid": d ? `${d}:Autocomplete` : void 0,
|
|
1185
|
-
loading:
|
|
1186
|
-
options:
|
|
1187
|
-
onChange: (
|
|
1188
|
-
t(
|
|
1185
|
+
loading: P ? F : !1,
|
|
1186
|
+
options: O != null ? O : [],
|
|
1187
|
+
onChange: (S, v) => {
|
|
1188
|
+
t(S, v);
|
|
1189
1189
|
},
|
|
1190
|
-
disablePortal:
|
|
1191
|
-
filterOptions: (
|
|
1190
|
+
disablePortal: w,
|
|
1191
|
+
filterOptions: (S) => S,
|
|
1192
1192
|
value: i,
|
|
1193
|
-
noOptionsText:
|
|
1194
|
-
getOptionLabel: (
|
|
1195
|
-
|
|
1193
|
+
noOptionsText: P ? l : "Start typing to search",
|
|
1194
|
+
getOptionLabel: (S) => S.label,
|
|
1195
|
+
popupIcon: y,
|
|
1196
|
+
renderInput: (S) => /* @__PURE__ */ o(
|
|
1196
1197
|
Se,
|
|
1197
|
-
|
|
1198
|
+
k(a({
|
|
1198
1199
|
"data-testid": d ? `${d}:Autocomplete:TextField` : void 0
|
|
1199
|
-
},
|
|
1200
|
+
}, S), {
|
|
1200
1201
|
variant: c,
|
|
1201
1202
|
label: n,
|
|
1202
1203
|
color: s,
|
|
1203
|
-
helperText:
|
|
1204
|
+
helperText: A
|
|
1204
1205
|
})
|
|
1205
1206
|
),
|
|
1206
|
-
isOptionEqualToValue: (
|
|
1207
|
-
onInputChange: (
|
|
1208
|
-
|
|
1207
|
+
isOptionEqualToValue: (S, v) => S.id === v.id,
|
|
1208
|
+
onInputChange: (S, v) => {
|
|
1209
|
+
I(v);
|
|
1209
1210
|
},
|
|
1210
|
-
renderOption: (
|
|
1211
|
+
renderOption: (S, v) => /* @__PURE__ */ xe(
|
|
1211
1212
|
"li",
|
|
1212
|
-
|
|
1213
|
-
key:
|
|
1214
|
-
"data-testid": d ? `${d}:Autocomplete:option(${
|
|
1213
|
+
k(a({}, S), {
|
|
1214
|
+
key: v.id,
|
|
1215
|
+
"data-testid": d ? `${d}:Autocomplete:option(${v.id.toString()})` : void 0
|
|
1215
1216
|
}),
|
|
1216
|
-
|
|
1217
|
+
v.label
|
|
1217
1218
|
),
|
|
1218
1219
|
disabled: g
|
|
1219
1220
|
}
|
|
@@ -1236,15 +1237,15 @@ const Lo = ({
|
|
|
1236
1237
|
closeHandler: t,
|
|
1237
1238
|
setAuth0ExpiryTime: n
|
|
1238
1239
|
}) => {
|
|
1239
|
-
const { logout: i, getAccessTokenSilently: r } = ut(), [s, c] =
|
|
1240
|
+
const { logout: i, getAccessTokenSilently: r } = ut(), [s, c] = B(0), d = () => N(void 0, null, function* () {
|
|
1240
1241
|
i({ logoutParams: { returnTo: `${window.location.origin}` } });
|
|
1241
|
-
}), l = () =>
|
|
1242
|
+
}), l = () => N(void 0, null, function* () {
|
|
1242
1243
|
c(s + 1), t();
|
|
1243
1244
|
});
|
|
1244
1245
|
return ie(() => {
|
|
1245
|
-
(() =>
|
|
1246
|
+
(() => N(void 0, null, function* () {
|
|
1246
1247
|
if (s > 0) {
|
|
1247
|
-
const
|
|
1248
|
+
const A = yield r({ cacheMode: "off" }), g = zn(A) * 1e3;
|
|
1248
1249
|
n(g);
|
|
1249
1250
|
}
|
|
1250
1251
|
}))();
|
|
@@ -1307,11 +1308,11 @@ function Mo({
|
|
|
1307
1308
|
let d = "Auth error", l = "An unknown Auth0 error occurred.";
|
|
1308
1309
|
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__ */ h(je, { open: !0, children: [
|
|
1309
1310
|
/* @__PURE__ */ o(tt, { children: d }),
|
|
1310
|
-
/* @__PURE__ */ o(nt, { children: /* @__PURE__ */ o(
|
|
1311
|
+
/* @__PURE__ */ o(nt, { children: /* @__PURE__ */ o(E, { children: l }) }),
|
|
1311
1312
|
/* @__PURE__ */ o(ot, { children: /* @__PURE__ */ o(re, { onClick: () => c({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
|
|
1312
1313
|
] });
|
|
1313
1314
|
}
|
|
1314
|
-
return n ? /* @__PURE__ */ o(
|
|
1315
|
+
return n ? /* @__PURE__ */ o(L, { children: e }) : /* @__PURE__ */ o(ln, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
|
|
1315
1316
|
}
|
|
1316
1317
|
const Xn = {
|
|
1317
1318
|
autoHideDuration: 6e3,
|
|
@@ -1347,62 +1348,62 @@ function eo(s) {
|
|
|
1347
1348
|
"children"
|
|
1348
1349
|
]);
|
|
1349
1350
|
var f;
|
|
1350
|
-
const [{ open: d }, l] =
|
|
1351
|
+
const [{ open: d }, l] = B({ open: !1 }), u = ge([]), w = ge(Date.now()), x = ge(0), A = oe((m) => {
|
|
1351
1352
|
l({ open: m });
|
|
1352
1353
|
}, []), g = oe((m = {}) => {
|
|
1353
|
-
x.current += 1, u.current.length >= Ve && Date.now() -
|
|
1354
|
+
x.current += 1, u.current.length >= Ve && Date.now() - w.current >= qe && (w.current = Date.now(), console.error(
|
|
1354
1355
|
`SaladBarProvider: MAX_QUEUE_LENGTH (${Ve}) hit ${x.current} times in last ${qe}ms)`
|
|
1355
1356
|
), x.current = 0);
|
|
1356
|
-
const C = a(
|
|
1357
|
+
const C = a(k(a({}, Ge), {
|
|
1357
1358
|
key: Kn()
|
|
1358
1359
|
}), m);
|
|
1359
1360
|
return u.current.push(C), u.current.length === 1 && l({ open: !0 }), C.key;
|
|
1360
|
-
}, []),
|
|
1361
|
-
const C = u.current.findIndex((
|
|
1361
|
+
}, []), y = (m = "", C = {}) => g(a({ message: m, severity: "success" }, C)), b = (m = "", C = {}) => g(a({ message: m, severity: "info" }, C)), D = (m = "", C = {}) => g(a({ message: m, severity: "warning" }, C)), I = (m = "", C = {}) => g(a({ message: m, severity: "error" }, C)), O = (m) => {
|
|
1362
|
+
const C = u.current.findIndex((M) => M.key === m);
|
|
1362
1363
|
if (C !== -1)
|
|
1363
1364
|
return C === 0 ? (l({ open: !1 }), u.current[0]) : u.current.splice(C, 1);
|
|
1364
|
-
},
|
|
1365
|
+
}, F = (m, C) => {
|
|
1365
1366
|
n(m, C) && l({ open: !1 });
|
|
1366
|
-
},
|
|
1367
|
-
},
|
|
1367
|
+
}, P = () => {
|
|
1368
|
+
}, S = () => {
|
|
1368
1369
|
u.current.shift(), u.current.length > 0 && l({ open: !0 });
|
|
1369
|
-
},
|
|
1370
|
-
"autoHideDuration" in
|
|
1370
|
+
}, v = (f = u.current[0]) != null ? f : a({}, Ge), H = {};
|
|
1371
|
+
"autoHideDuration" in v && (H.autoHideDuration = v.autoHideDuration);
|
|
1371
1372
|
const W = a(a({}, Xn), r), p = a(a({
|
|
1372
1373
|
open: d,
|
|
1373
|
-
setOpen:
|
|
1374
|
+
setOpen: A,
|
|
1374
1375
|
enqueueNotification: g,
|
|
1375
|
-
enqueueSuccessNotification:
|
|
1376
|
+
enqueueSuccessNotification: y,
|
|
1376
1377
|
enqueueInfoNotification: b,
|
|
1377
|
-
enqueueWarningNotification:
|
|
1378
|
+
enqueueWarningNotification: D,
|
|
1378
1379
|
enqueueErrorNotification: I,
|
|
1379
|
-
removeNotification:
|
|
1380
|
+
removeNotification: O
|
|
1380
1381
|
}, e), t);
|
|
1381
1382
|
return /* @__PURE__ */ h(Dt.Provider, { value: p, children: [
|
|
1382
1383
|
i,
|
|
1383
1384
|
/* @__PURE__ */ o(
|
|
1384
1385
|
Vt,
|
|
1385
|
-
|
|
1386
|
+
k(a(a({}, W), H), {
|
|
1386
1387
|
open: d,
|
|
1387
|
-
onClose:
|
|
1388
|
+
onClose: F,
|
|
1388
1389
|
TransitionProps: {
|
|
1389
|
-
onExited:
|
|
1390
|
-
onExit:
|
|
1390
|
+
onExited: S,
|
|
1391
|
+
onExit: P
|
|
1391
1392
|
},
|
|
1392
1393
|
sx: { zIndex: Yn },
|
|
1393
1394
|
children: /* @__PURE__ */ h("div", { children: [
|
|
1394
1395
|
/* @__PURE__ */ o(
|
|
1395
1396
|
qt,
|
|
1396
1397
|
{
|
|
1397
|
-
onClose: (m) =>
|
|
1398
|
-
severity:
|
|
1398
|
+
onClose: (m) => F(m, "closeAlert"),
|
|
1399
|
+
severity: v.severity,
|
|
1399
1400
|
variant: "filled",
|
|
1400
|
-
icon:
|
|
1401
|
-
style:
|
|
1402
|
-
children:
|
|
1401
|
+
icon: v.progressIndicator === "circular" ? /* @__PURE__ */ o(ke, { size: "1em" }) : void 0,
|
|
1402
|
+
style: v.progressIndicator === "linear" ? Jn : void 0,
|
|
1403
|
+
children: v.message
|
|
1403
1404
|
}
|
|
1404
1405
|
),
|
|
1405
|
-
|
|
1406
|
+
v.progressIndicator === "linear" && /* @__PURE__ */ o(et, { color: "primary" })
|
|
1406
1407
|
] })
|
|
1407
1408
|
})
|
|
1408
1409
|
)
|
|
@@ -1415,15 +1416,15 @@ function to() {
|
|
|
1415
1416
|
return e;
|
|
1416
1417
|
}
|
|
1417
1418
|
const Ro = X(
|
|
1418
|
-
(e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(eo,
|
|
1419
|
+
(e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(eo, k(a({}, e), { overrideState: t, overrideActions: n, children: i }))
|
|
1419
1420
|
), no = en(), Ho = ({
|
|
1420
1421
|
children: e,
|
|
1421
1422
|
store: t
|
|
1422
1423
|
}) => /* @__PURE__ */ o(ct, { store: t != null ? t : no, children: e }), yt = "domainCode";
|
|
1423
1424
|
var Qe;
|
|
1424
|
-
const Xe =
|
|
1425
|
+
const Xe = _(
|
|
1425
1426
|
JSON.parse((Qe = localStorage.getItem(yt)) != null ? Qe : '{"domainCode": ""}').domainCode
|
|
1426
|
-
), $t =
|
|
1427
|
+
), $t = _(
|
|
1427
1428
|
(e) => e(Xe),
|
|
1428
1429
|
(e, t, n) => {
|
|
1429
1430
|
t(Xe, n), localStorage.setItem(yt, JSON.stringify({ domainCode: n }));
|
|
@@ -1451,21 +1452,21 @@ const Xe = L(
|
|
|
1451
1452
|
applicationName: r,
|
|
1452
1453
|
handleLogout: s
|
|
1453
1454
|
}) => {
|
|
1454
|
-
const [c, d] = V($t), [l, u] =
|
|
1455
|
-
l ? (d(l),
|
|
1456
|
-
}), b = () =>
|
|
1457
|
-
c && !x && !
|
|
1455
|
+
const [c, d] = V($t), [l, u] = B(c), { enqueueSuccessNotification: w } = to(), x = i.length === 0, A = !!c && !i.includes(c) && !i.includes(l), g = !c || x || A, y = () => N(void 0, null, function* () {
|
|
1456
|
+
l ? (d(l), w(`Set domain to ${l}`), n()) : d("");
|
|
1457
|
+
}), b = () => N(void 0, null, function* () {
|
|
1458
|
+
c && !x && !A ? (u(c), n()) : g && s();
|
|
1458
1459
|
});
|
|
1459
|
-
let
|
|
1460
|
-
return x ?
|
|
1460
|
+
let D;
|
|
1461
|
+
return x ? D = "Unable to retrieve your active organisations. Try logging in again." : A && (D = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ h(
|
|
1461
1462
|
St,
|
|
1462
1463
|
{
|
|
1463
1464
|
isOpen: t,
|
|
1464
1465
|
dialogTitle: "Select an organisation",
|
|
1465
1466
|
primaryButton: {
|
|
1466
1467
|
text: "Confirm",
|
|
1467
|
-
onClick:
|
|
1468
|
-
disabled: !l || x ||
|
|
1468
|
+
onClick: y,
|
|
1469
|
+
disabled: !l || x || A,
|
|
1469
1470
|
buttonColor: "primary"
|
|
1470
1471
|
},
|
|
1471
1472
|
secondaryButton: {
|
|
@@ -1475,7 +1476,7 @@ const Xe = L(
|
|
|
1475
1476
|
onClose: g ? () => {
|
|
1476
1477
|
} : n,
|
|
1477
1478
|
children: [
|
|
1478
|
-
/* @__PURE__ */ h(
|
|
1479
|
+
/* @__PURE__ */ h(E, { marginBottom: 2, children: [
|
|
1479
1480
|
"Select the default organisation that you want to use with the ",
|
|
1480
1481
|
r,
|
|
1481
1482
|
"."
|
|
@@ -1487,16 +1488,16 @@ const Xe = L(
|
|
|
1487
1488
|
multiple: !1,
|
|
1488
1489
|
disableClearable: !1,
|
|
1489
1490
|
value: l !== "" ? l : null,
|
|
1490
|
-
onChange: (I,
|
|
1491
|
+
onChange: (I, O) => u(O != null ? O : ""),
|
|
1491
1492
|
getOptionLabel: io,
|
|
1492
1493
|
options: [...i],
|
|
1493
1494
|
renderInput: (I) => /* @__PURE__ */ o(
|
|
1494
1495
|
Se,
|
|
1495
|
-
|
|
1496
|
+
k(a({}, I), {
|
|
1496
1497
|
variant: "filled",
|
|
1497
1498
|
label: "Select organisation",
|
|
1498
|
-
InputProps:
|
|
1499
|
-
endAdornment: /* @__PURE__ */ h(
|
|
1499
|
+
InputProps: k(a({}, I.InputProps), {
|
|
1500
|
+
endAdornment: /* @__PURE__ */ h(L, { children: [
|
|
1500
1501
|
e ? /* @__PURE__ */ o(ke, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
|
|
1501
1502
|
I.InputProps.endAdornment
|
|
1502
1503
|
] })
|
|
@@ -1505,7 +1506,7 @@ const Xe = L(
|
|
|
1505
1506
|
)
|
|
1506
1507
|
}
|
|
1507
1508
|
),
|
|
1508
|
-
|
|
1509
|
+
D && /* @__PURE__ */ o(Xt, { error: !0, children: D })
|
|
1509
1510
|
]
|
|
1510
1511
|
}
|
|
1511
1512
|
);
|
|
@@ -1662,7 +1663,7 @@ const Xe = L(
|
|
|
1662
1663
|
}, Go = X(() => ({ children: e }) => /* @__PURE__ */ o(ct, { children: e })), ao = ({
|
|
1663
1664
|
initialValues: e,
|
|
1664
1665
|
children: t
|
|
1665
|
-
}) => (dt(e), /* @__PURE__ */ o(
|
|
1666
|
+
}) => (dt(e), /* @__PURE__ */ o(L, { children: t })), Vo = X(
|
|
1666
1667
|
(e) => ({ children: t }) => /* @__PURE__ */ o(
|
|
1667
1668
|
ao,
|
|
1668
1669
|
{
|