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