@authhero/kysely-adapter 0.7.11 → 0.8.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,11 +1,11 @@
1
- var Kn = Object.defineProperty;
2
- var Qn = (n, e, t) => e in n ? Kn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var Yt = (n, e, t) => Qn(n, typeof e != "symbol" ? e + "" : e, t);
4
- var Et = class extends Error {
1
+ var Jn = Object.defineProperty;
2
+ var Kn = (n, e, t) => e in n ? Jn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var Qt = (n, e, t) => Kn(n, typeof e != "symbol" ? e + "" : e, t);
4
+ var Gt = class extends Error {
5
5
  constructor(e = 500, t) {
6
6
  super(t == null ? void 0 : t.message, { cause: t == null ? void 0 : t.cause });
7
- Yt(this, "res");
8
- Yt(this, "status");
7
+ Qt(this, "res");
8
+ Qt(this, "status");
9
9
  this.res = t == null ? void 0 : t.res, this.status = e;
10
10
  }
11
11
  getResponse() {
@@ -17,7 +17,7 @@ var Et = class extends Error {
17
17
  });
18
18
  }
19
19
  };
20
- function Hn(n) {
20
+ function Qn(n) {
21
21
  return async (e, t) => {
22
22
  const { identities: s, ...r } = t, a = {
23
23
  ...r,
@@ -30,7 +30,7 @@ function Hn(n) {
30
30
  try {
31
31
  await n.insertInto("users").values(a).execute();
32
32
  } catch (o) {
33
- throw o.code === "SQLITE_CONSTRAINT_UNIQUE" || o.message.includes("AlreadyExists") ? new Et(409, { message: "User already exists" }) : (console.log(o.message), new Et(500, { message: `${o.code}, ${o.message}` }));
33
+ throw o.code === "SQLITE_CONSTRAINT_UNIQUE" || o.message.includes("AlreadyExists") ? new Gt(409, { message: "User already exists" }) : (console.log(o.message), new Gt(500, { message: `${o.code}, ${o.message}` }));
34
34
  }
35
35
  return {
36
36
  ...a,
@@ -47,7 +47,7 @@ function R(n) {
47
47
  e[t] === null ? delete e[t] : typeof e[t] == "object" && (Array.isArray(e[t]) ? e[t] = e[t].map(R) : e[t] = R(e[t]));
48
48
  return e;
49
49
  }
50
- function Yn(n, e) {
50
+ function Hn(n, e) {
51
51
  var t = {};
52
52
  for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
53
53
  if (n != null && typeof Object.getOwnPropertySymbols == "function")
@@ -55,7 +55,7 @@ function Yn(n, e) {
55
55
  e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
56
56
  return t;
57
57
  }
58
- function Gn(n, e) {
58
+ function Yn(n, e) {
59
59
  var t;
60
60
  return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
61
61
  }
@@ -66,28 +66,28 @@ function Qe(n, e) {
66
66
  return r._def.openapi = this._def.openapi, r;
67
67
  };
68
68
  }
69
- function Xn(n) {
69
+ function Gn(n) {
70
70
  if (typeof n.ZodType.prototype.openapi < "u")
71
71
  return;
72
72
  n.ZodType.prototype.openapi = function(r, a) {
73
- var o, c, d, u, l, T;
74
- const C = typeof r == "string" ? a : r, L = C ?? {}, { param: K } = L, re = Yn(L, ["param"]), ce = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), de = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || K ? {
75
- param: Object.assign(Object.assign({}, (T = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || T === void 0 ? void 0 : T.param), K)
76
- } : void 0), ue = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ce).length > 0 ? { _internal: ce } : void 0), Object.keys(de).length > 0 ? { metadata: de } : void 0) }));
77
- if (Gn(this, "ZodObject")) {
73
+ var o, c, d, u, l, j;
74
+ const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, Re = Hn(U, ["param"]), oe = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ce = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), Re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || ie ? {
75
+ param: Object.assign(Object.assign({}, (j = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || j === void 0 ? void 0 : j.param), ie)
76
+ } : void 0), de = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(oe).length > 0 ? { _internal: oe } : void 0), Object.keys(ce).length > 0 ? { metadata: ce } : void 0) }));
77
+ if (Yn(this, "ZodObject")) {
78
78
  const $e = this.extend;
79
- ue.extend = function(...Pe) {
80
- var Q, H, Y, le, Te, Oe;
81
- const Se = $e.apply(this, Pe);
82
- return Se._def.openapi = {
79
+ de.extend = function(...Pe) {
80
+ var K, Q, H, ue, xe, Te;
81
+ const Oe = $e.apply(this, Pe);
82
+ return Oe._def.openapi = {
83
83
  _internal: {
84
- extendedFrom: !((H = (Q = this._def.openapi) === null || Q === void 0 ? void 0 : Q._internal) === null || H === void 0) && H.refId ? { refId: (le = (Y = this._def.openapi) === null || Y === void 0 ? void 0 : Y._internal) === null || le === void 0 ? void 0 : le.refId, schema: this } : (Te = this._def.openapi) === null || Te === void 0 ? void 0 : Te._internal.extendedFrom
84
+ extendedFrom: !((Q = (K = this._def.openapi) === null || K === void 0 ? void 0 : K._internal) === null || Q === void 0) && Q.refId ? { refId: (ue = (H = this._def.openapi) === null || H === void 0 ? void 0 : H._internal) === null || ue === void 0 ? void 0 : ue.refId, schema: this } : (xe = this._def.openapi) === null || xe === void 0 ? void 0 : xe._internal.extendedFrom
85
85
  },
86
- metadata: (Oe = Se._def.openapi) === null || Oe === void 0 ? void 0 : Oe.metadata
87
- }, Se;
86
+ metadata: (Te = Oe._def.openapi) === null || Te === void 0 ? void 0 : Te.metadata
87
+ }, Oe;
88
88
  };
89
89
  }
90
- return ue;
90
+ return de;
91
91
  }, Qe(n, "optional"), Qe(n, "nullable"), Qe(n, "default"), Qe(n, "transform"), Qe(n, "refine");
92
92
  const e = n.ZodObject.prototype.deepPartial;
93
93
  n.ZodObject.prototype.deepPartial = function() {
@@ -145,14 +145,14 @@ var N;
145
145
  }
146
146
  n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
147
147
  })(N || (N = {}));
148
- var en;
148
+ var Xt;
149
149
  (function(n) {
150
150
  n.mergeShapes = (e, t) => ({
151
151
  ...e,
152
152
  ...t
153
153
  // second overwrites first
154
154
  });
155
- })(en || (en = {}));
155
+ })(Xt || (Xt = {}));
156
156
  const _ = N.arrayToEnum([
157
157
  "string",
158
158
  "nan",
@@ -174,7 +174,7 @@ const _ = N.arrayToEnum([
174
174
  "never",
175
175
  "map",
176
176
  "set"
177
- ]), he = (n) => {
177
+ ]), pe = (n) => {
178
178
  switch (typeof n) {
179
179
  case "undefined":
180
180
  return _.undefined;
@@ -212,8 +212,8 @@ const _ = N.arrayToEnum([
212
212
  "invalid_intersection_types",
213
213
  "not_multiple_of",
214
214
  "not_finite"
215
- ]), es = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
216
- class V extends Error {
215
+ ]), Xn = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
216
+ class L extends Error {
217
217
  constructor(e) {
218
218
  super(), this.issues = [], this.addIssue = (s) => {
219
219
  this.issues = [...this.issues, s];
@@ -250,7 +250,7 @@ class V extends Error {
250
250
  return r(this), s;
251
251
  }
252
252
  static assert(e) {
253
- if (!(e instanceof V))
253
+ if (!(e instanceof L))
254
254
  throw new Error(`Not a ZodError: ${e}`);
255
255
  }
256
256
  toString() {
@@ -272,7 +272,7 @@ class V extends Error {
272
272
  return this.flatten();
273
273
  }
274
274
  }
275
- V.create = (n) => new V(n);
275
+ L.create = (n) => new L(n);
276
276
  const ze = (n, e) => {
277
277
  let t;
278
278
  switch (n.code) {
@@ -329,14 +329,14 @@ const ze = (n, e) => {
329
329
  }
330
330
  return { message: t };
331
331
  };
332
- let wn = ze;
333
- function ts(n) {
334
- wn = n;
332
+ let vn = ze;
333
+ function es(n) {
334
+ vn = n;
335
335
  }
336
- function At() {
337
- return wn;
336
+ function Et() {
337
+ return vn;
338
338
  }
339
- const Rt = (n) => {
339
+ const At = (n) => {
340
340
  const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
341
341
  ...r,
342
342
  path: a
@@ -356,9 +356,9 @@ const Rt = (n) => {
356
356
  path: a,
357
357
  message: c
358
358
  };
359
- }, ns = [];
359
+ }, ts = [];
360
360
  function f(n, e) {
361
- const t = At(), s = Rt({
361
+ const t = Et(), s = At({
362
362
  issueData: e,
363
363
  data: n.data,
364
364
  path: n.path,
@@ -415,12 +415,12 @@ class $ {
415
415
  }
416
416
  const x = Object.freeze({
417
417
  status: "aborted"
418
- }), $t = (n) => ({ status: "dirty", value: n }), D = (n) => ({ status: "valid", value: n }), tn = (n) => n.status === "aborted", nn = (n) => n.status === "dirty", tt = (n) => n.status === "valid", nt = (n) => typeof Promise < "u" && n instanceof Promise;
419
- function Pt(n, e, t, s) {
418
+ }), Rt = (n) => ({ status: "dirty", value: n }), D = (n) => ({ status: "valid", value: n }), en = (n) => n.status === "aborted", tn = (n) => n.status === "dirty", tt = (n) => n.status === "valid", nt = (n) => typeof Promise < "u" && n instanceof Promise;
419
+ function $t(n, e, t, s) {
420
420
  if (typeof e == "function" ? n !== e || !s : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
421
421
  return e.get(n);
422
422
  }
423
- function kn(n, e, t, s, r) {
423
+ function wn(n, e, t, s, r) {
424
424
  if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
425
425
  return e.set(n, t), t;
426
426
  }
@@ -429,7 +429,7 @@ var y;
429
429
  n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
430
430
  })(y || (y = {}));
431
431
  var Ye, Ge;
432
- class ee {
432
+ class X {
433
433
  constructor(e, t, s, r) {
434
434
  this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
435
435
  }
@@ -437,7 +437,7 @@ class ee {
437
437
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
438
438
  }
439
439
  }
440
- const fn = (n, e) => {
440
+ const hn = (n, e) => {
441
441
  if (tt(e))
442
442
  return { success: !0, data: e.value };
443
443
  if (!n.common.issues.length)
@@ -447,12 +447,12 @@ const fn = (n, e) => {
447
447
  get error() {
448
448
  if (this._error)
449
449
  return this._error;
450
- const t = new V(n.common.issues);
450
+ const t = new L(n.common.issues);
451
451
  return this._error = t, this._error;
452
452
  }
453
453
  };
454
454
  };
455
- function O(n) {
455
+ function T(n) {
456
456
  if (!n)
457
457
  return {};
458
458
  const { errorMap: e, invalid_type_error: t, required_error: s, description: r } = n;
@@ -464,7 +464,7 @@ function O(n) {
464
464
  return a.code === "invalid_enum_value" ? { message: u ?? o.defaultError } : typeof o.data > "u" ? { message: (c = u ?? s) !== null && c !== void 0 ? c : o.defaultError } : a.code !== "invalid_type" ? { message: o.defaultError } : { message: (d = u ?? t) !== null && d !== void 0 ? d : o.defaultError };
465
465
  }, description: r };
466
466
  }
467
- class Z {
467
+ class S {
468
468
  constructor(e) {
469
469
  this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
470
470
  }
@@ -472,13 +472,13 @@ class Z {
472
472
  return this._def.description;
473
473
  }
474
474
  _getType(e) {
475
- return he(e.data);
475
+ return pe(e.data);
476
476
  }
477
477
  _getOrReturnCtx(e, t) {
478
478
  return t || {
479
479
  common: e.parent.common,
480
480
  data: e.data,
481
- parsedType: he(e.data),
481
+ parsedType: pe(e.data),
482
482
  schemaErrorMap: this._def.errorMap,
483
483
  path: e.path,
484
484
  parent: e.parent
@@ -490,7 +490,7 @@ class Z {
490
490
  ctx: {
491
491
  common: e.parent.common,
492
492
  data: e.data,
493
- parsedType: he(e.data),
493
+ parsedType: pe(e.data),
494
494
  schemaErrorMap: this._def.errorMap,
495
495
  path: e.path,
496
496
  parent: e.parent
@@ -525,9 +525,9 @@ class Z {
525
525
  schemaErrorMap: this._def.errorMap,
526
526
  parent: null,
527
527
  data: e,
528
- parsedType: he(e)
528
+ parsedType: pe(e)
529
529
  }, a = this._parseSync({ data: e, path: r.path, parent: r });
530
- return fn(r, a);
530
+ return hn(r, a);
531
531
  }
532
532
  async parseAsync(e, t) {
533
533
  const s = await this.safeParseAsync(e, t);
@@ -546,9 +546,9 @@ class Z {
546
546
  schemaErrorMap: this._def.errorMap,
547
547
  parent: null,
548
548
  data: e,
549
- parsedType: he(e)
549
+ parsedType: pe(e)
550
550
  }, r = this._parse({ data: e, path: s.path, parent: s }), a = await (nt(r) ? r : Promise.resolve(r));
551
- return fn(s, a);
551
+ return hn(s, a);
552
552
  }
553
553
  refine(e, t) {
554
554
  const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
@@ -574,10 +574,10 @@ class Z {
574
574
  return this._refinement(e);
575
575
  }
576
576
  optional() {
577
- return G.create(this, this._def);
577
+ return Y.create(this, this._def);
578
578
  }
579
579
  nullable() {
580
- return ye.create(this, this._def);
580
+ return ge.create(this, this._def);
581
581
  }
582
582
  nullish() {
583
583
  return this.nullable().optional();
@@ -596,7 +596,7 @@ class Z {
596
596
  }
597
597
  transform(e) {
598
598
  return new q({
599
- ...O(this._def),
599
+ ...T(this._def),
600
600
  schema: this,
601
601
  typeName: w.ZodEffects,
602
602
  effect: { type: "transform", transform: e }
@@ -605,23 +605,23 @@ class Z {
605
605
  default(e) {
606
606
  const t = typeof e == "function" ? e : () => e;
607
607
  return new pt({
608
- ...O(this._def),
608
+ ...T(this._def),
609
609
  innerType: this,
610
610
  defaultValue: t,
611
611
  typeName: w.ZodDefault
612
612
  });
613
613
  }
614
614
  brand() {
615
- return new dn({
615
+ return new cn({
616
616
  typeName: w.ZodBranded,
617
617
  type: this,
618
- ...O(this._def)
618
+ ...T(this._def)
619
619
  });
620
620
  }
621
621
  catch(e) {
622
622
  const t = typeof e == "function" ? e : () => e;
623
623
  return new ht({
624
- ...O(this._def),
624
+ ...T(this._def),
625
625
  innerType: this,
626
626
  catchValue: t,
627
627
  typeName: w.ZodCatch
@@ -647,25 +647,25 @@ class Z {
647
647
  return this.safeParse(null).success;
648
648
  }
649
649
  }
650
- const ss = /^c[^\s-]{8,}$/i, rs = /^[0-9a-z]+$/, as = /^[0-9A-HJKMNP-TV-Z]{26}$/, is = /^[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, os = /^[a-z0-9_-]{21}$/i, cs = /^[-+]?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)?)??$/, ds = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, us = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
651
- let Gt;
652
- const ls = /^(?:(?: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])$/, ps = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, hs = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, bn = "((\\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])))", fs = new RegExp(`^${bn}$`);
653
- function xn(n) {
650
+ const ns = /^c[^\s-]{8,}$/i, ss = /^[0-9a-z]+$/, rs = /^[0-9A-HJKMNP-TV-Z]{26}$/, as = /^[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, is = /^[a-z0-9_-]{21}$/i, os = /^[-+]?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)?)??$/, cs = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ds = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
651
+ let Ht;
652
+ const us = /^(?:(?: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])$/, ls = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, ps = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, kn = "((\\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])))", hs = new RegExp(`^${kn}$`);
653
+ function bn(n) {
654
654
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
655
655
  return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
656
656
  }
657
- function ms(n) {
658
- return new RegExp(`^${xn(n)}$`);
657
+ function fs(n) {
658
+ return new RegExp(`^${bn(n)}$`);
659
659
  }
660
- function Tn(n) {
661
- let e = `${bn}T${xn(n)}`;
660
+ function xn(n) {
661
+ let e = `${kn}T${bn(n)}`;
662
662
  const t = [];
663
663
  return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
664
664
  }
665
- function _s(n, e) {
666
- return !!((e === "v4" || !e) && ls.test(n) || (e === "v6" || !e) && ps.test(n));
665
+ function ms(n, e) {
666
+ return !!((e === "v4" || !e) && us.test(n) || (e === "v6" || !e) && ls.test(n));
667
667
  }
668
- class F extends Z {
668
+ class F extends S {
669
669
  _parse(e) {
670
670
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== _.string) {
671
671
  const r = this._getOrReturnCtx(e);
@@ -714,43 +714,43 @@ class F extends Z {
714
714
  message: r.message
715
715
  }), t.dirty());
716
716
  } else if (r.kind === "email")
717
- ds.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
717
+ cs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
718
718
  validation: "email",
719
719
  code: p.invalid_string,
720
720
  message: r.message
721
721
  }), t.dirty());
722
722
  else if (r.kind === "emoji")
723
- Gt || (Gt = new RegExp(us, "u")), Gt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
723
+ Ht || (Ht = new RegExp(ds, "u")), Ht.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
724
724
  validation: "emoji",
725
725
  code: p.invalid_string,
726
726
  message: r.message
727
727
  }), t.dirty());
728
728
  else if (r.kind === "uuid")
729
- is.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
729
+ as.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
730
730
  validation: "uuid",
731
731
  code: p.invalid_string,
732
732
  message: r.message
733
733
  }), t.dirty());
734
734
  else if (r.kind === "nanoid")
735
- os.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
735
+ is.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
736
736
  validation: "nanoid",
737
737
  code: p.invalid_string,
738
738
  message: r.message
739
739
  }), t.dirty());
740
740
  else if (r.kind === "cuid")
741
- ss.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
741
+ ns.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
742
742
  validation: "cuid",
743
743
  code: p.invalid_string,
744
744
  message: r.message
745
745
  }), t.dirty());
746
746
  else if (r.kind === "cuid2")
747
- rs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
747
+ ss.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
748
748
  validation: "cuid2",
749
749
  code: p.invalid_string,
750
750
  message: r.message
751
751
  }), t.dirty());
752
752
  else if (r.kind === "ulid")
753
- as.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
753
+ rs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
754
754
  validation: "ulid",
755
755
  code: p.invalid_string,
756
756
  message: r.message
@@ -781,27 +781,27 @@ class F extends Z {
781
781
  code: p.invalid_string,
782
782
  validation: { endsWith: r.value },
783
783
  message: r.message
784
- }), t.dirty()) : r.kind === "datetime" ? Tn(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
784
+ }), t.dirty()) : r.kind === "datetime" ? xn(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
785
785
  code: p.invalid_string,
786
786
  validation: "datetime",
787
787
  message: r.message
788
- }), t.dirty()) : r.kind === "date" ? fs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
788
+ }), t.dirty()) : r.kind === "date" ? hs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
789
789
  code: p.invalid_string,
790
790
  validation: "date",
791
791
  message: r.message
792
- }), t.dirty()) : r.kind === "time" ? ms(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
792
+ }), t.dirty()) : r.kind === "time" ? fs(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
793
793
  code: p.invalid_string,
794
794
  validation: "time",
795
795
  message: r.message
796
- }), t.dirty()) : r.kind === "duration" ? cs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
796
+ }), t.dirty()) : r.kind === "duration" ? os.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
797
797
  validation: "duration",
798
798
  code: p.invalid_string,
799
799
  message: r.message
800
- }), t.dirty()) : r.kind === "ip" ? _s(e.data, r.version) || (s = this._getOrReturnCtx(e, s), f(s, {
800
+ }), t.dirty()) : r.kind === "ip" ? ms(e.data, r.version) || (s = this._getOrReturnCtx(e, s), f(s, {
801
801
  validation: "ip",
802
802
  code: p.invalid_string,
803
803
  message: r.message
804
- }), t.dirty()) : r.kind === "base64" ? hs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
804
+ }), t.dirty()) : r.kind === "base64" ? ps.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
805
805
  validation: "base64",
806
806
  code: p.invalid_string,
807
807
  message: r.message
@@ -1020,14 +1020,14 @@ F.create = (n) => {
1020
1020
  checks: [],
1021
1021
  typeName: w.ZodString,
1022
1022
  coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
1023
- ...O(n)
1023
+ ...T(n)
1024
1024
  });
1025
1025
  };
1026
- function gs(n, e) {
1026
+ function _s(n, e) {
1027
1027
  const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = parseInt(n.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
1028
1028
  return a % o / Math.pow(10, r);
1029
1029
  }
1030
- class me extends Z {
1030
+ class fe extends S {
1031
1031
  constructor() {
1032
1032
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
1033
1033
  }
@@ -1062,7 +1062,7 @@ class me extends Z {
1062
1062
  inclusive: r.inclusive,
1063
1063
  exact: !1,
1064
1064
  message: r.message
1065
- }), s.dirty()) : r.kind === "multipleOf" ? gs(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), f(t, {
1065
+ }), s.dirty()) : r.kind === "multipleOf" ? _s(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), f(t, {
1066
1066
  code: p.not_multiple_of,
1067
1067
  multipleOf: r.value,
1068
1068
  message: r.message
@@ -1085,7 +1085,7 @@ class me extends Z {
1085
1085
  return this.setLimit("max", e, !1, y.toString(t));
1086
1086
  }
1087
1087
  setLimit(e, t, s, r) {
1088
- return new me({
1088
+ return new fe({
1089
1089
  ...this._def,
1090
1090
  checks: [
1091
1091
  ...this._def.checks,
@@ -1099,7 +1099,7 @@ class me extends Z {
1099
1099
  });
1100
1100
  }
1101
1101
  _addCheck(e) {
1102
- return new me({
1102
+ return new fe({
1103
1103
  ...this._def,
1104
1104
  checks: [...this._def.checks, e]
1105
1105
  });
@@ -1193,13 +1193,13 @@ class me extends Z {
1193
1193
  return Number.isFinite(t) && Number.isFinite(e);
1194
1194
  }
1195
1195
  }
1196
- me.create = (n) => new me({
1196
+ fe.create = (n) => new fe({
1197
1197
  checks: [],
1198
1198
  typeName: w.ZodNumber,
1199
1199
  coerce: (n == null ? void 0 : n.coerce) || !1,
1200
- ...O(n)
1200
+ ...T(n)
1201
1201
  });
1202
- class _e extends Z {
1202
+ class me extends S {
1203
1203
  constructor() {
1204
1204
  super(...arguments), this.min = this.gte, this.max = this.lte;
1205
1205
  }
@@ -1247,7 +1247,7 @@ class _e extends Z {
1247
1247
  return this.setLimit("max", e, !1, y.toString(t));
1248
1248
  }
1249
1249
  setLimit(e, t, s, r) {
1250
- return new _e({
1250
+ return new me({
1251
1251
  ...this._def,
1252
1252
  checks: [
1253
1253
  ...this._def.checks,
@@ -1261,7 +1261,7 @@ class _e extends Z {
1261
1261
  });
1262
1262
  }
1263
1263
  _addCheck(e) {
1264
- return new _e({
1264
+ return new me({
1265
1265
  ...this._def,
1266
1266
  checks: [...this._def.checks, e]
1267
1267
  });
@@ -1318,16 +1318,16 @@ class _e extends Z {
1318
1318
  return e;
1319
1319
  }
1320
1320
  }
1321
- _e.create = (n) => {
1321
+ me.create = (n) => {
1322
1322
  var e;
1323
- return new _e({
1323
+ return new me({
1324
1324
  checks: [],
1325
1325
  typeName: w.ZodBigInt,
1326
1326
  coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
1327
- ...O(n)
1327
+ ...T(n)
1328
1328
  });
1329
1329
  };
1330
- class st extends Z {
1330
+ class st extends S {
1331
1331
  _parse(e) {
1332
1332
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== _.boolean) {
1333
1333
  const t = this._getOrReturnCtx(e);
@@ -1343,9 +1343,9 @@ class st extends Z {
1343
1343
  st.create = (n) => new st({
1344
1344
  typeName: w.ZodBoolean,
1345
1345
  coerce: (n == null ? void 0 : n.coerce) || !1,
1346
- ...O(n)
1346
+ ...T(n)
1347
1347
  });
1348
- class Ne extends Z {
1348
+ class je extends S {
1349
1349
  _parse(e) {
1350
1350
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== _.date) {
1351
1351
  const r = this._getOrReturnCtx(e);
@@ -1385,7 +1385,7 @@ class Ne extends Z {
1385
1385
  };
1386
1386
  }
1387
1387
  _addCheck(e) {
1388
- return new Ne({
1388
+ return new je({
1389
1389
  ...this._def,
1390
1390
  checks: [...this._def.checks, e]
1391
1391
  });
@@ -1417,13 +1417,13 @@ class Ne extends Z {
1417
1417
  return e != null ? new Date(e) : null;
1418
1418
  }
1419
1419
  }
1420
- Ne.create = (n) => new Ne({
1420
+ je.create = (n) => new je({
1421
1421
  checks: [],
1422
1422
  coerce: (n == null ? void 0 : n.coerce) || !1,
1423
1423
  typeName: w.ZodDate,
1424
- ...O(n)
1424
+ ...T(n)
1425
1425
  });
1426
- class Dt extends Z {
1426
+ class Pt extends S {
1427
1427
  _parse(e) {
1428
1428
  if (this._getType(e) !== _.symbol) {
1429
1429
  const t = this._getOrReturnCtx(e);
@@ -1436,11 +1436,11 @@ class Dt extends Z {
1436
1436
  return D(e.data);
1437
1437
  }
1438
1438
  }
1439
- Dt.create = (n) => new Dt({
1439
+ Pt.create = (n) => new Pt({
1440
1440
  typeName: w.ZodSymbol,
1441
- ...O(n)
1441
+ ...T(n)
1442
1442
  });
1443
- class rt extends Z {
1443
+ class rt extends S {
1444
1444
  _parse(e) {
1445
1445
  if (this._getType(e) !== _.undefined) {
1446
1446
  const t = this._getOrReturnCtx(e);
@@ -1455,9 +1455,9 @@ class rt extends Z {
1455
1455
  }
1456
1456
  rt.create = (n) => new rt({
1457
1457
  typeName: w.ZodUndefined,
1458
- ...O(n)
1458
+ ...T(n)
1459
1459
  });
1460
- class at extends Z {
1460
+ class at extends S {
1461
1461
  _parse(e) {
1462
1462
  if (this._getType(e) !== _.null) {
1463
1463
  const t = this._getOrReturnCtx(e);
@@ -1472,9 +1472,9 @@ class at extends Z {
1472
1472
  }
1473
1473
  at.create = (n) => new at({
1474
1474
  typeName: w.ZodNull,
1475
- ...O(n)
1475
+ ...T(n)
1476
1476
  });
1477
- class Be extends Z {
1477
+ class Be extends S {
1478
1478
  constructor() {
1479
1479
  super(...arguments), this._any = !0;
1480
1480
  }
@@ -1484,9 +1484,9 @@ class Be extends Z {
1484
1484
  }
1485
1485
  Be.create = (n) => new Be({
1486
1486
  typeName: w.ZodAny,
1487
- ...O(n)
1487
+ ...T(n)
1488
1488
  });
1489
- class Ze extends Z {
1489
+ class Se extends S {
1490
1490
  constructor() {
1491
1491
  super(...arguments), this._unknown = !0;
1492
1492
  }
@@ -1494,11 +1494,11 @@ class Ze extends Z {
1494
1494
  return D(e.data);
1495
1495
  }
1496
1496
  }
1497
- Ze.create = (n) => new Ze({
1497
+ Se.create = (n) => new Se({
1498
1498
  typeName: w.ZodUnknown,
1499
- ...O(n)
1499
+ ...T(n)
1500
1500
  });
1501
- class ie extends Z {
1501
+ class re extends S {
1502
1502
  _parse(e) {
1503
1503
  const t = this._getOrReturnCtx(e);
1504
1504
  return f(t, {
@@ -1508,11 +1508,11 @@ class ie extends Z {
1508
1508
  }), x;
1509
1509
  }
1510
1510
  }
1511
- ie.create = (n) => new ie({
1511
+ re.create = (n) => new re({
1512
1512
  typeName: w.ZodNever,
1513
- ...O(n)
1513
+ ...T(n)
1514
1514
  });
1515
- class Mt extends Z {
1515
+ class Dt extends S {
1516
1516
  _parse(e) {
1517
1517
  if (this._getType(e) !== _.undefined) {
1518
1518
  const t = this._getOrReturnCtx(e);
@@ -1525,11 +1525,11 @@ class Mt extends Z {
1525
1525
  return D(e.data);
1526
1526
  }
1527
1527
  }
1528
- Mt.create = (n) => new Mt({
1528
+ Dt.create = (n) => new Dt({
1529
1529
  typeName: w.ZodVoid,
1530
- ...O(n)
1530
+ ...T(n)
1531
1531
  });
1532
- class B extends Z {
1532
+ class B extends S {
1533
1533
  _parse(e) {
1534
1534
  const { ctx: t, status: s } = this._processInputParams(e), r = this._def;
1535
1535
  if (t.parsedType !== _.array)
@@ -1565,8 +1565,8 @@ class B extends Z {
1565
1565
  exact: !1,
1566
1566
  message: r.maxLength.message
1567
1567
  }), s.dirty()), t.common.async)
1568
- return Promise.all([...t.data].map((o, c) => r.type._parseAsync(new ee(t, o, t.path, c)))).then((o) => $.mergeArray(s, o));
1569
- const a = [...t.data].map((o, c) => r.type._parseSync(new ee(t, o, t.path, c)));
1568
+ return Promise.all([...t.data].map((o, c) => r.type._parseAsync(new X(t, o, t.path, c)))).then((o) => $.mergeArray(s, o));
1569
+ const a = [...t.data].map((o, c) => r.type._parseSync(new X(t, o, t.path, c)));
1570
1570
  return $.mergeArray(s, a);
1571
1571
  }
1572
1572
  get element() {
@@ -1600,25 +1600,25 @@ B.create = (n, e) => new B({
1600
1600
  maxLength: null,
1601
1601
  exactLength: null,
1602
1602
  typeName: w.ZodArray,
1603
- ...O(e)
1603
+ ...T(e)
1604
1604
  });
1605
1605
  function Me(n) {
1606
- if (n instanceof E) {
1606
+ if (n instanceof I) {
1607
1607
  const e = {};
1608
1608
  for (const t in n.shape) {
1609
1609
  const s = n.shape[t];
1610
- e[t] = G.create(Me(s));
1610
+ e[t] = Y.create(Me(s));
1611
1611
  }
1612
- return new E({
1612
+ return new I({
1613
1613
  ...n._def,
1614
1614
  shape: () => e
1615
1615
  });
1616
1616
  } else return n instanceof B ? new B({
1617
1617
  ...n._def,
1618
1618
  type: Me(n.element)
1619
- }) : n instanceof G ? G.create(Me(n.unwrap())) : n instanceof ye ? ye.create(Me(n.unwrap())) : n instanceof te ? te.create(n.items.map((e) => Me(e))) : n;
1619
+ }) : n instanceof Y ? Y.create(Me(n.unwrap())) : n instanceof ge ? ge.create(Me(n.unwrap())) : n instanceof ee ? ee.create(n.items.map((e) => Me(e))) : n;
1620
1620
  }
1621
- class E extends Z {
1621
+ class I extends S {
1622
1622
  constructor() {
1623
1623
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1624
1624
  }
@@ -1638,7 +1638,7 @@ class E extends Z {
1638
1638
  }), x;
1639
1639
  }
1640
1640
  const { status: t, ctx: s } = this._processInputParams(e), { shape: r, keys: a } = this._getCached(), o = [];
1641
- if (!(this._def.catchall instanceof ie && this._def.unknownKeys === "strip"))
1641
+ if (!(this._def.catchall instanceof re && this._def.unknownKeys === "strip"))
1642
1642
  for (const d in s.data)
1643
1643
  a.includes(d) || o.push(d);
1644
1644
  const c = [];
@@ -1646,11 +1646,11 @@ class E extends Z {
1646
1646
  const u = r[d], l = s.data[d];
1647
1647
  c.push({
1648
1648
  key: { status: "valid", value: d },
1649
- value: u._parse(new ee(s, l, s.path, d)),
1649
+ value: u._parse(new X(s, l, s.path, d)),
1650
1650
  alwaysSet: d in s.data
1651
1651
  });
1652
1652
  }
1653
- if (this._def.catchall instanceof ie) {
1653
+ if (this._def.catchall instanceof re) {
1654
1654
  const d = this._def.unknownKeys;
1655
1655
  if (d === "passthrough")
1656
1656
  for (const u of o)
@@ -1671,7 +1671,7 @@ class E extends Z {
1671
1671
  c.push({
1672
1672
  key: { status: "valid", value: u },
1673
1673
  value: d._parse(
1674
- new ee(s, l, s.path, u)
1674
+ new X(s, l, s.path, u)
1675
1675
  //, ctx.child(key), value, getParsedType(value)
1676
1676
  ),
1677
1677
  alwaysSet: u in s.data
@@ -1681,10 +1681,10 @@ class E extends Z {
1681
1681
  return s.common.async ? Promise.resolve().then(async () => {
1682
1682
  const d = [];
1683
1683
  for (const u of c) {
1684
- const l = await u.key, T = await u.value;
1684
+ const l = await u.key, j = await u.value;
1685
1685
  d.push({
1686
1686
  key: l,
1687
- value: T,
1687
+ value: j,
1688
1688
  alwaysSet: u.alwaysSet
1689
1689
  });
1690
1690
  }
@@ -1695,7 +1695,7 @@ class E extends Z {
1695
1695
  return this._def.shape();
1696
1696
  }
1697
1697
  strict(e) {
1698
- return y.errToObj, new E({
1698
+ return y.errToObj, new I({
1699
1699
  ...this._def,
1700
1700
  unknownKeys: "strict",
1701
1701
  ...e !== void 0 ? {
@@ -1712,13 +1712,13 @@ class E extends Z {
1712
1712
  });
1713
1713
  }
1714
1714
  strip() {
1715
- return new E({
1715
+ return new I({
1716
1716
  ...this._def,
1717
1717
  unknownKeys: "strip"
1718
1718
  });
1719
1719
  }
1720
1720
  passthrough() {
1721
- return new E({
1721
+ return new I({
1722
1722
  ...this._def,
1723
1723
  unknownKeys: "passthrough"
1724
1724
  });
@@ -1741,7 +1741,7 @@ class E extends Z {
1741
1741
  // }) as any;
1742
1742
  // };
1743
1743
  extend(e) {
1744
- return new E({
1744
+ return new I({
1745
1745
  ...this._def,
1746
1746
  shape: () => ({
1747
1747
  ...this._def.shape(),
@@ -1755,7 +1755,7 @@ class E extends Z {
1755
1755
  * upgrade if you are experiencing issues.
1756
1756
  */
1757
1757
  merge(e) {
1758
- return new E({
1758
+ return new I({
1759
1759
  unknownKeys: e._def.unknownKeys,
1760
1760
  catchall: e._def.catchall,
1761
1761
  shape: () => ({
@@ -1825,7 +1825,7 @@ class E extends Z {
1825
1825
  // return merged;
1826
1826
  // }
1827
1827
  catchall(e) {
1828
- return new E({
1828
+ return new I({
1829
1829
  ...this._def,
1830
1830
  catchall: e
1831
1831
  });
@@ -1834,7 +1834,7 @@ class E extends Z {
1834
1834
  const t = {};
1835
1835
  return N.objectKeys(e).forEach((s) => {
1836
1836
  e[s] && this.shape[s] && (t[s] = this.shape[s]);
1837
- }), new E({
1837
+ }), new I({
1838
1838
  ...this._def,
1839
1839
  shape: () => t
1840
1840
  });
@@ -1843,7 +1843,7 @@ class E extends Z {
1843
1843
  const t = {};
1844
1844
  return N.objectKeys(this.shape).forEach((s) => {
1845
1845
  e[s] || (t[s] = this.shape[s]);
1846
- }), new E({
1846
+ }), new I({
1847
1847
  ...this._def,
1848
1848
  shape: () => t
1849
1849
  });
@@ -1859,7 +1859,7 @@ class E extends Z {
1859
1859
  return N.objectKeys(this.shape).forEach((s) => {
1860
1860
  const r = this.shape[s];
1861
1861
  e && !e[s] ? t[s] = r : t[s] = r.optional();
1862
- }), new E({
1862
+ }), new I({
1863
1863
  ...this._def,
1864
1864
  shape: () => t
1865
1865
  });
@@ -1871,41 +1871,41 @@ class E extends Z {
1871
1871
  t[s] = this.shape[s];
1872
1872
  else {
1873
1873
  let r = this.shape[s];
1874
- for (; r instanceof G; )
1874
+ for (; r instanceof Y; )
1875
1875
  r = r._def.innerType;
1876
1876
  t[s] = r;
1877
1877
  }
1878
- }), new E({
1878
+ }), new I({
1879
1879
  ...this._def,
1880
1880
  shape: () => t
1881
1881
  });
1882
1882
  }
1883
1883
  keyof() {
1884
- return On(N.objectKeys(this.shape));
1884
+ return Tn(N.objectKeys(this.shape));
1885
1885
  }
1886
1886
  }
1887
- E.create = (n, e) => new E({
1887
+ I.create = (n, e) => new I({
1888
1888
  shape: () => n,
1889
1889
  unknownKeys: "strip",
1890
- catchall: ie.create(),
1890
+ catchall: re.create(),
1891
1891
  typeName: w.ZodObject,
1892
- ...O(e)
1892
+ ...T(e)
1893
1893
  });
1894
- E.strictCreate = (n, e) => new E({
1894
+ I.strictCreate = (n, e) => new I({
1895
1895
  shape: () => n,
1896
1896
  unknownKeys: "strict",
1897
- catchall: ie.create(),
1897
+ catchall: re.create(),
1898
1898
  typeName: w.ZodObject,
1899
- ...O(e)
1899
+ ...T(e)
1900
1900
  });
1901
- E.lazycreate = (n, e) => new E({
1901
+ I.lazycreate = (n, e) => new I({
1902
1902
  shape: n,
1903
1903
  unknownKeys: "strip",
1904
- catchall: ie.create(),
1904
+ catchall: re.create(),
1905
1905
  typeName: w.ZodObject,
1906
- ...O(e)
1906
+ ...T(e)
1907
1907
  });
1908
- class it extends Z {
1908
+ class it extends S {
1909
1909
  _parse(e) {
1910
1910
  const { ctx: t } = this._processInputParams(e), s = this._def.options;
1911
1911
  function r(a) {
@@ -1915,7 +1915,7 @@ class it extends Z {
1915
1915
  for (const c of a)
1916
1916
  if (c.result.status === "dirty")
1917
1917
  return t.common.issues.push(...c.ctx.common.issues), c.result;
1918
- const o = a.map((c) => new V(c.ctx.common.issues));
1918
+ const o = a.map((c) => new L(c.ctx.common.issues));
1919
1919
  return f(t, {
1920
1920
  code: p.invalid_union,
1921
1921
  unionErrors: o
@@ -1962,7 +1962,7 @@ class it extends Z {
1962
1962
  }
1963
1963
  if (a)
1964
1964
  return t.common.issues.push(...a.ctx.common.issues), a.result;
1965
- const c = o.map((d) => new V(d));
1965
+ const c = o.map((d) => new L(d));
1966
1966
  return f(t, {
1967
1967
  code: p.invalid_union,
1968
1968
  unionErrors: c
@@ -1976,10 +1976,10 @@ class it extends Z {
1976
1976
  it.create = (n, e) => new it({
1977
1977
  options: n,
1978
1978
  typeName: w.ZodUnion,
1979
- ...O(e)
1979
+ ...T(e)
1980
1980
  });
1981
- const pe = (n) => n instanceof dt ? pe(n.schema) : n instanceof q ? pe(n.innerType()) : n instanceof ut ? [n.value] : n instanceof ge ? n.options : n instanceof lt ? N.objectValues(n.enum) : n instanceof pt ? pe(n._def.innerType) : n instanceof rt ? [void 0] : n instanceof at ? [null] : n instanceof G ? [void 0, ...pe(n.unwrap())] : n instanceof ye ? [null, ...pe(n.unwrap())] : n instanceof dn || n instanceof ft ? pe(n.unwrap()) : n instanceof ht ? pe(n._def.innerType) : [];
1982
- class Kt extends Z {
1981
+ const le = (n) => n instanceof dt ? le(n.schema) : n instanceof q ? le(n.innerType()) : n instanceof ut ? [n.value] : n instanceof _e ? n.options : n instanceof lt ? N.objectValues(n.enum) : n instanceof pt ? le(n._def.innerType) : n instanceof rt ? [void 0] : n instanceof at ? [null] : n instanceof Y ? [void 0, ...le(n.unwrap())] : n instanceof ge ? [null, ...le(n.unwrap())] : n instanceof cn || n instanceof ft ? le(n.unwrap()) : n instanceof ht ? le(n._def.innerType) : [];
1982
+ class Jt extends S {
1983
1983
  _parse(e) {
1984
1984
  const { ctx: t } = this._processInputParams(e);
1985
1985
  if (t.parsedType !== _.object)
@@ -2023,7 +2023,7 @@ class Kt extends Z {
2023
2023
  static create(e, t, s) {
2024
2024
  const r = /* @__PURE__ */ new Map();
2025
2025
  for (const a of t) {
2026
- const o = pe(a.shape[e]);
2026
+ const o = le(a.shape[e]);
2027
2027
  if (!o.length)
2028
2028
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
2029
2029
  for (const c of o) {
@@ -2032,23 +2032,23 @@ class Kt extends Z {
2032
2032
  r.set(c, a);
2033
2033
  }
2034
2034
  }
2035
- return new Kt({
2035
+ return new Jt({
2036
2036
  typeName: w.ZodDiscriminatedUnion,
2037
2037
  discriminator: e,
2038
2038
  options: t,
2039
2039
  optionsMap: r,
2040
- ...O(s)
2040
+ ...T(s)
2041
2041
  });
2042
2042
  }
2043
2043
  }
2044
- function sn(n, e) {
2045
- const t = he(n), s = he(e);
2044
+ function nn(n, e) {
2045
+ const t = pe(n), s = pe(e);
2046
2046
  if (n === e)
2047
2047
  return { valid: !0, data: n };
2048
2048
  if (t === _.object && s === _.object) {
2049
2049
  const r = N.objectKeys(e), a = N.objectKeys(n).filter((c) => r.indexOf(c) !== -1), o = { ...n, ...e };
2050
2050
  for (const c of a) {
2051
- const d = sn(n[c], e[c]);
2051
+ const d = nn(n[c], e[c]);
2052
2052
  if (!d.valid)
2053
2053
  return { valid: !1 };
2054
2054
  o[c] = d.data;
@@ -2059,7 +2059,7 @@ function sn(n, e) {
2059
2059
  return { valid: !1 };
2060
2060
  const r = [];
2061
2061
  for (let a = 0; a < n.length; a++) {
2062
- const o = n[a], c = e[a], d = sn(o, c);
2062
+ const o = n[a], c = e[a], d = nn(o, c);
2063
2063
  if (!d.valid)
2064
2064
  return { valid: !1 };
2065
2065
  r.push(d.data);
@@ -2067,13 +2067,13 @@ function sn(n, e) {
2067
2067
  return { valid: !0, data: r };
2068
2068
  } else return t === _.date && s === _.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
2069
2069
  }
2070
- class ot extends Z {
2070
+ class ot extends S {
2071
2071
  _parse(e) {
2072
2072
  const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
2073
- if (tn(a) || tn(o))
2073
+ if (en(a) || en(o))
2074
2074
  return x;
2075
- const c = sn(a.value, o.value);
2076
- return c.valid ? ((nn(a) || nn(o)) && t.dirty(), { status: t.value, value: c.data }) : (f(s, {
2075
+ const c = nn(a.value, o.value);
2076
+ return c.valid ? ((tn(a) || tn(o)) && t.dirty(), { status: t.value, value: c.data }) : (f(s, {
2077
2077
  code: p.invalid_intersection_types
2078
2078
  }), x);
2079
2079
  };
@@ -2103,9 +2103,9 @@ ot.create = (n, e, t) => new ot({
2103
2103
  left: n,
2104
2104
  right: e,
2105
2105
  typeName: w.ZodIntersection,
2106
- ...O(t)
2106
+ ...T(t)
2107
2107
  });
2108
- class te extends Z {
2108
+ class ee extends S {
2109
2109
  _parse(e) {
2110
2110
  const { status: t, ctx: s } = this._processInputParams(e);
2111
2111
  if (s.parsedType !== _.array)
@@ -2131,7 +2131,7 @@ class te extends Z {
2131
2131
  }), t.dirty());
2132
2132
  const r = [...s.data].map((a, o) => {
2133
2133
  const c = this._def.items[o] || this._def.rest;
2134
- return c ? c._parse(new ee(s, a, s.path, o)) : null;
2134
+ return c ? c._parse(new X(s, a, s.path, o)) : null;
2135
2135
  }).filter((a) => !!a);
2136
2136
  return s.common.async ? Promise.all(r).then((a) => $.mergeArray(t, a)) : $.mergeArray(t, r);
2137
2137
  }
@@ -2139,23 +2139,23 @@ class te extends Z {
2139
2139
  return this._def.items;
2140
2140
  }
2141
2141
  rest(e) {
2142
- return new te({
2142
+ return new ee({
2143
2143
  ...this._def,
2144
2144
  rest: e
2145
2145
  });
2146
2146
  }
2147
2147
  }
2148
- te.create = (n, e) => {
2148
+ ee.create = (n, e) => {
2149
2149
  if (!Array.isArray(n))
2150
2150
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2151
- return new te({
2151
+ return new ee({
2152
2152
  items: n,
2153
2153
  typeName: w.ZodTuple,
2154
2154
  rest: null,
2155
- ...O(e)
2155
+ ...T(e)
2156
2156
  });
2157
2157
  };
2158
- class ct extends Z {
2158
+ class ct extends S {
2159
2159
  get keySchema() {
2160
2160
  return this._def.keyType;
2161
2161
  }
@@ -2173,8 +2173,8 @@ class ct extends Z {
2173
2173
  const r = [], a = this._def.keyType, o = this._def.valueType;
2174
2174
  for (const c in s.data)
2175
2175
  r.push({
2176
- key: a._parse(new ee(s, c, s.path, c)),
2177
- value: o._parse(new ee(s, s.data[c], s.path, c)),
2176
+ key: a._parse(new X(s, c, s.path, c)),
2177
+ value: o._parse(new X(s, s.data[c], s.path, c)),
2178
2178
  alwaysSet: c in s.data
2179
2179
  });
2180
2180
  return s.common.async ? $.mergeObjectAsync(t, r) : $.mergeObjectSync(t, r);
@@ -2183,20 +2183,20 @@ class ct extends Z {
2183
2183
  return this._def.valueType;
2184
2184
  }
2185
2185
  static create(e, t, s) {
2186
- return t instanceof Z ? new ct({
2186
+ return t instanceof S ? new ct({
2187
2187
  keyType: e,
2188
2188
  valueType: t,
2189
2189
  typeName: w.ZodRecord,
2190
- ...O(s)
2190
+ ...T(s)
2191
2191
  }) : new ct({
2192
2192
  keyType: F.create(),
2193
2193
  valueType: e,
2194
2194
  typeName: w.ZodRecord,
2195
- ...O(t)
2195
+ ...T(t)
2196
2196
  });
2197
2197
  }
2198
2198
  }
2199
- class Lt extends Z {
2199
+ class Mt extends S {
2200
2200
  get keySchema() {
2201
2201
  return this._def.keyType;
2202
2202
  }
@@ -2212,8 +2212,8 @@ class Lt extends Z {
2212
2212
  received: s.parsedType
2213
2213
  }), x;
2214
2214
  const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([c, d], u) => ({
2215
- key: r._parse(new ee(s, c, s.path, [u, "key"])),
2216
- value: a._parse(new ee(s, d, s.path, [u, "value"]))
2215
+ key: r._parse(new X(s, c, s.path, [u, "key"])),
2216
+ value: a._parse(new X(s, d, s.path, [u, "value"]))
2217
2217
  }));
2218
2218
  if (s.common.async) {
2219
2219
  const c = /* @__PURE__ */ new Map();
@@ -2238,13 +2238,13 @@ class Lt extends Z {
2238
2238
  }
2239
2239
  }
2240
2240
  }
2241
- Lt.create = (n, e, t) => new Lt({
2241
+ Mt.create = (n, e, t) => new Mt({
2242
2242
  valueType: e,
2243
2243
  keyType: n,
2244
2244
  typeName: w.ZodMap,
2245
- ...O(t)
2245
+ ...T(t)
2246
2246
  });
2247
- class Ie extends Z {
2247
+ class Ne extends S {
2248
2248
  _parse(e) {
2249
2249
  const { status: t, ctx: s } = this._processInputParams(e);
2250
2250
  if (s.parsedType !== _.set)
@@ -2279,17 +2279,17 @@ class Ie extends Z {
2279
2279
  }
2280
2280
  return { status: t.value, value: u };
2281
2281
  }
2282
- const c = [...s.data.values()].map((d, u) => a._parse(new ee(s, d, s.path, u)));
2282
+ const c = [...s.data.values()].map((d, u) => a._parse(new X(s, d, s.path, u)));
2283
2283
  return s.common.async ? Promise.all(c).then((d) => o(d)) : o(c);
2284
2284
  }
2285
2285
  min(e, t) {
2286
- return new Ie({
2286
+ return new Ne({
2287
2287
  ...this._def,
2288
2288
  minSize: { value: e, message: y.toString(t) }
2289
2289
  });
2290
2290
  }
2291
2291
  max(e, t) {
2292
- return new Ie({
2292
+ return new Ne({
2293
2293
  ...this._def,
2294
2294
  maxSize: { value: e, message: y.toString(t) }
2295
2295
  });
@@ -2301,14 +2301,14 @@ class Ie extends Z {
2301
2301
  return this.min(1, e);
2302
2302
  }
2303
2303
  }
2304
- Ie.create = (n, e) => new Ie({
2304
+ Ne.create = (n, e) => new Ne({
2305
2305
  valueType: n,
2306
2306
  minSize: null,
2307
2307
  maxSize: null,
2308
2308
  typeName: w.ZodSet,
2309
- ...O(e)
2309
+ ...T(e)
2310
2310
  });
2311
- class Ue extends Z {
2311
+ class Ue extends S {
2312
2312
  constructor() {
2313
2313
  super(...arguments), this.validate = this.implement;
2314
2314
  }
@@ -2321,13 +2321,13 @@ class Ue extends Z {
2321
2321
  received: t.parsedType
2322
2322
  }), x;
2323
2323
  function s(c, d) {
2324
- return Rt({
2324
+ return At({
2325
2325
  data: c,
2326
2326
  path: t.path,
2327
2327
  errorMaps: [
2328
2328
  t.common.contextualErrorMap,
2329
2329
  t.schemaErrorMap,
2330
- At(),
2330
+ Et(),
2331
2331
  ze
2332
2332
  ].filter((u) => !!u),
2333
2333
  issueData: {
@@ -2337,13 +2337,13 @@ class Ue extends Z {
2337
2337
  });
2338
2338
  }
2339
2339
  function r(c, d) {
2340
- return Rt({
2340
+ return At({
2341
2341
  data: c,
2342
2342
  path: t.path,
2343
2343
  errorMaps: [
2344
2344
  t.common.contextualErrorMap,
2345
2345
  t.schemaErrorMap,
2346
- At(),
2346
+ Et(),
2347
2347
  ze
2348
2348
  ].filter((u) => !!u),
2349
2349
  issueData: {
@@ -2356,11 +2356,11 @@ class Ue extends Z {
2356
2356
  if (this._def.returns instanceof We) {
2357
2357
  const c = this;
2358
2358
  return D(async function(...d) {
2359
- const u = new V([]), l = await c._def.args.parseAsync(d, a).catch((C) => {
2360
- throw u.addIssue(s(d, C)), u;
2361
- }), T = await Reflect.apply(o, this, l);
2362
- return await c._def.returns._def.type.parseAsync(T, a).catch((C) => {
2363
- throw u.addIssue(r(T, C)), u;
2359
+ const u = new L([]), l = await c._def.args.parseAsync(d, a).catch((A) => {
2360
+ throw u.addIssue(s(d, A)), u;
2361
+ }), j = await Reflect.apply(o, this, l);
2362
+ return await c._def.returns._def.type.parseAsync(j, a).catch((A) => {
2363
+ throw u.addIssue(r(j, A)), u;
2364
2364
  });
2365
2365
  });
2366
2366
  } else {
@@ -2368,11 +2368,11 @@ class Ue extends Z {
2368
2368
  return D(function(...d) {
2369
2369
  const u = c._def.args.safeParse(d, a);
2370
2370
  if (!u.success)
2371
- throw new V([s(d, u.error)]);
2372
- const l = Reflect.apply(o, this, u.data), T = c._def.returns.safeParse(l, a);
2373
- if (!T.success)
2374
- throw new V([r(l, T.error)]);
2375
- return T.data;
2371
+ throw new L([s(d, u.error)]);
2372
+ const l = Reflect.apply(o, this, u.data), j = c._def.returns.safeParse(l, a);
2373
+ if (!j.success)
2374
+ throw new L([r(l, j.error)]);
2375
+ return j.data;
2376
2376
  });
2377
2377
  }
2378
2378
  }
@@ -2385,7 +2385,7 @@ class Ue extends Z {
2385
2385
  args(...e) {
2386
2386
  return new Ue({
2387
2387
  ...this._def,
2388
- args: te.create(e).rest(Ze.create())
2388
+ args: ee.create(e).rest(Se.create())
2389
2389
  });
2390
2390
  }
2391
2391
  returns(e) {
@@ -2402,14 +2402,14 @@ class Ue extends Z {
2402
2402
  }
2403
2403
  static create(e, t, s) {
2404
2404
  return new Ue({
2405
- args: e || te.create([]).rest(Ze.create()),
2406
- returns: t || Ze.create(),
2405
+ args: e || ee.create([]).rest(Se.create()),
2406
+ returns: t || Se.create(),
2407
2407
  typeName: w.ZodFunction,
2408
- ...O(s)
2408
+ ...T(s)
2409
2409
  });
2410
2410
  }
2411
2411
  }
2412
- class dt extends Z {
2412
+ class dt extends S {
2413
2413
  get schema() {
2414
2414
  return this._def.getter();
2415
2415
  }
@@ -2421,9 +2421,9 @@ class dt extends Z {
2421
2421
  dt.create = (n, e) => new dt({
2422
2422
  getter: n,
2423
2423
  typeName: w.ZodLazy,
2424
- ...O(e)
2424
+ ...T(e)
2425
2425
  });
2426
- class ut extends Z {
2426
+ class ut extends S {
2427
2427
  _parse(e) {
2428
2428
  if (e.data !== this._def.value) {
2429
2429
  const t = this._getOrReturnCtx(e);
@@ -2442,16 +2442,16 @@ class ut extends Z {
2442
2442
  ut.create = (n, e) => new ut({
2443
2443
  value: n,
2444
2444
  typeName: w.ZodLiteral,
2445
- ...O(e)
2445
+ ...T(e)
2446
2446
  });
2447
- function On(n, e) {
2448
- return new ge({
2447
+ function Tn(n, e) {
2448
+ return new _e({
2449
2449
  values: n,
2450
2450
  typeName: w.ZodEnum,
2451
- ...O(e)
2451
+ ...T(e)
2452
2452
  });
2453
2453
  }
2454
- class ge extends Z {
2454
+ class _e extends S {
2455
2455
  constructor() {
2456
2456
  super(...arguments), Ye.set(this, void 0);
2457
2457
  }
@@ -2464,7 +2464,7 @@ class ge extends Z {
2464
2464
  code: p.invalid_type
2465
2465
  }), x;
2466
2466
  }
2467
- if (Pt(this, Ye) || kn(this, Ye, new Set(this._def.values)), !Pt(this, Ye).has(e.data)) {
2467
+ if ($t(this, Ye) || wn(this, Ye, new Set(this._def.values)), !$t(this, Ye).has(e.data)) {
2468
2468
  const t = this._getOrReturnCtx(e), s = this._def.values;
2469
2469
  return f(t, {
2470
2470
  received: t.data,
@@ -2496,21 +2496,21 @@ class ge extends Z {
2496
2496
  return e;
2497
2497
  }
2498
2498
  extract(e, t = this._def) {
2499
- return ge.create(e, {
2499
+ return _e.create(e, {
2500
2500
  ...this._def,
2501
2501
  ...t
2502
2502
  });
2503
2503
  }
2504
2504
  exclude(e, t = this._def) {
2505
- return ge.create(this.options.filter((s) => !e.includes(s)), {
2505
+ return _e.create(this.options.filter((s) => !e.includes(s)), {
2506
2506
  ...this._def,
2507
2507
  ...t
2508
2508
  });
2509
2509
  }
2510
2510
  }
2511
2511
  Ye = /* @__PURE__ */ new WeakMap();
2512
- ge.create = On;
2513
- class lt extends Z {
2512
+ _e.create = Tn;
2513
+ class lt extends S {
2514
2514
  constructor() {
2515
2515
  super(...arguments), Ge.set(this, void 0);
2516
2516
  }
@@ -2524,7 +2524,7 @@ class lt extends Z {
2524
2524
  code: p.invalid_type
2525
2525
  }), x;
2526
2526
  }
2527
- if (Pt(this, Ge) || kn(this, Ge, new Set(N.getValidEnumValues(this._def.values))), !Pt(this, Ge).has(e.data)) {
2527
+ if ($t(this, Ge) || wn(this, Ge, new Set(N.getValidEnumValues(this._def.values))), !$t(this, Ge).has(e.data)) {
2528
2528
  const r = N.objectValues(t);
2529
2529
  return f(s, {
2530
2530
  received: s.data,
@@ -2542,9 +2542,9 @@ Ge = /* @__PURE__ */ new WeakMap();
2542
2542
  lt.create = (n, e) => new lt({
2543
2543
  values: n,
2544
2544
  typeName: w.ZodNativeEnum,
2545
- ...O(e)
2545
+ ...T(e)
2546
2546
  });
2547
- class We extends Z {
2547
+ class We extends S {
2548
2548
  unwrap() {
2549
2549
  return this._def.type;
2550
2550
  }
@@ -2566,9 +2566,9 @@ class We extends Z {
2566
2566
  We.create = (n, e) => new We({
2567
2567
  type: n,
2568
2568
  typeName: w.ZodPromise,
2569
- ...O(e)
2569
+ ...T(e)
2570
2570
  });
2571
- class q extends Z {
2571
+ class q extends S {
2572
2572
  innerType() {
2573
2573
  return this._def.schema;
2574
2574
  }
@@ -2595,7 +2595,7 @@ class q extends Z {
2595
2595
  path: s.path,
2596
2596
  parent: s
2597
2597
  });
2598
- return d.status === "aborted" ? x : d.status === "dirty" || t.value === "dirty" ? $t(d.value) : d;
2598
+ return d.status === "aborted" ? x : d.status === "dirty" || t.value === "dirty" ? Rt(d.value) : d;
2599
2599
  });
2600
2600
  {
2601
2601
  if (t.value === "aborted")
@@ -2605,7 +2605,7 @@ class q extends Z {
2605
2605
  path: s.path,
2606
2606
  parent: s
2607
2607
  });
2608
- return c.status === "aborted" ? x : c.status === "dirty" || t.value === "dirty" ? $t(c.value) : c;
2608
+ return c.status === "aborted" ? x : c.status === "dirty" || t.value === "dirty" ? Rt(c.value) : c;
2609
2609
  }
2610
2610
  }
2611
2611
  if (r.type === "refinement") {
@@ -2649,15 +2649,15 @@ q.create = (n, e, t) => new q({
2649
2649
  schema: n,
2650
2650
  typeName: w.ZodEffects,
2651
2651
  effect: e,
2652
- ...O(t)
2652
+ ...T(t)
2653
2653
  });
2654
2654
  q.createWithPreprocess = (n, e, t) => new q({
2655
2655
  schema: e,
2656
2656
  effect: { type: "preprocess", transform: n },
2657
2657
  typeName: w.ZodEffects,
2658
- ...O(t)
2658
+ ...T(t)
2659
2659
  });
2660
- class G extends Z {
2660
+ class Y extends S {
2661
2661
  _parse(e) {
2662
2662
  return this._getType(e) === _.undefined ? D(void 0) : this._def.innerType._parse(e);
2663
2663
  }
@@ -2665,12 +2665,12 @@ class G extends Z {
2665
2665
  return this._def.innerType;
2666
2666
  }
2667
2667
  }
2668
- G.create = (n, e) => new G({
2668
+ Y.create = (n, e) => new Y({
2669
2669
  innerType: n,
2670
2670
  typeName: w.ZodOptional,
2671
- ...O(e)
2671
+ ...T(e)
2672
2672
  });
2673
- class ye extends Z {
2673
+ class ge extends S {
2674
2674
  _parse(e) {
2675
2675
  return this._getType(e) === _.null ? D(null) : this._def.innerType._parse(e);
2676
2676
  }
@@ -2678,12 +2678,12 @@ class ye extends Z {
2678
2678
  return this._def.innerType;
2679
2679
  }
2680
2680
  }
2681
- ye.create = (n, e) => new ye({
2681
+ ge.create = (n, e) => new ge({
2682
2682
  innerType: n,
2683
2683
  typeName: w.ZodNullable,
2684
- ...O(e)
2684
+ ...T(e)
2685
2685
  });
2686
- class pt extends Z {
2686
+ class pt extends S {
2687
2687
  _parse(e) {
2688
2688
  const { ctx: t } = this._processInputParams(e);
2689
2689
  let s = t.data;
@@ -2701,9 +2701,9 @@ pt.create = (n, e) => new pt({
2701
2701
  innerType: n,
2702
2702
  typeName: w.ZodDefault,
2703
2703
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2704
- ...O(e)
2704
+ ...T(e)
2705
2705
  });
2706
- class ht extends Z {
2706
+ class ht extends S {
2707
2707
  _parse(e) {
2708
2708
  const { ctx: t } = this._processInputParams(e), s = {
2709
2709
  ...t,
@@ -2722,7 +2722,7 @@ class ht extends Z {
2722
2722
  status: "valid",
2723
2723
  value: a.status === "valid" ? a.value : this._def.catchValue({
2724
2724
  get error() {
2725
- return new V(s.common.issues);
2725
+ return new L(s.common.issues);
2726
2726
  },
2727
2727
  input: s.data
2728
2728
  })
@@ -2730,7 +2730,7 @@ class ht extends Z {
2730
2730
  status: "valid",
2731
2731
  value: r.status === "valid" ? r.value : this._def.catchValue({
2732
2732
  get error() {
2733
- return new V(s.common.issues);
2733
+ return new L(s.common.issues);
2734
2734
  },
2735
2735
  input: s.data
2736
2736
  })
@@ -2744,9 +2744,9 @@ ht.create = (n, e) => new ht({
2744
2744
  innerType: n,
2745
2745
  typeName: w.ZodCatch,
2746
2746
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2747
- ...O(e)
2747
+ ...T(e)
2748
2748
  });
2749
- class Vt extends Z {
2749
+ class Lt extends S {
2750
2750
  _parse(e) {
2751
2751
  if (this._getType(e) !== _.nan) {
2752
2752
  const t = this._getOrReturnCtx(e);
@@ -2759,12 +2759,12 @@ class Vt extends Z {
2759
2759
  return { status: "valid", value: e.data };
2760
2760
  }
2761
2761
  }
2762
- Vt.create = (n) => new Vt({
2762
+ Lt.create = (n) => new Lt({
2763
2763
  typeName: w.ZodNaN,
2764
- ...O(n)
2764
+ ...T(n)
2765
2765
  });
2766
- const ys = Symbol("zod_brand");
2767
- class dn extends Z {
2766
+ const gs = Symbol("zod_brand");
2767
+ class cn extends S {
2768
2768
  _parse(e) {
2769
2769
  const { ctx: t } = this._processInputParams(e), s = t.data;
2770
2770
  return this._def.type._parse({
@@ -2777,7 +2777,7 @@ class dn extends Z {
2777
2777
  return this._def.type;
2778
2778
  }
2779
2779
  }
2780
- class Nt extends Z {
2780
+ class Nt extends S {
2781
2781
  _parse(e) {
2782
2782
  const { status: t, ctx: s } = this._processInputParams(e);
2783
2783
  if (s.common.async)
@@ -2787,7 +2787,7 @@ class Nt extends Z {
2787
2787
  path: s.path,
2788
2788
  parent: s
2789
2789
  });
2790
- return r.status === "aborted" ? x : r.status === "dirty" ? (t.dirty(), $t(r.value)) : this._def.out._parseAsync({
2790
+ return r.status === "aborted" ? x : r.status === "dirty" ? (t.dirty(), Rt(r.value)) : this._def.out._parseAsync({
2791
2791
  data: r.value,
2792
2792
  path: s.path,
2793
2793
  parent: s
@@ -2817,7 +2817,7 @@ class Nt extends Z {
2817
2817
  });
2818
2818
  }
2819
2819
  }
2820
- class ft extends Z {
2820
+ class ft extends S {
2821
2821
  _parse(e) {
2822
2822
  const t = this._def.innerType._parse(e), s = (r) => (tt(r) && (r.value = Object.freeze(r.value)), r);
2823
2823
  return nt(t) ? t.then((r) => s(r)) : s(t);
@@ -2829,9 +2829,9 @@ class ft extends Z {
2829
2829
  ft.create = (n, e) => new ft({
2830
2830
  innerType: n,
2831
2831
  typeName: w.ZodReadonly,
2832
- ...O(e)
2832
+ ...T(e)
2833
2833
  });
2834
- function Sn(n, e = {}, t) {
2834
+ function On(n, e = {}, t) {
2835
2835
  return n ? Be.create().superRefine((s, r) => {
2836
2836
  var a, o;
2837
2837
  if (!n(s)) {
@@ -2840,151 +2840,151 @@ function Sn(n, e = {}, t) {
2840
2840
  }
2841
2841
  }) : Be.create();
2842
2842
  }
2843
- const vs = {
2844
- object: E.lazycreate
2843
+ const ys = {
2844
+ object: I.lazycreate
2845
2845
  };
2846
2846
  var w;
2847
2847
  (function(n) {
2848
2848
  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";
2849
2849
  })(w || (w = {}));
2850
- const ws = (n, e = {
2850
+ const vs = (n, e = {
2851
2851
  message: `Input not instance of ${n.name}`
2852
- }) => Sn((t) => t instanceof n, e), Zn = F.create, jn = me.create, ks = Vt.create, bs = _e.create, Nn = st.create, xs = Ne.create, Ts = Dt.create, Os = rt.create, Ss = at.create, Zs = Be.create, js = Ze.create, Ns = ie.create, Is = Mt.create, Cs = B.create, Es = E.create, As = E.strictCreate, Rs = it.create, $s = Kt.create, Ps = ot.create, Ds = te.create, Ms = ct.create, Ls = Lt.create, Vs = Ie.create, Us = Ue.create, Fs = dt.create, zs = ut.create, Bs = ge.create, Ws = lt.create, qs = We.create, mn = q.create, Js = G.create, Ks = ye.create, Qs = q.createWithPreprocess, Hs = Nt.create, Ys = () => Zn().optional(), Gs = () => jn().optional(), Xs = () => Nn().optional(), er = {
2852
+ }) => On((t) => t instanceof n, e), Sn = F.create, Zn = fe.create, ws = Lt.create, ks = me.create, jn = st.create, bs = je.create, xs = Pt.create, Ts = rt.create, Os = at.create, Ss = Be.create, Zs = Se.create, js = re.create, Ns = Dt.create, Cs = B.create, Is = I.create, Es = I.strictCreate, As = it.create, Rs = Jt.create, $s = ot.create, Ps = ee.create, Ds = ct.create, Ms = Mt.create, Ls = Ne.create, Vs = Ue.create, Us = dt.create, Fs = ut.create, zs = _e.create, Bs = lt.create, Ws = We.create, fn = q.create, qs = Y.create, Js = ge.create, Ks = q.createWithPreprocess, Qs = Nt.create, Hs = () => Sn().optional(), Ys = () => Zn().optional(), Gs = () => jn().optional(), Xs = {
2853
2853
  string: (n) => F.create({ ...n, coerce: !0 }),
2854
- number: (n) => me.create({ ...n, coerce: !0 }),
2854
+ number: (n) => fe.create({ ...n, coerce: !0 }),
2855
2855
  boolean: (n) => st.create({
2856
2856
  ...n,
2857
2857
  coerce: !0
2858
2858
  }),
2859
- bigint: (n) => _e.create({ ...n, coerce: !0 }),
2860
- date: (n) => Ne.create({ ...n, coerce: !0 })
2861
- }, tr = x;
2859
+ bigint: (n) => me.create({ ...n, coerce: !0 }),
2860
+ date: (n) => je.create({ ...n, coerce: !0 })
2861
+ }, er = x;
2862
2862
  var i = /* @__PURE__ */ Object.freeze({
2863
2863
  __proto__: null,
2864
2864
  defaultErrorMap: ze,
2865
- setErrorMap: ts,
2866
- getErrorMap: At,
2867
- makeIssue: Rt,
2868
- EMPTY_PATH: ns,
2865
+ setErrorMap: es,
2866
+ getErrorMap: Et,
2867
+ makeIssue: At,
2868
+ EMPTY_PATH: ts,
2869
2869
  addIssueToContext: f,
2870
2870
  ParseStatus: $,
2871
2871
  INVALID: x,
2872
- DIRTY: $t,
2872
+ DIRTY: Rt,
2873
2873
  OK: D,
2874
- isAborted: tn,
2875
- isDirty: nn,
2874
+ isAborted: en,
2875
+ isDirty: tn,
2876
2876
  isValid: tt,
2877
2877
  isAsync: nt,
2878
2878
  get util() {
2879
2879
  return N;
2880
2880
  },
2881
2881
  get objectUtil() {
2882
- return en;
2882
+ return Xt;
2883
2883
  },
2884
2884
  ZodParsedType: _,
2885
- getParsedType: he,
2886
- ZodType: Z,
2887
- datetimeRegex: Tn,
2885
+ getParsedType: pe,
2886
+ ZodType: S,
2887
+ datetimeRegex: xn,
2888
2888
  ZodString: F,
2889
- ZodNumber: me,
2890
- ZodBigInt: _e,
2889
+ ZodNumber: fe,
2890
+ ZodBigInt: me,
2891
2891
  ZodBoolean: st,
2892
- ZodDate: Ne,
2893
- ZodSymbol: Dt,
2892
+ ZodDate: je,
2893
+ ZodSymbol: Pt,
2894
2894
  ZodUndefined: rt,
2895
2895
  ZodNull: at,
2896
2896
  ZodAny: Be,
2897
- ZodUnknown: Ze,
2898
- ZodNever: ie,
2899
- ZodVoid: Mt,
2897
+ ZodUnknown: Se,
2898
+ ZodNever: re,
2899
+ ZodVoid: Dt,
2900
2900
  ZodArray: B,
2901
- ZodObject: E,
2901
+ ZodObject: I,
2902
2902
  ZodUnion: it,
2903
- ZodDiscriminatedUnion: Kt,
2903
+ ZodDiscriminatedUnion: Jt,
2904
2904
  ZodIntersection: ot,
2905
- ZodTuple: te,
2905
+ ZodTuple: ee,
2906
2906
  ZodRecord: ct,
2907
- ZodMap: Lt,
2908
- ZodSet: Ie,
2907
+ ZodMap: Mt,
2908
+ ZodSet: Ne,
2909
2909
  ZodFunction: Ue,
2910
2910
  ZodLazy: dt,
2911
2911
  ZodLiteral: ut,
2912
- ZodEnum: ge,
2912
+ ZodEnum: _e,
2913
2913
  ZodNativeEnum: lt,
2914
2914
  ZodPromise: We,
2915
2915
  ZodEffects: q,
2916
2916
  ZodTransformer: q,
2917
- ZodOptional: G,
2918
- ZodNullable: ye,
2917
+ ZodOptional: Y,
2918
+ ZodNullable: ge,
2919
2919
  ZodDefault: pt,
2920
2920
  ZodCatch: ht,
2921
- ZodNaN: Vt,
2922
- BRAND: ys,
2923
- ZodBranded: dn,
2921
+ ZodNaN: Lt,
2922
+ BRAND: gs,
2923
+ ZodBranded: cn,
2924
2924
  ZodPipeline: Nt,
2925
2925
  ZodReadonly: ft,
2926
- custom: Sn,
2927
- Schema: Z,
2928
- ZodSchema: Z,
2929
- late: vs,
2926
+ custom: On,
2927
+ Schema: S,
2928
+ ZodSchema: S,
2929
+ late: ys,
2930
2930
  get ZodFirstPartyTypeKind() {
2931
2931
  return w;
2932
2932
  },
2933
- coerce: er,
2934
- any: Zs,
2933
+ coerce: Xs,
2934
+ any: Ss,
2935
2935
  array: Cs,
2936
- bigint: bs,
2937
- boolean: Nn,
2938
- date: xs,
2939
- discriminatedUnion: $s,
2940
- effect: mn,
2941
- enum: Bs,
2942
- function: Us,
2943
- instanceof: ws,
2944
- intersection: Ps,
2945
- lazy: Fs,
2946
- literal: zs,
2947
- map: Ls,
2948
- nan: ks,
2949
- nativeEnum: Ws,
2950
- never: Ns,
2951
- null: Ss,
2952
- nullable: Ks,
2953
- number: jn,
2954
- object: Es,
2955
- oboolean: Xs,
2956
- onumber: Gs,
2957
- optional: Js,
2958
- ostring: Ys,
2959
- pipeline: Hs,
2960
- preprocess: Qs,
2961
- promise: qs,
2962
- record: Ms,
2963
- set: Vs,
2964
- strictObject: As,
2965
- string: Zn,
2966
- symbol: Ts,
2967
- transformer: mn,
2968
- tuple: Ds,
2969
- undefined: Os,
2970
- union: Rs,
2971
- unknown: js,
2972
- void: Is,
2973
- NEVER: tr,
2936
+ bigint: ks,
2937
+ boolean: jn,
2938
+ date: bs,
2939
+ discriminatedUnion: Rs,
2940
+ effect: fn,
2941
+ enum: zs,
2942
+ function: Vs,
2943
+ instanceof: vs,
2944
+ intersection: $s,
2945
+ lazy: Us,
2946
+ literal: Fs,
2947
+ map: Ms,
2948
+ nan: ws,
2949
+ nativeEnum: Bs,
2950
+ never: js,
2951
+ null: Os,
2952
+ nullable: Js,
2953
+ number: Zn,
2954
+ object: Is,
2955
+ oboolean: Gs,
2956
+ onumber: Ys,
2957
+ optional: qs,
2958
+ ostring: Hs,
2959
+ pipeline: Qs,
2960
+ preprocess: Ks,
2961
+ promise: Ws,
2962
+ record: Ds,
2963
+ set: Ls,
2964
+ strictObject: Es,
2965
+ string: Sn,
2966
+ symbol: xs,
2967
+ transformer: fn,
2968
+ tuple: Ps,
2969
+ undefined: Ts,
2970
+ union: As,
2971
+ unknown: Zs,
2972
+ void: Ns,
2973
+ NEVER: er,
2974
2974
  ZodIssueCode: p,
2975
- quotelessJson: es,
2976
- ZodError: V
2975
+ quotelessJson: Xn,
2976
+ ZodError: L
2977
2977
  });
2978
- Xn(i);
2978
+ Gn(i);
2979
2979
  i.object({
2980
2980
  start: i.number(),
2981
2981
  limit: i.number(),
2982
2982
  length: i.number()
2983
2983
  });
2984
- const un = i.object({
2984
+ const dn = i.object({
2985
2985
  created_at: i.string(),
2986
2986
  updated_at: i.string()
2987
- }), nr = i.object({
2987
+ }), tr = i.object({
2988
2988
  email: i.string().optional(),
2989
2989
  email_verified: i.boolean().optional(),
2990
2990
  name: i.string().optional(),
@@ -2993,7 +2993,7 @@ const un = i.object({
2993
2993
  phone_number: i.string().optional(),
2994
2994
  phone_verified: i.boolean().optional(),
2995
2995
  family_name: i.string().optional()
2996
- }).catchall(i.any()), sr = i.object({
2996
+ }).catchall(i.any()), nr = i.object({
2997
2997
  connection: i.string(),
2998
2998
  user_id: i.string(),
2999
2999
  provider: i.string(),
@@ -3001,8 +3001,8 @@ const un = i.object({
3001
3001
  access_token: i.string().optional(),
3002
3002
  access_token_secret: i.string().optional(),
3003
3003
  refresh_token: i.string().optional(),
3004
- profileData: nr.optional()
3005
- }), In = i.object({
3004
+ profileData: tr.optional()
3005
+ }), Nn = i.object({
3006
3006
  email: i.string().optional(),
3007
3007
  username: i.string().optional(),
3008
3008
  given_name: i.string().optional(),
@@ -3014,7 +3014,7 @@ const un = i.object({
3014
3014
  linked_to: i.string().optional(),
3015
3015
  profileData: i.string().optional(),
3016
3016
  user_id: i.string().optional()
3017
- }), rr = In.extend({
3017
+ }), sr = Nn.extend({
3018
3018
  email_verified: i.boolean().default(!1),
3019
3019
  verify_email: i.boolean().optional(),
3020
3020
  last_ip: i.string().optional(),
@@ -3023,15 +3023,15 @@ const un = i.object({
3023
3023
  provider: i.string().default("email"),
3024
3024
  connection: i.string().default("email")
3025
3025
  });
3026
- rr.extend(un.shape).extend({
3026
+ sr.extend(dn.shape).extend({
3027
3027
  user_id: i.string(),
3028
3028
  // TODO: this not might be correct if you use the username
3029
3029
  email: i.string(),
3030
3030
  is_social: i.boolean(),
3031
3031
  login_count: i.number(),
3032
- identities: i.array(sr).optional()
3032
+ identities: i.array(nr).optional()
3033
3033
  });
3034
- In.extend({
3034
+ Nn.extend({
3035
3035
  email: i.string(),
3036
3036
  login_count: i.number(),
3037
3037
  multifactor: i.array(i.string()).optional(),
@@ -3039,7 +3039,7 @@ In.extend({
3039
3039
  last_login: i.string().optional(),
3040
3040
  user_id: i.string()
3041
3041
  }).catchall(i.any());
3042
- const ar = i.object({
3042
+ const rr = i.object({
3043
3043
  audience: i.string().optional(),
3044
3044
  recipient: i.string().optional(),
3045
3045
  createUpnClaim: i.boolean().optional(),
@@ -3056,7 +3056,7 @@ const ar = i.object({
3056
3056
  nameIdentifierProbes: i.array(i.string()).optional(),
3057
3057
  authnContextClassRef: i.string().optional(),
3058
3058
  mappings: i.record(i.string()).optional()
3059
- }), ir = i.object({
3059
+ }), ar = i.object({
3060
3060
  id: i.string(),
3061
3061
  name: i.string(),
3062
3062
  callbacks: i.array(i.string()).openapi({
@@ -3072,7 +3072,7 @@ const ar = i.object({
3072
3072
  description: "Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."
3073
3073
  }),
3074
3074
  addons: i.object({
3075
- samlp: ar.optional()
3075
+ samlp: rr.optional()
3076
3076
  }).optional().openapi({
3077
3077
  description: "Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon."
3078
3078
  }),
@@ -3083,23 +3083,23 @@ const ar = i.object({
3083
3083
  disable_sign_ups: i.boolean().default(!1).openapi({
3084
3084
  description: "Prevents users from signing up using the hosted login page. This is not available in auth0"
3085
3085
  })
3086
- }), or = i.object({
3086
+ }), ir = i.object({
3087
3087
  created_at: i.string().transform((n) => n === null ? "" : n),
3088
3088
  updated_at: i.string().transform((n) => n === null ? "" : n),
3089
- ...ir.shape
3089
+ ...ar.shape
3090
3090
  });
3091
- var Cn = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(Cn || {}), En = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n.SAML_POST = "saml_post", n))(En || {}), An = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))(An || {});
3092
- const Qt = i.object({
3091
+ var Cn = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(Cn || {}), In = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n.SAML_POST = "saml_post", n))(In || {}), En = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))(En || {});
3092
+ const or = i.object({
3093
3093
  client_id: i.string(),
3094
3094
  vendor_id: i.string().optional(),
3095
3095
  response_type: i.nativeEnum(Cn).optional(),
3096
- response_mode: i.nativeEnum(En).optional(),
3096
+ response_mode: i.nativeEnum(In).optional(),
3097
3097
  redirect_uri: i.string().optional(),
3098
3098
  audience: i.string().optional(),
3099
3099
  state: i.string().optional(),
3100
3100
  nonce: i.string().optional(),
3101
3101
  scope: i.string().optional(),
3102
- code_challenge_method: i.nativeEnum(An).optional(),
3102
+ code_challenge_method: i.nativeEnum(En).optional(),
3103
3103
  code_challenge: i.string().optional(),
3104
3104
  username: i.string().optional()
3105
3105
  });
@@ -3134,7 +3134,7 @@ const cr = i.object({
3134
3134
  token_exchange_basic_auth: i.boolean().optional(),
3135
3135
  userinfo_endpoint: i.string().optional(),
3136
3136
  scope: i.string().optional()
3137
- }), Rn = i.object({
3137
+ }), An = i.object({
3138
3138
  id: i.string(),
3139
3139
  created_at: i.string().transform((n) => n === null ? "" : n),
3140
3140
  updated_at: i.string().transform((n) => n === null ? "" : n)
@@ -3180,10 +3180,10 @@ const lr = i.object({
3180
3180
  email_service: i.union([i.literal("mailgun"), i.literal("mailchannels")]).optional()
3181
3181
  });
3182
3182
  i.object({
3183
- ...or.shape,
3183
+ ...ir.shape,
3184
3184
  domains: i.array(lr),
3185
3185
  tenant: ur,
3186
- connections: i.array(Rn)
3186
+ connections: i.array(An)
3187
3187
  });
3188
3188
  const pr = i.enum([
3189
3189
  "password_reset",
@@ -3216,7 +3216,7 @@ const pr = i.enum([
3216
3216
  email_api_key: i.string().optional(),
3217
3217
  email_service: i.enum(["mailgun", "mailchannels"])
3218
3218
  });
3219
- un.extend({
3219
+ dn.extend({
3220
3220
  ...mr.shape,
3221
3221
  id: i.string()
3222
3222
  });
@@ -3233,7 +3233,7 @@ const _r = i.object({
3233
3233
  priority: i.number().optional()
3234
3234
  });
3235
3235
  _r.extend({
3236
- ...un.shape,
3236
+ ...dn.shape,
3237
3237
  hook_id: i.string()
3238
3238
  });
3239
3239
  const gr = i.object({
@@ -3271,7 +3271,7 @@ i.object({
3271
3271
  });
3272
3272
  const yr = i.object({
3273
3273
  auth0Client: i.string().optional(),
3274
- authParams: Qt,
3274
+ authParams: or,
3275
3275
  expires_at: i.string(),
3276
3276
  deleted_at: i.string().optional(),
3277
3277
  ip: i.string().optional()
@@ -3386,20 +3386,13 @@ i.object({
3386
3386
  created_at: i.string(),
3387
3387
  ...xr.shape
3388
3388
  });
3389
- i.object({
3390
- private_key: i.string(),
3391
- public_key: i.string(),
3392
- kid: i.string(),
3393
- created_at: i.string(),
3394
- revoked_at: i.string().optional()
3395
- });
3396
3389
  i.object({
3397
3390
  kid: i.string().openapi({ description: "The key id of the signing key" }),
3398
3391
  cert: i.string().openapi({ description: "The public certificate of the signing key" }),
3399
3392
  fingerprint: i.string().openapi({ description: "The cert fingerprint" }),
3400
3393
  thumbprint: i.string().openapi({ description: "The cert thumbprint" }),
3401
3394
  pkcs7: i.string().optional().openapi({
3402
- description: "The public certificate of the signing key in pkcs7 format"
3395
+ description: "The private key in pkcs7 format"
3403
3396
  }),
3404
3397
  current: i.boolean().optional().openapi({ description: "True if the key is the current key" }),
3405
3398
  next: i.boolean().optional().openapi({ description: "True if the key is the next key" }),
@@ -3413,10 +3406,10 @@ i.object({
3413
3406
  revoked: i.boolean().optional().openapi({ description: "True if the key is revoked" }),
3414
3407
  revoked_at: i.string().optional().openapi({ description: "The date and time when the key was revoked" })
3415
3408
  });
3416
- var $n = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))($n || {});
3417
- const ln = i.nativeEnum($n);
3409
+ var Rn = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))(Rn || {});
3410
+ const un = i.nativeEnum(Rn);
3418
3411
  i.object({
3419
- grant_type: ln.refine(
3412
+ grant_type: un.refine(
3420
3413
  (n) => n === "authorization_code"
3421
3414
  /* AuthorizationCode */
3422
3415
  ),
@@ -3425,7 +3418,7 @@ i.object({
3425
3418
  client_id: i.string()
3426
3419
  });
3427
3420
  i.object({
3428
- grant_type: ln.refine(
3421
+ grant_type: un.refine(
3429
3422
  (n) => n === "authorization_code"
3430
3423
  /* AuthorizationCode */
3431
3424
  ),
@@ -3435,7 +3428,7 @@ i.object({
3435
3428
  redirect_uri: i.string()
3436
3429
  });
3437
3430
  i.object({
3438
- grant_type: ln.refine(
3431
+ grant_type: un.refine(
3439
3432
  (n) => n === "client_credentials"
3440
3433
  /* ClientCredential */
3441
3434
  ),
@@ -3521,51 +3514,13 @@ const Tr = i.object({
3521
3514
  Nr.extend({
3522
3515
  themeId: i.string()
3523
3516
  });
3524
- const Ir = i.object({
3525
- id: i.string(),
3526
- expires_at: i.string(),
3527
- auth0Client: i.string().optional(),
3528
- authParams: Qt
3529
- });
3530
- i.object({
3531
- ...Ir.shape,
3532
- created_at: i.string(),
3533
- updated_at: i.string()
3534
- });
3535
- const Cr = i.object({
3536
- id: i.string(),
3537
- email: i.string(),
3538
- code: i.string(),
3539
- ip: i.string().optional(),
3540
- send: i.enum(["code", "link"]),
3541
- authParams: Qt,
3542
- expires_at: i.string(),
3543
- used_at: i.string().optional(),
3544
- user_id: i.string().optional()
3545
- });
3546
- i.object({
3547
- created_at: i.string(),
3548
- ...Cr.shape
3549
- });
3550
- const Er = i.object({
3551
- authParams: Qt,
3552
- code: i.string(),
3553
- user_id: i.string(),
3554
- created_at: i.string(),
3555
- expires_at: i.string(),
3556
- used_at: i.string().optional()
3557
- });
3558
- i.object({
3559
- ...Er.shape,
3560
- created_at: i.string()
3561
- });
3562
- function pn(n) {
3517
+ function ln(n) {
3563
3518
  const [e, t] = n.split("|");
3564
3519
  if (!e || !t)
3565
3520
  throw new Error(`Invalid user_id: ${n}`);
3566
3521
  return { connection: e, id: t };
3567
3522
  }
3568
- function Pn(n) {
3523
+ function $n(n) {
3569
3524
  let e = {};
3570
3525
  try {
3571
3526
  e = JSON.parse(n.profileData || "{}");
@@ -3575,7 +3530,7 @@ function Pn(n) {
3575
3530
  return {
3576
3531
  connection: n.connection,
3577
3532
  provider: n.provider,
3578
- user_id: pn(n.user_id).id,
3533
+ user_id: ln(n.user_id).id,
3579
3534
  isSocial: !!n.is_social,
3580
3535
  profileData: {
3581
3536
  email: n.email,
@@ -3584,7 +3539,7 @@ function Pn(n) {
3584
3539
  }
3585
3540
  };
3586
3541
  }
3587
- function Ar(n) {
3542
+ function Cr(n) {
3588
3543
  return async (e, t) => {
3589
3544
  const [s, r] = await Promise.all([
3590
3545
  n.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).selectAll().executeTakeFirst(),
@@ -3601,16 +3556,16 @@ function Ar(n) {
3601
3556
  {
3602
3557
  connection: s.connection,
3603
3558
  provider: s.provider,
3604
- user_id: pn(s.user_id).id,
3559
+ user_id: ln(s.user_id).id,
3605
3560
  isSocial: !!s.is_social
3606
3561
  },
3607
- ...r.map(Pn)
3562
+ ...r.map($n)
3608
3563
  ]
3609
3564
  };
3610
3565
  return R(c);
3611
3566
  };
3612
3567
  }
3613
- function Ae(n, e, t, s) {
3568
+ function Ee(n, e, t, s) {
3614
3569
  return t.split(/\s+/).map((a) => a.replace(/^([^:]+)=/g, "$1:")).map((a) => {
3615
3570
  let o = a.startsWith("-"), c, d, u, l;
3616
3571
  return a.startsWith("-_exists_:") ? (c = a.substring(10), u = !0, o = !0) : a.startsWith("_exists_:") ? (c = a.substring(9), u = !0, o = !1) : a.includes(":") ? (o = a.startsWith("-"), [c, d] = o ? a.substring(1).split(":") : a.split(":"), u = !1, d.startsWith(">=") ? (l = ">=", d = d.substring(2)) : d.startsWith(">") ? (l = ">", d = d.substring(1)) : d.startsWith("<=") ? (console.log("value", d), l = "<=", d = d.substring(2)) : d.startsWith("<") ? (l = "<", d = d.substring(1)) : l = "=") : (c = null, d = a, u = !1), { key: c, value: d, isNegation: o, isExistsQuery: u, operator: l };
@@ -3640,26 +3595,26 @@ function Ae(n, e, t, s) {
3640
3595
  else {
3641
3596
  const { ref: l } = n.dynamic;
3642
3597
  e = e.where(
3643
- (T) => T.or(
3644
- s.map((C) => T(l(C), "like", `%${o}%`))
3598
+ (j) => j.or(
3599
+ s.map((A) => j(l(A), "like", `%${o}%`))
3645
3600
  )
3646
3601
  );
3647
3602
  }
3648
3603
  }), e;
3649
3604
  }
3650
- function xe(n) {
3605
+ function be(n) {
3651
3606
  return typeof n == "string" ? parseInt(n, 10) : typeof n == "bigint" ? Number(n) : n;
3652
3607
  }
3653
- function Rr(n) {
3608
+ function Ir(n) {
3654
3609
  return async (e, t) => {
3655
3610
  let s = n.selectFrom("users").where("users.tenant_id", "=", e);
3656
- if (t.q && (s = Ae(n, s, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
3611
+ if (t.q && (s = Ee(n, s, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
3657
3612
  const { ref: l } = n.dynamic;
3658
3613
  s = s.orderBy(l(t.sort.sort_by), t.sort.sort_order);
3659
3614
  }
3660
3615
  const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), o = a.map((l) => l.user_id), c = o.length ? await n.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", o).execute() : [], d = a.map((l) => {
3661
- const T = c.filter(
3662
- (C) => C.linked_to === l.user_id
3616
+ const j = c.filter(
3617
+ (A) => A.linked_to === l.user_id
3663
3618
  );
3664
3619
  return R({
3665
3620
  ...l,
@@ -3669,10 +3624,10 @@ function Rr(n) {
3669
3624
  {
3670
3625
  connection: l.connection,
3671
3626
  provider: l.provider,
3672
- user_id: pn(l.user_id).id,
3627
+ user_id: ln(l.user_id).id,
3673
3628
  isSocial: !!l.is_social
3674
3629
  },
3675
- ...T.map(Pn)
3630
+ ...j.map($n)
3676
3631
  ]
3677
3632
  });
3678
3633
  }), { count: u } = await s.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
@@ -3680,55 +3635,55 @@ function Rr(n) {
3680
3635
  users: d,
3681
3636
  start: t.page * t.per_page,
3682
3637
  limit: t.per_page,
3683
- length: xe(u)
3638
+ length: be(u)
3684
3639
  };
3685
3640
  };
3686
3641
  }
3687
- function $r(n) {
3642
+ function Er(n) {
3688
3643
  return async (e, t) => (await n.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", t).execute(), (await n.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1);
3689
3644
  }
3690
- function Pr(n) {
3645
+ function Ar(n) {
3691
3646
  if (n.email_verified !== void 0)
3692
3647
  return n.email_verified ? 1 : 0;
3693
3648
  }
3694
- function Dr(n) {
3649
+ function Rr(n) {
3695
3650
  return async (e, t, s) => {
3696
3651
  const r = {
3697
3652
  ...s,
3698
- email_verified: Pr(s),
3653
+ email_verified: Ar(s),
3699
3654
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
3700
3655
  };
3701
3656
  return (await n.updateTable("users").set(r).where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1;
3702
3657
  };
3703
3658
  }
3704
- function Mr(n) {
3659
+ function $r(n) {
3705
3660
  return async (e, t, s, r) => {
3706
3661
  const a = { linked_to: null };
3707
3662
  return (await n.updateTable("users").set(a).where("users.tenant_id", "=", e).where("users.user_id", "=", `${s}|${r}`).where("users.linked_to", "=", `${t}`).execute()).length === 1;
3708
3663
  };
3709
3664
  }
3710
- function Lr(n) {
3665
+ function Pr(n) {
3711
3666
  return {
3712
- create: Hn(n),
3713
- remove: $r(n),
3714
- get: Ar(n),
3715
- list: Rr(n),
3716
- update: Dr(n),
3667
+ create: Qn(n),
3668
+ remove: Er(n),
3669
+ get: Cr(n),
3670
+ list: Ir(n),
3671
+ update: Rr(n),
3717
3672
  // TODO - think about this more when other issues fixed
3718
- unlink: Mr(n)
3673
+ unlink: $r(n)
3719
3674
  };
3720
3675
  }
3721
- const Vr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3722
- let Re = (n = 21) => {
3676
+ const Dr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3677
+ let Ae = (n = 21) => {
3723
3678
  let e = "", t = crypto.getRandomValues(new Uint8Array(n));
3724
3679
  for (; n--; )
3725
- e += Vr[t[n] & 63];
3680
+ e += Dr[t[n] & 63];
3726
3681
  return e;
3727
3682
  };
3728
- function Ur(n) {
3683
+ function Mr(n) {
3729
3684
  return async (e) => {
3730
3685
  const t = {
3731
- id: e.id || Re(),
3686
+ id: e.id || Ae(),
3732
3687
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
3733
3688
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
3734
3689
  ...e
@@ -3736,13 +3691,13 @@ function Ur(n) {
3736
3691
  return await n.insertInto("tenants").values(t).execute(), t;
3737
3692
  };
3738
3693
  }
3739
- function Fr(n) {
3694
+ function Lr(n) {
3740
3695
  return async (e) => {
3741
3696
  const t = await n.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
3742
3697
  return t ? R(t) : null;
3743
3698
  };
3744
3699
  }
3745
- function zr(n) {
3700
+ function Vr(n) {
3746
3701
  return async (e) => {
3747
3702
  let t = n.selectFrom("tenants");
3748
3703
  if (e.sort && e.sort.sort_by) {
@@ -3755,7 +3710,7 @@ function zr(n) {
3755
3710
  return {
3756
3711
  tenants: r
3757
3712
  };
3758
- const { count: a } = await t.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = xe(a);
3713
+ const { count: a } = await t.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = be(a);
3759
3714
  return {
3760
3715
  tenants: r.map(R),
3761
3716
  start: (e.page - 1) * e.per_page,
@@ -3764,7 +3719,7 @@ function zr(n) {
3764
3719
  };
3765
3720
  };
3766
3721
  }
3767
- function Br(n) {
3722
+ function Ur(n) {
3768
3723
  return async (e, t) => {
3769
3724
  const s = {
3770
3725
  ...t,
@@ -3774,29 +3729,29 @@ function Br(n) {
3774
3729
  await n.updateTable("tenants").set(s).where("id", "=", e).execute();
3775
3730
  };
3776
3731
  }
3777
- function Wr(n) {
3732
+ function Fr(n) {
3778
3733
  return async (e) => (await n.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
3779
3734
  }
3780
- function qr(n) {
3735
+ function zr(n) {
3781
3736
  return {
3782
- create: Ur(n),
3783
- get: Fr(n),
3784
- list: zr(n),
3785
- update: Br(n),
3786
- remove: Wr(n)
3737
+ create: Mr(n),
3738
+ get: Lr(n),
3739
+ list: Vr(n),
3740
+ update: Ur(n),
3741
+ remove: Fr(n)
3787
3742
  };
3788
3743
  }
3789
- function _n(n) {
3744
+ function mn(n) {
3790
3745
  return n ? JSON.stringify(n) : void 0;
3791
3746
  }
3792
- const Jr = 1024;
3793
- function Kr(n) {
3747
+ const Br = 1024;
3748
+ function Wr(n) {
3794
3749
  return async (e, t) => {
3795
3750
  var r, a, o;
3796
3751
  const s = {
3797
- id: Re(),
3752
+ id: Ae(),
3798
3753
  ...t,
3799
- user_agent: t.user_agent.slice(0, Jr)
3754
+ user_agent: t.user_agent.slice(0, Br)
3800
3755
  };
3801
3756
  return await n.insertInto("logs").values({
3802
3757
  ...s,
@@ -3805,12 +3760,12 @@ function Kr(n) {
3805
3760
  isMobile: t.isMobile ? 1 : 0,
3806
3761
  tenant_id: e,
3807
3762
  scope: (a = t.scope) == null ? void 0 : a.join(","),
3808
- auth0_client: _n(t.auth0_client),
3809
- details: (o = _n(t.details)) == null ? void 0 : o.substring(0, 8192)
3763
+ auth0_client: mn(t.auth0_client),
3764
+ details: (o = mn(t.details)) == null ? void 0 : o.substring(0, 8192)
3810
3765
  }).execute(), s;
3811
3766
  };
3812
3767
  }
3813
- function gn(n) {
3768
+ function _n(n) {
3814
3769
  if (!n)
3815
3770
  return "";
3816
3771
  try {
@@ -3819,23 +3774,23 @@ function gn(n) {
3819
3774
  return n;
3820
3775
  }
3821
3776
  }
3822
- function Dn(n) {
3777
+ function Pn(n) {
3823
3778
  return {
3824
3779
  ...n,
3825
3780
  client_id: n.client_id,
3826
3781
  client_name: "",
3827
- auth0_client: gn(n.auth0_client),
3828
- details: gn(n.details),
3782
+ auth0_client: _n(n.auth0_client),
3783
+ details: _n(n.details),
3829
3784
  isMobile: !!n.isMobile,
3830
3785
  scope: n.scope ? n.scope.split(",") : void 0,
3831
3786
  log_id: n.id,
3832
3787
  _id: n.id
3833
3788
  };
3834
3789
  }
3835
- function Qr(n) {
3790
+ function qr(n) {
3836
3791
  return async (e, t) => {
3837
3792
  let s = n.selectFrom("logs").where("logs.tenant_id", "=", e);
3838
- t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
3793
+ t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
3839
3794
  let r = s;
3840
3795
  if (t.sort && t.sort.sort_by) {
3841
3796
  const { ref: c } = n.dynamic;
@@ -3847,30 +3802,30 @@ function Qr(n) {
3847
3802
  r = r.offset(t.page * t.per_page).limit(t.per_page);
3848
3803
  const a = await r.selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
3849
3804
  return {
3850
- logs: a.map(Dn),
3805
+ logs: a.map(Pn),
3851
3806
  start: t.page * t.per_page,
3852
3807
  limit: t.per_page,
3853
- length: xe(o)
3808
+ length: be(o)
3854
3809
  };
3855
3810
  };
3856
3811
  }
3857
- function Hr(n) {
3812
+ function Jr(n) {
3858
3813
  return async (e, t) => {
3859
3814
  const s = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
3860
- return s ? Dn(s) : null;
3815
+ return s ? Pn(s) : null;
3861
3816
  };
3862
3817
  }
3863
- function Yr(n) {
3818
+ function Kr(n) {
3864
3819
  return {
3865
- create: Kr(n),
3866
- list: Qr(n),
3867
- get: Hr(n)
3820
+ create: Wr(n),
3821
+ list: qr(n),
3822
+ get: Jr(n)
3868
3823
  };
3869
3824
  }
3870
- function Gr(n) {
3825
+ function Qr(n) {
3871
3826
  return async (e, t) => await n.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).selectAll().executeTakeFirst() ?? null;
3872
3827
  }
3873
- function Xr(n) {
3828
+ function Hr(n) {
3874
3829
  return async (e, t) => {
3875
3830
  const s = {
3876
3831
  ...t,
@@ -3880,16 +3835,16 @@ function Xr(n) {
3880
3835
  return await n.insertInto("sessions").values({ ...s, tenant_id: e }).execute(), { ...t, ...s };
3881
3836
  };
3882
3837
  }
3883
- function ea(n) {
3838
+ function Yr(n) {
3884
3839
  return async (e, t) => !!(await n.updateTable("sessions").set({ deleted_at: (/* @__PURE__ */ new Date()).toISOString() }).where("tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).execute()).length;
3885
3840
  }
3886
- function ta(n) {
3841
+ function Gr(n) {
3887
3842
  return async (e, t, s) => !!(await n.updateTable("sessions").set(s).where("tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).execute()).length;
3888
3843
  }
3889
- function na(n) {
3844
+ function Xr(n) {
3890
3845
  return async (e, t) => {
3891
3846
  let s = n.selectFrom("sessions").where("sessions.tenant_id", "=", e);
3892
- t.q && (s = Ae(n, s, t.q, ["user_id", "session_id"]));
3847
+ t.q && (s = Ee(n, s, t.q, ["user_id", "session_id"]));
3893
3848
  let r = s;
3894
3849
  if (t.sort && t.sort.sort_by) {
3895
3850
  const { ref: d } = n.dynamic;
@@ -3899,7 +3854,7 @@ function na(n) {
3899
3854
  );
3900
3855
  }
3901
3856
  r = r.offset(t.page * t.per_page).limit(t.per_page);
3902
- const a = await r.selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = xe(o);
3857
+ const a = await r.selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = be(o);
3903
3858
  return {
3904
3859
  sessions: a,
3905
3860
  start: t.page * t.per_page,
@@ -3908,16 +3863,16 @@ function na(n) {
3908
3863
  };
3909
3864
  };
3910
3865
  }
3911
- function sa(n) {
3866
+ function ea(n) {
3912
3867
  return {
3913
- create: Xr(n),
3914
- get: Gr(n),
3915
- list: na(n),
3916
- remove: ea(n),
3917
- update: ta(n)
3868
+ create: Hr(n),
3869
+ get: Qr(n),
3870
+ list: Xr(n),
3871
+ remove: Yr(n),
3872
+ update: Gr(n)
3918
3873
  };
3919
3874
  }
3920
- function ra(n) {
3875
+ function ta(n) {
3921
3876
  return async (e, t) => {
3922
3877
  const s = await n.selectFrom("tickets").where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).where("tickets.used_at", "is", null).selectAll().executeTakeFirst();
3923
3878
  if (!s)
@@ -3947,7 +3902,7 @@ function ra(n) {
3947
3902
  };
3948
3903
  };
3949
3904
  }
3950
- function aa(n) {
3905
+ function na(n) {
3951
3906
  return async (e) => {
3952
3907
  const { authParams: t, ...s } = e, r = {
3953
3908
  ...s,
@@ -3959,83 +3914,27 @@ function aa(n) {
3959
3914
  await n.insertInto("tickets").values(r).execute();
3960
3915
  };
3961
3916
  }
3962
- function ia(n) {
3917
+ function sa(n) {
3963
3918
  return async (e, t) => {
3964
3919
  await n.updateTable("tickets").set({
3965
3920
  used_at: (/* @__PURE__ */ new Date()).toISOString()
3966
3921
  }).where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).execute();
3967
3922
  };
3968
3923
  }
3969
- function oa(n) {
3970
- return {
3971
- create: aa(n),
3972
- get: ra(n),
3973
- remove: ia(n)
3974
- };
3975
- }
3976
- function ca(n) {
3977
- return async (e, t) => {
3978
- const s = (/* @__PURE__ */ new Date()).toISOString();
3979
- return (await n.selectFrom("otps").where("otps.tenant_id", "=", e).where("otps.email", "=", t).where("otps.expires_at", ">", s).where("otps.used_at", "is", null).selectAll().execute()).map((a) => {
3980
- const {
3981
- nonce: o,
3982
- state: c,
3983
- scope: d,
3984
- response_type: u,
3985
- redirect_uri: l,
3986
- client_id: T,
3987
- ...C
3988
- } = a;
3989
- return {
3990
- ...C,
3991
- // TODO: this will be removed in the next version of the adapter
3992
- client_id: T,
3993
- authParams: {
3994
- client_id: T,
3995
- nonce: o,
3996
- state: c,
3997
- scope: d,
3998
- response_type: u,
3999
- redirect_uri: l
4000
- },
4001
- created_at: a.created_at,
4002
- expires_at: a.expires_at
4003
- };
4004
- });
4005
- };
4006
- }
4007
- function da(n) {
4008
- return async (e, t) => {
4009
- const { authParams: s, ...r } = t;
4010
- await n.insertInto("otps").values({
4011
- ...r,
4012
- ...s,
4013
- created_at: (/* @__PURE__ */ new Date()).toISOString(),
4014
- tenant_id: e,
4015
- // TODO: this will be fixed in next version of the adapter
4016
- send: t.send === "code" ? "code" : "link"
4017
- }).execute();
4018
- };
4019
- }
4020
- function ua(n) {
4021
- return async (e, t) => (await n.updateTable("otps").set({
4022
- used_at: (/* @__PURE__ */ new Date()).toISOString()
4023
- }).where("otps.tenant_id", "=", e).where("otps.id", "=", t).execute()).length > 0;
4024
- }
4025
- function la(n) {
3924
+ function ra(n) {
4026
3925
  return {
4027
- create: da(n),
4028
- list: ca(n),
4029
- remove: ua(n)
3926
+ create: na(n),
3927
+ get: ta(n),
3928
+ remove: sa(n)
4030
3929
  };
4031
3930
  }
4032
- function pa(n) {
3931
+ function aa(n) {
4033
3932
  return async (e, t) => {
4034
3933
  const s = await n.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", t).selectAll().executeTakeFirstOrThrow(), { tenant_id: r, ...a } = s;
4035
3934
  return a;
4036
3935
  };
4037
3936
  }
4038
- function ha(n) {
3937
+ function ia(n) {
4039
3938
  return async (e, t) => {
4040
3939
  const s = {
4041
3940
  ...t,
@@ -4048,23 +3947,23 @@ function ha(n) {
4048
3947
  }).execute(), s;
4049
3948
  };
4050
3949
  }
4051
- function fa(n) {
3950
+ function oa(n) {
4052
3951
  return async (e, t) => (await n.updateTable("passwords").set({
4053
3952
  password: t.password,
4054
3953
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
4055
3954
  }).where("tenant_id", "=", e).where("user_id", "=", t.user_id).execute()).length === 1;
4056
3955
  }
4057
- function ma(n) {
3956
+ function ca(n) {
4058
3957
  return {
4059
- create: ha(n),
4060
- update: fa(n),
4061
- get: pa(n)
3958
+ create: ia(n),
3959
+ update: oa(n),
3960
+ get: aa(n)
4062
3961
  };
4063
3962
  }
4064
- function _a(n) {
3963
+ function da(n) {
4065
3964
  return async (e, t) => {
4066
3965
  let s = n.selectFrom("codes").where("codes.tenant_id", "=", e);
4067
- t.q && (s = Ae(n, s, t.q, ["code", "login_id"]));
3966
+ t.q && (s = Ee(n, s, t.q, ["code", "login_id"]));
4068
3967
  const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
4069
3968
  return {
4070
3969
  codes: a.map((d) => {
@@ -4073,11 +3972,11 @@ function _a(n) {
4073
3972
  }),
4074
3973
  start: t.page * t.per_page,
4075
3974
  limit: t.per_page,
4076
- length: xe(o)
3975
+ length: be(o)
4077
3976
  };
4078
3977
  };
4079
3978
  }
4080
- function ga(n) {
3979
+ function ua(n) {
4081
3980
  return async (e, t) => {
4082
3981
  const s = {
4083
3982
  ...t,
@@ -4089,10 +3988,10 @@ function ga(n) {
4089
3988
  }).execute(), s;
4090
3989
  };
4091
3990
  }
4092
- function ya(n) {
3991
+ function la(n) {
4093
3992
  return async (e, t) => (await n.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4094
3993
  }
4095
- function va(n) {
3994
+ function pa(n) {
4096
3995
  return async (e, t, s) => {
4097
3996
  let r = n.selectFrom("codes").where("codes.code_id", "=", t).where("codes.code_type", "=", s).where("codes.expires_at", ">", (/* @__PURE__ */ new Date()).toISOString());
4098
3997
  e.length && (r = r.where("codes.tenant_id", "=", e));
@@ -4100,75 +3999,15 @@ function va(n) {
4100
3999
  return a ? R(a) : null;
4101
4000
  };
4102
4001
  }
4103
- function wa(n) {
4104
- return {
4105
- create: ga(n),
4106
- list: _a(n),
4107
- remove: ya(n),
4108
- get: va(n)
4109
- };
4110
- }
4111
- function ka(n) {
4112
- return async (e) => {
4113
- const t = (/* @__PURE__ */ new Date()).toISOString(), s = await n.selectFrom("universal_login_sessions").where("universal_login_sessions.expires_at", ">", t).where("universal_login_sessions.id", "=", e).selectAll().executeTakeFirst();
4114
- if (!s) return null;
4115
- const {
4116
- response_type: r,
4117
- response_mode: a,
4118
- redirect_uri: o,
4119
- audience: c,
4120
- state: d,
4121
- nonce: u,
4122
- scope: l,
4123
- code_challenge_method: T,
4124
- code_challenge: C,
4125
- username: L,
4126
- vendor_id: K,
4127
- ...re
4128
- } = s;
4129
- return {
4130
- ...re,
4131
- authParams: {
4132
- client_id: re.client_id,
4133
- vendor_id: K,
4134
- response_type: r,
4135
- response_mode: a,
4136
- redirect_uri: o,
4137
- audience: c,
4138
- state: d,
4139
- nonce: u,
4140
- scope: l,
4141
- // @ts-ignore
4142
- code_challenge_method: T,
4143
- code_challenge: C,
4144
- username: L
4145
- }
4146
- };
4147
- };
4148
- }
4149
- function ba(n) {
4150
- return async (e, t) => {
4151
- const { authParams: s, ...r } = t, a = {
4152
- created_at: (/* @__PURE__ */ new Date()).toISOString(),
4153
- updated_at: (/* @__PURE__ */ new Date()).toISOString()
4154
- };
4155
- return await n.insertInto("universal_login_sessions").values({ ...s, ...r, ...a, tenant_id: e }).execute(), { ...t, ...a };
4156
- };
4157
- }
4158
- function xa(n) {
4159
- return async (e, t, s) => {
4160
- const { authParams: r, ...a } = s;
4161
- return (await n.updateTable("universal_login_sessions").set({ ...r, ...a }).where("id", "=", t).where("tenant_id", "=", e).execute()).length === 1;
4162
- };
4163
- }
4164
- function Ta(n) {
4002
+ function ha(n) {
4165
4003
  return {
4166
- create: ba(n),
4167
- get: ka(n),
4168
- update: xa(n)
4004
+ create: ua(n),
4005
+ list: da(n),
4006
+ remove: la(n),
4007
+ get: pa(n)
4169
4008
  };
4170
4009
  }
4171
- function Oa(n) {
4010
+ function fa(n) {
4172
4011
  return async (e, t) => {
4173
4012
  const s = {
4174
4013
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
@@ -4187,7 +4026,7 @@ function Oa(n) {
4187
4026
  }).execute(), s;
4188
4027
  };
4189
4028
  }
4190
- function Sa(n) {
4029
+ function ma(n) {
4191
4030
  return async (e) => ({
4192
4031
  applications: (await n.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((a) => ({
4193
4032
  ...a,
@@ -4200,7 +4039,7 @@ function Sa(n) {
4200
4039
  }))
4201
4040
  });
4202
4041
  }
4203
- function Za(n) {
4042
+ function _a(n) {
4204
4043
  return async (e, t) => {
4205
4044
  const s = await n.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).selectAll().executeTakeFirst();
4206
4045
  return s ? R({
@@ -4214,10 +4053,10 @@ function Za(n) {
4214
4053
  }) : null;
4215
4054
  };
4216
4055
  }
4217
- function ja(n) {
4056
+ function ga(n) {
4218
4057
  return async (e, t) => (await n.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4219
4058
  }
4220
- function Na(n) {
4059
+ function ya(n) {
4221
4060
  return async (e, t, s) => {
4222
4061
  const r = {
4223
4062
  ...s,
@@ -4232,19 +4071,19 @@ function Na(n) {
4232
4071
  return await n.updateTable("applications").set(r).where("applications.id", "=", t).where("applications.tenant_id", "=", e).execute(), !0;
4233
4072
  };
4234
4073
  }
4235
- function Ia(n) {
4074
+ function va(n) {
4236
4075
  return {
4237
- create: Oa(n),
4238
- list: Sa(n),
4239
- get: Za(n),
4240
- remove: ja(n),
4241
- update: Na(n)
4076
+ create: fa(n),
4077
+ list: ma(n),
4078
+ get: _a(n),
4079
+ remove: ga(n),
4080
+ update: ya(n)
4242
4081
  };
4243
4082
  }
4244
- function Ca(n) {
4083
+ function wa(n) {
4245
4084
  return async (e, t) => {
4246
4085
  const s = {
4247
- id: Re(),
4086
+ id: Ae(),
4248
4087
  ...t,
4249
4088
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
4250
4089
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
@@ -4252,29 +4091,29 @@ function Ca(n) {
4252
4091
  return await n.insertInto("connections").values({ ...s, tenant_id: e }).execute(), s;
4253
4092
  };
4254
4093
  }
4255
- function Ea(n) {
4094
+ function ka(n) {
4256
4095
  return async (e, t) => {
4257
4096
  let s = n.selectFrom("connections").where("connections.tenant_id", "=", e);
4258
- t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
4097
+ t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
4259
4098
  const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
4260
4099
  return {
4261
4100
  connections: a.map(R),
4262
4101
  start: t.page * t.per_page,
4263
4102
  limit: t.per_page,
4264
- length: xe(o)
4103
+ length: be(o)
4265
4104
  };
4266
4105
  };
4267
4106
  }
4268
- function Aa(n) {
4107
+ function ba(n) {
4269
4108
  return async (e, t) => (await n.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4270
4109
  }
4271
- function Ra(n) {
4110
+ function xa(n) {
4272
4111
  return async (e, t) => {
4273
4112
  const s = await n.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).selectAll().executeTakeFirst();
4274
4113
  return s ? R(s) : null;
4275
4114
  };
4276
4115
  }
4277
- function $a(n) {
4116
+ function Ta(n) {
4278
4117
  return async (e, t, s) => {
4279
4118
  const r = {
4280
4119
  ...s,
@@ -4283,16 +4122,16 @@ function $a(n) {
4283
4122
  return await n.updateTable("connections").set(r).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
4284
4123
  };
4285
4124
  }
4286
- function Pa(n) {
4125
+ function Oa(n) {
4287
4126
  return {
4288
- create: Ca(n),
4289
- get: Ra(n),
4290
- list: Ea(n),
4291
- remove: Aa(n),
4292
- update: $a(n)
4127
+ create: wa(n),
4128
+ get: xa(n),
4129
+ list: ka(n),
4130
+ remove: ba(n),
4131
+ update: Ta(n)
4293
4132
  };
4294
4133
  }
4295
- function Da(n) {
4134
+ function Sa(n) {
4296
4135
  return {
4297
4136
  get: async (e) => {
4298
4137
  const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
@@ -4300,12 +4139,12 @@ function Da(n) {
4300
4139
  return null;
4301
4140
  const s = await n.selectFrom("tenants").selectAll().where("id", "=", t.tenant_id).executeTakeFirst();
4302
4141
  if (!s)
4303
- throw new Et(404, { message: "Tenant not found" });
4142
+ throw new Gt(404, { message: "Tenant not found" });
4304
4143
  const r = await n.selectFrom("connections").where("tenant_id", "=", t.tenant_id).selectAll().execute(), a = await n.selectFrom("domains").where("tenant_id", "=", t.tenant_id).selectAll().execute();
4305
4144
  return {
4306
4145
  ...t,
4307
4146
  connections: r.map(
4308
- (c) => Rn.parse(R(c))
4147
+ (c) => An.parse(R(c))
4309
4148
  ),
4310
4149
  domains: a,
4311
4150
  addons: t.addons ? JSON.parse(t.addons) : {},
@@ -4320,56 +4159,56 @@ function Da(n) {
4320
4159
  }
4321
4160
  };
4322
4161
  }
4323
- function Ma(n) {
4162
+ function Za(n) {
4324
4163
  return async () => await n.selectFrom("keys").where("revoked_at", "is", null).selectAll().execute();
4325
4164
  }
4326
- function La(n) {
4165
+ function ja(n) {
4327
4166
  return async (e) => {
4328
- await n.insertInto("keys").values(e).execute();
4167
+ await n.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
4329
4168
  };
4330
4169
  }
4331
- function Va(n) {
4332
- return async (e, t) => !!(await n.updateTable("keys").set({ revoked_at: t.toISOString() }).where("kid", "=", e).execute()).length;
4170
+ function Na(n) {
4171
+ return async (e, t) => !!(await n.updateTable("keys").set(t).where("kid", "=", e).execute()).length;
4333
4172
  }
4334
- function Ua(n) {
4173
+ function Ca(n) {
4335
4174
  return {
4336
- create: La(n),
4337
- list: Ma(n),
4338
- revoke: Va(n)
4175
+ create: ja(n),
4176
+ list: Za(n),
4177
+ update: Na(n)
4339
4178
  };
4340
4179
  }
4341
- function Fa(n) {
4180
+ function Ia(n) {
4342
4181
  return async (e, t) => {
4343
4182
  const s = {
4344
4183
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
4345
4184
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
4346
4185
  tenant_id: e,
4347
- id: Re(),
4186
+ id: Ae(),
4348
4187
  ...t
4349
4188
  };
4350
4189
  return await n.insertInto("domains").values(s).execute(), s;
4351
4190
  };
4352
4191
  }
4353
- function za(n) {
4192
+ function Ea(n) {
4354
4193
  return async (e, t) => {
4355
4194
  let s = n.selectFrom("domains").where("domains.tenant_id", "=", e);
4356
- t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
4195
+ t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
4357
4196
  const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
4358
4197
  return {
4359
4198
  domains: a,
4360
4199
  start: t.page * t.per_page,
4361
4200
  limit: t.per_page,
4362
- length: xe(o)
4201
+ length: be(o)
4363
4202
  };
4364
4203
  };
4365
4204
  }
4366
- function Ba(n) {
4205
+ function Aa(n) {
4367
4206
  return {
4368
- create: Fa(n),
4369
- list: za(n)
4207
+ create: Ia(n),
4208
+ list: Ea(n)
4370
4209
  };
4371
4210
  }
4372
- function Wa(n) {
4211
+ function Ra(n) {
4373
4212
  return async (e) => {
4374
4213
  const [t] = await n.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
4375
4214
  if (!t)
@@ -4399,9 +4238,9 @@ function Wa(n) {
4399
4238
  });
4400
4239
  };
4401
4240
  }
4402
- function qa(n) {
4241
+ function $a(n) {
4403
4242
  return async (e, t) => {
4404
- var o, c, d, u, l, T, C, L, K, re, ce, de, ue, $e, Pe, Q, H, Y;
4243
+ var o, c, d, u, l, j, A, U, ie, Re, oe, ce, de, $e, Pe, K, Q, H;
4405
4244
  const { colors: s, font: r, ...a } = t;
4406
4245
  try {
4407
4246
  await n.insertInto("branding").values({
@@ -4409,108 +4248,63 @@ function qa(n) {
4409
4248
  colors_primary: s == null ? void 0 : s.primary,
4410
4249
  colors_page_background_type: (c = (o = t.colors) == null ? void 0 : o.page_background) == null ? void 0 : c.type,
4411
4250
  colors_page_background_start: (u = (d = t.colors) == null ? void 0 : d.page_background) == null ? void 0 : u.start,
4412
- colors_page_background_end: (T = (l = t.colors) == null ? void 0 : l.page_background) == null ? void 0 : T.end,
4413
- colors_page_background_angle_dev: (L = (C = t.colors) == null ? void 0 : C.page_background) == null ? void 0 : L.angle_deg,
4414
- font_url: (K = t.font) == null ? void 0 : K.url,
4251
+ colors_page_background_end: (j = (l = t.colors) == null ? void 0 : l.page_background) == null ? void 0 : j.end,
4252
+ colors_page_background_angle_dev: (U = (A = t.colors) == null ? void 0 : A.page_background) == null ? void 0 : U.angle_deg,
4253
+ font_url: (ie = t.font) == null ? void 0 : ie.url,
4415
4254
  tenant_id: e
4416
4255
  }).execute();
4417
4256
  } catch {
4418
4257
  await n.updateTable("branding").set({
4419
4258
  ...a,
4420
4259
  colors_primary: s == null ? void 0 : s.primary,
4421
- colors_page_background_type: (ce = (re = t.colors) == null ? void 0 : re.page_background) == null ? void 0 : ce.type,
4422
- colors_page_background_start: (ue = (de = t.colors) == null ? void 0 : de.page_background) == null ? void 0 : ue.start,
4260
+ colors_page_background_type: (oe = (Re = t.colors) == null ? void 0 : Re.page_background) == null ? void 0 : oe.type,
4261
+ colors_page_background_start: (de = (ce = t.colors) == null ? void 0 : ce.page_background) == null ? void 0 : de.start,
4423
4262
  colors_page_background_end: (Pe = ($e = t.colors) == null ? void 0 : $e.page_background) == null ? void 0 : Pe.end,
4424
- colors_page_background_angle_dev: (H = (Q = t.colors) == null ? void 0 : Q.page_background) == null ? void 0 : H.angle_deg,
4425
- font_url: (Y = t.font) == null ? void 0 : Y.url
4263
+ colors_page_background_angle_dev: (Q = (K = t.colors) == null ? void 0 : K.page_background) == null ? void 0 : Q.angle_deg,
4264
+ font_url: (H = t.font) == null ? void 0 : H.url
4426
4265
  }).where("tenant_id", "=", e).execute();
4427
4266
  }
4428
4267
  };
4429
4268
  }
4430
- function Ja(n) {
4431
- return {
4432
- get: Wa(n),
4433
- set: qa(n)
4434
- };
4435
- }
4436
- function Ka(n) {
4437
- return async (e, t) => {
4438
- const s = await n.selectFrom("authentication_codes").where("tenant_id", "=", e).where("code", "=", t).selectAll().executeTakeFirst();
4439
- if (!s)
4440
- throw new Et(403, { message: "Code not found or expired" });
4441
- const {
4442
- state: r,
4443
- nonce: a,
4444
- scope: o,
4445
- client_id: c,
4446
- response_type: d,
4447
- response_mode: u,
4448
- redirect_uri: l,
4449
- ...T
4450
- } = s;
4451
- return {
4452
- ...T,
4453
- authParams: {
4454
- state: r,
4455
- nonce: a,
4456
- scope: o,
4457
- client_id: c,
4458
- response_type: d,
4459
- response_mode: u,
4460
- redirect_uri: l
4461
- }
4462
- };
4463
- };
4464
- }
4465
- function Qa(n) {
4466
- return async (e, t) => {
4467
- const { authParams: s, ...r } = t;
4468
- await n.insertInto("authentication_codes").values({
4469
- ...r,
4470
- ...s,
4471
- tenant_id: e
4472
- }).execute();
4473
- };
4474
- }
4475
- function Ha(n) {
4269
+ function Pa(n) {
4476
4270
  return {
4477
- create: Qa(n),
4478
- get: Ka(n)
4271
+ get: Ra(n),
4272
+ set: $a(n)
4479
4273
  };
4480
4274
  }
4481
- function Ya(n) {
4275
+ function Da(n) {
4482
4276
  return async (e, t) => {
4483
4277
  let s = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
4484
- t.q && (s = Ae(n, s, t.q, ["url"]));
4278
+ t.q && (s = Ee(n, s, t.q, ["url"]));
4485
4279
  const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
4486
4280
  return {
4487
4281
  hooks: a.map((d) => {
4488
- const { tenant_id: u, enabled: l, synchronous: T, ...C } = d;
4282
+ const { tenant_id: u, enabled: l, synchronous: j, ...A } = d;
4489
4283
  return R({
4490
- ...C,
4284
+ ...A,
4491
4285
  enabled: !!l,
4492
- synchronous: !!T
4286
+ synchronous: !!j
4493
4287
  });
4494
4288
  }),
4495
4289
  start: t.page * t.per_page,
4496
4290
  limit: t.per_page,
4497
- length: xe(o)
4291
+ length: be(o)
4498
4292
  };
4499
4293
  };
4500
4294
  }
4501
- function Ga(n) {
4295
+ function Ma(n) {
4502
4296
  return async (e, t) => {
4503
4297
  const s = await n.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).selectAll().executeTakeFirst();
4504
4298
  return s ? (s.enabled = !!s.enabled, s.synchronous = !!s.synchronous, R(s)) : null;
4505
4299
  };
4506
4300
  }
4507
- function Xa(n) {
4301
+ function La(n) {
4508
4302
  return async (e, t) => (await n.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4509
4303
  }
4510
- function ei(n) {
4304
+ function Va(n) {
4511
4305
  return async (e, t) => {
4512
4306
  const s = {
4513
- hook_id: Re(),
4307
+ hook_id: Ae(),
4514
4308
  ...t,
4515
4309
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
4516
4310
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
@@ -4521,7 +4315,7 @@ function ei(n) {
4521
4315
  }).execute(), s;
4522
4316
  };
4523
4317
  }
4524
- function ti(n) {
4318
+ function Ua(n) {
4525
4319
  return async (e, t, s) => {
4526
4320
  const r = {
4527
4321
  ...s,
@@ -4530,16 +4324,16 @@ function ti(n) {
4530
4324
  return await n.updateTable("hooks").set(r).where("hooks.hook_id", "=", t).where("hooks.tenant_id", "=", e).execute(), !0;
4531
4325
  };
4532
4326
  }
4533
- function ni(n) {
4327
+ function Fa(n) {
4534
4328
  return {
4535
- create: ei(n),
4536
- get: Ga(n),
4537
- list: Ya(n),
4538
- update: ti(n),
4539
- remove: Xa(n)
4329
+ create: Va(n),
4330
+ get: Ma(n),
4331
+ list: Da(n),
4332
+ update: Ua(n),
4333
+ remove: La(n)
4540
4334
  };
4541
4335
  }
4542
- function si(n, e) {
4336
+ function za(n, e) {
4543
4337
  var t = {};
4544
4338
  for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
4545
4339
  if (n != null && typeof Object.getOwnPropertySymbols == "function")
@@ -4547,7 +4341,7 @@ function si(n, e) {
4547
4341
  e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
4548
4342
  return t;
4549
4343
  }
4550
- function ri(n, e) {
4344
+ function Ba(n, e) {
4551
4345
  var t;
4552
4346
  return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
4553
4347
  }
@@ -4558,28 +4352,28 @@ function He(n, e) {
4558
4352
  return r._def.openapi = this._def.openapi, r;
4559
4353
  };
4560
4354
  }
4561
- function ai(n) {
4355
+ function Wa(n) {
4562
4356
  if (typeof n.ZodType.prototype.openapi < "u")
4563
4357
  return;
4564
4358
  n.ZodType.prototype.openapi = function(r, a) {
4565
- var o, c, d, u, l, T;
4566
- const C = typeof r == "string" ? a : r, L = C ?? {}, { param: K } = L, re = si(L, ["param"]), ce = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), de = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || K ? {
4567
- param: Object.assign(Object.assign({}, (T = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || T === void 0 ? void 0 : T.param), K)
4568
- } : void 0), ue = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ce).length > 0 ? { _internal: ce } : void 0), Object.keys(de).length > 0 ? { metadata: de } : void 0) }));
4569
- if (ri(this, "ZodObject")) {
4359
+ var o, c, d, u, l, j;
4360
+ const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, Re = za(U, ["param"]), oe = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ce = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), Re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || ie ? {
4361
+ param: Object.assign(Object.assign({}, (j = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || j === void 0 ? void 0 : j.param), ie)
4362
+ } : void 0), de = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(oe).length > 0 ? { _internal: oe } : void 0), Object.keys(ce).length > 0 ? { metadata: ce } : void 0) }));
4363
+ if (Ba(this, "ZodObject")) {
4570
4364
  const $e = this.extend;
4571
- ue.extend = function(...Pe) {
4572
- var Q, H, Y, le, Te, Oe;
4573
- const Se = $e.apply(this, Pe);
4574
- return Se._def.openapi = {
4365
+ de.extend = function(...Pe) {
4366
+ var K, Q, H, ue, xe, Te;
4367
+ const Oe = $e.apply(this, Pe);
4368
+ return Oe._def.openapi = {
4575
4369
  _internal: {
4576
- extendedFrom: !((H = (Q = this._def.openapi) === null || Q === void 0 ? void 0 : Q._internal) === null || H === void 0) && H.refId ? { refId: (le = (Y = this._def.openapi) === null || Y === void 0 ? void 0 : Y._internal) === null || le === void 0 ? void 0 : le.refId, schema: this } : (Te = this._def.openapi) === null || Te === void 0 ? void 0 : Te._internal.extendedFrom
4370
+ extendedFrom: !((Q = (K = this._def.openapi) === null || K === void 0 ? void 0 : K._internal) === null || Q === void 0) && Q.refId ? { refId: (ue = (H = this._def.openapi) === null || H === void 0 ? void 0 : H._internal) === null || ue === void 0 ? void 0 : ue.refId, schema: this } : (xe = this._def.openapi) === null || xe === void 0 ? void 0 : xe._internal.extendedFrom
4577
4371
  },
4578
- metadata: (Oe = Se._def.openapi) === null || Oe === void 0 ? void 0 : Oe.metadata
4579
- }, Se;
4372
+ metadata: (Te = Oe._def.openapi) === null || Te === void 0 ? void 0 : Te.metadata
4373
+ }, Oe;
4580
4374
  };
4581
4375
  }
4582
- return ue;
4376
+ return de;
4583
4377
  }, He(n, "optional"), He(n, "nullable"), He(n, "default"), He(n, "transform"), He(n, "refine");
4584
4378
  const e = n.ZodObject.prototype.deepPartial;
4585
4379
  n.ZodObject.prototype.deepPartial = function() {
@@ -4601,7 +4395,7 @@ function ai(n) {
4601
4395
  };
4602
4396
  }
4603
4397
  new Set(".\\+*[^]$()");
4604
- var I;
4398
+ var C;
4605
4399
  (function(n) {
4606
4400
  n.assertEqual = (r) => r;
4607
4401
  function e(r) {
@@ -4636,16 +4430,16 @@ var I;
4636
4430
  return r.map((o) => typeof o == "string" ? `'${o}'` : o).join(a);
4637
4431
  }
4638
4432
  n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
4639
- })(I || (I = {}));
4640
- var rn;
4433
+ })(C || (C = {}));
4434
+ var sn;
4641
4435
  (function(n) {
4642
4436
  n.mergeShapes = (e, t) => ({
4643
4437
  ...e,
4644
4438
  ...t
4645
4439
  // second overwrites first
4646
4440
  });
4647
- })(rn || (rn = {}));
4648
- const g = I.arrayToEnum([
4441
+ })(sn || (sn = {}));
4442
+ const g = C.arrayToEnum([
4649
4443
  "string",
4650
4444
  "nan",
4651
4445
  "number",
@@ -4666,7 +4460,7 @@ const g = I.arrayToEnum([
4666
4460
  "never",
4667
4461
  "map",
4668
4462
  "set"
4669
- ]), fe = (n) => {
4463
+ ]), he = (n) => {
4670
4464
  switch (typeof n) {
4671
4465
  case "undefined":
4672
4466
  return g.undefined;
@@ -4687,7 +4481,7 @@ const g = I.arrayToEnum([
4687
4481
  default:
4688
4482
  return g.unknown;
4689
4483
  }
4690
- }, h = I.arrayToEnum([
4484
+ }, h = C.arrayToEnum([
4691
4485
  "invalid_type",
4692
4486
  "invalid_literal",
4693
4487
  "custom",
@@ -4704,8 +4498,8 @@ const g = I.arrayToEnum([
4704
4498
  "invalid_intersection_types",
4705
4499
  "not_multiple_of",
4706
4500
  "not_finite"
4707
- ]), ii = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
4708
- class U extends Error {
4501
+ ]), qa = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
4502
+ class V extends Error {
4709
4503
  constructor(e) {
4710
4504
  super(), this.issues = [], this.addIssue = (s) => {
4711
4505
  this.issues = [...this.issues, s];
@@ -4742,14 +4536,14 @@ class U extends Error {
4742
4536
  return r(this), s;
4743
4537
  }
4744
4538
  static assert(e) {
4745
- if (!(e instanceof U))
4539
+ if (!(e instanceof V))
4746
4540
  throw new Error(`Not a ZodError: ${e}`);
4747
4541
  }
4748
4542
  toString() {
4749
4543
  return this.message;
4750
4544
  }
4751
4545
  get message() {
4752
- return JSON.stringify(this.issues, I.jsonStringifyReplacer, 2);
4546
+ return JSON.stringify(this.issues, C.jsonStringifyReplacer, 2);
4753
4547
  }
4754
4548
  get isEmpty() {
4755
4549
  return this.issues.length === 0;
@@ -4764,7 +4558,7 @@ class U extends Error {
4764
4558
  return this.flatten();
4765
4559
  }
4766
4560
  }
4767
- U.create = (n) => new U(n);
4561
+ V.create = (n) => new V(n);
4768
4562
  const qe = (n, e) => {
4769
4563
  let t;
4770
4564
  switch (n.code) {
@@ -4772,19 +4566,19 @@ const qe = (n, e) => {
4772
4566
  n.received === g.undefined ? t = "Required" : t = `Expected ${n.expected}, received ${n.received}`;
4773
4567
  break;
4774
4568
  case h.invalid_literal:
4775
- t = `Invalid literal value, expected ${JSON.stringify(n.expected, I.jsonStringifyReplacer)}`;
4569
+ t = `Invalid literal value, expected ${JSON.stringify(n.expected, C.jsonStringifyReplacer)}`;
4776
4570
  break;
4777
4571
  case h.unrecognized_keys:
4778
- t = `Unrecognized key(s) in object: ${I.joinValues(n.keys, ", ")}`;
4572
+ t = `Unrecognized key(s) in object: ${C.joinValues(n.keys, ", ")}`;
4779
4573
  break;
4780
4574
  case h.invalid_union:
4781
4575
  t = "Invalid input";
4782
4576
  break;
4783
4577
  case h.invalid_union_discriminator:
4784
- t = `Invalid discriminator value. Expected ${I.joinValues(n.options)}`;
4578
+ t = `Invalid discriminator value. Expected ${C.joinValues(n.options)}`;
4785
4579
  break;
4786
4580
  case h.invalid_enum_value:
4787
- t = `Invalid enum value. Expected ${I.joinValues(n.options)}, received '${n.received}'`;
4581
+ t = `Invalid enum value. Expected ${C.joinValues(n.options)}, received '${n.received}'`;
4788
4582
  break;
4789
4583
  case h.invalid_arguments:
4790
4584
  t = "Invalid function arguments";
@@ -4796,7 +4590,7 @@ const qe = (n, e) => {
4796
4590
  t = "Invalid date";
4797
4591
  break;
4798
4592
  case h.invalid_string:
4799
- 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}"` : I.assertNever(n.validation) : n.validation !== "regex" ? t = `Invalid ${n.validation}` : t = "Invalid";
4593
+ 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}"` : C.assertNever(n.validation) : n.validation !== "regex" ? t = `Invalid ${n.validation}` : t = "Invalid";
4800
4594
  break;
4801
4595
  case h.too_small:
4802
4596
  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 === "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";
@@ -4817,18 +4611,18 @@ const qe = (n, e) => {
4817
4611
  t = "Number must be finite";
4818
4612
  break;
4819
4613
  default:
4820
- t = e.defaultError, I.assertNever(n);
4614
+ t = e.defaultError, C.assertNever(n);
4821
4615
  }
4822
4616
  return { message: t };
4823
4617
  };
4824
- let Mn = qe;
4825
- function oi(n) {
4826
- Mn = n;
4618
+ let Dn = qe;
4619
+ function Ja(n) {
4620
+ Dn = n;
4827
4621
  }
4828
- function Ut() {
4829
- return Mn;
4622
+ function Vt() {
4623
+ return Dn;
4830
4624
  }
4831
- const Ft = (n) => {
4625
+ const Ut = (n) => {
4832
4626
  const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
4833
4627
  ...r,
4834
4628
  path: a
@@ -4848,9 +4642,9 @@ const Ft = (n) => {
4848
4642
  path: a,
4849
4643
  message: c
4850
4644
  };
4851
- }, ci = [];
4645
+ }, Ka = [];
4852
4646
  function m(n, e) {
4853
- const t = Ut(), s = Ft({
4647
+ const t = Vt(), s = Ut({
4854
4648
  issueData: e,
4855
4649
  data: n.data,
4856
4650
  path: n.path,
@@ -4907,12 +4701,12 @@ class P {
4907
4701
  }
4908
4702
  const b = Object.freeze({
4909
4703
  status: "aborted"
4910
- }), Ve = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }), an = (n) => n.status === "aborted", on = (n) => n.status === "dirty", mt = (n) => n.status === "valid", _t = (n) => typeof Promise < "u" && n instanceof Promise;
4911
- function zt(n, e, t, s) {
4704
+ }), Ve = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }), rn = (n) => n.status === "aborted", an = (n) => n.status === "dirty", mt = (n) => n.status === "valid", _t = (n) => typeof Promise < "u" && n instanceof Promise;
4705
+ function Ft(n, e, t, s) {
4912
4706
  if (typeof e == "function" ? n !== e || !s : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4913
4707
  return e.get(n);
4914
4708
  }
4915
- function Ln(n, e, t, s, r) {
4709
+ function Mn(n, e, t, s, r) {
4916
4710
  if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
4917
4711
  return e.set(n, t), t;
4918
4712
  }
@@ -4921,7 +4715,7 @@ var v;
4921
4715
  n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
4922
4716
  })(v || (v = {}));
4923
4717
  var Xe, et;
4924
- class ne {
4718
+ class te {
4925
4719
  constructor(e, t, s, r) {
4926
4720
  this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
4927
4721
  }
@@ -4929,7 +4723,7 @@ class ne {
4929
4723
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
4930
4724
  }
4931
4725
  }
4932
- const yn = (n, e) => {
4726
+ const gn = (n, e) => {
4933
4727
  if (mt(e))
4934
4728
  return { success: !0, data: e.value };
4935
4729
  if (!n.common.issues.length)
@@ -4939,12 +4733,12 @@ const yn = (n, e) => {
4939
4733
  get error() {
4940
4734
  if (this._error)
4941
4735
  return this._error;
4942
- const t = new U(n.common.issues);
4736
+ const t = new V(n.common.issues);
4943
4737
  return this._error = t, this._error;
4944
4738
  }
4945
4739
  };
4946
4740
  };
4947
- function S(n) {
4741
+ function O(n) {
4948
4742
  if (!n)
4949
4743
  return {};
4950
4744
  const { errorMap: e, invalid_type_error: t, required_error: s, description: r } = n;
@@ -4956,7 +4750,7 @@ function S(n) {
4956
4750
  return o.code === "invalid_enum_value" ? { message: l ?? c.defaultError } : typeof c.data > "u" ? { message: (d = l ?? s) !== null && d !== void 0 ? d : c.defaultError } : o.code !== "invalid_type" ? { message: c.defaultError } : { message: (u = l ?? t) !== null && u !== void 0 ? u : c.defaultError };
4957
4751
  }, description: r };
4958
4752
  }
4959
- class j {
4753
+ class Z {
4960
4754
  constructor(e) {
4961
4755
  this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
4962
4756
  }
@@ -4964,13 +4758,13 @@ class j {
4964
4758
  return this._def.description;
4965
4759
  }
4966
4760
  _getType(e) {
4967
- return fe(e.data);
4761
+ return he(e.data);
4968
4762
  }
4969
4763
  _getOrReturnCtx(e, t) {
4970
4764
  return t || {
4971
4765
  common: e.parent.common,
4972
4766
  data: e.data,
4973
- parsedType: fe(e.data),
4767
+ parsedType: he(e.data),
4974
4768
  schemaErrorMap: this._def.errorMap,
4975
4769
  path: e.path,
4976
4770
  parent: e.parent
@@ -4982,7 +4776,7 @@ class j {
4982
4776
  ctx: {
4983
4777
  common: e.parent.common,
4984
4778
  data: e.data,
4985
- parsedType: fe(e.data),
4779
+ parsedType: he(e.data),
4986
4780
  schemaErrorMap: this._def.errorMap,
4987
4781
  path: e.path,
4988
4782
  parent: e.parent
@@ -5017,9 +4811,9 @@ class j {
5017
4811
  schemaErrorMap: this._def.errorMap,
5018
4812
  parent: null,
5019
4813
  data: e,
5020
- parsedType: fe(e)
4814
+ parsedType: he(e)
5021
4815
  }, a = this._parseSync({ data: e, path: r.path, parent: r });
5022
- return yn(r, a);
4816
+ return gn(r, a);
5023
4817
  }
5024
4818
  async parseAsync(e, t) {
5025
4819
  const s = await this.safeParseAsync(e, t);
@@ -5038,9 +4832,9 @@ class j {
5038
4832
  schemaErrorMap: this._def.errorMap,
5039
4833
  parent: null,
5040
4834
  data: e,
5041
- parsedType: fe(e)
4835
+ parsedType: he(e)
5042
4836
  }, r = this._parse({ data: e, path: s.path, parent: s }), a = await (_t(r) ? r : Promise.resolve(r));
5043
- return yn(s, a);
4837
+ return gn(s, a);
5044
4838
  }
5045
4839
  refine(e, t) {
5046
4840
  const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
@@ -5066,10 +4860,10 @@ class j {
5066
4860
  return this._refinement(e);
5067
4861
  }
5068
4862
  optional() {
5069
- return X.create(this, this._def);
4863
+ return G.create(this, this._def);
5070
4864
  }
5071
4865
  nullable() {
5072
- return be.create(this, this._def);
4866
+ return ke.create(this, this._def);
5073
4867
  }
5074
4868
  nullish() {
5075
4869
  return this.nullable().optional();
@@ -5088,7 +4882,7 @@ class j {
5088
4882
  }
5089
4883
  transform(e) {
5090
4884
  return new J({
5091
- ...S(this._def),
4885
+ ...O(this._def),
5092
4886
  schema: this,
5093
4887
  typeName: k.ZodEffects,
5094
4888
  effect: { type: "transform", transform: e }
@@ -5097,23 +4891,23 @@ class j {
5097
4891
  default(e) {
5098
4892
  const t = typeof e == "function" ? e : () => e;
5099
4893
  return new St({
5100
- ...S(this._def),
4894
+ ...O(this._def),
5101
4895
  innerType: this,
5102
4896
  defaultValue: t,
5103
4897
  typeName: k.ZodDefault
5104
4898
  });
5105
4899
  }
5106
4900
  brand() {
5107
- return new hn({
4901
+ return new pn({
5108
4902
  typeName: k.ZodBranded,
5109
4903
  type: this,
5110
- ...S(this._def)
4904
+ ...O(this._def)
5111
4905
  });
5112
4906
  }
5113
4907
  catch(e) {
5114
4908
  const t = typeof e == "function" ? e : () => e;
5115
4909
  return new Zt({
5116
- ...S(this._def),
4910
+ ...O(this._def),
5117
4911
  innerType: this,
5118
4912
  catchValue: t,
5119
4913
  typeName: k.ZodCatch
@@ -5127,7 +4921,7 @@ class j {
5127
4921
  });
5128
4922
  }
5129
4923
  pipe(e) {
5130
- return It.create(this, e);
4924
+ return Ct.create(this, e);
5131
4925
  }
5132
4926
  readonly() {
5133
4927
  return jt.create(this);
@@ -5139,25 +4933,25 @@ class j {
5139
4933
  return this.safeParse(null).success;
5140
4934
  }
5141
4935
  }
5142
- const di = /^c[^\s-]{8,}$/i, ui = /^[0-9a-z]+$/, li = /^[0-9A-HJKMNP-TV-Z]{26}$/, pi = /^[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, hi = /^[a-z0-9_-]{21}$/i, fi = /^[-+]?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)?)??$/, mi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, _i = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
5143
- let Xt;
5144
- const gi = /^(?:(?: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])$/, yi = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, vi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Vn = "((\\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])))", wi = new RegExp(`^${Vn}$`);
5145
- function Un(n) {
4936
+ const Qa = /^c[^\s-]{8,}$/i, Ha = /^[0-9a-z]+$/, Ya = /^[0-9A-HJKMNP-TV-Z]{26}$/, Ga = /^[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, Xa = /^[a-z0-9_-]{21}$/i, ei = /^[-+]?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)?)??$/, ti = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ni = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
4937
+ let Yt;
4938
+ const si = /^(?:(?: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])$/, ri = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, ai = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ln = "((\\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])))", ii = new RegExp(`^${Ln}$`);
4939
+ function Vn(n) {
5146
4940
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
5147
4941
  return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
5148
4942
  }
5149
- function ki(n) {
5150
- return new RegExp(`^${Un(n)}$`);
4943
+ function oi(n) {
4944
+ return new RegExp(`^${Vn(n)}$`);
5151
4945
  }
5152
- function Fn(n) {
5153
- let e = `${Vn}T${Un(n)}`;
4946
+ function Un(n) {
4947
+ let e = `${Ln}T${Vn(n)}`;
5154
4948
  const t = [];
5155
4949
  return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
5156
4950
  }
5157
- function bi(n, e) {
5158
- return !!((e === "v4" || !e) && gi.test(n) || (e === "v6" || !e) && yi.test(n));
4951
+ function ci(n, e) {
4952
+ return !!((e === "v4" || !e) && si.test(n) || (e === "v6" || !e) && ri.test(n));
5159
4953
  }
5160
- class z extends j {
4954
+ class z extends Z {
5161
4955
  _parse(e) {
5162
4956
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== g.string) {
5163
4957
  const a = this._getOrReturnCtx(e);
@@ -5206,43 +5000,43 @@ class z extends j {
5206
5000
  message: a.message
5207
5001
  }), s.dirty());
5208
5002
  } else if (a.kind === "email")
5209
- mi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5003
+ ti.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5210
5004
  validation: "email",
5211
5005
  code: h.invalid_string,
5212
5006
  message: a.message
5213
5007
  }), s.dirty());
5214
5008
  else if (a.kind === "emoji")
5215
- Xt || (Xt = new RegExp(_i, "u")), Xt.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5009
+ Yt || (Yt = new RegExp(ni, "u")), Yt.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5216
5010
  validation: "emoji",
5217
5011
  code: h.invalid_string,
5218
5012
  message: a.message
5219
5013
  }), s.dirty());
5220
5014
  else if (a.kind === "uuid")
5221
- pi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5015
+ Ga.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5222
5016
  validation: "uuid",
5223
5017
  code: h.invalid_string,
5224
5018
  message: a.message
5225
5019
  }), s.dirty());
5226
5020
  else if (a.kind === "nanoid")
5227
- hi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5021
+ Xa.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5228
5022
  validation: "nanoid",
5229
5023
  code: h.invalid_string,
5230
5024
  message: a.message
5231
5025
  }), s.dirty());
5232
5026
  else if (a.kind === "cuid")
5233
- di.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5027
+ Qa.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5234
5028
  validation: "cuid",
5235
5029
  code: h.invalid_string,
5236
5030
  message: a.message
5237
5031
  }), s.dirty());
5238
5032
  else if (a.kind === "cuid2")
5239
- ui.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5033
+ Ha.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5240
5034
  validation: "cuid2",
5241
5035
  code: h.invalid_string,
5242
5036
  message: a.message
5243
5037
  }), s.dirty());
5244
5038
  else if (a.kind === "ulid")
5245
- li.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5039
+ Ya.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5246
5040
  validation: "ulid",
5247
5041
  code: h.invalid_string,
5248
5042
  message: a.message
@@ -5273,31 +5067,31 @@ class z extends j {
5273
5067
  code: h.invalid_string,
5274
5068
  validation: { endsWith: a.value },
5275
5069
  message: a.message
5276
- }), s.dirty()) : a.kind === "datetime" ? Fn(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5070
+ }), s.dirty()) : a.kind === "datetime" ? Un(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5277
5071
  code: h.invalid_string,
5278
5072
  validation: "datetime",
5279
5073
  message: a.message
5280
- }), s.dirty()) : a.kind === "date" ? wi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5074
+ }), s.dirty()) : a.kind === "date" ? ii.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5281
5075
  code: h.invalid_string,
5282
5076
  validation: "date",
5283
5077
  message: a.message
5284
- }), s.dirty()) : a.kind === "time" ? ki(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5078
+ }), s.dirty()) : a.kind === "time" ? oi(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5285
5079
  code: h.invalid_string,
5286
5080
  validation: "time",
5287
5081
  message: a.message
5288
- }), s.dirty()) : a.kind === "duration" ? fi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5082
+ }), s.dirty()) : a.kind === "duration" ? ei.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5289
5083
  validation: "duration",
5290
5084
  code: h.invalid_string,
5291
5085
  message: a.message
5292
- }), s.dirty()) : a.kind === "ip" ? bi(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
5086
+ }), s.dirty()) : a.kind === "ip" ? ci(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
5293
5087
  validation: "ip",
5294
5088
  code: h.invalid_string,
5295
5089
  message: a.message
5296
- }), s.dirty()) : a.kind === "base64" ? vi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5090
+ }), s.dirty()) : a.kind === "base64" ? ai.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5297
5091
  validation: "base64",
5298
5092
  code: h.invalid_string,
5299
5093
  message: a.message
5300
- }), s.dirty()) : I.assertNever(a);
5094
+ }), s.dirty()) : C.assertNever(a);
5301
5095
  return { status: s.value, value: e.data };
5302
5096
  }
5303
5097
  _regex(e, t, s) {
@@ -5512,14 +5306,14 @@ z.create = (n) => {
5512
5306
  checks: [],
5513
5307
  typeName: k.ZodString,
5514
5308
  coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
5515
- ...S(n)
5309
+ ...O(n)
5516
5310
  });
5517
5311
  };
5518
- function xi(n, e) {
5312
+ function di(n, e) {
5519
5313
  const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = parseInt(n.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
5520
5314
  return a % o / Math.pow(10, r);
5521
5315
  }
5522
- class ve extends j {
5316
+ class ye extends Z {
5523
5317
  constructor() {
5524
5318
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
5525
5319
  }
@@ -5535,7 +5329,7 @@ class ve extends j {
5535
5329
  let s;
5536
5330
  const r = new P();
5537
5331
  for (const a of this._def.checks)
5538
- a.kind === "int" ? I.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5332
+ a.kind === "int" ? C.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5539
5333
  code: h.invalid_type,
5540
5334
  expected: "integer",
5541
5335
  received: "float",
@@ -5554,14 +5348,14 @@ class ve extends j {
5554
5348
  inclusive: a.inclusive,
5555
5349
  exact: !1,
5556
5350
  message: a.message
5557
- }), r.dirty()) : a.kind === "multipleOf" ? xi(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
5351
+ }), r.dirty()) : a.kind === "multipleOf" ? di(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
5558
5352
  code: h.not_multiple_of,
5559
5353
  multipleOf: a.value,
5560
5354
  message: a.message
5561
5355
  }), r.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5562
5356
  code: h.not_finite,
5563
5357
  message: a.message
5564
- }), r.dirty()) : I.assertNever(a);
5358
+ }), r.dirty()) : C.assertNever(a);
5565
5359
  return { status: r.value, value: e.data };
5566
5360
  }
5567
5361
  gte(e, t) {
@@ -5577,7 +5371,7 @@ class ve extends j {
5577
5371
  return this.setLimit("max", e, !1, v.toString(t));
5578
5372
  }
5579
5373
  setLimit(e, t, s, r) {
5580
- return new ve({
5374
+ return new ye({
5581
5375
  ...this._def,
5582
5376
  checks: [
5583
5377
  ...this._def.checks,
@@ -5591,7 +5385,7 @@ class ve extends j {
5591
5385
  });
5592
5386
  }
5593
5387
  _addCheck(e) {
5594
- return new ve({
5388
+ return new ye({
5595
5389
  ...this._def,
5596
5390
  checks: [...this._def.checks, e]
5597
5391
  });
@@ -5673,7 +5467,7 @@ class ve extends j {
5673
5467
  return e;
5674
5468
  }
5675
5469
  get isInt() {
5676
- return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && I.isInteger(e.value));
5470
+ return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && C.isInteger(e.value));
5677
5471
  }
5678
5472
  get isFinite() {
5679
5473
  let e = null, t = null;
@@ -5685,13 +5479,13 @@ class ve extends j {
5685
5479
  return Number.isFinite(t) && Number.isFinite(e);
5686
5480
  }
5687
5481
  }
5688
- ve.create = (n) => new ve({
5482
+ ye.create = (n) => new ye({
5689
5483
  checks: [],
5690
5484
  typeName: k.ZodNumber,
5691
5485
  coerce: (n == null ? void 0 : n.coerce) || !1,
5692
- ...S(n)
5486
+ ...O(n)
5693
5487
  });
5694
- class we extends j {
5488
+ class ve extends Z {
5695
5489
  constructor() {
5696
5490
  super(...arguments), this.min = this.gte, this.max = this.lte;
5697
5491
  }
@@ -5723,7 +5517,7 @@ class we extends j {
5723
5517
  code: h.not_multiple_of,
5724
5518
  multipleOf: a.value,
5725
5519
  message: a.message
5726
- }), r.dirty()) : I.assertNever(a);
5520
+ }), r.dirty()) : C.assertNever(a);
5727
5521
  return { status: r.value, value: e.data };
5728
5522
  }
5729
5523
  gte(e, t) {
@@ -5739,7 +5533,7 @@ class we extends j {
5739
5533
  return this.setLimit("max", e, !1, v.toString(t));
5740
5534
  }
5741
5535
  setLimit(e, t, s, r) {
5742
- return new we({
5536
+ return new ve({
5743
5537
  ...this._def,
5744
5538
  checks: [
5745
5539
  ...this._def.checks,
@@ -5753,7 +5547,7 @@ class we extends j {
5753
5547
  });
5754
5548
  }
5755
5549
  _addCheck(e) {
5756
- return new we({
5550
+ return new ve({
5757
5551
  ...this._def,
5758
5552
  checks: [...this._def.checks, e]
5759
5553
  });
@@ -5810,16 +5604,16 @@ class we extends j {
5810
5604
  return e;
5811
5605
  }
5812
5606
  }
5813
- we.create = (n) => {
5607
+ ve.create = (n) => {
5814
5608
  var e;
5815
- return new we({
5609
+ return new ve({
5816
5610
  checks: [],
5817
5611
  typeName: k.ZodBigInt,
5818
5612
  coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
5819
- ...S(n)
5613
+ ...O(n)
5820
5614
  });
5821
5615
  };
5822
- class gt extends j {
5616
+ class gt extends Z {
5823
5617
  _parse(e) {
5824
5618
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== g.boolean) {
5825
5619
  const s = this._getOrReturnCtx(e);
@@ -5835,9 +5629,9 @@ class gt extends j {
5835
5629
  gt.create = (n) => new gt({
5836
5630
  typeName: k.ZodBoolean,
5837
5631
  coerce: (n == null ? void 0 : n.coerce) || !1,
5838
- ...S(n)
5632
+ ...O(n)
5839
5633
  });
5840
- class Ce extends j {
5634
+ class Ce extends Z {
5841
5635
  _parse(e) {
5842
5636
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== g.date) {
5843
5637
  const a = this._getOrReturnCtx(e);
@@ -5870,7 +5664,7 @@ class Ce extends j {
5870
5664
  exact: !1,
5871
5665
  maximum: a.value,
5872
5666
  type: "date"
5873
- }), s.dirty()) : I.assertNever(a);
5667
+ }), s.dirty()) : C.assertNever(a);
5874
5668
  return {
5875
5669
  status: s.value,
5876
5670
  value: new Date(e.data.getTime())
@@ -5913,9 +5707,9 @@ Ce.create = (n) => new Ce({
5913
5707
  checks: [],
5914
5708
  coerce: (n == null ? void 0 : n.coerce) || !1,
5915
5709
  typeName: k.ZodDate,
5916
- ...S(n)
5710
+ ...O(n)
5917
5711
  });
5918
- class Bt extends j {
5712
+ class zt extends Z {
5919
5713
  _parse(e) {
5920
5714
  if (this._getType(e) !== g.symbol) {
5921
5715
  const s = this._getOrReturnCtx(e);
@@ -5928,11 +5722,11 @@ class Bt extends j {
5928
5722
  return M(e.data);
5929
5723
  }
5930
5724
  }
5931
- Bt.create = (n) => new Bt({
5725
+ zt.create = (n) => new zt({
5932
5726
  typeName: k.ZodSymbol,
5933
- ...S(n)
5727
+ ...O(n)
5934
5728
  });
5935
- class yt extends j {
5729
+ class yt extends Z {
5936
5730
  _parse(e) {
5937
5731
  if (this._getType(e) !== g.undefined) {
5938
5732
  const s = this._getOrReturnCtx(e);
@@ -5947,9 +5741,9 @@ class yt extends j {
5947
5741
  }
5948
5742
  yt.create = (n) => new yt({
5949
5743
  typeName: k.ZodUndefined,
5950
- ...S(n)
5744
+ ...O(n)
5951
5745
  });
5952
- class vt extends j {
5746
+ class vt extends Z {
5953
5747
  _parse(e) {
5954
5748
  if (this._getType(e) !== g.null) {
5955
5749
  const s = this._getOrReturnCtx(e);
@@ -5964,9 +5758,9 @@ class vt extends j {
5964
5758
  }
5965
5759
  vt.create = (n) => new vt({
5966
5760
  typeName: k.ZodNull,
5967
- ...S(n)
5761
+ ...O(n)
5968
5762
  });
5969
- class Je extends j {
5763
+ class Je extends Z {
5970
5764
  constructor() {
5971
5765
  super(...arguments), this._any = !0;
5972
5766
  }
@@ -5976,9 +5770,9 @@ class Je extends j {
5976
5770
  }
5977
5771
  Je.create = (n) => new Je({
5978
5772
  typeName: k.ZodAny,
5979
- ...S(n)
5773
+ ...O(n)
5980
5774
  });
5981
- class je extends j {
5775
+ class Ze extends Z {
5982
5776
  constructor() {
5983
5777
  super(...arguments), this._unknown = !0;
5984
5778
  }
@@ -5986,11 +5780,11 @@ class je extends j {
5986
5780
  return M(e.data);
5987
5781
  }
5988
5782
  }
5989
- je.create = (n) => new je({
5783
+ Ze.create = (n) => new Ze({
5990
5784
  typeName: k.ZodUnknown,
5991
- ...S(n)
5785
+ ...O(n)
5992
5786
  });
5993
- class oe extends j {
5787
+ class ae extends Z {
5994
5788
  _parse(e) {
5995
5789
  const t = this._getOrReturnCtx(e);
5996
5790
  return m(t, {
@@ -6000,11 +5794,11 @@ class oe extends j {
6000
5794
  }), b;
6001
5795
  }
6002
5796
  }
6003
- oe.create = (n) => new oe({
5797
+ ae.create = (n) => new ae({
6004
5798
  typeName: k.ZodNever,
6005
- ...S(n)
5799
+ ...O(n)
6006
5800
  });
6007
- class Wt extends j {
5801
+ class Bt extends Z {
6008
5802
  _parse(e) {
6009
5803
  if (this._getType(e) !== g.undefined) {
6010
5804
  const s = this._getOrReturnCtx(e);
@@ -6017,11 +5811,11 @@ class Wt extends j {
6017
5811
  return M(e.data);
6018
5812
  }
6019
5813
  }
6020
- Wt.create = (n) => new Wt({
5814
+ Bt.create = (n) => new Bt({
6021
5815
  typeName: k.ZodVoid,
6022
- ...S(n)
5816
+ ...O(n)
6023
5817
  });
6024
- class W extends j {
5818
+ class W extends Z {
6025
5819
  _parse(e) {
6026
5820
  const { ctx: t, status: s } = this._processInputParams(e), r = this._def;
6027
5821
  if (t.parsedType !== g.array)
@@ -6057,8 +5851,8 @@ class W extends j {
6057
5851
  exact: !1,
6058
5852
  message: r.maxLength.message
6059
5853
  }), s.dirty()), t.common.async)
6060
- return Promise.all([...t.data].map((o, c) => r.type._parseAsync(new ne(t, o, t.path, c)))).then((o) => P.mergeArray(s, o));
6061
- const a = [...t.data].map((o, c) => r.type._parseSync(new ne(t, o, t.path, c)));
5854
+ return Promise.all([...t.data].map((o, c) => r.type._parseAsync(new te(t, o, t.path, c)))).then((o) => P.mergeArray(s, o));
5855
+ const a = [...t.data].map((o, c) => r.type._parseSync(new te(t, o, t.path, c)));
6062
5856
  return P.mergeArray(s, a);
6063
5857
  }
6064
5858
  get element() {
@@ -6092,32 +5886,32 @@ W.create = (n, e) => new W({
6092
5886
  maxLength: null,
6093
5887
  exactLength: null,
6094
5888
  typeName: k.ZodArray,
6095
- ...S(e)
5889
+ ...O(e)
6096
5890
  });
6097
5891
  function Le(n) {
6098
- if (n instanceof A) {
5892
+ if (n instanceof E) {
6099
5893
  const e = {};
6100
5894
  for (const t in n.shape) {
6101
5895
  const s = n.shape[t];
6102
- e[t] = X.create(Le(s));
5896
+ e[t] = G.create(Le(s));
6103
5897
  }
6104
- return new A({
5898
+ return new E({
6105
5899
  ...n._def,
6106
5900
  shape: () => e
6107
5901
  });
6108
5902
  } else return n instanceof W ? new W({
6109
5903
  ...n._def,
6110
5904
  type: Le(n.element)
6111
- }) : n instanceof X ? X.create(Le(n.unwrap())) : n instanceof be ? be.create(Le(n.unwrap())) : n instanceof se ? se.create(n.items.map((e) => Le(e))) : n;
5905
+ }) : n instanceof G ? G.create(Le(n.unwrap())) : n instanceof ke ? ke.create(Le(n.unwrap())) : n instanceof ne ? ne.create(n.items.map((e) => Le(e))) : n;
6112
5906
  }
6113
- class A extends j {
5907
+ class E extends Z {
6114
5908
  constructor() {
6115
5909
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
6116
5910
  }
6117
5911
  _getCached() {
6118
5912
  if (this._cached !== null)
6119
5913
  return this._cached;
6120
- const e = this._def.shape(), t = I.objectKeys(e);
5914
+ const e = this._def.shape(), t = C.objectKeys(e);
6121
5915
  return this._cached = { shape: e, keys: t };
6122
5916
  }
6123
5917
  _parse(e) {
@@ -6130,19 +5924,19 @@ class A extends j {
6130
5924
  }), b;
6131
5925
  }
6132
5926
  const { status: s, ctx: r } = this._processInputParams(e), { shape: a, keys: o } = this._getCached(), c = [];
6133
- if (!(this._def.catchall instanceof oe && this._def.unknownKeys === "strip"))
5927
+ if (!(this._def.catchall instanceof ae && this._def.unknownKeys === "strip"))
6134
5928
  for (const u in r.data)
6135
5929
  o.includes(u) || c.push(u);
6136
5930
  const d = [];
6137
5931
  for (const u of o) {
6138
- const l = a[u], T = r.data[u];
5932
+ const l = a[u], j = r.data[u];
6139
5933
  d.push({
6140
5934
  key: { status: "valid", value: u },
6141
- value: l._parse(new ne(r, T, r.path, u)),
5935
+ value: l._parse(new te(r, j, r.path, u)),
6142
5936
  alwaysSet: u in r.data
6143
5937
  });
6144
5938
  }
6145
- if (this._def.catchall instanceof oe) {
5939
+ if (this._def.catchall instanceof ae) {
6146
5940
  const u = this._def.unknownKeys;
6147
5941
  if (u === "passthrough")
6148
5942
  for (const l of c)
@@ -6159,11 +5953,11 @@ class A extends j {
6159
5953
  } else {
6160
5954
  const u = this._def.catchall;
6161
5955
  for (const l of c) {
6162
- const T = r.data[l];
5956
+ const j = r.data[l];
6163
5957
  d.push({
6164
5958
  key: { status: "valid", value: l },
6165
5959
  value: u._parse(
6166
- new ne(r, T, r.path, l)
5960
+ new te(r, j, r.path, l)
6167
5961
  //, ctx.child(key), value, getParsedType(value)
6168
5962
  ),
6169
5963
  alwaysSet: l in r.data
@@ -6173,10 +5967,10 @@ class A extends j {
6173
5967
  return r.common.async ? Promise.resolve().then(async () => {
6174
5968
  const u = [];
6175
5969
  for (const l of d) {
6176
- const T = await l.key, C = await l.value;
5970
+ const j = await l.key, A = await l.value;
6177
5971
  u.push({
6178
- key: T,
6179
- value: C,
5972
+ key: j,
5973
+ value: A,
6180
5974
  alwaysSet: l.alwaysSet
6181
5975
  });
6182
5976
  }
@@ -6187,7 +5981,7 @@ class A extends j {
6187
5981
  return this._def.shape();
6188
5982
  }
6189
5983
  strict(e) {
6190
- return v.errToObj, new A({
5984
+ return v.errToObj, new E({
6191
5985
  ...this._def,
6192
5986
  unknownKeys: "strict",
6193
5987
  ...e !== void 0 ? {
@@ -6204,13 +5998,13 @@ class A extends j {
6204
5998
  });
6205
5999
  }
6206
6000
  strip() {
6207
- return new A({
6001
+ return new E({
6208
6002
  ...this._def,
6209
6003
  unknownKeys: "strip"
6210
6004
  });
6211
6005
  }
6212
6006
  passthrough() {
6213
- return new A({
6007
+ return new E({
6214
6008
  ...this._def,
6215
6009
  unknownKeys: "passthrough"
6216
6010
  });
@@ -6233,7 +6027,7 @@ class A extends j {
6233
6027
  // }) as any;
6234
6028
  // };
6235
6029
  extend(e) {
6236
- return new A({
6030
+ return new E({
6237
6031
  ...this._def,
6238
6032
  shape: () => ({
6239
6033
  ...this._def.shape(),
@@ -6247,7 +6041,7 @@ class A extends j {
6247
6041
  * upgrade if you are experiencing issues.
6248
6042
  */
6249
6043
  merge(e) {
6250
- return new A({
6044
+ return new E({
6251
6045
  unknownKeys: e._def.unknownKeys,
6252
6046
  catchall: e._def.catchall,
6253
6047
  shape: () => ({
@@ -6317,25 +6111,25 @@ class A extends j {
6317
6111
  // return merged;
6318
6112
  // }
6319
6113
  catchall(e) {
6320
- return new A({
6114
+ return new E({
6321
6115
  ...this._def,
6322
6116
  catchall: e
6323
6117
  });
6324
6118
  }
6325
6119
  pick(e) {
6326
6120
  const t = {};
6327
- return I.objectKeys(e).forEach((s) => {
6121
+ return C.objectKeys(e).forEach((s) => {
6328
6122
  e[s] && this.shape[s] && (t[s] = this.shape[s]);
6329
- }), new A({
6123
+ }), new E({
6330
6124
  ...this._def,
6331
6125
  shape: () => t
6332
6126
  });
6333
6127
  }
6334
6128
  omit(e) {
6335
6129
  const t = {};
6336
- return I.objectKeys(this.shape).forEach((s) => {
6130
+ return C.objectKeys(this.shape).forEach((s) => {
6337
6131
  e[s] || (t[s] = this.shape[s]);
6338
- }), new A({
6132
+ }), new E({
6339
6133
  ...this._def,
6340
6134
  shape: () => t
6341
6135
  });
@@ -6348,56 +6142,56 @@ class A extends j {
6348
6142
  }
6349
6143
  partial(e) {
6350
6144
  const t = {};
6351
- return I.objectKeys(this.shape).forEach((s) => {
6145
+ return C.objectKeys(this.shape).forEach((s) => {
6352
6146
  const r = this.shape[s];
6353
6147
  e && !e[s] ? t[s] = r : t[s] = r.optional();
6354
- }), new A({
6148
+ }), new E({
6355
6149
  ...this._def,
6356
6150
  shape: () => t
6357
6151
  });
6358
6152
  }
6359
6153
  required(e) {
6360
6154
  const t = {};
6361
- return I.objectKeys(this.shape).forEach((s) => {
6155
+ return C.objectKeys(this.shape).forEach((s) => {
6362
6156
  if (e && !e[s])
6363
6157
  t[s] = this.shape[s];
6364
6158
  else {
6365
6159
  let a = this.shape[s];
6366
- for (; a instanceof X; )
6160
+ for (; a instanceof G; )
6367
6161
  a = a._def.innerType;
6368
6162
  t[s] = a;
6369
6163
  }
6370
- }), new A({
6164
+ }), new E({
6371
6165
  ...this._def,
6372
6166
  shape: () => t
6373
6167
  });
6374
6168
  }
6375
6169
  keyof() {
6376
- return zn(I.objectKeys(this.shape));
6170
+ return Fn(C.objectKeys(this.shape));
6377
6171
  }
6378
6172
  }
6379
- A.create = (n, e) => new A({
6173
+ E.create = (n, e) => new E({
6380
6174
  shape: () => n,
6381
6175
  unknownKeys: "strip",
6382
- catchall: oe.create(),
6176
+ catchall: ae.create(),
6383
6177
  typeName: k.ZodObject,
6384
- ...S(e)
6178
+ ...O(e)
6385
6179
  });
6386
- A.strictCreate = (n, e) => new A({
6180
+ E.strictCreate = (n, e) => new E({
6387
6181
  shape: () => n,
6388
6182
  unknownKeys: "strict",
6389
- catchall: oe.create(),
6183
+ catchall: ae.create(),
6390
6184
  typeName: k.ZodObject,
6391
- ...S(e)
6185
+ ...O(e)
6392
6186
  });
6393
- A.lazycreate = (n, e) => new A({
6187
+ E.lazycreate = (n, e) => new E({
6394
6188
  shape: n,
6395
6189
  unknownKeys: "strip",
6396
- catchall: oe.create(),
6190
+ catchall: ae.create(),
6397
6191
  typeName: k.ZodObject,
6398
- ...S(e)
6192
+ ...O(e)
6399
6193
  });
6400
- class wt extends j {
6194
+ class wt extends Z {
6401
6195
  _parse(e) {
6402
6196
  const { ctx: t } = this._processInputParams(e), s = this._def.options;
6403
6197
  function r(a) {
@@ -6407,7 +6201,7 @@ class wt extends j {
6407
6201
  for (const c of a)
6408
6202
  if (c.result.status === "dirty")
6409
6203
  return t.common.issues.push(...c.ctx.common.issues), c.result;
6410
- const o = a.map((c) => new U(c.ctx.common.issues));
6204
+ const o = a.map((c) => new V(c.ctx.common.issues));
6411
6205
  return m(t, {
6412
6206
  code: h.invalid_union,
6413
6207
  unionErrors: o
@@ -6454,7 +6248,7 @@ class wt extends j {
6454
6248
  }
6455
6249
  if (a)
6456
6250
  return t.common.issues.push(...a.ctx.common.issues), a.result;
6457
- const c = o.map((d) => new U(d));
6251
+ const c = o.map((d) => new V(d));
6458
6252
  return m(t, {
6459
6253
  code: h.invalid_union,
6460
6254
  unionErrors: c
@@ -6468,10 +6262,10 @@ class wt extends j {
6468
6262
  wt.create = (n, e) => new wt({
6469
6263
  options: n,
6470
6264
  typeName: k.ZodUnion,
6471
- ...S(e)
6265
+ ...O(e)
6472
6266
  });
6473
- const ae = (n) => n instanceof xt ? ae(n.schema) : n instanceof J ? ae(n.innerType()) : n instanceof Tt ? [n.value] : n instanceof ke ? n.options : n instanceof Ot ? I.objectValues(n.enum) : n instanceof St ? ae(n._def.innerType) : n instanceof yt ? [void 0] : n instanceof vt ? [null] : n instanceof X ? [void 0, ...ae(n.unwrap())] : n instanceof be ? [null, ...ae(n.unwrap())] : n instanceof hn || n instanceof jt ? ae(n.unwrap()) : n instanceof Zt ? ae(n._def.innerType) : [];
6474
- class Ht extends j {
6267
+ const se = (n) => n instanceof xt ? se(n.schema) : n instanceof J ? se(n.innerType()) : n instanceof Tt ? [n.value] : n instanceof we ? n.options : n instanceof Ot ? C.objectValues(n.enum) : n instanceof St ? se(n._def.innerType) : n instanceof yt ? [void 0] : n instanceof vt ? [null] : n instanceof G ? [void 0, ...se(n.unwrap())] : n instanceof ke ? [null, ...se(n.unwrap())] : n instanceof pn || n instanceof jt ? se(n.unwrap()) : n instanceof Zt ? se(n._def.innerType) : [];
6268
+ class Kt extends Z {
6475
6269
  _parse(e) {
6476
6270
  const { ctx: t } = this._processInputParams(e);
6477
6271
  if (t.parsedType !== g.object)
@@ -6515,7 +6309,7 @@ class Ht extends j {
6515
6309
  static create(e, t, s) {
6516
6310
  const r = /* @__PURE__ */ new Map();
6517
6311
  for (const a of t) {
6518
- const o = ae(a.shape[e]);
6312
+ const o = se(a.shape[e]);
6519
6313
  if (!o.length)
6520
6314
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
6521
6315
  for (const c of o) {
@@ -6524,23 +6318,23 @@ class Ht extends j {
6524
6318
  r.set(c, a);
6525
6319
  }
6526
6320
  }
6527
- return new Ht({
6321
+ return new Kt({
6528
6322
  typeName: k.ZodDiscriminatedUnion,
6529
6323
  discriminator: e,
6530
6324
  options: t,
6531
6325
  optionsMap: r,
6532
- ...S(s)
6326
+ ...O(s)
6533
6327
  });
6534
6328
  }
6535
6329
  }
6536
- function cn(n, e) {
6537
- const t = fe(n), s = fe(e);
6330
+ function on(n, e) {
6331
+ const t = he(n), s = he(e);
6538
6332
  if (n === e)
6539
6333
  return { valid: !0, data: n };
6540
6334
  if (t === g.object && s === g.object) {
6541
- const r = I.objectKeys(e), a = I.objectKeys(n).filter((c) => r.indexOf(c) !== -1), o = { ...n, ...e };
6335
+ const r = C.objectKeys(e), a = C.objectKeys(n).filter((c) => r.indexOf(c) !== -1), o = { ...n, ...e };
6542
6336
  for (const c of a) {
6543
- const d = cn(n[c], e[c]);
6337
+ const d = on(n[c], e[c]);
6544
6338
  if (!d.valid)
6545
6339
  return { valid: !1 };
6546
6340
  o[c] = d.data;
@@ -6551,7 +6345,7 @@ function cn(n, e) {
6551
6345
  return { valid: !1 };
6552
6346
  const r = [];
6553
6347
  for (let a = 0; a < n.length; a++) {
6554
- const o = n[a], c = e[a], d = cn(o, c);
6348
+ const o = n[a], c = e[a], d = on(o, c);
6555
6349
  if (!d.valid)
6556
6350
  return { valid: !1 };
6557
6351
  r.push(d.data);
@@ -6559,13 +6353,13 @@ function cn(n, e) {
6559
6353
  return { valid: !0, data: r };
6560
6354
  } else return t === g.date && s === g.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
6561
6355
  }
6562
- class kt extends j {
6356
+ class kt extends Z {
6563
6357
  _parse(e) {
6564
6358
  const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
6565
- if (an(a) || an(o))
6359
+ if (rn(a) || rn(o))
6566
6360
  return b;
6567
- const c = cn(a.value, o.value);
6568
- return c.valid ? ((on(a) || on(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(s, {
6361
+ const c = on(a.value, o.value);
6362
+ return c.valid ? ((an(a) || an(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(s, {
6569
6363
  code: h.invalid_intersection_types
6570
6364
  }), b);
6571
6365
  };
@@ -6595,9 +6389,9 @@ kt.create = (n, e, t) => new kt({
6595
6389
  left: n,
6596
6390
  right: e,
6597
6391
  typeName: k.ZodIntersection,
6598
- ...S(t)
6392
+ ...O(t)
6599
6393
  });
6600
- class se extends j {
6394
+ class ne extends Z {
6601
6395
  _parse(e) {
6602
6396
  const { status: t, ctx: s } = this._processInputParams(e);
6603
6397
  if (s.parsedType !== g.array)
@@ -6623,7 +6417,7 @@ class se extends j {
6623
6417
  }), t.dirty());
6624
6418
  const a = [...s.data].map((o, c) => {
6625
6419
  const d = this._def.items[c] || this._def.rest;
6626
- return d ? d._parse(new ne(s, o, s.path, c)) : null;
6420
+ return d ? d._parse(new te(s, o, s.path, c)) : null;
6627
6421
  }).filter((o) => !!o);
6628
6422
  return s.common.async ? Promise.all(a).then((o) => P.mergeArray(t, o)) : P.mergeArray(t, a);
6629
6423
  }
@@ -6631,23 +6425,23 @@ class se extends j {
6631
6425
  return this._def.items;
6632
6426
  }
6633
6427
  rest(e) {
6634
- return new se({
6428
+ return new ne({
6635
6429
  ...this._def,
6636
6430
  rest: e
6637
6431
  });
6638
6432
  }
6639
6433
  }
6640
- se.create = (n, e) => {
6434
+ ne.create = (n, e) => {
6641
6435
  if (!Array.isArray(n))
6642
6436
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
6643
- return new se({
6437
+ return new ne({
6644
6438
  items: n,
6645
6439
  typeName: k.ZodTuple,
6646
6440
  rest: null,
6647
- ...S(e)
6441
+ ...O(e)
6648
6442
  });
6649
6443
  };
6650
- class bt extends j {
6444
+ class bt extends Z {
6651
6445
  get keySchema() {
6652
6446
  return this._def.keyType;
6653
6447
  }
@@ -6665,8 +6459,8 @@ class bt extends j {
6665
6459
  const r = [], a = this._def.keyType, o = this._def.valueType;
6666
6460
  for (const c in s.data)
6667
6461
  r.push({
6668
- key: a._parse(new ne(s, c, s.path, c)),
6669
- value: o._parse(new ne(s, s.data[c], s.path, c)),
6462
+ key: a._parse(new te(s, c, s.path, c)),
6463
+ value: o._parse(new te(s, s.data[c], s.path, c)),
6670
6464
  alwaysSet: c in s.data
6671
6465
  });
6672
6466
  return s.common.async ? P.mergeObjectAsync(t, r) : P.mergeObjectSync(t, r);
@@ -6675,20 +6469,20 @@ class bt extends j {
6675
6469
  return this._def.valueType;
6676
6470
  }
6677
6471
  static create(e, t, s) {
6678
- return t instanceof j ? new bt({
6472
+ return t instanceof Z ? new bt({
6679
6473
  keyType: e,
6680
6474
  valueType: t,
6681
6475
  typeName: k.ZodRecord,
6682
- ...S(s)
6476
+ ...O(s)
6683
6477
  }) : new bt({
6684
6478
  keyType: z.create(),
6685
6479
  valueType: e,
6686
6480
  typeName: k.ZodRecord,
6687
- ...S(t)
6481
+ ...O(t)
6688
6482
  });
6689
6483
  }
6690
6484
  }
6691
- class qt extends j {
6485
+ class Wt extends Z {
6692
6486
  get keySchema() {
6693
6487
  return this._def.keyType;
6694
6488
  }
@@ -6704,8 +6498,8 @@ class qt extends j {
6704
6498
  received: s.parsedType
6705
6499
  }), b;
6706
6500
  const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([c, d], u) => ({
6707
- key: r._parse(new ne(s, c, s.path, [u, "key"])),
6708
- value: a._parse(new ne(s, d, s.path, [u, "value"]))
6501
+ key: r._parse(new te(s, c, s.path, [u, "key"])),
6502
+ value: a._parse(new te(s, d, s.path, [u, "value"]))
6709
6503
  }));
6710
6504
  if (s.common.async) {
6711
6505
  const c = /* @__PURE__ */ new Map();
@@ -6730,13 +6524,13 @@ class qt extends j {
6730
6524
  }
6731
6525
  }
6732
6526
  }
6733
- qt.create = (n, e, t) => new qt({
6527
+ Wt.create = (n, e, t) => new Wt({
6734
6528
  valueType: e,
6735
6529
  keyType: n,
6736
6530
  typeName: k.ZodMap,
6737
- ...S(t)
6531
+ ...O(t)
6738
6532
  });
6739
- class Ee extends j {
6533
+ class Ie extends Z {
6740
6534
  _parse(e) {
6741
6535
  const { status: t, ctx: s } = this._processInputParams(e);
6742
6536
  if (s.parsedType !== g.set)
@@ -6771,17 +6565,17 @@ class Ee extends j {
6771
6565
  }
6772
6566
  return { status: t.value, value: u };
6773
6567
  }
6774
- const c = [...s.data.values()].map((d, u) => a._parse(new ne(s, d, s.path, u)));
6568
+ const c = [...s.data.values()].map((d, u) => a._parse(new te(s, d, s.path, u)));
6775
6569
  return s.common.async ? Promise.all(c).then((d) => o(d)) : o(c);
6776
6570
  }
6777
6571
  min(e, t) {
6778
- return new Ee({
6572
+ return new Ie({
6779
6573
  ...this._def,
6780
6574
  minSize: { value: e, message: v.toString(t) }
6781
6575
  });
6782
6576
  }
6783
6577
  max(e, t) {
6784
- return new Ee({
6578
+ return new Ie({
6785
6579
  ...this._def,
6786
6580
  maxSize: { value: e, message: v.toString(t) }
6787
6581
  });
@@ -6793,14 +6587,14 @@ class Ee extends j {
6793
6587
  return this.min(1, e);
6794
6588
  }
6795
6589
  }
6796
- Ee.create = (n, e) => new Ee({
6590
+ Ie.create = (n, e) => new Ie({
6797
6591
  valueType: n,
6798
6592
  minSize: null,
6799
6593
  maxSize: null,
6800
6594
  typeName: k.ZodSet,
6801
- ...S(e)
6595
+ ...O(e)
6802
6596
  });
6803
- class Fe extends j {
6597
+ class Fe extends Z {
6804
6598
  constructor() {
6805
6599
  super(...arguments), this.validate = this.implement;
6806
6600
  }
@@ -6813,13 +6607,13 @@ class Fe extends j {
6813
6607
  received: t.parsedType
6814
6608
  }), b;
6815
6609
  function s(c, d) {
6816
- return Ft({
6610
+ return Ut({
6817
6611
  data: c,
6818
6612
  path: t.path,
6819
6613
  errorMaps: [
6820
6614
  t.common.contextualErrorMap,
6821
6615
  t.schemaErrorMap,
6822
- Ut(),
6616
+ Vt(),
6823
6617
  qe
6824
6618
  ].filter((u) => !!u),
6825
6619
  issueData: {
@@ -6829,13 +6623,13 @@ class Fe extends j {
6829
6623
  });
6830
6624
  }
6831
6625
  function r(c, d) {
6832
- return Ft({
6626
+ return Ut({
6833
6627
  data: c,
6834
6628
  path: t.path,
6835
6629
  errorMaps: [
6836
6630
  t.common.contextualErrorMap,
6837
6631
  t.schemaErrorMap,
6838
- Ut(),
6632
+ Vt(),
6839
6633
  qe
6840
6634
  ].filter((u) => !!u),
6841
6635
  issueData: {
@@ -6848,11 +6642,11 @@ class Fe extends j {
6848
6642
  if (this._def.returns instanceof Ke) {
6849
6643
  const c = this;
6850
6644
  return M(async function(...d) {
6851
- const u = new U([]), l = await c._def.args.parseAsync(d, a).catch((L) => {
6852
- throw u.addIssue(s(d, L)), u;
6853
- }), T = await Reflect.apply(o, this, l);
6854
- return await c._def.returns._def.type.parseAsync(T, a).catch((L) => {
6855
- throw u.addIssue(r(T, L)), u;
6645
+ const u = new V([]), l = await c._def.args.parseAsync(d, a).catch((U) => {
6646
+ throw u.addIssue(s(d, U)), u;
6647
+ }), j = await Reflect.apply(o, this, l);
6648
+ return await c._def.returns._def.type.parseAsync(j, a).catch((U) => {
6649
+ throw u.addIssue(r(j, U)), u;
6856
6650
  });
6857
6651
  });
6858
6652
  } else {
@@ -6860,11 +6654,11 @@ class Fe extends j {
6860
6654
  return M(function(...d) {
6861
6655
  const u = c._def.args.safeParse(d, a);
6862
6656
  if (!u.success)
6863
- throw new U([s(d, u.error)]);
6864
- const l = Reflect.apply(o, this, u.data), T = c._def.returns.safeParse(l, a);
6865
- if (!T.success)
6866
- throw new U([r(l, T.error)]);
6867
- return T.data;
6657
+ throw new V([s(d, u.error)]);
6658
+ const l = Reflect.apply(o, this, u.data), j = c._def.returns.safeParse(l, a);
6659
+ if (!j.success)
6660
+ throw new V([r(l, j.error)]);
6661
+ return j.data;
6868
6662
  });
6869
6663
  }
6870
6664
  }
@@ -6877,7 +6671,7 @@ class Fe extends j {
6877
6671
  args(...e) {
6878
6672
  return new Fe({
6879
6673
  ...this._def,
6880
- args: se.create(e).rest(je.create())
6674
+ args: ne.create(e).rest(Ze.create())
6881
6675
  });
6882
6676
  }
6883
6677
  returns(e) {
@@ -6894,14 +6688,14 @@ class Fe extends j {
6894
6688
  }
6895
6689
  static create(e, t, s) {
6896
6690
  return new Fe({
6897
- args: e || se.create([]).rest(je.create()),
6898
- returns: t || je.create(),
6691
+ args: e || ne.create([]).rest(Ze.create()),
6692
+ returns: t || Ze.create(),
6899
6693
  typeName: k.ZodFunction,
6900
- ...S(s)
6694
+ ...O(s)
6901
6695
  });
6902
6696
  }
6903
6697
  }
6904
- class xt extends j {
6698
+ class xt extends Z {
6905
6699
  get schema() {
6906
6700
  return this._def.getter();
6907
6701
  }
@@ -6913,9 +6707,9 @@ class xt extends j {
6913
6707
  xt.create = (n, e) => new xt({
6914
6708
  getter: n,
6915
6709
  typeName: k.ZodLazy,
6916
- ...S(e)
6710
+ ...O(e)
6917
6711
  });
6918
- class Tt extends j {
6712
+ class Tt extends Z {
6919
6713
  _parse(e) {
6920
6714
  if (e.data !== this._def.value) {
6921
6715
  const t = this._getOrReturnCtx(e);
@@ -6934,16 +6728,16 @@ class Tt extends j {
6934
6728
  Tt.create = (n, e) => new Tt({
6935
6729
  value: n,
6936
6730
  typeName: k.ZodLiteral,
6937
- ...S(e)
6731
+ ...O(e)
6938
6732
  });
6939
- function zn(n, e) {
6940
- return new ke({
6733
+ function Fn(n, e) {
6734
+ return new we({
6941
6735
  values: n,
6942
6736
  typeName: k.ZodEnum,
6943
- ...S(e)
6737
+ ...O(e)
6944
6738
  });
6945
6739
  }
6946
- class ke extends j {
6740
+ class we extends Z {
6947
6741
  constructor() {
6948
6742
  super(...arguments), Xe.set(this, void 0);
6949
6743
  }
@@ -6951,12 +6745,12 @@ class ke extends j {
6951
6745
  if (typeof e.data != "string") {
6952
6746
  const t = this._getOrReturnCtx(e), s = this._def.values;
6953
6747
  return m(t, {
6954
- expected: I.joinValues(s),
6748
+ expected: C.joinValues(s),
6955
6749
  received: t.parsedType,
6956
6750
  code: h.invalid_type
6957
6751
  }), b;
6958
6752
  }
6959
- if (zt(this, Xe) || Ln(this, Xe, new Set(this._def.values)), !zt(this, Xe).has(e.data)) {
6753
+ if (Ft(this, Xe) || Mn(this, Xe, new Set(this._def.values)), !Ft(this, Xe).has(e.data)) {
6960
6754
  const t = this._getOrReturnCtx(e), s = this._def.values;
6961
6755
  return m(t, {
6962
6756
  received: t.data,
@@ -6988,36 +6782,36 @@ class ke extends j {
6988
6782
  return e;
6989
6783
  }
6990
6784
  extract(e, t = this._def) {
6991
- return ke.create(e, {
6785
+ return we.create(e, {
6992
6786
  ...this._def,
6993
6787
  ...t
6994
6788
  });
6995
6789
  }
6996
6790
  exclude(e, t = this._def) {
6997
- return ke.create(this.options.filter((s) => !e.includes(s)), {
6791
+ return we.create(this.options.filter((s) => !e.includes(s)), {
6998
6792
  ...this._def,
6999
6793
  ...t
7000
6794
  });
7001
6795
  }
7002
6796
  }
7003
6797
  Xe = /* @__PURE__ */ new WeakMap();
7004
- ke.create = zn;
7005
- class Ot extends j {
6798
+ we.create = Fn;
6799
+ class Ot extends Z {
7006
6800
  constructor() {
7007
6801
  super(...arguments), et.set(this, void 0);
7008
6802
  }
7009
6803
  _parse(e) {
7010
- const t = I.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
6804
+ const t = C.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
7011
6805
  if (s.parsedType !== g.string && s.parsedType !== g.number) {
7012
- const r = I.objectValues(t);
6806
+ const r = C.objectValues(t);
7013
6807
  return m(s, {
7014
- expected: I.joinValues(r),
6808
+ expected: C.joinValues(r),
7015
6809
  received: s.parsedType,
7016
6810
  code: h.invalid_type
7017
6811
  }), b;
7018
6812
  }
7019
- if (zt(this, et) || Ln(this, et, new Set(I.getValidEnumValues(this._def.values))), !zt(this, et).has(e.data)) {
7020
- const r = I.objectValues(t);
6813
+ if (Ft(this, et) || Mn(this, et, new Set(C.getValidEnumValues(this._def.values))), !Ft(this, et).has(e.data)) {
6814
+ const r = C.objectValues(t);
7021
6815
  return m(s, {
7022
6816
  received: s.data,
7023
6817
  code: h.invalid_enum_value,
@@ -7034,9 +6828,9 @@ et = /* @__PURE__ */ new WeakMap();
7034
6828
  Ot.create = (n, e) => new Ot({
7035
6829
  values: n,
7036
6830
  typeName: k.ZodNativeEnum,
7037
- ...S(e)
6831
+ ...O(e)
7038
6832
  });
7039
- class Ke extends j {
6833
+ class Ke extends Z {
7040
6834
  unwrap() {
7041
6835
  return this._def.type;
7042
6836
  }
@@ -7058,9 +6852,9 @@ class Ke extends j {
7058
6852
  Ke.create = (n, e) => new Ke({
7059
6853
  type: n,
7060
6854
  typeName: k.ZodPromise,
7061
- ...S(e)
6855
+ ...O(e)
7062
6856
  });
7063
- class J extends j {
6857
+ class J extends Z {
7064
6858
  innerType() {
7065
6859
  return this._def.schema;
7066
6860
  }
@@ -7134,22 +6928,22 @@ class J extends j {
7134
6928
  return { status: t.value, value: c };
7135
6929
  } else
7136
6930
  return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => mt(o) ? Promise.resolve(r.transform(o.value, a)).then((c) => ({ status: t.value, value: c })) : o);
7137
- I.assertNever(r);
6931
+ C.assertNever(r);
7138
6932
  }
7139
6933
  }
7140
6934
  J.create = (n, e, t) => new J({
7141
6935
  schema: n,
7142
6936
  typeName: k.ZodEffects,
7143
6937
  effect: e,
7144
- ...S(t)
6938
+ ...O(t)
7145
6939
  });
7146
6940
  J.createWithPreprocess = (n, e, t) => new J({
7147
6941
  schema: e,
7148
6942
  effect: { type: "preprocess", transform: n },
7149
6943
  typeName: k.ZodEffects,
7150
- ...S(t)
6944
+ ...O(t)
7151
6945
  });
7152
- class X extends j {
6946
+ class G extends Z {
7153
6947
  _parse(e) {
7154
6948
  return this._getType(e) === g.undefined ? M(void 0) : this._def.innerType._parse(e);
7155
6949
  }
@@ -7157,12 +6951,12 @@ class X extends j {
7157
6951
  return this._def.innerType;
7158
6952
  }
7159
6953
  }
7160
- X.create = (n, e) => new X({
6954
+ G.create = (n, e) => new G({
7161
6955
  innerType: n,
7162
6956
  typeName: k.ZodOptional,
7163
- ...S(e)
6957
+ ...O(e)
7164
6958
  });
7165
- class be extends j {
6959
+ class ke extends Z {
7166
6960
  _parse(e) {
7167
6961
  return this._getType(e) === g.null ? M(null) : this._def.innerType._parse(e);
7168
6962
  }
@@ -7170,12 +6964,12 @@ class be extends j {
7170
6964
  return this._def.innerType;
7171
6965
  }
7172
6966
  }
7173
- be.create = (n, e) => new be({
6967
+ ke.create = (n, e) => new ke({
7174
6968
  innerType: n,
7175
6969
  typeName: k.ZodNullable,
7176
- ...S(e)
6970
+ ...O(e)
7177
6971
  });
7178
- class St extends j {
6972
+ class St extends Z {
7179
6973
  _parse(e) {
7180
6974
  const { ctx: t } = this._processInputParams(e);
7181
6975
  let s = t.data;
@@ -7193,9 +6987,9 @@ St.create = (n, e) => new St({
7193
6987
  innerType: n,
7194
6988
  typeName: k.ZodDefault,
7195
6989
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
7196
- ...S(e)
6990
+ ...O(e)
7197
6991
  });
7198
- class Zt extends j {
6992
+ class Zt extends Z {
7199
6993
  _parse(e) {
7200
6994
  const { ctx: t } = this._processInputParams(e), s = {
7201
6995
  ...t,
@@ -7214,7 +7008,7 @@ class Zt extends j {
7214
7008
  status: "valid",
7215
7009
  value: a.status === "valid" ? a.value : this._def.catchValue({
7216
7010
  get error() {
7217
- return new U(s.common.issues);
7011
+ return new V(s.common.issues);
7218
7012
  },
7219
7013
  input: s.data
7220
7014
  })
@@ -7222,7 +7016,7 @@ class Zt extends j {
7222
7016
  status: "valid",
7223
7017
  value: r.status === "valid" ? r.value : this._def.catchValue({
7224
7018
  get error() {
7225
- return new U(s.common.issues);
7019
+ return new V(s.common.issues);
7226
7020
  },
7227
7021
  input: s.data
7228
7022
  })
@@ -7236,9 +7030,9 @@ Zt.create = (n, e) => new Zt({
7236
7030
  innerType: n,
7237
7031
  typeName: k.ZodCatch,
7238
7032
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
7239
- ...S(e)
7033
+ ...O(e)
7240
7034
  });
7241
- class Jt extends j {
7035
+ class qt extends Z {
7242
7036
  _parse(e) {
7243
7037
  if (this._getType(e) !== g.nan) {
7244
7038
  const s = this._getOrReturnCtx(e);
@@ -7251,12 +7045,12 @@ class Jt extends j {
7251
7045
  return { status: "valid", value: e.data };
7252
7046
  }
7253
7047
  }
7254
- Jt.create = (n) => new Jt({
7048
+ qt.create = (n) => new qt({
7255
7049
  typeName: k.ZodNaN,
7256
- ...S(n)
7050
+ ...O(n)
7257
7051
  });
7258
- const Ti = Symbol("zod_brand");
7259
- class hn extends j {
7052
+ const ui = Symbol("zod_brand");
7053
+ class pn extends Z {
7260
7054
  _parse(e) {
7261
7055
  const { ctx: t } = this._processInputParams(e), s = t.data;
7262
7056
  return this._def.type._parse({
@@ -7269,7 +7063,7 @@ class hn extends j {
7269
7063
  return this._def.type;
7270
7064
  }
7271
7065
  }
7272
- class It extends j {
7066
+ class Ct extends Z {
7273
7067
  _parse(e) {
7274
7068
  const { status: t, ctx: s } = this._processInputParams(e);
7275
7069
  if (s.common.async)
@@ -7302,14 +7096,14 @@ class It extends j {
7302
7096
  }
7303
7097
  }
7304
7098
  static create(e, t) {
7305
- return new It({
7099
+ return new Ct({
7306
7100
  in: e,
7307
7101
  out: t,
7308
7102
  typeName: k.ZodPipeline
7309
7103
  });
7310
7104
  }
7311
7105
  }
7312
- class jt extends j {
7106
+ class jt extends Z {
7313
7107
  _parse(e) {
7314
7108
  const t = this._def.innerType._parse(e), s = (r) => (mt(r) && (r.value = Object.freeze(r.value)), r);
7315
7109
  return _t(t) ? t.then((r) => s(r)) : s(t);
@@ -7321,9 +7115,9 @@ class jt extends j {
7321
7115
  jt.create = (n, e) => new jt({
7322
7116
  innerType: n,
7323
7117
  typeName: k.ZodReadonly,
7324
- ...S(e)
7118
+ ...O(e)
7325
7119
  });
7326
- function Bn(n, e = {}, t) {
7120
+ function zn(n, e = {}, t) {
7327
7121
  return n ? Je.create().superRefine((s, r) => {
7328
7122
  var a, o;
7329
7123
  if (!n(s)) {
@@ -7332,151 +7126,151 @@ function Bn(n, e = {}, t) {
7332
7126
  }
7333
7127
  }) : Je.create();
7334
7128
  }
7335
- const Oi = {
7336
- object: A.lazycreate
7129
+ const li = {
7130
+ object: E.lazycreate
7337
7131
  };
7338
7132
  var k;
7339
7133
  (function(n) {
7340
7134
  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";
7341
7135
  })(k || (k = {}));
7342
- const Si = (n, e = {
7136
+ const pi = (n, e = {
7343
7137
  message: `Input not instance of ${n.name}`
7344
- }) => Bn((t) => t instanceof n, e), Wn = z.create, qn = ve.create, Zi = Jt.create, ji = we.create, Jn = gt.create, Ni = Ce.create, Ii = Bt.create, Ci = yt.create, Ei = vt.create, Ai = Je.create, Ri = je.create, $i = oe.create, Pi = Wt.create, Di = W.create, Mi = A.create, Li = A.strictCreate, Vi = wt.create, Ui = Ht.create, Fi = kt.create, zi = se.create, Bi = bt.create, Wi = qt.create, qi = Ee.create, Ji = Fe.create, Ki = xt.create, Qi = Tt.create, Hi = ke.create, Yi = Ot.create, Gi = Ke.create, vn = J.create, Xi = X.create, eo = be.create, to = J.createWithPreprocess, no = It.create, so = () => Wn().optional(), ro = () => qn().optional(), ao = () => Jn().optional(), io = {
7138
+ }) => zn((t) => t instanceof n, e), Bn = z.create, Wn = ye.create, hi = qt.create, fi = ve.create, qn = gt.create, mi = Ce.create, _i = zt.create, gi = yt.create, yi = vt.create, vi = Je.create, wi = Ze.create, ki = ae.create, bi = Bt.create, xi = W.create, Ti = E.create, Oi = E.strictCreate, Si = wt.create, Zi = Kt.create, ji = kt.create, Ni = ne.create, Ci = bt.create, Ii = Wt.create, Ei = Ie.create, Ai = Fe.create, Ri = xt.create, $i = Tt.create, Pi = we.create, Di = Ot.create, Mi = Ke.create, yn = J.create, Li = G.create, Vi = ke.create, Ui = J.createWithPreprocess, Fi = Ct.create, zi = () => Bn().optional(), Bi = () => Wn().optional(), Wi = () => qn().optional(), qi = {
7345
7139
  string: (n) => z.create({ ...n, coerce: !0 }),
7346
- number: (n) => ve.create({ ...n, coerce: !0 }),
7140
+ number: (n) => ye.create({ ...n, coerce: !0 }),
7347
7141
  boolean: (n) => gt.create({
7348
7142
  ...n,
7349
7143
  coerce: !0
7350
7144
  }),
7351
- bigint: (n) => we.create({ ...n, coerce: !0 }),
7145
+ bigint: (n) => ve.create({ ...n, coerce: !0 }),
7352
7146
  date: (n) => Ce.create({ ...n, coerce: !0 })
7353
- }, oo = b;
7354
- var co = /* @__PURE__ */ Object.freeze({
7147
+ }, Ji = b;
7148
+ var Ki = /* @__PURE__ */ Object.freeze({
7355
7149
  __proto__: null,
7356
7150
  defaultErrorMap: qe,
7357
- setErrorMap: oi,
7358
- getErrorMap: Ut,
7359
- makeIssue: Ft,
7360
- EMPTY_PATH: ci,
7151
+ setErrorMap: Ja,
7152
+ getErrorMap: Vt,
7153
+ makeIssue: Ut,
7154
+ EMPTY_PATH: Ka,
7361
7155
  addIssueToContext: m,
7362
7156
  ParseStatus: P,
7363
7157
  INVALID: b,
7364
7158
  DIRTY: Ve,
7365
7159
  OK: M,
7366
- isAborted: an,
7367
- isDirty: on,
7160
+ isAborted: rn,
7161
+ isDirty: an,
7368
7162
  isValid: mt,
7369
7163
  isAsync: _t,
7370
7164
  get util() {
7371
- return I;
7165
+ return C;
7372
7166
  },
7373
7167
  get objectUtil() {
7374
- return rn;
7168
+ return sn;
7375
7169
  },
7376
7170
  ZodParsedType: g,
7377
- getParsedType: fe,
7378
- ZodType: j,
7379
- datetimeRegex: Fn,
7171
+ getParsedType: he,
7172
+ ZodType: Z,
7173
+ datetimeRegex: Un,
7380
7174
  ZodString: z,
7381
- ZodNumber: ve,
7382
- ZodBigInt: we,
7175
+ ZodNumber: ye,
7176
+ ZodBigInt: ve,
7383
7177
  ZodBoolean: gt,
7384
7178
  ZodDate: Ce,
7385
- ZodSymbol: Bt,
7179
+ ZodSymbol: zt,
7386
7180
  ZodUndefined: yt,
7387
7181
  ZodNull: vt,
7388
7182
  ZodAny: Je,
7389
- ZodUnknown: je,
7390
- ZodNever: oe,
7391
- ZodVoid: Wt,
7183
+ ZodUnknown: Ze,
7184
+ ZodNever: ae,
7185
+ ZodVoid: Bt,
7392
7186
  ZodArray: W,
7393
- ZodObject: A,
7187
+ ZodObject: E,
7394
7188
  ZodUnion: wt,
7395
- ZodDiscriminatedUnion: Ht,
7189
+ ZodDiscriminatedUnion: Kt,
7396
7190
  ZodIntersection: kt,
7397
- ZodTuple: se,
7191
+ ZodTuple: ne,
7398
7192
  ZodRecord: bt,
7399
- ZodMap: qt,
7400
- ZodSet: Ee,
7193
+ ZodMap: Wt,
7194
+ ZodSet: Ie,
7401
7195
  ZodFunction: Fe,
7402
7196
  ZodLazy: xt,
7403
7197
  ZodLiteral: Tt,
7404
- ZodEnum: ke,
7198
+ ZodEnum: we,
7405
7199
  ZodNativeEnum: Ot,
7406
7200
  ZodPromise: Ke,
7407
7201
  ZodEffects: J,
7408
7202
  ZodTransformer: J,
7409
- ZodOptional: X,
7410
- ZodNullable: be,
7203
+ ZodOptional: G,
7204
+ ZodNullable: ke,
7411
7205
  ZodDefault: St,
7412
7206
  ZodCatch: Zt,
7413
- ZodNaN: Jt,
7414
- BRAND: Ti,
7415
- ZodBranded: hn,
7416
- ZodPipeline: It,
7207
+ ZodNaN: qt,
7208
+ BRAND: ui,
7209
+ ZodBranded: pn,
7210
+ ZodPipeline: Ct,
7417
7211
  ZodReadonly: jt,
7418
- custom: Bn,
7419
- Schema: j,
7420
- ZodSchema: j,
7421
- late: Oi,
7212
+ custom: zn,
7213
+ Schema: Z,
7214
+ ZodSchema: Z,
7215
+ late: li,
7422
7216
  get ZodFirstPartyTypeKind() {
7423
7217
  return k;
7424
7218
  },
7425
- coerce: io,
7426
- any: Ai,
7427
- array: Di,
7428
- bigint: ji,
7429
- boolean: Jn,
7430
- date: Ni,
7431
- discriminatedUnion: Ui,
7432
- effect: vn,
7433
- enum: Hi,
7434
- function: Ji,
7435
- instanceof: Si,
7436
- intersection: Fi,
7437
- lazy: Ki,
7438
- literal: Qi,
7439
- map: Wi,
7440
- nan: Zi,
7441
- nativeEnum: Yi,
7442
- never: $i,
7443
- null: Ei,
7444
- nullable: eo,
7445
- number: qn,
7446
- object: Mi,
7447
- oboolean: ao,
7448
- onumber: ro,
7449
- optional: Xi,
7450
- ostring: so,
7451
- pipeline: no,
7452
- preprocess: to,
7453
- promise: Gi,
7454
- record: Bi,
7455
- set: qi,
7456
- strictObject: Li,
7457
- string: Wn,
7458
- symbol: Ii,
7459
- transformer: vn,
7460
- tuple: zi,
7461
- undefined: Ci,
7462
- union: Vi,
7463
- unknown: Ri,
7464
- void: Pi,
7465
- NEVER: oo,
7219
+ coerce: qi,
7220
+ any: vi,
7221
+ array: xi,
7222
+ bigint: fi,
7223
+ boolean: qn,
7224
+ date: mi,
7225
+ discriminatedUnion: Zi,
7226
+ effect: yn,
7227
+ enum: Pi,
7228
+ function: Ai,
7229
+ instanceof: pi,
7230
+ intersection: ji,
7231
+ lazy: Ri,
7232
+ literal: $i,
7233
+ map: Ii,
7234
+ nan: hi,
7235
+ nativeEnum: Di,
7236
+ never: ki,
7237
+ null: yi,
7238
+ nullable: Vi,
7239
+ number: Wn,
7240
+ object: Ti,
7241
+ oboolean: Wi,
7242
+ onumber: Bi,
7243
+ optional: Li,
7244
+ ostring: zi,
7245
+ pipeline: Fi,
7246
+ preprocess: Ui,
7247
+ promise: Mi,
7248
+ record: Ci,
7249
+ set: Ei,
7250
+ strictObject: Oi,
7251
+ string: Bn,
7252
+ symbol: _i,
7253
+ transformer: yn,
7254
+ tuple: Ni,
7255
+ undefined: gi,
7256
+ union: Si,
7257
+ unknown: wi,
7258
+ void: bi,
7259
+ NEVER: Ji,
7466
7260
  ZodIssueCode: h,
7467
- quotelessJson: ii,
7468
- ZodError: U
7261
+ quotelessJson: qa,
7262
+ ZodError: V
7469
7263
  });
7470
- ai(co);
7471
- function Ct(n, e = "", t = {}) {
7264
+ Wa(Ki);
7265
+ function It(n, e = "", t = {}) {
7472
7266
  for (let s in n)
7473
7267
  if (Object.prototype.hasOwnProperty.call(n, s)) {
7474
7268
  const r = e ? `${e}_${s}` : s;
7475
- typeof n[s] == "object" && n[s] !== null && !Array.isArray(n[s]) ? Ct(n[s], r, t) : t[r] = n[s];
7269
+ typeof n[s] == "object" && n[s] !== null && !Array.isArray(n[s]) ? It(n[s], r, t) : t[r] = n[s];
7476
7270
  }
7477
7271
  return t;
7478
7272
  }
7479
- function uo(n, e) {
7273
+ function Qi(n, e) {
7480
7274
  const t = {};
7481
7275
  for (const [s, r] of Object.entries(n)) {
7482
7276
  const a = e.find(
@@ -7494,99 +7288,96 @@ function uo(n, e) {
7494
7288
  }
7495
7289
  return t;
7496
7290
  }
7497
- function lo(n) {
7291
+ function Hi(n) {
7498
7292
  return async (e, t) => {
7499
7293
  const s = {
7500
- themeId: Re(),
7294
+ themeId: Ae(),
7501
7295
  ...t,
7502
7296
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
7503
7297
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
7504
7298
  };
7505
- return await n.insertInto("themes").values({ ...Ct(s), tenant_id: e }).execute(), s;
7299
+ return await n.insertInto("themes").values({ ...It(s), tenant_id: e }).execute(), s;
7506
7300
  };
7507
7301
  }
7508
- function po(n) {
7302
+ function Yi(n) {
7509
7303
  return async (e, t) => (await n.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
7510
7304
  }
7511
- function ho(n) {
7305
+ function Gi(n) {
7512
7306
  return async (e, t) => {
7513
7307
  const s = await n.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).selectAll().executeTakeFirst();
7514
7308
  return s ? R(s) : null;
7515
7309
  };
7516
7310
  }
7517
- function fo(n) {
7311
+ function Xi(n) {
7518
7312
  return async (e, t, s) => {
7519
- const r = Ct({
7313
+ const r = It({
7520
7314
  ...s,
7521
7315
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
7522
7316
  });
7523
7317
  return await n.updateTable("themes").set(r).where("themes.id", "=", t).where("themes.tenant_id", "=", e).execute(), !0;
7524
7318
  };
7525
7319
  }
7526
- function mo(n) {
7320
+ function eo(n) {
7527
7321
  return {
7528
- create: lo(n),
7529
- get: ho(n),
7530
- remove: po(n),
7531
- update: fo(n)
7322
+ create: Hi(n),
7323
+ get: Gi(n),
7324
+ remove: Yi(n),
7325
+ update: Xi(n)
7532
7326
  };
7533
7327
  }
7534
- function _o(n) {
7328
+ function to(n) {
7535
7329
  return async (e, t) => {
7536
7330
  const s = (/* @__PURE__ */ new Date()).toISOString(), r = await n.selectFrom("logins").where("logins.expires_at", ">", s).where("logins.login_id", "=", t).selectAll().executeTakeFirst();
7537
7331
  return r ? vr.parse(
7538
- uo(R(r), ["authParams"])
7332
+ Qi(R(r), ["authParams"])
7539
7333
  ) : null;
7540
7334
  };
7541
7335
  }
7542
- function go(n) {
7336
+ function no(n) {
7543
7337
  return async (e, t) => {
7544
7338
  const s = {
7545
- login_id: Re(),
7339
+ login_id: Ae(),
7546
7340
  ...t,
7547
7341
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
7548
7342
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
7549
7343
  };
7550
- return await n.insertInto("logins").values({ ...Ct(s), tenant_id: e }).execute(), s;
7344
+ return await n.insertInto("logins").values({ ...It(s), tenant_id: e }).execute(), s;
7551
7345
  };
7552
7346
  }
7553
- function yo(n) {
7554
- return async (e, t, s) => (await n.updateTable("logins").set(Ct(s)).where("logins.login_id", "=", t).where("logins.tenant_id", "=", e).execute()).length === 1;
7347
+ function so(n) {
7348
+ return async (e, t, s) => (await n.updateTable("logins").set(It(s)).where("logins.login_id", "=", t).where("logins.tenant_id", "=", e).execute()).length === 1;
7555
7349
  }
7556
- function vo(n) {
7350
+ function ro(n) {
7557
7351
  return async (e, t) => (await n.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", t).execute()).length > 0;
7558
7352
  }
7559
- function wo(n) {
7353
+ function ao(n) {
7560
7354
  return {
7561
- create: go(n),
7562
- get: _o(n),
7563
- update: yo(n),
7564
- remove: vo(n)
7355
+ create: no(n),
7356
+ get: to(n),
7357
+ update: so(n),
7358
+ remove: ro(n)
7565
7359
  };
7566
7360
  }
7567
- function bo(n) {
7361
+ function oo(n) {
7568
7362
  return {
7569
- applications: Ia(n),
7570
- authenticationCodes: Ha(n),
7571
- branding: Ja(n),
7572
- clients: Da(n),
7573
- codes: wa(n),
7574
- connections: Pa(n),
7575
- domains: Ba(n),
7576
- hooks: ni(n),
7577
- keys: Ua(n),
7578
- logins: wo(n),
7579
- logs: Yr(n),
7580
- OTP: la(n),
7581
- passwords: ma(n),
7582
- users: Lr(n),
7583
- sessions: sa(n),
7584
- tenants: qr(n),
7585
- themes: mo(n),
7586
- tickets: oa(n),
7587
- universalLoginSessions: Ta(n)
7363
+ applications: va(n),
7364
+ branding: Pa(n),
7365
+ clients: Sa(n),
7366
+ codes: ha(n),
7367
+ connections: Oa(n),
7368
+ domains: Aa(n),
7369
+ hooks: Fa(n),
7370
+ keys: Ca(n),
7371
+ logins: ao(n),
7372
+ logs: Kr(n),
7373
+ passwords: ca(n),
7374
+ users: Pr(n),
7375
+ sessions: ea(n),
7376
+ tenants: zr(n),
7377
+ themes: eo(n),
7378
+ tickets: ra(n)
7588
7379
  };
7589
7380
  }
7590
7381
  export {
7591
- bo as default
7382
+ oo as default
7592
7383
  };