finform-react-builder 1.5.5 → 1.5.6
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/README.md +208 -0
- package/dist/index.es.js +1029 -1005
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2,49 +2,49 @@ var Ta = (e) => {
|
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
4
|
var fi = (e, t, r) => t.has(e) || Ta("Cannot " + r);
|
|
5
|
-
var v = (e, t, r) => (fi(e, t, "read from private field"), r ? r.call(e) : t.get(e)),
|
|
5
|
+
var v = (e, t, r) => (fi(e, t, "read from private field"), r ? r.call(e) : t.get(e)), se = (e, t, r) => t.has(e) ? Ta("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), J = (e, t, r, n) => (fi(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r), de = (e, t, r) => (fi(e, t, "access private method"), r);
|
|
6
6
|
var bn = (e, t, r, n) => ({
|
|
7
7
|
set _(i) {
|
|
8
|
-
|
|
8
|
+
J(e, t, i, r);
|
|
9
9
|
},
|
|
10
10
|
get _() {
|
|
11
11
|
return v(e, t, n);
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
import { jsx as $, jsxs as
|
|
15
|
-
import * as
|
|
16
|
-
import ge, { useMemo as
|
|
17
|
-
import { Box as Se, TextField as wn, Autocomplete as Al, CircularProgress as _r, Chip as zn, Checkbox as _a, FormControlLabel as Sn, Switch as Fl, FormHelperText as Hr, FormControl as mi, Typography as
|
|
14
|
+
import { jsx as $, jsxs as Te, Fragment as kl } from "react/jsx-runtime";
|
|
15
|
+
import * as Fe from "react";
|
|
16
|
+
import ge, { useMemo as Ve, useState as Xt, useRef as xt, useCallback as je, useEffect as wt, createElement as io, useReducer as Ol, forwardRef as Tl, useImperativeHandle as _l, Fragment as Cl } from "react";
|
|
17
|
+
import { Box as Se, TextField as wn, Autocomplete as Al, CircularProgress as _r, Chip as zn, Checkbox as _a, FormControlLabel as Sn, Switch as Fl, FormHelperText as Hr, FormControl as mi, Typography as ze, RadioGroup as Ca, Radio as Aa, InputLabel as $l, Select as Dl, MenuItem as En, Stepper as Rl, Step as Pl, StepLabel as jl, Button as Bt, ButtonGroup as Il, createTheme as Ml, ThemeProvider as zl, Paper as ao, Tooltip as Vl, IconButton as Nl, Alert as Ll } from "@mui/material";
|
|
18
18
|
import ql from "@emotion/styled";
|
|
19
19
|
import "@emotion/react";
|
|
20
20
|
var pn = (e) => e.type === "checkbox", tr = (e) => e instanceof Date, Ue = (e) => e == null;
|
|
21
21
|
const so = (e) => typeof e == "object";
|
|
22
|
-
var
|
|
22
|
+
var De = (e) => !Ue(e) && !Array.isArray(e) && so(e) && !tr(e), oo = (e) => De(e) && e.target ? pn(e.target) ? e.target.checked : e.target.value : e, Bl = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, lo = (e, t) => e.has(Bl(t)), Ul = (e) => {
|
|
23
23
|
const t = e.constructor && e.constructor.prototype;
|
|
24
|
-
return
|
|
24
|
+
return De(t) && t.hasOwnProperty("isPrototypeOf");
|
|
25
25
|
}, ia = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
26
|
-
function
|
|
26
|
+
function Me(e) {
|
|
27
27
|
let t;
|
|
28
28
|
const r = Array.isArray(e), n = typeof FileList < "u" ? e instanceof FileList : !1;
|
|
29
29
|
if (e instanceof Date)
|
|
30
30
|
t = new Date(e);
|
|
31
31
|
else if (e instanceof Set)
|
|
32
32
|
t = new Set(e);
|
|
33
|
-
else if (!(ia && (e instanceof Blob || n)) && (r ||
|
|
33
|
+
else if (!(ia && (e instanceof Blob || n)) && (r || De(e)))
|
|
34
34
|
if (t = r ? [] : {}, !r && !Ul(e))
|
|
35
35
|
t = e;
|
|
36
36
|
else
|
|
37
37
|
for (const i in e)
|
|
38
|
-
e.hasOwnProperty(i) && (t[i] =
|
|
38
|
+
e.hasOwnProperty(i) && (t[i] = Me(e[i]));
|
|
39
39
|
else
|
|
40
40
|
return e;
|
|
41
41
|
return t;
|
|
42
42
|
}
|
|
43
|
-
var ti = (e) => /^\w*$/.test(e),
|
|
44
|
-
if (!t ||
|
|
43
|
+
var ti = (e) => /^\w*$/.test(e), $e = (e) => e === void 0, aa = (e) => Array.isArray(e) ? e.filter(Boolean) : [], sa = (e) => aa(e.replace(/["|']|\]/g, "").split(/\.|\[/)), B = (e, t, r) => {
|
|
44
|
+
if (!t || !De(e))
|
|
45
45
|
return r;
|
|
46
46
|
const n = (ti(t) ? [t] : sa(t)).reduce((i, a) => Ue(i) ? i : i[a], e);
|
|
47
|
-
return
|
|
47
|
+
return $e(n) || n === e ? $e(e[t]) ? r : e[t] : n;
|
|
48
48
|
}, Ye = (e) => typeof e == "boolean", he = (e, t, r) => {
|
|
49
49
|
let n = -1;
|
|
50
50
|
const i = ti(t) ? [t] : sa(t), a = i.length, s = a - 1;
|
|
@@ -53,7 +53,7 @@ var ti = (e) => /^\w*$/.test(e), Fe = (e) => e === void 0, aa = (e) => Array.isA
|
|
|
53
53
|
let l = r;
|
|
54
54
|
if (n !== s) {
|
|
55
55
|
const p = e[o];
|
|
56
|
-
l =
|
|
56
|
+
l = De(p) || Array.isArray(p) ? p : isNaN(+i[n + 1]) ? {} : [];
|
|
57
57
|
}
|
|
58
58
|
if (o === "__proto__" || o === "constructor" || o === "prototype")
|
|
59
59
|
return;
|
|
@@ -94,7 +94,7 @@ var uo = (e, t, r, n = !0) => {
|
|
|
94
94
|
});
|
|
95
95
|
return i;
|
|
96
96
|
};
|
|
97
|
-
const la = typeof window < "u" ?
|
|
97
|
+
const la = typeof window < "u" ? Fe.useLayoutEffect : Fe.useEffect;
|
|
98
98
|
function Wl(e) {
|
|
99
99
|
const t = oa(), { control: r = t.control, disabled: n, name: i, exact: a } = e || {}, [s, o] = ge.useState(r._formState), l = ge.useRef({
|
|
100
100
|
isDirty: !1,
|
|
@@ -120,7 +120,7 @@ function Wl(e) {
|
|
|
120
120
|
l.current.isValid && r._setValid(!0);
|
|
121
121
|
}, [r]), ge.useMemo(() => uo(s, r, l.current, !1), [s, r]);
|
|
122
122
|
}
|
|
123
|
-
var bt = (e) => typeof e == "string", po = (e, t, r, n, i) => bt(e) ? (n && t.watch.add(e),
|
|
123
|
+
var bt = (e) => typeof e == "string", po = (e, t, r, n, i) => bt(e) ? (n && t.watch.add(e), B(r, e, i)) : Array.isArray(e) ? e.map((a) => (n && t.watch.add(a), B(r, a))) : (n && (t.watchAll = !0), r);
|
|
124
124
|
function Hl(e) {
|
|
125
125
|
const t = oa(), { control: r = t.control, name: n, defaultValue: i, disabled: a, exact: s } = e || {}, o = ge.useRef(i), [l, p] = ge.useState(r._getWatch(n, o.current));
|
|
126
126
|
return la(() => r._subscribe({
|
|
@@ -136,7 +136,7 @@ function Kl(e) {
|
|
|
136
136
|
const t = oa(), { name: r, disabled: n, control: i = t.control, shouldUnregister: a } = e, s = lo(i._names.array, r), o = Hl({
|
|
137
137
|
control: i,
|
|
138
138
|
name: r,
|
|
139
|
-
defaultValue:
|
|
139
|
+
defaultValue: B(i._formValues, r, B(i._defaultValues, r, e.defaultValue)),
|
|
140
140
|
exact: !0
|
|
141
141
|
}), l = Wl({
|
|
142
142
|
control: i,
|
|
@@ -149,23 +149,23 @@ function Kl(e) {
|
|
|
149
149
|
})), f = ge.useMemo(() => Object.defineProperties({}, {
|
|
150
150
|
invalid: {
|
|
151
151
|
enumerable: !0,
|
|
152
|
-
get: () => !!
|
|
152
|
+
get: () => !!B(l.errors, r)
|
|
153
153
|
},
|
|
154
154
|
isDirty: {
|
|
155
155
|
enumerable: !0,
|
|
156
|
-
get: () => !!
|
|
156
|
+
get: () => !!B(l.dirtyFields, r)
|
|
157
157
|
},
|
|
158
158
|
isTouched: {
|
|
159
159
|
enumerable: !0,
|
|
160
|
-
get: () => !!
|
|
160
|
+
get: () => !!B(l.touchedFields, r)
|
|
161
161
|
},
|
|
162
162
|
isValidating: {
|
|
163
163
|
enumerable: !0,
|
|
164
|
-
get: () => !!
|
|
164
|
+
get: () => !!B(l.validatingFields, r)
|
|
165
165
|
},
|
|
166
166
|
error: {
|
|
167
167
|
enumerable: !0,
|
|
168
|
-
get: () =>
|
|
168
|
+
get: () => B(l.errors, r)
|
|
169
169
|
}
|
|
170
170
|
}), [l, r]), m = ge.useCallback((x) => d.current.onChange({
|
|
171
171
|
target: {
|
|
@@ -175,12 +175,12 @@ function Kl(e) {
|
|
|
175
175
|
type: Vn.CHANGE
|
|
176
176
|
}), [r]), b = ge.useCallback(() => d.current.onBlur({
|
|
177
177
|
target: {
|
|
178
|
-
value:
|
|
178
|
+
value: B(i._formValues, r),
|
|
179
179
|
name: r
|
|
180
180
|
},
|
|
181
181
|
type: Vn.BLUR
|
|
182
182
|
}), [r, i._formValues]), h = ge.useCallback((x) => {
|
|
183
|
-
const y =
|
|
183
|
+
const y = B(i._fields, r);
|
|
184
184
|
y && x && (y._f.ref = {
|
|
185
185
|
focus: () => x.focus && x.focus(),
|
|
186
186
|
select: () => x.select && x.select(),
|
|
@@ -202,12 +202,12 @@ function Kl(e) {
|
|
|
202
202
|
...Ye(p.current.disabled) ? { disabled: p.current.disabled } : {}
|
|
203
203
|
});
|
|
204
204
|
const y = (O, F) => {
|
|
205
|
-
const C =
|
|
205
|
+
const C = B(i._fields, O);
|
|
206
206
|
C && C._f && (C._f.mount = F);
|
|
207
207
|
};
|
|
208
208
|
if (y(r, !0), x) {
|
|
209
|
-
const O =
|
|
210
|
-
he(i._defaultValues, r, O),
|
|
209
|
+
const O = Me(B(i._options.defaultValues, r));
|
|
210
|
+
he(i._defaultValues, r, O), $e(B(i._formValues, r)) && he(i._formValues, r, O);
|
|
211
211
|
}
|
|
212
212
|
return !s && i.register(r), () => {
|
|
213
213
|
(s ? x && !i._state.action : x) ? i.unregister(r) : y(r, !1);
|
|
@@ -264,13 +264,13 @@ function Pt(e, t) {
|
|
|
264
264
|
return !1;
|
|
265
265
|
if (i !== "ref") {
|
|
266
266
|
const s = t[i];
|
|
267
|
-
if (tr(a) && tr(s) ||
|
|
267
|
+
if (tr(a) && tr(s) || De(a) && De(s) || Array.isArray(a) && Array.isArray(s) ? !Pt(a, s) : a !== s)
|
|
268
268
|
return !1;
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
return !0;
|
|
272
272
|
}
|
|
273
|
-
var Ke = (e) =>
|
|
273
|
+
var Ke = (e) => De(e) && !Object.keys(e).length, ca = (e) => e.type === "file", ct = (e) => typeof e == "function", Nn = (e) => {
|
|
274
274
|
if (!ia)
|
|
275
275
|
return !1;
|
|
276
276
|
const t = e ? e.ownerDocument : 0;
|
|
@@ -280,18 +280,18 @@ function Gl(e, t) {
|
|
|
280
280
|
const r = t.slice(0, -1).length;
|
|
281
281
|
let n = 0;
|
|
282
282
|
for (; n < r; )
|
|
283
|
-
e =
|
|
283
|
+
e = $e(e) ? n++ : e[t[n++]];
|
|
284
284
|
return e;
|
|
285
285
|
}
|
|
286
286
|
function Yl(e) {
|
|
287
287
|
for (const t in e)
|
|
288
|
-
if (e.hasOwnProperty(t) &&
|
|
288
|
+
if (e.hasOwnProperty(t) && !$e(e[t]))
|
|
289
289
|
return !1;
|
|
290
290
|
return !0;
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function Pe(e, t) {
|
|
293
293
|
const r = Array.isArray(t) ? t : ti(t) ? [t] : sa(t), n = r.length === 1 ? e : Gl(e, r), i = r.length - 1, a = r[i];
|
|
294
|
-
return n && delete n[a], i !== 0 && (
|
|
294
|
+
return n && delete n[a], i !== 0 && (De(n) && Ke(n) || Array.isArray(n) && Yl(n)) && Pe(e, r.slice(0, -1)), e;
|
|
295
295
|
}
|
|
296
296
|
var ho = (e) => {
|
|
297
297
|
for (const t in e)
|
|
@@ -301,16 +301,16 @@ var ho = (e) => {
|
|
|
301
301
|
};
|
|
302
302
|
function Ln(e, t = {}) {
|
|
303
303
|
const r = Array.isArray(e);
|
|
304
|
-
if (
|
|
304
|
+
if (De(e) || r)
|
|
305
305
|
for (const n in e)
|
|
306
|
-
Array.isArray(e[n]) ||
|
|
306
|
+
Array.isArray(e[n]) || De(e[n]) && !ho(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, Ln(e[n], t[n])) : Ue(e[n]) || (t[n] = !0);
|
|
307
307
|
return t;
|
|
308
308
|
}
|
|
309
309
|
function go(e, t, r) {
|
|
310
310
|
const n = Array.isArray(e);
|
|
311
|
-
if (
|
|
311
|
+
if (De(e) || n)
|
|
312
312
|
for (const i in e)
|
|
313
|
-
Array.isArray(e[i]) ||
|
|
313
|
+
Array.isArray(e[i]) || De(e[i]) && !ho(e[i]) ? $e(t) || Di(r[i]) ? r[i] = Array.isArray(e[i]) ? Ln(e[i], []) : { ...Ln(e[i]) } : go(e[i], Ue(t) ? {} : t[i], r[i]) : r[i] = !Pt(e[i], t[i]);
|
|
314
314
|
return r;
|
|
315
315
|
}
|
|
316
316
|
var Kr = (e, t) => go(e, t, Ln(t));
|
|
@@ -326,11 +326,11 @@ var yo = (e) => {
|
|
|
326
326
|
}
|
|
327
327
|
return e[0].checked && !e[0].disabled ? (
|
|
328
328
|
// @ts-expect-error expected to work in the browser
|
|
329
|
-
e[0].attributes &&
|
|
329
|
+
e[0].attributes && !$e(e[0].attributes.value) ? $e(e[0].value) || e[0].value === "" ? Da : { value: e[0].value, isValid: !0 } : Da
|
|
330
330
|
) : $a;
|
|
331
331
|
}
|
|
332
332
|
return $a;
|
|
333
|
-
}, vo = (e, { valueAsNumber: t, valueAsDate: r, setValueAs: n }) =>
|
|
333
|
+
}, vo = (e, { valueAsNumber: t, valueAsDate: r, setValueAs: n }) => $e(e) ? e : t ? e === "" ? NaN : e && +e : r && bt(e) ? new Date(e) : n ? n(e) : e;
|
|
334
334
|
const Ra = {
|
|
335
335
|
isValid: !1,
|
|
336
336
|
value: null
|
|
@@ -341,12 +341,12 @@ var xo = (e) => Array.isArray(e) ? e.reduce((t, r) => r && r.checked && !r.disab
|
|
|
341
341
|
} : t, Ra) : Ra;
|
|
342
342
|
function Pa(e) {
|
|
343
343
|
const t = e.ref;
|
|
344
|
-
return ca(t) ? t.files : ua(t) ? xo(e.refs).value : mo(t) ? [...t.selectedOptions].map(({ value: r }) => r) : pn(t) ? yo(e.refs).value : vo(
|
|
344
|
+
return ca(t) ? t.files : ua(t) ? xo(e.refs).value : mo(t) ? [...t.selectedOptions].map(({ value: r }) => r) : pn(t) ? yo(e.refs).value : vo($e(t.value) ? e.ref.value : t.value, e);
|
|
345
345
|
}
|
|
346
346
|
var Zl = (e, t, r, n) => {
|
|
347
347
|
const i = {};
|
|
348
348
|
for (const a of e) {
|
|
349
|
-
const s =
|
|
349
|
+
const s = B(t, a);
|
|
350
350
|
s && he(i, a, s._f);
|
|
351
351
|
}
|
|
352
352
|
return {
|
|
@@ -355,7 +355,7 @@ var Zl = (e, t, r, n) => {
|
|
|
355
355
|
fields: i,
|
|
356
356
|
shouldUseNativeValidation: n
|
|
357
357
|
};
|
|
358
|
-
}, qn = (e) => e instanceof RegExp, Qr = (e) =>
|
|
358
|
+
}, qn = (e) => e instanceof RegExp, Qr = (e) => $e(e) ? e : qn(e) ? e.source : De(e) ? qn(e.value) ? e.value.source : e.value : e, ja = (e) => ({
|
|
359
359
|
isOnSubmit: !e || e === lt.onSubmit,
|
|
360
360
|
isOnBlur: e === lt.onBlur,
|
|
361
361
|
isOnChange: e === lt.onChange,
|
|
@@ -363,10 +363,10 @@ var Zl = (e, t, r, n) => {
|
|
|
363
363
|
isOnTouch: e === lt.onTouched
|
|
364
364
|
});
|
|
365
365
|
const Ia = "AsyncFunction";
|
|
366
|
-
var Jl = (e) => !!e && !!e.validate && !!(ct(e.validate) && e.validate.constructor.name === Ia ||
|
|
366
|
+
var Jl = (e) => !!e && !!e.validate && !!(ct(e.validate) && e.validate.constructor.name === Ia || De(e.validate) && Object.values(e.validate).find((t) => t.constructor.name === Ia)), Xl = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), Ma = (e, t, r) => !r && (t.watchAll || t.watch.has(e) || [...t.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
|
|
367
367
|
const tn = (e, t, r, n) => {
|
|
368
368
|
for (const i of r || Object.keys(e)) {
|
|
369
|
-
const a =
|
|
369
|
+
const a = B(e, i);
|
|
370
370
|
if (a) {
|
|
371
371
|
const { _f: s, ...o } = a;
|
|
372
372
|
if (s) {
|
|
@@ -376,13 +376,13 @@ const tn = (e, t, r, n) => {
|
|
|
376
376
|
return !0;
|
|
377
377
|
if (tn(o, t))
|
|
378
378
|
break;
|
|
379
|
-
} else if (
|
|
379
|
+
} else if (De(o) && tn(o, t))
|
|
380
380
|
break;
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
};
|
|
384
384
|
function za(e, t, r) {
|
|
385
|
-
const n =
|
|
385
|
+
const n = B(e, r);
|
|
386
386
|
if (n || ti(r))
|
|
387
387
|
return {
|
|
388
388
|
error: n,
|
|
@@ -390,7 +390,7 @@ function za(e, t, r) {
|
|
|
390
390
|
};
|
|
391
391
|
const i = r.split(".");
|
|
392
392
|
for (; i.length; ) {
|
|
393
|
-
const a = i.join("."), s =
|
|
393
|
+
const a = i.join("."), s = B(t, a), o = B(e, a);
|
|
394
394
|
if (s && !Array.isArray(s) && r !== a)
|
|
395
395
|
return { name: r };
|
|
396
396
|
if (o && o.type)
|
|
@@ -413,8 +413,8 @@ var ec = (e, t, r, n) => {
|
|
|
413
413
|
r(e);
|
|
414
414
|
const { name: i, ...a } = e;
|
|
415
415
|
return Ke(a) || Object.keys(a).length >= Object.keys(t).length || Object.keys(a).find((s) => t[s] === (!n || lt.all));
|
|
416
|
-
}, tc = (e, t, r) => !e || !t || e === t || en(e).some((n) => n && (r ? n === t : n.startsWith(t) || t.startsWith(n))), rc = (e, t, r, n, i) => i.isOnAll ? !1 : !r && i.isOnTouch ? !(t || e) : (r ? n.isOnBlur : i.isOnBlur) ? !e : (r ? n.isOnChange : i.isOnChange) ? e : !0, nc = (e, t) => !aa(
|
|
417
|
-
const n = en(
|
|
416
|
+
}, tc = (e, t, r) => !e || !t || e === t || en(e).some((n) => n && (r ? n === t : n.startsWith(t) || t.startsWith(n))), rc = (e, t, r, n, i) => i.isOnAll ? !1 : !r && i.isOnTouch ? !(t || e) : (r ? n.isOnBlur : i.isOnBlur) ? !e : (r ? n.isOnChange : i.isOnChange) ? e : !0, nc = (e, t) => !aa(B(e, t)).length && Pe(e, t), ic = (e, t, r) => {
|
|
417
|
+
const n = en(B(e, r));
|
|
418
418
|
return he(n, "root", t[r]), he(e, r, n), e;
|
|
419
419
|
}, Pn = (e) => bt(e);
|
|
420
420
|
function Va(e, t, r = "validate") {
|
|
@@ -425,25 +425,25 @@ function Va(e, t, r = "validate") {
|
|
|
425
425
|
ref: t
|
|
426
426
|
};
|
|
427
427
|
}
|
|
428
|
-
var vr = (e) =>
|
|
428
|
+
var vr = (e) => De(e) && !qn(e) ? e : {
|
|
429
429
|
value: e,
|
|
430
430
|
message: ""
|
|
431
431
|
}, Na = async (e, t, r, n, i, a) => {
|
|
432
|
-
const { ref: s, refs: o, required: l, maxLength: p, minLength: d, min: f, max: m, pattern: b, validate: h, name: c, valueAsNumber: x, mount: y } = e._f, O =
|
|
432
|
+
const { ref: s, refs: o, required: l, maxLength: p, minLength: d, min: f, max: m, pattern: b, validate: h, name: c, valueAsNumber: x, mount: y } = e._f, O = B(r, c);
|
|
433
433
|
if (!y || t.has(c))
|
|
434
434
|
return {};
|
|
435
435
|
const F = o ? o[0] : s, C = (k) => {
|
|
436
436
|
i && F.reportValidity && (F.setCustomValidity(Ye(k) ? "" : k || ""), F.reportValidity());
|
|
437
|
-
}, w = {}, M = ua(s),
|
|
438
|
-
const
|
|
437
|
+
}, w = {}, M = ua(s), Y = pn(s), X = M || Y, K = (x || ca(s)) && $e(s.value) && $e(O) || Nn(s) && s.value === "" || O === "" || Array.isArray(O) && !O.length, u = fo.bind(null, c, n, w), D = (k, P, z, N = St.maxLength, L = St.minLength) => {
|
|
438
|
+
const oe = k ? P : z;
|
|
439
439
|
w[c] = {
|
|
440
|
-
type: k ?
|
|
441
|
-
message:
|
|
440
|
+
type: k ? N : L,
|
|
441
|
+
message: oe,
|
|
442
442
|
ref: s,
|
|
443
|
-
...u(k ?
|
|
443
|
+
...u(k ? N : L, oe)
|
|
444
444
|
};
|
|
445
445
|
};
|
|
446
|
-
if (a ? !Array.isArray(O) || !O.length : l && (!
|
|
446
|
+
if (a ? !Array.isArray(O) || !O.length : l && (!X && (K || Ue(O)) || Ye(O) && !O || Y && !yo(o).isValid || M && !xo(o).isValid)) {
|
|
447
447
|
const { value: k, message: P } = Pn(l) ? { value: !!l, message: l } : vr(l);
|
|
448
448
|
if (k && (w[c] = {
|
|
449
449
|
type: St.required,
|
|
@@ -453,25 +453,25 @@ var vr = (e) => $e(e) && !qn(e) ? e : {
|
|
|
453
453
|
}, !n))
|
|
454
454
|
return C(P), w;
|
|
455
455
|
}
|
|
456
|
-
if (!
|
|
456
|
+
if (!K && (!Ue(f) || !Ue(m))) {
|
|
457
457
|
let k, P;
|
|
458
|
-
const z = vr(m),
|
|
458
|
+
const z = vr(m), N = vr(f);
|
|
459
459
|
if (!Ue(O) && !isNaN(O)) {
|
|
460
460
|
const L = s.valueAsNumber || O && +O;
|
|
461
|
-
Ue(z.value) || (k = L > z.value), Ue(
|
|
461
|
+
Ue(z.value) || (k = L > z.value), Ue(N.value) || (P = L < N.value);
|
|
462
462
|
} else {
|
|
463
|
-
const L = s.valueAsDate || new Date(O),
|
|
464
|
-
bt(z.value) && O && (k = ce ?
|
|
463
|
+
const L = s.valueAsDate || new Date(O), oe = (j) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + j), ce = s.type == "time", ue = s.type == "week";
|
|
464
|
+
bt(z.value) && O && (k = ce ? oe(O) > oe(z.value) : ue ? O > z.value : L > new Date(z.value)), bt(N.value) && O && (P = ce ? oe(O) < oe(N.value) : ue ? O < N.value : L < new Date(N.value));
|
|
465
465
|
}
|
|
466
|
-
if ((k || P) && (D(!!k, z.message,
|
|
466
|
+
if ((k || P) && (D(!!k, z.message, N.message, St.max, St.min), !n))
|
|
467
467
|
return C(w[c].message), w;
|
|
468
468
|
}
|
|
469
|
-
if ((p || d) && !
|
|
470
|
-
const k = vr(p), P = vr(d), z = !Ue(k.value) && O.length > +k.value,
|
|
471
|
-
if ((z ||
|
|
469
|
+
if ((p || d) && !K && (bt(O) || a && Array.isArray(O))) {
|
|
470
|
+
const k = vr(p), P = vr(d), z = !Ue(k.value) && O.length > +k.value, N = !Ue(P.value) && O.length < +P.value;
|
|
471
|
+
if ((z || N) && (D(z, k.message, P.message), !n))
|
|
472
472
|
return C(w[c].message), w;
|
|
473
473
|
}
|
|
474
|
-
if (b && !
|
|
474
|
+
if (b && !K && bt(O)) {
|
|
475
475
|
const { value: k, message: P } = vr(b);
|
|
476
476
|
if (qn(k) && !O.match(k) && (w[c] = {
|
|
477
477
|
type: St.pattern,
|
|
@@ -489,7 +489,7 @@ var vr = (e) => $e(e) && !qn(e) ? e : {
|
|
|
489
489
|
...u(St.validate, P.message)
|
|
490
490
|
}, !n))
|
|
491
491
|
return C(P.message), w;
|
|
492
|
-
} else if (
|
|
492
|
+
} else if (De(h)) {
|
|
493
493
|
let k = {};
|
|
494
494
|
for (const P in h) {
|
|
495
495
|
if (!Ke(k) && !n)
|
|
@@ -535,7 +535,7 @@ function sc(e = {}) {
|
|
|
535
535
|
disabled: t.disabled || !1
|
|
536
536
|
};
|
|
537
537
|
const n = {};
|
|
538
|
-
let i =
|
|
538
|
+
let i = De(t.defaultValues) || De(t.values) ? Me(t.defaultValues || t.values) || {} : {}, a = t.shouldUnregister ? {} : Me(i), s = {
|
|
539
539
|
action: !1,
|
|
540
540
|
mount: !1,
|
|
541
541
|
watch: !1
|
|
@@ -565,31 +565,31 @@ function sc(e = {}) {
|
|
|
565
565
|
clearTimeout(p), p = setTimeout(g, S);
|
|
566
566
|
}, c = async (g) => {
|
|
567
567
|
if (!t.disabled && (d.isValid || f.isValid || g)) {
|
|
568
|
-
const S = t.resolver ? Ke((await
|
|
568
|
+
const S = t.resolver ? Ke((await Y()).errors) : await K(n, !0);
|
|
569
569
|
S !== r.isValid && m.state.next({
|
|
570
570
|
isValid: S
|
|
571
571
|
});
|
|
572
572
|
}
|
|
573
573
|
}, x = (g, S) => {
|
|
574
574
|
!t.disabled && (d.isValidating || d.validatingFields || f.isValidating || f.validatingFields) && ((g || Array.from(o.mount)).forEach((A) => {
|
|
575
|
-
A && (S ? he(r.validatingFields, A, S) :
|
|
575
|
+
A && (S ? he(r.validatingFields, A, S) : Pe(r.validatingFields, A));
|
|
576
576
|
}), m.state.next({
|
|
577
577
|
validatingFields: r.validatingFields,
|
|
578
578
|
isValidating: !Ke(r.validatingFields)
|
|
579
579
|
}));
|
|
580
|
-
}, y = (g, S = [], A,
|
|
581
|
-
if (
|
|
582
|
-
if (s.action = !0, T && Array.isArray(
|
|
583
|
-
const
|
|
584
|
-
E && he(n, g,
|
|
580
|
+
}, y = (g, S = [], A, Q, E = !0, T = !0) => {
|
|
581
|
+
if (Q && A && !t.disabled) {
|
|
582
|
+
if (s.action = !0, T && Array.isArray(B(n, g))) {
|
|
583
|
+
const U = A(B(n, g), Q.argA, Q.argB);
|
|
584
|
+
E && he(n, g, U);
|
|
585
585
|
}
|
|
586
|
-
if (T && Array.isArray(
|
|
587
|
-
const
|
|
588
|
-
E && he(r.errors, g,
|
|
586
|
+
if (T && Array.isArray(B(r.errors, g))) {
|
|
587
|
+
const U = A(B(r.errors, g), Q.argA, Q.argB);
|
|
588
|
+
E && he(r.errors, g, U), nc(r.errors, g);
|
|
589
589
|
}
|
|
590
|
-
if ((d.touchedFields || f.touchedFields) && T && Array.isArray(
|
|
591
|
-
const
|
|
592
|
-
E && he(r.touchedFields, g,
|
|
590
|
+
if ((d.touchedFields || f.touchedFields) && T && Array.isArray(B(r.touchedFields, g))) {
|
|
591
|
+
const U = A(B(r.touchedFields, g), Q.argA, Q.argB);
|
|
592
|
+
E && he(r.touchedFields, g, U);
|
|
593
593
|
}
|
|
594
594
|
(d.dirtyFields || f.dirtyFields) && (r.dirtyFields = Kr(i, a)), m.state.next({
|
|
595
595
|
name: g,
|
|
@@ -609,191 +609,191 @@ function sc(e = {}) {
|
|
|
609
609
|
errors: r.errors,
|
|
610
610
|
isValid: !1
|
|
611
611
|
});
|
|
612
|
-
}, C = (g, S, A,
|
|
613
|
-
const E =
|
|
612
|
+
}, C = (g, S, A, Q) => {
|
|
613
|
+
const E = B(n, g);
|
|
614
614
|
if (E) {
|
|
615
|
-
const T =
|
|
616
|
-
|
|
615
|
+
const T = B(a, g, $e(A) ? B(i, g) : A);
|
|
616
|
+
$e(T) || Q && Q.defaultChecked || S ? he(a, g, S ? T : Pa(E._f)) : z(g, T), s.mount && c();
|
|
617
617
|
}
|
|
618
|
-
}, w = (g, S, A,
|
|
619
|
-
let T = !1,
|
|
620
|
-
const
|
|
618
|
+
}, w = (g, S, A, Q, E) => {
|
|
619
|
+
let T = !1, U = !1;
|
|
620
|
+
const ae = {
|
|
621
621
|
name: g
|
|
622
622
|
};
|
|
623
623
|
if (!t.disabled) {
|
|
624
|
-
if (!A ||
|
|
625
|
-
(d.isDirty || f.isDirty) && (
|
|
626
|
-
const le = Pt(
|
|
627
|
-
|
|
624
|
+
if (!A || Q) {
|
|
625
|
+
(d.isDirty || f.isDirty) && (U = r.isDirty, r.isDirty = ae.isDirty = D(), T = U !== ae.isDirty);
|
|
626
|
+
const le = Pt(B(i, g), S);
|
|
627
|
+
U = !!B(r.dirtyFields, g), le ? Pe(r.dirtyFields, g) : he(r.dirtyFields, g, !0), ae.dirtyFields = r.dirtyFields, T = T || (d.dirtyFields || f.dirtyFields) && U !== !le;
|
|
628
628
|
}
|
|
629
629
|
if (A) {
|
|
630
|
-
const le =
|
|
631
|
-
le || (he(r.touchedFields, g, A),
|
|
630
|
+
const le = B(r.touchedFields, g);
|
|
631
|
+
le || (he(r.touchedFields, g, A), ae.touchedFields = r.touchedFields, T = T || (d.touchedFields || f.touchedFields) && le !== A);
|
|
632
632
|
}
|
|
633
|
-
T && E && m.state.next(
|
|
634
|
-
}
|
|
635
|
-
return T ?
|
|
636
|
-
}, M = (g, S, A,
|
|
637
|
-
const E =
|
|
638
|
-
if (t.delayError && A ? (l = h(() => O(g, A)), l(t.delayError)) : (clearTimeout(p), l = null, A ? he(r.errors, g, A) :
|
|
639
|
-
const
|
|
640
|
-
...
|
|
633
|
+
T && E && m.state.next(ae);
|
|
634
|
+
}
|
|
635
|
+
return T ? ae : {};
|
|
636
|
+
}, M = (g, S, A, Q) => {
|
|
637
|
+
const E = B(r.errors, g), T = (d.isValid || f.isValid) && Ye(S) && r.isValid !== S;
|
|
638
|
+
if (t.delayError && A ? (l = h(() => O(g, A)), l(t.delayError)) : (clearTimeout(p), l = null, A ? he(r.errors, g, A) : Pe(r.errors, g)), (A ? !Pt(E, A) : E) || !Ke(Q) || T) {
|
|
639
|
+
const U = {
|
|
640
|
+
...Q,
|
|
641
641
|
...T && Ye(S) ? { isValid: S } : {},
|
|
642
642
|
errors: r.errors,
|
|
643
643
|
name: g
|
|
644
644
|
};
|
|
645
645
|
r = {
|
|
646
646
|
...r,
|
|
647
|
-
...
|
|
648
|
-
}, m.state.next(
|
|
647
|
+
...U
|
|
648
|
+
}, m.state.next(U);
|
|
649
649
|
}
|
|
650
|
-
},
|
|
650
|
+
}, Y = async (g) => {
|
|
651
651
|
x(g, !0);
|
|
652
652
|
const S = await t.resolver(a, t.context, Zl(g || o.mount, n, t.criteriaMode, t.shouldUseNativeValidation));
|
|
653
653
|
return x(g), S;
|
|
654
|
-
},
|
|
655
|
-
const { errors: S } = await
|
|
654
|
+
}, X = async (g) => {
|
|
655
|
+
const { errors: S } = await Y(g);
|
|
656
656
|
if (g)
|
|
657
657
|
for (const A of g) {
|
|
658
|
-
const
|
|
659
|
-
|
|
658
|
+
const Q = B(S, A);
|
|
659
|
+
Q ? he(r.errors, A, Q) : Pe(r.errors, A);
|
|
660
660
|
}
|
|
661
661
|
else
|
|
662
662
|
r.errors = S;
|
|
663
663
|
return S;
|
|
664
|
-
},
|
|
664
|
+
}, K = async (g, S, A = {
|
|
665
665
|
valid: !0
|
|
666
666
|
}) => {
|
|
667
|
-
for (const
|
|
668
|
-
const E = g[
|
|
667
|
+
for (const Q in g) {
|
|
668
|
+
const E = g[Q];
|
|
669
669
|
if (E) {
|
|
670
|
-
const { _f: T, ...
|
|
670
|
+
const { _f: T, ...U } = E;
|
|
671
671
|
if (T) {
|
|
672
|
-
const
|
|
673
|
-
le && d.validatingFields && x([
|
|
674
|
-
const
|
|
675
|
-
if (le && d.validatingFields && x([
|
|
672
|
+
const ae = o.array.has(T.name), le = E._f && Jl(E._f);
|
|
673
|
+
le && d.validatingFields && x([Q], !0);
|
|
674
|
+
const Ie = await Na(E, o.disabled, a, b, t.shouldUseNativeValidation && !S, ae);
|
|
675
|
+
if (le && d.validatingFields && x([Q]), Ie[T.name] && (A.valid = !1, S))
|
|
676
676
|
break;
|
|
677
|
-
!S && (
|
|
677
|
+
!S && (B(Ie, T.name) ? ae ? ic(r.errors, Ie, T.name) : he(r.errors, T.name, Ie[T.name]) : Pe(r.errors, T.name));
|
|
678
678
|
}
|
|
679
|
-
!Ke(
|
|
679
|
+
!Ke(U) && await K(U, S, A);
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
682
|
return A.valid;
|
|
683
683
|
}, u = () => {
|
|
684
684
|
for (const g of o.unMount) {
|
|
685
|
-
const S =
|
|
686
|
-
S && (S._f.refs ? S._f.refs.every((A) => !hi(A)) : !hi(S._f.ref)) &&
|
|
685
|
+
const S = B(n, g);
|
|
686
|
+
S && (S._f.refs ? S._f.refs.every((A) => !hi(A)) : !hi(S._f.ref)) && ee(g);
|
|
687
687
|
}
|
|
688
688
|
o.unMount = /* @__PURE__ */ new Set();
|
|
689
689
|
}, D = (g, S) => !t.disabled && (g && S && he(a, g, S), !Pt(j(), i)), k = (g, S, A) => po(g, o, {
|
|
690
|
-
...s.mount ? a :
|
|
691
|
-
}, A, S), P = (g) => aa(
|
|
692
|
-
const
|
|
690
|
+
...s.mount ? a : $e(S) ? i : bt(g) ? { [g]: S } : S
|
|
691
|
+
}, A, S), P = (g) => aa(B(s.mount ? a : i, g, t.shouldUnregister ? B(i, g, []) : [])), z = (g, S, A = {}) => {
|
|
692
|
+
const Q = B(n, g);
|
|
693
693
|
let E = S;
|
|
694
|
-
if (
|
|
695
|
-
const T =
|
|
696
|
-
T && (!T.disabled && he(a, g, vo(S, T)), E = Nn(T.ref) && Ue(S) ? "" : S, mo(T.ref) ? [...T.ref.options].forEach((
|
|
697
|
-
(!
|
|
698
|
-
}) : T.refs.forEach((
|
|
694
|
+
if (Q) {
|
|
695
|
+
const T = Q._f;
|
|
696
|
+
T && (!T.disabled && he(a, g, vo(S, T)), E = Nn(T.ref) && Ue(S) ? "" : S, mo(T.ref) ? [...T.ref.options].forEach((U) => U.selected = E.includes(U.value)) : T.refs ? pn(T.ref) ? T.refs.forEach((U) => {
|
|
697
|
+
(!U.defaultChecked || !U.disabled) && (Array.isArray(E) ? U.checked = !!E.find((ae) => ae === U.value) : U.checked = E === U.value || !!E);
|
|
698
|
+
}) : T.refs.forEach((U) => U.checked = U.value === E) : ca(T.ref) ? T.ref.value = "" : (T.ref.value = E, T.ref.type || m.state.next({
|
|
699
699
|
name: g,
|
|
700
|
-
values:
|
|
700
|
+
values: Me(a)
|
|
701
701
|
})));
|
|
702
702
|
}
|
|
703
703
|
(A.shouldDirty || A.shouldTouch) && w(g, E, A.shouldTouch, A.shouldDirty, !0), A.shouldValidate && ue(g);
|
|
704
|
-
},
|
|
705
|
-
for (const
|
|
706
|
-
if (!S.hasOwnProperty(
|
|
704
|
+
}, N = (g, S, A) => {
|
|
705
|
+
for (const Q in S) {
|
|
706
|
+
if (!S.hasOwnProperty(Q))
|
|
707
707
|
return;
|
|
708
|
-
const E = S[
|
|
709
|
-
(o.array.has(g) ||
|
|
708
|
+
const E = S[Q], T = g + "." + Q, U = B(n, T);
|
|
709
|
+
(o.array.has(g) || De(E) || U && !U._f) && !tr(E) ? N(T, E, A) : z(T, E, A);
|
|
710
710
|
}
|
|
711
711
|
}, L = (g, S, A = {}) => {
|
|
712
|
-
const
|
|
712
|
+
const Q = B(n, g), E = o.array.has(g), T = Me(S);
|
|
713
713
|
he(a, g, T), E ? (m.array.next({
|
|
714
714
|
name: g,
|
|
715
|
-
values:
|
|
715
|
+
values: Me(a)
|
|
716
716
|
}), (d.isDirty || d.dirtyFields || f.isDirty || f.dirtyFields) && A.shouldDirty && m.state.next({
|
|
717
717
|
name: g,
|
|
718
718
|
dirtyFields: Kr(i, a),
|
|
719
719
|
isDirty: D(g, T)
|
|
720
|
-
})) :
|
|
720
|
+
})) : Q && !Q._f && !Ue(T) ? N(g, T, A) : z(g, T, A), Ma(g, o) && m.state.next({ ...r }), m.state.next({
|
|
721
721
|
name: s.mount ? g : void 0,
|
|
722
|
-
values:
|
|
722
|
+
values: Me(a)
|
|
723
723
|
});
|
|
724
|
-
},
|
|
724
|
+
}, oe = async (g) => {
|
|
725
725
|
s.mount = !0;
|
|
726
726
|
const S = g.target;
|
|
727
|
-
let A = S.name,
|
|
728
|
-
const E =
|
|
729
|
-
|
|
730
|
-
},
|
|
727
|
+
let A = S.name, Q = !0;
|
|
728
|
+
const E = B(n, A), T = (le) => {
|
|
729
|
+
Q = Number.isNaN(le) || tr(le) && isNaN(le.getTime()) || Pt(le, B(a, A, le));
|
|
730
|
+
}, U = ja(t.mode), ae = ja(t.reValidateMode);
|
|
731
731
|
if (E) {
|
|
732
|
-
let le,
|
|
733
|
-
const at = S.type ? Pa(E._f) : oo(g), et = g.type === Vn.BLUR || g.type === Vn.FOCUS_OUT, Br = !Xl(E._f) && !t.resolver && !
|
|
732
|
+
let le, Ie;
|
|
733
|
+
const at = S.type ? Pa(E._f) : oo(g), et = g.type === Vn.BLUR || g.type === Vn.FOCUS_OUT, Br = !Xl(E._f) && !t.resolver && !B(r.errors, A) && !E._f.deps || rc(et, B(r.touchedFields, A), r.isSubmitted, ae, U), Zt = Ma(A, o, et);
|
|
734
734
|
he(a, A, at), et ? (E._f.onBlur && E._f.onBlur(g), l && l(0)) : E._f.onChange && E._f.onChange(g);
|
|
735
735
|
const $t = w(A, at, et), Ur = !Ke($t) || Zt;
|
|
736
736
|
if (!et && m.state.next({
|
|
737
737
|
name: A,
|
|
738
738
|
type: g.type,
|
|
739
|
-
values:
|
|
739
|
+
values: Me(a)
|
|
740
740
|
}), Br)
|
|
741
741
|
return (d.isValid || f.isValid) && (t.mode === "onBlur" ? et && c() : et || c()), Ur && m.state.next({ name: A, ...Zt ? {} : $t });
|
|
742
742
|
if (!et && Zt && m.state.next({ ...r }), t.resolver) {
|
|
743
|
-
const { errors: gr } = await
|
|
744
|
-
if (T(at),
|
|
743
|
+
const { errors: gr } = await Y([A]);
|
|
744
|
+
if (T(at), Q) {
|
|
745
745
|
const Wr = za(r.errors, n, A), yr = za(gr, n, Wr.name || A);
|
|
746
|
-
le = yr.error, A = yr.name,
|
|
746
|
+
le = yr.error, A = yr.name, Ie = Ke(gr);
|
|
747
747
|
}
|
|
748
748
|
} else
|
|
749
|
-
x([A], !0), le = (await Na(E, o.disabled, a, b, t.shouldUseNativeValidation))[A], x([A]), T(at),
|
|
750
|
-
|
|
749
|
+
x([A], !0), le = (await Na(E, o.disabled, a, b, t.shouldUseNativeValidation))[A], x([A]), T(at), Q && (le ? Ie = !1 : (d.isValid || f.isValid) && (Ie = await K(n, !0)));
|
|
750
|
+
Q && (E._f.deps && ue(E._f.deps), M(A, Ie, le, $t));
|
|
751
751
|
}
|
|
752
752
|
}, ce = (g, S) => {
|
|
753
|
-
if (
|
|
753
|
+
if (B(r.errors, S) && g.focus)
|
|
754
754
|
return g.focus(), 1;
|
|
755
755
|
}, ue = async (g, S = {}) => {
|
|
756
|
-
let A,
|
|
756
|
+
let A, Q;
|
|
757
757
|
const E = en(g);
|
|
758
758
|
if (t.resolver) {
|
|
759
|
-
const T = await
|
|
760
|
-
A = Ke(T),
|
|
761
|
-
} else g ? (
|
|
762
|
-
const
|
|
763
|
-
return await
|
|
764
|
-
}))).every(Boolean), !(!
|
|
759
|
+
const T = await X($e(g) ? g : E);
|
|
760
|
+
A = Ke(T), Q = g ? !E.some((U) => B(T, U)) : A;
|
|
761
|
+
} else g ? (Q = (await Promise.all(E.map(async (T) => {
|
|
762
|
+
const U = B(n, T);
|
|
763
|
+
return await K(U && U._f ? { [T]: U } : U);
|
|
764
|
+
}))).every(Boolean), !(!Q && !r.isValid) && c()) : Q = A = await K(n);
|
|
765
765
|
return m.state.next({
|
|
766
766
|
...!bt(g) || (d.isValid || f.isValid) && A !== r.isValid ? {} : { name: g },
|
|
767
767
|
...t.resolver || !g ? { isValid: A } : {},
|
|
768
768
|
errors: r.errors
|
|
769
|
-
}), S.shouldFocus && !
|
|
769
|
+
}), S.shouldFocus && !Q && tn(n, ce, g ? E : o.mount), Q;
|
|
770
770
|
}, j = (g) => {
|
|
771
771
|
const S = {
|
|
772
772
|
...s.mount ? a : i
|
|
773
773
|
};
|
|
774
|
-
return
|
|
775
|
-
},
|
|
776
|
-
invalid: !!
|
|
777
|
-
isDirty: !!
|
|
778
|
-
error:
|
|
779
|
-
isValidating: !!
|
|
780
|
-
isTouched: !!
|
|
781
|
-
}),
|
|
782
|
-
g && en(g).forEach((S) =>
|
|
774
|
+
return $e(g) ? S : bt(g) ? B(S, g) : g.map((A) => B(S, A));
|
|
775
|
+
}, H = (g, S) => ({
|
|
776
|
+
invalid: !!B((S || r).errors, g),
|
|
777
|
+
isDirty: !!B((S || r).dirtyFields, g),
|
|
778
|
+
error: B((S || r).errors, g),
|
|
779
|
+
isValidating: !!B(r.validatingFields, g),
|
|
780
|
+
isTouched: !!B((S || r).touchedFields, g)
|
|
781
|
+
}), q = (g) => {
|
|
782
|
+
g && en(g).forEach((S) => Pe(r.errors, S)), m.state.next({
|
|
783
783
|
errors: g ? r.errors : {}
|
|
784
784
|
});
|
|
785
|
-
},
|
|
786
|
-
const
|
|
785
|
+
}, W = (g, S, A) => {
|
|
786
|
+
const Q = (B(n, g, { _f: {} })._f || {}).ref, E = B(r.errors, g) || {}, { ref: T, message: U, type: ae, ...le } = E;
|
|
787
787
|
he(r.errors, g, {
|
|
788
788
|
...le,
|
|
789
789
|
...S,
|
|
790
|
-
ref:
|
|
790
|
+
ref: Q
|
|
791
791
|
}), m.state.next({
|
|
792
792
|
name: g,
|
|
793
793
|
errors: r.errors,
|
|
794
794
|
isValid: !1
|
|
795
|
-
}), A && A.shouldFocus &&
|
|
796
|
-
},
|
|
795
|
+
}), A && A.shouldFocus && Q && Q.focus && Q.focus();
|
|
796
|
+
}, Z = (g, S) => ct(g) ? m.state.subscribe({
|
|
797
797
|
next: (A) => g(k(void 0, S), A)
|
|
798
798
|
}) : k(g, S, !0), ne = (g) => m.state.subscribe({
|
|
799
799
|
next: (S) => {
|
|
@@ -809,20 +809,20 @@ function sc(e = {}) {
|
|
|
809
809
|
}, ne({
|
|
810
810
|
...g,
|
|
811
811
|
formState: f
|
|
812
|
-
})),
|
|
812
|
+
})), ee = (g, S = {}) => {
|
|
813
813
|
for (const A of g ? en(g) : o.mount)
|
|
814
|
-
o.mount.delete(A), o.array.delete(A), S.keepValue || (
|
|
814
|
+
o.mount.delete(A), o.array.delete(A), S.keepValue || (Pe(n, A), Pe(a, A)), !S.keepError && Pe(r.errors, A), !S.keepDirty && Pe(r.dirtyFields, A), !S.keepTouched && Pe(r.touchedFields, A), !S.keepIsValidating && Pe(r.validatingFields, A), !t.shouldUnregister && !S.keepDefaultValue && Pe(i, A);
|
|
815
815
|
m.state.next({
|
|
816
|
-
values:
|
|
816
|
+
values: Me(a)
|
|
817
817
|
}), m.state.next({
|
|
818
818
|
...r,
|
|
819
819
|
...S.keepDirty ? { isDirty: D() } : {}
|
|
820
820
|
}), !S.keepIsValid && c();
|
|
821
821
|
}, R = ({ disabled: g, name: S }) => {
|
|
822
822
|
(Ye(g) && s.mount || g || o.disabled.has(S)) && (g ? o.disabled.add(S) : o.disabled.delete(S));
|
|
823
|
-
},
|
|
824
|
-
let A =
|
|
825
|
-
const
|
|
823
|
+
}, G = (g, S = {}) => {
|
|
824
|
+
let A = B(n, g);
|
|
825
|
+
const Q = Ye(S.disabled) || Ye(t.disabled);
|
|
826
826
|
return he(n, g, {
|
|
827
827
|
...A || {},
|
|
828
828
|
_f: {
|
|
@@ -835,7 +835,7 @@ function sc(e = {}) {
|
|
|
835
835
|
disabled: Ye(S.disabled) ? S.disabled : t.disabled,
|
|
836
836
|
name: g
|
|
837
837
|
}) : C(g, !0, S.value), {
|
|
838
|
-
...
|
|
838
|
+
...Q ? { disabled: S.disabled || t.disabled } : {},
|
|
839
839
|
...t.progressive ? {
|
|
840
840
|
required: !!S.required,
|
|
841
841
|
min: Qr(S.min),
|
|
@@ -845,102 +845,102 @@ function sc(e = {}) {
|
|
|
845
845
|
pattern: Qr(S.pattern)
|
|
846
846
|
} : {},
|
|
847
847
|
name: g,
|
|
848
|
-
onChange:
|
|
849
|
-
onBlur:
|
|
848
|
+
onChange: oe,
|
|
849
|
+
onBlur: oe,
|
|
850
850
|
ref: (E) => {
|
|
851
851
|
if (E) {
|
|
852
|
-
|
|
853
|
-
const T =
|
|
854
|
-
if (
|
|
852
|
+
G(g, S), A = B(n, g);
|
|
853
|
+
const T = $e(E.value) && E.querySelectorAll && E.querySelectorAll("input,select,textarea")[0] || E, U = Ql(T), ae = A._f.refs || [];
|
|
854
|
+
if (U ? ae.find((le) => le === T) : T === A._f.ref)
|
|
855
855
|
return;
|
|
856
856
|
he(n, g, {
|
|
857
857
|
_f: {
|
|
858
858
|
...A._f,
|
|
859
|
-
...
|
|
859
|
+
...U ? {
|
|
860
860
|
refs: [
|
|
861
|
-
...
|
|
861
|
+
...ae.filter(hi),
|
|
862
862
|
T,
|
|
863
|
-
...Array.isArray(
|
|
863
|
+
...Array.isArray(B(i, g)) ? [{}] : []
|
|
864
864
|
],
|
|
865
865
|
ref: { type: T.type, name: g }
|
|
866
866
|
} : { ref: T }
|
|
867
867
|
}
|
|
868
868
|
}), C(g, !1, void 0, T);
|
|
869
869
|
} else
|
|
870
|
-
A =
|
|
870
|
+
A = B(n, g, {}), A._f && (A._f.mount = !1), (t.shouldUnregister || S.shouldUnregister) && !(lo(o.array, g) && s.action) && o.unMount.add(g);
|
|
871
871
|
}
|
|
872
872
|
};
|
|
873
|
-
},
|
|
873
|
+
}, V = () => t.shouldFocusError && tn(n, ce, o.mount), ie = (g) => {
|
|
874
874
|
Ye(g) && (m.state.next({ disabled: g }), tn(n, (S, A) => {
|
|
875
|
-
const
|
|
876
|
-
|
|
877
|
-
E.disabled =
|
|
875
|
+
const Q = B(n, A);
|
|
876
|
+
Q && (S.disabled = Q._f.disabled || g, Array.isArray(Q._f.refs) && Q._f.refs.forEach((E) => {
|
|
877
|
+
E.disabled = Q._f.disabled || g;
|
|
878
878
|
}));
|
|
879
879
|
}, 0, !1));
|
|
880
880
|
}, I = (g, S) => async (A) => {
|
|
881
|
-
let
|
|
881
|
+
let Q;
|
|
882
882
|
A && (A.preventDefault && A.preventDefault(), A.persist && A.persist());
|
|
883
|
-
let E =
|
|
883
|
+
let E = Me(a);
|
|
884
884
|
if (m.state.next({
|
|
885
885
|
isSubmitting: !0
|
|
886
886
|
}), t.resolver) {
|
|
887
|
-
const { errors: T, values:
|
|
888
|
-
r.errors = T, E =
|
|
887
|
+
const { errors: T, values: U } = await Y();
|
|
888
|
+
r.errors = T, E = U;
|
|
889
889
|
} else
|
|
890
|
-
await
|
|
890
|
+
await K(n);
|
|
891
891
|
if (o.disabled.size)
|
|
892
892
|
for (const T of o.disabled)
|
|
893
893
|
he(E, T, void 0);
|
|
894
|
-
if (
|
|
894
|
+
if (Pe(r.errors, "root"), Ke(r.errors)) {
|
|
895
895
|
m.state.next({
|
|
896
896
|
errors: {}
|
|
897
897
|
});
|
|
898
898
|
try {
|
|
899
899
|
await g(E, A);
|
|
900
900
|
} catch (T) {
|
|
901
|
-
|
|
901
|
+
Q = T;
|
|
902
902
|
}
|
|
903
903
|
} else
|
|
904
|
-
S && await S({ ...r.errors }, A),
|
|
904
|
+
S && await S({ ...r.errors }, A), V(), setTimeout(V);
|
|
905
905
|
if (m.state.next({
|
|
906
906
|
isSubmitted: !0,
|
|
907
907
|
isSubmitting: !1,
|
|
908
|
-
isSubmitSuccessful: Ke(r.errors) && !
|
|
908
|
+
isSubmitSuccessful: Ke(r.errors) && !Q,
|
|
909
909
|
submitCount: r.submitCount + 1,
|
|
910
910
|
errors: r.errors
|
|
911
|
-
}),
|
|
912
|
-
throw
|
|
913
|
-
},
|
|
914
|
-
|
|
911
|
+
}), Q)
|
|
912
|
+
throw Q;
|
|
913
|
+
}, ke = (g, S = {}) => {
|
|
914
|
+
B(n, g) && ($e(S.defaultValue) ? L(g, Me(B(i, g))) : (L(g, S.defaultValue), he(i, g, Me(S.defaultValue))), S.keepTouched || Pe(r.touchedFields, g), S.keepDirty || (Pe(r.dirtyFields, g), r.isDirty = S.defaultValue ? D(g, Me(B(i, g))) : D()), S.keepError || (Pe(r.errors, g), d.isValid && c()), m.state.next({ ...r }));
|
|
915
915
|
}, dt = (g, S = {}) => {
|
|
916
|
-
const A = g ?
|
|
916
|
+
const A = g ? Me(g) : i, Q = Me(A), E = Ke(g), T = E ? i : Q;
|
|
917
917
|
if (S.keepDefaultValues || (i = A), !S.keepValues) {
|
|
918
918
|
if (S.keepDirtyValues) {
|
|
919
|
-
const
|
|
919
|
+
const U = /* @__PURE__ */ new Set([
|
|
920
920
|
...o.mount,
|
|
921
921
|
...Object.keys(Kr(i, a))
|
|
922
922
|
]);
|
|
923
|
-
for (const
|
|
924
|
-
|
|
923
|
+
for (const ae of Array.from(U))
|
|
924
|
+
B(r.dirtyFields, ae) ? he(T, ae, B(a, ae)) : L(ae, B(T, ae));
|
|
925
925
|
} else {
|
|
926
|
-
if (ia &&
|
|
927
|
-
for (const
|
|
928
|
-
const
|
|
929
|
-
if (
|
|
930
|
-
const le = Array.isArray(
|
|
926
|
+
if (ia && $e(g))
|
|
927
|
+
for (const U of o.mount) {
|
|
928
|
+
const ae = B(n, U);
|
|
929
|
+
if (ae && ae._f) {
|
|
930
|
+
const le = Array.isArray(ae._f.refs) ? ae._f.refs[0] : ae._f.ref;
|
|
931
931
|
if (Nn(le)) {
|
|
932
|
-
const
|
|
933
|
-
if (
|
|
934
|
-
|
|
932
|
+
const Ie = le.closest("form");
|
|
933
|
+
if (Ie) {
|
|
934
|
+
Ie.reset();
|
|
935
935
|
break;
|
|
936
936
|
}
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
939
|
}
|
|
940
|
-
for (const
|
|
941
|
-
L(
|
|
940
|
+
for (const U of o.mount)
|
|
941
|
+
L(U, B(T, U));
|
|
942
942
|
}
|
|
943
|
-
a =
|
|
943
|
+
a = Me(T), m.array.next({
|
|
944
944
|
values: { ...T }
|
|
945
945
|
}), m.state.next({
|
|
946
946
|
values: { ...T }
|
|
@@ -965,9 +965,9 @@ function sc(e = {}) {
|
|
|
965
965
|
isSubmitting: !1
|
|
966
966
|
});
|
|
967
967
|
}, At = (g, S) => dt(ct(g) ? g(a) : g, S), vn = (g, S = {}) => {
|
|
968
|
-
const A =
|
|
969
|
-
if (
|
|
970
|
-
const E =
|
|
968
|
+
const A = B(n, g), Q = A && A._f;
|
|
969
|
+
if (Q) {
|
|
970
|
+
const E = Q.refs ? Q.refs[0] : Q.ref;
|
|
971
971
|
E.focus && (E.focus(), S.shouldSelect && ct(E.select) && E.select());
|
|
972
972
|
}
|
|
973
973
|
}, Ft = (g) => {
|
|
@@ -977,14 +977,14 @@ function sc(e = {}) {
|
|
|
977
977
|
};
|
|
978
978
|
}, Yt = {
|
|
979
979
|
control: {
|
|
980
|
-
register:
|
|
981
|
-
unregister:
|
|
982
|
-
getFieldState:
|
|
980
|
+
register: G,
|
|
981
|
+
unregister: ee,
|
|
982
|
+
getFieldState: H,
|
|
983
983
|
handleSubmit: I,
|
|
984
|
-
setError:
|
|
984
|
+
setError: W,
|
|
985
985
|
_subscribe: ne,
|
|
986
|
-
_runSchema:
|
|
987
|
-
_focusError:
|
|
986
|
+
_runSchema: Y,
|
|
987
|
+
_focusError: V,
|
|
988
988
|
_getWatch: k,
|
|
989
989
|
_getDirty: D,
|
|
990
990
|
_setValid: c,
|
|
@@ -999,7 +999,7 @@ function sc(e = {}) {
|
|
|
999
999
|
});
|
|
1000
1000
|
}),
|
|
1001
1001
|
_removeUnmounted: u,
|
|
1002
|
-
_disableForm:
|
|
1002
|
+
_disableForm: ie,
|
|
1003
1003
|
_subjects: m,
|
|
1004
1004
|
_proxyFormState: d,
|
|
1005
1005
|
get _fields() {
|
|
@@ -1038,18 +1038,18 @@ function sc(e = {}) {
|
|
|
1038
1038
|
},
|
|
1039
1039
|
subscribe: re,
|
|
1040
1040
|
trigger: ue,
|
|
1041
|
-
register:
|
|
1041
|
+
register: G,
|
|
1042
1042
|
handleSubmit: I,
|
|
1043
|
-
watch:
|
|
1043
|
+
watch: Z,
|
|
1044
1044
|
setValue: L,
|
|
1045
1045
|
getValues: j,
|
|
1046
1046
|
reset: At,
|
|
1047
|
-
resetField:
|
|
1048
|
-
clearErrors:
|
|
1049
|
-
unregister:
|
|
1050
|
-
setError:
|
|
1047
|
+
resetField: ke,
|
|
1048
|
+
clearErrors: q,
|
|
1049
|
+
unregister: ee,
|
|
1050
|
+
setError: W,
|
|
1051
1051
|
setFocus: vn,
|
|
1052
|
-
getFieldState:
|
|
1052
|
+
getFieldState: H
|
|
1053
1053
|
};
|
|
1054
1054
|
return {
|
|
1055
1055
|
...Yt,
|
|
@@ -1121,7 +1121,7 @@ function oc(e = {}) {
|
|
|
1121
1121
|
}
|
|
1122
1122
|
const La = (e, t, r) => {
|
|
1123
1123
|
if (e && "reportValidity" in e) {
|
|
1124
|
-
const n =
|
|
1124
|
+
const n = B(r, t);
|
|
1125
1125
|
e.setCustomValidity(n && n.message || ""), e.reportValidity();
|
|
1126
1126
|
}
|
|
1127
1127
|
}, bo = (e, t) => {
|
|
@@ -1133,9 +1133,9 @@ const La = (e, t, r) => {
|
|
|
1133
1133
|
t.shouldUseNativeValidation && bo(e, t);
|
|
1134
1134
|
const r = {};
|
|
1135
1135
|
for (const n in e) {
|
|
1136
|
-
const i =
|
|
1136
|
+
const i = B(t.fields, n), a = Object.assign(e[n] || {}, { ref: i && i.ref });
|
|
1137
1137
|
if (cc(t.names || Object.keys(e), n)) {
|
|
1138
|
-
const s = Object.assign({},
|
|
1138
|
+
const s = Object.assign({}, B(r, n));
|
|
1139
1139
|
he(s, "root", a), he(r, n, s);
|
|
1140
1140
|
} else he(r, n, a);
|
|
1141
1141
|
}
|
|
@@ -1336,10 +1336,10 @@ function hc(e, t) {
|
|
|
1336
1336
|
var rr, jt, Ar, Gs, gc = (Gs = class extends fn {
|
|
1337
1337
|
constructor() {
|
|
1338
1338
|
super();
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1339
|
+
se(this, rr);
|
|
1340
|
+
se(this, jt);
|
|
1341
|
+
se(this, Ar);
|
|
1342
|
+
J(this, Ar, (t) => {
|
|
1343
1343
|
if (!pr && window.addEventListener) {
|
|
1344
1344
|
const r = () => t();
|
|
1345
1345
|
return window.addEventListener("visibilitychange", r, !1), () => {
|
|
@@ -1353,16 +1353,16 @@ var rr, jt, Ar, Gs, gc = (Gs = class extends fn {
|
|
|
1353
1353
|
}
|
|
1354
1354
|
onUnsubscribe() {
|
|
1355
1355
|
var t;
|
|
1356
|
-
this.hasListeners() || ((t = v(this, jt)) == null || t.call(this),
|
|
1356
|
+
this.hasListeners() || ((t = v(this, jt)) == null || t.call(this), J(this, jt, void 0));
|
|
1357
1357
|
}
|
|
1358
1358
|
setEventListener(t) {
|
|
1359
1359
|
var r;
|
|
1360
|
-
|
|
1360
|
+
J(this, Ar, t), (r = v(this, jt)) == null || r.call(this), J(this, jt, t((n) => {
|
|
1361
1361
|
typeof n == "boolean" ? this.setFocused(n) : this.onFocus();
|
|
1362
1362
|
}));
|
|
1363
1363
|
}
|
|
1364
1364
|
setFocused(t) {
|
|
1365
|
-
v(this, rr) !== t && (
|
|
1365
|
+
v(this, rr) !== t && (J(this, rr, t), this.onFocus());
|
|
1366
1366
|
}
|
|
1367
1367
|
onFocus() {
|
|
1368
1368
|
const t = this.isFocused();
|
|
@@ -1377,10 +1377,10 @@ var rr, jt, Ar, Gs, gc = (Gs = class extends fn {
|
|
|
1377
1377
|
}, rr = new WeakMap(), jt = new WeakMap(), Ar = new WeakMap(), Gs), pa = new gc(), Fr, It, $r, Ys, yc = (Ys = class extends fn {
|
|
1378
1378
|
constructor() {
|
|
1379
1379
|
super();
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1380
|
+
se(this, Fr, !0);
|
|
1381
|
+
se(this, It);
|
|
1382
|
+
se(this, $r);
|
|
1383
|
+
J(this, $r, (t) => {
|
|
1384
1384
|
if (!pr && window.addEventListener) {
|
|
1385
1385
|
const r = () => t(!0), n = () => t(!1);
|
|
1386
1386
|
return window.addEventListener("online", r, !1), window.addEventListener("offline", n, !1), () => {
|
|
@@ -1394,14 +1394,14 @@ var rr, jt, Ar, Gs, gc = (Gs = class extends fn {
|
|
|
1394
1394
|
}
|
|
1395
1395
|
onUnsubscribe() {
|
|
1396
1396
|
var t;
|
|
1397
|
-
this.hasListeners() || ((t = v(this, It)) == null || t.call(this),
|
|
1397
|
+
this.hasListeners() || ((t = v(this, It)) == null || t.call(this), J(this, It, void 0));
|
|
1398
1398
|
}
|
|
1399
1399
|
setEventListener(t) {
|
|
1400
1400
|
var r;
|
|
1401
|
-
|
|
1401
|
+
J(this, $r, t), (r = v(this, It)) == null || r.call(this), J(this, It, t(this.setOnline.bind(this)));
|
|
1402
1402
|
}
|
|
1403
1403
|
setOnline(t) {
|
|
1404
|
-
v(this, Fr) !== t && (
|
|
1404
|
+
v(this, Fr) !== t && (J(this, Fr, t), this.listeners.forEach((n) => {
|
|
1405
1405
|
n(t);
|
|
1406
1406
|
}));
|
|
1407
1407
|
}
|
|
@@ -1562,15 +1562,15 @@ function bc() {
|
|
|
1562
1562
|
}
|
|
1563
1563
|
};
|
|
1564
1564
|
}
|
|
1565
|
-
var
|
|
1565
|
+
var Ne = bc(), nr, Zs, To = (Zs = class {
|
|
1566
1566
|
constructor() {
|
|
1567
|
-
|
|
1567
|
+
se(this, nr);
|
|
1568
1568
|
}
|
|
1569
1569
|
destroy() {
|
|
1570
1570
|
this.clearGcTimeout();
|
|
1571
1571
|
}
|
|
1572
1572
|
scheduleGc() {
|
|
1573
|
-
this.clearGcTimeout(), Ri(this.gcTime) &&
|
|
1573
|
+
this.clearGcTimeout(), Ri(this.gcTime) && J(this, nr, setTimeout(() => {
|
|
1574
1574
|
this.optionalRemove();
|
|
1575
1575
|
}, this.gcTime));
|
|
1576
1576
|
}
|
|
@@ -1581,27 +1581,27 @@ var Ve = bc(), nr, Zs, To = (Zs = class {
|
|
|
1581
1581
|
);
|
|
1582
1582
|
}
|
|
1583
1583
|
clearGcTimeout() {
|
|
1584
|
-
v(this, nr) && (clearTimeout(v(this, nr)),
|
|
1584
|
+
v(this, nr) && (clearTimeout(v(this, nr)), J(this, nr, void 0));
|
|
1585
1585
|
}
|
|
1586
|
-
}, nr = new WeakMap(), Zs), Dr, ir, tt, ar,
|
|
1586
|
+
}, nr = new WeakMap(), Zs), Dr, ir, tt, ar, Le, ln, sr, st, Ot, Js, wc = (Js = class extends To {
|
|
1587
1587
|
constructor(t) {
|
|
1588
1588
|
super();
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1589
|
+
se(this, st);
|
|
1590
|
+
se(this, Dr);
|
|
1591
|
+
se(this, ir);
|
|
1592
|
+
se(this, tt);
|
|
1593
|
+
se(this, ar);
|
|
1594
|
+
se(this, Le);
|
|
1595
|
+
se(this, ln);
|
|
1596
|
+
se(this, sr);
|
|
1597
|
+
J(this, sr, !1), J(this, ln, t.defaultOptions), this.setOptions(t.options), this.observers = [], J(this, ar, t.client), J(this, tt, v(this, ar).getQueryCache()), this.queryKey = t.queryKey, this.queryHash = t.queryHash, J(this, Dr, Sc(this.options)), this.state = t.state ?? v(this, Dr), this.scheduleGc();
|
|
1598
1598
|
}
|
|
1599
1599
|
get meta() {
|
|
1600
1600
|
return this.options.meta;
|
|
1601
1601
|
}
|
|
1602
1602
|
get promise() {
|
|
1603
1603
|
var t;
|
|
1604
|
-
return (t = v(this,
|
|
1604
|
+
return (t = v(this, Le)) == null ? void 0 : t.promise;
|
|
1605
1605
|
}
|
|
1606
1606
|
setOptions(t) {
|
|
1607
1607
|
this.options = { ...v(this, ln), ...t }, this.updateGcTime(this.options.gcTime);
|
|
@@ -1623,8 +1623,8 @@ var Ve = bc(), nr, Zs, To = (Zs = class {
|
|
|
1623
1623
|
}
|
|
1624
1624
|
cancel(t) {
|
|
1625
1625
|
var n, i;
|
|
1626
|
-
const r = (n = v(this,
|
|
1627
|
-
return (i = v(this,
|
|
1626
|
+
const r = (n = v(this, Le)) == null ? void 0 : n.promise;
|
|
1627
|
+
return (i = v(this, Le)) == null || i.cancel(t), r ? r.then(Qe).catch(Qe) : Promise.resolve();
|
|
1628
1628
|
}
|
|
1629
1629
|
destroy() {
|
|
1630
1630
|
super.destroy(), this.cancel({ silent: !0 });
|
|
@@ -1656,18 +1656,18 @@ var Ve = bc(), nr, Zs, To = (Zs = class {
|
|
|
1656
1656
|
onFocus() {
|
|
1657
1657
|
var r;
|
|
1658
1658
|
const t = this.observers.find((n) => n.shouldFetchOnWindowFocus());
|
|
1659
|
-
t == null || t.refetch({ cancelRefetch: !1 }), (r = v(this,
|
|
1659
|
+
t == null || t.refetch({ cancelRefetch: !1 }), (r = v(this, Le)) == null || r.continue();
|
|
1660
1660
|
}
|
|
1661
1661
|
onOnline() {
|
|
1662
1662
|
var r;
|
|
1663
1663
|
const t = this.observers.find((n) => n.shouldFetchOnReconnect());
|
|
1664
|
-
t == null || t.refetch({ cancelRefetch: !1 }), (r = v(this,
|
|
1664
|
+
t == null || t.refetch({ cancelRefetch: !1 }), (r = v(this, Le)) == null || r.continue();
|
|
1665
1665
|
}
|
|
1666
1666
|
addObserver(t) {
|
|
1667
1667
|
this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), v(this, tt).notify({ type: "observerAdded", query: this, observer: t }));
|
|
1668
1668
|
}
|
|
1669
1669
|
removeObserver(t) {
|
|
1670
|
-
this.observers.includes(t) && (this.observers = this.observers.filter((r) => r !== t), this.observers.length || (v(this,
|
|
1670
|
+
this.observers.includes(t) && (this.observers = this.observers.filter((r) => r !== t), this.observers.length || (v(this, Le) && (v(this, sr) ? v(this, Le).cancel({ revert: !0 }) : v(this, Le).cancelRetry()), this.scheduleGc()), v(this, tt).notify({ type: "observerRemoved", query: this, observer: t }));
|
|
1671
1671
|
}
|
|
1672
1672
|
getObserversCount() {
|
|
1673
1673
|
return this.observers.length;
|
|
@@ -1680,8 +1680,8 @@ var Ve = bc(), nr, Zs, To = (Zs = class {
|
|
|
1680
1680
|
if (this.state.fetchStatus !== "idle") {
|
|
1681
1681
|
if (this.state.data !== void 0 && (r != null && r.cancelRefetch))
|
|
1682
1682
|
this.cancel({ silent: !0 });
|
|
1683
|
-
else if (v(this,
|
|
1684
|
-
return v(this,
|
|
1683
|
+
else if (v(this, Le))
|
|
1684
|
+
return v(this, Le).continueRetry(), v(this, Le).promise;
|
|
1685
1685
|
}
|
|
1686
1686
|
if (t && this.setOptions(t), !this.options.queryFn) {
|
|
1687
1687
|
const m = this.observers.find((b) => b.options.queryFn);
|
|
@@ -1693,7 +1693,7 @@ var Ve = bc(), nr, Zs, To = (Zs = class {
|
|
|
1693
1693
|
const n = new AbortController(), i = (m) => {
|
|
1694
1694
|
Object.defineProperty(m, "signal", {
|
|
1695
1695
|
enumerable: !0,
|
|
1696
|
-
get: () => (
|
|
1696
|
+
get: () => (J(this, sr, !0), n.signal)
|
|
1697
1697
|
});
|
|
1698
1698
|
}, a = () => {
|
|
1699
1699
|
const m = So(this.options, r), h = (() => {
|
|
@@ -1704,7 +1704,7 @@ var Ve = bc(), nr, Zs, To = (Zs = class {
|
|
|
1704
1704
|
};
|
|
1705
1705
|
return i(c), c;
|
|
1706
1706
|
})();
|
|
1707
|
-
return
|
|
1707
|
+
return J(this, sr, !1), this.options.persister ? this.options.persister(
|
|
1708
1708
|
m,
|
|
1709
1709
|
h,
|
|
1710
1710
|
this
|
|
@@ -1720,7 +1720,7 @@ var Ve = bc(), nr, Zs, To = (Zs = class {
|
|
|
1720
1720
|
};
|
|
1721
1721
|
return i(m), m;
|
|
1722
1722
|
})();
|
|
1723
|
-
(p = this.options.behavior) == null || p.onFetch(o, this),
|
|
1723
|
+
(p = this.options.behavior) == null || p.onFetch(o, this), J(this, ir, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((d = o.fetchOptions) == null ? void 0 : d.meta)) && de(this, st, Ot).call(this, { type: "fetch", meta: (f = o.fetchOptions) == null ? void 0 : f.meta });
|
|
1724
1724
|
const l = (m) => {
|
|
1725
1725
|
var b, h, c, x;
|
|
1726
1726
|
gi(m) && m.silent || de(this, st, Ot).call(this, {
|
|
@@ -1737,7 +1737,7 @@ var Ve = bc(), nr, Zs, To = (Zs = class {
|
|
|
1737
1737
|
this
|
|
1738
1738
|
)), this.scheduleGc();
|
|
1739
1739
|
};
|
|
1740
|
-
return
|
|
1740
|
+
return J(this, Le, Oo({
|
|
1741
1741
|
initialPromise: r == null ? void 0 : r.initialPromise,
|
|
1742
1742
|
fn: o.fetchFn,
|
|
1743
1743
|
abort: n.abort.bind(n),
|
|
@@ -1776,9 +1776,9 @@ var Ve = bc(), nr, Zs, To = (Zs = class {
|
|
|
1776
1776
|
retryDelay: o.options.retryDelay,
|
|
1777
1777
|
networkMode: o.options.networkMode,
|
|
1778
1778
|
canRun: () => !0
|
|
1779
|
-
})), v(this,
|
|
1779
|
+
})), v(this, Le).start();
|
|
1780
1780
|
}
|
|
1781
|
-
}, Dr = new WeakMap(), ir = new WeakMap(), tt = new WeakMap(), ar = new WeakMap(),
|
|
1781
|
+
}, Dr = new WeakMap(), ir = new WeakMap(), tt = new WeakMap(), ar = new WeakMap(), Le = new WeakMap(), ln = new WeakMap(), sr = new WeakMap(), st = new WeakSet(), Ot = function(t) {
|
|
1782
1782
|
const r = (n) => {
|
|
1783
1783
|
switch (t.type) {
|
|
1784
1784
|
case "failed":
|
|
@@ -1804,7 +1804,7 @@ var Ve = bc(), nr, Zs, To = (Zs = class {
|
|
|
1804
1804
|
fetchMeta: t.meta ?? null
|
|
1805
1805
|
};
|
|
1806
1806
|
case "success":
|
|
1807
|
-
return
|
|
1807
|
+
return J(this, ir, void 0), {
|
|
1808
1808
|
...n,
|
|
1809
1809
|
data: t.data,
|
|
1810
1810
|
dataUpdateCount: n.dataUpdateCount + 1,
|
|
@@ -1842,7 +1842,7 @@ var Ve = bc(), nr, Zs, To = (Zs = class {
|
|
|
1842
1842
|
};
|
|
1843
1843
|
}
|
|
1844
1844
|
};
|
|
1845
|
-
this.state = r(this.state),
|
|
1845
|
+
this.state = r(this.state), Ne.batch(() => {
|
|
1846
1846
|
this.observers.forEach((n) => {
|
|
1847
1847
|
n.onQueryUpdate();
|
|
1848
1848
|
}), v(this, tt).notify({ query: this, type: "updated", action: t });
|
|
@@ -1879,8 +1879,8 @@ function Sc(e) {
|
|
|
1879
1879
|
var gt, Xs, Ec = (Xs = class extends fn {
|
|
1880
1880
|
constructor(t = {}) {
|
|
1881
1881
|
super();
|
|
1882
|
-
|
|
1883
|
-
this.config = t,
|
|
1882
|
+
se(this, gt);
|
|
1883
|
+
this.config = t, J(this, gt, /* @__PURE__ */ new Map());
|
|
1884
1884
|
}
|
|
1885
1885
|
build(t, r, n) {
|
|
1886
1886
|
const i = r.queryKey, a = r.queryHash ?? da(i, r);
|
|
@@ -1905,7 +1905,7 @@ var gt, Xs, Ec = (Xs = class extends fn {
|
|
|
1905
1905
|
r && (t.destroy(), r === t && v(this, gt).delete(t.queryHash), this.notify({ type: "removed", query: t }));
|
|
1906
1906
|
}
|
|
1907
1907
|
clear() {
|
|
1908
|
-
|
|
1908
|
+
Ne.batch(() => {
|
|
1909
1909
|
this.getAll().forEach((t) => {
|
|
1910
1910
|
this.remove(t);
|
|
1911
1911
|
});
|
|
@@ -1928,21 +1928,21 @@ var gt, Xs, Ec = (Xs = class extends fn {
|
|
|
1928
1928
|
return Object.keys(t).length > 0 ? r.filter((n) => Ba(t, n)) : r;
|
|
1929
1929
|
}
|
|
1930
1930
|
notify(t) {
|
|
1931
|
-
|
|
1931
|
+
Ne.batch(() => {
|
|
1932
1932
|
this.listeners.forEach((r) => {
|
|
1933
1933
|
r(t);
|
|
1934
1934
|
});
|
|
1935
1935
|
});
|
|
1936
1936
|
}
|
|
1937
1937
|
onFocus() {
|
|
1938
|
-
|
|
1938
|
+
Ne.batch(() => {
|
|
1939
1939
|
this.getAll().forEach((t) => {
|
|
1940
1940
|
t.onFocus();
|
|
1941
1941
|
});
|
|
1942
1942
|
});
|
|
1943
1943
|
}
|
|
1944
1944
|
onOnline() {
|
|
1945
|
-
|
|
1945
|
+
Ne.batch(() => {
|
|
1946
1946
|
this.getAll().forEach((t) => {
|
|
1947
1947
|
t.onOnline();
|
|
1948
1948
|
});
|
|
@@ -1951,11 +1951,11 @@ var gt, Xs, Ec = (Xs = class extends fn {
|
|
|
1951
1951
|
}, gt = new WeakMap(), Xs), yt, qe, or, vt, Dt, eo, kc = (eo = class extends To {
|
|
1952
1952
|
constructor(t) {
|
|
1953
1953
|
super();
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
this.mutationId = t.mutationId,
|
|
1954
|
+
se(this, vt);
|
|
1955
|
+
se(this, yt);
|
|
1956
|
+
se(this, qe);
|
|
1957
|
+
se(this, or);
|
|
1958
|
+
this.mutationId = t.mutationId, J(this, qe, t.mutationCache), J(this, yt, []), this.state = t.state || Oc(), this.setOptions(t.options), this.scheduleGc();
|
|
1959
1959
|
}
|
|
1960
1960
|
setOptions(t) {
|
|
1961
1961
|
this.options = t, this.updateGcTime(this.options.gcTime);
|
|
@@ -1971,7 +1971,7 @@ var gt, Xs, Ec = (Xs = class extends fn {
|
|
|
1971
1971
|
}));
|
|
1972
1972
|
}
|
|
1973
1973
|
removeObserver(t) {
|
|
1974
|
-
|
|
1974
|
+
J(this, yt, v(this, yt).filter((r) => r !== t)), this.scheduleGc(), v(this, qe).notify({
|
|
1975
1975
|
type: "observerRemoved",
|
|
1976
1976
|
mutation: this,
|
|
1977
1977
|
observer: t
|
|
@@ -1986,14 +1986,14 @@ var gt, Xs, Ec = (Xs = class extends fn {
|
|
|
1986
1986
|
this.execute(this.state.variables);
|
|
1987
1987
|
}
|
|
1988
1988
|
async execute(t) {
|
|
1989
|
-
var a, s, o, l, p, d, f, m, b, h, c, x, y, O, F, C, w, M,
|
|
1989
|
+
var a, s, o, l, p, d, f, m, b, h, c, x, y, O, F, C, w, M, Y, X;
|
|
1990
1990
|
const r = () => {
|
|
1991
1991
|
de(this, vt, Dt).call(this, { type: "continue" });
|
|
1992
1992
|
};
|
|
1993
|
-
|
|
1993
|
+
J(this, or, Oo({
|
|
1994
1994
|
fn: () => this.options.mutationFn ? this.options.mutationFn(t) : Promise.reject(new Error("No mutationFn found")),
|
|
1995
|
-
onFail: (
|
|
1996
|
-
de(this, vt, Dt).call(this, { type: "failed", failureCount:
|
|
1995
|
+
onFail: (K, u) => {
|
|
1996
|
+
de(this, vt, Dt).call(this, { type: "failed", failureCount: K, error: u });
|
|
1997
1997
|
},
|
|
1998
1998
|
onPause: () => {
|
|
1999
1999
|
de(this, vt, Dt).call(this, { type: "pause" });
|
|
@@ -2022,50 +2022,50 @@ var gt, Xs, Ec = (Xs = class extends fn {
|
|
|
2022
2022
|
isPaused: i
|
|
2023
2023
|
});
|
|
2024
2024
|
}
|
|
2025
|
-
const
|
|
2025
|
+
const K = await v(this, or).start();
|
|
2026
2026
|
return await ((d = (p = v(this, qe).config).onSuccess) == null ? void 0 : d.call(
|
|
2027
2027
|
p,
|
|
2028
|
-
|
|
2028
|
+
K,
|
|
2029
2029
|
t,
|
|
2030
2030
|
this.state.context,
|
|
2031
2031
|
this
|
|
2032
|
-
)), await ((m = (f = this.options).onSuccess) == null ? void 0 : m.call(f,
|
|
2032
|
+
)), await ((m = (f = this.options).onSuccess) == null ? void 0 : m.call(f, K, t, this.state.context)), await ((h = (b = v(this, qe).config).onSettled) == null ? void 0 : h.call(
|
|
2033
2033
|
b,
|
|
2034
|
-
|
|
2034
|
+
K,
|
|
2035
2035
|
null,
|
|
2036
2036
|
this.state.variables,
|
|
2037
2037
|
this.state.context,
|
|
2038
2038
|
this
|
|
2039
|
-
)), await ((x = (c = this.options).onSettled) == null ? void 0 : x.call(c,
|
|
2040
|
-
} catch (
|
|
2039
|
+
)), await ((x = (c = this.options).onSettled) == null ? void 0 : x.call(c, K, null, t, this.state.context)), de(this, vt, Dt).call(this, { type: "success", data: K }), K;
|
|
2040
|
+
} catch (K) {
|
|
2041
2041
|
try {
|
|
2042
2042
|
throw await ((O = (y = v(this, qe).config).onError) == null ? void 0 : O.call(
|
|
2043
2043
|
y,
|
|
2044
|
-
|
|
2044
|
+
K,
|
|
2045
2045
|
t,
|
|
2046
2046
|
this.state.context,
|
|
2047
2047
|
this
|
|
2048
2048
|
)), await ((C = (F = this.options).onError) == null ? void 0 : C.call(
|
|
2049
2049
|
F,
|
|
2050
|
-
|
|
2050
|
+
K,
|
|
2051
2051
|
t,
|
|
2052
2052
|
this.state.context
|
|
2053
2053
|
)), await ((M = (w = v(this, qe).config).onSettled) == null ? void 0 : M.call(
|
|
2054
2054
|
w,
|
|
2055
2055
|
void 0,
|
|
2056
|
-
|
|
2056
|
+
K,
|
|
2057
2057
|
this.state.variables,
|
|
2058
2058
|
this.state.context,
|
|
2059
2059
|
this
|
|
2060
|
-
)), await ((
|
|
2061
|
-
|
|
2060
|
+
)), await ((X = (Y = this.options).onSettled) == null ? void 0 : X.call(
|
|
2061
|
+
Y,
|
|
2062
2062
|
void 0,
|
|
2063
|
-
|
|
2063
|
+
K,
|
|
2064
2064
|
t,
|
|
2065
2065
|
this.state.context
|
|
2066
|
-
)),
|
|
2066
|
+
)), K;
|
|
2067
2067
|
} finally {
|
|
2068
|
-
de(this, vt, Dt).call(this, { type: "error", error:
|
|
2068
|
+
de(this, vt, Dt).call(this, { type: "error", error: K });
|
|
2069
2069
|
}
|
|
2070
2070
|
} finally {
|
|
2071
2071
|
v(this, qe).runNext(this);
|
|
@@ -2125,7 +2125,7 @@ var gt, Xs, Ec = (Xs = class extends fn {
|
|
|
2125
2125
|
};
|
|
2126
2126
|
}
|
|
2127
2127
|
};
|
|
2128
|
-
this.state = r(this.state),
|
|
2128
|
+
this.state = r(this.state), Ne.batch(() => {
|
|
2129
2129
|
v(this, yt).forEach((n) => {
|
|
2130
2130
|
n.onMutationUpdate(t);
|
|
2131
2131
|
}), v(this, qe).notify({
|
|
@@ -2151,10 +2151,10 @@ function Oc() {
|
|
|
2151
2151
|
var Tt, ot, cn, to, Tc = (to = class extends fn {
|
|
2152
2152
|
constructor(t = {}) {
|
|
2153
2153
|
super();
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
this.config = t,
|
|
2154
|
+
se(this, Tt);
|
|
2155
|
+
se(this, ot);
|
|
2156
|
+
se(this, cn);
|
|
2157
|
+
this.config = t, J(this, Tt, /* @__PURE__ */ new Set()), J(this, ot, /* @__PURE__ */ new Map()), J(this, cn, 0);
|
|
2158
2158
|
}
|
|
2159
2159
|
build(t, r, n) {
|
|
2160
2160
|
const i = new kc({
|
|
@@ -2208,7 +2208,7 @@ var Tt, ot, cn, to, Tc = (to = class extends fn {
|
|
|
2208
2208
|
return Promise.resolve();
|
|
2209
2209
|
}
|
|
2210
2210
|
clear() {
|
|
2211
|
-
|
|
2211
|
+
Ne.batch(() => {
|
|
2212
2212
|
v(this, Tt).forEach((t) => {
|
|
2213
2213
|
this.notify({ type: "removed", mutation: t });
|
|
2214
2214
|
}), v(this, Tt).clear(), v(this, ot).clear();
|
|
@@ -2227,7 +2227,7 @@ var Tt, ot, cn, to, Tc = (to = class extends fn {
|
|
|
2227
2227
|
return this.getAll().filter((r) => Ua(t, r));
|
|
2228
2228
|
}
|
|
2229
2229
|
notify(t) {
|
|
2230
|
-
|
|
2230
|
+
Ne.batch(() => {
|
|
2231
2231
|
this.listeners.forEach((r) => {
|
|
2232
2232
|
r(t);
|
|
2233
2233
|
});
|
|
@@ -2235,7 +2235,7 @@ var Tt, ot, cn, to, Tc = (to = class extends fn {
|
|
|
2235
2235
|
}
|
|
2236
2236
|
resumePausedMutations() {
|
|
2237
2237
|
const t = this.getAll().filter((r) => r.state.isPaused);
|
|
2238
|
-
return
|
|
2238
|
+
return Ne.batch(
|
|
2239
2239
|
() => Promise.all(
|
|
2240
2240
|
t.map((r) => r.continue().catch(Qe))
|
|
2241
2241
|
)
|
|
@@ -2266,7 +2266,7 @@ function Ka(e) {
|
|
|
2266
2266
|
return Promise.reject();
|
|
2267
2267
|
if (C == null && F.pages.length)
|
|
2268
2268
|
return Promise.resolve(F);
|
|
2269
|
-
const
|
|
2269
|
+
const Y = (() => {
|
|
2270
2270
|
const D = {
|
|
2271
2271
|
client: t.client,
|
|
2272
2272
|
queryKey: t.queryKey,
|
|
@@ -2275,10 +2275,10 @@ function Ka(e) {
|
|
|
2275
2275
|
meta: t.options.meta
|
|
2276
2276
|
};
|
|
2277
2277
|
return x(D), D;
|
|
2278
|
-
})(),
|
|
2278
|
+
})(), X = await y(Y), { maxPages: K } = t.options, u = w ? mc : fc;
|
|
2279
2279
|
return {
|
|
2280
|
-
pages: u(F.pages,
|
|
2281
|
-
pageParams: u(F.pageParams, C,
|
|
2280
|
+
pages: u(F.pages, X, K),
|
|
2281
|
+
pageParams: u(F.pageParams, C, K)
|
|
2282
2282
|
};
|
|
2283
2283
|
};
|
|
2284
2284
|
if (i && a.length) {
|
|
@@ -2328,31 +2328,31 @@ function _c(e, { pages: t, pageParams: r }) {
|
|
|
2328
2328
|
var n;
|
|
2329
2329
|
return t.length > 0 ? (n = e.getPreviousPageParam) == null ? void 0 : n.call(e, t[0], t, r[0], r) : void 0;
|
|
2330
2330
|
}
|
|
2331
|
-
var
|
|
2331
|
+
var Ae, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
2332
2332
|
constructor(e = {}) {
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2333
|
+
se(this, Ae);
|
|
2334
|
+
se(this, Mt);
|
|
2335
|
+
se(this, zt);
|
|
2336
|
+
se(this, Rr);
|
|
2337
|
+
se(this, Pr);
|
|
2338
|
+
se(this, Vt);
|
|
2339
|
+
se(this, jr);
|
|
2340
|
+
se(this, Ir);
|
|
2341
|
+
J(this, Ae, e.queryCache || new Ec()), J(this, Mt, e.mutationCache || new Tc()), J(this, zt, e.defaultOptions || {}), J(this, Rr, /* @__PURE__ */ new Map()), J(this, Pr, /* @__PURE__ */ new Map()), J(this, Vt, 0);
|
|
2342
2342
|
}
|
|
2343
2343
|
mount() {
|
|
2344
|
-
bn(this, Vt)._++, v(this, Vt) === 1 && (
|
|
2345
|
-
e && (await this.resumePausedMutations(), v(this,
|
|
2346
|
-
})),
|
|
2347
|
-
e && (await this.resumePausedMutations(), v(this,
|
|
2344
|
+
bn(this, Vt)._++, v(this, Vt) === 1 && (J(this, jr, pa.subscribe(async (e) => {
|
|
2345
|
+
e && (await this.resumePausedMutations(), v(this, Ae).onFocus());
|
|
2346
|
+
})), J(this, Ir, Un.subscribe(async (e) => {
|
|
2347
|
+
e && (await this.resumePausedMutations(), v(this, Ae).onOnline());
|
|
2348
2348
|
})));
|
|
2349
2349
|
}
|
|
2350
2350
|
unmount() {
|
|
2351
2351
|
var e, t;
|
|
2352
|
-
bn(this, Vt)._--, v(this, Vt) === 0 && ((e = v(this, jr)) == null || e.call(this),
|
|
2352
|
+
bn(this, Vt)._--, v(this, Vt) === 0 && ((e = v(this, jr)) == null || e.call(this), J(this, jr, void 0), (t = v(this, Ir)) == null || t.call(this), J(this, Ir, void 0));
|
|
2353
2353
|
}
|
|
2354
2354
|
isFetching(e) {
|
|
2355
|
-
return v(this,
|
|
2355
|
+
return v(this, Ae).findAll({ ...e, fetchStatus: "fetching" }).length;
|
|
2356
2356
|
}
|
|
2357
2357
|
isMutating(e) {
|
|
2358
2358
|
return v(this, Mt).findAll({ ...e, status: "pending" }).length;
|
|
@@ -2367,28 +2367,28 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2367
2367
|
getQueryData(e) {
|
|
2368
2368
|
var r;
|
|
2369
2369
|
const t = this.defaultQueryOptions({ queryKey: e });
|
|
2370
|
-
return (r = v(this,
|
|
2370
|
+
return (r = v(this, Ae).get(t.queryHash)) == null ? void 0 : r.state.data;
|
|
2371
2371
|
}
|
|
2372
2372
|
ensureQueryData(e) {
|
|
2373
|
-
const t = this.defaultQueryOptions(e), r = v(this,
|
|
2373
|
+
const t = this.defaultQueryOptions(e), r = v(this, Ae).build(this, t), n = r.state.data;
|
|
2374
2374
|
return n === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && r.isStaleByTime(Wt(t.staleTime, r)) && this.prefetchQuery(t), Promise.resolve(n));
|
|
2375
2375
|
}
|
|
2376
2376
|
getQueriesData(e) {
|
|
2377
|
-
return v(this,
|
|
2377
|
+
return v(this, Ae).findAll(e).map(({ queryKey: t, state: r }) => {
|
|
2378
2378
|
const n = r.data;
|
|
2379
2379
|
return [t, n];
|
|
2380
2380
|
});
|
|
2381
2381
|
}
|
|
2382
2382
|
setQueryData(e, t, r) {
|
|
2383
|
-
const n = this.defaultQueryOptions({ queryKey: e }), i = v(this,
|
|
2383
|
+
const n = this.defaultQueryOptions({ queryKey: e }), i = v(this, Ae).get(
|
|
2384
2384
|
n.queryHash
|
|
2385
2385
|
), a = i == null ? void 0 : i.state.data, s = dc(t, a);
|
|
2386
2386
|
if (s !== void 0)
|
|
2387
|
-
return v(this,
|
|
2387
|
+
return v(this, Ae).build(this, n).setData(s, { ...r, manual: !0 });
|
|
2388
2388
|
}
|
|
2389
2389
|
setQueriesData(e, t, r) {
|
|
2390
|
-
return
|
|
2391
|
-
() => v(this,
|
|
2390
|
+
return Ne.batch(
|
|
2391
|
+
() => v(this, Ae).findAll(e).map(({ queryKey: n }) => [
|
|
2392
2392
|
n,
|
|
2393
2393
|
this.setQueryData(n, t, r)
|
|
2394
2394
|
])
|
|
@@ -2397,21 +2397,21 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2397
2397
|
getQueryState(e) {
|
|
2398
2398
|
var r;
|
|
2399
2399
|
const t = this.defaultQueryOptions({ queryKey: e });
|
|
2400
|
-
return (r = v(this,
|
|
2400
|
+
return (r = v(this, Ae).get(
|
|
2401
2401
|
t.queryHash
|
|
2402
2402
|
)) == null ? void 0 : r.state;
|
|
2403
2403
|
}
|
|
2404
2404
|
removeQueries(e) {
|
|
2405
|
-
const t = v(this,
|
|
2406
|
-
|
|
2405
|
+
const t = v(this, Ae);
|
|
2406
|
+
Ne.batch(() => {
|
|
2407
2407
|
t.findAll(e).forEach((r) => {
|
|
2408
2408
|
t.remove(r);
|
|
2409
2409
|
});
|
|
2410
2410
|
});
|
|
2411
2411
|
}
|
|
2412
2412
|
resetQueries(e, t) {
|
|
2413
|
-
const r = v(this,
|
|
2414
|
-
return
|
|
2413
|
+
const r = v(this, Ae);
|
|
2414
|
+
return Ne.batch(() => (r.findAll(e).forEach((n) => {
|
|
2415
2415
|
n.reset();
|
|
2416
2416
|
}), this.refetchQueries(
|
|
2417
2417
|
{
|
|
@@ -2422,13 +2422,13 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2422
2422
|
)));
|
|
2423
2423
|
}
|
|
2424
2424
|
cancelQueries(e, t = {}) {
|
|
2425
|
-
const r = { revert: !0, ...t }, n =
|
|
2426
|
-
() => v(this,
|
|
2425
|
+
const r = { revert: !0, ...t }, n = Ne.batch(
|
|
2426
|
+
() => v(this, Ae).findAll(e).map((i) => i.cancel(r))
|
|
2427
2427
|
);
|
|
2428
2428
|
return Promise.all(n).then(Qe).catch(Qe);
|
|
2429
2429
|
}
|
|
2430
2430
|
invalidateQueries(e, t = {}) {
|
|
2431
|
-
return
|
|
2431
|
+
return Ne.batch(() => (v(this, Ae).findAll(e).forEach((r) => {
|
|
2432
2432
|
r.invalidate();
|
|
2433
2433
|
}), (e == null ? void 0 : e.refetchType) === "none" ? Promise.resolve() : this.refetchQueries(
|
|
2434
2434
|
{
|
|
@@ -2442,8 +2442,8 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2442
2442
|
const r = {
|
|
2443
2443
|
...t,
|
|
2444
2444
|
cancelRefetch: t.cancelRefetch ?? !0
|
|
2445
|
-
}, n =
|
|
2446
|
-
() => v(this,
|
|
2445
|
+
}, n = Ne.batch(
|
|
2446
|
+
() => v(this, Ae).findAll(e).filter((i) => !i.isDisabled() && !i.isStatic()).map((i) => {
|
|
2447
2447
|
let a = i.fetch(void 0, r);
|
|
2448
2448
|
return r.throwOnError || (a = a.catch(Qe)), i.state.fetchStatus === "paused" ? Promise.resolve() : a;
|
|
2449
2449
|
})
|
|
@@ -2453,7 +2453,7 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2453
2453
|
fetchQuery(e) {
|
|
2454
2454
|
const t = this.defaultQueryOptions(e);
|
|
2455
2455
|
t.retry === void 0 && (t.retry = !1);
|
|
2456
|
-
const r = v(this,
|
|
2456
|
+
const r = v(this, Ae).build(this, t);
|
|
2457
2457
|
return r.isStaleByTime(
|
|
2458
2458
|
Wt(t.staleTime, r)
|
|
2459
2459
|
) ? r.fetch(t) : Promise.resolve(r.state.data);
|
|
@@ -2474,7 +2474,7 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2474
2474
|
return Un.isOnline() ? v(this, Mt).resumePausedMutations() : Promise.resolve();
|
|
2475
2475
|
}
|
|
2476
2476
|
getQueryCache() {
|
|
2477
|
-
return v(this,
|
|
2477
|
+
return v(this, Ae);
|
|
2478
2478
|
}
|
|
2479
2479
|
getMutationCache() {
|
|
2480
2480
|
return v(this, Mt);
|
|
@@ -2483,7 +2483,7 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2483
2483
|
return v(this, zt);
|
|
2484
2484
|
}
|
|
2485
2485
|
setDefaultOptions(e) {
|
|
2486
|
-
|
|
2486
|
+
J(this, zt, e);
|
|
2487
2487
|
}
|
|
2488
2488
|
setQueryDefaults(e, t) {
|
|
2489
2489
|
v(this, Rr).set(nn(e), {
|
|
@@ -2532,30 +2532,30 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2532
2532
|
};
|
|
2533
2533
|
}
|
|
2534
2534
|
clear() {
|
|
2535
|
-
v(this,
|
|
2535
|
+
v(this, Ae).clear(), v(this, Mt).clear();
|
|
2536
2536
|
}
|
|
2537
|
-
},
|
|
2537
|
+
}, Ae = new WeakMap(), Mt = new WeakMap(), zt = new WeakMap(), Rr = new WeakMap(), Pr = new WeakMap(), Vt = new WeakMap(), jr = new WeakMap(), Ir = new WeakMap(), ro), He, pe, un, Be, lr, Mr, Nt, Lt, dn, zr, Vr, cr, ur, qt, Nr, ye, Yr, Vi, Ni, Li, qi, Bi, Ui, Wi, Co, no, Ac = (no = class extends fn {
|
|
2538
2538
|
constructor(t, r) {
|
|
2539
2539
|
super();
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2540
|
+
se(this, ye);
|
|
2541
|
+
se(this, He);
|
|
2542
|
+
se(this, pe);
|
|
2543
|
+
se(this, un);
|
|
2544
|
+
se(this, Be);
|
|
2545
|
+
se(this, lr);
|
|
2546
|
+
se(this, Mr);
|
|
2547
|
+
se(this, Nt);
|
|
2548
|
+
se(this, Lt);
|
|
2549
|
+
se(this, dn);
|
|
2550
|
+
se(this, zr);
|
|
2551
2551
|
// This property keeps track of the last query with defined data.
|
|
2552
2552
|
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
this.options = r,
|
|
2553
|
+
se(this, Vr);
|
|
2554
|
+
se(this, cr);
|
|
2555
|
+
se(this, ur);
|
|
2556
|
+
se(this, qt);
|
|
2557
|
+
se(this, Nr, /* @__PURE__ */ new Set());
|
|
2558
|
+
this.options = r, J(this, He, t), J(this, Lt, null), J(this, Nt, zi()), this.options.experimental_prefetchInRender || v(this, Nt).reject(
|
|
2559
2559
|
new Error("experimental_prefetchInRender feature flag is not enabled")
|
|
2560
2560
|
), this.bindMethods(), this.setOptions(r);
|
|
2561
2561
|
}
|
|
@@ -2608,7 +2608,7 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2608
2608
|
}
|
|
2609
2609
|
getOptimisticResult(t) {
|
|
2610
2610
|
const r = v(this, He).getQueryCache().build(v(this, He), t), n = this.createResult(r, t);
|
|
2611
|
-
return $c(this, n) && (
|
|
2611
|
+
return $c(this, n) && (J(this, Be, n), J(this, Mr, this.options), J(this, lr, v(this, pe).state)), n;
|
|
2612
2612
|
}
|
|
2613
2613
|
getCurrentResult() {
|
|
2614
2614
|
return v(this, Be);
|
|
@@ -2640,7 +2640,7 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2640
2640
|
}).then(() => (this.updateResult(), v(this, Be)));
|
|
2641
2641
|
}
|
|
2642
2642
|
createResult(t, r) {
|
|
2643
|
-
var
|
|
2643
|
+
var K;
|
|
2644
2644
|
const n = v(this, pe), i = this.options, a = v(this, Be), s = v(this, lr), o = v(this, Mr), p = t !== n ? t.state : v(this, un), { state: d } = t;
|
|
2645
2645
|
let f = { ...d }, m = !1, b;
|
|
2646
2646
|
if (r._optimisticResults) {
|
|
@@ -2656,7 +2656,7 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2656
2656
|
if (r.placeholderData !== void 0 && b === void 0 && x === "pending") {
|
|
2657
2657
|
let u;
|
|
2658
2658
|
a != null && a.isPlaceholderData && r.placeholderData === (o == null ? void 0 : o.placeholderData) ? (u = a.data, y = !0) : u = typeof r.placeholderData == "function" ? r.placeholderData(
|
|
2659
|
-
(
|
|
2659
|
+
(K = v(this, Vr)) == null ? void 0 : K.state.data,
|
|
2660
2660
|
v(this, Vr)
|
|
2661
2661
|
) : r.placeholderData, u !== void 0 && (x = "success", b = Mi(
|
|
2662
2662
|
a == null ? void 0 : a.data,
|
|
@@ -2669,12 +2669,12 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2669
2669
|
b = v(this, zr);
|
|
2670
2670
|
else
|
|
2671
2671
|
try {
|
|
2672
|
-
|
|
2672
|
+
J(this, dn, r.select), b = r.select(b), b = Mi(a == null ? void 0 : a.data, b, r), J(this, zr, b), J(this, Lt, null);
|
|
2673
2673
|
} catch (u) {
|
|
2674
|
-
|
|
2674
|
+
J(this, Lt, u);
|
|
2675
2675
|
}
|
|
2676
2676
|
v(this, Lt) && (h = v(this, Lt), b = v(this, zr), c = Date.now(), x = "error");
|
|
2677
|
-
const O = f.fetchStatus === "fetching", F = x === "pending", C = x === "error", w = F && O, M = b !== void 0,
|
|
2677
|
+
const O = f.fetchStatus === "fetching", F = x === "pending", C = x === "error", w = F && O, M = b !== void 0, X = {
|
|
2678
2678
|
status: x,
|
|
2679
2679
|
fetchStatus: f.fetchStatus,
|
|
2680
2680
|
isPending: F,
|
|
@@ -2704,9 +2704,9 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2704
2704
|
};
|
|
2705
2705
|
if (this.options.experimental_prefetchInRender) {
|
|
2706
2706
|
const u = (P) => {
|
|
2707
|
-
|
|
2707
|
+
X.status === "error" ? P.reject(X.error) : X.data !== void 0 && P.resolve(X.data);
|
|
2708
2708
|
}, D = () => {
|
|
2709
|
-
const P =
|
|
2709
|
+
const P = J(this, Nt, X.promise = zi());
|
|
2710
2710
|
u(P);
|
|
2711
2711
|
}, k = v(this, Nt);
|
|
2712
2712
|
switch (k.status) {
|
|
@@ -2714,20 +2714,20 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2714
2714
|
t.queryHash === n.queryHash && u(k);
|
|
2715
2715
|
break;
|
|
2716
2716
|
case "fulfilled":
|
|
2717
|
-
(
|
|
2717
|
+
(X.status === "error" || X.data !== k.value) && D();
|
|
2718
2718
|
break;
|
|
2719
2719
|
case "rejected":
|
|
2720
|
-
(
|
|
2720
|
+
(X.status !== "error" || X.error !== k.reason) && D();
|
|
2721
2721
|
break;
|
|
2722
2722
|
}
|
|
2723
2723
|
}
|
|
2724
|
-
return
|
|
2724
|
+
return X;
|
|
2725
2725
|
}
|
|
2726
2726
|
updateResult() {
|
|
2727
2727
|
const t = v(this, Be), r = this.createResult(v(this, pe), this.options);
|
|
2728
|
-
if (
|
|
2728
|
+
if (J(this, lr, v(this, pe).state), J(this, Mr, this.options), v(this, lr).data !== void 0 && J(this, Vr, v(this, pe)), ji(r, t))
|
|
2729
2729
|
return;
|
|
2730
|
-
|
|
2730
|
+
J(this, Be, r);
|
|
2731
2731
|
const n = () => {
|
|
2732
2732
|
if (!t)
|
|
2733
2733
|
return !0;
|
|
@@ -2763,29 +2763,29 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2763
2763
|
if (pr || v(this, Be).isStale || !Ri(t))
|
|
2764
2764
|
return;
|
|
2765
2765
|
const n = wo(v(this, Be).dataUpdatedAt, t) + 1;
|
|
2766
|
-
|
|
2766
|
+
J(this, cr, setTimeout(() => {
|
|
2767
2767
|
v(this, Be).isStale || this.updateResult();
|
|
2768
2768
|
}, n));
|
|
2769
2769
|
}, Ni = function() {
|
|
2770
2770
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(v(this, pe)) : this.options.refetchInterval) ?? !1;
|
|
2771
2771
|
}, Li = function(t) {
|
|
2772
|
-
de(this, ye, Ui).call(this),
|
|
2772
|
+
de(this, ye, Ui).call(this), J(this, qt, t), !(pr || rt(this.options.enabled, v(this, pe)) === !1 || !Ri(v(this, qt)) || v(this, qt) === 0) && J(this, ur, setInterval(() => {
|
|
2773
2773
|
(this.options.refetchIntervalInBackground || pa.isFocused()) && de(this, ye, Yr).call(this);
|
|
2774
2774
|
}, v(this, qt)));
|
|
2775
2775
|
}, qi = function() {
|
|
2776
2776
|
de(this, ye, Vi).call(this), de(this, ye, Li).call(this, de(this, ye, Ni).call(this));
|
|
2777
2777
|
}, Bi = function() {
|
|
2778
|
-
v(this, cr) && (clearTimeout(v(this, cr)),
|
|
2778
|
+
v(this, cr) && (clearTimeout(v(this, cr)), J(this, cr, void 0));
|
|
2779
2779
|
}, Ui = function() {
|
|
2780
|
-
v(this, ur) && (clearInterval(v(this, ur)),
|
|
2780
|
+
v(this, ur) && (clearInterval(v(this, ur)), J(this, ur, void 0));
|
|
2781
2781
|
}, Wi = function() {
|
|
2782
2782
|
const t = v(this, He).getQueryCache().build(v(this, He), this.options);
|
|
2783
2783
|
if (t === v(this, pe))
|
|
2784
2784
|
return;
|
|
2785
2785
|
const r = v(this, pe);
|
|
2786
|
-
|
|
2786
|
+
J(this, pe, t), J(this, un, t.state), this.hasListeners() && (r == null || r.removeObserver(this), t.addObserver(this));
|
|
2787
2787
|
}, Co = function(t) {
|
|
2788
|
-
|
|
2788
|
+
Ne.batch(() => {
|
|
2789
2789
|
t.listeners && this.listeners.forEach((r) => {
|
|
2790
2790
|
r(v(this, Be));
|
|
2791
2791
|
}), v(this, He).getQueryCache().notify({
|
|
@@ -2816,19 +2816,19 @@ function fa(e, t) {
|
|
|
2816
2816
|
function $c(e, t) {
|
|
2817
2817
|
return !ji(e.getCurrentResult(), t);
|
|
2818
2818
|
}
|
|
2819
|
-
var Ao =
|
|
2819
|
+
var Ao = Fe.createContext(
|
|
2820
2820
|
void 0
|
|
2821
2821
|
), Dc = (e) => {
|
|
2822
|
-
const t =
|
|
2822
|
+
const t = Fe.useContext(Ao);
|
|
2823
2823
|
if (!t)
|
|
2824
2824
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
2825
2825
|
return t;
|
|
2826
2826
|
}, Rc = ({
|
|
2827
2827
|
client: e,
|
|
2828
2828
|
children: t
|
|
2829
|
-
}) => (
|
|
2829
|
+
}) => (Fe.useEffect(() => (e.mount(), () => {
|
|
2830
2830
|
e.unmount();
|
|
2831
|
-
}), [e]), /* @__PURE__ */ $(Ao.Provider, { value: e, children: t })), Fo =
|
|
2831
|
+
}), [e]), /* @__PURE__ */ $(Ao.Provider, { value: e, children: t })), Fo = Fe.createContext(!1), Pc = () => Fe.useContext(Fo);
|
|
2832
2832
|
Fo.Provider;
|
|
2833
2833
|
function jc() {
|
|
2834
2834
|
let e = !1;
|
|
@@ -2842,10 +2842,10 @@ function jc() {
|
|
|
2842
2842
|
isReset: () => e
|
|
2843
2843
|
};
|
|
2844
2844
|
}
|
|
2845
|
-
var Ic =
|
|
2845
|
+
var Ic = Fe.createContext(jc()), Mc = () => Fe.useContext(Ic), zc = (e, t) => {
|
|
2846
2846
|
(e.suspense || e.throwOnError || e.experimental_prefetchInRender) && (t.isReset() || (e.retryOnMount = !1));
|
|
2847
2847
|
}, Vc = (e) => {
|
|
2848
|
-
|
|
2848
|
+
Fe.useEffect(() => {
|
|
2849
2849
|
e.clearReset();
|
|
2850
2850
|
}, [e]);
|
|
2851
2851
|
}, Nc = ({
|
|
@@ -2875,23 +2875,23 @@ function Uc(e, t, r) {
|
|
|
2875
2875
|
), process.env.NODE_ENV !== "production" && (s.queryFn || console.error(
|
|
2876
2876
|
`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
|
|
2877
2877
|
)), s._optimisticResults = n ? "isRestoring" : "optimistic", Lc(s), zc(s, i), Vc(i);
|
|
2878
|
-
const o = !a.getQueryCache().get(s.queryHash), [l] =
|
|
2878
|
+
const o = !a.getQueryCache().get(s.queryHash), [l] = Fe.useState(
|
|
2879
2879
|
() => new t(
|
|
2880
2880
|
a,
|
|
2881
2881
|
s
|
|
2882
2882
|
)
|
|
2883
2883
|
), p = l.getOptimisticResult(s), d = !n && e.subscribed !== !1;
|
|
2884
|
-
if (
|
|
2885
|
-
|
|
2884
|
+
if (Fe.useSyncExternalStore(
|
|
2885
|
+
Fe.useCallback(
|
|
2886
2886
|
(x) => {
|
|
2887
|
-
const y = d ? l.subscribe(
|
|
2887
|
+
const y = d ? l.subscribe(Ne.batchCalls(x)) : Qe;
|
|
2888
2888
|
return l.updateResult(), y;
|
|
2889
2889
|
},
|
|
2890
2890
|
[l, d]
|
|
2891
2891
|
),
|
|
2892
2892
|
() => l.getCurrentResult(),
|
|
2893
2893
|
() => l.getCurrentResult()
|
|
2894
|
-
),
|
|
2894
|
+
), Fe.useEffect(() => {
|
|
2895
2895
|
l.setOptions(s);
|
|
2896
2896
|
}, [s, l]), Bc(s, p))
|
|
2897
2897
|
throw Za(s, l, i);
|
|
@@ -3002,11 +3002,11 @@ async function Kc(e, t, r, n) {
|
|
|
3002
3002
|
}
|
|
3003
3003
|
}
|
|
3004
3004
|
function Qc(e, t, r, n, i = !1) {
|
|
3005
|
-
const a =
|
|
3005
|
+
const a = Ve(() => {
|
|
3006
3006
|
if (!(e != null && e.dependsOn) || !n) return null;
|
|
3007
3007
|
const o = n[e.dependsOn];
|
|
3008
3008
|
return o !== void 0 ? o : null;
|
|
3009
|
-
}, [e == null ? void 0 : e.dependsOn, n]), s =
|
|
3009
|
+
}, [e == null ? void 0 : e.dependsOn, n]), s = Ve(() => [
|
|
3010
3010
|
"api-data",
|
|
3011
3011
|
e == null ? void 0 : e.endpoint,
|
|
3012
3012
|
e == null ? void 0 : e.method,
|
|
@@ -3067,18 +3067,18 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3067
3067
|
const s = r[e.name], o = !!s, [l, p] = Xt(!1), d = xt(!1), f = () => {
|
|
3068
3068
|
var k;
|
|
3069
3069
|
return e.required !== void 0 ? e.required : ((k = e.validation) == null ? void 0 : k.required) !== void 0 ? e.validation.required : !1;
|
|
3070
|
-
}, m = (k) => f() ? `${k} *` : k, b = () => e.value !== void 0 ? e.value : e.type === "checkbox" ? !1 : e.type === "select" && e.default ? e.default : e.type === "autocomplete" && e.multiple ? [] : "", h =
|
|
3070
|
+
}, m = (k) => f() ? `${k} *` : k, b = () => e.value !== void 0 ? e.value : e.type === "checkbox" ? !1 : e.type === "select" && e.default ? e.default : e.type === "autocomplete" && e.multiple ? [] : "", h = Ve(() => $o(e), [e.apiConfig, e.api_endpoint, e.api_method, e.value_field, e.label_field, e.depends_on, e.conditional]), c = xt(null), x = h != null && h.dependsOn ? a == null ? void 0 : a[h.dependsOn] : null, y = Ve(() => {
|
|
3071
3071
|
if (!(h != null && h.dependsOn)) return !1;
|
|
3072
3072
|
const k = x, P = c.current, z = k !== P;
|
|
3073
3073
|
return z && (c.current = k), z;
|
|
3074
|
-
}, [h == null ? void 0 : h.dependsOn, x]), O =
|
|
3074
|
+
}, [h == null ? void 0 : h.dependsOn, x]), O = Ve(() => !0, []), F = Ve(() => l && xr(e) && (!(h != null && h.dependsOn) || x), [l, e, h == null ? void 0 : h.dependsOn, x]), C = Ve(() => {
|
|
3075
3075
|
if (!(h != null && h.dependsOn) || !a) return {};
|
|
3076
3076
|
const k = {};
|
|
3077
3077
|
return h.dependsOn && a[h.dependsOn] !== void 0 && (k[h.dependsOn] = a[h.dependsOn]), k;
|
|
3078
3078
|
}, [h == null ? void 0 : h.dependsOn, a]), {
|
|
3079
3079
|
data: w = [],
|
|
3080
3080
|
isLoading: M,
|
|
3081
|
-
error:
|
|
3081
|
+
error: Y
|
|
3082
3082
|
} = Qc(
|
|
3083
3083
|
h,
|
|
3084
3084
|
n,
|
|
@@ -3086,9 +3086,9 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3086
3086
|
C,
|
|
3087
3087
|
// Only pass dependent values, not entire formData
|
|
3088
3088
|
F
|
|
3089
|
-
),
|
|
3089
|
+
), X = je(() => {
|
|
3090
3090
|
xr(e) && !d.current && (d.current = !0, p(!0));
|
|
3091
|
-
}, [e]),
|
|
3091
|
+
}, [e]), K = je(() => {
|
|
3092
3092
|
xr(e) && !d.current && (d.current = !0, p(!0));
|
|
3093
3093
|
}, [e]);
|
|
3094
3094
|
wt(() => {
|
|
@@ -3099,12 +3099,12 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3099
3099
|
}, [e, a]), wt(() => {
|
|
3100
3100
|
xr(e) && (h != null && h.dependsOn) && y && d.current && (d.current = !1, p(!1));
|
|
3101
3101
|
}, [y, h == null ? void 0 : h.dependsOn]);
|
|
3102
|
-
const u =
|
|
3102
|
+
const u = je(() => xr(e) ? w : e.type === "select" || e.type === "toggle" || e.type === "radio" || e.type === "autocomplete" ? e.options || [] : [], [e, w]);
|
|
3103
3103
|
return O ? /* @__PURE__ */ $(Se, { children: (() => {
|
|
3104
3104
|
switch (e.type) {
|
|
3105
3105
|
case "title":
|
|
3106
3106
|
return /* @__PURE__ */ $(
|
|
3107
|
-
|
|
3107
|
+
ze,
|
|
3108
3108
|
{
|
|
3109
3109
|
variant: e.variant || "h4",
|
|
3110
3110
|
component: "h1",
|
|
@@ -3116,7 +3116,7 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3116
3116
|
);
|
|
3117
3117
|
case "section":
|
|
3118
3118
|
return /* @__PURE__ */ $(
|
|
3119
|
-
|
|
3119
|
+
ze,
|
|
3120
3120
|
{
|
|
3121
3121
|
variant: e.variant || "h6",
|
|
3122
3122
|
component: "h3",
|
|
@@ -3136,10 +3136,10 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3136
3136
|
name: e.name,
|
|
3137
3137
|
control: t,
|
|
3138
3138
|
defaultValue: b(),
|
|
3139
|
-
render: ({ field:
|
|
3139
|
+
render: ({ field: N }) => /* @__PURE__ */ $(
|
|
3140
3140
|
wn,
|
|
3141
3141
|
{
|
|
3142
|
-
...
|
|
3142
|
+
...N,
|
|
3143
3143
|
id: e.id,
|
|
3144
3144
|
fullWidth: !0,
|
|
3145
3145
|
label: m(e.label),
|
|
@@ -3159,10 +3159,10 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3159
3159
|
name: e.name,
|
|
3160
3160
|
control: t,
|
|
3161
3161
|
defaultValue: b(),
|
|
3162
|
-
render: ({ field:
|
|
3162
|
+
render: ({ field: N }) => /* @__PURE__ */ $(
|
|
3163
3163
|
wn,
|
|
3164
3164
|
{
|
|
3165
|
-
...
|
|
3165
|
+
...N,
|
|
3166
3166
|
id: e.id,
|
|
3167
3167
|
fullWidth: !0,
|
|
3168
3168
|
label: m(e.label),
|
|
@@ -3187,24 +3187,24 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3187
3187
|
name: e.name,
|
|
3188
3188
|
control: t,
|
|
3189
3189
|
defaultValue: b(),
|
|
3190
|
-
render: ({ field:
|
|
3190
|
+
render: ({ field: N }) => /* @__PURE__ */ Te(mi, { fullWidth: !0, error: o || !!Y, children: [
|
|
3191
3191
|
/* @__PURE__ */ $($l, { id: e.id, children: m(e.label) }),
|
|
3192
3192
|
/* @__PURE__ */ $(
|
|
3193
3193
|
Dl,
|
|
3194
3194
|
{
|
|
3195
|
-
...
|
|
3195
|
+
...N,
|
|
3196
3196
|
labelId: e.id,
|
|
3197
3197
|
label: m(e.label),
|
|
3198
3198
|
disabled: e.disabled || M,
|
|
3199
3199
|
endAdornment: M ? /* @__PURE__ */ $(_r, { size: 20 }) : void 0,
|
|
3200
|
-
onOpen:
|
|
3201
|
-
children: M ? /* @__PURE__ */ $(En, { disabled: !0, children: /* @__PURE__ */
|
|
3200
|
+
onOpen: X,
|
|
3201
|
+
children: M ? /* @__PURE__ */ $(En, { disabled: !0, children: /* @__PURE__ */ Te(Se, { sx: { display: "flex", alignItems: "center", gap: 1, width: "100%" }, children: [
|
|
3202
3202
|
/* @__PURE__ */ $(_r, { size: 16 }),
|
|
3203
|
-
/* @__PURE__ */ $(
|
|
3204
|
-
] }) }) : k.length > 0 ? k.map((L) => /* @__PURE__ */ $(En, { value: L.value, children: L.label }, L.value)) : l && !M ? /* @__PURE__ */ $(En, { disabled: !0, children: /* @__PURE__ */ $(
|
|
3203
|
+
/* @__PURE__ */ $(ze, { variant: "body2", children: "Fetching data..." })
|
|
3204
|
+
] }) }) : k.length > 0 ? k.map((L) => /* @__PURE__ */ $(En, { value: L.value, children: L.label }, L.value)) : l && !M ? /* @__PURE__ */ $(En, { disabled: !0, children: /* @__PURE__ */ $(ze, { variant: "body2", color: "text.secondary", children: "No options available" }) }) : /* @__PURE__ */ $(En, { disabled: !0, children: /* @__PURE__ */ $(ze, { variant: "body2", color: "text.secondary", children: "Click to load options" }) })
|
|
3205
3205
|
}
|
|
3206
3206
|
),
|
|
3207
|
-
(o ||
|
|
3207
|
+
(o || Y) && /* @__PURE__ */ $(Hr, { children: (s == null ? void 0 : s.message) || (Y == null ? void 0 : Y.message) })
|
|
3208
3208
|
] })
|
|
3209
3209
|
}
|
|
3210
3210
|
);
|
|
@@ -3215,16 +3215,16 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3215
3215
|
name: e.name,
|
|
3216
3216
|
control: t,
|
|
3217
3217
|
defaultValue: b(),
|
|
3218
|
-
render: ({ field:
|
|
3218
|
+
render: ({ field: N }) => /* @__PURE__ */ Te(Se, { sx: { mt: 1, mb: 0 }, children: [
|
|
3219
3219
|
/* @__PURE__ */ $(
|
|
3220
3220
|
Sn,
|
|
3221
3221
|
{
|
|
3222
3222
|
control: /* @__PURE__ */ $(
|
|
3223
3223
|
_a,
|
|
3224
3224
|
{
|
|
3225
|
-
...
|
|
3225
|
+
...N,
|
|
3226
3226
|
id: e.id,
|
|
3227
|
-
checked:
|
|
3227
|
+
checked: N.value,
|
|
3228
3228
|
disabled: e.disabled
|
|
3229
3229
|
}
|
|
3230
3230
|
),
|
|
@@ -3242,12 +3242,12 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3242
3242
|
name: e.name,
|
|
3243
3243
|
control: t,
|
|
3244
3244
|
defaultValue: b(),
|
|
3245
|
-
render: ({ field:
|
|
3246
|
-
/* @__PURE__ */ $(
|
|
3245
|
+
render: ({ field: N }) => /* @__PURE__ */ Te(mi, { component: "fieldset", error: o, children: [
|
|
3246
|
+
/* @__PURE__ */ $(ze, { variant: "body2", component: "legend", sx: { mb: 1 }, children: m(e.label) }),
|
|
3247
3247
|
/* @__PURE__ */ $(
|
|
3248
3248
|
Ca,
|
|
3249
3249
|
{
|
|
3250
|
-
...
|
|
3250
|
+
...N,
|
|
3251
3251
|
row: !0,
|
|
3252
3252
|
children: e.options.map((L) => /* @__PURE__ */ $(
|
|
3253
3253
|
Sn,
|
|
@@ -3271,12 +3271,12 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3271
3271
|
name: e.name,
|
|
3272
3272
|
control: t,
|
|
3273
3273
|
defaultValue: b(),
|
|
3274
|
-
render: ({ field:
|
|
3275
|
-
/* @__PURE__ */ $(
|
|
3274
|
+
render: ({ field: N }) => /* @__PURE__ */ Te(mi, { component: "fieldset", error: o, children: [
|
|
3275
|
+
/* @__PURE__ */ $(ze, { variant: "body2", component: "legend", sx: { mb: 1 }, children: m(e.label) }),
|
|
3276
3276
|
/* @__PURE__ */ $(
|
|
3277
3277
|
Ca,
|
|
3278
3278
|
{
|
|
3279
|
-
...
|
|
3279
|
+
...N,
|
|
3280
3280
|
children: e.options.map((L) => /* @__PURE__ */ $(
|
|
3281
3281
|
Sn,
|
|
3282
3282
|
{
|
|
@@ -3299,16 +3299,16 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3299
3299
|
name: e.name,
|
|
3300
3300
|
control: t,
|
|
3301
3301
|
defaultValue: b(),
|
|
3302
|
-
render: ({ field:
|
|
3302
|
+
render: ({ field: N }) => /* @__PURE__ */ Te(Se, { sx: { mt: 1, mb: 0 }, children: [
|
|
3303
3303
|
/* @__PURE__ */ $(
|
|
3304
3304
|
Sn,
|
|
3305
3305
|
{
|
|
3306
3306
|
control: /* @__PURE__ */ $(
|
|
3307
3307
|
Fl,
|
|
3308
3308
|
{
|
|
3309
|
-
...
|
|
3309
|
+
...N,
|
|
3310
3310
|
id: e.id,
|
|
3311
|
-
checked:
|
|
3311
|
+
checked: N.value,
|
|
3312
3312
|
disabled: e.disabled
|
|
3313
3313
|
}
|
|
3314
3314
|
),
|
|
@@ -3327,37 +3327,37 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3327
3327
|
name: e.name,
|
|
3328
3328
|
control: t,
|
|
3329
3329
|
defaultValue: b(),
|
|
3330
|
-
render: ({ field:
|
|
3331
|
-
const L =
|
|
3332
|
-
if (
|
|
3333
|
-
if (typeof
|
|
3334
|
-
if (typeof
|
|
3335
|
-
if (
|
|
3336
|
-
if (
|
|
3337
|
-
if (
|
|
3330
|
+
render: ({ field: N }) => {
|
|
3331
|
+
const L = N.value, oe = e.multiple === !0, ce = (h == null ? void 0 : h.valueField) || e.value_field || "value", ue = (h == null ? void 0 : h.labelField) || e.label_field || "label", j = (q) => {
|
|
3332
|
+
if (q != null) {
|
|
3333
|
+
if (typeof q == "string" || typeof q == "number") return q;
|
|
3334
|
+
if (typeof q == "object") {
|
|
3335
|
+
if (q[ce] !== void 0) return q[ce];
|
|
3336
|
+
if (q.value !== void 0) return q.value;
|
|
3337
|
+
if (q.id !== void 0) return q.id;
|
|
3338
3338
|
}
|
|
3339
3339
|
}
|
|
3340
|
-
},
|
|
3341
|
-
if (
|
|
3342
|
-
return (Array.isArray(L) ? L : []).map((
|
|
3343
|
-
const
|
|
3340
|
+
}, H = (() => {
|
|
3341
|
+
if (oe)
|
|
3342
|
+
return (Array.isArray(L) ? L : []).map((W) => {
|
|
3343
|
+
const Z = P.find((ne) => {
|
|
3344
3344
|
const re = j(ne);
|
|
3345
|
-
return re !== void 0 && re ===
|
|
3345
|
+
return re !== void 0 && re === W;
|
|
3346
3346
|
});
|
|
3347
|
-
return
|
|
3348
|
-
[ce]:
|
|
3349
|
-
[ue]: `Selected: ${
|
|
3350
|
-
value:
|
|
3351
|
-
label: `Selected: ${
|
|
3347
|
+
return Z || {
|
|
3348
|
+
[ce]: W,
|
|
3349
|
+
[ue]: `Selected: ${W}`,
|
|
3350
|
+
value: W,
|
|
3351
|
+
label: `Selected: ${W}`
|
|
3352
3352
|
};
|
|
3353
3353
|
});
|
|
3354
3354
|
{
|
|
3355
3355
|
if (L == null || L === "") return null;
|
|
3356
|
-
const
|
|
3357
|
-
const
|
|
3358
|
-
return
|
|
3356
|
+
const q = P.find((W) => {
|
|
3357
|
+
const Z = j(W);
|
|
3358
|
+
return Z !== void 0 && Z === L;
|
|
3359
3359
|
});
|
|
3360
|
-
return
|
|
3360
|
+
return q || {
|
|
3361
3361
|
[ce]: L,
|
|
3362
3362
|
[ue]: `Selected: ${L}`,
|
|
3363
3363
|
value: L,
|
|
@@ -3368,67 +3368,67 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3368
3368
|
return /* @__PURE__ */ $(
|
|
3369
3369
|
Al,
|
|
3370
3370
|
{
|
|
3371
|
-
...
|
|
3371
|
+
...N,
|
|
3372
3372
|
id: e.id,
|
|
3373
3373
|
options: P,
|
|
3374
|
-
value:
|
|
3375
|
-
getOptionLabel: (
|
|
3376
|
-
isOptionEqualToValue: (
|
|
3377
|
-
const
|
|
3378
|
-
return
|
|
3374
|
+
value: H,
|
|
3375
|
+
getOptionLabel: (q) => typeof q == "string" ? q : q[ue] || q.label || q.name || "",
|
|
3376
|
+
isOptionEqualToValue: (q, W) => {
|
|
3377
|
+
const Z = j(q), ne = j(W);
|
|
3378
|
+
return Z === void 0 || ne === void 0 ? !1 : Z === ne;
|
|
3379
3379
|
},
|
|
3380
3380
|
multiple: e.multiple,
|
|
3381
|
-
disableCloseOnSelect:
|
|
3381
|
+
disableCloseOnSelect: oe,
|
|
3382
3382
|
freeSolo: e.freeSolo,
|
|
3383
3383
|
filterOptions: e.filterOptions === !1 ? () => P : void 0,
|
|
3384
3384
|
disabled: z,
|
|
3385
3385
|
loading: M,
|
|
3386
|
-
onOpen:
|
|
3387
|
-
renderOption: (
|
|
3388
|
-
const ne = typeof
|
|
3389
|
-
return /* @__PURE__ */
|
|
3390
|
-
|
|
3386
|
+
onOpen: K,
|
|
3387
|
+
renderOption: (q, W, { selected: Z }) => {
|
|
3388
|
+
const ne = typeof W == "string" ? W : W[ue] || W.label || W.name || "";
|
|
3389
|
+
return /* @__PURE__ */ Te("li", { ...q, children: [
|
|
3390
|
+
oe && /* @__PURE__ */ $(
|
|
3391
3391
|
_a,
|
|
3392
3392
|
{
|
|
3393
3393
|
style: { marginRight: 8 },
|
|
3394
|
-
checked:
|
|
3394
|
+
checked: Z
|
|
3395
3395
|
}
|
|
3396
3396
|
),
|
|
3397
3397
|
ne
|
|
3398
3398
|
] });
|
|
3399
3399
|
},
|
|
3400
|
-
renderTags:
|
|
3401
|
-
const ne =
|
|
3402
|
-
const
|
|
3403
|
-
return /* @__PURE__ */ io(zn, { ...
|
|
3404
|
-
}), re =
|
|
3400
|
+
renderTags: oe ? (q, W) => {
|
|
3401
|
+
const ne = q.slice(0, 2).map((ee, R) => {
|
|
3402
|
+
const G = typeof ee == "string" ? ee : ee[ue] || ee.label || ee.name || "", V = W({ index: R });
|
|
3403
|
+
return /* @__PURE__ */ io(zn, { ...V, key: R, label: G, size: "small" });
|
|
3404
|
+
}), re = q.length - 2;
|
|
3405
3405
|
return re > 0 && ne.push(/* @__PURE__ */ $(zn, { label: `+${re} more`, size: "small" }, "more")), ne;
|
|
3406
3406
|
} : void 0,
|
|
3407
|
-
renderInput: (
|
|
3407
|
+
renderInput: (q) => /* @__PURE__ */ $(
|
|
3408
3408
|
wn,
|
|
3409
3409
|
{
|
|
3410
|
-
...
|
|
3410
|
+
...q,
|
|
3411
3411
|
label: m(e.label),
|
|
3412
3412
|
placeholder: z && (h != null && h.dependsOn) && !x ? `Please select ${h.dependsOn.replace(/_/g, " ")} first` : e.placeholder,
|
|
3413
|
-
error: o || !!
|
|
3414
|
-
helperText: (s == null ? void 0 : s.message) || (
|
|
3413
|
+
error: o || !!Y,
|
|
3414
|
+
helperText: (s == null ? void 0 : s.message) || (Y == null ? void 0 : Y.message) || "",
|
|
3415
3415
|
InputProps: {
|
|
3416
|
-
...
|
|
3417
|
-
endAdornment: /* @__PURE__ */
|
|
3416
|
+
...q.InputProps,
|
|
3417
|
+
endAdornment: /* @__PURE__ */ Te(kl, { children: [
|
|
3418
3418
|
M ? /* @__PURE__ */ $(_r, { color: "inherit", size: 20 }) : null,
|
|
3419
|
-
|
|
3419
|
+
q.InputProps.endAdornment
|
|
3420
3420
|
] })
|
|
3421
3421
|
}
|
|
3422
3422
|
}
|
|
3423
3423
|
),
|
|
3424
|
-
onChange: (
|
|
3425
|
-
const
|
|
3426
|
-
if (
|
|
3427
|
-
const re = (Array.isArray(
|
|
3428
|
-
|
|
3424
|
+
onChange: (q, W) => {
|
|
3425
|
+
const Z = (h == null ? void 0 : h.valueField) || e.value_field || "value";
|
|
3426
|
+
if (oe) {
|
|
3427
|
+
const re = (Array.isArray(W) ? W : []).map((ee) => typeof ee == "object" && (ee[Z] || ee.value || ee.id) || ee);
|
|
3428
|
+
N.onChange(re);
|
|
3429
3429
|
} else {
|
|
3430
3430
|
let ne;
|
|
3431
|
-
|
|
3431
|
+
W && typeof W == "object" ? ne = W[Z] || W.value || W.id || W : ne = W, N.onChange(ne);
|
|
3432
3432
|
}
|
|
3433
3433
|
},
|
|
3434
3434
|
noOptionsText: z && (h != null && h.dependsOn) && !x ? `Please select ${h.dependsOn.replace(/_/g, " ")} first` : M ? "Fetching data..." : l && !M && P.length === 0 ? "No options available" : "Click to load options"
|
|
@@ -3444,10 +3444,10 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3444
3444
|
name: e.name,
|
|
3445
3445
|
control: t,
|
|
3446
3446
|
defaultValue: b(),
|
|
3447
|
-
render: ({ field:
|
|
3447
|
+
render: ({ field: N }) => /* @__PURE__ */ $(
|
|
3448
3448
|
wn,
|
|
3449
3449
|
{
|
|
3450
|
-
...
|
|
3450
|
+
...N,
|
|
3451
3451
|
id: e.name,
|
|
3452
3452
|
fullWidth: !0,
|
|
3453
3453
|
label: m(e.label),
|
|
@@ -3473,10 +3473,10 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3473
3473
|
name: e.name,
|
|
3474
3474
|
control: t,
|
|
3475
3475
|
defaultValue: b(),
|
|
3476
|
-
render: ({ field:
|
|
3476
|
+
render: ({ field: N }) => /* @__PURE__ */ $(
|
|
3477
3477
|
Hc,
|
|
3478
3478
|
{
|
|
3479
|
-
src:
|
|
3479
|
+
src: N.value || e.defaultValue || e.src,
|
|
3480
3480
|
alt: e.alt || e.label,
|
|
3481
3481
|
width: e.width,
|
|
3482
3482
|
height: e.height,
|
|
@@ -3517,19 +3517,19 @@ function Yc() {
|
|
|
3517
3517
|
setter: function(y) {
|
|
3518
3518
|
var O = d(y);
|
|
3519
3519
|
return l.get(y) || l.set(y, function(C, w) {
|
|
3520
|
-
for (var M = 0,
|
|
3521
|
-
var
|
|
3522
|
-
if (
|
|
3520
|
+
for (var M = 0, Y = O.length, X = C; M < Y - 1; ) {
|
|
3521
|
+
var K = O[M];
|
|
3522
|
+
if (K === "__proto__" || K === "constructor" || K === "prototype")
|
|
3523
3523
|
return C;
|
|
3524
|
-
|
|
3524
|
+
X = X[O[M++]];
|
|
3525
3525
|
}
|
|
3526
|
-
|
|
3526
|
+
X[O[M]] = w;
|
|
3527
3527
|
});
|
|
3528
3528
|
},
|
|
3529
3529
|
getter: function(y, O) {
|
|
3530
3530
|
var F = d(y);
|
|
3531
3531
|
return p.get(y) || p.set(y, function(w) {
|
|
3532
|
-
for (var M = 0,
|
|
3532
|
+
for (var M = 0, Y = F.length; M < Y; )
|
|
3533
3533
|
if (w != null || !O) w = w[F[M++]];
|
|
3534
3534
|
else return;
|
|
3535
3535
|
return w;
|
|
@@ -3556,9 +3556,9 @@ function Yc() {
|
|
|
3556
3556
|
return y.match(t) || [""];
|
|
3557
3557
|
}
|
|
3558
3558
|
function m(y, O, F) {
|
|
3559
|
-
var C = y.length, w, M,
|
|
3559
|
+
var C = y.length, w, M, Y, X;
|
|
3560
3560
|
for (M = 0; M < C; M++)
|
|
3561
|
-
w = y[M], w && (x(w) && (w = '"' + w + '"'),
|
|
3561
|
+
w = y[M], w && (x(w) && (w = '"' + w + '"'), X = b(w), Y = !X && /^\d+$/.test(w), O.call(F, w, X, Y, M, y));
|
|
3562
3562
|
}
|
|
3563
3563
|
function b(y) {
|
|
3564
3564
|
return typeof y == "string" && y && ["'", '"'].indexOf(y.charAt(0)) !== -1;
|
|
@@ -3916,24 +3916,24 @@ function br(e) {
|
|
|
3916
3916
|
};
|
|
3917
3917
|
const M = (D) => {
|
|
3918
3918
|
Ge.isError(D) ? C(D) : D ? l(null) : C(F());
|
|
3919
|
-
},
|
|
3919
|
+
}, Y = (D) => {
|
|
3920
3920
|
Ge.isError(D) ? C(D) : o(D);
|
|
3921
3921
|
};
|
|
3922
3922
|
if (b && ut(r))
|
|
3923
3923
|
return M(!0);
|
|
3924
|
-
let
|
|
3924
|
+
let K;
|
|
3925
3925
|
try {
|
|
3926
3926
|
var u;
|
|
3927
|
-
if (
|
|
3927
|
+
if (K = d.call(w, r, w), typeof ((u = K) == null ? void 0 : u.then) == "function") {
|
|
3928
3928
|
if (i.sync)
|
|
3929
3929
|
throw new Error(`Validation test of type: "${w.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);
|
|
3930
|
-
return Promise.resolve(
|
|
3930
|
+
return Promise.resolve(K).then(M, Y);
|
|
3931
3931
|
}
|
|
3932
3932
|
} catch (D) {
|
|
3933
|
-
|
|
3933
|
+
Y(D);
|
|
3934
3934
|
return;
|
|
3935
3935
|
}
|
|
3936
|
-
M(
|
|
3936
|
+
M(K);
|
|
3937
3937
|
}
|
|
3938
3938
|
return t.OPTIONS = e, t;
|
|
3939
3939
|
}
|
|
@@ -5286,7 +5286,7 @@ const Au = (e) => {
|
|
|
5286
5286
|
opacity: 0.7
|
|
5287
5287
|
} : {}
|
|
5288
5288
|
},
|
|
5289
|
-
children: i && /* @__PURE__ */ $(
|
|
5289
|
+
children: i && /* @__PURE__ */ $(ze, { variant: "body2", component: "span", children: p(d) })
|
|
5290
5290
|
}
|
|
5291
5291
|
) }, d)) }) });
|
|
5292
5292
|
}, $u = ({
|
|
@@ -5297,7 +5297,7 @@ const Au = (e) => {
|
|
|
5297
5297
|
o.onClick && o.onClick();
|
|
5298
5298
|
}, n = e.filter((o) => o.position === "left" || !o.position), i = e.filter((o) => o.position === "center"), a = e.filter((o) => o.position === "right"), s = (o, l) => {
|
|
5299
5299
|
const p = (o.text || "").toLowerCase(), d = o.type === "submit" || p.includes("submit") || p.includes("save") || p.includes("next"), f = o.position === "left" || p.includes("cancel") || p.includes("back") || p.includes("draft"), m = o.type ? o.type : d ? "submit" : "button", b = f ? "outlined" : "contained", h = o.disabled || t;
|
|
5300
|
-
return /* @__PURE__ */
|
|
5300
|
+
return /* @__PURE__ */ Te(
|
|
5301
5301
|
Bt,
|
|
5302
5302
|
{
|
|
5303
5303
|
type: m,
|
|
@@ -5315,7 +5315,7 @@ const Au = (e) => {
|
|
|
5315
5315
|
`${o.text}-${l}`
|
|
5316
5316
|
);
|
|
5317
5317
|
};
|
|
5318
|
-
return /* @__PURE__ */
|
|
5318
|
+
return /* @__PURE__ */ Te(Se, { sx: { mt: 3, display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
5319
5319
|
/* @__PURE__ */ $(Se, { sx: { display: "flex", gap: 2 }, children: n.map((o, l) => s(o, l)) }),
|
|
5320
5320
|
/* @__PURE__ */ $(Se, { sx: { display: "flex", gap: 2 }, children: i.map((o, l) => s(o, l)) }),
|
|
5321
5321
|
/* @__PURE__ */ $(Se, { sx: { display: "flex", gap: 2 }, children: a.map((o, l) => s(o, l)) })
|
|
@@ -5401,41 +5401,41 @@ const Au = (e) => {
|
|
|
5401
5401
|
baseUrl: f,
|
|
5402
5402
|
apiHeaders: m
|
|
5403
5403
|
}) => {
|
|
5404
|
-
var re,
|
|
5405
|
-
const b = [...new Set(r.map((R) => R.step).filter((R) => R != null && R > 0))].sort((R,
|
|
5404
|
+
var re, ee;
|
|
5405
|
+
const b = [...new Set(r.map((R) => R.step).filter((R) => R != null && R > 0))].sort((R, G) => (R || 0) - (G || 0)), h = b.length > 1, c = b.length || 1, [x, y] = Xt(1), O = h ? r.filter((R) => R.step === x) : r, F = Ve(() => Au(O), [O]), {
|
|
5406
5406
|
control: C,
|
|
5407
5407
|
handleSubmit: w,
|
|
5408
5408
|
formState: { errors: M },
|
|
5409
|
-
watch:
|
|
5410
|
-
resetField:
|
|
5411
|
-
trigger:
|
|
5409
|
+
watch: Y,
|
|
5410
|
+
resetField: X,
|
|
5411
|
+
trigger: K
|
|
5412
5412
|
} = oc({
|
|
5413
5413
|
resolver: uc(F),
|
|
5414
5414
|
mode: "onChange",
|
|
5415
5415
|
defaultValues: o
|
|
5416
|
-
}), u =
|
|
5416
|
+
}), u = Y(), D = xt({});
|
|
5417
5417
|
wt(() => {
|
|
5418
5418
|
const R = [];
|
|
5419
|
-
for (const
|
|
5420
|
-
const
|
|
5421
|
-
|
|
5419
|
+
for (const G of r) {
|
|
5420
|
+
const V = G.depends_on;
|
|
5421
|
+
V && typeof G.name == "string" && R.push({ dependentField: G.name, dependencyName: V });
|
|
5422
5422
|
}
|
|
5423
5423
|
if (R.length !== 0)
|
|
5424
|
-
for (const { dependentField:
|
|
5425
|
-
const
|
|
5426
|
-
if (
|
|
5424
|
+
for (const { dependentField: G, dependencyName: V } of R) {
|
|
5425
|
+
const ie = D.current[V], I = u == null ? void 0 : u[V];
|
|
5426
|
+
if (ie !== I)
|
|
5427
5427
|
try {
|
|
5428
|
-
|
|
5428
|
+
X(G);
|
|
5429
5429
|
} catch {
|
|
5430
5430
|
}
|
|
5431
|
-
D.current[
|
|
5431
|
+
D.current[V] = I;
|
|
5432
5432
|
}
|
|
5433
|
-
}, [r, u,
|
|
5433
|
+
}, [r, u, X]);
|
|
5434
5434
|
const k = xt(i);
|
|
5435
5435
|
wt(() => {
|
|
5436
5436
|
k.current = i;
|
|
5437
5437
|
}, [i]);
|
|
5438
|
-
const P =
|
|
5438
|
+
const P = Ve(() => {
|
|
5439
5439
|
try {
|
|
5440
5440
|
return JSON.stringify(u);
|
|
5441
5441
|
} catch {
|
|
@@ -5445,44 +5445,44 @@ const Au = (e) => {
|
|
|
5445
5445
|
wt(() => {
|
|
5446
5446
|
k.current && z.current !== P && (z.current = P, k.current(u));
|
|
5447
5447
|
}, [P]);
|
|
5448
|
-
const
|
|
5448
|
+
const N = async () => {
|
|
5449
5449
|
if (!h) return !0;
|
|
5450
|
-
const R = r.filter((
|
|
5451
|
-
for (const
|
|
5452
|
-
if (
|
|
5453
|
-
const
|
|
5450
|
+
const R = r.filter((V) => V.step === x);
|
|
5451
|
+
for (const V of R)
|
|
5452
|
+
if (V.required) {
|
|
5453
|
+
const ie = u[V.name];
|
|
5454
5454
|
let I = !0;
|
|
5455
|
-
if (
|
|
5455
|
+
if (V.type === "checkbox" ? I = ie === !0 : Array.isArray(ie) ? I = ie.length > 0 : I = ie != null && ie !== "", !I)
|
|
5456
5456
|
return !1;
|
|
5457
5457
|
}
|
|
5458
|
-
return await
|
|
5459
|
-
const I = M[
|
|
5460
|
-
return typeof (I == null ? void 0 : I.message) == "string" ? I.message : `${
|
|
5458
|
+
return await K() ? !0 : Object.keys(M).filter((ie) => R.some((I) => I.name === ie)).map((ie) => {
|
|
5459
|
+
const I = M[ie];
|
|
5460
|
+
return typeof (I == null ? void 0 : I.message) == "string" ? I.message : `${ie} is invalid`;
|
|
5461
5461
|
}).length === 0;
|
|
5462
|
-
}, L =
|
|
5462
|
+
}, L = Ve(() => {
|
|
5463
5463
|
if (!h) return !0;
|
|
5464
|
-
const R = r.filter((
|
|
5465
|
-
for (const
|
|
5466
|
-
if (
|
|
5467
|
-
const
|
|
5464
|
+
const R = r.filter((V) => V.step === x);
|
|
5465
|
+
for (const V of R)
|
|
5466
|
+
if (V.required) {
|
|
5467
|
+
const ie = u[V.name];
|
|
5468
5468
|
let I = !0;
|
|
5469
|
-
if (
|
|
5469
|
+
if (V.type === "checkbox" ? I = ie === !0 : Array.isArray(ie) ? I = ie.length > 0 : I = ie != null && ie !== "", !I)
|
|
5470
5470
|
return !1;
|
|
5471
5471
|
}
|
|
5472
|
-
return Object.keys(M).filter((
|
|
5473
|
-
}, [h, x, r, u, M]),
|
|
5472
|
+
return Object.keys(M).filter((V) => R.some((ie) => ie.name === V)).length === 0;
|
|
5473
|
+
}, [h, x, r, u, M]), oe = Ve(() => {
|
|
5474
5474
|
if (h)
|
|
5475
5475
|
return L;
|
|
5476
5476
|
for (const R of r)
|
|
5477
5477
|
if (R.required) {
|
|
5478
|
-
const
|
|
5479
|
-
let
|
|
5480
|
-
if (R.type === "checkbox" ?
|
|
5478
|
+
const G = u[R.name];
|
|
5479
|
+
let V = !0;
|
|
5480
|
+
if (R.type === "checkbox" ? V = G === !0 : V = G != null && G !== "" && !(Array.isArray(G) && G.length === 0), !V)
|
|
5481
5481
|
return !1;
|
|
5482
5482
|
}
|
|
5483
5483
|
return Object.keys(M).length === 0;
|
|
5484
5484
|
}, [h, L, r, u, M]), ce = async (R) => {
|
|
5485
|
-
R < 1 || R > c || R > x && h && !await
|
|
5485
|
+
R < 1 || R > c || R > x && h && !await N() || y(R);
|
|
5486
5486
|
}, ue = async (R) => {
|
|
5487
5487
|
if (h && x < c) {
|
|
5488
5488
|
console.warn("Form submission attempted on non-final step");
|
|
@@ -5490,10 +5490,10 @@ const Au = (e) => {
|
|
|
5490
5490
|
}
|
|
5491
5491
|
s && s(R), n(R);
|
|
5492
5492
|
}, j = async (R) => {
|
|
5493
|
-
R && (R.preventDefault(), R.stopPropagation()), h && x < c && await
|
|
5494
|
-
},
|
|
5493
|
+
R && (R.preventDefault(), R.stopPropagation()), h && x < c && await N() && ce(x + 1);
|
|
5494
|
+
}, H = (R) => {
|
|
5495
5495
|
R && (R.preventDefault(), R.stopPropagation()), h && x > 1 && ce(x - 1);
|
|
5496
|
-
},
|
|
5496
|
+
}, q = (R) => R.col ? R.col : (R.xs || R.sm || R.md || R.lg || R.xl) && (R.xs || R.sm || R.md || R.lg || R.xl) || 12, W = t ? Ml({
|
|
5497
5497
|
palette: {
|
|
5498
5498
|
primary: {
|
|
5499
5499
|
main: t.primaryColor || "#1976d2"
|
|
@@ -5514,73 +5514,97 @@ const Au = (e) => {
|
|
|
5514
5514
|
spacing: t.spacing || 8,
|
|
5515
5515
|
typography: {
|
|
5516
5516
|
fontFamily: ((re = t.typography) == null ? void 0 : re.fontFamily) || "Roboto, Arial, sans-serif",
|
|
5517
|
-
fontSize: typeof ((
|
|
5518
|
-
}
|
|
5519
|
-
}) : void 0,
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
$u,
|
|
5532
|
-
{
|
|
5533
|
-
buttons: p
|
|
5534
|
-
}
|
|
5535
|
-
) : l ? /* @__PURE__ */ $(Se, { sx: { mt: 3, display: "flex", justifyContent: "flex-end", flexDirection: "column", alignItems: "flex-end" }, children: /* @__PURE__ */ Oe(Se, { sx: { display: "flex", gap: 2 }, children: [
|
|
5536
|
-
h && x > 1 && /* @__PURE__ */ $(
|
|
5537
|
-
Bt,
|
|
5538
|
-
{
|
|
5539
|
-
type: "button",
|
|
5540
|
-
variant: "outlined",
|
|
5541
|
-
onClick: W,
|
|
5542
|
-
children: "Previous"
|
|
5543
|
-
}
|
|
5544
|
-
),
|
|
5545
|
-
h ? (
|
|
5546
|
-
// Multi-step form: Show Next for non-final steps, Submit for final step
|
|
5547
|
-
x < c ? /* @__PURE__ */ $(
|
|
5548
|
-
Bt,
|
|
5517
|
+
fontSize: typeof ((ee = t.typography) == null ? void 0 : ee.fontSize) == "number" ? t.typography.fontSize : 14
|
|
5518
|
+
}
|
|
5519
|
+
}) : void 0, Z = () => {
|
|
5520
|
+
if (d && d.buttons && d.buttons.length > 0) {
|
|
5521
|
+
const R = {
|
|
5522
|
+
...d,
|
|
5523
|
+
buttons: d.buttons.map((G) => {
|
|
5524
|
+
const V = (G.text || "").toLowerCase(), ie = G.type === "submit" || V.includes("submit") || V.includes("save") || V.includes("finish") || V.includes("complete"), I = V.includes("next");
|
|
5525
|
+
let ke = !1;
|
|
5526
|
+
return h ? (ie || I) && (ke = !L) : ie && (ke = !oe), { ...G, disabled: G.disabled || ke };
|
|
5527
|
+
})
|
|
5528
|
+
};
|
|
5529
|
+
return /* @__PURE__ */ $(Se, { sx: { mt: 3 }, children: /* @__PURE__ */ $(
|
|
5530
|
+
Du,
|
|
5549
5531
|
{
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5532
|
+
config: R,
|
|
5533
|
+
onSubmit: ue,
|
|
5534
|
+
onStepChange: ce,
|
|
5535
|
+
currentStep: x,
|
|
5536
|
+
totalSteps: c,
|
|
5537
|
+
isMultiStep: h,
|
|
5538
|
+
formData: u
|
|
5557
5539
|
}
|
|
5558
|
-
)
|
|
5559
|
-
|
|
5540
|
+
) });
|
|
5541
|
+
}
|
|
5542
|
+
if (p && p.length > 0) {
|
|
5543
|
+
const R = p.map((G) => {
|
|
5544
|
+
const V = (G.text || "").toLowerCase(), ie = G.type === "submit" || V.includes("submit") || V.includes("save") || V.includes("finish") || V.includes("complete"), I = V.includes("next");
|
|
5545
|
+
let ke = !1;
|
|
5546
|
+
return h ? (ie || I) && (ke = !L) : ie && (ke = !oe), {
|
|
5547
|
+
...G,
|
|
5548
|
+
disabled: G.disabled || ke
|
|
5549
|
+
};
|
|
5550
|
+
});
|
|
5551
|
+
return /* @__PURE__ */ $(
|
|
5552
|
+
$u,
|
|
5560
5553
|
{
|
|
5561
|
-
|
|
5562
|
-
variant: "contained",
|
|
5563
|
-
color: "primary",
|
|
5564
|
-
size: "large",
|
|
5565
|
-
disabled: !L,
|
|
5566
|
-
children: a
|
|
5554
|
+
buttons: R
|
|
5567
5555
|
}
|
|
5568
|
-
)
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
/* @__PURE__ */ $(
|
|
5556
|
+
);
|
|
5557
|
+
}
|
|
5558
|
+
return l ? /* @__PURE__ */ $(Se, { sx: { mt: 3, display: "flex", justifyContent: "flex-end", flexDirection: "column", alignItems: "flex-end" }, children: /* @__PURE__ */ Te(Se, { sx: { display: "flex", gap: 2 }, children: [
|
|
5559
|
+
h && x > 1 && /* @__PURE__ */ $(
|
|
5572
5560
|
Bt,
|
|
5573
5561
|
{
|
|
5574
|
-
type: "
|
|
5575
|
-
variant: "
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
disabled: !se,
|
|
5579
|
-
children: a
|
|
5562
|
+
type: "button",
|
|
5563
|
+
variant: "outlined",
|
|
5564
|
+
onClick: H,
|
|
5565
|
+
children: "Previous"
|
|
5580
5566
|
}
|
|
5567
|
+
),
|
|
5568
|
+
h ? (
|
|
5569
|
+
// Multi-step form: Show Next for non-final steps, Submit for final step
|
|
5570
|
+
x < c ? /* @__PURE__ */ $(
|
|
5571
|
+
Bt,
|
|
5572
|
+
{
|
|
5573
|
+
type: "button",
|
|
5574
|
+
variant: "contained",
|
|
5575
|
+
color: "primary",
|
|
5576
|
+
size: "large",
|
|
5577
|
+
disabled: !L,
|
|
5578
|
+
onClick: j,
|
|
5579
|
+
children: "Next"
|
|
5580
|
+
}
|
|
5581
|
+
) : /* @__PURE__ */ $(
|
|
5582
|
+
Bt,
|
|
5583
|
+
{
|
|
5584
|
+
type: "submit",
|
|
5585
|
+
variant: "contained",
|
|
5586
|
+
color: "primary",
|
|
5587
|
+
size: "large",
|
|
5588
|
+
disabled: !L,
|
|
5589
|
+
children: a
|
|
5590
|
+
}
|
|
5591
|
+
)
|
|
5592
|
+
) : (
|
|
5593
|
+
// Single-step form: Show Submit button (disabled if invalid)
|
|
5594
|
+
/* @__PURE__ */ $(
|
|
5595
|
+
Bt,
|
|
5596
|
+
{
|
|
5597
|
+
type: "submit",
|
|
5598
|
+
variant: "contained",
|
|
5599
|
+
color: "primary",
|
|
5600
|
+
size: "large",
|
|
5601
|
+
disabled: !oe,
|
|
5602
|
+
children: a
|
|
5603
|
+
}
|
|
5604
|
+
)
|
|
5581
5605
|
)
|
|
5582
|
-
)
|
|
5583
|
-
|
|
5606
|
+
] }) }) : null;
|
|
5607
|
+
}, ne = /* @__PURE__ */ Te(
|
|
5584
5608
|
Se,
|
|
5585
5609
|
{
|
|
5586
5610
|
component: "form",
|
|
@@ -5613,12 +5637,12 @@ const Au = (e) => {
|
|
|
5613
5637
|
gap: 2
|
|
5614
5638
|
},
|
|
5615
5639
|
children: O.map((R) => {
|
|
5616
|
-
const
|
|
5640
|
+
const G = q(R);
|
|
5617
5641
|
return /* @__PURE__ */ $(
|
|
5618
5642
|
Se,
|
|
5619
5643
|
{
|
|
5620
5644
|
sx: {
|
|
5621
|
-
gridColumn: `span ${
|
|
5645
|
+
gridColumn: `span ${G}`
|
|
5622
5646
|
},
|
|
5623
5647
|
children: /* @__PURE__ */ $(
|
|
5624
5648
|
Gc,
|
|
@@ -5637,11 +5661,11 @@ const Au = (e) => {
|
|
|
5637
5661
|
})
|
|
5638
5662
|
}
|
|
5639
5663
|
),
|
|
5640
|
-
|
|
5664
|
+
Z()
|
|
5641
5665
|
]
|
|
5642
5666
|
}
|
|
5643
5667
|
);
|
|
5644
|
-
return
|
|
5668
|
+
return W ? /* @__PURE__ */ $(zl, { theme: W, children: ne }) : ne;
|
|
5645
5669
|
}, ss = (e) => e, ju = () => {
|
|
5646
5670
|
let e = ss;
|
|
5647
5671
|
return {
|
|
@@ -5759,8 +5783,8 @@ function zu() {
|
|
|
5759
5783
|
}
|
|
5760
5784
|
function C(I) {
|
|
5761
5785
|
if (typeof I == "object" && I !== null) {
|
|
5762
|
-
var
|
|
5763
|
-
switch (
|
|
5786
|
+
var ke = I.$$typeof;
|
|
5787
|
+
switch (ke) {
|
|
5764
5788
|
case t:
|
|
5765
5789
|
var dt = I.type;
|
|
5766
5790
|
switch (dt) {
|
|
@@ -5781,31 +5805,31 @@ function zu() {
|
|
|
5781
5805
|
case s:
|
|
5782
5806
|
return At;
|
|
5783
5807
|
default:
|
|
5784
|
-
return
|
|
5808
|
+
return ke;
|
|
5785
5809
|
}
|
|
5786
5810
|
}
|
|
5787
5811
|
case r:
|
|
5788
|
-
return
|
|
5812
|
+
return ke;
|
|
5789
5813
|
}
|
|
5790
5814
|
}
|
|
5791
5815
|
}
|
|
5792
|
-
var w = l, M = p,
|
|
5816
|
+
var w = l, M = p, Y = o, X = s, K = t, u = d, D = n, k = h, P = b, z = r, N = a, L = i, oe = f, ce = !1;
|
|
5793
5817
|
function ue(I) {
|
|
5794
5818
|
return ce || (ce = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), j(I) || C(I) === l;
|
|
5795
5819
|
}
|
|
5796
5820
|
function j(I) {
|
|
5797
5821
|
return C(I) === p;
|
|
5798
5822
|
}
|
|
5799
|
-
function
|
|
5823
|
+
function H(I) {
|
|
5800
5824
|
return C(I) === o;
|
|
5801
5825
|
}
|
|
5802
|
-
function
|
|
5826
|
+
function q(I) {
|
|
5803
5827
|
return C(I) === s;
|
|
5804
5828
|
}
|
|
5805
|
-
function
|
|
5829
|
+
function W(I) {
|
|
5806
5830
|
return typeof I == "object" && I !== null && I.$$typeof === t;
|
|
5807
5831
|
}
|
|
5808
|
-
function
|
|
5832
|
+
function Z(I) {
|
|
5809
5833
|
return C(I) === d;
|
|
5810
5834
|
}
|
|
5811
5835
|
function ne(I) {
|
|
@@ -5814,22 +5838,22 @@ function zu() {
|
|
|
5814
5838
|
function re(I) {
|
|
5815
5839
|
return C(I) === h;
|
|
5816
5840
|
}
|
|
5817
|
-
function
|
|
5841
|
+
function ee(I) {
|
|
5818
5842
|
return C(I) === b;
|
|
5819
5843
|
}
|
|
5820
5844
|
function R(I) {
|
|
5821
5845
|
return C(I) === r;
|
|
5822
5846
|
}
|
|
5823
|
-
function
|
|
5847
|
+
function G(I) {
|
|
5824
5848
|
return C(I) === a;
|
|
5825
5849
|
}
|
|
5826
|
-
function
|
|
5850
|
+
function V(I) {
|
|
5827
5851
|
return C(I) === i;
|
|
5828
5852
|
}
|
|
5829
|
-
function
|
|
5853
|
+
function ie(I) {
|
|
5830
5854
|
return C(I) === f;
|
|
5831
5855
|
}
|
|
5832
|
-
me.AsyncMode = w, me.ConcurrentMode = M, me.ContextConsumer =
|
|
5856
|
+
me.AsyncMode = w, me.ConcurrentMode = M, me.ContextConsumer = Y, me.ContextProvider = X, me.Element = K, me.ForwardRef = u, me.Fragment = D, me.Lazy = k, me.Memo = P, me.Portal = z, me.Profiler = N, me.StrictMode = L, me.Suspense = oe, me.isAsyncMode = ue, me.isConcurrentMode = j, me.isContextConsumer = H, me.isContextProvider = q, me.isElement = W, me.isForwardRef = Z, me.isFragment = ne, me.isLazy = re, me.isMemo = ee, me.isPortal = R, me.isProfiler = G, me.isStrictMode = V, me.isSuspense = ie, me.isValidElementType = F, me.typeOf = C;
|
|
5833
5857
|
}()), me;
|
|
5834
5858
|
}
|
|
5835
5859
|
var cs;
|
|
@@ -5967,9 +5991,9 @@ function Lu() {
|
|
|
5967
5991
|
return ki = function(o, l) {
|
|
5968
5992
|
var p = typeof Symbol == "function" && Symbol.iterator, d = "@@iterator";
|
|
5969
5993
|
function f(j) {
|
|
5970
|
-
var
|
|
5971
|
-
if (typeof
|
|
5972
|
-
return
|
|
5994
|
+
var H = j && (p && j[p] || j[d]);
|
|
5995
|
+
if (typeof H == "function")
|
|
5996
|
+
return H;
|
|
5973
5997
|
}
|
|
5974
5998
|
var m = "<<anonymous>>", b = {
|
|
5975
5999
|
array: y("array"),
|
|
@@ -5986,215 +6010,215 @@ function Lu() {
|
|
|
5986
6010
|
elementType: w(),
|
|
5987
6011
|
instanceOf: M,
|
|
5988
6012
|
node: u(),
|
|
5989
|
-
objectOf:
|
|
5990
|
-
oneOf:
|
|
5991
|
-
oneOfType:
|
|
6013
|
+
objectOf: X,
|
|
6014
|
+
oneOf: Y,
|
|
6015
|
+
oneOfType: K,
|
|
5992
6016
|
shape: k,
|
|
5993
6017
|
exact: P
|
|
5994
6018
|
};
|
|
5995
|
-
function h(j,
|
|
5996
|
-
return j ===
|
|
6019
|
+
function h(j, H) {
|
|
6020
|
+
return j === H ? j !== 0 || 1 / j === 1 / H : j !== j && H !== H;
|
|
5997
6021
|
}
|
|
5998
|
-
function c(j,
|
|
5999
|
-
this.message = j, this.data =
|
|
6022
|
+
function c(j, H) {
|
|
6023
|
+
this.message = j, this.data = H && typeof H == "object" ? H : {}, this.stack = "";
|
|
6000
6024
|
}
|
|
6001
6025
|
c.prototype = Error.prototype;
|
|
6002
6026
|
function x(j) {
|
|
6003
6027
|
if (process.env.NODE_ENV !== "production")
|
|
6004
|
-
var
|
|
6005
|
-
function
|
|
6006
|
-
if (R = R || m,
|
|
6028
|
+
var H = {}, q = 0;
|
|
6029
|
+
function W(ne, re, ee, R, G, V, ie) {
|
|
6030
|
+
if (R = R || m, V = V || ee, ie !== r) {
|
|
6007
6031
|
if (l) {
|
|
6008
6032
|
var I = new Error(
|
|
6009
6033
|
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
6010
6034
|
);
|
|
6011
6035
|
throw I.name = "Invariant Violation", I;
|
|
6012
6036
|
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
6013
|
-
var
|
|
6014
|
-
!
|
|
6015
|
-
|
|
6016
|
-
"You are manually calling a React.PropTypes validation function for the `" +
|
|
6017
|
-
),
|
|
6037
|
+
var ke = R + ":" + ee;
|
|
6038
|
+
!H[ke] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
6039
|
+
q < 3 && (a(
|
|
6040
|
+
"You are manually calling a React.PropTypes validation function for the `" + V + "` prop on `" + R + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
6041
|
+
), H[ke] = !0, q++);
|
|
6018
6042
|
}
|
|
6019
6043
|
}
|
|
6020
|
-
return re[
|
|
6044
|
+
return re[ee] == null ? ne ? re[ee] === null ? new c("The " + G + " `" + V + "` is marked as required " + ("in `" + R + "`, but its value is `null`.")) : new c("The " + G + " `" + V + "` is marked as required in " + ("`" + R + "`, but its value is `undefined`.")) : null : j(re, ee, R, G, V);
|
|
6021
6045
|
}
|
|
6022
|
-
var
|
|
6023
|
-
return
|
|
6046
|
+
var Z = W.bind(null, !1);
|
|
6047
|
+
return Z.isRequired = W.bind(null, !0), Z;
|
|
6024
6048
|
}
|
|
6025
6049
|
function y(j) {
|
|
6026
|
-
function
|
|
6027
|
-
var R =
|
|
6028
|
-
if (
|
|
6029
|
-
var
|
|
6050
|
+
function H(q, W, Z, ne, re, ee) {
|
|
6051
|
+
var R = q[W], G = L(R);
|
|
6052
|
+
if (G !== j) {
|
|
6053
|
+
var V = oe(R);
|
|
6030
6054
|
return new c(
|
|
6031
|
-
"Invalid " + ne + " `" + re + "` of type " + ("`" +
|
|
6055
|
+
"Invalid " + ne + " `" + re + "` of type " + ("`" + V + "` supplied to `" + Z + "`, expected ") + ("`" + j + "`."),
|
|
6032
6056
|
{ expectedType: j }
|
|
6033
6057
|
);
|
|
6034
6058
|
}
|
|
6035
6059
|
return null;
|
|
6036
6060
|
}
|
|
6037
|
-
return x(
|
|
6061
|
+
return x(H);
|
|
6038
6062
|
}
|
|
6039
6063
|
function O() {
|
|
6040
6064
|
return x(s);
|
|
6041
6065
|
}
|
|
6042
6066
|
function F(j) {
|
|
6043
|
-
function
|
|
6067
|
+
function H(q, W, Z, ne, re) {
|
|
6044
6068
|
if (typeof j != "function")
|
|
6045
|
-
return new c("Property `" + re + "` of component `" +
|
|
6046
|
-
var
|
|
6047
|
-
if (!Array.isArray(
|
|
6048
|
-
var R = L(
|
|
6049
|
-
return new c("Invalid " + ne + " `" + re + "` of type " + ("`" + R + "` supplied to `" +
|
|
6069
|
+
return new c("Property `" + re + "` of component `" + Z + "` has invalid PropType notation inside arrayOf.");
|
|
6070
|
+
var ee = q[W];
|
|
6071
|
+
if (!Array.isArray(ee)) {
|
|
6072
|
+
var R = L(ee);
|
|
6073
|
+
return new c("Invalid " + ne + " `" + re + "` of type " + ("`" + R + "` supplied to `" + Z + "`, expected an array."));
|
|
6050
6074
|
}
|
|
6051
|
-
for (var
|
|
6052
|
-
var
|
|
6053
|
-
if (
|
|
6054
|
-
return
|
|
6075
|
+
for (var G = 0; G < ee.length; G++) {
|
|
6076
|
+
var V = j(ee, G, Z, ne, re + "[" + G + "]", r);
|
|
6077
|
+
if (V instanceof Error)
|
|
6078
|
+
return V;
|
|
6055
6079
|
}
|
|
6056
6080
|
return null;
|
|
6057
6081
|
}
|
|
6058
|
-
return x(
|
|
6082
|
+
return x(H);
|
|
6059
6083
|
}
|
|
6060
6084
|
function C() {
|
|
6061
|
-
function j(
|
|
6062
|
-
var re =
|
|
6085
|
+
function j(H, q, W, Z, ne) {
|
|
6086
|
+
var re = H[q];
|
|
6063
6087
|
if (!o(re)) {
|
|
6064
|
-
var
|
|
6065
|
-
return new c("Invalid " +
|
|
6088
|
+
var ee = L(re);
|
|
6089
|
+
return new c("Invalid " + Z + " `" + ne + "` of type " + ("`" + ee + "` supplied to `" + W + "`, expected a single ReactElement."));
|
|
6066
6090
|
}
|
|
6067
6091
|
return null;
|
|
6068
6092
|
}
|
|
6069
6093
|
return x(j);
|
|
6070
6094
|
}
|
|
6071
6095
|
function w() {
|
|
6072
|
-
function j(
|
|
6073
|
-
var re =
|
|
6096
|
+
function j(H, q, W, Z, ne) {
|
|
6097
|
+
var re = H[q];
|
|
6074
6098
|
if (!e.isValidElementType(re)) {
|
|
6075
|
-
var
|
|
6076
|
-
return new c("Invalid " +
|
|
6099
|
+
var ee = L(re);
|
|
6100
|
+
return new c("Invalid " + Z + " `" + ne + "` of type " + ("`" + ee + "` supplied to `" + W + "`, expected a single ReactElement type."));
|
|
6077
6101
|
}
|
|
6078
6102
|
return null;
|
|
6079
6103
|
}
|
|
6080
6104
|
return x(j);
|
|
6081
6105
|
}
|
|
6082
6106
|
function M(j) {
|
|
6083
|
-
function
|
|
6084
|
-
if (!(
|
|
6085
|
-
var
|
|
6086
|
-
return new c("Invalid " + ne + " `" + re + "` of type " + ("`" + R + "` supplied to `" +
|
|
6107
|
+
function H(q, W, Z, ne, re) {
|
|
6108
|
+
if (!(q[W] instanceof j)) {
|
|
6109
|
+
var ee = j.name || m, R = ue(q[W]);
|
|
6110
|
+
return new c("Invalid " + ne + " `" + re + "` of type " + ("`" + R + "` supplied to `" + Z + "`, expected ") + ("instance of `" + ee + "`."));
|
|
6087
6111
|
}
|
|
6088
6112
|
return null;
|
|
6089
6113
|
}
|
|
6090
|
-
return x(
|
|
6114
|
+
return x(H);
|
|
6091
6115
|
}
|
|
6092
|
-
function
|
|
6116
|
+
function Y(j) {
|
|
6093
6117
|
if (!Array.isArray(j))
|
|
6094
6118
|
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? a(
|
|
6095
6119
|
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
6096
6120
|
) : a("Invalid argument supplied to oneOf, expected an array.")), s;
|
|
6097
|
-
function
|
|
6098
|
-
for (var
|
|
6099
|
-
if (h(
|
|
6121
|
+
function H(q, W, Z, ne, re) {
|
|
6122
|
+
for (var ee = q[W], R = 0; R < j.length; R++)
|
|
6123
|
+
if (h(ee, j[R]))
|
|
6100
6124
|
return null;
|
|
6101
|
-
var
|
|
6102
|
-
var
|
|
6103
|
-
return
|
|
6125
|
+
var G = JSON.stringify(j, function(ie, I) {
|
|
6126
|
+
var ke = oe(I);
|
|
6127
|
+
return ke === "symbol" ? String(I) : I;
|
|
6104
6128
|
});
|
|
6105
|
-
return new c("Invalid " + ne + " `" + re + "` of value `" + String(
|
|
6129
|
+
return new c("Invalid " + ne + " `" + re + "` of value `" + String(ee) + "` " + ("supplied to `" + Z + "`, expected one of " + G + "."));
|
|
6106
6130
|
}
|
|
6107
|
-
return x(
|
|
6131
|
+
return x(H);
|
|
6108
6132
|
}
|
|
6109
|
-
function
|
|
6110
|
-
function
|
|
6133
|
+
function X(j) {
|
|
6134
|
+
function H(q, W, Z, ne, re) {
|
|
6111
6135
|
if (typeof j != "function")
|
|
6112
|
-
return new c("Property `" + re + "` of component `" +
|
|
6113
|
-
var
|
|
6136
|
+
return new c("Property `" + re + "` of component `" + Z + "` has invalid PropType notation inside objectOf.");
|
|
6137
|
+
var ee = q[W], R = L(ee);
|
|
6114
6138
|
if (R !== "object")
|
|
6115
|
-
return new c("Invalid " + ne + " `" + re + "` of type " + ("`" + R + "` supplied to `" +
|
|
6116
|
-
for (var
|
|
6117
|
-
if (n(
|
|
6118
|
-
var
|
|
6119
|
-
if (
|
|
6120
|
-
return
|
|
6139
|
+
return new c("Invalid " + ne + " `" + re + "` of type " + ("`" + R + "` supplied to `" + Z + "`, expected an object."));
|
|
6140
|
+
for (var G in ee)
|
|
6141
|
+
if (n(ee, G)) {
|
|
6142
|
+
var V = j(ee, G, Z, ne, re + "." + G, r);
|
|
6143
|
+
if (V instanceof Error)
|
|
6144
|
+
return V;
|
|
6121
6145
|
}
|
|
6122
6146
|
return null;
|
|
6123
6147
|
}
|
|
6124
|
-
return x(
|
|
6148
|
+
return x(H);
|
|
6125
6149
|
}
|
|
6126
|
-
function
|
|
6150
|
+
function K(j) {
|
|
6127
6151
|
if (!Array.isArray(j))
|
|
6128
6152
|
return process.env.NODE_ENV !== "production" && a("Invalid argument supplied to oneOfType, expected an instance of array."), s;
|
|
6129
|
-
for (var
|
|
6130
|
-
var
|
|
6131
|
-
if (typeof
|
|
6153
|
+
for (var H = 0; H < j.length; H++) {
|
|
6154
|
+
var q = j[H];
|
|
6155
|
+
if (typeof q != "function")
|
|
6132
6156
|
return a(
|
|
6133
|
-
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + ce(
|
|
6157
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + ce(q) + " at index " + H + "."
|
|
6134
6158
|
), s;
|
|
6135
6159
|
}
|
|
6136
|
-
function
|
|
6137
|
-
for (var
|
|
6138
|
-
var
|
|
6160
|
+
function W(Z, ne, re, ee, R) {
|
|
6161
|
+
for (var G = [], V = 0; V < j.length; V++) {
|
|
6162
|
+
var ie = j[V], I = ie(Z, ne, re, ee, R, r);
|
|
6139
6163
|
if (I == null)
|
|
6140
6164
|
return null;
|
|
6141
|
-
I.data && n(I.data, "expectedType") &&
|
|
6165
|
+
I.data && n(I.data, "expectedType") && G.push(I.data.expectedType);
|
|
6142
6166
|
}
|
|
6143
|
-
var
|
|
6144
|
-
return new c("Invalid " +
|
|
6167
|
+
var ke = G.length > 0 ? ", expected one of type [" + G.join(", ") + "]" : "";
|
|
6168
|
+
return new c("Invalid " + ee + " `" + R + "` supplied to " + ("`" + re + "`" + ke + "."));
|
|
6145
6169
|
}
|
|
6146
|
-
return x(
|
|
6170
|
+
return x(W);
|
|
6147
6171
|
}
|
|
6148
6172
|
function u() {
|
|
6149
|
-
function j(
|
|
6150
|
-
return z(
|
|
6173
|
+
function j(H, q, W, Z, ne) {
|
|
6174
|
+
return z(H[q]) ? null : new c("Invalid " + Z + " `" + ne + "` supplied to " + ("`" + W + "`, expected a ReactNode."));
|
|
6151
6175
|
}
|
|
6152
6176
|
return x(j);
|
|
6153
6177
|
}
|
|
6154
|
-
function D(j,
|
|
6178
|
+
function D(j, H, q, W, Z) {
|
|
6155
6179
|
return new c(
|
|
6156
|
-
(j || "React class") + ": " +
|
|
6180
|
+
(j || "React class") + ": " + H + " type `" + q + "." + W + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + Z + "`."
|
|
6157
6181
|
);
|
|
6158
6182
|
}
|
|
6159
6183
|
function k(j) {
|
|
6160
|
-
function
|
|
6161
|
-
var
|
|
6184
|
+
function H(q, W, Z, ne, re) {
|
|
6185
|
+
var ee = q[W], R = L(ee);
|
|
6162
6186
|
if (R !== "object")
|
|
6163
|
-
return new c("Invalid " + ne + " `" + re + "` of type `" + R + "` " + ("supplied to `" +
|
|
6164
|
-
for (var
|
|
6165
|
-
var
|
|
6166
|
-
if (typeof
|
|
6167
|
-
return D(
|
|
6168
|
-
var
|
|
6169
|
-
if (
|
|
6170
|
-
return
|
|
6187
|
+
return new c("Invalid " + ne + " `" + re + "` of type `" + R + "` " + ("supplied to `" + Z + "`, expected `object`."));
|
|
6188
|
+
for (var G in j) {
|
|
6189
|
+
var V = j[G];
|
|
6190
|
+
if (typeof V != "function")
|
|
6191
|
+
return D(Z, ne, re, G, oe(V));
|
|
6192
|
+
var ie = V(ee, G, Z, ne, re + "." + G, r);
|
|
6193
|
+
if (ie)
|
|
6194
|
+
return ie;
|
|
6171
6195
|
}
|
|
6172
6196
|
return null;
|
|
6173
6197
|
}
|
|
6174
|
-
return x(
|
|
6198
|
+
return x(H);
|
|
6175
6199
|
}
|
|
6176
6200
|
function P(j) {
|
|
6177
|
-
function
|
|
6178
|
-
var
|
|
6201
|
+
function H(q, W, Z, ne, re) {
|
|
6202
|
+
var ee = q[W], R = L(ee);
|
|
6179
6203
|
if (R !== "object")
|
|
6180
|
-
return new c("Invalid " + ne + " `" + re + "` of type `" + R + "` " + ("supplied to `" +
|
|
6181
|
-
var
|
|
6182
|
-
for (var
|
|
6183
|
-
var
|
|
6184
|
-
if (n(j,
|
|
6185
|
-
return D(
|
|
6186
|
-
if (!
|
|
6204
|
+
return new c("Invalid " + ne + " `" + re + "` of type `" + R + "` " + ("supplied to `" + Z + "`, expected `object`."));
|
|
6205
|
+
var G = t({}, q[W], j);
|
|
6206
|
+
for (var V in G) {
|
|
6207
|
+
var ie = j[V];
|
|
6208
|
+
if (n(j, V) && typeof ie != "function")
|
|
6209
|
+
return D(Z, ne, re, V, oe(ie));
|
|
6210
|
+
if (!ie)
|
|
6187
6211
|
return new c(
|
|
6188
|
-
"Invalid " + ne + " `" + re + "` key `" +
|
|
6212
|
+
"Invalid " + ne + " `" + re + "` key `" + V + "` supplied to `" + Z + "`.\nBad object: " + JSON.stringify(q[W], null, " ") + `
|
|
6189
6213
|
Valid keys: ` + JSON.stringify(Object.keys(j), null, " ")
|
|
6190
6214
|
);
|
|
6191
|
-
var I =
|
|
6215
|
+
var I = ie(ee, V, Z, ne, re + "." + V, r);
|
|
6192
6216
|
if (I)
|
|
6193
6217
|
return I;
|
|
6194
6218
|
}
|
|
6195
6219
|
return null;
|
|
6196
6220
|
}
|
|
6197
|
-
return x(
|
|
6221
|
+
return x(H);
|
|
6198
6222
|
}
|
|
6199
6223
|
function z(j) {
|
|
6200
6224
|
switch (typeof j) {
|
|
@@ -6209,17 +6233,17 @@ Valid keys: ` + JSON.stringify(Object.keys(j), null, " ")
|
|
|
6209
6233
|
return j.every(z);
|
|
6210
6234
|
if (j === null || o(j))
|
|
6211
6235
|
return !0;
|
|
6212
|
-
var
|
|
6213
|
-
if (
|
|
6214
|
-
var
|
|
6215
|
-
if (
|
|
6216
|
-
for (; !(
|
|
6217
|
-
if (!z(
|
|
6236
|
+
var H = f(j);
|
|
6237
|
+
if (H) {
|
|
6238
|
+
var q = H.call(j), W;
|
|
6239
|
+
if (H !== j.entries) {
|
|
6240
|
+
for (; !(W = q.next()).done; )
|
|
6241
|
+
if (!z(W.value))
|
|
6218
6242
|
return !1;
|
|
6219
6243
|
} else
|
|
6220
|
-
for (; !(
|
|
6221
|
-
var
|
|
6222
|
-
if (
|
|
6244
|
+
for (; !(W = q.next()).done; ) {
|
|
6245
|
+
var Z = W.value;
|
|
6246
|
+
if (Z && !z(Z[1]))
|
|
6223
6247
|
return !1;
|
|
6224
6248
|
}
|
|
6225
6249
|
} else
|
|
@@ -6229,37 +6253,37 @@ Valid keys: ` + JSON.stringify(Object.keys(j), null, " ")
|
|
|
6229
6253
|
return !1;
|
|
6230
6254
|
}
|
|
6231
6255
|
}
|
|
6232
|
-
function
|
|
6233
|
-
return j === "symbol" ? !0 :
|
|
6256
|
+
function N(j, H) {
|
|
6257
|
+
return j === "symbol" ? !0 : H ? H["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && H instanceof Symbol : !1;
|
|
6234
6258
|
}
|
|
6235
6259
|
function L(j) {
|
|
6236
|
-
var
|
|
6237
|
-
return Array.isArray(j) ? "array" : j instanceof RegExp ? "object" :
|
|
6260
|
+
var H = typeof j;
|
|
6261
|
+
return Array.isArray(j) ? "array" : j instanceof RegExp ? "object" : N(H, j) ? "symbol" : H;
|
|
6238
6262
|
}
|
|
6239
|
-
function
|
|
6263
|
+
function oe(j) {
|
|
6240
6264
|
if (typeof j > "u" || j === null)
|
|
6241
6265
|
return "" + j;
|
|
6242
|
-
var
|
|
6243
|
-
if (
|
|
6266
|
+
var H = L(j);
|
|
6267
|
+
if (H === "object") {
|
|
6244
6268
|
if (j instanceof Date)
|
|
6245
6269
|
return "date";
|
|
6246
6270
|
if (j instanceof RegExp)
|
|
6247
6271
|
return "regexp";
|
|
6248
6272
|
}
|
|
6249
|
-
return
|
|
6273
|
+
return H;
|
|
6250
6274
|
}
|
|
6251
6275
|
function ce(j) {
|
|
6252
|
-
var
|
|
6253
|
-
switch (
|
|
6276
|
+
var H = oe(j);
|
|
6277
|
+
switch (H) {
|
|
6254
6278
|
case "array":
|
|
6255
6279
|
case "object":
|
|
6256
|
-
return "an " +
|
|
6280
|
+
return "an " + H;
|
|
6257
6281
|
case "boolean":
|
|
6258
6282
|
case "date":
|
|
6259
6283
|
case "regexp":
|
|
6260
|
-
return "a " +
|
|
6284
|
+
return "a " + H;
|
|
6261
6285
|
default:
|
|
6262
|
-
return
|
|
6286
|
+
return H;
|
|
6263
6287
|
}
|
|
6264
6288
|
}
|
|
6265
6289
|
function ue(j) {
|
|
@@ -6514,7 +6538,7 @@ function _t(e) {
|
|
|
6514
6538
|
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
|
|
6515
6539
|
}
|
|
6516
6540
|
function Yo(e) {
|
|
6517
|
-
if (/* @__PURE__ */
|
|
6541
|
+
if (/* @__PURE__ */ Fe.isValidElement(e) || Kn.isValidElementType(e) || !_t(e))
|
|
6518
6542
|
return e;
|
|
6519
6543
|
const t = {};
|
|
6520
6544
|
return Object.keys(e).forEach((r) => {
|
|
@@ -6528,7 +6552,7 @@ function Je(e, t, r = {
|
|
|
6528
6552
|
...e
|
|
6529
6553
|
} : e;
|
|
6530
6554
|
return _t(e) && _t(t) && Object.keys(t).forEach((i) => {
|
|
6531
|
-
/* @__PURE__ */
|
|
6555
|
+
/* @__PURE__ */ Fe.isValidElement(t[i]) || Kn.isValidElementType(t[i]) ? n[i] = t[i] : _t(t[i]) && // Avoid prototype pollution
|
|
6532
6556
|
Object.prototype.hasOwnProperty.call(e, i) && _t(e[i]) ? n[i] = Je(e[i], t[i], r) : r.clone ? n[i] = _t(t[i]) ? Yo(t[i]) : t[i] : n[i] = t[i];
|
|
6533
6557
|
}), n;
|
|
6534
6558
|
}
|
|
@@ -6657,7 +6681,7 @@ function Qn(e, t, r, n = r) {
|
|
|
6657
6681
|
let i;
|
|
6658
6682
|
return typeof e == "function" ? i = e(r) : Array.isArray(e) ? i = e[r] || n : i = ni(e, r) || n, t && (i = t(i, n, e)), i;
|
|
6659
6683
|
}
|
|
6660
|
-
function
|
|
6684
|
+
function Re(e) {
|
|
6661
6685
|
const {
|
|
6662
6686
|
prop: t,
|
|
6663
6687
|
cssProperty: r = e.prop,
|
|
@@ -6740,16 +6764,16 @@ function Zo(e, t) {
|
|
|
6740
6764
|
const r = va(e.theme);
|
|
6741
6765
|
return Object.keys(e).map((n) => cd(e, t, n, r)).reduce(rn, {});
|
|
6742
6766
|
}
|
|
6743
|
-
function
|
|
6767
|
+
function _e(e) {
|
|
6744
6768
|
return Zo(e, ii);
|
|
6745
6769
|
}
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
function
|
|
6770
|
+
_e.propTypes = process.env.NODE_ENV !== "production" ? ii.reduce((e, t) => (e[t] = Gt, e), {}) : {};
|
|
6771
|
+
_e.filterProps = ii;
|
|
6772
|
+
function Ce(e) {
|
|
6749
6773
|
return Zo(e, ai);
|
|
6750
6774
|
}
|
|
6751
|
-
|
|
6752
|
-
|
|
6775
|
+
Ce.propTypes = process.env.NODE_ENV !== "production" ? ai.reduce((e, t) => (e[t] = Gt, e), {}) : {};
|
|
6776
|
+
Ce.filterProps = ai;
|
|
6753
6777
|
process.env.NODE_ENV !== "production" && od.reduce((e, t) => (e[t] = Gt, e), {});
|
|
6754
6778
|
function si(...e) {
|
|
6755
6779
|
const t = e.reduce((n, i) => (i.filterProps.forEach((a) => {
|
|
@@ -6761,7 +6785,7 @@ function nt(e) {
|
|
|
6761
6785
|
return typeof e != "number" ? e : `${e}px solid`;
|
|
6762
6786
|
}
|
|
6763
6787
|
function it(e, t) {
|
|
6764
|
-
return
|
|
6788
|
+
return Re({
|
|
6765
6789
|
prop: e,
|
|
6766
6790
|
themeKey: "borders",
|
|
6767
6791
|
transform: t
|
|
@@ -6820,39 +6844,39 @@ ui.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
6820
6844
|
rowGap: Gt
|
|
6821
6845
|
} : {};
|
|
6822
6846
|
ui.filterProps = ["rowGap"];
|
|
6823
|
-
const Sd =
|
|
6847
|
+
const Sd = Re({
|
|
6824
6848
|
prop: "gridColumn"
|
|
6825
|
-
}), Ed =
|
|
6849
|
+
}), Ed = Re({
|
|
6826
6850
|
prop: "gridRow"
|
|
6827
|
-
}), kd =
|
|
6851
|
+
}), kd = Re({
|
|
6828
6852
|
prop: "gridAutoFlow"
|
|
6829
|
-
}), Od =
|
|
6853
|
+
}), Od = Re({
|
|
6830
6854
|
prop: "gridAutoColumns"
|
|
6831
|
-
}), Td =
|
|
6855
|
+
}), Td = Re({
|
|
6832
6856
|
prop: "gridAutoRows"
|
|
6833
|
-
}), _d =
|
|
6857
|
+
}), _d = Re({
|
|
6834
6858
|
prop: "gridTemplateColumns"
|
|
6835
|
-
}), Cd =
|
|
6859
|
+
}), Cd = Re({
|
|
6836
6860
|
prop: "gridTemplateRows"
|
|
6837
|
-
}), Ad =
|
|
6861
|
+
}), Ad = Re({
|
|
6838
6862
|
prop: "gridTemplateAreas"
|
|
6839
|
-
}), Fd =
|
|
6863
|
+
}), Fd = Re({
|
|
6840
6864
|
prop: "gridArea"
|
|
6841
6865
|
});
|
|
6842
6866
|
si(li, ci, ui, Sd, Ed, kd, Od, Td, _d, Cd, Ad, Fd);
|
|
6843
6867
|
function Cr(e, t) {
|
|
6844
6868
|
return t === "grey" ? t : e;
|
|
6845
6869
|
}
|
|
6846
|
-
const $d =
|
|
6870
|
+
const $d = Re({
|
|
6847
6871
|
prop: "color",
|
|
6848
6872
|
themeKey: "palette",
|
|
6849
6873
|
transform: Cr
|
|
6850
|
-
}), Dd =
|
|
6874
|
+
}), Dd = Re({
|
|
6851
6875
|
prop: "bgcolor",
|
|
6852
6876
|
cssProperty: "backgroundColor",
|
|
6853
6877
|
themeKey: "palette",
|
|
6854
6878
|
transform: Cr
|
|
6855
|
-
}), Rd =
|
|
6879
|
+
}), Rd = Re({
|
|
6856
6880
|
prop: "backgroundColor",
|
|
6857
6881
|
themeKey: "palette",
|
|
6858
6882
|
transform: Cr
|
|
@@ -6861,7 +6885,7 @@ si($d, Dd, Rd);
|
|
|
6861
6885
|
function Ze(e) {
|
|
6862
6886
|
return e <= 1 && e !== 0 ? `${e * 100}%` : e;
|
|
6863
6887
|
}
|
|
6864
|
-
const Pd =
|
|
6888
|
+
const Pd = Re({
|
|
6865
6889
|
prop: "width",
|
|
6866
6890
|
transform: Ze
|
|
6867
6891
|
}), xa = (e) => {
|
|
@@ -6882,30 +6906,30 @@ const Pd = De({
|
|
|
6882
6906
|
return null;
|
|
6883
6907
|
};
|
|
6884
6908
|
xa.filterProps = ["maxWidth"];
|
|
6885
|
-
const jd =
|
|
6909
|
+
const jd = Re({
|
|
6886
6910
|
prop: "minWidth",
|
|
6887
6911
|
transform: Ze
|
|
6888
|
-
}), Id =
|
|
6912
|
+
}), Id = Re({
|
|
6889
6913
|
prop: "height",
|
|
6890
6914
|
transform: Ze
|
|
6891
|
-
}), Md =
|
|
6915
|
+
}), Md = Re({
|
|
6892
6916
|
prop: "maxHeight",
|
|
6893
6917
|
transform: Ze
|
|
6894
|
-
}), zd =
|
|
6918
|
+
}), zd = Re({
|
|
6895
6919
|
prop: "minHeight",
|
|
6896
6920
|
transform: Ze
|
|
6897
6921
|
});
|
|
6898
|
-
|
|
6922
|
+
Re({
|
|
6899
6923
|
prop: "size",
|
|
6900
6924
|
cssProperty: "width",
|
|
6901
6925
|
transform: Ze
|
|
6902
6926
|
});
|
|
6903
|
-
|
|
6927
|
+
Re({
|
|
6904
6928
|
prop: "size",
|
|
6905
6929
|
cssProperty: "height",
|
|
6906
6930
|
transform: Ze
|
|
6907
6931
|
});
|
|
6908
|
-
const Vd =
|
|
6932
|
+
const Vd = Re({
|
|
6909
6933
|
prop: "boxSizing"
|
|
6910
6934
|
});
|
|
6911
6935
|
si(Pd, xa, jd, Id, Md, zd, Vd);
|
|
@@ -6973,124 +6997,124 @@ const di = {
|
|
|
6973
6997
|
},
|
|
6974
6998
|
// spacing
|
|
6975
6999
|
p: {
|
|
6976
|
-
style:
|
|
7000
|
+
style: Ce
|
|
6977
7001
|
},
|
|
6978
7002
|
pt: {
|
|
6979
|
-
style:
|
|
7003
|
+
style: Ce
|
|
6980
7004
|
},
|
|
6981
7005
|
pr: {
|
|
6982
|
-
style:
|
|
7006
|
+
style: Ce
|
|
6983
7007
|
},
|
|
6984
7008
|
pb: {
|
|
6985
|
-
style:
|
|
7009
|
+
style: Ce
|
|
6986
7010
|
},
|
|
6987
7011
|
pl: {
|
|
6988
|
-
style:
|
|
7012
|
+
style: Ce
|
|
6989
7013
|
},
|
|
6990
7014
|
px: {
|
|
6991
|
-
style:
|
|
7015
|
+
style: Ce
|
|
6992
7016
|
},
|
|
6993
7017
|
py: {
|
|
6994
|
-
style:
|
|
7018
|
+
style: Ce
|
|
6995
7019
|
},
|
|
6996
7020
|
padding: {
|
|
6997
|
-
style:
|
|
7021
|
+
style: Ce
|
|
6998
7022
|
},
|
|
6999
7023
|
paddingTop: {
|
|
7000
|
-
style:
|
|
7024
|
+
style: Ce
|
|
7001
7025
|
},
|
|
7002
7026
|
paddingRight: {
|
|
7003
|
-
style:
|
|
7027
|
+
style: Ce
|
|
7004
7028
|
},
|
|
7005
7029
|
paddingBottom: {
|
|
7006
|
-
style:
|
|
7030
|
+
style: Ce
|
|
7007
7031
|
},
|
|
7008
7032
|
paddingLeft: {
|
|
7009
|
-
style:
|
|
7033
|
+
style: Ce
|
|
7010
7034
|
},
|
|
7011
7035
|
paddingX: {
|
|
7012
|
-
style:
|
|
7036
|
+
style: Ce
|
|
7013
7037
|
},
|
|
7014
7038
|
paddingY: {
|
|
7015
|
-
style:
|
|
7039
|
+
style: Ce
|
|
7016
7040
|
},
|
|
7017
7041
|
paddingInline: {
|
|
7018
|
-
style:
|
|
7042
|
+
style: Ce
|
|
7019
7043
|
},
|
|
7020
7044
|
paddingInlineStart: {
|
|
7021
|
-
style:
|
|
7045
|
+
style: Ce
|
|
7022
7046
|
},
|
|
7023
7047
|
paddingInlineEnd: {
|
|
7024
|
-
style:
|
|
7048
|
+
style: Ce
|
|
7025
7049
|
},
|
|
7026
7050
|
paddingBlock: {
|
|
7027
|
-
style:
|
|
7051
|
+
style: Ce
|
|
7028
7052
|
},
|
|
7029
7053
|
paddingBlockStart: {
|
|
7030
|
-
style:
|
|
7054
|
+
style: Ce
|
|
7031
7055
|
},
|
|
7032
7056
|
paddingBlockEnd: {
|
|
7033
|
-
style:
|
|
7057
|
+
style: Ce
|
|
7034
7058
|
},
|
|
7035
7059
|
m: {
|
|
7036
|
-
style:
|
|
7060
|
+
style: _e
|
|
7037
7061
|
},
|
|
7038
7062
|
mt: {
|
|
7039
|
-
style:
|
|
7063
|
+
style: _e
|
|
7040
7064
|
},
|
|
7041
7065
|
mr: {
|
|
7042
|
-
style:
|
|
7066
|
+
style: _e
|
|
7043
7067
|
},
|
|
7044
7068
|
mb: {
|
|
7045
|
-
style:
|
|
7069
|
+
style: _e
|
|
7046
7070
|
},
|
|
7047
7071
|
ml: {
|
|
7048
|
-
style:
|
|
7072
|
+
style: _e
|
|
7049
7073
|
},
|
|
7050
7074
|
mx: {
|
|
7051
|
-
style:
|
|
7075
|
+
style: _e
|
|
7052
7076
|
},
|
|
7053
7077
|
my: {
|
|
7054
|
-
style:
|
|
7078
|
+
style: _e
|
|
7055
7079
|
},
|
|
7056
7080
|
margin: {
|
|
7057
|
-
style:
|
|
7081
|
+
style: _e
|
|
7058
7082
|
},
|
|
7059
7083
|
marginTop: {
|
|
7060
|
-
style:
|
|
7084
|
+
style: _e
|
|
7061
7085
|
},
|
|
7062
7086
|
marginRight: {
|
|
7063
|
-
style:
|
|
7087
|
+
style: _e
|
|
7064
7088
|
},
|
|
7065
7089
|
marginBottom: {
|
|
7066
|
-
style:
|
|
7090
|
+
style: _e
|
|
7067
7091
|
},
|
|
7068
7092
|
marginLeft: {
|
|
7069
|
-
style:
|
|
7093
|
+
style: _e
|
|
7070
7094
|
},
|
|
7071
7095
|
marginX: {
|
|
7072
|
-
style:
|
|
7096
|
+
style: _e
|
|
7073
7097
|
},
|
|
7074
7098
|
marginY: {
|
|
7075
|
-
style:
|
|
7099
|
+
style: _e
|
|
7076
7100
|
},
|
|
7077
7101
|
marginInline: {
|
|
7078
|
-
style:
|
|
7102
|
+
style: _e
|
|
7079
7103
|
},
|
|
7080
7104
|
marginInlineStart: {
|
|
7081
|
-
style:
|
|
7105
|
+
style: _e
|
|
7082
7106
|
},
|
|
7083
7107
|
marginInlineEnd: {
|
|
7084
|
-
style:
|
|
7108
|
+
style: _e
|
|
7085
7109
|
},
|
|
7086
7110
|
marginBlock: {
|
|
7087
|
-
style:
|
|
7111
|
+
style: _e
|
|
7088
7112
|
},
|
|
7089
7113
|
marginBlockStart: {
|
|
7090
|
-
style:
|
|
7114
|
+
style: _e
|
|
7091
7115
|
},
|
|
7092
7116
|
marginBlockEnd: {
|
|
7093
|
-
style:
|
|
7117
|
+
style: _e
|
|
7094
7118
|
},
|
|
7095
7119
|
// display
|
|
7096
7120
|
displayPrint: {
|
|
@@ -7759,37 +7783,37 @@ function lp(e = {}) {
|
|
|
7759
7783
|
if (w.__emotion_real === w)
|
|
7760
7784
|
return w;
|
|
7761
7785
|
if (typeof w == "function")
|
|
7762
|
-
return function(
|
|
7763
|
-
return Mn(
|
|
7786
|
+
return function(Y) {
|
|
7787
|
+
return Mn(Y, w);
|
|
7764
7788
|
};
|
|
7765
7789
|
if (_t(w)) {
|
|
7766
7790
|
const M = rl(w);
|
|
7767
|
-
return M.variants ? function(
|
|
7768
|
-
return Mn(
|
|
7791
|
+
return M.variants ? function(X) {
|
|
7792
|
+
return Mn(X, M);
|
|
7769
7793
|
} : M.style;
|
|
7770
7794
|
}
|
|
7771
7795
|
return w;
|
|
7772
7796
|
}, C = (...w) => {
|
|
7773
|
-
const M = [],
|
|
7774
|
-
if (M.push(a), p && b &&
|
|
7775
|
-
var L,
|
|
7776
|
-
const z = (
|
|
7797
|
+
const M = [], Y = w.map(F), X = [];
|
|
7798
|
+
if (M.push(a), p && b && X.push(function(k) {
|
|
7799
|
+
var L, oe;
|
|
7800
|
+
const z = (oe = (L = k.theme.components) == null ? void 0 : L[p]) == null ? void 0 : oe.styleOverrides;
|
|
7777
7801
|
if (!z)
|
|
7778
7802
|
return null;
|
|
7779
|
-
const
|
|
7803
|
+
const N = {};
|
|
7780
7804
|
for (const ce in z)
|
|
7781
|
-
|
|
7782
|
-
return b(k,
|
|
7783
|
-
}), p && !c &&
|
|
7784
|
-
var
|
|
7785
|
-
const P = k.theme, z = (L = (
|
|
7805
|
+
N[ce] = Mn(k, z[ce]);
|
|
7806
|
+
return b(k, N);
|
|
7807
|
+
}), p && !c && X.push(function(k) {
|
|
7808
|
+
var N, L;
|
|
7809
|
+
const P = k.theme, z = (L = (N = P == null ? void 0 : P.components) == null ? void 0 : N[p]) == null ? void 0 : L.variants;
|
|
7786
7810
|
return z ? nl(k, z) : null;
|
|
7787
|
-
}), x ||
|
|
7788
|
-
const D =
|
|
7811
|
+
}), x || X.push(Lr), Array.isArray(Y[0])) {
|
|
7812
|
+
const D = Y.shift(), k = new Array(M.length).fill(""), P = new Array(X.length).fill("");
|
|
7789
7813
|
let z;
|
|
7790
7814
|
z = [...k, ...D, ...P], z.raw = [...k, ...D.raw, ...P], M.unshift(z);
|
|
7791
7815
|
}
|
|
7792
|
-
const
|
|
7816
|
+
const K = [...M, ...Y, ...X], u = O(...K);
|
|
7793
7817
|
return o.muiName && (u.muiName = o.muiName), process.env.NODE_ENV !== "production" && (u.displayName = cp(p, d, o)), u;
|
|
7794
7818
|
};
|
|
7795
7819
|
return O.withConfig && (C.withConfig = O.withConfig), C;
|
|
@@ -7976,7 +8000,7 @@ function $n(e, t, r) {
|
|
|
7976
8000
|
return e;
|
|
7977
8001
|
}
|
|
7978
8002
|
}
|
|
7979
|
-
const vp = /* @__PURE__ */
|
|
8003
|
+
const vp = /* @__PURE__ */ Fe.createContext(void 0);
|
|
7980
8004
|
process.env.NODE_ENV !== "production" && (te.node, te.object);
|
|
7981
8005
|
function xp(e) {
|
|
7982
8006
|
const {
|
|
@@ -7993,7 +8017,7 @@ function bp({
|
|
|
7993
8017
|
props: e,
|
|
7994
8018
|
name: t
|
|
7995
8019
|
}) {
|
|
7996
|
-
const r =
|
|
8020
|
+
const r = Fe.useContext(vp);
|
|
7997
8021
|
return xp({
|
|
7998
8022
|
props: e,
|
|
7999
8023
|
name: t,
|
|
@@ -8081,9 +8105,9 @@ function Op(e, t = {}) {
|
|
|
8081
8105
|
const {
|
|
8082
8106
|
vars: w,
|
|
8083
8107
|
css: M,
|
|
8084
|
-
varsWithDefaults:
|
|
8108
|
+
varsWithDefaults: Y
|
|
8085
8109
|
} = Ci(C, t);
|
|
8086
|
-
m = Je(m,
|
|
8110
|
+
m = Je(m, Y), b[F] = {
|
|
8087
8111
|
css: M,
|
|
8088
8112
|
vars: w
|
|
8089
8113
|
};
|
|
@@ -8099,12 +8123,12 @@ function Op(e, t = {}) {
|
|
|
8099
8123
|
};
|
|
8100
8124
|
}
|
|
8101
8125
|
function x(F, C) {
|
|
8102
|
-
var M,
|
|
8126
|
+
var M, Y;
|
|
8103
8127
|
let w = i;
|
|
8104
8128
|
if (i === "class" && (w = ".%s"), i === "data" && (w = "[data-%s]"), i != null && i.startsWith("data-") && !i.includes("%s") && (w = `[${i}="%s"]`), F) {
|
|
8105
8129
|
if (w === "media")
|
|
8106
8130
|
return e.defaultColorScheme === F ? ":root" : {
|
|
8107
|
-
[`@media (prefers-color-scheme: ${((
|
|
8131
|
+
[`@media (prefers-color-scheme: ${((Y = (M = a[F]) == null ? void 0 : M.palette) == null ? void 0 : Y.mode) || F})`]: {
|
|
8108
8132
|
":root": C
|
|
8109
8133
|
}
|
|
8110
8134
|
};
|
|
@@ -8126,7 +8150,7 @@ function Op(e, t = {}) {
|
|
|
8126
8150
|
}), F;
|
|
8127
8151
|
},
|
|
8128
8152
|
generateStyleSheets: () => {
|
|
8129
|
-
var
|
|
8153
|
+
var X, K;
|
|
8130
8154
|
const F = [], C = e.defaultColorScheme || "light";
|
|
8131
8155
|
function w(u, D) {
|
|
8132
8156
|
Object.keys(D).length && F.push(typeof u == "string" ? {
|
|
@@ -8140,12 +8164,12 @@ function Op(e, t = {}) {
|
|
|
8140
8164
|
}), d);
|
|
8141
8165
|
const {
|
|
8142
8166
|
[C]: M,
|
|
8143
|
-
...
|
|
8167
|
+
...Y
|
|
8144
8168
|
} = b;
|
|
8145
8169
|
if (M) {
|
|
8146
8170
|
const {
|
|
8147
8171
|
css: u
|
|
8148
|
-
} = M, D = (
|
|
8172
|
+
} = M, D = (K = (X = a[C]) == null ? void 0 : X.palette) == null ? void 0 : K.mode, k = !n && D ? {
|
|
8149
8173
|
colorScheme: D,
|
|
8150
8174
|
...u
|
|
8151
8175
|
} : {
|
|
@@ -8155,11 +8179,11 @@ function Op(e, t = {}) {
|
|
|
8155
8179
|
...k
|
|
8156
8180
|
}), k);
|
|
8157
8181
|
}
|
|
8158
|
-
return Object.entries(
|
|
8182
|
+
return Object.entries(Y).forEach(([u, {
|
|
8159
8183
|
css: D
|
|
8160
8184
|
}]) => {
|
|
8161
|
-
var z,
|
|
8162
|
-
const k = (
|
|
8185
|
+
var z, N;
|
|
8186
|
+
const k = (N = (z = a[u]) == null ? void 0 : z.palette) == null ? void 0 : N.mode, P = !n && k ? {
|
|
8163
8187
|
colorScheme: k,
|
|
8164
8188
|
...D
|
|
8165
8189
|
} : {
|
|
@@ -8920,10 +8944,10 @@ function af(e = {}, ...t) {
|
|
|
8920
8944
|
},
|
|
8921
8945
|
spacing: rf(p.spacing)
|
|
8922
8946
|
};
|
|
8923
|
-
Object.keys(C.colorSchemes).forEach((
|
|
8924
|
-
const u = C.colorSchemes[
|
|
8925
|
-
const P = k.split("-"), z = P[1],
|
|
8926
|
-
return m(k, u[z][
|
|
8947
|
+
Object.keys(C.colorSchemes).forEach((K) => {
|
|
8948
|
+
const u = C.colorSchemes[K].palette, D = (k) => {
|
|
8949
|
+
const P = k.split("-"), z = P[1], N = P[2];
|
|
8950
|
+
return m(k, u[z][N]);
|
|
8927
8951
|
};
|
|
8928
8952
|
if (u.mode === "light" && (_(u.common, "background", "#fff"), _(u.common, "onBackground", "#000")), u.mode === "dark" && (_(u.common, "background", "#000"), _(u.common, "onBackground", "#fff")), tf(u, ["Alert", "AppBar", "Avatar", "Button", "Chip", "FilledInput", "LinearProgress", "Skeleton", "Slider", "SnackbarContent", "SpeedDialAction", "StepConnector", "StepContent", "Switch", "TableCell", "Tooltip"]), u.mode === "light") {
|
|
8929
8953
|
_(u.Alert, "errorColor", be(u.error.light, 0.6)), _(u.Alert, "infoColor", be(u.info.light, 0.6)), _(u.Alert, "successColor", be(u.success.light, 0.6)), _(u.Alert, "warningColor", be(u.warning.light, 0.6)), _(u.Alert, "errorFilledBg", D("palette-error-main")), _(u.Alert, "infoFilledBg", D("palette-info-main")), _(u.Alert, "successFilledBg", D("palette-success-main")), _(u.Alert, "warningFilledBg", D("palette-warning-main")), _(u.Alert, "errorFilledColor", ft(() => u.getContrastText(u.error.main))), _(u.Alert, "infoFilledColor", ft(() => u.getContrastText(u.info.main))), _(u.Alert, "successFilledColor", ft(() => u.getContrastText(u.success.main))), _(u.Alert, "warningFilledColor", ft(() => u.getContrastText(u.warning.main))), _(u.Alert, "errorStandardBg", we(u.error.light, 0.9)), _(u.Alert, "infoStandardBg", we(u.info.light, 0.9)), _(u.Alert, "successStandardBg", we(u.success.light, 0.9)), _(u.Alert, "warningStandardBg", we(u.warning.light, 0.9)), _(u.Alert, "errorIconColor", D("palette-error-main")), _(u.Alert, "infoIconColor", D("palette-info-main")), _(u.Alert, "successIconColor", D("palette-success-main")), _(u.Alert, "warningIconColor", D("palette-warning-main")), _(u.AppBar, "defaultBg", D("palette-grey-100")), _(u.Avatar, "defaultBg", D("palette-grey-400")), _(u.Button, "inheritContainedBg", D("palette-grey-300")), _(u.Button, "inheritContainedHoverBg", D("palette-grey-A100")), _(u.Chip, "defaultBorder", D("palette-grey-400")), _(u.Chip, "defaultAvatarColor", D("palette-grey-700")), _(u.Chip, "defaultIconColor", D("palette-grey-700")), _(u.FilledInput, "bg", "rgba(0, 0, 0, 0.06)"), _(u.FilledInput, "hoverBg", "rgba(0, 0, 0, 0.09)"), _(u.FilledInput, "disabledBg", "rgba(0, 0, 0, 0.12)"), _(u.LinearProgress, "primaryBg", we(u.primary.main, 0.62)), _(u.LinearProgress, "secondaryBg", we(u.secondary.main, 0.62)), _(u.LinearProgress, "errorBg", we(u.error.main, 0.62)), _(u.LinearProgress, "infoBg", we(u.info.main, 0.62)), _(u.LinearProgress, "successBg", we(u.success.main, 0.62)), _(u.LinearProgress, "warningBg", we(u.warning.main, 0.62)), _(u.Skeleton, "bg", `rgba(${D("palette-text-primaryChannel")} / 0.11)`), _(u.Slider, "primaryTrack", we(u.primary.main, 0.62)), _(u.Slider, "secondaryTrack", we(u.secondary.main, 0.62)), _(u.Slider, "errorTrack", we(u.error.main, 0.62)), _(u.Slider, "infoTrack", we(u.info.main, 0.62)), _(u.Slider, "successTrack", we(u.success.main, 0.62)), _(u.Slider, "warningTrack", we(u.warning.main, 0.62));
|
|
@@ -8939,7 +8963,7 @@ function af(e = {}, ...t) {
|
|
|
8939
8963
|
const P = u[k];
|
|
8940
8964
|
k !== "tonalOffset" && P && typeof P == "object" && (P.main && _(u[k], "mainChannel", Jr(Xr(P.main))), P.light && _(u[k], "lightChannel", Jr(Xr(P.light))), P.dark && _(u[k], "darkChannel", Jr(Xr(P.dark))), P.contrastText && _(u[k], "contrastTextChannel", Jr(Xr(P.contrastText))), k === "text" && (kt(u[k], "primary"), kt(u[k], "secondary")), k === "action" && (P.active && kt(u[k], "active"), P.selected && kt(u[k], "selected")));
|
|
8941
8965
|
});
|
|
8942
|
-
}), C = t.reduce((
|
|
8966
|
+
}), C = t.reduce((K, u) => Je(K, u), C);
|
|
8943
8967
|
const w = {
|
|
8944
8968
|
prefix: a,
|
|
8945
8969
|
disableCssColorScheme: i,
|
|
@@ -8947,12 +8971,12 @@ function af(e = {}, ...t) {
|
|
|
8947
8971
|
getSelector: ef(C)
|
|
8948
8972
|
}, {
|
|
8949
8973
|
vars: M,
|
|
8950
|
-
generateThemeVars:
|
|
8951
|
-
generateStyleSheets:
|
|
8974
|
+
generateThemeVars: Y,
|
|
8975
|
+
generateStyleSheets: X
|
|
8952
8976
|
} = Op(C, w);
|
|
8953
|
-
return C.vars = M, Object.entries(C.colorSchemes[C.defaultColorScheme]).forEach(([
|
|
8954
|
-
C[
|
|
8955
|
-
}), C.generateThemeVars =
|
|
8977
|
+
return C.vars = M, Object.entries(C.colorSchemes[C.defaultColorScheme]).forEach(([K, u]) => {
|
|
8978
|
+
C[K] = u;
|
|
8979
|
+
}), C.generateThemeVars = Y, C.generateStyleSheets = X, C.generateSpacing = function() {
|
|
8956
8980
|
return Xo(p.spacing, va(this));
|
|
8957
8981
|
}, C.getColorSchemeSelector = Tp(o), C.spacing = C.generateSpacing(), C.shouldSkipGeneratingVar = s, C.unstable_sxConfig = {
|
|
8958
8982
|
...di,
|
|
@@ -9145,7 +9169,7 @@ const hf = (e) => {
|
|
|
9145
9169
|
}
|
|
9146
9170
|
]
|
|
9147
9171
|
};
|
|
9148
|
-
})), Yn = /* @__PURE__ */
|
|
9172
|
+
})), Yn = /* @__PURE__ */ Fe.forwardRef(function(t, r) {
|
|
9149
9173
|
const n = ff({
|
|
9150
9174
|
props: t,
|
|
9151
9175
|
name: "MuiSvgIcon"
|
|
@@ -9160,7 +9184,7 @@ const hf = (e) => {
|
|
|
9160
9184
|
titleAccess: f,
|
|
9161
9185
|
viewBox: m = "0 0 24 24",
|
|
9162
9186
|
...b
|
|
9163
|
-
} = n, h = /* @__PURE__ */
|
|
9187
|
+
} = n, h = /* @__PURE__ */ Fe.isValidElement(i) && i.type === "svg", c = {
|
|
9164
9188
|
...n,
|
|
9165
9189
|
color: s,
|
|
9166
9190
|
component: o,
|
|
@@ -9172,7 +9196,7 @@ const hf = (e) => {
|
|
|
9172
9196
|
}, x = {};
|
|
9173
9197
|
d || (x.viewBox = m);
|
|
9174
9198
|
const y = hf(c);
|
|
9175
|
-
return /* @__PURE__ */
|
|
9199
|
+
return /* @__PURE__ */ Te(gf, {
|
|
9176
9200
|
as: o,
|
|
9177
9201
|
className: Wu(y.root, a),
|
|
9178
9202
|
focusable: "false",
|
|
@@ -9271,7 +9295,7 @@ function yn(e, t) {
|
|
|
9271
9295
|
children: e
|
|
9272
9296
|
});
|
|
9273
9297
|
}
|
|
9274
|
-
return process.env.NODE_ENV !== "production" && (r.displayName = `${t}Icon`), r.muiName = Yn.muiName, /* @__PURE__ */
|
|
9298
|
+
return process.env.NODE_ENV !== "production" && (r.displayName = `${t}Icon`), r.muiName = Yn.muiName, /* @__PURE__ */ Fe.memo(/* @__PURE__ */ Fe.forwardRef(r));
|
|
9275
9299
|
}
|
|
9276
9300
|
const yf = yn(/* @__PURE__ */ $("path", {
|
|
9277
9301
|
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"
|
|
@@ -10946,7 +10970,7 @@ function Ks(e, t) {
|
|
|
10946
10970
|
}
|
|
10947
10971
|
return r;
|
|
10948
10972
|
}
|
|
10949
|
-
function
|
|
10973
|
+
function Oe(e) {
|
|
10950
10974
|
for (var t = 1; t < arguments.length; t++) {
|
|
10951
10975
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
10952
10976
|
t % 2 ? Ks(Object(r), !0).forEach(function(n) {
|
|
@@ -10983,7 +11007,7 @@ var Oa = /* @__PURE__ */ Tl(function(e, t) {
|
|
|
10983
11007
|
return {
|
|
10984
11008
|
open: a
|
|
10985
11009
|
};
|
|
10986
|
-
}, [a]), /* @__PURE__ */ ge.createElement(Cl, null, r(
|
|
11010
|
+
}, [a]), /* @__PURE__ */ ge.createElement(Cl, null, r(Oe(Oe({}, s), {}, {
|
|
10987
11011
|
open: a
|
|
10988
11012
|
})));
|
|
10989
11013
|
});
|
|
@@ -11183,18 +11207,18 @@ var na = {
|
|
|
11183
11207
|
fileRejections: []
|
|
11184
11208
|
};
|
|
11185
11209
|
function Sl() {
|
|
11186
|
-
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t =
|
|
11210
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = Oe(Oe({}, wl), e), r = t.accept, n = t.disabled, i = t.getFilesFromEvent, a = t.maxSize, s = t.minSize, o = t.multiple, l = t.maxFiles, p = t.onDragEnter, d = t.onDragLeave, f = t.onDragOver, m = t.onDrop, b = t.onDropAccepted, h = t.onDropRejected, c = t.onFileDialogCancel, x = t.onFileDialogOpen, y = t.useFsAccessApi, O = t.autoFocus, F = t.preventDropOnDocument, C = t.noClick, w = t.noKeyboard, M = t.noDrag, Y = t.noDragEventsBubbling, X = t.onError, K = t.validator, u = Ve(function() {
|
|
11187
11211
|
return Xf(r);
|
|
11188
|
-
}, [r]), D =
|
|
11212
|
+
}, [r]), D = Ve(function() {
|
|
11189
11213
|
return Jf(r);
|
|
11190
|
-
}, [r]), k =
|
|
11214
|
+
}, [r]), k = Ve(function() {
|
|
11191
11215
|
return typeof x == "function" ? x : Qs;
|
|
11192
|
-
}, [x]), P =
|
|
11216
|
+
}, [x]), P = Ve(function() {
|
|
11193
11217
|
return typeof c == "function" ? c : Qs;
|
|
11194
|
-
}, [c]), z = xt(null),
|
|
11195
|
-
!
|
|
11196
|
-
if (
|
|
11197
|
-
var T =
|
|
11218
|
+
}, [c]), z = xt(null), N = xt(null), L = Ol(mm, na), oe = $i(L, 2), ce = oe[0], ue = oe[1], j = ce.isFocused, H = ce.isFileDialogActive, q = xt(typeof window < "u" && window.isSecureContext && y && Zf()), W = function() {
|
|
11219
|
+
!q.current && H && setTimeout(function() {
|
|
11220
|
+
if (N.current) {
|
|
11221
|
+
var T = N.current.files;
|
|
11198
11222
|
T.length || (ue({
|
|
11199
11223
|
type: "closeDialog"
|
|
11200
11224
|
}), P());
|
|
@@ -11202,12 +11226,12 @@ function Sl() {
|
|
|
11202
11226
|
}, 300);
|
|
11203
11227
|
};
|
|
11204
11228
|
wt(function() {
|
|
11205
|
-
return window.addEventListener("focus",
|
|
11206
|
-
window.removeEventListener("focus",
|
|
11229
|
+
return window.addEventListener("focus", W, !1), function() {
|
|
11230
|
+
window.removeEventListener("focus", W, !1);
|
|
11207
11231
|
};
|
|
11208
|
-
}, [
|
|
11209
|
-
var
|
|
11210
|
-
z.current && z.current.contains(T.target) || (T.preventDefault(),
|
|
11232
|
+
}, [N, H, P, q]);
|
|
11233
|
+
var Z = xt([]), ne = function(T) {
|
|
11234
|
+
z.current && z.current.contains(T.target) || (T.preventDefault(), Z.current = []);
|
|
11211
11235
|
};
|
|
11212
11236
|
wt(function() {
|
|
11213
11237
|
return F && (document.addEventListener("dragover", Hs, !1), document.addEventListener("drop", ne, !1)), function() {
|
|
@@ -11217,22 +11241,22 @@ function Sl() {
|
|
|
11217
11241
|
return !n && O && z.current && z.current.focus(), function() {
|
|
11218
11242
|
};
|
|
11219
11243
|
}, [z, O, n]);
|
|
11220
|
-
var re =
|
|
11221
|
-
|
|
11222
|
-
}, [
|
|
11223
|
-
E.preventDefault(), E.persist(), g(E),
|
|
11224
|
-
if (!(Xn(E) && !
|
|
11225
|
-
var
|
|
11244
|
+
var re = je(function(E) {
|
|
11245
|
+
X ? X(E) : console.error(E);
|
|
11246
|
+
}, [X]), ee = je(function(E) {
|
|
11247
|
+
E.preventDefault(), E.persist(), g(E), Z.current = [].concat(sm(Z.current), [E.target]), Rn(E) && Promise.resolve(i(E)).then(function(T) {
|
|
11248
|
+
if (!(Xn(E) && !Y)) {
|
|
11249
|
+
var U = T.length, ae = U > 0 && Kf({
|
|
11226
11250
|
files: T,
|
|
11227
11251
|
accept: u,
|
|
11228
11252
|
minSize: s,
|
|
11229
11253
|
maxSize: a,
|
|
11230
11254
|
multiple: o,
|
|
11231
11255
|
maxFiles: l,
|
|
11232
|
-
validator:
|
|
11233
|
-
}), le =
|
|
11256
|
+
validator: K
|
|
11257
|
+
}), le = U > 0 && !ae;
|
|
11234
11258
|
ue({
|
|
11235
|
-
isDragAccept:
|
|
11259
|
+
isDragAccept: ae,
|
|
11236
11260
|
isDragReject: le,
|
|
11237
11261
|
isDragActive: !0,
|
|
11238
11262
|
type: "setDraggedFiles"
|
|
@@ -11241,7 +11265,7 @@ function Sl() {
|
|
|
11241
11265
|
}).catch(function(T) {
|
|
11242
11266
|
return re(T);
|
|
11243
11267
|
});
|
|
11244
|
-
}, [i, p, re,
|
|
11268
|
+
}, [i, p, re, Y, u, s, a, o, l, K]), R = je(function(E) {
|
|
11245
11269
|
E.preventDefault(), E.persist(), g(E);
|
|
11246
11270
|
var T = Rn(E);
|
|
11247
11271
|
if (T && E.dataTransfer)
|
|
@@ -11250,53 +11274,53 @@ function Sl() {
|
|
|
11250
11274
|
} catch {
|
|
11251
11275
|
}
|
|
11252
11276
|
return T && f && f(E), !1;
|
|
11253
|
-
}, [f,
|
|
11277
|
+
}, [f, Y]), G = je(function(E) {
|
|
11254
11278
|
E.preventDefault(), E.persist(), g(E);
|
|
11255
|
-
var T =
|
|
11256
|
-
return z.current && z.current.contains(
|
|
11257
|
-
}),
|
|
11258
|
-
|
|
11279
|
+
var T = Z.current.filter(function(ae) {
|
|
11280
|
+
return z.current && z.current.contains(ae);
|
|
11281
|
+
}), U = T.indexOf(E.target);
|
|
11282
|
+
U !== -1 && T.splice(U, 1), Z.current = T, !(T.length > 0) && (ue({
|
|
11259
11283
|
type: "setDraggedFiles",
|
|
11260
11284
|
isDragActive: !1,
|
|
11261
11285
|
isDragAccept: !1,
|
|
11262
11286
|
isDragReject: !1
|
|
11263
11287
|
}), Rn(E) && d && d(E));
|
|
11264
|
-
}, [z, d,
|
|
11265
|
-
var
|
|
11288
|
+
}, [z, d, Y]), V = je(function(E, T) {
|
|
11289
|
+
var U = [], ae = [];
|
|
11266
11290
|
E.forEach(function(le) {
|
|
11267
|
-
var
|
|
11291
|
+
var Ie = gl(le, u), at = $i(Ie, 2), et = at[0], Br = at[1], Zt = yl(le, s, a), $t = $i(Zt, 2), Ur = $t[0], gr = $t[1], Wr = K ? K(le) : null;
|
|
11268
11292
|
if (et && Ur && !Wr)
|
|
11269
|
-
|
|
11293
|
+
U.push(le);
|
|
11270
11294
|
else {
|
|
11271
11295
|
var yr = [Br, gr];
|
|
11272
|
-
Wr && (yr = yr.concat(Wr)),
|
|
11296
|
+
Wr && (yr = yr.concat(Wr)), ae.push({
|
|
11273
11297
|
file: le,
|
|
11274
11298
|
errors: yr.filter(function(El) {
|
|
11275
11299
|
return El;
|
|
11276
11300
|
})
|
|
11277
11301
|
});
|
|
11278
11302
|
}
|
|
11279
|
-
}), (!o &&
|
|
11280
|
-
|
|
11303
|
+
}), (!o && U.length > 1 || o && l >= 1 && U.length > l) && (U.forEach(function(le) {
|
|
11304
|
+
ae.push({
|
|
11281
11305
|
file: le,
|
|
11282
11306
|
errors: [Hf]
|
|
11283
11307
|
});
|
|
11284
|
-
}),
|
|
11285
|
-
acceptedFiles:
|
|
11286
|
-
fileRejections:
|
|
11287
|
-
isDragReject:
|
|
11308
|
+
}), U.splice(0)), ue({
|
|
11309
|
+
acceptedFiles: U,
|
|
11310
|
+
fileRejections: ae,
|
|
11311
|
+
isDragReject: ae.length > 0,
|
|
11288
11312
|
type: "setFiles"
|
|
11289
|
-
}), m && m(
|
|
11290
|
-
}, [ue, o, u, s, a, l, m, b, h,
|
|
11291
|
-
E.preventDefault(), E.persist(), g(E),
|
|
11292
|
-
Xn(E) && !
|
|
11313
|
+
}), m && m(U, ae, T), ae.length > 0 && h && h(ae, T), U.length > 0 && b && b(U, T);
|
|
11314
|
+
}, [ue, o, u, s, a, l, m, b, h, K]), ie = je(function(E) {
|
|
11315
|
+
E.preventDefault(), E.persist(), g(E), Z.current = [], Rn(E) && Promise.resolve(i(E)).then(function(T) {
|
|
11316
|
+
Xn(E) && !Y || V(T, E);
|
|
11293
11317
|
}).catch(function(T) {
|
|
11294
11318
|
return re(T);
|
|
11295
11319
|
}), ue({
|
|
11296
11320
|
type: "reset"
|
|
11297
11321
|
});
|
|
11298
|
-
}, [i,
|
|
11299
|
-
if (
|
|
11322
|
+
}, [i, V, re, Y]), I = je(function() {
|
|
11323
|
+
if (q.current) {
|
|
11300
11324
|
ue({
|
|
11301
11325
|
type: "openDialog"
|
|
11302
11326
|
}), k();
|
|
@@ -11307,30 +11331,30 @@ function Sl() {
|
|
|
11307
11331
|
window.showOpenFilePicker(E).then(function(T) {
|
|
11308
11332
|
return i(T);
|
|
11309
11333
|
}).then(function(T) {
|
|
11310
|
-
|
|
11334
|
+
V(T, null), ue({
|
|
11311
11335
|
type: "closeDialog"
|
|
11312
11336
|
});
|
|
11313
11337
|
}).catch(function(T) {
|
|
11314
11338
|
em(T) ? (P(T), ue({
|
|
11315
11339
|
type: "closeDialog"
|
|
11316
|
-
})) : tm(T) ? (
|
|
11340
|
+
})) : tm(T) ? (q.current = !1, N.current ? (N.current.value = null, N.current.click()) : re(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))) : re(T);
|
|
11317
11341
|
});
|
|
11318
11342
|
return;
|
|
11319
11343
|
}
|
|
11320
|
-
|
|
11344
|
+
N.current && (ue({
|
|
11321
11345
|
type: "openDialog"
|
|
11322
|
-
}), k(),
|
|
11323
|
-
}, [ue, k, P, y,
|
|
11346
|
+
}), k(), N.current.value = null, N.current.click());
|
|
11347
|
+
}, [ue, k, P, y, V, re, D, o]), ke = je(function(E) {
|
|
11324
11348
|
!z.current || !z.current.isEqualNode(E.target) || (E.key === " " || E.key === "Enter" || E.keyCode === 32 || E.keyCode === 13) && (E.preventDefault(), I());
|
|
11325
|
-
}, [z, I]), dt =
|
|
11349
|
+
}, [z, I]), dt = je(function() {
|
|
11326
11350
|
ue({
|
|
11327
11351
|
type: "focus"
|
|
11328
11352
|
});
|
|
11329
|
-
}, []), At =
|
|
11353
|
+
}, []), At = je(function() {
|
|
11330
11354
|
ue({
|
|
11331
11355
|
type: "blur"
|
|
11332
11356
|
});
|
|
11333
|
-
}, []), vn =
|
|
11357
|
+
}, []), vn = je(function() {
|
|
11334
11358
|
C || (Yf() ? setTimeout(I, 0) : I());
|
|
11335
11359
|
}, [C, I]), Ft = function(T) {
|
|
11336
11360
|
return n ? null : T;
|
|
@@ -11339,29 +11363,29 @@ function Sl() {
|
|
|
11339
11363
|
}, Yt = function(T) {
|
|
11340
11364
|
return M ? null : Ft(T);
|
|
11341
11365
|
}, g = function(T) {
|
|
11342
|
-
|
|
11343
|
-
}, S =
|
|
11366
|
+
Y && T.stopPropagation();
|
|
11367
|
+
}, S = Ve(function() {
|
|
11344
11368
|
return function() {
|
|
11345
|
-
var E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, T = E.refKey,
|
|
11346
|
-
return
|
|
11347
|
-
onKeyDown: xn(mt(le,
|
|
11348
|
-
onFocus: xn(mt(
|
|
11369
|
+
var E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, T = E.refKey, U = T === void 0 ? "ref" : T, ae = E.role, le = E.onKeyDown, Ie = E.onFocus, at = E.onBlur, et = E.onClick, Br = E.onDragEnter, Zt = E.onDragOver, $t = E.onDragLeave, Ur = E.onDrop, gr = ei(E, im);
|
|
11370
|
+
return Oe(Oe(ra({
|
|
11371
|
+
onKeyDown: xn(mt(le, ke)),
|
|
11372
|
+
onFocus: xn(mt(Ie, dt)),
|
|
11349
11373
|
onBlur: xn(mt(at, At)),
|
|
11350
11374
|
onClick: Ft(mt(et, vn)),
|
|
11351
|
-
onDragEnter: Yt(mt(Br,
|
|
11375
|
+
onDragEnter: Yt(mt(Br, ee)),
|
|
11352
11376
|
onDragOver: Yt(mt(Zt, R)),
|
|
11353
|
-
onDragLeave: Yt(mt($t,
|
|
11354
|
-
onDrop: Yt(mt(Ur,
|
|
11355
|
-
role: typeof
|
|
11356
|
-
},
|
|
11377
|
+
onDragLeave: Yt(mt($t, G)),
|
|
11378
|
+
onDrop: Yt(mt(Ur, ie)),
|
|
11379
|
+
role: typeof ae == "string" && ae !== "" ? ae : "presentation"
|
|
11380
|
+
}, U, z), !n && !w ? {
|
|
11357
11381
|
tabIndex: 0
|
|
11358
11382
|
} : {}), gr);
|
|
11359
11383
|
};
|
|
11360
|
-
}, [z,
|
|
11384
|
+
}, [z, ke, dt, At, vn, ee, R, G, ie, w, M, n]), A = je(function(E) {
|
|
11361
11385
|
E.stopPropagation();
|
|
11362
|
-
}, []),
|
|
11386
|
+
}, []), Q = Ve(function() {
|
|
11363
11387
|
return function() {
|
|
11364
|
-
var E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, T = E.refKey,
|
|
11388
|
+
var E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, T = E.refKey, U = T === void 0 ? "ref" : T, ae = E.onChange, le = E.onClick, Ie = ei(E, am), at = ra({
|
|
11365
11389
|
accept: u,
|
|
11366
11390
|
multiple: o,
|
|
11367
11391
|
type: "file",
|
|
@@ -11377,54 +11401,54 @@ function Sl() {
|
|
|
11377
11401
|
width: "1px",
|
|
11378
11402
|
whiteSpace: "nowrap"
|
|
11379
11403
|
},
|
|
11380
|
-
onChange: Ft(mt(
|
|
11404
|
+
onChange: Ft(mt(ae, ie)),
|
|
11381
11405
|
onClick: Ft(mt(le, A)),
|
|
11382
11406
|
tabIndex: -1
|
|
11383
|
-
},
|
|
11384
|
-
return
|
|
11407
|
+
}, U, N);
|
|
11408
|
+
return Oe(Oe({}, at), Ie);
|
|
11385
11409
|
};
|
|
11386
|
-
}, [
|
|
11387
|
-
return
|
|
11410
|
+
}, [N, r, o, ie, n]);
|
|
11411
|
+
return Oe(Oe({}, ce), {}, {
|
|
11388
11412
|
isFocused: j && !n,
|
|
11389
11413
|
getRootProps: S,
|
|
11390
|
-
getInputProps:
|
|
11414
|
+
getInputProps: Q,
|
|
11391
11415
|
rootRef: z,
|
|
11392
|
-
inputRef:
|
|
11416
|
+
inputRef: N,
|
|
11393
11417
|
open: Ft(I)
|
|
11394
11418
|
});
|
|
11395
11419
|
}
|
|
11396
11420
|
function mm(e, t) {
|
|
11397
11421
|
switch (t.type) {
|
|
11398
11422
|
case "focus":
|
|
11399
|
-
return
|
|
11423
|
+
return Oe(Oe({}, e), {}, {
|
|
11400
11424
|
isFocused: !0
|
|
11401
11425
|
});
|
|
11402
11426
|
case "blur":
|
|
11403
|
-
return
|
|
11427
|
+
return Oe(Oe({}, e), {}, {
|
|
11404
11428
|
isFocused: !1
|
|
11405
11429
|
});
|
|
11406
11430
|
case "openDialog":
|
|
11407
|
-
return
|
|
11431
|
+
return Oe(Oe({}, na), {}, {
|
|
11408
11432
|
isFileDialogActive: !0
|
|
11409
11433
|
});
|
|
11410
11434
|
case "closeDialog":
|
|
11411
|
-
return
|
|
11435
|
+
return Oe(Oe({}, e), {}, {
|
|
11412
11436
|
isFileDialogActive: !1
|
|
11413
11437
|
});
|
|
11414
11438
|
case "setDraggedFiles":
|
|
11415
|
-
return
|
|
11439
|
+
return Oe(Oe({}, e), {}, {
|
|
11416
11440
|
isDragActive: t.isDragActive,
|
|
11417
11441
|
isDragAccept: t.isDragAccept,
|
|
11418
11442
|
isDragReject: t.isDragReject
|
|
11419
11443
|
});
|
|
11420
11444
|
case "setFiles":
|
|
11421
|
-
return
|
|
11445
|
+
return Oe(Oe({}, e), {}, {
|
|
11422
11446
|
acceptedFiles: t.acceptedFiles,
|
|
11423
11447
|
fileRejections: t.fileRejections,
|
|
11424
11448
|
isDragReject: t.isDragReject
|
|
11425
11449
|
});
|
|
11426
11450
|
case "reset":
|
|
11427
|
-
return
|
|
11451
|
+
return Oe({}, na);
|
|
11428
11452
|
default:
|
|
11429
11453
|
return e;
|
|
11430
11454
|
}
|
|
@@ -11449,7 +11473,7 @@ const hm = ({
|
|
|
11449
11473
|
const s = 1024, o = ["Bytes", "KB", "MB", "GB"], l = Math.floor(Math.log(a) / Math.log(s));
|
|
11450
11474
|
return parseFloat((a / Math.pow(s, l)).toFixed(2)) + " " + o[l];
|
|
11451
11475
|
};
|
|
11452
|
-
return /* @__PURE__ */
|
|
11476
|
+
return /* @__PURE__ */ Te(
|
|
11453
11477
|
ao,
|
|
11454
11478
|
{
|
|
11455
11479
|
sx: {
|
|
@@ -11461,13 +11485,13 @@ const hm = ({
|
|
|
11461
11485
|
border: "1px solid #e0e0e0"
|
|
11462
11486
|
},
|
|
11463
11487
|
children: [
|
|
11464
|
-
/* @__PURE__ */
|
|
11488
|
+
/* @__PURE__ */ Te(Se, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
11465
11489
|
r(),
|
|
11466
11490
|
n()
|
|
11467
11491
|
] }),
|
|
11468
|
-
/* @__PURE__ */
|
|
11469
|
-
/* @__PURE__ */ $(
|
|
11470
|
-
/* @__PURE__ */
|
|
11492
|
+
/* @__PURE__ */ Te(Se, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
11493
|
+
/* @__PURE__ */ $(ze, { variant: "body2", noWrap: !0, children: e.file.name }),
|
|
11494
|
+
/* @__PURE__ */ Te(ze, { variant: "caption", color: "textSecondary", children: [
|
|
11471
11495
|
i(e.file.size),
|
|
11472
11496
|
" • ",
|
|
11473
11497
|
e.file.type
|
|
@@ -11498,33 +11522,33 @@ const hm = ({
|
|
|
11498
11522
|
wt(() => {
|
|
11499
11523
|
l(t);
|
|
11500
11524
|
}, [t]);
|
|
11501
|
-
const O =
|
|
11525
|
+
const O = je((k) => e.fileTypes.some((z) => {
|
|
11502
11526
|
if (z.includes("*")) {
|
|
11503
|
-
const
|
|
11504
|
-
return k.type.startsWith(
|
|
11527
|
+
const N = z.split("/")[0];
|
|
11528
|
+
return k.type.startsWith(N);
|
|
11505
11529
|
}
|
|
11506
11530
|
return k.type === z;
|
|
11507
|
-
}) ? e.maxSize && k.size > e.maxSize ? `File size exceeds maximum limit of ${(e.maxSize / 1048576).toFixed(1)}MB` : null : `File type ${k.type} is not allowed. Allowed types: ${e.fileTypes.join(", ")}`, [e]), F =
|
|
11531
|
+
}) ? e.maxSize && k.size > e.maxSize ? `File size exceeds maximum limit of ${(e.maxSize / 1048576).toFixed(1)}MB` : null : `File type ${k.type} is not allowed. Allowed types: ${e.fileTypes.join(", ")}`, [e]), F = je(async (k) => {
|
|
11508
11532
|
console.log("handleFiles called with:", k.length, "files"), m(!0);
|
|
11509
11533
|
const P = [], z = [];
|
|
11510
11534
|
try {
|
|
11511
11535
|
for (const L of k) {
|
|
11512
|
-
let
|
|
11536
|
+
let oe = null;
|
|
11513
11537
|
if (e.multiple && o.some(
|
|
11514
11538
|
(ue) => ue.file.name === L.name && ue.file.size === L.size && ue.file.lastModified === L.lastModified
|
|
11515
11539
|
)) {
|
|
11516
11540
|
z.push(`${L.name}: File already exists`);
|
|
11517
11541
|
continue;
|
|
11518
11542
|
}
|
|
11519
|
-
if (
|
|
11543
|
+
if (oe = O(L), !oe && e.customValidation)
|
|
11520
11544
|
try {
|
|
11521
11545
|
const ce = e.customValidation(L);
|
|
11522
|
-
ce instanceof Promise ?
|
|
11546
|
+
ce instanceof Promise ? oe = await ce : oe = ce;
|
|
11523
11547
|
} catch (ce) {
|
|
11524
|
-
|
|
11548
|
+
oe = `Custom validation failed: ${ce instanceof Error ? ce.message : "Unknown error"}`;
|
|
11525
11549
|
}
|
|
11526
|
-
if (
|
|
11527
|
-
z.push(`${L.name}: ${
|
|
11550
|
+
if (oe)
|
|
11551
|
+
z.push(`${L.name}: ${oe}`);
|
|
11528
11552
|
else {
|
|
11529
11553
|
const ce = {
|
|
11530
11554
|
id: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
@@ -11537,17 +11561,17 @@ const hm = ({
|
|
|
11537
11561
|
P.push(ce);
|
|
11538
11562
|
}
|
|
11539
11563
|
}
|
|
11540
|
-
const
|
|
11541
|
-
l(
|
|
11542
|
-
} catch (
|
|
11543
|
-
const L = `Unexpected error: ${
|
|
11564
|
+
const N = e.multiple ? [...o, ...P] : P;
|
|
11565
|
+
l(N), r == null || r(N), z.length > 0 ? (x(z), d(z)) : (x([]), d([]));
|
|
11566
|
+
} catch (N) {
|
|
11567
|
+
const L = `Unexpected error: ${N instanceof Error ? N.message : "Unknown error"}`;
|
|
11544
11568
|
x([L]), d([L]);
|
|
11545
11569
|
}
|
|
11546
|
-
}, [o, e.multiple, O, e.customValidation, r]), C =
|
|
11570
|
+
}, [o, e.multiple, O, e.customValidation, r]), C = je((k) => {
|
|
11547
11571
|
m(!0);
|
|
11548
11572
|
const P = o.filter((z) => z.id !== k);
|
|
11549
11573
|
l(P), r == null || r(P), x([]), y.current && (y.current.value = "");
|
|
11550
|
-
}, [o, r]), w =
|
|
11574
|
+
}, [o, r]), w = je(() => {
|
|
11551
11575
|
if (e.required && o.length === 0) {
|
|
11552
11576
|
d([`${e.title} is required`]);
|
|
11553
11577
|
return;
|
|
@@ -11555,13 +11579,13 @@ const hm = ({
|
|
|
11555
11579
|
x([]), h(!0);
|
|
11556
11580
|
const k = o.filter((P) => P.status !== "error");
|
|
11557
11581
|
n == null || n(k);
|
|
11558
|
-
}, [o, n, e.required, e.title]), { getRootProps: M, getInputProps:
|
|
11582
|
+
}, [o, n, e.required, e.title]), { getRootProps: M, getInputProps: Y, isDragActive: X } = Sl({
|
|
11559
11583
|
onDrop: F,
|
|
11560
11584
|
multiple: e.multiple,
|
|
11561
11585
|
disabled: i,
|
|
11562
11586
|
noClick: !1,
|
|
11563
11587
|
noKeyboard: !1
|
|
11564
|
-
}),
|
|
11588
|
+
}), K = (k) => k.startsWith("image/") ? /* @__PURE__ */ $(dl, {}) : k.includes("pdf") ? /* @__PURE__ */ $(Zn, {}) : /* @__PURE__ */ $(Zn, {}), u = e.fileTypes.map((k) => k.replace("*", "all")).join(", ");
|
|
11565
11589
|
wt(() => {
|
|
11566
11590
|
if (!f) return;
|
|
11567
11591
|
const k = [], P = [...c, ...k];
|
|
@@ -11580,12 +11604,12 @@ const hm = ({
|
|
|
11580
11604
|
return "flex-end";
|
|
11581
11605
|
}
|
|
11582
11606
|
};
|
|
11583
|
-
return /* @__PURE__ */
|
|
11584
|
-
/* @__PURE__ */
|
|
11607
|
+
return /* @__PURE__ */ Te(Se, { className: a, style: s, children: [
|
|
11608
|
+
/* @__PURE__ */ Te(ze, { variant: "h6", gutterBottom: !0, children: [
|
|
11585
11609
|
e.title,
|
|
11586
11610
|
e.required && /* @__PURE__ */ $("span", { style: { color: "red" }, children: " *" })
|
|
11587
11611
|
] }),
|
|
11588
|
-
e.description && /* @__PURE__ */ $(
|
|
11612
|
+
e.description && /* @__PURE__ */ $(ze, { variant: "body2", color: "textSecondary", gutterBottom: !0, children: e.description }),
|
|
11589
11613
|
/* @__PURE__ */ io(
|
|
11590
11614
|
ao,
|
|
11591
11615
|
{
|
|
@@ -11593,8 +11617,8 @@ const hm = ({
|
|
|
11593
11617
|
key: `dropzone-${o.length}`,
|
|
11594
11618
|
sx: {
|
|
11595
11619
|
border: "2px dashed",
|
|
11596
|
-
borderColor:
|
|
11597
|
-
backgroundColor:
|
|
11620
|
+
borderColor: X ? "primary.main" : "grey.300",
|
|
11621
|
+
backgroundColor: X ? "action.hover" : "background.paper",
|
|
11598
11622
|
p: 3,
|
|
11599
11623
|
textAlign: "center",
|
|
11600
11624
|
cursor: i ? "not-allowed" : "pointer",
|
|
@@ -11605,10 +11629,10 @@ const hm = ({
|
|
|
11605
11629
|
}
|
|
11606
11630
|
}
|
|
11607
11631
|
},
|
|
11608
|
-
/* @__PURE__ */ $("input", { ...
|
|
11632
|
+
/* @__PURE__ */ $("input", { ...Y(), ref: y }),
|
|
11609
11633
|
/* @__PURE__ */ $(vf, { sx: { fontSize: 48, color: "text.secondary", mb: 2 } }),
|
|
11610
|
-
/* @__PURE__ */ $(
|
|
11611
|
-
/* @__PURE__ */
|
|
11634
|
+
/* @__PURE__ */ $(ze, { variant: "h6", gutterBottom: !0, children: X ? "Drop files here" : "Drag & drop files here" }),
|
|
11635
|
+
/* @__PURE__ */ Te(ze, { variant: "body2", color: "textSecondary", gutterBottom: !0, children: [
|
|
11612
11636
|
"or ",
|
|
11613
11637
|
/* @__PURE__ */ $(
|
|
11614
11638
|
Bt,
|
|
@@ -11623,11 +11647,11 @@ const hm = ({
|
|
|
11623
11647
|
}
|
|
11624
11648
|
)
|
|
11625
11649
|
] }),
|
|
11626
|
-
/* @__PURE__ */
|
|
11650
|
+
/* @__PURE__ */ Te(Se, { sx: { mt: 2 }, children: [
|
|
11627
11651
|
/* @__PURE__ */ $(
|
|
11628
11652
|
zn,
|
|
11629
11653
|
{
|
|
11630
|
-
icon:
|
|
11654
|
+
icon: K(e.fileTypes[0]),
|
|
11631
11655
|
label: `Accepted: ${u}`,
|
|
11632
11656
|
variant: "outlined",
|
|
11633
11657
|
size: "small"
|
|
@@ -11644,9 +11668,9 @@ const hm = ({
|
|
|
11644
11668
|
)
|
|
11645
11669
|
] })
|
|
11646
11670
|
),
|
|
11647
|
-
p.length > 0 && /* @__PURE__ */ $(Ll, { severity: "error", sx: { mt: 2 }, children: p.map((k, P) => /* @__PURE__ */ $(
|
|
11648
|
-
o.length > 0 && /* @__PURE__ */
|
|
11649
|
-
/* @__PURE__ */
|
|
11671
|
+
p.length > 0 && /* @__PURE__ */ $(Ll, { severity: "error", sx: { mt: 2 }, children: p.map((k, P) => /* @__PURE__ */ $(ze, { variant: "body2", children: k }, P)) }),
|
|
11672
|
+
o.length > 0 && /* @__PURE__ */ Te(Se, { sx: { mt: 2 }, children: [
|
|
11673
|
+
/* @__PURE__ */ Te(ze, { variant: "subtitle1", gutterBottom: !0, children: [
|
|
11650
11674
|
"Selected Files (",
|
|
11651
11675
|
o.length,
|
|
11652
11676
|
")"
|
|
@@ -11660,7 +11684,7 @@ const hm = ({
|
|
|
11660
11684
|
k.id
|
|
11661
11685
|
))
|
|
11662
11686
|
] }),
|
|
11663
|
-
e.helperText && /* @__PURE__ */ $(
|
|
11687
|
+
e.helperText && /* @__PURE__ */ $(ze, { variant: "caption", color: "textSecondary", sx: { mt: 1, display: "block" }, children: e.helperText }),
|
|
11664
11688
|
e.submitButton && /* @__PURE__ */ $(Se, { sx: {
|
|
11665
11689
|
mt: 3,
|
|
11666
11690
|
display: "flex",
|