zudoku 0.53.0 → 0.53.2

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.
Files changed (91) hide show
  1. package/README.md +2 -2
  2. package/dist/app/demo.js +16 -1
  3. package/dist/app/demo.js.map +1 -1
  4. package/dist/cli/build/handler.js +9 -1
  5. package/dist/cli/build/handler.js.map +1 -1
  6. package/dist/config/loader.js +2 -5
  7. package/dist/config/loader.js.map +1 -1
  8. package/dist/config/validators/BuildSchema.js +5 -0
  9. package/dist/config/validators/BuildSchema.js.map +1 -1
  10. package/dist/config/validators/validate.d.ts +1 -1
  11. package/dist/config/validators/validate.js +11 -2
  12. package/dist/config/validators/validate.js.map +1 -1
  13. package/dist/config/validators/validate.test.js +65 -2
  14. package/dist/config/validators/validate.test.js.map +1 -1
  15. package/dist/lib/authentication/authentication.d.ts +2 -0
  16. package/dist/lib/authentication/components/SignIn.js +4 -3
  17. package/dist/lib/authentication/components/SignIn.js.map +1 -1
  18. package/dist/lib/authentication/providers/openid.d.ts +4 -2
  19. package/dist/lib/authentication/providers/openid.js +11 -5
  20. package/dist/lib/authentication/providers/openid.js.map +1 -1
  21. package/dist/lib/components/MobileTopNavigation.js +8 -5
  22. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  23. package/dist/lib/components/TopNavigation.d.ts +5 -0
  24. package/dist/lib/components/TopNavigation.js +16 -12
  25. package/dist/lib/components/TopNavigation.js.map +1 -1
  26. package/dist/lib/core/ZudokuContext.d.ts +2 -1
  27. package/dist/lib/core/ZudokuContext.js +14 -1
  28. package/dist/lib/core/ZudokuContext.js.map +1 -1
  29. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +4 -4
  30. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  31. package/dist/lib/plugins/api-keys/index.js +1 -1
  32. package/dist/lib/plugins/markdown/MdxPage.js +3 -2
  33. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  34. package/dist/lib/plugins/openapi/OperationList.js +1 -1
  35. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  36. package/dist/lib/plugins/openapi/index.js +1 -1
  37. package/dist/lib/plugins/openapi/index.js.map +1 -1
  38. package/dist/vite/mdx/remark-last-modified.js +1 -28
  39. package/dist/vite/mdx/remark-last-modified.js.map +1 -1
  40. package/lib/{MdxPage-swXPJ0gf.js → MdxPage-8UuEK446.js} +37 -37
  41. package/lib/MdxPage-8UuEK446.js.map +1 -0
  42. package/lib/{OasProvider-CDAM3TB1.js → OasProvider-BsWpguVO.js} +2 -2
  43. package/lib/{OasProvider-CDAM3TB1.js.map → OasProvider-BsWpguVO.js.map} +1 -1
  44. package/lib/{OperationList-C9Hb9ql8.js → OperationList-PnZbf3b2.js} +6 -6
  45. package/lib/{OperationList-C9Hb9ql8.js.map → OperationList-PnZbf3b2.js.map} +1 -1
  46. package/lib/{Pagination-VGlgeCmS.js → Pagination-DY7gCrm4.js} +2 -2
  47. package/lib/{Pagination-VGlgeCmS.js.map → Pagination-DY7gCrm4.js.map} +1 -1
  48. package/lib/{SchemaList-BAbh1BXO.js → SchemaList-D6k4DKWH.js} +3 -3
  49. package/lib/{SchemaList-BAbh1BXO.js.map → SchemaList-D6k4DKWH.js.map} +1 -1
  50. package/lib/{SchemaView-C2Io712T.js → SchemaView-BhgJ9WB8.js} +3 -3
  51. package/lib/{SchemaView-C2Io712T.js.map → SchemaView-BhgJ9WB8.js.map} +1 -1
  52. package/lib/SignUp-CpUD6DUM.js +56 -0
  53. package/lib/SignUp-CpUD6DUM.js.map +1 -0
  54. package/lib/{circular-B42RaanD.js → circular-BUMjK3JF.js} +2 -2
  55. package/lib/{circular-B42RaanD.js.map → circular-BUMjK3JF.js.map} +1 -1
  56. package/lib/{createServer-BKFsRuuk.js → createServer-BPz8ZCrd.js} +3 -3
  57. package/lib/createServer-BPz8ZCrd.js.map +1 -0
  58. package/lib/{errors-CF2X_x5o.js → errors-DY-qOx9n.js} +3 -3
  59. package/lib/{errors-CF2X_x5o.js.map → errors-DY-qOx9n.js.map} +1 -1
  60. package/lib/{index-CLy1XyH0.js → index-C_xVKbf9.js} +1285 -1240
  61. package/lib/index-C_xVKbf9.js.map +1 -0
  62. package/lib/{index-B6Re5_cx.js → index-dVBKCNMa.js} +123 -123
  63. package/lib/{index-B6Re5_cx.js.map → index-dVBKCNMa.js.map} +1 -1
  64. package/lib/zudoku.auth-azureb2c.js +1 -1
  65. package/lib/zudoku.auth-clerk.js +1 -1
  66. package/lib/zudoku.auth-openid.js +114 -105
  67. package/lib/zudoku.auth-openid.js.map +1 -1
  68. package/lib/zudoku.components.js +1 -1
  69. package/lib/zudoku.plugin-api-catalog.js +1 -1
  70. package/lib/zudoku.plugin-api-keys.js +286 -272
  71. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  72. package/lib/zudoku.plugin-markdown.js +1 -1
  73. package/lib/zudoku.plugin-openapi.js +1 -1
  74. package/package.json +7 -7
  75. package/src/app/demo.tsx +19 -2
  76. package/src/lib/authentication/authentication.ts +2 -2
  77. package/src/lib/authentication/components/SignIn.tsx +5 -12
  78. package/src/lib/authentication/providers/openid.tsx +23 -4
  79. package/src/lib/components/MobileTopNavigation.tsx +56 -7
  80. package/src/lib/components/TopNavigation.tsx +30 -14
  81. package/src/lib/core/ZudokuContext.ts +21 -0
  82. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +13 -9
  83. package/src/lib/plugins/api-keys/index.tsx +1 -1
  84. package/src/lib/plugins/markdown/MdxPage.tsx +3 -2
  85. package/src/lib/plugins/openapi/OperationList.tsx +1 -1
  86. package/src/lib/plugins/openapi/index.tsx +1 -1
  87. package/lib/MdxPage-swXPJ0gf.js.map +0 -1
  88. package/lib/SignUp-5RUdVhnq.js +0 -63
  89. package/lib/SignUp-5RUdVhnq.js.map +0 -1
  90. package/lib/createServer-BKFsRuuk.js.map +0 -1
  91. package/lib/index-CLy1XyH0.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { j as yo } from "./jsx-runtime-C5mzlN2N.js";
2
2
  import { C as aa } from "./ClientOnly-E7hGysn1.js";
3
3
  import { j as sa, u as To } from "./hook-Bd0yS8M0.js";
4
- import { C as ca, A as qt, a as la } from "./errors-CF2X_x5o.js";
4
+ import { C as ca, A as qt, a as la } from "./errors-DY-qOx9n.js";
5
5
  /*! @azure/msal-common v15.7.0 2025-05-30 */
6
6
  const d = {
7
7
  LIBRARY_NAME: "MSAL.JS",
@@ -1,6 +1,6 @@
1
1
  import { j as l } from "./jsx-runtime-C5mzlN2N.js";
2
2
  import { LogOutIcon as g } from "lucide-react";
3
- import { S as f, a as w, b as p } from "./SignUp-5RUdVhnq.js";
3
+ import { S as f, a as w, b as p } from "./SignUp-CpUD6DUM.js";
4
4
  import { u as n } from "./hook-Bd0yS8M0.js";
5
5
  const y = ({
6
6
  clerkPubKey: d,
@@ -2,7 +2,7 @@ import { j as ne } from "./jsx-runtime-C5mzlN2N.js";
2
2
  import { g as Le } from "./invariant-DAFpPywt.js";
3
3
  import { C as Ue } from "./ClientOnly-E7hGysn1.js";
4
4
  import { j as xe, u as S } from "./hook-Bd0yS8M0.js";
5
- import { C as Ce, O as re, A as R, a as Ie } from "./errors-CF2X_x5o.js";
5
+ import { C as Ce, O as re, A as R, a as Ie } from "./errors-DY-qOx9n.js";
6
6
  var O = { exports: {} }, je = O.exports, oe;
7
7
  function De() {
8
8
  return oe || (oe = 1, function(t) {
@@ -17,28 +17,28 @@ function De() {
17
17
  "warn",
18
18
  "error"
19
19
  ], r = {}, i = null;
20
- function c(l, m) {
21
- var u = l[m];
22
- if (typeof u.bind == "function")
23
- return u.bind(l);
20
+ function u(l, m) {
21
+ var c = l[m];
22
+ if (typeof c.bind == "function")
23
+ return c.bind(l);
24
24
  try {
25
- return Function.prototype.bind.call(u, l);
25
+ return Function.prototype.bind.call(c, l);
26
26
  } catch {
27
27
  return function() {
28
- return Function.prototype.apply.apply(u, [l, arguments]);
28
+ return Function.prototype.apply.apply(c, [l, arguments]);
29
29
  };
30
30
  }
31
31
  }
32
- function f() {
32
+ function d() {
33
33
  console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
34
34
  }
35
35
  function y(l) {
36
- return l === "debug" && (l = "log"), typeof console === n ? !1 : l === "trace" && o ? f : console[l] !== void 0 ? c(console, l) : console.log !== void 0 ? c(console, "log") : e;
36
+ return l === "debug" && (l = "log"), typeof console === n ? !1 : l === "trace" && o ? d : console[l] !== void 0 ? u(console, l) : console.log !== void 0 ? u(console, "log") : e;
37
37
  }
38
38
  function p() {
39
39
  for (var l = this.getLevel(), m = 0; m < s.length; m++) {
40
- var u = s[m];
41
- this[u] = m < l ? e : this.methodFactory(u, l, this.name);
40
+ var c = s[m];
41
+ this[c] = m < l ? e : this.methodFactory(c, l, this.name);
42
42
  }
43
43
  if (this.log = this.debug, typeof console === n && l < this.levels.SILENT)
44
44
  return "No console available for logging";
@@ -48,14 +48,14 @@ function De() {
48
48
  typeof console !== n && (p.call(this), this[l].apply(this, arguments));
49
49
  };
50
50
  }
51
- function b(l, m, u) {
51
+ function b(l, m, c) {
52
52
  return y(l) || k.apply(this, arguments);
53
53
  }
54
- function h(l, m) {
55
- var u = this, j, K, L, _ = "loglevel";
54
+ function f(l, m) {
55
+ var c = this, j, K, L, _ = "loglevel";
56
56
  typeof l == "string" ? _ += ":" + l : typeof l == "symbol" && (_ = void 0);
57
- function Ee(d) {
58
- var g = (s[d] || "silent").toUpperCase();
57
+ function Ee(h) {
58
+ var g = (s[h] || "silent").toUpperCase();
59
59
  if (!(typeof window === n || !_)) {
60
60
  try {
61
61
  window.localStorage[_] = g;
@@ -69,21 +69,21 @@ function De() {
69
69
  }
70
70
  }
71
71
  function X() {
72
- var d;
72
+ var h;
73
73
  if (!(typeof window === n || !_)) {
74
74
  try {
75
- d = window.localStorage[_];
75
+ h = window.localStorage[_];
76
76
  } catch {
77
77
  }
78
- if (typeof d === n)
78
+ if (typeof h === n)
79
79
  try {
80
80
  var g = window.document.cookie, D = encodeURIComponent(_), te = g.indexOf(D + "=");
81
- te !== -1 && (d = /^([^;]+)/.exec(
81
+ te !== -1 && (h = /^([^;]+)/.exec(
82
82
  g.slice(te + D.length + 1)
83
83
  )[1]);
84
84
  } catch {
85
85
  }
86
- return u.levels[d] === void 0 && (d = void 0), d;
86
+ return c.levels[h] === void 0 && (h = void 0), h;
87
87
  }
88
88
  }
89
89
  function Re() {
@@ -98,49 +98,49 @@ function De() {
98
98
  }
99
99
  }
100
100
  }
101
- function U(d) {
102
- var g = d;
103
- if (typeof g == "string" && u.levels[g.toUpperCase()] !== void 0 && (g = u.levels[g.toUpperCase()]), typeof g == "number" && g >= 0 && g <= u.levels.SILENT)
101
+ function U(h) {
102
+ var g = h;
103
+ if (typeof g == "string" && c.levels[g.toUpperCase()] !== void 0 && (g = c.levels[g.toUpperCase()]), typeof g == "number" && g >= 0 && g <= c.levels.SILENT)
104
104
  return g;
105
- throw new TypeError("log.setLevel() called with invalid level: " + d);
105
+ throw new TypeError("log.setLevel() called with invalid level: " + h);
106
106
  }
107
- u.name = l, u.levels = {
107
+ c.name = l, c.levels = {
108
108
  TRACE: 0,
109
109
  DEBUG: 1,
110
110
  INFO: 2,
111
111
  WARN: 3,
112
112
  ERROR: 4,
113
113
  SILENT: 5
114
- }, u.methodFactory = m || b, u.getLevel = function() {
114
+ }, c.methodFactory = m || b, c.getLevel = function() {
115
115
  return L ?? K ?? j;
116
- }, u.setLevel = function(d, g) {
117
- return L = U(d), g !== !1 && Ee(L), p.call(u);
118
- }, u.setDefaultLevel = function(d) {
119
- K = U(d), X() || u.setLevel(d, !1);
120
- }, u.resetLevel = function() {
121
- L = null, Re(), p.call(u);
122
- }, u.enableAll = function(d) {
123
- u.setLevel(u.levels.TRACE, d);
124
- }, u.disableAll = function(d) {
125
- u.setLevel(u.levels.SILENT, d);
126
- }, u.rebuild = function() {
127
- if (i !== u && (j = U(i.getLevel())), p.call(u), i === u)
128
- for (var d in r)
129
- r[d].rebuild();
116
+ }, c.setLevel = function(h, g) {
117
+ return L = U(h), g !== !1 && Ee(L), p.call(c);
118
+ }, c.setDefaultLevel = function(h) {
119
+ K = U(h), X() || c.setLevel(h, !1);
120
+ }, c.resetLevel = function() {
121
+ L = null, Re(), p.call(c);
122
+ }, c.enableAll = function(h) {
123
+ c.setLevel(c.levels.TRACE, h);
124
+ }, c.disableAll = function(h) {
125
+ c.setLevel(c.levels.SILENT, h);
126
+ }, c.rebuild = function() {
127
+ if (i !== c && (j = U(i.getLevel())), p.call(c), i === c)
128
+ for (var h in r)
129
+ r[h].rebuild();
130
130
  }, j = U(
131
131
  i ? i.getLevel() : "WARN"
132
132
  );
133
133
  var ee = X();
134
- ee != null && (L = U(ee)), p.call(u);
134
+ ee != null && (L = U(ee)), p.call(c);
135
135
  }
136
- i = new h(), i.getLogger = function(m) {
136
+ i = new f(), i.getLogger = function(m) {
137
137
  if (typeof m != "symbol" && typeof m != "string" || m === "")
138
138
  throw new TypeError("You must supply a name when creating a logger.");
139
- var u = r[m];
140
- return u || (u = r[m] = new h(
139
+ var c = r[m];
140
+ return c || (c = r[m] = new f(
141
141
  m,
142
142
  i.methodFactory
143
- )), u;
143
+ )), c;
144
144
  };
145
145
  var P = typeof window !== n ? window.log : void 0;
146
146
  return i.noConflict = function() {
@@ -444,24 +444,24 @@ async function at(t, e, n) {
444
444
  return `${o}.${s}`;
445
445
  }
446
446
  async function ct(t, e, n, o, s, r) {
447
- const { privateKey: i, publicKey: c, nonce: f = we.get(n.origin) } = e;
447
+ const { privateKey: i, publicKey: u, nonce: d = we.get(n.origin) } = e;
448
448
  if (!qe(i))
449
449
  throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
450
- if (!Ve(c))
450
+ if (!Ve(u))
451
451
  throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
452
- if (f !== void 0 && !w(f))
452
+ if (d !== void 0 && !w(d))
453
453
  throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
454
- if (!c.extractable)
454
+ if (!u.extractable)
455
455
  throw new TypeError('"DPoP.publicKey.extractable" must be true');
456
456
  const y = Z() + s, p = {
457
457
  alg: it(i),
458
458
  typ: "dpop+jwt",
459
- jwk: await lt(c)
459
+ jwk: await lt(u)
460
460
  }, k = {
461
461
  iat: y,
462
462
  jti: Y(),
463
463
  htm: o,
464
- nonce: f,
464
+ nonce: d,
465
465
  htu: `${n.origin}${n.pathname}`,
466
466
  ath: r ? A(await crypto.subtle.digest("SHA-256", E(r))) : void 0
467
467
  };
@@ -469,8 +469,8 @@ async function ct(t, e, n, o, s, r) {
469
469
  }
470
470
  let J;
471
471
  async function ut(t) {
472
- const { kty: e, e: n, n: o, x: s, y: r, crv: i } = await crypto.subtle.exportKey("jwk", t), c = { kty: e, e: n, n: o, x: s, y: r, crv: i };
473
- return J.set(t, c), c;
472
+ const { kty: e, e: n, n: o, x: s, y: r, crv: i } = await crypto.subtle.exportKey("jwk", t), u = { kty: e, e: n, n: o, x: s, y: r, crv: i };
473
+ return J.set(t, u), u;
474
474
  }
475
475
  async function lt(t) {
476
476
  return J || (J = /* @__PURE__ */ new WeakMap()), J.get(t) || ut(t);
@@ -575,7 +575,7 @@ async function Se(t, e, n, o = !1, s = !1) {
575
575
  if (r.id_token !== void 0 && !w(r.id_token))
576
576
  throw new a('"response" body "id_token" property must be a non-empty string');
577
577
  if (r.id_token) {
578
- const { claims: i, jwt: c } = await Et(r.id_token, Rt.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), ke, W(e), ge(e), e[Ne]).then(_t.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(mt.bind(void 0, t.issuer)).then(wt.bind(void 0, e.client_id));
578
+ const { claims: i, jwt: u } = await Et(r.id_token, Rt.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), ke, W(e), ge(e), e[Ne]).then(_t.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(mt.bind(void 0, t.issuer)).then(wt.bind(void 0, e.client_id));
579
579
  if (Array.isArray(i.aud) && i.aud.length !== 1) {
580
580
  if (i.azp === void 0)
581
581
  throw new a('ID Token "aud" (audience) claim includes additional untrusted audiences');
@@ -584,7 +584,7 @@ async function Se(t, e, n, o = !1, s = !1) {
584
584
  }
585
585
  if (i.auth_time !== void 0 && (!Number.isFinite(i.auth_time) || Math.sign(i.auth_time) !== 1))
586
586
  throw new a('ID Token "auth_time" (authentication time) must be a positive number');
587
- ve.set(r, [i, c]);
587
+ ve.set(r, [i, u]);
588
588
  }
589
589
  }
590
590
  return r;
@@ -619,8 +619,8 @@ async function yt(t, e, n, o, s, r) {
619
619
  const i = T(n, "code");
620
620
  if (!i)
621
621
  throw new a('no authorization code in "callbackParameters"');
622
- const c = new URLSearchParams(r?.additionalParameters);
623
- return c.set("redirect_uri", o), c.set("code_verifier", s), c.set("code", i), _e(t, e, "authorization_code", c, r);
622
+ const u = new URLSearchParams(r?.additionalParameters);
623
+ return u.set("redirect_uri", o), u.set("code_verifier", s), u.set("code", i), _e(t, e, "authorization_code", u, r);
624
624
  }
625
625
  const bt = {
626
626
  aud: "audience",
@@ -658,8 +658,8 @@ async function St(t, e, n, o, s) {
658
658
  if (s !== H) {
659
659
  if (typeof s != "number" || s < 0)
660
660
  throw new TypeError('"maxAge" must be a non-negative number');
661
- const c = Z() + W(e), f = ge(e);
662
- if (i.auth_time + s < c - f)
661
+ const u = Z() + W(e), d = ge(e);
662
+ if (i.auth_time + s < u - d)
663
663
  throw new a("too much time has elapsed since the last End-User authentication");
664
664
  }
665
665
  switch (o) {
@@ -743,10 +743,10 @@ async function kt(t, e, n, o) {
743
743
  throw new a("JWT signature verification failed");
744
744
  }
745
745
  async function Et(t, e, n, o, s, r) {
746
- let { 0: i, 1: c, 2: f, length: y } = t.split(".");
746
+ let { 0: i, 1: u, 2: d, length: y } = t.split(".");
747
747
  if (y === 5)
748
748
  if (r !== void 0)
749
- t = await r(t), { 0: i, 1: c, 2: f, length: y } = t.split(".");
749
+ t = await r(t), { 0: i, 1: u, 2: d, length: y } = t.split(".");
750
750
  else
751
751
  throw new v("JWE structure JWTs are not supported");
752
752
  if (y !== 3)
@@ -761,37 +761,37 @@ async function Et(t, e, n, o, s, r) {
761
761
  throw new a("JWT Header must be a top level object");
762
762
  if (e(p), p.crit !== void 0)
763
763
  throw new a('unexpected JWT "crit" header parameter');
764
- const k = A(f);
764
+ const k = A(d);
765
765
  let b;
766
- n !== ke && (b = await n(p), await kt(i, c, b, k));
767
- let h;
766
+ n !== ke && (b = await n(p), await kt(i, u, b, k));
767
+ let f;
768
768
  try {
769
- h = JSON.parse(E(A(c)));
769
+ f = JSON.parse(E(A(u)));
770
770
  } catch (l) {
771
771
  throw new a("failed to parse JWT Payload body as base64url encoded JSON", { cause: l });
772
772
  }
773
- if (!x(h))
773
+ if (!x(f))
774
774
  throw new a("JWT Payload must be a top level object");
775
775
  const P = Z() + o;
776
- if (h.exp !== void 0) {
777
- if (typeof h.exp != "number")
776
+ if (f.exp !== void 0) {
777
+ if (typeof f.exp != "number")
778
778
  throw new a('unexpected JWT "exp" (expiration time) claim type');
779
- if (h.exp <= P - s)
779
+ if (f.exp <= P - s)
780
780
  throw new a('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
781
781
  }
782
- if (h.iat !== void 0 && typeof h.iat != "number")
782
+ if (f.iat !== void 0 && typeof f.iat != "number")
783
783
  throw new a('unexpected JWT "iat" (issued at) claim type');
784
- if (h.iss !== void 0 && typeof h.iss != "string")
784
+ if (f.iss !== void 0 && typeof f.iss != "string")
785
785
  throw new a('unexpected JWT "iss" (issuer) claim type');
786
- if (h.nbf !== void 0) {
787
- if (typeof h.nbf != "number")
786
+ if (f.nbf !== void 0) {
787
+ if (typeof f.nbf != "number")
788
788
  throw new a('unexpected JWT "nbf" (not before) claim type');
789
- if (h.nbf > P + s)
789
+ if (f.nbf > P + s)
790
790
  throw new a('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
791
791
  }
792
- if (h.aud !== void 0 && typeof h.aud != "string" && !Array.isArray(h.aud))
792
+ if (f.aud !== void 0 && typeof f.aud != "string" && !Array.isArray(f.aud))
793
793
  throw new a('unexpected JWT "aud" (audience) claim type');
794
- return { header: p, claims: h, signature: k, key: b, jwt: t };
794
+ return { header: p, claims: f, signature: k, key: b, jwt: t };
795
795
  }
796
796
  function Rt(t, e, n) {
797
797
  if (t !== void 0) {
@@ -847,8 +847,8 @@ function Ut(t, e, n, o) {
847
847
  error_description: T(n, "error_description"),
848
848
  error_uri: T(n, "error_uri")
849
849
  };
850
- const c = T(n, "id_token"), f = T(n, "token");
851
- if (c !== void 0 || f !== void 0)
850
+ const u = T(n, "id_token"), d = T(n, "token");
851
+ if (u !== void 0 || d !== void 0)
852
852
  throw new v("implicit and hybrid flows are not supported");
853
853
  return gt(new URLSearchParams(n));
854
854
  }
@@ -871,13 +871,13 @@ class xt extends Ce {
871
871
  redirectToAfterSignUp: s,
872
872
  redirectToAfterSignIn: r,
873
873
  redirectToAfterSignOut: i = "/",
874
- basePath: c,
875
- scopes: f
874
+ basePath: u,
875
+ scopes: d
876
876
  }) {
877
877
  super(), this.client = {
878
878
  client_id: o,
879
879
  token_endpoint_auth_method: "none"
880
- }, this.audience = n, this.issuer = e, this.callbackUrlPath = xe(c, pe), this.scopes = f ?? ["openid", "profile", "email"], this.redirectToAfterSignUp = s, this.redirectToAfterSignIn = r, this.redirectToAfterSignOut = i;
880
+ }, this.audience = n, this.issuer = e, this.callbackUrlPath = xe(u, pe), this.scopes = d ?? ["openid", "profile", "email"], this.redirectToAfterSignUp = s, this.redirectToAfterSignIn = r, this.redirectToAfterSignOut = i;
881
881
  }
882
882
  async getAuthServer() {
883
883
  if (!this.authorizationServer) {
@@ -909,40 +909,49 @@ class xt extends Ce {
909
909
  providerData: n
910
910
  });
911
911
  }
912
- async signUp({ redirectTo: e } = {}) {
912
+ async signUp({
913
+ redirectTo: e,
914
+ replace: n = !1
915
+ } = {}) {
913
916
  return this.authorize({
914
917
  redirectTo: this.redirectToAfterSignUp ?? e ?? "/",
918
+ replace: n,
915
919
  isSignUp: !0
916
920
  });
917
921
  }
918
- async signIn({ redirectTo: e } = {}) {
922
+ async signIn({
923
+ redirectTo: e,
924
+ replace: n = !1
925
+ } = {}) {
919
926
  return this.authorize({
920
- redirectTo: this.redirectToAfterSignIn ?? e ?? "/"
927
+ redirectTo: this.redirectToAfterSignIn ?? e ?? "/",
928
+ replace: n
921
929
  });
922
930
  }
923
931
  async authorize({
924
932
  redirectTo: e,
925
- isSignUp: n = !1
933
+ isSignUp: n = !1,
934
+ replace: o = !1
926
935
  }) {
927
- const o = "S256", s = await this.getAuthServer();
928
- if (!s.authorization_endpoint)
936
+ const s = "S256", r = await this.getAuthServer();
937
+ if (!r.authorization_endpoint)
929
938
  throw new R("No authorization endpoint");
930
- const r = Qe(), i = await et(r);
931
- sessionStorage.setItem($, r);
932
- const c = new URL(
933
- s.authorization_endpoint
939
+ const i = Qe(), u = await et(i);
940
+ sessionStorage.setItem($, i);
941
+ const d = new URL(
942
+ r.authorization_endpoint
934
943
  );
935
944
  sessionStorage.setItem("redirect-to", e);
936
- const f = new URL(window.location.origin);
937
- f.pathname = this.callbackUrlPath, f.search = "", c.searchParams.set("client_id", this.client.client_id), c.searchParams.set("redirect_uri", f.toString()), c.searchParams.set("response_type", "code"), c.searchParams.set("scope", this.scopes.join(" ")), c.searchParams.set("code_challenge", i), c.searchParams.set(
945
+ const y = new URL(window.location.origin);
946
+ y.pathname = this.callbackUrlPath, y.search = "", d.searchParams.set("client_id", this.client.client_id), d.searchParams.set("redirect_uri", y.toString()), d.searchParams.set("response_type", "code"), d.searchParams.set("scope", this.scopes.join(" ")), d.searchParams.set("code_challenge", u), d.searchParams.set(
938
947
  "code_challenge_method",
939
- o
940
- ), this.audience && c.searchParams.set("audience", this.audience), this.onAuthorizationUrl?.(c, {
948
+ s
949
+ ), this.audience && d.searchParams.set("audience", this.audience), this.onAuthorizationUrl?.(d, {
941
950
  isSignIn: !n,
942
951
  isSignUp: n
943
952
  });
944
- const y = Xe();
945
- sessionStorage.setItem(F, y), c.searchParams.set("state", y), location.href = c.href;
953
+ const p = Xe();
954
+ sessionStorage.setItem(F, p), d.searchParams.set("state", p), o ? location.replace(d.href) : location.href = d.href;
946
955
  }
947
956
  async getAccessToken() {
948
957
  const e = await this.getAuthServer(), { providerData: n } = S.getState();
@@ -1053,25 +1062,25 @@ class xt extends Ce {
1053
1062
  "Error validating OAuth response",
1054
1063
  i
1055
1064
  );
1056
- const c = new URL(e);
1057
- c.pathname = this.callbackUrlPath, c.search = "";
1058
- const f = await yt(
1065
+ const u = new URL(e);
1066
+ u.pathname = this.callbackUrlPath, u.search = "";
1067
+ const d = await yt(
1059
1068
  r,
1060
1069
  this.client,
1061
1070
  i,
1062
- c.toString(),
1071
+ u.toString(),
1063
1072
  s
1064
1073
  ), y = await St(
1065
1074
  r,
1066
1075
  this.client,
1067
- f
1076
+ d
1068
1077
  );
1069
1078
  this.setTokensFromResponse(y);
1070
1079
  const p = await this.getAccessToken(), b = await (await ht(
1071
1080
  r,
1072
1081
  this.client,
1073
1082
  p
1074
- )).json(), h = {
1083
+ )).json(), f = {
1075
1084
  sub: b.sub,
1076
1085
  email: b.email,
1077
1086
  name: b.name,
@@ -1081,7 +1090,7 @@ class xt extends Ce {
1081
1090
  S.setState({
1082
1091
  isAuthenticated: !0,
1083
1092
  isPending: !1,
1084
- profile: h
1093
+ profile: f
1085
1094
  });
1086
1095
  const P = sessionStorage.getItem("redirect-to") ?? "/";
1087
1096
  return sessionStorage.removeItem("redirect-to"), P;