zudoku 0.43.1 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/lib/authentication/components/CallbackHandler.js +5 -1
  2. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  3. package/dist/lib/authentication/providers/auth0.js +1 -1
  4. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  5. package/dist/lib/authentication/providers/clerk.js +13 -5
  6. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  7. package/dist/lib/authentication/providers/openid.d.ts +6 -9
  8. package/dist/lib/authentication/providers/openid.js +17 -29
  9. package/dist/lib/authentication/providers/openid.js.map +1 -1
  10. package/dist/lib/plugins/openapi/playground/QueryParams.js +1 -1
  11. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  12. package/dist/lib/util/url.d.ts +4 -0
  13. package/dist/lib/util/url.js +13 -0
  14. package/dist/lib/util/url.js.map +1 -0
  15. package/dist/lib/util/url.test.d.ts +1 -0
  16. package/dist/lib/util/url.test.js +26 -0
  17. package/dist/lib/util/url.test.js.map +1 -0
  18. package/lib/{AuthenticationPlugin-BxoEZCSJ.js → AuthenticationPlugin-BlJsiGuX.js} +2 -2
  19. package/lib/{AuthenticationPlugin-BxoEZCSJ.js.map → AuthenticationPlugin-BlJsiGuX.js.map} +1 -1
  20. package/lib/{MdxPage-DUcuusMU.js → MdxPage-DlJaCSPf.js} +3 -3
  21. package/lib/{MdxPage-DUcuusMU.js.map → MdxPage-DlJaCSPf.js.map} +1 -1
  22. package/lib/{OasProvider-CjMm8pB7.js → OasProvider-DHPC9PnR.js} +2 -2
  23. package/lib/{OasProvider-CjMm8pB7.js.map → OasProvider-DHPC9PnR.js.map} +1 -1
  24. package/lib/{OperationList-BhJcPgGi.js → OperationList-C6Ky0zQa.js} +5 -5
  25. package/lib/{OperationList-BhJcPgGi.js.map → OperationList-C6Ky0zQa.js.map} +1 -1
  26. package/lib/{Pagination-BgQxwq5j.js → Pagination-C5Fi7z_v.js} +2 -2
  27. package/lib/{Pagination-BgQxwq5j.js.map → Pagination-C5Fi7z_v.js.map} +1 -1
  28. package/lib/{SchemaList-BexhT_Z0.js → SchemaList-Cu7rWQ_k.js} +3 -3
  29. package/lib/{SchemaList-BexhT_Z0.js.map → SchemaList-Cu7rWQ_k.js.map} +1 -1
  30. package/lib/{SchemaView-Dt_-u8rW.js → SchemaView-Ci_CnNlv.js} +2 -2
  31. package/lib/{SchemaView-Dt_-u8rW.js.map → SchemaView-Ci_CnNlv.js.map} +1 -1
  32. package/lib/{circular-BWEIet3w.js → circular-P9P1oxbQ.js} +2 -2
  33. package/lib/{circular-BWEIet3w.js.map → circular-P9P1oxbQ.js.map} +1 -1
  34. package/lib/{createServer-BQD3Eeqb.js → createServer-Iclzdx0h.js} +3 -3
  35. package/lib/{createServer-BQD3Eeqb.js.map → createServer-Iclzdx0h.js.map} +1 -1
  36. package/lib/{index-CFf9AN-y.js → index-C56xKbMM.js} +7 -7
  37. package/lib/{index-CFf9AN-y.js.map → index-C56xKbMM.js.map} +1 -1
  38. package/lib/{index-DGNSSXgR.js → index-CzUOM_vE.js} +3 -3
  39. package/lib/{index-DGNSSXgR.js.map → index-CzUOM_vE.js.map} +1 -1
  40. package/lib/zudoku.auth-auth0.js +7 -7
  41. package/lib/zudoku.auth-auth0.js.map +1 -1
  42. package/lib/zudoku.auth-clerk.js +26 -26
  43. package/lib/zudoku.auth-clerk.js.map +1 -1
  44. package/lib/zudoku.auth-openid.js +407 -405
  45. package/lib/zudoku.auth-openid.js.map +1 -1
  46. package/lib/zudoku.components.js +1 -1
  47. package/lib/zudoku.plugin-api-catalog.js +1 -1
  48. package/lib/zudoku.plugin-markdown.js +1 -1
  49. package/lib/zudoku.plugin-openapi.js +1 -1
  50. package/package.json +1 -1
  51. package/src/app/demo.html +1 -1
  52. package/src/lib/authentication/components/CallbackHandler.tsx +11 -1
  53. package/src/lib/authentication/providers/auth0.tsx +1 -1
  54. package/src/lib/authentication/providers/clerk.tsx +14 -10
  55. package/src/lib/authentication/providers/openid.tsx +24 -42
  56. package/src/lib/plugins/openapi/playground/QueryParams.tsx +1 -1
  57. package/src/lib/util/url.test.ts +51 -0
  58. package/src/lib/util/url.ts +18 -0
@@ -1,21 +1,22 @@
1
- var Ce = Object.defineProperty;
2
- var Le = (t, e, n) => e in t ? Ce(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var w = (t, e, n) => Le(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { j as B } from "./jsx-runtime-C5mzlN2N.js";
5
- import { g as xe } from "./_commonjsHelpers-B4e78b8K.js";
6
- import { C as Ie } from "./ClientOnly-E7hGysn1.js";
7
- import { d as je, f as ie, u as L } from "./hook-8GM2HXNM.js";
8
- import { A as Je } from "./AuthenticationPlugin-BxoEZCSJ.js";
9
- import { N as Oe } from "./chunk-BAXFHI7N-BLTsN6tl.js";
10
- import { Z as ze } from "./invariant-Caa8-XvF.js";
11
- var D = { exports: {} }, De = D.exports, ae;
12
- function Ne() {
13
- return ae || (ae = 1, function(t) {
1
+ var xe = Object.defineProperty;
2
+ var Ce = (t, e, n) => e in t ? xe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var b = (t, e, n) => Ce(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { j as q } from "./jsx-runtime-C5mzlN2N.js";
5
+ import { g as Ie } from "./_commonjsHelpers-B4e78b8K.js";
6
+ import { C as je } from "./ClientOnly-E7hGysn1.js";
7
+ import { d as Oe, f as we, u as x } from "./hook-8GM2HXNM.js";
8
+ import { A as ze } from "./AuthenticationPlugin-BlJsiGuX.js";
9
+ import { N as Je } from "./chunk-BAXFHI7N-BLTsN6tl.js";
10
+ import { a as De } from "./index-CzUOM_vE.js";
11
+ import { Z as Ne } from "./invariant-Caa8-XvF.js";
12
+ var D = { exports: {} }, We = D.exports, ie;
13
+ function Ke() {
14
+ return ie || (ie = 1, function(t) {
14
15
  (function(e, n) {
15
16
  t.exports ? t.exports = n() : e.log = n();
16
- })(De, function() {
17
+ })(We, function() {
17
18
  var e = function() {
18
- }, n = "undefined", o = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent), a = [
19
+ }, n = "undefined", o = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent), s = [
19
20
  "trace",
20
21
  "debug",
21
22
  "info",
@@ -34,80 +35,80 @@ function Ne() {
34
35
  };
35
36
  }
36
37
  }
37
- function p() {
38
+ function f() {
38
39
  console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
39
40
  }
40
41
  function _(l) {
41
- return l === "debug" && (l = "log"), typeof console === n ? !1 : l === "trace" && o ? p : console[l] !== void 0 ? c(console, l) : console.log !== void 0 ? c(console, "log") : e;
42
+ 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;
42
43
  }
43
- function f() {
44
- for (var l = this.getLevel(), m = 0; m < a.length; m++) {
45
- var u = a[m];
44
+ function p() {
45
+ for (var l = this.getLevel(), m = 0; m < s.length; m++) {
46
+ var u = s[m];
46
47
  this[u] = m < l ? e : this.methodFactory(u, l, this.name);
47
48
  }
48
49
  if (this.log = this.debug, typeof console === n && l < this.levels.SILENT)
49
50
  return "No console available for logging";
50
51
  }
51
- function v(l) {
52
+ function k(l) {
52
53
  return function() {
53
- typeof console !== n && (f.call(this), this[l].apply(this, arguments));
54
+ typeof console !== n && (p.call(this), this[l].apply(this, arguments));
54
55
  };
55
56
  }
56
- function b(l, m, u) {
57
- return _(l) || v.apply(this, arguments);
57
+ function y(l, m, u) {
58
+ return _(l) || k.apply(this, arguments);
58
59
  }
59
- function d(l, m) {
60
- var u = this, J, $, U, S = "loglevel";
61
- typeof l == "string" ? S += ":" + l : typeof l == "symbol" && (S = void 0);
62
- function Re(h) {
63
- var y = (a[h] || "silent").toUpperCase();
64
- if (!(typeof window === n || !S)) {
60
+ function h(l, m) {
61
+ var u = this, O, $, U, v = "loglevel";
62
+ typeof l == "string" ? v += ":" + l : typeof l == "symbol" && (v = void 0);
63
+ function Pe(d) {
64
+ var g = (s[d] || "silent").toUpperCase();
65
+ if (!(typeof window === n || !v)) {
65
66
  try {
66
- window.localStorage[S] = y;
67
+ window.localStorage[v] = g;
67
68
  return;
68
69
  } catch {
69
70
  }
70
71
  try {
71
- window.document.cookie = encodeURIComponent(S) + "=" + y + ";";
72
+ window.document.cookie = encodeURIComponent(v) + "=" + g + ";";
72
73
  } catch {
73
74
  }
74
75
  }
75
76
  }
76
77
  function ne() {
77
- var h;
78
- if (!(typeof window === n || !S)) {
78
+ var d;
79
+ if (!(typeof window === n || !v)) {
79
80
  try {
80
- h = window.localStorage[S];
81
+ d = window.localStorage[v];
81
82
  } catch {
82
83
  }
83
- if (typeof h === n)
84
+ if (typeof d === n)
84
85
  try {
85
- var y = window.document.cookie, O = encodeURIComponent(S), oe = y.indexOf(O + "=");
86
- oe !== -1 && (h = /^([^;]+)/.exec(
87
- y.slice(oe + O.length + 1)
86
+ var g = window.document.cookie, z = encodeURIComponent(v), oe = g.indexOf(z + "=");
87
+ oe !== -1 && (d = /^([^;]+)/.exec(
88
+ g.slice(oe + z.length + 1)
88
89
  )[1]);
89
90
  } catch {
90
91
  }
91
- return u.levels[h] === void 0 && (h = void 0), h;
92
+ return u.levels[d] === void 0 && (d = void 0), d;
92
93
  }
93
94
  }
94
- function Pe() {
95
- if (!(typeof window === n || !S)) {
95
+ function Ue() {
96
+ if (!(typeof window === n || !v)) {
96
97
  try {
97
- window.localStorage.removeItem(S);
98
+ window.localStorage.removeItem(v);
98
99
  } catch {
99
100
  }
100
101
  try {
101
- window.document.cookie = encodeURIComponent(S) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
102
+ window.document.cookie = encodeURIComponent(v) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
102
103
  } catch {
103
104
  }
104
105
  }
105
106
  }
106
- function C(h) {
107
- var y = h;
108
- if (typeof y == "string" && u.levels[y.toUpperCase()] !== void 0 && (y = u.levels[y.toUpperCase()]), typeof y == "number" && y >= 0 && y <= u.levels.SILENT)
109
- return y;
110
- throw new TypeError("log.setLevel() called with invalid level: " + h);
107
+ function L(d) {
108
+ var g = d;
109
+ if (typeof g == "string" && u.levels[g.toUpperCase()] !== void 0 && (g = u.levels[g.toUpperCase()]), typeof g == "number" && g >= 0 && g <= u.levels.SILENT)
110
+ return g;
111
+ throw new TypeError("log.setLevel() called with invalid level: " + d);
111
112
  }
112
113
  u.name = l, u.levels = {
113
114
  TRACE: 0,
@@ -116,33 +117,33 @@ function Ne() {
116
117
  WARN: 3,
117
118
  ERROR: 4,
118
119
  SILENT: 5
119
- }, u.methodFactory = m || b, u.getLevel = function() {
120
- return U ?? $ ?? J;
121
- }, u.setLevel = function(h, y) {
122
- return U = C(h), y !== !1 && Re(U), f.call(u);
123
- }, u.setDefaultLevel = function(h) {
124
- $ = C(h), ne() || u.setLevel(h, !1);
120
+ }, u.methodFactory = m || y, u.getLevel = function() {
121
+ return U ?? $ ?? O;
122
+ }, u.setLevel = function(d, g) {
123
+ return U = L(d), g !== !1 && Pe(U), p.call(u);
124
+ }, u.setDefaultLevel = function(d) {
125
+ $ = L(d), ne() || u.setLevel(d, !1);
125
126
  }, u.resetLevel = function() {
126
- U = null, Pe(), f.call(u);
127
- }, u.enableAll = function(h) {
128
- u.setLevel(u.levels.TRACE, h);
129
- }, u.disableAll = function(h) {
130
- u.setLevel(u.levels.SILENT, h);
127
+ U = null, Ue(), p.call(u);
128
+ }, u.enableAll = function(d) {
129
+ u.setLevel(u.levels.TRACE, d);
130
+ }, u.disableAll = function(d) {
131
+ u.setLevel(u.levels.SILENT, d);
131
132
  }, u.rebuild = function() {
132
- if (i !== u && (J = C(i.getLevel())), f.call(u), i === u)
133
- for (var h in r)
134
- r[h].rebuild();
135
- }, J = C(
133
+ if (i !== u && (O = L(i.getLevel())), p.call(u), i === u)
134
+ for (var d in r)
135
+ r[d].rebuild();
136
+ }, O = L(
136
137
  i ? i.getLevel() : "WARN"
137
138
  );
138
139
  var re = ne();
139
- re != null && (U = C(re)), f.call(u);
140
+ re != null && (U = L(re)), p.call(u);
140
141
  }
141
- i = new d(), i.getLogger = function(m) {
142
+ i = new h(), i.getLogger = function(m) {
142
143
  if (typeof m != "symbol" && typeof m != "string" || m === "")
143
144
  throw new TypeError("You must supply a name when creating a logger.");
144
145
  var u = r[m];
145
- return u || (u = r[m] = new d(
146
+ return u || (u = r[m] = new h(
146
147
  m,
147
148
  i.methodFactory
148
149
  )), u;
@@ -156,12 +157,12 @@ function Ne() {
156
157
  });
157
158
  }(D)), D.exports;
158
159
  }
159
- var We = Ne();
160
- const se = /* @__PURE__ */ xe(We);
160
+ var He = Ke();
161
+ const se = /* @__PURE__ */ Ie(He);
161
162
  let V;
162
- var z, we;
163
- (typeof navigator > "u" || !((we = (z = navigator.userAgent) == null ? void 0 : z.startsWith) != null && we.call(z, "Mozilla/5.0 "))) && (V = "oauth4webapi/v2.17.0");
164
- function Y(t, e) {
163
+ var J, pe;
164
+ (typeof navigator > "u" || !((pe = (J = navigator.userAgent) == null ? void 0 : J.startsWith) != null && pe.call(J, "Mozilla/5.0 "))) && (V = "oauth4webapi/v2.17.0");
165
+ function Z(t, e) {
165
166
  if (t == null)
166
167
  return !1;
167
168
  try {
@@ -170,32 +171,32 @@ function Y(t, e) {
170
171
  return !1;
171
172
  }
172
173
  }
173
- const W = Symbol(), Ke = Symbol(), Z = Symbol(), He = Symbol(), $e = Symbol(), Fe = Symbol(), Me = new TextEncoder(), qe = new TextDecoder();
174
+ const W = Symbol(), $e = Symbol(), Y = Symbol(), Fe = Symbol(), Me = Symbol(), Be = Symbol(), qe = new TextEncoder(), Ve = new TextDecoder();
174
175
  function E(t) {
175
- return typeof t == "string" ? Me.encode(t) : qe.decode(t);
176
+ return typeof t == "string" ? qe.encode(t) : Ve.decode(t);
176
177
  }
177
- const ce = 32768;
178
- function Be(t) {
178
+ const ae = 32768;
179
+ function Ge(t) {
179
180
  t instanceof ArrayBuffer && (t = new Uint8Array(t));
180
181
  const e = [];
181
- for (let n = 0; n < t.byteLength; n += ce)
182
- e.push(String.fromCharCode.apply(null, t.subarray(n, n + ce)));
182
+ for (let n = 0; n < t.byteLength; n += ae)
183
+ e.push(String.fromCharCode.apply(null, t.subarray(n, n + ae)));
183
184
  return btoa(e.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
184
185
  }
185
- function Ve(t) {
186
+ function Ze(t) {
186
187
  try {
187
188
  const e = atob(t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")), n = new Uint8Array(e.length);
188
189
  for (let o = 0; o < e.length; o++)
189
190
  n[o] = e.charCodeAt(o);
190
191
  return n;
191
192
  } catch (e) {
192
- throw new s("The input to be decoded is not correctly encoded.", { cause: e });
193
+ throw new a("The input to be decoded is not correctly encoded.", { cause: e });
193
194
  }
194
195
  }
195
196
  function A(t) {
196
- return typeof t == "string" ? Ve(t) : Be(t);
197
+ return typeof t == "string" ? Ze(t) : Ge(t);
197
198
  }
198
- class Ge {
199
+ class Ye {
199
200
  constructor(e) {
200
201
  this.cache = /* @__PURE__ */ new Map(), this._cache = /* @__PURE__ */ new Map(), this.maxSize = e;
201
202
  }
@@ -219,41 +220,41 @@ class Ge {
219
220
  this.cache.set(e, n), this.cache.size >= this.maxSize && (this._cache = this.cache, this.cache = /* @__PURE__ */ new Map());
220
221
  }
221
222
  }
222
- class T extends Error {
223
+ class S extends Error {
223
224
  constructor(e) {
224
225
  var n;
225
226
  super(e ?? "operation not supported"), this.name = this.constructor.name, (n = Error.captureStackTrace) == null || n.call(Error, this, this.constructor);
226
227
  }
227
228
  }
228
- class Ye extends Error {
229
+ class Qe extends Error {
229
230
  constructor(e, n) {
230
231
  var o;
231
232
  super(e, n), this.name = this.constructor.name, (o = Error.captureStackTrace) == null || o.call(Error, this, this.constructor);
232
233
  }
233
234
  }
234
- const s = Ye, ge = new Ge(100);
235
- function me(t) {
235
+ const a = Qe, me = new Ye(100);
236
+ function ge(t) {
236
237
  return t instanceof CryptoKey;
237
238
  }
238
- function Ze(t) {
239
- return me(t) && t.type === "private";
239
+ function Xe(t) {
240
+ return ge(t) && t.type === "private";
240
241
  }
241
- function Qe(t) {
242
- return me(t) && t.type === "public";
242
+ function et(t) {
243
+ return ge(t) && t.type === "public";
243
244
  }
244
245
  function Q(t) {
245
246
  try {
246
247
  const e = t.headers.get("dpop-nonce");
247
- e && ge.set(new URL(t.url).origin, e);
248
+ e && me.set(new URL(t.url).origin, e);
248
249
  } catch {
249
250
  }
250
251
  return t;
251
252
  }
252
- function x(t) {
253
+ function C(t) {
253
254
  return !(t === null || typeof t != "object" || Array.isArray(t));
254
255
  }
255
256
  function K(t) {
256
- Y(t, Headers) && (t = Object.fromEntries(t.entries()));
257
+ Z(t, Headers) && (t = Object.fromEntries(t.entries()));
257
258
  const e = new Headers(t);
258
259
  if (V && !e.has("user-agent") && e.set("user-agent", V), e.has("authorization"))
259
260
  throw new TypeError('"options.headers" must not include the "authorization" header name');
@@ -261,12 +262,12 @@ function K(t) {
261
262
  throw new TypeError('"options.headers" must not include the "dpop" header name');
262
263
  return e;
263
264
  }
264
- function Xe(t) {
265
+ function tt(t) {
265
266
  if (typeof t == "function" && (t = t()), !(t instanceof AbortSignal))
266
267
  throw new TypeError('"options.signal" must return or be an instance of AbortSignal');
267
268
  return t;
268
269
  }
269
- async function et(t, e) {
270
+ async function nt(t, e) {
270
271
  if (!(t instanceof URL))
271
272
  throw new TypeError('"issuerIdentifier" must be an instance of URL');
272
273
  if (t.protocol !== "https:" && t.protocol !== "http:")
@@ -284,60 +285,60 @@ async function et(t, e) {
284
285
  throw new TypeError('"options.algorithm" must be "oidc" (default), or "oauth2"');
285
286
  }
286
287
  const o = K(e == null ? void 0 : e.headers);
287
- return o.set("accept", "application/json"), ((e == null ? void 0 : e[Z]) || fetch)(n.href, {
288
+ return o.set("accept", "application/json"), ((e == null ? void 0 : e[Y]) || fetch)(n.href, {
288
289
  headers: Object.fromEntries(o.entries()),
289
290
  method: "GET",
290
291
  redirect: "manual",
291
292
  signal: null
292
293
  }).then(Q);
293
294
  }
294
- function g(t) {
295
+ function w(t) {
295
296
  return typeof t == "string" && t.length !== 0;
296
297
  }
297
- async function tt(t, e) {
298
+ async function rt(t, e) {
298
299
  if (!(t instanceof URL))
299
300
  throw new TypeError('"expectedIssuer" must be an instance of URL');
300
- if (!Y(e, Response))
301
+ if (!Z(e, Response))
301
302
  throw new TypeError('"response" must be an instance of Response');
302
303
  if (e.status !== 200)
303
- throw new s('"response" is not a conform Authorization Server Metadata response');
304
+ throw new a('"response" is not a conform Authorization Server Metadata response');
304
305
  te(e);
305
306
  let n;
306
307
  try {
307
308
  n = await e.json();
308
309
  } catch (o) {
309
- throw new s('failed to parse "response" body as JSON', { cause: o });
310
+ throw new a('failed to parse "response" body as JSON', { cause: o });
310
311
  }
311
- if (!x(n))
312
- throw new s('"response" body must be a top level object');
313
- if (!g(n.issuer))
314
- throw new s('"response" body "issuer" property must be a non-empty string');
312
+ if (!C(n))
313
+ throw new a('"response" body must be a top level object');
314
+ if (!w(n.issuer))
315
+ throw new a('"response" body "issuer" property must be a non-empty string');
315
316
  if (new URL(n.issuer).href !== t.href)
316
- throw new s('"response" body "issuer" does not match "expectedIssuer"');
317
+ throw new a('"response" body "issuer" does not match "expectedIssuer"');
317
318
  return n;
318
319
  }
319
320
  function X() {
320
321
  return A(crypto.getRandomValues(new Uint8Array(32)));
321
322
  }
322
- function nt() {
323
+ function ot() {
323
324
  return X();
324
325
  }
325
- function rt() {
326
+ function it() {
326
327
  return X();
327
328
  }
328
- async function ot(t) {
329
- if (!g(t))
329
+ async function st(t) {
330
+ if (!w(t))
330
331
  throw new TypeError('"codeVerifier" must be a non-empty string');
331
332
  return A(await crypto.subtle.digest("SHA-256", E(t)));
332
333
  }
333
- function ue(t) {
334
+ function ce(t) {
334
335
  return encodeURIComponent(t).replace(/%20/g, "+");
335
336
  }
336
- function it(t, e) {
337
- const n = ue(t), o = ue(e);
337
+ function at(t, e) {
338
+ const n = ce(t), o = ce(e);
338
339
  return `Basic ${btoa(`${n}:${o}`)}`;
339
340
  }
340
- function at(t) {
341
+ function ct(t) {
341
342
  switch (t.algorithm.hash.name) {
342
343
  case "SHA-256":
343
344
  return "PS256";
@@ -346,10 +347,10 @@ function at(t) {
346
347
  case "SHA-512":
347
348
  return "PS512";
348
349
  default:
349
- throw new T("unsupported RsaHashedKeyAlgorithm hash name");
350
+ throw new S("unsupported RsaHashedKeyAlgorithm hash name");
350
351
  }
351
352
  }
352
- function st(t) {
353
+ function ut(t) {
353
354
  switch (t.algorithm.hash.name) {
354
355
  case "SHA-256":
355
356
  return "RS256";
@@ -358,10 +359,10 @@ function st(t) {
358
359
  case "SHA-512":
359
360
  return "RS512";
360
361
  default:
361
- throw new T("unsupported RsaHashedKeyAlgorithm hash name");
362
+ throw new S("unsupported RsaHashedKeyAlgorithm hash name");
362
363
  }
363
364
  }
364
- function ct(t) {
365
+ function lt(t) {
365
366
  switch (t.algorithm.namedCurve) {
366
367
  case "P-256":
367
368
  return "ES256";
@@ -370,22 +371,22 @@ function ct(t) {
370
371
  case "P-521":
371
372
  return "ES512";
372
373
  default:
373
- throw new T("unsupported EcKeyAlgorithm namedCurve");
374
+ throw new S("unsupported EcKeyAlgorithm namedCurve");
374
375
  }
375
376
  }
376
- function ut(t) {
377
+ function dt(t) {
377
378
  switch (t.algorithm.name) {
378
379
  case "RSA-PSS":
379
- return at(t);
380
+ return ct(t);
380
381
  case "RSASSA-PKCS1-v1_5":
381
- return st(t);
382
+ return ut(t);
382
383
  case "ECDSA":
383
- return ct(t);
384
+ return lt(t);
384
385
  case "Ed25519":
385
386
  case "Ed448":
386
387
  return "EdDSA";
387
388
  default:
388
- throw new T("unsupported CryptoKey algorithm name");
389
+ throw new S("unsupported CryptoKey algorithm name");
389
390
  }
390
391
  }
391
392
  function H(t) {
@@ -393,7 +394,7 @@ function H(t) {
393
394
  return typeof e == "number" && Number.isFinite(e) ? e : 0;
394
395
  }
395
396
  function ye(t) {
396
- const e = t == null ? void 0 : t[Ke];
397
+ const e = t == null ? void 0 : t[$e];
397
398
  return typeof e == "number" && Number.isFinite(e) && Math.sign(e) !== -1 ? e : 30;
398
399
  }
399
400
  function ee() {
@@ -402,87 +403,87 @@ function ee() {
402
403
  function I(t) {
403
404
  if (typeof t != "object" || t === null)
404
405
  throw new TypeError('"as" must be an object');
405
- if (!g(t.issuer))
406
+ if (!w(t.issuer))
406
407
  throw new TypeError('"as.issuer" property must be a non-empty string');
407
408
  return !0;
408
409
  }
409
410
  function j(t) {
410
411
  if (typeof t != "object" || t === null)
411
412
  throw new TypeError('"client" must be an object');
412
- if (!g(t.client_id))
413
+ if (!w(t.client_id))
413
414
  throw new TypeError('"client.client_id" property must be a non-empty string');
414
415
  return !0;
415
416
  }
416
- function le(t) {
417
- if (!g(t))
417
+ function ue(t) {
418
+ if (!w(t))
418
419
  throw new TypeError('"client.client_secret" property must be a non-empty string');
419
420
  return t;
420
421
  }
421
- function he(t, e) {
422
+ function le(t, e) {
422
423
  if (e !== void 0)
423
424
  throw new TypeError(`"client.client_secret" property must not be provided when ${t} client authentication method is used.`);
424
425
  }
425
- async function lt(t, e, n, o, a) {
426
+ async function ht(t, e, n, o, s) {
426
427
  switch (n.delete("client_secret"), n.delete("client_assertion_type"), n.delete("client_assertion"), e.token_endpoint_auth_method) {
427
428
  case void 0:
428
429
  case "client_secret_basic": {
429
- o.set("authorization", it(e.client_id, le(e.client_secret)));
430
+ o.set("authorization", at(e.client_id, ue(e.client_secret)));
430
431
  break;
431
432
  }
432
433
  case "client_secret_post": {
433
- n.set("client_id", e.client_id), n.set("client_secret", le(e.client_secret));
434
+ n.set("client_id", e.client_id), n.set("client_secret", ue(e.client_secret));
434
435
  break;
435
436
  }
436
437
  case "private_key_jwt":
437
- throw he("private_key_jwt", e.client_secret), new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');
438
+ throw le("private_key_jwt", e.client_secret), new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');
438
439
  case "tls_client_auth":
439
440
  case "self_signed_tls_client_auth":
440
441
  case "none": {
441
- he(e.token_endpoint_auth_method, e.client_secret), e.token_endpoint_auth_method, n.set("client_id", e.client_id);
442
+ le(e.token_endpoint_auth_method, e.client_secret), e.token_endpoint_auth_method, n.set("client_id", e.client_id);
442
443
  break;
443
444
  }
444
445
  default:
445
- throw new T("unsupported client token_endpoint_auth_method");
446
+ throw new S("unsupported client token_endpoint_auth_method");
446
447
  }
447
448
  }
448
- async function ht(t, e, n) {
449
+ async function ft(t, e, n) {
449
450
  if (!n.usages.includes("sign"))
450
451
  throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');
451
- const o = `${A(E(JSON.stringify(t)))}.${A(E(JSON.stringify(e)))}`, a = A(await crypto.subtle.sign(Ae(n), n, E(o)));
452
- return `${o}.${a}`;
452
+ const o = `${A(E(JSON.stringify(t)))}.${A(E(JSON.stringify(e)))}`, s = A(await crypto.subtle.sign(ke(n), n, E(o)));
453
+ return `${o}.${s}`;
453
454
  }
454
- async function dt(t, e, n, o, a, r) {
455
- var b;
456
- const { privateKey: i, publicKey: c, nonce: p = ge.get(n.origin) } = e;
457
- if (!Ze(i))
455
+ async function pt(t, e, n, o, s, r) {
456
+ var y;
457
+ const { privateKey: i, publicKey: c, nonce: f = me.get(n.origin) } = e;
458
+ if (!Xe(i))
458
459
  throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
459
- if (!Qe(c))
460
+ if (!et(c))
460
461
  throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
461
- if (p !== void 0 && !g(p))
462
+ if (f !== void 0 && !w(f))
462
463
  throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
463
464
  if (!c.extractable)
464
465
  throw new TypeError('"DPoP.publicKey.extractable" must be true');
465
- const _ = ee() + a, f = {
466
- alg: ut(i),
466
+ const _ = ee() + s, p = {
467
+ alg: dt(i),
467
468
  typ: "dpop+jwt",
468
- jwk: await pt(c)
469
- }, v = {
469
+ jwk: await mt(c)
470
+ }, k = {
470
471
  iat: _,
471
472
  jti: X(),
472
473
  htm: o,
473
- nonce: p,
474
+ nonce: f,
474
475
  htu: `${n.origin}${n.pathname}`,
475
476
  ath: r ? A(await crypto.subtle.digest("SHA-256", E(r))) : void 0
476
477
  };
477
- (b = e[He]) == null || b.call(e, f, v), t.set("dpop", await ht(f, v, i));
478
+ (y = e[Fe]) == null || y.call(e, p, k), t.set("dpop", await ft(p, k, i));
478
479
  }
479
480
  let N;
480
- async function ft(t) {
481
- const { kty: e, e: n, n: o, x: a, y: r, crv: i } = await crypto.subtle.exportKey("jwk", t), c = { kty: e, e: n, n: o, x: a, y: r, crv: i };
481
+ async function wt(t) {
482
+ 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 };
482
483
  return N.set(t, c), c;
483
484
  }
484
- async function pt(t) {
485
- return N || (N = /* @__PURE__ */ new WeakMap()), N.get(t) || ft(t);
485
+ async function mt(t) {
486
+ return N || (N = /* @__PURE__ */ new WeakMap()), N.get(t) || wt(t);
486
487
  }
487
488
  function de(t, e, n) {
488
489
  if (typeof t != "string")
@@ -493,56 +494,56 @@ function be(t, e, n = !1) {
493
494
  return n && t.mtls_endpoint_aliases && e in t.mtls_endpoint_aliases ? de(t.mtls_endpoint_aliases[e], e, n) : de(t[e], e, n);
494
495
  }
495
496
  function _e(t, e) {
496
- return !!(t.use_mtls_endpoint_aliases || e != null && e[Fe]);
497
+ return !!(t.use_mtls_endpoint_aliases || e != null && e[Be]);
497
498
  }
498
499
  function G(t) {
499
500
  const e = t;
500
501
  return typeof e != "object" || Array.isArray(e) || e === null ? !1 : e.error !== void 0;
501
502
  }
502
- async function wt(t, e, n, o, a, r) {
503
- if (!g(t))
503
+ async function gt(t, e, n, o, s, r) {
504
+ if (!w(t))
504
505
  throw new TypeError('"accessToken" must be a non-empty string');
505
506
  if (!(n instanceof URL))
506
507
  throw new TypeError('"url" must be an instance of URL');
507
- return o = K(o), (r == null ? void 0 : r.DPoP) === void 0 ? o.set("authorization", `Bearer ${t}`) : (await dt(o, r.DPoP, n, e.toUpperCase(), H({ [W]: r == null ? void 0 : r[W] }), t), o.set("authorization", `DPoP ${t}`)), ((r == null ? void 0 : r[Z]) || fetch)(n.href, {
508
- body: a,
508
+ return o = K(o), (r == null ? void 0 : r.DPoP) === void 0 ? o.set("authorization", `Bearer ${t}`) : (await pt(o, r.DPoP, n, e.toUpperCase(), H({ [W]: r == null ? void 0 : r[W] }), t), o.set("authorization", `DPoP ${t}`)), ((r == null ? void 0 : r[Y]) || fetch)(n.href, {
509
+ body: s,
509
510
  headers: Object.fromEntries(o.entries()),
510
511
  method: e,
511
512
  redirect: "manual",
512
- signal: r != null && r.signal ? Xe(r.signal) : null
513
+ signal: r != null && r.signal ? tt(r.signal) : null
513
514
  }).then(Q);
514
515
  }
515
- async function gt(t, e, n, o) {
516
+ async function yt(t, e, n, o) {
516
517
  I(t), j(e);
517
- const a = be(t, "userinfo_endpoint", _e(e, o)), r = K(o == null ? void 0 : o.headers);
518
- return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), wt(n, "GET", a, r, null, {
518
+ const s = be(t, "userinfo_endpoint", _e(e, o)), r = K(o == null ? void 0 : o.headers);
519
+ return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), gt(n, "GET", s, r, null, {
519
520
  ...o,
520
521
  [W]: H(e)
521
522
  });
522
523
  }
523
- async function mt(t, e, n, o, a, r, i) {
524
- return await lt(t, e, a, r), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[Z]) || fetch)(o.href, {
525
- body: a,
524
+ async function bt(t, e, n, o, s, r, i) {
525
+ return await ht(t, e, s, r), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[Y]) || fetch)(o.href, {
526
+ body: s,
526
527
  headers: Object.fromEntries(r.entries()),
527
528
  method: n,
528
529
  redirect: "manual",
529
530
  signal: null
530
531
  }).then(Q);
531
532
  }
532
- async function ve(t, e, n, o, a) {
533
- const r = be(t, "token_endpoint", _e(e, a));
533
+ async function ve(t, e, n, o, s) {
534
+ const r = be(t, "token_endpoint", _e(e, s));
534
535
  o.set("grant_type", n);
535
- const i = K(a == null ? void 0 : a.headers);
536
- return i.set("accept", "application/json"), mt(t, e, "POST", r, o, i, a);
536
+ const i = K(s == null ? void 0 : s.headers);
537
+ return i.set("accept", "application/json"), bt(t, e, "POST", r, o, i, s);
537
538
  }
538
- async function yt(t, e, n, o) {
539
- if (I(t), j(e), !g(n))
539
+ async function _t(t, e, n, o) {
540
+ if (I(t), j(e), !w(n))
540
541
  throw new TypeError('"refreshToken" must be a non-empty string');
541
- const a = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
542
- return a.set("refresh_token", n), ve(t, e, "refresh_token", a, o);
542
+ const s = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
543
+ return s.set("refresh_token", n), ve(t, e, "refresh_token", s, o);
543
544
  }
544
545
  const Se = /* @__PURE__ */ new WeakMap();
545
- function bt(t) {
546
+ function vt(t) {
546
547
  if (!t.id_token)
547
548
  return;
548
549
  const e = Se.get(t);
@@ -550,88 +551,88 @@ function bt(t) {
550
551
  throw new TypeError('"ref" was already garbage collected or did not resolve from the proper sources');
551
552
  return e[0];
552
553
  }
553
- async function Te(t, e, n, o = !1, a = !1) {
554
- if (I(t), j(e), !Y(n, Response))
554
+ async function Te(t, e, n, o = !1, s = !1) {
555
+ if (I(t), j(e), !Z(n, Response))
555
556
  throw new TypeError('"response" must be an instance of Response');
556
557
  if (n.status !== 200) {
557
558
  let i;
558
- if (i = await Ut(n))
559
+ if (i = await xt(n))
559
560
  return i;
560
- throw new s('"response" is not a conform Token Endpoint response');
561
+ throw new a('"response" is not a conform Token Endpoint response');
561
562
  }
562
563
  te(n);
563
564
  let r;
564
565
  try {
565
566
  r = await n.json();
566
567
  } catch (i) {
567
- throw new s('failed to parse "response" body as JSON', { cause: i });
568
+ throw new a('failed to parse "response" body as JSON', { cause: i });
568
569
  }
569
- if (!x(r))
570
- throw new s('"response" body must be a top level object');
571
- if (!g(r.access_token))
572
- throw new s('"response" body "access_token" property must be a non-empty string');
573
- if (!g(r.token_type))
574
- throw new s('"response" body "token_type" property must be a non-empty string');
570
+ if (!C(r))
571
+ throw new a('"response" body must be a top level object');
572
+ if (!w(r.access_token))
573
+ throw new a('"response" body "access_token" property must be a non-empty string');
574
+ if (!w(r.token_type))
575
+ throw new a('"response" body "token_type" property must be a non-empty string');
575
576
  if (r.token_type = r.token_type.toLowerCase(), r.token_type !== "dpop" && r.token_type !== "bearer")
576
- throw new T("unsupported `token_type` value");
577
+ throw new S("unsupported `token_type` value");
577
578
  if (r.expires_in !== void 0 && (typeof r.expires_in != "number" || r.expires_in <= 0))
578
- throw new s('"response" body "expires_in" property must be a positive number');
579
- if (!a && r.refresh_token !== void 0 && !g(r.refresh_token))
580
- throw new s('"response" body "refresh_token" property must be a non-empty string');
579
+ throw new a('"response" body "expires_in" property must be a positive number');
580
+ if (!s && r.refresh_token !== void 0 && !w(r.refresh_token))
581
+ throw new a('"response" body "refresh_token" property must be a non-empty string');
581
582
  if (r.scope !== void 0 && typeof r.scope != "string")
582
- throw new s('"response" body "scope" property must be a string');
583
+ throw new a('"response" body "scope" property must be a string');
583
584
  if (!o) {
584
- if (r.id_token !== void 0 && !g(r.id_token))
585
- throw new s('"response" body "id_token" property must be a non-empty string');
585
+ if (r.id_token !== void 0 && !w(r.id_token))
586
+ throw new a('"response" body "id_token" property must be a non-empty string');
586
587
  if (r.id_token) {
587
- const { claims: i, jwt: c } = await xt(r.id_token, It.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), Ee, H(e), ye(e), e[$e]).then(Et.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(St.bind(void 0, t.issuer)).then(vt.bind(void 0, e.client_id));
588
+ const { claims: i, jwt: c } = await jt(r.id_token, Ot.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), Ee, H(e), ye(e), e[Me]).then(Pt.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(At.bind(void 0, t.issuer)).then(Tt.bind(void 0, e.client_id));
588
589
  if (Array.isArray(i.aud) && i.aud.length !== 1) {
589
590
  if (i.azp === void 0)
590
- throw new s('ID Token "aud" (audience) claim includes additional untrusted audiences');
591
+ throw new a('ID Token "aud" (audience) claim includes additional untrusted audiences');
591
592
  if (i.azp !== e.client_id)
592
- throw new s('unexpected ID Token "azp" (authorized party) claim value');
593
+ throw new a('unexpected ID Token "azp" (authorized party) claim value');
593
594
  }
594
595
  if (i.auth_time !== void 0 && (!Number.isFinite(i.auth_time) || Math.sign(i.auth_time) !== 1))
595
- throw new s('ID Token "auth_time" (authentication time) must be a positive number');
596
+ throw new a('ID Token "auth_time" (authentication time) must be a positive number');
596
597
  Se.set(r, [i, c]);
597
598
  }
598
599
  }
599
600
  return r;
600
601
  }
601
- async function _t(t, e, n) {
602
+ async function St(t, e, n) {
602
603
  return Te(t, e, n);
603
604
  }
604
- function vt(t, e) {
605
+ function Tt(t, e) {
605
606
  if (Array.isArray(e.claims.aud)) {
606
607
  if (!e.claims.aud.includes(t))
607
- throw new s('unexpected JWT "aud" (audience) claim value');
608
+ throw new a('unexpected JWT "aud" (audience) claim value');
608
609
  } else if (e.claims.aud !== t)
609
- throw new s('unexpected JWT "aud" (audience) claim value');
610
+ throw new a('unexpected JWT "aud" (audience) claim value');
610
611
  return e;
611
612
  }
612
- function St(t, e) {
613
+ function At(t, e) {
613
614
  if (e.claims.iss !== t)
614
- throw new s('unexpected JWT "iss" (issuer) claim value');
615
+ throw new a('unexpected JWT "iss" (issuer) claim value');
615
616
  return e;
616
617
  }
617
- const ke = /* @__PURE__ */ new WeakSet();
618
- function Tt(t) {
619
- return ke.add(t), t;
618
+ const Ae = /* @__PURE__ */ new WeakSet();
619
+ function kt(t) {
620
+ return Ae.add(t), t;
620
621
  }
621
- async function kt(t, e, n, o, a, r) {
622
- if (I(t), j(e), !ke.has(n))
622
+ async function Et(t, e, n, o, s, r) {
623
+ if (I(t), j(e), !Ae.has(n))
623
624
  throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
624
- if (!g(o))
625
+ if (!w(o))
625
626
  throw new TypeError('"redirectUri" must be a non-empty string');
626
- if (!g(a))
627
+ if (!w(s))
627
628
  throw new TypeError('"codeVerifier" must be a non-empty string');
628
- const i = k(n, "code");
629
+ const i = T(n, "code");
629
630
  if (!i)
630
- throw new s('no authorization code in "callbackParameters"');
631
+ throw new a('no authorization code in "callbackParameters"');
631
632
  const c = new URLSearchParams(r == null ? void 0 : r.additionalParameters);
632
- return c.set("redirect_uri", o), c.set("code_verifier", a), c.set("code", i), ve(t, e, "authorization_code", c, r);
633
+ return c.set("redirect_uri", o), c.set("code_verifier", s), c.set("code", i), ve(t, e, "authorization_code", c, r);
633
634
  }
634
- const At = {
635
+ const Rt = {
635
636
  aud: "audience",
636
637
  c_hash: "code hash",
637
638
  client_id: "client id",
@@ -647,43 +648,43 @@ const At = {
647
648
  htu: "http uri",
648
649
  cnf: "confirmation"
649
650
  };
650
- function Et(t, e) {
651
+ function Pt(t, e) {
651
652
  for (const n of t)
652
653
  if (e.claims[n] === void 0)
653
- throw new s(`JWT "${n}" (${At[n]}) claim missing`);
654
+ throw new a(`JWT "${n}" (${Rt[n]}) claim missing`);
654
655
  return e;
655
656
  }
656
- const Rt = Symbol(), F = Symbol();
657
- async function Pt(t, e, n, o, a) {
657
+ const Ut = Symbol(), F = Symbol();
658
+ async function Lt(t, e, n, o, s) {
658
659
  const r = await Te(t, e, n);
659
660
  if (G(r))
660
661
  return r;
661
- if (!g(r.id_token))
662
- throw new s('"response" body "id_token" property must be a non-empty string');
663
- a ?? (a = e.default_max_age ?? F);
664
- const i = bt(r);
665
- if ((e.require_auth_time || a !== F) && i.auth_time === void 0)
666
- throw new s('ID Token "auth_time" (authentication time) claim missing');
667
- if (a !== F) {
668
- if (typeof a != "number" || a < 0)
662
+ if (!w(r.id_token))
663
+ throw new a('"response" body "id_token" property must be a non-empty string');
664
+ s ?? (s = e.default_max_age ?? F);
665
+ const i = vt(r);
666
+ if ((e.require_auth_time || s !== F) && i.auth_time === void 0)
667
+ throw new a('ID Token "auth_time" (authentication time) claim missing');
668
+ if (s !== F) {
669
+ if (typeof s != "number" || s < 0)
669
670
  throw new TypeError('"maxAge" must be a non-negative number');
670
- const c = ee() + H(e), p = ye(e);
671
- if (i.auth_time + a < c - p)
672
- throw new s("too much time has elapsed since the last End-User authentication");
671
+ const c = ee() + H(e), f = ye(e);
672
+ if (i.auth_time + s < c - f)
673
+ throw new a("too much time has elapsed since the last End-User authentication");
673
674
  }
674
675
  switch (o) {
675
676
  case void 0:
676
- case Rt:
677
+ case Ut:
677
678
  if (i.nonce !== void 0)
678
- throw new s('unexpected ID Token "nonce" claim value');
679
+ throw new a('unexpected ID Token "nonce" claim value');
679
680
  break;
680
681
  default:
681
- if (!g(o))
682
+ if (!w(o))
682
683
  throw new TypeError('"expectedNonce" must be a non-empty string');
683
684
  if (i.nonce === void 0)
684
- throw new s('ID Token "nonce" claim missing');
685
+ throw new a('ID Token "nonce" claim missing');
685
686
  if (i.nonce !== o)
686
- throw new s('unexpected ID Token "nonce" claim value');
687
+ throw new a('unexpected ID Token "nonce" claim value');
687
688
  }
688
689
  return r;
689
690
  }
@@ -691,20 +692,20 @@ function te(t) {
691
692
  if (t.bodyUsed)
692
693
  throw new TypeError('"response" body has been used already');
693
694
  }
694
- async function Ut(t) {
695
+ async function xt(t) {
695
696
  if (t.status > 399 && t.status < 500) {
696
697
  te(t);
697
698
  try {
698
699
  const e = await t.json();
699
- if (x(e) && typeof e.error == "string" && e.error.length)
700
+ if (C(e) && typeof e.error == "string" && e.error.length)
700
701
  return e.error_description !== void 0 && typeof e.error_description != "string" && delete e.error_description, e.error_uri !== void 0 && typeof e.error_uri != "string" && delete e.error_uri, e.algs !== void 0 && typeof e.algs != "string" && delete e.algs, e.scope !== void 0 && typeof e.scope != "string" && delete e.scope, e;
701
702
  } catch {
702
703
  }
703
704
  }
704
705
  }
705
- function fe(t) {
706
+ function he(t) {
706
707
  if (typeof t.modulusLength != "number" || t.modulusLength < 2048)
707
- throw new s(`${t.name} modulusLength must be at least 2048 bits`);
708
+ throw new a(`${t.name} modulusLength must be at least 2048 bits`);
708
709
  }
709
710
  function Ct(t) {
710
711
  switch (t) {
@@ -715,10 +716,10 @@ function Ct(t) {
715
716
  case "P-521":
716
717
  return "SHA-512";
717
718
  default:
718
- throw new T();
719
+ throw new S();
719
720
  }
720
721
  }
721
- function Ae(t) {
722
+ function ke(t) {
722
723
  switch (t.algorithm.name) {
723
724
  case "ECDSA":
724
725
  return {
@@ -726,7 +727,7 @@ function Ae(t) {
726
727
  hash: Ct(t.algorithm.namedCurve)
727
728
  };
728
729
  case "RSA-PSS":
729
- switch (fe(t.algorithm), t.algorithm.hash.name) {
730
+ switch (he(t.algorithm), t.algorithm.hash.name) {
730
731
  case "SHA-256":
731
732
  case "SHA-384":
732
733
  case "SHA-512":
@@ -735,204 +736,210 @@ function Ae(t) {
735
736
  saltLength: parseInt(t.algorithm.hash.name.slice(-3), 10) >> 3
736
737
  };
737
738
  default:
738
- throw new T();
739
+ throw new S();
739
740
  }
740
741
  case "RSASSA-PKCS1-v1_5":
741
- return fe(t.algorithm), t.algorithm.name;
742
+ return he(t.algorithm), t.algorithm.name;
742
743
  case "Ed448":
743
744
  case "Ed25519":
744
745
  return t.algorithm.name;
745
746
  }
746
- throw new T();
747
+ throw new S();
747
748
  }
748
749
  const Ee = Symbol();
749
- async function Lt(t, e, n, o) {
750
- const a = `${t}.${e}`;
751
- if (!await crypto.subtle.verify(Ae(n), n, o, E(a)))
752
- throw new s("JWT signature verification failed");
750
+ async function It(t, e, n, o) {
751
+ const s = `${t}.${e}`;
752
+ if (!await crypto.subtle.verify(ke(n), n, o, E(s)))
753
+ throw new a("JWT signature verification failed");
753
754
  }
754
- async function xt(t, e, n, o, a, r) {
755
- let { 0: i, 1: c, 2: p, length: _ } = t.split(".");
755
+ async function jt(t, e, n, o, s, r) {
756
+ let { 0: i, 1: c, 2: f, length: _ } = t.split(".");
756
757
  if (_ === 5)
757
758
  if (r !== void 0)
758
- t = await r(t), { 0: i, 1: c, 2: p, length: _ } = t.split(".");
759
+ t = await r(t), { 0: i, 1: c, 2: f, length: _ } = t.split(".");
759
760
  else
760
- throw new T("JWE structure JWTs are not supported");
761
+ throw new S("JWE structure JWTs are not supported");
761
762
  if (_ !== 3)
762
- throw new s("Invalid JWT");
763
- let f;
763
+ throw new a("Invalid JWT");
764
+ let p;
764
765
  try {
765
- f = JSON.parse(E(A(i)));
766
+ p = JSON.parse(E(A(i)));
766
767
  } catch (l) {
767
- throw new s("failed to parse JWT Header body as base64url encoded JSON", { cause: l });
768
+ throw new a("failed to parse JWT Header body as base64url encoded JSON", { cause: l });
768
769
  }
769
- if (!x(f))
770
- throw new s("JWT Header must be a top level object");
771
- if (e(f), f.crit !== void 0)
772
- throw new s('unexpected JWT "crit" header parameter');
773
- const v = A(p);
774
- let b;
775
- n !== Ee && (b = await n(f), await Lt(i, c, b, v));
776
- let d;
770
+ if (!C(p))
771
+ throw new a("JWT Header must be a top level object");
772
+ if (e(p), p.crit !== void 0)
773
+ throw new a('unexpected JWT "crit" header parameter');
774
+ const k = A(f);
775
+ let y;
776
+ n !== Ee && (y = await n(p), await It(i, c, y, k));
777
+ let h;
777
778
  try {
778
- d = JSON.parse(E(A(c)));
779
+ h = JSON.parse(E(A(c)));
779
780
  } catch (l) {
780
- throw new s("failed to parse JWT Payload body as base64url encoded JSON", { cause: l });
781
+ throw new a("failed to parse JWT Payload body as base64url encoded JSON", { cause: l });
781
782
  }
782
- if (!x(d))
783
- throw new s("JWT Payload must be a top level object");
783
+ if (!C(h))
784
+ throw new a("JWT Payload must be a top level object");
784
785
  const P = ee() + o;
785
- if (d.exp !== void 0) {
786
- if (typeof d.exp != "number")
787
- throw new s('unexpected JWT "exp" (expiration time) claim type');
788
- if (d.exp <= P - a)
789
- throw new s('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
786
+ if (h.exp !== void 0) {
787
+ if (typeof h.exp != "number")
788
+ throw new a('unexpected JWT "exp" (expiration time) claim type');
789
+ if (h.exp <= P - s)
790
+ throw new a('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
790
791
  }
791
- if (d.iat !== void 0 && typeof d.iat != "number")
792
- throw new s('unexpected JWT "iat" (issued at) claim type');
793
- if (d.iss !== void 0 && typeof d.iss != "string")
794
- throw new s('unexpected JWT "iss" (issuer) claim type');
795
- if (d.nbf !== void 0) {
796
- if (typeof d.nbf != "number")
797
- throw new s('unexpected JWT "nbf" (not before) claim type');
798
- if (d.nbf > P + a)
799
- throw new s('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
792
+ if (h.iat !== void 0 && typeof h.iat != "number")
793
+ throw new a('unexpected JWT "iat" (issued at) claim type');
794
+ if (h.iss !== void 0 && typeof h.iss != "string")
795
+ throw new a('unexpected JWT "iss" (issuer) claim type');
796
+ if (h.nbf !== void 0) {
797
+ if (typeof h.nbf != "number")
798
+ throw new a('unexpected JWT "nbf" (not before) claim type');
799
+ if (h.nbf > P + s)
800
+ throw new a('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
800
801
  }
801
- if (d.aud !== void 0 && typeof d.aud != "string" && !Array.isArray(d.aud))
802
- throw new s('unexpected JWT "aud" (audience) claim type');
803
- return { header: f, claims: d, signature: v, key: b, jwt: t };
802
+ if (h.aud !== void 0 && typeof h.aud != "string" && !Array.isArray(h.aud))
803
+ throw new a('unexpected JWT "aud" (audience) claim type');
804
+ return { header: p, claims: h, signature: k, key: y, jwt: t };
804
805
  }
805
- function It(t, e, n) {
806
+ function Ot(t, e, n) {
806
807
  if (t !== void 0) {
807
808
  if (n.alg !== t)
808
- throw new s('unexpected JWT "alg" header parameter');
809
+ throw new a('unexpected JWT "alg" header parameter');
809
810
  return;
810
811
  }
811
812
  if (Array.isArray(e)) {
812
813
  if (!e.includes(n.alg))
813
- throw new s('unexpected JWT "alg" header parameter');
814
+ throw new a('unexpected JWT "alg" header parameter');
814
815
  return;
815
816
  }
816
817
  if (n.alg !== "RS256")
817
- throw new s('unexpected JWT "alg" header parameter');
818
+ throw new a('unexpected JWT "alg" header parameter');
818
819
  }
819
- function k(t, e) {
820
+ function T(t, e) {
820
821
  const { 0: n, length: o } = t.getAll(e);
821
822
  if (o > 1)
822
- throw new s(`"${e}" parameter must be provided only once`);
823
+ throw new a(`"${e}" parameter must be provided only once`);
823
824
  return n;
824
825
  }
825
- const jt = Symbol(), Jt = Symbol();
826
- function Ot(t, e, n, o) {
826
+ const zt = Symbol(), Jt = Symbol();
827
+ function Dt(t, e, n, o) {
827
828
  if (I(t), j(e), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
828
829
  throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
829
- if (k(n, "response"))
830
- throw new s('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
831
- const a = k(n, "iss"), r = k(n, "state");
832
- if (!a && t.authorization_response_iss_parameter_supported)
833
- throw new s('response parameter "iss" (issuer) missing');
834
- if (a && a !== t.issuer)
835
- throw new s('unexpected "iss" (issuer) response parameter value');
830
+ if (T(n, "response"))
831
+ throw new a('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
832
+ const s = T(n, "iss"), r = T(n, "state");
833
+ if (!s && t.authorization_response_iss_parameter_supported)
834
+ throw new a('response parameter "iss" (issuer) missing');
835
+ if (s && s !== t.issuer)
836
+ throw new a('unexpected "iss" (issuer) response parameter value');
836
837
  switch (o) {
837
838
  case void 0:
838
839
  case Jt:
839
840
  if (r !== void 0)
840
- throw new s('unexpected "state" response parameter encountered');
841
+ throw new a('unexpected "state" response parameter encountered');
841
842
  break;
842
- case jt:
843
+ case zt:
843
844
  break;
844
845
  default:
845
- if (!g(o))
846
- throw new s('"expectedState" must be a non-empty string');
846
+ if (!w(o))
847
+ throw new a('"expectedState" must be a non-empty string');
847
848
  if (r === void 0)
848
- throw new s('response parameter "state" missing');
849
+ throw new a('response parameter "state" missing');
849
850
  if (r !== o)
850
- throw new s('unexpected "state" response parameter value');
851
+ throw new a('unexpected "state" response parameter value');
851
852
  }
852
- const i = k(n, "error");
853
+ const i = T(n, "error");
853
854
  if (i)
854
855
  return {
855
856
  error: i,
856
- error_description: k(n, "error_description"),
857
- error_uri: k(n, "error_uri")
857
+ error_description: T(n, "error_description"),
858
+ error_uri: T(n, "error_uri")
858
859
  };
859
- const c = k(n, "id_token"), p = k(n, "token");
860
- if (c !== void 0 || p !== void 0)
861
- throw new T("implicit and hybrid flows are not supported");
862
- return Tt(new URLSearchParams(n));
860
+ const c = T(n, "id_token"), f = T(n, "token");
861
+ if (c !== void 0 || f !== void 0)
862
+ throw new S("implicit and hybrid flows are not supported");
863
+ return kt(new URLSearchParams(n));
863
864
  }
864
- function zt({
865
+ function Nt(t, e, n = "/") {
866
+ return t.startsWith(e) ? n !== "/" && t.startsWith(e + n) ? t.slice(e.length + n.length) : t.slice(e.length) : t;
867
+ }
868
+ function Wt({
865
869
  handleCallback: t
866
870
  }) {
867
- const e = je({
871
+ const { options: e } = De(), n = Oe({
868
872
  retry: !1,
869
873
  queryKey: ["oauth-callback"],
870
874
  queryFn: async () => {
871
875
  try {
872
- return await t();
873
- } catch (n) {
874
- throw new ze("Could not validate user", {
875
- cause: n,
876
+ return we(
877
+ Nt(
878
+ await t(),
879
+ window.location.origin,
880
+ e.basePath
881
+ )
882
+ );
883
+ } catch (o) {
884
+ throw new Ne("Could not validate user", {
885
+ cause: o,
876
886
  title: "Authentication Error",
877
887
  developerHint: "Check the configuration of your authorization provider and ensure all settings such as the callback URL are configured correctly."
878
888
  });
879
889
  }
880
890
  }
881
891
  });
882
- return /* @__PURE__ */ B.jsx(Oe, { to: e.data });
892
+ return /* @__PURE__ */ q.jsx(Je, { to: n.data });
883
893
  }
884
894
  class R extends Error {
885
895
  }
886
- class pe extends R {
896
+ class fe extends R {
887
897
  constructor(e, n, o) {
888
898
  super(e, o), this.error = n;
889
899
  }
890
900
  }
891
- const M = "code-verifier", q = "oauth-state";
892
- class Dt extends Je {
893
- constructor(e, n) {
894
- super(), this.callbackUrlPath = e, this.handleCallback = n;
901
+ const M = "code-verifier", B = "oauth-state", Re = "/oauth/callback";
902
+ class Kt extends ze {
903
+ constructor(e) {
904
+ super(), this.handleCallback = e;
895
905
  }
896
906
  getRoutes() {
897
907
  return [
898
908
  ...super.getRoutes(),
899
909
  {
900
- path: this.callbackUrlPath,
901
- element: /* @__PURE__ */ B.jsx(Ie, { children: /* @__PURE__ */ B.jsx(zt, { handleCallback: this.handleCallback }) })
910
+ path: Re,
911
+ element: /* @__PURE__ */ q.jsx(je, { children: /* @__PURE__ */ q.jsx(Wt, { handleCallback: this.handleCallback }) })
902
912
  }
903
913
  ];
904
914
  }
905
915
  }
906
- class Nt {
916
+ class Ht {
907
917
  constructor({
908
918
  issuer: e,
909
919
  audience: n,
910
920
  clientId: o,
911
- redirectToAfterSignUp: a,
921
+ redirectToAfterSignUp: s,
912
922
  redirectToAfterSignIn: r,
913
- redirectToAfterSignOut: i,
923
+ redirectToAfterSignOut: i = "/",
914
924
  basePath: c,
915
- scopes: p
925
+ scopes: f
916
926
  }) {
917
- w(this, "client");
918
- w(this, "issuer");
919
- w(this, "authorizationServer");
920
- w(this, "absoluteCallbackUrlPath");
921
- w(this, "relativeCallbackUrlPath");
922
- w(this, "logoutRedirectUrlPath");
923
- w(this, "onAuthorizationUrl");
924
- w(this, "redirectToAfterSignUp");
925
- w(this, "redirectToAfterSignIn");
926
- w(this, "redirectToAfterSignOut");
927
- w(this, "audience");
928
- w(this, "scopes");
929
- w(this, "root");
930
- w(this, "signRequest", async (e) => {
927
+ b(this, "client");
928
+ b(this, "issuer");
929
+ b(this, "authorizationServer");
930
+ b(this, "callbackUrlPath");
931
+ b(this, "onAuthorizationUrl");
932
+ b(this, "redirectToAfterSignUp");
933
+ b(this, "redirectToAfterSignIn");
934
+ b(this, "redirectToAfterSignOut");
935
+ b(this, "audience");
936
+ b(this, "scopes");
937
+ b(this, "signRequest", async (e) => {
931
938
  const n = await this.getAccessToken();
932
939
  return e.headers.set("Authorization", `Bearer ${n}`), e;
933
940
  });
934
- w(this, "signOut", async () => {
935
- L.setState({
941
+ b(this, "signOut", async () => {
942
+ x.setState({
936
943
  isAuthenticated: !1,
937
944
  isPending: !1,
938
945
  profile: void 0,
@@ -941,60 +948,60 @@ class Nt {
941
948
  const e = await this.getAuthServer(), n = new URL(
942
949
  window.location.origin + this.redirectToAfterSignOut
943
950
  );
944
- n.pathname = this.logoutRedirectUrlPath;
951
+ n.pathname = this.callbackUrlPath;
945
952
  let o;
946
953
  e.end_session_endpoint ? (o = new URL(e.end_session_endpoint), o.searchParams.set(
947
954
  "post_logout_redirect_uri",
948
955
  n.toString()
949
956
  )) : o = n;
950
957
  });
951
- w(this, "handleCallback", async () => {
952
- const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(q);
953
- if (sessionStorage.removeItem(q), n !== o)
958
+ b(this, "handleCallback", async () => {
959
+ const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(B);
960
+ if (sessionStorage.removeItem(B), n !== o)
954
961
  throw new R("Invalid state parameter");
955
- const a = sessionStorage.getItem(M);
956
- if (sessionStorage.removeItem(M), !a)
962
+ const s = sessionStorage.getItem(M);
963
+ if (sessionStorage.removeItem(M), !s)
957
964
  throw new R("No code verifier found in state.");
958
- const r = await this.getAuthServer(), i = Ot(
965
+ const r = await this.getAuthServer(), i = Dt(
959
966
  r,
960
967
  this.client,
961
968
  e.searchParams,
962
969
  n ?? void 0
963
970
  );
964
971
  if (G(i))
965
- throw se.error("Error validating OAuth response", i), new pe(
972
+ throw se.error("Error validating OAuth response", i), new fe(
966
973
  "Error validating OAuth response",
967
974
  i
968
975
  );
969
976
  const c = new URL(e);
970
- c.pathname = this.absoluteCallbackUrlPath, c.search = "";
971
- const p = await kt(
977
+ c.pathname = this.callbackUrlPath, c.search = "";
978
+ const f = await Et(
972
979
  r,
973
980
  this.client,
974
981
  i,
975
982
  c.toString(),
976
- a
977
- ), _ = await Pt(
983
+ s
984
+ ), _ = await Lt(
978
985
  r,
979
986
  this.client,
980
- p
987
+ f
981
988
  );
982
989
  this.setTokensFromResponse(_);
983
- const f = await this.getAccessToken(), b = await (await gt(
990
+ const p = await this.getAccessToken(), y = await (await yt(
984
991
  r,
985
992
  this.client,
986
- f
987
- )).json(), d = {
988
- sub: b.sub,
989
- email: b.email,
990
- name: b.name,
991
- emailVerified: b.email_verified ?? !1,
992
- pictureUrl: b.picture
993
+ p
994
+ )).json(), h = {
995
+ sub: y.sub,
996
+ email: y.email,
997
+ name: y.name,
998
+ emailVerified: y.email_verified ?? !1,
999
+ pictureUrl: y.picture
993
1000
  };
994
- L.setState({
1001
+ x.setState({
995
1002
  isAuthenticated: !0,
996
1003
  isPending: !1,
997
- profile: d
1004
+ profile: h
998
1005
  });
999
1006
  const P = sessionStorage.getItem("redirect-to") ?? "/";
1000
1007
  return sessionStorage.removeItem("redirect-to"), P;
@@ -1002,15 +1009,12 @@ class Nt {
1002
1009
  this.client = {
1003
1010
  client_id: o,
1004
1011
  token_endpoint_auth_method: "none"
1005
- }, this.audience = n, this.issuer = e, this.relativeCallbackUrlPath = "/oauth/callback", this.absoluteCallbackUrlPath = ie(
1006
- c,
1007
- this.relativeCallbackUrlPath
1008
- ), this.scopes = p ?? ["openid", "profile", "email"], this.root = ie(c, "/"), this.logoutRedirectUrlPath = this.root, this.redirectToAfterSignUp = a ?? this.root, this.redirectToAfterSignIn = r ?? this.root, this.redirectToAfterSignOut = i ?? this.root;
1012
+ }, this.audience = n, this.issuer = e, this.callbackUrlPath = we(c, Re), this.scopes = f ?? ["openid", "profile", "email"], this.redirectToAfterSignUp = s, this.redirectToAfterSignIn = r, this.redirectToAfterSignOut = i;
1009
1013
  }
1010
1014
  async getAuthServer() {
1011
1015
  if (!this.authorizationServer) {
1012
- const e = new URL(this.issuer), n = await et(e);
1013
- this.authorizationServer = await tt(
1016
+ const e = new URL(this.issuer), n = await nt(e);
1017
+ this.authorizationServer = await rt(
1014
1018
  e,
1015
1019
  n
1016
1020
  );
@@ -1023,7 +1027,7 @@ class Nt {
1023
1027
  */
1024
1028
  setTokensFromResponse(e) {
1025
1029
  if (G(e))
1026
- throw se.error("Bad Token Response", e), new pe("Bad Token Response", e);
1030
+ throw se.error("Bad Token Response", e), new fe("Bad Token Response", e);
1027
1031
  if (!e.expires_in)
1028
1032
  throw new R("No expires_in in response");
1029
1033
  const n = {
@@ -1033,67 +1037,67 @@ class Nt {
1033
1037
  expiresOn: new Date(Date.now() + e.expires_in * 1e3),
1034
1038
  tokenType: e.token_type
1035
1039
  };
1036
- L.setState({
1040
+ x.setState({
1037
1041
  providerData: n
1038
1042
  });
1039
1043
  }
1040
1044
  async signUp({ redirectTo: e } = {}) {
1041
1045
  return this.authorize({
1042
- redirectTo: e ?? this.redirectToAfterSignUp,
1046
+ redirectTo: this.redirectToAfterSignUp ?? e ?? "/",
1043
1047
  isSignUp: !0
1044
1048
  });
1045
1049
  }
1046
1050
  async signIn({ redirectTo: e } = {}) {
1047
1051
  return this.authorize({
1048
- redirectTo: e ?? this.redirectToAfterSignIn
1052
+ redirectTo: this.redirectToAfterSignIn ?? e ?? "/"
1049
1053
  });
1050
1054
  }
1051
1055
  async authorize({
1052
1056
  redirectTo: e,
1053
1057
  isSignUp: n = !1
1054
1058
  }) {
1055
- var v;
1056
- const o = "S256", a = await this.getAuthServer();
1057
- if (!a.authorization_endpoint)
1059
+ var p;
1060
+ const o = "S256", s = await this.getAuthServer();
1061
+ if (!s.authorization_endpoint)
1058
1062
  throw new R("No authorization endpoint");
1059
- const r = nt(), i = await ot(r);
1063
+ const r = ot(), i = await st(r);
1060
1064
  sessionStorage.setItem(M, r);
1061
1065
  const c = new URL(
1062
- a.authorization_endpoint
1063
- ), p = e.startsWith(window.location.origin) ? this.root !== "/" && e.startsWith(window.location.origin + this.root) ? e.slice(window.location.origin.length + this.root.length) : e.slice(window.location.origin.length) : e;
1064
- sessionStorage.setItem("redirect-to", p);
1065
- const _ = new URL(window.location.origin);
1066
- _.pathname = this.absoluteCallbackUrlPath, _.search = "", c.searchParams.set("client_id", this.client.client_id), c.searchParams.set("redirect_uri", _.toString()), c.searchParams.set("response_type", "code"), c.searchParams.set("scope", this.scopes.join(" ")), c.searchParams.set("code_challenge", i), c.searchParams.set(
1066
+ s.authorization_endpoint
1067
+ );
1068
+ sessionStorage.setItem("redirect-to", e);
1069
+ const f = new URL(window.location.origin);
1070
+ 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(
1067
1071
  "code_challenge_method",
1068
1072
  o
1069
- ), this.audience && c.searchParams.set("audience", this.audience), (v = this.onAuthorizationUrl) == null || v.call(this, c, {
1073
+ ), this.audience && c.searchParams.set("audience", this.audience), (p = this.onAuthorizationUrl) == null || p.call(this, c, {
1070
1074
  isSignIn: !n,
1071
1075
  isSignUp: n
1072
1076
  });
1073
- const f = rt();
1074
- sessionStorage.setItem(q, f), c.searchParams.set("state", f), location.href = c.href;
1077
+ const _ = it();
1078
+ sessionStorage.setItem(B, _), c.searchParams.set("state", _), location.href = c.href;
1075
1079
  }
1076
1080
  async getAccessToken() {
1077
- const e = await this.getAuthServer(), { providerData: n } = L.getState();
1081
+ const e = await this.getAuthServer(), { providerData: n } = x.getState();
1078
1082
  if (!n)
1079
1083
  throw new R("User is not authenticated");
1080
1084
  const o = n;
1081
1085
  if (new Date(o.expiresOn) < /* @__PURE__ */ new Date()) {
1082
1086
  if (!o.refreshToken)
1083
- return L.setState({
1087
+ return x.setState({
1084
1088
  isAuthenticated: !1,
1085
1089
  isPending: !1,
1086
1090
  profile: null,
1087
1091
  providerData: null
1088
1092
  }), "";
1089
- const a = await yt(
1093
+ const s = await _t(
1090
1094
  e,
1091
1095
  this.client,
1092
1096
  o.refreshToken
1093
- ), r = await _t(
1097
+ ), r = await St(
1094
1098
  e,
1095
1099
  this.client,
1096
- a
1100
+ s
1097
1101
  );
1098
1102
  if (!r.access_token)
1099
1103
  throw new R("No access token in response");
@@ -1102,15 +1106,13 @@ class Nt {
1102
1106
  return o.accessToken;
1103
1107
  }
1104
1108
  getAuthenticationPlugin() {
1105
- return new Dt(
1106
- this.relativeCallbackUrlPath,
1107
- this.handleCallback
1108
- );
1109
+ return new Kt(this.handleCallback);
1109
1110
  }
1110
1111
  }
1111
- const Vt = (t) => new Nt(t);
1112
+ const Qt = (t) => new Ht(t);
1112
1113
  export {
1113
- Nt as OpenIDAuthenticationProvider,
1114
- Vt as default
1114
+ Re as OPENID_CALLBACK_PATH,
1115
+ Ht as OpenIDAuthenticationProvider,
1116
+ Qt as default
1115
1117
  };
1116
1118
  //# sourceMappingURL=zudoku.auth-openid.js.map