@australiangreens/ag-internal-components 0.0.70 → 0.0.71

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