@oneclick.dev/cms-core-modules 0.0.122 → 0.0.124

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 (162) hide show
  1. package/dist/{ContentEditor-CoJjsV-m.js → ContentEditor-BcIUumah.js} +63 -59
  2. package/dist/{ContentEditor-DIwqplfB.mjs → ContentEditor-DX1bTQKs.mjs} +27894 -26319
  3. package/dist/{Detail-Dk8E6_uF.mjs → Detail-B7pe808q.mjs} +15 -14
  4. package/dist/Detail-BESGmY7z.js +1 -0
  5. package/dist/{Detail-Cn9Bk0u0.mjs → Detail-B_Q7Qkuz.mjs} +26 -25
  6. package/dist/Detail-CNiLIEh9.js +1 -0
  7. package/dist/{Detail-B_scnidb.mjs → Detail-DNxAzeCs.mjs} +35 -34
  8. package/dist/Detail-t3tOcy3X.js +1 -0
  9. package/dist/Editor-D4evcdhv.mjs +768 -0
  10. package/dist/Editor-gLLtuJbY.js +1 -0
  11. package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-BjKpsqT9.js +1 -0
  12. package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-D5v5AhLe.mjs +76 -0
  13. package/dist/Knowledge-B66vxz--.js +1 -0
  14. package/dist/Knowledge-BnMTTuJ7.mjs +742 -0
  15. package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-bZidw6RT.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-8I_Z9cD_.mjs} +530 -530
  16. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-BVE_uURZ.js +1 -0
  17. package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-BdFa-xNf.mjs +3566 -0
  18. package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-DzPOadcU.js +925 -0
  19. package/dist/Overview-BE4uYPx0.mjs +745 -0
  20. package/dist/Overview-CQRpFhbJ.mjs +286 -0
  21. package/dist/Overview-CTs7sX4d.js +1 -0
  22. package/dist/Overview-Cj89XXKN.js +1 -0
  23. package/dist/Overview-D_c18mbR.mjs +248 -0
  24. package/dist/Overview-g4Rcj245.js +1 -0
  25. package/dist/TableCalculationWidget-CkQPrVUd.js +59 -0
  26. package/dist/TableCalculationWidget-CrqcLGfU.mjs +254 -0
  27. package/dist/TableDataWidget-7qvC3Egd.js +1 -0
  28. package/dist/TableDataWidget-DMTSoGRO.mjs +121 -0
  29. package/dist/TableOverviewCard-AFq-puJs.js +1 -0
  30. package/dist/TableOverviewCard-Ci0d4o4w.mjs +391 -0
  31. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-CBn-Oxl9.mjs +534 -0
  32. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js +1 -0
  33. package/dist/TableRowActionCard-BhdnnPaq.mjs +266 -0
  34. package/dist/TableRowActionCard-IzB6tNN-.js +1 -0
  35. package/dist/TableView-6mdrL3zx.js +4 -0
  36. package/dist/TableView-Du5nOE6R.mjs +8228 -0
  37. package/dist/Test-CzmOmi53.mjs +447 -0
  38. package/dist/Test-USDtNFY1.js +1 -0
  39. package/dist/UserDetail-DpUL3mhk.mjs +1483 -0
  40. package/dist/UserDetail-KRIfxaYd.js +1 -0
  41. package/dist/{agenda-BCKDYOeF.mjs → agenda-DWdbWUbb.mjs} +10 -9
  42. package/dist/agenda-r9Gl85GL.js +1 -0
  43. package/dist/cms-core-modules.css +1 -1
  44. package/dist/dateRangePresets-B-l5b_wR.mjs +48 -0
  45. package/dist/dateRangePresets-CPWqst_x.js +1 -0
  46. package/dist/fuse-Deb-Iq39.mjs +1473 -0
  47. package/dist/fuse-_CGUd5Zq.js +1 -0
  48. package/dist/{index-DU3Ib10Z.mjs → index-B_qaX29C.mjs} +7 -6
  49. package/dist/index-CQuN5rKx.js +1 -0
  50. package/dist/index-CnDGeInm.js +1 -0
  51. package/dist/index-CqDTc5Ig.mjs +20 -0
  52. package/dist/index-CyvvAdt4.js +1 -0
  53. package/dist/index-DIRD7t5_.mjs +20 -0
  54. package/dist/index-OJuBYR60.mjs +57 -0
  55. package/dist/{index-Bk3yLv_G.js → index-yHLT6gaZ.js} +3 -3
  56. package/dist/index.cjs.js +1 -1
  57. package/dist/index.mjs +671 -118
  58. package/dist/{orders-CElKNc1v.mjs → orders-BfTLIm7U.mjs} +10 -9
  59. package/dist/orders-DUa2PVoa.js +1 -0
  60. package/dist/reports-ChCsd1Gk.mjs +1107 -0
  61. package/dist/reports-DmJPm8uP.js +158 -0
  62. package/dist/row-item-C1dUyimV.mjs +204 -0
  63. package/dist/row-item-Cyo3m3MZ.js +1 -0
  64. package/dist/server-handlers.cjs.js +1 -1
  65. package/dist/server-handlers.mjs +1764 -605
  66. package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +9 -3
  67. package/dist/src/appointments/components/edit/EventDialog/OrderDetailDialog.vue.d.ts +2 -0
  68. package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +4 -2
  69. package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +9 -3
  70. package/dist/src/appointments/pages/edit/orders.vue.d.ts +9 -3
  71. package/dist/src/appointments/pages/edit/reports.vue.d.ts +229 -1
  72. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Container.d.ts +1 -1
  73. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Row.d.ts +7 -0
  74. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Stack.d.ts +7 -0
  75. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/resizeHistory.d.ts +9 -0
  76. package/dist/src/contentManager/components/content-editor/tiptap-menus/ElementEditorMenu.vue.d.ts +3 -1
  77. package/dist/src/firebaseAuthManager/components/DeleteUserDialog.vue.d.ts +25 -0
  78. package/dist/src/firebaseAuthManager/components/ReasonActionDialog.vue.d.ts +23 -0
  79. package/dist/src/firebaseAuthManager/components/UserStatusBadge.vue.d.ts +5 -0
  80. package/dist/src/firebaseAuthManager/config.d.ts +151 -0
  81. package/dist/src/firebaseAuthManager/index.d.ts +163 -0
  82. package/dist/src/firebaseAuthManager/index.vue.d.ts +14 -0
  83. package/dist/src/firebaseAuthManager/metadata.d.ts +2 -0
  84. package/dist/src/firebaseAuthManager/pages/Overview.vue.d.ts +2 -0
  85. package/dist/src/firebaseAuthManager/pages/UserDetail.vue.d.ts +2 -0
  86. package/dist/src/firebaseAuthManager/permissions.d.ts +5 -0
  87. package/dist/src/firebaseAuthManager/routes.d.ts +5 -0
  88. package/dist/src/firebaseAuthManager/server.d.ts +162 -0
  89. package/dist/src/firebaseAuthManager/types.d.ts +84 -0
  90. package/dist/src/formBuilder/components/FormPreviewDialog.vue.d.ts +12 -0
  91. package/dist/src/formBuilder/components/FormStatusBadge.vue.d.ts +9 -0
  92. package/dist/src/formBuilder/config.d.ts +31 -0
  93. package/dist/src/formBuilder/index.d.ts +44 -0
  94. package/dist/src/formBuilder/index.vue.d.ts +14 -0
  95. package/dist/src/formBuilder/lib/forms.d.ts +11 -0
  96. package/dist/src/formBuilder/metadata.d.ts +2 -0
  97. package/dist/src/formBuilder/pages/Editor.vue.d.ts +2 -0
  98. package/dist/src/formBuilder/pages/Overview.vue.d.ts +2 -0
  99. package/dist/src/formBuilder/permissions.d.ts +5 -0
  100. package/dist/src/formBuilder/routes.d.ts +5 -0
  101. package/dist/src/formBuilder/server.d.ts +87 -0
  102. package/dist/src/formBuilder/tools.d.ts +1 -0
  103. package/dist/src/formBuilder/types.d.ts +46 -0
  104. package/dist/src/helpbot/composables/useHelpbotApi.d.ts +18 -0
  105. package/dist/src/helpbot/config.d.ts +17 -0
  106. package/dist/src/helpbot/index.d.ts +29 -0
  107. package/dist/src/helpbot/index.vue.d.ts +2 -0
  108. package/dist/src/helpbot/metadata.d.ts +2 -0
  109. package/dist/src/helpbot/pages/Knowledge.vue.d.ts +4 -0
  110. package/dist/src/helpbot/pages/Overview.vue.d.ts +2 -0
  111. package/dist/src/helpbot/pages/Test.vue.d.ts +4 -0
  112. package/dist/src/helpbot/permissions.d.ts +5 -0
  113. package/dist/src/helpbot/routes.d.ts +5 -0
  114. package/dist/src/helpbot/types.d.ts +42 -0
  115. package/dist/src/index.d.ts +3 -0
  116. package/dist/src/server-handlers.d.ts +2 -0
  117. package/dist/src/table/chat-components/TableCalculationWidget.vue.d.ts +15 -0
  118. package/dist/src/table/chat-components/TableDataWidget.vue.d.ts +15 -0
  119. package/dist/src/table/chat-components/TableOverviewCard.vue.d.ts +61 -0
  120. package/dist/src/table/chat-components/TableResultView.vue.d.ts +48 -0
  121. package/dist/src/table/chat-components/TableRowActionCard.vue.d.ts +15 -0
  122. package/dist/src/table/components/filters/DialogTableFilterOptionItem.vue.d.ts +16 -0
  123. package/dist/src/table/components/filters/NumberComparisonFilter.vue.d.ts +12 -0
  124. package/dist/src/table/components/filters/NumberComparisonFilterSettings.vue.d.ts +12 -0
  125. package/dist/src/table/components/filters/NumberRangeFilter.vue.d.ts +12 -0
  126. package/dist/src/table/components/filters/NumberRangeFilterSettings.vue.d.ts +12 -0
  127. package/dist/src/table/components/filters/filter-utils.d.ts +14 -0
  128. package/dist/src/table/composables/useTableAgentTools.d.ts +33 -0
  129. package/dist/src/table/index.d.ts +339 -0
  130. package/dist/src/table/tool-sandbox.d.ts +13 -0
  131. package/dist/src/table/tool-utils.d.ts +11 -0
  132. package/dist/src/table/tools.d.ts +333 -1
  133. package/dist/src/table/types.d.ts +79 -0
  134. package/dist/tool-sandbox-DdkMLkDK.mjs +182 -0
  135. package/dist/tool-sandbox-DoF1PsyS.js +115 -0
  136. package/dist/types-9N-DKxNj.mjs +250 -0
  137. package/dist/types-BMraG1kN.js +1 -0
  138. package/dist/types-Cem0vPo_.js +1 -0
  139. package/dist/types-ibC3-e1N.mjs +2630 -0
  140. package/dist/useHelpbotApi-BIIungOh.js +1 -0
  141. package/dist/useHelpbotApi-HC9JSiSn.mjs +229 -0
  142. package/dist/useTableAgentTools-D5mzGf3A.js +1 -0
  143. package/dist/useTableAgentTools-DcN3kYRL.mjs +131 -0
  144. package/dist/vee-validate-zod-BQElPD0m.js +1 -0
  145. package/dist/vee-validate-zod-CN16K2x9.mjs +1780 -0
  146. package/package.json +17 -17
  147. package/src/formBuilder/tools.ts +1 -0
  148. package/src/table/tools.ts +304 -1
  149. package/dist/Detail-BCUUNWvp.js +0 -1
  150. package/dist/Detail-DGg_xXZc.js +0 -1
  151. package/dist/Detail-Sc2qZdxj.js +0 -1
  152. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-BdZbcubW.js +0 -1
  153. package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-BYSeUW_V.js +0 -925
  154. package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-DwAUYR8p.mjs +0 -5021
  155. package/dist/TableView-Ctnep-Qu.mjs +0 -6247
  156. package/dist/TableView-DJqyJL9L.js +0 -4
  157. package/dist/agenda-B54F8cEr.js +0 -1
  158. package/dist/orders-BMosTk6r.js +0 -1
  159. package/dist/reports-BQT_GZzU.js +0 -158
  160. package/dist/reports-DksZCTOw.mjs +0 -837
  161. package/dist/vee-validate-zod-SjDT8X35.mjs +0 -4404
  162. package/dist/vee-validate-zod-VCmLnrtQ.js +0 -1
@@ -0,0 +1,2630 @@
1
+ var y;
2
+ (function(s) {
3
+ s.assertEqual = (a) => {
4
+ };
5
+ function e(a) {
6
+ }
7
+ s.assertIs = e;
8
+ function t(a) {
9
+ throw new Error();
10
+ }
11
+ s.assertNever = t, s.arrayToEnum = (a) => {
12
+ const n = {};
13
+ for (const i of a)
14
+ n[i] = i;
15
+ return n;
16
+ }, s.getValidEnumValues = (a) => {
17
+ const n = s.objectKeys(a).filter((o) => typeof a[a[o]] != "number"), i = {};
18
+ for (const o of n)
19
+ i[o] = a[o];
20
+ return s.objectValues(i);
21
+ }, s.objectValues = (a) => s.objectKeys(a).map(function(n) {
22
+ return a[n];
23
+ }), s.objectKeys = typeof Object.keys == "function" ? (a) => Object.keys(a) : (a) => {
24
+ const n = [];
25
+ for (const i in a)
26
+ Object.prototype.hasOwnProperty.call(a, i) && n.push(i);
27
+ return n;
28
+ }, s.find = (a, n) => {
29
+ for (const i of a)
30
+ if (n(i))
31
+ return i;
32
+ }, s.isInteger = typeof Number.isInteger == "function" ? (a) => Number.isInteger(a) : (a) => typeof a == "number" && Number.isFinite(a) && Math.floor(a) === a;
33
+ function r(a, n = " | ") {
34
+ return a.map((i) => typeof i == "string" ? `'${i}'` : i).join(n);
35
+ }
36
+ s.joinValues = r, s.jsonStringifyReplacer = (a, n) => typeof n == "bigint" ? n.toString() : n;
37
+ })(y || (y = {}));
38
+ var te;
39
+ (function(s) {
40
+ s.mergeShapes = (e, t) => ({
41
+ ...e,
42
+ ...t
43
+ // second overwrites first
44
+ });
45
+ })(te || (te = {}));
46
+ const u = y.arrayToEnum([
47
+ "string",
48
+ "nan",
49
+ "number",
50
+ "integer",
51
+ "float",
52
+ "boolean",
53
+ "date",
54
+ "bigint",
55
+ "symbol",
56
+ "function",
57
+ "undefined",
58
+ "null",
59
+ "array",
60
+ "object",
61
+ "unknown",
62
+ "promise",
63
+ "void",
64
+ "never",
65
+ "map",
66
+ "set"
67
+ ]), O = (s) => {
68
+ switch (typeof s) {
69
+ case "undefined":
70
+ return u.undefined;
71
+ case "string":
72
+ return u.string;
73
+ case "number":
74
+ return Number.isNaN(s) ? u.nan : u.number;
75
+ case "boolean":
76
+ return u.boolean;
77
+ case "function":
78
+ return u.function;
79
+ case "bigint":
80
+ return u.bigint;
81
+ case "symbol":
82
+ return u.symbol;
83
+ case "object":
84
+ return Array.isArray(s) ? u.array : s === null ? u.null : s.then && typeof s.then == "function" && s.catch && typeof s.catch == "function" ? u.promise : typeof Map < "u" && s instanceof Map ? u.map : typeof Set < "u" && s instanceof Set ? u.set : typeof Date < "u" && s instanceof Date ? u.date : u.object;
85
+ default:
86
+ return u.unknown;
87
+ }
88
+ }, d = y.arrayToEnum([
89
+ "invalid_type",
90
+ "invalid_literal",
91
+ "custom",
92
+ "invalid_union",
93
+ "invalid_union_discriminator",
94
+ "invalid_enum_value",
95
+ "unrecognized_keys",
96
+ "invalid_arguments",
97
+ "invalid_return_type",
98
+ "invalid_date",
99
+ "invalid_string",
100
+ "too_small",
101
+ "too_big",
102
+ "invalid_intersection_types",
103
+ "not_multiple_of",
104
+ "not_finite"
105
+ ]);
106
+ class T extends Error {
107
+ get errors() {
108
+ return this.issues;
109
+ }
110
+ constructor(e) {
111
+ super(), this.issues = [], this.addIssue = (r) => {
112
+ this.issues = [...this.issues, r];
113
+ }, this.addIssues = (r = []) => {
114
+ this.issues = [...this.issues, ...r];
115
+ };
116
+ const t = new.target.prototype;
117
+ Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
118
+ }
119
+ format(e) {
120
+ const t = e || function(n) {
121
+ return n.message;
122
+ }, r = { _errors: [] }, a = (n) => {
123
+ for (const i of n.issues)
124
+ if (i.code === "invalid_union")
125
+ i.unionErrors.map(a);
126
+ else if (i.code === "invalid_return_type")
127
+ a(i.returnTypeError);
128
+ else if (i.code === "invalid_arguments")
129
+ a(i.argumentsError);
130
+ else if (i.path.length === 0)
131
+ r._errors.push(t(i));
132
+ else {
133
+ let o = r, h = 0;
134
+ for (; h < i.path.length; ) {
135
+ const f = i.path[h];
136
+ h === i.path.length - 1 ? (o[f] = o[f] || { _errors: [] }, o[f]._errors.push(t(i))) : o[f] = o[f] || { _errors: [] }, o = o[f], h++;
137
+ }
138
+ }
139
+ };
140
+ return a(this), r;
141
+ }
142
+ static assert(e) {
143
+ if (!(e instanceof T))
144
+ throw new Error(`Not a ZodError: ${e}`);
145
+ }
146
+ toString() {
147
+ return this.message;
148
+ }
149
+ get message() {
150
+ return JSON.stringify(this.issues, y.jsonStringifyReplacer, 2);
151
+ }
152
+ get isEmpty() {
153
+ return this.issues.length === 0;
154
+ }
155
+ flatten(e = (t) => t.message) {
156
+ const t = {}, r = [];
157
+ for (const a of this.issues)
158
+ if (a.path.length > 0) {
159
+ const n = a.path[0];
160
+ t[n] = t[n] || [], t[n].push(e(a));
161
+ } else
162
+ r.push(e(a));
163
+ return { formErrors: r, fieldErrors: t };
164
+ }
165
+ get formErrors() {
166
+ return this.flatten();
167
+ }
168
+ }
169
+ T.create = (s) => new T(s);
170
+ const Y = (s, e) => {
171
+ let t;
172
+ switch (s.code) {
173
+ case d.invalid_type:
174
+ s.received === u.undefined ? t = "Required" : t = `Expected ${s.expected}, received ${s.received}`;
175
+ break;
176
+ case d.invalid_literal:
177
+ t = `Invalid literal value, expected ${JSON.stringify(s.expected, y.jsonStringifyReplacer)}`;
178
+ break;
179
+ case d.unrecognized_keys:
180
+ t = `Unrecognized key(s) in object: ${y.joinValues(s.keys, ", ")}`;
181
+ break;
182
+ case d.invalid_union:
183
+ t = "Invalid input";
184
+ break;
185
+ case d.invalid_union_discriminator:
186
+ t = `Invalid discriminator value. Expected ${y.joinValues(s.options)}`;
187
+ break;
188
+ case d.invalid_enum_value:
189
+ t = `Invalid enum value. Expected ${y.joinValues(s.options)}, received '${s.received}'`;
190
+ break;
191
+ case d.invalid_arguments:
192
+ t = "Invalid function arguments";
193
+ break;
194
+ case d.invalid_return_type:
195
+ t = "Invalid function return type";
196
+ break;
197
+ case d.invalid_date:
198
+ t = "Invalid date";
199
+ break;
200
+ case d.invalid_string:
201
+ typeof s.validation == "object" ? "includes" in s.validation ? (t = `Invalid input: must include "${s.validation.includes}"`, typeof s.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${s.validation.position}`)) : "startsWith" in s.validation ? t = `Invalid input: must start with "${s.validation.startsWith}"` : "endsWith" in s.validation ? t = `Invalid input: must end with "${s.validation.endsWith}"` : y.assertNever(s.validation) : s.validation !== "regex" ? t = `Invalid ${s.validation}` : t = "Invalid";
202
+ break;
203
+ case d.too_small:
204
+ s.type === "array" ? t = `Array must contain ${s.exact ? "exactly" : s.inclusive ? "at least" : "more than"} ${s.minimum} element(s)` : s.type === "string" ? t = `String must contain ${s.exact ? "exactly" : s.inclusive ? "at least" : "over"} ${s.minimum} character(s)` : s.type === "number" ? t = `Number must be ${s.exact ? "exactly equal to " : s.inclusive ? "greater than or equal to " : "greater than "}${s.minimum}` : s.type === "bigint" ? t = `Number must be ${s.exact ? "exactly equal to " : s.inclusive ? "greater than or equal to " : "greater than "}${s.minimum}` : s.type === "date" ? t = `Date must be ${s.exact ? "exactly equal to " : s.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(s.minimum))}` : t = "Invalid input";
205
+ break;
206
+ case d.too_big:
207
+ s.type === "array" ? t = `Array must contain ${s.exact ? "exactly" : s.inclusive ? "at most" : "less than"} ${s.maximum} element(s)` : s.type === "string" ? t = `String must contain ${s.exact ? "exactly" : s.inclusive ? "at most" : "under"} ${s.maximum} character(s)` : s.type === "number" ? t = `Number must be ${s.exact ? "exactly" : s.inclusive ? "less than or equal to" : "less than"} ${s.maximum}` : s.type === "bigint" ? t = `BigInt must be ${s.exact ? "exactly" : s.inclusive ? "less than or equal to" : "less than"} ${s.maximum}` : s.type === "date" ? t = `Date must be ${s.exact ? "exactly" : s.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(s.maximum))}` : t = "Invalid input";
208
+ break;
209
+ case d.custom:
210
+ t = "Invalid input";
211
+ break;
212
+ case d.invalid_intersection_types:
213
+ t = "Intersection results could not be merged";
214
+ break;
215
+ case d.not_multiple_of:
216
+ t = `Number must be a multiple of ${s.multipleOf}`;
217
+ break;
218
+ case d.not_finite:
219
+ t = "Number must be finite";
220
+ break;
221
+ default:
222
+ t = e.defaultError, y.assertNever(s);
223
+ }
224
+ return { message: t };
225
+ };
226
+ let ve = Y;
227
+ function xe() {
228
+ return ve;
229
+ }
230
+ const ke = (s) => {
231
+ const { data: e, path: t, errorMaps: r, issueData: a } = s, n = [...t, ...a.path || []], i = {
232
+ ...a,
233
+ path: n
234
+ };
235
+ if (a.message !== void 0)
236
+ return {
237
+ ...a,
238
+ path: n,
239
+ message: a.message
240
+ };
241
+ let o = "";
242
+ const h = r.filter((f) => !!f).slice().reverse();
243
+ for (const f of h)
244
+ o = f(i, { data: e, defaultError: o }).message;
245
+ return {
246
+ ...a,
247
+ path: n,
248
+ message: o
249
+ };
250
+ };
251
+ function c(s, e) {
252
+ const t = xe(), r = ke({
253
+ issueData: e,
254
+ data: s.data,
255
+ path: s.path,
256
+ errorMaps: [
257
+ s.common.contextualErrorMap,
258
+ // contextual error map is first priority
259
+ s.schemaErrorMap,
260
+ // then schema-bound map if available
261
+ t,
262
+ // then global override map
263
+ t === Y ? void 0 : Y
264
+ // then global default map
265
+ ].filter((a) => !!a)
266
+ });
267
+ s.common.issues.push(r);
268
+ }
269
+ class k {
270
+ constructor() {
271
+ this.value = "valid";
272
+ }
273
+ dirty() {
274
+ this.value === "valid" && (this.value = "dirty");
275
+ }
276
+ abort() {
277
+ this.value !== "aborted" && (this.value = "aborted");
278
+ }
279
+ static mergeArray(e, t) {
280
+ const r = [];
281
+ for (const a of t) {
282
+ if (a.status === "aborted")
283
+ return m;
284
+ a.status === "dirty" && e.dirty(), r.push(a.value);
285
+ }
286
+ return { status: e.value, value: r };
287
+ }
288
+ static async mergeObjectAsync(e, t) {
289
+ const r = [];
290
+ for (const a of t) {
291
+ const n = await a.key, i = await a.value;
292
+ r.push({
293
+ key: n,
294
+ value: i
295
+ });
296
+ }
297
+ return k.mergeObjectSync(e, r);
298
+ }
299
+ static mergeObjectSync(e, t) {
300
+ const r = {};
301
+ for (const a of t) {
302
+ const { key: n, value: i } = a;
303
+ if (n.status === "aborted" || i.status === "aborted")
304
+ return m;
305
+ n.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), n.value !== "__proto__" && (typeof i.value < "u" || a.alwaysSet) && (r[n.value] = i.value);
306
+ }
307
+ return { status: e.value, value: r };
308
+ }
309
+ }
310
+ const m = Object.freeze({
311
+ status: "aborted"
312
+ }), P = (s) => ({ status: "dirty", value: s }), b = (s) => ({ status: "valid", value: s }), se = (s) => s.status === "aborted", re = (s) => s.status === "dirty", $ = (s) => s.status === "valid", U = (s) => typeof Promise < "u" && s instanceof Promise;
313
+ var l;
314
+ (function(s) {
315
+ s.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, s.toString = (e) => typeof e == "string" ? e : e?.message;
316
+ })(l || (l = {}));
317
+ class N {
318
+ constructor(e, t, r, a) {
319
+ this._cachedPath = [], this.parent = e, this.data = t, this._path = r, this._key = a;
320
+ }
321
+ get path() {
322
+ return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
323
+ }
324
+ }
325
+ const ae = (s, e) => {
326
+ if ($(e))
327
+ return { success: !0, data: e.value };
328
+ if (!s.common.issues.length)
329
+ throw new Error("Validation failed but no issues detected.");
330
+ return {
331
+ success: !1,
332
+ get error() {
333
+ if (this._error)
334
+ return this._error;
335
+ const t = new T(s.common.issues);
336
+ return this._error = t, this._error;
337
+ }
338
+ };
339
+ };
340
+ function _(s) {
341
+ if (!s)
342
+ return {};
343
+ const { errorMap: e, invalid_type_error: t, required_error: r, description: a } = s;
344
+ if (e && (t || r))
345
+ throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
346
+ return e ? { errorMap: e, description: a } : { errorMap: (i, o) => {
347
+ const { message: h } = s;
348
+ return i.code === "invalid_enum_value" ? { message: h ?? o.defaultError } : typeof o.data > "u" ? { message: h ?? r ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: h ?? t ?? o.defaultError };
349
+ }, description: a };
350
+ }
351
+ class g {
352
+ get description() {
353
+ return this._def.description;
354
+ }
355
+ _getType(e) {
356
+ return O(e.data);
357
+ }
358
+ _getOrReturnCtx(e, t) {
359
+ return t || {
360
+ common: e.parent.common,
361
+ data: e.data,
362
+ parsedType: O(e.data),
363
+ schemaErrorMap: this._def.errorMap,
364
+ path: e.path,
365
+ parent: e.parent
366
+ };
367
+ }
368
+ _processInputParams(e) {
369
+ return {
370
+ status: new k(),
371
+ ctx: {
372
+ common: e.parent.common,
373
+ data: e.data,
374
+ parsedType: O(e.data),
375
+ schemaErrorMap: this._def.errorMap,
376
+ path: e.path,
377
+ parent: e.parent
378
+ }
379
+ };
380
+ }
381
+ _parseSync(e) {
382
+ const t = this._parse(e);
383
+ if (U(t))
384
+ throw new Error("Synchronous parse encountered promise.");
385
+ return t;
386
+ }
387
+ _parseAsync(e) {
388
+ const t = this._parse(e);
389
+ return Promise.resolve(t);
390
+ }
391
+ parse(e, t) {
392
+ const r = this.safeParse(e, t);
393
+ if (r.success)
394
+ return r.data;
395
+ throw r.error;
396
+ }
397
+ safeParse(e, t) {
398
+ const r = {
399
+ common: {
400
+ issues: [],
401
+ async: t?.async ?? !1,
402
+ contextualErrorMap: t?.errorMap
403
+ },
404
+ path: t?.path || [],
405
+ schemaErrorMap: this._def.errorMap,
406
+ parent: null,
407
+ data: e,
408
+ parsedType: O(e)
409
+ }, a = this._parseSync({ data: e, path: r.path, parent: r });
410
+ return ae(r, a);
411
+ }
412
+ "~validate"(e) {
413
+ const t = {
414
+ common: {
415
+ issues: [],
416
+ async: !!this["~standard"].async
417
+ },
418
+ path: [],
419
+ schemaErrorMap: this._def.errorMap,
420
+ parent: null,
421
+ data: e,
422
+ parsedType: O(e)
423
+ };
424
+ if (!this["~standard"].async)
425
+ try {
426
+ const r = this._parseSync({ data: e, path: [], parent: t });
427
+ return $(r) ? {
428
+ value: r.value
429
+ } : {
430
+ issues: t.common.issues
431
+ };
432
+ } catch (r) {
433
+ r?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), t.common = {
434
+ issues: [],
435
+ async: !0
436
+ };
437
+ }
438
+ return this._parseAsync({ data: e, path: [], parent: t }).then((r) => $(r) ? {
439
+ value: r.value
440
+ } : {
441
+ issues: t.common.issues
442
+ });
443
+ }
444
+ async parseAsync(e, t) {
445
+ const r = await this.safeParseAsync(e, t);
446
+ if (r.success)
447
+ return r.data;
448
+ throw r.error;
449
+ }
450
+ async safeParseAsync(e, t) {
451
+ const r = {
452
+ common: {
453
+ issues: [],
454
+ contextualErrorMap: t?.errorMap,
455
+ async: !0
456
+ },
457
+ path: t?.path || [],
458
+ schemaErrorMap: this._def.errorMap,
459
+ parent: null,
460
+ data: e,
461
+ parsedType: O(e)
462
+ }, a = this._parse({ data: e, path: r.path, parent: r }), n = await (U(a) ? a : Promise.resolve(a));
463
+ return ae(r, n);
464
+ }
465
+ refine(e, t) {
466
+ const r = (a) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(a) : t;
467
+ return this._refinement((a, n) => {
468
+ const i = e(a), o = () => n.addIssue({
469
+ code: d.custom,
470
+ ...r(a)
471
+ });
472
+ return typeof Promise < "u" && i instanceof Promise ? i.then((h) => h ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
473
+ });
474
+ }
475
+ refinement(e, t) {
476
+ return this._refinement((r, a) => e(r) ? !0 : (a.addIssue(typeof t == "function" ? t(r, a) : t), !1));
477
+ }
478
+ _refinement(e) {
479
+ return new j({
480
+ schema: this,
481
+ typeName: p.ZodEffects,
482
+ effect: { type: "refinement", refinement: e }
483
+ });
484
+ }
485
+ superRefine(e) {
486
+ return this._refinement(e);
487
+ }
488
+ constructor(e) {
489
+ this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this), this["~standard"] = {
490
+ version: 1,
491
+ vendor: "zod",
492
+ validate: (t) => this["~validate"](t)
493
+ };
494
+ }
495
+ optional() {
496
+ return S.create(this, this._def);
497
+ }
498
+ nullable() {
499
+ return L.create(this, this._def);
500
+ }
501
+ nullish() {
502
+ return this.nullable().optional();
503
+ }
504
+ array() {
505
+ return w.create(this);
506
+ }
507
+ promise() {
508
+ return q.create(this, this._def);
509
+ }
510
+ or(e) {
511
+ return F.create([this, e], this._def);
512
+ }
513
+ and(e) {
514
+ return W.create(this, e, this._def);
515
+ }
516
+ transform(e) {
517
+ return new j({
518
+ ..._(this._def),
519
+ schema: this,
520
+ typeName: p.ZodEffects,
521
+ effect: { type: "transform", transform: e }
522
+ });
523
+ }
524
+ default(e) {
525
+ const t = typeof e == "function" ? e : () => e;
526
+ return new Q({
527
+ ..._(this._def),
528
+ innerType: this,
529
+ defaultValue: t,
530
+ typeName: p.ZodDefault
531
+ });
532
+ }
533
+ brand() {
534
+ return new Fe({
535
+ typeName: p.ZodBranded,
536
+ type: this,
537
+ ..._(this._def)
538
+ });
539
+ }
540
+ catch(e) {
541
+ const t = typeof e == "function" ? e : () => e;
542
+ return new X({
543
+ ..._(this._def),
544
+ innerType: this,
545
+ catchValue: t,
546
+ typeName: p.ZodCatch
547
+ });
548
+ }
549
+ describe(e) {
550
+ const t = this.constructor;
551
+ return new t({
552
+ ...this._def,
553
+ description: e
554
+ });
555
+ }
556
+ pipe(e) {
557
+ return ee.create(this, e);
558
+ }
559
+ readonly() {
560
+ return K.create(this);
561
+ }
562
+ isOptional() {
563
+ return this.safeParse(void 0).success;
564
+ }
565
+ isNullable() {
566
+ return this.safeParse(null).success;
567
+ }
568
+ }
569
+ const be = /^c[^\s-]{8,}$/i, we = /^[0-9a-z]+$/, Ce = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Te = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Oe = /^[a-z0-9_-]{21}$/i, Se = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ne = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Ae = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ze = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
570
+ let J;
571
+ const Re = /^(?:(?: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])$/, Ie = /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/, je = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Ee = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, $e = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ve = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, pe = "((\\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])))", Me = new RegExp(`^${pe}$`);
572
+ function _e(s) {
573
+ let e = "[0-5]\\d";
574
+ s.precision ? e = `${e}\\.\\d{${s.precision}}` : s.precision == null && (e = `${e}(\\.\\d+)?`);
575
+ const t = s.precision ? "+" : "?";
576
+ return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
577
+ }
578
+ function Le(s) {
579
+ return new RegExp(`^${_e(s)}$`);
580
+ }
581
+ function ze(s) {
582
+ let e = `${pe}T${_e(s)}`;
583
+ const t = [];
584
+ return t.push(s.local ? "Z?" : "Z"), s.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
585
+ }
586
+ function Pe(s, e) {
587
+ return !!((e === "v4" || !e) && Re.test(s) || (e === "v6" || !e) && je.test(s));
588
+ }
589
+ function De(s, e) {
590
+ if (!Se.test(s))
591
+ return !1;
592
+ try {
593
+ const [t] = s.split(".");
594
+ if (!t)
595
+ return !1;
596
+ const r = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), a = JSON.parse(atob(r));
597
+ return !(typeof a != "object" || a === null || "typ" in a && a?.typ !== "JWT" || !a.alg || e && a.alg !== e);
598
+ } catch {
599
+ return !1;
600
+ }
601
+ }
602
+ function Ue(s, e) {
603
+ return !!((e === "v4" || !e) && Ie.test(s) || (e === "v6" || !e) && Ee.test(s));
604
+ }
605
+ class C extends g {
606
+ _parse(e) {
607
+ if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== u.string) {
608
+ const n = this._getOrReturnCtx(e);
609
+ return c(n, {
610
+ code: d.invalid_type,
611
+ expected: u.string,
612
+ received: n.parsedType
613
+ }), m;
614
+ }
615
+ const r = new k();
616
+ let a;
617
+ for (const n of this._def.checks)
618
+ if (n.kind === "min")
619
+ e.data.length < n.value && (a = this._getOrReturnCtx(e, a), c(a, {
620
+ code: d.too_small,
621
+ minimum: n.value,
622
+ type: "string",
623
+ inclusive: !0,
624
+ exact: !1,
625
+ message: n.message
626
+ }), r.dirty());
627
+ else if (n.kind === "max")
628
+ e.data.length > n.value && (a = this._getOrReturnCtx(e, a), c(a, {
629
+ code: d.too_big,
630
+ maximum: n.value,
631
+ type: "string",
632
+ inclusive: !0,
633
+ exact: !1,
634
+ message: n.message
635
+ }), r.dirty());
636
+ else if (n.kind === "length") {
637
+ const i = e.data.length > n.value, o = e.data.length < n.value;
638
+ (i || o) && (a = this._getOrReturnCtx(e, a), i ? c(a, {
639
+ code: d.too_big,
640
+ maximum: n.value,
641
+ type: "string",
642
+ inclusive: !0,
643
+ exact: !0,
644
+ message: n.message
645
+ }) : o && c(a, {
646
+ code: d.too_small,
647
+ minimum: n.value,
648
+ type: "string",
649
+ inclusive: !0,
650
+ exact: !0,
651
+ message: n.message
652
+ }), r.dirty());
653
+ } else if (n.kind === "email")
654
+ Ae.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
655
+ validation: "email",
656
+ code: d.invalid_string,
657
+ message: n.message
658
+ }), r.dirty());
659
+ else if (n.kind === "emoji")
660
+ J || (J = new RegExp(Ze, "u")), J.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
661
+ validation: "emoji",
662
+ code: d.invalid_string,
663
+ message: n.message
664
+ }), r.dirty());
665
+ else if (n.kind === "uuid")
666
+ Te.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
667
+ validation: "uuid",
668
+ code: d.invalid_string,
669
+ message: n.message
670
+ }), r.dirty());
671
+ else if (n.kind === "nanoid")
672
+ Oe.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
673
+ validation: "nanoid",
674
+ code: d.invalid_string,
675
+ message: n.message
676
+ }), r.dirty());
677
+ else if (n.kind === "cuid")
678
+ be.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
679
+ validation: "cuid",
680
+ code: d.invalid_string,
681
+ message: n.message
682
+ }), r.dirty());
683
+ else if (n.kind === "cuid2")
684
+ we.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
685
+ validation: "cuid2",
686
+ code: d.invalid_string,
687
+ message: n.message
688
+ }), r.dirty());
689
+ else if (n.kind === "ulid")
690
+ Ce.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
691
+ validation: "ulid",
692
+ code: d.invalid_string,
693
+ message: n.message
694
+ }), r.dirty());
695
+ else if (n.kind === "url")
696
+ try {
697
+ new URL(e.data);
698
+ } catch {
699
+ a = this._getOrReturnCtx(e, a), c(a, {
700
+ validation: "url",
701
+ code: d.invalid_string,
702
+ message: n.message
703
+ }), r.dirty();
704
+ }
705
+ else n.kind === "regex" ? (n.regex.lastIndex = 0, n.regex.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
706
+ validation: "regex",
707
+ code: d.invalid_string,
708
+ message: n.message
709
+ }), r.dirty())) : n.kind === "trim" ? e.data = e.data.trim() : n.kind === "includes" ? e.data.includes(n.value, n.position) || (a = this._getOrReturnCtx(e, a), c(a, {
710
+ code: d.invalid_string,
711
+ validation: { includes: n.value, position: n.position },
712
+ message: n.message
713
+ }), r.dirty()) : n.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : n.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : n.kind === "startsWith" ? e.data.startsWith(n.value) || (a = this._getOrReturnCtx(e, a), c(a, {
714
+ code: d.invalid_string,
715
+ validation: { startsWith: n.value },
716
+ message: n.message
717
+ }), r.dirty()) : n.kind === "endsWith" ? e.data.endsWith(n.value) || (a = this._getOrReturnCtx(e, a), c(a, {
718
+ code: d.invalid_string,
719
+ validation: { endsWith: n.value },
720
+ message: n.message
721
+ }), r.dirty()) : n.kind === "datetime" ? ze(n).test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
722
+ code: d.invalid_string,
723
+ validation: "datetime",
724
+ message: n.message
725
+ }), r.dirty()) : n.kind === "date" ? Me.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
726
+ code: d.invalid_string,
727
+ validation: "date",
728
+ message: n.message
729
+ }), r.dirty()) : n.kind === "time" ? Le(n).test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
730
+ code: d.invalid_string,
731
+ validation: "time",
732
+ message: n.message
733
+ }), r.dirty()) : n.kind === "duration" ? Ne.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
734
+ validation: "duration",
735
+ code: d.invalid_string,
736
+ message: n.message
737
+ }), r.dirty()) : n.kind === "ip" ? Pe(e.data, n.version) || (a = this._getOrReturnCtx(e, a), c(a, {
738
+ validation: "ip",
739
+ code: d.invalid_string,
740
+ message: n.message
741
+ }), r.dirty()) : n.kind === "jwt" ? De(e.data, n.alg) || (a = this._getOrReturnCtx(e, a), c(a, {
742
+ validation: "jwt",
743
+ code: d.invalid_string,
744
+ message: n.message
745
+ }), r.dirty()) : n.kind === "cidr" ? Ue(e.data, n.version) || (a = this._getOrReturnCtx(e, a), c(a, {
746
+ validation: "cidr",
747
+ code: d.invalid_string,
748
+ message: n.message
749
+ }), r.dirty()) : n.kind === "base64" ? $e.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
750
+ validation: "base64",
751
+ code: d.invalid_string,
752
+ message: n.message
753
+ }), r.dirty()) : n.kind === "base64url" ? Ve.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
754
+ validation: "base64url",
755
+ code: d.invalid_string,
756
+ message: n.message
757
+ }), r.dirty()) : y.assertNever(n);
758
+ return { status: r.value, value: e.data };
759
+ }
760
+ _regex(e, t, r) {
761
+ return this.refinement((a) => e.test(a), {
762
+ validation: t,
763
+ code: d.invalid_string,
764
+ ...l.errToObj(r)
765
+ });
766
+ }
767
+ _addCheck(e) {
768
+ return new C({
769
+ ...this._def,
770
+ checks: [...this._def.checks, e]
771
+ });
772
+ }
773
+ email(e) {
774
+ return this._addCheck({ kind: "email", ...l.errToObj(e) });
775
+ }
776
+ url(e) {
777
+ return this._addCheck({ kind: "url", ...l.errToObj(e) });
778
+ }
779
+ emoji(e) {
780
+ return this._addCheck({ kind: "emoji", ...l.errToObj(e) });
781
+ }
782
+ uuid(e) {
783
+ return this._addCheck({ kind: "uuid", ...l.errToObj(e) });
784
+ }
785
+ nanoid(e) {
786
+ return this._addCheck({ kind: "nanoid", ...l.errToObj(e) });
787
+ }
788
+ cuid(e) {
789
+ return this._addCheck({ kind: "cuid", ...l.errToObj(e) });
790
+ }
791
+ cuid2(e) {
792
+ return this._addCheck({ kind: "cuid2", ...l.errToObj(e) });
793
+ }
794
+ ulid(e) {
795
+ return this._addCheck({ kind: "ulid", ...l.errToObj(e) });
796
+ }
797
+ base64(e) {
798
+ return this._addCheck({ kind: "base64", ...l.errToObj(e) });
799
+ }
800
+ base64url(e) {
801
+ return this._addCheck({
802
+ kind: "base64url",
803
+ ...l.errToObj(e)
804
+ });
805
+ }
806
+ jwt(e) {
807
+ return this._addCheck({ kind: "jwt", ...l.errToObj(e) });
808
+ }
809
+ ip(e) {
810
+ return this._addCheck({ kind: "ip", ...l.errToObj(e) });
811
+ }
812
+ cidr(e) {
813
+ return this._addCheck({ kind: "cidr", ...l.errToObj(e) });
814
+ }
815
+ datetime(e) {
816
+ return typeof e == "string" ? this._addCheck({
817
+ kind: "datetime",
818
+ precision: null,
819
+ offset: !1,
820
+ local: !1,
821
+ message: e
822
+ }) : this._addCheck({
823
+ kind: "datetime",
824
+ precision: typeof e?.precision > "u" ? null : e?.precision,
825
+ offset: e?.offset ?? !1,
826
+ local: e?.local ?? !1,
827
+ ...l.errToObj(e?.message)
828
+ });
829
+ }
830
+ date(e) {
831
+ return this._addCheck({ kind: "date", message: e });
832
+ }
833
+ time(e) {
834
+ return typeof e == "string" ? this._addCheck({
835
+ kind: "time",
836
+ precision: null,
837
+ message: e
838
+ }) : this._addCheck({
839
+ kind: "time",
840
+ precision: typeof e?.precision > "u" ? null : e?.precision,
841
+ ...l.errToObj(e?.message)
842
+ });
843
+ }
844
+ duration(e) {
845
+ return this._addCheck({ kind: "duration", ...l.errToObj(e) });
846
+ }
847
+ regex(e, t) {
848
+ return this._addCheck({
849
+ kind: "regex",
850
+ regex: e,
851
+ ...l.errToObj(t)
852
+ });
853
+ }
854
+ includes(e, t) {
855
+ return this._addCheck({
856
+ kind: "includes",
857
+ value: e,
858
+ position: t?.position,
859
+ ...l.errToObj(t?.message)
860
+ });
861
+ }
862
+ startsWith(e, t) {
863
+ return this._addCheck({
864
+ kind: "startsWith",
865
+ value: e,
866
+ ...l.errToObj(t)
867
+ });
868
+ }
869
+ endsWith(e, t) {
870
+ return this._addCheck({
871
+ kind: "endsWith",
872
+ value: e,
873
+ ...l.errToObj(t)
874
+ });
875
+ }
876
+ min(e, t) {
877
+ return this._addCheck({
878
+ kind: "min",
879
+ value: e,
880
+ ...l.errToObj(t)
881
+ });
882
+ }
883
+ max(e, t) {
884
+ return this._addCheck({
885
+ kind: "max",
886
+ value: e,
887
+ ...l.errToObj(t)
888
+ });
889
+ }
890
+ length(e, t) {
891
+ return this._addCheck({
892
+ kind: "length",
893
+ value: e,
894
+ ...l.errToObj(t)
895
+ });
896
+ }
897
+ /**
898
+ * Equivalent to `.min(1)`
899
+ */
900
+ nonempty(e) {
901
+ return this.min(1, l.errToObj(e));
902
+ }
903
+ trim() {
904
+ return new C({
905
+ ...this._def,
906
+ checks: [...this._def.checks, { kind: "trim" }]
907
+ });
908
+ }
909
+ toLowerCase() {
910
+ return new C({
911
+ ...this._def,
912
+ checks: [...this._def.checks, { kind: "toLowerCase" }]
913
+ });
914
+ }
915
+ toUpperCase() {
916
+ return new C({
917
+ ...this._def,
918
+ checks: [...this._def.checks, { kind: "toUpperCase" }]
919
+ });
920
+ }
921
+ get isDatetime() {
922
+ return !!this._def.checks.find((e) => e.kind === "datetime");
923
+ }
924
+ get isDate() {
925
+ return !!this._def.checks.find((e) => e.kind === "date");
926
+ }
927
+ get isTime() {
928
+ return !!this._def.checks.find((e) => e.kind === "time");
929
+ }
930
+ get isDuration() {
931
+ return !!this._def.checks.find((e) => e.kind === "duration");
932
+ }
933
+ get isEmail() {
934
+ return !!this._def.checks.find((e) => e.kind === "email");
935
+ }
936
+ get isURL() {
937
+ return !!this._def.checks.find((e) => e.kind === "url");
938
+ }
939
+ get isEmoji() {
940
+ return !!this._def.checks.find((e) => e.kind === "emoji");
941
+ }
942
+ get isUUID() {
943
+ return !!this._def.checks.find((e) => e.kind === "uuid");
944
+ }
945
+ get isNANOID() {
946
+ return !!this._def.checks.find((e) => e.kind === "nanoid");
947
+ }
948
+ get isCUID() {
949
+ return !!this._def.checks.find((e) => e.kind === "cuid");
950
+ }
951
+ get isCUID2() {
952
+ return !!this._def.checks.find((e) => e.kind === "cuid2");
953
+ }
954
+ get isULID() {
955
+ return !!this._def.checks.find((e) => e.kind === "ulid");
956
+ }
957
+ get isIP() {
958
+ return !!this._def.checks.find((e) => e.kind === "ip");
959
+ }
960
+ get isCIDR() {
961
+ return !!this._def.checks.find((e) => e.kind === "cidr");
962
+ }
963
+ get isBase64() {
964
+ return !!this._def.checks.find((e) => e.kind === "base64");
965
+ }
966
+ get isBase64url() {
967
+ return !!this._def.checks.find((e) => e.kind === "base64url");
968
+ }
969
+ get minLength() {
970
+ let e = null;
971
+ for (const t of this._def.checks)
972
+ t.kind === "min" && (e === null || t.value > e) && (e = t.value);
973
+ return e;
974
+ }
975
+ get maxLength() {
976
+ let e = null;
977
+ for (const t of this._def.checks)
978
+ t.kind === "max" && (e === null || t.value < e) && (e = t.value);
979
+ return e;
980
+ }
981
+ }
982
+ C.create = (s) => new C({
983
+ checks: [],
984
+ typeName: p.ZodString,
985
+ coerce: s?.coerce ?? !1,
986
+ ..._(s)
987
+ });
988
+ function Be(s, e) {
989
+ const t = (s.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, a = t > r ? t : r, n = Number.parseInt(s.toFixed(a).replace(".", "")), i = Number.parseInt(e.toFixed(a).replace(".", ""));
990
+ return n % i / 10 ** a;
991
+ }
992
+ class Z extends g {
993
+ constructor() {
994
+ super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
995
+ }
996
+ _parse(e) {
997
+ if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== u.number) {
998
+ const n = this._getOrReturnCtx(e);
999
+ return c(n, {
1000
+ code: d.invalid_type,
1001
+ expected: u.number,
1002
+ received: n.parsedType
1003
+ }), m;
1004
+ }
1005
+ let r;
1006
+ const a = new k();
1007
+ for (const n of this._def.checks)
1008
+ n.kind === "int" ? y.isInteger(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
1009
+ code: d.invalid_type,
1010
+ expected: "integer",
1011
+ received: "float",
1012
+ message: n.message
1013
+ }), a.dirty()) : n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (r = this._getOrReturnCtx(e, r), c(r, {
1014
+ code: d.too_small,
1015
+ minimum: n.value,
1016
+ type: "number",
1017
+ inclusive: n.inclusive,
1018
+ exact: !1,
1019
+ message: n.message
1020
+ }), a.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (r = this._getOrReturnCtx(e, r), c(r, {
1021
+ code: d.too_big,
1022
+ maximum: n.value,
1023
+ type: "number",
1024
+ inclusive: n.inclusive,
1025
+ exact: !1,
1026
+ message: n.message
1027
+ }), a.dirty()) : n.kind === "multipleOf" ? Be(e.data, n.value) !== 0 && (r = this._getOrReturnCtx(e, r), c(r, {
1028
+ code: d.not_multiple_of,
1029
+ multipleOf: n.value,
1030
+ message: n.message
1031
+ }), a.dirty()) : n.kind === "finite" ? Number.isFinite(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
1032
+ code: d.not_finite,
1033
+ message: n.message
1034
+ }), a.dirty()) : y.assertNever(n);
1035
+ return { status: a.value, value: e.data };
1036
+ }
1037
+ gte(e, t) {
1038
+ return this.setLimit("min", e, !0, l.toString(t));
1039
+ }
1040
+ gt(e, t) {
1041
+ return this.setLimit("min", e, !1, l.toString(t));
1042
+ }
1043
+ lte(e, t) {
1044
+ return this.setLimit("max", e, !0, l.toString(t));
1045
+ }
1046
+ lt(e, t) {
1047
+ return this.setLimit("max", e, !1, l.toString(t));
1048
+ }
1049
+ setLimit(e, t, r, a) {
1050
+ return new Z({
1051
+ ...this._def,
1052
+ checks: [
1053
+ ...this._def.checks,
1054
+ {
1055
+ kind: e,
1056
+ value: t,
1057
+ inclusive: r,
1058
+ message: l.toString(a)
1059
+ }
1060
+ ]
1061
+ });
1062
+ }
1063
+ _addCheck(e) {
1064
+ return new Z({
1065
+ ...this._def,
1066
+ checks: [...this._def.checks, e]
1067
+ });
1068
+ }
1069
+ int(e) {
1070
+ return this._addCheck({
1071
+ kind: "int",
1072
+ message: l.toString(e)
1073
+ });
1074
+ }
1075
+ positive(e) {
1076
+ return this._addCheck({
1077
+ kind: "min",
1078
+ value: 0,
1079
+ inclusive: !1,
1080
+ message: l.toString(e)
1081
+ });
1082
+ }
1083
+ negative(e) {
1084
+ return this._addCheck({
1085
+ kind: "max",
1086
+ value: 0,
1087
+ inclusive: !1,
1088
+ message: l.toString(e)
1089
+ });
1090
+ }
1091
+ nonpositive(e) {
1092
+ return this._addCheck({
1093
+ kind: "max",
1094
+ value: 0,
1095
+ inclusive: !0,
1096
+ message: l.toString(e)
1097
+ });
1098
+ }
1099
+ nonnegative(e) {
1100
+ return this._addCheck({
1101
+ kind: "min",
1102
+ value: 0,
1103
+ inclusive: !0,
1104
+ message: l.toString(e)
1105
+ });
1106
+ }
1107
+ multipleOf(e, t) {
1108
+ return this._addCheck({
1109
+ kind: "multipleOf",
1110
+ value: e,
1111
+ message: l.toString(t)
1112
+ });
1113
+ }
1114
+ finite(e) {
1115
+ return this._addCheck({
1116
+ kind: "finite",
1117
+ message: l.toString(e)
1118
+ });
1119
+ }
1120
+ safe(e) {
1121
+ return this._addCheck({
1122
+ kind: "min",
1123
+ inclusive: !0,
1124
+ value: Number.MIN_SAFE_INTEGER,
1125
+ message: l.toString(e)
1126
+ })._addCheck({
1127
+ kind: "max",
1128
+ inclusive: !0,
1129
+ value: Number.MAX_SAFE_INTEGER,
1130
+ message: l.toString(e)
1131
+ });
1132
+ }
1133
+ get minValue() {
1134
+ let e = null;
1135
+ for (const t of this._def.checks)
1136
+ t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1137
+ return e;
1138
+ }
1139
+ get maxValue() {
1140
+ let e = null;
1141
+ for (const t of this._def.checks)
1142
+ t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1143
+ return e;
1144
+ }
1145
+ get isInt() {
1146
+ return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && y.isInteger(e.value));
1147
+ }
1148
+ get isFinite() {
1149
+ let e = null, t = null;
1150
+ for (const r of this._def.checks) {
1151
+ if (r.kind === "finite" || r.kind === "int" || r.kind === "multipleOf")
1152
+ return !0;
1153
+ r.kind === "min" ? (t === null || r.value > t) && (t = r.value) : r.kind === "max" && (e === null || r.value < e) && (e = r.value);
1154
+ }
1155
+ return Number.isFinite(t) && Number.isFinite(e);
1156
+ }
1157
+ }
1158
+ Z.create = (s) => new Z({
1159
+ checks: [],
1160
+ typeName: p.ZodNumber,
1161
+ coerce: s?.coerce || !1,
1162
+ ..._(s)
1163
+ });
1164
+ class R extends g {
1165
+ constructor() {
1166
+ super(...arguments), this.min = this.gte, this.max = this.lte;
1167
+ }
1168
+ _parse(e) {
1169
+ if (this._def.coerce)
1170
+ try {
1171
+ e.data = BigInt(e.data);
1172
+ } catch {
1173
+ return this._getInvalidInput(e);
1174
+ }
1175
+ if (this._getType(e) !== u.bigint)
1176
+ return this._getInvalidInput(e);
1177
+ let r;
1178
+ const a = new k();
1179
+ for (const n of this._def.checks)
1180
+ n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (r = this._getOrReturnCtx(e, r), c(r, {
1181
+ code: d.too_small,
1182
+ type: "bigint",
1183
+ minimum: n.value,
1184
+ inclusive: n.inclusive,
1185
+ message: n.message
1186
+ }), a.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (r = this._getOrReturnCtx(e, r), c(r, {
1187
+ code: d.too_big,
1188
+ type: "bigint",
1189
+ maximum: n.value,
1190
+ inclusive: n.inclusive,
1191
+ message: n.message
1192
+ }), a.dirty()) : n.kind === "multipleOf" ? e.data % n.value !== BigInt(0) && (r = this._getOrReturnCtx(e, r), c(r, {
1193
+ code: d.not_multiple_of,
1194
+ multipleOf: n.value,
1195
+ message: n.message
1196
+ }), a.dirty()) : y.assertNever(n);
1197
+ return { status: a.value, value: e.data };
1198
+ }
1199
+ _getInvalidInput(e) {
1200
+ const t = this._getOrReturnCtx(e);
1201
+ return c(t, {
1202
+ code: d.invalid_type,
1203
+ expected: u.bigint,
1204
+ received: t.parsedType
1205
+ }), m;
1206
+ }
1207
+ gte(e, t) {
1208
+ return this.setLimit("min", e, !0, l.toString(t));
1209
+ }
1210
+ gt(e, t) {
1211
+ return this.setLimit("min", e, !1, l.toString(t));
1212
+ }
1213
+ lte(e, t) {
1214
+ return this.setLimit("max", e, !0, l.toString(t));
1215
+ }
1216
+ lt(e, t) {
1217
+ return this.setLimit("max", e, !1, l.toString(t));
1218
+ }
1219
+ setLimit(e, t, r, a) {
1220
+ return new R({
1221
+ ...this._def,
1222
+ checks: [
1223
+ ...this._def.checks,
1224
+ {
1225
+ kind: e,
1226
+ value: t,
1227
+ inclusive: r,
1228
+ message: l.toString(a)
1229
+ }
1230
+ ]
1231
+ });
1232
+ }
1233
+ _addCheck(e) {
1234
+ return new R({
1235
+ ...this._def,
1236
+ checks: [...this._def.checks, e]
1237
+ });
1238
+ }
1239
+ positive(e) {
1240
+ return this._addCheck({
1241
+ kind: "min",
1242
+ value: BigInt(0),
1243
+ inclusive: !1,
1244
+ message: l.toString(e)
1245
+ });
1246
+ }
1247
+ negative(e) {
1248
+ return this._addCheck({
1249
+ kind: "max",
1250
+ value: BigInt(0),
1251
+ inclusive: !1,
1252
+ message: l.toString(e)
1253
+ });
1254
+ }
1255
+ nonpositive(e) {
1256
+ return this._addCheck({
1257
+ kind: "max",
1258
+ value: BigInt(0),
1259
+ inclusive: !0,
1260
+ message: l.toString(e)
1261
+ });
1262
+ }
1263
+ nonnegative(e) {
1264
+ return this._addCheck({
1265
+ kind: "min",
1266
+ value: BigInt(0),
1267
+ inclusive: !0,
1268
+ message: l.toString(e)
1269
+ });
1270
+ }
1271
+ multipleOf(e, t) {
1272
+ return this._addCheck({
1273
+ kind: "multipleOf",
1274
+ value: e,
1275
+ message: l.toString(t)
1276
+ });
1277
+ }
1278
+ get minValue() {
1279
+ let e = null;
1280
+ for (const t of this._def.checks)
1281
+ t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1282
+ return e;
1283
+ }
1284
+ get maxValue() {
1285
+ let e = null;
1286
+ for (const t of this._def.checks)
1287
+ t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1288
+ return e;
1289
+ }
1290
+ }
1291
+ R.create = (s) => new R({
1292
+ checks: [],
1293
+ typeName: p.ZodBigInt,
1294
+ coerce: s?.coerce ?? !1,
1295
+ ..._(s)
1296
+ });
1297
+ class B extends g {
1298
+ _parse(e) {
1299
+ if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== u.boolean) {
1300
+ const r = this._getOrReturnCtx(e);
1301
+ return c(r, {
1302
+ code: d.invalid_type,
1303
+ expected: u.boolean,
1304
+ received: r.parsedType
1305
+ }), m;
1306
+ }
1307
+ return b(e.data);
1308
+ }
1309
+ }
1310
+ B.create = (s) => new B({
1311
+ typeName: p.ZodBoolean,
1312
+ coerce: s?.coerce || !1,
1313
+ ..._(s)
1314
+ });
1315
+ class V extends g {
1316
+ _parse(e) {
1317
+ if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== u.date) {
1318
+ const n = this._getOrReturnCtx(e);
1319
+ return c(n, {
1320
+ code: d.invalid_type,
1321
+ expected: u.date,
1322
+ received: n.parsedType
1323
+ }), m;
1324
+ }
1325
+ if (Number.isNaN(e.data.getTime())) {
1326
+ const n = this._getOrReturnCtx(e);
1327
+ return c(n, {
1328
+ code: d.invalid_date
1329
+ }), m;
1330
+ }
1331
+ const r = new k();
1332
+ let a;
1333
+ for (const n of this._def.checks)
1334
+ n.kind === "min" ? e.data.getTime() < n.value && (a = this._getOrReturnCtx(e, a), c(a, {
1335
+ code: d.too_small,
1336
+ message: n.message,
1337
+ inclusive: !0,
1338
+ exact: !1,
1339
+ minimum: n.value,
1340
+ type: "date"
1341
+ }), r.dirty()) : n.kind === "max" ? e.data.getTime() > n.value && (a = this._getOrReturnCtx(e, a), c(a, {
1342
+ code: d.too_big,
1343
+ message: n.message,
1344
+ inclusive: !0,
1345
+ exact: !1,
1346
+ maximum: n.value,
1347
+ type: "date"
1348
+ }), r.dirty()) : y.assertNever(n);
1349
+ return {
1350
+ status: r.value,
1351
+ value: new Date(e.data.getTime())
1352
+ };
1353
+ }
1354
+ _addCheck(e) {
1355
+ return new V({
1356
+ ...this._def,
1357
+ checks: [...this._def.checks, e]
1358
+ });
1359
+ }
1360
+ min(e, t) {
1361
+ return this._addCheck({
1362
+ kind: "min",
1363
+ value: e.getTime(),
1364
+ message: l.toString(t)
1365
+ });
1366
+ }
1367
+ max(e, t) {
1368
+ return this._addCheck({
1369
+ kind: "max",
1370
+ value: e.getTime(),
1371
+ message: l.toString(t)
1372
+ });
1373
+ }
1374
+ get minDate() {
1375
+ let e = null;
1376
+ for (const t of this._def.checks)
1377
+ t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1378
+ return e != null ? new Date(e) : null;
1379
+ }
1380
+ get maxDate() {
1381
+ let e = null;
1382
+ for (const t of this._def.checks)
1383
+ t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1384
+ return e != null ? new Date(e) : null;
1385
+ }
1386
+ }
1387
+ V.create = (s) => new V({
1388
+ checks: [],
1389
+ coerce: s?.coerce || !1,
1390
+ typeName: p.ZodDate,
1391
+ ..._(s)
1392
+ });
1393
+ class ne extends g {
1394
+ _parse(e) {
1395
+ if (this._getType(e) !== u.symbol) {
1396
+ const r = this._getOrReturnCtx(e);
1397
+ return c(r, {
1398
+ code: d.invalid_type,
1399
+ expected: u.symbol,
1400
+ received: r.parsedType
1401
+ }), m;
1402
+ }
1403
+ return b(e.data);
1404
+ }
1405
+ }
1406
+ ne.create = (s) => new ne({
1407
+ typeName: p.ZodSymbol,
1408
+ ..._(s)
1409
+ });
1410
+ class ie extends g {
1411
+ _parse(e) {
1412
+ if (this._getType(e) !== u.undefined) {
1413
+ const r = this._getOrReturnCtx(e);
1414
+ return c(r, {
1415
+ code: d.invalid_type,
1416
+ expected: u.undefined,
1417
+ received: r.parsedType
1418
+ }), m;
1419
+ }
1420
+ return b(e.data);
1421
+ }
1422
+ }
1423
+ ie.create = (s) => new ie({
1424
+ typeName: p.ZodUndefined,
1425
+ ..._(s)
1426
+ });
1427
+ class oe extends g {
1428
+ _parse(e) {
1429
+ if (this._getType(e) !== u.null) {
1430
+ const r = this._getOrReturnCtx(e);
1431
+ return c(r, {
1432
+ code: d.invalid_type,
1433
+ expected: u.null,
1434
+ received: r.parsedType
1435
+ }), m;
1436
+ }
1437
+ return b(e.data);
1438
+ }
1439
+ }
1440
+ oe.create = (s) => new oe({
1441
+ typeName: p.ZodNull,
1442
+ ..._(s)
1443
+ });
1444
+ class H extends g {
1445
+ constructor() {
1446
+ super(...arguments), this._any = !0;
1447
+ }
1448
+ _parse(e) {
1449
+ return b(e.data);
1450
+ }
1451
+ }
1452
+ H.create = (s) => new H({
1453
+ typeName: p.ZodAny,
1454
+ ..._(s)
1455
+ });
1456
+ class de extends g {
1457
+ constructor() {
1458
+ super(...arguments), this._unknown = !0;
1459
+ }
1460
+ _parse(e) {
1461
+ return b(e.data);
1462
+ }
1463
+ }
1464
+ de.create = (s) => new de({
1465
+ typeName: p.ZodUnknown,
1466
+ ..._(s)
1467
+ });
1468
+ class A extends g {
1469
+ _parse(e) {
1470
+ const t = this._getOrReturnCtx(e);
1471
+ return c(t, {
1472
+ code: d.invalid_type,
1473
+ expected: u.never,
1474
+ received: t.parsedType
1475
+ }), m;
1476
+ }
1477
+ }
1478
+ A.create = (s) => new A({
1479
+ typeName: p.ZodNever,
1480
+ ..._(s)
1481
+ });
1482
+ class ce extends g {
1483
+ _parse(e) {
1484
+ if (this._getType(e) !== u.undefined) {
1485
+ const r = this._getOrReturnCtx(e);
1486
+ return c(r, {
1487
+ code: d.invalid_type,
1488
+ expected: u.void,
1489
+ received: r.parsedType
1490
+ }), m;
1491
+ }
1492
+ return b(e.data);
1493
+ }
1494
+ }
1495
+ ce.create = (s) => new ce({
1496
+ typeName: p.ZodVoid,
1497
+ ..._(s)
1498
+ });
1499
+ class w extends g {
1500
+ _parse(e) {
1501
+ const { ctx: t, status: r } = this._processInputParams(e), a = this._def;
1502
+ if (t.parsedType !== u.array)
1503
+ return c(t, {
1504
+ code: d.invalid_type,
1505
+ expected: u.array,
1506
+ received: t.parsedType
1507
+ }), m;
1508
+ if (a.exactLength !== null) {
1509
+ const i = t.data.length > a.exactLength.value, o = t.data.length < a.exactLength.value;
1510
+ (i || o) && (c(t, {
1511
+ code: i ? d.too_big : d.too_small,
1512
+ minimum: o ? a.exactLength.value : void 0,
1513
+ maximum: i ? a.exactLength.value : void 0,
1514
+ type: "array",
1515
+ inclusive: !0,
1516
+ exact: !0,
1517
+ message: a.exactLength.message
1518
+ }), r.dirty());
1519
+ }
1520
+ if (a.minLength !== null && t.data.length < a.minLength.value && (c(t, {
1521
+ code: d.too_small,
1522
+ minimum: a.minLength.value,
1523
+ type: "array",
1524
+ inclusive: !0,
1525
+ exact: !1,
1526
+ message: a.minLength.message
1527
+ }), r.dirty()), a.maxLength !== null && t.data.length > a.maxLength.value && (c(t, {
1528
+ code: d.too_big,
1529
+ maximum: a.maxLength.value,
1530
+ type: "array",
1531
+ inclusive: !0,
1532
+ exact: !1,
1533
+ message: a.maxLength.message
1534
+ }), r.dirty()), t.common.async)
1535
+ return Promise.all([...t.data].map((i, o) => a.type._parseAsync(new N(t, i, t.path, o)))).then((i) => k.mergeArray(r, i));
1536
+ const n = [...t.data].map((i, o) => a.type._parseSync(new N(t, i, t.path, o)));
1537
+ return k.mergeArray(r, n);
1538
+ }
1539
+ get element() {
1540
+ return this._def.type;
1541
+ }
1542
+ min(e, t) {
1543
+ return new w({
1544
+ ...this._def,
1545
+ minLength: { value: e, message: l.toString(t) }
1546
+ });
1547
+ }
1548
+ max(e, t) {
1549
+ return new w({
1550
+ ...this._def,
1551
+ maxLength: { value: e, message: l.toString(t) }
1552
+ });
1553
+ }
1554
+ length(e, t) {
1555
+ return new w({
1556
+ ...this._def,
1557
+ exactLength: { value: e, message: l.toString(t) }
1558
+ });
1559
+ }
1560
+ nonempty(e) {
1561
+ return this.min(1, e);
1562
+ }
1563
+ }
1564
+ w.create = (s, e) => new w({
1565
+ type: s,
1566
+ minLength: null,
1567
+ maxLength: null,
1568
+ exactLength: null,
1569
+ typeName: p.ZodArray,
1570
+ ..._(e)
1571
+ });
1572
+ function E(s) {
1573
+ if (s instanceof x) {
1574
+ const e = {};
1575
+ for (const t in s.shape) {
1576
+ const r = s.shape[t];
1577
+ e[t] = S.create(E(r));
1578
+ }
1579
+ return new x({
1580
+ ...s._def,
1581
+ shape: () => e
1582
+ });
1583
+ } else return s instanceof w ? new w({
1584
+ ...s._def,
1585
+ type: E(s.element)
1586
+ }) : s instanceof S ? S.create(E(s.unwrap())) : s instanceof L ? L.create(E(s.unwrap())) : s instanceof I ? I.create(s.items.map((e) => E(e))) : s;
1587
+ }
1588
+ class x extends g {
1589
+ constructor() {
1590
+ super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1591
+ }
1592
+ _getCached() {
1593
+ if (this._cached !== null)
1594
+ return this._cached;
1595
+ const e = this._def.shape(), t = y.objectKeys(e);
1596
+ return this._cached = { shape: e, keys: t }, this._cached;
1597
+ }
1598
+ _parse(e) {
1599
+ if (this._getType(e) !== u.object) {
1600
+ const f = this._getOrReturnCtx(e);
1601
+ return c(f, {
1602
+ code: d.invalid_type,
1603
+ expected: u.object,
1604
+ received: f.parsedType
1605
+ }), m;
1606
+ }
1607
+ const { status: r, ctx: a } = this._processInputParams(e), { shape: n, keys: i } = this._getCached(), o = [];
1608
+ if (!(this._def.catchall instanceof A && this._def.unknownKeys === "strip"))
1609
+ for (const f in a.data)
1610
+ i.includes(f) || o.push(f);
1611
+ const h = [];
1612
+ for (const f of i) {
1613
+ const v = n[f], z = a.data[f];
1614
+ h.push({
1615
+ key: { status: "valid", value: f },
1616
+ value: v._parse(new N(a, z, a.path, f)),
1617
+ alwaysSet: f in a.data
1618
+ });
1619
+ }
1620
+ if (this._def.catchall instanceof A) {
1621
+ const f = this._def.unknownKeys;
1622
+ if (f === "passthrough")
1623
+ for (const v of o)
1624
+ h.push({
1625
+ key: { status: "valid", value: v },
1626
+ value: { status: "valid", value: a.data[v] }
1627
+ });
1628
+ else if (f === "strict")
1629
+ o.length > 0 && (c(a, {
1630
+ code: d.unrecognized_keys,
1631
+ keys: o
1632
+ }), r.dirty());
1633
+ else if (f !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1634
+ } else {
1635
+ const f = this._def.catchall;
1636
+ for (const v of o) {
1637
+ const z = a.data[v];
1638
+ h.push({
1639
+ key: { status: "valid", value: v },
1640
+ value: f._parse(
1641
+ new N(a, z, a.path, v)
1642
+ //, ctx.child(key), value, getParsedType(value)
1643
+ ),
1644
+ alwaysSet: v in a.data
1645
+ });
1646
+ }
1647
+ }
1648
+ return a.common.async ? Promise.resolve().then(async () => {
1649
+ const f = [];
1650
+ for (const v of h) {
1651
+ const z = await v.key, ye = await v.value;
1652
+ f.push({
1653
+ key: z,
1654
+ value: ye,
1655
+ alwaysSet: v.alwaysSet
1656
+ });
1657
+ }
1658
+ return f;
1659
+ }).then((f) => k.mergeObjectSync(r, f)) : k.mergeObjectSync(r, h);
1660
+ }
1661
+ get shape() {
1662
+ return this._def.shape();
1663
+ }
1664
+ strict(e) {
1665
+ return l.errToObj, new x({
1666
+ ...this._def,
1667
+ unknownKeys: "strict",
1668
+ ...e !== void 0 ? {
1669
+ errorMap: (t, r) => {
1670
+ const a = this._def.errorMap?.(t, r).message ?? r.defaultError;
1671
+ return t.code === "unrecognized_keys" ? {
1672
+ message: l.errToObj(e).message ?? a
1673
+ } : {
1674
+ message: a
1675
+ };
1676
+ }
1677
+ } : {}
1678
+ });
1679
+ }
1680
+ strip() {
1681
+ return new x({
1682
+ ...this._def,
1683
+ unknownKeys: "strip"
1684
+ });
1685
+ }
1686
+ passthrough() {
1687
+ return new x({
1688
+ ...this._def,
1689
+ unknownKeys: "passthrough"
1690
+ });
1691
+ }
1692
+ // const AugmentFactory =
1693
+ // <Def extends ZodObjectDef>(def: Def) =>
1694
+ // <Augmentation extends ZodRawShape>(
1695
+ // augmentation: Augmentation
1696
+ // ): ZodObject<
1697
+ // extendShape<ReturnType<Def["shape"]>, Augmentation>,
1698
+ // Def["unknownKeys"],
1699
+ // Def["catchall"]
1700
+ // > => {
1701
+ // return new ZodObject({
1702
+ // ...def,
1703
+ // shape: () => ({
1704
+ // ...def.shape(),
1705
+ // ...augmentation,
1706
+ // }),
1707
+ // }) as any;
1708
+ // };
1709
+ extend(e) {
1710
+ return new x({
1711
+ ...this._def,
1712
+ shape: () => ({
1713
+ ...this._def.shape(),
1714
+ ...e
1715
+ })
1716
+ });
1717
+ }
1718
+ /**
1719
+ * Prior to zod@1.0.12 there was a bug in the
1720
+ * inferred type of merged objects. Please
1721
+ * upgrade if you are experiencing issues.
1722
+ */
1723
+ merge(e) {
1724
+ return new x({
1725
+ unknownKeys: e._def.unknownKeys,
1726
+ catchall: e._def.catchall,
1727
+ shape: () => ({
1728
+ ...this._def.shape(),
1729
+ ...e._def.shape()
1730
+ }),
1731
+ typeName: p.ZodObject
1732
+ });
1733
+ }
1734
+ // merge<
1735
+ // Incoming extends AnyZodObject,
1736
+ // Augmentation extends Incoming["shape"],
1737
+ // NewOutput extends {
1738
+ // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
1739
+ // ? Augmentation[k]["_output"]
1740
+ // : k extends keyof Output
1741
+ // ? Output[k]
1742
+ // : never;
1743
+ // },
1744
+ // NewInput extends {
1745
+ // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
1746
+ // ? Augmentation[k]["_input"]
1747
+ // : k extends keyof Input
1748
+ // ? Input[k]
1749
+ // : never;
1750
+ // }
1751
+ // >(
1752
+ // merging: Incoming
1753
+ // ): ZodObject<
1754
+ // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
1755
+ // Incoming["_def"]["unknownKeys"],
1756
+ // Incoming["_def"]["catchall"],
1757
+ // NewOutput,
1758
+ // NewInput
1759
+ // > {
1760
+ // const merged: any = new ZodObject({
1761
+ // unknownKeys: merging._def.unknownKeys,
1762
+ // catchall: merging._def.catchall,
1763
+ // shape: () =>
1764
+ // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
1765
+ // typeName: ZodFirstPartyTypeKind.ZodObject,
1766
+ // }) as any;
1767
+ // return merged;
1768
+ // }
1769
+ setKey(e, t) {
1770
+ return this.augment({ [e]: t });
1771
+ }
1772
+ // merge<Incoming extends AnyZodObject>(
1773
+ // merging: Incoming
1774
+ // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
1775
+ // ZodObject<
1776
+ // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
1777
+ // Incoming["_def"]["unknownKeys"],
1778
+ // Incoming["_def"]["catchall"]
1779
+ // > {
1780
+ // // const mergedShape = objectUtil.mergeShapes(
1781
+ // // this._def.shape(),
1782
+ // // merging._def.shape()
1783
+ // // );
1784
+ // const merged: any = new ZodObject({
1785
+ // unknownKeys: merging._def.unknownKeys,
1786
+ // catchall: merging._def.catchall,
1787
+ // shape: () =>
1788
+ // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
1789
+ // typeName: ZodFirstPartyTypeKind.ZodObject,
1790
+ // }) as any;
1791
+ // return merged;
1792
+ // }
1793
+ catchall(e) {
1794
+ return new x({
1795
+ ...this._def,
1796
+ catchall: e
1797
+ });
1798
+ }
1799
+ pick(e) {
1800
+ const t = {};
1801
+ for (const r of y.objectKeys(e))
1802
+ e[r] && this.shape[r] && (t[r] = this.shape[r]);
1803
+ return new x({
1804
+ ...this._def,
1805
+ shape: () => t
1806
+ });
1807
+ }
1808
+ omit(e) {
1809
+ const t = {};
1810
+ for (const r of y.objectKeys(this.shape))
1811
+ e[r] || (t[r] = this.shape[r]);
1812
+ return new x({
1813
+ ...this._def,
1814
+ shape: () => t
1815
+ });
1816
+ }
1817
+ /**
1818
+ * @deprecated
1819
+ */
1820
+ deepPartial() {
1821
+ return E(this);
1822
+ }
1823
+ partial(e) {
1824
+ const t = {};
1825
+ for (const r of y.objectKeys(this.shape)) {
1826
+ const a = this.shape[r];
1827
+ e && !e[r] ? t[r] = a : t[r] = a.optional();
1828
+ }
1829
+ return new x({
1830
+ ...this._def,
1831
+ shape: () => t
1832
+ });
1833
+ }
1834
+ required(e) {
1835
+ const t = {};
1836
+ for (const r of y.objectKeys(this.shape))
1837
+ if (e && !e[r])
1838
+ t[r] = this.shape[r];
1839
+ else {
1840
+ let n = this.shape[r];
1841
+ for (; n instanceof S; )
1842
+ n = n._def.innerType;
1843
+ t[r] = n;
1844
+ }
1845
+ return new x({
1846
+ ...this._def,
1847
+ shape: () => t
1848
+ });
1849
+ }
1850
+ keyof() {
1851
+ return ge(y.objectKeys(this.shape));
1852
+ }
1853
+ }
1854
+ x.create = (s, e) => new x({
1855
+ shape: () => s,
1856
+ unknownKeys: "strip",
1857
+ catchall: A.create(),
1858
+ typeName: p.ZodObject,
1859
+ ..._(e)
1860
+ });
1861
+ x.strictCreate = (s, e) => new x({
1862
+ shape: () => s,
1863
+ unknownKeys: "strict",
1864
+ catchall: A.create(),
1865
+ typeName: p.ZodObject,
1866
+ ..._(e)
1867
+ });
1868
+ x.lazycreate = (s, e) => new x({
1869
+ shape: s,
1870
+ unknownKeys: "strip",
1871
+ catchall: A.create(),
1872
+ typeName: p.ZodObject,
1873
+ ..._(e)
1874
+ });
1875
+ class F extends g {
1876
+ _parse(e) {
1877
+ const { ctx: t } = this._processInputParams(e), r = this._def.options;
1878
+ function a(n) {
1879
+ for (const o of n)
1880
+ if (o.result.status === "valid")
1881
+ return o.result;
1882
+ for (const o of n)
1883
+ if (o.result.status === "dirty")
1884
+ return t.common.issues.push(...o.ctx.common.issues), o.result;
1885
+ const i = n.map((o) => new T(o.ctx.common.issues));
1886
+ return c(t, {
1887
+ code: d.invalid_union,
1888
+ unionErrors: i
1889
+ }), m;
1890
+ }
1891
+ if (t.common.async)
1892
+ return Promise.all(r.map(async (n) => {
1893
+ const i = {
1894
+ ...t,
1895
+ common: {
1896
+ ...t.common,
1897
+ issues: []
1898
+ },
1899
+ parent: null
1900
+ };
1901
+ return {
1902
+ result: await n._parseAsync({
1903
+ data: t.data,
1904
+ path: t.path,
1905
+ parent: i
1906
+ }),
1907
+ ctx: i
1908
+ };
1909
+ })).then(a);
1910
+ {
1911
+ let n;
1912
+ const i = [];
1913
+ for (const h of r) {
1914
+ const f = {
1915
+ ...t,
1916
+ common: {
1917
+ ...t.common,
1918
+ issues: []
1919
+ },
1920
+ parent: null
1921
+ }, v = h._parseSync({
1922
+ data: t.data,
1923
+ path: t.path,
1924
+ parent: f
1925
+ });
1926
+ if (v.status === "valid")
1927
+ return v;
1928
+ v.status === "dirty" && !n && (n = { result: v, ctx: f }), f.common.issues.length && i.push(f.common.issues);
1929
+ }
1930
+ if (n)
1931
+ return t.common.issues.push(...n.ctx.common.issues), n.result;
1932
+ const o = i.map((h) => new T(h));
1933
+ return c(t, {
1934
+ code: d.invalid_union,
1935
+ unionErrors: o
1936
+ }), m;
1937
+ }
1938
+ }
1939
+ get options() {
1940
+ return this._def.options;
1941
+ }
1942
+ }
1943
+ F.create = (s, e) => new F({
1944
+ options: s,
1945
+ typeName: p.ZodUnion,
1946
+ ..._(e)
1947
+ });
1948
+ function G(s, e) {
1949
+ const t = O(s), r = O(e);
1950
+ if (s === e)
1951
+ return { valid: !0, data: s };
1952
+ if (t === u.object && r === u.object) {
1953
+ const a = y.objectKeys(e), n = y.objectKeys(s).filter((o) => a.indexOf(o) !== -1), i = { ...s, ...e };
1954
+ for (const o of n) {
1955
+ const h = G(s[o], e[o]);
1956
+ if (!h.valid)
1957
+ return { valid: !1 };
1958
+ i[o] = h.data;
1959
+ }
1960
+ return { valid: !0, data: i };
1961
+ } else if (t === u.array && r === u.array) {
1962
+ if (s.length !== e.length)
1963
+ return { valid: !1 };
1964
+ const a = [];
1965
+ for (let n = 0; n < s.length; n++) {
1966
+ const i = s[n], o = e[n], h = G(i, o);
1967
+ if (!h.valid)
1968
+ return { valid: !1 };
1969
+ a.push(h.data);
1970
+ }
1971
+ return { valid: !0, data: a };
1972
+ } else return t === u.date && r === u.date && +s == +e ? { valid: !0, data: s } : { valid: !1 };
1973
+ }
1974
+ class W extends g {
1975
+ _parse(e) {
1976
+ const { status: t, ctx: r } = this._processInputParams(e), a = (n, i) => {
1977
+ if (se(n) || se(i))
1978
+ return m;
1979
+ const o = G(n.value, i.value);
1980
+ return o.valid ? ((re(n) || re(i)) && t.dirty(), { status: t.value, value: o.data }) : (c(r, {
1981
+ code: d.invalid_intersection_types
1982
+ }), m);
1983
+ };
1984
+ return r.common.async ? Promise.all([
1985
+ this._def.left._parseAsync({
1986
+ data: r.data,
1987
+ path: r.path,
1988
+ parent: r
1989
+ }),
1990
+ this._def.right._parseAsync({
1991
+ data: r.data,
1992
+ path: r.path,
1993
+ parent: r
1994
+ })
1995
+ ]).then(([n, i]) => a(n, i)) : a(this._def.left._parseSync({
1996
+ data: r.data,
1997
+ path: r.path,
1998
+ parent: r
1999
+ }), this._def.right._parseSync({
2000
+ data: r.data,
2001
+ path: r.path,
2002
+ parent: r
2003
+ }));
2004
+ }
2005
+ }
2006
+ W.create = (s, e, t) => new W({
2007
+ left: s,
2008
+ right: e,
2009
+ typeName: p.ZodIntersection,
2010
+ ..._(t)
2011
+ });
2012
+ class I extends g {
2013
+ _parse(e) {
2014
+ const { status: t, ctx: r } = this._processInputParams(e);
2015
+ if (r.parsedType !== u.array)
2016
+ return c(r, {
2017
+ code: d.invalid_type,
2018
+ expected: u.array,
2019
+ received: r.parsedType
2020
+ }), m;
2021
+ if (r.data.length < this._def.items.length)
2022
+ return c(r, {
2023
+ code: d.too_small,
2024
+ minimum: this._def.items.length,
2025
+ inclusive: !0,
2026
+ exact: !1,
2027
+ type: "array"
2028
+ }), m;
2029
+ !this._def.rest && r.data.length > this._def.items.length && (c(r, {
2030
+ code: d.too_big,
2031
+ maximum: this._def.items.length,
2032
+ inclusive: !0,
2033
+ exact: !1,
2034
+ type: "array"
2035
+ }), t.dirty());
2036
+ const n = [...r.data].map((i, o) => {
2037
+ const h = this._def.items[o] || this._def.rest;
2038
+ return h ? h._parse(new N(r, i, r.path, o)) : null;
2039
+ }).filter((i) => !!i);
2040
+ return r.common.async ? Promise.all(n).then((i) => k.mergeArray(t, i)) : k.mergeArray(t, n);
2041
+ }
2042
+ get items() {
2043
+ return this._def.items;
2044
+ }
2045
+ rest(e) {
2046
+ return new I({
2047
+ ...this._def,
2048
+ rest: e
2049
+ });
2050
+ }
2051
+ }
2052
+ I.create = (s, e) => {
2053
+ if (!Array.isArray(s))
2054
+ throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2055
+ return new I({
2056
+ items: s,
2057
+ typeName: p.ZodTuple,
2058
+ rest: null,
2059
+ ..._(e)
2060
+ });
2061
+ };
2062
+ class ue extends g {
2063
+ get keySchema() {
2064
+ return this._def.keyType;
2065
+ }
2066
+ get valueSchema() {
2067
+ return this._def.valueType;
2068
+ }
2069
+ _parse(e) {
2070
+ const { status: t, ctx: r } = this._processInputParams(e);
2071
+ if (r.parsedType !== u.map)
2072
+ return c(r, {
2073
+ code: d.invalid_type,
2074
+ expected: u.map,
2075
+ received: r.parsedType
2076
+ }), m;
2077
+ const a = this._def.keyType, n = this._def.valueType, i = [...r.data.entries()].map(([o, h], f) => ({
2078
+ key: a._parse(new N(r, o, r.path, [f, "key"])),
2079
+ value: n._parse(new N(r, h, r.path, [f, "value"]))
2080
+ }));
2081
+ if (r.common.async) {
2082
+ const o = /* @__PURE__ */ new Map();
2083
+ return Promise.resolve().then(async () => {
2084
+ for (const h of i) {
2085
+ const f = await h.key, v = await h.value;
2086
+ if (f.status === "aborted" || v.status === "aborted")
2087
+ return m;
2088
+ (f.status === "dirty" || v.status === "dirty") && t.dirty(), o.set(f.value, v.value);
2089
+ }
2090
+ return { status: t.value, value: o };
2091
+ });
2092
+ } else {
2093
+ const o = /* @__PURE__ */ new Map();
2094
+ for (const h of i) {
2095
+ const f = h.key, v = h.value;
2096
+ if (f.status === "aborted" || v.status === "aborted")
2097
+ return m;
2098
+ (f.status === "dirty" || v.status === "dirty") && t.dirty(), o.set(f.value, v.value);
2099
+ }
2100
+ return { status: t.value, value: o };
2101
+ }
2102
+ }
2103
+ }
2104
+ ue.create = (s, e, t) => new ue({
2105
+ valueType: e,
2106
+ keyType: s,
2107
+ typeName: p.ZodMap,
2108
+ ..._(t)
2109
+ });
2110
+ class D extends g {
2111
+ _parse(e) {
2112
+ const { status: t, ctx: r } = this._processInputParams(e);
2113
+ if (r.parsedType !== u.set)
2114
+ return c(r, {
2115
+ code: d.invalid_type,
2116
+ expected: u.set,
2117
+ received: r.parsedType
2118
+ }), m;
2119
+ const a = this._def;
2120
+ a.minSize !== null && r.data.size < a.minSize.value && (c(r, {
2121
+ code: d.too_small,
2122
+ minimum: a.minSize.value,
2123
+ type: "set",
2124
+ inclusive: !0,
2125
+ exact: !1,
2126
+ message: a.minSize.message
2127
+ }), t.dirty()), a.maxSize !== null && r.data.size > a.maxSize.value && (c(r, {
2128
+ code: d.too_big,
2129
+ maximum: a.maxSize.value,
2130
+ type: "set",
2131
+ inclusive: !0,
2132
+ exact: !1,
2133
+ message: a.maxSize.message
2134
+ }), t.dirty());
2135
+ const n = this._def.valueType;
2136
+ function i(h) {
2137
+ const f = /* @__PURE__ */ new Set();
2138
+ for (const v of h) {
2139
+ if (v.status === "aborted")
2140
+ return m;
2141
+ v.status === "dirty" && t.dirty(), f.add(v.value);
2142
+ }
2143
+ return { status: t.value, value: f };
2144
+ }
2145
+ const o = [...r.data.values()].map((h, f) => n._parse(new N(r, h, r.path, f)));
2146
+ return r.common.async ? Promise.all(o).then((h) => i(h)) : i(o);
2147
+ }
2148
+ min(e, t) {
2149
+ return new D({
2150
+ ...this._def,
2151
+ minSize: { value: e, message: l.toString(t) }
2152
+ });
2153
+ }
2154
+ max(e, t) {
2155
+ return new D({
2156
+ ...this._def,
2157
+ maxSize: { value: e, message: l.toString(t) }
2158
+ });
2159
+ }
2160
+ size(e, t) {
2161
+ return this.min(e, t).max(e, t);
2162
+ }
2163
+ nonempty(e) {
2164
+ return this.min(1, e);
2165
+ }
2166
+ }
2167
+ D.create = (s, e) => new D({
2168
+ valueType: s,
2169
+ minSize: null,
2170
+ maxSize: null,
2171
+ typeName: p.ZodSet,
2172
+ ..._(e)
2173
+ });
2174
+ class le extends g {
2175
+ get schema() {
2176
+ return this._def.getter();
2177
+ }
2178
+ _parse(e) {
2179
+ const { ctx: t } = this._processInputParams(e);
2180
+ return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
2181
+ }
2182
+ }
2183
+ le.create = (s, e) => new le({
2184
+ getter: s,
2185
+ typeName: p.ZodLazy,
2186
+ ..._(e)
2187
+ });
2188
+ class he extends g {
2189
+ _parse(e) {
2190
+ if (e.data !== this._def.value) {
2191
+ const t = this._getOrReturnCtx(e);
2192
+ return c(t, {
2193
+ received: t.data,
2194
+ code: d.invalid_literal,
2195
+ expected: this._def.value
2196
+ }), m;
2197
+ }
2198
+ return { status: "valid", value: e.data };
2199
+ }
2200
+ get value() {
2201
+ return this._def.value;
2202
+ }
2203
+ }
2204
+ he.create = (s, e) => new he({
2205
+ value: s,
2206
+ typeName: p.ZodLiteral,
2207
+ ..._(e)
2208
+ });
2209
+ function ge(s, e) {
2210
+ return new M({
2211
+ values: s,
2212
+ typeName: p.ZodEnum,
2213
+ ..._(e)
2214
+ });
2215
+ }
2216
+ class M extends g {
2217
+ _parse(e) {
2218
+ if (typeof e.data != "string") {
2219
+ const t = this._getOrReturnCtx(e), r = this._def.values;
2220
+ return c(t, {
2221
+ expected: y.joinValues(r),
2222
+ received: t.parsedType,
2223
+ code: d.invalid_type
2224
+ }), m;
2225
+ }
2226
+ if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
2227
+ const t = this._getOrReturnCtx(e), r = this._def.values;
2228
+ return c(t, {
2229
+ received: t.data,
2230
+ code: d.invalid_enum_value,
2231
+ options: r
2232
+ }), m;
2233
+ }
2234
+ return b(e.data);
2235
+ }
2236
+ get options() {
2237
+ return this._def.values;
2238
+ }
2239
+ get enum() {
2240
+ const e = {};
2241
+ for (const t of this._def.values)
2242
+ e[t] = t;
2243
+ return e;
2244
+ }
2245
+ get Values() {
2246
+ const e = {};
2247
+ for (const t of this._def.values)
2248
+ e[t] = t;
2249
+ return e;
2250
+ }
2251
+ get Enum() {
2252
+ const e = {};
2253
+ for (const t of this._def.values)
2254
+ e[t] = t;
2255
+ return e;
2256
+ }
2257
+ extract(e, t = this._def) {
2258
+ return M.create(e, {
2259
+ ...this._def,
2260
+ ...t
2261
+ });
2262
+ }
2263
+ exclude(e, t = this._def) {
2264
+ return M.create(this.options.filter((r) => !e.includes(r)), {
2265
+ ...this._def,
2266
+ ...t
2267
+ });
2268
+ }
2269
+ }
2270
+ M.create = ge;
2271
+ class fe extends g {
2272
+ _parse(e) {
2273
+ const t = y.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(e);
2274
+ if (r.parsedType !== u.string && r.parsedType !== u.number) {
2275
+ const a = y.objectValues(t);
2276
+ return c(r, {
2277
+ expected: y.joinValues(a),
2278
+ received: r.parsedType,
2279
+ code: d.invalid_type
2280
+ }), m;
2281
+ }
2282
+ if (this._cache || (this._cache = new Set(y.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
2283
+ const a = y.objectValues(t);
2284
+ return c(r, {
2285
+ received: r.data,
2286
+ code: d.invalid_enum_value,
2287
+ options: a
2288
+ }), m;
2289
+ }
2290
+ return b(e.data);
2291
+ }
2292
+ get enum() {
2293
+ return this._def.values;
2294
+ }
2295
+ }
2296
+ fe.create = (s, e) => new fe({
2297
+ values: s,
2298
+ typeName: p.ZodNativeEnum,
2299
+ ..._(e)
2300
+ });
2301
+ class q extends g {
2302
+ unwrap() {
2303
+ return this._def.type;
2304
+ }
2305
+ _parse(e) {
2306
+ const { ctx: t } = this._processInputParams(e);
2307
+ if (t.parsedType !== u.promise && t.common.async === !1)
2308
+ return c(t, {
2309
+ code: d.invalid_type,
2310
+ expected: u.promise,
2311
+ received: t.parsedType
2312
+ }), m;
2313
+ const r = t.parsedType === u.promise ? t.data : Promise.resolve(t.data);
2314
+ return b(r.then((a) => this._def.type.parseAsync(a, {
2315
+ path: t.path,
2316
+ errorMap: t.common.contextualErrorMap
2317
+ })));
2318
+ }
2319
+ }
2320
+ q.create = (s, e) => new q({
2321
+ type: s,
2322
+ typeName: p.ZodPromise,
2323
+ ..._(e)
2324
+ });
2325
+ class j extends g {
2326
+ innerType() {
2327
+ return this._def.schema;
2328
+ }
2329
+ sourceType() {
2330
+ return this._def.schema._def.typeName === p.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2331
+ }
2332
+ _parse(e) {
2333
+ const { status: t, ctx: r } = this._processInputParams(e), a = this._def.effect || null, n = {
2334
+ addIssue: (i) => {
2335
+ c(r, i), i.fatal ? t.abort() : t.dirty();
2336
+ },
2337
+ get path() {
2338
+ return r.path;
2339
+ }
2340
+ };
2341
+ if (n.addIssue = n.addIssue.bind(n), a.type === "preprocess") {
2342
+ const i = a.transform(r.data, n);
2343
+ if (r.common.async)
2344
+ return Promise.resolve(i).then(async (o) => {
2345
+ if (t.value === "aborted")
2346
+ return m;
2347
+ const h = await this._def.schema._parseAsync({
2348
+ data: o,
2349
+ path: r.path,
2350
+ parent: r
2351
+ });
2352
+ return h.status === "aborted" ? m : h.status === "dirty" || t.value === "dirty" ? P(h.value) : h;
2353
+ });
2354
+ {
2355
+ if (t.value === "aborted")
2356
+ return m;
2357
+ const o = this._def.schema._parseSync({
2358
+ data: i,
2359
+ path: r.path,
2360
+ parent: r
2361
+ });
2362
+ return o.status === "aborted" ? m : o.status === "dirty" || t.value === "dirty" ? P(o.value) : o;
2363
+ }
2364
+ }
2365
+ if (a.type === "refinement") {
2366
+ const i = (o) => {
2367
+ const h = a.refinement(o, n);
2368
+ if (r.common.async)
2369
+ return Promise.resolve(h);
2370
+ if (h instanceof Promise)
2371
+ throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
2372
+ return o;
2373
+ };
2374
+ if (r.common.async === !1) {
2375
+ const o = this._def.schema._parseSync({
2376
+ data: r.data,
2377
+ path: r.path,
2378
+ parent: r
2379
+ });
2380
+ return o.status === "aborted" ? m : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
2381
+ } else
2382
+ return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((o) => o.status === "aborted" ? m : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
2383
+ }
2384
+ if (a.type === "transform")
2385
+ if (r.common.async === !1) {
2386
+ const i = this._def.schema._parseSync({
2387
+ data: r.data,
2388
+ path: r.path,
2389
+ parent: r
2390
+ });
2391
+ if (!$(i))
2392
+ return m;
2393
+ const o = a.transform(i.value, n);
2394
+ if (o instanceof Promise)
2395
+ throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2396
+ return { status: t.value, value: o };
2397
+ } else
2398
+ return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((i) => $(i) ? Promise.resolve(a.transform(i.value, n)).then((o) => ({
2399
+ status: t.value,
2400
+ value: o
2401
+ })) : m);
2402
+ y.assertNever(a);
2403
+ }
2404
+ }
2405
+ j.create = (s, e, t) => new j({
2406
+ schema: s,
2407
+ typeName: p.ZodEffects,
2408
+ effect: e,
2409
+ ..._(t)
2410
+ });
2411
+ j.createWithPreprocess = (s, e, t) => new j({
2412
+ schema: e,
2413
+ effect: { type: "preprocess", transform: s },
2414
+ typeName: p.ZodEffects,
2415
+ ..._(t)
2416
+ });
2417
+ class S extends g {
2418
+ _parse(e) {
2419
+ return this._getType(e) === u.undefined ? b(void 0) : this._def.innerType._parse(e);
2420
+ }
2421
+ unwrap() {
2422
+ return this._def.innerType;
2423
+ }
2424
+ }
2425
+ S.create = (s, e) => new S({
2426
+ innerType: s,
2427
+ typeName: p.ZodOptional,
2428
+ ..._(e)
2429
+ });
2430
+ class L extends g {
2431
+ _parse(e) {
2432
+ return this._getType(e) === u.null ? b(null) : this._def.innerType._parse(e);
2433
+ }
2434
+ unwrap() {
2435
+ return this._def.innerType;
2436
+ }
2437
+ }
2438
+ L.create = (s, e) => new L({
2439
+ innerType: s,
2440
+ typeName: p.ZodNullable,
2441
+ ..._(e)
2442
+ });
2443
+ class Q extends g {
2444
+ _parse(e) {
2445
+ const { ctx: t } = this._processInputParams(e);
2446
+ let r = t.data;
2447
+ return t.parsedType === u.undefined && (r = this._def.defaultValue()), this._def.innerType._parse({
2448
+ data: r,
2449
+ path: t.path,
2450
+ parent: t
2451
+ });
2452
+ }
2453
+ removeDefault() {
2454
+ return this._def.innerType;
2455
+ }
2456
+ }
2457
+ Q.create = (s, e) => new Q({
2458
+ innerType: s,
2459
+ typeName: p.ZodDefault,
2460
+ defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2461
+ ..._(e)
2462
+ });
2463
+ class X extends g {
2464
+ _parse(e) {
2465
+ const { ctx: t } = this._processInputParams(e), r = {
2466
+ ...t,
2467
+ common: {
2468
+ ...t.common,
2469
+ issues: []
2470
+ }
2471
+ }, a = this._def.innerType._parse({
2472
+ data: r.data,
2473
+ path: r.path,
2474
+ parent: {
2475
+ ...r
2476
+ }
2477
+ });
2478
+ return U(a) ? a.then((n) => ({
2479
+ status: "valid",
2480
+ value: n.status === "valid" ? n.value : this._def.catchValue({
2481
+ get error() {
2482
+ return new T(r.common.issues);
2483
+ },
2484
+ input: r.data
2485
+ })
2486
+ })) : {
2487
+ status: "valid",
2488
+ value: a.status === "valid" ? a.value : this._def.catchValue({
2489
+ get error() {
2490
+ return new T(r.common.issues);
2491
+ },
2492
+ input: r.data
2493
+ })
2494
+ };
2495
+ }
2496
+ removeCatch() {
2497
+ return this._def.innerType;
2498
+ }
2499
+ }
2500
+ X.create = (s, e) => new X({
2501
+ innerType: s,
2502
+ typeName: p.ZodCatch,
2503
+ catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2504
+ ..._(e)
2505
+ });
2506
+ class me extends g {
2507
+ _parse(e) {
2508
+ if (this._getType(e) !== u.nan) {
2509
+ const r = this._getOrReturnCtx(e);
2510
+ return c(r, {
2511
+ code: d.invalid_type,
2512
+ expected: u.nan,
2513
+ received: r.parsedType
2514
+ }), m;
2515
+ }
2516
+ return { status: "valid", value: e.data };
2517
+ }
2518
+ }
2519
+ me.create = (s) => new me({
2520
+ typeName: p.ZodNaN,
2521
+ ..._(s)
2522
+ });
2523
+ class Fe extends g {
2524
+ _parse(e) {
2525
+ const { ctx: t } = this._processInputParams(e), r = t.data;
2526
+ return this._def.type._parse({
2527
+ data: r,
2528
+ path: t.path,
2529
+ parent: t
2530
+ });
2531
+ }
2532
+ unwrap() {
2533
+ return this._def.type;
2534
+ }
2535
+ }
2536
+ class ee extends g {
2537
+ _parse(e) {
2538
+ const { status: t, ctx: r } = this._processInputParams(e);
2539
+ if (r.common.async)
2540
+ return (async () => {
2541
+ const n = await this._def.in._parseAsync({
2542
+ data: r.data,
2543
+ path: r.path,
2544
+ parent: r
2545
+ });
2546
+ return n.status === "aborted" ? m : n.status === "dirty" ? (t.dirty(), P(n.value)) : this._def.out._parseAsync({
2547
+ data: n.value,
2548
+ path: r.path,
2549
+ parent: r
2550
+ });
2551
+ })();
2552
+ {
2553
+ const a = this._def.in._parseSync({
2554
+ data: r.data,
2555
+ path: r.path,
2556
+ parent: r
2557
+ });
2558
+ return a.status === "aborted" ? m : a.status === "dirty" ? (t.dirty(), {
2559
+ status: "dirty",
2560
+ value: a.value
2561
+ }) : this._def.out._parseSync({
2562
+ data: a.value,
2563
+ path: r.path,
2564
+ parent: r
2565
+ });
2566
+ }
2567
+ }
2568
+ static create(e, t) {
2569
+ return new ee({
2570
+ in: e,
2571
+ out: t,
2572
+ typeName: p.ZodPipeline
2573
+ });
2574
+ }
2575
+ }
2576
+ class K extends g {
2577
+ _parse(e) {
2578
+ const t = this._def.innerType._parse(e), r = (a) => ($(a) && (a.value = Object.freeze(a.value)), a);
2579
+ return U(t) ? t.then((a) => r(a)) : r(t);
2580
+ }
2581
+ unwrap() {
2582
+ return this._def.innerType;
2583
+ }
2584
+ }
2585
+ K.create = (s, e) => new K({
2586
+ innerType: s,
2587
+ typeName: p.ZodReadonly,
2588
+ ..._(e)
2589
+ });
2590
+ var p;
2591
+ (function(s) {
2592
+ s.ZodString = "ZodString", s.ZodNumber = "ZodNumber", s.ZodNaN = "ZodNaN", s.ZodBigInt = "ZodBigInt", s.ZodBoolean = "ZodBoolean", s.ZodDate = "ZodDate", s.ZodSymbol = "ZodSymbol", s.ZodUndefined = "ZodUndefined", s.ZodNull = "ZodNull", s.ZodAny = "ZodAny", s.ZodUnknown = "ZodUnknown", s.ZodNever = "ZodNever", s.ZodVoid = "ZodVoid", s.ZodArray = "ZodArray", s.ZodObject = "ZodObject", s.ZodUnion = "ZodUnion", s.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", s.ZodIntersection = "ZodIntersection", s.ZodTuple = "ZodTuple", s.ZodRecord = "ZodRecord", s.ZodMap = "ZodMap", s.ZodSet = "ZodSet", s.ZodFunction = "ZodFunction", s.ZodLazy = "ZodLazy", s.ZodLiteral = "ZodLiteral", s.ZodEnum = "ZodEnum", s.ZodEffects = "ZodEffects", s.ZodNativeEnum = "ZodNativeEnum", s.ZodOptional = "ZodOptional", s.ZodNullable = "ZodNullable", s.ZodDefault = "ZodDefault", s.ZodCatch = "ZodCatch", s.ZodPromise = "ZodPromise", s.ZodBranded = "ZodBranded", s.ZodPipeline = "ZodPipeline", s.ZodReadonly = "ZodReadonly";
2593
+ })(p || (p = {}));
2594
+ const We = C.create;
2595
+ Z.create;
2596
+ R.create;
2597
+ const qe = B.create, Je = V.create, Ye = H.create;
2598
+ A.create;
2599
+ const He = w.create, Ge = x.create;
2600
+ F.create;
2601
+ W.create;
2602
+ I.create;
2603
+ const Qe = M.create;
2604
+ q.create;
2605
+ S.create;
2606
+ L.create;
2607
+ const Xe = j.createWithPreprocess, Ke = {
2608
+ string: ((s) => C.create({ ...s, coerce: !0 })),
2609
+ number: ((s) => Z.create({ ...s, coerce: !0 })),
2610
+ boolean: ((s) => B.create({
2611
+ ...s,
2612
+ coerce: !0
2613
+ })),
2614
+ bigint: ((s) => R.create({ ...s, coerce: !0 })),
2615
+ date: ((s) => V.create({ ...s, coerce: !0 }))
2616
+ };
2617
+ export {
2618
+ x as Z,
2619
+ He as a,
2620
+ qe as b,
2621
+ Ke as c,
2622
+ Je as d,
2623
+ Q as e,
2624
+ p as f,
2625
+ Ye as g,
2626
+ Qe as h,
2627
+ Ge as o,
2628
+ Xe as p,
2629
+ We as s
2630
+ };