@australiangreens/ag-internal-components 0.0.65 → 0.0.67

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,46 +1,46 @@
1
- var $t = Object.defineProperty, kt = Object.defineProperties;
1
+ var Ot = Object.defineProperty, $t = Object.defineProperties;
2
2
  var It = Object.getOwnPropertyDescriptors;
3
3
  var ee = Object.getOwnPropertySymbols;
4
- var ye = Object.prototype.hasOwnProperty, Be = Object.prototype.propertyIsEnumerable;
5
- var ge = (e, t, n) => t in e ? $t(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, i = (e, t) => {
4
+ var Fe = Object.prototype.hasOwnProperty, ye = Object.prototype.propertyIsEnumerable;
5
+ var ge = (e, t, n) => t in e ? Ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, i = (e, t) => {
6
6
  for (var n in t || (t = {}))
7
- ye.call(t, n) && ge(e, n, t[n]);
7
+ Fe.call(t, n) && ge(e, n, t[n]);
8
8
  if (ee)
9
9
  for (var n of ee(t))
10
- Be.call(t, n) && ge(e, n, t[n]);
10
+ ye.call(t, n) && ge(e, n, t[n]);
11
11
  return e;
12
- }, A = (e, t) => kt(e, It(t));
13
- var Fe = (e, t) => {
12
+ }, S = (e, t) => $t(e, It(t));
13
+ var Pe = (e, t) => {
14
14
  var n = {};
15
15
  for (var r in e)
16
- ye.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
16
+ Fe.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
17
17
  if (e != null && ee)
18
18
  for (var r of ee(e))
19
- t.indexOf(r) < 0 && Be.call(e, r) && (n[r] = e[r]);
19
+ t.indexOf(r) < 0 && ye.call(e, r) && (n[r] = e[r]);
20
20
  return n;
21
21
  };
22
- var Pe = (e, t, n) => (ge(e, typeof t != "symbol" ? t + "" : t, n), n);
23
- var z = (e, t, n) => new Promise((r, s) => {
24
- var c = (p) => {
22
+ var Ne = (e, t, n) => (ge(e, typeof t != "symbol" ? t + "" : t, n), n);
23
+ var N = (e, t, n) => new Promise((r, s) => {
24
+ var l = (p) => {
25
25
  try {
26
- h(n.next(p));
26
+ g(n.next(p));
27
27
  } catch (u) {
28
28
  s(u);
29
29
  }
30
30
  }, d = (p) => {
31
31
  try {
32
- h(n.throw(p));
32
+ g(n.throw(p));
33
33
  } catch (u) {
34
34
  s(u);
35
35
  }
36
- }, h = (p) => p.done ? r(p.value) : Promise.resolve(p.value).then(c, d);
37
- h((n = n.apply(e, t)).next());
36
+ }, g = (p) => p.done ? r(p.value) : Promise.resolve(p.value).then(l, d);
37
+ g((n = n.apply(e, t)).next());
38
38
  });
39
- import { jsxs as f, Fragment as P, jsx as o } from "react/jsx-runtime";
40
- import { useState as $, createContext as Je, useCallback as oe, useContext as Ye, useEffect as re, useMemo as Et, createElement as xe, useRef as fe } from "react";
41
- import { Typography as E, Button as Tt, Paper as Ze, Box as D, Drawer as be, Autocomplete as Ae, TextField as Se, CircularProgress as De, Chip as yt, Tooltip as Bt, Stack as Ft, styled as Oe, IconButton as Q, Container as et, useTheme as ae, useMediaQuery as Pt, Collapse as Nt, Avatar as Ne, Fade as Lt, Skeleton as Le, Toolbar as Mt, Divider as Me, CssBaseline as _t, Snackbar as Ht, Alert as Rt, LinearProgress as Wt, FormHelperText as zt } from "@mui/material";
39
+ import { jsxs as f, Fragment as B, jsx as o } from "react/jsx-runtime";
40
+ import { useState as O, createContext as Je, useCallback as oe, useContext as Ye, useEffect as re, useMemo as Et, createElement as xe, useRef as fe } from "react";
41
+ import { Typography as E, Button as Tt, Paper as Ze, Box as D, Drawer as be, Autocomplete as Ae, TextField as Se, CircularProgress as De, Chip as Ft, Tooltip as yt, Stack as Pt, styled as ke, IconButton as Q, Container as et, useTheme as ae, useMediaQuery as Nt, Collapse as Bt, Avatar as Be, Fade as Lt, Skeleton as Le, Toolbar as Mt, Divider as Me, CssBaseline as _t, Snackbar as Ht, Alert as Rt, LinearProgress as Wt, FormHelperText as zt } from "@mui/material";
42
42
  import Gt from "@mui/material/CssBaseline";
43
- import { styled as N, createTheme as tt, alpha as me } from "@mui/material/styles";
43
+ import { styled as L, createTheme as tt, alpha as me } from "@mui/material/styles";
44
44
  import { AgError as Ut } from "@australiangreens/ag-error";
45
45
  import { createHelper as se } from "souvlaki";
46
46
  import nt from "@mui/material/List";
@@ -52,11 +52,11 @@ import jt from "@mui/material/DialogTitle";
52
52
  import { Cancel as Qt, ArrowDropDown as Kt, ArrowForward as ot, ArrowBack as rt, ViewHeadline as Jt } from "@mui/icons-material";
53
53
  import Yt from "autosuggest-highlight/parse";
54
54
  import Zt from "autosuggest-highlight/match";
55
- import { atom as L, useSetAtom as it, useAtomValue as He, useAtom as X, getDefaultStore as en, Provider as at } from "jotai";
55
+ import { atom as M, useSetAtom as it, useAtomValue as He, useAtom as X, getDefaultStore as en, Provider as at } from "jotai";
56
56
  import { useHydrateAtoms as st } from "jotai/utils";
57
57
  function fo({ text: e }) {
58
- const [t, n] = $(0);
59
- return /* @__PURE__ */ f(P, { children: [
58
+ const [t, n] = O(0);
59
+ return /* @__PURE__ */ f(B, { children: [
60
60
  /* @__PURE__ */ o(E, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
61
61
  /* @__PURE__ */ o(E, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
62
62
  /* @__PURE__ */ o(
@@ -86,7 +86,7 @@ const lt = 330, ct = 73, G = "Navbar", V = {
86
86
  userInfoHolder: `${G}-userInfoHolder`,
87
87
  settings: `${G}-settings`,
88
88
  pieChartIcon: `${G}-pieChartIcon`
89
- }, tn = N(D, {
89
+ }, tn = L(D, {
90
90
  name: "NavBar"
91
91
  })(({ theme: e }) => ({
92
92
  [`&.${V.root}`]: {
@@ -119,7 +119,7 @@ const lt = 330, ct = 73, G = "Navbar", V = {
119
119
  width: lt
120
120
  }, dt()), on = () => i({
121
121
  width: ct
122
- }, dt()), rn = N(be, {
122
+ }, dt()), rn = L(be, {
123
123
  shouldForwardProp: (e) => e !== "open"
124
124
  })(({ theme: e, open: t }) => i(i({
125
125
  width: t ? lt : ct,
@@ -132,34 +132,34 @@ const lt = 330, ct = 73, G = "Navbar", V = {
132
132
  }), !t && {
133
133
  "& .MuiDrawer-paper": on()
134
134
  }));
135
- class $e extends Ut {
135
+ class Oe extends Ut {
136
136
  }
137
- Pe($e, "errorName", "ContextError");
137
+ Ne(Oe, "errorName", "ContextError");
138
138
  const pt = Je(null), an = {}, sn = {}, ln = ({
139
139
  overrideState: e = an,
140
140
  overrideActions: t = sn,
141
141
  children: n
142
142
  }) => {
143
- const [{ open: r }, s] = $({ open: !0 }), c = oe((p) => {
143
+ const [{ open: r }, s] = O({ open: !0 }), l = oe((p) => {
144
144
  s({ open: p });
145
145
  }, []), d = oe(() => {
146
- s((p) => A(i({}, p), { open: !p.open }));
147
- }, []), h = i(i({
146
+ s((p) => S(i({}, p), { open: !p.open }));
147
+ }, []), g = i(i({
148
148
  open: r,
149
- setOpen: c,
149
+ setOpen: l,
150
150
  toggleOpen: d
151
151
  }, e), t);
152
- return /* @__PURE__ */ o(pt.Provider, { value: h, children: n });
152
+ return /* @__PURE__ */ o(pt.Provider, { value: g, children: n });
153
153
  }, cn = () => {
154
154
  const e = Ye(pt);
155
155
  if (e === null)
156
- throw new $e("Error: Tried to useNavBar outside of a <NavBarProvider>");
156
+ throw new Oe("Error: Tried to useNavBar outside of a <NavBarProvider>");
157
157
  return e;
158
158
  }, dn = (e = {}) => i({
159
159
  open: !0
160
160
  }, e), mo = se(
161
161
  (e = dn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(ln, { overrideState: e, overrideActions: t, children: n })
162
- ), Re = 7, Co = N(nt)(({ theme: e }) => ({
162
+ ), Re = 7, Co = L(nt)(({ theme: e }) => ({
163
163
  backgroundColor: "black",
164
164
  color: "white",
165
165
  "& .MuiListItem-root": {
@@ -197,7 +197,7 @@ const pt = Je(null), an = {}, sn = {}, ln = ({
197
197
  // '&.Mui-selected.Mui-focusVisible:hover': {
198
198
  // },
199
199
  }
200
- })), We = 7, vo = N(nt)(({ theme: e }) => ({
200
+ })), We = 7, vo = L(nt)(({ theme: e }) => ({
201
201
  backgroundColor: "#e8e8e8",
202
202
  color: "inherit",
203
203
  "& .MuiListItem-root": {
@@ -261,20 +261,24 @@ const pn = ({
261
261
  children: n,
262
262
  maxWidth: r,
263
263
  primaryButton: s,
264
- secondaryButton: c,
265
- onClose: d
264
+ secondaryButton: l,
265
+ onClose: d,
266
+ sx: g,
267
+ "data-testid": p
266
268
  }) => {
267
- var u, w;
268
- const [h, p] = $(!1);
269
+ var b, A;
270
+ const [u, w] = O(!1);
269
271
  return /* @__PURE__ */ f(
270
272
  Vt,
271
273
  {
272
274
  open: e,
273
- onClose: () => {
274
- h || d();
275
- },
275
+ onClose: () => N(void 0, null, function* () {
276
+ u || (l != null && l.onClick ? yield l.onClick() : d());
277
+ }),
276
278
  fullWidth: !0,
277
279
  maxWidth: r != null ? r : "xs",
280
+ "data-testid": p,
281
+ sx: g,
278
282
  children: [
279
283
  /* @__PURE__ */ o(jt, { children: t }),
280
284
  /* @__PURE__ */ o(Xt, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
@@ -282,22 +286,22 @@ const pn = ({
282
286
  /* @__PURE__ */ o(
283
287
  _e,
284
288
  {
285
- onClick: (u = c == null ? void 0 : c.onClick) != null ? u : d,
286
- "data-testid": c == null ? void 0 : c.testId,
287
- disabled: (c == null ? void 0 : c.disabled) || h,
288
- color: c == null ? void 0 : c.buttonColor,
289
- children: (w = c == null ? void 0 : c.text) != null ? w : "Cancel"
289
+ onClick: (b = l == null ? void 0 : l.onClick) != null ? b : d,
290
+ "data-testid": l == null ? void 0 : l.testId,
291
+ disabled: (l == null ? void 0 : l.disabled) || u,
292
+ color: l == null ? void 0 : l.buttonColor,
293
+ children: (A = l == null ? void 0 : l.text) != null ? A : "Cancel"
290
294
  }
291
295
  ),
292
296
  s && /* @__PURE__ */ o(
293
297
  _e,
294
298
  {
295
- onClick: () => z(void 0, null, function* () {
296
- var b;
297
- p(!0), yield (b = s.onClick) == null ? void 0 : b.call(s), p(!1);
299
+ onClick: () => N(void 0, null, function* () {
300
+ var C;
301
+ w(!0), yield (C = s.onClick) == null ? void 0 : C.call(s), w(!1);
298
302
  }),
299
303
  "data-testid": s.testId,
300
- disabled: s.disabled || h,
304
+ disabled: s.disabled || u,
301
305
  color: s == null ? void 0 : s.buttonColor,
302
306
  children: s.text
303
307
  }
@@ -308,36 +312,36 @@ const pn = ({
308
312
  );
309
313
  };
310
314
  function wo({
311
- lookup: e = () => z(this, null, function* () {
315
+ lookup: e = () => N(this, null, function* () {
312
316
  }),
313
317
  enableHighlighting: t = !0,
314
318
  onChange: n,
315
319
  minLength: r,
316
320
  label: s,
317
- value: c,
321
+ value: l,
318
322
  "data-testid": d,
319
- sx: h,
323
+ sx: g,
320
324
  textFieldColor: p,
321
325
  textFieldVariant: u = "filled",
322
326
  loadingText: w = "Loading...",
323
327
  noOptionsText: b = "No options",
324
- popupIcon: S = /* @__PURE__ */ o(Kt, {}),
325
- error: v = !1,
326
- helperText: O = "",
327
- preLoadedOptions: C = void 0,
328
+ popupIcon: A = /* @__PURE__ */ o(Kt, {}),
329
+ error: C = !1,
330
+ helperText: k = "",
331
+ preLoadedOptions: v = void 0,
328
332
  disablePortal: m = !1
329
333
  }) {
330
- const [g, T] = $(""), [M, y] = $(C || []), [B, k] = $(!1), [_, F] = $(!1), H = (a, l) => {
331
- const x = c.filter((q) => q.id !== l);
334
+ const [h, T] = O(""), [_, F] = O(v || []), [y, $] = O(!1), [H, P] = O(!1), R = (a, c) => {
335
+ const x = l.filter((q) => q.id !== c);
332
336
  n(x, "delete", a);
333
337
  };
334
338
  re(() => {
335
339
  let a;
336
- const l = () => z(this, null, function* () {
340
+ const c = () => N(this, null, function* () {
337
341
  a = new AbortController();
338
342
  try {
339
- const x = yield e(g, a.signal);
340
- y(x != null ? x : []), F(!1);
343
+ const x = yield e(h, a.signal);
344
+ F(x != null ? x : []), P(!1);
341
345
  } catch (x) {
342
346
  if (x instanceof Error && x.name === "AbortError")
343
347
  console.debug("Previous lookup request was cancelled");
@@ -345,74 +349,74 @@ function wo({
345
349
  throw x;
346
350
  }
347
351
  });
348
- if (g !== "")
349
- return (!r || g.length >= r) && !C ? (F(!0), l()) : F(!1), function() {
352
+ if (h !== "")
353
+ return (!r || h.length >= r) && !v ? (P(!0), c()) : P(!1), function() {
350
354
  a && a.abort();
351
355
  };
352
- }, [g, e, r, C]), re(() => {
353
- !B && !C && y([]), !B && C && y(C);
354
- }, [B, C]);
355
- const R = Et(() => C ? (a, l) => a.filter(
356
- (x) => x.label.toLowerCase().includes(l.inputValue.toLowerCase())
357
- ) : (a) => a, [C]);
356
+ }, [h, e, r, v]), re(() => {
357
+ !y && !v && F([]), !y && v && F(v);
358
+ }, [y, v]);
359
+ const W = Et(() => v ? (a, c) => a.filter(
360
+ (x) => x.label.toLowerCase().includes(c.inputValue.toLowerCase())
361
+ ) : (a) => a, [v]);
358
362
  return /* @__PURE__ */ f("div", { "data-testid": d, children: [
359
363
  /* @__PURE__ */ o(
360
364
  Ae,
361
365
  {
362
- sx: h,
366
+ sx: g,
363
367
  "data-testid": d ? `${d}:Autocomplete` : void 0,
364
368
  disablePortal: m,
365
369
  multiple: !0,
366
370
  getOptionLabel: (a) => typeof a == "string" ? a : a.label,
367
- filterOptions: R,
368
- loading: _,
369
- options: [...c, ...M],
371
+ filterOptions: W,
372
+ loading: H,
373
+ options: [...l, ..._],
370
374
  filterSelectedOptions: !0,
371
375
  includeInputInList: !0,
372
- value: c,
373
- onOpen: () => k(!0),
374
- onClose: () => k(!1),
375
- onChange: (a, l, x) => {
376
- n(l, x, a);
376
+ value: l,
377
+ onOpen: () => $(!0),
378
+ onClose: () => $(!1),
379
+ onChange: (a, c, x) => {
380
+ n(c, x, a);
377
381
  },
378
- onInputChange: (a, l) => T(l),
382
+ onInputChange: (a, c) => T(c),
379
383
  noOptionsText: b,
380
384
  loadingText: w,
381
- popupIcon: S,
385
+ popupIcon: A,
382
386
  renderInput: (a) => /* @__PURE__ */ o(
383
387
  Se,
384
- A(i({}, a), {
388
+ S(i({}, a), {
385
389
  label: s,
386
390
  fullWidth: !0,
387
391
  variant: u,
388
- error: v,
389
- helperText: O,
390
- InputProps: A(i({}, a.InputProps), {
391
- endAdornment: /* @__PURE__ */ f(P, { children: [
392
- _ ? /* @__PURE__ */ o(De, { color: "inherit", size: 20 }) : null,
392
+ error: C,
393
+ helperText: k,
394
+ InputProps: S(i({}, a.InputProps), {
395
+ endAdornment: /* @__PURE__ */ f(B, { children: [
396
+ H ? /* @__PURE__ */ o(De, { color: "inherit", size: 20 }) : null,
393
397
  a.InputProps.endAdornment
394
398
  ] })
395
399
  }),
396
400
  "data-testid": d ? `${d}:Autocomplete:TextField` : void 0,
397
- onKeyDown: (l) => {
398
- (l.key === "Backspace" || l.key === "Delete") && l.stopPropagation();
401
+ onKeyDown: (c) => {
402
+ (c.key === "Backspace" || c.key === "Delete") && c.stopPropagation();
399
403
  },
400
404
  color: p
401
405
  })
402
406
  ),
403
407
  renderTags: () => null,
404
- isOptionEqualToValue: (a, l) => a.id === l.id,
405
- renderOption: (a, l, x) => {
408
+ isOptionEqualToValue: (a, c) => a.id === c.id,
409
+ renderOption: (a, c, x) => {
406
410
  if (t) {
407
- const q = Zt(l.label, x.inputValue, {
411
+ const q = Zt(c.label, x.inputValue, {
408
412
  insideWords: !0,
409
413
  findAllOccurrences: !0
410
- }), le = Yt(l.label, q);
414
+ }), le = Yt(c.label, q);
411
415
  return /* @__PURE__ */ xe(
412
416
  "li",
413
- A(i({}, a), {
414
- key: l.id,
415
- "data-testid": d ? `${d}:Autocomplete:option(${l.id.toString()})` : void 0
417
+ S(i({}, a), {
418
+ key: c.id,
419
+ "data-testid": d ? `${d}:Autocomplete:option(${c.id.toString()})` : void 0
416
420
  }),
417
421
  /* @__PURE__ */ o("div", { children: le.map((J, ce) => /* @__PURE__ */ o(
418
422
  "span",
@@ -428,17 +432,17 @@ function wo({
428
432
  } else
429
433
  return /* @__PURE__ */ xe(
430
434
  "li",
431
- A(i({}, a), {
432
- key: l.id,
433
- "data-testid": d ? `${d}:option(${l.id.toString()})` : void 0
435
+ S(i({}, a), {
436
+ key: c.id,
437
+ "data-testid": d ? `${d}:option(${c.id.toString()})` : void 0
434
438
  }),
435
- l.label
439
+ c.label
436
440
  );
437
441
  }
438
442
  }
439
443
  ),
440
- c.length > 0 && /* @__PURE__ */ o(D, { children: c.map((a) => /* @__PURE__ */ o(
441
- yt,
444
+ l.length > 0 && /* @__PURE__ */ o(D, { children: l.map((a) => /* @__PURE__ */ o(
445
+ Ft,
442
446
  {
443
447
  sx: {
444
448
  marginTop: 1,
@@ -446,7 +450,7 @@ function wo({
446
450
  height: "auto"
447
451
  },
448
452
  label: /* @__PURE__ */ o(
449
- Bt,
453
+ yt,
450
454
  {
451
455
  title: a.tooltipContent || "",
452
456
  placement: "bottom-start",
@@ -464,7 +468,7 @@ function wo({
464
468
  }
465
469
  ),
466
470
  "data-testid": d ? `${d}:Chip(${a.id.toString()})` : void 0,
467
- onDelete: (l) => H(l, a.id),
471
+ onDelete: (c) => R(c, a.id),
468
472
  deleteIcon: /* @__PURE__ */ o(
469
473
  Qt,
470
474
  {
@@ -482,35 +486,35 @@ const bo = ({
482
486
  label: n,
483
487
  value: r,
484
488
  sx: s,
485
- textFieldColor: c,
489
+ textFieldColor: l,
486
490
  textFieldVariant: d = "filled",
487
- "data-testid": h,
491
+ "data-testid": g,
488
492
  minLength: p = 3,
489
493
  disablePortal: u = !1
490
494
  }) => {
491
- const [w, b] = $([]), [S, v] = $(!1);
492
- let O;
493
- const C = (m) => z(void 0, null, function* () {
494
- O = new AbortController();
495
+ const [w, b] = O([]), [A, C] = O(!1);
496
+ let k;
497
+ const v = (m) => N(void 0, null, function* () {
498
+ k = new AbortController();
495
499
  try {
496
- const g = yield e(m, O.signal);
497
- b(g != null ? g : []), v(!1);
498
- } catch (g) {
499
- if (g instanceof Error && g.name === "AbortError")
500
+ const h = yield e(m, k.signal);
501
+ b(h != null ? h : []), C(!1);
502
+ } catch (h) {
503
+ if (h instanceof Error && h.name === "AbortError")
500
504
  console.debug("Previous lookup request was cancelled");
501
505
  else
502
- throw g;
506
+ throw h;
503
507
  }
504
508
  });
505
- return /* @__PURE__ */ o("div", { "data-testid": h, children: /* @__PURE__ */ o(Ft, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
509
+ return /* @__PURE__ */ o("div", { "data-testid": g, children: /* @__PURE__ */ o(Pt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
506
510
  Ae,
507
511
  {
508
512
  sx: s,
509
- "data-testid": h ? `${h}:Autocomplete` : void 0,
510
- loading: S,
513
+ "data-testid": g ? `${g}:Autocomplete` : void 0,
514
+ loading: A,
511
515
  options: w,
512
- onChange: (m, g) => {
513
- t(m, g);
516
+ onChange: (m, h) => {
517
+ t(m, h);
514
518
  },
515
519
  disablePortal: u,
516
520
  filterOptions: (m) => m,
@@ -518,25 +522,25 @@ const bo = ({
518
522
  getOptionLabel: (m) => m.label,
519
523
  renderInput: (m) => /* @__PURE__ */ o(
520
524
  Se,
521
- A(i({
522
- "data-testid": h ? `${h}:Autocomplete:TextField` : void 0
525
+ S(i({
526
+ "data-testid": g ? `${g}:Autocomplete:TextField` : void 0
523
527
  }, m), {
524
528
  variant: d,
525
529
  label: n,
526
- color: c
530
+ color: l
527
531
  })
528
532
  ),
529
- isOptionEqualToValue: (m, g) => m.id === g.id,
530
- onInputChange: (m, g) => {
531
- (g == null ? void 0 : g.length) >= p && (v(!0), C(g));
533
+ isOptionEqualToValue: (m, h) => m.id === h.id,
534
+ onInputChange: (m, h) => {
535
+ (h == null ? void 0 : h.length) >= p && (C(!0), v(h));
532
536
  },
533
- renderOption: (m, g) => /* @__PURE__ */ xe(
537
+ renderOption: (m, h) => /* @__PURE__ */ xe(
534
538
  "li",
535
- A(i({}, m), {
536
- key: g.id,
537
- "data-testid": h ? `${h}:Autocomplete:option(${g.id.toString()})` : void 0
539
+ S(i({}, m), {
540
+ key: h.id,
541
+ "data-testid": g ? `${g}:Autocomplete:option(${h.id.toString()})` : void 0
538
542
  }),
539
- g.label
543
+ h.label
540
544
  )
541
545
  }
542
546
  ) }) });
@@ -547,7 +551,7 @@ const bo = ({
547
551
  titleText: `${U}-titleText`,
548
552
  leftPanelButton: `${U}-leftPanelButton`,
549
553
  rightPanelButton: `${U}-leftPanelButton`
550
- }, gn = Oe("div", {
554
+ }, gn = ke("div", {
551
555
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
552
556
  name: U
553
557
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
@@ -642,7 +646,7 @@ function fn({
642
646
  ] }) })
643
647
  ] });
644
648
  }
645
- const ut = 400, mn = Oe(be, {
649
+ const ut = 400, mn = ke(be, {
646
650
  shouldForwardProp: (e) => (
647
651
  // Note we do want anchor to be forwarded to the Drawer component
648
652
  ![
@@ -656,7 +660,7 @@ const ut = 400, mn = Oe(be, {
656
660
  ),
657
661
  name: "SidePanelDrawer"
658
662
  })(
659
- ({ width: e, debugOpacity: t = !1, anchor: n, navBarOpen: r, navBarWidthOpen: s, navBarWidthClosed: c }) => ({
663
+ ({ width: e, debugOpacity: t = !1, anchor: n, navBarOpen: r, navBarWidthOpen: s, navBarWidthClosed: l }) => ({
660
664
  width: e,
661
665
  "& .MuiDrawer-paper": i(i({
662
666
  position: "absolute",
@@ -667,14 +671,14 @@ const ut = 400, mn = Oe(be, {
667
671
  }, t && {
668
672
  opacity: "50%"
669
673
  }), n === "left" && i({
670
- marginLeft: `${c}px`
674
+ marginLeft: `${l}px`
671
675
  }, r && {
672
676
  marginLeft: `${s}px`
673
677
  }))
674
678
  })
675
- ), Cn = Oe(D, {
679
+ ), Cn = ke(D, {
676
680
  shouldForwardProp: (e) => !["anchor"].includes(e)
677
- })(({ theme: e, anchor: t }) => A(i({
681
+ })(({ theme: e, anchor: t }) => S(i({
678
682
  display: "flex",
679
683
  alignItems: "center",
680
684
  padding: e.spacing(2)
@@ -699,16 +703,16 @@ function ze({
699
703
  onClose: r = () => {
700
704
  },
701
705
  titleText: s = "",
702
- width: c = ut,
706
+ width: l = ut,
703
707
  showCloseArrow: d = !0,
704
- debugOpacity: h = !1,
708
+ debugOpacity: g = !1,
705
709
  headerBoxProps: p = {},
706
710
  onOpened: u,
707
711
  onClosed: w,
708
712
  "data-testid": b,
709
- navBarOpen: S = !1,
710
- navBarWidthOpen: v = 0,
711
- navBarWidthClosed: O = 0
713
+ navBarOpen: A = !1,
714
+ navBarWidthOpen: C = 0,
715
+ navBarWidthClosed: k = 0
712
716
  }) {
713
717
  return /* @__PURE__ */ f(
714
718
  mn,
@@ -720,20 +724,20 @@ function ze({
720
724
  variant: "persistent",
721
725
  anchor: t,
722
726
  open: n,
723
- width: c,
724
- debugOpacity: h,
727
+ width: l,
728
+ debugOpacity: g,
725
729
  "data-testid": b,
726
- navBarOpen: S,
727
- navBarWidthOpen: v,
728
- navBarWidthClosed: O,
730
+ navBarOpen: A,
731
+ navBarWidthOpen: C,
732
+ navBarWidthClosed: k,
729
733
  children: [
730
- /* @__PURE__ */ o(Cn, A(i({ anchor: t }, p), { children: t === "left" ? /* @__PURE__ */ f(P, { children: [
734
+ /* @__PURE__ */ o(Cn, S(i({ anchor: t }, p), { children: t === "left" ? /* @__PURE__ */ f(B, { children: [
731
735
  /* @__PURE__ */ o(E, { variant: "h6", color: "inherit", component: "div", children: s }),
732
736
  d && /* @__PURE__ */ f(Q, { onClick: r, size: "large", "aria-label": "Close left side panel", children: [
733
737
  /* @__PURE__ */ o(rt, { "data-testid": "arrowbackicon" }),
734
738
  " "
735
739
  ] })
736
- ] }) : /* @__PURE__ */ f(P, { children: [
740
+ ] }) : /* @__PURE__ */ f(B, { children: [
737
741
  d && /* @__PURE__ */ f(Q, { onClick: r, size: "large", "aria-label": "Close right side panel", children: [
738
742
  /* @__PURE__ */ o(ot, {}),
739
743
  " "
@@ -745,7 +749,7 @@ function ze({
745
749
  }
746
750
  );
747
751
  }
748
- const vn = N(D, {
752
+ const vn = L(D, {
749
753
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
750
754
  name: "PanelAwareMargins"
751
755
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
@@ -768,7 +772,7 @@ const vn = N(D, {
768
772
  }),
769
773
  marginRight: `${(s = n == null ? void 0 : n.width) != null ? s : 0}px`
770
774
  });
771
- }), xn = N(et, {
775
+ }), xn = L(et, {
772
776
  name: "PageContainer"
773
777
  })(({ theme: e }) => ({
774
778
  // Horizontal padding comes from the Container's gutter
@@ -783,7 +787,7 @@ const vn = N(D, {
783
787
  startOpen: !1,
784
788
  open: void 0,
785
789
  onChangeOpen: void 0,
786
- content: /* @__PURE__ */ o(P, {}),
790
+ content: /* @__PURE__ */ o(B, {}),
787
791
  onOpened: void 0,
788
792
  onClosed: void 0,
789
793
  dataTestId: void 0
@@ -794,22 +798,22 @@ function Ao({
794
798
  leftPanel: n,
795
799
  rightPanel: r,
796
800
  sidePanelsAreMutuallyExclusive: s = !0,
797
- debugOpacity: c = !1,
801
+ debugOpacity: l = !1,
798
802
  pageContainerProps: d,
799
- pageContentDataTestId: h,
803
+ pageContentDataTestId: g,
800
804
  topBarDataTestId: p,
801
805
  navBarOpen: u,
802
806
  navBarWidthOpen: w,
803
807
  navBarWidthClosed: b
804
808
  }) {
805
- const [S, v] = $(Ce), [O, C] = $(ve), [m, g] = $(Ce), [T, M] = $(ve), y = n !== void 0, B = r !== void 0, {
806
- titleText: k,
807
- content: _,
808
- flavour: F,
809
- open: H,
810
- onChangeOpen: R,
809
+ const [A, C] = O(Ce), [k, v] = O(ve), [m, h] = O(Ce), [T, _] = O(ve), F = n !== void 0, y = r !== void 0, {
810
+ titleText: $,
811
+ content: H,
812
+ flavour: P,
813
+ open: R,
814
+ onChangeOpen: W,
811
815
  width: a,
812
- arrowButtons: l,
816
+ arrowButtons: c,
813
817
  startOpen: x,
814
818
  onOpened: q,
815
819
  onClosed: le,
@@ -817,7 +821,7 @@ function Ao({
817
821
  } = n ? i(i({}, te), n) : i({}, te), {
818
822
  titleText: ce,
819
823
  content: At,
820
- flavour: ke,
824
+ flavour: $e,
821
825
  open: de,
822
826
  onChangeOpen: Ie,
823
827
  width: pe,
@@ -825,20 +829,20 @@ function Ao({
825
829
  startOpen: Z,
826
830
  onOpened: St,
827
831
  onClosed: Dt,
828
- dataTestId: Ot
832
+ dataTestId: kt
829
833
  } = r ? i(i({}, te), r) : i({}, te);
830
834
  re(() => {
831
- x !== Ce && (v(x), g(x));
835
+ x !== Ce && (C(x), h(x));
832
836
  }, [x]), re(() => {
833
- Z !== ve && (C(Z), M(Z));
837
+ Z !== ve && (v(Z), _(Z));
834
838
  }, [Z]);
835
- const ue = H === void 0 ? S : H, he = de === void 0 ? O : de, Ee = (W) => {
836
- H === void 0 && (v(W), s && B && (W ? (C(!1), M(O)) : C(T))), R && R(W);
837
- }, Te = (W) => {
838
- de === void 0 && (C(W), s && y && (W ? (v(!1), g(S)) : v(m))), Ie && Ie(W);
839
+ const ue = R === void 0 ? A : R, he = de === void 0 ? k : de, Ee = (z) => {
840
+ R === void 0 && (C(z), s && y && (z ? (v(!1), _(k)) : v(T))), W && W(z);
841
+ }, Te = (z) => {
842
+ de === void 0 && (v(z), s && F && (z ? (C(!1), h(A)) : C(m))), Ie && Ie(z);
839
843
  };
840
844
  return /* @__PURE__ */ f(D, { children: [
841
- y && /* @__PURE__ */ o(
845
+ F && /* @__PURE__ */ o(
842
846
  ze,
843
847
  {
844
848
  "data-testid": J,
@@ -846,27 +850,27 @@ function Ao({
846
850
  open: ue,
847
851
  onClose: () => Ee(!1),
848
852
  width: a,
849
- titleText: k,
850
- debugOpacity: c,
851
- showCloseArrow: l === "both" || l === "close",
853
+ titleText: $,
854
+ debugOpacity: l,
855
+ showCloseArrow: c === "both" || c === "close",
852
856
  onOpened: q,
853
857
  onClosed: le,
854
858
  navBarOpen: u,
855
859
  navBarWidthOpen: w,
856
860
  navBarWidthClosed: b,
857
- children: _
861
+ children: H
858
862
  }
859
863
  ),
860
- B && /* @__PURE__ */ o(
864
+ y && /* @__PURE__ */ o(
861
865
  ze,
862
866
  {
863
- "data-testid": Ot,
867
+ "data-testid": kt,
864
868
  anchor: "right",
865
869
  open: he,
866
870
  onClose: () => Te(!1),
867
871
  width: pe,
868
872
  titleText: ce,
869
- debugOpacity: c,
873
+ debugOpacity: l,
870
874
  showCloseArrow: Y === "both" || Y === "close",
871
875
  onOpened: St,
872
876
  onClosed: Dt,
@@ -881,14 +885,14 @@ function Ao({
881
885
  i(i({
882
886
  titleText: t,
883
887
  "data-testid": p
884
- }, y && F === "push" ? {
888
+ }, F && P === "push" ? {
885
889
  leftPanel: {
886
890
  open: ue,
887
891
  width: a,
888
892
  onOpen: () => Ee(!0),
889
- showOpenArrow: l === "both" || l === "open"
893
+ showOpenArrow: c === "both" || c === "open"
890
894
  }
891
- } : {}), B && ke === "push" ? {
895
+ } : {}), y && $e === "push" ? {
892
896
  rightPanel: {
893
897
  open: he,
894
898
  width: pe,
@@ -899,26 +903,26 @@ function Ao({
899
903
  ),
900
904
  /* @__PURE__ */ o(
901
905
  vn,
902
- A(i(i({}, F === "push" ? {
906
+ S(i(i({}, P === "push" ? {
903
907
  leftPanel: {
904
908
  open: ue,
905
909
  width: a
906
910
  }
907
- } : {}), ke === "push" ? {
911
+ } : {}), $e === "push" ? {
908
912
  rightPanel: {
909
913
  open: he,
910
914
  width: pe
911
915
  }
912
916
  } : {}), {
913
- children: /* @__PURE__ */ o(xn, A(i({ "data-testid": h }, d), { children: e }))
917
+ children: /* @__PURE__ */ o(xn, S(i({ "data-testid": g }, d), { children: e }))
914
918
  })
915
919
  )
916
920
  ] });
917
921
  }
918
922
  const ht = () => {
919
923
  const e = ae();
920
- return Pt(e.breakpoints.down("sm"));
921
- }, wn = 64, bn = 64, An = 256, K = L(!0), gt = L(An), ft = L(bn), we = L(""), mt = L(wn), Ct = L(void 0);
924
+ return Nt(e.breakpoints.down("sm"));
925
+ }, wn = 64, bn = 64, An = 256, K = M(!0), gt = M(An), ft = M(bn), we = M(""), mt = M(wn), Ct = M(void 0);
922
926
  function Sn({ links: e }) {
923
927
  return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
924
928
  }
@@ -930,7 +934,7 @@ const ne = "Navbar", j = {
930
934
  // userInfoHolder: `${PREFIX}-userInfoHolder`,
931
935
  // settings: `${PREFIX}-settings`,
932
936
  // pieChartIcon: `${PREFIX}-pieChartIcon`,
933
- }, Dn = N(D, { name: "NavBar" })(({ theme: e }) => ({
937
+ }, Dn = L(D, { name: "NavBar" })(({ theme: e }) => ({
934
938
  [`&.${j.root}`]: {
935
939
  display: "flex"
936
940
  },
@@ -952,10 +956,10 @@ const ne = "Navbar", j = {
952
956
  })), ie = (e, t, n) => e.transitions.create(t, {
953
957
  easing: e.transitions.easing.sharp,
954
958
  duration: n === "leaving" ? e.transitions.duration.leavingScreen : e.transitions.duration.enteringScreen
955
- }), On = (e) => {
959
+ }), kn = (e) => {
956
960
  const t = ae();
957
961
  return /* @__PURE__ */ o(
958
- Nt,
962
+ Bt,
959
963
  i({
960
964
  easing: t.transitions.easing.sharp,
961
965
  timeout: {
@@ -978,7 +982,7 @@ const ne = "Navbar", j = {
978
982
  }, vt(e)), Ue = (e, t) => i({
979
983
  width: t,
980
984
  transition: ie(e, "width", "leaving")
981
- }, vt(e)), $n = N(be, {
985
+ }, vt(e)), On = L(be, {
982
986
  shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
983
987
  })(({ theme: e, open: t, widthOpen: n, widthClosed: r, isSmallScreen: s }) => i(i({
984
988
  flexShrink: 0,
@@ -986,14 +990,14 @@ const ne = "Navbar", j = {
986
990
  boxSizing: "border-box",
987
991
  display: "flex",
988
992
  flexDirection: "column"
989
- }, t && A(i({}, Ge(e, n)), {
993
+ }, t && S(i({}, Ge(e, n)), {
990
994
  backgroundColor: "",
991
995
  "& .MuiDrawer-paper": Ge(e, n)
992
- })), !t && A(i({}, Ue(e, s ? n : r)), {
996
+ })), !t && S(i({}, Ue(e, s ? n : r)), {
993
997
  backgroundColor: "",
994
998
  "& .MuiDrawer-paper": Ue(e, s ? n : r)
995
999
  })));
996
- function kn(e) {
1000
+ function $n(e) {
997
1001
  let t = 0;
998
1002
  for (let n = 0, r = e.length; n < r; n++) {
999
1003
  const s = e.charCodeAt(n);
@@ -1024,20 +1028,20 @@ function En({ user: e, domainCode: t, open: n }) {
1024
1028
  aspectRatio: 1
1025
1029
  },
1026
1030
  children: e != null && e.name ? /* @__PURE__ */ o(
1027
- Ne,
1031
+ Be,
1028
1032
  {
1029
1033
  src: e == null ? void 0 : e.picture,
1030
1034
  sx: {
1031
1035
  width: "100%",
1032
1036
  height: "100%",
1033
- bgcolor: Ve[Math.abs(kn(e.name)) % Ve.length]
1037
+ bgcolor: Ve[Math.abs($n(e.name)) % Ve.length]
1034
1038
  },
1035
1039
  children: In(e.name)
1036
1040
  }
1037
- ) : /* @__PURE__ */ o(Ne, { sx: { width: "100%", height: "100%" } })
1041
+ ) : /* @__PURE__ */ o(Be, { sx: { width: "100%", height: "100%" } })
1038
1042
  }
1039
1043
  ),
1040
- /* @__PURE__ */ o(On, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Lt, { in: n, children: /* @__PURE__ */ f(D, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
1044
+ /* @__PURE__ */ o(kn, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Lt, { in: n, children: /* @__PURE__ */ f(D, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
1041
1045
  e != null && e.name ? /* @__PURE__ */ o(E, { children: e.name }) : /* @__PURE__ */ o(Le, { animation: !1, width: "50%" }),
1042
1046
  t ? /* @__PURE__ */ o(E, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Le, { animation: !1, width: "25%" })
1043
1047
  ] }) }) })
@@ -1051,14 +1055,14 @@ function Tn({
1051
1055
  widthOpen: n,
1052
1056
  "data-testid": r,
1053
1057
  top: s,
1054
- middle: c,
1058
+ middle: l,
1055
1059
  bottom: d,
1056
- user: h,
1060
+ user: g,
1057
1061
  domainCode: p
1058
1062
  }) {
1059
1063
  const u = ht(), w = it(K);
1060
1064
  return /* @__PURE__ */ o(Dn, { className: j.root, "data-testid": r, children: /* @__PURE__ */ f(
1061
- $n,
1065
+ On,
1062
1066
  {
1063
1067
  open: e,
1064
1068
  widthOpen: n,
@@ -1078,17 +1082,17 @@ function Tn({
1078
1082
  s,
1079
1083
  /* @__PURE__ */ o(Me, { variant: "middle" })
1080
1084
  ] }),
1081
- /* @__PURE__ */ o(D, { flexGrow: "1", children: Array.isArray(c) ? /* @__PURE__ */ o(Sn, { links: c }) : c }),
1085
+ /* @__PURE__ */ o(D, { flexGrow: "1", children: Array.isArray(l) ? /* @__PURE__ */ o(Sn, { links: l }) : l }),
1082
1086
  /* @__PURE__ */ f(D, { flexGrow: "0", children: [
1083
1087
  /* @__PURE__ */ o(Me, { variant: "middle" }),
1084
- /* @__PURE__ */ o(En, { user: h, domainCode: p, open: e }),
1085
- d && /* @__PURE__ */ o(P, { children: d })
1088
+ /* @__PURE__ */ o(En, { user: g, domainCode: p, open: e }),
1089
+ d && /* @__PURE__ */ o(B, { children: d })
1086
1090
  ] })
1087
1091
  ]
1088
1092
  }
1089
1093
  ) });
1090
1094
  }
1091
- function yn({
1095
+ function Fn({
1092
1096
  children: e,
1093
1097
  topBarHeight: t,
1094
1098
  maxWidth: n = !1
@@ -1116,11 +1120,11 @@ function yn({
1116
1120
  }
1117
1121
  );
1118
1122
  }
1119
- const Bn = "TopBar", Fn = {
1120
- titleText: `${Bn}-titleText`
1123
+ const yn = "TopBar", Pn = {
1124
+ titleText: `${yn}-titleText`
1121
1125
  };
1122
- function Pn({ titleText: e = "", height: t, "data-testid": n }) {
1123
- const r = it(K), s = () => r((h) => !h), c = ae(), d = ht();
1126
+ function Nn({ titleText: e = "", height: t, "data-testid": n }) {
1127
+ const r = it(K), s = () => r((g) => !g), l = ae(), d = ht();
1124
1128
  return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ f(
1125
1129
  Ze,
1126
1130
  {
@@ -1136,11 +1140,11 @@ function Pn({ titleText: e = "", height: t, "data-testid": n }) {
1136
1140
  gap: 2,
1137
1141
  flexShrink: 0,
1138
1142
  height: t,
1139
- zIndex: d ? 0 : c.zIndex.drawer + 1
1143
+ zIndex: d ? 0 : l.zIndex.drawer + 1
1140
1144
  },
1141
1145
  children: [
1142
1146
  /* @__PURE__ */ o(Q, { size: "medium", color: "inherit", sx: { padding: 1.5 }, onClick: s, children: /* @__PURE__ */ o(Jt, { fontSize: "medium" }) }),
1143
- /* @__PURE__ */ o(E, { className: Fn.titleText, variant: "h6", children: e })
1147
+ /* @__PURE__ */ o(E, { className: Pn.titleText, variant: "h6", children: e })
1144
1148
  ]
1145
1149
  }
1146
1150
  ) });
@@ -1151,9 +1155,9 @@ function So({
1151
1155
  initialNavBarOpen: n,
1152
1156
  pageContainerProps: r,
1153
1157
  pageContentDataTestId: s,
1154
- topBarDataTestId: c,
1158
+ topBarDataTestId: l,
1155
1159
  navBarDataTestId: d,
1156
- navBarMiddle: h,
1160
+ navBarMiddle: g,
1157
1161
  navBarBottom: p,
1158
1162
  user: u,
1159
1163
  domainCode: w
@@ -1162,31 +1166,31 @@ function So({
1162
1166
  [K, n != null ? n : !0],
1163
1167
  [we, t != null ? t : ""]
1164
1168
  ]);
1165
- const b = He(K), [S] = X(gt), [v] = X(ft), O = He(we), [C] = X(mt), [m] = X(Ct);
1169
+ const b = He(K), [A] = X(gt), [C] = X(ft), k = He(we), [v] = X(mt), [m] = X(Ct);
1166
1170
  return /* @__PURE__ */ f(D, { children: [
1167
1171
  /* @__PURE__ */ o(_t, {}),
1168
- /* @__PURE__ */ o(Pn, { titleText: O, "data-testid": c, height: C }),
1172
+ /* @__PURE__ */ o(Nn, { titleText: k, "data-testid": l, height: v }),
1169
1173
  /* @__PURE__ */ f(D, { sx: { display: "flex" }, children: [
1170
1174
  /* @__PURE__ */ o(
1171
1175
  Tn,
1172
1176
  {
1173
1177
  open: b,
1174
1178
  top: m,
1175
- middle: h,
1179
+ middle: g,
1176
1180
  bottom: p,
1177
1181
  user: u,
1178
1182
  domainCode: w,
1179
- widthOpen: S,
1180
- widthClosed: v,
1181
- offsetTop: C,
1183
+ widthOpen: A,
1184
+ widthClosed: C,
1185
+ offsetTop: v,
1182
1186
  "data-testid": d
1183
1187
  }
1184
1188
  ),
1185
1189
  /* @__PURE__ */ o(
1186
- yn,
1187
- A(i({
1190
+ Fn,
1191
+ S(i({
1188
1192
  "data-testid": s,
1189
- topBarHeight: C
1193
+ topBarHeight: v
1190
1194
  }, r), {
1191
1195
  children: e
1192
1196
  })
@@ -1194,7 +1198,7 @@ function So({
1194
1198
  ] })
1195
1199
  ] });
1196
1200
  }
1197
- const Nn = {
1201
+ const Bn = {
1198
1202
  autoHideDuration: 6e3,
1199
1203
  anchorOrigin: { vertical: "top", horizontal: "center" },
1200
1204
  // The default is false. If we prefer timer to continue when window loses
@@ -1215,75 +1219,75 @@ const Nn = {
1215
1219
  borderBottomLeftRadius: "0px",
1216
1220
  borderBottomRightRadius: "0px"
1217
1221
  }, Rn = {}, Wn = {}, xt = Je(null);
1218
- function zn(c) {
1219
- var d = c, {
1222
+ function zn(l) {
1223
+ var d = l, {
1220
1224
  overrideState: e = Rn,
1221
1225
  overrideActions: t = Wn,
1222
1226
  shouldClose: n = Ln.shouldClose,
1223
1227
  children: r
1224
- } = d, s = Fe(d, [
1228
+ } = d, s = Pe(d, [
1225
1229
  "overrideState",
1226
1230
  "overrideActions",
1227
1231
  "shouldClose",
1228
1232
  "children"
1229
1233
  ]);
1230
- var R;
1231
- const [{ open: h }, p] = $({ open: !1 }), u = fe([]), w = fe(Date.now()), b = fe(0), S = oe((a) => {
1234
+ var W;
1235
+ const [{ open: g }, p] = O({ open: !1 }), u = fe([]), w = fe(Date.now()), b = fe(0), A = oe((a) => {
1232
1236
  p({ open: a });
1233
- }, []), v = oe((a = {}) => {
1237
+ }, []), C = oe((a = {}) => {
1234
1238
  b.current += 1, u.current.length >= Xe && Date.now() - w.current >= je && (w.current = Date.now(), console.error(
1235
1239
  `SaladBarProvider: MAX_QUEUE_LENGTH (${Xe}) hit ${b.current} times in last ${je}ms)`
1236
1240
  ), b.current = 0);
1237
- const l = i(A(i({}, qe), {
1241
+ const c = i(S(i({}, qe), {
1238
1242
  key: _n()
1239
1243
  }), a);
1240
- return u.current.push(l), u.current.length === 1 && p({ open: !0 }), l.key;
1241
- }, []), O = (a = "", l = {}) => v(i({ message: a, severity: "success" }, l)), C = (a = "", l = {}) => v(i({ message: a, severity: "info" }, l)), m = (a = "", l = {}) => v(i({ message: a, severity: "warning" }, l)), g = (a = "", l = {}) => v(i({ message: a, severity: "error" }, l)), T = (a) => {
1242
- const l = u.current.findIndex((x) => x.key === a);
1243
- if (l !== -1)
1244
- return l === 0 ? (p({ open: !1 }), u.current[0]) : u.current.splice(l, 1);
1245
- }, M = (a, l) => {
1246
- n(a, l) && p({ open: !1 });
1244
+ return u.current.push(c), u.current.length === 1 && p({ open: !0 }), c.key;
1245
+ }, []), k = (a = "", c = {}) => C(i({ message: a, severity: "success" }, c)), v = (a = "", c = {}) => C(i({ message: a, severity: "info" }, c)), m = (a = "", c = {}) => C(i({ message: a, severity: "warning" }, c)), h = (a = "", c = {}) => C(i({ message: a, severity: "error" }, c)), T = (a) => {
1246
+ const c = u.current.findIndex((x) => x.key === a);
1247
+ if (c !== -1)
1248
+ return c === 0 ? (p({ open: !1 }), u.current[0]) : u.current.splice(c, 1);
1249
+ }, _ = (a, c) => {
1250
+ n(a, c) && p({ open: !1 });
1251
+ }, F = () => {
1247
1252
  }, y = () => {
1248
- }, B = () => {
1249
1253
  u.current.shift(), u.current.length > 0 && p({ open: !0 });
1250
- }, k = (R = u.current[0]) != null ? R : i({}, qe), _ = {};
1251
- "autoHideDuration" in k && (_.autoHideDuration = k.autoHideDuration);
1252
- const F = i(i({}, Nn), s), H = i(i({
1253
- open: h,
1254
- setOpen: S,
1255
- enqueueNotification: v,
1256
- enqueueSuccessNotification: O,
1257
- enqueueInfoNotification: C,
1254
+ }, $ = (W = u.current[0]) != null ? W : i({}, qe), H = {};
1255
+ "autoHideDuration" in $ && (H.autoHideDuration = $.autoHideDuration);
1256
+ const P = i(i({}, Bn), s), R = i(i({
1257
+ open: g,
1258
+ setOpen: A,
1259
+ enqueueNotification: C,
1260
+ enqueueSuccessNotification: k,
1261
+ enqueueInfoNotification: v,
1258
1262
  enqueueWarningNotification: m,
1259
- enqueueErrorNotification: g,
1263
+ enqueueErrorNotification: h,
1260
1264
  removeNotification: T
1261
1265
  }, e), t);
1262
- return /* @__PURE__ */ f(xt.Provider, { value: H, children: [
1266
+ return /* @__PURE__ */ f(xt.Provider, { value: R, children: [
1263
1267
  r,
1264
1268
  /* @__PURE__ */ o(
1265
1269
  Ht,
1266
- A(i(i({}, F), _), {
1267
- open: h,
1268
- onClose: M,
1270
+ S(i(i({}, P), H), {
1271
+ open: g,
1272
+ onClose: _,
1269
1273
  TransitionProps: {
1270
- onExited: B,
1271
- onExit: y
1274
+ onExited: y,
1275
+ onExit: F
1272
1276
  },
1273
1277
  sx: { zIndex: Mn },
1274
1278
  children: /* @__PURE__ */ f("div", { children: [
1275
1279
  /* @__PURE__ */ o(
1276
1280
  Rt,
1277
1281
  {
1278
- onClose: (a) => M(a, "closeAlert"),
1279
- severity: k.severity,
1282
+ onClose: (a) => _(a, "closeAlert"),
1283
+ severity: $.severity,
1280
1284
  variant: "filled",
1281
- icon: k.progressIndicator === "circular" ? /* @__PURE__ */ o(De, { size: "1em" }) : void 0,
1282
- style: k.progressIndicator === "linear" ? Hn : void 0,
1283
- children: k.message
1285
+ icon: $.progressIndicator === "circular" ? /* @__PURE__ */ o(De, { size: "1em" }) : void 0,
1286
+ style: $.progressIndicator === "linear" ? Hn : void 0,
1287
+ children: $.message
1284
1288
  }
1285
1289
  ),
1286
- k.progressIndicator === "linear" && /* @__PURE__ */ o(Wt, { color: "primary" })
1290
+ $.progressIndicator === "linear" && /* @__PURE__ */ o(Wt, { color: "primary" })
1287
1291
  ] })
1288
1292
  })
1289
1293
  )
@@ -1292,19 +1296,19 @@ function zn(c) {
1292
1296
  function Gn() {
1293
1297
  const e = Ye(xt);
1294
1298
  if (e === null)
1295
- throw new $e("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
1299
+ throw new Oe("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
1296
1300
  return e;
1297
1301
  }
1298
1302
  const Do = se(
1299
- (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: r }) => /* @__PURE__ */ o(zn, A(i({}, e), { overrideState: t, overrideActions: n, children: r }))
1300
- ), Un = en(), Oo = ({
1303
+ (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: r }) => /* @__PURE__ */ o(zn, S(i({}, e), { overrideState: t, overrideActions: n, children: r }))
1304
+ ), Un = en(), ko = ({
1301
1305
  children: e,
1302
1306
  store: t
1303
1307
  }) => /* @__PURE__ */ o(at, { store: t != null ? t : Un, children: e }), wt = "domainCode";
1304
1308
  var Ke;
1305
- const Qe = L(
1309
+ const Qe = M(
1306
1310
  JSON.parse((Ke = localStorage.getItem(wt)) != null ? Ke : '{"domainCode": ""}').domainCode
1307
- ), bt = L(
1311
+ ), bt = M(
1308
1312
  (e) => e(Qe),
1309
1313
  (e, t, n) => {
1310
1314
  t(Qe, n), localStorage.setItem(wt, JSON.stringify({ domainCode: n }));
@@ -1324,36 +1328,36 @@ const Qe = L(
1324
1328
  }, qn = (e) => {
1325
1329
  var t;
1326
1330
  return e === null ? "N/A" : (t = Vn[e]) != null ? t : "";
1327
- }, $o = ({
1331
+ }, Oo = ({
1328
1332
  isLoading: e,
1329
1333
  isOpen: t,
1330
1334
  onClose: n,
1331
1335
  domainOptions: r,
1332
1336
  applicationName: s,
1333
- handleLogout: c
1337
+ handleLogout: l
1334
1338
  }) => {
1335
- const [d, h] = X(bt), [p, u] = $(d), { enqueueSuccessNotification: w } = Gn(), b = r.length === 0, S = !!d && !r.includes(d) && !r.includes(p), v = !d || b || S, O = () => z(void 0, null, function* () {
1336
- p ? (h(p), w(`Set domain to ${p}`), n()) : h("");
1337
- }), C = () => z(void 0, null, function* () {
1338
- d && !b && !S ? (u(d), n()) : v && c();
1339
+ const [d, g] = X(bt), [p, u] = O(d), { enqueueSuccessNotification: w } = Gn(), b = r.length === 0, A = !!d && !r.includes(d) && !r.includes(p), C = !d || b || A, k = () => N(void 0, null, function* () {
1340
+ p ? (g(p), w(`Set domain to ${p}`), n()) : g("");
1341
+ }), v = () => N(void 0, null, function* () {
1342
+ d && !b && !A ? (u(d), n()) : C && l();
1339
1343
  });
1340
1344
  let m;
1341
- return b ? m = "Unable to retrieve your active organisations. Try logging in again." : S && (m = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ f(
1345
+ return b ? m = "Unable to retrieve your active organisations. Try logging in again." : A && (m = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ f(
1342
1346
  pn,
1343
1347
  {
1344
1348
  isOpen: t,
1345
1349
  dialogTitle: "Select an organisation",
1346
1350
  primaryButton: {
1347
1351
  text: "Confirm",
1348
- onClick: O,
1349
- disabled: !p || b || S,
1352
+ onClick: k,
1353
+ disabled: !p || b || A,
1350
1354
  buttonColor: "primary"
1351
1355
  },
1352
1356
  secondaryButton: {
1353
- text: v ? "Logout" : "Cancel",
1354
- onClick: C
1357
+ text: C ? "Logout" : "Cancel",
1358
+ onClick: v
1355
1359
  },
1356
- onClose: v ? () => {
1360
+ onClose: C ? () => {
1357
1361
  } : n,
1358
1362
  children: [
1359
1363
  /* @__PURE__ */ f(E, { marginBottom: 2, children: [
@@ -1368,18 +1372,18 @@ const Qe = L(
1368
1372
  multiple: !1,
1369
1373
  disableClearable: !1,
1370
1374
  value: p !== "" ? p : null,
1371
- onChange: (g, T) => u(T != null ? T : ""),
1375
+ onChange: (h, T) => u(T != null ? T : ""),
1372
1376
  getOptionLabel: qn,
1373
1377
  options: [...r],
1374
- renderInput: (g) => /* @__PURE__ */ o(
1378
+ renderInput: (h) => /* @__PURE__ */ o(
1375
1379
  Se,
1376
- A(i({}, g), {
1380
+ S(i({}, h), {
1377
1381
  variant: "filled",
1378
1382
  label: "Select organisation",
1379
- InputProps: A(i({}, g.InputProps), {
1380
- endAdornment: /* @__PURE__ */ f(P, { children: [
1383
+ InputProps: S(i({}, h.InputProps), {
1384
+ endAdornment: /* @__PURE__ */ f(B, { children: [
1381
1385
  e ? /* @__PURE__ */ o(De, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
1382
- g.InputProps.endAdornment
1386
+ h.InputProps.endAdornment
1383
1387
  ] })
1384
1388
  })
1385
1389
  })
@@ -1390,7 +1394,7 @@ const Qe = L(
1390
1394
  ]
1391
1395
  }
1392
1396
  );
1393
- }, ko = tt({
1397
+ }, $o = tt({
1394
1398
  palette: {
1395
1399
  primary: {
1396
1400
  dark: "#00A651",
@@ -1543,7 +1547,7 @@ const Qe = L(
1543
1547
  }, Eo = se(() => ({ children: e }) => /* @__PURE__ */ o(at, { children: e })), jn = ({
1544
1548
  initialValues: e,
1545
1549
  children: t
1546
- }) => (st(e), /* @__PURE__ */ o(P, { children: t })), To = se(
1550
+ }) => (st(e), /* @__PURE__ */ o(B, { children: t })), To = se(
1547
1551
  (e) => ({ children: t }) => /* @__PURE__ */ o(
1548
1552
  jn,
1549
1553
  {
@@ -1560,10 +1564,10 @@ const Qe = L(
1560
1564
  export {
1561
1565
  pn as AgDialog,
1562
1566
  So as AppLayout,
1563
- Oo as AtomProvider,
1567
+ ko as AtomProvider,
1564
1568
  xt as Context,
1565
- $e as ContextError,
1566
- $o as DomainCodeDialog,
1569
+ Oe as ContextError,
1570
+ Oo as DomainCodeDialog,
1567
1571
  fo as ExampleComponent,
1568
1572
  wo as FetchAutocomplete,
1569
1573
  jn as HydrateAtoms,
@@ -1579,7 +1583,7 @@ export {
1579
1583
  Un as atomStore,
1580
1584
  dn as buildNavBarState,
1581
1585
  bt as domainCodeAtom,
1582
- ko as fed21Theme,
1586
+ $o as fed21Theme,
1583
1587
  Io as internalAgSystemsTheme,
1584
1588
  V as navBarClasses,
1585
1589
  K as navBarOpenAtom,