@gen-epix/ui-client-common 4.3.0 → 4.3.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 (132) hide show
  1. package/dist/_chunks/Breadcrumbs.js +22 -22
  2. package/dist/_chunks/QueryClientProvider.js +1 -1
  3. package/dist/_chunks/QueryClientProvider.js.map +1 -1
  4. package/dist/_chunks/QueryClientService.js +4 -5
  5. package/dist/_chunks/QueryClientService.js.map +1 -1
  6. package/dist/_chunks/Table.js +559 -3173
  7. package/dist/_chunks/Table.js.map +1 -1
  8. package/dist/_chunks/{oidc-client-ts.js → UserManagerUtil.js} +222 -198
  9. package/dist/_chunks/UserManagerUtil.js.map +1 -0
  10. package/dist/_chunks/middleware.js +1 -1
  11. package/dist/_chunks/middleware.js.map +1 -1
  12. package/dist/_chunks/omit.js +1 -1
  13. package/dist/_chunks/omit.js.map +1 -1
  14. package/dist/_chunks/query.js +7 -7
  15. package/dist/_chunks/query.js.map +1 -1
  16. package/dist/_chunks/react.js +1 -1
  17. package/dist/_chunks/react.js.map +1 -1
  18. package/dist/_chunks/useColumnsMenu.js +2 -2
  19. package/dist/_chunks/useColumnsMenu.js.map +1 -1
  20. package/dist/_chunks/useMutation.js +2 -2
  21. package/dist/_chunks/useMutation.js.map +1 -1
  22. package/dist/_chunks/useQueryMemo.js +6 -6
  23. package/dist/_chunks/useQueryMemo.js.map +1 -1
  24. package/dist/_chunks/vanilla.js +1 -1
  25. package/dist/_chunks/vanilla.js.map +1 -1
  26. package/dist/_chunks/yup.js +2 -2
  27. package/dist/_chunks/yup.js.map +1 -1
  28. package/dist/classes/services/LogService/index.js +1 -1
  29. package/dist/classes/services/LogService/index.js.map +1 -1
  30. package/dist/classes/services/RouterService/index.js +4 -4
  31. package/dist/components/app/App/App.d.ts +1 -1
  32. package/dist/components/app/App/index.js +35 -100
  33. package/dist/components/app/App/index.js.map +1 -1
  34. package/dist/components/app/AppRouterProvider/AppRouterProvider.d.ts +1 -1
  35. package/dist/components/app/AuthenticationWrapper/AuthenticationWrapper.d.ts +1 -1
  36. package/dist/components/app/AuthenticationWrapper/index.js +38 -38
  37. package/dist/components/app/AuthorizationWrapper/index.js +20 -20
  38. package/dist/components/app/RouterRoot/RouterRoot.d.ts +1 -1
  39. package/dist/components/app/RouterRoot/index.js +58 -59
  40. package/dist/components/app/RouterRoot/index.js.map +1 -1
  41. package/dist/components/filters/BooleanFilterField/BooleanFilterField.d.ts +1 -1
  42. package/dist/components/filters/DateFilterField/DateFilterField.d.ts +1 -1
  43. package/dist/components/filters/GeoFilterField/GeoFilterField.d.ts +1 -1
  44. package/dist/components/filters/MultiSelectFilterField/MultiSelectFilterField.d.ts +1 -1
  45. package/dist/components/filters/NumberRangeFilterField/NumberRangeFilterField.d.ts +1 -1
  46. package/dist/components/filters/TextFilterField/TextFilterField.d.ts +1 -1
  47. package/dist/components/ui/ApplicationBar/ApplicationBar.d.ts +1 -1
  48. package/dist/components/ui/ApplicationBar/ApplicationBarActions.d.ts +1 -1
  49. package/dist/components/ui/ApplicationBar/ApplicationBarActionsFeedbackItem.d.ts +1 -1
  50. package/dist/components/ui/ApplicationBar/ApplicationBarActionsInfotem.d.ts +1 -1
  51. package/dist/components/ui/ApplicationBar/ApplicationBarActionsNotificationsItem.d.ts +1 -1
  52. package/dist/components/ui/ApplicationBar/ApplicationBarActionsOrganizationSwitcherItem.d.ts +1 -1
  53. package/dist/components/ui/ApplicationBar/ApplicationBarActionsOutagesItem.d.ts +1 -1
  54. package/dist/components/ui/ApplicationBar/ApplicationBarActionsUserItem.d.ts +1 -1
  55. package/dist/components/ui/ApplicationBar/ApplicationBarNavigationMenu.d.ts +1 -1
  56. package/dist/components/ui/ApplicationBar/UserOrganizationAdminMenuItem.d.ts +1 -1
  57. package/dist/components/ui/ApplicationBar/UserOwnOrganizationMenuItem.d.ts +1 -1
  58. package/dist/components/ui/ApplicationBar/index.js +146 -146
  59. package/dist/components/ui/ApplicationBar/index.js.map +1 -1
  60. package/dist/components/ui/ApplicationFooter/ApplicationFooter.d.ts +1 -1
  61. package/dist/components/ui/ApplicationFooter/ApplicationFooterLink.d.ts +1 -1
  62. package/dist/components/ui/ApplicationFooter/ApplicationFooterLinkSection.d.ts +1 -1
  63. package/dist/components/ui/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  64. package/dist/components/ui/GenericErrorMessage/GenericErrorMessage.d.ts +1 -1
  65. package/dist/components/ui/GenericErrorMessage/index.js +34 -34
  66. package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
  67. package/dist/components/ui/NavLink/NavLink.d.ts +1 -1
  68. package/dist/components/ui/NavLink/index.js +8 -8
  69. package/dist/components/ui/Notifications/NotificationItem.d.ts +1 -1
  70. package/dist/components/ui/Notifications/NotificationsDrawer.d.ts +1 -1
  71. package/dist/components/ui/OutageList/OutageItem.d.ts +1 -1
  72. package/dist/components/ui/OutageList/OutageList.d.ts +1 -1
  73. package/dist/components/ui/OutageList/OutageSection.d.ts +1 -1
  74. package/dist/components/ui/PageContainer/index.js +1 -1
  75. package/dist/components/ui/PageContainer/index.js.map +1 -1
  76. package/dist/components/ui/Sidebar/SidebarItem.d.ts +1 -1
  77. package/dist/components/ui/Sidebar/SidebarMenu.d.ts +1 -1
  78. package/dist/components/ui/Sidebar/SidebarMenuItem.d.ts +1 -1
  79. package/dist/components/ui/SortableList/SortableList.d.ts +1 -1
  80. package/dist/components/ui/SortableList/SortableListItem.d.ts +1 -1
  81. package/dist/components/ui/SortableList/SortableListItemDragHandle.d.ts +1 -1
  82. package/dist/components/ui/SortableList/SortableOverlay.d.ts +1 -1
  83. package/dist/components/ui/SortableList/context/SortableListItemContextProvider.d.ts +1 -1
  84. package/dist/components/ui/Table/Table.d.ts +1 -1
  85. package/dist/components/ui/Table/TableActionsCell.d.ts +1 -1
  86. package/dist/components/ui/Table/TableCaption.d.ts +1 -1
  87. package/dist/components/ui/Table/TableCell.d.ts +1 -1
  88. package/dist/components/ui/Table/TableCellAsyncContent.d.ts +1 -1
  89. package/dist/components/ui/Table/TableCheckboxCell.d.ts +1 -1
  90. package/dist/components/ui/Table/TableCheckboxHeader.d.ts +1 -1
  91. package/dist/components/ui/Table/TableFilter.d.ts +1 -1
  92. package/dist/components/ui/Table/TableFiltersSidebarItem.d.ts +2 -2
  93. package/dist/components/ui/Table/TableHeader.d.ts +1 -1
  94. package/dist/components/ui/Table/TableHeaderCell.d.ts +1 -1
  95. package/dist/components/ui/Table/TableHeaderFilter.d.ts +1 -1
  96. package/dist/components/ui/Table/TableMenu.d.ts +1 -1
  97. package/dist/components/ui/Table/TableReadableIndexCell.d.ts +1 -1
  98. package/dist/components/ui/Table/TableSidebarMenu.d.ts +1 -1
  99. package/dist/components/ui/UserInactivityConfirmation/UserInactivityConfirmation.d.ts +1 -1
  100. package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContextProvider.d.ts +1 -1
  101. package/dist/hoc/withPermissions/withPermissions.d.ts +1 -1
  102. package/dist/pages/AcceptInvitationPage/AcceptInvitationPage.d.ts +1 -1
  103. package/dist/pages/AcceptInvitationPage/index.js +28 -28
  104. package/dist/pages/AdminPage/AdminPage.d.ts +1 -1
  105. package/dist/pages/AdminPage/index.js +23 -23
  106. package/dist/pages/ChooseIdentityProviderPage/ChooseIdentityProviderPage.d.ts +1 -1
  107. package/dist/pages/CrudPage/CrudPage.d.ts +1 -1
  108. package/dist/pages/ErrorPage/ErrorPage.d.ts +1 -1
  109. package/dist/pages/IdentifierIssuersAdminPage/IdentifierIssuersAdminPage.d.ts +1 -1
  110. package/dist/pages/OrganizationAdminPoliciesAdminPage/OrganizationAdminPoliciesAdminPage.d.ts +1 -1
  111. package/dist/pages/OrganizationContactsAdminPage/OrganizationContactsAdminPage.d.ts +1 -1
  112. package/dist/pages/OrganizationContactsAdminPage/index.js +29 -29
  113. package/dist/pages/OrganizationSitesAdminPage/OrganizationSitesAdminPage.d.ts +1 -1
  114. package/dist/pages/OrganizationSitesAdminPage/index.js +25 -25
  115. package/dist/pages/OrganizationsAdminPage/OrganizationsAdminPage.d.ts +1 -1
  116. package/dist/pages/OutagesAdminPage/OutagesAdminPage.d.ts +1 -1
  117. package/dist/pages/PostLoginPage/PostLoginPage.d.ts +1 -1
  118. package/dist/pages/PostLoginPage/index.js +11 -11
  119. package/dist/pages/PostLogoutPage/PostLogoutPage.d.ts +1 -1
  120. package/dist/pages/RouterErrorPage/RouterErrorPage.d.ts +1 -1
  121. package/dist/pages/RouterErrorPage/index.js +10 -10
  122. package/dist/pages/UserInvitationsAdminPage/UserInvitationsAdminPage.d.ts +1 -1
  123. package/dist/pages/UsersAdminPage/UsersAdminPage.d.ts +1 -1
  124. package/dist/stores/tableStore/TableStoreContextProvider.d.ts +1 -1
  125. package/dist/utils/UserManagerUtil/index.js +2 -31
  126. package/package.json +27 -22
  127. package/dist/_chunks/chunk-OB3PAWPO.js +0 -3742
  128. package/dist/_chunks/chunk-OB3PAWPO.js.map +0 -1
  129. package/dist/_chunks/oidc-client-ts.js.map +0 -1
  130. package/dist/_chunks/react-oidc-context.js +0 -201
  131. package/dist/_chunks/react-oidc-context.js.map +0 -1
  132. package/dist/utils/UserManagerUtil/index.js.map +0 -1
@@ -1,85 +1,86 @@
1
+ import { WindowService as e } from "@gen-epix/ui-core/classes/services/WindowService";
1
2
  //#region ../../node_modules/.pnpm/jwt-decode@4.0.0/node_modules/jwt-decode/build/esm/index.js
2
- var e = class extends Error {};
3
- e.prototype.name = "InvalidTokenError";
4
- function t(e) {
3
+ var t = class extends Error {};
4
+ t.prototype.name = "InvalidTokenError";
5
+ function n(e) {
5
6
  return decodeURIComponent(atob(e).replace(/(.)/g, (e, t) => {
6
7
  let n = t.charCodeAt(0).toString(16).toUpperCase();
7
8
  return n.length < 2 && (n = "0" + n), "%" + n;
8
9
  }));
9
10
  }
10
- function n(e) {
11
- let n = e.replace(/-/g, "+").replace(/_/g, "/");
12
- switch (n.length % 4) {
11
+ function r(e) {
12
+ let t = e.replace(/-/g, "+").replace(/_/g, "/");
13
+ switch (t.length % 4) {
13
14
  case 0: break;
14
15
  case 2:
15
- n += "==";
16
+ t += "==";
16
17
  break;
17
18
  case 3:
18
- n += "=";
19
+ t += "=";
19
20
  break;
20
21
  default: throw Error("base64 string is not of the correct length");
21
22
  }
22
23
  try {
23
- return t(n);
24
+ return n(t);
24
25
  } catch {
25
- return atob(n);
26
+ return atob(t);
26
27
  }
27
28
  }
28
- function r(t, r) {
29
- if (typeof t != "string") throw new e("Invalid token specified: must be a string");
30
- r ||= {};
31
- let i = r.header === !0 ? 0 : 1, a = t.split(".")[i];
32
- if (typeof a != "string") throw new e(`Invalid token specified: missing part #${i + 1}`);
29
+ function i(e, n) {
30
+ if (typeof e != "string") throw new t("Invalid token specified: must be a string");
31
+ n ||= {};
32
+ let i = n.header === !0 ? 0 : 1, a = e.split(".")[i];
33
+ if (typeof a != "string") throw new t(`Invalid token specified: missing part #${i + 1}`);
33
34
  let o;
34
35
  try {
35
- o = n(a);
36
- } catch (t) {
37
- throw new e(`Invalid token specified: invalid base64 for part #${i + 1} (${t.message})`);
36
+ o = r(a);
37
+ } catch (e) {
38
+ throw new t(`Invalid token specified: invalid base64 for part #${i + 1} (${e.message})`);
38
39
  }
39
40
  try {
40
41
  return JSON.parse(o);
41
- } catch (t) {
42
- throw new e(`Invalid token specified: invalid json for part #${i + 1} (${t.message})`);
42
+ } catch (e) {
43
+ throw new t(`Invalid token specified: invalid json for part #${i + 1} (${e.message})`);
43
44
  }
44
45
  }
45
46
  //#endregion
46
47
  //#region ../../node_modules/.pnpm/oidc-client-ts@3.5.0/node_modules/oidc-client-ts/dist/esm/oidc-client-ts.js
47
- var i = {
48
+ var a = {
48
49
  debug: () => void 0,
49
50
  info: () => void 0,
50
51
  warn: () => void 0,
51
52
  error: () => void 0
52
- }, a, o, s = /* @__PURE__ */ ((e) => (e[e.NONE = 0] = "NONE", e[e.ERROR = 1] = "ERROR", e[e.WARN = 2] = "WARN", e[e.INFO = 3] = "INFO", e[e.DEBUG = 4] = "DEBUG", e))(s || {});
53
+ }, o, s, c = /* @__PURE__ */ ((e) => (e[e.NONE = 0] = "NONE", e[e.ERROR = 1] = "ERROR", e[e.WARN = 2] = "WARN", e[e.INFO = 3] = "INFO", e[e.DEBUG = 4] = "DEBUG", e))(c || {});
53
54
  ((e) => {
54
55
  function t() {
55
- a = 3, o = i;
56
+ o = 3, s = a;
56
57
  }
57
58
  e.reset = t;
58
59
  function n(e) {
59
60
  if (!(0 <= e && e <= 4)) throw Error("Invalid log level");
60
- a = e;
61
+ o = e;
61
62
  }
62
63
  e.setLevel = n;
63
64
  function r(e) {
64
- o = e;
65
+ s = e;
65
66
  }
66
67
  e.setLogger = r;
67
- })(s ||= {});
68
- var c = class e {
68
+ })(c ||= {});
69
+ var l = class e {
69
70
  constructor(e) {
70
71
  this._name = e;
71
72
  }
72
73
  debug(...t) {
73
- a >= 4 && o.debug(e._format(this._name, this._method), ...t);
74
+ o >= 4 && s.debug(e._format(this._name, this._method), ...t);
74
75
  }
75
76
  info(...t) {
76
- a >= 3 && o.info(e._format(this._name, this._method), ...t);
77
+ o >= 3 && s.info(e._format(this._name, this._method), ...t);
77
78
  }
78
79
  warn(...t) {
79
- a >= 2 && o.warn(e._format(this._name, this._method), ...t);
80
+ o >= 2 && s.warn(e._format(this._name, this._method), ...t);
80
81
  }
81
82
  error(...t) {
82
- a >= 1 && o.error(e._format(this._name, this._method), ...t);
83
+ o >= 1 && s.error(e._format(this._name, this._method), ...t);
83
84
  }
84
85
  throw(e) {
85
86
  throw this.error(e), e;
@@ -97,45 +98,45 @@ var c = class e {
97
98
  return t ? `${n} ${t}:` : n;
98
99
  }
99
100
  static debug(t, ...n) {
100
- a >= 4 && o.debug(e._format(t), ...n);
101
+ o >= 4 && s.debug(e._format(t), ...n);
101
102
  }
102
103
  static info(t, ...n) {
103
- a >= 3 && o.info(e._format(t), ...n);
104
+ o >= 3 && s.info(e._format(t), ...n);
104
105
  }
105
106
  static warn(t, ...n) {
106
- a >= 2 && o.warn(e._format(t), ...n);
107
+ o >= 2 && s.warn(e._format(t), ...n);
107
108
  }
108
109
  static error(t, ...n) {
109
- a >= 1 && o.error(e._format(t), ...n);
110
+ o >= 1 && s.error(e._format(t), ...n);
110
111
  }
111
112
  };
112
- s.reset();
113
- var l = class {
113
+ c.reset();
114
+ var u = class {
114
115
  static decode(e) {
115
116
  try {
116
- return r(e);
117
+ return i(e);
117
118
  } catch (e) {
118
- throw c.error("JwtUtils.decode", e), e;
119
+ throw l.error("JwtUtils.decode", e), e;
119
120
  }
120
121
  }
121
122
  static async generateSignedJwt(e, t, n) {
122
- let r = `${p.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e)))}.${p.encodeBase64Url(new TextEncoder().encode(JSON.stringify(t)))}`, i = await window.crypto.subtle.sign({
123
+ let r = `${m.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e)))}.${m.encodeBase64Url(new TextEncoder().encode(JSON.stringify(t)))}`, i = await window.crypto.subtle.sign({
123
124
  name: "ECDSA",
124
125
  hash: { name: "SHA-256" }
125
126
  }, n, new TextEncoder().encode(r));
126
- return `${r}.${p.encodeBase64Url(new Uint8Array(i))}`;
127
+ return `${r}.${m.encodeBase64Url(new Uint8Array(i))}`;
127
128
  }
128
129
  static async generateSignedJwtWithHmac(e, t, n) {
129
- let r = `${p.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e)))}.${p.encodeBase64Url(new TextEncoder().encode(JSON.stringify(t)))}`, i = await window.crypto.subtle.sign("HMAC", n, new TextEncoder().encode(r));
130
- return `${r}.${p.encodeBase64Url(new Uint8Array(i))}`;
130
+ let r = `${m.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e)))}.${m.encodeBase64Url(new TextEncoder().encode(JSON.stringify(t)))}`, i = await window.crypto.subtle.sign("HMAC", n, new TextEncoder().encode(r));
131
+ return `${r}.${m.encodeBase64Url(new Uint8Array(i))}`;
131
132
  }
132
- }, u = "10000000-1000-4000-8000-100000000000", d = (e) => btoa([...new Uint8Array(e)].map((e) => String.fromCharCode(e)).join("")), f = class e {
133
+ }, d = "10000000-1000-4000-8000-100000000000", f = (e) => btoa([...new Uint8Array(e)].map((e) => String.fromCharCode(e)).join("")), p = class e {
133
134
  static _randomWord() {
134
135
  let e = /* @__PURE__ */ new Uint32Array(1);
135
136
  return crypto.getRandomValues(e), e[0];
136
137
  }
137
138
  static generateUUIDv4() {
138
- return u.replace(/[018]/g, (t) => (+t ^ e._randomWord() & 15 >> t / 4).toString(16)).replace(/-/g, "");
139
+ return d.replace(/[018]/g, (t) => (+t ^ e._randomWord() & 15 >> t / 4).toString(16)).replace(/-/g, "");
139
140
  }
140
141
  static generateCodeVerifier() {
141
142
  return e.generateUUIDv4() + e.generateUUIDv4() + e.generateUUIDv4();
@@ -144,13 +145,13 @@ var l = class {
144
145
  if (!crypto.subtle) throw Error("Crypto.subtle is available only in secure contexts (HTTPS).");
145
146
  try {
146
147
  let t = new TextEncoder().encode(e);
147
- return d(await crypto.subtle.digest("SHA-256", t)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
148
+ return f(await crypto.subtle.digest("SHA-256", t)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
148
149
  } catch (e) {
149
- throw c.error("CryptoUtils.generateCodeChallenge", e), e;
150
+ throw l.error("CryptoUtils.generateCodeChallenge", e), e;
150
151
  }
151
152
  }
152
153
  static generateBasicAuth(e, t) {
153
- return d(new TextEncoder().encode([e, t].join(":")));
154
+ return f(new TextEncoder().encode([e, t].join(":")));
154
155
  }
155
156
  static async hash(e, t) {
156
157
  let n = new TextEncoder().encode(t), r = await crypto.subtle.digest(e, n);
@@ -211,7 +212,7 @@ var l = class {
211
212
  y: e.y
212
213
  }
213
214
  };
214
- return await l.generateSignedJwt(t, c, i.privateKey);
215
+ return await u.generateSignedJwt(t, c, i.privateKey);
215
216
  } catch (e) {
216
217
  throw e instanceof TypeError ? Error(`Error exporting dpop public key: ${e.message}`) : e;
217
218
  }
@@ -247,17 +248,17 @@ var l = class {
247
248
  HS512: "SHA-512"
248
249
  }[i];
249
250
  if (!c) throw Error(`Unsupported algorithm: ${i}. Supported algorithms are: HS256, HS384, HS512`);
250
- let u = new TextEncoder(), d = await crypto.subtle.importKey("raw", u.encode(n), {
251
+ let l = new TextEncoder(), d = await crypto.subtle.importKey("raw", l.encode(n), {
251
252
  name: "HMAC",
252
253
  hash: c
253
254
  }, !1, ["sign"]);
254
- return await l.generateSignedJwtWithHmac(o, s, d);
255
+ return await u.generateSignedJwtWithHmac(o, s, d);
255
256
  }
256
257
  };
257
- f.encodeBase64Url = (e) => d(e).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
258
- var p = f, m = class {
258
+ p.encodeBase64Url = (e) => f(e).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
259
+ var m = p, h = class {
259
260
  constructor(e) {
260
- this._name = e, this._callbacks = [], this._logger = new c(`Event('${this._name}')`);
261
+ this._name = e, this._callbacks = [], this._logger = new l(`Event('${this._name}')`);
261
262
  }
262
263
  addHandler(e) {
263
264
  return this._callbacks.push(e), () => this.removeHandler(e);
@@ -270,7 +271,7 @@ var p = f, m = class {
270
271
  this._logger.debug("raise:", ...e);
271
272
  for (let t of this._callbacks) await t(...e);
272
273
  }
273
- }, h = class {
274
+ }, g = class {
274
275
  static center({ ...e }) {
275
276
  return e.width ??= [
276
277
  800,
@@ -282,9 +283,9 @@ var p = f, m = class {
282
283
  static serialize(e) {
283
284
  return Object.entries(e).filter(([, e]) => e != null).map(([e, t]) => `${e}=${typeof t == "boolean" ? t ? "yes" : "no" : t}`).join(",");
284
285
  }
285
- }, g = class e extends m {
286
+ }, _ = class e extends h {
286
287
  constructor() {
287
- super(...arguments), this._logger = new c(`Timer('${this._name}')`), this._timerHandle = null, this._expiration = 0, this._callback = () => {
288
+ super(...arguments), this._logger = new l(`Timer('${this._name}')`), this._timerHandle = null, this._expiration = 0, this._callback = () => {
288
289
  let t = this._expiration - e.getEpochTime();
289
290
  this._logger.debug("timer completes in", t), this._expiration <= e.getEpochTime() && (this.cancel(), super.raise());
290
291
  };
@@ -310,24 +311,24 @@ var p = f, m = class {
310
311
  cancel() {
311
312
  this._logger.create("cancel"), this._timerHandle &&= (clearInterval(this._timerHandle), null);
312
313
  }
313
- }, _ = class {
314
+ }, v = class {
314
315
  static readParams(e, t = "query") {
315
316
  if (!e) throw TypeError("Invalid URL");
316
317
  let n = new URL(e, "http://127.0.0.1")[t === "fragment" ? "hash" : "search"];
317
318
  return new URLSearchParams(n.slice(1));
318
319
  }
319
- }, v = ";", y = class extends Error {
320
+ }, y = ";", b = class extends Error {
320
321
  constructor(e, t) {
321
- if (super(e.error_description || e.error || ""), this.form = t, this.name = "ErrorResponse", !e.error) throw c.error("ErrorResponse", "No error passed"), Error("No error passed");
322
+ if (super(e.error_description || e.error || ""), this.form = t, this.name = "ErrorResponse", !e.error) throw l.error("ErrorResponse", "No error passed"), Error("No error passed");
322
323
  this.error = e.error, this.error_description = e.error_description ?? null, this.error_uri = e.error_uri ?? null, this.state = e.userState, this.session_state = e.session_state ?? null, this.url_state = e.url_state;
323
324
  }
324
- }, b = class extends Error {
325
+ }, x = class extends Error {
325
326
  constructor(e) {
326
327
  super(e), this.name = "ErrorTimeout";
327
328
  }
328
- }, x = class {
329
+ }, S = class {
329
330
  constructor(e) {
330
- this._logger = new c("AccessTokenEvents"), this._expiringTimer = new g("Access token expiring"), this._expiredTimer = new g("Access token expired"), this._expiringNotificationTimeInSeconds = e.expiringNotificationTimeInSeconds;
331
+ this._logger = new l("AccessTokenEvents"), this._expiringTimer = new _("Access token expiring"), this._expiredTimer = new _("Access token expired"), this._expiringNotificationTimeInSeconds = e.expiringNotificationTimeInSeconds;
331
332
  }
332
333
  async load(e) {
333
334
  let t = this._logger.create("load");
@@ -356,9 +357,9 @@ var p = f, m = class {
356
357
  removeAccessTokenExpired(e) {
357
358
  this._expiredTimer.removeHandler(e);
358
359
  }
359
- }, S = class {
360
+ }, C = class {
360
361
  constructor(e, t, n, r, i) {
361
- this._callback = e, this._client_id = t, this._intervalInSeconds = r, this._stopOnError = i, this._logger = new c("CheckSessionIFrame"), this._timer = null, this._session_state = null, this._message = (e) => {
362
+ this._callback = e, this._client_id = t, this._intervalInSeconds = r, this._stopOnError = i, this._logger = new l("CheckSessionIFrame"), this._timer = null, this._session_state = null, this._message = (e) => {
362
363
  e.origin === this._frame_origin && e.source === this._frame.contentWindow && (e.data === "error" ? (this._logger.error("error message from check session op iframe"), this._stopOnError && this.stop()) : e.data === "changed" ? (this._logger.debug("changed message from check session op iframe"), this.stop(), this._callback()) : this._logger.debug(e.data + " message from check session op iframe"));
363
364
  };
364
365
  let a = new URL(n);
@@ -375,16 +376,16 @@ var p = f, m = class {
375
376
  if (this._session_state === e) return;
376
377
  this._logger.create("start"), this.stop(), this._session_state = e;
377
378
  let t = () => {
378
- !this._frame.contentWindow || !this._session_state || this._frame.contentWindow.postMessage(this._client_id + " " + this._session_state, this._frame_origin);
379
+ this._frame.contentWindow && this._session_state && this._frame.contentWindow.postMessage(this._client_id + " " + this._session_state, this._frame_origin);
379
380
  };
380
381
  t(), this._timer = setInterval(t, this._intervalInSeconds * 1e3);
381
382
  }
382
383
  stop() {
383
384
  this._logger.create("stop"), this._session_state = null, this._timer &&= (clearInterval(this._timer), null);
384
385
  }
385
- }, C = class {
386
+ }, w = class {
386
387
  constructor() {
387
- this._logger = new c("InMemoryWebStorage"), this._data = {};
388
+ this._logger = new l("InMemoryWebStorage"), this._data = {};
388
389
  }
389
390
  clear() {
390
391
  this._logger.create("clear"), this._data = {};
@@ -404,13 +405,13 @@ var p = f, m = class {
404
405
  key(e) {
405
406
  return Object.getOwnPropertyNames(this._data)[e];
406
407
  }
407
- }, w = class extends Error {
408
+ }, T = class extends Error {
408
409
  constructor(e, t) {
409
410
  super(t), this.name = "ErrorDPoPNonce", this.nonce = e;
410
411
  }
411
- }, T = class {
412
+ }, E = class {
412
413
  constructor(e = [], t = null, n = {}) {
413
- this._jwtHandler = t, this._extraHeaders = n, this._logger = new c("JsonService"), this._contentTypes = [], this._contentTypes.push(...e, "application/json"), t && this._contentTypes.push("application/jwt");
414
+ this._jwtHandler = t, this._extraHeaders = n, this._logger = new l("JsonService"), this._contentTypes = [], this._contentTypes.push(...e, "application/json"), t && this._contentTypes.push("application/jwt");
414
415
  }
415
416
  async fetchWithTimeout(e, t = {}) {
416
417
  let { timeoutInSeconds: n, ...r } = t;
@@ -422,7 +423,7 @@ var p = f, m = class {
422
423
  signal: i.signal
423
424
  });
424
425
  } catch (e) {
425
- throw e instanceof DOMException && e.name === "AbortError" ? new b("Network timed out") : e;
426
+ throw e instanceof DOMException && e.name === "AbortError" ? new x("Network timed out") : e;
426
427
  } finally {
427
428
  clearTimeout(a);
428
429
  }
@@ -450,7 +451,7 @@ var p = f, m = class {
450
451
  } catch (e) {
451
452
  throw i.error("Error parsing JSON response", e), o.ok ? e : Error(`${o.statusText} (${o.status})`);
452
453
  }
453
- if (!o.ok) throw i.error("Error from server:", c), c.error ? new y(c) : Error(`${o.statusText} (${o.status}): ${JSON.stringify(c)}`);
454
+ if (!o.ok) throw i.error("Error from server:", c), c.error ? new b(c) : Error(`${o.statusText} (${o.status}): ${JSON.stringify(c)}`);
454
455
  return c;
455
456
  }
456
457
  async postForm(e, { body: t, basicAuth: n, timeoutInSeconds: r, initCredentials: i, extraHeaders: a }) {
@@ -481,7 +482,7 @@ var p = f, m = class {
481
482
  } catch (e) {
482
483
  throw o.error("Error parsing JSON response", e), c.ok ? e : Error(`${c.statusText} (${c.status})`);
483
484
  }
484
- if (!c.ok) throw o.error("Error from server:", d), c.headers.has("dpop-nonce") ? new w(c.headers.get("dpop-nonce"), `${JSON.stringify(d)}`) : d.error ? new y(d, t) : Error(`${c.statusText} (${c.status}): ${JSON.stringify(d)}`);
485
+ if (!c.ok) throw o.error("Error from server:", d), c.headers.has("dpop-nonce") ? new T(c.headers.get("dpop-nonce"), `${JSON.stringify(d)}`) : d.error ? new b(d, t) : Error(`${c.statusText} (${c.status}): ${JSON.stringify(d)}`);
485
486
  return d;
486
487
  }
487
488
  _appendExtraHeaders(e) {
@@ -499,9 +500,9 @@ var p = f, m = class {
499
500
  a && a !== "" && (e[n] = a);
500
501
  });
501
502
  }
502
- }, E = class {
503
+ }, D = class {
503
504
  constructor(e) {
504
- this._settings = e, this._logger = new c("MetadataService"), this._signingKeys = null, this._metadata = null, this._metadataUrl = this._settings.metadataUrl, this._jsonService = new T(["application/jwk-set+json"], null, this._settings.extraHeaders), this._settings.signingKeys && (this._logger.debug("using signingKeys from settings"), this._signingKeys = this._settings.signingKeys), this._settings.metadata && (this._logger.debug("using metadata from settings"), this._metadata = this._settings.metadata), this._settings.fetchRequestCredentials && (this._logger.debug("using fetchRequestCredentials from settings"), this._fetchRequestCredentials = this._settings.fetchRequestCredentials);
505
+ this._settings = e, this._logger = new l("MetadataService"), this._signingKeys = null, this._metadata = null, this._metadataUrl = this._settings.metadataUrl, this._jsonService = new E(["application/jwk-set+json"], null, this._settings.extraHeaders), this._settings.signingKeys && (this._logger.debug("using signingKeys from settings"), this._signingKeys = this._settings.signingKeys), this._settings.metadata && (this._logger.debug("using metadata from settings"), this._metadata = this._settings.metadata), this._settings.fetchRequestCredentials && (this._logger.debug("using fetchRequestCredentials from settings"), this._fetchRequestCredentials = this._settings.fetchRequestCredentials);
505
506
  }
506
507
  resetSigningKeys() {
507
508
  this._signingKeys = null;
@@ -561,9 +562,9 @@ var p = f, m = class {
561
562
  if (e.debug("got key set", n), !Array.isArray(n.keys)) throw e.throw(/* @__PURE__ */ Error("Missing keys on keyset")), null;
562
563
  return this._signingKeys = n.keys, this._signingKeys;
563
564
  }
564
- }, D = class {
565
+ }, O = class {
565
566
  constructor({ prefix: e = "oidc.", store: t = localStorage } = {}) {
566
- this._logger = new c("WebStorageStateStore"), this._store = t, this._prefix = e;
567
+ this._logger = new l("WebStorageStateStore"), this._store = t, this._prefix = e;
567
568
  }
568
569
  async set(e, t) {
569
570
  this._logger.create(`set('${e}')`), e = this._prefix + e, await this._store.setItem(e, t);
@@ -585,26 +586,26 @@ var p = f, m = class {
585
586
  }
586
587
  return t;
587
588
  }
588
- }, ee = "code", O = "openid", te = "client_secret_post", k = 900, A = class {
589
- constructor({ authority: e, metadataUrl: t, metadata: n, signingKeys: r, metadataSeed: i, client_id: a, client_secret: o, response_type: s = ee, scope: c = O, redirect_uri: l, post_logout_redirect_uri: u, client_authentication: d = te, token_endpoint_auth_signing_alg: f = "HS256", prompt: p, display: m, max_age: h, ui_locales: g, acr_values: _, resource: v, response_mode: y, filterProtocolClaims: b = !0, loadUserInfo: x = !1, requestTimeoutInSeconds: S, staleStateAgeInSeconds: w = k, mergeClaimsStrategy: T = { array: "replace" }, disablePKCE: E = !1, stateStore: A, revokeTokenAdditionalContentTypes: j, fetchRequestCredentials: M, refreshTokenAllowedScope: N, extraQueryParams: P = {}, extraTokenParams: F = {}, extraHeaders: I = {}, dpop: L, omitScopeWhenRequesting: R = !1 }) {
590
- if (this.authority = e, t ? this.metadataUrl = t : (this.metadataUrl = e, e && (this.metadataUrl.endsWith("/") || (this.metadataUrl += "/"), this.metadataUrl += ".well-known/openid-configuration")), this.metadata = n, this.metadataSeed = i, this.signingKeys = r, this.client_id = a, this.client_secret = o, this.response_type = s, this.scope = c, this.redirect_uri = l, this.post_logout_redirect_uri = u, this.client_authentication = d, this.token_endpoint_auth_signing_alg = f, this.prompt = p, this.display = m, this.max_age = h, this.ui_locales = g, this.acr_values = _, this.resource = v, this.response_mode = y, this.filterProtocolClaims = b ?? !0, this.loadUserInfo = !!x, this.staleStateAgeInSeconds = w, this.mergeClaimsStrategy = T, this.omitScopeWhenRequesting = R, this.disablePKCE = !!E, this.revokeTokenAdditionalContentTypes = j, this.fetchRequestCredentials = M || "same-origin", this.requestTimeoutInSeconds = S, A) this.stateStore = A;
589
+ }, k = "code", A = "openid", j = "client_secret_post", ee = 900, M = class {
590
+ constructor({ authority: e, metadataUrl: t, metadata: n, signingKeys: r, metadataSeed: i, client_id: a, client_secret: o, response_type: s = k, scope: c = A, redirect_uri: l, post_logout_redirect_uri: u, client_authentication: d = j, token_endpoint_auth_signing_alg: f = "HS256", prompt: p, display: m, max_age: h, ui_locales: g, acr_values: _, resource: v, response_mode: y, filterProtocolClaims: b = !0, loadUserInfo: x = !1, requestTimeoutInSeconds: S, staleStateAgeInSeconds: C = ee, mergeClaimsStrategy: T = { array: "replace" }, disablePKCE: E = !1, stateStore: D, revokeTokenAdditionalContentTypes: M, fetchRequestCredentials: N, refreshTokenAllowedScope: P, extraQueryParams: F = {}, extraTokenParams: I = {}, extraHeaders: L = {}, dpop: R, omitScopeWhenRequesting: z = !1 }) {
591
+ if (this.authority = e, t ? this.metadataUrl = t : (this.metadataUrl = e, e && (this.metadataUrl.endsWith("/") || (this.metadataUrl += "/"), this.metadataUrl += ".well-known/openid-configuration")), this.metadata = n, this.metadataSeed = i, this.signingKeys = r, this.client_id = a, this.client_secret = o, this.response_type = s, this.scope = c, this.redirect_uri = l, this.post_logout_redirect_uri = u, this.client_authentication = d, this.token_endpoint_auth_signing_alg = f, this.prompt = p, this.display = m, this.max_age = h, this.ui_locales = g, this.acr_values = _, this.resource = v, this.response_mode = y, this.filterProtocolClaims = b ?? !0, this.loadUserInfo = !!x, this.staleStateAgeInSeconds = C, this.mergeClaimsStrategy = T, this.omitScopeWhenRequesting = z, this.disablePKCE = !!E, this.revokeTokenAdditionalContentTypes = M, this.fetchRequestCredentials = N || "same-origin", this.requestTimeoutInSeconds = S, D) this.stateStore = D;
591
592
  else {
592
- let e = typeof window < "u" ? window.localStorage : new C();
593
- this.stateStore = new D({ store: e });
593
+ let e = typeof window < "u" ? window.localStorage : new w();
594
+ this.stateStore = new O({ store: e });
594
595
  }
595
- if (this.refreshTokenAllowedScope = N, this.extraQueryParams = P, this.extraTokenParams = F, this.extraHeaders = I, this.dpop = L, this.dpop && !this.dpop?.store) throw Error("A DPoPStore is required when dpop is enabled");
596
+ if (this.refreshTokenAllowedScope = P, this.extraQueryParams = F, this.extraTokenParams = I, this.extraHeaders = L, this.dpop = R, this.dpop && !this.dpop?.store) throw Error("A DPoPStore is required when dpop is enabled");
596
597
  }
597
- }, j = class {
598
+ }, N = class {
598
599
  constructor(e, t) {
599
- this._settings = e, this._metadataService = t, this._logger = new c("UserInfoService"), this._getClaimsFromJwt = async (e) => {
600
+ this._settings = e, this._metadataService = t, this._logger = new l("UserInfoService"), this._getClaimsFromJwt = async (e) => {
600
601
  let t = this._logger.create("_getClaimsFromJwt");
601
602
  try {
602
- let n = l.decode(e);
603
+ let n = u.decode(e);
603
604
  return t.debug("JWT decoding successful"), n;
604
605
  } catch (e) {
605
606
  throw t.error("Error parsing JWT response"), e;
606
607
  }
607
- }, this._jsonService = new T(void 0, this._getClaimsFromJwt, this._settings.extraHeaders);
608
+ }, this._jsonService = new E(void 0, this._getClaimsFromJwt, this._settings.extraHeaders);
608
609
  }
609
610
  async getClaims(e) {
610
611
  let t = this._logger.create("getClaims");
@@ -618,9 +619,9 @@ var p = f, m = class {
618
619
  });
619
620
  return t.debug("got claims", r), r;
620
621
  }
621
- }, M = class {
622
+ }, P = class {
622
623
  constructor(e, t) {
623
- this._settings = e, this._metadataService = t, this._logger = new c("TokenClient"), this._jsonService = new T(this._settings.revokeTokenAdditionalContentTypes, null, this._settings.extraHeaders);
624
+ this._settings = e, this._metadataService = t, this._logger = new l("TokenClient"), this._jsonService = new E(this._settings.revokeTokenAdditionalContentTypes, null, this._settings.extraHeaders);
624
625
  }
625
626
  async exchangeCode({ grant_type: e = "authorization_code", redirect_uri: t = this._settings.redirect_uri, client_id: n = this._settings.client_id, client_secret: r = this._settings.client_secret, extraHeaders: i, ...a }) {
626
627
  let o = this._logger.create("exchangeCode");
@@ -634,13 +635,13 @@ var p = f, m = class {
634
635
  let c, l = await this._metadataService.getTokenEndpoint(!1);
635
636
  switch (this._settings.client_authentication) {
636
637
  case "client_secret_basic":
637
- c = p.generateBasicAuth(n, r);
638
+ c = m.generateBasicAuth(n, r);
638
639
  break;
639
640
  case "client_secret_post":
640
641
  s.append("client_id", n), r && s.append("client_secret", r);
641
642
  break;
642
643
  case "client_secret_jwt": {
643
- let e = await p.generateClientAssertionJwt(n, r, l, this._settings.token_endpoint_auth_signing_alg);
644
+ let e = await m.generateClientAssertionJwt(n, r, l, this._settings.token_endpoint_auth_signing_alg);
644
645
  s.append("client_id", n), s.append("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), s.append("client_assertion", e);
645
646
  break;
646
647
  }
@@ -665,13 +666,13 @@ var p = f, m = class {
665
666
  let s, c = await this._metadataService.getTokenEndpoint(!1);
666
667
  switch (this._settings.client_authentication) {
667
668
  case "client_secret_basic":
668
- s = p.generateBasicAuth(t, n);
669
+ s = m.generateBasicAuth(t, n);
669
670
  break;
670
671
  case "client_secret_post":
671
672
  o.append("client_id", t), n && o.append("client_secret", n);
672
673
  break;
673
674
  case "client_secret_jwt": {
674
- let e = await p.generateClientAssertionJwt(t, n, c, this._settings.token_endpoint_auth_signing_alg);
675
+ let e = await m.generateClientAssertionJwt(t, n, c, this._settings.token_endpoint_auth_signing_alg);
675
676
  o.append("client_id", t), o.append("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), o.append("client_assertion", e);
676
677
  break;
677
678
  }
@@ -694,13 +695,13 @@ var p = f, m = class {
694
695
  let c, l = await this._metadataService.getTokenEndpoint(!1);
695
696
  switch (this._settings.client_authentication) {
696
697
  case "client_secret_basic":
697
- c = p.generateBasicAuth(t, n);
698
+ c = m.generateBasicAuth(t, n);
698
699
  break;
699
700
  case "client_secret_post":
700
701
  s.append("client_id", t), n && s.append("client_secret", n);
701
702
  break;
702
703
  case "client_secret_jwt": {
703
- let e = await p.generateClientAssertionJwt(t, n, l, this._settings.token_endpoint_auth_signing_alg);
704
+ let e = await m.generateClientAssertionJwt(t, n, l, this._settings.token_endpoint_auth_signing_alg);
704
705
  s.append("client_id", t), s.append("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), s.append("client_assertion", e);
705
706
  break;
706
707
  }
@@ -727,9 +728,9 @@ var p = f, m = class {
727
728
  timeoutInSeconds: this._settings.requestTimeoutInSeconds
728
729
  }), t.debug("got response");
729
730
  }
730
- }, N = class {
731
+ }, F = class {
731
732
  constructor(e, t, n) {
732
- this._settings = e, this._metadataService = t, this._claimsService = n, this._logger = new c("ResponseValidator"), this._userInfoService = new j(this._settings, this._metadataService), this._tokenClient = new M(this._settings, this._metadataService);
733
+ this._settings = e, this._metadataService = t, this._claimsService = n, this._logger = new l("ResponseValidator"), this._userInfoService = new N(this._settings, this._metadataService), this._tokenClient = new P(this._settings, this._metadataService);
733
734
  }
734
735
  async validateSigninResponse(e, t, n) {
735
736
  let r = this._logger.create("validateSigninResponse");
@@ -747,11 +748,11 @@ var p = f, m = class {
747
748
  }
748
749
  validateSignoutResponse(e, t) {
749
750
  let n = this._logger.create("validateSignoutResponse");
750
- if (t.id !== e.state && n.throw(/* @__PURE__ */ Error("State does not match")), n.debug("state validated"), e.userState = t.data, e.error) throw n.warn("Response was error", e.error), new y(e);
751
+ if (t.id !== e.state && n.throw(/* @__PURE__ */ Error("State does not match")), n.debug("state validated"), e.userState = t.data, e.error) throw n.warn("Response was error", e.error), new b(e);
751
752
  }
752
753
  _processSigninState(e, t) {
753
754
  let n = this._logger.create("_processSigninState");
754
- if (t.id !== e.state && n.throw(/* @__PURE__ */ Error("State does not match")), t.client_id || n.throw(/* @__PURE__ */ Error("No client_id on state")), t.authority || n.throw(/* @__PURE__ */ Error("No authority on state")), this._settings.authority !== t.authority && n.throw(/* @__PURE__ */ Error("authority mismatch on settings vs. signin state")), this._settings.client_id && this._settings.client_id !== t.client_id && n.throw(/* @__PURE__ */ Error("client_id mismatch on settings vs. signin state")), n.debug("state validated"), e.userState = t.data, e.url_state = t.url_state, e.scope ??= t.scope, e.error) throw n.warn("Response was error", e.error), new y(e);
755
+ if (t.id !== e.state && n.throw(/* @__PURE__ */ Error("State does not match")), t.client_id || n.throw(/* @__PURE__ */ Error("No client_id on state")), t.authority || n.throw(/* @__PURE__ */ Error("No authority on state")), this._settings.authority !== t.authority && n.throw(/* @__PURE__ */ Error("authority mismatch on settings vs. signin state")), this._settings.client_id && this._settings.client_id !== t.client_id && n.throw(/* @__PURE__ */ Error("client_id mismatch on settings vs. signin state")), n.debug("state validated"), e.userState = t.data, e.url_state = t.url_state, e.scope ??= t.scope, e.error) throw n.warn("Response was error", e.error), new b(e);
755
756
  t.code_verifier && !e.code && n.throw(/* @__PURE__ */ Error("Expected code in response"));
756
757
  }
757
758
  async _processClaims(e, t = !1, n = !0) {
@@ -783,19 +784,19 @@ var p = f, m = class {
783
784
  _validateIdTokenAttributes(e, t, n) {
784
785
  let r = this._logger.create("_validateIdTokenAttributes");
785
786
  r.debug("decoding ID Token JWT");
786
- let i = l.decode(e.id_token ?? "");
787
+ let i = u.decode(e.id_token ?? "");
787
788
  if (i.sub || r.throw(/* @__PURE__ */ Error("ID Token is missing a subject claim")), n && i.nonce !== n && r.throw(/* @__PURE__ */ Error("nonce in id_token does not match nonce in client storage")), t) {
788
- let e = l.decode(t);
789
+ let e = u.decode(t);
789
790
  i.sub !== e.sub && r.throw(/* @__PURE__ */ Error("sub in id_token does not match current sub")), i.auth_time && i.auth_time !== e.auth_time && r.throw(/* @__PURE__ */ Error("auth_time in id_token does not match original auth_time")), i.azp && i.azp !== e.azp && r.throw(/* @__PURE__ */ Error("azp in id_token does not match original azp")), !i.azp && e.azp && r.throw(/* @__PURE__ */ Error("azp not in id_token, but present in original id_token"));
790
791
  }
791
792
  e.profile = i;
792
793
  }
793
- }, P = class e {
794
+ }, I = class e {
794
795
  constructor(e) {
795
- this.id = e.id || p.generateUUIDv4(), this.data = e.data, this.created = e.created && e.created > 0 ? e.created : g.getEpochTime(), this.request_type = e.request_type, this.url_state = e.url_state;
796
+ this.id = e.id || m.generateUUIDv4(), this.data = e.data, this.created = e.created && e.created > 0 ? e.created : _.getEpochTime(), this.request_type = e.request_type, this.url_state = e.url_state;
796
797
  }
797
798
  toStorageString() {
798
- return new c("State").create("toStorageString"), JSON.stringify({
799
+ return new l("State").create("toStorageString"), JSON.stringify({
799
800
  id: this.id,
800
801
  data: this.data,
801
802
  created: this.created,
@@ -804,10 +805,10 @@ var p = f, m = class {
804
805
  });
805
806
  }
806
807
  static fromStorageString(t) {
807
- return c.createStatic("State", "fromStorageString"), Promise.resolve(new e(JSON.parse(t)));
808
+ return l.createStatic("State", "fromStorageString"), Promise.resolve(new e(JSON.parse(t)));
808
809
  }
809
810
  static async clearStaleState(t, n) {
810
- let r = c.createStatic("State", "clearStaleState"), i = g.getEpochTime() - n, a = await t.getAllKeys();
811
+ let r = l.createStatic("State", "clearStaleState"), i = _.getEpochTime() - n, a = await t.getAllKeys();
811
812
  r.debug("got keys", a);
812
813
  for (let n = 0; n < a.length; n++) {
813
814
  let o = a[n], s = await t.get(o), c = !1;
@@ -821,12 +822,12 @@ var p = f, m = class {
821
822
  c && (r.debug("removed item for key:", o), t.remove(o));
822
823
  }
823
824
  }
824
- }, F = class e extends P {
825
+ }, L = class e extends I {
825
826
  constructor(e) {
826
827
  super(e), this.code_verifier = e.code_verifier, this.code_challenge = e.code_challenge, this.authority = e.authority, this.client_id = e.client_id, this.redirect_uri = e.redirect_uri, this.scope = e.scope, this.client_secret = e.client_secret, this.extraTokenParams = e.extraTokenParams, this.response_mode = e.response_mode, this.skipUserInfo = e.skipUserInfo, this.nonce = e.nonce;
827
828
  }
828
829
  static async create(t) {
829
- let n = t.code_verifier === !0 ? p.generateCodeVerifier() : t.code_verifier || void 0, r = n ? await p.generateCodeChallenge(n) : void 0;
830
+ let n = t.code_verifier === !0 ? m.generateCodeVerifier() : t.code_verifier || void 0, r = n ? await m.generateCodeChallenge(n) : void 0;
830
831
  return new e({
831
832
  ...t,
832
833
  code_verifier: n,
@@ -834,7 +835,7 @@ var p = f, m = class {
834
835
  });
835
836
  }
836
837
  toStorageString() {
837
- return new c("SigninState").create("toStorageString"), JSON.stringify({
838
+ return new l("SigninState").create("toStorageString"), JSON.stringify({
838
839
  id: this.id,
839
840
  data: this.data,
840
841
  created: this.created,
@@ -853,22 +854,22 @@ var p = f, m = class {
853
854
  });
854
855
  }
855
856
  static fromStorageString(t) {
856
- c.createStatic("SigninState", "fromStorageString");
857
+ l.createStatic("SigninState", "fromStorageString");
857
858
  let n = JSON.parse(t);
858
859
  return e.create(n);
859
860
  }
860
- }, I = class e {
861
+ }, R = class e {
861
862
  constructor(e) {
862
863
  this.url = e.url, this.state = e.state;
863
864
  }
864
- static async create({ url: t, authority: n, client_id: r, redirect_uri: i, response_type: a, scope: o, state_data: s, response_mode: c, request_type: l, client_secret: u, nonce: d, url_state: f, resource: p, skipUserInfo: m, extraQueryParams: h, extraTokenParams: g, disablePKCE: _, dpopJkt: y, omitScopeWhenRequesting: b, ...x }) {
865
+ static async create({ url: t, authority: n, client_id: r, redirect_uri: i, response_type: a, scope: o, state_data: s, response_mode: c, request_type: l, client_secret: u, nonce: d, url_state: f, resource: p, skipUserInfo: m, extraQueryParams: h, extraTokenParams: g, disablePKCE: _, dpopJkt: v, omitScopeWhenRequesting: b, ...x }) {
865
866
  if (!t) throw this._logger.error("create: No url passed"), Error("url");
866
867
  if (!r) throw this._logger.error("create: No client_id passed"), Error("client_id");
867
868
  if (!i) throw this._logger.error("create: No redirect_uri passed"), Error("redirect_uri");
868
869
  if (!a) throw this._logger.error("create: No response_type passed"), Error("response_type");
869
870
  if (!o) throw this._logger.error("create: No scope passed"), Error("scope");
870
871
  if (!n) throw this._logger.error("create: No authority passed"), Error("authority");
871
- let S = await F.create({
872
+ let S = await L.create({
872
873
  data: s,
873
874
  request_type: l,
874
875
  url_state: f,
@@ -883,9 +884,9 @@ var p = f, m = class {
883
884
  skipUserInfo: m,
884
885
  nonce: d
885
886
  }), C = new URL(t);
886
- C.searchParams.append("client_id", r), C.searchParams.append("redirect_uri", i), C.searchParams.append("response_type", a), b || C.searchParams.append("scope", o), d && C.searchParams.append("nonce", d), y && C.searchParams.append("dpop_jkt", y);
887
+ C.searchParams.append("client_id", r), C.searchParams.append("redirect_uri", i), C.searchParams.append("response_type", a), b || C.searchParams.append("scope", o), d && C.searchParams.append("nonce", d), v && C.searchParams.append("dpop_jkt", v);
887
888
  let w = S.id;
888
- f && (w = `${w}${v}${f}`), C.searchParams.append("state", w), S.code_challenge && (C.searchParams.append("code_challenge", S.code_challenge), C.searchParams.append("code_challenge_method", "S256")), p && (Array.isArray(p) ? p : [p]).forEach((e) => C.searchParams.append("resource", e));
889
+ f && (w = `${w}${y}${f}`), C.searchParams.append("state", w), S.code_challenge && (C.searchParams.append("code_challenge", S.code_challenge), C.searchParams.append("code_challenge_method", "S256")), p && (Array.isArray(p) ? p : [p]).forEach((e) => C.searchParams.append("resource", e));
889
890
  for (let [e, t] of Object.entries({
890
891
  response_mode: c,
891
892
  ...x,
@@ -897,49 +898,49 @@ var p = f, m = class {
897
898
  });
898
899
  }
899
900
  };
900
- I._logger = new c("SigninRequest");
901
- var L = I, R = "openid", z = class {
901
+ R._logger = new l("SigninRequest");
902
+ var z = R, te = "openid", B = class {
902
903
  constructor(e) {
903
904
  if (this.access_token = "", this.token_type = "", this.profile = {}, this.state = e.get("state"), this.session_state = e.get("session_state"), this.state) {
904
- let e = decodeURIComponent(this.state).split(v);
905
- this.state = e[0], e.length > 1 && (this.url_state = e.slice(1).join(v));
905
+ let e = decodeURIComponent(this.state).split(y);
906
+ this.state = e[0], e.length > 1 && (this.url_state = e.slice(1).join(y));
906
907
  }
907
908
  this.error = e.get("error"), this.error_description = e.get("error_description"), this.error_uri = e.get("error_uri"), this.code = e.get("code");
908
909
  }
909
910
  get expires_in() {
910
- if (this.expires_at !== void 0) return this.expires_at - g.getEpochTime();
911
+ if (this.expires_at !== void 0) return this.expires_at - _.getEpochTime();
911
912
  }
912
913
  set expires_in(e) {
913
- typeof e == "string" && (e = Number(e)), e !== void 0 && e >= 0 && (this.expires_at = Math.floor(e) + g.getEpochTime());
914
+ typeof e == "string" && (e = Number(e)), e !== void 0 && e >= 0 && (this.expires_at = Math.floor(e) + _.getEpochTime());
914
915
  }
915
916
  get isOpenId() {
916
- return this.scope?.split(" ").includes(R) || !!this.id_token;
917
+ return this.scope?.split(" ").includes(te) || !!this.id_token;
917
918
  }
918
- }, B = class {
919
+ }, V = class {
919
920
  constructor({ url: e, state_data: t, id_token_hint: n, post_logout_redirect_uri: r, extraQueryParams: i, request_type: a, client_id: o, url_state: s }) {
920
- if (this._logger = new c("SignoutRequest"), !e) throw this._logger.error("ctor: No url passed"), Error("url");
921
- let l = new URL(e);
922
- if (n && l.searchParams.append("id_token_hint", n), o && l.searchParams.append("client_id", o), r && (l.searchParams.append("post_logout_redirect_uri", r), t || s)) {
923
- this.state = new P({
921
+ if (this._logger = new l("SignoutRequest"), !e) throw this._logger.error("ctor: No url passed"), Error("url");
922
+ let c = new URL(e);
923
+ if (n && c.searchParams.append("id_token_hint", n), o && c.searchParams.append("client_id", o), r && (c.searchParams.append("post_logout_redirect_uri", r), t || s)) {
924
+ this.state = new I({
924
925
  data: t,
925
926
  request_type: a,
926
927
  url_state: s
927
928
  });
928
929
  let e = this.state.id;
929
- s && (e = `${e}${v}${s}`), l.searchParams.append("state", e);
930
+ s && (e = `${e}${y}${s}`), c.searchParams.append("state", e);
930
931
  }
931
- for (let [e, t] of Object.entries({ ...i })) t != null && l.searchParams.append(e, t.toString());
932
- this.url = l.href;
932
+ for (let [e, t] of Object.entries({ ...i })) t != null && c.searchParams.append(e, t.toString());
933
+ this.url = c.href;
933
934
  }
934
- }, V = class {
935
+ }, ne = class {
935
936
  constructor(e) {
936
937
  if (this.state = e.get("state"), this.state) {
937
- let e = decodeURIComponent(this.state).split(v);
938
- this.state = e[0], e.length > 1 && (this.url_state = e.slice(1).join(v));
938
+ let e = decodeURIComponent(this.state).split(y);
939
+ this.state = e[0], e.length > 1 && (this.url_state = e.slice(1).join(y));
939
940
  }
940
941
  this.error = e.get("error"), this.error_description = e.get("error_description"), this.error_uri = e.get("error_uri");
941
942
  }
942
- }, H = [
943
+ }, re = [
943
944
  "nbf",
944
945
  "jti",
945
946
  "auth_time",
@@ -948,22 +949,22 @@ var L = I, R = "openid", z = class {
948
949
  "amr",
949
950
  "azp",
950
951
  "at_hash"
951
- ], ne = [
952
+ ], ie = [
952
953
  "sub",
953
954
  "iss",
954
955
  "aud",
955
956
  "exp",
956
957
  "iat"
957
- ], re = class {
958
+ ], ae = class {
958
959
  constructor(e) {
959
- this._settings = e, this._logger = new c("ClaimsService");
960
+ this._settings = e, this._logger = new l("ClaimsService");
960
961
  }
961
962
  filterProtocolClaims(e) {
962
963
  let t = { ...e };
963
964
  if (this._settings.filterProtocolClaims) {
964
965
  let e;
965
- e = Array.isArray(this._settings.filterProtocolClaims) ? this._settings.filterProtocolClaims : H;
966
- for (let n of e) ne.includes(n) || delete t[n];
966
+ e = Array.isArray(this._settings.filterProtocolClaims) ? this._settings.filterProtocolClaims : re;
967
+ for (let n of e) ie.includes(n) || delete t[n];
967
968
  }
968
969
  return t;
969
970
  }
@@ -981,20 +982,20 @@ var L = I, R = "openid", z = class {
981
982
  }
982
983
  return n;
983
984
  }
984
- }, U = class {
985
+ }, H = class {
985
986
  constructor(e, t) {
986
987
  this.keys = e, this.nonce = t;
987
988
  }
988
- }, ie = class {
989
+ }, U = class {
989
990
  constructor(e, t) {
990
- this._logger = new c("OidcClient"), this.settings = e instanceof A ? e : new A(e), this.metadataService = t ?? new E(this.settings), this._claimsService = new re(this.settings), this._validator = new N(this.settings, this.metadataService, this._claimsService), this._tokenClient = new M(this.settings, this.metadataService);
991
+ this._logger = new l("OidcClient"), this.settings = e instanceof M ? e : new M(e), this.metadataService = t ?? new D(this.settings), this._claimsService = new ae(this.settings), this._validator = new F(this.settings, this.metadataService, this._claimsService), this._tokenClient = new P(this.settings, this.metadataService);
991
992
  }
992
993
  async createSigninRequest({ state: e, request: t, request_uri: n, request_type: r, id_token_hint: i, login_hint: a, skipUserInfo: o, nonce: s, url_state: c, response_type: l = this.settings.response_type, scope: u = this.settings.scope, redirect_uri: d = this.settings.redirect_uri, prompt: f = this.settings.prompt, display: p = this.settings.display, max_age: m = this.settings.max_age, ui_locales: h = this.settings.ui_locales, acr_values: g = this.settings.acr_values, resource: _ = this.settings.resource, response_mode: v = this.settings.response_mode, extraQueryParams: y = this.settings.extraQueryParams, extraTokenParams: b = this.settings.extraTokenParams, dpopJkt: x, omitScopeWhenRequesting: S = this.settings.omitScopeWhenRequesting }) {
993
994
  let C = this._logger.create("createSigninRequest");
994
995
  if (l !== "code") throw Error("Only the Authorization Code flow (with PKCE) is supported");
995
996
  let w = await this.metadataService.getAuthorizationEndpoint();
996
997
  C.debug("Received authorization endpoint", w);
997
- let T = await L.create({
998
+ let T = await z.create({
998
999
  url: w,
999
1000
  authority: this.settings.authority,
1000
1001
  client_id: this.settings.client_id,
@@ -1029,12 +1030,12 @@ var L = I, R = "openid", z = class {
1029
1030
  return await this.settings.stateStore.set(E.id, E.toStorageString()), T;
1030
1031
  }
1031
1032
  async readSigninResponseState(e, t = !1) {
1032
- let n = this._logger.create("readSigninResponseState"), r = new z(_.readParams(e, this.settings.response_mode));
1033
+ let n = this._logger.create("readSigninResponseState"), r = new B(v.readParams(e, this.settings.response_mode));
1033
1034
  if (!r.state) throw n.throw(/* @__PURE__ */ Error("No state in response")), null;
1034
1035
  let i = await this.settings.stateStore[t ? "remove" : "get"](r.state);
1035
1036
  if (!i) throw n.throw(/* @__PURE__ */ Error("No matching state found in storage")), null;
1036
1037
  return {
1037
- state: await F.fromStorageString(i),
1038
+ state: await L.fromStorageString(i),
1038
1039
  response: r
1039
1040
  };
1040
1041
  }
@@ -1050,7 +1051,7 @@ var L = I, R = "openid", z = class {
1050
1051
  try {
1051
1052
  await this._validator.validateSigninResponse(a, i, t);
1052
1053
  } catch (e) {
1053
- if (e instanceof w && this.settings.dpop) {
1054
+ if (e instanceof T && this.settings.dpop) {
1054
1055
  let n = await this.getDpopProof(this.settings.dpop.store, e.nonce);
1055
1056
  t.DPoP = n, await this._validator.validateSigninResponse(a, i, t);
1056
1057
  } else throw e;
@@ -1059,7 +1060,7 @@ var L = I, R = "openid", z = class {
1059
1060
  }
1060
1061
  async getDpopProof(e, t) {
1061
1062
  let n, r;
1062
- return (await e.getAllKeys()).includes(this.settings.client_id) ? (r = await e.get(this.settings.client_id), r.nonce !== t && t && (r.nonce = t, await e.set(this.settings.client_id, r))) : (n = await p.generateDPoPKeys(), r = new U(n, t), await e.set(this.settings.client_id, r)), await p.generateDPoPProof({
1063
+ return (await e.getAllKeys()).includes(this.settings.client_id) ? (r = await e.get(this.settings.client_id), r.nonce !== t && t && (r.nonce = t, await e.set(this.settings.client_id, r))) : (n = await m.generateDPoPKeys(), r = new H(n, t), await e.set(this.settings.client_id, r)), await m.generateDPoPProof({
1063
1064
  url: await this.metadataService.getTokenEndpoint(!1),
1064
1065
  httpMethod: "POST",
1065
1066
  keyPair: r.keys,
@@ -1071,7 +1072,7 @@ var L = I, R = "openid", z = class {
1071
1072
  username: e,
1072
1073
  password: t,
1073
1074
  ...r
1074
- }), a = new z(new URLSearchParams());
1075
+ }), a = new B(new URLSearchParams());
1075
1076
  return Object.assign(a, i), await this._validator.validateCredentialsResponse(a, n), a;
1076
1077
  }
1077
1078
  async useRefreshToken({ state: e, redirect_uri: t, resource: n, timeoutInSeconds: r, extraHeaders: i, extraTokenParams: a }) {
@@ -1100,7 +1101,7 @@ var L = I, R = "openid", z = class {
1100
1101
  ...a
1101
1102
  });
1102
1103
  } catch (o) {
1103
- if (o instanceof w && this.settings.dpop) i.DPoP = await this.getDpopProof(this.settings.dpop.store, o.nonce), c = await this._tokenClient.exchangeRefreshToken({
1104
+ if (o instanceof T && this.settings.dpop) i.DPoP = await this.getDpopProof(this.settings.dpop.store, o.nonce), c = await this._tokenClient.exchangeRefreshToken({
1104
1105
  refresh_token: e.refresh_token,
1105
1106
  scope: s,
1106
1107
  redirect_uri: t,
@@ -1111,7 +1112,7 @@ var L = I, R = "openid", z = class {
1111
1112
  });
1112
1113
  else throw o;
1113
1114
  }
1114
- let l = new z(new URLSearchParams());
1115
+ let l = new B(new URLSearchParams());
1115
1116
  return Object.assign(l, c), o.debug("validating response", l), await this._validator.validateRefreshResponse(l, {
1116
1117
  ...e,
1117
1118
  scope: s
@@ -1121,7 +1122,7 @@ var L = I, R = "openid", z = class {
1121
1122
  let s = this._logger.create("createSignoutRequest"), c = await this.metadataService.getEndSessionEndpoint();
1122
1123
  if (!c) throw s.throw(/* @__PURE__ */ Error("No end session endpoint")), null;
1123
1124
  s.debug("Received end session endpoint", c), !n && a && !t && (n = this.settings.client_id);
1124
- let l = new B({
1125
+ let l = new V({
1125
1126
  url: c,
1126
1127
  id_token_hint: t,
1127
1128
  client_id: n,
@@ -1136,9 +1137,9 @@ var L = I, R = "openid", z = class {
1136
1137
  return u && (s.debug("Signout request has state to persist"), await this.settings.stateStore.set(u.id, u.toStorageString())), l;
1137
1138
  }
1138
1139
  async readSignoutResponseState(e, t = !1) {
1139
- let n = this._logger.create("readSignoutResponseState"), r = new V(_.readParams(e, this.settings.response_mode));
1140
+ let n = this._logger.create("readSignoutResponseState"), r = new ne(v.readParams(e, this.settings.response_mode));
1140
1141
  if (!r.state) {
1141
- if (n.debug("No state in response"), r.error) throw n.warn("Response was error:", r.error), new y(r);
1142
+ if (n.debug("No state in response"), r.error) throw n.warn("Response was error:", r.error), new b(r);
1142
1143
  return {
1143
1144
  state: void 0,
1144
1145
  response: r
@@ -1147,7 +1148,7 @@ var L = I, R = "openid", z = class {
1147
1148
  let i = await this.settings.stateStore[t ? "remove" : "get"](r.state);
1148
1149
  if (!i) throw n.throw(/* @__PURE__ */ Error("No matching state found in storage")), null;
1149
1150
  return {
1150
- state: await P.fromStorageString(i),
1151
+ state: await I.fromStorageString(i),
1151
1152
  response: r
1152
1153
  };
1153
1154
  }
@@ -1156,7 +1157,7 @@ var L = I, R = "openid", z = class {
1156
1157
  return n ? (t.debug("Received state from storage; validating response"), this._validator.validateSignoutResponse(r, n)) : t.debug("No state from storage; skipping response validation"), r;
1157
1158
  }
1158
1159
  clearStaleState() {
1159
- return this._logger.create("clearStaleState"), P.clearStaleState(this.settings.stateStore, this.settings.staleStateAgeInSeconds);
1160
+ return this._logger.create("clearStaleState"), I.clearStaleState(this.settings.stateStore, this.settings.staleStateAgeInSeconds);
1160
1161
  }
1161
1162
  async revokeToken(e, t) {
1162
1163
  return this._logger.create("revokeToken"), await this._tokenClient.revoke({
@@ -1166,7 +1167,7 @@ var L = I, R = "openid", z = class {
1166
1167
  }
1167
1168
  }, W = class {
1168
1169
  constructor(e) {
1169
- this._userManager = e, this._logger = new c("SessionMonitor"), this._start = async (e) => {
1170
+ this._userManager = e, this._logger = new l("SessionMonitor"), this._start = async (e) => {
1170
1171
  let t = e.session_state;
1171
1172
  if (!t) return;
1172
1173
  let n = this._logger.create("_start");
@@ -1178,7 +1179,7 @@ var L = I, R = "openid", z = class {
1178
1179
  let e = await this._userManager.metadataService.getCheckSessionIframe();
1179
1180
  if (e) {
1180
1181
  n.debug("initializing check session iframe");
1181
- let r = this._userManager.settings.client_id, i = this._userManager.settings.checkSessionIntervalInSeconds, a = this._userManager.settings.stopCheckSessionOnError, o = new S(this._callback, r, e, i, a);
1182
+ let r = this._userManager.settings.client_id, i = this._userManager.settings.checkSessionIntervalInSeconds, a = this._userManager.settings.stopCheckSessionOnError, o = new C(this._callback, r, e, i, a);
1182
1183
  await o.load(), this._checkSessionIFrame = o, o.start(t);
1183
1184
  } else n.warn("no check session iframe found in the metadata");
1184
1185
  } catch (e) {
@@ -1235,10 +1236,10 @@ var L = I, R = "openid", z = class {
1235
1236
  this.id_token = e.id_token, this.session_state = e.session_state ?? null, this.access_token = e.access_token, this.refresh_token = e.refresh_token, this.token_type = e.token_type, this.scope = e.scope, this.profile = e.profile, this.expires_at = e.expires_at, this.state = e.userState, this.url_state = e.url_state;
1236
1237
  }
1237
1238
  get expires_in() {
1238
- if (this.expires_at !== void 0) return this.expires_at - g.getEpochTime();
1239
+ if (this.expires_at !== void 0) return this.expires_at - _.getEpochTime();
1239
1240
  }
1240
1241
  set expires_in(e) {
1241
- e !== void 0 && (this.expires_at = Math.floor(e) + g.getEpochTime());
1242
+ e !== void 0 && (this.expires_at = Math.floor(e) + _.getEpochTime());
1242
1243
  }
1243
1244
  get expired() {
1244
1245
  let e = this.expires_in;
@@ -1248,7 +1249,7 @@ var L = I, R = "openid", z = class {
1248
1249
  return this.scope?.split(" ") ?? [];
1249
1250
  }
1250
1251
  toStorageString() {
1251
- return new c("User").create("toStorageString"), JSON.stringify({
1252
+ return new l("User").create("toStorageString"), JSON.stringify({
1252
1253
  id_token: this.id_token,
1253
1254
  session_state: this.session_state,
1254
1255
  access_token: this.access_token,
@@ -1260,11 +1261,11 @@ var L = I, R = "openid", z = class {
1260
1261
  });
1261
1262
  }
1262
1263
  static fromStorageString(t) {
1263
- return c.createStatic("User", "fromStorageString"), new e(JSON.parse(t));
1264
+ return l.createStatic("User", "fromStorageString"), new e(JSON.parse(t));
1264
1265
  }
1265
1266
  }, K = "oidc-client", q = class {
1266
1267
  constructor() {
1267
- this._abort = new m("Window navigation aborted"), this._disposeHandlers = /* @__PURE__ */ new Set(), this._window = null;
1268
+ this._abort = new h("Window navigation aborted"), this._disposeHandlers = /* @__PURE__ */ new Set(), this._window = null;
1268
1269
  }
1269
1270
  async navigate(e) {
1270
1271
  let t = this._logger.create("navigate");
@@ -1275,7 +1276,7 @@ var L = I, R = "openid", z = class {
1275
1276
  let a = i.data, o = e.scriptOrigin ?? window.location.origin;
1276
1277
  if (i.origin === o && a?.source === K) {
1277
1278
  try {
1278
- let n = _.readParams(a.url, e.response_mode).get("state");
1279
+ let n = v.readParams(a.url, e.response_mode).get("state");
1279
1280
  if (n || t.warn("no state found in response url"), i.source !== this._window && n !== e.state) return;
1280
1281
  } catch {
1281
1282
  this._dispose(), r(/* @__PURE__ */ Error("Invalid response from window"));
@@ -1301,7 +1302,7 @@ var L = I, R = "openid", z = class {
1301
1302
  source: K,
1302
1303
  url: t,
1303
1304
  keepOpen: n
1304
- }, a = new c("_notifyParent");
1305
+ }, a = new l("_notifyParent");
1305
1306
  if (e) a.debug("With parent. Using parent.postMessage."), e.postMessage(i, r);
1306
1307
  else {
1307
1308
  a.debug("No parent. Using BroadcastChannel.");
@@ -1316,18 +1317,18 @@ var L = I, R = "openid", z = class {
1316
1317
  toolbar: !1,
1317
1318
  height: 640,
1318
1319
  closePopupWindowAfterInSeconds: -1
1319
- }, Y = "_blank", ae = 60, oe = 2, X = 10, se = class extends A {
1320
+ }, Y = "_blank", oe = 60, se = 2, X = 10, ce = class extends M {
1320
1321
  constructor(e) {
1321
- let { popup_redirect_uri: t = e.redirect_uri, popup_post_logout_redirect_uri: n = e.post_logout_redirect_uri, popupWindowFeatures: r = J, popupWindowTarget: i = Y, redirectMethod: a = "assign", redirectTarget: o = "self", iframeNotifyParentOrigin: s = e.iframeNotifyParentOrigin, iframeScriptOrigin: c = e.iframeScriptOrigin, requestTimeoutInSeconds: l, silent_redirect_uri: u = e.redirect_uri, silentRequestTimeoutInSeconds: d, automaticSilentRenew: f = !0, validateSubOnSilentRenew: p = !0, includeIdTokenInSilentRenew: m = !1, monitorSession: h = !1, monitorAnonymousSession: g = !1, checkSessionIntervalInSeconds: _ = oe, query_status_response_type: v = "code", stopCheckSessionOnError: y = !0, revokeTokenTypes: b = ["access_token", "refresh_token"], revokeTokensOnSignout: x = !1, includeIdTokenInSilentSignout: S = !1, accessTokenExpiringNotificationTimeInSeconds: w = ae, maxSilentRenewTimeoutRetries: T, userStore: E } = e;
1322
- if (super(e), this.popup_redirect_uri = t, this.popup_post_logout_redirect_uri = n, this.popupWindowFeatures = r, this.popupWindowTarget = i, this.redirectMethod = a, this.redirectTarget = o, this.iframeNotifyParentOrigin = s, this.iframeScriptOrigin = c, this.silent_redirect_uri = u, this.silentRequestTimeoutInSeconds = d || l || X, this.automaticSilentRenew = f, this.validateSubOnSilentRenew = p, this.includeIdTokenInSilentRenew = m, this.monitorSession = h, this.monitorAnonymousSession = g, this.checkSessionIntervalInSeconds = _, this.stopCheckSessionOnError = y, this.query_status_response_type = v, this.revokeTokenTypes = b, this.revokeTokensOnSignout = x, this.includeIdTokenInSilentSignout = S, this.accessTokenExpiringNotificationTimeInSeconds = w, this.maxSilentRenewTimeoutRetries = T, E) this.userStore = E;
1322
+ let { popup_redirect_uri: t = e.redirect_uri, popup_post_logout_redirect_uri: n = e.post_logout_redirect_uri, popupWindowFeatures: r = J, popupWindowTarget: i = Y, redirectMethod: a = "assign", redirectTarget: o = "self", iframeNotifyParentOrigin: s = e.iframeNotifyParentOrigin, iframeScriptOrigin: c = e.iframeScriptOrigin, requestTimeoutInSeconds: l, silent_redirect_uri: u = e.redirect_uri, silentRequestTimeoutInSeconds: d, automaticSilentRenew: f = !0, validateSubOnSilentRenew: p = !0, includeIdTokenInSilentRenew: m = !1, monitorSession: h = !1, monitorAnonymousSession: g = !1, checkSessionIntervalInSeconds: _ = se, query_status_response_type: v = "code", stopCheckSessionOnError: y = !0, revokeTokenTypes: b = ["access_token", "refresh_token"], revokeTokensOnSignout: x = !1, includeIdTokenInSilentSignout: S = !1, accessTokenExpiringNotificationTimeInSeconds: C = oe, maxSilentRenewTimeoutRetries: T, userStore: E } = e;
1323
+ if (super(e), this.popup_redirect_uri = t, this.popup_post_logout_redirect_uri = n, this.popupWindowFeatures = r, this.popupWindowTarget = i, this.redirectMethod = a, this.redirectTarget = o, this.iframeNotifyParentOrigin = s, this.iframeScriptOrigin = c, this.silent_redirect_uri = u, this.silentRequestTimeoutInSeconds = d || l || X, this.automaticSilentRenew = f, this.validateSubOnSilentRenew = p, this.includeIdTokenInSilentRenew = m, this.monitorSession = h, this.monitorAnonymousSession = g, this.checkSessionIntervalInSeconds = _, this.stopCheckSessionOnError = y, this.query_status_response_type = v, this.revokeTokenTypes = b, this.revokeTokensOnSignout = x, this.includeIdTokenInSilentSignout = S, this.accessTokenExpiringNotificationTimeInSeconds = C, this.maxSilentRenewTimeoutRetries = T, E) this.userStore = E;
1323
1324
  else {
1324
- let e = typeof window < "u" ? window.sessionStorage : new C();
1325
- this.userStore = new D({ store: e });
1325
+ let e = typeof window < "u" ? window.sessionStorage : new w();
1326
+ this.userStore = new O({ store: e });
1326
1327
  }
1327
1328
  }
1328
1329
  }, Z = class e extends q {
1329
1330
  constructor({ silentRequestTimeoutInSeconds: t = X }) {
1330
- super(), this._logger = new c("IFrameWindow"), this._timeoutInSeconds = t, this._frame = e.createHiddenIframe(), this._window = this._frame.contentWindow;
1331
+ super(), this._logger = new l("IFrameWindow"), this._timeoutInSeconds = t, this._frame = e.createHiddenIframe(), this._window = this._frame.contentWindow;
1331
1332
  }
1332
1333
  static createHiddenIframe() {
1333
1334
  let e = window.document.createElement("iframe");
@@ -1335,7 +1336,7 @@ var L = I, R = "openid", z = class {
1335
1336
  }
1336
1337
  async navigate(e) {
1337
1338
  this._logger.debug("navigate: Using timeout of:", this._timeoutInSeconds);
1338
- let t = setTimeout(() => void this._abort.raise(new b("IFrame timed out without a response")), this._timeoutInSeconds * 1e3);
1339
+ let t = setTimeout(() => void this._abort.raise(new x("IFrame timed out without a response")), this._timeoutInSeconds * 1e3);
1339
1340
  return this._disposeHandlers.add(() => clearTimeout(t)), await super.navigate(e);
1340
1341
  }
1341
1342
  close() {
@@ -1349,9 +1350,9 @@ var L = I, R = "openid", z = class {
1349
1350
  static notifyParent(e, t) {
1350
1351
  return super._notifyParent(window.parent, e, !1, t);
1351
1352
  }
1352
- }, ce = class {
1353
+ }, le = class {
1353
1354
  constructor(e) {
1354
- this._settings = e, this._logger = new c("IFrameNavigator");
1355
+ this._settings = e, this._logger = new l("IFrameNavigator");
1355
1356
  }
1356
1357
  async prepare({ silentRequestTimeoutInSeconds: e = this._settings.silentRequestTimeoutInSeconds }) {
1357
1358
  return new Z({ silentRequestTimeoutInSeconds: e });
@@ -1359,14 +1360,14 @@ var L = I, R = "openid", z = class {
1359
1360
  async callback(e) {
1360
1361
  this._logger.create("callback"), Z.notifyParent(e, this._settings.iframeNotifyParentOrigin);
1361
1362
  }
1362
- }, le = 500, ue = 1e3, Q = class extends q {
1363
+ }, ue = 500, de = 1e3, Q = class extends q {
1363
1364
  constructor({ popupWindowTarget: e = Y, popupWindowFeatures: t = {}, popupSignal: n, popupAbortOnClose: r }) {
1364
- super(), this._logger = new c("PopupWindow");
1365
- let i = h.center({
1365
+ super(), this._logger = new l("PopupWindow");
1366
+ let i = g.center({
1366
1367
  ...J,
1367
1368
  ...t
1368
1369
  });
1369
- this._window = window.open(void 0, e, h.serialize(i)), this.abortOnClose = !!r, n && n.addEventListener("abort", () => {
1370
+ this._window = window.open(void 0, e, g.serialize(i)), this.abortOnClose = !!r, n && n.addEventListener("abort", () => {
1370
1371
  this._abort.raise(Error(n.reason ?? "Popup aborted"));
1371
1372
  }), t.closePopupWindowAfterInSeconds && t.closePopupWindowAfterInSeconds > 0 && setTimeout(() => {
1372
1373
  if (!this._window || typeof this._window.closed != "boolean" || this._window.closed) {
@@ -1374,14 +1375,14 @@ var L = I, R = "openid", z = class {
1374
1375
  return;
1375
1376
  }
1376
1377
  this.close();
1377
- }, t.closePopupWindowAfterInSeconds * ue);
1378
+ }, t.closePopupWindowAfterInSeconds * de);
1378
1379
  }
1379
1380
  async navigate(e) {
1380
1381
  var t;
1381
1382
  (t = this._window) == null || t.focus();
1382
1383
  let n = setInterval(() => {
1383
1384
  (!this._window || this._window.closed) && (this._logger.debug("Popup closed by user or isolated by redirect"), r(), this._disposeHandlers.delete(r), this.abortOnClose && this._abort.raise(/* @__PURE__ */ Error("Popup closed by user")));
1384
- }, le), r = () => clearInterval(n);
1385
+ }, ue), r = () => clearInterval(n);
1385
1386
  return this._disposeHandlers.add(r), await super.navigate(e);
1386
1387
  }
1387
1388
  close() {
@@ -1392,7 +1393,7 @@ var L = I, R = "openid", z = class {
1392
1393
  }
1393
1394
  }, $ = class {
1394
1395
  constructor(e) {
1395
- this._settings = e, this._logger = new c("PopupNavigator");
1396
+ this._settings = e, this._logger = new l("PopupNavigator");
1396
1397
  }
1397
1398
  async prepare({ popupWindowFeatures: e = this._settings.popupWindowFeatures, popupWindowTarget: t = this._settings.popupWindowTarget, popupSignal: n, popupAbortOnClose: r }) {
1398
1399
  return new Q({
@@ -1405,9 +1406,9 @@ var L = I, R = "openid", z = class {
1405
1406
  async callback(e, { keepOpen: t = !1 }) {
1406
1407
  this._logger.create("callback"), Q.notifyOpener(e, t);
1407
1408
  }
1408
- }, de = class {
1409
+ }, fe = class {
1409
1410
  constructor(e) {
1410
- this._settings = e, this._logger = new c("RedirectNavigator");
1411
+ this._settings = e, this._logger = new l("RedirectNavigator");
1411
1412
  }
1412
1413
  async prepare({ redirectMethod: e = this._settings.redirectMethod, redirectTarget: t = this._settings.redirectTarget }) {
1413
1414
  this._logger.create("prepare");
@@ -1424,9 +1425,9 @@ var L = I, R = "openid", z = class {
1424
1425
  };
1425
1426
  }
1426
1427
  async callback() {}
1427
- }, fe = class extends x {
1428
+ }, pe = class extends S {
1428
1429
  constructor(e) {
1429
- super({ expiringNotificationTimeInSeconds: e.accessTokenExpiringNotificationTimeInSeconds }), this._logger = new c("UserManagerEvents"), this._userLoaded = new m("User loaded"), this._userUnloaded = new m("User unloaded"), this._silentRenewError = new m("Silent renew error"), this._userSignedIn = new m("User signed in"), this._userSignedOut = new m("User signed out"), this._userSessionChanged = new m("User session changed");
1430
+ super({ expiringNotificationTimeInSeconds: e.accessTokenExpiringNotificationTimeInSeconds }), this._logger = new l("UserManagerEvents"), this._userLoaded = new h("User loaded"), this._userUnloaded = new h("User unloaded"), this._silentRenewError = new h("Silent renew error"), this._userSignedIn = new h("User signed in"), this._userSignedOut = new h("User signed out"), this._userSessionChanged = new h("User session changed");
1430
1431
  }
1431
1432
  async load(e, t = !0) {
1432
1433
  await super.load(e), t && await this._userLoaded.raise(e);
@@ -1482,14 +1483,14 @@ var L = I, R = "openid", z = class {
1482
1483
  async _raiseUserSessionChanged() {
1483
1484
  await this._userSessionChanged.raise();
1484
1485
  }
1485
- }, pe = class {
1486
+ }, me = class {
1486
1487
  constructor(e) {
1487
- this._userManager = e, this._logger = new c("SilentRenewService"), this._isStarted = !1, this._retryTimer = new g("Retry Silent Renew"), this._timeoutRetryCount = 0, this._tokenExpiring = async () => {
1488
+ this._userManager = e, this._logger = new l("SilentRenewService"), this._isStarted = !1, this._retryTimer = new _("Retry Silent Renew"), this._timeoutRetryCount = 0, this._tokenExpiring = async () => {
1488
1489
  let e = this._logger.create("_tokenExpiring");
1489
1490
  try {
1490
1491
  await this._userManager.signinSilent(), this._timeoutRetryCount = 0, e.debug("silent token renewal successful");
1491
1492
  } catch (t) {
1492
- if (t instanceof b) {
1493
+ if (t instanceof x) {
1493
1494
  this._timeoutRetryCount++;
1494
1495
  let n = this._userManager.settings.maxSilentRenewTimeoutRetries;
1495
1496
  if (n !== void 0 && this._timeoutRetryCount > n) {
@@ -1517,13 +1518,13 @@ var L = I, R = "openid", z = class {
1517
1518
  stop() {
1518
1519
  this._isStarted &&= (this._retryTimer.cancel(), this._retryTimer.removeHandler(this._tokenExpiring), this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring), !1);
1519
1520
  }
1520
- }, me = class {
1521
+ }, he = class {
1521
1522
  constructor(e) {
1522
1523
  this.refresh_token = e.refresh_token, this.id_token = e.id_token, this.session_state = e.session_state, this.scope = e.scope, this.profile = e.profile, this.data = e.state;
1523
1524
  }
1524
- }, he = class {
1525
+ }, ge = class {
1525
1526
  constructor(e, t, n, r) {
1526
- this._logger = new c("UserManager"), this.settings = new se(e), this._client = new ie(e), this._redirectNavigator = t ?? new de(this.settings), this._popupNavigator = n ?? new $(this.settings), this._iframeNavigator = r ?? new ce(this.settings), this._events = new fe(this.settings), this._silentRenewService = new pe(this), this.settings.automaticSilentRenew && this.startSilentRenew(), this._sessionMonitor = null, this.settings.monitorSession && (this._sessionMonitor = new W(this));
1527
+ this._logger = new l("UserManager"), this.settings = new ce(e), this._client = new U(e), this._redirectNavigator = t ?? new fe(this.settings), this._popupNavigator = n ?? new $(this.settings), this._iframeNavigator = r ?? new le(this.settings), this._events = new pe(this.settings), this._silentRenewService = new me(this), this.settings.automaticSilentRenew && this.startSilentRenew(), this._sessionMonitor = null, this.settings.monitorSession && (this._sessionMonitor = new W(this));
1527
1528
  }
1528
1529
  get events() {
1529
1530
  return this._events;
@@ -1592,7 +1593,7 @@ var L = I, R = "openid", z = class {
1592
1593
  let t = this._logger.create("signinSilent"), { silentRequestTimeoutInSeconds: n, ...r } = e, i = await this._loadUser();
1593
1594
  if (!e.forceIframeAuth && i?.refresh_token) {
1594
1595
  t.debug("using refresh token");
1595
- let e = new me(i);
1596
+ let e = new he(i);
1596
1597
  return await this._useRefreshToken({
1597
1598
  state: e,
1598
1599
  redirect_uri: r.redirect_uri,
@@ -1677,7 +1678,7 @@ var L = I, R = "openid", z = class {
1677
1678
  sub: e.profile.sub
1678
1679
  }) : (t.info("success, user not authenticated"), null);
1679
1680
  } catch (e) {
1680
- if (this.settings.monitorAnonymousSession && e instanceof y) switch (e.error) {
1681
+ if (this.settings.monitorAnonymousSession && e instanceof b) switch (e.error) {
1681
1682
  case "login_required":
1682
1683
  case "consent_required":
1683
1684
  case "interaction_required":
@@ -1711,7 +1712,7 @@ var L = I, R = "openid", z = class {
1711
1712
  async _buildUser(e, t) {
1712
1713
  let n = this._logger.create("_buildUser"), r = new G(e);
1713
1714
  if (t) {
1714
- if (t !== r.profile.sub) throw n.debug("current user does not match user returned from signin. sub from signin:", r.profile.sub), new y({
1715
+ if (t !== r.profile.sub) throw n.debug("current user does not match user returned from signin. sub from signin:", r.profile.sub), new b({
1715
1716
  ...e,
1716
1717
  error: "login_required"
1717
1718
  });
@@ -1827,7 +1828,7 @@ var L = I, R = "openid", z = class {
1827
1828
  }
1828
1829
  async dpopProof(e, t, n, r) {
1829
1830
  let i = await (this.settings.dpop?.store)?.get(this.settings.client_id);
1830
- if (i) return await p.generateDPoPProof({
1831
+ if (i) return await m.generateDPoPProof({
1831
1832
  url: e,
1832
1833
  accessToken: t?.access_token,
1833
1834
  httpMethod: n,
@@ -1837,10 +1838,33 @@ var L = I, R = "openid", z = class {
1837
1838
  }
1838
1839
  async generateDPoPJkt(e) {
1839
1840
  let t = await e.store.get(this.settings.client_id);
1840
- return t || (t = new U(await p.generateDPoPKeys()), await e.store.set(this.settings.client_id, t)), await p.generateDPoPJkt(t.keys);
1841
+ return t || (t = new H(await m.generateDPoPKeys()), await e.store.set(this.settings.client_id, t)), await m.generateDPoPJkt(t.keys);
1842
+ }
1843
+ }, _e = class {
1844
+ static userManager;
1845
+ static getSettings(t) {
1846
+ let n = new URL(e.getInstance().window.location.href);
1847
+ n.search = "", n.pathname = "/post-login";
1848
+ let r = n.toString();
1849
+ n.pathname = "/post-logout";
1850
+ let i = n.toString();
1851
+ return {
1852
+ authority: t.issuer,
1853
+ automaticSilentRenew: !0,
1854
+ client_id: t.client_id,
1855
+ client_secret: t.client_secret,
1856
+ metadataUrl: t.discovery_url,
1857
+ post_logout_redirect_uri: i,
1858
+ redirect_uri: r,
1859
+ refreshTokenAllowedScope: "",
1860
+ response_type: "code",
1861
+ scope: t.scope,
1862
+ userStore: new O({ store: sessionStorage }),
1863
+ validateSubOnSilentRenew: !0
1864
+ };
1841
1865
  }
1842
1866
  };
1843
1867
  //#endregion
1844
- export { D as n, he as t };
1868
+ export { ge as n, _e as t };
1845
1869
 
1846
- //# sourceMappingURL=oidc-client-ts.js.map
1870
+ //# sourceMappingURL=UserManagerUtil.js.map