@jsdev_ninja/core 0.11.1 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.es.js CHANGED
@@ -13,9 +13,9 @@ var b;
13
13
  a[o] = o;
14
14
  return a;
15
15
  }, r.getValidEnumValues = (s) => {
16
- const a = r.objectKeys(s).filter((d) => typeof s[s[d]] != "number"), o = {};
17
- for (const d of a)
18
- o[d] = s[d];
16
+ const a = r.objectKeys(s).filter((i) => typeof s[s[i]] != "number"), o = {};
17
+ for (const i of a)
18
+ o[i] = s[i];
19
19
  return r.objectValues(o);
20
20
  }, r.objectValues = (s) => r.objectKeys(s).map(function(a) {
21
21
  return s[a];
@@ -34,14 +34,14 @@ var b;
34
34
  }
35
35
  r.joinValues = n, r.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
36
36
  })(b || (b = {}));
37
- var Ze;
37
+ var Ne;
38
38
  (function(r) {
39
39
  r.mergeShapes = (e, t) => ({
40
40
  ...e,
41
41
  ...t
42
42
  // second overwrites first
43
43
  });
44
- })(Ze || (Ze = {}));
44
+ })(Ne || (Ne = {}));
45
45
  const h = b.arrayToEnum([
46
46
  "string",
47
47
  "nan",
@@ -63,7 +63,7 @@ const h = b.arrayToEnum([
63
63
  "never",
64
64
  "map",
65
65
  "set"
66
- ]), R = (r) => {
66
+ ]), V = (r) => {
67
67
  switch (typeof r) {
68
68
  case "undefined":
69
69
  return h.undefined;
@@ -84,7 +84,7 @@ const h = b.arrayToEnum([
84
84
  default:
85
85
  return h.unknown;
86
86
  }
87
- }, c = b.arrayToEnum([
87
+ }, d = b.arrayToEnum([
88
88
  "invalid_type",
89
89
  "invalid_literal",
90
90
  "custom",
@@ -101,7 +101,7 @@ const h = b.arrayToEnum([
101
101
  "invalid_intersection_types",
102
102
  "not_multiple_of",
103
103
  "not_finite"
104
- ]), Ye = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
104
+ ]), it = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
105
105
  class Z extends Error {
106
106
  get errors() {
107
107
  return this.issues;
@@ -129,10 +129,10 @@ class Z extends Error {
129
129
  else if (o.path.length === 0)
130
130
  n._errors.push(t(o));
131
131
  else {
132
- let d = n, f = 0;
133
- for (; f < o.path.length; ) {
134
- const u = o.path[f];
135
- f === o.path.length - 1 ? (d[u] = d[u] || { _errors: [] }, d[u]._errors.push(t(o))) : d[u] = d[u] || { _errors: [] }, d = d[u], f++;
132
+ let i = n, l = 0;
133
+ for (; l < o.path.length; ) {
134
+ const u = o.path[l];
135
+ l === o.path.length - 1 ? (i[u] = i[u] || { _errors: [] }, i[u]._errors.push(t(o))) : i[u] = i[u] || { _errors: [] }, i = i[u], l++;
136
136
  }
137
137
  }
138
138
  };
@@ -162,55 +162,55 @@ class Z extends Error {
162
162
  }
163
163
  }
164
164
  Z.create = (r) => new Z(r);
165
- const Y = (r, e) => {
165
+ const G = (r, e) => {
166
166
  let t;
167
167
  switch (r.code) {
168
- case c.invalid_type:
168
+ case d.invalid_type:
169
169
  r.received === h.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
170
170
  break;
171
- case c.invalid_literal:
171
+ case d.invalid_literal:
172
172
  t = `Invalid literal value, expected ${JSON.stringify(r.expected, b.jsonStringifyReplacer)}`;
173
173
  break;
174
- case c.unrecognized_keys:
174
+ case d.unrecognized_keys:
175
175
  t = `Unrecognized key(s) in object: ${b.joinValues(r.keys, ", ")}`;
176
176
  break;
177
- case c.invalid_union:
177
+ case d.invalid_union:
178
178
  t = "Invalid input";
179
179
  break;
180
- case c.invalid_union_discriminator:
180
+ case d.invalid_union_discriminator:
181
181
  t = `Invalid discriminator value. Expected ${b.joinValues(r.options)}`;
182
182
  break;
183
- case c.invalid_enum_value:
183
+ case d.invalid_enum_value:
184
184
  t = `Invalid enum value. Expected ${b.joinValues(r.options)}, received '${r.received}'`;
185
185
  break;
186
- case c.invalid_arguments:
186
+ case d.invalid_arguments:
187
187
  t = "Invalid function arguments";
188
188
  break;
189
- case c.invalid_return_type:
189
+ case d.invalid_return_type:
190
190
  t = "Invalid function return type";
191
191
  break;
192
- case c.invalid_date:
192
+ case d.invalid_date:
193
193
  t = "Invalid date";
194
194
  break;
195
- case c.invalid_string:
195
+ case d.invalid_string:
196
196
  typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : b.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
197
197
  break;
198
- case c.too_small:
198
+ case d.too_small:
199
199
  r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
200
200
  break;
201
- case c.too_big:
201
+ case d.too_big:
202
202
  r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "bigint" ? t = `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r.maximum))}` : t = "Invalid input";
203
203
  break;
204
- case c.custom:
204
+ case d.custom:
205
205
  t = "Invalid input";
206
206
  break;
207
- case c.invalid_intersection_types:
207
+ case d.invalid_intersection_types:
208
208
  t = "Intersection results could not be merged";
209
209
  break;
210
- case c.not_multiple_of:
210
+ case d.not_multiple_of:
211
211
  t = `Number must be a multiple of ${r.multipleOf}`;
212
212
  break;
213
- case c.not_finite:
213
+ case d.not_finite:
214
214
  t = "Number must be finite";
215
215
  break;
216
216
  default:
@@ -218,14 +218,14 @@ const Y = (r, e) => {
218
218
  }
219
219
  return { message: t };
220
220
  };
221
- let $e = Y;
222
- function He(r) {
223
- $e = r;
221
+ let Ue = G;
222
+ function ot(r) {
223
+ Ue = r;
224
224
  }
225
- function pe() {
226
- return $e;
225
+ function _e() {
226
+ return Ue;
227
227
  }
228
- const ye = (r) => {
228
+ const be = (r) => {
229
229
  const { data: e, path: t, errorMaps: n, issueData: s } = r, a = [...t, ...s.path || []], o = {
230
230
  ...s,
231
231
  path: a
@@ -236,18 +236,18 @@ const ye = (r) => {
236
236
  path: a,
237
237
  message: s.message
238
238
  };
239
- let d = "";
240
- const f = n.filter((u) => !!u).slice().reverse();
241
- for (const u of f)
242
- d = u(o, { data: e, defaultError: d }).message;
239
+ let i = "";
240
+ const l = n.filter((u) => !!u).slice().reverse();
241
+ for (const u of l)
242
+ i = u(o, { data: e, defaultError: i }).message;
243
243
  return {
244
244
  ...s,
245
245
  path: a,
246
- message: d
246
+ message: i
247
247
  };
248
- }, Ge = [];
249
- function l(r, e) {
250
- const t = pe(), n = ye({
248
+ }, ct = [];
249
+ function f(r, e) {
250
+ const t = _e(), n = be({
251
251
  issueData: e,
252
252
  data: r.data,
253
253
  path: r.path,
@@ -258,13 +258,13 @@ function l(r, e) {
258
258
  // then schema-bound map if available
259
259
  t,
260
260
  // then global override map
261
- t === Y ? void 0 : Y
261
+ t === G ? void 0 : G
262
262
  // then global default map
263
263
  ].filter((s) => !!s)
264
264
  });
265
265
  r.common.issues.push(n);
266
266
  }
267
- class w {
267
+ class C {
268
268
  constructor() {
269
269
  this.value = "valid";
270
270
  }
@@ -292,7 +292,7 @@ class w {
292
292
  value: o
293
293
  });
294
294
  }
295
- return w.mergeObjectSync(e, n);
295
+ return C.mergeObjectSync(e, n);
296
296
  }
297
297
  static mergeObjectSync(e, t) {
298
298
  const n = {};
@@ -307,12 +307,12 @@ class w {
307
307
  }
308
308
  const g = Object.freeze({
309
309
  status: "aborted"
310
- }), W = (r) => ({ status: "dirty", value: r }), S = (r) => ({ status: "valid", value: r }), Ce = (r) => r.status === "aborted", Ie = (r) => r.status === "dirty", z = (r) => r.status === "valid", ee = (r) => typeof Promise < "u" && r instanceof Promise;
311
- function ge(r, e, t, n) {
310
+ }), Q = (r) => ({ status: "dirty", value: r }), S = (r) => ({ status: "valid", value: r }), Oe = (r) => r.status === "aborted", je = (r) => r.status === "dirty", B = (r) => r.status === "valid", ne = (r) => typeof Promise < "u" && r instanceof Promise;
311
+ function xe(r, e, t, n) {
312
312
  if (typeof e == "function" ? r !== e || !0 : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
313
313
  return e.get(r);
314
314
  }
315
- function Me(r, e, t, n, s) {
315
+ function Be(r, e, t, n, s) {
316
316
  if (typeof e == "function" ? r !== e || !0 : !e.has(r)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
317
317
  return e.set(r, t), t;
318
318
  }
@@ -320,8 +320,8 @@ var m;
320
320
  (function(r) {
321
321
  r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
322
322
  })(m || (m = {}));
323
- var X, K;
324
- class O {
323
+ var te, re;
324
+ class R {
325
325
  constructor(e, t, n, s) {
326
326
  this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = s;
327
327
  }
@@ -329,8 +329,8 @@ class O {
329
329
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
330
330
  }
331
331
  }
332
- const Ee = (r, e) => {
333
- if (z(e))
332
+ const Le = (r, e) => {
333
+ if (B(e))
334
334
  return { success: !0, data: e.value };
335
335
  if (!r.common.issues.length)
336
336
  throw new Error("Validation failed but no issues detected.");
@@ -350,10 +350,10 @@ function v(r) {
350
350
  const { errorMap: e, invalid_type_error: t, required_error: n, description: s } = r;
351
351
  if (e && (t || n))
352
352
  throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
353
- return e ? { errorMap: e, description: s } : { errorMap: (o, d) => {
354
- var f, u;
353
+ return e ? { errorMap: e, description: s } : { errorMap: (o, i) => {
354
+ var l, u;
355
355
  const { message: p } = r;
356
- return o.code === "invalid_enum_value" ? { message: p ?? d.defaultError } : typeof d.data > "u" ? { message: (f = p ?? n) !== null && f !== void 0 ? f : d.defaultError } : o.code !== "invalid_type" ? { message: d.defaultError } : { message: (u = p ?? t) !== null && u !== void 0 ? u : d.defaultError };
356
+ return o.code === "invalid_enum_value" ? { message: p ?? i.defaultError } : typeof i.data > "u" ? { message: (l = p ?? n) !== null && l !== void 0 ? l : i.defaultError } : o.code !== "invalid_type" ? { message: i.defaultError } : { message: (u = p ?? t) !== null && u !== void 0 ? u : i.defaultError };
357
357
  }, description: s };
358
358
  }
359
359
  class _ {
@@ -361,13 +361,13 @@ class _ {
361
361
  return this._def.description;
362
362
  }
363
363
  _getType(e) {
364
- return R(e.data);
364
+ return V(e.data);
365
365
  }
366
366
  _getOrReturnCtx(e, t) {
367
367
  return t || {
368
368
  common: e.parent.common,
369
369
  data: e.data,
370
- parsedType: R(e.data),
370
+ parsedType: V(e.data),
371
371
  schemaErrorMap: this._def.errorMap,
372
372
  path: e.path,
373
373
  parent: e.parent
@@ -375,11 +375,11 @@ class _ {
375
375
  }
376
376
  _processInputParams(e) {
377
377
  return {
378
- status: new w(),
378
+ status: new C(),
379
379
  ctx: {
380
380
  common: e.parent.common,
381
381
  data: e.data,
382
- parsedType: R(e.data),
382
+ parsedType: V(e.data),
383
383
  schemaErrorMap: this._def.errorMap,
384
384
  path: e.path,
385
385
  parent: e.parent
@@ -388,7 +388,7 @@ class _ {
388
388
  }
389
389
  _parseSync(e) {
390
390
  const t = this._parse(e);
391
- if (ee(t))
391
+ if (ne(t))
392
392
  throw new Error("Synchronous parse encountered promise.");
393
393
  return t;
394
394
  }
@@ -414,9 +414,9 @@ class _ {
414
414
  schemaErrorMap: this._def.errorMap,
415
415
  parent: null,
416
416
  data: e,
417
- parsedType: R(e)
417
+ parsedType: V(e)
418
418
  }, a = this._parseSync({ data: e, path: s.path, parent: s });
419
- return Ee(s, a);
419
+ return Le(s, a);
420
420
  }
421
421
  "~validate"(e) {
422
422
  var t, n;
@@ -429,12 +429,12 @@ class _ {
429
429
  schemaErrorMap: this._def.errorMap,
430
430
  parent: null,
431
431
  data: e,
432
- parsedType: R(e)
432
+ parsedType: V(e)
433
433
  };
434
434
  if (!this["~standard"].async)
435
435
  try {
436
436
  const a = this._parseSync({ data: e, path: [], parent: s });
437
- return z(a) ? {
437
+ return B(a) ? {
438
438
  value: a.value
439
439
  } : {
440
440
  issues: s.common.issues
@@ -445,7 +445,7 @@ class _ {
445
445
  async: !0
446
446
  };
447
447
  }
448
- return this._parseAsync({ data: e, path: [], parent: s }).then((a) => z(a) ? {
448
+ return this._parseAsync({ data: e, path: [], parent: s }).then((a) => B(a) ? {
449
449
  value: a.value
450
450
  } : {
451
451
  issues: s.common.issues
@@ -468,25 +468,25 @@ class _ {
468
468
  schemaErrorMap: this._def.errorMap,
469
469
  parent: null,
470
470
  data: e,
471
- parsedType: R(e)
472
- }, s = this._parse({ data: e, path: n.path, parent: n }), a = await (ee(s) ? s : Promise.resolve(s));
473
- return Ee(n, a);
471
+ parsedType: V(e)
472
+ }, s = this._parse({ data: e, path: n.path, parent: n }), a = await (ne(s) ? s : Promise.resolve(s));
473
+ return Le(n, a);
474
474
  }
475
475
  refine(e, t) {
476
476
  const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
477
477
  return this._refinement((s, a) => {
478
- const o = e(s), d = () => a.addIssue({
479
- code: c.custom,
478
+ const o = e(s), i = () => a.addIssue({
479
+ code: d.custom,
480
480
  ...n(s)
481
481
  });
482
- return typeof Promise < "u" && o instanceof Promise ? o.then((f) => f ? !0 : (d(), !1)) : o ? !0 : (d(), !1);
482
+ return typeof Promise < "u" && o instanceof Promise ? o.then((l) => l ? !0 : (i(), !1)) : o ? !0 : (i(), !1);
483
483
  });
484
484
  }
485
485
  refinement(e, t) {
486
486
  return this._refinement((n, s) => e(n) ? !0 : (s.addIssue(typeof t == "function" ? t(n, s) : t), !1));
487
487
  }
488
488
  _refinement(e) {
489
- return new A({
489
+ return new j({
490
490
  schema: this,
491
491
  typeName: y.ZodEffects,
492
492
  effect: { type: "refinement", refinement: e }
@@ -503,28 +503,28 @@ class _ {
503
503
  };
504
504
  }
505
505
  optional() {
506
- return N.create(this, this._def);
506
+ return E.create(this, this._def);
507
507
  }
508
508
  nullable() {
509
- return D.create(this, this._def);
509
+ return F.create(this, this._def);
510
510
  }
511
511
  nullish() {
512
512
  return this.nullable().optional();
513
513
  }
514
514
  array() {
515
- return I.create(this);
515
+ return O.create(this);
516
516
  }
517
517
  promise() {
518
- return G.create(this, this._def);
518
+ return K.create(this, this._def);
519
519
  }
520
520
  or(e) {
521
- return se.create([this, e], this._def);
521
+ return oe.create([this, e], this._def);
522
522
  }
523
523
  and(e) {
524
- return ae.create(this, e, this._def);
524
+ return ce.create(this, e, this._def);
525
525
  }
526
526
  transform(e) {
527
- return new A({
527
+ return new j({
528
528
  ...v(this._def),
529
529
  schema: this,
530
530
  typeName: y.ZodEffects,
@@ -533,7 +533,7 @@ class _ {
533
533
  }
534
534
  default(e) {
535
535
  const t = typeof e == "function" ? e : () => e;
536
- return new ue({
536
+ return new he({
537
537
  ...v(this._def),
538
538
  innerType: this,
539
539
  defaultValue: t,
@@ -541,7 +541,7 @@ class _ {
541
541
  });
542
542
  }
543
543
  brand() {
544
- return new Ne({
544
+ return new Re({
545
545
  typeName: y.ZodBranded,
546
546
  type: this,
547
547
  ...v(this._def)
@@ -549,7 +549,7 @@ class _ {
549
549
  }
550
550
  catch(e) {
551
551
  const t = typeof e == "function" ? e : () => e;
552
- return new le({
552
+ return new pe({
553
553
  ...v(this._def),
554
554
  innerType: this,
555
555
  catchValue: t,
@@ -564,10 +564,10 @@ class _ {
564
564
  });
565
565
  }
566
566
  pipe(e) {
567
- return he.create(this, e);
567
+ return ye.create(this, e);
568
568
  }
569
569
  readonly() {
570
- return fe.create(this);
570
+ return me.create(this);
571
571
  }
572
572
  isOptional() {
573
573
  return this.safeParse(void 0).success;
@@ -576,26 +576,26 @@ class _ {
576
576
  return this.safeParse(null).success;
577
577
  }
578
578
  }
579
- const Qe = /^c[^\s-]{8,}$/i, Xe = /^[0-9a-z]+$/, Ke = /^[0-9A-HJKMNP-TV-Z]{26}$/i, et = /^[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, tt = /^[a-z0-9_-]{21}$/i, rt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, nt = /^[-+]?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)?)??$/, st = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, at = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
580
- let Te;
581
- const it = /^(?:(?: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])$/, ot = /^(?:(?: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])$/, dt = /^(([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]))$/, ct = /^(([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])$/, ut = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, lt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Ve = "((\\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])))", ft = new RegExp(`^${Ve}$`);
582
- function De(r) {
579
+ const dt = /^c[^\s-]{8,}$/i, ut = /^[0-9a-z]+$/, lt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, ft = /^[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, ht = /^[a-z0-9_-]{21}$/i, pt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, mt = /^[-+]?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)?)??$/, yt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, gt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
580
+ let Ie;
581
+ const vt = /^(?:(?: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])$/, _t = /^(?:(?: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])$/, bt = /^(([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]))$/, xt = /^(([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])$/, kt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, wt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, qe = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Tt = new RegExp(`^${qe}$`);
582
+ function We(r) {
583
583
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
584
584
  return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
585
585
  }
586
- function ht(r) {
587
- return new RegExp(`^${De(r)}$`);
586
+ function Ct(r) {
587
+ return new RegExp(`^${We(r)}$`);
588
588
  }
589
- function Le(r) {
590
- let e = `${Ve}T${De(r)}`;
589
+ function Je(r) {
590
+ let e = `${qe}T${We(r)}`;
591
591
  const t = [];
592
592
  return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
593
593
  }
594
- function mt(r, e) {
595
- return !!((e === "v4" || !e) && it.test(r) || (e === "v6" || !e) && dt.test(r));
594
+ function St(r, e) {
595
+ return !!((e === "v4" || !e) && vt.test(r) || (e === "v6" || !e) && bt.test(r));
596
596
  }
597
- function pt(r, e) {
598
- if (!rt.test(r))
597
+ function Zt(r, e) {
598
+ if (!pt.test(r))
599
599
  return !1;
600
600
  try {
601
601
  const [t] = r.split("."), n = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), s = JSON.parse(atob(n));
@@ -604,25 +604,25 @@ function pt(r, e) {
604
604
  return !1;
605
605
  }
606
606
  }
607
- function yt(r, e) {
608
- return !!((e === "v4" || !e) && ot.test(r) || (e === "v6" || !e) && ct.test(r));
607
+ function It(r, e) {
608
+ return !!((e === "v4" || !e) && _t.test(r) || (e === "v6" || !e) && xt.test(r));
609
609
  }
610
- class C extends _ {
610
+ class N extends _ {
611
611
  _parse(e) {
612
612
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== h.string) {
613
613
  const a = this._getOrReturnCtx(e);
614
- return l(a, {
615
- code: c.invalid_type,
614
+ return f(a, {
615
+ code: d.invalid_type,
616
616
  expected: h.string,
617
617
  received: a.parsedType
618
618
  }), g;
619
619
  }
620
- const n = new w();
620
+ const n = new C();
621
621
  let s;
622
622
  for (const a of this._def.checks)
623
623
  if (a.kind === "min")
624
- e.data.length < a.value && (s = this._getOrReturnCtx(e, s), l(s, {
625
- code: c.too_small,
624
+ e.data.length < a.value && (s = this._getOrReturnCtx(e, s), f(s, {
625
+ code: d.too_small,
626
626
  minimum: a.value,
627
627
  type: "string",
628
628
  inclusive: !0,
@@ -630,8 +630,8 @@ class C extends _ {
630
630
  message: a.message
631
631
  }), n.dirty());
632
632
  else if (a.kind === "max")
633
- e.data.length > a.value && (s = this._getOrReturnCtx(e, s), l(s, {
634
- code: c.too_big,
633
+ e.data.length > a.value && (s = this._getOrReturnCtx(e, s), f(s, {
634
+ code: d.too_big,
635
635
  maximum: a.value,
636
636
  type: "string",
637
637
  inclusive: !0,
@@ -639,16 +639,16 @@ class C extends _ {
639
639
  message: a.message
640
640
  }), n.dirty());
641
641
  else if (a.kind === "length") {
642
- const o = e.data.length > a.value, d = e.data.length < a.value;
643
- (o || d) && (s = this._getOrReturnCtx(e, s), o ? l(s, {
644
- code: c.too_big,
642
+ const o = e.data.length > a.value, i = e.data.length < a.value;
643
+ (o || i) && (s = this._getOrReturnCtx(e, s), o ? f(s, {
644
+ code: d.too_big,
645
645
  maximum: a.value,
646
646
  type: "string",
647
647
  inclusive: !0,
648
648
  exact: !0,
649
649
  message: a.message
650
- }) : d && l(s, {
651
- code: c.too_small,
650
+ }) : i && f(s, {
651
+ code: d.too_small,
652
652
  minimum: a.value,
653
653
  type: "string",
654
654
  inclusive: !0,
@@ -656,108 +656,108 @@ class C extends _ {
656
656
  message: a.message
657
657
  }), n.dirty());
658
658
  } else if (a.kind === "email")
659
- st.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
659
+ yt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
660
660
  validation: "email",
661
- code: c.invalid_string,
661
+ code: d.invalid_string,
662
662
  message: a.message
663
663
  }), n.dirty());
664
664
  else if (a.kind === "emoji")
665
- Te || (Te = new RegExp(at, "u")), Te.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
665
+ Ie || (Ie = new RegExp(gt, "u")), Ie.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
666
666
  validation: "emoji",
667
- code: c.invalid_string,
667
+ code: d.invalid_string,
668
668
  message: a.message
669
669
  }), n.dirty());
670
670
  else if (a.kind === "uuid")
671
- et.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
671
+ ft.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
672
672
  validation: "uuid",
673
- code: c.invalid_string,
673
+ code: d.invalid_string,
674
674
  message: a.message
675
675
  }), n.dirty());
676
676
  else if (a.kind === "nanoid")
677
- tt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
677
+ ht.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
678
678
  validation: "nanoid",
679
- code: c.invalid_string,
679
+ code: d.invalid_string,
680
680
  message: a.message
681
681
  }), n.dirty());
682
682
  else if (a.kind === "cuid")
683
- Qe.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
683
+ dt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
684
684
  validation: "cuid",
685
- code: c.invalid_string,
685
+ code: d.invalid_string,
686
686
  message: a.message
687
687
  }), n.dirty());
688
688
  else if (a.kind === "cuid2")
689
- Xe.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
689
+ ut.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
690
690
  validation: "cuid2",
691
- code: c.invalid_string,
691
+ code: d.invalid_string,
692
692
  message: a.message
693
693
  }), n.dirty());
694
694
  else if (a.kind === "ulid")
695
- Ke.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
695
+ lt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
696
696
  validation: "ulid",
697
- code: c.invalid_string,
697
+ code: d.invalid_string,
698
698
  message: a.message
699
699
  }), n.dirty());
700
700
  else if (a.kind === "url")
701
701
  try {
702
702
  new URL(e.data);
703
703
  } catch {
704
- s = this._getOrReturnCtx(e, s), l(s, {
704
+ s = this._getOrReturnCtx(e, s), f(s, {
705
705
  validation: "url",
706
- code: c.invalid_string,
706
+ code: d.invalid_string,
707
707
  message: a.message
708
708
  }), n.dirty();
709
709
  }
710
- else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
710
+ else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
711
711
  validation: "regex",
712
- code: c.invalid_string,
712
+ code: d.invalid_string,
713
713
  message: a.message
714
- }), n.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (s = this._getOrReturnCtx(e, s), l(s, {
715
- code: c.invalid_string,
714
+ }), n.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (s = this._getOrReturnCtx(e, s), f(s, {
715
+ code: d.invalid_string,
716
716
  validation: { includes: a.value, position: a.position },
717
717
  message: a.message
718
- }), n.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (s = this._getOrReturnCtx(e, s), l(s, {
719
- code: c.invalid_string,
718
+ }), n.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (s = this._getOrReturnCtx(e, s), f(s, {
719
+ code: d.invalid_string,
720
720
  validation: { startsWith: a.value },
721
721
  message: a.message
722
- }), n.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (s = this._getOrReturnCtx(e, s), l(s, {
723
- code: c.invalid_string,
722
+ }), n.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (s = this._getOrReturnCtx(e, s), f(s, {
723
+ code: d.invalid_string,
724
724
  validation: { endsWith: a.value },
725
725
  message: a.message
726
- }), n.dirty()) : a.kind === "datetime" ? Le(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
727
- code: c.invalid_string,
726
+ }), n.dirty()) : a.kind === "datetime" ? Je(a).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
727
+ code: d.invalid_string,
728
728
  validation: "datetime",
729
729
  message: a.message
730
- }), n.dirty()) : a.kind === "date" ? ft.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
731
- code: c.invalid_string,
730
+ }), n.dirty()) : a.kind === "date" ? Tt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
731
+ code: d.invalid_string,
732
732
  validation: "date",
733
733
  message: a.message
734
- }), n.dirty()) : a.kind === "time" ? ht(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
735
- code: c.invalid_string,
734
+ }), n.dirty()) : a.kind === "time" ? Ct(a).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
735
+ code: d.invalid_string,
736
736
  validation: "time",
737
737
  message: a.message
738
- }), n.dirty()) : a.kind === "duration" ? nt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
738
+ }), n.dirty()) : a.kind === "duration" ? mt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
739
739
  validation: "duration",
740
- code: c.invalid_string,
740
+ code: d.invalid_string,
741
741
  message: a.message
742
- }), n.dirty()) : a.kind === "ip" ? mt(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
742
+ }), n.dirty()) : a.kind === "ip" ? St(e.data, a.version) || (s = this._getOrReturnCtx(e, s), f(s, {
743
743
  validation: "ip",
744
- code: c.invalid_string,
744
+ code: d.invalid_string,
745
745
  message: a.message
746
- }), n.dirty()) : a.kind === "jwt" ? pt(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), l(s, {
746
+ }), n.dirty()) : a.kind === "jwt" ? Zt(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), f(s, {
747
747
  validation: "jwt",
748
- code: c.invalid_string,
748
+ code: d.invalid_string,
749
749
  message: a.message
750
- }), n.dirty()) : a.kind === "cidr" ? yt(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
750
+ }), n.dirty()) : a.kind === "cidr" ? It(e.data, a.version) || (s = this._getOrReturnCtx(e, s), f(s, {
751
751
  validation: "cidr",
752
- code: c.invalid_string,
752
+ code: d.invalid_string,
753
753
  message: a.message
754
- }), n.dirty()) : a.kind === "base64" ? ut.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
754
+ }), n.dirty()) : a.kind === "base64" ? kt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
755
755
  validation: "base64",
756
- code: c.invalid_string,
756
+ code: d.invalid_string,
757
757
  message: a.message
758
- }), n.dirty()) : a.kind === "base64url" ? lt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
758
+ }), n.dirty()) : a.kind === "base64url" ? wt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
759
759
  validation: "base64url",
760
- code: c.invalid_string,
760
+ code: d.invalid_string,
761
761
  message: a.message
762
762
  }), n.dirty()) : b.assertNever(a);
763
763
  return { status: n.value, value: e.data };
@@ -765,12 +765,12 @@ class C extends _ {
765
765
  _regex(e, t, n) {
766
766
  return this.refinement((s) => e.test(s), {
767
767
  validation: t,
768
- code: c.invalid_string,
768
+ code: d.invalid_string,
769
769
  ...m.errToObj(n)
770
770
  });
771
771
  }
772
772
  _addCheck(e) {
773
- return new C({
773
+ return new N({
774
774
  ...this._def,
775
775
  checks: [...this._def.checks, e]
776
776
  });
@@ -907,19 +907,19 @@ class C extends _ {
907
907
  return this.min(1, m.errToObj(e));
908
908
  }
909
909
  trim() {
910
- return new C({
910
+ return new N({
911
911
  ...this._def,
912
912
  checks: [...this._def.checks, { kind: "trim" }]
913
913
  });
914
914
  }
915
915
  toLowerCase() {
916
- return new C({
916
+ return new N({
917
917
  ...this._def,
918
918
  checks: [...this._def.checks, { kind: "toLowerCase" }]
919
919
  });
920
920
  }
921
921
  toUpperCase() {
922
- return new C({
922
+ return new N({
923
923
  ...this._def,
924
924
  checks: [...this._def.checks, { kind: "toUpperCase" }]
925
925
  });
@@ -985,60 +985,60 @@ class C extends _ {
985
985
  return e;
986
986
  }
987
987
  }
988
- C.create = (r) => {
988
+ N.create = (r) => {
989
989
  var e;
990
- return new C({
990
+ return new N({
991
991
  checks: [],
992
992
  typeName: y.ZodString,
993
993
  coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
994
994
  ...v(r)
995
995
  });
996
996
  };
997
- function gt(r, e) {
997
+ function At(r, e) {
998
998
  const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n, a = parseInt(r.toFixed(s).replace(".", "")), o = parseInt(e.toFixed(s).replace(".", ""));
999
999
  return a % o / Math.pow(10, s);
1000
1000
  }
1001
- class $ extends _ {
1001
+ class M extends _ {
1002
1002
  constructor() {
1003
1003
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
1004
1004
  }
1005
1005
  _parse(e) {
1006
1006
  if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== h.number) {
1007
1007
  const a = this._getOrReturnCtx(e);
1008
- return l(a, {
1009
- code: c.invalid_type,
1008
+ return f(a, {
1009
+ code: d.invalid_type,
1010
1010
  expected: h.number,
1011
1011
  received: a.parsedType
1012
1012
  }), g;
1013
1013
  }
1014
1014
  let n;
1015
- const s = new w();
1015
+ const s = new C();
1016
1016
  for (const a of this._def.checks)
1017
- a.kind === "int" ? b.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
1018
- code: c.invalid_type,
1017
+ a.kind === "int" ? b.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), f(n, {
1018
+ code: d.invalid_type,
1019
1019
  expected: "integer",
1020
1020
  received: "float",
1021
1021
  message: a.message
1022
- }), s.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1023
- code: c.too_small,
1022
+ }), s.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), f(n, {
1023
+ code: d.too_small,
1024
1024
  minimum: a.value,
1025
1025
  type: "number",
1026
1026
  inclusive: a.inclusive,
1027
1027
  exact: !1,
1028
1028
  message: a.message
1029
- }), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1030
- code: c.too_big,
1029
+ }), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), f(n, {
1030
+ code: d.too_big,
1031
1031
  maximum: a.value,
1032
1032
  type: "number",
1033
1033
  inclusive: a.inclusive,
1034
1034
  exact: !1,
1035
1035
  message: a.message
1036
- }), s.dirty()) : a.kind === "multipleOf" ? gt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
1037
- code: c.not_multiple_of,
1036
+ }), s.dirty()) : a.kind === "multipleOf" ? At(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), f(n, {
1037
+ code: d.not_multiple_of,
1038
1038
  multipleOf: a.value,
1039
1039
  message: a.message
1040
- }), s.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
1041
- code: c.not_finite,
1040
+ }), s.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), f(n, {
1041
+ code: d.not_finite,
1042
1042
  message: a.message
1043
1043
  }), s.dirty()) : b.assertNever(a);
1044
1044
  return { status: s.value, value: e.data };
@@ -1056,7 +1056,7 @@ class $ extends _ {
1056
1056
  return this.setLimit("max", e, !1, m.toString(t));
1057
1057
  }
1058
1058
  setLimit(e, t, n, s) {
1059
- return new $({
1059
+ return new M({
1060
1060
  ...this._def,
1061
1061
  checks: [
1062
1062
  ...this._def.checks,
@@ -1070,7 +1070,7 @@ class $ extends _ {
1070
1070
  });
1071
1071
  }
1072
1072
  _addCheck(e) {
1073
- return new $({
1073
+ return new M({
1074
1074
  ...this._def,
1075
1075
  checks: [...this._def.checks, e]
1076
1076
  });
@@ -1164,13 +1164,13 @@ class $ extends _ {
1164
1164
  return Number.isFinite(t) && Number.isFinite(e);
1165
1165
  }
1166
1166
  }
1167
- $.create = (r) => new $({
1167
+ M.create = (r) => new M({
1168
1168
  checks: [],
1169
1169
  typeName: y.ZodNumber,
1170
1170
  coerce: (r == null ? void 0 : r.coerce) || !1,
1171
1171
  ...v(r)
1172
1172
  });
1173
- class M extends _ {
1173
+ class L extends _ {
1174
1174
  constructor() {
1175
1175
  super(...arguments), this.min = this.gte, this.max = this.lte;
1176
1176
  }
@@ -1184,22 +1184,22 @@ class M extends _ {
1184
1184
  if (this._getType(e) !== h.bigint)
1185
1185
  return this._getInvalidInput(e);
1186
1186
  let n;
1187
- const s = new w();
1187
+ const s = new C();
1188
1188
  for (const a of this._def.checks)
1189
- a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1190
- code: c.too_small,
1189
+ a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), f(n, {
1190
+ code: d.too_small,
1191
1191
  type: "bigint",
1192
1192
  minimum: a.value,
1193
1193
  inclusive: a.inclusive,
1194
1194
  message: a.message
1195
- }), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1196
- code: c.too_big,
1195
+ }), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), f(n, {
1196
+ code: d.too_big,
1197
1197
  type: "bigint",
1198
1198
  maximum: a.value,
1199
1199
  inclusive: a.inclusive,
1200
1200
  message: a.message
1201
- }), s.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), l(n, {
1202
- code: c.not_multiple_of,
1201
+ }), s.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), f(n, {
1202
+ code: d.not_multiple_of,
1203
1203
  multipleOf: a.value,
1204
1204
  message: a.message
1205
1205
  }), s.dirty()) : b.assertNever(a);
@@ -1207,8 +1207,8 @@ class M extends _ {
1207
1207
  }
1208
1208
  _getInvalidInput(e) {
1209
1209
  const t = this._getOrReturnCtx(e);
1210
- return l(t, {
1211
- code: c.invalid_type,
1210
+ return f(t, {
1211
+ code: d.invalid_type,
1212
1212
  expected: h.bigint,
1213
1213
  received: t.parsedType
1214
1214
  }), g;
@@ -1226,7 +1226,7 @@ class M extends _ {
1226
1226
  return this.setLimit("max", e, !1, m.toString(t));
1227
1227
  }
1228
1228
  setLimit(e, t, n, s) {
1229
- return new M({
1229
+ return new L({
1230
1230
  ...this._def,
1231
1231
  checks: [
1232
1232
  ...this._def.checks,
@@ -1240,7 +1240,7 @@ class M extends _ {
1240
1240
  });
1241
1241
  }
1242
1242
  _addCheck(e) {
1243
- return new M({
1243
+ return new L({
1244
1244
  ...this._def,
1245
1245
  checks: [...this._def.checks, e]
1246
1246
  });
@@ -1297,21 +1297,21 @@ class M extends _ {
1297
1297
  return e;
1298
1298
  }
1299
1299
  }
1300
- M.create = (r) => {
1300
+ L.create = (r) => {
1301
1301
  var e;
1302
- return new M({
1302
+ return new L({
1303
1303
  checks: [],
1304
1304
  typeName: y.ZodBigInt,
1305
1305
  coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
1306
1306
  ...v(r)
1307
1307
  });
1308
1308
  };
1309
- class te extends _ {
1309
+ class se extends _ {
1310
1310
  _parse(e) {
1311
1311
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== h.boolean) {
1312
1312
  const n = this._getOrReturnCtx(e);
1313
- return l(n, {
1314
- code: c.invalid_type,
1313
+ return f(n, {
1314
+ code: d.invalid_type,
1315
1315
  expected: h.boolean,
1316
1316
  received: n.parsedType
1317
1317
  }), g;
@@ -1319,39 +1319,39 @@ class te extends _ {
1319
1319
  return S(e.data);
1320
1320
  }
1321
1321
  }
1322
- te.create = (r) => new te({
1322
+ se.create = (r) => new se({
1323
1323
  typeName: y.ZodBoolean,
1324
1324
  coerce: (r == null ? void 0 : r.coerce) || !1,
1325
1325
  ...v(r)
1326
1326
  });
1327
- class U extends _ {
1327
+ class q extends _ {
1328
1328
  _parse(e) {
1329
1329
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== h.date) {
1330
1330
  const a = this._getOrReturnCtx(e);
1331
- return l(a, {
1332
- code: c.invalid_type,
1331
+ return f(a, {
1332
+ code: d.invalid_type,
1333
1333
  expected: h.date,
1334
1334
  received: a.parsedType
1335
1335
  }), g;
1336
1336
  }
1337
1337
  if (isNaN(e.data.getTime())) {
1338
1338
  const a = this._getOrReturnCtx(e);
1339
- return l(a, {
1340
- code: c.invalid_date
1339
+ return f(a, {
1340
+ code: d.invalid_date
1341
1341
  }), g;
1342
1342
  }
1343
- const n = new w();
1343
+ const n = new C();
1344
1344
  let s;
1345
1345
  for (const a of this._def.checks)
1346
- a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), l(s, {
1347
- code: c.too_small,
1346
+ a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), f(s, {
1347
+ code: d.too_small,
1348
1348
  message: a.message,
1349
1349
  inclusive: !0,
1350
1350
  exact: !1,
1351
1351
  minimum: a.value,
1352
1352
  type: "date"
1353
- }), n.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (s = this._getOrReturnCtx(e, s), l(s, {
1354
- code: c.too_big,
1353
+ }), n.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (s = this._getOrReturnCtx(e, s), f(s, {
1354
+ code: d.too_big,
1355
1355
  message: a.message,
1356
1356
  inclusive: !0,
1357
1357
  exact: !1,
@@ -1364,7 +1364,7 @@ class U extends _ {
1364
1364
  };
1365
1365
  }
1366
1366
  _addCheck(e) {
1367
- return new U({
1367
+ return new q({
1368
1368
  ...this._def,
1369
1369
  checks: [...this._def.checks, e]
1370
1370
  });
@@ -1396,18 +1396,18 @@ class U extends _ {
1396
1396
  return e != null ? new Date(e) : null;
1397
1397
  }
1398
1398
  }
1399
- U.create = (r) => new U({
1399
+ q.create = (r) => new q({
1400
1400
  checks: [],
1401
1401
  coerce: (r == null ? void 0 : r.coerce) || !1,
1402
1402
  typeName: y.ZodDate,
1403
1403
  ...v(r)
1404
1404
  });
1405
- class ve extends _ {
1405
+ class ke extends _ {
1406
1406
  _parse(e) {
1407
1407
  if (this._getType(e) !== h.symbol) {
1408
1408
  const n = this._getOrReturnCtx(e);
1409
- return l(n, {
1410
- code: c.invalid_type,
1409
+ return f(n, {
1410
+ code: d.invalid_type,
1411
1411
  expected: h.symbol,
1412
1412
  received: n.parsedType
1413
1413
  }), g;
@@ -1415,16 +1415,16 @@ class ve extends _ {
1415
1415
  return S(e.data);
1416
1416
  }
1417
1417
  }
1418
- ve.create = (r) => new ve({
1418
+ ke.create = (r) => new ke({
1419
1419
  typeName: y.ZodSymbol,
1420
1420
  ...v(r)
1421
1421
  });
1422
- class re extends _ {
1422
+ class ae extends _ {
1423
1423
  _parse(e) {
1424
1424
  if (this._getType(e) !== h.undefined) {
1425
1425
  const n = this._getOrReturnCtx(e);
1426
- return l(n, {
1427
- code: c.invalid_type,
1426
+ return f(n, {
1427
+ code: d.invalid_type,
1428
1428
  expected: h.undefined,
1429
1429
  received: n.parsedType
1430
1430
  }), g;
@@ -1432,16 +1432,16 @@ class re extends _ {
1432
1432
  return S(e.data);
1433
1433
  }
1434
1434
  }
1435
- re.create = (r) => new re({
1435
+ ae.create = (r) => new ae({
1436
1436
  typeName: y.ZodUndefined,
1437
1437
  ...v(r)
1438
1438
  });
1439
- class ne extends _ {
1439
+ class ie extends _ {
1440
1440
  _parse(e) {
1441
1441
  if (this._getType(e) !== h.null) {
1442
1442
  const n = this._getOrReturnCtx(e);
1443
- return l(n, {
1444
- code: c.invalid_type,
1443
+ return f(n, {
1444
+ code: d.invalid_type,
1445
1445
  expected: h.null,
1446
1446
  received: n.parsedType
1447
1447
  }), g;
@@ -1449,11 +1449,11 @@ class ne extends _ {
1449
1449
  return S(e.data);
1450
1450
  }
1451
1451
  }
1452
- ne.create = (r) => new ne({
1452
+ ie.create = (r) => new ie({
1453
1453
  typeName: y.ZodNull,
1454
1454
  ...v(r)
1455
1455
  });
1456
- class H extends _ {
1456
+ class X extends _ {
1457
1457
  constructor() {
1458
1458
  super(...arguments), this._any = !0;
1459
1459
  }
@@ -1461,11 +1461,11 @@ class H extends _ {
1461
1461
  return S(e.data);
1462
1462
  }
1463
1463
  }
1464
- H.create = (r) => new H({
1464
+ X.create = (r) => new X({
1465
1465
  typeName: y.ZodAny,
1466
1466
  ...v(r)
1467
1467
  });
1468
- class L extends _ {
1468
+ class U extends _ {
1469
1469
  constructor() {
1470
1470
  super(...arguments), this._unknown = !0;
1471
1471
  }
@@ -1473,30 +1473,30 @@ class L extends _ {
1473
1473
  return S(e.data);
1474
1474
  }
1475
1475
  }
1476
- L.create = (r) => new L({
1476
+ U.create = (r) => new U({
1477
1477
  typeName: y.ZodUnknown,
1478
1478
  ...v(r)
1479
1479
  });
1480
- class P extends _ {
1480
+ class D extends _ {
1481
1481
  _parse(e) {
1482
1482
  const t = this._getOrReturnCtx(e);
1483
- return l(t, {
1484
- code: c.invalid_type,
1483
+ return f(t, {
1484
+ code: d.invalid_type,
1485
1485
  expected: h.never,
1486
1486
  received: t.parsedType
1487
1487
  }), g;
1488
1488
  }
1489
1489
  }
1490
- P.create = (r) => new P({
1490
+ D.create = (r) => new D({
1491
1491
  typeName: y.ZodNever,
1492
1492
  ...v(r)
1493
1493
  });
1494
- class _e extends _ {
1494
+ class we extends _ {
1495
1495
  _parse(e) {
1496
1496
  if (this._getType(e) !== h.undefined) {
1497
1497
  const n = this._getOrReturnCtx(e);
1498
- return l(n, {
1499
- code: c.invalid_type,
1498
+ return f(n, {
1499
+ code: d.invalid_type,
1500
1500
  expected: h.void,
1501
1501
  received: n.parsedType
1502
1502
  }), g;
@@ -1504,24 +1504,24 @@ class _e extends _ {
1504
1504
  return S(e.data);
1505
1505
  }
1506
1506
  }
1507
- _e.create = (r) => new _e({
1507
+ we.create = (r) => new we({
1508
1508
  typeName: y.ZodVoid,
1509
1509
  ...v(r)
1510
1510
  });
1511
- class I extends _ {
1511
+ class O extends _ {
1512
1512
  _parse(e) {
1513
1513
  const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
1514
1514
  if (t.parsedType !== h.array)
1515
- return l(t, {
1516
- code: c.invalid_type,
1515
+ return f(t, {
1516
+ code: d.invalid_type,
1517
1517
  expected: h.array,
1518
1518
  received: t.parsedType
1519
1519
  }), g;
1520
1520
  if (s.exactLength !== null) {
1521
- const o = t.data.length > s.exactLength.value, d = t.data.length < s.exactLength.value;
1522
- (o || d) && (l(t, {
1523
- code: o ? c.too_big : c.too_small,
1524
- minimum: d ? s.exactLength.value : void 0,
1521
+ const o = t.data.length > s.exactLength.value, i = t.data.length < s.exactLength.value;
1522
+ (o || i) && (f(t, {
1523
+ code: o ? d.too_big : d.too_small,
1524
+ minimum: i ? s.exactLength.value : void 0,
1525
1525
  maximum: o ? s.exactLength.value : void 0,
1526
1526
  type: "array",
1527
1527
  inclusive: !0,
@@ -1529,42 +1529,42 @@ class I extends _ {
1529
1529
  message: s.exactLength.message
1530
1530
  }), n.dirty());
1531
1531
  }
1532
- if (s.minLength !== null && t.data.length < s.minLength.value && (l(t, {
1533
- code: c.too_small,
1532
+ if (s.minLength !== null && t.data.length < s.minLength.value && (f(t, {
1533
+ code: d.too_small,
1534
1534
  minimum: s.minLength.value,
1535
1535
  type: "array",
1536
1536
  inclusive: !0,
1537
1537
  exact: !1,
1538
1538
  message: s.minLength.message
1539
- }), n.dirty()), s.maxLength !== null && t.data.length > s.maxLength.value && (l(t, {
1540
- code: c.too_big,
1539
+ }), n.dirty()), s.maxLength !== null && t.data.length > s.maxLength.value && (f(t, {
1540
+ code: d.too_big,
1541
1541
  maximum: s.maxLength.value,
1542
1542
  type: "array",
1543
1543
  inclusive: !0,
1544
1544
  exact: !1,
1545
1545
  message: s.maxLength.message
1546
1546
  }), n.dirty()), t.common.async)
1547
- return Promise.all([...t.data].map((o, d) => s.type._parseAsync(new O(t, o, t.path, d)))).then((o) => w.mergeArray(n, o));
1548
- const a = [...t.data].map((o, d) => s.type._parseSync(new O(t, o, t.path, d)));
1549
- return w.mergeArray(n, a);
1547
+ return Promise.all([...t.data].map((o, i) => s.type._parseAsync(new R(t, o, t.path, i)))).then((o) => C.mergeArray(n, o));
1548
+ const a = [...t.data].map((o, i) => s.type._parseSync(new R(t, o, t.path, i)));
1549
+ return C.mergeArray(n, a);
1550
1550
  }
1551
1551
  get element() {
1552
1552
  return this._def.type;
1553
1553
  }
1554
1554
  min(e, t) {
1555
- return new I({
1555
+ return new O({
1556
1556
  ...this._def,
1557
1557
  minLength: { value: e, message: m.toString(t) }
1558
1558
  });
1559
1559
  }
1560
1560
  max(e, t) {
1561
- return new I({
1561
+ return new O({
1562
1562
  ...this._def,
1563
1563
  maxLength: { value: e, message: m.toString(t) }
1564
1564
  });
1565
1565
  }
1566
1566
  length(e, t) {
1567
- return new I({
1567
+ return new O({
1568
1568
  ...this._def,
1569
1569
  exactLength: { value: e, message: m.toString(t) }
1570
1570
  });
@@ -1573,7 +1573,7 @@ class I extends _ {
1573
1573
  return this.min(1, e);
1574
1574
  }
1575
1575
  }
1576
- I.create = (r, e) => new I({
1576
+ O.create = (r, e) => new O({
1577
1577
  type: r,
1578
1578
  minLength: null,
1579
1579
  maxLength: null,
@@ -1581,23 +1581,23 @@ I.create = (r, e) => new I({
1581
1581
  typeName: y.ZodArray,
1582
1582
  ...v(e)
1583
1583
  });
1584
- function B(r) {
1585
- if (r instanceof x) {
1584
+ function J(r) {
1585
+ if (r instanceof k) {
1586
1586
  const e = {};
1587
1587
  for (const t in r.shape) {
1588
1588
  const n = r.shape[t];
1589
- e[t] = N.create(B(n));
1589
+ e[t] = E.create(J(n));
1590
1590
  }
1591
- return new x({
1591
+ return new k({
1592
1592
  ...r._def,
1593
1593
  shape: () => e
1594
1594
  });
1595
- } else return r instanceof I ? new I({
1595
+ } else return r instanceof O ? new O({
1596
1596
  ...r._def,
1597
- type: B(r.element)
1598
- }) : r instanceof N ? N.create(B(r.unwrap())) : r instanceof D ? D.create(B(r.unwrap())) : r instanceof j ? j.create(r.items.map((e) => B(e))) : r;
1597
+ type: J(r.element)
1598
+ }) : r instanceof E ? E.create(J(r.unwrap())) : r instanceof F ? F.create(J(r.unwrap())) : r instanceof P ? P.create(r.items.map((e) => J(e))) : r;
1599
1599
  }
1600
- class x extends _ {
1600
+ class k extends _ {
1601
1601
  constructor() {
1602
1602
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1603
1603
  }
@@ -1610,47 +1610,47 @@ class x extends _ {
1610
1610
  _parse(e) {
1611
1611
  if (this._getType(e) !== h.object) {
1612
1612
  const u = this._getOrReturnCtx(e);
1613
- return l(u, {
1614
- code: c.invalid_type,
1613
+ return f(u, {
1614
+ code: d.invalid_type,
1615
1615
  expected: h.object,
1616
1616
  received: u.parsedType
1617
1617
  }), g;
1618
1618
  }
1619
- const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: o } = this._getCached(), d = [];
1620
- if (!(this._def.catchall instanceof P && this._def.unknownKeys === "strip"))
1619
+ const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: o } = this._getCached(), i = [];
1620
+ if (!(this._def.catchall instanceof D && this._def.unknownKeys === "strip"))
1621
1621
  for (const u in s.data)
1622
- o.includes(u) || d.push(u);
1623
- const f = [];
1622
+ o.includes(u) || i.push(u);
1623
+ const l = [];
1624
1624
  for (const u of o) {
1625
- const p = a[u], T = s.data[u];
1626
- f.push({
1625
+ const p = a[u], x = s.data[u];
1626
+ l.push({
1627
1627
  key: { status: "valid", value: u },
1628
- value: p._parse(new O(s, T, s.path, u)),
1628
+ value: p._parse(new R(s, x, s.path, u)),
1629
1629
  alwaysSet: u in s.data
1630
1630
  });
1631
1631
  }
1632
- if (this._def.catchall instanceof P) {
1632
+ if (this._def.catchall instanceof D) {
1633
1633
  const u = this._def.unknownKeys;
1634
1634
  if (u === "passthrough")
1635
- for (const p of d)
1636
- f.push({
1635
+ for (const p of i)
1636
+ l.push({
1637
1637
  key: { status: "valid", value: p },
1638
1638
  value: { status: "valid", value: s.data[p] }
1639
1639
  });
1640
1640
  else if (u === "strict")
1641
- d.length > 0 && (l(s, {
1642
- code: c.unrecognized_keys,
1643
- keys: d
1641
+ i.length > 0 && (f(s, {
1642
+ code: d.unrecognized_keys,
1643
+ keys: i
1644
1644
  }), n.dirty());
1645
1645
  else if (u !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1646
1646
  } else {
1647
1647
  const u = this._def.catchall;
1648
- for (const p of d) {
1649
- const T = s.data[p];
1650
- f.push({
1648
+ for (const p of i) {
1649
+ const x = s.data[p];
1650
+ l.push({
1651
1651
  key: { status: "valid", value: p },
1652
1652
  value: u._parse(
1653
- new O(s, T, s.path, p)
1653
+ new R(s, x, s.path, p)
1654
1654
  //, ctx.child(key), value, getParsedType(value)
1655
1655
  ),
1656
1656
  alwaysSet: p in s.data
@@ -1659,45 +1659,45 @@ class x extends _ {
1659
1659
  }
1660
1660
  return s.common.async ? Promise.resolve().then(async () => {
1661
1661
  const u = [];
1662
- for (const p of f) {
1663
- const T = await p.key, me = await p.value;
1662
+ for (const p of l) {
1663
+ const x = await p.key, I = await p.value;
1664
1664
  u.push({
1665
- key: T,
1666
- value: me,
1665
+ key: x,
1666
+ value: I,
1667
1667
  alwaysSet: p.alwaysSet
1668
1668
  });
1669
1669
  }
1670
1670
  return u;
1671
- }).then((u) => w.mergeObjectSync(n, u)) : w.mergeObjectSync(n, f);
1671
+ }).then((u) => C.mergeObjectSync(n, u)) : C.mergeObjectSync(n, l);
1672
1672
  }
1673
1673
  get shape() {
1674
1674
  return this._def.shape();
1675
1675
  }
1676
1676
  strict(e) {
1677
- return m.errToObj, new x({
1677
+ return m.errToObj, new k({
1678
1678
  ...this._def,
1679
1679
  unknownKeys: "strict",
1680
1680
  ...e !== void 0 ? {
1681
1681
  errorMap: (t, n) => {
1682
- var s, a, o, d;
1683
- const f = (o = (a = (s = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(s, t, n).message) !== null && o !== void 0 ? o : n.defaultError;
1682
+ var s, a, o, i;
1683
+ const l = (o = (a = (s = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(s, t, n).message) !== null && o !== void 0 ? o : n.defaultError;
1684
1684
  return t.code === "unrecognized_keys" ? {
1685
- message: (d = m.errToObj(e).message) !== null && d !== void 0 ? d : f
1685
+ message: (i = m.errToObj(e).message) !== null && i !== void 0 ? i : l
1686
1686
  } : {
1687
- message: f
1687
+ message: l
1688
1688
  };
1689
1689
  }
1690
1690
  } : {}
1691
1691
  });
1692
1692
  }
1693
1693
  strip() {
1694
- return new x({
1694
+ return new k({
1695
1695
  ...this._def,
1696
1696
  unknownKeys: "strip"
1697
1697
  });
1698
1698
  }
1699
1699
  passthrough() {
1700
- return new x({
1700
+ return new k({
1701
1701
  ...this._def,
1702
1702
  unknownKeys: "passthrough"
1703
1703
  });
@@ -1720,7 +1720,7 @@ class x extends _ {
1720
1720
  // }) as any;
1721
1721
  // };
1722
1722
  extend(e) {
1723
- return new x({
1723
+ return new k({
1724
1724
  ...this._def,
1725
1725
  shape: () => ({
1726
1726
  ...this._def.shape(),
@@ -1734,7 +1734,7 @@ class x extends _ {
1734
1734
  * upgrade if you are experiencing issues.
1735
1735
  */
1736
1736
  merge(e) {
1737
- return new x({
1737
+ return new k({
1738
1738
  unknownKeys: e._def.unknownKeys,
1739
1739
  catchall: e._def.catchall,
1740
1740
  shape: () => ({
@@ -1804,7 +1804,7 @@ class x extends _ {
1804
1804
  // return merged;
1805
1805
  // }
1806
1806
  catchall(e) {
1807
- return new x({
1807
+ return new k({
1808
1808
  ...this._def,
1809
1809
  catchall: e
1810
1810
  });
@@ -1813,7 +1813,7 @@ class x extends _ {
1813
1813
  const t = {};
1814
1814
  return b.objectKeys(e).forEach((n) => {
1815
1815
  e[n] && this.shape[n] && (t[n] = this.shape[n]);
1816
- }), new x({
1816
+ }), new k({
1817
1817
  ...this._def,
1818
1818
  shape: () => t
1819
1819
  });
@@ -1822,7 +1822,7 @@ class x extends _ {
1822
1822
  const t = {};
1823
1823
  return b.objectKeys(this.shape).forEach((n) => {
1824
1824
  e[n] || (t[n] = this.shape[n]);
1825
- }), new x({
1825
+ }), new k({
1826
1826
  ...this._def,
1827
1827
  shape: () => t
1828
1828
  });
@@ -1831,14 +1831,14 @@ class x extends _ {
1831
1831
  * @deprecated
1832
1832
  */
1833
1833
  deepPartial() {
1834
- return B(this);
1834
+ return J(this);
1835
1835
  }
1836
1836
  partial(e) {
1837
1837
  const t = {};
1838
1838
  return b.objectKeys(this.shape).forEach((n) => {
1839
1839
  const s = this.shape[n];
1840
1840
  e && !e[n] ? t[n] = s : t[n] = s.optional();
1841
- }), new x({
1841
+ }), new k({
1842
1842
  ...this._def,
1843
1843
  shape: () => t
1844
1844
  });
@@ -1850,53 +1850,53 @@ class x extends _ {
1850
1850
  t[n] = this.shape[n];
1851
1851
  else {
1852
1852
  let a = this.shape[n];
1853
- for (; a instanceof N; )
1853
+ for (; a instanceof E; )
1854
1854
  a = a._def.innerType;
1855
1855
  t[n] = a;
1856
1856
  }
1857
- }), new x({
1857
+ }), new k({
1858
1858
  ...this._def,
1859
1859
  shape: () => t
1860
1860
  });
1861
1861
  }
1862
1862
  keyof() {
1863
- return ze(b.objectKeys(this.shape));
1863
+ return Qe(b.objectKeys(this.shape));
1864
1864
  }
1865
1865
  }
1866
- x.create = (r, e) => new x({
1866
+ k.create = (r, e) => new k({
1867
1867
  shape: () => r,
1868
1868
  unknownKeys: "strip",
1869
- catchall: P.create(),
1869
+ catchall: D.create(),
1870
1870
  typeName: y.ZodObject,
1871
1871
  ...v(e)
1872
1872
  });
1873
- x.strictCreate = (r, e) => new x({
1873
+ k.strictCreate = (r, e) => new k({
1874
1874
  shape: () => r,
1875
1875
  unknownKeys: "strict",
1876
- catchall: P.create(),
1876
+ catchall: D.create(),
1877
1877
  typeName: y.ZodObject,
1878
1878
  ...v(e)
1879
1879
  });
1880
- x.lazycreate = (r, e) => new x({
1880
+ k.lazycreate = (r, e) => new k({
1881
1881
  shape: r,
1882
1882
  unknownKeys: "strip",
1883
- catchall: P.create(),
1883
+ catchall: D.create(),
1884
1884
  typeName: y.ZodObject,
1885
1885
  ...v(e)
1886
1886
  });
1887
- class se extends _ {
1887
+ class oe extends _ {
1888
1888
  _parse(e) {
1889
1889
  const { ctx: t } = this._processInputParams(e), n = this._def.options;
1890
1890
  function s(a) {
1891
- for (const d of a)
1892
- if (d.result.status === "valid")
1893
- return d.result;
1894
- for (const d of a)
1895
- if (d.result.status === "dirty")
1896
- return t.common.issues.push(...d.ctx.common.issues), d.result;
1897
- const o = a.map((d) => new Z(d.ctx.common.issues));
1898
- return l(t, {
1899
- code: c.invalid_union,
1891
+ for (const i of a)
1892
+ if (i.result.status === "valid")
1893
+ return i.result;
1894
+ for (const i of a)
1895
+ if (i.result.status === "dirty")
1896
+ return t.common.issues.push(...i.ctx.common.issues), i.result;
1897
+ const o = a.map((i) => new Z(i.ctx.common.issues));
1898
+ return f(t, {
1899
+ code: d.invalid_union,
1900
1900
  unionErrors: o
1901
1901
  }), g;
1902
1902
  }
@@ -1922,7 +1922,7 @@ class se extends _ {
1922
1922
  {
1923
1923
  let a;
1924
1924
  const o = [];
1925
- for (const f of n) {
1925
+ for (const l of n) {
1926
1926
  const u = {
1927
1927
  ...t,
1928
1928
  common: {
@@ -1930,7 +1930,7 @@ class se extends _ {
1930
1930
  issues: []
1931
1931
  },
1932
1932
  parent: null
1933
- }, p = f._parseSync({
1933
+ }, p = l._parseSync({
1934
1934
  data: t.data,
1935
1935
  path: t.path,
1936
1936
  parent: u
@@ -1941,10 +1941,10 @@ class se extends _ {
1941
1941
  }
1942
1942
  if (a)
1943
1943
  return t.common.issues.push(...a.ctx.common.issues), a.result;
1944
- const d = o.map((f) => new Z(f));
1945
- return l(t, {
1946
- code: c.invalid_union,
1947
- unionErrors: d
1944
+ const i = o.map((l) => new Z(l));
1945
+ return f(t, {
1946
+ code: d.invalid_union,
1947
+ unionErrors: i
1948
1948
  }), g;
1949
1949
  }
1950
1950
  }
@@ -1952,18 +1952,18 @@ class se extends _ {
1952
1952
  return this._def.options;
1953
1953
  }
1954
1954
  }
1955
- se.create = (r, e) => new se({
1955
+ oe.create = (r, e) => new oe({
1956
1956
  options: r,
1957
1957
  typeName: y.ZodUnion,
1958
1958
  ...v(e)
1959
1959
  });
1960
- const E = (r) => r instanceof oe ? E(r.schema) : r instanceof A ? E(r.innerType()) : r instanceof de ? [r.value] : r instanceof V ? r.options : r instanceof ce ? b.objectValues(r.enum) : r instanceof ue ? E(r._def.innerType) : r instanceof re ? [void 0] : r instanceof ne ? [null] : r instanceof N ? [void 0, ...E(r.unwrap())] : r instanceof D ? [null, ...E(r.unwrap())] : r instanceof Ne || r instanceof fe ? E(r.unwrap()) : r instanceof le ? E(r._def.innerType) : [];
1961
- class ke extends _ {
1960
+ const $ = (r) => r instanceof ue ? $(r.schema) : r instanceof j ? $(r.innerType()) : r instanceof le ? [r.value] : r instanceof z ? r.options : r instanceof fe ? b.objectValues(r.enum) : r instanceof he ? $(r._def.innerType) : r instanceof ae ? [void 0] : r instanceof ie ? [null] : r instanceof E ? [void 0, ...$(r.unwrap())] : r instanceof F ? [null, ...$(r.unwrap())] : r instanceof Re || r instanceof me ? $(r.unwrap()) : r instanceof pe ? $(r._def.innerType) : [];
1961
+ class Se extends _ {
1962
1962
  _parse(e) {
1963
1963
  const { ctx: t } = this._processInputParams(e);
1964
1964
  if (t.parsedType !== h.object)
1965
- return l(t, {
1966
- code: c.invalid_type,
1965
+ return f(t, {
1966
+ code: d.invalid_type,
1967
1967
  expected: h.object,
1968
1968
  received: t.parsedType
1969
1969
  }), g;
@@ -1976,8 +1976,8 @@ class ke extends _ {
1976
1976
  data: t.data,
1977
1977
  path: t.path,
1978
1978
  parent: t
1979
- }) : (l(t, {
1980
- code: c.invalid_union_discriminator,
1979
+ }) : (f(t, {
1980
+ code: d.invalid_union_discriminator,
1981
1981
  options: Array.from(this.optionsMap.keys()),
1982
1982
  path: [n]
1983
1983
  }), g);
@@ -2002,16 +2002,16 @@ class ke extends _ {
2002
2002
  static create(e, t, n) {
2003
2003
  const s = /* @__PURE__ */ new Map();
2004
2004
  for (const a of t) {
2005
- const o = E(a.shape[e]);
2005
+ const o = $(a.shape[e]);
2006
2006
  if (!o.length)
2007
2007
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
2008
- for (const d of o) {
2009
- if (s.has(d))
2010
- throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);
2011
- s.set(d, a);
2008
+ for (const i of o) {
2009
+ if (s.has(i))
2010
+ throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);
2011
+ s.set(i, a);
2012
2012
  }
2013
2013
  }
2014
- return new ke({
2014
+ return new Se({
2015
2015
  typeName: y.ZodDiscriminatedUnion,
2016
2016
  discriminator: e,
2017
2017
  options: t,
@@ -2020,17 +2020,17 @@ class ke extends _ {
2020
2020
  });
2021
2021
  }
2022
2022
  }
2023
- function Ae(r, e) {
2024
- const t = R(r), n = R(e);
2023
+ function Ee(r, e) {
2024
+ const t = V(r), n = V(e);
2025
2025
  if (r === e)
2026
2026
  return { valid: !0, data: r };
2027
2027
  if (t === h.object && n === h.object) {
2028
- const s = b.objectKeys(e), a = b.objectKeys(r).filter((d) => s.indexOf(d) !== -1), o = { ...r, ...e };
2029
- for (const d of a) {
2030
- const f = Ae(r[d], e[d]);
2031
- if (!f.valid)
2028
+ const s = b.objectKeys(e), a = b.objectKeys(r).filter((i) => s.indexOf(i) !== -1), o = { ...r, ...e };
2029
+ for (const i of a) {
2030
+ const l = Ee(r[i], e[i]);
2031
+ if (!l.valid)
2032
2032
  return { valid: !1 };
2033
- o[d] = f.data;
2033
+ o[i] = l.data;
2034
2034
  }
2035
2035
  return { valid: !0, data: o };
2036
2036
  } else if (t === h.array && n === h.array) {
@@ -2038,22 +2038,22 @@ function Ae(r, e) {
2038
2038
  return { valid: !1 };
2039
2039
  const s = [];
2040
2040
  for (let a = 0; a < r.length; a++) {
2041
- const o = r[a], d = e[a], f = Ae(o, d);
2042
- if (!f.valid)
2041
+ const o = r[a], i = e[a], l = Ee(o, i);
2042
+ if (!l.valid)
2043
2043
  return { valid: !1 };
2044
- s.push(f.data);
2044
+ s.push(l.data);
2045
2045
  }
2046
2046
  return { valid: !0, data: s };
2047
2047
  } else return t === h.date && n === h.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
2048
2048
  }
2049
- class ae extends _ {
2049
+ class ce extends _ {
2050
2050
  _parse(e) {
2051
2051
  const { status: t, ctx: n } = this._processInputParams(e), s = (a, o) => {
2052
- if (Ce(a) || Ce(o))
2052
+ if (Oe(a) || Oe(o))
2053
2053
  return g;
2054
- const d = Ae(a.value, o.value);
2055
- return d.valid ? ((Ie(a) || Ie(o)) && t.dirty(), { status: t.value, value: d.data }) : (l(n, {
2056
- code: c.invalid_intersection_types
2054
+ const i = Ee(a.value, o.value);
2055
+ return i.valid ? ((je(a) || je(o)) && t.dirty(), { status: t.value, value: i.data }) : (f(n, {
2056
+ code: d.invalid_intersection_types
2057
2057
  }), g);
2058
2058
  };
2059
2059
  return n.common.async ? Promise.all([
@@ -2078,63 +2078,63 @@ class ae extends _ {
2078
2078
  }));
2079
2079
  }
2080
2080
  }
2081
- ae.create = (r, e, t) => new ae({
2081
+ ce.create = (r, e, t) => new ce({
2082
2082
  left: r,
2083
2083
  right: e,
2084
2084
  typeName: y.ZodIntersection,
2085
2085
  ...v(t)
2086
2086
  });
2087
- class j extends _ {
2087
+ class P extends _ {
2088
2088
  _parse(e) {
2089
2089
  const { status: t, ctx: n } = this._processInputParams(e);
2090
2090
  if (n.parsedType !== h.array)
2091
- return l(n, {
2092
- code: c.invalid_type,
2091
+ return f(n, {
2092
+ code: d.invalid_type,
2093
2093
  expected: h.array,
2094
2094
  received: n.parsedType
2095
2095
  }), g;
2096
2096
  if (n.data.length < this._def.items.length)
2097
- return l(n, {
2098
- code: c.too_small,
2097
+ return f(n, {
2098
+ code: d.too_small,
2099
2099
  minimum: this._def.items.length,
2100
2100
  inclusive: !0,
2101
2101
  exact: !1,
2102
2102
  type: "array"
2103
2103
  }), g;
2104
- !this._def.rest && n.data.length > this._def.items.length && (l(n, {
2105
- code: c.too_big,
2104
+ !this._def.rest && n.data.length > this._def.items.length && (f(n, {
2105
+ code: d.too_big,
2106
2106
  maximum: this._def.items.length,
2107
2107
  inclusive: !0,
2108
2108
  exact: !1,
2109
2109
  type: "array"
2110
2110
  }), t.dirty());
2111
- const a = [...n.data].map((o, d) => {
2112
- const f = this._def.items[d] || this._def.rest;
2113
- return f ? f._parse(new O(n, o, n.path, d)) : null;
2111
+ const a = [...n.data].map((o, i) => {
2112
+ const l = this._def.items[i] || this._def.rest;
2113
+ return l ? l._parse(new R(n, o, n.path, i)) : null;
2114
2114
  }).filter((o) => !!o);
2115
- return n.common.async ? Promise.all(a).then((o) => w.mergeArray(t, o)) : w.mergeArray(t, a);
2115
+ return n.common.async ? Promise.all(a).then((o) => C.mergeArray(t, o)) : C.mergeArray(t, a);
2116
2116
  }
2117
2117
  get items() {
2118
2118
  return this._def.items;
2119
2119
  }
2120
2120
  rest(e) {
2121
- return new j({
2121
+ return new P({
2122
2122
  ...this._def,
2123
2123
  rest: e
2124
2124
  });
2125
2125
  }
2126
2126
  }
2127
- j.create = (r, e) => {
2127
+ P.create = (r, e) => {
2128
2128
  if (!Array.isArray(r))
2129
2129
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2130
- return new j({
2130
+ return new P({
2131
2131
  items: r,
2132
2132
  typeName: y.ZodTuple,
2133
2133
  rest: null,
2134
2134
  ...v(e)
2135
2135
  });
2136
2136
  };
2137
- class ie extends _ {
2137
+ class de extends _ {
2138
2138
  get keySchema() {
2139
2139
  return this._def.keyType;
2140
2140
  }
@@ -2144,38 +2144,38 @@ class ie extends _ {
2144
2144
  _parse(e) {
2145
2145
  const { status: t, ctx: n } = this._processInputParams(e);
2146
2146
  if (n.parsedType !== h.object)
2147
- return l(n, {
2148
- code: c.invalid_type,
2147
+ return f(n, {
2148
+ code: d.invalid_type,
2149
2149
  expected: h.object,
2150
2150
  received: n.parsedType
2151
2151
  }), g;
2152
2152
  const s = [], a = this._def.keyType, o = this._def.valueType;
2153
- for (const d in n.data)
2153
+ for (const i in n.data)
2154
2154
  s.push({
2155
- key: a._parse(new O(n, d, n.path, d)),
2156
- value: o._parse(new O(n, n.data[d], n.path, d)),
2157
- alwaysSet: d in n.data
2155
+ key: a._parse(new R(n, i, n.path, i)),
2156
+ value: o._parse(new R(n, n.data[i], n.path, i)),
2157
+ alwaysSet: i in n.data
2158
2158
  });
2159
- return n.common.async ? w.mergeObjectAsync(t, s) : w.mergeObjectSync(t, s);
2159
+ return n.common.async ? C.mergeObjectAsync(t, s) : C.mergeObjectSync(t, s);
2160
2160
  }
2161
2161
  get element() {
2162
2162
  return this._def.valueType;
2163
2163
  }
2164
2164
  static create(e, t, n) {
2165
- return t instanceof _ ? new ie({
2165
+ return t instanceof _ ? new de({
2166
2166
  keyType: e,
2167
2167
  valueType: t,
2168
2168
  typeName: y.ZodRecord,
2169
2169
  ...v(n)
2170
- }) : new ie({
2171
- keyType: C.create(),
2170
+ }) : new de({
2171
+ keyType: N.create(),
2172
2172
  valueType: e,
2173
2173
  typeName: y.ZodRecord,
2174
2174
  ...v(t)
2175
2175
  });
2176
2176
  }
2177
2177
  }
2178
- class be extends _ {
2178
+ class Te extends _ {
2179
2179
  get keySchema() {
2180
2180
  return this._def.keyType;
2181
2181
  }
@@ -2185,63 +2185,63 @@ class be extends _ {
2185
2185
  _parse(e) {
2186
2186
  const { status: t, ctx: n } = this._processInputParams(e);
2187
2187
  if (n.parsedType !== h.map)
2188
- return l(n, {
2189
- code: c.invalid_type,
2188
+ return f(n, {
2189
+ code: d.invalid_type,
2190
2190
  expected: h.map,
2191
2191
  received: n.parsedType
2192
2192
  }), g;
2193
- const s = this._def.keyType, a = this._def.valueType, o = [...n.data.entries()].map(([d, f], u) => ({
2194
- key: s._parse(new O(n, d, n.path, [u, "key"])),
2195
- value: a._parse(new O(n, f, n.path, [u, "value"]))
2193
+ const s = this._def.keyType, a = this._def.valueType, o = [...n.data.entries()].map(([i, l], u) => ({
2194
+ key: s._parse(new R(n, i, n.path, [u, "key"])),
2195
+ value: a._parse(new R(n, l, n.path, [u, "value"]))
2196
2196
  }));
2197
2197
  if (n.common.async) {
2198
- const d = /* @__PURE__ */ new Map();
2198
+ const i = /* @__PURE__ */ new Map();
2199
2199
  return Promise.resolve().then(async () => {
2200
- for (const f of o) {
2201
- const u = await f.key, p = await f.value;
2200
+ for (const l of o) {
2201
+ const u = await l.key, p = await l.value;
2202
2202
  if (u.status === "aborted" || p.status === "aborted")
2203
2203
  return g;
2204
- (u.status === "dirty" || p.status === "dirty") && t.dirty(), d.set(u.value, p.value);
2204
+ (u.status === "dirty" || p.status === "dirty") && t.dirty(), i.set(u.value, p.value);
2205
2205
  }
2206
- return { status: t.value, value: d };
2206
+ return { status: t.value, value: i };
2207
2207
  });
2208
2208
  } else {
2209
- const d = /* @__PURE__ */ new Map();
2210
- for (const f of o) {
2211
- const u = f.key, p = f.value;
2209
+ const i = /* @__PURE__ */ new Map();
2210
+ for (const l of o) {
2211
+ const u = l.key, p = l.value;
2212
2212
  if (u.status === "aborted" || p.status === "aborted")
2213
2213
  return g;
2214
- (u.status === "dirty" || p.status === "dirty") && t.dirty(), d.set(u.value, p.value);
2214
+ (u.status === "dirty" || p.status === "dirty") && t.dirty(), i.set(u.value, p.value);
2215
2215
  }
2216
- return { status: t.value, value: d };
2216
+ return { status: t.value, value: i };
2217
2217
  }
2218
2218
  }
2219
2219
  }
2220
- be.create = (r, e, t) => new be({
2220
+ Te.create = (r, e, t) => new Te({
2221
2221
  valueType: e,
2222
2222
  keyType: r,
2223
2223
  typeName: y.ZodMap,
2224
2224
  ...v(t)
2225
2225
  });
2226
- class F extends _ {
2226
+ class W extends _ {
2227
2227
  _parse(e) {
2228
2228
  const { status: t, ctx: n } = this._processInputParams(e);
2229
2229
  if (n.parsedType !== h.set)
2230
- return l(n, {
2231
- code: c.invalid_type,
2230
+ return f(n, {
2231
+ code: d.invalid_type,
2232
2232
  expected: h.set,
2233
2233
  received: n.parsedType
2234
2234
  }), g;
2235
2235
  const s = this._def;
2236
- s.minSize !== null && n.data.size < s.minSize.value && (l(n, {
2237
- code: c.too_small,
2236
+ s.minSize !== null && n.data.size < s.minSize.value && (f(n, {
2237
+ code: d.too_small,
2238
2238
  minimum: s.minSize.value,
2239
2239
  type: "set",
2240
2240
  inclusive: !0,
2241
2241
  exact: !1,
2242
2242
  message: s.minSize.message
2243
- }), t.dirty()), s.maxSize !== null && n.data.size > s.maxSize.value && (l(n, {
2244
- code: c.too_big,
2243
+ }), t.dirty()), s.maxSize !== null && n.data.size > s.maxSize.value && (f(n, {
2244
+ code: d.too_big,
2245
2245
  maximum: s.maxSize.value,
2246
2246
  type: "set",
2247
2247
  inclusive: !0,
@@ -2249,26 +2249,26 @@ class F extends _ {
2249
2249
  message: s.maxSize.message
2250
2250
  }), t.dirty());
2251
2251
  const a = this._def.valueType;
2252
- function o(f) {
2252
+ function o(l) {
2253
2253
  const u = /* @__PURE__ */ new Set();
2254
- for (const p of f) {
2254
+ for (const p of l) {
2255
2255
  if (p.status === "aborted")
2256
2256
  return g;
2257
2257
  p.status === "dirty" && t.dirty(), u.add(p.value);
2258
2258
  }
2259
2259
  return { status: t.value, value: u };
2260
2260
  }
2261
- const d = [...n.data.values()].map((f, u) => a._parse(new O(n, f, n.path, u)));
2262
- return n.common.async ? Promise.all(d).then((f) => o(f)) : o(d);
2261
+ const i = [...n.data.values()].map((l, u) => a._parse(new R(n, l, n.path, u)));
2262
+ return n.common.async ? Promise.all(i).then((l) => o(l)) : o(i);
2263
2263
  }
2264
2264
  min(e, t) {
2265
- return new F({
2265
+ return new W({
2266
2266
  ...this._def,
2267
2267
  minSize: { value: e, message: m.toString(t) }
2268
2268
  });
2269
2269
  }
2270
2270
  max(e, t) {
2271
- return new F({
2271
+ return new W({
2272
2272
  ...this._def,
2273
2273
  maxSize: { value: e, message: m.toString(t) }
2274
2274
  });
@@ -2280,78 +2280,78 @@ class F extends _ {
2280
2280
  return this.min(1, e);
2281
2281
  }
2282
2282
  }
2283
- F.create = (r, e) => new F({
2283
+ W.create = (r, e) => new W({
2284
2284
  valueType: r,
2285
2285
  minSize: null,
2286
2286
  maxSize: null,
2287
2287
  typeName: y.ZodSet,
2288
2288
  ...v(e)
2289
2289
  });
2290
- class q extends _ {
2290
+ class Y extends _ {
2291
2291
  constructor() {
2292
2292
  super(...arguments), this.validate = this.implement;
2293
2293
  }
2294
2294
  _parse(e) {
2295
2295
  const { ctx: t } = this._processInputParams(e);
2296
2296
  if (t.parsedType !== h.function)
2297
- return l(t, {
2298
- code: c.invalid_type,
2297
+ return f(t, {
2298
+ code: d.invalid_type,
2299
2299
  expected: h.function,
2300
2300
  received: t.parsedType
2301
2301
  }), g;
2302
- function n(d, f) {
2303
- return ye({
2304
- data: d,
2302
+ function n(i, l) {
2303
+ return be({
2304
+ data: i,
2305
2305
  path: t.path,
2306
2306
  errorMaps: [
2307
2307
  t.common.contextualErrorMap,
2308
2308
  t.schemaErrorMap,
2309
- pe(),
2310
- Y
2309
+ _e(),
2310
+ G
2311
2311
  ].filter((u) => !!u),
2312
2312
  issueData: {
2313
- code: c.invalid_arguments,
2314
- argumentsError: f
2313
+ code: d.invalid_arguments,
2314
+ argumentsError: l
2315
2315
  }
2316
2316
  });
2317
2317
  }
2318
- function s(d, f) {
2319
- return ye({
2320
- data: d,
2318
+ function s(i, l) {
2319
+ return be({
2320
+ data: i,
2321
2321
  path: t.path,
2322
2322
  errorMaps: [
2323
2323
  t.common.contextualErrorMap,
2324
2324
  t.schemaErrorMap,
2325
- pe(),
2326
- Y
2325
+ _e(),
2326
+ G
2327
2327
  ].filter((u) => !!u),
2328
2328
  issueData: {
2329
- code: c.invalid_return_type,
2330
- returnTypeError: f
2329
+ code: d.invalid_return_type,
2330
+ returnTypeError: l
2331
2331
  }
2332
2332
  });
2333
2333
  }
2334
2334
  const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
2335
- if (this._def.returns instanceof G) {
2336
- const d = this;
2337
- return S(async function(...f) {
2338
- const u = new Z([]), p = await d._def.args.parseAsync(f, a).catch((we) => {
2339
- throw u.addIssue(n(f, we)), u;
2340
- }), T = await Reflect.apply(o, this, p);
2341
- return await d._def.returns._def.type.parseAsync(T, a).catch((we) => {
2342
- throw u.addIssue(s(T, we)), u;
2335
+ if (this._def.returns instanceof K) {
2336
+ const i = this;
2337
+ return S(async function(...l) {
2338
+ const u = new Z([]), p = await i._def.args.parseAsync(l, a).catch((w) => {
2339
+ throw u.addIssue(n(l, w)), u;
2340
+ }), x = await Reflect.apply(o, this, p);
2341
+ return await i._def.returns._def.type.parseAsync(x, a).catch((w) => {
2342
+ throw u.addIssue(s(x, w)), u;
2343
2343
  });
2344
2344
  });
2345
2345
  } else {
2346
- const d = this;
2347
- return S(function(...f) {
2348
- const u = d._def.args.safeParse(f, a);
2346
+ const i = this;
2347
+ return S(function(...l) {
2348
+ const u = i._def.args.safeParse(l, a);
2349
2349
  if (!u.success)
2350
- throw new Z([n(f, u.error)]);
2351
- const p = Reflect.apply(o, this, u.data), T = d._def.returns.safeParse(p, a);
2352
- if (!T.success)
2353
- throw new Z([s(p, T.error)]);
2354
- return T.data;
2350
+ throw new Z([n(l, u.error)]);
2351
+ const p = Reflect.apply(o, this, u.data), x = i._def.returns.safeParse(p, a);
2352
+ if (!x.success)
2353
+ throw new Z([s(p, x.error)]);
2354
+ return x.data;
2355
2355
  });
2356
2356
  }
2357
2357
  }
@@ -2362,13 +2362,13 @@ class q extends _ {
2362
2362
  return this._def.returns;
2363
2363
  }
2364
2364
  args(...e) {
2365
- return new q({
2365
+ return new Y({
2366
2366
  ...this._def,
2367
- args: j.create(e).rest(L.create())
2367
+ args: P.create(e).rest(U.create())
2368
2368
  });
2369
2369
  }
2370
2370
  returns(e) {
2371
- return new q({
2371
+ return new Y({
2372
2372
  ...this._def,
2373
2373
  returns: e
2374
2374
  });
@@ -2380,15 +2380,15 @@ class q extends _ {
2380
2380
  return this.parse(e);
2381
2381
  }
2382
2382
  static create(e, t, n) {
2383
- return new q({
2384
- args: e || j.create([]).rest(L.create()),
2385
- returns: t || L.create(),
2383
+ return new Y({
2384
+ args: e || P.create([]).rest(U.create()),
2385
+ returns: t || U.create(),
2386
2386
  typeName: y.ZodFunction,
2387
2387
  ...v(n)
2388
2388
  });
2389
2389
  }
2390
2390
  }
2391
- class oe extends _ {
2391
+ class ue extends _ {
2392
2392
  get schema() {
2393
2393
  return this._def.getter();
2394
2394
  }
@@ -2397,18 +2397,18 @@ class oe extends _ {
2397
2397
  return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
2398
2398
  }
2399
2399
  }
2400
- oe.create = (r, e) => new oe({
2400
+ ue.create = (r, e) => new ue({
2401
2401
  getter: r,
2402
2402
  typeName: y.ZodLazy,
2403
2403
  ...v(e)
2404
2404
  });
2405
- class de extends _ {
2405
+ class le extends _ {
2406
2406
  _parse(e) {
2407
2407
  if (e.data !== this._def.value) {
2408
2408
  const t = this._getOrReturnCtx(e);
2409
- return l(t, {
2409
+ return f(t, {
2410
2410
  received: t.data,
2411
- code: c.invalid_literal,
2411
+ code: d.invalid_literal,
2412
2412
  expected: this._def.value
2413
2413
  }), g;
2414
2414
  }
@@ -2418,36 +2418,36 @@ class de extends _ {
2418
2418
  return this._def.value;
2419
2419
  }
2420
2420
  }
2421
- de.create = (r, e) => new de({
2421
+ le.create = (r, e) => new le({
2422
2422
  value: r,
2423
2423
  typeName: y.ZodLiteral,
2424
2424
  ...v(e)
2425
2425
  });
2426
- function ze(r, e) {
2427
- return new V({
2426
+ function Qe(r, e) {
2427
+ return new z({
2428
2428
  values: r,
2429
2429
  typeName: y.ZodEnum,
2430
2430
  ...v(e)
2431
2431
  });
2432
2432
  }
2433
- class V extends _ {
2433
+ class z extends _ {
2434
2434
  constructor() {
2435
- super(...arguments), X.set(this, void 0);
2435
+ super(...arguments), te.set(this, void 0);
2436
2436
  }
2437
2437
  _parse(e) {
2438
2438
  if (typeof e.data != "string") {
2439
2439
  const t = this._getOrReturnCtx(e), n = this._def.values;
2440
- return l(t, {
2440
+ return f(t, {
2441
2441
  expected: b.joinValues(n),
2442
2442
  received: t.parsedType,
2443
- code: c.invalid_type
2443
+ code: d.invalid_type
2444
2444
  }), g;
2445
2445
  }
2446
- if (ge(this, X) || Me(this, X, new Set(this._def.values)), !ge(this, X).has(e.data)) {
2446
+ if (xe(this, te) || Be(this, te, new Set(this._def.values)), !xe(this, te).has(e.data)) {
2447
2447
  const t = this._getOrReturnCtx(e), n = this._def.values;
2448
- return l(t, {
2448
+ return f(t, {
2449
2449
  received: t.data,
2450
- code: c.invalid_enum_value,
2450
+ code: d.invalid_enum_value,
2451
2451
  options: n
2452
2452
  }), g;
2453
2453
  }
@@ -2475,39 +2475,39 @@ class V extends _ {
2475
2475
  return e;
2476
2476
  }
2477
2477
  extract(e, t = this._def) {
2478
- return V.create(e, {
2478
+ return z.create(e, {
2479
2479
  ...this._def,
2480
2480
  ...t
2481
2481
  });
2482
2482
  }
2483
2483
  exclude(e, t = this._def) {
2484
- return V.create(this.options.filter((n) => !e.includes(n)), {
2484
+ return z.create(this.options.filter((n) => !e.includes(n)), {
2485
2485
  ...this._def,
2486
2486
  ...t
2487
2487
  });
2488
2488
  }
2489
2489
  }
2490
- X = /* @__PURE__ */ new WeakMap();
2491
- V.create = ze;
2492
- class ce extends _ {
2490
+ te = /* @__PURE__ */ new WeakMap();
2491
+ z.create = Qe;
2492
+ class fe extends _ {
2493
2493
  constructor() {
2494
- super(...arguments), K.set(this, void 0);
2494
+ super(...arguments), re.set(this, void 0);
2495
2495
  }
2496
2496
  _parse(e) {
2497
2497
  const t = b.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
2498
2498
  if (n.parsedType !== h.string && n.parsedType !== h.number) {
2499
2499
  const s = b.objectValues(t);
2500
- return l(n, {
2500
+ return f(n, {
2501
2501
  expected: b.joinValues(s),
2502
2502
  received: n.parsedType,
2503
- code: c.invalid_type
2503
+ code: d.invalid_type
2504
2504
  }), g;
2505
2505
  }
2506
- if (ge(this, K) || Me(this, K, new Set(b.getValidEnumValues(this._def.values))), !ge(this, K).has(e.data)) {
2506
+ if (xe(this, re) || Be(this, re, new Set(b.getValidEnumValues(this._def.values))), !xe(this, re).has(e.data)) {
2507
2507
  const s = b.objectValues(t);
2508
- return l(n, {
2508
+ return f(n, {
2509
2509
  received: n.data,
2510
- code: c.invalid_enum_value,
2510
+ code: d.invalid_enum_value,
2511
2511
  options: s
2512
2512
  }), g;
2513
2513
  }
@@ -2517,21 +2517,21 @@ class ce extends _ {
2517
2517
  return this._def.values;
2518
2518
  }
2519
2519
  }
2520
- K = /* @__PURE__ */ new WeakMap();
2521
- ce.create = (r, e) => new ce({
2520
+ re = /* @__PURE__ */ new WeakMap();
2521
+ fe.create = (r, e) => new fe({
2522
2522
  values: r,
2523
2523
  typeName: y.ZodNativeEnum,
2524
2524
  ...v(e)
2525
2525
  });
2526
- class G extends _ {
2526
+ class K extends _ {
2527
2527
  unwrap() {
2528
2528
  return this._def.type;
2529
2529
  }
2530
2530
  _parse(e) {
2531
2531
  const { ctx: t } = this._processInputParams(e);
2532
2532
  if (t.parsedType !== h.promise && t.common.async === !1)
2533
- return l(t, {
2534
- code: c.invalid_type,
2533
+ return f(t, {
2534
+ code: d.invalid_type,
2535
2535
  expected: h.promise,
2536
2536
  received: t.parsedType
2537
2537
  }), g;
@@ -2542,12 +2542,12 @@ class G extends _ {
2542
2542
  })));
2543
2543
  }
2544
2544
  }
2545
- G.create = (r, e) => new G({
2545
+ K.create = (r, e) => new K({
2546
2546
  type: r,
2547
2547
  typeName: y.ZodPromise,
2548
2548
  ...v(e)
2549
2549
  });
2550
- class A extends _ {
2550
+ class j extends _ {
2551
2551
  innerType() {
2552
2552
  return this._def.schema;
2553
2553
  }
@@ -2557,7 +2557,7 @@ class A extends _ {
2557
2557
  _parse(e) {
2558
2558
  const { status: t, ctx: n } = this._processInputParams(e), s = this._def.effect || null, a = {
2559
2559
  addIssue: (o) => {
2560
- l(n, o), o.fatal ? t.abort() : t.dirty();
2560
+ f(n, o), o.fatal ? t.abort() : t.dirty();
2561
2561
  },
2562
2562
  get path() {
2563
2563
  return n.path;
@@ -2566,45 +2566,45 @@ class A extends _ {
2566
2566
  if (a.addIssue = a.addIssue.bind(a), s.type === "preprocess") {
2567
2567
  const o = s.transform(n.data, a);
2568
2568
  if (n.common.async)
2569
- return Promise.resolve(o).then(async (d) => {
2569
+ return Promise.resolve(o).then(async (i) => {
2570
2570
  if (t.value === "aborted")
2571
2571
  return g;
2572
- const f = await this._def.schema._parseAsync({
2573
- data: d,
2572
+ const l = await this._def.schema._parseAsync({
2573
+ data: i,
2574
2574
  path: n.path,
2575
2575
  parent: n
2576
2576
  });
2577
- return f.status === "aborted" ? g : f.status === "dirty" || t.value === "dirty" ? W(f.value) : f;
2577
+ return l.status === "aborted" ? g : l.status === "dirty" || t.value === "dirty" ? Q(l.value) : l;
2578
2578
  });
2579
2579
  {
2580
2580
  if (t.value === "aborted")
2581
2581
  return g;
2582
- const d = this._def.schema._parseSync({
2582
+ const i = this._def.schema._parseSync({
2583
2583
  data: o,
2584
2584
  path: n.path,
2585
2585
  parent: n
2586
2586
  });
2587
- return d.status === "aborted" ? g : d.status === "dirty" || t.value === "dirty" ? W(d.value) : d;
2587
+ return i.status === "aborted" ? g : i.status === "dirty" || t.value === "dirty" ? Q(i.value) : i;
2588
2588
  }
2589
2589
  }
2590
2590
  if (s.type === "refinement") {
2591
- const o = (d) => {
2592
- const f = s.refinement(d, a);
2591
+ const o = (i) => {
2592
+ const l = s.refinement(i, a);
2593
2593
  if (n.common.async)
2594
- return Promise.resolve(f);
2595
- if (f instanceof Promise)
2594
+ return Promise.resolve(l);
2595
+ if (l instanceof Promise)
2596
2596
  throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
2597
- return d;
2597
+ return i;
2598
2598
  };
2599
2599
  if (n.common.async === !1) {
2600
- const d = this._def.schema._parseSync({
2600
+ const i = this._def.schema._parseSync({
2601
2601
  data: n.data,
2602
2602
  path: n.path,
2603
2603
  parent: n
2604
2604
  });
2605
- return d.status === "aborted" ? g : (d.status === "dirty" && t.dirty(), o(d.value), { status: t.value, value: d.value });
2605
+ return i.status === "aborted" ? g : (i.status === "dirty" && t.dirty(), o(i.value), { status: t.value, value: i.value });
2606
2606
  } else
2607
- return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((d) => d.status === "aborted" ? g : (d.status === "dirty" && t.dirty(), o(d.value).then(() => ({ status: t.value, value: d.value }))));
2607
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => i.status === "aborted" ? g : (i.status === "dirty" && t.dirty(), o(i.value).then(() => ({ status: t.value, value: i.value }))));
2608
2608
  }
2609
2609
  if (s.type === "transform")
2610
2610
  if (n.common.async === !1) {
@@ -2613,30 +2613,30 @@ class A extends _ {
2613
2613
  path: n.path,
2614
2614
  parent: n
2615
2615
  });
2616
- if (!z(o))
2616
+ if (!B(o))
2617
2617
  return o;
2618
- const d = s.transform(o.value, a);
2619
- if (d instanceof Promise)
2618
+ const i = s.transform(o.value, a);
2619
+ if (i instanceof Promise)
2620
2620
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2621
- return { status: t.value, value: d };
2621
+ return { status: t.value, value: i };
2622
2622
  } else
2623
- return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => z(o) ? Promise.resolve(s.transform(o.value, a)).then((d) => ({ status: t.value, value: d })) : o);
2623
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => B(o) ? Promise.resolve(s.transform(o.value, a)).then((i) => ({ status: t.value, value: i })) : o);
2624
2624
  b.assertNever(s);
2625
2625
  }
2626
2626
  }
2627
- A.create = (r, e, t) => new A({
2627
+ j.create = (r, e, t) => new j({
2628
2628
  schema: r,
2629
2629
  typeName: y.ZodEffects,
2630
2630
  effect: e,
2631
2631
  ...v(t)
2632
2632
  });
2633
- A.createWithPreprocess = (r, e, t) => new A({
2633
+ j.createWithPreprocess = (r, e, t) => new j({
2634
2634
  schema: e,
2635
2635
  effect: { type: "preprocess", transform: r },
2636
2636
  typeName: y.ZodEffects,
2637
2637
  ...v(t)
2638
2638
  });
2639
- class N extends _ {
2639
+ class E extends _ {
2640
2640
  _parse(e) {
2641
2641
  return this._getType(e) === h.undefined ? S(void 0) : this._def.innerType._parse(e);
2642
2642
  }
@@ -2644,12 +2644,12 @@ class N extends _ {
2644
2644
  return this._def.innerType;
2645
2645
  }
2646
2646
  }
2647
- N.create = (r, e) => new N({
2647
+ E.create = (r, e) => new E({
2648
2648
  innerType: r,
2649
2649
  typeName: y.ZodOptional,
2650
2650
  ...v(e)
2651
2651
  });
2652
- class D extends _ {
2652
+ class F extends _ {
2653
2653
  _parse(e) {
2654
2654
  return this._getType(e) === h.null ? S(null) : this._def.innerType._parse(e);
2655
2655
  }
@@ -2657,12 +2657,12 @@ class D extends _ {
2657
2657
  return this._def.innerType;
2658
2658
  }
2659
2659
  }
2660
- D.create = (r, e) => new D({
2660
+ F.create = (r, e) => new F({
2661
2661
  innerType: r,
2662
2662
  typeName: y.ZodNullable,
2663
2663
  ...v(e)
2664
2664
  });
2665
- class ue extends _ {
2665
+ class he extends _ {
2666
2666
  _parse(e) {
2667
2667
  const { ctx: t } = this._processInputParams(e);
2668
2668
  let n = t.data;
@@ -2676,13 +2676,13 @@ class ue extends _ {
2676
2676
  return this._def.innerType;
2677
2677
  }
2678
2678
  }
2679
- ue.create = (r, e) => new ue({
2679
+ he.create = (r, e) => new he({
2680
2680
  innerType: r,
2681
2681
  typeName: y.ZodDefault,
2682
2682
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2683
2683
  ...v(e)
2684
2684
  });
2685
- class le extends _ {
2685
+ class pe extends _ {
2686
2686
  _parse(e) {
2687
2687
  const { ctx: t } = this._processInputParams(e), n = {
2688
2688
  ...t,
@@ -2697,7 +2697,7 @@ class le extends _ {
2697
2697
  ...n
2698
2698
  }
2699
2699
  });
2700
- return ee(s) ? s.then((a) => ({
2700
+ return ne(s) ? s.then((a) => ({
2701
2701
  status: "valid",
2702
2702
  value: a.status === "valid" ? a.value : this._def.catchValue({
2703
2703
  get error() {
@@ -2719,18 +2719,18 @@ class le extends _ {
2719
2719
  return this._def.innerType;
2720
2720
  }
2721
2721
  }
2722
- le.create = (r, e) => new le({
2722
+ pe.create = (r, e) => new pe({
2723
2723
  innerType: r,
2724
2724
  typeName: y.ZodCatch,
2725
2725
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2726
2726
  ...v(e)
2727
2727
  });
2728
- class xe extends _ {
2728
+ class Ce extends _ {
2729
2729
  _parse(e) {
2730
2730
  if (this._getType(e) !== h.nan) {
2731
2731
  const n = this._getOrReturnCtx(e);
2732
- return l(n, {
2733
- code: c.invalid_type,
2732
+ return f(n, {
2733
+ code: d.invalid_type,
2734
2734
  expected: h.nan,
2735
2735
  received: n.parsedType
2736
2736
  }), g;
@@ -2738,12 +2738,12 @@ class xe extends _ {
2738
2738
  return { status: "valid", value: e.data };
2739
2739
  }
2740
2740
  }
2741
- xe.create = (r) => new xe({
2741
+ Ce.create = (r) => new Ce({
2742
2742
  typeName: y.ZodNaN,
2743
2743
  ...v(r)
2744
2744
  });
2745
- const vt = Symbol("zod_brand");
2746
- class Ne extends _ {
2745
+ const Nt = Symbol("zod_brand");
2746
+ class Re extends _ {
2747
2747
  _parse(e) {
2748
2748
  const { ctx: t } = this._processInputParams(e), n = t.data;
2749
2749
  return this._def.type._parse({
@@ -2756,7 +2756,7 @@ class Ne extends _ {
2756
2756
  return this._def.type;
2757
2757
  }
2758
2758
  }
2759
- class he extends _ {
2759
+ class ye extends _ {
2760
2760
  _parse(e) {
2761
2761
  const { status: t, ctx: n } = this._processInputParams(e);
2762
2762
  if (n.common.async)
@@ -2766,7 +2766,7 @@ class he extends _ {
2766
2766
  path: n.path,
2767
2767
  parent: n
2768
2768
  });
2769
- return a.status === "aborted" ? g : a.status === "dirty" ? (t.dirty(), W(a.value)) : this._def.out._parseAsync({
2769
+ return a.status === "aborted" ? g : a.status === "dirty" ? (t.dirty(), Q(a.value)) : this._def.out._parseAsync({
2770
2770
  data: a.value,
2771
2771
  path: n.path,
2772
2772
  parent: n
@@ -2789,307 +2789,307 @@ class he extends _ {
2789
2789
  }
2790
2790
  }
2791
2791
  static create(e, t) {
2792
- return new he({
2792
+ return new ye({
2793
2793
  in: e,
2794
2794
  out: t,
2795
2795
  typeName: y.ZodPipeline
2796
2796
  });
2797
2797
  }
2798
2798
  }
2799
- class fe extends _ {
2799
+ class me extends _ {
2800
2800
  _parse(e) {
2801
- const t = this._def.innerType._parse(e), n = (s) => (z(s) && (s.value = Object.freeze(s.value)), s);
2802
- return ee(t) ? t.then((s) => n(s)) : n(t);
2801
+ const t = this._def.innerType._parse(e), n = (s) => (B(s) && (s.value = Object.freeze(s.value)), s);
2802
+ return ne(t) ? t.then((s) => n(s)) : n(t);
2803
2803
  }
2804
2804
  unwrap() {
2805
2805
  return this._def.innerType;
2806
2806
  }
2807
2807
  }
2808
- fe.create = (r, e) => new fe({
2808
+ me.create = (r, e) => new me({
2809
2809
  innerType: r,
2810
2810
  typeName: y.ZodReadonly,
2811
2811
  ...v(e)
2812
2812
  });
2813
- function Re(r, e) {
2813
+ function ze(r, e) {
2814
2814
  const t = typeof r == "function" ? r(e) : typeof r == "string" ? { message: r } : r;
2815
2815
  return typeof t == "string" ? { message: t } : t;
2816
2816
  }
2817
- function Ue(r, e = {}, t) {
2818
- return r ? H.create().superRefine((n, s) => {
2817
+ function Ye(r, e = {}, t) {
2818
+ return r ? X.create().superRefine((n, s) => {
2819
2819
  var a, o;
2820
- const d = r(n);
2821
- if (d instanceof Promise)
2822
- return d.then((f) => {
2820
+ const i = r(n);
2821
+ if (i instanceof Promise)
2822
+ return i.then((l) => {
2823
2823
  var u, p;
2824
- if (!f) {
2825
- const T = Re(e, n), me = (p = (u = T.fatal) !== null && u !== void 0 ? u : t) !== null && p !== void 0 ? p : !0;
2826
- s.addIssue({ code: "custom", ...T, fatal: me });
2824
+ if (!l) {
2825
+ const x = ze(e, n), I = (p = (u = x.fatal) !== null && u !== void 0 ? u : t) !== null && p !== void 0 ? p : !0;
2826
+ s.addIssue({ code: "custom", ...x, fatal: I });
2827
2827
  }
2828
2828
  });
2829
- if (!d) {
2830
- const f = Re(e, n), u = (o = (a = f.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0;
2831
- s.addIssue({ code: "custom", ...f, fatal: u });
2829
+ if (!i) {
2830
+ const l = ze(e, n), u = (o = (a = l.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0;
2831
+ s.addIssue({ code: "custom", ...l, fatal: u });
2832
2832
  }
2833
- }) : H.create();
2833
+ }) : X.create();
2834
2834
  }
2835
- const _t = {
2836
- object: x.lazycreate
2835
+ const Ot = {
2836
+ object: k.lazycreate
2837
2837
  };
2838
2838
  var y;
2839
2839
  (function(r) {
2840
2840
  r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
2841
2841
  })(y || (y = {}));
2842
- const bt = (r, e = {
2842
+ const jt = (r, e = {
2843
2843
  message: `Input not instance of ${r.name}`
2844
- }) => Ue((t) => t instanceof r, e), Fe = C.create, Be = $.create, xt = xe.create, kt = M.create, We = te.create, wt = U.create, Tt = ve.create, St = re.create, Zt = ne.create, Ct = H.create, It = L.create, At = P.create, Nt = _e.create, Ot = I.create, jt = x.create, Et = x.strictCreate, Rt = se.create, Pt = ke.create, $t = ae.create, Mt = j.create, Vt = ie.create, Dt = be.create, Lt = F.create, zt = q.create, Ut = oe.create, Ft = de.create, Bt = V.create, Wt = ce.create, qt = G.create, Pe = A.create, Jt = N.create, Yt = D.create, Ht = A.createWithPreprocess, Gt = he.create, Qt = () => Fe().optional(), Xt = () => Be().optional(), Kt = () => We().optional(), er = {
2845
- string: (r) => C.create({ ...r, coerce: !0 }),
2846
- number: (r) => $.create({ ...r, coerce: !0 }),
2847
- boolean: (r) => te.create({
2844
+ }) => Ye((t) => t instanceof r, e), He = N.create, Ge = M.create, Et = Ce.create, Rt = L.create, Xe = se.create, Pt = q.create, $t = ke.create, Vt = ae.create, Dt = ie.create, Mt = X.create, Lt = U.create, zt = D.create, Ft = we.create, Ut = O.create, Bt = k.create, qt = k.strictCreate, Wt = oe.create, Jt = Se.create, Qt = ce.create, Yt = P.create, Ht = de.create, Gt = Te.create, Xt = W.create, Kt = Y.create, er = ue.create, tr = le.create, rr = z.create, nr = fe.create, sr = K.create, Fe = j.create, ar = E.create, ir = F.create, or = j.createWithPreprocess, cr = ye.create, dr = () => He().optional(), ur = () => Ge().optional(), lr = () => Xe().optional(), fr = {
2845
+ string: (r) => N.create({ ...r, coerce: !0 }),
2846
+ number: (r) => M.create({ ...r, coerce: !0 }),
2847
+ boolean: (r) => se.create({
2848
2848
  ...r,
2849
2849
  coerce: !0
2850
2850
  }),
2851
- bigint: (r) => M.create({ ...r, coerce: !0 }),
2852
- date: (r) => U.create({ ...r, coerce: !0 })
2853
- }, tr = g;
2854
- var i = /* @__PURE__ */ Object.freeze({
2851
+ bigint: (r) => L.create({ ...r, coerce: !0 }),
2852
+ date: (r) => q.create({ ...r, coerce: !0 })
2853
+ }, hr = g;
2854
+ var c = /* @__PURE__ */ Object.freeze({
2855
2855
  __proto__: null,
2856
- defaultErrorMap: Y,
2857
- setErrorMap: He,
2858
- getErrorMap: pe,
2859
- makeIssue: ye,
2860
- EMPTY_PATH: Ge,
2861
- addIssueToContext: l,
2862
- ParseStatus: w,
2856
+ defaultErrorMap: G,
2857
+ setErrorMap: ot,
2858
+ getErrorMap: _e,
2859
+ makeIssue: be,
2860
+ EMPTY_PATH: ct,
2861
+ addIssueToContext: f,
2862
+ ParseStatus: C,
2863
2863
  INVALID: g,
2864
- DIRTY: W,
2864
+ DIRTY: Q,
2865
2865
  OK: S,
2866
- isAborted: Ce,
2867
- isDirty: Ie,
2868
- isValid: z,
2869
- isAsync: ee,
2866
+ isAborted: Oe,
2867
+ isDirty: je,
2868
+ isValid: B,
2869
+ isAsync: ne,
2870
2870
  get util() {
2871
2871
  return b;
2872
2872
  },
2873
2873
  get objectUtil() {
2874
- return Ze;
2874
+ return Ne;
2875
2875
  },
2876
2876
  ZodParsedType: h,
2877
- getParsedType: R,
2877
+ getParsedType: V,
2878
2878
  ZodType: _,
2879
- datetimeRegex: Le,
2880
- ZodString: C,
2881
- ZodNumber: $,
2882
- ZodBigInt: M,
2883
- ZodBoolean: te,
2884
- ZodDate: U,
2885
- ZodSymbol: ve,
2886
- ZodUndefined: re,
2887
- ZodNull: ne,
2888
- ZodAny: H,
2889
- ZodUnknown: L,
2890
- ZodNever: P,
2891
- ZodVoid: _e,
2892
- ZodArray: I,
2893
- ZodObject: x,
2894
- ZodUnion: se,
2895
- ZodDiscriminatedUnion: ke,
2896
- ZodIntersection: ae,
2897
- ZodTuple: j,
2898
- ZodRecord: ie,
2899
- ZodMap: be,
2900
- ZodSet: F,
2901
- ZodFunction: q,
2902
- ZodLazy: oe,
2903
- ZodLiteral: de,
2904
- ZodEnum: V,
2905
- ZodNativeEnum: ce,
2906
- ZodPromise: G,
2907
- ZodEffects: A,
2908
- ZodTransformer: A,
2909
- ZodOptional: N,
2910
- ZodNullable: D,
2911
- ZodDefault: ue,
2912
- ZodCatch: le,
2913
- ZodNaN: xe,
2914
- BRAND: vt,
2915
- ZodBranded: Ne,
2916
- ZodPipeline: he,
2917
- ZodReadonly: fe,
2918
- custom: Ue,
2879
+ datetimeRegex: Je,
2880
+ ZodString: N,
2881
+ ZodNumber: M,
2882
+ ZodBigInt: L,
2883
+ ZodBoolean: se,
2884
+ ZodDate: q,
2885
+ ZodSymbol: ke,
2886
+ ZodUndefined: ae,
2887
+ ZodNull: ie,
2888
+ ZodAny: X,
2889
+ ZodUnknown: U,
2890
+ ZodNever: D,
2891
+ ZodVoid: we,
2892
+ ZodArray: O,
2893
+ ZodObject: k,
2894
+ ZodUnion: oe,
2895
+ ZodDiscriminatedUnion: Se,
2896
+ ZodIntersection: ce,
2897
+ ZodTuple: P,
2898
+ ZodRecord: de,
2899
+ ZodMap: Te,
2900
+ ZodSet: W,
2901
+ ZodFunction: Y,
2902
+ ZodLazy: ue,
2903
+ ZodLiteral: le,
2904
+ ZodEnum: z,
2905
+ ZodNativeEnum: fe,
2906
+ ZodPromise: K,
2907
+ ZodEffects: j,
2908
+ ZodTransformer: j,
2909
+ ZodOptional: E,
2910
+ ZodNullable: F,
2911
+ ZodDefault: he,
2912
+ ZodCatch: pe,
2913
+ ZodNaN: Ce,
2914
+ BRAND: Nt,
2915
+ ZodBranded: Re,
2916
+ ZodPipeline: ye,
2917
+ ZodReadonly: me,
2918
+ custom: Ye,
2919
2919
  Schema: _,
2920
2920
  ZodSchema: _,
2921
- late: _t,
2921
+ late: Ot,
2922
2922
  get ZodFirstPartyTypeKind() {
2923
2923
  return y;
2924
2924
  },
2925
- coerce: er,
2926
- any: Ct,
2927
- array: Ot,
2928
- bigint: kt,
2929
- boolean: We,
2930
- date: wt,
2931
- discriminatedUnion: Pt,
2932
- effect: Pe,
2933
- enum: Bt,
2934
- function: zt,
2935
- instanceof: bt,
2936
- intersection: $t,
2937
- lazy: Ut,
2938
- literal: Ft,
2939
- map: Dt,
2940
- nan: xt,
2941
- nativeEnum: Wt,
2942
- never: At,
2943
- null: Zt,
2944
- nullable: Yt,
2945
- number: Be,
2946
- object: jt,
2947
- oboolean: Kt,
2948
- onumber: Xt,
2949
- optional: Jt,
2950
- ostring: Qt,
2951
- pipeline: Gt,
2952
- preprocess: Ht,
2953
- promise: qt,
2954
- record: Vt,
2955
- set: Lt,
2956
- strictObject: Et,
2957
- string: Fe,
2958
- symbol: Tt,
2959
- transformer: Pe,
2960
- tuple: Mt,
2961
- undefined: St,
2962
- union: Rt,
2963
- unknown: It,
2964
- void: Nt,
2965
- NEVER: tr,
2966
- ZodIssueCode: c,
2967
- quotelessJson: Ye,
2925
+ coerce: fr,
2926
+ any: Mt,
2927
+ array: Ut,
2928
+ bigint: Rt,
2929
+ boolean: Xe,
2930
+ date: Pt,
2931
+ discriminatedUnion: Jt,
2932
+ effect: Fe,
2933
+ enum: rr,
2934
+ function: Kt,
2935
+ instanceof: jt,
2936
+ intersection: Qt,
2937
+ lazy: er,
2938
+ literal: tr,
2939
+ map: Gt,
2940
+ nan: Et,
2941
+ nativeEnum: nr,
2942
+ never: zt,
2943
+ null: Dt,
2944
+ nullable: ir,
2945
+ number: Ge,
2946
+ object: Bt,
2947
+ oboolean: lr,
2948
+ onumber: ur,
2949
+ optional: ar,
2950
+ ostring: dr,
2951
+ pipeline: cr,
2952
+ preprocess: or,
2953
+ promise: sr,
2954
+ record: Ht,
2955
+ set: Xt,
2956
+ strictObject: qt,
2957
+ string: He,
2958
+ symbol: $t,
2959
+ transformer: Fe,
2960
+ tuple: Yt,
2961
+ undefined: Vt,
2962
+ union: Wt,
2963
+ unknown: Lt,
2964
+ void: Ft,
2965
+ NEVER: hr,
2966
+ ZodIssueCode: d,
2967
+ quotelessJson: it,
2968
2968
  ZodError: Z
2969
2969
  });
2970
- const k = i.string().min(1, { message: "שדה חובה" }), dr = i.string().regex(/^\d+$/, "Must be a numeric string"), rr = i.object({
2971
- country: k,
2972
- city: k,
2973
- street: k,
2974
- streetNumber: k,
2975
- floor: k,
2976
- apartmentEnterNumber: k,
2977
- apartmentNumber: k
2978
- }), J = i.object({
2979
- lang: i.enum(["he"]),
2980
- value: i.string()
2981
- }), cr = i.array(J), qe = i.object({
2982
- id: i.string().min(1),
2983
- companyId: i.string().min(1),
2984
- storeId: i.string().min(1),
2985
- parentId: i.string().nullish(),
2986
- tag: i.string().optional(),
2987
- locales: i.array(J),
2988
- depth: i.number()
2989
- }), Oe = qe.extend({
2990
- children: i.lazy(() => Oe.array())
2991
- }), ur = qe.extend({
2992
- index: i.number(),
2993
- depth: i.number(),
2994
- collapsed: i.boolean().optional(),
2995
- children: i.array(Oe)
2996
- }), Q = i.string().min(1), je = i.object({
2997
- type: i.literal("Product"),
2998
- storeId: Q,
2999
- companyId: Q,
3000
- id: Q,
3001
- objectID: Q,
3002
- sku: Q,
3003
- name: i.array(J),
3004
- description: i.array(J),
3005
- isPublished: i.boolean(),
3006
- vat: i.boolean(),
3007
- priceType: i.object({
3008
- type: i.enum(["unit", "kg", "gram", "liter", "ml"]),
3009
- value: i.number()
2970
+ const T = c.string().min(1, { message: "שדה חובה" }), _r = c.string().regex(/^\d+$/, "Must be a numeric string"), pr = c.object({
2971
+ country: T,
2972
+ city: T,
2973
+ street: T,
2974
+ streetNumber: T,
2975
+ floor: T,
2976
+ apartmentEnterNumber: T,
2977
+ apartmentNumber: T
2978
+ }), H = c.object({
2979
+ lang: c.enum(["he"]),
2980
+ value: c.string()
2981
+ }), br = c.array(H), Ke = c.object({
2982
+ id: c.string().min(1),
2983
+ companyId: c.string().min(1),
2984
+ storeId: c.string().min(1),
2985
+ parentId: c.string().nullish(),
2986
+ tag: c.string().optional(),
2987
+ locales: c.array(H),
2988
+ depth: c.number()
2989
+ }), Pe = Ke.extend({
2990
+ children: c.lazy(() => Pe.array())
2991
+ }), xr = Ke.extend({
2992
+ index: c.number(),
2993
+ depth: c.number(),
2994
+ collapsed: c.boolean().optional(),
2995
+ children: c.array(Pe)
2996
+ }), ee = c.string().min(1), et = c.object({
2997
+ type: c.literal("Product"),
2998
+ storeId: ee,
2999
+ companyId: ee,
3000
+ id: ee,
3001
+ objectID: ee,
3002
+ sku: ee,
3003
+ name: c.array(H),
3004
+ description: c.array(H),
3005
+ isPublished: c.boolean(),
3006
+ vat: c.boolean(),
3007
+ priceType: c.object({
3008
+ type: c.enum(["unit", "kg", "gram", "liter", "ml"]),
3009
+ value: c.number()
3010
3010
  }),
3011
- price: i.number().positive(),
3012
- purchasePrice: i.number().optional(),
3013
- profitPercentage: i.number().optional(),
3014
- currency: i.literal("ILS"),
3015
- discount: i.object({
3016
- type: i.enum(["number", "percent", "none"]),
3017
- value: i.number()
3011
+ price: c.number().positive(),
3012
+ purchasePrice: c.number().optional(),
3013
+ profitPercentage: c.number().optional(),
3014
+ currency: c.literal("ILS"),
3015
+ discount: c.object({
3016
+ type: c.enum(["number", "percent", "none"]),
3017
+ value: c.number()
3018
3018
  }),
3019
- isDiscountable: i.boolean({ description: "included in store discounts" }).optional(),
3020
- weight: i.object({
3021
- value: i.number(),
3022
- unit: i.enum(["kg", "gram", "none"])
3019
+ isDiscountable: c.boolean({ description: "included in store discounts" }).optional(),
3020
+ weight: c.object({
3021
+ value: c.number(),
3022
+ unit: c.enum(["kg", "gram", "none"])
3023
3023
  }),
3024
- volume: i.object({
3025
- value: i.number(),
3026
- unit: i.enum(["liter", "ml", "none"])
3024
+ volume: c.object({
3025
+ value: c.number(),
3026
+ unit: c.enum(["liter", "ml", "none"])
3027
3027
  }),
3028
- images: i.array(i.object({ url: i.string().url(), id: i.string() })),
3029
- manufacturer: i.string(),
3030
- brand: i.string(),
3031
- importer: i.string(),
3032
- supplier: i.string(),
3033
- ingredients: i.array(J),
3034
- created_at: i.number(),
3035
- updated_at: i.number(),
3036
- categoryIds: i.array(i.string().nonempty()),
3028
+ images: c.array(c.object({ url: c.string().url(), id: c.string() })),
3029
+ manufacturer: c.string(),
3030
+ brand: c.string(),
3031
+ importer: c.string(),
3032
+ supplier: c.string(),
3033
+ ingredients: c.array(H),
3034
+ created_at: c.number(),
3035
+ updated_at: c.number(),
3036
+ categoryIds: c.array(c.string().nonempty()),
3037
3037
  // @deprecated
3038
- categoryList: i.array(Oe),
3038
+ categoryList: c.array(Pe),
3039
3039
  // @deprecated
3040
- categories: i.object({
3041
- lvl0: i.array(i.string()),
3042
- lvl1: i.array(i.string()),
3043
- lvl2: i.array(i.string()),
3044
- lvl3: i.array(i.string()),
3045
- lvl4: i.array(i.string())
3040
+ categories: c.object({
3041
+ lvl0: c.array(c.string()),
3042
+ lvl1: c.array(c.string()),
3043
+ lvl2: c.array(c.string()),
3044
+ lvl3: c.array(c.string()),
3045
+ lvl4: c.array(c.string())
3046
3046
  }),
3047
3047
  // @deprecated
3048
- categoryNames: i.array(i.string())
3049
- }), lr = je.extend({
3050
- image: i.instanceof(File).optional()
3051
- }), nr = i.object({
3052
- product: je,
3053
- originalPrice: i.number().optional(),
3054
- finalPrice: i.number().optional(),
3055
- finalDiscount: i.number().optional(),
3056
- amount: i.number().int().positive({ message: "Quantity must be a positive integer." })
3057
- }), fr = i.object({
3058
- type: i.literal("Cart"),
3059
- id: i.string().uuid(),
3060
- companyId: i.string().uuid(),
3061
- storeId: i.string().uuid(),
3062
- userId: i.string().uuid(),
3063
- status: i.enum(["active", "draft", "completed"]),
3064
- items: i.array(nr)
3065
- }), hr = i.object({
3066
- id: i.string(),
3067
- name: i.string(),
3068
- websiteDomains: i.array(i.string())
3069
- }), mr = i.object({
3070
- type: i.literal("FavoriteProduct"),
3071
- id: i.string().uuid(),
3072
- companyId: i.string().uuid(),
3073
- storeId: i.string().uuid(),
3074
- userId: i.string().uuid(),
3075
- productId: i.string().uuid()
3076
- }), Je = i.enum(["default", "delayed"]), sr = i.object({
3077
- type: i.literal("Profile"),
3078
- id: k,
3079
- companyId: k,
3080
- storeId: k,
3081
- tenantId: k,
3082
- clientType: i.enum(["user", "company"]),
3083
- displayName: k,
3084
- email: i.string().email(),
3085
- phoneNumber: k.optional(),
3086
- address: rr.optional(),
3087
- isAnonymous: i.boolean(),
3088
- createdDate: i.number(),
3089
- lastActivityDate: i.number(),
3090
- paymentType: Je
3048
+ categoryNames: c.array(c.string())
3049
+ }), kr = et.extend({
3050
+ image: c.instanceof(File).optional()
3051
+ }), tt = c.object({
3052
+ product: et,
3053
+ originalPrice: c.number().optional(),
3054
+ finalPrice: c.number().optional(),
3055
+ finalDiscount: c.number().optional(),
3056
+ amount: c.number().int().positive({ message: "Quantity must be a positive integer." })
3057
+ }), wr = c.object({
3058
+ type: c.literal("Cart"),
3059
+ id: c.string().uuid(),
3060
+ companyId: c.string().uuid(),
3061
+ storeId: c.string().uuid(),
3062
+ userId: c.string().uuid(),
3063
+ status: c.enum(["active", "draft", "completed"]),
3064
+ items: c.array(tt)
3065
+ }), Tr = c.object({
3066
+ id: c.string(),
3067
+ name: c.string(),
3068
+ websiteDomains: c.array(c.string())
3069
+ }), Cr = c.object({
3070
+ type: c.literal("FavoriteProduct"),
3071
+ id: c.string().uuid(),
3072
+ companyId: c.string().uuid(),
3073
+ storeId: c.string().uuid(),
3074
+ userId: c.string().uuid(),
3075
+ productId: c.string().uuid()
3076
+ }), rt = c.enum(["default", "delayed"]), mr = c.object({
3077
+ type: c.literal("Profile"),
3078
+ id: T,
3079
+ companyId: T,
3080
+ storeId: T,
3081
+ tenantId: T,
3082
+ clientType: c.enum(["user", "company"]),
3083
+ displayName: T,
3084
+ email: c.string().email(),
3085
+ phoneNumber: T.optional(),
3086
+ address: pr.optional(),
3087
+ isAnonymous: c.boolean(),
3088
+ createdDate: c.number(),
3089
+ lastActivityDate: c.number(),
3090
+ paymentType: rt
3091
3091
  });
3092
- function pr() {
3092
+ function Sr() {
3093
3093
  return {
3094
3094
  type: "Profile",
3095
3095
  id: "",
@@ -3112,16 +3112,16 @@ function pr() {
3112
3112
  createdDate: 0,
3113
3113
  lastActivityDate: 0,
3114
3114
  isAnonymous: !0,
3115
- paymentType: Je.Values.default
3115
+ paymentType: rt.Values.default
3116
3116
  };
3117
3117
  }
3118
- const yr = i.object({
3119
- type: i.literal("Order"),
3120
- id: k,
3121
- companyId: k,
3122
- storeId: k,
3123
- userId: k,
3124
- status: i.enum([
3118
+ const Zr = c.object({
3119
+ type: c.literal("Order"),
3120
+ id: T,
3121
+ companyId: T,
3122
+ storeId: T,
3123
+ userId: T,
3124
+ status: c.enum([
3125
3125
  "draft",
3126
3126
  // before payment
3127
3127
  "pending",
@@ -3135,55 +3135,148 @@ const yr = i.object({
3135
3135
  "completed",
3136
3136
  "refunded"
3137
3137
  ]),
3138
- paymentStatus: i.enum(["pending", "pending_j5", "completed", "failed", "refunded"]),
3138
+ paymentStatus: c.enum(["pending", "pending_j5", "completed", "failed", "refunded"]),
3139
3139
  //todo check if hyp support partial refund
3140
- cart: i.object({
3141
- id: i.string(),
3142
- items: i.array(i.object({ product: je, amount: i.number() })),
3143
- cartDiscount: i.number(),
3144
- cartTotal: i.number(),
3145
- cartVat: i.number()
3140
+ cart: c.object({
3141
+ id: c.string(),
3142
+ items: c.array(tt),
3143
+ cartDiscount: c.number(),
3144
+ cartTotal: c.number(),
3145
+ cartVat: c.number()
3146
3146
  }),
3147
- originalAmount: i.number().positive().optional(),
3147
+ originalAmount: c.number().positive().optional(),
3148
3148
  // what client pay
3149
- actualAmount: i.number().positive().optional(),
3149
+ actualAmount: c.number().positive().optional(),
3150
3150
  // what store charge
3151
- date: i.number(),
3152
- deliveryDate: i.number().optional(),
3153
- createdAt: i.number().optional(),
3154
- client: sr.required({})
3151
+ date: c.number(),
3152
+ deliveryDate: c.number().optional(),
3153
+ createdAt: c.number().optional(),
3154
+ client: mr.required({})
3155
3155
  });
3156
- i.object({
3157
- id: i.string(),
3158
- companyId: i.string(),
3159
- name: i.string(),
3160
- urls: i.array(i.string()),
3161
- logoUrl: i.string(),
3162
- tenantId: i.string(),
3156
+ c.object({
3157
+ id: c.string(),
3158
+ companyId: c.string(),
3159
+ name: c.string(),
3160
+ urls: c.array(c.string()),
3161
+ logoUrl: c.string(),
3162
+ tenantId: c.string(),
3163
3163
  // firebase auth tenantId
3164
- paymentType: i.enum(["external", "j5"]),
3165
- allowAnonymousClients: i.boolean(),
3166
- isVatIncludedInPrice: i.boolean()
3164
+ paymentType: c.enum(["external", "j5"]),
3165
+ allowAnonymousClients: c.boolean(),
3166
+ isVatIncludedInPrice: c.boolean()
3167
3167
  });
3168
- const Se = i.string().min(1), gr = i.object({
3169
- type: i.literal("Discount"),
3170
- storeId: Se,
3171
- companyId: Se,
3172
- id: Se,
3173
- name: i.array(J),
3174
- active: i.boolean(),
3175
- variant: i.discriminatedUnion("variantType", [
3176
- i.object({
3177
- variantType: i.literal("bundle"),
3178
- productsId: i.array(i.string()).min(1),
3179
- requiredQuantity: i.number().positive(),
3180
- discountPrice: i.number().positive()
3168
+ const Ae = c.string().min(1), Ir = c.object({
3169
+ type: c.literal("Discount"),
3170
+ storeId: Ae,
3171
+ companyId: Ae,
3172
+ id: Ae,
3173
+ name: c.array(H),
3174
+ active: c.boolean(),
3175
+ variant: c.discriminatedUnion("variantType", [
3176
+ c.object({
3177
+ variantType: c.literal("bundle"),
3178
+ productsId: c.array(c.string()).min(1),
3179
+ requiredQuantity: c.number().positive(),
3180
+ discountPrice: c.number().positive()
3181
3181
  })
3182
3182
  ])
3183
- }), ar = {
3183
+ }), ve = {
3184
+ VAT: 18
3185
+ };
3186
+ function nt(r) {
3187
+ var e, t;
3188
+ return ((e = r.discount) == null ? void 0 : e.type) === "percent" ? r.price * (r.discount.value ?? 100) / 100 : ((t = r.discount) == null ? void 0 : t.type) === "number" ? r.price - (r.discount.value ?? 0) : 0;
3189
+ }
3190
+ function st(r) {
3191
+ var e, t;
3192
+ if (((e = r.discount) == null ? void 0 : e.type) === "percent") {
3193
+ const n = r.price * r.discount.value / 100;
3194
+ return r.price - n;
3195
+ }
3196
+ return ((t = r.discount) == null ? void 0 : t.type) === "number" ? r.price - r.discount.value : r.price;
3197
+ }
3198
+ function Ar({
3199
+ cart: r,
3200
+ discounts: e,
3201
+ store: t
3202
+ }) {
3203
+ const { isVatIncludedInPrice: n } = t;
3204
+ let s = r.map((i) => ({
3205
+ amount: i.amount,
3206
+ product: { ...i.product },
3207
+ originalPrice: i.product.price,
3208
+ finalPrice: i.product.price,
3209
+ finalDiscount: 0
3210
+ }));
3211
+ const a = e.filter((i) => i.variant.variantType === "bundle" && ((r == null ? void 0 : r.reduce((u, p) => (i.variant.productsId.includes(p.product.id) && (u += p.amount), u), 0)) ?? 0) >= i.variant.requiredQuantity);
3212
+ console.log("activeDiscounts", a), a.forEach((i) => {
3213
+ var l, u;
3214
+ if (i.variant.variantType === "bundle") {
3215
+ const p = r.filter(
3216
+ (A) => i.variant.productsId.includes(A.product.id)
3217
+ ), x = (p == null ? void 0 : p.reduce((A, Me) => (i.variant.productsId.includes(Me.product.id) && (A += Me.amount), A), 0)) ?? 0, I = Math.floor(x / i.variant.requiredQuantity), w = st((l = p[0]) == null ? void 0 : l.product), Ze = nt((u = p[0]) == null ? void 0 : u.product);
3218
+ console.log("price", w, Ze);
3219
+ const at = Number(
3220
+ (i.variant.discountPrice / i.variant.requiredQuantity).toFixed(2)
3221
+ ) * 1;
3222
+ console.log("discountPrice", at);
3223
+ const $e = (w * i.variant.requiredQuantity - i.variant.discountPrice) * I, Ve = x * w, De = Ve - $e;
3224
+ console.log("totalDiscount", $e), console.log("discountPriceFinal", De, Ve);
3225
+ const ge = Number((De / x).toFixed(2));
3226
+ console.log("averagePrice", ge), s = s.map((A) => i.variant.productsId.includes(A.product.id) ? {
3227
+ ...A,
3228
+ finalPrice: ge,
3229
+ originalPrice: A.product.price,
3230
+ finalDiscount: A.product.price - ge
3231
+ } : A), console.log("averagePrice", ge), console.log(
3232
+ "yes",
3233
+ I,
3234
+ i.variant.requiredQuantity,
3235
+ i.variant.discountPrice
3236
+ ), console.log("dis", x, p);
3237
+ }
3238
+ }), console.log("result", s);
3239
+ const o = s.reduce(
3240
+ (i, l) => {
3241
+ const { product: u, amount: p, finalPrice: x, finalDiscount: I } = l;
3242
+ console.log("isVatIncludedInPrice", n);
3243
+ let w = 0;
3244
+ if (u.vat)
3245
+ if (n) {
3246
+ const Ze = x * (ve.VAT / (100 + ve.VAT));
3247
+ w = Number(Ze.toFixed(2)), w = w * p, i.vat += Number(w.toFixed(2));
3248
+ } else
3249
+ w = x * ve.VAT / 100, w = w * p, i.vat += Number(w.toFixed(2));
3250
+ return console.log("finalDiscount", I), i.cost += p * x, i.discount += I && p * I, i.finalCost += p * x + (n ? 0 : w), i;
3251
+ },
3252
+ {
3253
+ discount: 0,
3254
+ cost: 0,
3255
+ finalCost: 0,
3256
+ vat: 0
3257
+ }
3258
+ );
3259
+ return console.log("cartDetails", o), { items: s, ...o };
3260
+ }
3261
+ function Nr(r) {
3262
+ return (r ?? []).reduce(
3263
+ (e, t) => {
3264
+ const { product: n, amount: s } = t, a = st(n), o = nt(n), i = n.price - o;
3265
+ let l = 0;
3266
+ return n.vat && (l = i * ve.VAT / 100, l = l * s, e.vat += l), e.cost += s * n.price, e.discount += o && s * o, e.finalCost += s * a + l, e;
3267
+ },
3268
+ {
3269
+ cost: 0,
3270
+ discount: 0,
3271
+ vat: 0,
3272
+ finalCost: 0
3273
+ }
3274
+ );
3275
+ }
3276
+ const yr = {
3184
3277
  stores: "STORES",
3185
3278
  companies: "COMPANIES"
3186
- }, ir = {
3279
+ }, gr = {
3187
3280
  products: "products",
3188
3281
  profiles: "profiles",
3189
3282
  cart: "cart",
@@ -3194,9 +3287,9 @@ const Se = i.string().min(1), gr = i.object({
3194
3287
  payments: "payments",
3195
3288
  settings: "settings",
3196
3289
  discounts: "discounts"
3197
- }, or = {
3198
- systemCollections: ar,
3199
- storeCollections: ir,
3290
+ }, vr = {
3291
+ systemCollections: yr,
3292
+ storeCollections: gr,
3200
3293
  // for client
3201
3294
  getPath: ({
3202
3295
  companyId: r,
@@ -3206,28 +3299,31 @@ const Se = i.string().min(1), gr = i.object({
3206
3299
  }) => `${r}/${e}/${t}${n ? `/${n}` : ""}`,
3207
3300
  // for backend
3208
3301
  getDocPath: (r) => `{companyId}/{storeId}/${r}/{id}`
3209
- }, vr = {
3210
- firestore: or
3302
+ }, Or = {
3303
+ firestore: vr
3211
3304
  };
3212
3305
  export {
3213
- rr as AddressSchema,
3214
- qe as BaseCategorySchema,
3215
- fr as CartSchema,
3216
- Oe as CategorySchema,
3217
- hr as CompanySchema,
3218
- gr as DiscountSchema,
3219
- mr as FavoriteProductSchema,
3220
- vr as FirebaseAPI,
3221
- J as LocaleSchema,
3222
- cr as LocaleValueSchema,
3223
- lr as NewProductSchema,
3224
- yr as OrderSchema,
3225
- je as ProductSchema,
3226
- Je as ProfilePaymentTypeSchema,
3227
- sr as ProfileSchema,
3228
- ur as TFlattenCategorySchema,
3229
- pr as createEmptyProfile,
3230
- k as notEmptyTextSchema,
3231
- dr as numericTextSchema
3306
+ pr as AddressSchema,
3307
+ Ke as BaseCategorySchema,
3308
+ tt as CartItemProductSchema,
3309
+ wr as CartSchema,
3310
+ Pe as CategorySchema,
3311
+ Tr as CompanySchema,
3312
+ Ir as DiscountSchema,
3313
+ Cr as FavoriteProductSchema,
3314
+ Or as FirebaseAPI,
3315
+ H as LocaleSchema,
3316
+ br as LocaleValueSchema,
3317
+ kr as NewProductSchema,
3318
+ Zr as OrderSchema,
3319
+ et as ProductSchema,
3320
+ rt as ProfilePaymentTypeSchema,
3321
+ mr as ProfileSchema,
3322
+ xr as TFlattenCategorySchema,
3323
+ Nr as calculateCartPrice,
3324
+ Sr as createEmptyProfile,
3325
+ Ar as getCartCost,
3326
+ T as notEmptyTextSchema,
3327
+ _r as numericTextSchema
3232
3328
  };
3233
3329
  //# sourceMappingURL=core.es.js.map