react-luminus-components 2.0.31 → 2.0.33
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/README.md +349 -349
- package/dist/.vite/manifest.json +48 -38
- package/dist/{FormDisabledProvider-DYgNxt_V.js → FormDisabledProvider-CknAF8EI.js} +1 -1
- package/dist/FormDisabledProvider-DoGy2C4j.cjs +1 -0
- package/dist/components/Layout/ConnectionNotification/ConnectionAlert.d.ts +5 -0
- package/dist/components/Layout/ConnectionNotification/ConnectionIcon.d.ts +5 -0
- package/dist/components/Layout/index.d.ts +2 -0
- package/dist/contexts/index.d.ts +1 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +619 -612
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +154 -161
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +28 -28
- package/dist/main.cjs.js +15 -15
- package/dist/main.d.ts +2 -0
- package/dist/main.es.js +12606 -12568
- package/dist/nivo-bar-BkpPCncR.cjs +285 -0
- package/dist/{ShortcutLinksContext-Bu12oYeg.js → nivo-bar-wBsr2P1t.js} +20542 -20542
- package/dist/style.css +1 -1
- package/dist/useIsBrowserOnline-CREGrf2l.cjs +1 -0
- package/dist/useIsBrowserOnline-RAirIO4c.js +13 -0
- package/dist/{useIsFormDirty-D61PZNiu.js → useIsFormDirty-CTuj9_Nd.js} +5 -5
- package/dist/useIsFormDirty-Cb4GEBID.cjs +1 -0
- package/dist/{useLocalStorageState-C9vgpAvX.js → useLocalStorageState-DBd2vOH1.js} +30 -30
- package/dist/useLocalStorageState-gKbms6va.cjs +1 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +17 -17
- package/dist/variables.scss +165 -165
- package/package.json +128 -128
- package/dist/FormDisabledProvider-DFCB4DVo.cjs +0 -1
- package/dist/ShortcutLinksContext-BGLfiUxG.cjs +0 -285
- package/dist/useIsFormDirty-DQrsSiIC.cjs +0 -1
- package/dist/useLocalStorageState-DnWPyDKJ.cjs +0 -1
package/dist/contexts.es.js
CHANGED
|
@@ -1,260 +1,261 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { ck as
|
|
3
|
-
import { jsxs as I, jsx as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { EventType as
|
|
1
|
+
import { t as re, bR as Oe, c as N, bS as He, R as ce, an as Ue, bT as De, a5 as H, ak as We, S as ie, bU as je, ar as Fe, ap as Be, bd as pe, by as Re, bf as J, aq as ze, bV as Ge, aF as we, bW as Ve, bX as Xe, bY as L, bZ as Ke, b_ as U, b$ as l, c0 as _e, c1 as Le, c2 as V, c3 as E, c4 as q, c5 as ae, c6 as Ie, c7 as Je, c8 as Se, c9 as Qe, ca as Ye, cb as qe, cc as Ze, cd as be, ce as G, cf as Me, cg as Ce, ch as et, ci as fe, cj as $e, ao as tt, b8 as nt, a6 as ot } from "./nivo-bar-wBsr2P1t.js";
|
|
2
|
+
import { ck as gn, ah as pn } from "./nivo-bar-wBsr2P1t.js";
|
|
3
|
+
import { jsxs as I, jsx as y } from "react/jsx-runtime";
|
|
4
|
+
import { useState as R, useContext as z, useEffect as B, useRef as Q, useMemo as F, useCallback as Y, useSyncExternalStore as st } from "react";
|
|
5
|
+
import { EventType as ge, InteractionStatus as ye, InteractionRequiredAuthError as rt } from "@azure/msal-browser";
|
|
6
6
|
import { useMsal as it, MsalProvider as at } from "@azure/msal-react";
|
|
7
7
|
import "react-router";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
import "react-hook-form";
|
|
10
10
|
import "react-flexmonster";
|
|
11
|
-
import { L as ct, b as lt } from "./FormDisabledProvider-
|
|
12
|
-
import { F as
|
|
13
|
-
import { a as ht, u as ut } from "./useLocalStorageState-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
import { L as ct, b as lt } from "./FormDisabledProvider-CknAF8EI.js";
|
|
12
|
+
import { F as mn } from "./FormDisabledProvider-CknAF8EI.js";
|
|
13
|
+
import { a as ht, u as ut } from "./useLocalStorageState-DBd2vOH1.js";
|
|
14
|
+
import { u as dt } from "./useIsBrowserOnline-RAirIO4c.js";
|
|
15
|
+
function ft(t) {
|
|
16
|
+
const e = re(t);
|
|
16
17
|
return e.setHours(23, 59, 59, 999), e;
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
19
|
+
function gt() {
|
|
20
|
+
return ft(Date.now());
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
-
const n = +
|
|
23
|
-
+
|
|
24
|
-
+
|
|
25
|
-
].sort((
|
|
22
|
+
function pt(t, e) {
|
|
23
|
+
const n = +re(t), [s, o] = [
|
|
24
|
+
+re(e.start),
|
|
25
|
+
+re(e.end)
|
|
26
|
+
].sort((i, r) => i - r);
|
|
26
27
|
return n >= s && n <= o;
|
|
27
28
|
}
|
|
28
29
|
function _t() {
|
|
29
|
-
return
|
|
30
|
+
return Oe(Date.now());
|
|
30
31
|
}
|
|
31
|
-
const
|
|
32
|
+
const mt = (t) => {
|
|
32
33
|
const e = N.c(10), {
|
|
33
34
|
children: n
|
|
34
|
-
} = t, [s, o] =
|
|
35
|
-
let
|
|
36
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
37
|
-
o(!0),
|
|
38
|
-
}, e[0] =
|
|
39
|
-
const
|
|
40
|
-
let
|
|
41
|
-
e[1] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
35
|
+
} = t, [s, o] = R(!1), [i, r] = R(""), [a, c] = R(void 0);
|
|
36
|
+
let h;
|
|
37
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (h = (b, p) => {
|
|
38
|
+
o(!0), r(b), c(p);
|
|
39
|
+
}, e[0] = h) : h = e[0];
|
|
40
|
+
const u = h;
|
|
41
|
+
let _;
|
|
42
|
+
e[1] === Symbol.for("react.memo_cache_sentinel") ? (_ = () => {
|
|
42
43
|
o(!1);
|
|
43
|
-
}, e[1] =
|
|
44
|
-
const
|
|
45
|
-
let
|
|
46
|
-
e[2] !== s || e[3] !==
|
|
44
|
+
}, e[1] = _) : _ = e[1];
|
|
45
|
+
const f = _;
|
|
46
|
+
let g;
|
|
47
|
+
e[2] !== s || e[3] !== i || e[4] !== a ? (g = {
|
|
47
48
|
show: s,
|
|
48
|
-
text:
|
|
49
|
-
showConfirm:
|
|
50
|
-
hideConfirm:
|
|
49
|
+
text: i,
|
|
50
|
+
showConfirm: u,
|
|
51
|
+
hideConfirm: f,
|
|
51
52
|
textSm: a
|
|
52
|
-
}, e[2] = s, e[3] =
|
|
53
|
-
const
|
|
54
|
-
let
|
|
55
|
-
e[6] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
53
|
+
}, e[2] = s, e[3] = i, e[4] = a, e[5] = g) : g = e[5];
|
|
54
|
+
const m = g;
|
|
55
|
+
let S;
|
|
56
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ y(Bt, {}), e[6] = S) : S = e[6];
|
|
56
57
|
let d;
|
|
57
|
-
return e[7] !== n || e[8] !==
|
|
58
|
-
|
|
58
|
+
return e[7] !== n || e[8] !== m ? (d = /* @__PURE__ */ I(He.Provider, { value: m, children: [
|
|
59
|
+
S,
|
|
59
60
|
n
|
|
60
|
-
] }), e[7] = n, e[8] =
|
|
61
|
-
},
|
|
61
|
+
] }), e[7] = n, e[8] = m, e[9] = d) : d = e[9], d;
|
|
62
|
+
}, wt = () => {
|
|
62
63
|
const t = N.c(43), {
|
|
63
64
|
texts: e
|
|
64
|
-
} =
|
|
65
|
+
} = z(ce), {
|
|
65
66
|
confirm: n
|
|
66
67
|
} = e, {
|
|
67
68
|
isShown: s,
|
|
68
69
|
text: o,
|
|
69
|
-
onFinish:
|
|
70
|
-
} =
|
|
71
|
-
options:
|
|
72
|
-
} =
|
|
73
|
-
let
|
|
74
|
-
t[0] !==
|
|
75
|
-
|
|
76
|
-
}, t[0] =
|
|
77
|
-
const
|
|
70
|
+
onFinish: i
|
|
71
|
+
} = Ue(), {
|
|
72
|
+
options: r
|
|
73
|
+
} = z(De), [a, c] = R(r.defaultValue ?? "");
|
|
74
|
+
let h;
|
|
75
|
+
t[0] !== i ? (h = () => {
|
|
76
|
+
i(null);
|
|
77
|
+
}, t[0] = i, t[1] = h) : h = t[1];
|
|
78
|
+
const u = h;
|
|
79
|
+
let _;
|
|
80
|
+
t[2] !== i || t[3] !== r.required || t[4] !== a ? (_ = (j) => {
|
|
81
|
+
j.preventDefault(), !(r.required && !a) && (i(a), c(""));
|
|
82
|
+
}, t[2] = i, t[3] = r.required, t[4] = a, t[5] = _) : _ = t[5];
|
|
83
|
+
const f = _;
|
|
78
84
|
let g;
|
|
79
|
-
t[
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const _ = g;
|
|
83
|
-
let f;
|
|
84
|
-
t[6] === Symbol.for("react.memo_cache_sentinel") ? (f = (F) => c(F.currentTarget.value), t[6] = f) : f = t[6];
|
|
85
|
-
let p;
|
|
86
|
-
t[7] !== a ? (p = {
|
|
85
|
+
t[6] === Symbol.for("react.memo_cache_sentinel") ? (g = (j) => c(j.currentTarget.value), t[6] = g) : g = t[6];
|
|
86
|
+
let m;
|
|
87
|
+
t[7] !== a ? (m = {
|
|
87
88
|
value: a,
|
|
88
|
-
onChange:
|
|
89
|
+
onChange: g,
|
|
89
90
|
className: "w-100",
|
|
90
91
|
autoFocus: !0,
|
|
91
92
|
tabIndex: 0
|
|
92
|
-
}, t[7] = a, t[8] =
|
|
93
|
-
const
|
|
94
|
-
let d,
|
|
95
|
-
t[9] !== s || t[10] !==
|
|
96
|
-
s === !0 && c(
|
|
97
|
-
},
|
|
98
|
-
let
|
|
99
|
-
t[13] !== o ? (
|
|
93
|
+
}, t[7] = a, t[8] = m) : m = t[8];
|
|
94
|
+
const S = m;
|
|
95
|
+
let d, b;
|
|
96
|
+
t[9] !== s || t[10] !== r.defaultValue ? (d = () => {
|
|
97
|
+
s === !0 && c(r.defaultValue ?? "");
|
|
98
|
+
}, b = [s, r.defaultValue], t[9] = s, t[10] = r.defaultValue, t[11] = d, t[12] = b) : (d = t[11], b = t[12]), B(d, b);
|
|
99
|
+
let p;
|
|
100
|
+
t[13] !== o ? (p = /* @__PURE__ */ y(H.Header, { className: "justify-content-center", children: /* @__PURE__ */ y(H.Title, { children: o }) }), t[13] = o, t[14] = p) : p = t[14];
|
|
100
101
|
let C;
|
|
101
|
-
t[15] !==
|
|
102
|
-
let
|
|
103
|
-
t[18] !==
|
|
104
|
-
let
|
|
105
|
-
t[22] !== C || t[23] !==
|
|
102
|
+
t[15] !== S || t[16] !== r.input ? (C = r.input === "textarea" ? /* @__PURE__ */ y("textarea", { ...S, rows: 5 }) : void 0, t[15] = S, t[16] = r.input, t[17] = C) : C = t[17];
|
|
103
|
+
let w;
|
|
104
|
+
t[18] !== S || t[19] !== r.input || t[20] !== r.type ? (w = r.input === "input" ? /* @__PURE__ */ y(We, { ...S, type: r.type }) : void 0, t[18] = S, t[19] = r.input, t[20] = r.type, t[21] = w) : w = t[21];
|
|
105
|
+
let v;
|
|
106
|
+
t[22] !== C || t[23] !== w ? (v = /* @__PURE__ */ I(H.Body, { children: [
|
|
106
107
|
C,
|
|
107
|
-
|
|
108
|
-
] }), t[22] = C, t[23] =
|
|
108
|
+
w
|
|
109
|
+
] }), t[22] = C, t[23] = w, t[24] = v) : v = t[24];
|
|
109
110
|
let k;
|
|
110
|
-
t[25] !== n.cancel || t[26] !==
|
|
111
|
-
const
|
|
111
|
+
t[25] !== n.cancel || t[26] !== u ? (k = /* @__PURE__ */ y(ie, { variant: "outlined", color: "secondary", onClick: u, className: "flex-grow-1", children: n.cancel }), t[25] = n.cancel, t[26] = u, t[27] = k) : k = t[27];
|
|
112
|
+
const W = r.required && !a;
|
|
112
113
|
let P;
|
|
113
|
-
t[28] !== n.confirm || t[29] !==
|
|
114
|
+
t[28] !== n.confirm || t[29] !== W ? (P = /* @__PURE__ */ y(ie, { color: "primary", disabled: W, type: "submit", className: "flex-grow-1", children: n.confirm }), t[28] = n.confirm, t[29] = W, t[30] = P) : P = t[30];
|
|
114
115
|
let M;
|
|
115
|
-
t[31] !== k || t[32] !== P ? (M = /* @__PURE__ */ I(
|
|
116
|
+
t[31] !== k || t[32] !== P ? (M = /* @__PURE__ */ I(H.Footer, { className: "w-100 d-flex gap-5", children: [
|
|
116
117
|
k,
|
|
117
118
|
P
|
|
118
119
|
] }), t[31] = k, t[32] = P, t[33] = M) : M = t[33];
|
|
119
120
|
let x;
|
|
120
|
-
t[34] !==
|
|
121
|
-
|
|
121
|
+
t[34] !== f || t[35] !== v || t[36] !== M ? (x = /* @__PURE__ */ I("form", { onSubmit: f, onKeyDown: St, children: [
|
|
122
|
+
v,
|
|
122
123
|
M
|
|
123
|
-
] }), t[34] =
|
|
124
|
-
let
|
|
125
|
-
return t[38] !== s || t[39] !==
|
|
126
|
-
|
|
124
|
+
] }), t[34] = f, t[35] = v, t[36] = M, t[37] = x) : x = t[37];
|
|
125
|
+
let O;
|
|
126
|
+
return t[38] !== s || t[39] !== u || t[40] !== x || t[41] !== p ? (O = /* @__PURE__ */ I(H, { show: s, size: "sm", centered: !0, onHide: u, children: [
|
|
127
|
+
p,
|
|
127
128
|
x
|
|
128
|
-
] }), t[38] = s, t[39] =
|
|
129
|
+
] }), t[38] = s, t[39] = u, t[40] = x, t[41] = p, t[42] = O) : O = t[42], O;
|
|
129
130
|
};
|
|
130
|
-
function
|
|
131
|
+
function St(t) {
|
|
131
132
|
return t.stopPropagation();
|
|
132
133
|
}
|
|
133
|
-
const
|
|
134
|
+
const bt = (t) => {
|
|
134
135
|
const e = N.c(11), {
|
|
135
136
|
children: n
|
|
136
|
-
} = t, [s, o] =
|
|
137
|
+
} = t, [s, o] = R(!1), [i, r] = R("");
|
|
137
138
|
let a;
|
|
138
139
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = {
|
|
139
140
|
input: "textarea",
|
|
140
141
|
type: "text"
|
|
141
142
|
}, e[0] = a) : a = e[0];
|
|
142
|
-
const [c,
|
|
143
|
+
const [c, h] = R(a), u = Q(Ct);
|
|
144
|
+
let _;
|
|
145
|
+
e[1] === Symbol.for("react.memo_cache_sentinel") ? (_ = (C) => {
|
|
146
|
+
r(C), o(!0);
|
|
147
|
+
}, e[1] = _) : _ = e[1];
|
|
148
|
+
const f = _;
|
|
143
149
|
let g;
|
|
144
|
-
e[
|
|
145
|
-
i(C), o(!0);
|
|
146
|
-
}, e[1] = g) : g = e[1];
|
|
147
|
-
const _ = g;
|
|
148
|
-
let f;
|
|
149
|
-
e[2] === Symbol.for("react.memo_cache_sentinel") ? (f = () => {
|
|
150
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (g = () => {
|
|
150
151
|
o(!1);
|
|
151
|
-
}, e[2] =
|
|
152
|
-
const
|
|
153
|
-
let
|
|
154
|
-
e[3] !== s || e[4] !== c || e[5] !==
|
|
152
|
+
}, e[2] = g) : g = e[2];
|
|
153
|
+
const m = g;
|
|
154
|
+
let S;
|
|
155
|
+
e[3] !== s || e[4] !== c || e[5] !== i ? (S = {
|
|
155
156
|
isShown: s,
|
|
156
|
-
text:
|
|
157
|
-
showPrompt:
|
|
158
|
-
hidePrompt:
|
|
159
|
-
resolveRef:
|
|
157
|
+
text: i,
|
|
158
|
+
showPrompt: f,
|
|
159
|
+
hidePrompt: m,
|
|
160
|
+
resolveRef: u,
|
|
160
161
|
options: c,
|
|
161
|
-
setOptions:
|
|
162
|
-
}, e[3] = s, e[4] = c, e[5] =
|
|
163
|
-
const d =
|
|
164
|
-
let
|
|
165
|
-
e[7] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
166
|
-
let
|
|
167
|
-
return e[8] !== n || e[9] !== d ? (
|
|
162
|
+
setOptions: h
|
|
163
|
+
}, e[3] = s, e[4] = c, e[5] = i, e[6] = S) : S = e[6];
|
|
164
|
+
const d = S;
|
|
165
|
+
let b;
|
|
166
|
+
e[7] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ y(wt, {}), e[7] = b) : b = e[7];
|
|
167
|
+
let p;
|
|
168
|
+
return e[8] !== n || e[9] !== d ? (p = /* @__PURE__ */ I(De.Provider, { value: d, children: [
|
|
168
169
|
n,
|
|
169
|
-
|
|
170
|
-
] }), e[8] = n, e[9] = d, e[10] =
|
|
170
|
+
b
|
|
171
|
+
] }), e[8] = n, e[9] = d, e[10] = p) : p = e[10], p;
|
|
171
172
|
};
|
|
172
|
-
function
|
|
173
|
+
function Ct() {
|
|
173
174
|
}
|
|
174
|
-
const
|
|
175
|
+
const nn = (t) => {
|
|
175
176
|
const e = N.c(14), {
|
|
176
177
|
cookieDomain: n,
|
|
177
178
|
axiosOptions: s,
|
|
178
179
|
language: o,
|
|
179
|
-
texts:
|
|
180
|
-
ProjectIconComponent:
|
|
180
|
+
texts: i,
|
|
181
|
+
ProjectIconComponent: r,
|
|
181
182
|
localizationContext: a,
|
|
182
183
|
chartColorPalette: c,
|
|
183
|
-
children:
|
|
184
|
+
children: h
|
|
184
185
|
} = t;
|
|
185
|
-
let
|
|
186
|
-
e[0] !==
|
|
186
|
+
let u;
|
|
187
|
+
e[0] !== r || e[1] !== s || e[2] !== c || e[3] !== n || e[4] !== o || e[5] !== a || e[6] !== i ? (u = {
|
|
187
188
|
axiosOptions: s,
|
|
188
189
|
cookieDomain: n,
|
|
189
190
|
language: o,
|
|
190
|
-
texts:
|
|
191
|
-
ProjectIconComponent:
|
|
191
|
+
texts: i,
|
|
192
|
+
ProjectIconComponent: r,
|
|
192
193
|
localizationContext: a,
|
|
193
194
|
chartColorPalette: c
|
|
194
|
-
}, e[0] =
|
|
195
|
-
const
|
|
196
|
-
let _;
|
|
197
|
-
e[8] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ v(Ue, {}), e[8] = _) : _ = e[8];
|
|
195
|
+
}, e[0] = r, e[1] = s, e[2] = c, e[3] = n, e[4] = o, e[5] = a, e[6] = i, e[7] = u) : u = e[7];
|
|
196
|
+
const _ = u;
|
|
198
197
|
let f;
|
|
199
|
-
e[
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
198
|
+
e[8] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ y(je, {}), e[8] = f) : f = e[8];
|
|
199
|
+
let g;
|
|
200
|
+
e[9] !== h ? (g = /* @__PURE__ */ y(mt, { children: /* @__PURE__ */ I(bt, { children: [
|
|
201
|
+
f,
|
|
202
|
+
h
|
|
203
|
+
] }) }), e[9] = h, e[10] = g) : g = e[10];
|
|
204
|
+
let m;
|
|
205
|
+
return e[11] !== _ || e[12] !== g ? (m = /* @__PURE__ */ y(ce.Provider, { value: _, children: g }), e[11] = _, e[12] = g, e[13] = m) : m = e[13], m;
|
|
206
|
+
}, on = (t) => {
|
|
206
207
|
const e = N.c(15), {
|
|
207
208
|
children: n
|
|
208
|
-
} = t, [s, o] =
|
|
209
|
-
let
|
|
210
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
211
|
-
const [
|
|
209
|
+
} = t, [s, o] = R(!1);
|
|
210
|
+
let i;
|
|
211
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ new Set(), e[0] = i) : i = e[0];
|
|
212
|
+
const [r] = R(i);
|
|
212
213
|
let a;
|
|
213
|
-
e[1] !==
|
|
214
|
-
|
|
215
|
-
}, e[1] =
|
|
214
|
+
e[1] !== r ? (a = (S) => {
|
|
215
|
+
r.add(S), o(!0);
|
|
216
|
+
}, e[1] = r, e[2] = a) : a = e[2];
|
|
216
217
|
const c = a;
|
|
217
|
-
let
|
|
218
|
-
e[3] !==
|
|
219
|
-
|
|
220
|
-
}, e[3] =
|
|
221
|
-
const
|
|
222
|
-
let
|
|
223
|
-
e[5] !== s || e[6] !== c || e[7] !==
|
|
218
|
+
let h;
|
|
219
|
+
e[3] !== r ? (h = (S) => {
|
|
220
|
+
r.delete(S), r.size === 0 && o(!1);
|
|
221
|
+
}, e[3] = r, e[4] = h) : h = e[4];
|
|
222
|
+
const u = h;
|
|
223
|
+
let _;
|
|
224
|
+
e[5] !== s || e[6] !== c || e[7] !== u ? (_ = {
|
|
224
225
|
isLoading: s,
|
|
225
226
|
startLoading: c,
|
|
226
|
-
stopLoading:
|
|
227
|
-
}, e[5] = s, e[6] = c, e[7] =
|
|
228
|
-
const
|
|
229
|
-
let
|
|
230
|
-
e[9] !== s ? (
|
|
231
|
-
let
|
|
232
|
-
return e[11] !== n || e[12] !==
|
|
233
|
-
|
|
227
|
+
stopLoading: u
|
|
228
|
+
}, e[5] = s, e[6] = c, e[7] = u, e[8] = _) : _ = e[8];
|
|
229
|
+
const f = _;
|
|
230
|
+
let g;
|
|
231
|
+
e[9] !== s ? (g = s && /* @__PURE__ */ y(ct, {}), e[9] = s, e[10] = g) : g = e[10];
|
|
232
|
+
let m;
|
|
233
|
+
return e[11] !== n || e[12] !== f || e[13] !== g ? (m = /* @__PURE__ */ I(Fe.Provider, { value: f, children: [
|
|
234
|
+
g,
|
|
234
235
|
n
|
|
235
|
-
] }), e[11] = n, e[12] =
|
|
236
|
-
},
|
|
236
|
+
] }), e[11] = n, e[12] = f, e[13] = g, e[14] = m) : m = e[14], m;
|
|
237
|
+
}, sn = (t) => {
|
|
237
238
|
const e = N.c(39), {
|
|
238
239
|
children: n
|
|
239
|
-
} = t, s =
|
|
240
|
+
} = t, s = Be(), {
|
|
240
241
|
msalInstance: o,
|
|
241
|
-
getToken:
|
|
242
|
-
} =
|
|
243
|
-
delegation:
|
|
242
|
+
getToken: i
|
|
243
|
+
} = z(pe), {
|
|
244
|
+
delegation: r,
|
|
244
245
|
setDelegation: a,
|
|
245
246
|
setAvailableDelegations: c,
|
|
246
|
-
refreshAvailableDelegations:
|
|
247
|
-
} =
|
|
248
|
-
let
|
|
249
|
-
e[0] !==
|
|
250
|
-
const A = await
|
|
251
|
-
A &&
|
|
252
|
-
}, e[0] =
|
|
253
|
-
const
|
|
254
|
-
let
|
|
255
|
-
e[2] !==
|
|
256
|
-
|
|
257
|
-
},
|
|
247
|
+
refreshAvailableDelegations: h
|
|
248
|
+
} = z(Re), [u, _] = R(null);
|
|
249
|
+
let f;
|
|
250
|
+
e[0] !== i ? (f = async () => {
|
|
251
|
+
const A = await i();
|
|
252
|
+
A && _(A.token);
|
|
253
|
+
}, e[0] = i, e[1] = f) : f = e[1];
|
|
254
|
+
const g = f;
|
|
255
|
+
let m, S;
|
|
256
|
+
e[2] !== g ? (m = () => {
|
|
257
|
+
g();
|
|
258
|
+
}, S = [g], e[2] = g, e[3] = m, e[4] = S) : (m = e[3], S = e[4]), B(m, S);
|
|
258
259
|
let d;
|
|
259
260
|
if (e[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
260
261
|
e: {
|
|
@@ -268,15 +269,15 @@ const tn = (t) => {
|
|
|
268
269
|
e[5] = d;
|
|
269
270
|
} else
|
|
270
271
|
d = e[5];
|
|
271
|
-
const
|
|
272
|
-
let
|
|
273
|
-
e[6] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
274
|
-
state:
|
|
275
|
-
user:
|
|
276
|
-
}, e[6] =
|
|
277
|
-
const [C,
|
|
278
|
-
let
|
|
279
|
-
e[7] !== s ? (
|
|
272
|
+
const b = d;
|
|
273
|
+
let p;
|
|
274
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (p = {
|
|
275
|
+
state: b ? J.LOGGED_IN : J.LOGGED_OUT,
|
|
276
|
+
user: b
|
|
277
|
+
}, e[6] = p) : p = e[6];
|
|
278
|
+
const [C, w] = R(p);
|
|
279
|
+
let v;
|
|
280
|
+
e[7] !== s ? (v = async (A) => {
|
|
280
281
|
let $ = null;
|
|
281
282
|
return await s.get("/user/detail", A ? {
|
|
282
283
|
headers: {
|
|
@@ -287,39 +288,39 @@ const tn = (t) => {
|
|
|
287
288
|
}).catch(() => {
|
|
288
289
|
$ = null;
|
|
289
290
|
}), $;
|
|
290
|
-
}, e[7] = s, e[8] =
|
|
291
|
-
const k =
|
|
292
|
-
let
|
|
293
|
-
e[9] !== c || e[10] !== a ? (
|
|
294
|
-
localStorage.removeItem("user"),
|
|
295
|
-
state:
|
|
291
|
+
}, e[7] = s, e[8] = v) : v = e[8];
|
|
292
|
+
const k = v;
|
|
293
|
+
let W;
|
|
294
|
+
e[9] !== c || e[10] !== a ? (W = () => {
|
|
295
|
+
localStorage.removeItem("user"), w({
|
|
296
|
+
state: J.LOGGED_OUT,
|
|
296
297
|
user: null
|
|
297
298
|
}), a(null), c(null);
|
|
298
|
-
}, e[9] = c, e[10] = a, e[11] =
|
|
299
|
-
const P =
|
|
299
|
+
}, e[9] = c, e[10] = a, e[11] = W) : W = e[11];
|
|
300
|
+
const P = W;
|
|
300
301
|
let M;
|
|
301
|
-
e[12] !== k || e[13] !==
|
|
302
|
-
|
|
303
|
-
state:
|
|
302
|
+
e[12] !== k || e[13] !== h ? (M = async (A) => {
|
|
303
|
+
w({
|
|
304
|
+
state: J.LOGGING_IN,
|
|
304
305
|
user: null
|
|
305
306
|
});
|
|
306
307
|
const $ = await k(A);
|
|
307
|
-
return $ ? (
|
|
308
|
-
state:
|
|
308
|
+
return $ ? (w({
|
|
309
|
+
state: J.LOGGED_IN,
|
|
309
310
|
user: $
|
|
310
|
-
}), localStorage.setItem("user", JSON.stringify($)), await
|
|
311
|
-
state:
|
|
311
|
+
}), localStorage.setItem("user", JSON.stringify($)), await h(), !0) : (w({
|
|
312
|
+
state: J.LOGIN_FAILED,
|
|
312
313
|
user: null
|
|
313
314
|
}), !1);
|
|
314
|
-
}, e[12] = k, e[13] =
|
|
315
|
+
}, e[12] = k, e[13] = h, e[14] = M) : M = e[14];
|
|
315
316
|
const x = M;
|
|
316
|
-
let
|
|
317
|
-
e[15] !== o ? (
|
|
317
|
+
let O;
|
|
318
|
+
e[15] !== o ? (O = () => {
|
|
318
319
|
if (o) {
|
|
319
320
|
const A = o.addEventCallback(($) => {
|
|
320
|
-
if ($.eventType ===
|
|
321
|
+
if ($.eventType === ge.LOGIN_SUCCESS && $.payload) {
|
|
321
322
|
const de = $.payload;
|
|
322
|
-
|
|
323
|
+
_(de.accessToken);
|
|
323
324
|
}
|
|
324
325
|
});
|
|
325
326
|
return () => {
|
|
@@ -327,164 +328,164 @@ const tn = (t) => {
|
|
|
327
328
|
};
|
|
328
329
|
}
|
|
329
330
|
return yt;
|
|
330
|
-
}, e[15] = o, e[16] =
|
|
331
|
-
let
|
|
332
|
-
e[17] !== x || e[18] !== P || e[19] !== o ? (
|
|
333
|
-
let
|
|
334
|
-
e[21] !== x || e[22] !== P || e[23] !== a ? (
|
|
331
|
+
}, e[15] = o, e[16] = O) : O = e[16];
|
|
332
|
+
let j;
|
|
333
|
+
e[17] !== x || e[18] !== P || e[19] !== o ? (j = [o, x, P], e[17] = x, e[18] = P, e[19] = o, e[20] = j) : j = e[20], B(O, j);
|
|
334
|
+
let Z;
|
|
335
|
+
e[21] !== x || e[22] !== P || e[23] !== a ? (Z = async (A) => {
|
|
335
336
|
A && await x(A).catch(() => {
|
|
336
337
|
P(), a(null);
|
|
337
338
|
});
|
|
338
|
-
}, e[21] = x, e[22] = P, e[23] = a, e[24] =
|
|
339
|
-
const
|
|
340
|
-
let q;
|
|
341
|
-
e[25] !== h || e[26] !== X ? (q = () => {
|
|
342
|
-
X(h);
|
|
343
|
-
}, e[25] = h, e[26] = X, e[27] = q) : q = e[27];
|
|
344
|
-
const he = i == null ? void 0 : i.id;
|
|
345
|
-
let Z;
|
|
346
|
-
e[28] !== h || e[29] !== X || e[30] !== he ? (Z = [h, he, X], e[28] = h, e[29] = X, e[30] = he, e[31] = Z) : Z = e[31], W(q, Z);
|
|
339
|
+
}, e[21] = x, e[22] = P, e[23] = a, e[24] = Z) : Z = e[24];
|
|
340
|
+
const K = Z;
|
|
347
341
|
let ee;
|
|
348
|
-
e[
|
|
342
|
+
e[25] !== u || e[26] !== K ? (ee = () => {
|
|
343
|
+
K(u);
|
|
344
|
+
}, e[25] = u, e[26] = K, e[27] = ee) : ee = e[27];
|
|
345
|
+
const he = r == null ? void 0 : r.id;
|
|
346
|
+
let te;
|
|
347
|
+
e[28] !== u || e[29] !== K || e[30] !== he ? (te = [u, he, K], e[28] = u, e[29] = K, e[30] = he, e[31] = te) : te = e[31], B(ee, te);
|
|
348
|
+
let ne;
|
|
349
|
+
e[32] !== x || e[33] !== P || e[34] !== C ? (ne = {
|
|
349
350
|
user: C.user,
|
|
350
351
|
userLoginState: C,
|
|
351
352
|
loginUser: x,
|
|
352
353
|
logoutUser: P
|
|
353
|
-
}, e[32] = x, e[33] = P, e[34] = C, e[35] =
|
|
354
|
-
const ue =
|
|
355
|
-
let
|
|
356
|
-
return e[36] !== n || e[37] !== ue ? (
|
|
354
|
+
}, e[32] = x, e[33] = P, e[34] = C, e[35] = ne) : ne = e[35];
|
|
355
|
+
const ue = ne;
|
|
356
|
+
let oe;
|
|
357
|
+
return e[36] !== n || e[37] !== ue ? (oe = /* @__PURE__ */ y(ze.Provider, { value: ue, children: n }), e[36] = n, e[37] = ue, e[38] = oe) : oe = e[38], oe;
|
|
357
358
|
};
|
|
358
359
|
function yt() {
|
|
359
360
|
}
|
|
360
|
-
const
|
|
361
|
+
const ve = () => {
|
|
361
362
|
const t = N.c(2);
|
|
362
363
|
let e;
|
|
363
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */
|
|
364
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ y("p", { children: "Redirecting..." }), t[0] = e) : e = t[0];
|
|
364
365
|
let n;
|
|
365
366
|
return t[1] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ I("div", { children: [
|
|
366
367
|
e,
|
|
367
368
|
/* @__PURE__ */ I("p", { children: [
|
|
368
369
|
"If you are not redirected within 10 seconds, please click",
|
|
369
370
|
" ",
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ y("a", { href: window.location.href.replace("/blank", "/"), children: "here" })
|
|
371
372
|
] })
|
|
372
373
|
] }), t[1] = n) : n = t[1], n;
|
|
373
|
-
},
|
|
374
|
+
}, vt = (t) => {
|
|
374
375
|
const e = t == null ? void 0 : t.getActiveAccount();
|
|
375
376
|
console.log("getTokenMsal activeAccount", e);
|
|
376
377
|
const n = t == null ? void 0 : t.getAllAccounts();
|
|
377
378
|
console.log("getTokenMsal allAccounts", n);
|
|
378
379
|
const s = (n == null ? void 0 : n.at(0)) ?? void 0;
|
|
379
380
|
return console.log("getTokenMsal account", s), s ? (e || t == null || t.setActiveAccount(s), s) : null;
|
|
380
|
-
},
|
|
381
|
+
}, rn = ({
|
|
381
382
|
...t
|
|
382
383
|
}) => {
|
|
383
384
|
const {
|
|
384
385
|
inProgress: e
|
|
385
386
|
} = it(), {
|
|
386
387
|
cookieDomain: n
|
|
387
|
-
} =
|
|
388
|
+
} = z(ce), [, s] = Ge(["Authorization"]), o = F(
|
|
388
389
|
() => t.useMsal ? t.msalInstance : null,
|
|
389
390
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
390
391
|
[t.useMsal, t.useMsal ? t.msalInstance : null]
|
|
391
|
-
),
|
|
392
|
+
), i = F(
|
|
392
393
|
() => t.useMsal ? t.msalScopes : [],
|
|
393
394
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
394
395
|
[t.useMsal, t.useMsal ? t.msalScopes : null]
|
|
395
|
-
),
|
|
396
|
+
), r = F(
|
|
396
397
|
() => t.useMsal ? t.msalExtraScopes : [],
|
|
397
398
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
398
399
|
[t.useMsal, t.useMsal ? t.msalExtraScopes : null]
|
|
399
|
-
), a =
|
|
400
|
+
), a = Q(null), c = Q(!1), h = Y(() => {
|
|
400
401
|
const d = localStorage.getItem("token");
|
|
401
402
|
return d ? {
|
|
402
403
|
token: d,
|
|
403
404
|
expiresOn: lt(new Date(Date.now()), 1)
|
|
404
405
|
} : null;
|
|
405
|
-
}, []),
|
|
406
|
+
}, []), u = Y(async () => {
|
|
406
407
|
if (console.log("getTokenMsal"), o == null)
|
|
407
408
|
throw console.log("getTokenMsal throwing error because msalInstance is null"), new Error("getTokenMsal: msalInstance is null");
|
|
408
409
|
if (a.current)
|
|
409
410
|
return console.log("getTokenMsal returning tokenRequestPromise.current", a.current), a.current;
|
|
410
|
-
const d = new Promise((
|
|
411
|
-
const C = (
|
|
412
|
-
const
|
|
413
|
-
if (!
|
|
411
|
+
const d = new Promise((b, p) => {
|
|
412
|
+
const C = (w) => {
|
|
413
|
+
const v = vt(o);
|
|
414
|
+
if (!v) {
|
|
414
415
|
console.log("getTokenMsal no account found. Redirecting to login"), o == null || o.loginRedirect({
|
|
415
|
-
scopes:
|
|
416
|
-
extraScopesToConsent:
|
|
416
|
+
scopes: i,
|
|
417
|
+
extraScopesToConsent: r
|
|
417
418
|
});
|
|
418
419
|
return;
|
|
419
420
|
}
|
|
420
421
|
o == null || o.acquireTokenSilent({
|
|
421
|
-
scopes:
|
|
422
|
-
account:
|
|
422
|
+
scopes: i,
|
|
423
|
+
account: v,
|
|
423
424
|
redirectUri: t.useMsal ? t.msalSilentRedirectUri : void 0
|
|
424
425
|
}).then((k) => {
|
|
425
|
-
|
|
426
|
+
w(), b({
|
|
426
427
|
token: k.accessToken,
|
|
427
428
|
expiresOn: k.expiresOn ?? new Date(Date.now())
|
|
428
429
|
});
|
|
429
430
|
}).catch((k) => {
|
|
430
431
|
console.error("Error acquiring token", k), k instanceof rt && (console.log("Silent token acquisition failed. Acquiring token using redirect"), o == null || o.acquireTokenRedirect({
|
|
431
|
-
scopes:
|
|
432
|
-
extraScopesToConsent:
|
|
433
|
-
}),
|
|
432
|
+
scopes: i,
|
|
433
|
+
extraScopesToConsent: r
|
|
434
|
+
}), w(), b(null)), w(), p(k);
|
|
434
435
|
}).finally(() => {
|
|
435
|
-
|
|
436
|
+
w(), p(new Error("No access token returned from handleRedirectPromise"));
|
|
436
437
|
});
|
|
437
438
|
};
|
|
438
|
-
if (
|
|
439
|
-
console.log("getTokenMsal rejecting because inProgress !== InteractionStatus.None", e),
|
|
439
|
+
if (e !== ye.None) {
|
|
440
|
+
console.log("getTokenMsal rejecting because inProgress !== InteractionStatus.None", e), p(new Error("Authentication in progress"));
|
|
440
441
|
return;
|
|
441
442
|
}
|
|
442
443
|
c.current ? C(() => {
|
|
443
444
|
a.current = null;
|
|
444
|
-
}) : o.handleRedirectPromise().then((
|
|
445
|
-
if (console.log("getTokenMsal tokenResponse",
|
|
445
|
+
}) : o.handleRedirectPromise().then((w) => {
|
|
446
|
+
if (console.log("getTokenMsal tokenResponse", w), !(w != null && w.accessToken)) {
|
|
446
447
|
C(() => {
|
|
447
448
|
a.current = null, c.current = !0;
|
|
448
449
|
});
|
|
449
450
|
return;
|
|
450
451
|
}
|
|
451
|
-
a.current = null, c.current = !0,
|
|
452
|
-
token:
|
|
453
|
-
expiresOn:
|
|
452
|
+
a.current = null, c.current = !0, b({
|
|
453
|
+
token: w.accessToken,
|
|
454
|
+
expiresOn: w.expiresOn ?? new Date(Date.now())
|
|
454
455
|
});
|
|
455
456
|
});
|
|
456
457
|
});
|
|
457
458
|
return a.current = d, d;
|
|
458
|
-
}, [e,
|
|
459
|
+
}, [e, r, o, i, t.msalSilentRedirectUri, t.useMsal]), _ = Y(async () => t.useMsal ? u() : h(), [h, u, t.useMsal]), f = Y((d) => t.useMsal ? () => {
|
|
459
460
|
} : (window.addEventListener("storage", d), window.addEventListener("dev-auth-change", d), () => {
|
|
460
461
|
window.removeEventListener("storage", d), window.removeEventListener("dev-auth-change", d);
|
|
461
|
-
}), [t.useMsal]),
|
|
462
|
+
}), [t.useMsal]), g = st(f, () => localStorage.getItem("token") !== null ? "AUTH_OK" : "NO_AUTH"), m = F(() => {
|
|
462
463
|
var d;
|
|
463
|
-
return t.useMsal ? e !== ye.None ? "AUTH_IN_PROGRESS" : (o == null ? void 0 : o.getActiveAccount()) ?? ((d = o == null ? void 0 : o.getAllAccounts()) == null ? void 0 : d[0]) ?? null ? "AUTH_OK" : "NO_AUTH" :
|
|
464
|
-
}, [
|
|
464
|
+
return t.useMsal ? e !== ye.None ? "AUTH_IN_PROGRESS" : (o == null ? void 0 : o.getActiveAccount()) ?? ((d = o == null ? void 0 : o.getAllAccounts()) == null ? void 0 : d[0]) ?? null ? "AUTH_OK" : "NO_AUTH" : g;
|
|
465
|
+
}, [g, e, o, t.useMsal]), S = F(() => ({
|
|
465
466
|
useMsal: t.useMsal ?? !1,
|
|
466
467
|
msalInstance: o,
|
|
467
|
-
msalScopes:
|
|
468
|
-
msalExtraScopes:
|
|
469
|
-
getToken:
|
|
470
|
-
authState:
|
|
471
|
-
}), [t.useMsal, o,
|
|
472
|
-
return
|
|
468
|
+
msalScopes: i,
|
|
469
|
+
msalExtraScopes: r,
|
|
470
|
+
getToken: _,
|
|
471
|
+
authState: m
|
|
472
|
+
}), [t.useMsal, o, i, r, _, m]);
|
|
473
|
+
return B(() => {
|
|
473
474
|
if (t.useMsal && o) {
|
|
474
|
-
const d = o.addEventCallback((
|
|
475
|
-
if (
|
|
476
|
-
const
|
|
475
|
+
const d = o.addEventCallback((b) => {
|
|
476
|
+
if (b.eventType === ge.LOGIN_SUCCESS || b.eventType === ge.ACQUIRE_TOKEN_SUCCESS && b.payload) {
|
|
477
|
+
const p = b.payload, C = p.account;
|
|
477
478
|
o.setActiveAccount(C);
|
|
478
|
-
const
|
|
479
|
-
s("Authorization",
|
|
479
|
+
const w = p.accessToken, v = p.expiresOn;
|
|
480
|
+
s("Authorization", w, {
|
|
480
481
|
path: "/",
|
|
481
482
|
secure: !0,
|
|
482
483
|
sameSite: "none",
|
|
483
484
|
domain: n,
|
|
484
|
-
expires:
|
|
485
|
+
expires: v ?? void 0
|
|
485
486
|
});
|
|
486
487
|
}
|
|
487
|
-
|
|
488
|
+
b.error && console.error("AuthProvider MSAL Error", b);
|
|
488
489
|
});
|
|
489
490
|
return () => {
|
|
490
491
|
d && o.removeEventCallback(d);
|
|
@@ -492,112 +493,112 @@ const Ce = () => {
|
|
|
492
493
|
}
|
|
493
494
|
return () => {
|
|
494
495
|
};
|
|
495
|
-
}, [t.useMsal, o, s, n]), /* @__PURE__ */
|
|
496
|
-
},
|
|
496
|
+
}, [t.useMsal, o, s, n]), /* @__PURE__ */ y(pe.Provider, { value: S, children: t.useMsal ? /* @__PURE__ */ y(at, { instance: t.msalInstance, children: window.location.pathname === "/blank" ? /* @__PURE__ */ y(ve, {}) : t.children }) : window.location.pathname === "/blank" ? /* @__PURE__ */ y(ve, {}) : t.children });
|
|
497
|
+
}, an = (t) => {
|
|
497
498
|
const e = N.c(18), {
|
|
498
499
|
children: n,
|
|
499
500
|
relativeEndpoint: s
|
|
500
|
-
} = t, [o,
|
|
501
|
+
} = t, [o, i, r] = ht("user-delegation", null);
|
|
501
502
|
let a;
|
|
502
503
|
e: {
|
|
503
504
|
if (!o) {
|
|
504
505
|
a = null;
|
|
505
506
|
break e;
|
|
506
507
|
}
|
|
507
|
-
const
|
|
508
|
-
if (!
|
|
509
|
-
start:
|
|
508
|
+
const v = o.from ? we(o.from) : _t(), k = o.to ? we(o.to) : gt();
|
|
509
|
+
if (!pt(new Date(Date.now()), {
|
|
510
|
+
start: v,
|
|
510
511
|
end: k
|
|
511
512
|
})) {
|
|
512
|
-
|
|
513
|
+
i(null), a = null;
|
|
513
514
|
break e;
|
|
514
515
|
}
|
|
515
516
|
a = o;
|
|
516
517
|
}
|
|
517
518
|
const c = a;
|
|
518
|
-
let
|
|
519
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
519
|
+
let h;
|
|
520
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (h = {
|
|
520
521
|
nullStateBeforeLoad: !1,
|
|
521
522
|
nullStateOnFail: !0
|
|
522
|
-
}, e[0] =
|
|
523
|
+
}, e[0] = h) : h = e[0];
|
|
523
524
|
const {
|
|
524
|
-
data:
|
|
525
|
-
setData:
|
|
526
|
-
reloadData:
|
|
527
|
-
} = ut(s,
|
|
528
|
-
let
|
|
529
|
-
e[1] !==
|
|
530
|
-
const
|
|
531
|
-
|
|
525
|
+
data: u,
|
|
526
|
+
setData: _,
|
|
527
|
+
reloadData: f
|
|
528
|
+
} = ut(s, h), g = Q(null);
|
|
529
|
+
let m, S;
|
|
530
|
+
e[1] !== f ? (m = () => {
|
|
531
|
+
const v = () => {
|
|
532
|
+
f(), g.current = window.setTimeout(v, Ve() + 5e3);
|
|
532
533
|
};
|
|
533
|
-
return
|
|
534
|
-
|
|
534
|
+
return v(), () => {
|
|
535
|
+
g.current !== null && window.clearTimeout(g.current);
|
|
535
536
|
};
|
|
536
|
-
},
|
|
537
|
+
}, S = [f], e[1] = f, e[2] = m, e[3] = S) : (m = e[2], S = e[3]), B(m, S);
|
|
537
538
|
let d;
|
|
538
|
-
e[4] !==
|
|
539
|
-
const
|
|
540
|
-
|
|
539
|
+
e[4] !== r ? (d = () => {
|
|
540
|
+
const v = () => {
|
|
541
|
+
r();
|
|
541
542
|
};
|
|
542
|
-
return window.addEventListener("focus",
|
|
543
|
-
window.removeEventListener("focus",
|
|
543
|
+
return window.addEventListener("focus", v), () => {
|
|
544
|
+
window.removeEventListener("focus", v);
|
|
544
545
|
};
|
|
545
|
-
}, e[4] =
|
|
546
|
-
let S;
|
|
547
|
-
e[6] !== i || e[7] !== _ ? (S = [i, _], e[6] = i, e[7] = _, e[8] = S) : S = e[8], W(d, S);
|
|
548
|
-
let m;
|
|
549
|
-
e[9] !== h || e[10] !== _ || e[11] !== g || e[12] !== r || e[13] !== c ? (m = {
|
|
550
|
-
delegation: c,
|
|
551
|
-
setDelegation: r,
|
|
552
|
-
availableDelegations: h,
|
|
553
|
-
setAvailableDelegations: g,
|
|
554
|
-
refreshAvailableDelegations: _
|
|
555
|
-
}, e[9] = h, e[10] = _, e[11] = g, e[12] = r, e[13] = c, e[14] = m) : m = e[14];
|
|
556
|
-
const C = m;
|
|
546
|
+
}, e[4] = r, e[5] = d) : d = e[5];
|
|
557
547
|
let b;
|
|
558
|
-
|
|
559
|
-
|
|
548
|
+
e[6] !== r || e[7] !== f ? (b = [r, f], e[6] = r, e[7] = f, e[8] = b) : b = e[8], B(d, b);
|
|
549
|
+
let p;
|
|
550
|
+
e[9] !== u || e[10] !== f || e[11] !== _ || e[12] !== i || e[13] !== c ? (p = {
|
|
551
|
+
delegation: c,
|
|
552
|
+
setDelegation: i,
|
|
553
|
+
availableDelegations: u,
|
|
554
|
+
setAvailableDelegations: _,
|
|
555
|
+
refreshAvailableDelegations: f
|
|
556
|
+
}, e[9] = u, e[10] = f, e[11] = _, e[12] = i, e[13] = c, e[14] = p) : p = e[14];
|
|
557
|
+
const C = p;
|
|
558
|
+
let w;
|
|
559
|
+
return e[15] !== n || e[16] !== C ? (w = /* @__PURE__ */ y(Re.Provider, { value: C, children: n }), e[15] = n, e[16] = C, e[17] = w) : w = e[17], w;
|
|
560
|
+
}, ke = (t, e) => t ? `${t} | ${e}` : e, cn = (t) => {
|
|
560
561
|
const e = N.c(18), {
|
|
561
562
|
defaultHelmet: n,
|
|
562
563
|
children: s,
|
|
563
564
|
helmetPrefix: o
|
|
564
|
-
} = t,
|
|
565
|
-
let
|
|
566
|
-
e[0] !== n || e[1] !==
|
|
565
|
+
} = t, i = o ?? "";
|
|
566
|
+
let r;
|
|
567
|
+
e[0] !== n || e[1] !== i ? (r = ke(i, n), e[0] = n, e[1] = i, e[2] = r) : r = e[2];
|
|
567
568
|
let a;
|
|
568
|
-
e[3] !==
|
|
569
|
-
const [c,
|
|
570
|
-
let
|
|
571
|
-
e[5] !== o ? (
|
|
572
|
-
|
|
573
|
-
}, e[5] = o, e[6] =
|
|
574
|
-
const
|
|
575
|
-
let
|
|
576
|
-
e[7] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
577
|
-
|
|
578
|
-
}, e[7] =
|
|
579
|
-
const
|
|
580
|
-
let p;
|
|
581
|
-
e[8] !== c ? (p = c.at(-1) ?? "", e[8] = c, e[9] = p) : p = e[9];
|
|
582
|
-
const w = p;
|
|
583
|
-
let d;
|
|
584
|
-
e[10] !== g ? (d = {
|
|
585
|
-
addHelmet: g,
|
|
586
|
-
removeHelmet: f
|
|
587
|
-
}, e[10] = g, e[11] = d) : d = e[11];
|
|
588
|
-
const S = d;
|
|
569
|
+
e[3] !== r ? (a = [r], e[3] = r, e[4] = a) : a = e[4];
|
|
570
|
+
const [c, h] = R(a);
|
|
571
|
+
let u;
|
|
572
|
+
e[5] !== o ? (u = (w) => {
|
|
573
|
+
h((v) => [...v, ke(o ?? "", w)]);
|
|
574
|
+
}, e[5] = o, e[6] = u) : u = e[6];
|
|
575
|
+
const _ = u;
|
|
576
|
+
let f;
|
|
577
|
+
e[7] === Symbol.for("react.memo_cache_sentinel") ? (f = () => {
|
|
578
|
+
h(kt);
|
|
579
|
+
}, e[7] = f) : f = e[7];
|
|
580
|
+
const g = f;
|
|
589
581
|
let m;
|
|
590
|
-
e[
|
|
582
|
+
e[8] !== c ? (m = c.at(-1) ?? "", e[8] = c, e[9] = m) : m = e[9];
|
|
583
|
+
const S = m;
|
|
584
|
+
let d;
|
|
585
|
+
e[10] !== _ ? (d = {
|
|
586
|
+
addHelmet: _,
|
|
587
|
+
removeHelmet: g
|
|
588
|
+
}, e[10] = _, e[11] = d) : d = e[11];
|
|
589
|
+
const b = d;
|
|
590
|
+
let p;
|
|
591
|
+
e[12] !== S ? (p = /* @__PURE__ */ y("title", { children: S }), e[12] = S, e[13] = p) : p = e[13];
|
|
591
592
|
let C;
|
|
592
|
-
return e[14] !== s || e[15] !==
|
|
593
|
-
|
|
593
|
+
return e[14] !== s || e[15] !== b || e[16] !== p ? (C = /* @__PURE__ */ I(Xe.Provider, { value: b, children: [
|
|
594
|
+
p,
|
|
594
595
|
s
|
|
595
|
-
] }), e[14] = s, e[15] =
|
|
596
|
+
] }), e[14] = s, e[15] = b, e[16] = p, e[17] = C) : C = e[17], C;
|
|
596
597
|
};
|
|
597
|
-
function
|
|
598
|
+
function kt(t) {
|
|
598
599
|
return t.length > 1 ? t.slice(0, -1) : t;
|
|
599
600
|
}
|
|
600
|
-
class
|
|
601
|
+
class Ne {
|
|
601
602
|
constructor(e, n, s) {
|
|
602
603
|
this.statusCode = e, this.statusText = n, this.content = s;
|
|
603
604
|
}
|
|
@@ -634,13 +635,13 @@ class le {
|
|
|
634
635
|
return "";
|
|
635
636
|
}
|
|
636
637
|
}
|
|
637
|
-
class
|
|
638
|
+
class Tt extends le {
|
|
638
639
|
constructor(e) {
|
|
639
|
-
if (super(), this._logger = e, typeof fetch > "u" ||
|
|
640
|
+
if (super(), this._logger = e, typeof fetch > "u" || L.isNode) {
|
|
640
641
|
const n = typeof __webpack_require__ == "function" ? __non_webpack_require__ : require;
|
|
641
642
|
this._jar = new (n("tough-cookie")).CookieJar(), typeof fetch > "u" ? this._fetchType = n("node-fetch") : this._fetchType = fetch, this._fetchType = n("fetch-cookie")(this._fetchType, this._jar);
|
|
642
643
|
} else
|
|
643
|
-
this._fetchType = fetch.bind(
|
|
644
|
+
this._fetchType = fetch.bind(Ke());
|
|
644
645
|
if (typeof AbortController > "u") {
|
|
645
646
|
const n = typeof __webpack_require__ == "function" ? __non_webpack_require__ : require;
|
|
646
647
|
this._abortControllerType = n("abort-controller");
|
|
@@ -668,9 +669,9 @@ class kt extends le {
|
|
|
668
669
|
}, c);
|
|
669
670
|
}
|
|
670
671
|
e.content === "" && (e.content = void 0), e.content && (e.headers = e.headers || {}, Le(e.content) ? e.headers["Content-Type"] = "application/octet-stream" : e.headers["Content-Type"] = "text/plain;charset=UTF-8");
|
|
671
|
-
let
|
|
672
|
+
let i;
|
|
672
673
|
try {
|
|
673
|
-
|
|
674
|
+
i = await this._fetchType(e.url, {
|
|
674
675
|
body: e.content,
|
|
675
676
|
cache: "no-cache",
|
|
676
677
|
credentials: e.withCredentials === !0 ? "include" : "same-origin",
|
|
@@ -688,19 +689,19 @@ class kt extends le {
|
|
|
688
689
|
} finally {
|
|
689
690
|
o && clearTimeout(o), e.abortSignal && (e.abortSignal.onabort = null);
|
|
690
691
|
}
|
|
691
|
-
if (!
|
|
692
|
-
const c = await
|
|
693
|
-
throw new
|
|
692
|
+
if (!i.ok) {
|
|
693
|
+
const c = await Te(i, "text");
|
|
694
|
+
throw new V(c || i.statusText, i.status);
|
|
694
695
|
}
|
|
695
|
-
const a = await
|
|
696
|
-
return new
|
|
696
|
+
const a = await Te(i, e.responseType);
|
|
697
|
+
return new Ne(i.status, i.statusText, a);
|
|
697
698
|
}
|
|
698
699
|
getCookieString(e) {
|
|
699
700
|
let n = "";
|
|
700
|
-
return
|
|
701
|
+
return L.isNode && this._jar && this._jar.getCookies(e, (s, o) => n = o.join("; ")), n;
|
|
701
702
|
}
|
|
702
703
|
}
|
|
703
|
-
function
|
|
704
|
+
function Te(t, e) {
|
|
704
705
|
let n;
|
|
705
706
|
switch (e) {
|
|
706
707
|
case "arraybuffer":
|
|
@@ -719,7 +720,7 @@ function ke(t, e) {
|
|
|
719
720
|
}
|
|
720
721
|
return n;
|
|
721
722
|
}
|
|
722
|
-
class
|
|
723
|
+
class Et extends le {
|
|
723
724
|
constructor(e) {
|
|
724
725
|
super(), this._logger = e;
|
|
725
726
|
}
|
|
@@ -728,28 +729,28 @@ class Tt extends le {
|
|
|
728
729
|
return e.abortSignal && e.abortSignal.aborted ? Promise.reject(new U()) : e.method ? e.url ? new Promise((n, s) => {
|
|
729
730
|
const o = new XMLHttpRequest();
|
|
730
731
|
o.open(e.method, e.url, !0), o.withCredentials = e.withCredentials === void 0 ? !0 : e.withCredentials, o.setRequestHeader("X-Requested-With", "XMLHttpRequest"), e.content === "" && (e.content = void 0), e.content && (Le(e.content) ? o.setRequestHeader("Content-Type", "application/octet-stream") : o.setRequestHeader("Content-Type", "text/plain;charset=UTF-8"));
|
|
731
|
-
const
|
|
732
|
-
|
|
733
|
-
o.setRequestHeader(
|
|
732
|
+
const i = e.headers;
|
|
733
|
+
i && Object.keys(i).forEach((r) => {
|
|
734
|
+
o.setRequestHeader(r, i[r]);
|
|
734
735
|
}), e.responseType && (o.responseType = e.responseType), e.abortSignal && (e.abortSignal.onabort = () => {
|
|
735
736
|
o.abort(), s(new U());
|
|
736
737
|
}), e.timeout && (o.timeout = e.timeout), o.onload = () => {
|
|
737
|
-
e.abortSignal && (e.abortSignal.onabort = null), o.status >= 200 && o.status < 300 ? n(new
|
|
738
|
+
e.abortSignal && (e.abortSignal.onabort = null), o.status >= 200 && o.status < 300 ? n(new Ne(o.status, o.statusText, o.response || o.responseText)) : s(new V(o.response || o.responseText || o.statusText, o.status));
|
|
738
739
|
}, o.onerror = () => {
|
|
739
|
-
this._logger.log(l.Warning, `Error from HTTP request. ${o.status}: ${o.statusText}.`), s(new
|
|
740
|
+
this._logger.log(l.Warning, `Error from HTTP request. ${o.status}: ${o.statusText}.`), s(new V(o.statusText, o.status));
|
|
740
741
|
}, o.ontimeout = () => {
|
|
741
742
|
this._logger.log(l.Warning, "Timeout from HTTP request."), s(new _e());
|
|
742
743
|
}, o.send(e.content);
|
|
743
744
|
}) : Promise.reject(new Error("No url defined.")) : Promise.reject(new Error("No method defined."));
|
|
744
745
|
}
|
|
745
746
|
}
|
|
746
|
-
class
|
|
747
|
+
class Pt extends le {
|
|
747
748
|
/** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */
|
|
748
749
|
constructor(e) {
|
|
749
|
-
if (super(), typeof fetch < "u" ||
|
|
750
|
-
this._httpClient = new kt(e);
|
|
751
|
-
else if (typeof XMLHttpRequest < "u")
|
|
750
|
+
if (super(), typeof fetch < "u" || L.isNode)
|
|
752
751
|
this._httpClient = new Tt(e);
|
|
752
|
+
else if (typeof XMLHttpRequest < "u")
|
|
753
|
+
this._httpClient = new Et(e);
|
|
753
754
|
else
|
|
754
755
|
throw new Error("No usable HttpClient found.");
|
|
755
756
|
}
|
|
@@ -761,20 +762,20 @@ class Et extends le {
|
|
|
761
762
|
return this._httpClient.getCookieString(e);
|
|
762
763
|
}
|
|
763
764
|
}
|
|
764
|
-
const
|
|
765
|
-
class
|
|
765
|
+
const xt = [0, 2e3, 1e4, 3e4, null];
|
|
766
|
+
class Ee {
|
|
766
767
|
constructor(e) {
|
|
767
|
-
this._retryDelays = e !== void 0 ? [...e, null] :
|
|
768
|
+
this._retryDelays = e !== void 0 ? [...e, null] : xt;
|
|
768
769
|
}
|
|
769
770
|
nextRetryDelayInMilliseconds(e) {
|
|
770
771
|
return this._retryDelays[e.previousRetryCount];
|
|
771
772
|
}
|
|
772
773
|
}
|
|
773
|
-
class
|
|
774
|
+
class X {
|
|
774
775
|
}
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
class
|
|
776
|
+
X.Authorization = "Authorization";
|
|
777
|
+
X.Cookie = "Cookie";
|
|
778
|
+
class At extends le {
|
|
778
779
|
constructor(e, n) {
|
|
779
780
|
super(), this._innerClient = e, this._accessTokenFactory = n;
|
|
780
781
|
}
|
|
@@ -785,7 +786,7 @@ class xt extends le {
|
|
|
785
786
|
return n && s.statusCode === 401 && this._accessTokenFactory ? (this._accessToken = await this._accessTokenFactory(), this._setAuthorizationHeader(e), await this._innerClient.send(e)) : s;
|
|
786
787
|
}
|
|
787
788
|
_setAuthorizationHeader(e) {
|
|
788
|
-
e.headers || (e.headers = {}), this._accessToken ? e.headers[
|
|
789
|
+
e.headers || (e.headers = {}), this._accessToken ? e.headers[X.Authorization] = `Bearer ${this._accessToken}` : this._accessTokenFactory && e.headers[X.Authorization] && delete e.headers[X.Authorization];
|
|
789
790
|
}
|
|
790
791
|
getCookieString(e) {
|
|
791
792
|
return this._innerClient.getCookieString(e);
|
|
@@ -799,7 +800,7 @@ var D;
|
|
|
799
800
|
(function(t) {
|
|
800
801
|
t[t.Text = 1] = "Text", t[t.Binary = 2] = "Binary";
|
|
801
802
|
})(D || (D = {}));
|
|
802
|
-
let
|
|
803
|
+
let Dt = class {
|
|
803
804
|
constructor() {
|
|
804
805
|
this._isAborted = !1, this.onabort = null;
|
|
805
806
|
}
|
|
@@ -813,28 +814,28 @@ let At = class {
|
|
|
813
814
|
return this._isAborted;
|
|
814
815
|
}
|
|
815
816
|
};
|
|
816
|
-
class
|
|
817
|
+
class Pe {
|
|
817
818
|
// This is an internal type, not exported from 'index' so this is really just internal.
|
|
818
819
|
get pollAborted() {
|
|
819
820
|
return this._pollAbort.aborted;
|
|
820
821
|
}
|
|
821
822
|
constructor(e, n, s) {
|
|
822
|
-
this._httpClient = e, this._logger = n, this._pollAbort = new
|
|
823
|
+
this._httpClient = e, this._logger = n, this._pollAbort = new Dt(), this._options = s, this._running = !1, this.onreceive = null, this.onclose = null;
|
|
823
824
|
}
|
|
824
825
|
async connect(e, n) {
|
|
825
826
|
if (E.isRequired(e, "url"), E.isRequired(n, "transferFormat"), E.isIn(n, D, "transferFormat"), this._url = e, this._logger.log(l.Trace, "(LongPolling transport) Connecting."), n === D.Binary && typeof XMLHttpRequest < "u" && typeof new XMLHttpRequest().responseType != "string")
|
|
826
827
|
throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");
|
|
827
|
-
const [s, o] =
|
|
828
|
+
const [s, o] = q(), i = { [s]: o, ...this._options.headers }, r = {
|
|
828
829
|
abortSignal: this._pollAbort.signal,
|
|
829
|
-
headers:
|
|
830
|
+
headers: i,
|
|
830
831
|
timeout: 1e5,
|
|
831
832
|
withCredentials: this._options.withCredentials
|
|
832
833
|
};
|
|
833
|
-
n === D.Binary && (
|
|
834
|
+
n === D.Binary && (r.responseType = "arraybuffer");
|
|
834
835
|
const a = `${e}&_=${Date.now()}`;
|
|
835
836
|
this._logger.log(l.Trace, `(LongPolling transport) polling: ${a}.`);
|
|
836
|
-
const c = await this._httpClient.get(a,
|
|
837
|
-
c.statusCode !== 200 ? (this._logger.log(l.Error, `(LongPolling transport) Unexpected response code: ${c.statusCode}.`), this._closeError = new
|
|
837
|
+
const c = await this._httpClient.get(a, r);
|
|
838
|
+
c.statusCode !== 200 ? (this._logger.log(l.Error, `(LongPolling transport) Unexpected response code: ${c.statusCode}.`), this._closeError = new V(c.statusText || "", c.statusCode), this._running = !1) : this._running = !0, this._receiving = this._poll(this._url, r);
|
|
838
839
|
}
|
|
839
840
|
async _poll(e, n) {
|
|
840
841
|
try {
|
|
@@ -843,7 +844,7 @@ class Ee {
|
|
|
843
844
|
const s = `${e}&_=${Date.now()}`;
|
|
844
845
|
this._logger.log(l.Trace, `(LongPolling transport) polling: ${s}.`);
|
|
845
846
|
const o = await this._httpClient.get(s, n);
|
|
846
|
-
o.statusCode === 204 ? (this._logger.log(l.Information, "(LongPolling transport) Poll terminated by server."), this._running = !1) : o.statusCode !== 200 ? (this._logger.log(l.Error, `(LongPolling transport) Unexpected response code: ${o.statusCode}.`), this._closeError = new
|
|
847
|
+
o.statusCode === 204 ? (this._logger.log(l.Information, "(LongPolling transport) Poll terminated by server."), this._running = !1) : o.statusCode !== 200 ? (this._logger.log(l.Error, `(LongPolling transport) Unexpected response code: ${o.statusCode}.`), this._closeError = new V(o.statusText || "", o.statusCode), this._running = !1) : o.content ? (this._logger.log(l.Trace, `(LongPolling transport) data received. ${ae(o.content, this._options.logMessageContent)}.`), this.onreceive && this.onreceive(o.content)) : this._logger.log(l.Trace, "(LongPolling transport) Poll timed out, reissuing.");
|
|
847
848
|
} catch (s) {
|
|
848
849
|
this._running ? s instanceof _e ? this._logger.log(l.Trace, "(LongPolling transport) Poll timed out, reissuing.") : (this._closeError = s, this._running = !1) : this._logger.log(l.Trace, `(LongPolling transport) Poll errored after shutdown: ${s.message}`);
|
|
849
850
|
}
|
|
@@ -852,26 +853,26 @@ class Ee {
|
|
|
852
853
|
}
|
|
853
854
|
}
|
|
854
855
|
async send(e) {
|
|
855
|
-
return this._running ?
|
|
856
|
+
return this._running ? Ie(this._logger, "LongPolling", this._httpClient, this._url, e, this._options) : Promise.reject(new Error("Cannot send until the transport is connected"));
|
|
856
857
|
}
|
|
857
858
|
async stop() {
|
|
858
859
|
this._logger.log(l.Trace, "(LongPolling transport) Stopping polling."), this._running = !1, this._pollAbort.abort();
|
|
859
860
|
try {
|
|
860
861
|
await this._receiving, this._logger.log(l.Trace, `(LongPolling transport) sending DELETE request to ${this._url}.`);
|
|
861
|
-
const e = {}, [n, s] =
|
|
862
|
+
const e = {}, [n, s] = q();
|
|
862
863
|
e[n] = s;
|
|
863
864
|
const o = {
|
|
864
865
|
headers: { ...e, ...this._options.headers },
|
|
865
866
|
timeout: this._options.timeout,
|
|
866
867
|
withCredentials: this._options.withCredentials
|
|
867
868
|
};
|
|
868
|
-
let
|
|
869
|
+
let i;
|
|
869
870
|
try {
|
|
870
871
|
await this._httpClient.delete(this._url, o);
|
|
871
|
-
} catch (
|
|
872
|
-
|
|
872
|
+
} catch (r) {
|
|
873
|
+
i = r;
|
|
873
874
|
}
|
|
874
|
-
|
|
875
|
+
i ? i instanceof V && (i.statusCode === 404 ? this._logger.log(l.Trace, "(LongPolling transport) A 404 response was returned from sending a DELETE request.") : this._logger.log(l.Trace, `(LongPolling transport) Error sending a DELETE request: ${i}`)) : this._logger.log(l.Trace, "(LongPolling transport) DELETE request accepted.");
|
|
875
876
|
} finally {
|
|
876
877
|
this._logger.log(l.Trace, "(LongPolling transport) Stop finished."), this._raiseOnClose();
|
|
877
878
|
}
|
|
@@ -883,39 +884,39 @@ class Ee {
|
|
|
883
884
|
}
|
|
884
885
|
}
|
|
885
886
|
}
|
|
886
|
-
class
|
|
887
|
+
class Rt {
|
|
887
888
|
constructor(e, n, s, o) {
|
|
888
889
|
this._httpClient = e, this._accessToken = n, this._logger = s, this._options = o, this.onreceive = null, this.onclose = null;
|
|
889
890
|
}
|
|
890
891
|
async connect(e, n) {
|
|
891
892
|
return E.isRequired(e, "url"), E.isRequired(n, "transferFormat"), E.isIn(n, D, "transferFormat"), this._logger.log(l.Trace, "(SSE transport) Connecting."), this._url = e, this._accessToken && (e += (e.indexOf("?") < 0 ? "?" : "&") + `access_token=${encodeURIComponent(this._accessToken)}`), new Promise((s, o) => {
|
|
892
|
-
let
|
|
893
|
+
let i = !1;
|
|
893
894
|
if (n !== D.Text) {
|
|
894
895
|
o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));
|
|
895
896
|
return;
|
|
896
897
|
}
|
|
897
|
-
let
|
|
898
|
-
if (
|
|
899
|
-
|
|
898
|
+
let r;
|
|
899
|
+
if (L.isBrowser || L.isWebWorker)
|
|
900
|
+
r = new this._options.EventSource(e, { withCredentials: this._options.withCredentials });
|
|
900
901
|
else {
|
|
901
902
|
const a = this._httpClient.getCookieString(e), c = {};
|
|
902
903
|
c.Cookie = a;
|
|
903
|
-
const [
|
|
904
|
-
c[
|
|
904
|
+
const [h, u] = q();
|
|
905
|
+
c[h] = u, r = new this._options.EventSource(e, { withCredentials: this._options.withCredentials, headers: { ...c, ...this._options.headers } });
|
|
905
906
|
}
|
|
906
907
|
try {
|
|
907
|
-
|
|
908
|
+
r.onmessage = (a) => {
|
|
908
909
|
if (this.onreceive)
|
|
909
910
|
try {
|
|
910
|
-
this._logger.log(l.Trace, `(SSE transport) data received. ${
|
|
911
|
+
this._logger.log(l.Trace, `(SSE transport) data received. ${ae(a.data, this._options.logMessageContent)}.`), this.onreceive(a.data);
|
|
911
912
|
} catch (c) {
|
|
912
913
|
this._close(c);
|
|
913
914
|
return;
|
|
914
915
|
}
|
|
915
|
-
},
|
|
916
|
-
|
|
917
|
-
},
|
|
918
|
-
this._logger.log(l.Information, `SSE connected to ${this._url}`), this._eventSource =
|
|
916
|
+
}, r.onerror = (a) => {
|
|
917
|
+
i ? this._close() : o(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."));
|
|
918
|
+
}, r.onopen = () => {
|
|
919
|
+
this._logger.log(l.Information, `SSE connected to ${this._url}`), this._eventSource = r, i = !0, s();
|
|
919
920
|
};
|
|
920
921
|
} catch (a) {
|
|
921
922
|
o(a);
|
|
@@ -924,7 +925,7 @@ class Dt {
|
|
|
924
925
|
});
|
|
925
926
|
}
|
|
926
927
|
async send(e) {
|
|
927
|
-
return this._eventSource ?
|
|
928
|
+
return this._eventSource ? Ie(this._logger, "SSE", this._httpClient, this._url, e, this._options) : Promise.reject(new Error("Cannot send until the transport is connected"));
|
|
928
929
|
}
|
|
929
930
|
stop() {
|
|
930
931
|
return this._close(), Promise.resolve();
|
|
@@ -934,49 +935,49 @@ class Dt {
|
|
|
934
935
|
}
|
|
935
936
|
}
|
|
936
937
|
class Lt {
|
|
937
|
-
constructor(e, n, s, o,
|
|
938
|
-
this._logger = s, this._accessTokenFactory = n, this._logMessageContent = o, this._webSocketConstructor =
|
|
938
|
+
constructor(e, n, s, o, i, r) {
|
|
939
|
+
this._logger = s, this._accessTokenFactory = n, this._logMessageContent = o, this._webSocketConstructor = i, this._httpClient = e, this.onreceive = null, this.onclose = null, this._headers = r;
|
|
939
940
|
}
|
|
940
941
|
async connect(e, n) {
|
|
941
942
|
E.isRequired(e, "url"), E.isRequired(n, "transferFormat"), E.isIn(n, D, "transferFormat"), this._logger.log(l.Trace, "(WebSockets transport) Connecting.");
|
|
942
943
|
let s;
|
|
943
|
-
return this._accessTokenFactory && (s = await this._accessTokenFactory()), new Promise((o,
|
|
944
|
+
return this._accessTokenFactory && (s = await this._accessTokenFactory()), new Promise((o, i) => {
|
|
944
945
|
e = e.replace(/^http/, "ws");
|
|
945
|
-
let
|
|
946
|
+
let r;
|
|
946
947
|
const a = this._httpClient.getCookieString(e);
|
|
947
948
|
let c = !1;
|
|
948
|
-
if (
|
|
949
|
-
const
|
|
950
|
-
u
|
|
951
|
-
headers: { ...
|
|
949
|
+
if (L.isNode || L.isReactNative) {
|
|
950
|
+
const h = {}, [u, _] = q();
|
|
951
|
+
h[u] = _, s && (h[X.Authorization] = `Bearer ${s}`), a && (h[X.Cookie] = a), r = new this._webSocketConstructor(e, void 0, {
|
|
952
|
+
headers: { ...h, ...this._headers }
|
|
952
953
|
});
|
|
953
954
|
} else
|
|
954
955
|
s && (e += (e.indexOf("?") < 0 ? "?" : "&") + `access_token=${encodeURIComponent(s)}`);
|
|
955
|
-
|
|
956
|
-
this._logger.log(l.Information, `WebSocket connected to ${e}.`), this._webSocket =
|
|
957
|
-
},
|
|
958
|
-
let
|
|
959
|
-
typeof ErrorEvent < "u" &&
|
|
960
|
-
},
|
|
961
|
-
if (this._logger.log(l.Trace, `(WebSockets transport) data received. ${
|
|
956
|
+
r || (r = new this._webSocketConstructor(e)), n === D.Binary && (r.binaryType = "arraybuffer"), r.onopen = (h) => {
|
|
957
|
+
this._logger.log(l.Information, `WebSocket connected to ${e}.`), this._webSocket = r, c = !0, o();
|
|
958
|
+
}, r.onerror = (h) => {
|
|
959
|
+
let u = null;
|
|
960
|
+
typeof ErrorEvent < "u" && h instanceof ErrorEvent ? u = h.error : u = "There was an error with the transport", this._logger.log(l.Information, `(WebSockets transport) ${u}.`);
|
|
961
|
+
}, r.onmessage = (h) => {
|
|
962
|
+
if (this._logger.log(l.Trace, `(WebSockets transport) data received. ${ae(h.data, this._logMessageContent)}.`), this.onreceive)
|
|
962
963
|
try {
|
|
963
|
-
this.onreceive(
|
|
964
|
-
} catch (
|
|
965
|
-
this._close(
|
|
964
|
+
this.onreceive(h.data);
|
|
965
|
+
} catch (u) {
|
|
966
|
+
this._close(u);
|
|
966
967
|
return;
|
|
967
968
|
}
|
|
968
|
-
},
|
|
969
|
+
}, r.onclose = (h) => {
|
|
969
970
|
if (c)
|
|
970
|
-
this._close(
|
|
971
|
+
this._close(h);
|
|
971
972
|
else {
|
|
972
|
-
let
|
|
973
|
-
typeof ErrorEvent < "u" &&
|
|
973
|
+
let u = null;
|
|
974
|
+
typeof ErrorEvent < "u" && h instanceof ErrorEvent ? u = h.error : u = "WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.", i(new Error(u));
|
|
974
975
|
}
|
|
975
976
|
};
|
|
976
977
|
});
|
|
977
978
|
}
|
|
978
979
|
send(e) {
|
|
979
|
-
return this._webSocket && this._webSocket.readyState === this._webSocketConstructor.OPEN ? (this._logger.log(l.Trace, `(WebSockets transport) sending data. ${
|
|
980
|
+
return this._webSocket && this._webSocket.readyState === this._webSocketConstructor.OPEN ? (this._logger.log(l.Trace, `(WebSockets transport) sending data. ${ae(e, this._logMessageContent)}.`), this._webSocket.send(e), Promise.resolve()) : Promise.reject("WebSocket is not in the OPEN state");
|
|
980
981
|
}
|
|
981
982
|
stop() {
|
|
982
983
|
return this._webSocket && this._close(void 0), Promise.resolve();
|
|
@@ -991,21 +992,21 @@ class Lt {
|
|
|
991
992
|
return e && typeof e.wasClean == "boolean" && typeof e.code == "number";
|
|
992
993
|
}
|
|
993
994
|
}
|
|
994
|
-
const
|
|
995
|
-
class
|
|
995
|
+
const xe = 100;
|
|
996
|
+
class It {
|
|
996
997
|
constructor(e, n = {}) {
|
|
997
998
|
if (this._stopPromiseResolver = () => {
|
|
998
|
-
}, this.features = {}, this._negotiateVersion = 1, E.isRequired(e, "url"), this._logger =
|
|
999
|
+
}, this.features = {}, this._negotiateVersion = 1, E.isRequired(e, "url"), this._logger = Je(n.logger), this.baseUrl = this._resolveUrl(e), n = n || {}, n.logMessageContent = n.logMessageContent === void 0 ? !1 : n.logMessageContent, typeof n.withCredentials == "boolean" || n.withCredentials === void 0)
|
|
999
1000
|
n.withCredentials = n.withCredentials === void 0 ? !0 : n.withCredentials;
|
|
1000
1001
|
else
|
|
1001
1002
|
throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");
|
|
1002
1003
|
n.timeout = n.timeout === void 0 ? 100 * 1e3 : n.timeout;
|
|
1003
1004
|
let s = null, o = null;
|
|
1004
|
-
if (
|
|
1005
|
-
const
|
|
1006
|
-
s =
|
|
1005
|
+
if (L.isNode && typeof require < "u") {
|
|
1006
|
+
const i = typeof __webpack_require__ == "function" ? __non_webpack_require__ : require;
|
|
1007
|
+
s = i("ws"), o = i("eventsource");
|
|
1007
1008
|
}
|
|
1008
|
-
!
|
|
1009
|
+
!L.isNode && typeof WebSocket < "u" && !n.WebSocket ? n.WebSocket = WebSocket : L.isNode && !n.WebSocket && s && (n.WebSocket = s), !L.isNode && typeof EventSource < "u" && !n.EventSource ? n.EventSource = EventSource : L.isNode && !n.EventSource && typeof o < "u" && (n.EventSource = o), this._httpClient = new At(n.httpClient || new Pt(this._logger), n.accessTokenFactory), this._connectionState = "Disconnected", this._connectionStarted = !1, this._options = n, this.onreceive = null, this.onclose = null;
|
|
1009
1010
|
}
|
|
1010
1011
|
async start(e) {
|
|
1011
1012
|
if (e = e || D.Binary, E.isIn(e, D, "transferFormat"), this._logger.log(l.Debug, `Starting connection with transfer format '${D[e]}'.`), this._connectionState !== "Disconnected")
|
|
@@ -1020,7 +1021,7 @@ class Rt {
|
|
|
1020
1021
|
this._connectionStarted = !0;
|
|
1021
1022
|
}
|
|
1022
1023
|
send(e) {
|
|
1023
|
-
return this._connectionState !== "Connected" ? Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")) : (this._sendQueue || (this._sendQueue = new
|
|
1024
|
+
return this._connectionState !== "Connected" ? Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")) : (this._sendQueue || (this._sendQueue = new me(this.transport)), this._sendQueue.send(e));
|
|
1024
1025
|
}
|
|
1025
1026
|
async stop(e) {
|
|
1026
1027
|
if (this._connectionState === "Disconnected")
|
|
@@ -1066,77 +1067,77 @@ class Rt {
|
|
|
1066
1067
|
if (s.ProtocolVersion)
|
|
1067
1068
|
throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");
|
|
1068
1069
|
if (s.url && (n = s.url), s.accessToken) {
|
|
1069
|
-
const
|
|
1070
|
-
this._accessTokenFactory = () =>
|
|
1070
|
+
const i = s.accessToken;
|
|
1071
|
+
this._accessTokenFactory = () => i, this._httpClient._accessToken = i, this._httpClient._accessTokenFactory = void 0;
|
|
1071
1072
|
}
|
|
1072
1073
|
o++;
|
|
1073
|
-
} while (s.url && o <
|
|
1074
|
-
if (o ===
|
|
1074
|
+
} while (s.url && o < xe);
|
|
1075
|
+
if (o === xe && s.url)
|
|
1075
1076
|
throw new Error("Negotiate redirection limit exceeded.");
|
|
1076
1077
|
await this._createTransport(n, this._options.transport, s, e);
|
|
1077
1078
|
}
|
|
1078
|
-
this.transport instanceof
|
|
1079
|
+
this.transport instanceof Pe && (this.features.inherentKeepAlive = !0), this._connectionState === "Connecting" && (this._logger.log(l.Debug, "The HttpConnection connected successfully."), this._connectionState = "Connected");
|
|
1079
1080
|
} catch (s) {
|
|
1080
1081
|
return this._logger.log(l.Error, "Failed to start the connection: " + s), this._connectionState = "Disconnected", this.transport = void 0, this._stopPromiseResolver(), Promise.reject(s);
|
|
1081
1082
|
}
|
|
1082
1083
|
}
|
|
1083
1084
|
async _getNegotiationResponse(e) {
|
|
1084
|
-
const n = {}, [s, o] =
|
|
1085
|
+
const n = {}, [s, o] = q();
|
|
1085
1086
|
n[s] = o;
|
|
1086
|
-
const
|
|
1087
|
-
this._logger.log(l.Debug, `Sending negotiation request: ${
|
|
1087
|
+
const i = this._resolveNegotiateUrl(e);
|
|
1088
|
+
this._logger.log(l.Debug, `Sending negotiation request: ${i}.`);
|
|
1088
1089
|
try {
|
|
1089
|
-
const
|
|
1090
|
+
const r = await this._httpClient.post(i, {
|
|
1090
1091
|
content: "",
|
|
1091
1092
|
headers: { ...n, ...this._options.headers },
|
|
1092
1093
|
timeout: this._options.timeout,
|
|
1093
1094
|
withCredentials: this._options.withCredentials
|
|
1094
1095
|
});
|
|
1095
|
-
if (
|
|
1096
|
-
return Promise.reject(new Error(`Unexpected status code returned from negotiate '${
|
|
1097
|
-
const a = JSON.parse(
|
|
1098
|
-
return (!a.negotiateVersion || a.negotiateVersion < 1) && (a.connectionToken = a.connectionId), a.useStatefulReconnect && this._options._useStatefulReconnect !== !0 ? Promise.reject(new
|
|
1099
|
-
} catch (
|
|
1100
|
-
let a = "Failed to complete negotiation with the server: " +
|
|
1101
|
-
return
|
|
1096
|
+
if (r.statusCode !== 200)
|
|
1097
|
+
return Promise.reject(new Error(`Unexpected status code returned from negotiate '${r.statusCode}'`));
|
|
1098
|
+
const a = JSON.parse(r.content);
|
|
1099
|
+
return (!a.negotiateVersion || a.negotiateVersion < 1) && (a.connectionToken = a.connectionId), a.useStatefulReconnect && this._options._useStatefulReconnect !== !0 ? Promise.reject(new Se("Client didn't negotiate Stateful Reconnect but the server did.")) : a;
|
|
1100
|
+
} catch (r) {
|
|
1101
|
+
let a = "Failed to complete negotiation with the server: " + r;
|
|
1102
|
+
return r instanceof V && r.statusCode === 404 && (a = a + " Either this is not a SignalR endpoint or there is a proxy blocking the connection."), this._logger.log(l.Error, a), Promise.reject(new Se(a));
|
|
1102
1103
|
}
|
|
1103
1104
|
}
|
|
1104
1105
|
_createConnectUrl(e, n) {
|
|
1105
1106
|
return n ? e + (e.indexOf("?") === -1 ? "?" : "&") + `id=${n}` : e;
|
|
1106
1107
|
}
|
|
1107
1108
|
async _createTransport(e, n, s, o) {
|
|
1108
|
-
let
|
|
1109
|
+
let i = this._createConnectUrl(e, s.connectionToken);
|
|
1109
1110
|
if (this._isITransport(n)) {
|
|
1110
|
-
this._logger.log(l.Debug, "Connection was provided an instance of ITransport, using that directly."), this.transport = n, await this._startTransport(
|
|
1111
|
+
this._logger.log(l.Debug, "Connection was provided an instance of ITransport, using that directly."), this.transport = n, await this._startTransport(i, o), this.connectionId = s.connectionId;
|
|
1111
1112
|
return;
|
|
1112
1113
|
}
|
|
1113
|
-
const
|
|
1114
|
+
const r = [], a = s.availableTransports || [];
|
|
1114
1115
|
let c = s;
|
|
1115
|
-
for (const
|
|
1116
|
-
const
|
|
1117
|
-
if (
|
|
1118
|
-
|
|
1119
|
-
else if (this._isITransport(
|
|
1120
|
-
if (this.transport =
|
|
1116
|
+
for (const h of a) {
|
|
1117
|
+
const u = this._resolveTransportOrError(h, n, o, (c == null ? void 0 : c.useStatefulReconnect) === !0);
|
|
1118
|
+
if (u instanceof Error)
|
|
1119
|
+
r.push(`${h.transport} failed:`), r.push(u);
|
|
1120
|
+
else if (this._isITransport(u)) {
|
|
1121
|
+
if (this.transport = u, !c) {
|
|
1121
1122
|
try {
|
|
1122
1123
|
c = await this._getNegotiationResponse(e);
|
|
1123
|
-
} catch (
|
|
1124
|
-
return Promise.reject(
|
|
1124
|
+
} catch (_) {
|
|
1125
|
+
return Promise.reject(_);
|
|
1125
1126
|
}
|
|
1126
|
-
|
|
1127
|
+
i = this._createConnectUrl(e, c.connectionToken);
|
|
1127
1128
|
}
|
|
1128
1129
|
try {
|
|
1129
|
-
await this._startTransport(
|
|
1130
|
+
await this._startTransport(i, o), this.connectionId = c.connectionId;
|
|
1130
1131
|
return;
|
|
1131
|
-
} catch (
|
|
1132
|
-
if (this._logger.log(l.Error, `Failed to start the transport '${
|
|
1133
|
-
const
|
|
1134
|
-
return this._logger.log(l.Debug,
|
|
1132
|
+
} catch (_) {
|
|
1133
|
+
if (this._logger.log(l.Error, `Failed to start the transport '${h.transport}': ${_}`), c = void 0, r.push(new Qe(`${h.transport} failed: ${_}`, T[h.transport])), this._connectionState !== "Connecting") {
|
|
1134
|
+
const f = "Failed to select transport before stop() was called.";
|
|
1135
|
+
return this._logger.log(l.Debug, f), Promise.reject(new U(f));
|
|
1135
1136
|
}
|
|
1136
1137
|
}
|
|
1137
1138
|
}
|
|
1138
1139
|
}
|
|
1139
|
-
return
|
|
1140
|
+
return r.length > 0 ? Promise.reject(new Ye(`Unable to connect to the server with any of the available transports. ${r.join(" ")}`, r)) : Promise.reject(new Error("None of the transports supported by the client are supported by the server."));
|
|
1140
1141
|
}
|
|
1141
1142
|
_constructTransport(e) {
|
|
1142
1143
|
switch (e) {
|
|
@@ -1147,9 +1148,9 @@ class Rt {
|
|
|
1147
1148
|
case T.ServerSentEvents:
|
|
1148
1149
|
if (!this._options.EventSource)
|
|
1149
1150
|
throw new Error("'EventSource' is not supported in your environment.");
|
|
1150
|
-
return new
|
|
1151
|
+
return new Rt(this._httpClient, this._httpClient._accessToken, this._logger, this._options);
|
|
1151
1152
|
case T.LongPolling:
|
|
1152
|
-
return new
|
|
1153
|
+
return new Pe(this._httpClient, this._logger, this._options);
|
|
1153
1154
|
default:
|
|
1154
1155
|
throw new Error(`Unknown transport: ${e}.`);
|
|
1155
1156
|
}
|
|
@@ -1171,23 +1172,23 @@ class Rt {
|
|
|
1171
1172
|
} : this.transport.onclose = (s) => this._stopConnection(s), this.transport.connect(e, n);
|
|
1172
1173
|
}
|
|
1173
1174
|
_resolveTransportOrError(e, n, s, o) {
|
|
1174
|
-
const
|
|
1175
|
-
if (
|
|
1175
|
+
const i = T[e.transport];
|
|
1176
|
+
if (i == null)
|
|
1176
1177
|
return this._logger.log(l.Debug, `Skipping transport '${e.transport}' because it is not supported by this client.`), new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);
|
|
1177
|
-
if (
|
|
1178
|
+
if (Mt(n, i))
|
|
1178
1179
|
if (e.transferFormats.map((a) => D[a]).indexOf(s) >= 0) {
|
|
1179
|
-
if (
|
|
1180
|
-
return this._logger.log(l.Debug, `Skipping transport '${T[
|
|
1181
|
-
this._logger.log(l.Debug, `Selecting transport '${T[
|
|
1180
|
+
if (i === T.WebSockets && !this._options.WebSocket || i === T.ServerSentEvents && !this._options.EventSource)
|
|
1181
|
+
return this._logger.log(l.Debug, `Skipping transport '${T[i]}' because it is not supported in your environment.'`), new qe(`'${T[i]}' is not supported in your environment.`, i);
|
|
1182
|
+
this._logger.log(l.Debug, `Selecting transport '${T[i]}'.`);
|
|
1182
1183
|
try {
|
|
1183
|
-
return this.features.reconnect =
|
|
1184
|
+
return this.features.reconnect = i === T.WebSockets ? o : void 0, this._constructTransport(i);
|
|
1184
1185
|
} catch (a) {
|
|
1185
1186
|
return a;
|
|
1186
1187
|
}
|
|
1187
1188
|
} else
|
|
1188
|
-
return this._logger.log(l.Debug, `Skipping transport '${T[
|
|
1189
|
+
return this._logger.log(l.Debug, `Skipping transport '${T[i]}' because it does not support the requested transfer format '${D[s]}'.`), new Error(`'${T[i]}' does not support ${D[s]}.`);
|
|
1189
1190
|
else
|
|
1190
|
-
return this._logger.log(l.Debug, `Skipping transport '${T[
|
|
1191
|
+
return this._logger.log(l.Debug, `Skipping transport '${T[i]}' because it was disabled by the client.`), new Ze(`'${T[i]}' is disabled by the client.`, i);
|
|
1191
1192
|
}
|
|
1192
1193
|
_isITransport(e) {
|
|
1193
1194
|
return e && typeof e == "object" && "connect" in e;
|
|
@@ -1213,7 +1214,7 @@ class Rt {
|
|
|
1213
1214
|
_resolveUrl(e) {
|
|
1214
1215
|
if (e.lastIndexOf("https://", 0) === 0 || e.lastIndexOf("http://", 0) === 0)
|
|
1215
1216
|
return e;
|
|
1216
|
-
if (!
|
|
1217
|
+
if (!L.isBrowser)
|
|
1217
1218
|
throw new Error(`Cannot resolve '${e}'.`);
|
|
1218
1219
|
const n = window.document.createElement("a");
|
|
1219
1220
|
return n.href = e, this._logger.log(l.Information, `Normalizing '${e}' to '${n.href}'.`), n.href;
|
|
@@ -1225,15 +1226,15 @@ class Rt {
|
|
|
1225
1226
|
return s.has("negotiateVersion") || s.append("negotiateVersion", this._negotiateVersion.toString()), s.has("useStatefulReconnect") ? s.get("useStatefulReconnect") === "true" && (this._options._useStatefulReconnect = !0) : this._options._useStatefulReconnect === !0 && s.append("useStatefulReconnect", "true"), n.search = s.toString(), n.toString();
|
|
1226
1227
|
}
|
|
1227
1228
|
}
|
|
1228
|
-
function
|
|
1229
|
+
function Mt(t, e) {
|
|
1229
1230
|
return !t || (e & t) !== 0;
|
|
1230
1231
|
}
|
|
1231
|
-
class
|
|
1232
|
+
class me {
|
|
1232
1233
|
constructor(e) {
|
|
1233
|
-
this._transport = e, this._buffer = [], this._executing = !0, this._sendBufferedData = new
|
|
1234
|
+
this._transport = e, this._buffer = [], this._executing = !0, this._sendBufferedData = new se(), this._transportResult = new se(), this._sendLoopPromise = this._sendLoop();
|
|
1234
1235
|
}
|
|
1235
1236
|
send(e) {
|
|
1236
|
-
return this._bufferData(e), this._transportResult || (this._transportResult = new
|
|
1237
|
+
return this._bufferData(e), this._transportResult || (this._transportResult = new se()), this._transportResult.promise;
|
|
1237
1238
|
}
|
|
1238
1239
|
stop() {
|
|
1239
1240
|
return this._executing = !1, this._sendBufferedData.resolve(), this._sendLoopPromise;
|
|
@@ -1249,10 +1250,10 @@ class pe {
|
|
|
1249
1250
|
this._transportResult && this._transportResult.reject("Connection stopped.");
|
|
1250
1251
|
break;
|
|
1251
1252
|
}
|
|
1252
|
-
this._sendBufferedData = new
|
|
1253
|
+
this._sendBufferedData = new se();
|
|
1253
1254
|
const e = this._transportResult;
|
|
1254
1255
|
this._transportResult = void 0;
|
|
1255
|
-
const n = typeof this._buffer[0] == "string" ? this._buffer.join("") :
|
|
1256
|
+
const n = typeof this._buffer[0] == "string" ? this._buffer.join("") : me._concatBuffers(this._buffer);
|
|
1256
1257
|
this._buffer.length = 0;
|
|
1257
1258
|
try {
|
|
1258
1259
|
await this._transport.send(n), e.resolve();
|
|
@@ -1262,14 +1263,14 @@ class pe {
|
|
|
1262
1263
|
}
|
|
1263
1264
|
}
|
|
1264
1265
|
static _concatBuffers(e) {
|
|
1265
|
-
const n = e.map((
|
|
1266
|
+
const n = e.map((i) => i.byteLength).reduce((i, r) => i + r), s = new Uint8Array(n);
|
|
1266
1267
|
let o = 0;
|
|
1267
|
-
for (const
|
|
1268
|
-
s.set(new Uint8Array(
|
|
1268
|
+
for (const i of e)
|
|
1269
|
+
s.set(new Uint8Array(i), o), o += i.byteLength;
|
|
1269
1270
|
return s.buffer;
|
|
1270
1271
|
}
|
|
1271
1272
|
}
|
|
1272
|
-
class
|
|
1273
|
+
class se {
|
|
1273
1274
|
constructor() {
|
|
1274
1275
|
this.promise = new Promise((e, n) => [this._resolver, this._rejecter] = [e, n]);
|
|
1275
1276
|
}
|
|
@@ -1280,10 +1281,10 @@ class oe {
|
|
|
1280
1281
|
this._rejecter(e);
|
|
1281
1282
|
}
|
|
1282
1283
|
}
|
|
1283
|
-
const
|
|
1284
|
-
class
|
|
1284
|
+
const $t = "json";
|
|
1285
|
+
class Nt {
|
|
1285
1286
|
constructor() {
|
|
1286
|
-
this.name =
|
|
1287
|
+
this.name = $t, this.version = 2, this.transferFormat = D.Text;
|
|
1287
1288
|
}
|
|
1288
1289
|
/** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.
|
|
1289
1290
|
*
|
|
@@ -1295,37 +1296,37 @@ class $t {
|
|
|
1295
1296
|
throw new Error("Invalid input for JSON hub protocol. Expected a string.");
|
|
1296
1297
|
if (!e)
|
|
1297
1298
|
return [];
|
|
1298
|
-
n === null && (n =
|
|
1299
|
-
const s =
|
|
1300
|
-
for (const
|
|
1301
|
-
const
|
|
1302
|
-
if (typeof
|
|
1299
|
+
n === null && (n = Me.instance);
|
|
1300
|
+
const s = be.parse(e), o = [];
|
|
1301
|
+
for (const i of s) {
|
|
1302
|
+
const r = JSON.parse(i);
|
|
1303
|
+
if (typeof r.type != "number")
|
|
1303
1304
|
throw new Error("Invalid payload.");
|
|
1304
|
-
switch (
|
|
1305
|
-
case
|
|
1306
|
-
this._isInvocationMessage(
|
|
1305
|
+
switch (r.type) {
|
|
1306
|
+
case G.Invocation:
|
|
1307
|
+
this._isInvocationMessage(r);
|
|
1307
1308
|
break;
|
|
1308
|
-
case
|
|
1309
|
-
this._isStreamItemMessage(
|
|
1309
|
+
case G.StreamItem:
|
|
1310
|
+
this._isStreamItemMessage(r);
|
|
1310
1311
|
break;
|
|
1311
|
-
case
|
|
1312
|
-
this._isCompletionMessage(
|
|
1312
|
+
case G.Completion:
|
|
1313
|
+
this._isCompletionMessage(r);
|
|
1313
1314
|
break;
|
|
1314
|
-
case
|
|
1315
|
+
case G.Ping:
|
|
1315
1316
|
break;
|
|
1316
|
-
case
|
|
1317
|
+
case G.Close:
|
|
1317
1318
|
break;
|
|
1318
|
-
case
|
|
1319
|
-
this._isAckMessage(
|
|
1319
|
+
case G.Ack:
|
|
1320
|
+
this._isAckMessage(r);
|
|
1320
1321
|
break;
|
|
1321
|
-
case
|
|
1322
|
-
this._isSequenceMessage(
|
|
1322
|
+
case G.Sequence:
|
|
1323
|
+
this._isSequenceMessage(r);
|
|
1323
1324
|
break;
|
|
1324
1325
|
default:
|
|
1325
|
-
n.log(l.Information, "Unknown message type '" +
|
|
1326
|
+
n.log(l.Information, "Unknown message type '" + r.type + "' ignored.");
|
|
1326
1327
|
continue;
|
|
1327
1328
|
}
|
|
1328
|
-
o.push(
|
|
1329
|
+
o.push(r);
|
|
1329
1330
|
}
|
|
1330
1331
|
return o;
|
|
1331
1332
|
}
|
|
@@ -1335,7 +1336,7 @@ class $t {
|
|
|
1335
1336
|
* @returns {string} A string containing the serialized representation of the message.
|
|
1336
1337
|
*/
|
|
1337
1338
|
writeMessage(e) {
|
|
1338
|
-
return
|
|
1339
|
+
return be.write(JSON.stringify(e));
|
|
1339
1340
|
}
|
|
1340
1341
|
_isInvocationMessage(e) {
|
|
1341
1342
|
this._assertNotEmptyString(e.target, "Invalid payload for Invocation message."), e.invocationId !== void 0 && this._assertNotEmptyString(e.invocationId, "Invalid payload for Invocation message.");
|
|
@@ -1362,7 +1363,7 @@ class $t {
|
|
|
1362
1363
|
throw new Error(n);
|
|
1363
1364
|
}
|
|
1364
1365
|
}
|
|
1365
|
-
const
|
|
1366
|
+
const Ot = {
|
|
1366
1367
|
trace: l.Trace,
|
|
1367
1368
|
debug: l.Debug,
|
|
1368
1369
|
info: l.Information,
|
|
@@ -1374,20 +1375,20 @@ const Nt = {
|
|
|
1374
1375
|
none: l.None
|
|
1375
1376
|
};
|
|
1376
1377
|
function Ht(t) {
|
|
1377
|
-
const e =
|
|
1378
|
+
const e = Ot[t.toLowerCase()];
|
|
1378
1379
|
if (typeof e < "u")
|
|
1379
1380
|
return e;
|
|
1380
1381
|
throw new Error(`Unknown log level: ${t}`);
|
|
1381
1382
|
}
|
|
1382
|
-
class
|
|
1383
|
+
class Ut {
|
|
1383
1384
|
configureLogging(e) {
|
|
1384
|
-
if (E.isRequired(e, "logging"),
|
|
1385
|
+
if (E.isRequired(e, "logging"), Wt(e))
|
|
1385
1386
|
this.logger = e;
|
|
1386
1387
|
else if (typeof e == "string") {
|
|
1387
1388
|
const n = Ht(e);
|
|
1388
|
-
this.logger = new
|
|
1389
|
+
this.logger = new Ce(n);
|
|
1389
1390
|
} else
|
|
1390
|
-
this.logger = new
|
|
1391
|
+
this.logger = new Ce(e);
|
|
1391
1392
|
return this;
|
|
1392
1393
|
}
|
|
1393
1394
|
withUrl(e, n) {
|
|
@@ -1406,7 +1407,7 @@ class Ot {
|
|
|
1406
1407
|
withAutomaticReconnect(e) {
|
|
1407
1408
|
if (this.reconnectPolicy)
|
|
1408
1409
|
throw new Error("A reconnectPolicy has already been set.");
|
|
1409
|
-
return e ? Array.isArray(e) ? this.reconnectPolicy = new
|
|
1410
|
+
return e ? Array.isArray(e) ? this.reconnectPolicy = new Ee(e) : this.reconnectPolicy = e : this.reconnectPolicy = new Ee(), this;
|
|
1410
1411
|
}
|
|
1411
1412
|
/** Configures {@link @microsoft/signalr.HubConnection.serverTimeoutInMilliseconds} for the {@link @microsoft/signalr.HubConnection}.
|
|
1412
1413
|
*
|
|
@@ -1437,125 +1438,131 @@ class Ot {
|
|
|
1437
1438
|
const e = this.httpConnectionOptions || {};
|
|
1438
1439
|
if (e.logger === void 0 && (e.logger = this.logger), !this.url)
|
|
1439
1440
|
throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");
|
|
1440
|
-
const n = new
|
|
1441
|
-
return
|
|
1441
|
+
const n = new It(this.url, e);
|
|
1442
|
+
return et.create(n, this.logger || Me.instance, this.protocol || new Nt(), this.reconnectPolicy, this._serverTimeoutInMilliseconds, this._keepAliveIntervalInMilliseconds, this._statefulReconnectBufferSize);
|
|
1442
1443
|
}
|
|
1443
1444
|
}
|
|
1444
|
-
function
|
|
1445
|
+
function Wt(t) {
|
|
1445
1446
|
return t.log !== void 0;
|
|
1446
1447
|
}
|
|
1447
|
-
const
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
authState:
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
if (
|
|
1448
|
+
const jt = 10 * 1e3, Ft = 15 * 1e3, hn = ({
|
|
1449
|
+
children: t,
|
|
1450
|
+
apiUrl: e,
|
|
1451
|
+
endpoint: n
|
|
1452
|
+
}) => {
|
|
1453
|
+
const {
|
|
1454
|
+
authState: s,
|
|
1455
|
+
getToken: o
|
|
1456
|
+
} = z(pe), i = dt(), [r, a] = R(fe.Disconnected), [c, h] = R(!1), u = Q(null), _ = Q(o);
|
|
1457
|
+
_.current = o;
|
|
1458
|
+
const f = Y(() => {
|
|
1459
|
+
var d;
|
|
1460
|
+
return a(((d = u.current) == null ? void 0 : d.state) ?? fe.Disconnected);
|
|
1461
|
+
}, []);
|
|
1462
|
+
B(() => {
|
|
1463
|
+
if (s !== "AUTH_OK" || !i)
|
|
1463
1464
|
return;
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
})
|
|
1468
|
-
|
|
1469
|
-
})
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1465
|
+
let d = !1, b = null;
|
|
1466
|
+
const p = new Ut().withUrl(`${e}/${n}`, {
|
|
1467
|
+
accessTokenFactory: () => _.current().then((w) => (w == null ? void 0 : w.token) ?? "")
|
|
1468
|
+
}).withAutomaticReconnect({
|
|
1469
|
+
nextRetryDelayInMilliseconds: (w) => Math.min(1e3 * 2 ** w.previousRetryCount, Ft)
|
|
1470
|
+
}).build();
|
|
1471
|
+
u.current = p, p.on("Connected", (w) => {
|
|
1472
|
+
console.log("Server says:", w);
|
|
1473
|
+
}), p.onreconnecting((w) => {
|
|
1474
|
+
d || (console.log("Reconnecting...", w), f(), h(!0));
|
|
1475
|
+
}), p.onreconnected(() => {
|
|
1476
|
+
d || (console.log("Reconnected"), f(), h(!1));
|
|
1477
|
+
}), p.onclose((w) => {
|
|
1478
|
+
d || (console.log("Connection closed", w), f(), h(!0));
|
|
1475
1479
|
});
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
}, e
|
|
1489
|
-
const
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
}
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1480
|
+
const C = () => {
|
|
1481
|
+
p.start().then(() => {
|
|
1482
|
+
d || (console.log("Connection started"), f(), h(!1));
|
|
1483
|
+
}).catch((w) => {
|
|
1484
|
+
d || (console.log("Error starting connection:", w), f(), h(!0), b = window.setTimeout(C, jt));
|
|
1485
|
+
});
|
|
1486
|
+
};
|
|
1487
|
+
return C(), () => {
|
|
1488
|
+
d = !0, b !== null && window.clearTimeout(b), u.current = null, p.stop().catch((w) => {
|
|
1489
|
+
console.log("Error stopping connection:", w);
|
|
1490
|
+
});
|
|
1491
|
+
};
|
|
1492
|
+
}, [e, s, n, f, i]);
|
|
1493
|
+
const g = F(() => r === fe.Connected, [r]), m = F(() => s === "AUTH_OK", [s]), S = F(() => ({
|
|
1494
|
+
isAlive: g,
|
|
1495
|
+
shouldBeAlive: m,
|
|
1496
|
+
connectionState: r,
|
|
1497
|
+
hasLastConnectionEnded: c
|
|
1498
|
+
}), [g, m, r, c]);
|
|
1499
|
+
return /* @__PURE__ */ y($e.Provider, { value: S, children: t });
|
|
1500
|
+
}, un = () => {
|
|
1501
|
+
const t = z($e);
|
|
1502
|
+
if (!t)
|
|
1503
|
+
throw new Error("useApiWebSocket must be used within a ApiWebSocketProvider");
|
|
1504
|
+
return t;
|
|
1505
|
+
}, Ae = 50, Bt = () => {
|
|
1500
1506
|
const t = N.c(22), {
|
|
1501
1507
|
texts: e
|
|
1502
|
-
} =
|
|
1508
|
+
} = z(ce), {
|
|
1503
1509
|
confirm: n
|
|
1504
1510
|
} = e, {
|
|
1505
1511
|
onConfirm: s,
|
|
1506
1512
|
onCancel: o,
|
|
1507
|
-
text:
|
|
1508
|
-
show:
|
|
1513
|
+
text: i,
|
|
1514
|
+
show: r,
|
|
1509
1515
|
textSm: a
|
|
1510
|
-
} = tt(), c = a === void 0 ?
|
|
1511
|
-
let
|
|
1512
|
-
t[0] !== o || t[1] !== s || t[2] !==
|
|
1513
|
-
if (
|
|
1514
|
-
e: switch (
|
|
1516
|
+
} = tt(), c = a === void 0 ? i.length > Ae : a, h = i.length > Ae;
|
|
1517
|
+
let u;
|
|
1518
|
+
t[0] !== o || t[1] !== s || t[2] !== r ? (u = (p) => {
|
|
1519
|
+
if (r)
|
|
1520
|
+
e: switch (p.key) {
|
|
1515
1521
|
case "Enter": {
|
|
1516
|
-
|
|
1522
|
+
p.preventDefault(), p.stopPropagation(), s();
|
|
1517
1523
|
break e;
|
|
1518
1524
|
}
|
|
1519
1525
|
case "Escape": {
|
|
1520
|
-
|
|
1526
|
+
p.preventDefault(), p.stopPropagation(), o();
|
|
1521
1527
|
break e;
|
|
1522
1528
|
}
|
|
1523
1529
|
}
|
|
1524
|
-
}, t[0] = o, t[1] = s, t[2] =
|
|
1525
|
-
const
|
|
1526
|
-
let
|
|
1527
|
-
t[4] !== c || t[5] !==
|
|
1528
|
-
let
|
|
1529
|
-
t[7] !== n.no || t[8] !== o ? (
|
|
1530
|
-
let w;
|
|
1531
|
-
t[10] !== n.yes || t[11] !== s ? (w = /* @__PURE__ */ v(re, { type: "button", color: "primary", onClick: s, className: "w-100 ml", children: n.yes }), t[10] = n.yes, t[11] = s, t[12] = w) : w = t[12];
|
|
1532
|
-
let d;
|
|
1533
|
-
t[13] !== p || t[14] !== w ? (d = /* @__PURE__ */ v(O.Body, { children: /* @__PURE__ */ I("div", { className: "w-100 d-flex gap-5", children: [
|
|
1534
|
-
p,
|
|
1535
|
-
w
|
|
1536
|
-
] }) }), t[13] = p, t[14] = w, t[15] = d) : d = t[15];
|
|
1530
|
+
}, t[0] = o, t[1] = s, t[2] = r, t[3] = u) : u = t[3], nt(u);
|
|
1531
|
+
const f = h ? void 0 : "sm";
|
|
1532
|
+
let g;
|
|
1533
|
+
t[4] !== c || t[5] !== i ? (g = /* @__PURE__ */ y(H.Header, { className: "justify-content-center", children: c ? /* @__PURE__ */ y(ot, { variant: "body", children: i }) : /* @__PURE__ */ y(H.Title, { children: i }) }), t[4] = c, t[5] = i, t[6] = g) : g = t[6];
|
|
1534
|
+
let m;
|
|
1535
|
+
t[7] !== n.no || t[8] !== o ? (m = /* @__PURE__ */ y(ie, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: o, children: n.no }), t[7] = n.no, t[8] = o, t[9] = m) : m = t[9];
|
|
1537
1536
|
let S;
|
|
1538
|
-
|
|
1539
|
-
|
|
1537
|
+
t[10] !== n.yes || t[11] !== s ? (S = /* @__PURE__ */ y(ie, { type: "button", color: "primary", onClick: s, className: "w-100 ml", children: n.yes }), t[10] = n.yes, t[11] = s, t[12] = S) : S = t[12];
|
|
1538
|
+
let d;
|
|
1539
|
+
t[13] !== m || t[14] !== S ? (d = /* @__PURE__ */ y(H.Body, { children: /* @__PURE__ */ I("div", { className: "w-100 d-flex gap-5", children: [
|
|
1540
|
+
m,
|
|
1541
|
+
S
|
|
1542
|
+
] }) }), t[13] = m, t[14] = S, t[15] = d) : d = t[15];
|
|
1543
|
+
let b;
|
|
1544
|
+
return t[16] !== o || t[17] !== r || t[18] !== f || t[19] !== g || t[20] !== d ? (b = /* @__PURE__ */ I(H, { show: r, size: f, centered: !0, onHide: o, children: [
|
|
1545
|
+
g,
|
|
1540
1546
|
d
|
|
1541
|
-
] }), t[16] = o, t[17] =
|
|
1547
|
+
] }), t[16] = o, t[17] = r, t[18] = f, t[19] = g, t[20] = d, t[21] = b) : b = t[21], b;
|
|
1542
1548
|
};
|
|
1543
1549
|
export {
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1550
|
+
$e as ApiWebSocketContext,
|
|
1551
|
+
hn as ApiWebSocketProvider,
|
|
1552
|
+
pe as AuthContext,
|
|
1553
|
+
rn as AuthProvider,
|
|
1554
|
+
Re as DelegationContext,
|
|
1555
|
+
an as DelegationProvider,
|
|
1556
|
+
gn as FormDisabledContext,
|
|
1557
|
+
mn as FormDisabledProvider,
|
|
1558
|
+
Xe as HelmetContext,
|
|
1559
|
+
cn as HelmetProvider,
|
|
1560
|
+
Fe as LoadingContext,
|
|
1561
|
+
on as LoadingProvider,
|
|
1556
1562
|
ce as LuminusComponentsContext,
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1563
|
+
nn as LuminusComponentsProvider,
|
|
1564
|
+
ze as UserContext,
|
|
1565
|
+
sn as UserProvider,
|
|
1566
|
+
un as useApiWebSocketContext,
|
|
1567
|
+
pn as useFormDisabledContext
|
|
1561
1568
|
};
|