@australiangreens/ag-internal-components 0.3.1 → 0.3.3
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/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/FetchAutocomplete/FetchAutocomplete.d.ts +20 -2
- package/dist/components/FetchAutocomplete/FetchAutocomplete.d.ts.map +1 -1
- package/dist/components/FetchAutocomplete/const.d.ts +16 -0
- package/dist/components/FetchAutocomplete/const.d.ts.map +1 -0
- package/dist/components/SingleAutocomplete/index.d.ts +8 -1
- package/dist/components/SingleAutocomplete/index.d.ts.map +1 -1
- package/dist/esm/index.js +662 -599
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
1
|
+
var je = Object.defineProperty, et = Object.defineProperties;
|
|
2
|
+
var tt = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var K = Object.getOwnPropertySymbols;
|
|
4
|
+
var le = Object.prototype.hasOwnProperty, ce = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var j = (e, t, o) => t in e ? je(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, p = (e, t) => {
|
|
6
|
+
for (var o in t || (t = {}))
|
|
7
|
+
le.call(t, o) && j(e, o, t[o]);
|
|
8
|
+
if (K)
|
|
9
|
+
for (var o of K(t))
|
|
10
|
+
ce.call(t, o) && j(e, o, t[o]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
12
|
+
}, b = (e, t) => et(e, tt(t));
|
|
13
|
+
var de = (e, t) => {
|
|
14
|
+
var o = {};
|
|
15
15
|
for (var i in e)
|
|
16
|
-
|
|
17
|
-
if (e != null &&
|
|
18
|
-
for (var i of
|
|
19
|
-
t.indexOf(i) < 0 &&
|
|
20
|
-
return
|
|
16
|
+
le.call(e, i) && t.indexOf(i) < 0 && (o[i] = e[i]);
|
|
17
|
+
if (e != null && K)
|
|
18
|
+
for (var i of K(e))
|
|
19
|
+
t.indexOf(i) < 0 && ce.call(e, i) && (o[i] = e[i]);
|
|
20
|
+
return o;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
23
|
-
var
|
|
22
|
+
var ue = (e, t, o) => j(e, typeof t != "symbol" ? t + "" : t, o);
|
|
23
|
+
var M = (e, t, o) => new Promise((i, r) => {
|
|
24
24
|
var s = (l) => {
|
|
25
25
|
try {
|
|
26
|
-
a(
|
|
27
|
-
} catch (
|
|
28
|
-
r(
|
|
26
|
+
a(o.next(l));
|
|
27
|
+
} catch (u) {
|
|
28
|
+
r(u);
|
|
29
29
|
}
|
|
30
30
|
}, c = (l) => {
|
|
31
31
|
try {
|
|
32
|
-
a(
|
|
33
|
-
} catch (
|
|
34
|
-
r(
|
|
32
|
+
a(o.throw(l));
|
|
33
|
+
} catch (u) {
|
|
34
|
+
r(u);
|
|
35
35
|
}
|
|
36
36
|
}, a = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(s, c);
|
|
37
|
-
a((
|
|
37
|
+
a((o = o.apply(e, t)).next());
|
|
38
38
|
});
|
|
39
|
-
import { jsxs as
|
|
40
|
-
import { useState as
|
|
41
|
-
import { Typography as
|
|
42
|
-
import { Cancel as
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import { useQuery as
|
|
46
|
-
import { useAuth0 as
|
|
47
|
-
import { Buffer as
|
|
48
|
-
import
|
|
49
|
-
import { atom as P, useAtom as
|
|
50
|
-
import { createHelper as
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import { useHydrateAtoms as
|
|
54
|
-
import { styled as
|
|
55
|
-
import
|
|
56
|
-
function
|
|
57
|
-
const [t,
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
|
|
39
|
+
import { jsxs as x, Fragment as N, jsx as n } from "react/jsx-runtime";
|
|
40
|
+
import { useState as V, createElement as oe, useEffect as pe, useMemo as ot, createContext as nt, useRef as ee, useCallback as he, useContext as it } from "react";
|
|
41
|
+
import { Typography as E, Button as z, Paper as _e, Dialog as Me, LinearProgress as Te, DialogTitle as Pe, DialogContent as Ne, DialogActions as $e, Autocomplete as ne, TextField as ie, CircularProgress as re, Box as I, Chip as rt, Tooltip as at, Stack as st, Snackbar as lt, Alert as ct, FormHelperText as dt, useTheme as J, useMediaQuery as ut, Drawer as pt, Collapse as ht, Avatar as fe, Fade as ft, Skeleton as me, Toolbar as mt, Divider as ge, Container as gt, IconButton as xt } from "@mui/material";
|
|
42
|
+
import { Cancel as At, ArrowDropDown as Ct, ViewHeadline as St } from "@mui/icons-material";
|
|
43
|
+
import vt from "autosuggest-highlight/match";
|
|
44
|
+
import wt from "autosuggest-highlight/parse";
|
|
45
|
+
import { useQuery as Le } from "@tanstack/react-query";
|
|
46
|
+
import { useAuth0 as ae } from "@auth0/auth0-react";
|
|
47
|
+
import { Buffer as kt } from "buffer";
|
|
48
|
+
import Dt from "@mui/material/Skeleton";
|
|
49
|
+
import { atom as P, useAtom as W, useSetAtom as Oe, useAtomValue as xe } from "jotai";
|
|
50
|
+
import { createHelper as yt } from "souvlaki";
|
|
51
|
+
import bt from "@mui/material/CssBaseline";
|
|
52
|
+
import Ae from "@mui/material/Box";
|
|
53
|
+
import { useHydrateAtoms as Ft } from "jotai/utils";
|
|
54
|
+
import { styled as Re, createTheme as Ue, alpha as te } from "@mui/material/styles";
|
|
55
|
+
import Ce from "react-avatar";
|
|
56
|
+
function Io({ text: e }) {
|
|
57
|
+
const [t, o] = V(0);
|
|
58
|
+
return /* @__PURE__ */ x(N, { children: [
|
|
59
|
+
/* @__PURE__ */ n(E, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
|
|
60
|
+
/* @__PURE__ */ n(E, { variant: "caption", display: "block", children: /* @__PURE__ */ n("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
|
|
61
|
+
/* @__PURE__ */ n(
|
|
62
|
+
z,
|
|
63
63
|
{
|
|
64
64
|
variant: "outlined",
|
|
65
|
-
onClick: () =>
|
|
65
|
+
onClick: () => o((i) => i + 1),
|
|
66
66
|
"aria-label": "Increment",
|
|
67
67
|
children: "Hello I am a button"
|
|
68
68
|
}
|
|
69
69
|
),
|
|
70
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ x("p", { children: [
|
|
71
71
|
"This is some text: ",
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ n("span", { children: e })
|
|
73
73
|
] }),
|
|
74
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ x(_e, { children: [
|
|
75
75
|
"This number will incremember when button pressed: ",
|
|
76
76
|
t
|
|
77
77
|
] })
|
|
78
78
|
] });
|
|
79
79
|
}
|
|
80
|
-
const
|
|
80
|
+
const Be = ({
|
|
81
81
|
isOpen: e,
|
|
82
82
|
dialogTitle: t,
|
|
83
|
-
children:
|
|
83
|
+
children: o,
|
|
84
84
|
maxWidth: i,
|
|
85
85
|
primaryButton: r,
|
|
86
86
|
secondaryButton: s,
|
|
87
87
|
additionalButtons: c,
|
|
88
88
|
onClose: a,
|
|
89
89
|
sx: l,
|
|
90
|
-
"data-testid":
|
|
91
|
-
disableCloseOnBackdropOrEscape:
|
|
92
|
-
isLoading:
|
|
90
|
+
"data-testid": u,
|
|
91
|
+
disableCloseOnBackdropOrEscape: g = !1,
|
|
92
|
+
isLoading: w = !1
|
|
93
93
|
}) => {
|
|
94
|
-
var
|
|
95
|
-
const [
|
|
96
|
-
return /* @__PURE__ */
|
|
97
|
-
|
|
94
|
+
var v, D;
|
|
95
|
+
const [S, A] = V(!1);
|
|
96
|
+
return /* @__PURE__ */ x(
|
|
97
|
+
Me,
|
|
98
98
|
{
|
|
99
99
|
open: e,
|
|
100
|
-
onClose: (
|
|
101
|
-
|
|
100
|
+
onClose: (f, k) => M(null, null, function* () {
|
|
101
|
+
g && (k === "backdropClick" || k === "escapeKeyDown") || S || (s != null && s.onClick ? yield s.onClick() : a());
|
|
102
102
|
}),
|
|
103
103
|
fullWidth: !0,
|
|
104
104
|
maxWidth: i != null ? i : "xs",
|
|
105
|
-
"data-testid":
|
|
105
|
+
"data-testid": u,
|
|
106
106
|
sx: l,
|
|
107
107
|
children: [
|
|
108
|
-
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
|
|
108
|
+
w && /* @__PURE__ */ n(Te, { sx: { height: "4px", marginBottom: "-4px" } }),
|
|
109
|
+
/* @__PURE__ */ n(Pe, { children: t }),
|
|
110
|
+
/* @__PURE__ */ n(Ne, { sx: { "& > :last-child": { marginBottom: 0 } }, children: o }),
|
|
111
|
+
/* @__PURE__ */ x($e, { children: [
|
|
112
|
+
/* @__PURE__ */ n(
|
|
113
|
+
z,
|
|
114
114
|
{
|
|
115
|
-
onClick: (
|
|
115
|
+
onClick: (v = s == null ? void 0 : s.onClick) != null ? v : a,
|
|
116
116
|
"data-testid": s == null ? void 0 : s.testId,
|
|
117
|
-
disabled: (s == null ? void 0 : s.disabled) ||
|
|
117
|
+
disabled: (s == null ? void 0 : s.disabled) || S,
|
|
118
118
|
color: s == null ? void 0 : s.buttonColor,
|
|
119
119
|
children: (D = s == null ? void 0 : s.text) != null ? D : "Cancel"
|
|
120
120
|
}
|
|
121
121
|
),
|
|
122
|
-
c && c.map((
|
|
123
|
-
var
|
|
124
|
-
return /* @__PURE__ */
|
|
125
|
-
|
|
122
|
+
c && c.map((f, k) => {
|
|
123
|
+
var y;
|
|
124
|
+
return /* @__PURE__ */ n(
|
|
125
|
+
z,
|
|
126
126
|
{
|
|
127
|
-
onClick:
|
|
128
|
-
"data-testid":
|
|
129
|
-
disabled: (
|
|
130
|
-
color:
|
|
131
|
-
children: (
|
|
127
|
+
onClick: f == null ? void 0 : f.onClick,
|
|
128
|
+
"data-testid": f == null ? void 0 : f.testId,
|
|
129
|
+
disabled: (f == null ? void 0 : f.disabled) || S,
|
|
130
|
+
color: f == null ? void 0 : f.buttonColor,
|
|
131
|
+
children: (y = f.text) != null ? y : `Button ${k}`
|
|
132
132
|
},
|
|
133
133
|
k
|
|
134
134
|
);
|
|
135
135
|
}),
|
|
136
|
-
r && /* @__PURE__ */
|
|
137
|
-
|
|
136
|
+
r && /* @__PURE__ */ n(
|
|
137
|
+
z,
|
|
138
138
|
{
|
|
139
|
-
onClick: () =>
|
|
140
|
-
var
|
|
141
|
-
|
|
139
|
+
onClick: () => M(null, null, function* () {
|
|
140
|
+
var f;
|
|
141
|
+
A(!0), yield (f = r.onClick) == null ? void 0 : f.call(r), A(!1);
|
|
142
142
|
}),
|
|
143
143
|
"data-testid": r.testId,
|
|
144
|
-
disabled: r.disabled ||
|
|
144
|
+
disabled: r.disabled || S,
|
|
145
145
|
color: r == null ? void 0 : r.buttonColor,
|
|
146
146
|
children: r.text
|
|
147
147
|
}
|
|
@@ -150,244 +150,307 @@ const Le = ({
|
|
|
150
150
|
]
|
|
151
151
|
}
|
|
152
152
|
);
|
|
153
|
-
},
|
|
153
|
+
}, Et = {
|
|
154
|
+
popper: {
|
|
155
|
+
modifiers: [
|
|
156
|
+
{
|
|
157
|
+
name: "offset",
|
|
158
|
+
options: {
|
|
159
|
+
offset: [115, -15]
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
}, He = {
|
|
165
|
+
right: 2
|
|
166
|
+
}, We = ({
|
|
154
167
|
minLength: e,
|
|
155
168
|
preLoadedOptions: t,
|
|
156
|
-
lookup:
|
|
169
|
+
lookup: o,
|
|
157
170
|
label: i,
|
|
158
171
|
inputValue: r
|
|
159
|
-
}) =>
|
|
172
|
+
}) => Le({
|
|
160
173
|
queryFn: () => e && r.length < e ? t != null ? t : [] : t ? t.filter(
|
|
161
174
|
(s) => s.label.toLowerCase().includes(r.toLowerCase())
|
|
162
|
-
) :
|
|
175
|
+
) : o(r),
|
|
163
176
|
queryKey: ["autocomplete", i, r]
|
|
164
177
|
});
|
|
165
|
-
function
|
|
166
|
-
lookup: e = () =>
|
|
178
|
+
function _o({
|
|
179
|
+
lookup: e = () => M(null, null, function* () {
|
|
167
180
|
}),
|
|
168
181
|
enableHighlighting: t = !0,
|
|
169
|
-
onChange:
|
|
182
|
+
onChange: o,
|
|
170
183
|
minLength: i = 0,
|
|
171
184
|
label: r,
|
|
172
185
|
value: s,
|
|
173
186
|
"data-testid": c,
|
|
174
187
|
sx: a,
|
|
175
188
|
boxSx: l,
|
|
176
|
-
textFieldColor:
|
|
177
|
-
textFieldVariant:
|
|
178
|
-
loadingText:
|
|
179
|
-
noOptionsText:
|
|
180
|
-
popupIcon:
|
|
181
|
-
error:
|
|
189
|
+
textFieldColor: u,
|
|
190
|
+
textFieldVariant: g = "filled",
|
|
191
|
+
loadingText: w = "Loading...",
|
|
192
|
+
noOptionsText: S = "No options",
|
|
193
|
+
popupIcon: A = /* @__PURE__ */ n(Ct, {}),
|
|
194
|
+
error: v = !1,
|
|
182
195
|
helperText: D = "",
|
|
183
|
-
preLoadedOptions:
|
|
196
|
+
preLoadedOptions: f = void 0,
|
|
184
197
|
disablePortal: k = !1,
|
|
185
|
-
disableIconFlip:
|
|
198
|
+
disableIconFlip: y = !1,
|
|
199
|
+
chipToolTipSlotProps: _ = Et,
|
|
200
|
+
isPlaceholder: L = !1,
|
|
201
|
+
placeHolderText: O = void 0,
|
|
202
|
+
onRightClick: F = () => {
|
|
203
|
+
},
|
|
204
|
+
disableDefaultRightClickBehaviour: T = !1
|
|
186
205
|
}) {
|
|
187
|
-
const [
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
}, { data:
|
|
191
|
-
inputValue:
|
|
206
|
+
const [R, U] = V(""), B = (h, C) => {
|
|
207
|
+
const $ = s.filter((Z) => Z.id !== C);
|
|
208
|
+
o($, "delete", h);
|
|
209
|
+
}, { data: d, isLoading: m } = We({
|
|
210
|
+
inputValue: R,
|
|
192
211
|
label: r,
|
|
193
212
|
lookup: e,
|
|
194
213
|
minLength: i,
|
|
195
|
-
preLoadedOptions:
|
|
196
|
-
}),
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
214
|
+
preLoadedOptions: f
|
|
215
|
+
}), H = R.length >= i, Qe = L ? {
|
|
216
|
+
sx: {
|
|
217
|
+
"& .MuiFilledInput-root.Mui-focused": {
|
|
218
|
+
backgroundColor: "hsla(201, 98%, 41%, 0.08)"
|
|
219
|
+
},
|
|
220
|
+
"& .MuiOutlinedInput-root.Mui-focused": {
|
|
221
|
+
backgroundColor: "hsla(201, 98%, 41%, 0.08)"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
focused: !0
|
|
225
|
+
} : {};
|
|
226
|
+
return /* @__PURE__ */ x("div", { "data-testid": c, children: [
|
|
227
|
+
/* @__PURE__ */ n(
|
|
228
|
+
ne,
|
|
200
229
|
{
|
|
201
|
-
sx:
|
|
230
|
+
sx: p(p({}, a), y ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
|
|
202
231
|
"data-testid": c ? `${c}:Autocomplete` : void 0,
|
|
203
232
|
disablePortal: k,
|
|
204
233
|
multiple: !0,
|
|
205
234
|
getOptionLabel: (h) => typeof h == "string" ? h : h.label,
|
|
206
|
-
loading:
|
|
207
|
-
options: [...s, ...
|
|
235
|
+
loading: H ? m : !1,
|
|
236
|
+
options: [...s, ...d != null ? d : []],
|
|
208
237
|
filterSelectedOptions: !0,
|
|
209
238
|
includeInputInList: !0,
|
|
210
239
|
value: s,
|
|
211
|
-
onChange: (h,
|
|
212
|
-
|
|
240
|
+
onChange: (h, C, $) => {
|
|
241
|
+
o(C, $, h);
|
|
213
242
|
},
|
|
214
|
-
onInputChange: (h,
|
|
215
|
-
noOptionsText:
|
|
216
|
-
loadingText:
|
|
217
|
-
popupIcon:
|
|
218
|
-
renderInput: (h) => /* @__PURE__ */
|
|
219
|
-
|
|
220
|
-
|
|
243
|
+
onInputChange: (h, C) => U(C),
|
|
244
|
+
noOptionsText: H ? S : "Start typing to search",
|
|
245
|
+
loadingText: w,
|
|
246
|
+
popupIcon: A,
|
|
247
|
+
renderInput: (h) => /* @__PURE__ */ n(
|
|
248
|
+
ie,
|
|
249
|
+
p(b(p({}, h), {
|
|
221
250
|
label: r,
|
|
222
251
|
fullWidth: !0,
|
|
223
|
-
variant:
|
|
224
|
-
error:
|
|
252
|
+
variant: g,
|
|
253
|
+
error: v,
|
|
225
254
|
helperText: D,
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
255
|
+
slotProps: {
|
|
256
|
+
input: b(p({}, h.InputProps), {
|
|
257
|
+
endAdornment: /* @__PURE__ */ x(N, { children: [
|
|
258
|
+
m ? /* @__PURE__ */ n(re, { color: "inherit", size: 20 }) : null,
|
|
259
|
+
h.InputProps.endAdornment
|
|
260
|
+
] })
|
|
261
|
+
})
|
|
262
|
+
},
|
|
232
263
|
"data-testid": c ? `${c}:Autocomplete:TextField` : void 0,
|
|
233
|
-
onKeyDown: (
|
|
234
|
-
(
|
|
264
|
+
onKeyDown: (C) => {
|
|
265
|
+
(C.key === "Backspace" || C.key === "Delete") && C.stopPropagation();
|
|
235
266
|
},
|
|
236
|
-
color:
|
|
237
|
-
|
|
267
|
+
color: u,
|
|
268
|
+
placeholder: O
|
|
269
|
+
}), Qe)
|
|
238
270
|
),
|
|
239
|
-
|
|
240
|
-
isOptionEqualToValue: (h,
|
|
241
|
-
renderOption: (h,
|
|
271
|
+
renderValue: () => null,
|
|
272
|
+
isOptionEqualToValue: (h, C) => h.id === C.id,
|
|
273
|
+
renderOption: (h, C, $) => {
|
|
242
274
|
if (t) {
|
|
243
|
-
const
|
|
275
|
+
const Z = vt(C.label, $.inputValue, {
|
|
244
276
|
insideWords: !0,
|
|
245
277
|
findAllOccurrences: !0
|
|
246
|
-
}),
|
|
247
|
-
return /* @__PURE__ */
|
|
278
|
+
}), Je = wt(C.label, Z);
|
|
279
|
+
return /* @__PURE__ */ oe(
|
|
248
280
|
"li",
|
|
249
|
-
|
|
250
|
-
key:
|
|
251
|
-
"data-testid": c ? `${c}:Autocomplete:option(${
|
|
281
|
+
b(p({}, h), {
|
|
282
|
+
key: C.id,
|
|
283
|
+
"data-testid": c ? `${c}:Autocomplete:option(${C.id.toString()})` : void 0
|
|
252
284
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ n("div", { children: Je.map((se, Ze) => /* @__PURE__ */ n(
|
|
254
286
|
"span",
|
|
255
287
|
{
|
|
256
288
|
style: {
|
|
257
|
-
fontWeight:
|
|
289
|
+
fontWeight: se.highlight ? 700 : 400
|
|
258
290
|
},
|
|
259
|
-
children:
|
|
291
|
+
children: se.text
|
|
260
292
|
},
|
|
261
|
-
|
|
293
|
+
Ze
|
|
262
294
|
)) })
|
|
263
295
|
);
|
|
264
296
|
} else
|
|
265
|
-
return /* @__PURE__ */
|
|
297
|
+
return /* @__PURE__ */ oe(
|
|
266
298
|
"li",
|
|
267
|
-
|
|
268
|
-
key:
|
|
269
|
-
"data-testid": c ? `${c}:option(${
|
|
299
|
+
b(p({}, h), {
|
|
300
|
+
key: C.id,
|
|
301
|
+
"data-testid": c ? `${c}:option(${C.id.toString()})` : void 0
|
|
270
302
|
}),
|
|
271
|
-
|
|
303
|
+
C.label
|
|
272
304
|
);
|
|
305
|
+
},
|
|
306
|
+
onContextMenu: F,
|
|
307
|
+
onMouseDownCapture: (h) => {
|
|
308
|
+
h.button === He.right && T && (h.preventDefault(), h.stopPropagation());
|
|
309
|
+
},
|
|
310
|
+
onContextMenuCapture: (h) => {
|
|
311
|
+
T && (h.preventDefault(), h.stopPropagation());
|
|
273
312
|
}
|
|
274
313
|
}
|
|
275
314
|
),
|
|
276
|
-
s.length > 0 && /* @__PURE__ */
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
315
|
+
s.length > 0 && /* @__PURE__ */ n(I, { sx: l, children: s.map((h) => {
|
|
316
|
+
var C;
|
|
317
|
+
return /* @__PURE__ */ n(
|
|
318
|
+
rt,
|
|
319
|
+
{
|
|
320
|
+
sx: {
|
|
321
|
+
marginTop: 1,
|
|
322
|
+
marginRight: 1,
|
|
323
|
+
height: "auto"
|
|
324
|
+
},
|
|
325
|
+
label: /* @__PURE__ */ n(
|
|
326
|
+
at,
|
|
327
|
+
{
|
|
328
|
+
title: (C = h.tooltipContent) != null ? C : "",
|
|
329
|
+
placement: "bottom-start",
|
|
330
|
+
slotProps: _,
|
|
331
|
+
children: /* @__PURE__ */ n(E, { style: { whiteSpace: "normal" }, children: h.chipLabel ? h.chipLabel : h.label })
|
|
332
|
+
}
|
|
333
|
+
),
|
|
334
|
+
"data-testid": c ? `${c}:Chip(${h.id.toString()})` : void 0,
|
|
335
|
+
onDelete: ($) => B($, h.id),
|
|
336
|
+
deleteIcon: /* @__PURE__ */ n(
|
|
337
|
+
At,
|
|
338
|
+
{
|
|
339
|
+
"data-testid": c ? `${c}:Chip(${h.id.toString()}):deleteIcon` : void 0
|
|
340
|
+
}
|
|
341
|
+
)
|
|
283
342
|
},
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
title: h.tooltipContent || "",
|
|
288
|
-
placement: "bottom-start",
|
|
289
|
-
PopperProps: {
|
|
290
|
-
modifiers: [
|
|
291
|
-
{
|
|
292
|
-
name: "offset",
|
|
293
|
-
options: {
|
|
294
|
-
offset: [115, -15]
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
]
|
|
298
|
-
},
|
|
299
|
-
children: /* @__PURE__ */ o(_, { style: { whiteSpace: "normal" }, children: h.chipLabel ? h.chipLabel : h.label })
|
|
300
|
-
}
|
|
301
|
-
),
|
|
302
|
-
"data-testid": c ? `${c}:Chip(${h.id.toString()})` : void 0,
|
|
303
|
-
onDelete: (A) => M(A, h.id),
|
|
304
|
-
deleteIcon: /* @__PURE__ */ o(
|
|
305
|
-
ut,
|
|
306
|
-
{
|
|
307
|
-
"data-testid": c ? `${c}:Chip(${h.id.toString()}):deleteIcon` : void 0
|
|
308
|
-
}
|
|
309
|
-
)
|
|
310
|
-
},
|
|
311
|
-
h.id
|
|
312
|
-
)) })
|
|
343
|
+
h.id
|
|
344
|
+
);
|
|
345
|
+
}) })
|
|
313
346
|
] });
|
|
314
347
|
}
|
|
315
|
-
const
|
|
316
|
-
lookup: e = () =>
|
|
348
|
+
const Mo = /MUI: The value provided to.*is invalid/i, To = ({
|
|
349
|
+
lookup: e = () => M(null, null, function* () {
|
|
317
350
|
}),
|
|
318
351
|
onChange: t,
|
|
319
|
-
label:
|
|
352
|
+
label: o,
|
|
320
353
|
value: i,
|
|
321
354
|
sx: r,
|
|
322
355
|
textFieldColor: s,
|
|
323
356
|
textFieldVariant: c = "filled",
|
|
324
357
|
error: a = !1,
|
|
325
358
|
"data-testid": l,
|
|
326
|
-
noOptionsText:
|
|
327
|
-
minLength:
|
|
328
|
-
disablePortal:
|
|
329
|
-
preLoadedOptions:
|
|
330
|
-
helperText:
|
|
331
|
-
disabled:
|
|
359
|
+
noOptionsText: u = "No options",
|
|
360
|
+
minLength: g = 3,
|
|
361
|
+
disablePortal: w = !1,
|
|
362
|
+
preLoadedOptions: S,
|
|
363
|
+
helperText: A = "",
|
|
364
|
+
disabled: v,
|
|
332
365
|
popupIcon: D,
|
|
333
|
-
disableIconFlip:
|
|
366
|
+
disableIconFlip: f,
|
|
367
|
+
isPlaceholder: k = !1,
|
|
368
|
+
placeHolderText: y = void 0,
|
|
369
|
+
onRightClick: _ = () => {
|
|
370
|
+
},
|
|
371
|
+
disableDefaultRightClickBehaviour: L = !1
|
|
334
372
|
}) => {
|
|
335
|
-
const [
|
|
336
|
-
inputValue:
|
|
337
|
-
label:
|
|
373
|
+
const [O, F] = V(""), { data: T, isLoading: R } = We({
|
|
374
|
+
inputValue: O,
|
|
375
|
+
label: o,
|
|
338
376
|
lookup: e,
|
|
339
|
-
minLength:
|
|
340
|
-
preLoadedOptions:
|
|
341
|
-
}),
|
|
342
|
-
|
|
343
|
-
|
|
377
|
+
minLength: g != null ? g : 0,
|
|
378
|
+
preLoadedOptions: S
|
|
379
|
+
}), U = O.length >= g, B = k ? {
|
|
380
|
+
sx: {
|
|
381
|
+
"& .MuiFilledInput-root.Mui-focused": {
|
|
382
|
+
backgroundColor: "hsla(201, 98%, 41%, 0.08)"
|
|
383
|
+
},
|
|
384
|
+
"& .MuiOutlinedInput-root.Mui-focused": {
|
|
385
|
+
backgroundColor: "hsla(201, 98%, 41%, 0.08)"
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
focused: !0
|
|
389
|
+
} : {};
|
|
390
|
+
return /* @__PURE__ */ n("div", { "data-testid": l, children: /* @__PURE__ */ n(
|
|
391
|
+
st,
|
|
344
392
|
{
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
t(x, F, L);
|
|
393
|
+
direction: "row",
|
|
394
|
+
spacing: 1,
|
|
395
|
+
onContextMenu: _,
|
|
396
|
+
onMouseDownCapture: (d) => {
|
|
397
|
+
d.button === He.right && L && (d.preventDefault(), d.stopPropagation());
|
|
351
398
|
},
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
value: i,
|
|
355
|
-
noOptionsText: M ? d : "Start typing to search",
|
|
356
|
-
getOptionLabel: (x) => x.label,
|
|
357
|
-
popupIcon: D,
|
|
358
|
-
renderInput: (x) => /* @__PURE__ */ o(
|
|
359
|
-
ee,
|
|
360
|
-
E(u({
|
|
361
|
-
"data-testid": l ? `${l}:Autocomplete:TextField` : void 0
|
|
362
|
-
}, x), {
|
|
363
|
-
variant: c,
|
|
364
|
-
label: n,
|
|
365
|
-
color: s,
|
|
366
|
-
error: a,
|
|
367
|
-
helperText: g
|
|
368
|
-
})
|
|
369
|
-
),
|
|
370
|
-
isOptionEqualToValue: (x, F) => x.id === F.id,
|
|
371
|
-
onInputChange: (x, F) => {
|
|
372
|
-
b(F);
|
|
399
|
+
onContextMenuCapture: (d) => {
|
|
400
|
+
L && (d.preventDefault(), d.stopPropagation());
|
|
373
401
|
},
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
"data-testid": l ? `${l}:Autocomplete
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
402
|
+
children: /* @__PURE__ */ n(
|
|
403
|
+
ne,
|
|
404
|
+
{
|
|
405
|
+
sx: p(p({}, r), f ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
|
|
406
|
+
"data-testid": l ? `${l}:Autocomplete` : void 0,
|
|
407
|
+
loading: U ? R : !1,
|
|
408
|
+
options: T != null ? T : [],
|
|
409
|
+
onChange: (d, m, H) => {
|
|
410
|
+
t(d, m, H);
|
|
411
|
+
},
|
|
412
|
+
disablePortal: w,
|
|
413
|
+
filterOptions: (d) => d,
|
|
414
|
+
value: i,
|
|
415
|
+
noOptionsText: U ? u : "Start typing to search",
|
|
416
|
+
getOptionLabel: (d) => d.label,
|
|
417
|
+
popupIcon: D,
|
|
418
|
+
renderInput: (d) => /* @__PURE__ */ n(
|
|
419
|
+
ie,
|
|
420
|
+
p(b(p({
|
|
421
|
+
"data-testid": l ? `${l}:Autocomplete:TextField` : void 0
|
|
422
|
+
}, d), {
|
|
423
|
+
variant: c,
|
|
424
|
+
label: o,
|
|
425
|
+
color: s,
|
|
426
|
+
error: a,
|
|
427
|
+
helperText: A,
|
|
428
|
+
placeholder: y
|
|
429
|
+
}), B)
|
|
430
|
+
),
|
|
431
|
+
isOptionEqualToValue: (d, m) => d.id === m.id,
|
|
432
|
+
onInputChange: (d, m) => {
|
|
433
|
+
F(m);
|
|
434
|
+
},
|
|
435
|
+
renderOption: (d, m) => /* @__PURE__ */ oe(
|
|
436
|
+
"li",
|
|
437
|
+
b(p({}, d), {
|
|
438
|
+
key: m.id,
|
|
439
|
+
"data-testid": l ? `${l}:Autocomplete:option(${m.id.toString()})` : void 0
|
|
440
|
+
}),
|
|
441
|
+
m.label
|
|
442
|
+
),
|
|
443
|
+
disabled: v
|
|
444
|
+
}
|
|
445
|
+
)
|
|
383
446
|
}
|
|
384
|
-
) })
|
|
385
|
-
},
|
|
447
|
+
) });
|
|
448
|
+
}, It = (e) => {
|
|
386
449
|
if (!e)
|
|
387
450
|
return -1;
|
|
388
451
|
try {
|
|
389
|
-
const
|
|
390
|
-
|
|
452
|
+
const o = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), i = decodeURIComponent(
|
|
453
|
+
kt.from(o, "base64").toString("utf8").split("").map(function(s) {
|
|
391
454
|
return "%" + ("00" + s.charCodeAt(0).toString(16)).slice(-2);
|
|
392
455
|
}).join("")
|
|
393
456
|
), r = JSON.parse(i);
|
|
@@ -395,21 +458,21 @@ const kn = /MUI: The value provided to.*is invalid/i, yn = ({
|
|
|
395
458
|
} catch (t) {
|
|
396
459
|
return -1;
|
|
397
460
|
}
|
|
398
|
-
},
|
|
461
|
+
}, Po = ({
|
|
399
462
|
open: e = !1,
|
|
400
463
|
closeHandler: t,
|
|
401
|
-
setAuth0ExpiryTime:
|
|
464
|
+
setAuth0ExpiryTime: o
|
|
402
465
|
}) => {
|
|
403
|
-
const { logout: i, getAccessTokenSilently: r } =
|
|
404
|
-
return /* @__PURE__ */
|
|
405
|
-
|
|
466
|
+
const { logout: i, getAccessTokenSilently: r } = ae();
|
|
467
|
+
return /* @__PURE__ */ n(
|
|
468
|
+
Be,
|
|
406
469
|
{
|
|
407
470
|
isOpen: e,
|
|
408
471
|
primaryButton: {
|
|
409
472
|
text: "Continue",
|
|
410
|
-
onClick: () =>
|
|
411
|
-
const
|
|
412
|
-
|
|
473
|
+
onClick: () => M(null, null, function* () {
|
|
474
|
+
const u = yield r({ cacheMode: "off" }), g = It(u) * 1e3;
|
|
475
|
+
o(g), t();
|
|
413
476
|
}),
|
|
414
477
|
disabled: !1,
|
|
415
478
|
testId: "PreferencesDialog",
|
|
@@ -417,7 +480,7 @@ const kn = /MUI: The value provided to.*is invalid/i, yn = ({
|
|
|
417
480
|
},
|
|
418
481
|
secondaryButton: {
|
|
419
482
|
text: "Log out",
|
|
420
|
-
onClick: () =>
|
|
483
|
+
onClick: () => M(null, null, function* () {
|
|
421
484
|
i({ logoutParams: { returnTo: `${window.location.origin}` } });
|
|
422
485
|
}),
|
|
423
486
|
disabled: !1,
|
|
@@ -427,42 +490,42 @@ const kn = /MUI: The value provided to.*is invalid/i, yn = ({
|
|
|
427
490
|
onClose: t,
|
|
428
491
|
dialogTitle: "Session expiry",
|
|
429
492
|
disableCloseOnBackdropOrEscape: !0,
|
|
430
|
-
children: /* @__PURE__ */
|
|
493
|
+
children: /* @__PURE__ */ n("p", { style: { marginBottom: 0 }, children: "Your session is about to time out due to inactivity. Do you want to continue?" })
|
|
431
494
|
}
|
|
432
495
|
);
|
|
433
496
|
};
|
|
434
|
-
function
|
|
497
|
+
function _t(e) {
|
|
435
498
|
return "error" in e;
|
|
436
499
|
}
|
|
437
|
-
function
|
|
500
|
+
function Mt(e) {
|
|
438
501
|
var i;
|
|
439
|
-
const t = e.error,
|
|
440
|
-
return t === "access_denied" &&
|
|
502
|
+
const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
|
|
503
|
+
return t === "access_denied" && o.startsWith("You do not have the required authorization");
|
|
441
504
|
}
|
|
442
|
-
function
|
|
505
|
+
function Tt(e) {
|
|
443
506
|
var i;
|
|
444
|
-
const t = e.error,
|
|
445
|
-
return t === "access_denied" &&
|
|
507
|
+
const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
|
|
508
|
+
return t === "access_denied" && o.startsWith("User did not authorize the request");
|
|
446
509
|
}
|
|
447
|
-
function
|
|
510
|
+
function Pt(e) {
|
|
448
511
|
var i;
|
|
449
|
-
const t = e.error,
|
|
450
|
-
return t === "access_denied" &&
|
|
512
|
+
const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
|
|
513
|
+
return t === "access_denied" && o.match(/Script.*time.*exceeded/);
|
|
451
514
|
}
|
|
452
|
-
function
|
|
515
|
+
function No({
|
|
453
516
|
children: e,
|
|
454
517
|
appName: t = "the app",
|
|
455
|
-
throwErrors:
|
|
518
|
+
throwErrors: o = "none",
|
|
456
519
|
disableConsoleLogging: i = !1,
|
|
457
520
|
onError: r = () => {
|
|
458
521
|
}
|
|
459
522
|
}) {
|
|
460
|
-
var
|
|
461
|
-
const { isAuthenticated: s, isLoading: c, error: a, loginWithRedirect: l, logout:
|
|
462
|
-
|
|
523
|
+
var w, S;
|
|
524
|
+
const { isAuthenticated: s, isLoading: c, error: a, loginWithRedirect: l, logout: u } = ae();
|
|
525
|
+
pe(() => {
|
|
463
526
|
a && r(a);
|
|
464
527
|
}, [a, r]);
|
|
465
|
-
const
|
|
528
|
+
const g = ot(
|
|
466
529
|
() => ({
|
|
467
530
|
appState: {
|
|
468
531
|
returnTo: `${window.location.pathname}${window.location.search}`
|
|
@@ -470,166 +533,166 @@ function bn({
|
|
|
470
533
|
}),
|
|
471
534
|
[]
|
|
472
535
|
);
|
|
473
|
-
if (
|
|
474
|
-
c || s || a || l(
|
|
475
|
-
}, [c, s, a, l, r,
|
|
536
|
+
if (pe(() => {
|
|
537
|
+
c || s || a || l(g);
|
|
538
|
+
}, [c, s, a, l, r, g]), a) {
|
|
476
539
|
if (i || console.error(
|
|
477
540
|
`Error detected in AuthGuard [isAuthenticated=${s},isLoading=${c}]`,
|
|
478
541
|
a
|
|
479
|
-
),
|
|
542
|
+
), o === "all")
|
|
480
543
|
throw a;
|
|
481
|
-
if (
|
|
482
|
-
let
|
|
483
|
-
if (
|
|
484
|
-
|
|
485
|
-
else if (
|
|
486
|
-
|
|
487
|
-
else if (
|
|
488
|
-
|
|
544
|
+
if (_t(a)) {
|
|
545
|
+
let A = "Auth error", v = "An unknown Auth0 error occurred.";
|
|
546
|
+
if (Mt(a))
|
|
547
|
+
A = "Unauthorised", v = `You are not authorised to access ${t}.`;
|
|
548
|
+
else if (Tt(a))
|
|
549
|
+
A = "App not authorised", v = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
|
|
550
|
+
else if (Pt(a))
|
|
551
|
+
A = "Auth0 script execution time exceeded", v = "The Auth0 login flow exceeded the time limit (20s). Try again in a minute by clicking the RELOAD button below.";
|
|
489
552
|
else if (a.message === "Invalid state") {
|
|
490
553
|
const D = localStorage.getItem("auth0_redirect_count");
|
|
491
|
-
D ? D && parseInt(D) < 2 && (localStorage.setItem("auth0_redirect_count", String(parseInt(D) + 1)), l(
|
|
492
|
-
} else if (
|
|
493
|
-
return /* @__PURE__ */
|
|
494
|
-
/* @__PURE__ */
|
|
495
|
-
/* @__PURE__ */
|
|
496
|
-
/* @__PURE__ */
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
/* @__PURE__ */
|
|
499
|
-
/* @__PURE__ */
|
|
554
|
+
D ? D && parseInt(D) < 2 && (localStorage.setItem("auth0_redirect_count", String(parseInt(D) + 1)), l(g)) : (localStorage.setItem("auth0_redirect_count", "1"), l(g));
|
|
555
|
+
} else if (o === "unknown") throw a;
|
|
556
|
+
return /* @__PURE__ */ x(Me, { open: !0, children: [
|
|
557
|
+
/* @__PURE__ */ n(Pe, { children: A }),
|
|
558
|
+
/* @__PURE__ */ x(Ne, { children: [
|
|
559
|
+
/* @__PURE__ */ n(E, { children: v }),
|
|
560
|
+
/* @__PURE__ */ n("br", {}),
|
|
561
|
+
/* @__PURE__ */ n(E, { variant: "subtitle2", children: "Details from Auth0" }),
|
|
562
|
+
/* @__PURE__ */ x(E, { variant: "body2", children: [
|
|
500
563
|
"error: ",
|
|
501
|
-
(
|
|
564
|
+
(w = a == null ? void 0 : a.error) != null ? w : "N/A"
|
|
502
565
|
] }),
|
|
503
|
-
/* @__PURE__ */
|
|
566
|
+
/* @__PURE__ */ x(E, { variant: "body2", children: [
|
|
504
567
|
"description: ",
|
|
505
|
-
(
|
|
568
|
+
(S = a == null ? void 0 : a.error_description) != null ? S : "N/A"
|
|
506
569
|
] })
|
|
507
570
|
] }),
|
|
508
|
-
/* @__PURE__ */
|
|
509
|
-
|
|
510
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ x($e, { children: [
|
|
572
|
+
A === "Auth0 script execution time exceeded" && /* @__PURE__ */ n(z, { href: window.location.origin + window.location.pathname, children: "Reload" }),
|
|
573
|
+
/* @__PURE__ */ n(z, { onClick: () => u({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" })
|
|
511
574
|
] })
|
|
512
575
|
] });
|
|
513
|
-
} else if (
|
|
576
|
+
} else if (o === "unknown") throw a;
|
|
514
577
|
}
|
|
515
|
-
return s ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */
|
|
578
|
+
return s ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */ n(N, { children: e })) : /* @__PURE__ */ n(Dt, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
|
|
516
579
|
}
|
|
517
|
-
const
|
|
580
|
+
const Nt = {
|
|
518
581
|
autoHideDuration: 6e3,
|
|
519
582
|
anchorOrigin: { vertical: "top", horizontal: "center" },
|
|
520
583
|
// The default is false. If we prefer timer to continue when window loses
|
|
521
584
|
// focus, change to true
|
|
522
585
|
disableWindowBlurListener: !1
|
|
523
|
-
},
|
|
586
|
+
}, $t = {
|
|
524
587
|
shouldClose: (e, t) => t !== "clickaway"
|
|
525
|
-
},
|
|
588
|
+
}, Se = {
|
|
526
589
|
message: "",
|
|
527
590
|
severity: "info",
|
|
528
591
|
variant: "standard",
|
|
529
592
|
progressIndicator: void 0
|
|
530
593
|
// Can use 'circular' or 'linear'
|
|
531
|
-
},
|
|
594
|
+
}, ve = 100, we = 2e3, Lt = 2e3, Ot = /* @__PURE__ */ (() => {
|
|
532
595
|
let e = 0;
|
|
533
596
|
return () => (e += 1, e);
|
|
534
|
-
})(),
|
|
597
|
+
})(), Rt = {
|
|
535
598
|
borderBottomLeftRadius: "0px",
|
|
536
599
|
borderBottomRightRadius: "0px"
|
|
537
|
-
},
|
|
538
|
-
function
|
|
600
|
+
}, Ut = {}, Bt = {}, qe = nt(null);
|
|
601
|
+
function Ht(s) {
|
|
539
602
|
var c = s, {
|
|
540
|
-
overrideState: e =
|
|
541
|
-
overrideActions: t =
|
|
542
|
-
shouldClose:
|
|
603
|
+
overrideState: e = Ut,
|
|
604
|
+
overrideActions: t = Bt,
|
|
605
|
+
shouldClose: o = $t.shouldClose,
|
|
543
606
|
children: i
|
|
544
|
-
} = c, r =
|
|
607
|
+
} = c, r = de(c, [
|
|
545
608
|
"overrideState",
|
|
546
609
|
"overrideActions",
|
|
547
610
|
"shouldClose",
|
|
548
611
|
"children"
|
|
549
612
|
]);
|
|
550
|
-
var
|
|
551
|
-
const [{ open: a }, l] =
|
|
552
|
-
l({ open:
|
|
553
|
-
}, []),
|
|
554
|
-
|
|
555
|
-
`SaladBarProvider: MAX_QUEUE_LENGTH (${
|
|
556
|
-
),
|
|
557
|
-
const
|
|
558
|
-
key:
|
|
559
|
-
}),
|
|
560
|
-
return
|
|
561
|
-
}, []),
|
|
562
|
-
const
|
|
563
|
-
if (
|
|
564
|
-
return
|
|
565
|
-
},
|
|
566
|
-
|
|
567
|
-
},
|
|
568
|
-
},
|
|
569
|
-
|
|
570
|
-
},
|
|
571
|
-
"autoHideDuration" in
|
|
572
|
-
const
|
|
613
|
+
var B;
|
|
614
|
+
const [{ open: a }, l] = V({ open: !1 }), u = ee([]), g = ee(Date.now()), w = ee(0), S = he((d) => {
|
|
615
|
+
l({ open: d });
|
|
616
|
+
}, []), A = he((d = {}) => {
|
|
617
|
+
w.current += 1, u.current.length >= ve && Date.now() - g.current >= we && (g.current = Date.now(), console.error(
|
|
618
|
+
`SaladBarProvider: MAX_QUEUE_LENGTH (${ve}) hit ${w.current} times in last ${we}ms)`
|
|
619
|
+
), w.current = 0);
|
|
620
|
+
const m = p(b(p({}, Se), {
|
|
621
|
+
key: Ot()
|
|
622
|
+
}), d);
|
|
623
|
+
return u.current.push(m), u.current.length === 1 && l({ open: !0 }), m.key;
|
|
624
|
+
}, []), v = (d = "", m = {}) => A(p({ message: d, severity: "success" }, m)), D = (d = "", m = {}) => A(p({ message: d, severity: "info" }, m)), f = (d = "", m = {}) => A(p({ message: d, severity: "warning" }, m)), k = (d = "", m = {}) => A(p({ message: d, severity: "error" }, m)), y = (d) => {
|
|
625
|
+
const m = u.current.findIndex((H) => H.key === d);
|
|
626
|
+
if (m !== -1)
|
|
627
|
+
return m === 0 ? (l({ open: !1 }), u.current[0]) : u.current.splice(m, 1);
|
|
628
|
+
}, _ = (d, m) => {
|
|
629
|
+
o(d, m) && l({ open: !1 });
|
|
630
|
+
}, L = () => {
|
|
631
|
+
}, O = () => {
|
|
632
|
+
u.current.shift(), u.current.length > 0 && l({ open: !0 });
|
|
633
|
+
}, F = (B = u.current[0]) != null ? B : p({}, Se), T = {};
|
|
634
|
+
"autoHideDuration" in F && (T.autoHideDuration = F.autoHideDuration);
|
|
635
|
+
const R = p(p({}, Nt), r), U = p(p({
|
|
573
636
|
open: a,
|
|
574
|
-
setOpen:
|
|
575
|
-
enqueueNotification:
|
|
576
|
-
enqueueSuccessNotification:
|
|
637
|
+
setOpen: S,
|
|
638
|
+
enqueueNotification: A,
|
|
639
|
+
enqueueSuccessNotification: v,
|
|
577
640
|
enqueueInfoNotification: D,
|
|
578
|
-
enqueueWarningNotification:
|
|
641
|
+
enqueueWarningNotification: f,
|
|
579
642
|
enqueueErrorNotification: k,
|
|
580
|
-
removeNotification:
|
|
643
|
+
removeNotification: y
|
|
581
644
|
}, e), t);
|
|
582
|
-
return /* @__PURE__ */
|
|
645
|
+
return /* @__PURE__ */ x(qe.Provider, { value: U, children: [
|
|
583
646
|
i,
|
|
584
|
-
/* @__PURE__ */
|
|
585
|
-
|
|
586
|
-
|
|
647
|
+
/* @__PURE__ */ n(
|
|
648
|
+
lt,
|
|
649
|
+
b(p(p({}, R), T), {
|
|
587
650
|
open: a,
|
|
588
|
-
onClose:
|
|
651
|
+
onClose: _,
|
|
589
652
|
TransitionProps: {
|
|
590
|
-
onExited:
|
|
591
|
-
onExit:
|
|
653
|
+
onExited: O,
|
|
654
|
+
onExit: L
|
|
592
655
|
},
|
|
593
|
-
sx: { zIndex:
|
|
594
|
-
children: /* @__PURE__ */
|
|
595
|
-
/* @__PURE__ */
|
|
596
|
-
|
|
656
|
+
sx: { zIndex: Lt },
|
|
657
|
+
children: /* @__PURE__ */ x("div", { children: [
|
|
658
|
+
/* @__PURE__ */ n(
|
|
659
|
+
ct,
|
|
597
660
|
{
|
|
598
|
-
onClose: (
|
|
599
|
-
severity:
|
|
661
|
+
onClose: (d) => _(d, "closeAlert"),
|
|
662
|
+
severity: F.severity,
|
|
600
663
|
variant: "filled",
|
|
601
|
-
icon:
|
|
602
|
-
style:
|
|
603
|
-
children:
|
|
664
|
+
icon: F.progressIndicator === "circular" ? /* @__PURE__ */ n(re, { size: "1em" }) : void 0,
|
|
665
|
+
style: F.progressIndicator === "linear" ? Rt : void 0,
|
|
666
|
+
children: F.message
|
|
604
667
|
}
|
|
605
668
|
),
|
|
606
|
-
|
|
669
|
+
F.progressIndicator === "linear" && /* @__PURE__ */ n(Te, { color: "primary" })
|
|
607
670
|
] })
|
|
608
671
|
})
|
|
609
672
|
)
|
|
610
673
|
] });
|
|
611
674
|
}
|
|
612
|
-
class
|
|
675
|
+
class ze extends Error {
|
|
613
676
|
}
|
|
614
|
-
|
|
615
|
-
function
|
|
616
|
-
const e =
|
|
677
|
+
ue(ze, "errorName", "ContextError");
|
|
678
|
+
function Wt() {
|
|
679
|
+
const e = it(qe);
|
|
617
680
|
if (e === null)
|
|
618
|
-
throw new
|
|
681
|
+
throw new ze("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
|
|
619
682
|
return e;
|
|
620
683
|
}
|
|
621
|
-
const
|
|
622
|
-
(e = { autoHideDuration: 1 }, t = {},
|
|
623
|
-
),
|
|
624
|
-
var
|
|
625
|
-
const
|
|
626
|
-
JSON.parse((
|
|
627
|
-
),
|
|
628
|
-
(e) => e(
|
|
629
|
-
(e, t,
|
|
630
|
-
t(
|
|
684
|
+
const $o = yt(
|
|
685
|
+
(e = { autoHideDuration: 1 }, t = {}, o = {}) => ({ children: i }) => /* @__PURE__ */ n(Ht, b(p({}, e), { overrideState: t, overrideActions: o, children: /* @__PURE__ */ n(N, { children: i }) }))
|
|
686
|
+
), Ve = "domainCode";
|
|
687
|
+
var Ie;
|
|
688
|
+
const ke = P(
|
|
689
|
+
JSON.parse((Ie = localStorage.getItem(Ve)) != null ? Ie : '{"domainCode": ""}').domainCode
|
|
690
|
+
), qt = P(
|
|
691
|
+
(e) => e(ke),
|
|
692
|
+
(e, t, o) => {
|
|
693
|
+
t(ke, o), localStorage.setItem(Ve, JSON.stringify({ domainCode: o }));
|
|
631
694
|
}
|
|
632
|
-
),
|
|
695
|
+
), zt = {
|
|
633
696
|
act: "ACT",
|
|
634
697
|
nsw: "NSW",
|
|
635
698
|
nt: "NT",
|
|
@@ -641,102 +704,102 @@ const Ce = P(
|
|
|
641
704
|
ag: "AG",
|
|
642
705
|
fedmps: "FedMPs",
|
|
643
706
|
"": ""
|
|
644
|
-
},
|
|
707
|
+
}, Ge = (e) => {
|
|
645
708
|
var t;
|
|
646
|
-
return e === null ? "N/A" : (t =
|
|
647
|
-
},
|
|
709
|
+
return e === null ? "N/A" : (t = zt[e]) != null ? t : "";
|
|
710
|
+
}, Lo = ({
|
|
648
711
|
isLoading: e,
|
|
649
712
|
isOpen: t,
|
|
650
|
-
onClose:
|
|
713
|
+
onClose: o,
|
|
651
714
|
onDomainChange: i,
|
|
652
715
|
domainOptions: r,
|
|
653
716
|
applicationName: s,
|
|
654
717
|
handleLogout: c
|
|
655
718
|
}) => {
|
|
656
|
-
const [a, l] =
|
|
657
|
-
|
|
658
|
-
}),
|
|
659
|
-
a && !
|
|
719
|
+
const [a, l] = W(qt), [u, g] = V(a), { enqueueSuccessNotification: w } = Wt(), S = r.length === 0, A = !!a && !r.includes(a) && !r.includes(u), v = !a || S || A, D = () => M(null, null, function* () {
|
|
720
|
+
u ? (l(u), i == null || i(u), w(`Set organisation to ${u}`), o()) : (l(""), i == null || i(""));
|
|
721
|
+
}), f = () => M(null, null, function* () {
|
|
722
|
+
a && !S && !A ? (g(a), o()) : v && c();
|
|
660
723
|
});
|
|
661
724
|
let k;
|
|
662
|
-
return
|
|
663
|
-
|
|
725
|
+
return S ? k = "Unable to retrieve your active organisations. Try logging in again." : A && (k = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ x(
|
|
726
|
+
Be,
|
|
664
727
|
{
|
|
665
728
|
isOpen: t,
|
|
666
729
|
dialogTitle: "Select an organisation",
|
|
667
730
|
primaryButton: {
|
|
668
731
|
text: "Confirm",
|
|
669
732
|
onClick: D,
|
|
670
|
-
disabled: !
|
|
733
|
+
disabled: !u || S || A,
|
|
671
734
|
buttonColor: "primary"
|
|
672
735
|
},
|
|
673
736
|
secondaryButton: {
|
|
674
|
-
text:
|
|
675
|
-
onClick:
|
|
737
|
+
text: v ? "Logout" : "Cancel",
|
|
738
|
+
onClick: f
|
|
676
739
|
},
|
|
677
|
-
onClose:
|
|
678
|
-
} :
|
|
740
|
+
onClose: v ? () => {
|
|
741
|
+
} : o,
|
|
679
742
|
children: [
|
|
680
|
-
/* @__PURE__ */
|
|
743
|
+
/* @__PURE__ */ x(E, { marginBottom: 2, children: [
|
|
681
744
|
"Select the default organisation that you want to use with the ",
|
|
682
745
|
s,
|
|
683
746
|
"."
|
|
684
747
|
] }),
|
|
685
|
-
/* @__PURE__ */
|
|
686
|
-
|
|
748
|
+
/* @__PURE__ */ n(
|
|
749
|
+
ne,
|
|
687
750
|
{
|
|
688
751
|
loading: e,
|
|
689
752
|
multiple: !1,
|
|
690
753
|
disableClearable: !1,
|
|
691
|
-
value:
|
|
692
|
-
onChange: (
|
|
693
|
-
getOptionLabel:
|
|
754
|
+
value: u !== "" ? u : null,
|
|
755
|
+
onChange: (y, _) => g(_ != null ? _ : ""),
|
|
756
|
+
getOptionLabel: Ge,
|
|
694
757
|
options: [...r.toSorted()],
|
|
695
|
-
renderInput: (
|
|
696
|
-
|
|
697
|
-
|
|
758
|
+
renderInput: (y) => /* @__PURE__ */ n(
|
|
759
|
+
ie,
|
|
760
|
+
b(p({}, y), {
|
|
698
761
|
variant: "filled",
|
|
699
762
|
label: "Select organisation",
|
|
700
|
-
InputProps:
|
|
701
|
-
endAdornment: /* @__PURE__ */
|
|
702
|
-
e ? /* @__PURE__ */
|
|
703
|
-
|
|
763
|
+
InputProps: b(p({}, y.InputProps), {
|
|
764
|
+
endAdornment: /* @__PURE__ */ x(N, { children: [
|
|
765
|
+
e ? /* @__PURE__ */ n(re, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
|
|
766
|
+
y.InputProps.endAdornment
|
|
704
767
|
] })
|
|
705
768
|
})
|
|
706
769
|
})
|
|
707
770
|
)
|
|
708
771
|
}
|
|
709
772
|
),
|
|
710
|
-
k && /* @__PURE__ */
|
|
773
|
+
k && /* @__PURE__ */ n(dt, { error: !0, children: k })
|
|
711
774
|
]
|
|
712
775
|
}
|
|
713
776
|
);
|
|
714
|
-
},
|
|
715
|
-
const e =
|
|
716
|
-
return
|
|
717
|
-
},
|
|
718
|
-
function
|
|
719
|
-
return /* @__PURE__ */
|
|
777
|
+
}, Ke = () => {
|
|
778
|
+
const e = J();
|
|
779
|
+
return ut(e.breakpoints.down("sm"));
|
|
780
|
+
}, Vt = 64, Gt = 72, Kt = 256, Q = P(!0), Xt = P(Kt), Yt = P(Gt), De = P(""), Qt = P(void 0), Jt = P(Vt), Zt = P(void 0);
|
|
781
|
+
function jt({ links: e }) {
|
|
782
|
+
return /* @__PURE__ */ n("div", { children: "LinksMenu not implemented yet" });
|
|
720
783
|
}
|
|
721
|
-
const
|
|
722
|
-
root: `${
|
|
723
|
-
menuButton: `${
|
|
724
|
-
hide: `${
|
|
725
|
-
content: `${
|
|
784
|
+
const X = "Navbar", G = {
|
|
785
|
+
root: `${X}-root`,
|
|
786
|
+
menuButton: `${X}-menuButton`,
|
|
787
|
+
hide: `${X}-hide`,
|
|
788
|
+
content: `${X}-content`
|
|
726
789
|
// userInfoHolder: `${PREFIX}-userInfoHolder`,
|
|
727
790
|
// settings: `${PREFIX}-settings`,
|
|
728
791
|
// pieChartIcon: `${PREFIX}-pieChartIcon`,
|
|
729
|
-
},
|
|
730
|
-
[`&.${
|
|
792
|
+
}, eo = Re(I, { name: "NavBar" })(({ theme: e }) => ({
|
|
793
|
+
[`&.${G.root}`]: {
|
|
731
794
|
display: "flex"
|
|
732
795
|
},
|
|
733
|
-
[`& .${
|
|
796
|
+
[`& .${G.menuButton}`]: {
|
|
734
797
|
marginRight: 36
|
|
735
798
|
},
|
|
736
|
-
[`& .${
|
|
799
|
+
[`& .${G.hide}`]: {
|
|
737
800
|
display: "none"
|
|
738
801
|
},
|
|
739
|
-
[`& .${
|
|
802
|
+
[`& .${G.content}`]: {
|
|
740
803
|
flexGrow: 1,
|
|
741
804
|
padding: e.spacing(3)
|
|
742
805
|
}
|
|
@@ -745,14 +808,14 @@ const z = "Navbar", W = {
|
|
|
745
808
|
// marginTop: '64px',
|
|
746
809
|
// marginBottom: '16px',
|
|
747
810
|
// },
|
|
748
|
-
})),
|
|
811
|
+
})), q = (e, t, o) => e.transitions.create(t, {
|
|
749
812
|
easing: e.transitions.easing.sharp,
|
|
750
|
-
duration:
|
|
751
|
-
}),
|
|
752
|
-
const t =
|
|
753
|
-
return /* @__PURE__ */
|
|
754
|
-
|
|
755
|
-
|
|
813
|
+
duration: o === "leaving" ? e.transitions.duration.leavingScreen : e.transitions.duration.enteringScreen
|
|
814
|
+
}), to = (e) => {
|
|
815
|
+
const t = J();
|
|
816
|
+
return /* @__PURE__ */ n(
|
|
817
|
+
ht,
|
|
818
|
+
p({
|
|
756
819
|
easing: t.transitions.easing.sharp,
|
|
757
820
|
timeout: {
|
|
758
821
|
enter: t.transitions.duration.enteringScreen,
|
|
@@ -760,42 +823,42 @@ const z = "Navbar", W = {
|
|
|
760
823
|
}
|
|
761
824
|
}, e)
|
|
762
825
|
);
|
|
763
|
-
},
|
|
764
|
-
var t,
|
|
826
|
+
}, Xe = (e) => {
|
|
827
|
+
var t, o;
|
|
765
828
|
return {
|
|
766
829
|
overflowX: "hidden",
|
|
767
830
|
color: "inherit",
|
|
768
|
-
backgroundColor: (
|
|
831
|
+
backgroundColor: (o = (t = e == null ? void 0 : e.navBar) == null ? void 0 : t.backgroundColor) != null ? o : "white"
|
|
769
832
|
// Provide default so tests don't need to wrap theme provider
|
|
770
833
|
};
|
|
771
|
-
},
|
|
834
|
+
}, ye = (e, t) => p({
|
|
772
835
|
width: t,
|
|
773
|
-
transition:
|
|
774
|
-
},
|
|
836
|
+
transition: q(e, "width", "entering")
|
|
837
|
+
}, Xe(e)), be = (e, t) => p({
|
|
775
838
|
width: t,
|
|
776
|
-
transition:
|
|
777
|
-
},
|
|
839
|
+
transition: q(e, "width", "leaving")
|
|
840
|
+
}, Xe(e)), oo = Re(pt, {
|
|
778
841
|
shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
|
|
779
|
-
})(({ theme: e, open: t, widthOpen:
|
|
842
|
+
})(({ theme: e, open: t, widthOpen: o, widthClosed: i, isSmallScreen: r }) => p(p({
|
|
780
843
|
flexShrink: 0,
|
|
781
844
|
whiteSpace: "nowrap",
|
|
782
845
|
boxSizing: "border-box",
|
|
783
846
|
display: "flex",
|
|
784
847
|
flexDirection: "column"
|
|
785
|
-
}, t &&
|
|
848
|
+
}, t && b(p({}, ye(e, o)), {
|
|
786
849
|
backgroundColor: "",
|
|
787
|
-
"& .MuiDrawer-paper":
|
|
788
|
-
})), !t &&
|
|
850
|
+
"& .MuiDrawer-paper": ye(e, o)
|
|
851
|
+
})), !t && b(p({}, be(e, r ? o : i)), {
|
|
789
852
|
backgroundColor: "",
|
|
790
|
-
"& .MuiDrawer-paper":
|
|
853
|
+
"& .MuiDrawer-paper": be(e, r ? o : i)
|
|
791
854
|
})));
|
|
792
|
-
function
|
|
855
|
+
function Ye(e) {
|
|
793
856
|
return e.replace(
|
|
794
857
|
/(^|-)([a-z])/g,
|
|
795
|
-
(t,
|
|
858
|
+
(t, o, i) => o === "-" ? " " + i.toUpperCase() : i.toUpperCase()
|
|
796
859
|
);
|
|
797
860
|
}
|
|
798
|
-
function
|
|
861
|
+
function Oo(e, t, o, i) {
|
|
799
862
|
var c;
|
|
800
863
|
if (!e) return "None";
|
|
801
864
|
const s = Object.entries(e).filter(
|
|
@@ -803,69 +866,69 @@ function In(e, t, n, i) {
|
|
|
803
866
|
).map(
|
|
804
867
|
([a]) => {
|
|
805
868
|
var l;
|
|
806
|
-
return
|
|
869
|
+
return Ye((l = a.split("/").at(-1)) != null ? l : "");
|
|
807
870
|
}
|
|
808
871
|
);
|
|
809
872
|
return (c = i.find(
|
|
810
|
-
(a) =>
|
|
873
|
+
(a) => o[a].some((l) => s.includes(l))
|
|
811
874
|
)) != null ? c : "None";
|
|
812
875
|
}
|
|
813
|
-
const
|
|
814
|
-
const { getIdTokenClaims: t, user:
|
|
815
|
-
return
|
|
816
|
-
queryKey: ["availableDomains",
|
|
817
|
-
queryFn: () =>
|
|
876
|
+
const Ro = (e) => {
|
|
877
|
+
const { getIdTokenClaims: t, user: o } = ae();
|
|
878
|
+
return Le({
|
|
879
|
+
queryKey: ["availableDomains", o == null ? void 0 : o.sub],
|
|
880
|
+
queryFn: () => M(null, null, function* () {
|
|
818
881
|
const i = yield t();
|
|
819
882
|
return i ? Object.entries(i).reduce((r, [s, c]) => {
|
|
820
|
-
var
|
|
821
|
-
const a =
|
|
883
|
+
var u;
|
|
884
|
+
const a = Ye((u = s.split("/").at(-1)) != null ? u : ""), l = s.startsWith("https://greens.org.au/roles/") && e.includes(a) ? c : [];
|
|
822
885
|
return [.../* @__PURE__ */ new Set([...r, ...l])];
|
|
823
886
|
}, []) : [];
|
|
824
887
|
})
|
|
825
888
|
});
|
|
826
|
-
},
|
|
827
|
-
(t,
|
|
889
|
+
}, Uo = (e) => Object.values(e).reduce(
|
|
890
|
+
(t, o) => [.../* @__PURE__ */ new Set([...t, ...o])],
|
|
828
891
|
[]
|
|
829
|
-
),
|
|
892
|
+
), Y = {
|
|
830
893
|
log: console.warn.bind(console),
|
|
831
894
|
error: console.error.bind(console),
|
|
832
895
|
warn: console.warn.bind(console),
|
|
833
896
|
info: console.info.bind(console),
|
|
834
897
|
debug: console.debug.bind(console)
|
|
835
898
|
};
|
|
836
|
-
function
|
|
837
|
-
console[e] = (...
|
|
899
|
+
function Bo(e, t) {
|
|
900
|
+
console[e] = (...o) => {
|
|
838
901
|
for (const i of t)
|
|
839
902
|
if (typeof i == "function") {
|
|
840
|
-
if (i(...
|
|
841
|
-
} else if (i instanceof RegExp &&
|
|
842
|
-
for (const r of
|
|
903
|
+
if (i(...o)) return;
|
|
904
|
+
} else if (i instanceof RegExp && o.length > 0) {
|
|
905
|
+
for (const r of o)
|
|
843
906
|
if (typeof r == "string" && i.test(r))
|
|
844
907
|
return;
|
|
845
908
|
}
|
|
846
|
-
|
|
909
|
+
Y[e](o);
|
|
847
910
|
};
|
|
848
911
|
}
|
|
849
|
-
function
|
|
912
|
+
function Ho(e) {
|
|
850
913
|
if (e)
|
|
851
|
-
console[e] =
|
|
914
|
+
console[e] = Y[e];
|
|
852
915
|
else
|
|
853
|
-
for (const t of Object.keys(
|
|
854
|
-
console[t] =
|
|
916
|
+
for (const t of Object.keys(Y))
|
|
917
|
+
console[t] = Y[t];
|
|
855
918
|
}
|
|
856
|
-
function
|
|
919
|
+
function no(e) {
|
|
857
920
|
let t = 0;
|
|
858
|
-
for (let
|
|
859
|
-
const r = e.charCodeAt(
|
|
921
|
+
for (let o = 0, i = e.length; o < i; o++) {
|
|
922
|
+
const r = e.charCodeAt(o);
|
|
860
923
|
t = (t << 5) - t + r, t |= 0;
|
|
861
924
|
}
|
|
862
925
|
return t;
|
|
863
926
|
}
|
|
864
|
-
const
|
|
865
|
-
function
|
|
866
|
-
const r =
|
|
867
|
-
return /* @__PURE__ */
|
|
868
|
-
|
|
927
|
+
const Fe = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Ee = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
|
|
928
|
+
function io({ user: e, domainCode: t, open: o, useNewAvatar: i = !1 }) {
|
|
929
|
+
const r = J();
|
|
930
|
+
return /* @__PURE__ */ x(
|
|
931
|
+
I,
|
|
869
932
|
{
|
|
870
933
|
sx: {
|
|
871
934
|
paddingTop: 3,
|
|
@@ -875,116 +938,116 @@ function Qt({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
|
|
|
875
938
|
gap: "0.5rem"
|
|
876
939
|
},
|
|
877
940
|
children: [
|
|
878
|
-
!i && /* @__PURE__ */
|
|
879
|
-
|
|
941
|
+
!i && /* @__PURE__ */ n(
|
|
942
|
+
I,
|
|
880
943
|
{
|
|
881
944
|
sx: {
|
|
882
|
-
width:
|
|
883
|
-
transition:
|
|
945
|
+
width: o ? "5rem" : "2rem",
|
|
946
|
+
transition: o ? q(r, ["width", "height"], "entering") : q(r, ["width", "height"], "leaving"),
|
|
884
947
|
aspectRatio: 1
|
|
885
948
|
},
|
|
886
|
-
children: e != null && e.name ? /* @__PURE__ */
|
|
887
|
-
|
|
949
|
+
children: e != null && e.name ? /* @__PURE__ */ n(N, { children: /* @__PURE__ */ n(
|
|
950
|
+
fe,
|
|
888
951
|
{
|
|
889
952
|
src: e == null ? void 0 : e.picture,
|
|
890
953
|
sx: {
|
|
891
954
|
width: "100%",
|
|
892
955
|
height: "100%",
|
|
893
|
-
bgcolor:
|
|
956
|
+
bgcolor: Fe[Math.abs(no(e == null ? void 0 : e.name)) % Fe.length]
|
|
894
957
|
},
|
|
895
|
-
children:
|
|
958
|
+
children: Ee(e == null ? void 0 : e.name)
|
|
896
959
|
}
|
|
897
|
-
) }) : /* @__PURE__ */
|
|
960
|
+
) }) : /* @__PURE__ */ n(fe, { sx: { width: "100%", height: "100%" } })
|
|
898
961
|
}
|
|
899
962
|
),
|
|
900
|
-
i && /* @__PURE__ */
|
|
901
|
-
|
|
963
|
+
i && /* @__PURE__ */ n(
|
|
964
|
+
I,
|
|
902
965
|
{
|
|
903
966
|
sx: {
|
|
904
|
-
width:
|
|
905
|
-
transition:
|
|
967
|
+
width: o ? "5rem" : "2rem",
|
|
968
|
+
transition: o ? q(r, ["width", "height"], "entering") : q(r, ["width", "height"], "leaving"),
|
|
906
969
|
aspectRatio: 1
|
|
907
970
|
},
|
|
908
|
-
children: e != null && e.name ? /* @__PURE__ */
|
|
971
|
+
children: e != null && e.name ? /* @__PURE__ */ n(N, { children: /* @__PURE__ */ x(Ce, { src: e == null ? void 0 : e.picture, name: e == null ? void 0 : e.name, round: !0, size: o ? "80" : "32", children: [
|
|
909
972
|
" ",
|
|
910
|
-
|
|
973
|
+
Ee(e == null ? void 0 : e.name),
|
|
911
974
|
" ",
|
|
912
975
|
"ab"
|
|
913
|
-
] }) }) : /* @__PURE__ */
|
|
976
|
+
] }) }) : /* @__PURE__ */ n(Ce, {})
|
|
914
977
|
}
|
|
915
978
|
),
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
e != null && e.name ? /* @__PURE__ */
|
|
918
|
-
t ? /* @__PURE__ */
|
|
979
|
+
/* @__PURE__ */ n(to, { sx: { width: "100%" }, in: o, children: /* @__PURE__ */ n(ft, { in: o, children: /* @__PURE__ */ x(I, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
|
|
980
|
+
e != null && e.name ? /* @__PURE__ */ n(E, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ n(me, { animation: !1, width: "50%" }),
|
|
981
|
+
t ? /* @__PURE__ */ n(E, { children: Ge(t) }) : /* @__PURE__ */ n(me, { animation: !1, width: "25%" })
|
|
919
982
|
] }) }) })
|
|
920
983
|
]
|
|
921
984
|
}
|
|
922
985
|
);
|
|
923
986
|
}
|
|
924
|
-
function
|
|
987
|
+
function ro({
|
|
925
988
|
open: e,
|
|
926
989
|
widthClosed: t,
|
|
927
|
-
widthOpen:
|
|
990
|
+
widthOpen: o,
|
|
928
991
|
"data-testid": i,
|
|
929
992
|
top: r,
|
|
930
993
|
middle: s,
|
|
931
994
|
bottom: c,
|
|
932
995
|
user: a,
|
|
933
996
|
domainCode: l,
|
|
934
|
-
useNewAvatar:
|
|
997
|
+
useNewAvatar: u = !1
|
|
935
998
|
}) {
|
|
936
|
-
const
|
|
937
|
-
return /* @__PURE__ */
|
|
938
|
-
|
|
999
|
+
const g = Ke(), w = Oe(Q);
|
|
1000
|
+
return /* @__PURE__ */ n(eo, { className: G.root, "data-testid": i, children: /* @__PURE__ */ x(
|
|
1001
|
+
oo,
|
|
939
1002
|
{
|
|
940
1003
|
open: e,
|
|
941
|
-
widthOpen:
|
|
1004
|
+
widthOpen: o,
|
|
942
1005
|
widthClosed: t,
|
|
943
1006
|
anchor: "left",
|
|
944
|
-
variant:
|
|
1007
|
+
variant: g ? "temporary" : "permanent",
|
|
945
1008
|
PaperProps: {
|
|
946
1009
|
component: "nav"
|
|
947
1010
|
},
|
|
948
1011
|
onClose: () => {
|
|
949
|
-
|
|
1012
|
+
w(!1);
|
|
950
1013
|
},
|
|
951
|
-
isSmallScreen:
|
|
1014
|
+
isSmallScreen: g,
|
|
952
1015
|
children: [
|
|
953
|
-
!
|
|
954
|
-
r && /* @__PURE__ */
|
|
1016
|
+
!g && /* @__PURE__ */ n(mt, {}),
|
|
1017
|
+
r && /* @__PURE__ */ x(I, { flexGrow: "0", children: [
|
|
955
1018
|
r,
|
|
956
|
-
/* @__PURE__ */
|
|
1019
|
+
/* @__PURE__ */ n(ge, { variant: "middle", sx: { marginY: "0.5rem" } })
|
|
957
1020
|
] }),
|
|
958
|
-
/* @__PURE__ */
|
|
959
|
-
/* @__PURE__ */
|
|
960
|
-
/* @__PURE__ */
|
|
961
|
-
/* @__PURE__ */
|
|
962
|
-
c && /* @__PURE__ */
|
|
1021
|
+
/* @__PURE__ */ n(I, { flexGrow: "1", children: Array.isArray(s) ? /* @__PURE__ */ n(jt, { links: s }) : s }),
|
|
1022
|
+
/* @__PURE__ */ x(I, { flexGrow: "0", children: [
|
|
1023
|
+
/* @__PURE__ */ n(ge, { variant: "middle", sx: { marginY: "0.5rem" } }),
|
|
1024
|
+
/* @__PURE__ */ n(io, { user: a, domainCode: l, open: e, useNewAvatar: u }),
|
|
1025
|
+
c && /* @__PURE__ */ n(N, { children: c })
|
|
963
1026
|
] })
|
|
964
1027
|
]
|
|
965
1028
|
}
|
|
966
1029
|
) });
|
|
967
1030
|
}
|
|
968
|
-
function
|
|
1031
|
+
function ao({
|
|
969
1032
|
children: e,
|
|
970
1033
|
topBarHeight: t,
|
|
971
|
-
maxWidth:
|
|
1034
|
+
maxWidth: o = !1,
|
|
972
1035
|
noPadding: i
|
|
973
1036
|
}) {
|
|
974
|
-
return /* @__PURE__ */
|
|
975
|
-
|
|
1037
|
+
return /* @__PURE__ */ n(
|
|
1038
|
+
I,
|
|
976
1039
|
{
|
|
977
1040
|
sx: {
|
|
978
1041
|
overflow: "auto",
|
|
979
1042
|
height: `calc(100vh - ${t}px)`,
|
|
980
1043
|
flexGrow: 1
|
|
981
1044
|
},
|
|
982
|
-
children: i ? /* @__PURE__ */
|
|
983
|
-
|
|
1045
|
+
children: i ? /* @__PURE__ */ n(I, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ n(
|
|
1046
|
+
gt,
|
|
984
1047
|
{
|
|
985
1048
|
component: "main",
|
|
986
1049
|
id: "main-content",
|
|
987
|
-
maxWidth:
|
|
1050
|
+
maxWidth: o,
|
|
988
1051
|
sx: { paddingTop: 3, paddingBottom: 3, flexGrow: 1 },
|
|
989
1052
|
children: e
|
|
990
1053
|
}
|
|
@@ -992,18 +1055,18 @@ function Zt({
|
|
|
992
1055
|
}
|
|
993
1056
|
);
|
|
994
1057
|
}
|
|
995
|
-
const
|
|
996
|
-
titleText: `${
|
|
1058
|
+
const so = "TopBar", lo = {
|
|
1059
|
+
titleText: `${so}-titleText`
|
|
997
1060
|
};
|
|
998
|
-
function
|
|
1061
|
+
function co({
|
|
999
1062
|
titleText: e = "",
|
|
1000
1063
|
height: t,
|
|
1001
|
-
"data-testid":
|
|
1064
|
+
"data-testid": o,
|
|
1002
1065
|
middle: i
|
|
1003
1066
|
}) {
|
|
1004
|
-
const r =
|
|
1005
|
-
return /* @__PURE__ */
|
|
1006
|
-
|
|
1067
|
+
const r = Oe(Q), s = () => r((l) => !l), c = J(), a = Ke();
|
|
1068
|
+
return /* @__PURE__ */ n("header", { "data-testid": o, children: /* @__PURE__ */ x(
|
|
1069
|
+
_e,
|
|
1007
1070
|
{
|
|
1008
1071
|
square: !0,
|
|
1009
1072
|
elevation: 0,
|
|
@@ -1020,74 +1083,74 @@ function tn({
|
|
|
1020
1083
|
zIndex: a ? 0 : c.zIndex.drawer + 101
|
|
1021
1084
|
},
|
|
1022
1085
|
children: [
|
|
1023
|
-
/* @__PURE__ */
|
|
1024
|
-
|
|
1086
|
+
/* @__PURE__ */ n(
|
|
1087
|
+
xt,
|
|
1025
1088
|
{
|
|
1026
1089
|
size: "medium",
|
|
1027
1090
|
color: "inherit",
|
|
1028
1091
|
sx: { padding: 1.5, marginLeft: "12px" },
|
|
1029
1092
|
onClick: s,
|
|
1030
|
-
children: /* @__PURE__ */
|
|
1093
|
+
children: /* @__PURE__ */ n(St, { fontSize: "medium" })
|
|
1031
1094
|
}
|
|
1032
1095
|
),
|
|
1033
|
-
/* @__PURE__ */
|
|
1096
|
+
/* @__PURE__ */ n(E, { className: lo.titleText, variant: "h6", component: "h1", children: e }),
|
|
1034
1097
|
i
|
|
1035
1098
|
]
|
|
1036
1099
|
}
|
|
1037
1100
|
) });
|
|
1038
1101
|
}
|
|
1039
|
-
function
|
|
1102
|
+
function Wo({
|
|
1040
1103
|
children: e,
|
|
1041
1104
|
initialTitleText: t,
|
|
1042
|
-
initialNavBarOpen:
|
|
1105
|
+
initialNavBarOpen: o,
|
|
1043
1106
|
pageContainerProps: i,
|
|
1044
1107
|
pageContentDataTestId: r,
|
|
1045
1108
|
topBarDataTestId: s,
|
|
1046
1109
|
navBarDataTestId: c,
|
|
1047
1110
|
navBarMiddle: a,
|
|
1048
1111
|
navBarBottom: l,
|
|
1049
|
-
user:
|
|
1050
|
-
domainCode:
|
|
1051
|
-
useNewAvatar:
|
|
1112
|
+
user: u,
|
|
1113
|
+
domainCode: g,
|
|
1114
|
+
useNewAvatar: w = !1
|
|
1052
1115
|
}) {
|
|
1053
|
-
|
|
1054
|
-
[
|
|
1055
|
-
[
|
|
1116
|
+
Ft([
|
|
1117
|
+
[Q, o != null ? o : !0],
|
|
1118
|
+
[De, t != null ? t : ""]
|
|
1056
1119
|
]);
|
|
1057
|
-
const
|
|
1058
|
-
return /* @__PURE__ */
|
|
1059
|
-
/* @__PURE__ */
|
|
1060
|
-
/* @__PURE__ */
|
|
1061
|
-
|
|
1120
|
+
const S = xe(Q), [A] = W(Xt), [v] = W(Yt), D = xe(De), [f] = W(Jt), [k] = W(Qt), [y] = W(Zt);
|
|
1121
|
+
return /* @__PURE__ */ x(Ae, { children: [
|
|
1122
|
+
/* @__PURE__ */ n(bt, {}),
|
|
1123
|
+
/* @__PURE__ */ n(
|
|
1124
|
+
co,
|
|
1062
1125
|
{
|
|
1063
1126
|
titleText: D,
|
|
1064
1127
|
"data-testid": s,
|
|
1065
|
-
height:
|
|
1128
|
+
height: f,
|
|
1066
1129
|
middle: k
|
|
1067
1130
|
}
|
|
1068
1131
|
),
|
|
1069
|
-
/* @__PURE__ */
|
|
1070
|
-
/* @__PURE__ */
|
|
1071
|
-
|
|
1132
|
+
/* @__PURE__ */ x(Ae, { sx: { display: "flex" }, children: [
|
|
1133
|
+
/* @__PURE__ */ n(
|
|
1134
|
+
ro,
|
|
1072
1135
|
{
|
|
1073
|
-
open:
|
|
1074
|
-
top:
|
|
1136
|
+
open: S,
|
|
1137
|
+
top: y,
|
|
1075
1138
|
middle: a,
|
|
1076
1139
|
bottom: l,
|
|
1077
|
-
user:
|
|
1078
|
-
domainCode:
|
|
1079
|
-
widthOpen:
|
|
1080
|
-
widthClosed:
|
|
1081
|
-
offsetTop:
|
|
1140
|
+
user: u,
|
|
1141
|
+
domainCode: g,
|
|
1142
|
+
widthOpen: A,
|
|
1143
|
+
widthClosed: v,
|
|
1144
|
+
offsetTop: f,
|
|
1082
1145
|
"data-testid": c,
|
|
1083
|
-
useNewAvatar:
|
|
1146
|
+
useNewAvatar: w
|
|
1084
1147
|
}
|
|
1085
1148
|
),
|
|
1086
|
-
/* @__PURE__ */
|
|
1087
|
-
|
|
1088
|
-
|
|
1149
|
+
/* @__PURE__ */ n(
|
|
1150
|
+
ao,
|
|
1151
|
+
b(p({
|
|
1089
1152
|
"data-testid": r,
|
|
1090
|
-
topBarHeight:
|
|
1153
|
+
topBarHeight: f
|
|
1091
1154
|
}, i), {
|
|
1092
1155
|
children: e
|
|
1093
1156
|
})
|
|
@@ -1095,7 +1158,7 @@ function $n({
|
|
|
1095
1158
|
] })
|
|
1096
1159
|
] });
|
|
1097
1160
|
}
|
|
1098
|
-
const
|
|
1161
|
+
const qo = Ue({
|
|
1099
1162
|
palette: {
|
|
1100
1163
|
primary: {
|
|
1101
1164
|
dark: "#00A651",
|
|
@@ -1146,7 +1209,7 @@ const Mn = Me({
|
|
|
1146
1209
|
navBar: {
|
|
1147
1210
|
backgroundColor: "#E8E8E8"
|
|
1148
1211
|
}
|
|
1149
|
-
}),
|
|
1212
|
+
}), zo = Ue({
|
|
1150
1213
|
palette: {
|
|
1151
1214
|
primary: {
|
|
1152
1215
|
main: "#007236",
|
|
@@ -1200,18 +1263,18 @@ const Mn = Me({
|
|
|
1200
1263
|
styleOverrides: {
|
|
1201
1264
|
root: ({ theme: e }) => ({
|
|
1202
1265
|
"&.Mui-selected": {
|
|
1203
|
-
backgroundColor:
|
|
1266
|
+
backgroundColor: te(
|
|
1204
1267
|
e.palette.secondary.main,
|
|
1205
1268
|
e.palette.action.selectedOpacity
|
|
1206
1269
|
),
|
|
1207
1270
|
"&:hover": {
|
|
1208
|
-
backgroundColor:
|
|
1271
|
+
backgroundColor: te(
|
|
1209
1272
|
e.palette.secondary.main,
|
|
1210
1273
|
e.palette.action.selectedOpacity
|
|
1211
1274
|
)
|
|
1212
1275
|
},
|
|
1213
1276
|
"&.Mui-focusVisible": {
|
|
1214
|
-
backgroundColor:
|
|
1277
|
+
backgroundColor: te(
|
|
1215
1278
|
e.palette.secondary.main,
|
|
1216
1279
|
e.palette.action.focusOpacity
|
|
1217
1280
|
)
|
|
@@ -1242,39 +1305,39 @@ const Mn = Me({
|
|
|
1242
1305
|
}
|
|
1243
1306
|
});
|
|
1244
1307
|
export {
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1308
|
+
Be as AgDialog,
|
|
1309
|
+
Wo as AppLayout,
|
|
1310
|
+
No as AuthGuard,
|
|
1311
|
+
qe as Context,
|
|
1312
|
+
ze as ContextError,
|
|
1313
|
+
zt as DOMAIN_CODE_LABELS,
|
|
1314
|
+
Lo as DomainCodeDialog,
|
|
1315
|
+
Io as ExampleComponent,
|
|
1316
|
+
_o as FetchAutocomplete,
|
|
1317
|
+
Mo as MUI_AUTOCOMPLETE_VALUE_WARNING_REGEX,
|
|
1318
|
+
Ht as SaladBarProvider,
|
|
1319
|
+
Po as SessionExpiryDialog,
|
|
1320
|
+
To as SingleAutocomplete,
|
|
1321
|
+
Oo as determineUserLevelFromClaims,
|
|
1322
|
+
qt as domainCodeAtom,
|
|
1323
|
+
qo as fed21Theme,
|
|
1324
|
+
It as getAuth0Expiry,
|
|
1325
|
+
Ge as getDomainOptionLabel,
|
|
1326
|
+
Uo as getValidBusinessRoles,
|
|
1327
|
+
zo as internalAgSystemsTheme,
|
|
1328
|
+
Q as navBarOpenAtom,
|
|
1329
|
+
Zt as navBarTopAtom,
|
|
1330
|
+
Yt as navBarWidthClosedAtom,
|
|
1331
|
+
Xt as navBarWidthOpenAtom,
|
|
1332
|
+
no as simpleHashCode,
|
|
1333
|
+
Bo as suppressConsole,
|
|
1334
|
+
De as titleTextAtom,
|
|
1335
|
+
Jt as topBarHeightAtom,
|
|
1336
|
+
Qt as topBarMiddleAtom,
|
|
1337
|
+
Ho as unsuppressConsole,
|
|
1338
|
+
We as useAutocompleteOptions,
|
|
1339
|
+
Wt as useSaladBar,
|
|
1340
|
+
Ro as useValidDomains,
|
|
1341
|
+
$o as withSaladBarProvider
|
|
1279
1342
|
};
|
|
1280
1343
|
//# sourceMappingURL=index.js.map
|