@australiangreens/ag-internal-components 0.1.23 → 0.1.24

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