@authhero/cloudflare-adapter 1.8.0 → 1.10.0

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.
@@ -1,9 +1,9 @@
1
- var ot = Object.defineProperty;
2
- var dt = (r, e, t) => e in r ? ot(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var Ve = (r, e, t) => dt(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { verificationMethodsSchema as ct } from "@authhero/adapter-interfaces";
5
- import ut from "wretch";
6
- function lt(r, e) {
1
+ var dt = Object.defineProperty;
2
+ var ct = (r, e, t) => e in r ? dt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var Ve = (r, e, t) => ct(r, typeof e != "symbol" ? e + "" : e, t);
4
+ import { verificationMethodsSchema as ut } from "@authhero/adapter-interfaces";
5
+ import lt from "wretch";
6
+ function ft(r, e) {
7
7
  var t = {};
8
8
  for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && e.indexOf(n) < 0 && (t[n] = r[n]);
9
9
  if (r != null && typeof Object.getOwnPropertySymbols == "function")
@@ -11,40 +11,40 @@ function lt(r, e) {
11
11
  e.indexOf(n[s]) < 0 && Object.prototype.propertyIsEnumerable.call(r, n[s]) && (t[n[s]] = r[n[s]]);
12
12
  return t;
13
13
  }
14
- function ft(r, e) {
14
+ function ht(r, e) {
15
15
  var t;
16
16
  return ((t = r == null ? void 0 : r._def) === null || t === void 0 ? void 0 : t.typeName) === e;
17
17
  }
18
- function ne(r, e) {
18
+ function se(r, e) {
19
19
  const t = r.ZodType.prototype[e];
20
20
  r.ZodType.prototype[e] = function(...n) {
21
21
  const s = t.apply(this, n);
22
22
  return s._def.openapi = this._def.openapi, s;
23
23
  };
24
24
  }
25
- function ht(r) {
25
+ function pt(r) {
26
26
  if (typeof r.ZodType.prototype.openapi < "u")
27
27
  return;
28
28
  r.ZodType.prototype.openapi = function(s, a) {
29
- var i, o, d, c, p, k;
30
- const O = typeof s == "string" ? a : s, w = O ?? {}, { param: P } = w, Ne = lt(w, ["param"]), $ = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof s == "string" ? { refId: s } : void 0), be = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), Ne), !((c = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || c === void 0) && c.param || P ? {
31
- param: Object.assign(Object.assign({}, (k = (p = this._def.openapi) === null || p === void 0 ? void 0 : p.metadata) === null || k === void 0 ? void 0 : k.param), P)
32
- } : void 0), B = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys($).length > 0 ? { _internal: $ } : void 0), Object.keys(be).length > 0 ? { metadata: be } : void 0) }));
33
- if (ft(this, "ZodObject")) {
34
- const te = this.extend;
35
- B.extend = function(...re) {
36
- var Re, Ie, Ae, Me, Pe, $e;
37
- const De = te.apply(this, re);
29
+ var i, o, d, c, p, b;
30
+ const O = typeof s == "string" ? a : s, w = O ?? {}, { param: P } = w, Ee = ft(w, ["param"]), D = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof s == "string" ? { refId: s } : void 0), be = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), Ee), !((c = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || c === void 0) && c.param || P ? {
31
+ param: Object.assign(Object.assign({}, (b = (p = this._def.openapi) === null || p === void 0 ? void 0 : p.metadata) === null || b === void 0 ? void 0 : b.param), P)
32
+ } : void 0), B = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(D).length > 0 ? { _internal: D } : void 0), Object.keys(be).length > 0 ? { metadata: be } : void 0) }));
33
+ if (ht(this, "ZodObject")) {
34
+ const re = this.extend;
35
+ B.extend = function(...ne) {
36
+ var Re, Ne, Ie, $e, Me, Pe;
37
+ const De = re.apply(this, ne);
38
38
  return De._def.openapi = {
39
39
  _internal: {
40
- extendedFrom: !((Ie = (Re = this._def.openapi) === null || Re === void 0 ? void 0 : Re._internal) === null || Ie === void 0) && Ie.refId ? { refId: (Me = (Ae = this._def.openapi) === null || Ae === void 0 ? void 0 : Ae._internal) === null || Me === void 0 ? void 0 : Me.refId, schema: this } : (Pe = this._def.openapi) === null || Pe === void 0 ? void 0 : Pe._internal.extendedFrom
40
+ extendedFrom: !((Ne = (Re = this._def.openapi) === null || Re === void 0 ? void 0 : Re._internal) === null || Ne === void 0) && Ne.refId ? { refId: ($e = (Ie = this._def.openapi) === null || Ie === void 0 ? void 0 : Ie._internal) === null || $e === void 0 ? void 0 : $e.refId, schema: this } : (Me = this._def.openapi) === null || Me === void 0 ? void 0 : Me._internal.extendedFrom
41
41
  },
42
- metadata: ($e = De._def.openapi) === null || $e === void 0 ? void 0 : $e.metadata
42
+ metadata: (Pe = De._def.openapi) === null || Pe === void 0 ? void 0 : Pe.metadata
43
43
  }, De;
44
44
  };
45
45
  }
46
46
  return B;
47
- }, ne(r, "optional"), ne(r, "nullable"), ne(r, "default"), ne(r, "transform"), ne(r, "refine");
47
+ }, se(r, "optional"), se(r, "nullable"), se(r, "default"), se(r, "transform"), se(r, "refine");
48
48
  const e = r.ZodObject.prototype.deepPartial;
49
49
  r.ZodObject.prototype.deepPartial = function() {
50
50
  const s = this._def.shape(), a = e.apply(this), i = a._def.shape();
@@ -146,7 +146,7 @@ const f = x.arrayToEnum([
146
146
  "never",
147
147
  "map",
148
148
  "set"
149
- ]), D = (r) => {
149
+ ]), $ = (r) => {
150
150
  switch (typeof r) {
151
151
  case "undefined":
152
152
  return f.undefined;
@@ -184,8 +184,11 @@ const f = x.arrayToEnum([
184
184
  "invalid_intersection_types",
185
185
  "not_multiple_of",
186
186
  "not_finite"
187
- ]), pt = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
187
+ ]), mt = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
188
188
  class S extends Error {
189
+ get errors() {
190
+ return this.issues;
191
+ }
189
192
  constructor(e) {
190
193
  super(), this.issues = [], this.addIssue = (n) => {
191
194
  this.issues = [...this.issues, n];
@@ -195,9 +198,6 @@ class S extends Error {
195
198
  const t = new.target.prototype;
196
199
  Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
197
200
  }
198
- get errors() {
199
- return this.issues;
200
- }
201
201
  format(e) {
202
202
  const t = e || function(a) {
203
203
  return a.message;
@@ -302,7 +302,7 @@ const Q = (r, e) => {
302
302
  return { message: t };
303
303
  };
304
304
  let Xe = Q;
305
- function mt(r) {
305
+ function _t(r) {
306
306
  Xe = r;
307
307
  }
308
308
  function ke() {
@@ -328,7 +328,7 @@ const we = (r) => {
328
328
  path: a,
329
329
  message: o
330
330
  };
331
- }, _t = [];
331
+ }, yt = [];
332
332
  function l(r, e) {
333
333
  const t = ke(), n = we({
334
334
  issueData: e,
@@ -336,8 +336,11 @@ function l(r, e) {
336
336
  path: r.path,
337
337
  errorMaps: [
338
338
  r.common.contextualErrorMap,
339
+ // contextual error map is first priority
339
340
  r.schemaErrorMap,
341
+ // then schema-bound map if available
340
342
  t,
343
+ // then global override map
341
344
  t === Q ? void 0 : Q
342
345
  // then global default map
343
346
  ].filter((s) => !!s)
@@ -387,7 +390,7 @@ class T {
387
390
  }
388
391
  const y = Object.freeze({
389
392
  status: "aborted"
390
- }), X = (r) => ({ status: "dirty", value: r }), Z = (r) => ({ status: "valid", value: r }), We = (r) => r.status === "aborted", qe = (r) => r.status === "dirty", ie = (r) => r.status === "valid", oe = (r) => typeof Promise < "u" && r instanceof Promise;
393
+ }), X = (r) => ({ status: "dirty", value: r }), Z = (r) => ({ status: "valid", value: r }), Fe = (r) => r.status === "aborted", We = (r) => r.status === "dirty", W = (r) => r.status === "valid", oe = (r) => typeof Promise < "u" && r instanceof Promise;
391
394
  function Te(r, e, t, n) {
392
395
  if (typeof e == "function" ? r !== e || !n : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
393
396
  return e.get(r);
@@ -400,7 +403,7 @@ var m;
400
403
  (function(r) {
401
404
  r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
402
405
  })(m || (m = {}));
403
- var se, ae;
406
+ var ae, ie;
404
407
  class R {
405
408
  constructor(e, t, n, s) {
406
409
  this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = s;
@@ -409,8 +412,8 @@ class R {
409
412
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
410
413
  }
411
414
  }
412
- const Ye = (r, e) => {
413
- if (ie(e))
415
+ const He = (r, e) => {
416
+ if (W(e))
414
417
  return { success: !0, data: e.value };
415
418
  if (!r.common.issues.length)
416
419
  throw new Error("Validation failed but no issues detected.");
@@ -437,20 +440,17 @@ function v(r) {
437
440
  }, description: s };
438
441
  }
439
442
  class g {
440
- constructor(e) {
441
- this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
442
- }
443
443
  get description() {
444
444
  return this._def.description;
445
445
  }
446
446
  _getType(e) {
447
- return D(e.data);
447
+ return $(e.data);
448
448
  }
449
449
  _getOrReturnCtx(e, t) {
450
450
  return t || {
451
451
  common: e.parent.common,
452
452
  data: e.data,
453
- parsedType: D(e.data),
453
+ parsedType: $(e.data),
454
454
  schemaErrorMap: this._def.errorMap,
455
455
  path: e.path,
456
456
  parent: e.parent
@@ -462,7 +462,7 @@ class g {
462
462
  ctx: {
463
463
  common: e.parent.common,
464
464
  data: e.data,
465
- parsedType: D(e.data),
465
+ parsedType: $(e.data),
466
466
  schemaErrorMap: this._def.errorMap,
467
467
  path: e.path,
468
468
  parent: e.parent
@@ -497,9 +497,42 @@ class g {
497
497
  schemaErrorMap: this._def.errorMap,
498
498
  parent: null,
499
499
  data: e,
500
- parsedType: D(e)
500
+ parsedType: $(e)
501
501
  }, a = this._parseSync({ data: e, path: s.path, parent: s });
502
- return Ye(s, a);
502
+ return He(s, a);
503
+ }
504
+ "~validate"(e) {
505
+ var t, n;
506
+ const s = {
507
+ common: {
508
+ issues: [],
509
+ async: !!this["~standard"].async
510
+ },
511
+ path: [],
512
+ schemaErrorMap: this._def.errorMap,
513
+ parent: null,
514
+ data: e,
515
+ parsedType: $(e)
516
+ };
517
+ if (!this["~standard"].async)
518
+ try {
519
+ const a = this._parseSync({ data: e, path: [], parent: s });
520
+ return W(a) ? {
521
+ value: a.value
522
+ } : {
523
+ issues: s.common.issues
524
+ };
525
+ } catch (a) {
526
+ !((n = (t = a == null ? void 0 : a.message) === null || t === void 0 ? void 0 : t.toLowerCase()) === null || n === void 0) && n.includes("encountered") && (this["~standard"].async = !0), s.common = {
527
+ issues: [],
528
+ async: !0
529
+ };
530
+ }
531
+ return this._parseAsync({ data: e, path: [], parent: s }).then((a) => W(a) ? {
532
+ value: a.value
533
+ } : {
534
+ issues: s.common.issues
535
+ });
503
536
  }
504
537
  async parseAsync(e, t) {
505
538
  const n = await this.safeParseAsync(e, t);
@@ -518,9 +551,9 @@ class g {
518
551
  schemaErrorMap: this._def.errorMap,
519
552
  parent: null,
520
553
  data: e,
521
- parsedType: D(e)
554
+ parsedType: $(e)
522
555
  }, s = this._parse({ data: e, path: n.path, parent: n }), a = await (oe(s) ? s : Promise.resolve(s));
523
- return Ye(n, a);
556
+ return He(n, a);
524
557
  }
525
558
  refine(e, t) {
526
559
  const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
@@ -536,7 +569,7 @@ class g {
536
569
  return this._refinement((n, s) => e(n) ? !0 : (s.addIssue(typeof t == "function" ? t(n, s) : t), !1));
537
570
  }
538
571
  _refinement(e) {
539
- return new C({
572
+ return new A({
540
573
  schema: this,
541
574
  typeName: _.ZodEffects,
542
575
  effect: { type: "refinement", refinement: e }
@@ -545,20 +578,27 @@ class g {
545
578
  superRefine(e) {
546
579
  return this._refinement(e);
547
580
  }
581
+ constructor(e) {
582
+ this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this), this["~standard"] = {
583
+ version: 1,
584
+ vendor: "zod",
585
+ validate: (t) => this["~validate"](t)
586
+ };
587
+ }
548
588
  optional() {
549
- return N.create(this, this._def);
589
+ return E.create(this, this._def);
550
590
  }
551
591
  nullable() {
552
- return z.create(this, this._def);
592
+ return U.create(this, this._def);
553
593
  }
554
594
  nullish() {
555
595
  return this.nullable().optional();
556
596
  }
557
597
  array() {
558
- return E.create(this, this._def);
598
+ return C.create(this);
559
599
  }
560
600
  promise() {
561
- return ee.create(this, this._def);
601
+ return te.create(this, this._def);
562
602
  }
563
603
  or(e) {
564
604
  return le.create([this, e], this._def);
@@ -567,7 +607,7 @@ class g {
567
607
  return fe.create(this, e, this._def);
568
608
  }
569
609
  transform(e) {
570
- return new C({
610
+ return new A({
571
611
  ...v(this._def),
572
612
  schema: this,
573
613
  typeName: _.ZodEffects,
@@ -584,7 +624,7 @@ class g {
584
624
  });
585
625
  }
586
626
  brand() {
587
- return new He({
627
+ return new Je({
588
628
  typeName: _.ZodBranded,
589
629
  type: this,
590
630
  ...v(this._def)
@@ -619,23 +659,38 @@ class g {
619
659
  return this.safeParse(null).success;
620
660
  }
621
661
  }
622
- const yt = /^c[^\s-]{8,}$/i, vt = /^[0-9a-z]+$/, gt = /^[0-9A-HJKMNP-TV-Z]{26}$/, xt = /^[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, bt = /^[a-z0-9_-]{21}$/i, kt = /^[-+]?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)?)??$/, wt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Tt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
662
+ const vt = /^c[^\s-]{8,}$/i, gt = /^[0-9a-z]+$/, xt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, bt = /^[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, kt = /^[a-z0-9_-]{21}$/i, wt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Tt = /^[-+]?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)?)??$/, Zt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ot = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
623
663
  let Le;
624
- const Zt = /^(?:(?: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])$/, St = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, Ot = /^([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])))", jt = new RegExp(`^${Qe}$`);
625
- function Fe(r) {
626
- let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
627
- return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
664
+ const St = /^(?:(?: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])$/, jt = /^(?:(?: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])$/, 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]))$/, At = /^(([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])$/, Et = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Rt = /^([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])))", Nt = new RegExp(`^${Qe}$`);
665
+ function et(r) {
666
+ let e = "[0-5]\\d";
667
+ r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`);
668
+ const t = r.precision ? "+" : "?";
669
+ return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
628
670
  }
629
- function Et(r) {
630
- return new RegExp(`^${Fe(r)}$`);
671
+ function It(r) {
672
+ return new RegExp(`^${et(r)}$`);
631
673
  }
632
- function et(r) {
633
- let e = `${Qe}T${Fe(r)}`;
674
+ function tt(r) {
675
+ let e = `${Qe}T${et(r)}`;
634
676
  const t = [];
635
677
  return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
636
678
  }
637
- function Ct(r, e) {
638
- return !!((e === "v4" || !e) && Zt.test(r) || (e === "v6" || !e) && St.test(r));
679
+ function $t(r, e) {
680
+ return !!((e === "v4" || !e) && St.test(r) || (e === "v6" || !e) && Ct.test(r));
681
+ }
682
+ function Mt(r, e) {
683
+ if (!wt.test(r))
684
+ return !1;
685
+ try {
686
+ const [t] = r.split("."), n = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), s = JSON.parse(atob(n));
687
+ return !(typeof s != "object" || s === null || !s.typ || !s.alg || e && s.alg !== e);
688
+ } catch {
689
+ return !1;
690
+ }
691
+ }
692
+ function Pt(r, e) {
693
+ return !!((e === "v4" || !e) && jt.test(r) || (e === "v6" || !e) && At.test(r));
639
694
  }
640
695
  class j extends g {
641
696
  _parse(e) {
@@ -686,43 +741,43 @@ class j extends g {
686
741
  message: a.message
687
742
  }), n.dirty());
688
743
  } else if (a.kind === "email")
689
- wt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
744
+ Zt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
690
745
  validation: "email",
691
746
  code: u.invalid_string,
692
747
  message: a.message
693
748
  }), n.dirty());
694
749
  else if (a.kind === "emoji")
695
- Le || (Le = new RegExp(Tt, "u")), Le.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
750
+ Le || (Le = new RegExp(Ot, "u")), Le.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
696
751
  validation: "emoji",
697
752
  code: u.invalid_string,
698
753
  message: a.message
699
754
  }), n.dirty());
700
755
  else if (a.kind === "uuid")
701
- xt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
756
+ bt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
702
757
  validation: "uuid",
703
758
  code: u.invalid_string,
704
759
  message: a.message
705
760
  }), n.dirty());
706
761
  else if (a.kind === "nanoid")
707
- bt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
762
+ kt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
708
763
  validation: "nanoid",
709
764
  code: u.invalid_string,
710
765
  message: a.message
711
766
  }), n.dirty());
712
767
  else if (a.kind === "cuid")
713
- yt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
768
+ vt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
714
769
  validation: "cuid",
715
770
  code: u.invalid_string,
716
771
  message: a.message
717
772
  }), n.dirty());
718
773
  else if (a.kind === "cuid2")
719
- vt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
774
+ gt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
720
775
  validation: "cuid2",
721
776
  code: u.invalid_string,
722
777
  message: a.message
723
778
  }), n.dirty());
724
779
  else if (a.kind === "ulid")
725
- gt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
780
+ xt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
726
781
  validation: "ulid",
727
782
  code: u.invalid_string,
728
783
  message: a.message
@@ -753,30 +808,42 @@ class j extends g {
753
808
  code: u.invalid_string,
754
809
  validation: { endsWith: a.value },
755
810
  message: a.message
756
- }), n.dirty()) : a.kind === "datetime" ? et(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
811
+ }), n.dirty()) : a.kind === "datetime" ? tt(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
757
812
  code: u.invalid_string,
758
813
  validation: "datetime",
759
814
  message: a.message
760
- }), n.dirty()) : a.kind === "date" ? jt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
815
+ }), n.dirty()) : a.kind === "date" ? Nt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
761
816
  code: u.invalid_string,
762
817
  validation: "date",
763
818
  message: a.message
764
- }), n.dirty()) : a.kind === "time" ? Et(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
819
+ }), n.dirty()) : a.kind === "time" ? It(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
765
820
  code: u.invalid_string,
766
821
  validation: "time",
767
822
  message: a.message
768
- }), n.dirty()) : a.kind === "duration" ? kt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
823
+ }), n.dirty()) : a.kind === "duration" ? Tt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
769
824
  validation: "duration",
770
825
  code: u.invalid_string,
771
826
  message: a.message
772
- }), n.dirty()) : a.kind === "ip" ? Ct(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
827
+ }), n.dirty()) : a.kind === "ip" ? $t(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
773
828
  validation: "ip",
774
829
  code: u.invalid_string,
775
830
  message: a.message
776
- }), n.dirty()) : a.kind === "base64" ? Ot.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
831
+ }), n.dirty()) : a.kind === "jwt" ? Mt(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), l(s, {
832
+ validation: "jwt",
833
+ code: u.invalid_string,
834
+ message: a.message
835
+ }), n.dirty()) : a.kind === "cidr" ? Pt(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
836
+ validation: "cidr",
837
+ code: u.invalid_string,
838
+ message: a.message
839
+ }), n.dirty()) : a.kind === "base64" ? Et.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
777
840
  validation: "base64",
778
841
  code: u.invalid_string,
779
842
  message: a.message
843
+ }), n.dirty()) : a.kind === "base64url" ? Rt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
844
+ validation: "base64url",
845
+ code: u.invalid_string,
846
+ message: a.message
780
847
  }), n.dirty()) : x.assertNever(a);
781
848
  return { status: n.value, value: e.data };
782
849
  }
@@ -820,9 +887,21 @@ class j extends g {
820
887
  base64(e) {
821
888
  return this._addCheck({ kind: "base64", ...m.errToObj(e) });
822
889
  }
890
+ base64url(e) {
891
+ return this._addCheck({
892
+ kind: "base64url",
893
+ ...m.errToObj(e)
894
+ });
895
+ }
896
+ jwt(e) {
897
+ return this._addCheck({ kind: "jwt", ...m.errToObj(e) });
898
+ }
823
899
  ip(e) {
824
900
  return this._addCheck({ kind: "ip", ...m.errToObj(e) });
825
901
  }
902
+ cidr(e) {
903
+ return this._addCheck({ kind: "cidr", ...m.errToObj(e) });
904
+ }
826
905
  datetime(e) {
827
906
  var t, n;
828
907
  return typeof e == "string" ? this._addCheck({
@@ -907,8 +986,7 @@ class j extends g {
907
986
  });
908
987
  }
909
988
  /**
910
- * @deprecated Use z.string().min(1) instead.
911
- * @see {@link ZodString.min}
989
+ * Equivalent to `.min(1)`
912
990
  */
913
991
  nonempty(e) {
914
992
  return this.min(1, m.errToObj(e));
@@ -970,9 +1048,15 @@ class j extends g {
970
1048
  get isIP() {
971
1049
  return !!this._def.checks.find((e) => e.kind === "ip");
972
1050
  }
1051
+ get isCIDR() {
1052
+ return !!this._def.checks.find((e) => e.kind === "cidr");
1053
+ }
973
1054
  get isBase64() {
974
1055
  return !!this._def.checks.find((e) => e.kind === "base64");
975
1056
  }
1057
+ get isBase64url() {
1058
+ return !!this._def.checks.find((e) => e.kind === "base64url");
1059
+ }
976
1060
  get minLength() {
977
1061
  let e = null;
978
1062
  for (const t of this._def.checks)
@@ -995,7 +1079,7 @@ j.create = (r) => {
995
1079
  ...v(r)
996
1080
  });
997
1081
  };
998
- function Nt(r, e) {
1082
+ function Dt(r, e) {
999
1083
  const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n, a = parseInt(r.toFixed(s).replace(".", "")), i = parseInt(e.toFixed(s).replace(".", ""));
1000
1084
  return a % i / Math.pow(10, s);
1001
1085
  }
@@ -1034,7 +1118,7 @@ class V extends g {
1034
1118
  inclusive: a.inclusive,
1035
1119
  exact: !1,
1036
1120
  message: a.message
1037
- }), s.dirty()) : a.kind === "multipleOf" ? Nt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
1121
+ }), s.dirty()) : a.kind === "multipleOf" ? Dt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
1038
1122
  code: u.not_multiple_of,
1039
1123
  multipleOf: a.value,
1040
1124
  message: a.message
@@ -1176,14 +1260,14 @@ class L extends g {
1176
1260
  super(...arguments), this.min = this.gte, this.max = this.lte;
1177
1261
  }
1178
1262
  _parse(e) {
1179
- if (this._def.coerce && (e.data = BigInt(e.data)), this._getType(e) !== f.bigint) {
1180
- const a = this._getOrReturnCtx(e);
1181
- return l(a, {
1182
- code: u.invalid_type,
1183
- expected: f.bigint,
1184
- received: a.parsedType
1185
- }), y;
1186
- }
1263
+ if (this._def.coerce)
1264
+ try {
1265
+ e.data = BigInt(e.data);
1266
+ } catch {
1267
+ return this._getInvalidInput(e);
1268
+ }
1269
+ if (this._getType(e) !== f.bigint)
1270
+ return this._getInvalidInput(e);
1187
1271
  let n;
1188
1272
  const s = new T();
1189
1273
  for (const a of this._def.checks)
@@ -1206,6 +1290,14 @@ class L extends g {
1206
1290
  }), s.dirty()) : x.assertNever(a);
1207
1291
  return { status: s.value, value: e.data };
1208
1292
  }
1293
+ _getInvalidInput(e) {
1294
+ const t = this._getOrReturnCtx(e);
1295
+ return l(t, {
1296
+ code: u.invalid_type,
1297
+ expected: f.bigint,
1298
+ received: t.parsedType
1299
+ }), y;
1300
+ }
1209
1301
  gte(e, t) {
1210
1302
  return this.setLimit("min", e, !0, m.toString(t));
1211
1303
  }
@@ -1446,7 +1538,7 @@ ue.create = (r) => new ue({
1446
1538
  typeName: _.ZodNull,
1447
1539
  ...v(r)
1448
1540
  });
1449
- class F extends g {
1541
+ class ee extends g {
1450
1542
  constructor() {
1451
1543
  super(...arguments), this._any = !0;
1452
1544
  }
@@ -1454,11 +1546,11 @@ class F extends g {
1454
1546
  return Z(e.data);
1455
1547
  }
1456
1548
  }
1457
- F.create = (r) => new F({
1549
+ ee.create = (r) => new ee({
1458
1550
  typeName: _.ZodAny,
1459
1551
  ...v(r)
1460
1552
  });
1461
- class W extends g {
1553
+ class F extends g {
1462
1554
  constructor() {
1463
1555
  super(...arguments), this._unknown = !0;
1464
1556
  }
@@ -1466,7 +1558,7 @@ class W extends g {
1466
1558
  return Z(e.data);
1467
1559
  }
1468
1560
  }
1469
- W.create = (r) => new W({
1561
+ F.create = (r) => new F({
1470
1562
  typeName: _.ZodUnknown,
1471
1563
  ...v(r)
1472
1564
  });
@@ -1484,7 +1576,7 @@ M.create = (r) => new M({
1484
1576
  typeName: _.ZodNever,
1485
1577
  ...v(r)
1486
1578
  });
1487
- class Se extends g {
1579
+ class Oe extends g {
1488
1580
  _parse(e) {
1489
1581
  if (this._getType(e) !== f.undefined) {
1490
1582
  const n = this._getOrReturnCtx(e);
@@ -1497,11 +1589,11 @@ class Se extends g {
1497
1589
  return Z(e.data);
1498
1590
  }
1499
1591
  }
1500
- Se.create = (r) => new Se({
1592
+ Oe.create = (r) => new Oe({
1501
1593
  typeName: _.ZodVoid,
1502
1594
  ...v(r)
1503
1595
  });
1504
- class E extends g {
1596
+ class C extends g {
1505
1597
  _parse(e) {
1506
1598
  const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
1507
1599
  if (t.parsedType !== f.array)
@@ -1545,19 +1637,19 @@ class E extends g {
1545
1637
  return this._def.type;
1546
1638
  }
1547
1639
  min(e, t) {
1548
- return new E({
1640
+ return new C({
1549
1641
  ...this._def,
1550
1642
  minLength: { value: e, message: m.toString(t) }
1551
1643
  });
1552
1644
  }
1553
1645
  max(e, t) {
1554
- return new E({
1646
+ return new C({
1555
1647
  ...this._def,
1556
1648
  maxLength: { value: e, message: m.toString(t) }
1557
1649
  });
1558
1650
  }
1559
1651
  length(e, t) {
1560
- return new E({
1652
+ return new C({
1561
1653
  ...this._def,
1562
1654
  exactLength: { value: e, message: m.toString(t) }
1563
1655
  });
@@ -1566,7 +1658,7 @@ class E extends g {
1566
1658
  return this.min(1, e);
1567
1659
  }
1568
1660
  }
1569
- E.create = (r, e) => new E({
1661
+ C.create = (r, e) => new C({
1570
1662
  type: r,
1571
1663
  minLength: null,
1572
1664
  maxLength: null,
@@ -1575,22 +1667,22 @@ E.create = (r, e) => new E({
1575
1667
  ...v(e)
1576
1668
  });
1577
1669
  function G(r) {
1578
- if (r instanceof b) {
1670
+ if (r instanceof k) {
1579
1671
  const e = {};
1580
1672
  for (const t in r.shape) {
1581
1673
  const n = r.shape[t];
1582
- e[t] = N.create(G(n));
1674
+ e[t] = E.create(G(n));
1583
1675
  }
1584
- return new b({
1676
+ return new k({
1585
1677
  ...r._def,
1586
1678
  shape: () => e
1587
1679
  });
1588
- } else return r instanceof E ? new E({
1680
+ } else return r instanceof C ? new C({
1589
1681
  ...r._def,
1590
1682
  type: G(r.element)
1591
- }) : r instanceof N ? N.create(G(r.unwrap())) : r instanceof z ? z.create(G(r.unwrap())) : r instanceof I ? I.create(r.items.map((e) => G(e))) : r;
1683
+ }) : r instanceof E ? E.create(G(r.unwrap())) : r instanceof U ? U.create(G(r.unwrap())) : r instanceof N ? N.create(r.items.map((e) => G(e))) : r;
1592
1684
  }
1593
- class b extends g {
1685
+ class k extends g {
1594
1686
  constructor() {
1595
1687
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1596
1688
  }
@@ -1615,10 +1707,10 @@ class b extends g {
1615
1707
  i.includes(c) || o.push(c);
1616
1708
  const d = [];
1617
1709
  for (const c of i) {
1618
- const p = a[c], k = s.data[c];
1710
+ const p = a[c], b = s.data[c];
1619
1711
  d.push({
1620
1712
  key: { status: "valid", value: c },
1621
- value: p._parse(new R(s, k, s.path, c)),
1713
+ value: p._parse(new R(s, b, s.path, c)),
1622
1714
  alwaysSet: c in s.data
1623
1715
  });
1624
1716
  }
@@ -1639,11 +1731,11 @@ class b extends g {
1639
1731
  } else {
1640
1732
  const c = this._def.catchall;
1641
1733
  for (const p of o) {
1642
- const k = s.data[p];
1734
+ const b = s.data[p];
1643
1735
  d.push({
1644
1736
  key: { status: "valid", value: p },
1645
1737
  value: c._parse(
1646
- new R(s, k, s.path, p)
1738
+ new R(s, b, s.path, p)
1647
1739
  //, ctx.child(key), value, getParsedType(value)
1648
1740
  ),
1649
1741
  alwaysSet: p in s.data
@@ -1653,9 +1745,9 @@ class b extends g {
1653
1745
  return s.common.async ? Promise.resolve().then(async () => {
1654
1746
  const c = [];
1655
1747
  for (const p of d) {
1656
- const k = await p.key, O = await p.value;
1748
+ const b = await p.key, O = await p.value;
1657
1749
  c.push({
1658
- key: k,
1750
+ key: b,
1659
1751
  value: O,
1660
1752
  alwaysSet: p.alwaysSet
1661
1753
  });
@@ -1667,7 +1759,7 @@ class b extends g {
1667
1759
  return this._def.shape();
1668
1760
  }
1669
1761
  strict(e) {
1670
- return m.errToObj, new b({
1762
+ return m.errToObj, new k({
1671
1763
  ...this._def,
1672
1764
  unknownKeys: "strict",
1673
1765
  ...e !== void 0 ? {
@@ -1684,13 +1776,13 @@ class b extends g {
1684
1776
  });
1685
1777
  }
1686
1778
  strip() {
1687
- return new b({
1779
+ return new k({
1688
1780
  ...this._def,
1689
1781
  unknownKeys: "strip"
1690
1782
  });
1691
1783
  }
1692
1784
  passthrough() {
1693
- return new b({
1785
+ return new k({
1694
1786
  ...this._def,
1695
1787
  unknownKeys: "passthrough"
1696
1788
  });
@@ -1713,7 +1805,7 @@ class b extends g {
1713
1805
  // }) as any;
1714
1806
  // };
1715
1807
  extend(e) {
1716
- return new b({
1808
+ return new k({
1717
1809
  ...this._def,
1718
1810
  shape: () => ({
1719
1811
  ...this._def.shape(),
@@ -1727,7 +1819,7 @@ class b extends g {
1727
1819
  * upgrade if you are experiencing issues.
1728
1820
  */
1729
1821
  merge(e) {
1730
- return new b({
1822
+ return new k({
1731
1823
  unknownKeys: e._def.unknownKeys,
1732
1824
  catchall: e._def.catchall,
1733
1825
  shape: () => ({
@@ -1797,7 +1889,7 @@ class b extends g {
1797
1889
  // return merged;
1798
1890
  // }
1799
1891
  catchall(e) {
1800
- return new b({
1892
+ return new k({
1801
1893
  ...this._def,
1802
1894
  catchall: e
1803
1895
  });
@@ -1806,7 +1898,7 @@ class b extends g {
1806
1898
  const t = {};
1807
1899
  return x.objectKeys(e).forEach((n) => {
1808
1900
  e[n] && this.shape[n] && (t[n] = this.shape[n]);
1809
- }), new b({
1901
+ }), new k({
1810
1902
  ...this._def,
1811
1903
  shape: () => t
1812
1904
  });
@@ -1815,7 +1907,7 @@ class b extends g {
1815
1907
  const t = {};
1816
1908
  return x.objectKeys(this.shape).forEach((n) => {
1817
1909
  e[n] || (t[n] = this.shape[n]);
1818
- }), new b({
1910
+ }), new k({
1819
1911
  ...this._def,
1820
1912
  shape: () => t
1821
1913
  });
@@ -1831,7 +1923,7 @@ class b extends g {
1831
1923
  return x.objectKeys(this.shape).forEach((n) => {
1832
1924
  const s = this.shape[n];
1833
1925
  e && !e[n] ? t[n] = s : t[n] = s.optional();
1834
- }), new b({
1926
+ }), new k({
1835
1927
  ...this._def,
1836
1928
  shape: () => t
1837
1929
  });
@@ -1843,34 +1935,34 @@ class b extends g {
1843
1935
  t[n] = this.shape[n];
1844
1936
  else {
1845
1937
  let a = this.shape[n];
1846
- for (; a instanceof N; )
1938
+ for (; a instanceof E; )
1847
1939
  a = a._def.innerType;
1848
1940
  t[n] = a;
1849
1941
  }
1850
- }), new b({
1942
+ }), new k({
1851
1943
  ...this._def,
1852
1944
  shape: () => t
1853
1945
  });
1854
1946
  }
1855
1947
  keyof() {
1856
- return tt(x.objectKeys(this.shape));
1948
+ return rt(x.objectKeys(this.shape));
1857
1949
  }
1858
1950
  }
1859
- b.create = (r, e) => new b({
1951
+ k.create = (r, e) => new k({
1860
1952
  shape: () => r,
1861
1953
  unknownKeys: "strip",
1862
1954
  catchall: M.create(),
1863
1955
  typeName: _.ZodObject,
1864
1956
  ...v(e)
1865
1957
  });
1866
- b.strictCreate = (r, e) => new b({
1958
+ k.strictCreate = (r, e) => new k({
1867
1959
  shape: () => r,
1868
1960
  unknownKeys: "strict",
1869
1961
  catchall: M.create(),
1870
1962
  typeName: _.ZodObject,
1871
1963
  ...v(e)
1872
1964
  });
1873
- b.lazycreate = (r, e) => new b({
1965
+ k.lazycreate = (r, e) => new k({
1874
1966
  shape: r,
1875
1967
  unknownKeys: "strip",
1876
1968
  catchall: M.create(),
@@ -1950,8 +2042,8 @@ le.create = (r, e) => new le({
1950
2042
  typeName: _.ZodUnion,
1951
2043
  ...v(e)
1952
2044
  });
1953
- const A = (r) => r instanceof pe ? A(r.schema) : r instanceof C ? A(r.innerType()) : r instanceof me ? [r.value] : r instanceof U ? r.options : r instanceof _e ? x.objectValues(r.enum) : r instanceof ye ? A(r._def.innerType) : r instanceof ce ? [void 0] : r instanceof ue ? [null] : r instanceof N ? [void 0, ...A(r.unwrap())] : r instanceof z ? [null, ...A(r.unwrap())] : r instanceof He || r instanceof ge ? A(r.unwrap()) : r instanceof ve ? A(r._def.innerType) : [];
1954
- class Ce extends g {
2045
+ const I = (r) => r instanceof pe ? I(r.schema) : r instanceof A ? I(r.innerType()) : r instanceof me ? [r.value] : r instanceof z ? r.options : r instanceof _e ? x.objectValues(r.enum) : r instanceof ye ? I(r._def.innerType) : r instanceof ce ? [void 0] : r instanceof ue ? [null] : r instanceof E ? [void 0, ...I(r.unwrap())] : r instanceof U ? [null, ...I(r.unwrap())] : r instanceof Je || r instanceof ge ? I(r.unwrap()) : r instanceof ve ? I(r._def.innerType) : [];
2046
+ class Ae extends g {
1955
2047
  _parse(e) {
1956
2048
  const { ctx: t } = this._processInputParams(e);
1957
2049
  if (t.parsedType !== f.object)
@@ -1995,7 +2087,7 @@ class Ce extends g {
1995
2087
  static create(e, t, n) {
1996
2088
  const s = /* @__PURE__ */ new Map();
1997
2089
  for (const a of t) {
1998
- const i = A(a.shape[e]);
2090
+ const i = I(a.shape[e]);
1999
2091
  if (!i.length)
2000
2092
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
2001
2093
  for (const o of i) {
@@ -2004,7 +2096,7 @@ class Ce extends g {
2004
2096
  s.set(o, a);
2005
2097
  }
2006
2098
  }
2007
- return new Ce({
2099
+ return new Ae({
2008
2100
  typeName: _.ZodDiscriminatedUnion,
2009
2101
  discriminator: e,
2010
2102
  options: t,
@@ -2013,14 +2105,14 @@ class Ce extends g {
2013
2105
  });
2014
2106
  }
2015
2107
  }
2016
- function Je(r, e) {
2017
- const t = D(r), n = D(e);
2108
+ function qe(r, e) {
2109
+ const t = $(r), n = $(e);
2018
2110
  if (r === e)
2019
2111
  return { valid: !0, data: r };
2020
2112
  if (t === f.object && n === f.object) {
2021
2113
  const s = x.objectKeys(e), a = x.objectKeys(r).filter((o) => s.indexOf(o) !== -1), i = { ...r, ...e };
2022
2114
  for (const o of a) {
2023
- const d = Je(r[o], e[o]);
2115
+ const d = qe(r[o], e[o]);
2024
2116
  if (!d.valid)
2025
2117
  return { valid: !1 };
2026
2118
  i[o] = d.data;
@@ -2031,7 +2123,7 @@ function Je(r, e) {
2031
2123
  return { valid: !1 };
2032
2124
  const s = [];
2033
2125
  for (let a = 0; a < r.length; a++) {
2034
- const i = r[a], o = e[a], d = Je(i, o);
2126
+ const i = r[a], o = e[a], d = qe(i, o);
2035
2127
  if (!d.valid)
2036
2128
  return { valid: !1 };
2037
2129
  s.push(d.data);
@@ -2042,10 +2134,10 @@ function Je(r, e) {
2042
2134
  class fe extends g {
2043
2135
  _parse(e) {
2044
2136
  const { status: t, ctx: n } = this._processInputParams(e), s = (a, i) => {
2045
- if (We(a) || We(i))
2137
+ if (Fe(a) || Fe(i))
2046
2138
  return y;
2047
- const o = Je(a.value, i.value);
2048
- return o.valid ? ((qe(a) || qe(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(n, {
2139
+ const o = qe(a.value, i.value);
2140
+ return o.valid ? ((We(a) || We(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(n, {
2049
2141
  code: u.invalid_intersection_types
2050
2142
  }), y);
2051
2143
  };
@@ -2077,7 +2169,7 @@ fe.create = (r, e, t) => new fe({
2077
2169
  typeName: _.ZodIntersection,
2078
2170
  ...v(t)
2079
2171
  });
2080
- class I extends g {
2172
+ class N extends g {
2081
2173
  _parse(e) {
2082
2174
  const { status: t, ctx: n } = this._processInputParams(e);
2083
2175
  if (n.parsedType !== f.array)
@@ -2111,16 +2203,16 @@ class I extends g {
2111
2203
  return this._def.items;
2112
2204
  }
2113
2205
  rest(e) {
2114
- return new I({
2206
+ return new N({
2115
2207
  ...this._def,
2116
2208
  rest: e
2117
2209
  });
2118
2210
  }
2119
2211
  }
2120
- I.create = (r, e) => {
2212
+ N.create = (r, e) => {
2121
2213
  if (!Array.isArray(r))
2122
2214
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2123
- return new I({
2215
+ return new N({
2124
2216
  items: r,
2125
2217
  typeName: _.ZodTuple,
2126
2218
  rest: null,
@@ -2168,7 +2260,7 @@ class he extends g {
2168
2260
  });
2169
2261
  }
2170
2262
  }
2171
- class Oe extends g {
2263
+ class Se extends g {
2172
2264
  get keySchema() {
2173
2265
  return this._def.keyType;
2174
2266
  }
@@ -2210,7 +2302,7 @@ class Oe extends g {
2210
2302
  }
2211
2303
  }
2212
2304
  }
2213
- Oe.create = (r, e, t) => new Oe({
2305
+ Se.create = (r, e, t) => new Se({
2214
2306
  valueType: e,
2215
2307
  keyType: r,
2216
2308
  typeName: _.ZodMap,
@@ -2325,14 +2417,14 @@ class K extends g {
2325
2417
  });
2326
2418
  }
2327
2419
  const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
2328
- if (this._def.returns instanceof ee) {
2420
+ if (this._def.returns instanceof te) {
2329
2421
  const o = this;
2330
2422
  return Z(async function(...d) {
2331
2423
  const c = new S([]), p = await o._def.args.parseAsync(d, a).catch((w) => {
2332
2424
  throw c.addIssue(n(d, w)), c;
2333
- }), k = await Reflect.apply(i, this, p);
2334
- return await o._def.returns._def.type.parseAsync(k, a).catch((w) => {
2335
- throw c.addIssue(s(k, w)), c;
2425
+ }), b = await Reflect.apply(i, this, p);
2426
+ return await o._def.returns._def.type.parseAsync(b, a).catch((w) => {
2427
+ throw c.addIssue(s(b, w)), c;
2336
2428
  });
2337
2429
  });
2338
2430
  } else {
@@ -2341,10 +2433,10 @@ class K extends g {
2341
2433
  const c = o._def.args.safeParse(d, a);
2342
2434
  if (!c.success)
2343
2435
  throw new S([n(d, c.error)]);
2344
- const p = Reflect.apply(i, this, c.data), k = o._def.returns.safeParse(p, a);
2345
- if (!k.success)
2346
- throw new S([s(p, k.error)]);
2347
- return k.data;
2436
+ const p = Reflect.apply(i, this, c.data), b = o._def.returns.safeParse(p, a);
2437
+ if (!b.success)
2438
+ throw new S([s(p, b.error)]);
2439
+ return b.data;
2348
2440
  });
2349
2441
  }
2350
2442
  }
@@ -2357,7 +2449,7 @@ class K extends g {
2357
2449
  args(...e) {
2358
2450
  return new K({
2359
2451
  ...this._def,
2360
- args: I.create(e).rest(W.create())
2452
+ args: N.create(e).rest(F.create())
2361
2453
  });
2362
2454
  }
2363
2455
  returns(e) {
@@ -2374,8 +2466,8 @@ class K extends g {
2374
2466
  }
2375
2467
  static create(e, t, n) {
2376
2468
  return new K({
2377
- args: e || I.create([]).rest(W.create()),
2378
- returns: t || W.create(),
2469
+ args: e || N.create([]).rest(F.create()),
2470
+ returns: t || F.create(),
2379
2471
  typeName: _.ZodFunction,
2380
2472
  ...v(n)
2381
2473
  });
@@ -2416,16 +2508,16 @@ me.create = (r, e) => new me({
2416
2508
  typeName: _.ZodLiteral,
2417
2509
  ...v(e)
2418
2510
  });
2419
- function tt(r, e) {
2420
- return new U({
2511
+ function rt(r, e) {
2512
+ return new z({
2421
2513
  values: r,
2422
2514
  typeName: _.ZodEnum,
2423
2515
  ...v(e)
2424
2516
  });
2425
2517
  }
2426
- class U extends g {
2518
+ class z extends g {
2427
2519
  constructor() {
2428
- super(...arguments), se.set(this, void 0);
2520
+ super(...arguments), ae.set(this, void 0);
2429
2521
  }
2430
2522
  _parse(e) {
2431
2523
  if (typeof e.data != "string") {
@@ -2436,7 +2528,7 @@ class U extends g {
2436
2528
  code: u.invalid_type
2437
2529
  }), y;
2438
2530
  }
2439
- if (Te(this, se) || Ke(this, se, new Set(this._def.values)), !Te(this, se).has(e.data)) {
2531
+ if (Te(this, ae) || Ke(this, ae, new Set(this._def.values)), !Te(this, ae).has(e.data)) {
2440
2532
  const t = this._getOrReturnCtx(e), n = this._def.values;
2441
2533
  return l(t, {
2442
2534
  received: t.data,
@@ -2468,23 +2560,23 @@ class U extends g {
2468
2560
  return e;
2469
2561
  }
2470
2562
  extract(e, t = this._def) {
2471
- return U.create(e, {
2563
+ return z.create(e, {
2472
2564
  ...this._def,
2473
2565
  ...t
2474
2566
  });
2475
2567
  }
2476
2568
  exclude(e, t = this._def) {
2477
- return U.create(this.options.filter((n) => !e.includes(n)), {
2569
+ return z.create(this.options.filter((n) => !e.includes(n)), {
2478
2570
  ...this._def,
2479
2571
  ...t
2480
2572
  });
2481
2573
  }
2482
2574
  }
2483
- se = /* @__PURE__ */ new WeakMap();
2484
- U.create = tt;
2575
+ ae = /* @__PURE__ */ new WeakMap();
2576
+ z.create = rt;
2485
2577
  class _e extends g {
2486
2578
  constructor() {
2487
- super(...arguments), ae.set(this, void 0);
2579
+ super(...arguments), ie.set(this, void 0);
2488
2580
  }
2489
2581
  _parse(e) {
2490
2582
  const t = x.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
@@ -2496,7 +2588,7 @@ class _e extends g {
2496
2588
  code: u.invalid_type
2497
2589
  }), y;
2498
2590
  }
2499
- if (Te(this, ae) || Ke(this, ae, new Set(x.getValidEnumValues(this._def.values))), !Te(this, ae).has(e.data)) {
2591
+ if (Te(this, ie) || Ke(this, ie, new Set(x.getValidEnumValues(this._def.values))), !Te(this, ie).has(e.data)) {
2500
2592
  const s = x.objectValues(t);
2501
2593
  return l(n, {
2502
2594
  received: n.data,
@@ -2510,13 +2602,13 @@ class _e extends g {
2510
2602
  return this._def.values;
2511
2603
  }
2512
2604
  }
2513
- ae = /* @__PURE__ */ new WeakMap();
2605
+ ie = /* @__PURE__ */ new WeakMap();
2514
2606
  _e.create = (r, e) => new _e({
2515
2607
  values: r,
2516
2608
  typeName: _.ZodNativeEnum,
2517
2609
  ...v(e)
2518
2610
  });
2519
- class ee extends g {
2611
+ class te extends g {
2520
2612
  unwrap() {
2521
2613
  return this._def.type;
2522
2614
  }
@@ -2535,12 +2627,12 @@ class ee extends g {
2535
2627
  })));
2536
2628
  }
2537
2629
  }
2538
- ee.create = (r, e) => new ee({
2630
+ te.create = (r, e) => new te({
2539
2631
  type: r,
2540
2632
  typeName: _.ZodPromise,
2541
2633
  ...v(e)
2542
2634
  });
2543
- class C extends g {
2635
+ class A extends g {
2544
2636
  innerType() {
2545
2637
  return this._def.schema;
2546
2638
  }
@@ -2606,30 +2698,30 @@ class C extends g {
2606
2698
  path: n.path,
2607
2699
  parent: n
2608
2700
  });
2609
- if (!ie(i))
2701
+ if (!W(i))
2610
2702
  return i;
2611
2703
  const o = s.transform(i.value, a);
2612
2704
  if (o instanceof Promise)
2613
2705
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2614
2706
  return { status: t.value, value: o };
2615
2707
  } else
2616
- return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => ie(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
2708
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => W(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
2617
2709
  x.assertNever(s);
2618
2710
  }
2619
2711
  }
2620
- C.create = (r, e, t) => new C({
2712
+ A.create = (r, e, t) => new A({
2621
2713
  schema: r,
2622
2714
  typeName: _.ZodEffects,
2623
2715
  effect: e,
2624
2716
  ...v(t)
2625
2717
  });
2626
- C.createWithPreprocess = (r, e, t) => new C({
2718
+ A.createWithPreprocess = (r, e, t) => new A({
2627
2719
  schema: e,
2628
2720
  effect: { type: "preprocess", transform: r },
2629
2721
  typeName: _.ZodEffects,
2630
2722
  ...v(t)
2631
2723
  });
2632
- class N extends g {
2724
+ class E extends g {
2633
2725
  _parse(e) {
2634
2726
  return this._getType(e) === f.undefined ? Z(void 0) : this._def.innerType._parse(e);
2635
2727
  }
@@ -2637,12 +2729,12 @@ class N extends g {
2637
2729
  return this._def.innerType;
2638
2730
  }
2639
2731
  }
2640
- N.create = (r, e) => new N({
2732
+ E.create = (r, e) => new E({
2641
2733
  innerType: r,
2642
2734
  typeName: _.ZodOptional,
2643
2735
  ...v(e)
2644
2736
  });
2645
- class z extends g {
2737
+ class U extends g {
2646
2738
  _parse(e) {
2647
2739
  return this._getType(e) === f.null ? Z(null) : this._def.innerType._parse(e);
2648
2740
  }
@@ -2650,7 +2742,7 @@ class z extends g {
2650
2742
  return this._def.innerType;
2651
2743
  }
2652
2744
  }
2653
- z.create = (r, e) => new z({
2745
+ U.create = (r, e) => new U({
2654
2746
  innerType: r,
2655
2747
  typeName: _.ZodNullable,
2656
2748
  ...v(e)
@@ -2735,8 +2827,8 @@ je.create = (r) => new je({
2735
2827
  typeName: _.ZodNaN,
2736
2828
  ...v(r)
2737
2829
  });
2738
- const Rt = Symbol("zod_brand");
2739
- class He extends g {
2830
+ const Vt = Symbol("zod_brand");
2831
+ class Je extends g {
2740
2832
  _parse(e) {
2741
2833
  const { ctx: t } = this._processInputParams(e), n = t.data;
2742
2834
  return this._def.type._parse({
@@ -2791,7 +2883,7 @@ class xe extends g {
2791
2883
  }
2792
2884
  class ge extends g {
2793
2885
  _parse(e) {
2794
- const t = this._def.innerType._parse(e), n = (s) => (ie(s) && (s.value = Object.freeze(s.value)), s);
2886
+ const t = this._def.innerType._parse(e), n = (s) => (W(s) && (s.value = Object.freeze(s.value)), s);
2795
2887
  return oe(t) ? t.then((s) => n(s)) : n(t);
2796
2888
  }
2797
2889
  unwrap() {
@@ -2803,25 +2895,38 @@ ge.create = (r, e) => new ge({
2803
2895
  typeName: _.ZodReadonly,
2804
2896
  ...v(e)
2805
2897
  });
2806
- function rt(r, e = {}, t) {
2807
- return r ? F.create().superRefine((n, s) => {
2898
+ function Ye(r, e) {
2899
+ const t = typeof r == "function" ? r(e) : typeof r == "string" ? { message: r } : r;
2900
+ return typeof t == "string" ? { message: t } : t;
2901
+ }
2902
+ function nt(r, e = {}, t) {
2903
+ return r ? ee.create().superRefine((n, s) => {
2808
2904
  var a, i;
2809
- if (!r(n)) {
2810
- const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, d = (i = (a = o.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0, c = typeof o == "string" ? { message: o } : o;
2811
- s.addIssue({ code: "custom", ...c, fatal: d });
2905
+ const o = r(n);
2906
+ if (o instanceof Promise)
2907
+ return o.then((d) => {
2908
+ var c, p;
2909
+ if (!d) {
2910
+ const b = Ye(e, n), O = (p = (c = b.fatal) !== null && c !== void 0 ? c : t) !== null && p !== void 0 ? p : !0;
2911
+ s.addIssue({ code: "custom", ...b, fatal: O });
2912
+ }
2913
+ });
2914
+ if (!o) {
2915
+ const d = Ye(e, n), c = (i = (a = d.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0;
2916
+ s.addIssue({ code: "custom", ...d, fatal: c });
2812
2917
  }
2813
- }) : F.create();
2918
+ }) : ee.create();
2814
2919
  }
2815
- const It = {
2816
- object: b.lazycreate
2920
+ const Lt = {
2921
+ object: k.lazycreate
2817
2922
  };
2818
2923
  var _;
2819
2924
  (function(r) {
2820
2925
  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";
2821
2926
  })(_ || (_ = {}));
2822
- const At = (r, e = {
2927
+ const zt = (r, e = {
2823
2928
  message: `Input not instance of ${r.name}`
2824
- }) => rt((t) => t instanceof r, e), nt = j.create, st = V.create, Mt = je.create, Pt = L.create, at = de.create, $t = q.create, Dt = Ze.create, Vt = ce.create, Lt = ue.create, Ut = F.create, zt = W.create, Bt = M.create, Wt = Se.create, qt = E.create, Jt = b.create, Ht = b.strictCreate, Yt = le.create, Gt = Ce.create, Xt = fe.create, Kt = I.create, Qt = he.create, Ft = Oe.create, er = J.create, tr = K.create, rr = pe.create, nr = me.create, sr = U.create, ar = _e.create, ir = ee.create, Ge = C.create, or = N.create, dr = z.create, cr = C.createWithPreprocess, ur = xe.create, lr = () => nt().optional(), fr = () => st().optional(), hr = () => at().optional(), pr = {
2929
+ }) => nt((t) => t instanceof r, e), st = j.create, at = V.create, Ut = je.create, Bt = L.create, it = de.create, Ft = q.create, Wt = Ze.create, qt = ce.create, Jt = ue.create, Ht = ee.create, Yt = F.create, Gt = M.create, Xt = Oe.create, Kt = C.create, Qt = k.create, er = k.strictCreate, tr = le.create, rr = Ae.create, nr = fe.create, sr = N.create, ar = he.create, ir = Se.create, or = J.create, dr = K.create, cr = pe.create, ur = me.create, lr = z.create, fr = _e.create, hr = te.create, Ge = A.create, pr = E.create, mr = U.create, _r = A.createWithPreprocess, yr = xe.create, vr = () => st().optional(), gr = () => at().optional(), xr = () => it().optional(), br = {
2825
2930
  string: (r) => j.create({ ...r, coerce: !0 }),
2826
2931
  number: (r) => V.create({ ...r, coerce: !0 }),
2827
2932
  boolean: (r) => de.create({
@@ -2830,22 +2935,22 @@ const At = (r, e = {
2830
2935
  }),
2831
2936
  bigint: (r) => L.create({ ...r, coerce: !0 }),
2832
2937
  date: (r) => q.create({ ...r, coerce: !0 })
2833
- }, mr = y;
2938
+ }, kr = y;
2834
2939
  var h = /* @__PURE__ */ Object.freeze({
2835
2940
  __proto__: null,
2836
2941
  defaultErrorMap: Q,
2837
- setErrorMap: mt,
2942
+ setErrorMap: _t,
2838
2943
  getErrorMap: ke,
2839
2944
  makeIssue: we,
2840
- EMPTY_PATH: _t,
2945
+ EMPTY_PATH: yt,
2841
2946
  addIssueToContext: l,
2842
2947
  ParseStatus: T,
2843
2948
  INVALID: y,
2844
2949
  DIRTY: X,
2845
2950
  OK: Z,
2846
- isAborted: We,
2847
- isDirty: qe,
2848
- isValid: ie,
2951
+ isAborted: Fe,
2952
+ isDirty: We,
2953
+ isValid: W,
2849
2954
  isAsync: oe,
2850
2955
  get util() {
2851
2956
  return x;
@@ -2854,9 +2959,9 @@ var h = /* @__PURE__ */ Object.freeze({
2854
2959
  return Be;
2855
2960
  },
2856
2961
  ZodParsedType: f,
2857
- getParsedType: D,
2962
+ getParsedType: $,
2858
2963
  ZodType: g,
2859
- datetimeRegex: et,
2964
+ datetimeRegex: tt,
2860
2965
  ZodString: j,
2861
2966
  ZodNumber: V,
2862
2967
  ZodBigInt: L,
@@ -2865,90 +2970,90 @@ var h = /* @__PURE__ */ Object.freeze({
2865
2970
  ZodSymbol: Ze,
2866
2971
  ZodUndefined: ce,
2867
2972
  ZodNull: ue,
2868
- ZodAny: F,
2869
- ZodUnknown: W,
2973
+ ZodAny: ee,
2974
+ ZodUnknown: F,
2870
2975
  ZodNever: M,
2871
- ZodVoid: Se,
2872
- ZodArray: E,
2873
- ZodObject: b,
2976
+ ZodVoid: Oe,
2977
+ ZodArray: C,
2978
+ ZodObject: k,
2874
2979
  ZodUnion: le,
2875
- ZodDiscriminatedUnion: Ce,
2980
+ ZodDiscriminatedUnion: Ae,
2876
2981
  ZodIntersection: fe,
2877
- ZodTuple: I,
2982
+ ZodTuple: N,
2878
2983
  ZodRecord: he,
2879
- ZodMap: Oe,
2984
+ ZodMap: Se,
2880
2985
  ZodSet: J,
2881
2986
  ZodFunction: K,
2882
2987
  ZodLazy: pe,
2883
2988
  ZodLiteral: me,
2884
- ZodEnum: U,
2989
+ ZodEnum: z,
2885
2990
  ZodNativeEnum: _e,
2886
- ZodPromise: ee,
2887
- ZodEffects: C,
2888
- ZodTransformer: C,
2889
- ZodOptional: N,
2890
- ZodNullable: z,
2991
+ ZodPromise: te,
2992
+ ZodEffects: A,
2993
+ ZodTransformer: A,
2994
+ ZodOptional: E,
2995
+ ZodNullable: U,
2891
2996
  ZodDefault: ye,
2892
2997
  ZodCatch: ve,
2893
2998
  ZodNaN: je,
2894
- BRAND: Rt,
2895
- ZodBranded: He,
2999
+ BRAND: Vt,
3000
+ ZodBranded: Je,
2896
3001
  ZodPipeline: xe,
2897
3002
  ZodReadonly: ge,
2898
- custom: rt,
3003
+ custom: nt,
2899
3004
  Schema: g,
2900
3005
  ZodSchema: g,
2901
- late: It,
3006
+ late: Lt,
2902
3007
  get ZodFirstPartyTypeKind() {
2903
3008
  return _;
2904
3009
  },
2905
- coerce: pr,
2906
- any: Ut,
2907
- array: qt,
2908
- bigint: Pt,
2909
- boolean: at,
2910
- date: $t,
2911
- discriminatedUnion: Gt,
3010
+ coerce: br,
3011
+ any: Ht,
3012
+ array: Kt,
3013
+ bigint: Bt,
3014
+ boolean: it,
3015
+ date: Ft,
3016
+ discriminatedUnion: rr,
2912
3017
  effect: Ge,
2913
- enum: sr,
2914
- function: tr,
2915
- instanceof: At,
2916
- intersection: Xt,
2917
- lazy: rr,
2918
- literal: nr,
2919
- map: Ft,
2920
- nan: Mt,
2921
- nativeEnum: ar,
2922
- never: Bt,
2923
- null: Lt,
2924
- nullable: dr,
2925
- number: st,
2926
- object: Jt,
2927
- oboolean: hr,
2928
- onumber: fr,
2929
- optional: or,
2930
- ostring: lr,
2931
- pipeline: ur,
2932
- preprocess: cr,
2933
- promise: ir,
2934
- record: Qt,
2935
- set: er,
2936
- strictObject: Ht,
2937
- string: nt,
2938
- symbol: Dt,
3018
+ enum: lr,
3019
+ function: dr,
3020
+ instanceof: zt,
3021
+ intersection: nr,
3022
+ lazy: cr,
3023
+ literal: ur,
3024
+ map: ir,
3025
+ nan: Ut,
3026
+ nativeEnum: fr,
3027
+ never: Gt,
3028
+ null: Jt,
3029
+ nullable: mr,
3030
+ number: at,
3031
+ object: Qt,
3032
+ oboolean: xr,
3033
+ onumber: gr,
3034
+ optional: pr,
3035
+ ostring: vr,
3036
+ pipeline: yr,
3037
+ preprocess: _r,
3038
+ promise: hr,
3039
+ record: ar,
3040
+ set: or,
3041
+ strictObject: er,
3042
+ string: st,
3043
+ symbol: Wt,
2939
3044
  transformer: Ge,
2940
- tuple: Kt,
2941
- undefined: Vt,
2942
- union: Yt,
2943
- unknown: zt,
2944
- void: Wt,
2945
- NEVER: mr,
3045
+ tuple: sr,
3046
+ undefined: qt,
3047
+ union: tr,
3048
+ unknown: Yt,
3049
+ void: Xt,
3050
+ NEVER: kr,
2946
3051
  ZodIssueCode: u,
2947
- quotelessJson: pt,
3052
+ quotelessJson: mt,
2948
3053
  ZodError: S
2949
3054
  });
2950
- ht(h);
2951
- const _r = (r, e) => e.skipDedupe || e.method !== "GET", yr = (r, e) => e.method + "@" + r, vr = (r) => r.clone(), gr = ({ skip: r = _r, key: e = yr, resolver: t = vr } = {}) => {
3055
+ pt(h);
3056
+ const wr = (r, e) => e.skipDedupe || e.method !== "GET", Tr = (r, e) => e.method + "@" + r, Zr = (r) => r.clone(), Or = ({ skip: r = wr, key: e = Tr, resolver: t = Zr } = {}) => {
2952
3057
  const n = /* @__PURE__ */ new Map();
2953
3058
  return (s) => (a, i) => {
2954
3059
  if (r(a, i))
@@ -2968,12 +3073,12 @@ const _r = (r, e) => e.skipDedupe || e.method !== "GET", yr = (r, e) => e.method
2968
3073
  return n.delete(o), Promise.reject(d);
2969
3074
  }
2970
3075
  };
2971
- }, xr = (r, e) => r * e, br = (r) => r && r.ok, kr = ({ delayTimer: r = 500, delayRamp: e = xr, maxAttempts: t = 10, until: n = br, onRetry: s = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: i = !1, skip: o } = {}) => (d) => (c, p) => {
2972
- let k = 0;
3076
+ }, Sr = (r, e) => r * e, jr = (r) => r && r.ok, Cr = ({ delayTimer: r = 500, delayRamp: e = Sr, maxAttempts: t = 10, until: n = jr, onRetry: s = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: i = !1, skip: o } = {}) => (d) => (c, p) => {
3077
+ let b = 0;
2973
3078
  if (o && o(c, p))
2974
3079
  return d(c, p);
2975
- const O = (w, P) => Promise.resolve(n(w, P)).then((Ne) => Ne ? w && i ? w : P ? Promise.reject(P) : w : (k++, !t || k <= t ? new Promise(($) => {
2976
- const be = e(r, k);
3080
+ const O = (w, P) => Promise.resolve(n(w, P)).then((Ee) => Ee ? w && i ? w : P ? Promise.reject(P) : w : (b++, !t || b <= t ? new Promise((D) => {
3081
+ const be = e(r, b);
2977
3082
  setTimeout(() => {
2978
3083
  typeof s == "function" ? Promise.resolve(s({
2979
3084
  response: w,
@@ -2981,38 +3086,38 @@ const _r = (r, e) => e.skipDedupe || e.method !== "GET", yr = (r, e) => e.method
2981
3086
  url: c,
2982
3087
  options: p
2983
3088
  })).then((B = {}) => {
2984
- var te, re;
2985
- $(d((te = B && B.url) !== null && te !== void 0 ? te : c, (re = B && B.options) !== null && re !== void 0 ? re : p));
2986
- }) : $(d(c, p));
3089
+ var re, ne;
3090
+ D(d((re = B && B.url) !== null && re !== void 0 ? re : c, (ne = B && B.options) !== null && ne !== void 0 ? ne : p));
3091
+ }) : D(d(c, p));
2987
3092
  }, be);
2988
- }).then(O).catch(($) => {
3093
+ }).then(O).catch((D) => {
2989
3094
  if (!a)
2990
- throw $;
2991
- return O(null, $);
3095
+ throw D;
3096
+ return O(null, D);
2992
3097
  }) : w && i ? w : Promise.reject(P || new Error("Number of attempts exceeded."))));
2993
3098
  return d(c, p).then(O).catch((w) => {
2994
3099
  if (!a)
2995
3100
  throw w;
2996
3101
  return O(null, w);
2997
3102
  });
2998
- }, Ee = h.object({
3103
+ }, Ce = h.object({
2999
3104
  code: h.number(),
3000
3105
  message: h.string()
3001
- }), wr = h.object({
3106
+ }), Ar = h.object({
3002
3107
  message: h.string()
3003
- }), Tr = h.object({
3108
+ }), Er = h.object({
3004
3109
  emails: h.array(h.string()).optional(),
3005
3110
  http_body: h.string().optional(),
3006
3111
  http_url: h.string().optional(),
3007
3112
  txt_name: h.string().optional(),
3008
3113
  txt_value: h.string().optional()
3009
- }), Zr = h.object({
3114
+ }), Rr = h.object({
3010
3115
  ciphers: h.array(h.string()).optional(),
3011
3116
  early_hints: h.string().optional(),
3012
3117
  http2: h.string().optional(),
3013
3118
  min_tls_version: h.string().optional(),
3014
3119
  tls_1_3: h.string().optional()
3015
- }), Sr = h.object({
3120
+ }), Nr = h.object({
3016
3121
  id: h.string(),
3017
3122
  bundle_method: h.string().optional(),
3018
3123
  certificate_authority: h.string(),
@@ -3024,51 +3129,51 @@ const _r = (r, e) => e.skipDedupe || e.method !== "GET", yr = (r, e) => e.method
3024
3129
  issuer: h.string().optional(),
3025
3130
  method: h.string(),
3026
3131
  serial_number: h.string().optional(),
3027
- settings: Zr.optional(),
3132
+ settings: Rr.optional(),
3028
3133
  signature: h.string().optional(),
3029
3134
  type: h.string(),
3030
3135
  uploaded_on: h.string().optional(),
3031
- validation_errors: h.array(wr).optional(),
3032
- validation_records: h.array(Tr).optional(),
3136
+ validation_errors: h.array(Ar).optional(),
3137
+ validation_records: h.array(Er).optional(),
3033
3138
  wildcard: h.boolean()
3034
- }), Or = h.object({
3139
+ }), Ir = h.object({
3035
3140
  name: h.string(),
3036
3141
  type: h.string(),
3037
3142
  value: h.string()
3038
- }), jr = h.object({
3143
+ }), $r = h.object({
3039
3144
  http_body: h.string().optional(),
3040
3145
  http_url: h.string().optional()
3041
- }), it = h.object({
3146
+ }), ot = h.object({
3042
3147
  id: h.string(),
3043
- ssl: Sr,
3148
+ ssl: Nr,
3044
3149
  hostname: h.string(),
3045
3150
  custom_metadata: h.record(h.string()).optional(),
3046
3151
  custom_origin_server: h.string().optional(),
3047
3152
  custom_origin_sni: h.string().optional(),
3048
- ownership_verification: Or.optional(),
3049
- ownership_verification_http: jr.optional(),
3153
+ ownership_verification: Ir.optional(),
3154
+ ownership_verification_http: $r.optional(),
3050
3155
  status: h.string(),
3051
3156
  verification_errors: h.array(h.string()).optional(),
3052
3157
  created_at: h.string()
3053
- }), Ue = h.object({
3054
- errors: h.array(Ee),
3055
- messages: h.array(Ee),
3158
+ }), ze = h.object({
3159
+ errors: h.array(Ce),
3160
+ messages: h.array(Ce),
3056
3161
  success: h.boolean(),
3057
- result: it
3058
- }), Er = h.object({
3059
- errors: h.array(Ee),
3060
- messages: h.array(Ee),
3162
+ result: ot
3163
+ }), Mr = h.object({
3164
+ errors: h.array(Ce),
3165
+ messages: h.array(Ce),
3061
3166
  success: h.boolean(),
3062
- result: h.array(it)
3167
+ result: h.array(ot)
3063
3168
  });
3064
3169
  function Y(r) {
3065
- return ut(`https://api.cloudflare.com/client/v4/zones/${r.zoneId}`).headers({
3170
+ return lt(`https://api.cloudflare.com/client/v4/zones/${r.zoneId}`).headers({
3066
3171
  "X-Auth-Email": r.authEmail,
3067
3172
  "X-Auth-Key": r.authKey,
3068
3173
  "Content-Type": "application/json"
3069
- }).middlewares([kr(), gr()]);
3174
+ }).middlewares([Cr(), Or()]);
3070
3175
  }
3071
- function ze(r) {
3176
+ function Ue(r) {
3072
3177
  const e = [];
3073
3178
  if (r.ssl.validation_records)
3074
3179
  for (const t of r.ssl.validation_records)
@@ -3088,14 +3193,14 @@ function ze(r) {
3088
3193
  status: r.status === "active" ? "ready" : "pending",
3089
3194
  type: "auth0_managed_certs",
3090
3195
  verification: {
3091
- methods: h.array(ct).parse(e)
3196
+ methods: h.array(ut).parse(e)
3092
3197
  }
3093
3198
  };
3094
3199
  }
3095
- function Cr(r) {
3200
+ function Pr(r) {
3096
3201
  return {
3097
3202
  create: async (e, t) => {
3098
- const { result: n, errors: s, success: a } = Ue.parse(
3203
+ const { result: n, errors: s, success: a } = ze.parse(
3099
3204
  await Y(r).post(
3100
3205
  {
3101
3206
  hostname: t.domain,
@@ -3112,7 +3217,7 @@ function Cr(r) {
3112
3217
  );
3113
3218
  if (!a)
3114
3219
  throw new Error(JSON.stringify(s));
3115
- const i = ze({
3220
+ const i = Ue({
3116
3221
  ...n,
3117
3222
  primary: !1
3118
3223
  });
@@ -3130,18 +3235,18 @@ function Cr(r) {
3130
3235
  );
3131
3236
  if (!n)
3132
3237
  throw new H(404);
3133
- const s = await Y(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json(), { result: a, errors: i, success: o } = Ue.parse(s);
3238
+ const s = await Y(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json(), { result: a, errors: i, success: o } = ze.parse(s);
3134
3239
  if (!o)
3135
3240
  throw new H(503, {
3136
3241
  message: JSON.stringify(i)
3137
3242
  });
3138
3243
  if (r.enterprise && ((d = a.custom_metadata) == null ? void 0 : d.tenant_id) !== e)
3139
3244
  throw new H(404);
3140
- return ze({ ...n, ...a });
3245
+ return Ue({ ...n, ...a });
3141
3246
  },
3142
3247
  getByDomain: async (e) => r.customDomainAdapter.getByDomain(e),
3143
3248
  list: async (e) => {
3144
- const t = await r.customDomainAdapter.list(e), n = await Y(r).get("/custom_hostnames").json(), { result: s, errors: a, success: i } = Er.parse(n);
3249
+ const t = await r.customDomainAdapter.list(e), n = await Y(r).get("/custom_hostnames").json(), { result: s, errors: a, success: i } = Mr.parse(n);
3145
3250
  if (!i)
3146
3251
  throw new H(503, {
3147
3252
  message: JSON.stringify(a)
@@ -3154,7 +3259,7 @@ function Cr(r) {
3154
3259
  return !(r.enterprise && ((d = o.custom_metadata) == null ? void 0 : d.tenant_id) !== e);
3155
3260
  }
3156
3261
  ).map(
3157
- (o) => ze({
3262
+ (o) => Ue({
3158
3263
  ...t.find((d) => d.custom_domain_id === o.id),
3159
3264
  ...o
3160
3265
  })
@@ -3163,7 +3268,7 @@ function Cr(r) {
3163
3268
  remove: async (e, t) => {
3164
3269
  var s;
3165
3270
  if (r.enterprise) {
3166
- const { result: a, success: i } = Ue.parse(
3271
+ const { result: a, success: i } = ze.parse(
3167
3272
  await Y(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json()
3168
3273
  );
3169
3274
  if (!i || ((s = a.custom_metadata) == null ? void 0 : s.tenant_id) !== e)
@@ -3189,11 +3294,11 @@ function Cr(r) {
3189
3294
  }
3190
3295
  };
3191
3296
  }
3192
- function Ar(r) {
3297
+ function zr(r) {
3193
3298
  return {
3194
- customDomains: Cr(r)
3299
+ customDomains: Pr(r)
3195
3300
  };
3196
3301
  }
3197
3302
  export {
3198
- Ar as default
3303
+ zr as default
3199
3304
  };