@australiangreens/ag-internal-components 0.0.59 → 0.0.61

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