@apicurio/common-ui-components 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/ApplicationAuth.d.ts +4 -3
- package/dist/auth/AuthConfigContext.d.ts +2 -2
- package/dist/auth/IfAuth.d.ts +2 -1
- package/dist/auth/index.d.ts +4 -4
- package/dist/auth/useAuth.d.ts +8 -2
- package/dist/common/DateTime.d.ts +2 -1
- package/dist/common/FromNow.d.ts +2 -1
- package/dist/common/If.d.ts +2 -1
- package/dist/common/IfNotEmpty.d.ts +2 -1
- package/dist/common/IfNotLoading.d.ts +2 -1
- package/dist/common/ListWithToolbar.d.ts +2 -1
- package/dist/common/ObjectDropdown.d.ts +3 -2
- package/dist/common/ObjectSelect.d.ts +2 -1
- package/dist/common/ToggleIcon.d.ts +2 -1
- package/dist/common/UrlUpload.d.ts +2 -1
- package/dist/common/index.d.ts +10 -10
- package/dist/main.d.ts +4 -4
- package/dist/main.js +524 -411
- package/dist/modals/AppAboutModal.d.ts +2 -1
- package/dist/modals/BasicAuthModal.d.ts +13 -0
- package/dist/modals/PleaseWaitModal.d.ts +2 -1
- package/dist/modals/ProgressModal.d.ts +2 -1
- package/dist/modals/index.d.ts +4 -3
- package/dist/table/ChipFilter/ChipFilter.d.ts +3 -2
- package/dist/table/ChipFilter/components/FilterCheckbox.d.ts +2 -1
- package/dist/table/ChipFilter/components/FilterSearch.d.ts +3 -2
- package/dist/table/ChipFilter/components/index.d.ts +3 -3
- package/dist/table/ChipFilter/index.d.ts +5 -5
- package/dist/table/Pagination.d.ts +2 -1
- package/dist/table/ResponsiveTable.d.ts +6 -6
- package/dist/table/TableSkeleton.d.ts +2 -1
- package/dist/table/index.d.ts +5 -5
- package/package.json +17 -17
package/dist/main.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import j, { createContext as
|
|
2
|
-
import { jsx as c, jsxs as
|
|
3
|
-
import { EmptyState as
|
|
4
|
-
import { EllipsisVIcon as
|
|
5
|
-
import { DateTime as
|
|
6
|
-
import { Tr as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
1
|
+
import j, { createContext as dt, useContext as ht, useState as I, useEffect as ye, memo as ke, forwardRef as Z, useCallback as Pe, useMemo as Oe } from "react";
|
|
2
|
+
import { jsx as c, jsxs as f, Fragment as oe } from "react/jsx-runtime";
|
|
3
|
+
import { EmptyState as ee, EmptyStateVariant as gt, EmptyStateHeader as te, EmptyStateBody as ge, Spinner as Q, Alert as ut, Dropdown as _t, MenuToggle as ae, DropdownList as pt, Divider as Ke, DropdownItem as ft, Select as Te, SelectOption as Ie, TextInput as ue, Button as _e, TextArea as mt, Modal as Ee, Form as wt, FormGroup as Ne, EmptyStateIcon as ze, AboutModal as vt, TextContent as St, Text as qe, TextVariants as je, TextList as He, TextListItem as y, Progress as bt, Pagination as yt, PaginationVariant as kt, Skeleton as Tt, SearchInput as It, SelectList as Et, ToolbarItem as Ct, InputGroup as Rt, ToolbarToggleGroup as xt, ToolbarGroup as Ut, ToolbarFilter as At } from "@patternfly/react-core";
|
|
4
|
+
import { EllipsisVIcon as Pt, ChevronDownIcon as Ot, ChevronRightIcon as Nt, ErrorCircleOIcon as qt, FilterIcon as Je } from "@patternfly/react-icons";
|
|
5
|
+
import { DateTime as le } from "luxon";
|
|
6
|
+
import { Tr as se, Td as Ce, Th as jt, Table as Ht, Thead as Lt, Tbody as Mt, ActionsColumn as Dt } from "@patternfly/react-table";
|
|
7
|
+
import Ft from "use-resize-observer";
|
|
8
|
+
const $t = dt({
|
|
9
9
|
type: "none"
|
|
10
10
|
});
|
|
11
|
-
class
|
|
11
|
+
class B extends Error {
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
function
|
|
13
|
+
B.prototype.name = "InvalidTokenError";
|
|
14
|
+
function Wt(e) {
|
|
15
15
|
return decodeURIComponent(atob(e).replace(/(.)/g, (t, s) => {
|
|
16
16
|
let i = s.charCodeAt(0).toString(16).toUpperCase();
|
|
17
17
|
return i.length < 2 && (i = "0" + i), "%" + i;
|
|
18
18
|
}));
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function Kt(e) {
|
|
21
21
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
22
22
|
switch (t.length % 4) {
|
|
23
23
|
case 0:
|
|
@@ -32,31 +32,31 @@ function Ft(e) {
|
|
|
32
32
|
throw new Error("base64 string is not of the correct length");
|
|
33
33
|
}
|
|
34
34
|
try {
|
|
35
|
-
return
|
|
35
|
+
return Wt(t);
|
|
36
36
|
} catch {
|
|
37
37
|
return atob(t);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function zt(e, t) {
|
|
41
41
|
if (typeof e != "string")
|
|
42
|
-
throw new
|
|
42
|
+
throw new B("Invalid token specified: must be a string");
|
|
43
43
|
t || (t = {});
|
|
44
44
|
const s = t.header === !0 ? 0 : 1, i = e.split(".")[s];
|
|
45
45
|
if (typeof i != "string")
|
|
46
|
-
throw new
|
|
46
|
+
throw new B(`Invalid token specified: missing part #${s + 1}`);
|
|
47
47
|
let r;
|
|
48
48
|
try {
|
|
49
|
-
r =
|
|
49
|
+
r = Kt(i);
|
|
50
50
|
} catch (n) {
|
|
51
|
-
throw new
|
|
51
|
+
throw new B(`Invalid token specified: invalid base64 for part #${s + 1} (${n.message})`);
|
|
52
52
|
}
|
|
53
53
|
try {
|
|
54
54
|
return JSON.parse(r);
|
|
55
55
|
} catch (n) {
|
|
56
|
-
throw new
|
|
56
|
+
throw new B(`Invalid token specified: invalid json for part #${s + 1} (${n.message})`);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
var
|
|
59
|
+
var Jt = {
|
|
60
60
|
debug: () => {
|
|
61
61
|
},
|
|
62
62
|
info: () => {
|
|
@@ -65,39 +65,39 @@ var Lt = {
|
|
|
65
65
|
},
|
|
66
66
|
error: () => {
|
|
67
67
|
}
|
|
68
|
-
},
|
|
68
|
+
}, N, q, ie = /* @__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))(ie || {});
|
|
69
69
|
((e) => {
|
|
70
70
|
function t() {
|
|
71
|
-
|
|
71
|
+
N = 3, q = Jt;
|
|
72
72
|
}
|
|
73
73
|
e.reset = t;
|
|
74
74
|
function s(r) {
|
|
75
75
|
if (!(0 <= r && r <= 4))
|
|
76
76
|
throw new Error("Invalid log level");
|
|
77
|
-
|
|
77
|
+
N = r;
|
|
78
78
|
}
|
|
79
79
|
e.setLevel = s;
|
|
80
80
|
function i(r) {
|
|
81
|
-
|
|
81
|
+
q = r;
|
|
82
82
|
}
|
|
83
83
|
e.setLogger = i;
|
|
84
|
-
})(
|
|
84
|
+
})(ie || (ie = {}));
|
|
85
85
|
var u = class O {
|
|
86
86
|
constructor(t) {
|
|
87
87
|
this._name = t;
|
|
88
88
|
}
|
|
89
89
|
/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */
|
|
90
90
|
debug(...t) {
|
|
91
|
-
|
|
91
|
+
N >= 4 && q.debug(O._format(this._name, this._method), ...t);
|
|
92
92
|
}
|
|
93
93
|
info(...t) {
|
|
94
|
-
|
|
94
|
+
N >= 3 && q.info(O._format(this._name, this._method), ...t);
|
|
95
95
|
}
|
|
96
96
|
warn(...t) {
|
|
97
|
-
|
|
97
|
+
N >= 2 && q.warn(O._format(this._name, this._method), ...t);
|
|
98
98
|
}
|
|
99
99
|
error(...t) {
|
|
100
|
-
|
|
100
|
+
N >= 1 && q.error(O._format(this._name, this._method), ...t);
|
|
101
101
|
}
|
|
102
102
|
/* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */
|
|
103
103
|
throw(t) {
|
|
@@ -118,21 +118,21 @@ var u = class O {
|
|
|
118
118
|
/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */
|
|
119
119
|
// helpers for static class methods
|
|
120
120
|
static debug(t, ...s) {
|
|
121
|
-
|
|
121
|
+
N >= 4 && q.debug(O._format(t), ...s);
|
|
122
122
|
}
|
|
123
123
|
static info(t, ...s) {
|
|
124
|
-
|
|
124
|
+
N >= 3 && q.info(O._format(t), ...s);
|
|
125
125
|
}
|
|
126
126
|
static warn(t, ...s) {
|
|
127
|
-
|
|
127
|
+
N >= 2 && q.warn(O._format(t), ...s);
|
|
128
128
|
}
|
|
129
129
|
static error(t, ...s) {
|
|
130
|
-
|
|
130
|
+
N >= 1 && q.error(O._format(t), ...s);
|
|
131
131
|
}
|
|
132
132
|
/* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */
|
|
133
133
|
};
|
|
134
|
-
|
|
135
|
-
var
|
|
134
|
+
ie.reset();
|
|
135
|
+
var Bt = "10000000-1000-4000-8000-100000000000", Le = (e) => btoa([...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")), K = class V {
|
|
136
136
|
static _randomWord() {
|
|
137
137
|
const t = new Uint32Array(1);
|
|
138
138
|
return crypto.getRandomValues(t), t[0];
|
|
@@ -141,7 +141,7 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
141
141
|
* Generates RFC4122 version 4 guid
|
|
142
142
|
*/
|
|
143
143
|
static generateUUIDv4() {
|
|
144
|
-
return
|
|
144
|
+
return Bt.replace(
|
|
145
145
|
/[018]/g,
|
|
146
146
|
(s) => (+s ^ V._randomWord() & 15 >> +s / 4).toString(16)
|
|
147
147
|
).replace(/-/g, "");
|
|
@@ -160,7 +160,7 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
160
160
|
throw new Error("Crypto.subtle is available only in secure contexts (HTTPS).");
|
|
161
161
|
try {
|
|
162
162
|
const i = new TextEncoder().encode(t), r = await crypto.subtle.digest("SHA-256", i);
|
|
163
|
-
return
|
|
163
|
+
return Le(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
164
164
|
} catch (s) {
|
|
165
165
|
throw u.error("CryptoUtils.generateCodeChallenge", s), s;
|
|
166
166
|
}
|
|
@@ -170,9 +170,9 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
170
170
|
*/
|
|
171
171
|
static generateBasicAuth(t, s) {
|
|
172
172
|
const r = new TextEncoder().encode([t, s].join(":"));
|
|
173
|
-
return
|
|
173
|
+
return Le(r);
|
|
174
174
|
}
|
|
175
|
-
},
|
|
175
|
+
}, D = class {
|
|
176
176
|
constructor(e) {
|
|
177
177
|
this._name = e, this._logger = new u(`Event('${this._name}')`), this._callbacks = [];
|
|
178
178
|
}
|
|
@@ -188,16 +188,16 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
188
188
|
for (const t of this._callbacks)
|
|
189
189
|
await t(...e);
|
|
190
190
|
}
|
|
191
|
-
},
|
|
191
|
+
}, pe = class {
|
|
192
192
|
// IMPORTANT: doesn't validate the token
|
|
193
193
|
static decode(e) {
|
|
194
194
|
try {
|
|
195
|
-
return
|
|
195
|
+
return zt(e);
|
|
196
196
|
} catch (t) {
|
|
197
197
|
throw u.error("JwtUtils.decode", t), t;
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
},
|
|
200
|
+
}, Me = class {
|
|
201
201
|
/**
|
|
202
202
|
* Populates a map of window features with a placement centered in front of
|
|
203
203
|
* the current window. If no explicit width is given, a default value is
|
|
@@ -210,11 +210,11 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
210
210
|
static serialize(e) {
|
|
211
211
|
return Object.entries(e).filter(([, t]) => t != null).map(([t, s]) => `${t}=${typeof s != "boolean" ? s : s ? "yes" : "no"}`).join(",");
|
|
212
212
|
}
|
|
213
|
-
},
|
|
213
|
+
}, M = class Y extends D {
|
|
214
214
|
constructor() {
|
|
215
215
|
super(...arguments), this._logger = new u(`Timer('${this._name}')`), this._timerHandle = null, this._expiration = 0, this._callback = () => {
|
|
216
|
-
const t = this._expiration -
|
|
217
|
-
this._logger.debug("timer completes in", t), this._expiration <=
|
|
216
|
+
const t = this._expiration - Y.getEpochTime();
|
|
217
|
+
this._logger.debug("timer completes in", t), this._expiration <= Y.getEpochTime() && (this.cancel(), super.raise());
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
220
|
// get the time
|
|
@@ -224,7 +224,7 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
224
224
|
init(t) {
|
|
225
225
|
const s = this._logger.create("init");
|
|
226
226
|
t = Math.max(Math.floor(t), 1);
|
|
227
|
-
const i =
|
|
227
|
+
const i = Y.getEpochTime() + t;
|
|
228
228
|
if (this.expiration === i && this._timerHandle) {
|
|
229
229
|
s.debug("skipping since already initialized for expiration at", this.expiration);
|
|
230
230
|
return;
|
|
@@ -239,27 +239,27 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
239
239
|
cancel() {
|
|
240
240
|
this._logger.create("cancel"), this._timerHandle && (clearInterval(this._timerHandle), this._timerHandle = null);
|
|
241
241
|
}
|
|
242
|
-
},
|
|
242
|
+
}, fe = class {
|
|
243
243
|
static readParams(e, t = "query") {
|
|
244
244
|
if (!e)
|
|
245
245
|
throw new TypeError("Invalid URL");
|
|
246
246
|
const i = new URL(e, "http://127.0.0.1")[t === "fragment" ? "hash" : "search"];
|
|
247
247
|
return new URLSearchParams(i.slice(1));
|
|
248
248
|
}
|
|
249
|
-
},
|
|
249
|
+
}, me = ";", W = class extends Error {
|
|
250
250
|
constructor(e, t) {
|
|
251
251
|
var s, i, r;
|
|
252
252
|
if (super(e.error_description || e.error || ""), this.form = t, this.name = "ErrorResponse", !e.error)
|
|
253
253
|
throw u.error("ErrorResponse", "No error passed"), new Error("No error passed");
|
|
254
254
|
this.error = e.error, this.error_description = (s = e.error_description) != null ? s : null, this.error_uri = (i = e.error_uri) != null ? i : null, this.state = e.userState, this.session_state = (r = e.session_state) != null ? r : null, this.url_state = e.url_state;
|
|
255
255
|
}
|
|
256
|
-
},
|
|
256
|
+
}, Re = class extends Error {
|
|
257
257
|
constructor(e) {
|
|
258
258
|
super(e), this.name = "ErrorTimeout";
|
|
259
259
|
}
|
|
260
|
-
},
|
|
260
|
+
}, Vt = class {
|
|
261
261
|
constructor(e) {
|
|
262
|
-
this._logger = new u("AccessTokenEvents"), this._expiringTimer = new
|
|
262
|
+
this._logger = new u("AccessTokenEvents"), this._expiringTimer = new M("Access token expiring"), this._expiredTimer = new M("Access token expired"), this._expiringNotificationTimeInSeconds = e.expiringNotificationTimeInSeconds;
|
|
263
263
|
}
|
|
264
264
|
load(e) {
|
|
265
265
|
const t = this._logger.create("load");
|
|
@@ -302,7 +302,7 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
302
302
|
removeAccessTokenExpired(e) {
|
|
303
303
|
this._expiredTimer.removeHandler(e);
|
|
304
304
|
}
|
|
305
|
-
},
|
|
305
|
+
}, Gt = class {
|
|
306
306
|
constructor(e, t, s, i, r) {
|
|
307
307
|
this._callback = e, this._client_id = t, this._intervalInSeconds = i, this._stopOnError = r, this._logger = new u("CheckSessionIFrame"), this._timer = null, this._session_state = null, this._message = (a) => {
|
|
308
308
|
a.origin === this._frame_origin && a.source === this._frame.contentWindow && (a.data === "error" ? (this._logger.error("error message from check session op iframe"), this._stopOnError && this.stop()) : a.data === "changed" ? (this._logger.debug("changed message from check session op iframe"), this.stop(), this._callback()) : this._logger.debug(a.data + " message from check session op iframe"));
|
|
@@ -329,7 +329,7 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
329
329
|
stop() {
|
|
330
330
|
this._logger.create("stop"), this._session_state = null, this._timer && (clearInterval(this._timer), this._timer = null);
|
|
331
331
|
}
|
|
332
|
-
},
|
|
332
|
+
}, Be = class {
|
|
333
333
|
constructor() {
|
|
334
334
|
this._logger = new u("InMemoryWebStorage"), this._data = {};
|
|
335
335
|
}
|
|
@@ -351,7 +351,7 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
351
351
|
key(e) {
|
|
352
352
|
return Object.getOwnPropertyNames(this._data)[e];
|
|
353
353
|
}
|
|
354
|
-
},
|
|
354
|
+
}, xe = class {
|
|
355
355
|
constructor(e = [], t = null, s = {}) {
|
|
356
356
|
this._jwtHandler = t, this._extraHeaders = s, this._logger = new u("JsonService"), this._contentTypes = [], this._contentTypes.push(...e, "application/json"), t && this._contentTypes.push("application/jwt");
|
|
357
357
|
}
|
|
@@ -366,7 +366,7 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
366
366
|
signal: r.signal
|
|
367
367
|
});
|
|
368
368
|
} catch (a) {
|
|
369
|
-
throw a instanceof DOMException && a.name === "AbortError" ? new
|
|
369
|
+
throw a instanceof DOMException && a.name === "AbortError" ? new Re("Network timed out") : a;
|
|
370
370
|
} finally {
|
|
371
371
|
clearTimeout(n);
|
|
372
372
|
}
|
|
@@ -447,9 +447,9 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
447
447
|
n && n !== "" && (e[r] = n);
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
|
-
},
|
|
450
|
+
}, Qt = class {
|
|
451
451
|
constructor(e) {
|
|
452
|
-
this._settings = e, this._logger = new u("MetadataService"), this._signingKeys = null, this._metadata = null, this._metadataUrl = this._settings.metadataUrl, this._jsonService = new
|
|
452
|
+
this._settings = e, this._logger = new u("MetadataService"), this._signingKeys = null, this._metadata = null, this._metadataUrl = this._settings.metadataUrl, this._jsonService = new xe(
|
|
453
453
|
["application/jwk-set+json"],
|
|
454
454
|
null,
|
|
455
455
|
this._settings.extraHeaders
|
|
@@ -514,7 +514,7 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
514
514
|
throw e.throw(new Error("Missing keys on keyset")), null;
|
|
515
515
|
return this._signingKeys = s.keys, this._signingKeys;
|
|
516
516
|
}
|
|
517
|
-
},
|
|
517
|
+
}, Ve = class {
|
|
518
518
|
constructor({
|
|
519
519
|
prefix: e = "oidc.",
|
|
520
520
|
store: t = localStorage
|
|
@@ -541,7 +541,7 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
541
541
|
}
|
|
542
542
|
return t;
|
|
543
543
|
}
|
|
544
|
-
},
|
|
544
|
+
}, Xt = "code", Yt = "openid", Zt = "client_secret_post", es = 60 * 15, we = class {
|
|
545
545
|
constructor({
|
|
546
546
|
// metadata related
|
|
547
547
|
authority: e,
|
|
@@ -552,54 +552,54 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
552
552
|
// client related
|
|
553
553
|
client_id: n,
|
|
554
554
|
client_secret: a,
|
|
555
|
-
response_type: o =
|
|
556
|
-
scope: l =
|
|
555
|
+
response_type: o = Xt,
|
|
556
|
+
scope: l = Yt,
|
|
557
557
|
redirect_uri: d,
|
|
558
558
|
post_logout_redirect_uri: h,
|
|
559
|
-
client_authentication: g =
|
|
559
|
+
client_authentication: g = Zt,
|
|
560
560
|
// optional protocol
|
|
561
561
|
prompt: v,
|
|
562
562
|
display: b,
|
|
563
563
|
max_age: R,
|
|
564
564
|
ui_locales: k,
|
|
565
565
|
acr_values: x,
|
|
566
|
-
resource:
|
|
566
|
+
resource: E,
|
|
567
567
|
response_mode: H,
|
|
568
568
|
// behavior flags
|
|
569
569
|
filterProtocolClaims: T = !0,
|
|
570
570
|
loadUserInfo: w = !1,
|
|
571
|
-
staleStateAgeInSeconds: U =
|
|
571
|
+
staleStateAgeInSeconds: U = es,
|
|
572
572
|
mergeClaimsStrategy: C = { array: "replace" },
|
|
573
573
|
disablePKCE: S = !1,
|
|
574
574
|
// other behavior
|
|
575
|
-
stateStore:
|
|
576
|
-
revokeTokenAdditionalContentTypes:
|
|
577
|
-
fetchRequestCredentials:
|
|
575
|
+
stateStore: L,
|
|
576
|
+
revokeTokenAdditionalContentTypes: J,
|
|
577
|
+
fetchRequestCredentials: X,
|
|
578
578
|
refreshTokenAllowedScope: p,
|
|
579
579
|
// extra
|
|
580
|
-
extraQueryParams:
|
|
580
|
+
extraQueryParams: m = {},
|
|
581
581
|
extraTokenParams: P = {},
|
|
582
|
-
extraHeaders:
|
|
582
|
+
extraHeaders: F = {}
|
|
583
583
|
}) {
|
|
584
|
-
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 = s, this.metadataSeed = r, this.signingKeys = i, this.client_id = n, this.client_secret = a, this.response_type = o, this.scope = l, this.redirect_uri = d, this.post_logout_redirect_uri = h, this.client_authentication = g, this.prompt = v, this.display = b, this.max_age = R, this.ui_locales = k, this.acr_values = x, this.resource =
|
|
585
|
-
this.stateStore =
|
|
584
|
+
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 = s, this.metadataSeed = r, this.signingKeys = i, this.client_id = n, this.client_secret = a, this.response_type = o, this.scope = l, this.redirect_uri = d, this.post_logout_redirect_uri = h, this.client_authentication = g, this.prompt = v, this.display = b, this.max_age = R, this.ui_locales = k, this.acr_values = x, this.resource = E, this.response_mode = H, this.filterProtocolClaims = T ?? !0, this.loadUserInfo = !!w, this.staleStateAgeInSeconds = U, this.mergeClaimsStrategy = C, this.disablePKCE = !!S, this.revokeTokenAdditionalContentTypes = J, this.fetchRequestCredentials = X || "same-origin", L)
|
|
585
|
+
this.stateStore = L;
|
|
586
586
|
else {
|
|
587
|
-
const
|
|
588
|
-
this.stateStore = new
|
|
587
|
+
const $ = typeof window < "u" ? window.localStorage : new Be();
|
|
588
|
+
this.stateStore = new Ve({ store: $ });
|
|
589
589
|
}
|
|
590
|
-
this.refreshTokenAllowedScope = p, this.extraQueryParams =
|
|
590
|
+
this.refreshTokenAllowedScope = p, this.extraQueryParams = m, this.extraTokenParams = P, this.extraHeaders = F;
|
|
591
591
|
}
|
|
592
|
-
},
|
|
592
|
+
}, ts = class {
|
|
593
593
|
constructor(e, t) {
|
|
594
594
|
this._settings = e, this._metadataService = t, this._logger = new u("UserInfoService"), this._getClaimsFromJwt = async (s) => {
|
|
595
595
|
const i = this._logger.create("_getClaimsFromJwt");
|
|
596
596
|
try {
|
|
597
|
-
const r =
|
|
597
|
+
const r = pe.decode(s);
|
|
598
598
|
return i.debug("JWT decoding successful"), r;
|
|
599
599
|
} catch (r) {
|
|
600
600
|
throw i.error("Error parsing JWT response"), r;
|
|
601
601
|
}
|
|
602
|
-
}, this._jsonService = new
|
|
602
|
+
}, this._jsonService = new xe(
|
|
603
603
|
void 0,
|
|
604
604
|
this._getClaimsFromJwt,
|
|
605
605
|
this._settings.extraHeaders
|
|
@@ -616,9 +616,9 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
616
616
|
});
|
|
617
617
|
return t.debug("got claims", i), i;
|
|
618
618
|
}
|
|
619
|
-
},
|
|
619
|
+
}, Ge = class {
|
|
620
620
|
constructor(e, t) {
|
|
621
|
-
this._settings = e, this._metadataService = t, this._logger = new u("TokenClient"), this._jsonService = new
|
|
621
|
+
this._settings = e, this._metadataService = t, this._logger = new u("TokenClient"), this._jsonService = new xe(
|
|
622
622
|
this._settings.revokeTokenAdditionalContentTypes,
|
|
623
623
|
null,
|
|
624
624
|
this._settings.extraHeaders
|
|
@@ -739,9 +739,9 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
739
739
|
a != null && r.set(n, a);
|
|
740
740
|
r.set("client_id", this._settings.client_id), this._settings.client_secret && r.set("client_secret", this._settings.client_secret), await this._jsonService.postForm(i, { body: r }), s.debug("got response");
|
|
741
741
|
}
|
|
742
|
-
},
|
|
742
|
+
}, ss = class {
|
|
743
743
|
constructor(e, t, s) {
|
|
744
|
-
this._settings = e, this._metadataService = t, this._claimsService = s, this._logger = new u("ResponseValidator"), this._userInfoService = new
|
|
744
|
+
this._settings = e, this._metadataService = t, this._claimsService = s, this._logger = new u("ResponseValidator"), this._userInfoService = new ts(this._settings, this._metadataService), this._tokenClient = new Ge(this._settings, this._metadataService);
|
|
745
745
|
}
|
|
746
746
|
async validateSigninResponse(e, t) {
|
|
747
747
|
const s = this._logger.create("validateSigninResponse");
|
|
@@ -800,16 +800,16 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
800
800
|
var s;
|
|
801
801
|
const i = this._logger.create("_validateIdTokenAttributes");
|
|
802
802
|
i.debug("decoding ID Token JWT");
|
|
803
|
-
const r =
|
|
803
|
+
const r = pe.decode((s = e.id_token) != null ? s : "");
|
|
804
804
|
if (r.sub || i.throw(new Error("ID Token is missing a subject claim")), t) {
|
|
805
|
-
const n =
|
|
805
|
+
const n = pe.decode(t);
|
|
806
806
|
r.sub !== n.sub && i.throw(new Error("sub in id_token does not match current sub")), r.auth_time && r.auth_time !== n.auth_time && i.throw(new Error("auth_time in id_token does not match original auth_time")), r.azp && r.azp !== n.azp && i.throw(new Error("azp in id_token does not match original azp")), !r.azp && n.azp && i.throw(new Error("azp not in id_token, but present in original id_token"));
|
|
807
807
|
}
|
|
808
808
|
e.profile = r;
|
|
809
809
|
}
|
|
810
|
-
},
|
|
810
|
+
}, re = class ve {
|
|
811
811
|
constructor(t) {
|
|
812
|
-
this.id = t.id || K.generateUUIDv4(), this.data = t.data, t.created && t.created > 0 ? this.created = t.created : this.created =
|
|
812
|
+
this.id = t.id || K.generateUUIDv4(), this.data = t.data, t.created && t.created > 0 ? this.created = t.created : this.created = M.getEpochTime(), this.request_type = t.request_type, this.url_state = t.url_state;
|
|
813
813
|
}
|
|
814
814
|
toStorageString() {
|
|
815
815
|
return new u("State").create("toStorageString"), JSON.stringify({
|
|
@@ -821,17 +821,17 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
821
821
|
});
|
|
822
822
|
}
|
|
823
823
|
static fromStorageString(t) {
|
|
824
|
-
return u.createStatic("State", "fromStorageString"), Promise.resolve(new
|
|
824
|
+
return u.createStatic("State", "fromStorageString"), Promise.resolve(new ve(JSON.parse(t)));
|
|
825
825
|
}
|
|
826
826
|
static async clearStaleState(t, s) {
|
|
827
|
-
const i = u.createStatic("State", "clearStaleState"), r =
|
|
827
|
+
const i = u.createStatic("State", "clearStaleState"), r = M.getEpochTime() - s, n = await t.getAllKeys();
|
|
828
828
|
i.debug("got keys", n);
|
|
829
829
|
for (let a = 0; a < n.length; a++) {
|
|
830
830
|
const o = n[a], l = await t.get(o);
|
|
831
831
|
let d = !1;
|
|
832
832
|
if (l)
|
|
833
833
|
try {
|
|
834
|
-
const h = await
|
|
834
|
+
const h = await ve.fromStorageString(l);
|
|
835
835
|
i.debug("got item from key:", o, h.created), h.created <= r && (d = !0);
|
|
836
836
|
} catch (h) {
|
|
837
837
|
i.error("Error parsing state for key:", o, h), d = !0;
|
|
@@ -841,13 +841,13 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
841
841
|
d && (i.debug("removed item for key:", o), t.remove(o));
|
|
842
842
|
}
|
|
843
843
|
}
|
|
844
|
-
},
|
|
844
|
+
}, Qe = class Se extends re {
|
|
845
845
|
constructor(t) {
|
|
846
846
|
super(t), this.code_verifier = t.code_verifier, this.code_challenge = t.code_challenge, this.authority = t.authority, this.client_id = t.client_id, this.redirect_uri = t.redirect_uri, this.scope = t.scope, this.client_secret = t.client_secret, this.extraTokenParams = t.extraTokenParams, this.response_mode = t.response_mode, this.skipUserInfo = t.skipUserInfo;
|
|
847
847
|
}
|
|
848
848
|
static async create(t) {
|
|
849
849
|
const s = t.code_verifier === !0 ? K.generateCodeVerifier() : t.code_verifier || void 0, i = s ? await K.generateCodeChallenge(s) : void 0;
|
|
850
|
-
return new
|
|
850
|
+
return new Se({
|
|
851
851
|
...t,
|
|
852
852
|
code_verifier: s,
|
|
853
853
|
code_challenge: i
|
|
@@ -874,9 +874,9 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
874
874
|
static fromStorageString(t) {
|
|
875
875
|
u.createStatic("SigninState", "fromStorageString");
|
|
876
876
|
const s = JSON.parse(t);
|
|
877
|
-
return
|
|
877
|
+
return Se.create(s);
|
|
878
878
|
}
|
|
879
|
-
},
|
|
879
|
+
}, Xe = class Ye {
|
|
880
880
|
constructor(t) {
|
|
881
881
|
this.url = t.url, this.state = t.state;
|
|
882
882
|
}
|
|
@@ -899,7 +899,7 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
899
899
|
skipUserInfo: R,
|
|
900
900
|
extraQueryParams: k,
|
|
901
901
|
extraTokenParams: x,
|
|
902
|
-
disablePKCE:
|
|
902
|
+
disablePKCE: E,
|
|
903
903
|
...H
|
|
904
904
|
}) {
|
|
905
905
|
if (!t)
|
|
@@ -914,11 +914,11 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
914
914
|
throw this._logger.error("create: No scope passed"), new Error("scope");
|
|
915
915
|
if (!s)
|
|
916
916
|
throw this._logger.error("create: No authority passed"), new Error("authority");
|
|
917
|
-
const T = await
|
|
917
|
+
const T = await Qe.create({
|
|
918
918
|
data: o,
|
|
919
919
|
request_type: d,
|
|
920
920
|
url_state: v,
|
|
921
|
-
code_verifier: !
|
|
921
|
+
code_verifier: !E,
|
|
922
922
|
client_id: i,
|
|
923
923
|
authority: s,
|
|
924
924
|
redirect_uri: r,
|
|
@@ -930,36 +930,36 @@ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8A
|
|
|
930
930
|
}), w = new URL(t);
|
|
931
931
|
w.searchParams.append("client_id", i), w.searchParams.append("redirect_uri", r), w.searchParams.append("response_type", n), w.searchParams.append("scope", a), g && w.searchParams.append("nonce", g);
|
|
932
932
|
let U = T.id;
|
|
933
|
-
v && (U = `${U}${
|
|
933
|
+
v && (U = `${U}${me}${v}`), w.searchParams.append("state", U), T.code_challenge && (w.searchParams.append("code_challenge", T.code_challenge), w.searchParams.append("code_challenge_method", "S256")), b && (Array.isArray(b) ? b : [b]).forEach((S) => w.searchParams.append("resource", S));
|
|
934
934
|
for (const [C, S] of Object.entries({ response_mode: l, ...H, ...k }))
|
|
935
935
|
S != null && w.searchParams.append(C, S.toString());
|
|
936
|
-
return new
|
|
936
|
+
return new Ye({
|
|
937
937
|
url: w.href,
|
|
938
938
|
state: T
|
|
939
939
|
});
|
|
940
940
|
}
|
|
941
941
|
};
|
|
942
|
-
|
|
943
|
-
var
|
|
942
|
+
Xe._logger = new u("SigninRequest");
|
|
943
|
+
var is = Xe, rs = "openid", de = class {
|
|
944
944
|
constructor(e) {
|
|
945
945
|
if (this.access_token = "", this.token_type = "", this.profile = {}, this.state = e.get("state"), this.session_state = e.get("session_state"), this.state) {
|
|
946
|
-
const t = decodeURIComponent(this.state).split(
|
|
947
|
-
this.state = t[0], t.length > 1 && (this.url_state = t.slice(1).join(
|
|
946
|
+
const t = decodeURIComponent(this.state).split(me);
|
|
947
|
+
this.state = t[0], t.length > 1 && (this.url_state = t.slice(1).join(me));
|
|
948
948
|
}
|
|
949
949
|
this.error = e.get("error"), this.error_description = e.get("error_description"), this.error_uri = e.get("error_uri"), this.code = e.get("code");
|
|
950
950
|
}
|
|
951
951
|
get expires_in() {
|
|
952
952
|
if (this.expires_at !== void 0)
|
|
953
|
-
return this.expires_at -
|
|
953
|
+
return this.expires_at - M.getEpochTime();
|
|
954
954
|
}
|
|
955
955
|
set expires_in(e) {
|
|
956
|
-
typeof e == "string" && (e = Number(e)), e !== void 0 && e >= 0 && (this.expires_at = Math.floor(e) +
|
|
956
|
+
typeof e == "string" && (e = Number(e)), e !== void 0 && e >= 0 && (this.expires_at = Math.floor(e) + M.getEpochTime());
|
|
957
957
|
}
|
|
958
958
|
get isOpenId() {
|
|
959
959
|
var e;
|
|
960
|
-
return ((e = this.scope) == null ? void 0 : e.split(" ").includes(
|
|
960
|
+
return ((e = this.scope) == null ? void 0 : e.split(" ").includes(rs)) || !!this.id_token;
|
|
961
961
|
}
|
|
962
|
-
},
|
|
962
|
+
}, ns = class {
|
|
963
963
|
constructor({
|
|
964
964
|
url: e,
|
|
965
965
|
state_data: t,
|
|
@@ -972,16 +972,16 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
972
972
|
if (this._logger = new u("SignoutRequest"), !e)
|
|
973
973
|
throw this._logger.error("ctor: No url passed"), new Error("url");
|
|
974
974
|
const o = new URL(e);
|
|
975
|
-
s && o.searchParams.append("id_token_hint", s), a && o.searchParams.append("client_id", a), i && (o.searchParams.append("post_logout_redirect_uri", i), t && (this.state = new
|
|
975
|
+
s && o.searchParams.append("id_token_hint", s), a && o.searchParams.append("client_id", a), i && (o.searchParams.append("post_logout_redirect_uri", i), t && (this.state = new re({ data: t, request_type: n }), o.searchParams.append("state", this.state.id)));
|
|
976
976
|
for (const [l, d] of Object.entries({ ...r }))
|
|
977
977
|
d != null && o.searchParams.append(l, d.toString());
|
|
978
978
|
this.url = o.href;
|
|
979
979
|
}
|
|
980
|
-
},
|
|
980
|
+
}, os = class {
|
|
981
981
|
constructor(e) {
|
|
982
982
|
this.state = e.get("state"), this.error = e.get("error"), this.error_description = e.get("error_description"), this.error_uri = e.get("error_uri");
|
|
983
983
|
}
|
|
984
|
-
},
|
|
984
|
+
}, as = [
|
|
985
985
|
"nbf",
|
|
986
986
|
"jti",
|
|
987
987
|
"auth_time",
|
|
@@ -991,7 +991,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
991
991
|
"azp",
|
|
992
992
|
"at_hash"
|
|
993
993
|
// https://openid.net/specs/openid-connect-core-1_0.html#CodeIDToken
|
|
994
|
-
],
|
|
994
|
+
], cs = ["sub", "iss", "aud", "exp", "iat"], ls = class {
|
|
995
995
|
constructor(e) {
|
|
996
996
|
this._settings = e, this._logger = new u("ClaimsService");
|
|
997
997
|
}
|
|
@@ -999,9 +999,9 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
999
999
|
const t = { ...e };
|
|
1000
1000
|
if (this._settings.filterProtocolClaims) {
|
|
1001
1001
|
let s;
|
|
1002
|
-
Array.isArray(this._settings.filterProtocolClaims) ? s = this._settings.filterProtocolClaims : s =
|
|
1002
|
+
Array.isArray(this._settings.filterProtocolClaims) ? s = this._settings.filterProtocolClaims : s = as;
|
|
1003
1003
|
for (const i of s)
|
|
1004
|
-
|
|
1004
|
+
cs.includes(i) || delete t[i];
|
|
1005
1005
|
}
|
|
1006
1006
|
return t;
|
|
1007
1007
|
}
|
|
@@ -1022,9 +1022,9 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1022
1022
|
typeof s[i] == "object" && typeof r == "object" ? s[i] = this.mergeClaims(s[i], r) : s[i] = r;
|
|
1023
1023
|
return s;
|
|
1024
1024
|
}
|
|
1025
|
-
},
|
|
1025
|
+
}, ds = class {
|
|
1026
1026
|
constructor(e, t) {
|
|
1027
|
-
this._logger = new u("OidcClient"), this.settings = e instanceof
|
|
1027
|
+
this._logger = new u("OidcClient"), this.settings = e instanceof we ? e : new we(e), this.metadataService = t ?? new Qt(this.settings), this._claimsService = new ls(this.settings), this._validator = new ss(this.settings, this.metadataService, this._claimsService), this._tokenClient = new Ge(this.settings, this.metadataService);
|
|
1028
1028
|
}
|
|
1029
1029
|
async createSigninRequest({
|
|
1030
1030
|
state: e,
|
|
@@ -1044,7 +1044,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1044
1044
|
max_age: R = this.settings.max_age,
|
|
1045
1045
|
ui_locales: k = this.settings.ui_locales,
|
|
1046
1046
|
acr_values: x = this.settings.acr_values,
|
|
1047
|
-
resource:
|
|
1047
|
+
resource: E = this.settings.resource,
|
|
1048
1048
|
response_mode: H = this.settings.response_mode,
|
|
1049
1049
|
extraQueryParams: T = this.settings.extraQueryParams,
|
|
1050
1050
|
extraTokenParams: w = this.settings.extraTokenParams
|
|
@@ -1054,7 +1054,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1054
1054
|
throw new Error("Only the Authorization Code flow (with PKCE) is supported");
|
|
1055
1055
|
const C = await this.metadataService.getAuthorizationEndpoint();
|
|
1056
1056
|
U.debug("Received authorization endpoint", C);
|
|
1057
|
-
const S = await
|
|
1057
|
+
const S = await is.create({
|
|
1058
1058
|
url: C,
|
|
1059
1059
|
authority: this.settings.authority,
|
|
1060
1060
|
client_id: this.settings.client_id,
|
|
@@ -1070,7 +1070,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1070
1070
|
id_token_hint: r,
|
|
1071
1071
|
login_hint: n,
|
|
1072
1072
|
acr_values: x,
|
|
1073
|
-
resource:
|
|
1073
|
+
resource: E,
|
|
1074
1074
|
request: t,
|
|
1075
1075
|
request_uri: s,
|
|
1076
1076
|
extraQueryParams: T,
|
|
@@ -1083,17 +1083,17 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1083
1083
|
disablePKCE: this.settings.disablePKCE
|
|
1084
1084
|
});
|
|
1085
1085
|
await this.clearStaleState();
|
|
1086
|
-
const
|
|
1087
|
-
return await this.settings.stateStore.set(
|
|
1086
|
+
const L = S.state;
|
|
1087
|
+
return await this.settings.stateStore.set(L.id, L.toStorageString()), S;
|
|
1088
1088
|
}
|
|
1089
1089
|
async readSigninResponseState(e, t = !1) {
|
|
1090
|
-
const s = this._logger.create("readSigninResponseState"), i = new
|
|
1090
|
+
const s = this._logger.create("readSigninResponseState"), i = new de(fe.readParams(e, this.settings.response_mode));
|
|
1091
1091
|
if (!i.state)
|
|
1092
1092
|
throw s.throw(new Error("No state in response")), null;
|
|
1093
1093
|
const r = await this.settings.stateStore[t ? "remove" : "get"](i.state);
|
|
1094
1094
|
if (!r)
|
|
1095
1095
|
throw s.throw(new Error("No matching state found in storage")), null;
|
|
1096
|
-
return { state: await
|
|
1096
|
+
return { state: await Qe.fromStorageString(r), response: i };
|
|
1097
1097
|
}
|
|
1098
1098
|
async processSigninResponse(e) {
|
|
1099
1099
|
const t = this._logger.create("processSigninResponse"), { state: s, response: i } = await this.readSigninResponseState(e, !0);
|
|
@@ -1105,7 +1105,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1105
1105
|
skipUserInfo: s = !1,
|
|
1106
1106
|
extraTokenParams: i = {}
|
|
1107
1107
|
}) {
|
|
1108
|
-
const r = await this._tokenClient.exchangeCredentials({ username: e, password: t, ...i }), n = new
|
|
1108
|
+
const r = await this._tokenClient.exchangeCredentials({ username: e, password: t, ...i }), n = new de(new URLSearchParams());
|
|
1109
1109
|
return Object.assign(n, r), await this._validator.validateCredentialsResponse(n, s), n;
|
|
1110
1110
|
}
|
|
1111
1111
|
async useRefreshToken({
|
|
@@ -1132,7 +1132,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1132
1132
|
resource: s,
|
|
1133
1133
|
timeoutInSeconds: i,
|
|
1134
1134
|
...r
|
|
1135
|
-
}), d = new
|
|
1135
|
+
}), d = new de(new URLSearchParams());
|
|
1136
1136
|
return Object.assign(d, l), a.debug("validating response", d), await this._validator.validateRefreshResponse(d, {
|
|
1137
1137
|
...e,
|
|
1138
1138
|
// override the scope in the state handed over to the validator
|
|
@@ -1152,7 +1152,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1152
1152
|
if (!o)
|
|
1153
1153
|
throw a.throw(new Error("No end session endpoint")), null;
|
|
1154
1154
|
a.debug("Received end session endpoint", o), !s && r && !t && (s = this.settings.client_id);
|
|
1155
|
-
const l = new
|
|
1155
|
+
const l = new ns({
|
|
1156
1156
|
url: o,
|
|
1157
1157
|
id_token_hint: t,
|
|
1158
1158
|
client_id: s,
|
|
@@ -1166,7 +1166,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1166
1166
|
return d && (a.debug("Signout request has state to persist"), await this.settings.stateStore.set(d.id, d.toStorageString())), l;
|
|
1167
1167
|
}
|
|
1168
1168
|
async readSignoutResponseState(e, t = !1) {
|
|
1169
|
-
const s = this._logger.create("readSignoutResponseState"), i = new
|
|
1169
|
+
const s = this._logger.create("readSignoutResponseState"), i = new os(fe.readParams(e, this.settings.response_mode));
|
|
1170
1170
|
if (!i.state) {
|
|
1171
1171
|
if (s.debug("No state in response"), i.error)
|
|
1172
1172
|
throw s.warn("Response was error:", i.error), new W(i);
|
|
@@ -1175,14 +1175,14 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1175
1175
|
const r = await this.settings.stateStore[t ? "remove" : "get"](i.state);
|
|
1176
1176
|
if (!r)
|
|
1177
1177
|
throw s.throw(new Error("No matching state found in storage")), null;
|
|
1178
|
-
return { state: await
|
|
1178
|
+
return { state: await re.fromStorageString(r), response: i };
|
|
1179
1179
|
}
|
|
1180
1180
|
async processSignoutResponse(e) {
|
|
1181
1181
|
const t = this._logger.create("processSignoutResponse"), { state: s, response: i } = await this.readSignoutResponseState(e, !0);
|
|
1182
1182
|
return s ? (t.debug("Received state from storage; validating response"), this._validator.validateSignoutResponse(i, s)) : t.debug("No state from storage; skipping response validation"), i;
|
|
1183
1183
|
}
|
|
1184
1184
|
clearStaleState() {
|
|
1185
|
-
return this._logger.create("clearStaleState"),
|
|
1185
|
+
return this._logger.create("clearStaleState"), re.clearStaleState(this.settings.stateStore, this.settings.staleStateAgeInSeconds);
|
|
1186
1186
|
}
|
|
1187
1187
|
async revokeToken(e, t) {
|
|
1188
1188
|
return this._logger.create("revokeToken"), await this._tokenClient.revoke({
|
|
@@ -1190,7 +1190,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1190
1190
|
token_type_hint: t
|
|
1191
1191
|
});
|
|
1192
1192
|
}
|
|
1193
|
-
},
|
|
1193
|
+
}, hs = class {
|
|
1194
1194
|
constructor(e) {
|
|
1195
1195
|
this._userManager = e, this._logger = new u("SessionMonitor"), this._start = async (t) => {
|
|
1196
1196
|
const s = t.session_state;
|
|
@@ -1205,7 +1205,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1205
1205
|
const r = await this._userManager.metadataService.getCheckSessionIframe();
|
|
1206
1206
|
if (r) {
|
|
1207
1207
|
i.debug("initializing check session iframe");
|
|
1208
|
-
const n = this._userManager.settings.client_id, a = this._userManager.settings.checkSessionIntervalInSeconds, o = this._userManager.settings.stopCheckSessionOnError, l = new
|
|
1208
|
+
const n = this._userManager.settings.client_id, a = this._userManager.settings.checkSessionIntervalInSeconds, o = this._userManager.settings.stopCheckSessionOnError, l = new Gt(this._callback, n, r, a, o);
|
|
1209
1209
|
await l.load(), this._checkSessionIFrame = l, l.start(s);
|
|
1210
1210
|
} else
|
|
1211
1211
|
i.warn("no check session iframe found in the metadata");
|
|
@@ -1264,7 +1264,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1264
1264
|
}
|
|
1265
1265
|
}
|
|
1266
1266
|
}
|
|
1267
|
-
},
|
|
1267
|
+
}, he = class Ze {
|
|
1268
1268
|
constructor(t) {
|
|
1269
1269
|
var s;
|
|
1270
1270
|
this.id_token = t.id_token, this.session_state = (s = t.session_state) != null ? s : null, this.access_token = t.access_token, this.refresh_token = t.refresh_token, this.token_type = t.token_type, this.scope = t.scope, this.profile = t.profile, this.expires_at = t.expires_at, this.state = t.userState, this.url_state = t.url_state;
|
|
@@ -1272,10 +1272,10 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1272
1272
|
/** Computed number of seconds the access token has remaining. */
|
|
1273
1273
|
get expires_in() {
|
|
1274
1274
|
if (this.expires_at !== void 0)
|
|
1275
|
-
return this.expires_at -
|
|
1275
|
+
return this.expires_at - M.getEpochTime();
|
|
1276
1276
|
}
|
|
1277
1277
|
set expires_in(t) {
|
|
1278
|
-
t !== void 0 && (this.expires_at = Math.floor(t) +
|
|
1278
|
+
t !== void 0 && (this.expires_at = Math.floor(t) + M.getEpochTime());
|
|
1279
1279
|
}
|
|
1280
1280
|
/** Computed value indicating if the access token is expired. */
|
|
1281
1281
|
get expired() {
|
|
@@ -1301,11 +1301,11 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1301
1301
|
});
|
|
1302
1302
|
}
|
|
1303
1303
|
static fromStorageString(t) {
|
|
1304
|
-
return u.createStatic("User", "fromStorageString"), new
|
|
1304
|
+
return u.createStatic("User", "fromStorageString"), new Ze(JSON.parse(t));
|
|
1305
1305
|
}
|
|
1306
|
-
},
|
|
1306
|
+
}, De = "oidc-client", et = class {
|
|
1307
1307
|
constructor() {
|
|
1308
|
-
this._abort = new
|
|
1308
|
+
this._abort = new D("Window navigation aborted"), this._disposeHandlers = /* @__PURE__ */ new Set(), this._window = null;
|
|
1309
1309
|
}
|
|
1310
1310
|
async navigate(e) {
|
|
1311
1311
|
const t = this._logger.create("navigate");
|
|
@@ -1316,9 +1316,9 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1316
1316
|
const a = (o) => {
|
|
1317
1317
|
var l;
|
|
1318
1318
|
const d = o.data, h = (l = e.scriptOrigin) != null ? l : window.location.origin;
|
|
1319
|
-
if (!(o.origin !== h || (d == null ? void 0 : d.source) !==
|
|
1319
|
+
if (!(o.origin !== h || (d == null ? void 0 : d.source) !== De)) {
|
|
1320
1320
|
try {
|
|
1321
|
-
const g =
|
|
1321
|
+
const g = fe.readParams(d.url, e.response_mode).get("state");
|
|
1322
1322
|
if (g || t.warn("no state found in response url"), o.source !== this._window && g !== e.state)
|
|
1323
1323
|
return;
|
|
1324
1324
|
} catch {
|
|
@@ -1341,55 +1341,55 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1341
1341
|
}
|
|
1342
1342
|
static _notifyParent(e, t, s = !1, i = window.location.origin) {
|
|
1343
1343
|
e.postMessage({
|
|
1344
|
-
source:
|
|
1344
|
+
source: De,
|
|
1345
1345
|
url: t,
|
|
1346
1346
|
keepOpen: s
|
|
1347
1347
|
}, i);
|
|
1348
1348
|
}
|
|
1349
|
-
},
|
|
1349
|
+
}, tt = {
|
|
1350
1350
|
location: !1,
|
|
1351
1351
|
toolbar: !1,
|
|
1352
1352
|
height: 640,
|
|
1353
1353
|
closePopupWindowAfterInSeconds: -1
|
|
1354
|
-
},
|
|
1354
|
+
}, st = "_blank", gs = 60, us = 2, it = 10, _s = class extends we {
|
|
1355
1355
|
constructor(e) {
|
|
1356
1356
|
const {
|
|
1357
1357
|
popup_redirect_uri: t = e.redirect_uri,
|
|
1358
1358
|
popup_post_logout_redirect_uri: s = e.post_logout_redirect_uri,
|
|
1359
|
-
popupWindowFeatures: i =
|
|
1360
|
-
popupWindowTarget: r =
|
|
1359
|
+
popupWindowFeatures: i = tt,
|
|
1360
|
+
popupWindowTarget: r = st,
|
|
1361
1361
|
redirectMethod: n = "assign",
|
|
1362
1362
|
redirectTarget: a = "self",
|
|
1363
1363
|
iframeNotifyParentOrigin: o = e.iframeNotifyParentOrigin,
|
|
1364
1364
|
iframeScriptOrigin: l = e.iframeScriptOrigin,
|
|
1365
1365
|
silent_redirect_uri: d = e.redirect_uri,
|
|
1366
|
-
silentRequestTimeoutInSeconds: h =
|
|
1366
|
+
silentRequestTimeoutInSeconds: h = it,
|
|
1367
1367
|
automaticSilentRenew: g = !0,
|
|
1368
1368
|
validateSubOnSilentRenew: v = !0,
|
|
1369
1369
|
includeIdTokenInSilentRenew: b = !1,
|
|
1370
1370
|
monitorSession: R = !1,
|
|
1371
1371
|
monitorAnonymousSession: k = !1,
|
|
1372
|
-
checkSessionIntervalInSeconds: x =
|
|
1373
|
-
query_status_response_type:
|
|
1372
|
+
checkSessionIntervalInSeconds: x = us,
|
|
1373
|
+
query_status_response_type: E = "code",
|
|
1374
1374
|
stopCheckSessionOnError: H = !0,
|
|
1375
1375
|
revokeTokenTypes: T = ["access_token", "refresh_token"],
|
|
1376
1376
|
revokeTokensOnSignout: w = !1,
|
|
1377
1377
|
includeIdTokenInSilentSignout: U = !1,
|
|
1378
|
-
accessTokenExpiringNotificationTimeInSeconds: C =
|
|
1378
|
+
accessTokenExpiringNotificationTimeInSeconds: C = gs,
|
|
1379
1379
|
userStore: S
|
|
1380
1380
|
} = e;
|
|
1381
|
-
if (super(e), this.popup_redirect_uri = t, this.popup_post_logout_redirect_uri = s, this.popupWindowFeatures = i, this.popupWindowTarget = r, this.redirectMethod = n, this.redirectTarget = a, this.iframeNotifyParentOrigin = o, this.iframeScriptOrigin = l, this.silent_redirect_uri = d, this.silentRequestTimeoutInSeconds = h, this.automaticSilentRenew = g, this.validateSubOnSilentRenew = v, this.includeIdTokenInSilentRenew = b, this.monitorSession = R, this.monitorAnonymousSession = k, this.checkSessionIntervalInSeconds = x, this.stopCheckSessionOnError = H, this.query_status_response_type =
|
|
1381
|
+
if (super(e), this.popup_redirect_uri = t, this.popup_post_logout_redirect_uri = s, this.popupWindowFeatures = i, this.popupWindowTarget = r, this.redirectMethod = n, this.redirectTarget = a, this.iframeNotifyParentOrigin = o, this.iframeScriptOrigin = l, this.silent_redirect_uri = d, this.silentRequestTimeoutInSeconds = h, this.automaticSilentRenew = g, this.validateSubOnSilentRenew = v, this.includeIdTokenInSilentRenew = b, this.monitorSession = R, this.monitorAnonymousSession = k, this.checkSessionIntervalInSeconds = x, this.stopCheckSessionOnError = H, this.query_status_response_type = E, this.revokeTokenTypes = T, this.revokeTokensOnSignout = w, this.includeIdTokenInSilentSignout = U, this.accessTokenExpiringNotificationTimeInSeconds = C, S)
|
|
1382
1382
|
this.userStore = S;
|
|
1383
1383
|
else {
|
|
1384
|
-
const
|
|
1385
|
-
this.userStore = new
|
|
1384
|
+
const L = typeof window < "u" ? window.sessionStorage : new Be();
|
|
1385
|
+
this.userStore = new Ve({ store: L });
|
|
1386
1386
|
}
|
|
1387
1387
|
}
|
|
1388
|
-
},
|
|
1388
|
+
}, Fe = class rt extends et {
|
|
1389
1389
|
constructor({
|
|
1390
|
-
silentRequestTimeoutInSeconds: t =
|
|
1390
|
+
silentRequestTimeoutInSeconds: t = it
|
|
1391
1391
|
}) {
|
|
1392
|
-
super(), this._logger = new u("IFrameWindow"), this._timeoutInSeconds = t, this._frame =
|
|
1392
|
+
super(), this._logger = new u("IFrameWindow"), this._timeoutInSeconds = t, this._frame = rt.createHiddenIframe(), this._window = this._frame.contentWindow;
|
|
1393
1393
|
}
|
|
1394
1394
|
static createHiddenIframe() {
|
|
1395
1395
|
const t = window.document.createElement("iframe");
|
|
@@ -1397,7 +1397,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1397
1397
|
}
|
|
1398
1398
|
async navigate(t) {
|
|
1399
1399
|
this._logger.debug("navigate: Using timeout of:", this._timeoutInSeconds);
|
|
1400
|
-
const s = setTimeout(() => void this._abort.raise(new
|
|
1400
|
+
const s = setTimeout(() => void this._abort.raise(new Re("IFrame timed out without a response")), this._timeoutInSeconds * 1e3);
|
|
1401
1401
|
return this._disposeHandlers.add(() => clearTimeout(s)), await super.navigate(t);
|
|
1402
1402
|
}
|
|
1403
1403
|
close() {
|
|
@@ -1411,39 +1411,39 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1411
1411
|
static notifyParent(t, s) {
|
|
1412
1412
|
return super._notifyParent(window.parent, t, !1, s);
|
|
1413
1413
|
}
|
|
1414
|
-
},
|
|
1414
|
+
}, ps = class {
|
|
1415
1415
|
constructor(e) {
|
|
1416
1416
|
this._settings = e, this._logger = new u("IFrameNavigator");
|
|
1417
1417
|
}
|
|
1418
1418
|
async prepare({
|
|
1419
1419
|
silentRequestTimeoutInSeconds: e = this._settings.silentRequestTimeoutInSeconds
|
|
1420
1420
|
}) {
|
|
1421
|
-
return new
|
|
1421
|
+
return new Fe({ silentRequestTimeoutInSeconds: e });
|
|
1422
1422
|
}
|
|
1423
1423
|
async callback(e) {
|
|
1424
|
-
this._logger.create("callback"),
|
|
1424
|
+
this._logger.create("callback"), Fe.notifyParent(e, this._settings.iframeNotifyParentOrigin);
|
|
1425
1425
|
}
|
|
1426
|
-
},
|
|
1426
|
+
}, fs = 500, ms = 1e3, $e = class extends et {
|
|
1427
1427
|
constructor({
|
|
1428
|
-
popupWindowTarget: e =
|
|
1428
|
+
popupWindowTarget: e = st,
|
|
1429
1429
|
popupWindowFeatures: t = {}
|
|
1430
1430
|
}) {
|
|
1431
1431
|
super(), this._logger = new u("PopupWindow");
|
|
1432
|
-
const s =
|
|
1433
|
-
this._window = window.open(void 0, e,
|
|
1432
|
+
const s = Me.center({ ...tt, ...t });
|
|
1433
|
+
this._window = window.open(void 0, e, Me.serialize(s)), t.closePopupWindowAfterInSeconds && t.closePopupWindowAfterInSeconds > 0 && setTimeout(() => {
|
|
1434
1434
|
if (!this._window || typeof this._window.closed != "boolean" || this._window.closed) {
|
|
1435
1435
|
this._abort.raise(new Error("Popup blocked by user"));
|
|
1436
1436
|
return;
|
|
1437
1437
|
}
|
|
1438
1438
|
this.close();
|
|
1439
|
-
}, t.closePopupWindowAfterInSeconds *
|
|
1439
|
+
}, t.closePopupWindowAfterInSeconds * ms);
|
|
1440
1440
|
}
|
|
1441
1441
|
async navigate(e) {
|
|
1442
1442
|
var t;
|
|
1443
1443
|
(t = this._window) == null || t.focus();
|
|
1444
1444
|
const s = setInterval(() => {
|
|
1445
1445
|
(!this._window || this._window.closed) && this._abort.raise(new Error("Popup closed by user"));
|
|
1446
|
-
},
|
|
1446
|
+
}, fs);
|
|
1447
1447
|
return this._disposeHandlers.add(() => clearInterval(s)), await super.navigate(e);
|
|
1448
1448
|
}
|
|
1449
1449
|
close() {
|
|
@@ -1454,7 +1454,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1454
1454
|
throw new Error("No window.opener. Can't complete notification.");
|
|
1455
1455
|
return super._notifyParent(window.opener, e, t);
|
|
1456
1456
|
}
|
|
1457
|
-
},
|
|
1457
|
+
}, ws = class {
|
|
1458
1458
|
constructor(e) {
|
|
1459
1459
|
this._settings = e, this._logger = new u("PopupNavigator");
|
|
1460
1460
|
}
|
|
@@ -1462,12 +1462,12 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1462
1462
|
popupWindowFeatures: e = this._settings.popupWindowFeatures,
|
|
1463
1463
|
popupWindowTarget: t = this._settings.popupWindowTarget
|
|
1464
1464
|
}) {
|
|
1465
|
-
return new
|
|
1465
|
+
return new $e({ popupWindowFeatures: e, popupWindowTarget: t });
|
|
1466
1466
|
}
|
|
1467
1467
|
async callback(e, { keepOpen: t = !1 }) {
|
|
1468
|
-
this._logger.create("callback"),
|
|
1468
|
+
this._logger.create("callback"), $e.notifyOpener(e, t);
|
|
1469
1469
|
}
|
|
1470
|
-
},
|
|
1470
|
+
}, vs = class {
|
|
1471
1471
|
constructor(e) {
|
|
1472
1472
|
this._settings = e, this._logger = new u("RedirectNavigator");
|
|
1473
1473
|
}
|
|
@@ -1496,9 +1496,9 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1496
1496
|
}
|
|
1497
1497
|
async callback() {
|
|
1498
1498
|
}
|
|
1499
|
-
},
|
|
1499
|
+
}, Ss = class extends Vt {
|
|
1500
1500
|
constructor(e) {
|
|
1501
|
-
super({ expiringNotificationTimeInSeconds: e.accessTokenExpiringNotificationTimeInSeconds }), this._logger = new u("UserManagerEvents"), this._userLoaded = new
|
|
1501
|
+
super({ expiringNotificationTimeInSeconds: e.accessTokenExpiringNotificationTimeInSeconds }), this._logger = new u("UserManagerEvents"), this._userLoaded = new D("User loaded"), this._userUnloaded = new D("User unloaded"), this._silentRenewError = new D("Silent renew error"), this._userSignedIn = new D("User signed in"), this._userSignedOut = new D("User signed out"), this._userSessionChanged = new D("User session changed");
|
|
1502
1502
|
}
|
|
1503
1503
|
async load(e, t = !0) {
|
|
1504
1504
|
super.load(e), t && await this._userLoaded.raise(e);
|
|
@@ -1605,14 +1605,14 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1605
1605
|
async _raiseUserSessionChanged() {
|
|
1606
1606
|
await this._userSessionChanged.raise();
|
|
1607
1607
|
}
|
|
1608
|
-
},
|
|
1608
|
+
}, bs = class {
|
|
1609
1609
|
constructor(e) {
|
|
1610
|
-
this._userManager = e, this._logger = new u("SilentRenewService"), this._isStarted = !1, this._retryTimer = new
|
|
1610
|
+
this._userManager = e, this._logger = new u("SilentRenewService"), this._isStarted = !1, this._retryTimer = new M("Retry Silent Renew"), this._tokenExpiring = async () => {
|
|
1611
1611
|
const t = this._logger.create("_tokenExpiring");
|
|
1612
1612
|
try {
|
|
1613
1613
|
await this._userManager.signinSilent(), t.debug("silent token renewal successful");
|
|
1614
1614
|
} catch (s) {
|
|
1615
|
-
if (s instanceof
|
|
1615
|
+
if (s instanceof Re) {
|
|
1616
1616
|
t.warn("ErrorTimeout from signinSilent:", s, "retry in 5s"), this._retryTimer.init(5);
|
|
1617
1617
|
return;
|
|
1618
1618
|
}
|
|
@@ -1634,13 +1634,13 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1634
1634
|
stop() {
|
|
1635
1635
|
this._isStarted && (this._retryTimer.cancel(), this._retryTimer.removeHandler(this._tokenExpiring), this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring), this._isStarted = !1);
|
|
1636
1636
|
}
|
|
1637
|
-
},
|
|
1637
|
+
}, ys = class {
|
|
1638
1638
|
constructor(e) {
|
|
1639
1639
|
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;
|
|
1640
1640
|
}
|
|
1641
|
-
},
|
|
1641
|
+
}, ks = class {
|
|
1642
1642
|
constructor(e, t, s, i) {
|
|
1643
|
-
this._logger = new u("UserManager"), this.settings = new
|
|
1643
|
+
this._logger = new u("UserManager"), this.settings = new _s(e), this._client = new ds(e), this._redirectNavigator = t ?? new vs(this.settings), this._popupNavigator = s ?? new ws(this.settings), this._iframeNavigator = i ?? new ps(this.settings), this._events = new Ss(this.settings), this._silentRenewService = new bs(this), this.settings.automaticSilentRenew && this.startSilentRenew(), this._sessionMonitor = null, this.settings.monitorSession && (this._sessionMonitor = new hs(this));
|
|
1644
1644
|
}
|
|
1645
1645
|
/**
|
|
1646
1646
|
* Get object used to register for events raised by the `UserManager`.
|
|
@@ -1765,7 +1765,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1765
1765
|
let n = await this._loadUser();
|
|
1766
1766
|
if (n != null && n.refresh_token) {
|
|
1767
1767
|
s.debug("using refresh token");
|
|
1768
|
-
const d = new
|
|
1768
|
+
const d = new ys(n);
|
|
1769
1769
|
return await this._useRefreshToken({
|
|
1770
1770
|
state: d,
|
|
1771
1771
|
redirect_uri: r.redirect_uri,
|
|
@@ -1791,7 +1791,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1791
1791
|
const t = await this._client.useRefreshToken({
|
|
1792
1792
|
...e,
|
|
1793
1793
|
timeoutInSeconds: this.settings.silentRequestTimeoutInSeconds
|
|
1794
|
-
}), s = new
|
|
1794
|
+
}), s = new he({ ...e.state, ...t });
|
|
1795
1795
|
return await this.storeUser(s), await this._events.load(s), s;
|
|
1796
1796
|
}
|
|
1797
1797
|
/**
|
|
@@ -1921,7 +1921,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
1921
1921
|
return s.debug("got signin response"), await this._buildUser(i, t);
|
|
1922
1922
|
}
|
|
1923
1923
|
async _buildUser(e, t) {
|
|
1924
|
-
const s = this._logger.create("_buildUser"), i = new
|
|
1924
|
+
const s = this._logger.create("_buildUser"), i = new he(e);
|
|
1925
1925
|
if (t) {
|
|
1926
1926
|
if (t !== i.profile.sub)
|
|
1927
1927
|
throw s.debug("current user does not match user returned from signin. sub from signin:", i.profile.sub), new W({ ...e, error: "login_required" });
|
|
@@ -2003,7 +2003,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
2003
2003
|
const r = await this._loadUser();
|
|
2004
2004
|
i.debug("loaded current user from storage"), this.settings.revokeTokensOnSignout && await this._revokeInternal(r);
|
|
2005
2005
|
const n = e.id_token_hint || r && r.id_token;
|
|
2006
|
-
n && (i.debug("setting id_token_hint in signout request"), e.id_token_hint = n);
|
|
2006
|
+
n && (i.debug("setting id_token_hint in signout request"), e.id_token_hint = n), await this.removeUser(), i.debug("user removed, creating signout request");
|
|
2007
2007
|
const a = await this._client.createSignoutRequest(e);
|
|
2008
2008
|
return i.debug("got signout request"), await t.navigate({
|
|
2009
2009
|
url: a.url,
|
|
@@ -2016,7 +2016,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
2016
2016
|
}
|
|
2017
2017
|
async _signoutEnd(e) {
|
|
2018
2018
|
const t = this._logger.create("_signoutEnd"), s = await this._client.processSignoutResponse(e);
|
|
2019
|
-
return t.debug("got signout response"),
|
|
2019
|
+
return t.debug("got signout response"), s;
|
|
2020
2020
|
}
|
|
2021
2021
|
/**
|
|
2022
2022
|
* Trigger a silent request (via an iframe) to the end session endpoint.
|
|
@@ -2086,7 +2086,7 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
2086
2086
|
}
|
|
2087
2087
|
async _loadUser() {
|
|
2088
2088
|
const e = this._logger.create("_loadUser"), t = await this.settings.userStore.get(this._userStoreKey);
|
|
2089
|
-
return t ? (e.debug("user storageString loaded"),
|
|
2089
|
+
return t ? (e.debug("user storageString loaded"), he.fromStorageString(t)) : (e.debug("no user storageString"), null);
|
|
2090
2090
|
}
|
|
2091
2091
|
async storeUser(e) {
|
|
2092
2092
|
const t = this._logger.create("storeUser");
|
|
@@ -2104,28 +2104,28 @@ var Zt = Ve, es = "openid", ce = class {
|
|
|
2104
2104
|
await this._client.clearStaleState();
|
|
2105
2105
|
}
|
|
2106
2106
|
};
|
|
2107
|
-
const
|
|
2108
|
-
function
|
|
2107
|
+
const Ts = ["url", "clientId", "redirectUri", "scope"], Is = "openid profile email";
|
|
2108
|
+
function Es(e, t) {
|
|
2109
2109
|
const s = {};
|
|
2110
2110
|
return e.forEach((i) => {
|
|
2111
2111
|
t[i] !== void 0 && (s[i] = t[i]);
|
|
2112
2112
|
}), s;
|
|
2113
2113
|
}
|
|
2114
2114
|
let _;
|
|
2115
|
-
const
|
|
2116
|
-
const t =
|
|
2117
|
-
return new
|
|
2115
|
+
const Cs = (e) => {
|
|
2116
|
+
const t = Es(Ts, e);
|
|
2117
|
+
return new ks({
|
|
2118
2118
|
authority: t.url,
|
|
2119
2119
|
client_id: t.clientId,
|
|
2120
2120
|
redirect_uri: t.redirectUri,
|
|
2121
2121
|
response_type: "code",
|
|
2122
|
-
scope: t.scope ||
|
|
2122
|
+
scope: t.scope || Is,
|
|
2123
2123
|
filterProtocolClaims: !0,
|
|
2124
2124
|
includeIdTokenInSilentRenew: !0,
|
|
2125
2125
|
includeIdTokenInSilentSignout: !0,
|
|
2126
2126
|
loadUserInfo: !0
|
|
2127
2127
|
});
|
|
2128
|
-
},
|
|
2128
|
+
}, Rs = async () => {
|
|
2129
2129
|
try {
|
|
2130
2130
|
console.debug("[Auth] Logging in using OIDC");
|
|
2131
2131
|
const e = new URL(window.location.href), t = await (_ == null ? void 0 : _.getUser());
|
|
@@ -2137,63 +2137,94 @@ const ks = (e) => {
|
|
|
2137
2137
|
} catch (e) {
|
|
2138
2138
|
console.error("[Auth] Error logging in using OIDC: ", e);
|
|
2139
2139
|
}
|
|
2140
|
-
},
|
|
2140
|
+
}, xs = async () => _ == null ? void 0 : _.removeUser().then(() => _ == null ? void 0 : _.signoutRedirect({ post_logout_redirect_uri: window.location.href })), Us = async () => await (_ == null ? void 0 : _.getUser()) != null, As = async () => {
|
|
2141
2141
|
const e = await (_ == null ? void 0 : _.getUser());
|
|
2142
2142
|
return Promise.resolve(e == null ? void 0 : e.id_token);
|
|
2143
|
-
},
|
|
2143
|
+
}, Ps = async () => {
|
|
2144
2144
|
const e = await (_ == null ? void 0 : _.getUser());
|
|
2145
2145
|
return Promise.resolve(e == null ? void 0 : e.profile.preferred_username);
|
|
2146
|
-
}
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2146
|
+
};
|
|
2147
|
+
let z, G;
|
|
2148
|
+
const Os = async (e, t) => {
|
|
2149
|
+
try {
|
|
2150
|
+
console.debug("[Auth] Setting Username and Password for BasicAuth"), z = e, G = t;
|
|
2151
|
+
} catch (s) {
|
|
2152
|
+
console.error("[Auth] Error logging in using BasicAuth: ", s);
|
|
2153
|
+
}
|
|
2154
|
+
}, Ns = async () => {
|
|
2155
|
+
console.debug("[Auth] Logout for BasicAuth"), z = void 0, G = void 0, window.location.reload();
|
|
2156
|
+
}, qs = async () => z !== void 0 && G !== void 0, js = async () => Promise.resolve(z), Hs = () => {
|
|
2157
|
+
if (z !== void 0 && G != null)
|
|
2158
|
+
return {
|
|
2159
|
+
username: z,
|
|
2160
|
+
password: G
|
|
2161
|
+
};
|
|
2162
|
+
}, nt = () => {
|
|
2163
|
+
const e = ht($t);
|
|
2164
|
+
return e.type === "oidc" ? (_ === void 0 && (console.debug("[Auth] Creating OIDC UserManager with options: ", e.options), _ = Cs(e.options)), {
|
|
2165
|
+
isOidcAuthEnabled: () => !0,
|
|
2166
|
+
isBasicAuthEnabled: () => !1,
|
|
2167
|
+
isAuthenticated: Us,
|
|
2168
|
+
getToken: As,
|
|
2169
|
+
getUsernameAndPassword: () => {
|
|
2170
|
+
},
|
|
2171
|
+
getUsername: Ps,
|
|
2172
|
+
login: Rs,
|
|
2173
|
+
logout: xs
|
|
2174
|
+
}) : e.type === "basic" ? {
|
|
2175
|
+
isOidcAuthEnabled: () => !1,
|
|
2176
|
+
isBasicAuthEnabled: () => !0,
|
|
2177
|
+
isAuthenticated: qs,
|
|
2178
|
+
getToken: () => Promise.resolve(void 0),
|
|
2179
|
+
getUsernameAndPassword: Hs,
|
|
2180
|
+
getUsername: js,
|
|
2181
|
+
login: Os,
|
|
2182
|
+
logout: Ns
|
|
2183
|
+
} : {
|
|
2184
|
+
isOidcAuthEnabled: () => !1,
|
|
2185
|
+
isBasicAuthEnabled: () => !1,
|
|
2157
2186
|
isAuthenticated: () => Promise.resolve(!1),
|
|
2158
2187
|
getToken: () => Promise.resolve(void 0),
|
|
2159
2188
|
getUsername: () => Promise.resolve(void 0),
|
|
2189
|
+
getUsernameAndPassword: () => {
|
|
2190
|
+
},
|
|
2160
2191
|
login: () => Promise.resolve(),
|
|
2161
2192
|
logout: () => Promise.resolve()
|
|
2162
2193
|
};
|
|
2163
|
-
},
|
|
2164
|
-
const [t, s] =
|
|
2165
|
-
return
|
|
2194
|
+
}, Ls = (e) => {
|
|
2195
|
+
const [t, s] = I(null), i = e.format || "locale";
|
|
2196
|
+
return ye(() => {
|
|
2166
2197
|
let r;
|
|
2167
|
-
if (e.date && typeof e.date == "string" ? r =
|
|
2198
|
+
if (e.date && typeof e.date == "string" ? r = le.fromISO(e.date) : e.date && typeof e.date == "object" && (r = le.fromJSDate(e.date)), r) {
|
|
2168
2199
|
const n = {
|
|
2169
2200
|
locale: e.locale
|
|
2170
2201
|
};
|
|
2171
|
-
s(i === "fromNow" ? r.toRelative() : i === "locale" ? r.toLocaleString(
|
|
2202
|
+
s(i === "fromNow" ? r.toRelative() : i === "locale" ? r.toLocaleString(le.DATETIME_FULL, n) : r.toFormat(i, n));
|
|
2172
2203
|
} else
|
|
2173
2204
|
s(null);
|
|
2174
2205
|
}, [e.date]), /* @__PURE__ */ c("span", { children: t || "" });
|
|
2175
|
-
},
|
|
2176
|
-
const n = () => !e || e.length === 0, a = t || /* @__PURE__ */
|
|
2177
|
-
/* @__PURE__ */ c(
|
|
2178
|
-
/* @__PURE__ */ c(
|
|
2206
|
+
}, Xs = (e) => /* @__PURE__ */ c(Ls, { date: e.date, format: "fromNow" }), A = ({ condition: e, children: t }) => (typeof e == "boolean" ? e : e()) ? /* @__PURE__ */ c(j.Fragment, { children: t }) : /* @__PURE__ */ c(j.Fragment, {}), Ys = ({ collection: e, emptyState: t, emptyStateTitle: s, emptyStateMessage: i, children: r }) => {
|
|
2207
|
+
const n = () => !e || e.length === 0, a = t || /* @__PURE__ */ f(ee, { variant: gt.xs, children: [
|
|
2208
|
+
/* @__PURE__ */ c(te, { titleText: s || "None found", headingLevel: "h4" }),
|
|
2209
|
+
/* @__PURE__ */ c(ge, { children: i || "No items found." })
|
|
2179
2210
|
] });
|
|
2180
2211
|
return n() ? /* @__PURE__ */ c(j.Fragment, { children: a }) : /* @__PURE__ */ c(j.Fragment, { children: r });
|
|
2181
|
-
},
|
|
2182
|
-
const i = () => typeof e == "boolean" ? e : e(), r = t || /* @__PURE__ */ c(
|
|
2212
|
+
}, ne = ({ isLoading: e, loadingComponent: t, children: s }) => {
|
|
2213
|
+
const i = () => typeof e == "boolean" ? e : e(), r = t || /* @__PURE__ */ c(Q, {});
|
|
2183
2214
|
return i() ? /* @__PURE__ */ c(j.Fragment, { children: r }) : /* @__PURE__ */ c(j.Fragment, { children: s });
|
|
2184
|
-
},
|
|
2215
|
+
}, Zs = ({ toolbar: e, alwaysShowToolbar: t, emptyState: s, filteredEmptyState: i, isLoading: r, isError: n, loadingComponent: a, errorComponent: o, isEmpty: l, isFiltered: d, children: h }) => {
|
|
2185
2216
|
const g = t || !l || d || n;
|
|
2186
|
-
return o || (o = /* @__PURE__ */ c("div", { style: { padding: "15px", backgroundColor: "white" }, children: /* @__PURE__ */ c(
|
|
2187
|
-
/* @__PURE__ */ c(
|
|
2188
|
-
/* @__PURE__ */
|
|
2189
|
-
/* @__PURE__ */ c(
|
|
2190
|
-
/* @__PURE__ */ c(
|
|
2191
|
-
/* @__PURE__ */ c(
|
|
2192
|
-
/* @__PURE__ */ c(
|
|
2217
|
+
return o || (o = /* @__PURE__ */ c("div", { style: { padding: "15px", backgroundColor: "white" }, children: /* @__PURE__ */ c(ut, { isInline: !0, variant: "danger", title: "Error: Something went wrong!", children: /* @__PURE__ */ c("p", { children: "Something went wrong with the action you attempted, but we're not sure what it was. Try reloading the page and hopef for a better result, or contact your admin to report the error." }) }) })), /* @__PURE__ */ f(j.Fragment, { children: [
|
|
2218
|
+
/* @__PURE__ */ c(A, { condition: g, children: e }),
|
|
2219
|
+
/* @__PURE__ */ f(ne, { isLoading: r, loadingComponent: a, children: [
|
|
2220
|
+
/* @__PURE__ */ c(A, { condition: !l && !n, children: h }),
|
|
2221
|
+
/* @__PURE__ */ c(A, { condition: l && d && !n, children: i }),
|
|
2222
|
+
/* @__PURE__ */ c(A, { condition: l && !d && !n, children: s }),
|
|
2223
|
+
/* @__PURE__ */ c(A, { condition: n, children: o })
|
|
2193
2224
|
] })
|
|
2194
2225
|
] });
|
|
2195
|
-
},
|
|
2196
|
-
const [t, s] =
|
|
2226
|
+
}, ei = (e) => {
|
|
2227
|
+
const [t, s] = I(!1), i = (l, d) => {
|
|
2197
2228
|
s(!1);
|
|
2198
2229
|
const h = d;
|
|
2199
2230
|
h !== void 0 && h >= 0 ? e.onSelect(e.items[h]) : e.onSelect(void 0);
|
|
@@ -2205,15 +2236,15 @@ const ks = (e) => {
|
|
|
2205
2236
|
}, a = e.popperProps || {
|
|
2206
2237
|
appendTo: e.menuAppendTo
|
|
2207
2238
|
};
|
|
2208
|
-
let o = /* @__PURE__ */ c(
|
|
2239
|
+
let o = /* @__PURE__ */ c(Pt, { title: e.label });
|
|
2209
2240
|
return e.isKebab || (o = /* @__PURE__ */ c(j.Fragment, { children: e.label })), /* @__PURE__ */ c(
|
|
2210
|
-
|
|
2241
|
+
_t,
|
|
2211
2242
|
{
|
|
2212
2243
|
isOpen: t,
|
|
2213
2244
|
onSelect: i,
|
|
2214
2245
|
onOpenChange: (l) => s(l),
|
|
2215
2246
|
toggle: (l) => /* @__PURE__ */ c(
|
|
2216
|
-
|
|
2247
|
+
ae,
|
|
2217
2248
|
{
|
|
2218
2249
|
"data-testid": e.testId,
|
|
2219
2250
|
ref: l,
|
|
@@ -2226,8 +2257,8 @@ const ks = (e) => {
|
|
|
2226
2257
|
ouiaId: "ObjectDropdown",
|
|
2227
2258
|
popperProps: a,
|
|
2228
2259
|
shouldFocusToggleOnSelect: !0,
|
|
2229
|
-
children: /* @__PURE__ */ c(
|
|
2230
|
-
|
|
2260
|
+
children: /* @__PURE__ */ c(pt, { children: e.items.map((l, d) => e.itemIsVisible !== void 0 && !e.itemIsVisible(l) ? /* @__PURE__ */ c(oe, {}) : e.itemIsDivider && e.itemIsDivider(l) ? /* @__PURE__ */ c(Ke, { component: "li" }, `divider-${d}`) : /* @__PURE__ */ c(
|
|
2261
|
+
ft,
|
|
2231
2262
|
{
|
|
2232
2263
|
value: d,
|
|
2233
2264
|
isDisabled: e.itemIsDisabled === void 0 ? !1 : e.itemIsDisabled(l),
|
|
@@ -2238,9 +2269,9 @@ const ks = (e) => {
|
|
|
2238
2269
|
)) })
|
|
2239
2270
|
}
|
|
2240
2271
|
);
|
|
2241
|
-
},
|
|
2272
|
+
}, ti = (e) => {
|
|
2242
2273
|
var o;
|
|
2243
|
-
const [t, s] =
|
|
2274
|
+
const [t, s] = I(!1), i = (l, d) => {
|
|
2244
2275
|
s(!1), e.onSelect(e.items[d]);
|
|
2245
2276
|
}, r = () => {
|
|
2246
2277
|
s(!t);
|
|
@@ -2249,10 +2280,10 @@ const ks = (e) => {
|
|
|
2249
2280
|
return e.itemToTestId !== void 0 && (d = e.itemToTestId(l)), d;
|
|
2250
2281
|
};
|
|
2251
2282
|
return /* @__PURE__ */ c(
|
|
2252
|
-
|
|
2283
|
+
Te,
|
|
2253
2284
|
{
|
|
2254
2285
|
toggle: (l) => /* @__PURE__ */ c(
|
|
2255
|
-
|
|
2286
|
+
ae,
|
|
2256
2287
|
{
|
|
2257
2288
|
ref: l,
|
|
2258
2289
|
className: e.toggleClassname || "menu-toggle",
|
|
@@ -2266,8 +2297,8 @@ const ks = (e) => {
|
|
|
2266
2297
|
onSelect: i,
|
|
2267
2298
|
onOpenChange: s,
|
|
2268
2299
|
isOpen: t,
|
|
2269
|
-
children: (o = e.items) == null ? void 0 : o.map((l, d) => e.itemIsDivider && e.itemIsDivider(l) ? /* @__PURE__ */ c(
|
|
2270
|
-
|
|
2300
|
+
children: (o = e.items) == null ? void 0 : o.map((l, d) => e.itemIsDivider && e.itemIsDivider(l) ? /* @__PURE__ */ c(Ke, {}, d) : /* @__PURE__ */ c(
|
|
2301
|
+
Ie,
|
|
2271
2302
|
{
|
|
2272
2303
|
isSelected: l === e.value,
|
|
2273
2304
|
component: (h) => /* @__PURE__ */ c("button", { ...h, "data-testid": n(l) }),
|
|
@@ -2278,19 +2309,19 @@ const ks = (e) => {
|
|
|
2278
2309
|
))
|
|
2279
2310
|
}
|
|
2280
2311
|
);
|
|
2281
|
-
},
|
|
2312
|
+
}, si = ({ expanded: e, onClick: t }) => e ? /* @__PURE__ */ c(Ot, { onClick: t, style: { cursor: "pointer" } }) : /* @__PURE__ */ c(Nt, { onClick: t, style: { cursor: "pointer" } }), ot = {
|
|
2282
2313
|
padding: "5px",
|
|
2283
2314
|
minHeight: "128px",
|
|
2284
2315
|
borderRight: 0,
|
|
2285
2316
|
borderLeft: 0,
|
|
2286
2317
|
borderBottom: "1px solid #666",
|
|
2287
2318
|
backgroundColor: "rgb(240, 240, 240)"
|
|
2288
|
-
},
|
|
2289
|
-
...
|
|
2319
|
+
}, Ms = {
|
|
2320
|
+
...ot,
|
|
2290
2321
|
color: "red",
|
|
2291
2322
|
overflow: "auto"
|
|
2292
|
-
},
|
|
2293
|
-
const [t, s] =
|
|
2323
|
+
}, ii = (e) => {
|
|
2324
|
+
const [t, s] = I(""), [i, r] = I(""), [n, a] = I(!1), [o, l] = I(), d = (k, x) => {
|
|
2294
2325
|
s(x);
|
|
2295
2326
|
}, h = () => t != null && t.trim().length > 0, g = () => o != null && o.trim().length > 0, v = () => {
|
|
2296
2327
|
a(!0), e.onUrlFetch(t).then((k) => {
|
|
@@ -2300,14 +2331,14 @@ const ks = (e) => {
|
|
|
2300
2331
|
});
|
|
2301
2332
|
}, b = () => {
|
|
2302
2333
|
s(""), r(""), e.onChange(void 0, void 0);
|
|
2303
|
-
}, R = /* @__PURE__ */
|
|
2304
|
-
/* @__PURE__ */ c(
|
|
2334
|
+
}, R = /* @__PURE__ */ f("div", { className: "url-upload-loading", style: ot, children: [
|
|
2335
|
+
/* @__PURE__ */ c(Q, { size: "md", className: "spinner", style: { marginRight: "5px" } }),
|
|
2305
2336
|
/* @__PURE__ */ c("span", { className: "spinner-message", children: "Loading URL content" })
|
|
2306
2337
|
] });
|
|
2307
|
-
return /* @__PURE__ */
|
|
2308
|
-
/* @__PURE__ */
|
|
2338
|
+
return /* @__PURE__ */ f("div", { className: "url-upload", "data-testid": e.testId, children: [
|
|
2339
|
+
/* @__PURE__ */ f("div", { className: "url-upload-flex", style: { display: "flex" }, children: [
|
|
2309
2340
|
/* @__PURE__ */ c("div", { className: "url-upload-url", style: { flexGrow: 1 }, children: /* @__PURE__ */ c(
|
|
2310
|
-
|
|
2341
|
+
ue,
|
|
2311
2342
|
{
|
|
2312
2343
|
"data-testid": `${e.testId}-input`,
|
|
2313
2344
|
value: t,
|
|
@@ -2318,16 +2349,16 @@ const ks = (e) => {
|
|
|
2318
2349
|
"aria-label": "url input"
|
|
2319
2350
|
}
|
|
2320
2351
|
) }),
|
|
2321
|
-
/* @__PURE__ */ c("div", { className: "url-fetch-button", children: /* @__PURE__ */ c(
|
|
2322
|
-
/* @__PURE__ */ c("div", { className: "url-clear-button", children: /* @__PURE__ */ c(
|
|
2352
|
+
/* @__PURE__ */ c("div", { className: "url-fetch-button", children: /* @__PURE__ */ c(_e, { "data-testid": `${e.testId}-fetch`, variant: "control", isDisabled: !h(), onClick: v, children: "Fetch" }) }),
|
|
2353
|
+
/* @__PURE__ */ c("div", { className: "url-clear-button", children: /* @__PURE__ */ c(_e, { "data-testid": `${e.testId}-clear`, variant: "control", isDisabled: !h(), onClick: b, children: "Clear" }) })
|
|
2323
2354
|
] }),
|
|
2324
|
-
/* @__PURE__ */ c("div", { className: "url-upload-preview", children: /* @__PURE__ */
|
|
2325
|
-
/* @__PURE__ */ c(
|
|
2355
|
+
/* @__PURE__ */ c("div", { className: "url-upload-preview", children: /* @__PURE__ */ f(ne, { isLoading: n, loadingComponent: R, children: [
|
|
2356
|
+
/* @__PURE__ */ c(A, { condition: g, children: /* @__PURE__ */ f("div", { className: "url-upload-error", style: Ms, children: [
|
|
2326
2357
|
/* @__PURE__ */ c("div", { children: "Error getting content from URL." }),
|
|
2327
2358
|
/* @__PURE__ */ c("div", { children: o })
|
|
2328
2359
|
] }) }),
|
|
2329
|
-
/* @__PURE__ */ c(
|
|
2330
|
-
|
|
2360
|
+
/* @__PURE__ */ c(A, { condition: !g(), children: /* @__PURE__ */ c(
|
|
2361
|
+
mt,
|
|
2331
2362
|
{
|
|
2332
2363
|
"data-testid": `${e.testId}-preview`,
|
|
2333
2364
|
"aria-label": "url-content",
|
|
@@ -2338,49 +2369,130 @@ const ks = (e) => {
|
|
|
2338
2369
|
) })
|
|
2339
2370
|
] }) })
|
|
2340
2371
|
] });
|
|
2341
|
-
},
|
|
2342
|
-
const [t, s] =
|
|
2372
|
+
}, Ds = (e) => {
|
|
2373
|
+
const [t, s] = I({
|
|
2374
|
+
username: "",
|
|
2375
|
+
password: ""
|
|
2376
|
+
}), i = () => {
|
|
2377
|
+
e.onLogin(t);
|
|
2378
|
+
}, r = (a, o) => {
|
|
2379
|
+
s({
|
|
2380
|
+
...t,
|
|
2381
|
+
username: o
|
|
2382
|
+
});
|
|
2383
|
+
}, n = (a, o) => {
|
|
2384
|
+
s({
|
|
2385
|
+
...t,
|
|
2386
|
+
password: o
|
|
2387
|
+
});
|
|
2388
|
+
};
|
|
2389
|
+
return /* @__PURE__ */ c(
|
|
2390
|
+
Ee,
|
|
2391
|
+
{
|
|
2392
|
+
title: "Login",
|
|
2393
|
+
variant: "small",
|
|
2394
|
+
isOpen: !0,
|
|
2395
|
+
header: /* @__PURE__ */ c("a", { href: "#" }),
|
|
2396
|
+
showClose: !1,
|
|
2397
|
+
className: "please-wait pf-m-redhat-font",
|
|
2398
|
+
"aria-label": "please-wait-modal",
|
|
2399
|
+
style: { marginTop: "-15px" },
|
|
2400
|
+
actions: [
|
|
2401
|
+
/* @__PURE__ */ c(_e, { variant: "primary", "data-testid": "modal-btn-login", onClick: i, isDisabled: (t == null ? void 0 : t.username) === "" || (t == null ? void 0 : t.password) === "", children: "Login" }, "login")
|
|
2402
|
+
],
|
|
2403
|
+
children: /* @__PURE__ */ f(wt, { children: [
|
|
2404
|
+
/* @__PURE__ */ c(
|
|
2405
|
+
Ne,
|
|
2406
|
+
{
|
|
2407
|
+
label: "Username",
|
|
2408
|
+
fieldId: "form-username",
|
|
2409
|
+
children: /* @__PURE__ */ c(
|
|
2410
|
+
ue,
|
|
2411
|
+
{
|
|
2412
|
+
isRequired: !0,
|
|
2413
|
+
type: "text",
|
|
2414
|
+
id: "form-username",
|
|
2415
|
+
"data-testid": "basic-auth-login-modal-username",
|
|
2416
|
+
name: "form-username",
|
|
2417
|
+
value: t == null ? void 0 : t.username,
|
|
2418
|
+
placeholder: "Username",
|
|
2419
|
+
onChange: r
|
|
2420
|
+
}
|
|
2421
|
+
)
|
|
2422
|
+
}
|
|
2423
|
+
),
|
|
2424
|
+
/* @__PURE__ */ c(
|
|
2425
|
+
Ne,
|
|
2426
|
+
{
|
|
2427
|
+
label: "Password",
|
|
2428
|
+
fieldId: "form-password",
|
|
2429
|
+
children: /* @__PURE__ */ c(
|
|
2430
|
+
ue,
|
|
2431
|
+
{
|
|
2432
|
+
isRequired: !0,
|
|
2433
|
+
type: "text",
|
|
2434
|
+
id: "form-password",
|
|
2435
|
+
"data-testid": "basic-auth-login-modal-password",
|
|
2436
|
+
name: "form-password",
|
|
2437
|
+
value: t == null ? void 0 : t.password,
|
|
2438
|
+
placeholder: "Password",
|
|
2439
|
+
onChange: n
|
|
2440
|
+
}
|
|
2441
|
+
)
|
|
2442
|
+
}
|
|
2443
|
+
)
|
|
2444
|
+
] })
|
|
2445
|
+
}
|
|
2446
|
+
);
|
|
2447
|
+
}, ri = (e) => {
|
|
2448
|
+
const [t, s] = I(
|
|
2343
2449
|
0
|
|
2344
2450
|
/* AUTHENTICATING */
|
|
2345
|
-
), i =
|
|
2346
|
-
|
|
2347
|
-
|
|
2451
|
+
), i = nt(), r = (n) => {
|
|
2452
|
+
console.info("[ApplicationAuth] Using username and password."), i.login(n.username, n.password), s(
|
|
2453
|
+
1
|
|
2454
|
+
/* AUTHENTICATED */
|
|
2455
|
+
);
|
|
2456
|
+
};
|
|
2457
|
+
return ye(() => {
|
|
2458
|
+
i.isOidcAuthEnabled() ? i.login("", "").then(() => {
|
|
2348
2459
|
console.info("[ApplicationAuth] Authentication successful."), s(
|
|
2349
2460
|
1
|
|
2350
2461
|
/* AUTHENTICATED */
|
|
2351
2462
|
);
|
|
2352
|
-
}).catch((
|
|
2353
|
-
console.error("[ApplicationAuth] Authentication failed: ",
|
|
2463
|
+
}).catch((n) => {
|
|
2464
|
+
console.error("[ApplicationAuth] Authentication failed: ", n), s(
|
|
2354
2465
|
2
|
|
2355
2466
|
/* AUTHENTICATION_FAILED */
|
|
2356
2467
|
);
|
|
2357
|
-
}) : s(
|
|
2468
|
+
}) : i.isBasicAuthEnabled() || s(
|
|
2358
2469
|
1
|
|
2359
2470
|
/* AUTHENTICATED */
|
|
2360
2471
|
);
|
|
2361
|
-
}, []), /* @__PURE__ */
|
|
2362
|
-
/* @__PURE__ */ c(
|
|
2363
|
-
/* @__PURE__ */ c(
|
|
2364
|
-
/* @__PURE__ */ c(
|
|
2472
|
+
}, []), /* @__PURE__ */ f(oe, { children: [
|
|
2473
|
+
/* @__PURE__ */ c(A, { condition: t === 0 && i.isOidcAuthEnabled(), children: /* @__PURE__ */ f(ee, { children: [
|
|
2474
|
+
/* @__PURE__ */ c(te, { titleText: "Loading", headingLevel: "h4" }),
|
|
2475
|
+
/* @__PURE__ */ c(ge, { children: /* @__PURE__ */ c(Q, { size: "xl", "aria-label": "Loading spinner" }) })
|
|
2365
2476
|
] }) }),
|
|
2366
|
-
/* @__PURE__ */ c(
|
|
2367
|
-
|
|
2368
|
-
/* @__PURE__ */ c(
|
|
2477
|
+
/* @__PURE__ */ c(A, { condition: t === 0 && i.isBasicAuthEnabled(), children: /* @__PURE__ */ c(Ds, { onLogin: r }) }),
|
|
2478
|
+
/* @__PURE__ */ c(A, { condition: t === 2, children: /* @__PURE__ */ f(ee, { children: [
|
|
2479
|
+
/* @__PURE__ */ c(te, { titleText: "Empty state", headingLevel: "h4", icon: /* @__PURE__ */ c(ze, { icon: qt }) }),
|
|
2480
|
+
/* @__PURE__ */ c(ge, { children: "Authentication failed." })
|
|
2369
2481
|
] }) }),
|
|
2370
|
-
/* @__PURE__ */ c(
|
|
2482
|
+
/* @__PURE__ */ c(A, { condition: t === 1, children: e.children })
|
|
2371
2483
|
] });
|
|
2372
|
-
},
|
|
2373
|
-
const t =
|
|
2484
|
+
}, ni = (e) => {
|
|
2485
|
+
const t = nt();
|
|
2374
2486
|
return (() => {
|
|
2375
2487
|
let i = !0;
|
|
2376
|
-
return e.enabled !== void 0 && (i = i && t.
|
|
2488
|
+
return e.enabled !== void 0 && (i = i && (t.isOidcAuthEnabled() === e.enabled || t.isBasicAuthEnabled() === e.enabled)), i;
|
|
2377
2489
|
})() ? /* @__PURE__ */ c(j.Fragment, { children: e.children }) : /* @__PURE__ */ c(j.Fragment, {});
|
|
2378
|
-
},
|
|
2379
|
-
const [t, s] =
|
|
2380
|
-
return
|
|
2490
|
+
}, oi = (e) => {
|
|
2491
|
+
const [t, s] = I(), [i, r] = I(), n = (a) => typeof a == "string" ? a : a === void 0 ? "" : a.toDateString();
|
|
2492
|
+
return ye(() => {
|
|
2381
2493
|
e.isOpen && (typeof e.frontendInfo == "function" ? e.frontendInfo().then(s) : s(e.frontendInfo), typeof e.backendInfo == "function" ? e.backendInfo().then(r) : r(e.backendInfo));
|
|
2382
2494
|
}, [e.isOpen]), /* @__PURE__ */ c(
|
|
2383
|
-
|
|
2495
|
+
vt,
|
|
2384
2496
|
{
|
|
2385
2497
|
className: "app-about-modal",
|
|
2386
2498
|
isOpen: e.isOpen,
|
|
@@ -2389,9 +2501,9 @@ const ks = (e) => {
|
|
|
2389
2501
|
brandImageSrc: e.brandImageSrc,
|
|
2390
2502
|
brandImageAlt: e.brandImageAlt,
|
|
2391
2503
|
"aria-label": e.brandImageAlt,
|
|
2392
|
-
children: /* @__PURE__ */
|
|
2393
|
-
/* @__PURE__ */ c(
|
|
2394
|
-
/* @__PURE__ */ c(
|
|
2504
|
+
children: /* @__PURE__ */ f(St, { className: "app-about-modal-content", style: { marginTop: "-25px" }, children: [
|
|
2505
|
+
/* @__PURE__ */ c(qe, { component: je.h2, children: "Web console info" }),
|
|
2506
|
+
/* @__PURE__ */ c(ne, { isLoading: t === void 0, children: /* @__PURE__ */ f(He, { component: "dl", children: [
|
|
2395
2507
|
/* @__PURE__ */ c(y, { component: "dt", children: "Project" }),
|
|
2396
2508
|
/* @__PURE__ */ c(y, { component: "dd", children: /* @__PURE__ */ c("a", { href: t == null ? void 0 : t.url, target: "_blank", children: t == null ? void 0 : t.name }) }),
|
|
2397
2509
|
/* @__PURE__ */ c(y, { component: "dt", children: "Version" }),
|
|
@@ -2401,8 +2513,8 @@ const ks = (e) => {
|
|
|
2401
2513
|
/* @__PURE__ */ c(y, { component: "dt", children: "Digest" }),
|
|
2402
2514
|
/* @__PURE__ */ c(y, { component: "dd", children: t == null ? void 0 : t.digest })
|
|
2403
2515
|
] }) }),
|
|
2404
|
-
/* @__PURE__ */ c(
|
|
2405
|
-
/* @__PURE__ */ c(
|
|
2516
|
+
/* @__PURE__ */ c(qe, { style: { marginTop: "40px" }, component: je.h2, children: e.backendLabel }),
|
|
2517
|
+
/* @__PURE__ */ c(ne, { isLoading: i === void 0, children: /* @__PURE__ */ f(He, { component: "dl", children: [
|
|
2406
2518
|
/* @__PURE__ */ c(y, { component: "dt", children: "Name" }),
|
|
2407
2519
|
/* @__PURE__ */ c(y, { component: "dd", children: (i == null ? void 0 : i.name) || "" }),
|
|
2408
2520
|
/* @__PURE__ */ c(y, { component: "dt", children: "Description" }),
|
|
@@ -2415,8 +2527,8 @@ const ks = (e) => {
|
|
|
2415
2527
|
] })
|
|
2416
2528
|
}
|
|
2417
2529
|
);
|
|
2418
|
-
},
|
|
2419
|
-
|
|
2530
|
+
}, ai = (e) => /* @__PURE__ */ f(
|
|
2531
|
+
Ee,
|
|
2420
2532
|
{
|
|
2421
2533
|
title: "Please Wait",
|
|
2422
2534
|
variant: "small",
|
|
@@ -2427,12 +2539,12 @@ const ks = (e) => {
|
|
|
2427
2539
|
"aria-label": "please-wait-modal",
|
|
2428
2540
|
style: { marginTop: "-15px" },
|
|
2429
2541
|
children: [
|
|
2430
|
-
/* @__PURE__ */ c(
|
|
2542
|
+
/* @__PURE__ */ c(Q, { size: "md", className: "spinner" }),
|
|
2431
2543
|
/* @__PURE__ */ c("span", { className: "message", style: { fontSize: "15px", color: "#333", marginLeft: "10px" }, children: e.message })
|
|
2432
2544
|
]
|
|
2433
2545
|
}
|
|
2434
|
-
),
|
|
2435
|
-
|
|
2546
|
+
), ci = (e) => /* @__PURE__ */ c(
|
|
2547
|
+
Ee,
|
|
2436
2548
|
{
|
|
2437
2549
|
title: e.title,
|
|
2438
2550
|
variant: "small",
|
|
@@ -2441,29 +2553,29 @@ const ks = (e) => {
|
|
|
2441
2553
|
onClose: e.onClose,
|
|
2442
2554
|
className: "progress pf-m-redhat-font",
|
|
2443
2555
|
"aria-label": "progress-modal",
|
|
2444
|
-
children: /* @__PURE__ */ c(
|
|
2556
|
+
children: /* @__PURE__ */ c(bt, { title: e.message, value: e.progress })
|
|
2445
2557
|
}
|
|
2446
2558
|
);
|
|
2447
|
-
function
|
|
2448
|
-
return /* @__PURE__ */ c(
|
|
2449
|
-
|
|
2559
|
+
function li() {
|
|
2560
|
+
return /* @__PURE__ */ c(ee, { children: /* @__PURE__ */ c(
|
|
2561
|
+
te,
|
|
2450
2562
|
{
|
|
2451
2563
|
titleText: "Loading",
|
|
2452
2564
|
headingLevel: "h4",
|
|
2453
|
-
icon: /* @__PURE__ */ c(
|
|
2565
|
+
icon: /* @__PURE__ */ c(ze, { icon: Q })
|
|
2454
2566
|
}
|
|
2455
2567
|
) });
|
|
2456
2568
|
}
|
|
2457
|
-
function
|
|
2569
|
+
function di({
|
|
2458
2570
|
itemCount: e,
|
|
2459
2571
|
page: t,
|
|
2460
2572
|
perPage: s,
|
|
2461
2573
|
isCompact: i = !1,
|
|
2462
2574
|
onChange: r,
|
|
2463
|
-
variant: n =
|
|
2575
|
+
variant: n = kt.top
|
|
2464
2576
|
}) {
|
|
2465
2577
|
return /* @__PURE__ */ c(
|
|
2466
|
-
|
|
2578
|
+
yt,
|
|
2467
2579
|
{
|
|
2468
2580
|
itemCount: e,
|
|
2469
2581
|
page: t,
|
|
@@ -2475,19 +2587,19 @@ function ei({
|
|
|
2475
2587
|
}
|
|
2476
2588
|
);
|
|
2477
2589
|
}
|
|
2478
|
-
function
|
|
2590
|
+
function Fs({ columns: e, rows: t, getTd: s = () => Ce }) {
|
|
2479
2591
|
const i = new Array(e).fill(0).map((n, a) => {
|
|
2480
2592
|
const o = s(a);
|
|
2481
2593
|
return /* @__PURE__ */ c(o, { children: /* @__PURE__ */ c(
|
|
2482
|
-
|
|
2594
|
+
Tt,
|
|
2483
2595
|
{
|
|
2484
2596
|
screenreaderText: a === 0 ? "Loading data" : void 0
|
|
2485
2597
|
}
|
|
2486
2598
|
) }, `cell_${a}`);
|
|
2487
|
-
}), r = new Array(t).fill(0).map((n, a) => /* @__PURE__ */ c(
|
|
2488
|
-
return /* @__PURE__ */ c(
|
|
2599
|
+
}), r = new Array(t).fill(0).map((n, a) => /* @__PURE__ */ c(se, { children: i }, `row_${a}`));
|
|
2600
|
+
return /* @__PURE__ */ c(oe, { children: r });
|
|
2489
2601
|
}
|
|
2490
|
-
const
|
|
2602
|
+
const hi = ({
|
|
2491
2603
|
ariaLabel: e,
|
|
2492
2604
|
minimumColumnWidth: t = 250,
|
|
2493
2605
|
columns: s,
|
|
@@ -2506,28 +2618,28 @@ const ti = ({
|
|
|
2506
2618
|
children: k,
|
|
2507
2619
|
variant: x
|
|
2508
2620
|
}) => {
|
|
2509
|
-
const [
|
|
2621
|
+
const [E, H] = I(1e3);
|
|
2510
2622
|
let T;
|
|
2511
2623
|
const w = ({ width: p }) => {
|
|
2512
2624
|
T && cancelAnimationFrame(T), p && (T = requestAnimationFrame(() => {
|
|
2513
2625
|
H(p);
|
|
2514
2626
|
}));
|
|
2515
|
-
}, { ref: U } =
|
|
2627
|
+
}, { ref: U } = Ft({ onResize: w }), C = E >= 576, S = Pe(
|
|
2516
2628
|
(p) => C && p !== 0 && p !== s.length - 1,
|
|
2517
2629
|
[s, C]
|
|
2518
|
-
),
|
|
2519
|
-
const P =
|
|
2520
|
-
({ children:
|
|
2521
|
-
|
|
2630
|
+
), L = Oe(() => s.map((p, m) => {
|
|
2631
|
+
const P = Z(
|
|
2632
|
+
({ children: F, ...$ }, ce) => /* @__PURE__ */ c(
|
|
2633
|
+
at,
|
|
2522
2634
|
{
|
|
2523
|
-
position:
|
|
2524
|
-
tableWidth:
|
|
2635
|
+
position: m,
|
|
2636
|
+
tableWidth: E,
|
|
2525
2637
|
columnWidth: t,
|
|
2526
|
-
canHide: S(
|
|
2638
|
+
canHide: S(m),
|
|
2527
2639
|
sort: o ? o(p) : void 0,
|
|
2528
|
-
|
|
2529
|
-
ref:
|
|
2530
|
-
children:
|
|
2640
|
+
...$,
|
|
2641
|
+
ref: ce,
|
|
2642
|
+
children: F
|
|
2531
2643
|
}
|
|
2532
2644
|
)
|
|
2533
2645
|
);
|
|
@@ -2535,7 +2647,7 @@ const ti = ({
|
|
|
2535
2647
|
Th: P,
|
|
2536
2648
|
key: `header_${p}`,
|
|
2537
2649
|
column: p,
|
|
2538
|
-
colIndex:
|
|
2650
|
+
colIndex: m
|
|
2539
2651
|
});
|
|
2540
2652
|
}), [
|
|
2541
2653
|
S,
|
|
@@ -2543,32 +2655,32 @@ const ti = ({
|
|
|
2543
2655
|
o,
|
|
2544
2656
|
t,
|
|
2545
2657
|
r,
|
|
2546
|
-
|
|
2547
|
-
]),
|
|
2658
|
+
E
|
|
2659
|
+
]), J = Pe(
|
|
2548
2660
|
(p) => {
|
|
2549
|
-
const
|
|
2550
|
-
({ children: P,
|
|
2551
|
-
|
|
2661
|
+
const m = Z(
|
|
2662
|
+
({ children: P, ...F }, $) => /* @__PURE__ */ c(
|
|
2663
|
+
be,
|
|
2552
2664
|
{
|
|
2553
2665
|
position: p,
|
|
2554
|
-
tableWidth:
|
|
2666
|
+
tableWidth: E,
|
|
2555
2667
|
columnWidth: t,
|
|
2556
2668
|
canHide: S(p),
|
|
2557
|
-
|
|
2558
|
-
ref:
|
|
2669
|
+
...F,
|
|
2670
|
+
ref: $,
|
|
2559
2671
|
children: P
|
|
2560
2672
|
}
|
|
2561
2673
|
)
|
|
2562
2674
|
);
|
|
2563
|
-
return
|
|
2675
|
+
return m.displayName = "ResponsiveTdCurried", m;
|
|
2564
2676
|
},
|
|
2565
|
-
[S, t,
|
|
2566
|
-
),
|
|
2567
|
-
() => s.map((p,
|
|
2568
|
-
[s,
|
|
2677
|
+
[S, t, E]
|
|
2678
|
+
), X = Oe(
|
|
2679
|
+
() => s.map((p, m) => J(m)),
|
|
2680
|
+
[s, J]
|
|
2569
2681
|
);
|
|
2570
|
-
return /* @__PURE__ */
|
|
2571
|
-
|
|
2682
|
+
return /* @__PURE__ */ f(
|
|
2683
|
+
Ht,
|
|
2572
2684
|
{
|
|
2573
2685
|
"aria-label": e,
|
|
2574
2686
|
gridBreakPoint: "",
|
|
@@ -2577,58 +2689,58 @@ const ti = ({
|
|
|
2577
2689
|
ouiaId: R,
|
|
2578
2690
|
variant: x,
|
|
2579
2691
|
children: [
|
|
2580
|
-
/* @__PURE__ */ c(
|
|
2581
|
-
/* @__PURE__ */
|
|
2692
|
+
/* @__PURE__ */ c(Lt, { children: /* @__PURE__ */ c(se, { children: L }) }),
|
|
2693
|
+
/* @__PURE__ */ f(Mt, { children: [
|
|
2582
2694
|
i === void 0 && /* @__PURE__ */ c(
|
|
2583
|
-
|
|
2695
|
+
Fs,
|
|
2584
2696
|
{
|
|
2585
2697
|
columns: s.length,
|
|
2586
2698
|
rows: h,
|
|
2587
|
-
getTd:
|
|
2699
|
+
getTd: J
|
|
2588
2700
|
}
|
|
2589
2701
|
),
|
|
2590
|
-
i == null ? void 0 : i.map((p,
|
|
2591
|
-
const P = l !== void 0 && l({ row: p, rowIndex:
|
|
2592
|
-
Td:
|
|
2593
|
-
key: `row_${
|
|
2594
|
-
column:
|
|
2595
|
-
colIndex:
|
|
2596
|
-
rowIndex:
|
|
2702
|
+
i == null ? void 0 : i.map((p, m) => {
|
|
2703
|
+
const P = l !== void 0 && l({ row: p, rowIndex: m }), F = d !== void 0 && d({ row: p, rowIndex: m }), $ = !P && g ? () => g({ row: p, rowIndex: m }) : void 0, ce = s.map((Ue, Ae) => n({
|
|
2704
|
+
Td: X[Ae],
|
|
2705
|
+
key: `row_${m}_cell_${Ue}`,
|
|
2706
|
+
column: Ue,
|
|
2707
|
+
colIndex: Ae,
|
|
2708
|
+
rowIndex: m,
|
|
2597
2709
|
row: p
|
|
2598
|
-
})),
|
|
2599
|
-
|
|
2710
|
+
})), lt = !P && a && /* @__PURE__ */ c(
|
|
2711
|
+
be,
|
|
2600
2712
|
{
|
|
2601
2713
|
position: s.length,
|
|
2602
|
-
tableWidth:
|
|
2714
|
+
tableWidth: E,
|
|
2603
2715
|
columnWidth: t,
|
|
2604
2716
|
canHide: !1,
|
|
2605
2717
|
isActionCell: !0,
|
|
2606
|
-
"data-testid": v ? v({ row: p, rowIndex:
|
|
2607
|
-
children: a({ rowIndex:
|
|
2718
|
+
"data-testid": v ? v({ row: p, rowIndex: m }) : `actions-for-row-${m}`,
|
|
2719
|
+
children: a({ rowIndex: m, row: p, ActionsColumn: Dt })
|
|
2608
2720
|
}
|
|
2609
2721
|
);
|
|
2610
|
-
return /* @__PURE__ */
|
|
2611
|
-
|
|
2722
|
+
return /* @__PURE__ */ f(
|
|
2723
|
+
ct,
|
|
2612
2724
|
{
|
|
2613
2725
|
isDeleted: P,
|
|
2614
|
-
isSelected:
|
|
2615
|
-
onClick:
|
|
2616
|
-
rowOuiaId: b == null ? void 0 : b({ row: p, rowIndex:
|
|
2726
|
+
isSelected: F,
|
|
2727
|
+
onClick: $,
|
|
2728
|
+
rowOuiaId: b == null ? void 0 : b({ row: p, rowIndex: m }),
|
|
2617
2729
|
children: [
|
|
2618
|
-
|
|
2619
|
-
|
|
2730
|
+
ce,
|
|
2731
|
+
lt
|
|
2620
2732
|
]
|
|
2621
2733
|
},
|
|
2622
|
-
`row_${
|
|
2734
|
+
`row_${m}`
|
|
2623
2735
|
);
|
|
2624
2736
|
}),
|
|
2625
|
-
(i == null ? void 0 : i.length) === 0 && /* @__PURE__ */ c(
|
|
2737
|
+
(i == null ? void 0 : i.length) === 0 && /* @__PURE__ */ c(se, { children: /* @__PURE__ */ c(Ce, { colSpan: s.length, children: k }) })
|
|
2626
2738
|
] })
|
|
2627
2739
|
]
|
|
2628
2740
|
}
|
|
2629
2741
|
);
|
|
2630
|
-
},
|
|
2631
|
-
|
|
2742
|
+
}, at = ke(
|
|
2743
|
+
Z((e, t) => {
|
|
2632
2744
|
const {
|
|
2633
2745
|
tableWidth: s,
|
|
2634
2746
|
columnWidth: i,
|
|
@@ -2639,7 +2751,7 @@ const ti = ({
|
|
|
2639
2751
|
...l
|
|
2640
2752
|
} = e, d = n && s < i * (r + 1) ? "pf-m-hidden" : "pf-m-visible";
|
|
2641
2753
|
return /* @__PURE__ */ c(
|
|
2642
|
-
|
|
2754
|
+
jt,
|
|
2643
2755
|
{
|
|
2644
2756
|
ref: t,
|
|
2645
2757
|
className: `${d} ${a}`,
|
|
@@ -2649,9 +2761,9 @@ const ti = ({
|
|
|
2649
2761
|
);
|
|
2650
2762
|
})
|
|
2651
2763
|
);
|
|
2652
|
-
|
|
2653
|
-
const
|
|
2654
|
-
|
|
2764
|
+
at.displayName = "ResponsiveTh";
|
|
2765
|
+
const be = ke(
|
|
2766
|
+
Z((e, t) => {
|
|
2655
2767
|
const {
|
|
2656
2768
|
tableWidth: s,
|
|
2657
2769
|
columnWidth: i,
|
|
@@ -2662,7 +2774,7 @@ const me = ve(
|
|
|
2662
2774
|
...l
|
|
2663
2775
|
} = e, d = n && s < i * (r + 1) ? "pf-m-hidden" : "pf-m-visible";
|
|
2664
2776
|
return /* @__PURE__ */ c(
|
|
2665
|
-
|
|
2777
|
+
Ce,
|
|
2666
2778
|
{
|
|
2667
2779
|
ref: t,
|
|
2668
2780
|
className: `${d} ${a}`,
|
|
@@ -2672,10 +2784,10 @@ const me = ve(
|
|
|
2672
2784
|
);
|
|
2673
2785
|
})
|
|
2674
2786
|
);
|
|
2675
|
-
|
|
2676
|
-
const
|
|
2787
|
+
be.displayName = "ResponsiveTd";
|
|
2788
|
+
const ct = ke(
|
|
2677
2789
|
({ isDeleted: e, isSelected: t, onClick: s, children: i, rowOuiaId: r }) => /* @__PURE__ */ c(
|
|
2678
|
-
|
|
2790
|
+
se,
|
|
2679
2791
|
{
|
|
2680
2792
|
onRowClick: (n) => {
|
|
2681
2793
|
(n == null ? void 0 : n.target) instanceof HTMLElement && (["a", "button"].includes(n.target.tagName.toLowerCase()) || s && s());
|
|
@@ -2689,37 +2801,37 @@ const rt = ve(
|
|
|
2689
2801
|
}
|
|
2690
2802
|
)
|
|
2691
2803
|
);
|
|
2692
|
-
|
|
2693
|
-
const
|
|
2804
|
+
ct.displayName = "DeletableRow";
|
|
2805
|
+
const $s = ({ label: e, onSearch: t }) => {
|
|
2694
2806
|
const s = (i, r, n) => {
|
|
2695
2807
|
t(r);
|
|
2696
2808
|
};
|
|
2697
2809
|
return /* @__PURE__ */ c(
|
|
2698
|
-
|
|
2810
|
+
It,
|
|
2699
2811
|
{
|
|
2700
2812
|
placeholder: `Filter by ${e}`,
|
|
2701
2813
|
onSearch: s
|
|
2702
2814
|
}
|
|
2703
2815
|
);
|
|
2704
2816
|
};
|
|
2705
|
-
function
|
|
2817
|
+
function We({
|
|
2706
2818
|
options: e,
|
|
2707
2819
|
value: t,
|
|
2708
2820
|
onChange: s,
|
|
2709
2821
|
ouiaId: i
|
|
2710
2822
|
}) {
|
|
2711
|
-
const [r, n] =
|
|
2823
|
+
const [r, n] = I(!1);
|
|
2712
2824
|
return /* @__PURE__ */ c(
|
|
2713
|
-
|
|
2825
|
+
Te,
|
|
2714
2826
|
{
|
|
2715
2827
|
toggle: (o) => /* @__PURE__ */ c(
|
|
2716
|
-
|
|
2828
|
+
ae,
|
|
2717
2829
|
{
|
|
2718
2830
|
ref: o,
|
|
2719
2831
|
onClick: () => n((l) => !l),
|
|
2720
2832
|
isExpanded: r,
|
|
2721
2833
|
variant: "plain",
|
|
2722
|
-
children: /* @__PURE__ */ c(
|
|
2834
|
+
children: /* @__PURE__ */ c(Je, {})
|
|
2723
2835
|
}
|
|
2724
2836
|
),
|
|
2725
2837
|
"aria-label": "table:select_filter",
|
|
@@ -2729,19 +2841,19 @@ function Me({
|
|
|
2729
2841
|
s(l), n(!1);
|
|
2730
2842
|
},
|
|
2731
2843
|
ouiaId: i,
|
|
2732
|
-
children: /* @__PURE__ */ c(
|
|
2844
|
+
children: /* @__PURE__ */ c(Et, { children: e.map((o, l) => /* @__PURE__ */ c(Ie, { value: o, children: o }, l)) })
|
|
2733
2845
|
}
|
|
2734
2846
|
);
|
|
2735
2847
|
}
|
|
2736
|
-
function
|
|
2848
|
+
function Ws({
|
|
2737
2849
|
label: e,
|
|
2738
2850
|
chips: t,
|
|
2739
2851
|
options: s,
|
|
2740
2852
|
onToggle: i
|
|
2741
2853
|
}) {
|
|
2742
|
-
const [r, n] =
|
|
2854
|
+
const [r, n] = I(!1);
|
|
2743
2855
|
return /* @__PURE__ */ c(
|
|
2744
|
-
|
|
2856
|
+
Te,
|
|
2745
2857
|
{
|
|
2746
2858
|
"aria-label": e,
|
|
2747
2859
|
onSelect: (a, o) => {
|
|
@@ -2750,7 +2862,7 @@ function As({
|
|
|
2750
2862
|
selected: t,
|
|
2751
2863
|
isOpen: r,
|
|
2752
2864
|
toggle: (a) => /* @__PURE__ */ c(
|
|
2753
|
-
|
|
2865
|
+
ae,
|
|
2754
2866
|
{
|
|
2755
2867
|
ref: a,
|
|
2756
2868
|
onClick: () => n((o) => !o),
|
|
@@ -2761,16 +2873,16 @@ function As({
|
|
|
2761
2873
|
children: `Filter by ${e}`
|
|
2762
2874
|
}
|
|
2763
2875
|
),
|
|
2764
|
-
children: Object.entries(s).map(([a, o]) => /* @__PURE__ */ c(
|
|
2876
|
+
children: Object.entries(s).map(([a, o]) => /* @__PURE__ */ c(Ie, { value: a, hasCheckbox: !0, children: o }, a))
|
|
2765
2877
|
}
|
|
2766
2878
|
);
|
|
2767
2879
|
}
|
|
2768
|
-
function
|
|
2769
|
-
const s = Object.keys(e), [i, r] =
|
|
2880
|
+
function gi({ filters: e, breakpoint: t = "md" }) {
|
|
2881
|
+
const s = Object.keys(e), [i, r] = I(s[0]), n = (a, o) => {
|
|
2770
2882
|
switch (o.type) {
|
|
2771
2883
|
case "search":
|
|
2772
2884
|
return /* @__PURE__ */ c(
|
|
2773
|
-
|
|
2885
|
+
$s,
|
|
2774
2886
|
{
|
|
2775
2887
|
onSearch: o.onSearch,
|
|
2776
2888
|
label: a,
|
|
@@ -2780,7 +2892,7 @@ function si({ filters: e, breakpoint: t = "md" }) {
|
|
|
2780
2892
|
);
|
|
2781
2893
|
case "checkbox":
|
|
2782
2894
|
return /* @__PURE__ */ c(
|
|
2783
|
-
|
|
2895
|
+
Ws,
|
|
2784
2896
|
{
|
|
2785
2897
|
chips: o.chips,
|
|
2786
2898
|
options: o.options,
|
|
@@ -2790,16 +2902,16 @@ function si({ filters: e, breakpoint: t = "md" }) {
|
|
|
2790
2902
|
);
|
|
2791
2903
|
}
|
|
2792
2904
|
};
|
|
2793
|
-
return /* @__PURE__ */
|
|
2905
|
+
return /* @__PURE__ */ f(oe, { children: [
|
|
2794
2906
|
/* @__PURE__ */ c(
|
|
2795
|
-
|
|
2907
|
+
Ct,
|
|
2796
2908
|
{
|
|
2797
2909
|
variant: "search-filter",
|
|
2798
2910
|
visibility: { default: "hidden", [t]: "visible" },
|
|
2799
2911
|
"data-testid": "large-viewport-toolbar",
|
|
2800
|
-
children: /* @__PURE__ */
|
|
2912
|
+
children: /* @__PURE__ */ f(Rt, { children: [
|
|
2801
2913
|
s.length > 1 && /* @__PURE__ */ c(
|
|
2802
|
-
|
|
2914
|
+
We,
|
|
2803
2915
|
{
|
|
2804
2916
|
options: s,
|
|
2805
2917
|
value: i,
|
|
@@ -2812,14 +2924,14 @@ function si({ filters: e, breakpoint: t = "md" }) {
|
|
|
2812
2924
|
}
|
|
2813
2925
|
),
|
|
2814
2926
|
/* @__PURE__ */ c(
|
|
2815
|
-
|
|
2927
|
+
xt,
|
|
2816
2928
|
{
|
|
2817
|
-
toggleIcon: /* @__PURE__ */ c(
|
|
2929
|
+
toggleIcon: /* @__PURE__ */ c(Je, {}),
|
|
2818
2930
|
breakpoint: t,
|
|
2819
2931
|
visibility: { default: "visible", [t]: "hidden" },
|
|
2820
|
-
children: /* @__PURE__ */
|
|
2932
|
+
children: /* @__PURE__ */ f(Ut, { variant: "filter-group", children: [
|
|
2821
2933
|
s.length > 1 && /* @__PURE__ */ c(
|
|
2822
|
-
|
|
2934
|
+
We,
|
|
2823
2935
|
{
|
|
2824
2936
|
options: s,
|
|
2825
2937
|
value: i,
|
|
@@ -2828,7 +2940,7 @@ function si({ filters: e, breakpoint: t = "md" }) {
|
|
|
2828
2940
|
}
|
|
2829
2941
|
),
|
|
2830
2942
|
Object.entries(e).map(([a, o], l) => /* @__PURE__ */ c(
|
|
2831
|
-
|
|
2943
|
+
At,
|
|
2832
2944
|
{
|
|
2833
2945
|
chips: o.type === "checkbox" ? o.chips.map((d) => ({ key: d, node: o.options[d] })) : o.chips,
|
|
2834
2946
|
deleteChip: (d, h) => o.onRemoveChip(typeof h == "string" ? h : h.key),
|
|
@@ -2845,32 +2957,33 @@ function si({ filters: e, breakpoint: t = "md" }) {
|
|
|
2845
2957
|
] });
|
|
2846
2958
|
}
|
|
2847
2959
|
export {
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
Zs as
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2960
|
+
oi as AppAboutModal,
|
|
2961
|
+
ri as ApplicationAuth,
|
|
2962
|
+
$t as AuthConfigContext,
|
|
2963
|
+
Ds as BasicAuthModal,
|
|
2964
|
+
gi as ChipFilter,
|
|
2965
|
+
Ls as DateTime,
|
|
2966
|
+
ct as DeletableRow,
|
|
2967
|
+
Ws as FilterCheckbox,
|
|
2968
|
+
$s as FilterSearch,
|
|
2969
|
+
We as FilterSelector,
|
|
2970
|
+
Xs as FromNow,
|
|
2971
|
+
A as If,
|
|
2972
|
+
ni as IfAuth,
|
|
2973
|
+
Ys as IfNotEmpty,
|
|
2974
|
+
ne as IfNotLoading,
|
|
2975
|
+
Zs as ListWithToolbar,
|
|
2976
|
+
li as Loading,
|
|
2977
|
+
ei as ObjectDropdown,
|
|
2978
|
+
ti as ObjectSelect,
|
|
2979
|
+
di as Pagination,
|
|
2980
|
+
ai as PleaseWaitModal,
|
|
2981
|
+
ci as ProgressModal,
|
|
2982
|
+
hi as ResponsiveTable,
|
|
2983
|
+
be as ResponsiveTd,
|
|
2984
|
+
at as ResponsiveTh,
|
|
2985
|
+
Fs as TableSkeleton,
|
|
2986
|
+
si as ToggleIcon,
|
|
2987
|
+
ii as UrlUpload,
|
|
2988
|
+
nt as useAuth
|
|
2876
2989
|
};
|