denwa-web-shared 1.0.8 → 1.0.10

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 (33) hide show
  1. package/dist/client/hooks/index.d.ts +3 -0
  2. package/dist/client/hooks/use-disable-scroll.d.ts +1 -0
  3. package/dist/client/hooks/use-is-client.d.ts +1 -0
  4. package/dist/{client.d.ts → client/hooks/use-view-port.d.ts} +24 -48
  5. package/dist/client/index.d.ts +2 -0
  6. package/dist/client/ui/index.d.ts +1 -0
  7. package/dist/client/ui/infinity-list.d.ts +10 -0
  8. package/dist/denwa-web-shared.cjs.js +6830 -1
  9. package/dist/denwa-web-shared.es.js +6828 -30
  10. package/dist/index.d.ts +2 -0
  11. package/dist/server/constants/index.d.ts +39 -0
  12. package/dist/server/index.d.ts +5 -0
  13. package/dist/server/lib/css.d.ts +2 -0
  14. package/dist/server/lib/images.d.ts +46 -0
  15. package/dist/server/lib/index.d.ts +3 -0
  16. package/dist/server/lib/utils.d.ts +116 -0
  17. package/dist/server/schemas/index.d.ts +13 -0
  18. package/dist/server/types/index.d.ts +42 -0
  19. package/dist/server/ui/image.d.ts +20 -0
  20. package/dist/server/ui/index.d.ts +1 -0
  21. package/package.json +12 -10
  22. package/dist/client/denwa-web-shared.client.cjs.js +0 -1
  23. package/dist/client/denwa-web-shared.client.es.js +0 -12
  24. package/dist/image-CRxiqKd9.cjs +0 -18
  25. package/dist/image-CeUbwO13.js +0 -2575
  26. package/dist/infinity-list-BqhNmBDM.cjs +0 -1
  27. package/dist/infinity-list-ChtJSexP.js +0 -118
  28. package/dist/jsx-runtime-BgsXhnJy.js +0 -3065
  29. package/dist/jsx-runtime-Cgef3_fl.cjs +0 -22
  30. package/dist/main.d.ts +0 -349
  31. package/dist/server/denwa-web-shared.server.cjs.js +0 -1
  32. package/dist/server/denwa-web-shared.server.es.js +0 -22
  33. package/dist/server.d.ts +0 -304
@@ -1,2575 +0,0 @@
1
- import { j as A, c as ln } from "./jsx-runtime-BgsXhnJy.js";
2
- const yi = (e) => new Intl.NumberFormat(e), fn = (e, n) => e[n], Ii = (e) => {
3
- let n = e;
4
- if (n !== "+" && Number.isNaN(Number(n)) || n.length > 12)
5
- return "";
6
- const t = n.split(""), r = t[0], o = t[1];
7
- return r === "7" || r === "8" ? t[0] = "+7" : `${r}${o}` == "+8" ? t[1] = "7" : r && r !== "+" && (t[0] = `+${r}`), n = t.join("").trim(), n;
8
- }, Ei = (e, n) => {
9
- if (!e) return n.main;
10
- const t = e.split(".")[0], r = n[t];
11
- return r || n.main;
12
- }, S = ({
13
- text: e,
14
- subdomain: n,
15
- SUBDOMAIN_NAME: t,
16
- SUBDOMAIN_MASK: r
17
- }) => {
18
- const o = fn(t, n);
19
- if (!n) return e;
20
- let i = e;
21
- const { name: c, declination: u, region: a, regionDeclination: l } = o, d = new RegExp(r.CITY, "g"), p = new RegExp(r.CITY_DECL, "g"), m = new RegExp(r.CITY_REGION, "g"), h = new RegExp(r.CITY_REGION_DECL, "g");
22
- return i = i.replace(d, c), i = i.replace(p, u), i = i.replace(m, a), i = i.replace(h, l), i;
23
- }, Pi = ({
24
- subdomain: e,
25
- metaData: n,
26
- host: t,
27
- SUBDOMAIN_NAME: r,
28
- SUBDOMAIN_MASK: o,
29
- DEFAULT_SEO_TEXT: i
30
- }) => {
31
- const { title: c, description: u, keywords: a, canonical: l } = n, d = e === "main" ? t : `${e}.${t}`;
32
- let p = c, m = u, h = a;
33
- const z = {};
34
- return c ? p = S({ text: c, subdomain: e, SUBDOMAIN_MASK: o, SUBDOMAIN_NAME: r }) : p = S({
35
- text: i.title,
36
- subdomain: e,
37
- SUBDOMAIN_MASK: o,
38
- SUBDOMAIN_NAME: r
39
- }), u ? m = S({
40
- text: u,
41
- subdomain: e,
42
- SUBDOMAIN_MASK: o,
43
- SUBDOMAIN_NAME: r
44
- }) : m = S({
45
- text: i.description,
46
- subdomain: e,
47
- SUBDOMAIN_MASK: o,
48
- SUBDOMAIN_NAME: r
49
- }), a ? h = S({
50
- text: a,
51
- subdomain: e,
52
- SUBDOMAIN_MASK: o,
53
- SUBDOMAIN_NAME: r
54
- }) : h = S({
55
- text: i.keywords,
56
- subdomain: e,
57
- SUBDOMAIN_MASK: o,
58
- SUBDOMAIN_NAME: r
59
- }), l !== void 0 && (z.canonical = `https://${d}${l}`), {
60
- title: p,
61
- description: m,
62
- keywords: h,
63
- alternates: Object.keys(z).length ? z : void 0
64
- };
65
- }, xi = (e) => {
66
- const r = decodeURI(e).replace(/^\/[^\/]*\//, "").split("--"), o = {};
67
- return r.forEach((i) => {
68
- const [c, u] = i.split("__");
69
- c && u && (o[c] = u.replace(/_/g, " "));
70
- }), o;
71
- }, Ti = ({
72
- color1: e,
73
- color2: n,
74
- notFoundText: t,
75
- COLORS_NAMES: r
76
- }) => {
77
- const o = r[e], i = n ? r[n] : null;
78
- return o && i ? `${o}/${i}` : o || t;
79
- }, ji = (e, n, t) => {
80
- if (!e) return { buttons: [] };
81
- const { page: r, pages: o } = e;
82
- if (!r || !o)
83
- return { buttons: [] };
84
- const i = new URLSearchParams(t), c = [], u = 8, a = Math.floor(u / 2);
85
- let l = Math.max(1, r - a), d = Math.min(o, r + a);
86
- d - l + 1 < u && (l = Math.max(1, d - u + 1), d = Math.min(o, l + u - 1));
87
- for (let $ = l; $ <= d; $++) {
88
- const j = new URLSearchParams(i);
89
- j.set("page", $.toString()), c.push({
90
- label: $.toString(),
91
- href: `${n}?${j.toString()}`,
92
- isActive: $ === r
93
- });
94
- }
95
- const m = c.some(($) => $.label === "1") ? void 0 : {
96
- label: "1",
97
- href: `${n}?${new URLSearchParams({ ...Object.fromEntries(i), page: "1" }).toString()}`,
98
- isActive: r === 1
99
- }, z = c.some(($) => $.label === o.toString()) ? void 0 : {
100
- label: o.toString(),
101
- href: `${n}?${new URLSearchParams({ ...Object.fromEntries(i), page: o.toString() }).toString()}`,
102
- isActive: r === o
103
- };
104
- return {
105
- buttons: c,
106
- firstPage: m,
107
- lastPage: z
108
- };
109
- };
110
- function s(e, n, t) {
111
- function r(u, a) {
112
- var l;
113
- Object.defineProperty(u, "_zod", {
114
- value: u._zod ?? {},
115
- enumerable: !1
116
- }), (l = u._zod).traits ?? (l.traits = /* @__PURE__ */ new Set()), u._zod.traits.add(e), n(u, a);
117
- for (const d in c.prototype)
118
- d in u || Object.defineProperty(u, d, { value: c.prototype[d].bind(u) });
119
- u._zod.constr = c, u._zod.def = a;
120
- }
121
- const o = (t == null ? void 0 : t.Parent) ?? Object;
122
- class i extends o {
123
- }
124
- Object.defineProperty(i, "name", { value: e });
125
- function c(u) {
126
- var a;
127
- const l = t != null && t.Parent ? new i() : this;
128
- r(l, u), (a = l._zod).deferred ?? (a.deferred = []);
129
- for (const d of l._zod.deferred)
130
- d();
131
- return l;
132
- }
133
- return Object.defineProperty(c, "init", { value: r }), Object.defineProperty(c, Symbol.hasInstance, {
134
- value: (u) => {
135
- var a, l;
136
- return t != null && t.Parent && u instanceof t.Parent ? !0 : (l = (a = u == null ? void 0 : u._zod) == null ? void 0 : a.traits) == null ? void 0 : l.has(e);
137
- }
138
- }), Object.defineProperty(c, "name", { value: e }), c;
139
- }
140
- class D extends Error {
141
- constructor() {
142
- super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
143
- }
144
- }
145
- class Fe extends Error {
146
- constructor(n) {
147
- super(`Encountered unidirectional transform during encode: ${n}`), this.name = "ZodEncodeError";
148
- }
149
- }
150
- const Ue = {};
151
- function R(e) {
152
- return Ue;
153
- }
154
- function dn(e) {
155
- const n = Object.values(e).filter((r) => typeof r == "number");
156
- return Object.entries(e).filter(([r, o]) => n.indexOf(+r) === -1).map(([r, o]) => o);
157
- }
158
- function ie(e, n) {
159
- return typeof n == "bigint" ? n.toString() : n;
160
- }
161
- function ae(e) {
162
- return {
163
- get value() {
164
- {
165
- const n = e();
166
- return Object.defineProperty(this, "value", { value: n }), n;
167
- }
168
- }
169
- };
170
- }
171
- function le(e) {
172
- return e == null;
173
- }
174
- function fe(e) {
175
- const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
176
- return e.slice(n, t);
177
- }
178
- function hn(e, n) {
179
- const t = (e.toString().split(".")[1] || "").length, r = n.toString();
180
- let o = (r.split(".")[1] || "").length;
181
- if (o === 0 && /\d?e-\d?/.test(r)) {
182
- const a = r.match(/\d?e-(\d?)/);
183
- a != null && a[1] && (o = Number.parseInt(a[1]));
184
- }
185
- const i = t > o ? t : o, c = Number.parseInt(e.toFixed(i).replace(".", "")), u = Number.parseInt(n.toFixed(i).replace(".", ""));
186
- return c % u / 10 ** i;
187
- }
188
- const _e = Symbol("evaluating");
189
- function _(e, n, t) {
190
- let r;
191
- Object.defineProperty(e, n, {
192
- get() {
193
- if (r !== _e)
194
- return r === void 0 && (r = _e, r = t()), r;
195
- },
196
- set(o) {
197
- Object.defineProperty(e, n, {
198
- value: o
199
- // configurable: true,
200
- });
201
- },
202
- configurable: !0
203
- });
204
- }
205
- function pn(e) {
206
- return Object.create(Object.getPrototypeOf(e), Object.getOwnPropertyDescriptors(e));
207
- }
208
- function x(e, n, t) {
209
- Object.defineProperty(e, n, {
210
- value: t,
211
- writable: !0,
212
- enumerable: !0,
213
- configurable: !0
214
- });
215
- }
216
- function F(...e) {
217
- const n = {};
218
- for (const t of e) {
219
- const r = Object.getOwnPropertyDescriptors(t);
220
- Object.assign(n, r);
221
- }
222
- return Object.defineProperties({}, n);
223
- }
224
- function ge(e) {
225
- return JSON.stringify(e);
226
- }
227
- const Le = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
228
- };
229
- function K(e) {
230
- return typeof e == "object" && e !== null && !Array.isArray(e);
231
- }
232
- const mn = ae(() => {
233
- var e;
234
- if (typeof navigator < "u" && ((e = navigator == null ? void 0 : navigator.userAgent) != null && e.includes("Cloudflare")))
235
- return !1;
236
- try {
237
- const n = Function;
238
- return new n(""), !0;
239
- } catch {
240
- return !1;
241
- }
242
- });
243
- function U(e) {
244
- if (K(e) === !1)
245
- return !1;
246
- const n = e.constructor;
247
- if (n === void 0)
248
- return !0;
249
- const t = n.prototype;
250
- return !(K(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
251
- }
252
- function Ve(e) {
253
- return U(e) ? { ...e } : e;
254
- }
255
- const _n = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
256
- function q(e) {
257
- return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
258
- }
259
- function T(e, n, t) {
260
- const r = new e._zod.constr(n ?? e._zod.def);
261
- return (!n || t != null && t.parent) && (r._zod.parent = e), r;
262
- }
263
- function f(e) {
264
- const n = e;
265
- if (!n)
266
- return {};
267
- if (typeof n == "string")
268
- return { error: () => n };
269
- if ((n == null ? void 0 : n.message) !== void 0) {
270
- if ((n == null ? void 0 : n.error) !== void 0)
271
- throw new Error("Cannot specify both `message` and `error` params");
272
- n.error = n.message;
273
- }
274
- return delete n.message, typeof n.error == "string" ? { ...n, error: () => n.error } : n;
275
- }
276
- function gn(e) {
277
- return Object.keys(e).filter((n) => e[n]._zod.optin === "optional" && e[n]._zod.optout === "optional");
278
- }
279
- const vn = {
280
- safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
281
- int32: [-2147483648, 2147483647],
282
- uint32: [0, 4294967295],
283
- float32: [-34028234663852886e22, 34028234663852886e22],
284
- float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
285
- };
286
- function zn(e, n) {
287
- const t = e._zod.def, r = F(e._zod.def, {
288
- get shape() {
289
- const o = {};
290
- for (const i in n) {
291
- if (!(i in t.shape))
292
- throw new Error(`Unrecognized key: "${i}"`);
293
- n[i] && (o[i] = t.shape[i]);
294
- }
295
- return x(this, "shape", o), o;
296
- },
297
- checks: []
298
- });
299
- return T(e, r);
300
- }
301
- function bn(e, n) {
302
- const t = e._zod.def, r = F(e._zod.def, {
303
- get shape() {
304
- const o = { ...e._zod.def.shape };
305
- for (const i in n) {
306
- if (!(i in t.shape))
307
- throw new Error(`Unrecognized key: "${i}"`);
308
- n[i] && delete o[i];
309
- }
310
- return x(this, "shape", o), o;
311
- },
312
- checks: []
313
- });
314
- return T(e, r);
315
- }
316
- function wn(e, n) {
317
- if (!U(n))
318
- throw new Error("Invalid input to extend: expected a plain object");
319
- const t = e._zod.def.checks;
320
- if (t && t.length > 0)
321
- throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
322
- const o = F(e._zod.def, {
323
- get shape() {
324
- const i = { ...e._zod.def.shape, ...n };
325
- return x(this, "shape", i), i;
326
- },
327
- checks: []
328
- });
329
- return T(e, o);
330
- }
331
- function $n(e, n) {
332
- if (!U(n))
333
- throw new Error("Invalid input to safeExtend: expected a plain object");
334
- const t = {
335
- ...e._zod.def,
336
- get shape() {
337
- const r = { ...e._zod.def.shape, ...n };
338
- return x(this, "shape", r), r;
339
- },
340
- checks: e._zod.def.checks
341
- };
342
- return T(e, t);
343
- }
344
- function kn(e, n) {
345
- const t = F(e._zod.def, {
346
- get shape() {
347
- const r = { ...e._zod.def.shape, ...n._zod.def.shape };
348
- return x(this, "shape", r), r;
349
- },
350
- get catchall() {
351
- return n._zod.def.catchall;
352
- },
353
- checks: []
354
- // delete existing checks
355
- });
356
- return T(e, t);
357
- }
358
- function Zn(e, n, t) {
359
- const r = F(n._zod.def, {
360
- get shape() {
361
- const o = n._zod.def.shape, i = { ...o };
362
- if (t)
363
- for (const c in t) {
364
- if (!(c in o))
365
- throw new Error(`Unrecognized key: "${c}"`);
366
- t[c] && (i[c] = e ? new e({
367
- type: "optional",
368
- innerType: o[c]
369
- }) : o[c]);
370
- }
371
- else
372
- for (const c in o)
373
- i[c] = e ? new e({
374
- type: "optional",
375
- innerType: o[c]
376
- }) : o[c];
377
- return x(this, "shape", i), i;
378
- },
379
- checks: []
380
- });
381
- return T(n, r);
382
- }
383
- function yn(e, n, t) {
384
- const r = F(n._zod.def, {
385
- get shape() {
386
- const o = n._zod.def.shape, i = { ...o };
387
- if (t)
388
- for (const c in t) {
389
- if (!(c in i))
390
- throw new Error(`Unrecognized key: "${c}"`);
391
- t[c] && (i[c] = new e({
392
- type: "nonoptional",
393
- innerType: o[c]
394
- }));
395
- }
396
- else
397
- for (const c in o)
398
- i[c] = new e({
399
- type: "nonoptional",
400
- innerType: o[c]
401
- });
402
- return x(this, "shape", i), i;
403
- },
404
- checks: []
405
- });
406
- return T(n, r);
407
- }
408
- function N(e, n = 0) {
409
- var t;
410
- if (e.aborted === !0)
411
- return !0;
412
- for (let r = n; r < e.issues.length; r++)
413
- if (((t = e.issues[r]) == null ? void 0 : t.continue) !== !0)
414
- return !0;
415
- return !1;
416
- }
417
- function Ge(e, n) {
418
- return n.map((t) => {
419
- var r;
420
- return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
421
- });
422
- }
423
- function G(e) {
424
- return typeof e == "string" ? e : e == null ? void 0 : e.message;
425
- }
426
- function C(e, n, t) {
427
- var o, i, c, u, a, l;
428
- const r = { ...e, path: e.path ?? [] };
429
- if (!e.message) {
430
- const d = G((c = (i = (o = e.inst) == null ? void 0 : o._zod.def) == null ? void 0 : i.error) == null ? void 0 : c.call(i, e)) ?? G((u = n == null ? void 0 : n.error) == null ? void 0 : u.call(n, e)) ?? G((a = t.customError) == null ? void 0 : a.call(t, e)) ?? G((l = t.localeError) == null ? void 0 : l.call(t, e)) ?? "Invalid input";
431
- r.message = d;
432
- }
433
- return delete r.inst, delete r.continue, n != null && n.reportInput || delete r.input, r;
434
- }
435
- function de(e) {
436
- return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
437
- }
438
- function L(...e) {
439
- const [n, t, r] = e;
440
- return typeof n == "string" ? {
441
- message: n,
442
- code: "custom",
443
- input: t,
444
- inst: r
445
- } : { ...n };
446
- }
447
- const We = (e, n) => {
448
- e.name = "$ZodError", Object.defineProperty(e, "_zod", {
449
- value: e._zod,
450
- enumerable: !1
451
- }), Object.defineProperty(e, "issues", {
452
- value: n,
453
- enumerable: !1
454
- }), e.message = JSON.stringify(n, ie, 2), Object.defineProperty(e, "toString", {
455
- value: () => e.message,
456
- enumerable: !1
457
- });
458
- }, Je = s("$ZodError", We), Me = s("$ZodError", We, { Parent: Error });
459
- function In(e, n = (t) => t.message) {
460
- const t = {}, r = [];
461
- for (const o of e.issues)
462
- o.path.length > 0 ? (t[o.path[0]] = t[o.path[0]] || [], t[o.path[0]].push(n(o))) : r.push(n(o));
463
- return { formErrors: r, fieldErrors: t };
464
- }
465
- function En(e, n) {
466
- const t = n || function(i) {
467
- return i.message;
468
- }, r = { _errors: [] }, o = (i) => {
469
- for (const c of i.issues)
470
- if (c.code === "invalid_union" && c.errors.length)
471
- c.errors.map((u) => o({ issues: u }));
472
- else if (c.code === "invalid_key")
473
- o({ issues: c.issues });
474
- else if (c.code === "invalid_element")
475
- o({ issues: c.issues });
476
- else if (c.path.length === 0)
477
- r._errors.push(t(c));
478
- else {
479
- let u = r, a = 0;
480
- for (; a < c.path.length; ) {
481
- const l = c.path[a];
482
- a === c.path.length - 1 ? (u[l] = u[l] || { _errors: [] }, u[l]._errors.push(t(c))) : u[l] = u[l] || { _errors: [] }, u = u[l], a++;
483
- }
484
- }
485
- };
486
- return o(e), r;
487
- }
488
- const he = (e) => (n, t, r, o) => {
489
- const i = r ? Object.assign(r, { async: !1 }) : { async: !1 }, c = n._zod.run({ value: t, issues: [] }, i);
490
- if (c instanceof Promise)
491
- throw new D();
492
- if (c.issues.length) {
493
- const u = new ((o == null ? void 0 : o.Err) ?? e)(c.issues.map((a) => C(a, i, R())));
494
- throw Le(u, o == null ? void 0 : o.callee), u;
495
- }
496
- return c.value;
497
- }, pe = (e) => async (n, t, r, o) => {
498
- const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
499
- let c = n._zod.run({ value: t, issues: [] }, i);
500
- if (c instanceof Promise && (c = await c), c.issues.length) {
501
- const u = new ((o == null ? void 0 : o.Err) ?? e)(c.issues.map((a) => C(a, i, R())));
502
- throw Le(u, o == null ? void 0 : o.callee), u;
503
- }
504
- return c.value;
505
- }, H = (e) => (n, t, r) => {
506
- const o = r ? { ...r, async: !1 } : { async: !1 }, i = n._zod.run({ value: t, issues: [] }, o);
507
- if (i instanceof Promise)
508
- throw new D();
509
- return i.issues.length ? {
510
- success: !1,
511
- error: new (e ?? Je)(i.issues.map((c) => C(c, o, R())))
512
- } : { success: !0, data: i.value };
513
- }, Pn = /* @__PURE__ */ H(Me), Q = (e) => async (n, t, r) => {
514
- const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
515
- let i = n._zod.run({ value: t, issues: [] }, o);
516
- return i instanceof Promise && (i = await i), i.issues.length ? {
517
- success: !1,
518
- error: new e(i.issues.map((c) => C(c, o, R())))
519
- } : { success: !0, data: i.value };
520
- }, xn = /* @__PURE__ */ Q(Me), Tn = (e) => (n, t, r) => {
521
- const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
522
- return he(e)(n, t, o);
523
- }, jn = (e) => (n, t, r) => he(e)(n, t, r), On = (e) => async (n, t, r) => {
524
- const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
525
- return pe(e)(n, t, o);
526
- }, Rn = (e) => async (n, t, r) => pe(e)(n, t, r), Cn = (e) => (n, t, r) => {
527
- const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
528
- return H(e)(n, t, o);
529
- }, An = (e) => (n, t, r) => H(e)(n, t, r), Sn = (e) => async (n, t, r) => {
530
- const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
531
- return Q(e)(n, t, o);
532
- }, Nn = (e) => async (n, t, r) => Q(e)(n, t, r), Dn = /^[cC][^\s-]{8,}$/, Fn = /^[0-9a-z]+$/, Un = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Ln = /^[0-9a-vA-V]{20}$/, Vn = /^[A-Za-z0-9]{27}$/, Gn = /^[a-zA-Z0-9_-]{21}$/, Wn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Jn = /^([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})$/, ve = (e) => e ? new 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)$/, Mn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Yn = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
533
- function Kn() {
534
- return new RegExp(Yn, "u");
535
- }
536
- const Bn = /^(?:(?: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])$/, Xn = /^(([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})$/, qn = /^((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])$/, Hn = /^(([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])$/, Qn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Ye = /^[A-Za-z0-9_-]*$/, et = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, nt = /^\+(?:[0-9]){6,14}[0-9]$/, Ke = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", tt = /* @__PURE__ */ new RegExp(`^${Ke}$`);
537
- function Be(e) {
538
- const n = "(?:[01]\\d|2[0-3]):[0-5]\\d";
539
- return typeof e.precision == "number" ? e.precision === -1 ? `${n}` : e.precision === 0 ? `${n}:[0-5]\\d` : `${n}:[0-5]\\d\\.\\d{${e.precision}}` : `${n}(?::[0-5]\\d(?:\\.\\d+)?)?`;
540
- }
541
- function rt(e) {
542
- return new RegExp(`^${Be(e)}$`);
543
- }
544
- function ot(e) {
545
- const n = Be({ precision: e.precision }), t = ["Z"];
546
- e.local && t.push(""), e.offset && t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
547
- const r = `${n}(?:${t.join("|")})`;
548
- return new RegExp(`^${Ke}T(?:${r})$`);
549
- }
550
- const it = (e) => {
551
- const n = e ? `[\\s\\S]{${(e == null ? void 0 : e.minimum) ?? 0},${(e == null ? void 0 : e.maximum) ?? ""}}` : "[\\s\\S]*";
552
- return new RegExp(`^${n}$`);
553
- }, ct = /^\d+$/, ut = /^-?\d+(?:\.\d+)?/i, st = /^[^A-Z]*$/, at = /^[^a-z]*$/, k = /* @__PURE__ */ s("$ZodCheck", (e, n) => {
554
- var t;
555
- e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
556
- }), Xe = {
557
- number: "number",
558
- bigint: "bigint",
559
- object: "date"
560
- }, qe = /* @__PURE__ */ s("$ZodCheckLessThan", (e, n) => {
561
- k.init(e, n);
562
- const t = Xe[typeof n.value];
563
- e._zod.onattach.push((r) => {
564
- const o = r._zod.bag, i = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
565
- n.value < i && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
566
- }), e._zod.check = (r) => {
567
- (n.inclusive ? r.value <= n.value : r.value < n.value) || r.issues.push({
568
- origin: t,
569
- code: "too_big",
570
- maximum: n.value,
571
- input: r.value,
572
- inclusive: n.inclusive,
573
- inst: e,
574
- continue: !n.abort
575
- });
576
- };
577
- }), He = /* @__PURE__ */ s("$ZodCheckGreaterThan", (e, n) => {
578
- k.init(e, n);
579
- const t = Xe[typeof n.value];
580
- e._zod.onattach.push((r) => {
581
- const o = r._zod.bag, i = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
582
- n.value > i && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
583
- }), e._zod.check = (r) => {
584
- (n.inclusive ? r.value >= n.value : r.value > n.value) || r.issues.push({
585
- origin: t,
586
- code: "too_small",
587
- minimum: n.value,
588
- input: r.value,
589
- inclusive: n.inclusive,
590
- inst: e,
591
- continue: !n.abort
592
- });
593
- };
594
- }), lt = /* @__PURE__ */ s("$ZodCheckMultipleOf", (e, n) => {
595
- k.init(e, n), e._zod.onattach.push((t) => {
596
- var r;
597
- (r = t._zod.bag).multipleOf ?? (r.multipleOf = n.value);
598
- }), e._zod.check = (t) => {
599
- if (typeof t.value != typeof n.value)
600
- throw new Error("Cannot mix number and bigint in multiple_of check.");
601
- (typeof t.value == "bigint" ? t.value % n.value === BigInt(0) : hn(t.value, n.value) === 0) || t.issues.push({
602
- origin: typeof t.value,
603
- code: "not_multiple_of",
604
- divisor: n.value,
605
- input: t.value,
606
- inst: e,
607
- continue: !n.abort
608
- });
609
- };
610
- }), ft = /* @__PURE__ */ s("$ZodCheckNumberFormat", (e, n) => {
611
- var c;
612
- k.init(e, n), n.format = n.format || "float64";
613
- const t = (c = n.format) == null ? void 0 : c.includes("int"), r = t ? "int" : "number", [o, i] = vn[n.format];
614
- e._zod.onattach.push((u) => {
615
- const a = u._zod.bag;
616
- a.format = n.format, a.minimum = o, a.maximum = i, t && (a.pattern = ct);
617
- }), e._zod.check = (u) => {
618
- const a = u.value;
619
- if (t) {
620
- if (!Number.isInteger(a)) {
621
- u.issues.push({
622
- expected: r,
623
- format: n.format,
624
- code: "invalid_type",
625
- continue: !1,
626
- input: a,
627
- inst: e
628
- });
629
- return;
630
- }
631
- if (!Number.isSafeInteger(a)) {
632
- a > 0 ? u.issues.push({
633
- input: a,
634
- code: "too_big",
635
- maximum: Number.MAX_SAFE_INTEGER,
636
- note: "Integers must be within the safe integer range.",
637
- inst: e,
638
- origin: r,
639
- continue: !n.abort
640
- }) : u.issues.push({
641
- input: a,
642
- code: "too_small",
643
- minimum: Number.MIN_SAFE_INTEGER,
644
- note: "Integers must be within the safe integer range.",
645
- inst: e,
646
- origin: r,
647
- continue: !n.abort
648
- });
649
- return;
650
- }
651
- }
652
- a < o && u.issues.push({
653
- origin: "number",
654
- input: a,
655
- code: "too_small",
656
- minimum: o,
657
- inclusive: !0,
658
- inst: e,
659
- continue: !n.abort
660
- }), a > i && u.issues.push({
661
- origin: "number",
662
- input: a,
663
- code: "too_big",
664
- maximum: i,
665
- inst: e
666
- });
667
- };
668
- }), dt = /* @__PURE__ */ s("$ZodCheckMaxLength", (e, n) => {
669
- var t;
670
- k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
671
- const o = r.value;
672
- return !le(o) && o.length !== void 0;
673
- }), e._zod.onattach.push((r) => {
674
- const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
675
- n.maximum < o && (r._zod.bag.maximum = n.maximum);
676
- }), e._zod.check = (r) => {
677
- const o = r.value;
678
- if (o.length <= n.maximum)
679
- return;
680
- const c = de(o);
681
- r.issues.push({
682
- origin: c,
683
- code: "too_big",
684
- maximum: n.maximum,
685
- inclusive: !0,
686
- input: o,
687
- inst: e,
688
- continue: !n.abort
689
- });
690
- };
691
- }), ht = /* @__PURE__ */ s("$ZodCheckMinLength", (e, n) => {
692
- var t;
693
- k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
694
- const o = r.value;
695
- return !le(o) && o.length !== void 0;
696
- }), e._zod.onattach.push((r) => {
697
- const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
698
- n.minimum > o && (r._zod.bag.minimum = n.minimum);
699
- }), e._zod.check = (r) => {
700
- const o = r.value;
701
- if (o.length >= n.minimum)
702
- return;
703
- const c = de(o);
704
- r.issues.push({
705
- origin: c,
706
- code: "too_small",
707
- minimum: n.minimum,
708
- inclusive: !0,
709
- input: o,
710
- inst: e,
711
- continue: !n.abort
712
- });
713
- };
714
- }), pt = /* @__PURE__ */ s("$ZodCheckLengthEquals", (e, n) => {
715
- var t;
716
- k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
717
- const o = r.value;
718
- return !le(o) && o.length !== void 0;
719
- }), e._zod.onattach.push((r) => {
720
- const o = r._zod.bag;
721
- o.minimum = n.length, o.maximum = n.length, o.length = n.length;
722
- }), e._zod.check = (r) => {
723
- const o = r.value, i = o.length;
724
- if (i === n.length)
725
- return;
726
- const c = de(o), u = i > n.length;
727
- r.issues.push({
728
- origin: c,
729
- ...u ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
730
- inclusive: !0,
731
- exact: !0,
732
- input: r.value,
733
- inst: e,
734
- continue: !n.abort
735
- });
736
- };
737
- }), ee = /* @__PURE__ */ s("$ZodCheckStringFormat", (e, n) => {
738
- var t, r;
739
- k.init(e, n), e._zod.onattach.push((o) => {
740
- const i = o._zod.bag;
741
- i.format = n.format, n.pattern && (i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(n.pattern));
742
- }), n.pattern ? (t = e._zod).check ?? (t.check = (o) => {
743
- n.pattern.lastIndex = 0, !n.pattern.test(o.value) && o.issues.push({
744
- origin: "string",
745
- code: "invalid_format",
746
- format: n.format,
747
- input: o.value,
748
- ...n.pattern ? { pattern: n.pattern.toString() } : {},
749
- inst: e,
750
- continue: !n.abort
751
- });
752
- }) : (r = e._zod).check ?? (r.check = () => {
753
- });
754
- }), mt = /* @__PURE__ */ s("$ZodCheckRegex", (e, n) => {
755
- ee.init(e, n), e._zod.check = (t) => {
756
- n.pattern.lastIndex = 0, !n.pattern.test(t.value) && t.issues.push({
757
- origin: "string",
758
- code: "invalid_format",
759
- format: "regex",
760
- input: t.value,
761
- pattern: n.pattern.toString(),
762
- inst: e,
763
- continue: !n.abort
764
- });
765
- };
766
- }), _t = /* @__PURE__ */ s("$ZodCheckLowerCase", (e, n) => {
767
- n.pattern ?? (n.pattern = st), ee.init(e, n);
768
- }), gt = /* @__PURE__ */ s("$ZodCheckUpperCase", (e, n) => {
769
- n.pattern ?? (n.pattern = at), ee.init(e, n);
770
- }), vt = /* @__PURE__ */ s("$ZodCheckIncludes", (e, n) => {
771
- k.init(e, n);
772
- const t = q(n.includes), r = new RegExp(typeof n.position == "number" ? `^.{${n.position}}${t}` : t);
773
- n.pattern = r, e._zod.onattach.push((o) => {
774
- const i = o._zod.bag;
775
- i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(r);
776
- }), e._zod.check = (o) => {
777
- o.value.includes(n.includes, n.position) || o.issues.push({
778
- origin: "string",
779
- code: "invalid_format",
780
- format: "includes",
781
- includes: n.includes,
782
- input: o.value,
783
- inst: e,
784
- continue: !n.abort
785
- });
786
- };
787
- }), zt = /* @__PURE__ */ s("$ZodCheckStartsWith", (e, n) => {
788
- k.init(e, n);
789
- const t = new RegExp(`^${q(n.prefix)}.*`);
790
- n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
791
- const o = r._zod.bag;
792
- o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(t);
793
- }), e._zod.check = (r) => {
794
- r.value.startsWith(n.prefix) || r.issues.push({
795
- origin: "string",
796
- code: "invalid_format",
797
- format: "starts_with",
798
- prefix: n.prefix,
799
- input: r.value,
800
- inst: e,
801
- continue: !n.abort
802
- });
803
- };
804
- }), bt = /* @__PURE__ */ s("$ZodCheckEndsWith", (e, n) => {
805
- k.init(e, n);
806
- const t = new RegExp(`.*${q(n.suffix)}$`);
807
- n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
808
- const o = r._zod.bag;
809
- o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(t);
810
- }), e._zod.check = (r) => {
811
- r.value.endsWith(n.suffix) || r.issues.push({
812
- origin: "string",
813
- code: "invalid_format",
814
- format: "ends_with",
815
- suffix: n.suffix,
816
- input: r.value,
817
- inst: e,
818
- continue: !n.abort
819
- });
820
- };
821
- }), wt = /* @__PURE__ */ s("$ZodCheckOverwrite", (e, n) => {
822
- k.init(e, n), e._zod.check = (t) => {
823
- t.value = n.tx(t.value);
824
- };
825
- });
826
- class $t {
827
- constructor(n = []) {
828
- this.content = [], this.indent = 0, this && (this.args = n);
829
- }
830
- indented(n) {
831
- this.indent += 1, n(this), this.indent -= 1;
832
- }
833
- write(n) {
834
- if (typeof n == "function") {
835
- n(this, { execution: "sync" }), n(this, { execution: "async" });
836
- return;
837
- }
838
- const r = n.split(`
839
- `).filter((c) => c), o = Math.min(...r.map((c) => c.length - c.trimStart().length)), i = r.map((c) => c.slice(o)).map((c) => " ".repeat(this.indent * 2) + c);
840
- for (const c of i)
841
- this.content.push(c);
842
- }
843
- compile() {
844
- const n = Function, t = this == null ? void 0 : this.args, o = [...((this == null ? void 0 : this.content) ?? [""]).map((i) => ` ${i}`)];
845
- return new n(...t, o.join(`
846
- `));
847
- }
848
- }
849
- const kt = {
850
- major: 4,
851
- minor: 1,
852
- patch: 5
853
- }, b = /* @__PURE__ */ s("$ZodType", (e, n) => {
854
- var o;
855
- var t;
856
- e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = kt;
857
- const r = [...e._zod.def.checks ?? []];
858
- e._zod.traits.has("$ZodCheck") && r.unshift(e);
859
- for (const i of r)
860
- for (const c of i._zod.onattach)
861
- c(e);
862
- if (r.length === 0)
863
- (t = e._zod).deferred ?? (t.deferred = []), (o = e._zod.deferred) == null || o.push(() => {
864
- e._zod.run = e._zod.parse;
865
- });
866
- else {
867
- const i = (u, a, l) => {
868
- let d = N(u), p;
869
- for (const m of a) {
870
- if (m._zod.def.when) {
871
- if (!m._zod.def.when(u))
872
- continue;
873
- } else if (d)
874
- continue;
875
- const h = u.issues.length, z = m._zod.check(u);
876
- if (z instanceof Promise && (l == null ? void 0 : l.async) === !1)
877
- throw new D();
878
- if (p || z instanceof Promise)
879
- p = (p ?? Promise.resolve()).then(async () => {
880
- await z, u.issues.length !== h && (d || (d = N(u, h)));
881
- });
882
- else {
883
- if (u.issues.length === h)
884
- continue;
885
- d || (d = N(u, h));
886
- }
887
- }
888
- return p ? p.then(() => u) : u;
889
- }, c = (u, a, l) => {
890
- if (N(u))
891
- return u.aborted = !0, u;
892
- const d = i(a, r, l);
893
- if (d instanceof Promise) {
894
- if (l.async === !1)
895
- throw new D();
896
- return d.then((p) => e._zod.parse(p, l));
897
- }
898
- return e._zod.parse(d, l);
899
- };
900
- e._zod.run = (u, a) => {
901
- if (a.skipChecks)
902
- return e._zod.parse(u, a);
903
- if (a.direction === "backward") {
904
- const d = e._zod.parse({ value: u.value, issues: [] }, { ...a, skipChecks: !0 });
905
- return d instanceof Promise ? d.then((p) => c(p, u, a)) : c(d, u, a);
906
- }
907
- const l = e._zod.parse(u, a);
908
- if (l instanceof Promise) {
909
- if (a.async === !1)
910
- throw new D();
911
- return l.then((d) => i(d, r, a));
912
- }
913
- return i(l, r, a);
914
- };
915
- }
916
- e["~standard"] = {
917
- validate: (i) => {
918
- var c;
919
- try {
920
- const u = Pn(e, i);
921
- return u.success ? { value: u.data } : { issues: (c = u.error) == null ? void 0 : c.issues };
922
- } catch {
923
- return xn(e, i).then((a) => {
924
- var l;
925
- return a.success ? { value: a.data } : { issues: (l = a.error) == null ? void 0 : l.issues };
926
- });
927
- }
928
- },
929
- vendor: "zod",
930
- version: 1
931
- };
932
- }), me = /* @__PURE__ */ s("$ZodString", (e, n) => {
933
- var t;
934
- b.init(e, n), e._zod.pattern = [...((t = e == null ? void 0 : e._zod.bag) == null ? void 0 : t.patterns) ?? []].pop() ?? it(e._zod.bag), e._zod.parse = (r, o) => {
935
- if (n.coerce)
936
- try {
937
- r.value = String(r.value);
938
- } catch {
939
- }
940
- return typeof r.value == "string" || r.issues.push({
941
- expected: "string",
942
- code: "invalid_type",
943
- input: r.value,
944
- inst: e
945
- }), r;
946
- };
947
- }), g = /* @__PURE__ */ s("$ZodStringFormat", (e, n) => {
948
- ee.init(e, n), me.init(e, n);
949
- }), Zt = /* @__PURE__ */ s("$ZodGUID", (e, n) => {
950
- n.pattern ?? (n.pattern = Jn), g.init(e, n);
951
- }), yt = /* @__PURE__ */ s("$ZodUUID", (e, n) => {
952
- if (n.version) {
953
- const r = {
954
- v1: 1,
955
- v2: 2,
956
- v3: 3,
957
- v4: 4,
958
- v5: 5,
959
- v6: 6,
960
- v7: 7,
961
- v8: 8
962
- }[n.version];
963
- if (r === void 0)
964
- throw new Error(`Invalid UUID version: "${n.version}"`);
965
- n.pattern ?? (n.pattern = ve(r));
966
- } else
967
- n.pattern ?? (n.pattern = ve());
968
- g.init(e, n);
969
- }), It = /* @__PURE__ */ s("$ZodEmail", (e, n) => {
970
- n.pattern ?? (n.pattern = Mn), g.init(e, n);
971
- }), Et = /* @__PURE__ */ s("$ZodURL", (e, n) => {
972
- g.init(e, n), e._zod.check = (t) => {
973
- try {
974
- const r = t.value.trim(), o = new URL(r);
975
- n.hostname && (n.hostname.lastIndex = 0, n.hostname.test(o.hostname) || t.issues.push({
976
- code: "invalid_format",
977
- format: "url",
978
- note: "Invalid hostname",
979
- pattern: et.source,
980
- input: t.value,
981
- inst: e,
982
- continue: !n.abort
983
- })), n.protocol && (n.protocol.lastIndex = 0, n.protocol.test(o.protocol.endsWith(":") ? o.protocol.slice(0, -1) : o.protocol) || t.issues.push({
984
- code: "invalid_format",
985
- format: "url",
986
- note: "Invalid protocol",
987
- pattern: n.protocol.source,
988
- input: t.value,
989
- inst: e,
990
- continue: !n.abort
991
- })), n.normalize ? t.value = o.href : t.value = r;
992
- return;
993
- } catch {
994
- t.issues.push({
995
- code: "invalid_format",
996
- format: "url",
997
- input: t.value,
998
- inst: e,
999
- continue: !n.abort
1000
- });
1001
- }
1002
- };
1003
- }), Pt = /* @__PURE__ */ s("$ZodEmoji", (e, n) => {
1004
- n.pattern ?? (n.pattern = Kn()), g.init(e, n);
1005
- }), xt = /* @__PURE__ */ s("$ZodNanoID", (e, n) => {
1006
- n.pattern ?? (n.pattern = Gn), g.init(e, n);
1007
- }), Tt = /* @__PURE__ */ s("$ZodCUID", (e, n) => {
1008
- n.pattern ?? (n.pattern = Dn), g.init(e, n);
1009
- }), jt = /* @__PURE__ */ s("$ZodCUID2", (e, n) => {
1010
- n.pattern ?? (n.pattern = Fn), g.init(e, n);
1011
- }), Ot = /* @__PURE__ */ s("$ZodULID", (e, n) => {
1012
- n.pattern ?? (n.pattern = Un), g.init(e, n);
1013
- }), Rt = /* @__PURE__ */ s("$ZodXID", (e, n) => {
1014
- n.pattern ?? (n.pattern = Ln), g.init(e, n);
1015
- }), Ct = /* @__PURE__ */ s("$ZodKSUID", (e, n) => {
1016
- n.pattern ?? (n.pattern = Vn), g.init(e, n);
1017
- }), At = /* @__PURE__ */ s("$ZodISODateTime", (e, n) => {
1018
- n.pattern ?? (n.pattern = ot(n)), g.init(e, n);
1019
- }), St = /* @__PURE__ */ s("$ZodISODate", (e, n) => {
1020
- n.pattern ?? (n.pattern = tt), g.init(e, n);
1021
- }), Nt = /* @__PURE__ */ s("$ZodISOTime", (e, n) => {
1022
- n.pattern ?? (n.pattern = rt(n)), g.init(e, n);
1023
- }), Dt = /* @__PURE__ */ s("$ZodISODuration", (e, n) => {
1024
- n.pattern ?? (n.pattern = Wn), g.init(e, n);
1025
- }), Ft = /* @__PURE__ */ s("$ZodIPv4", (e, n) => {
1026
- n.pattern ?? (n.pattern = Bn), g.init(e, n), e._zod.onattach.push((t) => {
1027
- const r = t._zod.bag;
1028
- r.format = "ipv4";
1029
- });
1030
- }), Ut = /* @__PURE__ */ s("$ZodIPv6", (e, n) => {
1031
- n.pattern ?? (n.pattern = Xn), g.init(e, n), e._zod.onattach.push((t) => {
1032
- const r = t._zod.bag;
1033
- r.format = "ipv6";
1034
- }), e._zod.check = (t) => {
1035
- try {
1036
- new URL(`http://[${t.value}]`);
1037
- } catch {
1038
- t.issues.push({
1039
- code: "invalid_format",
1040
- format: "ipv6",
1041
- input: t.value,
1042
- inst: e,
1043
- continue: !n.abort
1044
- });
1045
- }
1046
- };
1047
- }), Lt = /* @__PURE__ */ s("$ZodCIDRv4", (e, n) => {
1048
- n.pattern ?? (n.pattern = qn), g.init(e, n);
1049
- }), Vt = /* @__PURE__ */ s("$ZodCIDRv6", (e, n) => {
1050
- n.pattern ?? (n.pattern = Hn), g.init(e, n), e._zod.check = (t) => {
1051
- const [r, o] = t.value.split("/");
1052
- try {
1053
- if (!o)
1054
- throw new Error();
1055
- const i = Number(o);
1056
- if (`${i}` !== o)
1057
- throw new Error();
1058
- if (i < 0 || i > 128)
1059
- throw new Error();
1060
- new URL(`http://[${r}]`);
1061
- } catch {
1062
- t.issues.push({
1063
- code: "invalid_format",
1064
- format: "cidrv6",
1065
- input: t.value,
1066
- inst: e,
1067
- continue: !n.abort
1068
- });
1069
- }
1070
- };
1071
- });
1072
- function Qe(e) {
1073
- if (e === "")
1074
- return !0;
1075
- if (e.length % 4 !== 0)
1076
- return !1;
1077
- try {
1078
- return atob(e), !0;
1079
- } catch {
1080
- return !1;
1081
- }
1082
- }
1083
- const Gt = /* @__PURE__ */ s("$ZodBase64", (e, n) => {
1084
- n.pattern ?? (n.pattern = Qn), g.init(e, n), e._zod.onattach.push((t) => {
1085
- t._zod.bag.contentEncoding = "base64";
1086
- }), e._zod.check = (t) => {
1087
- Qe(t.value) || t.issues.push({
1088
- code: "invalid_format",
1089
- format: "base64",
1090
- input: t.value,
1091
- inst: e,
1092
- continue: !n.abort
1093
- });
1094
- };
1095
- });
1096
- function Wt(e) {
1097
- if (!Ye.test(e))
1098
- return !1;
1099
- const n = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), t = n.padEnd(Math.ceil(n.length / 4) * 4, "=");
1100
- return Qe(t);
1101
- }
1102
- const Jt = /* @__PURE__ */ s("$ZodBase64URL", (e, n) => {
1103
- n.pattern ?? (n.pattern = Ye), g.init(e, n), e._zod.onattach.push((t) => {
1104
- t._zod.bag.contentEncoding = "base64url";
1105
- }), e._zod.check = (t) => {
1106
- Wt(t.value) || t.issues.push({
1107
- code: "invalid_format",
1108
- format: "base64url",
1109
- input: t.value,
1110
- inst: e,
1111
- continue: !n.abort
1112
- });
1113
- };
1114
- }), Mt = /* @__PURE__ */ s("$ZodE164", (e, n) => {
1115
- n.pattern ?? (n.pattern = nt), g.init(e, n);
1116
- });
1117
- function Yt(e, n = null) {
1118
- try {
1119
- const t = e.split(".");
1120
- if (t.length !== 3)
1121
- return !1;
1122
- const [r] = t;
1123
- if (!r)
1124
- return !1;
1125
- const o = JSON.parse(atob(r));
1126
- return !("typ" in o && (o == null ? void 0 : o.typ) !== "JWT" || !o.alg || n && (!("alg" in o) || o.alg !== n));
1127
- } catch {
1128
- return !1;
1129
- }
1130
- }
1131
- const Kt = /* @__PURE__ */ s("$ZodJWT", (e, n) => {
1132
- g.init(e, n), e._zod.check = (t) => {
1133
- Yt(t.value, n.alg) || t.issues.push({
1134
- code: "invalid_format",
1135
- format: "jwt",
1136
- input: t.value,
1137
- inst: e,
1138
- continue: !n.abort
1139
- });
1140
- };
1141
- }), en = /* @__PURE__ */ s("$ZodNumber", (e, n) => {
1142
- b.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? ut, e._zod.parse = (t, r) => {
1143
- if (n.coerce)
1144
- try {
1145
- t.value = Number(t.value);
1146
- } catch {
1147
- }
1148
- const o = t.value;
1149
- if (typeof o == "number" && !Number.isNaN(o) && Number.isFinite(o))
1150
- return t;
1151
- const i = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
1152
- return t.issues.push({
1153
- expected: "number",
1154
- code: "invalid_type",
1155
- input: o,
1156
- inst: e,
1157
- ...i ? { received: i } : {}
1158
- }), t;
1159
- };
1160
- }), Bt = /* @__PURE__ */ s("$ZodNumber", (e, n) => {
1161
- ft.init(e, n), en.init(e, n);
1162
- }), Xt = /* @__PURE__ */ s("$ZodAny", (e, n) => {
1163
- b.init(e, n), e._zod.parse = (t) => t;
1164
- }), qt = /* @__PURE__ */ s("$ZodUnknown", (e, n) => {
1165
- b.init(e, n), e._zod.parse = (t) => t;
1166
- }), Ht = /* @__PURE__ */ s("$ZodNever", (e, n) => {
1167
- b.init(e, n), e._zod.parse = (t, r) => (t.issues.push({
1168
- expected: "never",
1169
- code: "invalid_type",
1170
- input: t.value,
1171
- inst: e
1172
- }), t);
1173
- });
1174
- function ze(e, n, t) {
1175
- e.issues.length && n.issues.push(...Ge(t, e.issues)), n.value[t] = e.value;
1176
- }
1177
- const Qt = /* @__PURE__ */ s("$ZodArray", (e, n) => {
1178
- b.init(e, n), e._zod.parse = (t, r) => {
1179
- const o = t.value;
1180
- if (!Array.isArray(o))
1181
- return t.issues.push({
1182
- expected: "array",
1183
- code: "invalid_type",
1184
- input: o,
1185
- inst: e
1186
- }), t;
1187
- t.value = Array(o.length);
1188
- const i = [];
1189
- for (let c = 0; c < o.length; c++) {
1190
- const u = o[c], a = n.element._zod.run({
1191
- value: u,
1192
- issues: []
1193
- }, r);
1194
- a instanceof Promise ? i.push(a.then((l) => ze(l, t, c))) : ze(a, t, c);
1195
- }
1196
- return i.length ? Promise.all(i).then(() => t) : t;
1197
- };
1198
- });
1199
- function B(e, n, t, r) {
1200
- e.issues.length && n.issues.push(...Ge(t, e.issues)), e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
1201
- }
1202
- function nn(e) {
1203
- const n = Object.keys(e.shape);
1204
- for (const r of n)
1205
- if (!e.shape[r]._zod.traits.has("$ZodType"))
1206
- throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
1207
- const t = gn(e.shape);
1208
- return {
1209
- ...e,
1210
- keys: n,
1211
- keySet: new Set(n),
1212
- numKeys: n.length,
1213
- optionalKeys: new Set(t)
1214
- };
1215
- }
1216
- function tn(e, n, t, r, o, i) {
1217
- const c = [], u = o.keySet, a = o.catchall._zod, l = a.def.type;
1218
- for (const d of Object.keys(n)) {
1219
- if (u.has(d))
1220
- continue;
1221
- if (l === "never") {
1222
- c.push(d);
1223
- continue;
1224
- }
1225
- const p = a.run({ value: n[d], issues: [] }, r);
1226
- p instanceof Promise ? e.push(p.then((m) => B(m, t, d, n))) : B(p, t, d, n);
1227
- }
1228
- return c.length && t.issues.push({
1229
- code: "unrecognized_keys",
1230
- keys: c,
1231
- input: n,
1232
- inst: i
1233
- }), e.length ? Promise.all(e).then(() => t) : t;
1234
- }
1235
- const er = /* @__PURE__ */ s("$ZodObject", (e, n) => {
1236
- b.init(e, n);
1237
- const t = ae(() => nn(n));
1238
- _(e._zod, "propValues", () => {
1239
- const c = n.shape, u = {};
1240
- for (const a in c) {
1241
- const l = c[a]._zod;
1242
- if (l.values) {
1243
- u[a] ?? (u[a] = /* @__PURE__ */ new Set());
1244
- for (const d of l.values)
1245
- u[a].add(d);
1246
- }
1247
- }
1248
- return u;
1249
- });
1250
- const r = K, o = n.catchall;
1251
- let i;
1252
- e._zod.parse = (c, u) => {
1253
- i ?? (i = t.value);
1254
- const a = c.value;
1255
- if (!r(a))
1256
- return c.issues.push({
1257
- expected: "object",
1258
- code: "invalid_type",
1259
- input: a,
1260
- inst: e
1261
- }), c;
1262
- c.value = {};
1263
- const l = [], d = i.shape;
1264
- for (const p of i.keys) {
1265
- const h = d[p]._zod.run({ value: a[p], issues: [] }, u);
1266
- h instanceof Promise ? l.push(h.then((z) => B(z, c, p, a))) : B(h, c, p, a);
1267
- }
1268
- return o ? tn(l, a, c, u, t.value, e) : l.length ? Promise.all(l).then(() => c) : c;
1269
- };
1270
- }), nr = /* @__PURE__ */ s("$ZodObjectJIT", (e, n) => {
1271
- er.init(e, n);
1272
- const t = e._zod.parse, r = ae(() => nn(n)), o = (m) => {
1273
- const h = new $t(["shape", "payload", "ctx"]), z = r.value, $ = (I) => {
1274
- const Z = ge(I);
1275
- return `shape[${Z}]._zod.run({ value: input[${Z}], issues: [] }, ctx)`;
1276
- };
1277
- h.write("const input = payload.value;");
1278
- const j = /* @__PURE__ */ Object.create(null);
1279
- let ne = 0;
1280
- for (const I of z.keys)
1281
- j[I] = `key_${ne++}`;
1282
- h.write("const newResult = {}");
1283
- for (const I of z.keys) {
1284
- const Z = j[I], O = ge(I);
1285
- h.write(`const ${Z} = ${$(I)};`), h.write(`
1286
- if (${Z}.issues.length) {
1287
- payload.issues = payload.issues.concat(${Z}.issues.map(iss => ({
1288
- ...iss,
1289
- path: iss.path ? [${O}, ...iss.path] : [${O}]
1290
- })));
1291
- }
1292
-
1293
- if (${Z}.value === undefined) {
1294
- if (${O} in input) {
1295
- newResult[${O}] = undefined;
1296
- }
1297
- } else {
1298
- newResult[${O}] = ${Z}.value;
1299
- }
1300
- `);
1301
- }
1302
- h.write("payload.value = newResult;"), h.write("return payload;");
1303
- const te = h.compile();
1304
- return (I, Z) => te(m, I, Z);
1305
- };
1306
- let i;
1307
- const c = K, u = !Ue.jitless, l = u && mn.value, d = n.catchall;
1308
- let p;
1309
- e._zod.parse = (m, h) => {
1310
- p ?? (p = r.value);
1311
- const z = m.value;
1312
- return c(z) ? u && l && (h == null ? void 0 : h.async) === !1 && h.jitless !== !0 ? (i || (i = o(n.shape)), m = i(m, h), d ? tn([], z, m, h, p, e) : m) : t(m, h) : (m.issues.push({
1313
- expected: "object",
1314
- code: "invalid_type",
1315
- input: z,
1316
- inst: e
1317
- }), m);
1318
- };
1319
- });
1320
- function be(e, n, t, r) {
1321
- for (const i of e)
1322
- if (i.issues.length === 0)
1323
- return n.value = i.value, n;
1324
- const o = e.filter((i) => !N(i));
1325
- return o.length === 1 ? (n.value = o[0].value, o[0]) : (n.issues.push({
1326
- code: "invalid_union",
1327
- input: n.value,
1328
- inst: t,
1329
- errors: e.map((i) => i.issues.map((c) => C(c, r, R())))
1330
- }), n);
1331
- }
1332
- const tr = /* @__PURE__ */ s("$ZodUnion", (e, n) => {
1333
- b.init(e, n), _(e._zod, "optin", () => n.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), _(e._zod, "optout", () => n.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), _(e._zod, "values", () => {
1334
- if (n.options.every((o) => o._zod.values))
1335
- return new Set(n.options.flatMap((o) => Array.from(o._zod.values)));
1336
- }), _(e._zod, "pattern", () => {
1337
- if (n.options.every((o) => o._zod.pattern)) {
1338
- const o = n.options.map((i) => i._zod.pattern);
1339
- return new RegExp(`^(${o.map((i) => fe(i.source)).join("|")})$`);
1340
- }
1341
- });
1342
- const t = n.options.length === 1, r = n.options[0]._zod.run;
1343
- e._zod.parse = (o, i) => {
1344
- if (t)
1345
- return r(o, i);
1346
- let c = !1;
1347
- const u = [];
1348
- for (const a of n.options) {
1349
- const l = a._zod.run({
1350
- value: o.value,
1351
- issues: []
1352
- }, i);
1353
- if (l instanceof Promise)
1354
- u.push(l), c = !0;
1355
- else {
1356
- if (l.issues.length === 0)
1357
- return l;
1358
- u.push(l);
1359
- }
1360
- }
1361
- return c ? Promise.all(u).then((a) => be(a, o, e, i)) : be(u, o, e, i);
1362
- };
1363
- }), rr = /* @__PURE__ */ s("$ZodIntersection", (e, n) => {
1364
- b.init(e, n), e._zod.parse = (t, r) => {
1365
- const o = t.value, i = n.left._zod.run({ value: o, issues: [] }, r), c = n.right._zod.run({ value: o, issues: [] }, r);
1366
- return i instanceof Promise || c instanceof Promise ? Promise.all([i, c]).then(([a, l]) => we(t, a, l)) : we(t, i, c);
1367
- };
1368
- });
1369
- function ce(e, n) {
1370
- if (e === n)
1371
- return { valid: !0, data: e };
1372
- if (e instanceof Date && n instanceof Date && +e == +n)
1373
- return { valid: !0, data: e };
1374
- if (U(e) && U(n)) {
1375
- const t = Object.keys(n), r = Object.keys(e).filter((i) => t.indexOf(i) !== -1), o = { ...e, ...n };
1376
- for (const i of r) {
1377
- const c = ce(e[i], n[i]);
1378
- if (!c.valid)
1379
- return {
1380
- valid: !1,
1381
- mergeErrorPath: [i, ...c.mergeErrorPath]
1382
- };
1383
- o[i] = c.data;
1384
- }
1385
- return { valid: !0, data: o };
1386
- }
1387
- if (Array.isArray(e) && Array.isArray(n)) {
1388
- if (e.length !== n.length)
1389
- return { valid: !1, mergeErrorPath: [] };
1390
- const t = [];
1391
- for (let r = 0; r < e.length; r++) {
1392
- const o = e[r], i = n[r], c = ce(o, i);
1393
- if (!c.valid)
1394
- return {
1395
- valid: !1,
1396
- mergeErrorPath: [r, ...c.mergeErrorPath]
1397
- };
1398
- t.push(c.data);
1399
- }
1400
- return { valid: !0, data: t };
1401
- }
1402
- return { valid: !1, mergeErrorPath: [] };
1403
- }
1404
- function we(e, n, t) {
1405
- if (n.issues.length && e.issues.push(...n.issues), t.issues.length && e.issues.push(...t.issues), N(e))
1406
- return e;
1407
- const r = ce(n.value, t.value);
1408
- if (!r.valid)
1409
- throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
1410
- return e.value = r.data, e;
1411
- }
1412
- const or = /* @__PURE__ */ s("$ZodEnum", (e, n) => {
1413
- b.init(e, n);
1414
- const t = dn(n.entries), r = new Set(t);
1415
- e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((o) => _n.has(typeof o)).map((o) => typeof o == "string" ? q(o) : o.toString()).join("|")})$`), e._zod.parse = (o, i) => {
1416
- const c = o.value;
1417
- return r.has(c) || o.issues.push({
1418
- code: "invalid_value",
1419
- values: t,
1420
- input: c,
1421
- inst: e
1422
- }), o;
1423
- };
1424
- }), ir = /* @__PURE__ */ s("$ZodTransform", (e, n) => {
1425
- b.init(e, n), e._zod.parse = (t, r) => {
1426
- if (r.direction === "backward")
1427
- throw new Fe(e.constructor.name);
1428
- const o = n.transform(t.value, t);
1429
- if (r.async)
1430
- return (o instanceof Promise ? o : Promise.resolve(o)).then((c) => (t.value = c, t));
1431
- if (o instanceof Promise)
1432
- throw new D();
1433
- return t.value = o, t;
1434
- };
1435
- });
1436
- function $e(e, n) {
1437
- return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
1438
- }
1439
- const cr = /* @__PURE__ */ s("$ZodOptional", (e, n) => {
1440
- b.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", _(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), _(e._zod, "pattern", () => {
1441
- const t = n.innerType._zod.pattern;
1442
- return t ? new RegExp(`^(${fe(t.source)})?$`) : void 0;
1443
- }), e._zod.parse = (t, r) => {
1444
- if (n.innerType._zod.optin === "optional") {
1445
- const o = n.innerType._zod.run(t, r);
1446
- return o instanceof Promise ? o.then((i) => $e(i, t.value)) : $e(o, t.value);
1447
- }
1448
- return t.value === void 0 ? t : n.innerType._zod.run(t, r);
1449
- };
1450
- }), ur = /* @__PURE__ */ s("$ZodNullable", (e, n) => {
1451
- b.init(e, n), _(e._zod, "optin", () => n.innerType._zod.optin), _(e._zod, "optout", () => n.innerType._zod.optout), _(e._zod, "pattern", () => {
1452
- const t = n.innerType._zod.pattern;
1453
- return t ? new RegExp(`^(${fe(t.source)}|null)$`) : void 0;
1454
- }), _(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, null]) : void 0), e._zod.parse = (t, r) => t.value === null ? t : n.innerType._zod.run(t, r);
1455
- }), sr = /* @__PURE__ */ s("$ZodDefault", (e, n) => {
1456
- b.init(e, n), e._zod.optin = "optional", _(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1457
- if (r.direction === "backward")
1458
- return n.innerType._zod.run(t, r);
1459
- if (t.value === void 0)
1460
- return t.value = n.defaultValue, t;
1461
- const o = n.innerType._zod.run(t, r);
1462
- return o instanceof Promise ? o.then((i) => ke(i, n)) : ke(o, n);
1463
- };
1464
- });
1465
- function ke(e, n) {
1466
- return e.value === void 0 && (e.value = n.defaultValue), e;
1467
- }
1468
- const ar = /* @__PURE__ */ s("$ZodPrefault", (e, n) => {
1469
- b.init(e, n), e._zod.optin = "optional", _(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => (r.direction === "backward" || t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, r));
1470
- }), lr = /* @__PURE__ */ s("$ZodNonOptional", (e, n) => {
1471
- b.init(e, n), _(e._zod, "values", () => {
1472
- const t = n.innerType._zod.values;
1473
- return t ? new Set([...t].filter((r) => r !== void 0)) : void 0;
1474
- }), e._zod.parse = (t, r) => {
1475
- const o = n.innerType._zod.run(t, r);
1476
- return o instanceof Promise ? o.then((i) => Ze(i, e)) : Ze(o, e);
1477
- };
1478
- });
1479
- function Ze(e, n) {
1480
- return !e.issues.length && e.value === void 0 && e.issues.push({
1481
- code: "invalid_type",
1482
- expected: "nonoptional",
1483
- input: e.value,
1484
- inst: n
1485
- }), e;
1486
- }
1487
- const fr = /* @__PURE__ */ s("$ZodCatch", (e, n) => {
1488
- b.init(e, n), _(e._zod, "optin", () => n.innerType._zod.optin), _(e._zod, "optout", () => n.innerType._zod.optout), _(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1489
- if (r.direction === "backward")
1490
- return n.innerType._zod.run(t, r);
1491
- const o = n.innerType._zod.run(t, r);
1492
- return o instanceof Promise ? o.then((i) => (t.value = i.value, i.issues.length && (t.value = n.catchValue({
1493
- ...t,
1494
- error: {
1495
- issues: i.issues.map((c) => C(c, r, R()))
1496
- },
1497
- input: t.value
1498
- }), t.issues = []), t)) : (t.value = o.value, o.issues.length && (t.value = n.catchValue({
1499
- ...t,
1500
- error: {
1501
- issues: o.issues.map((i) => C(i, r, R()))
1502
- },
1503
- input: t.value
1504
- }), t.issues = []), t);
1505
- };
1506
- }), dr = /* @__PURE__ */ s("$ZodPipe", (e, n) => {
1507
- b.init(e, n), _(e._zod, "values", () => n.in._zod.values), _(e._zod, "optin", () => n.in._zod.optin), _(e._zod, "optout", () => n.out._zod.optout), _(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
1508
- if (r.direction === "backward") {
1509
- const i = n.out._zod.run(t, r);
1510
- return i instanceof Promise ? i.then((c) => W(c, n.in, r)) : W(i, n.in, r);
1511
- }
1512
- const o = n.in._zod.run(t, r);
1513
- return o instanceof Promise ? o.then((i) => W(i, n.out, r)) : W(o, n.out, r);
1514
- };
1515
- });
1516
- function W(e, n, t) {
1517
- return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ value: e.value, issues: e.issues }, t);
1518
- }
1519
- const hr = /* @__PURE__ */ s("$ZodReadonly", (e, n) => {
1520
- b.init(e, n), _(e._zod, "propValues", () => n.innerType._zod.propValues), _(e._zod, "values", () => n.innerType._zod.values), _(e._zod, "optin", () => n.innerType._zod.optin), _(e._zod, "optout", () => n.innerType._zod.optout), e._zod.parse = (t, r) => {
1521
- if (r.direction === "backward")
1522
- return n.innerType._zod.run(t, r);
1523
- const o = n.innerType._zod.run(t, r);
1524
- return o instanceof Promise ? o.then(ye) : ye(o);
1525
- };
1526
- });
1527
- function ye(e) {
1528
- return e.value = Object.freeze(e.value), e;
1529
- }
1530
- const pr = /* @__PURE__ */ s("$ZodCustom", (e, n) => {
1531
- k.init(e, n), b.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
1532
- const r = t.value, o = n.fn(r);
1533
- if (o instanceof Promise)
1534
- return o.then((i) => Ie(i, t, r, e));
1535
- Ie(o, t, r, e);
1536
- };
1537
- });
1538
- function Ie(e, n, t, r) {
1539
- if (!e) {
1540
- const o = {
1541
- code: "custom",
1542
- input: t,
1543
- inst: r,
1544
- // incorporates params.error into issue reporting
1545
- path: [...r._zod.def.path ?? []],
1546
- // incorporates params.error into issue reporting
1547
- continue: !r._zod.def.abort
1548
- // params: inst._zod.def.params,
1549
- };
1550
- r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(L(o));
1551
- }
1552
- }
1553
- class mr {
1554
- constructor() {
1555
- this._map = /* @__PURE__ */ new Map(), this._idmap = /* @__PURE__ */ new Map();
1556
- }
1557
- add(n, ...t) {
1558
- const r = t[0];
1559
- if (this._map.set(n, r), r && typeof r == "object" && "id" in r) {
1560
- if (this._idmap.has(r.id))
1561
- throw new Error(`ID ${r.id} already exists in the registry`);
1562
- this._idmap.set(r.id, n);
1563
- }
1564
- return this;
1565
- }
1566
- clear() {
1567
- return this._map = /* @__PURE__ */ new Map(), this._idmap = /* @__PURE__ */ new Map(), this;
1568
- }
1569
- remove(n) {
1570
- const t = this._map.get(n);
1571
- return t && typeof t == "object" && "id" in t && this._idmap.delete(t.id), this._map.delete(n), this;
1572
- }
1573
- get(n) {
1574
- const t = n._zod.parent;
1575
- if (t) {
1576
- const r = { ...this.get(t) ?? {} };
1577
- delete r.id;
1578
- const o = { ...r, ...this._map.get(n) };
1579
- return Object.keys(o).length ? o : void 0;
1580
- }
1581
- return this._map.get(n);
1582
- }
1583
- has(n) {
1584
- return this._map.has(n);
1585
- }
1586
- }
1587
- function _r() {
1588
- return new mr();
1589
- }
1590
- const J = /* @__PURE__ */ _r();
1591
- function gr(e, n) {
1592
- return new e({
1593
- type: "string",
1594
- ...f(n)
1595
- });
1596
- }
1597
- function vr(e, n) {
1598
- return new e({
1599
- type: "string",
1600
- format: "email",
1601
- check: "string_format",
1602
- abort: !1,
1603
- ...f(n)
1604
- });
1605
- }
1606
- function Ee(e, n) {
1607
- return new e({
1608
- type: "string",
1609
- format: "guid",
1610
- check: "string_format",
1611
- abort: !1,
1612
- ...f(n)
1613
- });
1614
- }
1615
- function zr(e, n) {
1616
- return new e({
1617
- type: "string",
1618
- format: "uuid",
1619
- check: "string_format",
1620
- abort: !1,
1621
- ...f(n)
1622
- });
1623
- }
1624
- function br(e, n) {
1625
- return new e({
1626
- type: "string",
1627
- format: "uuid",
1628
- check: "string_format",
1629
- abort: !1,
1630
- version: "v4",
1631
- ...f(n)
1632
- });
1633
- }
1634
- function wr(e, n) {
1635
- return new e({
1636
- type: "string",
1637
- format: "uuid",
1638
- check: "string_format",
1639
- abort: !1,
1640
- version: "v6",
1641
- ...f(n)
1642
- });
1643
- }
1644
- function $r(e, n) {
1645
- return new e({
1646
- type: "string",
1647
- format: "uuid",
1648
- check: "string_format",
1649
- abort: !1,
1650
- version: "v7",
1651
- ...f(n)
1652
- });
1653
- }
1654
- function kr(e, n) {
1655
- return new e({
1656
- type: "string",
1657
- format: "url",
1658
- check: "string_format",
1659
- abort: !1,
1660
- ...f(n)
1661
- });
1662
- }
1663
- function Zr(e, n) {
1664
- return new e({
1665
- type: "string",
1666
- format: "emoji",
1667
- check: "string_format",
1668
- abort: !1,
1669
- ...f(n)
1670
- });
1671
- }
1672
- function yr(e, n) {
1673
- return new e({
1674
- type: "string",
1675
- format: "nanoid",
1676
- check: "string_format",
1677
- abort: !1,
1678
- ...f(n)
1679
- });
1680
- }
1681
- function Ir(e, n) {
1682
- return new e({
1683
- type: "string",
1684
- format: "cuid",
1685
- check: "string_format",
1686
- abort: !1,
1687
- ...f(n)
1688
- });
1689
- }
1690
- function Er(e, n) {
1691
- return new e({
1692
- type: "string",
1693
- format: "cuid2",
1694
- check: "string_format",
1695
- abort: !1,
1696
- ...f(n)
1697
- });
1698
- }
1699
- function Pr(e, n) {
1700
- return new e({
1701
- type: "string",
1702
- format: "ulid",
1703
- check: "string_format",
1704
- abort: !1,
1705
- ...f(n)
1706
- });
1707
- }
1708
- function xr(e, n) {
1709
- return new e({
1710
- type: "string",
1711
- format: "xid",
1712
- check: "string_format",
1713
- abort: !1,
1714
- ...f(n)
1715
- });
1716
- }
1717
- function Tr(e, n) {
1718
- return new e({
1719
- type: "string",
1720
- format: "ksuid",
1721
- check: "string_format",
1722
- abort: !1,
1723
- ...f(n)
1724
- });
1725
- }
1726
- function jr(e, n) {
1727
- return new e({
1728
- type: "string",
1729
- format: "ipv4",
1730
- check: "string_format",
1731
- abort: !1,
1732
- ...f(n)
1733
- });
1734
- }
1735
- function Or(e, n) {
1736
- return new e({
1737
- type: "string",
1738
- format: "ipv6",
1739
- check: "string_format",
1740
- abort: !1,
1741
- ...f(n)
1742
- });
1743
- }
1744
- function Rr(e, n) {
1745
- return new e({
1746
- type: "string",
1747
- format: "cidrv4",
1748
- check: "string_format",
1749
- abort: !1,
1750
- ...f(n)
1751
- });
1752
- }
1753
- function Cr(e, n) {
1754
- return new e({
1755
- type: "string",
1756
- format: "cidrv6",
1757
- check: "string_format",
1758
- abort: !1,
1759
- ...f(n)
1760
- });
1761
- }
1762
- function Ar(e, n) {
1763
- return new e({
1764
- type: "string",
1765
- format: "base64",
1766
- check: "string_format",
1767
- abort: !1,
1768
- ...f(n)
1769
- });
1770
- }
1771
- function Sr(e, n) {
1772
- return new e({
1773
- type: "string",
1774
- format: "base64url",
1775
- check: "string_format",
1776
- abort: !1,
1777
- ...f(n)
1778
- });
1779
- }
1780
- function Nr(e, n) {
1781
- return new e({
1782
- type: "string",
1783
- format: "e164",
1784
- check: "string_format",
1785
- abort: !1,
1786
- ...f(n)
1787
- });
1788
- }
1789
- function Dr(e, n) {
1790
- return new e({
1791
- type: "string",
1792
- format: "jwt",
1793
- check: "string_format",
1794
- abort: !1,
1795
- ...f(n)
1796
- });
1797
- }
1798
- function Fr(e, n) {
1799
- return new e({
1800
- type: "string",
1801
- format: "datetime",
1802
- check: "string_format",
1803
- offset: !1,
1804
- local: !1,
1805
- precision: null,
1806
- ...f(n)
1807
- });
1808
- }
1809
- function Ur(e, n) {
1810
- return new e({
1811
- type: "string",
1812
- format: "date",
1813
- check: "string_format",
1814
- ...f(n)
1815
- });
1816
- }
1817
- function Lr(e, n) {
1818
- return new e({
1819
- type: "string",
1820
- format: "time",
1821
- check: "string_format",
1822
- precision: null,
1823
- ...f(n)
1824
- });
1825
- }
1826
- function Vr(e, n) {
1827
- return new e({
1828
- type: "string",
1829
- format: "duration",
1830
- check: "string_format",
1831
- ...f(n)
1832
- });
1833
- }
1834
- function Gr(e, n) {
1835
- return new e({
1836
- type: "number",
1837
- checks: [],
1838
- ...f(n)
1839
- });
1840
- }
1841
- function Wr(e, n) {
1842
- return new e({
1843
- type: "number",
1844
- check: "number_format",
1845
- abort: !1,
1846
- format: "safeint",
1847
- ...f(n)
1848
- });
1849
- }
1850
- function Jr(e) {
1851
- return new e({
1852
- type: "any"
1853
- });
1854
- }
1855
- function Mr(e) {
1856
- return new e({
1857
- type: "unknown"
1858
- });
1859
- }
1860
- function Yr(e, n) {
1861
- return new e({
1862
- type: "never",
1863
- ...f(n)
1864
- });
1865
- }
1866
- function Pe(e, n) {
1867
- return new qe({
1868
- check: "less_than",
1869
- ...f(n),
1870
- value: e,
1871
- inclusive: !1
1872
- });
1873
- }
1874
- function re(e, n) {
1875
- return new qe({
1876
- check: "less_than",
1877
- ...f(n),
1878
- value: e,
1879
- inclusive: !0
1880
- });
1881
- }
1882
- function xe(e, n) {
1883
- return new He({
1884
- check: "greater_than",
1885
- ...f(n),
1886
- value: e,
1887
- inclusive: !1
1888
- });
1889
- }
1890
- function oe(e, n) {
1891
- return new He({
1892
- check: "greater_than",
1893
- ...f(n),
1894
- value: e,
1895
- inclusive: !0
1896
- });
1897
- }
1898
- function Te(e, n) {
1899
- return new lt({
1900
- check: "multiple_of",
1901
- ...f(n),
1902
- value: e
1903
- });
1904
- }
1905
- function rn(e, n) {
1906
- return new dt({
1907
- check: "max_length",
1908
- ...f(n),
1909
- maximum: e
1910
- });
1911
- }
1912
- function X(e, n) {
1913
- return new ht({
1914
- check: "min_length",
1915
- ...f(n),
1916
- minimum: e
1917
- });
1918
- }
1919
- function on(e, n) {
1920
- return new pt({
1921
- check: "length_equals",
1922
- ...f(n),
1923
- length: e
1924
- });
1925
- }
1926
- function Kr(e, n) {
1927
- return new mt({
1928
- check: "string_format",
1929
- format: "regex",
1930
- ...f(n),
1931
- pattern: e
1932
- });
1933
- }
1934
- function Br(e) {
1935
- return new _t({
1936
- check: "string_format",
1937
- format: "lowercase",
1938
- ...f(e)
1939
- });
1940
- }
1941
- function Xr(e) {
1942
- return new gt({
1943
- check: "string_format",
1944
- format: "uppercase",
1945
- ...f(e)
1946
- });
1947
- }
1948
- function qr(e, n) {
1949
- return new vt({
1950
- check: "string_format",
1951
- format: "includes",
1952
- ...f(n),
1953
- includes: e
1954
- });
1955
- }
1956
- function Hr(e, n) {
1957
- return new zt({
1958
- check: "string_format",
1959
- format: "starts_with",
1960
- ...f(n),
1961
- prefix: e
1962
- });
1963
- }
1964
- function Qr(e, n) {
1965
- return new bt({
1966
- check: "string_format",
1967
- format: "ends_with",
1968
- ...f(n),
1969
- suffix: e
1970
- });
1971
- }
1972
- function V(e) {
1973
- return new wt({
1974
- check: "overwrite",
1975
- tx: e
1976
- });
1977
- }
1978
- function eo(e) {
1979
- return V((n) => n.normalize(e));
1980
- }
1981
- function no() {
1982
- return V((e) => e.trim());
1983
- }
1984
- function to() {
1985
- return V((e) => e.toLowerCase());
1986
- }
1987
- function ro() {
1988
- return V((e) => e.toUpperCase());
1989
- }
1990
- function oo(e, n, t) {
1991
- return new e({
1992
- type: "array",
1993
- element: n,
1994
- // get element() {
1995
- // return element;
1996
- // },
1997
- ...f(t)
1998
- });
1999
- }
2000
- function io(e, n, t) {
2001
- return new e({
2002
- type: "custom",
2003
- check: "custom",
2004
- fn: n,
2005
- ...f(t)
2006
- });
2007
- }
2008
- function co(e) {
2009
- const n = uo((t) => (t.addIssue = (r) => {
2010
- if (typeof r == "string")
2011
- t.issues.push(L(r, t.value, n._zod.def));
2012
- else {
2013
- const o = r;
2014
- o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = t.value), o.inst ?? (o.inst = n), o.continue ?? (o.continue = !n._zod.def.abort), t.issues.push(L(o));
2015
- }
2016
- }, e(t.value, t)));
2017
- return n;
2018
- }
2019
- function uo(e, n) {
2020
- const t = new k({
2021
- check: "custom",
2022
- ...f(n)
2023
- });
2024
- return t._zod.check = e, t;
2025
- }
2026
- const so = /* @__PURE__ */ s("ZodISODateTime", (e, n) => {
2027
- At.init(e, n), v.init(e, n);
2028
- });
2029
- function ao(e) {
2030
- return Fr(so, e);
2031
- }
2032
- const lo = /* @__PURE__ */ s("ZodISODate", (e, n) => {
2033
- St.init(e, n), v.init(e, n);
2034
- });
2035
- function fo(e) {
2036
- return Ur(lo, e);
2037
- }
2038
- const ho = /* @__PURE__ */ s("ZodISOTime", (e, n) => {
2039
- Nt.init(e, n), v.init(e, n);
2040
- });
2041
- function po(e) {
2042
- return Lr(ho, e);
2043
- }
2044
- const mo = /* @__PURE__ */ s("ZodISODuration", (e, n) => {
2045
- Dt.init(e, n), v.init(e, n);
2046
- });
2047
- function _o(e) {
2048
- return Vr(mo, e);
2049
- }
2050
- const go = (e, n) => {
2051
- Je.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
2052
- format: {
2053
- value: (t) => En(e, t)
2054
- // enumerable: false,
2055
- },
2056
- flatten: {
2057
- value: (t) => In(e, t)
2058
- // enumerable: false,
2059
- },
2060
- addIssue: {
2061
- value: (t) => {
2062
- e.issues.push(t), e.message = JSON.stringify(e.issues, ie, 2);
2063
- }
2064
- // enumerable: false,
2065
- },
2066
- addIssues: {
2067
- value: (t) => {
2068
- e.issues.push(...t), e.message = JSON.stringify(e.issues, ie, 2);
2069
- }
2070
- // enumerable: false,
2071
- },
2072
- isEmpty: {
2073
- get() {
2074
- return e.issues.length === 0;
2075
- }
2076
- // enumerable: false,
2077
- }
2078
- });
2079
- }, y = s("ZodError", go, {
2080
- Parent: Error
2081
- }), vo = /* @__PURE__ */ he(y), zo = /* @__PURE__ */ pe(y), bo = /* @__PURE__ */ H(y), wo = /* @__PURE__ */ Q(y), $o = /* @__PURE__ */ Tn(y), ko = /* @__PURE__ */ jn(y), Zo = /* @__PURE__ */ On(y), yo = /* @__PURE__ */ Rn(y), Io = /* @__PURE__ */ Cn(y), Eo = /* @__PURE__ */ An(y), Po = /* @__PURE__ */ Sn(y), xo = /* @__PURE__ */ Nn(y), w = /* @__PURE__ */ s("ZodType", (e, n) => (b.init(e, n), e.def = n, e.type = n.type, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(
2082
- {
2083
- ...n,
2084
- checks: [
2085
- ...n.checks ?? [],
2086
- ...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
2087
- ]
2088
- }
2089
- // { parent: true }
2090
- ), e.clone = (t, r) => T(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) => vo(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => bo(e, t, r), e.parseAsync = async (t, r) => zo(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => wo(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => $o(e, t, r), e.decode = (t, r) => ko(e, t, r), e.encodeAsync = async (t, r) => Zo(e, t, r), e.decodeAsync = async (t, r) => yo(e, t, r), e.safeEncode = (t, r) => Io(e, t, r), e.safeDecode = (t, r) => Eo(e, t, r), e.safeEncodeAsync = async (t, r) => Po(e, t, r), e.safeDecodeAsync = async (t, r) => xo(e, t, r), e.refine = (t, r) => e.check(wi(t, r)), e.superRefine = (t) => e.check($i(t)), e.overwrite = (t) => e.check(V(t)), e.optional = () => Se(e), e.nullable = () => Ne(e), e.nullish = () => Se(Ne(e)), e.nonoptional = (t) => pi(e, t), e.array = () => ei(e), e.or = (t) => ri([e, t]), e.and = (t) => ii(e, t), e.transform = (t) => De(e, si(t)), e.default = (t) => fi(e, t), e.prefault = (t) => hi(e, t), e.catch = (t) => _i(e, t), e.pipe = (t) => De(e, t), e.readonly = () => zi(e), e.describe = (t) => {
2091
- const r = e.clone();
2092
- return J.add(r, { description: t }), r;
2093
- }, Object.defineProperty(e, "description", {
2094
- get() {
2095
- var t;
2096
- return (t = J.get(e)) == null ? void 0 : t.description;
2097
- },
2098
- configurable: !0
2099
- }), e.meta = (...t) => {
2100
- if (t.length === 0)
2101
- return J.get(e);
2102
- const r = e.clone();
2103
- return J.add(r, t[0]), r;
2104
- }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), cn = /* @__PURE__ */ s("_ZodString", (e, n) => {
2105
- me.init(e, n), w.init(e, n);
2106
- const t = e._zod.bag;
2107
- e.format = t.format ?? null, e.minLength = t.minimum ?? null, e.maxLength = t.maximum ?? null, e.regex = (...r) => e.check(Kr(...r)), e.includes = (...r) => e.check(qr(...r)), e.startsWith = (...r) => e.check(Hr(...r)), e.endsWith = (...r) => e.check(Qr(...r)), e.min = (...r) => e.check(X(...r)), e.max = (...r) => e.check(rn(...r)), e.length = (...r) => e.check(on(...r)), e.nonempty = (...r) => e.check(X(1, ...r)), e.lowercase = (r) => e.check(Br(r)), e.uppercase = (r) => e.check(Xr(r)), e.trim = () => e.check(no()), e.normalize = (...r) => e.check(eo(...r)), e.toLowerCase = () => e.check(to()), e.toUpperCase = () => e.check(ro());
2108
- }), To = /* @__PURE__ */ s("ZodString", (e, n) => {
2109
- me.init(e, n), cn.init(e, n), e.email = (t) => e.check(vr(jo, t)), e.url = (t) => e.check(kr(Oo, t)), e.jwt = (t) => e.check(Dr(Yo, t)), e.emoji = (t) => e.check(Zr(Ro, t)), e.guid = (t) => e.check(Ee(je, t)), e.uuid = (t) => e.check(zr(M, t)), e.uuidv4 = (t) => e.check(br(M, t)), e.uuidv6 = (t) => e.check(wr(M, t)), e.uuidv7 = (t) => e.check($r(M, t)), e.nanoid = (t) => e.check(yr(Co, t)), e.guid = (t) => e.check(Ee(je, t)), e.cuid = (t) => e.check(Ir(Ao, t)), e.cuid2 = (t) => e.check(Er(So, t)), e.ulid = (t) => e.check(Pr(No, t)), e.base64 = (t) => e.check(Ar(Wo, t)), e.base64url = (t) => e.check(Sr(Jo, t)), e.xid = (t) => e.check(xr(Do, t)), e.ksuid = (t) => e.check(Tr(Fo, t)), e.ipv4 = (t) => e.check(jr(Uo, t)), e.ipv6 = (t) => e.check(Or(Lo, t)), e.cidrv4 = (t) => e.check(Rr(Vo, t)), e.cidrv6 = (t) => e.check(Cr(Go, t)), e.e164 = (t) => e.check(Nr(Mo, t)), e.datetime = (t) => e.check(ao(t)), e.date = (t) => e.check(fo(t)), e.time = (t) => e.check(po(t)), e.duration = (t) => e.check(_o(t));
2110
- });
2111
- function E(e) {
2112
- return gr(To, e);
2113
- }
2114
- const v = /* @__PURE__ */ s("ZodStringFormat", (e, n) => {
2115
- g.init(e, n), cn.init(e, n);
2116
- }), jo = /* @__PURE__ */ s("ZodEmail", (e, n) => {
2117
- It.init(e, n), v.init(e, n);
2118
- }), je = /* @__PURE__ */ s("ZodGUID", (e, n) => {
2119
- Zt.init(e, n), v.init(e, n);
2120
- }), M = /* @__PURE__ */ s("ZodUUID", (e, n) => {
2121
- yt.init(e, n), v.init(e, n);
2122
- }), Oo = /* @__PURE__ */ s("ZodURL", (e, n) => {
2123
- Et.init(e, n), v.init(e, n);
2124
- }), Ro = /* @__PURE__ */ s("ZodEmoji", (e, n) => {
2125
- Pt.init(e, n), v.init(e, n);
2126
- }), Co = /* @__PURE__ */ s("ZodNanoID", (e, n) => {
2127
- xt.init(e, n), v.init(e, n);
2128
- }), Ao = /* @__PURE__ */ s("ZodCUID", (e, n) => {
2129
- Tt.init(e, n), v.init(e, n);
2130
- }), So = /* @__PURE__ */ s("ZodCUID2", (e, n) => {
2131
- jt.init(e, n), v.init(e, n);
2132
- }), No = /* @__PURE__ */ s("ZodULID", (e, n) => {
2133
- Ot.init(e, n), v.init(e, n);
2134
- }), Do = /* @__PURE__ */ s("ZodXID", (e, n) => {
2135
- Rt.init(e, n), v.init(e, n);
2136
- }), Fo = /* @__PURE__ */ s("ZodKSUID", (e, n) => {
2137
- Ct.init(e, n), v.init(e, n);
2138
- }), Uo = /* @__PURE__ */ s("ZodIPv4", (e, n) => {
2139
- Ft.init(e, n), v.init(e, n);
2140
- }), Lo = /* @__PURE__ */ s("ZodIPv6", (e, n) => {
2141
- Ut.init(e, n), v.init(e, n);
2142
- }), Vo = /* @__PURE__ */ s("ZodCIDRv4", (e, n) => {
2143
- Lt.init(e, n), v.init(e, n);
2144
- }), Go = /* @__PURE__ */ s("ZodCIDRv6", (e, n) => {
2145
- Vt.init(e, n), v.init(e, n);
2146
- }), Wo = /* @__PURE__ */ s("ZodBase64", (e, n) => {
2147
- Gt.init(e, n), v.init(e, n);
2148
- }), Jo = /* @__PURE__ */ s("ZodBase64URL", (e, n) => {
2149
- Jt.init(e, n), v.init(e, n);
2150
- }), Mo = /* @__PURE__ */ s("ZodE164", (e, n) => {
2151
- Mt.init(e, n), v.init(e, n);
2152
- }), Yo = /* @__PURE__ */ s("ZodJWT", (e, n) => {
2153
- Kt.init(e, n), v.init(e, n);
2154
- }), un = /* @__PURE__ */ s("ZodNumber", (e, n) => {
2155
- en.init(e, n), w.init(e, n), e.gt = (r, o) => e.check(xe(r, o)), e.gte = (r, o) => e.check(oe(r, o)), e.min = (r, o) => e.check(oe(r, o)), e.lt = (r, o) => e.check(Pe(r, o)), e.lte = (r, o) => e.check(re(r, o)), e.max = (r, o) => e.check(re(r, o)), e.int = (r) => e.check(Re(r)), e.safe = (r) => e.check(Re(r)), e.positive = (r) => e.check(xe(0, r)), e.nonnegative = (r) => e.check(oe(0, r)), e.negative = (r) => e.check(Pe(0, r)), e.nonpositive = (r) => e.check(re(0, r)), e.multipleOf = (r, o) => e.check(Te(r, o)), e.step = (r, o) => e.check(Te(r, o)), e.finite = () => e;
2156
- const t = e._zod.bag;
2157
- e.minValue = Math.max(t.minimum ?? Number.NEGATIVE_INFINITY, t.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(t.maximum ?? Number.POSITIVE_INFINITY, t.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (t.format ?? "").includes("int") || Number.isSafeInteger(t.multipleOf ?? 0.5), e.isFinite = !0, e.format = t.format ?? null;
2158
- });
2159
- function Oe(e) {
2160
- return Gr(un, e);
2161
- }
2162
- const Ko = /* @__PURE__ */ s("ZodNumberFormat", (e, n) => {
2163
- Bt.init(e, n), un.init(e, n);
2164
- });
2165
- function Re(e) {
2166
- return Wr(Ko, e);
2167
- }
2168
- const Bo = /* @__PURE__ */ s("ZodAny", (e, n) => {
2169
- Xt.init(e, n), w.init(e, n);
2170
- });
2171
- function Ce() {
2172
- return Jr(Bo);
2173
- }
2174
- const Xo = /* @__PURE__ */ s("ZodUnknown", (e, n) => {
2175
- qt.init(e, n), w.init(e, n);
2176
- });
2177
- function Ae() {
2178
- return Mr(Xo);
2179
- }
2180
- const qo = /* @__PURE__ */ s("ZodNever", (e, n) => {
2181
- Ht.init(e, n), w.init(e, n);
2182
- });
2183
- function Ho(e) {
2184
- return Yr(qo, e);
2185
- }
2186
- const Qo = /* @__PURE__ */ s("ZodArray", (e, n) => {
2187
- Qt.init(e, n), w.init(e, n), e.element = n.element, e.min = (t, r) => e.check(X(t, r)), e.nonempty = (t) => e.check(X(1, t)), e.max = (t, r) => e.check(rn(t, r)), e.length = (t, r) => e.check(on(t, r)), e.unwrap = () => e.element;
2188
- });
2189
- function ei(e, n) {
2190
- return oo(Qo, e, n);
2191
- }
2192
- const ni = /* @__PURE__ */ s("ZodObject", (e, n) => {
2193
- nr.init(e, n), w.init(e, n), _(e, "shape", () => n.shape), e.keyof = () => ci(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ ...e._zod.def, catchall: t }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Ae() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Ae() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Ho() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (t) => wn(e, t), e.safeExtend = (t) => $n(e, t), e.merge = (t) => kn(e, t), e.pick = (t) => zn(e, t), e.omit = (t) => bn(e, t), e.partial = (...t) => Zn(sn, e, t[0]), e.required = (...t) => yn(an, e, t[0]);
2194
- });
2195
- function ue(e, n) {
2196
- const t = {
2197
- type: "object",
2198
- get shape() {
2199
- return x(this, "shape", e ? pn(e) : {}), this.shape;
2200
- },
2201
- ...f(n)
2202
- };
2203
- return new ni(t);
2204
- }
2205
- const ti = /* @__PURE__ */ s("ZodUnion", (e, n) => {
2206
- tr.init(e, n), w.init(e, n), e.options = n.options;
2207
- });
2208
- function ri(e, n) {
2209
- return new ti({
2210
- type: "union",
2211
- options: e,
2212
- ...f(n)
2213
- });
2214
- }
2215
- const oi = /* @__PURE__ */ s("ZodIntersection", (e, n) => {
2216
- rr.init(e, n), w.init(e, n);
2217
- });
2218
- function ii(e, n) {
2219
- return new oi({
2220
- type: "intersection",
2221
- left: e,
2222
- right: n
2223
- });
2224
- }
2225
- const se = /* @__PURE__ */ s("ZodEnum", (e, n) => {
2226
- or.init(e, n), w.init(e, n), e.enum = n.entries, e.options = Object.values(n.entries);
2227
- const t = new Set(Object.keys(n.entries));
2228
- e.extract = (r, o) => {
2229
- const i = {};
2230
- for (const c of r)
2231
- if (t.has(c))
2232
- i[c] = n.entries[c];
2233
- else
2234
- throw new Error(`Key ${c} not found in enum`);
2235
- return new se({
2236
- ...n,
2237
- checks: [],
2238
- ...f(o),
2239
- entries: i
2240
- });
2241
- }, e.exclude = (r, o) => {
2242
- const i = { ...n.entries };
2243
- for (const c of r)
2244
- if (t.has(c))
2245
- delete i[c];
2246
- else
2247
- throw new Error(`Key ${c} not found in enum`);
2248
- return new se({
2249
- ...n,
2250
- checks: [],
2251
- ...f(o),
2252
- entries: i
2253
- });
2254
- };
2255
- });
2256
- function ci(e, n) {
2257
- const t = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
2258
- return new se({
2259
- type: "enum",
2260
- entries: t,
2261
- ...f(n)
2262
- });
2263
- }
2264
- const ui = /* @__PURE__ */ s("ZodTransform", (e, n) => {
2265
- ir.init(e, n), w.init(e, n), e._zod.parse = (t, r) => {
2266
- if (r.direction === "backward")
2267
- throw new Fe(e.constructor.name);
2268
- t.addIssue = (i) => {
2269
- if (typeof i == "string")
2270
- t.issues.push(L(i, t.value, n));
2271
- else {
2272
- const c = i;
2273
- c.fatal && (c.continue = !1), c.code ?? (c.code = "custom"), c.input ?? (c.input = t.value), c.inst ?? (c.inst = e), t.issues.push(L(c));
2274
- }
2275
- };
2276
- const o = n.transform(t.value, t);
2277
- return o instanceof Promise ? o.then((i) => (t.value = i, t)) : (t.value = o, t);
2278
- };
2279
- });
2280
- function si(e) {
2281
- return new ui({
2282
- type: "transform",
2283
- transform: e
2284
- });
2285
- }
2286
- const sn = /* @__PURE__ */ s("ZodOptional", (e, n) => {
2287
- cr.init(e, n), w.init(e, n), e.unwrap = () => e._zod.def.innerType;
2288
- });
2289
- function Se(e) {
2290
- return new sn({
2291
- type: "optional",
2292
- innerType: e
2293
- });
2294
- }
2295
- const ai = /* @__PURE__ */ s("ZodNullable", (e, n) => {
2296
- ur.init(e, n), w.init(e, n), e.unwrap = () => e._zod.def.innerType;
2297
- });
2298
- function Ne(e) {
2299
- return new ai({
2300
- type: "nullable",
2301
- innerType: e
2302
- });
2303
- }
2304
- const li = /* @__PURE__ */ s("ZodDefault", (e, n) => {
2305
- sr.init(e, n), w.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
2306
- });
2307
- function fi(e, n) {
2308
- return new li({
2309
- type: "default",
2310
- innerType: e,
2311
- get defaultValue() {
2312
- return typeof n == "function" ? n() : Ve(n);
2313
- }
2314
- });
2315
- }
2316
- const di = /* @__PURE__ */ s("ZodPrefault", (e, n) => {
2317
- ar.init(e, n), w.init(e, n), e.unwrap = () => e._zod.def.innerType;
2318
- });
2319
- function hi(e, n) {
2320
- return new di({
2321
- type: "prefault",
2322
- innerType: e,
2323
- get defaultValue() {
2324
- return typeof n == "function" ? n() : Ve(n);
2325
- }
2326
- });
2327
- }
2328
- const an = /* @__PURE__ */ s("ZodNonOptional", (e, n) => {
2329
- lr.init(e, n), w.init(e, n), e.unwrap = () => e._zod.def.innerType;
2330
- });
2331
- function pi(e, n) {
2332
- return new an({
2333
- type: "nonoptional",
2334
- innerType: e,
2335
- ...f(n)
2336
- });
2337
- }
2338
- const mi = /* @__PURE__ */ s("ZodCatch", (e, n) => {
2339
- fr.init(e, n), w.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
2340
- });
2341
- function _i(e, n) {
2342
- return new mi({
2343
- type: "catch",
2344
- innerType: e,
2345
- catchValue: typeof n == "function" ? n : () => n
2346
- });
2347
- }
2348
- const gi = /* @__PURE__ */ s("ZodPipe", (e, n) => {
2349
- dr.init(e, n), w.init(e, n), e.in = n.in, e.out = n.out;
2350
- });
2351
- function De(e, n) {
2352
- return new gi({
2353
- type: "pipe",
2354
- in: e,
2355
- out: n
2356
- // ...util.normalizeParams(params),
2357
- });
2358
- }
2359
- const vi = /* @__PURE__ */ s("ZodReadonly", (e, n) => {
2360
- hr.init(e, n), w.init(e, n), e.unwrap = () => e._zod.def.innerType;
2361
- });
2362
- function zi(e) {
2363
- return new vi({
2364
- type: "readonly",
2365
- innerType: e
2366
- });
2367
- }
2368
- const bi = /* @__PURE__ */ s("ZodCustom", (e, n) => {
2369
- pr.init(e, n), w.init(e, n);
2370
- });
2371
- function wi(e, n = {}) {
2372
- return io(bi, e, n);
2373
- }
2374
- function $i(e) {
2375
- return co(e);
2376
- }
2377
- const P = ({
2378
- name: e,
2379
- extension: n,
2380
- entityId: t,
2381
- prefixe: r,
2382
- bucketFolder: o,
2383
- uploadUrl: i
2384
- }) => `${i}/${o}/${t}/${e}-${r}.${n}`, ki = (e, n) => {
2385
- try {
2386
- return ue({
2387
- altRU: E().optional().nullable(),
2388
- altEN: E().optional().nullable(),
2389
- name: E(),
2390
- originalFileExtension: E(),
2391
- fileExtensions: E().array()
2392
- }).parse(e), !0;
2393
- } catch (t) {
2394
- return n({ error: t }), !1;
2395
- }
2396
- }, Oi = ({
2397
- images: e,
2398
- bucketFolder: n,
2399
- uploadUrl: t,
2400
- getError: r
2401
- }) => {
2402
- if (!e) return [];
2403
- try {
2404
- const o = JSON.parse(e);
2405
- return Array.isArray(o) ? o.map((c) => {
2406
- if (!ki(c, r)) return null;
2407
- const u = c.originalFileExtension === "png" ? "image/png" : "image/jpeg", a = c.fileExtensions[0], l = c.fileExtensions[1], d = Y(c.prefixes, "1hd"), p = Y(c.prefixes, "2hd"), m = Y(c.prefixes, "0.5hd"), h = Y(c.prefixes, "1hd"), z = P({
2408
- name: c.name,
2409
- extension: l,
2410
- entityId: c.entityId,
2411
- prefixe: d,
2412
- bucketFolder: n,
2413
- uploadUrl: t
2414
- }), $ = P({
2415
- name: c.name,
2416
- extension: a,
2417
- entityId: c.entityId,
2418
- prefixe: d,
2419
- bucketFolder: n,
2420
- uploadUrl: t
2421
- }), j = P({
2422
- name: c.name,
2423
- extension: l,
2424
- entityId: c.entityId,
2425
- prefixe: p,
2426
- bucketFolder: n,
2427
- uploadUrl: t
2428
- }), ne = P({
2429
- name: c.name,
2430
- extension: a,
2431
- entityId: c.entityId,
2432
- prefixe: p,
2433
- bucketFolder: n,
2434
- uploadUrl: t
2435
- }), te = P({
2436
- name: c.name,
2437
- extension: l,
2438
- entityId: c.entityId,
2439
- prefixe: m,
2440
- bucketFolder: n,
2441
- uploadUrl: t
2442
- }), I = P({
2443
- name: c.name,
2444
- extension: a,
2445
- entityId: c.entityId,
2446
- prefixe: m,
2447
- bucketFolder: n,
2448
- uploadUrl: t
2449
- }), Z = P({
2450
- name: c.name,
2451
- extension: l,
2452
- entityId: c.entityId,
2453
- prefixe: h,
2454
- bucketFolder: n,
2455
- uploadUrl: t
2456
- }), O = P({
2457
- name: c.name,
2458
- extension: a,
2459
- entityId: c.entityId,
2460
- prefixe: h,
2461
- bucketFolder: n,
2462
- uploadUrl: t
2463
- });
2464
- return {
2465
- image1x: z,
2466
- image2x: j,
2467
- image1xWebp: $,
2468
- image2xWebp: ne,
2469
- mobileImage1x: te,
2470
- mobileImage2x: Z,
2471
- mobileImage1xWebp: I,
2472
- mobileImage2xWebp: O,
2473
- altRU: c.altRU,
2474
- altEN: c.altEN,
2475
- type: u
2476
- };
2477
- }).filter((c) => !!c) : [];
2478
- } catch (o) {
2479
- return r({ error: o }), [];
2480
- }
2481
- }, Y = (e, n) => {
2482
- switch (n) {
2483
- case "original":
2484
- return e[0] ?? "";
2485
- case "0.25hd":
2486
- return e[1] ?? "";
2487
- case "0.5hd":
2488
- return e[2] ?? "";
2489
- case "1hd":
2490
- return e[3] ?? "";
2491
- case "2hd":
2492
- return e[4] ?? "";
2493
- case "4hd":
2494
- return e[5] ?? "";
2495
- }
2496
- }, Ri = ue({
2497
- statusCode: Oe().optional(),
2498
- message: E().optional().nullable(),
2499
- messages: E().array().optional().nullable(),
2500
- data: Ce().optional().nullable(),
2501
- error: ue({
2502
- statusCode: Oe(),
2503
- message: E().optional().nullable(),
2504
- messages: E().array().optional().nullable()
2505
- }).optional().nullable(),
2506
- response: Ce().optional().nullable()
2507
- }), Ci = ({
2508
- imgProps: e,
2509
- image1x: n,
2510
- image2x: t,
2511
- image1xWebp: r,
2512
- image2xWebp: o,
2513
- mobileImage1x: i,
2514
- mobileImage2x: c,
2515
- mobileImage1xWebp: u,
2516
- mobileImage2xWebp: a,
2517
- type: l,
2518
- alt: d,
2519
- bgColorClass: p,
2520
- mobileMaxWidth: m = 450,
2521
- loading: h = "lazy",
2522
- ...z
2523
- }) => /* @__PURE__ */ A.jsxs("picture", { ...z, children: [
2524
- i && /* @__PURE__ */ A.jsx(
2525
- "source",
2526
- {
2527
- srcSet: `${i} 1x${c ? `, ${c} 2x` : ""}`,
2528
- media: `(max-width: ${m}px)`,
2529
- type: l
2530
- }
2531
- ),
2532
- u && /* @__PURE__ */ A.jsx(
2533
- "source",
2534
- {
2535
- srcSet: `${u} 1x${a ? `, ${a} 2x` : ""}`,
2536
- media: `(max-width: ${m}px)`,
2537
- type: "image/webp"
2538
- }
2539
- ),
2540
- r && /* @__PURE__ */ A.jsx(
2541
- "source",
2542
- {
2543
- srcSet: `${r} 1x${o ? `, ${o} 2x` : ""}`,
2544
- type: "image/webp"
2545
- }
2546
- ),
2547
- /* @__PURE__ */ A.jsx("source", { srcSet: `${n} 1x${t ? `, ${t} 2x` : ""}`, type: l }),
2548
- /* @__PURE__ */ A.jsx(
2549
- "img",
2550
- {
2551
- ...e,
2552
- className: ln(p, e == null ? void 0 : e.className),
2553
- src: r || n,
2554
- alt: d,
2555
- loading: h
2556
- }
2557
- )
2558
- ] });
2559
- export {
2560
- Ci as B,
2561
- fn as a,
2562
- Ei as b,
2563
- Ii as c,
2564
- xi as d,
2565
- Ti as e,
2566
- ji as f,
2567
- yi as g,
2568
- P as h,
2569
- ki as i,
2570
- Oi as j,
2571
- Y as k,
2572
- Pi as p,
2573
- Ri as r,
2574
- S as u
2575
- };