@australiangreens/ag-internal-components 0.0.56 → 0.0.58

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