@australiangreens/ag-internal-components 0.1.3 → 0.1.5

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/esm/index.js CHANGED
@@ -2,14 +2,14 @@ var Lt = Object.defineProperty, _t = Object.defineProperties;
2
2
  var Mt = Object.getOwnPropertyDescriptors;
3
3
  var ne = Object.getOwnPropertySymbols;
4
4
  var Be = Object.prototype.hasOwnProperty, Oe = Object.prototype.propertyIsEnumerable;
5
- var he = (e, t, n) => t in e ? Lt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, s = (e, t) => {
5
+ var he = (e, t, n) => t in e ? Lt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, a = (e, t) => {
6
6
  for (var n in t || (t = {}))
7
7
  Be.call(t, n) && he(e, n, t[n]);
8
8
  if (ne)
9
9
  for (var n of ne(t))
10
10
  Oe.call(t, n) && he(e, n, t[n]);
11
11
  return e;
12
- }, y = (e, t) => _t(e, Mt(t));
12
+ }, k = (e, t) => _t(e, Mt(t));
13
13
  var Ee = (e, t) => {
14
14
  var n = {};
15
15
  for (var i in e)
@@ -21,43 +21,43 @@ var Ee = (e, t) => {
21
21
  };
22
22
  var Fe = (e, t, n) => (he(e, typeof t != "symbol" ? t + "" : t, n), n);
23
23
  var L = (e, t, n) => new Promise((i, r) => {
24
- var l = (a) => {
24
+ var s = (d) => {
25
25
  try {
26
- p(n.next(a));
27
- } catch (d) {
28
- r(d);
26
+ l(n.next(d));
27
+ } catch (u) {
28
+ r(u);
29
29
  }
30
- }, c = (a) => {
30
+ }, c = (d) => {
31
31
  try {
32
- p(n.throw(a));
33
- } catch (d) {
34
- r(d);
32
+ l(n.throw(d));
33
+ } catch (u) {
34
+ r(u);
35
35
  }
36
- }, p = (a) => a.done ? i(a.value) : Promise.resolve(a.value).then(l, c);
37
- p((n = n.apply(e, t)).next());
36
+ }, l = (d) => d.done ? i(d.value) : Promise.resolve(d.value).then(s, c);
37
+ l((n = n.apply(e, t)).next());
38
38
  });
39
- import { jsxs as u, Fragment as F, jsx as o } from "react/jsx-runtime";
40
- import { useState as E, createContext as Je, useCallback as re, useContext as Ze, useEffect as K, createElement as xe, useRef as ge } from "react";
41
- import { Typography as B, Button as ae, Paper as je, Box as $, Drawer as we, styled as Ae, IconButton as J, Container as et, useTheme as se, useMediaQuery as Rt, Collapse as Ht, Avatar as Pe, Fade as Wt, Skeleton as Ne, Toolbar as zt, Divider as Le, CssBaseline as Ut, Dialog as tt, LinearProgress as nt, DialogTitle as ot, DialogContent as it, DialogActions as rt, Autocomplete as Se, TextField as be, CircularProgress as De, Chip as Gt, Tooltip as Vt, Stack as qt, Snackbar as Xt, Alert as Qt, FormHelperText as Yt } from "@mui/material";
42
- import Kt from "@mui/material/CssBaseline";
39
+ import { jsxs as h, Fragment as F, jsx as o } from "react/jsx-runtime";
40
+ import { useState as E, createContext as Je, useCallback as re, useContext as Ze, useEffect as K, createElement as xe, useMemo as Rt, useRef as ge } from "react";
41
+ import { Typography as B, Button as ae, Paper as je, Box as I, Drawer as we, styled as Ae, IconButton as J, Container as et, useTheme as se, useMediaQuery as Ht, Collapse as Wt, Avatar as Pe, Fade as zt, Skeleton as Ne, Toolbar as Ut, Divider as Le, CssBaseline as Gt, Dialog as tt, LinearProgress as nt, DialogTitle as ot, DialogContent as it, DialogActions as rt, Autocomplete as Se, TextField as be, CircularProgress as De, Chip as Vt, Tooltip as qt, Stack as Xt, Snackbar as Qt, Alert as Yt, FormHelperText as Kt } from "@mui/material";
42
+ import Jt from "@mui/material/CssBaseline";
43
43
  import { styled as R, createTheme as at, alpha as fe } from "@mui/material/styles";
44
- import { AgError as Jt } from "@australiangreens/ag-error";
44
+ import { AgError as Zt } from "@australiangreens/ag-error";
45
45
  import { createHelper as Q } from "souvlaki";
46
- import { BrowserRouter as Zt } from "react-router-dom";
46
+ import { BrowserRouter as jt } from "react-router-dom";
47
47
  import st from "@mui/material/List";
48
- import { ArrowForward as lt, ArrowBack as ct, ViewHeadline as jt, Cancel as en, ArrowDropDown as tn } from "@mui/icons-material";
49
- import { atom as _, useSetAtom as dt, useAtomValue as _e, useAtom as V, getDefaultStore as nn, Provider as pt } from "jotai";
50
- import { useHydrateAtoms as ut } from "jotai/utils";
48
+ import { ArrowForward as lt, ArrowBack as ct, ViewHeadline as en, Cancel as tn, ArrowDropDown as nn } from "@mui/icons-material";
49
+ import { atom as _, useSetAtom as dt, useAtomValue as _e, useAtom as V, getDefaultStore as on, Provider as ut } from "jotai";
50
+ import { useHydrateAtoms as pt } from "jotai/utils";
51
51
  import Me from "react-avatar";
52
- import on from "autosuggest-highlight/match";
53
- import rn from "autosuggest-highlight/parse";
54
- import { useQuery as an, QueryClient as sn, QueryClientProvider as ln } from "@tanstack/react-query";
52
+ import rn from "autosuggest-highlight/match";
53
+ import an from "autosuggest-highlight/parse";
54
+ import { useQuery as sn, QueryClient as ln, QueryClientProvider as cn } from "@tanstack/react-query";
55
55
  import { useAuth0 as ht } from "@auth0/auth0-react";
56
- import { Buffer as cn } from "buffer";
57
- import dn from "@mui/material/Skeleton";
58
- function To({ text: e }) {
56
+ import { Buffer as dn } from "buffer";
57
+ import un from "@mui/material/Skeleton";
58
+ function Bo({ text: e }) {
59
59
  const [t, n] = E(0);
60
- return /* @__PURE__ */ u(F, { children: [
60
+ return /* @__PURE__ */ h(F, { children: [
61
61
  /* @__PURE__ */ o(B, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
62
62
  /* @__PURE__ */ o(B, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
63
63
  /* @__PURE__ */ o(
@@ -69,11 +69,11 @@ function To({ text: e }) {
69
69
  children: "Hello I am a button"
70
70
  }
71
71
  ),
72
- /* @__PURE__ */ u("p", { children: [
72
+ /* @__PURE__ */ h("p", { children: [
73
73
  "This is some text: ",
74
74
  /* @__PURE__ */ o("span", { children: e })
75
75
  ] }),
76
- /* @__PURE__ */ u(je, { children: [
76
+ /* @__PURE__ */ h(je, { children: [
77
77
  "This number will incremember when button pressed: ",
78
78
  t
79
79
  ] })
@@ -87,7 +87,7 @@ const gt = 330, ft = 73, U = "Navbar", q = {
87
87
  userInfoHolder: `${U}-userInfoHolder`,
88
88
  settings: `${U}-settings`,
89
89
  pieChartIcon: `${U}-pieChartIcon`
90
- }, pn = R($, {
90
+ }, pn = R(I, {
91
91
  name: "NavBar"
92
92
  })(({ theme: e }) => ({
93
93
  [`&.${q.root}`]: {
@@ -116,51 +116,51 @@ const gt = 330, ft = 73, U = "Navbar", q = {
116
116
  color: "white",
117
117
  backgroundColor: "black"
118
118
  // backgroundColor: '#e8e8e8',
119
- }), un = () => s({
119
+ }), hn = () => a({
120
120
  width: gt
121
- }, mt()), hn = () => s({
121
+ }, mt()), gn = () => a({
122
122
  width: ft
123
- }, mt()), gn = R(we, {
123
+ }, mt()), fn = R(we, {
124
124
  shouldForwardProp: (e) => e !== "open"
125
- })(({ theme: e, open: t }) => s(s({
125
+ })(({ theme: e, open: t }) => a(a({
126
126
  width: t ? gt : ft,
127
127
  flexShrink: 0,
128
128
  whiteSpace: "nowrap",
129
129
  boxSizing: "border-box",
130
130
  zIndex: e.zIndex.drawer + 100
131
131
  }, t && {
132
- "& .MuiDrawer-paper": un()
133
- }), !t && {
134
132
  "& .MuiDrawer-paper": hn()
133
+ }), !t && {
134
+ "& .MuiDrawer-paper": gn()
135
135
  }));
136
- class ke extends Jt {
136
+ class ke extends Zt {
137
137
  }
138
138
  Fe(ke, "errorName", "ContextError");
139
- const Ct = Je(null), fn = {}, mn = {}, Cn = ({
140
- overrideState: e = fn,
141
- overrideActions: t = mn,
139
+ const Ct = Je(null), mn = {}, Cn = {}, xn = ({
140
+ overrideState: e = mn,
141
+ overrideActions: t = Cn,
142
142
  children: n
143
143
  }) => {
144
- const [{ open: i }, r] = E({ open: !0 }), l = re((a) => {
145
- r({ open: a });
144
+ const [{ open: i }, r] = E({ open: !0 }), s = re((d) => {
145
+ r({ open: d });
146
146
  }, []), c = re(() => {
147
- r((a) => y(s({}, a), { open: !a.open }));
148
- }, []), p = s(s({
147
+ r((d) => k(a({}, d), { open: !d.open }));
148
+ }, []), l = a(a({
149
149
  open: i,
150
- setOpen: l,
150
+ setOpen: s,
151
151
  toggleOpen: c
152
152
  }, e), t);
153
- return /* @__PURE__ */ o(Ct.Provider, { value: p, children: n });
154
- }, xn = () => {
153
+ return /* @__PURE__ */ o(Ct.Provider, { value: l, children: n });
154
+ }, vn = () => {
155
155
  const e = Ze(Ct);
156
156
  if (e === null)
157
157
  throw new ke("Error: Tried to useNavBar outside of a <NavBarProvider>");
158
158
  return e;
159
- }, vn = (e = {}) => s({
159
+ }, wn = (e = {}) => a({
160
160
  open: !0
161
- }, e), Bo = Q(
162
- (e = vn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(Cn, { overrideState: e, overrideActions: t, children: n })
163
- ), Oo = Q(() => ({ children: e }) => /* @__PURE__ */ o(Zt, { children: e })), Re = 7, Eo = R(st)(({ theme: e }) => ({
161
+ }, e), Oo = Q(
162
+ (e = wn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(xn, { overrideState: e, overrideActions: t, children: n })
163
+ ), Eo = Q(() => ({ children: e }) => /* @__PURE__ */ o(jt, { children: e })), Re = 7, Fo = R(st)(({ theme: e }) => ({
164
164
  backgroundColor: "black",
165
165
  color: "white",
166
166
  "& .MuiListItem-root": {
@@ -198,7 +198,7 @@ const Ct = Je(null), fn = {}, mn = {}, Cn = ({
198
198
  // '&.Mui-selected.Mui-focusVisible:hover': {
199
199
  // },
200
200
  }
201
- })), He = 7, Fo = R(st)(({ theme: e }) => ({
201
+ })), He = 7, Po = R(st)(({ theme: e }) => ({
202
202
  backgroundColor: "#e8e8e8",
203
203
  color: "inherit",
204
204
  "& .MuiListItem-root": {
@@ -237,15 +237,15 @@ const Ct = Je(null), fn = {}, mn = {}, Cn = ({
237
237
  // },
238
238
  }
239
239
  }));
240
- function Po({
240
+ function No({
241
241
  "data-testid": e,
242
242
  children: t
243
243
  }) {
244
- const { open: n } = xn();
245
- return /* @__PURE__ */ u(pn, { className: q.root, "data-testid": e, children: [
246
- /* @__PURE__ */ o(Kt, {}),
244
+ const { open: n } = vn();
245
+ return /* @__PURE__ */ h(pn, { className: q.root, "data-testid": e, children: [
246
+ /* @__PURE__ */ o(Jt, {}),
247
247
  /* @__PURE__ */ o(
248
- gn,
248
+ fn,
249
249
  {
250
250
  variant: "permanent",
251
251
  anchor: "left",
@@ -256,14 +256,14 @@ function Po({
256
256
  )
257
257
  ] });
258
258
  }
259
- const wn = 24, An = 64, G = "TopBar", O = {
259
+ const An = 24, Sn = 64, G = "TopBar", O = {
260
260
  topStripe: `${G}-topStripe`,
261
261
  titleBar: `${G}-titleBar`,
262
262
  titleSlider: `${G}-titleSlider`,
263
263
  titleText: `${G}-titleText`,
264
264
  leftPanelButton: `${G}-leftPanelButton`,
265
265
  rightPanelButton: `${G}-leftPanelButton`
266
- }, Sn = Ae("div", {
266
+ }, bn = Ae("div", {
267
267
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
268
268
  name: G
269
269
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
@@ -272,16 +272,16 @@ const wn = 24, An = 64, G = "TopBar", O = {
272
272
  width: "100%",
273
273
  [`& .${O.topStripe}`]: {
274
274
  width: "100%",
275
- height: `${wn}px`,
275
+ height: `${An}px`,
276
276
  backgroundColor: e.palette.primary.main
277
277
  },
278
278
  [`& .${O.titleBar}`]: {
279
279
  backgroundColor: e.palette.primary.light,
280
- height: `${An}px`,
280
+ height: `${Sn}px`,
281
281
  padding: e.spacing(0, 3),
282
282
  width: "100%"
283
283
  },
284
- [`& .${O.titleSlider}`]: s(s({
284
+ [`& .${O.titleSlider}`]: a(a({
285
285
  height: "100%",
286
286
  display: "flex",
287
287
  alignItems: "center",
@@ -315,16 +315,16 @@ const wn = 24, An = 64, G = "TopBar", O = {
315
315
  })
316
316
  };
317
317
  });
318
- function bn({
318
+ function Dn({
319
319
  titleText: e = "",
320
320
  leftPanel: t,
321
321
  rightPanel: n,
322
322
  "data-testid": i
323
323
  }) {
324
- return /* @__PURE__ */ u(Sn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
324
+ return /* @__PURE__ */ h(bn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
325
325
  /* @__PURE__ */ o("div", { className: O.topStripe }),
326
- /* @__PURE__ */ o("div", { className: O.titleBar, children: /* @__PURE__ */ u($, { className: O.titleSlider, children: [
327
- t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ u(
326
+ /* @__PURE__ */ o("div", { className: O.titleBar, children: /* @__PURE__ */ h(I, { className: O.titleSlider, children: [
327
+ t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ h(
328
328
  J,
329
329
  {
330
330
  className: O.leftPanelButton,
@@ -340,7 +340,7 @@ function bn({
340
340
  }
341
341
  ),
342
342
  /* @__PURE__ */ o(B, { className: O.titleText, variant: "h6", noWrap: !0, children: e }),
343
- n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ u(
343
+ n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ h(
344
344
  J,
345
345
  {
346
346
  className: O.rightPanelButton,
@@ -358,7 +358,7 @@ function bn({
358
358
  ] }) })
359
359
  ] });
360
360
  }
361
- const xt = 400, Dn = Ae(we, {
361
+ const xt = 400, kn = Ae(we, {
362
362
  shouldForwardProp: (e) => (
363
363
  // Note we do want anchor to be forwarded to the Drawer component
364
364
  ![
@@ -372,9 +372,9 @@ const xt = 400, Dn = Ae(we, {
372
372
  ),
373
373
  name: "SidePanelDrawer"
374
374
  })(
375
- ({ width: e, debugOpacity: t = !1, anchor: n, navBarOpen: i, navBarWidthOpen: r, navBarWidthClosed: l }) => ({
375
+ ({ width: e, debugOpacity: t = !1, anchor: n, navBarOpen: i, navBarWidthOpen: r, navBarWidthClosed: s }) => ({
376
376
  width: e,
377
- "& .MuiDrawer-paper": s(s({
377
+ "& .MuiDrawer-paper": a(a({
378
378
  position: "absolute",
379
379
  width: e,
380
380
  boxSizing: "border-box",
@@ -382,15 +382,15 @@ const xt = 400, Dn = Ae(we, {
382
382
  boxShadow: "0px 4px 5px rgba(0, 0, 0, 0.14), 0px 1px 10px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.2)"
383
383
  }, t && {
384
384
  opacity: "50%"
385
- }), n === "left" && s({
386
- marginLeft: `${l}px`
385
+ }), n === "left" && a({
386
+ marginLeft: `${s}px`
387
387
  }, i && {
388
388
  marginLeft: `${r}px`
389
389
  }))
390
390
  })
391
- ), kn = Ae($, {
391
+ ), yn = Ae(I, {
392
392
  shouldForwardProp: (e) => !["anchor"].includes(e)
393
- })(({ theme: e, anchor: t }) => y(s({
393
+ })(({ theme: e, anchor: t }) => k(a({
394
394
  display: "flex",
395
395
  alignItems: "center",
396
396
  padding: e.spacing(2)
@@ -415,42 +415,42 @@ function We({
415
415
  onClose: i = () => {
416
416
  },
417
417
  titleText: r = "",
418
- width: l = xt,
418
+ width: s = xt,
419
419
  showCloseArrow: c = !0,
420
- debugOpacity: p = !1,
421
- headerBoxProps: a = {},
422
- onOpened: d,
420
+ debugOpacity: l = !1,
421
+ headerBoxProps: d = {},
422
+ onOpened: u,
423
423
  onClosed: m,
424
424
  "data-testid": f,
425
425
  navBarOpen: v = !1,
426
- navBarWidthOpen: g = 0,
427
- navBarWidthClosed: A = 0
426
+ navBarWidthOpen: p = 0,
427
+ navBarWidthClosed: S = 0
428
428
  }) {
429
- return /* @__PURE__ */ u(
430
- Dn,
429
+ return /* @__PURE__ */ h(
430
+ kn,
431
431
  {
432
432
  SlideProps: {
433
- onEntered: () => d == null ? void 0 : d(),
433
+ onEntered: () => u == null ? void 0 : u(),
434
434
  onExited: () => m == null ? void 0 : m()
435
435
  },
436
436
  variant: "persistent",
437
437
  anchor: t,
438
438
  open: n,
439
- width: l,
440
- debugOpacity: p,
439
+ width: s,
440
+ debugOpacity: l,
441
441
  "data-testid": f,
442
442
  navBarOpen: v,
443
- navBarWidthOpen: g,
444
- navBarWidthClosed: A,
443
+ navBarWidthOpen: p,
444
+ navBarWidthClosed: S,
445
445
  children: [
446
- /* @__PURE__ */ o(kn, y(s({ anchor: t }, a), { children: t === "left" ? /* @__PURE__ */ u(F, { children: [
446
+ /* @__PURE__ */ o(yn, k(a({ anchor: t }, d), { children: t === "left" ? /* @__PURE__ */ h(F, { children: [
447
447
  /* @__PURE__ */ o(B, { variant: "h6", color: "inherit", component: "div", children: r }),
448
- c && /* @__PURE__ */ u(J, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
448
+ c && /* @__PURE__ */ h(J, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
449
449
  /* @__PURE__ */ o(ct, { "data-testid": "arrowbackicon" }),
450
450
  " "
451
451
  ] })
452
- ] }) : /* @__PURE__ */ u(F, { children: [
453
- c && /* @__PURE__ */ u(J, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
452
+ ] }) : /* @__PURE__ */ h(F, { children: [
453
+ c && /* @__PURE__ */ h(J, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
454
454
  /* @__PURE__ */ o(lt, {}),
455
455
  " "
456
456
  ] }),
@@ -461,12 +461,12 @@ function We({
461
461
  }
462
462
  );
463
463
  }
464
- const yn = R($, {
464
+ const In = R(I, {
465
465
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
466
466
  name: "PanelAwareMargins"
467
467
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
468
468
  var i, r;
469
- return s(s({
469
+ return a(a({
470
470
  transition: e.transitions.create("margin", {
471
471
  easing: e.transitions.easing.sharp,
472
472
  duration: e.transitions.duration.leavingScreen
@@ -504,25 +504,25 @@ const yn = R($, {
504
504
  onClosed: void 0,
505
505
  dataTestId: void 0
506
506
  };
507
- function No({
507
+ function Lo({
508
508
  children: e,
509
509
  titleText: t = "",
510
510
  leftPanel: n,
511
511
  rightPanel: i,
512
512
  sidePanelsAreMutuallyExclusive: r = !0,
513
- debugOpacity: l = !1,
513
+ debugOpacity: s = !1,
514
514
  pageContainerProps: c,
515
- pageContentDataTestId: p,
516
- topBarDataTestId: a,
517
- navBarOpen: d,
515
+ pageContentDataTestId: l,
516
+ topBarDataTestId: d,
517
+ navBarOpen: u,
518
518
  navBarWidthOpen: m,
519
519
  navBarWidthClosed: f
520
520
  }) {
521
- const [v, g] = E(me), [A, S] = E(Ce), [D, I] = E(me), [T, P] = E(Ce), N = n !== void 0, k = i !== void 0, {
522
- titleText: b,
521
+ const [v, p] = E(me), [S, y] = E(Ce), [b, $] = E(me), [T, P] = E(Ce), N = n !== void 0, D = i !== void 0, {
522
+ titleText: A,
523
523
  content: H,
524
524
  flavour: W,
525
- open: h,
525
+ open: g,
526
526
  onChangeOpen: C,
527
527
  width: x,
528
528
  arrowButtons: w,
@@ -530,83 +530,83 @@ function No({
530
530
  onOpened: j,
531
531
  onClosed: le,
532
532
  dataTestId: Bt
533
- } = n ? s(s({}, oe), n) : s({}, oe), {
533
+ } = n ? a(a({}, oe), n) : a({}, oe), {
534
534
  titleText: Ot,
535
535
  content: Et,
536
536
  flavour: ye,
537
537
  open: ce,
538
- onChangeOpen: $e,
538
+ onChangeOpen: Ie,
539
539
  width: de,
540
540
  arrowButtons: ee,
541
541
  startOpen: te,
542
542
  onOpened: Ft,
543
543
  onClosed: Pt,
544
544
  dataTestId: Nt
545
- } = i ? s(s({}, oe), i) : s({}, oe);
545
+ } = i ? a(a({}, oe), i) : a({}, oe);
546
546
  K(() => {
547
- M !== me && (g(M), I(M));
547
+ M !== me && (p(M), $(M));
548
548
  }, [M]), K(() => {
549
- te !== Ce && (S(te), P(te));
549
+ te !== Ce && (y(te), P(te));
550
550
  }, [te]);
551
- const pe = h === void 0 ? v : h, ue = ce === void 0 ? A : ce, Ie = (z) => {
552
- h === void 0 && (g(z), r && k && (z ? (S(!1), P(A)) : S(T))), C && C(z);
551
+ const ue = g === void 0 ? v : g, pe = ce === void 0 ? S : ce, $e = (z) => {
552
+ g === void 0 && (p(z), r && D && (z ? (y(!1), P(S)) : y(T))), C && C(z);
553
553
  }, Te = (z) => {
554
- ce === void 0 && (S(z), r && N && (z ? (g(!1), I(v)) : g(D))), $e && $e(z);
554
+ ce === void 0 && (y(z), r && N && (z ? (p(!1), $(v)) : p(b))), Ie && Ie(z);
555
555
  };
556
- return /* @__PURE__ */ u($, { children: [
556
+ return /* @__PURE__ */ h(I, { children: [
557
557
  N && /* @__PURE__ */ o(
558
558
  We,
559
559
  {
560
560
  "data-testid": Bt,
561
561
  anchor: "left",
562
- open: pe,
563
- onClose: () => Ie(!1),
562
+ open: ue,
563
+ onClose: () => $e(!1),
564
564
  width: x,
565
- titleText: b,
566
- debugOpacity: l,
565
+ titleText: A,
566
+ debugOpacity: s,
567
567
  showCloseArrow: w === "both" || w === "close",
568
568
  onOpened: j,
569
569
  onClosed: le,
570
- navBarOpen: d,
570
+ navBarOpen: u,
571
571
  navBarWidthOpen: m,
572
572
  navBarWidthClosed: f,
573
573
  children: H
574
574
  }
575
575
  ),
576
- k && /* @__PURE__ */ o(
576
+ D && /* @__PURE__ */ o(
577
577
  We,
578
578
  {
579
579
  "data-testid": Nt,
580
580
  anchor: "right",
581
- open: ue,
581
+ open: pe,
582
582
  onClose: () => Te(!1),
583
583
  width: de,
584
584
  titleText: Ot,
585
- debugOpacity: l,
585
+ debugOpacity: s,
586
586
  showCloseArrow: ee === "both" || ee === "close",
587
587
  onOpened: Ft,
588
588
  onClosed: Pt,
589
- navBarOpen: d,
589
+ navBarOpen: u,
590
590
  navBarWidthOpen: m,
591
591
  navBarWidthClosed: f,
592
592
  children: Et
593
593
  }
594
594
  ),
595
595
  /* @__PURE__ */ o(
596
- bn,
597
- s(s({
596
+ Dn,
597
+ a(a({
598
598
  titleText: t,
599
- "data-testid": a
599
+ "data-testid": d
600
600
  }, N && W === "push" ? {
601
601
  leftPanel: {
602
- open: pe,
602
+ open: ue,
603
603
  width: x,
604
- onOpen: () => Ie(!0),
604
+ onOpen: () => $e(!0),
605
605
  showOpenArrow: w === "both" || w === "open"
606
606
  }
607
- } : {}), k && ye === "push" ? {
607
+ } : {}), D && ye === "push" ? {
608
608
  rightPanel: {
609
- open: ue,
609
+ open: pe,
610
610
  width: de,
611
611
  onOpen: () => Te(!0),
612
612
  showOpenArrow: ee === "both" || ee === "open"
@@ -614,28 +614,28 @@ function No({
614
614
  } : {})
615
615
  ),
616
616
  /* @__PURE__ */ o(
617
- yn,
618
- y(s(s({}, W === "push" ? {
617
+ In,
618
+ k(a(a({}, W === "push" ? {
619
619
  leftPanel: {
620
- open: pe,
620
+ open: ue,
621
621
  width: x
622
622
  }
623
623
  } : {}), ye === "push" ? {
624
624
  rightPanel: {
625
- open: ue,
625
+ open: pe,
626
626
  width: de
627
627
  }
628
628
  } : {}), {
629
- children: /* @__PURE__ */ o($n, y(s({ "data-testid": p }, c), { children: e }))
629
+ children: /* @__PURE__ */ o($n, k(a({ "data-testid": l }, c), { children: e }))
630
630
  })
631
631
  )
632
632
  ] });
633
633
  }
634
634
  const vt = () => {
635
635
  const e = se();
636
- return Rt(e.breakpoints.down("sm"));
637
- }, In = 64, Tn = 72, Bn = 256, Z = _(!0), wt = _(Bn), At = _(Tn), ve = _(""), On = _(void 0), St = _(In), bt = _(void 0);
638
- function En({ links: e }) {
636
+ return Ht(e.breakpoints.down("sm"));
637
+ }, Tn = 64, Bn = 72, On = 256, Z = _(!0), wt = _(On), At = _(Bn), ve = _(""), En = _(void 0), St = _(Tn), bt = _(void 0);
638
+ function Fn({ links: e }) {
639
639
  return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
640
640
  }
641
641
  const ie = "Navbar", Y = {
@@ -646,7 +646,7 @@ const ie = "Navbar", Y = {
646
646
  // userInfoHolder: `${PREFIX}-userInfoHolder`,
647
647
  // settings: `${PREFIX}-settings`,
648
648
  // pieChartIcon: `${PREFIX}-pieChartIcon`,
649
- }, Fn = R($, { name: "NavBar" })(({ theme: e }) => ({
649
+ }, Pn = R(I, { name: "NavBar" })(({ theme: e }) => ({
650
650
  [`&.${Y.root}`]: {
651
651
  display: "flex"
652
652
  },
@@ -668,11 +668,11 @@ const ie = "Navbar", Y = {
668
668
  })), X = (e, t, n) => e.transitions.create(t, {
669
669
  easing: e.transitions.easing.sharp,
670
670
  duration: n === "leaving" ? e.transitions.duration.leavingScreen : e.transitions.duration.enteringScreen
671
- }), Pn = (e) => {
671
+ }), Nn = (e) => {
672
672
  const t = se();
673
673
  return /* @__PURE__ */ o(
674
- Ht,
675
- s({
674
+ Wt,
675
+ a({
676
676
  easing: t.transitions.easing.sharp,
677
677
  timeout: {
678
678
  enter: t.transitions.duration.enteringScreen,
@@ -688,28 +688,28 @@ const ie = "Navbar", Y = {
688
688
  backgroundColor: (n = (t = e == null ? void 0 : e.navBar) == null ? void 0 : t.backgroundColor) != null ? n : "white"
689
689
  // Provide default so tests don't need to wrap theme provider
690
690
  };
691
- }, ze = (e, t) => s({
691
+ }, ze = (e, t) => a({
692
692
  width: t,
693
693
  transition: X(e, "width", "entering")
694
- }, Dt(e)), Ue = (e, t) => s({
694
+ }, Dt(e)), Ue = (e, t) => a({
695
695
  width: t,
696
696
  transition: X(e, "width", "leaving")
697
- }, Dt(e)), Nn = R(we, {
697
+ }, Dt(e)), Ln = R(we, {
698
698
  shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
699
- })(({ theme: e, open: t, widthOpen: n, widthClosed: i, isSmallScreen: r }) => s(s({
699
+ })(({ theme: e, open: t, widthOpen: n, widthClosed: i, isSmallScreen: r }) => a(a({
700
700
  flexShrink: 0,
701
701
  whiteSpace: "nowrap",
702
702
  boxSizing: "border-box",
703
703
  display: "flex",
704
704
  flexDirection: "column"
705
- }, t && y(s({}, ze(e, n)), {
705
+ }, t && k(a({}, ze(e, n)), {
706
706
  backgroundColor: "",
707
707
  "& .MuiDrawer-paper": ze(e, n)
708
- })), !t && y(s({}, Ue(e, r ? n : i)), {
708
+ })), !t && k(a({}, Ue(e, r ? n : i)), {
709
709
  backgroundColor: "",
710
710
  "& .MuiDrawer-paper": Ue(e, r ? n : i)
711
711
  })));
712
- function Ln(e) {
712
+ function _n(e) {
713
713
  let t = 0;
714
714
  for (let n = 0, i = e.length; n < i; n++) {
715
715
  const r = e.charCodeAt(n);
@@ -718,10 +718,10 @@ function Ln(e) {
718
718
  return t;
719
719
  }
720
720
  const Ge = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Ve = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
721
- function _n({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
721
+ function Mn({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
722
722
  const r = se();
723
- return /* @__PURE__ */ u(
724
- $,
723
+ return /* @__PURE__ */ h(
724
+ I,
725
725
  {
726
726
  sx: {
727
727
  paddingTop: 3,
@@ -732,7 +732,7 @@ function _n({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
732
732
  },
733
733
  children: [
734
734
  !i && /* @__PURE__ */ o(
735
- $,
735
+ I,
736
736
  {
737
737
  sx: {
738
738
  width: n ? "5rem" : "2rem",
@@ -746,7 +746,7 @@ function _n({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
746
746
  sx: {
747
747
  width: "100%",
748
748
  height: "100%",
749
- bgcolor: Ge[Math.abs(Ln(e == null ? void 0 : e.name)) % Ge.length]
749
+ bgcolor: Ge[Math.abs(_n(e == null ? void 0 : e.name)) % Ge.length]
750
750
  },
751
751
  children: Ve(e == null ? void 0 : e.name)
752
752
  }
@@ -754,14 +754,14 @@ function _n({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
754
754
  }
755
755
  ),
756
756
  i && /* @__PURE__ */ o(
757
- $,
757
+ I,
758
758
  {
759
759
  sx: {
760
760
  width: n ? "5rem" : "2rem",
761
761
  transition: n ? X(r, ["width", "height"], "entering") : X(r, ["width", "height"], "leaving"),
762
762
  aspectRatio: 1
763
763
  },
764
- children: e != null && e.name ? /* @__PURE__ */ o(F, { children: /* @__PURE__ */ u(Me, { src: e == null ? void 0 : e.picture, name: e == null ? void 0 : e.name, round: !0, size: n ? "80" : "32", children: [
764
+ children: e != null && e.name ? /* @__PURE__ */ o(F, { children: /* @__PURE__ */ h(Me, { src: e == null ? void 0 : e.picture, name: e == null ? void 0 : e.name, round: !0, size: n ? "80" : "32", children: [
765
765
  " ",
766
766
  Ve(e == null ? void 0 : e.name),
767
767
  " ",
@@ -769,7 +769,7 @@ function _n({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
769
769
  ] }) }) : /* @__PURE__ */ o(Me, {})
770
770
  }
771
771
  ),
772
- /* @__PURE__ */ o(Pn, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Wt, { in: n, children: /* @__PURE__ */ u($, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
772
+ /* @__PURE__ */ o(Nn, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(zt, { in: n, children: /* @__PURE__ */ h(I, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
773
773
  e != null && e.name ? /* @__PURE__ */ o(B, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "50%" }),
774
774
  t ? /* @__PURE__ */ o(B, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "25%" })
775
775
  ] }) }) })
@@ -777,21 +777,21 @@ function _n({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
777
777
  }
778
778
  );
779
779
  }
780
- function Mn({
780
+ function Rn({
781
781
  open: e,
782
782
  widthClosed: t,
783
783
  widthOpen: n,
784
784
  "data-testid": i,
785
785
  top: r,
786
- middle: l,
786
+ middle: s,
787
787
  bottom: c,
788
- user: p,
789
- domainCode: a,
790
- useNewAvatar: d = !1
788
+ user: l,
789
+ domainCode: d,
790
+ useNewAvatar: u = !1
791
791
  }) {
792
792
  const m = vt(), f = dt(Z);
793
- return /* @__PURE__ */ o(Fn, { className: Y.root, "data-testid": i, children: /* @__PURE__ */ u(
794
- Nn,
793
+ return /* @__PURE__ */ o(Pn, { className: Y.root, "data-testid": i, children: /* @__PURE__ */ h(
794
+ Ln,
795
795
  {
796
796
  open: e,
797
797
  widthOpen: n,
@@ -806,36 +806,36 @@ function Mn({
806
806
  },
807
807
  isSmallScreen: m,
808
808
  children: [
809
- !m && /* @__PURE__ */ o(zt, {}),
810
- r && /* @__PURE__ */ u($, { flexGrow: "0", children: [
809
+ !m && /* @__PURE__ */ o(Ut, {}),
810
+ r && /* @__PURE__ */ h(I, { flexGrow: "0", children: [
811
811
  r,
812
812
  /* @__PURE__ */ o(Le, { variant: "middle", sx: { marginY: "0.5rem" } })
813
813
  ] }),
814
- /* @__PURE__ */ o($, { flexGrow: "1", children: Array.isArray(l) ? /* @__PURE__ */ o(En, { links: l }) : l }),
815
- /* @__PURE__ */ u($, { flexGrow: "0", children: [
814
+ /* @__PURE__ */ o(I, { flexGrow: "1", children: Array.isArray(s) ? /* @__PURE__ */ o(Fn, { links: s }) : s }),
815
+ /* @__PURE__ */ h(I, { flexGrow: "0", children: [
816
816
  /* @__PURE__ */ o(Le, { variant: "middle", sx: { marginY: "0.5rem" } }),
817
- /* @__PURE__ */ o(_n, { user: p, domainCode: a, open: e, useNewAvatar: d }),
817
+ /* @__PURE__ */ o(Mn, { user: l, domainCode: d, open: e, useNewAvatar: u }),
818
818
  c && /* @__PURE__ */ o(F, { children: c })
819
819
  ] })
820
820
  ]
821
821
  }
822
822
  ) });
823
823
  }
824
- function Rn({
824
+ function Hn({
825
825
  children: e,
826
826
  topBarHeight: t,
827
827
  maxWidth: n = !1,
828
828
  noPadding: i
829
829
  }) {
830
830
  return /* @__PURE__ */ o(
831
- $,
831
+ I,
832
832
  {
833
833
  sx: {
834
834
  overflow: "auto",
835
835
  height: `calc(100vh - ${t}px)`,
836
836
  flexGrow: 1
837
837
  },
838
- children: i ? /* @__PURE__ */ o($, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ o(
838
+ children: i ? /* @__PURE__ */ o(I, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ o(
839
839
  et,
840
840
  {
841
841
  component: "main",
@@ -848,17 +848,17 @@ function Rn({
848
848
  }
849
849
  );
850
850
  }
851
- const Hn = "TopBar", Wn = {
852
- titleText: `${Hn}-titleText`
851
+ const Wn = "TopBar", zn = {
852
+ titleText: `${Wn}-titleText`
853
853
  };
854
- function zn({
854
+ function Un({
855
855
  titleText: e = "",
856
856
  height: t,
857
857
  "data-testid": n,
858
858
  middle: i
859
859
  }) {
860
- const r = dt(Z), l = () => r((a) => !a), c = se(), p = vt();
861
- return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ u(
860
+ const r = dt(Z), s = () => r((d) => !d), c = se(), l = vt();
861
+ return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ h(
862
862
  je,
863
863
  {
864
864
  square: !0,
@@ -873,7 +873,7 @@ function zn({
873
873
  gap: 2,
874
874
  flexShrink: 0,
875
875
  height: t,
876
- zIndex: p ? 0 : c.zIndex.drawer + 1
876
+ zIndex: l ? 0 : c.zIndex.drawer + 1
877
877
  },
878
878
  children: [
879
879
  /* @__PURE__ */ o(
@@ -882,68 +882,68 @@ function zn({
882
882
  size: "medium",
883
883
  color: "inherit",
884
884
  sx: { padding: 1.5, marginLeft: "12px" },
885
- onClick: l,
886
- children: /* @__PURE__ */ o(jt, { fontSize: "medium" })
885
+ onClick: s,
886
+ children: /* @__PURE__ */ o(en, { fontSize: "medium" })
887
887
  }
888
888
  ),
889
- /* @__PURE__ */ o(B, { className: Wn.titleText, variant: "h6", component: "h1", children: e }),
889
+ /* @__PURE__ */ o(B, { className: zn.titleText, variant: "h6", component: "h1", children: e }),
890
890
  i
891
891
  ]
892
892
  }
893
893
  ) });
894
894
  }
895
- function Lo({
895
+ function _o({
896
896
  children: e,
897
897
  initialTitleText: t,
898
898
  initialNavBarOpen: n,
899
899
  pageContainerProps: i,
900
900
  pageContentDataTestId: r,
901
- topBarDataTestId: l,
901
+ topBarDataTestId: s,
902
902
  navBarDataTestId: c,
903
- navBarMiddle: p,
904
- navBarBottom: a,
905
- user: d,
903
+ navBarMiddle: l,
904
+ navBarBottom: d,
905
+ user: u,
906
906
  domainCode: m,
907
907
  useNewAvatar: f = !1
908
908
  }) {
909
- ut([
909
+ pt([
910
910
  [Z, n != null ? n : !0],
911
911
  [ve, t != null ? t : ""]
912
912
  ]);
913
- const v = _e(Z), [g] = V(wt), [A] = V(At), S = _e(ve), [D] = V(St), [I] = V(On), [T] = V(bt);
914
- return /* @__PURE__ */ u($, { children: [
915
- /* @__PURE__ */ o(Ut, {}),
913
+ const v = _e(Z), [p] = V(wt), [S] = V(At), y = _e(ve), [b] = V(St), [$] = V(En), [T] = V(bt);
914
+ return /* @__PURE__ */ h(I, { children: [
915
+ /* @__PURE__ */ o(Gt, {}),
916
916
  /* @__PURE__ */ o(
917
- zn,
917
+ Un,
918
918
  {
919
- titleText: S,
920
- "data-testid": l,
921
- height: D,
922
- middle: I
919
+ titleText: y,
920
+ "data-testid": s,
921
+ height: b,
922
+ middle: $
923
923
  }
924
924
  ),
925
- /* @__PURE__ */ u($, { sx: { display: "flex" }, children: [
925
+ /* @__PURE__ */ h(I, { sx: { display: "flex" }, children: [
926
926
  /* @__PURE__ */ o(
927
- Mn,
927
+ Rn,
928
928
  {
929
929
  open: v,
930
930
  top: T,
931
- middle: p,
932
- bottom: a,
933
- user: d,
931
+ middle: l,
932
+ bottom: d,
933
+ user: u,
934
934
  domainCode: m,
935
- widthOpen: g,
936
- widthClosed: A,
937
- offsetTop: D,
935
+ widthOpen: p,
936
+ widthClosed: S,
937
+ offsetTop: b,
938
938
  "data-testid": c,
939
939
  useNewAvatar: f
940
940
  }
941
941
  ),
942
942
  /* @__PURE__ */ o(
943
- Rn,
944
- y(s({
943
+ Hn,
944
+ k(a({
945
945
  "data-testid": r,
946
- topBarHeight: D
946
+ topBarHeight: b
947
947
  }, i), {
948
948
  children: e
949
949
  })
@@ -957,47 +957,47 @@ const kt = ({
957
957
  children: n,
958
958
  maxWidth: i,
959
959
  primaryButton: r,
960
- secondaryButton: l,
960
+ secondaryButton: s,
961
961
  onClose: c,
962
- sx: p,
963
- "data-testid": a,
964
- disableCloseOnBackdropOrEscape: d = !1,
962
+ sx: l,
963
+ "data-testid": d,
964
+ disableCloseOnBackdropOrEscape: u = !1,
965
965
  isLoading: m = !1
966
966
  }) => {
967
- var g, A;
967
+ var p, S;
968
968
  const [f, v] = E(!1);
969
- return /* @__PURE__ */ u(
969
+ return /* @__PURE__ */ h(
970
970
  tt,
971
971
  {
972
972
  open: e,
973
- onClose: (S, D) => L(void 0, null, function* () {
974
- d && (D === "backdropClick" || D === "escapeKeyDown") || f || (l != null && l.onClick ? yield l.onClick() : c());
973
+ onClose: (y, b) => L(void 0, null, function* () {
974
+ u && (b === "backdropClick" || b === "escapeKeyDown") || f || (s != null && s.onClick ? yield s.onClick() : c());
975
975
  }),
976
976
  fullWidth: !0,
977
977
  maxWidth: i != null ? i : "xs",
978
- "data-testid": a,
979
- sx: p,
978
+ "data-testid": d,
979
+ sx: l,
980
980
  children: [
981
981
  m && /* @__PURE__ */ o(nt, { sx: { height: "4px", marginBottom: "-4px" } }),
982
982
  /* @__PURE__ */ o(ot, { children: t }),
983
983
  /* @__PURE__ */ o(it, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
984
- /* @__PURE__ */ u(rt, { children: [
984
+ /* @__PURE__ */ h(rt, { children: [
985
985
  /* @__PURE__ */ o(
986
986
  ae,
987
987
  {
988
- onClick: (g = l == null ? void 0 : l.onClick) != null ? g : c,
989
- "data-testid": l == null ? void 0 : l.testId,
990
- disabled: (l == null ? void 0 : l.disabled) || f,
991
- color: l == null ? void 0 : l.buttonColor,
992
- children: (A = l == null ? void 0 : l.text) != null ? A : "Cancel"
988
+ onClick: (p = s == null ? void 0 : s.onClick) != null ? p : c,
989
+ "data-testid": s == null ? void 0 : s.testId,
990
+ disabled: (s == null ? void 0 : s.disabled) || f,
991
+ color: s == null ? void 0 : s.buttonColor,
992
+ children: (S = s == null ? void 0 : s.text) != null ? S : "Cancel"
993
993
  }
994
994
  ),
995
995
  r && /* @__PURE__ */ o(
996
996
  ae,
997
997
  {
998
998
  onClick: () => L(void 0, null, function* () {
999
- var S;
1000
- v(!0), yield (S = r.onClick) == null ? void 0 : S.call(r), v(!1);
999
+ var y;
1000
+ v(!0), yield (y = r.onClick) == null ? void 0 : y.call(r), v(!1);
1001
1001
  }),
1002
1002
  "data-testid": r.testId,
1003
1003
  disabled: r.disabled || f,
@@ -1015,97 +1015,97 @@ const kt = ({
1015
1015
  lookup: n,
1016
1016
  label: i,
1017
1017
  inputValue: r
1018
- }) => an({
1018
+ }) => sn({
1019
1019
  queryFn: () => e && r.length < e ? t != null ? t : [] : t ? t.filter(
1020
- (l) => l.label.toLowerCase().includes(r.toLowerCase())
1020
+ (s) => s.label.toLowerCase().includes(r.toLowerCase())
1021
1021
  ) : n(r),
1022
1022
  queryKey: ["autocomplete", i, r]
1023
1023
  });
1024
- function _o({
1024
+ function Mo({
1025
1025
  lookup: e = () => L(this, null, function* () {
1026
1026
  }),
1027
1027
  enableHighlighting: t = !0,
1028
1028
  onChange: n,
1029
1029
  minLength: i = 0,
1030
1030
  label: r,
1031
- value: l,
1031
+ value: s,
1032
1032
  "data-testid": c,
1033
- sx: p,
1034
- boxSx: a,
1035
- textFieldColor: d,
1033
+ sx: l,
1034
+ boxSx: d,
1035
+ textFieldColor: u,
1036
1036
  textFieldVariant: m = "filled",
1037
1037
  loadingText: f = "Loading...",
1038
1038
  noOptionsText: v = "No options",
1039
- popupIcon: g = /* @__PURE__ */ o(tn, {}),
1040
- error: A = !1,
1041
- helperText: S = "",
1042
- preLoadedOptions: D = void 0,
1043
- disablePortal: I = !1,
1039
+ popupIcon: p = /* @__PURE__ */ o(nn, {}),
1040
+ error: S = !1,
1041
+ helperText: y = "",
1042
+ preLoadedOptions: b = void 0,
1043
+ disablePortal: $ = !1,
1044
1044
  disableIconFlip: T = !1
1045
1045
  }) {
1046
- const [P, N] = E(""), k = (h, C) => {
1047
- const x = l.filter((w) => w.id !== C);
1048
- n(x, "delete", h);
1049
- }, { data: b, isLoading: H } = yt({
1046
+ const [P, N] = E(""), D = (g, C) => {
1047
+ const x = s.filter((w) => w.id !== C);
1048
+ n(x, "delete", g);
1049
+ }, { data: A, isLoading: H } = yt({
1050
1050
  inputValue: P,
1051
1051
  label: r,
1052
1052
  lookup: e,
1053
1053
  minLength: i,
1054
- preLoadedOptions: D
1054
+ preLoadedOptions: b
1055
1055
  }), W = P.length >= i;
1056
- return /* @__PURE__ */ u("div", { "data-testid": c, children: [
1056
+ return /* @__PURE__ */ h("div", { "data-testid": c, children: [
1057
1057
  /* @__PURE__ */ o(
1058
1058
  Se,
1059
1059
  {
1060
- sx: s(s({}, p), T ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
1060
+ sx: a(a({}, l), T ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
1061
1061
  "data-testid": c ? `${c}:Autocomplete` : void 0,
1062
- disablePortal: I,
1062
+ disablePortal: $,
1063
1063
  multiple: !0,
1064
- getOptionLabel: (h) => typeof h == "string" ? h : h.label,
1064
+ getOptionLabel: (g) => typeof g == "string" ? g : g.label,
1065
1065
  loading: W ? H : !1,
1066
- options: [...l, ...b != null ? b : []],
1066
+ options: [...s, ...A != null ? A : []],
1067
1067
  filterSelectedOptions: !0,
1068
1068
  includeInputInList: !0,
1069
- value: l,
1070
- onChange: (h, C, x) => {
1071
- n(C, x, h);
1069
+ value: s,
1070
+ onChange: (g, C, x) => {
1071
+ n(C, x, g);
1072
1072
  },
1073
- onInputChange: (h, C) => N(C),
1073
+ onInputChange: (g, C) => N(C),
1074
1074
  noOptionsText: W ? v : "Start typing to search",
1075
1075
  loadingText: f,
1076
- popupIcon: g,
1077
- renderInput: (h) => /* @__PURE__ */ o(
1076
+ popupIcon: p,
1077
+ renderInput: (g) => /* @__PURE__ */ o(
1078
1078
  be,
1079
- y(s({}, h), {
1079
+ k(a({}, g), {
1080
1080
  label: r,
1081
1081
  fullWidth: !0,
1082
1082
  variant: m,
1083
- error: A,
1084
- helperText: S,
1085
- InputProps: y(s({}, h.InputProps), {
1086
- endAdornment: /* @__PURE__ */ u(F, { children: [
1083
+ error: S,
1084
+ helperText: y,
1085
+ InputProps: k(a({}, g.InputProps), {
1086
+ endAdornment: /* @__PURE__ */ h(F, { children: [
1087
1087
  H ? /* @__PURE__ */ o(De, { color: "inherit", size: 20 }) : null,
1088
- h.InputProps.endAdornment
1088
+ g.InputProps.endAdornment
1089
1089
  ] })
1090
1090
  }),
1091
1091
  "data-testid": c ? `${c}:Autocomplete:TextField` : void 0,
1092
1092
  onKeyDown: (C) => {
1093
1093
  (C.key === "Backspace" || C.key === "Delete") && C.stopPropagation();
1094
1094
  },
1095
- color: d
1095
+ color: u
1096
1096
  })
1097
1097
  ),
1098
1098
  renderTags: () => null,
1099
- isOptionEqualToValue: (h, C) => h.id === C.id,
1100
- renderOption: (h, C, x) => {
1099
+ isOptionEqualToValue: (g, C) => g.id === C.id,
1100
+ renderOption: (g, C, x) => {
1101
1101
  if (t) {
1102
- const w = on(C.label, x.inputValue, {
1102
+ const w = rn(C.label, x.inputValue, {
1103
1103
  insideWords: !0,
1104
1104
  findAllOccurrences: !0
1105
- }), M = rn(C.label, w);
1105
+ }), M = an(C.label, w);
1106
1106
  return /* @__PURE__ */ xe(
1107
1107
  "li",
1108
- y(s({}, h), {
1108
+ k(a({}, g), {
1109
1109
  key: C.id,
1110
1110
  "data-testid": c ? `${c}:Autocomplete:option(${C.id.toString()})` : void 0
1111
1111
  }),
@@ -1123,7 +1123,7 @@ function _o({
1123
1123
  } else
1124
1124
  return /* @__PURE__ */ xe(
1125
1125
  "li",
1126
- y(s({}, h), {
1126
+ k(a({}, g), {
1127
1127
  key: C.id,
1128
1128
  "data-testid": c ? `${c}:option(${C.id.toString()})` : void 0
1129
1129
  }),
@@ -1132,8 +1132,8 @@ function _o({
1132
1132
  }
1133
1133
  }
1134
1134
  ),
1135
- l.length > 0 && /* @__PURE__ */ o($, { sx: a, children: l.map((h) => /* @__PURE__ */ o(
1136
- Gt,
1135
+ s.length > 0 && /* @__PURE__ */ o(I, { sx: d, children: s.map((g) => /* @__PURE__ */ o(
1136
+ Vt,
1137
1137
  {
1138
1138
  sx: {
1139
1139
  marginTop: 1,
@@ -1141,9 +1141,9 @@ function _o({
1141
1141
  height: "auto"
1142
1142
  },
1143
1143
  label: /* @__PURE__ */ o(
1144
- Vt,
1144
+ qt,
1145
1145
  {
1146
- title: h.tooltipContent || "",
1146
+ title: g.tooltipContent || "",
1147
1147
  placement: "bottom-start",
1148
1148
  PopperProps: {
1149
1149
  modifiers: [
@@ -1155,134 +1155,134 @@ function _o({
1155
1155
  }
1156
1156
  ]
1157
1157
  },
1158
- children: /* @__PURE__ */ o(B, { style: { whiteSpace: "normal" }, children: h.chipLabel ? h.chipLabel : h.label })
1158
+ children: /* @__PURE__ */ o(B, { style: { whiteSpace: "normal" }, children: g.chipLabel ? g.chipLabel : g.label })
1159
1159
  }
1160
1160
  ),
1161
- "data-testid": c ? `${c}:Chip(${h.id.toString()})` : void 0,
1162
- onDelete: (C) => k(C, h.id),
1161
+ "data-testid": c ? `${c}:Chip(${g.id.toString()})` : void 0,
1162
+ onDelete: (C) => D(C, g.id),
1163
1163
  deleteIcon: /* @__PURE__ */ o(
1164
- en,
1164
+ tn,
1165
1165
  {
1166
- "data-testid": c ? `${c}:Chip(${h.id.toString()}):deleteIcon` : void 0
1166
+ "data-testid": c ? `${c}:Chip(${g.id.toString()}):deleteIcon` : void 0
1167
1167
  }
1168
1168
  )
1169
1169
  },
1170
- h.id
1170
+ g.id
1171
1171
  )) })
1172
1172
  ] });
1173
1173
  }
1174
- const Mo = ({
1174
+ const Ro = ({
1175
1175
  lookup: e = () => L(void 0, null, function* () {
1176
1176
  }),
1177
1177
  onChange: t,
1178
1178
  label: n,
1179
1179
  value: i,
1180
1180
  sx: r,
1181
- textFieldColor: l,
1181
+ textFieldColor: s,
1182
1182
  textFieldVariant: c = "filled",
1183
- "data-testid": p,
1184
- noOptionsText: a = "No options",
1185
- minLength: d = 3,
1183
+ "data-testid": l,
1184
+ noOptionsText: d = "No options",
1185
+ minLength: u = 3,
1186
1186
  disablePortal: m = !1,
1187
1187
  preLoadedOptions: f,
1188
1188
  helperText: v = "",
1189
- disabled: g,
1190
- popupIcon: A,
1191
- disableIconFlip: S
1189
+ disabled: p,
1190
+ popupIcon: S,
1191
+ disableIconFlip: y
1192
1192
  }) => {
1193
- const [D, I] = E(""), { data: T, isLoading: P } = yt({
1194
- inputValue: D,
1193
+ const [b, $] = E(""), { data: T, isLoading: P } = yt({
1194
+ inputValue: b,
1195
1195
  label: n,
1196
1196
  lookup: e,
1197
- minLength: d != null ? d : 0,
1197
+ minLength: u != null ? u : 0,
1198
1198
  preLoadedOptions: f
1199
- }), N = D.length >= d;
1200
- return /* @__PURE__ */ o("div", { "data-testid": p, children: /* @__PURE__ */ o(qt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
1199
+ }), N = b.length >= u;
1200
+ return /* @__PURE__ */ o("div", { "data-testid": l, children: /* @__PURE__ */ o(Xt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
1201
1201
  Se,
1202
1202
  {
1203
- sx: s(s({}, r), S ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
1204
- "data-testid": p ? `${p}:Autocomplete` : void 0,
1203
+ sx: a(a({}, r), y ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
1204
+ "data-testid": l ? `${l}:Autocomplete` : void 0,
1205
1205
  loading: N ? P : !1,
1206
1206
  options: T != null ? T : [],
1207
- onChange: (k, b) => {
1208
- t(k, b);
1207
+ onChange: (D, A) => {
1208
+ t(D, A);
1209
1209
  },
1210
1210
  disablePortal: m,
1211
- filterOptions: (k) => k,
1211
+ filterOptions: (D) => D,
1212
1212
  value: i,
1213
- noOptionsText: N ? a : "Start typing to search",
1214
- getOptionLabel: (k) => k.label,
1215
- popupIcon: A,
1216
- renderInput: (k) => /* @__PURE__ */ o(
1213
+ noOptionsText: N ? d : "Start typing to search",
1214
+ getOptionLabel: (D) => D.label,
1215
+ popupIcon: S,
1216
+ renderInput: (D) => /* @__PURE__ */ o(
1217
1217
  be,
1218
- y(s({
1219
- "data-testid": p ? `${p}:Autocomplete:TextField` : void 0
1220
- }, k), {
1218
+ k(a({
1219
+ "data-testid": l ? `${l}:Autocomplete:TextField` : void 0
1220
+ }, D), {
1221
1221
  variant: c,
1222
1222
  label: n,
1223
- color: l,
1223
+ color: s,
1224
1224
  helperText: v
1225
1225
  })
1226
1226
  ),
1227
- isOptionEqualToValue: (k, b) => k.id === b.id,
1228
- onInputChange: (k, b) => {
1229
- I(b);
1227
+ isOptionEqualToValue: (D, A) => D.id === A.id,
1228
+ onInputChange: (D, A) => {
1229
+ $(A);
1230
1230
  },
1231
- renderOption: (k, b) => /* @__PURE__ */ xe(
1231
+ renderOption: (D, A) => /* @__PURE__ */ xe(
1232
1232
  "li",
1233
- y(s({}, k), {
1234
- key: b.id,
1235
- "data-testid": p ? `${p}:Autocomplete:option(${b.id.toString()})` : void 0
1233
+ k(a({}, D), {
1234
+ key: A.id,
1235
+ "data-testid": l ? `${l}:Autocomplete:option(${A.id.toString()})` : void 0
1236
1236
  }),
1237
- b.label
1237
+ A.label
1238
1238
  ),
1239
- disabled: g
1239
+ disabled: p
1240
1240
  }
1241
1241
  ) }) });
1242
- }, Un = (e) => {
1242
+ }, Gn = (e) => {
1243
1243
  if (!e)
1244
1244
  return -1;
1245
1245
  try {
1246
1246
  const n = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), i = decodeURIComponent(
1247
- cn.from(n, "base64").toString("utf8").split("").map(function(l) {
1248
- return "%" + ("00" + l.charCodeAt(0).toString(16)).slice(-2);
1247
+ dn.from(n, "base64").toString("utf8").split("").map(function(s) {
1248
+ return "%" + ("00" + s.charCodeAt(0).toString(16)).slice(-2);
1249
1249
  }).join("")
1250
1250
  ), r = JSON.parse(i);
1251
1251
  return r != null && r.exp ? r.exp : -1;
1252
1252
  } catch (t) {
1253
1253
  return -1;
1254
1254
  }
1255
- }, Ro = ({
1255
+ }, Ho = ({
1256
1256
  open: e = !1,
1257
1257
  closeHandler: t,
1258
1258
  setAuth0ExpiryTime: n
1259
1259
  }) => {
1260
- const { logout: i, getAccessTokenSilently: r } = ht(), [l, c] = E(0), p = () => L(void 0, null, function* () {
1260
+ const { logout: i, getAccessTokenSilently: r } = ht(), [s, c] = E(0), l = () => L(void 0, null, function* () {
1261
1261
  i({ logoutParams: { returnTo: `${window.location.origin}` } });
1262
- }), a = () => L(void 0, null, function* () {
1263
- c(l + 1), t();
1262
+ }), d = () => L(void 0, null, function* () {
1263
+ c(s + 1), t();
1264
1264
  });
1265
1265
  return K(() => {
1266
1266
  (() => L(void 0, null, function* () {
1267
- if (l > 0) {
1268
- const v = yield r({ cacheMode: "off" }), g = Un(v) * 1e3;
1269
- n(g);
1267
+ if (s > 0) {
1268
+ const v = yield r({ cacheMode: "off" }), p = Gn(v) * 1e3;
1269
+ n(p);
1270
1270
  }
1271
1271
  }))();
1272
- }, [l, r, n]), /* @__PURE__ */ o(
1272
+ }, [s, r, n]), /* @__PURE__ */ o(
1273
1273
  kt,
1274
1274
  {
1275
1275
  isOpen: e,
1276
1276
  primaryButton: {
1277
1277
  text: "Continue",
1278
- onClick: a,
1278
+ onClick: d,
1279
1279
  disabled: !1,
1280
1280
  testId: "PreferencesDialog",
1281
1281
  buttonColor: "secondary"
1282
1282
  },
1283
1283
  secondaryButton: {
1284
1284
  text: "Log out",
1285
- onClick: p,
1285
+ onClick: l,
1286
1286
  disabled: !1,
1287
1287
  testId: "PreferencesDialog",
1288
1288
  buttonColor: "secondary"
@@ -1294,91 +1294,95 @@ const Mo = ({
1294
1294
  }
1295
1295
  );
1296
1296
  };
1297
- function Gn(e) {
1297
+ function Vn(e) {
1298
1298
  return "error" in e;
1299
1299
  }
1300
- function Vn(e) {
1300
+ function qn(e) {
1301
1301
  var i;
1302
1302
  const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
1303
1303
  return t === "access_denied" && n.startsWith("You do not have the required authorization");
1304
1304
  }
1305
- function qn(e) {
1305
+ function Xn(e) {
1306
1306
  var i;
1307
1307
  const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
1308
1308
  return t === "access_denied" && n.startsWith("User did not authorize the request");
1309
1309
  }
1310
- function Xn(e) {
1310
+ function Qn(e) {
1311
1311
  var i;
1312
1312
  const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
1313
1313
  return t === "access_denied" && n.match(/Script.*time.*exceeded/);
1314
1314
  }
1315
- function Ho({
1315
+ function Wo({
1316
1316
  children: e,
1317
1317
  appName: t = "the app",
1318
1318
  throwErrors: n = "none",
1319
1319
  disableConsoleLogging: i = !1,
1320
1320
  onError: r = () => {
1321
- },
1322
- withPopup: l = !1
1321
+ }
1323
1322
  }) {
1324
- var v, g;
1325
- const { isAuthenticated: c, isLoading: p, error: a, loginWithRedirect: d, loginWithPopup: m, logout: f } = ht();
1326
- if (K(() => {
1327
- a && r(a);
1328
- }, [a, r]), K(() => {
1329
- if (p || c || a)
1330
- return;
1331
- const A = {
1323
+ var f, v;
1324
+ const { isAuthenticated: s, isLoading: c, error: l, loginWithRedirect: d, logout: u } = ht();
1325
+ K(() => {
1326
+ l && r(l);
1327
+ }, [l, r]);
1328
+ const m = Rt(
1329
+ () => ({
1332
1330
  appState: {
1333
1331
  returnTo: `${window.location.pathname}${window.location.search}`
1334
1332
  }
1335
- };
1336
- l ? m() : d(A);
1337
- }, [p, c, a, d, r, l, m]), a) {
1333
+ }),
1334
+ []
1335
+ );
1336
+ if (K(() => {
1337
+ c || s || l || d(m);
1338
+ }, [c, s, l, d, r, m]), l) {
1338
1339
  if (i || console.error(
1339
- `Error detected in AuthGuard [isAuthenticated=${c},isLoading=${p}]`,
1340
- a
1340
+ `Error detected in AuthGuard [isAuthenticated=${s},isLoading=${c}]`,
1341
+ l
1341
1342
  ), n === "all")
1342
- throw a;
1343
- if (Gn(a)) {
1344
- let A = "Auth error", S = "An unknown Auth0 error occurred.";
1345
- if (Vn(a))
1346
- A = "Unauthorised", S = `You are not authorised to access ${t}.`;
1347
- else if (qn(a))
1348
- A = "App not authorised", S = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
1349
- else if (Xn(a))
1350
- A = "Auth0 script execution time exceeded", S = "The Auth0 login flow exceeded the time limit (20s). Try again in a minute.";
1343
+ throw l;
1344
+ if (Vn(l)) {
1345
+ let p = "Auth error", S = "An unknown Auth0 error occurred.";
1346
+ if (qn(l))
1347
+ p = "Unauthorised", S = `You are not authorised to access ${t}.`;
1348
+ else if (Xn(l))
1349
+ p = "App not authorised", S = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
1350
+ else if (Qn(l))
1351
+ p = "Auth0 script execution time exceeded", S = "The Auth0 login flow exceeded the time limit (20s). Try again in a minute.";
1351
1352
  else if (n === "unknown")
1352
- throw a;
1353
- return /* @__PURE__ */ u(tt, { open: !0, children: [
1354
- /* @__PURE__ */ o(ot, { children: A }),
1355
- /* @__PURE__ */ u(it, { children: [
1353
+ throw l;
1354
+ return /* @__PURE__ */ h(tt, { open: !0, children: [
1355
+ /* @__PURE__ */ o(ot, { children: p }),
1356
+ /* @__PURE__ */ h(it, { children: [
1356
1357
  /* @__PURE__ */ o(B, { children: S }),
1357
1358
  /* @__PURE__ */ o("br", {}),
1358
1359
  /* @__PURE__ */ o(B, { variant: "subtitle2", children: "Details from Auth0" }),
1359
- /* @__PURE__ */ u(B, { variant: "body2", children: [
1360
+ /* @__PURE__ */ h(B, { variant: "body2", children: [
1360
1361
  "error: ",
1361
- (v = a == null ? void 0 : a.error) != null ? v : "N/A"
1362
+ (f = l == null ? void 0 : l.error) != null ? f : "N/A"
1362
1363
  ] }),
1363
- /* @__PURE__ */ u(B, { variant: "body2", children: [
1364
+ /* @__PURE__ */ h(B, { variant: "body2", children: [
1364
1365
  "description: ",
1365
- (g = a == null ? void 0 : a.error_description) != null ? g : "N/A"
1366
+ (v = l == null ? void 0 : l.error_description) != null ? v : "N/A"
1366
1367
  ] })
1367
1368
  ] }),
1368
- /* @__PURE__ */ o(rt, { children: /* @__PURE__ */ o(ae, { onClick: () => f({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
1369
+ /* @__PURE__ */ o(rt, { children: /* @__PURE__ */ o(ae, { onClick: () => u({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
1369
1370
  ] });
1371
+ } else if (l.message === "Invalid state") {
1372
+ const p = localStorage.getItem("auth0_redirect_count");
1373
+ p && parseInt(p) < 2 && (localStorage.setItem("auth0_redirect_count", String(parseInt(p) + 1)), d(m));
1370
1374
  } else if (n === "unknown")
1371
- throw a;
1375
+ throw l;
1372
1376
  }
1373
- return c ? /* @__PURE__ */ o(F, { children: e }) : /* @__PURE__ */ o(dn, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
1377
+ return s ? /* @__PURE__ */ o(F, { children: e }) : /* @__PURE__ */ o(un, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
1374
1378
  }
1375
- const Qn = {
1379
+ const Yn = {
1376
1380
  autoHideDuration: 6e3,
1377
1381
  anchorOrigin: { vertical: "top", horizontal: "center" },
1378
1382
  // The default is false. If we prefer timer to continue when window loses
1379
1383
  // focus, change to true
1380
1384
  disableWindowBlurListener: !1
1381
- }, Yn = {
1385
+ }, Kn = {
1382
1386
  shouldClose: (e, t) => t !== "clickaway"
1383
1387
  }, qe = {
1384
1388
  message: "",
@@ -1386,18 +1390,18 @@ const Qn = {
1386
1390
  variant: "standard",
1387
1391
  progressIndicator: void 0
1388
1392
  // Can use 'circular' or 'linear'
1389
- }, Xe = 100, Qe = 2e3, Kn = 2e3, Jn = (() => {
1393
+ }, Xe = 100, Qe = 2e3, Jn = 2e3, Zn = (() => {
1390
1394
  let e = 0;
1391
1395
  return () => (e += 1, e);
1392
- })(), Zn = {
1396
+ })(), jn = {
1393
1397
  borderBottomLeftRadius: "0px",
1394
1398
  borderBottomRightRadius: "0px"
1395
- }, jn = {}, eo = {}, $t = Je(null);
1396
- function to(l) {
1397
- var c = l, {
1398
- overrideState: e = jn,
1399
- overrideActions: t = eo,
1400
- shouldClose: n = Yn.shouldClose,
1399
+ }, eo = {}, to = {}, It = Je(null);
1400
+ function no(s) {
1401
+ var c = s, {
1402
+ overrideState: e = eo,
1403
+ overrideActions: t = to,
1404
+ shouldClose: n = Kn.shouldClose,
1401
1405
  children: i
1402
1406
  } = c, r = Ee(c, [
1403
1407
  "overrideState",
@@ -1406,88 +1410,88 @@ function to(l) {
1406
1410
  "children"
1407
1411
  ]);
1408
1412
  var C;
1409
- const [{ open: p }, a] = E({ open: !1 }), d = ge([]), m = ge(Date.now()), f = ge(0), v = re((x) => {
1410
- a({ open: x });
1411
- }, []), g = re((x = {}) => {
1412
- f.current += 1, d.current.length >= Xe && Date.now() - m.current >= Qe && (m.current = Date.now(), console.error(
1413
+ const [{ open: l }, d] = E({ open: !1 }), u = ge([]), m = ge(Date.now()), f = ge(0), v = re((x) => {
1414
+ d({ open: x });
1415
+ }, []), p = re((x = {}) => {
1416
+ f.current += 1, u.current.length >= Xe && Date.now() - m.current >= Qe && (m.current = Date.now(), console.error(
1413
1417
  `SaladBarProvider: MAX_QUEUE_LENGTH (${Xe}) hit ${f.current} times in last ${Qe}ms)`
1414
1418
  ), f.current = 0);
1415
- const w = s(y(s({}, qe), {
1416
- key: Jn()
1419
+ const w = a(k(a({}, qe), {
1420
+ key: Zn()
1417
1421
  }), x);
1418
- return d.current.push(w), d.current.length === 1 && a({ open: !0 }), w.key;
1419
- }, []), A = (x = "", w = {}) => g(s({ message: x, severity: "success" }, w)), S = (x = "", w = {}) => g(s({ message: x, severity: "info" }, w)), D = (x = "", w = {}) => g(s({ message: x, severity: "warning" }, w)), I = (x = "", w = {}) => g(s({ message: x, severity: "error" }, w)), T = (x) => {
1420
- const w = d.current.findIndex((M) => M.key === x);
1422
+ return u.current.push(w), u.current.length === 1 && d({ open: !0 }), w.key;
1423
+ }, []), S = (x = "", w = {}) => p(a({ message: x, severity: "success" }, w)), y = (x = "", w = {}) => p(a({ message: x, severity: "info" }, w)), b = (x = "", w = {}) => p(a({ message: x, severity: "warning" }, w)), $ = (x = "", w = {}) => p(a({ message: x, severity: "error" }, w)), T = (x) => {
1424
+ const w = u.current.findIndex((M) => M.key === x);
1421
1425
  if (w !== -1)
1422
- return w === 0 ? (a({ open: !1 }), d.current[0]) : d.current.splice(w, 1);
1426
+ return w === 0 ? (d({ open: !1 }), u.current[0]) : u.current.splice(w, 1);
1423
1427
  }, P = (x, w) => {
1424
- n(x, w) && a({ open: !1 });
1428
+ n(x, w) && d({ open: !1 });
1425
1429
  }, N = () => {
1426
- }, k = () => {
1427
- d.current.shift(), d.current.length > 0 && a({ open: !0 });
1428
- }, b = (C = d.current[0]) != null ? C : s({}, qe), H = {};
1429
- "autoHideDuration" in b && (H.autoHideDuration = b.autoHideDuration);
1430
- const W = s(s({}, Qn), r), h = s(s({
1431
- open: p,
1430
+ }, D = () => {
1431
+ u.current.shift(), u.current.length > 0 && d({ open: !0 });
1432
+ }, A = (C = u.current[0]) != null ? C : a({}, qe), H = {};
1433
+ "autoHideDuration" in A && (H.autoHideDuration = A.autoHideDuration);
1434
+ const W = a(a({}, Yn), r), g = a(a({
1435
+ open: l,
1432
1436
  setOpen: v,
1433
- enqueueNotification: g,
1434
- enqueueSuccessNotification: A,
1435
- enqueueInfoNotification: S,
1436
- enqueueWarningNotification: D,
1437
- enqueueErrorNotification: I,
1437
+ enqueueNotification: p,
1438
+ enqueueSuccessNotification: S,
1439
+ enqueueInfoNotification: y,
1440
+ enqueueWarningNotification: b,
1441
+ enqueueErrorNotification: $,
1438
1442
  removeNotification: T
1439
1443
  }, e), t);
1440
- return /* @__PURE__ */ u($t.Provider, { value: h, children: [
1444
+ return /* @__PURE__ */ h(It.Provider, { value: g, children: [
1441
1445
  i,
1442
1446
  /* @__PURE__ */ o(
1443
- Xt,
1444
- y(s(s({}, W), H), {
1445
- open: p,
1447
+ Qt,
1448
+ k(a(a({}, W), H), {
1449
+ open: l,
1446
1450
  onClose: P,
1447
1451
  TransitionProps: {
1448
- onExited: k,
1452
+ onExited: D,
1449
1453
  onExit: N
1450
1454
  },
1451
- sx: { zIndex: Kn },
1452
- children: /* @__PURE__ */ u("div", { children: [
1455
+ sx: { zIndex: Jn },
1456
+ children: /* @__PURE__ */ h("div", { children: [
1453
1457
  /* @__PURE__ */ o(
1454
- Qt,
1458
+ Yt,
1455
1459
  {
1456
1460
  onClose: (x) => P(x, "closeAlert"),
1457
- severity: b.severity,
1461
+ severity: A.severity,
1458
1462
  variant: "filled",
1459
- icon: b.progressIndicator === "circular" ? /* @__PURE__ */ o(De, { size: "1em" }) : void 0,
1460
- style: b.progressIndicator === "linear" ? Zn : void 0,
1461
- children: b.message
1463
+ icon: A.progressIndicator === "circular" ? /* @__PURE__ */ o(De, { size: "1em" }) : void 0,
1464
+ style: A.progressIndicator === "linear" ? jn : void 0,
1465
+ children: A.message
1462
1466
  }
1463
1467
  ),
1464
- b.progressIndicator === "linear" && /* @__PURE__ */ o(nt, { color: "primary" })
1468
+ A.progressIndicator === "linear" && /* @__PURE__ */ o(nt, { color: "primary" })
1465
1469
  ] })
1466
1470
  })
1467
1471
  )
1468
1472
  ] });
1469
1473
  }
1470
- function no() {
1471
- const e = Ze($t);
1474
+ function oo() {
1475
+ const e = Ze(It);
1472
1476
  if (e === null)
1473
1477
  throw new ke("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
1474
1478
  return e;
1475
1479
  }
1476
- const Wo = Q(
1477
- (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(to, y(s({}, e), { overrideState: t, overrideActions: n, children: i }))
1478
- ), oo = nn(), zo = ({
1480
+ const zo = Q(
1481
+ (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(no, k(a({}, e), { overrideState: t, overrideActions: n, children: i }))
1482
+ ), io = on(), Uo = ({
1479
1483
  children: e,
1480
1484
  store: t
1481
- }) => /* @__PURE__ */ o(pt, { store: t != null ? t : oo, children: e }), It = "domainCode";
1485
+ }) => /* @__PURE__ */ o(ut, { store: t != null ? t : io, children: e }), $t = "domainCode";
1482
1486
  var Ke;
1483
1487
  const Ye = _(
1484
- JSON.parse((Ke = localStorage.getItem(It)) != null ? Ke : '{"domainCode": ""}').domainCode
1488
+ JSON.parse((Ke = localStorage.getItem($t)) != null ? Ke : '{"domainCode": ""}').domainCode
1485
1489
  ), Tt = _(
1486
1490
  (e) => e(Ye),
1487
1491
  (e, t, n) => {
1488
- t(Ye, n), localStorage.setItem(It, JSON.stringify({ domainCode: n }));
1492
+ t(Ye, n), localStorage.setItem($t, JSON.stringify({ domainCode: n }));
1489
1493
  }
1490
- ), io = {
1494
+ ), ro = {
1491
1495
  act: "ACT",
1492
1496
  nsw: "NSW",
1493
1497
  nt: "NT",
@@ -1499,42 +1503,42 @@ const Ye = _(
1499
1503
  ag: "AG",
1500
1504
  fedmps: "Fedmps",
1501
1505
  "": ""
1502
- }, ro = (e) => {
1506
+ }, ao = (e) => {
1503
1507
  var t;
1504
- return e === null ? "N/A" : (t = io[e]) != null ? t : "";
1505
- }, Uo = ({
1508
+ return e === null ? "N/A" : (t = ro[e]) != null ? t : "";
1509
+ }, Go = ({
1506
1510
  isLoading: e,
1507
1511
  isOpen: t,
1508
1512
  onClose: n,
1509
1513
  domainOptions: i,
1510
1514
  applicationName: r,
1511
- handleLogout: l
1515
+ handleLogout: s
1512
1516
  }) => {
1513
- const [c, p] = V(Tt), [a, d] = E(c), { enqueueSuccessNotification: m } = no(), f = i.length === 0, v = !!c && !i.includes(c) && !i.includes(a), g = !c || f || v, A = () => L(void 0, null, function* () {
1514
- a ? (p(a), m(`Set organisation to ${a}`), n()) : p("");
1515
- }), S = () => L(void 0, null, function* () {
1516
- c && !f && !v ? (d(c), n()) : g && l();
1517
+ const [c, l] = V(Tt), [d, u] = E(c), { enqueueSuccessNotification: m } = oo(), f = i.length === 0, v = !!c && !i.includes(c) && !i.includes(d), p = !c || f || v, S = () => L(void 0, null, function* () {
1518
+ d ? (l(d), m(`Set organisation to ${d}`), n()) : l("");
1519
+ }), y = () => L(void 0, null, function* () {
1520
+ c && !f && !v ? (u(c), n()) : p && s();
1517
1521
  });
1518
- let D;
1519
- return f ? D = "Unable to retrieve your active organisations. Try logging in again." : v && (D = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ u(
1522
+ let b;
1523
+ return f ? b = "Unable to retrieve your active organisations. Try logging in again." : v && (b = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ h(
1520
1524
  kt,
1521
1525
  {
1522
1526
  isOpen: t,
1523
1527
  dialogTitle: "Select an organisation",
1524
1528
  primaryButton: {
1525
1529
  text: "Confirm",
1526
- onClick: A,
1527
- disabled: !a || f || v,
1530
+ onClick: S,
1531
+ disabled: !d || f || v,
1528
1532
  buttonColor: "primary"
1529
1533
  },
1530
1534
  secondaryButton: {
1531
- text: g ? "Logout" : "Cancel",
1532
- onClick: S
1535
+ text: p ? "Logout" : "Cancel",
1536
+ onClick: y
1533
1537
  },
1534
- onClose: g ? () => {
1538
+ onClose: p ? () => {
1535
1539
  } : n,
1536
1540
  children: [
1537
- /* @__PURE__ */ u(B, { marginBottom: 2, children: [
1541
+ /* @__PURE__ */ h(B, { marginBottom: 2, children: [
1538
1542
  "Select the default organisation that you want to use with the ",
1539
1543
  r,
1540
1544
  "."
@@ -1545,30 +1549,30 @@ const Ye = _(
1545
1549
  loading: e,
1546
1550
  multiple: !1,
1547
1551
  disableClearable: !1,
1548
- value: a !== "" ? a : null,
1549
- onChange: (I, T) => d(T != null ? T : ""),
1550
- getOptionLabel: ro,
1552
+ value: d !== "" ? d : null,
1553
+ onChange: ($, T) => u(T != null ? T : ""),
1554
+ getOptionLabel: ao,
1551
1555
  options: [...i],
1552
- renderInput: (I) => /* @__PURE__ */ o(
1556
+ renderInput: ($) => /* @__PURE__ */ o(
1553
1557
  be,
1554
- y(s({}, I), {
1558
+ k(a({}, $), {
1555
1559
  variant: "filled",
1556
1560
  label: "Select organisation",
1557
- InputProps: y(s({}, I.InputProps), {
1558
- endAdornment: /* @__PURE__ */ u(F, { children: [
1561
+ InputProps: k(a({}, $.InputProps), {
1562
+ endAdornment: /* @__PURE__ */ h(F, { children: [
1559
1563
  e ? /* @__PURE__ */ o(De, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
1560
- I.InputProps.endAdornment
1564
+ $.InputProps.endAdornment
1561
1565
  ] })
1562
1566
  })
1563
1567
  })
1564
1568
  )
1565
1569
  }
1566
1570
  ),
1567
- D && /* @__PURE__ */ o(Yt, { error: !0, children: D })
1571
+ b && /* @__PURE__ */ o(Kt, { error: !0, children: b })
1568
1572
  ]
1569
1573
  }
1570
1574
  );
1571
- }, Go = at({
1575
+ }, Vo = at({
1572
1576
  palette: {
1573
1577
  primary: {
1574
1578
  dark: "#00A651",
@@ -1619,7 +1623,7 @@ const Ye = _(
1619
1623
  navBar: {
1620
1624
  backgroundColor: "#E8E8E8"
1621
1625
  }
1622
- }), Vo = at({
1626
+ }), qo = at({
1623
1627
  palette: {
1624
1628
  primary: {
1625
1629
  main: "#007236",
@@ -1713,7 +1717,7 @@ const Ye = _(
1713
1717
  navBar: {
1714
1718
  backgroundColor: "#E8E8E8"
1715
1719
  }
1716
- }), ao = {
1720
+ }), so = {
1717
1721
  domainCode: Tt,
1718
1722
  navBarOpen: Z,
1719
1723
  navBarWidthOpen: wt,
@@ -1721,53 +1725,53 @@ const Ye = _(
1721
1725
  titleText: ve,
1722
1726
  topBarHeight: St,
1723
1727
  navBarTop: bt
1724
- }, qo = Q(() => ({ children: e }) => /* @__PURE__ */ o(pt, { children: e })), so = ({
1728
+ }, Xo = Q(() => ({ children: e }) => /* @__PURE__ */ o(ut, { children: e })), lo = ({
1725
1729
  initialValues: e,
1726
1730
  children: t
1727
- }) => (ut(e), /* @__PURE__ */ o(F, { children: t })), Xo = Q(
1731
+ }) => (pt(e), /* @__PURE__ */ o(F, { children: t })), Qo = Q(
1728
1732
  (e) => ({ children: t }) => /* @__PURE__ */ o(
1729
- so,
1733
+ lo,
1730
1734
  {
1731
1735
  initialValues: Object.entries(e).map(
1732
1736
  ([n, i]) => [
1733
- ao[n],
1737
+ so[n],
1734
1738
  i
1735
1739
  ]
1736
1740
  ),
1737
1741
  children: t
1738
1742
  }
1739
1743
  )
1740
- ), Qo = Q(() => ({ children: e }) => {
1741
- const t = new sn();
1742
- return /* @__PURE__ */ o(ln, { client: t, children: e });
1744
+ ), Yo = Q(() => ({ children: e }) => {
1745
+ const t = new ln();
1746
+ return /* @__PURE__ */ o(cn, { client: t, children: e });
1743
1747
  });
1744
1748
  export {
1745
1749
  kt as AgDialog,
1746
- Lo as AppLayout,
1747
- zo as AtomProvider,
1748
- Ho as AuthGuard,
1749
- $t as Context,
1750
+ _o as AppLayout,
1751
+ Uo as AtomProvider,
1752
+ Wo as AuthGuard,
1753
+ It as Context,
1750
1754
  ke as ContextError,
1751
- Uo as DomainCodeDialog,
1752
- To as ExampleComponent,
1753
- _o as FetchAutocomplete,
1754
- so as HydrateAtoms,
1755
+ Go as DomainCodeDialog,
1756
+ Bo as ExampleComponent,
1757
+ Mo as FetchAutocomplete,
1758
+ lo as HydrateAtoms,
1755
1759
  ft as NAVBAR_WIDTH_CLOSED,
1756
1760
  gt as NAVBAR_WIDTH_OPENED,
1757
- Po as NavBar,
1758
- Eo as NavBarDarkStyledList,
1759
- Fo as NavBarLightStyledList,
1760
- Cn as NavBarProvider,
1761
- No as PageLayout,
1762
- to as SaladBarProvider,
1763
- Ro as SessionExpiryDialog,
1764
- Mo as SingleAutocomplete,
1765
- oo as atomStore,
1766
- vn as buildNavBarState,
1761
+ No as NavBar,
1762
+ Fo as NavBarDarkStyledList,
1763
+ Po as NavBarLightStyledList,
1764
+ xn as NavBarProvider,
1765
+ Lo as PageLayout,
1766
+ no as SaladBarProvider,
1767
+ Ho as SessionExpiryDialog,
1768
+ Ro as SingleAutocomplete,
1769
+ io as atomStore,
1770
+ wn as buildNavBarState,
1767
1771
  Tt as domainCodeAtom,
1768
- Go as fed21Theme,
1769
- Un as getAuth0Expiry,
1770
- Vo as internalAgSystemsTheme,
1772
+ Vo as fed21Theme,
1773
+ Gn as getAuth0Expiry,
1774
+ qo as internalAgSystemsTheme,
1771
1775
  q as navBarClasses,
1772
1776
  Z as navBarOpenAtom,
1773
1777
  bt as navBarTopAtom,
@@ -1775,15 +1779,15 @@ export {
1775
1779
  wt as navBarWidthOpenAtom,
1776
1780
  ve as titleTextAtom,
1777
1781
  St as topBarHeightAtom,
1778
- On as topBarMiddleAtom,
1782
+ En as topBarMiddleAtom,
1779
1783
  yt as useAutocompleteOptions,
1780
- xn as useNavBar,
1781
- no as useSaladBar,
1782
- qo as withAtomProvider,
1783
- Oo as withBrowserRouter,
1784
- Bo as withNavBarProvider,
1785
- Xo as withOverrideDefaults,
1786
- Qo as withQueryClient,
1787
- Wo as withSaladBarProvider
1784
+ vn as useNavBar,
1785
+ oo as useSaladBar,
1786
+ Xo as withAtomProvider,
1787
+ Eo as withBrowserRouter,
1788
+ Oo as withNavBarProvider,
1789
+ Qo as withOverrideDefaults,
1790
+ Yo as withQueryClient,
1791
+ zo as withSaladBarProvider
1788
1792
  };
1789
1793
  //# sourceMappingURL=index.js.map