zudoku 0.32.0 → 0.32.2

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