zudoku 0.32.6 → 0.33.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 (205) hide show
  1. package/cli.js +3 -0
  2. package/dist/app/main.js +1 -1
  3. package/dist/app/main.js.map +1 -1
  4. package/dist/cli/build/handler.d.ts +1 -3
  5. package/dist/cli/build/handler.js +7 -0
  6. package/dist/cli/build/handler.js.map +1 -1
  7. package/dist/cli/cli.js +5 -0
  8. package/dist/cli/cli.js.map +1 -1
  9. package/dist/cli/cmds/build.d.ts +11 -3
  10. package/dist/cli/cmds/build.js +20 -13
  11. package/dist/cli/cmds/build.js.map +1 -1
  12. package/dist/cli/cmds/preview.d.ts +16 -0
  13. package/dist/cli/cmds/preview.js +25 -0
  14. package/dist/cli/cmds/preview.js.map +1 -0
  15. package/dist/cli/preview/handler.d.ts +3 -0
  16. package/dist/cli/preview/handler.js +37 -0
  17. package/dist/cli/preview/handler.js.map +1 -0
  18. package/dist/config/common.d.ts +5 -2
  19. package/dist/config/config.d.ts +2 -7
  20. package/dist/config/loader.d.ts +4 -4
  21. package/dist/config/loader.js +7 -4
  22. package/dist/config/loader.js.map +1 -1
  23. package/dist/config/validators/validate.d.ts +1 -1
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.js +1 -0
  26. package/dist/index.js.map +1 -1
  27. package/dist/lib/authentication/providers/auth0.d.ts +2 -2
  28. package/dist/lib/authentication/providers/auth0.js +1 -0
  29. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  30. package/dist/lib/authentication/providers/openid.d.ts +4 -3
  31. package/dist/lib/authentication/providers/openid.js +4 -2
  32. package/dist/lib/authentication/providers/openid.js.map +1 -1
  33. package/dist/lib/authentication/state.js +8 -2
  34. package/dist/lib/authentication/state.js.map +1 -1
  35. package/dist/lib/components/ThemeSwitch.js +1 -1
  36. package/dist/lib/components/ThemeSwitch.js.map +1 -1
  37. package/dist/lib/components/Zudoku.d.ts +1 -1
  38. package/dist/lib/components/Zudoku.js +7 -6
  39. package/dist/lib/components/Zudoku.js.map +1 -1
  40. package/dist/lib/components/context/RouterEventsEmitter.d.ts +1 -0
  41. package/dist/lib/components/context/RouterEventsEmitter.js +17 -0
  42. package/dist/lib/components/context/RouterEventsEmitter.js.map +1 -0
  43. package/dist/lib/components/index.d.ts +1 -1
  44. package/dist/lib/core/RouteGuard.d.ts +1 -1
  45. package/dist/lib/core/RouteGuard.js +23 -18
  46. package/dist/lib/core/RouteGuard.js.map +1 -1
  47. package/dist/lib/core/ZudokuContext.d.ts +10 -0
  48. package/dist/lib/core/ZudokuContext.js +17 -1
  49. package/dist/lib/core/ZudokuContext.js.map +1 -1
  50. package/dist/lib/core/plugins.d.ts +8 -2
  51. package/dist/lib/core/plugins.js +1 -0
  52. package/dist/lib/core/plugins.js.map +1 -1
  53. package/dist/lib/hooks/index.d.ts +3 -0
  54. package/dist/lib/hooks/index.js +5 -0
  55. package/dist/lib/hooks/index.js.map +1 -0
  56. package/dist/lib/hooks/useEvent.d.ts +11 -0
  57. package/dist/lib/hooks/useEvent.js +19 -0
  58. package/dist/lib/hooks/useEvent.js.map +1 -0
  59. package/dist/lib/hooks/useEvent.test.d.ts +1 -0
  60. package/dist/lib/hooks/useEvent.test.js +100 -0
  61. package/dist/lib/hooks/useEvent.test.js.map +1 -0
  62. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  63. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  64. package/dist/lib/ui/Stepper.d.ts +4 -0
  65. package/dist/lib/ui/Stepper.js +7 -0
  66. package/dist/lib/ui/Stepper.js.map +1 -0
  67. package/dist/lib/util/MdxComponents.d.ts +3 -1
  68. package/dist/lib/util/MdxComponents.js +3 -0
  69. package/dist/lib/util/MdxComponents.js.map +1 -1
  70. package/dist/vite/config.d.ts +2 -5
  71. package/dist/vite/config.js +21 -28
  72. package/dist/vite/config.js.map +1 -1
  73. package/dist/vite/config.test.js +1 -1
  74. package/dist/vite/config.test.js.map +1 -1
  75. package/dist/vite/css/plugin.d.ts +2 -2
  76. package/dist/vite/css/plugin.js.map +1 -1
  77. package/dist/vite/dev-server.js.map +1 -1
  78. package/dist/vite/plugin-api-keys.d.ts +2 -2
  79. package/dist/vite/plugin-api-keys.js +3 -3
  80. package/dist/vite/plugin-api-keys.js.map +1 -1
  81. package/dist/vite/plugin-api.d.ts +2 -2
  82. package/dist/vite/plugin-api.js +5 -5
  83. package/dist/vite/plugin-api.js.map +1 -1
  84. package/dist/vite/plugin-auth.d.ts +2 -2
  85. package/dist/vite/plugin-auth.js +3 -3
  86. package/dist/vite/plugin-auth.js.map +1 -1
  87. package/dist/vite/plugin-component.d.ts +2 -2
  88. package/dist/vite/plugin-component.js +3 -2
  89. package/dist/vite/plugin-component.js.map +1 -1
  90. package/dist/vite/plugin-config-reload.d.ts +4 -3
  91. package/dist/vite/plugin-config-reload.js +11 -8
  92. package/dist/vite/plugin-config-reload.js.map +1 -1
  93. package/dist/vite/plugin-config.d.ts +2 -2
  94. package/dist/vite/plugin-config.js +2 -2
  95. package/dist/vite/plugin-config.js.map +1 -1
  96. package/dist/vite/plugin-custom-pages.d.ts +2 -2
  97. package/dist/vite/plugin-custom-pages.js +3 -3
  98. package/dist/vite/plugin-custom-pages.js.map +1 -1
  99. package/dist/vite/plugin-docs.d.ts +2 -2
  100. package/dist/vite/plugin-docs.js +5 -5
  101. package/dist/vite/plugin-docs.js.map +1 -1
  102. package/dist/vite/plugin-frontmatter.d.ts +2 -2
  103. package/dist/vite/plugin-frontmatter.js +5 -4
  104. package/dist/vite/plugin-frontmatter.js.map +1 -1
  105. package/dist/vite/plugin-mdx.d.ts +2 -2
  106. package/dist/vite/plugin-mdx.js +1 -1
  107. package/dist/vite/plugin-mdx.js.map +1 -1
  108. package/dist/vite/plugin-redirect.d.ts +2 -2
  109. package/dist/vite/plugin-redirect.js +3 -3
  110. package/dist/vite/plugin-redirect.js.map +1 -1
  111. package/dist/vite/plugin-search.d.ts +2 -2
  112. package/dist/vite/plugin-search.js +1 -1
  113. package/dist/vite/plugin-search.js.map +1 -1
  114. package/dist/vite/plugin-sidebar.d.ts +2 -2
  115. package/dist/vite/plugin-sidebar.js +2 -2
  116. package/dist/vite/plugin-sidebar.js.map +1 -1
  117. package/dist/vite/plugin-theme-css.d.ts +2 -2
  118. package/dist/vite/plugin-theme-css.js.map +1 -1
  119. package/dist/vite/plugin.d.ts +2 -2
  120. package/dist/vite/plugin.js.map +1 -1
  121. package/dist/vite/prerender/FileWritingResponse.d.ts +2 -1
  122. package/dist/vite/prerender/FileWritingResponse.js +4 -1
  123. package/dist/vite/prerender/FileWritingResponse.js.map +1 -1
  124. package/dist/vite/prerender/worker.d.ts +1 -1
  125. package/dist/vite/prerender/worker.js +3 -0
  126. package/dist/vite/prerender/worker.js.map +1 -1
  127. package/lib/{AuthenticationPlugin-BlxA4Mbn.js → AuthenticationPlugin-CiO1FM6Q.js} +2 -2
  128. package/lib/{AuthenticationPlugin-BlxA4Mbn.js.map → AuthenticationPlugin-CiO1FM6Q.js.map} +1 -1
  129. package/lib/Dialog-DIKGQxQc.js +83 -0
  130. package/lib/Dialog-DIKGQxQc.js.map +1 -0
  131. package/lib/{Markdown-Cr9sYpR_.js → Markdown-DePfm7oQ.js} +1384 -1381
  132. package/lib/{Markdown-Cr9sYpR_.js.map → Markdown-DePfm7oQ.js.map} +1 -1
  133. package/lib/{MdxPage-Dt-UEQl8.js → MdxPage-DZTt9ld7.js} +4 -4
  134. package/lib/{MdxPage-Dt-UEQl8.js.map → MdxPage-DZTt9ld7.js.map} +1 -1
  135. package/lib/{OasProvider-WVtvHP5H.js → OasProvider-SzD9mHJc.js} +3 -3
  136. package/lib/{OasProvider-WVtvHP5H.js.map → OasProvider-SzD9mHJc.js.map} +1 -1
  137. package/lib/{OperationList-DhOwupvv.js → OperationList-DDs9NblY.js} +242 -241
  138. package/lib/OperationList-DDs9NblY.js.map +1 -0
  139. package/lib/{Select-D9hI1G-y.js → Select-Dqtcn53H.js} +36 -36
  140. package/lib/{Select-D9hI1G-y.js.map → Select-Dqtcn53H.js.map} +1 -1
  141. package/lib/{SlotletProvider-CEfNOA8i.js → SlotletProvider-DdtIOUi6.js} +2 -2
  142. package/lib/{SlotletProvider-CEfNOA8i.js.map → SlotletProvider-DdtIOUi6.js.map} +1 -1
  143. package/lib/{createServer-DMf6O2Rz.js → createServer-DmusVVsi.js} +987 -967
  144. package/lib/createServer-DmusVVsi.js.map +1 -0
  145. package/lib/{hook-CWwSAAlH.js → hook-CN__aZIt.js} +67 -63
  146. package/lib/{hook-CWwSAAlH.js.map → hook-CN__aZIt.js.map} +1 -1
  147. package/lib/{index-Do_30Hpk.js → index-CibzSNks.js} +95 -93
  148. package/lib/{index-Do_30Hpk.js.map → index-CibzSNks.js.map} +1 -1
  149. package/lib/index-DwT-v3zK.js +86 -0
  150. package/lib/index-DwT-v3zK.js.map +1 -0
  151. package/lib/index-gQD2h1wX.js +447 -0
  152. package/lib/index-gQD2h1wX.js.map +1 -0
  153. package/lib/{mutation-B0wxqzSN.js → mutation-EclmI0is.js} +2 -2
  154. package/lib/{mutation-B0wxqzSN.js.map → mutation-EclmI0is.js.map} +1 -1
  155. package/lib/objectEntries-yMIkr2mI.js +5 -0
  156. package/lib/objectEntries-yMIkr2mI.js.map +1 -0
  157. package/lib/ui/Command.js +21 -20
  158. package/lib/ui/Command.js.map +1 -1
  159. package/lib/ui/Stepper.js +6 -0
  160. package/lib/ui/Stepper.js.map +1 -0
  161. package/lib/ui/SyntaxHighlight.js +2902 -7
  162. package/lib/ui/SyntaxHighlight.js.map +1 -1
  163. package/lib/{useScrollToAnchor-C-sRxs9o.js → useScrollToAnchor-C7ilRSts.js} +3 -3
  164. package/lib/{useScrollToAnchor-C-sRxs9o.js.map → useScrollToAnchor-C7ilRSts.js.map} +1 -1
  165. package/lib/zudoku.auth-auth0.js +15 -14
  166. package/lib/zudoku.auth-auth0.js.map +1 -1
  167. package/lib/zudoku.auth-clerk.js +2 -2
  168. package/lib/zudoku.auth-openid.js +126 -124
  169. package/lib/zudoku.auth-openid.js.map +1 -1
  170. package/lib/zudoku.components.js +441 -395
  171. package/lib/zudoku.components.js.map +1 -1
  172. package/lib/zudoku.css +1 -0
  173. package/lib/zudoku.hooks.js +19 -0
  174. package/lib/zudoku.hooks.js.map +1 -0
  175. package/lib/zudoku.plugin-api-catalog.js +2 -2
  176. package/lib/zudoku.plugin-api-keys.js +5 -5
  177. package/lib/zudoku.plugin-custom-pages.js +1 -1
  178. package/lib/zudoku.plugin-markdown.js +1 -1
  179. package/lib/zudoku.plugin-openapi.js +2 -2
  180. package/lib/zudoku.plugins.js +9 -8
  181. package/lib/zudoku.plugins.js.map +1 -1
  182. package/package.json +12 -4
  183. package/src/app/main.tsx +1 -1
  184. package/src/lib/authentication/providers/auth0.tsx +3 -2
  185. package/src/lib/authentication/providers/openid.tsx +8 -5
  186. package/src/lib/authentication/state.ts +8 -2
  187. package/src/lib/components/ThemeSwitch.tsx +1 -1
  188. package/src/lib/components/Zudoku.tsx +9 -5
  189. package/src/lib/components/context/RouterEventsEmitter.tsx +19 -0
  190. package/src/lib/core/RouteGuard.tsx +43 -18
  191. package/src/lib/core/ZudokuContext.ts +31 -0
  192. package/src/lib/core/plugins.ts +16 -2
  193. package/src/lib/hooks/index.ts +5 -0
  194. package/src/lib/hooks/useEvent.test.tsx +149 -0
  195. package/src/lib/hooks/useEvent.ts +41 -0
  196. package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
  197. package/src/lib/ui/Stepper.css +43 -0
  198. package/src/lib/ui/Stepper.tsx +8 -0
  199. package/src/lib/util/MdxComponents.tsx +4 -1
  200. package/lib/OperationList-DhOwupvv.js.map +0 -1
  201. package/lib/SyntaxHighlight-CcnUjERD.js +0 -2986
  202. package/lib/SyntaxHighlight-CcnUjERD.js.map +0 -1
  203. package/lib/createServer-DMf6O2Rz.js.map +0 -1
  204. package/lib/index-Du5aNddU.js +0 -509
  205. package/lib/index-Du5aNddU.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  var Ue = Object.defineProperty;
2
2
  var Le = (t, e, n) => e in t ? Ue(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var b = (t, e, n) => Le(t, typeof e != "symbol" ? e + "" : e, n);
3
+ var _ = (t, e, n) => Le(t, typeof e != "symbol" ? e + "" : e, n);
4
4
  import { j as q } from "./jsx-runtime-CYK1ROHF.js";
5
5
  import { g as xe } from "./_commonjsHelpers-BkfeUUK-.js";
6
6
  import { C as Ce } from "./ClientOnly-E7hGysn1.js";
7
7
  import { j as oe } from "./joinUrl-10po2Jdj.js";
8
- import { A as Ie } from "./AuthenticationPlugin-BlxA4Mbn.js";
9
- import { a as je, u as L } from "./hook-CWwSAAlH.js";
8
+ import { A as je } from "./AuthenticationPlugin-CiO1FM6Q.js";
9
+ import { b as Ie, u as L } from "./hook-CN__aZIt.js";
10
10
  import { N as Je } from "./chunk-IR6S3I6Y-D_3UmFIn.js";
11
11
  import { Z as Oe } from "./invariant-Caa8-XvF.js";
12
12
  var D = { exports: {} }, ze = D.exports, ie;
@@ -23,8 +23,8 @@ function De() {
23
23
  "warn",
24
24
  "error"
25
25
  ], r = {}, i = null;
26
- function c(l, m) {
27
- var u = l[m];
26
+ function c(l, g) {
27
+ var u = l[g];
28
28
  if (typeof u.bind == "function")
29
29
  return u.bind(l);
30
30
  try {
@@ -35,41 +35,41 @@ function De() {
35
35
  };
36
36
  }
37
37
  }
38
- function h() {
38
+ function f() {
39
39
  console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
40
40
  }
41
- function _(l) {
42
- return l === "debug" && (l = "log"), typeof console === n ? !1 : l === "trace" && o ? h : console[l] !== void 0 ? c(console, l) : console.log !== void 0 ? c(console, "log") : e;
41
+ function w(l) {
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;
43
43
  }
44
44
  function p() {
45
- for (var l = this.getLevel(), m = 0; m < a.length; m++) {
46
- var u = a[m];
47
- this[u] = m < l ? e : this.methodFactory(u, l, this.name);
45
+ for (var l = this.getLevel(), g = 0; g < a.length; g++) {
46
+ var u = a[g];
47
+ this[u] = g < l ? e : this.methodFactory(u, l, this.name);
48
48
  }
49
49
  if (this.log = this.debug, typeof console === n && l < this.levels.SILENT)
50
50
  return "No console available for logging";
51
51
  }
52
- function y(l) {
52
+ function b(l) {
53
53
  return function() {
54
54
  typeof console !== n && (p.call(this), this[l].apply(this, arguments));
55
55
  };
56
56
  }
57
- function T(l, m, u) {
58
- return _(l) || y.apply(this, arguments);
57
+ function T(l, g, u) {
58
+ return w(l) || b.apply(this, arguments);
59
59
  }
60
- function f(l, m) {
60
+ function h(l, g) {
61
61
  var u = this, J, $, R, v = "loglevel";
62
62
  typeof l == "string" ? v += ":" + l : typeof l == "symbol" && (v = void 0);
63
63
  function Ee(d) {
64
- var g = (a[d] || "silent").toUpperCase();
64
+ var y = (a[d] || "silent").toUpperCase();
65
65
  if (!(typeof window === n || !v)) {
66
66
  try {
67
- window.localStorage[v] = g;
67
+ window.localStorage[v] = y;
68
68
  return;
69
69
  } catch {
70
70
  }
71
71
  try {
72
- window.document.cookie = encodeURIComponent(v) + "=" + g + ";";
72
+ window.document.cookie = encodeURIComponent(v) + "=" + y + ";";
73
73
  } catch {
74
74
  }
75
75
  }
@@ -83,9 +83,9 @@ function De() {
83
83
  }
84
84
  if (typeof d === n)
85
85
  try {
86
- var g = window.document.cookie, O = encodeURIComponent(v), re = g.indexOf(O + "=");
86
+ var y = window.document.cookie, O = encodeURIComponent(v), re = y.indexOf(O + "=");
87
87
  re !== -1 && (d = /^([^;]+)/.exec(
88
- g.slice(re + O.length + 1)
88
+ y.slice(re + O.length + 1)
89
89
  )[1]);
90
90
  } catch {
91
91
  }
@@ -105,9 +105,9 @@ function De() {
105
105
  }
106
106
  }
107
107
  function U(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;
108
+ var y = d;
109
+ if (typeof y == "string" && u.levels[y.toUpperCase()] !== void 0 && (y = u.levels[y.toUpperCase()]), typeof y == "number" && y >= 0 && y <= u.levels.SILENT)
110
+ return y;
111
111
  throw new TypeError("log.setLevel() called with invalid level: " + d);
112
112
  }
113
113
  u.name = l, u.levels = {
@@ -117,10 +117,10 @@ function De() {
117
117
  WARN: 3,
118
118
  ERROR: 4,
119
119
  SILENT: 5
120
- }, u.methodFactory = m || T, u.getLevel = function() {
120
+ }, u.methodFactory = g || T, u.getLevel = function() {
121
121
  return R ?? $ ?? J;
122
- }, u.setLevel = function(d, g) {
123
- return R = U(d), g !== !1 && Ee(R), p.call(u);
122
+ }, u.setLevel = function(d, y) {
123
+ return R = U(d), y !== !1 && Ee(R), p.call(u);
124
124
  }, u.setDefaultLevel = function(d) {
125
125
  $ = U(d), te() || u.setLevel(d, !1);
126
126
  }, u.resetLevel = function() {
@@ -139,18 +139,18 @@ function De() {
139
139
  var ne = te();
140
140
  ne != null && (R = U(ne)), p.call(u);
141
141
  }
142
- i = new f(), i.getLogger = function(m) {
143
- if (typeof m != "symbol" && typeof m != "string" || m === "")
142
+ i = new h(), i.getLogger = function(g) {
143
+ if (typeof g != "symbol" && typeof g != "string" || g === "")
144
144
  throw new TypeError("You must supply a name when creating a logger.");
145
- var u = r[m];
146
- return u || (u = r[m] = new f(
147
- m,
145
+ var u = r[g];
146
+ return u || (u = r[g] = new h(
147
+ g,
148
148
  i.methodFactory
149
149
  )), u;
150
150
  };
151
- var j = typeof window !== n ? window.log : void 0;
151
+ var I = typeof window !== n ? window.log : void 0;
152
152
  return i.noConflict = function() {
153
- return typeof window !== n && window.log === i && (window.log = j), i;
153
+ return typeof window !== n && window.log === i && (window.log = I), i;
154
154
  }, i.getLoggers = function() {
155
155
  return r;
156
156
  }, i.default = i, i;
@@ -292,7 +292,7 @@ async function Xe(t, e) {
292
292
  signal: null
293
293
  }).then(Y);
294
294
  }
295
- function w(t) {
295
+ function m(t) {
296
296
  return typeof t == "string" && t.length !== 0;
297
297
  }
298
298
  async function et(t, e) {
@@ -311,7 +311,7 @@ async function et(t, e) {
311
311
  }
312
312
  if (!x(n))
313
313
  throw new s('"response" body must be a top level object');
314
- if (!w(n.issuer))
314
+ if (!m(n.issuer))
315
315
  throw new s('"response" body "issuer" property must be a non-empty string');
316
316
  if (new URL(n.issuer).href !== t.href)
317
317
  throw new s('"response" body "issuer" does not match "expectedIssuer"');
@@ -327,7 +327,7 @@ function nt() {
327
327
  return Q();
328
328
  }
329
329
  async function rt(t) {
330
- if (!w(t))
330
+ if (!m(t))
331
331
  throw new TypeError('"codeVerifier" must be a non-empty string');
332
332
  return k(await crypto.subtle.digest("SHA-256", E(t)));
333
333
  }
@@ -403,19 +403,19 @@ function X() {
403
403
  function C(t) {
404
404
  if (typeof t != "object" || t === null)
405
405
  throw new TypeError('"as" must be an object');
406
- if (!w(t.issuer))
406
+ if (!m(t.issuer))
407
407
  throw new TypeError('"as.issuer" property must be a non-empty string');
408
408
  return !0;
409
409
  }
410
- function I(t) {
410
+ function j(t) {
411
411
  if (typeof t != "object" || t === null)
412
412
  throw new TypeError('"client" must be an object');
413
- if (!w(t.client_id))
413
+ if (!m(t.client_id))
414
414
  throw new TypeError('"client.client_id" property must be a non-empty string');
415
415
  return !0;
416
416
  }
417
417
  function ue(t) {
418
- if (!w(t))
418
+ if (!m(t))
419
419
  throw new TypeError('"client.client_secret" property must be a non-empty string');
420
420
  return t;
421
421
  }
@@ -454,28 +454,28 @@ async function lt(t, e, n) {
454
454
  }
455
455
  async function dt(t, e, n, o, a, r) {
456
456
  var T;
457
- const { privateKey: i, publicKey: c, nonce: h = we.get(n.origin) } = e;
457
+ const { privateKey: i, publicKey: c, nonce: f = we.get(n.origin) } = e;
458
458
  if (!Ze(i))
459
459
  throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
460
460
  if (!Ye(c))
461
461
  throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
462
- if (h !== void 0 && !w(h))
462
+ if (f !== void 0 && !m(f))
463
463
  throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
464
464
  if (!c.extractable)
465
465
  throw new TypeError('"DPoP.publicKey.extractable" must be true');
466
- const _ = X() + a, p = {
466
+ const w = X() + a, p = {
467
467
  alg: ct(i),
468
468
  typ: "dpop+jwt",
469
469
  jwk: await ft(c)
470
- }, y = {
471
- iat: _,
470
+ }, b = {
471
+ iat: w,
472
472
  jti: Q(),
473
473
  htm: o,
474
- nonce: h,
474
+ nonce: f,
475
475
  htu: `${n.origin}${n.pathname}`,
476
476
  ath: r ? k(await crypto.subtle.digest("SHA-256", E(r))) : void 0
477
477
  };
478
- (T = e[Ke]) == null || T.call(e, p, y), t.set("dpop", await lt(p, y, i));
478
+ (T = e[Ke]) == null || T.call(e, p, b), t.set("dpop", await lt(p, b, i));
479
479
  }
480
480
  let N;
481
481
  async function ht(t) {
@@ -501,7 +501,7 @@ function V(t) {
501
501
  return typeof e != "object" || Array.isArray(e) || e === null ? !1 : e.error !== void 0;
502
502
  }
503
503
  async function pt(t, e, n, o, a, r) {
504
- if (!w(t))
504
+ if (!m(t))
505
505
  throw new TypeError('"accessToken" must be a non-empty string');
506
506
  if (!(n instanceof URL))
507
507
  throw new TypeError('"url" must be an instance of URL');
@@ -514,7 +514,7 @@ async function pt(t, e, n, o, a, r) {
514
514
  }).then(Y);
515
515
  }
516
516
  async function wt(t, e, n, o) {
517
- C(t), I(e);
517
+ C(t), j(e);
518
518
  const a = ye(t, "userinfo_endpoint", be(e, o)), r = K(o == null ? void 0 : o.headers);
519
519
  return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), pt(n, "GET", a, r, null, {
520
520
  ...o,
@@ -537,7 +537,7 @@ async function _e(t, e, n, o, a) {
537
537
  return i.set("accept", "application/json"), mt(t, e, "POST", r, o, i, a);
538
538
  }
539
539
  async function gt(t, e, n, o) {
540
- if (C(t), I(e), !w(n))
540
+ if (C(t), j(e), !m(n))
541
541
  throw new TypeError('"refreshToken" must be a non-empty string');
542
542
  const a = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
543
543
  return a.set("refresh_token", n), _e(t, e, "refresh_token", a, o);
@@ -552,7 +552,7 @@ function yt(t) {
552
552
  return e[0];
553
553
  }
554
554
  async function Se(t, e, n, o = !1, a = !1) {
555
- if (C(t), I(e), !G(n, Response))
555
+ if (C(t), j(e), !G(n, Response))
556
556
  throw new TypeError('"response" must be an instance of Response');
557
557
  if (n.status !== 200) {
558
558
  let i;
@@ -569,20 +569,20 @@ async function Se(t, e, n, o = !1, a = !1) {
569
569
  }
570
570
  if (!x(r))
571
571
  throw new s('"response" body must be a top level object');
572
- if (!w(r.access_token))
572
+ if (!m(r.access_token))
573
573
  throw new s('"response" body "access_token" property must be a non-empty string');
574
- if (!w(r.token_type))
574
+ if (!m(r.token_type))
575
575
  throw new s('"response" body "token_type" property must be a non-empty string');
576
576
  if (r.token_type = r.token_type.toLowerCase(), r.token_type !== "dpop" && r.token_type !== "bearer")
577
577
  throw new S("unsupported `token_type` value");
578
578
  if (r.expires_in !== void 0 && (typeof r.expires_in != "number" || r.expires_in <= 0))
579
579
  throw new s('"response" body "expires_in" property must be a positive number');
580
- if (!a && r.refresh_token !== void 0 && !w(r.refresh_token))
580
+ if (!a && r.refresh_token !== void 0 && !m(r.refresh_token))
581
581
  throw new s('"response" body "refresh_token" property must be a non-empty string');
582
582
  if (r.scope !== void 0 && typeof r.scope != "string")
583
583
  throw new s('"response" body "scope" property must be a string');
584
584
  if (!o) {
585
- if (r.id_token !== void 0 && !w(r.id_token))
585
+ if (r.id_token !== void 0 && !m(r.id_token))
586
586
  throw new s('"response" body "id_token" property must be a non-empty string');
587
587
  if (r.id_token) {
588
588
  const { claims: i, jwt: c } = await xt(r.id_token, Ct.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), ke, H(e), ge(e), e[He]).then(kt.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(vt.bind(void 0, t.issuer)).then(_t.bind(void 0, e.client_id));
@@ -620,11 +620,11 @@ function St(t) {
620
620
  return Te.add(t), t;
621
621
  }
622
622
  async function Tt(t, e, n, o, a, r) {
623
- if (C(t), I(e), !Te.has(n))
623
+ if (C(t), j(e), !Te.has(n))
624
624
  throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
625
- if (!w(o))
625
+ if (!m(o))
626
626
  throw new TypeError('"redirectUri" must be a non-empty string');
627
- if (!w(a))
627
+ if (!m(a))
628
628
  throw new TypeError('"codeVerifier" must be a non-empty string');
629
629
  const i = A(n, "code");
630
630
  if (!i)
@@ -659,7 +659,7 @@ async function Rt(t, e, n, o, a) {
659
659
  const r = await Se(t, e, n);
660
660
  if (V(r))
661
661
  return r;
662
- if (!w(r.id_token))
662
+ if (!m(r.id_token))
663
663
  throw new s('"response" body "id_token" property must be a non-empty string');
664
664
  a ?? (a = e.default_max_age ?? F);
665
665
  const i = yt(r);
@@ -668,8 +668,8 @@ async function Rt(t, e, n, o, a) {
668
668
  if (a !== F) {
669
669
  if (typeof a != "number" || a < 0)
670
670
  throw new TypeError('"maxAge" must be a non-negative number');
671
- const c = X() + H(e), h = ge(e);
672
- if (i.auth_time + a < c - h)
671
+ const c = X() + H(e), f = ge(e);
672
+ if (i.auth_time + a < c - f)
673
673
  throw new s("too much time has elapsed since the last End-User authentication");
674
674
  }
675
675
  switch (o) {
@@ -679,7 +679,7 @@ async function Rt(t, e, n, o, a) {
679
679
  throw new s('unexpected ID Token "nonce" claim value');
680
680
  break;
681
681
  default:
682
- if (!w(o))
682
+ if (!m(o))
683
683
  throw new TypeError('"expectedNonce" must be a non-empty string');
684
684
  if (i.nonce === void 0)
685
685
  throw new s('ID Token "nonce" claim missing');
@@ -753,13 +753,13 @@ async function Lt(t, e, n, o) {
753
753
  throw new s("JWT signature verification failed");
754
754
  }
755
755
  async function xt(t, e, n, o, a, r) {
756
- let { 0: i, 1: c, 2: h, length: _ } = t.split(".");
757
- if (_ === 5)
756
+ let { 0: i, 1: c, 2: f, length: w } = t.split(".");
757
+ if (w === 5)
758
758
  if (r !== void 0)
759
- t = await r(t), { 0: i, 1: c, 2: h, length: _ } = t.split(".");
759
+ t = await r(t), { 0: i, 1: c, 2: f, length: w } = t.split(".");
760
760
  else
761
761
  throw new S("JWE structure JWTs are not supported");
762
- if (_ !== 3)
762
+ if (w !== 3)
763
763
  throw new s("Invalid JWT");
764
764
  let p;
765
765
  try {
@@ -771,37 +771,37 @@ async function xt(t, e, n, o, a, r) {
771
771
  throw new s("JWT Header must be a top level object");
772
772
  if (e(p), p.crit !== void 0)
773
773
  throw new s('unexpected JWT "crit" header parameter');
774
- const y = k(h);
774
+ const b = k(f);
775
775
  let T;
776
- n !== ke && (T = await n(p), await Lt(i, c, T, y));
777
- let f;
776
+ n !== ke && (T = await n(p), await Lt(i, c, T, b));
777
+ let h;
778
778
  try {
779
- f = JSON.parse(E(k(c)));
779
+ h = JSON.parse(E(k(c)));
780
780
  } catch (l) {
781
781
  throw new s("failed to parse JWT Payload body as base64url encoded JSON", { cause: l });
782
782
  }
783
- if (!x(f))
783
+ if (!x(h))
784
784
  throw new s("JWT Payload must be a top level object");
785
- const j = X() + o;
786
- if (f.exp !== void 0) {
787
- if (typeof f.exp != "number")
785
+ const I = X() + o;
786
+ if (h.exp !== void 0) {
787
+ if (typeof h.exp != "number")
788
788
  throw new s('unexpected JWT "exp" (expiration time) claim type');
789
- if (f.exp <= j - a)
789
+ if (h.exp <= I - a)
790
790
  throw new s('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
791
791
  }
792
- if (f.iat !== void 0 && typeof f.iat != "number")
792
+ if (h.iat !== void 0 && typeof h.iat != "number")
793
793
  throw new s('unexpected JWT "iat" (issued at) claim type');
794
- if (f.iss !== void 0 && typeof f.iss != "string")
794
+ if (h.iss !== void 0 && typeof h.iss != "string")
795
795
  throw new s('unexpected JWT "iss" (issuer) claim type');
796
- if (f.nbf !== void 0) {
797
- if (typeof f.nbf != "number")
796
+ if (h.nbf !== void 0) {
797
+ if (typeof h.nbf != "number")
798
798
  throw new s('unexpected JWT "nbf" (not before) claim type');
799
- if (f.nbf > j + a)
799
+ if (h.nbf > I + a)
800
800
  throw new s('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
801
801
  }
802
- if (f.aud !== void 0 && typeof f.aud != "string" && !Array.isArray(f.aud))
802
+ if (h.aud !== void 0 && typeof h.aud != "string" && !Array.isArray(h.aud))
803
803
  throw new s('unexpected JWT "aud" (audience) claim type');
804
- return { header: p, claims: f, signature: y, key: T, jwt: t };
804
+ return { header: p, claims: h, signature: b, key: T, jwt: t };
805
805
  }
806
806
  function Ct(t, e, n) {
807
807
  if (t !== void 0) {
@@ -823,9 +823,9 @@ function A(t, e) {
823
823
  throw new s(`"${e}" parameter must be provided only once`);
824
824
  return n;
825
825
  }
826
- const It = Symbol(), jt = Symbol();
826
+ const jt = Symbol(), It = Symbol();
827
827
  function Jt(t, e, n, o) {
828
- if (C(t), I(e), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
828
+ if (C(t), j(e), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
829
829
  throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
830
830
  if (A(n, "response"))
831
831
  throw new s('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
@@ -836,14 +836,14 @@ function Jt(t, e, n, o) {
836
836
  throw new s('unexpected "iss" (issuer) response parameter value');
837
837
  switch (o) {
838
838
  case void 0:
839
- case jt:
839
+ case It:
840
840
  if (r !== void 0)
841
841
  throw new s('unexpected "state" response parameter encountered');
842
842
  break;
843
- case It:
843
+ case jt:
844
844
  break;
845
845
  default:
846
- if (!w(o))
846
+ if (!m(o))
847
847
  throw new s('"expectedState" must be a non-empty string');
848
848
  if (r === void 0)
849
849
  throw new s('response parameter "state" missing');
@@ -857,15 +857,15 @@ function Jt(t, e, n, o) {
857
857
  error_description: A(n, "error_description"),
858
858
  error_uri: A(n, "error_uri")
859
859
  };
860
- const c = A(n, "id_token"), h = A(n, "token");
861
- if (c !== void 0 || h !== void 0)
860
+ const c = A(n, "id_token"), f = A(n, "token");
861
+ if (c !== void 0 || f !== void 0)
862
862
  throw new S("implicit and hybrid flows are not supported");
863
863
  return St(new URLSearchParams(n));
864
864
  }
865
865
  function Ot({
866
866
  handleCallback: t
867
867
  }) {
868
- const e = je({
868
+ const e = Ie({
869
869
  retry: !1,
870
870
  queryKey: ["oauth-callback"],
871
871
  queryFn: async () => {
@@ -890,7 +890,7 @@ class fe extends P {
890
890
  }
891
891
  }
892
892
  const M = "code-verifier";
893
- class zt extends Ie {
893
+ class zt extends je {
894
894
  constructor(e, n) {
895
895
  super(), this.callbackUrlPath = e, this.handleCallback = n;
896
896
  }
@@ -912,19 +912,21 @@ class Dt {
912
912
  redirectToAfterSignUp: a,
913
913
  redirectToAfterSignIn: r,
914
914
  redirectToAfterSignOut: i,
915
- basePath: c
915
+ basePath: c,
916
+ scopes: f
916
917
  }) {
917
- b(this, "client");
918
- b(this, "issuer");
919
- b(this, "authorizationServer");
920
- b(this, "callbackUrlPath");
921
- b(this, "logoutRedirectUrlPath");
922
- b(this, "onAuthorizationUrl");
923
- b(this, "redirectToAfterSignUp");
924
- b(this, "redirectToAfterSignIn");
925
- b(this, "redirectToAfterSignOut");
926
- b(this, "audience");
927
- b(this, "signOut", async () => {
918
+ _(this, "client");
919
+ _(this, "issuer");
920
+ _(this, "authorizationServer");
921
+ _(this, "callbackUrlPath");
922
+ _(this, "logoutRedirectUrlPath");
923
+ _(this, "onAuthorizationUrl");
924
+ _(this, "redirectToAfterSignUp");
925
+ _(this, "redirectToAfterSignIn");
926
+ _(this, "redirectToAfterSignOut");
927
+ _(this, "audience");
928
+ _(this, "scopes");
929
+ _(this, "signOut", async () => {
928
930
  L.setState({
929
931
  isAuthenticated: !1,
930
932
  isPending: !1,
@@ -941,7 +943,7 @@ class Dt {
941
943
  n.toString()
942
944
  )) : o = n;
943
945
  });
944
- b(this, "handleCallback", async () => {
946
+ _(this, "handleCallback", async () => {
945
947
  const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(M);
946
948
  if (sessionStorage.removeItem(M), !o)
947
949
  throw new P("No code verifier found in state.");
@@ -964,37 +966,37 @@ class Dt {
964
966
  r,
965
967
  i.toString(),
966
968
  o
967
- ), h = await Rt(
969
+ ), f = await Rt(
968
970
  a,
969
971
  this.client,
970
972
  c
971
973
  );
972
- this.setTokensFromResponse(h);
973
- const _ = await this.getAccessToken(), y = await (await wt(
974
+ this.setTokensFromResponse(f);
975
+ const w = await this.getAccessToken(), b = await (await wt(
974
976
  a,
975
977
  this.client,
976
- _
978
+ w
977
979
  )).json(), T = {
978
- sub: y.sub,
979
- email: y.email,
980
- name: y.name,
981
- emailVerified: y.email_verified ?? !1,
982
- pictureUrl: y.picture
980
+ sub: b.sub,
981
+ email: b.email,
982
+ name: b.name,
983
+ emailVerified: b.email_verified ?? !1,
984
+ pictureUrl: b.picture
983
985
  };
984
986
  L.setState({
985
987
  isAuthenticated: !0,
986
988
  isPending: !1,
987
989
  profile: T
988
990
  });
989
- const f = sessionStorage.getItem("redirect-to") ?? "/";
990
- return sessionStorage.removeItem("redirect-to"), f;
991
+ const h = sessionStorage.getItem("redirect-to") ?? "/";
992
+ return sessionStorage.removeItem("redirect-to"), h;
991
993
  });
992
994
  this.client = {
993
995
  client_id: o,
994
996
  token_endpoint_auth_method: "none"
995
- }, this.audience = n, this.issuer = e, this.callbackUrlPath = oe(c, "/oauth/callback");
996
- const h = oe(c, "/");
997
- this.logoutRedirectUrlPath = h, this.redirectToAfterSignUp = a ?? h, this.redirectToAfterSignIn = r ?? h, this.redirectToAfterSignOut = i ?? h;
997
+ }, this.audience = n, this.issuer = e, this.callbackUrlPath = oe(c, "/oauth/callback"), this.scopes = f ?? ["openid", "profile", "email"];
998
+ const w = oe(c, "/");
999
+ this.logoutRedirectUrlPath = w, this.redirectToAfterSignUp = a ?? w, this.redirectToAfterSignIn = r ?? w, this.redirectToAfterSignOut = i ?? w;
998
1000
  }
999
1001
  async getAuthServer() {
1000
1002
  if (!this.authorizationServer) {
@@ -1041,7 +1043,7 @@ class Dt {
1041
1043
  redirectTo: e,
1042
1044
  isSignUp: n = !1
1043
1045
  }) {
1044
- var _, p;
1046
+ var w, p;
1045
1047
  const o = "S256", a = await this.getAuthServer();
1046
1048
  if (!a.authorization_endpoint)
1047
1049
  throw new P("No authorization endpoint");
@@ -1051,16 +1053,16 @@ class Dt {
1051
1053
  a.authorization_endpoint
1052
1054
  );
1053
1055
  sessionStorage.setItem("redirect-to", e);
1054
- const h = new URL(window.location.origin);
1055
- if (h.pathname = this.callbackUrlPath, h.search = "", c.searchParams.set("client_id", this.client.client_id), c.searchParams.set("redirect_uri", h.toString()), c.searchParams.set("response_type", "code"), c.searchParams.set("scope", "openid profile email"), c.searchParams.set("code_challenge", i), c.searchParams.set(
1056
+ const f = new URL(window.location.origin);
1057
+ if (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(
1056
1058
  "code_challenge_method",
1057
1059
  o
1058
- ), this.audience && c.searchParams.set("audience", this.audience), (_ = this.onAuthorizationUrl) == null || _.call(this, c, {
1060
+ ), this.audience && c.searchParams.set("audience", this.audience), (w = this.onAuthorizationUrl) == null || w.call(this, c, {
1059
1061
  isSignIn: !n,
1060
1062
  isSignUp: n
1061
1063
  }), ((p = a.code_challenge_methods_supported) == null ? void 0 : p.includes("S256")) !== !0) {
1062
- const y = nt();
1063
- c.searchParams.set("state", y);
1064
+ const b = nt();
1065
+ c.searchParams.set("state", b);
1064
1066
  }
1065
1067
  location.href = c.href;
1066
1068
  }