@australiangreens/ag-internal-components 0.3.19 → 0.4.0

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,147 +1,148 @@
1
- var ot = Object.defineProperty, nt = Object.defineProperties;
2
- var it = Object.getOwnPropertyDescriptors;
3
- var J = Object.getOwnPropertySymbols;
4
- var pe = Object.prototype.hasOwnProperty, he = Object.prototype.propertyIsEnumerable;
5
- var ie = (e, t, o) => t in e ? ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, d = (e, t) => {
1
+ var lt = Object.defineProperty, ct = Object.defineProperties;
2
+ var dt = Object.getOwnPropertyDescriptors;
3
+ var Z = Object.getOwnPropertySymbols;
4
+ var fe = Object.prototype.hasOwnProperty, me = Object.prototype.propertyIsEnumerable;
5
+ var ie = (e, t, o) => t in e ? lt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, d = (e, t) => {
6
6
  for (var o in t || (t = {}))
7
- pe.call(t, o) && ie(e, o, t[o]);
8
- if (J)
9
- for (var o of J(t))
10
- he.call(t, o) && ie(e, o, t[o]);
7
+ fe.call(t, o) && ie(e, o, t[o]);
8
+ if (Z)
9
+ for (var o of Z(t))
10
+ me.call(t, o) && ie(e, o, t[o]);
11
11
  return e;
12
- }, b = (e, t) => nt(e, it(t));
13
- var fe = (e, t) => {
12
+ }, F = (e, t) => ct(e, dt(t));
13
+ var re = (e, t) => {
14
14
  var o = {};
15
- for (var n in e)
16
- pe.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
17
- if (e != null && J)
18
- for (var n of J(e))
19
- t.indexOf(n) < 0 && he.call(e, n) && (o[n] = e[n]);
15
+ for (var i in e)
16
+ fe.call(e, i) && t.indexOf(i) < 0 && (o[i] = e[i]);
17
+ if (e != null && Z)
18
+ for (var i of Z(e))
19
+ t.indexOf(i) < 0 && me.call(e, i) && (o[i] = e[i]);
20
20
  return o;
21
21
  };
22
- var me = (e, t, o) => ie(e, typeof t != "symbol" ? t + "" : t, o);
23
- var N = (e, t, o) => new Promise((n, r) => {
24
- var s = (l) => {
22
+ var ge = (e, t, o) => ie(e, typeof t != "symbol" ? t + "" : t, o);
23
+ var L = (e, t, o) => new Promise((i, r) => {
24
+ var s = (c) => {
25
25
  try {
26
- a(o.next(l));
27
- } catch (c) {
28
- r(c);
26
+ a(o.next(c));
27
+ } catch (l) {
28
+ r(l);
29
29
  }
30
- }, u = (l) => {
30
+ }, u = (c) => {
31
31
  try {
32
- a(o.throw(l));
33
- } catch (c) {
34
- r(c);
32
+ a(o.throw(c));
33
+ } catch (l) {
34
+ r(l);
35
35
  }
36
- }, a = (l) => l.done ? n(l.value) : Promise.resolve(l.value).then(s, u);
36
+ }, a = (c) => c.done ? i(c.value) : Promise.resolve(c.value).then(s, u);
37
37
  a((o = o.apply(e, t)).next());
38
38
  });
39
- import { jsxs as m, Fragment as M, jsx as i } from "react/jsx-runtime";
40
- import { useState as G, createElement as se, useEffect as ge, useMemo as rt, createContext as at, useRef as re, useCallback as xe, useContext as st } from "react";
41
- import { Typography as I, Button as W, Paper as $e, Dialog as Me, LinearProgress as Le, DialogTitle as Oe, DialogContent as Re, DialogActions as Ue, Autocomplete as le, TextField as ce, CircularProgress as te, Box as P, Chip as lt, Tooltip as ct, Stack as dt, Snackbar as ut, Alert as pt, FormHelperText as ht, useTheme as oe, useMediaQuery as ft, Drawer as mt, Collapse as gt, Avatar as Ae, Fade as xt, Skeleton as Ce, Toolbar as At, Divider as Se, Container as Ct, IconButton as St } from "@mui/material";
42
- import { Cancel as vt, ArrowDropDown as wt, ViewHeadline as Dt } from "@mui/icons-material";
43
- import { useQuery as Be } from "@tanstack/react-query";
44
- import kt from "autosuggest-highlight/match";
45
- import yt from "autosuggest-highlight/parse";
46
- import { useAuth0 as de } from "@auth0/auth0-react";
47
- import { Buffer as bt } from "buffer";
48
- import Ft from "@mui/material/Skeleton";
49
- import { atom as L, useAtom as q, useSetAtom as He, useAtomValue as ve } from "jotai";
50
- import { createHelper as Et } from "souvlaki";
51
- import _t from "@mui/material/CssBaseline";
52
- import we from "@mui/material/Box";
53
- import { useHydrateAtoms as It } from "jotai/utils";
54
- import { styled as qe, createTheme as ze, alpha as ae } from "@mui/material/styles";
55
- import De from "react-avatar";
56
- function $o({ text: e }) {
57
- const [t, o] = G(0);
58
- return /* @__PURE__ */ m(M, { children: [
59
- /* @__PURE__ */ i(I, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
60
- /* @__PURE__ */ i(I, { variant: "caption", display: "block", children: /* @__PURE__ */ i("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
61
- /* @__PURE__ */ i(
62
- W,
39
+ import { jsxs as f, Fragment as $, jsx as n } from "react/jsx-runtime";
40
+ import { useState as H, createElement as le, useEffect as xe, useMemo as ut, createContext as pt, useRef as ae, useCallback as Ae, useContext as ht } from "react";
41
+ import { Typography as I, Button as K, Paper as Be, Dialog as Re, LinearProgress as Ue, DialogTitle as He, DialogContent as We, DialogActions as qe, Autocomplete as ce, TextField as de, CircularProgress as te, Box as T, Chip as ft, Tooltip as ze, Stack as mt, useTheme as oe, useMediaQuery as gt, ListItemButton as Ce, ListItemIcon as xt, Fade as Ge, ListItemText as Se, ListItemSecondaryAction as At, Collapse as Ve, List as Ct, Snackbar as St, Alert as vt, FormHelperText as wt, Drawer as yt, Avatar as ve, Skeleton as we, Toolbar as kt, Divider as ye, Container as Dt, IconButton as bt } from "@mui/material";
42
+ import { Cancel as Et, ArrowDropDown as Ft, ExpandLess as _t, ExpandMore as Pt, ViewHeadline as Tt } from "@mui/icons-material";
43
+ import { useQuery as Ke } from "@tanstack/react-query";
44
+ import Nt from "autosuggest-highlight/match";
45
+ import It from "autosuggest-highlight/parse";
46
+ import { useAuth0 as ue } from "@auth0/auth0-react";
47
+ import { Buffer as Lt } from "buffer";
48
+ import $t from "@mui/material/Skeleton";
49
+ import { atom as O, useAtom as U, useSetAtom as Xe, useAtomValue as ke } from "jotai";
50
+ import { useLocation as Mt, Link as De } from "react-router";
51
+ import { createHelper as Ot } from "souvlaki";
52
+ import Bt from "@mui/material/CssBaseline";
53
+ import be from "@mui/material/Box";
54
+ import { useHydrateAtoms as Rt } from "jotai/utils";
55
+ import { styled as Ye, createTheme as Qe, alpha as se } from "@mui/material/styles";
56
+ import Ee from "react-avatar";
57
+ function Go({ text: e }) {
58
+ const [t, o] = H(0);
59
+ return /* @__PURE__ */ f($, { children: [
60
+ /* @__PURE__ */ n(I, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
61
+ /* @__PURE__ */ n(I, { variant: "caption", display: "block", children: /* @__PURE__ */ n("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
62
+ /* @__PURE__ */ n(
63
+ K,
63
64
  {
64
65
  variant: "outlined",
65
- onClick: () => o((n) => n + 1),
66
+ onClick: () => o((i) => i + 1),
66
67
  "aria-label": "Increment",
67
68
  children: "Hello I am a button"
68
69
  }
69
70
  ),
70
- /* @__PURE__ */ m("p", { children: [
71
+ /* @__PURE__ */ f("p", { children: [
71
72
  "This is some text: ",
72
- /* @__PURE__ */ i("span", { children: e })
73
+ /* @__PURE__ */ n("span", { children: e })
73
74
  ] }),
74
- /* @__PURE__ */ m($e, { children: [
75
+ /* @__PURE__ */ f(Be, { children: [
75
76
  "This number will incremember when button pressed: ",
76
77
  t
77
78
  ] })
78
79
  ] });
79
80
  }
80
- const We = ({
81
+ const Je = ({
81
82
  isOpen: e,
82
83
  dialogTitle: t,
83
84
  children: o,
84
- maxWidth: n,
85
+ maxWidth: i,
85
86
  primaryButton: r,
86
87
  secondaryButton: s,
87
88
  additionalButtons: u,
88
89
  onClose: a,
89
- sx: l,
90
- "data-testid": c,
91
- disableCloseOnBackdropOrEscape: x = !1,
92
- isLoading: A = !1
90
+ sx: c,
91
+ "data-testid": l,
92
+ disableCloseOnBackdropOrEscape: g = !1,
93
+ isLoading: x = !1
93
94
  }) => {
94
- var S, y;
95
- const [D, g] = G(!1);
96
- return /* @__PURE__ */ m(
97
- Me,
95
+ var C, S;
96
+ const [v, m] = H(!1);
97
+ return /* @__PURE__ */ f(
98
+ Re,
98
99
  {
99
100
  open: e,
100
- onClose: (h, k) => N(null, null, function* () {
101
- x && (k === "backdropClick" || k === "escapeKeyDown") || D || (s != null && s.onClick ? yield s.onClick() : a());
101
+ onClose: (h, w) => L(null, null, function* () {
102
+ g && (w === "backdropClick" || w === "escapeKeyDown") || v || (s != null && s.onClick ? yield s.onClick() : a());
102
103
  }),
103
104
  fullWidth: !0,
104
- maxWidth: n != null ? n : "xs",
105
- "data-testid": c,
106
- sx: l,
105
+ maxWidth: i != null ? i : "xs",
106
+ "data-testid": l,
107
+ sx: c,
107
108
  children: [
108
- A && /* @__PURE__ */ i(Le, { sx: { height: "4px", marginBottom: "-4px" } }),
109
- /* @__PURE__ */ i(Oe, { children: t }),
110
- /* @__PURE__ */ i(Re, { sx: { "& > :last-child": { marginBottom: 0 } }, children: o }),
111
- /* @__PURE__ */ m(Ue, { children: [
112
- /* @__PURE__ */ i(
113
- W,
109
+ x && /* @__PURE__ */ n(Ue, { sx: { height: "4px", marginBottom: "-4px" } }),
110
+ /* @__PURE__ */ n(He, { children: t }),
111
+ /* @__PURE__ */ n(We, { sx: { "& > :last-child": { marginBottom: 0 } }, children: o }),
112
+ /* @__PURE__ */ f(qe, { children: [
113
+ /* @__PURE__ */ n(
114
+ K,
114
115
  {
115
- onClick: (S = s == null ? void 0 : s.onClick) != null ? S : a,
116
+ onClick: (C = s == null ? void 0 : s.onClick) != null ? C : a,
116
117
  "data-testid": s == null ? void 0 : s.testId,
117
- disabled: (s == null ? void 0 : s.disabled) || D,
118
+ disabled: (s == null ? void 0 : s.disabled) || v,
118
119
  color: s == null ? void 0 : s.buttonColor,
119
- children: (y = s == null ? void 0 : s.text) != null ? y : "Cancel"
120
+ children: (S = s == null ? void 0 : s.text) != null ? S : "Cancel"
120
121
  }
121
122
  ),
122
- u && u.map((h, k) => {
123
- var F;
124
- return /* @__PURE__ */ i(
125
- W,
123
+ u && u.map((h, w) => {
124
+ var E;
125
+ return /* @__PURE__ */ n(
126
+ K,
126
127
  {
127
128
  onClick: h == null ? void 0 : h.onClick,
128
129
  "data-testid": h == null ? void 0 : h.testId,
129
- disabled: (h == null ? void 0 : h.disabled) || D,
130
+ disabled: (h == null ? void 0 : h.disabled) || v,
130
131
  color: h == null ? void 0 : h.buttonColor,
131
- children: (F = h.text) != null ? F : `Button ${k}`
132
+ children: (E = h.text) != null ? E : `Button ${w}`
132
133
  },
133
- k
134
+ w
134
135
  );
135
136
  }),
136
- r && /* @__PURE__ */ i(
137
- W,
137
+ r && /* @__PURE__ */ n(
138
+ K,
138
139
  {
139
- onClick: () => N(null, null, function* () {
140
+ onClick: () => L(null, null, function* () {
140
141
  var h;
141
- g(!0), yield (h = r.onClick) == null ? void 0 : h.call(r), g(!1);
142
+ m(!0), yield (h = r.onClick) == null ? void 0 : h.call(r), m(!1);
142
143
  }),
143
144
  "data-testid": r.testId,
144
- disabled: r.disabled || D,
145
+ disabled: r.disabled || v,
145
146
  color: r == null ? void 0 : r.buttonColor,
146
147
  children: r.text
147
148
  }
@@ -150,7 +151,7 @@ const We = ({
150
151
  ]
151
152
  }
152
153
  );
153
- }, Pt = {
154
+ }, Ut = {
154
155
  popper: {
155
156
  modifiers: [
156
157
  {
@@ -161,179 +162,179 @@ const We = ({
161
162
  }
162
163
  ]
163
164
  }
164
- }, Ge = {
165
+ }, Ze = {
165
166
  right: 2
166
- }, Ve = ({
167
+ }, je = ({
167
168
  minLength: e,
168
169
  preLoadedOptions: t,
169
170
  lookup: o,
170
- label: n,
171
+ label: i,
171
172
  inputValue: r
172
- }) => Be({
173
+ }) => Ke({
173
174
  queryFn: () => e && r.length < e ? t != null ? t : [] : t ? t.filter(
174
175
  (s) => s.label.toLowerCase().includes(r.toLowerCase())
175
176
  ) : o(r),
176
- queryKey: ["autocomplete", n, r]
177
+ queryKey: ["autocomplete", i, r]
177
178
  });
178
- function Mo({
179
- lookup: e = () => N(null, null, function* () {
179
+ function Vo({
180
+ lookup: e = () => L(null, null, function* () {
180
181
  }),
181
182
  enableHighlighting: t = !0,
182
183
  onChange: o,
183
- onInputChange: n,
184
+ onInputChange: i,
184
185
  minLength: r = 0,
185
186
  label: s,
186
187
  value: u,
187
188
  "data-testid": a,
188
- sx: l,
189
- boxSx: c,
190
- textFieldColor: x,
191
- textFieldVariant: A = "filled",
192
- textFieldFocused: D,
193
- textFieldSx: g,
194
- loadingText: S = "Loading...",
195
- noOptionsText: y = "No options",
196
- popupIcon: h = /* @__PURE__ */ i(wt, {}),
197
- error: k = !1,
198
- helperText: F = "",
199
- preLoadedOptions: T = void 0,
200
- disablePortal: V = !1,
201
- disableIconFlip: K = !1,
202
- chipToolTipSlotProps: _ = Pt,
203
- placeholderText: O = void 0,
189
+ sx: c,
190
+ boxSx: l,
191
+ textFieldColor: g,
192
+ textFieldVariant: x = "filled",
193
+ textFieldFocused: v,
194
+ textFieldSx: m,
195
+ loadingText: C = "Loading...",
196
+ noOptionsText: S = "No options",
197
+ popupIcon: h = /* @__PURE__ */ n(Ft, {}),
198
+ error: w = !1,
199
+ helperText: E = "",
200
+ preLoadedOptions: _ = void 0,
201
+ disablePortal: W = !1,
202
+ disableIconFlip: D = !1,
203
+ chipToolTipSlotProps: N = Ut,
204
+ placeholderText: B = void 0,
204
205
  onRightClick: X = () => {
205
206
  },
206
- disableDefaultRightClickBehaviour: U = !1,
207
+ disableDefaultRightClickBehaviour: q = !1,
207
208
  readOnly: R,
208
- hideInputEndAdornment: w
209
+ hideInputEndAdornment: b
209
210
  }) {
210
- const [C, B] = G(""), Q = (p, v) => {
211
- const $ = u.filter((ne) => ne.id !== v);
212
- o($, "delete", p);
213
- }, { data: f, isLoading: E } = Ve({
214
- inputValue: C,
211
+ const [y, z] = H(""), J = (p, k) => {
212
+ const M = u.filter((ne) => ne.id !== k);
213
+ o(M, "delete", p);
214
+ }, { data: A, isLoading: P } = je({
215
+ inputValue: y,
215
216
  label: s,
216
217
  lookup: e,
217
218
  minLength: r,
218
- preLoadedOptions: T
219
- }), H = C.length >= r;
220
- return /* @__PURE__ */ m("div", { "data-testid": a, children: [
221
- /* @__PURE__ */ i(
222
- le,
219
+ preLoadedOptions: _
220
+ }), G = y.length >= r;
221
+ return /* @__PURE__ */ f("div", { "data-testid": a, children: [
222
+ /* @__PURE__ */ n(
223
+ ce,
223
224
  {
224
- sx: d(d({}, l), K ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
225
+ sx: d(d({}, c), D ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
225
226
  "data-testid": a ? `${a}:Autocomplete` : void 0,
226
- disablePortal: V,
227
+ disablePortal: W,
227
228
  multiple: !0,
228
229
  getOptionLabel: (p) => typeof p == "string" ? p : p.label,
229
- loading: H ? E : !1,
230
- options: [...u, ...f != null ? f : []],
230
+ loading: G ? P : !1,
231
+ options: [...u, ...A != null ? A : []],
231
232
  filterSelectedOptions: !0,
232
233
  includeInputInList: !0,
233
234
  value: u,
234
- onChange: (p, v, $) => {
235
- o(v, $, p);
235
+ onChange: (p, k, M) => {
236
+ o(k, M, p);
236
237
  },
237
- onInputChange: (p, v, $) => {
238
- B(v), n && n(u, $, p);
238
+ onInputChange: (p, k, M) => {
239
+ z(k), i && i(u, M, p);
239
240
  },
240
- noOptionsText: H ? y : "Start typing to search",
241
- loadingText: S,
241
+ noOptionsText: G ? S : "Start typing to search",
242
+ loadingText: C,
242
243
  popupIcon: h,
243
- renderInput: (p) => /* @__PURE__ */ i(
244
- ce,
245
- b(d({}, p), {
244
+ renderInput: (p) => /* @__PURE__ */ n(
245
+ de,
246
+ F(d({}, p), {
246
247
  label: s,
247
248
  fullWidth: !0,
248
- variant: A,
249
- error: k,
250
- helperText: F,
249
+ variant: x,
250
+ error: w,
251
+ helperText: E,
251
252
  autoComplete: "off",
252
253
  slotProps: {
253
- input: b(d({}, p.InputProps), {
254
- endAdornment: w ? void 0 : /* @__PURE__ */ m(M, { children: [
255
- E ? /* @__PURE__ */ i(te, { color: "inherit", size: 20 }) : null,
254
+ input: F(d({}, p.InputProps), {
255
+ endAdornment: b ? void 0 : /* @__PURE__ */ f($, { children: [
256
+ P ? /* @__PURE__ */ n(te, { color: "inherit", size: 20 }) : null,
256
257
  p.InputProps.endAdornment
257
258
  ] })
258
259
  })
259
260
  },
260
261
  "data-testid": a ? `${a}:Autocomplete:TextField` : void 0,
261
- onKeyDown: (v) => {
262
- (v.key === "Backspace" || v.key === "Delete") && v.stopPropagation();
262
+ onKeyDown: (k) => {
263
+ (k.key === "Backspace" || k.key === "Delete") && k.stopPropagation();
263
264
  },
264
- color: x,
265
- placeholder: O,
266
- sx: g,
267
- focused: D
265
+ color: g,
266
+ placeholder: B,
267
+ sx: m,
268
+ focused: v
268
269
  })
269
270
  ),
270
271
  renderValue: () => null,
271
- isOptionEqualToValue: (p, v) => p.id === v.id,
272
- renderOption: (p, v, $) => {
272
+ isOptionEqualToValue: (p, k) => p.id === k.id,
273
+ renderOption: (p, k, M) => {
273
274
  if (t) {
274
- const ne = kt(v.label, $.inputValue, {
275
+ const ne = Nt(k.label, M.inputValue, {
275
276
  insideWords: !0,
276
277
  findAllOccurrences: !0
277
- }), et = yt(v.label, ne);
278
- return /* @__PURE__ */ se(
278
+ }), at = It(k.label, ne);
279
+ return /* @__PURE__ */ le(
279
280
  "li",
280
- b(d({}, p), {
281
- key: v.id,
282
- "data-testid": a ? `${a}:Autocomplete:option(${v.id.toString()})` : void 0
281
+ F(d({}, p), {
282
+ key: k.id,
283
+ "data-testid": a ? `${a}:Autocomplete:option(${k.id.toString()})` : void 0
283
284
  }),
284
- /* @__PURE__ */ i("div", { children: et.map((ue, tt) => /* @__PURE__ */ i(
285
+ /* @__PURE__ */ n("div", { children: at.map((he, st) => /* @__PURE__ */ n(
285
286
  "span",
286
287
  {
287
288
  style: {
288
- fontWeight: ue.highlight ? 700 : 400
289
+ fontWeight: he.highlight ? 700 : 400
289
290
  },
290
- children: ue.text
291
+ children: he.text
291
292
  },
292
- tt
293
+ st
293
294
  )) })
294
295
  );
295
296
  } else
296
- return /* @__PURE__ */ se(
297
+ return /* @__PURE__ */ le(
297
298
  "li",
298
- b(d({}, p), {
299
- key: v.id,
300
- "data-testid": a ? `${a}:option(${v.id.toString()})` : void 0
299
+ F(d({}, p), {
300
+ key: k.id,
301
+ "data-testid": a ? `${a}:option(${k.id.toString()})` : void 0
301
302
  }),
302
- v.label
303
+ k.label
303
304
  );
304
305
  },
305
306
  onMouseDownCapture: (p) => {
306
- p.button === Ge.right && U && (p.preventDefault(), p.stopPropagation());
307
+ p.button === Ze.right && q && (p.preventDefault(), p.stopPropagation());
307
308
  },
308
309
  onContextMenuCapture: (p) => {
309
- U && (p.preventDefault(), p.stopPropagation()), X(p);
310
+ q && (p.preventDefault(), p.stopPropagation()), X(p);
310
311
  },
311
312
  readOnly: R
312
313
  }
313
314
  ),
314
- u.length > 0 && /* @__PURE__ */ i(P, { sx: c, children: u.map((p) => {
315
- var v;
316
- return /* @__PURE__ */ i(
317
- lt,
315
+ u.length > 0 && /* @__PURE__ */ n(T, { sx: l, children: u.map((p) => {
316
+ var k;
317
+ return /* @__PURE__ */ n(
318
+ ft,
318
319
  {
319
320
  sx: {
320
321
  marginTop: 1,
321
322
  marginRight: 1,
322
323
  height: "auto"
323
324
  },
324
- label: /* @__PURE__ */ i(
325
- ct,
325
+ label: /* @__PURE__ */ n(
326
+ ze,
326
327
  {
327
- title: (v = p.tooltipContent) != null ? v : "",
328
+ title: (k = p.tooltipContent) != null ? k : "",
328
329
  placement: "bottom-start",
329
- slotProps: _,
330
- children: /* @__PURE__ */ i(I, { style: { whiteSpace: "normal" }, children: p.chipLabel ? p.chipLabel : p.label })
330
+ slotProps: N,
331
+ children: /* @__PURE__ */ n(I, { style: { whiteSpace: "normal" }, children: p.chipLabel ? p.chipLabel : p.label })
331
332
  }
332
333
  ),
333
334
  "data-testid": a ? `${a}:Chip(${p.id.toString()})` : void 0,
334
- onDelete: ($) => Q($, p.id),
335
- deleteIcon: /* @__PURE__ */ i(
336
- vt,
335
+ onDelete: (M) => J(M, p.id),
336
+ deleteIcon: /* @__PURE__ */ n(
337
+ Et,
337
338
  {
338
339
  "data-testid": a ? `${a}:Chip(${p.id.toString()}):deleteIcon` : void 0
339
340
  }
@@ -344,141 +345,141 @@ function Mo({
344
345
  }) })
345
346
  ] });
346
347
  }
347
- const Lo = /MUI: The value provided to.*is invalid/i, Oo = ({
348
- lookup: e = () => N(null, null, function* () {
348
+ const Ko = /MUI: The value provided to.*is invalid/i, Xo = ({
349
+ lookup: e = () => L(null, null, function* () {
349
350
  }),
350
351
  onChange: t,
351
352
  onInputChange: o,
352
- label: n,
353
+ label: i,
353
354
  value: r,
354
355
  sx: s,
355
356
  textFieldColor: u,
356
357
  textFieldVariant: a = "filled",
357
- textFieldFocused: l,
358
- textFieldSx: c,
359
- error: x = !1,
360
- "data-testid": A,
361
- loadingText: D = "Loading...",
362
- noOptionsText: g = "No options",
363
- minLength: S = 3,
364
- disablePortal: y = !1,
358
+ textFieldFocused: c,
359
+ textFieldSx: l,
360
+ error: g = !1,
361
+ "data-testid": x,
362
+ loadingText: v = "Loading...",
363
+ noOptionsText: m = "No options",
364
+ minLength: C = 3,
365
+ disablePortal: S = !1,
365
366
  preLoadedOptions: h,
366
- helperText: k = "",
367
- disabled: F,
368
- popupIcon: T,
369
- disableIconFlip: V,
370
- placeholderText: K = void 0,
371
- onRightClick: _ = () => {
367
+ helperText: w = "",
368
+ disabled: E,
369
+ popupIcon: _,
370
+ disableIconFlip: W,
371
+ placeholderText: D = void 0,
372
+ onRightClick: N = () => {
372
373
  },
373
- disableDefaultRightClickBehaviour: O = !1,
374
+ disableDefaultRightClickBehaviour: B = !1,
374
375
  readOnly: X,
375
- hideInputEndAdornment: U
376
+ hideInputEndAdornment: q
376
377
  }) => {
377
- const [R, w] = G(""), { data: C, isLoading: B } = Ve({
378
+ const [R, b] = H(""), { data: y, isLoading: z } = je({
378
379
  inputValue: R,
379
- label: n,
380
+ label: i,
380
381
  lookup: e,
381
- minLength: S != null ? S : 0,
382
+ minLength: C != null ? C : 0,
382
383
  preLoadedOptions: h
383
- }), Q = R.length >= S;
384
- return /* @__PURE__ */ i("div", { "data-testid": A, children: /* @__PURE__ */ i(
385
- dt,
384
+ }), J = R.length >= C;
385
+ return /* @__PURE__ */ n("div", { "data-testid": x, children: /* @__PURE__ */ n(
386
+ mt,
386
387
  {
387
388
  direction: "row",
388
389
  spacing: 1,
389
- onMouseDownCapture: (f) => {
390
- f.button === Ge.right && O && (f.preventDefault(), f.stopPropagation());
390
+ onMouseDownCapture: (A) => {
391
+ A.button === Ze.right && B && (A.preventDefault(), A.stopPropagation());
391
392
  },
392
- onContextMenuCapture: (f) => {
393
- O && (f.preventDefault(), f.stopPropagation()), _(f);
393
+ onContextMenuCapture: (A) => {
394
+ B && (A.preventDefault(), A.stopPropagation()), N(A);
394
395
  },
395
- children: /* @__PURE__ */ i(
396
- le,
396
+ children: /* @__PURE__ */ n(
397
+ ce,
397
398
  {
398
- sx: d(d({}, s), V ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
399
- "data-testid": A ? `${A}:Autocomplete` : void 0,
400
- loading: Q ? B : !1,
401
- options: C != null ? C : [],
402
- onChange: (f, E, H) => {
403
- t(f, E, H);
399
+ sx: d(d({}, s), W ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
400
+ "data-testid": x ? `${x}:Autocomplete` : void 0,
401
+ loading: J ? z : !1,
402
+ options: y != null ? y : [],
403
+ onChange: (A, P, G) => {
404
+ t(A, P, G);
404
405
  },
405
- disablePortal: y,
406
- filterOptions: (f) => f,
406
+ disablePortal: S,
407
+ filterOptions: (A) => A,
407
408
  value: r,
408
- noOptionsText: Q ? g : "Start typing to search",
409
- loadingText: D,
410
- getOptionLabel: (f) => f.label,
411
- popupIcon: T,
412
- renderInput: (f) => /* @__PURE__ */ i(
413
- ce,
414
- b(d({
415
- "data-testid": A ? `${A}:Autocomplete:TextField` : void 0
416
- }, f), {
409
+ noOptionsText: J ? m : "Start typing to search",
410
+ loadingText: v,
411
+ getOptionLabel: (A) => A.label,
412
+ popupIcon: _,
413
+ renderInput: (A) => /* @__PURE__ */ n(
414
+ de,
415
+ F(d({
416
+ "data-testid": x ? `${x}:Autocomplete:TextField` : void 0
417
+ }, A), {
417
418
  variant: a,
418
- label: n,
419
+ label: i,
419
420
  color: u,
420
- error: x,
421
- helperText: k,
421
+ error: g,
422
+ helperText: w,
422
423
  autoComplete: "off",
423
424
  slotProps: {
424
- input: b(d({}, f.InputProps), {
425
- endAdornment: U ? void 0 : /* @__PURE__ */ m(M, { children: [
426
- B ? /* @__PURE__ */ i(te, { color: "inherit", size: 20 }) : null,
427
- f.InputProps.endAdornment
425
+ input: F(d({}, A.InputProps), {
426
+ endAdornment: q ? void 0 : /* @__PURE__ */ f($, { children: [
427
+ z ? /* @__PURE__ */ n(te, { color: "inherit", size: 20 }) : null,
428
+ A.InputProps.endAdornment
428
429
  ] })
429
430
  })
430
431
  },
431
- placeholder: K,
432
- sx: c,
433
- focused: l
432
+ placeholder: D,
433
+ sx: l,
434
+ focused: c
434
435
  })
435
436
  ),
436
- isOptionEqualToValue: (f, E) => f.id === E.id,
437
- onInputChange: (f, E, H) => {
438
- w(E), o && o(E, H, f);
437
+ isOptionEqualToValue: (A, P) => A.id === P.id,
438
+ onInputChange: (A, P, G) => {
439
+ b(P), o && o(P, G, A);
439
440
  },
440
- renderOption: (f, E) => /* @__PURE__ */ se(
441
+ renderOption: (A, P) => /* @__PURE__ */ le(
441
442
  "li",
442
- b(d({}, f), {
443
- key: E.id,
444
- "data-testid": A ? `${A}:Autocomplete:option(${E.id.toString()})` : void 0
443
+ F(d({}, A), {
444
+ key: P.id,
445
+ "data-testid": x ? `${x}:Autocomplete:option(${P.id.toString()})` : void 0
445
446
  }),
446
- E.label
447
+ P.label
447
448
  ),
448
- disabled: F,
449
+ disabled: E,
449
450
  readOnly: X
450
451
  }
451
452
  )
452
453
  }
453
454
  ) });
454
- }, Tt = (e) => {
455
+ }, Ht = (e) => {
455
456
  if (!e)
456
457
  return -1;
457
458
  try {
458
- const o = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), n = decodeURIComponent(
459
- bt.from(o, "base64").toString("utf8").split("").map(function(s) {
459
+ const o = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), i = decodeURIComponent(
460
+ Lt.from(o, "base64").toString("utf8").split("").map(function(s) {
460
461
  return "%" + ("00" + s.charCodeAt(0).toString(16)).slice(-2);
461
462
  }).join("")
462
- ), r = JSON.parse(n);
463
+ ), r = JSON.parse(i);
463
464
  return r != null && r.exp ? r.exp : -1;
464
465
  } catch (t) {
465
466
  return -1;
466
467
  }
467
- }, Ro = ({
468
+ }, Yo = ({
468
469
  open: e = !1,
469
470
  closeHandler: t,
470
471
  setAuth0ExpiryTime: o
471
472
  }) => {
472
- const { logout: n, getAccessTokenSilently: r } = de();
473
- return /* @__PURE__ */ i(
474
- We,
473
+ const { logout: i, getAccessTokenSilently: r } = ue();
474
+ return /* @__PURE__ */ n(
475
+ Je,
475
476
  {
476
477
  isOpen: e,
477
478
  primaryButton: {
478
479
  text: "Continue",
479
- onClick: () => N(null, null, function* () {
480
- const c = yield r({ cacheMode: "off" }), x = Tt(c) * 1e3;
481
- o(x), t();
480
+ onClick: () => L(null, null, function* () {
481
+ const l = yield r({ cacheMode: "off" }), g = Ht(l) * 1e3;
482
+ o(g), t();
482
483
  }),
483
484
  disabled: !1,
484
485
  testId: "PreferencesDialog",
@@ -486,8 +487,8 @@ const Lo = /MUI: The value provided to.*is invalid/i, Oo = ({
486
487
  },
487
488
  secondaryButton: {
488
489
  text: "Log out",
489
- onClick: () => N(null, null, function* () {
490
- n({ logoutParams: { returnTo: `${window.location.origin}` } });
490
+ onClick: () => L(null, null, function* () {
491
+ i({ logoutParams: { returnTo: `${window.location.origin}` } });
491
492
  }),
492
493
  disabled: !1,
493
494
  testId: "PreferencesDialog",
@@ -496,42 +497,42 @@ const Lo = /MUI: The value provided to.*is invalid/i, Oo = ({
496
497
  onClose: t,
497
498
  dialogTitle: "Session expiry",
498
499
  disableCloseOnBackdropOrEscape: !0,
499
- children: /* @__PURE__ */ i("p", { style: { marginBottom: 0 }, children: "Your session is about to time out due to inactivity. Do you want to continue?" })
500
+ children: /* @__PURE__ */ n("p", { style: { marginBottom: 0 }, children: "Your session is about to time out due to inactivity. Do you want to continue?" })
500
501
  }
501
502
  );
502
503
  };
503
- function Nt(e) {
504
+ function Wt(e) {
504
505
  return "error" in e;
505
506
  }
506
- function $t(e) {
507
- var n;
508
- const t = e.error, o = (n = e == null ? void 0 : e.error_description) != null ? n : "";
507
+ function qt(e) {
508
+ var i;
509
+ const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
509
510
  return t === "access_denied" && o.startsWith("You do not have the required authorization");
510
511
  }
511
- function Mt(e) {
512
- var n;
513
- const t = e.error, o = (n = e == null ? void 0 : e.error_description) != null ? n : "";
512
+ function zt(e) {
513
+ var i;
514
+ const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
514
515
  return t === "access_denied" && o.startsWith("User did not authorize the request");
515
516
  }
516
- function Lt(e) {
517
- var n;
518
- const t = e.error, o = (n = e == null ? void 0 : e.error_description) != null ? n : "";
517
+ function Gt(e) {
518
+ var i;
519
+ const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
519
520
  return t === "access_denied" && o.match(/Script.*time.*exceeded/);
520
521
  }
521
- function Uo({
522
+ function Qo({
522
523
  children: e,
523
524
  appName: t = "the app",
524
525
  throwErrors: o = "none",
525
- disableConsoleLogging: n = !1,
526
+ disableConsoleLogging: i = !1,
526
527
  onError: r = () => {
527
528
  }
528
529
  }) {
529
- var A, D;
530
- const { isAuthenticated: s, isLoading: u, error: a, loginWithRedirect: l, logout: c } = de();
531
- ge(() => {
530
+ var x, v;
531
+ const { isAuthenticated: s, isLoading: u, error: a, loginWithRedirect: c, logout: l } = ue();
532
+ xe(() => {
532
533
  a && r(a);
533
534
  }, [a, r]);
534
- const x = rt(
535
+ const g = ut(
535
536
  () => ({
536
537
  appState: {
537
538
  returnTo: `${window.location.pathname}${window.location.search}`
@@ -539,166 +540,243 @@ function Uo({
539
540
  }),
540
541
  []
541
542
  );
542
- if (ge(() => {
543
- u || s || a || l(x);
544
- }, [u, s, a, l, r, x]), a) {
545
- if (n || console.error(
543
+ if (xe(() => {
544
+ u || s || a || c(g);
545
+ }, [u, s, a, c, r, g]), a) {
546
+ if (i || console.error(
546
547
  `Error detected in AuthGuard [isAuthenticated=${s},isLoading=${u}]`,
547
548
  a
548
549
  ), o === "all")
549
550
  throw a;
550
- if (Nt(a)) {
551
- let g = "Auth error", S = "An unknown Auth0 error occurred.";
552
- if ($t(a))
553
- g = "Unauthorised", S = `You are not authorised to access ${t}.`;
554
- else if (Mt(a))
555
- g = "App not authorised", S = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
556
- else if (Lt(a))
557
- g = "Auth0 script execution time exceeded", S = "The Auth0 login flow exceeded the time limit (20s). Try again in a minute by clicking the RELOAD button below.";
551
+ if (Wt(a)) {
552
+ let m = "Auth error", C = "An unknown Auth0 error occurred.";
553
+ if (qt(a))
554
+ m = "Unauthorised", C = `You are not authorised to access ${t}.`;
555
+ else if (zt(a))
556
+ m = "App not authorised", C = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
557
+ else if (Gt(a))
558
+ m = "Auth0 script execution time exceeded", C = "The Auth0 login flow exceeded the time limit (20s). Try again in a minute by clicking the RELOAD button below.";
558
559
  else if (a.message === "Invalid state") {
559
- const y = localStorage.getItem("auth0_redirect_count");
560
- y ? y && parseInt(y) < 2 && (localStorage.setItem("auth0_redirect_count", String(parseInt(y) + 1)), l(x)) : (localStorage.setItem("auth0_redirect_count", "1"), l(x));
560
+ const S = localStorage.getItem("auth0_redirect_count");
561
+ S ? S && parseInt(S) < 2 && (localStorage.setItem("auth0_redirect_count", String(parseInt(S) + 1)), c(g)) : (localStorage.setItem("auth0_redirect_count", "1"), c(g));
561
562
  } else if (o === "unknown") throw a;
562
- return /* @__PURE__ */ m(Me, { open: !0, children: [
563
- /* @__PURE__ */ i(Oe, { children: g }),
564
- /* @__PURE__ */ m(Re, { children: [
565
- /* @__PURE__ */ i(I, { children: S }),
566
- /* @__PURE__ */ i("br", {}),
567
- /* @__PURE__ */ i(I, { variant: "subtitle2", children: "Details from Auth0" }),
568
- /* @__PURE__ */ m(I, { variant: "body2", children: [
563
+ return /* @__PURE__ */ f(Re, { open: !0, children: [
564
+ /* @__PURE__ */ n(He, { children: m }),
565
+ /* @__PURE__ */ f(We, { children: [
566
+ /* @__PURE__ */ n(I, { children: C }),
567
+ /* @__PURE__ */ n("br", {}),
568
+ /* @__PURE__ */ n(I, { variant: "subtitle2", children: "Details from Auth0" }),
569
+ /* @__PURE__ */ f(I, { variant: "body2", children: [
569
570
  "error: ",
570
- (A = a == null ? void 0 : a.error) != null ? A : "N/A"
571
+ (x = a == null ? void 0 : a.error) != null ? x : "N/A"
571
572
  ] }),
572
- /* @__PURE__ */ m(I, { variant: "body2", children: [
573
+ /* @__PURE__ */ f(I, { variant: "body2", children: [
573
574
  "description: ",
574
- (D = a == null ? void 0 : a.error_description) != null ? D : "N/A"
575
+ (v = a == null ? void 0 : a.error_description) != null ? v : "N/A"
575
576
  ] })
576
577
  ] }),
577
- /* @__PURE__ */ m(Ue, { children: [
578
- g === "Auth0 script execution time exceeded" && /* @__PURE__ */ i(W, { href: window.location.origin + window.location.pathname, children: "Reload" }),
579
- /* @__PURE__ */ i(W, { onClick: () => c({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" })
578
+ /* @__PURE__ */ f(qe, { children: [
579
+ m === "Auth0 script execution time exceeded" && /* @__PURE__ */ n(K, { href: window.location.origin + window.location.pathname, children: "Reload" }),
580
+ /* @__PURE__ */ n(K, { onClick: () => l({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" })
580
581
  ] })
581
582
  ] });
582
583
  } else if (o === "unknown") throw a;
583
584
  }
584
- return s ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */ i(M, { children: e })) : /* @__PURE__ */ i(Ft, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
585
+ return s ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */ n($, { children: e })) : /* @__PURE__ */ n($t, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
585
586
  }
586
- const Ot = {
587
+ const pe = () => {
588
+ const e = oe();
589
+ return gt(e.breakpoints.down("sm"));
590
+ }, Vt = 64, Kt = 72, Xt = 256, Q = O(!0), Yt = O(Xt), Qt = O(Kt), Fe = O(""), Jt = O(void 0), Zt = O(Vt), jt = O(void 0), eo = ({
591
+ label: e,
592
+ to: t,
593
+ icon: o,
594
+ subMenu: i,
595
+ subMenuInitialOpen: r,
596
+ onClick: s,
597
+ closeOnSmallScreen: u,
598
+ disabled: a = !1,
599
+ openInNewWindow: c = !1,
600
+ extraSubIndentSpace: l = 0,
601
+ tooltip: g = "",
602
+ tooltipMenuOpen: x = "",
603
+ tooltipMenuClosed: v = ""
604
+ }) => {
605
+ const [m, C] = H(r), [S, h] = U(Q), { pathname: w } = Mt(), E = pe(), _ = "  ".repeat(l);
606
+ return /* @__PURE__ */ f($, { children: [
607
+ /* @__PURE__ */ n(
608
+ ze,
609
+ {
610
+ title: g || (x && S ? x : v && !S ? v : ""),
611
+ arrow: !0,
612
+ placement: "right",
613
+ children: /* @__PURE__ */ f(
614
+ Ce,
615
+ F(d({
616
+ component: t ? De : "button",
617
+ sx: { width: "100%" },
618
+ to: t,
619
+ onClick: () => {
620
+ s == null || s(), S ? (C((D) => !D), u && E && h(!1)) : i && (C(!0), h(!0));
621
+ },
622
+ "aria-label": e,
623
+ selected: w === t,
624
+ disabled: a
625
+ }, c ? { rel: "noopener noreferrer", target: "_blank" } : {}), {
626
+ children: [
627
+ /* @__PURE__ */ n(xt, { sx: { padding: "8px" }, children: o }),
628
+ /* @__PURE__ */ n(Ge, { in: S, unmountOnExit: !0, children: /* @__PURE__ */ f(T, { children: [
629
+ /* @__PURE__ */ n(Se, { primary: e }),
630
+ i && /* @__PURE__ */ n(At, { children: m ? /* @__PURE__ */ n(_t, {}) : /* @__PURE__ */ n(Pt, {}) })
631
+ ] }) })
632
+ ]
633
+ })
634
+ )
635
+ }
636
+ ),
637
+ i && /* @__PURE__ */ n(Ve, { in: m && S, timeout: "auto", unmountOnExit: !0, children: /* @__PURE__ */ n(Ct, { component: "div", disablePadding: !0, children: i.map((D) => /* @__PURE__ */ n(
638
+ Ce,
639
+ {
640
+ onClick: () => {
641
+ D.onClick && (D == null || D.onClick()), S && D != null && D.closeOnSmallScreen && E && h(!1);
642
+ },
643
+ to: D.to,
644
+ component: D.to ? De : "button",
645
+ sx: { width: "100%" },
646
+ selected: w === D.to,
647
+ disabled: D.disabled,
648
+ children: /* @__PURE__ */ n(
649
+ Se,
650
+ {
651
+ primary: _ + D.label,
652
+ inset: !0,
653
+ slotProps: { primary: { variant: "body2" } }
654
+ }
655
+ )
656
+ },
657
+ D.label
658
+ )) }) })
659
+ ] });
660
+ }, Jo = (o) => {
661
+ var i = o, { subMenuInitialOpen: e } = i, t = re(i, ["subMenuInitialOpen"]);
662
+ const r = e === void 0 ? "initial-undefined" : String(e);
663
+ return /* @__PURE__ */ n(eo, d({ subMenuInitialOpen: e }, t), r);
664
+ }, to = {
587
665
  autoHideDuration: 6e3,
588
666
  anchorOrigin: { vertical: "top", horizontal: "center" },
589
667
  // The default is false. If we prefer timer to continue when window loses
590
668
  // focus, change to true
591
669
  disableWindowBlurListener: !1
592
- }, Rt = {
670
+ }, oo = {
593
671
  shouldClose: (e, t) => t !== "clickaway"
594
- }, ke = {
672
+ }, _e = {
595
673
  message: "",
596
674
  severity: "info",
597
675
  variant: "standard",
598
676
  progressIndicator: void 0
599
677
  // Can use 'circular' or 'linear'
600
- }, ye = 100, be = 2e3, Ut = 2e3, Bt = /* @__PURE__ */ (() => {
678
+ }, Pe = 100, Te = 2e3, no = 2e3, io = /* @__PURE__ */ (() => {
601
679
  let e = 0;
602
680
  return () => (e += 1, e);
603
- })(), Ht = {
681
+ })(), ro = {
604
682
  borderBottomLeftRadius: "0px",
605
683
  borderBottomRightRadius: "0px"
606
- }, qt = {}, zt = {}, Ke = at(null);
607
- function Wt(s) {
684
+ }, ao = {}, so = {}, et = pt(null);
685
+ function lo(s) {
608
686
  var u = s, {
609
- overrideState: e = qt,
610
- overrideActions: t = zt,
611
- shouldClose: o = Rt.shouldClose,
612
- children: n
613
- } = u, r = fe(u, [
687
+ overrideState: e = ao,
688
+ overrideActions: t = so,
689
+ shouldClose: o = oo.shouldClose,
690
+ children: i
691
+ } = u, r = re(u, [
614
692
  "overrideState",
615
693
  "overrideActions",
616
694
  "shouldClose",
617
695
  "children"
618
696
  ]);
619
697
  var R;
620
- const [{ open: a }, l] = G({ open: !1 }), c = re([]), x = re(Date.now()), A = re(0), D = xe((w) => {
621
- l({ open: w });
622
- }, []), g = xe((w = {}) => {
623
- A.current += 1, c.current.length >= ye && Date.now() - x.current >= be && (x.current = Date.now(), console.error(
624
- `SaladBarProvider: MAX_QUEUE_LENGTH (${ye}) hit ${A.current} times in last ${be}ms)`
625
- ), A.current = 0);
626
- const C = d(b(d({}, ke), {
627
- key: Bt()
628
- }), w);
629
- return c.current.push(C), c.current.length === 1 && l({ open: !0 }), C.key;
630
- }, []), S = (w = "", C = {}) => g(d({ message: w, severity: "success" }, C)), y = (w = "", C = {}) => g(d({ message: w, severity: "info" }, C)), h = (w = "", C = {}) => g(d({ message: w, severity: "warning" }, C)), k = (w = "", C = {}) => g(d({ message: w, severity: "error" }, C)), F = (w) => {
631
- const C = c.current.findIndex((B) => B.key === w);
632
- if (C !== -1)
633
- return C === 0 ? (l({ open: !1 }), c.current[0]) : c.current.splice(C, 1);
634
- }, T = (w, C) => {
635
- o(w, C) && l({ open: !1 });
636
- }, V = () => {
637
- }, K = () => {
638
- c.current.shift(), c.current.length > 0 && l({ open: !0 });
639
- }, _ = (R = c.current[0]) != null ? R : d({}, ke), O = {};
640
- "autoHideDuration" in _ && (O.autoHideDuration = _.autoHideDuration);
641
- const X = d(d({}, Ot), r), U = d(d({
698
+ const [{ open: a }, c] = H({ open: !1 }), l = ae([]), g = ae(Date.now()), x = ae(0), v = Ae((b) => {
699
+ c({ open: b });
700
+ }, []), m = Ae((b = {}) => {
701
+ x.current += 1, l.current.length >= Pe && Date.now() - g.current >= Te && (g.current = Date.now(), console.error(
702
+ `SaladBarProvider: MAX_QUEUE_LENGTH (${Pe}) hit ${x.current} times in last ${Te}ms)`
703
+ ), x.current = 0);
704
+ const y = d(F(d({}, _e), {
705
+ key: io()
706
+ }), b);
707
+ return l.current.push(y), l.current.length === 1 && c({ open: !0 }), y.key;
708
+ }, []), C = (b = "", y = {}) => m(d({ message: b, severity: "success" }, y)), S = (b = "", y = {}) => m(d({ message: b, severity: "info" }, y)), h = (b = "", y = {}) => m(d({ message: b, severity: "warning" }, y)), w = (b = "", y = {}) => m(d({ message: b, severity: "error" }, y)), E = (b) => {
709
+ const y = l.current.findIndex((z) => z.key === b);
710
+ if (y !== -1)
711
+ return y === 0 ? (c({ open: !1 }), l.current[0]) : l.current.splice(y, 1);
712
+ }, _ = (b, y) => {
713
+ o(b, y) && c({ open: !1 });
714
+ }, W = () => {
715
+ }, D = () => {
716
+ l.current.shift(), l.current.length > 0 && c({ open: !0 });
717
+ }, N = (R = l.current[0]) != null ? R : d({}, _e), B = {};
718
+ "autoHideDuration" in N && (B.autoHideDuration = N.autoHideDuration);
719
+ const X = d(d({}, to), r), q = d(d({
642
720
  open: a,
643
- setOpen: D,
644
- enqueueNotification: g,
645
- enqueueSuccessNotification: S,
646
- enqueueInfoNotification: y,
721
+ setOpen: v,
722
+ enqueueNotification: m,
723
+ enqueueSuccessNotification: C,
724
+ enqueueInfoNotification: S,
647
725
  enqueueWarningNotification: h,
648
- enqueueErrorNotification: k,
649
- removeNotification: F
726
+ enqueueErrorNotification: w,
727
+ removeNotification: E
650
728
  }, e), t);
651
- return /* @__PURE__ */ m(Ke.Provider, { value: U, children: [
652
- n,
653
- /* @__PURE__ */ i(
654
- ut,
655
- b(d(d({}, X), O), {
729
+ return /* @__PURE__ */ f(et.Provider, { value: q, children: [
730
+ i,
731
+ /* @__PURE__ */ n(
732
+ St,
733
+ F(d(d({}, X), B), {
656
734
  open: a,
657
- onClose: T,
735
+ onClose: _,
658
736
  TransitionProps: {
659
- onExited: K,
660
- onExit: V
737
+ onExited: D,
738
+ onExit: W
661
739
  },
662
- sx: { zIndex: Ut },
663
- children: /* @__PURE__ */ m("div", { children: [
664
- /* @__PURE__ */ i(
665
- pt,
740
+ sx: { zIndex: no },
741
+ children: /* @__PURE__ */ f("div", { children: [
742
+ /* @__PURE__ */ n(
743
+ vt,
666
744
  {
667
- onClose: (w) => T(w, "closeAlert"),
668
- severity: _.severity,
745
+ onClose: (b) => _(b, "closeAlert"),
746
+ severity: N.severity,
669
747
  variant: "filled",
670
- icon: _.progressIndicator === "circular" ? /* @__PURE__ */ i(te, { size: "1em" }) : void 0,
671
- style: _.progressIndicator === "linear" ? Ht : void 0,
672
- children: _.message
748
+ icon: N.progressIndicator === "circular" ? /* @__PURE__ */ n(te, { size: "1em" }) : void 0,
749
+ style: N.progressIndicator === "linear" ? ro : void 0,
750
+ children: N.message
673
751
  }
674
752
  ),
675
- _.progressIndicator === "linear" && /* @__PURE__ */ i(Le, { color: "primary" })
753
+ N.progressIndicator === "linear" && /* @__PURE__ */ n(Ue, { color: "primary" })
676
754
  ] })
677
755
  })
678
756
  )
679
757
  ] });
680
758
  }
681
- class Xe extends Error {
759
+ class tt extends Error {
682
760
  }
683
- me(Xe, "errorName", "ContextError");
684
- function Gt() {
685
- const e = st(Ke);
761
+ ge(tt, "errorName", "ContextError");
762
+ function co() {
763
+ const e = ht(et);
686
764
  if (e === null)
687
- throw new Xe("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
765
+ throw new tt("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
688
766
  return e;
689
767
  }
690
- const Bo = Et(
691
- (e = { autoHideDuration: 1 }, t = {}, o = {}) => ({ children: n }) => /* @__PURE__ */ i(Wt, b(d({}, e), { overrideState: t, overrideActions: o, children: /* @__PURE__ */ i(M, { children: n }) }))
692
- ), Ye = "domainCode";
693
- var Ne;
694
- const Fe = L(
695
- JSON.parse((Ne = localStorage.getItem(Ye)) != null ? Ne : '{"domainCode": ""}').domainCode
696
- ), Vt = L(
697
- (e) => e(Fe),
768
+ const Zo = Ot(
769
+ (e = { autoHideDuration: 1 }, t = {}, o = {}) => ({ children: i }) => /* @__PURE__ */ n(lo, F(d({}, e), { overrideState: t, overrideActions: o, children: /* @__PURE__ */ n($, { children: i }) }))
770
+ ), ot = "domainCode";
771
+ var Oe;
772
+ const Ne = O(
773
+ JSON.parse((Oe = localStorage.getItem(ot)) != null ? Oe : '{"domainCode": ""}').domainCode
774
+ ), uo = O(
775
+ (e) => e(Ne),
698
776
  (e, t, o) => {
699
- t(Fe, o), localStorage.setItem(Ye, JSON.stringify({ domainCode: o }));
777
+ t(Ne, o), localStorage.setItem(ot, JSON.stringify({ domainCode: o }));
700
778
  }
701
- ), Kt = {
779
+ ), po = {
702
780
  act: "ACT",
703
781
  nsw: "NSW",
704
782
  nt: "NT",
@@ -710,92 +788,89 @@ const Fe = L(
710
788
  ag: "AG",
711
789
  fedmps: "FedMPs",
712
790
  "": ""
713
- }, Qe = (e) => {
791
+ }, nt = (e) => {
714
792
  var t;
715
- return e === null ? "N/A" : (t = Kt[e]) != null ? t : "";
716
- }, Ho = ({
793
+ return e === null ? "N/A" : (t = po[e]) != null ? t : "";
794
+ }, jo = ({
717
795
  isLoading: e,
718
796
  isOpen: t,
719
797
  onClose: o,
720
- onDomainChange: n,
798
+ onDomainChange: i,
721
799
  domainOptions: r,
722
800
  applicationName: s,
723
801
  handleLogout: u
724
802
  }) => {
725
- const [a, l] = q(Vt), [c, x] = G(a), { enqueueSuccessNotification: A } = Gt(), D = r.length === 0, g = !!a && !r.includes(a) && !r.includes(c), S = !a || D || g, y = () => N(null, null, function* () {
726
- c ? (l(c), n == null || n(c), A(`Set organisation to ${c}`), o()) : (l(""), n == null || n(""));
727
- }), h = () => N(null, null, function* () {
728
- a && !D && !g ? (x(a), o()) : S && u();
803
+ const [a, c] = U(uo), [l, g] = H(a), { enqueueSuccessNotification: x } = co(), v = r.length === 0, m = !!a && !r.includes(a) && !r.includes(l), C = !a || v || m, S = () => L(null, null, function* () {
804
+ l ? (c(l), i == null || i(l), x(`Set organisation to ${l}`), o()) : (c(""), i == null || i(""));
805
+ }), h = () => L(null, null, function* () {
806
+ a && !v && !m ? (g(a), o()) : C && u();
729
807
  });
730
- let k;
731
- return D ? k = "Unable to retrieve your active organisations. Try logging in again." : g && (k = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ m(
732
- We,
808
+ let w;
809
+ return v ? w = "Unable to retrieve your active organisations. Try logging in again." : m && (w = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ f(
810
+ Je,
733
811
  {
734
812
  isOpen: t,
735
813
  dialogTitle: "Select an organisation",
736
814
  primaryButton: {
737
815
  text: "Confirm",
738
- onClick: y,
739
- disabled: !c || D || g,
816
+ onClick: S,
817
+ disabled: !l || v || m,
740
818
  buttonColor: "primary"
741
819
  },
742
820
  secondaryButton: {
743
- text: S ? "Logout" : "Cancel",
821
+ text: C ? "Logout" : "Cancel",
744
822
  onClick: h
745
823
  },
746
- onClose: S ? () => {
824
+ onClose: C ? () => {
747
825
  } : o,
748
826
  children: [
749
- /* @__PURE__ */ m(I, { marginBottom: 2, children: [
827
+ /* @__PURE__ */ f(I, { marginBottom: 2, children: [
750
828
  "Select the default organisation that you want to use with the ",
751
829
  s,
752
830
  "."
753
831
  ] }),
754
- /* @__PURE__ */ i(
755
- le,
832
+ /* @__PURE__ */ n(
833
+ ce,
756
834
  {
757
835
  loading: e,
758
836
  multiple: !1,
759
837
  disableClearable: !1,
760
- value: c !== "" ? c : null,
761
- onChange: (F, T) => x(T != null ? T : ""),
762
- getOptionLabel: Qe,
838
+ value: l !== "" ? l : null,
839
+ onChange: (E, _) => g(_ != null ? _ : ""),
840
+ getOptionLabel: nt,
763
841
  options: [...r.toSorted()],
764
- renderInput: (F) => /* @__PURE__ */ i(
765
- ce,
766
- b(d({}, F), {
842
+ renderInput: (E) => /* @__PURE__ */ n(
843
+ de,
844
+ F(d({}, E), {
767
845
  variant: "filled",
768
846
  label: "Select organisation",
769
- InputProps: b(d({}, F.InputProps), {
770
- endAdornment: /* @__PURE__ */ m(M, { children: [
771
- e ? /* @__PURE__ */ i(te, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
772
- F.InputProps.endAdornment
847
+ InputProps: F(d({}, E.InputProps), {
848
+ endAdornment: /* @__PURE__ */ f($, { children: [
849
+ e ? /* @__PURE__ */ n(te, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
850
+ E.InputProps.endAdornment
773
851
  ] })
774
852
  })
775
853
  })
776
854
  )
777
855
  }
778
856
  ),
779
- k && /* @__PURE__ */ i(ht, { error: !0, children: k })
857
+ w && /* @__PURE__ */ n(wt, { error: !0, children: w })
780
858
  ]
781
859
  }
782
860
  );
783
- }, Je = () => {
784
- const e = oe();
785
- return ft(e.breakpoints.down("sm"));
786
- }, Xt = 64, Yt = 72, Qt = 256, ee = L(!0), Jt = L(Qt), Zt = L(Yt), Ee = L(""), jt = L(void 0), eo = L(Xt), to = L(void 0);
787
- function oo({ links: e }) {
788
- return /* @__PURE__ */ i("div", { children: "LinksMenu not implemented yet" });
861
+ };
862
+ function ho({ links: e }) {
863
+ return /* @__PURE__ */ n("div", { children: "LinksMenu not implemented yet" });
789
864
  }
790
- const Z = "Navbar", Y = {
791
- root: `${Z}-root`,
792
- menuButton: `${Z}-menuButton`,
793
- hide: `${Z}-hide`,
794
- content: `${Z}-content`
865
+ const j = "Navbar", Y = {
866
+ root: `${j}-root`,
867
+ menuButton: `${j}-menuButton`,
868
+ hide: `${j}-hide`,
869
+ content: `${j}-content`
795
870
  // userInfoHolder: `${PREFIX}-userInfoHolder`,
796
871
  // settings: `${PREFIX}-settings`,
797
872
  // pieChartIcon: `${PREFIX}-pieChartIcon`,
798
- }, no = qe(P, { name: "NavBar" })(({ theme: e }) => ({
873
+ }, fo = Ye(T, { name: "NavBar" })(({ theme: e }) => ({
799
874
  [`&.${Y.root}`]: {
800
875
  display: "flex"
801
876
  },
@@ -814,13 +889,13 @@ const Z = "Navbar", Y = {
814
889
  // marginTop: '64px',
815
890
  // marginBottom: '16px',
816
891
  // },
817
- })), z = (e, t, o) => e.transitions.create(t, {
892
+ })), V = (e, t, o) => e.transitions.create(t, {
818
893
  easing: e.transitions.easing.sharp,
819
894
  duration: o === "leaving" ? e.transitions.duration.leavingScreen : e.transitions.duration.enteringScreen
820
- }), io = (e) => {
895
+ }), mo = (e) => {
821
896
  const t = oe();
822
- return /* @__PURE__ */ i(
823
- gt,
897
+ return /* @__PURE__ */ n(
898
+ Ve,
824
899
  d({
825
900
  easing: t.transitions.easing.sharp,
826
901
  timeout: {
@@ -829,7 +904,7 @@ const Z = "Navbar", Y = {
829
904
  }
830
905
  }, e)
831
906
  );
832
- }, Ze = (e) => {
907
+ }, it = (e) => {
833
908
  var t, o;
834
909
  return {
835
910
  overflowX: "hidden",
@@ -837,110 +912,110 @@ const Z = "Navbar", Y = {
837
912
  backgroundColor: (o = (t = e == null ? void 0 : e.navBar) == null ? void 0 : t.backgroundColor) != null ? o : "white"
838
913
  // Provide default so tests don't need to wrap theme provider
839
914
  };
840
- }, _e = (e, t) => d({
915
+ }, Ie = (e, t) => d({
841
916
  width: t,
842
- transition: z(e, "width", "entering")
843
- }, Ze(e)), Ie = (e, t) => d({
917
+ transition: V(e, "width", "entering")
918
+ }, it(e)), Le = (e, t) => d({
844
919
  width: t,
845
- transition: z(e, "width", "leaving")
846
- }, Ze(e)), ro = qe(mt, {
920
+ transition: V(e, "width", "leaving")
921
+ }, it(e)), go = Ye(yt, {
847
922
  shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
848
- })(({ theme: e, open: t, widthOpen: o, widthClosed: n, isSmallScreen: r }) => d(d({
923
+ })(({ theme: e, open: t, widthOpen: o, widthClosed: i, isSmallScreen: r }) => d(d({
849
924
  flexShrink: 0,
850
925
  whiteSpace: "nowrap",
851
926
  boxSizing: "border-box",
852
927
  display: "flex",
853
928
  flexDirection: "column"
854
- }, t && b(d({}, _e(e, o)), {
929
+ }, t && F(d({}, Ie(e, o)), {
855
930
  backgroundColor: "",
856
- "& .MuiDrawer-paper": _e(e, o)
857
- })), !t && b(d({}, Ie(e, r ? o : n)), {
931
+ "& .MuiDrawer-paper": Ie(e, o)
932
+ })), !t && F(d({}, Le(e, r ? o : i)), {
858
933
  backgroundColor: "",
859
- "& .MuiDrawer-paper": Ie(e, r ? o : n)
934
+ "& .MuiDrawer-paper": Le(e, r ? o : i)
860
935
  })));
861
- function je(e) {
936
+ function rt(e) {
862
937
  return e.replace(
863
938
  /(^|-)([a-z])/g,
864
- (t, o, n) => o === "-" ? " " + n.toUpperCase() : n.toUpperCase()
939
+ (t, o, i) => o === "-" ? " " + i.toUpperCase() : i.toUpperCase()
865
940
  );
866
941
  }
867
- function qo(e, t, o, n) {
942
+ function en(e, t, o, i) {
868
943
  var u;
869
944
  if (!e) return "None";
870
945
  const r = e["https://greens.org.au/roles"];
871
946
  if (!r) return "None";
872
- const s = Object.entries(r).filter(([, a]) => a.includes(t)).map(([a]) => je(a));
873
- return (u = n.find(
874
- (a) => o[a].some((l) => s.includes(l))
947
+ const s = Object.entries(r).filter(([, a]) => a.includes(t)).map(([a]) => rt(a));
948
+ return (u = i.find(
949
+ (a) => o[a].some((c) => s.includes(c))
875
950
  )) != null ? u : "None";
876
951
  }
877
- function ao(e, t) {
878
- return Object.entries(e).reduce((o, [n, r]) => {
879
- const s = je(n), u = t.includes(s) ? r : [];
952
+ function xo(e, t) {
953
+ return Object.entries(e).reduce((o, [i, r]) => {
954
+ const s = rt(i), u = t.includes(s) ? r : [];
880
955
  return [.../* @__PURE__ */ new Set([...o, ...u])];
881
956
  }, []);
882
957
  }
883
- const zo = (e) => {
884
- const { getIdTokenClaims: t, user: o } = de();
885
- return Be({
958
+ const tn = (e) => {
959
+ const { getIdTokenClaims: t, user: o } = ue();
960
+ return Ke({
886
961
  queryKey: ["availableDomains", o == null ? void 0 : o.sub],
887
- queryFn: () => N(null, null, function* () {
888
- const n = yield t();
889
- if (!n) return [];
890
- const r = n["https://greens.org.au/roles"];
891
- return r ? ao(r, e) : [];
962
+ queryFn: () => L(null, null, function* () {
963
+ const i = yield t();
964
+ if (!i) return [];
965
+ const r = i["https://greens.org.au/roles"];
966
+ return r ? xo(r, e) : [];
892
967
  })
893
968
  });
894
- }, Wo = (e) => Object.values(e).reduce(
969
+ }, on = (e) => Object.values(e).reduce(
895
970
  (t, o) => [.../* @__PURE__ */ new Set([...t, ...o])],
896
971
  []
897
- ), j = {
972
+ ), ee = {
898
973
  log: console.warn.bind(console),
899
974
  error: console.error.bind(console),
900
975
  warn: console.warn.bind(console),
901
976
  info: console.info.bind(console),
902
977
  debug: console.debug.bind(console)
903
978
  };
904
- function Go(e, t) {
979
+ function nn(e, t) {
905
980
  console[e] = (...o) => {
906
- for (const n of t)
907
- if (typeof n == "function") {
908
- if (n(...o)) return;
909
- } else if (n instanceof RegExp && o.length > 0) {
981
+ for (const i of t)
982
+ if (typeof i == "function") {
983
+ if (i(...o)) return;
984
+ } else if (i instanceof RegExp && o.length > 0) {
910
985
  for (const r of o)
911
- if (typeof r == "string" && n.test(r))
986
+ if (typeof r == "string" && i.test(r))
912
987
  return;
913
988
  }
914
- j[e](o);
989
+ ee[e](o);
915
990
  };
916
991
  }
917
- function Vo(e) {
992
+ function rn(e) {
918
993
  if (e)
919
- console[e] = j[e];
994
+ console[e] = ee[e];
920
995
  else
921
- for (const t of Object.keys(j))
922
- console[t] = j[t];
996
+ for (const t of Object.keys(ee))
997
+ console[t] = ee[t];
923
998
  }
924
- function so(e, t) {
999
+ function Ao(e, t) {
925
1000
  return e != null && typeof e == "object" && "error" in e && e.error === t;
926
1001
  }
927
- function Ko(e, t) {
1002
+ function an(e, t) {
928
1003
  const o = t == null ? void 0 : t.originalException;
929
- return so(o, "login_required") ? null : e;
1004
+ return Ao(o, "login_required") ? null : e;
930
1005
  }
931
- function lo(e) {
1006
+ function Co(e) {
932
1007
  let t = 0;
933
- for (let o = 0, n = e.length; o < n; o++) {
1008
+ for (let o = 0, i = e.length; o < i; o++) {
934
1009
  const r = e.charCodeAt(o);
935
1010
  t = (t << 5) - t + r, t |= 0;
936
1011
  }
937
1012
  return t;
938
1013
  }
939
- const Pe = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Te = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
940
- function co({ user: e, domainCode: t, open: o, useNewAvatar: n = !1 }) {
1014
+ const $e = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Me = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
1015
+ function So({ user: e, domainCode: t, open: o, useNewAvatar: i = !1 }) {
941
1016
  const r = oe();
942
- return /* @__PURE__ */ m(
943
- P,
1017
+ return /* @__PURE__ */ f(
1018
+ T,
944
1019
  {
945
1020
  sx: {
946
1021
  paddingTop: 3,
@@ -950,126 +1025,128 @@ function co({ user: e, domainCode: t, open: o, useNewAvatar: n = !1 }) {
950
1025
  gap: "0.5rem"
951
1026
  },
952
1027
  children: [
953
- !n && /* @__PURE__ */ i(
954
- P,
1028
+ !i && /* @__PURE__ */ n(
1029
+ T,
955
1030
  {
956
1031
  sx: {
957
1032
  width: o ? "5rem" : "2rem",
958
- transition: o ? z(r, ["width", "height"], "entering") : z(r, ["width", "height"], "leaving"),
1033
+ transition: o ? V(r, ["width", "height"], "entering") : V(r, ["width", "height"], "leaving"),
959
1034
  aspectRatio: 1
960
1035
  },
961
- children: e != null && e.name ? /* @__PURE__ */ i(M, { children: /* @__PURE__ */ i(
962
- Ae,
1036
+ children: e != null && e.name ? /* @__PURE__ */ n($, { children: /* @__PURE__ */ n(
1037
+ ve,
963
1038
  {
964
1039
  src: e == null ? void 0 : e.picture,
965
1040
  sx: {
966
1041
  width: "100%",
967
1042
  height: "100%",
968
- bgcolor: Pe[Math.abs(lo(e == null ? void 0 : e.name)) % Pe.length]
1043
+ bgcolor: $e[Math.abs(Co(e == null ? void 0 : e.name)) % $e.length]
969
1044
  },
970
- children: Te(e == null ? void 0 : e.name)
1045
+ children: Me(e == null ? void 0 : e.name)
971
1046
  }
972
- ) }) : /* @__PURE__ */ i(Ae, { sx: { width: "100%", height: "100%" } })
1047
+ ) }) : /* @__PURE__ */ n(ve, { sx: { width: "100%", height: "100%" } })
973
1048
  }
974
1049
  ),
975
- n && /* @__PURE__ */ i(
976
- P,
1050
+ i && /* @__PURE__ */ n(
1051
+ T,
977
1052
  {
978
1053
  sx: {
979
1054
  width: o ? "5rem" : "2rem",
980
- transition: o ? z(r, ["width", "height"], "entering") : z(r, ["width", "height"], "leaving"),
1055
+ transition: o ? V(r, ["width", "height"], "entering") : V(r, ["width", "height"], "leaving"),
981
1056
  aspectRatio: 1
982
1057
  },
983
- children: e != null && e.name ? /* @__PURE__ */ i(M, { children: /* @__PURE__ */ m(De, { src: e == null ? void 0 : e.picture, name: e == null ? void 0 : e.name, round: !0, size: o ? "80" : "32", children: [
1058
+ children: e != null && e.name ? /* @__PURE__ */ n($, { children: /* @__PURE__ */ f(Ee, { src: e == null ? void 0 : e.picture, name: e == null ? void 0 : e.name, round: !0, size: o ? "80" : "32", children: [
984
1059
  " ",
985
- Te(e == null ? void 0 : e.name),
1060
+ Me(e == null ? void 0 : e.name),
986
1061
  " ",
987
1062
  "ab"
988
- ] }) }) : /* @__PURE__ */ i(De, {})
1063
+ ] }) }) : /* @__PURE__ */ n(Ee, {})
989
1064
  }
990
1065
  ),
991
- /* @__PURE__ */ i(io, { sx: { width: "100%" }, in: o, children: /* @__PURE__ */ i(xt, { in: o, children: /* @__PURE__ */ m(P, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
992
- e != null && e.name ? /* @__PURE__ */ i(I, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ i(Ce, { animation: !1, width: "50%" }),
993
- t ? /* @__PURE__ */ i(I, { children: Qe(t) }) : /* @__PURE__ */ i(Ce, { animation: !1, width: "25%" })
1066
+ /* @__PURE__ */ n(mo, { sx: { width: "100%" }, in: o, children: /* @__PURE__ */ n(Ge, { in: o, children: /* @__PURE__ */ f(T, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
1067
+ e != null && e.name ? /* @__PURE__ */ n(I, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ n(we, { animation: !1, width: "50%" }),
1068
+ t ? /* @__PURE__ */ n(I, { children: nt(t) }) : /* @__PURE__ */ n(we, { animation: !1, width: "25%" })
994
1069
  ] }) }) })
995
1070
  ]
996
1071
  }
997
1072
  );
998
1073
  }
999
- function uo({
1074
+ function vo({
1000
1075
  open: e,
1001
1076
  widthClosed: t,
1002
1077
  widthOpen: o,
1003
- "data-testid": n,
1078
+ "data-testid": i,
1004
1079
  top: r,
1005
1080
  middle: s,
1006
1081
  bottom: u,
1007
1082
  user: a,
1008
- domainCode: l,
1009
- useNewAvatar: c = !1
1083
+ domainCode: c,
1084
+ useNewAvatar: l = !1
1010
1085
  }) {
1011
- const x = Je(), A = He(ee);
1012
- return /* @__PURE__ */ i(no, { className: Y.root, "data-testid": n, children: /* @__PURE__ */ m(
1013
- ro,
1086
+ const g = pe(), x = Xe(Q);
1087
+ return /* @__PURE__ */ n(fo, { className: Y.root, "data-testid": i, children: /* @__PURE__ */ f(
1088
+ go,
1014
1089
  {
1015
1090
  open: e,
1016
1091
  widthOpen: o,
1017
1092
  widthClosed: t,
1018
1093
  anchor: "left",
1019
- variant: x ? "temporary" : "permanent",
1094
+ variant: g ? "temporary" : "permanent",
1020
1095
  PaperProps: {
1021
1096
  component: "nav"
1022
1097
  },
1023
1098
  onClose: () => {
1024
- A(!1);
1099
+ x(!1);
1025
1100
  },
1026
- isSmallScreen: x,
1101
+ isSmallScreen: g,
1027
1102
  children: [
1028
- !x && /* @__PURE__ */ i(At, {}),
1029
- r && /* @__PURE__ */ m(P, { flexGrow: "0", children: [
1103
+ !g && /* @__PURE__ */ n(kt, {}),
1104
+ r && /* @__PURE__ */ f(T, { flexGrow: "0", children: [
1030
1105
  r,
1031
- /* @__PURE__ */ i(Se, { variant: "middle", sx: { marginY: "0.5rem" } })
1106
+ /* @__PURE__ */ n(ye, { variant: "middle", sx: { marginY: "0.5rem" } })
1032
1107
  ] }),
1033
- /* @__PURE__ */ i(P, { flexGrow: "1", children: Array.isArray(s) ? /* @__PURE__ */ i(oo, { links: s }) : s }),
1034
- /* @__PURE__ */ m(P, { flexGrow: "0", children: [
1035
- /* @__PURE__ */ i(Se, { variant: "middle", sx: { marginY: "0.5rem" } }),
1036
- /* @__PURE__ */ i(co, { user: a, domainCode: l, open: e, useNewAvatar: c }),
1037
- u && /* @__PURE__ */ i(M, { children: u })
1108
+ /* @__PURE__ */ n(T, { flexGrow: "1", children: Array.isArray(s) ? /* @__PURE__ */ n(ho, { links: s }) : s }),
1109
+ /* @__PURE__ */ f(T, { flexGrow: "0", children: [
1110
+ /* @__PURE__ */ n(ye, { variant: "middle", sx: { marginY: "0.5rem" } }),
1111
+ /* @__PURE__ */ n(So, { user: a, domainCode: c, open: e, useNewAvatar: l }),
1112
+ u && /* @__PURE__ */ n($, { children: u })
1038
1113
  ] })
1039
1114
  ]
1040
1115
  }
1041
1116
  ) });
1042
1117
  }
1043
- function po({
1118
+ function wo({
1044
1119
  children: e,
1045
1120
  topBarHeight: t,
1046
1121
  maxWidth: o = !1,
1047
- noPadding: n
1122
+ noPadding: i
1048
1123
  }) {
1049
- return /* @__PURE__ */ i(
1050
- P,
1124
+ return /* @__PURE__ */ n(
1125
+ T,
1051
1126
  {
1127
+ tabIndex: 0,
1052
1128
  sx: {
1053
1129
  overflow: "auto",
1054
1130
  height: `calc(100vh - ${t}px)`,
1055
1131
  flexGrow: 1
1056
1132
  },
1057
- children: n ? /* @__PURE__ */ i(P, { height: "inherit", children: e }) : /* @__PURE__ */ i(Ct, { maxWidth: o, sx: { paddingTop: 3, paddingBottom: 3, flexGrow: 1 }, children: e })
1133
+ children: i ? /* @__PURE__ */ n(T, { height: "inherit", children: e }) : /* @__PURE__ */ n(Dt, { maxWidth: o, sx: { paddingTop: 3, paddingBottom: 3, flexGrow: 1 }, children: e })
1058
1134
  }
1059
1135
  );
1060
1136
  }
1061
- const ho = "TopBar", fo = {
1062
- titleText: `${ho}-titleText`
1137
+ const yo = "TopBar", ko = {
1138
+ titleText: `${yo}-titleText`
1063
1139
  };
1064
- function mo({
1140
+ function Do({
1065
1141
  titleText: e = "",
1066
1142
  height: t,
1067
1143
  "data-testid": o,
1068
- middle: n
1144
+ middle: i,
1145
+ menuButtonAriaLabel: r = "Open navigation menu"
1069
1146
  }) {
1070
- const r = He(ee), s = () => r((l) => !l), u = oe(), a = Je();
1071
- return /* @__PURE__ */ i("header", { "data-testid": o, children: /* @__PURE__ */ m(
1072
- $e,
1147
+ const s = Xe(Q), u = () => s((l) => !l), a = oe(), c = pe();
1148
+ return /* @__PURE__ */ n("header", { "data-testid": o, children: /* @__PURE__ */ f(
1149
+ Be,
1073
1150
  {
1074
1151
  square: !0,
1075
1152
  elevation: 0,
@@ -1083,85 +1160,88 @@ function mo({
1083
1160
  gap: 2,
1084
1161
  flexShrink: 0,
1085
1162
  height: t,
1086
- zIndex: a ? 0 : u.zIndex.drawer + 99
1163
+ zIndex: c ? 0 : a.zIndex.drawer + 99
1087
1164
  },
1088
1165
  children: [
1089
- /* @__PURE__ */ i(
1090
- St,
1166
+ /* @__PURE__ */ n(
1167
+ bt,
1091
1168
  {
1092
1169
  size: "medium",
1093
1170
  color: "inherit",
1094
1171
  sx: { padding: 1.5, marginLeft: "12px" },
1095
- onClick: s,
1096
- children: /* @__PURE__ */ i(Dt, { fontSize: "medium" })
1172
+ onClick: u,
1173
+ "aria-label": r,
1174
+ children: /* @__PURE__ */ n(Tt, { fontSize: "medium" })
1097
1175
  }
1098
1176
  ),
1099
- /* @__PURE__ */ i(I, { className: fo.titleText, variant: "h6", component: "h1", children: e }),
1100
- n
1177
+ /* @__PURE__ */ n(I, { className: ko.titleText, variant: "h6", component: "h1", children: e }),
1178
+ i
1101
1179
  ]
1102
1180
  }
1103
1181
  ) });
1104
1182
  }
1105
- function Xo({
1183
+ function sn({
1106
1184
  children: e,
1107
1185
  initialTitleText: t,
1108
1186
  initialNavBarOpen: o,
1109
- pageContainerProps: n,
1187
+ pageContainerProps: i,
1110
1188
  pageContentDataTestId: r,
1111
1189
  topBarDataTestId: s,
1112
- navBarDataTestId: u,
1113
- navBarMiddle: a,
1190
+ menuButtonAriaLabel: u,
1191
+ navBarDataTestId: a,
1192
+ navBarMiddle: c,
1114
1193
  navBarBottom: l,
1115
- user: c,
1194
+ user: g,
1116
1195
  domainCode: x,
1117
- useNewAvatar: A = !1
1196
+ useNewAvatar: v = !1
1118
1197
  }) {
1119
- It([
1120
- [ee, o != null ? o : !0],
1121
- [Ee, t != null ? t : ""]
1198
+ Rt([
1199
+ [Q, o != null ? o : !0],
1200
+ [Fe, t != null ? t : ""]
1122
1201
  ]);
1123
- const D = ve(ee), [g] = q(Jt), [S] = q(Zt), y = ve(Ee), [h] = q(eo), [k] = q(jt), [F] = q(to);
1124
- return /* @__PURE__ */ m(we, { children: [
1125
- /* @__PURE__ */ i(_t, {}),
1126
- /* @__PURE__ */ i(
1127
- mo,
1202
+ const m = ke(Q), [C] = U(Yt), [S] = U(Qt), h = ke(Fe), [w] = U(Zt), [E] = U(Jt), [_] = U(jt);
1203
+ return /* @__PURE__ */ f(be, { children: [
1204
+ /* @__PURE__ */ n(Bt, {}),
1205
+ /* @__PURE__ */ n(
1206
+ Do,
1128
1207
  {
1129
- titleText: y,
1208
+ titleText: h,
1130
1209
  "data-testid": s,
1131
- height: h,
1132
- middle: k
1210
+ height: w,
1211
+ middle: E,
1212
+ menuButtonAriaLabel: u
1133
1213
  }
1134
1214
  ),
1135
- /* @__PURE__ */ m(we, { sx: { display: "flex" }, children: [
1136
- /* @__PURE__ */ i(
1137
- uo,
1215
+ /* @__PURE__ */ f(be, { sx: { display: "flex" }, children: [
1216
+ /* @__PURE__ */ n(
1217
+ vo,
1138
1218
  {
1139
- open: D,
1140
- top: F,
1141
- middle: a,
1219
+ open: m,
1220
+ top: _,
1221
+ middle: c,
1142
1222
  bottom: l,
1143
- user: c,
1223
+ user: g,
1144
1224
  domainCode: x,
1145
- widthOpen: g,
1225
+ widthOpen: C,
1146
1226
  widthClosed: S,
1147
- offsetTop: h,
1148
- "data-testid": u,
1149
- useNewAvatar: A
1227
+ offsetTop: w,
1228
+ "data-testid": a,
1229
+ useNewAvatar: v
1150
1230
  }
1151
1231
  ),
1152
- /* @__PURE__ */ i(
1153
- po,
1154
- b(d({
1232
+ /* @__PURE__ */ n(
1233
+ wo,
1234
+ F(d({
1155
1235
  "data-testid": r,
1156
- topBarHeight: h
1157
- }, n), {
1236
+ topBarHeight: w
1237
+ }, i), {
1158
1238
  children: e
1159
1239
  })
1160
1240
  )
1161
1241
  ] })
1162
1242
  ] });
1163
1243
  }
1164
- const Yo = ze({
1244
+ const ln = Qe({
1165
1245
  palette: {
1166
1246
  primary: {
1167
1247
  dark: "#00A651",
@@ -1212,7 +1292,7 @@ const Yo = ze({
1212
1292
  navBar: {
1213
1293
  backgroundColor: "#E8E8E8"
1214
1294
  }
1215
- }), Qo = ze({
1295
+ }), cn = Qe({
1216
1296
  palette: {
1217
1297
  primary: {
1218
1298
  main: "#007236",
@@ -1266,18 +1346,18 @@ const Yo = ze({
1266
1346
  styleOverrides: {
1267
1347
  root: ({ theme: e }) => ({
1268
1348
  "&.Mui-selected": {
1269
- backgroundColor: ae(
1349
+ backgroundColor: se(
1270
1350
  e.palette.secondary.main,
1271
1351
  e.palette.action.selectedOpacity
1272
1352
  ),
1273
1353
  "&:hover": {
1274
- backgroundColor: ae(
1354
+ backgroundColor: se(
1275
1355
  e.palette.secondary.main,
1276
1356
  e.palette.action.selectedOpacity
1277
1357
  )
1278
1358
  },
1279
1359
  "&.Mui-focusVisible": {
1280
- backgroundColor: ae(
1360
+ backgroundColor: se(
1281
1361
  e.palette.secondary.main,
1282
1362
  e.palette.action.focusOpacity
1283
1363
  )
@@ -1308,41 +1388,43 @@ const Yo = ze({
1308
1388
  }
1309
1389
  });
1310
1390
  export {
1311
- We as AgDialog,
1312
- Xo as AppLayout,
1313
- Uo as AuthGuard,
1314
- Ke as Context,
1315
- Xe as ContextError,
1316
- Kt as DOMAIN_CODE_LABELS,
1317
- Ho as DomainCodeDialog,
1318
- $o as ExampleComponent,
1319
- Mo as FetchAutocomplete,
1320
- Lo as MUI_AUTOCOMPLETE_VALUE_WARNING_REGEX,
1321
- Wt as SaladBarProvider,
1322
- Ro as SessionExpiryDialog,
1323
- Oo as SingleAutocomplete,
1324
- qo as determineUserLevelFromClaims,
1325
- Vt as domainCodeAtom,
1326
- Yo as fed21Theme,
1327
- Tt as getAuth0Expiry,
1328
- Qe as getDomainOptionLabel,
1329
- ao as getDomainsFromRolesClaim,
1330
- Wo as getValidBusinessRoles,
1331
- Qo as internalAgSystemsTheme,
1332
- ee as navBarOpenAtom,
1333
- to as navBarTopAtom,
1334
- Zt as navBarWidthClosedAtom,
1335
- Jt as navBarWidthOpenAtom,
1336
- Ko as sentryBeforeSend,
1337
- lo as simpleHashCode,
1338
- Go as suppressConsole,
1339
- Ee as titleTextAtom,
1340
- eo as topBarHeightAtom,
1341
- jt as topBarMiddleAtom,
1342
- Vo as unsuppressConsole,
1343
- Ve as useAutocompleteOptions,
1344
- Gt as useSaladBar,
1345
- zo as useValidDomains,
1346
- Bo as withSaladBarProvider
1391
+ Je as AgDialog,
1392
+ sn as AppLayout,
1393
+ Qo as AuthGuard,
1394
+ et as Context,
1395
+ tt as ContextError,
1396
+ po as DOMAIN_CODE_LABELS,
1397
+ jo as DomainCodeDialog,
1398
+ Go as ExampleComponent,
1399
+ Vo as FetchAutocomplete,
1400
+ Ko as MUI_AUTOCOMPLETE_VALUE_WARNING_REGEX,
1401
+ Jo as NavBarLink,
1402
+ eo as NavBarLinkInner,
1403
+ lo as SaladBarProvider,
1404
+ Yo as SessionExpiryDialog,
1405
+ Xo as SingleAutocomplete,
1406
+ en as determineUserLevelFromClaims,
1407
+ uo as domainCodeAtom,
1408
+ ln as fed21Theme,
1409
+ Ht as getAuth0Expiry,
1410
+ nt as getDomainOptionLabel,
1411
+ xo as getDomainsFromRolesClaim,
1412
+ on as getValidBusinessRoles,
1413
+ cn as internalAgSystemsTheme,
1414
+ Q as navBarOpenAtom,
1415
+ jt as navBarTopAtom,
1416
+ Qt as navBarWidthClosedAtom,
1417
+ Yt as navBarWidthOpenAtom,
1418
+ an as sentryBeforeSend,
1419
+ Co as simpleHashCode,
1420
+ nn as suppressConsole,
1421
+ Fe as titleTextAtom,
1422
+ Zt as topBarHeightAtom,
1423
+ Jt as topBarMiddleAtom,
1424
+ rn as unsuppressConsole,
1425
+ je as useAutocompleteOptions,
1426
+ co as useSaladBar,
1427
+ tn as useValidDomains,
1428
+ Zo as withSaladBarProvider
1347
1429
  };
1348
1430
  //# sourceMappingURL=index.js.map