@australiangreens/ag-internal-components 0.0.95 → 0.0.97

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