mlform 0.1.4 → 0.1.5
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 +2 -2
- package/dist/{engine-nnhWPT2L.js → engine-CCDhPk4O.js} +393 -330
- package/dist/{kit-Dt_1Fxlc.js → kit-CtFMUUFf.js} +2 -2
- package/dist/mlform/engine.mjs +2 -2
- package/dist/mlform/kit.mjs +1 -1
- package/dist/mlform/primitives.mjs +1 -1
- package/dist/mlform/questionnaire.mjs +2 -2
- package/dist/mlform.mjs +3 -3
- package/dist/{primitives-Pi-ztAr6.js → primitives-BdyK00g_.js} +1 -1
- package/dist/types/src/engine/builtins/fields/mapped-category.d.ts +12 -0
- package/dist/types/src/engine/builtins/index.d.ts +9 -1
- package/dist/types/src/engine/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -187,7 +187,7 @@ var r = class extends e {
|
|
|
187
187
|
listExplanations() {
|
|
188
188
|
return Array.from(this.explanationDefinitions.values());
|
|
189
189
|
}
|
|
190
|
-
}, S = () => new x(),
|
|
190
|
+
}, S = () => new x(), C = (e) => e, w = (e) => e, te = (e) => e;
|
|
191
191
|
Object.freeze({ status: "aborted" });
|
|
192
192
|
function T(e, t, n) {
|
|
193
193
|
function r(n, r) {
|
|
@@ -285,22 +285,22 @@ function de(e, t, n) {
|
|
|
285
285
|
configurable: !0
|
|
286
286
|
});
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function fe(...e) {
|
|
289
289
|
let t = {};
|
|
290
290
|
for (let n of e) Object.assign(t, Object.getOwnPropertyDescriptors(n));
|
|
291
291
|
return Object.defineProperties({}, t);
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function pe(e) {
|
|
294
294
|
return JSON.stringify(e);
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function me(e) {
|
|
297
297
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
298
298
|
}
|
|
299
|
-
var
|
|
300
|
-
function
|
|
299
|
+
var he = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {};
|
|
300
|
+
function ge(e) {
|
|
301
301
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
302
302
|
}
|
|
303
|
-
var
|
|
303
|
+
var _e = oe(() => {
|
|
304
304
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return !1;
|
|
305
305
|
try {
|
|
306
306
|
return Function(""), !0;
|
|
@@ -308,25 +308,25 @@ var ge = oe(() => {
|
|
|
308
308
|
return !1;
|
|
309
309
|
}
|
|
310
310
|
});
|
|
311
|
-
function
|
|
312
|
-
if (
|
|
311
|
+
function ve(e) {
|
|
312
|
+
if (ge(e) === !1) return !1;
|
|
313
313
|
let t = e.constructor;
|
|
314
314
|
if (t === void 0 || typeof t != "function") return !0;
|
|
315
315
|
let n = t.prototype;
|
|
316
|
-
return !(
|
|
316
|
+
return !(ge(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
return
|
|
318
|
+
function ye(e) {
|
|
319
|
+
return ve(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
320
320
|
}
|
|
321
|
-
var
|
|
321
|
+
var be = new Set([
|
|
322
322
|
"string",
|
|
323
323
|
"number",
|
|
324
324
|
"symbol"
|
|
325
325
|
]);
|
|
326
|
-
function
|
|
326
|
+
function xe(e) {
|
|
327
327
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function k(e, t, n) {
|
|
330
330
|
let r = new e._zod.constr(t ?? e._zod.def);
|
|
331
331
|
return (!t || n?.parent) && (r._zod.parent = e), r;
|
|
332
332
|
}
|
|
@@ -356,7 +356,7 @@ var Ce = {
|
|
|
356
356
|
function we(e, t) {
|
|
357
357
|
let n = e._zod.def, r = n.checks;
|
|
358
358
|
if (r && r.length > 0) throw Error(".pick() cannot be used on object schemas containing refinements");
|
|
359
|
-
return
|
|
359
|
+
return k(e, fe(e._zod.def, {
|
|
360
360
|
get shape() {
|
|
361
361
|
let e = {};
|
|
362
362
|
for (let r in t) {
|
|
@@ -371,7 +371,7 @@ function we(e, t) {
|
|
|
371
371
|
function Te(e, t) {
|
|
372
372
|
let n = e._zod.def, r = n.checks;
|
|
373
373
|
if (r && r.length > 0) throw Error(".omit() cannot be used on object schemas containing refinements");
|
|
374
|
-
return
|
|
374
|
+
return k(e, fe(e._zod.def, {
|
|
375
375
|
get shape() {
|
|
376
376
|
let r = { ...e._zod.def.shape };
|
|
377
377
|
for (let e in t) {
|
|
@@ -384,13 +384,13 @@ function Te(e, t) {
|
|
|
384
384
|
}));
|
|
385
385
|
}
|
|
386
386
|
function Ee(e, t) {
|
|
387
|
-
if (!
|
|
387
|
+
if (!ve(t)) throw Error("Invalid input to extend: expected a plain object");
|
|
388
388
|
let n = e._zod.def.checks;
|
|
389
389
|
if (n && n.length > 0) {
|
|
390
390
|
let n = e._zod.def.shape;
|
|
391
391
|
for (let e in t) if (Object.getOwnPropertyDescriptor(n, e) !== void 0) throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
392
392
|
}
|
|
393
|
-
return
|
|
393
|
+
return k(e, fe(e._zod.def, { get shape() {
|
|
394
394
|
let n = {
|
|
395
395
|
...e._zod.def.shape,
|
|
396
396
|
...t
|
|
@@ -399,8 +399,8 @@ function Ee(e, t) {
|
|
|
399
399
|
} }));
|
|
400
400
|
}
|
|
401
401
|
function De(e, t) {
|
|
402
|
-
if (!
|
|
403
|
-
return
|
|
402
|
+
if (!ve(t)) throw Error("Invalid input to safeExtend: expected a plain object");
|
|
403
|
+
return k(e, fe(e._zod.def, { get shape() {
|
|
404
404
|
let n = {
|
|
405
405
|
...e._zod.def.shape,
|
|
406
406
|
...t
|
|
@@ -409,7 +409,7 @@ function De(e, t) {
|
|
|
409
409
|
} }));
|
|
410
410
|
}
|
|
411
411
|
function Oe(e, t) {
|
|
412
|
-
return
|
|
412
|
+
return k(e, fe(e._zod.def, {
|
|
413
413
|
get shape() {
|
|
414
414
|
let n = {
|
|
415
415
|
...e._zod.def.shape,
|
|
@@ -426,7 +426,7 @@ function Oe(e, t) {
|
|
|
426
426
|
function ke(e, t, n) {
|
|
427
427
|
let r = t._zod.def.checks;
|
|
428
428
|
if (r && r.length > 0) throw Error(".partial() cannot be used on object schemas containing refinements");
|
|
429
|
-
return
|
|
429
|
+
return k(t, fe(t._zod.def, {
|
|
430
430
|
get shape() {
|
|
431
431
|
let r = t._zod.def.shape, i = { ...r };
|
|
432
432
|
if (n) for (let t in n) {
|
|
@@ -446,7 +446,7 @@ function ke(e, t, n) {
|
|
|
446
446
|
}));
|
|
447
447
|
}
|
|
448
448
|
function Ae(e, t, n) {
|
|
449
|
-
return
|
|
449
|
+
return k(t, fe(t._zod.def, { get shape() {
|
|
450
450
|
let r = t._zod.def.shape, i = { ...r };
|
|
451
451
|
if (n) for (let t in n) {
|
|
452
452
|
if (!(t in i)) throw Error(`Unrecognized key: "${t}"`);
|
|
@@ -543,7 +543,7 @@ var Ve = (e) => (t, n, r, i) => {
|
|
|
543
543
|
if (o instanceof Promise) throw new E();
|
|
544
544
|
if (o.issues.length) {
|
|
545
545
|
let t = new (i?.Err ?? e)(o.issues.map((e) => j(e, a, D())));
|
|
546
|
-
throw
|
|
546
|
+
throw he(t, i?.callee), t;
|
|
547
547
|
}
|
|
548
548
|
return o.value;
|
|
549
549
|
}, He = (e) => async (t, n, r, i) => {
|
|
@@ -553,7 +553,7 @@ var Ve = (e) => (t, n, r, i) => {
|
|
|
553
553
|
}, a);
|
|
554
554
|
if (o instanceof Promise && (o = await o), o.issues.length) {
|
|
555
555
|
let t = new (i?.Err ?? e)(o.issues.map((e) => j(e, a, D())));
|
|
556
|
-
throw
|
|
556
|
+
throw he(t, i?.callee), t;
|
|
557
557
|
}
|
|
558
558
|
return o.value;
|
|
559
559
|
}, Ue = (e) => (t, n, r) => {
|
|
@@ -840,7 +840,7 @@ var Tt = (e) => {
|
|
|
840
840
|
t.pattern ??= At, zt.init(e, t);
|
|
841
841
|
}), Ut = /* @__PURE__ */ T("$ZodCheckIncludes", (e, t) => {
|
|
842
842
|
M.init(e, t);
|
|
843
|
-
let n =
|
|
843
|
+
let n = xe(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
844
844
|
t.pattern = r, e._zod.onattach.push((e) => {
|
|
845
845
|
let t = e._zod.bag;
|
|
846
846
|
t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r);
|
|
@@ -857,7 +857,7 @@ var Tt = (e) => {
|
|
|
857
857
|
};
|
|
858
858
|
}), Wt = /* @__PURE__ */ T("$ZodCheckStartsWith", (e, t) => {
|
|
859
859
|
M.init(e, t);
|
|
860
|
-
let n = RegExp(`^${
|
|
860
|
+
let n = RegExp(`^${xe(t.prefix)}.*`);
|
|
861
861
|
t.pattern ??= n, e._zod.onattach.push((e) => {
|
|
862
862
|
let t = e._zod.bag;
|
|
863
863
|
t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
|
|
@@ -874,7 +874,7 @@ var Tt = (e) => {
|
|
|
874
874
|
};
|
|
875
875
|
}), Gt = /* @__PURE__ */ T("$ZodCheckEndsWith", (e, t) => {
|
|
876
876
|
M.init(e, t);
|
|
877
|
-
let n = RegExp(`.*${
|
|
877
|
+
let n = RegExp(`.*${xe(t.suffix)}$`);
|
|
878
878
|
t.pattern ??= n, e._zod.onattach.push((e) => {
|
|
879
879
|
let t = e._zod.bag;
|
|
880
880
|
t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
|
|
@@ -1296,7 +1296,7 @@ var Nn = /* @__PURE__ */ T("$ZodObject", (e, t) => {
|
|
|
1296
1296
|
}
|
|
1297
1297
|
return n;
|
|
1298
1298
|
});
|
|
1299
|
-
let r =
|
|
1299
|
+
let r = ge, i = t.catchall, a;
|
|
1300
1300
|
e._zod.parse = (t, o) => {
|
|
1301
1301
|
a ??= n.value;
|
|
1302
1302
|
let s = t.value;
|
|
@@ -1325,7 +1325,7 @@ var Nn = /* @__PURE__ */ T("$ZodObject", (e, t) => {
|
|
|
1325
1325
|
"payload",
|
|
1326
1326
|
"ctx"
|
|
1327
1327
|
]), n = r.value, i = (e) => {
|
|
1328
|
-
let t =
|
|
1328
|
+
let t = pe(e);
|
|
1329
1329
|
return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`;
|
|
1330
1330
|
};
|
|
1331
1331
|
t.write("const input = payload.value;");
|
|
@@ -1333,7 +1333,7 @@ var Nn = /* @__PURE__ */ T("$ZodObject", (e, t) => {
|
|
|
1333
1333
|
for (let e of n.keys) a[e] = `key_${o++}`;
|
|
1334
1334
|
t.write("const newResult = {};");
|
|
1335
1335
|
for (let r of n.keys) {
|
|
1336
|
-
let n = a[r], o =
|
|
1336
|
+
let n = a[r], o = pe(r), s = e[r]?._zod?.optout === "optional";
|
|
1337
1337
|
t.write(`const ${n} = ${i(r)};`), s ? t.write(`
|
|
1338
1338
|
if (${n}.issues.length) {
|
|
1339
1339
|
if (${o} in input) {
|
|
@@ -1373,7 +1373,7 @@ var Nn = /* @__PURE__ */ T("$ZodObject", (e, t) => {
|
|
|
1373
1373
|
t.write("payload.value = newResult;"), t.write("return payload;");
|
|
1374
1374
|
let s = t.compile();
|
|
1375
1375
|
return (t, n) => s(e, t, n);
|
|
1376
|
-
}, a, o =
|
|
1376
|
+
}, a, o = ge, s = !re.jitless, c = s && _e.value, l = t.catchall, u;
|
|
1377
1377
|
e._zod.parse = (d, f) => {
|
|
1378
1378
|
u ??= r.value;
|
|
1379
1379
|
let p = d.value;
|
|
@@ -1438,7 +1438,7 @@ function Rn(e, t) {
|
|
|
1438
1438
|
valid: !0,
|
|
1439
1439
|
data: e
|
|
1440
1440
|
};
|
|
1441
|
-
if (
|
|
1441
|
+
if (ve(e) && ve(t)) {
|
|
1442
1442
|
let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = {
|
|
1443
1443
|
...e,
|
|
1444
1444
|
...t
|
|
@@ -1500,7 +1500,7 @@ function zn(e, t, n) {
|
|
|
1500
1500
|
var Bn = /* @__PURE__ */ T("$ZodRecord", (e, t) => {
|
|
1501
1501
|
N.init(e, t), e._zod.parse = (n, r) => {
|
|
1502
1502
|
let i = n.value;
|
|
1503
|
-
if (!
|
|
1503
|
+
if (!ve(i)) return n.issues.push({
|
|
1504
1504
|
expected: "record",
|
|
1505
1505
|
code: "invalid_type",
|
|
1506
1506
|
input: i,
|
|
@@ -1570,7 +1570,7 @@ var Bn = /* @__PURE__ */ T("$ZodRecord", (e, t) => {
|
|
|
1570
1570
|
}), Vn = /* @__PURE__ */ T("$ZodEnum", (e, t) => {
|
|
1571
1571
|
N.init(e, t);
|
|
1572
1572
|
let n = ie(t.entries), r = new Set(n);
|
|
1573
|
-
e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) =>
|
|
1573
|
+
e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) => be.has(typeof e)).map((e) => typeof e == "string" ? xe(e) : e.toString()).join("|")})$`), e._zod.parse = (t, i) => {
|
|
1574
1574
|
let a = t.value;
|
|
1575
1575
|
return r.has(a) || t.issues.push({
|
|
1576
1576
|
code: "invalid_value",
|
|
@@ -1582,7 +1582,7 @@ var Bn = /* @__PURE__ */ T("$ZodRecord", (e, t) => {
|
|
|
1582
1582
|
}), Hn = /* @__PURE__ */ T("$ZodLiteral", (e, t) => {
|
|
1583
1583
|
if (N.init(e, t), t.values.length === 0) throw Error("Cannot create literal schema with no valid values");
|
|
1584
1584
|
let n = new Set(t.values);
|
|
1585
|
-
e._zod.values = n, e._zod.pattern = RegExp(`^(${t.values.map((e) => typeof e == "string" ?
|
|
1585
|
+
e._zod.values = n, e._zod.pattern = RegExp(`^(${t.values.map((e) => typeof e == "string" ? xe(e) : e ? xe(e.toString()) : String(e)).join("|")})$`), e._zod.parse = (r, i) => {
|
|
1586
1586
|
let a = r.value;
|
|
1587
1587
|
return n.has(a) || r.issues.push({
|
|
1588
1588
|
code: "invalid_value",
|
|
@@ -2207,7 +2207,7 @@ function si() {
|
|
|
2207
2207
|
}
|
|
2208
2208
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2209
2209
|
function ci() {
|
|
2210
|
-
return /* @__PURE__ */ ri((e) =>
|
|
2210
|
+
return /* @__PURE__ */ ri((e) => me(e));
|
|
2211
2211
|
}
|
|
2212
2212
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2213
2213
|
function li(e, t, n) {
|
|
@@ -2692,11 +2692,11 @@ T("ZodError", Xi);
|
|
|
2692
2692
|
var L = T("ZodError", Xi, { Parent: Error }), Zi = /* @__PURE__ */ Ve(L), Qi = /* @__PURE__ */ He(L), $i = /* @__PURE__ */ Ue(L), ea = /* @__PURE__ */ Ge(L), ta = /* @__PURE__ */ qe(L), na = /* @__PURE__ */ Je(L), ra = /* @__PURE__ */ Ye(L), ia = /* @__PURE__ */ Xe(L), aa = /* @__PURE__ */ Ze(L), oa = /* @__PURE__ */ Qe(L), sa = /* @__PURE__ */ $e(L), ca = /* @__PURE__ */ et(L), R = /* @__PURE__ */ T("ZodType", (e, t) => (N.init(e, t), Object.assign(e["~standard"], { jsonSchema: {
|
|
2693
2693
|
input: vi(e, "input"),
|
|
2694
2694
|
output: vi(e, "output")
|
|
2695
|
-
} }), e.toJSONSchema = _i(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(
|
|
2695
|
+
} }), e.toJSONSchema = _i(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(fe(t, { checks: [...t.checks ?? [], ...n.map((e) => typeof e == "function" ? { _zod: {
|
|
2696
2696
|
check: e,
|
|
2697
2697
|
def: { check: "custom" },
|
|
2698
2698
|
onattach: []
|
|
2699
|
-
} } : e)] }), { parent: !0 }), e.with = e.check, e.clone = (t, n) =>
|
|
2699
|
+
} } : e)] }), { parent: !0 }), e.with = e.check, e.clone = (t, n) => k(e, t, n), e.brand = () => e, e.register = ((t, n) => (t.add(e, n), e)), e.parse = (t, n) => Zi(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => $i(e, t, n), e.parseAsync = async (t, n) => Qi(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => ea(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n) => ta(e, t, n), e.decode = (t, n) => na(e, t, n), e.encodeAsync = async (t, n) => ra(e, t, n), e.decodeAsync = async (t, n) => ia(e, t, n), e.safeEncode = (t, n) => aa(e, t, n), e.safeDecode = (t, n) => oa(e, t, n), e.safeEncodeAsync = async (t, n) => sa(e, t, n), e.safeDecodeAsync = async (t, n) => ca(e, t, n), e.refine = (t, n) => e.check(yo(t, n)), e.superRefine = (t) => e.check(bo(t)), e.overwrite = (t) => e.check(/* @__PURE__ */ ri(t)), e.optional = () => Za(e), e.exactOptional = () => $a(e), e.nullable = () => to(e), e.nullish = () => Za(to(e)), e.nonoptional = (t) => so(e, t), e.array = () => W(e), e.or = (t) => Ba([e, t]), e.and = (t) => Ha(e, t), e.transform = (t) => fo(e, Ya(t)), e.default = (t) => ro(e, t), e.prefault = (t) => ao(e, t), e.catch = (t) => lo(e, t), e.pipe = (t) => fo(e, t), e.readonly = () => mo(e), e.describe = (t) => {
|
|
2700
2700
|
let n = e.clone();
|
|
2701
2701
|
return ur.add(n, { description: t }), n;
|
|
2702
2702
|
}, Object.defineProperty(e, "description", {
|
|
@@ -2952,7 +2952,7 @@ function ro(e, t) {
|
|
|
2952
2952
|
type: "default",
|
|
2953
2953
|
innerType: e,
|
|
2954
2954
|
get defaultValue() {
|
|
2955
|
-
return typeof t == "function" ? t() :
|
|
2955
|
+
return typeof t == "function" ? t() : ye(t);
|
|
2956
2956
|
}
|
|
2957
2957
|
});
|
|
2958
2958
|
}
|
|
@@ -2964,7 +2964,7 @@ function ao(e, t) {
|
|
|
2964
2964
|
type: "prefault",
|
|
2965
2965
|
innerType: e,
|
|
2966
2966
|
get defaultValue() {
|
|
2967
|
-
return typeof t == "function" ? t() :
|
|
2967
|
+
return typeof t == "function" ? t() : ye(t);
|
|
2968
2968
|
}
|
|
2969
2969
|
});
|
|
2970
2970
|
}
|
|
@@ -3214,21 +3214,52 @@ var xo = {
|
|
|
3214
3214
|
errors: t.state.errors
|
|
3215
3215
|
});
|
|
3216
3216
|
}
|
|
3217
|
-
}, Po = (
|
|
3217
|
+
}, Po = G({
|
|
3218
|
+
label: z(),
|
|
3219
|
+
value: z(),
|
|
3220
|
+
mapping: Wa(z(), U())
|
|
3221
|
+
}), Fo = {
|
|
3222
|
+
kind: "mapped-category",
|
|
3223
|
+
schema: G({
|
|
3224
|
+
kind: K("mapped-category"),
|
|
3225
|
+
...J,
|
|
3226
|
+
options: W(Po).min(1)
|
|
3227
|
+
}),
|
|
3228
|
+
getDefaultValue(e) {
|
|
3229
|
+
return typeof e.defaultValue == "string" ? e.defaultValue : null;
|
|
3230
|
+
},
|
|
3231
|
+
normalizeValue(e) {
|
|
3232
|
+
return e == null || e === "" ? null : typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" ? `${e}` : null;
|
|
3233
|
+
},
|
|
3234
|
+
validate(e, t) {
|
|
3235
|
+
return e === null || t.options.map((e) => e.value).includes(e) ? [] : [q.categoryOptionMismatch];
|
|
3236
|
+
},
|
|
3237
|
+
describe(e, t) {
|
|
3238
|
+
return Y("category-field", e, {
|
|
3239
|
+
value: t.state.value,
|
|
3240
|
+
options: e.options.map((e) => ({
|
|
3241
|
+
label: e.label,
|
|
3242
|
+
value: e.value
|
|
3243
|
+
})),
|
|
3244
|
+
state: t.state.status,
|
|
3245
|
+
errors: t.state.errors
|
|
3246
|
+
});
|
|
3247
|
+
}
|
|
3248
|
+
}, Io = (e) => e.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "item", X = (e) => typeof e == "object" && !!e && !Array.isArray(e), Lo = (e) => typeof e == "object" && !!e || typeof e == "function", Ro = (e) => Lo(e) && "then" in e && typeof e.then == "function", zo = (e) => e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : e instanceof Date ? Number.isNaN(e.getTime()) : !1, Bo = (e) => {
|
|
3218
3249
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : e;
|
|
3219
3250
|
if (typeof e == "string" || typeof e == "number") {
|
|
3220
3251
|
let t = new Date(e);
|
|
3221
3252
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
3222
3253
|
}
|
|
3223
3254
|
return null;
|
|
3224
|
-
},
|
|
3255
|
+
}, Vo = (e) => e, Ho = (e) => {
|
|
3225
3256
|
let t = typeof ArrayBuffer < "u" && ArrayBuffer.isView(e), n = typeof ArrayBuffer < "u" && e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer, r = typeof Blob < "u" && e instanceof Blob || typeof File < "u" && e instanceof File;
|
|
3226
3257
|
if (e !== null && (typeof e == "object" || typeof e == "function") && !t && !n && !r && !Object.isFrozen(e)) {
|
|
3227
3258
|
Object.freeze(e);
|
|
3228
|
-
for (let t of Object.values(e))
|
|
3259
|
+
for (let t of Object.values(e)) Ho(t);
|
|
3229
3260
|
}
|
|
3230
3261
|
return e;
|
|
3231
|
-
},
|
|
3262
|
+
}, Uo = (e, t) => e <= 0 ? Promise.resolve() : new Promise((n, r) => {
|
|
3232
3263
|
let i = setTimeout(() => {
|
|
3233
3264
|
t?.removeEventListener("abort", a), n();
|
|
3234
3265
|
}, e), a = () => {
|
|
@@ -3239,7 +3270,7 @@ var xo = {
|
|
|
3239
3270
|
return;
|
|
3240
3271
|
}
|
|
3241
3272
|
t?.addEventListener("abort", a, { once: !0 });
|
|
3242
|
-
}),
|
|
3273
|
+
}), Wo = {
|
|
3243
3274
|
kind: "date",
|
|
3244
3275
|
schema: G({
|
|
3245
3276
|
kind: K("date"),
|
|
@@ -3249,16 +3280,16 @@ var xo = {
|
|
|
3249
3280
|
step: V().positive().optional()
|
|
3250
3281
|
}),
|
|
3251
3282
|
getDefaultValue(e) {
|
|
3252
|
-
return
|
|
3283
|
+
return Bo(e.defaultValue) ?? null;
|
|
3253
3284
|
},
|
|
3254
3285
|
normalizeValue(e) {
|
|
3255
|
-
return
|
|
3286
|
+
return Bo(e);
|
|
3256
3287
|
},
|
|
3257
3288
|
serializeValue(e) {
|
|
3258
3289
|
return e instanceof Date ? e.toISOString() : e;
|
|
3259
3290
|
},
|
|
3260
3291
|
validate(e, t) {
|
|
3261
|
-
let n = [], r =
|
|
3292
|
+
let n = [], r = Bo(t.min), i = Bo(t.max);
|
|
3262
3293
|
if (r && i && r.getTime() > i.getTime() && n.push(q.invalidDateRange), e === null) return n;
|
|
3263
3294
|
if (r && e.getTime() < r.getTime() && n.push(q.dateOnOrAfter(String(t.min))), i && e.getTime() > i.getTime() && n.push(q.dateOnOrBefore(String(t.max))), t.step !== void 0) {
|
|
3264
3295
|
let i = r ?? /* @__PURE__ */ new Date("1970-01-01T00:00:00Z");
|
|
@@ -3276,7 +3307,7 @@ var xo = {
|
|
|
3276
3307
|
errors: t.state.errors
|
|
3277
3308
|
});
|
|
3278
3309
|
}
|
|
3279
|
-
},
|
|
3310
|
+
}, Go = {
|
|
3280
3311
|
kind: "long-text",
|
|
3281
3312
|
schema: G({
|
|
3282
3313
|
kind: K("long-text"),
|
|
@@ -3307,7 +3338,7 @@ var xo = {
|
|
|
3307
3338
|
errors: t.state.errors
|
|
3308
3339
|
});
|
|
3309
3340
|
}
|
|
3310
|
-
},
|
|
3341
|
+
}, Ko = {
|
|
3311
3342
|
kind: "multi-choice",
|
|
3312
3343
|
schema: G({
|
|
3313
3344
|
kind: K("multi-choice"),
|
|
@@ -3341,7 +3372,7 @@ var xo = {
|
|
|
3341
3372
|
errors: t.state.errors
|
|
3342
3373
|
});
|
|
3343
3374
|
}
|
|
3344
|
-
},
|
|
3375
|
+
}, qo = {
|
|
3345
3376
|
kind: "number",
|
|
3346
3377
|
schema: G({
|
|
3347
3378
|
kind: K("number"),
|
|
@@ -3391,7 +3422,7 @@ var xo = {
|
|
|
3391
3422
|
errors: t.state.errors
|
|
3392
3423
|
});
|
|
3393
3424
|
}
|
|
3394
|
-
},
|
|
3425
|
+
}, Jo = {
|
|
3395
3426
|
kind: "rating",
|
|
3396
3427
|
schema: G({
|
|
3397
3428
|
kind: K("rating"),
|
|
@@ -3423,7 +3454,7 @@ var xo = {
|
|
|
3423
3454
|
errors: t.state.errors
|
|
3424
3455
|
});
|
|
3425
3456
|
}
|
|
3426
|
-
},
|
|
3457
|
+
}, Yo = {
|
|
3427
3458
|
kind: "text",
|
|
3428
3459
|
schema: G({
|
|
3429
3460
|
kind: K("text"),
|
|
@@ -3454,16 +3485,16 @@ var xo = {
|
|
|
3454
3485
|
errors: t.state.errors
|
|
3455
3486
|
});
|
|
3456
3487
|
}
|
|
3457
|
-
},
|
|
3488
|
+
}, Xo = G({
|
|
3458
3489
|
kind: z().min(1),
|
|
3459
3490
|
label: z().min(1),
|
|
3460
3491
|
required: H().optional()
|
|
3461
|
-
}).passthrough(),
|
|
3462
|
-
text:
|
|
3463
|
-
number:
|
|
3464
|
-
date:
|
|
3492
|
+
}).passthrough(), Zo = "This field is required.", Qo = (e) => e.toISOString().slice(0, 10), $o = {
|
|
3493
|
+
text: Yo,
|
|
3494
|
+
number: qo,
|
|
3495
|
+
date: Wo,
|
|
3465
3496
|
category: No
|
|
3466
|
-
},
|
|
3497
|
+
}, es = (e) => $o[e], ts = (e) => {
|
|
3467
3498
|
if (e == null || e === "") return null;
|
|
3468
3499
|
if (typeof e == "boolean") return e;
|
|
3469
3500
|
if (typeof e == "string") {
|
|
@@ -3471,17 +3502,17 @@ var xo = {
|
|
|
3471
3502
|
if (e === "false") return !1;
|
|
3472
3503
|
}
|
|
3473
3504
|
return !!e;
|
|
3474
|
-
},
|
|
3475
|
-
if (e.kind === Mo.kind) return
|
|
3476
|
-
let n =
|
|
3505
|
+
}, ns = (e, t) => {
|
|
3506
|
+
if (e.kind === Mo.kind) return ts(t);
|
|
3507
|
+
let n = es(e.kind);
|
|
3477
3508
|
return n?.normalizeValue ? n.normalizeValue(t, e) : t;
|
|
3478
|
-
},
|
|
3509
|
+
}, rs = (e, t) => {
|
|
3479
3510
|
if (t == null) return null;
|
|
3480
|
-
if (e.kind === "date" && t instanceof Date) return
|
|
3481
|
-
let n =
|
|
3511
|
+
if (e.kind === "date" && t instanceof Date) return Qo(t);
|
|
3512
|
+
let n = es(e.kind);
|
|
3482
3513
|
return n?.serializeValue ? n.serializeValue(t, e) : t;
|
|
3483
|
-
},
|
|
3484
|
-
if (e.required &&
|
|
3514
|
+
}, is = (e, t) => t == null ? !0 : typeof t == "string" ? t.trim().length === 0 : e.kind === Mo.kind ? t == null : !1, as = (e, t) => {
|
|
3515
|
+
if (e.required && is(e, t)) return [Zo];
|
|
3485
3516
|
if (e.kind === Mo.kind) {
|
|
3486
3517
|
if (t === null) return [];
|
|
3487
3518
|
let n = Mo.validate?.(t, e, {
|
|
@@ -3496,7 +3527,7 @@ var xo = {
|
|
|
3496
3527
|
});
|
|
3497
3528
|
return Array.isArray(n) ? n : [];
|
|
3498
3529
|
}
|
|
3499
|
-
let n =
|
|
3530
|
+
let n = es(e.kind);
|
|
3500
3531
|
if (!n?.validate) return [];
|
|
3501
3532
|
let r = n.validate(t, e, {
|
|
3502
3533
|
field: {
|
|
@@ -3509,7 +3540,7 @@ var xo = {
|
|
|
3509
3540
|
signal: void 0
|
|
3510
3541
|
});
|
|
3511
3542
|
return Array.isArray(r) ? r : [];
|
|
3512
|
-
},
|
|
3543
|
+
}, os = (e, t, n) => n.map((n) => `Row ${e + 1} (${t}): ${n}`), ss = (e) => {
|
|
3513
3544
|
if (Array.isArray(e)) return e.length >= 2 ? {
|
|
3514
3545
|
field1: e[0],
|
|
3515
3546
|
field2: e[1]
|
|
@@ -3524,46 +3555,46 @@ var xo = {
|
|
|
3524
3555
|
field1: t[0]?.[1],
|
|
3525
3556
|
field2: t[1]?.[1]
|
|
3526
3557
|
};
|
|
3527
|
-
},
|
|
3528
|
-
let n =
|
|
3558
|
+
}, cs = (e, t) => {
|
|
3559
|
+
let n = ss(e);
|
|
3529
3560
|
return n ? {
|
|
3530
|
-
field1:
|
|
3531
|
-
field2:
|
|
3561
|
+
field1: ns(t.field1, n.field1),
|
|
3562
|
+
field2: ns(t.field2, n.field2)
|
|
3532
3563
|
} : null;
|
|
3533
|
-
},
|
|
3564
|
+
}, ls = {
|
|
3534
3565
|
kind: "series",
|
|
3535
3566
|
schema: G({
|
|
3536
3567
|
kind: K("series"),
|
|
3537
3568
|
...J,
|
|
3538
|
-
field1:
|
|
3539
|
-
field2:
|
|
3569
|
+
field1: Xo,
|
|
3570
|
+
field2: Xo,
|
|
3540
3571
|
minPoints: V().int().nonnegative().optional(),
|
|
3541
3572
|
maxPoints: V().int().nonnegative().optional()
|
|
3542
3573
|
}),
|
|
3543
3574
|
getDefaultValue(e) {
|
|
3544
|
-
return Array.isArray(e.defaultValue) ? e.defaultValue.map((t) =>
|
|
3575
|
+
return Array.isArray(e.defaultValue) ? e.defaultValue.map((t) => cs(t, e)).filter((e) => e !== null) : [];
|
|
3545
3576
|
},
|
|
3546
3577
|
normalizeValue(e, t) {
|
|
3547
|
-
return Array.isArray(e) ? e.map((e) =>
|
|
3578
|
+
return Array.isArray(e) ? e.map((e) => cs(e, t)).filter((e) => e !== null) : [];
|
|
3548
3579
|
},
|
|
3549
3580
|
serializeValue(e, t) {
|
|
3550
3581
|
return e.map((e) => ({
|
|
3551
|
-
field1:
|
|
3552
|
-
field2:
|
|
3582
|
+
field1: rs(t.field1, e.field1),
|
|
3583
|
+
field2: rs(t.field2, e.field2)
|
|
3553
3584
|
}));
|
|
3554
3585
|
},
|
|
3555
3586
|
validate(e, t) {
|
|
3556
3587
|
let n = /* @__PURE__ */ new Set();
|
|
3557
3588
|
return t.minPoints !== void 0 && t.maxPoints !== void 0 && t.minPoints > t.maxPoints && n.add(q.invalidPointCountRange), t.minPoints !== void 0 && e.length < t.minPoints && n.add(q.minPoints(t.minPoints)), t.maxPoints !== void 0 && e.length > t.maxPoints && n.add(q.maxPoints(t.maxPoints)), e.forEach((e, r) => {
|
|
3558
|
-
for (let i of
|
|
3559
|
-
for (let i of
|
|
3589
|
+
for (let i of os(r, t.field1.label, as(t.field1, e.field1))) n.add(i);
|
|
3590
|
+
for (let i of os(r, t.field2.label, as(t.field2, e.field2))) n.add(i);
|
|
3560
3591
|
}), [...n];
|
|
3561
3592
|
},
|
|
3562
3593
|
describe(e, t) {
|
|
3563
3594
|
return Y("series-field", e, {
|
|
3564
3595
|
value: Array.isArray(t.state.value) ? t.state.value.map((t) => X(t) ? {
|
|
3565
|
-
field1:
|
|
3566
|
-
field2:
|
|
3596
|
+
field1: rs(e.field1, t.field1),
|
|
3597
|
+
field2: rs(e.field2, t.field2)
|
|
3567
3598
|
} : t) : [],
|
|
3568
3599
|
field1: e.field1,
|
|
3569
3600
|
field2: e.field2,
|
|
@@ -3573,7 +3604,7 @@ var xo = {
|
|
|
3573
3604
|
errors: t.state.errors
|
|
3574
3605
|
});
|
|
3575
3606
|
}
|
|
3576
|
-
},
|
|
3607
|
+
}, us = {
|
|
3577
3608
|
kind: "single-choice",
|
|
3578
3609
|
schema: G({
|
|
3579
3610
|
kind: K("single-choice"),
|
|
@@ -3599,7 +3630,7 @@ var xo = {
|
|
|
3599
3630
|
errors: t.state.errors
|
|
3600
3631
|
});
|
|
3601
3632
|
}
|
|
3602
|
-
},
|
|
3633
|
+
}, ds = {
|
|
3603
3634
|
kind: "classifier",
|
|
3604
3635
|
partialUpdatePolicy: "validate",
|
|
3605
3636
|
schema: G({
|
|
@@ -3628,7 +3659,7 @@ var xo = {
|
|
|
3628
3659
|
}
|
|
3629
3660
|
};
|
|
3630
3661
|
}
|
|
3631
|
-
},
|
|
3662
|
+
}, fs = {
|
|
3632
3663
|
kind: "regressor",
|
|
3633
3664
|
partialUpdatePolicy: "validate",
|
|
3634
3665
|
schema: G({
|
|
@@ -3657,64 +3688,64 @@ var xo = {
|
|
|
3657
3688
|
}
|
|
3658
3689
|
};
|
|
3659
3690
|
}
|
|
3660
|
-
},
|
|
3691
|
+
}, ps = () => {
|
|
3661
3692
|
let e = S();
|
|
3662
|
-
return e.registerField(
|
|
3663
|
-
},
|
|
3693
|
+
return e.registerField(Yo).registerField(qo).registerField(Mo).registerField(No).registerField(Fo).registerField(Wo).registerField(ls).registerField(Go).registerField(us).registerField(Ko).registerField(Jo).registerReport(ds).registerReport(fs), e;
|
|
3694
|
+
}, ms = (e) => typeof e == "object" && !!e && !Array.isArray(e), hs = (e, t) => Object.is(e, t), gs = (e, t) => e === t ? !0 : e.length === t.length ? e.every((e, n) => Object.is(e, t[n])) : !1, _s = (e, t) => {
|
|
3664
3695
|
if (e === t) return !0;
|
|
3665
3696
|
let n = Object.keys(e), r = Object.keys(t);
|
|
3666
3697
|
return n.length === r.length ? n.every((n) => Object.is(e[n], t[n])) : !1;
|
|
3667
|
-
},
|
|
3698
|
+
}, vs = (e, t) => Object.is(e, t) ? !0 : Array.isArray(e) && Array.isArray(t) ? gs(e, t) : ms(e) && ms(t) ? _s(e, t) : !1, ys = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), bs = (e) => {
|
|
3668
3699
|
let t = new Uint8Array(e.byteLength);
|
|
3669
3700
|
return t.set(new Uint8Array(e)), t.buffer;
|
|
3670
|
-
},
|
|
3701
|
+
}, xs = (e) => typeof File < "u" && e instanceof File ? new File([e], e.name, {
|
|
3671
3702
|
type: e.type,
|
|
3672
3703
|
lastModified: e.lastModified
|
|
3673
|
-
}) : typeof Blob < "u" && e instanceof Blob ? e.slice(0, e.size, e.type) : e,
|
|
3704
|
+
}) : typeof Blob < "u" && e instanceof Blob ? e.slice(0, e.size, e.type) : e, Ss = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), Cs = (e, t) => e.byteLength === t.byteLength ? Ss(new Uint8Array(e), new Uint8Array(t)) : !1, Z = (e) => {
|
|
3674
3705
|
if (e instanceof Date) return new Date(e.getTime());
|
|
3675
3706
|
if (e instanceof RegExp) return new RegExp(e.source, e.flags);
|
|
3676
|
-
if (e instanceof ArrayBuffer) return
|
|
3677
|
-
if (e instanceof DataView) return new DataView(
|
|
3678
|
-
if (
|
|
3707
|
+
if (e instanceof ArrayBuffer) return bs(e);
|
|
3708
|
+
if (e instanceof DataView) return new DataView(bs(e.buffer), e.byteOffset, e.byteLength);
|
|
3709
|
+
if (ys(e)) {
|
|
3679
3710
|
let t = e.constructor;
|
|
3680
|
-
return new t(
|
|
3711
|
+
return new t(bs(e.buffer), e.byteOffset, e.length);
|
|
3681
3712
|
}
|
|
3682
|
-
return e instanceof Map ? new Map(Array.from(e.entries(), ([e, t]) => [Z(e), Z(t)])) : e instanceof Set ? new Set(Array.from(e.values(), (e) => Z(e))) : typeof File < "u" && e instanceof File || typeof Blob < "u" && e instanceof Blob ?
|
|
3683
|
-
},
|
|
3713
|
+
return e instanceof Map ? new Map(Array.from(e.entries(), ([e, t]) => [Z(e), Z(t)])) : e instanceof Set ? new Set(Array.from(e.values(), (e) => Z(e))) : typeof File < "u" && e instanceof File || typeof Blob < "u" && e instanceof Blob ? xs(e) : Array.isArray(e) ? e.map((e) => Z(e)) : X(e) ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, Z(t)])) : e;
|
|
3714
|
+
}, ws = (e, t) => {
|
|
3684
3715
|
if (Object.is(e, t)) return !0;
|
|
3685
3716
|
if (e instanceof Date && t instanceof Date) return e.getTime() === t.getTime();
|
|
3686
3717
|
if (e instanceof RegExp && t instanceof RegExp) return e.source === t.source && e.flags === t.flags;
|
|
3687
|
-
if (e instanceof ArrayBuffer && t instanceof ArrayBuffer) return
|
|
3688
|
-
if (e instanceof DataView && t instanceof DataView) return e.byteOffset === t.byteOffset && e.byteLength === t.byteLength &&
|
|
3689
|
-
if (
|
|
3718
|
+
if (e instanceof ArrayBuffer && t instanceof ArrayBuffer) return Cs(e, t);
|
|
3719
|
+
if (e instanceof DataView && t instanceof DataView) return e.byteOffset === t.byteOffset && e.byteLength === t.byteLength && Cs(e.buffer, t.buffer);
|
|
3720
|
+
if (ys(e) && ys(t)) {
|
|
3690
3721
|
let n = new Uint8Array(e.buffer, e.byteOffset, e.byteLength), r = new Uint8Array(t.buffer, t.byteOffset, t.byteLength);
|
|
3691
|
-
return e.constructor === t.constructor &&
|
|
3722
|
+
return e.constructor === t.constructor && Ss(n, r);
|
|
3692
3723
|
}
|
|
3693
3724
|
if (e instanceof Map && t instanceof Map) return e.size === t.size && Array.from(e.entries()).every(([e, n], r) => {
|
|
3694
3725
|
let i = Array.from(t.entries())[r];
|
|
3695
|
-
return i !== void 0 &&
|
|
3726
|
+
return i !== void 0 && ws(e, i[0]) && ws(n, i[1]);
|
|
3696
3727
|
});
|
|
3697
3728
|
if (e instanceof Set && t instanceof Set) {
|
|
3698
3729
|
let n = Array.from(t.values());
|
|
3699
3730
|
for (let t of e.values()) {
|
|
3700
|
-
let e = n.findIndex((e) =>
|
|
3731
|
+
let e = n.findIndex((e) => ws(t, e));
|
|
3701
3732
|
if (e < 0) return !1;
|
|
3702
3733
|
n.splice(e, 1);
|
|
3703
3734
|
}
|
|
3704
3735
|
return n.length === 0;
|
|
3705
3736
|
}
|
|
3706
3737
|
if (typeof Blob < "u" && typeof File < "u" && e instanceof Blob && t instanceof Blob) return e.size === t.size && e.type === t.type ? e instanceof File && t instanceof File ? e.name === t.name && e.lastModified === t.lastModified : !0 : !1;
|
|
3707
|
-
if (Array.isArray(e) && Array.isArray(t)) return e.length === t.length && e.every((e, n) =>
|
|
3738
|
+
if (Array.isArray(e) && Array.isArray(t)) return e.length === t.length && e.every((e, n) => ws(e, t[n]));
|
|
3708
3739
|
if (X(e) && X(t)) {
|
|
3709
3740
|
let n = Object.keys(e), r = Object.keys(t);
|
|
3710
|
-
return n.length === r.length && n.every((n) =>
|
|
3741
|
+
return n.length === r.length && n.every((n) => ws(e[n], t[n]));
|
|
3711
3742
|
}
|
|
3712
3743
|
return !1;
|
|
3713
3744
|
}, Q = {
|
|
3714
3745
|
status: "idle",
|
|
3715
3746
|
result: void 0,
|
|
3716
3747
|
error: null
|
|
3717
|
-
},
|
|
3748
|
+
}, Ts = (e) => e instanceof Error ? e.message : typeof e == "string" && e.trim().length > 0 ? e : String(e), Es = (e, t, n) => {
|
|
3718
3749
|
e.update((e) => ({
|
|
3719
3750
|
...e,
|
|
3720
3751
|
explanationStates: {
|
|
@@ -3722,7 +3753,7 @@ var xo = {
|
|
|
3722
3753
|
[t]: n
|
|
3723
3754
|
}
|
|
3724
3755
|
}));
|
|
3725
|
-
},
|
|
3756
|
+
}, Ds = (e) => {
|
|
3726
3757
|
let t = e.filter((e) => e !== void 0);
|
|
3727
3758
|
if (t.length === 0) return {
|
|
3728
3759
|
signal: void 0,
|
|
@@ -3743,9 +3774,9 @@ var xo = {
|
|
|
3743
3774
|
for (let e of r) e();
|
|
3744
3775
|
}
|
|
3745
3776
|
};
|
|
3746
|
-
},
|
|
3747
|
-
let i =
|
|
3748
|
-
|
|
3777
|
+
}, Os = ({ config: e, definition: t, store: n, hooks: r }) => {
|
|
3778
|
+
let i = Ho(Z(e));
|
|
3779
|
+
Es(n, i.id, Q);
|
|
3749
3780
|
let a = null;
|
|
3750
3781
|
return {
|
|
3751
3782
|
get id() {
|
|
@@ -3771,22 +3802,22 @@ var xo = {
|
|
|
3771
3802
|
if ((n.getState().explanationStates[i.id] ?? Q).status !== "idle") return;
|
|
3772
3803
|
a?.abort();
|
|
3773
3804
|
let o = new AbortController();
|
|
3774
|
-
a = o,
|
|
3805
|
+
a = o, Es(n, i.id, {
|
|
3775
3806
|
status: "loading",
|
|
3776
3807
|
result: void 0,
|
|
3777
3808
|
error: null
|
|
3778
3809
|
});
|
|
3779
|
-
let s = t.transport(i), { signal: c, cleanup: l } =
|
|
3810
|
+
let s = t.transport(i), { signal: c, cleanup: l } = Ds([e.signal, o.signal]);
|
|
3780
3811
|
try {
|
|
3781
3812
|
let t = await s.submit({
|
|
3782
3813
|
...e,
|
|
3783
3814
|
signal: c
|
|
3784
3815
|
});
|
|
3785
3816
|
if (o.signal.aborted || c?.aborted) {
|
|
3786
|
-
|
|
3817
|
+
Es(n, i.id, Q);
|
|
3787
3818
|
return;
|
|
3788
3819
|
}
|
|
3789
|
-
|
|
3820
|
+
Es(n, i.id, {
|
|
3790
3821
|
status: "done",
|
|
3791
3822
|
result: t,
|
|
3792
3823
|
error: null
|
|
@@ -3797,11 +3828,11 @@ var xo = {
|
|
|
3797
3828
|
});
|
|
3798
3829
|
} catch (e) {
|
|
3799
3830
|
if (o.signal.aborted || c?.aborted || u(e)) {
|
|
3800
|
-
|
|
3831
|
+
Es(n, i.id, Q);
|
|
3801
3832
|
return;
|
|
3802
3833
|
}
|
|
3803
|
-
let t =
|
|
3804
|
-
|
|
3834
|
+
let t = Ts(e);
|
|
3835
|
+
Es(n, i.id, {
|
|
3805
3836
|
status: "error",
|
|
3806
3837
|
result: void 0,
|
|
3807
3838
|
error: t
|
|
@@ -3815,20 +3846,20 @@ var xo = {
|
|
|
3815
3846
|
}
|
|
3816
3847
|
},
|
|
3817
3848
|
abort() {
|
|
3818
|
-
a?.abort(), a = null,
|
|
3849
|
+
a?.abort(), a = null, Es(n, i.id, Q);
|
|
3819
3850
|
},
|
|
3820
3851
|
reset() {
|
|
3821
|
-
a?.abort(), a = null,
|
|
3852
|
+
a?.abort(), a = null, Es(n, i.id, Q);
|
|
3822
3853
|
},
|
|
3823
3854
|
subscribe(e) {
|
|
3824
3855
|
let t = n.getState().explanationStates[i.id] ?? Q;
|
|
3825
3856
|
return n.subscribe(() => {
|
|
3826
3857
|
let r = n.getState().explanationStates[i.id] ?? Q;
|
|
3827
|
-
|
|
3858
|
+
hs(t, r) || (t = r, e(Z(r)));
|
|
3828
3859
|
});
|
|
3829
3860
|
}
|
|
3830
3861
|
};
|
|
3831
|
-
},
|
|
3862
|
+
}, ks = "Unknown explanation error.", As = async ({ explanations: e, request: t }) => {
|
|
3832
3863
|
if (e.length === 0) return {
|
|
3833
3864
|
results: {},
|
|
3834
3865
|
errors: {}
|
|
@@ -3845,13 +3876,13 @@ var xo = {
|
|
|
3845
3876
|
n[t.id] = e.result;
|
|
3846
3877
|
continue;
|
|
3847
3878
|
}
|
|
3848
|
-
e.status === "error" && (r[t.id] = e.error ??
|
|
3879
|
+
e.status === "error" && (r[t.id] = e.error ?? ks);
|
|
3849
3880
|
}
|
|
3850
3881
|
return {
|
|
3851
3882
|
results: n,
|
|
3852
3883
|
errors: r
|
|
3853
3884
|
};
|
|
3854
|
-
},
|
|
3885
|
+
}, js = Object.freeze({}), Ms = (e, t) => ({
|
|
3855
3886
|
explanationId: "",
|
|
3856
3887
|
backend: e.backend,
|
|
3857
3888
|
values: e.values,
|
|
@@ -3862,10 +3893,10 @@ var xo = {
|
|
|
3862
3893
|
meta: e.meta,
|
|
3863
3894
|
raw: e.raw,
|
|
3864
3895
|
signal: t
|
|
3865
|
-
}),
|
|
3866
|
-
let i = await e.submit(t), a = r === "all" ? await
|
|
3896
|
+
}), Ns = async ({ form: e, submit: t, artifactAdapter: n, explanationMode: r = "all" }) => {
|
|
3897
|
+
let i = await e.submit(t), a = r === "all" ? await As({
|
|
3867
3898
|
explanations: e.explanations,
|
|
3868
|
-
request:
|
|
3899
|
+
request: Ms(i, t?.signal)
|
|
3869
3900
|
}) : {
|
|
3870
3901
|
results: {},
|
|
3871
3902
|
errors: {}
|
|
@@ -3873,14 +3904,14 @@ var xo = {
|
|
|
3873
3904
|
submitResult: i,
|
|
3874
3905
|
explanationResults: a.results,
|
|
3875
3906
|
explanationErrors: a.errors
|
|
3876
|
-
}, s = n ? await n.derive(o) :
|
|
3907
|
+
}, s = n ? await n.derive(o) : js;
|
|
3877
3908
|
return {
|
|
3878
3909
|
submitResult: i,
|
|
3879
3910
|
explanationResults: a.results,
|
|
3880
3911
|
explanationErrors: a.errors,
|
|
3881
3912
|
artifacts: s
|
|
3882
3913
|
};
|
|
3883
|
-
},
|
|
3914
|
+
}, Ps = (e, t) => (Array.isArray(e) ? e : (e ?? t).split(".")).map((e) => e.trim()).filter(Boolean), Fs = (e, t, n) => {
|
|
3884
3915
|
if (t.length === 0) return;
|
|
3885
3916
|
let r = e;
|
|
3886
3917
|
for (let e of t.slice(0, -1)) {
|
|
@@ -3893,26 +3924,26 @@ var xo = {
|
|
|
3893
3924
|
r = t;
|
|
3894
3925
|
}
|
|
3895
3926
|
r[t[t.length - 1]] = n;
|
|
3896
|
-
},
|
|
3927
|
+
}, Is = (e) => {
|
|
3897
3928
|
try {
|
|
3898
3929
|
return new TextEncoder().encode(JSON.stringify(e)).byteLength;
|
|
3899
3930
|
} catch {
|
|
3900
3931
|
return;
|
|
3901
3932
|
}
|
|
3902
|
-
},
|
|
3933
|
+
}, Ls = (e) => ({
|
|
3903
3934
|
values: Z(e.values),
|
|
3904
3935
|
fieldValues: Z(e.fieldValues),
|
|
3905
3936
|
serializedValues: Z(e.serializedValues),
|
|
3906
3937
|
serializedFieldValues: Z(e.serializedFieldValues)
|
|
3907
|
-
}),
|
|
3938
|
+
}), Rs = (e, t) => {
|
|
3908
3939
|
let n = t(e), r = e.state;
|
|
3909
3940
|
return !((!r.visible || r.disabled) && (n === "omit" || n === "reset-on-hide"));
|
|
3910
|
-
},
|
|
3941
|
+
}, zs = (e, t) => {
|
|
3911
3942
|
let n = {}, r = {}, i = {}, a = {};
|
|
3912
3943
|
for (let o of e) {
|
|
3913
|
-
if (!
|
|
3914
|
-
let e =
|
|
3915
|
-
r[o.id] = Z(s), a[o.id] = Z(c),
|
|
3944
|
+
if (!Rs(o, t)) continue;
|
|
3945
|
+
let e = Ps(o.config.valuePath, o.id), s = o.state.value, c = o.serialize();
|
|
3946
|
+
r[o.id] = Z(s), a[o.id] = Z(c), Fs(n, e, Z(s)), Fs(i, e, Z(c));
|
|
3916
3947
|
}
|
|
3917
3948
|
return {
|
|
3918
3949
|
values: n,
|
|
@@ -3920,26 +3951,26 @@ var xo = {
|
|
|
3920
3951
|
serializedValues: i,
|
|
3921
3952
|
serializedFieldValues: a
|
|
3922
3953
|
};
|
|
3923
|
-
},
|
|
3954
|
+
}, Bs = (e) => X(e) ? {
|
|
3924
3955
|
reports: X(e.reports) ? e.reports : void 0,
|
|
3925
3956
|
meta: X(e.meta) ? e.meta : void 0,
|
|
3926
3957
|
raw: "raw" in e ? e.raw : e
|
|
3927
|
-
} : { raw: e },
|
|
3958
|
+
} : { raw: e }, Vs = async (e, t) => {
|
|
3928
3959
|
let n = /* @__PURE__ */ new Map();
|
|
3929
3960
|
return await Promise.all(e.map(async (e) => {
|
|
3930
3961
|
n.set(e.id, await e.prepareState(t));
|
|
3931
3962
|
})), n;
|
|
3932
|
-
},
|
|
3963
|
+
}, Hs = (e, t) => {
|
|
3933
3964
|
for (let n of e) {
|
|
3934
3965
|
let e = t.get(n.id);
|
|
3935
3966
|
if (!e) throw new r(`Prepared report state missing for "${n.id}".`);
|
|
3936
3967
|
n.commitState(e);
|
|
3937
3968
|
}
|
|
3938
|
-
},
|
|
3969
|
+
}, Us = (e, t) => Object.fromEntries(e.map((e) => {
|
|
3939
3970
|
let n = t.get(e.id);
|
|
3940
3971
|
if (!n) throw new r(`Prepared report state missing for "${e.id}".`);
|
|
3941
3972
|
return [e.id, e.cloneState(n)];
|
|
3942
|
-
})),
|
|
3973
|
+
})), Ws = (e) => {
|
|
3943
3974
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : e.getTime();
|
|
3944
3975
|
if (typeof e == "number") return Number.isNaN(e) ? null : e;
|
|
3945
3976
|
if (typeof e == "string") {
|
|
@@ -3947,11 +3978,11 @@ var xo = {
|
|
|
3947
3978
|
return !Number.isNaN(t) && /^\d{4}-\d{2}-\d{2}/.test(e) ? t : e;
|
|
3948
3979
|
}
|
|
3949
3980
|
return typeof e == "bigint" ? e : null;
|
|
3950
|
-
},
|
|
3951
|
-
let n =
|
|
3981
|
+
}, Gs = (e, t) => {
|
|
3982
|
+
let n = Ws(e), r = Ws(t);
|
|
3952
3983
|
return n === null || r === null || typeof n != typeof r ? null : n === r ? 0 : n < r ? -1 : 1;
|
|
3953
|
-
},
|
|
3954
|
-
let r =
|
|
3984
|
+
}, Ks = (e, t, n) => e ? typeof e == "function" ? e(t) : Xs(e, t) : n, qs = (e, t) => t.some((t) => Object.is(t, e)), Js = (e, t, n) => {
|
|
3985
|
+
let r = Gs(e, t);
|
|
3955
3986
|
if (r === null) return !1;
|
|
3956
3987
|
switch (n) {
|
|
3957
3988
|
case "eq": return r === 0;
|
|
@@ -3960,27 +3991,27 @@ var xo = {
|
|
|
3960
3991
|
case "gte": return r >= 0;
|
|
3961
3992
|
case "lt": return r < 0;
|
|
3962
3993
|
case "lte": return r <= 0;
|
|
3963
|
-
default: return
|
|
3994
|
+
default: return Ys(n);
|
|
3964
3995
|
}
|
|
3965
|
-
},
|
|
3996
|
+
}, Ys = (e) => {
|
|
3966
3997
|
throw Error("Unsupported comparison operator.");
|
|
3967
|
-
},
|
|
3998
|
+
}, Xs = (e, t) => {
|
|
3968
3999
|
switch (e.kind) {
|
|
3969
4000
|
case "field-value": {
|
|
3970
4001
|
let n = t.values[e.field];
|
|
3971
|
-
return !(e.equals !== void 0 && !Object.is(n, e.equals) || e.notEquals !== void 0 && Object.is(n, e.notEquals) || e.greaterThan !== void 0 && !
|
|
4002
|
+
return !(e.equals !== void 0 && !Object.is(n, e.equals) || e.notEquals !== void 0 && Object.is(n, e.notEquals) || e.greaterThan !== void 0 && !Js(n, e.greaterThan, "gt") || e.greaterThanOrEqual !== void 0 && !Js(n, e.greaterThanOrEqual, "gte") || e.lessThan !== void 0 && !Js(n, e.lessThan, "lt") || e.lessThanOrEqual !== void 0 && !Js(n, e.lessThanOrEqual, "lte") || e.in && !qs(n, e.in) || e.notIn && qs(n, e.notIn) || e.empty === !0 && !zo(n) || e.notEmpty === !0 && zo(n) || e.truthy === !0 && !n || e.falsy === !0 && n);
|
|
3972
4003
|
}
|
|
3973
|
-
case "field-comparison": return
|
|
4004
|
+
case "field-comparison": return Js(t.values[e.field], t.values[e.otherField], e.operator);
|
|
3974
4005
|
case "form-status": return (Array.isArray(e.equals) ? e.equals : [e.equals]).includes(t.formStatus);
|
|
3975
4006
|
case "submit-count": return !(e.eq !== void 0 && t.submitCount !== e.eq || e.gte !== void 0 && t.submitCount < e.gte || e.lte !== void 0 && t.submitCount > e.lte);
|
|
3976
|
-
case "all": return e.conditions.every((e) =>
|
|
3977
|
-
case "any": return e.conditions.some((e) =>
|
|
3978
|
-
case "not": return !
|
|
3979
|
-
default: return
|
|
4007
|
+
case "all": return e.conditions.every((e) => Xs(e, t));
|
|
4008
|
+
case "any": return e.conditions.some((e) => Xs(e, t));
|
|
4009
|
+
case "not": return !Xs(e.condition, t);
|
|
4010
|
+
default: return Zs(e);
|
|
3980
4011
|
}
|
|
3981
|
-
},
|
|
4012
|
+
}, Zs = (e) => {
|
|
3982
4013
|
throw Error("Unsupported field condition.");
|
|
3983
|
-
},
|
|
4014
|
+
}, Qs = (e, t, n, r) => {
|
|
3984
4015
|
let i = {
|
|
3985
4016
|
field: e,
|
|
3986
4017
|
values: t,
|
|
@@ -3988,31 +4019,31 @@ var xo = {
|
|
|
3988
4019
|
formStatus: r
|
|
3989
4020
|
};
|
|
3990
4021
|
return {
|
|
3991
|
-
visible: !
|
|
3992
|
-
disabled:
|
|
3993
|
-
readOnly:
|
|
4022
|
+
visible: !Ks(e.hiddenWhen, i, !!e.hidden),
|
|
4023
|
+
disabled: Ks(e.disabledWhen, i, !!e.disabled),
|
|
4024
|
+
readOnly: Ks(e.readOnlyWhen, i, !!e.readOnly)
|
|
3994
4025
|
};
|
|
3995
|
-
},
|
|
4026
|
+
}, $s = (e) => [
|
|
3996
4027
|
...e.syncErrors,
|
|
3997
4028
|
...e.validationErrors,
|
|
3998
4029
|
...e.externalErrors
|
|
3999
|
-
],
|
|
4000
|
-
let t =
|
|
4030
|
+
], ec = (e) => {
|
|
4031
|
+
let t = $s(e);
|
|
4001
4032
|
return {
|
|
4002
4033
|
...e,
|
|
4003
4034
|
errors: t,
|
|
4004
4035
|
valid: t.length === 0,
|
|
4005
4036
|
status: t.length === 0 ? "valid" : "invalid"
|
|
4006
4037
|
};
|
|
4007
|
-
},
|
|
4008
|
-
let t =
|
|
4038
|
+
}, tc = (e) => {
|
|
4039
|
+
let t = $s(e);
|
|
4009
4040
|
return {
|
|
4010
4041
|
...e,
|
|
4011
4042
|
errors: t,
|
|
4012
4043
|
valid: t.length === 0,
|
|
4013
4044
|
status: "validating"
|
|
4014
4045
|
};
|
|
4015
|
-
},
|
|
4046
|
+
}, nc = (e, t) => e.required && zo(t) ? ["This field is required."] : [], rc = (e, t, n) => e.normalizeValue ? ic(e, t, e.normalizeValue(n, t)) : ic(e, t, n), ic = (e, t, n) => e.cloneValue ? e.cloneValue(n, t) : Z(n), ac = (e, t, n, r) => e.isEqual ? e.isEqual(n, r, t) : ws(n, r), oc = (e, t, n, r, i) => {
|
|
4016
4047
|
if (!e.validate || typeof t.asyncValidationDebounceMs == "number" && t.asyncValidationDebounceMs > 0) return [];
|
|
4017
4048
|
let a = e.validate(n, t, {
|
|
4018
4049
|
field: t,
|
|
@@ -4021,14 +4052,14 @@ var xo = {
|
|
|
4021
4052
|
validationVersion: 0,
|
|
4022
4053
|
signal: void 0
|
|
4023
4054
|
});
|
|
4024
|
-
return
|
|
4025
|
-
},
|
|
4055
|
+
return Ro(a) ? [] : a;
|
|
4056
|
+
}, sc = (e, t, n, r, i, a) => {
|
|
4026
4057
|
if (!a.visible || a.disabled) return [];
|
|
4027
|
-
let o =
|
|
4028
|
-
return o.length > 0 ? o :
|
|
4029
|
-
},
|
|
4030
|
-
let o =
|
|
4031
|
-
return
|
|
4058
|
+
let o = nc(t, n);
|
|
4059
|
+
return o.length > 0 ? o : oc(e, t, n, r, i);
|
|
4060
|
+
}, cc = (e, t, n, r, i, a) => {
|
|
4061
|
+
let o = rc(e, t, n), s = Qs(t, r, i, a), c = sc(e, t, o, r, i, s);
|
|
4062
|
+
return ec({
|
|
4032
4063
|
value: o,
|
|
4033
4064
|
initialValue: o,
|
|
4034
4065
|
touched: !1,
|
|
@@ -4044,16 +4075,16 @@ var xo = {
|
|
|
4044
4075
|
valid: c.length === 0,
|
|
4045
4076
|
status: c.length === 0 ? "valid" : "invalid"
|
|
4046
4077
|
});
|
|
4047
|
-
},
|
|
4078
|
+
}, lc = ({ config: e, definition: t, store: n, getValues: r, getSubmitCount: i, getFormStatus: a, commitState: o }) => {
|
|
4048
4079
|
let s = null, c = 0;
|
|
4049
4080
|
return {
|
|
4050
4081
|
abort(e) {
|
|
4051
4082
|
s?.abort(e), s = null;
|
|
4052
4083
|
},
|
|
4053
4084
|
async validate(l, d = n.getState().activeValidationVersion) {
|
|
4054
|
-
let f = n.getState().lifecycleVersion, p = r(), m =
|
|
4085
|
+
let f = n.getState().lifecycleVersion, p = r(), m = rc(t, e, l.value), h = i(), g = Qs(e, p, h, a()), _ = ++c, v = typeof AbortController < "u" ? new AbortController() : null, y = sc(t, e, m, p, h, g);
|
|
4055
4086
|
if (s?.abort("validation-restarted"), s = v, !g.visible || g.disabled) {
|
|
4056
|
-
let t =
|
|
4087
|
+
let t = ec({
|
|
4057
4088
|
...l,
|
|
4058
4089
|
value: m,
|
|
4059
4090
|
visible: g.visible,
|
|
@@ -4069,7 +4100,7 @@ var xo = {
|
|
|
4069
4100
|
errors: []
|
|
4070
4101
|
};
|
|
4071
4102
|
}
|
|
4072
|
-
o(e.id,
|
|
4103
|
+
o(e.id, tc({
|
|
4073
4104
|
...l,
|
|
4074
4105
|
visible: g.visible,
|
|
4075
4106
|
disabled: g.disabled,
|
|
@@ -4083,7 +4114,7 @@ var xo = {
|
|
|
4083
4114
|
let b = [];
|
|
4084
4115
|
if (y.length === 0 && t.validate) try {
|
|
4085
4116
|
let n = typeof e.asyncValidationDebounceMs == "number" ? e.asyncValidationDebounceMs : 0;
|
|
4086
|
-
n > 0 && await
|
|
4117
|
+
n > 0 && await Uo(n, v?.signal);
|
|
4087
4118
|
let r = t.validate(m, e, {
|
|
4088
4119
|
field: e,
|
|
4089
4120
|
values: p,
|
|
@@ -4091,7 +4122,7 @@ var xo = {
|
|
|
4091
4122
|
validationVersion: d,
|
|
4092
4123
|
signal: v?.signal
|
|
4093
4124
|
});
|
|
4094
|
-
|
|
4125
|
+
Ro(r) && (b = await r);
|
|
4095
4126
|
} catch (t) {
|
|
4096
4127
|
if (v?.signal.aborted || u(t)) return {
|
|
4097
4128
|
fieldId: e.id,
|
|
@@ -4100,11 +4131,11 @@ var xo = {
|
|
|
4100
4131
|
};
|
|
4101
4132
|
throw t;
|
|
4102
4133
|
}
|
|
4103
|
-
let ee = n.getState().activeValidationVersion === d && n.getState().lifecycleVersion === f && c === _ && !v?.signal.aborted, x =
|
|
4134
|
+
let ee = n.getState().activeValidationVersion === d && n.getState().lifecycleVersion === f && c === _ && !v?.signal.aborted, x = ec({
|
|
4104
4135
|
...l,
|
|
4105
4136
|
value: m,
|
|
4106
4137
|
touched: !0,
|
|
4107
|
-
dirty: !
|
|
4138
|
+
dirty: !ac(t, e, m, l.initialValue),
|
|
4108
4139
|
visible: g.visible,
|
|
4109
4140
|
disabled: g.disabled,
|
|
4110
4141
|
readOnly: g.readOnly,
|
|
@@ -4120,7 +4151,7 @@ var xo = {
|
|
|
4120
4151
|
};
|
|
4121
4152
|
}
|
|
4122
4153
|
};
|
|
4123
|
-
},
|
|
4154
|
+
}, uc = () => ({
|
|
4124
4155
|
status: "idle",
|
|
4125
4156
|
submitCount: 0,
|
|
4126
4157
|
lastResult: null,
|
|
@@ -4133,7 +4164,7 @@ var xo = {
|
|
|
4133
4164
|
activeValidationVersion: 0,
|
|
4134
4165
|
activeSubmissionVersion: null
|
|
4135
4166
|
}), $ = (e, t) => {
|
|
4136
|
-
switch (
|
|
4167
|
+
switch (fc(e.status, t.type), t.type) {
|
|
4137
4168
|
case "bump-lifecycle": return {
|
|
4138
4169
|
...e,
|
|
4139
4170
|
lifecycleVersion: e.lifecycleVersion + 1
|
|
@@ -4206,13 +4237,13 @@ var xo = {
|
|
|
4206
4237
|
submissionProgress: null,
|
|
4207
4238
|
activeSubmissionVersion: null
|
|
4208
4239
|
};
|
|
4209
|
-
default: return
|
|
4240
|
+
default: return dc(t);
|
|
4210
4241
|
}
|
|
4211
|
-
},
|
|
4242
|
+
}, dc = (e) => {
|
|
4212
4243
|
throw Error("Unsupported engine transition.");
|
|
4213
|
-
},
|
|
4244
|
+
}, fc = (e, t) => {
|
|
4214
4245
|
if (!(t === "submission-success" || t === "submission-aborted" ? e === "submitting" : t === "submission-error" ? e === "submitting" || e === "success" : t !== "validation-error" || e === "validating")) throw Error(`Invalid engine transition "${t}" from status "${e}".`);
|
|
4215
|
-
},
|
|
4246
|
+
}, pc = (e) => ({
|
|
4216
4247
|
value: Z(e.value),
|
|
4217
4248
|
initialValue: Z(e.initialValue),
|
|
4218
4249
|
touched: e.touched,
|
|
@@ -4223,8 +4254,8 @@ var xo = {
|
|
|
4223
4254
|
readOnly: e.readOnly,
|
|
4224
4255
|
errors: [...e.errors],
|
|
4225
4256
|
status: e.status
|
|
4226
|
-
}),
|
|
4227
|
-
let t = Object.fromEntries(Object.entries(e.fieldStates).map(([e, t]) => [e, Z(t.value)])), n =
|
|
4257
|
+
}), mc = (e) => Object.fromEntries(Object.entries(e).map(([e, t]) => [e, pc(t)])), hc = (e) => {
|
|
4258
|
+
let t = Object.fromEntries(Object.entries(e.fieldStates).map(([e, t]) => [e, Z(t.value)])), n = mc(e.fieldStates), r = Object.fromEntries(Object.entries(n).map(([e, t]) => [e, t.errors])), i = e.formErrors.length === 0 && Object.values(n).every((e) => e.valid), a = Object.values(n).some((e) => e.dirty), o = Object.values(n).some((e) => e.touched);
|
|
4228
4259
|
return {
|
|
4229
4260
|
status: e.status,
|
|
4230
4261
|
submitCount: e.submitCount,
|
|
@@ -4241,7 +4272,7 @@ var xo = {
|
|
|
4241
4272
|
},
|
|
4242
4273
|
lastResult: Z(e.lastResult)
|
|
4243
4274
|
};
|
|
4244
|
-
},
|
|
4275
|
+
}, gc = (e) => typeof AggregateError < "u" ? AggregateError(e, "Store listener notification failed.") : /* @__PURE__ */ Error("Store listener notification failed."), _c = (e, t = {}) => {
|
|
4245
4276
|
let n = e, r = 0, i = !1, a = /* @__PURE__ */ new Set(), o = () => {
|
|
4246
4277
|
let e = [];
|
|
4247
4278
|
for (let r of a) try {
|
|
@@ -4249,7 +4280,7 @@ var xo = {
|
|
|
4249
4280
|
} catch (r) {
|
|
4250
4281
|
e.push(r), t.onListenerError?.(r, n);
|
|
4251
4282
|
}
|
|
4252
|
-
if (e.length > 0 && t.listenerErrorPolicy === "throw-aggregate") throw
|
|
4283
|
+
if (e.length > 0 && t.listenerErrorPolicy === "throw-aggregate") throw gc(e);
|
|
4253
4284
|
};
|
|
4254
4285
|
return {
|
|
4255
4286
|
getState() {
|
|
@@ -4277,14 +4308,14 @@ var xo = {
|
|
|
4277
4308
|
return a.add(e), () => a.delete(e);
|
|
4278
4309
|
}
|
|
4279
4310
|
};
|
|
4280
|
-
},
|
|
4281
|
-
let t =
|
|
4311
|
+
}, vc = (e) => {
|
|
4312
|
+
let t = hc(e.getState());
|
|
4282
4313
|
return {
|
|
4283
4314
|
valid: t.valid,
|
|
4284
4315
|
fields: t.errors.fields,
|
|
4285
4316
|
formErrors: t.errors.form
|
|
4286
4317
|
};
|
|
4287
|
-
},
|
|
4318
|
+
}, yc = (e, t, n) => {
|
|
4288
4319
|
if (n) {
|
|
4289
4320
|
if (Array.isArray(n)) {
|
|
4290
4321
|
t.push(...n);
|
|
@@ -4292,7 +4323,7 @@ var xo = {
|
|
|
4292
4323
|
}
|
|
4293
4324
|
if (n.form && t.push(...n.form), n.fields) for (let [t, r] of Object.entries(n.fields)) e[t] = [...e[t] ?? [], ...r];
|
|
4294
4325
|
}
|
|
4295
|
-
},
|
|
4326
|
+
}, bc = ({ store: e, fields: t, normalizedSchema: n, validators: i, hooks: a, getValues: o, getSubmitCount: s, getFormStatus: c, syncDerivedFieldState: l, setRestingStatus: u, shouldResetInactiveFields: d, inactiveFieldPolicy: f }) => {
|
|
4296
4327
|
let p = 0, m = new Set(t.map((e) => e.id)), h = async (a, l) => {
|
|
4297
4328
|
let u = [], d = Object.fromEntries(t.map((e) => [e.id, []]));
|
|
4298
4329
|
if (i?.length) {
|
|
@@ -4300,22 +4331,22 @@ var xo = {
|
|
|
4300
4331
|
values: o(),
|
|
4301
4332
|
submitCount: s(),
|
|
4302
4333
|
formStatus: c(),
|
|
4303
|
-
fields:
|
|
4334
|
+
fields: mc(e.getState().fieldStates),
|
|
4304
4335
|
schema: {
|
|
4305
4336
|
fields: n.fields,
|
|
4306
4337
|
reports: n.reports
|
|
4307
4338
|
}
|
|
4308
4339
|
};
|
|
4309
|
-
for (let n of i) if (
|
|
4340
|
+
for (let n of i) if (yc(d, u, await n(t)), e.getState().activeValidationVersion !== a || e.getState().lifecycleVersion !== l) return vc(e);
|
|
4310
4341
|
}
|
|
4311
4342
|
let f = Object.keys(d).filter((e) => !m.has(e));
|
|
4312
4343
|
if (f.length > 0) throw new r(`Form validator returned errors for unknown fields: ${f.join(", ")}.`);
|
|
4313
|
-
if (e.getState().activeValidationVersion !== a || e.getState().lifecycleVersion !== l) return
|
|
4344
|
+
if (e.getState().activeValidationVersion !== a || e.getState().lifecycleVersion !== l) return vc(e);
|
|
4314
4345
|
for (let e of t) e.setExternalErrors(d[e.id] ?? []);
|
|
4315
4346
|
return e.update((e) => ({
|
|
4316
4347
|
...e,
|
|
4317
4348
|
formErrors: u
|
|
4318
|
-
})),
|
|
4349
|
+
})), vc(e);
|
|
4319
4350
|
};
|
|
4320
4351
|
return { async validate() {
|
|
4321
4352
|
let n = e.getState().lifecycleVersion, r = ++p;
|
|
@@ -4327,7 +4358,7 @@ var xo = {
|
|
|
4327
4358
|
if (await a?.beforeValidate?.({
|
|
4328
4359
|
values: o(),
|
|
4329
4360
|
submitCount: s()
|
|
4330
|
-
}), await Promise.all(t.map((e) => e.validate(r))), e.getState().lifecycleVersion !== n) return
|
|
4361
|
+
}), await Promise.all(t.map((e) => e.validate(r))), e.getState().lifecycleVersion !== n) return vc(e);
|
|
4331
4362
|
l({
|
|
4332
4363
|
preserveValidationErrors: !0,
|
|
4333
4364
|
preserveExternalErrors: !1,
|
|
@@ -4353,7 +4384,7 @@ var xo = {
|
|
|
4353
4384
|
})), t;
|
|
4354
4385
|
}
|
|
4355
4386
|
} };
|
|
4356
|
-
},
|
|
4387
|
+
}, xc = () => {
|
|
4357
4388
|
let e = null, t = "", n = null, i = 0, a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = (e) => {
|
|
4358
4389
|
let t = o.get(e);
|
|
4359
4390
|
t && (o.delete(e), t());
|
|
@@ -4408,7 +4439,7 @@ var xo = {
|
|
|
4408
4439
|
n = null, e = null, t = "", a.clear();
|
|
4409
4440
|
}
|
|
4410
4441
|
};
|
|
4411
|
-
},
|
|
4442
|
+
}, Sc = ({ store: e, resetReports: t, resetExplanations: n, syncAfterSubmissionTransition: r }) => ({
|
|
4412
4443
|
start(t) {
|
|
4413
4444
|
e.batch(() => {
|
|
4414
4445
|
n(), e.update((e) => $(e, {
|
|
@@ -4447,10 +4478,10 @@ var xo = {
|
|
|
4447
4478
|
submissionVersion: t
|
|
4448
4479
|
}));
|
|
4449
4480
|
}
|
|
4450
|
-
}),
|
|
4481
|
+
}), Cc = (e, t, n) => ({
|
|
4451
4482
|
...t,
|
|
4452
|
-
reportStates:
|
|
4453
|
-
}),
|
|
4483
|
+
reportStates: Us(e, n)
|
|
4484
|
+
}), wc = (e, t) => {
|
|
4454
4485
|
let n = Object.fromEntries(e.map((e) => {
|
|
4455
4486
|
let n = t.reportStates[e.id];
|
|
4456
4487
|
return [e.id, n && e.cloneState(n)];
|
|
@@ -4466,8 +4497,8 @@ var xo = {
|
|
|
4466
4497
|
meta: Z(t.meta),
|
|
4467
4498
|
raw: Z(t.raw)
|
|
4468
4499
|
};
|
|
4469
|
-
},
|
|
4470
|
-
let S =
|
|
4500
|
+
}, Tc = ({ store: e, transport: r, hooks: i, hookFailurePolicy: s, normalizedSchema: d, fields: f, reports: p, validate: m, getSubmitCount: h, markReportsLoading: g, resetReports: _, resetExplanations: v, syncDerivedFieldState: y, shouldResetInactiveFields: b, resolveInactiveFieldPolicy: ee, inactiveFieldPolicy: x }) => {
|
|
4501
|
+
let S = xc(), C = Sc({
|
|
4471
4502
|
store: e,
|
|
4472
4503
|
resetReports: _,
|
|
4473
4504
|
resetExplanations: v,
|
|
@@ -4479,8 +4510,8 @@ var xo = {
|
|
|
4479
4510
|
inactiveFieldPolicy: x
|
|
4480
4511
|
});
|
|
4481
4512
|
}
|
|
4482
|
-
}),
|
|
4483
|
-
let a =
|
|
4513
|
+
}), w = new Map(f.map((e) => [e.id, e])), te = new Map(p.map((e) => [e.id, e])), T = async (e, t, n, r) => {
|
|
4514
|
+
let a = Ls(t);
|
|
4484
4515
|
await i?.onSubmitError?.({
|
|
4485
4516
|
backend: e,
|
|
4486
4517
|
...a,
|
|
@@ -4489,10 +4520,10 @@ var xo = {
|
|
|
4489
4520
|
});
|
|
4490
4521
|
}, E = async (t, n, r, i, a, o) => {
|
|
4491
4522
|
let s = t instanceof c ? t : l(S.getAbortReason(n));
|
|
4492
|
-
throw S.getCurrentRequestId() === n && e.getState().lifecycleVersion === r &&
|
|
4523
|
+
throw S.getCurrentRequestId() === n && e.getState().lifecycleVersion === r && C.abort(s.message), await T(o, a, i, s), s;
|
|
4493
4524
|
}, ne = async (t, n, r, i, a, s) => {
|
|
4494
4525
|
let c = t instanceof Error ? t.message : String(t);
|
|
4495
|
-
throw S.getCurrentRequestId() === n && e.getState().lifecycleVersion === r &&
|
|
4526
|
+
throw S.getCurrentRequestId() === n && e.getState().lifecycleVersion === r && C.fail(c), await T(s, a, i, t), new o(`Form submission failed: ${c}`, t);
|
|
4496
4527
|
}, re = (t, n, r) => {
|
|
4497
4528
|
S.getCurrentRequestId() !== n || e.getState().lifecycleVersion !== r || e.update((e) => ({
|
|
4498
4529
|
...e,
|
|
@@ -4577,14 +4608,14 @@ var xo = {
|
|
|
4577
4608
|
for (let [e, n] of Object.entries(t)) i[e] = e in i ? ie(i[e], n, "deep-merge") : Z(n);
|
|
4578
4609
|
return i;
|
|
4579
4610
|
}, ae = (e, t) => {
|
|
4580
|
-
let n =
|
|
4611
|
+
let n = te.get(e);
|
|
4581
4612
|
n && n.commitState({
|
|
4582
4613
|
payload: Z(t),
|
|
4583
4614
|
error: null,
|
|
4584
4615
|
status: t === void 0 ? "idle" : "ready"
|
|
4585
4616
|
});
|
|
4586
4617
|
}, oe = (t, n, r, i) => {
|
|
4587
|
-
let a =
|
|
4618
|
+
let a = te.get(r)?.config?.source ?? r, o = Z(e.getState().reportStates);
|
|
4588
4619
|
return {
|
|
4589
4620
|
backend: n,
|
|
4590
4621
|
values: Z(t.values),
|
|
@@ -4597,7 +4628,7 @@ var xo = {
|
|
|
4597
4628
|
raw: Z(i)
|
|
4598
4629
|
};
|
|
4599
4630
|
}, se = async (t, n, r, i) => {
|
|
4600
|
-
let a =
|
|
4631
|
+
let a = te.get(t);
|
|
4601
4632
|
if (a) {
|
|
4602
4633
|
if (a.partialUpdatePolicy === "trust") {
|
|
4603
4634
|
ae(t, n);
|
|
@@ -4630,7 +4661,7 @@ var xo = {
|
|
|
4630
4661
|
}
|
|
4631
4662
|
}
|
|
4632
4663
|
}, ce = (t, n, r = "deep-merge") => {
|
|
4633
|
-
let i =
|
|
4664
|
+
let i = te.get(t);
|
|
4634
4665
|
if (!i) return;
|
|
4635
4666
|
let a = e.getState().reportStates[t], o = ie(a?.payload, n, r);
|
|
4636
4667
|
i.commitState({
|
|
@@ -4639,7 +4670,7 @@ var xo = {
|
|
|
4639
4670
|
status: o === void 0 ? "idle" : "ready"
|
|
4640
4671
|
});
|
|
4641
4672
|
}, le = async (t, n, r = "deep-merge", i, a) => {
|
|
4642
|
-
let o =
|
|
4673
|
+
let o = te.get(t);
|
|
4643
4674
|
if (!o) return;
|
|
4644
4675
|
if (o.partialUpdatePolicy === "trust") {
|
|
4645
4676
|
ce(t, n, r);
|
|
@@ -4673,12 +4704,12 @@ var xo = {
|
|
|
4673
4704
|
ce(t, n, r);
|
|
4674
4705
|
}
|
|
4675
4706
|
}, ue = (t) => {
|
|
4676
|
-
let n =
|
|
4707
|
+
let n = w.get(t.fieldId);
|
|
4677
4708
|
if (!n) return;
|
|
4678
4709
|
let r = e.getState().fieldStates[t.fieldId];
|
|
4679
4710
|
if (!r) return;
|
|
4680
4711
|
let i = t.value === void 0 ? r.value : n.coerceValue(t.value);
|
|
4681
|
-
n.commitState(
|
|
4712
|
+
n.commitState(ec({
|
|
4682
4713
|
...r,
|
|
4683
4714
|
value: i,
|
|
4684
4715
|
touched: t.touched ?? r.touched,
|
|
@@ -4711,29 +4742,29 @@ var xo = {
|
|
|
4711
4742
|
if (S.getCurrentRequestId() !== c) throw S.clear(c), l(S.getAbortReason(c) || "superseded");
|
|
4712
4743
|
if (!v.valid) throw S.clear(c), new a(v);
|
|
4713
4744
|
if (o?.signal?.aborted) throw S.clear(c), l(String(o.signal.reason ?? ""));
|
|
4714
|
-
let y =
|
|
4745
|
+
let y = zs(f, ee);
|
|
4715
4746
|
S.setActiveController(c, typeof AbortController < "u" ? new AbortController() : null), S.attachExternalSignal(o, c), e.batch(() => {
|
|
4716
|
-
g(),
|
|
4747
|
+
g(), C.start(c);
|
|
4717
4748
|
});
|
|
4718
|
-
let b = h(), x = e.getState().lifecycleVersion,
|
|
4749
|
+
let b = h(), x = e.getState().lifecycleVersion, w = S.createSignal(o);
|
|
4719
4750
|
try {
|
|
4720
|
-
let a =
|
|
4751
|
+
let a = Ls(y);
|
|
4721
4752
|
if (await i?.beforeSubmit?.({
|
|
4722
4753
|
backend: _,
|
|
4723
4754
|
...a,
|
|
4724
4755
|
submitCount: b,
|
|
4725
|
-
signal:
|
|
4726
|
-
}),
|
|
4727
|
-
let o =
|
|
4756
|
+
signal: w
|
|
4757
|
+
}), w.aborted || S.isAborted(c)) throw l(S.getAbortReason(c));
|
|
4758
|
+
let o = Ls(y), u = {
|
|
4728
4759
|
backend: _,
|
|
4729
4760
|
...o,
|
|
4730
4761
|
fields: d.fields,
|
|
4731
4762
|
reports: d.reports,
|
|
4732
|
-
metadata: { estimatedPayloadBytes:
|
|
4763
|
+
metadata: { estimatedPayloadBytes: Is({
|
|
4733
4764
|
values: o.serializedValues,
|
|
4734
4765
|
fieldValues: o.serializedFieldValues
|
|
4735
4766
|
}) },
|
|
4736
|
-
signal:
|
|
4767
|
+
signal: w
|
|
4737
4768
|
}, f;
|
|
4738
4769
|
if (r.stream) {
|
|
4739
4770
|
let i = !1, a = await r.stream(u);
|
|
@@ -4745,37 +4776,37 @@ var xo = {
|
|
|
4745
4776
|
details: { backend: _ }
|
|
4746
4777
|
});
|
|
4747
4778
|
} else f = await r.submit(u);
|
|
4748
|
-
if (!(S.getCurrentRequestId() === c && e.getState().lifecycleVersion === x && !
|
|
4749
|
-
let m =
|
|
4779
|
+
if (!(S.getCurrentRequestId() === c && e.getState().lifecycleVersion === x && !w.aborted && !S.isAborted(c))) throw l(S.getAbortReason(c));
|
|
4780
|
+
let m = Bs(f), h = {
|
|
4750
4781
|
backend: _,
|
|
4751
4782
|
...y,
|
|
4752
4783
|
reports: m.reports ?? {},
|
|
4753
4784
|
meta: m.meta ?? {},
|
|
4754
4785
|
raw: m.raw
|
|
4755
|
-
}, g = await
|
|
4786
|
+
}, g = await Vs(p, {
|
|
4756
4787
|
...h,
|
|
4757
4788
|
reportStates: {}
|
|
4758
|
-
}), v =
|
|
4789
|
+
}), v = Cc(p, h, g), ee = wc(p, v);
|
|
4759
4790
|
e.batch(() => {
|
|
4760
|
-
|
|
4791
|
+
Hs(p, g), C.succeed(ee);
|
|
4761
4792
|
});
|
|
4762
4793
|
try {
|
|
4763
|
-
let e =
|
|
4794
|
+
let e = Ls(y);
|
|
4764
4795
|
await i?.afterSubmit?.({
|
|
4765
4796
|
backend: _,
|
|
4766
4797
|
...e,
|
|
4767
4798
|
submitCount: b,
|
|
4768
|
-
result:
|
|
4799
|
+
result: wc(p, v)
|
|
4769
4800
|
});
|
|
4770
4801
|
} catch (e) {
|
|
4771
4802
|
if (s?.afterSubmit !== "preserve-success") throw e;
|
|
4772
4803
|
await T(_, y, b, e);
|
|
4773
4804
|
}
|
|
4774
|
-
return
|
|
4805
|
+
return wc(p, v);
|
|
4775
4806
|
} catch (e) {
|
|
4776
|
-
return u(e) ||
|
|
4807
|
+
return u(e) || w.aborted || S.isAborted(c) ? await E(e, c, x, b, y, _) : await ne(e, c, x, b, y, _);
|
|
4777
4808
|
} finally {
|
|
4778
|
-
S.clear(c),
|
|
4809
|
+
S.clear(c), C.clear(c);
|
|
4779
4810
|
}
|
|
4780
4811
|
},
|
|
4781
4812
|
abort(e) {
|
|
@@ -4785,7 +4816,7 @@ var xo = {
|
|
|
4785
4816
|
S.reset();
|
|
4786
4817
|
}
|
|
4787
4818
|
};
|
|
4788
|
-
},
|
|
4819
|
+
}, Ec = (e, t, n) => {
|
|
4789
4820
|
e.update((e) => ({
|
|
4790
4821
|
...e,
|
|
4791
4822
|
fieldStates: {
|
|
@@ -4793,17 +4824,17 @@ var xo = {
|
|
|
4793
4824
|
[t]: n
|
|
4794
4825
|
}
|
|
4795
4826
|
}));
|
|
4796
|
-
},
|
|
4797
|
-
let c =
|
|
4798
|
-
|
|
4799
|
-
let u = () => n.getState().fieldStates[e.id], d =
|
|
4827
|
+
}, Dc = ({ config: e, definition: t, store: n, getValues: i, getSubmitCount: a, getFormStatus: o, onValueChange: s }) => {
|
|
4828
|
+
let c = Ho(Z(e)), l = cc(t, c, c.defaultValue === void 0 ? t.getDefaultValue?.(c) : c.defaultValue, i(), a(), o());
|
|
4829
|
+
Ec(n, e.id, l);
|
|
4830
|
+
let u = () => n.getState().fieldStates[e.id], d = lc({
|
|
4800
4831
|
config: c,
|
|
4801
4832
|
definition: t,
|
|
4802
4833
|
store: n,
|
|
4803
4834
|
getValues: i,
|
|
4804
4835
|
getSubmitCount: a,
|
|
4805
4836
|
getFormStatus: o,
|
|
4806
|
-
commitState: (e, t) =>
|
|
4837
|
+
commitState: (e, t) => Ec(n, e, t)
|
|
4807
4838
|
});
|
|
4808
4839
|
return {
|
|
4809
4840
|
get id() {
|
|
@@ -4816,7 +4847,7 @@ var xo = {
|
|
|
4816
4847
|
return c;
|
|
4817
4848
|
},
|
|
4818
4849
|
get state() {
|
|
4819
|
-
return
|
|
4850
|
+
return pc(u());
|
|
4820
4851
|
},
|
|
4821
4852
|
get descriptor() {
|
|
4822
4853
|
return t.describe(c, {
|
|
@@ -4844,16 +4875,16 @@ var xo = {
|
|
|
4844
4875
|
d.abort("value-updated"), this.commitState(this.prepareValue(e, t));
|
|
4845
4876
|
},
|
|
4846
4877
|
prepareValue(e, n) {
|
|
4847
|
-
let i = u(), s =
|
|
4878
|
+
let i = u(), s = rc(t, c, e), l = Qs(c, n, a(), o());
|
|
4848
4879
|
if (!l.visible) throw new r(`Field "${c.id}" is hidden and cannot be updated.`);
|
|
4849
4880
|
if (l.disabled) throw new r(`Field "${c.id}" is disabled and cannot be updated.`);
|
|
4850
4881
|
if (l.readOnly) throw new r(`Field "${c.id}" is read-only and cannot be updated.`);
|
|
4851
|
-
let d =
|
|
4852
|
-
return
|
|
4882
|
+
let d = sc(t, c, s, n, a(), l);
|
|
4883
|
+
return ec({
|
|
4853
4884
|
...i,
|
|
4854
4885
|
value: s,
|
|
4855
4886
|
touched: !0,
|
|
4856
|
-
dirty: !
|
|
4887
|
+
dirty: !ac(t, c, s, i.initialValue),
|
|
4857
4888
|
visible: l.visible,
|
|
4858
4889
|
disabled: l.disabled,
|
|
4859
4890
|
readOnly: l.readOnly,
|
|
@@ -4863,11 +4894,11 @@ var xo = {
|
|
|
4863
4894
|
});
|
|
4864
4895
|
},
|
|
4865
4896
|
commitState(e) {
|
|
4866
|
-
|
|
4897
|
+
Ec(n, c.id, e);
|
|
4867
4898
|
},
|
|
4868
4899
|
blur() {
|
|
4869
4900
|
let e = u();
|
|
4870
|
-
|
|
4901
|
+
Ec(n, c.id, {
|
|
4871
4902
|
...e,
|
|
4872
4903
|
touched: !0
|
|
4873
4904
|
}), n.update((e) => ({
|
|
@@ -4880,13 +4911,13 @@ var xo = {
|
|
|
4880
4911
|
return d.validate(u(), e);
|
|
4881
4912
|
},
|
|
4882
4913
|
reset() {
|
|
4883
|
-
d.abort("field-reset"),
|
|
4914
|
+
d.abort("field-reset"), Ec(n, c.id, { ...l });
|
|
4884
4915
|
},
|
|
4885
4916
|
subscribe(e) {
|
|
4886
4917
|
let t = u();
|
|
4887
4918
|
return n.subscribe(() => {
|
|
4888
4919
|
let r = n.getState().fieldStates[c.id];
|
|
4889
|
-
|
|
4920
|
+
hs(t, r) || (t = r, e(pc(r)));
|
|
4890
4921
|
});
|
|
4891
4922
|
},
|
|
4892
4923
|
serialize() {
|
|
@@ -4894,20 +4925,20 @@ var xo = {
|
|
|
4894
4925
|
return t.serializeValue ? t.serializeValue(e, c) : e;
|
|
4895
4926
|
},
|
|
4896
4927
|
coerceValue(e) {
|
|
4897
|
-
return
|
|
4928
|
+
return rc(t, c, e);
|
|
4898
4929
|
},
|
|
4899
4930
|
setExternalErrors(e) {
|
|
4900
4931
|
let t = u();
|
|
4901
|
-
|
|
4932
|
+
Ec(n, c.id, ec({
|
|
4902
4933
|
...t,
|
|
4903
4934
|
externalErrors: [...e]
|
|
4904
4935
|
}));
|
|
4905
4936
|
},
|
|
4906
4937
|
refresh(e) {
|
|
4907
|
-
let r = u(), s = e?.values ?? i(), l =
|
|
4938
|
+
let r = u(), s = e?.values ?? i(), l = Qs(c, s, a(), o()), d = c.inactiveFieldPolicy ?? e?.inactiveFieldPolicy, f = rc(t, c, (e?.resetInactiveToInitial === !0 || d === "reset-on-hide") && (!l.visible || l.disabled) ? r.initialValue : r.value), p = sc(t, c, f, s, a(), l), m = e?.preserveValidationErrors && l.visible && !l.disabled ? [...r.validationErrors] : [], h = e?.preserveExternalErrors && l.visible && !l.disabled ? [...r.externalErrors] : [], g = ec({
|
|
4908
4939
|
...r,
|
|
4909
4940
|
value: f,
|
|
4910
|
-
dirty: !
|
|
4941
|
+
dirty: !ac(t, c, f, r.initialValue),
|
|
4911
4942
|
visible: l.visible,
|
|
4912
4943
|
disabled: l.disabled,
|
|
4913
4944
|
readOnly: l.readOnly,
|
|
@@ -4916,24 +4947,24 @@ var xo = {
|
|
|
4916
4947
|
externalErrors: h,
|
|
4917
4948
|
validationVersion: r.validationVersion
|
|
4918
4949
|
});
|
|
4919
|
-
return
|
|
4950
|
+
return Ec(n, c.id, g), g;
|
|
4920
4951
|
}
|
|
4921
4952
|
};
|
|
4922
|
-
},
|
|
4953
|
+
}, Oc = {
|
|
4923
4954
|
payload: void 0,
|
|
4924
4955
|
error: null,
|
|
4925
4956
|
status: "idle"
|
|
4926
|
-
},
|
|
4957
|
+
}, kc = {
|
|
4927
4958
|
payload: void 0,
|
|
4928
4959
|
error: null,
|
|
4929
4960
|
status: "loading"
|
|
4930
|
-
},
|
|
4961
|
+
}, Ac = (e, t, n) => {
|
|
4931
4962
|
if (n !== void 0) return e.clonePayload ? e.clonePayload(n, t) : Z(n);
|
|
4932
|
-
},
|
|
4933
|
-
payload:
|
|
4963
|
+
}, jc = (e, t, n) => ({
|
|
4964
|
+
payload: Ac(e, t, n.payload),
|
|
4934
4965
|
error: n.error,
|
|
4935
4966
|
status: n.status
|
|
4936
|
-
}),
|
|
4967
|
+
}), Mc = (e, t, n) => {
|
|
4937
4968
|
e.update((e) => ({
|
|
4938
4969
|
...e,
|
|
4939
4970
|
reportStates: {
|
|
@@ -4941,9 +4972,9 @@ var xo = {
|
|
|
4941
4972
|
[t]: n
|
|
4942
4973
|
}
|
|
4943
4974
|
}));
|
|
4944
|
-
},
|
|
4945
|
-
let r =
|
|
4946
|
-
return
|
|
4975
|
+
}, Nc = ({ config: e, definition: t, store: n }) => {
|
|
4976
|
+
let r = Ho(Z(e));
|
|
4977
|
+
return Mc(n, r.id, Oc), {
|
|
4947
4978
|
get id() {
|
|
4948
4979
|
return r.id;
|
|
4949
4980
|
},
|
|
@@ -4957,7 +4988,7 @@ var xo = {
|
|
|
4957
4988
|
return t.partialUpdatePolicy ?? "trust";
|
|
4958
4989
|
},
|
|
4959
4990
|
get state() {
|
|
4960
|
-
return
|
|
4991
|
+
return jc(t, r, n.getState().reportStates[r.id]);
|
|
4961
4992
|
},
|
|
4962
4993
|
get descriptor() {
|
|
4963
4994
|
let e = this.state;
|
|
@@ -4969,7 +5000,7 @@ var xo = {
|
|
|
4969
5000
|
});
|
|
4970
5001
|
},
|
|
4971
5002
|
cloneState(e) {
|
|
4972
|
-
return
|
|
5003
|
+
return jc(t, r, e);
|
|
4973
5004
|
},
|
|
4974
5005
|
async prepareState(e) {
|
|
4975
5006
|
let n;
|
|
@@ -4986,13 +5017,13 @@ var xo = {
|
|
|
4986
5017
|
};
|
|
4987
5018
|
}
|
|
4988
5019
|
if (n === void 0 || !t.payloadSchema) return {
|
|
4989
|
-
payload:
|
|
5020
|
+
payload: Ac(t, r, n),
|
|
4990
5021
|
error: null,
|
|
4991
5022
|
status: n === void 0 ? "idle" : "ready"
|
|
4992
5023
|
};
|
|
4993
5024
|
try {
|
|
4994
5025
|
return {
|
|
4995
|
-
payload:
|
|
5026
|
+
payload: Ac(t, r, t.payloadSchema.parse(n)),
|
|
4996
5027
|
error: null,
|
|
4997
5028
|
status: "ready"
|
|
4998
5029
|
};
|
|
@@ -5007,35 +5038,35 @@ var xo = {
|
|
|
5007
5038
|
}
|
|
5008
5039
|
},
|
|
5009
5040
|
commitState(e) {
|
|
5010
|
-
|
|
5041
|
+
Mc(n, r.id, this.cloneState(e));
|
|
5011
5042
|
},
|
|
5012
5043
|
async update(e) {
|
|
5013
5044
|
this.commitState(await this.prepareState(e));
|
|
5014
5045
|
},
|
|
5015
5046
|
markLoading() {
|
|
5016
|
-
|
|
5047
|
+
Mc(n, r.id, kc);
|
|
5017
5048
|
},
|
|
5018
5049
|
reset() {
|
|
5019
|
-
|
|
5050
|
+
Mc(n, r.id, Oc);
|
|
5020
5051
|
},
|
|
5021
5052
|
subscribe(e) {
|
|
5022
5053
|
let t = n.getState().reportStates[r.id];
|
|
5023
5054
|
return n.subscribe(() => {
|
|
5024
5055
|
let i = n.getState().reportStates[r.id];
|
|
5025
|
-
|
|
5056
|
+
hs(t, i) || (t = i, e(this.cloneState(i)));
|
|
5026
5057
|
});
|
|
5027
5058
|
}
|
|
5028
5059
|
};
|
|
5029
|
-
},
|
|
5060
|
+
}, Pc = (e, t, n, a) => {
|
|
5030
5061
|
if (typeof n != "object" || !n) throw new r(`Series field "${e}" requires "${t}" configuration.`);
|
|
5031
5062
|
let o = "kind" in n && typeof n.kind == "string" ? n.kind : "";
|
|
5032
5063
|
if (o.length === 0) throw new r(`Series field "${e}" requires "${t}.kind".`);
|
|
5033
5064
|
if (o === "series") throw new r(`Series field "${e}" cannot nest series in "${t}".`);
|
|
5034
5065
|
if (!a.getField(o)) throw new i(`Series field "${e}" uses unknown sub-field kind "${o}" in "${t}".`);
|
|
5035
|
-
},
|
|
5036
|
-
if (e.kind === "series" && (
|
|
5037
|
-
},
|
|
5038
|
-
let a =
|
|
5066
|
+
}, Fc = (e, t) => {
|
|
5067
|
+
if (e.kind === "series" && (Pc(e.label, "field1", e.field1, t), Pc(e.label, "field2", e.field2, t), typeof e.minPoints == "number" && typeof e.maxPoints == "number" && e.minPoints > e.maxPoints)) throw new r(`Series field "${e.label}" requires minPoints to be less than or equal to maxPoints.`);
|
|
5068
|
+
}, Ic = (e, t, n, i) => {
|
|
5069
|
+
let a = Io((e ?? t) || i);
|
|
5039
5070
|
if (e) {
|
|
5040
5071
|
if (n.has(a)) throw new r(`Duplicate explicit id "${a}" in schema.`);
|
|
5041
5072
|
return n.add(a), a;
|
|
@@ -5043,50 +5074,50 @@ var xo = {
|
|
|
5043
5074
|
let o = a, s = 2;
|
|
5044
5075
|
for (; n.has(o);) o = `${a}-${s}`, s += 1;
|
|
5045
5076
|
return n.add(o), o;
|
|
5046
|
-
},
|
|
5077
|
+
}, Lc = (e, t, n, r) => {
|
|
5047
5078
|
let a = n.getField(e.kind);
|
|
5048
5079
|
if (!a) throw new i(`Unknown field kind "${e.kind}".`);
|
|
5049
5080
|
let o = a.schema.parse(e);
|
|
5050
|
-
|
|
5051
|
-
let s =
|
|
5081
|
+
Fc(o, n);
|
|
5082
|
+
let s = Ic(o.id, o.label, r, `field-${t + 1}`);
|
|
5052
5083
|
return {
|
|
5053
5084
|
...o,
|
|
5054
5085
|
id: s
|
|
5055
5086
|
};
|
|
5056
|
-
},
|
|
5087
|
+
}, Rc = (e, t, n, r) => {
|
|
5057
5088
|
let a = n.getReport(e.kind);
|
|
5058
5089
|
if (!a) throw new i(`Unknown report kind "${e.kind}".`);
|
|
5059
|
-
let o = a.schema.parse(e), s =
|
|
5090
|
+
let o = a.schema.parse(e), s = Ic(o.id, o.label ?? o.kind, r, `report-${t + 1}`);
|
|
5060
5091
|
return {
|
|
5061
5092
|
...o,
|
|
5062
5093
|
id: s,
|
|
5063
5094
|
source: o.source ?? s
|
|
5064
5095
|
};
|
|
5065
|
-
},
|
|
5096
|
+
}, zc = (e, t, n, r) => {
|
|
5066
5097
|
let a = n.getExplanation(e.kind);
|
|
5067
5098
|
if (!a) throw new i(`Unknown explanation kind "${e.kind}".`);
|
|
5068
|
-
let o = a.schema.parse(e), s =
|
|
5099
|
+
let o = a.schema.parse(e), s = Ic(o.id, o.label ?? o.kind, r, `explanation-${t + 1}`);
|
|
5069
5100
|
return {
|
|
5070
5101
|
...o,
|
|
5071
5102
|
id: s
|
|
5072
5103
|
};
|
|
5073
|
-
},
|
|
5104
|
+
}, Bc = (e, t) => {
|
|
5074
5105
|
let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
5075
5106
|
return {
|
|
5076
|
-
fields: e.fields.map((e, r) =>
|
|
5077
|
-
reports: (e.reports ?? []).map((e, n) =>
|
|
5078
|
-
explanations: (e.explanations ?? []).map((e, n) =>
|
|
5107
|
+
fields: e.fields.map((e, r) => Lc(e, r, t, n)),
|
|
5108
|
+
reports: (e.reports ?? []).map((e, n) => Rc(e, n, t, r)),
|
|
5109
|
+
explanations: (e.explanations ?? []).map((e, n) => zc(e, n, t, i))
|
|
5079
5110
|
};
|
|
5080
|
-
},
|
|
5111
|
+
}, Vc = (e) => {
|
|
5081
5112
|
if (!e || typeof e.submit != "function") throw new r("createForm requires a transport with a submit(request) function.");
|
|
5082
|
-
},
|
|
5083
|
-
|
|
5084
|
-
let t =
|
|
5113
|
+
}, Hc = (e) => {
|
|
5114
|
+
Vc(e.transport);
|
|
5115
|
+
let t = Bc(e.schema, e.registry), n = _c(uc(), {
|
|
5085
5116
|
listenerErrorPolicy: e.listenerErrorPolicy ?? "ignore",
|
|
5086
5117
|
onListenerError: e.onListenerError
|
|
5087
|
-
}), i = n.getState(), a =
|
|
5118
|
+
}), i = n.getState(), a = hc(i), o = () => {
|
|
5088
5119
|
let e = n.getState();
|
|
5089
|
-
return e !== i && (i = e, a =
|
|
5120
|
+
return e !== i && (i = e, a = hc(e)), a;
|
|
5090
5121
|
}, s = () => Object.fromEntries(Object.entries(n.getState().fieldStates).map(([e, t]) => [e, Z(t.value)])), c = () => n.getState().submitCount, l = () => n.getState().status, u = (e) => {
|
|
5091
5122
|
for (let t in e) {
|
|
5092
5123
|
let n = e[t];
|
|
@@ -5096,7 +5127,7 @@ var xo = {
|
|
|
5096
5127
|
}, d = () => e.inactiveFieldPolicy === "reset-on-hide", f = (t) => t.config.inactiveFieldPolicy ?? e.inactiveFieldPolicy ?? "omit", p = t.fields.map((t) => {
|
|
5097
5128
|
let i = e.registry.getField(t.kind);
|
|
5098
5129
|
if (!i) throw new r(`Field definition "${t.kind}" disappeared during form creation.`);
|
|
5099
|
-
return
|
|
5130
|
+
return Dc({
|
|
5100
5131
|
config: {
|
|
5101
5132
|
...t,
|
|
5102
5133
|
defaultValue: e.initialValues?.[t.id] === void 0 ? t.defaultValue : e.initialValues[t.id]
|
|
@@ -5112,20 +5143,20 @@ var xo = {
|
|
|
5112
5143
|
type: "editing",
|
|
5113
5144
|
clearFormErrors: !0,
|
|
5114
5145
|
bumpLifecycle: !0
|
|
5115
|
-
})),
|
|
5146
|
+
})), E({
|
|
5116
5147
|
values: r,
|
|
5117
5148
|
preserveValidationErrors: !1,
|
|
5118
5149
|
preserveExternalErrors: !1,
|
|
5119
5150
|
resetInactiveToInitial: d(),
|
|
5120
5151
|
inactiveFieldPolicy: e.inactiveFieldPolicy
|
|
5121
|
-
});
|
|
5152
|
+
}), v(t, r);
|
|
5122
5153
|
});
|
|
5123
5154
|
}
|
|
5124
5155
|
});
|
|
5125
5156
|
}), m = t.reports.map((t) => {
|
|
5126
5157
|
let i = e.registry.getReport(t.kind);
|
|
5127
5158
|
if (!i) throw new r(`Report definition "${t.kind}" disappeared during form creation.`);
|
|
5128
|
-
return
|
|
5159
|
+
return Nc({
|
|
5129
5160
|
config: t,
|
|
5130
5161
|
definition: i,
|
|
5131
5162
|
store: n
|
|
@@ -5133,20 +5164,51 @@ var xo = {
|
|
|
5133
5164
|
}), h = t.explanations.map((t) => {
|
|
5134
5165
|
let i = e.registry.getExplanation(t.kind);
|
|
5135
5166
|
if (!i) throw new r(`Explanation definition "${t.kind}" disappeared during form creation.`);
|
|
5136
|
-
return
|
|
5167
|
+
return Os({
|
|
5137
5168
|
config: t,
|
|
5138
5169
|
definition: i,
|
|
5139
5170
|
store: n,
|
|
5140
5171
|
hooks: e.hooks
|
|
5141
5172
|
});
|
|
5142
|
-
}), g = new Map(p.map((e) => [e.id, e])), _ =
|
|
5173
|
+
}), g = new Map(p.map((e) => [e.id, e])), _ = /* @__PURE__ */ new Map();
|
|
5174
|
+
for (let e of p) if (e.kind === "mapped-category") {
|
|
5175
|
+
let t = e.config;
|
|
5176
|
+
for (let n of t.options) if (n.mapping) {
|
|
5177
|
+
for (let t of Object.keys(n.mapping)) if (!g.has(t)) throw new r(`mapped-category "${e.id}": mapping references unknown field "${t}".`);
|
|
5178
|
+
}
|
|
5179
|
+
_.set(e.id, t);
|
|
5180
|
+
}
|
|
5181
|
+
let v = (t, i) => {
|
|
5182
|
+
let a = _.get(t);
|
|
5183
|
+
if (!a) return;
|
|
5184
|
+
let o = i[t], s = a.options.find((e) => e.value === o);
|
|
5185
|
+
if (s?.mapping) for (let [a, o] of Object.entries(s.mapping)) {
|
|
5186
|
+
let s = g.get(a);
|
|
5187
|
+
if (!s) throw new r(`mapped-category "${t}": target field "${a}" not found in schema.`);
|
|
5188
|
+
let l = s.coerceValue(o), u = e.registry.getField(s.kind);
|
|
5189
|
+
if (u?.validate) {
|
|
5190
|
+
let e = u.validate(l, s.config, {
|
|
5191
|
+
field: s.config,
|
|
5192
|
+
values: i,
|
|
5193
|
+
submitCount: c(),
|
|
5194
|
+
validationVersion: 0
|
|
5195
|
+
});
|
|
5196
|
+
if (Array.isArray(e) && e.length > 0) throw new r(`mapped-category "${t}": value ${JSON.stringify(o)} invalid for "${a}": ${e.join(", ")}`);
|
|
5197
|
+
}
|
|
5198
|
+
let d = n.getState().fieldStates[a];
|
|
5199
|
+
d && s.commitState({
|
|
5200
|
+
...d,
|
|
5201
|
+
value: l
|
|
5202
|
+
});
|
|
5203
|
+
}
|
|
5204
|
+
}, y = new Map(m.map((e) => [e.id, e])), b = new Map(h.map((e) => [e.id, e])), ee = Object.freeze([...p]), x = Object.freeze([...m]), S = Object.freeze([...h]), C = () => {
|
|
5143
5205
|
for (let e of m) e.reset();
|
|
5144
|
-
},
|
|
5206
|
+
}, w = () => {
|
|
5145
5207
|
for (let e of h) e.reset();
|
|
5146
5208
|
}, te = () => {
|
|
5147
5209
|
for (let e of m) e.markLoading();
|
|
5148
|
-
},
|
|
5149
|
-
function
|
|
5210
|
+
}, T = () => (n.update((e) => $(e, { type: "bump-lifecycle" })), n.getState().lifecycleVersion);
|
|
5211
|
+
function E(t) {
|
|
5150
5212
|
n.batch(() => {
|
|
5151
5213
|
let n = t?.resetInactiveToInitial === !0 ? { ...t.values ?? s() } : t?.values;
|
|
5152
5214
|
for (let r of p) {
|
|
@@ -5159,7 +5221,7 @@ var xo = {
|
|
|
5159
5221
|
}
|
|
5160
5222
|
});
|
|
5161
5223
|
}
|
|
5162
|
-
let
|
|
5224
|
+
let ne = bc({
|
|
5163
5225
|
store: n,
|
|
5164
5226
|
fields: p,
|
|
5165
5227
|
normalizedSchema: t,
|
|
@@ -5168,14 +5230,14 @@ var xo = {
|
|
|
5168
5230
|
getValues: s,
|
|
5169
5231
|
getSubmitCount: c,
|
|
5170
5232
|
getFormStatus: l,
|
|
5171
|
-
syncDerivedFieldState:
|
|
5233
|
+
syncDerivedFieldState: E,
|
|
5172
5234
|
setRestingStatus: () => {
|
|
5173
5235
|
n.batch(() => {
|
|
5174
5236
|
let t = u(n.getState().fieldStates) ? "editing" : "idle";
|
|
5175
5237
|
n.update((e) => $(e, {
|
|
5176
5238
|
type: "rest",
|
|
5177
5239
|
status: t
|
|
5178
|
-
})),
|
|
5240
|
+
})), E({
|
|
5179
5241
|
preserveValidationErrors: !0,
|
|
5180
5242
|
preserveExternalErrors: !0,
|
|
5181
5243
|
resetInactiveToInitial: d(),
|
|
@@ -5185,7 +5247,7 @@ var xo = {
|
|
|
5185
5247
|
},
|
|
5186
5248
|
shouldResetInactiveFields: d,
|
|
5187
5249
|
inactiveFieldPolicy: e.inactiveFieldPolicy
|
|
5188
|
-
}),
|
|
5250
|
+
}), re = Tc({
|
|
5189
5251
|
store: n,
|
|
5190
5252
|
transport: e.transport,
|
|
5191
5253
|
hooks: e.hooks,
|
|
@@ -5193,30 +5255,30 @@ var xo = {
|
|
|
5193
5255
|
normalizedSchema: t,
|
|
5194
5256
|
fields: p,
|
|
5195
5257
|
reports: m,
|
|
5196
|
-
validate: () =>
|
|
5258
|
+
validate: () => ne.validate(),
|
|
5197
5259
|
getSubmitCount: c,
|
|
5198
5260
|
markReportsLoading: te,
|
|
5199
|
-
resetReports:
|
|
5200
|
-
resetExplanations:
|
|
5201
|
-
syncDerivedFieldState:
|
|
5261
|
+
resetReports: C,
|
|
5262
|
+
resetExplanations: w,
|
|
5263
|
+
syncDerivedFieldState: E,
|
|
5202
5264
|
shouldResetInactiveFields: d,
|
|
5203
5265
|
resolveInactiveFieldPolicy: f,
|
|
5204
5266
|
inactiveFieldPolicy: e.inactiveFieldPolicy
|
|
5205
5267
|
});
|
|
5206
|
-
return
|
|
5268
|
+
return E({
|
|
5207
5269
|
preserveValidationErrors: !1,
|
|
5208
5270
|
preserveExternalErrors: !1,
|
|
5209
5271
|
resetInactiveToInitial: d(),
|
|
5210
5272
|
inactiveFieldPolicy: e.inactiveFieldPolicy
|
|
5211
5273
|
}), {
|
|
5212
5274
|
get fields() {
|
|
5213
|
-
return
|
|
5275
|
+
return ee;
|
|
5214
5276
|
},
|
|
5215
5277
|
get reports() {
|
|
5216
|
-
return
|
|
5278
|
+
return x;
|
|
5217
5279
|
},
|
|
5218
5280
|
get explanations() {
|
|
5219
|
-
return
|
|
5281
|
+
return S;
|
|
5220
5282
|
},
|
|
5221
5283
|
get state() {
|
|
5222
5284
|
return o();
|
|
@@ -5225,10 +5287,10 @@ var xo = {
|
|
|
5225
5287
|
return g.get(e);
|
|
5226
5288
|
},
|
|
5227
5289
|
getReport(e) {
|
|
5228
|
-
return
|
|
5290
|
+
return y.get(e);
|
|
5229
5291
|
},
|
|
5230
5292
|
getExplanation(e) {
|
|
5231
|
-
return
|
|
5293
|
+
return b.get(e);
|
|
5232
5294
|
},
|
|
5233
5295
|
getValues() {
|
|
5234
5296
|
return s();
|
|
@@ -5246,7 +5308,7 @@ var xo = {
|
|
|
5246
5308
|
if (!n) throw new r(`Unknown field "${e}".`);
|
|
5247
5309
|
o.set(e, n.prepareValue(t, a));
|
|
5248
5310
|
}
|
|
5249
|
-
|
|
5311
|
+
T();
|
|
5250
5312
|
for (let [e, t] of o) {
|
|
5251
5313
|
let n = g.get(e);
|
|
5252
5314
|
if (!n) throw new r(`Unknown field "${e}".`);
|
|
@@ -5255,29 +5317,30 @@ var xo = {
|
|
|
5255
5317
|
n.update((e) => $(e, {
|
|
5256
5318
|
type: "editing",
|
|
5257
5319
|
clearFormErrors: !0
|
|
5258
|
-
})),
|
|
5320
|
+
})), E({
|
|
5259
5321
|
values: a,
|
|
5260
5322
|
preserveValidationErrors: !1,
|
|
5261
5323
|
preserveExternalErrors: !1,
|
|
5262
5324
|
resetInactiveToInitial: d(),
|
|
5263
5325
|
inactiveFieldPolicy: e.inactiveFieldPolicy
|
|
5264
5326
|
});
|
|
5327
|
+
for (let [e] of i) v(e, a);
|
|
5265
5328
|
});
|
|
5266
5329
|
},
|
|
5267
5330
|
validate() {
|
|
5268
|
-
return
|
|
5331
|
+
return ne.validate();
|
|
5269
5332
|
},
|
|
5270
5333
|
submit(e) {
|
|
5271
|
-
return
|
|
5334
|
+
return re.submit(e);
|
|
5272
5335
|
},
|
|
5273
5336
|
abortSubmit(e) {
|
|
5274
|
-
|
|
5337
|
+
re.abort(e);
|
|
5275
5338
|
},
|
|
5276
5339
|
reset() {
|
|
5277
5340
|
n.batch(() => {
|
|
5278
|
-
|
|
5341
|
+
re.abort("reset"), T();
|
|
5279
5342
|
for (let e of p) e.reset();
|
|
5280
|
-
|
|
5343
|
+
C(), w(), re.reset(), n.update((e) => $(e, { type: "reset" })), E({
|
|
5281
5344
|
preserveValidationErrors: !1,
|
|
5282
5345
|
preserveExternalErrors: !1
|
|
5283
5346
|
});
|
|
@@ -5289,7 +5352,7 @@ var xo = {
|
|
|
5289
5352
|
});
|
|
5290
5353
|
},
|
|
5291
5354
|
subscribeSelector(e, t, r) {
|
|
5292
|
-
let i = r?.equality ??
|
|
5355
|
+
let i = r?.equality ?? vs, a = e(o());
|
|
5293
5356
|
return r?.emitInitial && t(a, o()), n.subscribe(() => {
|
|
5294
5357
|
let n = o(), r = e(n);
|
|
5295
5358
|
i(a, r) || (a = r, t(r, n));
|
|
@@ -5298,4 +5361,4 @@ var xo = {
|
|
|
5298
5361
|
};
|
|
5299
5362
|
};
|
|
5300
5363
|
//#endregion
|
|
5301
|
-
export {
|
|
5364
|
+
export { w as A, Fo as C, S as D, x as E, i as F, s as I, c as L, v as M, m as N, te as O, r as P, o as R, Io as S, Mo as T, Ko as _, hs as a, Vo as b, _s as c, ds as d, us as f, qo as g, Jo as h, Os as i, ee as j, C as k, ps as l, Yo as m, Ns as n, gs as o, ls as p, As as r, vs as s, Hc as t, fs as u, Go as v, No as w, Ro as x, Wo as y, a as z };
|