authhero 0.264.0 → 0.265.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/authhero.mjs CHANGED
@@ -107,7 +107,7 @@ const E1 = [" ", ",", "?", "!", ";"], C1 = new A1(20), N1 = (t, e, n) => {
107
107
  i = a;
108
108
  }
109
109
  return i;
110
- }, io = (t) => t?.replace("_", "-"), j1 = {
110
+ }, oo = (t) => t?.replace("_", "-"), j1 = {
111
111
  type: "logger",
112
112
  log(t) {
113
113
  this.output("log", t);
@@ -535,12 +535,12 @@ class Gp {
535
535
  this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = qt.create("languageUtils");
536
536
  }
537
537
  getScriptPartFromCode(e) {
538
- if (e = io(e), !e || e.indexOf("-") < 0) return null;
538
+ if (e = oo(e), !e || e.indexOf("-") < 0) return null;
539
539
  const n = e.split("-");
540
540
  return n.length === 2 || (n.pop(), n[n.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(n.join("-"));
541
541
  }
542
542
  getLanguagePartFromCode(e) {
543
- if (e = io(e), !e || e.indexOf("-") < 0) return e;
543
+ if (e = oo(e), !e || e.indexOf("-") < 0) return e;
544
544
  const n = e.split("-");
545
545
  return this.formatLanguageCode(n[0]);
546
546
  }
@@ -618,7 +618,7 @@ class O1 {
618
618
  this.pluralRulesCache = {};
619
619
  }
620
620
  getRule(e, n = {}) {
621
- const r = io(e === "dev" ? "en" : e), i = n.ordinal ? "ordinal" : "cardinal", s = JSON.stringify({
621
+ const r = oo(e === "dev" ? "en" : e), i = n.ordinal ? "ordinal" : "cardinal", s = JSON.stringify({
622
622
  cleanedCode: r,
623
623
  type: i
624
624
  });
@@ -804,9 +804,9 @@ const T1 = (t) => {
804
804
  });
805
805
  const a = r + JSON.stringify(s);
806
806
  let c = e[a];
807
- return c || (c = t(io(r), i), e[a] = c), c(n);
807
+ return c || (c = t(oo(r), i), e[a] = c), c(n);
808
808
  };
809
- }, R1 = (t) => (e, n, r) => t(io(n), r)(e);
809
+ }, R1 = (t) => (e, n, r) => t(oo(n), r)(e);
810
810
  class B1 {
811
811
  constructor(e = {}) {
812
812
  this.logger = qt.create("formatter"), this.options = e, this.init(e);
@@ -1076,13 +1076,13 @@ const Yp = () => ({
1076
1076
  skipOnVariables: !0
1077
1077
  },
1078
1078
  cacheInBuiltFormats: !0
1079
- }), Qp = (t) => (Q(t.ns) && (t.ns = [t.ns]), Q(t.fallbackLng) && (t.fallbackLng = [t.fallbackLng]), Q(t.fallbackNS) && (t.fallbackNS = [t.fallbackNS]), t.supportedLngs?.indexOf?.("cimode") < 0 && (t.supportedLngs = t.supportedLngs.concat(["cimode"])), typeof t.initImmediate == "boolean" && (t.initAsync = t.initImmediate), t), os = () => {
1079
+ }), Qp = (t) => (Q(t.ns) && (t.ns = [t.ns]), Q(t.fallbackLng) && (t.fallbackLng = [t.fallbackLng]), Q(t.fallbackNS) && (t.fallbackNS = [t.fallbackNS]), t.supportedLngs?.indexOf?.("cimode") < 0 && (t.supportedLngs = t.supportedLngs.concat(["cimode"])), typeof t.initImmediate == "boolean" && (t.initAsync = t.initImmediate), t), ss = () => {
1080
1080
  }, D1 = (t) => {
1081
1081
  Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach((n) => {
1082
1082
  typeof t[n] == "function" && (t[n] = t[n].bind(t));
1083
1083
  });
1084
1084
  };
1085
- class oo extends ba {
1085
+ class so extends ba {
1086
1086
  constructor(e = {}, n) {
1087
1087
  if (super(), this.options = Qp(e), this.services = {}, this.logger = qt, this.modules = {
1088
1088
  external: []
@@ -1126,7 +1126,7 @@ class oo extends ba {
1126
1126
  _.init && _.init(this);
1127
1127
  });
1128
1128
  }
1129
- if (this.format = this.options.interpolation.format, n || (n = os), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1129
+ if (this.format = this.options.interpolation.format, n || (n = ss), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1130
1130
  const d = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1131
1131
  d.length > 0 && d[0] !== "dev" && (this.options.lng = d[0]);
1132
1132
  }
@@ -1144,7 +1144,7 @@ class oo extends ba {
1144
1144
  };
1145
1145
  return this.options.resources || !this.options.initAsync ? l() : setTimeout(l, 0), c;
1146
1146
  }
1147
- loadResources(e, n = os) {
1147
+ loadResources(e, n = ss) {
1148
1148
  let r = n;
1149
1149
  const i = Q(e) ? e : this.language;
1150
1150
  if (typeof e == "function" && (r = e), !this.options.resources || this.options.partialBundledLanguages) {
@@ -1163,7 +1163,7 @@ class oo extends ba {
1163
1163
  }
1164
1164
  reloadResources(e, n, r) {
1165
1165
  const i = bi();
1166
- return typeof e == "function" && (r = e, e = void 0), typeof n == "function" && (r = n, n = void 0), e || (e = this.languages), n || (n = this.options.ns), r || (r = os), this.services.backendConnector.reload(e, n, (s) => {
1166
+ return typeof e == "function" && (r = e, e = void 0), typeof n == "function" && (r = n, n = void 0), e || (e = this.languages), n || (n = this.options.ns), r || (r = ss), this.services.backendConnector.reload(e, n, (s) => {
1167
1167
  i.resolve(), r(s);
1168
1168
  }), i;
1169
1169
  }
@@ -1275,16 +1275,16 @@ class oo extends ba {
1275
1275
  return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : n.indexOf(r.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1276
1276
  }
1277
1277
  static createInstance(e = {}, n) {
1278
- return new oo(e, n);
1278
+ return new so(e, n);
1279
1279
  }
1280
- cloneInstance(e = {}, n = os) {
1280
+ cloneInstance(e = {}, n = ss) {
1281
1281
  const r = e.forkResourceStore;
1282
1282
  r && delete e.forkResourceStore;
1283
1283
  const i = {
1284
1284
  ...this.options,
1285
1285
  ...e,
1286
1286
  isClone: !0
1287
- }, s = new oo(i);
1287
+ }, s = new so(i);
1288
1288
  if ((e.debug !== void 0 || e.prefix !== void 0) && (s.logger = s.logger.clone(e)), ["store", "services", "language"].forEach((c) => {
1289
1289
  s[c] = this[c];
1290
1290
  }), s.services = {
@@ -1315,8 +1315,8 @@ class oo extends ba {
1315
1315
  };
1316
1316
  }
1317
1317
  }
1318
- const y = oo.createInstance();
1319
- y.createInstance = oo.createInstance;
1318
+ const y = so.createInstance();
1319
+ y.createInstance = so.createInstance;
1320
1320
  y.createInstance;
1321
1321
  y.dir;
1322
1322
  y.init;
@@ -1637,7 +1637,7 @@ const _l = o.object({
1637
1637
  ...yl.shape,
1638
1638
  created_at: o.string().optional(),
1639
1639
  updated_at: o.string().optional()
1640
- }), AK = o.array(Ir), Oo = o.object({
1640
+ }), AK = o.array(Ir), Po = o.object({
1641
1641
  x: o.number(),
1642
1642
  y: o.number()
1643
1643
  });
@@ -1765,7 +1765,7 @@ const Z1 = o.object({
1765
1765
  "STEP"
1766
1766
  /* STEP */
1767
1767
  ),
1768
- coordinates: Oo,
1768
+ coordinates: Po,
1769
1769
  alias: o.string().optional(),
1770
1770
  config: o.object({
1771
1771
  components: o.array(J1),
@@ -1777,7 +1777,7 @@ const Z1 = o.object({
1777
1777
  "FLOW"
1778
1778
  /* FLOW */
1779
1779
  ),
1780
- coordinates: Oo,
1780
+ coordinates: Po,
1781
1781
  alias: o.string().optional(),
1782
1782
  config: o.object({
1783
1783
  flow_id: o.string(),
@@ -1786,17 +1786,17 @@ const Z1 = o.object({
1786
1786
  }), Q1 = o.object({
1787
1787
  id: o.string(),
1788
1788
  type: o.string(),
1789
- coordinates: Oo
1789
+ coordinates: Po
1790
1790
  }).passthrough(), ew = o.union([
1791
1791
  Z1,
1792
1792
  Y1,
1793
1793
  Q1
1794
1794
  ]), tw = o.object({
1795
1795
  next_node: o.string(),
1796
- coordinates: Oo
1796
+ coordinates: Po
1797
1797
  }).passthrough(), nw = o.object({
1798
1798
  resume_flow: o.boolean().optional(),
1799
- coordinates: Oo
1799
+ coordinates: Po
1800
1800
  }).passthrough(), rw = o.object({
1801
1801
  id: o.string(),
1802
1802
  name: o.string(),
@@ -1883,7 +1883,7 @@ const Ns = o.object({
1883
1883
  id: o.string(),
1884
1884
  created_at: o.string().transform((t) => t === null ? "" : t),
1885
1885
  updated_at: o.string().transform((t) => t === null ? "" : t)
1886
- }).extend(wl.shape), fs = o.object({
1886
+ }).extend(wl.shape), hs = o.object({
1887
1887
  id: o.string().optional(),
1888
1888
  // Basic settings
1889
1889
  audience: o.string(),
@@ -2006,7 +2006,7 @@ const Ns = o.object({
2006
2006
  }), Fn = o.object({
2007
2007
  created_at: o.string().nullable().transform((t) => t ?? ""),
2008
2008
  updated_at: o.string().nullable().transform((t) => t ?? ""),
2009
- ...fs.shape,
2009
+ ...hs.shape,
2010
2010
  id: o.string()
2011
2011
  });
2012
2012
  o.object({
@@ -2275,7 +2275,7 @@ const iw = o.enum([
2275
2275
  ttl_sec: o.number().int().max(2592e3).default(604800).optional(),
2276
2276
  roles: o.array(o.string()).default([]).optional(),
2277
2277
  send_invitation_email: o.boolean().default(!0).optional()
2278
- }), hs = o.object({
2278
+ }), gs = o.object({
2279
2279
  id: o.string(),
2280
2280
  organization_id: o.string().max(50),
2281
2281
  created_at: o.string().datetime(),
@@ -3272,7 +3272,7 @@ function fu(t, e) {
3272
3272
  );
3273
3273
  t < 4 ? t = 4 : t > 31 && (t = 31);
3274
3274
  var n = [];
3275
- return n.push("$2b$"), t < 10 && n.push("0"), n.push(t.toString()), n.push("$"), n.push(js(Gw(so), so)), n.join("");
3275
+ return n.push("$2b$"), t < 10 && n.push("0"), n.push(t.toString()), n.push("$"), n.push(js(Gw(ao), ao)), n.join("");
3276
3276
  }
3277
3277
  function I0(t, e, n) {
3278
3278
  if (typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), typeof t > "u") t = hu;
@@ -3570,7 +3570,7 @@ function B0(t, e) {
3570
3570
  for (n = 0; n < i; n++) g.push(s[n].charCodeAt(0));
3571
3571
  return g;
3572
3572
  }
3573
- var so = 16, hu = 10, tb = 16, nb = 100, of = [
3573
+ var ao = 16, hu = 10, tb = 16, nb = 100, of = [
3574
3574
  608135816,
3575
3575
  2242054355,
3576
3576
  320440878,
@@ -4622,7 +4622,7 @@ var so = 16, hu = 10, tb = 16, nb = 100, of = [
4622
4622
  1668446532,
4623
4623
  1869963892
4624
4624
  ];
4625
- function ao(t, e, n, r) {
4625
+ function co(t, e, n, r) {
4626
4626
  var i, s = t[e], a = t[e + 1];
4627
4627
  return s ^= n[0], i = r[s >>> 24], i += r[256 | s >> 16 & 255], i ^= r[512 | s >> 8 & 255], i += r[768 | s & 255], a ^= i ^ n[1], i = r[a >>> 24], i += r[256 | a >> 16 & 255], i ^= r[512 | a >> 8 & 255], i += r[768 | a & 255], s ^= i ^ n[2], i = r[s >>> 24], i += r[256 | s >> 16 & 255], i ^= r[512 | s >> 8 & 255], i += r[768 | s & 255], a ^= i ^ n[3], i = r[a >>> 24], i += r[256 | a >> 16 & 255], i ^= r[512 | a >> 8 & 255], i += r[768 | a & 255], s ^= i ^ n[4], i = r[s >>> 24], i += r[256 | s >> 16 & 255], i ^= r[512 | s >> 8 & 255], i += r[768 | s & 255], a ^= i ^ n[5], i = r[a >>> 24], i += r[256 | a >> 16 & 255], i ^= r[512 | a >> 8 & 255], i += r[768 | a & 255], s ^= i ^ n[6], i = r[s >>> 24], i += r[256 | s >> 16 & 255], i ^= r[512 | s >> 8 & 255], i += r[768 | s & 255], a ^= i ^ n[7], i = r[a >>> 24], i += r[256 | a >> 16 & 255], i ^= r[512 | a >> 8 & 255], i += r[768 | a & 255], s ^= i ^ n[8], i = r[s >>> 24], i += r[256 | s >> 16 & 255], i ^= r[512 | s >> 8 & 255], i += r[768 | s & 255], a ^= i ^ n[9], i = r[a >>> 24], i += r[256 | a >> 16 & 255], i ^= r[512 | a >> 8 & 255], i += r[768 | a & 255], s ^= i ^ n[10], i = r[s >>> 24], i += r[256 | s >> 16 & 255], i ^= r[512 | s >> 8 & 255], i += r[768 | s & 255], a ^= i ^ n[11], i = r[a >>> 24], i += r[256 | a >> 16 & 255], i ^= r[512 | a >> 8 & 255], i += r[768 | a & 255], s ^= i ^ n[12], i = r[s >>> 24], i += r[256 | s >> 16 & 255], i ^= r[512 | s >> 8 & 255], i += r[768 | s & 255], a ^= i ^ n[13], i = r[a >>> 24], i += r[256 | a >> 16 & 255], i ^= r[512 | a >> 8 & 255], i += r[768 | a & 255], s ^= i ^ n[14], i = r[s >>> 24], i += r[256 | s >> 16 & 255], i ^= r[512 | s >> 8 & 255], i += r[768 | s & 255], a ^= i ^ n[15], i = r[a >>> 24], i += r[256 | a >> 16 & 255], i ^= r[512 | a >> 8 & 255], i += r[768 | a & 255], s ^= i ^ n[16], t[e] = a ^ n[tb + 1], t[e + 1] = s, t;
4628
4628
  }
@@ -4635,17 +4635,17 @@ function af(t, e, n) {
4635
4635
  for (var r = 0, i = [0, 0], s = e.length, a = n.length, c, l = 0; l < s; l++)
4636
4636
  c = Sr(t, r), r = c.offp, e[l] = e[l] ^ c.key;
4637
4637
  for (l = 0; l < s; l += 2)
4638
- i = ao(i, 0, e, n), e[l] = i[0], e[l + 1] = i[1];
4638
+ i = co(i, 0, e, n), e[l] = i[0], e[l + 1] = i[1];
4639
4639
  for (l = 0; l < a; l += 2)
4640
- i = ao(i, 0, e, n), n[l] = i[0], n[l + 1] = i[1];
4640
+ i = co(i, 0, e, n), n[l] = i[0], n[l + 1] = i[1];
4641
4641
  }
4642
4642
  function rb(t, e, n, r) {
4643
4643
  for (var i = 0, s = [0, 0], a = n.length, c = r.length, l, d = 0; d < a; d++)
4644
4644
  l = Sr(e, i), i = l.offp, n[d] = n[d] ^ l.key;
4645
4645
  for (i = 0, d = 0; d < a; d += 2)
4646
- l = Sr(t, i), i = l.offp, s[0] ^= l.key, l = Sr(t, i), i = l.offp, s[1] ^= l.key, s = ao(s, 0, n, r), n[d] = s[0], n[d + 1] = s[1];
4646
+ l = Sr(t, i), i = l.offp, s[0] ^= l.key, l = Sr(t, i), i = l.offp, s[1] ^= l.key, s = co(s, 0, n, r), n[d] = s[0], n[d + 1] = s[1];
4647
4647
  for (d = 0; d < c; d += 2)
4648
- l = Sr(t, i), i = l.offp, s[0] ^= l.key, l = Sr(t, i), i = l.offp, s[1] ^= l.key, s = ao(s, 0, n, r), r[d] = s[0], r[d + 1] = s[1];
4648
+ l = Sr(t, i), i = l.offp, s[0] ^= l.key, l = Sr(t, i), i = l.offp, s[1] ^= l.key, s = co(s, 0, n, r), r[d] = s[0], r[d + 1] = s[1];
4649
4649
  }
4650
4650
  function cf(t, e, n, r, i) {
4651
4651
  var s = L0.slice(), a = s.length, c;
@@ -4654,9 +4654,9 @@ function cf(t, e, n, r, i) {
4654
4654
  xt(r.bind(this, c));
4655
4655
  return;
4656
4656
  } else throw c;
4657
- if (e.length !== so)
4657
+ if (e.length !== ao)
4658
4658
  if (c = Error(
4659
- "Illegal salt length: " + e.length + " != " + so
4659
+ "Illegal salt length: " + e.length + " != " + ao
4660
4660
  ), r) {
4661
4661
  xt(r.bind(this, c));
4662
4662
  return;
@@ -4670,7 +4670,7 @@ function cf(t, e, n, r, i) {
4670
4670
  ;
4671
4671
  else {
4672
4672
  for (p = 0; p < 64; p++)
4673
- for (f = 0; f < a >> 1; f++) ao(s, f << 1, l, d);
4673
+ for (f = 0; f < a >> 1; f++) co(s, f << 1, l, d);
4674
4674
  var x = [];
4675
4675
  for (p = 0; p < a; p++)
4676
4676
  x.push((s[p] >> 24 & 255) >>> 0), x.push((s[p] >> 16 & 255) >>> 0), x.push((s[p] >> 8 & 255) >>> 0), x.push((s[p] & 255) >>> 0);
@@ -4715,7 +4715,7 @@ function Cl(t, e, n, r) {
4715
4715
  } else throw i;
4716
4716
  var c = parseInt(e.substring(a, a + 1), 10) * 10, l = parseInt(e.substring(a + 1, a + 2), 10), d = c + l, p = e.substring(a + 3, a + 25);
4717
4717
  t += s >= "a" ? "\0" : "";
4718
- var f = eb(t), g = B0(p, so);
4718
+ var f = eb(t), g = B0(p, ao);
4719
4719
  function _(w) {
4720
4720
  var x = [];
4721
4721
  return x.push("$2"), s >= "a" && x.push(s), x.push("$"), d < 10 && x.push("0"), x.push(d.toString()), x.push("$"), x.push(js(g, g.length)), x.push(js(w, L0.length * 4 - 1)), x.join("");
@@ -4772,7 +4772,7 @@ const lb = 24;
4772
4772
  function ka() {
4773
4773
  return U0("0123456789abcdef", lb)();
4774
4774
  }
4775
- function ss(t) {
4775
+ function as(t) {
4776
4776
  if (!t.includes("|"))
4777
4777
  return console.error("Invalid user_id format"), t;
4778
4778
  const [, e] = t.split("|");
@@ -5173,7 +5173,7 @@ async function wb(t, e) {
5173
5173
  includePadding: !1
5174
5174
  });
5175
5175
  }
5176
- const as = 300, Sa = 720 * 60 * 60, Yn = 1440 * 60, bb = "auth-token", gs = 1800 * 1e3, jl = 10080 * 60 * 1e3, vb = 300, $b = 300, kb = 1800 * 1e3, xb = 1800 * 1e3, Sb = 1440 * 60 * 1e3;
5176
+ const cs = 300, Sa = 720 * 60 * 60, Yn = 1440 * 60, bb = "auth-token", ms = 1800 * 1e3, jl = 10080 * 60 * 1e3, vb = 300, $b = 300, kb = 1800 * 1e3, xb = 1800 * 1e3, Sb = 1440 * 60 * 1e3;
5177
5177
  function q0(t, e, n) {
5178
5178
  const r = [];
5179
5179
  return r.push([encodeURIComponent(t), encodeURIComponent(e)]), n?.domain !== void 0 && r.push(["Domain", n.domain]), n?.expires !== void 0 && r.push(["Expires", n.expires.toUTCString()]), n?.httpOnly && r.push(["HttpOnly"]), n?.maxAge !== void 0 && r.push(["Max-Age", n.maxAge.toString()]), n?.path !== void 0 && r.push(["Path", n.path]), n?.sameSite === "lax" && r.push(["SameSite", "Lax"]), n?.sameSite === "none" && r.push(["SameSite", "None"]), n?.sameSite === "strict" && r.push(["SameSite", "Strict"]), n?.secure && r.push(["Secure"]), r.map((i) => i.join("=")).join("; ");
@@ -5221,7 +5221,7 @@ function Os(t, e, n) {
5221
5221
  domain: n ? F0(n) : void 0
5222
5222
  });
5223
5223
  }
5224
- class z extends v {
5224
+ class D extends v {
5225
5225
  constructor(e, n) {
5226
5226
  super(e, {
5227
5227
  message: JSON.stringify(n),
@@ -6276,27 +6276,27 @@ function Qb(t, e, n) {
6276
6276
  }
6277
6277
  async function ev(t, e, n, r, i) {
6278
6278
  if (!n.redirect_uri)
6279
- throw new z(400, {
6279
+ throw new D(400, {
6280
6280
  message: "Missing redirect_uri in authParams"
6281
6281
  });
6282
6282
  if (!r.email)
6283
- throw new z(400, {
6283
+ throw new D(400, {
6284
6284
  message: "Missing email in user"
6285
6285
  });
6286
6286
  const { signingKeys: s } = await t.env.data.keys.list({
6287
6287
  q: "type:saml_encryption"
6288
6288
  }), [a] = s;
6289
6289
  if (!a)
6290
- throw new z(500, {
6290
+ throw new D(500, {
6291
6291
  message: "No signing key found"
6292
6292
  });
6293
6293
  if (!e.addons?.samlp)
6294
- throw new z(400, {
6294
+ throw new D(400, {
6295
6295
  message: `SAML Addon is not enabled for client ${e.client_id}`
6296
6296
  });
6297
6297
  const { recipient: c, audience: l } = e.addons.samlp, d = n.state || "";
6298
6298
  if (!c || !d || !r || !n.state)
6299
- throw new z(400, {
6299
+ throw new D(400, {
6300
6300
  message: "Missing recipient or inResponseTo"
6301
6301
  });
6302
6302
  const p = JSON.parse(n.state), f = new URL(n.redirect_uri), g = t.env.samlSigner || (t.env.SAML_SIGN_URL ? new Yb(t.env.SAML_SIGN_URL) : void 0), _ = await Zb(
@@ -6442,7 +6442,7 @@ async function Ps(t, e) {
6442
6442
  })).userOrganizations.some(
6443
6443
  (X) => X.organization_id === a
6444
6444
  ))
6445
- throw new z(403, {
6445
+ throw new D(403, {
6446
6446
  error: "access_denied",
6447
6447
  error_description: "User is not a member of the specified organization"
6448
6448
  });
@@ -6527,7 +6527,7 @@ async function Aa(t, e) {
6527
6527
  (O) => !O.revoked_at || new Date(O.revoked_at) > /* @__PURE__ */ new Date()
6528
6528
  ), f = p[p.length - 1];
6529
6529
  if (!f?.pkcs7)
6530
- throw new z(500, { message: "No signing key available" });
6530
+ throw new D(500, { message: "No signing key available" });
6531
6531
  const g = yb(f.pkcs7), _ = t.var.custom_domain ? `https://${t.var.custom_domain}/` : t.env.ISSUER, w = {
6532
6532
  // TODO: consider if the dafault should be removed
6533
6533
  aud: n.audience || "default",
@@ -6590,7 +6590,7 @@ async function Aa(t, e) {
6590
6590
  },
6591
6591
  access: {
6592
6592
  deny: (O) => {
6593
- throw new z(400, {
6593
+ throw new D(400, {
6594
6594
  message: `Access denied: ${O}`
6595
6595
  });
6596
6596
  }
@@ -6713,7 +6713,7 @@ async function Kt(t, e) {
6713
6713
  const a = n.response_type || Et.CODE, c = n.response_mode || sn.QUERY;
6714
6714
  if (i) {
6715
6715
  if (!e.loginSession)
6716
- throw new z(500, {
6716
+ throw new D(500, {
6717
6717
  message: "Login session not found for ticket auth."
6718
6718
  });
6719
6719
  const _ = _b(), w = me(12), x = await t.env.data.codes.create(r.tenant.id, {
@@ -6744,7 +6744,7 @@ async function Kt(t, e) {
6744
6744
  });
6745
6745
  } else if (!d) {
6746
6746
  if (!e.loginSession)
6747
- throw new z(500, {
6747
+ throw new D(500, {
6748
6748
  message: "Login session not found for creating a new session."
6749
6749
  });
6750
6750
  d = (await Z0(t, {
@@ -6791,7 +6791,7 @@ async function Kt(t, e) {
6791
6791
  return p;
6792
6792
  if (c === sn.WEB_MESSAGE) {
6793
6793
  if (!n.redirect_uri)
6794
- throw new z(400, {
6794
+ throw new D(400, {
6795
6795
  message: "Redirect URI not allowed for WEB_MESSAGE response mode."
6796
6796
  });
6797
6797
  const _ = new Headers();
@@ -6818,7 +6818,7 @@ async function Kt(t, e) {
6818
6818
  );
6819
6819
  }
6820
6820
  if (!n.redirect_uri)
6821
- throw new z(400, {
6821
+ throw new D(400, {
6822
6822
  message: "Redirect uri not found for this response mode."
6823
6823
  });
6824
6824
  const f = new Headers();
@@ -6843,7 +6843,7 @@ async function Kt(t, e) {
6843
6843
  ...n.scope && { scope: n.scope }
6844
6844
  }).toString();
6845
6845
  else
6846
- throw new z(500, {
6846
+ throw new D(500, {
6847
6847
  message: "Invalid token response for implicit flow."
6848
6848
  });
6849
6849
  return f.set("location", g.toString()), new Response("Redirecting", {
@@ -6864,7 +6864,7 @@ async function nv(t, e) {
6864
6864
  )).userOrganizations.some(
6865
6865
  (d) => d.organization_id === e.organization.id
6866
6866
  ))
6867
- throw new z(403, {
6867
+ throw new D(403, {
6868
6868
  error: "access_denied",
6869
6869
  error_description: "User is not a member of the specified organization"
6870
6870
  });
@@ -6884,7 +6884,7 @@ async function nv(t, e) {
6884
6884
  else {
6885
6885
  const l = n?.user_id || e.user?.user_id;
6886
6886
  if (!l)
6887
- throw new z(400, {
6887
+ throw new D(400, {
6888
6888
  error: "invalid_request",
6889
6889
  error_description: "User ID is required for user-based grants"
6890
6890
  });
@@ -6936,7 +6936,7 @@ async function nv(t, e) {
6936
6936
  }
6937
6937
  if (r === Et.CODE) {
6938
6938
  if (!n || !e.loginSession)
6939
- throw new z(500, {
6939
+ throw new D(500, {
6940
6940
  message: "User and loginSession is required for code flow"
6941
6941
  });
6942
6942
  return await J0(t, {
@@ -7161,7 +7161,7 @@ function fv(t, e) {
7161
7161
  if (t.var.client_id) {
7162
7162
  const a = await e.legacyClients.get(t.var.client_id);
7163
7163
  if (!a)
7164
- throw new z(400, {
7164
+ throw new D(400, {
7165
7165
  message: "Client not found"
7166
7166
  });
7167
7167
  r.email && await gv(t, a, e, r.email);
@@ -7226,7 +7226,7 @@ function hv(t, e) {
7226
7226
  return e.users.update(n, r, i);
7227
7227
  const s = await e.users.get(n, r);
7228
7228
  if (!s)
7229
- throw new z(404, {
7229
+ throw new D(404, {
7230
7230
  message: "User not found"
7231
7231
  });
7232
7232
  const a = {
@@ -7253,7 +7253,7 @@ function hv(t, e) {
7253
7253
  }
7254
7254
  },
7255
7255
  cancel: () => {
7256
- throw new z(400, {
7256
+ throw new D(400, {
7257
7257
  message: "User update cancelled by pre-update hook"
7258
7258
  });
7259
7259
  },
@@ -7261,7 +7261,7 @@ function hv(t, e) {
7261
7261
  }
7262
7262
  );
7263
7263
  } catch {
7264
- throw new z(400, {
7264
+ throw new D(400, {
7265
7265
  message: "Pre user update hook failed"
7266
7266
  });
7267
7267
  }
@@ -7383,7 +7383,7 @@ async function gv(t, e, n, r) {
7383
7383
  type: ie.FAILED_SIGNUP,
7384
7384
  description: i.reason || "Signup not allowed"
7385
7385
  });
7386
- throw se(t, n.logs.create(e.tenant.id, s)), new z(400, {
7386
+ throw se(t, n.logs.create(e.tenant.id, s)), new D(400, {
7387
7387
  message: i.reason || "Signups are disabled for this client"
7388
7388
  });
7389
7389
  }
@@ -7414,7 +7414,7 @@ function mv(t, e) {
7414
7414
  },
7415
7415
  {
7416
7416
  cancel: () => {
7417
- throw new z(400, {
7417
+ throw new D(400, {
7418
7418
  message: "User deletion cancelled by pre-deletion hook"
7419
7419
  });
7420
7420
  },
@@ -7428,7 +7428,7 @@ function mv(t, e) {
7428
7428
  type: ie.FAILED_HOOK,
7429
7429
  description: `Pre user deletion hook failed: ${c instanceof Error ? c.message : String(c)}`
7430
7430
  });
7431
- throw se(t, e.logs.create(n, l)), new z(400, {
7431
+ throw se(t, e.logs.create(n, l)), new D(400, {
7432
7432
  message: "Pre user deletion hook failed"
7433
7433
  });
7434
7434
  }
@@ -7439,7 +7439,7 @@ function mv(t, e) {
7439
7439
  type: ie.FAILED_HOOK,
7440
7440
  description: `Pre user deletion webhook failed: ${c instanceof Error ? c.message : String(c)}`
7441
7441
  });
7442
- throw se(t, e.logs.create(n, l)), new z(400, {
7442
+ throw se(t, e.logs.create(n, l)), new D(400, {
7443
7443
  message: "Pre user deletion webhook failed"
7444
7444
  });
7445
7445
  }
@@ -7494,7 +7494,7 @@ function mv(t, e) {
7494
7494
  return a;
7495
7495
  };
7496
7496
  }
7497
- function Po(t, e) {
7497
+ function To(t, e) {
7498
7498
  const n = e;
7499
7499
  return {
7500
7500
  ...e,
@@ -7739,7 +7739,7 @@ async function em(t, e, n, r, i, s) {
7739
7739
  return r;
7740
7740
  }
7741
7741
  function yv(t) {
7742
- return Po(t, t.env.data);
7742
+ return To(t, t.env.data);
7743
7743
  }
7744
7744
  async function mu(t, e, n) {
7745
7745
  return (await t.list(e, {
@@ -7790,7 +7790,7 @@ async function _u({
7790
7790
  throw new Error("Primary account not found");
7791
7791
  return a;
7792
7792
  }
7793
- async function co({
7793
+ async function lo({
7794
7794
  userAdapter: t,
7795
7795
  tenant_id: e,
7796
7796
  username: n,
@@ -7815,7 +7815,7 @@ async function Na(t, e) {
7815
7815
  profileData: l = {},
7816
7816
  ip: d = ""
7817
7817
  } = e;
7818
- let p = await co({
7818
+ let p = await lo({
7819
7819
  userAdapter: t.env.data.users,
7820
7820
  tenant_id: e.client.tenant.id,
7821
7821
  username: n,
@@ -8074,7 +8074,7 @@ const wf = ut.extend({
8074
8074
  provider: c,
8075
8075
  connection: l,
8076
8076
  password: d
8077
- } = e, p = e.user_id, f = p ? ss(p) : ka(), g = `${e.provider}|${f}`;
8077
+ } = e, p = e.user_id, f = p ? as(p) : ka(), g = `${e.provider}|${f}`;
8078
8078
  try {
8079
8079
  const _ = {
8080
8080
  email: n,
@@ -8116,7 +8116,7 @@ const wf = ut.extend({
8116
8116
  {
8117
8117
  connection: w.connection,
8118
8118
  provider: w.provider,
8119
- user_id: ss(w.user_id),
8119
+ user_id: as(w.user_id),
8120
8120
  isSocial: w.is_social
8121
8121
  }
8122
8122
  ]
@@ -8214,7 +8214,7 @@ const wf = ut.extend({
8214
8214
  if (a === "Username-Password-Authentication")
8215
8215
  _ = {
8216
8216
  provider: p.provider,
8217
- user_id: ss(d)
8217
+ user_id: as(d)
8218
8218
  };
8219
8219
  else
8220
8220
  throw new v(400, {
@@ -8322,7 +8322,7 @@ const wf = ut.extend({
8322
8322
  }), a = [i, ...s.users].map((c) => ({
8323
8323
  connection: c.connection,
8324
8324
  provider: c.provider,
8325
- user_id: ss(c.user_id),
8325
+ user_id: as(c.user_id),
8326
8326
  isSocial: c.is_social
8327
8327
  }));
8328
8328
  return t.json(a, { status: 201 });
@@ -9071,13 +9071,13 @@ function kv() {
9071
9071
  var E, B, Z;
9072
9072
  {
9073
9073
  var Ae = $.toString;
9074
- if (is(Ae)) {
9074
+ if (os(Ae)) {
9075
9075
  var B = Ae.call($);
9076
9076
  if (!Te(B))
9077
9077
  return B;
9078
9078
  }
9079
9079
  var E = $.valueOf;
9080
- if (is(E)) {
9080
+ if (os(E)) {
9081
9081
  var B = E.call($);
9082
9082
  if (!Te(B))
9083
9083
  return B;
@@ -9098,7 +9098,7 @@ function kv() {
9098
9098
  function Pp($) {
9099
9099
  return Array.isArray ? Array.isArray($) : $ instanceof Object ? $ instanceof Array : Object.prototype.toString.call($) === "[object Array]";
9100
9100
  }
9101
- function is($) {
9101
+ function os($) {
9102
9102
  return typeof $ == "function";
9103
9103
  }
9104
9104
  function Tp($) {
@@ -9120,14 +9120,14 @@ function kv() {
9120
9120
  function Rp($, S) {
9121
9121
  var E = $[S];
9122
9122
  if (E != null) {
9123
- if (!is(E))
9123
+ if (!os(E))
9124
9124
  throw new TypeError();
9125
9125
  return E;
9126
9126
  }
9127
9127
  }
9128
9128
  function Bp($) {
9129
9129
  var S = Rp($, c);
9130
- if (!is(S))
9130
+ if (!os(S))
9131
9131
  throw new TypeError();
9132
9132
  var E = S.call($);
9133
9133
  if (!Te(E))
@@ -9982,7 +9982,7 @@ class ja {
9982
9982
  return yu(this.items);
9983
9983
  }
9984
9984
  }
9985
- const vi = [new Uint8Array([1])], xf = "0123456789", qc = "name", Sf = "valueHexView", Iv = "isHexOnly", Ov = "idBlock", Pv = "tagClass", Tv = "tagNumber", Rv = "isConstructed", Bv = "fromBER", Lv = "toBER", Uv = "local", ot = "", Rt = new ArrayBuffer(0), Ia = new Uint8Array(0), lo = "EndOfContent", rm = "OCTET STRING", im = "BIT STRING";
9985
+ const vi = [new Uint8Array([1])], xf = "0123456789", qc = "name", Sf = "valueHexView", Iv = "isHexOnly", Ov = "idBlock", Pv = "tagClass", Tv = "tagNumber", Rv = "isConstructed", Bv = "fromBER", Lv = "toBER", Uv = "local", ot = "", Rt = new ArrayBuffer(0), Ia = new Uint8Array(0), uo = "EndOfContent", rm = "OCTET STRING", im = "BIT STRING";
9986
9986
  function Wt(t) {
9987
9987
  var e;
9988
9988
  return e = class extends t {
@@ -10228,7 +10228,7 @@ class sm extends mr {
10228
10228
  }
10229
10229
  }
10230
10230
  sm.NAME = "lengthBlock";
10231
- const M = {};
10231
+ const z = {};
10232
10232
  class Fe extends mr {
10233
10233
  constructor({ name: e = ot, optional: n = !1, primitiveSchema: r, ...i } = {}, s) {
10234
10234
  super(i), this.name = e, this.optional = n, r && (this.primitiveSchema = r), this.idBlock = new om(i), this.lenBlock = new sm(i), this.valueBlock = s ? new s(i) : new nt(i);
@@ -10281,7 +10281,7 @@ class Fe extends mr {
10281
10281
  Fe.NAME = "BaseBlock";
10282
10282
  function am(t) {
10283
10283
  var e;
10284
- if (t instanceof M.Constructed)
10284
+ if (t instanceof z.Constructed)
10285
10285
  for (const n of t.valueBlock.value)
10286
10286
  am(n) && (t.lenBlock.isIndefiniteForm = !0);
10287
10287
  return !!(!((e = t.lenBlock) === null || e === void 0) && e.isIndefiniteForm);
@@ -10312,14 +10312,14 @@ class cm extends Wt(nt) {
10312
10312
  }
10313
10313
  cm.NAME = "PrimitiveValueBlock";
10314
10314
  var lm;
10315
- class To extends Fe {
10315
+ class Ro extends Fe {
10316
10316
  constructor(e = {}) {
10317
10317
  super(e, cm), this.idBlock.isConstructed = !1;
10318
10318
  }
10319
10319
  }
10320
- lm = To;
10321
- M.Primitive = lm;
10322
- To.NAME = "PRIMITIVE";
10320
+ lm = Ro;
10321
+ z.Primitive = lm;
10322
+ Ro.NAME = "PRIMITIVE";
10323
10323
  function Dv(t, e) {
10324
10324
  if (t instanceof e)
10325
10325
  return t;
@@ -10371,37 +10371,37 @@ function si(t, e = 0, n = t.length) {
10371
10371
  offset: -1,
10372
10372
  result: i
10373
10373
  };
10374
- l = M.EndOfContent;
10374
+ l = z.EndOfContent;
10375
10375
  break;
10376
10376
  case 1:
10377
- l = M.Boolean;
10377
+ l = z.Boolean;
10378
10378
  break;
10379
10379
  case 2:
10380
- l = M.Integer;
10380
+ l = z.Integer;
10381
10381
  break;
10382
10382
  case 3:
10383
- l = M.BitString;
10383
+ l = z.BitString;
10384
10384
  break;
10385
10385
  case 4:
10386
- l = M.OctetString;
10386
+ l = z.OctetString;
10387
10387
  break;
10388
10388
  case 5:
10389
- l = M.Null;
10389
+ l = z.Null;
10390
10390
  break;
10391
10391
  case 6:
10392
- l = M.ObjectIdentifier;
10392
+ l = z.ObjectIdentifier;
10393
10393
  break;
10394
10394
  case 10:
10395
- l = M.Enumerated;
10395
+ l = z.Enumerated;
10396
10396
  break;
10397
10397
  case 12:
10398
- l = M.Utf8String;
10398
+ l = z.Utf8String;
10399
10399
  break;
10400
10400
  case 13:
10401
- l = M.RelativeObjectIdentifier;
10401
+ l = z.RelativeObjectIdentifier;
10402
10402
  break;
10403
10403
  case 14:
10404
- l = M.TIME;
10404
+ l = z.TIME;
10405
10405
  break;
10406
10406
  case 15:
10407
10407
  return i.error = "[UNIVERSAL 15] is reserved by ASN.1 standard", {
@@ -10409,64 +10409,64 @@ function si(t, e = 0, n = t.length) {
10409
10409
  result: i
10410
10410
  };
10411
10411
  case 16:
10412
- l = M.Sequence;
10412
+ l = z.Sequence;
10413
10413
  break;
10414
10414
  case 17:
10415
- l = M.Set;
10415
+ l = z.Set;
10416
10416
  break;
10417
10417
  case 18:
10418
- l = M.NumericString;
10418
+ l = z.NumericString;
10419
10419
  break;
10420
10420
  case 19:
10421
- l = M.PrintableString;
10421
+ l = z.PrintableString;
10422
10422
  break;
10423
10423
  case 20:
10424
- l = M.TeletexString;
10424
+ l = z.TeletexString;
10425
10425
  break;
10426
10426
  case 21:
10427
- l = M.VideotexString;
10427
+ l = z.VideotexString;
10428
10428
  break;
10429
10429
  case 22:
10430
- l = M.IA5String;
10430
+ l = z.IA5String;
10431
10431
  break;
10432
10432
  case 23:
10433
- l = M.UTCTime;
10433
+ l = z.UTCTime;
10434
10434
  break;
10435
10435
  case 24:
10436
- l = M.GeneralizedTime;
10436
+ l = z.GeneralizedTime;
10437
10437
  break;
10438
10438
  case 25:
10439
- l = M.GraphicString;
10439
+ l = z.GraphicString;
10440
10440
  break;
10441
10441
  case 26:
10442
- l = M.VisibleString;
10442
+ l = z.VisibleString;
10443
10443
  break;
10444
10444
  case 27:
10445
- l = M.GeneralString;
10445
+ l = z.GeneralString;
10446
10446
  break;
10447
10447
  case 28:
10448
- l = M.UniversalString;
10448
+ l = z.UniversalString;
10449
10449
  break;
10450
10450
  case 29:
10451
- l = M.CharacterString;
10451
+ l = z.CharacterString;
10452
10452
  break;
10453
10453
  case 30:
10454
- l = M.BmpString;
10454
+ l = z.BmpString;
10455
10455
  break;
10456
10456
  case 31:
10457
- l = M.DATE;
10457
+ l = z.DATE;
10458
10458
  break;
10459
10459
  case 32:
10460
- l = M.TimeOfDay;
10460
+ l = z.TimeOfDay;
10461
10461
  break;
10462
10462
  case 33:
10463
- l = M.DateTime;
10463
+ l = z.DateTime;
10464
10464
  break;
10465
10465
  case 34:
10466
- l = M.Duration;
10466
+ l = z.Duration;
10467
10467
  break;
10468
10468
  default: {
10469
- const d = i.idBlock.isConstructed ? new M.Constructed() : new M.Primitive();
10469
+ const d = i.idBlock.isConstructed ? new z.Constructed() : new z.Primitive();
10470
10470
  d.idBlock = i.idBlock, d.lenBlock = i.lenBlock, d.warnings = i.warnings, i = d;
10471
10471
  }
10472
10472
  }
@@ -10475,7 +10475,7 @@ function si(t, e = 0, n = t.length) {
10475
10475
  case 3:
10476
10476
  case 4:
10477
10477
  default:
10478
- l = i.idBlock.isConstructed ? M.Constructed : M.Primitive;
10478
+ l = i.idBlock.isConstructed ? z.Constructed : z.Primitive;
10479
10479
  }
10480
10480
  return i = Dv(i, l), c = i.fromBER(t, e, i.lenBlock.isIndefiniteForm ? n : i.lenBlock.length), i.valueBeforeDecodeView = t.subarray(r, r + i.blockLength), {
10481
10481
  offset: c,
@@ -10510,10 +10510,10 @@ class Nn extends nt {
10510
10510
  const a = si(i, s, r);
10511
10511
  if (a.offset === -1)
10512
10512
  return this.error = a.result.error, this.warnings.concat(a.result.warnings), -1;
10513
- if (s = a.offset, this.blockLength += a.result.blockLength, r -= a.result.blockLength, this.value.push(a.result), this.isIndefiniteForm && a.result.constructor.NAME === lo)
10513
+ if (s = a.offset, this.blockLength += a.result.blockLength, r -= a.result.blockLength, this.value.push(a.result), this.isIndefiniteForm && a.result.constructor.NAME === uo)
10514
10514
  break;
10515
10515
  }
10516
- return this.isIndefiniteForm && (this.value[this.value.length - 1].constructor.NAME === lo ? this.value.pop() : this.warnings.push("No EndOfContent block encoded")), s;
10516
+ return this.isIndefiniteForm && (this.value[this.value.length - 1].constructor.NAME === uo ? this.value.pop() : this.warnings.push("No EndOfContent block encoded")), s;
10517
10517
  }
10518
10518
  toBER(e, n) {
10519
10519
  const r = n || new ja();
@@ -10556,7 +10556,7 @@ ${e.join(`
10556
10556
  }
10557
10557
  }
10558
10558
  dm = tt;
10559
- M.Constructed = dm;
10559
+ z.Constructed = dm;
10560
10560
  tt.NAME = "CONSTRUCTED";
10561
10561
  class um extends nt {
10562
10562
  fromBER(e, n, r) {
@@ -10574,8 +10574,8 @@ class bu extends Fe {
10574
10574
  }
10575
10575
  }
10576
10576
  pm = bu;
10577
- M.EndOfContent = pm;
10578
- bu.NAME = lo;
10577
+ z.EndOfContent = pm;
10578
+ bu.NAME = uo;
10579
10579
  var fm;
10580
10580
  class tr extends Fe {
10581
10581
  constructor(e = {}) {
@@ -10597,7 +10597,7 @@ class tr extends Fe {
10597
10597
  }
10598
10598
  }
10599
10599
  fm = tr;
10600
- M.Null = fm;
10600
+ z.Null = fm;
10601
10601
  tr.NAME = "NULL";
10602
10602
  class hm extends Wt(nt) {
10603
10603
  get value() {
@@ -10643,7 +10643,7 @@ let Oa = class extends Fe {
10643
10643
  }
10644
10644
  };
10645
10645
  gm = Oa;
10646
- M.Boolean = gm;
10646
+ z.Boolean = gm;
10647
10647
  Oa.NAME = "BOOLEAN";
10648
10648
  class mm extends Wt(Nn) {
10649
10649
  constructor({ isConstructed: e = !1, ...n } = {}) {
@@ -10656,7 +10656,7 @@ class mm extends Wt(Nn) {
10656
10656
  return i;
10657
10657
  for (let s = 0; s < this.value.length; s++) {
10658
10658
  const a = this.value[s].constructor.NAME;
10659
- if (a === lo) {
10659
+ if (a === uo) {
10660
10660
  if (this.isIndefiniteForm)
10661
10661
  break;
10662
10662
  return this.error = "EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only", -1;
@@ -10726,7 +10726,7 @@ let Jn = class extends Fe {
10726
10726
  }
10727
10727
  };
10728
10728
  vu = Jn;
10729
- M.OctetString = vu;
10729
+ z.OctetString = vu;
10730
10730
  Jn.NAME = rm;
10731
10731
  class _m extends Wt(Nn) {
10732
10732
  constructor({ unusedBits: e = 0, isConstructed: n = !1, ...r } = {}) {
@@ -10741,7 +10741,7 @@ class _m extends Wt(Nn) {
10741
10741
  return i;
10742
10742
  for (const c of this.value) {
10743
10743
  const l = c.constructor.NAME;
10744
- if (l === lo) {
10744
+ if (l === uo) {
10745
10745
  if (this.isIndefiniteForm)
10746
10746
  break;
10747
10747
  return this.error = "EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only", -1;
@@ -10824,7 +10824,7 @@ let Xn = class extends Fe {
10824
10824
  }
10825
10825
  };
10826
10826
  ym = Xn;
10827
- M.BitString = ym;
10827
+ z.BitString = ym;
10828
10828
  Xn.NAME = im;
10829
10829
  var wm;
10830
10830
  function zv(t, e) {
@@ -11003,7 +11003,7 @@ class ai extends Fe {
11003
11003
  }
11004
11004
  }
11005
11005
  Zi = ai;
11006
- M.Integer = Zi;
11006
+ z.Integer = Zi;
11007
11007
  ai.NAME = "INTEGER";
11008
11008
  var bm;
11009
11009
  class Pa extends ai {
@@ -11012,7 +11012,7 @@ class Pa extends ai {
11012
11012
  }
11013
11013
  }
11014
11014
  bm = Pa;
11015
- M.Enumerated = bm;
11015
+ z.Enumerated = bm;
11016
11016
  Pa.NAME = "ENUMERATED";
11017
11017
  class Pl extends Wt(nt) {
11018
11018
  constructor({ valueDec: e = -1, isFirstSid: n = !1, ...r } = {}) {
@@ -11187,7 +11187,7 @@ class Ta extends Fe {
11187
11187
  }
11188
11188
  }
11189
11189
  $m = Ta;
11190
- M.ObjectIdentifier = $m;
11190
+ z.ObjectIdentifier = $m;
11191
11191
  Ta.NAME = "OBJECT IDENTIFIER";
11192
11192
  class Tl extends Wt(mr) {
11193
11193
  constructor({ valueDec: e = 0, ...n } = {}) {
@@ -11320,7 +11320,7 @@ class ku extends Fe {
11320
11320
  }
11321
11321
  }
11322
11322
  xm = ku;
11323
- M.RelativeObjectIdentifier = xm;
11323
+ z.RelativeObjectIdentifier = xm;
11324
11324
  ku.NAME = "RelativeObjectIdentifier";
11325
11325
  var Sm;
11326
11326
  class Ct extends tt {
@@ -11329,7 +11329,7 @@ class Ct extends tt {
11329
11329
  }
11330
11330
  }
11331
11331
  Sm = Ct;
11332
- M.Sequence = Sm;
11332
+ z.Sequence = Sm;
11333
11333
  Ct.NAME = "SEQUENCE";
11334
11334
  var Am;
11335
11335
  let Ht = class extends tt {
@@ -11338,7 +11338,7 @@ let Ht = class extends tt {
11338
11338
  }
11339
11339
  };
11340
11340
  Am = Ht;
11341
- M.Set = Am;
11341
+ z.Set = Am;
11342
11342
  Ht.NAME = "SET";
11343
11343
  class Em extends Wt(nt) {
11344
11344
  constructor({ ...e } = {}) {
@@ -11391,7 +11391,7 @@ class _n extends Nm {
11391
11391
  }
11392
11392
  }
11393
11393
  jm = _n;
11394
- M.Utf8String = jm;
11394
+ z.Utf8String = jm;
11395
11395
  _n.NAME = "UTF8String";
11396
11396
  class Im extends pt {
11397
11397
  fromBuffer(e) {
@@ -11409,7 +11409,7 @@ class Ra extends Im {
11409
11409
  }
11410
11410
  }
11411
11411
  Om = Ra;
11412
- M.BmpString = Om;
11412
+ z.BmpString = Om;
11413
11413
  Ra.NAME = "BMPString";
11414
11414
  class Pm extends pt {
11415
11415
  fromBuffer(e) {
@@ -11439,7 +11439,7 @@ class Ba extends Pm {
11439
11439
  }
11440
11440
  }
11441
11441
  Tm = Ba;
11442
- M.UniversalString = Tm;
11442
+ z.UniversalString = Tm;
11443
11443
  Ba.NAME = "UniversalString";
11444
11444
  var Rm;
11445
11445
  class La extends pt {
@@ -11448,7 +11448,7 @@ class La extends pt {
11448
11448
  }
11449
11449
  }
11450
11450
  Rm = La;
11451
- M.NumericString = Rm;
11451
+ z.NumericString = Rm;
11452
11452
  La.NAME = "NumericString";
11453
11453
  var Bm;
11454
11454
  class Ua extends pt {
@@ -11457,7 +11457,7 @@ class Ua extends pt {
11457
11457
  }
11458
11458
  }
11459
11459
  Bm = Ua;
11460
- M.PrintableString = Bm;
11460
+ z.PrintableString = Bm;
11461
11461
  Ua.NAME = "PrintableString";
11462
11462
  var Lm;
11463
11463
  class Da extends pt {
@@ -11466,7 +11466,7 @@ class Da extends pt {
11466
11466
  }
11467
11467
  }
11468
11468
  Lm = Da;
11469
- M.TeletexString = Lm;
11469
+ z.TeletexString = Lm;
11470
11470
  Da.NAME = "TeletexString";
11471
11471
  var Um;
11472
11472
  class Ma extends pt {
@@ -11475,7 +11475,7 @@ class Ma extends pt {
11475
11475
  }
11476
11476
  }
11477
11477
  Um = Ma;
11478
- M.VideotexString = Um;
11478
+ z.VideotexString = Um;
11479
11479
  Ma.NAME = "VideotexString";
11480
11480
  var Dm;
11481
11481
  class za extends pt {
@@ -11484,7 +11484,7 @@ class za extends pt {
11484
11484
  }
11485
11485
  }
11486
11486
  Dm = za;
11487
- M.IA5String = Dm;
11487
+ z.IA5String = Dm;
11488
11488
  za.NAME = "IA5String";
11489
11489
  var Mm;
11490
11490
  class qa extends pt {
@@ -11493,17 +11493,17 @@ class qa extends pt {
11493
11493
  }
11494
11494
  }
11495
11495
  Mm = qa;
11496
- M.GraphicString = Mm;
11496
+ z.GraphicString = Mm;
11497
11497
  qa.NAME = "GraphicString";
11498
11498
  var zm;
11499
- class Ro extends pt {
11499
+ class Bo extends pt {
11500
11500
  constructor(e = {}) {
11501
11501
  super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 26;
11502
11502
  }
11503
11503
  }
11504
- zm = Ro;
11505
- M.VisibleString = zm;
11506
- Ro.NAME = "VisibleString";
11504
+ zm = Bo;
11505
+ z.VisibleString = zm;
11506
+ Bo.NAME = "VisibleString";
11507
11507
  var qm;
11508
11508
  class Fa extends pt {
11509
11509
  constructor(e = {}) {
@@ -11511,7 +11511,7 @@ class Fa extends pt {
11511
11511
  }
11512
11512
  }
11513
11513
  qm = Fa;
11514
- M.GeneralString = qm;
11514
+ z.GeneralString = qm;
11515
11515
  Fa.NAME = "GeneralString";
11516
11516
  var Fm;
11517
11517
  class Ha extends pt {
@@ -11520,10 +11520,10 @@ class Ha extends pt {
11520
11520
  }
11521
11521
  }
11522
11522
  Fm = Ha;
11523
- M.CharacterString = Fm;
11523
+ z.CharacterString = Fm;
11524
11524
  Ha.NAME = "CharacterString";
11525
11525
  var Hm;
11526
- class Bo extends Ro {
11526
+ class Lo extends Bo {
11527
11527
  constructor({ value: e, valueDate: n, ...r } = {}) {
11528
11528
  if (super(r), this.year = 0, this.month = 0, this.day = 0, this.hour = 0, this.minute = 0, this.second = 0, e) {
11529
11529
  this.fromString(e), this.valueBlock.valueHexView = new Uint8Array(e.length);
@@ -11578,11 +11578,11 @@ class Bo extends Ro {
11578
11578
  };
11579
11579
  }
11580
11580
  }
11581
- Hm = Bo;
11582
- M.UTCTime = Hm;
11583
- Bo.NAME = "UTCTime";
11581
+ Hm = Lo;
11582
+ z.UTCTime = Hm;
11583
+ Lo.NAME = "UTCTime";
11584
11584
  var Vm;
11585
- class Va extends Bo {
11585
+ class Va extends Lo {
11586
11586
  constructor(e = {}) {
11587
11587
  var n;
11588
11588
  super(e), (n = this.millisecond) !== null && n !== void 0 || (this.millisecond = 0), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 24;
@@ -11704,7 +11704,7 @@ class Va extends Bo {
11704
11704
  }
11705
11705
  }
11706
11706
  Vm = Va;
11707
- M.GeneralizedTime = Vm;
11707
+ z.GeneralizedTime = Vm;
11708
11708
  Va.NAME = "GeneralizedTime";
11709
11709
  var Km;
11710
11710
  class xu extends _n {
@@ -11713,7 +11713,7 @@ class xu extends _n {
11713
11713
  }
11714
11714
  }
11715
11715
  Km = xu;
11716
- M.DATE = Km;
11716
+ z.DATE = Km;
11717
11717
  xu.NAME = "DATE";
11718
11718
  var Gm;
11719
11719
  class Su extends _n {
@@ -11722,7 +11722,7 @@ class Su extends _n {
11722
11722
  }
11723
11723
  }
11724
11724
  Gm = Su;
11725
- M.TimeOfDay = Gm;
11725
+ z.TimeOfDay = Gm;
11726
11726
  Su.NAME = "TimeOfDay";
11727
11727
  var Wm;
11728
11728
  class Au extends _n {
@@ -11731,7 +11731,7 @@ class Au extends _n {
11731
11731
  }
11732
11732
  }
11733
11733
  Wm = Au;
11734
- M.DateTime = Wm;
11734
+ z.DateTime = Wm;
11735
11735
  Au.NAME = "DateTime";
11736
11736
  var Jm;
11737
11737
  class Eu extends _n {
@@ -11740,7 +11740,7 @@ class Eu extends _n {
11740
11740
  }
11741
11741
  }
11742
11742
  Jm = Eu;
11743
- M.Duration = Jm;
11743
+ z.Duration = Jm;
11744
11744
  Eu.NAME = "Duration";
11745
11745
  var Xm;
11746
11746
  class Cu extends _n {
@@ -11749,7 +11749,7 @@ class Cu extends _n {
11749
11749
  }
11750
11750
  }
11751
11751
  Xm = Cu;
11752
- M.TIME = Xm;
11752
+ z.TIME = Xm;
11753
11753
  Cu.NAME = "TIME";
11754
11754
  class nr {
11755
11755
  constructor({ name: e = ot, optional: n = !1 } = {}) {
@@ -11905,7 +11905,7 @@ function An(t, e, n) {
11905
11905
  result: t
11906
11906
  };
11907
11907
  }
11908
- if (n.name && (n.name = n.name.replace(/^\s+|\s+$/g, ot), n.name && (t[n.name] = e)), n instanceof M.Constructed) {
11908
+ if (n.name && (n.name = n.name.replace(/^\s+|\s+$/g, ot), n.name && (t[n.name] = e)), n instanceof z.Constructed) {
11909
11909
  let s = 0, a = {
11910
11910
  verified: !1,
11911
11911
  result: { error: "Unknown error" }
@@ -12017,7 +12017,7 @@ const Zm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12017
12017
  NumericString: La,
12018
12018
  ObjectIdentifier: Ta,
12019
12019
  OctetString: Jn,
12020
- Primitive: To,
12020
+ Primitive: Ro,
12021
12021
  PrintableString: Ua,
12022
12022
  RawData: Fv,
12023
12023
  RelativeObjectIdentifier: ku,
@@ -12027,13 +12027,13 @@ const Zm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12027
12027
  TIME: Cu,
12028
12028
  TeletexString: Da,
12029
12029
  TimeOfDay: Su,
12030
- UTCTime: Bo,
12030
+ UTCTime: Lo,
12031
12031
  UniversalString: Ba,
12032
12032
  Utf8String: _n,
12033
12033
  ValueBlock: nt,
12034
12034
  VideotexString: Ma,
12035
12035
  ViewWriter: ja,
12036
- VisibleString: Ro,
12036
+ VisibleString: Bo,
12037
12037
  compareSchema: An,
12038
12038
  fromBER: Br,
12039
12039
  verifySchema: Hv
@@ -12149,9 +12149,9 @@ function bt(t) {
12149
12149
  toASN: (e) => new t({ value: e })
12150
12150
  };
12151
12151
  }
12152
- const Ym = bt(_n), Yv = bt(Ra), Qv = bt(Ba), e2 = bt(La), t2 = bt(Ua), n2 = bt(Da), r2 = bt(Ma), i2 = bt(za), o2 = bt(qa), s2 = bt(Ro), a2 = bt(Fa), c2 = bt(Ha), l2 = {
12152
+ const Ym = bt(_n), Yv = bt(Ra), Qv = bt(Ba), e2 = bt(La), t2 = bt(Ua), n2 = bt(Da), r2 = bt(Ma), i2 = bt(za), o2 = bt(qa), s2 = bt(Bo), a2 = bt(Fa), c2 = bt(Ha), l2 = {
12153
12153
  fromASN: (t) => t.toDate(),
12154
- toASN: (t) => new Bo({ valueDate: t })
12154
+ toASN: (t) => new Lo({ valueDate: t })
12155
12155
  }, d2 = {
12156
12156
  fromASN: (t) => t.toDate(),
12157
12157
  toASN: (t) => new Va({ valueDate: t })
@@ -12275,7 +12275,7 @@ class f2 {
12275
12275
  if (a.context !== null && a.context !== void 0)
12276
12276
  if (a.implicit)
12277
12277
  if (typeof a.type == "number" || on(a.type)) {
12278
- const p = a.repeated ? tt : To;
12278
+ const p = a.repeated ? tt : Ro;
12279
12279
  i.push(new p({ name: c, optional: d, idBlock: { tagClass: 3, tagNumber: a.context } }));
12280
12280
  } else {
12281
12281
  this.cache(a.type);
@@ -12606,7 +12606,7 @@ class ju {
12606
12606
  if (c.implicit)
12607
12607
  if (!c.repeated && (typeof c.type == "number" || on(c.type))) {
12608
12608
  const p = {};
12609
- p.valueHex = d instanceof tr ? d.valueBeforeDecodeView : d.valueBlock.toBER(), i.push(new To({
12609
+ p.valueHex = d instanceof tr ? d.valueBeforeDecodeView : d.valueBlock.toBER(), i.push(new Ro({
12610
12610
  optional: c.optional,
12611
12611
  idBlock: {
12612
12612
  tagClass: 3,
@@ -12905,17 +12905,17 @@ const g2 = {
12905
12905
  fromASN: (t) => Ef.toString(Bs.fromASN(t)),
12906
12906
  toASN: (t) => Bs.toASN(Ef.fromString(t))
12907
12907
  };
12908
- class uo {
12908
+ class po {
12909
12909
  constructor(e = {}) {
12910
12910
  this.typeId = "", this.value = new ArrayBuffer(0), Object.assign(this, e);
12911
12911
  }
12912
12912
  }
12913
12913
  h([
12914
12914
  m({ type: b.ObjectIdentifier })
12915
- ], uo.prototype, "typeId", void 0);
12915
+ ], po.prototype, "typeId", void 0);
12916
12916
  h([
12917
12917
  m({ type: b.Any, context: 0 })
12918
- ], uo.prototype, "value", void 0);
12918
+ ], po.prototype, "value", void 0);
12919
12919
  class Iu {
12920
12920
  constructor(e = {}) {
12921
12921
  this.partyName = new He(), Object.assign(this, e);
@@ -12933,7 +12933,7 @@ let ne = class {
12933
12933
  }
12934
12934
  };
12935
12935
  h([
12936
- m({ type: uo, context: 0, implicit: !0 })
12936
+ m({ type: po, context: 0, implicit: !0 })
12937
12937
  ], ne.prototype, "otherName", void 0);
12938
12938
  h([
12939
12939
  m({ type: b.IA5String, context: 1, implicit: !0 })
@@ -12970,24 +12970,24 @@ ne = h([
12970
12970
  const Ou = "1.3.6.1.5.5.7", m2 = `${Ou}.1`, ci = `${Ou}.3`, Wa = `${Ou}.48`, Cf = `${Wa}.1`, Nf = `${Wa}.2`, jf = `${Wa}.3`, If = `${Wa}.5`, yn = "2.5.29";
12971
12971
  var Dl;
12972
12972
  const Ml = `${m2}.1`;
12973
- class Lo {
12973
+ class Uo {
12974
12974
  constructor(e = {}) {
12975
12975
  this.accessMethod = "", this.accessLocation = new ne(), Object.assign(this, e);
12976
12976
  }
12977
12977
  }
12978
12978
  h([
12979
12979
  m({ type: b.ObjectIdentifier })
12980
- ], Lo.prototype, "accessMethod", void 0);
12980
+ ], Uo.prototype, "accessMethod", void 0);
12981
12981
  h([
12982
12982
  m({ type: ne })
12983
- ], Lo.prototype, "accessLocation", void 0);
12983
+ ], Uo.prototype, "accessLocation", void 0);
12984
12984
  let Tr = Dl = class extends pe {
12985
12985
  constructor(e) {
12986
12986
  super(e), Object.setPrototypeOf(this, Dl.prototype);
12987
12987
  }
12988
12988
  };
12989
12989
  Tr = Dl = h([
12990
- P({ type: C.Sequence, itemType: Lo })
12990
+ P({ type: C.Sequence, itemType: Uo })
12991
12991
  ], Tr);
12992
12992
  const zl = `${yn}.35`;
12993
12993
  class Pu extends le {
@@ -13483,34 +13483,34 @@ let Uf = id = class extends pe {
13483
13483
  }
13484
13484
  };
13485
13485
  Uf = id = h([
13486
- P({ type: C.Sequence, itemType: Lo })
13486
+ P({ type: C.Sequence, itemType: Uo })
13487
13487
  ], Uf);
13488
- class D {
13488
+ class M {
13489
13489
  constructor(e = {}) {
13490
13490
  this.algorithm = "", Object.assign(this, e);
13491
13491
  }
13492
13492
  isEqual(e) {
13493
- return e instanceof D && e.algorithm == this.algorithm && (e.parameters && this.parameters && tm(e.parameters, this.parameters) || e.parameters === this.parameters);
13493
+ return e instanceof M && e.algorithm == this.algorithm && (e.parameters && this.parameters && tm(e.parameters, this.parameters) || e.parameters === this.parameters);
13494
13494
  }
13495
13495
  }
13496
13496
  h([
13497
13497
  m({
13498
13498
  type: b.ObjectIdentifier
13499
13499
  })
13500
- ], D.prototype, "algorithm", void 0);
13500
+ ], M.prototype, "algorithm", void 0);
13501
13501
  h([
13502
13502
  m({
13503
13503
  type: b.Any,
13504
13504
  optional: !0
13505
13505
  })
13506
- ], D.prototype, "parameters", void 0);
13506
+ ], M.prototype, "parameters", void 0);
13507
13507
  class St {
13508
13508
  constructor(e = {}) {
13509
- this.algorithm = new D(), this.subjectPublicKey = new ArrayBuffer(0), Object.assign(this, e);
13509
+ this.algorithm = new M(), this.subjectPublicKey = new ArrayBuffer(0), Object.assign(this, e);
13510
13510
  }
13511
13511
  }
13512
13512
  h([
13513
- m({ type: D })
13513
+ m({ type: M })
13514
13514
  ], St.prototype, "algorithm", void 0);
13515
13515
  h([
13516
13516
  m({ type: b.BitString })
@@ -13544,17 +13544,17 @@ h([
13544
13544
  ze = h([
13545
13545
  P({ type: C.Choice })
13546
13546
  ], ze);
13547
- class Uo {
13547
+ class Do {
13548
13548
  constructor(e) {
13549
13549
  this.notBefore = new ze(/* @__PURE__ */ new Date()), this.notAfter = new ze(/* @__PURE__ */ new Date()), e && (this.notBefore = new ze(e.notBefore), this.notAfter = new ze(e.notAfter));
13550
13550
  }
13551
13551
  }
13552
13552
  h([
13553
13553
  m({ type: ze })
13554
- ], Uo.prototype, "notBefore", void 0);
13554
+ ], Do.prototype, "notBefore", void 0);
13555
13555
  h([
13556
13556
  m({ type: ze })
13557
- ], Uo.prototype, "notAfter", void 0);
13557
+ ], Do.prototype, "notAfter", void 0);
13558
13558
  var od;
13559
13559
  let yt = class f_ {
13560
13560
  constructor(e = {}) {
@@ -13588,7 +13588,7 @@ var ir;
13588
13588
  })(ir || (ir = {}));
13589
13589
  class ft {
13590
13590
  constructor(e = {}) {
13591
- this.version = ir.v1, this.serialNumber = new ArrayBuffer(0), this.signature = new D(), this.issuer = new je(), this.validity = new Uo(), this.subject = new je(), this.subjectPublicKeyInfo = new St(), Object.assign(this, e);
13591
+ this.version = ir.v1, this.serialNumber = new ArrayBuffer(0), this.signature = new M(), this.issuer = new je(), this.validity = new Do(), this.subject = new je(), this.subjectPublicKeyInfo = new St(), Object.assign(this, e);
13592
13592
  }
13593
13593
  }
13594
13594
  h([
@@ -13605,13 +13605,13 @@ h([
13605
13605
  })
13606
13606
  ], ft.prototype, "serialNumber", void 0);
13607
13607
  h([
13608
- m({ type: D })
13608
+ m({ type: M })
13609
13609
  ], ft.prototype, "signature", void 0);
13610
13610
  h([
13611
13611
  m({ type: je })
13612
13612
  ], ft.prototype, "issuer", void 0);
13613
13613
  h([
13614
- m({ type: Uo })
13614
+ m({ type: Do })
13615
13615
  ], ft.prototype, "validity", void 0);
13616
13616
  h([
13617
13617
  m({ type: je })
@@ -13635,14 +13635,14 @@ h([
13635
13635
  ], ft.prototype, "extensions", void 0);
13636
13636
  class or {
13637
13637
  constructor(e = {}) {
13638
- this.tbsCertificate = new ft(), this.signatureAlgorithm = new D(), this.signatureValue = new ArrayBuffer(0), Object.assign(this, e);
13638
+ this.tbsCertificate = new ft(), this.signatureAlgorithm = new M(), this.signatureValue = new ArrayBuffer(0), Object.assign(this, e);
13639
13639
  }
13640
13640
  }
13641
13641
  h([
13642
13642
  m({ type: ft, raw: !0 })
13643
13643
  ], or.prototype, "tbsCertificate", void 0);
13644
13644
  h([
13645
- m({ type: D })
13645
+ m({ type: M })
13646
13646
  ], or.prototype, "signatureAlgorithm", void 0);
13647
13647
  h([
13648
13648
  m({ type: b.BitString })
@@ -13663,14 +13663,14 @@ h([
13663
13663
  ], Za.prototype, "crlEntryExtensions", void 0);
13664
13664
  class wn {
13665
13665
  constructor(e = {}) {
13666
- this.signature = new D(), this.issuer = new je(), this.thisUpdate = new ze(), Object.assign(this, e);
13666
+ this.signature = new M(), this.issuer = new je(), this.thisUpdate = new ze(), Object.assign(this, e);
13667
13667
  }
13668
13668
  }
13669
13669
  h([
13670
13670
  m({ type: b.Integer, optional: !0 })
13671
13671
  ], wn.prototype, "version", void 0);
13672
13672
  h([
13673
- m({ type: D })
13673
+ m({ type: M })
13674
13674
  ], wn.prototype, "signature", void 0);
13675
13675
  h([
13676
13676
  m({ type: je })
@@ -13689,14 +13689,14 @@ h([
13689
13689
  ], wn.prototype, "crlExtensions", void 0);
13690
13690
  class Uu {
13691
13691
  constructor(e = {}) {
13692
- this.tbsCertList = new wn(), this.signatureAlgorithm = new D(), this.signature = new ArrayBuffer(0), Object.assign(this, e);
13692
+ this.tbsCertList = new wn(), this.signatureAlgorithm = new M(), this.signature = new ArrayBuffer(0), Object.assign(this, e);
13693
13693
  }
13694
13694
  }
13695
13695
  h([
13696
13696
  m({ type: wn, raw: !0 })
13697
13697
  ], Uu.prototype, "tbsCertList", void 0);
13698
13698
  h([
13699
- m({ type: D })
13699
+ m({ type: M })
13700
13700
  ], Uu.prototype, "signatureAlgorithm", void 0);
13701
13701
  h([
13702
13702
  m({ type: b.BitString })
@@ -13730,32 +13730,32 @@ var dn;
13730
13730
  (function(t) {
13731
13731
  t[t.v0 = 0] = "v0", t[t.v1 = 1] = "v1", t[t.v2 = 2] = "v2", t[t.v3 = 3] = "v3", t[t.v4 = 4] = "v4", t[t.v5 = 5] = "v5";
13732
13732
  })(dn || (dn = {}));
13733
- let po = class extends D {
13733
+ let fo = class extends M {
13734
13734
  };
13735
- po = h([
13735
+ fo = h([
13736
13736
  P({ type: C.Sequence })
13737
- ], po);
13738
- let Fs = class extends D {
13737
+ ], fo);
13738
+ let Fs = class extends M {
13739
13739
  };
13740
13740
  Fs = h([
13741
13741
  P({ type: C.Sequence })
13742
13742
  ], Fs);
13743
- let Gt = class extends D {
13743
+ let Gt = class extends M {
13744
13744
  };
13745
13745
  Gt = h([
13746
13746
  P({ type: C.Sequence })
13747
13747
  ], Gt);
13748
- let Hs = class extends D {
13748
+ let Hs = class extends M {
13749
13749
  };
13750
13750
  Hs = h([
13751
13751
  P({ type: C.Sequence })
13752
13752
  ], Hs);
13753
- let Df = class extends D {
13753
+ let Df = class extends M {
13754
13754
  };
13755
13755
  Df = h([
13756
13756
  P({ type: C.Sequence })
13757
13757
  ], Df);
13758
- let sd = class extends D {
13758
+ let sd = class extends M {
13759
13759
  };
13760
13760
  sd = h([
13761
13761
  P({ type: C.Sequence })
@@ -13774,7 +13774,7 @@ h([
13774
13774
  var ad;
13775
13775
  class Jt {
13776
13776
  constructor(e = {}) {
13777
- this.version = dn.v0, this.sid = new Kr(), this.digestAlgorithm = new po(), this.signatureAlgorithm = new Fs(), this.signature = new le(), Object.assign(this, e);
13777
+ this.version = dn.v0, this.sid = new Kr(), this.digestAlgorithm = new fo(), this.signatureAlgorithm = new Fs(), this.signature = new le(), Object.assign(this, e);
13778
13778
  }
13779
13779
  }
13780
13780
  h([
@@ -13784,7 +13784,7 @@ h([
13784
13784
  m({ type: Kr })
13785
13785
  ], Jt.prototype, "sid", void 0);
13786
13786
  h([
13787
- m({ type: po })
13787
+ m({ type: fo })
13788
13788
  ], Jt.prototype, "digestAlgorithm", void 0);
13789
13789
  h([
13790
13790
  m({
@@ -13883,7 +13883,7 @@ var ld;
13883
13883
  })(ld || (ld = {}));
13884
13884
  class yr {
13885
13885
  constructor(e = {}) {
13886
- this.digestedObjectType = ld.publicKey, this.digestAlgorithm = new D(), this.objectDigest = new ArrayBuffer(0), Object.assign(this, e);
13886
+ this.digestedObjectType = ld.publicKey, this.digestAlgorithm = new M(), this.objectDigest = new ArrayBuffer(0), Object.assign(this, e);
13887
13887
  }
13888
13888
  }
13889
13889
  h([
@@ -13893,7 +13893,7 @@ h([
13893
13893
  m({ type: b.ObjectIdentifier, optional: !0 })
13894
13894
  ], yr.prototype, "otherObjectTypeID", void 0);
13895
13895
  h([
13896
- m({ type: D })
13896
+ m({ type: M })
13897
13897
  ], yr.prototype, "digestAlgorithm", void 0);
13898
13898
  h([
13899
13899
  m({ type: b.BitString })
@@ -13937,40 +13937,40 @@ h([
13937
13937
  h([
13938
13938
  m({ type: b.GeneralizedTime })
13939
13939
  ], ec.prototype, "notAfterTime", void 0);
13940
- class Do {
13940
+ class Mo {
13941
13941
  constructor(e = {}) {
13942
13942
  Object.assign(this, e);
13943
13943
  }
13944
13944
  }
13945
13945
  h([
13946
13946
  m({ type: _r, implicit: !0, context: 0, optional: !0 })
13947
- ], Do.prototype, "baseCertificateID", void 0);
13947
+ ], Mo.prototype, "baseCertificateID", void 0);
13948
13948
  h([
13949
13949
  m({ type: Ye, implicit: !0, context: 1, optional: !0 })
13950
- ], Do.prototype, "entityName", void 0);
13950
+ ], Mo.prototype, "entityName", void 0);
13951
13951
  h([
13952
13952
  m({ type: yr, implicit: !0, context: 2, optional: !0 })
13953
- ], Do.prototype, "objectDigestInfo", void 0);
13953
+ ], Mo.prototype, "objectDigestInfo", void 0);
13954
13954
  var dd;
13955
13955
  (function(t) {
13956
13956
  t[t.v2 = 1] = "v2";
13957
13957
  })(dd || (dd = {}));
13958
13958
  class Bt {
13959
13959
  constructor(e = {}) {
13960
- this.version = dd.v2, this.holder = new Do(), this.issuer = new Gr(), this.signature = new D(), this.serialNumber = new ArrayBuffer(0), this.attrCertValidityPeriod = new ec(), this.attributes = [], Object.assign(this, e);
13960
+ this.version = dd.v2, this.holder = new Mo(), this.issuer = new Gr(), this.signature = new M(), this.serialNumber = new ArrayBuffer(0), this.attrCertValidityPeriod = new ec(), this.attributes = [], Object.assign(this, e);
13961
13961
  }
13962
13962
  }
13963
13963
  h([
13964
13964
  m({ type: b.Integer })
13965
13965
  ], Bt.prototype, "version", void 0);
13966
13966
  h([
13967
- m({ type: Do })
13967
+ m({ type: Mo })
13968
13968
  ], Bt.prototype, "holder", void 0);
13969
13969
  h([
13970
13970
  m({ type: Gr })
13971
13971
  ], Bt.prototype, "issuer", void 0);
13972
13972
  h([
13973
- m({ type: D })
13973
+ m({ type: M })
13974
13974
  ], Bt.prototype, "signature", void 0);
13975
13975
  h([
13976
13976
  m({ type: b.Integer, converter: ye })
@@ -13989,14 +13989,14 @@ h([
13989
13989
  ], Bt.prototype, "extensions", void 0);
13990
13990
  class tc {
13991
13991
  constructor(e = {}) {
13992
- this.acinfo = new Bt(), this.signatureAlgorithm = new D(), this.signatureValue = new ArrayBuffer(0), Object.assign(this, e);
13992
+ this.acinfo = new Bt(), this.signatureAlgorithm = new M(), this.signatureValue = new ArrayBuffer(0), Object.assign(this, e);
13993
13993
  }
13994
13994
  }
13995
13995
  h([
13996
13996
  m({ type: Bt })
13997
13997
  ], tc.prototype, "acinfo", void 0);
13998
13998
  h([
13999
- m({ type: D })
13999
+ m({ type: M })
14000
14000
  ], tc.prototype, "signatureAlgorithm", void 0);
14001
14001
  h([
14002
14002
  m({ type: b.BitString })
@@ -14179,20 +14179,20 @@ h([
14179
14179
  h([
14180
14180
  m({ type: b.Any, context: 0 })
14181
14181
  ], pi.prototype, "content", void 0);
14182
- let fo = class {
14182
+ let ho = class {
14183
14183
  constructor(e = {}) {
14184
14184
  Object.assign(this, e);
14185
14185
  }
14186
14186
  };
14187
14187
  h([
14188
14188
  m({ type: le })
14189
- ], fo.prototype, "single", void 0);
14189
+ ], ho.prototype, "single", void 0);
14190
14190
  h([
14191
14191
  m({ type: b.Any })
14192
- ], fo.prototype, "any", void 0);
14193
- fo = h([
14192
+ ], ho.prototype, "any", void 0);
14193
+ ho = h([
14194
14194
  P({ type: C.Choice })
14195
- ], fo);
14195
+ ], ho);
14196
14196
  class ic {
14197
14197
  constructor(e = {}) {
14198
14198
  this.eContentType = "", Object.assign(this, e);
@@ -14202,16 +14202,16 @@ h([
14202
14202
  m({ type: b.ObjectIdentifier })
14203
14203
  ], ic.prototype, "eContentType", void 0);
14204
14204
  h([
14205
- m({ type: fo, context: 0, optional: !0 })
14205
+ m({ type: ho, context: 0, optional: !0 })
14206
14206
  ], ic.prototype, "eContent", void 0);
14207
- let ho = class {
14207
+ let go = class {
14208
14208
  constructor(e = {}) {
14209
14209
  Object.assign(this, e);
14210
14210
  }
14211
14211
  };
14212
14212
  h([
14213
14213
  m({ type: le, context: 0, implicit: !0, optional: !0 })
14214
- ], ho.prototype, "value", void 0);
14214
+ ], go.prototype, "value", void 0);
14215
14215
  h([
14216
14216
  m({
14217
14217
  type: le,
@@ -14221,24 +14221,24 @@ h([
14221
14221
  optional: !0,
14222
14222
  repeated: "sequence"
14223
14223
  })
14224
- ], ho.prototype, "constructedValue", void 0);
14225
- ho = h([
14224
+ ], go.prototype, "constructedValue", void 0);
14225
+ go = h([
14226
14226
  P({ type: C.Choice })
14227
- ], ho);
14228
- class Mo {
14227
+ ], go);
14228
+ class zo {
14229
14229
  constructor(e = {}) {
14230
14230
  this.contentType = "", this.contentEncryptionAlgorithm = new Hs(), Object.assign(this, e);
14231
14231
  }
14232
14232
  }
14233
14233
  h([
14234
14234
  m({ type: b.ObjectIdentifier })
14235
- ], Mo.prototype, "contentType", void 0);
14235
+ ], zo.prototype, "contentType", void 0);
14236
14236
  h([
14237
14237
  m({ type: Hs })
14238
- ], Mo.prototype, "contentEncryptionAlgorithm", void 0);
14238
+ ], zo.prototype, "contentEncryptionAlgorithm", void 0);
14239
14239
  h([
14240
- m({ type: ho, optional: !0 })
14241
- ], Mo.prototype, "encryptedContent", void 0);
14240
+ m({ type: go, optional: !0 })
14241
+ ], zo.prototype, "encryptedContent", void 0);
14242
14242
  class oc {
14243
14243
  constructor(e = {}) {
14244
14244
  this.keyAttrId = "", Object.assign(this, e);
@@ -14300,11 +14300,11 @@ Js = md = h([
14300
14300
  ], Js);
14301
14301
  class Vu {
14302
14302
  constructor(e = {}) {
14303
- this.algorithm = new D(), this.publicKey = new ArrayBuffer(0), Object.assign(this, e);
14303
+ this.algorithm = new M(), this.publicKey = new ArrayBuffer(0), Object.assign(this, e);
14304
14304
  }
14305
14305
  }
14306
14306
  h([
14307
- m({ type: D })
14307
+ m({ type: M })
14308
14308
  ], Vu.prototype, "algorithm", void 0);
14309
14309
  h([
14310
14310
  m({ type: b.BitString })
@@ -14360,71 +14360,71 @@ h([
14360
14360
  Zr = h([
14361
14361
  P({ type: C.Choice })
14362
14362
  ], Zr);
14363
- class zo {
14363
+ class qo {
14364
14364
  constructor(e = {}) {
14365
14365
  this.version = dn.v0, this.rid = new Zr(), this.keyEncryptionAlgorithm = new Gt(), this.encryptedKey = new le(), Object.assign(this, e);
14366
14366
  }
14367
14367
  }
14368
14368
  h([
14369
14369
  m({ type: b.Integer })
14370
- ], zo.prototype, "version", void 0);
14370
+ ], qo.prototype, "version", void 0);
14371
14371
  h([
14372
14372
  m({ type: Zr })
14373
- ], zo.prototype, "rid", void 0);
14373
+ ], qo.prototype, "rid", void 0);
14374
14374
  h([
14375
14375
  m({ type: Gt })
14376
- ], zo.prototype, "keyEncryptionAlgorithm", void 0);
14376
+ ], qo.prototype, "keyEncryptionAlgorithm", void 0);
14377
14377
  h([
14378
14378
  m({ type: le })
14379
- ], zo.prototype, "encryptedKey", void 0);
14380
- class qo {
14379
+ ], qo.prototype, "encryptedKey", void 0);
14380
+ class Fo {
14381
14381
  constructor(e = {}) {
14382
14382
  this.keyIdentifier = new le(), Object.assign(this, e);
14383
14383
  }
14384
14384
  }
14385
14385
  h([
14386
14386
  m({ type: le })
14387
- ], qo.prototype, "keyIdentifier", void 0);
14387
+ ], Fo.prototype, "keyIdentifier", void 0);
14388
14388
  h([
14389
14389
  m({ type: b.GeneralizedTime, optional: !0 })
14390
- ], qo.prototype, "date", void 0);
14390
+ ], Fo.prototype, "date", void 0);
14391
14391
  h([
14392
14392
  m({ type: oc, optional: !0 })
14393
- ], qo.prototype, "other", void 0);
14394
- class Fo {
14393
+ ], Fo.prototype, "other", void 0);
14394
+ class Ho {
14395
14395
  constructor(e = {}) {
14396
- this.version = dn.v4, this.kekid = new qo(), this.keyEncryptionAlgorithm = new Gt(), this.encryptedKey = new le(), Object.assign(this, e);
14396
+ this.version = dn.v4, this.kekid = new Fo(), this.keyEncryptionAlgorithm = new Gt(), this.encryptedKey = new le(), Object.assign(this, e);
14397
14397
  }
14398
14398
  }
14399
14399
  h([
14400
14400
  m({ type: b.Integer })
14401
- ], Fo.prototype, "version", void 0);
14401
+ ], Ho.prototype, "version", void 0);
14402
14402
  h([
14403
- m({ type: qo })
14404
- ], Fo.prototype, "kekid", void 0);
14403
+ m({ type: Fo })
14404
+ ], Ho.prototype, "kekid", void 0);
14405
14405
  h([
14406
14406
  m({ type: Gt })
14407
- ], Fo.prototype, "keyEncryptionAlgorithm", void 0);
14407
+ ], Ho.prototype, "keyEncryptionAlgorithm", void 0);
14408
14408
  h([
14409
14409
  m({ type: le })
14410
- ], Fo.prototype, "encryptedKey", void 0);
14411
- class Ho {
14410
+ ], Ho.prototype, "encryptedKey", void 0);
14411
+ class Vo {
14412
14412
  constructor(e = {}) {
14413
14413
  this.version = dn.v0, this.keyEncryptionAlgorithm = new Gt(), this.encryptedKey = new le(), Object.assign(this, e);
14414
14414
  }
14415
14415
  }
14416
14416
  h([
14417
14417
  m({ type: b.Integer })
14418
- ], Ho.prototype, "version", void 0);
14418
+ ], Vo.prototype, "version", void 0);
14419
14419
  h([
14420
14420
  m({ type: sd, context: 0, optional: !0 })
14421
- ], Ho.prototype, "keyDerivationAlgorithm", void 0);
14421
+ ], Vo.prototype, "keyDerivationAlgorithm", void 0);
14422
14422
  h([
14423
14423
  m({ type: Gt })
14424
- ], Ho.prototype, "keyEncryptionAlgorithm", void 0);
14424
+ ], Vo.prototype, "keyEncryptionAlgorithm", void 0);
14425
14425
  h([
14426
14426
  m({ type: le })
14427
- ], Ho.prototype, "encryptedKey", void 0);
14427
+ ], Vo.prototype, "encryptedKey", void 0);
14428
14428
  class Ku {
14429
14429
  constructor(e = {}) {
14430
14430
  this.oriType = "", this.oriValue = new ArrayBuffer(0), Object.assign(this, e);
@@ -14442,16 +14442,16 @@ let Tn = class {
14442
14442
  }
14443
14443
  };
14444
14444
  h([
14445
- m({ type: zo, optional: !0 })
14445
+ m({ type: qo, optional: !0 })
14446
14446
  ], Tn.prototype, "ktri", void 0);
14447
14447
  h([
14448
14448
  m({ type: fi, context: 1, implicit: !0, optional: !0 })
14449
14449
  ], Tn.prototype, "kari", void 0);
14450
14450
  h([
14451
- m({ type: Fo, context: 2, implicit: !0, optional: !0 })
14451
+ m({ type: Ho, context: 2, implicit: !0, optional: !0 })
14452
14452
  ], Tn.prototype, "kekri", void 0);
14453
14453
  h([
14454
- m({ type: Ho, context: 3, implicit: !0, optional: !0 })
14454
+ m({ type: Vo, context: 3, implicit: !0, optional: !0 })
14455
14455
  ], Tn.prototype, "pwri", void 0);
14456
14456
  h([
14457
14457
  m({ type: Ku, context: 4, implicit: !0, optional: !0 })
@@ -14519,26 +14519,26 @@ let bd = wd = class extends pe {
14519
14519
  bd = wd = h([
14520
14520
  P({ type: C.Set, itemType: ui })
14521
14521
  ], bd);
14522
- class Vo {
14522
+ class Ko {
14523
14523
  constructor(e = {}) {
14524
- this.version = dn.v0, this.recipientInfos = new Xs(), this.encryptedContentInfo = new Mo(), Object.assign(this, e);
14524
+ this.version = dn.v0, this.recipientInfos = new Xs(), this.encryptedContentInfo = new zo(), Object.assign(this, e);
14525
14525
  }
14526
14526
  }
14527
14527
  h([
14528
14528
  m({ type: b.Integer })
14529
- ], Vo.prototype, "version", void 0);
14529
+ ], Ko.prototype, "version", void 0);
14530
14530
  h([
14531
14531
  m({ type: Gu, context: 0, implicit: !0, optional: !0 })
14532
- ], Vo.prototype, "originatorInfo", void 0);
14532
+ ], Ko.prototype, "originatorInfo", void 0);
14533
14533
  h([
14534
14534
  m({ type: Xs })
14535
- ], Vo.prototype, "recipientInfos", void 0);
14535
+ ], Ko.prototype, "recipientInfos", void 0);
14536
14536
  h([
14537
- m({ type: Mo })
14538
- ], Vo.prototype, "encryptedContentInfo", void 0);
14537
+ m({ type: zo })
14538
+ ], Ko.prototype, "encryptedContentInfo", void 0);
14539
14539
  h([
14540
14540
  m({ type: bd, context: 1, implicit: !0, optional: !0 })
14541
- ], Vo.prototype, "unprotectedAttrs", void 0);
14541
+ ], Ko.prototype, "unprotectedAttrs", void 0);
14542
14542
  const k2 = "1.2.840.113549.1.7.2";
14543
14543
  var vd;
14544
14544
  let Qs = vd = class extends pe {
@@ -14547,7 +14547,7 @@ let Qs = vd = class extends pe {
14547
14547
  }
14548
14548
  };
14549
14549
  Qs = vd = h([
14550
- P({ type: C.Set, itemType: po })
14550
+ P({ type: C.Set, itemType: fo })
14551
14551
  ], Qs);
14552
14552
  class hi {
14553
14553
  constructor(e = {}) {
@@ -14572,27 +14572,27 @@ h([
14572
14572
  h([
14573
14573
  m({ type: Vs })
14574
14574
  ], hi.prototype, "signerInfos", void 0);
14575
- const go = "1.2.840.10045.2.1", Wu = "1.2.840.10045.4.1", m_ = "1.2.840.10045.4.3.1", Ju = "1.2.840.10045.4.3.2", Xu = "1.2.840.10045.4.3.3", Zu = "1.2.840.10045.4.3.4", Ff = "1.2.840.10045.3.1.7", Hf = "1.3.132.0.34", Vf = "1.3.132.0.35";
14576
- function Ko(t) {
14577
- return new D({ algorithm: t });
14578
- }
14579
- const x2 = Ko(Wu);
14580
- Ko(m_);
14581
- const S2 = Ko(Ju), A2 = Ko(Xu), E2 = Ko(Zu);
14582
- let mo = class {
14575
+ const mo = "1.2.840.10045.2.1", Wu = "1.2.840.10045.4.1", m_ = "1.2.840.10045.4.3.1", Ju = "1.2.840.10045.4.3.2", Xu = "1.2.840.10045.4.3.3", Zu = "1.2.840.10045.4.3.4", Ff = "1.2.840.10045.3.1.7", Hf = "1.3.132.0.34", Vf = "1.3.132.0.35";
14576
+ function Go(t) {
14577
+ return new M({ algorithm: t });
14578
+ }
14579
+ const x2 = Go(Wu);
14580
+ Go(m_);
14581
+ const S2 = Go(Ju), A2 = Go(Xu), E2 = Go(Zu);
14582
+ let _o = class {
14583
14583
  constructor(e = {}) {
14584
14584
  Object.assign(this, e);
14585
14585
  }
14586
14586
  };
14587
14587
  h([
14588
14588
  m({ type: b.ObjectIdentifier })
14589
- ], mo.prototype, "fieldType", void 0);
14589
+ ], _o.prototype, "fieldType", void 0);
14590
14590
  h([
14591
14591
  m({ type: b.Any })
14592
- ], mo.prototype, "parameters", void 0);
14593
- mo = h([
14592
+ ], _o.prototype, "parameters", void 0);
14593
+ _o = h([
14594
14594
  P({ type: C.Sequence })
14595
- ], mo);
14595
+ ], _o);
14596
14596
  class C2 extends le {
14597
14597
  }
14598
14598
  let Yr = class {
@@ -14625,7 +14625,7 @@ h([
14625
14625
  m({ type: b.Integer })
14626
14626
  ], un.prototype, "version", void 0);
14627
14627
  h([
14628
- m({ type: mo })
14628
+ m({ type: _o })
14629
14629
  ], un.prototype, "fieldID", void 0);
14630
14630
  h([
14631
14631
  m({ type: Yr })
@@ -14689,7 +14689,7 @@ h([
14689
14689
  ], ea.prototype, "s", void 0);
14690
14690
  const at = "1.2.840.113549.1.1", ar = `${at}.1`, N2 = `${at}.7`, j2 = `${at}.9`, to = `${at}.10`, I2 = `${at}.2`, O2 = `${at}.4`, ta = `${at}.5`, P2 = `${at}.14`, kd = `${at}.11`, na = `${at}.12`, ra = `${at}.13`, __ = `${at}.15`, y_ = `${at}.16`, ia = "1.3.14.3.2.26", w_ = "2.16.840.1.101.3.4.2.4", oa = "2.16.840.1.101.3.4.2.1", sa = "2.16.840.1.101.3.4.2.2", aa = "2.16.840.1.101.3.4.2.3", T2 = "2.16.840.1.101.3.4.2.5", R2 = "2.16.840.1.101.3.4.2.6", B2 = "1.2.840.113549.2.2", L2 = "1.2.840.113549.2.5", lc = `${at}.8`;
14691
14691
  function Le(t) {
14692
- return new D({ algorithm: t, parameters: null });
14692
+ return new M({ algorithm: t, parameters: null });
14693
14693
  }
14694
14694
  Le(B2);
14695
14695
  Le(L2);
@@ -14700,10 +14700,10 @@ Le(sa);
14700
14700
  Le(aa);
14701
14701
  Le(T2);
14702
14702
  Le(R2);
14703
- const b_ = new D({
14703
+ const b_ = new M({
14704
14704
  algorithm: lc,
14705
14705
  parameters: T.serialize(cr)
14706
- }), v_ = new D({
14706
+ }), v_ = new M({
14707
14707
  algorithm: j2,
14708
14708
  parameters: T.serialize(Bs.toASN(new Uint8Array([
14709
14709
  218,
@@ -14740,38 +14740,38 @@ Le(__);
14740
14740
  Le(y_);
14741
14741
  class dc {
14742
14742
  constructor(e = {}) {
14743
- this.hashAlgorithm = new D(cr), this.maskGenAlgorithm = new D({
14743
+ this.hashAlgorithm = new M(cr), this.maskGenAlgorithm = new M({
14744
14744
  algorithm: lc,
14745
14745
  parameters: T.serialize(cr)
14746
- }), this.pSourceAlgorithm = new D(v_), Object.assign(this, e);
14746
+ }), this.pSourceAlgorithm = new M(v_), Object.assign(this, e);
14747
14747
  }
14748
14748
  }
14749
14749
  h([
14750
- m({ type: D, context: 0, defaultValue: cr })
14750
+ m({ type: M, context: 0, defaultValue: cr })
14751
14751
  ], dc.prototype, "hashAlgorithm", void 0);
14752
14752
  h([
14753
- m({ type: D, context: 1, defaultValue: b_ })
14753
+ m({ type: M, context: 1, defaultValue: b_ })
14754
14754
  ], dc.prototype, "maskGenAlgorithm", void 0);
14755
14755
  h([
14756
- m({ type: D, context: 2, defaultValue: v_ })
14756
+ m({ type: M, context: 2, defaultValue: v_ })
14757
14757
  ], dc.prototype, "pSourceAlgorithm", void 0);
14758
- new D({
14758
+ new M({
14759
14759
  algorithm: N2,
14760
14760
  parameters: T.serialize(new dc())
14761
14761
  });
14762
14762
  class lr {
14763
14763
  constructor(e = {}) {
14764
- this.hashAlgorithm = new D(cr), this.maskGenAlgorithm = new D({
14764
+ this.hashAlgorithm = new M(cr), this.maskGenAlgorithm = new M({
14765
14765
  algorithm: lc,
14766
14766
  parameters: T.serialize(cr)
14767
14767
  }), this.saltLength = 20, this.trailerField = 1, Object.assign(this, e);
14768
14768
  }
14769
14769
  }
14770
14770
  h([
14771
- m({ type: D, context: 0, defaultValue: cr })
14771
+ m({ type: M, context: 0, defaultValue: cr })
14772
14772
  ], lr.prototype, "hashAlgorithm", void 0);
14773
14773
  h([
14774
- m({ type: D, context: 1, defaultValue: b_ })
14774
+ m({ type: M, context: 1, defaultValue: b_ })
14775
14775
  ], lr.prototype, "maskGenAlgorithm", void 0);
14776
14776
  h([
14777
14777
  m({ type: b.Integer, context: 2, defaultValue: 20 })
@@ -14779,17 +14779,17 @@ h([
14779
14779
  h([
14780
14780
  m({ type: b.Integer, context: 3, defaultValue: 1 })
14781
14781
  ], lr.prototype, "trailerField", void 0);
14782
- new D({
14782
+ new M({
14783
14783
  algorithm: to,
14784
14784
  parameters: T.serialize(new lr())
14785
14785
  });
14786
14786
  class uc {
14787
14787
  constructor(e = {}) {
14788
- this.digestAlgorithm = new D(), this.digest = new le(), Object.assign(this, e);
14788
+ this.digestAlgorithm = new M(), this.digest = new le(), Object.assign(this, e);
14789
14789
  }
14790
14790
  }
14791
14791
  h([
14792
- m({ type: D })
14792
+ m({ type: M })
14793
14793
  ], uc.prototype, "digestAlgorithm", void 0);
14794
14794
  h([
14795
14795
  m({ type: le })
@@ -14969,7 +14969,7 @@ function D2(t, e) {
14969
14969
  return { value: d[0] ? d[1] : void 0, done: !0 };
14970
14970
  }
14971
14971
  }
14972
- function cs(t) {
14972
+ function ls(t) {
14973
14973
  var e = typeof Symbol == "function" && Symbol.iterator, n = e && t[e], r = 0;
14974
14974
  if (n) return n.call(t);
14975
14975
  if (t && typeof t.length == "number") return {
@@ -15060,14 +15060,14 @@ function Kf(t) {
15060
15060
  function F2(t) {
15061
15061
  return typeof t == "function" || t instanceof k_;
15062
15062
  }
15063
- function ms(t) {
15063
+ function _s(t) {
15064
15064
  return !!t.useToken;
15065
15065
  }
15066
- function _s(t) {
15066
+ function ys(t) {
15067
15067
  return t.useValue != null;
15068
15068
  }
15069
15069
  function H2(t) {
15070
- return $_(t) || _s(t) || ms(t) || Cd(t);
15070
+ return $_(t) || ys(t) || _s(t) || Cd(t);
15071
15071
  }
15072
15072
  var ep = (function() {
15073
15073
  function t() {
@@ -15098,7 +15098,7 @@ var ep = (function() {
15098
15098
  return t !== null && t.apply(this, arguments) || this;
15099
15099
  }
15100
15100
  return e;
15101
- })(ep), ls = /* @__PURE__ */ (function() {
15101
+ })(ep), ds = /* @__PURE__ */ (function() {
15102
15102
  function t() {
15103
15103
  this.scopedResolutions = /* @__PURE__ */ new Map();
15104
15104
  }
@@ -15151,16 +15151,16 @@ var X2 = (function(t) {
15151
15151
  return t.prototype.register = function(e, n, r) {
15152
15152
  r === void 0 && (r = { lifecycle: it.Transient }), this.ensureNotDisposed();
15153
15153
  var i;
15154
- if (H2(n) ? i = n : i = { useClass: n }, ms(i))
15154
+ if (H2(n) ? i = n : i = { useClass: n }, _s(i))
15155
15155
  for (var s = [e], a = i; a != null; ) {
15156
15156
  var c = a.useToken;
15157
15157
  if (s.includes(c))
15158
15158
  throw new Error("Token registration cycle detected! " + Hn(s, [c]).join(" -> "));
15159
15159
  s.push(c);
15160
15160
  var l = this._registry.get(c);
15161
- l && ms(l.provider) ? a = l.provider : a = null;
15161
+ l && _s(l.provider) ? a = l.provider : a = null;
15162
15162
  }
15163
- if ((r.lifecycle === it.Singleton || r.lifecycle == it.ContainerScoped || r.lifecycle == it.ResolutionScoped) && (_s(i) || Cd(i)))
15163
+ if ((r.lifecycle === it.Singleton || r.lifecycle == it.ContainerScoped || r.lifecycle == it.ResolutionScoped) && (ys(i) || Cd(i)))
15164
15164
  throw new Error('Cannot use lifecycle "' + it[r.lifecycle] + '" with ValueProviders or FactoryProviders');
15165
15165
  return this._registry.set(e, { provider: i, options: r }), this;
15166
15166
  }, t.prototype.registerType = function(e, n) {
@@ -15190,7 +15190,7 @@ var X2 = (function(t) {
15190
15190
  useClass: r
15191
15191
  }, { lifecycle: it.Singleton });
15192
15192
  }, t.prototype.resolve = function(e, n, r) {
15193
- n === void 0 && (n = new ls()), r === void 0 && (r = !1), this.ensureNotDisposed();
15193
+ n === void 0 && (n = new ds()), r === void 0 && (r = !1), this.ensureNotDisposed();
15194
15194
  var i = this.getRegistration(e);
15195
15195
  if (!i && $r(e)) {
15196
15196
  if (r)
@@ -15211,7 +15211,7 @@ var X2 = (function(t) {
15211
15211
  if (this.interceptors.preResolution.has(e)) {
15212
15212
  var s = [];
15213
15213
  try {
15214
- for (var a = cs(this.interceptors.preResolution.getAll(e)), c = a.next(); !c.done; c = a.next()) {
15214
+ for (var a = ls(this.interceptors.preResolution.getAll(e)), c = a.next(); !c.done; c = a.next()) {
15215
15215
  var l = c.value;
15216
15216
  l.options.frequency != "Once" && s.push(l), l.callback(e, n);
15217
15217
  }
@@ -15231,7 +15231,7 @@ var X2 = (function(t) {
15231
15231
  if (this.interceptors.postResolution.has(e)) {
15232
15232
  var a = [];
15233
15233
  try {
15234
- for (var c = cs(this.interceptors.postResolution.getAll(e)), l = c.next(); !l.done; l = c.next()) {
15234
+ for (var c = ls(this.interceptors.postResolution.getAll(e)), l = c.next(); !l.done; l = c.next()) {
15235
15235
  var d = l.value;
15236
15236
  d.options.frequency != "Once" && a.push(d), d.callback(e, n, r);
15237
15237
  }
@@ -15250,10 +15250,10 @@ var X2 = (function(t) {
15250
15250
  if (this.ensureNotDisposed(), e.options.lifecycle === it.ResolutionScoped && n.scopedResolutions.has(e))
15251
15251
  return n.scopedResolutions.get(e);
15252
15252
  var r = e.options.lifecycle === it.Singleton, i = e.options.lifecycle === it.ContainerScoped, s = r || i, a;
15253
- return _s(e.provider) ? a = e.provider.useValue : ms(e.provider) ? a = s ? e.instance || (e.instance = this.resolve(e.provider.useToken, n)) : this.resolve(e.provider.useToken, n) : $_(e.provider) ? a = s ? e.instance || (e.instance = this.construct(e.provider.useClass, n)) : this.construct(e.provider.useClass, n) : Cd(e.provider) ? a = e.provider.useFactory(this) : a = this.construct(e.provider, n), e.options.lifecycle === it.ResolutionScoped && n.scopedResolutions.set(e, a), a;
15253
+ return ys(e.provider) ? a = e.provider.useValue : _s(e.provider) ? a = s ? e.instance || (e.instance = this.resolve(e.provider.useToken, n)) : this.resolve(e.provider.useToken, n) : $_(e.provider) ? a = s ? e.instance || (e.instance = this.construct(e.provider.useClass, n)) : this.construct(e.provider.useClass, n) : Cd(e.provider) ? a = e.provider.useFactory(this) : a = this.construct(e.provider, n), e.options.lifecycle === it.ResolutionScoped && n.scopedResolutions.set(e, a), a;
15254
15254
  }, t.prototype.resolveAll = function(e, n, r) {
15255
15255
  var i = this;
15256
- n === void 0 && (n = new ls()), r === void 0 && (r = !1), this.ensureNotDisposed();
15256
+ n === void 0 && (n = new ds()), r === void 0 && (r = !1), this.ensureNotDisposed();
15257
15257
  var s = this.getAllRegistrations(e);
15258
15258
  if (!s && $r(e)) {
15259
15259
  if (r)
@@ -15276,10 +15276,10 @@ var X2 = (function(t) {
15276
15276
  var e, n;
15277
15277
  this.ensureNotDisposed();
15278
15278
  try {
15279
- for (var r = cs(this._registry.entries()), i = r.next(); !i.done; i = r.next()) {
15279
+ for (var r = ls(this._registry.entries()), i = r.next(); !i.done; i = r.next()) {
15280
15280
  var s = ca(i.value, 2), a = s[0], c = s[1];
15281
15281
  this._registry.setAll(a, c.filter(function(l) {
15282
- return !_s(l.provider);
15282
+ return !ys(l.provider);
15283
15283
  }).map(function(l) {
15284
15284
  return l.instance = void 0, l;
15285
15285
  }));
@@ -15298,7 +15298,7 @@ var X2 = (function(t) {
15298
15298
  this.ensureNotDisposed();
15299
15299
  var r = new t(this);
15300
15300
  try {
15301
- for (var i = cs(this._registry.entries()), s = i.next(); !s.done; s = i.next()) {
15301
+ for (var i = ls(this._registry.entries()), s = i.next(); !s.done; s = i.next()) {
15302
15302
  var a = ca(s.value, 2), c = a[0], l = a[1];
15303
15303
  l.some(function(d) {
15304
15304
  var p = d.options;
@@ -15371,7 +15371,7 @@ var X2 = (function(t) {
15371
15371
  return function(i, s) {
15372
15372
  var a, c, l;
15373
15373
  try {
15374
- return q2(i) ? Kf(i) ? i.multiple ? (a = r.resolve(i.transform)).transform.apply(a, Hn([r.resolveAll(i.token, new ls(), i.isOptional)], i.transformArgs)) : (c = r.resolve(i.transform)).transform.apply(c, Hn([r.resolve(i.token, e, i.isOptional)], i.transformArgs)) : i.multiple ? r.resolveAll(i.token, new ls(), i.isOptional) : r.resolve(i.token, e, i.isOptional) : Kf(i) ? (l = r.resolve(i.transform, e)).transform.apply(l, Hn([r.resolve(i.token, e)], i.transformArgs)) : r.resolve(i, e);
15374
+ return q2(i) ? Kf(i) ? i.multiple ? (a = r.resolve(i.transform)).transform.apply(a, Hn([r.resolveAll(i.token, new ds(), i.isOptional)], i.transformArgs)) : (c = r.resolve(i.transform)).transform.apply(c, Hn([r.resolve(i.token, e, i.isOptional)], i.transformArgs)) : i.multiple ? r.resolveAll(i.token, new ds(), i.isOptional) : r.resolve(i.token, e, i.isOptional) : Kf(i) ? (l = r.resolve(i.transform, e)).transform.apply(l, Hn([r.resolve(i.token, e)], i.transformArgs)) : r.resolve(i, e);
15375
15375
  } catch (d) {
15376
15376
  throw new Error(W2(n, s, d));
15377
15377
  }
@@ -15443,11 +15443,11 @@ class E_ extends le {
15443
15443
  }
15444
15444
  let gc = class {
15445
15445
  constructor(e = {}) {
15446
- this.encryptionAlgorithm = new D(), this.encryptedData = new E_(), Object.assign(this, e);
15446
+ this.encryptionAlgorithm = new M(), this.encryptedData = new E_(), Object.assign(this, e);
15447
15447
  }
15448
15448
  };
15449
15449
  h([
15450
- m({ type: D })
15450
+ m({ type: M })
15451
15451
  ], gc.prototype, "encryptionAlgorithm", void 0);
15452
15452
  h([
15453
15453
  m({ type: E_ })
@@ -15466,24 +15466,24 @@ let Pd = Id = class extends pe {
15466
15466
  Pd = Id = h([
15467
15467
  P({ type: C.Sequence, itemType: ln })
15468
15468
  ], Pd);
15469
- class Go {
15469
+ class Wo {
15470
15470
  constructor(e = {}) {
15471
- this.version = Od.v1, this.privateKeyAlgorithm = new D(), this.privateKey = new C_(), Object.assign(this, e);
15471
+ this.version = Od.v1, this.privateKeyAlgorithm = new M(), this.privateKey = new C_(), Object.assign(this, e);
15472
15472
  }
15473
15473
  }
15474
15474
  h([
15475
15475
  m({ type: b.Integer })
15476
- ], Go.prototype, "version", void 0);
15476
+ ], Wo.prototype, "version", void 0);
15477
15477
  h([
15478
- m({ type: D })
15479
- ], Go.prototype, "privateKeyAlgorithm", void 0);
15478
+ m({ type: M })
15479
+ ], Wo.prototype, "privateKeyAlgorithm", void 0);
15480
15480
  h([
15481
15481
  m({ type: C_ })
15482
- ], Go.prototype, "privateKey", void 0);
15482
+ ], Wo.prototype, "privateKey", void 0);
15483
15483
  h([
15484
15484
  m({ type: Pd, implicit: !0, context: 0, optional: !0 })
15485
- ], Go.prototype, "attributes", void 0);
15486
- let Jf = class extends Go {
15485
+ ], Wo.prototype, "attributes", void 0);
15486
+ let Jf = class extends Wo {
15487
15487
  };
15488
15488
  Jf = h([
15489
15489
  P({ type: C.Sequence })
@@ -15504,23 +15504,23 @@ h([
15504
15504
  h([
15505
15505
  m({ type: b.Any, context: 0 })
15506
15506
  ], N_.prototype, "secretValue", void 0);
15507
- class Wo {
15507
+ class Jo {
15508
15508
  constructor(e = {}) {
15509
15509
  this.mac = new uc(), this.macSalt = new le(), this.iterations = 1, Object.assign(this, e);
15510
15510
  }
15511
15511
  }
15512
15512
  h([
15513
15513
  m({ type: uc })
15514
- ], Wo.prototype, "mac", void 0);
15514
+ ], Jo.prototype, "mac", void 0);
15515
15515
  h([
15516
15516
  m({ type: le })
15517
- ], Wo.prototype, "macSalt", void 0);
15517
+ ], Jo.prototype, "macSalt", void 0);
15518
15518
  h([
15519
15519
  m({ type: b.Integer, defaultValue: 1 })
15520
- ], Wo.prototype, "iterations", void 0);
15520
+ ], Jo.prototype, "iterations", void 0);
15521
15521
  class mc {
15522
15522
  constructor(e = {}) {
15523
- this.version = 3, this.authSafe = new pi(), this.macData = new Wo(), Object.assign(this, e);
15523
+ this.version = 3, this.authSafe = new pi(), this.macData = new Jo(), Object.assign(this, e);
15524
15524
  }
15525
15525
  }
15526
15526
  h([
@@ -15530,7 +15530,7 @@ h([
15530
15530
  m({ type: pi })
15531
15531
  ], mc.prototype, "authSafe", void 0);
15532
15532
  h([
15533
- m({ type: Wo, optional: !0 })
15533
+ m({ type: Jo, optional: !0 })
15534
15534
  ], mc.prototype, "macData", void 0);
15535
15535
  var Td;
15536
15536
  class _c {
@@ -15737,7 +15737,7 @@ h([
15737
15737
  Fd = h([
15738
15738
  P({ type: C.Choice })
15739
15739
  ], Fd);
15740
- let Hd = class extends D {
15740
+ let Hd = class extends M {
15741
15741
  };
15742
15742
  Hd = h([
15743
15743
  P({ type: C.Sequence })
@@ -15776,24 +15776,24 @@ h([
15776
15776
  h([
15777
15777
  m({ type: pa, implicit: !0, context: 0 })
15778
15778
  ], gi.prototype, "attributes", void 0);
15779
- class _o {
15779
+ class yo {
15780
15780
  constructor(e = {}) {
15781
- this.certificationRequestInfo = new gi(), this.signatureAlgorithm = new D(), this.signature = new ArrayBuffer(0), Object.assign(this, e);
15781
+ this.certificationRequestInfo = new gi(), this.signatureAlgorithm = new M(), this.signature = new ArrayBuffer(0), Object.assign(this, e);
15782
15782
  }
15783
15783
  }
15784
15784
  h([
15785
15785
  m({ type: gi, raw: !0 })
15786
- ], _o.prototype, "certificationRequestInfo", void 0);
15786
+ ], yo.prototype, "certificationRequestInfo", void 0);
15787
15787
  h([
15788
- m({ type: D })
15789
- ], _o.prototype, "signatureAlgorithm", void 0);
15788
+ m({ type: M })
15789
+ ], yo.prototype, "signatureAlgorithm", void 0);
15790
15790
  h([
15791
15791
  m({ type: b.BitString })
15792
- ], _o.prototype, "signature", void 0);
15793
- const Jo = "crypto.algorithm";
15792
+ ], yo.prototype, "signature", void 0);
15793
+ const Xo = "crypto.algorithm";
15794
15794
  class e3 {
15795
15795
  getAlgorithms() {
15796
- return Ve.resolveAll(Jo);
15796
+ return Ve.resolveAll(Xo);
15797
15797
  }
15798
15798
  toAsnAlgorithm(e) {
15799
15799
  ({ ...e });
@@ -15803,7 +15803,7 @@ class e3 {
15803
15803
  return r;
15804
15804
  }
15805
15805
  if (/^[0-9.]+$/.test(e.name)) {
15806
- const n = new D({
15806
+ const n = new M({
15807
15807
  algorithm: e.name
15808
15808
  });
15809
15809
  if ("parameters" in e) {
@@ -15828,9 +15828,9 @@ class e3 {
15828
15828
  }
15829
15829
  const dr = "crypto.algorithmProvider";
15830
15830
  Ve.registerSingleton(dr, e3);
15831
- var ys;
15831
+ var ws;
15832
15832
  const ct = "1.3.36.3.3.2.8.1.1", uh = `${ct}.1`, ph = `${ct}.2`, fh = `${ct}.3`, hh = `${ct}.4`, gh = `${ct}.5`, mh = `${ct}.6`, _h = `${ct}.7`, yh = `${ct}.8`, wh = `${ct}.9`, bh = `${ct}.10`, vh = `${ct}.11`, $h = `${ct}.12`, kh = `${ct}.13`, xh = `${ct}.14`, Sh = "brainpoolP160r1", Ah = "brainpoolP160t1", Eh = "brainpoolP192r1", Ch = "brainpoolP192t1", Nh = "brainpoolP224r1", jh = "brainpoolP224t1", Ih = "brainpoolP256r1", Oh = "brainpoolP256t1", Ph = "brainpoolP320r1", Th = "brainpoolP320t1", Rh = "brainpoolP384r1", Bh = "brainpoolP384t1", Lh = "brainpoolP512r1", Uh = "brainpoolP512t1", $e = "ECDSA";
15833
- let yo = ys = class {
15833
+ let wo = ws = class {
15834
15834
  toAsnAlgorithm(e) {
15835
15835
  switch (e.name.toLowerCase()) {
15836
15836
  case $e.toLowerCase():
@@ -15852,7 +15852,7 @@ let yo = ys = class {
15852
15852
  n = Ff;
15853
15853
  break;
15854
15854
  case "K-256":
15855
- n = ys.SECP256K1;
15855
+ n = ws.SECP256K1;
15856
15856
  break;
15857
15857
  case "P-384":
15858
15858
  n = Hf;
@@ -15904,8 +15904,8 @@ let yo = ys = class {
15904
15904
  break;
15905
15905
  }
15906
15906
  if (n)
15907
- return new D({
15908
- algorithm: go,
15907
+ return new M({
15908
+ algorithm: mo,
15909
15909
  parameters: T.serialize(new Rn({ namedCurve: n }))
15910
15910
  });
15911
15911
  }
@@ -15922,13 +15922,13 @@ let yo = ys = class {
15922
15922
  return { name: $e, hash: { name: "SHA-384" } };
15923
15923
  case Zu:
15924
15924
  return { name: $e, hash: { name: "SHA-512" } };
15925
- case go: {
15925
+ case mo: {
15926
15926
  if (!e.parameters)
15927
15927
  throw new TypeError("Cannot get required parameters from EC algorithm");
15928
15928
  switch (T.parse(e.parameters, Rn).namedCurve) {
15929
15929
  case Ff:
15930
15930
  return { name: $e, namedCurve: "P-256" };
15931
- case ys.SECP256K1:
15931
+ case ws.SECP256K1:
15932
15932
  return { name: $e, namedCurve: "K-256" };
15933
15933
  case Hf:
15934
15934
  return { name: $e, namedCurve: "P-384" };
@@ -15968,11 +15968,11 @@ let yo = ys = class {
15968
15968
  return null;
15969
15969
  }
15970
15970
  };
15971
- yo.SECP256K1 = "1.3.132.0.10";
15972
- yo = ys = h([
15971
+ wo.SECP256K1 = "1.3.132.0.10";
15972
+ wo = ws = h([
15973
15973
  fc()
15974
- ], yo);
15975
- Ve.registerSingleton(Jo, yo);
15974
+ ], wo);
15975
+ Ve.registerSingleton(Xo, wo);
15976
15976
  const O_ = Symbol("name"), P_ = Symbol("value");
15977
15977
  class de {
15978
15978
  constructor(e, n = {}, r = "") {
@@ -15988,8 +15988,8 @@ class t3 {
15988
15988
  const n = new de("Algorithm Identifier", {}, Un.toString(e.algorithm));
15989
15989
  if (e.parameters)
15990
15990
  switch (e.algorithm) {
15991
- case go: {
15992
- const r = new yo().toWebAlgorithm(e);
15991
+ case mo: {
15992
+ const r = new wo().toWebAlgorithm(e);
15993
15993
  r && "namedCurve" in r ? n["Named Curve"] = r.namedCurve : n.Parameters = e.parameters;
15994
15994
  break;
15995
15995
  }
@@ -16017,7 +16017,7 @@ Un.items = {
16017
16017
  [kd]: "sha256WithRSAEncryption",
16018
16018
  [na]: "sha384WithRSAEncryption",
16019
16019
  [ra]: "sha512WithRSAEncryption",
16020
- [go]: "ecPublicKey",
16020
+ [mo]: "ecPublicKey",
16021
16021
  [Wu]: "ecdsaWithSHA1",
16022
16022
  [m_]: "ecdsaWithSHA224",
16023
16023
  [Ju]: "ecdsaWithSHA256",
@@ -16367,7 +16367,7 @@ class At {
16367
16367
  return e.length >= 1 && !(!((n = e[0]) === null || n === void 0) && n.subtle) ? (i = e[0] || i, r = e[1] || De.get()) : r = e[0] || De.get(), await r.subtle.digest(i, this.toArrayBuffer());
16368
16368
  }
16369
16369
  }
16370
- const B_ = "Cannot initialize GeneralName from ASN.1 data.", Dh = `${B_} Unsupported string format in use.`, s3 = `${B_} Value doesn't match to GUID regular expression.`, Mh = /^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i, zh = "1.3.6.1.4.1.311.25.1", qh = "1.3.6.1.4.1.311.20.2.3", Hc = "dns", Vc = "dn", Kc = "email", Gc = "ip", Wc = "url", Jc = "guid", Xc = "upn", ds = "id";
16370
+ const B_ = "Cannot initialize GeneralName from ASN.1 data.", Dh = `${B_} Unsupported string format in use.`, s3 = `${B_} Value doesn't match to GUID regular expression.`, Mh = /^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i, zh = "1.3.6.1.4.1.311.25.1", qh = "1.3.6.1.4.1.311.20.2.3", Hc = "dns", Vc = "dn", Kc = "email", Gc = "ip", Wc = "url", Jc = "guid", Xc = "upn", us = "id";
16371
16371
  class Cn extends Dn {
16372
16372
  constructor(...e) {
16373
16373
  let n;
@@ -16390,7 +16390,7 @@ class Cn extends Dn {
16390
16390
  throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");
16391
16391
  const i = r.slice(1).map((s, a) => a < 3 ? F.ToHex(new Uint8Array(F.FromHex(s)).reverse()) : s).join("");
16392
16392
  n = new ne({
16393
- otherName: new uo({
16393
+ otherName: new po({
16394
16394
  typeId: zh,
16395
16395
  value: T.serialize(new le(F.FromHex(i)))
16396
16396
  })
@@ -16400,12 +16400,12 @@ class Cn extends Dn {
16400
16400
  case Gc:
16401
16401
  n = new ne({ iPAddress: e[1] });
16402
16402
  break;
16403
- case ds:
16403
+ case us:
16404
16404
  n = new ne({ registeredID: e[1] });
16405
16405
  break;
16406
16406
  case Xc: {
16407
16407
  n = new ne({
16408
- otherName: new uo({
16408
+ otherName: new po({
16409
16409
  typeId: qh,
16410
16410
  value: T.serialize(Ym.toASN(e[1]))
16411
16411
  })
@@ -16431,7 +16431,7 @@ class Cn extends Dn {
16431
16431
  else if (e.uniformResourceIdentifier != null)
16432
16432
  this.type = Wc, this.value = e.uniformResourceIdentifier;
16433
16433
  else if (e.registeredID != null)
16434
- this.type = ds, this.value = e.registeredID;
16434
+ this.type = us, this.value = e.registeredID;
16435
16435
  else if (e.directoryName != null)
16436
16436
  this.type = Vc, this.value = new At(e.directoryName).toString();
16437
16437
  else if (e.otherName != null)
@@ -16461,7 +16461,7 @@ class Cn extends Dn {
16461
16461
  case Hc:
16462
16462
  case Jc:
16463
16463
  case Gc:
16464
- case ds:
16464
+ case us:
16465
16465
  case Xc:
16466
16466
  case Wc:
16467
16467
  e = this.type.toUpperCase();
@@ -16473,7 +16473,7 @@ class Cn extends Dn {
16473
16473
  throw new Error("Unsupported GeneralName type");
16474
16474
  }
16475
16475
  let n = this.value;
16476
- return this.type === ds && (n = Un.toString(n)), new de(e, void 0, n);
16476
+ return this.type === us && (n = Un.toString(n)), new de(e, void 0, n);
16477
16477
  }
16478
16478
  }
16479
16479
  class pr extends Dn {
@@ -16524,7 +16524,7 @@ class pr extends Dn {
16524
16524
  }
16525
16525
  }
16526
16526
  pr.NAME = "GeneralNames";
16527
- const no = "-{5}", wo = "\\n", a3 = `[^${wo}]+`, c3 = `${no}BEGIN (${a3}(?=${no}))${no}`, l3 = `${no}END \\1${no}`, Qr = "\\n", d3 = `[^:${wo}]+`, u3 = `(?:[^${wo}]+${Qr}(?: +[^${wo}]+${Qr})*)`, p3 = "[a-zA-Z0-9=+/]+", f3 = `(?:${p3}${Qr})+`, Fh = `${c3}${Qr}(?:((?:${d3}: ${u3})+))?${Qr}?(${f3})${l3}`;
16527
+ const no = "-{5}", bo = "\\n", a3 = `[^${bo}]+`, c3 = `${no}BEGIN (${a3}(?=${no}))${no}`, l3 = `${no}END \\1${no}`, Qr = "\\n", d3 = `[^:${bo}]+`, u3 = `(?:[^${bo}]+${Qr}(?: +[^${bo}]+${Qr})*)`, p3 = "[a-zA-Z0-9=+/]+", f3 = `(?:${p3}${Qr})+`, Fh = `${c3}${Qr}(?:((?:${d3}: ${u3})+))?${Qr}?(${f3})${l3}`;
16528
16528
  class dt {
16529
16529
  static isPem(e) {
16530
16530
  return typeof e == "string" && new RegExp(Fh, "g").test(e.replace(/\r/g, ""));
@@ -16534,7 +16534,7 @@ class dt {
16534
16534
  const n = new RegExp(Fh, "g"), r = [];
16535
16535
  let i = null;
16536
16536
  for (; i = n.exec(e); ) {
16537
- const s = i[3].replace(new RegExp(`[${wo}]+`, "g"), ""), a = {
16537
+ const s = i[3].replace(new RegExp(`[${bo}]+`, "g"), ""), a = {
16538
16538
  type: i[1],
16539
16539
  headers: [],
16540
16540
  rawData: F.FromBase64(s)
@@ -16708,7 +16708,7 @@ class Nt extends pn {
16708
16708
  toTextObject() {
16709
16709
  const e = this.toTextObjectEmpty(), n = T.parse(this.rawData, St);
16710
16710
  switch (e.Algorithm = ur.serializeAlgorithm(n.algorithm), n.algorithm.algorithm) {
16711
- case go:
16711
+ case mo:
16712
16712
  e["EC Point"] = n.subjectPublicKey;
16713
16713
  break;
16714
16714
  case ar:
@@ -16719,17 +16719,17 @@ class Nt extends pn {
16719
16719
  }
16720
16720
  }
16721
16721
  function h3(t, e) {
16722
- return t.algorithm = new D({
16722
+ return t.algorithm = new M({
16723
16723
  algorithm: ar,
16724
16724
  parameters: null
16725
16725
  }), e = T.serialize(t), e;
16726
16726
  }
16727
- class bo extends ht {
16727
+ class vo extends ht {
16728
16728
  static async create(e, n = !1, r = De.get()) {
16729
16729
  if ("name" in e && "serialNumber" in e)
16730
- return new bo(e, n);
16730
+ return new vo(e, n);
16731
16731
  const s = await (await Nt.create(e, r)).getKeyIdentifier(r);
16732
- return new bo(F.ToHex(s), n);
16732
+ return new vo(F.ToHex(s), n);
16733
16733
  }
16734
16734
  constructor(...e) {
16735
16735
  if (R.isBufferSource(e[0]))
@@ -16758,7 +16758,7 @@ class bo extends ht {
16758
16758
  return n.authorityCertIssuer && (e["Authority Issuer"] = new pr(n.authorityCertIssuer).toTextObject()), n.authorityCertSerialNumber && (e["Authority Serial Number"] = n.authorityCertSerialNumber), n.keyIdentifier && (e[""] = n.keyIdentifier), e;
16759
16759
  }
16760
16760
  }
16761
- bo.NAME = "Authority Key Identifier";
16761
+ vo.NAME = "Authority Key Identifier";
16762
16762
  class np extends ht {
16763
16763
  constructor(...e) {
16764
16764
  if (R.isBufferSource(e[0])) {
@@ -16821,10 +16821,10 @@ class ip extends ht {
16821
16821
  }
16822
16822
  }
16823
16823
  ip.NAME = "Key Usages";
16824
- class Xo extends ht {
16824
+ class Zo extends ht {
16825
16825
  static async create(e, n = !1, r = De.get()) {
16826
16826
  const s = await (await Nt.create(e, r)).getKeyIdentifier(r);
16827
- return new Xo(F.ToHex(s), n);
16827
+ return new Zo(F.ToHex(s), n);
16828
16828
  }
16829
16829
  constructor(...e) {
16830
16830
  if (R.isBufferSource(e[0])) {
@@ -16841,7 +16841,7 @@ class Xo extends ht {
16841
16841
  return e[""] = n, e;
16842
16842
  }
16843
16843
  }
16844
- Xo.NAME = "Subject Key Identifier";
16844
+ Zo.NAME = "Subject Key Identifier";
16845
16845
  class L_ extends ht {
16846
16846
  constructor(...e) {
16847
16847
  R.isBufferSource(e[0]) ? super(e[0]) : super(c_, e[1], new pr(e[0] || []).rawData);
@@ -16933,7 +16933,7 @@ class M_ extends ht {
16933
16933
  super(Ml, e[1], T.serialize(a));
16934
16934
  } else {
16935
16935
  const a = e[0], c = new Tr();
16936
- ps(c, a, Cf, "ocsp"), ps(c, a, Nf, "caIssuers"), ps(c, a, jf, "timeStamping"), ps(c, a, If, "caRepository"), super(Ml, e[1], T.serialize(c));
16936
+ fs(c, a, Cf, "ocsp"), fs(c, a, Nf, "caIssuers"), fs(c, a, jf, "timeStamping"), fs(c, a, If, "caRepository"), super(Ml, e[1], T.serialize(c));
16937
16937
  }
16938
16938
  (n = this.ocsp) !== null && n !== void 0 || (this.ocsp = []), (r = this.caIssuers) !== null && r !== void 0 || (this.caIssuers = []), (i = this.timeStamping) !== null && i !== void 0 || (this.timeStamping = []), (s = this.caRepository) !== null && s !== void 0 || (this.caRepository = []);
16939
16939
  }
@@ -16957,11 +16957,11 @@ class M_ extends ht {
16957
16957
  }
16958
16958
  toTextObject() {
16959
16959
  const e = this.toTextObjectWithoutValue();
16960
- return this.ocsp.length && us(e, "OCSP", this.ocsp), this.caIssuers.length && us(e, "CA Issuers", this.caIssuers), this.timeStamping.length && us(e, "Time Stamping", this.timeStamping), this.caRepository.length && us(e, "CA Repository", this.caRepository), e;
16960
+ return this.ocsp.length && ps(e, "OCSP", this.ocsp), this.caIssuers.length && ps(e, "CA Issuers", this.caIssuers), this.timeStamping.length && ps(e, "Time Stamping", this.timeStamping), this.caRepository.length && ps(e, "CA Repository", this.caRepository), e;
16961
16961
  }
16962
16962
  }
16963
16963
  M_.NAME = "Authority Info Access";
16964
- function us(t, e, n) {
16964
+ function ps(t, e, n) {
16965
16965
  if (n.length === 1)
16966
16966
  t[e] = n[0].toTextObject();
16967
16967
  else {
@@ -16973,10 +16973,10 @@ function us(t, e, n) {
16973
16973
  }), t[e] = r;
16974
16974
  }
16975
16975
  }
16976
- function ps(t, e, n, r) {
16976
+ function fs(t, e, n, r) {
16977
16977
  const i = e[r];
16978
16978
  i && (Array.isArray(i) ? i : [i]).forEach((a) => {
16979
- typeof a == "string" && (a = new Cn("url", a)), t.push(new Lo({
16979
+ typeof a == "string" && (a = new Cn("url", a)), t.push(new Uo({
16980
16980
  accessMethod: n,
16981
16981
  accessLocation: T.parse(a.rawData, ne)
16982
16982
  }));
@@ -17085,7 +17085,7 @@ class yc {
17085
17085
  }
17086
17086
  }
17087
17087
  yc.items = /* @__PURE__ */ new Map();
17088
- const Zo = "crypto.signatureFormatter";
17088
+ const Yo = "crypto.signatureFormatter";
17089
17089
  class g3 {
17090
17090
  toAsnSignature(e, n) {
17091
17091
  return R.toArrayBuffer(n);
@@ -17094,13 +17094,13 @@ class g3 {
17094
17094
  return R.toArrayBuffer(n);
17095
17095
  }
17096
17096
  }
17097
- var ws;
17098
- let Kd = ws = class {
17097
+ var bs;
17098
+ let Kd = bs = class {
17099
17099
  static createPssParams(e, n) {
17100
- const r = ws.getHashAlgorithm(e);
17100
+ const r = bs.getHashAlgorithm(e);
17101
17101
  return r ? new lr({
17102
17102
  hashAlgorithm: r,
17103
- maskGenAlgorithm: new D({
17103
+ maskGenAlgorithm: new M({
17104
17104
  algorithm: lc,
17105
17105
  parameters: T.serialize(r)
17106
17106
  }),
@@ -17124,27 +17124,27 @@ let Kd = ws = class {
17124
17124
  throw new Error("Cannot get hash algorithm name");
17125
17125
  switch (n.toLowerCase()) {
17126
17126
  case "sha-1":
17127
- return new D({ algorithm: ta, parameters: null });
17127
+ return new M({ algorithm: ta, parameters: null });
17128
17128
  case "sha-256":
17129
- return new D({ algorithm: kd, parameters: null });
17129
+ return new M({ algorithm: kd, parameters: null });
17130
17130
  case "sha-384":
17131
- return new D({ algorithm: na, parameters: null });
17131
+ return new M({ algorithm: na, parameters: null });
17132
17132
  case "sha-512":
17133
- return new D({ algorithm: ra, parameters: null });
17133
+ return new M({ algorithm: ra, parameters: null });
17134
17134
  }
17135
17135
  } else
17136
- return new D({ algorithm: ar, parameters: null });
17136
+ return new M({ algorithm: ar, parameters: null });
17137
17137
  break;
17138
17138
  case "rsa-pss":
17139
17139
  if ("hash" in e) {
17140
17140
  if (!("saltLength" in e && typeof e.saltLength == "number"))
17141
17141
  throw new Error("Cannot get 'saltLength' from 'alg' argument");
17142
- const n = ws.createPssParams(e.hash, e.saltLength);
17142
+ const n = bs.createPssParams(e.hash, e.saltLength);
17143
17143
  if (!n)
17144
17144
  throw new Error("Cannot create PSS parameters");
17145
- return new D({ algorithm: to, parameters: T.serialize(n) });
17145
+ return new M({ algorithm: to, parameters: T.serialize(n) });
17146
17146
  } else
17147
- return new D({ algorithm: to, parameters: null });
17147
+ return new M({ algorithm: to, parameters: null });
17148
17148
  }
17149
17149
  return null;
17150
17150
  }
@@ -17174,21 +17174,21 @@ let Kd = ws = class {
17174
17174
  return null;
17175
17175
  }
17176
17176
  };
17177
- Kd = ws = h([
17177
+ Kd = bs = h([
17178
17178
  fc()
17179
17179
  ], Kd);
17180
- Ve.registerSingleton(Jo, Kd);
17180
+ Ve.registerSingleton(Xo, Kd);
17181
17181
  let Gd = class {
17182
17182
  toAsnAlgorithm(e) {
17183
17183
  switch (e.name.toLowerCase()) {
17184
17184
  case "sha-1":
17185
- return new D({ algorithm: ia });
17185
+ return new M({ algorithm: ia });
17186
17186
  case "sha-256":
17187
- return new D({ algorithm: oa });
17187
+ return new M({ algorithm: oa });
17188
17188
  case "sha-384":
17189
- return new D({ algorithm: sa });
17189
+ return new M({ algorithm: sa });
17190
17190
  case "sha-512":
17191
- return new D({ algorithm: aa });
17191
+ return new M({ algorithm: aa });
17192
17192
  }
17193
17193
  return null;
17194
17194
  }
@@ -17209,7 +17209,7 @@ let Gd = class {
17209
17209
  Gd = h([
17210
17210
  fc()
17211
17211
  ], Gd);
17212
- Ve.registerSingleton(Jo, Gd);
17212
+ Ve.registerSingleton(Xo, Gd);
17213
17213
  class _t {
17214
17214
  addPadding(e, n) {
17215
17215
  const r = R.toUint8Array(n), i = new Uint8Array(e);
@@ -17276,7 +17276,7 @@ let Wd = class {
17276
17276
  break;
17277
17277
  }
17278
17278
  }
17279
- return n ? new D({
17279
+ return n ? new M({
17280
17280
  algorithm: n
17281
17281
  }) : null;
17282
17282
  }
@@ -17297,7 +17297,7 @@ let Wd = class {
17297
17297
  Wd = h([
17298
17298
  fc()
17299
17299
  ], Wd);
17300
- Ve.registerSingleton(Jo, Wd);
17300
+ Ve.registerSingleton(Xo, Wd);
17301
17301
  var ji, Ii, Oi, Pi, Ti, Ri, Bi, Er;
17302
17302
  class m3 extends pn {
17303
17303
  get subjectName() {
@@ -17334,7 +17334,7 @@ class m3 extends pn {
17334
17334
  return re(this, ji, "f") || we(this, ji, this.asn.certificationRequestInfoRaw || T.serialize(this.asn.certificationRequestInfo), "f"), re(this, ji, "f");
17335
17335
  }
17336
17336
  constructor(e) {
17337
- const n = pn.isAsnEncoded(e) ? [e, _o] : [e];
17337
+ const n = pn.isAsnEncoded(e) ? [e, yo] : [e];
17338
17338
  super(n[0], n[1]), ji.set(this, void 0), Ii.set(this, void 0), Oi.set(this, void 0), Pi.set(this, void 0), Ti.set(this, void 0), Ri.set(this, void 0), Bi.set(this, void 0), Er.set(this, void 0), this.tag = dt.CertificateRequestTag;
17339
17339
  }
17340
17340
  onInit(e) {
@@ -17358,7 +17358,7 @@ class m3 extends pn {
17358
17358
  return this.extensions.filter((n) => n.type === e);
17359
17359
  }
17360
17360
  async verify(e = De.get()) {
17361
- const n = { ...this.publicKey.algorithm, ...this.signatureAlgorithm }, r = await this.publicKey.export(n, ["verify"], e), i = Ve.resolveAll(Zo).reverse();
17361
+ const n = { ...this.publicKey.algorithm, ...this.signatureAlgorithm }, r = await this.publicKey.export(n, ["verify"], e), i = Ve.resolveAll(Yo).reverse();
17362
17362
  let s = null;
17363
17363
  for (const c of i)
17364
17364
  if (s = c.toWebSignature(n, this.signature), s)
@@ -17368,7 +17368,7 @@ class m3 extends pn {
17368
17368
  return await e.subtle.verify(this.signatureAlgorithm, r, s, this.tbs);
17369
17369
  }
17370
17370
  toTextObject() {
17371
- const e = this.toTextObjectEmpty(), n = T.parse(this.rawData, _o), r = n.certificationRequestInfo, i = new de("", {
17371
+ const e = this.toTextObjectEmpty(), n = T.parse(this.rawData, yo), r = n.certificationRequestInfo, i = new de("", {
17372
17372
  Version: `${ir[r.version]} (${r.version})`,
17373
17373
  Subject: this.subject,
17374
17374
  "Subject Public Key Info": this.publicKey
@@ -17484,7 +17484,7 @@ class wc extends pn {
17484
17484
  } catch {
17485
17485
  return !1;
17486
17486
  }
17487
- const a = Ve.resolveAll(Zo).reverse();
17487
+ const a = Ve.resolveAll(Yo).reverse();
17488
17488
  let c = null;
17489
17489
  for (const d of a)
17490
17490
  if (c = d.toWebSignature(r, this.signature), c)
@@ -17574,7 +17574,7 @@ class y3 {
17574
17574
  tbsCertificate: new ft({
17575
17575
  version: ir.v3,
17576
17576
  serialNumber: s,
17577
- validity: new Uo({
17577
+ validity: new Do({
17578
17578
  notBefore: a,
17579
17579
  notAfter: c
17580
17580
  }),
@@ -17594,7 +17594,7 @@ class y3 {
17594
17594
  hash: "SHA-256"
17595
17595
  }, p = "signingKey" in e ? { ...d, ...e.signingAlgorithm, ...e.signingKey.algorithm } : { ...d, ...e.signingAlgorithm }, f = Ve.resolve(dr);
17596
17596
  l.tbsCertificate.signature = l.signatureAlgorithm = f.toAsnAlgorithm(p);
17597
- const g = T.serialize(l.tbsCertificate), _ = "signingKey" in e ? await n.subtle.sign(p, e.signingKey, g) : e.signature, w = Ve.resolveAll(Zo).reverse();
17597
+ const g = T.serialize(l.tbsCertificate), _ = "signingKey" in e ? await n.subtle.sign(p, e.signingKey, g) : e.signature, w = Ve.resolveAll(Yo).reverse();
17598
17598
  let x = null;
17599
17599
  for (const A of w)
17600
17600
  if (x = A.toAsnSignature(p, _), x)
@@ -17611,16 +17611,16 @@ var Gh;
17611
17611
  gt.register(e_, np);
17612
17612
  gt.register(r_, rp);
17613
17613
  gt.register(o_, ip);
17614
- gt.register(l_, Xo);
17615
- gt.register(zl, bo);
17614
+ gt.register(l_, Zo);
17615
+ gt.register(zl, vo);
17616
17616
  gt.register(c_, L_);
17617
17617
  gt.register(Kl, D_);
17618
17618
  gt.register(Ml, M_);
17619
17619
  gt.register(i_, z_);
17620
17620
  yc.register(I_, q_);
17621
17621
  yc.register(tp, op);
17622
- Ve.registerSingleton(Zo, g3);
17623
- Ve.registerSingleton(Zo, _t);
17622
+ Ve.registerSingleton(Yo, g3);
17623
+ Ve.registerSingleton(Yo, _t);
17624
17624
  _t.namedCurveSize.set("P-256", 32);
17625
17625
  _t.namedCurveSize.set("K-256", 32);
17626
17626
  _t.namedCurveSize.set("P-384", 48);
@@ -17647,7 +17647,7 @@ async function Jd(t) {
17647
17647
  fa.keyCertSign | fa.cRLSign,
17648
17648
  !0
17649
17649
  ),
17650
- await Xo.create(n.publicKey)
17650
+ await Zo.create(n.publicKey)
17651
17651
  ]
17652
17652
  }), a = await crypto.subtle.exportKey("pkcs8", n.privateKey), c = s.toString("pem"), l = await b3(s), d = Nl(await s.getThumbprint()), p = w3("PRIVATE", a);
17653
17653
  return {
@@ -18100,7 +18100,7 @@ const A3 = ut.extend({
18100
18100
  body: {
18101
18101
  content: {
18102
18102
  "application/json": {
18103
- schema: o.object(fs.shape).partial()
18103
+ schema: o.object(hs.shape).partial()
18104
18104
  }
18105
18105
  }
18106
18106
  }
@@ -18236,7 +18236,7 @@ const A3 = ut.extend({
18236
18236
  body: {
18237
18237
  content: {
18238
18238
  "application/json": {
18239
- schema: o.object(fs.shape).partial()
18239
+ schema: o.object(hs.shape).partial()
18240
18240
  }
18241
18241
  }
18242
18242
  },
@@ -18268,7 +18268,7 @@ const A3 = ut.extend({
18268
18268
  body: {
18269
18269
  content: {
18270
18270
  "application/json": {
18271
- schema: o.object(fs.shape)
18271
+ schema: o.object(hs.shape)
18272
18272
  }
18273
18273
  }
18274
18274
  }
@@ -19333,7 +19333,7 @@ async function g4(t, e) {
19333
19333
  try {
19334
19334
  const { header: n } = f4(e), i = (await h4(t.env)).find((c) => c.kid === n.kid);
19335
19335
  if (!i)
19336
- throw new z(401, { message: "No matching kid found" });
19336
+ throw new D(401, { message: "No matching kid found" });
19337
19337
  const s = await crypto.subtle.importKey(
19338
19338
  "jwk",
19339
19339
  i,
@@ -19343,7 +19343,7 @@ async function g4(t, e) {
19343
19343
  );
19344
19344
  return await p4(e, s, "RS256");
19345
19345
  } catch (n) {
19346
- throw n instanceof v ? n : new z(403, { message: "Invalid JWT signature" });
19346
+ throw n instanceof v ? n : new D(403, { message: "Invalid JWT signature" });
19347
19347
  }
19348
19348
  }
19349
19349
  function m4(t) {
@@ -19368,7 +19368,7 @@ function ap(t) {
19368
19368
  return await n();
19369
19369
  const l = e.req.header("authorization") || "", [d, p] = l.split(" ");
19370
19370
  if (d?.toLowerCase() !== "bearer" || !p)
19371
- throw new z(401, {
19371
+ throw new D(401, {
19372
19372
  message: "Missing bearer token"
19373
19373
  });
19374
19374
  try {
@@ -19379,9 +19379,9 @@ function ap(t) {
19379
19379
  (c.some(
19380
19380
  (w) => g.includes(w)
19381
19381
  ) || c.some((w) => _.includes(w))))
19382
- throw new z(403, { message: "Unauthorized" });
19382
+ throw new D(403, { message: "Unauthorized" });
19383
19383
  } catch (f) {
19384
- throw f instanceof v ? f : new z(403, { message: "Invalid token" });
19384
+ throw f instanceof v ? f : new D(403, { message: "Invalid token" });
19385
19385
  }
19386
19386
  }
19387
19387
  return await n();
@@ -21152,7 +21152,7 @@ const A4 = ut.extend({
21152
21152
  description: "Field to sort by. Use field:order where order is 1 for ascending and -1 for descending. Defaults to created_at:-1."
21153
21153
  })
21154
21154
  }), B4 = o.object({
21155
- invitations: o.array(hs),
21155
+ invitations: o.array(gs),
21156
21156
  start: o.number(),
21157
21157
  limit: o.number(),
21158
21158
  length: o.number()
@@ -21802,7 +21802,7 @@ const A4 = ut.extend({
21802
21802
  content: {
21803
21803
  "application/json": {
21804
21804
  schema: o.union([
21805
- o.array(hs),
21805
+ o.array(gs),
21806
21806
  B4
21807
21807
  ])
21808
21808
  }
@@ -21881,7 +21881,7 @@ const A4 = ut.extend({
21881
21881
  200: {
21882
21882
  content: {
21883
21883
  "application/json": {
21884
- schema: hs
21884
+ schema: gs
21885
21885
  }
21886
21886
  },
21887
21887
  description: "An invitation"
@@ -21929,7 +21929,7 @@ const A4 = ut.extend({
21929
21929
  201: {
21930
21930
  content: {
21931
21931
  "application/json": {
21932
- schema: hs
21932
+ schema: gs
21933
21933
  }
21934
21934
  },
21935
21935
  description: "The created invitation"
@@ -22016,7 +22016,7 @@ function H4(t) {
22016
22016
  credentials: !0
22017
22017
  })
22018
22018
  ), sp(e), e.use(async (r, i) => {
22019
- const s = Po(r, t.dataAdapter), a = Ac({
22019
+ const s = To(r, t.dataAdapter), a = Ac({
22020
22020
  defaultTtlSeconds: 0,
22021
22021
  // No TTL for request-scoped cache
22022
22022
  maxEntries: 100,
@@ -22134,20 +22134,20 @@ var K4 = (t, ...e) => {
22134
22134
  return i instanceof Promise ? i.then((s) => jt(s, s.callbacks)) : jt(i);
22135
22135
  };
22136
22136
  return n.values = e, n.Provider = n, n[lp] = Q_(e), ei.push(n), n;
22137
- }, _i = (t) => t.values.at(-1), bs = {
22137
+ }, _i = (t) => t.values.at(-1), vs = {
22138
22138
  title: [],
22139
22139
  script: ["src"],
22140
22140
  style: ["data-href"],
22141
22141
  link: ["href"],
22142
22142
  meta: ["name", "httpEquiv", "charset", "itemProp"]
22143
- }, Yd = {}, vs = "data-precedence", Yo = (t) => Array.isArray(t) ? t : [t], eg = /* @__PURE__ */ new WeakMap(), tg = (t, e, n, r) => ({ buffer: i, context: s }) => {
22143
+ }, Yd = {}, $s = "data-precedence", Qo = (t) => Array.isArray(t) ? t : [t], eg = /* @__PURE__ */ new WeakMap(), tg = (t, e, n, r) => ({ buffer: i, context: s }) => {
22144
22144
  if (!i)
22145
22145
  return;
22146
22146
  const a = eg.get(s) || {};
22147
22147
  eg.set(s, a);
22148
22148
  const c = a[t] ||= [];
22149
22149
  let l = !1;
22150
- const d = bs[t];
22150
+ const d = vs[t];
22151
22151
  if (d.length > 0) {
22152
22152
  e:
22153
22153
  for (const [, p] of c)
@@ -22172,12 +22172,12 @@ var K4 = (t, ...e) => {
22172
22172
  i[0] = i[0].replaceAll(f, "");
22173
22173
  }), i[0] = i[0].replace(/(?=<\/head>)/, p.join(""));
22174
22174
  }
22175
- }, Qo = (t, e, n) => jt(new It(t, n, Yo(e ?? [])).toString()), es = (t, e, n, r) => {
22175
+ }, es = (t, e, n) => jt(new It(t, n, Qo(e ?? [])).toString()), ts = (t, e, n, r) => {
22176
22176
  if ("itemProp" in n)
22177
- return Qo(t, e, n);
22177
+ return es(t, e, n);
22178
22178
  let { precedence: i, blocking: s, ...a } = n;
22179
- i = r ? i ?? "" : void 0, r && (a[vs] = i);
22180
- const c = new It(t, a, Yo(e || [])).toString();
22179
+ i = r ? i ?? "" : void 0, r && (a[$s] = i);
22180
+ const c = new It(t, a, Qo(e || [])).toString();
22181
22181
  return c instanceof Promise ? c.then(
22182
22182
  (l) => jt(c, [
22183
22183
  ...l.callbacks || [],
@@ -22192,23 +22192,23 @@ var K4 = (t, ...e) => {
22192
22192
  return new It(
22193
22193
  "title",
22194
22194
  e,
22195
- Yo(t ?? [])
22195
+ Qo(t ?? [])
22196
22196
  );
22197
22197
  }
22198
- return es("title", t, e, !1);
22198
+ return ts("title", t, e, !1);
22199
22199
  }, J4 = ({
22200
22200
  children: t,
22201
22201
  ...e
22202
22202
  }) => {
22203
22203
  const n = dp();
22204
- return ["src", "async"].some((r) => !e[r]) || n && _i(n) === "head" ? Qo("script", t, e) : es("script", t, e, !1);
22204
+ return ["src", "async"].some((r) => !e[r]) || n && _i(n) === "head" ? es("script", t, e) : ts("script", t, e, !1);
22205
22205
  }, X4 = ({
22206
22206
  children: t,
22207
22207
  ...e
22208
- }) => ["href", "precedence"].every((n) => n in e) ? (e["data-href"] = e.href, delete e.href, es("style", t, e, !0)) : Qo("style", t, e), Z4 = ({ children: t, ...e }) => ["onLoad", "onError"].some((n) => n in e) || e.rel === "stylesheet" && (!("precedence" in e) || "disabled" in e) ? Qo("link", t, e) : es("link", t, e, "precedence" in e), Y4 = ({ children: t, ...e }) => {
22208
+ }) => ["href", "precedence"].every((n) => n in e) ? (e["data-href"] = e.href, delete e.href, ts("style", t, e, !0)) : es("style", t, e), Z4 = ({ children: t, ...e }) => ["onLoad", "onError"].some((n) => n in e) || e.rel === "stylesheet" && (!("precedence" in e) || "disabled" in e) ? es("link", t, e) : ts("link", t, e, "precedence" in e), Y4 = ({ children: t, ...e }) => {
22209
22209
  const n = dp();
22210
- return n && _i(n) === "head" ? Qo("meta", t, e) : es("meta", t, e, !1);
22211
- }, ny = (t, { children: e, ...n }) => new It(t, n, Yo(e ?? [])), Q4 = (t) => (typeof t.action == "function" && (t.action = ga in t.action ? t.action[ga] : void 0), ny("form", t)), ry = (t, e) => (typeof e.formAction == "function" && (e.formAction = ga in e.formAction ? e.formAction[ga] : void 0), ny(t, e)), e$ = (t) => ry("input", t), t$ = (t) => ry("button", t);
22210
+ return n && _i(n) === "head" ? es("meta", t, e) : ts("meta", t, e, !1);
22211
+ }, ny = (t, { children: e, ...n }) => new It(t, n, Qo(e ?? [])), Q4 = (t) => (typeof t.action == "function" && (t.action = ga in t.action ? t.action[ga] : void 0), ny("form", t)), ry = (t, e) => (typeof e.formAction == "function" && (e.formAction = ga in e.formAction ? e.formAction[ga] : void 0), ny(t, e)), e$ = (t) => ry("input", t), t$ = (t) => ry("button", t);
22212
22212
  const tl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
22213
22213
  __proto__: null,
22214
22214
  button: t$,
@@ -22239,7 +22239,7 @@ var n$ = /* @__PURE__ */ new Map([
22239
22239
  ) ? `${r}` : `${r}px` : r
22240
22240
  );
22241
22241
  }
22242
- }, vo = void 0, dp = () => vo, r$ = (t) => /[A-Z]/.test(t) && t.match(
22242
+ }, $o = void 0, dp = () => $o, r$ = (t) => /[A-Z]/.test(t) && t.match(
22243
22243
  /^(?:al|basel|clip(?:Path|Rule)$|co|do|fill|fl|fo|gl|let|lig|i|marker[EMS]|o|pai|pointe|sh|st[or]|text[^L]|tr|u|ve|w)/
22244
22244
  ) ? t.replace(/([A-Z])/g, "-$1").toLowerCase() : t, i$ = [
22245
22245
  "area",
@@ -22329,7 +22329,7 @@ var n$ = /* @__PURE__ */ new Map([
22329
22329
  const e = this.tag, n = this.props;
22330
22330
  let { children: r } = this;
22331
22331
  t[0] += `<${e}`;
22332
- const i = vo && _i(vo) === "svg" ? (s) => r$(ma(s)) : (s) => ma(s);
22332
+ const i = $o && _i($o) === "svg" ? (s) => r$(ma(s)) : (s) => ma(s);
22333
22333
  for (let [s, a] of Object.entries(n))
22334
22334
  if (s = i(s), s !== "children") {
22335
22335
  if (s === "style" && typeof a == "object") {
@@ -22388,9 +22388,9 @@ var n$ = /* @__PURE__ */ new Map([
22388
22388
  e ??= {}, n.length && (e.children = n.length === 1 ? n[0] : n);
22389
22389
  const r = e.key;
22390
22390
  delete e.key;
22391
- const i = $s(t, e, n);
22391
+ const i = ks(t, e, n);
22392
22392
  return i.key = r, i;
22393
- }, ng = !1, $s = (t, e, n) => {
22393
+ }, ng = !1, ks = (t, e, n) => {
22394
22394
  if (!ng) {
22395
22395
  for (const r in Yd)
22396
22396
  tl[r][lp] = Yd[r];
@@ -22400,9 +22400,9 @@ var n$ = /* @__PURE__ */ new Map([
22400
22400
  tl[t],
22401
22401
  e,
22402
22402
  n
22403
- ) : t === "svg" || t === "head" ? (vo ||= ty(""), new It(t, e, [
22403
+ ) : t === "svg" || t === "head" ? ($o ||= ty(""), new It(t, e, [
22404
22404
  new nl(
22405
- vo,
22405
+ $o,
22406
22406
  {
22407
22407
  value: t
22408
22408
  },
@@ -22434,10 +22434,10 @@ var n$ = /* @__PURE__ */ new Map([
22434
22434
  function u(t, e, n) {
22435
22435
  let r;
22436
22436
  if (!e || !("children" in e))
22437
- r = $s(t, e, []);
22437
+ r = ks(t, e, []);
22438
22438
  else {
22439
22439
  const i = e.children;
22440
- r = Array.isArray(i) ? $s(t, e, i) : $s(t, e, [i]);
22440
+ r = Array.isArray(i) ? ks(t, e, i) : ks(t, e, [i]);
22441
22441
  }
22442
22442
  return r.key = n, r;
22443
22443
  }
@@ -22450,10 +22450,10 @@ var ig;
22450
22450
  t[t.Required = 0] = "Required", t[t.Ignore = 1] = "Ignore";
22451
22451
  })(ig || (ig = {}));
22452
22452
  function c$(t) {
22453
- return ay(t, l$, $o.Include);
22453
+ return ay(t, l$, ko.Include);
22454
22454
  }
22455
22455
  function sy(t) {
22456
- return ay(t, d$, $o.None);
22456
+ return ay(t, d$, ko.None);
22457
22457
  }
22458
22458
  function ay(t, e, n) {
22459
22459
  let r = "";
@@ -22462,15 +22462,15 @@ function ay(t, e, n) {
22462
22462
  for (let c = 0; c < 3 && i + c < t.byteLength; c++)
22463
22463
  s = s << 8 | t[i + c], a += 8;
22464
22464
  for (let c = 0; c < 4; c++)
22465
- a >= 6 ? (r += e[s >> a - 6 & 63], a -= 6) : a > 0 ? (r += e[s << 6 - a & 63], a = 0) : n === $o.Include && (r += "=");
22465
+ a >= 6 ? (r += e[s >> a - 6 & 63], a -= 6) : a > 0 ? (r += e[s << 6 - a & 63], a = 0) : n === ko.Include && (r += "=");
22466
22466
  }
22467
22467
  return r;
22468
22468
  }
22469
22469
  const l$ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", d$ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
22470
- var $o;
22470
+ var ko;
22471
22471
  (function(t) {
22472
22472
  t[t.Include = 0] = "Include", t[t.None = 1] = "None";
22473
- })($o || ($o = {}));
22473
+ })(ko || (ko = {}));
22474
22474
  var og;
22475
22475
  (function(t) {
22476
22476
  t[t.Required = 0] = "Required", t[t.Ignore = 1] = "Ignore";
@@ -22966,10 +22966,10 @@ class hp {
22966
22966
  }
22967
22967
  createAuthorizationURLWithPKCE(e, n, r, i, s) {
22968
22968
  const a = new URL(e);
22969
- if (a.searchParams.set("response_type", "code"), a.searchParams.set("client_id", this.clientId), this.redirectURI !== null && a.searchParams.set("redirect_uri", this.redirectURI), a.searchParams.set("state", n), r === ko.S256) {
22969
+ if (a.searchParams.set("response_type", "code"), a.searchParams.set("client_id", this.clientId), this.redirectURI !== null && a.searchParams.set("redirect_uri", this.redirectURI), a.searchParams.set("state", n), r === xo.S256) {
22970
22970
  const c = ly(i);
22971
22971
  a.searchParams.set("code_challenge_method", "S256"), a.searchParams.set("code_challenge", c);
22972
- } else r === ko.Plain && (a.searchParams.set("code_challenge_method", "plain"), a.searchParams.set("code_challenge", i));
22972
+ } else r === xo.Plain && (a.searchParams.set("code_challenge_method", "plain"), a.searchParams.set("code_challenge", i));
22973
22973
  return s.length > 0 && a.searchParams.set("scope", s.join(" ")), a;
22974
22974
  }
22975
22975
  async validateAuthorizationCode(e, n, r) {
@@ -23003,10 +23003,10 @@ class hp {
23003
23003
  await m$(i);
23004
23004
  }
23005
23005
  }
23006
- var ko;
23006
+ var xo;
23007
23007
  (function(t) {
23008
23008
  t[t.S256 = 0] = "S256", t[t.Plain = 1] = "Plain";
23009
- })(ko || (ko = {}));
23009
+ })(xo || (xo = {}));
23010
23010
  var lg;
23011
23011
  (function(t) {
23012
23012
  t[t.Include = 0] = "Include", t[t.None = 1] = "None";
@@ -23168,7 +23168,7 @@ let hy = class {
23168
23168
  this.client = new hp(e, n, r);
23169
23169
  }
23170
23170
  createAuthorizationURL(e, n, r) {
23171
- return this.client.createAuthorizationURLWithPKCE(E$, e, ko.S256, n, r);
23171
+ return this.client.createAuthorizationURLWithPKCE(E$, e, xo.S256, n, r);
23172
23172
  }
23173
23173
  async validateAuthorizationCode(e, n) {
23174
23174
  return await this.client.validateAuthorizationCode(hg, e, n);
@@ -23218,7 +23218,7 @@ class gy {
23218
23218
  return await ti(i);
23219
23219
  }
23220
23220
  }
23221
- const ts = o.object({
23221
+ const ns = o.object({
23222
23222
  iss: o.string().url(),
23223
23223
  sub: o.string(),
23224
23224
  aud: o.string(),
@@ -23244,7 +23244,7 @@ const ts = o.object({
23244
23244
  c_hash: o.string().optional()
23245
23245
  // Code hash
23246
23246
  }).passthrough();
23247
- ts.omit({
23247
+ ns.omit({
23248
23248
  iat: !0,
23249
23249
  auth_time: !0,
23250
23250
  nonce: !0,
@@ -23308,7 +23308,7 @@ async function O$(t, e, n) {
23308
23308
  ).validateAuthorizationCode(n), c = xa(a.idToken());
23309
23309
  if (!c)
23310
23310
  throw new Error("Invalid ID token");
23311
- const l = ts.parse(c.payload);
23311
+ const l = ns.parse(c.payload);
23312
23312
  return {
23313
23313
  sub: l.sub,
23314
23314
  email: l.email,
@@ -23469,7 +23469,7 @@ async function M$(t, e, n, r) {
23469
23469
  ).validateAuthorizationCode(n, r), c = xa(a.idToken());
23470
23470
  if (!c)
23471
23471
  throw new Error("Invalid ID token");
23472
- const l = ts.parse(c.payload);
23472
+ const l = ns.parse(c.payload);
23473
23473
  return {
23474
23474
  sub: l.sub,
23475
23475
  email: l.email,
@@ -23557,7 +23557,7 @@ async function H$(t, e, n) {
23557
23557
  ), a = xa(s.idToken());
23558
23558
  if (!a)
23559
23559
  throw new Error("Invalid ID token");
23560
- const c = ts.parse(a.payload);
23560
+ const c = ns.parse(a.payload);
23561
23561
  if (typeof c.msn != "string")
23562
23562
  throw new Error("msn not available in id token");
23563
23563
  const l = await fetch(
@@ -23570,7 +23570,7 @@ async function H$(t, e, n) {
23570
23570
  }
23571
23571
  );
23572
23572
  if (!l.ok)
23573
- throw new z(400, {
23573
+ throw new D(400, {
23574
23574
  message: "Failed to get user from vipps"
23575
23575
  });
23576
23576
  return await l.json();
@@ -23707,7 +23707,7 @@ async function Y$(t, e, n, r) {
23707
23707
  ).validateAuthorizationCode(n, r), l = xa(c.idToken());
23708
23708
  if (!l)
23709
23709
  throw new Error("Invalid ID token");
23710
- const d = ts.parse(l.payload);
23710
+ const d = ns.parse(l.payload);
23711
23711
  return t.set("log", `Microsoft user: ${JSON.stringify(d)}`), {
23712
23712
  sub: d.sub,
23713
23713
  email: d.email,
@@ -23751,7 +23751,7 @@ function xy(t) {
23751
23751
  async function yi(t, e) {
23752
23752
  const n = await t.data.legacyClients.get(e);
23753
23753
  if (!n)
23754
- throw new z(403, { message: "Client not found" });
23754
+ throw new D(403, { message: "Client not found" });
23755
23755
  let r = n;
23756
23756
  if (t.DEFAULT_CLIENT_ID || t.DEFAULT_TENANT_ID) {
23757
23757
  const i = t.DEFAULT_CLIENT_ID ? await t.data.legacyClients.get(t.DEFAULT_CLIENT_ID) : void 0, s = await t.data.connections.list(n.tenant.id), a = t.DEFAULT_TENANT_ID ? await t.data.connections.list(t.DEFAULT_TENANT_ID) : { connections: [] }, c = s.connections.map((l) => {
@@ -23808,7 +23808,7 @@ async function yi(t, e) {
23808
23808
  }
23809
23809
  async function gg(t, e, n, r) {
23810
23810
  if (!r.state)
23811
- throw new z(400, { message: "State not found" });
23811
+ throw new D(400, { message: "State not found" });
23812
23812
  const i = e.connections.find((l) => l.name === n);
23813
23813
  if (!i) {
23814
23814
  t.set("client_id", e.client_id);
@@ -23816,7 +23816,7 @@ async function gg(t, e, n, r) {
23816
23816
  type: ie.FAILED_LOGIN,
23817
23817
  description: "Connection not found"
23818
23818
  });
23819
- throw se(t, t.env.data.logs.create(e.tenant.id, l)), new z(403, { message: "Connection Not Found" });
23819
+ throw se(t, t.env.data.logs.create(e.tenant.id, l)), new D(403, { message: "Connection Not Found" });
23820
23820
  }
23821
23821
  let s = await t.env.data.loginSessions.get(
23822
23822
  e.tenant.id,
@@ -23859,13 +23859,13 @@ async function mg(t, { code: e, state: n }) {
23859
23859
  "oauth2_state"
23860
23860
  );
23861
23861
  if (!i || !i.connection_id)
23862
- throw new z(403, { message: "State not found" });
23862
+ throw new D(403, { message: "State not found" });
23863
23863
  const s = await r.data.loginSessions.get(
23864
23864
  t.var.tenant_id || "",
23865
23865
  i.login_id
23866
23866
  );
23867
23867
  if (!s)
23868
- throw new z(403, { message: "Session not found" });
23868
+ throw new D(403, { message: "Session not found" });
23869
23869
  if (s.authorization_url) {
23870
23870
  const w = new URL(s.authorization_url).hostname, x = t.var.host || "";
23871
23871
  if (w !== x && w) {
@@ -23892,14 +23892,14 @@ async function mg(t, { code: e, state: n }) {
23892
23892
  type: ie.FAILED_LOGIN,
23893
23893
  description: "Connection not found"
23894
23894
  });
23895
- throw se(t, r.data.logs.create(a.tenant.id, w)), new z(403, { message: "Connection not found" });
23895
+ throw se(t, r.data.logs.create(a.tenant.id, w)), new D(403, { message: "Connection not found" });
23896
23896
  }
23897
23897
  if (t.set("connection", c.name), !s.authParams.redirect_uri) {
23898
23898
  const w = oe(t, {
23899
23899
  type: ie.FAILED_LOGIN,
23900
23900
  description: "Redirect URI not defined"
23901
23901
  });
23902
- throw se(t, r.data.logs.create(a.tenant.id, w)), new z(403, { message: "Redirect URI not defined" });
23902
+ throw se(t, r.data.logs.create(a.tenant.id, w)), new D(403, { message: "Redirect URI not defined" });
23903
23903
  }
23904
23904
  const d = await ky(t, c.strategy).validateAuthorizationCodeAndGetUser(
23905
23905
  t,
@@ -24294,7 +24294,7 @@ const tk = new W().openapi(
24294
24294
  headers: {
24295
24295
  "access-control-allow-origin": "*",
24296
24296
  "access-control-allow-method": "GET",
24297
- "cache-control": `public, max-age=${as}, stale-while-revalidate=${as * 2}, stale-if-error=86400`
24297
+ "cache-control": `public, max-age=${cs}, stale-while-revalidate=${cs * 2}, stale-if-error=86400`
24298
24298
  }
24299
24299
  }
24300
24300
  );
@@ -24393,12 +24393,12 @@ const tk = new W().openapi(
24393
24393
  headers: {
24394
24394
  "access-control-allow-origin": "*",
24395
24395
  "access-control-allow-method": "GET",
24396
- "cache-control": `public, max-age=${as}, stale-while-revalidate=${as * 2}, stale-if-error=86400`
24396
+ "cache-control": `public, max-age=${cs}, stale-while-revalidate=${cs * 2}, stale-if-error=86400`
24397
24397
  }
24398
24398
  });
24399
24399
  }
24400
24400
  );
24401
- function ks(t, e) {
24401
+ function io(t, e) {
24402
24402
  if (!t || !e || t.length !== e.length) return !1;
24403
24403
  let n = 0;
24404
24404
  for (let r = 0; r < t.length; r++)
@@ -24415,9 +24415,9 @@ const Sy = o.object({
24415
24415
  async function ik(t, e) {
24416
24416
  const n = await t.env.data.legacyClients.get(e.client_id);
24417
24417
  if (!n)
24418
- throw new z(403, { message: "Invalid client credentials" });
24419
- if (n.client_secret && !ks(n.client_secret, e.client_secret))
24420
- throw new z(403, { message: "Invalid client credentials" });
24418
+ throw new D(403, { message: "Invalid client credentials" });
24419
+ if (n.client_secret && !io(n.client_secret, e.client_secret))
24420
+ throw new D(403, { message: "Invalid client credentials" });
24421
24421
  const r = {
24422
24422
  client_id: n.client_id,
24423
24423
  scope: e.scope,
@@ -24445,7 +24445,7 @@ const ok = o.object({
24445
24445
  async function sk(t, e) {
24446
24446
  const n = await t.env.data.legacyClients.get(e.client_id);
24447
24447
  if (!n)
24448
- throw new z(403, { message: "Client not found" });
24448
+ throw new D(403, { message: "Client not found" });
24449
24449
  const r = await t.env.data.codes.get(
24450
24450
  n.tenant.id,
24451
24451
  e.code,
@@ -24456,21 +24456,21 @@ async function sk(t, e) {
24456
24456
  type: ie.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,
24457
24457
  description: "Invalid client credentials"
24458
24458
  });
24459
- throw se(t, t.env.data.logs.create(n.tenant.id, l)), new z(403, { message: "Invalid client credentials" });
24459
+ throw se(t, t.env.data.logs.create(n.tenant.id, l)), new D(403, { message: "Invalid client credentials" });
24460
24460
  } else if (new Date(r.expires_at) < /* @__PURE__ */ new Date()) {
24461
24461
  const l = oe(t, {
24462
24462
  type: ie.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,
24463
24463
  description: "Code expired",
24464
24464
  userId: r.user_id
24465
24465
  });
24466
- throw se(t, t.env.data.logs.create(n.tenant.id, l)), new z(403, { message: "Code expired" });
24466
+ throw se(t, t.env.data.logs.create(n.tenant.id, l)), new D(403, { message: "Code expired" });
24467
24467
  } else if (r.used_at) {
24468
24468
  const l = oe(t, {
24469
24469
  type: ie.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,
24470
24470
  description: "Invalid authorization code",
24471
24471
  userId: r.user_id
24472
24472
  });
24473
- throw se(t, t.env.data.logs.create(n.tenant.id, l)), new z(403, {
24473
+ throw se(t, t.env.data.logs.create(n.tenant.id, l)), new D(403, {
24474
24474
  error: "invalid_grant",
24475
24475
  error_description: "Invalid authorization code"
24476
24476
  });
@@ -24480,21 +24480,21 @@ async function sk(t, e) {
24480
24480
  r.login_id
24481
24481
  );
24482
24482
  if (!i)
24483
- throw new z(403, { message: "Invalid login" });
24483
+ throw new D(403, { message: "Invalid login" });
24484
24484
  if (e.organization && i.authParams.organization && e.organization !== i.authParams.organization)
24485
- throw new z(400, {
24485
+ throw new D(400, {
24486
24486
  error: "invalid_request",
24487
24487
  error_description: "Organization parameter does not match login session organization"
24488
24488
  });
24489
24489
  if ("client_secret" in e) {
24490
24490
  const l = await t.env.data.legacyClients.get("DEFAULT_CLIENT");
24491
- if (!ks(n.client_secret, e.client_secret) && !ks(l?.client_secret, e.client_secret)) {
24491
+ if (!io(n.client_secret, e.client_secret) && !io(l?.client_secret, e.client_secret)) {
24492
24492
  const d = oe(t, {
24493
24493
  type: ie.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,
24494
24494
  description: "Invalid client credentials",
24495
24495
  userId: r.user_id
24496
24496
  });
24497
- throw se(t, t.env.data.logs.create(n.tenant.id, d)), new z(403, {
24497
+ throw se(t, t.env.data.logs.create(n.tenant.id, d)), new D(403, {
24498
24498
  message: "Invalid client credentials"
24499
24499
  });
24500
24500
  }
@@ -24503,13 +24503,13 @@ async function sk(t, e) {
24503
24503
  e.code_verifier,
24504
24504
  r.code_challenge_method
24505
24505
  );
24506
- if (!ks(l, r.code_challenge)) {
24506
+ if (!io(l, r.code_challenge)) {
24507
24507
  const d = oe(t, {
24508
24508
  type: ie.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,
24509
24509
  description: "Invalid client credentials",
24510
24510
  userId: r.user_id
24511
24511
  });
24512
- throw se(t, t.env.data.logs.create(n.tenant.id, d)), new z(403, {
24512
+ throw se(t, t.env.data.logs.create(n.tenant.id, d)), new D(403, {
24513
24513
  message: "Invalid client credentials"
24514
24514
  });
24515
24515
  }
@@ -24520,11 +24520,11 @@ async function sk(t, e) {
24520
24520
  description: "Invalid redirect uri",
24521
24521
  userId: r.user_id
24522
24522
  });
24523
- throw se(t, t.env.data.logs.create(n.tenant.id, l)), new z(403, { message: "Invalid redirect uri" });
24523
+ throw se(t, t.env.data.logs.create(n.tenant.id, l)), new D(403, { message: "Invalid redirect uri" });
24524
24524
  }
24525
24525
  const s = await t.env.data.users.get(n.tenant.id, r.user_id);
24526
24526
  if (!s)
24527
- throw new z(403, { message: "User not found" });
24527
+ throw new D(403, { message: "User not found" });
24528
24528
  await t.env.data.codes.used(n.tenant.id, e.code);
24529
24529
  let a;
24530
24530
  i.session_id && i.authParams.scope?.split(" ").includes("offline_access") && (a = await X0(t, {
@@ -24578,23 +24578,29 @@ const ak = o.object({
24578
24578
  grant_type: o.literal("refresh_token"),
24579
24579
  client_id: o.string(),
24580
24580
  redirect_uri: o.string().optional(),
24581
- refresh_token: o.string()
24581
+ refresh_token: o.string(),
24582
+ client_secret: o.string().optional()
24582
24583
  });
24583
24584
  async function ck(t, e) {
24584
24585
  const n = await t.env.data.legacyClients.get(e.client_id);
24585
24586
  if (!n)
24586
- throw new z(403, { message: "Client not found" });
24587
+ throw new D(403, { message: "Client not found" });
24588
+ if (e.client_secret && n.client_secret && !io(n.client_secret, e.client_secret))
24589
+ throw new D(403, {
24590
+ error: "invalid_client",
24591
+ error_description: "Client authentication failed"
24592
+ });
24587
24593
  const r = await t.env.data.refreshTokens.get(
24588
24594
  n.tenant.id,
24589
24595
  e.refresh_token
24590
24596
  );
24591
24597
  if (r) {
24592
24598
  if (r.expires_at && new Date(r.expires_at) < /* @__PURE__ */ new Date() || r.idle_expires_at && new Date(r.idle_expires_at) < /* @__PURE__ */ new Date())
24593
- throw new z(403, {
24599
+ throw new D(403, {
24594
24600
  error: "invalid_grant",
24595
24601
  error_description: "Refresh token has expired"
24596
24602
  });
24597
- } else throw new z(403, {
24603
+ } else throw new D(403, {
24598
24604
  error: "invalid_grant",
24599
24605
  error_description: "Invalid refresh token"
24600
24606
  });
@@ -24603,7 +24609,7 @@ async function ck(t, e) {
24603
24609
  r.user_id
24604
24610
  );
24605
24611
  if (!i)
24606
- throw new z(403, { message: "User not found" });
24612
+ throw new D(403, { message: "User not found" });
24607
24613
  const s = r.resource_servers[0];
24608
24614
  if (r.idle_expires_at) {
24609
24615
  const a = new Date(
@@ -25550,13 +25556,13 @@ function p5(t, e) {
25550
25556
  n++;
25551
25557
  }
25552
25558
  }
25553
- function xo(t) {
25559
+ function So(t) {
25554
25560
  "@babel/helpers - typeof";
25555
- return xo = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
25561
+ return So = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
25556
25562
  return typeof e;
25557
25563
  } : function(e) {
25558
25564
  return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
25559
- }, xo(t);
25565
+ }, So(t);
25560
25566
  }
25561
25567
  function Ag(t, e) {
25562
25568
  var n = Object.keys(t);
@@ -25596,14 +25602,14 @@ function m5(t, e, n) {
25596
25602
  }
25597
25603
  function Oy(t) {
25598
25604
  var e = _5(t, "string");
25599
- return xo(e) == "symbol" ? e : e + "";
25605
+ return So(e) == "symbol" ? e : e + "";
25600
25606
  }
25601
25607
  function _5(t, e) {
25602
- if (xo(t) != "object" || !t) return t;
25608
+ if (So(t) != "object" || !t) return t;
25603
25609
  var n = t[Symbol.toPrimitive];
25604
25610
  if (n !== void 0) {
25605
25611
  var r = n.call(t, e);
25606
- if (xo(r) != "object") return r;
25612
+ if (So(r) != "object") return r;
25607
25613
  throw new TypeError("@@toPrimitive must return a primitive value.");
25608
25614
  }
25609
25615
  return String(t);
@@ -25742,7 +25748,7 @@ function k5(t, e) {
25742
25748
  if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
25743
25749
  }
25744
25750
  function x5(t, e, n) {
25745
- return e = Ao(e), S5(t, vp() ? Reflect.construct(e, n || [], Ao(t).constructor) : e.apply(t, n));
25751
+ return e = Eo(e), S5(t, vp() ? Reflect.construct(e, n || [], Eo(t).constructor) : e.apply(t, n));
25746
25752
  }
25747
25753
  function S5(t, e) {
25748
25754
  if (e && (eu(e) == "object" || typeof e == "function")) return e;
@@ -25755,7 +25761,7 @@ function A5(t) {
25755
25761
  }
25756
25762
  function E5(t, e) {
25757
25763
  if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function");
25758
- t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && So(t, e);
25764
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && Ao(t, e);
25759
25765
  }
25760
25766
  function tu(t) {
25761
25767
  var e = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
@@ -25767,9 +25773,9 @@ function tu(t) {
25767
25773
  e.set(r, i);
25768
25774
  }
25769
25775
  function i() {
25770
- return C5(r, arguments, Ao(this).constructor);
25776
+ return C5(r, arguments, Eo(this).constructor);
25771
25777
  }
25772
- return i.prototype = Object.create(r.prototype, { constructor: { value: i, enumerable: !1, writable: !0, configurable: !0 } }), So(i, r);
25778
+ return i.prototype = Object.create(r.prototype, { constructor: { value: i, enumerable: !1, writable: !0, configurable: !0 } }), Ao(i, r);
25773
25779
  }, tu(t);
25774
25780
  }
25775
25781
  function C5(t, e, n) {
@@ -25777,7 +25783,7 @@ function C5(t, e, n) {
25777
25783
  var r = [null];
25778
25784
  r.push.apply(r, e);
25779
25785
  var i = new (t.bind.apply(t, r))();
25780
- return n && So(i, n.prototype), i;
25786
+ return n && Ao(i, n.prototype), i;
25781
25787
  }
25782
25788
  function vp() {
25783
25789
  try {
@@ -25796,15 +25802,15 @@ function N5(t) {
25796
25802
  return typeof t == "function";
25797
25803
  }
25798
25804
  }
25799
- function So(t, e) {
25800
- return So = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
25805
+ function Ao(t, e) {
25806
+ return Ao = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
25801
25807
  return n.__proto__ = r, n;
25802
- }, So(t, e);
25808
+ }, Ao(t, e);
25803
25809
  }
25804
- function Ao(t) {
25805
- return Ao = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
25810
+ function Eo(t) {
25811
+ return Eo = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
25806
25812
  return e.__proto__ || Object.getPrototypeOf(e);
25807
- }, Ao(t);
25813
+ }, Eo(t);
25808
25814
  }
25809
25815
  var nn = /* @__PURE__ */ (function(t) {
25810
25816
  function e(n) {
@@ -26071,13 +26077,13 @@ function t6(t, e, n, r) {
26071
26077
  carrierCode: f
26072
26078
  };
26073
26079
  }
26074
- function Eo(t) {
26080
+ function Co(t) {
26075
26081
  "@babel/helpers - typeof";
26076
- return Eo = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
26082
+ return Co = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
26077
26083
  return typeof e;
26078
26084
  } : function(e) {
26079
26085
  return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
26080
- }, Eo(t);
26086
+ }, Co(t);
26081
26087
  }
26082
26088
  function Pg(t, e) {
26083
26089
  var n = Object.keys(t);
@@ -26105,14 +26111,14 @@ function n6(t, e, n) {
26105
26111
  }
26106
26112
  function r6(t) {
26107
26113
  var e = i6(t, "string");
26108
- return Eo(e) == "symbol" ? e : e + "";
26114
+ return Co(e) == "symbol" ? e : e + "";
26109
26115
  }
26110
26116
  function i6(t, e) {
26111
- if (Eo(t) != "object" || !t) return t;
26117
+ if (Co(t) != "object" || !t) return t;
26112
26118
  var n = t[Symbol.toPrimitive];
26113
26119
  if (n !== void 0) {
26114
26120
  var r = n.call(t, e);
26115
- if (Eo(r) != "object") return r;
26121
+ if (Co(r) != "object") return r;
26116
26122
  throw new TypeError("@@toPrimitive must return a primitive value.");
26117
26123
  }
26118
26124
  return (e === "string" ? String : Number)(t);
@@ -26122,13 +26128,13 @@ function o6(t, e, n) {
26122
26128
  v2: !0
26123
26129
  }), n);
26124
26130
  }
26125
- function Co(t) {
26131
+ function No(t) {
26126
26132
  "@babel/helpers - typeof";
26127
- return Co = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
26133
+ return No = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
26128
26134
  return typeof e;
26129
26135
  } : function(e) {
26130
26136
  return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
26131
- }, Co(t);
26137
+ }, No(t);
26132
26138
  }
26133
26139
  function Rg(t, e) {
26134
26140
  var n = Object.keys(t);
@@ -26156,14 +26162,14 @@ function a6(t, e, n) {
26156
26162
  }
26157
26163
  function c6(t) {
26158
26164
  var e = l6(t, "string");
26159
- return Co(e) == "symbol" ? e : e + "";
26165
+ return No(e) == "symbol" ? e : e + "";
26160
26166
  }
26161
26167
  function l6(t, e) {
26162
- if (Co(t) != "object" || !t) return t;
26168
+ if (No(t) != "object" || !t) return t;
26163
26169
  var n = t[Symbol.toPrimitive];
26164
26170
  if (n !== void 0) {
26165
26171
  var r = n.call(t, e);
26166
- if (Co(r) != "object") return r;
26172
+ if (No(r) != "object") return r;
26167
26173
  throw new TypeError("@@toPrimitive must return a primitive value.");
26168
26174
  }
26169
26175
  return (e === "string" ? String : Number)(t);
@@ -26226,13 +26232,13 @@ function g6(t) {
26226
26232
  metadata: d
26227
26233
  };
26228
26234
  }
26229
- function No(t) {
26235
+ function jo(t) {
26230
26236
  "@babel/helpers - typeof";
26231
- return No = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
26237
+ return jo = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
26232
26238
  return typeof e;
26233
26239
  } : function(e) {
26234
26240
  return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
26235
- }, No(t);
26241
+ }, jo(t);
26236
26242
  }
26237
26243
  function Lg(t, e) {
26238
26244
  var n = Object.keys(t);
@@ -26260,14 +26266,14 @@ function m6(t, e, n) {
26260
26266
  }
26261
26267
  function _6(t) {
26262
26268
  var e = y6(t, "string");
26263
- return No(e) == "symbol" ? e : e + "";
26269
+ return jo(e) == "symbol" ? e : e + "";
26264
26270
  }
26265
26271
  function y6(t, e) {
26266
- if (No(t) != "object" || !t) return t;
26272
+ if (jo(t) != "object" || !t) return t;
26267
26273
  var n = t[Symbol.toPrimitive];
26268
26274
  if (n !== void 0) {
26269
26275
  var r = n.call(t, e);
26270
- if (No(r) != "object") return r;
26276
+ if (jo(r) != "object") return r;
26271
26277
  throw new TypeError("@@toPrimitive must return a primitive value.");
26272
26278
  }
26273
26279
  return (e === "string" ? String : Number)(t);
@@ -26401,23 +26407,23 @@ async function Ty(t, {
26401
26407
  c
26402
26408
  );
26403
26409
  if (!d)
26404
- throw new z(400, {
26410
+ throw new D(400, {
26405
26411
  message: "Invalid username format"
26406
26412
  });
26407
26413
  const p = await t.env.data.legacyClients.get(e);
26408
26414
  if (!p)
26409
- throw new z(403, { message: "Client not found" });
26415
+ throw new D(403, { message: "Client not found" });
26410
26416
  const { env: f } = t, g = await f.data.codes.get(p.tenant.id, r, "otp");
26411
26417
  if (!g)
26412
- throw new z(400, {
26418
+ throw new D(400, {
26413
26419
  message: Y("code_invalid")
26414
26420
  });
26415
26421
  if (g.expires_at < (/* @__PURE__ */ new Date()).toISOString())
26416
- throw new z(400, {
26422
+ throw new D(400, {
26417
26423
  message: Y("code_expired")
26418
26424
  });
26419
26425
  if (g.used_at)
26420
- throw new z(400, {
26426
+ throw new D(400, {
26421
26427
  message: Y("code_used")
26422
26428
  });
26423
26429
  const _ = await f.data.loginSessions.get(
@@ -26425,7 +26431,7 @@ async function Ty(t, {
26425
26431
  g.login_id
26426
26432
  );
26427
26433
  if (!_ || _.authParams.username !== n)
26428
- throw new z(400, {
26434
+ throw new D(400, {
26429
26435
  message: "Code not found or expired"
26430
26436
  });
26431
26437
  if (s && _.ip && a && !S6(_.ip, a))
@@ -26488,9 +26494,10 @@ const zg = o.object({
26488
26494
  // Refresh token
26489
26495
  o.object({
26490
26496
  grant_type: o.literal("refresh_token"),
26491
- client_id: o.string(),
26497
+ client_id: o.string().optional(),
26492
26498
  refresh_token: o.string(),
26493
- redirect_uri: o.string().optional()
26499
+ redirect_uri: o.string().optional(),
26500
+ client_secret: o.string().optional()
26494
26501
  }),
26495
26502
  // OTP
26496
26503
  o.object({
@@ -26640,7 +26647,7 @@ const C6 = new W().openapi(
26640
26647
  });
26641
26648
  else {
26642
26649
  if (!s.user?.user_id)
26643
- throw new z(400, {
26650
+ throw new D(400, {
26644
26651
  error: "invalid_request",
26645
26652
  error_description: "User ID is required for user-based grants"
26646
26653
  });
@@ -26732,7 +26739,7 @@ function xp(t) {
26732
26739
  /[0-9]/.test(t) && // At least one number
26733
26740
  /[^A-Za-z0-9]/.test(t);
26734
26741
  }
26735
- async function ns(t, e) {
26742
+ async function rs(t, e) {
26736
26743
  const n = await t.env.data.emailProviders.get(t.var.tenant_id) || // Fallback to default tenant
26737
26744
  (t.env.DEFAULT_TENANT_ID ? await t.env.data.emailProviders.get(t.env.DEFAULT_TENANT_ID) : null);
26738
26745
  if (!n)
@@ -26776,7 +26783,7 @@ async function By(t, e, n, r, i) {
26776
26783
  vendorName: s.friendly_name,
26777
26784
  lng: "en"
26778
26785
  };
26779
- await ns(t, {
26786
+ await rs(t, {
26780
26787
  to: e,
26781
26788
  subject: Y("reset_password_title", p),
26782
26789
  html: `Click here to reset your password: ${qe(t.env)}reset-password?state=${r}&code=${n}`,
@@ -26812,7 +26819,7 @@ async function Sp(t, { to: e, code: n, language: r }) {
26812
26819
  code: n,
26813
26820
  lng: r || "en"
26814
26821
  };
26815
- s === "email" ? await ns(t, {
26822
+ s === "email" ? await rs(t, {
26816
26823
  to: e,
26817
26824
  subject: Y("code_email_subject", p),
26818
26825
  html: `Click here to validate your email: ${qe(t.env)}validate-email`,
@@ -26861,7 +26868,7 @@ async function Ap(t, { to: e, code: n, authParams: r, language: i }) {
26861
26868
  lng: i || "en"
26862
26869
  };
26863
26870
  if (a === "email")
26864
- await ns(t, {
26871
+ await rs(t, {
26865
26872
  to: e,
26866
26873
  subject: Y("code_email_subject", f),
26867
26874
  html: `Click here to validate your email: ${qe(t.env)}validate-email`,
@@ -26910,7 +26917,7 @@ async function Ep(t, e, n) {
26910
26917
  vendorName: r.friendly_name,
26911
26918
  lng: n || "en"
26912
26919
  };
26913
- await ns(t, {
26920
+ await rs(t, {
26914
26921
  to: e.email,
26915
26922
  subject: Y("welcome_to_your_account", c),
26916
26923
  html: `Click here to validate your email: ${qe(t.env)}validate-email`,
@@ -26937,7 +26944,7 @@ async function O6(t, e, n, r, i) {
26937
26944
  vendorName: s.friendly_name,
26938
26945
  lng: "en"
26939
26946
  }, p = `${qe(t.env)}signup?state=${r}&code=${n}`;
26940
- await ns(t, {
26947
+ await rs(t, {
26941
26948
  to: e,
26942
26949
  subject: Y("register_password_account", d),
26943
26950
  html: `Click here to register: ${p}`,
@@ -27005,7 +27012,7 @@ const P6 = new W().openapi(
27005
27012
  throw new v(400, {
27006
27013
  message: "Password does not meet the requirements"
27007
27014
  });
27008
- if (await co({
27015
+ if (await lo({
27009
27016
  userAdapter: t.env.data.users,
27010
27017
  tenant_id: i.tenant.id,
27011
27018
  username: e,
@@ -27157,7 +27164,7 @@ const T6 = new W().openapi(
27157
27164
  c.tenant.id,
27158
27165
  {
27159
27166
  authParams: { ...s, client_id: r, username: l },
27160
- expires_at: new Date(Date.now() + gs).toISOString(),
27167
+ expires_at: new Date(Date.now() + ms).toISOString(),
27161
27168
  csrf_token: me(),
27162
27169
  ip: d,
27163
27170
  useragent: p,
@@ -27167,7 +27174,7 @@ const T6 = new W().openapi(
27167
27174
  code_id: Bn(),
27168
27175
  code_type: "otp",
27169
27176
  login_id: _.id,
27170
- expires_at: new Date(Date.now() + gs).toISOString(),
27177
+ expires_at: new Date(Date.now() + ms).toISOString(),
27171
27178
  redirect_uri: s.redirect_uri
27172
27179
  }), x = s?.ui_locales?.split(" ")?.map((A) => A.split("-")[0])[0];
27173
27180
  return i === "link" ? await Ap(t, {
@@ -27279,7 +27286,7 @@ const T6 = new W().openapi(
27279
27286
  ...g,
27280
27287
  username: r
27281
27288
  },
27282
- expires_at: new Date(Date.now() + gs).toISOString(),
27289
+ expires_at: new Date(Date.now() + ms).toISOString(),
27283
27290
  csrf_token: me(),
27284
27291
  ip: w,
27285
27292
  useragent: x,
@@ -27304,7 +27311,7 @@ class Nr extends v {
27304
27311
  async function Ly(t, e, n, r) {
27305
27312
  const { data: i } = t.env, { username: s } = n;
27306
27313
  if (t.set("username", s), !s)
27307
- throw new z(400, { message: "Username is required" });
27314
+ throw new D(400, { message: "Username is required" });
27308
27315
  const a = await oi({
27309
27316
  userAdapter: t.env.data.users,
27310
27317
  tenant_id: e.tenant.id,
@@ -27621,25 +27628,25 @@ function U6(t) {
27621
27628
  return "auth2";
27622
27629
  if (t === "email")
27623
27630
  return "email";
27624
- throw new z(403, { message: "Invalid realm" });
27631
+ throw new D(403, { message: "Invalid realm" });
27625
27632
  }
27626
27633
  async function D6(t, e, n, r, i) {
27627
27634
  const { env: s } = t;
27628
27635
  t.set("connection", i);
27629
27636
  const a = await s.data.codes.get(e, n, "ticket");
27630
27637
  if (!a || a.used_at)
27631
- throw new z(403, { message: "Ticket not found" });
27638
+ throw new D(403, { message: "Ticket not found" });
27632
27639
  const c = await s.data.loginSessions.get(
27633
27640
  e,
27634
27641
  a.login_id
27635
27642
  );
27636
27643
  if (!c || !c.authParams.username)
27637
- throw new z(403, { message: "Session not found" });
27644
+ throw new D(403, { message: "Session not found" });
27638
27645
  const l = await s.data.legacyClients.get(
27639
27646
  c.authParams.client_id
27640
27647
  );
27641
27648
  if (!l)
27642
- throw new z(403, { message: "Client not found" });
27649
+ throw new D(403, { message: "Client not found" });
27643
27650
  t.set("client_id", c.authParams.client_id), await s.data.codes.used(e, n);
27644
27651
  const d = U6(i);
27645
27652
  let p = await Na(t, {
@@ -28072,7 +28079,7 @@ const z6 = ["email", "sms", "Username-Password-Authentication"], q6 = new W().op
28072
28079
  function H6(t) {
28073
28080
  const e = new W();
28074
28081
  e.use(async (r, i) => {
28075
- const s = Po(r, t.dataAdapter), a = t.dataAdapter.cache || Ac({
28082
+ const s = To(r, t.dataAdapter), a = t.dataAdapter.cache || Ac({
28076
28083
  defaultTtlSeconds: 0,
28077
28084
  // No TTL for request-scoped cache
28078
28085
  maxEntries: 100,
@@ -28134,7 +28141,7 @@ async function ge(t, e, n = !1) {
28134
28141
  e
28135
28142
  );
28136
28143
  if (!i)
28137
- throw new z(400, { message: "Login session not found" });
28144
+ throw new D(400, { message: "Login session not found" });
28138
28145
  t.set("loginSession", i);
28139
28146
  const s = await yi(
28140
28147
  r,
@@ -28153,13 +28160,13 @@ async function ge(t, e, n = !1) {
28153
28160
  if (l) {
28154
28161
  if (i.session_id && !n) {
28155
28162
  if (!i.authParams.redirect_uri)
28156
- throw new z(400, {
28163
+ throw new D(400, {
28157
28164
  message: "Login session closed and no redirect URI available"
28158
28165
  });
28159
28166
  const g = new URL(i.authParams.redirect_uri);
28160
28167
  throw g.searchParams.set("error", "access_denied"), g.searchParams.set("error_description", "Login session closed"), i.authParams.state && g.searchParams.set("state", i.authParams.state), new fr(g.toString(), 302);
28161
28168
  }
28162
- } else throw new z(400, { message: "Tenant not found" });
28169
+ } else throw new D(400, { message: "Tenant not found" });
28163
28170
  const d = await r.data.themes.get(l.id, "default"), p = await r.data.branding.get(l.id), f = i.authParams?.ui_locales?.split(" ")?.map((g) => g.split("-")[0])?.find((g) => {
28164
28171
  if (Array.isArray(y.options.supportedLngs))
28165
28172
  return y.options.supportedLngs.includes(g);
@@ -28974,7 +28981,7 @@ const te = /* @__PURE__ */ $v(G6), bn = ({
28974
28981
  const d = t.get("countryCode"), { normalized: p, connectionType: f } = jc(
28975
28982
  r.username,
28976
28983
  d
28977
- ), g = p ? await co({
28984
+ ), g = p ? await lo({
28978
28985
  userAdapter: e.data.users,
28979
28986
  tenant_id: i.tenant.id,
28980
28987
  username: p,
@@ -29094,7 +29101,7 @@ const te = /* @__PURE__ */ $v(G6), bn = ({
29094
29101
  code_id: x,
29095
29102
  code_type: "otp",
29096
29103
  login_id: s.id,
29097
- expires_at: new Date(Date.now() + gs).toISOString(),
29104
+ expires_at: new Date(Date.now() + ms).toISOString(),
29098
29105
  redirect_uri: s.authParams.redirect_uri
29099
29106
  }), N = i.connections.find(
29100
29107
  (I) => I.strategy === f
@@ -29126,13 +29133,13 @@ const te = /* @__PURE__ */ $v(G6), bn = ({
29126
29133
  children: y.t("go_back")
29127
29134
  }
29128
29135
  );
29129
- var jo = "_hp", o8 = {
29136
+ var Io = "_hp", o8 = {
29130
29137
  Change: "Input",
29131
29138
  DoubleClick: "DblClick"
29132
29139
  }, s8 = {
29133
29140
  svg: "2000/svg",
29134
29141
  math: "1998/Math/MathML"
29135
- }, Io = [], iu = /* @__PURE__ */ new WeakMap(), ri = void 0, a8 = () => ri, rn = (t) => "t" in t, ll = {
29142
+ }, Oo = [], iu = /* @__PURE__ */ new WeakMap(), ri = void 0, a8 = () => ri, rn = (t) => "t" in t, ll = {
29136
29143
  onClick: ["click", !1]
29137
29144
  }, Hg = (t) => {
29138
29145
  if (!t.startsWith("on"))
@@ -29193,7 +29200,7 @@ var jo = "_hp", o8 = {
29193
29200
  }
29194
29201
  }
29195
29202
  }, l8 = (t, e) => {
29196
- e[Se][0] = 0, Io.push([t, e]);
29203
+ e[Se][0] = 0, Oo.push([t, e]);
29197
29204
  const n = e.tag[lp] || e.tag, r = n.defaultProps ? {
29198
29205
  ...n.defaultProps,
29199
29206
  ...e.props
@@ -29201,7 +29208,7 @@ var jo = "_hp", o8 = {
29201
29208
  try {
29202
29209
  return [n.call(null, r)];
29203
29210
  } finally {
29204
- Io.pop();
29211
+ Oo.pop();
29205
29212
  }
29206
29213
  }, My = (t, e, n, r, i) => {
29207
29214
  t.vR?.length && (r.push(...t.vR), delete t.vR), typeof t.tag == "function" && t[Se][1][Hy]?.forEach((s) => i.push(s)), t.vC.forEach((s) => {
@@ -29219,10 +29226,10 @@ var jo = "_hp", o8 = {
29219
29226
  n.push(s), s.vR?.length && (r.push(...s.vR), delete s.vR);
29220
29227
  });
29221
29228
  }, d8 = (t) => {
29222
- for (; ; t = t.tag === jo || !t.vC || !t.pP ? t.nN : t.vC[0]) {
29229
+ for (; ; t = t.tag === Io || !t.vC || !t.pP ? t.nN : t.vC[0]) {
29223
29230
  if (!t)
29224
29231
  return null;
29225
- if (t.tag !== jo && t.e)
29232
+ if (t.tag !== Io && t.e)
29226
29233
  return t.e;
29227
29234
  }
29228
29235
  }, zy = (t) => {
@@ -29246,7 +29253,7 @@ var jo = "_hp", o8 = {
29246
29253
  c = 0;
29247
29254
  else {
29248
29255
  const d = Kg(a, d8(t.nN));
29249
- d !== void 0 ? (l = a[d], c = d) : c = Kg(a, r.find((p) => p.tag !== jo && p.e)?.e) ?? -1, c === -1 && (n = !0);
29256
+ d !== void 0 ? (l = a[d], c = d) : c = Kg(a, r.find((p) => p.tag !== Io && p.e)?.e) ?? -1, c === -1 && (n = !0);
29250
29257
  }
29251
29258
  for (let d = 0, p = r.length; d < p; d++, c++) {
29252
29259
  const f = r[d];
@@ -29257,7 +29264,7 @@ var jo = "_hp", o8 = {
29257
29264
  const _ = n || !f.e;
29258
29265
  rn(f) ? (f.e && f.d && (f.e.textContent = f.t), f.d = !1, g = f.e ||= document.createTextNode(f.t)) : (g = f.e ||= f.n ? document.createElementNS(f.n, f.tag) : document.createElement(f.tag), c8(g, f.props, f.pP), Fy(f, g, _));
29259
29266
  }
29260
- f.tag === jo ? c-- : n ? g.parentNode || e.appendChild(g) : a[c] !== g && a[c - 1] !== g && (a[c + 1] === g ? e.appendChild(a[c]) : e.insertBefore(g, l || a[c] || null));
29267
+ f.tag === Io ? c-- : n ? g.parentNode || e.appendChild(g) : a[c] !== g && a[c - 1] !== g && (a[c + 1] === g ? e.appendChild(a[c]) : e.insertBefore(g, l || a[c] || null));
29261
29268
  }
29262
29269
  if (t.pP && delete t.pP, s.length) {
29263
29270
  const d = [], p = [];
@@ -29272,7 +29279,7 @@ var jo = "_hp", o8 = {
29272
29279
  n && (e.pC ||= e.vC);
29273
29280
  let i;
29274
29281
  try {
29275
- n ||= typeof e.tag == "function" ? l8(t, e) : Yo(e.props.children), n[0]?.tag === "" && n[0][Zd] && (i = n[0][Zd], t[5].push([t, i, e]));
29282
+ n ||= typeof e.tag == "function" ? l8(t, e) : Qo(e.props.children), n[0]?.tag === "" && n[0][Zd] && (i = n[0][Zd], t[5].push([t, i, e]));
29276
29283
  const s = r ? [...e.pC] : e.vC ? [...e.vC] : void 0, a = [];
29277
29284
  let c;
29278
29285
  for (let l = 0; l < n.length; l++) {
@@ -29407,7 +29414,7 @@ var jo = "_hp", o8 = {
29407
29414
  }
29408
29415
  return i;
29409
29416
  }, f8 = (t, e, n) => ({
29410
- tag: jo,
29417
+ tag: Io,
29411
29418
  props: {
29412
29419
  children: t
29413
29420
  },
@@ -29415,7 +29422,7 @@ var jo = "_hp", o8 = {
29415
29422
  e,
29416
29423
  p: 1
29417
29424
  }), h8 = 0, Hy = 1, g8 = 2, m8 = 3, dl = /* @__PURE__ */ new WeakMap(), Vy = (t, e) => !t || !e || t.length !== e.length || e.some((n, r) => n !== t[r]), _8 = void 0, Xg = [], y8 = (t) => {
29418
- const e = () => typeof t == "function" ? t() : t, n = Io.at(-1);
29425
+ const e = () => typeof t == "function" ? t() : t, n = Oo.at(-1);
29419
29426
  if (!n)
29420
29427
  return [e(), () => {
29421
29428
  }];
@@ -29445,7 +29452,7 @@ var jo = "_hp", o8 = {
29445
29452
  }
29446
29453
  ];
29447
29454
  }, Cp = (t, e) => {
29448
- const n = Io.at(-1);
29455
+ const n = Oo.at(-1);
29449
29456
  if (!n)
29450
29457
  return t;
29451
29458
  const [, r] = n, i = r[Se][1][g8] ||= [], s = r[Se][0]++, a = i[s];
@@ -29462,7 +29469,7 @@ var jo = "_hp", o8 = {
29462
29469
  (n) => dl.set(t, [void 0, n])
29463
29470
  ), t;
29464
29471
  }, b8 = (t, e) => {
29465
- const n = Io.at(-1);
29472
+ const n = Oo.at(-1);
29466
29473
  if (!n)
29467
29474
  return t();
29468
29475
  const [, r] = n, i = r[Se][1][m8] ||= [], s = r[Se][0]++, a = i[s];
@@ -29488,7 +29495,7 @@ var jo = "_hp", o8 = {
29488
29495
  };
29489
29496
  },
29490
29497
  [t]
29491
- ), Yg = /* @__PURE__ */ Object.create(null), Qg = /* @__PURE__ */ Object.create(null), rs = (t, e, n, r, i) => {
29498
+ ), Yg = /* @__PURE__ */ Object.create(null), Qg = /* @__PURE__ */ Object.create(null), is = (t, e, n, r, i) => {
29492
29499
  if (e?.itemProp)
29493
29500
  return {
29494
29501
  tag: t,
@@ -29498,13 +29505,13 @@ var jo = "_hp", o8 = {
29498
29505
  };
29499
29506
  const s = document.head;
29500
29507
  let { onLoad: a, onError: c, precedence: l, blocking: d, ...p } = e, f = null, g = !1;
29501
- const _ = bs[t];
29508
+ const _ = vs[t];
29502
29509
  let w;
29503
29510
  if (_.length > 0) {
29504
29511
  const N = s.querySelectorAll(t);
29505
29512
  e:
29506
29513
  for (const O of N)
29507
- for (const I of bs[t])
29514
+ for (const I of vs[t])
29508
29515
  if (O.getAttribute(I) === e[I]) {
29509
29516
  f = O;
29510
29517
  break e;
@@ -29523,17 +29530,17 @@ var jo = "_hp", o8 = {
29523
29530
  }
29524
29531
  } else
29525
29532
  w = s.querySelectorAll(t);
29526
- l = r ? l ?? "" : void 0, r && (p[vs] = l);
29533
+ l = r ? l ?? "" : void 0, r && (p[$s] = l);
29527
29534
  const x = Cp(
29528
29535
  (N) => {
29529
29536
  if (_.length > 0) {
29530
29537
  let O = !1;
29531
29538
  for (const I of s.querySelectorAll(t)) {
29532
- if (O && I.getAttribute(vs) !== l) {
29539
+ if (O && I.getAttribute($s) !== l) {
29533
29540
  s.insertBefore(N, I);
29534
29541
  return;
29535
29542
  }
29536
- I.getAttribute(vs) === l && (O = !0);
29543
+ I.getAttribute($s) === l && (O = !0);
29537
29544
  }
29538
29545
  s.appendChild(N);
29539
29546
  } else if (w) {
@@ -29563,7 +29570,7 @@ var jo = "_hp", o8 = {
29563
29570
  });
29564
29571
  });
29565
29572
  if (i && d === "render") {
29566
- const N = bs[t][0];
29573
+ const N = vs[t][0];
29567
29574
  if (e[N]) {
29568
29575
  const O = e[N], I = Yg[O] ||= new Promise((U, J) => {
29569
29576
  x(f), f.addEventListener("load", U), f.addEventListener("error", J);
@@ -29591,23 +29598,23 @@ var jo = "_hp", o8 = {
29591
29598
  props: t,
29592
29599
  type: "title",
29593
29600
  ref: t.ref
29594
- } : rs("title", t, void 0, !1, !1);
29601
+ } : is("title", t, void 0, !1, !1);
29595
29602
  }, x8 = (t) => !t || ["src", "async"].some((e) => !t[e]) ? {
29596
29603
  tag: "script",
29597
29604
  props: t,
29598
29605
  type: "script",
29599
29606
  ref: t.ref
29600
- } : rs("script", t, 1, !1, !0), S8 = (t) => !t || !["href", "precedence"].every((e) => e in t) ? {
29607
+ } : is("script", t, 1, !1, !0), S8 = (t) => !t || !["href", "precedence"].every((e) => e in t) ? {
29601
29608
  tag: "style",
29602
29609
  props: t,
29603
29610
  type: "style",
29604
29611
  ref: t.ref
29605
- } : (t["data-href"] = t.href, delete t.href, rs("style", t, 2, !0, !0)), A8 = (t) => !t || ["onLoad", "onError"].some((e) => e in t) || t.rel === "stylesheet" && (!("precedence" in t) || "disabled" in t) ? {
29612
+ } : (t["data-href"] = t.href, delete t.href, is("style", t, 2, !0, !0)), A8 = (t) => !t || ["onLoad", "onError"].some((e) => e in t) || t.rel === "stylesheet" && (!("precedence" in t) || "disabled" in t) ? {
29606
29613
  tag: "link",
29607
29614
  props: t,
29608
29615
  type: "link",
29609
29616
  ref: t.ref
29610
- } : rs("link", t, 1, "precedence" in t, !0), E8 = (t) => rs("meta", t, void 0, !1, !1), Ky = Symbol(), C8 = (t) => {
29617
+ } : is("link", t, 1, "precedence" in t, !0), E8 = (t) => is("meta", t, void 0, !1, !1), Ky = Symbol(), C8 = (t) => {
29611
29618
  const { action: e, ...n } = t;
29612
29619
  typeof e != "function" && (n.action = e);
29613
29620
  const [r, i] = y8([null, !1]), s = Cp(
@@ -30030,7 +30037,7 @@ const gr = (t) => {
30030
30037
  ),
30031
30038
  400
30032
30039
  );
30033
- const l = await co({
30040
+ const l = await lo({
30034
30041
  userAdapter: t.env.data.users,
30035
30042
  tenant_id: a.tenant.id,
30036
30043
  username: s.authParams.username,
@@ -30156,7 +30163,7 @@ const gr = (t) => {
30156
30163
  } catch (d) {
30157
30164
  let p;
30158
30165
  try {
30159
- p = await co({
30166
+ p = await lo({
30160
30167
  userAdapter: t.env.data.users,
30161
30168
  tenant_id: a.tenant.id,
30162
30169
  username: c.authParams.username,
@@ -34481,7 +34488,7 @@ function yx(t) {
34481
34488
  }), e.get("/js/client.js", async (s) => s.text(ux, 200, {
34482
34489
  "content-type": "application/javascript; charset=utf-8"
34483
34490
  })), e.use(async (s, a) => {
34484
- const c = Po(s, t.dataAdapter), l = Sc(c, {
34491
+ const c = To(s, t.dataAdapter), l = Sc(c, {
34485
34492
  defaultTtl: r,
34486
34493
  cacheEntities: [
34487
34494
  "tenants",
@@ -36215,7 +36222,7 @@ const GS = new W().openapi(
36215
36222
  function WS(t) {
36216
36223
  const e = new W();
36217
36224
  e.use(async (r, i) => {
36218
- const s = Po(r, t.dataAdapter), a = t.dataAdapter.cache || Ac({
36225
+ const s = To(r, t.dataAdapter), a = t.dataAdapter.cache || Ac({
36219
36226
  defaultTtlSeconds: 0,
36220
36227
  // No TTL for request-scoped cache
36221
36228
  maxEntries: 100,
@@ -37829,7 +37836,7 @@ export {
37829
37836
  wl as connectionInsertSchema,
37830
37837
  Xi as connectionOptionsSchema,
37831
37838
  Ft as connectionSchema,
37832
- Oo as coordinatesSchema,
37839
+ Po as coordinatesSchema,
37833
37840
  Ac as createInMemoryCache,
37834
37841
  k0 as customDomainInsertSchema,
37835
37842
  qn as customDomainSchema,
@@ -37852,7 +37859,7 @@ export {
37852
37859
  JW as init,
37853
37860
  HW as injectTailwindCSS,
37854
37861
  A0 as inviteInsertSchema,
37855
- hs as inviteSchema,
37862
+ gs as inviteSchema,
37856
37863
  fw as inviteeSchema,
37857
37864
  pw as inviterSchema,
37858
37865
  hw as jwksKeySchema,
@@ -37899,7 +37906,7 @@ export {
37899
37906
  tw as startSchema,
37900
37907
  Z1 as stepNodeSchema,
37901
37908
  Wy as tailwindCss,
37902
- fs as tenantInsertSchema,
37909
+ hs as tenantInsertSchema,
37903
37910
  Fn as tenantSchema,
37904
37911
  zK as tenantSettingsSchema,
37905
37912
  Aw as themeInsertSchema,