@axa-fr/react-oidc 6.24.27-beta929 → 6.25.0-alpha939

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 (264) hide show
  1. package/bin/post-install.js +35 -0
  2. package/dist/FetchToken.d.ts +2 -3
  3. package/dist/FetchToken.d.ts.map +1 -1
  4. package/dist/OidcProvider.d.ts +4 -5
  5. package/dist/OidcProvider.d.ts.map +1 -1
  6. package/dist/OidcSecure.d.ts +3 -3
  7. package/dist/OidcSecure.d.ts.map +1 -1
  8. package/dist/OidcServiceWorker.js +559 -0
  9. package/{service_worker → dist}/OidcTrustedDomains.js +4 -5
  10. package/dist/ReactOidc.d.ts +4 -4
  11. package/dist/ReactOidc.d.ts.map +1 -1
  12. package/dist/User.d.ts +2 -2
  13. package/dist/User.d.ts.map +1 -1
  14. package/dist/core/default-component/AuthenticateError.component.d.ts.map +1 -1
  15. package/dist/core/default-component/Authenticating.component.d.ts.map +1 -1
  16. package/dist/core/default-component/Callback.component.d.ts.map +1 -1
  17. package/dist/core/default-component/Loading.component.d.ts.map +1 -1
  18. package/dist/core/default-component/ServiceWorkerNotSupported.component.d.ts.map +1 -1
  19. package/dist/core/default-component/SessionLost.component.d.ts.map +1 -1
  20. package/dist/core/default-component/SilentCallback.component.d.ts.map +1 -1
  21. package/dist/core/default-component/SilentLogin.component.d.ts.map +1 -1
  22. package/dist/core/default-component/index.d.ts.map +1 -1
  23. package/dist/core/routes/OidcRoutes.d.ts +1 -1
  24. package/dist/core/routes/OidcRoutes.d.ts.map +1 -1
  25. package/dist/core/routes/index.d.ts +3 -0
  26. package/dist/core/routes/index.d.ts.map +1 -0
  27. package/dist/core/routes/withRouter.d.ts +4 -4
  28. package/dist/core/routes/withRouter.d.ts.map +1 -1
  29. package/dist/index.d.ts +2 -2
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +964 -21
  32. package/dist/index.umd.cjs +27 -0
  33. package/package.json +37 -43
  34. package/src/{oidc/FetchToken.tsx → FetchToken.tsx} +14 -16
  35. package/src/{oidc/OidcProvider.tsx → OidcProvider.tsx} +40 -42
  36. package/src/{oidc/OidcSecure.tsx → OidcSecure.tsx} +1 -3
  37. package/src/{oidc/ReactOidc.tsx → ReactOidc.tsx} +1 -3
  38. package/src/{oidc/User.ts → User.ts} +1 -2
  39. package/src/{oidc/core → core}/default-component/AuthenticateError.component.tsx +0 -1
  40. package/src/{oidc/core → core}/default-component/Authenticating.component.tsx +0 -1
  41. package/src/{oidc/core → core}/default-component/Callback.component.tsx +2 -2
  42. package/src/{oidc/core → core}/default-component/Loading.component.tsx +0 -1
  43. package/src/{oidc/core → core}/default-component/ServiceWorkerNotSupported.component.tsx +0 -1
  44. package/src/{oidc/core → core}/default-component/SessionLost.component.tsx +1 -1
  45. package/src/{oidc/core → core}/default-component/SilentCallback.component.tsx +1 -2
  46. package/src/{oidc/core → core}/default-component/SilentLogin.component.tsx +1 -3
  47. package/src/{oidc/core → core}/routes/OidcRoutes.spec.tsx +3 -2
  48. package/src/{oidc/core → core}/routes/OidcRoutes.tsx +6 -6
  49. package/src/{oidc/core → core}/routes/withRouter.spec.tsx +3 -5
  50. package/src/{oidc/index.ts → index.ts} +7 -2
  51. package/bin/copy.cjs +0 -43
  52. package/dist/FetchToken.js +0 -59
  53. package/dist/FetchToken.js.map +0 -1
  54. package/dist/OidcProvider.js +0 -134
  55. package/dist/OidcProvider.js.map +0 -1
  56. package/dist/OidcSecure.js +0 -25
  57. package/dist/OidcSecure.js.map +0 -1
  58. package/dist/ReactOidc.js +0 -156
  59. package/dist/ReactOidc.js.map +0 -1
  60. package/dist/User.js +0 -42
  61. package/dist/User.js.map +0 -1
  62. package/dist/core/default-component/AuthenticateError.component.js +0 -6
  63. package/dist/core/default-component/AuthenticateError.component.js.map +0 -1
  64. package/dist/core/default-component/Authenticating.component.js +0 -6
  65. package/dist/core/default-component/Authenticating.component.js.map +0 -1
  66. package/dist/core/default-component/Callback.component.js +0 -54
  67. package/dist/core/default-component/Callback.component.js.map +0 -1
  68. package/dist/core/default-component/Loading.component.js +0 -6
  69. package/dist/core/default-component/Loading.component.js.map +0 -1
  70. package/dist/core/default-component/ServiceWorkerNotSupported.component.js +0 -6
  71. package/dist/core/default-component/ServiceWorkerNotSupported.component.js.map +0 -1
  72. package/dist/core/default-component/SessionLost.component.js +0 -8
  73. package/dist/core/default-component/SessionLost.component.js.map +0 -1
  74. package/dist/core/default-component/SilentCallback.component.js +0 -27
  75. package/dist/core/default-component/SilentCallback.component.js.map +0 -1
  76. package/dist/core/default-component/SilentLogin.component.js +0 -29
  77. package/dist/core/default-component/SilentLogin.component.js.map +0 -1
  78. package/dist/core/default-component/index.js +0 -20
  79. package/dist/core/default-component/index.js.map +0 -1
  80. package/dist/core/routes/OidcRoutes.js +0 -64
  81. package/dist/core/routes/OidcRoutes.js.map +0 -1
  82. package/dist/core/routes/withRouter.js +0 -31
  83. package/dist/core/routes/withRouter.js.map +0 -1
  84. package/dist/index.js.map +0 -1
  85. package/dist/service_worker/OidcServiceWorker.d.ts +0 -2
  86. package/dist/service_worker/OidcServiceWorker.d.ts.map +0 -1
  87. package/dist/service_worker/OidcServiceWorker.js +0 -2
  88. package/dist/service_worker/OidcServiceWorker.js.map +0 -1
  89. package/dist/service_worker/constants.d.ts +0 -18
  90. package/dist/service_worker/constants.d.ts.map +0 -1
  91. package/dist/service_worker/types.d.ts +0 -87
  92. package/dist/service_worker/types.d.ts.map +0 -1
  93. package/dist/service_worker/utils/codeVerifier.d.ts +0 -2
  94. package/dist/service_worker/utils/codeVerifier.d.ts.map +0 -1
  95. package/dist/service_worker/utils/domains.d.ts +0 -7
  96. package/dist/service_worker/utils/domains.d.ts.map +0 -1
  97. package/dist/service_worker/utils/index.d.ts +0 -6
  98. package/dist/service_worker/utils/index.d.ts.map +0 -1
  99. package/dist/service_worker/utils/serializeHeaders.d.ts +0 -3
  100. package/dist/service_worker/utils/serializeHeaders.d.ts.map +0 -1
  101. package/dist/service_worker/utils/sleep.d.ts +0 -3
  102. package/dist/service_worker/utils/sleep.d.ts.map +0 -1
  103. package/dist/service_worker/utils/strings.d.ts +0 -8
  104. package/dist/service_worker/utils/strings.d.ts.map +0 -1
  105. package/dist/service_worker/utils/tokens.d.ts +0 -22
  106. package/dist/service_worker/utils/tokens.d.ts.map +0 -1
  107. package/dist/tsconfig.tsbuildinfo +0 -1
  108. package/dist/vanilla/cache.d.ts +0 -3
  109. package/dist/vanilla/cache.d.ts.map +0 -1
  110. package/dist/vanilla/cache.js +0 -30
  111. package/dist/vanilla/cache.js.map +0 -1
  112. package/dist/vanilla/checkSession.d.ts +0 -4
  113. package/dist/vanilla/checkSession.d.ts.map +0 -1
  114. package/dist/vanilla/checkSession.js +0 -73
  115. package/dist/vanilla/checkSession.js.map +0 -1
  116. package/dist/vanilla/checkSessionIFrame.d.ts +0 -17
  117. package/dist/vanilla/checkSessionIFrame.d.ts.map +0 -1
  118. package/dist/vanilla/checkSessionIFrame.js +0 -73
  119. package/dist/vanilla/checkSessionIFrame.js.map +0 -1
  120. package/dist/vanilla/crypto.d.ts +0 -4
  121. package/dist/vanilla/crypto.d.ts.map +0 -1
  122. package/dist/vanilla/crypto.js +0 -85
  123. package/dist/vanilla/crypto.js.map +0 -1
  124. package/dist/vanilla/events.d.ts +0 -29
  125. package/dist/vanilla/events.d.ts.map +0 -1
  126. package/dist/vanilla/events.js +0 -32
  127. package/dist/vanilla/events.js.map +0 -1
  128. package/dist/vanilla/index.d.ts +0 -3
  129. package/dist/vanilla/index.d.ts.map +0 -1
  130. package/dist/vanilla/index.js +0 -6
  131. package/dist/vanilla/index.js.map +0 -1
  132. package/dist/vanilla/initSession.d.ts +0 -22
  133. package/dist/vanilla/initSession.d.ts.map +0 -1
  134. package/dist/vanilla/initSession.js +0 -90
  135. package/dist/vanilla/initSession.js.map +0 -1
  136. package/dist/vanilla/initWorker.d.ts +0 -30
  137. package/dist/vanilla/initWorker.d.ts.map +0 -1
  138. package/dist/vanilla/initWorker.js +0 -317
  139. package/dist/vanilla/initWorker.js.map +0 -1
  140. package/dist/vanilla/login.d.ts +0 -8
  141. package/dist/vanilla/login.d.ts.map +0 -1
  142. package/dist/vanilla/login.js +0 -175
  143. package/dist/vanilla/login.js.map +0 -1
  144. package/dist/vanilla/logout.d.ts +0 -8
  145. package/dist/vanilla/logout.d.ts.map +0 -1
  146. package/dist/vanilla/logout.js +0 -118
  147. package/dist/vanilla/logout.js.map +0 -1
  148. package/dist/vanilla/oidc.d.ts +0 -101
  149. package/dist/vanilla/oidc.d.ts.map +0 -1
  150. package/dist/vanilla/oidc.js +0 -612
  151. package/dist/vanilla/oidc.js.map +0 -1
  152. package/dist/vanilla/parseTokens.d.ts +0 -37
  153. package/dist/vanilla/parseTokens.d.ts.map +0 -1
  154. package/dist/vanilla/parseTokens.js +0 -167
  155. package/dist/vanilla/parseTokens.js.map +0 -1
  156. package/dist/vanilla/renewTokens.d.ts +0 -4
  157. package/dist/vanilla/renewTokens.d.ts.map +0 -1
  158. package/dist/vanilla/renewTokens.js +0 -51
  159. package/dist/vanilla/renewTokens.js.map +0 -1
  160. package/dist/vanilla/requests.d.ts +0 -33
  161. package/dist/vanilla/requests.d.ts.map +0 -1
  162. package/dist/vanilla/requests.js +0 -174
  163. package/dist/vanilla/requests.js.map +0 -1
  164. package/dist/vanilla/route-utils.d.ts +0 -13
  165. package/dist/vanilla/route-utils.d.ts.map +0 -1
  166. package/dist/vanilla/route-utils.js +0 -71
  167. package/dist/vanilla/route-utils.js.map +0 -1
  168. package/dist/vanilla/silentLogin.d.ts +0 -10
  169. package/dist/vanilla/silentLogin.d.ts.map +0 -1
  170. package/dist/vanilla/silentLogin.js +0 -144
  171. package/dist/vanilla/silentLogin.js.map +0 -1
  172. package/dist/vanilla/timer.d.ts +0 -8
  173. package/dist/vanilla/timer.d.ts.map +0 -1
  174. package/dist/vanilla/timer.js +0 -143
  175. package/dist/vanilla/timer.js.map +0 -1
  176. package/dist/vanilla/types.d.ts +0 -38
  177. package/dist/vanilla/types.d.ts.map +0 -1
  178. package/dist/vanilla/types.js +0 -3
  179. package/dist/vanilla/types.js.map +0 -1
  180. package/dist/vanilla/user.d.ts +0 -2
  181. package/dist/vanilla/user.d.ts.map +0 -1
  182. package/dist/vanilla/user.js +0 -48
  183. package/dist/vanilla/user.js.map +0 -1
  184. package/dist/vanilla/vanillaOidc.d.ts +0 -85
  185. package/dist/vanilla/vanillaOidc.d.ts.map +0 -1
  186. package/dist/vanilla/vanillaOidc.js +0 -71
  187. package/dist/vanilla/vanillaOidc.js.map +0 -1
  188. package/service_worker/.eslintrc.cjs +0 -18
  189. package/service_worker/OidcServiceWorker.ts +0 -424
  190. package/service_worker/constants.ts +0 -32
  191. package/service_worker/dist/OidcServiceWorker.d.ts +0 -2
  192. package/service_worker/dist/OidcServiceWorker.d.ts.map +0 -1
  193. package/service_worker/dist/OidcServiceWorker.js +0 -2
  194. package/service_worker/dist/OidcServiceWorker.js.map +0 -1
  195. package/service_worker/dist/constants.d.ts +0 -18
  196. package/service_worker/dist/constants.d.ts.map +0 -1
  197. package/service_worker/dist/types.d.ts +0 -87
  198. package/service_worker/dist/types.d.ts.map +0 -1
  199. package/service_worker/dist/utils/codeVerifier.d.ts +0 -2
  200. package/service_worker/dist/utils/codeVerifier.d.ts.map +0 -1
  201. package/service_worker/dist/utils/domains.d.ts +0 -7
  202. package/service_worker/dist/utils/domains.d.ts.map +0 -1
  203. package/service_worker/dist/utils/index.d.ts +0 -6
  204. package/service_worker/dist/utils/index.d.ts.map +0 -1
  205. package/service_worker/dist/utils/serializeHeaders.d.ts +0 -3
  206. package/service_worker/dist/utils/serializeHeaders.d.ts.map +0 -1
  207. package/service_worker/dist/utils/sleep.d.ts +0 -3
  208. package/service_worker/dist/utils/sleep.d.ts.map +0 -1
  209. package/service_worker/dist/utils/strings.d.ts +0 -8
  210. package/service_worker/dist/utils/strings.d.ts.map +0 -1
  211. package/service_worker/dist/utils/tokens.d.ts +0 -22
  212. package/service_worker/dist/utils/tokens.d.ts.map +0 -1
  213. package/service_worker/tsconfig.json +0 -26
  214. package/service_worker/types.ts +0 -103
  215. package/service_worker/utils/__tests__/codeVerifier.spec.ts +0 -14
  216. package/service_worker/utils/__tests__/domains.spec.ts +0 -90
  217. package/service_worker/utils/__tests__/serializeHeaders.spec.ts +0 -11
  218. package/service_worker/utils/__tests__/strings.spec.ts +0 -9
  219. package/service_worker/utils/__tests__/testHelper.ts +0 -352
  220. package/service_worker/utils/__tests__/tokens.spec.ts +0 -92
  221. package/service_worker/utils/codeVerifier.ts +0 -6
  222. package/service_worker/utils/domains.ts +0 -105
  223. package/service_worker/utils/index.ts +0 -5
  224. package/service_worker/utils/serializeHeaders.ts +0 -12
  225. package/service_worker/utils/sleep.ts +0 -2
  226. package/service_worker/utils/strings.ts +0 -9
  227. package/service_worker/utils/tokens.ts +0 -206
  228. package/src/oidc/vanilla/cache.ts +0 -27
  229. package/src/oidc/vanilla/checkSession.ts +0 -60
  230. package/src/oidc/vanilla/checkSessionIFrame.ts +0 -83
  231. package/src/oidc/vanilla/crypto.ts +0 -61
  232. package/src/oidc/vanilla/events.ts +0 -29
  233. package/src/oidc/vanilla/index.ts +0 -2
  234. package/src/oidc/vanilla/iniWorker.spec.ts +0 -21
  235. package/src/oidc/vanilla/initSession.ts +0 -90
  236. package/src/oidc/vanilla/initWorker.ts +0 -321
  237. package/src/oidc/vanilla/login.ts +0 -174
  238. package/src/oidc/vanilla/logout.spec.ts +0 -66
  239. package/src/oidc/vanilla/logout.spec.tsx +0 -64
  240. package/src/oidc/vanilla/logout.ts +0 -101
  241. package/src/oidc/vanilla/oidc.ts +0 -614
  242. package/src/oidc/vanilla/parseTokens.spec.ts +0 -49
  243. package/src/oidc/vanilla/parseTokens.ts +0 -194
  244. package/src/oidc/vanilla/renewTokens.ts +0 -37
  245. package/src/oidc/vanilla/requests.spec.ts +0 -9
  246. package/src/oidc/vanilla/requests.ts +0 -169
  247. package/src/oidc/vanilla/route-utils.spec.ts +0 -23
  248. package/src/oidc/vanilla/route-utils.ts +0 -79
  249. package/src/oidc/vanilla/silentLogin.ts +0 -144
  250. package/src/oidc/vanilla/timer.ts +0 -163
  251. package/src/oidc/vanilla/types.ts +0 -42
  252. package/src/oidc/vanilla/user.ts +0 -40
  253. package/src/oidc/vanilla/vanillaOidc.ts +0 -109
  254. package/src/override/AuthenticateError.component.tsx +0 -15
  255. package/src/override/Authenticating.component.tsx +0 -15
  256. package/src/override/Callback.component.tsx +0 -14
  257. package/src/override/Loading.component.tsx +0 -11
  258. package/src/override/ServiceWorkerNotSupported.component.tsx +0 -15
  259. package/src/override/SessionLost.component.tsx +0 -22
  260. package/src/override/style.ts +0 -12
  261. /package/src/{oidc/core → core}/default-component/index.ts +0 -0
  262. /package/src/{oidc/core → core}/routes/__snapshots__/OidcRoutes.spec.tsx.snap +0 -0
  263. /package/src/{oidc/core → core}/routes/index.ts +0 -0
  264. /package/src/{oidc/core → core}/routes/withRouter.tsx +0 -0
package/dist/index.js CHANGED
@@ -1,21 +1,964 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TokenRenewMode = exports.useOidcUser = exports.OidcUserStatus = exports.useOidcIdToken = exports.useOidcAccessToken = exports.useOidc = exports.withOidcSecure = exports.OidcSecure = exports.OidcProvider = exports.withOidcFetch = exports.useOidcFetch = void 0;
4
- var FetchToken_js_1 = require("./FetchToken.js");
5
- Object.defineProperty(exports, "useOidcFetch", { enumerable: true, get: function () { return FetchToken_js_1.useOidcFetch; } });
6
- Object.defineProperty(exports, "withOidcFetch", { enumerable: true, get: function () { return FetchToken_js_1.withOidcFetch; } });
7
- var OidcProvider_js_1 = require("./OidcProvider.js");
8
- Object.defineProperty(exports, "OidcProvider", { enumerable: true, get: function () { return OidcProvider_js_1.OidcProvider; } });
9
- var OidcSecure_js_1 = require("./OidcSecure.js");
10
- Object.defineProperty(exports, "OidcSecure", { enumerable: true, get: function () { return OidcSecure_js_1.OidcSecure; } });
11
- Object.defineProperty(exports, "withOidcSecure", { enumerable: true, get: function () { return OidcSecure_js_1.withOidcSecure; } });
12
- var ReactOidc_js_1 = require("./ReactOidc.js");
13
- Object.defineProperty(exports, "useOidc", { enumerable: true, get: function () { return ReactOidc_js_1.useOidc; } });
14
- Object.defineProperty(exports, "useOidcAccessToken", { enumerable: true, get: function () { return ReactOidc_js_1.useOidcAccessToken; } });
15
- Object.defineProperty(exports, "useOidcIdToken", { enumerable: true, get: function () { return ReactOidc_js_1.useOidcIdToken; } });
16
- var User_js_1 = require("./User.js");
17
- Object.defineProperty(exports, "OidcUserStatus", { enumerable: true, get: function () { return User_js_1.OidcUserStatus; } });
18
- Object.defineProperty(exports, "useOidcUser", { enumerable: true, get: function () { return User_js_1.useOidcUser; } });
19
- var parseTokens_js_1 = require("./vanilla/parseTokens.js");
20
- Object.defineProperty(exports, "TokenRenewMode", { enumerable: true, get: function () { return parseTokens_js_1.TokenRenewMode; } });
21
- //# sourceMappingURL=index.js.map
1
+ import be, { useCallback as kt, useState as P, useEffect as O } from "react";
2
+ import { VanillaOidc as f, getParseQueryStringFromLocation as mt, getPath as z, getFetchDefault as Et } from "@axa-fr/vanilla-oidc";
3
+ import { TokenRenewMode as rr } from "@axa-fr/vanilla-oidc";
4
+ var ye = { exports: {} }, G = {};
5
+ /**
6
+ * @license React
7
+ * react-jsx-runtime.production.min.js
8
+ *
9
+ * Copyright (c) Facebook, Inc. and its affiliates.
10
+ *
11
+ * This source code is licensed under the MIT license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ */
14
+ var Ye;
15
+ function Tt() {
16
+ if (Ye)
17
+ return G;
18
+ Ye = 1;
19
+ var o = be, s = Symbol.for("react.element"), r = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, u = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
20
+ function h(c, v, g) {
21
+ var b, m = {}, R = null, D = null;
22
+ g !== void 0 && (R = "" + g), v.key !== void 0 && (R = "" + v.key), v.ref !== void 0 && (D = v.ref);
23
+ for (b in v)
24
+ a.call(v, b) && !l.hasOwnProperty(b) && (m[b] = v[b]);
25
+ if (c && c.defaultProps)
26
+ for (b in v = c.defaultProps, v)
27
+ m[b] === void 0 && (m[b] = v[b]);
28
+ return { $$typeof: s, type: c, key: R, ref: D, props: m, _owner: u.current };
29
+ }
30
+ return G.Fragment = r, G.jsx = h, G.jsxs = h, G;
31
+ }
32
+ var H = {};
33
+ /**
34
+ * @license React
35
+ * react-jsx-runtime.development.js
36
+ *
37
+ * Copyright (c) Facebook, Inc. and its affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */
42
+ var Me;
43
+ function wt() {
44
+ return Me || (Me = 1, process.env.NODE_ENV !== "production" && function() {
45
+ var o = be, s = Symbol.for("react.element"), r = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), c = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), D = Symbol.for("react.offscreen"), K = Symbol.iterator, U = "@@iterator";
46
+ function ne(e) {
47
+ if (e === null || typeof e != "object")
48
+ return null;
49
+ var t = K && e[K] || e[U];
50
+ return typeof t == "function" ? t : null;
51
+ }
52
+ var L = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
53
+ function C(e) {
54
+ {
55
+ for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), d = 1; d < t; d++)
56
+ n[d - 1] = arguments[d];
57
+ $("error", e, n);
58
+ }
59
+ }
60
+ function $(e, t, n) {
61
+ {
62
+ var d = L.ReactDebugCurrentFrame, y = d.getStackAddendum();
63
+ y !== "" && (t += "%s", n = n.concat([y]));
64
+ var k = n.map(function(_) {
65
+ return String(_);
66
+ });
67
+ k.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, k);
68
+ }
69
+ }
70
+ var oe = !1, se = !1, ae = !1, ie = !1, W = !1, X;
71
+ X = Symbol.for("react.module.reference");
72
+ function ce(e) {
73
+ return !!(typeof e == "string" || typeof e == "function" || e === a || e === l || W || e === u || e === g || e === b || ie || e === D || oe || se || ae || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === m || e.$$typeof === h || e.$$typeof === c || e.$$typeof === v || // This needs to include all possible module reference object
74
+ // types supported by any Flight configuration anywhere since
75
+ // we don't know which Flight build this will end up being used
76
+ // with.
77
+ e.$$typeof === X || e.getModuleId !== void 0));
78
+ }
79
+ function Y(e, t, n) {
80
+ var d = e.displayName;
81
+ if (d)
82
+ return d;
83
+ var y = t.displayName || t.name || "";
84
+ return y !== "" ? n + "(" + y + ")" : n;
85
+ }
86
+ function M(e) {
87
+ return e.displayName || "Context";
88
+ }
89
+ function A(e) {
90
+ if (e == null)
91
+ return null;
92
+ if (typeof e.tag == "number" && C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
93
+ return e.displayName || e.name || null;
94
+ if (typeof e == "string")
95
+ return e;
96
+ switch (e) {
97
+ case a:
98
+ return "Fragment";
99
+ case r:
100
+ return "Portal";
101
+ case l:
102
+ return "Profiler";
103
+ case u:
104
+ return "StrictMode";
105
+ case g:
106
+ return "Suspense";
107
+ case b:
108
+ return "SuspenseList";
109
+ }
110
+ if (typeof e == "object")
111
+ switch (e.$$typeof) {
112
+ case c:
113
+ var t = e;
114
+ return M(t) + ".Consumer";
115
+ case h:
116
+ var n = e;
117
+ return M(n._context) + ".Provider";
118
+ case v:
119
+ return Y(e, e.render, "ForwardRef");
120
+ case m:
121
+ var d = e.displayName || null;
122
+ return d !== null ? d : A(e.type) || "Memo";
123
+ case R: {
124
+ var y = e, k = y._payload, _ = y._init;
125
+ try {
126
+ return A(_(k));
127
+ } catch {
128
+ return null;
129
+ }
130
+ }
131
+ }
132
+ return null;
133
+ }
134
+ var S = Object.assign, F = 0, T, N, me, Ee, Te, we, Re;
135
+ function Ce() {
136
+ }
137
+ Ce.__reactDisabledLog = !0;
138
+ function Je() {
139
+ {
140
+ if (F === 0) {
141
+ T = console.log, N = console.info, me = console.warn, Ee = console.error, Te = console.group, we = console.groupCollapsed, Re = console.groupEnd;
142
+ var e = {
143
+ configurable: !0,
144
+ enumerable: !0,
145
+ value: Ce,
146
+ writable: !0
147
+ };
148
+ Object.defineProperties(console, {
149
+ info: e,
150
+ log: e,
151
+ warn: e,
152
+ error: e,
153
+ group: e,
154
+ groupCollapsed: e,
155
+ groupEnd: e
156
+ });
157
+ }
158
+ F++;
159
+ }
160
+ }
161
+ function Ke() {
162
+ {
163
+ if (F--, F === 0) {
164
+ var e = {
165
+ configurable: !0,
166
+ enumerable: !0,
167
+ writable: !0
168
+ };
169
+ Object.defineProperties(console, {
170
+ log: S({}, e, {
171
+ value: T
172
+ }),
173
+ info: S({}, e, {
174
+ value: N
175
+ }),
176
+ warn: S({}, e, {
177
+ value: me
178
+ }),
179
+ error: S({}, e, {
180
+ value: Ee
181
+ }),
182
+ group: S({}, e, {
183
+ value: Te
184
+ }),
185
+ groupCollapsed: S({}, e, {
186
+ value: we
187
+ }),
188
+ groupEnd: S({}, e, {
189
+ value: Re
190
+ })
191
+ });
192
+ }
193
+ F < 0 && C("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
194
+ }
195
+ }
196
+ var le = L.ReactCurrentDispatcher, ue;
197
+ function Q(e, t, n) {
198
+ {
199
+ if (ue === void 0)
200
+ try {
201
+ throw Error();
202
+ } catch (y) {
203
+ var d = y.stack.trim().match(/\n( *(at )?)/);
204
+ ue = d && d[1] || "";
205
+ }
206
+ return `
207
+ ` + ue + e;
208
+ }
209
+ }
210
+ var de = !1, Z;
211
+ {
212
+ var Xe = typeof WeakMap == "function" ? WeakMap : Map;
213
+ Z = new Xe();
214
+ }
215
+ function xe(e, t) {
216
+ if (!e || de)
217
+ return "";
218
+ {
219
+ var n = Z.get(e);
220
+ if (n !== void 0)
221
+ return n;
222
+ }
223
+ var d;
224
+ de = !0;
225
+ var y = Error.prepareStackTrace;
226
+ Error.prepareStackTrace = void 0;
227
+ var k;
228
+ k = le.current, le.current = null, Je();
229
+ try {
230
+ if (t) {
231
+ var _ = function() {
232
+ throw Error();
233
+ };
234
+ if (Object.defineProperty(_.prototype, "props", {
235
+ set: function() {
236
+ throw Error();
237
+ }
238
+ }), typeof Reflect == "object" && Reflect.construct) {
239
+ try {
240
+ Reflect.construct(_, []);
241
+ } catch (I) {
242
+ d = I;
243
+ }
244
+ Reflect.construct(e, [], _);
245
+ } else {
246
+ try {
247
+ _.call();
248
+ } catch (I) {
249
+ d = I;
250
+ }
251
+ e.call(_.prototype);
252
+ }
253
+ } else {
254
+ try {
255
+ throw Error();
256
+ } catch (I) {
257
+ d = I;
258
+ }
259
+ e();
260
+ }
261
+ } catch (I) {
262
+ if (I && d && typeof I.stack == "string") {
263
+ for (var p = I.stack.split(`
264
+ `), x = d.stack.split(`
265
+ `), E = p.length - 1, w = x.length - 1; E >= 1 && w >= 0 && p[E] !== x[w]; )
266
+ w--;
267
+ for (; E >= 1 && w >= 0; E--, w--)
268
+ if (p[E] !== x[w]) {
269
+ if (E !== 1 || w !== 1)
270
+ do
271
+ if (E--, w--, w < 0 || p[E] !== x[w]) {
272
+ var j = `
273
+ ` + p[E].replace(" at new ", " at ");
274
+ return e.displayName && j.includes("<anonymous>") && (j = j.replace("<anonymous>", e.displayName)), typeof e == "function" && Z.set(e, j), j;
275
+ }
276
+ while (E >= 1 && w >= 0);
277
+ break;
278
+ }
279
+ }
280
+ } finally {
281
+ de = !1, le.current = k, Ke(), Error.prepareStackTrace = y;
282
+ }
283
+ var B = e ? e.displayName || e.name : "", $e = B ? Q(B) : "";
284
+ return typeof e == "function" && Z.set(e, $e), $e;
285
+ }
286
+ function Qe(e, t, n) {
287
+ return xe(e, !1);
288
+ }
289
+ function Ze(e) {
290
+ var t = e.prototype;
291
+ return !!(t && t.isReactComponent);
292
+ }
293
+ function ee(e, t, n) {
294
+ if (e == null)
295
+ return "";
296
+ if (typeof e == "function")
297
+ return xe(e, Ze(e));
298
+ if (typeof e == "string")
299
+ return Q(e);
300
+ switch (e) {
301
+ case g:
302
+ return Q("Suspense");
303
+ case b:
304
+ return Q("SuspenseList");
305
+ }
306
+ if (typeof e == "object")
307
+ switch (e.$$typeof) {
308
+ case v:
309
+ return Qe(e.render);
310
+ case m:
311
+ return ee(e.type, t, n);
312
+ case R: {
313
+ var d = e, y = d._payload, k = d._init;
314
+ try {
315
+ return ee(k(y), t, n);
316
+ } catch {
317
+ }
318
+ }
319
+ }
320
+ return "";
321
+ }
322
+ var te = Object.prototype.hasOwnProperty, je = {}, Oe = L.ReactDebugCurrentFrame;
323
+ function re(e) {
324
+ if (e) {
325
+ var t = e._owner, n = ee(e.type, e._source, t ? t.type : null);
326
+ Oe.setExtraStackFrame(n);
327
+ } else
328
+ Oe.setExtraStackFrame(null);
329
+ }
330
+ function et(e, t, n, d, y) {
331
+ {
332
+ var k = Function.call.bind(te);
333
+ for (var _ in e)
334
+ if (k(e, _)) {
335
+ var p = void 0;
336
+ try {
337
+ if (typeof e[_] != "function") {
338
+ var x = Error((d || "React class") + ": " + n + " type `" + _ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[_] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
339
+ throw x.name = "Invariant Violation", x;
340
+ }
341
+ p = e[_](t, _, d, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
342
+ } catch (E) {
343
+ p = E;
344
+ }
345
+ p && !(p instanceof Error) && (re(y), C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", d || "React class", n, _, typeof p), re(null)), p instanceof Error && !(p.message in je) && (je[p.message] = !0, re(y), C("Failed %s type: %s", n, p.message), re(null));
346
+ }
347
+ }
348
+ }
349
+ var tt = Array.isArray;
350
+ function fe(e) {
351
+ return tt(e);
352
+ }
353
+ function rt(e) {
354
+ {
355
+ var t = typeof Symbol == "function" && Symbol.toStringTag, n = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
356
+ return n;
357
+ }
358
+ }
359
+ function nt(e) {
360
+ try {
361
+ return Se(e), !1;
362
+ } catch {
363
+ return !0;
364
+ }
365
+ }
366
+ function Se(e) {
367
+ return "" + e;
368
+ }
369
+ function Pe(e) {
370
+ if (nt(e))
371
+ return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", rt(e)), Se(e);
372
+ }
373
+ var q = L.ReactCurrentOwner, ot = {
374
+ key: !0,
375
+ ref: !0,
376
+ __self: !0,
377
+ __source: !0
378
+ }, Ae, Fe, ve;
379
+ ve = {};
380
+ function st(e) {
381
+ if (te.call(e, "ref")) {
382
+ var t = Object.getOwnPropertyDescriptor(e, "ref").get;
383
+ if (t && t.isReactWarning)
384
+ return !1;
385
+ }
386
+ return e.ref !== void 0;
387
+ }
388
+ function at(e) {
389
+ if (te.call(e, "key")) {
390
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
391
+ if (t && t.isReactWarning)
392
+ return !1;
393
+ }
394
+ return e.key !== void 0;
395
+ }
396
+ function it(e, t) {
397
+ if (typeof e.ref == "string" && q.current && t && q.current.stateNode !== t) {
398
+ var n = A(q.current.type);
399
+ ve[n] || (C('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', A(q.current.type), e.ref), ve[n] = !0);
400
+ }
401
+ }
402
+ function ct(e, t) {
403
+ {
404
+ var n = function() {
405
+ Ae || (Ae = !0, C("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
406
+ };
407
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
408
+ get: n,
409
+ configurable: !0
410
+ });
411
+ }
412
+ }
413
+ function lt(e, t) {
414
+ {
415
+ var n = function() {
416
+ Fe || (Fe = !0, C("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
417
+ };
418
+ n.isReactWarning = !0, Object.defineProperty(e, "ref", {
419
+ get: n,
420
+ configurable: !0
421
+ });
422
+ }
423
+ }
424
+ var ut = function(e, t, n, d, y, k, _) {
425
+ var p = {
426
+ // This tag allows us to uniquely identify this as a React Element
427
+ $$typeof: s,
428
+ // Built-in properties that belong on the element
429
+ type: e,
430
+ key: t,
431
+ ref: n,
432
+ props: _,
433
+ // Record the component responsible for creating this element.
434
+ _owner: k
435
+ };
436
+ return p._store = {}, Object.defineProperty(p._store, "validated", {
437
+ configurable: !1,
438
+ enumerable: !1,
439
+ writable: !0,
440
+ value: !1
441
+ }), Object.defineProperty(p, "_self", {
442
+ configurable: !1,
443
+ enumerable: !1,
444
+ writable: !1,
445
+ value: d
446
+ }), Object.defineProperty(p, "_source", {
447
+ configurable: !1,
448
+ enumerable: !1,
449
+ writable: !1,
450
+ value: y
451
+ }), Object.freeze && (Object.freeze(p.props), Object.freeze(p)), p;
452
+ };
453
+ function dt(e, t, n, d, y) {
454
+ {
455
+ var k, _ = {}, p = null, x = null;
456
+ n !== void 0 && (Pe(n), p = "" + n), at(t) && (Pe(t.key), p = "" + t.key), st(t) && (x = t.ref, it(t, y));
457
+ for (k in t)
458
+ te.call(t, k) && !ot.hasOwnProperty(k) && (_[k] = t[k]);
459
+ if (e && e.defaultProps) {
460
+ var E = e.defaultProps;
461
+ for (k in E)
462
+ _[k] === void 0 && (_[k] = E[k]);
463
+ }
464
+ if (p || x) {
465
+ var w = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
466
+ p && ct(_, w), x && lt(_, w);
467
+ }
468
+ return ut(e, p, x, y, d, q.current, _);
469
+ }
470
+ }
471
+ var he = L.ReactCurrentOwner, Ne = L.ReactDebugCurrentFrame;
472
+ function V(e) {
473
+ if (e) {
474
+ var t = e._owner, n = ee(e.type, e._source, t ? t.type : null);
475
+ Ne.setExtraStackFrame(n);
476
+ } else
477
+ Ne.setExtraStackFrame(null);
478
+ }
479
+ var pe;
480
+ pe = !1;
481
+ function _e(e) {
482
+ return typeof e == "object" && e !== null && e.$$typeof === s;
483
+ }
484
+ function Ie() {
485
+ {
486
+ if (he.current) {
487
+ var e = A(he.current.type);
488
+ if (e)
489
+ return `
490
+
491
+ Check the render method of \`` + e + "`.";
492
+ }
493
+ return "";
494
+ }
495
+ }
496
+ function ft(e) {
497
+ {
498
+ if (e !== void 0) {
499
+ var t = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
500
+ return `
501
+
502
+ Check your code at ` + t + ":" + n + ".";
503
+ }
504
+ return "";
505
+ }
506
+ }
507
+ var De = {};
508
+ function vt(e) {
509
+ {
510
+ var t = Ie();
511
+ if (!t) {
512
+ var n = typeof e == "string" ? e : e.displayName || e.name;
513
+ n && (t = `
514
+
515
+ Check the top-level render call using <` + n + ">.");
516
+ }
517
+ return t;
518
+ }
519
+ }
520
+ function Le(e, t) {
521
+ {
522
+ if (!e._store || e._store.validated || e.key != null)
523
+ return;
524
+ e._store.validated = !0;
525
+ var n = vt(t);
526
+ if (De[n])
527
+ return;
528
+ De[n] = !0;
529
+ var d = "";
530
+ e && e._owner && e._owner !== he.current && (d = " It was passed a child from " + A(e._owner.type) + "."), V(e), C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, d), V(null);
531
+ }
532
+ }
533
+ function We(e, t) {
534
+ {
535
+ if (typeof e != "object")
536
+ return;
537
+ if (fe(e))
538
+ for (var n = 0; n < e.length; n++) {
539
+ var d = e[n];
540
+ _e(d) && Le(d, t);
541
+ }
542
+ else if (_e(e))
543
+ e._store && (e._store.validated = !0);
544
+ else if (e) {
545
+ var y = ne(e);
546
+ if (typeof y == "function" && y !== e.entries)
547
+ for (var k = y.call(e), _; !(_ = k.next()).done; )
548
+ _e(_.value) && Le(_.value, t);
549
+ }
550
+ }
551
+ }
552
+ function ht(e) {
553
+ {
554
+ var t = e.type;
555
+ if (t == null || typeof t == "string")
556
+ return;
557
+ var n;
558
+ if (typeof t == "function")
559
+ n = t.propTypes;
560
+ else if (typeof t == "object" && (t.$$typeof === v || // Note: Memo only checks outer props here.
561
+ // Inner props are checked in the reconciler.
562
+ t.$$typeof === m))
563
+ n = t.propTypes;
564
+ else
565
+ return;
566
+ if (n) {
567
+ var d = A(t);
568
+ et(n, e.props, "prop", d, e);
569
+ } else if (t.PropTypes !== void 0 && !pe) {
570
+ pe = !0;
571
+ var y = A(t);
572
+ C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", y || "Unknown");
573
+ }
574
+ typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
575
+ }
576
+ }
577
+ function pt(e) {
578
+ {
579
+ for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
580
+ var d = t[n];
581
+ if (d !== "children" && d !== "key") {
582
+ V(e), C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", d), V(null);
583
+ break;
584
+ }
585
+ }
586
+ e.ref !== null && (V(e), C("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
587
+ }
588
+ }
589
+ function Ue(e, t, n, d, y, k) {
590
+ {
591
+ var _ = ce(e);
592
+ if (!_) {
593
+ var p = "";
594
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (p += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
595
+ var x = ft(y);
596
+ x ? p += x : p += Ie();
597
+ var E;
598
+ e === null ? E = "null" : fe(e) ? E = "array" : e !== void 0 && e.$$typeof === s ? (E = "<" + (A(e.type) || "Unknown") + " />", p = " Did you accidentally export a JSX literal instead of a component?") : E = typeof e, C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", E, p);
599
+ }
600
+ var w = dt(e, t, n, y, k);
601
+ if (w == null)
602
+ return w;
603
+ if (_) {
604
+ var j = t.children;
605
+ if (j !== void 0)
606
+ if (d)
607
+ if (fe(j)) {
608
+ for (var B = 0; B < j.length; B++)
609
+ We(j[B], e);
610
+ Object.freeze && Object.freeze(j);
611
+ } else
612
+ C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
613
+ else
614
+ We(j, e);
615
+ }
616
+ return e === a ? pt(w) : ht(w), w;
617
+ }
618
+ }
619
+ function _t(e, t, n) {
620
+ return Ue(e, t, n, !0);
621
+ }
622
+ function gt(e, t, n) {
623
+ return Ue(e, t, n, !1);
624
+ }
625
+ var yt = gt, bt = _t;
626
+ H.Fragment = a, H.jsx = yt, H.jsxs = bt;
627
+ }()), H;
628
+ }
629
+ process.env.NODE_ENV === "production" ? ye.exports = Tt() : ye.exports = wt();
630
+ var i = ye.exports;
631
+ const Be = "default", Rt = (o, s) => async (...r) => {
632
+ var R;
633
+ const [a, u, ...l] = r, h = u ? { ...u } : { method: "GET" };
634
+ let c = new Headers();
635
+ h.headers && (c = h.headers instanceof Headers ? h.headers : new Headers(h.headers));
636
+ const g = await s().getValidTokenAsync(), b = (R = g == null ? void 0 : g.tokens) == null ? void 0 : R.accessToken;
637
+ c.has("Accept") || c.set("Accept", "application/json"), b && (c.set("Authorization", `Bearer ${b}`), h.credentials || (h.credentials = "same-origin"));
638
+ const m = { ...h, headers: c };
639
+ return await o(a, m, ...l);
640
+ }, Gt = (o = null, s = Be) => (r) => (a) => {
641
+ const { fetch: u } = Ct(o || a.fetch, s);
642
+ return /* @__PURE__ */ i.jsx(r, { ...a, fetch: u });
643
+ }, Ct = (o = null, s = Be) => {
644
+ const r = o || window.fetch, a = f.get;
645
+ return { fetch: kt(
646
+ (l, h) => Rt(r, () => a(s))(l, h),
647
+ [r, s]
648
+ ) };
649
+ }, qe = () => /* @__PURE__ */ i.jsx("div", { className: "oidc-authenticating", children: /* @__PURE__ */ i.jsxs("div", { className: "oidc-authenticating__container", children: [
650
+ /* @__PURE__ */ i.jsx("h1", { className: "oidc-authenticating__title", children: "Error authentication" }),
651
+ /* @__PURE__ */ i.jsx("p", { className: "oidc-authenticating__content", children: "An error occurred during authentication." })
652
+ ] }) }), xt = () => /* @__PURE__ */ i.jsx("div", { className: "oidc-authenticating", children: /* @__PURE__ */ i.jsxs("div", { className: "oidc-authenticating__container", children: [
653
+ /* @__PURE__ */ i.jsx("h1", { className: "oidc-authenticating__title", children: "Authentication in progress" }),
654
+ /* @__PURE__ */ i.jsx("p", { className: "oidc-authenticating__content", children: "You will be redirected to the login page." })
655
+ ] }) }), jt = () => Math.random().toString(36).substr(2, 6), Ot = (o, s) => (r, a) => {
656
+ if (typeof o.CustomEvent == "function")
657
+ return new o.CustomEvent(r, a);
658
+ const u = a || { bubbles: !1, cancelable: !1, detail: void 0 }, l = s.createEvent("CustomEvent");
659
+ return l.initCustomEvent(r, u.bubbles, u.cancelable, u.detail), l.prototype = o.Event.prototype, l;
660
+ }, St = (o, s, r) => ({
661
+ replaceState: (a, u) => {
662
+ const l = r(), h = u || o.history.state;
663
+ o.history.replaceState({ key: l, state: h }, null, a), o.dispatchEvent(s("popstate"));
664
+ }
665
+ }), Pt = () => St(window, Ot(window, document), jt), ze = () => /* @__PURE__ */ i.jsx("div", { className: "oidc-callback", children: /* @__PURE__ */ i.jsxs("div", { className: "oidc-callback__container", children: [
666
+ /* @__PURE__ */ i.jsx("h1", { className: "oidc-callback__title", children: "Authentication complete" }),
667
+ /* @__PURE__ */ i.jsx("p", { className: "oidc-callback__content", children: "You will be redirected to your application." })
668
+ ] }) }), At = ({ callBackError: o, callBackSuccess: s, configurationName: r, withCustomHistory: a }) => {
669
+ const [u, l] = P(!1);
670
+ O(() => {
671
+ let v = !0;
672
+ return (async () => {
673
+ const b = f.get;
674
+ try {
675
+ const { callbackPath: m } = await b(r).loginCallbackAsync();
676
+ (a ? a() : Pt()).replaceState(m || "/");
677
+ } catch (m) {
678
+ v && (console.warn(m), l(!0));
679
+ }
680
+ })(), () => {
681
+ v = !1;
682
+ };
683
+ }, []);
684
+ const h = o || qe, c = s || ze;
685
+ return u ? /* @__PURE__ */ i.jsx(h, { configurationName: r }) : /* @__PURE__ */ i.jsx(c, { configurationName: r });
686
+ }, Ft = () => /* @__PURE__ */ i.jsx("span", { className: "oidc-loading", children: "Loading" }), Nt = () => /* @__PURE__ */ i.jsx("div", { className: "oidc-serviceworker", children: /* @__PURE__ */ i.jsxs("div", { className: "oidc-serviceworker__container", children: [
687
+ /* @__PURE__ */ i.jsx("h1", { className: "oidc-serviceworker__title", children: "Unable to authenticate on this browser" }),
688
+ /* @__PURE__ */ i.jsx("p", { className: "oidc-serviceworker__content", children: "Your browser is not secure enough to make authentication work. Try updating your browser or use a newer browser." })
689
+ ] }) }), It = () => /* @__PURE__ */ i.jsx("div", { className: "oidc-session-lost", children: /* @__PURE__ */ i.jsxs("div", { className: "oidc-session-lost__container", children: [
690
+ /* @__PURE__ */ i.jsx("h1", { className: "oidc-session-lost__title", children: "Session timed out" }),
691
+ /* @__PURE__ */ i.jsx("p", { className: "oidc-session-lost__content", children: "Your session has expired. Please re-authenticate." })
692
+ ] }) }), Dt = ({ configurationName: o }) => (O(() => {
693
+ (async () => {
694
+ const r = f.get;
695
+ r(o).silentLoginCallbackAsync();
696
+ })();
697
+ }, []), /* @__PURE__ */ i.jsx(i.Fragment, {})), Lt = ({ configurationName: o }) => {
698
+ const s = mt(window.location.href), r = f.get, a = r(o);
699
+ let u = null;
700
+ for (const [l, h] of Object.entries(s))
701
+ l === "state" || l === "scope" || (u === null && (u = {}), u[l] = h);
702
+ return O(() => {
703
+ a.tokens || a.loginAsync(null, u, !0, s.scope);
704
+ }, []), /* @__PURE__ */ i.jsx(i.Fragment, {});
705
+ }, Wt = ({
706
+ callbackErrorComponent: o,
707
+ callbackSuccessComponent: s,
708
+ redirect_uri: r,
709
+ silent_redirect_uri: a,
710
+ silent_login_uri: u,
711
+ children: l,
712
+ configurationName: h,
713
+ withCustomHistory: c = null
714
+ }) => {
715
+ const v = window ? z(window.location.href) : "", [g, b] = P(v);
716
+ O(() => {
717
+ const R = () => b(z(window.location.href));
718
+ return R(), window.addEventListener("popstate", R, !1), () => window.removeEventListener("popstate", R, !1);
719
+ }, []);
720
+ const m = z(r);
721
+ if (a && g === z(a))
722
+ return /* @__PURE__ */ i.jsx(Dt, { configurationName: h });
723
+ if (u && g === z(u))
724
+ return /* @__PURE__ */ i.jsx(Lt, { configurationName: h });
725
+ switch (g) {
726
+ case m:
727
+ return /* @__PURE__ */ i.jsx(At, { callBackError: o, callBackSuccess: s, configurationName: h, withCustomHistory: c });
728
+ default:
729
+ return /* @__PURE__ */ i.jsx(i.Fragment, { children: l });
730
+ }
731
+ }, Ut = be.memo(Wt), Ve = { name: "", data: null }, $t = ({ loadingComponent: o, children: s, configurationName: r }) => {
732
+ const [a, u] = P(!0), l = f.get, h = l(r);
733
+ O(() => {
734
+ let v = !0;
735
+ return h && h.tryKeepExistingSessionAsync().then(() => {
736
+ v && u(!1);
737
+ }), () => {
738
+ v = !1;
739
+ };
740
+ }, [r]);
741
+ const c = o;
742
+ return /* @__PURE__ */ i.jsx(i.Fragment, { children: a ? /* @__PURE__ */ i.jsx(c, { configurationName: r }) : /* @__PURE__ */ i.jsx(i.Fragment, { children: s }) });
743
+ }, J = ({ isLoading: o, loadingComponent: s, children: r, configurationName: a }) => {
744
+ const u = s;
745
+ return o ? /* @__PURE__ */ i.jsx(u, { configurationName: a, children: r }) : /* @__PURE__ */ i.jsx(i.Fragment, { children: r });
746
+ }, Ht = ({
747
+ children: o,
748
+ configuration: s,
749
+ configurationName: r = "default",
750
+ callbackSuccessComponent: a = ze,
751
+ authenticatingComponent: u = xt,
752
+ loadingComponent: l = Ft,
753
+ serviceWorkerNotSupportedComponent: h = Nt,
754
+ authenticatingErrorComponent: c = qe,
755
+ sessionLostComponent: v = It,
756
+ onSessionLost: g = null,
757
+ onLogoutFromAnotherTab: b = null,
758
+ onLogoutFromSameTab: m = null,
759
+ withCustomHistory: R = null,
760
+ onEvent: D = null,
761
+ getFetch: K = null
762
+ }) => {
763
+ const U = (S = "default") => f.getOrCreate(K ?? Et)(s, S), [ne, L] = P(!0), [C, $] = P(Ve), [oe, se] = P("default");
764
+ O(() => {
765
+ const F = U(r).subscribeEvents((T, N) => {
766
+ D && D(r, T, N);
767
+ });
768
+ return () => {
769
+ U(r).removeEventSubscription(F);
770
+ };
771
+ }, [r, D]), O(() => {
772
+ const F = U(r).subscribeEvents((T, N) => {
773
+ if (T === f.eventNames.refreshTokensAsync_error || T === f.eventNames.syncTokensAsync_error) {
774
+ if (g != null) {
775
+ g();
776
+ return;
777
+ }
778
+ $({ name: T, data: N });
779
+ } else if (T === f.eventNames.logout_from_another_tab) {
780
+ if (b != null) {
781
+ b();
782
+ return;
783
+ }
784
+ $({ name: T, data: N });
785
+ } else
786
+ T === f.eventNames.logout_from_same_tab ? m != null && m() : T === f.eventNames.loginAsync_begin || T === f.eventNames.loginCallbackAsync_end || T === f.eventNames.loginAsync_error || T === f.eventNames.loginCallbackAsync_error ? $({ name: T, data: N }) : T === f.eventNames.service_worker_not_supported_by_browser && s.service_worker_only === !0 && $({ name: T, data: N });
787
+ });
788
+ return se(r), L(!1), () => {
789
+ U(r).removeEventSubscription(F), $(Ve);
790
+ };
791
+ }, [s, r]);
792
+ const ae = v, ie = u, W = l, X = h, ce = c, Y = ne || oe !== r, M = U(r);
793
+ switch (C.name) {
794
+ case f.eventNames.service_worker_not_supported_by_browser:
795
+ return /* @__PURE__ */ i.jsx(J, { loadingComponent: W, isLoading: Y, configurationName: r, children: /* @__PURE__ */ i.jsx(X, { configurationName: r }) });
796
+ case f.eventNames.loginAsync_begin:
797
+ return /* @__PURE__ */ i.jsx(J, { loadingComponent: W, isLoading: Y, configurationName: r, children: /* @__PURE__ */ i.jsx(ie, { configurationName: r }) });
798
+ case f.eventNames.loginAsync_error:
799
+ case f.eventNames.loginCallbackAsync_error:
800
+ return /* @__PURE__ */ i.jsx(J, { loadingComponent: W, isLoading: Y, configurationName: r, children: /* @__PURE__ */ i.jsx(ce, { configurationName: r }) });
801
+ case f.eventNames.refreshTokensAsync_error:
802
+ case f.eventNames.syncTokensAsync_error:
803
+ case f.eventNames.logout_from_another_tab:
804
+ return /* @__PURE__ */ i.jsx(J, { loadingComponent: W, isLoading: Y, configurationName: r, children: /* @__PURE__ */ i.jsx(ae, { configurationName: r }) });
805
+ default:
806
+ return /* @__PURE__ */ i.jsx(J, { loadingComponent: W, isLoading: Y, configurationName: r, children: /* @__PURE__ */ i.jsx(
807
+ Ut,
808
+ {
809
+ redirect_uri: M.configuration.redirect_uri,
810
+ silent_redirect_uri: M.configuration.silent_redirect_uri,
811
+ silent_login_uri: M.configuration.silent_login_uri,
812
+ callbackSuccessComponent: a,
813
+ callbackErrorComponent: c,
814
+ authenticatingComponent: u,
815
+ configurationName: r,
816
+ withCustomHistory: R,
817
+ children: /* @__PURE__ */ i.jsx($t, { loadingComponent: W, configurationName: r, children: o })
818
+ }
819
+ ) });
820
+ }
821
+ }, Yt = ({ children: o, callbackPath: s = null, extras: r = null, configurationName: a = "default" }) => {
822
+ const u = f.get, l = u(a);
823
+ return O(() => {
824
+ l.tokens || l.loginAsync(s, r);
825
+ }, [a, s, r]), l.tokens ? /* @__PURE__ */ i.jsx(i.Fragment, { children: o }) : null;
826
+ }, Jt = (o, s = null, r = null, a = "default") => (u) => /* @__PURE__ */ i.jsx(Yt, { callbackPath: s, extras: r, configurationName: a, children: /* @__PURE__ */ i.jsx(o, { ...u }) }), ke = "default", ge = (o, s) => {
827
+ let r = !1;
828
+ return o(s) && (r = o(s).tokens != null), r;
829
+ }, Kt = (o = ke) => {
830
+ const s = f.get, [r, a] = P(ge(s, o));
831
+ return O(() => {
832
+ let c = !0;
833
+ const v = s(o);
834
+ a(ge(s, o));
835
+ const g = v.subscribeEvents((b, m) => {
836
+ (b === f.eventNames.logout_from_another_tab || b === f.eventNames.logout_from_same_tab || b === f.eventNames.token_aquired) && c && a(ge(s, o));
837
+ });
838
+ return () => {
839
+ c = !1, v.removeEventSubscription(g);
840
+ };
841
+ }, [o]), { login: (c = void 0, v = null, g = !1) => s(o).loginAsync(c, v, !1, void 0, g), logout: (c = void 0, v = null) => s(o).logoutAsync(c, v), renewTokens: async (c = null) => {
842
+ const v = await s(o).renewTokensAsync(c);
843
+ return {
844
+ // @ts-ignore
845
+ accessToken: v.accessToken,
846
+ // @ts-ignore
847
+ accessTokenPayload: v.accessTokenPayload,
848
+ // @ts-ignore
849
+ idToken: v.idToken,
850
+ // @ts-ignore
851
+ idTokenPayload: v.idTokenPayload
852
+ };
853
+ }, isAuthenticated: r };
854
+ }, Ge = { accessToken: null, accessTokenPayload: null }, Mt = (o) => {
855
+ const s = f.get, r = s(o);
856
+ if (r.tokens) {
857
+ const a = r.tokens;
858
+ return {
859
+ accessToken: a.accessToken,
860
+ accessTokenPayload: a.accessTokenPayload
861
+ };
862
+ }
863
+ return Ge;
864
+ }, Xt = (o = ke) => {
865
+ const s = f.get, [r, a] = P(Mt(o));
866
+ return O(() => {
867
+ let u = !0;
868
+ const l = s(o);
869
+ if (l.tokens) {
870
+ const c = l.tokens;
871
+ a({ accessToken: c.accessToken, accessTokenPayload: c.accessTokenPayload });
872
+ }
873
+ const h = l.subscribeEvents((c, v) => {
874
+ if ((c === f.eventNames.token_renewed || c === f.eventNames.token_aquired || c === f.eventNames.logout_from_another_tab || c === f.eventNames.logout_from_same_tab || c === f.eventNames.refreshTokensAsync_error || c === f.eventNames.syncTokensAsync_error) && u) {
875
+ const g = l.tokens;
876
+ a(g != null ? { accessToken: g.accessToken, accessTokenPayload: g.accessTokenPayload } : Ge);
877
+ }
878
+ });
879
+ return () => {
880
+ u = !1, l.removeEventSubscription(h);
881
+ };
882
+ }, [o]), r;
883
+ }, He = { idToken: null, idTokenPayload: null }, Vt = (o) => {
884
+ const s = f.get, r = s(o);
885
+ if (r.tokens) {
886
+ const a = r.tokens;
887
+ return { idToken: a.idToken, idTokenPayload: a.idTokenPayload };
888
+ }
889
+ return He;
890
+ }, Qt = (o = ke) => {
891
+ const s = f.get, [r, a] = P(Vt(o));
892
+ return O(() => {
893
+ let u = !0;
894
+ const l = s(o);
895
+ if (l.tokens) {
896
+ const c = l.tokens;
897
+ a({ idToken: c.idToken, idTokenPayload: c.idTokenPayload });
898
+ }
899
+ const h = l.subscribeEvents((c, v) => {
900
+ if ((c === f.eventNames.token_renewed || c === f.eventNames.token_aquired || c === f.eventNames.logout_from_another_tab || c === f.eventNames.logout_from_same_tab || c === f.eventNames.refreshTokensAsync_error || c === f.eventNames.syncTokensAsync_error) && u) {
901
+ const g = l.tokens;
902
+ a(g != null ? { idToken: g.idToken, idTokenPayload: g.idTokenPayload } : He);
903
+ }
904
+ });
905
+ return () => {
906
+ u = !1, l.removeEventSubscription(h);
907
+ };
908
+ }, [o]), r;
909
+ };
910
+ var Bt = /* @__PURE__ */ ((o) => (o.Unauthenticated = "Unauthenticated", o.Loading = "Loading user", o.Loaded = "User loaded", o.LoadingError = "Error loading user", o))(Bt || {});
911
+ const Zt = (o = "default") => {
912
+ const [s, r] = P({
913
+ user: null,
914
+ status: "Unauthenticated"
915
+ /* Unauthenticated */
916
+ }), [a, u] = P(""), l = f.get(o);
917
+ O(() => {
918
+ let c = !0;
919
+ if (l && l.tokens) {
920
+ r({
921
+ ...s,
922
+ status: "Loading user"
923
+ /* Loading */
924
+ });
925
+ const v = a !== "";
926
+ l.userInfoAsync(v).then((g) => {
927
+ c && r({
928
+ user: g,
929
+ status: "User loaded"
930
+ /* Loaded */
931
+ });
932
+ }).catch(() => r({
933
+ ...s,
934
+ status: "Error loading user"
935
+ /* LoadingError */
936
+ }));
937
+ } else
938
+ r({
939
+ user: null,
940
+ status: "Unauthenticated"
941
+ /* Unauthenticated */
942
+ });
943
+ return () => {
944
+ c = !1;
945
+ };
946
+ }, [a]);
947
+ const h = () => {
948
+ u(a + " ");
949
+ };
950
+ return { oidcUser: s.user, oidcUserLoadingState: s.status, reloadOidcUser: h };
951
+ };
952
+ export {
953
+ Ht as OidcProvider,
954
+ Yt as OidcSecure,
955
+ Bt as OidcUserStatus,
956
+ rr as TokenRenewMode,
957
+ Kt as useOidc,
958
+ Xt as useOidcAccessToken,
959
+ Ct as useOidcFetch,
960
+ Qt as useOidcIdToken,
961
+ Zt as useOidcUser,
962
+ Gt as withOidcFetch,
963
+ Jt as withOidcSecure
964
+ };