authhero 0.24.0 → 0.25.1

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
@@ -40,20 +40,20 @@ function W0(r) {
40
40
  return;
41
41
  r.ZodType.prototype.openapi = function(s, i) {
42
42
  var a, o, c, u, f, y;
43
- const B = typeof s == "string" ? i : s, C = B ?? {}, { param: p } = C, g = ki(C, ["param"]), A = Object.assign(Object.assign({}, (a = this._def.openapi) === null || a === void 0 ? void 0 : a._internal), typeof s == "string" ? { refId: s } : void 0), O = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), g), !((u = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || u === void 0) && u.param || p ? {
43
+ const B = typeof s == "string" ? i : s, I = B ?? {}, { param: p } = I, g = ki(I, ["param"]), A = Object.assign(Object.assign({}, (a = this._def.openapi) === null || a === void 0 ? void 0 : a._internal), typeof s == "string" ? { refId: s } : void 0), O = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), g), !((u = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || u === void 0) && u.param || p ? {
44
44
  param: Object.assign(Object.assign({}, (y = (f = this._def.openapi) === null || f === void 0 ? void 0 : f.metadata) === null || y === void 0 ? void 0 : y.param), p)
45
45
  } : void 0), P = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(A).length > 0 ? { _internal: A } : void 0), Object.keys(O).length > 0 ? { metadata: O } : void 0) }));
46
46
  if (Se(this, "ZodObject")) {
47
47
  const N = this.extend;
48
48
  P.extend = function(...xe) {
49
49
  var Le, qe, Ze, tt, mt, Rt;
50
- const I = N.apply(this, xe);
51
- return I._def.openapi = {
50
+ const C = N.apply(this, xe);
51
+ return C._def.openapi = {
52
52
  _internal: {
53
53
  extendedFrom: !((qe = (Le = this._def.openapi) === null || Le === void 0 ? void 0 : Le._internal) === null || qe === void 0) && qe.refId ? { refId: (tt = (Ze = this._def.openapi) === null || Ze === void 0 ? void 0 : Ze._internal) === null || tt === void 0 ? void 0 : tt.refId, schema: this } : (mt = this._def.openapi) === null || mt === void 0 ? void 0 : mt._internal.extendedFrom
54
54
  },
55
- metadata: (Rt = I._def.openapi) === null || Rt === void 0 ? void 0 : Rt.metadata
56
- }, I;
55
+ metadata: (Rt = C._def.openapi) === null || Rt === void 0 ? void 0 : Rt.metadata
56
+ }, C;
57
57
  };
58
58
  }
59
59
  return P;
@@ -148,7 +148,7 @@ function G0(r, e) {
148
148
  e.some((i) => i === n) || (t[n] = s);
149
149
  }), t;
150
150
  }
151
- function Cs(r, e) {
151
+ function Is(r, e) {
152
152
  const t = {};
153
153
  return Object.entries(r).forEach(([n, s]) => {
154
154
  e(s, n) || (t[n] = s);
@@ -288,13 +288,13 @@ class We {
288
288
  * metadata properties
289
289
  */
290
290
  static buildSchemaMetadata(e) {
291
- return Cs(G0(e, ["param"]), Bi);
291
+ return Is(G0(e, ["param"]), Bi);
292
292
  }
293
293
  static buildParameterMetadata(e) {
294
- return Cs(e, Bi);
294
+ return Is(e, Bi);
295
295
  }
296
296
  static applySchemaMetadata(e, t) {
297
- return Cs(Object.assign(Object.assign({}, e), this.buildSchemaMetadata(t)), Bi);
297
+ return Is(Object.assign(Object.assign({}, e), this.buildSchemaMetadata(t)), Bi);
298
298
  }
299
299
  static getRefId(e) {
300
300
  var t;
@@ -410,7 +410,7 @@ class cv {
410
410
  return Object.assign(Object.assign(Object.assign(Object.assign({}, n("object")), { properties: c, default: t }), o.length > 0 ? { required: o } : {}), this.generateAdditionalProperties(e, s));
411
411
  const u = a.schema;
412
412
  s(u);
413
- const f = this.requiredKeysOf(u), y = Ri(u == null ? void 0 : u._def.shape(), s), B = Object.fromEntries(Object.entries(c).filter(([g, A]) => !cl(y[g], A))), C = o.filter((g) => !f.includes(g)), p = Object.assign(Object.assign(Object.assign(Object.assign({}, n("object")), { default: t, properties: B }), C.length > 0 ? { required: C } : {}), this.generateAdditionalProperties(e, s));
413
+ const f = this.requiredKeysOf(u), y = Ri(u == null ? void 0 : u._def.shape(), s), B = Object.fromEntries(Object.entries(c).filter(([g, A]) => !cl(y[g], A))), I = o.filter((g) => !f.includes(g)), p = Object.assign(Object.assign(Object.assign(Object.assign({}, n("object")), { default: t, properties: B }), I.length > 0 ? { required: I } : {}), this.generateAdditionalProperties(e, s));
414
414
  return {
415
415
  allOf: [
416
416
  { $ref: `#/components/schemas/${a.refId}` },
@@ -650,13 +650,13 @@ class xm {
650
650
  const o = e._def.shape();
651
651
  return Object.entries(o).map(([u, f]) => {
652
652
  var y, B;
653
- const C = We.getMetadata(f), p = this.getParameterRef(C, {
653
+ const I = We.getMetadata(f), p = this.getParameterRef(I, {
654
654
  in: t,
655
655
  name: u
656
656
  });
657
657
  if (p)
658
658
  return p;
659
- const g = (y = C == null ? void 0 : C.metadata) === null || y === void 0 ? void 0 : y.param;
659
+ const g = (y = I == null ? void 0 : I.metadata) === null || y === void 0 ? void 0 : y.param;
660
660
  if (g != null && g.name && g.name !== u)
661
661
  throw new bi("Conflicting names for parameter", {
662
662
  key: "name",
@@ -703,7 +703,7 @@ class xm {
703
703
  generateSchemaWithMetadata(e) {
704
704
  var t;
705
705
  const n = We.unwrapChained(e), s = We.getMetadata(e), i = We.getDefaultValue(e), a = !((t = s == null ? void 0 : s.metadata) === null || t === void 0) && t.type ? { type: s == null ? void 0 : s.metadata.type } : this.toOpenAPISchema(n, e.isNullable(), i);
706
- return s != null && s.metadata ? We.applySchemaMetadata(a, s.metadata) : Cs(a, Bi);
706
+ return s != null && s.metadata ? We.applySchemaMetadata(a, s.metadata) : Is(a, Bi);
707
707
  }
708
708
  /**
709
709
  * Same as above but applies nullable
@@ -723,12 +723,12 @@ class xm {
723
723
  return this.generateSchemaWithMetadata(e);
724
724
  const i = this.schemaRefs[s], a = {
725
725
  $ref: this.generateSchemaRef(s)
726
- }, o = Cs(We.buildSchemaMetadata((t = n == null ? void 0 : n.metadata) !== null && t !== void 0 ? t : {}), (f, y) => f === void 0 || cl(f, i[y]));
726
+ }, o = Is(We.buildSchemaMetadata((t = n == null ? void 0 : n.metadata) !== null && t !== void 0 ? t : {}), (f, y) => f === void 0 || cl(f, i[y]));
727
727
  if (o.type)
728
728
  return {
729
729
  allOf: [a, o]
730
730
  };
731
- const c = Cs(this.constructReferencedOpenAPISchema(e), (f, y) => f === void 0 || cl(f, i[y])), u = We.applySchemaMetadata(c, o);
731
+ const c = Is(this.constructReferencedOpenAPISchema(e), (f, y) => f === void 0 || cl(f, i[y])), u = We.applySchemaMetadata(c, o);
732
732
  return Object.keys(u).length > 0 ? {
733
733
  allOf: [a, u]
734
734
  } : a;
@@ -1018,7 +1018,7 @@ var _m = (r) => {
1018
1018
  o === -1 ? u = "" : (u = r.slice(o + 1, a === -1 ? void 0 : a), n && (u = qu(u))), t ? (s[c] && Array.isArray(s[c]) || (s[c] = []), s[c].push(u)) : s[c] ?? (s[c] = u);
1019
1019
  }
1020
1020
  return e ? s[e] : s;
1021
- }, Sv = Am, Av = (r, e) => Am(r, e, !0), tf = decodeURIComponent, Ov = /^[\w!#$%&'*.^`|~+-]+$/, Ev = /^[ !#-:<-[\]-~]*$/, Iv = (r, e) => {
1021
+ }, Sv = Am, Av = (r, e) => Am(r, e, !0), tf = decodeURIComponent, Ov = /^[\w!#$%&'*.^`|~+-]+$/, Ev = /^[ !#-:<-[\]-~]*$/, Cv = (r, e) => {
1022
1022
  const t = r.trim().split(";"), n = {};
1023
1023
  for (let s of t) {
1024
1024
  s = s.trim();
@@ -1032,10 +1032,10 @@ var _m = (r) => {
1032
1032
  o.startsWith('"') && o.endsWith('"') && (o = o.slice(1, -1)), Ev.test(o) && (n[a] = tf(o));
1033
1033
  }
1034
1034
  return n;
1035
- }, Cv = (r, e, t) => {
1035
+ }, Iv = (r, e, t) => {
1036
1036
  const n = r.req.raw.headers.get("Cookie");
1037
- return n ? Iv(n) : {};
1038
- }, de = class extends Error {
1037
+ return n ? Cv(n) : {};
1038
+ }, le = class extends Error {
1039
1039
  constructor(e = 500, t) {
1040
1040
  super(t == null ? void 0 : t.message, { cause: t == null ? void 0 : t.cause });
1041
1041
  ne(this, "res");
@@ -1065,7 +1065,7 @@ var _m = (r) => {
1065
1065
  s = await t.req.json();
1066
1066
  } catch {
1067
1067
  const o = "Malformed JSON in request body";
1068
- throw new de(400, { message: o });
1068
+ throw new le(400, { message: o });
1069
1069
  }
1070
1070
  break;
1071
1071
  case "form": {
@@ -1080,7 +1080,7 @@ var _m = (r) => {
1080
1080
  o = await jv(u, i), t.req.bodyCache.formData = o;
1081
1081
  } catch (u) {
1082
1082
  let f = "Malformed FormData request.";
1083
- throw f += u instanceof Error ? ` ${u.message}` : ` ${String(u)}`, new de(400, { message: f });
1083
+ throw f += u instanceof Error ? ` ${u.message}` : ` ${String(u)}`, new le(400, { message: f });
1084
1084
  }
1085
1085
  const c = {};
1086
1086
  o.forEach((u, f) => {
@@ -1100,7 +1100,7 @@ var _m = (r) => {
1100
1100
  s = t.req.header();
1101
1101
  break;
1102
1102
  case "cookie":
1103
- s = Cv(t);
1103
+ s = Iv(t);
1104
1104
  break;
1105
1105
  }
1106
1106
  const a = await e(s, t);
@@ -1148,7 +1148,7 @@ var Zv = (r, e, t) => {
1148
1148
  s.forEach((i, a) => {
1149
1149
  a === s.length - 1 ? n[i] = t : ((!n[i] || typeof n[i] != "object" || Array.isArray(n[i]) || n[i] instanceof File) && (n[i] = /* @__PURE__ */ Object.create(null)), n = n[i]);
1150
1150
  });
1151
- }, hh = (r) => wm(r, tf), Rs, tr, Xr, Em, Im, ul, cn, lm, Om = (lm = class {
1151
+ }, hh = (r) => wm(r, tf), Rs, tr, Xr, Em, Cm, ul, cn, lm, Om = (lm = class {
1152
1152
  constructor(r, e = "/", t = [[]]) {
1153
1153
  Oe(this, Xr);
1154
1154
  ne(this, "raw");
@@ -1167,7 +1167,7 @@ var Zv = (r, e, t) => {
1167
1167
  this.raw = r, this.path = e, ue(this, tr, t), ue(this, Rs, {});
1168
1168
  }
1169
1169
  param(r) {
1170
- return r ? Te(this, Xr, Em).call(this, r) : Te(this, Xr, Im).call(this);
1170
+ return r ? Te(this, Xr, Em).call(this, r) : Te(this, Xr, Cm).call(this);
1171
1171
  }
1172
1172
  query(r) {
1173
1173
  return Sv(this.url, r);
@@ -1223,7 +1223,7 @@ var Zv = (r, e, t) => {
1223
1223
  }, Rs = new WeakMap(), tr = new WeakMap(), Xr = new WeakSet(), Em = function(r) {
1224
1224
  const e = w(this, tr)[0][this.routeIndex][1][r], t = Te(this, Xr, ul).call(this, e);
1225
1225
  return t ? /\%/.test(t) ? hh(t) : t : void 0;
1226
- }, Im = function() {
1226
+ }, Cm = function() {
1227
1227
  const r = {}, e = Object.keys(w(this, tr)[0][this.routeIndex][1]);
1228
1228
  for (const t of e) {
1229
1229
  const n = Te(this, Xr, ul).call(this, w(this, tr)[0][this.routeIndex][1][t]);
@@ -1236,12 +1236,12 @@ var Zv = (r, e, t) => {
1236
1236
  Stringify: 1,
1237
1237
  BeforeStream: 2,
1238
1238
  Stream: 3
1239
- }, Cm = async (r, e, t, n, s) => {
1239
+ }, Im = async (r, e, t, n, s) => {
1240
1240
  typeof r == "object" && !(r instanceof String) && (r instanceof Promise || (r = r.toString()), r instanceof Promise && (r = await r));
1241
1241
  const i = r.callbacks;
1242
1242
  return i != null && i.length ? (s ? s[0] += r : s = [r], Promise.all(i.map((o) => o({ phase: e, buffer: s, context: n }))).then(
1243
1243
  (o) => Promise.all(
1244
- o.filter(Boolean).map((c) => Cm(c, e, !1, n, s))
1244
+ o.filter(Boolean).map((c) => Im(c, e, !1, n, s))
1245
1245
  ).then(() => s[0])
1246
1246
  )) : Promise.resolve(r);
1247
1247
  }, Vv = "text/plain; charset=UTF-8", Hu = (r, e = {}) => {
@@ -1302,7 +1302,7 @@ var Zv = (r, e, t) => {
1302
1302
  const n = JSON.stringify(r);
1303
1303
  return w(this, Qe) ?? ue(this, Qe, {}), w(this, Qe)["content-type"] = "application/json; charset=UTF-8", typeof e == "number" ? Te(this, Ot, Vt).call(this, n, e, t) : Te(this, Ot, Vt).call(this, n, e);
1304
1304
  });
1305
- ne(this, "html", (r, e, t) => (w(this, Qe) ?? ue(this, Qe, {}), w(this, Qe)["content-type"] = "text/html; charset=UTF-8", typeof r == "object" ? Cm(r, Uv.Stringify, !1, {}).then((n) => typeof e == "number" ? Te(this, Ot, Vt).call(this, n, e, t) : Te(this, Ot, Vt).call(this, n, e)) : typeof e == "number" ? Te(this, Ot, Vt).call(this, r, e, t) : Te(this, Ot, Vt).call(this, r, e)));
1305
+ ne(this, "html", (r, e, t) => (w(this, Qe) ?? ue(this, Qe, {}), w(this, Qe)["content-type"] = "text/html; charset=UTF-8", typeof r == "object" ? Im(r, Uv.Stringify, !1, {}).then((n) => typeof e == "number" ? Te(this, Ot, Vt).call(this, n, e, t) : Te(this, Ot, Vt).call(this, n, e)) : typeof e == "number" ? Te(this, Ot, Vt).call(this, r, e, t) : Te(this, Ot, Vt).call(this, r, e)));
1306
1306
  ne(this, "redirect", (r, e) => (w(this, Ge) ?? ue(this, Ge, new Headers()), w(this, Ge).set("Location", String(r)), this.newResponse(null, e ?? 302)));
1307
1307
  ne(this, "notFound", () => (w(this, $s) ?? ue(this, $s, () => new Response()), w(this, $s).call(this, this)));
1308
1308
  ue(this, Ha, r), e && (ue(this, $r, e.executionCtx), this.env = e.env, ue(this, $s, e.notFoundHandler), ue(this, za, e.path), ue(this, Wa, e.matchResult));
@@ -1659,18 +1659,18 @@ function Yv(r) {
1659
1659
  const n = r.map(
1660
1660
  (f) => [!/\*|\/:/.test(f[0]), ...f]
1661
1661
  ).sort(
1662
- ([f, y], [B, C]) => f ? 1 : B ? -1 : y.length - C.length
1662
+ ([f, y], [B, I]) => f ? 1 : B ? -1 : y.length - I.length
1663
1663
  ), s = /* @__PURE__ */ Object.create(null);
1664
1664
  for (let f = 0, y = -1, B = n.length; f < B; f++) {
1665
- const [C, p, g] = n[f];
1666
- C ? s[p] = [g.map(([O]) => [O, /* @__PURE__ */ Object.create(null)]), Pm] : y++;
1665
+ const [I, p, g] = n[f];
1666
+ I ? s[p] = [g.map(([O]) => [O, /* @__PURE__ */ Object.create(null)]), Pm] : y++;
1667
1667
  let A;
1668
1668
  try {
1669
- A = e.insert(p, y, C);
1669
+ A = e.insert(p, y, I);
1670
1670
  } catch (O) {
1671
1671
  throw O === Si ? new Nm(p) : O;
1672
1672
  }
1673
- C || (t[y] = g.map(([O, P]) => {
1673
+ I || (t[y] = g.map(([O, P]) => {
1674
1674
  const N = /* @__PURE__ */ Object.create(null);
1675
1675
  for (P -= 1; P >= 0; P--) {
1676
1676
  const [xe, Le] = A[P];
@@ -1681,7 +1681,7 @@ function Yv(r) {
1681
1681
  }
1682
1682
  const [i, a, o] = e.buildRegExp();
1683
1683
  for (let f = 0, y = t.length; f < y; f++)
1684
- for (let B = 0, C = t[f].length; B < C; B++) {
1684
+ for (let B = 0, I = t[f].length; B < I; B++) {
1685
1685
  const p = (u = t[f][B]) == null ? void 0 : u[1];
1686
1686
  if (!p)
1687
1687
  continue;
@@ -1859,7 +1859,7 @@ var un, ln, ii, Dm, Zm, mm, Xv = (mm = class {
1859
1859
  const i = _m(e);
1860
1860
  for (let o = 0, c = i.length; o < c; o++) {
1861
1861
  const u = i[o], f = o === c - 1, y = [];
1862
- for (let B = 0, C = s.length; B < C; B++) {
1862
+ for (let B = 0, I = s.length; B < I; B++) {
1863
1863
  const p = s[B], g = w(p, bt)[u];
1864
1864
  g && (ue(g, Et, w(p, Et)), f ? (w(g, bt)["*"] && t.push(
1865
1865
  ...Te(this, Ur, Pn).call(this, w(g, bt)["*"], r, w(p, Et), /* @__PURE__ */ Object.create(null))
@@ -1898,8 +1898,8 @@ var un, ln, ii, Dm, Zm, mm, Xv = (mm = class {
1898
1898
  if (c !== void 0) {
1899
1899
  c.params = /* @__PURE__ */ Object.create(null);
1900
1900
  for (let f = 0, y = c.possibleKeys.length; f < y; f++) {
1901
- const B = c.possibleKeys[f], C = u[c.score];
1902
- c.params[B] = n[B] && !C ? n[B] : t[B] ?? n[B], u[c.score] = !0;
1901
+ const B = c.possibleKeys[f], I = u[c.score];
1902
+ c.params[B] = n[B] && !I ? n[B] : t[B] ?? n[B], u[c.score] = !0;
1903
1903
  }
1904
1904
  s.push(c);
1905
1905
  }
@@ -3349,7 +3349,7 @@ qo.create = (r) => new qo({
3349
3349
  typeName: fe.ZodVoid,
3350
3350
  ..._e(r)
3351
3351
  });
3352
- let Gn = class Io extends Ae {
3352
+ let Gn = class Co extends Ae {
3353
3353
  _parse(e) {
3354
3354
  const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
3355
3355
  if (t.parsedType !== z.array)
@@ -3393,19 +3393,19 @@ let Gn = class Io extends Ae {
3393
3393
  return this._def.type;
3394
3394
  }
3395
3395
  min(e, t) {
3396
- return new Io({
3396
+ return new Co({
3397
3397
  ...this._def,
3398
3398
  minLength: { value: e, message: ae.toString(t) }
3399
3399
  });
3400
3400
  }
3401
3401
  max(e, t) {
3402
- return new Io({
3402
+ return new Co({
3403
3403
  ...this._def,
3404
3404
  maxLength: { value: e, message: ae.toString(t) }
3405
3405
  });
3406
3406
  }
3407
3407
  length(e, t) {
3408
- return new Io({
3408
+ return new Co({
3409
3409
  ...this._def,
3410
3410
  exactLength: { value: e, message: ae.toString(t) }
3411
3411
  });
@@ -4127,7 +4127,7 @@ Fo.create = (r, e) => new Fo({
4127
4127
  typeName: fe.ZodSet,
4128
4128
  ..._e(e)
4129
4129
  });
4130
- let Xm = class Co extends Ae {
4130
+ let Xm = class Io extends Ae {
4131
4131
  constructor() {
4132
4132
  super(...arguments), this.validate = this.implement;
4133
4133
  }
@@ -4175,11 +4175,11 @@ let Xm = class Co extends Ae {
4175
4175
  if (this._def.returns instanceof Vs) {
4176
4176
  const o = this;
4177
4177
  return _t(async function(...c) {
4178
- const u = new or([]), f = await o._def.args.parseAsync(c, i).catch((C) => {
4179
- throw u.addIssue(n(c, C)), u;
4178
+ const u = new or([]), f = await o._def.args.parseAsync(c, i).catch((I) => {
4179
+ throw u.addIssue(n(c, I)), u;
4180
4180
  }), y = await Reflect.apply(a, this, f);
4181
- return await o._def.returns._def.type.parseAsync(y, i).catch((C) => {
4182
- throw u.addIssue(s(y, C)), u;
4181
+ return await o._def.returns._def.type.parseAsync(y, i).catch((I) => {
4182
+ throw u.addIssue(s(y, I)), u;
4183
4183
  });
4184
4184
  });
4185
4185
  } else {
@@ -4202,13 +4202,13 @@ let Xm = class Co extends Ae {
4202
4202
  return this._def.returns;
4203
4203
  }
4204
4204
  args(...e) {
4205
- return new Co({
4205
+ return new Io({
4206
4206
  ...this._def,
4207
4207
  args: gn.create(e).rest(Hn.create())
4208
4208
  });
4209
4209
  }
4210
4210
  returns(e) {
4211
- return new Co({
4211
+ return new Io({
4212
4212
  ...this._def,
4213
4213
  returns: e
4214
4214
  });
@@ -4220,7 +4220,7 @@ let Xm = class Co extends Ae {
4220
4220
  return this.parse(e);
4221
4221
  }
4222
4222
  static create(e, t, n) {
4223
- return new Co({
4223
+ return new Io({
4224
4224
  args: e || gn.create([]).rest(Hn.create()),
4225
4225
  returns: t || Hn.create(),
4226
4226
  typeName: fe.ZodFunction,
@@ -4665,7 +4665,7 @@ var fe;
4665
4665
  })(fe || (fe = {}));
4666
4666
  const wb = (r, e = {
4667
4667
  message: `Input not instance of ${r.name}`
4668
- }) => ty((t) => t instanceof r, e), ry = Ms.create, ny = Hi.create, kb = Ko.create, Sb = Fi.create, sy = Ki.create, Ab = Wi.create, Ob = Lo.create, Eb = zi.create, Ib = Gi.create, Cb = Us.create, jb = Hn.create, Tb = Hr.create, Nb = qo.create, Bb = Gn.create, Rb = Kt.create, Pb = Kt.strictCreate, $b = Ji.create, Db = zm.create, Zb = Yi.create, Mb = gn.create, Ub = Ym.create, Vb = Ho.create, Lb = Fo.create, qb = Xm.create, Hb = Xi.create, Fb = Qi.create, Kb = Ja.create, Wb = ea.create, zb = Vs.create, gh = dr.create, Gb = br.create, Jb = vn.create, Yb = dr.createWithPreprocess, Xb = nf.create, Qb = () => ry().optional(), ex = () => ny().optional(), tx = () => sy().optional(), rx = {
4668
+ }) => ty((t) => t instanceof r, e), ry = Ms.create, ny = Hi.create, kb = Ko.create, Sb = Fi.create, sy = Ki.create, Ab = Wi.create, Ob = Lo.create, Eb = zi.create, Cb = Gi.create, Ib = Us.create, jb = Hn.create, Tb = Hr.create, Nb = qo.create, Bb = Gn.create, Rb = Kt.create, Pb = Kt.strictCreate, $b = Ji.create, Db = zm.create, Zb = Yi.create, Mb = gn.create, Ub = Ym.create, Vb = Ho.create, Lb = Fo.create, qb = Xm.create, Hb = Xi.create, Fb = Qi.create, Kb = Ja.create, Wb = ea.create, zb = Vs.create, gh = dr.create, Gb = br.create, Jb = vn.create, Yb = dr.createWithPreprocess, Xb = nf.create, Qb = () => ry().optional(), ex = () => ny().optional(), tx = () => sy().optional(), rx = {
4669
4669
  string: (r) => Ms.create({ ...r, coerce: !0 }),
4670
4670
  number: (r) => Hi.create({ ...r, coerce: !0 }),
4671
4671
  boolean: (r) => Ki.create({
@@ -4747,7 +4747,7 @@ var m = /* @__PURE__ */ Object.freeze({
4747
4747
  return fe;
4748
4748
  },
4749
4749
  coerce: rx,
4750
- any: Cb,
4750
+ any: Ib,
4751
4751
  array: Bb,
4752
4752
  bigint: Sb,
4753
4753
  boolean: sy,
@@ -4764,7 +4764,7 @@ var m = /* @__PURE__ */ Object.freeze({
4764
4764
  nan: kb,
4765
4765
  nativeEnum: Wb,
4766
4766
  never: Tb,
4767
- null: Ib,
4767
+ null: Cb,
4768
4768
  nullable: Jb,
4769
4769
  number: ny,
4770
4770
  object: Rb,
@@ -4827,7 +4827,7 @@ var m = /* @__PURE__ */ Object.freeze({
4827
4827
  *)
4828
4828
  */
4829
4829
  ne(this, "openapi", ({ middleware: t, ...n }, s, i = this.defaultHook) => {
4830
- var u, f, y, B, C, p, g, A, O, P;
4830
+ var u, f, y, B, I, p, g, A, O, P;
4831
4831
  this.openAPIRegistry.registerPath(n);
4832
4832
  const a = [];
4833
4833
  if ((u = n.request) != null && u.query) {
@@ -4846,7 +4846,7 @@ var m = /* @__PURE__ */ Object.freeze({
4846
4846
  const N = gs("cookie", n.request.cookies, i);
4847
4847
  a.push(N);
4848
4848
  }
4849
- const o = (p = (C = n.request) == null ? void 0 : C.body) == null ? void 0 : p.content;
4849
+ const o = (p = (I = n.request) == null ? void 0 : I.body) == null ? void 0 : p.content;
4850
4850
  if (o)
4851
4851
  for (const N of Object.keys(o)) {
4852
4852
  if (!o[N])
@@ -5000,20 +5000,20 @@ function ax(r) {
5000
5000
  return;
5001
5001
  r.ZodType.prototype.openapi = function(s, i) {
5002
5002
  var a, o, c, u, f, y;
5003
- const B = typeof s == "string" ? i : s, C = B ?? {}, { param: p } = C, g = sx(C, ["param"]), A = Object.assign(Object.assign({}, (a = this._def.openapi) === null || a === void 0 ? void 0 : a._internal), typeof s == "string" ? { refId: s } : void 0), O = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), g), !((u = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || u === void 0) && u.param || p ? {
5003
+ const B = typeof s == "string" ? i : s, I = B ?? {}, { param: p } = I, g = sx(I, ["param"]), A = Object.assign(Object.assign({}, (a = this._def.openapi) === null || a === void 0 ? void 0 : a._internal), typeof s == "string" ? { refId: s } : void 0), O = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), g), !((u = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || u === void 0) && u.param || p ? {
5004
5004
  param: Object.assign(Object.assign({}, (y = (f = this._def.openapi) === null || f === void 0 ? void 0 : f.metadata) === null || y === void 0 ? void 0 : y.param), p)
5005
5005
  } : void 0), P = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(A).length > 0 ? { _internal: A } : void 0), Object.keys(O).length > 0 ? { metadata: O } : void 0) }));
5006
5006
  if (ix(this, "ZodObject")) {
5007
5007
  const N = this.extend;
5008
5008
  P.extend = function(...xe) {
5009
5009
  var Le, qe, Ze, tt, mt, Rt;
5010
- const I = N.apply(this, xe);
5011
- return I._def.openapi = {
5010
+ const C = N.apply(this, xe);
5011
+ return C._def.openapi = {
5012
5012
  _internal: {
5013
5013
  extendedFrom: !((qe = (Le = this._def.openapi) === null || Le === void 0 ? void 0 : Le._internal) === null || qe === void 0) && qe.refId ? { refId: (tt = (Ze = this._def.openapi) === null || Ze === void 0 ? void 0 : Ze._internal) === null || tt === void 0 ? void 0 : tt.refId, schema: this } : (mt = this._def.openapi) === null || mt === void 0 ? void 0 : mt._internal.extendedFrom
5014
5014
  },
5015
- metadata: (Rt = I._def.openapi) === null || Rt === void 0 ? void 0 : Rt.metadata
5016
- }, I;
5015
+ metadata: (Rt = C._def.openapi) === null || Rt === void 0 ? void 0 : Rt.metadata
5016
+ }, C;
5017
5017
  };
5018
5018
  }
5019
5019
  return P;
@@ -5357,7 +5357,7 @@ var oe;
5357
5357
  (function(r) {
5358
5358
  r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
5359
5359
  })(oe || (oe = {}));
5360
- var Ii, Ci;
5360
+ var Ci, Ii;
5361
5361
  class Sr {
5362
5362
  constructor(e, t, n, s) {
5363
5363
  this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = s;
@@ -7382,7 +7382,7 @@ function ly(r, e) {
7382
7382
  }
7383
7383
  class _n extends Ee {
7384
7384
  constructor() {
7385
- super(...arguments), Ii.set(this, void 0);
7385
+ super(...arguments), Ci.set(this, void 0);
7386
7386
  }
7387
7387
  _parse(e) {
7388
7388
  if (typeof e.data != "string") {
@@ -7393,7 +7393,7 @@ class _n extends Ee {
7393
7393
  code: Z.invalid_type
7394
7394
  }), ve;
7395
7395
  }
7396
- if (Jo(this, Ii) || ay(this, Ii, new Set(this._def.values)), !Jo(this, Ii).has(e.data)) {
7396
+ if (Jo(this, Ci) || ay(this, Ci, new Set(this._def.values)), !Jo(this, Ci).has(e.data)) {
7397
7397
  const t = this._getOrReturnCtx(e), n = this._def.values;
7398
7398
  return F(t, {
7399
7399
  received: t.data,
@@ -7437,11 +7437,11 @@ class _n extends Ee {
7437
7437
  });
7438
7438
  }
7439
7439
  }
7440
- Ii = /* @__PURE__ */ new WeakMap();
7440
+ Ci = /* @__PURE__ */ new WeakMap();
7441
7441
  _n.create = ly;
7442
7442
  class pa extends Ee {
7443
7443
  constructor() {
7444
- super(...arguments), Ci.set(this, void 0);
7444
+ super(...arguments), Ii.set(this, void 0);
7445
7445
  }
7446
7446
  _parse(e) {
7447
7447
  const t = Pe.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
@@ -7453,7 +7453,7 @@ class pa extends Ee {
7453
7453
  code: Z.invalid_type
7454
7454
  }), ve;
7455
7455
  }
7456
- if (Jo(this, Ci) || ay(this, Ci, new Set(Pe.getValidEnumValues(this._def.values))), !Jo(this, Ci).has(e.data)) {
7456
+ if (Jo(this, Ii) || ay(this, Ii, new Set(Pe.getValidEnumValues(this._def.values))), !Jo(this, Ii).has(e.data)) {
7457
7457
  const s = Pe.objectValues(t);
7458
7458
  return F(n, {
7459
7459
  received: n.data,
@@ -7467,7 +7467,7 @@ class pa extends Ee {
7467
7467
  return this._def.values;
7468
7468
  }
7469
7469
  }
7470
- Ci = /* @__PURE__ */ new WeakMap();
7470
+ Ii = /* @__PURE__ */ new WeakMap();
7471
7471
  pa.create = (r, e) => new pa({
7472
7472
  values: r,
7473
7473
  typeName: he.ZodNativeEnum,
@@ -7778,7 +7778,7 @@ var he;
7778
7778
  })(he || (he = {}));
7779
7779
  const Ex = (r, e = {
7780
7780
  message: `Input not instance of ${r.name}`
7781
- }) => dy((t) => t instanceof r, e), fy = sr.create, hy = bn.create, Ix = ec.create, Cx = xn.create, py = aa.create, jx = Jn.create, Tx = Yo.create, Nx = oa.create, Bx = ca.create, Rx = qs.create, Px = Fn.create, $x = Fr.create, Dx = Xo.create, Zx = cr.create, Mx = Je.create, Ux = Je.strictCreate, Vx = ua.create, Lx = Wc.create, qx = la.create, Hx = Ar.create, Fx = da.create, Kx = Qo.create, Wx = Yn.create, zx = js.create, Gx = fa.create, Jx = ha.create, Yx = _n.create, Xx = pa.create, Qx = Hs.create, wh = fr.create, e_ = xr.create, t_ = wn.create, r_ = fr.createWithPreprocess, n_ = Ya.create, s_ = () => fy().optional(), i_ = () => hy().optional(), a_ = () => py().optional(), o_ = {
7781
+ }) => dy((t) => t instanceof r, e), fy = sr.create, hy = bn.create, Cx = ec.create, Ix = xn.create, py = aa.create, jx = Jn.create, Tx = Yo.create, Nx = oa.create, Bx = ca.create, Rx = qs.create, Px = Fn.create, $x = Fr.create, Dx = Xo.create, Zx = cr.create, Mx = Je.create, Ux = Je.strictCreate, Vx = ua.create, Lx = Wc.create, qx = la.create, Hx = Ar.create, Fx = da.create, Kx = Qo.create, Wx = Yn.create, zx = js.create, Gx = fa.create, Jx = ha.create, Yx = _n.create, Xx = pa.create, Qx = Hs.create, wh = fr.create, e_ = xr.create, t_ = wn.create, r_ = fr.createWithPreprocess, n_ = Ya.create, s_ = () => fy().optional(), i_ = () => hy().optional(), a_ = () => py().optional(), o_ = {
7782
7782
  string: (r) => sr.create({ ...r, coerce: !0 }),
7783
7783
  number: (r) => bn.create({ ...r, coerce: !0 }),
7784
7784
  boolean: (r) => aa.create({
@@ -7862,7 +7862,7 @@ var d = /* @__PURE__ */ Object.freeze({
7862
7862
  coerce: o_,
7863
7863
  any: Rx,
7864
7864
  array: Zx,
7865
- bigint: Cx,
7865
+ bigint: Ix,
7866
7866
  boolean: py,
7867
7867
  date: jx,
7868
7868
  discriminatedUnion: Lx,
@@ -7874,7 +7874,7 @@ var d = /* @__PURE__ */ Object.freeze({
7874
7874
  lazy: Gx,
7875
7875
  literal: Jx,
7876
7876
  map: Kx,
7877
- nan: Ix,
7877
+ nan: Cx,
7878
7878
  nativeEnum: Xx,
7879
7879
  never: $x,
7880
7880
  null: Bx,
@@ -8062,21 +8062,7 @@ const p_ = d.object({
8062
8062
  }), El = d.object({
8063
8063
  id: d.string().optional(),
8064
8064
  name: d.string(),
8065
- strategy: d.enum([
8066
- "google-oauth2",
8067
- "facebook",
8068
- "vipps",
8069
- "freja",
8070
- "apple",
8071
- "email",
8072
- "auth0",
8073
- "authhero",
8074
- // This is incorrect as strategy. Remove once data is migrated
8075
- "Username-Password-Authentication",
8076
- "oidc",
8077
- "oauth2",
8078
- "custom"
8079
- ]),
8065
+ strategy: d.string(),
8080
8066
  options: d.object({
8081
8067
  kid: d.string().optional(),
8082
8068
  team_id: d.string().optional(),
@@ -8099,7 +8085,7 @@ const p_ = d.object({
8099
8085
  id: d.string(),
8100
8086
  created_at: d.string().transform((r) => r === null ? "" : r),
8101
8087
  updated_at: d.string().transform((r) => r === null ? "" : r)
8102
- }).extend(El.shape), Il = d.object({
8088
+ }).extend(El.shape), Cl = d.object({
8103
8089
  name: d.string(),
8104
8090
  audience: d.string(),
8105
8091
  sender_email: d.string().email(),
@@ -8113,7 +8099,7 @@ const p_ = d.object({
8113
8099
  created_at: d.string().transform((r) => r === null ? "" : r),
8114
8100
  updated_at: d.string().transform((r) => r === null ? "" : r),
8115
8101
  id: d.string(),
8116
- ...Il.shape
8102
+ ...Cl.shape
8117
8103
  }), bA = d.object({
8118
8104
  logoUrl: d.string(),
8119
8105
  loginBackgroundImage: d.string().nullish(),
@@ -8180,7 +8166,7 @@ const y_ = d.enum([
8180
8166
  }), _A = af.extend({
8181
8167
  ...v_.shape,
8182
8168
  id: d.string()
8183
- }), Cl = d.object({
8169
+ }), Il = d.object({
8184
8170
  trigger_id: d.enum([
8185
8171
  "pre-user-signup",
8186
8172
  "post-user-registration",
@@ -8191,7 +8177,7 @@ const y_ = d.enum([
8191
8177
  hook_id: d.string().optional(),
8192
8178
  synchronous: d.boolean().default(!1),
8193
8179
  priority: d.number().optional()
8194
- }), ji = Cl.extend({
8180
+ }), ji = Il.extend({
8195
8181
  ...af.shape,
8196
8182
  hook_id: d.string()
8197
8183
  }), by = d.object({
@@ -8427,11 +8413,11 @@ const A_ = d.object({
8427
8413
  reference_text_size: d.number(),
8428
8414
  subtitle: bs,
8429
8415
  title: bs
8430
- }), I_ = d.object({
8416
+ }), C_ = d.object({
8431
8417
  background_color: d.string(),
8432
8418
  background_image_url: d.string(),
8433
8419
  page_layout: d.enum(["center"])
8434
- }), C_ = d.object({
8420
+ }), I_ = d.object({
8435
8421
  header_text_alignment: d.enum(["center"]),
8436
8422
  logo_height: d.number(),
8437
8423
  logo_position: d.enum(["center"]),
@@ -8442,8 +8428,8 @@ const A_ = d.object({
8442
8428
  colors: O_,
8443
8429
  displayName: d.string(),
8444
8430
  fonts: E_,
8445
- page_background: I_,
8446
- widget: C_
8431
+ page_background: C_,
8432
+ widget: I_
8447
8433
  }), SA = j_.extend({
8448
8434
  themeId: d.string()
8449
8435
  }), Wu = d.object({
@@ -8592,43 +8578,43 @@ const P_ = {}, $_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
8592
8578
  typeof R_ == "function" && r && r.exports ? r.exports = t() : (e.dcodeIO = e.dcodeIO || {}).bcrypt = t();
8593
8579
  })(tc, function() {
8594
8580
  var e = {}, t = null;
8595
- function n(I) {
8581
+ function n(C) {
8596
8582
  if (r && r.exports)
8597
8583
  try {
8598
- return D_.randomBytes(I);
8584
+ return D_.randomBytes(C);
8599
8585
  } catch {
8600
8586
  }
8601
8587
  try {
8602
8588
  var E;
8603
- return (self.crypto || self.msCrypto).getRandomValues(E = new Uint32Array(I)), Array.prototype.slice.call(E);
8589
+ return (self.crypto || self.msCrypto).getRandomValues(E = new Uint32Array(C)), Array.prototype.slice.call(E);
8604
8590
  } catch {
8605
8591
  }
8606
8592
  if (!t)
8607
8593
  throw Error("Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative");
8608
- return t(I);
8594
+ return t(C);
8609
8595
  }
8610
8596
  var s = !1;
8611
8597
  try {
8612
8598
  n(1), s = !0;
8613
8599
  } catch {
8614
8600
  }
8615
- t = null, e.setRandomFallback = function(I) {
8616
- t = I;
8617
- }, e.genSaltSync = function(I, E) {
8618
- if (I = I || g, typeof I != "number")
8619
- throw Error("Illegal arguments: " + typeof I + ", " + typeof E);
8620
- I < 4 ? I = 4 : I > 31 && (I = 31);
8601
+ t = null, e.setRandomFallback = function(C) {
8602
+ t = C;
8603
+ }, e.genSaltSync = function(C, E) {
8604
+ if (C = C || g, typeof C != "number")
8605
+ throw Error("Illegal arguments: " + typeof C + ", " + typeof E);
8606
+ C < 4 ? C = 4 : C > 31 && (C = 31);
8621
8607
  var k = [];
8622
- return k.push("$2a$"), I < 10 && k.push("0"), k.push(I.toString()), k.push("$"), k.push(y(n(p), p)), k.join("");
8623
- }, e.genSalt = function(I, E, k) {
8624
- if (typeof E == "function" && (k = E, E = void 0), typeof I == "function" && (k = I, I = void 0), typeof I > "u")
8625
- I = g;
8626
- else if (typeof I != "number")
8627
- throw Error("illegal arguments: " + typeof I);
8608
+ return k.push("$2a$"), C < 10 && k.push("0"), k.push(C.toString()), k.push("$"), k.push(y(n(p), p)), k.join("");
8609
+ }, e.genSalt = function(C, E, k) {
8610
+ if (typeof E == "function" && (k = E, E = void 0), typeof C == "function" && (k = C, C = void 0), typeof C > "u")
8611
+ C = g;
8612
+ else if (typeof C != "number")
8613
+ throw Error("illegal arguments: " + typeof C);
8628
8614
  function x(b) {
8629
8615
  a(function() {
8630
8616
  try {
8631
- b(null, e.genSaltSync(I));
8617
+ b(null, e.genSaltSync(C));
8632
8618
  } catch (j) {
8633
8619
  b(j);
8634
8620
  }
@@ -8640,23 +8626,23 @@ const P_ = {}, $_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
8640
8626
  x(k);
8641
8627
  } else
8642
8628
  return new Promise(function(b, j) {
8643
- x(function(U, Ce) {
8629
+ x(function(U, Ie) {
8644
8630
  if (U) {
8645
8631
  j(U);
8646
8632
  return;
8647
8633
  }
8648
- b(Ce);
8634
+ b(Ie);
8649
8635
  });
8650
8636
  });
8651
- }, e.hashSync = function(I, E) {
8652
- if (typeof E > "u" && (E = g), typeof E == "number" && (E = e.genSaltSync(E)), typeof I != "string" || typeof E != "string")
8653
- throw Error("Illegal arguments: " + typeof I + ", " + typeof E);
8654
- return Rt(I, E);
8655
- }, e.hash = function(I, E, k, x) {
8637
+ }, e.hashSync = function(C, E) {
8638
+ if (typeof E > "u" && (E = g), typeof E == "number" && (E = e.genSaltSync(E)), typeof C != "string" || typeof E != "string")
8639
+ throw Error("Illegal arguments: " + typeof C + ", " + typeof E);
8640
+ return Rt(C, E);
8641
+ }, e.hash = function(C, E, k, x) {
8656
8642
  function b(j) {
8657
- typeof I == "string" && typeof E == "number" ? e.genSalt(E, function(U, Ce) {
8658
- Rt(I, Ce, j, x);
8659
- }) : typeof I == "string" && typeof E == "string" ? Rt(I, E, j, x) : a(j.bind(this, Error("Illegal arguments: " + typeof I + ", " + typeof E)));
8643
+ typeof C == "string" && typeof E == "number" ? e.genSalt(E, function(U, Ie) {
8644
+ Rt(C, Ie, j, x);
8645
+ }) : typeof C == "string" && typeof E == "string" ? Rt(C, E, j, x) : a(j.bind(this, Error("Illegal arguments: " + typeof C + ", " + typeof E)));
8660
8646
  }
8661
8647
  if (k) {
8662
8648
  if (typeof k != "function")
@@ -8664,36 +8650,36 @@ const P_ = {}, $_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
8664
8650
  b(k);
8665
8651
  } else
8666
8652
  return new Promise(function(j, U) {
8667
- b(function(Ce, ie) {
8668
- if (Ce) {
8669
- U(Ce);
8653
+ b(function(Ie, ie) {
8654
+ if (Ie) {
8655
+ U(Ie);
8670
8656
  return;
8671
8657
  }
8672
8658
  j(ie);
8673
8659
  });
8674
8660
  });
8675
8661
  };
8676
- function i(I, E) {
8677
- for (var k = 0, x = 0, b = 0, j = I.length; b < j; ++b)
8678
- I.charCodeAt(b) === E.charCodeAt(b) ? ++k : ++x;
8662
+ function i(C, E) {
8663
+ for (var k = 0, x = 0, b = 0, j = C.length; b < j; ++b)
8664
+ C.charCodeAt(b) === E.charCodeAt(b) ? ++k : ++x;
8679
8665
  return k < 0 ? !1 : x === 0;
8680
8666
  }
8681
- e.compareSync = function(I, E) {
8682
- if (typeof I != "string" || typeof E != "string")
8683
- throw Error("Illegal arguments: " + typeof I + ", " + typeof E);
8684
- return E.length !== 60 ? !1 : i(e.hashSync(I, E.substr(0, E.length - 31)), E);
8685
- }, e.compare = function(I, E, k, x) {
8667
+ e.compareSync = function(C, E) {
8668
+ if (typeof C != "string" || typeof E != "string")
8669
+ throw Error("Illegal arguments: " + typeof C + ", " + typeof E);
8670
+ return E.length !== 60 ? !1 : i(e.hashSync(C, E.substr(0, E.length - 31)), E);
8671
+ }, e.compare = function(C, E, k, x) {
8686
8672
  function b(j) {
8687
- if (typeof I != "string" || typeof E != "string") {
8688
- a(j.bind(this, Error("Illegal arguments: " + typeof I + ", " + typeof E)));
8673
+ if (typeof C != "string" || typeof E != "string") {
8674
+ a(j.bind(this, Error("Illegal arguments: " + typeof C + ", " + typeof E)));
8689
8675
  return;
8690
8676
  }
8691
8677
  if (E.length !== 60) {
8692
8678
  a(j.bind(this, null, !1));
8693
8679
  return;
8694
8680
  }
8695
- e.hash(I, E.substr(0, 29), function(U, Ce) {
8696
- U ? j(U) : j(null, i(Ce, E));
8681
+ e.hash(C, E.substr(0, 29), function(U, Ie) {
8682
+ U ? j(U) : j(null, i(Ie, E));
8697
8683
  }, x);
8698
8684
  }
8699
8685
  if (k) {
@@ -8702,30 +8688,30 @@ const P_ = {}, $_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
8702
8688
  b(k);
8703
8689
  } else
8704
8690
  return new Promise(function(j, U) {
8705
- b(function(Ce, ie) {
8706
- if (Ce) {
8707
- U(Ce);
8691
+ b(function(Ie, ie) {
8692
+ if (Ie) {
8693
+ U(Ie);
8708
8694
  return;
8709
8695
  }
8710
8696
  j(ie);
8711
8697
  });
8712
8698
  });
8713
- }, e.getRounds = function(I) {
8714
- if (typeof I != "string")
8715
- throw Error("Illegal arguments: " + typeof I);
8716
- return parseInt(I.split("$")[2], 10);
8717
- }, e.getSalt = function(I) {
8718
- if (typeof I != "string")
8719
- throw Error("Illegal arguments: " + typeof I);
8720
- if (I.length !== 60)
8721
- throw Error("Illegal hash length: " + I.length + " != 60");
8722
- return I.substring(0, 29);
8699
+ }, e.getRounds = function(C) {
8700
+ if (typeof C != "string")
8701
+ throw Error("Illegal arguments: " + typeof C);
8702
+ return parseInt(C.split("$")[2], 10);
8703
+ }, e.getSalt = function(C) {
8704
+ if (typeof C != "string")
8705
+ throw Error("Illegal arguments: " + typeof C);
8706
+ if (C.length !== 60)
8707
+ throw Error("Illegal hash length: " + C.length + " != 60");
8708
+ return C.substring(0, 29);
8723
8709
  };
8724
8710
  var a = typeof process < "u" && process && typeof process.nextTick == "function" ? typeof setImmediate == "function" ? setImmediate : process.nextTick : setTimeout;
8725
- function o(I) {
8711
+ function o(C) {
8726
8712
  var E = [], k = 0;
8727
- return C.encodeUTF16toUTF8(function() {
8728
- return k >= I.length ? null : I.charCodeAt(k++);
8713
+ return I.encodeUTF16toUTF8(function() {
8714
+ return k >= C.length ? null : C.charCodeAt(k++);
8729
8715
  }, function(x) {
8730
8716
  E.push(x);
8731
8717
  }), E;
@@ -8860,44 +8846,44 @@ const P_ = {}, $_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
8860
8846
  -1,
8861
8847
  -1
8862
8848
  ], f = String.fromCharCode;
8863
- function y(I, E) {
8849
+ function y(C, E) {
8864
8850
  var k = 0, x = [], b, j;
8865
- if (E <= 0 || E > I.length)
8851
+ if (E <= 0 || E > C.length)
8866
8852
  throw Error("Illegal len: " + E);
8867
8853
  for (; k < E; ) {
8868
- if (b = I[k++] & 255, x.push(c[b >> 2 & 63]), b = (b & 3) << 4, k >= E) {
8854
+ if (b = C[k++] & 255, x.push(c[b >> 2 & 63]), b = (b & 3) << 4, k >= E) {
8869
8855
  x.push(c[b & 63]);
8870
8856
  break;
8871
8857
  }
8872
- if (j = I[k++] & 255, b |= j >> 4 & 15, x.push(c[b & 63]), b = (j & 15) << 2, k >= E) {
8858
+ if (j = C[k++] & 255, b |= j >> 4 & 15, x.push(c[b & 63]), b = (j & 15) << 2, k >= E) {
8873
8859
  x.push(c[b & 63]);
8874
8860
  break;
8875
8861
  }
8876
- j = I[k++] & 255, b |= j >> 6 & 3, x.push(c[b & 63]), x.push(c[j & 63]);
8862
+ j = C[k++] & 255, b |= j >> 6 & 3, x.push(c[b & 63]), x.push(c[j & 63]);
8877
8863
  }
8878
8864
  return x.join("");
8879
8865
  }
8880
- function B(I, E) {
8881
- var k = 0, x = I.length, b = 0, j = [], U, Ce, ie, Ne, Ue, Q;
8866
+ function B(C, E) {
8867
+ var k = 0, x = C.length, b = 0, j = [], U, Ie, ie, Ne, Ue, Q;
8882
8868
  if (E <= 0)
8883
8869
  throw Error("Illegal len: " + E);
8884
- for (; k < x - 1 && b < E && (Q = I.charCodeAt(k++), U = Q < u.length ? u[Q] : -1, Q = I.charCodeAt(k++), Ce = Q < u.length ? u[Q] : -1, !(U == -1 || Ce == -1 || (Ue = U << 2 >>> 0, Ue |= (Ce & 48) >> 4, j.push(f(Ue)), ++b >= E || k >= x) || (Q = I.charCodeAt(k++), ie = Q < u.length ? u[Q] : -1, ie == -1) || (Ue = (Ce & 15) << 4 >>> 0, Ue |= (ie & 60) >> 2, j.push(f(Ue)), ++b >= E || k >= x))); )
8885
- Q = I.charCodeAt(k++), Ne = Q < u.length ? u[Q] : -1, Ue = (ie & 3) << 6 >>> 0, Ue |= Ne, j.push(f(Ue)), ++b;
8870
+ for (; k < x - 1 && b < E && (Q = C.charCodeAt(k++), U = Q < u.length ? u[Q] : -1, Q = C.charCodeAt(k++), Ie = Q < u.length ? u[Q] : -1, !(U == -1 || Ie == -1 || (Ue = U << 2 >>> 0, Ue |= (Ie & 48) >> 4, j.push(f(Ue)), ++b >= E || k >= x) || (Q = C.charCodeAt(k++), ie = Q < u.length ? u[Q] : -1, ie == -1) || (Ue = (Ie & 15) << 4 >>> 0, Ue |= (ie & 60) >> 2, j.push(f(Ue)), ++b >= E || k >= x))); )
8871
+ Q = C.charCodeAt(k++), Ne = Q < u.length ? u[Q] : -1, Ue = (ie & 3) << 6 >>> 0, Ue |= Ne, j.push(f(Ue)), ++b;
8886
8872
  var ot = [];
8887
8873
  for (k = 0; k < b; k++)
8888
8874
  ot.push(j[k].charCodeAt(0));
8889
8875
  return ot;
8890
8876
  }
8891
- var C = function() {
8892
- var I = {};
8893
- return I.MAX_CODEPOINT = 1114111, I.encodeUTF8 = function(E, k) {
8877
+ var I = function() {
8878
+ var C = {};
8879
+ return C.MAX_CODEPOINT = 1114111, C.encodeUTF8 = function(E, k) {
8894
8880
  var x = null;
8895
8881
  for (typeof E == "number" && (x = E, E = function() {
8896
8882
  return null;
8897
8883
  }); x !== null || (x = E()) !== null; )
8898
8884
  x < 128 ? k(x & 127) : x < 2048 ? (k(x >> 6 & 31 | 192), k(x & 63 | 128)) : x < 65536 ? (k(x >> 12 & 15 | 224), k(x >> 6 & 63 | 128), k(x & 63 | 128)) : (k(x >> 18 & 7 | 240), k(x >> 12 & 63 | 128), k(x >> 6 & 63 | 128), k(x & 63 | 128)), x = null;
8899
- }, I.decodeUTF8 = function(E, k) {
8900
- for (var x, b, j, U, Ce = function(ie) {
8885
+ }, C.decodeUTF8 = function(E, k) {
8886
+ for (var x, b, j, U, Ie = function(ie) {
8901
8887
  ie = ie.slice(0, ie.indexOf(null));
8902
8888
  var Ne = Error(ie.toString());
8903
8889
  throw Ne.name = "TruncatedError", Ne.bytes = ie, Ne;
@@ -8905,13 +8891,13 @@ const P_ = {}, $_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
8905
8891
  if (!(x & 128))
8906
8892
  k(x);
8907
8893
  else if ((x & 224) === 192)
8908
- (b = E()) === null && Ce([x, b]), k((x & 31) << 6 | b & 63);
8894
+ (b = E()) === null && Ie([x, b]), k((x & 31) << 6 | b & 63);
8909
8895
  else if ((x & 240) === 224)
8910
- ((b = E()) === null || (j = E()) === null) && Ce([x, b, j]), k((x & 15) << 12 | (b & 63) << 6 | j & 63);
8896
+ ((b = E()) === null || (j = E()) === null) && Ie([x, b, j]), k((x & 15) << 12 | (b & 63) << 6 | j & 63);
8911
8897
  else if ((x & 248) === 240)
8912
- ((b = E()) === null || (j = E()) === null || (U = E()) === null) && Ce([x, b, j, U]), k((x & 7) << 18 | (b & 63) << 12 | (j & 63) << 6 | U & 63);
8898
+ ((b = E()) === null || (j = E()) === null || (U = E()) === null) && Ie([x, b, j, U]), k((x & 7) << 18 | (b & 63) << 12 | (j & 63) << 6 | U & 63);
8913
8899
  else throw RangeError("Illegal starting byte: " + x);
8914
- }, I.UTF16toUTF8 = function(E, k) {
8900
+ }, C.UTF16toUTF8 = function(E, k) {
8915
8901
  for (var x, b = null; (x = b !== null ? b : E()) !== null; ) {
8916
8902
  if (x >= 55296 && x <= 57343 && (b = E()) !== null && b >= 56320 && b <= 57343) {
8917
8903
  k((x - 55296) * 1024 + b - 56320 + 65536), b = null;
@@ -8920,32 +8906,32 @@ const P_ = {}, $_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
8920
8906
  k(x);
8921
8907
  }
8922
8908
  b !== null && k(b);
8923
- }, I.UTF8toUTF16 = function(E, k) {
8909
+ }, C.UTF8toUTF16 = function(E, k) {
8924
8910
  var x = null;
8925
8911
  for (typeof E == "number" && (x = E, E = function() {
8926
8912
  return null;
8927
8913
  }); x !== null || (x = E()) !== null; )
8928
8914
  x <= 65535 ? k(x) : (x -= 65536, k((x >> 10) + 55296), k(x % 1024 + 56320)), x = null;
8929
- }, I.encodeUTF16toUTF8 = function(E, k) {
8930
- I.UTF16toUTF8(E, function(x) {
8931
- I.encodeUTF8(x, k);
8915
+ }, C.encodeUTF16toUTF8 = function(E, k) {
8916
+ C.UTF16toUTF8(E, function(x) {
8917
+ C.encodeUTF8(x, k);
8932
8918
  });
8933
- }, I.decodeUTF8toUTF16 = function(E, k) {
8934
- I.decodeUTF8(E, function(x) {
8935
- I.UTF8toUTF16(x, k);
8919
+ }, C.decodeUTF8toUTF16 = function(E, k) {
8920
+ C.decodeUTF8(E, function(x) {
8921
+ C.UTF8toUTF16(x, k);
8936
8922
  });
8937
- }, I.calculateCodePoint = function(E) {
8923
+ }, C.calculateCodePoint = function(E) {
8938
8924
  return E < 128 ? 1 : E < 2048 ? 2 : E < 65536 ? 3 : 4;
8939
- }, I.calculateUTF8 = function(E) {
8925
+ }, C.calculateUTF8 = function(E) {
8940
8926
  for (var k, x = 0; (k = E()) !== null; )
8941
- x += I.calculateCodePoint(k);
8927
+ x += C.calculateCodePoint(k);
8942
8928
  return x;
8943
- }, I.calculateUTF16asUTF8 = function(E) {
8929
+ }, C.calculateUTF16asUTF8 = function(E) {
8944
8930
  var k = 0, x = 0;
8945
- return I.UTF16toUTF8(E, function(b) {
8946
- ++k, x += I.calculateCodePoint(b);
8931
+ return C.UTF16toUTF8(E, function(b) {
8932
+ ++k, x += C.calculateCodePoint(b);
8947
8933
  }), [k, x];
8948
- }, I;
8934
+ }, C;
8949
8935
  }();
8950
8936
  Date.now = Date.now || function() {
8951
8937
  return +/* @__PURE__ */ new Date();
@@ -10002,51 +9988,51 @@ const P_ = {}, $_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
10002
9988
  1668446532,
10003
9989
  1869963892
10004
9990
  ];
10005
- function Le(I, E, k, x) {
10006
- var b, j = I[E], U = I[E + 1];
10007
- return j ^= k[0], b = x[j >>> 24], b += x[256 | j >> 16 & 255], b ^= x[512 | j >> 8 & 255], b += x[768 | j & 255], U ^= b ^ k[1], b = x[U >>> 24], b += x[256 | U >> 16 & 255], b ^= x[512 | U >> 8 & 255], b += x[768 | U & 255], j ^= b ^ k[2], b = x[j >>> 24], b += x[256 | j >> 16 & 255], b ^= x[512 | j >> 8 & 255], b += x[768 | j & 255], U ^= b ^ k[3], b = x[U >>> 24], b += x[256 | U >> 16 & 255], b ^= x[512 | U >> 8 & 255], b += x[768 | U & 255], j ^= b ^ k[4], b = x[j >>> 24], b += x[256 | j >> 16 & 255], b ^= x[512 | j >> 8 & 255], b += x[768 | j & 255], U ^= b ^ k[5], b = x[U >>> 24], b += x[256 | U >> 16 & 255], b ^= x[512 | U >> 8 & 255], b += x[768 | U & 255], j ^= b ^ k[6], b = x[j >>> 24], b += x[256 | j >> 16 & 255], b ^= x[512 | j >> 8 & 255], b += x[768 | j & 255], U ^= b ^ k[7], b = x[U >>> 24], b += x[256 | U >> 16 & 255], b ^= x[512 | U >> 8 & 255], b += x[768 | U & 255], j ^= b ^ k[8], b = x[j >>> 24], b += x[256 | j >> 16 & 255], b ^= x[512 | j >> 8 & 255], b += x[768 | j & 255], U ^= b ^ k[9], b = x[U >>> 24], b += x[256 | U >> 16 & 255], b ^= x[512 | U >> 8 & 255], b += x[768 | U & 255], j ^= b ^ k[10], b = x[j >>> 24], b += x[256 | j >> 16 & 255], b ^= x[512 | j >> 8 & 255], b += x[768 | j & 255], U ^= b ^ k[11], b = x[U >>> 24], b += x[256 | U >> 16 & 255], b ^= x[512 | U >> 8 & 255], b += x[768 | U & 255], j ^= b ^ k[12], b = x[j >>> 24], b += x[256 | j >> 16 & 255], b ^= x[512 | j >> 8 & 255], b += x[768 | j & 255], U ^= b ^ k[13], b = x[U >>> 24], b += x[256 | U >> 16 & 255], b ^= x[512 | U >> 8 & 255], b += x[768 | U & 255], j ^= b ^ k[14], b = x[j >>> 24], b += x[256 | j >> 16 & 255], b ^= x[512 | j >> 8 & 255], b += x[768 | j & 255], U ^= b ^ k[15], b = x[U >>> 24], b += x[256 | U >> 16 & 255], b ^= x[512 | U >> 8 & 255], b += x[768 | U & 255], j ^= b ^ k[16], I[E] = U ^ k[A + 1], I[E + 1] = j, I;
9991
+ function Le(C, E, k, x) {
9992
+ var b, j = C[E], U = C[E + 1];
9993
+ return j ^= k[0], b = x[j >>> 24], b += x[256 | j >> 16 & 255], b ^= x[512 | j >> 8 & 255], b += x[768 | j & 255], U ^= b ^ k[1], b = x[U >>> 24], b += x[256 | U >> 16 & 255], b ^= x[512 | U >> 8 & 255], b += x[768 | U & 255], j ^= b ^ k[2], b = x[j >>> 24], b += x[256 | j >> 16 & 255], b ^= x[512 | j >> 8 & 255], b += x[768 | j & 255], U ^= b ^ k[3], b = x[U >>> 24], b += x[256 | U >> 16 & 255], b ^= x[512 | U >> 8 & 255], b += x[768 | U & 255], j ^= b ^ k[4], b = x[j >>> 24], b += x[256 | j >> 16 & 255], b ^= x[512 | j >> 8 & 255], b += x[768 | j & 255], U ^= b ^ k[5], b = x[U >>> 24], b += x[256 | U >> 16 & 255], b ^= x[512 | U >> 8 & 255], b += x[768 | U & 255], j ^= b ^ k[6], b = x[j >>> 24], b += x[256 | j >> 16 & 255], b ^= x[512 | j >> 8 & 255], b += x[768 | j & 255], U ^= b ^ k[7], b = x[U >>> 24], b += x[256 | U >> 16 & 255], b ^= x[512 | U >> 8 & 255], b += x[768 | U & 255], j ^= b ^ k[8], b = x[j >>> 24], b += x[256 | j >> 16 & 255], b ^= x[512 | j >> 8 & 255], b += x[768 | j & 255], U ^= b ^ k[9], b = x[U >>> 24], b += x[256 | U >> 16 & 255], b ^= x[512 | U >> 8 & 255], b += x[768 | U & 255], j ^= b ^ k[10], b = x[j >>> 24], b += x[256 | j >> 16 & 255], b ^= x[512 | j >> 8 & 255], b += x[768 | j & 255], U ^= b ^ k[11], b = x[U >>> 24], b += x[256 | U >> 16 & 255], b ^= x[512 | U >> 8 & 255], b += x[768 | U & 255], j ^= b ^ k[12], b = x[j >>> 24], b += x[256 | j >> 16 & 255], b ^= x[512 | j >> 8 & 255], b += x[768 | j & 255], U ^= b ^ k[13], b = x[U >>> 24], b += x[256 | U >> 16 & 255], b ^= x[512 | U >> 8 & 255], b += x[768 | U & 255], j ^= b ^ k[14], b = x[j >>> 24], b += x[256 | j >> 16 & 255], b ^= x[512 | j >> 8 & 255], b += x[768 | j & 255], U ^= b ^ k[15], b = x[U >>> 24], b += x[256 | U >> 16 & 255], b ^= x[512 | U >> 8 & 255], b += x[768 | U & 255], j ^= b ^ k[16], C[E] = U ^ k[A + 1], C[E + 1] = j, C;
10008
9994
  }
10009
- function qe(I, E) {
9995
+ function qe(C, E) {
10010
9996
  for (var k = 0, x = 0; k < 4; ++k)
10011
- x = x << 8 | I[E] & 255, E = (E + 1) % I.length;
9997
+ x = x << 8 | C[E] & 255, E = (E + 1) % C.length;
10012
9998
  return { key: x, offp: E };
10013
9999
  }
10014
- function Ze(I, E, k) {
10015
- for (var x = 0, b = [0, 0], j = E.length, U = k.length, Ce, ie = 0; ie < j; ie++)
10016
- Ce = qe(I, x), x = Ce.offp, E[ie] = E[ie] ^ Ce.key;
10000
+ function Ze(C, E, k) {
10001
+ for (var x = 0, b = [0, 0], j = E.length, U = k.length, Ie, ie = 0; ie < j; ie++)
10002
+ Ie = qe(C, x), x = Ie.offp, E[ie] = E[ie] ^ Ie.key;
10017
10003
  for (ie = 0; ie < j; ie += 2)
10018
10004
  b = Le(b, 0, E, k), E[ie] = b[0], E[ie + 1] = b[1];
10019
10005
  for (ie = 0; ie < U; ie += 2)
10020
10006
  b = Le(b, 0, E, k), k[ie] = b[0], k[ie + 1] = b[1];
10021
10007
  }
10022
- function tt(I, E, k, x) {
10023
- for (var b = 0, j = [0, 0], U = k.length, Ce = x.length, ie, Ne = 0; Ne < U; Ne++)
10008
+ function tt(C, E, k, x) {
10009
+ for (var b = 0, j = [0, 0], U = k.length, Ie = x.length, ie, Ne = 0; Ne < U; Ne++)
10024
10010
  ie = qe(E, b), b = ie.offp, k[Ne] = k[Ne] ^ ie.key;
10025
10011
  for (b = 0, Ne = 0; Ne < U; Ne += 2)
10026
- ie = qe(I, b), b = ie.offp, j[0] ^= ie.key, ie = qe(I, b), b = ie.offp, j[1] ^= ie.key, j = Le(j, 0, k, x), k[Ne] = j[0], k[Ne + 1] = j[1];
10027
- for (Ne = 0; Ne < Ce; Ne += 2)
10028
- ie = qe(I, b), b = ie.offp, j[0] ^= ie.key, ie = qe(I, b), b = ie.offp, j[1] ^= ie.key, j = Le(j, 0, k, x), x[Ne] = j[0], x[Ne + 1] = j[1];
10012
+ ie = qe(C, b), b = ie.offp, j[0] ^= ie.key, ie = qe(C, b), b = ie.offp, j[1] ^= ie.key, j = Le(j, 0, k, x), k[Ne] = j[0], k[Ne + 1] = j[1];
10013
+ for (Ne = 0; Ne < Ie; Ne += 2)
10014
+ ie = qe(C, b), b = ie.offp, j[0] ^= ie.key, ie = qe(C, b), b = ie.offp, j[1] ^= ie.key, j = Le(j, 0, k, x), x[Ne] = j[0], x[Ne + 1] = j[1];
10029
10015
  }
10030
- function mt(I, E, k, x, b) {
10031
- var j = xe.slice(), U = j.length, Ce;
10016
+ function mt(C, E, k, x, b) {
10017
+ var j = xe.slice(), U = j.length, Ie;
10032
10018
  if (k < 4 || k > 31)
10033
- if (Ce = Error("Illegal number of rounds (4-31): " + k), x) {
10034
- a(x.bind(this, Ce));
10019
+ if (Ie = Error("Illegal number of rounds (4-31): " + k), x) {
10020
+ a(x.bind(this, Ie));
10035
10021
  return;
10036
10022
  } else
10037
- throw Ce;
10023
+ throw Ie;
10038
10024
  if (E.length !== p)
10039
- if (Ce = Error("Illegal salt length: " + E.length + " != " + p), x) {
10040
- a(x.bind(this, Ce));
10025
+ if (Ie = Error("Illegal salt length: " + E.length + " != " + p), x) {
10026
+ a(x.bind(this, Ie));
10041
10027
  return;
10042
10028
  } else
10043
- throw Ce;
10029
+ throw Ie;
10044
10030
  k = 1 << k >>> 0;
10045
10031
  var ie, Ne, Ue = 0, Q;
10046
- Int32Array ? (ie = new Int32Array(P), Ne = new Int32Array(N)) : (ie = P.slice(), Ne = N.slice()), tt(E, I, ie, Ne);
10032
+ Int32Array ? (ie = new Int32Array(P), Ne = new Int32Array(N)) : (ie = P.slice(), Ne = N.slice()), tt(E, C, ie, Ne);
10047
10033
  function ot() {
10048
10034
  if (b && b(Ue / k), Ue < k)
10049
- for (var He = Date.now(); Ue < k && (Ue = Ue + 1, Ze(I, ie, Ne), Ze(E, ie, Ne), !(Date.now() - He > O)); )
10035
+ for (var He = Date.now(); Ue < k && (Ue = Ue + 1, Ze(C, ie, Ne), Ze(E, ie, Ne), !(Date.now() - He > O)); )
10050
10036
  ;
10051
10037
  else {
10052
10038
  for (Ue = 0; Ue < 64; Ue++)
@@ -10070,9 +10056,9 @@ const P_ = {}, $_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
10070
10056
  if (typeof (Bn = ot()) < "u")
10071
10057
  return Bn || [];
10072
10058
  }
10073
- function Rt(I, E, k, x) {
10059
+ function Rt(C, E, k, x) {
10074
10060
  var b;
10075
- if (typeof I != "string" || typeof E != "string")
10061
+ if (typeof C != "string" || typeof E != "string")
10076
10062
  if (b = Error("Invalid string / salt: Not a string"), k) {
10077
10063
  a(k.bind(this, b));
10078
10064
  return;
@@ -10102,9 +10088,9 @@ const P_ = {}, $_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
10102
10088
  return;
10103
10089
  } else
10104
10090
  throw b;
10105
- var Ce = parseInt(E.substring(U, U + 1), 10) * 10, ie = parseInt(E.substring(U + 1, U + 2), 10), Ne = Ce + ie, Ue = E.substring(U + 3, U + 25);
10106
- I += j >= "a" ? "\0" : "";
10107
- var Q = o(I), ot = B(Ue, p);
10091
+ var Ie = parseInt(E.substring(U, U + 1), 10) * 10, ie = parseInt(E.substring(U + 1, U + 2), 10), Ne = Ie + ie, Ue = E.substring(U + 3, U + 25);
10092
+ C += j >= "a" ? "\0" : "";
10093
+ var Q = o(C), ot = B(Ue, p);
10108
10094
  function Bn(He) {
10109
10095
  var rt = [];
10110
10096
  return rt.push("$2"), j >= "a" && rt.push(j), rt.push("$"), Ne < 10 && rt.push("0"), rt.push(Ne.toString()), rt.push("$"), rt.push(y(ot, ot.length)), rt.push(y(He, xe.length * 4 - 1)), rt.join("");
@@ -10299,17 +10285,17 @@ const Eh = hs.extend({
10299
10285
  per_page: t,
10300
10286
  include_totals: n,
10301
10287
  q: `email:${f}`
10302
- })).users.filter((g) => g.linked_to), [C] = B;
10303
- if (!C)
10288
+ })).users.filter((g) => g.linked_to), [I] = B;
10289
+ if (!I)
10304
10290
  return r.json([]);
10305
10291
  const p = await r.env.data.users.get(
10306
10292
  a,
10307
10293
  // we know linked_to is truthy here but typescript cannot read .filter() logic above
10308
10294
  // possible to fix!
10309
- C.linked_to
10295
+ I.linked_to
10310
10296
  );
10311
10297
  if (!p)
10312
- throw new de(500, {
10298
+ throw new le(500, {
10313
10299
  message: "Primary account not found"
10314
10300
  });
10315
10301
  return r.json([Br.parse(p)]);
@@ -10364,9 +10350,9 @@ const Eh = hs.extend({
10364
10350
  async (r) => {
10365
10351
  const { user_id: e } = r.req.valid("param"), { "tenant-id": t } = r.req.valid("header"), n = await r.env.data.users.get(t, e);
10366
10352
  if (!n)
10367
- throw new de(404);
10353
+ throw new le(404);
10368
10354
  if (n.linked_to)
10369
- throw new de(404, {
10355
+ throw new le(404, {
10370
10356
  message: "User is linked to another user"
10371
10357
  });
10372
10358
  return r.json(n);
@@ -10398,7 +10384,7 @@ const Eh = hs.extend({
10398
10384
  async (r) => {
10399
10385
  const { user_id: e } = r.req.valid("param"), { "tenant-id": t } = r.req.valid("header");
10400
10386
  if (!await r.env.data.users.remove(t, e))
10401
- throw new de(404);
10387
+ throw new le(404);
10402
10388
  return r.text("OK");
10403
10389
  }
10404
10390
  ).openapi(
@@ -10439,7 +10425,7 @@ const Eh = hs.extend({
10439
10425
  r.set("body", t);
10440
10426
  const { email: n } = t;
10441
10427
  if (!n)
10442
- throw new de(400, { message: "Email is required" });
10428
+ throw new le(400, { message: "Email is required" });
10443
10429
  const s = n.toLowerCase(), i = `${t.provider}|${t.user_id || F_()}`;
10444
10430
  try {
10445
10431
  const a = await r.env.data.users.create(e, {
@@ -10479,7 +10465,7 @@ const Eh = hs.extend({
10479
10465
  status: 201
10480
10466
  });
10481
10467
  } catch (a) {
10482
- throw a.message === "User already exists" ? new de(409, {
10468
+ throw a.message === "User already exists" ? new le(409, {
10483
10469
  message: "User already exists"
10484
10470
  }) : a;
10485
10471
  }
@@ -10523,7 +10509,7 @@ const Eh = hs.extend({
10523
10509
  var u;
10524
10510
  const { "tenant-id": e } = r.req.valid("header"), t = r.req.valid("json"), { user_id: n } = r.req.valid("param"), { verify_email: s, password: i, ...a } = t, o = await r.env.data.users.get(e, n);
10525
10511
  if (!o)
10526
- throw new de(404);
10512
+ throw new le(404);
10527
10513
  if (a.email && a.email !== o.email) {
10528
10514
  const f = await wy(
10529
10515
  r.env.data.users,
@@ -10531,12 +10517,12 @@ const Eh = hs.extend({
10531
10517
  a.email
10532
10518
  );
10533
10519
  if (f.length && f.some((y) => y.user_id !== n))
10534
- throw new de(409, {
10520
+ throw new le(409, {
10535
10521
  message: "Another user with the same email address already exists."
10536
10522
  });
10537
10523
  }
10538
10524
  if (o.linked_to)
10539
- throw new de(404, {
10525
+ throw new le(404, {
10540
10526
  // not the auth0 error message but I'd rather deviate here
10541
10527
  message: "User is linked to another user"
10542
10528
  });
@@ -10545,7 +10531,7 @@ const Eh = hs.extend({
10545
10531
  (y) => y.connection === "Username-Password-Authentication"
10546
10532
  );
10547
10533
  if (!f)
10548
- throw new de(400, {
10534
+ throw new le(400, {
10549
10535
  message: "User does not have a password identity"
10550
10536
  });
10551
10537
  await r.env.data.passwords.update(e, {
@@ -10556,7 +10542,7 @@ const Eh = hs.extend({
10556
10542
  }
10557
10543
  const c = await r.env.data.users.get(e, n);
10558
10544
  if (!c)
10559
- throw new de(500);
10545
+ throw new le(500);
10560
10546
  return r.json(c);
10561
10547
  }
10562
10548
  ).openapi(
@@ -10612,7 +10598,7 @@ const Eh = hs.extend({
10612
10598
  async (r) => {
10613
10599
  const { "tenant-id": e } = r.req.valid("header"), t = r.req.valid("json"), { user_id: n } = r.req.valid("param"), s = "link_with" in t ? t.link_with : t.user_id, i = await r.env.data.users.get(e, n);
10614
10600
  if (!i)
10615
- throw new de(400, {
10601
+ throw new le(400, {
10616
10602
  message: "Linking an inexistent identity is not allowed."
10617
10603
  });
10618
10604
  await r.env.data.users.update(e, s, {
@@ -10672,7 +10658,7 @@ const Eh = hs.extend({
10672
10658
  );
10673
10659
  const i = await r.env.data.users.get(e, t);
10674
10660
  if (!i)
10675
- throw new de(404);
10661
+ throw new le(404);
10676
10662
  return r.json([Br.parse(i)]);
10677
10663
  }
10678
10664
  ).openapi(
@@ -10732,7 +10718,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
10732
10718
  See the Apache Version 2.0 License for specific language governing permissions
10733
10719
  and limitations under the License.
10734
10720
  ***************************************************************************** */
10735
- var Ih;
10721
+ var Ch;
10736
10722
  (function(r) {
10737
10723
  (function(e) {
10738
10724
  var t = typeof globalThis == "object" ? globalThis : typeof tc == "object" ? tc : typeof self == "object" ? self : typeof this == "object" ? this : o(), n = s(r);
@@ -10777,7 +10763,7 @@ var Ih;
10777
10763
  } : function(_, S) {
10778
10764
  return _[S];
10779
10765
  }
10780
- }, y = Object.getPrototypeOf(Function), B = typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map : M0(), C = typeof Set == "function" && typeof Set.prototype.entries == "function" ? Set : U0(), p = typeof WeakMap == "function" ? WeakMap : V0(), g = s ? Symbol.for("@reflect-metadata:registry") : void 0, A = $0(), O = D0(A);
10766
+ }, y = Object.getPrototypeOf(Function), B = typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map : M0(), I = typeof Set == "function" && typeof Set.prototype.entries == "function" ? Set : U0(), p = typeof WeakMap == "function" ? WeakMap : V0(), g = s ? Symbol.for("@reflect-metadata:registry") : void 0, A = $0(), O = D0(A);
10781
10767
  function P(_, S, T, V) {
10782
10768
  if (Q(T)) {
10783
10769
  if (!th(_))
@@ -10797,12 +10783,12 @@ var Ih;
10797
10783
  }
10798
10784
  e("decorate", P);
10799
10785
  function N(_, S) {
10800
- function T(V, le) {
10786
+ function T(V, de) {
10801
10787
  if (!He(V))
10802
10788
  throw new TypeError();
10803
- if (!Q(le) && !R0(le))
10789
+ if (!Q(de) && !R0(de))
10804
10790
  throw new TypeError();
10805
- Ce(_, S, V, le);
10791
+ Ie(_, S, V, de);
10806
10792
  }
10807
10793
  return T;
10808
10794
  }
@@ -10810,7 +10796,7 @@ var Ih;
10810
10796
  function xe(_, S, T, V) {
10811
10797
  if (!He(T))
10812
10798
  throw new TypeError();
10813
- return Q(V) || (V = yr(V)), Ce(_, S, T, V);
10799
+ return Q(V) || (V = yr(V)), Ie(_, S, T, V);
10814
10800
  }
10815
10801
  e("defineMetadata", xe);
10816
10802
  function Le(_, S, T) {
@@ -10849,7 +10835,7 @@ var Ih;
10849
10835
  return Q(S) || (S = yr(S)), Ne(_, S);
10850
10836
  }
10851
10837
  e("getOwnMetadataKeys", Rt);
10852
- function I(_, S, T) {
10838
+ function C(_, S, T) {
10853
10839
  if (!He(S))
10854
10840
  throw new TypeError();
10855
10841
  if (Q(T) || (T = yr(T)), !He(S))
@@ -10863,21 +10849,21 @@ var Ih;
10863
10849
  );
10864
10850
  return Q(V) ? !1 : V.OrdinaryDeleteMetadata(_, S, T);
10865
10851
  }
10866
- e("deleteMetadata", I);
10852
+ e("deleteMetadata", C);
10867
10853
  function E(_, S) {
10868
10854
  for (var T = _.length - 1; T >= 0; --T) {
10869
- var V = _[T], le = V(S);
10870
- if (!Q(le) && !ot(le)) {
10871
- if (!rh(le))
10855
+ var V = _[T], de = V(S);
10856
+ if (!Q(de) && !ot(de)) {
10857
+ if (!rh(de))
10872
10858
  throw new TypeError();
10873
- S = le;
10859
+ S = de;
10874
10860
  }
10875
10861
  }
10876
10862
  return S;
10877
10863
  }
10878
10864
  function k(_, S, T, V) {
10879
- for (var le = _.length - 1; le >= 0; --le) {
10880
- var ct = _[le], nt = ct(S, T, V);
10865
+ for (var de = _.length - 1; de >= 0; --de) {
10866
+ var ct = _[de], nt = ct(S, T, V);
10881
10867
  if (!Q(nt) && !ot(nt)) {
10882
10868
  if (!He(nt))
10883
10869
  throw new TypeError();
@@ -10890,8 +10876,8 @@ var Ih;
10890
10876
  var V = b(_, S, T);
10891
10877
  if (V)
10892
10878
  return !0;
10893
- var le = Uu(S);
10894
- return ot(le) ? !1 : x(_, le, T);
10879
+ var de = Uu(S);
10880
+ return ot(de) ? !1 : x(_, de, T);
10895
10881
  }
10896
10882
  function b(_, S, T) {
10897
10883
  var V = gi(
@@ -10906,9 +10892,9 @@ var Ih;
10906
10892
  var V = b(_, S, T);
10907
10893
  if (V)
10908
10894
  return U(_, S, T);
10909
- var le = Uu(S);
10910
- if (!ot(le))
10911
- return j(_, le, T);
10895
+ var de = Uu(S);
10896
+ if (!ot(de))
10897
+ return j(_, de, T);
10912
10898
  }
10913
10899
  function U(_, S, T) {
10914
10900
  var V = gi(
@@ -10920,29 +10906,29 @@ var Ih;
10920
10906
  if (!Q(V))
10921
10907
  return V.OrdinaryGetOwnMetadata(_, S, T);
10922
10908
  }
10923
- function Ce(_, S, T, V) {
10924
- var le = gi(
10909
+ function Ie(_, S, T, V) {
10910
+ var de = gi(
10925
10911
  T,
10926
10912
  V,
10927
10913
  /*Create*/
10928
10914
  !0
10929
10915
  );
10930
- le.OrdinaryDefineOwnMetadata(_, S, T, V);
10916
+ de.OrdinaryDefineOwnMetadata(_, S, T, V);
10931
10917
  }
10932
10918
  function ie(_, S) {
10933
10919
  var T = Ne(_, S), V = Uu(_);
10934
10920
  if (V === null)
10935
10921
  return T;
10936
- var le = ie(V, S);
10937
- if (le.length <= 0)
10922
+ var de = ie(V, S);
10923
+ if (de.length <= 0)
10938
10924
  return T;
10939
10925
  if (T.length <= 0)
10940
- return le;
10941
- for (var ct = new C(), nt = [], je = 0, W = T; je < W.length; je++) {
10926
+ return de;
10927
+ for (var ct = new I(), nt = [], je = 0, W = T; je < W.length; je++) {
10942
10928
  var ee = W[je], re = ct.has(ee);
10943
10929
  re || (ct.add(ee), nt.push(ee));
10944
10930
  }
10945
- for (var se = 0, Be = le; se < Be.length; se++) {
10931
+ for (var se = 0, Be = de; se < Be.length; se++) {
10946
10932
  var ee = Be[se], re = ct.has(ee);
10947
10933
  re || (ct.add(ee), nt.push(ee));
10948
10934
  }
@@ -11006,19 +10992,19 @@ var Ih;
11006
10992
  }
11007
10993
  var T = "string", V = nh(_, i);
11008
10994
  if (V !== void 0) {
11009
- var le = V.call(_, T);
11010
- if (He(le))
10995
+ var de = V.call(_, T);
10996
+ if (He(de))
11011
10997
  throw new TypeError();
11012
- return le;
10998
+ return de;
11013
10999
  }
11014
11000
  return N0(_);
11015
11001
  }
11016
11002
  function N0(_, S) {
11017
11003
  var T, V;
11018
11004
  {
11019
- var le = _.toString;
11020
- if (vo(le)) {
11021
- var V = le.call(_);
11005
+ var de = _.toString;
11006
+ if (vo(de)) {
11007
+ var V = de.call(_);
11022
11008
  if (!He(V))
11023
11009
  return V;
11024
11010
  }
@@ -11098,13 +11084,13 @@ var Ih;
11098
11084
  var T = _.prototype, V = T && Object.getPrototypeOf(T);
11099
11085
  if (V == null || V === Object.prototype)
11100
11086
  return S;
11101
- var le = V.constructor;
11102
- return typeof le != "function" || le === _ ? S : le;
11087
+ var de = V.constructor;
11088
+ return typeof de != "function" || de === _ ? S : de;
11103
11089
  }
11104
11090
  function P0() {
11105
11091
  var _;
11106
11092
  !Q(g) && typeof t.Reflect < "u" && !(g in t.Reflect) && typeof t.Reflect.defineMetadata == "function" && (_ = Z0(t.Reflect));
11107
- var S, T, V, le = new p(), ct = {
11093
+ var S, T, V, de = new p(), ct = {
11108
11094
  registerProvider: nt,
11109
11095
  getProvider: W,
11110
11096
  setProvider: re
@@ -11127,7 +11113,7 @@ var Ih;
11127
11113
  case T === se:
11128
11114
  break;
11129
11115
  default:
11130
- V === void 0 && (V = new C()), V.add(se);
11116
+ V === void 0 && (V = new I()), V.add(se);
11131
11117
  break;
11132
11118
  }
11133
11119
  }
@@ -11153,8 +11139,8 @@ var Ih;
11153
11139
  return _;
11154
11140
  }
11155
11141
  function W(se, Be) {
11156
- var Fe = le.get(se), Xe;
11157
- return Q(Fe) || (Xe = Fe.get(Be)), Q(Xe) && (Xe = je(se, Be), Q(Xe) || (Q(Fe) && (Fe = new B(), le.set(se, Fe)), Fe.set(Be, Xe))), Xe;
11142
+ var Fe = de.get(se), Xe;
11143
+ return Q(Fe) || (Xe = Fe.get(Be)), Q(Xe) && (Xe = je(se, Be), Q(Xe) || (Q(Fe) && (Fe = new B(), de.set(se, Fe)), Fe.set(Be, Xe))), Xe;
11158
11144
  }
11159
11145
  function ee(se) {
11160
11146
  if (Q(se))
@@ -11168,8 +11154,8 @@ var Ih;
11168
11154
  if (Xe !== Fe) {
11169
11155
  if (!Q(Xe))
11170
11156
  return !1;
11171
- var Yt = le.get(se);
11172
- Q(Yt) && (Yt = new B(), le.set(se, Yt)), Yt.set(Be, Fe);
11157
+ var Yt = de.get(se);
11158
+ Q(Yt) && (Yt = new B(), de.set(se, Yt)), Yt.set(Be, Fe);
11173
11159
  }
11174
11160
  return !0;
11175
11161
  }
@@ -11190,7 +11176,7 @@ var Ih;
11190
11176
  return Q(se) ? !1 : se.has(re);
11191
11177
  },
11192
11178
  OrdinaryDefineOwnMetadata: nt,
11193
- OrdinaryHasOwnMetadata: le,
11179
+ OrdinaryHasOwnMetadata: de,
11194
11180
  OrdinaryGetOwnMetadata: ct,
11195
11181
  OrdinaryOwnMetadataKeys: je,
11196
11182
  OrdinaryDeleteMetadata: W
@@ -11212,7 +11198,7 @@ var Ih;
11212
11198
  }
11213
11199
  return Xe;
11214
11200
  }
11215
- function le(ee, re, se) {
11201
+ function de(ee, re, se) {
11216
11202
  var Be = V(
11217
11203
  re,
11218
11204
  se,
@@ -11283,15 +11269,15 @@ var Ih;
11283
11269
  }
11284
11270
  }
11285
11271
  function Z0(_) {
11286
- var S = _.defineMetadata, T = _.hasOwnMetadata, V = _.getOwnMetadata, le = _.getOwnMetadataKeys, ct = _.deleteMetadata, nt = new p(), je = {
11272
+ var S = _.defineMetadata, T = _.hasOwnMetadata, V = _.getOwnMetadata, de = _.getOwnMetadataKeys, ct = _.deleteMetadata, nt = new p(), je = {
11287
11273
  isProviderFor: function(W, ee) {
11288
11274
  var re = nt.get(W);
11289
- return !Q(re) && re.has(ee) ? !0 : le(W, ee).length ? (Q(re) && (re = new C(), nt.set(W, re)), re.add(ee), !0) : !1;
11275
+ return !Q(re) && re.has(ee) ? !0 : de(W, ee).length ? (Q(re) && (re = new I(), nt.set(W, re)), re.add(ee), !0) : !1;
11290
11276
  },
11291
11277
  OrdinaryDefineOwnMetadata: S,
11292
11278
  OrdinaryHasOwnMetadata: T,
11293
11279
  OrdinaryGetOwnMetadata: V,
11294
- OrdinaryOwnMetadataKeys: le,
11280
+ OrdinaryOwnMetadataKeys: de,
11295
11281
  OrdinaryDeleteMetadata: ct
11296
11282
  };
11297
11283
  return je;
@@ -11377,7 +11363,7 @@ var Ih;
11377
11363
  }, je.prototype.clear = function() {
11378
11364
  this._keys.length = 0, this._values.length = 0, this._cacheKey = _, this._cacheIndex = -2;
11379
11365
  }, je.prototype.keys = function() {
11380
- return new T(this._keys, this._values, le);
11366
+ return new T(this._keys, this._values, de);
11381
11367
  }, je.prototype.values = function() {
11382
11368
  return new T(this._keys, this._values, ct);
11383
11369
  }, je.prototype.entries = function() {
@@ -11400,7 +11386,7 @@ var Ih;
11400
11386
  }()
11401
11387
  );
11402
11388
  return V;
11403
- function le(je, W) {
11389
+ function de(je, W) {
11404
11390
  return je;
11405
11391
  }
11406
11392
  function ct(je, W) {
@@ -11455,28 +11441,28 @@ var Ih;
11455
11441
  this._key = V();
11456
11442
  }
11457
11443
  return W.prototype.has = function(ee) {
11458
- var re = le(
11444
+ var re = de(
11459
11445
  ee,
11460
11446
  /*create*/
11461
11447
  !1
11462
11448
  );
11463
11449
  return re !== void 0 ? f.has(re, this._key) : !1;
11464
11450
  }, W.prototype.get = function(ee) {
11465
- var re = le(
11451
+ var re = de(
11466
11452
  ee,
11467
11453
  /*create*/
11468
11454
  !1
11469
11455
  );
11470
11456
  return re !== void 0 ? f.get(re, this._key) : void 0;
11471
11457
  }, W.prototype.set = function(ee, re) {
11472
- var se = le(
11458
+ var se = de(
11473
11459
  ee,
11474
11460
  /*create*/
11475
11461
  !0
11476
11462
  );
11477
11463
  return se[this._key] = re, this;
11478
11464
  }, W.prototype.delete = function(ee) {
11479
- var re = le(
11465
+ var re = de(
11480
11466
  ee,
11481
11467
  /*create*/
11482
11468
  !1
@@ -11494,7 +11480,7 @@ var Ih;
11494
11480
  while (f.has(S, W));
11495
11481
  return S[W] = !0, W;
11496
11482
  }
11497
- function le(W, ee) {
11483
+ function de(W, ee) {
11498
11484
  if (!n.call(W, T)) {
11499
11485
  if (!ee)
11500
11486
  return;
@@ -11528,7 +11514,7 @@ var Ih;
11528
11514
  return _.__ = void 0, delete _.__, _;
11529
11515
  }
11530
11516
  });
11531
- })(Ih || (Ih = {}));
11517
+ })(Ch || (Ch = {}));
11532
11518
  /*!
11533
11519
  * MIT License
11534
11520
  *
@@ -11604,7 +11590,7 @@ class q {
11604
11590
  }
11605
11591
  }
11606
11592
  const Gu = "string", ew = /^[0-9a-f]+$/i, tw = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/, rw = /^[a-zA-Z0-9-_]+$/;
11607
- class Ch {
11593
+ class Ih {
11608
11594
  static fromString(e) {
11609
11595
  const t = unescape(encodeURIComponent(e)), n = new Uint8Array(t.length);
11610
11596
  for (let s = 0; s < t.length; s++)
@@ -11723,7 +11709,7 @@ class te {
11723
11709
  case "ascii":
11724
11710
  return this.FromBinary(e);
11725
11711
  case "utf8":
11726
- return Ch.fromString(e);
11712
+ return Ih.fromString(e);
11727
11713
  case "utf16":
11728
11714
  case "utf16be":
11729
11715
  return gr.fromString(e);
@@ -11739,7 +11725,7 @@ class te {
11739
11725
  case "ascii":
11740
11726
  return this.ToBinary(e);
11741
11727
  case "utf8":
11742
- return Ch.toString(e);
11728
+ return Ih.toString(e);
11743
11729
  case "utf16":
11744
11730
  case "utf16be":
11745
11731
  return gr.toString(e);
@@ -11986,8 +11972,8 @@ class Gc {
11986
11972
  return uf(this.items);
11987
11973
  }
11988
11974
  }
11989
- const wi = [new Uint8Array([1])], jh = "0123456789", Ju = "name", Th = "valueHexView", aw = "isHexOnly", ow = "idBlock", cw = "tagClass", uw = "tagNumber", lw = "isConstructed", dw = "fromBER", fw = "toBER", hw = "local", It = "", pr = new ArrayBuffer(0), Jc = new Uint8Array(0), va = "EndOfContent", Ay = "OCTET STRING", Oy = "BIT STRING";
11990
- function Cr(r) {
11975
+ const wi = [new Uint8Array([1])], jh = "0123456789", Ju = "name", Th = "valueHexView", aw = "isHexOnly", ow = "idBlock", cw = "tagClass", uw = "tagNumber", lw = "isConstructed", dw = "fromBER", fw = "toBER", hw = "local", Ct = "", pr = new ArrayBuffer(0), Jc = new Uint8Array(0), va = "EndOfContent", Ay = "OCTET STRING", Oy = "BIT STRING";
11976
+ function Ir(r) {
11991
11977
  var e;
11992
11978
  return e = class extends r {
11993
11979
  constructor(...n) {
@@ -12022,7 +12008,7 @@ function Cr(r) {
12022
12008
  }, e.NAME = "hexBlock", e;
12023
12009
  }
12024
12010
  class ps {
12025
- constructor({ blockLength: e = 0, error: t = It, warnings: n = [], valueBeforeDecode: s = Jc } = {}) {
12011
+ constructor({ blockLength: e = 0, error: t = Ct, warnings: n = [], valueBeforeDecode: s = Jc } = {}) {
12026
12012
  this.blockLength = e, this.error = t, this.warnings = n, this.valueBeforeDecodeView = q.toUint8Array(s);
12027
12013
  }
12028
12014
  static blockName() {
@@ -12054,7 +12040,7 @@ class St extends ps {
12054
12040
  }
12055
12041
  }
12056
12042
  St.NAME = "valueBlock";
12057
- class Ey extends Cr(ps) {
12043
+ class Ey extends Ir(ps) {
12058
12044
  constructor({ idBlock: e = {} } = {}) {
12059
12045
  var t, n, s, i;
12060
12046
  super(), e ? (this.isHexOnly = (t = e.isHexOnly) !== null && t !== void 0 ? t : !1, this.valueHexView = e.valueHex ? q.toUint8Array(e.valueHex) : Jc, this.tagClass = (n = e.tagClass) !== null && n !== void 0 ? n : -1, this.tagNumber = (s = e.tagNumber) !== null && s !== void 0 ? s : -1, this.isConstructed = (i = e.isConstructed) !== null && i !== void 0 ? i : !1) : (this.tagClass = -1, this.tagNumber = -1, this.isConstructed = !1);
@@ -12138,8 +12124,8 @@ class Ey extends Cr(ps) {
12138
12124
  if (c === f) {
12139
12125
  f += 255;
12140
12126
  const B = new Uint8Array(f);
12141
- for (let C = 0; C < u.length; C++)
12142
- B[C] = u[C];
12127
+ for (let I = 0; I < u.length; I++)
12128
+ B[I] = u[I];
12143
12129
  u = this.valueHexView = new Uint8Array(f);
12144
12130
  }
12145
12131
  }
@@ -12178,7 +12164,7 @@ class Ey extends Cr(ps) {
12178
12164
  }
12179
12165
  }
12180
12166
  Ey.NAME = "identificationBlock";
12181
- class Iy extends ps {
12167
+ class Cy extends ps {
12182
12168
  constructor({ lenBlock: e = {} } = {}) {
12183
12169
  var t, n, s;
12184
12170
  super(), this.isIndefiniteForm = (t = e.isIndefiniteForm) !== null && t !== void 0 ? t : !1, this.longFormUsed = (n = e.longFormUsed) !== null && n !== void 0 ? n : !1, this.length = (s = e.length) !== null && s !== void 0 ? s : 0;
@@ -12231,11 +12217,11 @@ class Iy extends ps {
12231
12217
  };
12232
12218
  }
12233
12219
  }
12234
- Iy.NAME = "lengthBlock";
12220
+ Cy.NAME = "lengthBlock";
12235
12221
  const X = {};
12236
12222
  class ft extends ps {
12237
- constructor({ name: e = It, optional: t = !1, primitiveSchema: n, ...s } = {}, i) {
12238
- super(s), this.name = e, this.optional = t, n && (this.primitiveSchema = n), this.idBlock = new Ey(s), this.lenBlock = new Iy(s), this.valueBlock = i ? new i(s) : new St(s);
12223
+ constructor({ name: e = Ct, optional: t = !1, primitiveSchema: n, ...s } = {}, i) {
12224
+ super(s), this.name = e, this.optional = t, n && (this.primitiveSchema = n), this.idBlock = new Ey(s), this.lenBlock = new Cy(s), this.valueBlock = i ? new i(s) : new St(s);
12239
12225
  }
12240
12226
  fromBER(e, t, n) {
12241
12227
  const s = this.valueBlock.fromBER(e, t, this.lenBlock.isIndefiniteForm ? n : this.lenBlock.length);
@@ -12243,7 +12229,7 @@ class ft extends ps {
12243
12229
  }
12244
12230
  toBER(e, t) {
12245
12231
  const n = t || new Gc();
12246
- t || Cy(this);
12232
+ t || Iy(this);
12247
12233
  const s = this.idBlock.toBER(e);
12248
12234
  if (n.write(s), this.lenBlock.isIndefiniteForm)
12249
12235
  n.write(new Uint8Array([128]).buffer), this.valueBlock.toBER(e, n), n.write(new ArrayBuffer(2));
@@ -12282,14 +12268,14 @@ class ft extends ps {
12282
12268
  }
12283
12269
  }
12284
12270
  ft.NAME = "BaseBlock";
12285
- function Cy(r) {
12271
+ function Iy(r) {
12286
12272
  if (r instanceof X.Constructed)
12287
12273
  for (const e of r.valueBlock.value)
12288
- Cy(e) && (r.lenBlock.isIndefiniteForm = !0);
12274
+ Iy(e) && (r.lenBlock.isIndefiniteForm = !0);
12289
12275
  return !!r.lenBlock.isIndefiniteForm;
12290
12276
  }
12291
12277
  class lf extends ft {
12292
- constructor({ value: e = It, ...t } = {}, n) {
12278
+ constructor({ value: e = Ct, ...t } = {}, n) {
12293
12279
  super(t, n), e && this.fromString(e);
12294
12280
  }
12295
12281
  getValue() {
@@ -12307,7 +12293,7 @@ class lf extends ft {
12307
12293
  }
12308
12294
  }
12309
12295
  lf.NAME = "BaseStringBlock";
12310
- class jy extends Cr(St) {
12296
+ class jy extends Ir(St) {
12311
12297
  constructor({ isHexOnly: e = !0, ...t } = {}) {
12312
12298
  super(t), this.isHexOnly = e;
12313
12299
  }
@@ -12536,7 +12522,7 @@ class mn extends St {
12536
12522
  }
12537
12523
  mn.NAME = "ConstructedValueBlock";
12538
12524
  var Ny;
12539
- class Ct extends ft {
12525
+ class It extends ft {
12540
12526
  constructor(e = {}) {
12541
12527
  super(e, mn), this.idBlock.isConstructed = !0;
12542
12528
  }
@@ -12557,9 +12543,9 @@ ${e.join(`
12557
12543
  `)}` : `${t} :`;
12558
12544
  }
12559
12545
  }
12560
- Ny = Ct;
12546
+ Ny = It;
12561
12547
  X.Constructed = Ny;
12562
- Ct.NAME = "CONSTRUCTED";
12548
+ It.NAME = "CONSTRUCTED";
12563
12549
  class By extends St {
12564
12550
  fromBER(e, t, n) {
12565
12551
  return t;
@@ -12601,7 +12587,7 @@ class es extends ft {
12601
12587
  Py = es;
12602
12588
  X.Null = Py;
12603
12589
  es.NAME = "NULL";
12604
- class $y extends Cr(St) {
12590
+ class $y extends Ir(St) {
12605
12591
  constructor({ value: e, ...t } = {}) {
12606
12592
  super(t), t.valueHex ? this.valueHexView = q.toUint8Array(t.valueHex) : this.valueHexView = new Uint8Array(1), e && (this.value = e);
12607
12593
  }
@@ -12647,7 +12633,7 @@ let Yc = class extends ft {
12647
12633
  Dy = Yc;
12648
12634
  X.Boolean = Dy;
12649
12635
  Yc.NAME = "BOOLEAN";
12650
- class Zy extends Cr(mn) {
12636
+ class Zy extends Ir(mn) {
12651
12637
  constructor({ isConstructed: e = !1, ...t } = {}) {
12652
12638
  super(t), this.isConstructed = e;
12653
12639
  }
@@ -12713,7 +12699,7 @@ let Kn = class Uy extends ft {
12713
12699
  return super.fromBER(e, t, n);
12714
12700
  }
12715
12701
  onAsciiEncoding() {
12716
- return this.valueBlock.isConstructed || this.valueBlock.value && this.valueBlock.value.length ? Ct.prototype.onAsciiEncoding.call(this) : `${this.constructor.NAME} : ${te.ToHex(this.valueBlock.valueHexView)}`;
12702
+ return this.valueBlock.isConstructed || this.valueBlock.value && this.valueBlock.value.length ? It.prototype.onAsciiEncoding.call(this) : `${this.constructor.NAME} : ${te.ToHex(this.valueBlock.valueHexView)}`;
12717
12703
  }
12718
12704
  getValue() {
12719
12705
  if (!this.idBlock.isConstructed)
@@ -12727,7 +12713,7 @@ let Kn = class Uy extends ft {
12727
12713
  My = Kn;
12728
12714
  X.OctetString = My;
12729
12715
  Kn.NAME = Ay;
12730
- class Vy extends Cr(mn) {
12716
+ class Vy extends Ir(mn) {
12731
12717
  constructor({ unusedBits: e = 0, isConstructed: t = !1, ...n } = {}) {
12732
12718
  super(n), this.unusedBits = e, this.isConstructed = t, this.blockLength = this.valueHexView.byteLength;
12733
12719
  }
@@ -12812,7 +12798,7 @@ let Wn = class extends ft {
12812
12798
  }
12813
12799
  onAsciiEncoding() {
12814
12800
  if (this.valueBlock.isConstructed || this.valueBlock.value && this.valueBlock.value.length)
12815
- return Ct.prototype.onAsciiEncoding.call(this);
12801
+ return It.prototype.onAsciiEncoding.call(this);
12816
12802
  {
12817
12803
  const e = [], t = this.valueBlock.valueHexView;
12818
12804
  for (const s of t)
@@ -12886,7 +12872,7 @@ function gw(r, e) {
12886
12872
  }
12887
12873
  return i.slice();
12888
12874
  }
12889
- class ff extends Cr(St) {
12875
+ class ff extends Ir(St) {
12890
12876
  constructor({ value: e, ...t } = {}) {
12891
12877
  super(t), this._valueDec = 0, t.valueHex && this.setValueHex(), e !== void 0 && (this.valueDec = e);
12892
12878
  }
@@ -13015,7 +13001,7 @@ class Xc extends _r {
13015
13001
  Fy = Xc;
13016
13002
  X.Enumerated = Fy;
13017
13003
  Xc.NAME = "ENUMERATED";
13018
- class Bl extends Cr(St) {
13004
+ class Bl extends Ir(St) {
13019
13005
  constructor({ valueDec: e = -1, isFirstSid: t = !1, ...n } = {}) {
13020
13006
  super(n), this.valueDec = e, this.isFirstSid = t;
13021
13007
  }
@@ -13086,7 +13072,7 @@ class Bl extends Cr(St) {
13086
13072
  }
13087
13073
  Bl.NAME = "sidBlock";
13088
13074
  class Ky extends St {
13089
- constructor({ value: e = It, ...t } = {}) {
13075
+ constructor({ value: e = Ct, ...t } = {}) {
13090
13076
  super(t), this.value = [], e && this.fromString(e);
13091
13077
  }
13092
13078
  fromBER(e, t, n) {
@@ -13190,7 +13176,7 @@ class Qc extends ft {
13190
13176
  Wy = Qc;
13191
13177
  X.ObjectIdentifier = Wy;
13192
13178
  Qc.NAME = "OBJECT IDENTIFIER";
13193
- class Rl extends Cr(ps) {
13179
+ class Rl extends Ir(ps) {
13194
13180
  constructor({ valueDec: e = 0, ...t } = {}) {
13195
13181
  super(t), this.valueDec = e;
13196
13182
  }
@@ -13243,7 +13229,7 @@ class Rl extends Cr(ps) {
13243
13229
  }
13244
13230
  Rl.NAME = "relativeSidBlock";
13245
13231
  class zy extends St {
13246
- constructor({ value: e = It, ...t } = {}) {
13232
+ constructor({ value: e = Ct, ...t } = {}) {
13247
13233
  super(t), this.value = [], e && this.fromString(e);
13248
13234
  }
13249
13235
  fromBER(e, t, n) {
@@ -13324,7 +13310,7 @@ Gy = hf;
13324
13310
  X.RelativeObjectIdentifier = Gy;
13325
13311
  hf.NAME = "RelativeObjectIdentifier";
13326
13312
  var Jy;
13327
- class Lr extends Ct {
13313
+ class Lr extends It {
13328
13314
  constructor(e = {}) {
13329
13315
  super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 16;
13330
13316
  }
@@ -13333,7 +13319,7 @@ Jy = Lr;
13333
13319
  X.Sequence = Jy;
13334
13320
  Lr.NAME = "SEQUENCE";
13335
13321
  var Yy;
13336
- let qr = class extends Ct {
13322
+ let qr = class extends It {
13337
13323
  constructor(e = {}) {
13338
13324
  super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 17;
13339
13325
  }
@@ -13341,9 +13327,9 @@ let qr = class extends Ct {
13341
13327
  Yy = qr;
13342
13328
  X.Set = Yy;
13343
13329
  qr.NAME = "SET";
13344
- class Xy extends Cr(St) {
13330
+ class Xy extends Ir(St) {
13345
13331
  constructor({ ...e } = {}) {
13346
- super(e), this.isHexOnly = !0, this.value = It;
13332
+ super(e), this.isHexOnly = !0, this.value = Ct;
13347
13333
  }
13348
13334
  toJSON() {
13349
13335
  return {
@@ -13610,15 +13596,15 @@ class lu extends eo {
13610
13596
  if (n.indexOf("-") !== -1)
13611
13597
  throw new Error("Wrong input string for conversion");
13612
13598
  } else {
13613
- let y = 1, B = n.indexOf("+"), C = "";
13599
+ let y = 1, B = n.indexOf("+"), I = "";
13614
13600
  if (B === -1 && (B = n.indexOf("-"), y = -1), B !== -1) {
13615
- if (C = n.substring(B + 1), n = n.substring(0, B), C.length !== 2 && C.length !== 4)
13601
+ if (I = n.substring(B + 1), n = n.substring(0, B), I.length !== 2 && I.length !== 4)
13616
13602
  throw new Error("Wrong input string for conversion");
13617
- let p = parseInt(C.substring(0, 2), 10);
13603
+ let p = parseInt(I.substring(0, 2), 10);
13618
13604
  if (isNaN(p.valueOf()))
13619
13605
  throw new Error("Wrong input string for conversion");
13620
- if (o = y * p, C.length === 4) {
13621
- if (p = parseInt(C.substring(2, 4), 10), isNaN(p.valueOf()))
13606
+ if (o = y * p, I.length === 4) {
13607
+ if (p = parseInt(I.substring(2, 4), 10), isNaN(p.valueOf()))
13622
13608
  throw new Error("Wrong input string for conversion");
13623
13609
  c = y * p;
13624
13610
  }
@@ -13752,7 +13738,7 @@ _g = vf;
13752
13738
  X.TIME = _g;
13753
13739
  vf.NAME = "TIME";
13754
13740
  class ts {
13755
- constructor({ name: e = It, optional: t = !1 } = {}) {
13741
+ constructor({ name: e = Ct, optional: t = !1 } = {}) {
13756
13742
  this.name = e, this.optional = t;
13757
13743
  }
13758
13744
  }
@@ -13907,7 +13893,7 @@ function Dn(r, e, t) {
13907
13893
  result: r
13908
13894
  };
13909
13895
  }
13910
- if (t.name && (t.name = t.name.replace(/^\s+|\s+$/g, It), t.name && (r[t.name] = e)), t instanceof X.Constructed) {
13896
+ if (t.name && (t.name = t.name.replace(/^\s+|\s+$/g, Ct), t.name && (r[t.name] = e)), t instanceof X.Constructed) {
13911
13897
  let i = 0, a = {
13912
13898
  verified: !1,
13913
13899
  result: {
@@ -13926,7 +13912,7 @@ function Dn(r, e, t) {
13926
13912
  return c ? {
13927
13913
  verified: !0,
13928
13914
  result: r
13929
- } : (t.name && (t.name = t.name.replace(/^\s+|\s+$/g, It), t.name && delete r[t.name]), r.error = "Inconsistent object length", {
13915
+ } : (t.name && (t.name = t.name.replace(/^\s+|\s+$/g, Ct), t.name && delete r[t.name]), r.error = "Inconsistent object length", {
13930
13916
  verified: !1,
13931
13917
  result: r
13932
13918
  });
@@ -13938,14 +13924,14 @@ function Dn(r, e, t) {
13938
13924
  verified: !1,
13939
13925
  result: r
13940
13926
  };
13941
- return r.error = "Inconsistent length between ASN.1 data and schema", t.name && (t.name = t.name.replace(/^\s+|\s+$/g, It), t.name && (delete r[t.name], u.name = t.name)), u;
13927
+ return r.error = "Inconsistent length between ASN.1 data and schema", t.name && (t.name = t.name.replace(/^\s+|\s+$/g, Ct), t.name && (delete r[t.name], u.name = t.name)), u;
13942
13928
  }
13943
13929
  } else if (t.valueBlock.value[0] instanceof sc) {
13944
13930
  if (a = Dn(r, e.valueBlock.value[c], t.valueBlock.value[0].value), a.verified === !1)
13945
13931
  if (t.valueBlock.value[0].optional)
13946
13932
  i++;
13947
13933
  else
13948
- return t.name && (t.name = t.name.replace(/^\s+|\s+$/g, It), t.name && delete r[t.name]), a;
13934
+ return t.name && (t.name = t.name.replace(/^\s+|\s+$/g, Ct), t.name && delete r[t.name]), a;
13949
13935
  if (Ju in t.valueBlock.value[0] && t.valueBlock.value[0].name.length > 0) {
13950
13936
  let u = {};
13951
13937
  hw in t.valueBlock.value[0] && t.valueBlock.value[0].local ? u = e : u = r, typeof u[t.valueBlock.value[0].name] > "u" && (u[t.valueBlock.value[0].name] = []), u[t.valueBlock.value[0].name].push(e.valueBlock.value[c]);
@@ -13954,13 +13940,13 @@ function Dn(r, e, t) {
13954
13940
  if (t.valueBlock.value[c].optional)
13955
13941
  i++;
13956
13942
  else
13957
- return t.name && (t.name = t.name.replace(/^\s+|\s+$/g, It), t.name && delete r[t.name]), a;
13943
+ return t.name && (t.name = t.name.replace(/^\s+|\s+$/g, Ct), t.name && delete r[t.name]), a;
13958
13944
  if (a.verified === !1) {
13959
13945
  const c = {
13960
13946
  verified: !1,
13961
13947
  result: r
13962
13948
  };
13963
- return t.name && (t.name = t.name.replace(/^\s+|\s+$/g, It), t.name && (delete r[t.name], c.name = t.name)), c;
13949
+ return t.name && (t.name = t.name.replace(/^\s+|\s+$/g, Ct), t.name && (delete r[t.name], c.name = t.name)), c;
13964
13950
  }
13965
13951
  return {
13966
13952
  verified: !0,
@@ -13974,7 +13960,7 @@ function Dn(r, e, t) {
13974
13960
  verified: !1,
13975
13961
  result: i.result
13976
13962
  };
13977
- return t.name && (t.name = t.name.replace(/^\s+|\s+$/g, It), t.name && (delete r[t.name], a.name = t.name)), a;
13963
+ return t.name && (t.name = t.name.replace(/^\s+|\s+$/g, Ct), t.name && (delete r[t.name], a.name = t.name)), a;
13978
13964
  }
13979
13965
  return Dn(r, i.result, t.primitiveSchema);
13980
13966
  }
@@ -14005,7 +13991,7 @@ const wg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
14005
13991
  Boolean: Yc,
14006
13992
  CharacterString: uu,
14007
13993
  Choice: bf,
14008
- Constructed: Ct,
13994
+ Constructed: It,
14009
13995
  DATE: pf,
14010
13996
  DateTime: yf,
14011
13997
  Duration: gf,
@@ -14014,7 +14000,7 @@ const wg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
14014
14000
  GeneralString: cu,
14015
14001
  GeneralizedTime: lu,
14016
14002
  GraphicString: ou,
14017
- HexBlock: Cr,
14003
+ HexBlock: Ir,
14018
14004
  IA5String: au,
14019
14005
  Integer: _r,
14020
14006
  Null: es,
@@ -14153,7 +14139,7 @@ function zt(r) {
14153
14139
  toASN: (e) => new r({ value: e })
14154
14140
  };
14155
14141
  }
14156
- const kg = zt(en), Ew = zt(eu), Iw = zt(tu), Cw = zt(ru), jw = zt(nu), Tw = zt(su), Nw = zt(iu), Bw = zt(au), Rw = zt(ou), Pw = zt(Qa), $w = zt(cu), Dw = zt(uu), Zw = {
14142
+ const kg = zt(en), Ew = zt(eu), Cw = zt(tu), Iw = zt(ru), jw = zt(nu), Tw = zt(su), Nw = zt(iu), Bw = zt(au), Rw = zt(ou), Pw = zt(Qa), $w = zt(cu), Dw = zt(uu), Zw = {
14157
14143
  fromASN: (r) => r.toDate(),
14158
14144
  toASN: (r) => new eo({ valueDate: r })
14159
14145
  }, Mw = {
@@ -14190,7 +14176,7 @@ function xf(r) {
14190
14176
  case v.Null:
14191
14177
  return Uw;
14192
14178
  case v.NumericString:
14193
- return Cw;
14179
+ return Iw;
14194
14180
  case v.ObjectIdentifier:
14195
14181
  return Sw;
14196
14182
  case v.OctetString:
@@ -14202,7 +14188,7 @@ function xf(r) {
14202
14188
  case v.UTCTime:
14203
14189
  return Zw;
14204
14190
  case v.UniversalString:
14205
- return Iw;
14191
+ return Cw;
14206
14192
  case v.Utf8String:
14207
14193
  return kg;
14208
14194
  case v.VideotexString:
@@ -14287,7 +14273,7 @@ class Lw {
14287
14273
  if (a.context !== null && a.context !== void 0)
14288
14274
  if (a.implicit)
14289
14275
  if (typeof a.type == "number" || Vr(a.type)) {
14290
- const f = a.repeated ? Ct : Xa;
14276
+ const f = a.repeated ? It : Xa;
14291
14277
  s.push(new f({
14292
14278
  name: o,
14293
14279
  optional: u,
@@ -14300,7 +14286,7 @@ class Lw {
14300
14286
  this.cache(a.type);
14301
14287
  const f = !!a.repeated;
14302
14288
  let y = f ? c : this.get(a.type, !0).schema;
14303
- y = "valueBlock" in y ? y.valueBlock.value : y.value, s.push(new Ct({
14289
+ y = "valueBlock" in y ? y.valueBlock.value : y.value, s.push(new It({
14304
14290
  name: f ? "" : o,
14305
14291
  optional: u,
14306
14292
  idBlock: {
@@ -14311,7 +14297,7 @@ class Lw {
14311
14297
  }));
14312
14298
  }
14313
14299
  else
14314
- s.push(new Ct({
14300
+ s.push(new It({
14315
14301
  optional: u,
14316
14302
  idBlock: {
14317
14303
  tagClass: 3,
@@ -14376,8 +14362,8 @@ class qw {
14376
14362
  const s = qt.get(t);
14377
14363
  qt.cache(t);
14378
14364
  let i = s.schema;
14379
- if (e.constructor === Ct && s.type !== R.Choice) {
14380
- i = new Ct({
14365
+ if (e.constructor === It && s.type !== R.Choice) {
14366
+ i = new It({
14381
14367
  idBlock: {
14382
14368
  tagClass: 3,
14383
14369
  tagNumber: e.idBlock.tagNumber
@@ -14414,7 +14400,7 @@ class qw {
14414
14400
  throw new Error("Converter is empty");
14415
14401
  if (f.repeated)
14416
14402
  if (f.implicit) {
14417
- const C = f.repeated === "sequence" ? Lr : qr, p = new C();
14403
+ const I = f.repeated === "sequence" ? Lr : qr, p = new I();
14418
14404
  p.valueBlock = u.valueBlock;
14419
14405
  const g = Ts(p.toBER(!1));
14420
14406
  if (g.offset === -1)
@@ -14424,9 +14410,9 @@ class qw {
14424
14410
  const A = g.result.valueBlock.value;
14425
14411
  o[c] = Array.from(A, (O) => B.fromASN(O));
14426
14412
  } else
14427
- o[c] = Array.from(u, (C) => B.fromASN(C));
14413
+ o[c] = Array.from(u, (I) => B.fromASN(I));
14428
14414
  else {
14429
- let C = u;
14415
+ let I = u;
14430
14416
  if (f.implicit) {
14431
14417
  let p;
14432
14418
  if (Vr(y))
@@ -14437,9 +14423,9 @@ class qw {
14437
14423
  throw new Error(`Cannot get '${g}' class from asn1js module`);
14438
14424
  p = new A();
14439
14425
  }
14440
- p.valueBlock = C.valueBlock, C = Ts(p.toBER(!1)).result;
14426
+ p.valueBlock = I.valueBlock, I = Ts(p.toBER(!1)).result;
14441
14427
  }
14442
- o[c] = B.fromASN(C);
14428
+ o[c] = B.fromASN(I);
14443
14429
  }
14444
14430
  } else if (f.repeated) {
14445
14431
  if (!Array.isArray(u))
@@ -14495,7 +14481,7 @@ class _f {
14495
14481
  ...f
14496
14482
  }));
14497
14483
  } else
14498
- s.push(new Ct({
14484
+ s.push(new It({
14499
14485
  optional: o.optional,
14500
14486
  idBlock: {
14501
14487
  tagClass: 3,
@@ -14504,7 +14490,7 @@ class _f {
14504
14490
  value: u.valueBlock.value
14505
14491
  }));
14506
14492
  else
14507
- s.push(new Ct({
14493
+ s.push(new It({
14508
14494
  optional: o.optional,
14509
14495
  idBlock: {
14510
14496
  tagClass: 3,
@@ -14648,8 +14634,8 @@ var Ag = { exports: {} };
14648
14634
  p = `0${p}`;
14649
14635
  return p;
14650
14636
  }
14651
- const C = {};
14652
- C.IPv4 = function() {
14637
+ const I = {};
14638
+ I.IPv4 = function() {
14653
14639
  function p(g) {
14654
14640
  if (g.length !== 4)
14655
14641
  throw new Error("ipaddr: ipv4 octet count should be 4");
@@ -14725,17 +14711,17 @@ var Ag = { exports: {} };
14725
14711
  return null;
14726
14712
  return 32 - g;
14727
14713
  }, p.prototype.range = function() {
14728
- return C.subnetMatch(this, this.SpecialRanges);
14714
+ return I.subnetMatch(this, this.SpecialRanges);
14729
14715
  }, p.prototype.toByteArray = function() {
14730
14716
  return this.octets.slice(0);
14731
14717
  }, p.prototype.toIPv4MappedAddress = function() {
14732
- return C.IPv6.parse(`::ffff:${this.toString()}`);
14718
+ return I.IPv6.parse(`::ffff:${this.toString()}`);
14733
14719
  }, p.prototype.toNormalizedString = function() {
14734
14720
  return this.toString();
14735
14721
  }, p.prototype.toString = function() {
14736
14722
  return this.octets.join(".");
14737
14723
  }, p;
14738
- }(), C.IPv4.broadcastAddressFromCIDR = function(p) {
14724
+ }(), I.IPv4.broadcastAddressFromCIDR = function(p) {
14739
14725
  try {
14740
14726
  const g = this.parseCIDR(p), A = g[0].toByteArray(), O = this.subnetMaskFromPrefixLength(g[1]).toByteArray(), P = [];
14741
14727
  let N = 0;
@@ -14745,23 +14731,23 @@ var Ag = { exports: {} };
14745
14731
  } catch {
14746
14732
  throw new Error("ipaddr: the address does not have IPv4 CIDR format");
14747
14733
  }
14748
- }, C.IPv4.isIPv4 = function(p) {
14734
+ }, I.IPv4.isIPv4 = function(p) {
14749
14735
  return this.parser(p) !== null;
14750
- }, C.IPv4.isValid = function(p) {
14736
+ }, I.IPv4.isValid = function(p) {
14751
14737
  try {
14752
14738
  return new this(this.parser(p)), !0;
14753
14739
  } catch {
14754
14740
  return !1;
14755
14741
  }
14756
- }, C.IPv4.isValidCIDR = function(p) {
14742
+ }, I.IPv4.isValidCIDR = function(p) {
14757
14743
  try {
14758
14744
  return this.parseCIDR(p), !0;
14759
14745
  } catch {
14760
14746
  return !1;
14761
14747
  }
14762
- }, C.IPv4.isValidFourPartDecimal = function(p) {
14763
- return !!(C.IPv4.isValid(p) && p.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/));
14764
- }, C.IPv4.networkAddressFromCIDR = function(p) {
14748
+ }, I.IPv4.isValidFourPartDecimal = function(p) {
14749
+ return !!(I.IPv4.isValid(p) && p.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/));
14750
+ }, I.IPv4.networkAddressFromCIDR = function(p) {
14765
14751
  let g, A, O, P, N;
14766
14752
  try {
14767
14753
  for (g = this.parseCIDR(p), O = g[0].toByteArray(), N = this.subnetMaskFromPrefixLength(g[1]).toByteArray(), P = [], A = 0; A < 4; )
@@ -14770,12 +14756,12 @@ var Ag = { exports: {} };
14770
14756
  } catch {
14771
14757
  throw new Error("ipaddr: the address does not have IPv4 CIDR format");
14772
14758
  }
14773
- }, C.IPv4.parse = function(p) {
14759
+ }, I.IPv4.parse = function(p) {
14774
14760
  const g = this.parser(p);
14775
14761
  if (g === null)
14776
14762
  throw new Error("ipaddr: string is not formatted like an IPv4 Address");
14777
14763
  return new this(g);
14778
- }, C.IPv4.parseCIDR = function(p) {
14764
+ }, I.IPv4.parseCIDR = function(p) {
14779
14765
  let g;
14780
14766
  if (g = p.match(/^(.+)\/(\d+)$/)) {
14781
14767
  const A = parseInt(g[2]);
@@ -14789,7 +14775,7 @@ var Ag = { exports: {} };
14789
14775
  }
14790
14776
  }
14791
14777
  throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range");
14792
- }, C.IPv4.parser = function(p) {
14778
+ }, I.IPv4.parser = function(p) {
14793
14779
  let g, A, O;
14794
14780
  if (g = p.match(n.fourOctet))
14795
14781
  return function() {
@@ -14819,7 +14805,7 @@ var Ag = { exports: {} };
14819
14805
  throw new Error("ipaddr: address outside defined range");
14820
14806
  return N.push(y(P[0])), N.push(y(P[1])), N.push(O >> 8 & 255), N.push(O & 255), N;
14821
14807
  }() : null;
14822
- }, C.IPv4.subnetMaskFromPrefixLength = function(p) {
14808
+ }, I.IPv4.subnetMaskFromPrefixLength = function(p) {
14823
14809
  if (p = parseInt(p), p < 0 || p > 32)
14824
14810
  throw new Error("ipaddr: invalid IPv4 prefix length");
14825
14811
  const g = [0, 0, 0, 0];
@@ -14828,7 +14814,7 @@ var Ag = { exports: {} };
14828
14814
  for (; A < O; )
14829
14815
  g[A] = 255, A++;
14830
14816
  return O < 4 && (g[O] = Math.pow(2, p % 8) - 1 << 8 - p % 8), new this(g);
14831
- }, C.IPv6 = function() {
14817
+ }, I.IPv6 = function() {
14832
14818
  function p(g, A) {
14833
14819
  let O, P;
14834
14820
  if (g.length === 16)
@@ -14918,7 +14904,7 @@ var Ag = { exports: {} };
14918
14904
  return null;
14919
14905
  return 128 - g;
14920
14906
  }, p.prototype.range = function() {
14921
- return C.subnetMatch(this, this.SpecialRanges);
14907
+ return I.subnetMatch(this, this.SpecialRanges);
14922
14908
  }, p.prototype.toByteArray = function() {
14923
14909
  let g;
14924
14910
  const A = [], O = this.parts;
@@ -14938,7 +14924,7 @@ var Ag = { exports: {} };
14938
14924
  if (!this.isIPv4MappedAddress())
14939
14925
  throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");
14940
14926
  const g = this.parts.slice(-2), A = g[0], O = g[1];
14941
- return new C.IPv4([A >> 8, A & 255, O >> 8, O & 255]);
14927
+ return new I.IPv4([A >> 8, A & 255, O >> 8, O & 255]);
14942
14928
  }, p.prototype.toNormalizedString = function() {
14943
14929
  const g = (function() {
14944
14930
  const O = [];
@@ -14957,7 +14943,7 @@ var Ag = { exports: {} };
14957
14943
  }, p.prototype.toString = function() {
14958
14944
  return this.toRFC5952String();
14959
14945
  }, p;
14960
- }(), C.IPv6.broadcastAddressFromCIDR = function(p) {
14946
+ }(), I.IPv6.broadcastAddressFromCIDR = function(p) {
14961
14947
  try {
14962
14948
  const g = this.parseCIDR(p), A = g[0].toByteArray(), O = this.subnetMaskFromPrefixLength(g[1]).toByteArray(), P = [];
14963
14949
  let N = 0;
@@ -14967,9 +14953,9 @@ var Ag = { exports: {} };
14967
14953
  } catch (g) {
14968
14954
  throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`);
14969
14955
  }
14970
- }, C.IPv6.isIPv6 = function(p) {
14956
+ }, I.IPv6.isIPv6 = function(p) {
14971
14957
  return this.parser(p) !== null;
14972
- }, C.IPv6.isValid = function(p) {
14958
+ }, I.IPv6.isValid = function(p) {
14973
14959
  if (typeof p == "string" && p.indexOf(":") === -1)
14974
14960
  return !1;
14975
14961
  try {
@@ -14978,7 +14964,7 @@ var Ag = { exports: {} };
14978
14964
  } catch {
14979
14965
  return !1;
14980
14966
  }
14981
- }, C.IPv6.isValidCIDR = function(p) {
14967
+ }, I.IPv6.isValidCIDR = function(p) {
14982
14968
  if (typeof p == "string" && p.indexOf(":") === -1)
14983
14969
  return !1;
14984
14970
  try {
@@ -14986,7 +14972,7 @@ var Ag = { exports: {} };
14986
14972
  } catch {
14987
14973
  return !1;
14988
14974
  }
14989
- }, C.IPv6.networkAddressFromCIDR = function(p) {
14975
+ }, I.IPv6.networkAddressFromCIDR = function(p) {
14990
14976
  let g, A, O, P, N;
14991
14977
  try {
14992
14978
  for (g = this.parseCIDR(p), O = g[0].toByteArray(), N = this.subnetMaskFromPrefixLength(g[1]).toByteArray(), P = [], A = 0; A < 16; )
@@ -14995,12 +14981,12 @@ var Ag = { exports: {} };
14995
14981
  } catch (xe) {
14996
14982
  throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${xe})`);
14997
14983
  }
14998
- }, C.IPv6.parse = function(p) {
14984
+ }, I.IPv6.parse = function(p) {
14999
14985
  const g = this.parser(p);
15000
14986
  if (g.parts === null)
15001
14987
  throw new Error("ipaddr: string is not formatted like an IPv6 Address");
15002
14988
  return new this(g.parts, g.zoneId);
15003
- }, C.IPv6.parseCIDR = function(p) {
14989
+ }, I.IPv6.parseCIDR = function(p) {
15004
14990
  let g, A, O;
15005
14991
  if ((A = p.match(/^(.+)\/(\d+)$/)) && (g = parseInt(A[2]), g >= 0 && g <= 128))
15006
14992
  return O = [this.parse(A[1]), g], Object.defineProperty(O, "toString", {
@@ -15009,7 +14995,7 @@ var Ag = { exports: {} };
15009
14995
  }
15010
14996
  }), O;
15011
14997
  throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range");
15012
- }, C.IPv6.parser = function(p) {
14998
+ }, I.IPv6.parser = function(p) {
15013
14999
  let g, A, O, P, N, xe;
15014
15000
  if (O = p.match(c.deprecatedTransitional))
15015
15001
  return this.parser(`::ffff:${O[1]}`);
@@ -15030,7 +15016,7 @@ var Ag = { exports: {} };
15030
15016
  };
15031
15017
  }
15032
15018
  return null;
15033
- }, C.IPv6.subnetMaskFromPrefixLength = function(p) {
15019
+ }, I.IPv6.subnetMaskFromPrefixLength = function(p) {
15034
15020
  if (p = parseInt(p), p < 0 || p > 128)
15035
15021
  throw new Error("ipaddr: invalid IPv6 prefix length");
15036
15022
  const g = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
@@ -15039,37 +15025,37 @@ var Ag = { exports: {} };
15039
15025
  for (; A < O; )
15040
15026
  g[A] = 255, A++;
15041
15027
  return O < 16 && (g[O] = Math.pow(2, p % 8) - 1 << 8 - p % 8), new this(g);
15042
- }, C.fromByteArray = function(p) {
15028
+ }, I.fromByteArray = function(p) {
15043
15029
  const g = p.length;
15044
15030
  if (g === 4)
15045
- return new C.IPv4(p);
15031
+ return new I.IPv4(p);
15046
15032
  if (g === 16)
15047
- return new C.IPv6(p);
15033
+ return new I.IPv6(p);
15048
15034
  throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address");
15049
- }, C.isValid = function(p) {
15050
- return C.IPv6.isValid(p) || C.IPv4.isValid(p);
15051
- }, C.isValidCIDR = function(p) {
15052
- return C.IPv6.isValidCIDR(p) || C.IPv4.isValidCIDR(p);
15053
- }, C.parse = function(p) {
15054
- if (C.IPv6.isValid(p))
15055
- return C.IPv6.parse(p);
15056
- if (C.IPv4.isValid(p))
15057
- return C.IPv4.parse(p);
15035
+ }, I.isValid = function(p) {
15036
+ return I.IPv6.isValid(p) || I.IPv4.isValid(p);
15037
+ }, I.isValidCIDR = function(p) {
15038
+ return I.IPv6.isValidCIDR(p) || I.IPv4.isValidCIDR(p);
15039
+ }, I.parse = function(p) {
15040
+ if (I.IPv6.isValid(p))
15041
+ return I.IPv6.parse(p);
15042
+ if (I.IPv4.isValid(p))
15043
+ return I.IPv4.parse(p);
15058
15044
  throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format");
15059
- }, C.parseCIDR = function(p) {
15045
+ }, I.parseCIDR = function(p) {
15060
15046
  try {
15061
- return C.IPv6.parseCIDR(p);
15047
+ return I.IPv6.parseCIDR(p);
15062
15048
  } catch {
15063
15049
  try {
15064
- return C.IPv4.parseCIDR(p);
15050
+ return I.IPv4.parseCIDR(p);
15065
15051
  } catch {
15066
15052
  throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format");
15067
15053
  }
15068
15054
  }
15069
- }, C.process = function(p) {
15055
+ }, I.process = function(p) {
15070
15056
  const g = this.parse(p);
15071
15057
  return g.kind() === "ipv6" && g.isIPv4MappedAddress() ? g.toIPv4Address() : g;
15072
- }, C.subnetMatch = function(p, g, A) {
15058
+ }, I.subnetMatch = function(p, g, A) {
15073
15059
  let O, P, N, xe;
15074
15060
  A == null && (A = "unicast");
15075
15061
  for (P in g)
@@ -15079,7 +15065,7 @@ var Ag = { exports: {} };
15079
15065
  return P;
15080
15066
  }
15081
15067
  return A;
15082
- }, r.exports ? r.exports = C : e.ipaddr = C;
15068
+ }, r.exports ? r.exports = I : e.ipaddr = I;
15083
15069
  })(tc);
15084
15070
  })(Ag);
15085
15071
  var Rh = Ag.exports;
@@ -15433,7 +15419,7 @@ var Qt;
15433
15419
  (function(r) {
15434
15420
  r[r.unused = 1] = "unused", r[r.keyCompromise = 2] = "keyCompromise", r[r.cACompromise = 4] = "cACompromise", r[r.affiliationChanged = 8] = "affiliationChanged", r[r.superseded = 16] = "superseded", r[r.cessationOfOperation = 32] = "cessationOfOperation", r[r.certificateHold = 64] = "certificateHold", r[r.privilegeWithdrawn = 128] = "privilegeWithdrawn", r[r.aACompromise = 256] = "aACompromise";
15435
15421
  })(Qt || (Qt = {}));
15436
- class Ig extends du {
15422
+ class Cg extends du {
15437
15423
  toJSON() {
15438
15424
  const e = [], t = this.toNumber();
15439
15425
  return t & Qt.aACompromise && e.push("aACompromise"), t & Qt.affiliationChanged && e.push("affiliationChanged"), t & Qt.cACompromise && e.push("cACompromise"), t & Qt.certificateHold && e.push("certificateHold"), t & Qt.cessationOfOperation && e.push("cessationOfOperation"), t & Qt.keyCompromise && e.push("keyCompromise"), t & Qt.privilegeWithdrawn && e.push("privilegeWithdrawn"), t & Qt.superseded && e.push("superseded"), t & Qt.unused && e.push("unused"), e;
@@ -15465,7 +15451,7 @@ l([
15465
15451
  h({ type: rs, context: 0, optional: !0 })
15466
15452
  ], ui.prototype, "distributionPoint", void 0);
15467
15453
  l([
15468
- h({ type: Ig, context: 1, optional: !0, implicit: !0 })
15454
+ h({ type: Cg, context: 1, optional: !0, implicit: !0 })
15469
15455
  ], ui.prototype, "reasons", void 0);
15470
15456
  l([
15471
15457
  h({ type: be, context: 2, optional: !0, repeated: "sequence", implicit: !0 })
@@ -15503,7 +15489,7 @@ l([
15503
15489
  h({ type: v.Boolean, context: 2, defaultValue: yt.ONLY, implicit: !0 })
15504
15490
  ], yt.prototype, "onlyContainsCACerts", void 0);
15505
15491
  l([
15506
- h({ type: Ig, context: 3, optional: !0, implicit: !0 })
15492
+ h({ type: Cg, context: 3, optional: !0, implicit: !0 })
15507
15493
  ], yt.prototype, "onlySomeReasons", void 0);
15508
15494
  l([
15509
15495
  h({ type: v.Boolean, context: 4, defaultValue: yt.ONLY, implicit: !0 })
@@ -15533,7 +15519,7 @@ zl = l([
15533
15519
  $({ type: R.Choice })
15534
15520
  ], zl);
15535
15521
  var Gl;
15536
- const Cg = `${jn}.37`;
15522
+ const Ig = `${jn}.37`;
15537
15523
  let lc = Gl = class extends Ve {
15538
15524
  constructor(e) {
15539
15525
  super(e), Object.setPrototypeOf(this, Gl.prototype);
@@ -15646,24 +15632,24 @@ l([
15646
15632
  })
15647
15633
  ], Ng.prototype, "inhibitPolicyMapping", void 0);
15648
15634
  var ed;
15649
- class If {
15635
+ class Cf {
15650
15636
  constructor(e = {}) {
15651
15637
  this.issuerDomainPolicy = "", this.subjectDomainPolicy = "", Object.assign(this, e);
15652
15638
  }
15653
15639
  }
15654
15640
  l([
15655
15641
  h({ type: v.ObjectIdentifier })
15656
- ], If.prototype, "issuerDomainPolicy", void 0);
15642
+ ], Cf.prototype, "issuerDomainPolicy", void 0);
15657
15643
  l([
15658
15644
  h({ type: v.ObjectIdentifier })
15659
- ], If.prototype, "subjectDomainPolicy", void 0);
15645
+ ], Cf.prototype, "subjectDomainPolicy", void 0);
15660
15646
  let Hh = ed = class extends Ve {
15661
15647
  constructor(e) {
15662
15648
  super(e), Object.setPrototypeOf(this, ed.prototype);
15663
15649
  }
15664
15650
  };
15665
15651
  Hh = ed = l([
15666
- $({ type: R.Sequence, itemType: If })
15652
+ $({ type: R.Sequence, itemType: Cf })
15667
15653
  ], Hh);
15668
15654
  var td;
15669
15655
  const Bg = `${jn}.17`;
@@ -15944,20 +15930,20 @@ l([
15944
15930
  l([
15945
15931
  h({ type: Wt, optional: !0, context: 0, repeated: "sequence" })
15946
15932
  ], tn.prototype, "crlExtensions", void 0);
15947
- class Cf {
15933
+ class If {
15948
15934
  constructor(e = {}) {
15949
15935
  this.tbsCertList = new tn(), this.signatureAlgorithm = new Y(), this.signature = new ArrayBuffer(0), Object.assign(this, e);
15950
15936
  }
15951
15937
  }
15952
15938
  l([
15953
15939
  h({ type: tn })
15954
- ], Cf.prototype, "tbsCertList", void 0);
15940
+ ], If.prototype, "tbsCertList", void 0);
15955
15941
  l([
15956
15942
  h({ type: Y })
15957
- ], Cf.prototype, "signatureAlgorithm", void 0);
15943
+ ], If.prototype, "signatureAlgorithm", void 0);
15958
15944
  l([
15959
15945
  h({ type: v.BitString })
15960
- ], Cf.prototype, "signature", void 0);
15946
+ ], If.prototype, "signature", void 0);
15961
15947
  class li {
15962
15948
  constructor(e = {}) {
15963
15949
  this.issuer = new et(), this.serialNumber = new ArrayBuffer(0), Object.assign(this, e);
@@ -16930,7 +16916,7 @@ l([
16930
16916
  l([
16931
16917
  h({ type: v.Integer, converter: Ke })
16932
16918
  ], kc.prototype, "s", void 0);
16933
- const Nt = "1.2.840.113549.1.1", as = `${Nt}.1`, s1 = `${Nt}.7`, i1 = `${Nt}.9`, Ui = `${Nt}.10`, a1 = `${Nt}.2`, o1 = `${Nt}.4`, Sc = `${Nt}.5`, c1 = `${Nt}.14`, kd = `${Nt}.11`, Ac = `${Nt}.12`, Oc = `${Nt}.13`, Lg = `${Nt}.15`, qg = `${Nt}.16`, Ec = "1.3.14.3.2.26", Hg = "2.16.840.1.101.3.4.2.4", Ic = "2.16.840.1.101.3.4.2.1", Cc = "2.16.840.1.101.3.4.2.2", jc = "2.16.840.1.101.3.4.2.3", u1 = "2.16.840.1.101.3.4.2.5", l1 = "2.16.840.1.101.3.4.2.6", d1 = "1.2.840.113549.2.2", f1 = "1.2.840.113549.2.5", Iu = `${Nt}.8`;
16919
+ const Nt = "1.2.840.113549.1.1", as = `${Nt}.1`, s1 = `${Nt}.7`, i1 = `${Nt}.9`, Ui = `${Nt}.10`, a1 = `${Nt}.2`, o1 = `${Nt}.4`, Sc = `${Nt}.5`, c1 = `${Nt}.14`, kd = `${Nt}.11`, Ac = `${Nt}.12`, Oc = `${Nt}.13`, Lg = `${Nt}.15`, qg = `${Nt}.16`, Ec = "1.3.14.3.2.26", Hg = "2.16.840.1.101.3.4.2.4", Cc = "2.16.840.1.101.3.4.2.1", Ic = "2.16.840.1.101.3.4.2.2", jc = "2.16.840.1.101.3.4.2.3", u1 = "2.16.840.1.101.3.4.2.5", l1 = "2.16.840.1.101.3.4.2.6", d1 = "1.2.840.113549.2.2", f1 = "1.2.840.113549.2.5", Cu = `${Nt}.8`;
16934
16920
  function at(r) {
16935
16921
  return new Y({ algorithm: r, parameters: null });
16936
16922
  }
@@ -16938,13 +16924,13 @@ at(d1);
16938
16924
  at(f1);
16939
16925
  const os = at(Ec);
16940
16926
  at(Hg);
16941
- at(Ic);
16942
16927
  at(Cc);
16928
+ at(Ic);
16943
16929
  at(jc);
16944
16930
  at(u1);
16945
16931
  at(l1);
16946
16932
  const Fg = new Y({
16947
- algorithm: Iu,
16933
+ algorithm: Cu,
16948
16934
  parameters: L.serialize(os)
16949
16935
  }), Kg = new Y({
16950
16936
  algorithm: i1,
@@ -16960,31 +16946,31 @@ at(Ac);
16960
16946
  at(Oc);
16961
16947
  at(Lg);
16962
16948
  at(qg);
16963
- class Cu {
16949
+ class Iu {
16964
16950
  constructor(e = {}) {
16965
16951
  this.hashAlgorithm = new Y(os), this.maskGenAlgorithm = new Y({
16966
- algorithm: Iu,
16952
+ algorithm: Cu,
16967
16953
  parameters: L.serialize(os)
16968
16954
  }), this.pSourceAlgorithm = new Y(Kg), Object.assign(this, e);
16969
16955
  }
16970
16956
  }
16971
16957
  l([
16972
16958
  h({ type: Y, context: 0, defaultValue: os })
16973
- ], Cu.prototype, "hashAlgorithm", void 0);
16959
+ ], Iu.prototype, "hashAlgorithm", void 0);
16974
16960
  l([
16975
16961
  h({ type: Y, context: 1, defaultValue: Fg })
16976
- ], Cu.prototype, "maskGenAlgorithm", void 0);
16962
+ ], Iu.prototype, "maskGenAlgorithm", void 0);
16977
16963
  l([
16978
16964
  h({ type: Y, context: 2, defaultValue: Kg })
16979
- ], Cu.prototype, "pSourceAlgorithm", void 0);
16965
+ ], Iu.prototype, "pSourceAlgorithm", void 0);
16980
16966
  new Y({
16981
16967
  algorithm: s1,
16982
- parameters: L.serialize(new Cu())
16968
+ parameters: L.serialize(new Iu())
16983
16969
  });
16984
16970
  class cs {
16985
16971
  constructor(e = {}) {
16986
16972
  this.hashAlgorithm = new Y(os), this.maskGenAlgorithm = new Y({
16987
- algorithm: Iu,
16973
+ algorithm: Cu,
16988
16974
  parameters: L.serialize(os)
16989
16975
  }), this.saltLength = 20, this.trailerField = 1, Object.assign(this, e);
16990
16976
  }
@@ -17247,7 +17233,7 @@ function y1(r) {
17247
17233
  function Wg(r) {
17248
17234
  return !!r.useClass;
17249
17235
  }
17250
- function Id(r) {
17236
+ function Cd(r) {
17251
17237
  return !!r.useFactory;
17252
17238
  }
17253
17239
  var zg = function() {
@@ -17303,7 +17289,7 @@ function To(r) {
17303
17289
  return r.useValue != null;
17304
17290
  }
17305
17291
  function b1(r) {
17306
- return Wg(r) || To(r) || jo(r) || Id(r);
17292
+ return Wg(r) || To(r) || jo(r) || Cd(r);
17307
17293
  }
17308
17294
  var Ff = function() {
17309
17295
  function r() {
@@ -17380,7 +17366,7 @@ var A1 = function(r) {
17380
17366
  this.preResolution = new A1(), this.postResolution = new O1();
17381
17367
  }
17382
17368
  return r;
17383
- }(), Gg = /* @__PURE__ */ new Map(), I1 = function() {
17369
+ }(), Gg = /* @__PURE__ */ new Map(), C1 = function() {
17384
17370
  function r(e) {
17385
17371
  this.parent = e, this._registry = new x1(), this.interceptors = new E1(), this.disposed = !1, this.disposables = /* @__PURE__ */ new Set();
17386
17372
  }
@@ -17396,7 +17382,7 @@ var A1 = function(r) {
17396
17382
  var c = this._registry.get(o);
17397
17383
  c && jo(c.provider) ? a = c.provider : a = null;
17398
17384
  }
17399
- if ((n.lifecycle === At.Singleton || n.lifecycle == At.ContainerScoped || n.lifecycle == At.ResolutionScoped) && (To(s) || Id(s)))
17385
+ if ((n.lifecycle === At.Singleton || n.lifecycle == At.ContainerScoped || n.lifecycle == At.ResolutionScoped) && (To(s) || Cd(s)))
17400
17386
  throw new Error('Cannot use lifecycle "' + At[n.lifecycle] + '" with ValueProviders or FactoryProviders');
17401
17387
  return this._registry.set(e, { provider: s, options: n }), this;
17402
17388
  }, r.prototype.registerType = function(e, t) {
@@ -17483,7 +17469,7 @@ var A1 = function(r) {
17483
17469
  if (this.ensureNotDisposed(), e.options.lifecycle === At.ResolutionScoped && t.scopedResolutions.has(e))
17484
17470
  return t.scopedResolutions.get(e);
17485
17471
  var n = e.options.lifecycle === At.Singleton, s = e.options.lifecycle === At.ContainerScoped, i = n || s, a;
17486
- return To(e.provider) ? a = e.provider.useValue : jo(e.provider) ? a = i ? e.instance || (e.instance = this.resolve(e.provider.useToken, t)) : this.resolve(e.provider.useToken, t) : Wg(e.provider) ? a = i ? e.instance || (e.instance = this.construct(e.provider.useClass, t)) : this.construct(e.provider.useClass, t) : Id(e.provider) ? a = e.provider.useFactory(this) : a = this.construct(e.provider, t), e.options.lifecycle === At.ResolutionScoped && t.scopedResolutions.set(e, a), a;
17472
+ return To(e.provider) ? a = e.provider.useValue : jo(e.provider) ? a = i ? e.instance || (e.instance = this.resolve(e.provider.useToken, t)) : this.resolve(e.provider.useToken, t) : Wg(e.provider) ? a = i ? e.instance || (e.instance = this.construct(e.provider.useClass, t)) : this.construct(e.provider.useClass, t) : Cd(e.provider) ? a = e.provider.useFactory(this) : a = this.construct(e.provider, t), e.options.lifecycle === At.ResolutionScoped && t.scopedResolutions.set(e, a), a;
17487
17473
  }, r.prototype.resolveAll = function(e, t) {
17488
17474
  var n = this;
17489
17475
  t === void 0 && (t = new tp()), this.ensureNotDisposed();
@@ -17610,7 +17596,7 @@ var A1 = function(r) {
17610
17596
  if (this.disposed)
17611
17597
  throw new Error("This container has been disposed, you cannot interact with a disposed container");
17612
17598
  }, r;
17613
- }(), pt = new I1();
17599
+ }(), pt = new C1();
17614
17600
  function Nu() {
17615
17601
  return function(r) {
17616
17602
  Gg.set(r, y1(r));
@@ -17618,7 +17604,7 @@ function Nu() {
17618
17604
  }
17619
17605
  if (typeof Reflect > "u" || !Reflect.getMetadata)
17620
17606
  throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);
17621
- var Cd;
17607
+ var Id;
17622
17608
  class Bu {
17623
17609
  constructor(e = {}) {
17624
17610
  this.attrId = "", this.attrValues = [], Object.assign(e);
@@ -17630,12 +17616,12 @@ l([
17630
17616
  l([
17631
17617
  h({ type: v.Any, repeated: "set" })
17632
17618
  ], Bu.prototype, "attrValues", void 0);
17633
- let rp = Cd = class extends Ve {
17619
+ let rp = Id = class extends Ve {
17634
17620
  constructor(e) {
17635
- super(e), Object.setPrototypeOf(this, Cd.prototype);
17621
+ super(e), Object.setPrototypeOf(this, Id.prototype);
17636
17622
  }
17637
17623
  };
17638
- rp = Cd = l([
17624
+ rp = Id = l([
17639
17625
  $({ type: R.Sequence, itemType: Bu })
17640
17626
  ], rp);
17641
17627
  var jd;
@@ -18045,7 +18031,7 @@ l([
18045
18031
  *
18046
18032
  */
18047
18033
  const po = "crypto.algorithm";
18048
- class C1 {
18034
+ class I1 {
18049
18035
  getAlgorithms() {
18050
18036
  return pt.resolveAll(po);
18051
18037
  }
@@ -18081,9 +18067,9 @@ class C1 {
18081
18067
  }
18082
18068
  }
18083
18069
  const us = "crypto.algorithmProvider";
18084
- pt.registerSingleton(us, C1);
18070
+ pt.registerSingleton(us, I1);
18085
18071
  var No;
18086
- const Bt = "1.3.36.3.3.2.8.1.1", xp = `${Bt}.1`, _p = `${Bt}.2`, wp = `${Bt}.3`, kp = `${Bt}.4`, Sp = `${Bt}.5`, Ap = `${Bt}.6`, Op = `${Bt}.7`, Ep = `${Bt}.8`, Ip = `${Bt}.9`, Cp = `${Bt}.10`, jp = `${Bt}.11`, Tp = `${Bt}.12`, Np = `${Bt}.13`, Bp = `${Bt}.14`, Rp = "brainpoolP160r1", Pp = "brainpoolP160t1", $p = "brainpoolP192r1", Dp = "brainpoolP192t1", Zp = "brainpoolP224r1", Mp = "brainpoolP224t1", Up = "brainpoolP256r1", Vp = "brainpoolP256t1", Lp = "brainpoolP320r1", qp = "brainpoolP320t1", Hp = "brainpoolP384r1", Fp = "brainpoolP384t1", Kp = "brainpoolP512r1", Wp = "brainpoolP512t1", ze = "ECDSA";
18072
+ const Bt = "1.3.36.3.3.2.8.1.1", xp = `${Bt}.1`, _p = `${Bt}.2`, wp = `${Bt}.3`, kp = `${Bt}.4`, Sp = `${Bt}.5`, Ap = `${Bt}.6`, Op = `${Bt}.7`, Ep = `${Bt}.8`, Cp = `${Bt}.9`, Ip = `${Bt}.10`, jp = `${Bt}.11`, Tp = `${Bt}.12`, Np = `${Bt}.13`, Bp = `${Bt}.14`, Rp = "brainpoolP160r1", Pp = "brainpoolP160t1", $p = "brainpoolP192r1", Dp = "brainpoolP192t1", Zp = "brainpoolP224r1", Mp = "brainpoolP224t1", Up = "brainpoolP256r1", Vp = "brainpoolP256t1", Lp = "brainpoolP320r1", qp = "brainpoolP320t1", Hp = "brainpoolP384r1", Fp = "brainpoolP384t1", Kp = "brainpoolP512r1", Wp = "brainpoolP512t1", ze = "ECDSA";
18087
18073
  let Oa = No = class {
18088
18074
  toAsnAlgorithm(e) {
18089
18075
  switch (e.name.toLowerCase()) {
@@ -18139,10 +18125,10 @@ let Oa = No = class {
18139
18125
  t = Ep;
18140
18126
  break;
18141
18127
  case Lp:
18142
- t = Ip;
18128
+ t = Cp;
18143
18129
  break;
18144
18130
  case qp:
18145
- t = Cp;
18131
+ t = Ip;
18146
18132
  break;
18147
18133
  case Hp:
18148
18134
  t = jp;
@@ -18204,9 +18190,9 @@ let Oa = No = class {
18204
18190
  return { name: ze, namedCurve: Up };
18205
18191
  case Ep:
18206
18192
  return { name: ze, namedCurve: Vp };
18207
- case Ip:
18208
- return { name: ze, namedCurve: Lp };
18209
18193
  case Cp:
18194
+ return { name: ze, namedCurve: Lp };
18195
+ case Ip:
18210
18196
  return { name: ze, namedCurve: qp };
18211
18197
  case jp:
18212
18198
  return { name: ze, namedCurve: Hp };
@@ -18262,8 +18248,8 @@ class Tn {
18262
18248
  Tn.items = {
18263
18249
  [Ec]: "sha1",
18264
18250
  [Hg]: "sha224",
18265
- [Ic]: "sha256",
18266
- [Cc]: "sha384",
18251
+ [Cc]: "sha256",
18252
+ [Ic]: "sha384",
18267
18253
  [jc]: "sha512",
18268
18254
  [as]: "rsaEncryption",
18269
18255
  [Sc]: "sha1WithRSAEncryption",
@@ -18779,7 +18765,7 @@ class Ea extends Nn {
18779
18765
  }
18780
18766
  }
18781
18767
  Ea.NAME = "GeneralNames";
18782
- const Vi = "-{5}", Ia = "\\n", $1 = `[^${Ia}]+`, D1 = `${Vi}BEGIN (${$1}(?=${Vi}))${Vi}`, Z1 = `${Vi}END \\1${Vi}`, ti = "\\n", M1 = `[^:${Ia}]+`, U1 = `(?:[^${Ia}]+${ti}(?: +[^${Ia}]+${ti})*)`, V1 = "[a-zA-Z0-9=+/]+", L1 = `(?:${V1}${ti})+`, Xp = `${D1}${ti}(?:((?:${M1}: ${U1})+))?${ti}?(${L1})${Z1}`;
18768
+ const Vi = "-{5}", Ca = "\\n", $1 = `[^${Ca}]+`, D1 = `${Vi}BEGIN (${$1}(?=${Vi}))${Vi}`, Z1 = `${Vi}END \\1${Vi}`, ti = "\\n", M1 = `[^:${Ca}]+`, U1 = `(?:[^${Ca}]+${ti}(?: +[^${Ca}]+${ti})*)`, V1 = "[a-zA-Z0-9=+/]+", L1 = `(?:${V1}${ti})+`, Xp = `${D1}${ti}(?:((?:${M1}: ${U1})+))?${ti}?(${L1})${Z1}`;
18783
18769
  class $t {
18784
18770
  static isPem(e) {
18785
18771
  return typeof e == "string" && new RegExp(Xp, "g").test(e);
@@ -18789,7 +18775,7 @@ class $t {
18789
18775
  const t = new RegExp(Xp, "g"), n = [];
18790
18776
  let s = null;
18791
18777
  for (; s = t.exec(e); ) {
18792
- const i = s[3].replace(new RegExp(`[${Ia}]+`, "g"), ""), a = {
18778
+ const i = s[3].replace(new RegExp(`[${Ca}]+`, "g"), ""), a = {
18793
18779
  type: s[1],
18794
18780
  headers: [],
18795
18781
  rawData: te.FromBase64(i)
@@ -18968,12 +18954,12 @@ function q1(r, e) {
18968
18954
  parameters: null
18969
18955
  }), e = L.serialize(r), e;
18970
18956
  }
18971
- class Ca extends Gt {
18957
+ class Ia extends Gt {
18972
18958
  static async create(e, t = !1, n = lt.get()) {
18973
18959
  if ("name" in e && "serialNumber" in e)
18974
- return new Ca(e, t);
18960
+ return new Ia(e, t);
18975
18961
  const i = await (await ur.create(e, n)).getKeyIdentifier(n);
18976
- return new Ca(te.ToHex(i), t);
18962
+ return new Ia(te.ToHex(i), t);
18977
18963
  }
18978
18964
  constructor(...e) {
18979
18965
  if (q.isBufferSource(e[0]))
@@ -19002,7 +18988,7 @@ class Ca extends Gt {
19002
18988
  return t.authorityCertIssuer && (e["Authority Issuer"] = new Ea(t.authorityCertIssuer).toTextObject()), t.authorityCertSerialNumber && (e["Authority Serial Number"] = t.authorityCertSerialNumber), t.keyIdentifier && (e[""] = t.keyIdentifier), e;
19003
18989
  }
19004
18990
  }
19005
- Ca.NAME = "Authority Key Identifier";
18991
+ Ia.NAME = "Authority Key Identifier";
19006
18992
  class Wf extends Gt {
19007
18993
  constructor(...e) {
19008
18994
  if (q.isBufferSource(e[0])) {
@@ -19035,7 +19021,7 @@ class zf extends Gt {
19035
19021
  this.usages = t.map((n) => n);
19036
19022
  } else {
19037
19023
  const t = new lc(e[0]);
19038
- super(Cg, e[1], L.serialize(t)), this.usages = e[0];
19024
+ super(Ig, e[1], L.serialize(t)), this.usages = e[0];
19039
19025
  }
19040
19026
  }
19041
19027
  toTextObject() {
@@ -19328,7 +19314,7 @@ let Kd = Bo = class {
19328
19314
  return n ? new cs({
19329
19315
  hashAlgorithm: n,
19330
19316
  maskGenAlgorithm: new Y({
19331
- algorithm: Iu,
19317
+ algorithm: Cu,
19332
19318
  parameters: L.serialize(n)
19333
19319
  }),
19334
19320
  saltLength: t
@@ -19411,9 +19397,9 @@ let Wd = class {
19411
19397
  case "sha-1":
19412
19398
  return new Y({ algorithm: Ec });
19413
19399
  case "sha-256":
19414
- return new Y({ algorithm: Ic });
19415
- case "sha-384":
19416
19400
  return new Y({ algorithm: Cc });
19401
+ case "sha-384":
19402
+ return new Y({ algorithm: Ic });
19417
19403
  case "sha-512":
19418
19404
  return new Y({ algorithm: jc });
19419
19405
  }
@@ -19423,9 +19409,9 @@ let Wd = class {
19423
19409
  switch (e.algorithm) {
19424
19410
  case Ec:
19425
19411
  return { name: "SHA-1" };
19426
- case Ic:
19427
- return { name: "SHA-256" };
19428
19412
  case Cc:
19413
+ return { name: "SHA-256" };
19414
+ case Ic:
19429
19415
  return { name: "SHA-384" };
19430
19416
  case jc:
19431
19417
  return { name: "SHA-512" };
@@ -19731,10 +19717,10 @@ class K1 {
19731
19717
  hash: "SHA-256"
19732
19718
  }, f = "signingKey" in e ? { ...u, ...e.signingAlgorithm, ...e.signingKey.algorithm } : { ...u, ...e.signingAlgorithm }, y = pt.resolve(us);
19733
19719
  c.tbsCertificate.signature = c.signatureAlgorithm = y.toAsnAlgorithm(f);
19734
- const B = L.serialize(c.tbsCertificate), C = "signingKey" in e ? await t.subtle.sign(f, e.signingKey, B) : e.signature, p = pt.resolveAll(yo).reverse();
19720
+ const B = L.serialize(c.tbsCertificate), I = "signingKey" in e ? await t.subtle.sign(f, e.signingKey, B) : e.signature, p = pt.resolveAll(yo).reverse();
19735
19721
  let g = null;
19736
19722
  for (const A of p)
19737
- if (g = A.toAsnSignature(f, C), g)
19723
+ if (g = A.toAsnSignature(f, I), g)
19738
19724
  break;
19739
19725
  if (!g)
19740
19726
  throw Error("Cannot convert ASN.1 signature value to WebCrypto format");
@@ -19746,10 +19732,10 @@ var rm;
19746
19732
  r[r.unspecified = 0] = "unspecified", r[r.keyCompromise = 1] = "keyCompromise", r[r.cACompromise = 2] = "cACompromise", r[r.affiliationChanged = 3] = "affiliationChanged", r[r.superseded = 4] = "superseded", r[r.cessationOfOperation = 5] = "cessationOfOperation", r[r.certificateHold = 6] = "certificateHold", r[r.removeFromCRL = 8] = "removeFromCRL", r[r.privilegeWithdrawn = 9] = "privilegeWithdrawn", r[r.aACompromise = 10] = "aACompromise";
19747
19733
  })(rm || (rm = {}));
19748
19734
  Jt.register(Og, Wf);
19749
- Jt.register(Cg, zf);
19735
+ Jt.register(Ig, zf);
19750
19736
  Jt.register(jg, Gf);
19751
19737
  Jt.register(Rg, mo);
19752
- Jt.register(Vl, Ca);
19738
+ Jt.register(Vl, Ia);
19753
19739
  Jt.register(Bg, c0);
19754
19740
  Jt.register(Kl, l0);
19755
19741
  Jt.register(Ul, d0);
@@ -20044,7 +20030,7 @@ const Y1 = 1e3 * 60 * 60 * 24, X1 = new ut().openapi(
20044
20030
  async (r) => {
20045
20031
  const { kid: e } = r.req.valid("param"), n = (await r.env.data.keys.list()).find((s) => s.kid === e);
20046
20032
  if (!n)
20047
- throw new de(404, { message: "Key not found" });
20033
+ throw new le(404, { message: "Key not found" });
20048
20034
  return r.json(n);
20049
20035
  }
20050
20036
  ).openapi(
@@ -20108,7 +20094,7 @@ const Y1 = 1e3 * 60 * 60 * 24, X1 = new ut().openapi(
20108
20094
  if (!await r.env.data.keys.update(e, {
20109
20095
  revoked_at: (/* @__PURE__ */ new Date()).toISOString()
20110
20096
  }))
20111
- throw new de(404, { message: "Key not found" });
20097
+ throw new le(404, { message: "Key not found" });
20112
20098
  const n = await Jd({
20113
20099
  name: `CN=${r.env.ORGANIZATION_NAME}`
20114
20100
  });
@@ -20230,7 +20216,7 @@ const Y1 = 1e3 * 60 * 60 * 24, X1 = new ut().openapi(
20230
20216
  include_totals: !1
20231
20217
  })).applications.find((i) => i.id === t);
20232
20218
  if (!s)
20233
- throw new de(404);
20219
+ throw new le(404);
20234
20220
  return r.json(s);
20235
20221
  }
20236
20222
  ).openapi(
@@ -20260,7 +20246,7 @@ const Y1 = 1e3 * 60 * 60 * 24, X1 = new ut().openapi(
20260
20246
  async (r) => {
20261
20247
  const { "tenant-id": e } = r.req.valid("header"), { id: t } = r.req.valid("param");
20262
20248
  if (!await r.env.data.applications.remove(e, t))
20263
- throw new de(404, { message: "Application not found" });
20249
+ throw new le(404, { message: "Application not found" });
20264
20250
  return r.text("OK");
20265
20251
  }
20266
20252
  ).openapi(
@@ -20304,7 +20290,7 @@ const Y1 = 1e3 * 60 * 60 * 24, X1 = new ut().openapi(
20304
20290
  await r.env.data.applications.update(e, t, s);
20305
20291
  const i = await r.env.data.applications.get(e, t);
20306
20292
  if (!i)
20307
- throw new de(404, { message: "Application not found" });
20293
+ throw new le(404, { message: "Application not found" });
20308
20294
  return r.json(i);
20309
20295
  }
20310
20296
  ).openapi(
@@ -20658,7 +20644,7 @@ class vt {
20658
20644
  }
20659
20645
  const ye = Object.freeze({
20660
20646
  status: "aborted"
20661
- }), Is = (r) => ({ status: "dirty", value: r }), kt = (r) => ({ status: "valid", value: r }), Xd = (r) => r.status === "aborted", Qd = (r) => r.status === "dirty", ja = (r) => r.status === "valid", Ta = (r) => typeof Promise < "u" && r instanceof Promise;
20647
+ }), Cs = (r) => ({ status: "dirty", value: r }), kt = (r) => ({ status: "valid", value: r }), Xd = (r) => r.status === "aborted", Qd = (r) => r.status === "dirty", ja = (r) => r.status === "valid", Ta = (r) => typeof Promise < "u" && r instanceof Promise;
20662
20648
  function Mc(r, e, t, n) {
20663
20649
  if (typeof e == "function" ? r !== e || !n : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
20664
20650
  return e.get(r);
@@ -20707,7 +20693,7 @@ function ke(r) {
20707
20693
  return a.code === "invalid_enum_value" ? { message: f ?? o.defaultError } : typeof o.data > "u" ? { message: (c = f ?? n) !== null && c !== void 0 ? c : o.defaultError } : a.code !== "invalid_type" ? { message: o.defaultError } : { message: (u = f ?? t) !== null && u !== void 0 ? u : o.defaultError };
20708
20694
  }, description: s };
20709
20695
  }
20710
- class Ie {
20696
+ class Ce {
20711
20697
  constructor(e) {
20712
20698
  this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
20713
20699
  }
@@ -20820,7 +20806,7 @@ class Ie {
20820
20806
  return wr.create(this, this._def);
20821
20807
  }
20822
20808
  nullable() {
20823
- return Cn.create(this, this._def);
20809
+ return In.create(this, this._def);
20824
20810
  }
20825
20811
  nullish() {
20826
20812
  return this.nullable().optional();
@@ -20908,7 +20894,7 @@ function x0(r) {
20908
20894
  function vk(r, e) {
20909
20895
  return !!((e === "v4" || !e) && hk.test(r) || (e === "v6" || !e) && pk.test(r));
20910
20896
  }
20911
- class ar extends Ie {
20897
+ class ar extends Ce {
20912
20898
  _parse(e) {
20913
20899
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== J.string) {
20914
20900
  const i = this._getOrReturnCtx(e);
@@ -21270,7 +21256,7 @@ function bk(r, e) {
21270
21256
  const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n, i = parseInt(r.toFixed(s).replace(".", "")), a = parseInt(e.toFixed(s).replace(".", ""));
21271
21257
  return i % a / Math.pow(10, s);
21272
21258
  }
21273
- class On extends Ie {
21259
+ class On extends Ce {
21274
21260
  constructor() {
21275
21261
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
21276
21262
  }
@@ -21442,7 +21428,7 @@ On.create = (r) => new On({
21442
21428
  coerce: (r == null ? void 0 : r.coerce) || !1,
21443
21429
  ...ke(r)
21444
21430
  });
21445
- class En extends Ie {
21431
+ class En extends Ce {
21446
21432
  constructor() {
21447
21433
  super(...arguments), this.min = this.gte, this.max = this.lte;
21448
21434
  }
@@ -21570,7 +21556,7 @@ En.create = (r) => {
21570
21556
  ...ke(r)
21571
21557
  });
21572
21558
  };
21573
- class Na extends Ie {
21559
+ class Na extends Ce {
21574
21560
  _parse(e) {
21575
21561
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== J.boolean) {
21576
21562
  const n = this._getOrReturnCtx(e);
@@ -21588,7 +21574,7 @@ Na.create = (r) => new Na({
21588
21574
  coerce: (r == null ? void 0 : r.coerce) || !1,
21589
21575
  ...ke(r)
21590
21576
  });
21591
- class ds extends Ie {
21577
+ class ds extends Ce {
21592
21578
  _parse(e) {
21593
21579
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== J.date) {
21594
21580
  const i = this._getOrReturnCtx(e);
@@ -21666,7 +21652,7 @@ ds.create = (r) => new ds({
21666
21652
  typeName: pe.ZodDate,
21667
21653
  ...ke(r)
21668
21654
  });
21669
- class Uc extends Ie {
21655
+ class Uc extends Ce {
21670
21656
  _parse(e) {
21671
21657
  if (this._getType(e) !== J.symbol) {
21672
21658
  const n = this._getOrReturnCtx(e);
@@ -21683,7 +21669,7 @@ Uc.create = (r) => new Uc({
21683
21669
  typeName: pe.ZodSymbol,
21684
21670
  ...ke(r)
21685
21671
  });
21686
- class Ba extends Ie {
21672
+ class Ba extends Ce {
21687
21673
  _parse(e) {
21688
21674
  if (this._getType(e) !== J.undefined) {
21689
21675
  const n = this._getOrReturnCtx(e);
@@ -21700,7 +21686,7 @@ Ba.create = (r) => new Ba({
21700
21686
  typeName: pe.ZodUndefined,
21701
21687
  ...ke(r)
21702
21688
  });
21703
- class Ra extends Ie {
21689
+ class Ra extends Ce {
21704
21690
  _parse(e) {
21705
21691
  if (this._getType(e) !== J.null) {
21706
21692
  const n = this._getOrReturnCtx(e);
@@ -21717,7 +21703,7 @@ Ra.create = (r) => new Ra({
21717
21703
  typeName: pe.ZodNull,
21718
21704
  ...ke(r)
21719
21705
  });
21720
- class ni extends Ie {
21706
+ class ni extends Ce {
21721
21707
  constructor() {
21722
21708
  super(...arguments), this._any = !0;
21723
21709
  }
@@ -21729,7 +21715,7 @@ ni.create = (r) => new ni({
21729
21715
  typeName: pe.ZodAny,
21730
21716
  ...ke(r)
21731
21717
  });
21732
- class zn extends Ie {
21718
+ class zn extends Ce {
21733
21719
  constructor() {
21734
21720
  super(...arguments), this._unknown = !0;
21735
21721
  }
@@ -21741,7 +21727,7 @@ zn.create = (r) => new zn({
21741
21727
  typeName: pe.ZodUnknown,
21742
21728
  ...ke(r)
21743
21729
  });
21744
- class Yr extends Ie {
21730
+ class Yr extends Ce {
21745
21731
  _parse(e) {
21746
21732
  const t = this._getOrReturnCtx(e);
21747
21733
  return K(t, {
@@ -21755,7 +21741,7 @@ Yr.create = (r) => new Yr({
21755
21741
  typeName: pe.ZodNever,
21756
21742
  ...ke(r)
21757
21743
  });
21758
- class Vc extends Ie {
21744
+ class Vc extends Ce {
21759
21745
  _parse(e) {
21760
21746
  if (this._getType(e) !== J.undefined) {
21761
21747
  const n = this._getOrReturnCtx(e);
@@ -21772,7 +21758,7 @@ Vc.create = (r) => new Vc({
21772
21758
  typeName: pe.ZodVoid,
21773
21759
  ...ke(r)
21774
21760
  });
21775
- class lr extends Ie {
21761
+ class lr extends Ce {
21776
21762
  _parse(e) {
21777
21763
  const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
21778
21764
  if (t.parsedType !== J.array)
@@ -21859,9 +21845,9 @@ function ks(r) {
21859
21845
  } else return r instanceof lr ? new lr({
21860
21846
  ...r._def,
21861
21847
  type: ks(r.element)
21862
- }) : r instanceof wr ? wr.create(ks(r.unwrap())) : r instanceof Cn ? Cn.create(ks(r.unwrap())) : r instanceof Ir ? Ir.create(r.items.map((e) => ks(e))) : r;
21848
+ }) : r instanceof wr ? wr.create(ks(r.unwrap())) : r instanceof In ? In.create(ks(r.unwrap())) : r instanceof Cr ? Cr.create(r.items.map((e) => ks(e))) : r;
21863
21849
  }
21864
- class Ye extends Ie {
21850
+ class Ye extends Ce {
21865
21851
  constructor() {
21866
21852
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
21867
21853
  }
@@ -22148,7 +22134,7 @@ Ye.lazycreate = (r, e) => new Ye({
22148
22134
  typeName: pe.ZodObject,
22149
22135
  ...ke(e)
22150
22136
  });
22151
- class Pa extends Ie {
22137
+ class Pa extends Ce {
22152
22138
  _parse(e) {
22153
22139
  const { ctx: t } = this._processInputParams(e), n = this._def.options;
22154
22140
  function s(i) {
@@ -22221,8 +22207,8 @@ Pa.create = (r, e) => new Pa({
22221
22207
  typeName: pe.ZodUnion,
22222
22208
  ...ke(e)
22223
22209
  });
22224
- const Rr = (r) => r instanceof Za ? Rr(r.schema) : r instanceof hr ? Rr(r.innerType()) : r instanceof Ma ? [r.value] : r instanceof In ? r.options : r instanceof Ua ? $e.objectValues(r.enum) : r instanceof Va ? Rr(r._def.innerType) : r instanceof Ba ? [void 0] : r instanceof Ra ? [null] : r instanceof wr ? [void 0, ...Rr(r.unwrap())] : r instanceof Cn ? [null, ...Rr(r.unwrap())] : r instanceof Xf || r instanceof qa ? Rr(r.unwrap()) : r instanceof La ? Rr(r._def.innerType) : [];
22225
- class Zu extends Ie {
22210
+ const Rr = (r) => r instanceof Za ? Rr(r.schema) : r instanceof hr ? Rr(r.innerType()) : r instanceof Ma ? [r.value] : r instanceof Cn ? r.options : r instanceof Ua ? $e.objectValues(r.enum) : r instanceof Va ? Rr(r._def.innerType) : r instanceof Ba ? [void 0] : r instanceof Ra ? [null] : r instanceof wr ? [void 0, ...Rr(r.unwrap())] : r instanceof In ? [null, ...Rr(r.unwrap())] : r instanceof Xf || r instanceof qa ? Rr(r.unwrap()) : r instanceof La ? Rr(r._def.innerType) : [];
22211
+ class Zu extends Ce {
22226
22212
  _parse(e) {
22227
22213
  const { ctx: t } = this._processInputParams(e);
22228
22214
  if (t.parsedType !== J.object)
@@ -22310,7 +22296,7 @@ function ef(r, e) {
22310
22296
  return { valid: !0, data: s };
22311
22297
  } else return t === J.date && n === J.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
22312
22298
  }
22313
- class $a extends Ie {
22299
+ class $a extends Ce {
22314
22300
  _parse(e) {
22315
22301
  const { status: t, ctx: n } = this._processInputParams(e), s = (i, a) => {
22316
22302
  if (Xd(i) || Xd(a))
@@ -22348,7 +22334,7 @@ $a.create = (r, e, t) => new $a({
22348
22334
  typeName: pe.ZodIntersection,
22349
22335
  ...ke(t)
22350
22336
  });
22351
- class Ir extends Ie {
22337
+ class Cr extends Ce {
22352
22338
  _parse(e) {
22353
22339
  const { status: t, ctx: n } = this._processInputParams(e);
22354
22340
  if (n.parsedType !== J.array)
@@ -22382,23 +22368,23 @@ class Ir extends Ie {
22382
22368
  return this._def.items;
22383
22369
  }
22384
22370
  rest(e) {
22385
- return new Ir({
22371
+ return new Cr({
22386
22372
  ...this._def,
22387
22373
  rest: e
22388
22374
  });
22389
22375
  }
22390
22376
  }
22391
- Ir.create = (r, e) => {
22377
+ Cr.create = (r, e) => {
22392
22378
  if (!Array.isArray(r))
22393
22379
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
22394
- return new Ir({
22380
+ return new Cr({
22395
22381
  items: r,
22396
22382
  typeName: pe.ZodTuple,
22397
22383
  rest: null,
22398
22384
  ...ke(e)
22399
22385
  });
22400
22386
  };
22401
- class Da extends Ie {
22387
+ class Da extends Ce {
22402
22388
  get keySchema() {
22403
22389
  return this._def.keyType;
22404
22390
  }
@@ -22426,7 +22412,7 @@ class Da extends Ie {
22426
22412
  return this._def.valueType;
22427
22413
  }
22428
22414
  static create(e, t, n) {
22429
- return t instanceof Ie ? new Da({
22415
+ return t instanceof Ce ? new Da({
22430
22416
  keyType: e,
22431
22417
  valueType: t,
22432
22418
  typeName: pe.ZodRecord,
@@ -22439,7 +22425,7 @@ class Da extends Ie {
22439
22425
  });
22440
22426
  }
22441
22427
  }
22442
- class Lc extends Ie {
22428
+ class Lc extends Ce {
22443
22429
  get keySchema() {
22444
22430
  return this._def.keyType;
22445
22431
  }
@@ -22487,7 +22473,7 @@ Lc.create = (r, e, t) => new Lc({
22487
22473
  typeName: pe.ZodMap,
22488
22474
  ...ke(t)
22489
22475
  });
22490
- class fs extends Ie {
22476
+ class fs extends Ce {
22491
22477
  _parse(e) {
22492
22478
  const { status: t, ctx: n } = this._processInputParams(e);
22493
22479
  if (n.parsedType !== J.set)
@@ -22551,7 +22537,7 @@ fs.create = (r, e) => new fs({
22551
22537
  typeName: pe.ZodSet,
22552
22538
  ...ke(e)
22553
22539
  });
22554
- class Bs extends Ie {
22540
+ class Bs extends Ce {
22555
22541
  constructor() {
22556
22542
  super(...arguments), this.validate = this.implement;
22557
22543
  }
@@ -22599,11 +22585,11 @@ class Bs extends Ie {
22599
22585
  if (this._def.returns instanceof si) {
22600
22586
  const o = this;
22601
22587
  return kt(async function(...c) {
22602
- const u = new Zt([]), f = await o._def.args.parseAsync(c, i).catch((C) => {
22603
- throw u.addIssue(n(c, C)), u;
22588
+ const u = new Zt([]), f = await o._def.args.parseAsync(c, i).catch((I) => {
22589
+ throw u.addIssue(n(c, I)), u;
22604
22590
  }), y = await Reflect.apply(a, this, f);
22605
- return await o._def.returns._def.type.parseAsync(y, i).catch((C) => {
22606
- throw u.addIssue(s(y, C)), u;
22591
+ return await o._def.returns._def.type.parseAsync(y, i).catch((I) => {
22592
+ throw u.addIssue(s(y, I)), u;
22607
22593
  });
22608
22594
  });
22609
22595
  } else {
@@ -22628,7 +22614,7 @@ class Bs extends Ie {
22628
22614
  args(...e) {
22629
22615
  return new Bs({
22630
22616
  ...this._def,
22631
- args: Ir.create(e).rest(zn.create())
22617
+ args: Cr.create(e).rest(zn.create())
22632
22618
  });
22633
22619
  }
22634
22620
  returns(e) {
@@ -22645,14 +22631,14 @@ class Bs extends Ie {
22645
22631
  }
22646
22632
  static create(e, t, n) {
22647
22633
  return new Bs({
22648
- args: e || Ir.create([]).rest(zn.create()),
22634
+ args: e || Cr.create([]).rest(zn.create()),
22649
22635
  returns: t || zn.create(),
22650
22636
  typeName: pe.ZodFunction,
22651
22637
  ...ke(n)
22652
22638
  });
22653
22639
  }
22654
22640
  }
22655
- class Za extends Ie {
22641
+ class Za extends Ce {
22656
22642
  get schema() {
22657
22643
  return this._def.getter();
22658
22644
  }
@@ -22666,7 +22652,7 @@ Za.create = (r, e) => new Za({
22666
22652
  typeName: pe.ZodLazy,
22667
22653
  ...ke(e)
22668
22654
  });
22669
- class Ma extends Ie {
22655
+ class Ma extends Ce {
22670
22656
  _parse(e) {
22671
22657
  if (e.data !== this._def.value) {
22672
22658
  const t = this._getOrReturnCtx(e);
@@ -22688,13 +22674,13 @@ Ma.create = (r, e) => new Ma({
22688
22674
  ...ke(e)
22689
22675
  });
22690
22676
  function _0(r, e) {
22691
- return new In({
22677
+ return new Cn({
22692
22678
  values: r,
22693
22679
  typeName: pe.ZodEnum,
22694
22680
  ...ke(e)
22695
22681
  });
22696
22682
  }
22697
- class In extends Ie {
22683
+ class Cn extends Ce {
22698
22684
  constructor() {
22699
22685
  super(...arguments), Ti.set(this, void 0);
22700
22686
  }
@@ -22739,21 +22725,21 @@ class In extends Ie {
22739
22725
  return e;
22740
22726
  }
22741
22727
  extract(e, t = this._def) {
22742
- return In.create(e, {
22728
+ return Cn.create(e, {
22743
22729
  ...this._def,
22744
22730
  ...t
22745
22731
  });
22746
22732
  }
22747
22733
  exclude(e, t = this._def) {
22748
- return In.create(this.options.filter((n) => !e.includes(n)), {
22734
+ return Cn.create(this.options.filter((n) => !e.includes(n)), {
22749
22735
  ...this._def,
22750
22736
  ...t
22751
22737
  });
22752
22738
  }
22753
22739
  }
22754
22740
  Ti = /* @__PURE__ */ new WeakMap();
22755
- In.create = _0;
22756
- class Ua extends Ie {
22741
+ Cn.create = _0;
22742
+ class Ua extends Ce {
22757
22743
  constructor() {
22758
22744
  super(...arguments), Ni.set(this, void 0);
22759
22745
  }
@@ -22787,7 +22773,7 @@ Ua.create = (r, e) => new Ua({
22787
22773
  typeName: pe.ZodNativeEnum,
22788
22774
  ...ke(e)
22789
22775
  });
22790
- class si extends Ie {
22776
+ class si extends Ce {
22791
22777
  unwrap() {
22792
22778
  return this._def.type;
22793
22779
  }
@@ -22811,7 +22797,7 @@ si.create = (r, e) => new si({
22811
22797
  typeName: pe.ZodPromise,
22812
22798
  ...ke(e)
22813
22799
  });
22814
- class hr extends Ie {
22800
+ class hr extends Ce {
22815
22801
  innerType() {
22816
22802
  return this._def.schema;
22817
22803
  }
@@ -22838,7 +22824,7 @@ class hr extends Ie {
22838
22824
  path: n.path,
22839
22825
  parent: n
22840
22826
  });
22841
- return c.status === "aborted" ? ye : c.status === "dirty" || t.value === "dirty" ? Is(c.value) : c;
22827
+ return c.status === "aborted" ? ye : c.status === "dirty" || t.value === "dirty" ? Cs(c.value) : c;
22842
22828
  });
22843
22829
  {
22844
22830
  if (t.value === "aborted")
@@ -22848,7 +22834,7 @@ class hr extends Ie {
22848
22834
  path: n.path,
22849
22835
  parent: n
22850
22836
  });
22851
- return o.status === "aborted" ? ye : o.status === "dirty" || t.value === "dirty" ? Is(o.value) : o;
22837
+ return o.status === "aborted" ? ye : o.status === "dirty" || t.value === "dirty" ? Cs(o.value) : o;
22852
22838
  }
22853
22839
  }
22854
22840
  if (s.type === "refinement") {
@@ -22900,7 +22886,7 @@ hr.createWithPreprocess = (r, e, t) => new hr({
22900
22886
  typeName: pe.ZodEffects,
22901
22887
  ...ke(t)
22902
22888
  });
22903
- class wr extends Ie {
22889
+ class wr extends Ce {
22904
22890
  _parse(e) {
22905
22891
  return this._getType(e) === J.undefined ? kt(void 0) : this._def.innerType._parse(e);
22906
22892
  }
@@ -22913,7 +22899,7 @@ wr.create = (r, e) => new wr({
22913
22899
  typeName: pe.ZodOptional,
22914
22900
  ...ke(e)
22915
22901
  });
22916
- class Cn extends Ie {
22902
+ class In extends Ce {
22917
22903
  _parse(e) {
22918
22904
  return this._getType(e) === J.null ? kt(null) : this._def.innerType._parse(e);
22919
22905
  }
@@ -22921,12 +22907,12 @@ class Cn extends Ie {
22921
22907
  return this._def.innerType;
22922
22908
  }
22923
22909
  }
22924
- Cn.create = (r, e) => new Cn({
22910
+ In.create = (r, e) => new In({
22925
22911
  innerType: r,
22926
22912
  typeName: pe.ZodNullable,
22927
22913
  ...ke(e)
22928
22914
  });
22929
- class Va extends Ie {
22915
+ class Va extends Ce {
22930
22916
  _parse(e) {
22931
22917
  const { ctx: t } = this._processInputParams(e);
22932
22918
  let n = t.data;
@@ -22946,7 +22932,7 @@ Va.create = (r, e) => new Va({
22946
22932
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
22947
22933
  ...ke(e)
22948
22934
  });
22949
- class La extends Ie {
22935
+ class La extends Ce {
22950
22936
  _parse(e) {
22951
22937
  const { ctx: t } = this._processInputParams(e), n = {
22952
22938
  ...t,
@@ -22989,7 +22975,7 @@ La.create = (r, e) => new La({
22989
22975
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
22990
22976
  ...ke(e)
22991
22977
  });
22992
- class qc extends Ie {
22978
+ class qc extends Ce {
22993
22979
  _parse(e) {
22994
22980
  if (this._getType(e) !== J.nan) {
22995
22981
  const n = this._getOrReturnCtx(e);
@@ -23007,7 +22993,7 @@ qc.create = (r) => new qc({
23007
22993
  ...ke(r)
23008
22994
  });
23009
22995
  const xk = Symbol("zod_brand");
23010
- class Xf extends Ie {
22996
+ class Xf extends Ce {
23011
22997
  _parse(e) {
23012
22998
  const { ctx: t } = this._processInputParams(e), n = t.data;
23013
22999
  return this._def.type._parse({
@@ -23020,7 +23006,7 @@ class Xf extends Ie {
23020
23006
  return this._def.type;
23021
23007
  }
23022
23008
  }
23023
- class go extends Ie {
23009
+ class go extends Ce {
23024
23010
  _parse(e) {
23025
23011
  const { status: t, ctx: n } = this._processInputParams(e);
23026
23012
  if (n.common.async)
@@ -23030,7 +23016,7 @@ class go extends Ie {
23030
23016
  path: n.path,
23031
23017
  parent: n
23032
23018
  });
23033
- return i.status === "aborted" ? ye : i.status === "dirty" ? (t.dirty(), Is(i.value)) : this._def.out._parseAsync({
23019
+ return i.status === "aborted" ? ye : i.status === "dirty" ? (t.dirty(), Cs(i.value)) : this._def.out._parseAsync({
23034
23020
  data: i.value,
23035
23021
  path: n.path,
23036
23022
  parent: n
@@ -23060,7 +23046,7 @@ class go extends Ie {
23060
23046
  });
23061
23047
  }
23062
23048
  }
23063
- class qa extends Ie {
23049
+ class qa extends Ce {
23064
23050
  _parse(e) {
23065
23051
  const t = this._def.innerType._parse(e), n = (s) => (ja(s) && (s.value = Object.freeze(s.value)), s);
23066
23052
  return Ta(t) ? t.then((s) => n(s)) : n(t);
@@ -23092,7 +23078,7 @@ var pe;
23092
23078
  })(pe || (pe = {}));
23093
23079
  const wk = (r, e = {
23094
23080
  message: `Input not instance of ${r.name}`
23095
- }) => w0((t) => t instanceof r, e), k0 = ar.create, S0 = On.create, kk = qc.create, Sk = En.create, A0 = Na.create, Ak = ds.create, Ok = Uc.create, Ek = Ba.create, Ik = Ra.create, Ck = ni.create, jk = zn.create, Tk = Yr.create, Nk = Vc.create, Bk = lr.create, Rk = Ye.create, Pk = Ye.strictCreate, $k = Pa.create, Dk = Zu.create, Zk = $a.create, Mk = Ir.create, Uk = Da.create, Vk = Lc.create, Lk = fs.create, qk = Bs.create, Hk = Za.create, Fk = Ma.create, Kk = In.create, Wk = Ua.create, zk = si.create, im = hr.create, Gk = wr.create, Jk = Cn.create, Yk = hr.createWithPreprocess, Xk = go.create, Qk = () => k0().optional(), eS = () => S0().optional(), tS = () => A0().optional(), rS = {
23081
+ }) => w0((t) => t instanceof r, e), k0 = ar.create, S0 = On.create, kk = qc.create, Sk = En.create, A0 = Na.create, Ak = ds.create, Ok = Uc.create, Ek = Ba.create, Ck = Ra.create, Ik = ni.create, jk = zn.create, Tk = Yr.create, Nk = Vc.create, Bk = lr.create, Rk = Ye.create, Pk = Ye.strictCreate, $k = Pa.create, Dk = Zu.create, Zk = $a.create, Mk = Cr.create, Uk = Da.create, Vk = Lc.create, Lk = fs.create, qk = Bs.create, Hk = Za.create, Fk = Ma.create, Kk = Cn.create, Wk = Ua.create, zk = si.create, im = hr.create, Gk = wr.create, Jk = In.create, Yk = hr.createWithPreprocess, Xk = go.create, Qk = () => k0().optional(), eS = () => S0().optional(), tS = () => A0().optional(), rS = {
23096
23082
  string: (r) => ar.create({ ...r, coerce: !0 }),
23097
23083
  number: (r) => On.create({ ...r, coerce: !0 }),
23098
23084
  boolean: (r) => Na.create({
@@ -23112,7 +23098,7 @@ var Lt = /* @__PURE__ */ Object.freeze({
23112
23098
  addIssueToContext: K,
23113
23099
  ParseStatus: vt,
23114
23100
  INVALID: ye,
23115
- DIRTY: Is,
23101
+ DIRTY: Cs,
23116
23102
  OK: kt,
23117
23103
  isAborted: Xd,
23118
23104
  isDirty: Qd,
@@ -23126,7 +23112,7 @@ var Lt = /* @__PURE__ */ Object.freeze({
23126
23112
  },
23127
23113
  ZodParsedType: J,
23128
23114
  getParsedType: on,
23129
- ZodType: Ie,
23115
+ ZodType: Ce,
23130
23116
  datetimeRegex: x0,
23131
23117
  ZodString: ar,
23132
23118
  ZodNumber: On,
@@ -23145,20 +23131,20 @@ var Lt = /* @__PURE__ */ Object.freeze({
23145
23131
  ZodUnion: Pa,
23146
23132
  ZodDiscriminatedUnion: Zu,
23147
23133
  ZodIntersection: $a,
23148
- ZodTuple: Ir,
23134
+ ZodTuple: Cr,
23149
23135
  ZodRecord: Da,
23150
23136
  ZodMap: Lc,
23151
23137
  ZodSet: fs,
23152
23138
  ZodFunction: Bs,
23153
23139
  ZodLazy: Za,
23154
23140
  ZodLiteral: Ma,
23155
- ZodEnum: In,
23141
+ ZodEnum: Cn,
23156
23142
  ZodNativeEnum: Ua,
23157
23143
  ZodPromise: si,
23158
23144
  ZodEffects: hr,
23159
23145
  ZodTransformer: hr,
23160
23146
  ZodOptional: wr,
23161
- ZodNullable: Cn,
23147
+ ZodNullable: In,
23162
23148
  ZodDefault: Va,
23163
23149
  ZodCatch: La,
23164
23150
  ZodNaN: qc,
@@ -23167,14 +23153,14 @@ var Lt = /* @__PURE__ */ Object.freeze({
23167
23153
  ZodPipeline: go,
23168
23154
  ZodReadonly: qa,
23169
23155
  custom: w0,
23170
- Schema: Ie,
23171
- ZodSchema: Ie,
23156
+ Schema: Ce,
23157
+ ZodSchema: Ce,
23172
23158
  late: _k,
23173
23159
  get ZodFirstPartyTypeKind() {
23174
23160
  return pe;
23175
23161
  },
23176
23162
  coerce: rS,
23177
- any: Ck,
23163
+ any: Ik,
23178
23164
  array: Bk,
23179
23165
  bigint: Sk,
23180
23166
  boolean: A0,
@@ -23191,7 +23177,7 @@ var Lt = /* @__PURE__ */ Object.freeze({
23191
23177
  nan: kk,
23192
23178
  nativeEnum: Wk,
23193
23179
  never: Tk,
23194
- null: Ik,
23180
+ null: Ck,
23195
23181
  nullable: Jk,
23196
23182
  number: S0,
23197
23183
  object: Rk,
@@ -23296,7 +23282,7 @@ const sS = hs.extend({
23296
23282
  async (r) => {
23297
23283
  const { id: e } = r.req.valid("param"), t = await r.env.data.tenants.get(e);
23298
23284
  if (!t)
23299
- throw new de(404);
23285
+ throw new le(404);
23300
23286
  return r.json(t);
23301
23287
  }
23302
23288
  ).openapi(
@@ -23333,7 +23319,7 @@ const sS = hs.extend({
23333
23319
  body: {
23334
23320
  content: {
23335
23321
  "application/json": {
23336
- schema: m.object(Il.shape).partial()
23322
+ schema: m.object(Cl.shape).partial()
23337
23323
  }
23338
23324
  }
23339
23325
  },
@@ -23365,7 +23351,7 @@ const sS = hs.extend({
23365
23351
  body: {
23366
23352
  content: {
23367
23353
  "application/json": {
23368
- schema: m.object(Il.shape)
23354
+ schema: m.object(Cl.shape)
23369
23355
  }
23370
23356
  }
23371
23357
  }
@@ -23461,7 +23447,7 @@ const sS = hs.extend({
23461
23447
  async (r) => {
23462
23448
  const { "tenant-id": e } = r.req.valid("header"), { id: t } = r.req.valid("param"), n = await r.env.data.logs.get(e, t);
23463
23449
  if (!n)
23464
- throw new de(404);
23450
+ throw new le(404);
23465
23451
  return r.json(n);
23466
23452
  }
23467
23453
  ), cS = hs.extend({
@@ -23515,7 +23501,7 @@ const sS = hs.extend({
23515
23501
  body: {
23516
23502
  content: {
23517
23503
  "application/json": {
23518
- schema: m.object(Cl.shape)
23504
+ schema: m.object(Il.shape)
23519
23505
  }
23520
23506
  }
23521
23507
  }
@@ -23555,7 +23541,7 @@ const sS = hs.extend({
23555
23541
  body: {
23556
23542
  content: {
23557
23543
  "application/json": {
23558
- schema: m.object(Cl.shape).omit({ hook_id: !0 }).partial()
23544
+ schema: m.object(Il.shape).omit({ hook_id: !0 }).partial()
23559
23545
  }
23560
23546
  }
23561
23547
  }
@@ -23584,7 +23570,7 @@ const sS = hs.extend({
23584
23570
  await r.env.data.hooks.update(e, t, n);
23585
23571
  const s = await r.env.data.hooks.get(e, t);
23586
23572
  if (!s)
23587
- throw new de(404, { message: "Hook not found" });
23573
+ throw new le(404, { message: "Hook not found" });
23588
23574
  return r.json(s);
23589
23575
  }
23590
23576
  ).openapi(
@@ -23622,7 +23608,7 @@ const sS = hs.extend({
23622
23608
  async (r) => {
23623
23609
  const { "tenant-id": e } = r.req.valid("header"), { hook_id: t } = r.req.valid("param"), n = await r.env.data.hooks.get(e, t);
23624
23610
  if (!n)
23625
- throw new de(404, { message: "Hook not found" });
23611
+ throw new le(404, { message: "Hook not found" });
23626
23612
  return r.json(n);
23627
23613
  }
23628
23614
  ).openapi(
@@ -23652,7 +23638,7 @@ const sS = hs.extend({
23652
23638
  async (r) => {
23653
23639
  const { "tenant-id": e } = r.req.valid("header"), { hook_id: t } = r.req.valid("param");
23654
23640
  if (!await r.env.data.hooks.remove(e, t))
23655
- throw new de(404, { message: "Hook not found" });
23641
+ throw new le(404, { message: "Hook not found" });
23656
23642
  return r.text("OK");
23657
23643
  }
23658
23644
  ), lS = hs.extend({
@@ -23735,7 +23721,7 @@ const sS = hs.extend({
23735
23721
  async (r) => {
23736
23722
  const { "tenant-id": e } = r.req.valid("header"), { id: t } = r.req.valid("param"), n = await r.env.data.connections.get(e, t);
23737
23723
  if (!n)
23738
- throw new de(404);
23724
+ throw new le(404);
23739
23725
  return r.json(n);
23740
23726
  }
23741
23727
  ).openapi(
@@ -23765,7 +23751,7 @@ const sS = hs.extend({
23765
23751
  async (r) => {
23766
23752
  const { "tenant-id": e } = r.req.valid("header"), { id: t } = r.req.valid("param");
23767
23753
  if (!await r.env.data.connections.remove(e, t))
23768
- throw new de(404, {
23754
+ throw new le(404, {
23769
23755
  message: "Connection not found"
23770
23756
  });
23771
23757
  return r.text("OK");
@@ -23809,12 +23795,12 @@ const sS = hs.extend({
23809
23795
  async (r) => {
23810
23796
  const { "tenant-id": e } = r.req.valid("header"), { id: t } = r.req.valid("param"), n = r.req.valid("json");
23811
23797
  if (!await r.env.data.connections.update(e, t, n))
23812
- throw new de(404, {
23798
+ throw new le(404, {
23813
23799
  message: "Connection not found"
23814
23800
  });
23815
23801
  const i = await r.env.data.connections.get(e, t);
23816
23802
  if (!i)
23817
- throw new de(404, {
23803
+ throw new le(404, {
23818
23804
  message: "Connection not found"
23819
23805
  });
23820
23806
  return r.json(i);
@@ -23953,7 +23939,7 @@ async function hS(r) {
23953
23939
  throw new Error("Failed to fetch jwks");
23954
23940
  return (await e.json()).keys;
23955
23941
  } catch (e) {
23956
- throw new de(500, {
23942
+ throw new le(500, {
23957
23943
  message: `Failed to fetch jwks: ${e.message}`
23958
23944
  });
23959
23945
  }
@@ -23997,17 +23983,17 @@ function E0(r) {
23997
23983
  return await t();
23998
23984
  const c = e.req.header("authorization") || "", [u, f] = c.split(" ");
23999
23985
  if ((u == null ? void 0 : u.toLowerCase()) !== "bearer" || !f)
24000
- throw new de(401, {
23986
+ throw new le(401, {
24001
23987
  message: "Missing bearer token"
24002
23988
  });
24003
23989
  const y = mS(f);
24004
23990
  if (!y || !await pS(e, y))
24005
- throw new de(403, { message: "Invalid JWT signature" });
23991
+ throw new le(403, { message: "Invalid JWT signature" });
24006
23992
  e.set("user_id", y.payload.sub), e.set("user", y.payload);
24007
- const B = y.payload.permissions || [], C = ((a = y.payload.scope) == null ? void 0 : a.split(" ")) || [];
23993
+ const B = y.payload.permissions || [], I = ((a = y.payload.scope) == null ? void 0 : a.split(" ")) || [];
24008
23994
  if (o.length && !// Should we check both?
24009
- (o.some((p) => B.includes(p)) || o.some((p) => C.includes(p))))
24010
- throw new de(403, { message: "Unauthorized" });
23995
+ (o.some((p) => B.includes(p)) || o.some((p) => I.includes(p))))
23996
+ throw new le(403, { message: "Unauthorized" });
24011
23997
  }
24012
23998
  return await t();
24013
23999
  };
@@ -24041,7 +24027,7 @@ const yS = new ut().openapi(
24041
24027
  async (r) => {
24042
24028
  const { "tenant-id": e } = r.req.valid("header"), t = await r.env.data.emailProviders.get(e);
24043
24029
  if (!t)
24044
- throw new de(404, { message: "Email provider not found" });
24030
+ throw new le(404, { message: "Email provider not found" });
24045
24031
  return r.json(t);
24046
24032
  }
24047
24033
  ).openapi(
@@ -24121,7 +24107,7 @@ function gS() {
24121
24107
  }
24122
24108
  }), e;
24123
24109
  }
24124
- const So = 60 * 5, I0 = 30 * 24 * 60 * 60, vS = "auth-token", bS = new ut().openapi(
24110
+ const So = 60 * 5, C0 = 30 * 24 * 60 * 60, vS = "auth-token", bS = new ut().openapi(
24125
24111
  ge({
24126
24112
  tags: ["well known"],
24127
24113
  method: "get",
@@ -24319,41 +24305,69 @@ async function kS(r, e) {
24319
24305
  const t = new TextEncoder().encode(r), n = await m0(t);
24320
24306
  return Ro.encode(new Uint8Array(n));
24321
24307
  }
24322
- async function C0(r, e) {
24323
- var y;
24324
- const { authParams: t, user: n, sid: s } = e, a = (await r.env.data.keys.list()).filter(
24325
- (B) => !B.revoked_at || new Date(B.revoked_at) > /* @__PURE__ */ new Date()
24326
- ), o = a[a.length - 1];
24327
- if (!(o != null && o.pkcs7))
24328
- throw new de(500, { message: "No signing key available" });
24329
- const c = wS(o.pkcs7), u = await om(
24330
- "RS256",
24331
- c,
24308
+ async function I0(r, e) {
24309
+ var I, p;
24310
+ const { authParams: t, user: n, client: s, sid: i } = e, o = (await r.env.data.keys.list()).filter(
24311
+ (g) => !g.revoked_at || new Date(g.revoked_at) > /* @__PURE__ */ new Date()
24312
+ ), c = o[o.length - 1];
24313
+ if (!(c != null && c.pkcs7))
24314
+ throw new le(500, { message: "No signing key available" });
24315
+ const u = wS(c.pkcs7), f = {
24316
+ // TODO: consider if the dafault should be removed
24317
+ aud: t.audience || "default",
24318
+ scope: t.scope || "",
24319
+ sub: (n == null ? void 0 : n.user_id) || t.client_id,
24320
+ iss: r.env.ISSUER,
24321
+ tenant_id: r.var.tenant_id,
24322
+ sid: i
24323
+ };
24324
+ (I = r.env.hooks) != null && I.onExecuteCredentialsExchange && await r.env.hooks.onExecuteCredentialsExchange(
24332
24325
  {
24333
- // TODO: consider if the dafault should be removed
24334
- aud: t.audience || "default",
24326
+ client: s,
24327
+ user: n,
24335
24328
  scope: t.scope || "",
24336
- sub: (n == null ? void 0 : n.user_id) || t.client_id,
24337
- iss: r.env.ISSUER,
24338
- tenant_id: r.var.tenant_id,
24339
- sid: s
24329
+ grant_type: ""
24340
24330
  },
24341
24331
  {
24342
- includeIssuedTimestamp: !0,
24343
- expiresIn: new Hc(1, "d"),
24344
- headers: {
24345
- kid: o.kid
24332
+ accessToken: {
24333
+ setCustomClaim: (g, A) => {
24334
+ if ([
24335
+ "sub",
24336
+ "iss",
24337
+ "aud",
24338
+ "exp",
24339
+ "nbf",
24340
+ "iat",
24341
+ "jti"
24342
+ ].includes(g))
24343
+ throw new Error(`Cannot overwrite reserved claim '${g}'`);
24344
+ f[g] = A;
24345
+ }
24346
+ },
24347
+ access: {
24348
+ deny: (g) => {
24349
+ throw new le(400, {
24350
+ message: `Access denied: ${g}`
24351
+ });
24352
+ }
24346
24353
  }
24347
24354
  }
24348
- ), f = n && ((y = t.scope) != null && y.split(" ").includes("openid")) ? await om(
24355
+ );
24356
+ const y = await om("RS256", u, f, {
24357
+ includeIssuedTimestamp: !0,
24358
+ expiresIn: new Hc(1, "d"),
24359
+ headers: {
24360
+ kid: c.kid
24361
+ }
24362
+ }), B = n && ((p = t.scope) != null && p.split(" ").includes("openid")) ? await om(
24349
24363
  "RS256",
24350
- c,
24364
+ u,
24351
24365
  {
24352
24366
  // The audience for an id token is the client id
24353
24367
  aud: t.client_id,
24354
24368
  sub: n.user_id,
24355
24369
  iss: r.env.ISSUER,
24356
- sid: s,
24370
+ sid: i,
24357
24371
  nonce: t.nonce,
24358
24372
  given_name: n.given_name,
24359
24373
  family_name: n.family_name,
@@ -24368,13 +24382,13 @@ async function C0(r, e) {
24368
24382
  includeIssuedTimestamp: !0,
24369
24383
  expiresIn: new Hc(1, "d"),
24370
24384
  headers: {
24371
- kid: o.kid
24385
+ kid: c.kid
24372
24386
  }
24373
24387
  }
24374
24388
  ) : void 0;
24375
24389
  return {
24376
- access_token: u,
24377
- id_token: f,
24390
+ access_token: y,
24391
+ id_token: B,
24378
24392
  token_type: "Bearer",
24379
24393
  expires_in: 86400
24380
24394
  };
@@ -24396,14 +24410,14 @@ const j0 = m.object({
24396
24410
  async function SS(r, e) {
24397
24411
  const t = await r.env.data.clients.get(e.client_id);
24398
24412
  if (!t)
24399
- throw new de(403, { message: "Invalid client credentials" });
24413
+ throw new le(403, { message: "Invalid client credentials" });
24400
24414
  if (t.client_secret && !Po(t.client_secret, e.client_secret))
24401
- throw new de(403, { message: "Invalid client credentials" });
24415
+ throw new le(403, { message: "Invalid client credentials" });
24402
24416
  const n = {
24403
24417
  client_id: t.id,
24404
24418
  scope: e.scope,
24405
24419
  audience: e.audience
24406
- }, s = await C0(r, { authParams: n });
24420
+ }, s = await I0(r, { authParams: n, client: t });
24407
24421
  return r.json(s);
24408
24422
  }
24409
24423
  function T0(r, e, t) {
@@ -24436,19 +24450,19 @@ function ES(r) {
24436
24450
  sameSite: "none"
24437
24451
  });
24438
24452
  }
24439
- function IS(r, e) {
24453
+ function CS(r, e) {
24440
24454
  const t = {
24441
24455
  path: "/",
24442
24456
  httpOnly: !0,
24443
24457
  secure: !0,
24444
- maxAge: I0
24458
+ maxAge: C0
24445
24459
  };
24446
24460
  return T0(Qf(r), e, {
24447
24461
  ...t,
24448
24462
  sameSite: "none"
24449
24463
  });
24450
24464
  }
24451
- const CS = m.object({
24465
+ const IS = m.object({
24452
24466
  grant_type: m.literal("authorization_code"),
24453
24467
  client_id: m.string(),
24454
24468
  code: m.string(),
@@ -24464,51 +24478,54 @@ const CS = m.object({
24464
24478
  async function jS(r, e) {
24465
24479
  const t = await r.env.data.clients.get(e.client_id);
24466
24480
  if (!t)
24467
- throw new de(403, { message: "Client not found" });
24481
+ throw new le(403, { message: "Client not found" });
24468
24482
  const n = await r.env.data.codes.get(
24469
24483
  t.tenant.id,
24470
24484
  e.code,
24471
24485
  "authorization_code"
24472
24486
  );
24473
24487
  if (!n || !n.user_id)
24474
- throw new de(403, { message: "Invalid client credentials" });
24488
+ throw new le(403, { message: "Invalid client credentials" });
24475
24489
  if (new Date(n.expires_at) < /* @__PURE__ */ new Date())
24476
- throw new de(403, { message: "Code expired" });
24490
+ throw new le(403, { message: "Code expired" });
24491
+ if (n.used_at)
24492
+ throw new le(403, { message: "Code already used" });
24477
24493
  const s = await r.env.data.logins.get(t.tenant.id, n.login_id);
24478
24494
  if (!s)
24479
- throw new de(403, { message: "Invalid login" });
24495
+ throw new le(403, { message: "Invalid login" });
24480
24496
  if ("client_secret" in e) {
24481
24497
  const c = await r.env.data.clients.get("DEFAULT_CLIENT");
24482
24498
  if (!Po(t.client_secret, e.client_secret) && !Po(c == null ? void 0 : c.client_secret, e.client_secret))
24483
- throw new de(403, { message: "Invalid client credentials" });
24499
+ throw new le(403, { message: "Invalid client credentials" });
24484
24500
  } else if ("code_verifier" in e && typeof e.code_verifier == "string" && "code_challenge_method" in s.authParams && typeof s.authParams.code_challenge_method == "string") {
24485
24501
  const c = await kS(
24486
24502
  e.code_verifier,
24487
24503
  s.authParams.code_challenge_method
24488
24504
  );
24489
24505
  if (!Po(c, s.authParams.code_challenge || ""))
24490
- throw new de(403, { message: "Invalid client credentials" });
24506
+ throw new le(403, { message: "Invalid client credentials" });
24491
24507
  }
24492
24508
  if (s.authParams.redirect_uri && s.authParams.redirect_uri !== e.redirect_uri)
24493
- throw new de(403, { message: "Invalid redirect uri" });
24509
+ throw new le(403, { message: "Invalid redirect uri" });
24494
24510
  const i = await r.env.data.users.get(t.tenant.id, n.user_id);
24495
24511
  if (!i)
24496
- throw new de(403, { message: "User not found" });
24512
+ throw new le(403, { message: "User not found" });
24497
24513
  await r.env.data.codes.used(t.tenant.id, e.code);
24498
24514
  const a = await r.env.data.sessions.create(t.tenant.id, {
24499
24515
  session_id: rc(),
24500
24516
  user_id: i.user_id,
24501
24517
  client_id: t.id,
24502
- expires_at: new Date(Date.now() + I0 * 1e3).toISOString(),
24518
+ expires_at: new Date(Date.now() + C0 * 1e3).toISOString(),
24503
24519
  used_at: (/* @__PURE__ */ new Date()).toISOString()
24504
- }), o = await C0(r, {
24520
+ }), o = await I0(r, {
24505
24521
  authParams: s.authParams,
24506
24522
  user: i,
24523
+ client: t,
24507
24524
  sid: a.session_id
24508
24525
  });
24509
24526
  return r.json(o, {
24510
24527
  headers: {
24511
- "set-cookie": IS(t.tenant.id, a.session_id)
24528
+ "set-cookie": CS(t.tenant.id, a.session_id)
24512
24529
  }
24513
24530
  });
24514
24531
  }
@@ -24579,12 +24596,12 @@ const BS = new ut().openapi(
24579
24596
  async (r) => {
24580
24597
  const e = r.req.valid("form"), t = NS(r.req.header("Authorization")), n = { ...e, ...t };
24581
24598
  if (!n.client_id)
24582
- throw new de(400, { message: "client_id is required" });
24599
+ throw new le(400, { message: "client_id is required" });
24583
24600
  switch (e.grant_type) {
24584
24601
  case Tl.AuthorizationCode:
24585
24602
  return jS(
24586
24603
  r,
24587
- CS.parse(n)
24604
+ IS.parse(n)
24588
24605
  );
24589
24606
  case Tl.ClientCredential:
24590
24607
  return SS(
@@ -24592,7 +24609,7 @@ const BS = new ut().openapi(
24592
24609
  j0.parse(n)
24593
24610
  );
24594
24611
  default:
24595
- throw new de(400, { message: "Not implemented" });
24612
+ throw new le(400, { message: "Not implemented" });
24596
24613
  }
24597
24614
  }
24598
24615
  );
@@ -24657,7 +24674,7 @@ const $S = new ut().openapi(
24657
24674
  ...n.allowed_logout_urls || [],
24658
24675
  ...(s == null ? void 0 : s.allowed_logout_urls) || []
24659
24676
  ]))
24660
- throw new de(400, {
24677
+ throw new le(400, {
24661
24678
  message: "Invalid redirect uri"
24662
24679
  });
24663
24680
  const a = r.req.header("cookie");
@@ -24720,13 +24737,13 @@ const $S = new ut().openapi(
24720
24737
  }),
24721
24738
  async (r) => {
24722
24739
  if (!r.var.user)
24723
- throw new de(404, { message: "User not found" });
24740
+ throw new le(404, { message: "User not found" });
24724
24741
  const e = await r.env.data.users.get(
24725
24742
  r.var.user.tenant_id,
24726
24743
  r.var.user.sub
24727
24744
  );
24728
24745
  if (!e)
24729
- throw new de(404, {
24746
+ throw new le(404, {
24730
24747
  message: "User not found"
24731
24748
  });
24732
24749
  return r.json(um.parse({ ...e, sub: e.user_id }));
@@ -24842,7 +24859,7 @@ export {
24842
24859
  zu as emailProviderSchema,
24843
24860
  bs as fontDetailsSchema,
24844
24861
  E_ as fontsSchema,
24845
- Cl as hookInsertSchema,
24862
+ Il as hookInsertSchema,
24846
24863
  ji as hookSchema,
24847
24864
  l_ as identitySchema,
24848
24865
  w2 as init,
@@ -24852,7 +24869,7 @@ export {
24852
24869
  x_ as loginInsertSchema,
24853
24870
  wA as loginSchema,
24854
24871
  Sh as openIDConfigurationSchema,
24855
- I_ as pageBackgroundSchema,
24872
+ C_ as pageBackgroundSchema,
24856
24873
  AA as parseUserId,
24857
24874
  k_ as passwordInsertSchema,
24858
24875
  kA as passwordSchema,
@@ -24862,7 +24879,7 @@ export {
24862
24879
  S_ as sessionInsertSchema,
24863
24880
  xy as sessionSchema,
24864
24881
  Ah as signingKeySchema,
24865
- Il as tenantInsertSchema,
24882
+ Cl as tenantInsertSchema,
24866
24883
  Di as tenantSchema,
24867
24884
  j_ as themeInsertSchema,
24868
24885
  SA as themeSchema,
@@ -24871,5 +24888,5 @@ export {
24871
24888
  vA as userResponseSchema,
24872
24889
  my as userSchema,
24873
24890
  bA as vendorSettingsSchema,
24874
- C_ as widgetSchema
24891
+ I_ as widgetSchema
24875
24892
  };