mlform 0.1.7 → 0.1.8
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 +39 -12
- package/dist/builtins-DegwhFGA.js +3507 -0
- package/dist/builtins-ml-9qB2MOxt.js +51 -0
- package/dist/{design-system-CrrSGfFB.js → design-system-Dxx1Sh7r.js} +284 -268
- package/dist/errors-B3H1wRwj.js +8 -0
- package/dist/kit-CuRF6dhL.js +1847 -0
- package/dist/mlform/behaviors.mjs +32 -0
- package/dist/mlform/builtins-ml.mjs +3 -0
- package/dist/mlform/design-system.mjs +1 -1
- package/dist/mlform/kit.mjs +3 -3
- package/dist/mlform/presentation.mjs +2 -0
- package/dist/mlform/primitives.mjs +2 -2
- package/dist/mlform/runtime.mjs +5 -0
- package/dist/mlform/schema.mjs +102 -0
- package/dist/mlform/transport.mjs +2 -2
- package/dist/mlform.mjs +8 -4
- package/dist/presentation-CkQuYheR.js +200 -0
- package/dist/{primitives-BqjFDDhL.js → primitives-Duag8Lj0.js} +1367 -1312
- package/dist/runtime-DMjDVo0H.js +1824 -0
- package/dist/strings-CWwrrYzz.js +4 -0
- package/dist/{transport-A1RsnZhD.js → transport-CtVX8ZUT.js} +311 -336
- package/dist/types/src/behaviors/index.d.ts +3 -0
- package/dist/types/src/builtins-ml/index.d.ts +5 -0
- package/dist/types/src/design-system/runtime/fingerprint.d.ts +8 -0
- package/dist/types/src/design-system/runtime/host-observer.d.ts +1 -0
- package/dist/types/src/design-system/runtime/hydration-state.d.ts +13 -0
- package/dist/types/src/design-system/runtime/inherited-scheme.d.ts +5 -0
- package/dist/types/src/design-system/runtime/media.d.ts +19 -0
- package/dist/types/src/index.d.ts +10 -4
- package/dist/types/src/kit/accordion-root-styles.d.ts +1 -0
- package/dist/types/src/kit/accordion-root.d.ts +24 -0
- package/dist/types/src/kit/accordion.d.ts +2 -0
- package/dist/types/src/kit/constants.d.ts +29 -0
- package/dist/types/src/kit/defaults.d.ts +2 -2
- package/dist/types/src/kit/index.d.ts +6 -1
- package/dist/types/src/kit/layout-helpers.d.ts +29 -0
- package/dist/types/src/kit/layout-node-render.d.ts +18 -0
- package/dist/types/src/kit/layout-node-resolver.d.ts +3 -0
- package/dist/types/src/kit/layout-types.d.ts +124 -0
- package/dist/types/src/kit/layout-utils.d.ts +9 -0
- package/dist/types/src/kit/layout.d.ts +8 -0
- package/dist/types/src/kit/mount-types.d.ts +54 -0
- package/dist/types/src/kit/panel-nav.d.ts +9 -0
- package/dist/types/src/{questionnaire/primitives/components → kit}/step-indicator.d.ts +3 -3
- package/dist/types/src/kit/tabs-root-styles.d.ts +1 -0
- package/dist/types/src/kit/tabs-root.d.ts +24 -0
- package/dist/types/src/kit/tabs.d.ts +2 -0
- package/dist/types/src/kit/types.d.ts +4 -51
- package/dist/types/src/kit/view-layout-state.d.ts +14 -0
- package/dist/types/src/kit/view-navigation.d.ts +8 -0
- package/dist/types/src/kit/view-snapshot-cache.d.ts +14 -0
- package/dist/types/src/kit/view-snapshot.d.ts +15 -0
- package/dist/types/src/kit/view-types.d.ts +172 -0
- package/dist/types/src/kit/view.d.ts +8 -0
- package/dist/types/src/kit/wizard-constants.d.ts +19 -0
- package/dist/types/src/kit/wizard-root-styles.d.ts +1 -0
- package/dist/types/src/kit/wizard-root.d.ts +23 -0
- package/dist/types/src/kit/wizard.d.ts +2 -0
- package/dist/types/src/packs/default.d.ts +2 -0
- package/dist/types/src/packs/index.d.ts +3 -0
- package/dist/types/src/packs/ml.d.ts +2 -0
- package/dist/types/src/packs/shared.d.ts +25 -0
- package/dist/types/src/presentation/define-explanation-kind.d.ts +11 -0
- package/dist/types/src/presentation/define-field-kind.d.ts +18 -0
- package/dist/types/src/presentation/define-report-kind.d.ts +15 -0
- package/dist/types/src/presentation/index.d.ts +10 -0
- package/dist/types/src/presentation/register-kind.d.ts +6 -0
- package/dist/types/src/presentation/registry.d.ts +15 -0
- package/dist/types/src/presentation/types/explanation.d.ts +32 -0
- package/dist/types/src/presentation/types/field.d.ts +36 -0
- package/dist/types/src/presentation/types/report.d.ts +41 -0
- package/dist/types/src/primitives/base-explanation-element.d.ts +2 -1
- package/dist/types/src/primitives/base-field-element.d.ts +2 -1
- package/dist/types/src/primitives/base-report-element.d.ts +2 -1
- package/dist/types/src/primitives/components/explanation-panel.d.ts +4 -2
- package/dist/types/src/primitives/components/field-frame-feedback.d.ts +9 -0
- package/dist/types/src/primitives/components/field-frame-styles.d.ts +1 -0
- package/dist/types/src/primitives/components/field-frame.d.ts +5 -3
- package/dist/types/src/primitives/components/form-errors.d.ts +1 -1
- package/dist/types/src/primitives/components/form-root-presenters.d.ts +17 -0
- package/dist/types/src/primitives/components/form-root-state.d.ts +19 -0
- package/dist/types/src/primitives/components/form-root-styles.d.ts +1 -0
- package/dist/types/src/primitives/components/form-root-templates.d.ts +42 -0
- package/dist/types/src/primitives/components/form-root.d.ts +4 -2
- package/dist/types/src/primitives/components/presentation.d.ts +1 -1
- package/dist/types/src/primitives/components/report-frame.d.ts +4 -2
- package/dist/types/src/primitives/components/submit-button.d.ts +1 -1
- package/dist/types/src/primitives/constants.d.ts +1 -1
- package/dist/types/src/primitives/fields/series-field-helpers.d.ts +23 -0
- package/dist/types/src/primitives/fields/series-field-styles.d.ts +1 -0
- package/dist/types/src/primitives/mount-form.d.ts +1 -1
- package/dist/types/src/primitives/presentation.d.ts +8 -0
- package/dist/types/src/primitives/types.d.ts +4 -1
- package/dist/types/src/{engine → runtime}/builtins/index.d.ts +1 -3
- package/dist/types/src/{engine → runtime}/builtins/reports/classifier.d.ts +1 -1
- package/dist/types/src/{engine → runtime}/builtins/shared.d.ts +2 -0
- package/dist/types/src/runtime/declarative/presentation.d.ts +61 -0
- package/dist/types/src/runtime/fields/state-calculations.d.ts +25 -0
- package/dist/types/src/runtime/fields/state.d.ts +2 -0
- package/dist/types/src/runtime/form.d.ts +1 -0
- package/dist/types/src/runtime/index.d.ts +16 -0
- package/dist/types/src/runtime/registry/index.d.ts +5 -0
- package/dist/types/src/runtime/runtime-behaviors.d.ts +23 -0
- package/dist/types/src/runtime/runtime-controller.d.ts +34 -0
- package/dist/types/src/runtime/runtime-refresh.d.ts +14 -0
- package/dist/types/src/runtime/runtime-values.d.ts +19 -0
- package/dist/types/src/runtime/submission/create-submitter.d.ts +2 -0
- package/dist/types/src/runtime/submission/error-flow.d.ts +19 -0
- package/dist/types/src/runtime/submission/field-updates.d.ts +14 -0
- package/dist/types/src/runtime/submission/report-updates.d.ts +16 -0
- package/dist/types/src/runtime/submission/stream-progress.d.ts +4 -0
- package/dist/types/src/runtime/submission/submitter.d.ts +2 -0
- package/dist/types/src/runtime/submission/types.d.ts +60 -0
- package/dist/types/src/runtime/types/behavior.d.ts +32 -0
- package/dist/types/src/runtime/types/explanation.d.ts +22 -0
- package/dist/types/src/runtime/types/field.d.ts +24 -0
- package/dist/types/src/{engine → runtime}/types/form.d.ts +8 -11
- package/dist/types/src/runtime/types/index.d.ts +9 -0
- package/dist/types/src/runtime/types/registry.d.ts +6 -0
- package/dist/types/src/runtime/types/report.d.ts +23 -0
- package/dist/types/src/{engine → runtime}/utils.d.ts +2 -2
- package/dist/types/src/{engine/validation/field.d.ts → runtime/validation/field-state.d.ts} +3 -19
- package/dist/types/src/runtime/validation/field-validator.d.ts +18 -0
- package/dist/types/src/runtime/validation/field.d.ts +2 -0
- package/dist/types/src/schema/index.d.ts +7 -0
- package/dist/types/src/schema/normalize.d.ts +2 -0
- package/dist/types/src/schema/registry.d.ts +9 -0
- package/dist/types/src/schema/types/explanation.d.ts +43 -0
- package/dist/types/src/{engine → schema}/types/field.d.ts +3 -45
- package/dist/types/src/schema/types/form.d.ts +13 -0
- package/dist/types/src/schema/types/report.d.ts +43 -0
- package/dist/types/src/shared/index.d.ts +2 -0
- package/dist/types/src/shared/object.d.ts +1 -0
- package/dist/types/src/shared/strings.d.ts +1 -0
- package/dist/types/src/transport/composition/fanout-helpers.d.ts +2 -0
- package/dist/types/src/transport/composition/fanout.d.ts +1 -2
- package/dist/types/src/transport/composition/index.d.ts +1 -0
- package/dist/types/src/transport/composition/quorum-fanout.d.ts +2 -0
- package/dist/types/src/transport/internal-core.d.ts +21 -0
- package/dist/types/src/transport/internal-errors.d.ts +21 -0
- package/dist/types/src/transport/internal-request.d.ts +21 -0
- package/dist/types/src/transport/internal-routing.d.ts +25 -0
- package/dist/types/src/transport/internal-sse.d.ts +14 -0
- package/dist/types/src/transport/internal-stream.d.ts +13 -0
- package/dist/types/src/transport/internal.d.ts +6 -110
- package/dist/types/src/transport/types/options-http.d.ts +85 -0
- package/dist/types/src/transport/types/options-middleware.d.ts +96 -0
- package/dist/types/src/transport/types/options-routing.d.ts +82 -0
- package/dist/types/src/transport/types/options.d.ts +3 -258
- package/package.json +20 -8
- package/dist/engine-CEy1IX7y.js +0 -5367
- package/dist/kit-DrrbtxI2.js +0 -76
- package/dist/mlform/engine.mjs +0 -3
- package/dist/mlform/questionnaire.mjs +0 -640
- package/dist/types/src/engine/index.d.ts +0 -11
- package/dist/types/src/engine/registry/index.d.ts +0 -26
- package/dist/types/src/engine/submission/submitter.d.ts +0 -40
- package/dist/types/src/engine/types/explanation.d.ts +0 -109
- package/dist/types/src/engine/types/index.d.ts +0 -9
- package/dist/types/src/engine/types/report.d.ts +0 -87
- package/dist/types/src/questionnaire/constants.d.ts +0 -31
- package/dist/types/src/questionnaire/defaults.d.ts +0 -8
- package/dist/types/src/questionnaire/engine/controller.d.ts +0 -12
- package/dist/types/src/questionnaire/engine/schema.d.ts +0 -9
- package/dist/types/src/questionnaire/errors.d.ts +0 -3
- package/dist/types/src/questionnaire/index.d.ts +0 -6
- package/dist/types/src/questionnaire/mount.d.ts +0 -3
- package/dist/types/src/questionnaire/primitives/components/questionnaire-root.d.ts +0 -23
- package/dist/types/src/questionnaire/primitives/register.d.ts +0 -0
- package/dist/types/src/questionnaire/types.d.ts +0 -69
- package/dist/types/src/{engine/declarative → presentation/types}/presentation.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/boolean.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/category.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/date.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/long-text.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/mapped-category.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/multi-choice.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/number.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/rating.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/series.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/single-choice.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/text.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/reports/regressor.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/comparison.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/constants.d.ts +0 -0
- package/dist/types/src/{engine/form.d.ts → runtime/create-runtime.d.ts} +0 -0
- package/dist/types/src/{engine → runtime}/declarative/explanation.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/declarative/field.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/declarative/report.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/equality.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/errors.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/explanations/controller.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/explanations/index.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/fields/controller.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/fields/index.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/paths.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/reports/controller.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/reports/index.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/schema/index.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/state/engine.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/state/index.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/state/snapshots.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/state/store.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/submission/abort.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/submission/explanations.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/submission/index.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/submission/lifecycle.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/submission/pipeline.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/submission/reports.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/submission/request.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/submission/result.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/types/pipeline.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/types/transport.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/validation/conditions.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/validation/form.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/validation/index.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/values.d.ts +0 -0
- package/dist/types/src/{engine → schema}/types/registry.d.ts +1 -1
|
@@ -0,0 +1,3507 @@
|
|
|
1
|
+
Object.freeze({ status: "aborted" });
|
|
2
|
+
function e(e, t, n) {
|
|
3
|
+
function r(n, r) {
|
|
4
|
+
if (n._zod || Object.defineProperty(n, "_zod", {
|
|
5
|
+
value: {
|
|
6
|
+
def: r,
|
|
7
|
+
constr: o,
|
|
8
|
+
traits: /* @__PURE__ */ new Set()
|
|
9
|
+
},
|
|
10
|
+
enumerable: !1
|
|
11
|
+
}), n._zod.traits.has(e)) return;
|
|
12
|
+
n._zod.traits.add(e), t(n, r);
|
|
13
|
+
let i = o.prototype, a = Object.keys(i);
|
|
14
|
+
for (let e = 0; e < a.length; e++) {
|
|
15
|
+
let t = a[e];
|
|
16
|
+
t in n || (n[t] = i[t].bind(n));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
let i = n?.Parent ?? Object;
|
|
20
|
+
class a extends i {}
|
|
21
|
+
Object.defineProperty(a, "name", { value: e });
|
|
22
|
+
function o(e) {
|
|
23
|
+
var t;
|
|
24
|
+
let i = n?.Parent ? new a() : this;
|
|
25
|
+
r(i, e), (t = i._zod).deferred ?? (t.deferred = []);
|
|
26
|
+
for (let e of i._zod.deferred) e();
|
|
27
|
+
return i;
|
|
28
|
+
}
|
|
29
|
+
return Object.defineProperty(o, "init", { value: r }), Object.defineProperty(o, Symbol.hasInstance, { value: (t) => n?.Parent && t instanceof n.Parent ? !0 : t?._zod?.traits?.has(e) }), Object.defineProperty(o, "name", { value: e }), o;
|
|
30
|
+
}
|
|
31
|
+
var t = class extends Error {
|
|
32
|
+
constructor() {
|
|
33
|
+
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
34
|
+
}
|
|
35
|
+
}, n = class extends Error {
|
|
36
|
+
constructor(e) {
|
|
37
|
+
super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError";
|
|
38
|
+
}
|
|
39
|
+
}, r = {};
|
|
40
|
+
function i(e) {
|
|
41
|
+
return e && Object.assign(r, e), r;
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js
|
|
45
|
+
function a(e) {
|
|
46
|
+
let t = Object.values(e).filter((e) => typeof e == "number");
|
|
47
|
+
return Object.entries(e).filter(([e, n]) => t.indexOf(+e) === -1).map(([e, t]) => t);
|
|
48
|
+
}
|
|
49
|
+
function o(e, t) {
|
|
50
|
+
return typeof t == "bigint" ? t.toString() : t;
|
|
51
|
+
}
|
|
52
|
+
function s(e) {
|
|
53
|
+
return { get value() {
|
|
54
|
+
{
|
|
55
|
+
let t = e();
|
|
56
|
+
return Object.defineProperty(this, "value", { value: t }), t;
|
|
57
|
+
}
|
|
58
|
+
throw Error("cached value already set");
|
|
59
|
+
} };
|
|
60
|
+
}
|
|
61
|
+
function c(e) {
|
|
62
|
+
return e == null;
|
|
63
|
+
}
|
|
64
|
+
function l(e) {
|
|
65
|
+
let t = +!!e.startsWith("^"), n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
66
|
+
return e.slice(t, n);
|
|
67
|
+
}
|
|
68
|
+
function u(e, t) {
|
|
69
|
+
let n = (e.toString().split(".")[1] || "").length, r = t.toString(), i = (r.split(".")[1] || "").length;
|
|
70
|
+
if (i === 0 && /\d?e-\d?/.test(r)) {
|
|
71
|
+
let e = r.match(/\d?e-(\d?)/);
|
|
72
|
+
e?.[1] && (i = Number.parseInt(e[1]));
|
|
73
|
+
}
|
|
74
|
+
let a = n > i ? n : i;
|
|
75
|
+
return Number.parseInt(e.toFixed(a).replace(".", "")) % Number.parseInt(t.toFixed(a).replace(".", "")) / 10 ** a;
|
|
76
|
+
}
|
|
77
|
+
var ee = Symbol("evaluating");
|
|
78
|
+
function d(e, t, n) {
|
|
79
|
+
let r;
|
|
80
|
+
Object.defineProperty(e, t, {
|
|
81
|
+
get() {
|
|
82
|
+
if (r !== ee) return r === void 0 && (r = ee, r = n()), r;
|
|
83
|
+
},
|
|
84
|
+
set(n) {
|
|
85
|
+
Object.defineProperty(e, t, { value: n });
|
|
86
|
+
},
|
|
87
|
+
configurable: !0
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function f(e, t, n) {
|
|
91
|
+
Object.defineProperty(e, t, {
|
|
92
|
+
value: n,
|
|
93
|
+
writable: !0,
|
|
94
|
+
enumerable: !0,
|
|
95
|
+
configurable: !0
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function p(...e) {
|
|
99
|
+
let t = {};
|
|
100
|
+
for (let n of e) Object.assign(t, Object.getOwnPropertyDescriptors(n));
|
|
101
|
+
return Object.defineProperties({}, t);
|
|
102
|
+
}
|
|
103
|
+
function te(e) {
|
|
104
|
+
return JSON.stringify(e);
|
|
105
|
+
}
|
|
106
|
+
function ne(e) {
|
|
107
|
+
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
108
|
+
}
|
|
109
|
+
var re = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {};
|
|
110
|
+
function ie(e) {
|
|
111
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
112
|
+
}
|
|
113
|
+
var ae = s(() => {
|
|
114
|
+
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return !1;
|
|
115
|
+
try {
|
|
116
|
+
return Function(""), !0;
|
|
117
|
+
} catch {
|
|
118
|
+
return !1;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
function m(e) {
|
|
122
|
+
if (ie(e) === !1) return !1;
|
|
123
|
+
let t = e.constructor;
|
|
124
|
+
if (t === void 0 || typeof t != "function") return !0;
|
|
125
|
+
let n = t.prototype;
|
|
126
|
+
return !(ie(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
127
|
+
}
|
|
128
|
+
function oe(e) {
|
|
129
|
+
return m(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
130
|
+
}
|
|
131
|
+
var se = new Set([
|
|
132
|
+
"string",
|
|
133
|
+
"number",
|
|
134
|
+
"symbol"
|
|
135
|
+
]);
|
|
136
|
+
function h(e) {
|
|
137
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
138
|
+
}
|
|
139
|
+
function g(e, t, n) {
|
|
140
|
+
let r = new e._zod.constr(t ?? e._zod.def);
|
|
141
|
+
return (!t || n?.parent) && (r._zod.parent = e), r;
|
|
142
|
+
}
|
|
143
|
+
function _(e) {
|
|
144
|
+
let t = e;
|
|
145
|
+
if (!t) return {};
|
|
146
|
+
if (typeof t == "string") return { error: () => t };
|
|
147
|
+
if (t?.message !== void 0) {
|
|
148
|
+
if (t?.error !== void 0) throw Error("Cannot specify both `message` and `error` params");
|
|
149
|
+
t.error = t.message;
|
|
150
|
+
}
|
|
151
|
+
return delete t.message, typeof t.error == "string" ? {
|
|
152
|
+
...t,
|
|
153
|
+
error: () => t.error
|
|
154
|
+
} : t;
|
|
155
|
+
}
|
|
156
|
+
function ce(e) {
|
|
157
|
+
return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
|
|
158
|
+
}
|
|
159
|
+
var le = {
|
|
160
|
+
safeint: [-(2 ** 53 - 1), 2 ** 53 - 1],
|
|
161
|
+
int32: [-2147483648, 2147483647],
|
|
162
|
+
uint32: [0, 4294967295],
|
|
163
|
+
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
164
|
+
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
165
|
+
};
|
|
166
|
+
function ue(e, t) {
|
|
167
|
+
let n = e._zod.def, r = n.checks;
|
|
168
|
+
if (r && r.length > 0) throw Error(".pick() cannot be used on object schemas containing refinements");
|
|
169
|
+
return g(e, p(e._zod.def, {
|
|
170
|
+
get shape() {
|
|
171
|
+
let e = {};
|
|
172
|
+
for (let r in t) {
|
|
173
|
+
if (!(r in n.shape)) throw Error(`Unrecognized key: "${r}"`);
|
|
174
|
+
t[r] && (e[r] = n.shape[r]);
|
|
175
|
+
}
|
|
176
|
+
return f(this, "shape", e), e;
|
|
177
|
+
},
|
|
178
|
+
checks: []
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
181
|
+
function de(e, t) {
|
|
182
|
+
let n = e._zod.def, r = n.checks;
|
|
183
|
+
if (r && r.length > 0) throw Error(".omit() cannot be used on object schemas containing refinements");
|
|
184
|
+
return g(e, p(e._zod.def, {
|
|
185
|
+
get shape() {
|
|
186
|
+
let r = { ...e._zod.def.shape };
|
|
187
|
+
for (let e in t) {
|
|
188
|
+
if (!(e in n.shape)) throw Error(`Unrecognized key: "${e}"`);
|
|
189
|
+
t[e] && delete r[e];
|
|
190
|
+
}
|
|
191
|
+
return f(this, "shape", r), r;
|
|
192
|
+
},
|
|
193
|
+
checks: []
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
function fe(e, t) {
|
|
197
|
+
if (!m(t)) throw Error("Invalid input to extend: expected a plain object");
|
|
198
|
+
let n = e._zod.def.checks;
|
|
199
|
+
if (n && n.length > 0) {
|
|
200
|
+
let n = e._zod.def.shape;
|
|
201
|
+
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.");
|
|
202
|
+
}
|
|
203
|
+
return g(e, p(e._zod.def, { get shape() {
|
|
204
|
+
let n = {
|
|
205
|
+
...e._zod.def.shape,
|
|
206
|
+
...t
|
|
207
|
+
};
|
|
208
|
+
return f(this, "shape", n), n;
|
|
209
|
+
} }));
|
|
210
|
+
}
|
|
211
|
+
function pe(e, t) {
|
|
212
|
+
if (!m(t)) throw Error("Invalid input to safeExtend: expected a plain object");
|
|
213
|
+
return g(e, p(e._zod.def, { get shape() {
|
|
214
|
+
let n = {
|
|
215
|
+
...e._zod.def.shape,
|
|
216
|
+
...t
|
|
217
|
+
};
|
|
218
|
+
return f(this, "shape", n), n;
|
|
219
|
+
} }));
|
|
220
|
+
}
|
|
221
|
+
function me(e, t) {
|
|
222
|
+
return g(e, p(e._zod.def, {
|
|
223
|
+
get shape() {
|
|
224
|
+
let n = {
|
|
225
|
+
...e._zod.def.shape,
|
|
226
|
+
...t._zod.def.shape
|
|
227
|
+
};
|
|
228
|
+
return f(this, "shape", n), n;
|
|
229
|
+
},
|
|
230
|
+
get catchall() {
|
|
231
|
+
return t._zod.def.catchall;
|
|
232
|
+
},
|
|
233
|
+
checks: []
|
|
234
|
+
}));
|
|
235
|
+
}
|
|
236
|
+
function he(e, t, n) {
|
|
237
|
+
let r = t._zod.def.checks;
|
|
238
|
+
if (r && r.length > 0) throw Error(".partial() cannot be used on object schemas containing refinements");
|
|
239
|
+
return g(t, p(t._zod.def, {
|
|
240
|
+
get shape() {
|
|
241
|
+
let r = t._zod.def.shape, i = { ...r };
|
|
242
|
+
if (n) for (let t in n) {
|
|
243
|
+
if (!(t in r)) throw Error(`Unrecognized key: "${t}"`);
|
|
244
|
+
n[t] && (i[t] = e ? new e({
|
|
245
|
+
type: "optional",
|
|
246
|
+
innerType: r[t]
|
|
247
|
+
}) : r[t]);
|
|
248
|
+
}
|
|
249
|
+
else for (let t in r) i[t] = e ? new e({
|
|
250
|
+
type: "optional",
|
|
251
|
+
innerType: r[t]
|
|
252
|
+
}) : r[t];
|
|
253
|
+
return f(this, "shape", i), i;
|
|
254
|
+
},
|
|
255
|
+
checks: []
|
|
256
|
+
}));
|
|
257
|
+
}
|
|
258
|
+
function ge(e, t, n) {
|
|
259
|
+
return g(t, p(t._zod.def, { get shape() {
|
|
260
|
+
let r = t._zod.def.shape, i = { ...r };
|
|
261
|
+
if (n) for (let t in n) {
|
|
262
|
+
if (!(t in i)) throw Error(`Unrecognized key: "${t}"`);
|
|
263
|
+
n[t] && (i[t] = new e({
|
|
264
|
+
type: "nonoptional",
|
|
265
|
+
innerType: r[t]
|
|
266
|
+
}));
|
|
267
|
+
}
|
|
268
|
+
else for (let t in r) i[t] = new e({
|
|
269
|
+
type: "nonoptional",
|
|
270
|
+
innerType: r[t]
|
|
271
|
+
});
|
|
272
|
+
return f(this, "shape", i), i;
|
|
273
|
+
} }));
|
|
274
|
+
}
|
|
275
|
+
function v(e, t = 0) {
|
|
276
|
+
if (e.aborted === !0) return !0;
|
|
277
|
+
for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue !== !0) return !0;
|
|
278
|
+
return !1;
|
|
279
|
+
}
|
|
280
|
+
function y(e, t) {
|
|
281
|
+
return t.map((t) => {
|
|
282
|
+
var n;
|
|
283
|
+
return (n = t).path ?? (n.path = []), t.path.unshift(e), t;
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
function b(e) {
|
|
287
|
+
return typeof e == "string" ? e : e?.message;
|
|
288
|
+
}
|
|
289
|
+
function x(e, t, n) {
|
|
290
|
+
let r = {
|
|
291
|
+
...e,
|
|
292
|
+
path: e.path ?? []
|
|
293
|
+
};
|
|
294
|
+
return e.message || (r.message = b(e.inst?._zod.def?.error?.(e)) ?? b(t?.error?.(e)) ?? b(n.customError?.(e)) ?? b(n.localeError?.(e)) ?? "Invalid input"), delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
|
|
295
|
+
}
|
|
296
|
+
function _e(e) {
|
|
297
|
+
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
298
|
+
}
|
|
299
|
+
function S(...e) {
|
|
300
|
+
let [t, n, r] = e;
|
|
301
|
+
return typeof t == "string" ? {
|
|
302
|
+
message: t,
|
|
303
|
+
code: "custom",
|
|
304
|
+
input: n,
|
|
305
|
+
inst: r
|
|
306
|
+
} : { ...t };
|
|
307
|
+
}
|
|
308
|
+
//#endregion
|
|
309
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js
|
|
310
|
+
var ve = (e, t) => {
|
|
311
|
+
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
312
|
+
value: e._zod,
|
|
313
|
+
enumerable: !1
|
|
314
|
+
}), Object.defineProperty(e, "issues", {
|
|
315
|
+
value: t,
|
|
316
|
+
enumerable: !1
|
|
317
|
+
}), e.message = JSON.stringify(t, o, 2), Object.defineProperty(e, "toString", {
|
|
318
|
+
value: () => e.message,
|
|
319
|
+
enumerable: !1
|
|
320
|
+
});
|
|
321
|
+
}, ye = e("$ZodError", ve), be = e("$ZodError", ve, { Parent: Error });
|
|
322
|
+
function xe(e, t = (e) => e.message) {
|
|
323
|
+
let n = {}, r = [];
|
|
324
|
+
for (let i of e.issues) i.path.length > 0 ? (n[i.path[0]] = n[i.path[0]] || [], n[i.path[0]].push(t(i))) : r.push(t(i));
|
|
325
|
+
return {
|
|
326
|
+
formErrors: r,
|
|
327
|
+
fieldErrors: n
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
function Se(e, t = (e) => e.message) {
|
|
331
|
+
let n = { _errors: [] }, r = (e) => {
|
|
332
|
+
for (let i of e.issues) if (i.code === "invalid_union" && i.errors.length) i.errors.map((e) => r({ issues: e }));
|
|
333
|
+
else if (i.code === "invalid_key") r({ issues: i.issues });
|
|
334
|
+
else if (i.code === "invalid_element") r({ issues: i.issues });
|
|
335
|
+
else if (i.path.length === 0) n._errors.push(t(i));
|
|
336
|
+
else {
|
|
337
|
+
let e = n, r = 0;
|
|
338
|
+
for (; r < i.path.length;) {
|
|
339
|
+
let n = i.path[r];
|
|
340
|
+
r === i.path.length - 1 ? (e[n] = e[n] || { _errors: [] }, e[n]._errors.push(t(i))) : e[n] = e[n] || { _errors: [] }, e = e[n], r++;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
return r(e), n;
|
|
345
|
+
}
|
|
346
|
+
//#endregion
|
|
347
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js
|
|
348
|
+
var Ce = (e) => (n, r, a, o) => {
|
|
349
|
+
let s = a ? Object.assign(a, { async: !1 }) : { async: !1 }, c = n._zod.run({
|
|
350
|
+
value: r,
|
|
351
|
+
issues: []
|
|
352
|
+
}, s);
|
|
353
|
+
if (c instanceof Promise) throw new t();
|
|
354
|
+
if (c.issues.length) {
|
|
355
|
+
let t = new (o?.Err ?? e)(c.issues.map((e) => x(e, s, i())));
|
|
356
|
+
throw re(t, o?.callee), t;
|
|
357
|
+
}
|
|
358
|
+
return c.value;
|
|
359
|
+
}, we = (e) => async (t, n, r, a) => {
|
|
360
|
+
let o = r ? Object.assign(r, { async: !0 }) : { async: !0 }, s = t._zod.run({
|
|
361
|
+
value: n,
|
|
362
|
+
issues: []
|
|
363
|
+
}, o);
|
|
364
|
+
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
365
|
+
let t = new (a?.Err ?? e)(s.issues.map((e) => x(e, o, i())));
|
|
366
|
+
throw re(t, a?.callee), t;
|
|
367
|
+
}
|
|
368
|
+
return s.value;
|
|
369
|
+
}, C = (e) => (n, r, a) => {
|
|
370
|
+
let o = a ? {
|
|
371
|
+
...a,
|
|
372
|
+
async: !1
|
|
373
|
+
} : { async: !1 }, s = n._zod.run({
|
|
374
|
+
value: r,
|
|
375
|
+
issues: []
|
|
376
|
+
}, o);
|
|
377
|
+
if (s instanceof Promise) throw new t();
|
|
378
|
+
return s.issues.length ? {
|
|
379
|
+
success: !1,
|
|
380
|
+
error: new (e ?? ye)(s.issues.map((e) => x(e, o, i())))
|
|
381
|
+
} : {
|
|
382
|
+
success: !0,
|
|
383
|
+
data: s.value
|
|
384
|
+
};
|
|
385
|
+
}, Te = /* @__PURE__ */ C(be), w = (e) => async (t, n, r) => {
|
|
386
|
+
let a = r ? Object.assign(r, { async: !0 }) : { async: !0 }, o = t._zod.run({
|
|
387
|
+
value: n,
|
|
388
|
+
issues: []
|
|
389
|
+
}, a);
|
|
390
|
+
return o instanceof Promise && (o = await o), o.issues.length ? {
|
|
391
|
+
success: !1,
|
|
392
|
+
error: new e(o.issues.map((e) => x(e, a, i())))
|
|
393
|
+
} : {
|
|
394
|
+
success: !0,
|
|
395
|
+
data: o.value
|
|
396
|
+
};
|
|
397
|
+
}, Ee = /* @__PURE__ */ w(be), De = (e) => (t, n, r) => {
|
|
398
|
+
let i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
399
|
+
return Ce(e)(t, n, i);
|
|
400
|
+
}, Oe = (e) => (t, n, r) => Ce(e)(t, n, r), ke = (e) => async (t, n, r) => {
|
|
401
|
+
let i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
402
|
+
return we(e)(t, n, i);
|
|
403
|
+
}, Ae = (e) => async (t, n, r) => we(e)(t, n, r), je = (e) => (t, n, r) => {
|
|
404
|
+
let i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
405
|
+
return C(e)(t, n, i);
|
|
406
|
+
}, Me = (e) => (t, n, r) => C(e)(t, n, r), Ne = (e) => async (t, n, r) => {
|
|
407
|
+
let i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
408
|
+
return w(e)(t, n, i);
|
|
409
|
+
}, Pe = (e) => async (t, n, r) => w(e)(t, n, r), Fe = /^[cC][^\s-]{8,}$/, Ie = /^[0-9a-z]+$/, Le = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Re = /^[0-9a-vA-V]{20}$/, ze = /^[A-Za-z0-9]{27}$/, Be = /^[a-zA-Z0-9_-]{21}$/, Ve = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, He = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Ue = (e) => e ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, We = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Ge = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
410
|
+
function Ke() {
|
|
411
|
+
return new RegExp(Ge, "u");
|
|
412
|
+
}
|
|
413
|
+
var qe = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Je = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, Ye = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, Xe = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ze = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Qe = /^[A-Za-z0-9_-]*$/, $e = /^\+[1-9]\d{6,14}$/, et = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", tt = /* @__PURE__ */ RegExp(`^${et}$`);
|
|
414
|
+
function nt(e) {
|
|
415
|
+
let t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
416
|
+
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
417
|
+
}
|
|
418
|
+
function rt(e) {
|
|
419
|
+
return RegExp(`^${nt(e)}$`);
|
|
420
|
+
}
|
|
421
|
+
function it(e) {
|
|
422
|
+
let t = nt({ precision: e.precision }), n = ["Z"];
|
|
423
|
+
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
424
|
+
let r = `${t}(?:${n.join("|")})`;
|
|
425
|
+
return RegExp(`^${et}T(?:${r})$`);
|
|
426
|
+
}
|
|
427
|
+
var at = (e) => {
|
|
428
|
+
let t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
429
|
+
return RegExp(`^${t}$`);
|
|
430
|
+
}, ot = /^-?\d+$/, st = /^-?\d+(?:\.\d+)?$/, ct = /^(?:true|false)$/i, lt = /^[^A-Z]*$/, ut = /^[^a-z]*$/, T = /* @__PURE__ */ e("$ZodCheck", (e, t) => {
|
|
431
|
+
var n;
|
|
432
|
+
e._zod ??= {}, e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
433
|
+
}), dt = {
|
|
434
|
+
number: "number",
|
|
435
|
+
bigint: "bigint",
|
|
436
|
+
object: "date"
|
|
437
|
+
}, ft = /* @__PURE__ */ e("$ZodCheckLessThan", (e, t) => {
|
|
438
|
+
T.init(e, t);
|
|
439
|
+
let n = dt[typeof t.value];
|
|
440
|
+
e._zod.onattach.push((e) => {
|
|
441
|
+
let n = e._zod.bag, r = (t.inclusive ? n.maximum : n.exclusiveMaximum) ?? Infinity;
|
|
442
|
+
t.value < r && (t.inclusive ? n.maximum = t.value : n.exclusiveMaximum = t.value);
|
|
443
|
+
}), e._zod.check = (r) => {
|
|
444
|
+
(t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({
|
|
445
|
+
origin: n,
|
|
446
|
+
code: "too_big",
|
|
447
|
+
maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
|
|
448
|
+
input: r.value,
|
|
449
|
+
inclusive: t.inclusive,
|
|
450
|
+
inst: e,
|
|
451
|
+
continue: !t.abort
|
|
452
|
+
});
|
|
453
|
+
};
|
|
454
|
+
}), pt = /* @__PURE__ */ e("$ZodCheckGreaterThan", (e, t) => {
|
|
455
|
+
T.init(e, t);
|
|
456
|
+
let n = dt[typeof t.value];
|
|
457
|
+
e._zod.onattach.push((e) => {
|
|
458
|
+
let n = e._zod.bag, r = (t.inclusive ? n.minimum : n.exclusiveMinimum) ?? -Infinity;
|
|
459
|
+
t.value > r && (t.inclusive ? n.minimum = t.value : n.exclusiveMinimum = t.value);
|
|
460
|
+
}), e._zod.check = (r) => {
|
|
461
|
+
(t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({
|
|
462
|
+
origin: n,
|
|
463
|
+
code: "too_small",
|
|
464
|
+
minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
|
|
465
|
+
input: r.value,
|
|
466
|
+
inclusive: t.inclusive,
|
|
467
|
+
inst: e,
|
|
468
|
+
continue: !t.abort
|
|
469
|
+
});
|
|
470
|
+
};
|
|
471
|
+
}), mt = /* @__PURE__ */ e("$ZodCheckMultipleOf", (e, t) => {
|
|
472
|
+
T.init(e, t), e._zod.onattach.push((e) => {
|
|
473
|
+
var n;
|
|
474
|
+
(n = e._zod.bag).multipleOf ?? (n.multipleOf = t.value);
|
|
475
|
+
}), e._zod.check = (n) => {
|
|
476
|
+
if (typeof n.value != typeof t.value) throw Error("Cannot mix number and bigint in multiple_of check.");
|
|
477
|
+
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : u(n.value, t.value) === 0) || n.issues.push({
|
|
478
|
+
origin: typeof n.value,
|
|
479
|
+
code: "not_multiple_of",
|
|
480
|
+
divisor: t.value,
|
|
481
|
+
input: n.value,
|
|
482
|
+
inst: e,
|
|
483
|
+
continue: !t.abort
|
|
484
|
+
});
|
|
485
|
+
};
|
|
486
|
+
}), ht = /* @__PURE__ */ e("$ZodCheckNumberFormat", (e, t) => {
|
|
487
|
+
T.init(e, t), t.format = t.format || "float64";
|
|
488
|
+
let n = t.format?.includes("int"), r = n ? "int" : "number", [i, a] = le[t.format];
|
|
489
|
+
e._zod.onattach.push((e) => {
|
|
490
|
+
let r = e._zod.bag;
|
|
491
|
+
r.format = t.format, r.minimum = i, r.maximum = a, n && (r.pattern = ot);
|
|
492
|
+
}), e._zod.check = (o) => {
|
|
493
|
+
let s = o.value;
|
|
494
|
+
if (n) {
|
|
495
|
+
if (!Number.isInteger(s)) {
|
|
496
|
+
o.issues.push({
|
|
497
|
+
expected: r,
|
|
498
|
+
format: t.format,
|
|
499
|
+
code: "invalid_type",
|
|
500
|
+
continue: !1,
|
|
501
|
+
input: s,
|
|
502
|
+
inst: e
|
|
503
|
+
});
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
if (!Number.isSafeInteger(s)) {
|
|
507
|
+
s > 0 ? o.issues.push({
|
|
508
|
+
input: s,
|
|
509
|
+
code: "too_big",
|
|
510
|
+
maximum: 2 ** 53 - 1,
|
|
511
|
+
note: "Integers must be within the safe integer range.",
|
|
512
|
+
inst: e,
|
|
513
|
+
origin: r,
|
|
514
|
+
inclusive: !0,
|
|
515
|
+
continue: !t.abort
|
|
516
|
+
}) : o.issues.push({
|
|
517
|
+
input: s,
|
|
518
|
+
code: "too_small",
|
|
519
|
+
minimum: -(2 ** 53 - 1),
|
|
520
|
+
note: "Integers must be within the safe integer range.",
|
|
521
|
+
inst: e,
|
|
522
|
+
origin: r,
|
|
523
|
+
inclusive: !0,
|
|
524
|
+
continue: !t.abort
|
|
525
|
+
});
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
s < i && o.issues.push({
|
|
530
|
+
origin: "number",
|
|
531
|
+
input: s,
|
|
532
|
+
code: "too_small",
|
|
533
|
+
minimum: i,
|
|
534
|
+
inclusive: !0,
|
|
535
|
+
inst: e,
|
|
536
|
+
continue: !t.abort
|
|
537
|
+
}), s > a && o.issues.push({
|
|
538
|
+
origin: "number",
|
|
539
|
+
input: s,
|
|
540
|
+
code: "too_big",
|
|
541
|
+
maximum: a,
|
|
542
|
+
inclusive: !0,
|
|
543
|
+
inst: e,
|
|
544
|
+
continue: !t.abort
|
|
545
|
+
});
|
|
546
|
+
};
|
|
547
|
+
}), gt = /* @__PURE__ */ e("$ZodCheckMaxLength", (e, t) => {
|
|
548
|
+
var n;
|
|
549
|
+
T.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
|
|
550
|
+
let t = e.value;
|
|
551
|
+
return !c(t) && t.length !== void 0;
|
|
552
|
+
}), e._zod.onattach.push((e) => {
|
|
553
|
+
let n = e._zod.bag.maximum ?? Infinity;
|
|
554
|
+
t.maximum < n && (e._zod.bag.maximum = t.maximum);
|
|
555
|
+
}), e._zod.check = (n) => {
|
|
556
|
+
let r = n.value;
|
|
557
|
+
if (r.length <= t.maximum) return;
|
|
558
|
+
let i = _e(r);
|
|
559
|
+
n.issues.push({
|
|
560
|
+
origin: i,
|
|
561
|
+
code: "too_big",
|
|
562
|
+
maximum: t.maximum,
|
|
563
|
+
inclusive: !0,
|
|
564
|
+
input: r,
|
|
565
|
+
inst: e,
|
|
566
|
+
continue: !t.abort
|
|
567
|
+
});
|
|
568
|
+
};
|
|
569
|
+
}), _t = /* @__PURE__ */ e("$ZodCheckMinLength", (e, t) => {
|
|
570
|
+
var n;
|
|
571
|
+
T.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
|
|
572
|
+
let t = e.value;
|
|
573
|
+
return !c(t) && t.length !== void 0;
|
|
574
|
+
}), e._zod.onattach.push((e) => {
|
|
575
|
+
let n = e._zod.bag.minimum ?? -Infinity;
|
|
576
|
+
t.minimum > n && (e._zod.bag.minimum = t.minimum);
|
|
577
|
+
}), e._zod.check = (n) => {
|
|
578
|
+
let r = n.value;
|
|
579
|
+
if (r.length >= t.minimum) return;
|
|
580
|
+
let i = _e(r);
|
|
581
|
+
n.issues.push({
|
|
582
|
+
origin: i,
|
|
583
|
+
code: "too_small",
|
|
584
|
+
minimum: t.minimum,
|
|
585
|
+
inclusive: !0,
|
|
586
|
+
input: r,
|
|
587
|
+
inst: e,
|
|
588
|
+
continue: !t.abort
|
|
589
|
+
});
|
|
590
|
+
};
|
|
591
|
+
}), vt = /* @__PURE__ */ e("$ZodCheckLengthEquals", (e, t) => {
|
|
592
|
+
var n;
|
|
593
|
+
T.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
|
|
594
|
+
let t = e.value;
|
|
595
|
+
return !c(t) && t.length !== void 0;
|
|
596
|
+
}), e._zod.onattach.push((e) => {
|
|
597
|
+
let n = e._zod.bag;
|
|
598
|
+
n.minimum = t.length, n.maximum = t.length, n.length = t.length;
|
|
599
|
+
}), e._zod.check = (n) => {
|
|
600
|
+
let r = n.value, i = r.length;
|
|
601
|
+
if (i === t.length) return;
|
|
602
|
+
let a = _e(r), o = i > t.length;
|
|
603
|
+
n.issues.push({
|
|
604
|
+
origin: a,
|
|
605
|
+
...o ? {
|
|
606
|
+
code: "too_big",
|
|
607
|
+
maximum: t.length
|
|
608
|
+
} : {
|
|
609
|
+
code: "too_small",
|
|
610
|
+
minimum: t.length
|
|
611
|
+
},
|
|
612
|
+
inclusive: !0,
|
|
613
|
+
exact: !0,
|
|
614
|
+
input: n.value,
|
|
615
|
+
inst: e,
|
|
616
|
+
continue: !t.abort
|
|
617
|
+
});
|
|
618
|
+
};
|
|
619
|
+
}), yt = /* @__PURE__ */ e("$ZodCheckStringFormat", (e, t) => {
|
|
620
|
+
var n, r;
|
|
621
|
+
T.init(e, t), e._zod.onattach.push((e) => {
|
|
622
|
+
let n = e._zod.bag;
|
|
623
|
+
n.format = t.format, t.pattern && (n.patterns ??= /* @__PURE__ */ new Set(), n.patterns.add(t.pattern));
|
|
624
|
+
}), t.pattern ? (n = e._zod).check ?? (n.check = (n) => {
|
|
625
|
+
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
626
|
+
origin: "string",
|
|
627
|
+
code: "invalid_format",
|
|
628
|
+
format: t.format,
|
|
629
|
+
input: n.value,
|
|
630
|
+
...t.pattern ? { pattern: t.pattern.toString() } : {},
|
|
631
|
+
inst: e,
|
|
632
|
+
continue: !t.abort
|
|
633
|
+
});
|
|
634
|
+
}) : (r = e._zod).check ?? (r.check = () => {});
|
|
635
|
+
}), bt = /* @__PURE__ */ e("$ZodCheckRegex", (e, t) => {
|
|
636
|
+
yt.init(e, t), e._zod.check = (n) => {
|
|
637
|
+
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
638
|
+
origin: "string",
|
|
639
|
+
code: "invalid_format",
|
|
640
|
+
format: "regex",
|
|
641
|
+
input: n.value,
|
|
642
|
+
pattern: t.pattern.toString(),
|
|
643
|
+
inst: e,
|
|
644
|
+
continue: !t.abort
|
|
645
|
+
});
|
|
646
|
+
};
|
|
647
|
+
}), xt = /* @__PURE__ */ e("$ZodCheckLowerCase", (e, t) => {
|
|
648
|
+
t.pattern ??= lt, yt.init(e, t);
|
|
649
|
+
}), St = /* @__PURE__ */ e("$ZodCheckUpperCase", (e, t) => {
|
|
650
|
+
t.pattern ??= ut, yt.init(e, t);
|
|
651
|
+
}), Ct = /* @__PURE__ */ e("$ZodCheckIncludes", (e, t) => {
|
|
652
|
+
T.init(e, t);
|
|
653
|
+
let n = h(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
654
|
+
t.pattern = r, e._zod.onattach.push((e) => {
|
|
655
|
+
let t = e._zod.bag;
|
|
656
|
+
t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r);
|
|
657
|
+
}), e._zod.check = (n) => {
|
|
658
|
+
n.value.includes(t.includes, t.position) || n.issues.push({
|
|
659
|
+
origin: "string",
|
|
660
|
+
code: "invalid_format",
|
|
661
|
+
format: "includes",
|
|
662
|
+
includes: t.includes,
|
|
663
|
+
input: n.value,
|
|
664
|
+
inst: e,
|
|
665
|
+
continue: !t.abort
|
|
666
|
+
});
|
|
667
|
+
};
|
|
668
|
+
}), wt = /* @__PURE__ */ e("$ZodCheckStartsWith", (e, t) => {
|
|
669
|
+
T.init(e, t);
|
|
670
|
+
let n = RegExp(`^${h(t.prefix)}.*`);
|
|
671
|
+
t.pattern ??= n, e._zod.onattach.push((e) => {
|
|
672
|
+
let t = e._zod.bag;
|
|
673
|
+
t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
|
|
674
|
+
}), e._zod.check = (n) => {
|
|
675
|
+
n.value.startsWith(t.prefix) || n.issues.push({
|
|
676
|
+
origin: "string",
|
|
677
|
+
code: "invalid_format",
|
|
678
|
+
format: "starts_with",
|
|
679
|
+
prefix: t.prefix,
|
|
680
|
+
input: n.value,
|
|
681
|
+
inst: e,
|
|
682
|
+
continue: !t.abort
|
|
683
|
+
});
|
|
684
|
+
};
|
|
685
|
+
}), Tt = /* @__PURE__ */ e("$ZodCheckEndsWith", (e, t) => {
|
|
686
|
+
T.init(e, t);
|
|
687
|
+
let n = RegExp(`.*${h(t.suffix)}$`);
|
|
688
|
+
t.pattern ??= n, e._zod.onattach.push((e) => {
|
|
689
|
+
let t = e._zod.bag;
|
|
690
|
+
t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
|
|
691
|
+
}), e._zod.check = (n) => {
|
|
692
|
+
n.value.endsWith(t.suffix) || n.issues.push({
|
|
693
|
+
origin: "string",
|
|
694
|
+
code: "invalid_format",
|
|
695
|
+
format: "ends_with",
|
|
696
|
+
suffix: t.suffix,
|
|
697
|
+
input: n.value,
|
|
698
|
+
inst: e,
|
|
699
|
+
continue: !t.abort
|
|
700
|
+
});
|
|
701
|
+
};
|
|
702
|
+
}), Et = /* @__PURE__ */ e("$ZodCheckOverwrite", (e, t) => {
|
|
703
|
+
T.init(e, t), e._zod.check = (e) => {
|
|
704
|
+
e.value = t.tx(e.value);
|
|
705
|
+
};
|
|
706
|
+
}), Dt = class {
|
|
707
|
+
constructor(e = []) {
|
|
708
|
+
this.content = [], this.indent = 0, this && (this.args = e);
|
|
709
|
+
}
|
|
710
|
+
indented(e) {
|
|
711
|
+
this.indent += 1, e(this), --this.indent;
|
|
712
|
+
}
|
|
713
|
+
write(e) {
|
|
714
|
+
if (typeof e == "function") {
|
|
715
|
+
e(this, { execution: "sync" }), e(this, { execution: "async" });
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
718
|
+
let t = e.split("\n").filter((e) => e), n = Math.min(...t.map((e) => e.length - e.trimStart().length)), r = t.map((e) => e.slice(n)).map((e) => " ".repeat(this.indent * 2) + e);
|
|
719
|
+
for (let e of r) this.content.push(e);
|
|
720
|
+
}
|
|
721
|
+
compile() {
|
|
722
|
+
let e = Function, t = this?.args, n = [...(this?.content ?? [""]).map((e) => ` ${e}`)];
|
|
723
|
+
return new e(...t, n.join("\n"));
|
|
724
|
+
}
|
|
725
|
+
}, Ot = {
|
|
726
|
+
major: 4,
|
|
727
|
+
minor: 3,
|
|
728
|
+
patch: 6
|
|
729
|
+
}, E = /* @__PURE__ */ e("$ZodType", (e, n) => {
|
|
730
|
+
var r;
|
|
731
|
+
e ??= {}, e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = Ot;
|
|
732
|
+
let i = [...e._zod.def.checks ?? []];
|
|
733
|
+
e._zod.traits.has("$ZodCheck") && i.unshift(e);
|
|
734
|
+
for (let t of i) for (let n of t._zod.onattach) n(e);
|
|
735
|
+
if (i.length === 0) (r = e._zod).deferred ?? (r.deferred = []), e._zod.deferred?.push(() => {
|
|
736
|
+
e._zod.run = e._zod.parse;
|
|
737
|
+
});
|
|
738
|
+
else {
|
|
739
|
+
let n = (e, n, r) => {
|
|
740
|
+
let i = v(e), a;
|
|
741
|
+
for (let o of n) {
|
|
742
|
+
if (o._zod.def.when) {
|
|
743
|
+
if (!o._zod.def.when(e)) continue;
|
|
744
|
+
} else if (i) continue;
|
|
745
|
+
let n = e.issues.length, s = o._zod.check(e);
|
|
746
|
+
if (s instanceof Promise && r?.async === !1) throw new t();
|
|
747
|
+
if (a || s instanceof Promise) a = (a ?? Promise.resolve()).then(async () => {
|
|
748
|
+
await s, e.issues.length !== n && (i ||= v(e, n));
|
|
749
|
+
});
|
|
750
|
+
else {
|
|
751
|
+
if (e.issues.length === n) continue;
|
|
752
|
+
i ||= v(e, n);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
return a ? a.then(() => e) : e;
|
|
756
|
+
}, r = (r, a, o) => {
|
|
757
|
+
if (v(r)) return r.aborted = !0, r;
|
|
758
|
+
let s = n(a, i, o);
|
|
759
|
+
if (s instanceof Promise) {
|
|
760
|
+
if (o.async === !1) throw new t();
|
|
761
|
+
return s.then((t) => e._zod.parse(t, o));
|
|
762
|
+
}
|
|
763
|
+
return e._zod.parse(s, o);
|
|
764
|
+
};
|
|
765
|
+
e._zod.run = (a, o) => {
|
|
766
|
+
if (o.skipChecks) return e._zod.parse(a, o);
|
|
767
|
+
if (o.direction === "backward") {
|
|
768
|
+
let t = e._zod.parse({
|
|
769
|
+
value: a.value,
|
|
770
|
+
issues: []
|
|
771
|
+
}, {
|
|
772
|
+
...o,
|
|
773
|
+
skipChecks: !0
|
|
774
|
+
});
|
|
775
|
+
return t instanceof Promise ? t.then((e) => r(e, a, o)) : r(t, a, o);
|
|
776
|
+
}
|
|
777
|
+
let s = e._zod.parse(a, o);
|
|
778
|
+
if (s instanceof Promise) {
|
|
779
|
+
if (o.async === !1) throw new t();
|
|
780
|
+
return s.then((e) => n(e, i, o));
|
|
781
|
+
}
|
|
782
|
+
return n(s, i, o);
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
d(e, "~standard", () => ({
|
|
786
|
+
validate: (t) => {
|
|
787
|
+
try {
|
|
788
|
+
let n = Te(e, t);
|
|
789
|
+
return n.success ? { value: n.data } : { issues: n.error?.issues };
|
|
790
|
+
} catch {
|
|
791
|
+
return Ee(e, t).then((e) => e.success ? { value: e.data } : { issues: e.error?.issues });
|
|
792
|
+
}
|
|
793
|
+
},
|
|
794
|
+
vendor: "zod",
|
|
795
|
+
version: 1
|
|
796
|
+
}));
|
|
797
|
+
}), kt = /* @__PURE__ */ e("$ZodString", (e, t) => {
|
|
798
|
+
E.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? at(e._zod.bag), e._zod.parse = (n, r) => {
|
|
799
|
+
if (t.coerce) try {
|
|
800
|
+
n.value = String(n.value);
|
|
801
|
+
} catch {}
|
|
802
|
+
return typeof n.value == "string" || n.issues.push({
|
|
803
|
+
expected: "string",
|
|
804
|
+
code: "invalid_type",
|
|
805
|
+
input: n.value,
|
|
806
|
+
inst: e
|
|
807
|
+
}), n;
|
|
808
|
+
};
|
|
809
|
+
}), D = /* @__PURE__ */ e("$ZodStringFormat", (e, t) => {
|
|
810
|
+
yt.init(e, t), kt.init(e, t);
|
|
811
|
+
}), At = /* @__PURE__ */ e("$ZodGUID", (e, t) => {
|
|
812
|
+
t.pattern ??= He, D.init(e, t);
|
|
813
|
+
}), jt = /* @__PURE__ */ e("$ZodUUID", (e, t) => {
|
|
814
|
+
if (t.version) {
|
|
815
|
+
let e = {
|
|
816
|
+
v1: 1,
|
|
817
|
+
v2: 2,
|
|
818
|
+
v3: 3,
|
|
819
|
+
v4: 4,
|
|
820
|
+
v5: 5,
|
|
821
|
+
v6: 6,
|
|
822
|
+
v7: 7,
|
|
823
|
+
v8: 8
|
|
824
|
+
}[t.version];
|
|
825
|
+
if (e === void 0) throw Error(`Invalid UUID version: "${t.version}"`);
|
|
826
|
+
t.pattern ??= Ue(e);
|
|
827
|
+
} else t.pattern ??= Ue();
|
|
828
|
+
D.init(e, t);
|
|
829
|
+
}), Mt = /* @__PURE__ */ e("$ZodEmail", (e, t) => {
|
|
830
|
+
t.pattern ??= We, D.init(e, t);
|
|
831
|
+
}), Nt = /* @__PURE__ */ e("$ZodURL", (e, t) => {
|
|
832
|
+
D.init(e, t), e._zod.check = (n) => {
|
|
833
|
+
try {
|
|
834
|
+
let r = n.value.trim(), i = new URL(r);
|
|
835
|
+
t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(i.hostname) || n.issues.push({
|
|
836
|
+
code: "invalid_format",
|
|
837
|
+
format: "url",
|
|
838
|
+
note: "Invalid hostname",
|
|
839
|
+
pattern: t.hostname.source,
|
|
840
|
+
input: n.value,
|
|
841
|
+
inst: e,
|
|
842
|
+
continue: !t.abort
|
|
843
|
+
})), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(i.protocol.endsWith(":") ? i.protocol.slice(0, -1) : i.protocol) || n.issues.push({
|
|
844
|
+
code: "invalid_format",
|
|
845
|
+
format: "url",
|
|
846
|
+
note: "Invalid protocol",
|
|
847
|
+
pattern: t.protocol.source,
|
|
848
|
+
input: n.value,
|
|
849
|
+
inst: e,
|
|
850
|
+
continue: !t.abort
|
|
851
|
+
})), t.normalize ? n.value = i.href : n.value = r;
|
|
852
|
+
return;
|
|
853
|
+
} catch {
|
|
854
|
+
n.issues.push({
|
|
855
|
+
code: "invalid_format",
|
|
856
|
+
format: "url",
|
|
857
|
+
input: n.value,
|
|
858
|
+
inst: e,
|
|
859
|
+
continue: !t.abort
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
};
|
|
863
|
+
}), Pt = /* @__PURE__ */ e("$ZodEmoji", (e, t) => {
|
|
864
|
+
t.pattern ??= Ke(), D.init(e, t);
|
|
865
|
+
}), Ft = /* @__PURE__ */ e("$ZodNanoID", (e, t) => {
|
|
866
|
+
t.pattern ??= Be, D.init(e, t);
|
|
867
|
+
}), It = /* @__PURE__ */ e("$ZodCUID", (e, t) => {
|
|
868
|
+
t.pattern ??= Fe, D.init(e, t);
|
|
869
|
+
}), Lt = /* @__PURE__ */ e("$ZodCUID2", (e, t) => {
|
|
870
|
+
t.pattern ??= Ie, D.init(e, t);
|
|
871
|
+
}), Rt = /* @__PURE__ */ e("$ZodULID", (e, t) => {
|
|
872
|
+
t.pattern ??= Le, D.init(e, t);
|
|
873
|
+
}), zt = /* @__PURE__ */ e("$ZodXID", (e, t) => {
|
|
874
|
+
t.pattern ??= Re, D.init(e, t);
|
|
875
|
+
}), Bt = /* @__PURE__ */ e("$ZodKSUID", (e, t) => {
|
|
876
|
+
t.pattern ??= ze, D.init(e, t);
|
|
877
|
+
}), Vt = /* @__PURE__ */ e("$ZodISODateTime", (e, t) => {
|
|
878
|
+
t.pattern ??= it(t), D.init(e, t);
|
|
879
|
+
}), Ht = /* @__PURE__ */ e("$ZodISODate", (e, t) => {
|
|
880
|
+
t.pattern ??= tt, D.init(e, t);
|
|
881
|
+
}), Ut = /* @__PURE__ */ e("$ZodISOTime", (e, t) => {
|
|
882
|
+
t.pattern ??= rt(t), D.init(e, t);
|
|
883
|
+
}), Wt = /* @__PURE__ */ e("$ZodISODuration", (e, t) => {
|
|
884
|
+
t.pattern ??= Ve, D.init(e, t);
|
|
885
|
+
}), Gt = /* @__PURE__ */ e("$ZodIPv4", (e, t) => {
|
|
886
|
+
t.pattern ??= qe, D.init(e, t), e._zod.bag.format = "ipv4";
|
|
887
|
+
}), Kt = /* @__PURE__ */ e("$ZodIPv6", (e, t) => {
|
|
888
|
+
t.pattern ??= Je, D.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
|
|
889
|
+
try {
|
|
890
|
+
new URL(`http://[${n.value}]`);
|
|
891
|
+
} catch {
|
|
892
|
+
n.issues.push({
|
|
893
|
+
code: "invalid_format",
|
|
894
|
+
format: "ipv6",
|
|
895
|
+
input: n.value,
|
|
896
|
+
inst: e,
|
|
897
|
+
continue: !t.abort
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
};
|
|
901
|
+
}), qt = /* @__PURE__ */ e("$ZodCIDRv4", (e, t) => {
|
|
902
|
+
t.pattern ??= Ye, D.init(e, t);
|
|
903
|
+
}), Jt = /* @__PURE__ */ e("$ZodCIDRv6", (e, t) => {
|
|
904
|
+
t.pattern ??= Xe, D.init(e, t), e._zod.check = (n) => {
|
|
905
|
+
let r = n.value.split("/");
|
|
906
|
+
try {
|
|
907
|
+
if (r.length !== 2) throw Error();
|
|
908
|
+
let [e, t] = r;
|
|
909
|
+
if (!t) throw Error();
|
|
910
|
+
let n = Number(t);
|
|
911
|
+
if (`${n}` !== t || n < 0 || n > 128) throw Error();
|
|
912
|
+
new URL(`http://[${e}]`);
|
|
913
|
+
} catch {
|
|
914
|
+
n.issues.push({
|
|
915
|
+
code: "invalid_format",
|
|
916
|
+
format: "cidrv6",
|
|
917
|
+
input: n.value,
|
|
918
|
+
inst: e,
|
|
919
|
+
continue: !t.abort
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
};
|
|
923
|
+
});
|
|
924
|
+
function Yt(e) {
|
|
925
|
+
if (e === "") return !0;
|
|
926
|
+
if (e.length % 4 != 0) return !1;
|
|
927
|
+
try {
|
|
928
|
+
return atob(e), !0;
|
|
929
|
+
} catch {
|
|
930
|
+
return !1;
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
var Xt = /* @__PURE__ */ e("$ZodBase64", (e, t) => {
|
|
934
|
+
t.pattern ??= Ze, D.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
|
|
935
|
+
Yt(n.value) || n.issues.push({
|
|
936
|
+
code: "invalid_format",
|
|
937
|
+
format: "base64",
|
|
938
|
+
input: n.value,
|
|
939
|
+
inst: e,
|
|
940
|
+
continue: !t.abort
|
|
941
|
+
});
|
|
942
|
+
};
|
|
943
|
+
});
|
|
944
|
+
function Zt(e) {
|
|
945
|
+
if (!Qe.test(e)) return !1;
|
|
946
|
+
let t = e.replace(/[-_]/g, (e) => e === "-" ? "+" : "/");
|
|
947
|
+
return Yt(t.padEnd(Math.ceil(t.length / 4) * 4, "="));
|
|
948
|
+
}
|
|
949
|
+
var Qt = /* @__PURE__ */ e("$ZodBase64URL", (e, t) => {
|
|
950
|
+
t.pattern ??= Qe, D.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
|
|
951
|
+
Zt(n.value) || n.issues.push({
|
|
952
|
+
code: "invalid_format",
|
|
953
|
+
format: "base64url",
|
|
954
|
+
input: n.value,
|
|
955
|
+
inst: e,
|
|
956
|
+
continue: !t.abort
|
|
957
|
+
});
|
|
958
|
+
};
|
|
959
|
+
}), $t = /* @__PURE__ */ e("$ZodE164", (e, t) => {
|
|
960
|
+
t.pattern ??= $e, D.init(e, t);
|
|
961
|
+
});
|
|
962
|
+
function en(e, t = null) {
|
|
963
|
+
try {
|
|
964
|
+
let n = e.split(".");
|
|
965
|
+
if (n.length !== 3) return !1;
|
|
966
|
+
let [r] = n;
|
|
967
|
+
if (!r) return !1;
|
|
968
|
+
let i = JSON.parse(atob(r));
|
|
969
|
+
return !("typ" in i && i?.typ !== "JWT" || !i.alg || t && (!("alg" in i) || i.alg !== t));
|
|
970
|
+
} catch {
|
|
971
|
+
return !1;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
var tn = /* @__PURE__ */ e("$ZodJWT", (e, t) => {
|
|
975
|
+
D.init(e, t), e._zod.check = (n) => {
|
|
976
|
+
en(n.value, t.alg) || n.issues.push({
|
|
977
|
+
code: "invalid_format",
|
|
978
|
+
format: "jwt",
|
|
979
|
+
input: n.value,
|
|
980
|
+
inst: e,
|
|
981
|
+
continue: !t.abort
|
|
982
|
+
});
|
|
983
|
+
};
|
|
984
|
+
}), nn = /* @__PURE__ */ e("$ZodNumber", (e, t) => {
|
|
985
|
+
E.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? st, e._zod.parse = (n, r) => {
|
|
986
|
+
if (t.coerce) try {
|
|
987
|
+
n.value = Number(n.value);
|
|
988
|
+
} catch {}
|
|
989
|
+
let i = n.value;
|
|
990
|
+
if (typeof i == "number" && !Number.isNaN(i) && Number.isFinite(i)) return n;
|
|
991
|
+
let a = typeof i == "number" ? Number.isNaN(i) ? "NaN" : Number.isFinite(i) ? void 0 : "Infinity" : void 0;
|
|
992
|
+
return n.issues.push({
|
|
993
|
+
expected: "number",
|
|
994
|
+
code: "invalid_type",
|
|
995
|
+
input: i,
|
|
996
|
+
inst: e,
|
|
997
|
+
...a ? { received: a } : {}
|
|
998
|
+
}), n;
|
|
999
|
+
};
|
|
1000
|
+
}), rn = /* @__PURE__ */ e("$ZodNumberFormat", (e, t) => {
|
|
1001
|
+
ht.init(e, t), nn.init(e, t);
|
|
1002
|
+
}), an = /* @__PURE__ */ e("$ZodBoolean", (e, t) => {
|
|
1003
|
+
E.init(e, t), e._zod.pattern = ct, e._zod.parse = (n, r) => {
|
|
1004
|
+
if (t.coerce) try {
|
|
1005
|
+
n.value = !!n.value;
|
|
1006
|
+
} catch {}
|
|
1007
|
+
let i = n.value;
|
|
1008
|
+
return typeof i == "boolean" || n.issues.push({
|
|
1009
|
+
expected: "boolean",
|
|
1010
|
+
code: "invalid_type",
|
|
1011
|
+
input: i,
|
|
1012
|
+
inst: e
|
|
1013
|
+
}), n;
|
|
1014
|
+
};
|
|
1015
|
+
}), on = /* @__PURE__ */ e("$ZodUnknown", (e, t) => {
|
|
1016
|
+
E.init(e, t), e._zod.parse = (e) => e;
|
|
1017
|
+
}), sn = /* @__PURE__ */ e("$ZodNever", (e, t) => {
|
|
1018
|
+
E.init(e, t), e._zod.parse = (t, n) => (t.issues.push({
|
|
1019
|
+
expected: "never",
|
|
1020
|
+
code: "invalid_type",
|
|
1021
|
+
input: t.value,
|
|
1022
|
+
inst: e
|
|
1023
|
+
}), t);
|
|
1024
|
+
});
|
|
1025
|
+
function cn(e, t, n) {
|
|
1026
|
+
e.issues.length && t.issues.push(...y(n, e.issues)), t.value[n] = e.value;
|
|
1027
|
+
}
|
|
1028
|
+
var ln = /* @__PURE__ */ e("$ZodArray", (e, t) => {
|
|
1029
|
+
E.init(e, t), e._zod.parse = (n, r) => {
|
|
1030
|
+
let i = n.value;
|
|
1031
|
+
if (!Array.isArray(i)) return n.issues.push({
|
|
1032
|
+
expected: "array",
|
|
1033
|
+
code: "invalid_type",
|
|
1034
|
+
input: i,
|
|
1035
|
+
inst: e
|
|
1036
|
+
}), n;
|
|
1037
|
+
n.value = Array(i.length);
|
|
1038
|
+
let a = [];
|
|
1039
|
+
for (let e = 0; e < i.length; e++) {
|
|
1040
|
+
let o = i[e], s = t.element._zod.run({
|
|
1041
|
+
value: o,
|
|
1042
|
+
issues: []
|
|
1043
|
+
}, r);
|
|
1044
|
+
s instanceof Promise ? a.push(s.then((t) => cn(t, n, e))) : cn(s, n, e);
|
|
1045
|
+
}
|
|
1046
|
+
return a.length ? Promise.all(a).then(() => n) : n;
|
|
1047
|
+
};
|
|
1048
|
+
});
|
|
1049
|
+
function O(e, t, n, r, i) {
|
|
1050
|
+
if (e.issues.length) {
|
|
1051
|
+
if (i && !(n in r)) return;
|
|
1052
|
+
t.issues.push(...y(n, e.issues));
|
|
1053
|
+
}
|
|
1054
|
+
e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
|
|
1055
|
+
}
|
|
1056
|
+
function un(e) {
|
|
1057
|
+
let t = Object.keys(e.shape);
|
|
1058
|
+
for (let n of t) if (!e.shape?.[n]?._zod?.traits?.has("$ZodType")) throw Error(`Invalid element at key "${n}": expected a Zod schema`);
|
|
1059
|
+
let n = ce(e.shape);
|
|
1060
|
+
return {
|
|
1061
|
+
...e,
|
|
1062
|
+
keys: t,
|
|
1063
|
+
keySet: new Set(t),
|
|
1064
|
+
numKeys: t.length,
|
|
1065
|
+
optionalKeys: new Set(n)
|
|
1066
|
+
};
|
|
1067
|
+
}
|
|
1068
|
+
function dn(e, t, n, r, i, a) {
|
|
1069
|
+
let o = [], s = i.keySet, c = i.catchall._zod, l = c.def.type, u = c.optout === "optional";
|
|
1070
|
+
for (let i in t) {
|
|
1071
|
+
if (s.has(i)) continue;
|
|
1072
|
+
if (l === "never") {
|
|
1073
|
+
o.push(i);
|
|
1074
|
+
continue;
|
|
1075
|
+
}
|
|
1076
|
+
let a = c.run({
|
|
1077
|
+
value: t[i],
|
|
1078
|
+
issues: []
|
|
1079
|
+
}, r);
|
|
1080
|
+
a instanceof Promise ? e.push(a.then((e) => O(e, n, i, t, u))) : O(a, n, i, t, u);
|
|
1081
|
+
}
|
|
1082
|
+
return o.length && n.issues.push({
|
|
1083
|
+
code: "unrecognized_keys",
|
|
1084
|
+
keys: o,
|
|
1085
|
+
input: t,
|
|
1086
|
+
inst: a
|
|
1087
|
+
}), e.length ? Promise.all(e).then(() => n) : n;
|
|
1088
|
+
}
|
|
1089
|
+
var fn = /* @__PURE__ */ e("$ZodObject", (e, t) => {
|
|
1090
|
+
if (E.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
|
|
1091
|
+
let e = t.shape;
|
|
1092
|
+
Object.defineProperty(t, "shape", { get: () => {
|
|
1093
|
+
let n = { ...e };
|
|
1094
|
+
return Object.defineProperty(t, "shape", { value: n }), n;
|
|
1095
|
+
} });
|
|
1096
|
+
}
|
|
1097
|
+
let n = s(() => un(t));
|
|
1098
|
+
d(e._zod, "propValues", () => {
|
|
1099
|
+
let e = t.shape, n = {};
|
|
1100
|
+
for (let t in e) {
|
|
1101
|
+
let r = e[t]._zod;
|
|
1102
|
+
if (r.values) {
|
|
1103
|
+
n[t] ?? (n[t] = /* @__PURE__ */ new Set());
|
|
1104
|
+
for (let e of r.values) n[t].add(e);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
return n;
|
|
1108
|
+
});
|
|
1109
|
+
let r = ie, i = t.catchall, a;
|
|
1110
|
+
e._zod.parse = (t, o) => {
|
|
1111
|
+
a ??= n.value;
|
|
1112
|
+
let s = t.value;
|
|
1113
|
+
if (!r(s)) return t.issues.push({
|
|
1114
|
+
expected: "object",
|
|
1115
|
+
code: "invalid_type",
|
|
1116
|
+
input: s,
|
|
1117
|
+
inst: e
|
|
1118
|
+
}), t;
|
|
1119
|
+
t.value = {};
|
|
1120
|
+
let c = [], l = a.shape;
|
|
1121
|
+
for (let e of a.keys) {
|
|
1122
|
+
let n = l[e], r = n._zod.optout === "optional", i = n._zod.run({
|
|
1123
|
+
value: s[e],
|
|
1124
|
+
issues: []
|
|
1125
|
+
}, o);
|
|
1126
|
+
i instanceof Promise ? c.push(i.then((n) => O(n, t, e, s, r))) : O(i, t, e, s, r);
|
|
1127
|
+
}
|
|
1128
|
+
return i ? dn(c, s, t, o, n.value, e) : c.length ? Promise.all(c).then(() => t) : t;
|
|
1129
|
+
};
|
|
1130
|
+
}), pn = /* @__PURE__ */ e("$ZodObjectJIT", (e, t) => {
|
|
1131
|
+
fn.init(e, t);
|
|
1132
|
+
let n = e._zod.parse, i = s(() => un(t)), a = (e) => {
|
|
1133
|
+
let t = new Dt([
|
|
1134
|
+
"shape",
|
|
1135
|
+
"payload",
|
|
1136
|
+
"ctx"
|
|
1137
|
+
]), n = i.value, r = (e) => {
|
|
1138
|
+
let t = te(e);
|
|
1139
|
+
return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`;
|
|
1140
|
+
};
|
|
1141
|
+
t.write("const input = payload.value;");
|
|
1142
|
+
let a = Object.create(null), o = 0;
|
|
1143
|
+
for (let e of n.keys) a[e] = `key_${o++}`;
|
|
1144
|
+
t.write("const newResult = {};");
|
|
1145
|
+
for (let i of n.keys) {
|
|
1146
|
+
let n = a[i], o = te(i), s = e[i]?._zod?.optout === "optional";
|
|
1147
|
+
t.write(`const ${n} = ${r(i)};`), s ? t.write(`
|
|
1148
|
+
if (${n}.issues.length) {
|
|
1149
|
+
if (${o} in input) {
|
|
1150
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
1151
|
+
...iss,
|
|
1152
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
1153
|
+
})));
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
if (${n}.value === undefined) {
|
|
1158
|
+
if (${o} in input) {
|
|
1159
|
+
newResult[${o}] = undefined;
|
|
1160
|
+
}
|
|
1161
|
+
} else {
|
|
1162
|
+
newResult[${o}] = ${n}.value;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
`) : t.write(`
|
|
1166
|
+
if (${n}.issues.length) {
|
|
1167
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
1168
|
+
...iss,
|
|
1169
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
1170
|
+
})));
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
if (${n}.value === undefined) {
|
|
1174
|
+
if (${o} in input) {
|
|
1175
|
+
newResult[${o}] = undefined;
|
|
1176
|
+
}
|
|
1177
|
+
} else {
|
|
1178
|
+
newResult[${o}] = ${n}.value;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
`);
|
|
1182
|
+
}
|
|
1183
|
+
t.write("payload.value = newResult;"), t.write("return payload;");
|
|
1184
|
+
let s = t.compile();
|
|
1185
|
+
return (t, n) => s(e, t, n);
|
|
1186
|
+
}, o, c = ie, l = !r.jitless, u = l && ae.value, ee = t.catchall, d;
|
|
1187
|
+
e._zod.parse = (r, s) => {
|
|
1188
|
+
d ??= i.value;
|
|
1189
|
+
let f = r.value;
|
|
1190
|
+
return c(f) ? l && u && s?.async === !1 && s.jitless !== !0 ? (o ||= a(t.shape), r = o(r, s), ee ? dn([], f, r, s, d, e) : r) : n(r, s) : (r.issues.push({
|
|
1191
|
+
expected: "object",
|
|
1192
|
+
code: "invalid_type",
|
|
1193
|
+
input: f,
|
|
1194
|
+
inst: e
|
|
1195
|
+
}), r);
|
|
1196
|
+
};
|
|
1197
|
+
});
|
|
1198
|
+
function mn(e, t, n, r) {
|
|
1199
|
+
for (let n of e) if (n.issues.length === 0) return t.value = n.value, t;
|
|
1200
|
+
let a = e.filter((e) => !v(e));
|
|
1201
|
+
return a.length === 1 ? (t.value = a[0].value, a[0]) : (t.issues.push({
|
|
1202
|
+
code: "invalid_union",
|
|
1203
|
+
input: t.value,
|
|
1204
|
+
inst: n,
|
|
1205
|
+
errors: e.map((e) => e.issues.map((e) => x(e, r, i())))
|
|
1206
|
+
}), t);
|
|
1207
|
+
}
|
|
1208
|
+
var hn = /* @__PURE__ */ e("$ZodUnion", (e, t) => {
|
|
1209
|
+
E.init(e, t), d(e._zod, "optin", () => t.options.some((e) => e._zod.optin === "optional") ? "optional" : void 0), d(e._zod, "optout", () => t.options.some((e) => e._zod.optout === "optional") ? "optional" : void 0), d(e._zod, "values", () => {
|
|
1210
|
+
if (t.options.every((e) => e._zod.values)) return new Set(t.options.flatMap((e) => Array.from(e._zod.values)));
|
|
1211
|
+
}), d(e._zod, "pattern", () => {
|
|
1212
|
+
if (t.options.every((e) => e._zod.pattern)) {
|
|
1213
|
+
let e = t.options.map((e) => e._zod.pattern);
|
|
1214
|
+
return RegExp(`^(${e.map((e) => l(e.source)).join("|")})$`);
|
|
1215
|
+
}
|
|
1216
|
+
});
|
|
1217
|
+
let n = t.options.length === 1, r = t.options[0]._zod.run;
|
|
1218
|
+
e._zod.parse = (i, a) => {
|
|
1219
|
+
if (n) return r(i, a);
|
|
1220
|
+
let o = !1, s = [];
|
|
1221
|
+
for (let e of t.options) {
|
|
1222
|
+
let t = e._zod.run({
|
|
1223
|
+
value: i.value,
|
|
1224
|
+
issues: []
|
|
1225
|
+
}, a);
|
|
1226
|
+
if (t instanceof Promise) s.push(t), o = !0;
|
|
1227
|
+
else {
|
|
1228
|
+
if (t.issues.length === 0) return t;
|
|
1229
|
+
s.push(t);
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
return o ? Promise.all(s).then((t) => mn(t, i, e, a)) : mn(s, i, e, a);
|
|
1233
|
+
};
|
|
1234
|
+
}), gn = /* @__PURE__ */ e("$ZodIntersection", (e, t) => {
|
|
1235
|
+
E.init(e, t), e._zod.parse = (e, n) => {
|
|
1236
|
+
let r = e.value, i = t.left._zod.run({
|
|
1237
|
+
value: r,
|
|
1238
|
+
issues: []
|
|
1239
|
+
}, n), a = t.right._zod.run({
|
|
1240
|
+
value: r,
|
|
1241
|
+
issues: []
|
|
1242
|
+
}, n);
|
|
1243
|
+
return i instanceof Promise || a instanceof Promise ? Promise.all([i, a]).then(([t, n]) => vn(e, t, n)) : vn(e, i, a);
|
|
1244
|
+
};
|
|
1245
|
+
});
|
|
1246
|
+
function _n(e, t) {
|
|
1247
|
+
if (e === t || e instanceof Date && t instanceof Date && +e == +t) return {
|
|
1248
|
+
valid: !0,
|
|
1249
|
+
data: e
|
|
1250
|
+
};
|
|
1251
|
+
if (m(e) && m(t)) {
|
|
1252
|
+
let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = {
|
|
1253
|
+
...e,
|
|
1254
|
+
...t
|
|
1255
|
+
};
|
|
1256
|
+
for (let n of r) {
|
|
1257
|
+
let r = _n(e[n], t[n]);
|
|
1258
|
+
if (!r.valid) return {
|
|
1259
|
+
valid: !1,
|
|
1260
|
+
mergeErrorPath: [n, ...r.mergeErrorPath]
|
|
1261
|
+
};
|
|
1262
|
+
i[n] = r.data;
|
|
1263
|
+
}
|
|
1264
|
+
return {
|
|
1265
|
+
valid: !0,
|
|
1266
|
+
data: i
|
|
1267
|
+
};
|
|
1268
|
+
}
|
|
1269
|
+
if (Array.isArray(e) && Array.isArray(t)) {
|
|
1270
|
+
if (e.length !== t.length) return {
|
|
1271
|
+
valid: !1,
|
|
1272
|
+
mergeErrorPath: []
|
|
1273
|
+
};
|
|
1274
|
+
let n = [];
|
|
1275
|
+
for (let r = 0; r < e.length; r++) {
|
|
1276
|
+
let i = e[r], a = t[r], o = _n(i, a);
|
|
1277
|
+
if (!o.valid) return {
|
|
1278
|
+
valid: !1,
|
|
1279
|
+
mergeErrorPath: [r, ...o.mergeErrorPath]
|
|
1280
|
+
};
|
|
1281
|
+
n.push(o.data);
|
|
1282
|
+
}
|
|
1283
|
+
return {
|
|
1284
|
+
valid: !0,
|
|
1285
|
+
data: n
|
|
1286
|
+
};
|
|
1287
|
+
}
|
|
1288
|
+
return {
|
|
1289
|
+
valid: !1,
|
|
1290
|
+
mergeErrorPath: []
|
|
1291
|
+
};
|
|
1292
|
+
}
|
|
1293
|
+
function vn(e, t, n) {
|
|
1294
|
+
let r = /* @__PURE__ */ new Map(), i;
|
|
1295
|
+
for (let n of t.issues) if (n.code === "unrecognized_keys") {
|
|
1296
|
+
i ??= n;
|
|
1297
|
+
for (let e of n.keys) r.has(e) || r.set(e, {}), r.get(e).l = !0;
|
|
1298
|
+
} else e.issues.push(n);
|
|
1299
|
+
for (let t of n.issues) if (t.code === "unrecognized_keys") for (let e of t.keys) r.has(e) || r.set(e, {}), r.get(e).r = !0;
|
|
1300
|
+
else e.issues.push(t);
|
|
1301
|
+
let a = [...r].filter(([, e]) => e.l && e.r).map(([e]) => e);
|
|
1302
|
+
if (a.length && i && e.issues.push({
|
|
1303
|
+
...i,
|
|
1304
|
+
keys: a
|
|
1305
|
+
}), v(e)) return e;
|
|
1306
|
+
let o = _n(t.value, n.value);
|
|
1307
|
+
if (!o.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);
|
|
1308
|
+
return e.value = o.data, e;
|
|
1309
|
+
}
|
|
1310
|
+
var yn = /* @__PURE__ */ e("$ZodRecord", (e, t) => {
|
|
1311
|
+
E.init(e, t), e._zod.parse = (n, r) => {
|
|
1312
|
+
let a = n.value;
|
|
1313
|
+
if (!m(a)) return n.issues.push({
|
|
1314
|
+
expected: "record",
|
|
1315
|
+
code: "invalid_type",
|
|
1316
|
+
input: a,
|
|
1317
|
+
inst: e
|
|
1318
|
+
}), n;
|
|
1319
|
+
let o = [], s = t.keyType._zod.values;
|
|
1320
|
+
if (s) {
|
|
1321
|
+
n.value = {};
|
|
1322
|
+
let i = /* @__PURE__ */ new Set();
|
|
1323
|
+
for (let e of s) if (typeof e == "string" || typeof e == "number" || typeof e == "symbol") {
|
|
1324
|
+
i.add(typeof e == "number" ? e.toString() : e);
|
|
1325
|
+
let s = t.valueType._zod.run({
|
|
1326
|
+
value: a[e],
|
|
1327
|
+
issues: []
|
|
1328
|
+
}, r);
|
|
1329
|
+
s instanceof Promise ? o.push(s.then((t) => {
|
|
1330
|
+
t.issues.length && n.issues.push(...y(e, t.issues)), n.value[e] = t.value;
|
|
1331
|
+
})) : (s.issues.length && n.issues.push(...y(e, s.issues)), n.value[e] = s.value);
|
|
1332
|
+
}
|
|
1333
|
+
let c;
|
|
1334
|
+
for (let e in a) i.has(e) || (c ??= [], c.push(e));
|
|
1335
|
+
c && c.length > 0 && n.issues.push({
|
|
1336
|
+
code: "unrecognized_keys",
|
|
1337
|
+
input: a,
|
|
1338
|
+
inst: e,
|
|
1339
|
+
keys: c
|
|
1340
|
+
});
|
|
1341
|
+
} else {
|
|
1342
|
+
n.value = {};
|
|
1343
|
+
for (let s of Reflect.ownKeys(a)) {
|
|
1344
|
+
if (s === "__proto__") continue;
|
|
1345
|
+
let c = t.keyType._zod.run({
|
|
1346
|
+
value: s,
|
|
1347
|
+
issues: []
|
|
1348
|
+
}, r);
|
|
1349
|
+
if (c instanceof Promise) throw Error("Async schemas not supported in object keys currently");
|
|
1350
|
+
if (typeof s == "string" && st.test(s) && c.issues.length) {
|
|
1351
|
+
let e = t.keyType._zod.run({
|
|
1352
|
+
value: Number(s),
|
|
1353
|
+
issues: []
|
|
1354
|
+
}, r);
|
|
1355
|
+
if (e instanceof Promise) throw Error("Async schemas not supported in object keys currently");
|
|
1356
|
+
e.issues.length === 0 && (c = e);
|
|
1357
|
+
}
|
|
1358
|
+
if (c.issues.length) {
|
|
1359
|
+
t.mode === "loose" ? n.value[s] = a[s] : n.issues.push({
|
|
1360
|
+
code: "invalid_key",
|
|
1361
|
+
origin: "record",
|
|
1362
|
+
issues: c.issues.map((e) => x(e, r, i())),
|
|
1363
|
+
input: s,
|
|
1364
|
+
path: [s],
|
|
1365
|
+
inst: e
|
|
1366
|
+
});
|
|
1367
|
+
continue;
|
|
1368
|
+
}
|
|
1369
|
+
let l = t.valueType._zod.run({
|
|
1370
|
+
value: a[s],
|
|
1371
|
+
issues: []
|
|
1372
|
+
}, r);
|
|
1373
|
+
l instanceof Promise ? o.push(l.then((e) => {
|
|
1374
|
+
e.issues.length && n.issues.push(...y(s, e.issues)), n.value[c.value] = e.value;
|
|
1375
|
+
})) : (l.issues.length && n.issues.push(...y(s, l.issues)), n.value[c.value] = l.value);
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
return o.length ? Promise.all(o).then(() => n) : n;
|
|
1379
|
+
};
|
|
1380
|
+
}), bn = /* @__PURE__ */ e("$ZodEnum", (e, t) => {
|
|
1381
|
+
E.init(e, t);
|
|
1382
|
+
let n = a(t.entries), r = new Set(n);
|
|
1383
|
+
e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) => se.has(typeof e)).map((e) => typeof e == "string" ? h(e) : e.toString()).join("|")})$`), e._zod.parse = (t, i) => {
|
|
1384
|
+
let a = t.value;
|
|
1385
|
+
return r.has(a) || t.issues.push({
|
|
1386
|
+
code: "invalid_value",
|
|
1387
|
+
values: n,
|
|
1388
|
+
input: a,
|
|
1389
|
+
inst: e
|
|
1390
|
+
}), t;
|
|
1391
|
+
};
|
|
1392
|
+
}), xn = /* @__PURE__ */ e("$ZodLiteral", (e, t) => {
|
|
1393
|
+
if (E.init(e, t), t.values.length === 0) throw Error("Cannot create literal schema with no valid values");
|
|
1394
|
+
let n = new Set(t.values);
|
|
1395
|
+
e._zod.values = n, e._zod.pattern = RegExp(`^(${t.values.map((e) => typeof e == "string" ? h(e) : e ? h(e.toString()) : String(e)).join("|")})$`), e._zod.parse = (r, i) => {
|
|
1396
|
+
let a = r.value;
|
|
1397
|
+
return n.has(a) || r.issues.push({
|
|
1398
|
+
code: "invalid_value",
|
|
1399
|
+
values: t.values,
|
|
1400
|
+
input: a,
|
|
1401
|
+
inst: e
|
|
1402
|
+
}), r;
|
|
1403
|
+
};
|
|
1404
|
+
}), Sn = /* @__PURE__ */ e("$ZodTransform", (e, r) => {
|
|
1405
|
+
E.init(e, r), e._zod.parse = (i, a) => {
|
|
1406
|
+
if (a.direction === "backward") throw new n(e.constructor.name);
|
|
1407
|
+
let o = r.transform(i.value, i);
|
|
1408
|
+
if (a.async) return (o instanceof Promise ? o : Promise.resolve(o)).then((e) => (i.value = e, i));
|
|
1409
|
+
if (o instanceof Promise) throw new t();
|
|
1410
|
+
return i.value = o, i;
|
|
1411
|
+
};
|
|
1412
|
+
});
|
|
1413
|
+
function Cn(e, t) {
|
|
1414
|
+
return e.issues.length && t === void 0 ? {
|
|
1415
|
+
issues: [],
|
|
1416
|
+
value: void 0
|
|
1417
|
+
} : e;
|
|
1418
|
+
}
|
|
1419
|
+
var wn = /* @__PURE__ */ e("$ZodOptional", (e, t) => {
|
|
1420
|
+
E.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", d(e._zod, "values", () => t.innerType._zod.values ? new Set([...t.innerType._zod.values, void 0]) : void 0), d(e._zod, "pattern", () => {
|
|
1421
|
+
let e = t.innerType._zod.pattern;
|
|
1422
|
+
return e ? RegExp(`^(${l(e.source)})?$`) : void 0;
|
|
1423
|
+
}), e._zod.parse = (e, n) => {
|
|
1424
|
+
if (t.innerType._zod.optin === "optional") {
|
|
1425
|
+
let r = t.innerType._zod.run(e, n);
|
|
1426
|
+
return r instanceof Promise ? r.then((t) => Cn(t, e.value)) : Cn(r, e.value);
|
|
1427
|
+
}
|
|
1428
|
+
return e.value === void 0 ? e : t.innerType._zod.run(e, n);
|
|
1429
|
+
};
|
|
1430
|
+
}), Tn = /* @__PURE__ */ e("$ZodExactOptional", (e, t) => {
|
|
1431
|
+
wn.init(e, t), d(e._zod, "values", () => t.innerType._zod.values), d(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (e, n) => t.innerType._zod.run(e, n);
|
|
1432
|
+
}), En = /* @__PURE__ */ e("$ZodNullable", (e, t) => {
|
|
1433
|
+
E.init(e, t), d(e._zod, "optin", () => t.innerType._zod.optin), d(e._zod, "optout", () => t.innerType._zod.optout), d(e._zod, "pattern", () => {
|
|
1434
|
+
let e = t.innerType._zod.pattern;
|
|
1435
|
+
return e ? RegExp(`^(${l(e.source)}|null)$`) : void 0;
|
|
1436
|
+
}), d(e._zod, "values", () => t.innerType._zod.values ? new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (e, n) => e.value === null ? e : t.innerType._zod.run(e, n);
|
|
1437
|
+
}), Dn = /* @__PURE__ */ e("$ZodDefault", (e, t) => {
|
|
1438
|
+
E.init(e, t), e._zod.optin = "optional", d(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
|
|
1439
|
+
if (n.direction === "backward") return t.innerType._zod.run(e, n);
|
|
1440
|
+
if (e.value === void 0) return e.value = t.defaultValue, e;
|
|
1441
|
+
let r = t.innerType._zod.run(e, n);
|
|
1442
|
+
return r instanceof Promise ? r.then((e) => On(e, t)) : On(r, t);
|
|
1443
|
+
};
|
|
1444
|
+
});
|
|
1445
|
+
function On(e, t) {
|
|
1446
|
+
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1447
|
+
}
|
|
1448
|
+
var kn = /* @__PURE__ */ e("$ZodPrefault", (e, t) => {
|
|
1449
|
+
E.init(e, t), e._zod.optin = "optional", d(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => (n.direction === "backward" || e.value === void 0 && (e.value = t.defaultValue), t.innerType._zod.run(e, n));
|
|
1450
|
+
}), An = /* @__PURE__ */ e("$ZodNonOptional", (e, t) => {
|
|
1451
|
+
E.init(e, t), d(e._zod, "values", () => {
|
|
1452
|
+
let e = t.innerType._zod.values;
|
|
1453
|
+
return e ? new Set([...e].filter((e) => e !== void 0)) : void 0;
|
|
1454
|
+
}), e._zod.parse = (n, r) => {
|
|
1455
|
+
let i = t.innerType._zod.run(n, r);
|
|
1456
|
+
return i instanceof Promise ? i.then((t) => jn(t, e)) : jn(i, e);
|
|
1457
|
+
};
|
|
1458
|
+
});
|
|
1459
|
+
function jn(e, t) {
|
|
1460
|
+
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1461
|
+
code: "invalid_type",
|
|
1462
|
+
expected: "nonoptional",
|
|
1463
|
+
input: e.value,
|
|
1464
|
+
inst: t
|
|
1465
|
+
}), e;
|
|
1466
|
+
}
|
|
1467
|
+
var Mn = /* @__PURE__ */ e("$ZodCatch", (e, t) => {
|
|
1468
|
+
E.init(e, t), d(e._zod, "optin", () => t.innerType._zod.optin), d(e._zod, "optout", () => t.innerType._zod.optout), d(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
|
|
1469
|
+
if (n.direction === "backward") return t.innerType._zod.run(e, n);
|
|
1470
|
+
let r = t.innerType._zod.run(e, n);
|
|
1471
|
+
return r instanceof Promise ? r.then((r) => (e.value = r.value, r.issues.length && (e.value = t.catchValue({
|
|
1472
|
+
...e,
|
|
1473
|
+
error: { issues: r.issues.map((e) => x(e, n, i())) },
|
|
1474
|
+
input: e.value
|
|
1475
|
+
}), e.issues = []), e)) : (e.value = r.value, r.issues.length && (e.value = t.catchValue({
|
|
1476
|
+
...e,
|
|
1477
|
+
error: { issues: r.issues.map((e) => x(e, n, i())) },
|
|
1478
|
+
input: e.value
|
|
1479
|
+
}), e.issues = []), e);
|
|
1480
|
+
};
|
|
1481
|
+
}), Nn = /* @__PURE__ */ e("$ZodPipe", (e, t) => {
|
|
1482
|
+
E.init(e, t), d(e._zod, "values", () => t.in._zod.values), d(e._zod, "optin", () => t.in._zod.optin), d(e._zod, "optout", () => t.out._zod.optout), d(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (e, n) => {
|
|
1483
|
+
if (n.direction === "backward") {
|
|
1484
|
+
let r = t.out._zod.run(e, n);
|
|
1485
|
+
return r instanceof Promise ? r.then((e) => k(e, t.in, n)) : k(r, t.in, n);
|
|
1486
|
+
}
|
|
1487
|
+
let r = t.in._zod.run(e, n);
|
|
1488
|
+
return r instanceof Promise ? r.then((e) => k(e, t.out, n)) : k(r, t.out, n);
|
|
1489
|
+
};
|
|
1490
|
+
});
|
|
1491
|
+
function k(e, t, n) {
|
|
1492
|
+
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({
|
|
1493
|
+
value: e.value,
|
|
1494
|
+
issues: e.issues
|
|
1495
|
+
}, n);
|
|
1496
|
+
}
|
|
1497
|
+
var Pn = /* @__PURE__ */ e("$ZodReadonly", (e, t) => {
|
|
1498
|
+
E.init(e, t), d(e._zod, "propValues", () => t.innerType._zod.propValues), d(e._zod, "values", () => t.innerType._zod.values), d(e._zod, "optin", () => t.innerType?._zod?.optin), d(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (e, n) => {
|
|
1499
|
+
if (n.direction === "backward") return t.innerType._zod.run(e, n);
|
|
1500
|
+
let r = t.innerType._zod.run(e, n);
|
|
1501
|
+
return r instanceof Promise ? r.then(Fn) : Fn(r);
|
|
1502
|
+
};
|
|
1503
|
+
});
|
|
1504
|
+
function Fn(e) {
|
|
1505
|
+
return e.value = Object.freeze(e.value), e;
|
|
1506
|
+
}
|
|
1507
|
+
var In = /* @__PURE__ */ e("$ZodLazy", (e, t) => {
|
|
1508
|
+
E.init(e, t), d(e._zod, "innerType", () => t.getter()), d(e._zod, "pattern", () => e._zod.innerType?._zod?.pattern), d(e._zod, "propValues", () => e._zod.innerType?._zod?.propValues), d(e._zod, "optin", () => e._zod.innerType?._zod?.optin ?? void 0), d(e._zod, "optout", () => e._zod.innerType?._zod?.optout ?? void 0), e._zod.parse = (t, n) => e._zod.innerType._zod.run(t, n);
|
|
1509
|
+
}), Ln = /* @__PURE__ */ e("$ZodCustom", (e, t) => {
|
|
1510
|
+
T.init(e, t), E.init(e, t), e._zod.parse = (e, t) => e, e._zod.check = (n) => {
|
|
1511
|
+
let r = n.value, i = t.fn(r);
|
|
1512
|
+
if (i instanceof Promise) return i.then((t) => Rn(t, n, r, e));
|
|
1513
|
+
Rn(i, n, r, e);
|
|
1514
|
+
};
|
|
1515
|
+
});
|
|
1516
|
+
function Rn(e, t, n, r) {
|
|
1517
|
+
if (!e) {
|
|
1518
|
+
let e = {
|
|
1519
|
+
code: "custom",
|
|
1520
|
+
input: n,
|
|
1521
|
+
inst: r,
|
|
1522
|
+
path: [...r._zod.def.path ?? []],
|
|
1523
|
+
continue: !r._zod.def.abort
|
|
1524
|
+
};
|
|
1525
|
+
r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(S(e));
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
//#endregion
|
|
1529
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js
|
|
1530
|
+
var zn, Bn = class {
|
|
1531
|
+
constructor() {
|
|
1532
|
+
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1533
|
+
}
|
|
1534
|
+
add(e, ...t) {
|
|
1535
|
+
let n = t[0];
|
|
1536
|
+
return this._map.set(e, n), n && typeof n == "object" && "id" in n && this._idmap.set(n.id, e), this;
|
|
1537
|
+
}
|
|
1538
|
+
clear() {
|
|
1539
|
+
return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
|
|
1540
|
+
}
|
|
1541
|
+
remove(e) {
|
|
1542
|
+
let t = this._map.get(e);
|
|
1543
|
+
return t && typeof t == "object" && "id" in t && this._idmap.delete(t.id), this._map.delete(e), this;
|
|
1544
|
+
}
|
|
1545
|
+
get(e) {
|
|
1546
|
+
let t = e._zod.parent;
|
|
1547
|
+
if (t) {
|
|
1548
|
+
let n = { ...this.get(t) ?? {} };
|
|
1549
|
+
delete n.id;
|
|
1550
|
+
let r = {
|
|
1551
|
+
...n,
|
|
1552
|
+
...this._map.get(e)
|
|
1553
|
+
};
|
|
1554
|
+
return Object.keys(r).length ? r : void 0;
|
|
1555
|
+
}
|
|
1556
|
+
return this._map.get(e);
|
|
1557
|
+
}
|
|
1558
|
+
has(e) {
|
|
1559
|
+
return this._map.has(e);
|
|
1560
|
+
}
|
|
1561
|
+
};
|
|
1562
|
+
function Vn() {
|
|
1563
|
+
return new Bn();
|
|
1564
|
+
}
|
|
1565
|
+
(zn = globalThis).__zod_globalRegistry ?? (zn.__zod_globalRegistry = Vn());
|
|
1566
|
+
var A = globalThis.__zod_globalRegistry;
|
|
1567
|
+
//#endregion
|
|
1568
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js
|
|
1569
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1570
|
+
function Hn(e, t) {
|
|
1571
|
+
return new e({
|
|
1572
|
+
type: "string",
|
|
1573
|
+
..._(t)
|
|
1574
|
+
});
|
|
1575
|
+
}
|
|
1576
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1577
|
+
function Un(e, t) {
|
|
1578
|
+
return new e({
|
|
1579
|
+
type: "string",
|
|
1580
|
+
format: "email",
|
|
1581
|
+
check: "string_format",
|
|
1582
|
+
abort: !1,
|
|
1583
|
+
..._(t)
|
|
1584
|
+
});
|
|
1585
|
+
}
|
|
1586
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1587
|
+
function Wn(e, t) {
|
|
1588
|
+
return new e({
|
|
1589
|
+
type: "string",
|
|
1590
|
+
format: "guid",
|
|
1591
|
+
check: "string_format",
|
|
1592
|
+
abort: !1,
|
|
1593
|
+
..._(t)
|
|
1594
|
+
});
|
|
1595
|
+
}
|
|
1596
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1597
|
+
function Gn(e, t) {
|
|
1598
|
+
return new e({
|
|
1599
|
+
type: "string",
|
|
1600
|
+
format: "uuid",
|
|
1601
|
+
check: "string_format",
|
|
1602
|
+
abort: !1,
|
|
1603
|
+
..._(t)
|
|
1604
|
+
});
|
|
1605
|
+
}
|
|
1606
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1607
|
+
function Kn(e, t) {
|
|
1608
|
+
return new e({
|
|
1609
|
+
type: "string",
|
|
1610
|
+
format: "uuid",
|
|
1611
|
+
check: "string_format",
|
|
1612
|
+
abort: !1,
|
|
1613
|
+
version: "v4",
|
|
1614
|
+
..._(t)
|
|
1615
|
+
});
|
|
1616
|
+
}
|
|
1617
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1618
|
+
function qn(e, t) {
|
|
1619
|
+
return new e({
|
|
1620
|
+
type: "string",
|
|
1621
|
+
format: "uuid",
|
|
1622
|
+
check: "string_format",
|
|
1623
|
+
abort: !1,
|
|
1624
|
+
version: "v6",
|
|
1625
|
+
..._(t)
|
|
1626
|
+
});
|
|
1627
|
+
}
|
|
1628
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1629
|
+
function Jn(e, t) {
|
|
1630
|
+
return new e({
|
|
1631
|
+
type: "string",
|
|
1632
|
+
format: "uuid",
|
|
1633
|
+
check: "string_format",
|
|
1634
|
+
abort: !1,
|
|
1635
|
+
version: "v7",
|
|
1636
|
+
..._(t)
|
|
1637
|
+
});
|
|
1638
|
+
}
|
|
1639
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1640
|
+
function Yn(e, t) {
|
|
1641
|
+
return new e({
|
|
1642
|
+
type: "string",
|
|
1643
|
+
format: "url",
|
|
1644
|
+
check: "string_format",
|
|
1645
|
+
abort: !1,
|
|
1646
|
+
..._(t)
|
|
1647
|
+
});
|
|
1648
|
+
}
|
|
1649
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1650
|
+
function Xn(e, t) {
|
|
1651
|
+
return new e({
|
|
1652
|
+
type: "string",
|
|
1653
|
+
format: "emoji",
|
|
1654
|
+
check: "string_format",
|
|
1655
|
+
abort: !1,
|
|
1656
|
+
..._(t)
|
|
1657
|
+
});
|
|
1658
|
+
}
|
|
1659
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1660
|
+
function Zn(e, t) {
|
|
1661
|
+
return new e({
|
|
1662
|
+
type: "string",
|
|
1663
|
+
format: "nanoid",
|
|
1664
|
+
check: "string_format",
|
|
1665
|
+
abort: !1,
|
|
1666
|
+
..._(t)
|
|
1667
|
+
});
|
|
1668
|
+
}
|
|
1669
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1670
|
+
function Qn(e, t) {
|
|
1671
|
+
return new e({
|
|
1672
|
+
type: "string",
|
|
1673
|
+
format: "cuid",
|
|
1674
|
+
check: "string_format",
|
|
1675
|
+
abort: !1,
|
|
1676
|
+
..._(t)
|
|
1677
|
+
});
|
|
1678
|
+
}
|
|
1679
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1680
|
+
function $n(e, t) {
|
|
1681
|
+
return new e({
|
|
1682
|
+
type: "string",
|
|
1683
|
+
format: "cuid2",
|
|
1684
|
+
check: "string_format",
|
|
1685
|
+
abort: !1,
|
|
1686
|
+
..._(t)
|
|
1687
|
+
});
|
|
1688
|
+
}
|
|
1689
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1690
|
+
function er(e, t) {
|
|
1691
|
+
return new e({
|
|
1692
|
+
type: "string",
|
|
1693
|
+
format: "ulid",
|
|
1694
|
+
check: "string_format",
|
|
1695
|
+
abort: !1,
|
|
1696
|
+
..._(t)
|
|
1697
|
+
});
|
|
1698
|
+
}
|
|
1699
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1700
|
+
function tr(e, t) {
|
|
1701
|
+
return new e({
|
|
1702
|
+
type: "string",
|
|
1703
|
+
format: "xid",
|
|
1704
|
+
check: "string_format",
|
|
1705
|
+
abort: !1,
|
|
1706
|
+
..._(t)
|
|
1707
|
+
});
|
|
1708
|
+
}
|
|
1709
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1710
|
+
function nr(e, t) {
|
|
1711
|
+
return new e({
|
|
1712
|
+
type: "string",
|
|
1713
|
+
format: "ksuid",
|
|
1714
|
+
check: "string_format",
|
|
1715
|
+
abort: !1,
|
|
1716
|
+
..._(t)
|
|
1717
|
+
});
|
|
1718
|
+
}
|
|
1719
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1720
|
+
function rr(e, t) {
|
|
1721
|
+
return new e({
|
|
1722
|
+
type: "string",
|
|
1723
|
+
format: "ipv4",
|
|
1724
|
+
check: "string_format",
|
|
1725
|
+
abort: !1,
|
|
1726
|
+
..._(t)
|
|
1727
|
+
});
|
|
1728
|
+
}
|
|
1729
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1730
|
+
function ir(e, t) {
|
|
1731
|
+
return new e({
|
|
1732
|
+
type: "string",
|
|
1733
|
+
format: "ipv6",
|
|
1734
|
+
check: "string_format",
|
|
1735
|
+
abort: !1,
|
|
1736
|
+
..._(t)
|
|
1737
|
+
});
|
|
1738
|
+
}
|
|
1739
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1740
|
+
function ar(e, t) {
|
|
1741
|
+
return new e({
|
|
1742
|
+
type: "string",
|
|
1743
|
+
format: "cidrv4",
|
|
1744
|
+
check: "string_format",
|
|
1745
|
+
abort: !1,
|
|
1746
|
+
..._(t)
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1749
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1750
|
+
function or(e, t) {
|
|
1751
|
+
return new e({
|
|
1752
|
+
type: "string",
|
|
1753
|
+
format: "cidrv6",
|
|
1754
|
+
check: "string_format",
|
|
1755
|
+
abort: !1,
|
|
1756
|
+
..._(t)
|
|
1757
|
+
});
|
|
1758
|
+
}
|
|
1759
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1760
|
+
function sr(e, t) {
|
|
1761
|
+
return new e({
|
|
1762
|
+
type: "string",
|
|
1763
|
+
format: "base64",
|
|
1764
|
+
check: "string_format",
|
|
1765
|
+
abort: !1,
|
|
1766
|
+
..._(t)
|
|
1767
|
+
});
|
|
1768
|
+
}
|
|
1769
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1770
|
+
function cr(e, t) {
|
|
1771
|
+
return new e({
|
|
1772
|
+
type: "string",
|
|
1773
|
+
format: "base64url",
|
|
1774
|
+
check: "string_format",
|
|
1775
|
+
abort: !1,
|
|
1776
|
+
..._(t)
|
|
1777
|
+
});
|
|
1778
|
+
}
|
|
1779
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1780
|
+
function lr(e, t) {
|
|
1781
|
+
return new e({
|
|
1782
|
+
type: "string",
|
|
1783
|
+
format: "e164",
|
|
1784
|
+
check: "string_format",
|
|
1785
|
+
abort: !1,
|
|
1786
|
+
..._(t)
|
|
1787
|
+
});
|
|
1788
|
+
}
|
|
1789
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1790
|
+
function ur(e, t) {
|
|
1791
|
+
return new e({
|
|
1792
|
+
type: "string",
|
|
1793
|
+
format: "jwt",
|
|
1794
|
+
check: "string_format",
|
|
1795
|
+
abort: !1,
|
|
1796
|
+
..._(t)
|
|
1797
|
+
});
|
|
1798
|
+
}
|
|
1799
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1800
|
+
function dr(e, t) {
|
|
1801
|
+
return new e({
|
|
1802
|
+
type: "string",
|
|
1803
|
+
format: "datetime",
|
|
1804
|
+
check: "string_format",
|
|
1805
|
+
offset: !1,
|
|
1806
|
+
local: !1,
|
|
1807
|
+
precision: null,
|
|
1808
|
+
..._(t)
|
|
1809
|
+
});
|
|
1810
|
+
}
|
|
1811
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1812
|
+
function fr(e, t) {
|
|
1813
|
+
return new e({
|
|
1814
|
+
type: "string",
|
|
1815
|
+
format: "date",
|
|
1816
|
+
check: "string_format",
|
|
1817
|
+
..._(t)
|
|
1818
|
+
});
|
|
1819
|
+
}
|
|
1820
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1821
|
+
function pr(e, t) {
|
|
1822
|
+
return new e({
|
|
1823
|
+
type: "string",
|
|
1824
|
+
format: "time",
|
|
1825
|
+
check: "string_format",
|
|
1826
|
+
precision: null,
|
|
1827
|
+
..._(t)
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1831
|
+
function mr(e, t) {
|
|
1832
|
+
return new e({
|
|
1833
|
+
type: "string",
|
|
1834
|
+
format: "duration",
|
|
1835
|
+
check: "string_format",
|
|
1836
|
+
..._(t)
|
|
1837
|
+
});
|
|
1838
|
+
}
|
|
1839
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1840
|
+
function hr(e, t) {
|
|
1841
|
+
return new e({
|
|
1842
|
+
type: "number",
|
|
1843
|
+
checks: [],
|
|
1844
|
+
..._(t)
|
|
1845
|
+
});
|
|
1846
|
+
}
|
|
1847
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1848
|
+
function gr(e, t) {
|
|
1849
|
+
return new e({
|
|
1850
|
+
type: "number",
|
|
1851
|
+
check: "number_format",
|
|
1852
|
+
abort: !1,
|
|
1853
|
+
format: "safeint",
|
|
1854
|
+
..._(t)
|
|
1855
|
+
});
|
|
1856
|
+
}
|
|
1857
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1858
|
+
function _r(e, t) {
|
|
1859
|
+
return new e({
|
|
1860
|
+
type: "boolean",
|
|
1861
|
+
..._(t)
|
|
1862
|
+
});
|
|
1863
|
+
}
|
|
1864
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1865
|
+
function vr(e) {
|
|
1866
|
+
return new e({ type: "unknown" });
|
|
1867
|
+
}
|
|
1868
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1869
|
+
function yr(e, t) {
|
|
1870
|
+
return new e({
|
|
1871
|
+
type: "never",
|
|
1872
|
+
..._(t)
|
|
1873
|
+
});
|
|
1874
|
+
}
|
|
1875
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1876
|
+
function br(e, t) {
|
|
1877
|
+
return new ft({
|
|
1878
|
+
check: "less_than",
|
|
1879
|
+
..._(t),
|
|
1880
|
+
value: e,
|
|
1881
|
+
inclusive: !1
|
|
1882
|
+
});
|
|
1883
|
+
}
|
|
1884
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1885
|
+
function xr(e, t) {
|
|
1886
|
+
return new ft({
|
|
1887
|
+
check: "less_than",
|
|
1888
|
+
..._(t),
|
|
1889
|
+
value: e,
|
|
1890
|
+
inclusive: !0
|
|
1891
|
+
});
|
|
1892
|
+
}
|
|
1893
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1894
|
+
function Sr(e, t) {
|
|
1895
|
+
return new pt({
|
|
1896
|
+
check: "greater_than",
|
|
1897
|
+
..._(t),
|
|
1898
|
+
value: e,
|
|
1899
|
+
inclusive: !1
|
|
1900
|
+
});
|
|
1901
|
+
}
|
|
1902
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1903
|
+
function Cr(e, t) {
|
|
1904
|
+
return new pt({
|
|
1905
|
+
check: "greater_than",
|
|
1906
|
+
..._(t),
|
|
1907
|
+
value: e,
|
|
1908
|
+
inclusive: !0
|
|
1909
|
+
});
|
|
1910
|
+
}
|
|
1911
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1912
|
+
function wr(e, t) {
|
|
1913
|
+
return new mt({
|
|
1914
|
+
check: "multiple_of",
|
|
1915
|
+
..._(t),
|
|
1916
|
+
value: e
|
|
1917
|
+
});
|
|
1918
|
+
}
|
|
1919
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1920
|
+
function Tr(e, t) {
|
|
1921
|
+
return new gt({
|
|
1922
|
+
check: "max_length",
|
|
1923
|
+
..._(t),
|
|
1924
|
+
maximum: e
|
|
1925
|
+
});
|
|
1926
|
+
}
|
|
1927
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1928
|
+
function j(e, t) {
|
|
1929
|
+
return new _t({
|
|
1930
|
+
check: "min_length",
|
|
1931
|
+
..._(t),
|
|
1932
|
+
minimum: e
|
|
1933
|
+
});
|
|
1934
|
+
}
|
|
1935
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1936
|
+
function Er(e, t) {
|
|
1937
|
+
return new vt({
|
|
1938
|
+
check: "length_equals",
|
|
1939
|
+
..._(t),
|
|
1940
|
+
length: e
|
|
1941
|
+
});
|
|
1942
|
+
}
|
|
1943
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1944
|
+
function Dr(e, t) {
|
|
1945
|
+
return new bt({
|
|
1946
|
+
check: "string_format",
|
|
1947
|
+
format: "regex",
|
|
1948
|
+
..._(t),
|
|
1949
|
+
pattern: e
|
|
1950
|
+
});
|
|
1951
|
+
}
|
|
1952
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1953
|
+
function Or(e) {
|
|
1954
|
+
return new xt({
|
|
1955
|
+
check: "string_format",
|
|
1956
|
+
format: "lowercase",
|
|
1957
|
+
..._(e)
|
|
1958
|
+
});
|
|
1959
|
+
}
|
|
1960
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1961
|
+
function kr(e) {
|
|
1962
|
+
return new St({
|
|
1963
|
+
check: "string_format",
|
|
1964
|
+
format: "uppercase",
|
|
1965
|
+
..._(e)
|
|
1966
|
+
});
|
|
1967
|
+
}
|
|
1968
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1969
|
+
function Ar(e, t) {
|
|
1970
|
+
return new Ct({
|
|
1971
|
+
check: "string_format",
|
|
1972
|
+
format: "includes",
|
|
1973
|
+
..._(t),
|
|
1974
|
+
includes: e
|
|
1975
|
+
});
|
|
1976
|
+
}
|
|
1977
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1978
|
+
function jr(e, t) {
|
|
1979
|
+
return new wt({
|
|
1980
|
+
check: "string_format",
|
|
1981
|
+
format: "starts_with",
|
|
1982
|
+
..._(t),
|
|
1983
|
+
prefix: e
|
|
1984
|
+
});
|
|
1985
|
+
}
|
|
1986
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1987
|
+
function Mr(e, t) {
|
|
1988
|
+
return new Tt({
|
|
1989
|
+
check: "string_format",
|
|
1990
|
+
format: "ends_with",
|
|
1991
|
+
..._(t),
|
|
1992
|
+
suffix: e
|
|
1993
|
+
});
|
|
1994
|
+
}
|
|
1995
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1996
|
+
function M(e) {
|
|
1997
|
+
return new Et({
|
|
1998
|
+
check: "overwrite",
|
|
1999
|
+
tx: e
|
|
2000
|
+
});
|
|
2001
|
+
}
|
|
2002
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2003
|
+
function Nr(e) {
|
|
2004
|
+
return /* @__PURE__ */ M((t) => t.normalize(e));
|
|
2005
|
+
}
|
|
2006
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2007
|
+
function Pr() {
|
|
2008
|
+
return /* @__PURE__ */ M((e) => e.trim());
|
|
2009
|
+
}
|
|
2010
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2011
|
+
function Fr() {
|
|
2012
|
+
return /* @__PURE__ */ M((e) => e.toLowerCase());
|
|
2013
|
+
}
|
|
2014
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2015
|
+
function Ir() {
|
|
2016
|
+
return /* @__PURE__ */ M((e) => e.toUpperCase());
|
|
2017
|
+
}
|
|
2018
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2019
|
+
function Lr() {
|
|
2020
|
+
return /* @__PURE__ */ M((e) => ne(e));
|
|
2021
|
+
}
|
|
2022
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2023
|
+
function Rr(e, t, n) {
|
|
2024
|
+
return new e({
|
|
2025
|
+
type: "array",
|
|
2026
|
+
element: t,
|
|
2027
|
+
..._(n)
|
|
2028
|
+
});
|
|
2029
|
+
}
|
|
2030
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2031
|
+
function zr(e, t, n) {
|
|
2032
|
+
let r = _(n);
|
|
2033
|
+
return r.abort ??= !0, new e({
|
|
2034
|
+
type: "custom",
|
|
2035
|
+
check: "custom",
|
|
2036
|
+
fn: t,
|
|
2037
|
+
...r
|
|
2038
|
+
});
|
|
2039
|
+
}
|
|
2040
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2041
|
+
function Br(e, t, n) {
|
|
2042
|
+
return new e({
|
|
2043
|
+
type: "custom",
|
|
2044
|
+
check: "custom",
|
|
2045
|
+
fn: t,
|
|
2046
|
+
..._(n)
|
|
2047
|
+
});
|
|
2048
|
+
}
|
|
2049
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2050
|
+
function Vr(e) {
|
|
2051
|
+
let t = /* @__PURE__ */ Hr((n) => (n.addIssue = (e) => {
|
|
2052
|
+
if (typeof e == "string") n.issues.push(S(e, n.value, t._zod.def));
|
|
2053
|
+
else {
|
|
2054
|
+
let r = e;
|
|
2055
|
+
r.fatal && (r.continue = !1), r.code ??= "custom", r.input ??= n.value, r.inst ??= t, r.continue ??= !t._zod.def.abort, n.issues.push(S(r));
|
|
2056
|
+
}
|
|
2057
|
+
}, e(n.value, n)));
|
|
2058
|
+
return t;
|
|
2059
|
+
}
|
|
2060
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2061
|
+
function Hr(e, t) {
|
|
2062
|
+
let n = new T({
|
|
2063
|
+
check: "custom",
|
|
2064
|
+
..._(t)
|
|
2065
|
+
});
|
|
2066
|
+
return n._zod.check = e, n;
|
|
2067
|
+
}
|
|
2068
|
+
//#endregion
|
|
2069
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js
|
|
2070
|
+
function Ur(e) {
|
|
2071
|
+
let t = e?.target ?? "draft-2020-12";
|
|
2072
|
+
return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
|
|
2073
|
+
processors: e.processors ?? {},
|
|
2074
|
+
metadataRegistry: e?.metadata ?? A,
|
|
2075
|
+
target: t,
|
|
2076
|
+
unrepresentable: e?.unrepresentable ?? "throw",
|
|
2077
|
+
override: e?.override ?? (() => {}),
|
|
2078
|
+
io: e?.io ?? "output",
|
|
2079
|
+
counter: 0,
|
|
2080
|
+
seen: /* @__PURE__ */ new Map(),
|
|
2081
|
+
cycles: e?.cycles ?? "ref",
|
|
2082
|
+
reused: e?.reused ?? "inline",
|
|
2083
|
+
external: e?.external ?? void 0
|
|
2084
|
+
};
|
|
2085
|
+
}
|
|
2086
|
+
function N(e, t, n = {
|
|
2087
|
+
path: [],
|
|
2088
|
+
schemaPath: []
|
|
2089
|
+
}) {
|
|
2090
|
+
var r;
|
|
2091
|
+
let i = e._zod.def, a = t.seen.get(e);
|
|
2092
|
+
if (a) return a.count++, n.schemaPath.includes(e) && (a.cycle = n.path), a.schema;
|
|
2093
|
+
let o = {
|
|
2094
|
+
schema: {},
|
|
2095
|
+
count: 1,
|
|
2096
|
+
cycle: void 0,
|
|
2097
|
+
path: n.path
|
|
2098
|
+
};
|
|
2099
|
+
t.seen.set(e, o);
|
|
2100
|
+
let s = e._zod.toJSONSchema?.();
|
|
2101
|
+
if (s) o.schema = s;
|
|
2102
|
+
else {
|
|
2103
|
+
let r = {
|
|
2104
|
+
...n,
|
|
2105
|
+
schemaPath: [...n.schemaPath, e],
|
|
2106
|
+
path: n.path
|
|
2107
|
+
};
|
|
2108
|
+
if (e._zod.processJSONSchema) e._zod.processJSONSchema(t, o.schema, r);
|
|
2109
|
+
else {
|
|
2110
|
+
let n = o.schema, a = t.processors[i.type];
|
|
2111
|
+
if (!a) throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);
|
|
2112
|
+
a(e, t, n, r);
|
|
2113
|
+
}
|
|
2114
|
+
let a = e._zod.parent;
|
|
2115
|
+
a && (o.ref ||= a, N(a, t, r), t.seen.get(a).isParent = !0);
|
|
2116
|
+
}
|
|
2117
|
+
let c = t.metadataRegistry.get(e);
|
|
2118
|
+
return c && Object.assign(o.schema, c), t.io === "input" && P(e) && (delete o.schema.examples, delete o.schema.default), t.io === "input" && o.schema._prefault && ((r = o.schema).default ?? (r.default = o.schema._prefault)), delete o.schema._prefault, t.seen.get(e).schema;
|
|
2119
|
+
}
|
|
2120
|
+
function Wr(e, t) {
|
|
2121
|
+
let n = e.seen.get(t);
|
|
2122
|
+
if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
|
|
2123
|
+
let r = /* @__PURE__ */ new Map();
|
|
2124
|
+
for (let t of e.seen.entries()) {
|
|
2125
|
+
let n = e.metadataRegistry.get(t[0])?.id;
|
|
2126
|
+
if (n) {
|
|
2127
|
+
let e = r.get(n);
|
|
2128
|
+
if (e && e !== t[0]) throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
2129
|
+
r.set(n, t[0]);
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
let i = (t) => {
|
|
2133
|
+
let r = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
2134
|
+
if (e.external) {
|
|
2135
|
+
let n = e.external.registry.get(t[0])?.id, i = e.external.uri ?? ((e) => e);
|
|
2136
|
+
if (n) return { ref: i(n) };
|
|
2137
|
+
let a = t[1].defId ?? t[1].schema.id ?? `schema${e.counter++}`;
|
|
2138
|
+
return t[1].defId = a, {
|
|
2139
|
+
defId: a,
|
|
2140
|
+
ref: `${i("__shared")}#/${r}/${a}`
|
|
2141
|
+
};
|
|
2142
|
+
}
|
|
2143
|
+
if (t[1] === n) return { ref: "#" };
|
|
2144
|
+
let i = `#/${r}/`, a = t[1].schema.id ?? `__schema${e.counter++}`;
|
|
2145
|
+
return {
|
|
2146
|
+
defId: a,
|
|
2147
|
+
ref: i + a
|
|
2148
|
+
};
|
|
2149
|
+
}, a = (e) => {
|
|
2150
|
+
if (e[1].schema.$ref) return;
|
|
2151
|
+
let t = e[1], { ref: n, defId: r } = i(e);
|
|
2152
|
+
t.def = { ...t.schema }, r && (t.defId = r);
|
|
2153
|
+
let a = t.schema;
|
|
2154
|
+
for (let e in a) delete a[e];
|
|
2155
|
+
a.$ref = n;
|
|
2156
|
+
};
|
|
2157
|
+
if (e.cycles === "throw") for (let t of e.seen.entries()) {
|
|
2158
|
+
let e = t[1];
|
|
2159
|
+
if (e.cycle) throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
2160
|
+
|
|
2161
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
|
|
2162
|
+
}
|
|
2163
|
+
for (let n of e.seen.entries()) {
|
|
2164
|
+
let r = n[1];
|
|
2165
|
+
if (t === n[0]) {
|
|
2166
|
+
a(n);
|
|
2167
|
+
continue;
|
|
2168
|
+
}
|
|
2169
|
+
if (e.external) {
|
|
2170
|
+
let r = e.external.registry.get(n[0])?.id;
|
|
2171
|
+
if (t !== n[0] && r) {
|
|
2172
|
+
a(n);
|
|
2173
|
+
continue;
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
if (e.metadataRegistry.get(n[0])?.id) {
|
|
2177
|
+
a(n);
|
|
2178
|
+
continue;
|
|
2179
|
+
}
|
|
2180
|
+
if (r.cycle) {
|
|
2181
|
+
a(n);
|
|
2182
|
+
continue;
|
|
2183
|
+
}
|
|
2184
|
+
if (r.count > 1 && e.reused === "ref") {
|
|
2185
|
+
a(n);
|
|
2186
|
+
continue;
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
function Gr(e, t) {
|
|
2191
|
+
let n = e.seen.get(t);
|
|
2192
|
+
if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
|
|
2193
|
+
let r = (t) => {
|
|
2194
|
+
let n = e.seen.get(t);
|
|
2195
|
+
if (n.ref === null) return;
|
|
2196
|
+
let i = n.def ?? n.schema, a = { ...i }, o = n.ref;
|
|
2197
|
+
if (n.ref = null, o) {
|
|
2198
|
+
r(o);
|
|
2199
|
+
let n = e.seen.get(o), s = n.schema;
|
|
2200
|
+
if (s.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (i.allOf = i.allOf ?? [], i.allOf.push(s)) : Object.assign(i, s), Object.assign(i, a), t._zod.parent === o) for (let e in i) e === "$ref" || e === "allOf" || e in a || delete i[e];
|
|
2201
|
+
if (s.$ref && n.def) for (let e in i) e === "$ref" || e === "allOf" || e in n.def && JSON.stringify(i[e]) === JSON.stringify(n.def[e]) && delete i[e];
|
|
2202
|
+
}
|
|
2203
|
+
let s = t._zod.parent;
|
|
2204
|
+
if (s && s !== o) {
|
|
2205
|
+
r(s);
|
|
2206
|
+
let t = e.seen.get(s);
|
|
2207
|
+
if (t?.schema.$ref && (i.$ref = t.schema.$ref, t.def)) for (let e in i) e === "$ref" || e === "allOf" || e in t.def && JSON.stringify(i[e]) === JSON.stringify(t.def[e]) && delete i[e];
|
|
2208
|
+
}
|
|
2209
|
+
e.override({
|
|
2210
|
+
zodSchema: t,
|
|
2211
|
+
jsonSchema: i,
|
|
2212
|
+
path: n.path ?? []
|
|
2213
|
+
});
|
|
2214
|
+
};
|
|
2215
|
+
for (let t of [...e.seen.entries()].reverse()) r(t[0]);
|
|
2216
|
+
let i = {};
|
|
2217
|
+
if (e.target === "draft-2020-12" ? i.$schema = "https://json-schema.org/draft/2020-12/schema" : e.target === "draft-07" ? i.$schema = "http://json-schema.org/draft-07/schema#" : e.target === "draft-04" ? i.$schema = "http://json-schema.org/draft-04/schema#" : e.target, e.external?.uri) {
|
|
2218
|
+
let n = e.external.registry.get(t)?.id;
|
|
2219
|
+
if (!n) throw Error("Schema is missing an `id` property");
|
|
2220
|
+
i.$id = e.external.uri(n);
|
|
2221
|
+
}
|
|
2222
|
+
Object.assign(i, n.def ?? n.schema);
|
|
2223
|
+
let a = e.external?.defs ?? {};
|
|
2224
|
+
for (let t of e.seen.entries()) {
|
|
2225
|
+
let e = t[1];
|
|
2226
|
+
e.def && e.defId && (a[e.defId] = e.def);
|
|
2227
|
+
}
|
|
2228
|
+
e.external || Object.keys(a).length > 0 && (e.target === "draft-2020-12" ? i.$defs = a : i.definitions = a);
|
|
2229
|
+
try {
|
|
2230
|
+
let n = JSON.parse(JSON.stringify(i));
|
|
2231
|
+
return Object.defineProperty(n, "~standard", {
|
|
2232
|
+
value: {
|
|
2233
|
+
...t["~standard"],
|
|
2234
|
+
jsonSchema: {
|
|
2235
|
+
input: F(t, "input", e.processors),
|
|
2236
|
+
output: F(t, "output", e.processors)
|
|
2237
|
+
}
|
|
2238
|
+
},
|
|
2239
|
+
enumerable: !1,
|
|
2240
|
+
writable: !1
|
|
2241
|
+
}), n;
|
|
2242
|
+
} catch {
|
|
2243
|
+
throw Error("Error converting schema to JSON.");
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
function P(e, t) {
|
|
2247
|
+
let n = t ?? { seen: /* @__PURE__ */ new Set() };
|
|
2248
|
+
if (n.seen.has(e)) return !1;
|
|
2249
|
+
n.seen.add(e);
|
|
2250
|
+
let r = e._zod.def;
|
|
2251
|
+
if (r.type === "transform") return !0;
|
|
2252
|
+
if (r.type === "array") return P(r.element, n);
|
|
2253
|
+
if (r.type === "set") return P(r.valueType, n);
|
|
2254
|
+
if (r.type === "lazy") return P(r.getter(), n);
|
|
2255
|
+
if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault") return P(r.innerType, n);
|
|
2256
|
+
if (r.type === "intersection") return P(r.left, n) || P(r.right, n);
|
|
2257
|
+
if (r.type === "record" || r.type === "map") return P(r.keyType, n) || P(r.valueType, n);
|
|
2258
|
+
if (r.type === "pipe") return P(r.in, n) || P(r.out, n);
|
|
2259
|
+
if (r.type === "object") {
|
|
2260
|
+
for (let e in r.shape) if (P(r.shape[e], n)) return !0;
|
|
2261
|
+
return !1;
|
|
2262
|
+
}
|
|
2263
|
+
if (r.type === "union") {
|
|
2264
|
+
for (let e of r.options) if (P(e, n)) return !0;
|
|
2265
|
+
return !1;
|
|
2266
|
+
}
|
|
2267
|
+
if (r.type === "tuple") {
|
|
2268
|
+
for (let e of r.items) if (P(e, n)) return !0;
|
|
2269
|
+
return !!(r.rest && P(r.rest, n));
|
|
2270
|
+
}
|
|
2271
|
+
return !1;
|
|
2272
|
+
}
|
|
2273
|
+
var Kr = (e, t = {}) => (n) => {
|
|
2274
|
+
let r = Ur({
|
|
2275
|
+
...n,
|
|
2276
|
+
processors: t
|
|
2277
|
+
});
|
|
2278
|
+
return N(e, r), Wr(r, e), Gr(r, e);
|
|
2279
|
+
}, F = (e, t, n = {}) => (r) => {
|
|
2280
|
+
let { libraryOptions: i, target: a } = r ?? {}, o = Ur({
|
|
2281
|
+
...i ?? {},
|
|
2282
|
+
target: a,
|
|
2283
|
+
io: t,
|
|
2284
|
+
processors: n
|
|
2285
|
+
});
|
|
2286
|
+
return N(e, o), Wr(o, e), Gr(o, e);
|
|
2287
|
+
}, qr = {
|
|
2288
|
+
guid: "uuid",
|
|
2289
|
+
url: "uri",
|
|
2290
|
+
datetime: "date-time",
|
|
2291
|
+
json_string: "json-string",
|
|
2292
|
+
regex: ""
|
|
2293
|
+
}, Jr = (e, t, n, r) => {
|
|
2294
|
+
let i = n;
|
|
2295
|
+
i.type = "string";
|
|
2296
|
+
let { minimum: a, maximum: o, format: s, patterns: c, contentEncoding: l } = e._zod.bag;
|
|
2297
|
+
if (typeof a == "number" && (i.minLength = a), typeof o == "number" && (i.maxLength = o), s && (i.format = qr[s] ?? s, i.format === "" && delete i.format, s === "time" && delete i.format), l && (i.contentEncoding = l), c && c.size > 0) {
|
|
2298
|
+
let e = [...c];
|
|
2299
|
+
e.length === 1 ? i.pattern = e[0].source : e.length > 1 && (i.allOf = [...e.map((e) => ({
|
|
2300
|
+
...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
|
|
2301
|
+
pattern: e.source
|
|
2302
|
+
}))]);
|
|
2303
|
+
}
|
|
2304
|
+
}, Yr = (e, t, n, r) => {
|
|
2305
|
+
let i = n, { minimum: a, maximum: o, format: s, multipleOf: c, exclusiveMaximum: l, exclusiveMinimum: u } = e._zod.bag;
|
|
2306
|
+
typeof s == "string" && s.includes("int") ? i.type = "integer" : i.type = "number", typeof u == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (i.minimum = u, i.exclusiveMinimum = !0) : i.exclusiveMinimum = u), typeof a == "number" && (i.minimum = a, typeof u == "number" && t.target !== "draft-04" && (u >= a ? delete i.minimum : delete i.exclusiveMinimum)), typeof l == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (i.maximum = l, i.exclusiveMaximum = !0) : i.exclusiveMaximum = l), typeof o == "number" && (i.maximum = o, typeof l == "number" && t.target !== "draft-04" && (l <= o ? delete i.maximum : delete i.exclusiveMaximum)), typeof c == "number" && (i.multipleOf = c);
|
|
2307
|
+
}, Xr = (e, t, n, r) => {
|
|
2308
|
+
n.type = "boolean";
|
|
2309
|
+
}, Zr = (e, t, n, r) => {
|
|
2310
|
+
n.not = {};
|
|
2311
|
+
}, Qr = (e, t, n, r) => {
|
|
2312
|
+
let i = e._zod.def, o = a(i.entries);
|
|
2313
|
+
o.every((e) => typeof e == "number") && (n.type = "number"), o.every((e) => typeof e == "string") && (n.type = "string"), n.enum = o;
|
|
2314
|
+
}, $r = (e, t, n, r) => {
|
|
2315
|
+
let i = e._zod.def, a = [];
|
|
2316
|
+
for (let e of i.values) if (e === void 0) {
|
|
2317
|
+
if (t.unrepresentable === "throw") throw Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
2318
|
+
} else if (typeof e == "bigint") {
|
|
2319
|
+
if (t.unrepresentable === "throw") throw Error("BigInt literals cannot be represented in JSON Schema");
|
|
2320
|
+
a.push(Number(e));
|
|
2321
|
+
} else a.push(e);
|
|
2322
|
+
if (a.length !== 0) if (a.length === 1) {
|
|
2323
|
+
let e = a[0];
|
|
2324
|
+
n.type = e === null ? "null" : typeof e, t.target === "draft-04" || t.target === "openapi-3.0" ? n.enum = [e] : n.const = e;
|
|
2325
|
+
} else a.every((e) => typeof e == "number") && (n.type = "number"), a.every((e) => typeof e == "string") && (n.type = "string"), a.every((e) => typeof e == "boolean") && (n.type = "boolean"), a.every((e) => e === null) && (n.type = "null"), n.enum = a;
|
|
2326
|
+
}, ei = (e, t, n, r) => {
|
|
2327
|
+
if (t.unrepresentable === "throw") throw Error("Custom types cannot be represented in JSON Schema");
|
|
2328
|
+
}, ti = (e, t, n, r) => {
|
|
2329
|
+
if (t.unrepresentable === "throw") throw Error("Transforms cannot be represented in JSON Schema");
|
|
2330
|
+
}, ni = (e, t, n, r) => {
|
|
2331
|
+
let i = n, a = e._zod.def, { minimum: o, maximum: s } = e._zod.bag;
|
|
2332
|
+
typeof o == "number" && (i.minItems = o), typeof s == "number" && (i.maxItems = s), i.type = "array", i.items = N(a.element, t, {
|
|
2333
|
+
...r,
|
|
2334
|
+
path: [...r.path, "items"]
|
|
2335
|
+
});
|
|
2336
|
+
}, ri = (e, t, n, r) => {
|
|
2337
|
+
let i = n, a = e._zod.def;
|
|
2338
|
+
i.type = "object", i.properties = {};
|
|
2339
|
+
let o = a.shape;
|
|
2340
|
+
for (let e in o) i.properties[e] = N(o[e], t, {
|
|
2341
|
+
...r,
|
|
2342
|
+
path: [
|
|
2343
|
+
...r.path,
|
|
2344
|
+
"properties",
|
|
2345
|
+
e
|
|
2346
|
+
]
|
|
2347
|
+
});
|
|
2348
|
+
let s = new Set(Object.keys(o)), c = new Set([...s].filter((e) => {
|
|
2349
|
+
let n = a.shape[e]._zod;
|
|
2350
|
+
return t.io === "input" ? n.optin === void 0 : n.optout === void 0;
|
|
2351
|
+
}));
|
|
2352
|
+
c.size > 0 && (i.required = Array.from(c)), a.catchall?._zod.def.type === "never" ? i.additionalProperties = !1 : a.catchall ? a.catchall && (i.additionalProperties = N(a.catchall, t, {
|
|
2353
|
+
...r,
|
|
2354
|
+
path: [...r.path, "additionalProperties"]
|
|
2355
|
+
})) : t.io === "output" && (i.additionalProperties = !1);
|
|
2356
|
+
}, ii = (e, t, n, r) => {
|
|
2357
|
+
let i = e._zod.def, a = i.inclusive === !1, o = i.options.map((e, n) => N(e, t, {
|
|
2358
|
+
...r,
|
|
2359
|
+
path: [
|
|
2360
|
+
...r.path,
|
|
2361
|
+
a ? "oneOf" : "anyOf",
|
|
2362
|
+
n
|
|
2363
|
+
]
|
|
2364
|
+
}));
|
|
2365
|
+
a ? n.oneOf = o : n.anyOf = o;
|
|
2366
|
+
}, ai = (e, t, n, r) => {
|
|
2367
|
+
let i = e._zod.def, a = N(i.left, t, {
|
|
2368
|
+
...r,
|
|
2369
|
+
path: [
|
|
2370
|
+
...r.path,
|
|
2371
|
+
"allOf",
|
|
2372
|
+
0
|
|
2373
|
+
]
|
|
2374
|
+
}), o = N(i.right, t, {
|
|
2375
|
+
...r,
|
|
2376
|
+
path: [
|
|
2377
|
+
...r.path,
|
|
2378
|
+
"allOf",
|
|
2379
|
+
1
|
|
2380
|
+
]
|
|
2381
|
+
}), s = (e) => "allOf" in e && Object.keys(e).length === 1;
|
|
2382
|
+
n.allOf = [...s(a) ? a.allOf : [a], ...s(o) ? o.allOf : [o]];
|
|
2383
|
+
}, oi = (e, t, n, r) => {
|
|
2384
|
+
let i = n, a = e._zod.def;
|
|
2385
|
+
i.type = "object";
|
|
2386
|
+
let o = a.keyType, s = o._zod.bag?.patterns;
|
|
2387
|
+
if (a.mode === "loose" && s && s.size > 0) {
|
|
2388
|
+
let e = N(a.valueType, t, {
|
|
2389
|
+
...r,
|
|
2390
|
+
path: [
|
|
2391
|
+
...r.path,
|
|
2392
|
+
"patternProperties",
|
|
2393
|
+
"*"
|
|
2394
|
+
]
|
|
2395
|
+
});
|
|
2396
|
+
i.patternProperties = {};
|
|
2397
|
+
for (let t of s) i.patternProperties[t.source] = e;
|
|
2398
|
+
} else (t.target === "draft-07" || t.target === "draft-2020-12") && (i.propertyNames = N(a.keyType, t, {
|
|
2399
|
+
...r,
|
|
2400
|
+
path: [...r.path, "propertyNames"]
|
|
2401
|
+
})), i.additionalProperties = N(a.valueType, t, {
|
|
2402
|
+
...r,
|
|
2403
|
+
path: [...r.path, "additionalProperties"]
|
|
2404
|
+
});
|
|
2405
|
+
let c = o._zod.values;
|
|
2406
|
+
if (c) {
|
|
2407
|
+
let e = [...c].filter((e) => typeof e == "string" || typeof e == "number");
|
|
2408
|
+
e.length > 0 && (i.required = e);
|
|
2409
|
+
}
|
|
2410
|
+
}, si = (e, t, n, r) => {
|
|
2411
|
+
let i = e._zod.def, a = N(i.innerType, t, r), o = t.seen.get(e);
|
|
2412
|
+
t.target === "openapi-3.0" ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [a, { type: "null" }];
|
|
2413
|
+
}, ci = (e, t, n, r) => {
|
|
2414
|
+
let i = e._zod.def;
|
|
2415
|
+
N(i.innerType, t, r);
|
|
2416
|
+
let a = t.seen.get(e);
|
|
2417
|
+
a.ref = i.innerType;
|
|
2418
|
+
}, li = (e, t, n, r) => {
|
|
2419
|
+
let i = e._zod.def;
|
|
2420
|
+
N(i.innerType, t, r);
|
|
2421
|
+
let a = t.seen.get(e);
|
|
2422
|
+
a.ref = i.innerType, n.default = JSON.parse(JSON.stringify(i.defaultValue));
|
|
2423
|
+
}, ui = (e, t, n, r) => {
|
|
2424
|
+
let i = e._zod.def;
|
|
2425
|
+
N(i.innerType, t, r);
|
|
2426
|
+
let a = t.seen.get(e);
|
|
2427
|
+
a.ref = i.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(i.defaultValue)));
|
|
2428
|
+
}, di = (e, t, n, r) => {
|
|
2429
|
+
let i = e._zod.def;
|
|
2430
|
+
N(i.innerType, t, r);
|
|
2431
|
+
let a = t.seen.get(e);
|
|
2432
|
+
a.ref = i.innerType;
|
|
2433
|
+
let o;
|
|
2434
|
+
try {
|
|
2435
|
+
o = i.catchValue(void 0);
|
|
2436
|
+
} catch {
|
|
2437
|
+
throw Error("Dynamic catch values are not supported in JSON Schema");
|
|
2438
|
+
}
|
|
2439
|
+
n.default = o;
|
|
2440
|
+
}, fi = (e, t, n, r) => {
|
|
2441
|
+
let i = e._zod.def, a = t.io === "input" ? i.in._zod.def.type === "transform" ? i.out : i.in : i.out;
|
|
2442
|
+
N(a, t, r);
|
|
2443
|
+
let o = t.seen.get(e);
|
|
2444
|
+
o.ref = a;
|
|
2445
|
+
}, pi = (e, t, n, r) => {
|
|
2446
|
+
let i = e._zod.def;
|
|
2447
|
+
N(i.innerType, t, r);
|
|
2448
|
+
let a = t.seen.get(e);
|
|
2449
|
+
a.ref = i.innerType, n.readOnly = !0;
|
|
2450
|
+
}, mi = (e, t, n, r) => {
|
|
2451
|
+
let i = e._zod.def;
|
|
2452
|
+
N(i.innerType, t, r);
|
|
2453
|
+
let a = t.seen.get(e);
|
|
2454
|
+
a.ref = i.innerType;
|
|
2455
|
+
}, hi = (e, t, n, r) => {
|
|
2456
|
+
let i = e._zod.innerType;
|
|
2457
|
+
N(i, t, r);
|
|
2458
|
+
let a = t.seen.get(e);
|
|
2459
|
+
a.ref = i;
|
|
2460
|
+
}, gi = /* @__PURE__ */ e("ZodISODateTime", (e, t) => {
|
|
2461
|
+
Vt.init(e, t), z.init(e, t);
|
|
2462
|
+
});
|
|
2463
|
+
function _i(e) {
|
|
2464
|
+
return /* @__PURE__ */ dr(gi, e);
|
|
2465
|
+
}
|
|
2466
|
+
var vi = /* @__PURE__ */ e("ZodISODate", (e, t) => {
|
|
2467
|
+
Ht.init(e, t), z.init(e, t);
|
|
2468
|
+
});
|
|
2469
|
+
function yi(e) {
|
|
2470
|
+
return /* @__PURE__ */ fr(vi, e);
|
|
2471
|
+
}
|
|
2472
|
+
var bi = /* @__PURE__ */ e("ZodISOTime", (e, t) => {
|
|
2473
|
+
Ut.init(e, t), z.init(e, t);
|
|
2474
|
+
});
|
|
2475
|
+
function xi(e) {
|
|
2476
|
+
return /* @__PURE__ */ pr(bi, e);
|
|
2477
|
+
}
|
|
2478
|
+
var Si = /* @__PURE__ */ e("ZodISODuration", (e, t) => {
|
|
2479
|
+
Wt.init(e, t), z.init(e, t);
|
|
2480
|
+
});
|
|
2481
|
+
function Ci(e) {
|
|
2482
|
+
return /* @__PURE__ */ mr(Si, e);
|
|
2483
|
+
}
|
|
2484
|
+
//#endregion
|
|
2485
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.js
|
|
2486
|
+
var wi = (e, t) => {
|
|
2487
|
+
ye.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
2488
|
+
format: { value: (t) => Se(e, t) },
|
|
2489
|
+
flatten: { value: (t) => xe(e, t) },
|
|
2490
|
+
addIssue: { value: (t) => {
|
|
2491
|
+
e.issues.push(t), e.message = JSON.stringify(e.issues, o, 2);
|
|
2492
|
+
} },
|
|
2493
|
+
addIssues: { value: (t) => {
|
|
2494
|
+
e.issues.push(...t), e.message = JSON.stringify(e.issues, o, 2);
|
|
2495
|
+
} },
|
|
2496
|
+
isEmpty: { get() {
|
|
2497
|
+
return e.issues.length === 0;
|
|
2498
|
+
} }
|
|
2499
|
+
});
|
|
2500
|
+
};
|
|
2501
|
+
e("ZodError", wi);
|
|
2502
|
+
var I = e("ZodError", wi, { Parent: Error }), Ti = /* @__PURE__ */ Ce(I), Ei = /* @__PURE__ */ we(I), Di = /* @__PURE__ */ C(I), Oi = /* @__PURE__ */ w(I), ki = /* @__PURE__ */ De(I), Ai = /* @__PURE__ */ Oe(I), ji = /* @__PURE__ */ ke(I), Mi = /* @__PURE__ */ Ae(I), Ni = /* @__PURE__ */ je(I), Pi = /* @__PURE__ */ Me(I), Fi = /* @__PURE__ */ Ne(I), Ii = /* @__PURE__ */ Pe(I), L = /* @__PURE__ */ e("ZodType", (e, t) => (E.init(e, t), Object.assign(e["~standard"], { jsonSchema: {
|
|
2503
|
+
input: F(e, "input"),
|
|
2504
|
+
output: F(e, "output")
|
|
2505
|
+
} }), e.toJSONSchema = Kr(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(p(t, { checks: [...t.checks ?? [], ...n.map((e) => typeof e == "function" ? { _zod: {
|
|
2506
|
+
check: e,
|
|
2507
|
+
def: { check: "custom" },
|
|
2508
|
+
onattach: []
|
|
2509
|
+
} } : e)] }), { parent: !0 }), e.with = e.check, e.clone = (t, n) => g(e, t, n), e.brand = () => e, e.register = ((t, n) => (t.add(e, n), e)), e.parse = (t, n) => Ti(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => Di(e, t, n), e.parseAsync = async (t, n) => Ei(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => Oi(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n) => ki(e, t, n), e.decode = (t, n) => Ai(e, t, n), e.encodeAsync = async (t, n) => ji(e, t, n), e.decodeAsync = async (t, n) => Mi(e, t, n), e.safeEncode = (t, n) => Ni(e, t, n), e.safeDecode = (t, n) => Pi(e, t, n), e.safeEncodeAsync = async (t, n) => Fi(e, t, n), e.safeDecodeAsync = async (t, n) => Ii(e, t, n), e.refine = (t, n) => e.check(Ua(t, n)), e.superRefine = (t) => e.check(Wa(t)), e.overwrite = (t) => e.check(/* @__PURE__ */ M(t)), e.optional = () => Sa(e), e.exactOptional = () => wa(e), e.nullable = () => Ea(e), e.nullish = () => Sa(Ea(e)), e.nonoptional = (t) => Ma(e, t), e.array = () => W(e), e.or = (t) => K([e, t]), e.and = (t) => ma(e, t), e.transform = (t) => Ia(e, ba(t)), e.default = (t) => Oa(e, t), e.prefault = (t) => Aa(e, t), e.catch = (t) => Pa(e, t), e.pipe = (t) => Ia(e, t), e.readonly = () => Ra(e), e.describe = (t) => {
|
|
2510
|
+
let n = e.clone();
|
|
2511
|
+
return A.add(n, { description: t }), n;
|
|
2512
|
+
}, Object.defineProperty(e, "description", {
|
|
2513
|
+
get() {
|
|
2514
|
+
return A.get(e)?.description;
|
|
2515
|
+
},
|
|
2516
|
+
configurable: !0
|
|
2517
|
+
}), e.meta = (...t) => {
|
|
2518
|
+
if (t.length === 0) return A.get(e);
|
|
2519
|
+
let n = e.clone();
|
|
2520
|
+
return A.add(n, t[0]), n;
|
|
2521
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (t) => t(e), e)), Li = /* @__PURE__ */ e("_ZodString", (e, t) => {
|
|
2522
|
+
kt.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Jr(e, t, n, r);
|
|
2523
|
+
let n = e._zod.bag;
|
|
2524
|
+
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...t) => e.check(/* @__PURE__ */ Dr(...t)), e.includes = (...t) => e.check(/* @__PURE__ */ Ar(...t)), e.startsWith = (...t) => e.check(/* @__PURE__ */ jr(...t)), e.endsWith = (...t) => e.check(/* @__PURE__ */ Mr(...t)), e.min = (...t) => e.check(/* @__PURE__ */ j(...t)), e.max = (...t) => e.check(/* @__PURE__ */ Tr(...t)), e.length = (...t) => e.check(/* @__PURE__ */ Er(...t)), e.nonempty = (...t) => e.check(/* @__PURE__ */ j(1, ...t)), e.lowercase = (t) => e.check(/* @__PURE__ */ Or(t)), e.uppercase = (t) => e.check(/* @__PURE__ */ kr(t)), e.trim = () => e.check(/* @__PURE__ */ Pr()), e.normalize = (...t) => e.check(/* @__PURE__ */ Nr(...t)), e.toLowerCase = () => e.check(/* @__PURE__ */ Fr()), e.toUpperCase = () => e.check(/* @__PURE__ */ Ir()), e.slugify = () => e.check(/* @__PURE__ */ Lr());
|
|
2525
|
+
}), Ri = /* @__PURE__ */ e("ZodString", (e, t) => {
|
|
2526
|
+
kt.init(e, t), Li.init(e, t), e.email = (t) => e.check(/* @__PURE__ */ Un(zi, t)), e.url = (t) => e.check(/* @__PURE__ */ Yn(Vi, t)), e.jwt = (t) => e.check(/* @__PURE__ */ ur(na, t)), e.emoji = (t) => e.check(/* @__PURE__ */ Xn(Hi, t)), e.guid = (t) => e.check(/* @__PURE__ */ Wn(Bi, t)), e.uuid = (t) => e.check(/* @__PURE__ */ Gn(B, t)), e.uuidv4 = (t) => e.check(/* @__PURE__ */ Kn(B, t)), e.uuidv6 = (t) => e.check(/* @__PURE__ */ qn(B, t)), e.uuidv7 = (t) => e.check(/* @__PURE__ */ Jn(B, t)), e.nanoid = (t) => e.check(/* @__PURE__ */ Zn(Ui, t)), e.guid = (t) => e.check(/* @__PURE__ */ Wn(Bi, t)), e.cuid = (t) => e.check(/* @__PURE__ */ Qn(Wi, t)), e.cuid2 = (t) => e.check(/* @__PURE__ */ $n(Gi, t)), e.ulid = (t) => e.check(/* @__PURE__ */ er(Ki, t)), e.base64 = (t) => e.check(/* @__PURE__ */ sr($i, t)), e.base64url = (t) => e.check(/* @__PURE__ */ cr(ea, t)), e.xid = (t) => e.check(/* @__PURE__ */ tr(qi, t)), e.ksuid = (t) => e.check(/* @__PURE__ */ nr(Ji, t)), e.ipv4 = (t) => e.check(/* @__PURE__ */ rr(Yi, t)), e.ipv6 = (t) => e.check(/* @__PURE__ */ ir(Xi, t)), e.cidrv4 = (t) => e.check(/* @__PURE__ */ ar(Zi, t)), e.cidrv6 = (t) => e.check(/* @__PURE__ */ or(Qi, t)), e.e164 = (t) => e.check(/* @__PURE__ */ lr(ta, t)), e.datetime = (t) => e.check(_i(t)), e.date = (t) => e.check(yi(t)), e.time = (t) => e.check(xi(t)), e.duration = (t) => e.check(Ci(t));
|
|
2527
|
+
});
|
|
2528
|
+
function R(e) {
|
|
2529
|
+
return /* @__PURE__ */ Hn(Ri, e);
|
|
2530
|
+
}
|
|
2531
|
+
var z = /* @__PURE__ */ e("ZodStringFormat", (e, t) => {
|
|
2532
|
+
D.init(e, t), Li.init(e, t);
|
|
2533
|
+
}), zi = /* @__PURE__ */ e("ZodEmail", (e, t) => {
|
|
2534
|
+
Mt.init(e, t), z.init(e, t);
|
|
2535
|
+
}), Bi = /* @__PURE__ */ e("ZodGUID", (e, t) => {
|
|
2536
|
+
At.init(e, t), z.init(e, t);
|
|
2537
|
+
}), B = /* @__PURE__ */ e("ZodUUID", (e, t) => {
|
|
2538
|
+
jt.init(e, t), z.init(e, t);
|
|
2539
|
+
}), Vi = /* @__PURE__ */ e("ZodURL", (e, t) => {
|
|
2540
|
+
Nt.init(e, t), z.init(e, t);
|
|
2541
|
+
}), Hi = /* @__PURE__ */ e("ZodEmoji", (e, t) => {
|
|
2542
|
+
Pt.init(e, t), z.init(e, t);
|
|
2543
|
+
}), Ui = /* @__PURE__ */ e("ZodNanoID", (e, t) => {
|
|
2544
|
+
Ft.init(e, t), z.init(e, t);
|
|
2545
|
+
}), Wi = /* @__PURE__ */ e("ZodCUID", (e, t) => {
|
|
2546
|
+
It.init(e, t), z.init(e, t);
|
|
2547
|
+
}), Gi = /* @__PURE__ */ e("ZodCUID2", (e, t) => {
|
|
2548
|
+
Lt.init(e, t), z.init(e, t);
|
|
2549
|
+
}), Ki = /* @__PURE__ */ e("ZodULID", (e, t) => {
|
|
2550
|
+
Rt.init(e, t), z.init(e, t);
|
|
2551
|
+
}), qi = /* @__PURE__ */ e("ZodXID", (e, t) => {
|
|
2552
|
+
zt.init(e, t), z.init(e, t);
|
|
2553
|
+
}), Ji = /* @__PURE__ */ e("ZodKSUID", (e, t) => {
|
|
2554
|
+
Bt.init(e, t), z.init(e, t);
|
|
2555
|
+
}), Yi = /* @__PURE__ */ e("ZodIPv4", (e, t) => {
|
|
2556
|
+
Gt.init(e, t), z.init(e, t);
|
|
2557
|
+
}), Xi = /* @__PURE__ */ e("ZodIPv6", (e, t) => {
|
|
2558
|
+
Kt.init(e, t), z.init(e, t);
|
|
2559
|
+
}), Zi = /* @__PURE__ */ e("ZodCIDRv4", (e, t) => {
|
|
2560
|
+
qt.init(e, t), z.init(e, t);
|
|
2561
|
+
}), Qi = /* @__PURE__ */ e("ZodCIDRv6", (e, t) => {
|
|
2562
|
+
Jt.init(e, t), z.init(e, t);
|
|
2563
|
+
}), $i = /* @__PURE__ */ e("ZodBase64", (e, t) => {
|
|
2564
|
+
Xt.init(e, t), z.init(e, t);
|
|
2565
|
+
}), ea = /* @__PURE__ */ e("ZodBase64URL", (e, t) => {
|
|
2566
|
+
Qt.init(e, t), z.init(e, t);
|
|
2567
|
+
}), ta = /* @__PURE__ */ e("ZodE164", (e, t) => {
|
|
2568
|
+
$t.init(e, t), z.init(e, t);
|
|
2569
|
+
}), na = /* @__PURE__ */ e("ZodJWT", (e, t) => {
|
|
2570
|
+
tn.init(e, t), z.init(e, t);
|
|
2571
|
+
}), ra = /* @__PURE__ */ e("ZodNumber", (e, t) => {
|
|
2572
|
+
nn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Yr(e, t, n, r), e.gt = (t, n) => e.check(/* @__PURE__ */ Sr(t, n)), e.gte = (t, n) => e.check(/* @__PURE__ */ Cr(t, n)), e.min = (t, n) => e.check(/* @__PURE__ */ Cr(t, n)), e.lt = (t, n) => e.check(/* @__PURE__ */ br(t, n)), e.lte = (t, n) => e.check(/* @__PURE__ */ xr(t, n)), e.max = (t, n) => e.check(/* @__PURE__ */ xr(t, n)), e.int = (t) => e.check(aa(t)), e.safe = (t) => e.check(aa(t)), e.positive = (t) => e.check(/* @__PURE__ */ Sr(0, t)), e.nonnegative = (t) => e.check(/* @__PURE__ */ Cr(0, t)), e.negative = (t) => e.check(/* @__PURE__ */ br(0, t)), e.nonpositive = (t) => e.check(/* @__PURE__ */ xr(0, t)), e.multipleOf = (t, n) => e.check(/* @__PURE__ */ wr(t, n)), e.step = (t, n) => e.check(/* @__PURE__ */ wr(t, n)), e.finite = () => e;
|
|
2573
|
+
let n = e._zod.bag;
|
|
2574
|
+
e.minValue = Math.max(n.minimum ?? -Infinity, n.exclusiveMinimum ?? -Infinity) ?? null, e.maxValue = Math.min(n.maximum ?? Infinity, n.exclusiveMaximum ?? Infinity) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? .5), e.isFinite = !0, e.format = n.format ?? null;
|
|
2575
|
+
});
|
|
2576
|
+
function V(e) {
|
|
2577
|
+
return /* @__PURE__ */ hr(ra, e);
|
|
2578
|
+
}
|
|
2579
|
+
var ia = /* @__PURE__ */ e("ZodNumberFormat", (e, t) => {
|
|
2580
|
+
rn.init(e, t), ra.init(e, t);
|
|
2581
|
+
});
|
|
2582
|
+
function aa(e) {
|
|
2583
|
+
return /* @__PURE__ */ gr(ia, e);
|
|
2584
|
+
}
|
|
2585
|
+
var oa = /* @__PURE__ */ e("ZodBoolean", (e, t) => {
|
|
2586
|
+
an.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Xr(e, t, n, r);
|
|
2587
|
+
});
|
|
2588
|
+
function H(e) {
|
|
2589
|
+
return /* @__PURE__ */ _r(oa, e);
|
|
2590
|
+
}
|
|
2591
|
+
var sa = /* @__PURE__ */ e("ZodUnknown", (e, t) => {
|
|
2592
|
+
on.init(e, t), L.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0;
|
|
2593
|
+
});
|
|
2594
|
+
function U() {
|
|
2595
|
+
return /* @__PURE__ */ vr(sa);
|
|
2596
|
+
}
|
|
2597
|
+
var ca = /* @__PURE__ */ e("ZodNever", (e, t) => {
|
|
2598
|
+
sn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Zr(e, t, n, r);
|
|
2599
|
+
});
|
|
2600
|
+
function la(e) {
|
|
2601
|
+
return /* @__PURE__ */ yr(ca, e);
|
|
2602
|
+
}
|
|
2603
|
+
var ua = /* @__PURE__ */ e("ZodArray", (e, t) => {
|
|
2604
|
+
ln.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => ni(e, t, n, r), e.element = t.element, e.min = (t, n) => e.check(/* @__PURE__ */ j(t, n)), e.nonempty = (t) => e.check(/* @__PURE__ */ j(1, t)), e.max = (t, n) => e.check(/* @__PURE__ */ Tr(t, n)), e.length = (t, n) => e.check(/* @__PURE__ */ Er(t, n)), e.unwrap = () => e.element;
|
|
2605
|
+
});
|
|
2606
|
+
function W(e, t) {
|
|
2607
|
+
return /* @__PURE__ */ Rr(ua, e, t);
|
|
2608
|
+
}
|
|
2609
|
+
var da = /* @__PURE__ */ e("ZodObject", (e, t) => {
|
|
2610
|
+
pn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => ri(e, t, n, r), d(e, "shape", () => t.shape), e.keyof = () => q(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({
|
|
2611
|
+
...e._zod.def,
|
|
2612
|
+
catchall: t
|
|
2613
|
+
}), e.passthrough = () => e.clone({
|
|
2614
|
+
...e._zod.def,
|
|
2615
|
+
catchall: U()
|
|
2616
|
+
}), e.loose = () => e.clone({
|
|
2617
|
+
...e._zod.def,
|
|
2618
|
+
catchall: U()
|
|
2619
|
+
}), e.strict = () => e.clone({
|
|
2620
|
+
...e._zod.def,
|
|
2621
|
+
catchall: la()
|
|
2622
|
+
}), e.strip = () => e.clone({
|
|
2623
|
+
...e._zod.def,
|
|
2624
|
+
catchall: void 0
|
|
2625
|
+
}), e.extend = (t) => fe(e, t), e.safeExtend = (t) => pe(e, t), e.merge = (t) => me(e, t), e.pick = (t) => ue(e, t), e.omit = (t) => de(e, t), e.partial = (...t) => he(xa, e, t[0]), e.required = (...t) => ge(ja, e, t[0]);
|
|
2626
|
+
});
|
|
2627
|
+
function G(e, t) {
|
|
2628
|
+
return new da({
|
|
2629
|
+
type: "object",
|
|
2630
|
+
shape: e ?? {},
|
|
2631
|
+
..._(t)
|
|
2632
|
+
});
|
|
2633
|
+
}
|
|
2634
|
+
var fa = /* @__PURE__ */ e("ZodUnion", (e, t) => {
|
|
2635
|
+
hn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => ii(e, t, n, r), e.options = t.options;
|
|
2636
|
+
});
|
|
2637
|
+
function K(e, t) {
|
|
2638
|
+
return new fa({
|
|
2639
|
+
type: "union",
|
|
2640
|
+
options: e,
|
|
2641
|
+
..._(t)
|
|
2642
|
+
});
|
|
2643
|
+
}
|
|
2644
|
+
var pa = /* @__PURE__ */ e("ZodIntersection", (e, t) => {
|
|
2645
|
+
gn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => ai(e, t, n, r);
|
|
2646
|
+
});
|
|
2647
|
+
function ma(e, t) {
|
|
2648
|
+
return new pa({
|
|
2649
|
+
type: "intersection",
|
|
2650
|
+
left: e,
|
|
2651
|
+
right: t
|
|
2652
|
+
});
|
|
2653
|
+
}
|
|
2654
|
+
var ha = /* @__PURE__ */ e("ZodRecord", (e, t) => {
|
|
2655
|
+
yn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => oi(e, t, n, r), e.keyType = t.keyType, e.valueType = t.valueType;
|
|
2656
|
+
});
|
|
2657
|
+
function ga(e, t, n) {
|
|
2658
|
+
return new ha({
|
|
2659
|
+
type: "record",
|
|
2660
|
+
keyType: e,
|
|
2661
|
+
valueType: t,
|
|
2662
|
+
..._(n)
|
|
2663
|
+
});
|
|
2664
|
+
}
|
|
2665
|
+
var _a = /* @__PURE__ */ e("ZodEnum", (e, t) => {
|
|
2666
|
+
bn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Qr(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
2667
|
+
let n = new Set(Object.keys(t.entries));
|
|
2668
|
+
e.extract = (e, r) => {
|
|
2669
|
+
let i = {};
|
|
2670
|
+
for (let r of e) if (n.has(r)) i[r] = t.entries[r];
|
|
2671
|
+
else throw Error(`Key ${r} not found in enum`);
|
|
2672
|
+
return new _a({
|
|
2673
|
+
...t,
|
|
2674
|
+
checks: [],
|
|
2675
|
+
..._(r),
|
|
2676
|
+
entries: i
|
|
2677
|
+
});
|
|
2678
|
+
}, e.exclude = (e, r) => {
|
|
2679
|
+
let i = { ...t.entries };
|
|
2680
|
+
for (let t of e) if (n.has(t)) delete i[t];
|
|
2681
|
+
else throw Error(`Key ${t} not found in enum`);
|
|
2682
|
+
return new _a({
|
|
2683
|
+
...t,
|
|
2684
|
+
checks: [],
|
|
2685
|
+
..._(r),
|
|
2686
|
+
entries: i
|
|
2687
|
+
});
|
|
2688
|
+
};
|
|
2689
|
+
});
|
|
2690
|
+
function q(e, t) {
|
|
2691
|
+
return new _a({
|
|
2692
|
+
type: "enum",
|
|
2693
|
+
entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e,
|
|
2694
|
+
..._(t)
|
|
2695
|
+
});
|
|
2696
|
+
}
|
|
2697
|
+
var va = /* @__PURE__ */ e("ZodLiteral", (e, t) => {
|
|
2698
|
+
xn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => $r(e, t, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", { get() {
|
|
2699
|
+
if (t.values.length > 1) throw Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
2700
|
+
return t.values[0];
|
|
2701
|
+
} });
|
|
2702
|
+
});
|
|
2703
|
+
function J(e, t) {
|
|
2704
|
+
return new va({
|
|
2705
|
+
type: "literal",
|
|
2706
|
+
values: Array.isArray(e) ? e : [e],
|
|
2707
|
+
..._(t)
|
|
2708
|
+
});
|
|
2709
|
+
}
|
|
2710
|
+
var ya = /* @__PURE__ */ e("ZodTransform", (e, t) => {
|
|
2711
|
+
Sn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => ti(e, t, n, r), e._zod.parse = (r, i) => {
|
|
2712
|
+
if (i.direction === "backward") throw new n(e.constructor.name);
|
|
2713
|
+
r.addIssue = (n) => {
|
|
2714
|
+
if (typeof n == "string") r.issues.push(S(n, r.value, t));
|
|
2715
|
+
else {
|
|
2716
|
+
let t = n;
|
|
2717
|
+
t.fatal && (t.continue = !1), t.code ??= "custom", t.input ??= r.value, t.inst ??= e, r.issues.push(S(t));
|
|
2718
|
+
}
|
|
2719
|
+
};
|
|
2720
|
+
let a = t.transform(r.value, r);
|
|
2721
|
+
return a instanceof Promise ? a.then((e) => (r.value = e, r)) : (r.value = a, r);
|
|
2722
|
+
};
|
|
2723
|
+
});
|
|
2724
|
+
function ba(e) {
|
|
2725
|
+
return new ya({
|
|
2726
|
+
type: "transform",
|
|
2727
|
+
transform: e
|
|
2728
|
+
});
|
|
2729
|
+
}
|
|
2730
|
+
var xa = /* @__PURE__ */ e("ZodOptional", (e, t) => {
|
|
2731
|
+
wn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => mi(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
2732
|
+
});
|
|
2733
|
+
function Sa(e) {
|
|
2734
|
+
return new xa({
|
|
2735
|
+
type: "optional",
|
|
2736
|
+
innerType: e
|
|
2737
|
+
});
|
|
2738
|
+
}
|
|
2739
|
+
var Ca = /* @__PURE__ */ e("ZodExactOptional", (e, t) => {
|
|
2740
|
+
Tn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => mi(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
2741
|
+
});
|
|
2742
|
+
function wa(e) {
|
|
2743
|
+
return new Ca({
|
|
2744
|
+
type: "optional",
|
|
2745
|
+
innerType: e
|
|
2746
|
+
});
|
|
2747
|
+
}
|
|
2748
|
+
var Ta = /* @__PURE__ */ e("ZodNullable", (e, t) => {
|
|
2749
|
+
En.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => si(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
2750
|
+
});
|
|
2751
|
+
function Ea(e) {
|
|
2752
|
+
return new Ta({
|
|
2753
|
+
type: "nullable",
|
|
2754
|
+
innerType: e
|
|
2755
|
+
});
|
|
2756
|
+
}
|
|
2757
|
+
var Da = /* @__PURE__ */ e("ZodDefault", (e, t) => {
|
|
2758
|
+
Dn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => li(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
2759
|
+
});
|
|
2760
|
+
function Oa(e, t) {
|
|
2761
|
+
return new Da({
|
|
2762
|
+
type: "default",
|
|
2763
|
+
innerType: e,
|
|
2764
|
+
get defaultValue() {
|
|
2765
|
+
return typeof t == "function" ? t() : oe(t);
|
|
2766
|
+
}
|
|
2767
|
+
});
|
|
2768
|
+
}
|
|
2769
|
+
var ka = /* @__PURE__ */ e("ZodPrefault", (e, t) => {
|
|
2770
|
+
kn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => ui(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
2771
|
+
});
|
|
2772
|
+
function Aa(e, t) {
|
|
2773
|
+
return new ka({
|
|
2774
|
+
type: "prefault",
|
|
2775
|
+
innerType: e,
|
|
2776
|
+
get defaultValue() {
|
|
2777
|
+
return typeof t == "function" ? t() : oe(t);
|
|
2778
|
+
}
|
|
2779
|
+
});
|
|
2780
|
+
}
|
|
2781
|
+
var ja = /* @__PURE__ */ e("ZodNonOptional", (e, t) => {
|
|
2782
|
+
An.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => ci(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
2783
|
+
});
|
|
2784
|
+
function Ma(e, t) {
|
|
2785
|
+
return new ja({
|
|
2786
|
+
type: "nonoptional",
|
|
2787
|
+
innerType: e,
|
|
2788
|
+
..._(t)
|
|
2789
|
+
});
|
|
2790
|
+
}
|
|
2791
|
+
var Na = /* @__PURE__ */ e("ZodCatch", (e, t) => {
|
|
2792
|
+
Mn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => di(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
2793
|
+
});
|
|
2794
|
+
function Pa(e, t) {
|
|
2795
|
+
return new Na({
|
|
2796
|
+
type: "catch",
|
|
2797
|
+
innerType: e,
|
|
2798
|
+
catchValue: typeof t == "function" ? t : () => t
|
|
2799
|
+
});
|
|
2800
|
+
}
|
|
2801
|
+
var Fa = /* @__PURE__ */ e("ZodPipe", (e, t) => {
|
|
2802
|
+
Nn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => fi(e, t, n, r), e.in = t.in, e.out = t.out;
|
|
2803
|
+
});
|
|
2804
|
+
function Ia(e, t) {
|
|
2805
|
+
return new Fa({
|
|
2806
|
+
type: "pipe",
|
|
2807
|
+
in: e,
|
|
2808
|
+
out: t
|
|
2809
|
+
});
|
|
2810
|
+
}
|
|
2811
|
+
var La = /* @__PURE__ */ e("ZodReadonly", (e, t) => {
|
|
2812
|
+
Pn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => pi(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
2813
|
+
});
|
|
2814
|
+
function Ra(e) {
|
|
2815
|
+
return new La({
|
|
2816
|
+
type: "readonly",
|
|
2817
|
+
innerType: e
|
|
2818
|
+
});
|
|
2819
|
+
}
|
|
2820
|
+
var za = /* @__PURE__ */ e("ZodLazy", (e, t) => {
|
|
2821
|
+
In.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => hi(e, t, n, r), e.unwrap = () => e._zod.def.getter();
|
|
2822
|
+
});
|
|
2823
|
+
function Ba(e) {
|
|
2824
|
+
return new za({
|
|
2825
|
+
type: "lazy",
|
|
2826
|
+
getter: e
|
|
2827
|
+
});
|
|
2828
|
+
}
|
|
2829
|
+
var Va = /* @__PURE__ */ e("ZodCustom", (e, t) => {
|
|
2830
|
+
Ln.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => ei(e, t, n, r);
|
|
2831
|
+
});
|
|
2832
|
+
function Ha(e, t) {
|
|
2833
|
+
return /* @__PURE__ */ zr(Va, e ?? (() => !0), t);
|
|
2834
|
+
}
|
|
2835
|
+
function Ua(e, t = {}) {
|
|
2836
|
+
return /* @__PURE__ */ Br(Va, e, t);
|
|
2837
|
+
}
|
|
2838
|
+
function Wa(e) {
|
|
2839
|
+
return /* @__PURE__ */ Vr(e);
|
|
2840
|
+
}
|
|
2841
|
+
//#endregion
|
|
2842
|
+
//#region src/runtime/constants.ts
|
|
2843
|
+
var Ga = {
|
|
2844
|
+
classifier: "classifier",
|
|
2845
|
+
regressor: "regressor"
|
|
2846
|
+
}, Ka = {
|
|
2847
|
+
classifier: Ga.classifier,
|
|
2848
|
+
regressor: Ga.regressor
|
|
2849
|
+
}, qa = {
|
|
2850
|
+
classifier: "Classifier report",
|
|
2851
|
+
regressor: "Regressor report"
|
|
2852
|
+
}, Y = {
|
|
2853
|
+
invalidNumber: "Value must be a valid number.",
|
|
2854
|
+
textPatternMismatch: "Value does not match the expected pattern.",
|
|
2855
|
+
booleanRequired: "This field must be accepted.",
|
|
2856
|
+
categoryOptionMismatch: "Value must match one of the available options.",
|
|
2857
|
+
invalidTextLengthRange: "Minimum length cannot exceed maximum length.",
|
|
2858
|
+
invalidNumericRange: "Minimum value cannot exceed maximum value.",
|
|
2859
|
+
invalidDateRange: "Minimum date cannot be after maximum date.",
|
|
2860
|
+
invalidPointCountRange: "Minimum number of points cannot exceed maximum number of points.",
|
|
2861
|
+
minLength: (e) => `Minimum length is ${e} characters.`,
|
|
2862
|
+
maxLength: (e) => `Maximum length is ${e} characters.`,
|
|
2863
|
+
minValue: (e) => `Minimum value is ${e}.`,
|
|
2864
|
+
maxValue: (e) => `Maximum value is ${e}.`,
|
|
2865
|
+
stepValue: (e) => `Value must be a multiple of ${e}.`,
|
|
2866
|
+
dateOnOrAfter: (e) => `Date must be on or after ${e}.`,
|
|
2867
|
+
dateOnOrBefore: (e) => `Date must be on or before ${e}.`,
|
|
2868
|
+
stepDate: (e) => `Date must fall on a step of ${e} day(s) from the minimum date.`,
|
|
2869
|
+
minPoints: (e) => `Minimum number of points is ${e}.`,
|
|
2870
|
+
maxPoints: (e) => `Maximum number of points is ${e}.`,
|
|
2871
|
+
timestampsUnique: "Timestamps must be unique.",
|
|
2872
|
+
timestampsAscending: "Timestamps must be sorted in ascending order.",
|
|
2873
|
+
timestampsDescending: "Timestamps must be sorted in descending order."
|
|
2874
|
+
}, Ja = ga(R(), U()).optional(), Ya = Ha((e) => typeof e == "function"), Xa = q([
|
|
2875
|
+
"idle",
|
|
2876
|
+
"editing",
|
|
2877
|
+
"validating",
|
|
2878
|
+
"submitting",
|
|
2879
|
+
"success",
|
|
2880
|
+
"error"
|
|
2881
|
+
]), X = Ba(() => K([
|
|
2882
|
+
G({
|
|
2883
|
+
kind: J("field-value"),
|
|
2884
|
+
field: R().min(1),
|
|
2885
|
+
equals: U().optional(),
|
|
2886
|
+
notEquals: U().optional(),
|
|
2887
|
+
greaterThan: U().optional(),
|
|
2888
|
+
greaterThanOrEqual: U().optional(),
|
|
2889
|
+
lessThan: U().optional(),
|
|
2890
|
+
lessThanOrEqual: U().optional(),
|
|
2891
|
+
in: W(U()).optional(),
|
|
2892
|
+
notIn: W(U()).optional(),
|
|
2893
|
+
empty: H().optional(),
|
|
2894
|
+
notEmpty: H().optional(),
|
|
2895
|
+
truthy: H().optional(),
|
|
2896
|
+
falsy: H().optional()
|
|
2897
|
+
}),
|
|
2898
|
+
G({
|
|
2899
|
+
kind: J("field-comparison"),
|
|
2900
|
+
field: R().min(1),
|
|
2901
|
+
otherField: R().min(1),
|
|
2902
|
+
operator: q([
|
|
2903
|
+
"eq",
|
|
2904
|
+
"neq",
|
|
2905
|
+
"gt",
|
|
2906
|
+
"gte",
|
|
2907
|
+
"lt",
|
|
2908
|
+
"lte"
|
|
2909
|
+
])
|
|
2910
|
+
}),
|
|
2911
|
+
G({
|
|
2912
|
+
kind: J("form-status"),
|
|
2913
|
+
equals: K([Xa, W(Xa).min(1)])
|
|
2914
|
+
}),
|
|
2915
|
+
G({
|
|
2916
|
+
kind: J("submit-count"),
|
|
2917
|
+
eq: V().int().nonnegative().optional(),
|
|
2918
|
+
gte: V().int().nonnegative().optional(),
|
|
2919
|
+
lte: V().int().nonnegative().optional()
|
|
2920
|
+
}),
|
|
2921
|
+
G({
|
|
2922
|
+
kind: J("all"),
|
|
2923
|
+
conditions: W(X).min(1)
|
|
2924
|
+
}),
|
|
2925
|
+
G({
|
|
2926
|
+
kind: J("any"),
|
|
2927
|
+
conditions: W(X).min(1)
|
|
2928
|
+
}),
|
|
2929
|
+
G({
|
|
2930
|
+
kind: J("not"),
|
|
2931
|
+
condition: X
|
|
2932
|
+
})
|
|
2933
|
+
])), Za = K([Ya, X]), Z = {
|
|
2934
|
+
id: R().optional(),
|
|
2935
|
+
label: R().min(1),
|
|
2936
|
+
description: R().optional(),
|
|
2937
|
+
showDescriptionInline: H().optional().default(!1),
|
|
2938
|
+
required: H().optional().default(!1),
|
|
2939
|
+
disabled: H().optional().default(!1),
|
|
2940
|
+
hidden: H().optional().default(!1),
|
|
2941
|
+
readOnly: H().optional().default(!1),
|
|
2942
|
+
disabledWhen: Za.optional(),
|
|
2943
|
+
hiddenWhen: Za.optional(),
|
|
2944
|
+
readOnlyWhen: Za.optional(),
|
|
2945
|
+
asyncValidationDebounceMs: V().int().nonnegative().optional(),
|
|
2946
|
+
inactiveFieldPolicy: q([
|
|
2947
|
+
"include",
|
|
2948
|
+
"omit",
|
|
2949
|
+
"reset-on-hide"
|
|
2950
|
+
]).optional(),
|
|
2951
|
+
includeInSubmission: H().optional(),
|
|
2952
|
+
valuePath: K([R().min(1), W(R().min(1)).min(1)]).optional(),
|
|
2953
|
+
defaultValue: U().optional(),
|
|
2954
|
+
ui: Ja
|
|
2955
|
+
}, Qa = {
|
|
2956
|
+
id: R().optional(),
|
|
2957
|
+
label: R().optional(),
|
|
2958
|
+
description: R().optional(),
|
|
2959
|
+
source: R().optional(),
|
|
2960
|
+
ui: Ja
|
|
2961
|
+
}, $a = K([R(), G({
|
|
2962
|
+
label: R(),
|
|
2963
|
+
value: R()
|
|
2964
|
+
})]), eo = (e, t) => {
|
|
2965
|
+
let n = e.raw;
|
|
2966
|
+
if (!(typeof n != "object" || !n || !("outputs" in n) || !Array.isArray(n.outputs))) return n.outputs.find((e) => e.type === t);
|
|
2967
|
+
}, Q = (e, t, n) => ({
|
|
2968
|
+
component: e,
|
|
2969
|
+
props: {
|
|
2970
|
+
id: t.id,
|
|
2971
|
+
kind: t.kind,
|
|
2972
|
+
label: t.label,
|
|
2973
|
+
description: t.description ?? "",
|
|
2974
|
+
showDescriptionInline: !!t.showDescriptionInline,
|
|
2975
|
+
required: !!t.required,
|
|
2976
|
+
disabled: !!t.disabled,
|
|
2977
|
+
...n,
|
|
2978
|
+
...t.ui
|
|
2979
|
+
}
|
|
2980
|
+
}), $ = {
|
|
2981
|
+
kind: "boolean",
|
|
2982
|
+
schema: G({
|
|
2983
|
+
kind: J("boolean"),
|
|
2984
|
+
...Z,
|
|
2985
|
+
trueLabel: R().optional(),
|
|
2986
|
+
falseLabel: R().optional()
|
|
2987
|
+
}),
|
|
2988
|
+
getDefaultValue(e) {
|
|
2989
|
+
return typeof e.defaultValue == "boolean" ? e.defaultValue : !1;
|
|
2990
|
+
},
|
|
2991
|
+
normalizeValue(e) {
|
|
2992
|
+
return !!e;
|
|
2993
|
+
},
|
|
2994
|
+
validate(e, t) {
|
|
2995
|
+
return t.required && e !== !0 ? [Y.booleanRequired] : [];
|
|
2996
|
+
},
|
|
2997
|
+
describe(e, t) {
|
|
2998
|
+
return Q("boolean-field", e, {
|
|
2999
|
+
checked: t.state.value,
|
|
3000
|
+
trueLabel: e.trueLabel,
|
|
3001
|
+
falseLabel: e.falseLabel,
|
|
3002
|
+
state: t.state.status,
|
|
3003
|
+
errors: t.state.errors
|
|
3004
|
+
});
|
|
3005
|
+
}
|
|
3006
|
+
}, to = {
|
|
3007
|
+
kind: "category",
|
|
3008
|
+
schema: G({
|
|
3009
|
+
kind: J("category"),
|
|
3010
|
+
...Z,
|
|
3011
|
+
options: W($a).min(1)
|
|
3012
|
+
}),
|
|
3013
|
+
getDefaultValue(e) {
|
|
3014
|
+
return typeof e.defaultValue == "string" ? e.defaultValue : null;
|
|
3015
|
+
},
|
|
3016
|
+
normalizeValue(e) {
|
|
3017
|
+
return e == null || e === "" ? null : typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" ? `${e}` : null;
|
|
3018
|
+
},
|
|
3019
|
+
validate(e, t) {
|
|
3020
|
+
return e === null || t.options.map((e) => typeof e == "string" ? e : e.value).includes(e) ? [] : [Y.categoryOptionMismatch];
|
|
3021
|
+
},
|
|
3022
|
+
describe(e, t) {
|
|
3023
|
+
return Q("category-field", e, {
|
|
3024
|
+
value: t.state.value,
|
|
3025
|
+
options: e.options,
|
|
3026
|
+
state: t.state.status,
|
|
3027
|
+
errors: t.state.errors
|
|
3028
|
+
});
|
|
3029
|
+
}
|
|
3030
|
+
}, no = G({
|
|
3031
|
+
label: R(),
|
|
3032
|
+
value: R(),
|
|
3033
|
+
mapping: ga(R(), U())
|
|
3034
|
+
}), ro = {
|
|
3035
|
+
kind: "mapped-category",
|
|
3036
|
+
schema: G({
|
|
3037
|
+
kind: J("mapped-category"),
|
|
3038
|
+
...Z,
|
|
3039
|
+
includeInSubmission: H().optional().default(!1),
|
|
3040
|
+
options: W(no).min(1)
|
|
3041
|
+
}),
|
|
3042
|
+
getDefaultValue(e) {
|
|
3043
|
+
return typeof e.defaultValue == "string" ? e.defaultValue : null;
|
|
3044
|
+
},
|
|
3045
|
+
normalizeValue(e) {
|
|
3046
|
+
return e == null || e === "" ? null : typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" ? `${e}` : null;
|
|
3047
|
+
},
|
|
3048
|
+
validate(e, t) {
|
|
3049
|
+
return e === null || t.options.map((e) => e.value).includes(e) ? [] : [Y.categoryOptionMismatch];
|
|
3050
|
+
},
|
|
3051
|
+
describe(e, t) {
|
|
3052
|
+
return Q("category-field", e, {
|
|
3053
|
+
value: t.state.value,
|
|
3054
|
+
options: e.options.map((e) => ({
|
|
3055
|
+
label: e.label,
|
|
3056
|
+
value: e.value
|
|
3057
|
+
})),
|
|
3058
|
+
state: t.state.status,
|
|
3059
|
+
errors: t.state.errors
|
|
3060
|
+
});
|
|
3061
|
+
}
|
|
3062
|
+
}, io = (e) => typeof e == "object" && !!e && !Array.isArray(e), ao = (e) => typeof e == "object" && !!e || typeof e == "function", oo = (e) => ao(e) && "then" in e && typeof e.then == "function", so = (e) => e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : e instanceof Date ? Number.isNaN(e.getTime()) : !1, co = (e) => {
|
|
3063
|
+
if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : e;
|
|
3064
|
+
if (typeof e == "string" || typeof e == "number") {
|
|
3065
|
+
let t = new Date(e);
|
|
3066
|
+
return Number.isNaN(t.getTime()) ? null : t;
|
|
3067
|
+
}
|
|
3068
|
+
return null;
|
|
3069
|
+
}, lo = (e) => e, uo = (e) => {
|
|
3070
|
+
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;
|
|
3071
|
+
if (e !== null && (typeof e == "object" || typeof e == "function") && !t && !n && !r && !Object.isFrozen(e)) {
|
|
3072
|
+
Object.freeze(e);
|
|
3073
|
+
for (let t of Object.values(e)) uo(t);
|
|
3074
|
+
}
|
|
3075
|
+
return e;
|
|
3076
|
+
}, fo = (e, t) => e <= 0 ? Promise.resolve() : new Promise((n, r) => {
|
|
3077
|
+
let i = setTimeout(() => {
|
|
3078
|
+
t?.removeEventListener("abort", a), n();
|
|
3079
|
+
}, e), a = () => {
|
|
3080
|
+
clearTimeout(i), r(t?.reason ?? /* @__PURE__ */ Error("Operation aborted."));
|
|
3081
|
+
};
|
|
3082
|
+
if (t?.aborted) {
|
|
3083
|
+
a();
|
|
3084
|
+
return;
|
|
3085
|
+
}
|
|
3086
|
+
t?.addEventListener("abort", a, { once: !0 });
|
|
3087
|
+
}), po = {
|
|
3088
|
+
kind: "date",
|
|
3089
|
+
schema: G({
|
|
3090
|
+
kind: J("date"),
|
|
3091
|
+
...Z,
|
|
3092
|
+
min: R().optional(),
|
|
3093
|
+
max: R().optional(),
|
|
3094
|
+
step: V().positive().optional()
|
|
3095
|
+
}),
|
|
3096
|
+
getDefaultValue(e) {
|
|
3097
|
+
return co(e.defaultValue) ?? null;
|
|
3098
|
+
},
|
|
3099
|
+
normalizeValue(e) {
|
|
3100
|
+
return co(e);
|
|
3101
|
+
},
|
|
3102
|
+
serializeValue(e) {
|
|
3103
|
+
return e instanceof Date ? e.toISOString() : e;
|
|
3104
|
+
},
|
|
3105
|
+
validate(e, t) {
|
|
3106
|
+
let n = [], r = co(t.min), i = co(t.max);
|
|
3107
|
+
if (r && i && r.getTime() > i.getTime() && n.push(Y.invalidDateRange), e === null) return n;
|
|
3108
|
+
if (r && e.getTime() < r.getTime() && n.push(Y.dateOnOrAfter(String(t.min))), i && e.getTime() > i.getTime() && n.push(Y.dateOnOrBefore(String(t.max))), t.step !== void 0) {
|
|
3109
|
+
let i = r ?? /* @__PURE__ */ new Date("1970-01-01T00:00:00Z");
|
|
3110
|
+
Math.round(Math.abs(e.getTime() - i.getTime()) / 864e5) % t.step !== 0 && n.push(Y.stepDate(t.step));
|
|
3111
|
+
}
|
|
3112
|
+
return n;
|
|
3113
|
+
},
|
|
3114
|
+
describe(e, t) {
|
|
3115
|
+
return Q("date-field", e, {
|
|
3116
|
+
value: t.state.value instanceof Date ? t.state.value.toISOString().slice(0, 10) : t.state.value,
|
|
3117
|
+
min: e.min,
|
|
3118
|
+
max: e.max,
|
|
3119
|
+
step: e.step,
|
|
3120
|
+
state: t.state.status,
|
|
3121
|
+
errors: t.state.errors
|
|
3122
|
+
});
|
|
3123
|
+
}
|
|
3124
|
+
}, mo = {
|
|
3125
|
+
kind: "long-text",
|
|
3126
|
+
schema: G({
|
|
3127
|
+
kind: J("long-text"),
|
|
3128
|
+
...Z,
|
|
3129
|
+
placeholder: R().optional(),
|
|
3130
|
+
minLength: V().int().nonnegative().optional(),
|
|
3131
|
+
maxLength: V().int().nonnegative().optional(),
|
|
3132
|
+
rows: V().int().positive().optional()
|
|
3133
|
+
}),
|
|
3134
|
+
getDefaultValue(e) {
|
|
3135
|
+
return typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
3136
|
+
},
|
|
3137
|
+
normalizeValue(e) {
|
|
3138
|
+
return typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" ? `${e}` : "";
|
|
3139
|
+
},
|
|
3140
|
+
validate(e, t) {
|
|
3141
|
+
let n = [];
|
|
3142
|
+
return t.minLength !== void 0 && t.maxLength !== void 0 && t.minLength > t.maxLength && n.push(Y.invalidTextLengthRange), e.length === 0 ? n : (t.minLength !== void 0 && e.length < t.minLength && n.push(Y.minLength(t.minLength)), t.maxLength !== void 0 && e.length > t.maxLength && n.push(Y.maxLength(t.maxLength)), n);
|
|
3143
|
+
},
|
|
3144
|
+
describe(e, t) {
|
|
3145
|
+
return Q("long-text-field", e, {
|
|
3146
|
+
value: t.state.value,
|
|
3147
|
+
placeholder: e.placeholder ?? "",
|
|
3148
|
+
minLength: e.minLength,
|
|
3149
|
+
maxLength: e.maxLength,
|
|
3150
|
+
rows: e.rows,
|
|
3151
|
+
state: t.state.status,
|
|
3152
|
+
errors: t.state.errors
|
|
3153
|
+
});
|
|
3154
|
+
}
|
|
3155
|
+
}, ho = {
|
|
3156
|
+
kind: "multi-choice",
|
|
3157
|
+
schema: G({
|
|
3158
|
+
kind: J("multi-choice"),
|
|
3159
|
+
...Z,
|
|
3160
|
+
options: W($a).min(1),
|
|
3161
|
+
layout: q(["horizontal", "vertical"]).optional()
|
|
3162
|
+
}),
|
|
3163
|
+
getDefaultValue(e) {
|
|
3164
|
+
return Array.isArray(e.defaultValue) ? e.defaultValue.filter((e) => typeof e == "string").map(String) : [];
|
|
3165
|
+
},
|
|
3166
|
+
normalizeValue(e) {
|
|
3167
|
+
return Array.isArray(e) ? e.filter((e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "bigint").map(String) : [];
|
|
3168
|
+
},
|
|
3169
|
+
cloneValue(e) {
|
|
3170
|
+
return [...e];
|
|
3171
|
+
},
|
|
3172
|
+
isEqual(e, t) {
|
|
3173
|
+
return e.length === t.length ? e.every((e, n) => e === t[n]) : !1;
|
|
3174
|
+
},
|
|
3175
|
+
validate(e, t) {
|
|
3176
|
+
if (e.length === 0) return [];
|
|
3177
|
+
let n = t.options.map((e) => typeof e == "string" ? e : e.value);
|
|
3178
|
+
return e.filter((e) => !n.includes(e)).length > 0 ? [Y.categoryOptionMismatch] : [];
|
|
3179
|
+
},
|
|
3180
|
+
describe(e, t) {
|
|
3181
|
+
return Q("multi-choice-field", e, {
|
|
3182
|
+
value: t.state.value,
|
|
3183
|
+
options: e.options,
|
|
3184
|
+
layout: e.layout ?? "vertical",
|
|
3185
|
+
state: t.state.status,
|
|
3186
|
+
errors: t.state.errors
|
|
3187
|
+
});
|
|
3188
|
+
}
|
|
3189
|
+
}, go = {
|
|
3190
|
+
kind: "number",
|
|
3191
|
+
schema: G({
|
|
3192
|
+
kind: J("number"),
|
|
3193
|
+
...Z,
|
|
3194
|
+
min: V().optional(),
|
|
3195
|
+
max: V().optional(),
|
|
3196
|
+
step: V().positive().optional(),
|
|
3197
|
+
unit: R().optional(),
|
|
3198
|
+
placeholder: R().optional()
|
|
3199
|
+
}),
|
|
3200
|
+
getDefaultValue(e) {
|
|
3201
|
+
return typeof e.defaultValue == "number" ? e.defaultValue : null;
|
|
3202
|
+
},
|
|
3203
|
+
normalizeValue(e) {
|
|
3204
|
+
if (e == null || e === "") return null;
|
|
3205
|
+
if (typeof e == "number") return Number.isNaN(e) ? null : e;
|
|
3206
|
+
if (typeof e == "string") {
|
|
3207
|
+
let t = e.trim();
|
|
3208
|
+
if (t.length === 0) return null;
|
|
3209
|
+
let n = Number(t);
|
|
3210
|
+
return Number.isNaN(n) ? e : n;
|
|
3211
|
+
}
|
|
3212
|
+
let t = Number(e);
|
|
3213
|
+
return Number.isNaN(t) ? null : t;
|
|
3214
|
+
},
|
|
3215
|
+
validate(e, t) {
|
|
3216
|
+
let n = [];
|
|
3217
|
+
if (t.min !== void 0 && t.max !== void 0 && t.min > t.max && n.push(Y.invalidNumericRange), e === null) return n;
|
|
3218
|
+
if (typeof e != "number") return n.push(Y.invalidNumber), n;
|
|
3219
|
+
if (t.min !== void 0 && e < t.min && n.push(Y.minValue(t.min)), t.max !== void 0 && e > t.max && n.push(Y.maxValue(t.max)), t.step !== void 0) {
|
|
3220
|
+
let r = t.min ?? 0, i = Math.abs(e - r) % t.step, a = t.step * 1e-9;
|
|
3221
|
+
i > a && Math.abs(i - t.step) > a && n.push(Y.stepValue(t.step));
|
|
3222
|
+
}
|
|
3223
|
+
return n;
|
|
3224
|
+
},
|
|
3225
|
+
describe(e, t) {
|
|
3226
|
+
let n = e.min !== void 0 && e.max !== void 0 && !e.required && t.state.value !== null;
|
|
3227
|
+
return Q("number-field", e, {
|
|
3228
|
+
value: t.state.value,
|
|
3229
|
+
min: e.min,
|
|
3230
|
+
max: e.max,
|
|
3231
|
+
step: e.step,
|
|
3232
|
+
unit: e.unit,
|
|
3233
|
+
placeholder: e.placeholder ?? "",
|
|
3234
|
+
input: n ? "range" : "text",
|
|
3235
|
+
state: t.state.status,
|
|
3236
|
+
errors: t.state.errors
|
|
3237
|
+
});
|
|
3238
|
+
}
|
|
3239
|
+
}, _o = {
|
|
3240
|
+
kind: "rating",
|
|
3241
|
+
schema: G({
|
|
3242
|
+
kind: J("rating"),
|
|
3243
|
+
...Z,
|
|
3244
|
+
min: V().int().optional(),
|
|
3245
|
+
max: V().int().min(1),
|
|
3246
|
+
step: V().int().positive().optional()
|
|
3247
|
+
}),
|
|
3248
|
+
getDefaultValue(e) {
|
|
3249
|
+
return typeof e.defaultValue == "number" ? e.defaultValue : null;
|
|
3250
|
+
},
|
|
3251
|
+
normalizeValue(e) {
|
|
3252
|
+
if (e == null) return null;
|
|
3253
|
+
let t = typeof e == "number" ? e : Number(e);
|
|
3254
|
+
return Number.isNaN(t) ? null : t;
|
|
3255
|
+
},
|
|
3256
|
+
validate(e, t) {
|
|
3257
|
+
if (e === null) return [];
|
|
3258
|
+
let n = [], r = t.min ?? 1, i = t.max;
|
|
3259
|
+
return r > i ? (n.push(Y.invalidNumericRange), n) : (e < r && n.push(Y.minValue(r)), e > i && n.push(Y.maxValue(i)), n);
|
|
3260
|
+
},
|
|
3261
|
+
describe(e, t) {
|
|
3262
|
+
return Q("rating-field", e, {
|
|
3263
|
+
value: t.state.value,
|
|
3264
|
+
min: e.min ?? 1,
|
|
3265
|
+
max: e.max,
|
|
3266
|
+
step: e.step ?? 1,
|
|
3267
|
+
state: t.state.status,
|
|
3268
|
+
errors: t.state.errors
|
|
3269
|
+
});
|
|
3270
|
+
}
|
|
3271
|
+
}, vo = {
|
|
3272
|
+
kind: "text",
|
|
3273
|
+
schema: G({
|
|
3274
|
+
kind: J("text"),
|
|
3275
|
+
...Z,
|
|
3276
|
+
placeholder: R().optional(),
|
|
3277
|
+
minLength: V().int().nonnegative().optional(),
|
|
3278
|
+
maxLength: V().int().nonnegative().optional(),
|
|
3279
|
+
pattern: R().optional()
|
|
3280
|
+
}),
|
|
3281
|
+
getDefaultValue(e) {
|
|
3282
|
+
return typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
3283
|
+
},
|
|
3284
|
+
normalizeValue(e) {
|
|
3285
|
+
return typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" ? `${e}` : "";
|
|
3286
|
+
},
|
|
3287
|
+
validate(e, t) {
|
|
3288
|
+
let n = [];
|
|
3289
|
+
return t.minLength !== void 0 && t.maxLength !== void 0 && t.minLength > t.maxLength && n.push(Y.invalidTextLengthRange), e.length === 0 ? n : (t.minLength !== void 0 && e.length < t.minLength && n.push(Y.minLength(t.minLength)), t.maxLength !== void 0 && e.length > t.maxLength && n.push(Y.maxLength(t.maxLength)), t.pattern && !new RegExp(t.pattern).test(e) && n.push(Y.textPatternMismatch), n);
|
|
3290
|
+
},
|
|
3291
|
+
describe(e, t) {
|
|
3292
|
+
return Q("text-field", e, {
|
|
3293
|
+
value: t.state.value,
|
|
3294
|
+
placeholder: e.placeholder ?? "",
|
|
3295
|
+
minLength: e.minLength,
|
|
3296
|
+
maxLength: e.maxLength,
|
|
3297
|
+
pattern: e.pattern,
|
|
3298
|
+
state: t.state.status,
|
|
3299
|
+
errors: t.state.errors
|
|
3300
|
+
});
|
|
3301
|
+
}
|
|
3302
|
+
}, yo = G({
|
|
3303
|
+
kind: R().min(1),
|
|
3304
|
+
label: R().min(1),
|
|
3305
|
+
required: H().optional()
|
|
3306
|
+
}).passthrough(), bo = "This field is required.", xo = (e) => e.toISOString().slice(0, 10), So = {
|
|
3307
|
+
text: vo,
|
|
3308
|
+
number: go,
|
|
3309
|
+
date: po,
|
|
3310
|
+
category: to
|
|
3311
|
+
}, Co = (e) => So[e], wo = (e) => {
|
|
3312
|
+
if (e == null || e === "") return null;
|
|
3313
|
+
if (typeof e == "boolean") return e;
|
|
3314
|
+
if (typeof e == "string") {
|
|
3315
|
+
if (e === "true") return !0;
|
|
3316
|
+
if (e === "false") return !1;
|
|
3317
|
+
}
|
|
3318
|
+
return !!e;
|
|
3319
|
+
}, To = (e, t) => {
|
|
3320
|
+
if (e.kind === $.kind) return wo(t);
|
|
3321
|
+
let n = Co(e.kind);
|
|
3322
|
+
return n?.normalizeValue ? n.normalizeValue(t, e) : t;
|
|
3323
|
+
}, Eo = (e, t) => {
|
|
3324
|
+
if (t == null) return null;
|
|
3325
|
+
if (e.kind === "date" && t instanceof Date) return xo(t);
|
|
3326
|
+
let n = Co(e.kind);
|
|
3327
|
+
return n?.serializeValue ? n.serializeValue(t, e) : t;
|
|
3328
|
+
}, Do = (e, t) => t == null ? !0 : typeof t == "string" ? t.trim().length === 0 : e.kind === $.kind ? t == null : !1, Oo = (e, t) => {
|
|
3329
|
+
if (e.required && Do(e, t)) return [bo];
|
|
3330
|
+
if (e.kind === $.kind) {
|
|
3331
|
+
if (t === null) return [];
|
|
3332
|
+
let n = $.validate?.(t, e, {
|
|
3333
|
+
field: {
|
|
3334
|
+
...e,
|
|
3335
|
+
id: e.label
|
|
3336
|
+
},
|
|
3337
|
+
values: {},
|
|
3338
|
+
submitCount: 0,
|
|
3339
|
+
validationVersion: 0,
|
|
3340
|
+
signal: void 0
|
|
3341
|
+
});
|
|
3342
|
+
return Array.isArray(n) ? n : [];
|
|
3343
|
+
}
|
|
3344
|
+
let n = Co(e.kind);
|
|
3345
|
+
if (!n?.validate) return [];
|
|
3346
|
+
let r = n.validate(t, e, {
|
|
3347
|
+
field: {
|
|
3348
|
+
...e,
|
|
3349
|
+
id: e.label
|
|
3350
|
+
},
|
|
3351
|
+
values: {},
|
|
3352
|
+
submitCount: 0,
|
|
3353
|
+
validationVersion: 0,
|
|
3354
|
+
signal: void 0
|
|
3355
|
+
});
|
|
3356
|
+
return Array.isArray(r) ? r : [];
|
|
3357
|
+
}, ko = (e, t, n) => n.map((n) => `Row ${e + 1} (${t}): ${n}`), Ao = (e) => {
|
|
3358
|
+
if (Array.isArray(e)) return e.length >= 2 ? {
|
|
3359
|
+
field1: e[0],
|
|
3360
|
+
field2: e[1]
|
|
3361
|
+
} : null;
|
|
3362
|
+
if (!io(e)) return null;
|
|
3363
|
+
if ("field1" in e || "field2" in e) return {
|
|
3364
|
+
field1: e.field1,
|
|
3365
|
+
field2: e.field2
|
|
3366
|
+
};
|
|
3367
|
+
let t = Object.entries(e);
|
|
3368
|
+
return t.length < 2 ? null : {
|
|
3369
|
+
field1: t[0]?.[1],
|
|
3370
|
+
field2: t[1]?.[1]
|
|
3371
|
+
};
|
|
3372
|
+
}, jo = (e, t) => {
|
|
3373
|
+
let n = Ao(e);
|
|
3374
|
+
return n ? {
|
|
3375
|
+
field1: To(t.field1, n.field1),
|
|
3376
|
+
field2: To(t.field2, n.field2)
|
|
3377
|
+
} : null;
|
|
3378
|
+
}, Mo = {
|
|
3379
|
+
kind: "series",
|
|
3380
|
+
schema: G({
|
|
3381
|
+
kind: J("series"),
|
|
3382
|
+
...Z,
|
|
3383
|
+
field1: yo,
|
|
3384
|
+
field2: yo,
|
|
3385
|
+
minPoints: V().int().nonnegative().optional(),
|
|
3386
|
+
maxPoints: V().int().nonnegative().optional()
|
|
3387
|
+
}),
|
|
3388
|
+
getDefaultValue(e) {
|
|
3389
|
+
return Array.isArray(e.defaultValue) ? e.defaultValue.map((t) => jo(t, e)).filter((e) => e !== null) : [];
|
|
3390
|
+
},
|
|
3391
|
+
normalizeValue(e, t) {
|
|
3392
|
+
return Array.isArray(e) ? e.map((e) => jo(e, t)).filter((e) => e !== null) : [];
|
|
3393
|
+
},
|
|
3394
|
+
serializeValue(e, t) {
|
|
3395
|
+
return e.map((e) => ({
|
|
3396
|
+
field1: Eo(t.field1, e.field1),
|
|
3397
|
+
field2: Eo(t.field2, e.field2)
|
|
3398
|
+
}));
|
|
3399
|
+
},
|
|
3400
|
+
validate(e, t) {
|
|
3401
|
+
let n = /* @__PURE__ */ new Set();
|
|
3402
|
+
return t.minPoints !== void 0 && t.maxPoints !== void 0 && t.minPoints > t.maxPoints && n.add(Y.invalidPointCountRange), t.minPoints !== void 0 && e.length < t.minPoints && n.add(Y.minPoints(t.minPoints)), t.maxPoints !== void 0 && e.length > t.maxPoints && n.add(Y.maxPoints(t.maxPoints)), e.forEach((e, r) => {
|
|
3403
|
+
for (let i of ko(r, t.field1.label, Oo(t.field1, e.field1))) n.add(i);
|
|
3404
|
+
for (let i of ko(r, t.field2.label, Oo(t.field2, e.field2))) n.add(i);
|
|
3405
|
+
}), [...n];
|
|
3406
|
+
},
|
|
3407
|
+
describe(e, t) {
|
|
3408
|
+
return Q("series-field", e, {
|
|
3409
|
+
value: Array.isArray(t.state.value) ? t.state.value.map((t) => io(t) ? {
|
|
3410
|
+
field1: Eo(e.field1, t.field1),
|
|
3411
|
+
field2: Eo(e.field2, t.field2)
|
|
3412
|
+
} : t) : [],
|
|
3413
|
+
field1: e.field1,
|
|
3414
|
+
field2: e.field2,
|
|
3415
|
+
minPoints: e.minPoints,
|
|
3416
|
+
maxPoints: e.maxPoints,
|
|
3417
|
+
state: t.state.status,
|
|
3418
|
+
errors: t.state.errors
|
|
3419
|
+
});
|
|
3420
|
+
}
|
|
3421
|
+
}, No = {
|
|
3422
|
+
kind: "single-choice",
|
|
3423
|
+
schema: G({
|
|
3424
|
+
kind: J("single-choice"),
|
|
3425
|
+
...Z,
|
|
3426
|
+
options: W($a).min(1),
|
|
3427
|
+
layout: q(["horizontal", "vertical"]).optional()
|
|
3428
|
+
}),
|
|
3429
|
+
getDefaultValue(e) {
|
|
3430
|
+
return typeof e.defaultValue == "string" ? e.defaultValue : null;
|
|
3431
|
+
},
|
|
3432
|
+
normalizeValue(e) {
|
|
3433
|
+
return e == null || e === "" ? null : typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" ? `${e}` : null;
|
|
3434
|
+
},
|
|
3435
|
+
validate(e, t) {
|
|
3436
|
+
return e === null || t.options.map((e) => typeof e == "string" ? e : e.value).includes(e) ? [] : [Y.categoryOptionMismatch];
|
|
3437
|
+
},
|
|
3438
|
+
describe(e, t) {
|
|
3439
|
+
return Q("single-choice-field", e, {
|
|
3440
|
+
value: t.state.value,
|
|
3441
|
+
options: e.options,
|
|
3442
|
+
layout: e.layout ?? "vertical",
|
|
3443
|
+
state: t.state.status,
|
|
3444
|
+
errors: t.state.errors
|
|
3445
|
+
});
|
|
3446
|
+
}
|
|
3447
|
+
}, Po = {
|
|
3448
|
+
kind: "classifier",
|
|
3449
|
+
partialUpdatePolicy: "validate",
|
|
3450
|
+
schema: G({
|
|
3451
|
+
kind: J("classifier"),
|
|
3452
|
+
...Qa,
|
|
3453
|
+
labels: W(R()).optional(),
|
|
3454
|
+
showClassProbabilities: H().optional().default(!0)
|
|
3455
|
+
}),
|
|
3456
|
+
resolvePayload(e, t) {
|
|
3457
|
+
return t.result.reports[t.report.source] ?? eo(t.result, Ka.classifier);
|
|
3458
|
+
},
|
|
3459
|
+
describe(e, t) {
|
|
3460
|
+
return t.state.status === "idle" && t.payload === void 0 ? null : {
|
|
3461
|
+
component: "classifier-report",
|
|
3462
|
+
props: {
|
|
3463
|
+
id: t.reportId,
|
|
3464
|
+
kind: e.kind,
|
|
3465
|
+
label: e.label ?? qa.classifier,
|
|
3466
|
+
description: e.description ?? "",
|
|
3467
|
+
payload: t.payload,
|
|
3468
|
+
error: t.state.error,
|
|
3469
|
+
state: t.state.status,
|
|
3470
|
+
showClassProbabilities: e.showClassProbabilities,
|
|
3471
|
+
labels: e.labels,
|
|
3472
|
+
...e.ui
|
|
3473
|
+
}
|
|
3474
|
+
};
|
|
3475
|
+
}
|
|
3476
|
+
}, Fo = {
|
|
3477
|
+
kind: "regressor",
|
|
3478
|
+
partialUpdatePolicy: "validate",
|
|
3479
|
+
schema: G({
|
|
3480
|
+
kind: J("regressor"),
|
|
3481
|
+
...Qa,
|
|
3482
|
+
unit: R().optional(),
|
|
3483
|
+
precision: V().int().nonnegative().optional().default(2)
|
|
3484
|
+
}),
|
|
3485
|
+
resolvePayload(e, t) {
|
|
3486
|
+
return t.result.reports[t.report.source] ?? eo(t.result, Ka.regressor);
|
|
3487
|
+
},
|
|
3488
|
+
describe(e, t) {
|
|
3489
|
+
return t.state.status === "idle" && t.payload === void 0 ? null : {
|
|
3490
|
+
component: "regressor-report",
|
|
3491
|
+
props: {
|
|
3492
|
+
id: t.reportId,
|
|
3493
|
+
kind: e.kind,
|
|
3494
|
+
label: e.label ?? qa.regressor,
|
|
3495
|
+
description: e.description ?? "",
|
|
3496
|
+
payload: t.payload,
|
|
3497
|
+
error: t.state.error,
|
|
3498
|
+
state: t.state.status,
|
|
3499
|
+
unit: e.unit,
|
|
3500
|
+
precision: e.precision,
|
|
3501
|
+
...e.ui
|
|
3502
|
+
}
|
|
3503
|
+
};
|
|
3504
|
+
}
|
|
3505
|
+
};
|
|
3506
|
+
//#endregion
|
|
3507
|
+
export { ro as _, vo as a, ho as c, uo as d, fo as f, io as g, oo as h, Mo as i, mo as l, so as m, Po as n, _o as o, lo as p, No as r, go as s, Fo as t, po as u, to as v, $ as y };
|