@spear-ai/spectral 1.9.1 → 1.10.1
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 +6 -5
- package/dist/.js +113 -239
- package/dist/Accordion-CDXdSAST.js +363 -0
- package/dist/Accordion.js +3 -498
- package/dist/Alert/AlertBase.js +69 -152
- package/dist/Alert.js +58 -106
- package/dist/AnimatePresence-D-9jXfgI.js +178 -0
- package/dist/App.js +6 -6
- package/dist/Avatar.js +83 -65
- package/dist/Badge.d.ts +1 -3
- package/dist/Badge.js +21 -25
- package/dist/Button.js +102 -178
- package/dist/ButtonGroup/ButtonGroupButton.js +38 -40
- package/dist/ButtonGroup.js +55 -59
- package/dist/ButtonIcon.js +58 -134
- package/dist/Calendar-s4lyijkn.js +3109 -0
- package/dist/Checkbox/CheckboxBase.js +94 -126
- package/dist/Checkbox.d.ts +1 -1
- package/dist/Checkbox.js +40 -105
- package/dist/Combobox/ComboboxBase.js +2 -79
- package/dist/Combobox.js +106 -172
- package/dist/ComboboxBase-D8Nf4xC-.js +491 -0
- package/dist/ControlGroup/ControlGroupSelect.d.ts +1 -1
- package/dist/ControlGroup/ControlGroupSelect.js +85 -101
- package/dist/ControlGroup.js +45 -48
- package/dist/DataCard/Card.js +37 -12
- package/dist/DataCard.d.ts +1 -1
- package/dist/DataCard.js +36 -16
- package/dist/DateTimePicker/Calendar.js +2 -2967
- package/dist/DateTimePicker/DateTimeDisplayInput.d.ts +1 -1
- package/dist/DateTimePicker/DateTimeDisplayInput.js +379 -275
- package/dist/DateTimePicker/DateTimeInput.d.ts +1 -1
- package/dist/DateTimePicker/DateTimeInput.js +133 -141
- package/dist/DateTimePicker/DateTimeUtils.js +2 -2193
- package/dist/DateTimePicker/TimePeriodSelect.d.ts +1 -1
- package/dist/DateTimePicker/TimePeriodSelect.js +45 -20
- package/dist/DateTimePicker/TimePicker.d.ts +1 -1
- package/dist/DateTimePicker/TimePicker.js +76 -60
- package/dist/DateTimePicker.d.ts +2 -2
- package/dist/DateTimePicker.js +87 -205
- package/dist/DateTimeUtils-DVvG6H-p.js +2098 -0
- package/dist/Dialog.js +74 -74
- package/dist/Drawer.js +67 -37
- package/dist/HoverCard-CYDsIiVK.js +201 -0
- package/dist/HoverCard.d.ts +1 -1
- package/dist/HoverCard.js +2 -218
- package/dist/Icons/AnalyzeIcon.js +50 -57
- package/dist/Icons/AnnotationsIcon.js +20 -15
- package/dist/Icons/ApprovedIcon.js +26 -18
- package/dist/Icons/ArrowDownIcon.js +20 -6
- package/dist/Icons/ArrowUpIcon.js +20 -6
- package/dist/Icons/BoxToolIcon.js +17 -12
- package/dist/Icons/CalendarIcon.js +43 -20
- package/dist/Icons/CheckCircleIcon.js +26 -10
- package/dist/Icons/CheckSquareIcon.js +26 -10
- package/dist/Icons/CheckmarkIcon.js +22 -9
- package/dist/Icons/ChevronDownIcon.js +22 -9
- package/dist/Icons/ChevronUpIcon.js +22 -9
- package/dist/Icons/ClockIcon.js +26 -18
- package/dist/Icons/CloseCircleIcon.js +26 -10
- package/dist/Icons/CloseIcon.js +18 -9
- package/dist/Icons/DashboardIcon.js +36 -10
- package/dist/Icons/DatabaseIcon.js +36 -19
- package/dist/Icons/DeleteIcon.js +36 -19
- package/dist/Icons/DurationIcon.js +57 -22
- package/dist/Icons/EditIcon.js +26 -27
- package/dist/Icons/EmailIcon.js +26 -10
- package/dist/Icons/EraserIcon.js +41 -25
- package/dist/Icons/ErrorIcon.js +27 -11
- package/dist/Icons/EyeClosedIcon.js +29 -13
- package/dist/Icons/EyeClosedIcon2.js +27 -11
- package/dist/Icons/EyeOpenIcon.js +22 -9
- package/dist/Icons/FileDownloadIcon.js +43 -20
- package/dist/Icons/GoToFirstIcon.js +26 -9
- package/dist/Icons/GoToLastIcon.js +26 -9
- package/dist/Icons/HarmonicCursorsIcon.js +23 -9
- package/dist/Icons/IconBase.d.ts +3 -3
- package/dist/Icons/IconBase.js +49 -66
- package/dist/Icons/InfoIcon.js +36 -10
- package/dist/Icons/KeyboardIcon.js +26 -27
- package/dist/Icons/LabelIcon.js +19 -14
- package/dist/Icons/LassoIcon.js +36 -28
- package/dist/Icons/LineToolIcon.js +48 -39
- package/dist/Icons/LiveViewIcon.js +50 -12
- package/dist/Icons/LoaderIcon.js +67 -27
- package/dist/Icons/LocationIcon.js +26 -27
- package/dist/Icons/LogoutIcon.js +20 -15
- package/dist/Icons/MeasureIcon.js +78 -25
- package/dist/Icons/MessagesIcon.js +33 -18
- package/dist/Icons/MetadataIcon.js +20 -15
- package/dist/Icons/MinusIcon.d.ts +1 -1
- package/dist/Icons/MinusIcon.js +18 -6
- package/dist/Icons/OntologyIcon.js +87 -71
- package/dist/Icons/PanelIconClose.js +28 -10
- package/dist/Icons/PanelIconOpen.js +28 -10
- package/dist/Icons/PlayIcon.js +20 -6
- package/dist/Icons/PlusIcon.js +20 -14
- package/dist/Icons/PolygonIcon.js +50 -39
- package/dist/Icons/ProgressCheckIcon.d.ts +5 -0
- package/dist/Icons/ProgressCheckIcon.js +58 -0
- package/dist/Icons/ResetIcon.js +17 -12
- package/dist/Icons/ReviewedIcon.js +36 -19
- package/dist/Icons/ScissorsIcon.js +22 -17
- package/dist/Icons/SearchIcon.js +26 -9
- package/dist/Icons/SettingsIcon.js +26 -27
- package/dist/Icons/SortAscendingIcon.js +50 -12
- package/dist/Icons/SortAtoZIcon.js +50 -12
- package/dist/Icons/SortDescendingIcon.js +50 -12
- package/dist/Icons/SortZtoAIcon.js +50 -12
- package/dist/Icons/StackIcon.js +26 -9
- package/dist/Icons/StarIcon.js +20 -6
- package/dist/Icons/TrashIcon.js +17 -12
- package/dist/Icons/UndoIcon.js +20 -15
- package/dist/Icons/User2Icon.js +26 -10
- package/dist/Icons/UserIcon.js +19 -14
- package/dist/Icons/WarningIcon.js +19 -14
- package/dist/Icons/ZoomAllIcon.js +71 -15
- package/dist/Icons/ZoomXIcon.js +36 -10
- package/dist/Icons/ZoomYIcon.js +36 -10
- package/dist/Icons/index.d.ts +1 -0
- package/dist/Icons.js +68 -136
- package/dist/IconsAnimated/PanelLeftCloseIcon.js +66 -36
- package/dist/IconsAnimated/PanelLeftOpenIcon.js +66 -36
- package/dist/IconsAnimated.js +3 -6
- package/dist/Input/InputUtils.js +51 -52
- package/dist/Input.js +132 -185
- package/dist/InputNumeric.d.ts +14 -0
- package/dist/InputNumeric.js +137 -0
- package/dist/InputOTP-cVn5Bzyp.js +461 -0
- package/dist/InputOTP.js +2 -382
- package/dist/Kbd.d.ts +1 -1
- package/dist/Kbd.js +182 -86
- package/dist/Label.js +12 -14
- package/dist/MultiSelect/MultiSelectBase.js +331 -403
- package/dist/MultiSelect.d.ts +1 -1
- package/dist/MultiSelect.js +23 -23
- package/dist/Popover.js +28 -32
- package/dist/RadioButton.d.ts +17 -0
- package/dist/RadioButton.js +33 -0
- package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +3 -1
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +49 -46
- package/dist/RadioButtonGroup.d.ts +1 -1
- package/dist/RadioButtonGroup.js +11 -8
- package/dist/RadioGroup-w_q6RGEK.js +447 -0
- package/dist/RadioGroup.js +2 -505
- package/dist/Select.js +163 -186
- package/dist/Separator.js +16 -19
- package/dist/Skeleton.js +10 -6
- package/dist/Slider-BzzZT3Zm.js +490 -0
- package/dist/Slider.js +2 -562
- package/dist/SpectralProvider.js +8 -5
- package/dist/Switch/SwitchBase.js +91 -95
- package/dist/Switch-CVzRJ-0n.js +126 -0
- package/dist/Switch.d.ts +1 -1
- package/dist/Switch.js +2 -134
- package/dist/Tabs/TabsBase.js +242 -250
- package/dist/Tabs/tabsUtils.js +65 -73
- package/dist/Tabs.d.ts +1 -1
- package/dist/Tabs.js +73 -103
- package/dist/Textarea/TextareaUtils.js +35 -46
- package/dist/Textarea.js +83 -160
- package/dist/Toast-9zqXxKKO.js +711 -0
- package/dist/Toast.js +2 -885
- package/dist/Toggle/ToggleBase.js +46 -56
- package/dist/Toggle.d.ts +1 -1
- package/dist/Toggle.js +52 -62
- package/dist/ToggleGroup/ToggleGroupBase.js +128 -104
- package/dist/ToggleGroup.d.ts +1 -1
- package/dist/ToggleGroup.js +52 -63
- package/dist/Tooltip-D1K8kY1y.js +389 -0
- package/dist/Tooltip.js +2 -365
- package/dist/Tray.js +174 -217
- package/dist/chunk-h9knIhTc.js +20 -0
- package/dist/clsx-jM1GlMvB.js +16 -0
- package/dist/dist-3Af8168y.js +913 -0
- package/dist/dist-7HRQ5IKN.js +249 -0
- package/dist/dist-B2k1iWFp.js +129 -0
- package/dist/dist-B4FgboI8.js +122 -0
- package/dist/dist-B4g6zpUF.js +33 -0
- package/dist/dist-B9tup-4O.js +216 -0
- package/dist/dist-BK1K0g9W.js +29 -0
- package/dist/dist-Bfjk-jx9.js +28 -0
- package/dist/dist-Bft31cJh.js +65 -0
- package/dist/dist-BtdmHAzK.js +190 -0
- package/dist/dist-C0Hifjgh.js +1287 -0
- package/dist/dist-CGzgmYB9.js +68 -0
- package/dist/dist-ClmepHp4.js +10 -0
- package/dist/dist-D8Wb_MX9.js +6 -0
- package/dist/dist-Dtvmk11N.js +12 -0
- package/dist/dist-fW81qjVl.js +677 -0
- package/dist/dist-s1uWaZYZ.js +11 -0
- package/dist/es2015-YHaMV-St.js +701 -0
- package/dist/hooks/useAccordionAutoScroll.js +66 -67
- package/dist/hooks/useControllableState.js +14 -13
- package/dist/hooks/useConvertToOklch.d.ts +3 -0
- package/dist/hooks/useConvertToOklch.d.ts.map +1 -0
- package/dist/hooks/useConvertToOklch.js +51 -0
- package/dist/hooks/useTheme.js +21 -17
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/main.js +18954 -27224
- package/dist/primitives/button.js +39 -41
- package/dist/primitives/input-group.js +57 -73
- package/dist/primitives/input.js +11 -20
- package/dist/primitives/popover.js +34 -28
- package/dist/primitives/select.js +70 -138
- package/dist/primitives/slot.js +32 -31
- package/dist/primitives/textarea.js +10 -16
- package/dist/proxy-Dn10Pl_g.js +4920 -0
- package/dist/styles/main.css +2 -1
- package/dist/styles/spectral.css +1 -1
- package/dist/twUtils-VNWgstKL.js +1673 -0
- package/dist/use-animation-CBUDycyW.js +57 -0
- package/dist/utils/constants.js +4 -4
- package/dist/utils/formFieldUtils.js +136 -148
- package/dist/utils/sharedUtils.js +26 -7
- package/dist/utils/twUtils.js +2 -2919
- package/package.json +24 -28
- package/dist/ComboboxBase-CxNxYtdT.js +0 -408
- package/dist/clsx-OuTLNxxd.js +0 -16
- package/dist/index-0ioNhtNM.js +0 -10
- package/dist/index-6oYKCvIn.js +0 -677
- package/dist/index-BFOf48AQ.js +0 -69
- package/dist/index-BZPx6jYI.js +0 -8
- package/dist/index-BlHU_t18.js +0 -142
- package/dist/index-Bm1RbF6w.js +0 -1037
- package/dist/index-Bv2OIg5P.js +0 -225
- package/dist/index-CKEI0pDv.js +0 -56
- package/dist/index-CM_hWgfC.js +0 -32
- package/dist/index-C_YVr64u.js +0 -1538
- package/dist/index-Cl8VeY0o.js +0 -149
- package/dist/index-CwSyIPrv.js +0 -13
- package/dist/index-D29mdTf5.js +0 -34
- package/dist/index-DEYs15GP.js +0 -66
- package/dist/index-Dc0No4pV.js +0 -233
- package/dist/index-T6XEa11q.js +0 -822
- package/dist/index-pBCLb6Gr.js +0 -240
- package/dist/index-psiVrsnE.js +0 -27
- package/dist/index-rKs9bXHr.js +0 -6
- package/dist/proxy-CO_-Vget.js +0 -4975
- package/dist/use-animation-DhEPRwZ3.js +0 -62
|
@@ -0,0 +1,2098 @@
|
|
|
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("^") ? 1 : 0, 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 d = Symbol("evaluating");
|
|
78
|
+
function f(e, t, n) {
|
|
79
|
+
let r;
|
|
80
|
+
Object.defineProperty(e, t, {
|
|
81
|
+
get() {
|
|
82
|
+
if (r !== d) return r === void 0 && (r = d, r = n()), r;
|
|
83
|
+
},
|
|
84
|
+
set(n) {
|
|
85
|
+
Object.defineProperty(e, t, { value: n });
|
|
86
|
+
},
|
|
87
|
+
configurable: !0
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function p(e, t, n) {
|
|
91
|
+
Object.defineProperty(e, t, {
|
|
92
|
+
value: n,
|
|
93
|
+
writable: !0,
|
|
94
|
+
enumerable: !0,
|
|
95
|
+
configurable: !0
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function m(...e) {
|
|
99
|
+
let t = {};
|
|
100
|
+
for (let n of e) Object.assign(t, Object.getOwnPropertyDescriptors(n));
|
|
101
|
+
return Object.defineProperties({}, t);
|
|
102
|
+
}
|
|
103
|
+
function ee(e) {
|
|
104
|
+
return JSON.stringify(e);
|
|
105
|
+
}
|
|
106
|
+
var te = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {};
|
|
107
|
+
function h(e) {
|
|
108
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
109
|
+
}
|
|
110
|
+
var ne = s(() => {
|
|
111
|
+
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return !1;
|
|
112
|
+
try {
|
|
113
|
+
return Function(""), !0;
|
|
114
|
+
} catch {
|
|
115
|
+
return !1;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
function g(e) {
|
|
119
|
+
if (h(e) === !1) return !1;
|
|
120
|
+
let t = e.constructor;
|
|
121
|
+
if (t === void 0 || typeof t != "function") return !0;
|
|
122
|
+
let n = t.prototype;
|
|
123
|
+
return !(h(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
124
|
+
}
|
|
125
|
+
function re(e) {
|
|
126
|
+
return g(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
127
|
+
}
|
|
128
|
+
var ie = new Set([
|
|
129
|
+
"string",
|
|
130
|
+
"number",
|
|
131
|
+
"symbol"
|
|
132
|
+
]);
|
|
133
|
+
function ae(e) {
|
|
134
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
135
|
+
}
|
|
136
|
+
function _(e, t, n) {
|
|
137
|
+
let r = new e._zod.constr(t ?? e._zod.def);
|
|
138
|
+
return (!t || n?.parent) && (r._zod.parent = e), r;
|
|
139
|
+
}
|
|
140
|
+
function v(e) {
|
|
141
|
+
let t = e;
|
|
142
|
+
if (!t) return {};
|
|
143
|
+
if (typeof t == "string") return { error: () => t };
|
|
144
|
+
if (t?.message !== void 0) {
|
|
145
|
+
if (t?.error !== void 0) throw Error("Cannot specify both `message` and `error` params");
|
|
146
|
+
t.error = t.message;
|
|
147
|
+
}
|
|
148
|
+
return delete t.message, typeof t.error == "string" ? {
|
|
149
|
+
...t,
|
|
150
|
+
error: () => t.error
|
|
151
|
+
} : t;
|
|
152
|
+
}
|
|
153
|
+
function oe(e) {
|
|
154
|
+
return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
|
|
155
|
+
}
|
|
156
|
+
var se = {
|
|
157
|
+
safeint: [-(2 ** 53 - 1), 2 ** 53 - 1],
|
|
158
|
+
int32: [-2147483648, 2147483647],
|
|
159
|
+
uint32: [0, 4294967295],
|
|
160
|
+
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
161
|
+
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
162
|
+
};
|
|
163
|
+
function ce(e, t) {
|
|
164
|
+
let n = e._zod.def, r = n.checks;
|
|
165
|
+
if (r && r.length > 0) throw Error(".pick() cannot be used on object schemas containing refinements");
|
|
166
|
+
return _(e, m(e._zod.def, {
|
|
167
|
+
get shape() {
|
|
168
|
+
let e = {};
|
|
169
|
+
for (let r in t) {
|
|
170
|
+
if (!(r in n.shape)) throw Error(`Unrecognized key: "${r}"`);
|
|
171
|
+
t[r] && (e[r] = n.shape[r]);
|
|
172
|
+
}
|
|
173
|
+
return p(this, "shape", e), e;
|
|
174
|
+
},
|
|
175
|
+
checks: []
|
|
176
|
+
}));
|
|
177
|
+
}
|
|
178
|
+
function le(e, t) {
|
|
179
|
+
let n = e._zod.def, r = n.checks;
|
|
180
|
+
if (r && r.length > 0) throw Error(".omit() cannot be used on object schemas containing refinements");
|
|
181
|
+
return _(e, m(e._zod.def, {
|
|
182
|
+
get shape() {
|
|
183
|
+
let r = { ...e._zod.def.shape };
|
|
184
|
+
for (let e in t) {
|
|
185
|
+
if (!(e in n.shape)) throw Error(`Unrecognized key: "${e}"`);
|
|
186
|
+
t[e] && delete r[e];
|
|
187
|
+
}
|
|
188
|
+
return p(this, "shape", r), r;
|
|
189
|
+
},
|
|
190
|
+
checks: []
|
|
191
|
+
}));
|
|
192
|
+
}
|
|
193
|
+
function ue(e, t) {
|
|
194
|
+
if (!g(t)) throw Error("Invalid input to extend: expected a plain object");
|
|
195
|
+
let n = e._zod.def.checks;
|
|
196
|
+
if (n && n.length > 0) {
|
|
197
|
+
let n = e._zod.def.shape;
|
|
198
|
+
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.");
|
|
199
|
+
}
|
|
200
|
+
return _(e, m(e._zod.def, { get shape() {
|
|
201
|
+
let n = {
|
|
202
|
+
...e._zod.def.shape,
|
|
203
|
+
...t
|
|
204
|
+
};
|
|
205
|
+
return p(this, "shape", n), n;
|
|
206
|
+
} }));
|
|
207
|
+
}
|
|
208
|
+
function de(e, t) {
|
|
209
|
+
if (!g(t)) throw Error("Invalid input to safeExtend: expected a plain object");
|
|
210
|
+
return _(e, m(e._zod.def, { get shape() {
|
|
211
|
+
let n = {
|
|
212
|
+
...e._zod.def.shape,
|
|
213
|
+
...t
|
|
214
|
+
};
|
|
215
|
+
return p(this, "shape", n), n;
|
|
216
|
+
} }));
|
|
217
|
+
}
|
|
218
|
+
function fe(e, t) {
|
|
219
|
+
return _(e, m(e._zod.def, {
|
|
220
|
+
get shape() {
|
|
221
|
+
let n = {
|
|
222
|
+
...e._zod.def.shape,
|
|
223
|
+
...t._zod.def.shape
|
|
224
|
+
};
|
|
225
|
+
return p(this, "shape", n), n;
|
|
226
|
+
},
|
|
227
|
+
get catchall() {
|
|
228
|
+
return t._zod.def.catchall;
|
|
229
|
+
},
|
|
230
|
+
checks: []
|
|
231
|
+
}));
|
|
232
|
+
}
|
|
233
|
+
function pe(e, t, n) {
|
|
234
|
+
let r = t._zod.def.checks;
|
|
235
|
+
if (r && r.length > 0) throw Error(".partial() cannot be used on object schemas containing refinements");
|
|
236
|
+
return _(t, m(t._zod.def, {
|
|
237
|
+
get shape() {
|
|
238
|
+
let r = t._zod.def.shape, i = { ...r };
|
|
239
|
+
if (n) for (let t in n) {
|
|
240
|
+
if (!(t in r)) throw Error(`Unrecognized key: "${t}"`);
|
|
241
|
+
n[t] && (i[t] = e ? new e({
|
|
242
|
+
type: "optional",
|
|
243
|
+
innerType: r[t]
|
|
244
|
+
}) : r[t]);
|
|
245
|
+
}
|
|
246
|
+
else for (let t in r) i[t] = e ? new e({
|
|
247
|
+
type: "optional",
|
|
248
|
+
innerType: r[t]
|
|
249
|
+
}) : r[t];
|
|
250
|
+
return p(this, "shape", i), i;
|
|
251
|
+
},
|
|
252
|
+
checks: []
|
|
253
|
+
}));
|
|
254
|
+
}
|
|
255
|
+
function me(e, t, n) {
|
|
256
|
+
return _(t, m(t._zod.def, { get shape() {
|
|
257
|
+
let r = t._zod.def.shape, i = { ...r };
|
|
258
|
+
if (n) for (let t in n) {
|
|
259
|
+
if (!(t in i)) throw Error(`Unrecognized key: "${t}"`);
|
|
260
|
+
n[t] && (i[t] = new e({
|
|
261
|
+
type: "nonoptional",
|
|
262
|
+
innerType: r[t]
|
|
263
|
+
}));
|
|
264
|
+
}
|
|
265
|
+
else for (let t in r) i[t] = new e({
|
|
266
|
+
type: "nonoptional",
|
|
267
|
+
innerType: r[t]
|
|
268
|
+
});
|
|
269
|
+
return p(this, "shape", i), i;
|
|
270
|
+
} }));
|
|
271
|
+
}
|
|
272
|
+
function y(e, t = 0) {
|
|
273
|
+
if (e.aborted === !0) return !0;
|
|
274
|
+
for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue !== !0) return !0;
|
|
275
|
+
return !1;
|
|
276
|
+
}
|
|
277
|
+
function he(e, t) {
|
|
278
|
+
return t.map((t) => {
|
|
279
|
+
var n;
|
|
280
|
+
return (n = t).path ?? (n.path = []), t.path.unshift(e), t;
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
function b(e) {
|
|
284
|
+
return typeof e == "string" ? e : e?.message;
|
|
285
|
+
}
|
|
286
|
+
function x(e, t, n) {
|
|
287
|
+
let r = {
|
|
288
|
+
...e,
|
|
289
|
+
path: e.path ?? []
|
|
290
|
+
};
|
|
291
|
+
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;
|
|
292
|
+
}
|
|
293
|
+
function S(e) {
|
|
294
|
+
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
295
|
+
}
|
|
296
|
+
function C(...e) {
|
|
297
|
+
let [t, n, r] = e;
|
|
298
|
+
return typeof t == "string" ? {
|
|
299
|
+
message: t,
|
|
300
|
+
code: "custom",
|
|
301
|
+
input: n,
|
|
302
|
+
inst: r
|
|
303
|
+
} : { ...t };
|
|
304
|
+
}
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js
|
|
307
|
+
var ge = (e, t) => {
|
|
308
|
+
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
309
|
+
value: e._zod,
|
|
310
|
+
enumerable: !1
|
|
311
|
+
}), Object.defineProperty(e, "issues", {
|
|
312
|
+
value: t,
|
|
313
|
+
enumerable: !1
|
|
314
|
+
}), e.message = JSON.stringify(t, o, 2), Object.defineProperty(e, "toString", {
|
|
315
|
+
value: () => e.message,
|
|
316
|
+
enumerable: !1
|
|
317
|
+
});
|
|
318
|
+
}, _e = e("$ZodError", ge), ve = e("$ZodError", ge, { Parent: Error });
|
|
319
|
+
function ye(e, t = (e) => e.message) {
|
|
320
|
+
let n = {}, r = [];
|
|
321
|
+
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));
|
|
322
|
+
return {
|
|
323
|
+
formErrors: r,
|
|
324
|
+
fieldErrors: n
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
function be(e, t = (e) => e.message) {
|
|
328
|
+
let n = { _errors: [] }, r = (e) => {
|
|
329
|
+
for (let i of e.issues) if (i.code === "invalid_union" && i.errors.length) i.errors.map((e) => r({ issues: e }));
|
|
330
|
+
else if (i.code === "invalid_key") r({ issues: i.issues });
|
|
331
|
+
else if (i.code === "invalid_element") r({ issues: i.issues });
|
|
332
|
+
else if (i.path.length === 0) n._errors.push(t(i));
|
|
333
|
+
else {
|
|
334
|
+
let e = n, r = 0;
|
|
335
|
+
for (; r < i.path.length;) {
|
|
336
|
+
let n = i.path[r];
|
|
337
|
+
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++;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
return r(e), n;
|
|
342
|
+
}
|
|
343
|
+
//#endregion
|
|
344
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js
|
|
345
|
+
var w = (e) => (n, r, a, o) => {
|
|
346
|
+
let s = a ? Object.assign(a, { async: !1 }) : { async: !1 }, c = n._zod.run({
|
|
347
|
+
value: r,
|
|
348
|
+
issues: []
|
|
349
|
+
}, s);
|
|
350
|
+
if (c instanceof Promise) throw new t();
|
|
351
|
+
if (c.issues.length) {
|
|
352
|
+
let t = new (o?.Err ?? e)(c.issues.map((e) => x(e, s, i())));
|
|
353
|
+
throw te(t, o?.callee), t;
|
|
354
|
+
}
|
|
355
|
+
return c.value;
|
|
356
|
+
}, T = (e) => async (t, n, r, a) => {
|
|
357
|
+
let o = r ? Object.assign(r, { async: !0 }) : { async: !0 }, s = t._zod.run({
|
|
358
|
+
value: n,
|
|
359
|
+
issues: []
|
|
360
|
+
}, o);
|
|
361
|
+
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
362
|
+
let t = new (a?.Err ?? e)(s.issues.map((e) => x(e, o, i())));
|
|
363
|
+
throw te(t, a?.callee), t;
|
|
364
|
+
}
|
|
365
|
+
return s.value;
|
|
366
|
+
}, E = (e) => (n, r, a) => {
|
|
367
|
+
let o = a ? {
|
|
368
|
+
...a,
|
|
369
|
+
async: !1
|
|
370
|
+
} : { async: !1 }, s = n._zod.run({
|
|
371
|
+
value: r,
|
|
372
|
+
issues: []
|
|
373
|
+
}, o);
|
|
374
|
+
if (s instanceof Promise) throw new t();
|
|
375
|
+
return s.issues.length ? {
|
|
376
|
+
success: !1,
|
|
377
|
+
error: new (e ?? _e)(s.issues.map((e) => x(e, o, i())))
|
|
378
|
+
} : {
|
|
379
|
+
success: !0,
|
|
380
|
+
data: s.value
|
|
381
|
+
};
|
|
382
|
+
}, xe = /* @__PURE__ */ E(ve), D = (e) => async (t, n, r) => {
|
|
383
|
+
let a = r ? Object.assign(r, { async: !0 }) : { async: !0 }, o = t._zod.run({
|
|
384
|
+
value: n,
|
|
385
|
+
issues: []
|
|
386
|
+
}, a);
|
|
387
|
+
return o instanceof Promise && (o = await o), o.issues.length ? {
|
|
388
|
+
success: !1,
|
|
389
|
+
error: new e(o.issues.map((e) => x(e, a, i())))
|
|
390
|
+
} : {
|
|
391
|
+
success: !0,
|
|
392
|
+
data: o.value
|
|
393
|
+
};
|
|
394
|
+
}, Se = /* @__PURE__ */ D(ve), Ce = (e) => (t, n, r) => {
|
|
395
|
+
let i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
396
|
+
return w(e)(t, n, i);
|
|
397
|
+
}, we = (e) => (t, n, r) => w(e)(t, n, r), Te = (e) => async (t, n, r) => {
|
|
398
|
+
let i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
399
|
+
return T(e)(t, n, i);
|
|
400
|
+
}, Ee = (e) => async (t, n, r) => T(e)(t, n, r), De = (e) => (t, n, r) => {
|
|
401
|
+
let i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
402
|
+
return E(e)(t, n, i);
|
|
403
|
+
}, Oe = (e) => (t, n, r) => E(e)(t, n, r), ke = (e) => async (t, n, r) => {
|
|
404
|
+
let i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
405
|
+
return D(e)(t, n, i);
|
|
406
|
+
}, Ae = (e) => async (t, n, r) => D(e)(t, n, r), je = /^-?\d+$/, Me = /^-?\d+(?:\.\d+)?$/, O = /* @__PURE__ */ e("$ZodCheck", (e, t) => {
|
|
407
|
+
var n;
|
|
408
|
+
e._zod ??= {}, e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
409
|
+
}), k = {
|
|
410
|
+
number: "number",
|
|
411
|
+
bigint: "bigint",
|
|
412
|
+
object: "date"
|
|
413
|
+
}, A = /* @__PURE__ */ e("$ZodCheckLessThan", (e, t) => {
|
|
414
|
+
O.init(e, t);
|
|
415
|
+
let n = k[typeof t.value];
|
|
416
|
+
e._zod.onattach.push((e) => {
|
|
417
|
+
let n = e._zod.bag, r = (t.inclusive ? n.maximum : n.exclusiveMaximum) ?? Infinity;
|
|
418
|
+
t.value < r && (t.inclusive ? n.maximum = t.value : n.exclusiveMaximum = t.value);
|
|
419
|
+
}), e._zod.check = (r) => {
|
|
420
|
+
(t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({
|
|
421
|
+
origin: n,
|
|
422
|
+
code: "too_big",
|
|
423
|
+
maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
|
|
424
|
+
input: r.value,
|
|
425
|
+
inclusive: t.inclusive,
|
|
426
|
+
inst: e,
|
|
427
|
+
continue: !t.abort
|
|
428
|
+
});
|
|
429
|
+
};
|
|
430
|
+
}), j = /* @__PURE__ */ e("$ZodCheckGreaterThan", (e, t) => {
|
|
431
|
+
O.init(e, t);
|
|
432
|
+
let n = k[typeof t.value];
|
|
433
|
+
e._zod.onattach.push((e) => {
|
|
434
|
+
let n = e._zod.bag, r = (t.inclusive ? n.minimum : n.exclusiveMinimum) ?? -Infinity;
|
|
435
|
+
t.value > r && (t.inclusive ? n.minimum = t.value : n.exclusiveMinimum = t.value);
|
|
436
|
+
}), e._zod.check = (r) => {
|
|
437
|
+
(t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({
|
|
438
|
+
origin: n,
|
|
439
|
+
code: "too_small",
|
|
440
|
+
minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
|
|
441
|
+
input: r.value,
|
|
442
|
+
inclusive: t.inclusive,
|
|
443
|
+
inst: e,
|
|
444
|
+
continue: !t.abort
|
|
445
|
+
});
|
|
446
|
+
};
|
|
447
|
+
}), Ne = /* @__PURE__ */ e("$ZodCheckMultipleOf", (e, t) => {
|
|
448
|
+
O.init(e, t), e._zod.onattach.push((e) => {
|
|
449
|
+
var n;
|
|
450
|
+
(n = e._zod.bag).multipleOf ?? (n.multipleOf = t.value);
|
|
451
|
+
}), e._zod.check = (n) => {
|
|
452
|
+
if (typeof n.value != typeof t.value) throw Error("Cannot mix number and bigint in multiple_of check.");
|
|
453
|
+
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : u(n.value, t.value) === 0) || n.issues.push({
|
|
454
|
+
origin: typeof n.value,
|
|
455
|
+
code: "not_multiple_of",
|
|
456
|
+
divisor: t.value,
|
|
457
|
+
input: n.value,
|
|
458
|
+
inst: e,
|
|
459
|
+
continue: !t.abort
|
|
460
|
+
});
|
|
461
|
+
};
|
|
462
|
+
}), Pe = /* @__PURE__ */ e("$ZodCheckNumberFormat", (e, t) => {
|
|
463
|
+
O.init(e, t), t.format = t.format || "float64";
|
|
464
|
+
let n = t.format?.includes("int"), r = n ? "int" : "number", [i, a] = se[t.format];
|
|
465
|
+
e._zod.onattach.push((e) => {
|
|
466
|
+
let r = e._zod.bag;
|
|
467
|
+
r.format = t.format, r.minimum = i, r.maximum = a, n && (r.pattern = je);
|
|
468
|
+
}), e._zod.check = (o) => {
|
|
469
|
+
let s = o.value;
|
|
470
|
+
if (n) {
|
|
471
|
+
if (!Number.isInteger(s)) {
|
|
472
|
+
o.issues.push({
|
|
473
|
+
expected: r,
|
|
474
|
+
format: t.format,
|
|
475
|
+
code: "invalid_type",
|
|
476
|
+
continue: !1,
|
|
477
|
+
input: s,
|
|
478
|
+
inst: e
|
|
479
|
+
});
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
if (!Number.isSafeInteger(s)) {
|
|
483
|
+
s > 0 ? o.issues.push({
|
|
484
|
+
input: s,
|
|
485
|
+
code: "too_big",
|
|
486
|
+
maximum: 2 ** 53 - 1,
|
|
487
|
+
note: "Integers must be within the safe integer range.",
|
|
488
|
+
inst: e,
|
|
489
|
+
origin: r,
|
|
490
|
+
inclusive: !0,
|
|
491
|
+
continue: !t.abort
|
|
492
|
+
}) : o.issues.push({
|
|
493
|
+
input: s,
|
|
494
|
+
code: "too_small",
|
|
495
|
+
minimum: -(2 ** 53 - 1),
|
|
496
|
+
note: "Integers must be within the safe integer range.",
|
|
497
|
+
inst: e,
|
|
498
|
+
origin: r,
|
|
499
|
+
inclusive: !0,
|
|
500
|
+
continue: !t.abort
|
|
501
|
+
});
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
s < i && o.issues.push({
|
|
506
|
+
origin: "number",
|
|
507
|
+
input: s,
|
|
508
|
+
code: "too_small",
|
|
509
|
+
minimum: i,
|
|
510
|
+
inclusive: !0,
|
|
511
|
+
inst: e,
|
|
512
|
+
continue: !t.abort
|
|
513
|
+
}), s > a && o.issues.push({
|
|
514
|
+
origin: "number",
|
|
515
|
+
input: s,
|
|
516
|
+
code: "too_big",
|
|
517
|
+
maximum: a,
|
|
518
|
+
inclusive: !0,
|
|
519
|
+
inst: e,
|
|
520
|
+
continue: !t.abort
|
|
521
|
+
});
|
|
522
|
+
};
|
|
523
|
+
}), Fe = /* @__PURE__ */ e("$ZodCheckMaxLength", (e, t) => {
|
|
524
|
+
var n;
|
|
525
|
+
O.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
|
|
526
|
+
let t = e.value;
|
|
527
|
+
return !c(t) && t.length !== void 0;
|
|
528
|
+
}), e._zod.onattach.push((e) => {
|
|
529
|
+
let n = e._zod.bag.maximum ?? Infinity;
|
|
530
|
+
t.maximum < n && (e._zod.bag.maximum = t.maximum);
|
|
531
|
+
}), e._zod.check = (n) => {
|
|
532
|
+
let r = n.value;
|
|
533
|
+
if (r.length <= t.maximum) return;
|
|
534
|
+
let i = S(r);
|
|
535
|
+
n.issues.push({
|
|
536
|
+
origin: i,
|
|
537
|
+
code: "too_big",
|
|
538
|
+
maximum: t.maximum,
|
|
539
|
+
inclusive: !0,
|
|
540
|
+
input: r,
|
|
541
|
+
inst: e,
|
|
542
|
+
continue: !t.abort
|
|
543
|
+
});
|
|
544
|
+
};
|
|
545
|
+
}), Ie = /* @__PURE__ */ e("$ZodCheckMinLength", (e, t) => {
|
|
546
|
+
var n;
|
|
547
|
+
O.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
|
|
548
|
+
let t = e.value;
|
|
549
|
+
return !c(t) && t.length !== void 0;
|
|
550
|
+
}), e._zod.onattach.push((e) => {
|
|
551
|
+
let n = e._zod.bag.minimum ?? -Infinity;
|
|
552
|
+
t.minimum > n && (e._zod.bag.minimum = t.minimum);
|
|
553
|
+
}), e._zod.check = (n) => {
|
|
554
|
+
let r = n.value;
|
|
555
|
+
if (r.length >= t.minimum) return;
|
|
556
|
+
let i = S(r);
|
|
557
|
+
n.issues.push({
|
|
558
|
+
origin: i,
|
|
559
|
+
code: "too_small",
|
|
560
|
+
minimum: t.minimum,
|
|
561
|
+
inclusive: !0,
|
|
562
|
+
input: r,
|
|
563
|
+
inst: e,
|
|
564
|
+
continue: !t.abort
|
|
565
|
+
});
|
|
566
|
+
};
|
|
567
|
+
}), Le = /* @__PURE__ */ e("$ZodCheckLengthEquals", (e, t) => {
|
|
568
|
+
var n;
|
|
569
|
+
O.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
|
|
570
|
+
let t = e.value;
|
|
571
|
+
return !c(t) && t.length !== void 0;
|
|
572
|
+
}), e._zod.onattach.push((e) => {
|
|
573
|
+
let n = e._zod.bag;
|
|
574
|
+
n.minimum = t.length, n.maximum = t.length, n.length = t.length;
|
|
575
|
+
}), e._zod.check = (n) => {
|
|
576
|
+
let r = n.value, i = r.length;
|
|
577
|
+
if (i === t.length) return;
|
|
578
|
+
let a = S(r), o = i > t.length;
|
|
579
|
+
n.issues.push({
|
|
580
|
+
origin: a,
|
|
581
|
+
...o ? {
|
|
582
|
+
code: "too_big",
|
|
583
|
+
maximum: t.length
|
|
584
|
+
} : {
|
|
585
|
+
code: "too_small",
|
|
586
|
+
minimum: t.length
|
|
587
|
+
},
|
|
588
|
+
inclusive: !0,
|
|
589
|
+
exact: !0,
|
|
590
|
+
input: n.value,
|
|
591
|
+
inst: e,
|
|
592
|
+
continue: !t.abort
|
|
593
|
+
});
|
|
594
|
+
};
|
|
595
|
+
}), Re = /* @__PURE__ */ e("$ZodCheckOverwrite", (e, t) => {
|
|
596
|
+
O.init(e, t), e._zod.check = (e) => {
|
|
597
|
+
e.value = t.tx(e.value);
|
|
598
|
+
};
|
|
599
|
+
}), ze = class {
|
|
600
|
+
constructor(e = []) {
|
|
601
|
+
this.content = [], this.indent = 0, this && (this.args = e);
|
|
602
|
+
}
|
|
603
|
+
indented(e) {
|
|
604
|
+
this.indent += 1, e(this), --this.indent;
|
|
605
|
+
}
|
|
606
|
+
write(e) {
|
|
607
|
+
if (typeof e == "function") {
|
|
608
|
+
e(this, { execution: "sync" }), e(this, { execution: "async" });
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
611
|
+
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);
|
|
612
|
+
for (let e of r) this.content.push(e);
|
|
613
|
+
}
|
|
614
|
+
compile() {
|
|
615
|
+
let e = Function, t = this?.args, n = [...(this?.content ?? [""]).map((e) => ` ${e}`)];
|
|
616
|
+
return new e(...t, n.join("\n"));
|
|
617
|
+
}
|
|
618
|
+
}, Be = {
|
|
619
|
+
major: 4,
|
|
620
|
+
minor: 3,
|
|
621
|
+
patch: 6
|
|
622
|
+
}, M = /* @__PURE__ */ e("$ZodType", (e, n) => {
|
|
623
|
+
var r;
|
|
624
|
+
e ??= {}, e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = Be;
|
|
625
|
+
let i = [...e._zod.def.checks ?? []];
|
|
626
|
+
e._zod.traits.has("$ZodCheck") && i.unshift(e);
|
|
627
|
+
for (let t of i) for (let n of t._zod.onattach) n(e);
|
|
628
|
+
if (i.length === 0) (r = e._zod).deferred ?? (r.deferred = []), e._zod.deferred?.push(() => {
|
|
629
|
+
e._zod.run = e._zod.parse;
|
|
630
|
+
});
|
|
631
|
+
else {
|
|
632
|
+
let n = (e, n, r) => {
|
|
633
|
+
let i = y(e), a;
|
|
634
|
+
for (let o of n) {
|
|
635
|
+
if (o._zod.def.when) {
|
|
636
|
+
if (!o._zod.def.when(e)) continue;
|
|
637
|
+
} else if (i) continue;
|
|
638
|
+
let n = e.issues.length, s = o._zod.check(e);
|
|
639
|
+
if (s instanceof Promise && r?.async === !1) throw new t();
|
|
640
|
+
if (a || s instanceof Promise) a = (a ?? Promise.resolve()).then(async () => {
|
|
641
|
+
await s, e.issues.length !== n && (i ||= y(e, n));
|
|
642
|
+
});
|
|
643
|
+
else {
|
|
644
|
+
if (e.issues.length === n) continue;
|
|
645
|
+
i ||= y(e, n);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
return a ? a.then(() => e) : e;
|
|
649
|
+
}, r = (r, a, o) => {
|
|
650
|
+
if (y(r)) return r.aborted = !0, r;
|
|
651
|
+
let s = n(a, i, o);
|
|
652
|
+
if (s instanceof Promise) {
|
|
653
|
+
if (o.async === !1) throw new t();
|
|
654
|
+
return s.then((t) => e._zod.parse(t, o));
|
|
655
|
+
}
|
|
656
|
+
return e._zod.parse(s, o);
|
|
657
|
+
};
|
|
658
|
+
e._zod.run = (a, o) => {
|
|
659
|
+
if (o.skipChecks) return e._zod.parse(a, o);
|
|
660
|
+
if (o.direction === "backward") {
|
|
661
|
+
let t = e._zod.parse({
|
|
662
|
+
value: a.value,
|
|
663
|
+
issues: []
|
|
664
|
+
}, {
|
|
665
|
+
...o,
|
|
666
|
+
skipChecks: !0
|
|
667
|
+
});
|
|
668
|
+
return t instanceof Promise ? t.then((e) => r(e, a, o)) : r(t, a, o);
|
|
669
|
+
}
|
|
670
|
+
let s = e._zod.parse(a, o);
|
|
671
|
+
if (s instanceof Promise) {
|
|
672
|
+
if (o.async === !1) throw new t();
|
|
673
|
+
return s.then((e) => n(e, i, o));
|
|
674
|
+
}
|
|
675
|
+
return n(s, i, o);
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
f(e, "~standard", () => ({
|
|
679
|
+
validate: (t) => {
|
|
680
|
+
try {
|
|
681
|
+
let n = xe(e, t);
|
|
682
|
+
return n.success ? { value: n.data } : { issues: n.error?.issues };
|
|
683
|
+
} catch {
|
|
684
|
+
return Se(e, t).then((e) => e.success ? { value: e.data } : { issues: e.error?.issues });
|
|
685
|
+
}
|
|
686
|
+
},
|
|
687
|
+
vendor: "zod",
|
|
688
|
+
version: 1
|
|
689
|
+
}));
|
|
690
|
+
}), N = /* @__PURE__ */ e("$ZodNumber", (e, t) => {
|
|
691
|
+
M.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? Me, e._zod.parse = (n, r) => {
|
|
692
|
+
if (t.coerce) try {
|
|
693
|
+
n.value = Number(n.value);
|
|
694
|
+
} catch {}
|
|
695
|
+
let i = n.value;
|
|
696
|
+
if (typeof i == "number" && !Number.isNaN(i) && Number.isFinite(i)) return n;
|
|
697
|
+
let a = typeof i == "number" ? Number.isNaN(i) ? "NaN" : Number.isFinite(i) ? void 0 : "Infinity" : void 0;
|
|
698
|
+
return n.issues.push({
|
|
699
|
+
expected: "number",
|
|
700
|
+
code: "invalid_type",
|
|
701
|
+
input: i,
|
|
702
|
+
inst: e,
|
|
703
|
+
...a ? { received: a } : {}
|
|
704
|
+
}), n;
|
|
705
|
+
};
|
|
706
|
+
}), Ve = /* @__PURE__ */ e("$ZodNumberFormat", (e, t) => {
|
|
707
|
+
Pe.init(e, t), N.init(e, t);
|
|
708
|
+
}), He = /* @__PURE__ */ e("$ZodUnknown", (e, t) => {
|
|
709
|
+
M.init(e, t), e._zod.parse = (e) => e;
|
|
710
|
+
}), Ue = /* @__PURE__ */ e("$ZodNever", (e, t) => {
|
|
711
|
+
M.init(e, t), e._zod.parse = (t, n) => (t.issues.push({
|
|
712
|
+
expected: "never",
|
|
713
|
+
code: "invalid_type",
|
|
714
|
+
input: t.value,
|
|
715
|
+
inst: e
|
|
716
|
+
}), t);
|
|
717
|
+
}), We = /* @__PURE__ */ e("$ZodDate", (e, t) => {
|
|
718
|
+
M.init(e, t), e._zod.parse = (n, r) => {
|
|
719
|
+
if (t.coerce) try {
|
|
720
|
+
n.value = new Date(n.value);
|
|
721
|
+
} catch {}
|
|
722
|
+
let i = n.value, a = i instanceof Date;
|
|
723
|
+
return a && !Number.isNaN(i.getTime()) || n.issues.push({
|
|
724
|
+
expected: "date",
|
|
725
|
+
code: "invalid_type",
|
|
726
|
+
input: i,
|
|
727
|
+
...a ? { received: "Invalid Date" } : {},
|
|
728
|
+
inst: e
|
|
729
|
+
}), n;
|
|
730
|
+
};
|
|
731
|
+
});
|
|
732
|
+
function P(e, t, n) {
|
|
733
|
+
e.issues.length && t.issues.push(...he(n, e.issues)), t.value[n] = e.value;
|
|
734
|
+
}
|
|
735
|
+
var Ge = /* @__PURE__ */ e("$ZodArray", (e, t) => {
|
|
736
|
+
M.init(e, t), e._zod.parse = (n, r) => {
|
|
737
|
+
let i = n.value;
|
|
738
|
+
if (!Array.isArray(i)) return n.issues.push({
|
|
739
|
+
expected: "array",
|
|
740
|
+
code: "invalid_type",
|
|
741
|
+
input: i,
|
|
742
|
+
inst: e
|
|
743
|
+
}), n;
|
|
744
|
+
n.value = Array(i.length);
|
|
745
|
+
let a = [];
|
|
746
|
+
for (let e = 0; e < i.length; e++) {
|
|
747
|
+
let o = i[e], s = t.element._zod.run({
|
|
748
|
+
value: o,
|
|
749
|
+
issues: []
|
|
750
|
+
}, r);
|
|
751
|
+
s instanceof Promise ? a.push(s.then((t) => P(t, n, e))) : P(s, n, e);
|
|
752
|
+
}
|
|
753
|
+
return a.length ? Promise.all(a).then(() => n) : n;
|
|
754
|
+
};
|
|
755
|
+
});
|
|
756
|
+
function F(e, t, n, r, i) {
|
|
757
|
+
if (e.issues.length) {
|
|
758
|
+
if (i && !(n in r)) return;
|
|
759
|
+
t.issues.push(...he(n, e.issues));
|
|
760
|
+
}
|
|
761
|
+
e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
|
|
762
|
+
}
|
|
763
|
+
function Ke(e) {
|
|
764
|
+
let t = Object.keys(e.shape);
|
|
765
|
+
for (let n of t) if (!e.shape?.[n]?._zod?.traits?.has("$ZodType")) throw Error(`Invalid element at key "${n}": expected a Zod schema`);
|
|
766
|
+
let n = oe(e.shape);
|
|
767
|
+
return {
|
|
768
|
+
...e,
|
|
769
|
+
keys: t,
|
|
770
|
+
keySet: new Set(t),
|
|
771
|
+
numKeys: t.length,
|
|
772
|
+
optionalKeys: new Set(n)
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
function qe(e, t, n, r, i, a) {
|
|
776
|
+
let o = [], s = i.keySet, c = i.catchall._zod, l = c.def.type, u = c.optout === "optional";
|
|
777
|
+
for (let i in t) {
|
|
778
|
+
if (s.has(i)) continue;
|
|
779
|
+
if (l === "never") {
|
|
780
|
+
o.push(i);
|
|
781
|
+
continue;
|
|
782
|
+
}
|
|
783
|
+
let a = c.run({
|
|
784
|
+
value: t[i],
|
|
785
|
+
issues: []
|
|
786
|
+
}, r);
|
|
787
|
+
a instanceof Promise ? e.push(a.then((e) => F(e, n, i, t, u))) : F(a, n, i, t, u);
|
|
788
|
+
}
|
|
789
|
+
return o.length && n.issues.push({
|
|
790
|
+
code: "unrecognized_keys",
|
|
791
|
+
keys: o,
|
|
792
|
+
input: t,
|
|
793
|
+
inst: a
|
|
794
|
+
}), e.length ? Promise.all(e).then(() => n) : n;
|
|
795
|
+
}
|
|
796
|
+
var Je = /* @__PURE__ */ e("$ZodObject", (e, t) => {
|
|
797
|
+
if (M.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
|
|
798
|
+
let e = t.shape;
|
|
799
|
+
Object.defineProperty(t, "shape", { get: () => {
|
|
800
|
+
let n = { ...e };
|
|
801
|
+
return Object.defineProperty(t, "shape", { value: n }), n;
|
|
802
|
+
} });
|
|
803
|
+
}
|
|
804
|
+
let n = s(() => Ke(t));
|
|
805
|
+
f(e._zod, "propValues", () => {
|
|
806
|
+
let e = t.shape, n = {};
|
|
807
|
+
for (let t in e) {
|
|
808
|
+
let r = e[t]._zod;
|
|
809
|
+
if (r.values) {
|
|
810
|
+
n[t] ?? (n[t] = /* @__PURE__ */ new Set());
|
|
811
|
+
for (let e of r.values) n[t].add(e);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
return n;
|
|
815
|
+
});
|
|
816
|
+
let r = h, i = t.catchall, a;
|
|
817
|
+
e._zod.parse = (t, o) => {
|
|
818
|
+
a ??= n.value;
|
|
819
|
+
let s = t.value;
|
|
820
|
+
if (!r(s)) return t.issues.push({
|
|
821
|
+
expected: "object",
|
|
822
|
+
code: "invalid_type",
|
|
823
|
+
input: s,
|
|
824
|
+
inst: e
|
|
825
|
+
}), t;
|
|
826
|
+
t.value = {};
|
|
827
|
+
let c = [], l = a.shape;
|
|
828
|
+
for (let e of a.keys) {
|
|
829
|
+
let n = l[e], r = n._zod.optout === "optional", i = n._zod.run({
|
|
830
|
+
value: s[e],
|
|
831
|
+
issues: []
|
|
832
|
+
}, o);
|
|
833
|
+
i instanceof Promise ? c.push(i.then((n) => F(n, t, e, s, r))) : F(i, t, e, s, r);
|
|
834
|
+
}
|
|
835
|
+
return i ? qe(c, s, t, o, n.value, e) : c.length ? Promise.all(c).then(() => t) : t;
|
|
836
|
+
};
|
|
837
|
+
}), Ye = /* @__PURE__ */ e("$ZodObjectJIT", (e, t) => {
|
|
838
|
+
Je.init(e, t);
|
|
839
|
+
let n = e._zod.parse, i = s(() => Ke(t)), a = (e) => {
|
|
840
|
+
let t = new ze([
|
|
841
|
+
"shape",
|
|
842
|
+
"payload",
|
|
843
|
+
"ctx"
|
|
844
|
+
]), n = i.value, r = (e) => {
|
|
845
|
+
let t = ee(e);
|
|
846
|
+
return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`;
|
|
847
|
+
};
|
|
848
|
+
t.write("const input = payload.value;");
|
|
849
|
+
let a = Object.create(null), o = 0;
|
|
850
|
+
for (let e of n.keys) a[e] = `key_${o++}`;
|
|
851
|
+
t.write("const newResult = {};");
|
|
852
|
+
for (let i of n.keys) {
|
|
853
|
+
let n = a[i], o = ee(i), s = e[i]?._zod?.optout === "optional";
|
|
854
|
+
t.write(`const ${n} = ${r(i)};`), s ? t.write(`
|
|
855
|
+
if (${n}.issues.length) {
|
|
856
|
+
if (${o} in input) {
|
|
857
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
858
|
+
...iss,
|
|
859
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
860
|
+
})));
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
if (${n}.value === undefined) {
|
|
865
|
+
if (${o} in input) {
|
|
866
|
+
newResult[${o}] = undefined;
|
|
867
|
+
}
|
|
868
|
+
} else {
|
|
869
|
+
newResult[${o}] = ${n}.value;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
`) : t.write(`
|
|
873
|
+
if (${n}.issues.length) {
|
|
874
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
875
|
+
...iss,
|
|
876
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
877
|
+
})));
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
if (${n}.value === undefined) {
|
|
881
|
+
if (${o} in input) {
|
|
882
|
+
newResult[${o}] = undefined;
|
|
883
|
+
}
|
|
884
|
+
} else {
|
|
885
|
+
newResult[${o}] = ${n}.value;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
`);
|
|
889
|
+
}
|
|
890
|
+
t.write("payload.value = newResult;"), t.write("return payload;");
|
|
891
|
+
let s = t.compile();
|
|
892
|
+
return (t, n) => s(e, t, n);
|
|
893
|
+
}, o, c = h, l = !r.jitless, u = l && ne.value, d = t.catchall, f;
|
|
894
|
+
e._zod.parse = (r, s) => {
|
|
895
|
+
f ??= i.value;
|
|
896
|
+
let p = r.value;
|
|
897
|
+
return c(p) ? l && u && s?.async === !1 && s.jitless !== !0 ? (o ||= a(t.shape), r = o(r, s), d ? qe([], p, r, s, f, e) : r) : n(r, s) : (r.issues.push({
|
|
898
|
+
expected: "object",
|
|
899
|
+
code: "invalid_type",
|
|
900
|
+
input: p,
|
|
901
|
+
inst: e
|
|
902
|
+
}), r);
|
|
903
|
+
};
|
|
904
|
+
});
|
|
905
|
+
function Xe(e, t, n, r) {
|
|
906
|
+
for (let n of e) if (n.issues.length === 0) return t.value = n.value, t;
|
|
907
|
+
let a = e.filter((e) => !y(e));
|
|
908
|
+
return a.length === 1 ? (t.value = a[0].value, a[0]) : (t.issues.push({
|
|
909
|
+
code: "invalid_union",
|
|
910
|
+
input: t.value,
|
|
911
|
+
inst: n,
|
|
912
|
+
errors: e.map((e) => e.issues.map((e) => x(e, r, i())))
|
|
913
|
+
}), t);
|
|
914
|
+
}
|
|
915
|
+
var Ze = /* @__PURE__ */ e("$ZodUnion", (e, t) => {
|
|
916
|
+
M.init(e, t), f(e._zod, "optin", () => t.options.some((e) => e._zod.optin === "optional") ? "optional" : void 0), f(e._zod, "optout", () => t.options.some((e) => e._zod.optout === "optional") ? "optional" : void 0), f(e._zod, "values", () => {
|
|
917
|
+
if (t.options.every((e) => e._zod.values)) return new Set(t.options.flatMap((e) => Array.from(e._zod.values)));
|
|
918
|
+
}), f(e._zod, "pattern", () => {
|
|
919
|
+
if (t.options.every((e) => e._zod.pattern)) {
|
|
920
|
+
let e = t.options.map((e) => e._zod.pattern);
|
|
921
|
+
return RegExp(`^(${e.map((e) => l(e.source)).join("|")})$`);
|
|
922
|
+
}
|
|
923
|
+
});
|
|
924
|
+
let n = t.options.length === 1, r = t.options[0]._zod.run;
|
|
925
|
+
e._zod.parse = (i, a) => {
|
|
926
|
+
if (n) return r(i, a);
|
|
927
|
+
let o = !1, s = [];
|
|
928
|
+
for (let e of t.options) {
|
|
929
|
+
let t = e._zod.run({
|
|
930
|
+
value: i.value,
|
|
931
|
+
issues: []
|
|
932
|
+
}, a);
|
|
933
|
+
if (t instanceof Promise) s.push(t), o = !0;
|
|
934
|
+
else {
|
|
935
|
+
if (t.issues.length === 0) return t;
|
|
936
|
+
s.push(t);
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
return o ? Promise.all(s).then((t) => Xe(t, i, e, a)) : Xe(s, i, e, a);
|
|
940
|
+
};
|
|
941
|
+
}), Qe = /* @__PURE__ */ e("$ZodIntersection", (e, t) => {
|
|
942
|
+
M.init(e, t), e._zod.parse = (e, n) => {
|
|
943
|
+
let r = e.value, i = t.left._zod.run({
|
|
944
|
+
value: r,
|
|
945
|
+
issues: []
|
|
946
|
+
}, n), a = t.right._zod.run({
|
|
947
|
+
value: r,
|
|
948
|
+
issues: []
|
|
949
|
+
}, n);
|
|
950
|
+
return i instanceof Promise || a instanceof Promise ? Promise.all([i, a]).then(([t, n]) => $e(e, t, n)) : $e(e, i, a);
|
|
951
|
+
};
|
|
952
|
+
});
|
|
953
|
+
function I(e, t) {
|
|
954
|
+
if (e === t || e instanceof Date && t instanceof Date && +e == +t) return {
|
|
955
|
+
valid: !0,
|
|
956
|
+
data: e
|
|
957
|
+
};
|
|
958
|
+
if (g(e) && g(t)) {
|
|
959
|
+
let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = {
|
|
960
|
+
...e,
|
|
961
|
+
...t
|
|
962
|
+
};
|
|
963
|
+
for (let n of r) {
|
|
964
|
+
let r = I(e[n], t[n]);
|
|
965
|
+
if (!r.valid) return {
|
|
966
|
+
valid: !1,
|
|
967
|
+
mergeErrorPath: [n, ...r.mergeErrorPath]
|
|
968
|
+
};
|
|
969
|
+
i[n] = r.data;
|
|
970
|
+
}
|
|
971
|
+
return {
|
|
972
|
+
valid: !0,
|
|
973
|
+
data: i
|
|
974
|
+
};
|
|
975
|
+
}
|
|
976
|
+
if (Array.isArray(e) && Array.isArray(t)) {
|
|
977
|
+
if (e.length !== t.length) return {
|
|
978
|
+
valid: !1,
|
|
979
|
+
mergeErrorPath: []
|
|
980
|
+
};
|
|
981
|
+
let n = [];
|
|
982
|
+
for (let r = 0; r < e.length; r++) {
|
|
983
|
+
let i = e[r], a = t[r], o = I(i, a);
|
|
984
|
+
if (!o.valid) return {
|
|
985
|
+
valid: !1,
|
|
986
|
+
mergeErrorPath: [r, ...o.mergeErrorPath]
|
|
987
|
+
};
|
|
988
|
+
n.push(o.data);
|
|
989
|
+
}
|
|
990
|
+
return {
|
|
991
|
+
valid: !0,
|
|
992
|
+
data: n
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
return {
|
|
996
|
+
valid: !1,
|
|
997
|
+
mergeErrorPath: []
|
|
998
|
+
};
|
|
999
|
+
}
|
|
1000
|
+
function $e(e, t, n) {
|
|
1001
|
+
let r = /* @__PURE__ */ new Map(), i;
|
|
1002
|
+
for (let n of t.issues) if (n.code === "unrecognized_keys") {
|
|
1003
|
+
i ??= n;
|
|
1004
|
+
for (let e of n.keys) r.has(e) || r.set(e, {}), r.get(e).l = !0;
|
|
1005
|
+
} else e.issues.push(n);
|
|
1006
|
+
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;
|
|
1007
|
+
else e.issues.push(t);
|
|
1008
|
+
let a = [...r].filter(([, e]) => e.l && e.r).map(([e]) => e);
|
|
1009
|
+
if (a.length && i && e.issues.push({
|
|
1010
|
+
...i,
|
|
1011
|
+
keys: a
|
|
1012
|
+
}), y(e)) return e;
|
|
1013
|
+
let o = I(t.value, n.value);
|
|
1014
|
+
if (!o.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);
|
|
1015
|
+
return e.value = o.data, e;
|
|
1016
|
+
}
|
|
1017
|
+
var et = /* @__PURE__ */ e("$ZodEnum", (e, t) => {
|
|
1018
|
+
M.init(e, t);
|
|
1019
|
+
let n = a(t.entries), r = new Set(n);
|
|
1020
|
+
e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) => ie.has(typeof e)).map((e) => typeof e == "string" ? ae(e) : e.toString()).join("|")})$`), e._zod.parse = (t, i) => {
|
|
1021
|
+
let a = t.value;
|
|
1022
|
+
return r.has(a) || t.issues.push({
|
|
1023
|
+
code: "invalid_value",
|
|
1024
|
+
values: n,
|
|
1025
|
+
input: a,
|
|
1026
|
+
inst: e
|
|
1027
|
+
}), t;
|
|
1028
|
+
};
|
|
1029
|
+
}), tt = /* @__PURE__ */ e("$ZodTransform", (e, r) => {
|
|
1030
|
+
M.init(e, r), e._zod.parse = (i, a) => {
|
|
1031
|
+
if (a.direction === "backward") throw new n(e.constructor.name);
|
|
1032
|
+
let o = r.transform(i.value, i);
|
|
1033
|
+
if (a.async) return (o instanceof Promise ? o : Promise.resolve(o)).then((e) => (i.value = e, i));
|
|
1034
|
+
if (o instanceof Promise) throw new t();
|
|
1035
|
+
return i.value = o, i;
|
|
1036
|
+
};
|
|
1037
|
+
});
|
|
1038
|
+
function nt(e, t) {
|
|
1039
|
+
return e.issues.length && t === void 0 ? {
|
|
1040
|
+
issues: [],
|
|
1041
|
+
value: void 0
|
|
1042
|
+
} : e;
|
|
1043
|
+
}
|
|
1044
|
+
var rt = /* @__PURE__ */ e("$ZodOptional", (e, t) => {
|
|
1045
|
+
M.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", f(e._zod, "values", () => t.innerType._zod.values ? new Set([...t.innerType._zod.values, void 0]) : void 0), f(e._zod, "pattern", () => {
|
|
1046
|
+
let e = t.innerType._zod.pattern;
|
|
1047
|
+
return e ? RegExp(`^(${l(e.source)})?$`) : void 0;
|
|
1048
|
+
}), e._zod.parse = (e, n) => {
|
|
1049
|
+
if (t.innerType._zod.optin === "optional") {
|
|
1050
|
+
let r = t.innerType._zod.run(e, n);
|
|
1051
|
+
return r instanceof Promise ? r.then((t) => nt(t, e.value)) : nt(r, e.value);
|
|
1052
|
+
}
|
|
1053
|
+
return e.value === void 0 ? e : t.innerType._zod.run(e, n);
|
|
1054
|
+
};
|
|
1055
|
+
}), it = /* @__PURE__ */ e("$ZodExactOptional", (e, t) => {
|
|
1056
|
+
rt.init(e, t), f(e._zod, "values", () => t.innerType._zod.values), f(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (e, n) => t.innerType._zod.run(e, n);
|
|
1057
|
+
}), at = /* @__PURE__ */ e("$ZodNullable", (e, t) => {
|
|
1058
|
+
M.init(e, t), f(e._zod, "optin", () => t.innerType._zod.optin), f(e._zod, "optout", () => t.innerType._zod.optout), f(e._zod, "pattern", () => {
|
|
1059
|
+
let e = t.innerType._zod.pattern;
|
|
1060
|
+
return e ? RegExp(`^(${l(e.source)}|null)$`) : void 0;
|
|
1061
|
+
}), f(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);
|
|
1062
|
+
}), ot = /* @__PURE__ */ e("$ZodDefault", (e, t) => {
|
|
1063
|
+
M.init(e, t), e._zod.optin = "optional", f(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
|
|
1064
|
+
if (n.direction === "backward") return t.innerType._zod.run(e, n);
|
|
1065
|
+
if (e.value === void 0) return e.value = t.defaultValue, e;
|
|
1066
|
+
let r = t.innerType._zod.run(e, n);
|
|
1067
|
+
return r instanceof Promise ? r.then((e) => st(e, t)) : st(r, t);
|
|
1068
|
+
};
|
|
1069
|
+
});
|
|
1070
|
+
function st(e, t) {
|
|
1071
|
+
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1072
|
+
}
|
|
1073
|
+
var ct = /* @__PURE__ */ e("$ZodPrefault", (e, t) => {
|
|
1074
|
+
M.init(e, t), e._zod.optin = "optional", f(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));
|
|
1075
|
+
}), lt = /* @__PURE__ */ e("$ZodNonOptional", (e, t) => {
|
|
1076
|
+
M.init(e, t), f(e._zod, "values", () => {
|
|
1077
|
+
let e = t.innerType._zod.values;
|
|
1078
|
+
return e ? new Set([...e].filter((e) => e !== void 0)) : void 0;
|
|
1079
|
+
}), e._zod.parse = (n, r) => {
|
|
1080
|
+
let i = t.innerType._zod.run(n, r);
|
|
1081
|
+
return i instanceof Promise ? i.then((t) => ut(t, e)) : ut(i, e);
|
|
1082
|
+
};
|
|
1083
|
+
});
|
|
1084
|
+
function ut(e, t) {
|
|
1085
|
+
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1086
|
+
code: "invalid_type",
|
|
1087
|
+
expected: "nonoptional",
|
|
1088
|
+
input: e.value,
|
|
1089
|
+
inst: t
|
|
1090
|
+
}), e;
|
|
1091
|
+
}
|
|
1092
|
+
var dt = /* @__PURE__ */ e("$ZodCatch", (e, t) => {
|
|
1093
|
+
M.init(e, t), f(e._zod, "optin", () => t.innerType._zod.optin), f(e._zod, "optout", () => t.innerType._zod.optout), f(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
|
|
1094
|
+
if (n.direction === "backward") return t.innerType._zod.run(e, n);
|
|
1095
|
+
let r = t.innerType._zod.run(e, n);
|
|
1096
|
+
return r instanceof Promise ? r.then((r) => (e.value = r.value, r.issues.length && (e.value = t.catchValue({
|
|
1097
|
+
...e,
|
|
1098
|
+
error: { issues: r.issues.map((e) => x(e, n, i())) },
|
|
1099
|
+
input: e.value
|
|
1100
|
+
}), e.issues = []), e)) : (e.value = r.value, r.issues.length && (e.value = t.catchValue({
|
|
1101
|
+
...e,
|
|
1102
|
+
error: { issues: r.issues.map((e) => x(e, n, i())) },
|
|
1103
|
+
input: e.value
|
|
1104
|
+
}), e.issues = []), e);
|
|
1105
|
+
};
|
|
1106
|
+
}), ft = /* @__PURE__ */ e("$ZodPipe", (e, t) => {
|
|
1107
|
+
M.init(e, t), f(e._zod, "values", () => t.in._zod.values), f(e._zod, "optin", () => t.in._zod.optin), f(e._zod, "optout", () => t.out._zod.optout), f(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (e, n) => {
|
|
1108
|
+
if (n.direction === "backward") {
|
|
1109
|
+
let r = t.out._zod.run(e, n);
|
|
1110
|
+
return r instanceof Promise ? r.then((e) => L(e, t.in, n)) : L(r, t.in, n);
|
|
1111
|
+
}
|
|
1112
|
+
let r = t.in._zod.run(e, n);
|
|
1113
|
+
return r instanceof Promise ? r.then((e) => L(e, t.out, n)) : L(r, t.out, n);
|
|
1114
|
+
};
|
|
1115
|
+
});
|
|
1116
|
+
function L(e, t, n) {
|
|
1117
|
+
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({
|
|
1118
|
+
value: e.value,
|
|
1119
|
+
issues: e.issues
|
|
1120
|
+
}, n);
|
|
1121
|
+
}
|
|
1122
|
+
var pt = /* @__PURE__ */ e("$ZodReadonly", (e, t) => {
|
|
1123
|
+
M.init(e, t), f(e._zod, "propValues", () => t.innerType._zod.propValues), f(e._zod, "values", () => t.innerType._zod.values), f(e._zod, "optin", () => t.innerType?._zod?.optin), f(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (e, n) => {
|
|
1124
|
+
if (n.direction === "backward") return t.innerType._zod.run(e, n);
|
|
1125
|
+
let r = t.innerType._zod.run(e, n);
|
|
1126
|
+
return r instanceof Promise ? r.then(mt) : mt(r);
|
|
1127
|
+
};
|
|
1128
|
+
});
|
|
1129
|
+
function mt(e) {
|
|
1130
|
+
return e.value = Object.freeze(e.value), e;
|
|
1131
|
+
}
|
|
1132
|
+
var ht = /* @__PURE__ */ e("$ZodCustom", (e, t) => {
|
|
1133
|
+
O.init(e, t), M.init(e, t), e._zod.parse = (e, t) => e, e._zod.check = (n) => {
|
|
1134
|
+
let r = n.value, i = t.fn(r);
|
|
1135
|
+
if (i instanceof Promise) return i.then((t) => gt(t, n, r, e));
|
|
1136
|
+
gt(i, n, r, e);
|
|
1137
|
+
};
|
|
1138
|
+
});
|
|
1139
|
+
function gt(e, t, n, r) {
|
|
1140
|
+
if (!e) {
|
|
1141
|
+
let e = {
|
|
1142
|
+
code: "custom",
|
|
1143
|
+
input: n,
|
|
1144
|
+
inst: r,
|
|
1145
|
+
path: [...r._zod.def.path ?? []],
|
|
1146
|
+
continue: !r._zod.def.abort
|
|
1147
|
+
};
|
|
1148
|
+
r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(C(e));
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
//#endregion
|
|
1152
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js
|
|
1153
|
+
var _t, vt = class {
|
|
1154
|
+
constructor() {
|
|
1155
|
+
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1156
|
+
}
|
|
1157
|
+
add(e, ...t) {
|
|
1158
|
+
let n = t[0];
|
|
1159
|
+
return this._map.set(e, n), n && typeof n == "object" && "id" in n && this._idmap.set(n.id, e), this;
|
|
1160
|
+
}
|
|
1161
|
+
clear() {
|
|
1162
|
+
return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
|
|
1163
|
+
}
|
|
1164
|
+
remove(e) {
|
|
1165
|
+
let t = this._map.get(e);
|
|
1166
|
+
return t && typeof t == "object" && "id" in t && this._idmap.delete(t.id), this._map.delete(e), this;
|
|
1167
|
+
}
|
|
1168
|
+
get(e) {
|
|
1169
|
+
let t = e._zod.parent;
|
|
1170
|
+
if (t) {
|
|
1171
|
+
let n = { ...this.get(t) ?? {} };
|
|
1172
|
+
delete n.id;
|
|
1173
|
+
let r = {
|
|
1174
|
+
...n,
|
|
1175
|
+
...this._map.get(e)
|
|
1176
|
+
};
|
|
1177
|
+
return Object.keys(r).length ? r : void 0;
|
|
1178
|
+
}
|
|
1179
|
+
return this._map.get(e);
|
|
1180
|
+
}
|
|
1181
|
+
has(e) {
|
|
1182
|
+
return this._map.has(e);
|
|
1183
|
+
}
|
|
1184
|
+
};
|
|
1185
|
+
function yt() {
|
|
1186
|
+
return new vt();
|
|
1187
|
+
}
|
|
1188
|
+
(_t = globalThis).__zod_globalRegistry ?? (_t.__zod_globalRegistry = yt());
|
|
1189
|
+
var R = globalThis.__zod_globalRegistry;
|
|
1190
|
+
//#endregion
|
|
1191
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js
|
|
1192
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1193
|
+
function bt(e, t) {
|
|
1194
|
+
return new e({
|
|
1195
|
+
type: "number",
|
|
1196
|
+
checks: [],
|
|
1197
|
+
...v(t)
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1201
|
+
function xt(e, t) {
|
|
1202
|
+
return new e({
|
|
1203
|
+
type: "number",
|
|
1204
|
+
check: "number_format",
|
|
1205
|
+
abort: !1,
|
|
1206
|
+
format: "safeint",
|
|
1207
|
+
...v(t)
|
|
1208
|
+
});
|
|
1209
|
+
}
|
|
1210
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1211
|
+
function St(e) {
|
|
1212
|
+
return new e({ type: "unknown" });
|
|
1213
|
+
}
|
|
1214
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1215
|
+
function Ct(e, t) {
|
|
1216
|
+
return new e({
|
|
1217
|
+
type: "never",
|
|
1218
|
+
...v(t)
|
|
1219
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1222
|
+
function wt(e, t) {
|
|
1223
|
+
return new e({
|
|
1224
|
+
type: "date",
|
|
1225
|
+
...v(t)
|
|
1226
|
+
});
|
|
1227
|
+
}
|
|
1228
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1229
|
+
function Tt(e, t) {
|
|
1230
|
+
return new A({
|
|
1231
|
+
check: "less_than",
|
|
1232
|
+
...v(t),
|
|
1233
|
+
value: e,
|
|
1234
|
+
inclusive: !1
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1238
|
+
function z(e, t) {
|
|
1239
|
+
return new A({
|
|
1240
|
+
check: "less_than",
|
|
1241
|
+
...v(t),
|
|
1242
|
+
value: e,
|
|
1243
|
+
inclusive: !0
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1246
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1247
|
+
function Et(e, t) {
|
|
1248
|
+
return new j({
|
|
1249
|
+
check: "greater_than",
|
|
1250
|
+
...v(t),
|
|
1251
|
+
value: e,
|
|
1252
|
+
inclusive: !1
|
|
1253
|
+
});
|
|
1254
|
+
}
|
|
1255
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1256
|
+
function B(e, t) {
|
|
1257
|
+
return new j({
|
|
1258
|
+
check: "greater_than",
|
|
1259
|
+
...v(t),
|
|
1260
|
+
value: e,
|
|
1261
|
+
inclusive: !0
|
|
1262
|
+
});
|
|
1263
|
+
}
|
|
1264
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1265
|
+
function Dt(e, t) {
|
|
1266
|
+
return new Ne({
|
|
1267
|
+
check: "multiple_of",
|
|
1268
|
+
...v(t),
|
|
1269
|
+
value: e
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1272
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1273
|
+
function Ot(e, t) {
|
|
1274
|
+
return new Fe({
|
|
1275
|
+
check: "max_length",
|
|
1276
|
+
...v(t),
|
|
1277
|
+
maximum: e
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1281
|
+
function kt(e, t) {
|
|
1282
|
+
return new Ie({
|
|
1283
|
+
check: "min_length",
|
|
1284
|
+
...v(t),
|
|
1285
|
+
minimum: e
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1289
|
+
function At(e, t) {
|
|
1290
|
+
return new Le({
|
|
1291
|
+
check: "length_equals",
|
|
1292
|
+
...v(t),
|
|
1293
|
+
length: e
|
|
1294
|
+
});
|
|
1295
|
+
}
|
|
1296
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1297
|
+
function jt(e) {
|
|
1298
|
+
return new Re({
|
|
1299
|
+
check: "overwrite",
|
|
1300
|
+
tx: e
|
|
1301
|
+
});
|
|
1302
|
+
}
|
|
1303
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1304
|
+
function Mt(e, t, n) {
|
|
1305
|
+
return new e({
|
|
1306
|
+
type: "array",
|
|
1307
|
+
element: t,
|
|
1308
|
+
...v(n)
|
|
1309
|
+
});
|
|
1310
|
+
}
|
|
1311
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1312
|
+
function Nt(e, t, n) {
|
|
1313
|
+
return new e({
|
|
1314
|
+
type: "custom",
|
|
1315
|
+
check: "custom",
|
|
1316
|
+
fn: t,
|
|
1317
|
+
...v(n)
|
|
1318
|
+
});
|
|
1319
|
+
}
|
|
1320
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1321
|
+
function Pt(e) {
|
|
1322
|
+
let t = /* @__PURE__ */ Ft((n) => (n.addIssue = (e) => {
|
|
1323
|
+
if (typeof e == "string") n.issues.push(C(e, n.value, t._zod.def));
|
|
1324
|
+
else {
|
|
1325
|
+
let r = e;
|
|
1326
|
+
r.fatal && (r.continue = !1), r.code ??= "custom", r.input ??= n.value, r.inst ??= t, r.continue ??= !t._zod.def.abort, n.issues.push(C(r));
|
|
1327
|
+
}
|
|
1328
|
+
}, e(n.value, n)));
|
|
1329
|
+
return t;
|
|
1330
|
+
}
|
|
1331
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1332
|
+
function Ft(e, t) {
|
|
1333
|
+
let n = new O({
|
|
1334
|
+
check: "custom",
|
|
1335
|
+
...v(t)
|
|
1336
|
+
});
|
|
1337
|
+
return n._zod.check = e, n;
|
|
1338
|
+
}
|
|
1339
|
+
//#endregion
|
|
1340
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js
|
|
1341
|
+
function It(e) {
|
|
1342
|
+
let t = e?.target ?? "draft-2020-12";
|
|
1343
|
+
return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
|
|
1344
|
+
processors: e.processors ?? {},
|
|
1345
|
+
metadataRegistry: e?.metadata ?? R,
|
|
1346
|
+
target: t,
|
|
1347
|
+
unrepresentable: e?.unrepresentable ?? "throw",
|
|
1348
|
+
override: e?.override ?? (() => {}),
|
|
1349
|
+
io: e?.io ?? "output",
|
|
1350
|
+
counter: 0,
|
|
1351
|
+
seen: /* @__PURE__ */ new Map(),
|
|
1352
|
+
cycles: e?.cycles ?? "ref",
|
|
1353
|
+
reused: e?.reused ?? "inline",
|
|
1354
|
+
external: e?.external ?? void 0
|
|
1355
|
+
};
|
|
1356
|
+
}
|
|
1357
|
+
function V(e, t, n = {
|
|
1358
|
+
path: [],
|
|
1359
|
+
schemaPath: []
|
|
1360
|
+
}) {
|
|
1361
|
+
var r;
|
|
1362
|
+
let i = e._zod.def, a = t.seen.get(e);
|
|
1363
|
+
if (a) return a.count++, n.schemaPath.includes(e) && (a.cycle = n.path), a.schema;
|
|
1364
|
+
let o = {
|
|
1365
|
+
schema: {},
|
|
1366
|
+
count: 1,
|
|
1367
|
+
cycle: void 0,
|
|
1368
|
+
path: n.path
|
|
1369
|
+
};
|
|
1370
|
+
t.seen.set(e, o);
|
|
1371
|
+
let s = e._zod.toJSONSchema?.();
|
|
1372
|
+
if (s) o.schema = s;
|
|
1373
|
+
else {
|
|
1374
|
+
let r = {
|
|
1375
|
+
...n,
|
|
1376
|
+
schemaPath: [...n.schemaPath, e],
|
|
1377
|
+
path: n.path
|
|
1378
|
+
};
|
|
1379
|
+
if (e._zod.processJSONSchema) e._zod.processJSONSchema(t, o.schema, r);
|
|
1380
|
+
else {
|
|
1381
|
+
let n = o.schema, a = t.processors[i.type];
|
|
1382
|
+
if (!a) throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);
|
|
1383
|
+
a(e, t, n, r);
|
|
1384
|
+
}
|
|
1385
|
+
let a = e._zod.parent;
|
|
1386
|
+
a && (o.ref ||= a, V(a, t, r), t.seen.get(a).isParent = !0);
|
|
1387
|
+
}
|
|
1388
|
+
let c = t.metadataRegistry.get(e);
|
|
1389
|
+
return c && Object.assign(o.schema, c), t.io === "input" && H(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;
|
|
1390
|
+
}
|
|
1391
|
+
function Lt(e, t) {
|
|
1392
|
+
let n = e.seen.get(t);
|
|
1393
|
+
if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
|
|
1394
|
+
let r = /* @__PURE__ */ new Map();
|
|
1395
|
+
for (let t of e.seen.entries()) {
|
|
1396
|
+
let n = e.metadataRegistry.get(t[0])?.id;
|
|
1397
|
+
if (n) {
|
|
1398
|
+
let e = r.get(n);
|
|
1399
|
+
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.`);
|
|
1400
|
+
r.set(n, t[0]);
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
let i = (t) => {
|
|
1404
|
+
let r = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
1405
|
+
if (e.external) {
|
|
1406
|
+
let n = e.external.registry.get(t[0])?.id, i = e.external.uri ?? ((e) => e);
|
|
1407
|
+
if (n) return { ref: i(n) };
|
|
1408
|
+
let a = t[1].defId ?? t[1].schema.id ?? `schema${e.counter++}`;
|
|
1409
|
+
return t[1].defId = a, {
|
|
1410
|
+
defId: a,
|
|
1411
|
+
ref: `${i("__shared")}#/${r}/${a}`
|
|
1412
|
+
};
|
|
1413
|
+
}
|
|
1414
|
+
if (t[1] === n) return { ref: "#" };
|
|
1415
|
+
let i = `#/${r}/`, a = t[1].schema.id ?? `__schema${e.counter++}`;
|
|
1416
|
+
return {
|
|
1417
|
+
defId: a,
|
|
1418
|
+
ref: i + a
|
|
1419
|
+
};
|
|
1420
|
+
}, a = (e) => {
|
|
1421
|
+
if (e[1].schema.$ref) return;
|
|
1422
|
+
let t = e[1], { ref: n, defId: r } = i(e);
|
|
1423
|
+
t.def = { ...t.schema }, r && (t.defId = r);
|
|
1424
|
+
let a = t.schema;
|
|
1425
|
+
for (let e in a) delete a[e];
|
|
1426
|
+
a.$ref = n;
|
|
1427
|
+
};
|
|
1428
|
+
if (e.cycles === "throw") for (let t of e.seen.entries()) {
|
|
1429
|
+
let e = t[1];
|
|
1430
|
+
if (e.cycle) throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
1431
|
+
|
|
1432
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
|
|
1433
|
+
}
|
|
1434
|
+
for (let n of e.seen.entries()) {
|
|
1435
|
+
let r = n[1];
|
|
1436
|
+
if (t === n[0]) {
|
|
1437
|
+
a(n);
|
|
1438
|
+
continue;
|
|
1439
|
+
}
|
|
1440
|
+
if (e.external) {
|
|
1441
|
+
let r = e.external.registry.get(n[0])?.id;
|
|
1442
|
+
if (t !== n[0] && r) {
|
|
1443
|
+
a(n);
|
|
1444
|
+
continue;
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
if (e.metadataRegistry.get(n[0])?.id) {
|
|
1448
|
+
a(n);
|
|
1449
|
+
continue;
|
|
1450
|
+
}
|
|
1451
|
+
if (r.cycle) {
|
|
1452
|
+
a(n);
|
|
1453
|
+
continue;
|
|
1454
|
+
}
|
|
1455
|
+
if (r.count > 1 && e.reused === "ref") {
|
|
1456
|
+
a(n);
|
|
1457
|
+
continue;
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
function Rt(e, t) {
|
|
1462
|
+
let n = e.seen.get(t);
|
|
1463
|
+
if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
|
|
1464
|
+
let r = (t) => {
|
|
1465
|
+
let n = e.seen.get(t);
|
|
1466
|
+
if (n.ref === null) return;
|
|
1467
|
+
let i = n.def ?? n.schema, a = { ...i }, o = n.ref;
|
|
1468
|
+
if (n.ref = null, o) {
|
|
1469
|
+
r(o);
|
|
1470
|
+
let n = e.seen.get(o), s = n.schema;
|
|
1471
|
+
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];
|
|
1472
|
+
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];
|
|
1473
|
+
}
|
|
1474
|
+
let s = t._zod.parent;
|
|
1475
|
+
if (s && s !== o) {
|
|
1476
|
+
r(s);
|
|
1477
|
+
let t = e.seen.get(s);
|
|
1478
|
+
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];
|
|
1479
|
+
}
|
|
1480
|
+
e.override({
|
|
1481
|
+
zodSchema: t,
|
|
1482
|
+
jsonSchema: i,
|
|
1483
|
+
path: n.path ?? []
|
|
1484
|
+
});
|
|
1485
|
+
};
|
|
1486
|
+
for (let t of [...e.seen.entries()].reverse()) r(t[0]);
|
|
1487
|
+
let i = {};
|
|
1488
|
+
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) {
|
|
1489
|
+
let n = e.external.registry.get(t)?.id;
|
|
1490
|
+
if (!n) throw Error("Schema is missing an `id` property");
|
|
1491
|
+
i.$id = e.external.uri(n);
|
|
1492
|
+
}
|
|
1493
|
+
Object.assign(i, n.def ?? n.schema);
|
|
1494
|
+
let a = e.external?.defs ?? {};
|
|
1495
|
+
for (let t of e.seen.entries()) {
|
|
1496
|
+
let e = t[1];
|
|
1497
|
+
e.def && e.defId && (a[e.defId] = e.def);
|
|
1498
|
+
}
|
|
1499
|
+
e.external || Object.keys(a).length > 0 && (e.target === "draft-2020-12" ? i.$defs = a : i.definitions = a);
|
|
1500
|
+
try {
|
|
1501
|
+
let n = JSON.parse(JSON.stringify(i));
|
|
1502
|
+
return Object.defineProperty(n, "~standard", {
|
|
1503
|
+
value: {
|
|
1504
|
+
...t["~standard"],
|
|
1505
|
+
jsonSchema: {
|
|
1506
|
+
input: U(t, "input", e.processors),
|
|
1507
|
+
output: U(t, "output", e.processors)
|
|
1508
|
+
}
|
|
1509
|
+
},
|
|
1510
|
+
enumerable: !1,
|
|
1511
|
+
writable: !1
|
|
1512
|
+
}), n;
|
|
1513
|
+
} catch {
|
|
1514
|
+
throw Error("Error converting schema to JSON.");
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
function H(e, t) {
|
|
1518
|
+
let n = t ?? { seen: /* @__PURE__ */ new Set() };
|
|
1519
|
+
if (n.seen.has(e)) return !1;
|
|
1520
|
+
n.seen.add(e);
|
|
1521
|
+
let r = e._zod.def;
|
|
1522
|
+
if (r.type === "transform") return !0;
|
|
1523
|
+
if (r.type === "array") return H(r.element, n);
|
|
1524
|
+
if (r.type === "set") return H(r.valueType, n);
|
|
1525
|
+
if (r.type === "lazy") return H(r.getter(), n);
|
|
1526
|
+
if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault") return H(r.innerType, n);
|
|
1527
|
+
if (r.type === "intersection") return H(r.left, n) || H(r.right, n);
|
|
1528
|
+
if (r.type === "record" || r.type === "map") return H(r.keyType, n) || H(r.valueType, n);
|
|
1529
|
+
if (r.type === "pipe") return H(r.in, n) || H(r.out, n);
|
|
1530
|
+
if (r.type === "object") {
|
|
1531
|
+
for (let e in r.shape) if (H(r.shape[e], n)) return !0;
|
|
1532
|
+
return !1;
|
|
1533
|
+
}
|
|
1534
|
+
if (r.type === "union") {
|
|
1535
|
+
for (let e of r.options) if (H(e, n)) return !0;
|
|
1536
|
+
return !1;
|
|
1537
|
+
}
|
|
1538
|
+
if (r.type === "tuple") {
|
|
1539
|
+
for (let e of r.items) if (H(e, n)) return !0;
|
|
1540
|
+
return !!(r.rest && H(r.rest, n));
|
|
1541
|
+
}
|
|
1542
|
+
return !1;
|
|
1543
|
+
}
|
|
1544
|
+
var zt = (e, t = {}) => (n) => {
|
|
1545
|
+
let r = It({
|
|
1546
|
+
...n,
|
|
1547
|
+
processors: t
|
|
1548
|
+
});
|
|
1549
|
+
return V(e, r), Lt(r, e), Rt(r, e);
|
|
1550
|
+
}, U = (e, t, n = {}) => (r) => {
|
|
1551
|
+
let { libraryOptions: i, target: a } = r ?? {}, o = It({
|
|
1552
|
+
...i ?? {},
|
|
1553
|
+
target: a,
|
|
1554
|
+
io: t,
|
|
1555
|
+
processors: n
|
|
1556
|
+
});
|
|
1557
|
+
return V(e, o), Lt(o, e), Rt(o, e);
|
|
1558
|
+
}, Bt = (e, t, n, r) => {
|
|
1559
|
+
let i = n, { minimum: a, maximum: o, format: s, multipleOf: c, exclusiveMaximum: l, exclusiveMinimum: u } = e._zod.bag;
|
|
1560
|
+
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);
|
|
1561
|
+
}, Vt = (e, t, n, r) => {
|
|
1562
|
+
n.not = {};
|
|
1563
|
+
}, Ht = (e, t, n, r) => {
|
|
1564
|
+
if (t.unrepresentable === "throw") throw Error("Date cannot be represented in JSON Schema");
|
|
1565
|
+
}, Ut = (e, t, n, r) => {
|
|
1566
|
+
let i = e._zod.def, o = a(i.entries);
|
|
1567
|
+
o.every((e) => typeof e == "number") && (n.type = "number"), o.every((e) => typeof e == "string") && (n.type = "string"), n.enum = o;
|
|
1568
|
+
}, Wt = (e, t, n, r) => {
|
|
1569
|
+
if (t.unrepresentable === "throw") throw Error("Custom types cannot be represented in JSON Schema");
|
|
1570
|
+
}, Gt = (e, t, n, r) => {
|
|
1571
|
+
if (t.unrepresentable === "throw") throw Error("Transforms cannot be represented in JSON Schema");
|
|
1572
|
+
}, Kt = (e, t, n, r) => {
|
|
1573
|
+
let i = n, a = e._zod.def, { minimum: o, maximum: s } = e._zod.bag;
|
|
1574
|
+
typeof o == "number" && (i.minItems = o), typeof s == "number" && (i.maxItems = s), i.type = "array", i.items = V(a.element, t, {
|
|
1575
|
+
...r,
|
|
1576
|
+
path: [...r.path, "items"]
|
|
1577
|
+
});
|
|
1578
|
+
}, qt = (e, t, n, r) => {
|
|
1579
|
+
let i = n, a = e._zod.def;
|
|
1580
|
+
i.type = "object", i.properties = {};
|
|
1581
|
+
let o = a.shape;
|
|
1582
|
+
for (let e in o) i.properties[e] = V(o[e], t, {
|
|
1583
|
+
...r,
|
|
1584
|
+
path: [
|
|
1585
|
+
...r.path,
|
|
1586
|
+
"properties",
|
|
1587
|
+
e
|
|
1588
|
+
]
|
|
1589
|
+
});
|
|
1590
|
+
let s = new Set(Object.keys(o)), c = new Set([...s].filter((e) => {
|
|
1591
|
+
let n = a.shape[e]._zod;
|
|
1592
|
+
return t.io === "input" ? n.optin === void 0 : n.optout === void 0;
|
|
1593
|
+
}));
|
|
1594
|
+
c.size > 0 && (i.required = Array.from(c)), a.catchall?._zod.def.type === "never" ? i.additionalProperties = !1 : a.catchall ? a.catchall && (i.additionalProperties = V(a.catchall, t, {
|
|
1595
|
+
...r,
|
|
1596
|
+
path: [...r.path, "additionalProperties"]
|
|
1597
|
+
})) : t.io === "output" && (i.additionalProperties = !1);
|
|
1598
|
+
}, Jt = (e, t, n, r) => {
|
|
1599
|
+
let i = e._zod.def, a = i.inclusive === !1, o = i.options.map((e, n) => V(e, t, {
|
|
1600
|
+
...r,
|
|
1601
|
+
path: [
|
|
1602
|
+
...r.path,
|
|
1603
|
+
a ? "oneOf" : "anyOf",
|
|
1604
|
+
n
|
|
1605
|
+
]
|
|
1606
|
+
}));
|
|
1607
|
+
a ? n.oneOf = o : n.anyOf = o;
|
|
1608
|
+
}, Yt = (e, t, n, r) => {
|
|
1609
|
+
let i = e._zod.def, a = V(i.left, t, {
|
|
1610
|
+
...r,
|
|
1611
|
+
path: [
|
|
1612
|
+
...r.path,
|
|
1613
|
+
"allOf",
|
|
1614
|
+
0
|
|
1615
|
+
]
|
|
1616
|
+
}), o = V(i.right, t, {
|
|
1617
|
+
...r,
|
|
1618
|
+
path: [
|
|
1619
|
+
...r.path,
|
|
1620
|
+
"allOf",
|
|
1621
|
+
1
|
|
1622
|
+
]
|
|
1623
|
+
}), s = (e) => "allOf" in e && Object.keys(e).length === 1;
|
|
1624
|
+
n.allOf = [...s(a) ? a.allOf : [a], ...s(o) ? o.allOf : [o]];
|
|
1625
|
+
}, Xt = (e, t, n, r) => {
|
|
1626
|
+
let i = e._zod.def, a = V(i.innerType, t, r), o = t.seen.get(e);
|
|
1627
|
+
t.target === "openapi-3.0" ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [a, { type: "null" }];
|
|
1628
|
+
}, Zt = (e, t, n, r) => {
|
|
1629
|
+
let i = e._zod.def;
|
|
1630
|
+
V(i.innerType, t, r);
|
|
1631
|
+
let a = t.seen.get(e);
|
|
1632
|
+
a.ref = i.innerType;
|
|
1633
|
+
}, Qt = (e, t, n, r) => {
|
|
1634
|
+
let i = e._zod.def;
|
|
1635
|
+
V(i.innerType, t, r);
|
|
1636
|
+
let a = t.seen.get(e);
|
|
1637
|
+
a.ref = i.innerType, n.default = JSON.parse(JSON.stringify(i.defaultValue));
|
|
1638
|
+
}, $t = (e, t, n, r) => {
|
|
1639
|
+
let i = e._zod.def;
|
|
1640
|
+
V(i.innerType, t, r);
|
|
1641
|
+
let a = t.seen.get(e);
|
|
1642
|
+
a.ref = i.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(i.defaultValue)));
|
|
1643
|
+
}, en = (e, t, n, r) => {
|
|
1644
|
+
let i = e._zod.def;
|
|
1645
|
+
V(i.innerType, t, r);
|
|
1646
|
+
let a = t.seen.get(e);
|
|
1647
|
+
a.ref = i.innerType;
|
|
1648
|
+
let o;
|
|
1649
|
+
try {
|
|
1650
|
+
o = i.catchValue(void 0);
|
|
1651
|
+
} catch {
|
|
1652
|
+
throw Error("Dynamic catch values are not supported in JSON Schema");
|
|
1653
|
+
}
|
|
1654
|
+
n.default = o;
|
|
1655
|
+
}, tn = (e, t, n, r) => {
|
|
1656
|
+
let i = e._zod.def, a = t.io === "input" ? i.in._zod.def.type === "transform" ? i.out : i.in : i.out;
|
|
1657
|
+
V(a, t, r);
|
|
1658
|
+
let o = t.seen.get(e);
|
|
1659
|
+
o.ref = a;
|
|
1660
|
+
}, nn = (e, t, n, r) => {
|
|
1661
|
+
let i = e._zod.def;
|
|
1662
|
+
V(i.innerType, t, r);
|
|
1663
|
+
let a = t.seen.get(e);
|
|
1664
|
+
a.ref = i.innerType, n.readOnly = !0;
|
|
1665
|
+
}, rn = (e, t, n, r) => {
|
|
1666
|
+
let i = e._zod.def;
|
|
1667
|
+
V(i.innerType, t, r);
|
|
1668
|
+
let a = t.seen.get(e);
|
|
1669
|
+
a.ref = i.innerType;
|
|
1670
|
+
}, an = (e, t) => {
|
|
1671
|
+
_e.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
1672
|
+
format: { value: (t) => be(e, t) },
|
|
1673
|
+
flatten: { value: (t) => ye(e, t) },
|
|
1674
|
+
addIssue: { value: (t) => {
|
|
1675
|
+
e.issues.push(t), e.message = JSON.stringify(e.issues, o, 2);
|
|
1676
|
+
} },
|
|
1677
|
+
addIssues: { value: (t) => {
|
|
1678
|
+
e.issues.push(...t), e.message = JSON.stringify(e.issues, o, 2);
|
|
1679
|
+
} },
|
|
1680
|
+
isEmpty: { get() {
|
|
1681
|
+
return e.issues.length === 0;
|
|
1682
|
+
} }
|
|
1683
|
+
});
|
|
1684
|
+
};
|
|
1685
|
+
e("ZodError", an);
|
|
1686
|
+
var W = e("ZodError", an, { Parent: Error }), on = /* @__PURE__ */ w(W), sn = /* @__PURE__ */ T(W), cn = /* @__PURE__ */ E(W), ln = /* @__PURE__ */ D(W), un = /* @__PURE__ */ Ce(W), dn = /* @__PURE__ */ we(W), fn = /* @__PURE__ */ Te(W), pn = /* @__PURE__ */ Ee(W), mn = /* @__PURE__ */ De(W), hn = /* @__PURE__ */ Oe(W), gn = /* @__PURE__ */ ke(W), _n = /* @__PURE__ */ Ae(W), G = /* @__PURE__ */ e("ZodType", (e, t) => (M.init(e, t), Object.assign(e["~standard"], { jsonSchema: {
|
|
1687
|
+
input: U(e, "input"),
|
|
1688
|
+
output: U(e, "output")
|
|
1689
|
+
} }), e.toJSONSchema = zt(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(m(t, { checks: [...t.checks ?? [], ...n.map((e) => typeof e == "function" ? { _zod: {
|
|
1690
|
+
check: e,
|
|
1691
|
+
def: { check: "custom" },
|
|
1692
|
+
onattach: []
|
|
1693
|
+
} } : e)] }), { parent: !0 }), e.with = e.check, e.clone = (t, n) => _(e, t, n), e.brand = () => e, e.register = ((t, n) => (t.add(e, n), e)), e.parse = (t, n) => on(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => cn(e, t, n), e.parseAsync = async (t, n) => sn(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => ln(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n) => un(e, t, n), e.decode = (t, n) => dn(e, t, n), e.encodeAsync = async (t, n) => fn(e, t, n), e.decodeAsync = async (t, n) => pn(e, t, n), e.safeEncode = (t, n) => mn(e, t, n), e.safeDecode = (t, n) => hn(e, t, n), e.safeEncodeAsync = async (t, n) => gn(e, t, n), e.safeDecodeAsync = async (t, n) => _n(e, t, n), e.refine = (t, n) => e.check(rr(t, n)), e.superRefine = (t) => e.check(ir(t)), e.overwrite = (t) => e.check(/* @__PURE__ */ jt(t)), e.optional = () => zn(e), e.exactOptional = () => Vn(e), e.nullable = () => Un(e), e.nullish = () => zn(Un(e)), e.nonoptional = (t) => Yn(e, t), e.array = () => kn(e), e.or = (t) => Nn([e, t]), e.and = (t) => Fn(e, t), e.transform = (t) => $n(e, Ln(t)), e.default = (t) => Gn(e, t), e.prefault = (t) => qn(e, t), e.catch = (t) => Zn(e, t), e.pipe = (t) => $n(e, t), e.readonly = () => tr(e), e.describe = (t) => {
|
|
1694
|
+
let n = e.clone();
|
|
1695
|
+
return R.add(n, { description: t }), n;
|
|
1696
|
+
}, Object.defineProperty(e, "description", {
|
|
1697
|
+
get() {
|
|
1698
|
+
return R.get(e)?.description;
|
|
1699
|
+
},
|
|
1700
|
+
configurable: !0
|
|
1701
|
+
}), e.meta = (...t) => {
|
|
1702
|
+
if (t.length === 0) return R.get(e);
|
|
1703
|
+
let n = e.clone();
|
|
1704
|
+
return R.add(n, t[0]), n;
|
|
1705
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (t) => t(e), e)), vn = /* @__PURE__ */ e("ZodNumber", (e, t) => {
|
|
1706
|
+
N.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => Bt(e, t, n, r), e.gt = (t, n) => e.check(/* @__PURE__ */ Et(t, n)), e.gte = (t, n) => e.check(/* @__PURE__ */ B(t, n)), e.min = (t, n) => e.check(/* @__PURE__ */ B(t, n)), e.lt = (t, n) => e.check(/* @__PURE__ */ Tt(t, n)), e.lte = (t, n) => e.check(/* @__PURE__ */ z(t, n)), e.max = (t, n) => e.check(/* @__PURE__ */ z(t, n)), e.int = (t) => e.check(xn(t)), e.safe = (t) => e.check(xn(t)), e.positive = (t) => e.check(/* @__PURE__ */ Et(0, t)), e.nonnegative = (t) => e.check(/* @__PURE__ */ B(0, t)), e.negative = (t) => e.check(/* @__PURE__ */ Tt(0, t)), e.nonpositive = (t) => e.check(/* @__PURE__ */ z(0, t)), e.multipleOf = (t, n) => e.check(/* @__PURE__ */ Dt(t, n)), e.step = (t, n) => e.check(/* @__PURE__ */ Dt(t, n)), e.finite = () => e;
|
|
1707
|
+
let n = e._zod.bag;
|
|
1708
|
+
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;
|
|
1709
|
+
});
|
|
1710
|
+
function yn(e) {
|
|
1711
|
+
return /* @__PURE__ */ bt(vn, e);
|
|
1712
|
+
}
|
|
1713
|
+
var bn = /* @__PURE__ */ e("ZodNumberFormat", (e, t) => {
|
|
1714
|
+
Ve.init(e, t), vn.init(e, t);
|
|
1715
|
+
});
|
|
1716
|
+
function xn(e) {
|
|
1717
|
+
return /* @__PURE__ */ xt(bn, e);
|
|
1718
|
+
}
|
|
1719
|
+
var Sn = /* @__PURE__ */ e("ZodUnknown", (e, t) => {
|
|
1720
|
+
He.init(e, t), G.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0;
|
|
1721
|
+
});
|
|
1722
|
+
function Cn() {
|
|
1723
|
+
return /* @__PURE__ */ St(Sn);
|
|
1724
|
+
}
|
|
1725
|
+
var wn = /* @__PURE__ */ e("ZodNever", (e, t) => {
|
|
1726
|
+
Ue.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => Vt(e, t, n, r);
|
|
1727
|
+
});
|
|
1728
|
+
function Tn(e) {
|
|
1729
|
+
return /* @__PURE__ */ Ct(wn, e);
|
|
1730
|
+
}
|
|
1731
|
+
var En = /* @__PURE__ */ e("ZodDate", (e, t) => {
|
|
1732
|
+
We.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ht(e, t, n, r), e.min = (t, n) => e.check(/* @__PURE__ */ B(t, n)), e.max = (t, n) => e.check(/* @__PURE__ */ z(t, n));
|
|
1733
|
+
let n = e._zod.bag;
|
|
1734
|
+
e.minDate = n.minimum ? new Date(n.minimum) : null, e.maxDate = n.maximum ? new Date(n.maximum) : null;
|
|
1735
|
+
});
|
|
1736
|
+
function Dn(e) {
|
|
1737
|
+
return /* @__PURE__ */ wt(En, e);
|
|
1738
|
+
}
|
|
1739
|
+
var On = /* @__PURE__ */ e("ZodArray", (e, t) => {
|
|
1740
|
+
Ge.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => Kt(e, t, n, r), e.element = t.element, e.min = (t, n) => e.check(/* @__PURE__ */ kt(t, n)), e.nonempty = (t) => e.check(/* @__PURE__ */ kt(1, t)), e.max = (t, n) => e.check(/* @__PURE__ */ Ot(t, n)), e.length = (t, n) => e.check(/* @__PURE__ */ At(t, n)), e.unwrap = () => e.element;
|
|
1741
|
+
});
|
|
1742
|
+
function kn(e, t) {
|
|
1743
|
+
return /* @__PURE__ */ Mt(On, e, t);
|
|
1744
|
+
}
|
|
1745
|
+
var An = /* @__PURE__ */ e("ZodObject", (e, t) => {
|
|
1746
|
+
Ye.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => qt(e, t, n, r), f(e, "shape", () => t.shape), e.keyof = () => q(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({
|
|
1747
|
+
...e._zod.def,
|
|
1748
|
+
catchall: t
|
|
1749
|
+
}), e.passthrough = () => e.clone({
|
|
1750
|
+
...e._zod.def,
|
|
1751
|
+
catchall: Cn()
|
|
1752
|
+
}), e.loose = () => e.clone({
|
|
1753
|
+
...e._zod.def,
|
|
1754
|
+
catchall: Cn()
|
|
1755
|
+
}), e.strict = () => e.clone({
|
|
1756
|
+
...e._zod.def,
|
|
1757
|
+
catchall: Tn()
|
|
1758
|
+
}), e.strip = () => e.clone({
|
|
1759
|
+
...e._zod.def,
|
|
1760
|
+
catchall: void 0
|
|
1761
|
+
}), e.extend = (t) => ue(e, t), e.safeExtend = (t) => de(e, t), e.merge = (t) => fe(e, t), e.pick = (t) => ce(e, t), e.omit = (t) => le(e, t), e.partial = (...t) => pe(Rn, e, t[0]), e.required = (...t) => me(Jn, e, t[0]);
|
|
1762
|
+
});
|
|
1763
|
+
function jn(e, t) {
|
|
1764
|
+
return new An({
|
|
1765
|
+
type: "object",
|
|
1766
|
+
shape: e ?? {},
|
|
1767
|
+
...v(t)
|
|
1768
|
+
});
|
|
1769
|
+
}
|
|
1770
|
+
var Mn = /* @__PURE__ */ e("ZodUnion", (e, t) => {
|
|
1771
|
+
Ze.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => Jt(e, t, n, r), e.options = t.options;
|
|
1772
|
+
});
|
|
1773
|
+
function Nn(e, t) {
|
|
1774
|
+
return new Mn({
|
|
1775
|
+
type: "union",
|
|
1776
|
+
options: e,
|
|
1777
|
+
...v(t)
|
|
1778
|
+
});
|
|
1779
|
+
}
|
|
1780
|
+
var Pn = /* @__PURE__ */ e("ZodIntersection", (e, t) => {
|
|
1781
|
+
Qe.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => Yt(e, t, n, r);
|
|
1782
|
+
});
|
|
1783
|
+
function Fn(e, t) {
|
|
1784
|
+
return new Pn({
|
|
1785
|
+
type: "intersection",
|
|
1786
|
+
left: e,
|
|
1787
|
+
right: t
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1790
|
+
var K = /* @__PURE__ */ e("ZodEnum", (e, t) => {
|
|
1791
|
+
et.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ut(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
1792
|
+
let n = new Set(Object.keys(t.entries));
|
|
1793
|
+
e.extract = (e, r) => {
|
|
1794
|
+
let i = {};
|
|
1795
|
+
for (let r of e) if (n.has(r)) i[r] = t.entries[r];
|
|
1796
|
+
else throw Error(`Key ${r} not found in enum`);
|
|
1797
|
+
return new K({
|
|
1798
|
+
...t,
|
|
1799
|
+
checks: [],
|
|
1800
|
+
...v(r),
|
|
1801
|
+
entries: i
|
|
1802
|
+
});
|
|
1803
|
+
}, e.exclude = (e, r) => {
|
|
1804
|
+
let i = { ...t.entries };
|
|
1805
|
+
for (let t of e) if (n.has(t)) delete i[t];
|
|
1806
|
+
else throw Error(`Key ${t} not found in enum`);
|
|
1807
|
+
return new K({
|
|
1808
|
+
...t,
|
|
1809
|
+
checks: [],
|
|
1810
|
+
...v(r),
|
|
1811
|
+
entries: i
|
|
1812
|
+
});
|
|
1813
|
+
};
|
|
1814
|
+
});
|
|
1815
|
+
function q(e, t) {
|
|
1816
|
+
return new K({
|
|
1817
|
+
type: "enum",
|
|
1818
|
+
entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e,
|
|
1819
|
+
...v(t)
|
|
1820
|
+
});
|
|
1821
|
+
}
|
|
1822
|
+
var In = /* @__PURE__ */ e("ZodTransform", (e, t) => {
|
|
1823
|
+
tt.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => Gt(e, t, n, r), e._zod.parse = (r, i) => {
|
|
1824
|
+
if (i.direction === "backward") throw new n(e.constructor.name);
|
|
1825
|
+
r.addIssue = (n) => {
|
|
1826
|
+
if (typeof n == "string") r.issues.push(C(n, r.value, t));
|
|
1827
|
+
else {
|
|
1828
|
+
let t = n;
|
|
1829
|
+
t.fatal && (t.continue = !1), t.code ??= "custom", t.input ??= r.value, t.inst ??= e, r.issues.push(C(t));
|
|
1830
|
+
}
|
|
1831
|
+
};
|
|
1832
|
+
let a = t.transform(r.value, r);
|
|
1833
|
+
return a instanceof Promise ? a.then((e) => (r.value = e, r)) : (r.value = a, r);
|
|
1834
|
+
};
|
|
1835
|
+
});
|
|
1836
|
+
function Ln(e) {
|
|
1837
|
+
return new In({
|
|
1838
|
+
type: "transform",
|
|
1839
|
+
transform: e
|
|
1840
|
+
});
|
|
1841
|
+
}
|
|
1842
|
+
var Rn = /* @__PURE__ */ e("ZodOptional", (e, t) => {
|
|
1843
|
+
rt.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => rn(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
1844
|
+
});
|
|
1845
|
+
function zn(e) {
|
|
1846
|
+
return new Rn({
|
|
1847
|
+
type: "optional",
|
|
1848
|
+
innerType: e
|
|
1849
|
+
});
|
|
1850
|
+
}
|
|
1851
|
+
var Bn = /* @__PURE__ */ e("ZodExactOptional", (e, t) => {
|
|
1852
|
+
it.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => rn(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
1853
|
+
});
|
|
1854
|
+
function Vn(e) {
|
|
1855
|
+
return new Bn({
|
|
1856
|
+
type: "optional",
|
|
1857
|
+
innerType: e
|
|
1858
|
+
});
|
|
1859
|
+
}
|
|
1860
|
+
var Hn = /* @__PURE__ */ e("ZodNullable", (e, t) => {
|
|
1861
|
+
at.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => Xt(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
1862
|
+
});
|
|
1863
|
+
function Un(e) {
|
|
1864
|
+
return new Hn({
|
|
1865
|
+
type: "nullable",
|
|
1866
|
+
innerType: e
|
|
1867
|
+
});
|
|
1868
|
+
}
|
|
1869
|
+
var Wn = /* @__PURE__ */ e("ZodDefault", (e, t) => {
|
|
1870
|
+
ot.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => Qt(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
1871
|
+
});
|
|
1872
|
+
function Gn(e, t) {
|
|
1873
|
+
return new Wn({
|
|
1874
|
+
type: "default",
|
|
1875
|
+
innerType: e,
|
|
1876
|
+
get defaultValue() {
|
|
1877
|
+
return typeof t == "function" ? t() : re(t);
|
|
1878
|
+
}
|
|
1879
|
+
});
|
|
1880
|
+
}
|
|
1881
|
+
var Kn = /* @__PURE__ */ e("ZodPrefault", (e, t) => {
|
|
1882
|
+
ct.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => $t(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
1883
|
+
});
|
|
1884
|
+
function qn(e, t) {
|
|
1885
|
+
return new Kn({
|
|
1886
|
+
type: "prefault",
|
|
1887
|
+
innerType: e,
|
|
1888
|
+
get defaultValue() {
|
|
1889
|
+
return typeof t == "function" ? t() : re(t);
|
|
1890
|
+
}
|
|
1891
|
+
});
|
|
1892
|
+
}
|
|
1893
|
+
var Jn = /* @__PURE__ */ e("ZodNonOptional", (e, t) => {
|
|
1894
|
+
lt.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => Zt(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
1895
|
+
});
|
|
1896
|
+
function Yn(e, t) {
|
|
1897
|
+
return new Jn({
|
|
1898
|
+
type: "nonoptional",
|
|
1899
|
+
innerType: e,
|
|
1900
|
+
...v(t)
|
|
1901
|
+
});
|
|
1902
|
+
}
|
|
1903
|
+
var Xn = /* @__PURE__ */ e("ZodCatch", (e, t) => {
|
|
1904
|
+
dt.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => en(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
1905
|
+
});
|
|
1906
|
+
function Zn(e, t) {
|
|
1907
|
+
return new Xn({
|
|
1908
|
+
type: "catch",
|
|
1909
|
+
innerType: e,
|
|
1910
|
+
catchValue: typeof t == "function" ? t : () => t
|
|
1911
|
+
});
|
|
1912
|
+
}
|
|
1913
|
+
var Qn = /* @__PURE__ */ e("ZodPipe", (e, t) => {
|
|
1914
|
+
ft.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => tn(e, t, n, r), e.in = t.in, e.out = t.out;
|
|
1915
|
+
});
|
|
1916
|
+
function $n(e, t) {
|
|
1917
|
+
return new Qn({
|
|
1918
|
+
type: "pipe",
|
|
1919
|
+
in: e,
|
|
1920
|
+
out: t
|
|
1921
|
+
});
|
|
1922
|
+
}
|
|
1923
|
+
var er = /* @__PURE__ */ e("ZodReadonly", (e, t) => {
|
|
1924
|
+
pt.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => nn(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
1925
|
+
});
|
|
1926
|
+
function tr(e) {
|
|
1927
|
+
return new er({
|
|
1928
|
+
type: "readonly",
|
|
1929
|
+
innerType: e
|
|
1930
|
+
});
|
|
1931
|
+
}
|
|
1932
|
+
var nr = /* @__PURE__ */ e("ZodCustom", (e, t) => {
|
|
1933
|
+
ht.init(e, t), G.init(e, t), e._zod.processJSONSchema = (t, n, r) => Wt(e, t, n, r);
|
|
1934
|
+
});
|
|
1935
|
+
function rr(e, t = {}) {
|
|
1936
|
+
return /* @__PURE__ */ Nt(nr, e, t);
|
|
1937
|
+
}
|
|
1938
|
+
function ir(e) {
|
|
1939
|
+
return /* @__PURE__ */ Pt(e);
|
|
1940
|
+
}
|
|
1941
|
+
//#endregion
|
|
1942
|
+
//#region src/components/DateTimePicker/DateTimeUtils.ts
|
|
1943
|
+
var ar = q([
|
|
1944
|
+
"minutes",
|
|
1945
|
+
"hours",
|
|
1946
|
+
"12hours"
|
|
1947
|
+
]), or = q(["AM", "PM"]), sr = q(["12", "24"]), cr = jn({
|
|
1948
|
+
hours: yn().min(0).max(23),
|
|
1949
|
+
minutes: yn().min(0).max(59)
|
|
1950
|
+
}), lr = jn({
|
|
1951
|
+
date: Dn().optional(),
|
|
1952
|
+
hourFormat: sr.default("12"),
|
|
1953
|
+
period: or.optional()
|
|
1954
|
+
}), ur = {
|
|
1955
|
+
hours12: "Hours (1-12)",
|
|
1956
|
+
hours24: "Hours",
|
|
1957
|
+
minutes: "Minutes",
|
|
1958
|
+
selectPeriodTemplate: "Select {am} or {pm}",
|
|
1959
|
+
timePicker12Hour: "Time picker (12-hour format)",
|
|
1960
|
+
timePicker24Hour: "Time picker (24-hour format)",
|
|
1961
|
+
timeValue: "Time value"
|
|
1962
|
+
}, dr = (e, t) => t.replace("{am}", e.am).replace("{pm}", e.pm), fr = {
|
|
1963
|
+
HOURS: "hours",
|
|
1964
|
+
HOURS_12: "12hours",
|
|
1965
|
+
MINUTES: "minutes"
|
|
1966
|
+
}, J = {
|
|
1967
|
+
HOURS_24: {
|
|
1968
|
+
min: 0,
|
|
1969
|
+
max: 23
|
|
1970
|
+
},
|
|
1971
|
+
HOURS_12: {
|
|
1972
|
+
min: 1,
|
|
1973
|
+
max: 12
|
|
1974
|
+
},
|
|
1975
|
+
MINUTES: {
|
|
1976
|
+
min: 0,
|
|
1977
|
+
max: 59
|
|
1978
|
+
}
|
|
1979
|
+
}, pr = (e) => {
|
|
1980
|
+
if (e) return e;
|
|
1981
|
+
try {
|
|
1982
|
+
return Intl.DateTimeFormat().resolvedOptions().locale;
|
|
1983
|
+
} catch {
|
|
1984
|
+
return typeof navigator < "u" && navigator.language ? navigator.language : "en-US";
|
|
1985
|
+
}
|
|
1986
|
+
}, mr = (e) => {
|
|
1987
|
+
try {
|
|
1988
|
+
return new Intl.DateTimeFormat(e, {
|
|
1989
|
+
hour: "numeric",
|
|
1990
|
+
hour12: void 0
|
|
1991
|
+
}).formatToParts(new Date(2e3, 0, 1, 13, 0, 0)).some((e) => e.type === "dayPeriod") ? "12" : "24";
|
|
1992
|
+
} catch {
|
|
1993
|
+
return "12";
|
|
1994
|
+
}
|
|
1995
|
+
}, hr = (e) => {
|
|
1996
|
+
try {
|
|
1997
|
+
let t = new Intl.DateTimeFormat(e, {
|
|
1998
|
+
hour: "numeric",
|
|
1999
|
+
hour12: !0
|
|
2000
|
+
}), n = t.formatToParts(new Date(2e3, 0, 1, 0, 0, 0)).find((e) => e.type === "dayPeriod"), r = t.formatToParts(new Date(2e3, 0, 1, 12, 0, 0)).find((e) => e.type === "dayPeriod");
|
|
2001
|
+
return {
|
|
2002
|
+
am: n?.value ?? "AM",
|
|
2003
|
+
pm: r?.value ?? "PM"
|
|
2004
|
+
};
|
|
2005
|
+
} catch {
|
|
2006
|
+
return {
|
|
2007
|
+
am: "AM",
|
|
2008
|
+
pm: "PM"
|
|
2009
|
+
};
|
|
2010
|
+
}
|
|
2011
|
+
}, gr = (e, t) => e === "AM" ? t.am : t.pm, _r = (e, t) => {
|
|
2012
|
+
try {
|
|
2013
|
+
return new Intl.NumberFormat(t, {
|
|
2014
|
+
minimumIntegerDigits: 2,
|
|
2015
|
+
useGrouping: !1
|
|
2016
|
+
}).format(e);
|
|
2017
|
+
} catch {
|
|
2018
|
+
return e.toString().padStart(2, "0");
|
|
2019
|
+
}
|
|
2020
|
+
}, vr = (e) => /^(0[0-9]|1[0-9]|2[0-3])$/.test(e), Y = (e) => /^(0[1-9]|1[0-2])$/.test(e), yr = (e) => /^[0-5][0-9]$/.test(e), X = (e, { max: t, min: n = 0, loop: r = !1 }) => {
|
|
2021
|
+
let i = parseInt(e, 10);
|
|
2022
|
+
return isNaN(i) ? n.toString().padStart(2, "0") : (r ? i > t ? i = n : i < n && (i = t) : i = Math.min(Math.max(i, n), t), i.toString().padStart(2, "0"));
|
|
2023
|
+
}, Z = (e) => vr(e) ? e : X(e, J.HOURS_24), br = (e) => Y(e) ? e : X(e, J.HOURS_12), Q = (e) => yr(e) ? e : X(e, J.MINUTES), $ = (e, { min: t, max: n, step: r }) => {
|
|
2024
|
+
let i = parseInt(e, 10);
|
|
2025
|
+
return isNaN(i) ? t.toString().padStart(2, "0") : X(String(i + r), {
|
|
2026
|
+
min: t,
|
|
2027
|
+
max: n,
|
|
2028
|
+
loop: !0
|
|
2029
|
+
});
|
|
2030
|
+
}, xr = (e, t) => $(e, {
|
|
2031
|
+
...J.HOURS_24,
|
|
2032
|
+
step: t
|
|
2033
|
+
}), Sr = (e, t) => $(e, {
|
|
2034
|
+
...J.HOURS_12,
|
|
2035
|
+
step: t
|
|
2036
|
+
}), Cr = (e, t) => $(e, {
|
|
2037
|
+
...J.MINUTES,
|
|
2038
|
+
step: t
|
|
2039
|
+
}), wr = (e, t) => {
|
|
2040
|
+
let n = new Date(e.getTime()), r = Q(t);
|
|
2041
|
+
return n.setMinutes(parseInt(r, 10)), n;
|
|
2042
|
+
}, Tr = (e, t) => {
|
|
2043
|
+
let n = new Date(e.getTime()), r = Z(t);
|
|
2044
|
+
return n.setHours(parseInt(r, 10)), n;
|
|
2045
|
+
}, Er = (e, t, n) => {
|
|
2046
|
+
let r = new Date(e.getTime()), i = Ar(parseInt(br(t), 10), n);
|
|
2047
|
+
return r.setHours(i), r;
|
|
2048
|
+
}, Dr = (e, t, n, r) => {
|
|
2049
|
+
switch (t) {
|
|
2050
|
+
case "minutes": return wr(e, n);
|
|
2051
|
+
case "hours": return Tr(e, n);
|
|
2052
|
+
case "12hours": return r ? Er(e, n, r) : new Date(e.getTime());
|
|
2053
|
+
default: return new Date(e.getTime());
|
|
2054
|
+
}
|
|
2055
|
+
}, Or = (e, t) => {
|
|
2056
|
+
switch (t) {
|
|
2057
|
+
case "minutes": return Q(String(e.getMinutes()));
|
|
2058
|
+
case "hours": return Z(String(e.getHours()));
|
|
2059
|
+
case "12hours": return jr(e.getHours());
|
|
2060
|
+
default: return "00";
|
|
2061
|
+
}
|
|
2062
|
+
}, kr = (e, t, n) => {
|
|
2063
|
+
switch (t) {
|
|
2064
|
+
case "minutes": return Cr(n, e);
|
|
2065
|
+
case "hours": return xr(n, e);
|
|
2066
|
+
case "12hours": return Sr(n, e);
|
|
2067
|
+
default: return "00";
|
|
2068
|
+
}
|
|
2069
|
+
}, Ar = (e, t) => t === "PM" ? e === 12 ? 12 : e + 12 : e === 12 ? 0 : e, jr = (e) => e === 0 || e === 12 ? "12" : (e % 12).toString().padStart(2, "0"), Mr = (e) => e >= 12 ? "PM" : "AM", Nr = (e, t) => {
|
|
2070
|
+
switch (t) {
|
|
2071
|
+
case "minutes": return e.getMinutes();
|
|
2072
|
+
case "hours": return e.getHours();
|
|
2073
|
+
case "12hours": {
|
|
2074
|
+
let t = e.getHours();
|
|
2075
|
+
return t === 0 ? 12 : t > 12 ? t - 12 : t;
|
|
2076
|
+
}
|
|
2077
|
+
default: return 0;
|
|
2078
|
+
}
|
|
2079
|
+
}, Pr = (e) => {
|
|
2080
|
+
switch (e) {
|
|
2081
|
+
case "minutes": return J.MINUTES;
|
|
2082
|
+
case "hours": return J.HOURS_24;
|
|
2083
|
+
case "12hours": return J.HOURS_12;
|
|
2084
|
+
default: return {
|
|
2085
|
+
min: 0,
|
|
2086
|
+
max: 0
|
|
2087
|
+
};
|
|
2088
|
+
}
|
|
2089
|
+
}, Fr = (e, t = ur) => {
|
|
2090
|
+
switch (e) {
|
|
2091
|
+
case "minutes": return t.minutes;
|
|
2092
|
+
case "hours": return t.hours24;
|
|
2093
|
+
case "12hours": return t.hours12;
|
|
2094
|
+
default: return t.timeValue;
|
|
2095
|
+
}
|
|
2096
|
+
};
|
|
2097
|
+
//#endregion
|
|
2098
|
+
export { X as A, br as C, $ as D, Cr as E, Dr as F, Tr as I, wr as L, vr as M, yr as N, Z as O, Er as P, pr as S, xr as T, kr as _, or as a, hr as b, cr as c, jr as d, dr as f, Nr as g, Pr as h, fr as i, Y as j, Q as k, Ar as l, Fr as m, lr as n, J as o, _r as p, sr as r, ar as s, ur as t, mr as u, Or as v, Sr as w, Mr as x, gr as y };
|