@australiangreens/ag-internal-components 0.0.43 → 0.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,15 +1,15 @@
1
- var ht = Object.defineProperty, ft = Object.defineProperties;
2
- var mt = Object.getOwnPropertyDescriptors;
1
+ var xt = Object.defineProperty, Ct = Object.defineProperties;
2
+ var wt = Object.getOwnPropertyDescriptors;
3
3
  var J = Object.getOwnPropertySymbols;
4
4
  var we = Object.prototype.hasOwnProperty, be = Object.prototype.propertyIsEnumerable;
5
- var de = (e, t, n) => t in e ? ht(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, i = (e, t) => {
5
+ var de = (e, t, n) => t in e ? xt(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
7
  we.call(t, n) && de(e, n, t[n]);
8
8
  if (J)
9
9
  for (var n of J(t))
10
10
  be.call(t, n) && de(e, n, t[n]);
11
11
  return e;
12
- }, x = (e, t) => ft(e, mt(t));
12
+ }, x = (e, t) => Ct(e, wt(t));
13
13
  var Ae = (e, t) => {
14
14
  var n = {};
15
15
  for (var r in e)
@@ -21,45 +21,46 @@ var Ae = (e, t) => {
21
21
  };
22
22
  var Se = (e, t, n) => (de(e, typeof t != "symbol" ? t + "" : t, n), n);
23
23
  var K = (e, t, n) => new Promise((r, a) => {
24
- var s = (l) => {
24
+ var l = (s) => {
25
25
  try {
26
- u(n.next(l));
26
+ u(n.next(s));
27
27
  } catch (d) {
28
28
  a(d);
29
29
  }
30
- }, c = (l) => {
30
+ }, p = (s) => {
31
31
  try {
32
- u(n.throw(l));
32
+ u(n.throw(s));
33
33
  } catch (d) {
34
34
  a(d);
35
35
  }
36
- }, u = (l) => l.done ? r(l.value) : Promise.resolve(l.value).then(s, c);
36
+ }, u = (s) => s.done ? r(s.value) : Promise.resolve(s.value).then(l, p);
37
37
  u((n = n.apply(e, t)).next());
38
38
  });
39
- import { jsxs as p, Fragment as _, jsx as o } from "react/jsx-runtime";
40
- import { useState as O, createContext as ye, useCallback as te, useContext as _e, useEffect as ne, useRef as ce } from "react";
41
- import { Typography as P, Button as vt, Paper as oe, styled as X, Box as A, IconButton as V, Drawer as xt, Container as Me, Divider as Te, CssBaseline as Ct, Snackbar as wt, Alert as bt, CircularProgress as He, LinearProgress as At, Autocomplete as St, TextField as Tt, FormHelperText as It } from "@mui/material";
42
- import Ot from "@mui/material/CssBaseline";
43
- import { styled as M, createTheme as Re, alpha as pe } from "@mui/material/styles";
44
- import We from "@mui/material/Drawer";
45
- import { AgError as Dt } from "@australiangreens/ag-error";
39
+ import { jsxs as c, Fragment as M, jsx as o } from "react/jsx-runtime";
40
+ import { useState as D, createContext as He, useCallback as ne, useContext as Re, useEffect as oe, useRef as ce } from "react";
41
+ import { Typography as $, Button as bt, Paper as We, styled as X, Box as T, IconButton as V, Drawer as At, Container as ze, Avatar as Ie, Skeleton as Te, Divider as Oe, CssBaseline as St, Snackbar as It, Alert as Tt, CircularProgress as Ge, LinearProgress as Ot, Autocomplete as Dt, TextField as $t, FormHelperText as kt } from "@mui/material";
42
+ import Bt from "@mui/material/CssBaseline";
43
+ import { styled as _, createTheme as Ue, alpha as pe } from "@mui/material/styles";
44
+ import Ve from "@mui/material/Drawer";
45
+ import { AgError as Nt } from "@australiangreens/ag-error";
46
46
  import { createHelper as re } from "souvlaki";
47
- import ze from "@mui/material/List";
48
- import Ie from "@mui/material/Button";
49
- import $t from "@mui/material/Dialog";
50
- import kt from "@mui/material/DialogActions";
51
- import Bt from "@mui/material/DialogContent";
52
- import Nt from "@mui/material/DialogTitle";
53
- import { ArrowForward as Ge, ArrowBack as Ue, ViewHeadline as Et } from "@mui/icons-material";
54
- import { atom as $, useSetAtom as Ft, useAtom as E, getDefaultStore as Pt, Provider as Ve } from "jotai";
55
- import { useHydrateAtoms as Lt } from "jotai/utils";
56
- function Un({ text: e }) {
57
- const [t, n] = O(0);
58
- return /* @__PURE__ */ p(_, { children: [
59
- /* @__PURE__ */ o(P, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
60
- /* @__PURE__ */ o(P, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
47
+ import Xe from "@mui/material/List";
48
+ import De from "@mui/material/Button";
49
+ import Et from "@mui/material/Dialog";
50
+ import Ft from "@mui/material/DialogActions";
51
+ import Lt from "@mui/material/DialogContent";
52
+ import yt from "@mui/material/DialogTitle";
53
+ import { ArrowForward as qe, ArrowBack as je, ViewHeadline as Pt } from "@mui/icons-material";
54
+ import { useSetLibraryAtom as Mt, useLibraryAtom as y } from "src/providers";
55
+ import { atom as k, getDefaultStore as _t, Provider as Ye, useAtom as Ht, useSetAtom as Rt } from "jotai";
56
+ import { useHydrateAtoms as Wt } from "jotai/utils";
57
+ function no({ text: e }) {
58
+ const [t, n] = D(0);
59
+ return /* @__PURE__ */ c(M, { children: [
60
+ /* @__PURE__ */ o($, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
61
+ /* @__PURE__ */ o($, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
61
62
  /* @__PURE__ */ o(
62
- vt,
63
+ bt,
63
64
  {
64
65
  variant: "outlined",
65
66
  onClick: () => n((r) => r + 1),
@@ -67,44 +68,44 @@ function Un({ text: e }) {
67
68
  children: "Hello I am a button"
68
69
  }
69
70
  ),
70
- /* @__PURE__ */ p("p", { children: [
71
+ /* @__PURE__ */ c("p", { children: [
71
72
  "This is some text: ",
72
73
  /* @__PURE__ */ o("span", { children: e })
73
74
  ] }),
74
- /* @__PURE__ */ p(oe, { children: [
75
+ /* @__PURE__ */ c(We, { children: [
75
76
  "This number will incremember when button pressed: ",
76
77
  t
77
78
  ] })
78
79
  ] });
79
80
  }
80
- const Xe = 330, qe = 73, N = "Navbar", y = {
81
- root: `${N}-root`,
82
- menuButton: `${N}-menuButton`,
83
- hide: `${N}-hide`,
84
- content: `${N}-content`,
85
- userInfoHolder: `${N}-userInfoHolder`,
86
- settings: `${N}-settings`,
87
- pieChartIcon: `${N}-pieChartIcon`
88
- }, yt = M("div", { name: "NavBar" })(({ theme: e }) => ({
89
- [`&.${y.root}`]: {
81
+ const Qe = 330, Je = 73, E = "Navbar", P = {
82
+ root: `${E}-root`,
83
+ menuButton: `${E}-menuButton`,
84
+ hide: `${E}-hide`,
85
+ content: `${E}-content`,
86
+ userInfoHolder: `${E}-userInfoHolder`,
87
+ settings: `${E}-settings`,
88
+ pieChartIcon: `${E}-pieChartIcon`
89
+ }, zt = _("div", { name: "NavBar" })(({ theme: e }) => ({
90
+ [`&.${P.root}`]: {
90
91
  display: "flex"
91
92
  },
92
- [`& .${y.menuButton}`]: {
93
+ [`& .${P.menuButton}`]: {
93
94
  marginRight: 36
94
95
  },
95
- [`& .${y.hide}`]: {
96
+ [`& .${P.hide}`]: {
96
97
  display: "none"
97
98
  },
98
- [`& .${y.content}`]: {
99
+ [`& .${P.content}`]: {
99
100
  flexGrow: 1,
100
101
  padding: e.spacing(3)
101
102
  },
102
- [`& .${y.userInfoHolder}`]: {
103
+ [`& .${P.userInfoHolder}`]: {
103
104
  height: "148px",
104
105
  marginTop: "64px",
105
106
  marginBottom: "16px"
106
107
  }
107
- })), je = () => ({
108
+ })), Ke = () => ({
108
109
  position: "absolute",
109
110
  height: "100%",
110
111
  overflowX: "hidden",
@@ -112,51 +113,51 @@ const Xe = 330, qe = 73, N = "Navbar", y = {
112
113
  color: "white",
113
114
  backgroundColor: "black"
114
115
  // backgroundColor: '#e8e8e8',
115
- }), _t = () => i({
116
- width: Xe
117
- }, je()), Mt = () => i({
118
- width: qe
119
- }, je()), Ht = M(We, {
116
+ }), Gt = () => i({
117
+ width: Qe
118
+ }, Ke()), Ut = () => i({
119
+ width: Je
120
+ }, Ke()), Vt = _(Ve, {
120
121
  shouldForwardProp: (e) => e !== "open"
121
122
  })(({ theme: e, open: t }) => i(i({
122
- width: t ? Xe : qe,
123
+ width: t ? Qe : Je,
123
124
  flexShrink: 0,
124
125
  whiteSpace: "nowrap",
125
126
  boxSizing: "border-box",
126
127
  zIndex: e.zIndex.drawer + 100
127
128
  }, t && {
128
- "& .MuiDrawer-paper": _t()
129
+ "& .MuiDrawer-paper": Gt()
129
130
  }), !t && {
130
- "& .MuiDrawer-paper": Mt()
131
+ "& .MuiDrawer-paper": Ut()
131
132
  }));
132
- class he extends Dt {
133
+ class he extends Nt {
133
134
  }
134
135
  Se(he, "errorName", "ContextError");
135
- const Qe = ye(null), Rt = {}, Wt = {}, zt = ({
136
- overrideState: e = Rt,
137
- overrideActions: t = Wt,
136
+ const Ze = He(null), Xt = {}, qt = {}, jt = ({
137
+ overrideState: e = Xt,
138
+ overrideActions: t = qt,
138
139
  children: n
139
140
  }) => {
140
- const [{ open: r }, a] = O({ open: !0 }), s = te((l) => {
141
- a({ open: l });
142
- }, []), c = te(() => {
143
- a((l) => x(i({}, l), { open: !l.open }));
141
+ const [{ open: r }, a] = D({ open: !0 }), l = ne((s) => {
142
+ a({ open: s });
143
+ }, []), p = ne(() => {
144
+ a((s) => x(i({}, s), { open: !s.open }));
144
145
  }, []), u = i(i({
145
146
  open: r,
146
- setOpen: s,
147
- toggleOpen: c
147
+ setOpen: l,
148
+ toggleOpen: p
148
149
  }, e), t);
149
- return /* @__PURE__ */ o(Qe.Provider, { value: u, children: n });
150
- }, Gt = () => {
151
- const e = _e(Qe);
150
+ return /* @__PURE__ */ o(Ze.Provider, { value: u, children: n });
151
+ }, Yt = () => {
152
+ const e = Re(Ze);
152
153
  if (e === null)
153
154
  throw new he("Error: Tried to useNavBar outside of a <NavBarProvider>");
154
155
  return e;
155
- }, Ut = (e = {}) => i({
156
+ }, Qt = (e = {}) => i({
156
157
  open: !0
157
- }, e), Vn = re(
158
- (e = Ut(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(zt, { overrideState: e, overrideActions: t, children: n })
159
- ), Oe = 7, Xn = M(ze)(({ theme: e }) => ({
158
+ }, e), oo = re(
159
+ (e = Qt(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(jt, { overrideState: e, overrideActions: t, children: n })
160
+ ), $e = 7, ro = _(Xe)(({ theme: e }) => ({
160
161
  backgroundColor: "black",
161
162
  color: "white",
162
163
  "& .MuiListItem-root": {
@@ -165,7 +166,7 @@ const Qe = ye(null), Rt = {}, Wt = {}, zt = ({
165
166
  "& .MuiListItemButton-root": {
166
167
  " .MuiListItemIcon-root": {
167
168
  color: "white",
168
- padding: `${Oe}px`
169
+ padding: `${$e}px`
169
170
  },
170
171
  // Focus state
171
172
  "&.Mui-focusVisible": {
@@ -176,7 +177,7 @@ const Qe = ye(null), Rt = {}, Wt = {}, zt = ({
176
177
  borderLeftStyle: "solid",
177
178
  borderLeftWidth: "7px",
178
179
  borderLeftColor: e.palette.primary.main,
179
- paddingLeft: `calc(${e.spacing(2)} - ${Oe}px)`
180
+ paddingLeft: `calc(${e.spacing(2)} - ${$e}px)`
180
181
  },
181
182
  // Hover state
182
183
  "&:hover": {
@@ -194,7 +195,7 @@ const Qe = ye(null), Rt = {}, Wt = {}, zt = ({
194
195
  // '&.Mui-selected.Mui-focusVisible:hover': {
195
196
  // },
196
197
  }
197
- })), De = 7, qn = M(ze)(({ theme: e }) => ({
198
+ })), ke = 7, io = _(Xe)(({ theme: e }) => ({
198
199
  backgroundColor: "#e8e8e8",
199
200
  color: "inherit",
200
201
  "& .MuiListItem-root": {
@@ -203,7 +204,7 @@ const Qe = ye(null), Rt = {}, Wt = {}, zt = ({
203
204
  "& .MuiListItemButton-root": {
204
205
  " .MuiListItemIcon-root": {
205
206
  color: "inherit",
206
- padding: `${De}px`
207
+ padding: `${ke}px`
207
208
  },
208
209
  // Focus state
209
210
  "&.Mui-focusVisible": {
@@ -214,7 +215,7 @@ const Qe = ye(null), Rt = {}, Wt = {}, zt = ({
214
215
  borderLeftStyle: "solid",
215
216
  borderLeftWidth: "7px",
216
217
  borderLeftColor: e.palette.primary.main,
217
- paddingLeft: `calc(${e.spacing(2)} - ${De}px)`
218
+ paddingLeft: `calc(${e.spacing(2)} - ${ke}px)`
218
219
  },
219
220
  // Hover state
220
221
  "&:hover": {
@@ -233,15 +234,15 @@ const Qe = ye(null), Rt = {}, Wt = {}, zt = ({
233
234
  // },
234
235
  }
235
236
  }));
236
- function jn({
237
+ function ao({
237
238
  "data-testid": e,
238
239
  children: t
239
240
  }) {
240
- const { open: n } = Gt();
241
- return /* @__PURE__ */ p(yt, { className: y.root, "data-testid": e, children: [
242
- /* @__PURE__ */ o(Ot, {}),
241
+ const { open: n } = Yt();
242
+ return /* @__PURE__ */ c(zt, { className: P.root, "data-testid": e, children: [
243
+ /* @__PURE__ */ o(Bt, {}),
243
244
  /* @__PURE__ */ o(
244
- Ht,
245
+ Vt,
245
246
  {
246
247
  variant: "permanent",
247
248
  anchor: "left",
@@ -252,46 +253,46 @@ function jn({
252
253
  )
253
254
  ] });
254
255
  }
255
- const Vt = ({
256
+ const Jt = ({
256
257
  isOpen: e,
257
258
  dialogTitle: t,
258
259
  children: n,
259
260
  maxWidth: r,
260
261
  primaryButton: a,
261
- secondaryButton: s,
262
- onClose: c
262
+ secondaryButton: l,
263
+ onClose: p
263
264
  }) => {
264
265
  var d, v;
265
- const [u, l] = O(!1);
266
- return /* @__PURE__ */ p(
267
- $t,
266
+ const [u, s] = D(!1);
267
+ return /* @__PURE__ */ c(
268
+ Et,
268
269
  {
269
270
  open: e,
270
271
  onClose: () => {
271
- u || c();
272
+ u || p();
272
273
  },
273
274
  fullWidth: !0,
274
275
  maxWidth: r != null ? r : "xs",
275
276
  children: [
276
- /* @__PURE__ */ o(Nt, { children: t }),
277
- /* @__PURE__ */ o(Bt, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
278
- /* @__PURE__ */ p(kt, { children: [
277
+ /* @__PURE__ */ o(yt, { children: t }),
278
+ /* @__PURE__ */ o(Lt, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
279
+ /* @__PURE__ */ c(Ft, { children: [
279
280
  /* @__PURE__ */ o(
280
- Ie,
281
+ De,
281
282
  {
282
- onClick: (d = s == null ? void 0 : s.onClick) != null ? d : c,
283
- "data-testid": s == null ? void 0 : s.testId,
284
- disabled: (s == null ? void 0 : s.disabled) || u,
285
- color: s == null ? void 0 : s.buttonColor,
286
- children: (v = s == null ? void 0 : s.text) != null ? v : "Cancel"
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"
287
288
  }
288
289
  ),
289
290
  a && /* @__PURE__ */ o(
290
- Ie,
291
+ De,
291
292
  {
292
293
  onClick: () => K(void 0, null, function* () {
293
- var m;
294
- l(!0), yield (m = a.onClick) == null ? void 0 : m.call(a), l(!1);
294
+ var f;
295
+ s(!0), yield (f = a.onClick) == null ? void 0 : f.call(a), s(!1);
295
296
  }),
296
297
  "data-testid": a.testId,
297
298
  disabled: a.disabled || u,
@@ -303,14 +304,14 @@ const Vt = ({
303
304
  ]
304
305
  }
305
306
  );
306
- }, Xt = 24, qt = 64, F = "TopBar", b = {
307
+ }, Kt = 24, Zt = 64, F = "TopBar", b = {
307
308
  topStripe: `${F}-topStripe`,
308
309
  titleBar: `${F}-titleBar`,
309
310
  titleSlider: `${F}-titleSlider`,
310
311
  titleText: `${F}-titleText`,
311
312
  leftPanelButton: `${F}-leftPanelButton`,
312
313
  rightPanelButton: `${F}-leftPanelButton`
313
- }, jt = X("div", {
314
+ }, en = X("div", {
314
315
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
315
316
  name: F
316
317
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
@@ -319,12 +320,12 @@ const Vt = ({
319
320
  width: "100%",
320
321
  [`& .${b.topStripe}`]: {
321
322
  width: "100%",
322
- height: `${Xt}px`,
323
+ height: `${Kt}px`,
323
324
  backgroundColor: e.palette.primary.main
324
325
  },
325
326
  [`& .${b.titleBar}`]: {
326
327
  backgroundColor: e.palette.primary.light,
327
- height: `${qt}px`,
328
+ height: `${Zt}px`,
328
329
  padding: e.spacing(0, 3),
329
330
  width: "100%"
330
331
  },
@@ -362,16 +363,16 @@ const Vt = ({
362
363
  })
363
364
  };
364
365
  });
365
- function Qt({
366
+ function tn({
366
367
  titleText: e = "",
367
368
  leftPanel: t,
368
369
  rightPanel: n,
369
370
  "data-testid": r
370
371
  }) {
371
- return /* @__PURE__ */ p(jt, { leftPanel: t, rightPanel: n, "data-testid": r, children: [
372
+ return /* @__PURE__ */ c(en, { leftPanel: t, rightPanel: n, "data-testid": r, children: [
372
373
  /* @__PURE__ */ o("div", { className: b.topStripe }),
373
- /* @__PURE__ */ o("div", { className: b.titleBar, children: /* @__PURE__ */ p(A, { className: b.titleSlider, children: [
374
- t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ p(
374
+ /* @__PURE__ */ o("div", { className: b.titleBar, children: /* @__PURE__ */ c(T, { className: b.titleSlider, children: [
375
+ t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ c(
375
376
  V,
376
377
  {
377
378
  className: b.leftPanelButton,
@@ -382,12 +383,12 @@ function Qt({
382
383
  size: "large",
383
384
  children: [
384
385
  " ",
385
- /* @__PURE__ */ o(Ge, {})
386
+ /* @__PURE__ */ o(qe, {})
386
387
  ]
387
388
  }
388
389
  ),
389
- /* @__PURE__ */ o(P, { className: b.titleText, variant: "h6", noWrap: !0, children: e }),
390
- n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ p(
390
+ /* @__PURE__ */ o($, { className: b.titleText, variant: "h6", noWrap: !0, children: e }),
391
+ n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ c(
391
392
  V,
392
393
  {
393
394
  className: b.rightPanelButton,
@@ -398,14 +399,14 @@ function Qt({
398
399
  size: "large",
399
400
  children: [
400
401
  " ",
401
- /* @__PURE__ */ o(Ue, {})
402
+ /* @__PURE__ */ o(je, {})
402
403
  ]
403
404
  }
404
405
  )
405
406
  ] }) })
406
407
  ] });
407
408
  }
408
- const Ye = 400, Yt = X(xt, {
409
+ const et = 400, nn = X(At, {
409
410
  shouldForwardProp: (e) => (
410
411
  // Note we do want anchor to be forwarded to the Drawer component
411
412
  ![
@@ -419,7 +420,7 @@ const Ye = 400, Yt = X(xt, {
419
420
  ),
420
421
  name: "SidePanelDrawer"
421
422
  })(
422
- ({ width: e, debugOpacity: t = !1, anchor: n, navBarOpen: r, navBarWidthOpen: a, navBarWidthClosed: s }) => ({
423
+ ({ width: e, debugOpacity: t = !1, anchor: n, navBarOpen: r, navBarWidthOpen: a, navBarWidthClosed: l }) => ({
423
424
  width: e,
424
425
  "& .MuiDrawer-paper": i(i({
425
426
  position: "absolute",
@@ -430,12 +431,12 @@ const Ye = 400, Yt = X(xt, {
430
431
  }, t && {
431
432
  opacity: "50%"
432
433
  }), n === "left" && i({
433
- marginLeft: `${s}px`
434
+ marginLeft: `${l}px`
434
435
  }, r && {
435
436
  marginLeft: `${a}px`
436
437
  }))
437
438
  })
438
- ), Jt = X(A, {
439
+ ), on = X(T, {
439
440
  shouldForwardProp: (e) => !["anchor"].includes(e)
440
441
  })(({ theme: e, anchor: t }) => x(i({
441
442
  display: "flex",
@@ -455,26 +456,26 @@ const Ye = 400, Yt = X(xt, {
455
456
  marginRight: t === "right" ? e.spacing(2) : 0
456
457
  }
457
458
  }));
458
- function $e({
459
+ function Be({
459
460
  children: e,
460
461
  anchor: t = "left",
461
462
  open: n,
462
463
  onClose: r = () => {
463
464
  },
464
465
  titleText: a = "",
465
- width: s = Ye,
466
- showCloseArrow: c = !0,
466
+ width: l = et,
467
+ showCloseArrow: p = !0,
467
468
  debugOpacity: u = !1,
468
- headerBoxProps: l = {},
469
+ headerBoxProps: s = {},
469
470
  onOpened: d,
470
471
  onClosed: v,
471
- "data-testid": m,
472
+ "data-testid": f,
472
473
  navBarOpen: C = !1,
473
- navBarWidthOpen: f = 0,
474
- navBarWidthClosed: w = 0
474
+ navBarWidthOpen: m = 0,
475
+ navBarWidthClosed: I = 0
475
476
  }) {
476
- return /* @__PURE__ */ p(
477
- Yt,
477
+ return /* @__PURE__ */ c(
478
+ nn,
478
479
  {
479
480
  SlideProps: {
480
481
  onEntered: () => d == null ? void 0 : d(),
@@ -483,32 +484,32 @@ function $e({
483
484
  variant: "persistent",
484
485
  anchor: t,
485
486
  open: n,
486
- width: s,
487
+ width: l,
487
488
  debugOpacity: u,
488
- "data-testid": m,
489
+ "data-testid": f,
489
490
  navBarOpen: C,
490
- navBarWidthOpen: f,
491
- navBarWidthClosed: w,
491
+ navBarWidthOpen: m,
492
+ navBarWidthClosed: I,
492
493
  children: [
493
- /* @__PURE__ */ o(Jt, x(i({ anchor: t }, l), { children: t === "left" ? /* @__PURE__ */ p(_, { children: [
494
- /* @__PURE__ */ o(P, { variant: "h6", color: "inherit", component: "div", children: a }),
495
- c && /* @__PURE__ */ p(V, { onClick: r, size: "large", "aria-label": "Close left side panel", children: [
496
- /* @__PURE__ */ o(Ue, { "data-testid": "arrowbackicon" }),
494
+ /* @__PURE__ */ o(on, x(i({ anchor: t }, s), { children: t === "left" ? /* @__PURE__ */ c(M, { children: [
495
+ /* @__PURE__ */ o($, { variant: "h6", color: "inherit", component: "div", children: a }),
496
+ p && /* @__PURE__ */ c(V, { onClick: r, size: "large", "aria-label": "Close left side panel", children: [
497
+ /* @__PURE__ */ o(je, { "data-testid": "arrowbackicon" }),
497
498
  " "
498
499
  ] })
499
- ] }) : /* @__PURE__ */ p(_, { children: [
500
- c && /* @__PURE__ */ p(V, { onClick: r, size: "large", "aria-label": "Close right side panel", children: [
501
- /* @__PURE__ */ o(Ge, {}),
500
+ ] }) : /* @__PURE__ */ c(M, { children: [
501
+ p && /* @__PURE__ */ c(V, { onClick: r, size: "large", "aria-label": "Close right side panel", children: [
502
+ /* @__PURE__ */ o(qe, {}),
502
503
  " "
503
504
  ] }),
504
- /* @__PURE__ */ o(P, { variant: "h6", color: "inherit", component: "div", children: a })
505
+ /* @__PURE__ */ o($, { variant: "h6", color: "inherit", component: "div", children: a })
505
506
  ] }) })),
506
507
  e
507
508
  ]
508
509
  }
509
510
  );
510
511
  }
511
- const Kt = X("div", {
512
+ const rn = X("div", {
512
513
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
513
514
  name: "PanelAwareMargins"
514
515
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
@@ -531,7 +532,7 @@ const Kt = X("div", {
531
532
  }),
532
533
  marginRight: `${(a = n == null ? void 0 : n.width) != null ? a : 0}px`
533
534
  });
534
- }), Zt = X(Me, {
535
+ }), an = X(ze, {
535
536
  name: "PageContainer"
536
537
  })(({ theme: e }) => ({
537
538
  // Horizontal padding comes from the Container's gutter
@@ -540,32 +541,32 @@ const Kt = X("div", {
540
541
  })), ue = !1, ge = !1, Z = {
541
542
  titleText: "",
542
543
  flavour: "push",
543
- width: Ye,
544
+ width: et,
544
545
  arrowButtons: "both",
545
546
  startOpen: !1,
546
547
  open: void 0,
547
548
  onChangeOpen: void 0,
548
- content: /* @__PURE__ */ o(_, {}),
549
+ content: /* @__PURE__ */ o(M, {}),
549
550
  onOpened: void 0,
550
551
  onClosed: void 0,
551
552
  dataTestId: void 0
552
553
  };
553
- function Qn({
554
+ function so({
554
555
  children: e,
555
556
  titleText: t = "",
556
557
  leftPanel: n,
557
558
  rightPanel: r,
558
559
  sidePanelsAreMutuallyExclusive: a = !0,
559
- debugOpacity: s = !1,
560
- pageContainerProps: c,
560
+ debugOpacity: l = !1,
561
+ pageContainerProps: p,
561
562
  pageContentDataTestId: u,
562
- topBarDataTestId: l,
563
+ topBarDataTestId: s,
563
564
  navBarOpen: d,
564
565
  navBarWidthOpen: v,
565
- navBarWidthClosed: m
566
+ navBarWidthClosed: f
566
567
  }) {
567
- const [C, f] = O(ue), [w, S] = O(ge), [D, T] = O(ue), [k, H] = O(ge), R = n !== void 0, W = r !== void 0, {
568
- titleText: I,
568
+ const [C, m] = D(ue), [I, A] = D(ge), [w, S] = D(ue), [B, H] = D(ge), R = n !== void 0, W = r !== void 0, {
569
+ titleText: O,
569
570
  content: q,
570
571
  flavour: j,
571
572
  open: z,
@@ -573,76 +574,76 @@ function Qn({
573
574
  width: g,
574
575
  arrowButtons: h,
575
576
  startOpen: L,
576
- onOpened: at,
577
- onClosed: st,
578
- dataTestId: lt
577
+ onOpened: ct,
578
+ onClosed: pt,
579
+ dataTestId: ut
579
580
  } = n ? i(i({}, Z), n) : i({}, Z), {
580
- titleText: dt,
581
- content: ct,
581
+ titleText: gt,
582
+ content: ht,
582
583
  flavour: me,
583
584
  open: ie,
584
585
  onChangeOpen: ve,
585
586
  width: ae,
586
- arrowButtons: Q,
587
- startOpen: Y,
588
- onOpened: pt,
589
- onClosed: ut,
590
- dataTestId: gt
587
+ arrowButtons: Y,
588
+ startOpen: Q,
589
+ onOpened: ft,
590
+ onClosed: mt,
591
+ dataTestId: vt
591
592
  } = r ? i(i({}, Z), r) : i({}, Z);
592
- ne(() => {
593
- L !== ue && (f(L), T(L));
594
- }, [L]), ne(() => {
595
- Y !== ge && (S(Y), H(Y));
596
- }, [Y]);
597
- const se = z === void 0 ? C : z, le = ie === void 0 ? w : ie, xe = (B) => {
598
- z === void 0 && (f(B), a && W && (B ? (S(!1), H(w)) : S(k))), G && G(B);
599
- }, Ce = (B) => {
600
- ie === void 0 && (S(B), a && R && (B ? (f(!1), T(C)) : f(D))), ve && ve(B);
593
+ oe(() => {
594
+ L !== ue && (m(L), S(L));
595
+ }, [L]), oe(() => {
596
+ Q !== ge && (A(Q), H(Q));
597
+ }, [Q]);
598
+ const se = z === void 0 ? C : z, le = ie === void 0 ? I : ie, xe = (N) => {
599
+ z === void 0 && (m(N), a && W && (N ? (A(!1), H(I)) : A(B))), G && G(N);
600
+ }, Ce = (N) => {
601
+ ie === void 0 && (A(N), a && R && (N ? (m(!1), S(C)) : m(w))), ve && ve(N);
601
602
  };
602
- return /* @__PURE__ */ p(A, { children: [
603
+ return /* @__PURE__ */ c(T, { children: [
603
604
  R && /* @__PURE__ */ o(
604
- $e,
605
+ Be,
605
606
  {
606
- "data-testid": lt,
607
+ "data-testid": ut,
607
608
  anchor: "left",
608
609
  open: se,
609
610
  onClose: () => xe(!1),
610
611
  width: g,
611
- titleText: I,
612
- debugOpacity: s,
612
+ titleText: O,
613
+ debugOpacity: l,
613
614
  showCloseArrow: h === "both" || h === "close",
614
- onOpened: at,
615
- onClosed: st,
615
+ onOpened: ct,
616
+ onClosed: pt,
616
617
  navBarOpen: d,
617
618
  navBarWidthOpen: v,
618
- navBarWidthClosed: m,
619
+ navBarWidthClosed: f,
619
620
  children: q
620
621
  }
621
622
  ),
622
623
  W && /* @__PURE__ */ o(
623
- $e,
624
+ Be,
624
625
  {
625
- "data-testid": gt,
626
+ "data-testid": vt,
626
627
  anchor: "right",
627
628
  open: le,
628
629
  onClose: () => Ce(!1),
629
630
  width: ae,
630
- titleText: dt,
631
- debugOpacity: s,
632
- showCloseArrow: Q === "both" || Q === "close",
633
- onOpened: pt,
634
- onClosed: ut,
631
+ titleText: gt,
632
+ debugOpacity: l,
633
+ showCloseArrow: Y === "both" || Y === "close",
634
+ onOpened: ft,
635
+ onClosed: mt,
635
636
  navBarOpen: d,
636
637
  navBarWidthOpen: v,
637
- navBarWidthClosed: m,
638
- children: ct
638
+ navBarWidthClosed: f,
639
+ children: ht
639
640
  }
640
641
  ),
641
642
  /* @__PURE__ */ o(
642
- Qt,
643
+ tn,
643
644
  i(i({
644
645
  titleText: t,
645
- "data-testid": l
646
+ "data-testid": s
646
647
  }, R && j === "push" ? {
647
648
  leftPanel: {
648
649
  open: se,
@@ -655,12 +656,12 @@ function Qn({
655
656
  open: le,
656
657
  width: ae,
657
658
  onOpen: () => Ce(!0),
658
- showOpenArrow: Q === "both" || Q === "open"
659
+ showOpenArrow: Y === "both" || Y === "open"
659
660
  }
660
661
  } : {})
661
662
  ),
662
663
  /* @__PURE__ */ o(
663
- Kt,
664
+ rn,
664
665
  x(i(i({}, j === "push" ? {
665
666
  leftPanel: {
666
667
  open: se,
@@ -672,39 +673,11 @@ function Qn({
672
673
  width: ae
673
674
  }
674
675
  } : {}), {
675
- children: /* @__PURE__ */ o(Zt, x(i({ "data-testid": u }, c), { children: e }))
676
+ children: /* @__PURE__ */ o(an, x(i({ "data-testid": u }, p), { children: e }))
676
677
  })
677
678
  )
678
679
  ] });
679
680
  }
680
- const en = 64, tn = 64, nn = 256, fe = $(!0), Je = $(nn), Ke = $(tn), Ze = $(""), et = $(en), tt = $(void 0), on = "TopBar", rn = {
681
- titleText: `${on}-titleText`
682
- };
683
- function an({ titleText: e = "", height: t, "data-testid": n }) {
684
- const r = Ft(fe);
685
- return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ p(
686
- oe,
687
- {
688
- square: !0,
689
- elevation: 0,
690
- sx: {
691
- width: "100%",
692
- position: "sticky",
693
- color: "primary.contrastText",
694
- backgroundColor: "primary.main",
695
- display: "flex",
696
- alignItems: "center",
697
- gap: 2,
698
- flexShrink: 0,
699
- height: t
700
- },
701
- children: [
702
- /* @__PURE__ */ o(V, { size: "medium", color: "inherit", sx: { padding: 1.5 }, onClick: () => r((s) => !s), children: /* @__PURE__ */ o(Et, { fontSize: "medium" }) }),
703
- /* @__PURE__ */ o(P, { className: rn.titleText, variant: "h6", children: e })
704
- ]
705
- }
706
- ) });
707
- }
708
681
  const ee = "Navbar", U = {
709
682
  root: `${ee}-root`,
710
683
  menuButton: `${ee}-menuButton`,
@@ -713,7 +686,7 @@ const ee = "Navbar", U = {
713
686
  // userInfoHolder: `${PREFIX}-userInfoHolder`,
714
687
  // settings: `${PREFIX}-settings`,
715
688
  // pieChartIcon: `${PREFIX}-pieChartIcon`,
716
- }, sn = M("div", { name: "NavBar" })(({ theme: e }) => ({
689
+ }, sn = _("div", { name: "NavBar" })(({ theme: e }) => ({
717
690
  [`&.${U.root}`]: {
718
691
  display: "flex"
719
692
  },
@@ -732,7 +705,7 @@ const ee = "Navbar", U = {
732
705
  // marginTop: '64px',
733
706
  // marginBottom: '16px',
734
707
  // },
735
- })), nt = (e, t) => {
708
+ })), tt = (e, t) => {
736
709
  var n, r;
737
710
  return {
738
711
  height: `calc(100vh - ${t})`,
@@ -743,42 +716,73 @@ const ee = "Navbar", U = {
743
716
  backgroundColor: (r = (n = e == null ? void 0 : e.navBar) == null ? void 0 : n.backgroundColor) != null ? r : "white"
744
717
  // Provide default so tests don't need to wrap theme provider
745
718
  };
746
- }, ke = (e, t, n) => i({
719
+ }, Ne = (e, t, n) => i({
747
720
  width: t,
748
721
  transition: e.transitions.create("width", {
749
722
  easing: e.transitions.easing.sharp,
750
723
  duration: e.transitions.duration.enteringScreen
751
724
  })
752
- }, nt(e, n)), Be = (e, t, n) => i({
725
+ }, tt(e, n)), Ee = (e, t, n) => i({
753
726
  width: t,
754
727
  transition: e.transitions.create("width", {
755
728
  easing: e.transitions.easing.sharp,
756
729
  duration: e.transitions.duration.leavingScreen
757
730
  }),
758
731
  overflowX: "hidden"
759
- }, nt(e, n)), ln = M(We, {
732
+ }, tt(e, n)), ln = _(Ve, {
760
733
  shouldForwardProp: (e) => !["open", "widthOpen", "widthClosed", "offsetTop"].includes(e)
761
734
  })(({ theme: e, open: t, widthOpen: n, widthClosed: r, offsetTop: a }) => i(i({
762
735
  flexShrink: 0,
763
736
  whiteSpace: "nowrap",
764
737
  boxSizing: "border-box"
765
- }, t && x(i({}, ke(e, n, a)), {
766
- "& .MuiDrawer-paper": ke(e, n, a)
767
- })), !t && x(i({}, Be(e, r, a)), {
768
- "& .MuiDrawer-paper": Be(e, r, a)
738
+ }, t && x(i({}, Ne(e, n, a)), {
739
+ "& .MuiDrawer-paper": Ne(e, n, a)
740
+ })), !t && x(i({}, Ee(e, r, a)), {
741
+ "& .MuiDrawer-paper": Ee(e, r, a)
769
742
  })));
770
743
  function dn({ links: e }) {
771
744
  return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
772
745
  }
773
- function cn({
746
+ function cn(e) {
747
+ let t = 0;
748
+ for (let n = 0, r = e.length; n < r; n++) {
749
+ const a = e.charCodeAt(n);
750
+ t = (t << 5) - t + a, t |= 0;
751
+ }
752
+ return t;
753
+ }
754
+ const te = {
755
+ width: "5rem",
756
+ height: "5rem"
757
+ }, Fe = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], pn = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
758
+ function un({ user: e, domainCode: t }) {
759
+ return /* @__PURE__ */ c(T, { marginY: "2rem", display: "flex", flexDirection: "column", alignItems: "center", gap: "1rem", children: [
760
+ e != null && e.name ? /* @__PURE__ */ o(
761
+ Ie,
762
+ {
763
+ src: e == null ? void 0 : e.picture,
764
+ sx: x(i({}, te), {
765
+ bgcolor: Fe[Math.abs(cn(e.name)) % Fe.length]
766
+ }),
767
+ children: pn(e.name)
768
+ }
769
+ ) : /* @__PURE__ */ o(Ie, { sx: te }),
770
+ /* @__PURE__ */ c(T, { alignItems: "center", display: "flex", flexDirection: "column", children: [
771
+ e != null && e.name ? /* @__PURE__ */ o($, { children: e.name }) : /* @__PURE__ */ o(Te, { animation: !1, width: te.width }),
772
+ t ? /* @__PURE__ */ o($, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Te, { animation: !1, width: te.width })
773
+ ] })
774
+ ] });
775
+ }
776
+ function gn({
774
777
  open: e,
775
778
  offsetTop: t = 0,
776
779
  widthOpen: n,
777
780
  widthClosed: r,
778
781
  "data-testid": a,
779
- top: s,
780
- middle: c,
781
- bottom: u
782
+ top: l,
783
+ middle: p,
784
+ user: u,
785
+ domainCode: s
782
786
  }) {
783
787
  return /* @__PURE__ */ o(sn, { className: U.root, "data-testid": a, children: /* @__PURE__ */ o(
784
788
  ln,
@@ -789,23 +793,21 @@ function cn({
789
793
  widthOpen: n,
790
794
  widthClosed: r,
791
795
  offsetTop: t,
792
- children: /* @__PURE__ */ p(A, { component: "nav", sx: {}, children: [
793
- s && /* @__PURE__ */ p(A, { sx: { flexGrow: 1 }, children: [
794
- s,
795
- /* @__PURE__ */ o(Te, { variant: "middle" })
796
+ children: /* @__PURE__ */ c(T, { component: "nav", sx: {}, children: [
797
+ l && /* @__PURE__ */ c(T, { sx: { flexGrow: 1 }, children: [
798
+ l,
799
+ /* @__PURE__ */ o(Oe, { variant: "middle" })
796
800
  ] }),
797
- Array.isArray(c) ? /* @__PURE__ */ o(dn, { links: c }) : c,
798
- u && /* @__PURE__ */ p(A, { sx: {}, children: [
799
- /* @__PURE__ */ o(Te, { variant: "middle" }),
800
- u
801
- ] })
801
+ Array.isArray(p) ? /* @__PURE__ */ o(dn, { links: p }) : p,
802
+ /* @__PURE__ */ o(Oe, { variant: "middle" }),
803
+ /* @__PURE__ */ o(un, { user: u, domainCode: s })
802
804
  ] })
803
805
  }
804
806
  ) });
805
807
  }
806
- function pn({ children: e, topBarHeight: t }) {
808
+ function hn({ children: e, topBarHeight: t }) {
807
809
  return /* @__PURE__ */ o(
808
- A,
810
+ T,
809
811
  {
810
812
  sx: {
811
813
  overflow: "auto",
@@ -815,7 +817,7 @@ function pn({ children: e, topBarHeight: t }) {
815
817
  flexGrow: 1
816
818
  },
817
819
  children: /* @__PURE__ */ o(
818
- Me,
820
+ ze,
819
821
  {
820
822
  component: "main",
821
823
  id: "main-content",
@@ -826,40 +828,71 @@ function pn({ children: e, topBarHeight: t }) {
826
828
  }
827
829
  );
828
830
  }
829
- function Yn({
831
+ const fn = 64, mn = 64, vn = 256, fe = k(!0), nt = k(vn), ot = k(mn), rt = k(""), it = k(fn), at = k(void 0), xn = "TopBar", Cn = {
832
+ titleText: `${xn}-titleText`
833
+ };
834
+ function wn({ titleText: e = "", height: t, "data-testid": n }) {
835
+ const r = Mt(fe);
836
+ return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ c(
837
+ We,
838
+ {
839
+ square: !0,
840
+ elevation: 0,
841
+ sx: {
842
+ width: "100%",
843
+ position: "sticky",
844
+ color: "primary.contrastText",
845
+ backgroundColor: "primary.main",
846
+ display: "flex",
847
+ alignItems: "center",
848
+ gap: 2,
849
+ flexShrink: 0,
850
+ height: t
851
+ },
852
+ children: [
853
+ /* @__PURE__ */ o(V, { size: "medium", color: "inherit", sx: { padding: 1.5 }, onClick: () => r((l) => !l), children: /* @__PURE__ */ o(Pt, { fontSize: "medium" }) }),
854
+ /* @__PURE__ */ o($, { className: Cn.titleText, variant: "h6", children: e })
855
+ ]
856
+ }
857
+ ) });
858
+ }
859
+ function lo({
830
860
  children: e,
831
861
  initialTitleText: t,
832
862
  initialNavBarOpen: n,
833
863
  pageContainerProps: r,
834
864
  pageContentDataTestId: a,
835
- topBarDataTestId: s,
836
- navBarDataTestId: c,
837
- navBarMiddle: u
865
+ topBarDataTestId: l,
866
+ navBarDataTestId: p,
867
+ navBarMiddle: u,
868
+ user: s,
869
+ domainCode: d
838
870
  }) {
839
- const [l, d] = E(fe), [v] = E(Je), [m] = E(Ke), [C, f] = E(Ze), [w] = E(et), [S] = E(tt);
840
- return ne(() => {
841
- t !== void 0 && f(t);
842
- }, [t, f]), ne(() => {
843
- n !== void 0 && d(n);
844
- }, [n, d]), /* @__PURE__ */ p(A, { children: [
845
- /* @__PURE__ */ o(Ct, {}),
846
- /* @__PURE__ */ o(an, { titleText: C, "data-testid": s, height: w }),
847
- /* @__PURE__ */ p(A, { sx: { display: "flex" }, children: [
871
+ const [v, f] = y(fe), [C] = y(nt), [m] = y(ot), [I, A] = y(rt), [w] = y(it), [S] = y(at);
872
+ return oe(() => {
873
+ t !== void 0 && A(t);
874
+ }, [t, A]), oe(() => {
875
+ n !== void 0 && f(n);
876
+ }, [n, f]), /* @__PURE__ */ c(T, { children: [
877
+ /* @__PURE__ */ o(St, {}),
878
+ /* @__PURE__ */ o(wn, { titleText: I, "data-testid": l, height: w }),
879
+ /* @__PURE__ */ c(T, { sx: { display: "flex" }, children: [
848
880
  /* @__PURE__ */ o(
849
- cn,
881
+ gn,
850
882
  {
851
- open: l,
883
+ open: v,
852
884
  top: S,
853
885
  middle: u,
854
- bottom: l ? /* @__PURE__ */ o(A, { sx: { padding: 2 }, children: /* @__PURE__ */ o(oe, { sx: { padding: 2, textWrap: "initial" }, variant: "outlined", children: "Placeholder for standard user settings, domain selector etc. It should be at the very bottom, but WIP" }) }) : /* @__PURE__ */ o(A, { sx: { paddingTop: 2 }, children: /* @__PURE__ */ o(oe, { sx: { padding: 2, textWrap: "initial" }, variant: "outlined", children: "WIP" }) }),
855
- widthOpen: v,
886
+ user: s,
887
+ domainCode: d,
888
+ widthOpen: C,
856
889
  widthClosed: m,
857
890
  offsetTop: w,
858
- "data-testid": c
891
+ "data-testid": p
859
892
  }
860
893
  ),
861
894
  /* @__PURE__ */ o(
862
- pn,
895
+ hn,
863
896
  x(i({
864
897
  "data-testid": a,
865
898
  topBarHeight: w
@@ -870,75 +903,75 @@ function Yn({
870
903
  ] })
871
904
  ] });
872
905
  }
873
- const un = {
906
+ const bn = {
874
907
  autoHideDuration: 6e3,
875
908
  anchorOrigin: { vertical: "top", horizontal: "center" },
876
909
  // The default is false. If we prefer timer to continue when window loses
877
910
  // focus, change to true
878
911
  disableWindowBlurListener: !1
879
- }, gn = {
912
+ }, An = {
880
913
  shouldClose: (e, t) => t !== "clickaway"
881
- }, Ne = {
914
+ }, Le = {
882
915
  message: "",
883
916
  severity: "info",
884
917
  variant: "standard",
885
918
  progressIndicator: void 0
886
919
  // Can use 'circular' or 'linear'
887
- }, Ee = 100, Fe = 2e3, hn = 2e3, fn = (() => {
920
+ }, ye = 100, Pe = 2e3, Sn = 2e3, In = (() => {
888
921
  let e = 0;
889
922
  return () => (e += 1, e);
890
- })(), mn = {
923
+ })(), Tn = {
891
924
  borderBottomLeftRadius: "0px",
892
925
  borderBottomRightRadius: "0px"
893
- }, vn = {}, xn = {}, ot = ye(null);
894
- function Cn(s) {
895
- var c = s, {
896
- overrideState: e = vn,
897
- overrideActions: t = xn,
898
- shouldClose: n = gn.shouldClose,
926
+ }, On = {}, Dn = {}, st = He(null);
927
+ function $n(l) {
928
+ var p = l, {
929
+ overrideState: e = On,
930
+ overrideActions: t = Dn,
931
+ shouldClose: n = An.shouldClose,
899
932
  children: r
900
- } = c, a = Ae(c, [
933
+ } = p, a = Ae(p, [
901
934
  "overrideState",
902
935
  "overrideActions",
903
936
  "shouldClose",
904
937
  "children"
905
938
  ]);
906
939
  var G;
907
- const [{ open: u }, l] = O({ open: !1 }), d = ce([]), v = ce(Date.now()), m = ce(0), C = te((g) => {
908
- l({ open: g });
909
- }, []), f = te((g = {}) => {
910
- m.current += 1, d.current.length >= Ee && Date.now() - v.current >= Fe && (v.current = Date.now(), console.error(
911
- `SaladBarProvider: MAX_QUEUE_LENGTH (${Ee}) hit ${m.current} times in last ${Fe}ms)`
912
- ), m.current = 0);
913
- const h = i(x(i({}, Ne), {
914
- key: fn()
940
+ const [{ open: u }, s] = D({ open: !1 }), d = ce([]), v = ce(Date.now()), f = ce(0), C = ne((g) => {
941
+ s({ open: g });
942
+ }, []), m = ne((g = {}) => {
943
+ f.current += 1, d.current.length >= ye && Date.now() - v.current >= Pe && (v.current = Date.now(), console.error(
944
+ `SaladBarProvider: MAX_QUEUE_LENGTH (${ye}) hit ${f.current} times in last ${Pe}ms)`
945
+ ), f.current = 0);
946
+ const h = i(x(i({}, Le), {
947
+ key: In()
915
948
  }), g);
916
- return d.current.push(h), d.current.length === 1 && l({ open: !0 }), h.key;
917
- }, []), w = (g = "", h = {}) => f(i({ message: g, severity: "success" }, h)), S = (g = "", h = {}) => f(i({ message: g, severity: "info" }, h)), D = (g = "", h = {}) => f(i({ message: g, severity: "warning" }, h)), T = (g = "", h = {}) => f(i({ message: g, severity: "error" }, h)), k = (g) => {
949
+ return d.current.push(h), d.current.length === 1 && s({ open: !0 }), h.key;
950
+ }, []), I = (g = "", h = {}) => m(i({ message: g, severity: "success" }, h)), A = (g = "", h = {}) => m(i({ message: g, severity: "info" }, h)), w = (g = "", h = {}) => m(i({ message: g, severity: "warning" }, h)), S = (g = "", h = {}) => m(i({ message: g, severity: "error" }, h)), B = (g) => {
918
951
  const h = d.current.findIndex((L) => L.key === g);
919
952
  if (h !== -1)
920
- return h === 0 ? (l({ open: !1 }), d.current[0]) : d.current.splice(h, 1);
953
+ return h === 0 ? (s({ open: !1 }), d.current[0]) : d.current.splice(h, 1);
921
954
  }, H = (g, h) => {
922
- n(g, h) && l({ open: !1 });
955
+ n(g, h) && s({ open: !1 });
923
956
  }, R = () => {
924
957
  }, W = () => {
925
- d.current.shift(), d.current.length > 0 && l({ open: !0 });
926
- }, I = (G = d.current[0]) != null ? G : i({}, Ne), q = {};
927
- "autoHideDuration" in I && (q.autoHideDuration = I.autoHideDuration);
928
- const j = i(i({}, un), a), z = i(i({
958
+ d.current.shift(), d.current.length > 0 && s({ open: !0 });
959
+ }, O = (G = d.current[0]) != null ? G : i({}, Le), q = {};
960
+ "autoHideDuration" in O && (q.autoHideDuration = O.autoHideDuration);
961
+ const j = i(i({}, bn), a), z = i(i({
929
962
  open: u,
930
963
  setOpen: C,
931
- enqueueNotification: f,
932
- enqueueSuccessNotification: w,
933
- enqueueInfoNotification: S,
934
- enqueueWarningNotification: D,
935
- enqueueErrorNotification: T,
936
- removeNotification: k
964
+ enqueueNotification: m,
965
+ enqueueSuccessNotification: I,
966
+ enqueueInfoNotification: A,
967
+ enqueueWarningNotification: w,
968
+ enqueueErrorNotification: S,
969
+ removeNotification: B
937
970
  }, e), t);
938
- return /* @__PURE__ */ p(ot.Provider, { value: z, children: [
971
+ return /* @__PURE__ */ c(st.Provider, { value: z, children: [
939
972
  r,
940
973
  /* @__PURE__ */ o(
941
- wt,
974
+ It,
942
975
  x(i(i({}, j), q), {
943
976
  open: u,
944
977
  onClose: H,
@@ -946,46 +979,46 @@ function Cn(s) {
946
979
  onExited: W,
947
980
  onExit: R
948
981
  },
949
- sx: { zIndex: hn },
950
- children: /* @__PURE__ */ p("div", { children: [
982
+ sx: { zIndex: Sn },
983
+ children: /* @__PURE__ */ c("div", { children: [
951
984
  /* @__PURE__ */ o(
952
- bt,
985
+ Tt,
953
986
  {
954
987
  onClose: (g) => H(g, "closeAlert"),
955
- severity: I.severity,
988
+ severity: O.severity,
956
989
  variant: "filled",
957
- icon: I.progressIndicator === "circular" ? /* @__PURE__ */ o(He, { size: "1em" }) : void 0,
958
- style: I.progressIndicator === "linear" ? mn : void 0,
959
- children: I.message
990
+ icon: O.progressIndicator === "circular" ? /* @__PURE__ */ o(Ge, { size: "1em" }) : void 0,
991
+ style: O.progressIndicator === "linear" ? Tn : void 0,
992
+ children: O.message
960
993
  }
961
994
  ),
962
- I.progressIndicator === "linear" && /* @__PURE__ */ o(At, { color: "primary" })
995
+ O.progressIndicator === "linear" && /* @__PURE__ */ o(Ot, { color: "primary" })
963
996
  ] })
964
997
  })
965
998
  )
966
999
  ] });
967
1000
  }
968
- function wn() {
969
- const e = _e(ot);
1001
+ function kn() {
1002
+ const e = Re(st);
970
1003
  if (e === null)
971
1004
  throw new he("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
972
1005
  return e;
973
1006
  }
974
- const Jn = re(
975
- (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: r }) => /* @__PURE__ */ o(Cn, x(i({}, e), { overrideState: t, overrideActions: n, children: r }))
976
- ), bn = Pt(), Kn = ({
1007
+ const co = re(
1008
+ (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: r }) => /* @__PURE__ */ o($n, x(i({}, e), { overrideState: t, overrideActions: n, children: r }))
1009
+ ), Bn = _t(), po = ({
977
1010
  children: e,
978
1011
  store: t
979
- }) => /* @__PURE__ */ o(Ve, { store: t != null ? t : bn, children: e }), rt = "domainCode";
980
- var Le;
981
- const Pe = $(
982
- JSON.parse((Le = localStorage.getItem(rt)) != null ? Le : '{"domainCode": ""}').domainCode
983
- ), it = $(
984
- (e) => e(Pe),
1012
+ }) => /* @__PURE__ */ o(Ye, { store: t != null ? t : Bn, children: e }), Nn = (...e) => Ht(...e), uo = (...e) => Rt(...e), En = (...e) => En(...e), lt = "domainCode";
1013
+ var _e;
1014
+ const Me = k(
1015
+ JSON.parse((_e = localStorage.getItem(lt)) != null ? _e : '{"domainCode": ""}').domainCode
1016
+ ), dt = k(
1017
+ (e) => e(Me),
985
1018
  (e, t, n) => {
986
- t(Pe, n), localStorage.setItem(rt, JSON.stringify({ domainCode: n }));
1019
+ t(Me, n), localStorage.setItem(lt, JSON.stringify({ domainCode: n }));
987
1020
  }
988
- ), An = {
1021
+ ), Fn = {
989
1022
  act: "ACT",
990
1023
  nsw: "NSW",
991
1024
  nt: "NT",
@@ -997,76 +1030,76 @@ const Pe = $(
997
1030
  ag: "AG",
998
1031
  fedmps: "Fedmps",
999
1032
  "": ""
1000
- }, Sn = (e) => {
1033
+ }, Ln = (e) => {
1001
1034
  var t;
1002
- return e === null ? "N/A" : (t = An[e]) != null ? t : "";
1003
- }, Zn = ({
1035
+ return e === null ? "N/A" : (t = Fn[e]) != null ? t : "";
1036
+ }, go = ({
1004
1037
  isLoading: e,
1005
1038
  isOpen: t,
1006
1039
  onClose: n,
1007
1040
  domainOptions: r,
1008
1041
  applicationName: a,
1009
- handleLogout: s
1042
+ handleLogout: l
1010
1043
  }) => {
1011
- const [c, u] = E(it), [l, d] = O(c), { enqueueSuccessNotification: v } = wn(), m = r.length === 0, C = !!c && !r.includes(c) && !r.includes(l), f = !c || m || C, w = () => K(void 0, null, function* () {
1012
- l ? (u(l), v(`Set domain to ${l}`), n()) : u("");
1013
- }), S = () => K(void 0, null, function* () {
1014
- c && !m && !C ? (d(c), n()) : f && s();
1044
+ const [p, u] = Nn(dt), [s, d] = D(p), { enqueueSuccessNotification: v } = kn(), f = r.length === 0, C = !!p && !r.includes(p) && !r.includes(s), m = !p || f || C, I = () => K(void 0, null, function* () {
1045
+ s ? (u(s), v(`Set domain to ${s}`), n()) : u("");
1046
+ }), A = () => K(void 0, null, function* () {
1047
+ p && !f && !C ? (d(p), n()) : m && l();
1015
1048
  });
1016
- let D;
1017
- return m ? D = "Unable to retrieve your active organisations. Try logging in again." : C && (D = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ p(
1018
- Vt,
1049
+ let w;
1050
+ return f ? w = "Unable to retrieve your active organisations. Try logging in again." : C && (w = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ c(
1051
+ Jt,
1019
1052
  {
1020
1053
  isOpen: t,
1021
1054
  dialogTitle: "Select an organisation",
1022
1055
  primaryButton: {
1023
1056
  text: "Confirm",
1024
- onClick: w,
1025
- disabled: !l || m || C,
1057
+ onClick: I,
1058
+ disabled: !s || f || C,
1026
1059
  buttonColor: "primary"
1027
1060
  },
1028
1061
  secondaryButton: {
1029
- text: f ? "Logout" : "Cancel",
1030
- onClick: S
1062
+ text: m ? "Logout" : "Cancel",
1063
+ onClick: A
1031
1064
  },
1032
- onClose: f ? () => {
1065
+ onClose: m ? () => {
1033
1066
  } : n,
1034
1067
  children: [
1035
- /* @__PURE__ */ p(P, { marginBottom: 2, children: [
1068
+ /* @__PURE__ */ c($, { marginBottom: 2, children: [
1036
1069
  "Select the default organisation that you want to use with the ",
1037
1070
  a,
1038
1071
  "."
1039
1072
  ] }),
1040
1073
  /* @__PURE__ */ o(
1041
- St,
1074
+ Dt,
1042
1075
  {
1043
1076
  loading: e,
1044
1077
  multiple: !1,
1045
1078
  disableClearable: !1,
1046
- value: l !== "" ? l : null,
1047
- onChange: (T, k) => d(k != null ? k : ""),
1048
- getOptionLabel: Sn,
1079
+ value: s !== "" ? s : null,
1080
+ onChange: (S, B) => d(B != null ? B : ""),
1081
+ getOptionLabel: Ln,
1049
1082
  options: [...r],
1050
- renderInput: (T) => /* @__PURE__ */ o(
1051
- Tt,
1052
- x(i({}, T), {
1083
+ renderInput: (S) => /* @__PURE__ */ o(
1084
+ $t,
1085
+ x(i({}, S), {
1053
1086
  variant: "filled",
1054
1087
  label: "Select organisation",
1055
- InputProps: x(i({}, T.InputProps), {
1056
- endAdornment: /* @__PURE__ */ p(_, { children: [
1057
- e ? /* @__PURE__ */ o(He, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
1058
- T.InputProps.endAdornment
1088
+ InputProps: x(i({}, S.InputProps), {
1089
+ endAdornment: /* @__PURE__ */ c(M, { children: [
1090
+ e ? /* @__PURE__ */ o(Ge, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
1091
+ S.InputProps.endAdornment
1059
1092
  ] })
1060
1093
  })
1061
1094
  })
1062
1095
  )
1063
1096
  }
1064
1097
  ),
1065
- D && /* @__PURE__ */ o(It, { error: !0, children: D })
1098
+ w && /* @__PURE__ */ o(kt, { error: !0, children: w })
1066
1099
  ]
1067
1100
  }
1068
1101
  );
1069
- }, eo = Re({
1102
+ }, ho = Ue({
1070
1103
  palette: {
1071
1104
  primary: {
1072
1105
  dark: "#00A651",
@@ -1117,7 +1150,7 @@ const Pe = $(
1117
1150
  navBar: {
1118
1151
  backgroundColor: "#E8E8E8"
1119
1152
  }
1120
- }), to = Re({
1153
+ }), fo = Ue({
1121
1154
  palette: {
1122
1155
  primary: {
1123
1156
  main: "#007236",
@@ -1208,24 +1241,24 @@ const Pe = $(
1208
1241
  navBar: {
1209
1242
  backgroundColor: "#E8E8E8"
1210
1243
  }
1211
- }), Tn = {
1212
- domainCode: it,
1244
+ }), yn = {
1245
+ domainCode: dt,
1213
1246
  navBarOpen: fe,
1214
- navBarWidthOpen: Je,
1215
- navBarWidthClosed: Ke,
1216
- titleText: Ze,
1217
- topBarHeight: et,
1218
- navBarTop: tt
1219
- }, no = re(() => ({ children: e }) => /* @__PURE__ */ o(Ve, { children: e })), In = ({
1247
+ navBarWidthOpen: nt,
1248
+ navBarWidthClosed: ot,
1249
+ titleText: rt,
1250
+ topBarHeight: it,
1251
+ navBarTop: at
1252
+ }, mo = re(() => ({ children: e }) => /* @__PURE__ */ o(Ye, { children: e })), Pn = ({
1220
1253
  initialValues: e,
1221
1254
  children: t
1222
- }) => (Lt(e), /* @__PURE__ */ o(_, { children: t })), oo = re(
1255
+ }) => (Wt(e), /* @__PURE__ */ o(M, { children: t })), vo = re(
1223
1256
  (e) => ({ children: t }) => /* @__PURE__ */ o(
1224
- In,
1257
+ Pn,
1225
1258
  {
1226
1259
  initialValues: Object.entries(e).map(
1227
1260
  ([n, r]) => [
1228
- Tn[n],
1261
+ yn[n],
1229
1262
  r
1230
1263
  ]
1231
1264
  ),
@@ -1234,39 +1267,42 @@ const Pe = $(
1234
1267
  )
1235
1268
  );
1236
1269
  export {
1237
- Vt as AgDialog,
1238
- Yn as AppLayout,
1239
- Kn as AtomProvider,
1240
- ot as Context,
1270
+ Jt as AgDialog,
1271
+ lo as AppLayout,
1272
+ po as AtomProvider,
1273
+ st as Context,
1241
1274
  he as ContextError,
1242
- Zn as DomainCodeDialog,
1243
- Un as ExampleComponent,
1244
- In as HydrateAtoms,
1245
- qe as NAVBAR_WIDTH_CLOSED,
1246
- Xe as NAVBAR_WIDTH_OPENED,
1247
- jn as NavBar,
1248
- Xn as NavBarDarkStyledList,
1249
- qn as NavBarLightStyledList,
1250
- zt as NavBarProvider,
1251
- Qn as PageLayout,
1252
- Cn as SaladBarProvider,
1253
- bn as atomStore,
1254
- Ut as buildNavBarState,
1255
- it as domainCodeAtom,
1256
- eo as fed21Theme,
1257
- to as internalAgSystemsTheme,
1258
- y as navBarClasses,
1275
+ go as DomainCodeDialog,
1276
+ no as ExampleComponent,
1277
+ Pn as HydrateAtoms,
1278
+ Je as NAVBAR_WIDTH_CLOSED,
1279
+ Qe as NAVBAR_WIDTH_OPENED,
1280
+ ao as NavBar,
1281
+ ro as NavBarDarkStyledList,
1282
+ io as NavBarLightStyledList,
1283
+ jt as NavBarProvider,
1284
+ so as PageLayout,
1285
+ $n as SaladBarProvider,
1286
+ Bn as atomStore,
1287
+ Qt as buildNavBarState,
1288
+ dt as domainCodeAtom,
1289
+ ho as fed21Theme,
1290
+ fo as internalAgSystemsTheme,
1291
+ P as navBarClasses,
1259
1292
  fe as navBarOpenAtom,
1260
- tt as navBarTopAtom,
1261
- Ke as navBarWidthClosedAtom,
1262
- Je as navBarWidthOpenAtom,
1263
- Ze as titleTextAtom,
1264
- et as topBarHeightAtom,
1265
- Gt as useNavBar,
1266
- wn as useSaladBar,
1267
- no as withAtomProvider,
1268
- Vn as withNavBarProvider,
1269
- oo as withOverrideDefaults,
1270
- Jn as withSaladBarProvider
1293
+ at as navBarTopAtom,
1294
+ ot as navBarWidthClosedAtom,
1295
+ nt as navBarWidthOpenAtom,
1296
+ rt as titleTextAtom,
1297
+ it as topBarHeightAtom,
1298
+ Nn as useLibraryAtom,
1299
+ En as useLibraryAtomValue,
1300
+ Yt as useNavBar,
1301
+ kn as useSaladBar,
1302
+ uo as useSetLibraryAtom,
1303
+ mo as withAtomProvider,
1304
+ oo as withNavBarProvider,
1305
+ vo as withOverrideDefaults,
1306
+ co as withSaladBarProvider
1271
1307
  };
1272
1308
  //# sourceMappingURL=index.js.map