react-luminus-components 2.0.3-beta.r19-15 → 2.0.3-beta.r19-16

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.
@@ -1,354 +1,601 @@
1
- import { t as E, bJ as K, bK as j, P as M, al as J, bL as R, a3 as T, ai as Q, Q as O, bM as V, ap as $, an as W, bb as q, bx as z, bd as k, ao as X, bN as Y, aC as H, bO as Z, bP as ee, am as te, b6 as ne, a4 as oe } from "./nivo-bar-FuUHRilH.js";
2
- import { bQ as _e, af as Fe } from "./nivo-bar-FuUHRilH.js";
3
- import { jsxs as w, jsx as u } from "react/jsx-runtime";
4
- import { useState as x, useCallback as m, useMemo as h, useContext as p, useEffect as b, useRef as G } from "react";
5
- import { EventType as I, InteractionRequiredAuthError as se } from "@azure/msal-browser";
6
- import { MsalProvider as re } from "@azure/msal-react";
1
+ import { t as J, bK as ue, c as N, bL as fe, Q as X, am as de, bM as ae, a4 as M, aj as me, R as W, bN as he, aq as ge, ao as Se, bc as ie, by as ce, be as H, ap as xe, bO as ye, aD as se, bP as ve, bQ as be, an as pe, b7 as Ce, a5 as we } from "./nivo-bar-BZDK_ha3.js";
2
+ import { bR as ct, ag as ut } from "./nivo-bar-BZDK_ha3.js";
3
+ import { jsxs as E, jsx as v } from "react/jsx-runtime";
4
+ import { useState as k, useContext as R, useEffect as U, useRef as oe, useMemo as Q, useCallback as te } from "react";
5
+ import { EventType as ne, InteractionRequiredAuthError as De } from "@azure/msal-browser";
6
+ import { MsalProvider as _e } from "@azure/msal-react";
7
7
  import "@tanstack/react-query";
8
8
  import "react-router";
9
9
  import "react-dom";
10
10
  import "react-hook-form";
11
11
  import "react-flexmonster";
12
- import { L as ae, b as ce } from "./FormDisabledProvider-qklvful2.js";
13
- import { F as qe } from "./FormDisabledProvider-qklvful2.js";
14
- import { a as le, u as ie } from "./useLocalStorageState-BWVTT0cO.js";
15
- function ue(t) {
16
- const r = E(t);
17
- return r.setHours(23, 59, 59, 999), r;
12
+ import { L as ke, b as Te } from "./FormDisabledProvider-DXNc2136.js";
13
+ import { F as dt } from "./FormDisabledProvider-DXNc2136.js";
14
+ import { a as Pe, u as Le } from "./useLocalStorageState-DcSLbUf2.js";
15
+ function Ee(t) {
16
+ const e = J(t);
17
+ return e.setHours(23, 59, 59, 999), e;
18
18
  }
19
- function de() {
20
- return ue(Date.now());
19
+ function Ae() {
20
+ return Ee(Date.now());
21
21
  }
22
- function me(t, r) {
23
- const o = +E(t), [e, n] = [
24
- +E(r.start),
25
- +E(r.end)
26
- ].sort((s, a) => s - a);
27
- return o >= e && o <= n;
22
+ function Oe(t, e) {
23
+ const u = +J(t), [n, s] = [
24
+ +J(e.start),
25
+ +J(e.end)
26
+ ].sort((a, o) => a - o);
27
+ return u >= n && u <= s;
28
28
  }
29
- function fe() {
30
- return K(Date.now());
29
+ function Me() {
30
+ return ue(Date.now());
31
31
  }
32
- const ge = ({ children: t }) => {
33
- const [r, o] = x(!1), [e, n] = x(""), [s, a] = x(void 0), l = m((f, d) => {
34
- o(!0), n(f), a(d);
35
- }, []), i = m(() => {
36
- o(!1);
37
- }, []), c = h(() => ({ show: r, text: e, showConfirm: l, hideConfirm: i, textSm: s }), [r, e, l, i, s]);
38
- return /* @__PURE__ */ w(j.Provider, { value: c, children: [
39
- /* @__PURE__ */ u(xe, {}),
40
- t
41
- ] });
42
- }, he = () => {
43
- const { texts: { confirm: t } } = p(M), { isShown: r, text: o, onFinish: e } = J(), { options: n } = p(R), [s, a] = x(n.defaultValue ?? ""), l = m(() => {
44
- e(null);
45
- }, [e]), i = m((f) => {
46
- f.preventDefault(), !(n.required && !s) && (e(s), a(""));
47
- }, [e, n.required, s]), c = h(() => ({
48
- value: s,
49
- onChange: (f) => a(f.currentTarget.value),
32
+ const Ne = (t) => {
33
+ const e = N.c(10), {
34
+ children: u
35
+ } = t, [n, s] = k(!1), [a, o] = k(""), [c, g] = k(void 0);
36
+ let h;
37
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (h = (y, x) => {
38
+ s(!0), o(y), g(x);
39
+ }, e[0] = h) : h = e[0];
40
+ const m = h;
41
+ let d;
42
+ e[1] === Symbol.for("react.memo_cache_sentinel") ? (d = () => {
43
+ s(!1);
44
+ }, e[1] = d) : d = e[1];
45
+ const r = d;
46
+ let l;
47
+ e[2] !== n || e[3] !== a || e[4] !== c ? (l = {
48
+ show: n,
49
+ text: a,
50
+ showConfirm: m,
51
+ hideConfirm: r,
52
+ textSm: c
53
+ }, e[2] = n, e[3] = a, e[4] = c, e[5] = l) : l = e[5];
54
+ const f = l;
55
+ let i;
56
+ e[6] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ v(Fe, {}), e[6] = i) : i = e[6];
57
+ let S;
58
+ return e[7] !== u || e[8] !== f ? (S = /* @__PURE__ */ E(fe.Provider, { value: f, children: [
59
+ i,
60
+ u
61
+ ] }), e[7] = u, e[8] = f, e[9] = S) : S = e[9], S;
62
+ }, Ie = () => {
63
+ const t = N.c(43), {
64
+ texts: e
65
+ } = R(X), {
66
+ confirm: u
67
+ } = e, {
68
+ isShown: n,
69
+ text: s,
70
+ onFinish: a
71
+ } = de(), {
72
+ options: o
73
+ } = R(ae), [c, g] = k(o.defaultValue ?? "");
74
+ let h;
75
+ t[0] !== a ? (h = () => {
76
+ a(null);
77
+ }, t[0] = a, t[1] = h) : h = t[1];
78
+ const m = h;
79
+ let d;
80
+ t[2] !== a || t[3] !== o.required || t[4] !== c ? (d = (I) => {
81
+ I.preventDefault(), !(o.required && !c) && (a(c), g(""));
82
+ }, t[2] = a, t[3] = o.required, t[4] = c, t[5] = d) : d = t[5];
83
+ const r = d;
84
+ let l;
85
+ t[6] === Symbol.for("react.memo_cache_sentinel") ? (l = (I) => g(I.currentTarget.value), t[6] = l) : l = t[6];
86
+ let f;
87
+ t[7] !== c ? (f = {
88
+ value: c,
89
+ onChange: l,
50
90
  className: "w-100",
51
91
  autoFocus: !0,
52
92
  tabIndex: 0
53
- }), [s]);
54
- return b(() => {
55
- r === !0 && a(n.defaultValue ?? "");
56
- }, [r, n.defaultValue]), /* @__PURE__ */ w(T, { show: r, size: "sm", centered: !0, onHide: l, children: [
57
- /* @__PURE__ */ u(T.Header, { className: "justify-content-center", children: /* @__PURE__ */ u(T.Title, { children: o }) }),
58
- /* @__PURE__ */ w("form", { onSubmit: i, onKeyDown: (f) => f.stopPropagation(), children: [
59
- /* @__PURE__ */ w(T.Body, { children: [
60
- n.input === "textarea" ? /* @__PURE__ */ u("textarea", { ...c, rows: 5 }) : void 0,
61
- n.input === "input" ? /* @__PURE__ */ u(Q, { ...c, type: n.type }) : void 0
62
- ] }),
63
- /* @__PURE__ */ w(T.Footer, { className: "w-100 d-flex gap-5", children: [
64
- /* @__PURE__ */ u(O, { variant: "outlined", color: "secondary", onClick: l, className: "flex-grow-1", children: t.cancel }),
65
- /* @__PURE__ */ u(O, { color: "primary", disabled: n.required && !s, type: "submit", className: "flex-grow-1", children: t.confirm })
66
- ] })
67
- ] })
68
- ] });
69
- }, ve = ({ children: t }) => {
70
- const [r, o] = x(!1), [e, n] = x(""), [s, a] = x({ input: "textarea", type: "text" }), l = G(() => {
71
- }), i = m((d) => {
72
- n(d), o(!0);
73
- }, []), c = m(() => {
74
- o(!1);
75
- }, []), f = h(() => ({
76
- isShown: r,
77
- text: e,
78
- showPrompt: i,
79
- hidePrompt: c,
80
- resolveRef: l,
81
- options: s,
82
- setOptions: a
83
- }), [r, e, i, c, s]);
84
- return /* @__PURE__ */ w(R.Provider, { value: f, children: [
85
- t,
86
- /* @__PURE__ */ u(he, {})
87
- ] });
88
- }, Ee = ({ cookieDomain: t, axiosOptions: r, language: o, texts: e, ProjectIconComponent: n, localizationContext: s, chartColorPalette: a, children: l }) => {
89
- const i = h(() => ({
90
- axiosOptions: r,
91
- cookieDomain: t,
92
- language: o,
93
- texts: e,
94
- ProjectIconComponent: n,
95
- localizationContext: s,
96
- chartColorPalette: a
97
- }), [
93
+ }, t[7] = c, t[8] = f) : f = t[8];
94
+ const i = f;
95
+ let S, y;
96
+ t[9] !== n || t[10] !== o.defaultValue ? (S = () => {
97
+ n === !0 && g(o.defaultValue ?? "");
98
+ }, y = [n, o.defaultValue], t[9] = n, t[10] = o.defaultValue, t[11] = S, t[12] = y) : (S = t[11], y = t[12]), U(S, y);
99
+ let x;
100
+ t[13] !== s ? (x = /* @__PURE__ */ v(M.Header, { className: "justify-content-center", children: /* @__PURE__ */ v(M.Title, { children: s }) }), t[13] = s, t[14] = x) : x = t[14];
101
+ let b;
102
+ t[15] !== i || t[16] !== o.input ? (b = o.input === "textarea" ? /* @__PURE__ */ v("textarea", { ...i, rows: 5 }) : void 0, t[15] = i, t[16] = o.input, t[17] = b) : b = t[17];
103
+ let C;
104
+ t[18] !== i || t[19] !== o.input || t[20] !== o.type ? (C = o.input === "input" ? /* @__PURE__ */ v(me, { ...i, type: o.type }) : void 0, t[18] = i, t[19] = o.input, t[20] = o.type, t[21] = C) : C = t[21];
105
+ let p;
106
+ t[22] !== b || t[23] !== C ? (p = /* @__PURE__ */ E(M.Body, { children: [
107
+ b,
108
+ C
109
+ ] }), t[22] = b, t[23] = C, t[24] = p) : p = t[24];
110
+ let D;
111
+ t[25] !== u.cancel || t[26] !== m ? (D = /* @__PURE__ */ v(W, { variant: "outlined", color: "secondary", onClick: m, className: "flex-grow-1", children: u.cancel }), t[25] = u.cancel, t[26] = m, t[27] = D) : D = t[27];
112
+ const G = o.required && !c;
113
+ let T;
114
+ t[28] !== u.confirm || t[29] !== G ? (T = /* @__PURE__ */ v(W, { color: "primary", disabled: G, type: "submit", className: "flex-grow-1", children: u.confirm }), t[28] = u.confirm, t[29] = G, t[30] = T) : T = t[30];
115
+ let A;
116
+ t[31] !== D || t[32] !== T ? (A = /* @__PURE__ */ E(M.Footer, { className: "w-100 d-flex gap-5", children: [
117
+ D,
118
+ T
119
+ ] }), t[31] = D, t[32] = T, t[33] = A) : A = t[33];
120
+ let P;
121
+ t[34] !== r || t[35] !== p || t[36] !== A ? (P = /* @__PURE__ */ E("form", { onSubmit: r, onKeyDown: Ge, children: [
122
+ p,
123
+ A
124
+ ] }), t[34] = r, t[35] = p, t[36] = A, t[37] = P) : P = t[37];
125
+ let w;
126
+ return t[38] !== n || t[39] !== m || t[40] !== P || t[41] !== x ? (w = /* @__PURE__ */ E(M, { show: n, size: "sm", centered: !0, onHide: m, children: [
127
+ x,
128
+ P
129
+ ] }), t[38] = n, t[39] = m, t[40] = P, t[41] = x, t[42] = w) : w = t[42], w;
130
+ };
131
+ function Ge(t) {
132
+ return t.stopPropagation();
133
+ }
134
+ const Ue = (t) => {
135
+ const e = N.c(11), {
136
+ children: u
137
+ } = t, [n, s] = k(!1), [a, o] = k("");
138
+ let c;
139
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (c = {
140
+ input: "textarea",
141
+ type: "text"
142
+ }, e[0] = c) : c = e[0];
143
+ const [g, h] = k(c), m = oe($e);
144
+ let d;
145
+ e[1] === Symbol.for("react.memo_cache_sentinel") ? (d = (b) => {
146
+ o(b), s(!0);
147
+ }, e[1] = d) : d = e[1];
148
+ const r = d;
149
+ let l;
150
+ e[2] === Symbol.for("react.memo_cache_sentinel") ? (l = () => {
151
+ s(!1);
152
+ }, e[2] = l) : l = e[2];
153
+ const f = l;
154
+ let i;
155
+ e[3] !== n || e[4] !== g || e[5] !== a ? (i = {
156
+ isShown: n,
157
+ text: a,
158
+ showPrompt: r,
159
+ hidePrompt: f,
160
+ resolveRef: m,
161
+ options: g,
162
+ setOptions: h
163
+ }, e[3] = n, e[4] = g, e[5] = a, e[6] = i) : i = e[6];
164
+ const S = i;
165
+ let y;
166
+ e[7] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ v(Ie, {}), e[7] = y) : y = e[7];
167
+ let x;
168
+ return e[8] !== u || e[9] !== S ? (x = /* @__PURE__ */ E(ae.Provider, { value: S, children: [
169
+ u,
170
+ y
171
+ ] }), e[8] = u, e[9] = S, e[10] = x) : x = e[10], x;
172
+ };
173
+ function $e() {
174
+ }
175
+ const tt = (t) => {
176
+ const e = N.c(14), {
177
+ cookieDomain: u,
178
+ axiosOptions: n,
179
+ language: s,
180
+ texts: a,
181
+ ProjectIconComponent: o,
182
+ localizationContext: c,
183
+ chartColorPalette: g,
184
+ children: h
185
+ } = t;
186
+ let m;
187
+ e[0] !== o || e[1] !== n || e[2] !== g || e[3] !== u || e[4] !== s || e[5] !== c || e[6] !== a ? (m = {
188
+ axiosOptions: n,
189
+ cookieDomain: u,
190
+ language: s,
191
+ texts: a,
192
+ ProjectIconComponent: o,
193
+ localizationContext: c,
194
+ chartColorPalette: g
195
+ }, e[0] = o, e[1] = n, e[2] = g, e[3] = u, e[4] = s, e[5] = c, e[6] = a, e[7] = m) : m = e[7];
196
+ const d = m;
197
+ let r;
198
+ e[8] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ v(he, {}), e[8] = r) : r = e[8];
199
+ let l;
200
+ e[9] !== h ? (l = /* @__PURE__ */ v(Ne, { children: /* @__PURE__ */ E(Ue, { children: [
98
201
  r,
99
- t,
100
- o,
101
- n,
102
- s,
103
- e,
104
- a
105
- ]);
106
- return /* @__PURE__ */ u(M.Provider, { value: i, children: /* @__PURE__ */ u(ge, { children: /* @__PURE__ */ w(ve, { children: [
107
- /* @__PURE__ */ u(V, {}),
108
- l
109
- ] }) }) });
110
- }, Oe = ({ children: t }) => {
111
- const [r, o] = x(!1), [e] = x(/* @__PURE__ */ new Set()), n = m((l) => {
112
- e.add(l), o(!0);
113
- }, [e]), s = m((l) => {
114
- e.delete(l), e.size === 0 && o(!1);
115
- }, [e]), a = h(() => ({ isLoading: r, startLoading: n, stopLoading: s }), [r, n, s]);
116
- return /* @__PURE__ */ w($.Provider, { value: a, children: [
117
- r && /* @__PURE__ */ u(ae, {}),
118
- t
119
- ] });
120
- }, Me = ({ children: t }) => {
121
- const r = W(), { msalInstance: o, getToken: e } = p(q), { delegation: n, setDelegation: s, setAvailableDelegations: a, refreshAvailableDelegations: l } = p(z), [i, c] = x(null), f = m(async () => {
122
- const g = await e();
123
- g && c(g.token);
124
- }, [e]);
125
- b(() => {
126
- f();
127
- }, [f]);
128
- const v = m(() => {
129
- const g = localStorage.getItem("user") ?? null;
130
- return g ? JSON.parse(g ?? "") : null;
131
- }, [])(), [C, D] = x({
132
- state: v ? k.LOGGED_IN : k.LOGGING_IN,
133
- user: v
134
- }), S = m(async (g) => {
135
- let y = null;
136
- return await r.get("/user/detail", g ? { headers: { Authorization: `Bearer ${g}` } } : void 0).then((N) => {
137
- y = N.data;
202
+ h
203
+ ] }) }), e[9] = h, e[10] = l) : l = e[10];
204
+ let f;
205
+ return e[11] !== d || e[12] !== l ? (f = /* @__PURE__ */ v(X.Provider, { value: d, children: l }), e[11] = d, e[12] = l, e[13] = f) : f = e[13], f;
206
+ }, nt = (t) => {
207
+ const e = N.c(15), {
208
+ children: u
209
+ } = t, [n, s] = k(!1);
210
+ let a;
211
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ new Set(), e[0] = a) : a = e[0];
212
+ const [o] = k(a);
213
+ let c;
214
+ e[1] !== o ? (c = (i) => {
215
+ o.add(i), s(!0);
216
+ }, e[1] = o, e[2] = c) : c = e[2];
217
+ const g = c;
218
+ let h;
219
+ e[3] !== o ? (h = (i) => {
220
+ o.delete(i), o.size === 0 && s(!1);
221
+ }, e[3] = o, e[4] = h) : h = e[4];
222
+ const m = h;
223
+ let d;
224
+ e[5] !== n || e[6] !== g || e[7] !== m ? (d = {
225
+ isLoading: n,
226
+ startLoading: g,
227
+ stopLoading: m
228
+ }, e[5] = n, e[6] = g, e[7] = m, e[8] = d) : d = e[8];
229
+ const r = d;
230
+ let l;
231
+ e[9] !== n ? (l = n && /* @__PURE__ */ v(ke, {}), e[9] = n, e[10] = l) : l = e[10];
232
+ let f;
233
+ return e[11] !== u || e[12] !== r || e[13] !== l ? (f = /* @__PURE__ */ E(ge.Provider, { value: r, children: [
234
+ l,
235
+ u
236
+ ] }), e[11] = u, e[12] = r, e[13] = l, e[14] = f) : f = e[14], f;
237
+ }, ot = (t) => {
238
+ const e = N.c(41), {
239
+ children: u
240
+ } = t, n = Se(), {
241
+ msalInstance: s,
242
+ getToken: a
243
+ } = R(ie), {
244
+ delegation: o,
245
+ setDelegation: c,
246
+ setAvailableDelegations: g,
247
+ refreshAvailableDelegations: h
248
+ } = R(ce), [m, d] = k(null);
249
+ let r;
250
+ e[0] !== a ? (r = async () => {
251
+ const _ = await a();
252
+ _ && d(_.token);
253
+ }, e[0] = a, e[1] = r) : r = e[1];
254
+ const l = r;
255
+ let f, i;
256
+ e[2] !== l ? (f = () => {
257
+ l();
258
+ }, i = [l], e[2] = l, e[3] = f, e[4] = i) : (f = e[3], i = e[4]), U(f, i);
259
+ const S = He;
260
+ let y;
261
+ e[5] === Symbol.for("react.memo_cache_sentinel") ? (y = S(), e[5] = y) : y = e[5];
262
+ const x = y;
263
+ let b;
264
+ e[6] === Symbol.for("react.memo_cache_sentinel") ? (b = {
265
+ state: x ? H.LOGGED_IN : H.LOGGING_IN,
266
+ user: x
267
+ }, e[6] = b) : b = e[6];
268
+ const [C, p] = k(b);
269
+ let D;
270
+ e[7] !== n ? (D = async (_) => {
271
+ let L = null;
272
+ return await n.get("/user/detail", _ ? {
273
+ headers: {
274
+ Authorization: `Bearer ${_}`
275
+ }
276
+ } : void 0).then((ee) => {
277
+ L = ee.data;
138
278
  }).catch(() => {
139
- y = null;
140
- }), y;
141
- }, [r]), A = m(() => {
142
- localStorage.removeItem("user"), D({
143
- state: k.LOGGED_OUT,
279
+ L = null;
280
+ }), L;
281
+ }, e[7] = n, e[8] = D) : D = e[8];
282
+ const G = D;
283
+ let T;
284
+ e[9] !== g || e[10] !== c ? (T = () => {
285
+ localStorage.removeItem("user"), p({
286
+ state: H.LOGGED_OUT,
144
287
  user: null
145
- }), s(null), a(null);
146
- }, [a, s]), P = m(async (g) => {
147
- D({
148
- state: k.LOGGING_IN,
288
+ }), c(null), g(null);
289
+ }, e[9] = g, e[10] = c, e[11] = T) : T = e[11];
290
+ const A = T;
291
+ let P;
292
+ e[12] !== G || e[13] !== h ? (P = async (_) => {
293
+ p({
294
+ state: H.LOGGING_IN,
149
295
  user: null
150
296
  });
151
- const y = await S(g);
152
- return y ? (D({
153
- state: k.LOGGED_IN,
154
- user: y
155
- }), localStorage.setItem("user", JSON.stringify(y)), await l(), !0) : (D({
156
- state: k.LOGIN_FAILED,
297
+ const L = await G(_);
298
+ return L ? (p({
299
+ state: H.LOGGED_IN,
300
+ user: L
301
+ }), localStorage.setItem("user", JSON.stringify(L)), await h(), !0) : (p({
302
+ state: H.LOGIN_FAILED,
157
303
  user: null
158
304
  }), !1);
159
- }, [S, l]), L = m(() => {
305
+ }, e[12] = G, e[13] = h, e[14] = P) : P = e[14];
306
+ const w = P;
307
+ let I;
308
+ e[15] !== A ? (I = () => {
160
309
  A();
161
- }, [A]);
162
- b(() => {
163
- if (o) {
164
- const g = o.addEventCallback((y) => {
165
- if (y.eventType === I.LOGIN_SUCCESS && y.payload) {
166
- const N = y.payload;
167
- c(N.accessToken);
310
+ }, e[15] = A, e[16] = I) : I = e[16];
311
+ const O = I;
312
+ let q;
313
+ e[17] !== s ? (q = () => {
314
+ if (s) {
315
+ const _ = s.addEventCallback((L) => {
316
+ if (L.eventType === ne.LOGIN_SUCCESS && L.payload) {
317
+ const ee = L.payload;
318
+ d(ee.accessToken);
168
319
  }
169
320
  });
170
321
  return () => {
171
- g && o.removeEventCallback(g);
322
+ _ && s.removeEventCallback(_);
172
323
  };
173
324
  }
174
- return () => {
175
- };
176
- }, [o, P, L]);
177
- const U = m(async (g) => {
178
- g && await P(g).catch(() => {
179
- L(), s(null);
325
+ return Re;
326
+ }, e[17] = s, e[18] = q) : q = e[18];
327
+ let F;
328
+ e[19] !== w || e[20] !== O || e[21] !== s ? (F = [s, w, O], e[19] = w, e[20] = O, e[21] = s, e[22] = F) : F = e[22], U(q, F);
329
+ let z;
330
+ e[23] !== w || e[24] !== O || e[25] !== c ? (z = async (_) => {
331
+ _ && await w(_).catch(() => {
332
+ O(), c(null);
180
333
  });
181
- }, [P, L, s]);
182
- b(() => {
183
- U(i);
184
- }, [i, n == null ? void 0 : n.id, U]);
185
- const B = h(() => ({
334
+ }, e[23] = w, e[24] = O, e[25] = c, e[26] = z) : z = e[26];
335
+ const $ = z;
336
+ let j;
337
+ e[27] !== m || e[28] !== $ ? (j = () => {
338
+ $(m);
339
+ }, e[27] = m, e[28] = $, e[29] = j) : j = e[29];
340
+ const Y = o == null ? void 0 : o.id;
341
+ let K;
342
+ e[30] !== m || e[31] !== $ || e[32] !== Y ? (K = [m, Y, $], e[30] = m, e[31] = $, e[32] = Y, e[33] = K) : K = e[33], U(j, K);
343
+ let B;
344
+ e[34] !== w || e[35] !== O || e[36] !== C ? (B = {
186
345
  user: C.user,
187
346
  userLoginState: C,
188
- loginUser: P,
189
- logoutUser: L
190
- }), [C, P, L]);
191
- return /* @__PURE__ */ u(X.Provider, { value: B, children: t });
192
- }, Ne = ({ ...t }) => {
193
- const { cookieDomain: r } = p(M), [, o] = Y(["Authorization"]), e = h(
347
+ loginUser: w,
348
+ logoutUser: O
349
+ }, e[34] = w, e[35] = O, e[36] = C, e[37] = B) : B = e[37];
350
+ const Z = B;
351
+ let V;
352
+ return e[38] !== u || e[39] !== Z ? (V = /* @__PURE__ */ v(xe.Provider, { value: Z, children: u }), e[38] = u, e[39] = Z, e[40] = V) : V = e[40], V;
353
+ };
354
+ function He() {
355
+ const t = localStorage.getItem("user") ?? null;
356
+ return t ? JSON.parse(t ?? "") : null;
357
+ }
358
+ function Re() {
359
+ }
360
+ const st = ({
361
+ ...t
362
+ }) => {
363
+ const {
364
+ cookieDomain: e
365
+ } = R(X), [, u] = ye(["Authorization"]), n = Q(
194
366
  () => t.useMsal ? t.msalInstance : null,
195
367
  // eslint-disable-next-line react-hooks/exhaustive-deps
196
368
  [t.useMsal, t.useMsal ? t.msalInstance : null]
197
- ), n = h(
369
+ ), s = Q(
198
370
  () => t.useMsal ? t.msalScopes : [],
199
371
  // eslint-disable-next-line react-hooks/exhaustive-deps
200
372
  [t.useMsal, t.useMsal ? t.msalScopes : null]
201
- ), s = h(
373
+ ), a = Q(
202
374
  () => t.useMsal ? t.msalExtraScopes : [],
203
375
  // eslint-disable-next-line react-hooks/exhaustive-deps
204
376
  [t.useMsal, t.useMsal ? t.msalExtraScopes : null]
205
- ), a = G(null), l = m(() => {
377
+ ), o = oe(null), c = te(() => {
206
378
  const d = localStorage.getItem("token");
207
379
  return d ? {
208
380
  token: d,
209
- expiresOn: ce(new Date(Date.now()), 1)
381
+ expiresOn: Te(new Date(Date.now()), 1)
210
382
  } : null;
211
- }, []), i = m(async () => {
212
- var D;
213
- if (a.current)
214
- return a.current;
215
- const d = e == null ? void 0 : e.getActiveAccount(), v = d ?? ((D = e == null ? void 0 : e.getAllAccounts()) == null ? void 0 : D.at(0)) ?? void 0;
216
- if (!v)
217
- return null;
218
- d || e == null || e.setActiveAccount(v);
219
- const C = e == null ? void 0 : e.acquireTokenSilent({
220
- scopes: n,
221
- account: v
222
- }).then((S) => ({
223
- token: S.accessToken,
224
- expiresOn: S.expiresOn ?? new Date(Date.now())
225
- })).catch((S) => {
226
- if (console.error("Error acquiring token", S), S instanceof se)
227
- return console.log("Silent token acquisition failed. Acquiring token using redirect"), e == null || e.acquireTokenRedirect({
228
- scopes: n,
229
- extraScopesToConsent: s
383
+ }, []), g = te(async () => {
384
+ var f;
385
+ if (o.current) return o.current;
386
+ const d = n == null ? void 0 : n.getActiveAccount(), r = d ?? ((f = n == null ? void 0 : n.getAllAccounts()) == null ? void 0 : f.at(0)) ?? void 0;
387
+ if (!r) return null;
388
+ d || n == null || n.setActiveAccount(r);
389
+ const l = n == null ? void 0 : n.acquireTokenSilent({
390
+ scopes: s,
391
+ account: r
392
+ }).then((i) => ({
393
+ token: i.accessToken,
394
+ expiresOn: i.expiresOn ?? new Date(Date.now())
395
+ })).catch((i) => {
396
+ if (console.error("Error acquiring token", i), i instanceof De)
397
+ return console.log("Silent token acquisition failed. Acquiring token using redirect"), n == null || n.acquireTokenRedirect({
398
+ scopes: s,
399
+ extraScopesToConsent: a
230
400
  }), null;
231
- throw S;
401
+ throw i;
232
402
  }).finally(() => {
233
- a.current = null;
403
+ o.current = null;
234
404
  });
235
- return a.current = C ?? null, C ?? null;
236
- }, [e, n, s]), c = m(async () => t.useMsal ? i() : l(), [l, i, t.useMsal]), f = h(() => ({
405
+ return o.current = l ?? null, l ?? null;
406
+ }, [n, s, a]), h = te(async () => t.useMsal ? g() : c(), [c, g, t.useMsal]), m = Q(() => ({
237
407
  useMsal: t.useMsal ?? !1,
238
- msalInstance: e,
239
- msalScopes: n,
240
- msalExtraScopes: s,
241
- getToken: c
242
- }), [t.useMsal, e, n, s, c]);
243
- return b(() => {
244
- if (t.useMsal && e) {
245
- const d = e.addEventCallback((v) => {
246
- if (v.eventType === I.LOGIN_SUCCESS || v.eventType === I.ACQUIRE_TOKEN_SUCCESS && v.payload) {
247
- const C = v.payload, D = C.account;
248
- e.setActiveAccount(D);
249
- const S = C.accessToken, A = C.expiresOn;
250
- o("Authorization", S, {
408
+ msalInstance: n,
409
+ msalScopes: s,
410
+ msalExtraScopes: a,
411
+ getToken: h
412
+ }), [t.useMsal, n, s, a, h]);
413
+ return U(() => {
414
+ if (t.useMsal && n) {
415
+ const d = n.addEventCallback((r) => {
416
+ if (r.eventType === ne.LOGIN_SUCCESS || r.eventType === ne.ACQUIRE_TOKEN_SUCCESS && r.payload) {
417
+ const l = r.payload, f = l.account;
418
+ n.setActiveAccount(f);
419
+ const i = l.accessToken, S = l.expiresOn;
420
+ u("Authorization", i, {
251
421
  path: "/",
252
422
  secure: !0,
253
423
  sameSite: "none",
254
- domain: r,
255
- expires: A ?? void 0
424
+ domain: e,
425
+ expires: S ?? void 0
256
426
  });
257
427
  }
258
- v.error && console.error("AuthProvider MSAL Error", v);
428
+ r.error && console.error("AuthProvider MSAL Error", r);
259
429
  });
260
430
  return () => {
261
- d && e.removeEventCallback(d);
431
+ d && n.removeEventCallback(d);
262
432
  };
263
433
  }
264
434
  return () => {
265
435
  };
266
- }, [t.useMsal, e, o, r]), /* @__PURE__ */ u(q.Provider, { value: f, children: t.useMsal ? /* @__PURE__ */ u(re, { instance: t.msalInstance, children: t.children }) : t.children });
267
- }, Ie = ({ children: t, relativeEndpoint: r }) => {
268
- const [o, e, n] = le("user-delegation", null), s = h(() => {
269
- if (!o)
270
- return null;
271
- const d = o.from ? H(o.from) : fe(), v = o.to ? H(o.to) : de();
272
- return me(new Date(Date.now()), { start: d, end: v }) ? o : (e(null), null);
273
- }, [o, e]), { data: a, setData: l, reloadData: i } = ie(r, {
436
+ }, [t.useMsal, n, u, e]), /* @__PURE__ */ v(ie.Provider, { value: m, children: t.useMsal ? /* @__PURE__ */ v(_e, { instance: t.msalInstance, children: t.children }) : t.children });
437
+ }, lt = (t) => {
438
+ const e = N.c(18), {
439
+ children: u,
440
+ relativeEndpoint: n
441
+ } = t, [s, a, o] = Pe("user-delegation", null);
442
+ let c;
443
+ e: {
444
+ if (!s) {
445
+ c = null;
446
+ break e;
447
+ }
448
+ const p = s.from ? se(s.from) : Me(), D = s.to ? se(s.to) : Ae();
449
+ if (!Oe(new Date(Date.now()), {
450
+ start: p,
451
+ end: D
452
+ })) {
453
+ a(null), c = null;
454
+ break e;
455
+ }
456
+ c = s;
457
+ }
458
+ const g = c;
459
+ let h;
460
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (h = {
274
461
  nullStateBeforeLoad: !1,
275
462
  nullStateOnFail: !0
276
- }), c = G(null);
277
- b(() => {
278
- const d = () => {
279
- i(), c.current = window.setTimeout(d, Z() + 5e3);
463
+ }, e[0] = h) : h = e[0];
464
+ const {
465
+ data: m,
466
+ setData: d,
467
+ reloadData: r
468
+ } = Le(n, h), l = oe(null);
469
+ let f, i;
470
+ e[1] !== r ? (f = () => {
471
+ const p = () => {
472
+ r(), l.current = window.setTimeout(p, ve() + 5e3);
280
473
  };
281
- return d(), () => {
282
- c.current !== null && window.clearTimeout(c.current);
474
+ return p(), () => {
475
+ l.current !== null && window.clearTimeout(l.current);
283
476
  };
284
- }, [i]), b(() => {
285
- const d = () => {
286
- n();
477
+ }, i = [r], e[1] = r, e[2] = f, e[3] = i) : (f = e[2], i = e[3]), U(f, i);
478
+ let S;
479
+ e[4] !== o ? (S = () => {
480
+ const p = () => {
481
+ o();
287
482
  };
288
- return window.addEventListener("focus", d), () => {
289
- window.removeEventListener("focus", d);
483
+ return window.addEventListener("focus", p), () => {
484
+ window.removeEventListener("focus", p);
290
485
  };
291
- }, [n, i]);
292
- const f = h(() => ({
293
- delegation: s,
294
- setDelegation: e,
295
- availableDelegations: a,
296
- setAvailableDelegations: l,
297
- refreshAvailableDelegations: i
298
- }), [
299
- s,
300
- e,
301
- a,
302
- l,
303
- i
304
- ]);
305
- return /* @__PURE__ */ u(z.Provider, { value: f, children: t });
306
- }, _ = (t, r) => t ? `${t} | ${r}` : r, Ge = ({ defaultHelmet: t, children: r, helmetPrefix: o }) => {
307
- const [e, n] = x([
308
- _(o ?? "", t)
309
- ]), s = m((c) => {
310
- n((f) => [...f, _(o ?? "", c)]);
311
- }, [o]), a = m(() => {
312
- n((c) => c.length > 1 ? c.slice(0, -1) : c);
313
- }, [n]), l = h(() => e.at(-1) ?? "", [e]), i = h(() => ({ addHelmet: s, removeHelmet: a }), [s, a]);
314
- return /* @__PURE__ */ w(ee.Provider, { value: i, children: [
315
- /* @__PURE__ */ u("title", { children: l }),
316
- r
317
- ] });
318
- }, F = 50, xe = () => {
319
- const { texts: { confirm: t } } = p(M), { onConfirm: r, onCancel: o, text: e, show: n, textSm: s } = te(), a = h(() => s === void 0 ? e.length > F : s, [e, s]), l = h(() => e.length > F, [e]), i = m((c) => {
320
- if (n)
321
- switch (c.key) {
322
- case "Enter":
323
- c.preventDefault(), c.stopPropagation(), r();
324
- break;
325
- case "Escape":
326
- c.preventDefault(), c.stopPropagation(), o();
327
- break;
486
+ }, e[4] = o, e[5] = S) : S = e[5];
487
+ let y;
488
+ e[6] !== o || e[7] !== r ? (y = [o, r], e[6] = o, e[7] = r, e[8] = y) : y = e[8], U(S, y);
489
+ let x;
490
+ e[9] !== m || e[10] !== r || e[11] !== d || e[12] !== a || e[13] !== g ? (x = {
491
+ delegation: g,
492
+ setDelegation: a,
493
+ availableDelegations: m,
494
+ setAvailableDelegations: d,
495
+ refreshAvailableDelegations: r
496
+ }, e[9] = m, e[10] = r, e[11] = d, e[12] = a, e[13] = g, e[14] = x) : x = e[14];
497
+ const b = x;
498
+ let C;
499
+ return e[15] !== u || e[16] !== b ? (C = /* @__PURE__ */ v(ce.Provider, { value: b, children: u }), e[15] = u, e[16] = b, e[17] = C) : C = e[17], C;
500
+ }, le = (t, e) => t ? `${t} | ${e}` : e, rt = (t) => {
501
+ const e = N.c(18), {
502
+ defaultHelmet: u,
503
+ children: n,
504
+ helmetPrefix: s
505
+ } = t, a = s ?? "";
506
+ let o;
507
+ e[0] !== u || e[1] !== a ? (o = le(a, u), e[0] = u, e[1] = a, e[2] = o) : o = e[2];
508
+ let c;
509
+ e[3] !== o ? (c = [o], e[3] = o, e[4] = c) : c = e[4];
510
+ const [g, h] = k(c);
511
+ let m;
512
+ e[5] !== s ? (m = (C) => {
513
+ h((p) => [...p, le(s ?? "", C)]);
514
+ }, e[5] = s, e[6] = m) : m = e[6];
515
+ const d = m;
516
+ let r;
517
+ e[7] === Symbol.for("react.memo_cache_sentinel") ? (r = () => {
518
+ h(qe);
519
+ }, e[7] = r) : r = e[7];
520
+ const l = r;
521
+ let f;
522
+ e[8] !== g ? (f = g.at(-1) ?? "", e[8] = g, e[9] = f) : f = e[9];
523
+ const i = f;
524
+ let S;
525
+ e[10] !== d ? (S = {
526
+ addHelmet: d,
527
+ removeHelmet: l
528
+ }, e[10] = d, e[11] = S) : S = e[11];
529
+ const y = S;
530
+ let x;
531
+ e[12] !== i ? (x = /* @__PURE__ */ v("title", { children: i }), e[12] = i, e[13] = x) : x = e[13];
532
+ let b;
533
+ return e[14] !== n || e[15] !== y || e[16] !== x ? (b = /* @__PURE__ */ E(be.Provider, { value: y, children: [
534
+ x,
535
+ n
536
+ ] }), e[14] = n, e[15] = y, e[16] = x, e[17] = b) : b = e[17], b;
537
+ };
538
+ function qe(t) {
539
+ return t.length > 1 ? t.slice(0, -1) : t;
540
+ }
541
+ const re = 50, Fe = () => {
542
+ const t = N.c(22), {
543
+ texts: e
544
+ } = R(X), {
545
+ confirm: u
546
+ } = e, {
547
+ onConfirm: n,
548
+ onCancel: s,
549
+ text: a,
550
+ show: o,
551
+ textSm: c
552
+ } = pe(), g = c === void 0 ? a.length > re : c, h = a.length > re;
553
+ let m;
554
+ t[0] !== s || t[1] !== n || t[2] !== o ? (m = (x) => {
555
+ if (o)
556
+ e: switch (x.key) {
557
+ case "Enter": {
558
+ x.preventDefault(), x.stopPropagation(), n();
559
+ break e;
560
+ }
561
+ case "Escape": {
562
+ x.preventDefault(), x.stopPropagation(), s();
563
+ break e;
564
+ }
328
565
  }
329
- }, [r, o, n]);
330
- return ne(i), /* @__PURE__ */ w(T, { show: n, size: l ? void 0 : "sm", centered: !0, onHide: o, children: [
331
- /* @__PURE__ */ u(T.Header, { className: "justify-content-center", children: a ? /* @__PURE__ */ u(oe, { variant: "body", children: e }) : /* @__PURE__ */ u(T.Title, { children: e }) }),
332
- /* @__PURE__ */ u(T.Body, { children: /* @__PURE__ */ w("div", { className: "w-100 d-flex gap-5", children: [
333
- /* @__PURE__ */ u(O, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: o, children: t.no }),
334
- /* @__PURE__ */ u(O, { type: "button", color: "primary", onClick: r, className: "w-100 ml", children: t.yes })
335
- ] }) })
336
- ] });
566
+ }, t[0] = s, t[1] = n, t[2] = o, t[3] = m) : m = t[3], Ce(m);
567
+ const r = h ? void 0 : "sm";
568
+ let l;
569
+ t[4] !== g || t[5] !== a ? (l = /* @__PURE__ */ v(M.Header, { className: "justify-content-center", children: g ? /* @__PURE__ */ v(we, { variant: "body", children: a }) : /* @__PURE__ */ v(M.Title, { children: a }) }), t[4] = g, t[5] = a, t[6] = l) : l = t[6];
570
+ let f;
571
+ t[7] !== u.no || t[8] !== s ? (f = /* @__PURE__ */ v(W, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: s, children: u.no }), t[7] = u.no, t[8] = s, t[9] = f) : f = t[9];
572
+ let i;
573
+ t[10] !== u.yes || t[11] !== n ? (i = /* @__PURE__ */ v(W, { type: "button", color: "primary", onClick: n, className: "w-100 ml", children: u.yes }), t[10] = u.yes, t[11] = n, t[12] = i) : i = t[12];
574
+ let S;
575
+ t[13] !== f || t[14] !== i ? (S = /* @__PURE__ */ v(M.Body, { children: /* @__PURE__ */ E("div", { className: "w-100 d-flex gap-5", children: [
576
+ f,
577
+ i
578
+ ] }) }), t[13] = f, t[14] = i, t[15] = S) : S = t[15];
579
+ let y;
580
+ return t[16] !== s || t[17] !== o || t[18] !== r || t[19] !== l || t[20] !== S ? (y = /* @__PURE__ */ E(M, { show: o, size: r, centered: !0, onHide: s, children: [
581
+ l,
582
+ S
583
+ ] }), t[16] = s, t[17] = o, t[18] = r, t[19] = l, t[20] = S, t[21] = y) : y = t[21], y;
337
584
  };
338
585
  export {
339
- q as AuthContext,
340
- Ne as AuthProvider,
341
- z as DelegationContext,
342
- Ie as DelegationProvider,
343
- _e as FormDisabledContext,
344
- qe as FormDisabledProvider,
345
- ee as HelmetContext,
346
- Ge as HelmetProvider,
347
- $ as LoadingContext,
348
- Oe as LoadingProvider,
349
- M as LuminusComponentsContext,
350
- Ee as LuminusComponentsProvider,
351
- X as UserContext,
352
- Me as UserProvider,
353
- Fe as useFormDisabledContext
586
+ ie as AuthContext,
587
+ st as AuthProvider,
588
+ ce as DelegationContext,
589
+ lt as DelegationProvider,
590
+ ct as FormDisabledContext,
591
+ dt as FormDisabledProvider,
592
+ be as HelmetContext,
593
+ rt as HelmetProvider,
594
+ ge as LoadingContext,
595
+ nt as LoadingProvider,
596
+ X as LuminusComponentsContext,
597
+ tt as LuminusComponentsProvider,
598
+ xe as UserContext,
599
+ ot as UserProvider,
600
+ ut as useFormDisabledContext
354
601
  };