@authhero/kysely-adapter 0.7.3 → 0.7.4

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,6 +1,6 @@
1
- var Yn = Object.defineProperty;
2
- var Gn = (n, e, t) => e in n ? Yn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var Yt = (n, e, t) => Gn(n, typeof e != "symbol" ? e + "" : e, t);
1
+ var Qn = Object.defineProperty;
2
+ var Hn = (n, e, t) => e in n ? Qn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var Yt = (n, e, t) => Hn(n, typeof e != "symbol" ? e + "" : e, t);
4
4
  var Et = 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 });
@@ -17,7 +17,7 @@ var Et = class extends Error {
17
17
  });
18
18
  }
19
19
  };
20
- function Xn(n) {
20
+ function Yn(n) {
21
21
  return async (e, t) => {
22
22
  const { identities: s, ...r } = t, a = {
23
23
  ...r,
@@ -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 es(n, e) {
50
+ function Gn(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 es(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 ts(n, e) {
58
+ function Xn(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,15 +66,15 @@ function Qe(n, e) {
66
66
  return r._def.openapi = this._def.openapi, r;
67
67
  };
68
68
  }
69
- function ns(n) {
69
+ function es(n) {
70
70
  if (typeof n.ZodType.prototype.openapi < "u")
71
71
  return;
72
72
  n.ZodType.prototype.openapi = function(r, a) {
73
73
  var o, c, d, u, l, T;
74
- const C = typeof r == "string" ? a : r, L = C ?? {}, { param: J } = L, re = es(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 || J ? {
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), J)
74
+ const C = typeof r == "string" ? a : r, L = C ?? {}, { param: K } = L, re = Gn(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
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 (ts(this, "ZodObject")) {
77
+ if (Xn(this, "ZodObject")) {
78
78
  const $e = this.extend;
79
79
  ue.extend = function(...Pe) {
80
80
  var Q, H, Y, le, Te, Oe;
@@ -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 nn;
148
+ var en;
149
149
  (function(n) {
150
150
  n.mergeShapes = (e, t) => ({
151
151
  ...e,
152
152
  ...t
153
153
  // second overwrites first
154
154
  });
155
- })(nn || (nn = {}));
155
+ })(en || (en = {}));
156
156
  const _ = N.arrayToEnum([
157
157
  "string",
158
158
  "nan",
@@ -212,7 +212,7 @@ const _ = N.arrayToEnum([
212
212
  "invalid_intersection_types",
213
213
  "not_multiple_of",
214
214
  "not_finite"
215
- ]), ss = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
215
+ ]), ts = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
216
216
  class V extends Error {
217
217
  constructor(e) {
218
218
  super(), this.issues = [], this.addIssue = (s) => {
@@ -329,12 +329,12 @@ const ze = (n, e) => {
329
329
  }
330
330
  return { message: t };
331
331
  };
332
- let xn = ze;
333
- function rs(n) {
334
- xn = n;
332
+ let kn = ze;
333
+ function ns(n) {
334
+ kn = n;
335
335
  }
336
336
  function At() {
337
- return xn;
337
+ return kn;
338
338
  }
339
339
  const Rt = (n) => {
340
340
  const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
@@ -356,7 +356,7 @@ const Rt = (n) => {
356
356
  path: a,
357
357
  message: c
358
358
  };
359
- }, as = [];
359
+ }, ss = [];
360
360
  function f(n, e) {
361
361
  const t = At(), s = Rt({
362
362
  issueData: e,
@@ -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 }), sn = (n) => n.status === "aborted", rn = (n) => n.status === "dirty", tt = (n) => n.status === "valid", nt = (n) => typeof Promise < "u" && n instanceof Promise;
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
419
  function Pt(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 Tn(n, e, t, s, r) {
423
+ function bn(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
  }
@@ -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 gn = (n, e) => {
440
+ const mn = (n, e) => {
441
441
  if (tt(e))
442
442
  return { success: !0, data: e.value };
443
443
  if (!n.common.issues.length)
@@ -527,7 +527,7 @@ class Z {
527
527
  data: e,
528
528
  parsedType: he(e)
529
529
  }, a = this._parseSync({ data: e, path: r.path, parent: r });
530
- return gn(r, a);
530
+ return mn(r, a);
531
531
  }
532
532
  async parseAsync(e, t) {
533
533
  const s = await this.safeParseAsync(e, t);
@@ -548,7 +548,7 @@ class Z {
548
548
  data: e,
549
549
  parsedType: he(e)
550
550
  }, r = this._parse({ data: e, path: s.path, parent: s }), a = await (nt(r) ? r : Promise.resolve(r));
551
- return gn(s, a);
551
+ return mn(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;
@@ -612,7 +612,7 @@ class Z {
612
612
  });
613
613
  }
614
614
  brand() {
615
- return new ln({
615
+ return new dn({
616
616
  typeName: w.ZodBranded,
617
617
  type: this,
618
618
  ...O(this._def)
@@ -647,23 +647,23 @@ class Z {
647
647
  return this.safeParse(null).success;
648
648
  }
649
649
  }
650
- const is = /^c[^\s-]{8,}$/i, os = /^[0-9a-z]+$/, cs = /^[0-9A-HJKMNP-TV-Z]{26}$/, ds = /^[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, us = /^[a-z0-9_-]{21}$/i, ls = /^[-+]?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)?)??$/, ps = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, hs = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
650
+ const rs = /^c[^\s-]{8,}$/i, as = /^[0-9a-z]+$/, is = /^[0-9A-HJKMNP-TV-Z]{26}$/, os = /^[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, cs = /^[a-z0-9_-]{21}$/i, ds = /^[-+]?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)?)??$/, us = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ls = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
651
651
  let Gt;
652
- const fs = /^(?:(?: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])$/, ms = /^(([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})))$/, _s = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, On = "((\\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])))", gs = new RegExp(`^${On}$`);
653
- function Sn(n) {
652
+ const ps = /^(?:(?: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])$/, hs = /^(([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})))$/, fs = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, xn = "((\\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])))", ms = new RegExp(`^${xn}$`);
653
+ function Tn(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 ys(n) {
658
- return new RegExp(`^${Sn(n)}$`);
657
+ function _s(n) {
658
+ return new RegExp(`^${Tn(n)}$`);
659
659
  }
660
- function Zn(n) {
661
- let e = `${On}T${Sn(n)}`;
660
+ function On(n) {
661
+ let e = `${xn}T${Tn(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 vs(n, e) {
666
- return !!((e === "v4" || !e) && fs.test(n) || (e === "v6" || !e) && ms.test(n));
665
+ function gs(n, e) {
666
+ return !!((e === "v4" || !e) && ps.test(n) || (e === "v6" || !e) && hs.test(n));
667
667
  }
668
668
  class F extends Z {
669
669
  _parse(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
- ps.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
717
+ us.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(hs, "u")), Gt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
723
+ Gt || (Gt = new RegExp(ls, "u")), Gt.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
- ds.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
729
+ os.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
- us.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
735
+ cs.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
- is.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
741
+ rs.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
- os.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
747
+ as.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
- cs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
753
+ is.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" ? Zn(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
784
+ }), t.dirty()) : r.kind === "datetime" ? On(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" ? gs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
788
+ }), t.dirty()) : r.kind === "date" ? ms.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" ? ys(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
792
+ }), t.dirty()) : r.kind === "time" ? _s(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" ? ls.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
796
+ }), t.dirty()) : r.kind === "duration" ? ds.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" ? vs(e.data, r.version) || (s = this._getOrReturnCtx(e, s), f(s, {
800
+ }), t.dirty()) : r.kind === "ip" ? gs(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" ? _s.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
804
+ }), t.dirty()) : r.kind === "base64" ? fs.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
@@ -1023,7 +1023,7 @@ F.create = (n) => {
1023
1023
  ...O(n)
1024
1024
  });
1025
1025
  };
1026
- function ws(n, e) {
1026
+ function ys(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
  }
@@ -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" ? ws(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), f(t, {
1065
+ }), s.dirty()) : r.kind === "multipleOf" ? ys(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
@@ -1881,7 +1881,7 @@ class E extends Z {
1881
1881
  });
1882
1882
  }
1883
1883
  keyof() {
1884
- return jn(N.objectKeys(this.shape));
1884
+ return Sn(N.objectKeys(this.shape));
1885
1885
  }
1886
1886
  }
1887
1887
  E.create = (n, e) => new E({
@@ -1978,8 +1978,8 @@ it.create = (n, e) => new it({
1978
1978
  typeName: w.ZodUnion,
1979
1979
  ...O(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 ln || n instanceof ft ? pe(n.unwrap()) : n instanceof ht ? pe(n._def.innerType) : [];
1982
- class Jt extends Z {
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 {
1983
1983
  _parse(e) {
1984
1984
  const { ctx: t } = this._processInputParams(e);
1985
1985
  if (t.parsedType !== _.object)
@@ -2032,7 +2032,7 @@ class Jt extends Z {
2032
2032
  r.set(c, a);
2033
2033
  }
2034
2034
  }
2035
- return new Jt({
2035
+ return new Kt({
2036
2036
  typeName: w.ZodDiscriminatedUnion,
2037
2037
  discriminator: e,
2038
2038
  options: t,
@@ -2041,14 +2041,14 @@ class Jt extends Z {
2041
2041
  });
2042
2042
  }
2043
2043
  }
2044
- function an(n, e) {
2044
+ function sn(n, e) {
2045
2045
  const t = he(n), s = he(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 = an(n[c], e[c]);
2051
+ const d = sn(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 an(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 = an(o, c);
2062
+ const o = n[a], c = e[a], d = sn(o, c);
2063
2063
  if (!d.valid)
2064
2064
  return { valid: !1 };
2065
2065
  r.push(d.data);
@@ -2070,10 +2070,10 @@ function an(n, e) {
2070
2070
  class ot extends Z {
2071
2071
  _parse(e) {
2072
2072
  const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
2073
- if (sn(a) || sn(o))
2073
+ if (tn(a) || tn(o))
2074
2074
  return x;
2075
- const c = an(a.value, o.value);
2076
- return c.valid ? ((rn(a) || rn(o)) && t.dirty(), { status: t.value, value: c.data }) : (f(s, {
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, {
2077
2077
  code: p.invalid_intersection_types
2078
2078
  }), x);
2079
2079
  };
@@ -2444,7 +2444,7 @@ ut.create = (n, e) => new ut({
2444
2444
  typeName: w.ZodLiteral,
2445
2445
  ...O(e)
2446
2446
  });
2447
- function jn(n, e) {
2447
+ function Sn(n, e) {
2448
2448
  return new ge({
2449
2449
  values: n,
2450
2450
  typeName: w.ZodEnum,
@@ -2464,7 +2464,7 @@ class ge extends Z {
2464
2464
  code: p.invalid_type
2465
2465
  }), x;
2466
2466
  }
2467
- if (Pt(this, Ye) || Tn(this, Ye, new Set(this._def.values)), !Pt(this, Ye).has(e.data)) {
2467
+ if (Pt(this, Ye) || bn(this, Ye, new Set(this._def.values)), !Pt(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,
@@ -2509,7 +2509,7 @@ class ge extends Z {
2509
2509
  }
2510
2510
  }
2511
2511
  Ye = /* @__PURE__ */ new WeakMap();
2512
- ge.create = jn;
2512
+ ge.create = Sn;
2513
2513
  class lt extends Z {
2514
2514
  constructor() {
2515
2515
  super(...arguments), Ge.set(this, void 0);
@@ -2524,7 +2524,7 @@ class lt extends Z {
2524
2524
  code: p.invalid_type
2525
2525
  }), x;
2526
2526
  }
2527
- if (Pt(this, Ge) || Tn(this, Ge, new Set(N.getValidEnumValues(this._def.values))), !Pt(this, Ge).has(e.data)) {
2527
+ if (Pt(this, Ge) || bn(this, Ge, new Set(N.getValidEnumValues(this._def.values))), !Pt(this, Ge).has(e.data)) {
2528
2528
  const r = N.objectValues(t);
2529
2529
  return f(s, {
2530
2530
  received: s.data,
@@ -2763,8 +2763,8 @@ Vt.create = (n) => new Vt({
2763
2763
  typeName: w.ZodNaN,
2764
2764
  ...O(n)
2765
2765
  });
2766
- const ks = Symbol("zod_brand");
2767
- class ln extends Z {
2766
+ const vs = Symbol("zod_brand");
2767
+ class dn extends Z {
2768
2768
  _parse(e) {
2769
2769
  const { ctx: t } = this._processInputParams(e), s = t.data;
2770
2770
  return this._def.type._parse({
@@ -2831,7 +2831,7 @@ ft.create = (n, e) => new ft({
2831
2831
  typeName: w.ZodReadonly,
2832
2832
  ...O(e)
2833
2833
  });
2834
- function Nn(n, e = {}, t) {
2834
+ function Zn(n, e = {}, t) {
2835
2835
  return n ? Be.create().superRefine((s, r) => {
2836
2836
  var a, o;
2837
2837
  if (!n(s)) {
@@ -2840,16 +2840,16 @@ function Nn(n, e = {}, t) {
2840
2840
  }
2841
2841
  }) : Be.create();
2842
2842
  }
2843
- const bs = {
2843
+ const ws = {
2844
2844
  object: E.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 xs = (n, e = {
2850
+ const ks = (n, e = {
2851
2851
  message: `Input not instance of ${n.name}`
2852
- }) => Nn((t) => t instanceof n, e), In = F.create, Cn = me.create, Ts = Vt.create, Os = _e.create, En = st.create, Ss = Ne.create, Zs = Dt.create, js = rt.create, Ns = at.create, Is = Be.create, Cs = Ze.create, Es = ie.create, As = Mt.create, Rs = B.create, $s = E.create, Ps = E.strictCreate, Ds = it.create, Ms = Jt.create, Ls = ot.create, Vs = te.create, Us = ct.create, Fs = Lt.create, zs = Ie.create, Bs = Ue.create, Ws = dt.create, qs = ut.create, Ks = ge.create, Js = lt.create, Qs = We.create, yn = q.create, Hs = G.create, Ys = ye.create, Gs = q.createWithPreprocess, Xs = Nt.create, er = () => In().optional(), tr = () => Cn().optional(), nr = () => En().optional(), sr = {
2852
+ }) => Zn((t) => t instanceof n, e), jn = F.create, Nn = me.create, bs = Vt.create, xs = _e.create, In = st.create, Ts = Ne.create, Os = Dt.create, Ss = rt.create, Zs = at.create, js = Be.create, Ns = Ze.create, Is = ie.create, Cs = Mt.create, Es = B.create, As = E.create, Rs = E.strictCreate, $s = it.create, Ps = Kt.create, Ds = ot.create, Ms = te.create, Ls = ct.create, Vs = Lt.create, Us = Ie.create, Fs = Ue.create, zs = dt.create, Bs = ut.create, Ws = ge.create, qs = lt.create, Js = We.create, _n = q.create, Ks = G.create, Qs = ye.create, Hs = q.createWithPreprocess, Ys = Nt.create, Gs = () => jn().optional(), Xs = () => Nn().optional(), er = () => In().optional(), tr = {
2853
2853
  string: (n) => F.create({ ...n, coerce: !0 }),
2854
2854
  number: (n) => me.create({ ...n, coerce: !0 }),
2855
2855
  boolean: (n) => st.create({
@@ -2858,33 +2858,33 @@ const xs = (n, e = {
2858
2858
  }),
2859
2859
  bigint: (n) => _e.create({ ...n, coerce: !0 }),
2860
2860
  date: (n) => Ne.create({ ...n, coerce: !0 })
2861
- }, rr = x;
2861
+ }, nr = x;
2862
2862
  var i = /* @__PURE__ */ Object.freeze({
2863
2863
  __proto__: null,
2864
2864
  defaultErrorMap: ze,
2865
- setErrorMap: rs,
2865
+ setErrorMap: ns,
2866
2866
  getErrorMap: At,
2867
2867
  makeIssue: Rt,
2868
- EMPTY_PATH: as,
2868
+ EMPTY_PATH: ss,
2869
2869
  addIssueToContext: f,
2870
2870
  ParseStatus: $,
2871
2871
  INVALID: x,
2872
2872
  DIRTY: $t,
2873
2873
  OK: D,
2874
- isAborted: sn,
2875
- isDirty: rn,
2874
+ isAborted: tn,
2875
+ isDirty: nn,
2876
2876
  isValid: tt,
2877
2877
  isAsync: nt,
2878
2878
  get util() {
2879
2879
  return N;
2880
2880
  },
2881
2881
  get objectUtil() {
2882
- return nn;
2882
+ return en;
2883
2883
  },
2884
2884
  ZodParsedType: _,
2885
2885
  getParsedType: he,
2886
2886
  ZodType: Z,
2887
- datetimeRegex: Zn,
2887
+ datetimeRegex: On,
2888
2888
  ZodString: F,
2889
2889
  ZodNumber: me,
2890
2890
  ZodBigInt: _e,
@@ -2900,7 +2900,7 @@ var i = /* @__PURE__ */ Object.freeze({
2900
2900
  ZodArray: B,
2901
2901
  ZodObject: E,
2902
2902
  ZodUnion: it,
2903
- ZodDiscriminatedUnion: Jt,
2903
+ ZodDiscriminatedUnion: Kt,
2904
2904
  ZodIntersection: ot,
2905
2905
  ZodTuple: te,
2906
2906
  ZodRecord: ct,
@@ -2919,72 +2919,72 @@ var i = /* @__PURE__ */ Object.freeze({
2919
2919
  ZodDefault: pt,
2920
2920
  ZodCatch: ht,
2921
2921
  ZodNaN: Vt,
2922
- BRAND: ks,
2923
- ZodBranded: ln,
2922
+ BRAND: vs,
2923
+ ZodBranded: dn,
2924
2924
  ZodPipeline: Nt,
2925
2925
  ZodReadonly: ft,
2926
- custom: Nn,
2926
+ custom: Zn,
2927
2927
  Schema: Z,
2928
2928
  ZodSchema: Z,
2929
- late: bs,
2929
+ late: ws,
2930
2930
  get ZodFirstPartyTypeKind() {
2931
2931
  return w;
2932
2932
  },
2933
- coerce: sr,
2934
- any: Is,
2935
- array: Rs,
2936
- bigint: Os,
2937
- boolean: En,
2938
- date: Ss,
2939
- discriminatedUnion: Ms,
2940
- effect: yn,
2941
- enum: Ks,
2942
- function: Bs,
2943
- instanceof: xs,
2944
- intersection: Ls,
2945
- lazy: Ws,
2946
- literal: qs,
2947
- map: Fs,
2948
- nan: Ts,
2949
- nativeEnum: Js,
2950
- never: Es,
2951
- null: Ns,
2952
- nullable: Ys,
2953
- number: Cn,
2954
- object: $s,
2955
- oboolean: nr,
2956
- onumber: tr,
2957
- optional: Hs,
2958
- ostring: er,
2959
- pipeline: Xs,
2960
- preprocess: Gs,
2961
- promise: Qs,
2962
- record: Us,
2963
- set: zs,
2964
- strictObject: Ps,
2965
- string: In,
2966
- symbol: Zs,
2967
- transformer: yn,
2968
- tuple: Vs,
2969
- undefined: js,
2970
- union: Ds,
2971
- unknown: Cs,
2972
- void: As,
2973
- NEVER: rr,
2933
+ coerce: tr,
2934
+ any: js,
2935
+ array: Es,
2936
+ bigint: xs,
2937
+ boolean: In,
2938
+ date: Ts,
2939
+ discriminatedUnion: Ps,
2940
+ effect: _n,
2941
+ enum: Ws,
2942
+ function: Fs,
2943
+ instanceof: ks,
2944
+ intersection: Ds,
2945
+ lazy: zs,
2946
+ literal: Bs,
2947
+ map: Vs,
2948
+ nan: bs,
2949
+ nativeEnum: qs,
2950
+ never: Is,
2951
+ null: Zs,
2952
+ nullable: Qs,
2953
+ number: Nn,
2954
+ object: As,
2955
+ oboolean: er,
2956
+ onumber: Xs,
2957
+ optional: Ks,
2958
+ ostring: Gs,
2959
+ pipeline: Ys,
2960
+ preprocess: Hs,
2961
+ promise: Js,
2962
+ record: Ls,
2963
+ set: Us,
2964
+ strictObject: Rs,
2965
+ string: jn,
2966
+ symbol: Os,
2967
+ transformer: _n,
2968
+ tuple: Ms,
2969
+ undefined: Ss,
2970
+ union: $s,
2971
+ unknown: Ns,
2972
+ void: Cs,
2973
+ NEVER: nr,
2974
2974
  ZodIssueCode: p,
2975
- quotelessJson: ss,
2975
+ quotelessJson: ts,
2976
2976
  ZodError: V
2977
2977
  });
2978
- ns(i);
2978
+ es(i);
2979
2979
  i.object({
2980
2980
  start: i.number(),
2981
2981
  limit: i.number(),
2982
2982
  length: i.number()
2983
2983
  });
2984
- const pn = i.object({
2984
+ const un = i.object({
2985
2985
  created_at: i.string(),
2986
2986
  updated_at: i.string()
2987
- }), ar = i.object({
2987
+ }), sr = 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 pn = 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()), ir = i.object({
2996
+ }).catchall(i.any()), rr = i.object({
2997
2997
  connection: i.string(),
2998
2998
  user_id: i.string(),
2999
2999
  provider: i.string(),
@@ -3001,8 +3001,8 @@ const pn = 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: ar.optional()
3005
- }), An = i.object({
3004
+ profileData: sr.optional()
3005
+ }), Cn = 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 pn = i.object({
3014
3014
  linked_to: i.string().optional(),
3015
3015
  profileData: i.string().optional(),
3016
3016
  user_id: i.string().optional()
3017
- }), or = An.extend({
3017
+ }), ar = Cn.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 pn = i.object({
3023
3023
  provider: i.string().default("email"),
3024
3024
  connection: i.string().default("email")
3025
3025
  });
3026
- or.extend(pn.shape).extend({
3026
+ ar.extend(un.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(ir).optional()
3032
+ identities: i.array(rr).optional()
3033
3033
  });
3034
- An.extend({
3034
+ Cn.extend({
3035
3035
  email: i.string(),
3036
3036
  login_count: i.number(),
3037
3037
  multifactor: i.array(i.string()).optional(),
@@ -3039,27 +3039,24 @@ An.extend({
3039
3039
  last_login: i.string().optional(),
3040
3040
  user_id: i.string()
3041
3041
  }).catchall(i.any());
3042
- const cr = i.object({
3042
+ const ir = i.object({
3043
3043
  id: i.string(),
3044
3044
  name: i.string(),
3045
- callbacks: i.string().transform((n) => n === null ? "" : n).default("").openapi({
3045
+ callbacks: i.array(i.string()).openapi({
3046
3046
  description: "Comma-separated list of URLs whitelisted to use as a callback to the client after authentication."
3047
3047
  }),
3048
- allowed_origins: i.string().transform((n) => n === null ? "" : n).default("").openapi({
3048
+ allowed_origins: i.array(i.string()).openapi({
3049
3049
  description: "Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level. Query strings and hash information are not taken into account when validating these URLs."
3050
3050
  }),
3051
- web_origins: i.string().transform((n) => n === null ? "" : n).default("").openapi({
3051
+ web_origins: i.array(i.string()).openapi({
3052
3052
  description: "Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode."
3053
3053
  }),
3054
- allowed_logout_urls: i.string().transform((n) => n === null ? "" : n).default("").openapi({
3054
+ allowed_logout_urls: i.array(i.string()).openapi({
3055
3055
  description: "Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."
3056
3056
  }),
3057
3057
  addons: i.record(i.string(), i.record(i.string(), i.union([i.string(), i.number()]))).optional().openapi({
3058
3058
  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."
3059
3059
  }),
3060
- // @deprecated. Renamed to match the auth0 API
3061
- allowed_web_origins: i.string().transform((n) => n === null ? "" : n).default(""),
3062
- allowed_callback_urls: i.string().transform((n) => n === null ? "" : n).default(""),
3063
3060
  email_validation: i.enum(["enabled", "disabled", "enforced"]).default("enforced").openapi({
3064
3061
  description: "Defines if it possible to sign in with an unverified email and if verification emails will be sent. This is not available in auth0"
3065
3062
  }),
@@ -3067,23 +3064,22 @@ const cr = i.object({
3067
3064
  disable_sign_ups: i.boolean().default(!1).openapi({
3068
3065
  description: "Prevents users from signing up using the hosted login page. This is not available in auth0"
3069
3066
  })
3070
- });
3071
- i.object({
3067
+ }), or = i.object({
3072
3068
  created_at: i.string().transform((n) => n === null ? "" : n),
3073
3069
  updated_at: i.string().transform((n) => n === null ? "" : n)
3074
- }).extend(cr.shape);
3075
- var Rn = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(Rn || {}), $n = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n.SAML_POST = "saml_post", n))($n || {}), Pn = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))(Pn || {});
3070
+ }).extend(ir.shape);
3071
+ var En = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(En || {}), An = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n.SAML_POST = "saml_post", n))(An || {}), Rn = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))(Rn || {});
3076
3072
  const Qt = i.object({
3077
3073
  client_id: i.string(),
3078
3074
  vendor_id: i.string().optional(),
3079
- response_type: i.nativeEnum(Rn).optional(),
3080
- response_mode: i.nativeEnum($n).optional(),
3075
+ response_type: i.nativeEnum(En).optional(),
3076
+ response_mode: i.nativeEnum(An).optional(),
3081
3077
  redirect_uri: i.string().optional(),
3082
3078
  audience: i.string().optional(),
3083
3079
  state: i.string().optional(),
3084
3080
  nonce: i.string().optional(),
3085
3081
  scope: i.string().optional(),
3086
- code_challenge_method: i.nativeEnum(Pn).optional(),
3082
+ code_challenge_method: i.nativeEnum(Rn).optional(),
3087
3083
  code_challenge: i.string().optional(),
3088
3084
  username: i.string().optional()
3089
3085
  });
@@ -3103,7 +3099,7 @@ i.object({
3103
3099
  url: i.string()
3104
3100
  }).optional()
3105
3101
  });
3106
- const dr = i.object({
3102
+ const cr = i.object({
3107
3103
  id: i.string().optional(),
3108
3104
  name: i.string(),
3109
3105
  client_id: i.string().optional(),
@@ -3118,31 +3114,19 @@ const dr = i.object({
3118
3114
  token_exchange_basic_auth: i.boolean().optional(),
3119
3115
  userinfo_endpoint: i.string().optional(),
3120
3116
  scope: i.string().optional()
3121
- }), hn = i.object({
3117
+ }), ln = i.object({
3122
3118
  id: i.string(),
3123
3119
  created_at: i.string().transform((n) => n === null ? "" : n),
3124
3120
  updated_at: i.string().transform((n) => n === null ? "" : n)
3125
- }).extend(dr.shape), ur = i.object({
3121
+ }).extend(cr.shape), dr = i.object({
3126
3122
  domain: i.string(),
3127
3123
  dkim_private_key: i.string().optional(),
3128
3124
  dkim_public_key: i.string().optional(),
3129
3125
  email_api_key: i.string().optional(),
3130
3126
  email_service: i.union([i.literal("mailgun"), i.literal("mailchannels")]).optional()
3131
- }), Dn = i.object({
3132
- id: i.string(),
3133
- name: i.string(),
3134
- domains: i.array(ur),
3135
- allowed_callback_urls: i.array(i.string()),
3136
- allowed_logout_urls: i.array(i.string()),
3137
- allowed_web_origins: i.array(i.string()),
3138
- email_validation: i.union([
3139
- i.literal("enabled"),
3140
- i.literal("disabled"),
3141
- i.literal("enforced")
3142
- ]),
3143
- tenant_id: i.string(),
3144
- client_secret: i.string(),
3145
- disable_sign_ups: i.boolean(),
3127
+ }), $n = i.object({
3128
+ ...or.shape,
3129
+ domains: i.array(dr),
3146
3130
  tenant: i.object({
3147
3131
  name: i.string(),
3148
3132
  audience: i.string().optional(),
@@ -3155,44 +3139,44 @@ const dr = i.object({
3155
3139
  language: i.string().length(2).optional()
3156
3140
  })
3157
3141
  });
3158
- Dn.extend({
3159
- connections: i.array(hn)
3142
+ $n.extend({
3143
+ connections: i.array(ln)
3160
3144
  });
3161
- Dn.extend({
3162
- connections: i.array(hn.partial())
3145
+ $n.extend({
3146
+ connections: i.array(ln.partial())
3163
3147
  });
3164
- const lr = i.enum([
3148
+ const ur = i.enum([
3165
3149
  "password_reset",
3166
3150
  "email_verification",
3167
3151
  "otp",
3168
3152
  "oauth2",
3169
3153
  "oauth2_state",
3170
3154
  "ticket"
3171
- ]), pr = i.object({
3155
+ ]), lr = i.object({
3172
3156
  code_id: i.string().openapi({
3173
3157
  description: "The code that will be used in for instance an email verification flow"
3174
3158
  }),
3175
3159
  login_id: i.string().openapi({
3176
3160
  description: "The id of the login session that the code is connected to"
3177
3161
  }),
3178
- code_type: lr,
3162
+ code_type: ur,
3179
3163
  expires_at: i.string(),
3180
3164
  used_at: i.string().optional()
3181
- }), hr = i.object({
3182
- ...pr.shape,
3165
+ }), pr = i.object({
3166
+ ...lr.shape,
3183
3167
  created_at: i.string()
3184
- }), fr = i.object({
3168
+ }), hr = i.object({
3185
3169
  domain: i.string(),
3186
3170
  dkim_private_key: i.string().optional(),
3187
3171
  dkim_public_key: i.string().optional(),
3188
3172
  email_api_key: i.string().optional(),
3189
3173
  email_service: i.enum(["mailgun", "mailchannels"])
3190
3174
  });
3191
- pn.extend({
3192
- ...fr.shape,
3175
+ un.extend({
3176
+ ...hr.shape,
3193
3177
  id: i.string()
3194
3178
  });
3195
- const mr = i.object({
3179
+ const fr = i.object({
3196
3180
  trigger_id: i.enum([
3197
3181
  "pre-user-signup",
3198
3182
  "post-user-registration",
@@ -3204,11 +3188,11 @@ const mr = i.object({
3204
3188
  synchronous: i.boolean().default(!1),
3205
3189
  priority: i.number().optional()
3206
3190
  });
3207
- mr.extend({
3208
- ...pn.shape,
3191
+ fr.extend({
3192
+ ...un.shape,
3209
3193
  hook_id: i.string()
3210
3194
  });
3211
- const _r = i.object({
3195
+ const mr = i.object({
3212
3196
  alg: i.string(),
3213
3197
  e: i.string(),
3214
3198
  kid: i.string(),
@@ -3217,7 +3201,7 @@ const _r = i.object({
3217
3201
  use: i.string().optional()
3218
3202
  });
3219
3203
  i.object({
3220
- keys: i.array(_r)
3204
+ keys: i.array(mr)
3221
3205
  });
3222
3206
  i.object({
3223
3207
  issuer: i.string(),
@@ -3241,7 +3225,7 @@ i.object({
3241
3225
  request_parameter_supported: i.boolean(),
3242
3226
  token_endpoint_auth_signing_alg_values_supported: i.array(i.string())
3243
3227
  });
3244
- const gr = i.object({
3228
+ const _r = i.object({
3245
3229
  auth0Client: i.string().optional(),
3246
3230
  authParams: Qt,
3247
3231
  expires_at: i.string(),
@@ -3249,14 +3233,14 @@ const gr = i.object({
3249
3233
  ip: i.string().optional()
3250
3234
  }).openapi({
3251
3235
  description: "This represents a login sesion"
3252
- }), yr = i.object({
3253
- ...gr.shape,
3236
+ }), gr = i.object({
3237
+ ..._r.shape,
3254
3238
  login_id: i.string().openapi({
3255
3239
  description: "This is is used as the state in the universal login"
3256
3240
  }),
3257
3241
  created_at: i.string(),
3258
3242
  updated_at: i.string()
3259
- }), vr = i.enum([
3243
+ }), yr = i.enum([
3260
3244
  "cls",
3261
3245
  // CODE_LINK_SENT
3262
3246
  "fsa",
@@ -3305,7 +3289,7 @@ const gr = i.object({
3305
3289
  // SUCCESS_VERIFICATION_EMAIL
3306
3290
  "svr"
3307
3291
  // SUCCESS_VERIFICATION_EMAIL_REQUEST
3308
- ]), wr = i.object({
3292
+ ]), vr = i.object({
3309
3293
  name: i.string(),
3310
3294
  version: i.string(),
3311
3295
  env: i.object({
@@ -3313,7 +3297,7 @@ const gr = i.object({
3313
3297
  }).optional()
3314
3298
  });
3315
3299
  i.object({
3316
- type: vr,
3300
+ type: yr,
3317
3301
  date: i.string(),
3318
3302
  description: i.string().optional(),
3319
3303
  log_id: i.string().optional(),
@@ -3334,19 +3318,19 @@ i.object({
3334
3318
  strategy: i.string().optional(),
3335
3319
  strategy_type: i.string().optional(),
3336
3320
  hostname: i.string().optional(),
3337
- auth0_client: wr.optional()
3321
+ auth0_client: vr.optional()
3338
3322
  });
3339
- const kr = i.object({
3323
+ const wr = i.object({
3340
3324
  user_id: i.string(),
3341
3325
  password: i.string(),
3342
3326
  algorithm: i.enum(["bcrypt", "argon2id"]).default("argon2id")
3343
3327
  });
3344
3328
  i.object({
3345
- ...kr.shape,
3329
+ ...wr.shape,
3346
3330
  created_at: i.string(),
3347
3331
  updated_at: i.string()
3348
3332
  });
3349
- const br = i.object({
3333
+ const kr = i.object({
3350
3334
  session_id: i.string(),
3351
3335
  client_id: i.string(),
3352
3336
  expires_at: i.string(),
@@ -3356,7 +3340,7 @@ const br = i.object({
3356
3340
  });
3357
3341
  i.object({
3358
3342
  created_at: i.string(),
3359
- ...br.shape
3343
+ ...kr.shape
3360
3344
  });
3361
3345
  i.object({
3362
3346
  private_key: i.string(),
@@ -3385,7 +3369,7 @@ i.object({
3385
3369
  revoked: i.boolean().optional().openapi({ description: "True if the key is revoked" }),
3386
3370
  revoked_at: i.string().optional().openapi({ description: "The date and time when the key was revoked" })
3387
3371
  });
3388
- const xr = i.object({
3372
+ const br = i.object({
3389
3373
  name: i.string(),
3390
3374
  audience: i.string(),
3391
3375
  sender_email: i.string().email(),
@@ -3396,7 +3380,7 @@ const xr = i.object({
3396
3380
  secondary_color: i.string().optional(),
3397
3381
  language: i.string().optional()
3398
3382
  });
3399
- xr.extend({
3383
+ br.extend({
3400
3384
  created_at: i.string().transform((n) => n === null ? "" : n),
3401
3385
  updated_at: i.string().transform((n) => n === null ? "" : n)
3402
3386
  });
@@ -3418,10 +3402,10 @@ i.object({
3418
3402
  siteUrl: i.string().nullable(),
3419
3403
  manageSubscriptionsUrl: i.string().optional()
3420
3404
  });
3421
- var Mn = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))(Mn || {});
3422
- const fn = i.nativeEnum(Mn);
3405
+ var Pn = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))(Pn || {});
3406
+ const pn = i.nativeEnum(Pn);
3423
3407
  i.object({
3424
- grant_type: fn.refine(
3408
+ grant_type: pn.refine(
3425
3409
  (n) => n === "authorization_code"
3426
3410
  /* AuthorizationCode */
3427
3411
  ),
@@ -3430,7 +3414,7 @@ i.object({
3430
3414
  client_id: i.string()
3431
3415
  });
3432
3416
  i.object({
3433
- grant_type: fn.refine(
3417
+ grant_type: pn.refine(
3434
3418
  (n) => n === "authorization_code"
3435
3419
  /* AuthorizationCode */
3436
3420
  ),
@@ -3440,7 +3424,7 @@ i.object({
3440
3424
  redirect_uri: i.string()
3441
3425
  });
3442
3426
  i.object({
3443
- grant_type: fn.refine(
3427
+ grant_type: pn.refine(
3444
3428
  (n) => n === "client_credentials"
3445
3429
  /* ClientCredential */
3446
3430
  ),
@@ -3462,7 +3446,7 @@ i.object({
3462
3446
  code: i.string(),
3463
3447
  state: i.string().optional()
3464
3448
  });
3465
- const Tr = i.object({
3449
+ const xr = i.object({
3466
3450
  button_border_radius: i.number(),
3467
3451
  button_border_weight: i.number(),
3468
3452
  buttons_style: i.enum(["pill"]),
@@ -3472,7 +3456,7 @@ const Tr = i.object({
3472
3456
  show_widget_shadow: i.boolean(),
3473
3457
  widget_border_weight: i.number(),
3474
3458
  widget_corner_radius: i.number()
3475
- }), Or = i.object({
3459
+ }), Tr = i.object({
3476
3460
  base_focus_color: i.string(),
3477
3461
  base_hover_color: i.string(),
3478
3462
  body_text: i.string(),
@@ -3495,7 +3479,7 @@ const Tr = i.object({
3495
3479
  }), De = i.object({
3496
3480
  bold: i.boolean(),
3497
3481
  size: i.number()
3498
- }), Sr = i.object({
3482
+ }), Or = i.object({
3499
3483
  body_text: De,
3500
3484
  buttons_text: De,
3501
3485
  font_url: i.string(),
@@ -3505,39 +3489,39 @@ const Tr = i.object({
3505
3489
  reference_text_size: i.number(),
3506
3490
  subtitle: De,
3507
3491
  title: De
3508
- }), Zr = i.object({
3492
+ }), Sr = i.object({
3509
3493
  background_color: i.string(),
3510
3494
  background_image_url: i.string(),
3511
3495
  page_layout: i.enum(["center"])
3512
- }), jr = i.object({
3496
+ }), Zr = i.object({
3513
3497
  header_text_alignment: i.enum(["center"]),
3514
3498
  logo_height: i.number(),
3515
3499
  logo_position: i.enum(["center"]),
3516
3500
  logo_url: i.string(),
3517
3501
  social_buttons_layout: i.enum(["bottom"])
3518
- }), Nr = i.object({
3519
- borders: Tr,
3520
- colors: Or,
3502
+ }), jr = i.object({
3503
+ borders: xr,
3504
+ colors: Tr,
3521
3505
  displayName: i.string(),
3522
- fonts: Sr,
3523
- page_background: Zr,
3524
- widget: jr
3506
+ fonts: Or,
3507
+ page_background: Sr,
3508
+ widget: Zr
3525
3509
  });
3526
- Nr.extend({
3510
+ jr.extend({
3527
3511
  themeId: i.string()
3528
3512
  });
3529
- const Ir = i.object({
3513
+ const Nr = i.object({
3530
3514
  id: i.string(),
3531
3515
  expires_at: i.string(),
3532
3516
  auth0Client: i.string().optional(),
3533
3517
  authParams: Qt
3534
3518
  });
3535
3519
  i.object({
3536
- ...Ir.shape,
3520
+ ...Nr.shape,
3537
3521
  created_at: i.string(),
3538
3522
  updated_at: i.string()
3539
3523
  });
3540
- const Cr = i.object({
3524
+ const Ir = i.object({
3541
3525
  id: i.string(),
3542
3526
  email: i.string(),
3543
3527
  code: i.string(),
@@ -3550,9 +3534,9 @@ const Cr = i.object({
3550
3534
  });
3551
3535
  i.object({
3552
3536
  created_at: i.string(),
3553
- ...Cr.shape
3537
+ ...Ir.shape
3554
3538
  });
3555
- const Er = i.object({
3539
+ const Cr = i.object({
3556
3540
  authParams: Qt,
3557
3541
  code: i.string(),
3558
3542
  user_id: i.string(),
@@ -3561,16 +3545,16 @@ const Er = i.object({
3561
3545
  used_at: i.string().optional()
3562
3546
  });
3563
3547
  i.object({
3564
- ...Er.shape,
3548
+ ...Cr.shape,
3565
3549
  created_at: i.string()
3566
3550
  });
3567
- function mn(n) {
3551
+ function hn(n) {
3568
3552
  const [e, t] = n.split("|");
3569
3553
  if (!e || !t)
3570
3554
  throw new Error(`Invalid user_id: ${n}`);
3571
3555
  return { connection: e, id: t };
3572
3556
  }
3573
- function Ln(n) {
3557
+ function Dn(n) {
3574
3558
  let e = {};
3575
3559
  try {
3576
3560
  e = JSON.parse(n.profileData || "{}");
@@ -3580,7 +3564,7 @@ function Ln(n) {
3580
3564
  return {
3581
3565
  connection: n.connection,
3582
3566
  provider: n.provider,
3583
- user_id: mn(n.user_id).id,
3567
+ user_id: hn(n.user_id).id,
3584
3568
  isSocial: !!n.is_social,
3585
3569
  profileData: {
3586
3570
  email: n.email,
@@ -3589,7 +3573,7 @@ function Ln(n) {
3589
3573
  }
3590
3574
  };
3591
3575
  }
3592
- function Ar(n) {
3576
+ function Er(n) {
3593
3577
  return async (e, t) => {
3594
3578
  const [s, r] = await Promise.all([
3595
3579
  n.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).selectAll().executeTakeFirst(),
@@ -3606,10 +3590,10 @@ function Ar(n) {
3606
3590
  {
3607
3591
  connection: s.connection,
3608
3592
  provider: s.provider,
3609
- user_id: mn(s.user_id).id,
3593
+ user_id: hn(s.user_id).id,
3610
3594
  isSocial: !!s.is_social
3611
3595
  },
3612
- ...r.map(Ln)
3596
+ ...r.map(Dn)
3613
3597
  ]
3614
3598
  };
3615
3599
  return R(c);
@@ -3655,7 +3639,7 @@ function Ae(n, e, t, s) {
3655
3639
  function xe(n) {
3656
3640
  return typeof n == "string" ? parseInt(n, 10) : typeof n == "bigint" ? Number(n) : n;
3657
3641
  }
3658
- function Rr(n) {
3642
+ function Ar(n) {
3659
3643
  return async (e, t) => {
3660
3644
  let s = n.selectFrom("users").where("users.tenant_id", "=", e);
3661
3645
  if (t.q && (s = Ae(n, s, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
@@ -3674,10 +3658,10 @@ function Rr(n) {
3674
3658
  {
3675
3659
  connection: l.connection,
3676
3660
  provider: l.provider,
3677
- user_id: mn(l.user_id).id,
3661
+ user_id: hn(l.user_id).id,
3678
3662
  isSocial: !!l.is_social
3679
3663
  },
3680
- ...T.map(Ln)
3664
+ ...T.map(Dn)
3681
3665
  ]
3682
3666
  });
3683
3667
  }), { count: u } = await s.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
@@ -3689,48 +3673,48 @@ function Rr(n) {
3689
3673
  };
3690
3674
  };
3691
3675
  }
3692
- function $r(n) {
3676
+ function Rr(n) {
3693
3677
  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);
3694
3678
  }
3695
- function Pr(n) {
3679
+ function $r(n) {
3696
3680
  if (n.email_verified !== void 0)
3697
3681
  return n.email_verified ? 1 : 0;
3698
3682
  }
3699
- function Dr(n) {
3683
+ function Pr(n) {
3700
3684
  return async (e, t, s) => {
3701
3685
  const r = {
3702
3686
  ...s,
3703
- email_verified: Pr(s),
3687
+ email_verified: $r(s),
3704
3688
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
3705
3689
  };
3706
3690
  return (await n.updateTable("users").set(r).where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1;
3707
3691
  };
3708
3692
  }
3709
- function Mr(n) {
3693
+ function Dr(n) {
3710
3694
  return async (e, t, s, r) => {
3711
3695
  const a = { linked_to: null };
3712
3696
  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;
3713
3697
  };
3714
3698
  }
3715
- function Lr(n) {
3699
+ function Mr(n) {
3716
3700
  return {
3717
- create: Xn(n),
3718
- remove: $r(n),
3719
- get: Ar(n),
3720
- list: Rr(n),
3721
- update: Dr(n),
3701
+ create: Yn(n),
3702
+ remove: Rr(n),
3703
+ get: Er(n),
3704
+ list: Ar(n),
3705
+ update: Pr(n),
3722
3706
  // TODO - think about this more when other issues fixed
3723
- unlink: Mr(n)
3707
+ unlink: Dr(n)
3724
3708
  };
3725
3709
  }
3726
- const Vr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3710
+ const Lr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3727
3711
  let Re = (n = 21) => {
3728
3712
  let e = "", t = crypto.getRandomValues(new Uint8Array(n));
3729
3713
  for (; n--; )
3730
- e += Vr[t[n] & 63];
3714
+ e += Lr[t[n] & 63];
3731
3715
  return e;
3732
3716
  };
3733
- function Ur(n) {
3717
+ function Vr(n) {
3734
3718
  return async (e) => {
3735
3719
  const t = {
3736
3720
  id: e.id || Re(),
@@ -3741,13 +3725,13 @@ function Ur(n) {
3741
3725
  return await n.insertInto("tenants").values(t).execute(), t;
3742
3726
  };
3743
3727
  }
3744
- function Fr(n) {
3728
+ function Ur(n) {
3745
3729
  return async (e) => {
3746
3730
  const t = await n.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
3747
3731
  return t ? R(t) : null;
3748
3732
  };
3749
3733
  }
3750
- function zr(n) {
3734
+ function Fr(n) {
3751
3735
  return async (e) => {
3752
3736
  let t = n.selectFrom("tenants");
3753
3737
  if (e.sort && e.sort.sort_by) {
@@ -3769,7 +3753,7 @@ function zr(n) {
3769
3753
  };
3770
3754
  };
3771
3755
  }
3772
- function Br(n) {
3756
+ function zr(n) {
3773
3757
  return async (e, t) => {
3774
3758
  const s = {
3775
3759
  ...t,
@@ -3779,29 +3763,29 @@ function Br(n) {
3779
3763
  await n.updateTable("tenants").set(s).where("id", "=", e).execute();
3780
3764
  };
3781
3765
  }
3782
- function Wr(n) {
3766
+ function Br(n) {
3783
3767
  return async (e) => (await n.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
3784
3768
  }
3785
- function qr(n) {
3769
+ function Wr(n) {
3786
3770
  return {
3787
- create: Ur(n),
3788
- get: Fr(n),
3789
- list: zr(n),
3790
- update: Br(n),
3791
- remove: Wr(n)
3771
+ create: Vr(n),
3772
+ get: Ur(n),
3773
+ list: Fr(n),
3774
+ update: zr(n),
3775
+ remove: Br(n)
3792
3776
  };
3793
3777
  }
3794
- function vn(n) {
3778
+ function gn(n) {
3795
3779
  return n ? JSON.stringify(n) : void 0;
3796
3780
  }
3797
- const Kr = 1024;
3781
+ const qr = 1024;
3798
3782
  function Jr(n) {
3799
3783
  return async (e, t) => {
3800
3784
  var r, a, o;
3801
3785
  const s = {
3802
3786
  id: Re(),
3803
3787
  ...t,
3804
- user_agent: t.user_agent.slice(0, Kr)
3788
+ user_agent: t.user_agent.slice(0, qr)
3805
3789
  };
3806
3790
  return await n.insertInto("logs").values({
3807
3791
  ...s,
@@ -3810,12 +3794,12 @@ function Jr(n) {
3810
3794
  isMobile: t.isMobile ? 1 : 0,
3811
3795
  tenant_id: e,
3812
3796
  scope: (a = t.scope) == null ? void 0 : a.join(","),
3813
- auth0_client: vn(t.auth0_client),
3814
- details: (o = vn(t.details)) == null ? void 0 : o.substring(0, 8192)
3797
+ auth0_client: gn(t.auth0_client),
3798
+ details: (o = gn(t.details)) == null ? void 0 : o.substring(0, 8192)
3815
3799
  }).execute(), s;
3816
3800
  };
3817
3801
  }
3818
- function wn(n) {
3802
+ function yn(n) {
3819
3803
  if (!n)
3820
3804
  return "";
3821
3805
  try {
@@ -3824,20 +3808,20 @@ function wn(n) {
3824
3808
  return n;
3825
3809
  }
3826
3810
  }
3827
- function Vn(n) {
3811
+ function Mn(n) {
3828
3812
  return {
3829
3813
  ...n,
3830
3814
  client_id: n.client_id,
3831
3815
  client_name: "",
3832
- auth0_client: wn(n.auth0_client),
3833
- details: wn(n.details),
3816
+ auth0_client: yn(n.auth0_client),
3817
+ details: yn(n.details),
3834
3818
  isMobile: !!n.isMobile,
3835
3819
  scope: n.scope ? n.scope.split(",") : void 0,
3836
3820
  log_id: n.id,
3837
3821
  _id: n.id
3838
3822
  };
3839
3823
  }
3840
- function Qr(n) {
3824
+ function Kr(n) {
3841
3825
  return async (e, t) => {
3842
3826
  let s = n.selectFrom("logs").where("logs.tenant_id", "=", e);
3843
3827
  t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
@@ -3852,30 +3836,30 @@ function Qr(n) {
3852
3836
  r = r.offset(t.page * t.per_page).limit(t.per_page);
3853
3837
  const a = await r.selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
3854
3838
  return {
3855
- logs: a.map(Vn),
3839
+ logs: a.map(Mn),
3856
3840
  start: t.page * t.per_page,
3857
3841
  limit: t.per_page,
3858
3842
  length: xe(o)
3859
3843
  };
3860
3844
  };
3861
3845
  }
3862
- function Hr(n) {
3846
+ function Qr(n) {
3863
3847
  return async (e, t) => {
3864
3848
  const s = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
3865
- return s ? Vn(s) : null;
3849
+ return s ? Mn(s) : null;
3866
3850
  };
3867
3851
  }
3868
- function Yr(n) {
3852
+ function Hr(n) {
3869
3853
  return {
3870
3854
  create: Jr(n),
3871
- list: Qr(n),
3872
- get: Hr(n)
3855
+ list: Kr(n),
3856
+ get: Qr(n)
3873
3857
  };
3874
3858
  }
3875
- function Gr(n) {
3859
+ function Yr(n) {
3876
3860
  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;
3877
3861
  }
3878
- function Xr(n) {
3862
+ function Gr(n) {
3879
3863
  return async (e, t) => {
3880
3864
  const s = {
3881
3865
  ...t,
@@ -3885,13 +3869,13 @@ function Xr(n) {
3885
3869
  return await n.insertInto("sessions").values({ ...s, tenant_id: e }).execute(), { ...t, ...s };
3886
3870
  };
3887
3871
  }
3888
- function ea(n) {
3872
+ function Xr(n) {
3889
3873
  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;
3890
3874
  }
3891
- function ta(n) {
3875
+ function ea(n) {
3892
3876
  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;
3893
3877
  }
3894
- function na(n) {
3878
+ function ta(n) {
3895
3879
  return async (e, t) => {
3896
3880
  let s = n.selectFrom("sessions").where("sessions.tenant_id", "=", e);
3897
3881
  t.q && (s = Ae(n, s, t.q, ["user_id", "session_id"]));
@@ -3913,16 +3897,16 @@ function na(n) {
3913
3897
  };
3914
3898
  };
3915
3899
  }
3916
- function sa(n) {
3900
+ function na(n) {
3917
3901
  return {
3918
- create: Xr(n),
3919
- get: Gr(n),
3920
- list: na(n),
3921
- remove: ea(n),
3922
- update: ta(n)
3902
+ create: Gr(n),
3903
+ get: Yr(n),
3904
+ list: ta(n),
3905
+ remove: Xr(n),
3906
+ update: ea(n)
3923
3907
  };
3924
3908
  }
3925
- function ra(n) {
3909
+ function sa(n) {
3926
3910
  return async (e, t) => {
3927
3911
  const s = await n.selectFrom("tickets").where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).where("tickets.used_at", "is", null).selectAll().executeTakeFirst();
3928
3912
  if (!s)
@@ -3952,7 +3936,7 @@ function ra(n) {
3952
3936
  };
3953
3937
  };
3954
3938
  }
3955
- function aa(n) {
3939
+ function ra(n) {
3956
3940
  return async (e) => {
3957
3941
  const { authParams: t, ...s } = e, r = {
3958
3942
  ...s,
@@ -3964,21 +3948,21 @@ function aa(n) {
3964
3948
  await n.insertInto("tickets").values(r).execute();
3965
3949
  };
3966
3950
  }
3967
- function ia(n) {
3951
+ function aa(n) {
3968
3952
  return async (e, t) => {
3969
3953
  await n.updateTable("tickets").set({
3970
3954
  used_at: (/* @__PURE__ */ new Date()).toISOString()
3971
3955
  }).where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).execute();
3972
3956
  };
3973
3957
  }
3974
- function oa(n) {
3958
+ function ia(n) {
3975
3959
  return {
3976
- create: aa(n),
3977
- get: ra(n),
3978
- remove: ia(n)
3960
+ create: ra(n),
3961
+ get: sa(n),
3962
+ remove: aa(n)
3979
3963
  };
3980
3964
  }
3981
- function ca(n) {
3965
+ function oa(n) {
3982
3966
  return async (e, t) => {
3983
3967
  const s = (/* @__PURE__ */ new Date()).toISOString();
3984
3968
  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) => {
@@ -4009,7 +3993,7 @@ function ca(n) {
4009
3993
  });
4010
3994
  };
4011
3995
  }
4012
- function da(n) {
3996
+ function ca(n) {
4013
3997
  return async (e, t) => {
4014
3998
  const { authParams: s, ...r } = t;
4015
3999
  await n.insertInto("otps").values({
@@ -4022,25 +4006,25 @@ function da(n) {
4022
4006
  }).execute();
4023
4007
  };
4024
4008
  }
4025
- function ua(n) {
4009
+ function da(n) {
4026
4010
  return async (e, t) => (await n.updateTable("otps").set({
4027
4011
  used_at: (/* @__PURE__ */ new Date()).toISOString()
4028
4012
  }).where("otps.tenant_id", "=", e).where("otps.id", "=", t).execute()).length > 0;
4029
4013
  }
4030
- function la(n) {
4014
+ function ua(n) {
4031
4015
  return {
4032
- create: da(n),
4033
- list: ca(n),
4034
- remove: ua(n)
4016
+ create: ca(n),
4017
+ list: oa(n),
4018
+ remove: da(n)
4035
4019
  };
4036
4020
  }
4037
- function pa(n) {
4021
+ function la(n) {
4038
4022
  return async (e, t) => {
4039
4023
  const s = await n.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", t).selectAll().executeTakeFirstOrThrow(), { tenant_id: r, ...a } = s;
4040
4024
  return a;
4041
4025
  };
4042
4026
  }
4043
- function ha(n) {
4027
+ function pa(n) {
4044
4028
  return async (e, t) => {
4045
4029
  const s = {
4046
4030
  ...t,
@@ -4053,20 +4037,20 @@ function ha(n) {
4053
4037
  }).execute(), s;
4054
4038
  };
4055
4039
  }
4056
- function fa(n) {
4040
+ function ha(n) {
4057
4041
  return async (e, t) => (await n.updateTable("passwords").set({
4058
4042
  password: t.password,
4059
4043
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
4060
4044
  }).where("tenant_id", "=", e).where("user_id", "=", t.user_id).execute()).length === 1;
4061
4045
  }
4062
- function ma(n) {
4046
+ function fa(n) {
4063
4047
  return {
4064
- create: ha(n),
4065
- update: fa(n),
4066
- get: pa(n)
4048
+ create: pa(n),
4049
+ update: ha(n),
4050
+ get: la(n)
4067
4051
  };
4068
4052
  }
4069
- function _a(n) {
4053
+ function ma(n) {
4070
4054
  return async (e, t) => {
4071
4055
  let s = n.selectFrom("codes").where("codes.tenant_id", "=", e);
4072
4056
  t.q && (s = Ae(n, s, t.q, ["code", "login_id"]));
@@ -4074,7 +4058,7 @@ function _a(n) {
4074
4058
  return {
4075
4059
  codes: a.map((d) => {
4076
4060
  const { tenant_id: u, ...l } = d;
4077
- return hr.parse(R(l));
4061
+ return pr.parse(R(l));
4078
4062
  }),
4079
4063
  start: t.page * t.per_page,
4080
4064
  limit: t.per_page,
@@ -4082,7 +4066,7 @@ function _a(n) {
4082
4066
  };
4083
4067
  };
4084
4068
  }
4085
- function ga(n) {
4069
+ function _a(n) {
4086
4070
  return async (e, t) => {
4087
4071
  const s = {
4088
4072
  ...t,
@@ -4094,24 +4078,24 @@ function ga(n) {
4094
4078
  }).execute(), s;
4095
4079
  };
4096
4080
  }
4097
- function ya(n) {
4081
+ function ga(n) {
4098
4082
  return async (e, t) => (await n.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4099
4083
  }
4100
- function va(n) {
4084
+ function ya(n) {
4101
4085
  return async (e, t, s) => {
4102
4086
  const r = await n.selectFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).where("codes.code_type", "=", s).selectAll().executeTakeFirst();
4103
4087
  return r ? R(r) : null;
4104
4088
  };
4105
4089
  }
4106
- function wa(n) {
4090
+ function va(n) {
4107
4091
  return {
4108
- create: ga(n),
4109
- list: _a(n),
4110
- remove: ya(n),
4111
- get: va(n)
4092
+ create: _a(n),
4093
+ list: ma(n),
4094
+ remove: ga(n),
4095
+ get: ya(n)
4112
4096
  };
4113
4097
  }
4114
- function ka(n) {
4098
+ function wa(n) {
4115
4099
  return async (e) => {
4116
4100
  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();
4117
4101
  if (!s) return null;
@@ -4126,14 +4110,14 @@ function ka(n) {
4126
4110
  code_challenge_method: T,
4127
4111
  code_challenge: C,
4128
4112
  username: L,
4129
- vendor_id: J,
4113
+ vendor_id: K,
4130
4114
  ...re
4131
4115
  } = s;
4132
4116
  return {
4133
4117
  ...re,
4134
4118
  authParams: {
4135
4119
  client_id: re.client_id,
4136
- vendor_id: J,
4120
+ vendor_id: K,
4137
4121
  response_type: r,
4138
4122
  response_mode: a,
4139
4123
  redirect_uri: o,
@@ -4149,7 +4133,7 @@ function ka(n) {
4149
4133
  };
4150
4134
  };
4151
4135
  }
4152
- function ba(n) {
4136
+ function ka(n) {
4153
4137
  return async (e, t) => {
4154
4138
  const { authParams: s, ...r } = t, a = {
4155
4139
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
@@ -4158,99 +4142,93 @@ function ba(n) {
4158
4142
  return await n.insertInto("universal_login_sessions").values({ ...s, ...r, ...a, tenant_id: e }).execute(), { ...t, ...a };
4159
4143
  };
4160
4144
  }
4161
- function xa(n) {
4145
+ function ba(n) {
4162
4146
  return async (e, t, s) => {
4163
4147
  const { authParams: r, ...a } = s;
4164
4148
  return (await n.updateTable("universal_login_sessions").set({ ...r, ...a }).where("id", "=", t).where("tenant_id", "=", e).execute()).length === 1;
4165
4149
  };
4166
4150
  }
4167
- function Ta(n) {
4151
+ function xa(n) {
4168
4152
  return {
4169
- create: ba(n),
4170
- get: ka(n),
4171
- update: xa(n)
4153
+ create: ka(n),
4154
+ get: wa(n),
4155
+ update: ba(n)
4172
4156
  };
4173
4157
  }
4174
- function Xt(n) {
4175
- return JSON.stringify(
4176
- n.split(",").map((e) => e.trim()).filter((e) => e.length)
4177
- );
4178
- }
4179
- function Oa(n) {
4158
+ function Ta(n) {
4180
4159
  return async (e, t) => {
4181
4160
  const s = {
4182
4161
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
4183
4162
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
4184
- ...t,
4185
- // TODO: remove fallbacks
4186
- allowed_web_origins: t.allowed_origins,
4187
- allowed_callback_urls: t.callbacks,
4188
- allowed_origins: t.allowed_origins
4189
- }, r = Xt(t.allowed_origins), a = Xt(t.callbacks), o = Xt(t.callbacks);
4163
+ ...t
4164
+ }, r = JSON.stringify(t.allowed_origins), a = JSON.stringify(t.callbacks), o = JSON.stringify(t.web_origins), c = JSON.stringify(t.allowed_logout_urls);
4190
4165
  return await n.insertInto("applications").values({
4191
4166
  ...s,
4192
4167
  tenant_id: e,
4193
4168
  disable_sign_ups: t.disable_sign_ups ? 1 : 0,
4194
4169
  addons: t.addons ? JSON.stringify(t.addons) : "{}",
4195
- callbacks: o,
4196
- allowed_web_origins: r,
4197
- allowed_callback_urls: a,
4198
- allowed_origins: r
4170
+ callbacks: a,
4171
+ allowed_origins: r,
4172
+ web_origins: o,
4173
+ allowed_logout_urls: c
4199
4174
  }).execute(), s;
4200
4175
  };
4201
4176
  }
4202
- function Sa(n) {
4177
+ function Oa(n) {
4203
4178
  return async (e) => ({
4204
4179
  applications: (await n.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((a) => ({
4205
4180
  ...a,
4206
4181
  disable_sign_ups: !!a.disable_sign_ups,
4207
- addons: a.addons ? JSON.parse(a.addons) : {}
4182
+ addons: a.addons ? JSON.parse(a.addons) : {},
4183
+ callbacks: a.callbacks ? JSON.parse(a.callbacks) : [],
4184
+ allowed_origins: a.allowed_origins ? JSON.parse(a.allowed_origins) : [],
4185
+ web_origins: a.web_origins ? JSON.parse(a.web_origins) : [],
4186
+ allowed_logout_urls: a.allowed_logout_urls ? JSON.parse(a.allowed_logout_urls) : []
4208
4187
  }))
4209
4188
  });
4210
4189
  }
4211
- function Za(n) {
4190
+ function Sa(n) {
4212
4191
  return async (e, t) => {
4213
4192
  const s = await n.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).selectAll().executeTakeFirst();
4214
4193
  return s ? R({
4215
4194
  ...s,
4216
4195
  disable_sign_ups: !!s.disable_sign_ups,
4217
4196
  addons: JSON.parse(s.addons),
4218
- // TODO: add callbacks
4219
4197
  callback: JSON.parse(s.callbacks),
4220
4198
  allowed_origins: JSON.parse(s.allowed_origins),
4221
- allowed_callback_urls: JSON.parse(s.allowed_callback_urls),
4222
- allowed_web_origins: JSON.parse(s.allowed_web_origins)
4199
+ web_origins: JSON.parse(s.web_origins),
4200
+ allowed_logout_urls: JSON.parse(s.allowed_logout_urls)
4223
4201
  }) : null;
4224
4202
  };
4225
4203
  }
4226
- function ja(n) {
4204
+ function Za(n) {
4227
4205
  return async (e, t) => (await n.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4228
4206
  }
4229
- function Na(n) {
4207
+ function ja(n) {
4230
4208
  return async (e, t, s) => {
4231
4209
  const r = {
4232
4210
  ...s,
4233
4211
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
4234
4212
  allowed_origins: s.allowed_origins ? JSON.stringify(s.allowed_origins) : void 0,
4235
- allowed_callback_urls: s.allowed_callback_urls ? JSON.stringify(s.allowed_callback_urls) : void 0,
4236
- allowed_web_origins: s.allowed_web_origins ? JSON.stringify(s.allowed_web_origins) : void 0,
4237
4213
  callbacks: s.callbacks ? JSON.stringify(s.callbacks) : void 0,
4214
+ web_origins: s.web_origins ? JSON.stringify(s.web_origins) : void 0,
4215
+ allowed_logout_urls: s.allowed_logout_urls ? JSON.stringify(s.allowed_logout_urls) : void 0,
4238
4216
  addons: s.addons ? JSON.stringify(s.addons) : "{}",
4239
4217
  disable_sign_ups: s.disable_sign_ups ? 1 : 0
4240
4218
  };
4241
4219
  return await n.updateTable("applications").set(r).where("applications.id", "=", t).where("applications.tenant_id", "=", e).execute(), !0;
4242
4220
  };
4243
4221
  }
4244
- function Ia(n) {
4222
+ function Na(n) {
4245
4223
  return {
4246
- create: Oa(n),
4247
- list: Sa(n),
4248
- get: Za(n),
4249
- remove: ja(n),
4250
- update: Na(n)
4224
+ create: Ta(n),
4225
+ list: Oa(n),
4226
+ get: Sa(n),
4227
+ remove: Za(n),
4228
+ update: ja(n)
4251
4229
  };
4252
4230
  }
4253
- function Ca(n) {
4231
+ function Ia(n) {
4254
4232
  return async (e, t) => {
4255
4233
  const s = {
4256
4234
  id: Re(),
@@ -4261,7 +4239,7 @@ function Ca(n) {
4261
4239
  return await n.insertInto("connections").values({ ...s, tenant_id: e }).execute(), s;
4262
4240
  };
4263
4241
  }
4264
- function Ea(n) {
4242
+ function Ca(n) {
4265
4243
  return async (e, t) => {
4266
4244
  let s = n.selectFrom("connections").where("connections.tenant_id", "=", e);
4267
4245
  t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
@@ -4274,16 +4252,16 @@ function Ea(n) {
4274
4252
  };
4275
4253
  };
4276
4254
  }
4277
- function Aa(n) {
4255
+ function Ea(n) {
4278
4256
  return async (e, t) => (await n.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4279
4257
  }
4280
- function Ra(n) {
4258
+ function Aa(n) {
4281
4259
  return async (e, t) => {
4282
4260
  const s = await n.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).selectAll().executeTakeFirst();
4283
4261
  return s ? R(s) : null;
4284
4262
  };
4285
4263
  }
4286
- function $a(n) {
4264
+ function Ra(n) {
4287
4265
  return async (e, t, s) => {
4288
4266
  const r = {
4289
4267
  ...s,
@@ -4292,19 +4270,16 @@ function $a(n) {
4292
4270
  return await n.updateTable("connections").set(r).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
4293
4271
  };
4294
4272
  }
4295
- function Pa(n) {
4273
+ function $a(n) {
4296
4274
  return {
4297
- create: Ca(n),
4298
- get: Ra(n),
4299
- list: Ea(n),
4300
- remove: Aa(n),
4301
- update: $a(n)
4275
+ create: Ia(n),
4276
+ get: Aa(n),
4277
+ list: Ca(n),
4278
+ remove: Ea(n),
4279
+ update: Ra(n)
4302
4280
  };
4303
4281
  }
4304
- function en(n) {
4305
- return n != null && n.length ? n.split(",").map((e) => e.trim()) : [];
4306
- }
4307
- function Da(n) {
4282
+ function Pa(n) {
4308
4283
  return {
4309
4284
  get: async (e) => {
4310
4285
  const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
@@ -4315,18 +4290,16 @@ function Da(n) {
4315
4290
  throw new Et(404, { message: "Tenant not found" });
4316
4291
  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();
4317
4292
  return {
4318
- id: t.id,
4319
- name: t.name,
4293
+ ...t,
4320
4294
  connections: r.map(
4321
- (c) => hn.parse(R(c))
4295
+ (c) => ln.parse(R(c))
4322
4296
  ),
4323
4297
  domains: a,
4324
- tenant_id: s.id,
4325
- allowed_callback_urls: en(t.allowed_callback_urls),
4326
- allowed_logout_urls: en(t.allowed_logout_urls),
4327
- allowed_web_origins: en(t.allowed_web_origins),
4328
- email_validation: t.email_validation,
4329
- client_secret: t.client_secret,
4298
+ addons: t.addons ? JSON.parse(t.addons) : {},
4299
+ callbacks: t.callbacks ? JSON.parse(t.callbacks) : [],
4300
+ allowed_origins: t.allowed_origins ? JSON.parse(t.allowed_origins) : [],
4301
+ web_origins: t.web_origins ? JSON.parse(t.web_origins) : [],
4302
+ allowed_logout_urls: t.allowed_logout_urls ? JSON.parse(t.allowed_logout_urls) : [],
4330
4303
  tenant: R(s),
4331
4304
  // this is really an integer in the database
4332
4305
  disable_sign_ups: !!t.disable_sign_ups
@@ -4334,25 +4307,25 @@ function Da(n) {
4334
4307
  }
4335
4308
  };
4336
4309
  }
4337
- function Ma(n) {
4310
+ function Da(n) {
4338
4311
  return async () => await n.selectFrom("keys").where("revoked_at", "is", null).selectAll().execute();
4339
4312
  }
4340
- function La(n) {
4313
+ function Ma(n) {
4341
4314
  return async (e) => {
4342
4315
  await n.insertInto("keys").values(e).execute();
4343
4316
  };
4344
4317
  }
4345
- function Va(n) {
4318
+ function La(n) {
4346
4319
  return async (e, t) => !!(await n.updateTable("keys").set({ revoked_at: t.toISOString() }).where("kid", "=", e).execute()).length;
4347
4320
  }
4348
- function Ua(n) {
4321
+ function Va(n) {
4349
4322
  return {
4350
- create: La(n),
4351
- list: Ma(n),
4352
- revoke: Va(n)
4323
+ create: Ma(n),
4324
+ list: Da(n),
4325
+ revoke: La(n)
4353
4326
  };
4354
4327
  }
4355
- function Fa(n) {
4328
+ function Ua(n) {
4356
4329
  return async (e, t) => {
4357
4330
  const s = {
4358
4331
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
@@ -4364,7 +4337,7 @@ function Fa(n) {
4364
4337
  return await n.insertInto("domains").values(s).execute(), s;
4365
4338
  };
4366
4339
  }
4367
- function za(n) {
4340
+ function Fa(n) {
4368
4341
  return async (e, t) => {
4369
4342
  let s = n.selectFrom("domains").where("domains.tenant_id", "=", e);
4370
4343
  t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
@@ -4377,13 +4350,13 @@ function za(n) {
4377
4350
  };
4378
4351
  };
4379
4352
  }
4380
- function Ba(n) {
4353
+ function za(n) {
4381
4354
  return {
4382
- create: Fa(n),
4383
- list: za(n)
4355
+ create: Ua(n),
4356
+ list: Fa(n)
4384
4357
  };
4385
4358
  }
4386
- function Wa(n) {
4359
+ function Ba(n) {
4387
4360
  return async (e) => {
4388
4361
  const [t] = await n.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
4389
4362
  if (!t)
@@ -4413,9 +4386,9 @@ function Wa(n) {
4413
4386
  });
4414
4387
  };
4415
4388
  }
4416
- function qa(n) {
4389
+ function Wa(n) {
4417
4390
  return async (e, t) => {
4418
- var o, c, d, u, l, T, C, L, J, re, ce, de, ue, $e, Pe, Q, H, Y;
4391
+ var o, c, d, u, l, T, C, L, K, re, ce, de, ue, $e, Pe, Q, H, Y;
4419
4392
  const { colors: s, font: r, ...a } = t;
4420
4393
  try {
4421
4394
  await n.insertInto("branding").values({
@@ -4425,7 +4398,7 @@ function qa(n) {
4425
4398
  colors_page_background_start: (u = (d = t.colors) == null ? void 0 : d.page_background) == null ? void 0 : u.start,
4426
4399
  colors_page_background_end: (T = (l = t.colors) == null ? void 0 : l.page_background) == null ? void 0 : T.end,
4427
4400
  colors_page_background_angle_dev: (L = (C = t.colors) == null ? void 0 : C.page_background) == null ? void 0 : L.angle_deg,
4428
- font_url: (J = t.font) == null ? void 0 : J.url,
4401
+ font_url: (K = t.font) == null ? void 0 : K.url,
4429
4402
  tenant_id: e
4430
4403
  }).execute();
4431
4404
  } catch {
@@ -4441,10 +4414,10 @@ function qa(n) {
4441
4414
  }
4442
4415
  };
4443
4416
  }
4444
- function Ka(n) {
4417
+ function qa(n) {
4445
4418
  return {
4446
- get: Wa(n),
4447
- set: qa(n)
4419
+ get: Ba(n),
4420
+ set: Wa(n)
4448
4421
  };
4449
4422
  }
4450
4423
  function Ja(n) {
@@ -4476,7 +4449,7 @@ function Ja(n) {
4476
4449
  };
4477
4450
  };
4478
4451
  }
4479
- function Qa(n) {
4452
+ function Ka(n) {
4480
4453
  return async (e, t) => {
4481
4454
  const { authParams: s, ...r } = t;
4482
4455
  await n.insertInto("authentication_codes").values({
@@ -4486,13 +4459,13 @@ function Qa(n) {
4486
4459
  }).execute();
4487
4460
  };
4488
4461
  }
4489
- function Ha(n) {
4462
+ function Qa(n) {
4490
4463
  return {
4491
- create: Qa(n),
4464
+ create: Ka(n),
4492
4465
  get: Ja(n)
4493
4466
  };
4494
4467
  }
4495
- function Ya(n) {
4468
+ function Ha(n) {
4496
4469
  return async (e, t) => {
4497
4470
  let s = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
4498
4471
  t.q && (s = Ae(n, s, t.q, ["url"]));
@@ -4512,16 +4485,16 @@ function Ya(n) {
4512
4485
  };
4513
4486
  };
4514
4487
  }
4515
- function Ga(n) {
4488
+ function Ya(n) {
4516
4489
  return async (e, t) => {
4517
4490
  const s = await n.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).selectAll().executeTakeFirst();
4518
4491
  return s ? (s.enabled = !!s.enabled, s.synchronous = !!s.synchronous, R(s)) : null;
4519
4492
  };
4520
4493
  }
4521
- function Xa(n) {
4494
+ function Ga(n) {
4522
4495
  return async (e, t) => (await n.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4523
4496
  }
4524
- function ei(n) {
4497
+ function Xa(n) {
4525
4498
  return async (e, t) => {
4526
4499
  const s = {
4527
4500
  hook_id: Re(),
@@ -4535,7 +4508,7 @@ function ei(n) {
4535
4508
  }).execute(), s;
4536
4509
  };
4537
4510
  }
4538
- function ti(n) {
4511
+ function ei(n) {
4539
4512
  return async (e, t, s) => {
4540
4513
  const r = {
4541
4514
  ...s,
@@ -4544,16 +4517,16 @@ function ti(n) {
4544
4517
  return await n.updateTable("hooks").set(r).where("hooks.hook_id", "=", t).where("hooks.tenant_id", "=", e).execute(), !0;
4545
4518
  };
4546
4519
  }
4547
- function ni(n) {
4520
+ function ti(n) {
4548
4521
  return {
4549
- create: ei(n),
4550
- get: Ga(n),
4551
- list: Ya(n),
4552
- update: ti(n),
4553
- remove: Xa(n)
4522
+ create: Xa(n),
4523
+ get: Ya(n),
4524
+ list: Ha(n),
4525
+ update: ei(n),
4526
+ remove: Ga(n)
4554
4527
  };
4555
4528
  }
4556
- function si(n, e) {
4529
+ function ni(n, e) {
4557
4530
  var t = {};
4558
4531
  for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
4559
4532
  if (n != null && typeof Object.getOwnPropertySymbols == "function")
@@ -4561,7 +4534,7 @@ function si(n, e) {
4561
4534
  e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
4562
4535
  return t;
4563
4536
  }
4564
- function ri(n, e) {
4537
+ function si(n, e) {
4565
4538
  var t;
4566
4539
  return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
4567
4540
  }
@@ -4572,15 +4545,15 @@ function He(n, e) {
4572
4545
  return r._def.openapi = this._def.openapi, r;
4573
4546
  };
4574
4547
  }
4575
- function ai(n) {
4548
+ function ri(n) {
4576
4549
  if (typeof n.ZodType.prototype.openapi < "u")
4577
4550
  return;
4578
4551
  n.ZodType.prototype.openapi = function(r, a) {
4579
4552
  var o, c, d, u, l, T;
4580
- const C = typeof r == "string" ? a : r, L = C ?? {}, { param: J } = 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 || J ? {
4581
- 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), J)
4553
+ const C = typeof r == "string" ? a : r, L = C ?? {}, { param: K } = L, re = ni(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 ? {
4554
+ 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)
4582
4555
  } : 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) }));
4583
- if (ri(this, "ZodObject")) {
4556
+ if (si(this, "ZodObject")) {
4584
4557
  const $e = this.extend;
4585
4558
  ue.extend = function(...Pe) {
4586
4559
  var Q, H, Y, le, Te, Oe;
@@ -4651,14 +4624,14 @@ var I;
4651
4624
  }
4652
4625
  n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
4653
4626
  })(I || (I = {}));
4654
- var on;
4627
+ var rn;
4655
4628
  (function(n) {
4656
4629
  n.mergeShapes = (e, t) => ({
4657
4630
  ...e,
4658
4631
  ...t
4659
4632
  // second overwrites first
4660
4633
  });
4661
- })(on || (on = {}));
4634
+ })(rn || (rn = {}));
4662
4635
  const g = I.arrayToEnum([
4663
4636
  "string",
4664
4637
  "nan",
@@ -4718,7 +4691,7 @@ const g = I.arrayToEnum([
4718
4691
  "invalid_intersection_types",
4719
4692
  "not_multiple_of",
4720
4693
  "not_finite"
4721
- ]), ii = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
4694
+ ]), ai = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
4722
4695
  class U extends Error {
4723
4696
  constructor(e) {
4724
4697
  super(), this.issues = [], this.addIssue = (s) => {
@@ -4835,12 +4808,12 @@ const qe = (n, e) => {
4835
4808
  }
4836
4809
  return { message: t };
4837
4810
  };
4838
- let Un = qe;
4839
- function oi(n) {
4840
- Un = n;
4811
+ let Ln = qe;
4812
+ function ii(n) {
4813
+ Ln = n;
4841
4814
  }
4842
4815
  function Ut() {
4843
- return Un;
4816
+ return Ln;
4844
4817
  }
4845
4818
  const Ft = (n) => {
4846
4819
  const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
@@ -4862,7 +4835,7 @@ const Ft = (n) => {
4862
4835
  path: a,
4863
4836
  message: c
4864
4837
  };
4865
- }, ci = [];
4838
+ }, oi = [];
4866
4839
  function m(n, e) {
4867
4840
  const t = Ut(), s = Ft({
4868
4841
  issueData: e,
@@ -4921,12 +4894,12 @@ class P {
4921
4894
  }
4922
4895
  const b = Object.freeze({
4923
4896
  status: "aborted"
4924
- }), Ve = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }), cn = (n) => n.status === "aborted", dn = (n) => n.status === "dirty", mt = (n) => n.status === "valid", _t = (n) => typeof Promise < "u" && n instanceof Promise;
4897
+ }), 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;
4925
4898
  function zt(n, e, t, s) {
4926
4899
  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");
4927
4900
  return e.get(n);
4928
4901
  }
4929
- function Fn(n, e, t, s, r) {
4902
+ function Vn(n, e, t, s, r) {
4930
4903
  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");
4931
4904
  return e.set(n, t), t;
4932
4905
  }
@@ -4943,7 +4916,7 @@ class ne {
4943
4916
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
4944
4917
  }
4945
4918
  }
4946
- const kn = (n, e) => {
4919
+ const vn = (n, e) => {
4947
4920
  if (mt(e))
4948
4921
  return { success: !0, data: e.value };
4949
4922
  if (!n.common.issues.length)
@@ -5033,7 +5006,7 @@ class j {
5033
5006
  data: e,
5034
5007
  parsedType: fe(e)
5035
5008
  }, a = this._parseSync({ data: e, path: r.path, parent: r });
5036
- return kn(r, a);
5009
+ return vn(r, a);
5037
5010
  }
5038
5011
  async parseAsync(e, t) {
5039
5012
  const s = await this.safeParseAsync(e, t);
@@ -5054,7 +5027,7 @@ class j {
5054
5027
  data: e,
5055
5028
  parsedType: fe(e)
5056
5029
  }, r = this._parse({ data: e, path: s.path, parent: s }), a = await (_t(r) ? r : Promise.resolve(r));
5057
- return kn(s, a);
5030
+ return vn(s, a);
5058
5031
  }
5059
5032
  refine(e, t) {
5060
5033
  const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
@@ -5070,7 +5043,7 @@ class j {
5070
5043
  return this._refinement((s, r) => e(s) ? !0 : (r.addIssue(typeof t == "function" ? t(s, r) : t), !1));
5071
5044
  }
5072
5045
  _refinement(e) {
5073
- return new K({
5046
+ return new J({
5074
5047
  schema: this,
5075
5048
  typeName: k.ZodEffects,
5076
5049
  effect: { type: "refinement", refinement: e }
@@ -5092,7 +5065,7 @@ class j {
5092
5065
  return W.create(this, this._def);
5093
5066
  }
5094
5067
  promise() {
5095
- return Je.create(this, this._def);
5068
+ return Ke.create(this, this._def);
5096
5069
  }
5097
5070
  or(e) {
5098
5071
  return wt.create([this, e], this._def);
@@ -5101,7 +5074,7 @@ class j {
5101
5074
  return kt.create(this, e, this._def);
5102
5075
  }
5103
5076
  transform(e) {
5104
- return new K({
5077
+ return new J({
5105
5078
  ...S(this._def),
5106
5079
  schema: this,
5107
5080
  typeName: k.ZodEffects,
@@ -5118,7 +5091,7 @@ class j {
5118
5091
  });
5119
5092
  }
5120
5093
  brand() {
5121
- return new _n({
5094
+ return new fn({
5122
5095
  typeName: k.ZodBranded,
5123
5096
  type: this,
5124
5097
  ...S(this._def)
@@ -5153,23 +5126,23 @@ class j {
5153
5126
  return this.safeParse(null).success;
5154
5127
  }
5155
5128
  }
5156
- 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})+$";
5157
- let tn;
5158
- 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}=))?$/, zn = "((\\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(`^${zn}$`);
5159
- function Bn(n) {
5129
+ const ci = /^c[^\s-]{8,}$/i, di = /^[0-9a-z]+$/, ui = /^[0-9A-HJKMNP-TV-Z]{26}$/, li = /^[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, pi = /^[a-z0-9_-]{21}$/i, hi = /^[-+]?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)?)??$/, fi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, mi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
5130
+ let Xt;
5131
+ const _i = /^(?:(?: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])$/, gi = /^(([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})))$/, yi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Un = "((\\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])))", vi = new RegExp(`^${Un}$`);
5132
+ function Fn(n) {
5160
5133
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
5161
5134
  return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
5162
5135
  }
5163
- function ki(n) {
5164
- return new RegExp(`^${Bn(n)}$`);
5136
+ function wi(n) {
5137
+ return new RegExp(`^${Fn(n)}$`);
5165
5138
  }
5166
- function Wn(n) {
5167
- let e = `${zn}T${Bn(n)}`;
5139
+ function zn(n) {
5140
+ let e = `${Un}T${Fn(n)}`;
5168
5141
  const t = [];
5169
5142
  return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
5170
5143
  }
5171
- function bi(n, e) {
5172
- return !!((e === "v4" || !e) && gi.test(n) || (e === "v6" || !e) && yi.test(n));
5144
+ function ki(n, e) {
5145
+ return !!((e === "v4" || !e) && _i.test(n) || (e === "v6" || !e) && gi.test(n));
5173
5146
  }
5174
5147
  class z extends j {
5175
5148
  _parse(e) {
@@ -5220,43 +5193,43 @@ class z extends j {
5220
5193
  message: a.message
5221
5194
  }), s.dirty());
5222
5195
  } else if (a.kind === "email")
5223
- mi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5196
+ fi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5224
5197
  validation: "email",
5225
5198
  code: h.invalid_string,
5226
5199
  message: a.message
5227
5200
  }), s.dirty());
5228
5201
  else if (a.kind === "emoji")
5229
- tn || (tn = new RegExp(_i, "u")), tn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5202
+ Xt || (Xt = new RegExp(mi, "u")), Xt.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5230
5203
  validation: "emoji",
5231
5204
  code: h.invalid_string,
5232
5205
  message: a.message
5233
5206
  }), s.dirty());
5234
5207
  else if (a.kind === "uuid")
5235
- pi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5208
+ li.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5236
5209
  validation: "uuid",
5237
5210
  code: h.invalid_string,
5238
5211
  message: a.message
5239
5212
  }), s.dirty());
5240
5213
  else if (a.kind === "nanoid")
5241
- hi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5214
+ pi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5242
5215
  validation: "nanoid",
5243
5216
  code: h.invalid_string,
5244
5217
  message: a.message
5245
5218
  }), s.dirty());
5246
5219
  else if (a.kind === "cuid")
5247
- di.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5220
+ ci.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5248
5221
  validation: "cuid",
5249
5222
  code: h.invalid_string,
5250
5223
  message: a.message
5251
5224
  }), s.dirty());
5252
5225
  else if (a.kind === "cuid2")
5253
- ui.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5226
+ di.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5254
5227
  validation: "cuid2",
5255
5228
  code: h.invalid_string,
5256
5229
  message: a.message
5257
5230
  }), s.dirty());
5258
5231
  else if (a.kind === "ulid")
5259
- li.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5232
+ ui.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5260
5233
  validation: "ulid",
5261
5234
  code: h.invalid_string,
5262
5235
  message: a.message
@@ -5287,27 +5260,27 @@ class z extends j {
5287
5260
  code: h.invalid_string,
5288
5261
  validation: { endsWith: a.value },
5289
5262
  message: a.message
5290
- }), s.dirty()) : a.kind === "datetime" ? Wn(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5263
+ }), s.dirty()) : a.kind === "datetime" ? zn(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5291
5264
  code: h.invalid_string,
5292
5265
  validation: "datetime",
5293
5266
  message: a.message
5294
- }), s.dirty()) : a.kind === "date" ? wi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5267
+ }), s.dirty()) : a.kind === "date" ? vi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5295
5268
  code: h.invalid_string,
5296
5269
  validation: "date",
5297
5270
  message: a.message
5298
- }), s.dirty()) : a.kind === "time" ? ki(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5271
+ }), s.dirty()) : a.kind === "time" ? wi(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5299
5272
  code: h.invalid_string,
5300
5273
  validation: "time",
5301
5274
  message: a.message
5302
- }), s.dirty()) : a.kind === "duration" ? fi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5275
+ }), s.dirty()) : a.kind === "duration" ? hi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5303
5276
  validation: "duration",
5304
5277
  code: h.invalid_string,
5305
5278
  message: a.message
5306
- }), s.dirty()) : a.kind === "ip" ? bi(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
5279
+ }), s.dirty()) : a.kind === "ip" ? ki(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
5307
5280
  validation: "ip",
5308
5281
  code: h.invalid_string,
5309
5282
  message: a.message
5310
- }), s.dirty()) : a.kind === "base64" ? vi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5283
+ }), s.dirty()) : a.kind === "base64" ? yi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5311
5284
  validation: "base64",
5312
5285
  code: h.invalid_string,
5313
5286
  message: a.message
@@ -5529,7 +5502,7 @@ z.create = (n) => {
5529
5502
  ...S(n)
5530
5503
  });
5531
5504
  };
5532
- function xi(n, e) {
5505
+ function bi(n, e) {
5533
5506
  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(".", ""));
5534
5507
  return a % o / Math.pow(10, r);
5535
5508
  }
@@ -5568,7 +5541,7 @@ class ve extends j {
5568
5541
  inclusive: a.inclusive,
5569
5542
  exact: !1,
5570
5543
  message: a.message
5571
- }), r.dirty()) : a.kind === "multipleOf" ? xi(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
5544
+ }), r.dirty()) : a.kind === "multipleOf" ? bi(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
5572
5545
  code: h.not_multiple_of,
5573
5546
  multipleOf: a.value,
5574
5547
  message: a.message
@@ -5980,7 +5953,7 @@ vt.create = (n) => new vt({
5980
5953
  typeName: k.ZodNull,
5981
5954
  ...S(n)
5982
5955
  });
5983
- class Ke extends j {
5956
+ class Je extends j {
5984
5957
  constructor() {
5985
5958
  super(...arguments), this._any = !0;
5986
5959
  }
@@ -5988,7 +5961,7 @@ class Ke extends j {
5988
5961
  return M(e.data);
5989
5962
  }
5990
5963
  }
5991
- Ke.create = (n) => new Ke({
5964
+ Je.create = (n) => new Je({
5992
5965
  typeName: k.ZodAny,
5993
5966
  ...S(n)
5994
5967
  });
@@ -6387,7 +6360,7 @@ class A extends j {
6387
6360
  });
6388
6361
  }
6389
6362
  keyof() {
6390
- return qn(I.objectKeys(this.shape));
6363
+ return Bn(I.objectKeys(this.shape));
6391
6364
  }
6392
6365
  }
6393
6366
  A.create = (n, e) => new A({
@@ -6484,7 +6457,7 @@ wt.create = (n, e) => new wt({
6484
6457
  typeName: k.ZodUnion,
6485
6458
  ...S(e)
6486
6459
  });
6487
- const ae = (n) => n instanceof xt ? ae(n.schema) : n instanceof K ? 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 _n || n instanceof jt ? ae(n.unwrap()) : n instanceof Zt ? ae(n._def.innerType) : [];
6460
+ 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 fn || n instanceof jt ? ae(n.unwrap()) : n instanceof Zt ? ae(n._def.innerType) : [];
6488
6461
  class Ht extends j {
6489
6462
  _parse(e) {
6490
6463
  const { ctx: t } = this._processInputParams(e);
@@ -6547,14 +6520,14 @@ class Ht extends j {
6547
6520
  });
6548
6521
  }
6549
6522
  }
6550
- function un(n, e) {
6523
+ function cn(n, e) {
6551
6524
  const t = fe(n), s = fe(e);
6552
6525
  if (n === e)
6553
6526
  return { valid: !0, data: n };
6554
6527
  if (t === g.object && s === g.object) {
6555
6528
  const r = I.objectKeys(e), a = I.objectKeys(n).filter((c) => r.indexOf(c) !== -1), o = { ...n, ...e };
6556
6529
  for (const c of a) {
6557
- const d = un(n[c], e[c]);
6530
+ const d = cn(n[c], e[c]);
6558
6531
  if (!d.valid)
6559
6532
  return { valid: !1 };
6560
6533
  o[c] = d.data;
@@ -6565,7 +6538,7 @@ function un(n, e) {
6565
6538
  return { valid: !1 };
6566
6539
  const r = [];
6567
6540
  for (let a = 0; a < n.length; a++) {
6568
- const o = n[a], c = e[a], d = un(o, c);
6541
+ const o = n[a], c = e[a], d = cn(o, c);
6569
6542
  if (!d.valid)
6570
6543
  return { valid: !1 };
6571
6544
  r.push(d.data);
@@ -6576,10 +6549,10 @@ function un(n, e) {
6576
6549
  class kt extends j {
6577
6550
  _parse(e) {
6578
6551
  const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
6579
- if (cn(a) || cn(o))
6552
+ if (an(a) || an(o))
6580
6553
  return b;
6581
- const c = un(a.value, o.value);
6582
- return c.valid ? ((dn(a) || dn(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(s, {
6554
+ const c = cn(a.value, o.value);
6555
+ return c.valid ? ((on(a) || on(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(s, {
6583
6556
  code: h.invalid_intersection_types
6584
6557
  }), b);
6585
6558
  };
@@ -6859,7 +6832,7 @@ class Fe extends j {
6859
6832
  });
6860
6833
  }
6861
6834
  const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
6862
- if (this._def.returns instanceof Je) {
6835
+ if (this._def.returns instanceof Ke) {
6863
6836
  const c = this;
6864
6837
  return M(async function(...d) {
6865
6838
  const u = new U([]), l = await c._def.args.parseAsync(d, a).catch((L) => {
@@ -6950,7 +6923,7 @@ Tt.create = (n, e) => new Tt({
6950
6923
  typeName: k.ZodLiteral,
6951
6924
  ...S(e)
6952
6925
  });
6953
- function qn(n, e) {
6926
+ function Bn(n, e) {
6954
6927
  return new ke({
6955
6928
  values: n,
6956
6929
  typeName: k.ZodEnum,
@@ -6970,7 +6943,7 @@ class ke extends j {
6970
6943
  code: h.invalid_type
6971
6944
  }), b;
6972
6945
  }
6973
- if (zt(this, Xe) || Fn(this, Xe, new Set(this._def.values)), !zt(this, Xe).has(e.data)) {
6946
+ if (zt(this, Xe) || Vn(this, Xe, new Set(this._def.values)), !zt(this, Xe).has(e.data)) {
6974
6947
  const t = this._getOrReturnCtx(e), s = this._def.values;
6975
6948
  return m(t, {
6976
6949
  received: t.data,
@@ -7015,7 +6988,7 @@ class ke extends j {
7015
6988
  }
7016
6989
  }
7017
6990
  Xe = /* @__PURE__ */ new WeakMap();
7018
- ke.create = qn;
6991
+ ke.create = Bn;
7019
6992
  class Ot extends j {
7020
6993
  constructor() {
7021
6994
  super(...arguments), et.set(this, void 0);
@@ -7030,7 +7003,7 @@ class Ot extends j {
7030
7003
  code: h.invalid_type
7031
7004
  }), b;
7032
7005
  }
7033
- if (zt(this, et) || Fn(this, et, new Set(I.getValidEnumValues(this._def.values))), !zt(this, et).has(e.data)) {
7006
+ if (zt(this, et) || Vn(this, et, new Set(I.getValidEnumValues(this._def.values))), !zt(this, et).has(e.data)) {
7034
7007
  const r = I.objectValues(t);
7035
7008
  return m(s, {
7036
7009
  received: s.data,
@@ -7050,7 +7023,7 @@ Ot.create = (n, e) => new Ot({
7050
7023
  typeName: k.ZodNativeEnum,
7051
7024
  ...S(e)
7052
7025
  });
7053
- class Je extends j {
7026
+ class Ke extends j {
7054
7027
  unwrap() {
7055
7028
  return this._def.type;
7056
7029
  }
@@ -7069,12 +7042,12 @@ class Je extends j {
7069
7042
  })));
7070
7043
  }
7071
7044
  }
7072
- Je.create = (n, e) => new Je({
7045
+ Ke.create = (n, e) => new Ke({
7073
7046
  type: n,
7074
7047
  typeName: k.ZodPromise,
7075
7048
  ...S(e)
7076
7049
  });
7077
- class K extends j {
7050
+ class J extends j {
7078
7051
  innerType() {
7079
7052
  return this._def.schema;
7080
7053
  }
@@ -7151,13 +7124,13 @@ class K extends j {
7151
7124
  I.assertNever(r);
7152
7125
  }
7153
7126
  }
7154
- K.create = (n, e, t) => new K({
7127
+ J.create = (n, e, t) => new J({
7155
7128
  schema: n,
7156
7129
  typeName: k.ZodEffects,
7157
7130
  effect: e,
7158
7131
  ...S(t)
7159
7132
  });
7160
- K.createWithPreprocess = (n, e, t) => new K({
7133
+ J.createWithPreprocess = (n, e, t) => new J({
7161
7134
  schema: e,
7162
7135
  effect: { type: "preprocess", transform: n },
7163
7136
  typeName: k.ZodEffects,
@@ -7252,7 +7225,7 @@ Zt.create = (n, e) => new Zt({
7252
7225
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
7253
7226
  ...S(e)
7254
7227
  });
7255
- class Kt extends j {
7228
+ class Jt extends j {
7256
7229
  _parse(e) {
7257
7230
  if (this._getType(e) !== g.nan) {
7258
7231
  const s = this._getOrReturnCtx(e);
@@ -7265,12 +7238,12 @@ class Kt extends j {
7265
7238
  return { status: "valid", value: e.data };
7266
7239
  }
7267
7240
  }
7268
- Kt.create = (n) => new Kt({
7241
+ Jt.create = (n) => new Jt({
7269
7242
  typeName: k.ZodNaN,
7270
7243
  ...S(n)
7271
7244
  });
7272
- const Ti = Symbol("zod_brand");
7273
- class _n extends j {
7245
+ const xi = Symbol("zod_brand");
7246
+ class fn extends j {
7274
7247
  _parse(e) {
7275
7248
  const { ctx: t } = this._processInputParams(e), s = t.data;
7276
7249
  return this._def.type._parse({
@@ -7337,25 +7310,25 @@ jt.create = (n, e) => new jt({
7337
7310
  typeName: k.ZodReadonly,
7338
7311
  ...S(e)
7339
7312
  });
7340
- function Kn(n, e = {}, t) {
7341
- return n ? Ke.create().superRefine((s, r) => {
7313
+ function Wn(n, e = {}, t) {
7314
+ return n ? Je.create().superRefine((s, r) => {
7342
7315
  var a, o;
7343
7316
  if (!n(s)) {
7344
7317
  const c = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, d = (o = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0, u = typeof c == "string" ? { message: c } : c;
7345
7318
  r.addIssue({ code: "custom", ...u, fatal: d });
7346
7319
  }
7347
- }) : Ke.create();
7320
+ }) : Je.create();
7348
7321
  }
7349
- const Oi = {
7322
+ const Ti = {
7350
7323
  object: A.lazycreate
7351
7324
  };
7352
7325
  var k;
7353
7326
  (function(n) {
7354
7327
  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";
7355
7328
  })(k || (k = {}));
7356
- const Si = (n, e = {
7329
+ const Oi = (n, e = {
7357
7330
  message: `Input not instance of ${n.name}`
7358
- }) => Kn((t) => t instanceof n, e), Jn = z.create, Qn = ve.create, Zi = Kt.create, ji = we.create, Hn = gt.create, Ni = Ce.create, Ii = Bt.create, Ci = yt.create, Ei = vt.create, Ai = Ke.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, Ki = Fe.create, Ji = xt.create, Qi = Tt.create, Hi = ke.create, Yi = Ot.create, Gi = Je.create, bn = K.create, Xi = X.create, eo = be.create, to = K.createWithPreprocess, no = It.create, so = () => Jn().optional(), ro = () => Qn().optional(), ao = () => Hn().optional(), io = {
7331
+ }) => Wn((t) => t instanceof n, e), qn = z.create, Jn = ve.create, Si = Jt.create, Zi = we.create, Kn = gt.create, ji = Ce.create, Ni = Bt.create, Ii = yt.create, Ci = vt.create, Ei = Je.create, Ai = je.create, Ri = oe.create, $i = Wt.create, Pi = W.create, Di = A.create, Mi = A.strictCreate, Li = wt.create, Vi = Ht.create, Ui = kt.create, Fi = se.create, zi = bt.create, Bi = qt.create, Wi = Ee.create, qi = Fe.create, Ji = xt.create, Ki = Tt.create, Qi = ke.create, Hi = Ot.create, Yi = Ke.create, wn = J.create, Gi = X.create, Xi = be.create, eo = J.createWithPreprocess, to = It.create, no = () => qn().optional(), so = () => Jn().optional(), ro = () => Kn().optional(), ao = {
7359
7332
  string: (n) => z.create({ ...n, coerce: !0 }),
7360
7333
  number: (n) => ve.create({ ...n, coerce: !0 }),
7361
7334
  boolean: (n) => gt.create({
@@ -7364,33 +7337,33 @@ const Si = (n, e = {
7364
7337
  }),
7365
7338
  bigint: (n) => we.create({ ...n, coerce: !0 }),
7366
7339
  date: (n) => Ce.create({ ...n, coerce: !0 })
7367
- }, oo = b;
7368
- var co = /* @__PURE__ */ Object.freeze({
7340
+ }, io = b;
7341
+ var oo = /* @__PURE__ */ Object.freeze({
7369
7342
  __proto__: null,
7370
7343
  defaultErrorMap: qe,
7371
- setErrorMap: oi,
7344
+ setErrorMap: ii,
7372
7345
  getErrorMap: Ut,
7373
7346
  makeIssue: Ft,
7374
- EMPTY_PATH: ci,
7347
+ EMPTY_PATH: oi,
7375
7348
  addIssueToContext: m,
7376
7349
  ParseStatus: P,
7377
7350
  INVALID: b,
7378
7351
  DIRTY: Ve,
7379
7352
  OK: M,
7380
- isAborted: cn,
7381
- isDirty: dn,
7353
+ isAborted: an,
7354
+ isDirty: on,
7382
7355
  isValid: mt,
7383
7356
  isAsync: _t,
7384
7357
  get util() {
7385
7358
  return I;
7386
7359
  },
7387
7360
  get objectUtil() {
7388
- return on;
7361
+ return rn;
7389
7362
  },
7390
7363
  ZodParsedType: g,
7391
7364
  getParsedType: fe,
7392
7365
  ZodType: j,
7393
- datetimeRegex: Wn,
7366
+ datetimeRegex: zn,
7394
7367
  ZodString: z,
7395
7368
  ZodNumber: ve,
7396
7369
  ZodBigInt: we,
@@ -7399,7 +7372,7 @@ var co = /* @__PURE__ */ Object.freeze({
7399
7372
  ZodSymbol: Bt,
7400
7373
  ZodUndefined: yt,
7401
7374
  ZodNull: vt,
7402
- ZodAny: Ke,
7375
+ ZodAny: Je,
7403
7376
  ZodUnknown: je,
7404
7377
  ZodNever: oe,
7405
7378
  ZodVoid: Wt,
@@ -7417,71 +7390,71 @@ var co = /* @__PURE__ */ Object.freeze({
7417
7390
  ZodLiteral: Tt,
7418
7391
  ZodEnum: ke,
7419
7392
  ZodNativeEnum: Ot,
7420
- ZodPromise: Je,
7421
- ZodEffects: K,
7422
- ZodTransformer: K,
7393
+ ZodPromise: Ke,
7394
+ ZodEffects: J,
7395
+ ZodTransformer: J,
7423
7396
  ZodOptional: X,
7424
7397
  ZodNullable: be,
7425
7398
  ZodDefault: St,
7426
7399
  ZodCatch: Zt,
7427
- ZodNaN: Kt,
7428
- BRAND: Ti,
7429
- ZodBranded: _n,
7400
+ ZodNaN: Jt,
7401
+ BRAND: xi,
7402
+ ZodBranded: fn,
7430
7403
  ZodPipeline: It,
7431
7404
  ZodReadonly: jt,
7432
- custom: Kn,
7405
+ custom: Wn,
7433
7406
  Schema: j,
7434
7407
  ZodSchema: j,
7435
- late: Oi,
7408
+ late: Ti,
7436
7409
  get ZodFirstPartyTypeKind() {
7437
7410
  return k;
7438
7411
  },
7439
- coerce: io,
7440
- any: Ai,
7441
- array: Di,
7442
- bigint: ji,
7443
- boolean: Hn,
7444
- date: Ni,
7445
- discriminatedUnion: Ui,
7446
- effect: bn,
7447
- enum: Hi,
7448
- function: Ki,
7449
- instanceof: Si,
7450
- intersection: Fi,
7412
+ coerce: ao,
7413
+ any: Ei,
7414
+ array: Pi,
7415
+ bigint: Zi,
7416
+ boolean: Kn,
7417
+ date: ji,
7418
+ discriminatedUnion: Vi,
7419
+ effect: wn,
7420
+ enum: Qi,
7421
+ function: qi,
7422
+ instanceof: Oi,
7423
+ intersection: Ui,
7451
7424
  lazy: Ji,
7452
- literal: Qi,
7453
- map: Wi,
7454
- nan: Zi,
7455
- nativeEnum: Yi,
7456
- never: $i,
7457
- null: Ei,
7458
- nullable: eo,
7459
- number: Qn,
7460
- object: Mi,
7461
- oboolean: ao,
7462
- onumber: ro,
7463
- optional: Xi,
7464
- ostring: so,
7465
- pipeline: no,
7466
- preprocess: to,
7467
- promise: Gi,
7468
- record: Bi,
7469
- set: qi,
7470
- strictObject: Li,
7471
- string: Jn,
7472
- symbol: Ii,
7473
- transformer: bn,
7474
- tuple: zi,
7475
- undefined: Ci,
7476
- union: Vi,
7477
- unknown: Ri,
7478
- void: Pi,
7479
- NEVER: oo,
7425
+ literal: Ki,
7426
+ map: Bi,
7427
+ nan: Si,
7428
+ nativeEnum: Hi,
7429
+ never: Ri,
7430
+ null: Ci,
7431
+ nullable: Xi,
7432
+ number: Jn,
7433
+ object: Di,
7434
+ oboolean: ro,
7435
+ onumber: so,
7436
+ optional: Gi,
7437
+ ostring: no,
7438
+ pipeline: to,
7439
+ preprocess: eo,
7440
+ promise: Yi,
7441
+ record: zi,
7442
+ set: Wi,
7443
+ strictObject: Mi,
7444
+ string: qn,
7445
+ symbol: Ni,
7446
+ transformer: wn,
7447
+ tuple: Fi,
7448
+ undefined: Ii,
7449
+ union: Li,
7450
+ unknown: Ai,
7451
+ void: $i,
7452
+ NEVER: io,
7480
7453
  ZodIssueCode: h,
7481
- quotelessJson: ii,
7454
+ quotelessJson: ai,
7482
7455
  ZodError: U
7483
7456
  });
7484
- ai(co);
7457
+ ri(oo);
7485
7458
  function Ct(n, e = "", t = {}) {
7486
7459
  for (let s in n)
7487
7460
  if (Object.prototype.hasOwnProperty.call(n, s)) {
@@ -7490,7 +7463,7 @@ function Ct(n, e = "", t = {}) {
7490
7463
  }
7491
7464
  return t;
7492
7465
  }
7493
- function uo(n, e) {
7466
+ function co(n, e) {
7494
7467
  const t = {};
7495
7468
  for (const [s, r] of Object.entries(n)) {
7496
7469
  const a = e.find(
@@ -7508,7 +7481,7 @@ function uo(n, e) {
7508
7481
  }
7509
7482
  return t;
7510
7483
  }
7511
- function lo(n) {
7484
+ function uo(n) {
7512
7485
  return async (e, t) => {
7513
7486
  const s = {
7514
7487
  themeId: Re(),
@@ -7519,16 +7492,16 @@ function lo(n) {
7519
7492
  return await n.insertInto("themes").values({ ...Ct(s), tenant_id: e }).execute(), s;
7520
7493
  };
7521
7494
  }
7522
- function po(n) {
7495
+ function lo(n) {
7523
7496
  return async (e, t) => (await n.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
7524
7497
  }
7525
- function ho(n) {
7498
+ function po(n) {
7526
7499
  return async (e, t) => {
7527
7500
  const s = await n.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).selectAll().executeTakeFirst();
7528
7501
  return s ? R(s) : null;
7529
7502
  };
7530
7503
  }
7531
- function fo(n) {
7504
+ function ho(n) {
7532
7505
  return async (e, t, s) => {
7533
7506
  const r = Ct({
7534
7507
  ...s,
@@ -7537,23 +7510,23 @@ function fo(n) {
7537
7510
  return await n.updateTable("themes").set(r).where("themes.id", "=", t).where("themes.tenant_id", "=", e).execute(), !0;
7538
7511
  };
7539
7512
  }
7540
- function mo(n) {
7513
+ function fo(n) {
7541
7514
  return {
7542
- create: lo(n),
7543
- get: ho(n),
7544
- remove: po(n),
7545
- update: fo(n)
7515
+ create: uo(n),
7516
+ get: po(n),
7517
+ remove: lo(n),
7518
+ update: ho(n)
7546
7519
  };
7547
7520
  }
7548
- function _o(n) {
7521
+ function mo(n) {
7549
7522
  return async (e, t) => {
7550
7523
  const s = (/* @__PURE__ */ new Date()).toISOString(), r = await n.selectFrom("logins").where("logins.expires_at", ">", s).where("logins.login_id", "=", t).selectAll().executeTakeFirst();
7551
- return r ? yr.parse(
7552
- uo(R(r), ["authParams"])
7524
+ return r ? gr.parse(
7525
+ co(R(r), ["authParams"])
7553
7526
  ) : null;
7554
7527
  };
7555
7528
  }
7556
- function go(n) {
7529
+ function _o(n) {
7557
7530
  return async (e, t) => {
7558
7531
  const s = {
7559
7532
  login_id: Re(),
@@ -7564,43 +7537,43 @@ function go(n) {
7564
7537
  return await n.insertInto("logins").values({ ...Ct(s), tenant_id: e }).execute(), s;
7565
7538
  };
7566
7539
  }
7567
- function yo(n) {
7540
+ function go(n) {
7568
7541
  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;
7569
7542
  }
7570
- function vo(n) {
7543
+ function yo(n) {
7571
7544
  return async (e, t) => (await n.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", t).execute()).length > 0;
7572
7545
  }
7573
- function wo(n) {
7546
+ function vo(n) {
7574
7547
  return {
7575
- create: go(n),
7576
- get: _o(n),
7577
- update: yo(n),
7578
- remove: vo(n)
7548
+ create: _o(n),
7549
+ get: mo(n),
7550
+ update: go(n),
7551
+ remove: yo(n)
7579
7552
  };
7580
7553
  }
7581
- function bo(n) {
7554
+ function ko(n) {
7582
7555
  return {
7583
- applications: Ia(n),
7584
- authenticationCodes: Ha(n),
7585
- branding: Ka(n),
7586
- clients: Da(n),
7587
- codes: wa(n),
7588
- connections: Pa(n),
7589
- domains: Ba(n),
7590
- hooks: ni(n),
7591
- keys: Ua(n),
7592
- logins: wo(n),
7593
- logs: Yr(n),
7594
- OTP: la(n),
7595
- passwords: ma(n),
7596
- users: Lr(n),
7597
- sessions: sa(n),
7598
- tenants: qr(n),
7599
- themes: mo(n),
7600
- tickets: oa(n),
7601
- universalLoginSessions: Ta(n)
7556
+ applications: Na(n),
7557
+ authenticationCodes: Qa(n),
7558
+ branding: qa(n),
7559
+ clients: Pa(n),
7560
+ codes: va(n),
7561
+ connections: $a(n),
7562
+ domains: za(n),
7563
+ hooks: ti(n),
7564
+ keys: Va(n),
7565
+ logins: vo(n),
7566
+ logs: Hr(n),
7567
+ OTP: ua(n),
7568
+ passwords: fa(n),
7569
+ users: Mr(n),
7570
+ sessions: na(n),
7571
+ tenants: Wr(n),
7572
+ themes: fo(n),
7573
+ tickets: ia(n),
7574
+ universalLoginSessions: xa(n)
7602
7575
  };
7603
7576
  }
7604
7577
  export {
7605
- bo as default
7578
+ ko as default
7606
7579
  };