@australiangreens/ag-internal-components 0.0.79 → 0.0.81

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