@hiai-gg/docsmint 1.0.3 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/README.md +19 -4
  2. package/dist/backend/index.js +14297 -12972
  3. package/dist/frontend/{CategoryDialog-B1yQFy54.js → CategoryDialog-CJeAYxcd.js} +7 -7
  4. package/dist/frontend/{ConfirmDialog-9N3dJGHt.js → ConfirmDialog-B1MjKlVQ.js} +5 -5
  5. package/dist/frontend/{CreateSnapshotDialog-CR5BHpsb.js → CreateSnapshotDialog-BTMoPFdj.js} +4 -4
  6. package/dist/frontend/{DatePicker-B7p5pH4-.js → DatePicker-Bmjko3X7.js} +12 -12
  7. package/dist/frontend/{DeleteDialog-BqR7AQrP.js → DeleteDialog-BkfIeKXO.js} +3 -3
  8. package/dist/frontend/{FolderNode-BQcEuZe3.js → FolderNode-Do8pIfyA.js} +4 -4
  9. package/dist/frontend/{FolderTreeSelector-DqO-f0nt.js → FolderTreeSelector-FyxhcHjr.js} +3 -3
  10. package/dist/frontend/{HiAiEditor-BFpfeft6.js → HiAiEditor-DDpfdQEg.js} +38 -38
  11. package/dist/frontend/{Icon-y7xxAIC6.js → Icon-3EYzvNyk.js} +1 -1
  12. package/dist/frontend/{SettingsDialog-eyTOtZcw.js → SettingsDialog-DzlYW50I.js} +18 -18
  13. package/dist/frontend/{ShareDialog-gCbk5Rrv.js → ShareDialog-Ddvl7xvb.js} +1 -1
  14. package/dist/frontend/{Sidebar-3ridIx_X.js → Sidebar-rFiVen96.js} +29 -29
  15. package/dist/frontend/{TagCreateDialog-B0M1gqk6.js → TagCreateDialog-DQmMJe_E.js} +5 -5
  16. package/dist/frontend/api/categories.js +1 -1
  17. package/dist/frontend/api/settings.js +1 -1
  18. package/dist/frontend/api/tags.js +1 -1
  19. package/dist/frontend/app-shell.js +6 -6
  20. package/dist/frontend/{auth-client-DuY45VqK.js → auth-client-CXR-7mIO.js} +11 -11
  21. package/dist/frontend/{camera-BI-BtnIm.js → camera-DtgHzfVI.js} +2 -2
  22. package/dist/frontend/{categories-Bjcc41We.js → categories-C8AAkhCR.js} +1 -1
  23. package/dist/frontend/{check-sdTlLwi9.js → check-DVx65aSv.js} +2 -2
  24. package/dist/frontend/{chevron-down-DlBnIE7Y.js → chevron-down-C2tbZ8Ol.js} +2 -2
  25. package/dist/frontend/{circle-check-hWC-HeKu.js → circle-check-BAN-D7yg.js} +2 -2
  26. package/dist/frontend/{clock-C4FHq-9q.js → clock-ByiB0SwQ.js} +2 -2
  27. package/dist/frontend/components/category-dialog.js +1 -1
  28. package/dist/frontend/components/create-snapshot-dialog.js +1 -1
  29. package/dist/frontend/components/delete-dialog.js +1 -1
  30. package/dist/frontend/components/editor/compact-editor.js +1 -1
  31. package/dist/frontend/components/editor/document-editor.js +1 -1
  32. package/dist/frontend/components/editor/markdown-toggle.js +2 -2
  33. package/dist/frontend/components/folder-node.js +1 -1
  34. package/dist/frontend/components/folder-tree-selector.js +1 -1
  35. package/dist/frontend/components/save-as-dialog.js +7 -7
  36. package/dist/frontend/components/settings.js +1 -1
  37. package/dist/frontend/components/share-dialog.js +1 -1
  38. package/dist/frontend/components/sidebar.js +1 -1
  39. package/dist/frontend/components/tag-create-dialog.js +1 -1
  40. package/dist/frontend/components/version-history.js +10 -10
  41. package/dist/frontend/{copy-4H99lwAQ.js → copy-CRzvfZGb.js} +2 -2
  42. package/dist/frontend/dashboard.js +48 -48
  43. package/dist/frontend/{db-rWMRdDfv.js → db-Dya0HRhS.js} +1 -1
  44. package/dist/frontend/{dialog-dq74xSum.js → dialog-a_ZcpEC5.js} +9 -9
  45. package/dist/frontend/{dist-BUuz1oVW.js → dist-CcHOStsA.js} +1 -1
  46. package/dist/frontend/dist-DcHl92QO.js +316 -0
  47. package/dist/frontend/{dndzone-BrakBHwm.js → dndzone-CDhrbpTg.js} +1 -1
  48. package/dist/frontend/{dropdown-menu-ChtRLf5S.js → dropdown-menu-DrHYReIC.js} +12 -12
  49. package/dist/frontend/{ellipsis-vertical-CObXWXZW.js → ellipsis-vertical-qxNgoXu-.js} +2 -2
  50. package/dist/frontend/{folder-BAX6qBYy.js → folder-D74E-Kdp.js} +3 -3
  51. package/dist/frontend/frontend.css +1 -1
  52. package/dist/frontend/{identity-BCcv0x22.js → identity-BOA7Jejv.js} +1 -1
  53. package/dist/frontend/{input-DTrIztSF.js → input-Q_7qCfnU.js} +2 -2
  54. package/dist/frontend/{label-BidWF619.js → label-Dj8FDEhf.js} +2 -2
  55. package/dist/frontend/{loader-circle-DnyUzAmN.js → loader-circle-D3t5NkvC.js} +2 -2
  56. package/dist/frontend/offline/identity.js +1 -1
  57. package/dist/frontend/{popper-layer-force-mount-DeBbICF4.js → popper-layer-force-mount-CNtiLgbV.js} +63 -63
  58. package/dist/frontend/{rotate-ccw-DtZDfSK3.js → rotate-ccw-B1ybQ8oQ.js} +2 -2
  59. package/dist/frontend/schemas-1Na35n71.js +3988 -0
  60. package/dist/frontend/search.js +13 -13
  61. package/dist/frontend/{select-value-BlBmN1Vp.js → select-value-BkI1W1bn.js} +19 -19
  62. package/dist/frontend/{settings-BsuxLoxv.js → settings-BRcYFQa_.js} +1 -1
  63. package/dist/frontend/{share-context-CX9pmtDz.js → share-context-BJ4GF4yT.js} +8 -8
  64. package/dist/frontend/{tag-ChpMfbfa.js → tag-qbTBLj-g.js} +3 -3
  65. package/dist/frontend/{tags-CzPNUoFw.js → tags-CF_cqzSV.js} +1 -1
  66. package/dist/frontend/{textarea-704DccHJ.js → textarea-BNK0LFUK.js} +2 -2
  67. package/dist/frontend/theme.js +1 -1
  68. package/dist/frontend/{theme.svelte-B6hsI5me.js → theme.svelte-BRdxXd-B.js} +3 -3
  69. package/dist/frontend/utils/dndzone.js +1 -1
  70. package/dist/frontend/{utils-j7qLkF4C.js → utils-BlHvR6OL.js} +1 -1
  71. package/dist/frontend/{x-B2ifxSH7.js → x-CvSSnrjl.js} +2 -2
  72. package/dist/frontend-ssr/api/settings.js +1 -1
  73. package/dist/frontend-ssr/app-shell.js +6 -6
  74. package/dist/frontend-ssr/assets/{CategoryDialog-Ch4RlhLg.js → CategoryDialog-DuZLLlt7.js} +7 -7
  75. package/dist/frontend-ssr/assets/{ConfirmDialog-B9sc7xt5.js → ConfirmDialog-0WVu9BCE.js} +8 -8
  76. package/dist/frontend-ssr/assets/{CreateSnapshotDialog-XLsNLzRf.js → CreateSnapshotDialog-3vhDTFNu.js} +4 -4
  77. package/dist/frontend-ssr/assets/{DatePicker-BwLyP3b_.js → DatePicker-t12leL2Y.js} +7 -7
  78. package/dist/frontend-ssr/assets/{DeleteDialog-C0a-RBKC.js → DeleteDialog-B0AU1fJR.js} +3 -3
  79. package/dist/frontend-ssr/assets/{FolderNode-imYW-MNe.js → FolderNode-C-B-s8x1.js} +5 -5
  80. package/dist/frontend-ssr/assets/{FolderTreeSelector-DnrKCYtl.js → FolderTreeSelector-DdQuEcj0.js} +4 -4
  81. package/dist/frontend-ssr/assets/{HiAiEditor-CXq29oHf.js → HiAiEditor-Bj6tiE97.js} +30 -30
  82. package/dist/frontend-ssr/assets/{Icon-Clqe8D8X.js → Icon-DE_3EnuF.js} +4 -4
  83. package/dist/frontend-ssr/assets/{SettingsDialog-CH5B9IOK.js → SettingsDialog-h4SFwpUa.js} +16 -16
  84. package/dist/frontend-ssr/assets/{ShareDialog-CcKZFHo8.js → ShareDialog-CpE9zd_f.js} +1 -1
  85. package/dist/frontend-ssr/assets/{Sidebar-DQcwbR0y.js → Sidebar-BFBpsd3L.js} +26 -26
  86. package/dist/frontend-ssr/assets/{TagCreateDialog-DCz6I-FH.js → TagCreateDialog-DBHO1DPU.js} +4 -4
  87. package/dist/frontend-ssr/assets/{auth-client-CokKgEB-.js → auth-client-BC4hSFKF.js} +13 -13
  88. package/dist/frontend-ssr/assets/{camera-Dwwtgvfn.js → camera-B6ldo_Js.js} +2 -2
  89. package/dist/frontend-ssr/assets/{chevron-down-C6BTPJFz.js → chevron-down-DQcr6JUc.js} +2 -2
  90. package/dist/frontend-ssr/assets/{chevron-right-CseGE1qd.js → chevron-right-9szrliZx.js} +2 -2
  91. package/dist/frontend-ssr/assets/{circle-check-BRhWPZo1.js → circle-check-BgP9MRRv.js} +2 -2
  92. package/dist/frontend-ssr/assets/{clock-DpP_Y7WP.js → clock-roNtGlT6.js} +2 -2
  93. package/dist/frontend-ssr/assets/{copy-DRMKiRZ0.js → copy-BYqYnBIQ.js} +2 -2
  94. package/dist/frontend-ssr/assets/{db-BxaCyM9B.js → db-C3rFdTZa.js} +1 -1
  95. package/dist/frontend-ssr/assets/{dialog-Bjm7PhCc.js → dialog-SqCnTT43.js} +9 -9
  96. package/dist/frontend-ssr/assets/{dist-71eunluk.js → dist-CaZQ1FhA.js} +10 -10
  97. package/dist/frontend-ssr/assets/{dist-CshZmNmp.js → dist-CqxHwOlp.js} +3 -3
  98. package/dist/frontend-ssr/assets/{dndzone-WtNaDxoQ.js → dndzone-CnTCMhPd.js} +1 -1
  99. package/dist/frontend-ssr/assets/{dropdown-menu-dg8hpDGz.js → dropdown-menu-CE6U0f1b.js} +12 -12
  100. package/dist/frontend-ssr/assets/{ellipsis-vertical-BErUuhWg.js → ellipsis-vertical-Cg1MrZsl.js} +2 -2
  101. package/dist/frontend-ssr/assets/{folder-DszunwKc.js → folder-DHB-CEcQ.js} +2 -2
  102. package/dist/frontend-ssr/assets/{identity-BHNrcgU5.js → identity-DNIo1bgc.js} +1 -1
  103. package/dist/frontend-ssr/assets/{input-BzlpgSwc.js → input-DVrBVPgs.js} +2 -2
  104. package/dist/frontend-ssr/assets/{label-uycYYCYF.js → label-vtCK3pTp.js} +2 -2
  105. package/dist/frontend-ssr/assets/{loader-circle-BpRVrMZg.js → loader-circle-D3NWhCif.js} +2 -2
  106. package/dist/frontend-ssr/assets/{popper-layer-force-mount-X3deg3KH.js → popper-layer-force-mount-C4dMMt-f.js} +71 -71
  107. package/dist/frontend-ssr/assets/{rotate-ccw-1GOD_yt_.js → rotate-ccw-DNf3nwMD.js} +2 -2
  108. package/dist/frontend-ssr/assets/{select-value-BRQxTiFP.js → select-value-Ce5c_fuA.js} +18 -18
  109. package/dist/frontend-ssr/assets/{settings-Dy4eZk45.js → settings-DWCpfCPj.js} +1 -1
  110. package/dist/frontend-ssr/assets/{share-context-dIAQ413Z.js → share-context-B4UpvTSw.js} +9 -9
  111. package/dist/frontend-ssr/assets/{tag-DFh6nF9R.js → tag-Cqv0fWVG.js} +3 -3
  112. package/dist/frontend-ssr/assets/{textarea-CEUFQIma.js → textarea-BdjOJJVb.js} +2 -2
  113. package/dist/frontend-ssr/assets/{theme.svelte-dM8TietK.js → theme.svelte-D6bbaJ9m.js} +3 -3
  114. package/dist/frontend-ssr/assets/{utils-0rlYZMNr.js → utils-D3X7I8nz.js} +1 -1
  115. package/dist/frontend-ssr/components/category-dialog.js +1 -1
  116. package/dist/frontend-ssr/components/create-snapshot-dialog.js +1 -1
  117. package/dist/frontend-ssr/components/delete-dialog.js +1 -1
  118. package/dist/frontend-ssr/components/editor/compact-editor.js +1 -1
  119. package/dist/frontend-ssr/components/editor/document-editor.js +1 -1
  120. package/dist/frontend-ssr/components/editor/markdown-toggle.js +1 -1
  121. package/dist/frontend-ssr/components/folder-node.js +1 -1
  122. package/dist/frontend-ssr/components/folder-tree-selector.js +1 -1
  123. package/dist/frontend-ssr/components/save-as-dialog.js +6 -6
  124. package/dist/frontend-ssr/components/settings.js +1 -1
  125. package/dist/frontend-ssr/components/share-dialog.js +1 -1
  126. package/dist/frontend-ssr/components/sidebar.js +1 -1
  127. package/dist/frontend-ssr/components/tag-create-dialog.js +1 -1
  128. package/dist/frontend-ssr/components/version-history.js +10 -10
  129. package/dist/frontend-ssr/dashboard.js +40 -40
  130. package/dist/frontend-ssr/offline/identity.js +1 -1
  131. package/dist/frontend-ssr/search.js +8 -8
  132. package/dist/frontend-ssr/theme.js +1 -1
  133. package/dist/frontend-ssr/utils/dndzone.js +1 -1
  134. package/dist/lifecycle-runtime.js +7129 -1986
  135. package/dist/mcp-cli.js +133 -72
  136. package/dist/mcp-server.d.ts +15 -0
  137. package/dist/mcp-server.js +137 -72
  138. package/package.json +15 -6
  139. package/packages/cli/src/index.ts +1 -1
  140. package/server.json +2 -2
  141. package/dist/frontend/dist-COPpfjrc.js +0 -316
  142. package/dist/frontend/schemas-CdPhcuru.js +0 -3001
@@ -1,3001 +0,0 @@
1
- //#region ../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/core/core.js
2
- var e;
3
- function t(e, t, n) {
4
- function r(n, r) {
5
- if (n._zod || Object.defineProperty(n, "_zod", {
6
- value: {
7
- def: r,
8
- constr: o,
9
- traits: /* @__PURE__ */ new Set()
10
- },
11
- enumerable: !1
12
- }), n._zod.traits.has(e)) return;
13
- n._zod.traits.add(e), t(n, r);
14
- let i = o.prototype, a = Object.keys(i);
15
- for (let e = 0; e < a.length; e++) {
16
- let t = a[e];
17
- t in n || (n[t] = i[t].bind(n));
18
- }
19
- }
20
- let i = n?.Parent ?? Object;
21
- class a extends i {}
22
- Object.defineProperty(a, "name", { value: e });
23
- function o(e) {
24
- var t;
25
- let i = n?.Parent ? new a() : this;
26
- r(i, e), (t = i._zod).deferred ?? (t.deferred = []);
27
- for (let e of i._zod.deferred) e();
28
- return i;
29
- }
30
- 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;
31
- }
32
- var n = class extends Error {
33
- constructor() {
34
- super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
35
- }
36
- }, r = class extends Error {
37
- constructor(e) {
38
- super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError";
39
- }
40
- };
41
- (e = globalThis).__zod_globalConfig ?? (e.__zod_globalConfig = {});
42
- var i = globalThis.__zod_globalConfig;
43
- function a(e) {
44
- return e && Object.assign(i, e), i;
45
- }
46
- //#endregion
47
- //#region ../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/core/util.js
48
- function o(e) {
49
- let t = Object.values(e).filter((e) => typeof e == "number");
50
- return Object.entries(e).filter(([e, n]) => t.indexOf(+e) === -1).map(([e, t]) => t);
51
- }
52
- function s(e, t) {
53
- return typeof t == "bigint" ? t.toString() : t;
54
- }
55
- function c(e) {
56
- return { get value() {
57
- {
58
- let t = e();
59
- return Object.defineProperty(this, "value", { value: t }), t;
60
- }
61
- } };
62
- }
63
- function l(e) {
64
- return e == null;
65
- }
66
- function u(e) {
67
- let t = +!!e.startsWith("^"), n = e.endsWith("$") ? e.length - 1 : e.length;
68
- return e.slice(t, n);
69
- }
70
- function d(e, t) {
71
- let n = e / t, r = Math.round(n), i = 2 ** -52 * Math.max(Math.abs(n), 1);
72
- return Math.abs(n - r) < i ? 0 : n - r;
73
- }
74
- var f = /* @__PURE__*/ Symbol("evaluating");
75
- function p(e, t, n) {
76
- let r;
77
- Object.defineProperty(e, t, {
78
- get() {
79
- if (r !== f) return r === void 0 && (r = f, r = n()), r;
80
- },
81
- set(n) {
82
- Object.defineProperty(e, t, { value: n });
83
- },
84
- configurable: !0
85
- });
86
- }
87
- function m(e, t, n) {
88
- Object.defineProperty(e, t, {
89
- value: n,
90
- writable: !0,
91
- enumerable: !0,
92
- configurable: !0
93
- });
94
- }
95
- function h(...e) {
96
- let t = {};
97
- for (let n of e) {
98
- let e = Object.getOwnPropertyDescriptors(n);
99
- Object.assign(t, e);
100
- }
101
- return Object.defineProperties({}, t);
102
- }
103
- function ee(e) {
104
- return JSON.stringify(e);
105
- }
106
- function te(e) {
107
- return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
108
- }
109
- var ne = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {};
110
- function g(e) {
111
- return typeof e == "object" && !!e && !Array.isArray(e);
112
- }
113
- var re = /* @__PURE__*/ c(() => {
114
- if (i.jitless || typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return !1;
115
- try {
116
- return Function(""), !0;
117
- } catch {
118
- return !1;
119
- }
120
- });
121
- function _(e) {
122
- if (g(e) === !1) return !1;
123
- let t = e.constructor;
124
- if (t === void 0 || typeof t != "function") return !0;
125
- let n = t.prototype;
126
- return g(n) !== !1 && Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") !== !1;
127
- }
128
- function ie(e) {
129
- return _(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e;
130
- }
131
- var ae = /* @__PURE__*/ new Set([
132
- "string",
133
- "number",
134
- "symbol"
135
- ]);
136
- function v(e) {
137
- return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
138
- }
139
- function y(e, t, n) {
140
- let r = new e._zod.constr(t ?? e._zod.def);
141
- return (!t || n?.parent) && (r._zod.parent = e), r;
142
- }
143
- function b(e) {
144
- let t = e;
145
- if (!t) return {};
146
- if (typeof t == "string") return { error: () => t };
147
- if (t?.message !== void 0) {
148
- if (t?.error !== void 0) throw Error("Cannot specify both `message` and `error` params");
149
- t.error = t.message;
150
- }
151
- return delete t.message, typeof t.error == "string" ? {
152
- ...t,
153
- error: () => t.error
154
- } : t;
155
- }
156
- function oe(e) {
157
- return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
158
- }
159
- var se = {
160
- safeint: [-(2 ** 53 - 1), 2 ** 53 - 1],
161
- int32: [-2147483648, 2147483647],
162
- uint32: [0, 4294967295],
163
- float32: [-34028234663852886e22, 34028234663852886e22],
164
- float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
165
- };
166
- function ce(e, t) {
167
- let n = e._zod.def, r = n.checks;
168
- if (r && r.length > 0) throw Error(".pick() cannot be used on object schemas containing refinements");
169
- return y(e, h(e._zod.def, {
170
- get shape() {
171
- let e = {};
172
- for (let r in t) {
173
- if (!(r in n.shape)) throw Error(`Unrecognized key: "${r}"`);
174
- t[r] && (e[r] = n.shape[r]);
175
- }
176
- return m(this, "shape", e), e;
177
- },
178
- checks: []
179
- }));
180
- }
181
- function le(e, t) {
182
- let n = e._zod.def, r = n.checks;
183
- if (r && r.length > 0) throw Error(".omit() cannot be used on object schemas containing refinements");
184
- return y(e, h(e._zod.def, {
185
- get shape() {
186
- let r = { ...e._zod.def.shape };
187
- for (let e in t) {
188
- if (!(e in n.shape)) throw Error(`Unrecognized key: "${e}"`);
189
- t[e] && delete r[e];
190
- }
191
- return m(this, "shape", r), r;
192
- },
193
- checks: []
194
- }));
195
- }
196
- function ue(e, t) {
197
- if (!_(t)) throw Error("Invalid input to extend: expected a plain object");
198
- let n = e._zod.def.checks;
199
- if (n && n.length > 0) {
200
- let n = e._zod.def.shape;
201
- for (let e in t) if (Object.getOwnPropertyDescriptor(n, e) !== void 0) throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
202
- }
203
- return y(e, h(e._zod.def, { get shape() {
204
- let n = {
205
- ...e._zod.def.shape,
206
- ...t
207
- };
208
- return m(this, "shape", n), n;
209
- } }));
210
- }
211
- function de(e, t) {
212
- if (!_(t)) throw Error("Invalid input to safeExtend: expected a plain object");
213
- return y(e, h(e._zod.def, { get shape() {
214
- let n = {
215
- ...e._zod.def.shape,
216
- ...t
217
- };
218
- return m(this, "shape", n), n;
219
- } }));
220
- }
221
- function fe(e, t) {
222
- if (e._zod.def.checks?.length) throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
223
- return y(e, h(e._zod.def, {
224
- get shape() {
225
- let n = {
226
- ...e._zod.def.shape,
227
- ...t._zod.def.shape
228
- };
229
- return m(this, "shape", n), n;
230
- },
231
- get catchall() {
232
- return t._zod.def.catchall;
233
- },
234
- checks: t._zod.def.checks ?? []
235
- }));
236
- }
237
- function pe(e, t, n) {
238
- let r = t._zod.def.checks;
239
- if (r && r.length > 0) throw Error(".partial() cannot be used on object schemas containing refinements");
240
- return y(t, h(t._zod.def, {
241
- get shape() {
242
- let r = t._zod.def.shape, i = { ...r };
243
- if (n) for (let t in n) {
244
- if (!(t in r)) throw Error(`Unrecognized key: "${t}"`);
245
- n[t] && (i[t] = e ? new e({
246
- type: "optional",
247
- innerType: r[t]
248
- }) : r[t]);
249
- }
250
- else for (let t in r) i[t] = e ? new e({
251
- type: "optional",
252
- innerType: r[t]
253
- }) : r[t];
254
- return m(this, "shape", i), i;
255
- },
256
- checks: []
257
- }));
258
- }
259
- function me(e, t, n) {
260
- return y(t, h(t._zod.def, { get shape() {
261
- let r = t._zod.def.shape, i = { ...r };
262
- if (n) for (let t in n) {
263
- if (!(t in i)) throw Error(`Unrecognized key: "${t}"`);
264
- n[t] && (i[t] = new e({
265
- type: "nonoptional",
266
- innerType: r[t]
267
- }));
268
- }
269
- else for (let t in r) i[t] = new e({
270
- type: "nonoptional",
271
- innerType: r[t]
272
- });
273
- return m(this, "shape", i), i;
274
- } }));
275
- }
276
- function x(e, t = 0) {
277
- if (e.aborted === !0) return !0;
278
- for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue !== !0) return !0;
279
- return !1;
280
- }
281
- function he(e, t = 0) {
282
- if (e.aborted === !0) return !0;
283
- for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue === !1) return !0;
284
- return !1;
285
- }
286
- function ge(e, t) {
287
- return t.map((t) => {
288
- var n;
289
- return (n = t).path ?? (n.path = []), t.path.unshift(e), t;
290
- });
291
- }
292
- function S(e) {
293
- return typeof e == "string" ? e : e?.message;
294
- }
295
- function C(e, t, n) {
296
- let r = e.message ? e.message : S(e.inst?._zod.def?.error?.(e)) ?? S(t?.error?.(e)) ?? S(n.customError?.(e)) ?? S(n.localeError?.(e)) ?? "Invalid input", { inst: i, continue: a, input: o, ...s } = e;
297
- return s.path ??= [], s.message = r, t?.reportInput && (s.input = o), s;
298
- }
299
- function w(e) {
300
- return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
301
- }
302
- function T(...e) {
303
- let [t, n, r] = e;
304
- return typeof t == "string" ? {
305
- message: t,
306
- code: "custom",
307
- input: n,
308
- inst: r
309
- } : { ...t };
310
- }
311
- //#endregion
312
- //#region ../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/core/errors.js
313
- var _e = (e, t) => {
314
- e.name = "$ZodError", Object.defineProperty(e, "_zod", {
315
- value: e._zod,
316
- enumerable: !1
317
- }), Object.defineProperty(e, "issues", {
318
- value: t,
319
- enumerable: !1
320
- }), e.message = JSON.stringify(t, s, 2), Object.defineProperty(e, "toString", {
321
- value: () => e.message,
322
- enumerable: !1
323
- });
324
- }, ve = t("$ZodError", _e), ye = t("$ZodError", _e, { Parent: Error });
325
- function be(e, t = (e) => e.message) {
326
- let n = {}, r = [];
327
- 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));
328
- return {
329
- formErrors: r,
330
- fieldErrors: n
331
- };
332
- }
333
- function xe(e, t = (e) => e.message) {
334
- let n = { _errors: [] }, r = (e, i = []) => {
335
- for (let a of e.issues) if (a.code === "invalid_union" && a.errors.length) a.errors.map((e) => r({ issues: e }, [...i, ...a.path]));
336
- else if (a.code === "invalid_key") r({ issues: a.issues }, [...i, ...a.path]);
337
- else if (a.code === "invalid_element") r({ issues: a.issues }, [...i, ...a.path]);
338
- else {
339
- let e = [...i, ...a.path];
340
- if (e.length === 0) n._errors.push(t(a));
341
- else {
342
- let r = n, i = 0;
343
- for (; i < e.length;) {
344
- let n = e[i];
345
- i === e.length - 1 ? (r[n] = r[n] || { _errors: [] }, r[n]._errors.push(t(a))) : r[n] = r[n] || { _errors: [] }, r = r[n], i++;
346
- }
347
- }
348
- }
349
- };
350
- return r(e), n;
351
- }
352
- //#endregion
353
- //#region ../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/core/parse.js
354
- var E = (e) => (t, r, i, o) => {
355
- let s = i ? {
356
- ...i,
357
- async: !1
358
- } : { async: !1 }, c = t._zod.run({
359
- value: r,
360
- issues: []
361
- }, s);
362
- if (c instanceof Promise) throw new n();
363
- if (c.issues.length) {
364
- let t = new ((o?.Err) ?? e)(c.issues.map((e) => C(e, s, a())));
365
- throw ne(t, o?.callee), t;
366
- }
367
- return c.value;
368
- }, D = (e) => async (t, n, r, i) => {
369
- let o = r ? {
370
- ...r,
371
- async: !0
372
- } : { async: !0 }, s = t._zod.run({
373
- value: n,
374
- issues: []
375
- }, o);
376
- if (s instanceof Promise && (s = await s), s.issues.length) {
377
- let t = new ((i?.Err) ?? e)(s.issues.map((e) => C(e, o, a())));
378
- throw ne(t, i?.callee), t;
379
- }
380
- return s.value;
381
- }, O = (e) => (t, r, i) => {
382
- let o = i ? {
383
- ...i,
384
- async: !1
385
- } : { async: !1 }, s = t._zod.run({
386
- value: r,
387
- issues: []
388
- }, o);
389
- if (s instanceof Promise) throw new n();
390
- return s.issues.length ? {
391
- success: !1,
392
- error: new (e ?? ve)(s.issues.map((e) => C(e, o, a())))
393
- } : {
394
- success: !0,
395
- data: s.value
396
- };
397
- }, Se = /* @__PURE__*/ O(ye), k = (e) => async (t, n, r) => {
398
- let i = r ? {
399
- ...r,
400
- async: !0
401
- } : { async: !0 }, o = t._zod.run({
402
- value: n,
403
- issues: []
404
- }, i);
405
- return o instanceof Promise && (o = await o), o.issues.length ? {
406
- success: !1,
407
- error: new e(o.issues.map((e) => C(e, i, a())))
408
- } : {
409
- success: !0,
410
- data: o.value
411
- };
412
- }, Ce = /* @__PURE__*/ k(ye), we = (e) => (t, n, r) => {
413
- let i = r ? {
414
- ...r,
415
- direction: "backward"
416
- } : { direction: "backward" };
417
- return E(e)(t, n, i);
418
- }, Te = (e) => (t, n, r) => E(e)(t, n, r), Ee = (e) => async (t, n, r) => {
419
- let i = r ? {
420
- ...r,
421
- direction: "backward"
422
- } : { direction: "backward" };
423
- return D(e)(t, n, i);
424
- }, De = (e) => async (t, n, r) => D(e)(t, n, r), Oe = (e) => (t, n, r) => {
425
- let i = r ? {
426
- ...r,
427
- direction: "backward"
428
- } : { direction: "backward" };
429
- return O(e)(t, n, i);
430
- }, ke = (e) => (t, n, r) => O(e)(t, n, r), Ae = (e) => async (t, n, r) => {
431
- let i = r ? {
432
- ...r,
433
- direction: "backward"
434
- } : { direction: "backward" };
435
- return k(e)(t, n, i);
436
- }, je = (e) => async (t, n, r) => k(e)(t, n, r), Me = /^[cC][0-9a-z]{6,}$/, Ne = /^[0-9a-z]+$/, Pe = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Fe = /^[0-9a-vA-V]{20}$/, Ie = /^[A-Za-z0-9]{27}$/, Le = /^[a-zA-Z0-9_-]{21}$/, Re = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, ze = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Be = (e) => e ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Ve = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, He = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
437
- function Ue() {
438
- return new RegExp(He, "u");
439
- }
440
- var We = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Ge = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, Ke = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, qe = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Je = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Ye = /^[A-Za-z0-9_-]*$/, Xe = /^https?$/, Ze = /^\+[1-9]\d{6,14}$/, Qe = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", $e = /*@__PURE__*/ RegExp(`^${Qe}$`);
441
- function et(e) {
442
- let t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
443
- return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
444
- }
445
- function tt(e) {
446
- return RegExp(`^${et(e)}$`);
447
- }
448
- function nt(e) {
449
- let t = et({ precision: e.precision }), n = ["Z"];
450
- e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
451
- let r = `${t}(?:${n.join("|")})`;
452
- return RegExp(`^${Qe}T(?:${r})$`);
453
- }
454
- var rt = (e) => {
455
- let t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
456
- return RegExp(`^${t}$`);
457
- }, it = /^-?\d+$/, at = /^-?\d+(?:\.\d+)?$/, ot = /^(?:true|false)$/i, st = /^[^A-Z]*$/, ct = /^[^a-z]*$/, A = /*@__PURE__*/ t("$ZodCheck", (e, t) => {
458
- var n;
459
- e._zod ??= {}, e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
460
- }), lt = {
461
- number: "number",
462
- bigint: "bigint",
463
- object: "date"
464
- }, ut = /*@__PURE__*/ t("$ZodCheckLessThan", (e, t) => {
465
- A.init(e, t);
466
- let n = lt[typeof t.value];
467
- e._zod.onattach.push((e) => {
468
- let n = e._zod.bag, r = (t.inclusive ? n.maximum : n.exclusiveMaximum) ?? Infinity;
469
- t.value < r && (t.inclusive ? n.maximum = t.value : n.exclusiveMaximum = t.value);
470
- }), e._zod.check = (r) => {
471
- (t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({
472
- origin: n,
473
- code: "too_big",
474
- maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
475
- input: r.value,
476
- inclusive: t.inclusive,
477
- inst: e,
478
- continue: !t.abort
479
- });
480
- };
481
- }), dt = /*@__PURE__*/ t("$ZodCheckGreaterThan", (e, t) => {
482
- A.init(e, t);
483
- let n = lt[typeof t.value];
484
- e._zod.onattach.push((e) => {
485
- let n = e._zod.bag, r = (t.inclusive ? n.minimum : n.exclusiveMinimum) ?? -Infinity;
486
- t.value > r && (t.inclusive ? n.minimum = t.value : n.exclusiveMinimum = t.value);
487
- }), e._zod.check = (r) => {
488
- (t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({
489
- origin: n,
490
- code: "too_small",
491
- minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
492
- input: r.value,
493
- inclusive: t.inclusive,
494
- inst: e,
495
- continue: !t.abort
496
- });
497
- };
498
- }), ft = /*@__PURE__*/ t("$ZodCheckMultipleOf", (e, t) => {
499
- A.init(e, t), e._zod.onattach.push((e) => {
500
- var n;
501
- (n = e._zod.bag).multipleOf ?? (n.multipleOf = t.value);
502
- }), e._zod.check = (n) => {
503
- if (typeof n.value != typeof t.value) throw Error("Cannot mix number and bigint in multiple_of check.");
504
- (typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : d(n.value, t.value) === 0) || n.issues.push({
505
- origin: typeof n.value,
506
- code: "not_multiple_of",
507
- divisor: t.value,
508
- input: n.value,
509
- inst: e,
510
- continue: !t.abort
511
- });
512
- };
513
- }), pt = /*@__PURE__*/ t("$ZodCheckNumberFormat", (e, t) => {
514
- A.init(e, t), t.format = t.format || "float64";
515
- let n = t.format?.includes("int"), r = n ? "int" : "number", [i, a] = se[t.format];
516
- e._zod.onattach.push((e) => {
517
- let r = e._zod.bag;
518
- r.format = t.format, r.minimum = i, r.maximum = a, n && (r.pattern = it);
519
- }), e._zod.check = (o) => {
520
- let s = o.value;
521
- if (n) {
522
- if (!Number.isInteger(s)) {
523
- o.issues.push({
524
- expected: r,
525
- format: t.format,
526
- code: "invalid_type",
527
- continue: !1,
528
- input: s,
529
- inst: e
530
- });
531
- return;
532
- }
533
- if (!Number.isSafeInteger(s)) {
534
- s > 0 ? o.issues.push({
535
- input: s,
536
- code: "too_big",
537
- maximum: 2 ** 53 - 1,
538
- note: "Integers must be within the safe integer range.",
539
- inst: e,
540
- origin: r,
541
- inclusive: !0,
542
- continue: !t.abort
543
- }) : o.issues.push({
544
- input: s,
545
- code: "too_small",
546
- minimum: -(2 ** 53 - 1),
547
- note: "Integers must be within the safe integer range.",
548
- inst: e,
549
- origin: r,
550
- inclusive: !0,
551
- continue: !t.abort
552
- });
553
- return;
554
- }
555
- }
556
- s < i && o.issues.push({
557
- origin: "number",
558
- input: s,
559
- code: "too_small",
560
- minimum: i,
561
- inclusive: !0,
562
- inst: e,
563
- continue: !t.abort
564
- }), s > a && o.issues.push({
565
- origin: "number",
566
- input: s,
567
- code: "too_big",
568
- maximum: a,
569
- inclusive: !0,
570
- inst: e,
571
- continue: !t.abort
572
- });
573
- };
574
- }), mt = /*@__PURE__*/ t("$ZodCheckMaxLength", (e, t) => {
575
- var n;
576
- A.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
577
- let t = e.value;
578
- return !l(t) && t.length !== void 0;
579
- }), e._zod.onattach.push((e) => {
580
- let n = e._zod.bag.maximum ?? Infinity;
581
- t.maximum < n && (e._zod.bag.maximum = t.maximum);
582
- }), e._zod.check = (n) => {
583
- let r = n.value;
584
- if (r.length <= t.maximum) return;
585
- let i = w(r);
586
- n.issues.push({
587
- origin: i,
588
- code: "too_big",
589
- maximum: t.maximum,
590
- inclusive: !0,
591
- input: r,
592
- inst: e,
593
- continue: !t.abort
594
- });
595
- };
596
- }), ht = /*@__PURE__*/ t("$ZodCheckMinLength", (e, t) => {
597
- var n;
598
- A.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
599
- let t = e.value;
600
- return !l(t) && t.length !== void 0;
601
- }), e._zod.onattach.push((e) => {
602
- let n = e._zod.bag.minimum ?? -Infinity;
603
- t.minimum > n && (e._zod.bag.minimum = t.minimum);
604
- }), e._zod.check = (n) => {
605
- let r = n.value;
606
- if (r.length >= t.minimum) return;
607
- let i = w(r);
608
- n.issues.push({
609
- origin: i,
610
- code: "too_small",
611
- minimum: t.minimum,
612
- inclusive: !0,
613
- input: r,
614
- inst: e,
615
- continue: !t.abort
616
- });
617
- };
618
- }), gt = /*@__PURE__*/ t("$ZodCheckLengthEquals", (e, t) => {
619
- var n;
620
- A.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
621
- let t = e.value;
622
- return !l(t) && t.length !== void 0;
623
- }), e._zod.onattach.push((e) => {
624
- let n = e._zod.bag;
625
- n.minimum = t.length, n.maximum = t.length, n.length = t.length;
626
- }), e._zod.check = (n) => {
627
- let r = n.value, i = r.length;
628
- if (i === t.length) return;
629
- let a = w(r), o = i > t.length;
630
- n.issues.push({
631
- origin: a,
632
- ...o ? {
633
- code: "too_big",
634
- maximum: t.length
635
- } : {
636
- code: "too_small",
637
- minimum: t.length
638
- },
639
- inclusive: !0,
640
- exact: !0,
641
- input: n.value,
642
- inst: e,
643
- continue: !t.abort
644
- });
645
- };
646
- }), j = /*@__PURE__*/ t("$ZodCheckStringFormat", (e, t) => {
647
- var n, r;
648
- A.init(e, t), e._zod.onattach.push((e) => {
649
- let n = e._zod.bag;
650
- n.format = t.format, t.pattern && (n.patterns ??= /* @__PURE__ */ new Set(), n.patterns.add(t.pattern));
651
- }), t.pattern ? (n = e._zod).check ?? (n.check = (n) => {
652
- t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
653
- origin: "string",
654
- code: "invalid_format",
655
- format: t.format,
656
- input: n.value,
657
- ...t.pattern ? { pattern: t.pattern.toString() } : {},
658
- inst: e,
659
- continue: !t.abort
660
- });
661
- }) : (r = e._zod).check ?? (r.check = () => {});
662
- }), _t = /*@__PURE__*/ t("$ZodCheckRegex", (e, t) => {
663
- j.init(e, t), e._zod.check = (n) => {
664
- t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
665
- origin: "string",
666
- code: "invalid_format",
667
- format: "regex",
668
- input: n.value,
669
- pattern: t.pattern.toString(),
670
- inst: e,
671
- continue: !t.abort
672
- });
673
- };
674
- }), vt = /*@__PURE__*/ t("$ZodCheckLowerCase", (e, t) => {
675
- t.pattern ??= st, j.init(e, t);
676
- }), yt = /*@__PURE__*/ t("$ZodCheckUpperCase", (e, t) => {
677
- t.pattern ??= ct, j.init(e, t);
678
- }), bt = /*@__PURE__*/ t("$ZodCheckIncludes", (e, t) => {
679
- A.init(e, t);
680
- let n = v(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
681
- t.pattern = r, e._zod.onattach.push((e) => {
682
- let t = e._zod.bag;
683
- t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r);
684
- }), e._zod.check = (n) => {
685
- n.value.includes(t.includes, t.position) || n.issues.push({
686
- origin: "string",
687
- code: "invalid_format",
688
- format: "includes",
689
- includes: t.includes,
690
- input: n.value,
691
- inst: e,
692
- continue: !t.abort
693
- });
694
- };
695
- }), xt = /*@__PURE__*/ t("$ZodCheckStartsWith", (e, t) => {
696
- A.init(e, t);
697
- let n = RegExp(`^${v(t.prefix)}.*`);
698
- t.pattern ??= n, e._zod.onattach.push((e) => {
699
- let t = e._zod.bag;
700
- t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
701
- }), e._zod.check = (n) => {
702
- n.value.startsWith(t.prefix) || n.issues.push({
703
- origin: "string",
704
- code: "invalid_format",
705
- format: "starts_with",
706
- prefix: t.prefix,
707
- input: n.value,
708
- inst: e,
709
- continue: !t.abort
710
- });
711
- };
712
- }), St = /*@__PURE__*/ t("$ZodCheckEndsWith", (e, t) => {
713
- A.init(e, t);
714
- let n = RegExp(`.*${v(t.suffix)}$`);
715
- t.pattern ??= n, e._zod.onattach.push((e) => {
716
- let t = e._zod.bag;
717
- t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
718
- }), e._zod.check = (n) => {
719
- n.value.endsWith(t.suffix) || n.issues.push({
720
- origin: "string",
721
- code: "invalid_format",
722
- format: "ends_with",
723
- suffix: t.suffix,
724
- input: n.value,
725
- inst: e,
726
- continue: !t.abort
727
- });
728
- };
729
- }), Ct = /*@__PURE__*/ t("$ZodCheckOverwrite", (e, t) => {
730
- A.init(e, t), e._zod.check = (e) => {
731
- e.value = t.tx(e.value);
732
- };
733
- }), wt = class {
734
- constructor(e = []) {
735
- this.content = [], this.indent = 0, this && (this.args = e);
736
- }
737
- indented(e) {
738
- this.indent += 1, e(this), --this.indent;
739
- }
740
- write(e) {
741
- if (typeof e == "function") {
742
- e(this, { execution: "sync" }), e(this, { execution: "async" });
743
- return;
744
- }
745
- 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);
746
- for (let e of r) this.content.push(e);
747
- }
748
- compile() {
749
- let e = Function, t = this?.args, n = [...(this?.content ?? [""]).map((e) => ` ${e}`)];
750
- return new e(...t, n.join("\n"));
751
- }
752
- }, Tt = {
753
- major: 4,
754
- minor: 4,
755
- patch: 3
756
- }, M = /*@__PURE__*/ t("$ZodType", (e, t) => {
757
- var r;
758
- e ??= {}, e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Tt;
759
- let i = [...e._zod.def.checks ?? []];
760
- e._zod.traits.has("$ZodCheck") && i.unshift(e);
761
- for (let t of i) for (let n of t._zod.onattach) n(e);
762
- if (i.length === 0) (r = e._zod).deferred ?? (r.deferred = []), e._zod.deferred?.push(() => {
763
- e._zod.run = e._zod.parse;
764
- });
765
- else {
766
- let t = (e, t, r) => {
767
- let i = x(e), a;
768
- for (let o of t) {
769
- if (o._zod.def.when) {
770
- if (he(e) || !o._zod.def.when(e)) continue;
771
- } else if (i) continue;
772
- let t = e.issues.length, s = o._zod.check(e);
773
- if (s instanceof Promise && r?.async === !1) throw new n();
774
- if (a || s instanceof Promise) a = (a ?? Promise.resolve()).then(async () => {
775
- await s, e.issues.length !== t && (i ||= x(e, t));
776
- });
777
- else {
778
- if (e.issues.length === t) continue;
779
- i ||= x(e, t);
780
- }
781
- }
782
- return a ? a.then(() => e) : e;
783
- }, r = (r, a, o) => {
784
- if (x(r)) return r.aborted = !0, r;
785
- let s = t(a, i, o);
786
- if (s instanceof Promise) {
787
- if (o.async === !1) throw new n();
788
- return s.then((t) => e._zod.parse(t, o));
789
- }
790
- return e._zod.parse(s, o);
791
- };
792
- e._zod.run = (a, o) => {
793
- if (o.skipChecks) return e._zod.parse(a, o);
794
- if (o.direction === "backward") {
795
- let t = e._zod.parse({
796
- value: a.value,
797
- issues: []
798
- }, {
799
- ...o,
800
- skipChecks: !0
801
- });
802
- return t instanceof Promise ? t.then((e) => r(e, a, o)) : r(t, a, o);
803
- }
804
- let s = e._zod.parse(a, o);
805
- if (s instanceof Promise) {
806
- if (o.async === !1) throw new n();
807
- return s.then((e) => t(e, i, o));
808
- }
809
- return t(s, i, o);
810
- };
811
- }
812
- p(e, "~standard", () => ({
813
- validate: (t) => {
814
- try {
815
- let n = Se(e, t);
816
- return n.success ? { value: n.data } : { issues: n.error?.issues };
817
- } catch {
818
- return Ce(e, t).then((e) => e.success ? { value: e.data } : { issues: e.error?.issues });
819
- }
820
- },
821
- vendor: "zod",
822
- version: 1
823
- }));
824
- }), N = /*@__PURE__*/ t("$ZodString", (e, t) => {
825
- M.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? rt(e._zod.bag), e._zod.parse = (n, r) => {
826
- if (t.coerce) try {
827
- n.value = String(n.value);
828
- } catch {}
829
- return typeof n.value == "string" || n.issues.push({
830
- expected: "string",
831
- code: "invalid_type",
832
- input: n.value,
833
- inst: e
834
- }), n;
835
- };
836
- }), P = /*@__PURE__*/ t("$ZodStringFormat", (e, t) => {
837
- j.init(e, t), N.init(e, t);
838
- }), Et = /*@__PURE__*/ t("$ZodGUID", (e, t) => {
839
- t.pattern ??= ze, P.init(e, t);
840
- }), Dt = /*@__PURE__*/ t("$ZodUUID", (e, t) => {
841
- if (t.version) {
842
- let e = {
843
- v1: 1,
844
- v2: 2,
845
- v3: 3,
846
- v4: 4,
847
- v5: 5,
848
- v6: 6,
849
- v7: 7,
850
- v8: 8
851
- }[t.version];
852
- if (e === void 0) throw Error(`Invalid UUID version: "${t.version}"`);
853
- t.pattern ??= Be(e);
854
- } else t.pattern ??= Be();
855
- P.init(e, t);
856
- }), Ot = /*@__PURE__*/ t("$ZodEmail", (e, t) => {
857
- t.pattern ??= Ve, P.init(e, t);
858
- }), kt = /*@__PURE__*/ t("$ZodURL", (e, t) => {
859
- P.init(e, t), e._zod.check = (n) => {
860
- try {
861
- let r = n.value.trim();
862
- if (!t.normalize && t.protocol?.source === Xe.source && !/^https?:\/\//i.test(r)) {
863
- n.issues.push({
864
- code: "invalid_format",
865
- format: "url",
866
- note: "Invalid URL format",
867
- input: n.value,
868
- inst: e,
869
- continue: !t.abort
870
- });
871
- return;
872
- }
873
- let i = new URL(r);
874
- t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(i.hostname) || n.issues.push({
875
- code: "invalid_format",
876
- format: "url",
877
- note: "Invalid hostname",
878
- pattern: t.hostname.source,
879
- input: n.value,
880
- inst: e,
881
- continue: !t.abort
882
- })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(i.protocol.endsWith(":") ? i.protocol.slice(0, -1) : i.protocol) || n.issues.push({
883
- code: "invalid_format",
884
- format: "url",
885
- note: "Invalid protocol",
886
- pattern: t.protocol.source,
887
- input: n.value,
888
- inst: e,
889
- continue: !t.abort
890
- })), n.value = t.normalize ? i.href : r;
891
- return;
892
- } catch {
893
- n.issues.push({
894
- code: "invalid_format",
895
- format: "url",
896
- input: n.value,
897
- inst: e,
898
- continue: !t.abort
899
- });
900
- }
901
- };
902
- }), At = /*@__PURE__*/ t("$ZodEmoji", (e, t) => {
903
- t.pattern ??= Ue(), P.init(e, t);
904
- }), jt = /*@__PURE__*/ t("$ZodNanoID", (e, t) => {
905
- t.pattern ??= Le, P.init(e, t);
906
- }), Mt = /*@__PURE__*/ t("$ZodCUID", (e, t) => {
907
- t.pattern ??= Me, P.init(e, t);
908
- }), Nt = /*@__PURE__*/ t("$ZodCUID2", (e, t) => {
909
- t.pattern ??= Ne, P.init(e, t);
910
- }), Pt = /*@__PURE__*/ t("$ZodULID", (e, t) => {
911
- t.pattern ??= Pe, P.init(e, t);
912
- }), Ft = /*@__PURE__*/ t("$ZodXID", (e, t) => {
913
- t.pattern ??= Fe, P.init(e, t);
914
- }), It = /*@__PURE__*/ t("$ZodKSUID", (e, t) => {
915
- t.pattern ??= Ie, P.init(e, t);
916
- }), Lt = /*@__PURE__*/ t("$ZodISODateTime", (e, t) => {
917
- t.pattern ??= nt(t), P.init(e, t);
918
- }), Rt = /*@__PURE__*/ t("$ZodISODate", (e, t) => {
919
- t.pattern ??= $e, P.init(e, t);
920
- }), zt = /*@__PURE__*/ t("$ZodISOTime", (e, t) => {
921
- t.pattern ??= tt(t), P.init(e, t);
922
- }), Bt = /*@__PURE__*/ t("$ZodISODuration", (e, t) => {
923
- t.pattern ??= Re, P.init(e, t);
924
- }), Vt = /*@__PURE__*/ t("$ZodIPv4", (e, t) => {
925
- t.pattern ??= We, P.init(e, t), e._zod.bag.format = "ipv4";
926
- }), Ht = /*@__PURE__*/ t("$ZodIPv6", (e, t) => {
927
- t.pattern ??= Ge, P.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
928
- try {
929
- new URL(`http://[${n.value}]`);
930
- } catch {
931
- n.issues.push({
932
- code: "invalid_format",
933
- format: "ipv6",
934
- input: n.value,
935
- inst: e,
936
- continue: !t.abort
937
- });
938
- }
939
- };
940
- }), Ut = /*@__PURE__*/ t("$ZodCIDRv4", (e, t) => {
941
- t.pattern ??= Ke, P.init(e, t);
942
- }), Wt = /*@__PURE__*/ t("$ZodCIDRv6", (e, t) => {
943
- t.pattern ??= qe, P.init(e, t), e._zod.check = (n) => {
944
- let r = n.value.split("/");
945
- try {
946
- if (r.length !== 2) throw Error();
947
- let [e, t] = r;
948
- if (!t) throw Error();
949
- let n = Number(t);
950
- if (`${n}` !== t || n < 0 || n > 128) throw Error();
951
- new URL(`http://[${e}]`);
952
- } catch {
953
- n.issues.push({
954
- code: "invalid_format",
955
- format: "cidrv6",
956
- input: n.value,
957
- inst: e,
958
- continue: !t.abort
959
- });
960
- }
961
- };
962
- });
963
- function Gt(e) {
964
- if (e === "") return !0;
965
- if (/\s/.test(e) || e.length % 4 != 0) return !1;
966
- try {
967
- return atob(e), !0;
968
- } catch {
969
- return !1;
970
- }
971
- }
972
- var Kt = /*@__PURE__*/ t("$ZodBase64", (e, t) => {
973
- t.pattern ??= Je, P.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
974
- Gt(n.value) || n.issues.push({
975
- code: "invalid_format",
976
- format: "base64",
977
- input: n.value,
978
- inst: e,
979
- continue: !t.abort
980
- });
981
- };
982
- });
983
- function qt(e) {
984
- if (!Ye.test(e)) return !1;
985
- let t = e.replace(/[-_]/g, (e) => e === "-" ? "+" : "/");
986
- return Gt(t.padEnd(Math.ceil(t.length / 4) * 4, "="));
987
- }
988
- var Jt = /*@__PURE__*/ t("$ZodBase64URL", (e, t) => {
989
- t.pattern ??= Ye, P.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
990
- qt(n.value) || n.issues.push({
991
- code: "invalid_format",
992
- format: "base64url",
993
- input: n.value,
994
- inst: e,
995
- continue: !t.abort
996
- });
997
- };
998
- }), Yt = /*@__PURE__*/ t("$ZodE164", (e, t) => {
999
- t.pattern ??= Ze, P.init(e, t);
1000
- });
1001
- function Xt(e, t = null) {
1002
- try {
1003
- let n = e.split(".");
1004
- if (n.length !== 3) return !1;
1005
- let [r] = n;
1006
- if (!r) return !1;
1007
- let i = JSON.parse(atob(r));
1008
- return !("typ" in i && i?.typ !== "JWT" || !i.alg || t && (!("alg" in i) || i.alg !== t));
1009
- } catch {
1010
- return !1;
1011
- }
1012
- }
1013
- var Zt = /*@__PURE__*/ t("$ZodJWT", (e, t) => {
1014
- P.init(e, t), e._zod.check = (n) => {
1015
- Xt(n.value, t.alg) || n.issues.push({
1016
- code: "invalid_format",
1017
- format: "jwt",
1018
- input: n.value,
1019
- inst: e,
1020
- continue: !t.abort
1021
- });
1022
- };
1023
- }), Qt = /*@__PURE__*/ t("$ZodNumber", (e, t) => {
1024
- M.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? at, e._zod.parse = (n, r) => {
1025
- if (t.coerce) try {
1026
- n.value = Number(n.value);
1027
- } catch {}
1028
- let i = n.value;
1029
- if (typeof i == "number" && !Number.isNaN(i) && Number.isFinite(i)) return n;
1030
- let a = typeof i == "number" ? Number.isNaN(i) ? "NaN" : Number.isFinite(i) ? void 0 : "Infinity" : void 0;
1031
- return n.issues.push({
1032
- expected: "number",
1033
- code: "invalid_type",
1034
- input: i,
1035
- inst: e,
1036
- ...a ? { received: a } : {}
1037
- }), n;
1038
- };
1039
- }), $t = /*@__PURE__*/ t("$ZodNumberFormat", (e, t) => {
1040
- pt.init(e, t), Qt.init(e, t);
1041
- }), en = /*@__PURE__*/ t("$ZodBoolean", (e, t) => {
1042
- M.init(e, t), e._zod.pattern = ot, e._zod.parse = (n, r) => {
1043
- if (t.coerce) try {
1044
- n.value = !!n.value;
1045
- } catch {}
1046
- let i = n.value;
1047
- return typeof i == "boolean" || n.issues.push({
1048
- expected: "boolean",
1049
- code: "invalid_type",
1050
- input: i,
1051
- inst: e
1052
- }), n;
1053
- };
1054
- }), tn = /*@__PURE__*/ t("$ZodUnknown", (e, t) => {
1055
- M.init(e, t), e._zod.parse = (e) => e;
1056
- }), nn = /*@__PURE__*/ t("$ZodNever", (e, t) => {
1057
- M.init(e, t), e._zod.parse = (t, n) => (t.issues.push({
1058
- expected: "never",
1059
- code: "invalid_type",
1060
- input: t.value,
1061
- inst: e
1062
- }), t);
1063
- });
1064
- function rn(e, t, n) {
1065
- e.issues.length && t.issues.push(...ge(n, e.issues)), t.value[n] = e.value;
1066
- }
1067
- var an = /*@__PURE__*/ t("$ZodArray", (e, t) => {
1068
- M.init(e, t), e._zod.parse = (n, r) => {
1069
- let i = n.value;
1070
- if (!Array.isArray(i)) return n.issues.push({
1071
- expected: "array",
1072
- code: "invalid_type",
1073
- input: i,
1074
- inst: e
1075
- }), n;
1076
- n.value = Array(i.length);
1077
- let a = [];
1078
- for (let e = 0; e < i.length; e++) {
1079
- let o = i[e], s = t.element._zod.run({
1080
- value: o,
1081
- issues: []
1082
- }, r);
1083
- s instanceof Promise ? a.push(s.then((t) => rn(t, n, e))) : rn(s, n, e);
1084
- }
1085
- return a.length ? Promise.all(a).then(() => n) : n;
1086
- };
1087
- });
1088
- function F(e, t, n, r, i, a) {
1089
- let o = n in r;
1090
- if (e.issues.length) {
1091
- if (i && a && !o) return;
1092
- t.issues.push(...ge(n, e.issues));
1093
- }
1094
- if (!o && !i) {
1095
- e.issues.length || t.issues.push({
1096
- code: "invalid_type",
1097
- expected: "nonoptional",
1098
- input: void 0,
1099
- path: [n]
1100
- });
1101
- return;
1102
- }
1103
- e.value === void 0 ? o && (t.value[n] = void 0) : t.value[n] = e.value;
1104
- }
1105
- function on(e) {
1106
- let t = Object.keys(e.shape);
1107
- for (let n of t) if (!e.shape?.[n]?._zod?.traits?.has("$ZodType")) throw Error(`Invalid element at key "${n}": expected a Zod schema`);
1108
- let n = oe(e.shape);
1109
- return {
1110
- ...e,
1111
- keys: t,
1112
- keySet: new Set(t),
1113
- numKeys: t.length,
1114
- optionalKeys: new Set(n)
1115
- };
1116
- }
1117
- function sn(e, t, n, r, i, a) {
1118
- let o = [], s = i.keySet, c = i.catchall._zod, l = c.def.type, u = c.optin === "optional", d = c.optout === "optional";
1119
- for (let i in t) {
1120
- if (i === "__proto__" || s.has(i)) continue;
1121
- if (l === "never") {
1122
- o.push(i);
1123
- continue;
1124
- }
1125
- let a = c.run({
1126
- value: t[i],
1127
- issues: []
1128
- }, r);
1129
- a instanceof Promise ? e.push(a.then((e) => F(e, n, i, t, u, d))) : F(a, n, i, t, u, d);
1130
- }
1131
- return o.length && n.issues.push({
1132
- code: "unrecognized_keys",
1133
- keys: o,
1134
- input: t,
1135
- inst: a
1136
- }), e.length ? Promise.all(e).then(() => n) : n;
1137
- }
1138
- var cn = /*@__PURE__*/ t("$ZodObject", (e, t) => {
1139
- if (M.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
1140
- let e = t.shape;
1141
- Object.defineProperty(t, "shape", { get: () => {
1142
- let n = { ...e };
1143
- return Object.defineProperty(t, "shape", { value: n }), n;
1144
- } });
1145
- }
1146
- let n = c(() => on(t));
1147
- p(e._zod, "propValues", () => {
1148
- let e = t.shape, n = {};
1149
- for (let t in e) {
1150
- let r = e[t]._zod;
1151
- if (r.values) {
1152
- n[t] ?? (n[t] = /* @__PURE__ */ new Set());
1153
- for (let e of r.values) n[t].add(e);
1154
- }
1155
- }
1156
- return n;
1157
- });
1158
- let r = g, i = t.catchall, a;
1159
- e._zod.parse = (t, o) => {
1160
- a ??= n.value;
1161
- let s = t.value;
1162
- if (!r(s)) return t.issues.push({
1163
- expected: "object",
1164
- code: "invalid_type",
1165
- input: s,
1166
- inst: e
1167
- }), t;
1168
- t.value = {};
1169
- let c = [], l = a.shape;
1170
- for (let e of a.keys) {
1171
- let n = l[e], r = n._zod.optin === "optional", i = n._zod.optout === "optional", a = n._zod.run({
1172
- value: s[e],
1173
- issues: []
1174
- }, o);
1175
- a instanceof Promise ? c.push(a.then((n) => F(n, t, e, s, r, i))) : F(a, t, e, s, r, i);
1176
- }
1177
- return i ? sn(c, s, t, o, n.value, e) : c.length ? Promise.all(c).then(() => t) : t;
1178
- };
1179
- }), ln = /*@__PURE__*/ t("$ZodObjectJIT", (e, t) => {
1180
- cn.init(e, t);
1181
- let n = e._zod.parse, r = c(() => on(t)), a = (e) => {
1182
- let t = new wt([
1183
- "shape",
1184
- "payload",
1185
- "ctx"
1186
- ]), n = r.value, i = (e) => {
1187
- let t = ee(e);
1188
- return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`;
1189
- };
1190
- t.write("const input = payload.value;");
1191
- let a = Object.create(null), o = 0;
1192
- for (let e of n.keys) a[e] = `key_${o++}`;
1193
- t.write("const newResult = {};");
1194
- for (let r of n.keys) {
1195
- let n = a[r], o = ee(r), s = e[r], c = s?._zod?.optin === "optional", l = s?._zod?.optout === "optional";
1196
- t.write(`const ${n} = ${i(r)};`), c && l ? t.write(`
1197
- if (${n}.issues.length) {
1198
- if (${o} in input) {
1199
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
1200
- ...iss,
1201
- path: iss.path ? [${o}, ...iss.path] : [${o}]
1202
- })));
1203
- }
1204
- }
1205
-
1206
- if (${n}.value === undefined) {
1207
- if (${o} in input) {
1208
- newResult[${o}] = undefined;
1209
- }
1210
- } else {
1211
- newResult[${o}] = ${n}.value;
1212
- }
1213
-
1214
- `) : c ? t.write(`
1215
- if (${n}.issues.length) {
1216
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
1217
- ...iss,
1218
- path: iss.path ? [${o}, ...iss.path] : [${o}]
1219
- })));
1220
- }
1221
-
1222
- if (${n}.value === undefined) {
1223
- if (${o} in input) {
1224
- newResult[${o}] = undefined;
1225
- }
1226
- } else {
1227
- newResult[${o}] = ${n}.value;
1228
- }
1229
-
1230
- `) : t.write(`
1231
- const ${n}_present = ${o} in input;
1232
- if (${n}.issues.length) {
1233
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
1234
- ...iss,
1235
- path: iss.path ? [${o}, ...iss.path] : [${o}]
1236
- })));
1237
- }
1238
- if (!${n}_present && !${n}.issues.length) {
1239
- payload.issues.push({
1240
- code: "invalid_type",
1241
- expected: "nonoptional",
1242
- input: undefined,
1243
- path: [${o}]
1244
- });
1245
- }
1246
-
1247
- if (${n}_present) {
1248
- if (${n}.value === undefined) {
1249
- newResult[${o}] = undefined;
1250
- } else {
1251
- newResult[${o}] = ${n}.value;
1252
- }
1253
- }
1254
-
1255
- `);
1256
- }
1257
- t.write("payload.value = newResult;"), t.write("return payload;");
1258
- let s = t.compile();
1259
- return (t, n) => s(e, t, n);
1260
- }, o, s = g, l = !i.jitless, u = l && re.value, d = t.catchall, f;
1261
- e._zod.parse = (i, c) => {
1262
- f ??= r.value;
1263
- let p = i.value;
1264
- return s(p) ? l && u && c?.async === !1 && c.jitless !== !0 ? (o ||= a(t.shape), i = o(i, c), d ? sn([], p, i, c, f, e) : i) : n(i, c) : (i.issues.push({
1265
- expected: "object",
1266
- code: "invalid_type",
1267
- input: p,
1268
- inst: e
1269
- }), i);
1270
- };
1271
- });
1272
- function I(e, t, n, r) {
1273
- for (let n of e) if (n.issues.length === 0) return t.value = n.value, t;
1274
- let i = e.filter((e) => !x(e));
1275
- return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({
1276
- code: "invalid_union",
1277
- input: t.value,
1278
- inst: n,
1279
- errors: e.map((e) => e.issues.map((e) => C(e, r, a())))
1280
- }), t);
1281
- }
1282
- var un = /*@__PURE__*/ t("$ZodUnion", (e, t) => {
1283
- M.init(e, t), p(e._zod, "optin", () => t.options.some((e) => e._zod.optin === "optional") ? "optional" : void 0), p(e._zod, "optout", () => t.options.some((e) => e._zod.optout === "optional") ? "optional" : void 0), p(e._zod, "values", () => {
1284
- if (t.options.every((e) => e._zod.values)) return new Set(t.options.flatMap((e) => Array.from(e._zod.values)));
1285
- }), p(e._zod, "pattern", () => {
1286
- if (t.options.every((e) => e._zod.pattern)) {
1287
- let e = t.options.map((e) => e._zod.pattern);
1288
- return RegExp(`^(${e.map((e) => u(e.source)).join("|")})$`);
1289
- }
1290
- });
1291
- let n = t.options.length === 1 ? t.options[0]._zod.run : null;
1292
- e._zod.parse = (r, i) => {
1293
- if (n) return n(r, i);
1294
- let a = !1, o = [];
1295
- for (let e of t.options) {
1296
- let t = e._zod.run({
1297
- value: r.value,
1298
- issues: []
1299
- }, i);
1300
- if (t instanceof Promise) o.push(t), a = !0;
1301
- else {
1302
- if (t.issues.length === 0) return t;
1303
- o.push(t);
1304
- }
1305
- }
1306
- return a ? Promise.all(o).then((t) => I(t, r, e, i)) : I(o, r, e, i);
1307
- };
1308
- }), dn = /*@__PURE__*/ t("$ZodIntersection", (e, t) => {
1309
- M.init(e, t), e._zod.parse = (e, n) => {
1310
- let r = e.value, i = t.left._zod.run({
1311
- value: r,
1312
- issues: []
1313
- }, n), a = t.right._zod.run({
1314
- value: r,
1315
- issues: []
1316
- }, n);
1317
- return i instanceof Promise || a instanceof Promise ? Promise.all([i, a]).then(([t, n]) => fn(e, t, n)) : fn(e, i, a);
1318
- };
1319
- });
1320
- function L(e, t) {
1321
- if (e === t || e instanceof Date && t instanceof Date && +e == +t) return {
1322
- valid: !0,
1323
- data: e
1324
- };
1325
- if (_(e) && _(t)) {
1326
- let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = {
1327
- ...e,
1328
- ...t
1329
- };
1330
- for (let n of r) {
1331
- let r = L(e[n], t[n]);
1332
- if (!r.valid) return {
1333
- valid: !1,
1334
- mergeErrorPath: [n, ...r.mergeErrorPath]
1335
- };
1336
- i[n] = r.data;
1337
- }
1338
- return {
1339
- valid: !0,
1340
- data: i
1341
- };
1342
- }
1343
- if (Array.isArray(e) && Array.isArray(t)) {
1344
- if (e.length !== t.length) return {
1345
- valid: !1,
1346
- mergeErrorPath: []
1347
- };
1348
- let n = [];
1349
- for (let r = 0; r < e.length; r++) {
1350
- let i = e[r], a = t[r], o = L(i, a);
1351
- if (!o.valid) return {
1352
- valid: !1,
1353
- mergeErrorPath: [r, ...o.mergeErrorPath]
1354
- };
1355
- n.push(o.data);
1356
- }
1357
- return {
1358
- valid: !0,
1359
- data: n
1360
- };
1361
- }
1362
- return {
1363
- valid: !1,
1364
- mergeErrorPath: []
1365
- };
1366
- }
1367
- function fn(e, t, n) {
1368
- let r = /* @__PURE__ */ new Map(), i;
1369
- for (let n of t.issues) if (n.code === "unrecognized_keys") {
1370
- i ??= n;
1371
- for (let e of n.keys) r.has(e) || r.set(e, {}), r.get(e).l = !0;
1372
- } else e.issues.push(n);
1373
- 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;
1374
- else e.issues.push(t);
1375
- let a = [...r].filter(([, e]) => e.l && e.r).map(([e]) => e);
1376
- if (a.length && i && e.issues.push({
1377
- ...i,
1378
- keys: a
1379
- }), x(e)) return e;
1380
- let o = L(t.value, n.value);
1381
- if (!o.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);
1382
- return e.value = o.data, e;
1383
- }
1384
- var pn = /*@__PURE__*/ t("$ZodEnum", (e, t) => {
1385
- M.init(e, t);
1386
- let n = o(t.entries), r = new Set(n);
1387
- e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) => ae.has(typeof e)).map((e) => typeof e == "string" ? v(e) : e.toString()).join("|")})$`), e._zod.parse = (t, i) => {
1388
- let a = t.value;
1389
- return r.has(a) || t.issues.push({
1390
- code: "invalid_value",
1391
- values: n,
1392
- input: a,
1393
- inst: e
1394
- }), t;
1395
- };
1396
- }), mn = /*@__PURE__*/ t("$ZodTransform", (e, t) => {
1397
- M.init(e, t), e._zod.optin = "optional", e._zod.parse = (i, a) => {
1398
- if (a.direction === "backward") throw new r(e.constructor.name);
1399
- let o = t.transform(i.value, i);
1400
- if (a.async) return (o instanceof Promise ? o : Promise.resolve(o)).then((e) => (i.value = e, i.fallback = !0, i));
1401
- if (o instanceof Promise) throw new n();
1402
- return i.value = o, i.fallback = !0, i;
1403
- };
1404
- });
1405
- function hn(e, t) {
1406
- return t === void 0 && (e.issues.length || e.fallback) ? {
1407
- issues: [],
1408
- value: void 0
1409
- } : e;
1410
- }
1411
- var gn = /*@__PURE__*/ t("$ZodOptional", (e, t) => {
1412
- M.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", p(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), p(e._zod, "pattern", () => {
1413
- let e = t.innerType._zod.pattern;
1414
- return e ? RegExp(`^(${u(e.source)})?$`) : void 0;
1415
- }), e._zod.parse = (e, n) => {
1416
- if (t.innerType._zod.optin === "optional") {
1417
- let r = e.value, i = t.innerType._zod.run(e, n);
1418
- return i instanceof Promise ? i.then((e) => hn(e, r)) : hn(i, r);
1419
- }
1420
- return e.value === void 0 ? e : t.innerType._zod.run(e, n);
1421
- };
1422
- }), _n = /*@__PURE__*/ t("$ZodExactOptional", (e, t) => {
1423
- gn.init(e, t), p(e._zod, "values", () => t.innerType._zod.values), p(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (e, n) => t.innerType._zod.run(e, n);
1424
- }), vn = /*@__PURE__*/ t("$ZodNullable", (e, t) => {
1425
- M.init(e, t), p(e._zod, "optin", () => t.innerType._zod.optin), p(e._zod, "optout", () => t.innerType._zod.optout), p(e._zod, "pattern", () => {
1426
- let e = t.innerType._zod.pattern;
1427
- return e ? RegExp(`^(${u(e.source)}|null)$`) : void 0;
1428
- }), p(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (e, n) => e.value === null ? e : t.innerType._zod.run(e, n);
1429
- }), yn = /*@__PURE__*/ t("$ZodDefault", (e, t) => {
1430
- M.init(e, t), e._zod.optin = "optional", p(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
1431
- if (n.direction === "backward") return t.innerType._zod.run(e, n);
1432
- if (e.value === void 0) return e.value = t.defaultValue, e;
1433
- let r = t.innerType._zod.run(e, n);
1434
- return r instanceof Promise ? r.then((e) => bn(e, t)) : bn(r, t);
1435
- };
1436
- });
1437
- function bn(e, t) {
1438
- return e.value === void 0 && (e.value = t.defaultValue), e;
1439
- }
1440
- var xn = /*@__PURE__*/ t("$ZodPrefault", (e, t) => {
1441
- M.init(e, t), e._zod.optin = "optional", p(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));
1442
- }), Sn = /*@__PURE__*/ t("$ZodNonOptional", (e, t) => {
1443
- M.init(e, t), p(e._zod, "values", () => {
1444
- let e = t.innerType._zod.values;
1445
- return e ? new Set([...e].filter((e) => e !== void 0)) : void 0;
1446
- }), e._zod.parse = (n, r) => {
1447
- let i = t.innerType._zod.run(n, r);
1448
- return i instanceof Promise ? i.then((t) => Cn(t, e)) : Cn(i, e);
1449
- };
1450
- });
1451
- function Cn(e, t) {
1452
- return !e.issues.length && e.value === void 0 && e.issues.push({
1453
- code: "invalid_type",
1454
- expected: "nonoptional",
1455
- input: e.value,
1456
- inst: t
1457
- }), e;
1458
- }
1459
- var wn = /*@__PURE__*/ t("$ZodCatch", (e, t) => {
1460
- M.init(e, t), e._zod.optin = "optional", p(e._zod, "optout", () => t.innerType._zod.optout), p(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
1461
- if (n.direction === "backward") return t.innerType._zod.run(e, n);
1462
- let r = t.innerType._zod.run(e, n);
1463
- return r instanceof Promise ? r.then((r) => (e.value = r.value, r.issues.length && (e.value = t.catchValue({
1464
- ...e,
1465
- error: { issues: r.issues.map((e) => C(e, n, a())) },
1466
- input: e.value
1467
- }), e.issues = [], e.fallback = !0), e)) : (e.value = r.value, r.issues.length && (e.value = t.catchValue({
1468
- ...e,
1469
- error: { issues: r.issues.map((e) => C(e, n, a())) },
1470
- input: e.value
1471
- }), e.issues = [], e.fallback = !0), e);
1472
- };
1473
- }), Tn = /*@__PURE__*/ t("$ZodPipe", (e, t) => {
1474
- M.init(e, t), p(e._zod, "values", () => t.in._zod.values), p(e._zod, "optin", () => t.in._zod.optin), p(e._zod, "optout", () => t.out._zod.optout), p(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (e, n) => {
1475
- if (n.direction === "backward") {
1476
- let r = t.out._zod.run(e, n);
1477
- return r instanceof Promise ? r.then((e) => R(e, t.in, n)) : R(r, t.in, n);
1478
- }
1479
- let r = t.in._zod.run(e, n);
1480
- return r instanceof Promise ? r.then((e) => R(e, t.out, n)) : R(r, t.out, n);
1481
- };
1482
- });
1483
- function R(e, t, n) {
1484
- return e.issues.length ? (e.aborted = !0, e) : t._zod.run({
1485
- value: e.value,
1486
- issues: e.issues,
1487
- fallback: e.fallback
1488
- }, n);
1489
- }
1490
- var En = /*@__PURE__*/ t("$ZodReadonly", (e, t) => {
1491
- M.init(e, t), p(e._zod, "propValues", () => t.innerType._zod.propValues), p(e._zod, "values", () => t.innerType._zod.values), p(e._zod, "optin", () => t.innerType?._zod?.optin), p(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (e, n) => {
1492
- if (n.direction === "backward") return t.innerType._zod.run(e, n);
1493
- let r = t.innerType._zod.run(e, n);
1494
- return r instanceof Promise ? r.then(Dn) : Dn(r);
1495
- };
1496
- });
1497
- function Dn(e) {
1498
- return e.value = Object.freeze(e.value), e;
1499
- }
1500
- var On = /*@__PURE__*/ t("$ZodCustom", (e, t) => {
1501
- A.init(e, t), M.init(e, t), e._zod.parse = (e, t) => e, e._zod.check = (n) => {
1502
- let r = n.value, i = t.fn(r);
1503
- if (i instanceof Promise) return i.then((t) => kn(t, n, r, e));
1504
- kn(i, n, r, e);
1505
- };
1506
- });
1507
- function kn(e, t, n, r) {
1508
- if (!e) {
1509
- let e = {
1510
- code: "custom",
1511
- input: n,
1512
- inst: r,
1513
- path: [...r._zod.def.path ?? []],
1514
- continue: !r._zod.def.abort
1515
- };
1516
- r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(T(e));
1517
- }
1518
- }
1519
- //#endregion
1520
- //#region ../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/core/registries.js
1521
- var An, jn = class {
1522
- constructor() {
1523
- this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1524
- }
1525
- add(e, ...t) {
1526
- let n = t[0];
1527
- return this._map.set(e, n), n && typeof n == "object" && "id" in n && this._idmap.set(n.id, e), this;
1528
- }
1529
- clear() {
1530
- return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
1531
- }
1532
- remove(e) {
1533
- let t = this._map.get(e);
1534
- return t && typeof t == "object" && "id" in t && this._idmap.delete(t.id), this._map.delete(e), this;
1535
- }
1536
- get(e) {
1537
- let t = e._zod.parent;
1538
- if (t) {
1539
- let n = { ...this.get(t) ?? {} };
1540
- delete n.id;
1541
- let r = {
1542
- ...n,
1543
- ...this._map.get(e)
1544
- };
1545
- return Object.keys(r).length ? r : void 0;
1546
- }
1547
- return this._map.get(e);
1548
- }
1549
- has(e) {
1550
- return this._map.has(e);
1551
- }
1552
- };
1553
- function Mn() {
1554
- return new jn();
1555
- }
1556
- (An = globalThis).__zod_globalRegistry ?? (An.__zod_globalRegistry = Mn());
1557
- var z = globalThis.__zod_globalRegistry;
1558
- //#endregion
1559
- //#region ../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/core/api.js
1560
- // @__NO_SIDE_EFFECTS__
1561
- function Nn(e, t) {
1562
- return new e({
1563
- type: "string",
1564
- ...b(t)
1565
- });
1566
- }
1567
- // @__NO_SIDE_EFFECTS__
1568
- function Pn(e, t) {
1569
- return new e({
1570
- type: "string",
1571
- format: "email",
1572
- check: "string_format",
1573
- abort: !1,
1574
- ...b(t)
1575
- });
1576
- }
1577
- // @__NO_SIDE_EFFECTS__
1578
- function Fn(e, t) {
1579
- return new e({
1580
- type: "string",
1581
- format: "guid",
1582
- check: "string_format",
1583
- abort: !1,
1584
- ...b(t)
1585
- });
1586
- }
1587
- // @__NO_SIDE_EFFECTS__
1588
- function In(e, t) {
1589
- return new e({
1590
- type: "string",
1591
- format: "uuid",
1592
- check: "string_format",
1593
- abort: !1,
1594
- ...b(t)
1595
- });
1596
- }
1597
- // @__NO_SIDE_EFFECTS__
1598
- function Ln(e, t) {
1599
- return new e({
1600
- type: "string",
1601
- format: "uuid",
1602
- check: "string_format",
1603
- abort: !1,
1604
- version: "v4",
1605
- ...b(t)
1606
- });
1607
- }
1608
- // @__NO_SIDE_EFFECTS__
1609
- function Rn(e, t) {
1610
- return new e({
1611
- type: "string",
1612
- format: "uuid",
1613
- check: "string_format",
1614
- abort: !1,
1615
- version: "v6",
1616
- ...b(t)
1617
- });
1618
- }
1619
- // @__NO_SIDE_EFFECTS__
1620
- function zn(e, t) {
1621
- return new e({
1622
- type: "string",
1623
- format: "uuid",
1624
- check: "string_format",
1625
- abort: !1,
1626
- version: "v7",
1627
- ...b(t)
1628
- });
1629
- }
1630
- // @__NO_SIDE_EFFECTS__
1631
- function Bn(e, t) {
1632
- return new e({
1633
- type: "string",
1634
- format: "url",
1635
- check: "string_format",
1636
- abort: !1,
1637
- ...b(t)
1638
- });
1639
- }
1640
- // @__NO_SIDE_EFFECTS__
1641
- function Vn(e, t) {
1642
- return new e({
1643
- type: "string",
1644
- format: "emoji",
1645
- check: "string_format",
1646
- abort: !1,
1647
- ...b(t)
1648
- });
1649
- }
1650
- // @__NO_SIDE_EFFECTS__
1651
- function Hn(e, t) {
1652
- return new e({
1653
- type: "string",
1654
- format: "nanoid",
1655
- check: "string_format",
1656
- abort: !1,
1657
- ...b(t)
1658
- });
1659
- }
1660
- // @__NO_SIDE_EFFECTS__
1661
- function Un(e, t) {
1662
- return new e({
1663
- type: "string",
1664
- format: "cuid",
1665
- check: "string_format",
1666
- abort: !1,
1667
- ...b(t)
1668
- });
1669
- }
1670
- // @__NO_SIDE_EFFECTS__
1671
- function Wn(e, t) {
1672
- return new e({
1673
- type: "string",
1674
- format: "cuid2",
1675
- check: "string_format",
1676
- abort: !1,
1677
- ...b(t)
1678
- });
1679
- }
1680
- // @__NO_SIDE_EFFECTS__
1681
- function Gn(e, t) {
1682
- return new e({
1683
- type: "string",
1684
- format: "ulid",
1685
- check: "string_format",
1686
- abort: !1,
1687
- ...b(t)
1688
- });
1689
- }
1690
- // @__NO_SIDE_EFFECTS__
1691
- function Kn(e, t) {
1692
- return new e({
1693
- type: "string",
1694
- format: "xid",
1695
- check: "string_format",
1696
- abort: !1,
1697
- ...b(t)
1698
- });
1699
- }
1700
- // @__NO_SIDE_EFFECTS__
1701
- function qn(e, t) {
1702
- return new e({
1703
- type: "string",
1704
- format: "ksuid",
1705
- check: "string_format",
1706
- abort: !1,
1707
- ...b(t)
1708
- });
1709
- }
1710
- // @__NO_SIDE_EFFECTS__
1711
- function Jn(e, t) {
1712
- return new e({
1713
- type: "string",
1714
- format: "ipv4",
1715
- check: "string_format",
1716
- abort: !1,
1717
- ...b(t)
1718
- });
1719
- }
1720
- // @__NO_SIDE_EFFECTS__
1721
- function Yn(e, t) {
1722
- return new e({
1723
- type: "string",
1724
- format: "ipv6",
1725
- check: "string_format",
1726
- abort: !1,
1727
- ...b(t)
1728
- });
1729
- }
1730
- // @__NO_SIDE_EFFECTS__
1731
- function Xn(e, t) {
1732
- return new e({
1733
- type: "string",
1734
- format: "cidrv4",
1735
- check: "string_format",
1736
- abort: !1,
1737
- ...b(t)
1738
- });
1739
- }
1740
- // @__NO_SIDE_EFFECTS__
1741
- function Zn(e, t) {
1742
- return new e({
1743
- type: "string",
1744
- format: "cidrv6",
1745
- check: "string_format",
1746
- abort: !1,
1747
- ...b(t)
1748
- });
1749
- }
1750
- // @__NO_SIDE_EFFECTS__
1751
- function Qn(e, t) {
1752
- return new e({
1753
- type: "string",
1754
- format: "base64",
1755
- check: "string_format",
1756
- abort: !1,
1757
- ...b(t)
1758
- });
1759
- }
1760
- // @__NO_SIDE_EFFECTS__
1761
- function $n(e, t) {
1762
- return new e({
1763
- type: "string",
1764
- format: "base64url",
1765
- check: "string_format",
1766
- abort: !1,
1767
- ...b(t)
1768
- });
1769
- }
1770
- // @__NO_SIDE_EFFECTS__
1771
- function er(e, t) {
1772
- return new e({
1773
- type: "string",
1774
- format: "e164",
1775
- check: "string_format",
1776
- abort: !1,
1777
- ...b(t)
1778
- });
1779
- }
1780
- // @__NO_SIDE_EFFECTS__
1781
- function tr(e, t) {
1782
- return new e({
1783
- type: "string",
1784
- format: "jwt",
1785
- check: "string_format",
1786
- abort: !1,
1787
- ...b(t)
1788
- });
1789
- }
1790
- // @__NO_SIDE_EFFECTS__
1791
- function nr(e, t) {
1792
- return new e({
1793
- type: "string",
1794
- format: "datetime",
1795
- check: "string_format",
1796
- offset: !1,
1797
- local: !1,
1798
- precision: null,
1799
- ...b(t)
1800
- });
1801
- }
1802
- // @__NO_SIDE_EFFECTS__
1803
- function rr(e, t) {
1804
- return new e({
1805
- type: "string",
1806
- format: "date",
1807
- check: "string_format",
1808
- ...b(t)
1809
- });
1810
- }
1811
- // @__NO_SIDE_EFFECTS__
1812
- function ir(e, t) {
1813
- return new e({
1814
- type: "string",
1815
- format: "time",
1816
- check: "string_format",
1817
- precision: null,
1818
- ...b(t)
1819
- });
1820
- }
1821
- // @__NO_SIDE_EFFECTS__
1822
- function ar(e, t) {
1823
- return new e({
1824
- type: "string",
1825
- format: "duration",
1826
- check: "string_format",
1827
- ...b(t)
1828
- });
1829
- }
1830
- // @__NO_SIDE_EFFECTS__
1831
- function or(e, t) {
1832
- return new e({
1833
- type: "number",
1834
- checks: [],
1835
- ...b(t)
1836
- });
1837
- }
1838
- // @__NO_SIDE_EFFECTS__
1839
- function sr(e, t) {
1840
- return new e({
1841
- type: "number",
1842
- check: "number_format",
1843
- abort: !1,
1844
- format: "safeint",
1845
- ...b(t)
1846
- });
1847
- }
1848
- // @__NO_SIDE_EFFECTS__
1849
- function cr(e, t) {
1850
- return new e({
1851
- type: "boolean",
1852
- ...b(t)
1853
- });
1854
- }
1855
- // @__NO_SIDE_EFFECTS__
1856
- function lr(e) {
1857
- return new e({ type: "unknown" });
1858
- }
1859
- // @__NO_SIDE_EFFECTS__
1860
- function ur(e, t) {
1861
- return new e({
1862
- type: "never",
1863
- ...b(t)
1864
- });
1865
- }
1866
- // @__NO_SIDE_EFFECTS__
1867
- function dr(e, t) {
1868
- return new ut({
1869
- check: "less_than",
1870
- ...b(t),
1871
- value: e,
1872
- inclusive: !1
1873
- });
1874
- }
1875
- // @__NO_SIDE_EFFECTS__
1876
- function B(e, t) {
1877
- return new ut({
1878
- check: "less_than",
1879
- ...b(t),
1880
- value: e,
1881
- inclusive: !0
1882
- });
1883
- }
1884
- // @__NO_SIDE_EFFECTS__
1885
- function V(e, t) {
1886
- return new dt({
1887
- check: "greater_than",
1888
- ...b(t),
1889
- value: e,
1890
- inclusive: !1
1891
- });
1892
- }
1893
- // @__NO_SIDE_EFFECTS__
1894
- function H(e, t) {
1895
- return new dt({
1896
- check: "greater_than",
1897
- ...b(t),
1898
- value: e,
1899
- inclusive: !0
1900
- });
1901
- }
1902
- // @__NO_SIDE_EFFECTS__
1903
- function fr(e, t) {
1904
- return new ft({
1905
- check: "multiple_of",
1906
- ...b(t),
1907
- value: e
1908
- });
1909
- }
1910
- // @__NO_SIDE_EFFECTS__
1911
- function pr(e, t) {
1912
- return new mt({
1913
- check: "max_length",
1914
- ...b(t),
1915
- maximum: e
1916
- });
1917
- }
1918
- // @__NO_SIDE_EFFECTS__
1919
- function U(e, t) {
1920
- return new ht({
1921
- check: "min_length",
1922
- ...b(t),
1923
- minimum: e
1924
- });
1925
- }
1926
- // @__NO_SIDE_EFFECTS__
1927
- function mr(e, t) {
1928
- return new gt({
1929
- check: "length_equals",
1930
- ...b(t),
1931
- length: e
1932
- });
1933
- }
1934
- // @__NO_SIDE_EFFECTS__
1935
- function hr(e, t) {
1936
- return new _t({
1937
- check: "string_format",
1938
- format: "regex",
1939
- ...b(t),
1940
- pattern: e
1941
- });
1942
- }
1943
- // @__NO_SIDE_EFFECTS__
1944
- function gr(e) {
1945
- return new vt({
1946
- check: "string_format",
1947
- format: "lowercase",
1948
- ...b(e)
1949
- });
1950
- }
1951
- // @__NO_SIDE_EFFECTS__
1952
- function _r(e) {
1953
- return new yt({
1954
- check: "string_format",
1955
- format: "uppercase",
1956
- ...b(e)
1957
- });
1958
- }
1959
- // @__NO_SIDE_EFFECTS__
1960
- function vr(e, t) {
1961
- return new bt({
1962
- check: "string_format",
1963
- format: "includes",
1964
- ...b(t),
1965
- includes: e
1966
- });
1967
- }
1968
- // @__NO_SIDE_EFFECTS__
1969
- function yr(e, t) {
1970
- return new xt({
1971
- check: "string_format",
1972
- format: "starts_with",
1973
- ...b(t),
1974
- prefix: e
1975
- });
1976
- }
1977
- // @__NO_SIDE_EFFECTS__
1978
- function br(e, t) {
1979
- return new St({
1980
- check: "string_format",
1981
- format: "ends_with",
1982
- ...b(t),
1983
- suffix: e
1984
- });
1985
- }
1986
- // @__NO_SIDE_EFFECTS__
1987
- function W(e) {
1988
- return new Ct({
1989
- check: "overwrite",
1990
- tx: e
1991
- });
1992
- }
1993
- // @__NO_SIDE_EFFECTS__
1994
- function xr(e) {
1995
- return /* @__PURE__ */ W((t) => t.normalize(e));
1996
- }
1997
- // @__NO_SIDE_EFFECTS__
1998
- function Sr() {
1999
- return /* @__PURE__ */ W((e) => e.trim());
2000
- }
2001
- // @__NO_SIDE_EFFECTS__
2002
- function Cr() {
2003
- return /* @__PURE__ */ W((e) => e.toLowerCase());
2004
- }
2005
- // @__NO_SIDE_EFFECTS__
2006
- function wr() {
2007
- return /* @__PURE__ */ W((e) => e.toUpperCase());
2008
- }
2009
- // @__NO_SIDE_EFFECTS__
2010
- function Tr() {
2011
- return /* @__PURE__ */ W((e) => te(e));
2012
- }
2013
- // @__NO_SIDE_EFFECTS__
2014
- function Er(e, t, n) {
2015
- return new e({
2016
- type: "array",
2017
- element: t,
2018
- ...b(n)
2019
- });
2020
- }
2021
- // @__NO_SIDE_EFFECTS__
2022
- function Dr(e, t, n) {
2023
- return new e({
2024
- type: "custom",
2025
- check: "custom",
2026
- fn: t,
2027
- ...b(n)
2028
- });
2029
- }
2030
- // @__NO_SIDE_EFFECTS__
2031
- function Or(e, t) {
2032
- let n = /* @__PURE__ */ kr((t) => (t.addIssue = (e) => {
2033
- if (typeof e == "string") t.issues.push(T(e, t.value, n._zod.def));
2034
- else {
2035
- let r = e;
2036
- r.fatal && (r.continue = !1), r.code ??= "custom", r.input ??= t.value, r.inst ??= n, r.continue ??= !n._zod.def.abort, t.issues.push(T(r));
2037
- }
2038
- }, e(t.value, t)), t);
2039
- return n;
2040
- }
2041
- // @__NO_SIDE_EFFECTS__
2042
- function kr(e, t) {
2043
- let n = new A({
2044
- check: "custom",
2045
- ...b(t)
2046
- });
2047
- return n._zod.check = e, n;
2048
- }
2049
- //#endregion
2050
- //#region ../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
2051
- function Ar(e) {
2052
- let t = e?.target ?? "draft-2020-12";
2053
- return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
2054
- processors: e.processors ?? {},
2055
- metadataRegistry: e?.metadata ?? z,
2056
- target: t,
2057
- unrepresentable: e?.unrepresentable ?? "throw",
2058
- override: e?.override ?? (() => {}),
2059
- io: e?.io ?? "output",
2060
- counter: 0,
2061
- seen: /* @__PURE__ */ new Map(),
2062
- cycles: e?.cycles ?? "ref",
2063
- reused: e?.reused ?? "inline",
2064
- external: e?.external ?? void 0
2065
- };
2066
- }
2067
- function G(e, t, n = {
2068
- path: [],
2069
- schemaPath: []
2070
- }) {
2071
- var r;
2072
- let i = e._zod.def, a = t.seen.get(e);
2073
- if (a) return a.count++, n.schemaPath.includes(e) && (a.cycle = n.path), a.schema;
2074
- let o = {
2075
- schema: {},
2076
- count: 1,
2077
- cycle: void 0,
2078
- path: n.path
2079
- };
2080
- t.seen.set(e, o);
2081
- let s = e._zod.toJSONSchema?.();
2082
- if (s) o.schema = s;
2083
- else {
2084
- let r = {
2085
- ...n,
2086
- schemaPath: [...n.schemaPath, e],
2087
- path: n.path
2088
- };
2089
- if (e._zod.processJSONSchema) e._zod.processJSONSchema(t, o.schema, r);
2090
- else {
2091
- let n = o.schema, a = t.processors[i.type];
2092
- if (!a) throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);
2093
- a(e, t, n, r);
2094
- }
2095
- let a = e._zod.parent;
2096
- a && (o.ref ||= a, G(a, t, r), t.seen.get(a).isParent = !0);
2097
- }
2098
- let c = t.metadataRegistry.get(e);
2099
- return c && Object.assign(o.schema, c), t.io === "input" && K(e) && (delete o.schema.examples, delete o.schema.default), t.io === "input" && "_prefault" in o.schema && ((r = o.schema).default ?? (r.default = o.schema._prefault)), delete o.schema._prefault, t.seen.get(e).schema;
2100
- }
2101
- function jr(e, t) {
2102
- let n = e.seen.get(t);
2103
- if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
2104
- let r = /* @__PURE__ */ new Map();
2105
- for (let t of e.seen.entries()) {
2106
- let n = e.metadataRegistry.get(t[0])?.id;
2107
- if (n) {
2108
- let e = r.get(n);
2109
- 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.`);
2110
- r.set(n, t[0]);
2111
- }
2112
- }
2113
- let i = (t) => {
2114
- let r = e.target === "draft-2020-12" ? "$defs" : "definitions";
2115
- if (e.external) {
2116
- let n = e.external.registry.get(t[0])?.id, i = e.external.uri ?? ((e) => e);
2117
- if (n) return { ref: i(n) };
2118
- let a = t[1].defId ?? t[1].schema.id ?? `schema${e.counter++}`;
2119
- return t[1].defId = a, {
2120
- defId: a,
2121
- ref: `${i("__shared")}#/${r}/${a}`
2122
- };
2123
- }
2124
- if (t[1] === n) return { ref: "#" };
2125
- let i = `#/${r}/`, a = t[1].schema.id ?? `__schema${e.counter++}`;
2126
- return {
2127
- defId: a,
2128
- ref: i + a
2129
- };
2130
- }, a = (e) => {
2131
- if (e[1].schema.$ref) return;
2132
- let t = e[1], { ref: n, defId: r } = i(e);
2133
- t.def = { ...t.schema }, r && (t.defId = r);
2134
- let a = t.schema;
2135
- for (let e in a) delete a[e];
2136
- a.$ref = n;
2137
- };
2138
- if (e.cycles === "throw") for (let t of e.seen.entries()) {
2139
- let e = t[1];
2140
- if (e.cycle) throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
2141
-
2142
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
2143
- }
2144
- for (let n of e.seen.entries()) {
2145
- let r = n[1];
2146
- if (t === n[0]) {
2147
- a(n);
2148
- continue;
2149
- }
2150
- if (e.external) {
2151
- let r = e.external.registry.get(n[0])?.id;
2152
- if (t !== n[0] && r) {
2153
- a(n);
2154
- continue;
2155
- }
2156
- }
2157
- if (e.metadataRegistry.get(n[0])?.id) {
2158
- a(n);
2159
- continue;
2160
- }
2161
- if (r.cycle) {
2162
- a(n);
2163
- continue;
2164
- }
2165
- if (r.count > 1 && e.reused === "ref") {
2166
- a(n);
2167
- continue;
2168
- }
2169
- }
2170
- }
2171
- function Mr(e, t) {
2172
- let n = e.seen.get(t);
2173
- if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
2174
- let r = (t) => {
2175
- let n = e.seen.get(t);
2176
- if (n.ref === null) return;
2177
- let i = n.def ?? n.schema, a = { ...i }, o = n.ref;
2178
- if (n.ref = null, o) {
2179
- r(o);
2180
- let n = e.seen.get(o), s = n.schema;
2181
- 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]);
2182
- 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];
2183
- }
2184
- let s = t._zod.parent;
2185
- if (s && s !== o) {
2186
- r(s);
2187
- let t = e.seen.get(s);
2188
- 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];
2189
- }
2190
- e.override({
2191
- zodSchema: t,
2192
- jsonSchema: i,
2193
- path: n.path ?? []
2194
- });
2195
- };
2196
- for (let t of [...e.seen.entries()].reverse()) r(t[0]);
2197
- let i = {};
2198
- 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) {
2199
- let n = e.external.registry.get(t)?.id;
2200
- if (!n) throw Error("Schema is missing an `id` property");
2201
- i.$id = e.external.uri(n);
2202
- }
2203
- Object.assign(i, n.def ?? n.schema);
2204
- let a = e.metadataRegistry.get(t)?.id;
2205
- a !== void 0 && i.id === a && delete i.id;
2206
- let o = e.external?.defs ?? {};
2207
- for (let t of e.seen.entries()) {
2208
- let e = t[1];
2209
- e.def && e.defId && (e.def.id === e.defId && delete e.def.id, o[e.defId] = e.def);
2210
- }
2211
- e.external || Object.keys(o).length > 0 && (e.target === "draft-2020-12" ? i.$defs = o : i.definitions = o);
2212
- try {
2213
- let n = JSON.parse(JSON.stringify(i));
2214
- return Object.defineProperty(n, "~standard", {
2215
- value: {
2216
- ...t["~standard"],
2217
- jsonSchema: {
2218
- input: q(t, "input", e.processors),
2219
- output: q(t, "output", e.processors)
2220
- }
2221
- },
2222
- enumerable: !1,
2223
- writable: !1
2224
- }), n;
2225
- } catch {
2226
- throw Error("Error converting schema to JSON.");
2227
- }
2228
- }
2229
- function K(e, t) {
2230
- let n = t ?? { seen: /* @__PURE__ */ new Set() };
2231
- if (n.seen.has(e)) return !1;
2232
- n.seen.add(e);
2233
- let r = e._zod.def;
2234
- if (r.type === "transform") return !0;
2235
- if (r.type === "array") return K(r.element, n);
2236
- if (r.type === "set") return K(r.valueType, n);
2237
- if (r.type === "lazy") return K(r.getter(), n);
2238
- if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault") return K(r.innerType, n);
2239
- if (r.type === "intersection") return K(r.left, n) || K(r.right, n);
2240
- if (r.type === "record" || r.type === "map") return K(r.keyType, n) || K(r.valueType, n);
2241
- if (r.type === "pipe") return e._zod.traits.has("$ZodCodec") ? !0 : K(r.in, n) || K(r.out, n);
2242
- if (r.type === "object") {
2243
- for (let e in r.shape) if (K(r.shape[e], n)) return !0;
2244
- return !1;
2245
- }
2246
- if (r.type === "union") {
2247
- for (let e of r.options) if (K(e, n)) return !0;
2248
- return !1;
2249
- }
2250
- if (r.type === "tuple") {
2251
- for (let e of r.items) if (K(e, n)) return !0;
2252
- return !!(r.rest && K(r.rest, n));
2253
- }
2254
- return !1;
2255
- }
2256
- var Nr = (e, t = {}) => (n) => {
2257
- let r = Ar({
2258
- ...n,
2259
- processors: t
2260
- });
2261
- return G(e, r), jr(r, e), Mr(r, e);
2262
- }, q = (e, t, n = {}) => (r) => {
2263
- let { libraryOptions: i, target: a } = r ?? {}, o = Ar({
2264
- ...i ?? {},
2265
- target: a,
2266
- io: t,
2267
- processors: n
2268
- });
2269
- return G(e, o), jr(o, e), Mr(o, e);
2270
- }, Pr = {
2271
- guid: "uuid",
2272
- url: "uri",
2273
- datetime: "date-time",
2274
- json_string: "json-string",
2275
- regex: ""
2276
- }, Fr = (e, t, n, r) => {
2277
- let i = n;
2278
- i.type = "string";
2279
- let { minimum: a, maximum: o, format: s, patterns: c, contentEncoding: l } = e._zod.bag;
2280
- if (typeof a == "number" && (i.minLength = a), typeof o == "number" && (i.maxLength = o), s && (i.format = Pr[s] ?? s, i.format === "" && delete i.format, s === "time" && delete i.format), l && (i.contentEncoding = l), c && c.size > 0) {
2281
- let e = [...c];
2282
- e.length === 1 ? i.pattern = e[0].source : e.length > 1 && (i.allOf = [...e.map((e) => ({
2283
- ...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
2284
- pattern: e.source
2285
- }))]);
2286
- }
2287
- }, Ir = (e, t, n, r) => {
2288
- let i = n, { minimum: a, maximum: o, format: s, multipleOf: c, exclusiveMaximum: l, exclusiveMinimum: u } = e._zod.bag;
2289
- i.type = typeof s == "string" && s.includes("int") ? "integer" : "number";
2290
- let d = typeof u == "number" && u >= (a ?? -Infinity), f = typeof l == "number" && l <= (o ?? Infinity), p = t.target === "draft-04" || t.target === "openapi-3.0";
2291
- d ? p ? (i.minimum = u, i.exclusiveMinimum = !0) : i.exclusiveMinimum = u : typeof a == "number" && (i.minimum = a), f ? p ? (i.maximum = l, i.exclusiveMaximum = !0) : i.exclusiveMaximum = l : typeof o == "number" && (i.maximum = o), typeof c == "number" && (i.multipleOf = c);
2292
- }, Lr = (e, t, n, r) => {
2293
- n.type = "boolean";
2294
- }, Rr = (e, t, n, r) => {
2295
- n.not = {};
2296
- }, zr = (e, t, n, r) => {
2297
- let i = e._zod.def, a = o(i.entries);
2298
- a.every((e) => typeof e == "number") && (n.type = "number"), a.every((e) => typeof e == "string") && (n.type = "string"), n.enum = a;
2299
- }, Br = (e, t, n, r) => {
2300
- if (t.unrepresentable === "throw") throw Error("Custom types cannot be represented in JSON Schema");
2301
- }, Vr = (e, t, n, r) => {
2302
- if (t.unrepresentable === "throw") throw Error("Transforms cannot be represented in JSON Schema");
2303
- }, Hr = (e, t, n, r) => {
2304
- let i = n, a = e._zod.def, { minimum: o, maximum: s } = e._zod.bag;
2305
- typeof o == "number" && (i.minItems = o), typeof s == "number" && (i.maxItems = s), i.type = "array", i.items = G(a.element, t, {
2306
- ...r,
2307
- path: [...r.path, "items"]
2308
- });
2309
- }, Ur = (e, t, n, r) => {
2310
- let i = n, a = e._zod.def;
2311
- i.type = "object", i.properties = {};
2312
- let o = a.shape;
2313
- for (let e in o) i.properties[e] = G(o[e], t, {
2314
- ...r,
2315
- path: [
2316
- ...r.path,
2317
- "properties",
2318
- e
2319
- ]
2320
- });
2321
- let s = new Set(Object.keys(o)), c = new Set([...s].filter((e) => {
2322
- let n = a.shape[e]._zod;
2323
- return t.io === "input" ? n.optin === void 0 : n.optout === void 0;
2324
- }));
2325
- c.size > 0 && (i.required = Array.from(c)), a.catchall?._zod.def.type === "never" ? i.additionalProperties = !1 : a.catchall ? a.catchall && (i.additionalProperties = G(a.catchall, t, {
2326
- ...r,
2327
- path: [...r.path, "additionalProperties"]
2328
- })) : t.io === "output" && (i.additionalProperties = !1);
2329
- }, Wr = (e, t, n, r) => {
2330
- let i = e._zod.def, a = i.inclusive === !1, o = i.options.map((e, n) => G(e, t, {
2331
- ...r,
2332
- path: [
2333
- ...r.path,
2334
- a ? "oneOf" : "anyOf",
2335
- n
2336
- ]
2337
- }));
2338
- a ? n.oneOf = o : n.anyOf = o;
2339
- }, Gr = (e, t, n, r) => {
2340
- let i = e._zod.def, a = G(i.left, t, {
2341
- ...r,
2342
- path: [
2343
- ...r.path,
2344
- "allOf",
2345
- 0
2346
- ]
2347
- }), o = G(i.right, t, {
2348
- ...r,
2349
- path: [
2350
- ...r.path,
2351
- "allOf",
2352
- 1
2353
- ]
2354
- }), s = (e) => "allOf" in e && Object.keys(e).length === 1;
2355
- n.allOf = [...s(a) ? a.allOf : [a], ...s(o) ? o.allOf : [o]];
2356
- }, Kr = (e, t, n, r) => {
2357
- let i = e._zod.def, a = G(i.innerType, t, r), o = t.seen.get(e);
2358
- t.target === "openapi-3.0" ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [a, { type: "null" }];
2359
- }, qr = (e, t, n, r) => {
2360
- let i = e._zod.def;
2361
- G(i.innerType, t, r);
2362
- let a = t.seen.get(e);
2363
- a.ref = i.innerType;
2364
- }, Jr = (e, t, n, r) => {
2365
- let i = e._zod.def;
2366
- G(i.innerType, t, r);
2367
- let a = t.seen.get(e);
2368
- a.ref = i.innerType, n.default = JSON.parse(JSON.stringify(i.defaultValue));
2369
- }, Yr = (e, t, n, r) => {
2370
- let i = e._zod.def;
2371
- G(i.innerType, t, r);
2372
- let a = t.seen.get(e);
2373
- a.ref = i.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(i.defaultValue)));
2374
- }, Xr = (e, t, n, r) => {
2375
- let i = e._zod.def;
2376
- G(i.innerType, t, r);
2377
- let a = t.seen.get(e);
2378
- a.ref = i.innerType;
2379
- let o;
2380
- try {
2381
- o = i.catchValue(void 0);
2382
- } catch {
2383
- throw Error("Dynamic catch values are not supported in JSON Schema");
2384
- }
2385
- n.default = o;
2386
- }, Zr = (e, t, n, r) => {
2387
- let i = e._zod.def, a = i.in._zod.traits.has("$ZodTransform"), o = t.io === "input" ? a ? i.out : i.in : i.out;
2388
- G(o, t, r);
2389
- let s = t.seen.get(e);
2390
- s.ref = o;
2391
- }, Qr = (e, t, n, r) => {
2392
- let i = e._zod.def;
2393
- G(i.innerType, t, r);
2394
- let a = t.seen.get(e);
2395
- a.ref = i.innerType, n.readOnly = !0;
2396
- }, $r = (e, t, n, r) => {
2397
- let i = e._zod.def;
2398
- G(i.innerType, t, r);
2399
- let a = t.seen.get(e);
2400
- a.ref = i.innerType;
2401
- }, ei = /*@__PURE__*/ t("ZodISODateTime", (e, t) => {
2402
- Lt.init(e, t), Z.init(e, t);
2403
- });
2404
- function ti(e) {
2405
- return /* @__PURE__ */ nr(ei, e);
2406
- }
2407
- var ni = /*@__PURE__*/ t("ZodISODate", (e, t) => {
2408
- Rt.init(e, t), Z.init(e, t);
2409
- });
2410
- function ri(e) {
2411
- return /* @__PURE__ */ rr(ni, e);
2412
- }
2413
- var ii = /*@__PURE__*/ t("ZodISOTime", (e, t) => {
2414
- zt.init(e, t), Z.init(e, t);
2415
- });
2416
- function ai(e) {
2417
- return /* @__PURE__ */ ir(ii, e);
2418
- }
2419
- var oi = /*@__PURE__*/ t("ZodISODuration", (e, t) => {
2420
- Bt.init(e, t), Z.init(e, t);
2421
- });
2422
- function si(e) {
2423
- return /* @__PURE__ */ ar(oi, e);
2424
- }
2425
- var J = /*@__PURE__*/ t("ZodError", (e, t) => {
2426
- ve.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
2427
- format: { value: (t) => xe(e, t) },
2428
- flatten: { value: (t) => be(e, t) },
2429
- addIssue: { value: (t) => {
2430
- e.issues.push(t), e.message = JSON.stringify(e.issues, s, 2);
2431
- } },
2432
- addIssues: { value: (t) => {
2433
- e.issues.push(...t), e.message = JSON.stringify(e.issues, s, 2);
2434
- } },
2435
- isEmpty: { get() {
2436
- return e.issues.length === 0;
2437
- } }
2438
- });
2439
- }, { Parent: Error }), ci = /* @__PURE__ */ E(J), li = /* @__PURE__ */ D(J), ui = /* @__PURE__ */ O(J), di = /* @__PURE__ */ k(J), fi = /* @__PURE__ */ we(J), pi = /* @__PURE__ */ Te(J), mi = /* @__PURE__ */ Ee(J), hi = /* @__PURE__ */ De(J), gi = /* @__PURE__ */ Oe(J), _i = /* @__PURE__ */ ke(J), vi = /* @__PURE__ */ Ae(J), yi = /* @__PURE__ */ je(J), bi = /* @__PURE__ */ new WeakMap();
2440
- function Y(e, t, n) {
2441
- let r = Object.getPrototypeOf(e), i = bi.get(r);
2442
- if (i || (i = /* @__PURE__ */ new Set(), bi.set(r, i)), !i.has(t)) {
2443
- i.add(t);
2444
- for (let e in n) {
2445
- let t = n[e];
2446
- Object.defineProperty(r, e, {
2447
- configurable: !0,
2448
- enumerable: !1,
2449
- get() {
2450
- let n = t.bind(this);
2451
- return Object.defineProperty(this, e, {
2452
- configurable: !0,
2453
- writable: !0,
2454
- enumerable: !0,
2455
- value: n
2456
- }), n;
2457
- },
2458
- set(t) {
2459
- Object.defineProperty(this, e, {
2460
- configurable: !0,
2461
- writable: !0,
2462
- enumerable: !0,
2463
- value: t
2464
- });
2465
- }
2466
- });
2467
- }
2468
- }
2469
- }
2470
- var X = /*@__PURE__*/ t("ZodType", (e, t) => (M.init(e, t), Object.assign(e["~standard"], { jsonSchema: {
2471
- input: q(e, "input"),
2472
- output: q(e, "output")
2473
- } }), e.toJSONSchema = Nr(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.parse = (t, n) => ci(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => ui(e, t, n), e.parseAsync = async (t, n) => li(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => di(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n) => fi(e, t, n), e.decode = (t, n) => pi(e, t, n), e.encodeAsync = async (t, n) => mi(e, t, n), e.decodeAsync = async (t, n) => hi(e, t, n), e.safeEncode = (t, n) => gi(e, t, n), e.safeDecode = (t, n) => _i(e, t, n), e.safeEncodeAsync = async (t, n) => vi(e, t, n), e.safeDecodeAsync = async (t, n) => yi(e, t, n), Y(e, "ZodType", {
2474
- check(...e) {
2475
- let t = this.def;
2476
- return this.clone(h(t, { checks: [...t.checks ?? [], ...e.map((e) => typeof e == "function" ? { _zod: {
2477
- check: e,
2478
- def: { check: "custom" },
2479
- onattach: []
2480
- } } : e)] }), { parent: !0 });
2481
- },
2482
- with(...e) {
2483
- return this.check(...e);
2484
- },
2485
- clone(e, t) {
2486
- return y(this, e, t);
2487
- },
2488
- brand() {
2489
- return this;
2490
- },
2491
- register(e, t) {
2492
- return e.add(this, t), this;
2493
- },
2494
- refine(e, t) {
2495
- return this.check(Oa(e, t));
2496
- },
2497
- superRefine(e, t) {
2498
- return this.check(ka(e, t));
2499
- },
2500
- overwrite(e) {
2501
- return this.check(/* @__PURE__ */ W(e));
2502
- },
2503
- optional() {
2504
- return ua(this);
2505
- },
2506
- exactOptional() {
2507
- return fa(this);
2508
- },
2509
- nullable() {
2510
- return ma(this);
2511
- },
2512
- nullish() {
2513
- return ua(ma(this));
2514
- },
2515
- nonoptional(e) {
2516
- return ba(this, e);
2517
- },
2518
- array() {
2519
- return $i(this);
2520
- },
2521
- or(e) {
2522
- return ra([this, e]);
2523
- },
2524
- and(e) {
2525
- return aa(this, e);
2526
- },
2527
- transform(e) {
2528
- return wa(this, ca(e));
2529
- },
2530
- default(e) {
2531
- return ga(this, e);
2532
- },
2533
- prefault(e) {
2534
- return va(this, e);
2535
- },
2536
- catch(e) {
2537
- return Sa(this, e);
2538
- },
2539
- pipe(e) {
2540
- return wa(this, e);
2541
- },
2542
- readonly() {
2543
- return Ea(this);
2544
- },
2545
- describe(e) {
2546
- let t = this.clone();
2547
- return z.add(t, { description: e }), t;
2548
- },
2549
- meta(...e) {
2550
- if (e.length === 0) return z.get(this);
2551
- let t = this.clone();
2552
- return z.add(t, e[0]), t;
2553
- },
2554
- isOptional() {
2555
- return this.safeParse(void 0).success;
2556
- },
2557
- isNullable() {
2558
- return this.safeParse(null).success;
2559
- },
2560
- apply(e) {
2561
- return e(this);
2562
- }
2563
- }), Object.defineProperty(e, "description", {
2564
- get() {
2565
- return z.get(e)?.description;
2566
- },
2567
- configurable: !0
2568
- }), e)), xi = /*@__PURE__*/ t("_ZodString", (e, t) => {
2569
- N.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => Fr(e, t, n, r);
2570
- let n = e._zod.bag;
2571
- e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, Y(e, "_ZodString", {
2572
- regex(...e) {
2573
- return this.check(/* @__PURE__ */ hr(...e));
2574
- },
2575
- includes(...e) {
2576
- return this.check(/* @__PURE__ */ vr(...e));
2577
- },
2578
- startsWith(...e) {
2579
- return this.check(/* @__PURE__ */ yr(...e));
2580
- },
2581
- endsWith(...e) {
2582
- return this.check(/* @__PURE__ */ br(...e));
2583
- },
2584
- min(...e) {
2585
- return this.check(/* @__PURE__ */ U(...e));
2586
- },
2587
- max(...e) {
2588
- return this.check(/* @__PURE__ */ pr(...e));
2589
- },
2590
- length(...e) {
2591
- return this.check(/* @__PURE__ */ mr(...e));
2592
- },
2593
- nonempty(...e) {
2594
- return this.check(/* @__PURE__ */ U(1, ...e));
2595
- },
2596
- lowercase(e) {
2597
- return this.check(/* @__PURE__ */ gr(e));
2598
- },
2599
- uppercase(e) {
2600
- return this.check(/* @__PURE__ */ _r(e));
2601
- },
2602
- trim() {
2603
- return this.check(/* @__PURE__ */ Sr());
2604
- },
2605
- normalize(...e) {
2606
- return this.check(/* @__PURE__ */ xr(...e));
2607
- },
2608
- toLowerCase() {
2609
- return this.check(/* @__PURE__ */ Cr());
2610
- },
2611
- toUpperCase() {
2612
- return this.check(/* @__PURE__ */ wr());
2613
- },
2614
- slugify() {
2615
- return this.check(/* @__PURE__ */ Tr());
2616
- }
2617
- });
2618
- }), Si = /*@__PURE__*/ t("ZodString", (e, t) => {
2619
- N.init(e, t), xi.init(e, t), e.email = (t) => e.check(/* @__PURE__ */ Pn(wi, t)), e.url = (t) => e.check(/* @__PURE__ */ Bn(Ei, t)), e.jwt = (t) => e.check(/* @__PURE__ */ tr(Vi, t)), e.emoji = (t) => e.check(/* @__PURE__ */ Vn(Di, t)), e.guid = (t) => e.check(/* @__PURE__ */ Fn(Ti, t)), e.uuid = (t) => e.check(/* @__PURE__ */ In(Q, t)), e.uuidv4 = (t) => e.check(/* @__PURE__ */ Ln(Q, t)), e.uuidv6 = (t) => e.check(/* @__PURE__ */ Rn(Q, t)), e.uuidv7 = (t) => e.check(/* @__PURE__ */ zn(Q, t)), e.nanoid = (t) => e.check(/* @__PURE__ */ Hn(Oi, t)), e.guid = (t) => e.check(/* @__PURE__ */ Fn(Ti, t)), e.cuid = (t) => e.check(/* @__PURE__ */ Un(ki, t)), e.cuid2 = (t) => e.check(/* @__PURE__ */ Wn(Ai, t)), e.ulid = (t) => e.check(/* @__PURE__ */ Gn(ji, t)), e.base64 = (t) => e.check(/* @__PURE__ */ Qn(Ri, t)), e.base64url = (t) => e.check(/* @__PURE__ */ $n(zi, t)), e.xid = (t) => e.check(/* @__PURE__ */ Kn(Mi, t)), e.ksuid = (t) => e.check(/* @__PURE__ */ qn(Ni, t)), e.ipv4 = (t) => e.check(/* @__PURE__ */ Jn(Pi, t)), e.ipv6 = (t) => e.check(/* @__PURE__ */ Yn(Fi, t)), e.cidrv4 = (t) => e.check(/* @__PURE__ */ Xn(Ii, t)), e.cidrv6 = (t) => e.check(/* @__PURE__ */ Zn(Li, t)), e.e164 = (t) => e.check(/* @__PURE__ */ er(Bi, t)), e.datetime = (t) => e.check(ti(t)), e.date = (t) => e.check(ri(t)), e.time = (t) => e.check(ai(t)), e.duration = (t) => e.check(si(t));
2620
- });
2621
- function Ci(e) {
2622
- return /* @__PURE__ */ Nn(Si, e);
2623
- }
2624
- var Z = /*@__PURE__*/ t("ZodStringFormat", (e, t) => {
2625
- P.init(e, t), xi.init(e, t);
2626
- }), wi = /*@__PURE__*/ t("ZodEmail", (e, t) => {
2627
- Ot.init(e, t), Z.init(e, t);
2628
- }), Ti = /*@__PURE__*/ t("ZodGUID", (e, t) => {
2629
- Et.init(e, t), Z.init(e, t);
2630
- }), Q = /*@__PURE__*/ t("ZodUUID", (e, t) => {
2631
- Dt.init(e, t), Z.init(e, t);
2632
- }), Ei = /*@__PURE__*/ t("ZodURL", (e, t) => {
2633
- kt.init(e, t), Z.init(e, t);
2634
- }), Di = /*@__PURE__*/ t("ZodEmoji", (e, t) => {
2635
- At.init(e, t), Z.init(e, t);
2636
- }), Oi = /*@__PURE__*/ t("ZodNanoID", (e, t) => {
2637
- jt.init(e, t), Z.init(e, t);
2638
- }), ki = /*@__PURE__*/ t("ZodCUID", (e, t) => {
2639
- Mt.init(e, t), Z.init(e, t);
2640
- }), Ai = /*@__PURE__*/ t("ZodCUID2", (e, t) => {
2641
- Nt.init(e, t), Z.init(e, t);
2642
- }), ji = /*@__PURE__*/ t("ZodULID", (e, t) => {
2643
- Pt.init(e, t), Z.init(e, t);
2644
- }), Mi = /*@__PURE__*/ t("ZodXID", (e, t) => {
2645
- Ft.init(e, t), Z.init(e, t);
2646
- }), Ni = /*@__PURE__*/ t("ZodKSUID", (e, t) => {
2647
- It.init(e, t), Z.init(e, t);
2648
- }), Pi = /*@__PURE__*/ t("ZodIPv4", (e, t) => {
2649
- Vt.init(e, t), Z.init(e, t);
2650
- }), Fi = /*@__PURE__*/ t("ZodIPv6", (e, t) => {
2651
- Ht.init(e, t), Z.init(e, t);
2652
- }), Ii = /*@__PURE__*/ t("ZodCIDRv4", (e, t) => {
2653
- Ut.init(e, t), Z.init(e, t);
2654
- }), Li = /*@__PURE__*/ t("ZodCIDRv6", (e, t) => {
2655
- Wt.init(e, t), Z.init(e, t);
2656
- }), Ri = /*@__PURE__*/ t("ZodBase64", (e, t) => {
2657
- Kt.init(e, t), Z.init(e, t);
2658
- }), zi = /*@__PURE__*/ t("ZodBase64URL", (e, t) => {
2659
- Jt.init(e, t), Z.init(e, t);
2660
- }), Bi = /*@__PURE__*/ t("ZodE164", (e, t) => {
2661
- Yt.init(e, t), Z.init(e, t);
2662
- }), Vi = /*@__PURE__*/ t("ZodJWT", (e, t) => {
2663
- Zt.init(e, t), Z.init(e, t);
2664
- }), Hi = /*@__PURE__*/ t("ZodNumber", (e, t) => {
2665
- Qt.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ir(e, t, n, r), Y(e, "ZodNumber", {
2666
- gt(e, t) {
2667
- return this.check(/* @__PURE__ */ V(e, t));
2668
- },
2669
- gte(e, t) {
2670
- return this.check(/* @__PURE__ */ H(e, t));
2671
- },
2672
- min(e, t) {
2673
- return this.check(/* @__PURE__ */ H(e, t));
2674
- },
2675
- lt(e, t) {
2676
- return this.check(/* @__PURE__ */ dr(e, t));
2677
- },
2678
- lte(e, t) {
2679
- return this.check(/* @__PURE__ */ B(e, t));
2680
- },
2681
- max(e, t) {
2682
- return this.check(/* @__PURE__ */ B(e, t));
2683
- },
2684
- int(e) {
2685
- return this.check(Gi(e));
2686
- },
2687
- safe(e) {
2688
- return this.check(Gi(e));
2689
- },
2690
- positive(e) {
2691
- return this.check(/* @__PURE__ */ V(0, e));
2692
- },
2693
- nonnegative(e) {
2694
- return this.check(/* @__PURE__ */ H(0, e));
2695
- },
2696
- negative(e) {
2697
- return this.check(/* @__PURE__ */ dr(0, e));
2698
- },
2699
- nonpositive(e) {
2700
- return this.check(/* @__PURE__ */ B(0, e));
2701
- },
2702
- multipleOf(e, t) {
2703
- return this.check(/* @__PURE__ */ fr(e, t));
2704
- },
2705
- step(e, t) {
2706
- return this.check(/* @__PURE__ */ fr(e, t));
2707
- },
2708
- finite() {
2709
- return this;
2710
- }
2711
- });
2712
- let n = e._zod.bag;
2713
- 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;
2714
- });
2715
- function Ui(e) {
2716
- return /* @__PURE__ */ or(Hi, e);
2717
- }
2718
- var Wi = /*@__PURE__*/ t("ZodNumberFormat", (e, t) => {
2719
- $t.init(e, t), Hi.init(e, t);
2720
- });
2721
- function Gi(e) {
2722
- return /* @__PURE__ */ sr(Wi, e);
2723
- }
2724
- var Ki = /*@__PURE__*/ t("ZodBoolean", (e, t) => {
2725
- en.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => Lr(e, t, n, r);
2726
- });
2727
- function qi(e) {
2728
- return /* @__PURE__ */ cr(Ki, e);
2729
- }
2730
- var Ji = /*@__PURE__*/ t("ZodUnknown", (e, t) => {
2731
- tn.init(e, t), X.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0;
2732
- });
2733
- function Yi() {
2734
- return /* @__PURE__ */ lr(Ji);
2735
- }
2736
- var Xi = /*@__PURE__*/ t("ZodNever", (e, t) => {
2737
- nn.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => Rr(e, t, n, r);
2738
- });
2739
- function Zi(e) {
2740
- return /* @__PURE__ */ ur(Xi, e);
2741
- }
2742
- var Qi = /*@__PURE__*/ t("ZodArray", (e, t) => {
2743
- an.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => Hr(e, t, n, r), e.element = t.element, Y(e, "ZodArray", {
2744
- min(e, t) {
2745
- return this.check(/* @__PURE__ */ U(e, t));
2746
- },
2747
- nonempty(e) {
2748
- return this.check(/* @__PURE__ */ U(1, e));
2749
- },
2750
- max(e, t) {
2751
- return this.check(/* @__PURE__ */ pr(e, t));
2752
- },
2753
- length(e, t) {
2754
- return this.check(/* @__PURE__ */ mr(e, t));
2755
- },
2756
- unwrap() {
2757
- return this.element;
2758
- }
2759
- });
2760
- });
2761
- function $i(e, t) {
2762
- return /* @__PURE__ */ Er(Qi, e, t);
2763
- }
2764
- var ea = /*@__PURE__*/ t("ZodObject", (e, t) => {
2765
- ln.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ur(e, t, n, r), p(e, "shape", () => t.shape), Y(e, "ZodObject", {
2766
- keyof() {
2767
- return oa(Object.keys(this._zod.def.shape));
2768
- },
2769
- catchall(e) {
2770
- return this.clone({
2771
- ...this._zod.def,
2772
- catchall: e
2773
- });
2774
- },
2775
- passthrough() {
2776
- return this.clone({
2777
- ...this._zod.def,
2778
- catchall: Yi()
2779
- });
2780
- },
2781
- loose() {
2782
- return this.clone({
2783
- ...this._zod.def,
2784
- catchall: Yi()
2785
- });
2786
- },
2787
- strict() {
2788
- return this.clone({
2789
- ...this._zod.def,
2790
- catchall: Zi()
2791
- });
2792
- },
2793
- strip() {
2794
- return this.clone({
2795
- ...this._zod.def,
2796
- catchall: void 0
2797
- });
2798
- },
2799
- extend(e) {
2800
- return ue(this, e);
2801
- },
2802
- safeExtend(e) {
2803
- return de(this, e);
2804
- },
2805
- merge(e) {
2806
- return fe(this, e);
2807
- },
2808
- pick(e) {
2809
- return ce(this, e);
2810
- },
2811
- omit(e) {
2812
- return le(this, e);
2813
- },
2814
- partial(...e) {
2815
- return pe(la, this, e[0]);
2816
- },
2817
- required(...e) {
2818
- return me(ya, this, e[0]);
2819
- }
2820
- });
2821
- });
2822
- function ta(e, t) {
2823
- return new ea({
2824
- type: "object",
2825
- shape: e ?? {},
2826
- ...b(t)
2827
- });
2828
- }
2829
- var na = /*@__PURE__*/ t("ZodUnion", (e, t) => {
2830
- un.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => Wr(e, t, n, r), e.options = t.options;
2831
- });
2832
- function ra(e, t) {
2833
- return new na({
2834
- type: "union",
2835
- options: e,
2836
- ...b(t)
2837
- });
2838
- }
2839
- var ia = /*@__PURE__*/ t("ZodIntersection", (e, t) => {
2840
- dn.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => Gr(e, t, n, r);
2841
- });
2842
- function aa(e, t) {
2843
- return new ia({
2844
- type: "intersection",
2845
- left: e,
2846
- right: t
2847
- });
2848
- }
2849
- var $ = /*@__PURE__*/ t("ZodEnum", (e, t) => {
2850
- pn.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => zr(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries);
2851
- let n = new Set(Object.keys(t.entries));
2852
- e.extract = (e, r) => {
2853
- let i = {};
2854
- for (let r of e) if (n.has(r)) i[r] = t.entries[r];
2855
- else throw Error(`Key ${r} not found in enum`);
2856
- return new $({
2857
- ...t,
2858
- checks: [],
2859
- ...b(r),
2860
- entries: i
2861
- });
2862
- }, e.exclude = (e, r) => {
2863
- let i = { ...t.entries };
2864
- for (let t of e) if (n.has(t)) delete i[t];
2865
- else throw Error(`Key ${t} not found in enum`);
2866
- return new $({
2867
- ...t,
2868
- checks: [],
2869
- ...b(r),
2870
- entries: i
2871
- });
2872
- };
2873
- });
2874
- function oa(e, t) {
2875
- return new $({
2876
- type: "enum",
2877
- entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e,
2878
- ...b(t)
2879
- });
2880
- }
2881
- var sa = /*@__PURE__*/ t("ZodTransform", (e, t) => {
2882
- mn.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => Vr(e, t, n, r), e._zod.parse = (n, i) => {
2883
- if (i.direction === "backward") throw new r(e.constructor.name);
2884
- n.addIssue = (r) => {
2885
- if (typeof r == "string") n.issues.push(T(r, n.value, t));
2886
- else {
2887
- let t = r;
2888
- t.fatal && (t.continue = !1), t.code ??= "custom", t.input ??= n.value, t.inst ??= e, n.issues.push(T(t));
2889
- }
2890
- };
2891
- let a = t.transform(n.value, n);
2892
- return a instanceof Promise ? a.then((e) => (n.value = e, n.fallback = !0, n)) : (n.value = a, n.fallback = !0, n);
2893
- };
2894
- });
2895
- function ca(e) {
2896
- return new sa({
2897
- type: "transform",
2898
- transform: e
2899
- });
2900
- }
2901
- var la = /*@__PURE__*/ t("ZodOptional", (e, t) => {
2902
- gn.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => $r(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
2903
- });
2904
- function ua(e) {
2905
- return new la({
2906
- type: "optional",
2907
- innerType: e
2908
- });
2909
- }
2910
- var da = /*@__PURE__*/ t("ZodExactOptional", (e, t) => {
2911
- _n.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => $r(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
2912
- });
2913
- function fa(e) {
2914
- return new da({
2915
- type: "optional",
2916
- innerType: e
2917
- });
2918
- }
2919
- var pa = /*@__PURE__*/ t("ZodNullable", (e, t) => {
2920
- vn.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => Kr(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
2921
- });
2922
- function ma(e) {
2923
- return new pa({
2924
- type: "nullable",
2925
- innerType: e
2926
- });
2927
- }
2928
- var ha = /*@__PURE__*/ t("ZodDefault", (e, t) => {
2929
- yn.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => Jr(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
2930
- });
2931
- function ga(e, t) {
2932
- return new ha({
2933
- type: "default",
2934
- innerType: e,
2935
- get defaultValue() {
2936
- return typeof t == "function" ? t() : ie(t);
2937
- }
2938
- });
2939
- }
2940
- var _a = /*@__PURE__*/ t("ZodPrefault", (e, t) => {
2941
- xn.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => Yr(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
2942
- });
2943
- function va(e, t) {
2944
- return new _a({
2945
- type: "prefault",
2946
- innerType: e,
2947
- get defaultValue() {
2948
- return typeof t == "function" ? t() : ie(t);
2949
- }
2950
- });
2951
- }
2952
- var ya = /*@__PURE__*/ t("ZodNonOptional", (e, t) => {
2953
- Sn.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => qr(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
2954
- });
2955
- function ba(e, t) {
2956
- return new ya({
2957
- type: "nonoptional",
2958
- innerType: e,
2959
- ...b(t)
2960
- });
2961
- }
2962
- var xa = /*@__PURE__*/ t("ZodCatch", (e, t) => {
2963
- wn.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => Xr(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
2964
- });
2965
- function Sa(e, t) {
2966
- return new xa({
2967
- type: "catch",
2968
- innerType: e,
2969
- catchValue: typeof t == "function" ? t : () => t
2970
- });
2971
- }
2972
- var Ca = /*@__PURE__*/ t("ZodPipe", (e, t) => {
2973
- Tn.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => Zr(e, t, n, r), e.in = t.in, e.out = t.out;
2974
- });
2975
- function wa(e, t) {
2976
- return new Ca({
2977
- type: "pipe",
2978
- in: e,
2979
- out: t
2980
- });
2981
- }
2982
- var Ta = /*@__PURE__*/ t("ZodReadonly", (e, t) => {
2983
- En.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => Qr(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
2984
- });
2985
- function Ea(e) {
2986
- return new Ta({
2987
- type: "readonly",
2988
- innerType: e
2989
- });
2990
- }
2991
- var Da = /*@__PURE__*/ t("ZodCustom", (e, t) => {
2992
- On.init(e, t), X.init(e, t), e._zod.processJSONSchema = (t, n, r) => Br(e, t, n, r);
2993
- });
2994
- function Oa(e, t = {}) {
2995
- return /* @__PURE__ */ Dr(Da, e, t);
2996
- }
2997
- function ka(e, t) {
2998
- return /* @__PURE__ */ Or(e, t);
2999
- }
3000
- //#endregion
3001
- export { Ci as a, ta as i, qi as n, Ui as r, oa as t };