@australiangreens/ag-internal-components 0.0.72 → 0.0.74

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