@authhero/cloudflare-adapter 2.7.6 → 2.9.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,75 +1,71 @@
1
- var ot = Object.defineProperty;
2
- var ct = (r, e, t) => e in r ? ot(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var we = (r, e, t) => ct(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { verificationMethodsSchema as dt } from "@authhero/adapter-interfaces";
5
- import ut from "wretch";
6
- function lt(r, e) {
1
+ import { verificationMethodsSchema as lt } from "@authhero/adapter-interfaces";
2
+ import ft from "wretch";
3
+ function ht(n, e) {
7
4
  var t = {};
8
- for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && e.indexOf(s) < 0 && (t[s] = r[s]);
9
- if (r != null && typeof Object.getOwnPropertySymbols == "function")
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]]);
5
+ for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
6
+ if (n != null && typeof Object.getOwnPropertySymbols == "function")
7
+ for (var r = 0, s = Object.getOwnPropertySymbols(n); r < s.length; r++)
8
+ e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
12
9
  return t;
13
10
  }
14
- function ft(r, e) {
11
+ function pt(n, e) {
15
12
  var t;
16
- return ((t = r == null ? void 0 : r._def) === null || t === void 0 ? void 0 : t.typeName) === e;
13
+ return ((t = n?._def) === null || t === void 0 ? void 0 : t.typeName) === e;
17
14
  }
18
- function ie(r, e) {
19
- const t = r.ZodType.prototype[e];
20
- r.ZodType.prototype[e] = function(...s) {
21
- const n = t.apply(this, s);
22
- return n._def.openapi = this._def.openapi, n;
15
+ function le(n, e) {
16
+ const t = n.ZodType.prototype[e];
17
+ n.ZodType.prototype[e] = function(...s) {
18
+ const r = t.apply(this, s);
19
+ return r._def.openapi = this._def.openapi, r;
23
20
  };
24
21
  }
25
- function ht(r) {
26
- if (typeof r.ZodType.prototype.openapi < "u")
22
+ function mt(n) {
23
+ if (typeof n.ZodType.prototype.openapi < "u")
27
24
  return;
28
- r.ZodType.prototype.openapi = function(n, a) {
29
- var i, o, c, u, p, b;
30
- const A = typeof n == "string" ? a : n, w = A ?? {}, { param: V } = w, Ze = lt(w, ["param"]), L = 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), Ze), !((u = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || u === void 0) && u.param || V ? {
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), V)
32
- } : void 0), q = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(L).length > 0 ? { _internal: L } : void 0), Object.keys(be).length > 0 ? { metadata: be } : void 0) }));
33
- if (ft(this, "ZodObject")) {
34
- const ne = this.extend;
35
- q.extend = function(...ae) {
36
- var Ee, Ie, $e, Pe, Me, De, Ve;
37
- const Le = ne.apply(this, ae);
38
- return Le._def.openapi = {
25
+ n.ZodType.prototype.openapi = function(r, a) {
26
+ var i, o, c, d, p, b;
27
+ const C = typeof r == "string" ? a : r, w = C ?? {}, { param: I } = w, de = ht(w, ["param"]), M = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof r == "string" ? { refId: r } : void 0), W = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), de), !((d = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || d === void 0) && d.param || I ? {
28
+ 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), I)
29
+ } : void 0), D = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(M).length > 0 ? { _internal: M } : void 0), Object.keys(W).length > 0 ? { metadata: W } : void 0) }));
30
+ if (pt(this, "ZodObject")) {
31
+ const ee = this.extend;
32
+ D.extend = function(...G) {
33
+ var J, ue, Pe, Me, De, Le, Ve;
34
+ const Ue = ee.apply(this, G);
35
+ return Ue._def.openapi = {
39
36
  _internal: {
40
- extendedFrom: !((Ie = (Ee = this._def.openapi) === null || Ee === void 0 ? void 0 : Ee._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 } : (De = (Me = this._def.openapi) === null || Me === void 0 ? void 0 : Me._internal) === null || De === void 0 ? void 0 : De.extendedFrom
37
+ extendedFrom: !((ue = (J = this._def.openapi) === null || J === void 0 ? void 0 : J._internal) === null || ue === void 0) && ue.refId ? { refId: (Me = (Pe = this._def.openapi) === null || Pe === void 0 ? void 0 : Pe._internal) === null || Me === void 0 ? void 0 : Me.refId, schema: this } : (Le = (De = this._def.openapi) === null || De === void 0 ? void 0 : De._internal) === null || Le === void 0 ? void 0 : Le.extendedFrom
41
38
  },
42
- metadata: (Ve = Le._def.openapi) === null || Ve === void 0 ? void 0 : Ve.metadata
43
- }, Le;
39
+ metadata: (Ve = Ue._def.openapi) === null || Ve === void 0 ? void 0 : Ve.metadata
40
+ }, Ue;
44
41
  };
45
42
  }
46
- return q;
47
- }, ie(r, "optional"), ie(r, "nullable"), ie(r, "default"), ie(r, "transform"), ie(r, "refine");
48
- const e = r.ZodObject.prototype.deepPartial;
49
- r.ZodObject.prototype.deepPartial = function() {
50
- const n = this._def.shape(), a = e.apply(this), i = a._def.shape();
43
+ return D;
44
+ }, le(n, "optional"), le(n, "nullable"), le(n, "default"), le(n, "transform"), le(n, "refine");
45
+ const e = n.ZodObject.prototype.deepPartial;
46
+ n.ZodObject.prototype.deepPartial = function() {
47
+ const r = this._def.shape(), a = e.apply(this), i = a._def.shape();
51
48
  return Object.entries(i).forEach(([o, c]) => {
52
- var u, p;
53
- c._def.openapi = (p = (u = n[o]) === null || u === void 0 ? void 0 : u._def) === null || p === void 0 ? void 0 : p.openapi;
49
+ var d, p;
50
+ c._def.openapi = (p = (d = r[o]) === null || d === void 0 ? void 0 : d._def) === null || p === void 0 ? void 0 : p.openapi;
54
51
  }), a._def.openapi = void 0, a;
55
52
  };
56
- const t = r.ZodObject.prototype.pick;
57
- r.ZodObject.prototype.pick = function(...n) {
58
- const a = t.apply(this, n);
53
+ const t = n.ZodObject.prototype.pick;
54
+ n.ZodObject.prototype.pick = function(...r) {
55
+ const a = t.apply(this, r);
59
56
  return a._def.openapi = void 0, a;
60
57
  };
61
- const s = r.ZodObject.prototype.omit;
62
- r.ZodObject.prototype.omit = function(...n) {
63
- const a = s.apply(this, n);
58
+ const s = n.ZodObject.prototype.omit;
59
+ n.ZodObject.prototype.omit = function(...r) {
60
+ const a = s.apply(this, r);
64
61
  return a._def.openapi = void 0, a;
65
62
  };
66
63
  }
67
- var G = class extends Error {
68
- constructor(e = 500, t) {
69
- super(t == null ? void 0 : t.message, { cause: t == null ? void 0 : t.cause });
70
- we(this, "res");
71
- we(this, "status");
72
- this.res = t == null ? void 0 : t.res, this.status = e;
64
+ var te = class extends Error {
65
+ res;
66
+ status;
67
+ constructor(n = 500, e) {
68
+ super(e?.message, { cause: e?.cause }), this.res = e?.res, this.status = n;
73
69
  }
74
70
  getResponse() {
75
71
  return this.res ? new Response(this.res.body, {
@@ -82,50 +78,50 @@ var G = class extends Error {
82
78
  };
83
79
  new Set(".\\+*[^]$()");
84
80
  var x;
85
- (function(r) {
86
- r.assertEqual = (n) => {
81
+ (function(n) {
82
+ n.assertEqual = (r) => {
87
83
  };
88
- function e(n) {
84
+ function e(r) {
89
85
  }
90
- r.assertIs = e;
91
- function t(n) {
86
+ n.assertIs = e;
87
+ function t(r) {
92
88
  throw new Error();
93
89
  }
94
- r.assertNever = t, r.arrayToEnum = (n) => {
90
+ n.assertNever = t, n.arrayToEnum = (r) => {
95
91
  const a = {};
96
- for (const i of n)
92
+ for (const i of r)
97
93
  a[i] = i;
98
94
  return a;
99
- }, r.getValidEnumValues = (n) => {
100
- const a = r.objectKeys(n).filter((o) => typeof n[n[o]] != "number"), i = {};
95
+ }, n.getValidEnumValues = (r) => {
96
+ const a = n.objectKeys(r).filter((o) => typeof r[r[o]] != "number"), i = {};
101
97
  for (const o of a)
102
- i[o] = n[o];
103
- return r.objectValues(i);
104
- }, r.objectValues = (n) => r.objectKeys(n).map(function(a) {
105
- return n[a];
106
- }), r.objectKeys = typeof Object.keys == "function" ? (n) => Object.keys(n) : (n) => {
98
+ i[o] = r[o];
99
+ return n.objectValues(i);
100
+ }, n.objectValues = (r) => n.objectKeys(r).map(function(a) {
101
+ return r[a];
102
+ }), n.objectKeys = typeof Object.keys == "function" ? (r) => Object.keys(r) : (r) => {
107
103
  const a = [];
108
- for (const i in n)
109
- Object.prototype.hasOwnProperty.call(n, i) && a.push(i);
104
+ for (const i in r)
105
+ Object.prototype.hasOwnProperty.call(r, i) && a.push(i);
110
106
  return a;
111
- }, r.find = (n, a) => {
112
- for (const i of n)
107
+ }, n.find = (r, a) => {
108
+ for (const i of r)
113
109
  if (a(i))
114
110
  return i;
115
- }, r.isInteger = typeof Number.isInteger == "function" ? (n) => Number.isInteger(n) : (n) => typeof n == "number" && Number.isFinite(n) && Math.floor(n) === n;
116
- function s(n, a = " | ") {
117
- return n.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
111
+ }, n.isInteger = typeof Number.isInteger == "function" ? (r) => Number.isInteger(r) : (r) => typeof r == "number" && Number.isFinite(r) && Math.floor(r) === r;
112
+ function s(r, a = " | ") {
113
+ return r.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
118
114
  }
119
- r.joinValues = s, r.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
115
+ n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
120
116
  })(x || (x = {}));
121
- var Fe;
122
- (function(r) {
123
- r.mergeShapes = (e, t) => ({
117
+ var qe;
118
+ (function(n) {
119
+ n.mergeShapes = (e, t) => ({
124
120
  ...e,
125
121
  ...t
126
122
  // second overwrites first
127
123
  });
128
- })(Fe || (Fe = {}));
124
+ })(qe || (qe = {}));
129
125
  const f = x.arrayToEnum([
130
126
  "string",
131
127
  "nan",
@@ -147,14 +143,14 @@ const f = x.arrayToEnum([
147
143
  "never",
148
144
  "map",
149
145
  "set"
150
- ]), M = (r) => {
151
- switch (typeof r) {
146
+ ]), V = (n) => {
147
+ switch (typeof n) {
152
148
  case "undefined":
153
149
  return f.undefined;
154
150
  case "string":
155
151
  return f.string;
156
152
  case "number":
157
- return Number.isNaN(r) ? f.nan : f.number;
153
+ return Number.isNaN(n) ? f.nan : f.number;
158
154
  case "boolean":
159
155
  return f.boolean;
160
156
  case "function":
@@ -164,11 +160,11 @@ const f = x.arrayToEnum([
164
160
  case "symbol":
165
161
  return f.symbol;
166
162
  case "object":
167
- return Array.isArray(r) ? f.array : r === null ? f.null : r.then && typeof r.then == "function" && r.catch && typeof r.catch == "function" ? f.promise : typeof Map < "u" && r instanceof Map ? f.map : typeof Set < "u" && r instanceof Set ? f.set : typeof Date < "u" && r instanceof Date ? f.date : f.object;
163
+ return Array.isArray(n) ? f.array : n === null ? f.null : n.then && typeof n.then == "function" && n.catch && typeof n.catch == "function" ? f.promise : typeof Map < "u" && n instanceof Map ? f.map : typeof Set < "u" && n instanceof Set ? f.set : typeof Date < "u" && n instanceof Date ? f.date : f.object;
168
164
  default:
169
165
  return f.unknown;
170
166
  }
171
- }, d = x.arrayToEnum([
167
+ }, u = x.arrayToEnum([
172
168
  "invalid_type",
173
169
  "invalid_literal",
174
170
  "custom",
@@ -185,8 +181,8 @@ const f = x.arrayToEnum([
185
181
  "invalid_intersection_types",
186
182
  "not_multiple_of",
187
183
  "not_finite"
188
- ]), pt = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
189
- class S extends Error {
184
+ ]), yt = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
185
+ class A extends Error {
190
186
  get errors() {
191
187
  return this.issues;
192
188
  }
@@ -202,28 +198,28 @@ class S extends Error {
202
198
  format(e) {
203
199
  const t = e || function(a) {
204
200
  return a.message;
205
- }, s = { _errors: [] }, n = (a) => {
201
+ }, s = { _errors: [] }, r = (a) => {
206
202
  for (const i of a.issues)
207
203
  if (i.code === "invalid_union")
208
- i.unionErrors.map(n);
204
+ i.unionErrors.map(r);
209
205
  else if (i.code === "invalid_return_type")
210
- n(i.returnTypeError);
206
+ r(i.returnTypeError);
211
207
  else if (i.code === "invalid_arguments")
212
- n(i.argumentsError);
208
+ r(i.argumentsError);
213
209
  else if (i.path.length === 0)
214
210
  s._errors.push(t(i));
215
211
  else {
216
212
  let o = s, c = 0;
217
213
  for (; c < i.path.length; ) {
218
- const u = i.path[c];
219
- c === i.path.length - 1 ? (o[u] = o[u] || { _errors: [] }, o[u]._errors.push(t(i))) : o[u] = o[u] || { _errors: [] }, o = o[u], c++;
214
+ const d = i.path[c];
215
+ 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++;
220
216
  }
221
217
  }
222
218
  };
223
- return n(this), s;
219
+ return r(this), s;
224
220
  }
225
221
  static assert(e) {
226
- if (!(e instanceof S))
222
+ if (!(e instanceof A))
227
223
  throw new Error(`Not a ZodError: ${e}`);
228
224
  }
229
225
  toString() {
@@ -237,120 +233,120 @@ class S extends Error {
237
233
  }
238
234
  flatten(e = (t) => t.message) {
239
235
  const t = {}, s = [];
240
- for (const n of this.issues)
241
- if (n.path.length > 0) {
242
- const a = n.path[0];
243
- t[a] = t[a] || [], t[a].push(e(n));
236
+ for (const r of this.issues)
237
+ if (r.path.length > 0) {
238
+ const a = r.path[0];
239
+ t[a] = t[a] || [], t[a].push(e(r));
244
240
  } else
245
- s.push(e(n));
241
+ s.push(e(r));
246
242
  return { formErrors: s, fieldErrors: t };
247
243
  }
248
244
  get formErrors() {
249
245
  return this.flatten();
250
246
  }
251
247
  }
252
- S.create = (r) => new S(r);
253
- const te = (r, e) => {
248
+ A.create = (n) => new A(n);
249
+ const ie = (n, e) => {
254
250
  let t;
255
- switch (r.code) {
256
- case d.invalid_type:
257
- r.received === f.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
251
+ switch (n.code) {
252
+ case u.invalid_type:
253
+ n.received === f.undefined ? t = "Required" : t = `Expected ${n.expected}, received ${n.received}`;
258
254
  break;
259
- case d.invalid_literal:
260
- t = `Invalid literal value, expected ${JSON.stringify(r.expected, x.jsonStringifyReplacer)}`;
255
+ case u.invalid_literal:
256
+ t = `Invalid literal value, expected ${JSON.stringify(n.expected, x.jsonStringifyReplacer)}`;
261
257
  break;
262
- case d.unrecognized_keys:
263
- t = `Unrecognized key(s) in object: ${x.joinValues(r.keys, ", ")}`;
258
+ case u.unrecognized_keys:
259
+ t = `Unrecognized key(s) in object: ${x.joinValues(n.keys, ", ")}`;
264
260
  break;
265
- case d.invalid_union:
261
+ case u.invalid_union:
266
262
  t = "Invalid input";
267
263
  break;
268
- case d.invalid_union_discriminator:
269
- t = `Invalid discriminator value. Expected ${x.joinValues(r.options)}`;
264
+ case u.invalid_union_discriminator:
265
+ t = `Invalid discriminator value. Expected ${x.joinValues(n.options)}`;
270
266
  break;
271
- case d.invalid_enum_value:
272
- t = `Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;
267
+ case u.invalid_enum_value:
268
+ t = `Invalid enum value. Expected ${x.joinValues(n.options)}, received '${n.received}'`;
273
269
  break;
274
- case d.invalid_arguments:
270
+ case u.invalid_arguments:
275
271
  t = "Invalid function arguments";
276
272
  break;
277
- case d.invalid_return_type:
273
+ case u.invalid_return_type:
278
274
  t = "Invalid function return type";
279
275
  break;
280
- case d.invalid_date:
276
+ case u.invalid_date:
281
277
  t = "Invalid date";
282
278
  break;
283
- case d.invalid_string:
284
- typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : x.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
279
+ case u.invalid_string:
280
+ typeof n.validation == "object" ? "includes" in n.validation ? (t = `Invalid input: must include "${n.validation.includes}"`, typeof n.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${n.validation.position}`)) : "startsWith" in n.validation ? t = `Invalid input: must start with "${n.validation.startsWith}"` : "endsWith" in n.validation ? t = `Invalid input: must end with "${n.validation.endsWith}"` : x.assertNever(n.validation) : n.validation !== "regex" ? t = `Invalid ${n.validation}` : t = "Invalid";
285
281
  break;
286
- case d.too_small:
287
- r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "bigint" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
282
+ case u.too_small:
283
+ n.type === "array" ? t = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "more than"} ${n.minimum} element(s)` : n.type === "string" ? t = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "over"} ${n.minimum} character(s)` : n.type === "number" ? t = `Number must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${n.minimum}` : n.type === "bigint" ? t = `Number must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${n.minimum}` : n.type === "date" ? t = `Date must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(n.minimum))}` : t = "Invalid input";
288
284
  break;
289
- case d.too_big:
290
- r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "bigint" ? t = `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r.maximum))}` : t = "Invalid input";
285
+ case u.too_big:
286
+ n.type === "array" ? t = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at most" : "less than"} ${n.maximum} element(s)` : n.type === "string" ? t = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at most" : "under"} ${n.maximum} character(s)` : n.type === "number" ? t = `Number must be ${n.exact ? "exactly" : n.inclusive ? "less than or equal to" : "less than"} ${n.maximum}` : n.type === "bigint" ? t = `BigInt must be ${n.exact ? "exactly" : n.inclusive ? "less than or equal to" : "less than"} ${n.maximum}` : n.type === "date" ? t = `Date must be ${n.exact ? "exactly" : n.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(n.maximum))}` : t = "Invalid input";
291
287
  break;
292
- case d.custom:
288
+ case u.custom:
293
289
  t = "Invalid input";
294
290
  break;
295
- case d.invalid_intersection_types:
291
+ case u.invalid_intersection_types:
296
292
  t = "Intersection results could not be merged";
297
293
  break;
298
- case d.not_multiple_of:
299
- t = `Number must be a multiple of ${r.multipleOf}`;
294
+ case u.not_multiple_of:
295
+ t = `Number must be a multiple of ${n.multipleOf}`;
300
296
  break;
301
- case d.not_finite:
297
+ case u.not_finite:
302
298
  t = "Number must be finite";
303
299
  break;
304
300
  default:
305
- t = e.defaultError, x.assertNever(r);
301
+ t = e.defaultError, x.assertNever(n);
306
302
  }
307
303
  return { message: t };
308
304
  };
309
- let Qe = te;
310
- function mt(r) {
311
- Qe = r;
305
+ let nt = ie;
306
+ function _t(n) {
307
+ nt = n;
312
308
  }
313
- function Te() {
314
- return Qe;
309
+ function Ae() {
310
+ return nt;
315
311
  }
316
- const Ce = (r) => {
317
- const { data: e, path: t, errorMaps: s, issueData: n } = r, a = [...t, ...n.path || []], i = {
318
- ...n,
312
+ const Oe = (n) => {
313
+ const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], i = {
314
+ ...r,
319
315
  path: a
320
316
  };
321
- if (n.message !== void 0)
317
+ if (r.message !== void 0)
322
318
  return {
323
- ...n,
319
+ ...r,
324
320
  path: a,
325
- message: n.message
321
+ message: r.message
326
322
  };
327
323
  let o = "";
328
- const c = s.filter((u) => !!u).slice().reverse();
329
- for (const u of c)
330
- o = u(i, { data: e, defaultError: o }).message;
324
+ const c = s.filter((d) => !!d).slice().reverse();
325
+ for (const d of c)
326
+ o = d(i, { data: e, defaultError: o }).message;
331
327
  return {
332
- ...n,
328
+ ...r,
333
329
  path: a,
334
330
  message: o
335
331
  };
336
- }, yt = [];
337
- function l(r, e) {
338
- const t = Te(), s = Ce({
332
+ }, gt = [];
333
+ function l(n, e) {
334
+ const t = Ae(), s = Oe({
339
335
  issueData: e,
340
- data: r.data,
341
- path: r.path,
336
+ data: n.data,
337
+ path: n.path,
342
338
  errorMaps: [
343
- r.common.contextualErrorMap,
339
+ n.common.contextualErrorMap,
344
340
  // contextual error map is first priority
345
- r.schemaErrorMap,
341
+ n.schemaErrorMap,
346
342
  // then schema-bound map if available
347
343
  t,
348
344
  // then global override map
349
- t === te ? void 0 : te
345
+ t === ie ? void 0 : ie
350
346
  // then global default map
351
- ].filter((n) => !!n)
347
+ ].filter((r) => !!r)
352
348
  });
353
- r.common.issues.push(s);
349
+ n.common.issues.push(s);
354
350
  }
355
351
  class T {
356
352
  constructor() {
@@ -364,17 +360,17 @@ class T {
364
360
  }
365
361
  static mergeArray(e, t) {
366
362
  const s = [];
367
- for (const n of t) {
368
- if (n.status === "aborted")
363
+ for (const r of t) {
364
+ if (r.status === "aborted")
369
365
  return m;
370
- n.status === "dirty" && e.dirty(), s.push(n.value);
366
+ r.status === "dirty" && e.dirty(), s.push(r.value);
371
367
  }
372
368
  return { status: e.value, value: s };
373
369
  }
374
370
  static async mergeObjectAsync(e, t) {
375
371
  const s = [];
376
- for (const n of t) {
377
- const a = await n.key, i = await n.value;
372
+ for (const r of t) {
373
+ const a = await r.key, i = await r.value;
378
374
  s.push({
379
375
  key: a,
380
376
  value: i
@@ -384,68 +380,68 @@ class T {
384
380
  }
385
381
  static mergeObjectSync(e, t) {
386
382
  const s = {};
387
- for (const n of t) {
388
- const { key: a, value: i } = n;
383
+ for (const r of t) {
384
+ const { key: a, value: i } = r;
389
385
  if (a.status === "aborted" || i.status === "aborted")
390
386
  return m;
391
- 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
+ a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || r.alwaysSet) && (s[a.value] = i.value);
392
388
  }
393
389
  return { status: e.value, value: s };
394
390
  }
395
391
  }
396
392
  const m = Object.freeze({
397
393
  status: "aborted"
398
- }), Q = (r) => ({ status: "dirty", value: r }), C = (r) => ({ status: "valid", value: r }), qe = (r) => r.status === "aborted", We = (r) => r.status === "dirty", J = (r) => r.status === "valid", oe = (r) => typeof Promise < "u" && r instanceof Promise;
394
+ }), re = (n) => ({ status: "dirty", value: n }), S = (n) => ({ status: "valid", value: n }), He = (n) => n.status === "aborted", We = (n) => n.status === "dirty", Q = (n) => n.status === "valid", fe = (n) => typeof Promise < "u" && n instanceof Promise;
399
395
  var h;
400
- (function(r) {
401
- r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
396
+ (function(n) {
397
+ n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e?.message;
402
398
  })(h || (h = {}));
403
- class I {
404
- constructor(e, t, s, n) {
405
- this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
399
+ class $ {
400
+ constructor(e, t, s, r) {
401
+ this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
406
402
  }
407
403
  get path() {
408
404
  return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
409
405
  }
410
406
  }
411
- const Ge = (r, e) => {
412
- if (J(e))
407
+ const Ye = (n, e) => {
408
+ if (Q(e))
413
409
  return { success: !0, data: e.value };
414
- if (!r.common.issues.length)
410
+ if (!n.common.issues.length)
415
411
  throw new Error("Validation failed but no issues detected.");
416
412
  return {
417
413
  success: !1,
418
414
  get error() {
419
415
  if (this._error)
420
416
  return this._error;
421
- const t = new S(r.common.issues);
417
+ const t = new A(n.common.issues);
422
418
  return this._error = t, this._error;
423
419
  }
424
420
  };
425
421
  };
426
- function _(r) {
427
- if (!r)
422
+ function _(n) {
423
+ if (!n)
428
424
  return {};
429
- const { errorMap: e, invalid_type_error: t, required_error: s, description: n } = r;
425
+ const { errorMap: e, invalid_type_error: t, required_error: s, description: r } = n;
430
426
  if (e && (t || s))
431
427
  throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
432
- return e ? { errorMap: e, description: n } : { errorMap: (i, o) => {
433
- const { message: c } = r;
428
+ return e ? { errorMap: e, description: r } : { errorMap: (i, o) => {
429
+ const { message: c } = n;
434
430
  return i.code === "invalid_enum_value" ? { message: c ?? o.defaultError } : typeof o.data > "u" ? { message: c ?? s ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: c ?? t ?? o.defaultError };
435
- }, description: n };
431
+ }, description: r };
436
432
  }
437
433
  class v {
438
434
  get description() {
439
435
  return this._def.description;
440
436
  }
441
437
  _getType(e) {
442
- return M(e.data);
438
+ return V(e.data);
443
439
  }
444
440
  _getOrReturnCtx(e, t) {
445
441
  return t || {
446
442
  common: e.parent.common,
447
443
  data: e.data,
448
- parsedType: M(e.data),
444
+ parsedType: V(e.data),
449
445
  schemaErrorMap: this._def.errorMap,
450
446
  path: e.path,
451
447
  parent: e.parent
@@ -457,7 +453,7 @@ class v {
457
453
  ctx: {
458
454
  common: e.parent.common,
459
455
  data: e.data,
460
- parsedType: M(e.data),
456
+ parsedType: V(e.data),
461
457
  schemaErrorMap: this._def.errorMap,
462
458
  path: e.path,
463
459
  parent: e.parent
@@ -466,7 +462,7 @@ class v {
466
462
  }
467
463
  _parseSync(e) {
468
464
  const t = this._parse(e);
469
- if (oe(t))
465
+ if (fe(t))
470
466
  throw new Error("Synchronous parse encountered promise.");
471
467
  return t;
472
468
  }
@@ -484,19 +480,18 @@ class v {
484
480
  const s = {
485
481
  common: {
486
482
  issues: [],
487
- async: (t == null ? void 0 : t.async) ?? !1,
488
- contextualErrorMap: t == null ? void 0 : t.errorMap
483
+ async: t?.async ?? !1,
484
+ contextualErrorMap: t?.errorMap
489
485
  },
490
- path: (t == null ? void 0 : t.path) || [],
486
+ path: t?.path || [],
491
487
  schemaErrorMap: this._def.errorMap,
492
488
  parent: null,
493
489
  data: e,
494
- parsedType: M(e)
495
- }, n = this._parseSync({ data: e, path: s.path, parent: s });
496
- return Ge(s, n);
490
+ parsedType: V(e)
491
+ }, r = this._parseSync({ data: e, path: s.path, parent: s });
492
+ return Ye(s, r);
497
493
  }
498
494
  "~validate"(e) {
499
- var s, n;
500
495
  const t = {
501
496
  common: {
502
497
  issues: [],
@@ -506,24 +501,24 @@ class v {
506
501
  schemaErrorMap: this._def.errorMap,
507
502
  parent: null,
508
503
  data: e,
509
- parsedType: M(e)
504
+ parsedType: V(e)
510
505
  };
511
506
  if (!this["~standard"].async)
512
507
  try {
513
- const a = this._parseSync({ data: e, path: [], parent: t });
514
- return J(a) ? {
515
- value: a.value
508
+ const s = this._parseSync({ data: e, path: [], parent: t });
509
+ return Q(s) ? {
510
+ value: s.value
516
511
  } : {
517
512
  issues: t.common.issues
518
513
  };
519
- } catch (a) {
520
- (n = (s = a == null ? void 0 : a.message) == null ? void 0 : s.toLowerCase()) != null && n.includes("encountered") && (this["~standard"].async = !0), t.common = {
514
+ } catch (s) {
515
+ s?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), t.common = {
521
516
  issues: [],
522
517
  async: !0
523
518
  };
524
519
  }
525
- return this._parseAsync({ data: e, path: [], parent: t }).then((a) => J(a) ? {
526
- value: a.value
520
+ return this._parseAsync({ data: e, path: [], parent: t }).then((s) => Q(s) ? {
521
+ value: s.value
527
522
  } : {
528
523
  issues: t.common.issues
529
524
  });
@@ -538,32 +533,32 @@ class v {
538
533
  const s = {
539
534
  common: {
540
535
  issues: [],
541
- contextualErrorMap: t == null ? void 0 : t.errorMap,
536
+ contextualErrorMap: t?.errorMap,
542
537
  async: !0
543
538
  },
544
- path: (t == null ? void 0 : t.path) || [],
539
+ path: t?.path || [],
545
540
  schemaErrorMap: this._def.errorMap,
546
541
  parent: null,
547
542
  data: e,
548
- parsedType: M(e)
549
- }, n = this._parse({ data: e, path: s.path, parent: s }), a = await (oe(n) ? n : Promise.resolve(n));
550
- return Ge(s, a);
543
+ parsedType: V(e)
544
+ }, r = this._parse({ data: e, path: s.path, parent: s }), a = await (fe(r) ? r : Promise.resolve(r));
545
+ return Ye(s, a);
551
546
  }
552
547
  refine(e, t) {
553
- const s = (n) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(n) : t;
554
- return this._refinement((n, a) => {
555
- const i = e(n), o = () => a.addIssue({
556
- code: d.custom,
557
- ...s(n)
548
+ const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
549
+ return this._refinement((r, a) => {
550
+ const i = e(r), o = () => a.addIssue({
551
+ code: u.custom,
552
+ ...s(r)
558
553
  });
559
554
  return typeof Promise < "u" && i instanceof Promise ? i.then((c) => c ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
560
555
  });
561
556
  }
562
557
  refinement(e, t) {
563
- return this._refinement((s, n) => e(s) ? !0 : (n.addIssue(typeof t == "function" ? t(s, n) : t), !1));
558
+ return this._refinement((s, r) => e(s) ? !0 : (r.addIssue(typeof t == "function" ? t(s, r) : t), !1));
564
559
  }
565
560
  _refinement(e) {
566
- return new N({
561
+ return new R({
567
562
  schema: this,
568
563
  typeName: y.ZodEffects,
569
564
  effect: { type: "refinement", refinement: e }
@@ -580,28 +575,28 @@ class v {
580
575
  };
581
576
  }
582
577
  optional() {
583
- return E.create(this, this._def);
578
+ return Z.create(this, this._def);
584
579
  }
585
580
  nullable() {
586
- return F.create(this, this._def);
581
+ return H.create(this, this._def);
587
582
  }
588
583
  nullish() {
589
584
  return this.nullable().optional();
590
585
  }
591
586
  array() {
592
- return R.create(this);
587
+ return E.create(this);
593
588
  }
594
589
  promise() {
595
- return se.create(this, this._def);
590
+ return ce.create(this, this._def);
596
591
  }
597
592
  or(e) {
598
- return le.create([this, e], this._def);
593
+ return ye.create([this, e], this._def);
599
594
  }
600
595
  and(e) {
601
- return fe.create(this, e, this._def);
596
+ return _e.create(this, e, this._def);
602
597
  }
603
598
  transform(e) {
604
- return new N({
599
+ return new R({
605
600
  ..._(this._def),
606
601
  schema: this,
607
602
  typeName: y.ZodEffects,
@@ -610,7 +605,7 @@ class v {
610
605
  }
611
606
  default(e) {
612
607
  const t = typeof e == "function" ? e : () => e;
613
- return new _e({
608
+ return new ke({
614
609
  ..._(this._def),
615
610
  innerType: this,
616
611
  defaultValue: t,
@@ -618,7 +613,7 @@ class v {
618
613
  });
619
614
  }
620
615
  brand() {
621
- return new He({
616
+ return new Ke({
622
617
  typeName: y.ZodBranded,
623
618
  type: this,
624
619
  ..._(this._def)
@@ -626,7 +621,7 @@ class v {
626
621
  }
627
622
  catch(e) {
628
623
  const t = typeof e == "function" ? e : () => e;
629
- return new ge({
624
+ return new we({
630
625
  ..._(this._def),
631
626
  innerType: this,
632
627
  catchValue: t,
@@ -641,10 +636,10 @@ class v {
641
636
  });
642
637
  }
643
638
  pipe(e) {
644
- return xe.create(this, e);
639
+ return Se.create(this, e);
645
640
  }
646
641
  readonly() {
647
- return ve.create(this);
642
+ return Te.create(this);
648
643
  }
649
644
  isOptional() {
650
645
  return this.safeParse(void 0).success;
@@ -653,58 +648,58 @@ class v {
653
648
  return this.safeParse(null).success;
654
649
  }
655
650
  }
656
- const _t = /^c[^\s-]{8,}$/i, gt = /^[0-9a-z]+$/, vt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, xt = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, kt = /^[a-z0-9_-]{21}$/i, bt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, wt = /^[-+]?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)?)??$/, Tt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ct = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
657
- let ze;
658
- 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])$/, 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])$/, 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]))$/, 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]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Rt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Nt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, et = "((\\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])))", Zt = new RegExp(`^${et}$`);
659
- function tt(r) {
651
+ const vt = /^c[^\s-]{8,}$/i, xt = /^[0-9a-z]+$/, bt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, kt = /^[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, wt = /^[a-z0-9_-]{21}$/i, Tt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, St = /^[-+]?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)?)??$/, Ct = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, At = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
652
+ let Be;
653
+ const 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])$/, Nt = /^(?:(?: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])$/, Et = /^(([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]))$/, Rt = /^(([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])$/, jt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, It = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, st = "((\\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])))", Zt = new RegExp(`^${st}$`);
654
+ function rt(n) {
660
655
  let e = "[0-5]\\d";
661
- r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`);
662
- const t = r.precision ? "+" : "?";
656
+ n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`);
657
+ const t = n.precision ? "+" : "?";
663
658
  return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
664
659
  }
665
- function Et(r) {
666
- return new RegExp(`^${tt(r)}$`);
660
+ function $t(n) {
661
+ return new RegExp(`^${rt(n)}$`);
667
662
  }
668
- function rt(r) {
669
- let e = `${et}T${tt(r)}`;
663
+ function at(n) {
664
+ let e = `${st}T${rt(n)}`;
670
665
  const t = [];
671
- return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
666
+ return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
672
667
  }
673
- function It(r, e) {
674
- return !!((e === "v4" || !e) && St.test(r) || (e === "v6" || !e) && At.test(r));
668
+ function Pt(n, e) {
669
+ return !!((e === "v4" || !e) && Ot.test(n) || (e === "v6" || !e) && Et.test(n));
675
670
  }
676
- function $t(r, e) {
677
- if (!bt.test(r))
671
+ function Mt(n, e) {
672
+ if (!Tt.test(n))
678
673
  return !1;
679
674
  try {
680
- const [t] = r.split(".");
675
+ const [t] = n.split(".");
681
676
  if (!t)
682
677
  return !1;
683
- const s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), n = JSON.parse(atob(s));
684
- return !(typeof n != "object" || n === null || "typ" in n && (n == null ? void 0 : n.typ) !== "JWT" || !n.alg || e && n.alg !== e);
678
+ const s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), r = JSON.parse(atob(s));
679
+ return !(typeof r != "object" || r === null || "typ" in r && r?.typ !== "JWT" || !r.alg || e && r.alg !== e);
685
680
  } catch {
686
681
  return !1;
687
682
  }
688
683
  }
689
- function Pt(r, e) {
690
- return !!((e === "v4" || !e) && Ot.test(r) || (e === "v6" || !e) && jt.test(r));
684
+ function Dt(n, e) {
685
+ return !!((e === "v4" || !e) && Nt.test(n) || (e === "v6" || !e) && Rt.test(n));
691
686
  }
692
- class j extends v {
687
+ class N extends v {
693
688
  _parse(e) {
694
689
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
695
690
  const a = this._getOrReturnCtx(e);
696
691
  return l(a, {
697
- code: d.invalid_type,
692
+ code: u.invalid_type,
698
693
  expected: f.string,
699
694
  received: a.parsedType
700
695
  }), m;
701
696
  }
702
697
  const s = new T();
703
- let n;
698
+ let r;
704
699
  for (const a of this._def.checks)
705
700
  if (a.kind === "min")
706
- e.data.length < a.value && (n = this._getOrReturnCtx(e, n), l(n, {
707
- code: d.too_small,
701
+ e.data.length < a.value && (r = this._getOrReturnCtx(e, r), l(r, {
702
+ code: u.too_small,
708
703
  minimum: a.value,
709
704
  type: "string",
710
705
  inclusive: !0,
@@ -712,8 +707,8 @@ class j extends v {
712
707
  message: a.message
713
708
  }), s.dirty());
714
709
  else if (a.kind === "max")
715
- e.data.length > a.value && (n = this._getOrReturnCtx(e, n), l(n, {
716
- code: d.too_big,
710
+ e.data.length > a.value && (r = this._getOrReturnCtx(e, r), l(r, {
711
+ code: u.too_big,
717
712
  maximum: a.value,
718
713
  type: "string",
719
714
  inclusive: !0,
@@ -722,15 +717,15 @@ class j extends v {
722
717
  }), s.dirty());
723
718
  else if (a.kind === "length") {
724
719
  const i = e.data.length > a.value, o = e.data.length < a.value;
725
- (i || o) && (n = this._getOrReturnCtx(e, n), i ? l(n, {
726
- code: d.too_big,
720
+ (i || o) && (r = this._getOrReturnCtx(e, r), i ? l(r, {
721
+ code: u.too_big,
727
722
  maximum: a.value,
728
723
  type: "string",
729
724
  inclusive: !0,
730
725
  exact: !0,
731
726
  message: a.message
732
- }) : o && l(n, {
733
- code: d.too_small,
727
+ }) : o && l(r, {
728
+ code: u.too_small,
734
729
  minimum: a.value,
735
730
  type: "string",
736
731
  inclusive: !0,
@@ -738,121 +733,121 @@ class j extends v {
738
733
  message: a.message
739
734
  }), s.dirty());
740
735
  } else if (a.kind === "email")
741
- Tt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
736
+ Ct.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
742
737
  validation: "email",
743
- code: d.invalid_string,
738
+ code: u.invalid_string,
744
739
  message: a.message
745
740
  }), s.dirty());
746
741
  else if (a.kind === "emoji")
747
- ze || (ze = new RegExp(Ct, "u")), ze.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
742
+ Be || (Be = new RegExp(At, "u")), Be.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
748
743
  validation: "emoji",
749
- code: d.invalid_string,
744
+ code: u.invalid_string,
750
745
  message: a.message
751
746
  }), s.dirty());
752
747
  else if (a.kind === "uuid")
753
- xt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
748
+ kt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
754
749
  validation: "uuid",
755
- code: d.invalid_string,
750
+ code: u.invalid_string,
756
751
  message: a.message
757
752
  }), s.dirty());
758
753
  else if (a.kind === "nanoid")
759
- kt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
754
+ wt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
760
755
  validation: "nanoid",
761
- code: d.invalid_string,
756
+ code: u.invalid_string,
762
757
  message: a.message
763
758
  }), s.dirty());
764
759
  else if (a.kind === "cuid")
765
- _t.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
760
+ vt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
766
761
  validation: "cuid",
767
- code: d.invalid_string,
762
+ code: u.invalid_string,
768
763
  message: a.message
769
764
  }), s.dirty());
770
765
  else if (a.kind === "cuid2")
771
- gt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
766
+ xt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
772
767
  validation: "cuid2",
773
- code: d.invalid_string,
768
+ code: u.invalid_string,
774
769
  message: a.message
775
770
  }), s.dirty());
776
771
  else if (a.kind === "ulid")
777
- vt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
772
+ bt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
778
773
  validation: "ulid",
779
- code: d.invalid_string,
774
+ code: u.invalid_string,
780
775
  message: a.message
781
776
  }), s.dirty());
782
777
  else if (a.kind === "url")
783
778
  try {
784
779
  new URL(e.data);
785
780
  } catch {
786
- n = this._getOrReturnCtx(e, n), l(n, {
781
+ r = this._getOrReturnCtx(e, r), l(r, {
787
782
  validation: "url",
788
- code: d.invalid_string,
783
+ code: u.invalid_string,
789
784
  message: a.message
790
785
  }), s.dirty();
791
786
  }
792
- else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
787
+ else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
793
788
  validation: "regex",
794
- code: d.invalid_string,
789
+ code: u.invalid_string,
795
790
  message: a.message
796
- }), 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, {
797
- code: d.invalid_string,
791
+ }), s.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (r = this._getOrReturnCtx(e, r), l(r, {
792
+ code: u.invalid_string,
798
793
  validation: { includes: a.value, position: a.position },
799
794
  message: a.message
800
- }), 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, {
801
- code: d.invalid_string,
795
+ }), 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) || (r = this._getOrReturnCtx(e, r), l(r, {
796
+ code: u.invalid_string,
802
797
  validation: { startsWith: a.value },
803
798
  message: a.message
804
- }), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (n = this._getOrReturnCtx(e, n), l(n, {
805
- code: d.invalid_string,
799
+ }), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (r = this._getOrReturnCtx(e, r), l(r, {
800
+ code: u.invalid_string,
806
801
  validation: { endsWith: a.value },
807
802
  message: a.message
808
- }), s.dirty()) : a.kind === "datetime" ? rt(a).test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
809
- code: d.invalid_string,
803
+ }), s.dirty()) : a.kind === "datetime" ? at(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
804
+ code: u.invalid_string,
810
805
  validation: "datetime",
811
806
  message: a.message
812
- }), s.dirty()) : a.kind === "date" ? Zt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
813
- code: d.invalid_string,
807
+ }), s.dirty()) : a.kind === "date" ? Zt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
808
+ code: u.invalid_string,
814
809
  validation: "date",
815
810
  message: a.message
816
- }), s.dirty()) : a.kind === "time" ? Et(a).test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
817
- code: d.invalid_string,
811
+ }), s.dirty()) : a.kind === "time" ? $t(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
812
+ code: u.invalid_string,
818
813
  validation: "time",
819
814
  message: a.message
820
- }), s.dirty()) : a.kind === "duration" ? wt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
815
+ }), s.dirty()) : a.kind === "duration" ? St.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
821
816
  validation: "duration",
822
- code: d.invalid_string,
817
+ code: u.invalid_string,
823
818
  message: a.message
824
- }), s.dirty()) : a.kind === "ip" ? It(e.data, a.version) || (n = this._getOrReturnCtx(e, n), l(n, {
819
+ }), s.dirty()) : a.kind === "ip" ? Pt(e.data, a.version) || (r = this._getOrReturnCtx(e, r), l(r, {
825
820
  validation: "ip",
826
- code: d.invalid_string,
821
+ code: u.invalid_string,
827
822
  message: a.message
828
- }), s.dirty()) : a.kind === "jwt" ? $t(e.data, a.alg) || (n = this._getOrReturnCtx(e, n), l(n, {
823
+ }), s.dirty()) : a.kind === "jwt" ? Mt(e.data, a.alg) || (r = this._getOrReturnCtx(e, r), l(r, {
829
824
  validation: "jwt",
830
- code: d.invalid_string,
825
+ code: u.invalid_string,
831
826
  message: a.message
832
- }), s.dirty()) : a.kind === "cidr" ? Pt(e.data, a.version) || (n = this._getOrReturnCtx(e, n), l(n, {
827
+ }), s.dirty()) : a.kind === "cidr" ? Dt(e.data, a.version) || (r = this._getOrReturnCtx(e, r), l(r, {
833
828
  validation: "cidr",
834
- code: d.invalid_string,
829
+ code: u.invalid_string,
835
830
  message: a.message
836
- }), s.dirty()) : a.kind === "base64" ? Rt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
831
+ }), s.dirty()) : a.kind === "base64" ? jt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
837
832
  validation: "base64",
838
- code: d.invalid_string,
833
+ code: u.invalid_string,
839
834
  message: a.message
840
- }), s.dirty()) : a.kind === "base64url" ? Nt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
835
+ }), s.dirty()) : a.kind === "base64url" ? It.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
841
836
  validation: "base64url",
842
- code: d.invalid_string,
837
+ code: u.invalid_string,
843
838
  message: a.message
844
839
  }), s.dirty()) : x.assertNever(a);
845
840
  return { status: s.value, value: e.data };
846
841
  }
847
842
  _regex(e, t, s) {
848
- return this.refinement((n) => e.test(n), {
843
+ return this.refinement((r) => e.test(r), {
849
844
  validation: t,
850
- code: d.invalid_string,
845
+ code: u.invalid_string,
851
846
  ...h.errToObj(s)
852
847
  });
853
848
  }
854
849
  _addCheck(e) {
855
- return new j({
850
+ return new N({
856
851
  ...this._def,
857
852
  checks: [...this._def.checks, e]
858
853
  });
@@ -908,10 +903,10 @@ class j extends v {
908
903
  message: e
909
904
  }) : this._addCheck({
910
905
  kind: "datetime",
911
- precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
912
- offset: (e == null ? void 0 : e.offset) ?? !1,
913
- local: (e == null ? void 0 : e.local) ?? !1,
914
- ...h.errToObj(e == null ? void 0 : e.message)
906
+ precision: typeof e?.precision > "u" ? null : e?.precision,
907
+ offset: e?.offset ?? !1,
908
+ local: e?.local ?? !1,
909
+ ...h.errToObj(e?.message)
915
910
  });
916
911
  }
917
912
  date(e) {
@@ -924,8 +919,8 @@ class j extends v {
924
919
  message: e
925
920
  }) : this._addCheck({
926
921
  kind: "time",
927
- precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
928
- ...h.errToObj(e == null ? void 0 : e.message)
922
+ precision: typeof e?.precision > "u" ? null : e?.precision,
923
+ ...h.errToObj(e?.message)
929
924
  });
930
925
  }
931
926
  duration(e) {
@@ -942,8 +937,8 @@ class j extends v {
942
937
  return this._addCheck({
943
938
  kind: "includes",
944
939
  value: e,
945
- position: t == null ? void 0 : t.position,
946
- ...h.errToObj(t == null ? void 0 : t.message)
940
+ position: t?.position,
941
+ ...h.errToObj(t?.message)
947
942
  });
948
943
  }
949
944
  startsWith(e, t) {
@@ -988,19 +983,19 @@ class j extends v {
988
983
  return this.min(1, h.errToObj(e));
989
984
  }
990
985
  trim() {
991
- return new j({
986
+ return new N({
992
987
  ...this._def,
993
988
  checks: [...this._def.checks, { kind: "trim" }]
994
989
  });
995
990
  }
996
991
  toLowerCase() {
997
- return new j({
992
+ return new N({
998
993
  ...this._def,
999
994
  checks: [...this._def.checks, { kind: "toLowerCase" }]
1000
995
  });
1001
996
  }
1002
997
  toUpperCase() {
1003
- return new j({
998
+ return new N({
1004
999
  ...this._def,
1005
1000
  checks: [...this._def.checks, { kind: "toUpperCase" }]
1006
1001
  });
@@ -1066,15 +1061,15 @@ class j extends v {
1066
1061
  return e;
1067
1062
  }
1068
1063
  }
1069
- j.create = (r) => new j({
1064
+ N.create = (n) => new N({
1070
1065
  checks: [],
1071
1066
  typeName: y.ZodString,
1072
- coerce: (r == null ? void 0 : r.coerce) ?? !1,
1073
- ..._(r)
1067
+ coerce: n?.coerce ?? !1,
1068
+ ..._(n)
1074
1069
  });
1075
- function Mt(r, e) {
1076
- const t = (r.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, a = Number.parseInt(r.toFixed(n).replace(".", "")), i = Number.parseInt(e.toFixed(n).replace(".", ""));
1077
- return a % i / 10 ** n;
1070
+ function Lt(n, e) {
1071
+ const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = Number.parseInt(n.toFixed(r).replace(".", "")), i = Number.parseInt(e.toFixed(r).replace(".", ""));
1072
+ return a % i / 10 ** r;
1078
1073
  }
1079
1074
  class z extends v {
1080
1075
  constructor() {
@@ -1084,42 +1079,42 @@ class z extends v {
1084
1079
  if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== f.number) {
1085
1080
  const a = this._getOrReturnCtx(e);
1086
1081
  return l(a, {
1087
- code: d.invalid_type,
1082
+ code: u.invalid_type,
1088
1083
  expected: f.number,
1089
1084
  received: a.parsedType
1090
1085
  }), m;
1091
1086
  }
1092
1087
  let s;
1093
- const n = new T();
1088
+ const r = new T();
1094
1089
  for (const a of this._def.checks)
1095
1090
  a.kind === "int" ? x.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
1096
- code: d.invalid_type,
1091
+ code: u.invalid_type,
1097
1092
  expected: "integer",
1098
1093
  received: "float",
1099
1094
  message: a.message
1100
- }), n.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1101
- code: d.too_small,
1095
+ }), r.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1096
+ code: u.too_small,
1102
1097
  minimum: a.value,
1103
1098
  type: "number",
1104
1099
  inclusive: a.inclusive,
1105
1100
  exact: !1,
1106
1101
  message: a.message
1107
- }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1108
- code: d.too_big,
1102
+ }), r.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1103
+ code: u.too_big,
1109
1104
  maximum: a.value,
1110
1105
  type: "number",
1111
1106
  inclusive: a.inclusive,
1112
1107
  exact: !1,
1113
1108
  message: a.message
1114
- }), n.dirty()) : a.kind === "multipleOf" ? Mt(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), l(s, {
1115
- code: d.not_multiple_of,
1109
+ }), r.dirty()) : a.kind === "multipleOf" ? Lt(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), l(s, {
1110
+ code: u.not_multiple_of,
1116
1111
  multipleOf: a.value,
1117
1112
  message: a.message
1118
- }), n.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
1119
- code: d.not_finite,
1113
+ }), r.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
1114
+ code: u.not_finite,
1120
1115
  message: a.message
1121
- }), n.dirty()) : x.assertNever(a);
1122
- return { status: n.value, value: e.data };
1116
+ }), r.dirty()) : x.assertNever(a);
1117
+ return { status: r.value, value: e.data };
1123
1118
  }
1124
1119
  gte(e, t) {
1125
1120
  return this.setLimit("min", e, !0, h.toString(t));
@@ -1133,7 +1128,7 @@ class z extends v {
1133
1128
  lt(e, t) {
1134
1129
  return this.setLimit("max", e, !1, h.toString(t));
1135
1130
  }
1136
- setLimit(e, t, s, n) {
1131
+ setLimit(e, t, s, r) {
1137
1132
  return new z({
1138
1133
  ...this._def,
1139
1134
  checks: [
@@ -1142,7 +1137,7 @@ class z extends v {
1142
1137
  kind: e,
1143
1138
  value: t,
1144
1139
  inclusive: s,
1145
- message: h.toString(n)
1140
+ message: h.toString(r)
1146
1141
  }
1147
1142
  ]
1148
1143
  });
@@ -1242,13 +1237,13 @@ class z extends v {
1242
1237
  return Number.isFinite(t) && Number.isFinite(e);
1243
1238
  }
1244
1239
  }
1245
- z.create = (r) => new z({
1240
+ z.create = (n) => new z({
1246
1241
  checks: [],
1247
1242
  typeName: y.ZodNumber,
1248
- coerce: (r == null ? void 0 : r.coerce) || !1,
1249
- ..._(r)
1243
+ coerce: n?.coerce || !1,
1244
+ ..._(n)
1250
1245
  });
1251
- class U extends v {
1246
+ class F extends v {
1252
1247
  constructor() {
1253
1248
  super(...arguments), this.min = this.gte, this.max = this.lte;
1254
1249
  }
@@ -1262,31 +1257,31 @@ class U extends v {
1262
1257
  if (this._getType(e) !== f.bigint)
1263
1258
  return this._getInvalidInput(e);
1264
1259
  let s;
1265
- const n = new T();
1260
+ const r = new T();
1266
1261
  for (const a of this._def.checks)
1267
1262
  a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1268
- code: d.too_small,
1263
+ code: u.too_small,
1269
1264
  type: "bigint",
1270
1265
  minimum: a.value,
1271
1266
  inclusive: a.inclusive,
1272
1267
  message: a.message
1273
- }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1274
- code: d.too_big,
1268
+ }), r.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1269
+ code: u.too_big,
1275
1270
  type: "bigint",
1276
1271
  maximum: a.value,
1277
1272
  inclusive: a.inclusive,
1278
1273
  message: a.message
1279
- }), n.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), l(s, {
1280
- code: d.not_multiple_of,
1274
+ }), r.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), l(s, {
1275
+ code: u.not_multiple_of,
1281
1276
  multipleOf: a.value,
1282
1277
  message: a.message
1283
- }), n.dirty()) : x.assertNever(a);
1284
- return { status: n.value, value: e.data };
1278
+ }), r.dirty()) : x.assertNever(a);
1279
+ return { status: r.value, value: e.data };
1285
1280
  }
1286
1281
  _getInvalidInput(e) {
1287
1282
  const t = this._getOrReturnCtx(e);
1288
1283
  return l(t, {
1289
- code: d.invalid_type,
1284
+ code: u.invalid_type,
1290
1285
  expected: f.bigint,
1291
1286
  received: t.parsedType
1292
1287
  }), m;
@@ -1303,8 +1298,8 @@ class U extends v {
1303
1298
  lt(e, t) {
1304
1299
  return this.setLimit("max", e, !1, h.toString(t));
1305
1300
  }
1306
- setLimit(e, t, s, n) {
1307
- return new U({
1301
+ setLimit(e, t, s, r) {
1302
+ return new F({
1308
1303
  ...this._def,
1309
1304
  checks: [
1310
1305
  ...this._def.checks,
@@ -1312,13 +1307,13 @@ class U extends v {
1312
1307
  kind: e,
1313
1308
  value: t,
1314
1309
  inclusive: s,
1315
- message: h.toString(n)
1310
+ message: h.toString(r)
1316
1311
  }
1317
1312
  ]
1318
1313
  });
1319
1314
  }
1320
1315
  _addCheck(e) {
1321
- return new U({
1316
+ return new F({
1322
1317
  ...this._def,
1323
1318
  checks: [...this._def.checks, e]
1324
1319
  });
@@ -1375,36 +1370,36 @@ class U extends v {
1375
1370
  return e;
1376
1371
  }
1377
1372
  }
1378
- U.create = (r) => new U({
1373
+ F.create = (n) => new F({
1379
1374
  checks: [],
1380
1375
  typeName: y.ZodBigInt,
1381
- coerce: (r == null ? void 0 : r.coerce) ?? !1,
1382
- ..._(r)
1376
+ coerce: n?.coerce ?? !1,
1377
+ ..._(n)
1383
1378
  });
1384
- class ce extends v {
1379
+ class he extends v {
1385
1380
  _parse(e) {
1386
1381
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
1387
1382
  const s = this._getOrReturnCtx(e);
1388
1383
  return l(s, {
1389
- code: d.invalid_type,
1384
+ code: u.invalid_type,
1390
1385
  expected: f.boolean,
1391
1386
  received: s.parsedType
1392
1387
  }), m;
1393
1388
  }
1394
- return C(e.data);
1389
+ return S(e.data);
1395
1390
  }
1396
1391
  }
1397
- ce.create = (r) => new ce({
1392
+ he.create = (n) => new he({
1398
1393
  typeName: y.ZodBoolean,
1399
- coerce: (r == null ? void 0 : r.coerce) || !1,
1400
- ..._(r)
1394
+ coerce: n?.coerce || !1,
1395
+ ..._(n)
1401
1396
  });
1402
- class H extends v {
1397
+ class Y extends v {
1403
1398
  _parse(e) {
1404
1399
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
1405
1400
  const a = this._getOrReturnCtx(e);
1406
1401
  return l(a, {
1407
- code: d.invalid_type,
1402
+ code: u.invalid_type,
1408
1403
  expected: f.date,
1409
1404
  received: a.parsedType
1410
1405
  }), m;
@@ -1412,21 +1407,21 @@ class H extends v {
1412
1407
  if (Number.isNaN(e.data.getTime())) {
1413
1408
  const a = this._getOrReturnCtx(e);
1414
1409
  return l(a, {
1415
- code: d.invalid_date
1410
+ code: u.invalid_date
1416
1411
  }), m;
1417
1412
  }
1418
1413
  const s = new T();
1419
- let n;
1414
+ let r;
1420
1415
  for (const a of this._def.checks)
1421
- a.kind === "min" ? e.data.getTime() < a.value && (n = this._getOrReturnCtx(e, n), l(n, {
1422
- code: d.too_small,
1416
+ a.kind === "min" ? e.data.getTime() < a.value && (r = this._getOrReturnCtx(e, r), l(r, {
1417
+ code: u.too_small,
1423
1418
  message: a.message,
1424
1419
  inclusive: !0,
1425
1420
  exact: !1,
1426
1421
  minimum: a.value,
1427
1422
  type: "date"
1428
- }), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (n = this._getOrReturnCtx(e, n), l(n, {
1429
- code: d.too_big,
1423
+ }), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (r = this._getOrReturnCtx(e, r), l(r, {
1424
+ code: u.too_big,
1430
1425
  message: a.message,
1431
1426
  inclusive: !0,
1432
1427
  exact: !1,
@@ -1439,7 +1434,7 @@ class H extends v {
1439
1434
  };
1440
1435
  }
1441
1436
  _addCheck(e) {
1442
- return new H({
1437
+ return new Y({
1443
1438
  ...this._def,
1444
1439
  checks: [...this._def.checks, e]
1445
1440
  });
@@ -1471,175 +1466,175 @@ class H extends v {
1471
1466
  return e != null ? new Date(e) : null;
1472
1467
  }
1473
1468
  }
1474
- H.create = (r) => new H({
1469
+ Y.create = (n) => new Y({
1475
1470
  checks: [],
1476
- coerce: (r == null ? void 0 : r.coerce) || !1,
1471
+ coerce: n?.coerce || !1,
1477
1472
  typeName: y.ZodDate,
1478
- ..._(r)
1473
+ ..._(n)
1479
1474
  });
1480
- class Se extends v {
1475
+ class Ne extends v {
1481
1476
  _parse(e) {
1482
1477
  if (this._getType(e) !== f.symbol) {
1483
1478
  const s = this._getOrReturnCtx(e);
1484
1479
  return l(s, {
1485
- code: d.invalid_type,
1480
+ code: u.invalid_type,
1486
1481
  expected: f.symbol,
1487
1482
  received: s.parsedType
1488
1483
  }), m;
1489
1484
  }
1490
- return C(e.data);
1485
+ return S(e.data);
1491
1486
  }
1492
1487
  }
1493
- Se.create = (r) => new Se({
1488
+ Ne.create = (n) => new Ne({
1494
1489
  typeName: y.ZodSymbol,
1495
- ..._(r)
1490
+ ..._(n)
1496
1491
  });
1497
- class de extends v {
1492
+ class pe extends v {
1498
1493
  _parse(e) {
1499
1494
  if (this._getType(e) !== f.undefined) {
1500
1495
  const s = this._getOrReturnCtx(e);
1501
1496
  return l(s, {
1502
- code: d.invalid_type,
1497
+ code: u.invalid_type,
1503
1498
  expected: f.undefined,
1504
1499
  received: s.parsedType
1505
1500
  }), m;
1506
1501
  }
1507
- return C(e.data);
1502
+ return S(e.data);
1508
1503
  }
1509
1504
  }
1510
- de.create = (r) => new de({
1505
+ pe.create = (n) => new pe({
1511
1506
  typeName: y.ZodUndefined,
1512
- ..._(r)
1507
+ ..._(n)
1513
1508
  });
1514
- class ue extends v {
1509
+ class me extends v {
1515
1510
  _parse(e) {
1516
1511
  if (this._getType(e) !== f.null) {
1517
1512
  const s = this._getOrReturnCtx(e);
1518
1513
  return l(s, {
1519
- code: d.invalid_type,
1514
+ code: u.invalid_type,
1520
1515
  expected: f.null,
1521
1516
  received: s.parsedType
1522
1517
  }), m;
1523
1518
  }
1524
- return C(e.data);
1519
+ return S(e.data);
1525
1520
  }
1526
1521
  }
1527
- ue.create = (r) => new ue({
1522
+ me.create = (n) => new me({
1528
1523
  typeName: y.ZodNull,
1529
- ..._(r)
1524
+ ..._(n)
1530
1525
  });
1531
- class re extends v {
1526
+ class oe extends v {
1532
1527
  constructor() {
1533
1528
  super(...arguments), this._any = !0;
1534
1529
  }
1535
1530
  _parse(e) {
1536
- return C(e.data);
1531
+ return S(e.data);
1537
1532
  }
1538
1533
  }
1539
- re.create = (r) => new re({
1534
+ oe.create = (n) => new oe({
1540
1535
  typeName: y.ZodAny,
1541
- ..._(r)
1536
+ ..._(n)
1542
1537
  });
1543
- class W extends v {
1538
+ class K extends v {
1544
1539
  constructor() {
1545
1540
  super(...arguments), this._unknown = !0;
1546
1541
  }
1547
1542
  _parse(e) {
1548
- return C(e.data);
1543
+ return S(e.data);
1549
1544
  }
1550
1545
  }
1551
- W.create = (r) => new W({
1546
+ K.create = (n) => new K({
1552
1547
  typeName: y.ZodUnknown,
1553
- ..._(r)
1548
+ ..._(n)
1554
1549
  });
1555
- class D extends v {
1550
+ class U extends v {
1556
1551
  _parse(e) {
1557
1552
  const t = this._getOrReturnCtx(e);
1558
1553
  return l(t, {
1559
- code: d.invalid_type,
1554
+ code: u.invalid_type,
1560
1555
  expected: f.never,
1561
1556
  received: t.parsedType
1562
1557
  }), m;
1563
1558
  }
1564
1559
  }
1565
- D.create = (r) => new D({
1560
+ U.create = (n) => new U({
1566
1561
  typeName: y.ZodNever,
1567
- ..._(r)
1562
+ ..._(n)
1568
1563
  });
1569
- class Oe extends v {
1564
+ class Ee extends v {
1570
1565
  _parse(e) {
1571
1566
  if (this._getType(e) !== f.undefined) {
1572
1567
  const s = this._getOrReturnCtx(e);
1573
1568
  return l(s, {
1574
- code: d.invalid_type,
1569
+ code: u.invalid_type,
1575
1570
  expected: f.void,
1576
1571
  received: s.parsedType
1577
1572
  }), m;
1578
1573
  }
1579
- return C(e.data);
1574
+ return S(e.data);
1580
1575
  }
1581
1576
  }
1582
- Oe.create = (r) => new Oe({
1577
+ Ee.create = (n) => new Ee({
1583
1578
  typeName: y.ZodVoid,
1584
- ..._(r)
1579
+ ..._(n)
1585
1580
  });
1586
- class R extends v {
1581
+ class E extends v {
1587
1582
  _parse(e) {
1588
- const { ctx: t, status: s } = this._processInputParams(e), n = this._def;
1583
+ const { ctx: t, status: s } = this._processInputParams(e), r = this._def;
1589
1584
  if (t.parsedType !== f.array)
1590
1585
  return l(t, {
1591
- code: d.invalid_type,
1586
+ code: u.invalid_type,
1592
1587
  expected: f.array,
1593
1588
  received: t.parsedType
1594
1589
  }), m;
1595
- if (n.exactLength !== null) {
1596
- const i = t.data.length > n.exactLength.value, o = t.data.length < n.exactLength.value;
1590
+ if (r.exactLength !== null) {
1591
+ const i = t.data.length > r.exactLength.value, o = t.data.length < r.exactLength.value;
1597
1592
  (i || o) && (l(t, {
1598
- code: i ? d.too_big : d.too_small,
1599
- minimum: o ? n.exactLength.value : void 0,
1600
- maximum: i ? n.exactLength.value : void 0,
1593
+ code: i ? u.too_big : u.too_small,
1594
+ minimum: o ? r.exactLength.value : void 0,
1595
+ maximum: i ? r.exactLength.value : void 0,
1601
1596
  type: "array",
1602
1597
  inclusive: !0,
1603
1598
  exact: !0,
1604
- message: n.exactLength.message
1599
+ message: r.exactLength.message
1605
1600
  }), s.dirty());
1606
1601
  }
1607
- if (n.minLength !== null && t.data.length < n.minLength.value && (l(t, {
1608
- code: d.too_small,
1609
- minimum: n.minLength.value,
1602
+ if (r.minLength !== null && t.data.length < r.minLength.value && (l(t, {
1603
+ code: u.too_small,
1604
+ minimum: r.minLength.value,
1610
1605
  type: "array",
1611
1606
  inclusive: !0,
1612
1607
  exact: !1,
1613
- message: n.minLength.message
1614
- }), s.dirty()), n.maxLength !== null && t.data.length > n.maxLength.value && (l(t, {
1615
- code: d.too_big,
1616
- maximum: n.maxLength.value,
1608
+ message: r.minLength.message
1609
+ }), s.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (l(t, {
1610
+ code: u.too_big,
1611
+ maximum: r.maxLength.value,
1617
1612
  type: "array",
1618
1613
  inclusive: !0,
1619
1614
  exact: !1,
1620
- message: n.maxLength.message
1615
+ message: r.maxLength.message
1621
1616
  }), s.dirty()), t.common.async)
1622
- return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new I(t, i, t.path, o)))).then((i) => T.mergeArray(s, i));
1623
- const a = [...t.data].map((i, o) => n.type._parseSync(new I(t, i, t.path, o)));
1617
+ return Promise.all([...t.data].map((i, o) => r.type._parseAsync(new $(t, i, t.path, o)))).then((i) => T.mergeArray(s, i));
1618
+ const a = [...t.data].map((i, o) => r.type._parseSync(new $(t, i, t.path, o)));
1624
1619
  return T.mergeArray(s, a);
1625
1620
  }
1626
1621
  get element() {
1627
1622
  return this._def.type;
1628
1623
  }
1629
1624
  min(e, t) {
1630
- return new R({
1625
+ return new E({
1631
1626
  ...this._def,
1632
1627
  minLength: { value: e, message: h.toString(t) }
1633
1628
  });
1634
1629
  }
1635
1630
  max(e, t) {
1636
- return new R({
1631
+ return new E({
1637
1632
  ...this._def,
1638
1633
  maxLength: { value: e, message: h.toString(t) }
1639
1634
  });
1640
1635
  }
1641
1636
  length(e, t) {
1642
- return new R({
1637
+ return new E({
1643
1638
  ...this._def,
1644
1639
  exactLength: { value: e, message: h.toString(t) }
1645
1640
  });
@@ -1648,29 +1643,29 @@ class R extends v {
1648
1643
  return this.min(1, e);
1649
1644
  }
1650
1645
  }
1651
- R.create = (r, e) => new R({
1652
- type: r,
1646
+ E.create = (n, e) => new E({
1647
+ type: n,
1653
1648
  minLength: null,
1654
1649
  maxLength: null,
1655
1650
  exactLength: null,
1656
1651
  typeName: y.ZodArray,
1657
1652
  ..._(e)
1658
1653
  });
1659
- function X(r) {
1660
- if (r instanceof k) {
1654
+ function se(n) {
1655
+ if (n instanceof k) {
1661
1656
  const e = {};
1662
- for (const t in r.shape) {
1663
- const s = r.shape[t];
1664
- e[t] = E.create(X(s));
1657
+ for (const t in n.shape) {
1658
+ const s = n.shape[t];
1659
+ e[t] = Z.create(se(s));
1665
1660
  }
1666
1661
  return new k({
1667
- ...r._def,
1662
+ ...n._def,
1668
1663
  shape: () => e
1669
1664
  });
1670
- } else return r instanceof R ? new R({
1671
- ...r._def,
1672
- type: X(r.element)
1673
- }) : r instanceof E ? E.create(X(r.unwrap())) : r instanceof F ? F.create(X(r.unwrap())) : r instanceof $ ? $.create(r.items.map((e) => X(e))) : r;
1665
+ } else return n instanceof E ? new E({
1666
+ ...n._def,
1667
+ type: se(n.element)
1668
+ }) : n instanceof Z ? Z.create(se(n.unwrap())) : n instanceof H ? H.create(se(n.unwrap())) : n instanceof P ? P.create(n.items.map((e) => se(e))) : n;
1674
1669
  }
1675
1670
  class k extends v {
1676
1671
  constructor() {
@@ -1684,66 +1679,66 @@ class k extends v {
1684
1679
  }
1685
1680
  _parse(e) {
1686
1681
  if (this._getType(e) !== f.object) {
1687
- const u = this._getOrReturnCtx(e);
1688
- return l(u, {
1689
- code: d.invalid_type,
1682
+ const d = this._getOrReturnCtx(e);
1683
+ return l(d, {
1684
+ code: u.invalid_type,
1690
1685
  expected: f.object,
1691
- received: u.parsedType
1686
+ received: d.parsedType
1692
1687
  }), m;
1693
1688
  }
1694
- const { status: s, ctx: n } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
1695
- if (!(this._def.catchall instanceof D && this._def.unknownKeys === "strip"))
1696
- for (const u in n.data)
1697
- i.includes(u) || o.push(u);
1689
+ const { status: s, ctx: r } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
1690
+ if (!(this._def.catchall instanceof U && this._def.unknownKeys === "strip"))
1691
+ for (const d in r.data)
1692
+ i.includes(d) || o.push(d);
1698
1693
  const c = [];
1699
- for (const u of i) {
1700
- const p = a[u], b = n.data[u];
1694
+ for (const d of i) {
1695
+ const p = a[d], b = r.data[d];
1701
1696
  c.push({
1702
- key: { status: "valid", value: u },
1703
- value: p._parse(new I(n, b, n.path, u)),
1704
- alwaysSet: u in n.data
1697
+ key: { status: "valid", value: d },
1698
+ value: p._parse(new $(r, b, r.path, d)),
1699
+ alwaysSet: d in r.data
1705
1700
  });
1706
1701
  }
1707
- if (this._def.catchall instanceof D) {
1708
- const u = this._def.unknownKeys;
1709
- if (u === "passthrough")
1702
+ if (this._def.catchall instanceof U) {
1703
+ const d = this._def.unknownKeys;
1704
+ if (d === "passthrough")
1710
1705
  for (const p of o)
1711
1706
  c.push({
1712
1707
  key: { status: "valid", value: p },
1713
- value: { status: "valid", value: n.data[p] }
1708
+ value: { status: "valid", value: r.data[p] }
1714
1709
  });
1715
- else if (u === "strict")
1716
- o.length > 0 && (l(n, {
1717
- code: d.unrecognized_keys,
1710
+ else if (d === "strict")
1711
+ o.length > 0 && (l(r, {
1712
+ code: u.unrecognized_keys,
1718
1713
  keys: o
1719
1714
  }), s.dirty());
1720
- else if (u !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1715
+ else if (d !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1721
1716
  } else {
1722
- const u = this._def.catchall;
1717
+ const d = this._def.catchall;
1723
1718
  for (const p of o) {
1724
- const b = n.data[p];
1719
+ const b = r.data[p];
1725
1720
  c.push({
1726
1721
  key: { status: "valid", value: p },
1727
- value: u._parse(
1728
- new I(n, b, n.path, p)
1722
+ value: d._parse(
1723
+ new $(r, b, r.path, p)
1729
1724
  //, ctx.child(key), value, getParsedType(value)
1730
1725
  ),
1731
- alwaysSet: p in n.data
1726
+ alwaysSet: p in r.data
1732
1727
  });
1733
1728
  }
1734
1729
  }
1735
- return n.common.async ? Promise.resolve().then(async () => {
1736
- const u = [];
1730
+ return r.common.async ? Promise.resolve().then(async () => {
1731
+ const d = [];
1737
1732
  for (const p of c) {
1738
- const b = await p.key, A = await p.value;
1739
- u.push({
1733
+ const b = await p.key, C = await p.value;
1734
+ d.push({
1740
1735
  key: b,
1741
- value: A,
1736
+ value: C,
1742
1737
  alwaysSet: p.alwaysSet
1743
1738
  });
1744
1739
  }
1745
- return u;
1746
- }).then((u) => T.mergeObjectSync(s, u)) : T.mergeObjectSync(s, c);
1740
+ return d;
1741
+ }).then((d) => T.mergeObjectSync(s, d)) : T.mergeObjectSync(s, c);
1747
1742
  }
1748
1743
  get shape() {
1749
1744
  return this._def.shape();
@@ -1754,12 +1749,11 @@ class k extends v {
1754
1749
  unknownKeys: "strict",
1755
1750
  ...e !== void 0 ? {
1756
1751
  errorMap: (t, s) => {
1757
- var a, i;
1758
- const n = ((i = (a = this._def).errorMap) == null ? void 0 : i.call(a, t, s).message) ?? s.defaultError;
1752
+ const r = this._def.errorMap?.(t, s).message ?? s.defaultError;
1759
1753
  return t.code === "unrecognized_keys" ? {
1760
- message: h.errToObj(e).message ?? n
1754
+ message: h.errToObj(e).message ?? r
1761
1755
  } : {
1762
- message: n
1756
+ message: r
1763
1757
  };
1764
1758
  }
1765
1759
  } : {}
@@ -1906,13 +1900,13 @@ class k extends v {
1906
1900
  * @deprecated
1907
1901
  */
1908
1902
  deepPartial() {
1909
- return X(this);
1903
+ return se(this);
1910
1904
  }
1911
1905
  partial(e) {
1912
1906
  const t = {};
1913
1907
  for (const s of x.objectKeys(this.shape)) {
1914
- const n = this.shape[s];
1915
- e && !e[s] ? t[s] = n : t[s] = n.optional();
1908
+ const r = this.shape[s];
1909
+ e && !e[s] ? t[s] = r : t[s] = r.optional();
1916
1910
  }
1917
1911
  return new k({
1918
1912
  ...this._def,
@@ -1926,7 +1920,7 @@ class k extends v {
1926
1920
  t[s] = this.shape[s];
1927
1921
  else {
1928
1922
  let a = this.shape[s];
1929
- for (; a instanceof E; )
1923
+ for (; a instanceof Z; )
1930
1924
  a = a._def.innerType;
1931
1925
  t[s] = a;
1932
1926
  }
@@ -1936,43 +1930,43 @@ class k extends v {
1936
1930
  });
1937
1931
  }
1938
1932
  keyof() {
1939
- return st(x.objectKeys(this.shape));
1933
+ return it(x.objectKeys(this.shape));
1940
1934
  }
1941
1935
  }
1942
- k.create = (r, e) => new k({
1943
- shape: () => r,
1936
+ k.create = (n, e) => new k({
1937
+ shape: () => n,
1944
1938
  unknownKeys: "strip",
1945
- catchall: D.create(),
1939
+ catchall: U.create(),
1946
1940
  typeName: y.ZodObject,
1947
1941
  ..._(e)
1948
1942
  });
1949
- k.strictCreate = (r, e) => new k({
1950
- shape: () => r,
1943
+ k.strictCreate = (n, e) => new k({
1944
+ shape: () => n,
1951
1945
  unknownKeys: "strict",
1952
- catchall: D.create(),
1946
+ catchall: U.create(),
1953
1947
  typeName: y.ZodObject,
1954
1948
  ..._(e)
1955
1949
  });
1956
- k.lazycreate = (r, e) => new k({
1957
- shape: r,
1950
+ k.lazycreate = (n, e) => new k({
1951
+ shape: n,
1958
1952
  unknownKeys: "strip",
1959
- catchall: D.create(),
1953
+ catchall: U.create(),
1960
1954
  typeName: y.ZodObject,
1961
1955
  ..._(e)
1962
1956
  });
1963
- class le extends v {
1957
+ class ye extends v {
1964
1958
  _parse(e) {
1965
1959
  const { ctx: t } = this._processInputParams(e), s = this._def.options;
1966
- function n(a) {
1960
+ function r(a) {
1967
1961
  for (const o of a)
1968
1962
  if (o.result.status === "valid")
1969
1963
  return o.result;
1970
1964
  for (const o of a)
1971
1965
  if (o.result.status === "dirty")
1972
1966
  return t.common.issues.push(...o.ctx.common.issues), o.result;
1973
- const i = a.map((o) => new S(o.ctx.common.issues));
1967
+ const i = a.map((o) => new A(o.ctx.common.issues));
1974
1968
  return l(t, {
1975
- code: d.invalid_union,
1969
+ code: u.invalid_union,
1976
1970
  unionErrors: i
1977
1971
  }), m;
1978
1972
  }
@@ -1994,12 +1988,12 @@ class le extends v {
1994
1988
  }),
1995
1989
  ctx: i
1996
1990
  };
1997
- })).then(n);
1991
+ })).then(r);
1998
1992
  {
1999
1993
  let a;
2000
1994
  const i = [];
2001
1995
  for (const c of s) {
2002
- const u = {
1996
+ const d = {
2003
1997
  ...t,
2004
1998
  common: {
2005
1999
  ...t.common,
@@ -2009,17 +2003,17 @@ class le extends v {
2009
2003
  }, p = c._parseSync({
2010
2004
  data: t.data,
2011
2005
  path: t.path,
2012
- parent: u
2006
+ parent: d
2013
2007
  });
2014
2008
  if (p.status === "valid")
2015
2009
  return p;
2016
- p.status === "dirty" && !a && (a = { result: p, ctx: u }), u.common.issues.length && i.push(u.common.issues);
2010
+ p.status === "dirty" && !a && (a = { result: p, ctx: d }), d.common.issues.length && i.push(d.common.issues);
2017
2011
  }
2018
2012
  if (a)
2019
2013
  return t.common.issues.push(...a.ctx.common.issues), a.result;
2020
- const o = i.map((c) => new S(c));
2014
+ const o = i.map((c) => new A(c));
2021
2015
  return l(t, {
2022
- code: d.invalid_union,
2016
+ code: u.invalid_union,
2023
2017
  unionErrors: o
2024
2018
  }), m;
2025
2019
  }
@@ -2028,22 +2022,22 @@ class le extends v {
2028
2022
  return this._def.options;
2029
2023
  }
2030
2024
  }
2031
- le.create = (r, e) => new le({
2032
- options: r,
2025
+ ye.create = (n, e) => new ye({
2026
+ options: n,
2033
2027
  typeName: y.ZodUnion,
2034
2028
  ..._(e)
2035
2029
  });
2036
- const P = (r) => r instanceof pe ? P(r.schema) : r instanceof N ? P(r.innerType()) : r instanceof me ? [r.value] : r instanceof B ? r.options : r instanceof ye ? x.objectValues(r.enum) : r instanceof _e ? P(r._def.innerType) : r instanceof de ? [void 0] : r instanceof ue ? [null] : r instanceof E ? [void 0, ...P(r.unwrap())] : r instanceof F ? [null, ...P(r.unwrap())] : r instanceof He || r instanceof ve ? P(r.unwrap()) : r instanceof ge ? P(r._def.innerType) : [];
2037
- class Ne extends v {
2030
+ const L = (n) => n instanceof ve ? L(n.schema) : n instanceof R ? L(n.innerType()) : n instanceof xe ? [n.value] : n instanceof q ? n.options : n instanceof be ? x.objectValues(n.enum) : n instanceof ke ? L(n._def.innerType) : n instanceof pe ? [void 0] : n instanceof me ? [null] : n instanceof Z ? [void 0, ...L(n.unwrap())] : n instanceof H ? [null, ...L(n.unwrap())] : n instanceof Ke || n instanceof Te ? L(n.unwrap()) : n instanceof we ? L(n._def.innerType) : [];
2031
+ class $e extends v {
2038
2032
  _parse(e) {
2039
2033
  const { ctx: t } = this._processInputParams(e);
2040
2034
  if (t.parsedType !== f.object)
2041
2035
  return l(t, {
2042
- code: d.invalid_type,
2036
+ code: u.invalid_type,
2043
2037
  expected: f.object,
2044
2038
  received: t.parsedType
2045
2039
  }), m;
2046
- const s = this.discriminator, n = t.data[s], a = this.optionsMap.get(n);
2040
+ const s = this.discriminator, r = t.data[s], a = this.optionsMap.get(r);
2047
2041
  return a ? t.common.async ? a._parseAsync({
2048
2042
  data: t.data,
2049
2043
  path: t.path,
@@ -2053,7 +2047,7 @@ class Ne extends v {
2053
2047
  path: t.path,
2054
2048
  parent: t
2055
2049
  }) : (l(t, {
2056
- code: d.invalid_union_discriminator,
2050
+ code: u.invalid_union_discriminator,
2057
2051
  options: Array.from(this.optionsMap.keys()),
2058
2052
  path: [s]
2059
2053
  }), m);
@@ -2076,60 +2070,60 @@ class Ne extends v {
2076
2070
  * @param params
2077
2071
  */
2078
2072
  static create(e, t, s) {
2079
- const n = /* @__PURE__ */ new Map();
2073
+ const r = /* @__PURE__ */ new Map();
2080
2074
  for (const a of t) {
2081
- const i = P(a.shape[e]);
2075
+ const i = L(a.shape[e]);
2082
2076
  if (!i.length)
2083
2077
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
2084
2078
  for (const o of i) {
2085
- if (n.has(o))
2079
+ if (r.has(o))
2086
2080
  throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
2087
- n.set(o, a);
2081
+ r.set(o, a);
2088
2082
  }
2089
2083
  }
2090
- return new Ne({
2084
+ return new $e({
2091
2085
  typeName: y.ZodDiscriminatedUnion,
2092
2086
  discriminator: e,
2093
2087
  options: t,
2094
- optionsMap: n,
2088
+ optionsMap: r,
2095
2089
  ..._(s)
2096
2090
  });
2097
2091
  }
2098
2092
  }
2099
- function Je(r, e) {
2100
- const t = M(r), s = M(e);
2101
- if (r === e)
2102
- return { valid: !0, data: r };
2093
+ function Ge(n, e) {
2094
+ const t = V(n), s = V(e);
2095
+ if (n === e)
2096
+ return { valid: !0, data: n };
2103
2097
  if (t === f.object && s === f.object) {
2104
- const n = x.objectKeys(e), a = x.objectKeys(r).filter((o) => n.indexOf(o) !== -1), i = { ...r, ...e };
2098
+ const r = x.objectKeys(e), a = x.objectKeys(n).filter((o) => r.indexOf(o) !== -1), i = { ...n, ...e };
2105
2099
  for (const o of a) {
2106
- const c = Je(r[o], e[o]);
2100
+ const c = Ge(n[o], e[o]);
2107
2101
  if (!c.valid)
2108
2102
  return { valid: !1 };
2109
2103
  i[o] = c.data;
2110
2104
  }
2111
2105
  return { valid: !0, data: i };
2112
2106
  } else if (t === f.array && s === f.array) {
2113
- if (r.length !== e.length)
2107
+ if (n.length !== e.length)
2114
2108
  return { valid: !1 };
2115
- const n = [];
2116
- for (let a = 0; a < r.length; a++) {
2117
- const i = r[a], o = e[a], c = Je(i, o);
2109
+ const r = [];
2110
+ for (let a = 0; a < n.length; a++) {
2111
+ const i = n[a], o = e[a], c = Ge(i, o);
2118
2112
  if (!c.valid)
2119
2113
  return { valid: !1 };
2120
- n.push(c.data);
2114
+ r.push(c.data);
2121
2115
  }
2122
- return { valid: !0, data: n };
2123
- } else return t === f.date && s === f.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
2116
+ return { valid: !0, data: r };
2117
+ } else return t === f.date && s === f.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
2124
2118
  }
2125
- class fe extends v {
2119
+ class _e extends v {
2126
2120
  _parse(e) {
2127
- const { status: t, ctx: s } = this._processInputParams(e), n = (a, i) => {
2128
- if (qe(a) || qe(i))
2121
+ const { status: t, ctx: s } = this._processInputParams(e), r = (a, i) => {
2122
+ if (He(a) || He(i))
2129
2123
  return m;
2130
- const o = Je(a.value, i.value);
2124
+ const o = Ge(a.value, i.value);
2131
2125
  return o.valid ? ((We(a) || We(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(s, {
2132
- code: d.invalid_intersection_types
2126
+ code: u.invalid_intersection_types
2133
2127
  }), m);
2134
2128
  };
2135
2129
  return s.common.async ? Promise.all([
@@ -2143,7 +2137,7 @@ class fe extends v {
2143
2137
  path: s.path,
2144
2138
  parent: s
2145
2139
  })
2146
- ]).then(([a, i]) => n(a, i)) : n(this._def.left._parseSync({
2140
+ ]).then(([a, i]) => r(a, i)) : r(this._def.left._parseSync({
2147
2141
  data: s.data,
2148
2142
  path: s.path,
2149
2143
  parent: s
@@ -2154,31 +2148,31 @@ class fe extends v {
2154
2148
  }));
2155
2149
  }
2156
2150
  }
2157
- fe.create = (r, e, t) => new fe({
2158
- left: r,
2151
+ _e.create = (n, e, t) => new _e({
2152
+ left: n,
2159
2153
  right: e,
2160
2154
  typeName: y.ZodIntersection,
2161
2155
  ..._(t)
2162
2156
  });
2163
- class $ extends v {
2157
+ class P extends v {
2164
2158
  _parse(e) {
2165
2159
  const { status: t, ctx: s } = this._processInputParams(e);
2166
2160
  if (s.parsedType !== f.array)
2167
2161
  return l(s, {
2168
- code: d.invalid_type,
2162
+ code: u.invalid_type,
2169
2163
  expected: f.array,
2170
2164
  received: s.parsedType
2171
2165
  }), m;
2172
2166
  if (s.data.length < this._def.items.length)
2173
2167
  return l(s, {
2174
- code: d.too_small,
2168
+ code: u.too_small,
2175
2169
  minimum: this._def.items.length,
2176
2170
  inclusive: !0,
2177
2171
  exact: !1,
2178
2172
  type: "array"
2179
2173
  }), m;
2180
2174
  !this._def.rest && s.data.length > this._def.items.length && (l(s, {
2181
- code: d.too_big,
2175
+ code: u.too_big,
2182
2176
  maximum: this._def.items.length,
2183
2177
  inclusive: !0,
2184
2178
  exact: !1,
@@ -2186,7 +2180,7 @@ class $ extends v {
2186
2180
  }), t.dirty());
2187
2181
  const a = [...s.data].map((i, o) => {
2188
2182
  const c = this._def.items[o] || this._def.rest;
2189
- return c ? c._parse(new I(s, i, s.path, o)) : null;
2183
+ return c ? c._parse(new $(s, i, s.path, o)) : null;
2190
2184
  }).filter((i) => !!i);
2191
2185
  return s.common.async ? Promise.all(a).then((i) => T.mergeArray(t, i)) : T.mergeArray(t, a);
2192
2186
  }
@@ -2194,23 +2188,23 @@ class $ extends v {
2194
2188
  return this._def.items;
2195
2189
  }
2196
2190
  rest(e) {
2197
- return new $({
2191
+ return new P({
2198
2192
  ...this._def,
2199
2193
  rest: e
2200
2194
  });
2201
2195
  }
2202
2196
  }
2203
- $.create = (r, e) => {
2204
- if (!Array.isArray(r))
2197
+ P.create = (n, e) => {
2198
+ if (!Array.isArray(n))
2205
2199
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2206
- return new $({
2207
- items: r,
2200
+ return new P({
2201
+ items: n,
2208
2202
  typeName: y.ZodTuple,
2209
2203
  rest: null,
2210
2204
  ..._(e)
2211
2205
  });
2212
2206
  };
2213
- class he extends v {
2207
+ class ge extends v {
2214
2208
  get keySchema() {
2215
2209
  return this._def.keyType;
2216
2210
  }
@@ -2221,37 +2215,37 @@ class he extends v {
2221
2215
  const { status: t, ctx: s } = this._processInputParams(e);
2222
2216
  if (s.parsedType !== f.object)
2223
2217
  return l(s, {
2224
- code: d.invalid_type,
2218
+ code: u.invalid_type,
2225
2219
  expected: f.object,
2226
2220
  received: s.parsedType
2227
2221
  }), m;
2228
- const n = [], a = this._def.keyType, i = this._def.valueType;
2222
+ const r = [], a = this._def.keyType, i = this._def.valueType;
2229
2223
  for (const o in s.data)
2230
- n.push({
2231
- key: a._parse(new I(s, o, s.path, o)),
2232
- value: i._parse(new I(s, s.data[o], s.path, o)),
2224
+ r.push({
2225
+ key: a._parse(new $(s, o, s.path, o)),
2226
+ value: i._parse(new $(s, s.data[o], s.path, o)),
2233
2227
  alwaysSet: o in s.data
2234
2228
  });
2235
- return s.common.async ? T.mergeObjectAsync(t, n) : T.mergeObjectSync(t, n);
2229
+ return s.common.async ? T.mergeObjectAsync(t, r) : T.mergeObjectSync(t, r);
2236
2230
  }
2237
2231
  get element() {
2238
2232
  return this._def.valueType;
2239
2233
  }
2240
2234
  static create(e, t, s) {
2241
- return t instanceof v ? new he({
2235
+ return t instanceof v ? new ge({
2242
2236
  keyType: e,
2243
2237
  valueType: t,
2244
2238
  typeName: y.ZodRecord,
2245
2239
  ..._(s)
2246
- }) : new he({
2247
- keyType: j.create(),
2240
+ }) : new ge({
2241
+ keyType: N.create(),
2248
2242
  valueType: e,
2249
2243
  typeName: y.ZodRecord,
2250
2244
  ..._(t)
2251
2245
  });
2252
2246
  }
2253
2247
  }
2254
- class Ae extends v {
2248
+ class Re extends v {
2255
2249
  get keySchema() {
2256
2250
  return this._def.keyType;
2257
2251
  }
@@ -2262,89 +2256,89 @@ class Ae extends v {
2262
2256
  const { status: t, ctx: s } = this._processInputParams(e);
2263
2257
  if (s.parsedType !== f.map)
2264
2258
  return l(s, {
2265
- code: d.invalid_type,
2259
+ code: u.invalid_type,
2266
2260
  expected: f.map,
2267
2261
  received: s.parsedType
2268
2262
  }), m;
2269
- const n = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], u) => ({
2270
- key: n._parse(new I(s, o, s.path, [u, "key"])),
2271
- value: a._parse(new I(s, c, s.path, [u, "value"]))
2263
+ const r = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], d) => ({
2264
+ key: r._parse(new $(s, o, s.path, [d, "key"])),
2265
+ value: a._parse(new $(s, c, s.path, [d, "value"]))
2272
2266
  }));
2273
2267
  if (s.common.async) {
2274
2268
  const o = /* @__PURE__ */ new Map();
2275
2269
  return Promise.resolve().then(async () => {
2276
2270
  for (const c of i) {
2277
- const u = await c.key, p = await c.value;
2278
- if (u.status === "aborted" || p.status === "aborted")
2271
+ const d = await c.key, p = await c.value;
2272
+ if (d.status === "aborted" || p.status === "aborted")
2279
2273
  return m;
2280
- (u.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(u.value, p.value);
2274
+ (d.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(d.value, p.value);
2281
2275
  }
2282
2276
  return { status: t.value, value: o };
2283
2277
  });
2284
2278
  } else {
2285
2279
  const o = /* @__PURE__ */ new Map();
2286
2280
  for (const c of i) {
2287
- const u = c.key, p = c.value;
2288
- if (u.status === "aborted" || p.status === "aborted")
2281
+ const d = c.key, p = c.value;
2282
+ if (d.status === "aborted" || p.status === "aborted")
2289
2283
  return m;
2290
- (u.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(u.value, p.value);
2284
+ (d.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(d.value, p.value);
2291
2285
  }
2292
2286
  return { status: t.value, value: o };
2293
2287
  }
2294
2288
  }
2295
2289
  }
2296
- Ae.create = (r, e, t) => new Ae({
2290
+ Re.create = (n, e, t) => new Re({
2297
2291
  valueType: e,
2298
- keyType: r,
2292
+ keyType: n,
2299
2293
  typeName: y.ZodMap,
2300
2294
  ..._(t)
2301
2295
  });
2302
- class Y extends v {
2296
+ class X extends v {
2303
2297
  _parse(e) {
2304
2298
  const { status: t, ctx: s } = this._processInputParams(e);
2305
2299
  if (s.parsedType !== f.set)
2306
2300
  return l(s, {
2307
- code: d.invalid_type,
2301
+ code: u.invalid_type,
2308
2302
  expected: f.set,
2309
2303
  received: s.parsedType
2310
2304
  }), m;
2311
- const n = this._def;
2312
- n.minSize !== null && s.data.size < n.minSize.value && (l(s, {
2313
- code: d.too_small,
2314
- minimum: n.minSize.value,
2305
+ const r = this._def;
2306
+ r.minSize !== null && s.data.size < r.minSize.value && (l(s, {
2307
+ code: u.too_small,
2308
+ minimum: r.minSize.value,
2315
2309
  type: "set",
2316
2310
  inclusive: !0,
2317
2311
  exact: !1,
2318
- message: n.minSize.message
2319
- }), t.dirty()), n.maxSize !== null && s.data.size > n.maxSize.value && (l(s, {
2320
- code: d.too_big,
2321
- maximum: n.maxSize.value,
2312
+ message: r.minSize.message
2313
+ }), t.dirty()), r.maxSize !== null && s.data.size > r.maxSize.value && (l(s, {
2314
+ code: u.too_big,
2315
+ maximum: r.maxSize.value,
2322
2316
  type: "set",
2323
2317
  inclusive: !0,
2324
2318
  exact: !1,
2325
- message: n.maxSize.message
2319
+ message: r.maxSize.message
2326
2320
  }), t.dirty());
2327
2321
  const a = this._def.valueType;
2328
2322
  function i(c) {
2329
- const u = /* @__PURE__ */ new Set();
2323
+ const d = /* @__PURE__ */ new Set();
2330
2324
  for (const p of c) {
2331
2325
  if (p.status === "aborted")
2332
2326
  return m;
2333
- p.status === "dirty" && t.dirty(), u.add(p.value);
2327
+ p.status === "dirty" && t.dirty(), d.add(p.value);
2334
2328
  }
2335
- return { status: t.value, value: u };
2329
+ return { status: t.value, value: d };
2336
2330
  }
2337
- const o = [...s.data.values()].map((c, u) => a._parse(new I(s, c, s.path, u)));
2331
+ const o = [...s.data.values()].map((c, d) => a._parse(new $(s, c, s.path, d)));
2338
2332
  return s.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
2339
2333
  }
2340
2334
  min(e, t) {
2341
- return new Y({
2335
+ return new X({
2342
2336
  ...this._def,
2343
2337
  minSize: { value: e, message: h.toString(t) }
2344
2338
  });
2345
2339
  }
2346
2340
  max(e, t) {
2347
- return new Y({
2341
+ return new X({
2348
2342
  ...this._def,
2349
2343
  maxSize: { value: e, message: h.toString(t) }
2350
2344
  });
@@ -2356,14 +2350,14 @@ class Y extends v {
2356
2350
  return this.min(1, e);
2357
2351
  }
2358
2352
  }
2359
- Y.create = (r, e) => new Y({
2360
- valueType: r,
2353
+ X.create = (n, e) => new X({
2354
+ valueType: n,
2361
2355
  minSize: null,
2362
2356
  maxSize: null,
2363
2357
  typeName: y.ZodSet,
2364
2358
  ..._(e)
2365
2359
  });
2366
- class ee extends v {
2360
+ class ae extends v {
2367
2361
  constructor() {
2368
2362
  super(...arguments), this.validate = this.implement;
2369
2363
  }
@@ -2371,52 +2365,52 @@ class ee extends v {
2371
2365
  const { ctx: t } = this._processInputParams(e);
2372
2366
  if (t.parsedType !== f.function)
2373
2367
  return l(t, {
2374
- code: d.invalid_type,
2368
+ code: u.invalid_type,
2375
2369
  expected: f.function,
2376
2370
  received: t.parsedType
2377
2371
  }), m;
2378
2372
  function s(o, c) {
2379
- return Ce({
2373
+ return Oe({
2380
2374
  data: o,
2381
2375
  path: t.path,
2382
- errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, Te(), te].filter((u) => !!u),
2376
+ errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, Ae(), ie].filter((d) => !!d),
2383
2377
  issueData: {
2384
- code: d.invalid_arguments,
2378
+ code: u.invalid_arguments,
2385
2379
  argumentsError: c
2386
2380
  }
2387
2381
  });
2388
2382
  }
2389
- function n(o, c) {
2390
- return Ce({
2383
+ function r(o, c) {
2384
+ return Oe({
2391
2385
  data: o,
2392
2386
  path: t.path,
2393
- errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, Te(), te].filter((u) => !!u),
2387
+ errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, Ae(), ie].filter((d) => !!d),
2394
2388
  issueData: {
2395
- code: d.invalid_return_type,
2389
+ code: u.invalid_return_type,
2396
2390
  returnTypeError: c
2397
2391
  }
2398
2392
  });
2399
2393
  }
2400
2394
  const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
2401
- if (this._def.returns instanceof se) {
2395
+ if (this._def.returns instanceof ce) {
2402
2396
  const o = this;
2403
- return C(async function(...c) {
2404
- const u = new S([]), p = await o._def.args.parseAsync(c, a).catch((w) => {
2405
- throw u.addIssue(s(c, w)), u;
2397
+ return S(async function(...c) {
2398
+ const d = new A([]), p = await o._def.args.parseAsync(c, a).catch((w) => {
2399
+ throw d.addIssue(s(c, w)), d;
2406
2400
  }), b = await Reflect.apply(i, this, p);
2407
2401
  return await o._def.returns._def.type.parseAsync(b, a).catch((w) => {
2408
- throw u.addIssue(n(b, w)), u;
2402
+ throw d.addIssue(r(b, w)), d;
2409
2403
  });
2410
2404
  });
2411
2405
  } else {
2412
2406
  const o = this;
2413
- return C(function(...c) {
2414
- const u = o._def.args.safeParse(c, a);
2415
- if (!u.success)
2416
- throw new S([s(c, u.error)]);
2417
- const p = Reflect.apply(i, this, u.data), b = o._def.returns.safeParse(p, a);
2407
+ return S(function(...c) {
2408
+ const d = o._def.args.safeParse(c, a);
2409
+ if (!d.success)
2410
+ throw new A([s(c, d.error)]);
2411
+ const p = Reflect.apply(i, this, d.data), b = o._def.returns.safeParse(p, a);
2418
2412
  if (!b.success)
2419
- throw new S([n(p, b.error)]);
2413
+ throw new A([r(p, b.error)]);
2420
2414
  return b.data;
2421
2415
  });
2422
2416
  }
@@ -2428,13 +2422,13 @@ class ee extends v {
2428
2422
  return this._def.returns;
2429
2423
  }
2430
2424
  args(...e) {
2431
- return new ee({
2425
+ return new ae({
2432
2426
  ...this._def,
2433
- args: $.create(e).rest(W.create())
2427
+ args: P.create(e).rest(K.create())
2434
2428
  });
2435
2429
  }
2436
2430
  returns(e) {
2437
- return new ee({
2431
+ return new ae({
2438
2432
  ...this._def,
2439
2433
  returns: e
2440
2434
  });
@@ -2446,15 +2440,15 @@ class ee extends v {
2446
2440
  return this.parse(e);
2447
2441
  }
2448
2442
  static create(e, t, s) {
2449
- return new ee({
2450
- args: e || $.create([]).rest(W.create()),
2451
- returns: t || W.create(),
2443
+ return new ae({
2444
+ args: e || P.create([]).rest(K.create()),
2445
+ returns: t || K.create(),
2452
2446
  typeName: y.ZodFunction,
2453
2447
  ..._(s)
2454
2448
  });
2455
2449
  }
2456
2450
  }
2457
- class pe extends v {
2451
+ class ve extends v {
2458
2452
  get schema() {
2459
2453
  return this._def.getter();
2460
2454
  }
@@ -2463,18 +2457,18 @@ class pe extends v {
2463
2457
  return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
2464
2458
  }
2465
2459
  }
2466
- pe.create = (r, e) => new pe({
2467
- getter: r,
2460
+ ve.create = (n, e) => new ve({
2461
+ getter: n,
2468
2462
  typeName: y.ZodLazy,
2469
2463
  ..._(e)
2470
2464
  });
2471
- class me extends v {
2465
+ class xe extends v {
2472
2466
  _parse(e) {
2473
2467
  if (e.data !== this._def.value) {
2474
2468
  const t = this._getOrReturnCtx(e);
2475
2469
  return l(t, {
2476
2470
  received: t.data,
2477
- code: d.invalid_literal,
2471
+ code: u.invalid_literal,
2478
2472
  expected: this._def.value
2479
2473
  }), m;
2480
2474
  }
@@ -2484,37 +2478,37 @@ class me extends v {
2484
2478
  return this._def.value;
2485
2479
  }
2486
2480
  }
2487
- me.create = (r, e) => new me({
2488
- value: r,
2481
+ xe.create = (n, e) => new xe({
2482
+ value: n,
2489
2483
  typeName: y.ZodLiteral,
2490
2484
  ..._(e)
2491
2485
  });
2492
- function st(r, e) {
2493
- return new B({
2494
- values: r,
2486
+ function it(n, e) {
2487
+ return new q({
2488
+ values: n,
2495
2489
  typeName: y.ZodEnum,
2496
2490
  ..._(e)
2497
2491
  });
2498
2492
  }
2499
- class B extends v {
2493
+ class q extends v {
2500
2494
  _parse(e) {
2501
2495
  if (typeof e.data != "string") {
2502
2496
  const t = this._getOrReturnCtx(e), s = this._def.values;
2503
2497
  return l(t, {
2504
2498
  expected: x.joinValues(s),
2505
2499
  received: t.parsedType,
2506
- code: d.invalid_type
2500
+ code: u.invalid_type
2507
2501
  }), m;
2508
2502
  }
2509
2503
  if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
2510
2504
  const t = this._getOrReturnCtx(e), s = this._def.values;
2511
2505
  return l(t, {
2512
2506
  received: t.data,
2513
- code: d.invalid_enum_value,
2507
+ code: u.invalid_enum_value,
2514
2508
  options: s
2515
2509
  }), m;
2516
2510
  }
2517
- return C(e.data);
2511
+ return S(e.data);
2518
2512
  }
2519
2513
  get options() {
2520
2514
  return this._def.values;
@@ -2538,50 +2532,50 @@ class B extends v {
2538
2532
  return e;
2539
2533
  }
2540
2534
  extract(e, t = this._def) {
2541
- return B.create(e, {
2535
+ return q.create(e, {
2542
2536
  ...this._def,
2543
2537
  ...t
2544
2538
  });
2545
2539
  }
2546
2540
  exclude(e, t = this._def) {
2547
- return B.create(this.options.filter((s) => !e.includes(s)), {
2541
+ return q.create(this.options.filter((s) => !e.includes(s)), {
2548
2542
  ...this._def,
2549
2543
  ...t
2550
2544
  });
2551
2545
  }
2552
2546
  }
2553
- B.create = st;
2554
- class ye extends v {
2547
+ q.create = it;
2548
+ class be extends v {
2555
2549
  _parse(e) {
2556
2550
  const t = x.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
2557
2551
  if (s.parsedType !== f.string && s.parsedType !== f.number) {
2558
- const n = x.objectValues(t);
2552
+ const r = x.objectValues(t);
2559
2553
  return l(s, {
2560
- expected: x.joinValues(n),
2554
+ expected: x.joinValues(r),
2561
2555
  received: s.parsedType,
2562
- code: d.invalid_type
2556
+ code: u.invalid_type
2563
2557
  }), m;
2564
2558
  }
2565
2559
  if (this._cache || (this._cache = new Set(x.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
2566
- const n = x.objectValues(t);
2560
+ const r = x.objectValues(t);
2567
2561
  return l(s, {
2568
2562
  received: s.data,
2569
- code: d.invalid_enum_value,
2570
- options: n
2563
+ code: u.invalid_enum_value,
2564
+ options: r
2571
2565
  }), m;
2572
2566
  }
2573
- return C(e.data);
2567
+ return S(e.data);
2574
2568
  }
2575
2569
  get enum() {
2576
2570
  return this._def.values;
2577
2571
  }
2578
2572
  }
2579
- ye.create = (r, e) => new ye({
2580
- values: r,
2573
+ be.create = (n, e) => new be({
2574
+ values: n,
2581
2575
  typeName: y.ZodNativeEnum,
2582
2576
  ..._(e)
2583
2577
  });
2584
- class se extends v {
2578
+ class ce extends v {
2585
2579
  unwrap() {
2586
2580
  return this._def.type;
2587
2581
  }
@@ -2589,23 +2583,23 @@ class se extends v {
2589
2583
  const { ctx: t } = this._processInputParams(e);
2590
2584
  if (t.parsedType !== f.promise && t.common.async === !1)
2591
2585
  return l(t, {
2592
- code: d.invalid_type,
2586
+ code: u.invalid_type,
2593
2587
  expected: f.promise,
2594
2588
  received: t.parsedType
2595
2589
  }), m;
2596
2590
  const s = t.parsedType === f.promise ? t.data : Promise.resolve(t.data);
2597
- return C(s.then((n) => this._def.type.parseAsync(n, {
2591
+ return S(s.then((r) => this._def.type.parseAsync(r, {
2598
2592
  path: t.path,
2599
2593
  errorMap: t.common.contextualErrorMap
2600
2594
  })));
2601
2595
  }
2602
2596
  }
2603
- se.create = (r, e) => new se({
2604
- type: r,
2597
+ ce.create = (n, e) => new ce({
2598
+ type: n,
2605
2599
  typeName: y.ZodPromise,
2606
2600
  ..._(e)
2607
2601
  });
2608
- class N extends v {
2602
+ class R extends v {
2609
2603
  innerType() {
2610
2604
  return this._def.schema;
2611
2605
  }
@@ -2613,7 +2607,7 @@ class N extends v {
2613
2607
  return this._def.schema._def.typeName === y.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2614
2608
  }
2615
2609
  _parse(e) {
2616
- const { status: t, ctx: s } = this._processInputParams(e), n = this._def.effect || null, a = {
2610
+ const { status: t, ctx: s } = this._processInputParams(e), r = this._def.effect || null, a = {
2617
2611
  addIssue: (i) => {
2618
2612
  l(s, i), i.fatal ? t.abort() : t.dirty();
2619
2613
  },
@@ -2621,8 +2615,8 @@ class N extends v {
2621
2615
  return s.path;
2622
2616
  }
2623
2617
  };
2624
- if (a.addIssue = a.addIssue.bind(a), n.type === "preprocess") {
2625
- const i = n.transform(s.data, a);
2618
+ if (a.addIssue = a.addIssue.bind(a), r.type === "preprocess") {
2619
+ const i = r.transform(s.data, a);
2626
2620
  if (s.common.async)
2627
2621
  return Promise.resolve(i).then(async (o) => {
2628
2622
  if (t.value === "aborted")
@@ -2632,7 +2626,7 @@ class N extends v {
2632
2626
  path: s.path,
2633
2627
  parent: s
2634
2628
  });
2635
- return c.status === "aborted" ? m : c.status === "dirty" || t.value === "dirty" ? Q(c.value) : c;
2629
+ return c.status === "aborted" ? m : c.status === "dirty" || t.value === "dirty" ? re(c.value) : c;
2636
2630
  });
2637
2631
  {
2638
2632
  if (t.value === "aborted")
@@ -2642,12 +2636,12 @@ class N extends v {
2642
2636
  path: s.path,
2643
2637
  parent: s
2644
2638
  });
2645
- return o.status === "aborted" ? m : o.status === "dirty" || t.value === "dirty" ? Q(o.value) : o;
2639
+ return o.status === "aborted" ? m : o.status === "dirty" || t.value === "dirty" ? re(o.value) : o;
2646
2640
  }
2647
2641
  }
2648
- if (n.type === "refinement") {
2642
+ if (r.type === "refinement") {
2649
2643
  const i = (o) => {
2650
- const c = n.refinement(o, a);
2644
+ const c = r.refinement(o, a);
2651
2645
  if (s.common.async)
2652
2646
  return Promise.resolve(c);
2653
2647
  if (c instanceof Promise)
@@ -2664,66 +2658,66 @@ class N extends v {
2664
2658
  } else
2665
2659
  return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? m : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
2666
2660
  }
2667
- if (n.type === "transform")
2661
+ if (r.type === "transform")
2668
2662
  if (s.common.async === !1) {
2669
2663
  const i = this._def.schema._parseSync({
2670
2664
  data: s.data,
2671
2665
  path: s.path,
2672
2666
  parent: s
2673
2667
  });
2674
- if (!J(i))
2668
+ if (!Q(i))
2675
2669
  return m;
2676
- const o = n.transform(i.value, a);
2670
+ const o = r.transform(i.value, a);
2677
2671
  if (o instanceof Promise)
2678
2672
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2679
2673
  return { status: t.value, value: o };
2680
2674
  } else
2681
- return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => J(i) ? Promise.resolve(n.transform(i.value, a)).then((o) => ({
2675
+ return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => Q(i) ? Promise.resolve(r.transform(i.value, a)).then((o) => ({
2682
2676
  status: t.value,
2683
2677
  value: o
2684
2678
  })) : m);
2685
- x.assertNever(n);
2679
+ x.assertNever(r);
2686
2680
  }
2687
2681
  }
2688
- N.create = (r, e, t) => new N({
2689
- schema: r,
2682
+ R.create = (n, e, t) => new R({
2683
+ schema: n,
2690
2684
  typeName: y.ZodEffects,
2691
2685
  effect: e,
2692
2686
  ..._(t)
2693
2687
  });
2694
- N.createWithPreprocess = (r, e, t) => new N({
2688
+ R.createWithPreprocess = (n, e, t) => new R({
2695
2689
  schema: e,
2696
- effect: { type: "preprocess", transform: r },
2690
+ effect: { type: "preprocess", transform: n },
2697
2691
  typeName: y.ZodEffects,
2698
2692
  ..._(t)
2699
2693
  });
2700
- class E extends v {
2694
+ class Z extends v {
2701
2695
  _parse(e) {
2702
- return this._getType(e) === f.undefined ? C(void 0) : this._def.innerType._parse(e);
2696
+ return this._getType(e) === f.undefined ? S(void 0) : this._def.innerType._parse(e);
2703
2697
  }
2704
2698
  unwrap() {
2705
2699
  return this._def.innerType;
2706
2700
  }
2707
2701
  }
2708
- E.create = (r, e) => new E({
2709
- innerType: r,
2702
+ Z.create = (n, e) => new Z({
2703
+ innerType: n,
2710
2704
  typeName: y.ZodOptional,
2711
2705
  ..._(e)
2712
2706
  });
2713
- class F extends v {
2707
+ class H extends v {
2714
2708
  _parse(e) {
2715
- return this._getType(e) === f.null ? C(null) : this._def.innerType._parse(e);
2709
+ return this._getType(e) === f.null ? S(null) : this._def.innerType._parse(e);
2716
2710
  }
2717
2711
  unwrap() {
2718
2712
  return this._def.innerType;
2719
2713
  }
2720
2714
  }
2721
- F.create = (r, e) => new F({
2722
- innerType: r,
2715
+ H.create = (n, e) => new H({
2716
+ innerType: n,
2723
2717
  typeName: y.ZodNullable,
2724
2718
  ..._(e)
2725
2719
  });
2726
- class _e extends v {
2720
+ class ke extends v {
2727
2721
  _parse(e) {
2728
2722
  const { ctx: t } = this._processInputParams(e);
2729
2723
  let s = t.data;
@@ -2737,13 +2731,13 @@ class _e extends v {
2737
2731
  return this._def.innerType;
2738
2732
  }
2739
2733
  }
2740
- _e.create = (r, e) => new _e({
2741
- innerType: r,
2734
+ ke.create = (n, e) => new ke({
2735
+ innerType: n,
2742
2736
  typeName: y.ZodDefault,
2743
2737
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2744
2738
  ..._(e)
2745
2739
  });
2746
- class ge extends v {
2740
+ class we extends v {
2747
2741
  _parse(e) {
2748
2742
  const { ctx: t } = this._processInputParams(e), s = {
2749
2743
  ...t,
@@ -2751,26 +2745,26 @@ class ge extends v {
2751
2745
  ...t.common,
2752
2746
  issues: []
2753
2747
  }
2754
- }, n = this._def.innerType._parse({
2748
+ }, r = this._def.innerType._parse({
2755
2749
  data: s.data,
2756
2750
  path: s.path,
2757
2751
  parent: {
2758
2752
  ...s
2759
2753
  }
2760
2754
  });
2761
- return oe(n) ? n.then((a) => ({
2755
+ return fe(r) ? r.then((a) => ({
2762
2756
  status: "valid",
2763
2757
  value: a.status === "valid" ? a.value : this._def.catchValue({
2764
2758
  get error() {
2765
- return new S(s.common.issues);
2759
+ return new A(s.common.issues);
2766
2760
  },
2767
2761
  input: s.data
2768
2762
  })
2769
2763
  })) : {
2770
2764
  status: "valid",
2771
- value: n.status === "valid" ? n.value : this._def.catchValue({
2765
+ value: r.status === "valid" ? r.value : this._def.catchValue({
2772
2766
  get error() {
2773
- return new S(s.common.issues);
2767
+ return new A(s.common.issues);
2774
2768
  },
2775
2769
  input: s.data
2776
2770
  })
@@ -2780,8 +2774,8 @@ class ge extends v {
2780
2774
  return this._def.innerType;
2781
2775
  }
2782
2776
  }
2783
- ge.create = (r, e) => new ge({
2784
- innerType: r,
2777
+ we.create = (n, e) => new we({
2778
+ innerType: n,
2785
2779
  typeName: y.ZodCatch,
2786
2780
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2787
2781
  ..._(e)
@@ -2791,7 +2785,7 @@ class je extends v {
2791
2785
  if (this._getType(e) !== f.nan) {
2792
2786
  const s = this._getOrReturnCtx(e);
2793
2787
  return l(s, {
2794
- code: d.invalid_type,
2788
+ code: u.invalid_type,
2795
2789
  expected: f.nan,
2796
2790
  received: s.parsedType
2797
2791
  }), m;
@@ -2799,12 +2793,12 @@ class je extends v {
2799
2793
  return { status: "valid", value: e.data };
2800
2794
  }
2801
2795
  }
2802
- je.create = (r) => new je({
2796
+ je.create = (n) => new je({
2803
2797
  typeName: y.ZodNaN,
2804
- ..._(r)
2798
+ ..._(n)
2805
2799
  });
2806
- const Dt = Symbol("zod_brand");
2807
- class He extends v {
2800
+ const Vt = Symbol("zod_brand");
2801
+ class Ke extends v {
2808
2802
  _parse(e) {
2809
2803
  const { ctx: t } = this._processInputParams(e), s = t.data;
2810
2804
  return this._def.type._parse({
@@ -2817,7 +2811,7 @@ class He extends v {
2817
2811
  return this._def.type;
2818
2812
  }
2819
2813
  }
2820
- class xe extends v {
2814
+ class Se extends v {
2821
2815
  _parse(e) {
2822
2816
  const { status: t, ctx: s } = this._processInputParams(e);
2823
2817
  if (s.common.async)
@@ -2827,270 +2821,271 @@ class xe extends v {
2827
2821
  path: s.path,
2828
2822
  parent: s
2829
2823
  });
2830
- return a.status === "aborted" ? m : a.status === "dirty" ? (t.dirty(), Q(a.value)) : this._def.out._parseAsync({
2824
+ return a.status === "aborted" ? m : a.status === "dirty" ? (t.dirty(), re(a.value)) : this._def.out._parseAsync({
2831
2825
  data: a.value,
2832
2826
  path: s.path,
2833
2827
  parent: s
2834
2828
  });
2835
2829
  })();
2836
2830
  {
2837
- const n = this._def.in._parseSync({
2831
+ const r = this._def.in._parseSync({
2838
2832
  data: s.data,
2839
2833
  path: s.path,
2840
2834
  parent: s
2841
2835
  });
2842
- return n.status === "aborted" ? m : n.status === "dirty" ? (t.dirty(), {
2836
+ return r.status === "aborted" ? m : r.status === "dirty" ? (t.dirty(), {
2843
2837
  status: "dirty",
2844
- value: n.value
2838
+ value: r.value
2845
2839
  }) : this._def.out._parseSync({
2846
- data: n.value,
2840
+ data: r.value,
2847
2841
  path: s.path,
2848
2842
  parent: s
2849
2843
  });
2850
2844
  }
2851
2845
  }
2852
2846
  static create(e, t) {
2853
- return new xe({
2847
+ return new Se({
2854
2848
  in: e,
2855
2849
  out: t,
2856
2850
  typeName: y.ZodPipeline
2857
2851
  });
2858
2852
  }
2859
2853
  }
2860
- class ve extends v {
2854
+ class Te extends v {
2861
2855
  _parse(e) {
2862
- const t = this._def.innerType._parse(e), s = (n) => (J(n) && (n.value = Object.freeze(n.value)), n);
2863
- return oe(t) ? t.then((n) => s(n)) : s(t);
2856
+ const t = this._def.innerType._parse(e), s = (r) => (Q(r) && (r.value = Object.freeze(r.value)), r);
2857
+ return fe(t) ? t.then((r) => s(r)) : s(t);
2864
2858
  }
2865
2859
  unwrap() {
2866
2860
  return this._def.innerType;
2867
2861
  }
2868
2862
  }
2869
- ve.create = (r, e) => new ve({
2870
- innerType: r,
2863
+ Te.create = (n, e) => new Te({
2864
+ innerType: n,
2871
2865
  typeName: y.ZodReadonly,
2872
2866
  ..._(e)
2873
2867
  });
2874
- function Ke(r, e) {
2875
- const t = typeof r == "function" ? r(e) : typeof r == "string" ? { message: r } : r;
2868
+ function Xe(n, e) {
2869
+ const t = typeof n == "function" ? n(e) : typeof n == "string" ? { message: n } : n;
2876
2870
  return typeof t == "string" ? { message: t } : t;
2877
2871
  }
2878
- function nt(r, e = {}, t) {
2879
- return r ? re.create().superRefine((s, n) => {
2880
- const a = r(s);
2872
+ function ot(n, e = {}, t) {
2873
+ return n ? oe.create().superRefine((s, r) => {
2874
+ const a = n(s);
2881
2875
  if (a instanceof Promise)
2882
2876
  return a.then((i) => {
2883
2877
  if (!i) {
2884
- const o = Ke(e, s), c = o.fatal ?? t ?? !0;
2885
- n.addIssue({ code: "custom", ...o, fatal: c });
2878
+ const o = Xe(e, s), c = o.fatal ?? t ?? !0;
2879
+ r.addIssue({ code: "custom", ...o, fatal: c });
2886
2880
  }
2887
2881
  });
2888
2882
  if (!a) {
2889
- const i = Ke(e, s), o = i.fatal ?? t ?? !0;
2890
- n.addIssue({ code: "custom", ...i, fatal: o });
2883
+ const i = Xe(e, s), o = i.fatal ?? t ?? !0;
2884
+ r.addIssue({ code: "custom", ...i, fatal: o });
2891
2885
  }
2892
- }) : re.create();
2886
+ }) : oe.create();
2893
2887
  }
2894
- const Vt = {
2888
+ const Ut = {
2895
2889
  object: k.lazycreate
2896
2890
  };
2897
2891
  var y;
2898
- (function(r) {
2899
- r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
2892
+ (function(n) {
2893
+ n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
2900
2894
  })(y || (y = {}));
2901
- const Lt = (r, e = {
2902
- message: `Input not instance of ${r.name}`
2903
- }) => nt((t) => t instanceof r, e), g = j.create, Ye = z.create, zt = je.create, Ut = U.create, ke = ce.create, Bt = H.create, Ft = Se.create, qt = de.create, Wt = ue.create, Jt = re.create, Ht = W.create, Yt = D.create, Gt = Oe.create, O = R.create, Z = k.create, Kt = k.strictCreate, Xt = le.create, Qt = Ne.create, er = fe.create, tr = $.create, at = he.create, rr = Ae.create, sr = Y.create, nr = ee.create, ar = pe.create, ir = me.create, or = B.create, cr = ye.create, dr = se.create, Xe = N.create, ur = E.create, lr = F.create, fr = N.createWithPreprocess, hr = xe.create, pr = () => g().optional(), mr = () => Ye().optional(), yr = () => ke().optional(), _r = {
2904
- string: (r) => j.create({ ...r, coerce: !0 }),
2905
- number: (r) => z.create({ ...r, coerce: !0 }),
2906
- boolean: (r) => ce.create({
2907
- ...r,
2895
+ const Bt = (n, e = {
2896
+ message: `Input not instance of ${n.name}`
2897
+ }) => ot((t) => t instanceof n, e), g = N.create, Qe = z.create, zt = je.create, Ft = F.create, Ce = he.create, qt = Y.create, Ht = Ne.create, Wt = pe.create, Gt = me.create, Jt = oe.create, Kt = K.create, Qt = U.create, Yt = Ee.create, O = E.create, j = k.create, Xt = k.strictCreate, en = ye.create, tn = $e.create, nn = _e.create, sn = P.create, ct = ge.create, rn = Re.create, an = X.create, on = ae.create, cn = ve.create, dn = xe.create, un = q.create, ln = be.create, fn = ce.create, et = R.create, hn = Z.create, pn = H.create, mn = R.createWithPreprocess, yn = Se.create, _n = () => g().optional(), gn = () => Qe().optional(), vn = () => Ce().optional(), xn = {
2898
+ string: ((n) => N.create({ ...n, coerce: !0 })),
2899
+ number: ((n) => z.create({ ...n, coerce: !0 })),
2900
+ boolean: ((n) => he.create({
2901
+ ...n,
2908
2902
  coerce: !0
2909
- }),
2910
- bigint: (r) => U.create({ ...r, coerce: !0 }),
2911
- date: (r) => H.create({ ...r, coerce: !0 })
2912
- }, gr = m, vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2903
+ })),
2904
+ bigint: ((n) => F.create({ ...n, coerce: !0 })),
2905
+ date: ((n) => Y.create({ ...n, coerce: !0 }))
2906
+ }, bn = m, kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2913
2907
  __proto__: null,
2914
- BRAND: Dt,
2915
- DIRTY: Q,
2916
- EMPTY_PATH: yt,
2908
+ BRAND: Vt,
2909
+ DIRTY: re,
2910
+ EMPTY_PATH: gt,
2917
2911
  INVALID: m,
2918
- NEVER: gr,
2919
- OK: C,
2912
+ NEVER: bn,
2913
+ OK: S,
2920
2914
  ParseStatus: T,
2921
2915
  Schema: v,
2922
- ZodAny: re,
2923
- ZodArray: R,
2924
- ZodBigInt: U,
2925
- ZodBoolean: ce,
2926
- ZodBranded: He,
2927
- ZodCatch: ge,
2928
- ZodDate: H,
2929
- ZodDefault: _e,
2930
- ZodDiscriminatedUnion: Ne,
2931
- ZodEffects: N,
2932
- ZodEnum: B,
2933
- ZodError: S,
2916
+ ZodAny: oe,
2917
+ ZodArray: E,
2918
+ ZodBigInt: F,
2919
+ ZodBoolean: he,
2920
+ ZodBranded: Ke,
2921
+ ZodCatch: we,
2922
+ ZodDate: Y,
2923
+ ZodDefault: ke,
2924
+ ZodDiscriminatedUnion: $e,
2925
+ ZodEffects: R,
2926
+ ZodEnum: q,
2927
+ ZodError: A,
2934
2928
  get ZodFirstPartyTypeKind() {
2935
2929
  return y;
2936
2930
  },
2937
- ZodFunction: ee,
2938
- ZodIntersection: fe,
2939
- ZodIssueCode: d,
2940
- ZodLazy: pe,
2941
- ZodLiteral: me,
2942
- ZodMap: Ae,
2931
+ ZodFunction: ae,
2932
+ ZodIntersection: _e,
2933
+ ZodIssueCode: u,
2934
+ ZodLazy: ve,
2935
+ ZodLiteral: xe,
2936
+ ZodMap: Re,
2943
2937
  ZodNaN: je,
2944
- ZodNativeEnum: ye,
2945
- ZodNever: D,
2946
- ZodNull: ue,
2947
- ZodNullable: F,
2938
+ ZodNativeEnum: be,
2939
+ ZodNever: U,
2940
+ ZodNull: me,
2941
+ ZodNullable: H,
2948
2942
  ZodNumber: z,
2949
2943
  ZodObject: k,
2950
- ZodOptional: E,
2944
+ ZodOptional: Z,
2951
2945
  ZodParsedType: f,
2952
- ZodPipeline: xe,
2953
- ZodPromise: se,
2954
- ZodReadonly: ve,
2955
- ZodRecord: he,
2946
+ ZodPipeline: Se,
2947
+ ZodPromise: ce,
2948
+ ZodReadonly: Te,
2949
+ ZodRecord: ge,
2956
2950
  ZodSchema: v,
2957
- ZodSet: Y,
2958
- ZodString: j,
2959
- ZodSymbol: Se,
2960
- ZodTransformer: N,
2961
- ZodTuple: $,
2951
+ ZodSet: X,
2952
+ ZodString: N,
2953
+ ZodSymbol: Ne,
2954
+ ZodTransformer: R,
2955
+ ZodTuple: P,
2962
2956
  ZodType: v,
2963
- ZodUndefined: de,
2964
- ZodUnion: le,
2965
- ZodUnknown: W,
2966
- ZodVoid: Oe,
2957
+ ZodUndefined: pe,
2958
+ ZodUnion: ye,
2959
+ ZodUnknown: K,
2960
+ ZodVoid: Ee,
2967
2961
  addIssueToContext: l,
2968
2962
  any: Jt,
2969
2963
  array: O,
2970
- bigint: Ut,
2971
- boolean: ke,
2972
- coerce: _r,
2973
- custom: nt,
2974
- date: Bt,
2975
- datetimeRegex: rt,
2976
- defaultErrorMap: te,
2977
- discriminatedUnion: Qt,
2978
- effect: Xe,
2979
- enum: or,
2980
- function: nr,
2981
- getErrorMap: Te,
2982
- getParsedType: M,
2983
- instanceof: Lt,
2984
- intersection: er,
2985
- isAborted: qe,
2986
- isAsync: oe,
2964
+ bigint: Ft,
2965
+ boolean: Ce,
2966
+ coerce: xn,
2967
+ custom: ot,
2968
+ date: qt,
2969
+ datetimeRegex: at,
2970
+ defaultErrorMap: ie,
2971
+ discriminatedUnion: tn,
2972
+ effect: et,
2973
+ enum: un,
2974
+ function: on,
2975
+ getErrorMap: Ae,
2976
+ getParsedType: V,
2977
+ instanceof: Bt,
2978
+ intersection: nn,
2979
+ isAborted: He,
2980
+ isAsync: fe,
2987
2981
  isDirty: We,
2988
- isValid: J,
2989
- late: Vt,
2990
- lazy: ar,
2991
- literal: ir,
2992
- makeIssue: Ce,
2993
- map: rr,
2982
+ isValid: Q,
2983
+ late: Ut,
2984
+ lazy: cn,
2985
+ literal: dn,
2986
+ makeIssue: Oe,
2987
+ map: rn,
2994
2988
  nan: zt,
2995
- nativeEnum: cr,
2996
- never: Yt,
2997
- null: Wt,
2998
- nullable: lr,
2999
- number: Ye,
3000
- object: Z,
2989
+ nativeEnum: ln,
2990
+ never: Qt,
2991
+ null: Gt,
2992
+ nullable: pn,
2993
+ number: Qe,
2994
+ object: j,
3001
2995
  get objectUtil() {
3002
- return Fe;
2996
+ return qe;
3003
2997
  },
3004
- oboolean: yr,
3005
- onumber: mr,
3006
- optional: ur,
3007
- ostring: pr,
3008
- pipeline: hr,
3009
- preprocess: fr,
3010
- promise: dr,
3011
- quotelessJson: pt,
3012
- record: at,
3013
- set: sr,
3014
- setErrorMap: mt,
3015
- strictObject: Kt,
2998
+ oboolean: vn,
2999
+ onumber: gn,
3000
+ optional: hn,
3001
+ ostring: _n,
3002
+ pipeline: yn,
3003
+ preprocess: mn,
3004
+ promise: fn,
3005
+ quotelessJson: yt,
3006
+ record: ct,
3007
+ set: an,
3008
+ setErrorMap: _t,
3009
+ strictObject: Xt,
3016
3010
  string: g,
3017
- symbol: Ft,
3018
- transformer: Xe,
3019
- tuple: tr,
3020
- undefined: qt,
3021
- union: Xt,
3022
- unknown: Ht,
3011
+ symbol: Ht,
3012
+ transformer: et,
3013
+ tuple: sn,
3014
+ undefined: Wt,
3015
+ union: en,
3016
+ unknown: Kt,
3023
3017
  get util() {
3024
3018
  return x;
3025
3019
  },
3026
- void: Gt
3020
+ void: Yt
3027
3021
  }, Symbol.toStringTag, { value: "Module" }));
3028
- ht(vr);
3029
- const xr = (r, e) => e.skipDedupe || e.method !== "GET", kr = (r, e) => e.method + "@" + r, br = (r) => r.clone(), wr = ({ skip: r = xr, key: e = kr, resolver: t = br } = {}) => {
3022
+ mt(kn);
3023
+ const wn = (n, e) => e.skipDedupe || e.method !== "GET", Tn = (n, e) => e.method + "@" + n, Sn = (n) => n.clone(), Cn = ({ skip: n = wn, key: e = Tn, resolver: t = Sn } = {}) => {
3030
3024
  const s = /* @__PURE__ */ new Map();
3031
- return (n) => (a, i) => {
3032
- if (r(a, i))
3033
- return n(a, i);
3025
+ return (r) => (a, i) => {
3026
+ if (n(a, i))
3027
+ return r(a, i);
3034
3028
  const o = e(a, i);
3035
3029
  if (!s.has(o))
3036
3030
  s.set(o, []);
3037
3031
  else
3038
- return new Promise((c, u) => {
3039
- s.get(o).push([c, u]);
3032
+ return new Promise((c, d) => {
3033
+ s.get(o).push([c, d]);
3040
3034
  });
3041
3035
  try {
3042
- return n(a, i).then((c) => (s.get(o).forEach(([u]) => u(t(c))), s.delete(o), c)).catch((c) => {
3043
- throw s.get(o).forEach(([, u]) => u(c)), s.delete(o), c;
3036
+ return r(a, i).then((c) => (s.get(o).forEach(([d]) => d(t(c))), s.delete(o), c)).catch((c) => {
3037
+ throw s.get(o).forEach(([, d]) => d(c)), s.delete(o), c;
3044
3038
  });
3045
3039
  } catch (c) {
3046
3040
  return s.delete(o), Promise.reject(c);
3047
3041
  }
3048
3042
  };
3049
- }, Tr = (r, e) => r * e, Cr = (r) => r && r.ok, Sr = ({ delayTimer: r = 500, delayRamp: e = Tr, maxAttempts: t = 10, until: s = Cr, onRetry: n = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: i = !1, skip: o } = {}) => (c) => (u, p) => {
3043
+ }, An = (n, e) => n * e, On = (n) => n && (n.ok || n.status >= 400 && n.status < 500), Nn = ({ delayTimer: n = 500, delayRamp: e = An, maxAttempts: t = 10, until: s = On, onRetry: r = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: i = !1, skip: o } = {}) => (c) => (d, p) => {
3050
3044
  let b = 0;
3051
- if (o && o(u, p))
3052
- return c(u, p);
3053
- const A = (w, V) => Promise.resolve(s(w, V)).then((Ze) => Ze ? w && i ? w : V ? Promise.reject(V) : w : (b++, !t || b <= t ? new Promise((L) => {
3054
- const be = e(r, b);
3045
+ if (o && o(d, p))
3046
+ return c(d, p);
3047
+ const C = (w, I) => Promise.resolve(s(w, I)).then((de) => de ? w && i ? w : I ? Promise.reject(I) : w : (b++, !t || b <= t ? new Promise((M) => {
3048
+ const W = e(n, b);
3055
3049
  setTimeout(() => {
3056
- typeof n == "function" ? Promise.resolve(n({
3050
+ typeof r == "function" ? Promise.resolve(r({
3057
3051
  response: w,
3058
- error: V,
3059
- url: u,
3052
+ error: I,
3053
+ url: d,
3054
+ attempt: b,
3060
3055
  options: p
3061
- })).then((q = {}) => {
3062
- var ne, ae;
3063
- L(c((ne = q && q.url) !== null && ne !== void 0 ? ne : u, (ae = q && q.options) !== null && ae !== void 0 ? ae : p));
3064
- }) : L(c(u, p));
3065
- }, be);
3066
- }).then(A).catch((L) => {
3056
+ })).then((D = {}) => {
3057
+ var ee, G;
3058
+ M(c((ee = D && D.url) !== null && ee !== void 0 ? ee : d, (G = D && D.options) !== null && G !== void 0 ? G : p));
3059
+ }) : M(c(d, p));
3060
+ }, W);
3061
+ }).then(C).catch((M) => {
3067
3062
  if (!a)
3068
- throw L;
3069
- return A(null, L);
3070
- }) : w && i ? w : Promise.reject(V || new Error("Number of attempts exceeded."))));
3071
- return c(u, p).then(A).catch((w) => {
3063
+ throw M;
3064
+ return C(null, M);
3065
+ }) : w && i ? w : Promise.reject(I || new Error("Number of attempts exceeded."))));
3066
+ return c(d, p).then(C).catch((w) => {
3072
3067
  if (!a)
3073
3068
  throw w;
3074
- return A(null, w);
3069
+ return C(null, w);
3075
3070
  });
3076
- }, Re = Z({
3077
- code: Ye(),
3071
+ }, Ie = j({
3072
+ code: Qe(),
3078
3073
  message: g()
3079
- }), Or = Z({
3074
+ }), En = j({
3080
3075
  message: g()
3081
- }), Ar = Z({
3076
+ }), Rn = j({
3082
3077
  emails: O(g()).optional(),
3083
3078
  http_body: g().optional(),
3084
3079
  http_url: g().optional(),
3085
3080
  txt_name: g().optional(),
3086
3081
  txt_value: g().optional()
3087
- }), jr = Z({
3082
+ }), jn = j({
3088
3083
  ciphers: O(g()).optional(),
3089
3084
  early_hints: g().optional(),
3090
3085
  http2: g().optional(),
3091
3086
  min_tls_version: g().optional(),
3092
3087
  tls_1_3: g().optional()
3093
- }), Rr = Z({
3088
+ }), In = j({
3094
3089
  id: g(),
3095
3090
  bundle_method: g().optional(),
3096
3091
  certificate_authority: g(),
@@ -3102,86 +3097,86 @@ const xr = (r, e) => e.skipDedupe || e.method !== "GET", kr = (r, e) => e.method
3102
3097
  issuer: g().optional(),
3103
3098
  method: g(),
3104
3099
  serial_number: g().optional(),
3105
- settings: jr.optional(),
3100
+ settings: jn.optional(),
3106
3101
  signature: g().optional(),
3107
3102
  type: g(),
3108
3103
  uploaded_on: g().optional(),
3109
- validation_errors: O(Or).optional(),
3110
- validation_records: O(Ar).optional(),
3111
- wildcard: ke()
3112
- }), Nr = Z({
3104
+ validation_errors: O(En).optional(),
3105
+ validation_records: O(Rn).optional(),
3106
+ wildcard: Ce()
3107
+ }), Zn = j({
3113
3108
  name: g(),
3114
3109
  type: g(),
3115
3110
  value: g()
3116
- }), Zr = Z({
3111
+ }), $n = j({
3117
3112
  http_body: g().optional(),
3118
3113
  http_url: g().optional()
3119
- }), it = Z({
3114
+ }), dt = j({
3120
3115
  id: g(),
3121
- ssl: Rr,
3116
+ ssl: In,
3122
3117
  hostname: g(),
3123
- custom_metadata: at(g()).optional(),
3118
+ custom_metadata: ct(g()).optional(),
3124
3119
  custom_origin_server: g().optional(),
3125
3120
  custom_origin_sni: g().optional(),
3126
- ownership_verification: Nr.optional(),
3127
- ownership_verification_http: Zr.optional(),
3121
+ ownership_verification: Zn.optional(),
3122
+ ownership_verification_http: $n.optional(),
3128
3123
  status: g(),
3129
3124
  verification_errors: O(g()).optional(),
3130
3125
  created_at: g()
3131
- }), Ue = Z({
3132
- errors: O(Re),
3133
- messages: O(Re),
3134
- success: ke(),
3135
- result: it
3136
- }), Er = Z({
3137
- errors: O(Re),
3138
- messages: O(Re),
3139
- success: ke(),
3140
- result: O(it)
3126
+ }), ze = j({
3127
+ errors: O(Ie),
3128
+ messages: O(Ie),
3129
+ success: Ce(),
3130
+ result: dt
3131
+ }), Pn = j({
3132
+ errors: O(Ie),
3133
+ messages: O(Ie),
3134
+ success: Ce(),
3135
+ result: O(dt)
3141
3136
  });
3142
- function K(r) {
3143
- return ut(`https://api.cloudflare.com/client/v4/zones/${r.zoneId}`).headers({
3144
- "X-Auth-Email": r.authEmail,
3145
- "X-Auth-Key": r.authKey,
3137
+ function ne(n) {
3138
+ return ft(`https://api.cloudflare.com/client/v4/zones/${n.zoneId}`).headers({
3139
+ "X-Auth-Email": n.authEmail,
3140
+ "X-Auth-Key": n.authKey,
3146
3141
  "Content-Type": "application/json"
3147
- }).middlewares([Sr(), wr()]);
3142
+ }).middlewares([Nn(), Cn()]);
3148
3143
  }
3149
- function Be(r) {
3144
+ function Fe(n) {
3150
3145
  const e = [];
3151
- if (r.ssl.validation_records)
3152
- for (const t of r.ssl.validation_records)
3146
+ if (n.ssl.validation_records)
3147
+ for (const t of n.ssl.validation_records)
3153
3148
  t.txt_name && t.txt_value && e.push({
3154
3149
  name: "txt",
3155
3150
  record: t.txt_value,
3156
3151
  domain: t.txt_name
3157
3152
  });
3158
- return r.ownership_verification && e.push({
3153
+ return n.ownership_verification && e.push({
3159
3154
  name: "txt",
3160
- record: r.ownership_verification.value,
3161
- domain: r.ownership_verification.name
3155
+ record: n.ownership_verification.value,
3156
+ domain: n.ownership_verification.name
3162
3157
  }), {
3163
- custom_domain_id: r.id,
3164
- domain: r.hostname,
3165
- primary: r.primary,
3166
- status: r.status === "active" ? "ready" : "pending",
3158
+ custom_domain_id: n.id,
3159
+ domain: n.hostname,
3160
+ primary: n.primary,
3161
+ status: n.status === "active" ? "ready" : "pending",
3167
3162
  type: "auth0_managed_certs",
3168
3163
  verification: {
3169
- methods: O(dt).parse(e)
3164
+ methods: O(lt).parse(e)
3170
3165
  }
3171
3166
  };
3172
3167
  }
3173
- function Ir(r) {
3168
+ function Mn(n) {
3174
3169
  return {
3175
3170
  create: async (e, t) => {
3176
- const { result: s, errors: n, success: a } = Ue.parse(
3177
- await K(r).post(
3171
+ const { result: s, errors: r, success: a } = ze.parse(
3172
+ await ne(n).post(
3178
3173
  {
3179
3174
  hostname: t.domain,
3180
3175
  ssl: {
3181
3176
  method: "txt",
3182
3177
  type: "dv"
3183
3178
  },
3184
- custom_metadata: r.enterprise ? {
3179
+ custom_metadata: n.enterprise ? {
3185
3180
  tenant_id: e
3186
3181
  } : void 0
3187
3182
  },
@@ -3189,77 +3184,72 @@ function Ir(r) {
3189
3184
  ).json()
3190
3185
  );
3191
3186
  if (!a)
3192
- throw new Error(JSON.stringify(n));
3193
- const i = Be({
3187
+ throw new Error(JSON.stringify(r));
3188
+ const i = Fe({
3194
3189
  ...s,
3195
3190
  primary: !1
3196
3191
  });
3197
- return await r.customDomainAdapter.create(e, {
3192
+ return await n.customDomainAdapter.create(e, {
3198
3193
  custom_domain_id: i.custom_domain_id,
3199
3194
  domain: i.domain,
3200
3195
  type: i.type
3201
3196
  }), i;
3202
3197
  },
3203
3198
  get: async (e, t) => {
3204
- var c;
3205
- const s = await r.customDomainAdapter.get(
3199
+ const s = await n.customDomainAdapter.get(
3206
3200
  e,
3207
3201
  t
3208
3202
  );
3209
3203
  if (!s)
3210
- throw new G(404);
3211
- const n = await K(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json(), { result: a, errors: i, success: o } = Ue.parse(n);
3204
+ throw new te(404);
3205
+ const r = await ne(n).get(`/custom_hostnames/${encodeURIComponent(t)}`).json(), { result: a, errors: i, success: o } = ze.parse(r);
3212
3206
  if (!o)
3213
- throw new G(503, {
3207
+ throw new te(503, {
3214
3208
  message: JSON.stringify(i)
3215
3209
  });
3216
- if (r.enterprise && ((c = a.custom_metadata) == null ? void 0 : c.tenant_id) !== e)
3217
- throw new G(404);
3218
- return Be({ ...s, ...a });
3210
+ if (n.enterprise && a.custom_metadata?.tenant_id !== e)
3211
+ throw new te(404);
3212
+ return Fe({ ...s, ...a });
3219
3213
  },
3220
- getByDomain: async (e) => r.customDomainAdapter.getByDomain(e),
3214
+ getByDomain: async (e) => n.customDomainAdapter.getByDomain(e),
3221
3215
  list: async (e) => {
3222
- const t = await r.customDomainAdapter.list(e), s = await K(r).get("/custom_hostnames").json(), { result: n, errors: a, success: i } = Er.parse(s);
3216
+ const t = await n.customDomainAdapter.list(e), s = await ne(n).get("/custom_hostnames").json(), { result: r, errors: a, success: i } = Pn.parse(s);
3223
3217
  if (!i)
3224
- throw new G(503, {
3218
+ throw new te(503, {
3225
3219
  message: JSON.stringify(a)
3226
3220
  });
3227
- return n.filter(
3221
+ return r.filter(
3228
3222
  (o) => t.find((c) => c.custom_domain_id === o.id)
3229
3223
  ).filter(
3230
- (o) => {
3231
- var c;
3232
- return !(r.enterprise && ((c = o.custom_metadata) == null ? void 0 : c.tenant_id) !== e);
3233
- }
3224
+ (o) => !(n.enterprise && o.custom_metadata?.tenant_id !== e)
3234
3225
  ).map(
3235
- (o) => Be({
3226
+ (o) => Fe({
3236
3227
  ...t.find((c) => c.custom_domain_id === o.id),
3237
3228
  ...o
3238
3229
  })
3239
3230
  );
3240
3231
  },
3241
3232
  remove: async (e, t) => {
3242
- var n;
3243
- if (r.enterprise) {
3244
- const { result: a, success: i } = Ue.parse(
3245
- await K(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json()
3233
+ if (n.enterprise) {
3234
+ const { result: r, success: a } = ze.parse(
3235
+ await ne(n).get(`/custom_hostnames/${encodeURIComponent(t)}`).json()
3246
3236
  );
3247
- if (!i || ((n = a.custom_metadata) == null ? void 0 : n.tenant_id) !== e)
3248
- throw new G(404);
3237
+ if (!a || r.custom_metadata?.tenant_id !== e)
3238
+ throw new te(404);
3249
3239
  }
3250
- const s = await K(r).delete(`/custom_hostnames/${encodeURIComponent(t)}`).res();
3251
- return s.ok && await r.customDomainAdapter.remove(e, t), s.ok;
3240
+ const s = await ne(n).delete(`/custom_hostnames/${encodeURIComponent(t)}`).res();
3241
+ return s.ok && await n.customDomainAdapter.remove(e, t), s.ok;
3252
3242
  },
3253
3243
  update: async (e, t, s) => {
3254
- const n = await K(r).patch(
3244
+ const r = await ne(n).patch(
3255
3245
  s,
3256
3246
  `/custom_hostnames/${encodeURIComponent(t)}`
3257
3247
  ).res();
3258
- if (!n.ok)
3259
- throw new G(503, {
3260
- message: await n.text()
3248
+ if (!r.ok)
3249
+ throw new te(503, {
3250
+ message: await r.text()
3261
3251
  });
3262
- return r.customDomainAdapter.update(
3252
+ return n.customDomainAdapter.update(
3263
3253
  e,
3264
3254
  t,
3265
3255
  s
@@ -3267,11 +3257,11 @@ function Ir(r) {
3267
3257
  }
3268
3258
  };
3269
3259
  }
3270
- class $r {
3260
+ class Dn {
3271
3261
  constructor(e) {
3272
- we(this, "cache", null);
3273
3262
  this.config = e;
3274
3263
  }
3264
+ cache = null;
3275
3265
  async getCache() {
3276
3266
  if (this.cache)
3277
3267
  return this.cache;
@@ -3289,10 +3279,10 @@ class $r {
3289
3279
  }
3290
3280
  async get(e) {
3291
3281
  try {
3292
- const t = await this.getCache(), s = this.createRequest(e), n = await t.match(s);
3293
- if (!n)
3282
+ const t = await this.getCache(), s = this.createRequest(e), r = await t.match(s);
3283
+ if (!r)
3294
3284
  return null;
3295
- const a = await n.json();
3285
+ const a = await r.json();
3296
3286
  return a.expiresAt && new Date(a.expiresAt) < /* @__PURE__ */ new Date() ? (await this.delete(e), null) : a.value;
3297
3287
  } catch (t) {
3298
3288
  return console.error(`CloudflareCache: get error for key ${e}:`, t), null;
@@ -3300,20 +3290,20 @@ class $r {
3300
3290
  }
3301
3291
  async set(e, t, s) {
3302
3292
  try {
3303
- const n = await this.getCache(), a = s ?? this.config.defaultTtlSeconds, i = a !== void 0, o = i ? Math.max(0, a) : 0, c = {
3293
+ const r = await this.getCache(), a = s ?? this.config.defaultTtlSeconds, i = a !== void 0, o = i ? Math.max(0, a) : 0, c = {
3304
3294
  value: t,
3305
3295
  expiresAt: i ? new Date(Date.now() + (o > 0 ? o * 1e3 : -1)).toISOString() : void 0,
3306
3296
  cachedAt: (/* @__PURE__ */ new Date()).toISOString()
3307
- }, u = this.createRequest(e), p = {
3297
+ }, d = this.createRequest(e), p = {
3308
3298
  "Content-Type": "application/json"
3309
3299
  };
3310
3300
  i && o > 0 && (p["Cache-Control"] = `max-age=${o}`);
3311
3301
  const b = new Response(JSON.stringify(c), {
3312
3302
  headers: p
3313
3303
  });
3314
- await n.put(u, b);
3315
- } catch (n) {
3316
- console.error(`CloudflareCache: set error for key ${e}:`, n);
3304
+ await r.put(d, b);
3305
+ } catch (r) {
3306
+ console.error(`CloudflareCache: set error for key ${e}:`, r);
3317
3307
  }
3318
3308
  }
3319
3309
  async delete(e) {
@@ -3330,30 +3320,421 @@ class $r {
3330
3320
  );
3331
3321
  }
3332
3322
  }
3333
- function Pr(r = {}) {
3323
+ function Ln(n = {}) {
3334
3324
  const e = {
3335
3325
  defaultTtlSeconds: 300,
3336
3326
  // 5 minutes default
3337
3327
  keyPrefix: "authhero",
3338
3328
  // default prefix
3339
- ...r
3329
+ ...n
3340
3330
  // user config overrides defaults
3341
3331
  };
3342
- return new $r(e);
3332
+ return new Dn(e);
3333
+ }
3334
+ const Vn = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3335
+ let Un = (n = 21) => {
3336
+ let e = "", t = crypto.getRandomValues(new Uint8Array(n |= 0));
3337
+ for (; n--; )
3338
+ e += Vn[t[n] & 63];
3339
+ return e;
3340
+ };
3341
+ async function Je(n, e) {
3342
+ const t = n.timeout || 3e4, s = new AbortController(), r = setTimeout(() => s.abort(), t);
3343
+ try {
3344
+ const a = `https://api.sql.cloudflarestorage.com/api/v1/accounts/${n.accountId}/r2-sql/query/${n.warehouseName}`, i = await fetch(a, {
3345
+ method: "POST",
3346
+ headers: {
3347
+ "Content-Type": "application/json",
3348
+ Authorization: `Bearer ${n.authToken}`
3349
+ },
3350
+ // Request body should be shaped as { "query": "..." }
3351
+ body: JSON.stringify({
3352
+ query: e
3353
+ }),
3354
+ signal: s.signal
3355
+ });
3356
+ if (!i.ok)
3357
+ throw new Error(
3358
+ `R2 SQL query failed: ${i.status} ${i.statusText}`
3359
+ );
3360
+ const o = await i.json();
3361
+ if (!o.success && o.errors)
3362
+ throw new Error(`R2 SQL error: ${o.errors.join(", ")}`);
3363
+ return o.data || o.result?.data || [];
3364
+ } finally {
3365
+ clearTimeout(r);
3366
+ }
3367
+ }
3368
+ function Ze(n) {
3369
+ return `'${n.replace(/'/g, "''")}'`;
3370
+ }
3371
+ function B(n) {
3372
+ return `"${n.replace(/"/g, '""')}"`;
3373
+ }
3374
+ function ut(n) {
3375
+ const e = (t) => {
3376
+ if (!t)
3377
+ return "";
3378
+ try {
3379
+ return JSON.parse(t);
3380
+ } catch {
3381
+ return t;
3382
+ }
3383
+ };
3384
+ return {
3385
+ type: n.type,
3386
+ date: n.date,
3387
+ description: n.description,
3388
+ ip: n.ip,
3389
+ user_agent: n.user_agent,
3390
+ details: e(n.details),
3391
+ isMobile: !!n.isMobile,
3392
+ user_id: n.user_id,
3393
+ user_name: n.user_name,
3394
+ connection: n.connection,
3395
+ connection_id: n.connection_id,
3396
+ client_id: n.client_id,
3397
+ client_name: n.client_name,
3398
+ audience: n.audience,
3399
+ scope: n.scope,
3400
+ strategy: n.strategy,
3401
+ strategy_type: n.strategy_type,
3402
+ hostname: n.hostname,
3403
+ auth0_client: e(n.auth0_client),
3404
+ log_id: n.id
3405
+ };
3406
+ }
3407
+ function Bn(n) {
3408
+ return async (e, t) => {
3409
+ if (console.log("createLog called with config:", n), n.baseAdapter) {
3410
+ const a = await n.baseAdapter.create(e, t);
3411
+ return (n.pipelineEndpoint || n.pipelineBinding) && tt(n, e, a).catch((i) => {
3412
+ console.error("Failed to send log to Pipeline:", i);
3413
+ }), a;
3414
+ }
3415
+ const s = t.log_id || Un(), r = {
3416
+ ...t,
3417
+ log_id: s
3418
+ };
3419
+ return await tt(n, e, r), console.log("Log sent to Pipeline with ID:", s), r;
3420
+ };
3421
+ }
3422
+ async function tt(n, e, t) {
3423
+ const s = (c) => c ? JSON.stringify(c) : void 0, r = {
3424
+ id: t.log_id,
3425
+ tenant_id: e,
3426
+ type: t.type,
3427
+ date: t.date,
3428
+ description: t.description?.substring(0, 256),
3429
+ ip: t.ip,
3430
+ user_agent: t.user_agent,
3431
+ details: s(t.details)?.substring(0, 8192),
3432
+ isMobile: t.isMobile ? 1 : 0,
3433
+ user_id: t.user_id,
3434
+ user_name: t.user_name,
3435
+ connection: t.connection,
3436
+ connection_id: t.connection_id,
3437
+ client_id: t.client_id,
3438
+ client_name: t.client_name,
3439
+ audience: t.audience,
3440
+ scope: t.scope,
3441
+ strategy: t.strategy,
3442
+ strategy_type: t.strategy_type,
3443
+ hostname: t.hostname,
3444
+ auth0_client: s(t.auth0_client),
3445
+ log_id: t.log_id
3446
+ }, a = n.timeout || 3e4, i = new AbortController(), o = setTimeout(() => i.abort(), a);
3447
+ try {
3448
+ let c;
3449
+ if (n.pipelineBinding)
3450
+ c = await n.pipelineBinding.fetch("https://pipeline", {
3451
+ method: "POST",
3452
+ headers: {
3453
+ "Content-Type": "application/json"
3454
+ },
3455
+ body: JSON.stringify([r]),
3456
+ // Pipelines accept array of records
3457
+ signal: i.signal
3458
+ });
3459
+ else if (n.pipelineEndpoint)
3460
+ c = await fetch(n.pipelineEndpoint, {
3461
+ method: "POST",
3462
+ headers: {
3463
+ "Content-Type": "application/json"
3464
+ },
3465
+ body: JSON.stringify([r]),
3466
+ // Pipelines accept array of records
3467
+ signal: i.signal
3468
+ });
3469
+ else
3470
+ throw new Error(
3471
+ "Either pipelineEndpoint or pipelineBinding must be configured"
3472
+ );
3473
+ if (!c.ok)
3474
+ throw new Error(
3475
+ `Pipeline ingestion failed: ${c.status} ${c.statusText}`
3476
+ );
3477
+ } finally {
3478
+ clearTimeout(o);
3479
+ }
3480
+ }
3481
+ function zn(n) {
3482
+ return async (e, t) => {
3483
+ if (n.baseAdapter)
3484
+ return n.baseAdapter.get(e, t);
3485
+ const s = n.namespace || "default", r = n.tableName || "logs", a = `
3486
+ SELECT * FROM ${B(s)}.${B(r)}
3487
+ WHERE tenant_id = ${Ze(e)}
3488
+ AND id = ${Ze(t)}
3489
+ LIMIT 1
3490
+ `, i = await Je(n, a);
3491
+ if (i.length === 0)
3492
+ return null;
3493
+ const o = i[0];
3494
+ return o ? ut(o) : null;
3495
+ };
3496
+ }
3497
+ function Fn(n) {
3498
+ const e = {};
3499
+ return (n.match(/(\w+):(\S+)/g) || []).forEach((s) => {
3500
+ const [r, a] = s.split(":");
3501
+ r && a && (e[r] = a);
3502
+ }), e;
3503
+ }
3504
+ function qn(n) {
3505
+ const e = [];
3506
+ for (const [t, s] of Object.entries(n)) {
3507
+ const r = t.replace(/[^a-zA-Z0-9_]/g, "");
3508
+ r && s && e.push(
3509
+ `${B(r)} = ${Ze(s)}`
3510
+ );
3511
+ }
3512
+ return e;
3513
+ }
3514
+ function Hn(n) {
3515
+ return async (e, t = {}) => {
3516
+ if (n.baseAdapter)
3517
+ return n.baseAdapter.list(e, t);
3518
+ const { page: s = 0, per_page: r = 50, include_totals: a = !1, sort: i, q: o } = t, c = n.namespace || "default", d = n.tableName || "logs", p = [
3519
+ `tenant_id = ${Ze(e)}`
3520
+ ];
3521
+ if (o) {
3522
+ const J = Fn(o);
3523
+ p.push(...qn(J));
3524
+ }
3525
+ const b = p.join(" AND ");
3526
+ let C = "ORDER BY date DESC";
3527
+ if (i && i.sort_by) {
3528
+ const J = i.sort_by.replace(/[^a-zA-Z0-9_]/g, ""), ue = i.sort_order === "asc" ? "ASC" : "DESC";
3529
+ C = `ORDER BY ${B(J)} ${ue}`;
3530
+ }
3531
+ const w = s * r, I = `LIMIT ${r} OFFSET ${w}`, de = `
3532
+ SELECT * FROM ${B(c)}.${B(d)}
3533
+ WHERE ${b}
3534
+ ${C}
3535
+ ${I}
3536
+ `, W = (await Je(n, de)).map(ut);
3537
+ if (!a)
3538
+ return {
3539
+ logs: W,
3540
+ start: 0,
3541
+ limit: 0,
3542
+ length: 0
3543
+ };
3544
+ const D = `
3545
+ SELECT COUNT(*) as count FROM ${B(c)}.${B(d)}
3546
+ WHERE ${b}
3547
+ `, G = (await Je(n, D))[0]?.count || 0;
3548
+ return {
3549
+ logs: W,
3550
+ start: w,
3551
+ limit: r,
3552
+ length: Number(G)
3553
+ };
3554
+ };
3343
3555
  }
3344
- function Lr(r) {
3556
+ function Wn(n) {
3557
+ const e = !!n.baseAdapter, t = !!n.pipelineEndpoint, s = !!n.pipelineBinding;
3558
+ if (!e && !t && !s)
3559
+ throw new Error(
3560
+ 'R2 SQL logs adapter requires one of: "baseAdapter", "pipelineEndpoint", or "pipelineBinding"'
3561
+ );
3562
+ if (!e) {
3563
+ if (!n.authToken)
3564
+ throw new Error('R2 SQL logs adapter requires "authToken" configuration');
3565
+ if (!n.warehouseName)
3566
+ throw new Error(
3567
+ 'R2 SQL logs adapter requires "warehouseName" configuration'
3568
+ );
3569
+ }
3570
+ return {
3571
+ create: Bn(n),
3572
+ list: Hn(n),
3573
+ get: zn(n)
3574
+ };
3575
+ }
3576
+ function Gn(n) {
3345
3577
  return {
3346
- customDomains: Ir(r),
3578
+ async getGeoInfo() {
3579
+ try {
3580
+ const e = n.getHeaders(), t = e["cf-ipcountry"], s = e["cf-ipcity"], r = e["cf-iplatitude"], a = e["cf-iplongitude"], i = e["cf-timezone"], o = e["cf-ipcontinent"];
3581
+ if (!t)
3582
+ return null;
3583
+ const c = Jn(t), d = Kn(t);
3584
+ return {
3585
+ country_code: t,
3586
+ country_code3: c,
3587
+ country_name: d,
3588
+ city_name: s || "",
3589
+ latitude: r || "",
3590
+ longitude: a || "",
3591
+ time_zone: i || "",
3592
+ continent_code: o || ""
3593
+ };
3594
+ } catch (e) {
3595
+ return console.warn("Failed to get geo info from Cloudflare headers:", e), null;
3596
+ }
3597
+ }
3598
+ };
3599
+ }
3600
+ function Jn(n) {
3601
+ return {
3602
+ // North America
3603
+ US: "USA",
3604
+ CA: "CAN",
3605
+ MX: "MEX",
3606
+ // Europe
3607
+ GB: "GBR",
3608
+ DE: "DEU",
3609
+ FR: "FRA",
3610
+ IT: "ITA",
3611
+ ES: "ESP",
3612
+ NL: "NLD",
3613
+ BE: "BEL",
3614
+ CH: "CHE",
3615
+ AT: "AUT",
3616
+ SE: "SWE",
3617
+ NO: "NOR",
3618
+ DK: "DNK",
3619
+ FI: "FIN",
3620
+ PL: "POL",
3621
+ RU: "RUS",
3622
+ UA: "UKR",
3623
+ // Asia
3624
+ JP: "JPN",
3625
+ CN: "CHN",
3626
+ IN: "IND",
3627
+ KR: "KOR",
3628
+ SG: "SGP",
3629
+ HK: "HKG",
3630
+ TW: "TWN",
3631
+ TH: "THA",
3632
+ MY: "MYS",
3633
+ ID: "IDN",
3634
+ PH: "PHL",
3635
+ VN: "VNM",
3636
+ // Oceania
3637
+ AU: "AUS",
3638
+ NZ: "NZL",
3639
+ // South America
3640
+ BR: "BRA",
3641
+ AR: "ARG",
3642
+ CL: "CHL",
3643
+ CO: "COL",
3644
+ PE: "PER",
3645
+ VE: "VEN",
3646
+ // Africa
3647
+ ZA: "ZAF",
3648
+ EG: "EGY",
3649
+ NG: "NGA",
3650
+ KE: "KEN",
3651
+ MA: "MAR",
3652
+ GH: "GHA",
3653
+ // Middle East
3654
+ AE: "ARE",
3655
+ SA: "SAU",
3656
+ IL: "ISR",
3657
+ TR: "TUR",
3658
+ IR: "IRN"
3659
+ }[n] || (n.length === 2 ? n + n.charAt(1) : n);
3660
+ }
3661
+ function Kn(n) {
3662
+ return {
3663
+ // North America
3664
+ US: "United States",
3665
+ CA: "Canada",
3666
+ MX: "Mexico",
3667
+ // Europe
3668
+ GB: "United Kingdom",
3669
+ DE: "Germany",
3670
+ FR: "France",
3671
+ IT: "Italy",
3672
+ ES: "Spain",
3673
+ NL: "Netherlands",
3674
+ BE: "Belgium",
3675
+ CH: "Switzerland",
3676
+ AT: "Austria",
3677
+ SE: "Sweden",
3678
+ NO: "Norway",
3679
+ DK: "Denmark",
3680
+ FI: "Finland",
3681
+ PL: "Poland",
3682
+ RU: "Russia",
3683
+ UA: "Ukraine",
3684
+ // Asia
3685
+ JP: "Japan",
3686
+ CN: "China",
3687
+ IN: "India",
3688
+ KR: "South Korea",
3689
+ SG: "Singapore",
3690
+ HK: "Hong Kong",
3691
+ TW: "Taiwan",
3692
+ TH: "Thailand",
3693
+ MY: "Malaysia",
3694
+ ID: "Indonesia",
3695
+ PH: "Philippines",
3696
+ VN: "Vietnam",
3697
+ // Oceania
3698
+ AU: "Australia",
3699
+ NZ: "New Zealand",
3700
+ // South America
3701
+ BR: "Brazil",
3702
+ AR: "Argentina",
3703
+ CL: "Chile",
3704
+ CO: "Colombia",
3705
+ PE: "Peru",
3706
+ VE: "Venezuela",
3707
+ // Africa
3708
+ ZA: "South Africa",
3709
+ EG: "Egypt",
3710
+ NG: "Nigeria",
3711
+ KE: "Kenya",
3712
+ MA: "Morocco",
3713
+ GH: "Ghana",
3714
+ // Middle East
3715
+ AE: "United Arab Emirates",
3716
+ SA: "Saudi Arabia",
3717
+ IL: "Israel",
3718
+ TR: "Turkey",
3719
+ IR: "Iran"
3720
+ }[n] || n;
3721
+ }
3722
+ function Xn(n) {
3723
+ const e = {
3724
+ customDomains: Mn(n),
3347
3725
  // Always create a cache adapter (let createCloudflareCache apply defaults)
3348
- cache: Pr({
3349
- ...r.cacheName && { cacheName: r.cacheName },
3350
- ...r.defaultTtlSeconds !== void 0 && {
3351
- defaultTtlSeconds: r.defaultTtlSeconds
3726
+ cache: Ln({
3727
+ ...n.cacheName && { cacheName: n.cacheName },
3728
+ ...n.defaultTtlSeconds !== void 0 && {
3729
+ defaultTtlSeconds: n.defaultTtlSeconds
3352
3730
  },
3353
- ...r.keyPrefix && { keyPrefix: r.keyPrefix }
3731
+ ...n.keyPrefix && { keyPrefix: n.keyPrefix }
3354
3732
  })
3355
3733
  };
3734
+ return n.r2SqlLogs && (e.logs = Wn(n.r2SqlLogs)), n.getHeaders && (e.geo = Gn({
3735
+ getHeaders: n.getHeaders
3736
+ })), e;
3356
3737
  }
3357
3738
  export {
3358
- Lr as default
3739
+ Xn as default
3359
3740
  };