@authhero/cloudflare-adapter 1.25.0 → 1.27.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,74 +1,74 @@
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);
1
+ var ct = Object.defineProperty;
2
+ var dt = (r, e, t) => e in r ? ct(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var ke = (r, e, t) => dt(r, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { verificationMethodsSchema as ut } from "@authhero/adapter-interfaces";
5
5
  import lt from "wretch";
6
6
  function ft(r, e) {
7
7
  var t = {};
8
- for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && e.indexOf(n) < 0 && (t[n] = r[n]);
8
+ for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && e.indexOf(s) < 0 && (t[s] = r[s]);
9
9
  if (r != null && typeof Object.getOwnPropertySymbols == "function")
10
- for (var s = 0, n = Object.getOwnPropertySymbols(r); s < n.length; s++)
11
- e.indexOf(n[s]) < 0 && Object.prototype.propertyIsEnumerable.call(r, n[s]) && (t[n[s]] = r[n[s]]);
10
+ for (var n = 0, s = Object.getOwnPropertySymbols(r); n < s.length; n++)
11
+ e.indexOf(s[n]) < 0 && Object.prototype.propertyIsEnumerable.call(r, s[n]) && (t[s[n]] = r[s[n]]);
12
12
  return t;
13
13
  }
14
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 se(r, e) {
18
+ function ne(r, e) {
19
19
  const t = r.ZodType.prototype[e];
20
- r.ZodType.prototype[e] = function(...n) {
21
- const s = t.apply(this, n);
22
- return s._def.openapi = this._def.openapi, s;
20
+ r.ZodType.prototype[e] = function(...s) {
21
+ const n = t.apply(this, s);
22
+ return n._def.openapi = this._def.openapi, n;
23
23
  };
24
24
  }
25
25
  function pt(r) {
26
26
  if (typeof r.ZodType.prototype.openapi < "u")
27
27
  return;
28
- r.ZodType.prototype.openapi = function(s, a) {
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)
28
+ r.ZodType.prototype.openapi = function(n, a) {
29
+ var i, o, c, d, h, b;
30
+ const Z = typeof n == "string" ? a : n, w = Z ?? {}, { param: M } = w, Re = ft(w, ["param"]), D = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof n == "string" ? { refId: n } : void 0), be = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), Re), !((d = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || d === void 0) && d.param || M ? {
31
+ param: Object.assign(Object.assign({}, (b = (h = this._def.openapi) === null || h === void 0 ? void 0 : h.metadata) === null || b === void 0 ? void 0 : b.param), M)
32
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
33
  if (ht(this, "ZodObject")) {
34
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
- return De._def.openapi = {
35
+ B.extend = function(...se) {
36
+ var Ne, Ie, $e, Pe, Me, De;
37
+ const Ve = re.apply(this, se);
38
+ return Ve._def.openapi = {
39
39
  _internal: {
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
40
+ extendedFrom: !((Ie = (Ne = this._def.openapi) === null || Ne === void 0 ? void 0 : Ne._internal) === null || Ie === void 0) && Ie.refId ? { refId: (Pe = ($e = this._def.openapi) === null || $e === void 0 ? void 0 : $e._internal) === null || Pe === void 0 ? void 0 : Pe.refId, schema: this } : (Me = this._def.openapi) === null || Me === void 0 ? void 0 : Me._internal.extendedFrom
41
41
  },
42
- metadata: (Pe = De._def.openapi) === null || Pe === void 0 ? void 0 : Pe.metadata
43
- }, De;
42
+ metadata: (De = Ve._def.openapi) === null || De === void 0 ? void 0 : De.metadata
43
+ }, Ve;
44
44
  };
45
45
  }
46
46
  return B;
47
- }, se(r, "optional"), se(r, "nullable"), se(r, "default"), se(r, "transform"), se(r, "refine");
47
+ }, ne(r, "optional"), ne(r, "nullable"), ne(r, "default"), ne(r, "transform"), ne(r, "refine");
48
48
  const e = r.ZodObject.prototype.deepPartial;
49
49
  r.ZodObject.prototype.deepPartial = function() {
50
- const s = this._def.shape(), a = e.apply(this), i = a._def.shape();
51
- return Object.entries(i).forEach(([o, d]) => {
52
- var c, p;
53
- d._def.openapi = (p = (c = s[o]) === null || c === void 0 ? void 0 : c._def) === null || p === void 0 ? void 0 : p.openapi;
50
+ const n = this._def.shape(), a = e.apply(this), i = a._def.shape();
51
+ return Object.entries(i).forEach(([o, c]) => {
52
+ var d, h;
53
+ c._def.openapi = (h = (d = n[o]) === null || d === void 0 ? void 0 : d._def) === null || h === void 0 ? void 0 : h.openapi;
54
54
  }), a._def.openapi = void 0, a;
55
55
  };
56
56
  const t = r.ZodObject.prototype.pick;
57
- r.ZodObject.prototype.pick = function(...s) {
58
- const a = t.apply(this, s);
57
+ r.ZodObject.prototype.pick = function(...n) {
58
+ const a = t.apply(this, n);
59
59
  return a._def.openapi = void 0, a;
60
60
  };
61
- const n = r.ZodObject.prototype.omit;
62
- r.ZodObject.prototype.omit = function(...s) {
63
- const a = n.apply(this, s);
61
+ const s = r.ZodObject.prototype.omit;
62
+ r.ZodObject.prototype.omit = function(...n) {
63
+ const a = s.apply(this, n);
64
64
  return a._def.openapi = void 0, a;
65
65
  };
66
66
  }
67
67
  var H = class extends Error {
68
68
  constructor(e = 500, t) {
69
69
  super(t == null ? void 0 : t.message, { cause: t == null ? void 0 : t.cause });
70
- Ve(this, "res");
71
- Ve(this, "status");
70
+ ke(this, "res");
71
+ ke(this, "status");
72
72
  this.res = t == null ? void 0 : t.res, this.status = e;
73
73
  }
74
74
  getResponse() {
@@ -83,39 +83,39 @@ var H = class extends Error {
83
83
  new Set(".\\+*[^]$()");
84
84
  var x;
85
85
  (function(r) {
86
- r.assertEqual = (s) => s;
87
- function e(s) {
86
+ r.assertEqual = (n) => n;
87
+ function e(n) {
88
88
  }
89
89
  r.assertIs = e;
90
- function t(s) {
90
+ function t(n) {
91
91
  throw new Error();
92
92
  }
93
- r.assertNever = t, r.arrayToEnum = (s) => {
93
+ r.assertNever = t, r.arrayToEnum = (n) => {
94
94
  const a = {};
95
- for (const i of s)
95
+ for (const i of n)
96
96
  a[i] = i;
97
97
  return a;
98
- }, r.getValidEnumValues = (s) => {
99
- const a = r.objectKeys(s).filter((o) => typeof s[s[o]] != "number"), i = {};
98
+ }, r.getValidEnumValues = (n) => {
99
+ const a = r.objectKeys(n).filter((o) => typeof n[n[o]] != "number"), i = {};
100
100
  for (const o of a)
101
- i[o] = s[o];
101
+ i[o] = n[o];
102
102
  return r.objectValues(i);
103
- }, r.objectValues = (s) => r.objectKeys(s).map(function(a) {
104
- return s[a];
105
- }), r.objectKeys = typeof Object.keys == "function" ? (s) => Object.keys(s) : (s) => {
103
+ }, r.objectValues = (n) => r.objectKeys(n).map(function(a) {
104
+ return n[a];
105
+ }), r.objectKeys = typeof Object.keys == "function" ? (n) => Object.keys(n) : (n) => {
106
106
  const a = [];
107
- for (const i in s)
108
- Object.prototype.hasOwnProperty.call(s, i) && a.push(i);
107
+ for (const i in n)
108
+ Object.prototype.hasOwnProperty.call(n, i) && a.push(i);
109
109
  return a;
110
- }, r.find = (s, a) => {
111
- for (const i of s)
110
+ }, r.find = (n, a) => {
111
+ for (const i of n)
112
112
  if (a(i))
113
113
  return i;
114
- }, r.isInteger = typeof Number.isInteger == "function" ? (s) => Number.isInteger(s) : (s) => typeof s == "number" && isFinite(s) && Math.floor(s) === s;
115
- function n(s, a = " | ") {
116
- return s.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
114
+ }, r.isInteger = typeof Number.isInteger == "function" ? (n) => Number.isInteger(n) : (n) => typeof n == "number" && isFinite(n) && Math.floor(n) === n;
115
+ function s(n, a = " | ") {
116
+ return n.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
117
117
  }
118
- r.joinValues = n, r.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
118
+ r.joinValues = s, r.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
119
119
  })(x || (x = {}));
120
120
  var Be;
121
121
  (function(r) {
@@ -185,15 +185,15 @@ const f = x.arrayToEnum([
185
185
  "not_multiple_of",
186
186
  "not_finite"
187
187
  ]), mt = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
188
- class S extends Error {
188
+ class C extends Error {
189
189
  get errors() {
190
190
  return this.issues;
191
191
  }
192
192
  constructor(e) {
193
- super(), this.issues = [], this.addIssue = (n) => {
194
- this.issues = [...this.issues, n];
195
- }, this.addIssues = (n = []) => {
196
- this.issues = [...this.issues, ...n];
193
+ super(), this.issues = [], this.addIssue = (s) => {
194
+ this.issues = [...this.issues, s];
195
+ }, this.addIssues = (s = []) => {
196
+ this.issues = [...this.issues, ...s];
197
197
  };
198
198
  const t = new.target.prototype;
199
199
  Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
@@ -201,28 +201,28 @@ class S extends Error {
201
201
  format(e) {
202
202
  const t = e || function(a) {
203
203
  return a.message;
204
- }, n = { _errors: [] }, s = (a) => {
204
+ }, s = { _errors: [] }, n = (a) => {
205
205
  for (const i of a.issues)
206
206
  if (i.code === "invalid_union")
207
- i.unionErrors.map(s);
207
+ i.unionErrors.map(n);
208
208
  else if (i.code === "invalid_return_type")
209
- s(i.returnTypeError);
209
+ n(i.returnTypeError);
210
210
  else if (i.code === "invalid_arguments")
211
- s(i.argumentsError);
211
+ n(i.argumentsError);
212
212
  else if (i.path.length === 0)
213
- n._errors.push(t(i));
213
+ s._errors.push(t(i));
214
214
  else {
215
- let o = n, d = 0;
216
- for (; d < i.path.length; ) {
217
- const c = i.path[d];
218
- d === i.path.length - 1 ? (o[c] = o[c] || { _errors: [] }, o[c]._errors.push(t(i))) : o[c] = o[c] || { _errors: [] }, o = o[c], d++;
215
+ let o = s, c = 0;
216
+ for (; c < i.path.length; ) {
217
+ const d = i.path[c];
218
+ c === i.path.length - 1 ? (o[d] = o[d] || { _errors: [] }, o[d]._errors.push(t(i))) : o[d] = o[d] || { _errors: [] }, o = o[d], c++;
219
219
  }
220
220
  }
221
221
  };
222
- return s(this), n;
222
+ return n(this), s;
223
223
  }
224
224
  static assert(e) {
225
- if (!(e instanceof S))
225
+ if (!(e instanceof C))
226
226
  throw new Error(`Not a ZodError: ${e}`);
227
227
  }
228
228
  toString() {
@@ -235,16 +235,16 @@ class S extends Error {
235
235
  return this.issues.length === 0;
236
236
  }
237
237
  flatten(e = (t) => t.message) {
238
- const t = {}, n = [];
239
- for (const s of this.issues)
240
- s.path.length > 0 ? (t[s.path[0]] = t[s.path[0]] || [], t[s.path[0]].push(e(s))) : n.push(e(s));
241
- return { formErrors: n, fieldErrors: t };
238
+ const t = {}, s = [];
239
+ for (const n of this.issues)
240
+ n.path.length > 0 ? (t[n.path[0]] = t[n.path[0]] || [], t[n.path[0]].push(e(n))) : s.push(e(n));
241
+ return { formErrors: s, fieldErrors: t };
242
242
  }
243
243
  get formErrors() {
244
244
  return this.flatten();
245
245
  }
246
246
  }
247
- S.create = (r) => new S(r);
247
+ C.create = (r) => new C(r);
248
248
  const Q = (r, e) => {
249
249
  let t;
250
250
  switch (r.code) {
@@ -301,36 +301,36 @@ const Q = (r, e) => {
301
301
  }
302
302
  return { message: t };
303
303
  };
304
- let Xe = Q;
304
+ let Ke = Q;
305
305
  function _t(r) {
306
- Xe = r;
306
+ Ke = r;
307
307
  }
308
- function ke() {
309
- return Xe;
308
+ function we() {
309
+ return Ke;
310
310
  }
311
- const we = (r) => {
312
- const { data: e, path: t, errorMaps: n, issueData: s } = r, a = [...t, ...s.path || []], i = {
313
- ...s,
311
+ const Te = (r) => {
312
+ const { data: e, path: t, errorMaps: s, issueData: n } = r, a = [...t, ...n.path || []], i = {
313
+ ...n,
314
314
  path: a
315
315
  };
316
- if (s.message !== void 0)
316
+ if (n.message !== void 0)
317
317
  return {
318
- ...s,
318
+ ...n,
319
319
  path: a,
320
- message: s.message
320
+ message: n.message
321
321
  };
322
322
  let o = "";
323
- const d = n.filter((c) => !!c).slice().reverse();
324
- for (const c of d)
325
- o = c(i, { data: e, defaultError: o }).message;
323
+ const c = s.filter((d) => !!d).slice().reverse();
324
+ for (const d of c)
325
+ o = d(i, { data: e, defaultError: o }).message;
326
326
  return {
327
- ...s,
327
+ ...n,
328
328
  path: a,
329
329
  message: o
330
330
  };
331
331
  }, yt = [];
332
332
  function l(r, e) {
333
- const t = ke(), n = we({
333
+ const t = we(), s = Te({
334
334
  issueData: e,
335
335
  data: r.data,
336
336
  path: r.path,
@@ -343,9 +343,9 @@ function l(r, e) {
343
343
  // then global override map
344
344
  t === Q ? void 0 : Q
345
345
  // then global default map
346
- ].filter((s) => !!s)
346
+ ].filter((n) => !!n)
347
347
  });
348
- r.common.issues.push(n);
348
+ r.common.issues.push(s);
349
349
  }
350
350
  class T {
351
351
  constructor() {
@@ -358,45 +358,45 @@ class T {
358
358
  this.value !== "aborted" && (this.value = "aborted");
359
359
  }
360
360
  static mergeArray(e, t) {
361
- const n = [];
362
- for (const s of t) {
363
- if (s.status === "aborted")
361
+ const s = [];
362
+ for (const n of t) {
363
+ if (n.status === "aborted")
364
364
  return y;
365
- s.status === "dirty" && e.dirty(), n.push(s.value);
365
+ n.status === "dirty" && e.dirty(), s.push(n.value);
366
366
  }
367
- return { status: e.value, value: n };
367
+ return { status: e.value, value: s };
368
368
  }
369
369
  static async mergeObjectAsync(e, t) {
370
- const n = [];
371
- for (const s of t) {
372
- const a = await s.key, i = await s.value;
373
- n.push({
370
+ const s = [];
371
+ for (const n of t) {
372
+ const a = await n.key, i = await n.value;
373
+ s.push({
374
374
  key: a,
375
375
  value: i
376
376
  });
377
377
  }
378
- return T.mergeObjectSync(e, n);
378
+ return T.mergeObjectSync(e, s);
379
379
  }
380
380
  static mergeObjectSync(e, t) {
381
- const n = {};
382
- for (const s of t) {
383
- const { key: a, value: i } = s;
381
+ const s = {};
382
+ for (const n of t) {
383
+ const { key: a, value: i } = n;
384
384
  if (a.status === "aborted" || i.status === "aborted")
385
385
  return y;
386
- a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || s.alwaysSet) && (n[a.value] = i.value);
386
+ a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || n.alwaysSet) && (s[a.value] = i.value);
387
387
  }
388
- return { status: e.value, value: n };
388
+ return { status: e.value, value: s };
389
389
  }
390
390
  }
391
391
  const y = Object.freeze({
392
392
  status: "aborted"
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;
394
- function Te(r, e, t, n) {
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
+ }), K = (r) => ({ status: "dirty", value: r }), S = (r) => ({ status: "valid", value: r }), Fe = (r) => r.status === "aborted", qe = (r) => r.status === "dirty", q = (r) => r.status === "valid", oe = (r) => typeof Promise < "u" && r instanceof Promise;
394
+ function Se(r, e, t, s) {
395
+ if (typeof e == "function" ? r !== e || !s : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
396
396
  return e.get(r);
397
397
  }
398
- function Ke(r, e, t, n, s) {
399
- if (typeof e == "function" ? r !== e || !s : !e.has(r)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
398
+ function Xe(r, e, t, s, n) {
399
+ if (typeof e == "function" ? r !== e || !n : !e.has(r)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
400
400
  return e.set(r, t), t;
401
401
  }
402
402
  var m;
@@ -405,15 +405,15 @@ var m;
405
405
  })(m || (m = {}));
406
406
  var ae, ie;
407
407
  class R {
408
- constructor(e, t, n, s) {
409
- this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = s;
408
+ constructor(e, t, s, n) {
409
+ this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
410
410
  }
411
411
  get path() {
412
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;
413
413
  }
414
414
  }
415
415
  const He = (r, e) => {
416
- if (W(e))
416
+ if (q(e))
417
417
  return { success: !0, data: e.value };
418
418
  if (!r.common.issues.length)
419
419
  throw new Error("Validation failed but no issues detected.");
@@ -422,7 +422,7 @@ const He = (r, e) => {
422
422
  get error() {
423
423
  if (this._error)
424
424
  return this._error;
425
- const t = new S(r.common.issues);
425
+ const t = new C(r.common.issues);
426
426
  return this._error = t, this._error;
427
427
  }
428
428
  };
@@ -430,14 +430,14 @@ const He = (r, e) => {
430
430
  function v(r) {
431
431
  if (!r)
432
432
  return {};
433
- const { errorMap: e, invalid_type_error: t, required_error: n, description: s } = r;
434
- if (e && (t || n))
433
+ const { errorMap: e, invalid_type_error: t, required_error: s, description: n } = r;
434
+ if (e && (t || s))
435
435
  throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
436
- return e ? { errorMap: e, description: s } : { errorMap: (i, o) => {
437
- var d, c;
438
- const { message: p } = r;
439
- return i.code === "invalid_enum_value" ? { message: p ?? o.defaultError } : typeof o.data > "u" ? { message: (d = p ?? n) !== null && d !== void 0 ? d : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (c = p ?? t) !== null && c !== void 0 ? c : o.defaultError };
440
- }, description: s };
436
+ return e ? { errorMap: e, description: n } : { errorMap: (i, o) => {
437
+ var c, d;
438
+ const { message: h } = r;
439
+ return i.code === "invalid_enum_value" ? { message: h ?? o.defaultError } : typeof o.data > "u" ? { message: (c = h ?? s) !== null && c !== void 0 ? c : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (d = h ?? t) !== null && d !== void 0 ? d : o.defaultError };
440
+ }, description: n };
441
441
  }
442
442
  class g {
443
443
  get description() {
@@ -480,17 +480,17 @@ class g {
480
480
  return Promise.resolve(t);
481
481
  }
482
482
  parse(e, t) {
483
- const n = this.safeParse(e, t);
484
- if (n.success)
485
- return n.data;
486
- throw n.error;
483
+ const s = this.safeParse(e, t);
484
+ if (s.success)
485
+ return s.data;
486
+ throw s.error;
487
487
  }
488
488
  safeParse(e, t) {
489
- var n;
490
- const s = {
489
+ var s;
490
+ const n = {
491
491
  common: {
492
492
  issues: [],
493
- async: (n = t == null ? void 0 : t.async) !== null && n !== void 0 ? n : !1,
493
+ async: (s = t == null ? void 0 : t.async) !== null && s !== void 0 ? s : !1,
494
494
  contextualErrorMap: t == null ? void 0 : t.errorMap
495
495
  },
496
496
  path: (t == null ? void 0 : t.path) || [],
@@ -498,12 +498,12 @@ class g {
498
498
  parent: null,
499
499
  data: e,
500
500
  parsedType: $(e)
501
- }, a = this._parseSync({ data: e, path: s.path, parent: s });
502
- return He(s, a);
501
+ }, a = this._parseSync({ data: e, path: n.path, parent: n });
502
+ return He(n, a);
503
503
  }
504
504
  "~validate"(e) {
505
- var t, n;
506
- const s = {
505
+ var t, s;
506
+ const n = {
507
507
  common: {
508
508
  issues: [],
509
509
  async: !!this["~standard"].async
@@ -516,32 +516,32 @@ class g {
516
516
  };
517
517
  if (!this["~standard"].async)
518
518
  try {
519
- const a = this._parseSync({ data: e, path: [], parent: s });
520
- return W(a) ? {
519
+ const a = this._parseSync({ data: e, path: [], parent: n });
520
+ return q(a) ? {
521
521
  value: a.value
522
522
  } : {
523
- issues: s.common.issues
523
+ issues: n.common.issues
524
524
  };
525
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 = {
526
+ !((s = (t = a == null ? void 0 : a.message) === null || t === void 0 ? void 0 : t.toLowerCase()) === null || s === void 0) && s.includes("encountered") && (this["~standard"].async = !0), n.common = {
527
527
  issues: [],
528
528
  async: !0
529
529
  };
530
530
  }
531
- return this._parseAsync({ data: e, path: [], parent: s }).then((a) => W(a) ? {
531
+ return this._parseAsync({ data: e, path: [], parent: n }).then((a) => q(a) ? {
532
532
  value: a.value
533
533
  } : {
534
- issues: s.common.issues
534
+ issues: n.common.issues
535
535
  });
536
536
  }
537
537
  async parseAsync(e, t) {
538
- const n = await this.safeParseAsync(e, t);
539
- if (n.success)
540
- return n.data;
541
- throw n.error;
538
+ const s = await this.safeParseAsync(e, t);
539
+ if (s.success)
540
+ return s.data;
541
+ throw s.error;
542
542
  }
543
543
  async safeParseAsync(e, t) {
544
- const n = {
544
+ const s = {
545
545
  common: {
546
546
  issues: [],
547
547
  contextualErrorMap: t == null ? void 0 : t.errorMap,
@@ -552,21 +552,21 @@ class g {
552
552
  parent: null,
553
553
  data: e,
554
554
  parsedType: $(e)
555
- }, s = this._parse({ data: e, path: n.path, parent: n }), a = await (oe(s) ? s : Promise.resolve(s));
556
- return He(n, a);
555
+ }, n = this._parse({ data: e, path: s.path, parent: s }), a = await (oe(n) ? n : Promise.resolve(n));
556
+ return He(s, a);
557
557
  }
558
558
  refine(e, t) {
559
- const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
560
- return this._refinement((s, a) => {
561
- const i = e(s), o = () => a.addIssue({
559
+ const s = (n) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(n) : t;
560
+ return this._refinement((n, a) => {
561
+ const i = e(n), o = () => a.addIssue({
562
562
  code: u.custom,
563
- ...n(s)
563
+ ...s(n)
564
564
  });
565
- return typeof Promise < "u" && i instanceof Promise ? i.then((d) => d ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
565
+ return typeof Promise < "u" && i instanceof Promise ? i.then((c) => c ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
566
566
  });
567
567
  }
568
568
  refinement(e, t) {
569
- return this._refinement((n, s) => e(n) ? !0 : (s.addIssue(typeof t == "function" ? t(n, s) : t), !1));
569
+ return this._refinement((s, n) => e(s) ? !0 : (n.addIssue(typeof t == "function" ? t(s, n) : t), !1));
570
570
  }
571
571
  _refinement(e) {
572
572
  return new A({
@@ -595,7 +595,7 @@ class g {
595
595
  return this.nullable().optional();
596
596
  }
597
597
  array() {
598
- return C.create(this);
598
+ return j.create(this);
599
599
  }
600
600
  promise() {
601
601
  return te.create(this, this._def);
@@ -659,9 +659,9 @@ class g {
659
659
  return this.safeParse(null).success;
660
660
  }
661
661
  }
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})+$";
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)?)??$/, St = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Zt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
663
663
  let Le;
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}$`);
664
+ const Ct = /^(?:(?: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])$/, jt = /^(([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
665
  function et(r) {
666
666
  let e = "[0-5]\\d";
667
667
  r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`);
@@ -677,22 +677,22 @@ function tt(r) {
677
677
  return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
678
678
  }
679
679
  function $t(r, e) {
680
- return !!((e === "v4" || !e) && St.test(r) || (e === "v6" || !e) && Ct.test(r));
680
+ return !!((e === "v4" || !e) && Ct.test(r) || (e === "v6" || !e) && jt.test(r));
681
681
  }
682
- function Mt(r, e) {
682
+ function Pt(r, e) {
683
683
  if (!wt.test(r))
684
684
  return !1;
685
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);
686
+ const [t] = r.split("."), s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), n = JSON.parse(atob(s));
687
+ return !(typeof n != "object" || n === null || !n.typ || !n.alg || e && n.alg !== e);
688
688
  } catch {
689
689
  return !1;
690
690
  }
691
691
  }
692
- function Pt(r, e) {
693
- return !!((e === "v4" || !e) && jt.test(r) || (e === "v6" || !e) && At.test(r));
692
+ function Mt(r, e) {
693
+ return !!((e === "v4" || !e) && Ot.test(r) || (e === "v6" || !e) && At.test(r));
694
694
  }
695
- class j extends g {
695
+ class O extends g {
696
696
  _parse(e) {
697
697
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
698
698
  const a = this._getOrReturnCtx(e);
@@ -702,160 +702,160 @@ class j extends g {
702
702
  received: a.parsedType
703
703
  }), y;
704
704
  }
705
- const n = new T();
706
- let s;
705
+ const s = new T();
706
+ let n;
707
707
  for (const a of this._def.checks)
708
708
  if (a.kind === "min")
709
- e.data.length < a.value && (s = this._getOrReturnCtx(e, s), l(s, {
709
+ e.data.length < a.value && (n = this._getOrReturnCtx(e, n), l(n, {
710
710
  code: u.too_small,
711
711
  minimum: a.value,
712
712
  type: "string",
713
713
  inclusive: !0,
714
714
  exact: !1,
715
715
  message: a.message
716
- }), n.dirty());
716
+ }), s.dirty());
717
717
  else if (a.kind === "max")
718
- e.data.length > a.value && (s = this._getOrReturnCtx(e, s), l(s, {
718
+ e.data.length > a.value && (n = this._getOrReturnCtx(e, n), l(n, {
719
719
  code: u.too_big,
720
720
  maximum: a.value,
721
721
  type: "string",
722
722
  inclusive: !0,
723
723
  exact: !1,
724
724
  message: a.message
725
- }), n.dirty());
725
+ }), s.dirty());
726
726
  else if (a.kind === "length") {
727
727
  const i = e.data.length > a.value, o = e.data.length < a.value;
728
- (i || o) && (s = this._getOrReturnCtx(e, s), i ? l(s, {
728
+ (i || o) && (n = this._getOrReturnCtx(e, n), i ? l(n, {
729
729
  code: u.too_big,
730
730
  maximum: a.value,
731
731
  type: "string",
732
732
  inclusive: !0,
733
733
  exact: !0,
734
734
  message: a.message
735
- }) : o && l(s, {
735
+ }) : o && l(n, {
736
736
  code: u.too_small,
737
737
  minimum: a.value,
738
738
  type: "string",
739
739
  inclusive: !0,
740
740
  exact: !0,
741
741
  message: a.message
742
- }), n.dirty());
742
+ }), s.dirty());
743
743
  } else if (a.kind === "email")
744
- Zt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
744
+ St.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
745
745
  validation: "email",
746
746
  code: u.invalid_string,
747
747
  message: a.message
748
- }), n.dirty());
748
+ }), s.dirty());
749
749
  else if (a.kind === "emoji")
750
- Le || (Le = new RegExp(Ot, "u")), Le.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
750
+ Le || (Le = new RegExp(Zt, "u")), Le.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
751
751
  validation: "emoji",
752
752
  code: u.invalid_string,
753
753
  message: a.message
754
- }), n.dirty());
754
+ }), s.dirty());
755
755
  else if (a.kind === "uuid")
756
- bt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
756
+ bt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
757
757
  validation: "uuid",
758
758
  code: u.invalid_string,
759
759
  message: a.message
760
- }), n.dirty());
760
+ }), s.dirty());
761
761
  else if (a.kind === "nanoid")
762
- kt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
762
+ kt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
763
763
  validation: "nanoid",
764
764
  code: u.invalid_string,
765
765
  message: a.message
766
- }), n.dirty());
766
+ }), s.dirty());
767
767
  else if (a.kind === "cuid")
768
- vt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
768
+ vt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
769
769
  validation: "cuid",
770
770
  code: u.invalid_string,
771
771
  message: a.message
772
- }), n.dirty());
772
+ }), s.dirty());
773
773
  else if (a.kind === "cuid2")
774
- gt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
774
+ gt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
775
775
  validation: "cuid2",
776
776
  code: u.invalid_string,
777
777
  message: a.message
778
- }), n.dirty());
778
+ }), s.dirty());
779
779
  else if (a.kind === "ulid")
780
- xt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
780
+ xt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
781
781
  validation: "ulid",
782
782
  code: u.invalid_string,
783
783
  message: a.message
784
- }), n.dirty());
784
+ }), s.dirty());
785
785
  else if (a.kind === "url")
786
786
  try {
787
787
  new URL(e.data);
788
788
  } catch {
789
- s = this._getOrReturnCtx(e, s), l(s, {
789
+ n = this._getOrReturnCtx(e, n), l(n, {
790
790
  validation: "url",
791
791
  code: u.invalid_string,
792
792
  message: a.message
793
- }), n.dirty();
793
+ }), s.dirty();
794
794
  }
795
- else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
795
+ else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
796
796
  validation: "regex",
797
797
  code: u.invalid_string,
798
798
  message: a.message
799
- }), 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, {
799
+ }), s.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (n = this._getOrReturnCtx(e, n), l(n, {
800
800
  code: u.invalid_string,
801
801
  validation: { includes: a.value, position: a.position },
802
802
  message: a.message
803
- }), 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, {
803
+ }), s.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) || (n = this._getOrReturnCtx(e, n), l(n, {
804
804
  code: u.invalid_string,
805
805
  validation: { startsWith: a.value },
806
806
  message: a.message
807
- }), n.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (s = this._getOrReturnCtx(e, s), l(s, {
807
+ }), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (n = this._getOrReturnCtx(e, n), l(n, {
808
808
  code: u.invalid_string,
809
809
  validation: { endsWith: a.value },
810
810
  message: a.message
811
- }), n.dirty()) : a.kind === "datetime" ? tt(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
811
+ }), s.dirty()) : a.kind === "datetime" ? tt(a).test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
812
812
  code: u.invalid_string,
813
813
  validation: "datetime",
814
814
  message: a.message
815
- }), n.dirty()) : a.kind === "date" ? Nt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
815
+ }), s.dirty()) : a.kind === "date" ? Nt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
816
816
  code: u.invalid_string,
817
817
  validation: "date",
818
818
  message: a.message
819
- }), n.dirty()) : a.kind === "time" ? It(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
819
+ }), s.dirty()) : a.kind === "time" ? It(a).test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
820
820
  code: u.invalid_string,
821
821
  validation: "time",
822
822
  message: a.message
823
- }), n.dirty()) : a.kind === "duration" ? Tt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
823
+ }), s.dirty()) : a.kind === "duration" ? Tt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
824
824
  validation: "duration",
825
825
  code: u.invalid_string,
826
826
  message: a.message
827
- }), n.dirty()) : a.kind === "ip" ? $t(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
827
+ }), s.dirty()) : a.kind === "ip" ? $t(e.data, a.version) || (n = this._getOrReturnCtx(e, n), l(n, {
828
828
  validation: "ip",
829
829
  code: u.invalid_string,
830
830
  message: a.message
831
- }), n.dirty()) : a.kind === "jwt" ? Mt(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), l(s, {
831
+ }), s.dirty()) : a.kind === "jwt" ? Pt(e.data, a.alg) || (n = this._getOrReturnCtx(e, n), l(n, {
832
832
  validation: "jwt",
833
833
  code: u.invalid_string,
834
834
  message: a.message
835
- }), n.dirty()) : a.kind === "cidr" ? Pt(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
835
+ }), s.dirty()) : a.kind === "cidr" ? Mt(e.data, a.version) || (n = this._getOrReturnCtx(e, n), l(n, {
836
836
  validation: "cidr",
837
837
  code: u.invalid_string,
838
838
  message: a.message
839
- }), n.dirty()) : a.kind === "base64" ? Et.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
839
+ }), s.dirty()) : a.kind === "base64" ? Et.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
840
840
  validation: "base64",
841
841
  code: u.invalid_string,
842
842
  message: a.message
843
- }), n.dirty()) : a.kind === "base64url" ? Rt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
843
+ }), s.dirty()) : a.kind === "base64url" ? Rt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
844
844
  validation: "base64url",
845
845
  code: u.invalid_string,
846
846
  message: a.message
847
- }), n.dirty()) : x.assertNever(a);
848
- return { status: n.value, value: e.data };
847
+ }), s.dirty()) : x.assertNever(a);
848
+ return { status: s.value, value: e.data };
849
849
  }
850
- _regex(e, t, n) {
851
- return this.refinement((s) => e.test(s), {
850
+ _regex(e, t, s) {
851
+ return this.refinement((n) => e.test(n), {
852
852
  validation: t,
853
853
  code: u.invalid_string,
854
- ...m.errToObj(n)
854
+ ...m.errToObj(s)
855
855
  });
856
856
  }
857
857
  _addCheck(e) {
858
- return new j({
858
+ return new O({
859
859
  ...this._def,
860
860
  checks: [...this._def.checks, e]
861
861
  });
@@ -903,7 +903,7 @@ class j extends g {
903
903
  return this._addCheck({ kind: "cidr", ...m.errToObj(e) });
904
904
  }
905
905
  datetime(e) {
906
- var t, n;
906
+ var t, s;
907
907
  return typeof e == "string" ? this._addCheck({
908
908
  kind: "datetime",
909
909
  precision: null,
@@ -914,7 +914,7 @@ class j extends g {
914
914
  kind: "datetime",
915
915
  precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
916
916
  offset: (t = e == null ? void 0 : e.offset) !== null && t !== void 0 ? t : !1,
917
- local: (n = e == null ? void 0 : e.local) !== null && n !== void 0 ? n : !1,
917
+ local: (s = e == null ? void 0 : e.local) !== null && s !== void 0 ? s : !1,
918
918
  ...m.errToObj(e == null ? void 0 : e.message)
919
919
  });
920
920
  }
@@ -992,19 +992,19 @@ class j extends g {
992
992
  return this.min(1, m.errToObj(e));
993
993
  }
994
994
  trim() {
995
- return new j({
995
+ return new O({
996
996
  ...this._def,
997
997
  checks: [...this._def.checks, { kind: "trim" }]
998
998
  });
999
999
  }
1000
1000
  toLowerCase() {
1001
- return new j({
1001
+ return new O({
1002
1002
  ...this._def,
1003
1003
  checks: [...this._def.checks, { kind: "toLowerCase" }]
1004
1004
  });
1005
1005
  }
1006
1006
  toUpperCase() {
1007
- return new j({
1007
+ return new O({
1008
1008
  ...this._def,
1009
1009
  checks: [...this._def.checks, { kind: "toUpperCase" }]
1010
1010
  });
@@ -1070,9 +1070,9 @@ class j extends g {
1070
1070
  return e;
1071
1071
  }
1072
1072
  }
1073
- j.create = (r) => {
1073
+ O.create = (r) => {
1074
1074
  var e;
1075
- return new j({
1075
+ return new O({
1076
1076
  checks: [],
1077
1077
  typeName: _.ZodString,
1078
1078
  coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
@@ -1080,8 +1080,8 @@ j.create = (r) => {
1080
1080
  });
1081
1081
  };
1082
1082
  function Dt(r, e) {
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(".", ""));
1084
- return a % i / Math.pow(10, s);
1083
+ const t = (r.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, a = parseInt(r.toFixed(n).replace(".", "")), i = parseInt(e.toFixed(n).replace(".", ""));
1084
+ return a % i / Math.pow(10, n);
1085
1085
  }
1086
1086
  class V extends g {
1087
1087
  constructor() {
@@ -1096,37 +1096,37 @@ class V extends g {
1096
1096
  received: a.parsedType
1097
1097
  }), y;
1098
1098
  }
1099
- let n;
1100
- const s = new T();
1099
+ let s;
1100
+ const n = new T();
1101
1101
  for (const a of this._def.checks)
1102
- a.kind === "int" ? x.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
1102
+ a.kind === "int" ? x.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
1103
1103
  code: u.invalid_type,
1104
1104
  expected: "integer",
1105
1105
  received: "float",
1106
1106
  message: a.message
1107
- }), s.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1107
+ }), n.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1108
1108
  code: u.too_small,
1109
1109
  minimum: a.value,
1110
1110
  type: "number",
1111
1111
  inclusive: a.inclusive,
1112
1112
  exact: !1,
1113
1113
  message: a.message
1114
- }), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1114
+ }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1115
1115
  code: u.too_big,
1116
1116
  maximum: a.value,
1117
1117
  type: "number",
1118
1118
  inclusive: a.inclusive,
1119
1119
  exact: !1,
1120
1120
  message: a.message
1121
- }), s.dirty()) : a.kind === "multipleOf" ? Dt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
1121
+ }), n.dirty()) : a.kind === "multipleOf" ? Dt(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), l(s, {
1122
1122
  code: u.not_multiple_of,
1123
1123
  multipleOf: a.value,
1124
1124
  message: a.message
1125
- }), s.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
1125
+ }), n.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
1126
1126
  code: u.not_finite,
1127
1127
  message: a.message
1128
- }), s.dirty()) : x.assertNever(a);
1129
- return { status: s.value, value: e.data };
1128
+ }), n.dirty()) : x.assertNever(a);
1129
+ return { status: n.value, value: e.data };
1130
1130
  }
1131
1131
  gte(e, t) {
1132
1132
  return this.setLimit("min", e, !0, m.toString(t));
@@ -1140,7 +1140,7 @@ class V extends g {
1140
1140
  lt(e, t) {
1141
1141
  return this.setLimit("max", e, !1, m.toString(t));
1142
1142
  }
1143
- setLimit(e, t, n, s) {
1143
+ setLimit(e, t, s, n) {
1144
1144
  return new V({
1145
1145
  ...this._def,
1146
1146
  checks: [
@@ -1148,8 +1148,8 @@ class V extends g {
1148
1148
  {
1149
1149
  kind: e,
1150
1150
  value: t,
1151
- inclusive: n,
1152
- message: m.toString(s)
1151
+ inclusive: s,
1152
+ message: m.toString(n)
1153
1153
  }
1154
1154
  ]
1155
1155
  });
@@ -1241,10 +1241,10 @@ class V extends g {
1241
1241
  }
1242
1242
  get isFinite() {
1243
1243
  let e = null, t = null;
1244
- for (const n of this._def.checks) {
1245
- if (n.kind === "finite" || n.kind === "int" || n.kind === "multipleOf")
1244
+ for (const s of this._def.checks) {
1245
+ if (s.kind === "finite" || s.kind === "int" || s.kind === "multipleOf")
1246
1246
  return !0;
1247
- n.kind === "min" ? (t === null || n.value > t) && (t = n.value) : n.kind === "max" && (e === null || n.value < e) && (e = n.value);
1247
+ s.kind === "min" ? (t === null || s.value > t) && (t = s.value) : s.kind === "max" && (e === null || s.value < e) && (e = s.value);
1248
1248
  }
1249
1249
  return Number.isFinite(t) && Number.isFinite(e);
1250
1250
  }
@@ -1268,27 +1268,27 @@ class L extends g {
1268
1268
  }
1269
1269
  if (this._getType(e) !== f.bigint)
1270
1270
  return this._getInvalidInput(e);
1271
- let n;
1272
- const s = new T();
1271
+ let s;
1272
+ const n = new T();
1273
1273
  for (const a of this._def.checks)
1274
- a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1274
+ a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1275
1275
  code: u.too_small,
1276
1276
  type: "bigint",
1277
1277
  minimum: a.value,
1278
1278
  inclusive: a.inclusive,
1279
1279
  message: a.message
1280
- }), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1280
+ }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1281
1281
  code: u.too_big,
1282
1282
  type: "bigint",
1283
1283
  maximum: a.value,
1284
1284
  inclusive: a.inclusive,
1285
1285
  message: a.message
1286
- }), s.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), l(n, {
1286
+ }), n.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), l(s, {
1287
1287
  code: u.not_multiple_of,
1288
1288
  multipleOf: a.value,
1289
1289
  message: a.message
1290
- }), s.dirty()) : x.assertNever(a);
1291
- return { status: s.value, value: e.data };
1290
+ }), n.dirty()) : x.assertNever(a);
1291
+ return { status: n.value, value: e.data };
1292
1292
  }
1293
1293
  _getInvalidInput(e) {
1294
1294
  const t = this._getOrReturnCtx(e);
@@ -1310,7 +1310,7 @@ class L extends g {
1310
1310
  lt(e, t) {
1311
1311
  return this.setLimit("max", e, !1, m.toString(t));
1312
1312
  }
1313
- setLimit(e, t, n, s) {
1313
+ setLimit(e, t, s, n) {
1314
1314
  return new L({
1315
1315
  ...this._def,
1316
1316
  checks: [
@@ -1318,8 +1318,8 @@ class L extends g {
1318
1318
  {
1319
1319
  kind: e,
1320
1320
  value: t,
1321
- inclusive: n,
1322
- message: m.toString(s)
1321
+ inclusive: s,
1322
+ message: m.toString(n)
1323
1323
  }
1324
1324
  ]
1325
1325
  });
@@ -1391,25 +1391,25 @@ L.create = (r) => {
1391
1391
  ...v(r)
1392
1392
  });
1393
1393
  };
1394
- class de extends g {
1394
+ class ce extends g {
1395
1395
  _parse(e) {
1396
1396
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
1397
- const n = this._getOrReturnCtx(e);
1398
- return l(n, {
1397
+ const s = this._getOrReturnCtx(e);
1398
+ return l(s, {
1399
1399
  code: u.invalid_type,
1400
1400
  expected: f.boolean,
1401
- received: n.parsedType
1401
+ received: s.parsedType
1402
1402
  }), y;
1403
1403
  }
1404
- return Z(e.data);
1404
+ return S(e.data);
1405
1405
  }
1406
1406
  }
1407
- de.create = (r) => new de({
1407
+ ce.create = (r) => new ce({
1408
1408
  typeName: _.ZodBoolean,
1409
1409
  coerce: (r == null ? void 0 : r.coerce) || !1,
1410
1410
  ...v(r)
1411
1411
  });
1412
- class q extends g {
1412
+ class W extends g {
1413
1413
  _parse(e) {
1414
1414
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
1415
1415
  const a = this._getOrReturnCtx(e);
@@ -1425,31 +1425,31 @@ class q extends g {
1425
1425
  code: u.invalid_date
1426
1426
  }), y;
1427
1427
  }
1428
- const n = new T();
1429
- let s;
1428
+ const s = new T();
1429
+ let n;
1430
1430
  for (const a of this._def.checks)
1431
- a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), l(s, {
1431
+ a.kind === "min" ? e.data.getTime() < a.value && (n = this._getOrReturnCtx(e, n), l(n, {
1432
1432
  code: u.too_small,
1433
1433
  message: a.message,
1434
1434
  inclusive: !0,
1435
1435
  exact: !1,
1436
1436
  minimum: a.value,
1437
1437
  type: "date"
1438
- }), n.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (s = this._getOrReturnCtx(e, s), l(s, {
1438
+ }), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (n = this._getOrReturnCtx(e, n), l(n, {
1439
1439
  code: u.too_big,
1440
1440
  message: a.message,
1441
1441
  inclusive: !0,
1442
1442
  exact: !1,
1443
1443
  maximum: a.value,
1444
1444
  type: "date"
1445
- }), n.dirty()) : x.assertNever(a);
1445
+ }), s.dirty()) : x.assertNever(a);
1446
1446
  return {
1447
- status: n.value,
1447
+ status: s.value,
1448
1448
  value: new Date(e.data.getTime())
1449
1449
  };
1450
1450
  }
1451
1451
  _addCheck(e) {
1452
- return new q({
1452
+ return new W({
1453
1453
  ...this._def,
1454
1454
  checks: [...this._def.checks, e]
1455
1455
  });
@@ -1481,7 +1481,7 @@ class q extends g {
1481
1481
  return e != null ? new Date(e) : null;
1482
1482
  }
1483
1483
  }
1484
- q.create = (r) => new q({
1484
+ W.create = (r) => new W({
1485
1485
  checks: [],
1486
1486
  coerce: (r == null ? void 0 : r.coerce) || !1,
1487
1487
  typeName: _.ZodDate,
@@ -1490,48 +1490,48 @@ q.create = (r) => new q({
1490
1490
  class Ze extends g {
1491
1491
  _parse(e) {
1492
1492
  if (this._getType(e) !== f.symbol) {
1493
- const n = this._getOrReturnCtx(e);
1494
- return l(n, {
1493
+ const s = this._getOrReturnCtx(e);
1494
+ return l(s, {
1495
1495
  code: u.invalid_type,
1496
1496
  expected: f.symbol,
1497
- received: n.parsedType
1497
+ received: s.parsedType
1498
1498
  }), y;
1499
1499
  }
1500
- return Z(e.data);
1500
+ return S(e.data);
1501
1501
  }
1502
1502
  }
1503
1503
  Ze.create = (r) => new Ze({
1504
1504
  typeName: _.ZodSymbol,
1505
1505
  ...v(r)
1506
1506
  });
1507
- class ce extends g {
1507
+ class de extends g {
1508
1508
  _parse(e) {
1509
1509
  if (this._getType(e) !== f.undefined) {
1510
- const n = this._getOrReturnCtx(e);
1511
- return l(n, {
1510
+ const s = this._getOrReturnCtx(e);
1511
+ return l(s, {
1512
1512
  code: u.invalid_type,
1513
1513
  expected: f.undefined,
1514
- received: n.parsedType
1514
+ received: s.parsedType
1515
1515
  }), y;
1516
1516
  }
1517
- return Z(e.data);
1517
+ return S(e.data);
1518
1518
  }
1519
1519
  }
1520
- ce.create = (r) => new ce({
1520
+ de.create = (r) => new de({
1521
1521
  typeName: _.ZodUndefined,
1522
1522
  ...v(r)
1523
1523
  });
1524
1524
  class ue extends g {
1525
1525
  _parse(e) {
1526
1526
  if (this._getType(e) !== f.null) {
1527
- const n = this._getOrReturnCtx(e);
1528
- return l(n, {
1527
+ const s = this._getOrReturnCtx(e);
1528
+ return l(s, {
1529
1529
  code: u.invalid_type,
1530
1530
  expected: f.null,
1531
- received: n.parsedType
1531
+ received: s.parsedType
1532
1532
  }), y;
1533
1533
  }
1534
- return Z(e.data);
1534
+ return S(e.data);
1535
1535
  }
1536
1536
  }
1537
1537
  ue.create = (r) => new ue({
@@ -1543,7 +1543,7 @@ class ee extends g {
1543
1543
  super(...arguments), this._any = !0;
1544
1544
  }
1545
1545
  _parse(e) {
1546
- return Z(e.data);
1546
+ return S(e.data);
1547
1547
  }
1548
1548
  }
1549
1549
  ee.create = (r) => new ee({
@@ -1555,14 +1555,14 @@ class F extends g {
1555
1555
  super(...arguments), this._unknown = !0;
1556
1556
  }
1557
1557
  _parse(e) {
1558
- return Z(e.data);
1558
+ return S(e.data);
1559
1559
  }
1560
1560
  }
1561
1561
  F.create = (r) => new F({
1562
1562
  typeName: _.ZodUnknown,
1563
1563
  ...v(r)
1564
1564
  });
1565
- class M extends g {
1565
+ class P extends g {
1566
1566
  _parse(e) {
1567
1567
  const t = this._getOrReturnCtx(e);
1568
1568
  return l(t, {
@@ -1572,84 +1572,84 @@ class M extends g {
1572
1572
  }), y;
1573
1573
  }
1574
1574
  }
1575
- M.create = (r) => new M({
1575
+ P.create = (r) => new P({
1576
1576
  typeName: _.ZodNever,
1577
1577
  ...v(r)
1578
1578
  });
1579
- class Oe extends g {
1579
+ class Ce extends g {
1580
1580
  _parse(e) {
1581
1581
  if (this._getType(e) !== f.undefined) {
1582
- const n = this._getOrReturnCtx(e);
1583
- return l(n, {
1582
+ const s = this._getOrReturnCtx(e);
1583
+ return l(s, {
1584
1584
  code: u.invalid_type,
1585
1585
  expected: f.void,
1586
- received: n.parsedType
1586
+ received: s.parsedType
1587
1587
  }), y;
1588
1588
  }
1589
- return Z(e.data);
1589
+ return S(e.data);
1590
1590
  }
1591
1591
  }
1592
- Oe.create = (r) => new Oe({
1592
+ Ce.create = (r) => new Ce({
1593
1593
  typeName: _.ZodVoid,
1594
1594
  ...v(r)
1595
1595
  });
1596
- class C extends g {
1596
+ class j extends g {
1597
1597
  _parse(e) {
1598
- const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
1598
+ const { ctx: t, status: s } = this._processInputParams(e), n = this._def;
1599
1599
  if (t.parsedType !== f.array)
1600
1600
  return l(t, {
1601
1601
  code: u.invalid_type,
1602
1602
  expected: f.array,
1603
1603
  received: t.parsedType
1604
1604
  }), y;
1605
- if (s.exactLength !== null) {
1606
- const i = t.data.length > s.exactLength.value, o = t.data.length < s.exactLength.value;
1605
+ if (n.exactLength !== null) {
1606
+ const i = t.data.length > n.exactLength.value, o = t.data.length < n.exactLength.value;
1607
1607
  (i || o) && (l(t, {
1608
1608
  code: i ? u.too_big : u.too_small,
1609
- minimum: o ? s.exactLength.value : void 0,
1610
- maximum: i ? s.exactLength.value : void 0,
1609
+ minimum: o ? n.exactLength.value : void 0,
1610
+ maximum: i ? n.exactLength.value : void 0,
1611
1611
  type: "array",
1612
1612
  inclusive: !0,
1613
1613
  exact: !0,
1614
- message: s.exactLength.message
1615
- }), n.dirty());
1614
+ message: n.exactLength.message
1615
+ }), s.dirty());
1616
1616
  }
1617
- if (s.minLength !== null && t.data.length < s.minLength.value && (l(t, {
1617
+ if (n.minLength !== null && t.data.length < n.minLength.value && (l(t, {
1618
1618
  code: u.too_small,
1619
- minimum: s.minLength.value,
1619
+ minimum: n.minLength.value,
1620
1620
  type: "array",
1621
1621
  inclusive: !0,
1622
1622
  exact: !1,
1623
- message: s.minLength.message
1624
- }), n.dirty()), s.maxLength !== null && t.data.length > s.maxLength.value && (l(t, {
1623
+ message: n.minLength.message
1624
+ }), s.dirty()), n.maxLength !== null && t.data.length > n.maxLength.value && (l(t, {
1625
1625
  code: u.too_big,
1626
- maximum: s.maxLength.value,
1626
+ maximum: n.maxLength.value,
1627
1627
  type: "array",
1628
1628
  inclusive: !0,
1629
1629
  exact: !1,
1630
- message: s.maxLength.message
1631
- }), n.dirty()), t.common.async)
1632
- return Promise.all([...t.data].map((i, o) => s.type._parseAsync(new R(t, i, t.path, o)))).then((i) => T.mergeArray(n, i));
1633
- const a = [...t.data].map((i, o) => s.type._parseSync(new R(t, i, t.path, o)));
1634
- return T.mergeArray(n, a);
1630
+ message: n.maxLength.message
1631
+ }), s.dirty()), t.common.async)
1632
+ return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new R(t, i, t.path, o)))).then((i) => T.mergeArray(s, i));
1633
+ const a = [...t.data].map((i, o) => n.type._parseSync(new R(t, i, t.path, o)));
1634
+ return T.mergeArray(s, a);
1635
1635
  }
1636
1636
  get element() {
1637
1637
  return this._def.type;
1638
1638
  }
1639
1639
  min(e, t) {
1640
- return new C({
1640
+ return new j({
1641
1641
  ...this._def,
1642
1642
  minLength: { value: e, message: m.toString(t) }
1643
1643
  });
1644
1644
  }
1645
1645
  max(e, t) {
1646
- return new C({
1646
+ return new j({
1647
1647
  ...this._def,
1648
1648
  maxLength: { value: e, message: m.toString(t) }
1649
1649
  });
1650
1650
  }
1651
1651
  length(e, t) {
1652
- return new C({
1652
+ return new j({
1653
1653
  ...this._def,
1654
1654
  exactLength: { value: e, message: m.toString(t) }
1655
1655
  });
@@ -1658,7 +1658,7 @@ class C extends g {
1658
1658
  return this.min(1, e);
1659
1659
  }
1660
1660
  }
1661
- C.create = (r, e) => new C({
1661
+ j.create = (r, e) => new j({
1662
1662
  type: r,
1663
1663
  minLength: null,
1664
1664
  maxLength: null,
@@ -1670,14 +1670,14 @@ function G(r) {
1670
1670
  if (r instanceof k) {
1671
1671
  const e = {};
1672
1672
  for (const t in r.shape) {
1673
- const n = r.shape[t];
1674
- e[t] = E.create(G(n));
1673
+ const s = r.shape[t];
1674
+ e[t] = E.create(G(s));
1675
1675
  }
1676
1676
  return new k({
1677
1677
  ...r._def,
1678
1678
  shape: () => e
1679
1679
  });
1680
- } else return r instanceof C ? new C({
1680
+ } else return r instanceof j ? new j({
1681
1681
  ...r._def,
1682
1682
  type: G(r.element)
1683
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;
@@ -1694,66 +1694,66 @@ class k extends g {
1694
1694
  }
1695
1695
  _parse(e) {
1696
1696
  if (this._getType(e) !== f.object) {
1697
- const c = this._getOrReturnCtx(e);
1698
- return l(c, {
1697
+ const d = this._getOrReturnCtx(e);
1698
+ return l(d, {
1699
1699
  code: u.invalid_type,
1700
1700
  expected: f.object,
1701
- received: c.parsedType
1701
+ received: d.parsedType
1702
1702
  }), y;
1703
1703
  }
1704
- const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
1705
- if (!(this._def.catchall instanceof M && this._def.unknownKeys === "strip"))
1706
- for (const c in s.data)
1707
- i.includes(c) || o.push(c);
1708
- const d = [];
1709
- for (const c of i) {
1710
- const p = a[c], b = s.data[c];
1711
- d.push({
1712
- key: { status: "valid", value: c },
1713
- value: p._parse(new R(s, b, s.path, c)),
1714
- alwaysSet: c in s.data
1704
+ const { status: s, ctx: n } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
1705
+ if (!(this._def.catchall instanceof P && this._def.unknownKeys === "strip"))
1706
+ for (const d in n.data)
1707
+ i.includes(d) || o.push(d);
1708
+ const c = [];
1709
+ for (const d of i) {
1710
+ const h = a[d], b = n.data[d];
1711
+ c.push({
1712
+ key: { status: "valid", value: d },
1713
+ value: h._parse(new R(n, b, n.path, d)),
1714
+ alwaysSet: d in n.data
1715
1715
  });
1716
1716
  }
1717
- if (this._def.catchall instanceof M) {
1718
- const c = this._def.unknownKeys;
1719
- if (c === "passthrough")
1720
- for (const p of o)
1721
- d.push({
1722
- key: { status: "valid", value: p },
1723
- value: { status: "valid", value: s.data[p] }
1717
+ if (this._def.catchall instanceof P) {
1718
+ const d = this._def.unknownKeys;
1719
+ if (d === "passthrough")
1720
+ for (const h of o)
1721
+ c.push({
1722
+ key: { status: "valid", value: h },
1723
+ value: { status: "valid", value: n.data[h] }
1724
1724
  });
1725
- else if (c === "strict")
1726
- o.length > 0 && (l(s, {
1725
+ else if (d === "strict")
1726
+ o.length > 0 && (l(n, {
1727
1727
  code: u.unrecognized_keys,
1728
1728
  keys: o
1729
- }), n.dirty());
1730
- else if (c !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1729
+ }), s.dirty());
1730
+ else if (d !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1731
1731
  } else {
1732
- const c = this._def.catchall;
1733
- for (const p of o) {
1734
- const b = s.data[p];
1735
- d.push({
1736
- key: { status: "valid", value: p },
1737
- value: c._parse(
1738
- new R(s, b, s.path, p)
1732
+ const d = this._def.catchall;
1733
+ for (const h of o) {
1734
+ const b = n.data[h];
1735
+ c.push({
1736
+ key: { status: "valid", value: h },
1737
+ value: d._parse(
1738
+ new R(n, b, n.path, h)
1739
1739
  //, ctx.child(key), value, getParsedType(value)
1740
1740
  ),
1741
- alwaysSet: p in s.data
1741
+ alwaysSet: h in n.data
1742
1742
  });
1743
1743
  }
1744
1744
  }
1745
- return s.common.async ? Promise.resolve().then(async () => {
1746
- const c = [];
1747
- for (const p of d) {
1748
- const b = await p.key, O = await p.value;
1749
- c.push({
1745
+ return n.common.async ? Promise.resolve().then(async () => {
1746
+ const d = [];
1747
+ for (const h of c) {
1748
+ const b = await h.key, Z = await h.value;
1749
+ d.push({
1750
1750
  key: b,
1751
- value: O,
1752
- alwaysSet: p.alwaysSet
1751
+ value: Z,
1752
+ alwaysSet: h.alwaysSet
1753
1753
  });
1754
1754
  }
1755
- return c;
1756
- }).then((c) => T.mergeObjectSync(n, c)) : T.mergeObjectSync(n, d);
1755
+ return d;
1756
+ }).then((d) => T.mergeObjectSync(s, d)) : T.mergeObjectSync(s, c);
1757
1757
  }
1758
1758
  get shape() {
1759
1759
  return this._def.shape();
@@ -1763,13 +1763,13 @@ class k extends g {
1763
1763
  ...this._def,
1764
1764
  unknownKeys: "strict",
1765
1765
  ...e !== void 0 ? {
1766
- errorMap: (t, n) => {
1767
- var s, a, i, o;
1768
- const d = (i = (a = (s = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(s, t, n).message) !== null && i !== void 0 ? i : n.defaultError;
1766
+ errorMap: (t, s) => {
1767
+ var n, a, i, o;
1768
+ const c = (i = (a = (n = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(n, t, s).message) !== null && i !== void 0 ? i : s.defaultError;
1769
1769
  return t.code === "unrecognized_keys" ? {
1770
- message: (o = m.errToObj(e).message) !== null && o !== void 0 ? o : d
1770
+ message: (o = m.errToObj(e).message) !== null && o !== void 0 ? o : c
1771
1771
  } : {
1772
- message: d
1772
+ message: c
1773
1773
  };
1774
1774
  }
1775
1775
  } : {}
@@ -1896,8 +1896,8 @@ class k extends g {
1896
1896
  }
1897
1897
  pick(e) {
1898
1898
  const t = {};
1899
- return x.objectKeys(e).forEach((n) => {
1900
- e[n] && this.shape[n] && (t[n] = this.shape[n]);
1899
+ return x.objectKeys(e).forEach((s) => {
1900
+ e[s] && this.shape[s] && (t[s] = this.shape[s]);
1901
1901
  }), new k({
1902
1902
  ...this._def,
1903
1903
  shape: () => t
@@ -1905,8 +1905,8 @@ class k extends g {
1905
1905
  }
1906
1906
  omit(e) {
1907
1907
  const t = {};
1908
- return x.objectKeys(this.shape).forEach((n) => {
1909
- e[n] || (t[n] = this.shape[n]);
1908
+ return x.objectKeys(this.shape).forEach((s) => {
1909
+ e[s] || (t[s] = this.shape[s]);
1910
1910
  }), new k({
1911
1911
  ...this._def,
1912
1912
  shape: () => t
@@ -1920,9 +1920,9 @@ class k extends g {
1920
1920
  }
1921
1921
  partial(e) {
1922
1922
  const t = {};
1923
- return x.objectKeys(this.shape).forEach((n) => {
1924
- const s = this.shape[n];
1925
- e && !e[n] ? t[n] = s : t[n] = s.optional();
1923
+ return x.objectKeys(this.shape).forEach((s) => {
1924
+ const n = this.shape[s];
1925
+ e && !e[s] ? t[s] = n : t[s] = n.optional();
1926
1926
  }), new k({
1927
1927
  ...this._def,
1928
1928
  shape: () => t
@@ -1930,14 +1930,14 @@ class k extends g {
1930
1930
  }
1931
1931
  required(e) {
1932
1932
  const t = {};
1933
- return x.objectKeys(this.shape).forEach((n) => {
1934
- if (e && !e[n])
1935
- t[n] = this.shape[n];
1933
+ return x.objectKeys(this.shape).forEach((s) => {
1934
+ if (e && !e[s])
1935
+ t[s] = this.shape[s];
1936
1936
  else {
1937
- let a = this.shape[n];
1937
+ let a = this.shape[s];
1938
1938
  for (; a instanceof E; )
1939
1939
  a = a._def.innerType;
1940
- t[n] = a;
1940
+ t[s] = a;
1941
1941
  }
1942
1942
  }), new k({
1943
1943
  ...this._def,
@@ -1951,42 +1951,42 @@ class k extends g {
1951
1951
  k.create = (r, e) => new k({
1952
1952
  shape: () => r,
1953
1953
  unknownKeys: "strip",
1954
- catchall: M.create(),
1954
+ catchall: P.create(),
1955
1955
  typeName: _.ZodObject,
1956
1956
  ...v(e)
1957
1957
  });
1958
1958
  k.strictCreate = (r, e) => new k({
1959
1959
  shape: () => r,
1960
1960
  unknownKeys: "strict",
1961
- catchall: M.create(),
1961
+ catchall: P.create(),
1962
1962
  typeName: _.ZodObject,
1963
1963
  ...v(e)
1964
1964
  });
1965
1965
  k.lazycreate = (r, e) => new k({
1966
1966
  shape: r,
1967
1967
  unknownKeys: "strip",
1968
- catchall: M.create(),
1968
+ catchall: P.create(),
1969
1969
  typeName: _.ZodObject,
1970
1970
  ...v(e)
1971
1971
  });
1972
1972
  class le extends g {
1973
1973
  _parse(e) {
1974
- const { ctx: t } = this._processInputParams(e), n = this._def.options;
1975
- function s(a) {
1974
+ const { ctx: t } = this._processInputParams(e), s = this._def.options;
1975
+ function n(a) {
1976
1976
  for (const o of a)
1977
1977
  if (o.result.status === "valid")
1978
1978
  return o.result;
1979
1979
  for (const o of a)
1980
1980
  if (o.result.status === "dirty")
1981
1981
  return t.common.issues.push(...o.ctx.common.issues), o.result;
1982
- const i = a.map((o) => new S(o.ctx.common.issues));
1982
+ const i = a.map((o) => new C(o.ctx.common.issues));
1983
1983
  return l(t, {
1984
1984
  code: u.invalid_union,
1985
1985
  unionErrors: i
1986
1986
  }), y;
1987
1987
  }
1988
1988
  if (t.common.async)
1989
- return Promise.all(n.map(async (a) => {
1989
+ return Promise.all(s.map(async (a) => {
1990
1990
  const i = {
1991
1991
  ...t,
1992
1992
  common: {
@@ -2003,30 +2003,30 @@ class le extends g {
2003
2003
  }),
2004
2004
  ctx: i
2005
2005
  };
2006
- })).then(s);
2006
+ })).then(n);
2007
2007
  {
2008
2008
  let a;
2009
2009
  const i = [];
2010
- for (const d of n) {
2011
- const c = {
2010
+ for (const c of s) {
2011
+ const d = {
2012
2012
  ...t,
2013
2013
  common: {
2014
2014
  ...t.common,
2015
2015
  issues: []
2016
2016
  },
2017
2017
  parent: null
2018
- }, p = d._parseSync({
2018
+ }, h = c._parseSync({
2019
2019
  data: t.data,
2020
2020
  path: t.path,
2021
- parent: c
2021
+ parent: d
2022
2022
  });
2023
- if (p.status === "valid")
2024
- return p;
2025
- p.status === "dirty" && !a && (a = { result: p, ctx: c }), c.common.issues.length && i.push(c.common.issues);
2023
+ if (h.status === "valid")
2024
+ return h;
2025
+ h.status === "dirty" && !a && (a = { result: h, ctx: d }), d.common.issues.length && i.push(d.common.issues);
2026
2026
  }
2027
2027
  if (a)
2028
2028
  return t.common.issues.push(...a.ctx.common.issues), a.result;
2029
- const o = i.map((d) => new S(d));
2029
+ const o = i.map((c) => new C(c));
2030
2030
  return l(t, {
2031
2031
  code: u.invalid_union,
2032
2032
  unionErrors: o
@@ -2042,8 +2042,8 @@ le.create = (r, e) => new le({
2042
2042
  typeName: _.ZodUnion,
2043
2043
  ...v(e)
2044
2044
  });
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 {
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 de ? [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 Ee extends g {
2047
2047
  _parse(e) {
2048
2048
  const { ctx: t } = this._processInputParams(e);
2049
2049
  if (t.parsedType !== f.object)
@@ -2052,7 +2052,7 @@ class Ae extends g {
2052
2052
  expected: f.object,
2053
2053
  received: t.parsedType
2054
2054
  }), y;
2055
- const n = this.discriminator, s = t.data[n], a = this.optionsMap.get(s);
2055
+ const s = this.discriminator, n = t.data[s], a = this.optionsMap.get(n);
2056
2056
  return a ? t.common.async ? a._parseAsync({
2057
2057
  data: t.data,
2058
2058
  path: t.path,
@@ -2064,7 +2064,7 @@ class Ae extends g {
2064
2064
  }) : (l(t, {
2065
2065
  code: u.invalid_union_discriminator,
2066
2066
  options: Array.from(this.optionsMap.keys()),
2067
- path: [n]
2067
+ path: [s]
2068
2068
  }), y);
2069
2069
  }
2070
2070
  get discriminator() {
@@ -2084,82 +2084,82 @@ class Ae extends g {
2084
2084
  * @param types an array of object schemas
2085
2085
  * @param params
2086
2086
  */
2087
- static create(e, t, n) {
2088
- const s = /* @__PURE__ */ new Map();
2087
+ static create(e, t, s) {
2088
+ const n = /* @__PURE__ */ new Map();
2089
2089
  for (const a of t) {
2090
2090
  const i = I(a.shape[e]);
2091
2091
  if (!i.length)
2092
2092
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
2093
2093
  for (const o of i) {
2094
- if (s.has(o))
2094
+ if (n.has(o))
2095
2095
  throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
2096
- s.set(o, a);
2096
+ n.set(o, a);
2097
2097
  }
2098
2098
  }
2099
- return new Ae({
2099
+ return new Ee({
2100
2100
  typeName: _.ZodDiscriminatedUnion,
2101
2101
  discriminator: e,
2102
2102
  options: t,
2103
- optionsMap: s,
2104
- ...v(n)
2103
+ optionsMap: n,
2104
+ ...v(s)
2105
2105
  });
2106
2106
  }
2107
2107
  }
2108
- function qe(r, e) {
2109
- const t = $(r), n = $(e);
2108
+ function We(r, e) {
2109
+ const t = $(r), s = $(e);
2110
2110
  if (r === e)
2111
2111
  return { valid: !0, data: r };
2112
- if (t === f.object && n === f.object) {
2113
- const s = x.objectKeys(e), a = x.objectKeys(r).filter((o) => s.indexOf(o) !== -1), i = { ...r, ...e };
2112
+ if (t === f.object && s === f.object) {
2113
+ const n = x.objectKeys(e), a = x.objectKeys(r).filter((o) => n.indexOf(o) !== -1), i = { ...r, ...e };
2114
2114
  for (const o of a) {
2115
- const d = qe(r[o], e[o]);
2116
- if (!d.valid)
2115
+ const c = We(r[o], e[o]);
2116
+ if (!c.valid)
2117
2117
  return { valid: !1 };
2118
- i[o] = d.data;
2118
+ i[o] = c.data;
2119
2119
  }
2120
2120
  return { valid: !0, data: i };
2121
- } else if (t === f.array && n === f.array) {
2121
+ } else if (t === f.array && s === f.array) {
2122
2122
  if (r.length !== e.length)
2123
2123
  return { valid: !1 };
2124
- const s = [];
2124
+ const n = [];
2125
2125
  for (let a = 0; a < r.length; a++) {
2126
- const i = r[a], o = e[a], d = qe(i, o);
2127
- if (!d.valid)
2126
+ const i = r[a], o = e[a], c = We(i, o);
2127
+ if (!c.valid)
2128
2128
  return { valid: !1 };
2129
- s.push(d.data);
2129
+ n.push(c.data);
2130
2130
  }
2131
- return { valid: !0, data: s };
2132
- } else return t === f.date && n === f.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
2131
+ return { valid: !0, data: n };
2132
+ } else return t === f.date && s === f.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
2133
2133
  }
2134
2134
  class fe extends g {
2135
2135
  _parse(e) {
2136
- const { status: t, ctx: n } = this._processInputParams(e), s = (a, i) => {
2136
+ const { status: t, ctx: s } = this._processInputParams(e), n = (a, i) => {
2137
2137
  if (Fe(a) || Fe(i))
2138
2138
  return y;
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, {
2139
+ const o = We(a.value, i.value);
2140
+ return o.valid ? ((qe(a) || qe(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(s, {
2141
2141
  code: u.invalid_intersection_types
2142
2142
  }), y);
2143
2143
  };
2144
- return n.common.async ? Promise.all([
2144
+ return s.common.async ? Promise.all([
2145
2145
  this._def.left._parseAsync({
2146
- data: n.data,
2147
- path: n.path,
2148
- parent: n
2146
+ data: s.data,
2147
+ path: s.path,
2148
+ parent: s
2149
2149
  }),
2150
2150
  this._def.right._parseAsync({
2151
- data: n.data,
2152
- path: n.path,
2153
- parent: n
2151
+ data: s.data,
2152
+ path: s.path,
2153
+ parent: s
2154
2154
  })
2155
- ]).then(([a, i]) => s(a, i)) : s(this._def.left._parseSync({
2156
- data: n.data,
2157
- path: n.path,
2158
- parent: n
2155
+ ]).then(([a, i]) => n(a, i)) : n(this._def.left._parseSync({
2156
+ data: s.data,
2157
+ path: s.path,
2158
+ parent: s
2159
2159
  }), this._def.right._parseSync({
2160
- data: n.data,
2161
- path: n.path,
2162
- parent: n
2160
+ data: s.data,
2161
+ path: s.path,
2162
+ parent: s
2163
2163
  }));
2164
2164
  }
2165
2165
  }
@@ -2171,33 +2171,33 @@ fe.create = (r, e, t) => new fe({
2171
2171
  });
2172
2172
  class N extends g {
2173
2173
  _parse(e) {
2174
- const { status: t, ctx: n } = this._processInputParams(e);
2175
- if (n.parsedType !== f.array)
2176
- return l(n, {
2174
+ const { status: t, ctx: s } = this._processInputParams(e);
2175
+ if (s.parsedType !== f.array)
2176
+ return l(s, {
2177
2177
  code: u.invalid_type,
2178
2178
  expected: f.array,
2179
- received: n.parsedType
2179
+ received: s.parsedType
2180
2180
  }), y;
2181
- if (n.data.length < this._def.items.length)
2182
- return l(n, {
2181
+ if (s.data.length < this._def.items.length)
2182
+ return l(s, {
2183
2183
  code: u.too_small,
2184
2184
  minimum: this._def.items.length,
2185
2185
  inclusive: !0,
2186
2186
  exact: !1,
2187
2187
  type: "array"
2188
2188
  }), y;
2189
- !this._def.rest && n.data.length > this._def.items.length && (l(n, {
2189
+ !this._def.rest && s.data.length > this._def.items.length && (l(s, {
2190
2190
  code: u.too_big,
2191
2191
  maximum: this._def.items.length,
2192
2192
  inclusive: !0,
2193
2193
  exact: !1,
2194
2194
  type: "array"
2195
2195
  }), t.dirty());
2196
- const a = [...n.data].map((i, o) => {
2197
- const d = this._def.items[o] || this._def.rest;
2198
- return d ? d._parse(new R(n, i, n.path, o)) : null;
2196
+ const a = [...s.data].map((i, o) => {
2197
+ const c = this._def.items[o] || this._def.rest;
2198
+ return c ? c._parse(new R(s, i, s.path, o)) : null;
2199
2199
  }).filter((i) => !!i);
2200
- return n.common.async ? Promise.all(a).then((i) => T.mergeArray(t, i)) : T.mergeArray(t, a);
2200
+ return s.common.async ? Promise.all(a).then((i) => T.mergeArray(t, i)) : T.mergeArray(t, a);
2201
2201
  }
2202
2202
  get items() {
2203
2203
  return this._def.items;
@@ -2227,40 +2227,40 @@ class he extends g {
2227
2227
  return this._def.valueType;
2228
2228
  }
2229
2229
  _parse(e) {
2230
- const { status: t, ctx: n } = this._processInputParams(e);
2231
- if (n.parsedType !== f.object)
2232
- return l(n, {
2230
+ const { status: t, ctx: s } = this._processInputParams(e);
2231
+ if (s.parsedType !== f.object)
2232
+ return l(s, {
2233
2233
  code: u.invalid_type,
2234
2234
  expected: f.object,
2235
- received: n.parsedType
2235
+ received: s.parsedType
2236
2236
  }), y;
2237
- const s = [], a = this._def.keyType, i = this._def.valueType;
2238
- for (const o in n.data)
2239
- s.push({
2240
- key: a._parse(new R(n, o, n.path, o)),
2241
- value: i._parse(new R(n, n.data[o], n.path, o)),
2242
- alwaysSet: o in n.data
2237
+ const n = [], a = this._def.keyType, i = this._def.valueType;
2238
+ for (const o in s.data)
2239
+ n.push({
2240
+ key: a._parse(new R(s, o, s.path, o)),
2241
+ value: i._parse(new R(s, s.data[o], s.path, o)),
2242
+ alwaysSet: o in s.data
2243
2243
  });
2244
- return n.common.async ? T.mergeObjectAsync(t, s) : T.mergeObjectSync(t, s);
2244
+ return s.common.async ? T.mergeObjectAsync(t, n) : T.mergeObjectSync(t, n);
2245
2245
  }
2246
2246
  get element() {
2247
2247
  return this._def.valueType;
2248
2248
  }
2249
- static create(e, t, n) {
2249
+ static create(e, t, s) {
2250
2250
  return t instanceof g ? new he({
2251
2251
  keyType: e,
2252
2252
  valueType: t,
2253
2253
  typeName: _.ZodRecord,
2254
- ...v(n)
2254
+ ...v(s)
2255
2255
  }) : new he({
2256
- keyType: j.create(),
2256
+ keyType: O.create(),
2257
2257
  valueType: e,
2258
2258
  typeName: _.ZodRecord,
2259
2259
  ...v(t)
2260
2260
  });
2261
2261
  }
2262
2262
  }
2263
- class Se extends g {
2263
+ class Oe extends g {
2264
2264
  get keySchema() {
2265
2265
  return this._def.keyType;
2266
2266
  }
@@ -2268,41 +2268,41 @@ class Se extends g {
2268
2268
  return this._def.valueType;
2269
2269
  }
2270
2270
  _parse(e) {
2271
- const { status: t, ctx: n } = this._processInputParams(e);
2272
- if (n.parsedType !== f.map)
2273
- return l(n, {
2271
+ const { status: t, ctx: s } = this._processInputParams(e);
2272
+ if (s.parsedType !== f.map)
2273
+ return l(s, {
2274
2274
  code: u.invalid_type,
2275
2275
  expected: f.map,
2276
- received: n.parsedType
2276
+ received: s.parsedType
2277
2277
  }), y;
2278
- const s = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, d], c) => ({
2279
- key: s._parse(new R(n, o, n.path, [c, "key"])),
2280
- value: a._parse(new R(n, d, n.path, [c, "value"]))
2278
+ const n = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], d) => ({
2279
+ key: n._parse(new R(s, o, s.path, [d, "key"])),
2280
+ value: a._parse(new R(s, c, s.path, [d, "value"]))
2281
2281
  }));
2282
- if (n.common.async) {
2282
+ if (s.common.async) {
2283
2283
  const o = /* @__PURE__ */ new Map();
2284
2284
  return Promise.resolve().then(async () => {
2285
- for (const d of i) {
2286
- const c = await d.key, p = await d.value;
2287
- if (c.status === "aborted" || p.status === "aborted")
2285
+ for (const c of i) {
2286
+ const d = await c.key, h = await c.value;
2287
+ if (d.status === "aborted" || h.status === "aborted")
2288
2288
  return y;
2289
- (c.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(c.value, p.value);
2289
+ (d.status === "dirty" || h.status === "dirty") && t.dirty(), o.set(d.value, h.value);
2290
2290
  }
2291
2291
  return { status: t.value, value: o };
2292
2292
  });
2293
2293
  } else {
2294
2294
  const o = /* @__PURE__ */ new Map();
2295
- for (const d of i) {
2296
- const c = d.key, p = d.value;
2297
- if (c.status === "aborted" || p.status === "aborted")
2295
+ for (const c of i) {
2296
+ const d = c.key, h = c.value;
2297
+ if (d.status === "aborted" || h.status === "aborted")
2298
2298
  return y;
2299
- (c.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(c.value, p.value);
2299
+ (d.status === "dirty" || h.status === "dirty") && t.dirty(), o.set(d.value, h.value);
2300
2300
  }
2301
2301
  return { status: t.value, value: o };
2302
2302
  }
2303
2303
  }
2304
2304
  }
2305
- Se.create = (r, e, t) => new Se({
2305
+ Oe.create = (r, e, t) => new Oe({
2306
2306
  valueType: e,
2307
2307
  keyType: r,
2308
2308
  typeName: _.ZodMap,
@@ -2310,41 +2310,41 @@ Se.create = (r, e, t) => new Se({
2310
2310
  });
2311
2311
  class J extends g {
2312
2312
  _parse(e) {
2313
- const { status: t, ctx: n } = this._processInputParams(e);
2314
- if (n.parsedType !== f.set)
2315
- return l(n, {
2313
+ const { status: t, ctx: s } = this._processInputParams(e);
2314
+ if (s.parsedType !== f.set)
2315
+ return l(s, {
2316
2316
  code: u.invalid_type,
2317
2317
  expected: f.set,
2318
- received: n.parsedType
2318
+ received: s.parsedType
2319
2319
  }), y;
2320
- const s = this._def;
2321
- s.minSize !== null && n.data.size < s.minSize.value && (l(n, {
2320
+ const n = this._def;
2321
+ n.minSize !== null && s.data.size < n.minSize.value && (l(s, {
2322
2322
  code: u.too_small,
2323
- minimum: s.minSize.value,
2323
+ minimum: n.minSize.value,
2324
2324
  type: "set",
2325
2325
  inclusive: !0,
2326
2326
  exact: !1,
2327
- message: s.minSize.message
2328
- }), t.dirty()), s.maxSize !== null && n.data.size > s.maxSize.value && (l(n, {
2327
+ message: n.minSize.message
2328
+ }), t.dirty()), n.maxSize !== null && s.data.size > n.maxSize.value && (l(s, {
2329
2329
  code: u.too_big,
2330
- maximum: s.maxSize.value,
2330
+ maximum: n.maxSize.value,
2331
2331
  type: "set",
2332
2332
  inclusive: !0,
2333
2333
  exact: !1,
2334
- message: s.maxSize.message
2334
+ message: n.maxSize.message
2335
2335
  }), t.dirty());
2336
2336
  const a = this._def.valueType;
2337
- function i(d) {
2338
- const c = /* @__PURE__ */ new Set();
2339
- for (const p of d) {
2340
- if (p.status === "aborted")
2337
+ function i(c) {
2338
+ const d = /* @__PURE__ */ new Set();
2339
+ for (const h of c) {
2340
+ if (h.status === "aborted")
2341
2341
  return y;
2342
- p.status === "dirty" && t.dirty(), c.add(p.value);
2342
+ h.status === "dirty" && t.dirty(), d.add(h.value);
2343
2343
  }
2344
- return { status: t.value, value: c };
2344
+ return { status: t.value, value: d };
2345
2345
  }
2346
- const o = [...n.data.values()].map((d, c) => a._parse(new R(n, d, n.path, c)));
2347
- return n.common.async ? Promise.all(o).then((d) => i(d)) : i(o);
2346
+ const o = [...s.data.values()].map((c, d) => a._parse(new R(s, c, s.path, d)));
2347
+ return s.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
2348
2348
  }
2349
2349
  min(e, t) {
2350
2350
  return new J({
@@ -2372,7 +2372,7 @@ J.create = (r, e) => new J({
2372
2372
  typeName: _.ZodSet,
2373
2373
  ...v(e)
2374
2374
  });
2375
- class K extends g {
2375
+ class X extends g {
2376
2376
  constructor() {
2377
2377
  super(...arguments), this.validate = this.implement;
2378
2378
  }
@@ -2384,58 +2384,58 @@ class K extends g {
2384
2384
  expected: f.function,
2385
2385
  received: t.parsedType
2386
2386
  }), y;
2387
- function n(o, d) {
2388
- return we({
2387
+ function s(o, c) {
2388
+ return Te({
2389
2389
  data: o,
2390
2390
  path: t.path,
2391
2391
  errorMaps: [
2392
2392
  t.common.contextualErrorMap,
2393
2393
  t.schemaErrorMap,
2394
- ke(),
2394
+ we(),
2395
2395
  Q
2396
- ].filter((c) => !!c),
2396
+ ].filter((d) => !!d),
2397
2397
  issueData: {
2398
2398
  code: u.invalid_arguments,
2399
- argumentsError: d
2399
+ argumentsError: c
2400
2400
  }
2401
2401
  });
2402
2402
  }
2403
- function s(o, d) {
2404
- return we({
2403
+ function n(o, c) {
2404
+ return Te({
2405
2405
  data: o,
2406
2406
  path: t.path,
2407
2407
  errorMaps: [
2408
2408
  t.common.contextualErrorMap,
2409
2409
  t.schemaErrorMap,
2410
- ke(),
2410
+ we(),
2411
2411
  Q
2412
- ].filter((c) => !!c),
2412
+ ].filter((d) => !!d),
2413
2413
  issueData: {
2414
2414
  code: u.invalid_return_type,
2415
- returnTypeError: d
2415
+ returnTypeError: c
2416
2416
  }
2417
2417
  });
2418
2418
  }
2419
2419
  const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
2420
2420
  if (this._def.returns instanceof te) {
2421
2421
  const o = this;
2422
- return Z(async function(...d) {
2423
- const c = new S([]), p = await o._def.args.parseAsync(d, a).catch((w) => {
2424
- throw c.addIssue(n(d, w)), c;
2425
- }), b = await Reflect.apply(i, this, p);
2422
+ return S(async function(...c) {
2423
+ const d = new C([]), h = await o._def.args.parseAsync(c, a).catch((w) => {
2424
+ throw d.addIssue(s(c, w)), d;
2425
+ }), b = await Reflect.apply(i, this, h);
2426
2426
  return await o._def.returns._def.type.parseAsync(b, a).catch((w) => {
2427
- throw c.addIssue(s(b, w)), c;
2427
+ throw d.addIssue(n(b, w)), d;
2428
2428
  });
2429
2429
  });
2430
2430
  } else {
2431
2431
  const o = this;
2432
- return Z(function(...d) {
2433
- const c = o._def.args.safeParse(d, a);
2434
- if (!c.success)
2435
- throw new S([n(d, c.error)]);
2436
- const p = Reflect.apply(i, this, c.data), b = o._def.returns.safeParse(p, a);
2432
+ return S(function(...c) {
2433
+ const d = o._def.args.safeParse(c, a);
2434
+ if (!d.success)
2435
+ throw new C([s(c, d.error)]);
2436
+ const h = Reflect.apply(i, this, d.data), b = o._def.returns.safeParse(h, a);
2437
2437
  if (!b.success)
2438
- throw new S([s(p, b.error)]);
2438
+ throw new C([n(h, b.error)]);
2439
2439
  return b.data;
2440
2440
  });
2441
2441
  }
@@ -2447,13 +2447,13 @@ class K extends g {
2447
2447
  return this._def.returns;
2448
2448
  }
2449
2449
  args(...e) {
2450
- return new K({
2450
+ return new X({
2451
2451
  ...this._def,
2452
2452
  args: N.create(e).rest(F.create())
2453
2453
  });
2454
2454
  }
2455
2455
  returns(e) {
2456
- return new K({
2456
+ return new X({
2457
2457
  ...this._def,
2458
2458
  returns: e
2459
2459
  });
@@ -2464,12 +2464,12 @@ class K extends g {
2464
2464
  strictImplement(e) {
2465
2465
  return this.parse(e);
2466
2466
  }
2467
- static create(e, t, n) {
2468
- return new K({
2467
+ static create(e, t, s) {
2468
+ return new X({
2469
2469
  args: e || N.create([]).rest(F.create()),
2470
2470
  returns: t || F.create(),
2471
2471
  typeName: _.ZodFunction,
2472
- ...v(n)
2472
+ ...v(s)
2473
2473
  });
2474
2474
  }
2475
2475
  }
@@ -2521,22 +2521,22 @@ class z extends g {
2521
2521
  }
2522
2522
  _parse(e) {
2523
2523
  if (typeof e.data != "string") {
2524
- const t = this._getOrReturnCtx(e), n = this._def.values;
2524
+ const t = this._getOrReturnCtx(e), s = this._def.values;
2525
2525
  return l(t, {
2526
- expected: x.joinValues(n),
2526
+ expected: x.joinValues(s),
2527
2527
  received: t.parsedType,
2528
2528
  code: u.invalid_type
2529
2529
  }), y;
2530
2530
  }
2531
- if (Te(this, ae) || Ke(this, ae, new Set(this._def.values)), !Te(this, ae).has(e.data)) {
2532
- const t = this._getOrReturnCtx(e), n = this._def.values;
2531
+ if (Se(this, ae) || Xe(this, ae, new Set(this._def.values)), !Se(this, ae).has(e.data)) {
2532
+ const t = this._getOrReturnCtx(e), s = this._def.values;
2533
2533
  return l(t, {
2534
2534
  received: t.data,
2535
2535
  code: u.invalid_enum_value,
2536
- options: n
2536
+ options: s
2537
2537
  }), y;
2538
2538
  }
2539
- return Z(e.data);
2539
+ return S(e.data);
2540
2540
  }
2541
2541
  get options() {
2542
2542
  return this._def.values;
@@ -2566,7 +2566,7 @@ class z extends g {
2566
2566
  });
2567
2567
  }
2568
2568
  exclude(e, t = this._def) {
2569
- return z.create(this.options.filter((n) => !e.includes(n)), {
2569
+ return z.create(this.options.filter((s) => !e.includes(s)), {
2570
2570
  ...this._def,
2571
2571
  ...t
2572
2572
  });
@@ -2579,24 +2579,24 @@ class _e extends g {
2579
2579
  super(...arguments), ie.set(this, void 0);
2580
2580
  }
2581
2581
  _parse(e) {
2582
- const t = x.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
2583
- if (n.parsedType !== f.string && n.parsedType !== f.number) {
2584
- const s = x.objectValues(t);
2585
- return l(n, {
2586
- expected: x.joinValues(s),
2587
- received: n.parsedType,
2582
+ const t = x.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
2583
+ if (s.parsedType !== f.string && s.parsedType !== f.number) {
2584
+ const n = x.objectValues(t);
2585
+ return l(s, {
2586
+ expected: x.joinValues(n),
2587
+ received: s.parsedType,
2588
2588
  code: u.invalid_type
2589
2589
  }), y;
2590
2590
  }
2591
- if (Te(this, ie) || Ke(this, ie, new Set(x.getValidEnumValues(this._def.values))), !Te(this, ie).has(e.data)) {
2592
- const s = x.objectValues(t);
2593
- return l(n, {
2594
- received: n.data,
2591
+ if (Se(this, ie) || Xe(this, ie, new Set(x.getValidEnumValues(this._def.values))), !Se(this, ie).has(e.data)) {
2592
+ const n = x.objectValues(t);
2593
+ return l(s, {
2594
+ received: s.data,
2595
2595
  code: u.invalid_enum_value,
2596
- options: s
2596
+ options: n
2597
2597
  }), y;
2598
2598
  }
2599
- return Z(e.data);
2599
+ return S(e.data);
2600
2600
  }
2601
2601
  get enum() {
2602
2602
  return this._def.values;
@@ -2620,8 +2620,8 @@ class te extends g {
2620
2620
  expected: f.promise,
2621
2621
  received: t.parsedType
2622
2622
  }), y;
2623
- const n = t.parsedType === f.promise ? t.data : Promise.resolve(t.data);
2624
- return Z(n.then((s) => this._def.type.parseAsync(s, {
2623
+ const s = t.parsedType === f.promise ? t.data : Promise.resolve(t.data);
2624
+ return S(s.then((n) => this._def.type.parseAsync(n, {
2625
2625
  path: t.path,
2626
2626
  errorMap: t.common.contextualErrorMap
2627
2627
  })));
@@ -2640,73 +2640,73 @@ class A extends g {
2640
2640
  return this._def.schema._def.typeName === _.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2641
2641
  }
2642
2642
  _parse(e) {
2643
- const { status: t, ctx: n } = this._processInputParams(e), s = this._def.effect || null, a = {
2643
+ const { status: t, ctx: s } = this._processInputParams(e), n = this._def.effect || null, a = {
2644
2644
  addIssue: (i) => {
2645
- l(n, i), i.fatal ? t.abort() : t.dirty();
2645
+ l(s, i), i.fatal ? t.abort() : t.dirty();
2646
2646
  },
2647
2647
  get path() {
2648
- return n.path;
2648
+ return s.path;
2649
2649
  }
2650
2650
  };
2651
- if (a.addIssue = a.addIssue.bind(a), s.type === "preprocess") {
2652
- const i = s.transform(n.data, a);
2653
- if (n.common.async)
2651
+ if (a.addIssue = a.addIssue.bind(a), n.type === "preprocess") {
2652
+ const i = n.transform(s.data, a);
2653
+ if (s.common.async)
2654
2654
  return Promise.resolve(i).then(async (o) => {
2655
2655
  if (t.value === "aborted")
2656
2656
  return y;
2657
- const d = await this._def.schema._parseAsync({
2657
+ const c = await this._def.schema._parseAsync({
2658
2658
  data: o,
2659
- path: n.path,
2660
- parent: n
2659
+ path: s.path,
2660
+ parent: s
2661
2661
  });
2662
- return d.status === "aborted" ? y : d.status === "dirty" || t.value === "dirty" ? X(d.value) : d;
2662
+ return c.status === "aborted" ? y : c.status === "dirty" || t.value === "dirty" ? K(c.value) : c;
2663
2663
  });
2664
2664
  {
2665
2665
  if (t.value === "aborted")
2666
2666
  return y;
2667
2667
  const o = this._def.schema._parseSync({
2668
2668
  data: i,
2669
- path: n.path,
2670
- parent: n
2669
+ path: s.path,
2670
+ parent: s
2671
2671
  });
2672
- return o.status === "aborted" ? y : o.status === "dirty" || t.value === "dirty" ? X(o.value) : o;
2672
+ return o.status === "aborted" ? y : o.status === "dirty" || t.value === "dirty" ? K(o.value) : o;
2673
2673
  }
2674
2674
  }
2675
- if (s.type === "refinement") {
2675
+ if (n.type === "refinement") {
2676
2676
  const i = (o) => {
2677
- const d = s.refinement(o, a);
2678
- if (n.common.async)
2679
- return Promise.resolve(d);
2680
- if (d instanceof Promise)
2677
+ const c = n.refinement(o, a);
2678
+ if (s.common.async)
2679
+ return Promise.resolve(c);
2680
+ if (c instanceof Promise)
2681
2681
  throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
2682
2682
  return o;
2683
2683
  };
2684
- if (n.common.async === !1) {
2684
+ if (s.common.async === !1) {
2685
2685
  const o = this._def.schema._parseSync({
2686
- data: n.data,
2687
- path: n.path,
2688
- parent: n
2686
+ data: s.data,
2687
+ path: s.path,
2688
+ parent: s
2689
2689
  });
2690
2690
  return o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
2691
2691
  } else
2692
- return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
2692
+ return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
2693
2693
  }
2694
- if (s.type === "transform")
2695
- if (n.common.async === !1) {
2694
+ if (n.type === "transform")
2695
+ if (s.common.async === !1) {
2696
2696
  const i = this._def.schema._parseSync({
2697
- data: n.data,
2698
- path: n.path,
2699
- parent: n
2697
+ data: s.data,
2698
+ path: s.path,
2699
+ parent: s
2700
2700
  });
2701
- if (!W(i))
2701
+ if (!q(i))
2702
2702
  return i;
2703
- const o = s.transform(i.value, a);
2703
+ const o = n.transform(i.value, a);
2704
2704
  if (o instanceof Promise)
2705
2705
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2706
2706
  return { status: t.value, value: o };
2707
2707
  } else
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);
2709
- x.assertNever(s);
2708
+ return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => q(i) ? Promise.resolve(n.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
2709
+ x.assertNever(n);
2710
2710
  }
2711
2711
  }
2712
2712
  A.create = (r, e, t) => new A({
@@ -2723,7 +2723,7 @@ A.createWithPreprocess = (r, e, t) => new A({
2723
2723
  });
2724
2724
  class E extends g {
2725
2725
  _parse(e) {
2726
- return this._getType(e) === f.undefined ? Z(void 0) : this._def.innerType._parse(e);
2726
+ return this._getType(e) === f.undefined ? S(void 0) : this._def.innerType._parse(e);
2727
2727
  }
2728
2728
  unwrap() {
2729
2729
  return this._def.innerType;
@@ -2736,7 +2736,7 @@ E.create = (r, e) => new E({
2736
2736
  });
2737
2737
  class U extends g {
2738
2738
  _parse(e) {
2739
- return this._getType(e) === f.null ? Z(null) : this._def.innerType._parse(e);
2739
+ return this._getType(e) === f.null ? S(null) : this._def.innerType._parse(e);
2740
2740
  }
2741
2741
  unwrap() {
2742
2742
  return this._def.innerType;
@@ -2750,9 +2750,9 @@ U.create = (r, e) => new U({
2750
2750
  class ye extends g {
2751
2751
  _parse(e) {
2752
2752
  const { ctx: t } = this._processInputParams(e);
2753
- let n = t.data;
2754
- return t.parsedType === f.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
2755
- data: n,
2753
+ let s = t.data;
2754
+ return t.parsedType === f.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
2755
+ data: s,
2756
2756
  path: t.path,
2757
2757
  parent: t
2758
2758
  });
@@ -2769,34 +2769,34 @@ ye.create = (r, e) => new ye({
2769
2769
  });
2770
2770
  class ve extends g {
2771
2771
  _parse(e) {
2772
- const { ctx: t } = this._processInputParams(e), n = {
2772
+ const { ctx: t } = this._processInputParams(e), s = {
2773
2773
  ...t,
2774
2774
  common: {
2775
2775
  ...t.common,
2776
2776
  issues: []
2777
2777
  }
2778
- }, s = this._def.innerType._parse({
2779
- data: n.data,
2780
- path: n.path,
2778
+ }, n = this._def.innerType._parse({
2779
+ data: s.data,
2780
+ path: s.path,
2781
2781
  parent: {
2782
- ...n
2782
+ ...s
2783
2783
  }
2784
2784
  });
2785
- return oe(s) ? s.then((a) => ({
2785
+ return oe(n) ? n.then((a) => ({
2786
2786
  status: "valid",
2787
2787
  value: a.status === "valid" ? a.value : this._def.catchValue({
2788
2788
  get error() {
2789
- return new S(n.common.issues);
2789
+ return new C(s.common.issues);
2790
2790
  },
2791
- input: n.data
2791
+ input: s.data
2792
2792
  })
2793
2793
  })) : {
2794
2794
  status: "valid",
2795
- value: s.status === "valid" ? s.value : this._def.catchValue({
2795
+ value: n.status === "valid" ? n.value : this._def.catchValue({
2796
2796
  get error() {
2797
- return new S(n.common.issues);
2797
+ return new C(s.common.issues);
2798
2798
  },
2799
- input: n.data
2799
+ input: s.data
2800
2800
  })
2801
2801
  };
2802
2802
  }
@@ -2813,11 +2813,11 @@ ve.create = (r, e) => new ve({
2813
2813
  class je extends g {
2814
2814
  _parse(e) {
2815
2815
  if (this._getType(e) !== f.nan) {
2816
- const n = this._getOrReturnCtx(e);
2817
- return l(n, {
2816
+ const s = this._getOrReturnCtx(e);
2817
+ return l(s, {
2818
2818
  code: u.invalid_type,
2819
2819
  expected: f.nan,
2820
- received: n.parsedType
2820
+ received: s.parsedType
2821
2821
  }), y;
2822
2822
  }
2823
2823
  return { status: "valid", value: e.data };
@@ -2830,9 +2830,9 @@ je.create = (r) => new je({
2830
2830
  const Vt = Symbol("zod_brand");
2831
2831
  class Je extends g {
2832
2832
  _parse(e) {
2833
- const { ctx: t } = this._processInputParams(e), n = t.data;
2833
+ const { ctx: t } = this._processInputParams(e), s = t.data;
2834
2834
  return this._def.type._parse({
2835
- data: n,
2835
+ data: s,
2836
2836
  path: t.path,
2837
2837
  parent: t
2838
2838
  });
@@ -2843,33 +2843,33 @@ class Je extends g {
2843
2843
  }
2844
2844
  class xe extends g {
2845
2845
  _parse(e) {
2846
- const { status: t, ctx: n } = this._processInputParams(e);
2847
- if (n.common.async)
2846
+ const { status: t, ctx: s } = this._processInputParams(e);
2847
+ if (s.common.async)
2848
2848
  return (async () => {
2849
2849
  const a = await this._def.in._parseAsync({
2850
- data: n.data,
2851
- path: n.path,
2852
- parent: n
2850
+ data: s.data,
2851
+ path: s.path,
2852
+ parent: s
2853
2853
  });
2854
- return a.status === "aborted" ? y : a.status === "dirty" ? (t.dirty(), X(a.value)) : this._def.out._parseAsync({
2854
+ return a.status === "aborted" ? y : a.status === "dirty" ? (t.dirty(), K(a.value)) : this._def.out._parseAsync({
2855
2855
  data: a.value,
2856
- path: n.path,
2857
- parent: n
2856
+ path: s.path,
2857
+ parent: s
2858
2858
  });
2859
2859
  })();
2860
2860
  {
2861
- const s = this._def.in._parseSync({
2862
- data: n.data,
2863
- path: n.path,
2864
- parent: n
2861
+ const n = this._def.in._parseSync({
2862
+ data: s.data,
2863
+ path: s.path,
2864
+ parent: s
2865
2865
  });
2866
- return s.status === "aborted" ? y : s.status === "dirty" ? (t.dirty(), {
2866
+ return n.status === "aborted" ? y : n.status === "dirty" ? (t.dirty(), {
2867
2867
  status: "dirty",
2868
- value: s.value
2868
+ value: n.value
2869
2869
  }) : this._def.out._parseSync({
2870
- data: s.value,
2871
- path: n.path,
2872
- parent: n
2870
+ data: n.value,
2871
+ path: s.path,
2872
+ parent: s
2873
2873
  });
2874
2874
  }
2875
2875
  }
@@ -2883,8 +2883,8 @@ class xe extends g {
2883
2883
  }
2884
2884
  class ge extends g {
2885
2885
  _parse(e) {
2886
- const t = this._def.innerType._parse(e), n = (s) => (W(s) && (s.value = Object.freeze(s.value)), s);
2887
- return oe(t) ? t.then((s) => n(s)) : n(t);
2886
+ const t = this._def.innerType._parse(e), s = (n) => (q(n) && (n.value = Object.freeze(n.value)), n);
2887
+ return oe(t) ? t.then((n) => s(n)) : s(t);
2888
2888
  }
2889
2889
  unwrap() {
2890
2890
  return this._def.innerType;
@@ -2899,21 +2899,21 @@ function Ye(r, e) {
2899
2899
  const t = typeof r == "function" ? r(e) : typeof r == "string" ? { message: r } : r;
2900
2900
  return typeof t == "string" ? { message: t } : t;
2901
2901
  }
2902
- function nt(r, e = {}, t) {
2903
- return r ? ee.create().superRefine((n, s) => {
2902
+ function st(r, e = {}, t) {
2903
+ return r ? ee.create().superRefine((s, n) => {
2904
2904
  var a, i;
2905
- const o = r(n);
2905
+ const o = r(s);
2906
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 });
2907
+ return o.then((c) => {
2908
+ var d, h;
2909
+ if (!c) {
2910
+ const b = Ye(e, s), Z = (h = (d = b.fatal) !== null && d !== void 0 ? d : t) !== null && h !== void 0 ? h : !0;
2911
+ n.addIssue({ code: "custom", ...b, fatal: Z });
2912
2912
  }
2913
2913
  });
2914
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 });
2915
+ const c = Ye(e, s), d = (i = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0;
2916
+ n.addIssue({ code: "custom", ...c, fatal: d });
2917
2917
  }
2918
2918
  }) : ee.create();
2919
2919
  }
@@ -2926,31 +2926,31 @@ var _;
2926
2926
  })(_ || (_ = {}));
2927
2927
  const zt = (r, e = {
2928
2928
  message: `Input not instance of ${r.name}`
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 = {
2930
- string: (r) => j.create({ ...r, coerce: !0 }),
2929
+ }) => st((t) => t instanceof r, e), nt = O.create, at = V.create, Ut = je.create, Bt = L.create, it = ce.create, Ft = W.create, qt = Ze.create, Wt = de.create, Jt = ue.create, Ht = ee.create, Yt = F.create, Gt = P.create, Kt = Ce.create, Xt = j.create, Qt = k.create, er = k.strictCreate, tr = le.create, rr = Ee.create, sr = fe.create, nr = N.create, ar = he.create, ir = Oe.create, or = J.create, cr = X.create, dr = 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 = () => nt().optional(), gr = () => at().optional(), xr = () => it().optional(), br = {
2930
+ string: (r) => O.create({ ...r, coerce: !0 }),
2931
2931
  number: (r) => V.create({ ...r, coerce: !0 }),
2932
- boolean: (r) => de.create({
2932
+ boolean: (r) => ce.create({
2933
2933
  ...r,
2934
2934
  coerce: !0
2935
2935
  }),
2936
2936
  bigint: (r) => L.create({ ...r, coerce: !0 }),
2937
- date: (r) => q.create({ ...r, coerce: !0 })
2937
+ date: (r) => W.create({ ...r, coerce: !0 })
2938
2938
  }, kr = y;
2939
- var h = /* @__PURE__ */ Object.freeze({
2939
+ var p = /* @__PURE__ */ Object.freeze({
2940
2940
  __proto__: null,
2941
2941
  defaultErrorMap: Q,
2942
2942
  setErrorMap: _t,
2943
- getErrorMap: ke,
2944
- makeIssue: we,
2943
+ getErrorMap: we,
2944
+ makeIssue: Te,
2945
2945
  EMPTY_PATH: yt,
2946
2946
  addIssueToContext: l,
2947
2947
  ParseStatus: T,
2948
2948
  INVALID: y,
2949
- DIRTY: X,
2950
- OK: Z,
2949
+ DIRTY: K,
2950
+ OK: S,
2951
2951
  isAborted: Fe,
2952
- isDirty: We,
2953
- isValid: W,
2952
+ isDirty: qe,
2953
+ isValid: q,
2954
2954
  isAsync: oe,
2955
2955
  get util() {
2956
2956
  return x;
@@ -2962,28 +2962,28 @@ var h = /* @__PURE__ */ Object.freeze({
2962
2962
  getParsedType: $,
2963
2963
  ZodType: g,
2964
2964
  datetimeRegex: tt,
2965
- ZodString: j,
2965
+ ZodString: O,
2966
2966
  ZodNumber: V,
2967
2967
  ZodBigInt: L,
2968
- ZodBoolean: de,
2969
- ZodDate: q,
2968
+ ZodBoolean: ce,
2969
+ ZodDate: W,
2970
2970
  ZodSymbol: Ze,
2971
- ZodUndefined: ce,
2971
+ ZodUndefined: de,
2972
2972
  ZodNull: ue,
2973
2973
  ZodAny: ee,
2974
2974
  ZodUnknown: F,
2975
- ZodNever: M,
2976
- ZodVoid: Oe,
2977
- ZodArray: C,
2975
+ ZodNever: P,
2976
+ ZodVoid: Ce,
2977
+ ZodArray: j,
2978
2978
  ZodObject: k,
2979
2979
  ZodUnion: le,
2980
- ZodDiscriminatedUnion: Ae,
2980
+ ZodDiscriminatedUnion: Ee,
2981
2981
  ZodIntersection: fe,
2982
2982
  ZodTuple: N,
2983
2983
  ZodRecord: he,
2984
- ZodMap: Se,
2984
+ ZodMap: Oe,
2985
2985
  ZodSet: J,
2986
- ZodFunction: K,
2986
+ ZodFunction: X,
2987
2987
  ZodLazy: pe,
2988
2988
  ZodLiteral: me,
2989
2989
  ZodEnum: z,
@@ -3000,7 +3000,7 @@ var h = /* @__PURE__ */ Object.freeze({
3000
3000
  ZodBranded: Je,
3001
3001
  ZodPipeline: xe,
3002
3002
  ZodReadonly: ge,
3003
- custom: nt,
3003
+ custom: st,
3004
3004
  Schema: g,
3005
3005
  ZodSchema: g,
3006
3006
  late: Lt,
@@ -3009,17 +3009,17 @@ var h = /* @__PURE__ */ Object.freeze({
3009
3009
  },
3010
3010
  coerce: br,
3011
3011
  any: Ht,
3012
- array: Kt,
3012
+ array: Xt,
3013
3013
  bigint: Bt,
3014
3014
  boolean: it,
3015
3015
  date: Ft,
3016
3016
  discriminatedUnion: rr,
3017
3017
  effect: Ge,
3018
3018
  enum: lr,
3019
- function: dr,
3019
+ function: cr,
3020
3020
  instanceof: zt,
3021
- intersection: nr,
3022
- lazy: cr,
3021
+ intersection: sr,
3022
+ lazy: dr,
3023
3023
  literal: ur,
3024
3024
  map: ir,
3025
3025
  nan: Ut,
@@ -3039,139 +3039,139 @@ var h = /* @__PURE__ */ Object.freeze({
3039
3039
  record: ar,
3040
3040
  set: or,
3041
3041
  strictObject: er,
3042
- string: st,
3043
- symbol: Wt,
3042
+ string: nt,
3043
+ symbol: qt,
3044
3044
  transformer: Ge,
3045
- tuple: sr,
3046
- undefined: qt,
3045
+ tuple: nr,
3046
+ undefined: Wt,
3047
3047
  union: tr,
3048
3048
  unknown: Yt,
3049
- void: Xt,
3049
+ void: Kt,
3050
3050
  NEVER: kr,
3051
3051
  ZodIssueCode: u,
3052
3052
  quotelessJson: mt,
3053
- ZodError: S
3053
+ ZodError: C
3054
3054
  });
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 } = {}) => {
3057
- const n = /* @__PURE__ */ new Map();
3058
- return (s) => (a, i) => {
3055
+ pt(p);
3056
+ const wr = (r, e) => e.skipDedupe || e.method !== "GET", Tr = (r, e) => e.method + "@" + r, Sr = (r) => r.clone(), Zr = ({ skip: r = wr, key: e = Tr, resolver: t = Sr } = {}) => {
3057
+ const s = /* @__PURE__ */ new Map();
3058
+ return (n) => (a, i) => {
3059
3059
  if (r(a, i))
3060
- return s(a, i);
3060
+ return n(a, i);
3061
3061
  const o = e(a, i);
3062
- if (!n.has(o))
3063
- n.set(o, []);
3062
+ if (!s.has(o))
3063
+ s.set(o, []);
3064
3064
  else
3065
- return new Promise((d, c) => {
3066
- n.get(o).push([d, c]);
3065
+ return new Promise((c, d) => {
3066
+ s.get(o).push([c, d]);
3067
3067
  });
3068
3068
  try {
3069
- return s(a, i).then((d) => (n.get(o).forEach(([c]) => c(t(d))), n.delete(o), d)).catch((d) => {
3070
- throw n.get(o).forEach(([, c]) => c(d)), n.delete(o), d;
3069
+ return n(a, i).then((c) => (s.get(o).forEach(([d]) => d(t(c))), s.delete(o), c)).catch((c) => {
3070
+ throw s.get(o).forEach(([, d]) => d(c)), s.delete(o), c;
3071
3071
  });
3072
- } catch (d) {
3073
- return n.delete(o), Promise.reject(d);
3072
+ } catch (c) {
3073
+ return s.delete(o), Promise.reject(c);
3074
3074
  }
3075
3075
  };
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) => {
3076
+ }, Cr = (r, e) => r * e, Or = (r) => r && r.ok, jr = ({ delayTimer: r = 500, delayRamp: e = Cr, maxAttempts: t = 10, until: s = Or, onRetry: n = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: i = !1, skip: o } = {}) => (c) => (d, h) => {
3077
3077
  let b = 0;
3078
- if (o && o(c, p))
3079
- return d(c, p);
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) => {
3078
+ if (o && o(d, h))
3079
+ return c(d, h);
3080
+ const Z = (w, M) => Promise.resolve(s(w, M)).then((Re) => Re ? w && i ? w : M ? Promise.reject(M) : w : (b++, !t || b <= t ? new Promise((D) => {
3081
3081
  const be = e(r, b);
3082
3082
  setTimeout(() => {
3083
- typeof s == "function" ? Promise.resolve(s({
3083
+ typeof n == "function" ? Promise.resolve(n({
3084
3084
  response: w,
3085
- error: P,
3086
- url: c,
3087
- options: p
3085
+ error: M,
3086
+ url: d,
3087
+ options: h
3088
3088
  })).then((B = {}) => {
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));
3089
+ var re, se;
3090
+ D(c((re = B && B.url) !== null && re !== void 0 ? re : d, (se = B && B.options) !== null && se !== void 0 ? se : h));
3091
+ }) : D(c(d, h));
3092
3092
  }, be);
3093
- }).then(O).catch((D) => {
3093
+ }).then(Z).catch((D) => {
3094
3094
  if (!a)
3095
3095
  throw D;
3096
- return O(null, D);
3097
- }) : w && i ? w : Promise.reject(P || new Error("Number of attempts exceeded."))));
3098
- return d(c, p).then(O).catch((w) => {
3096
+ return Z(null, D);
3097
+ }) : w && i ? w : Promise.reject(M || new Error("Number of attempts exceeded."))));
3098
+ return c(d, h).then(Z).catch((w) => {
3099
3099
  if (!a)
3100
3100
  throw w;
3101
- return O(null, w);
3101
+ return Z(null, w);
3102
3102
  });
3103
- }, Ce = h.object({
3104
- code: h.number(),
3105
- message: h.string()
3106
- }), Ar = h.object({
3107
- message: h.string()
3108
- }), Er = h.object({
3109
- emails: h.array(h.string()).optional(),
3110
- http_body: h.string().optional(),
3111
- http_url: h.string().optional(),
3112
- txt_name: h.string().optional(),
3113
- txt_value: h.string().optional()
3114
- }), Rr = h.object({
3115
- ciphers: h.array(h.string()).optional(),
3116
- early_hints: h.string().optional(),
3117
- http2: h.string().optional(),
3118
- min_tls_version: h.string().optional(),
3119
- tls_1_3: h.string().optional()
3120
- }), Nr = h.object({
3121
- id: h.string(),
3122
- bundle_method: h.string().optional(),
3123
- certificate_authority: h.string(),
3124
- custom_certificate: h.string().optional(),
3125
- custom_csr_id: h.string().optional(),
3126
- custom_key: h.string().optional(),
3127
- expires_on: h.string().optional(),
3128
- hosts: h.array(h.string()).optional(),
3129
- issuer: h.string().optional(),
3130
- method: h.string(),
3131
- serial_number: h.string().optional(),
3103
+ }, Ae = p.object({
3104
+ code: p.number(),
3105
+ message: p.string()
3106
+ }), Ar = p.object({
3107
+ message: p.string()
3108
+ }), Er = p.object({
3109
+ emails: p.array(p.string()).optional(),
3110
+ http_body: p.string().optional(),
3111
+ http_url: p.string().optional(),
3112
+ txt_name: p.string().optional(),
3113
+ txt_value: p.string().optional()
3114
+ }), Rr = p.object({
3115
+ ciphers: p.array(p.string()).optional(),
3116
+ early_hints: p.string().optional(),
3117
+ http2: p.string().optional(),
3118
+ min_tls_version: p.string().optional(),
3119
+ tls_1_3: p.string().optional()
3120
+ }), Nr = p.object({
3121
+ id: p.string(),
3122
+ bundle_method: p.string().optional(),
3123
+ certificate_authority: p.string(),
3124
+ custom_certificate: p.string().optional(),
3125
+ custom_csr_id: p.string().optional(),
3126
+ custom_key: p.string().optional(),
3127
+ expires_on: p.string().optional(),
3128
+ hosts: p.array(p.string()).optional(),
3129
+ issuer: p.string().optional(),
3130
+ method: p.string(),
3131
+ serial_number: p.string().optional(),
3132
3132
  settings: Rr.optional(),
3133
- signature: h.string().optional(),
3134
- type: h.string(),
3135
- uploaded_on: h.string().optional(),
3136
- validation_errors: h.array(Ar).optional(),
3137
- validation_records: h.array(Er).optional(),
3138
- wildcard: h.boolean()
3139
- }), Ir = h.object({
3140
- name: h.string(),
3141
- type: h.string(),
3142
- value: h.string()
3143
- }), $r = h.object({
3144
- http_body: h.string().optional(),
3145
- http_url: h.string().optional()
3146
- }), ot = h.object({
3147
- id: h.string(),
3133
+ signature: p.string().optional(),
3134
+ type: p.string(),
3135
+ uploaded_on: p.string().optional(),
3136
+ validation_errors: p.array(Ar).optional(),
3137
+ validation_records: p.array(Er).optional(),
3138
+ wildcard: p.boolean()
3139
+ }), Ir = p.object({
3140
+ name: p.string(),
3141
+ type: p.string(),
3142
+ value: p.string()
3143
+ }), $r = p.object({
3144
+ http_body: p.string().optional(),
3145
+ http_url: p.string().optional()
3146
+ }), ot = p.object({
3147
+ id: p.string(),
3148
3148
  ssl: Nr,
3149
- hostname: h.string(),
3150
- custom_metadata: h.record(h.string()).optional(),
3151
- custom_origin_server: h.string().optional(),
3152
- custom_origin_sni: h.string().optional(),
3149
+ hostname: p.string(),
3150
+ custom_metadata: p.record(p.string()).optional(),
3151
+ custom_origin_server: p.string().optional(),
3152
+ custom_origin_sni: p.string().optional(),
3153
3153
  ownership_verification: Ir.optional(),
3154
3154
  ownership_verification_http: $r.optional(),
3155
- status: h.string(),
3156
- verification_errors: h.array(h.string()).optional(),
3157
- created_at: h.string()
3158
- }), ze = h.object({
3159
- errors: h.array(Ce),
3160
- messages: h.array(Ce),
3161
- success: h.boolean(),
3155
+ status: p.string(),
3156
+ verification_errors: p.array(p.string()).optional(),
3157
+ created_at: p.string()
3158
+ }), ze = p.object({
3159
+ errors: p.array(Ae),
3160
+ messages: p.array(Ae),
3161
+ success: p.boolean(),
3162
3162
  result: ot
3163
- }), Mr = h.object({
3164
- errors: h.array(Ce),
3165
- messages: h.array(Ce),
3166
- success: h.boolean(),
3167
- result: h.array(ot)
3163
+ }), Pr = p.object({
3164
+ errors: p.array(Ae),
3165
+ messages: p.array(Ae),
3166
+ success: p.boolean(),
3167
+ result: p.array(ot)
3168
3168
  });
3169
3169
  function Y(r) {
3170
3170
  return lt(`https://api.cloudflare.com/client/v4/zones/${r.zoneId}`).headers({
3171
3171
  "X-Auth-Email": r.authEmail,
3172
3172
  "X-Auth-Key": r.authKey,
3173
3173
  "Content-Type": "application/json"
3174
- }).middlewares([Cr(), Or()]);
3174
+ }).middlewares([jr(), Zr()]);
3175
3175
  }
3176
3176
  function Ue(r) {
3177
3177
  const e = [];
@@ -3193,14 +3193,14 @@ function Ue(r) {
3193
3193
  status: r.status === "active" ? "ready" : "pending",
3194
3194
  type: "auth0_managed_certs",
3195
3195
  verification: {
3196
- methods: h.array(ut).parse(e)
3196
+ methods: p.array(ut).parse(e)
3197
3197
  }
3198
3198
  };
3199
3199
  }
3200
- function Pr(r) {
3200
+ function Mr(r) {
3201
3201
  return {
3202
3202
  create: async (e, t) => {
3203
- const { result: n, errors: s, success: a } = ze.parse(
3203
+ const { result: s, errors: n, success: a } = ze.parse(
3204
3204
  await Y(r).post(
3205
3205
  {
3206
3206
  hostname: t.domain,
@@ -3216,9 +3216,9 @@ function Pr(r) {
3216
3216
  ).json()
3217
3217
  );
3218
3218
  if (!a)
3219
- throw new Error(JSON.stringify(s));
3219
+ throw new Error(JSON.stringify(n));
3220
3220
  const i = Ue({
3221
- ...n,
3221
+ ...s,
3222
3222
  primary: !1
3223
3223
  });
3224
3224
  return await r.customDomainAdapter.create(e, {
@@ -3228,77 +3228,147 @@ function Pr(r) {
3228
3228
  }), i;
3229
3229
  },
3230
3230
  get: async (e, t) => {
3231
- var d;
3232
- const n = await r.customDomainAdapter.get(
3231
+ var c;
3232
+ const s = await r.customDomainAdapter.get(
3233
3233
  e,
3234
3234
  t
3235
3235
  );
3236
- if (!n)
3236
+ if (!s)
3237
3237
  throw new H(404);
3238
- const s = await Y(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json(), { result: a, errors: i, success: o } = ze.parse(s);
3238
+ const n = await Y(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json(), { result: a, errors: i, success: o } = ze.parse(n);
3239
3239
  if (!o)
3240
3240
  throw new H(503, {
3241
3241
  message: JSON.stringify(i)
3242
3242
  });
3243
- if (r.enterprise && ((d = a.custom_metadata) == null ? void 0 : d.tenant_id) !== e)
3243
+ if (r.enterprise && ((c = a.custom_metadata) == null ? void 0 : c.tenant_id) !== e)
3244
3244
  throw new H(404);
3245
- return Ue({ ...n, ...a });
3245
+ return Ue({ ...s, ...a });
3246
3246
  },
3247
3247
  getByDomain: async (e) => r.customDomainAdapter.getByDomain(e),
3248
3248
  list: async (e) => {
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);
3249
+ const t = await r.customDomainAdapter.list(e), s = await Y(r).get("/custom_hostnames").json(), { result: n, errors: a, success: i } = Pr.parse(s);
3250
3250
  if (!i)
3251
3251
  throw new H(503, {
3252
3252
  message: JSON.stringify(a)
3253
3253
  });
3254
- return s.filter(
3255
- (o) => t.find((d) => d.custom_domain_id === o.id)
3254
+ return n.filter(
3255
+ (o) => t.find((c) => c.custom_domain_id === o.id)
3256
3256
  ).filter(
3257
3257
  (o) => {
3258
- var d;
3259
- return !(r.enterprise && ((d = o.custom_metadata) == null ? void 0 : d.tenant_id) !== e);
3258
+ var c;
3259
+ return !(r.enterprise && ((c = o.custom_metadata) == null ? void 0 : c.tenant_id) !== e);
3260
3260
  }
3261
3261
  ).map(
3262
3262
  (o) => Ue({
3263
- ...t.find((d) => d.custom_domain_id === o.id),
3263
+ ...t.find((c) => c.custom_domain_id === o.id),
3264
3264
  ...o
3265
3265
  })
3266
3266
  );
3267
3267
  },
3268
3268
  remove: async (e, t) => {
3269
- var s;
3269
+ var n;
3270
3270
  if (r.enterprise) {
3271
3271
  const { result: a, success: i } = ze.parse(
3272
3272
  await Y(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json()
3273
3273
  );
3274
- if (!i || ((s = a.custom_metadata) == null ? void 0 : s.tenant_id) !== e)
3274
+ if (!i || ((n = a.custom_metadata) == null ? void 0 : n.tenant_id) !== e)
3275
3275
  throw new H(404);
3276
3276
  }
3277
- const n = await Y(r).delete(`/custom_hostnames/${encodeURIComponent(t)}`).res();
3278
- return n.ok && await r.customDomainAdapter.remove(e, t), n.ok;
3277
+ const s = await Y(r).delete(`/custom_hostnames/${encodeURIComponent(t)}`).res();
3278
+ return s.ok && await r.customDomainAdapter.remove(e, t), s.ok;
3279
3279
  },
3280
- update: async (e, t, n) => {
3281
- const s = await Y(r).patch(
3282
- n,
3280
+ update: async (e, t, s) => {
3281
+ const n = await Y(r).patch(
3282
+ s,
3283
3283
  `/custom_hostnames/${encodeURIComponent(t)}`
3284
3284
  ).res();
3285
- if (!s.ok)
3285
+ if (!n.ok)
3286
3286
  throw new H(503, {
3287
- message: await s.text()
3287
+ message: await n.text()
3288
3288
  });
3289
3289
  return r.customDomainAdapter.update(
3290
3290
  e,
3291
3291
  t,
3292
- n
3292
+ s
3293
3293
  );
3294
3294
  }
3295
3295
  };
3296
3296
  }
3297
- function zr(r) {
3298
- return {
3299
- customDomains: Pr(r)
3297
+ class Dr {
3298
+ constructor(e) {
3299
+ ke(this, "cache", null);
3300
+ this.config = e;
3301
+ }
3302
+ async getCache() {
3303
+ if (this.cache)
3304
+ return this.cache;
3305
+ if (typeof caches > "u")
3306
+ throw new Error(
3307
+ "caches API is not available - CloudflareCache should only be used in Cloudflare Workers"
3308
+ );
3309
+ return this.config.cacheName ? this.cache = await caches.open(this.config.cacheName) : this.cache = caches.default, this.cache;
3310
+ }
3311
+ getKey(e) {
3312
+ return this.config.keyPrefix ? `${this.config.keyPrefix}:${e}` : e;
3313
+ }
3314
+ createRequest(e) {
3315
+ return new Request(`https://cache.internal/${this.getKey(e)}`);
3316
+ }
3317
+ async get(e) {
3318
+ try {
3319
+ const t = await this.getCache(), s = this.createRequest(e), n = await t.match(s);
3320
+ if (!n)
3321
+ return null;
3322
+ const a = await n.json();
3323
+ return a.expiresAt && new Date(a.expiresAt) < /* @__PURE__ */ new Date() ? (await this.delete(e), null) : a.value;
3324
+ } catch (t) {
3325
+ return console.warn(`Cache get error for key ${e}:`, t), null;
3326
+ }
3327
+ }
3328
+ async set(e, t, s) {
3329
+ try {
3330
+ const n = await this.getCache(), a = s ?? this.config.defaultTtlSeconds, i = a !== void 0, o = i ? Math.max(0, a) : 0, c = {
3331
+ value: t,
3332
+ expiresAt: i ? new Date(Date.now() + (o > 0 ? o * 1e3 : -1)).toISOString() : void 0,
3333
+ cachedAt: (/* @__PURE__ */ new Date()).toISOString()
3334
+ }, d = this.createRequest(e), h = new Response(JSON.stringify(c), {
3335
+ headers: {
3336
+ "Content-Type": "application/json",
3337
+ ...i && o > 0 && { "Cache-Control": `max-age=${o}` }
3338
+ }
3339
+ });
3340
+ await n.put(d, h);
3341
+ } catch (n) {
3342
+ console.warn(`Cache set error for key ${e}:`, n);
3343
+ }
3344
+ }
3345
+ async delete(e) {
3346
+ try {
3347
+ const t = await this.getCache(), s = this.createRequest(e);
3348
+ return await t.delete(s);
3349
+ } catch (t) {
3350
+ return console.warn(`Cache delete error for key ${e}:`, t), !1;
3351
+ }
3352
+ }
3353
+ async clear() {
3354
+ console.warn(
3355
+ "CloudflareCache.clear() is not implemented - Cloudflare Cache API does not support clearing all entries"
3356
+ );
3357
+ }
3358
+ }
3359
+ function Vr(r) {
3360
+ return new Dr(r);
3361
+ }
3362
+ function Br(r) {
3363
+ const e = {
3364
+ customDomains: Mr(r)
3300
3365
  };
3366
+ return (r.cacheName || r.defaultTtlSeconds || r.keyPrefix) && (e.cache = Vr({
3367
+ cacheName: r.cacheName,
3368
+ defaultTtlSeconds: r.defaultTtlSeconds,
3369
+ keyPrefix: r.keyPrefix
3370
+ })), e;
3301
3371
  }
3302
3372
  export {
3303
- zr as default
3373
+ Br as default
3304
3374
  };