react-luminus-components 1.2.28 → 1.2.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/.vite/manifest.json +53 -53
  2. package/dist/EventType-D1zXMD8A.js +63 -0
  3. package/dist/EventType-DO8vvA6X.cjs +1 -0
  4. package/dist/{SimpleTooltip-BRhpcft2.cjs → SimpleTooltip-CjMfPKvQ.cjs} +1 -1
  5. package/dist/{SimpleTooltip-QvdXlxmf.js → SimpleTooltip-cMiObSvf.js} +1 -1
  6. package/dist/{Typography-ViYwSz0j.js → Typography-B12JkmMC.js} +1 -1
  7. package/dist/{Typography-tgs5dV12.cjs → Typography-Plu1Wa0_.cjs} +1 -1
  8. package/dist/{UserAvatarToggle-C3Sj7vJ2.js → UserAvatarToggle-BWDRIIXE.js} +2450 -2036
  9. package/dist/UserAvatarToggle-DEb7Klk7.cjs +253 -0
  10. package/dist/components/common/AuthTemplate/AuthTemplate.d.ts +6 -0
  11. package/dist/components/common/index.d.ts +1 -0
  12. package/dist/contexts/auth/AuthContext.d.ts +10 -0
  13. package/dist/contexts/auth/AuthProvider.d.ts +16 -0
  14. package/dist/contexts/index.d.ts +2 -0
  15. package/dist/contexts/luminus-components/LuminusComponentsContext.d.ts +2 -1
  16. package/dist/contexts/luminus-components/LuminusComponentsProvider.d.ts +3 -2
  17. package/dist/contexts/user/UserContext.d.ts +1 -1
  18. package/dist/contexts.cjs.js +1 -1
  19. package/dist/contexts.es.js +651 -475
  20. package/dist/hooks/useAuth/hooks/useDevAuth.d.ts +7 -0
  21. package/dist/hooks/useAuth/hooks/useMsalAuth.d.ts +8 -0
  22. package/dist/hooks/useAuth/useAuth.d.ts +2 -1
  23. package/dist/hooks.cjs.js +1 -1
  24. package/dist/hooks.es.js +4 -4
  25. package/dist/layout.cjs.js +1 -1
  26. package/dist/layout.es.js +4 -4
  27. package/dist/main.cjs.js +1 -1
  28. package/dist/main.d.ts +1 -0
  29. package/dist/main.es.js +2170 -1788
  30. package/dist/{useConfirm-BSs-RcsS.js → useConfirm-CKDkB8lL.js} +1 -1
  31. package/dist/{useConfirm-D1nPczaK.cjs → useConfirm-QOAtP0re.cjs} +1 -1
  32. package/dist/{usePermissions-BoFHWnT4.js → usePermissions-Cg_BMKPX.js} +1 -1
  33. package/dist/{usePermissions-COxTbL_u.cjs → usePermissions-zYTcBjf7.cjs} +1 -1
  34. package/package.json +3 -1
  35. package/dist/DataKey-BehuC6mV.js +0 -33
  36. package/dist/DataKey-CD61sktc.cjs +0 -1
  37. package/dist/UserAvatarToggle-BKpAJdnv.cjs +0 -253
@@ -1,127 +1,127 @@
1
- import { j as r, c as w, e as ye, f as Ee, o as Fe, s as V, g as De, h as tt, i as nt, k as j, l as ke, m as Oe, n as We, p as ot, r as Se, q as st, t as U, v as rt, w as at, x as it, y as Be, F as Ue, z as lt, A as dt, L as be, P as He, C as ct, I as ut, B as ft, b as ht, U as mt } from "./UserAvatarToggle-C3Sj7vJ2.js";
2
- import * as y from "react";
3
- import { forwardRef as gt, useState as p, useRef as N, useImperativeHandle as pt, useEffect as re, useCallback as g, useContext as ae, useMemo as R } from "react";
4
- import { a as vt, u as yt } from "./useConfirm-BSs-RcsS.js";
5
- import { T as xt } from "./Typography-ViYwSz0j.js";
6
- import { d as wt, u as Ct, q as D, L as Et } from "./DataKey-BehuC6mV.js";
7
- import bt from "react-dom";
8
- const jt = (t) => /* @__PURE__ */ y.forwardRef((e, n) => /* @__PURE__ */ r.jsx("div", {
9
- ...e,
1
+ import { j as a, c as N, e as xe, f as Se, o as He, s as J, g as Ke, h as lt, i as ct, k as M, l as je, m as Le, n as $e, p as dt, r as _e, q as ut, t as K, v as ft, w as ht, x as mt, y as Be, F as Ge, z as gt, A as pt, L as ue, P as ze, C as Et, I as vt, B as yt, D as le, E, W as Ct, G as Tt, H as Pe, b as Rt, J as Ve, U as xt, K as Nt } from "./UserAvatarToggle-BWDRIIXE.js";
2
+ import * as R from "react";
3
+ import bt, { forwardRef as wt, useState as C, useRef as O, useImperativeHandle as St, useEffect as b, useCallback as y, useContext as H, useMemo as w, useReducer as kt } from "react";
4
+ import { a as Mt, u as Ot } from "./useConfirm-CKDkB8lL.js";
5
+ import { T as At } from "./Typography-B12JkmMC.js";
6
+ import { d as It, u as jt, q as D, L as Lt, E as v } from "./EventType-D1zXMD8A.js";
7
+ import _t from "react-dom";
8
+ const Bt = (e) => /* @__PURE__ */ R.forwardRef((t, n) => /* @__PURE__ */ a.jsx("div", {
9
+ ...t,
10
10
  ref: n,
11
- className: w(e.className, t)
12
- })), Nt = {
11
+ className: N(t.className, e)
12
+ })), Pt = {
13
13
  /** An accessible label indicating the relevant information about the Close Button. */
14
- "aria-label": ye.string,
14
+ "aria-label": xe.string,
15
15
  /** A callback fired after the Close Button is clicked. */
16
- onClick: ye.func,
16
+ onClick: xe.func,
17
17
  /**
18
18
  * Render different color variant for the button.
19
19
  *
20
20
  * Omitting this will render the default dark color.
21
21
  */
22
- variant: ye.oneOf(["white"])
23
- }, je = /* @__PURE__ */ y.forwardRef(({
24
- className: t,
25
- variant: e,
22
+ variant: xe.oneOf(["white"])
23
+ }, ke = /* @__PURE__ */ R.forwardRef(({
24
+ className: e,
25
+ variant: t,
26
26
  "aria-label": n = "Close",
27
27
  ...o
28
- }, s) => /* @__PURE__ */ r.jsx("button", {
28
+ }, s) => /* @__PURE__ */ a.jsx("button", {
29
29
  ref: s,
30
30
  type: "button",
31
- className: w("btn-close", e && `btn-close-${e}`, t),
31
+ className: N("btn-close", t && `btn-close-${t}`, e),
32
32
  "aria-label": n,
33
33
  ...o
34
34
  }));
35
- je.displayName = "CloseButton";
36
- je.propTypes = Nt;
37
- var se;
38
- function Ae(t) {
39
- if ((!se && se !== 0 || t) && Ee) {
40
- var e = document.createElement("div");
41
- e.style.position = "absolute", e.style.top = "-9999px", e.style.width = "50px", e.style.height = "50px", e.style.overflow = "scroll", document.body.appendChild(e), se = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
35
+ ke.displayName = "CloseButton";
36
+ ke.propTypes = Pt;
37
+ var ce;
38
+ function Ue(e) {
39
+ if ((!ce && ce !== 0 || e) && Se) {
40
+ var t = document.createElement("div");
41
+ t.style.position = "absolute", t.style.top = "-9999px", t.style.width = "50px", t.style.height = "50px", t.style.overflow = "scroll", document.body.appendChild(t), ce = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
42
42
  }
43
- return se;
43
+ return ce;
44
44
  }
45
- function xe(t) {
46
- t === void 0 && (t = Fe());
45
+ function Ne(e) {
46
+ e === void 0 && (e = He());
47
47
  try {
48
- var e = t.activeElement;
49
- return !e || !e.nodeName ? null : e;
48
+ var t = e.activeElement;
49
+ return !t || !t.nodeName ? null : t;
50
50
  } catch {
51
- return t.body;
51
+ return e.body;
52
52
  }
53
53
  }
54
- function Tt(t = document) {
55
- const e = t.defaultView;
56
- return Math.abs(e.innerWidth - t.documentElement.clientWidth);
54
+ function Ut(e = document) {
55
+ const t = e.defaultView;
56
+ return Math.abs(t.innerWidth - e.documentElement.clientWidth);
57
57
  }
58
- const Le = wt("modal-open");
59
- class Ne {
58
+ const Fe = It("modal-open");
59
+ class Me {
60
60
  constructor({
61
- ownerDocument: e,
61
+ ownerDocument: t,
62
62
  handleContainerOverflow: n = !0,
63
63
  isRTL: o = !1
64
64
  } = {}) {
65
- this.handleContainerOverflow = n, this.isRTL = o, this.modals = [], this.ownerDocument = e;
65
+ this.handleContainerOverflow = n, this.isRTL = o, this.modals = [], this.ownerDocument = t;
66
66
  }
67
67
  getScrollbarWidth() {
68
- return Tt(this.ownerDocument);
68
+ return Ut(this.ownerDocument);
69
69
  }
70
70
  getElement() {
71
71
  return (this.ownerDocument || document).body;
72
72
  }
73
- setModalAttributes(e) {
73
+ setModalAttributes(t) {
74
74
  }
75
- removeModalAttributes(e) {
75
+ removeModalAttributes(t) {
76
76
  }
77
- setContainerStyle(e) {
77
+ setContainerStyle(t) {
78
78
  const n = {
79
79
  overflow: "hidden"
80
80
  }, o = this.isRTL ? "paddingLeft" : "paddingRight", s = this.getElement();
81
- e.style = {
81
+ t.style = {
82
82
  overflow: s.style.overflow,
83
83
  [o]: s.style[o]
84
- }, e.scrollBarWidth && (n[o] = `${parseInt(V(s, o) || "0", 10) + e.scrollBarWidth}px`), s.setAttribute(Le, ""), V(s, n);
84
+ }, t.scrollBarWidth && (n[o] = `${parseInt(J(s, o) || "0", 10) + t.scrollBarWidth}px`), s.setAttribute(Fe, ""), J(s, n);
85
85
  }
86
86
  reset() {
87
- [...this.modals].forEach((e) => this.remove(e));
87
+ [...this.modals].forEach((t) => this.remove(t));
88
88
  }
89
- removeContainerStyle(e) {
89
+ removeContainerStyle(t) {
90
90
  const n = this.getElement();
91
- n.removeAttribute(Le), Object.assign(n.style, e.style);
91
+ n.removeAttribute(Fe), Object.assign(n.style, t.style);
92
92
  }
93
- add(e) {
94
- let n = this.modals.indexOf(e);
95
- return n !== -1 || (n = this.modals.length, this.modals.push(e), this.setModalAttributes(e), n !== 0) || (this.state = {
93
+ add(t) {
94
+ let n = this.modals.indexOf(t);
95
+ return n !== -1 || (n = this.modals.length, this.modals.push(t), this.setModalAttributes(t), n !== 0) || (this.state = {
96
96
  scrollBarWidth: this.getScrollbarWidth(),
97
97
  style: {}
98
98
  }, this.handleContainerOverflow && this.setContainerStyle(this.state)), n;
99
99
  }
100
- remove(e) {
101
- const n = this.modals.indexOf(e);
102
- n !== -1 && (this.modals.splice(n, 1), !this.modals.length && this.handleContainerOverflow && this.removeContainerStyle(this.state), this.removeModalAttributes(e));
100
+ remove(t) {
101
+ const n = this.modals.indexOf(t);
102
+ n !== -1 && (this.modals.splice(n, 1), !this.modals.length && this.handleContainerOverflow && this.removeContainerStyle(this.state), this.removeModalAttributes(t));
103
103
  }
104
- isTopModal(e) {
105
- return !!this.modals.length && this.modals[this.modals.length - 1] === e;
104
+ isTopModal(t) {
105
+ return !!this.modals.length && this.modals[this.modals.length - 1] === t;
106
106
  }
107
107
  }
108
- const Mt = ["show", "role", "className", "style", "children", "backdrop", "keyboard", "onBackdropClick", "onEscapeKeyDown", "transition", "runTransition", "backdropTransition", "runBackdropTransition", "autoFocus", "enforceFocus", "restoreFocus", "restoreFocusOptions", "renderDialog", "renderBackdrop", "manager", "container", "onShow", "onHide", "onExit", "onExited", "onExiting", "onEnter", "onEntering", "onEntered"];
109
- function Rt(t, e) {
110
- if (t == null)
108
+ const Ft = ["show", "role", "className", "style", "children", "backdrop", "keyboard", "onBackdropClick", "onEscapeKeyDown", "transition", "runTransition", "backdropTransition", "runBackdropTransition", "autoFocus", "enforceFocus", "restoreFocus", "restoreFocusOptions", "renderDialog", "renderBackdrop", "manager", "container", "onShow", "onHide", "onExit", "onExited", "onExiting", "onEnter", "onEntering", "onEntered"];
109
+ function Dt(e, t) {
110
+ if (e == null)
111
111
  return {};
112
- var n = {}, o = Object.keys(t), s, a;
113
- for (a = 0; a < o.length; a++)
114
- s = o[a], !(e.indexOf(s) >= 0) && (n[s] = t[s]);
112
+ var n = {}, o = Object.keys(e), s, r;
113
+ for (r = 0; r < o.length; r++)
114
+ s = o[r], !(t.indexOf(s) >= 0) && (n[s] = e[s]);
115
115
  return n;
116
116
  }
117
- let we;
118
- function kt(t) {
119
- return we || (we = new Ne({
120
- ownerDocument: t == null ? void 0 : t.document
121
- })), we;
117
+ let be;
118
+ function Wt(e) {
119
+ return be || (be = new Me({
120
+ ownerDocument: e == null ? void 0 : e.document
121
+ })), be;
122
122
  }
123
- function Ot(t) {
124
- const e = De(), n = t || kt(e), o = N({
123
+ function Ht(e) {
124
+ const t = Ke(), n = e || Wt(t), o = O({
125
125
  dialog: null,
126
126
  backdrop: null
127
127
  });
@@ -129,584 +129,760 @@ function Ot(t) {
129
129
  add: () => n.add(o.current),
130
130
  remove: () => n.remove(o.current),
131
131
  isTopModal: () => n.isTopModal(o.current),
132
- setDialogRef: g((s) => {
132
+ setDialogRef: y((s) => {
133
133
  o.current.dialog = s;
134
134
  }, []),
135
- setBackdropRef: g((s) => {
135
+ setBackdropRef: y((s) => {
136
136
  o.current.backdrop = s;
137
137
  }, [])
138
138
  });
139
139
  }
140
- const $e = /* @__PURE__ */ gt((t, e) => {
140
+ const qe = /* @__PURE__ */ wt((e, t) => {
141
141
  let {
142
142
  show: n = !1,
143
143
  role: o = "dialog",
144
144
  className: s,
145
- style: a,
146
- children: u,
147
- backdrop: l = !0,
148
- keyboard: f = !0,
145
+ style: r,
146
+ children: l,
147
+ backdrop: i = !0,
148
+ keyboard: d = !0,
149
149
  onBackdropClick: h,
150
- onEscapeKeyDown: d,
151
- transition: v,
152
- runTransition: C,
153
- backdropTransition: k,
154
- runBackdropTransition: ie,
155
- autoFocus: G = !0,
156
- enforceFocus: le = !0,
157
- restoreFocus: O = !0,
158
- restoreFocusOptions: de,
159
- renderDialog: q,
160
- renderBackdrop: ce = (c) => /* @__PURE__ */ r.jsx("div", Object.assign({}, c)),
161
- manager: ue,
162
- container: fe,
163
- onShow: X,
164
- onHide: H = () => {
150
+ onEscapeKeyDown: g,
151
+ transition: f,
152
+ runTransition: m,
153
+ backdropTransition: T,
154
+ runBackdropTransition: fe,
155
+ autoFocus: X = !0,
156
+ enforceFocus: he = !0,
157
+ restoreFocus: j = !0,
158
+ restoreFocusOptions: me,
159
+ renderDialog: Y,
160
+ renderBackdrop: ge = (u) => /* @__PURE__ */ a.jsx("div", Object.assign({}, u)),
161
+ manager: pe,
162
+ container: Ee,
163
+ onShow: Z,
164
+ onHide: $ = () => {
165
165
  },
166
- onExit: he,
167
- onExited: $,
168
- onExiting: Y,
169
- onEnter: J,
170
- onEntering: Q,
171
- onEntered: Z
172
- } = t, me = Rt(t, Mt);
173
- const E = De(), S = tt(fe), m = Ot(ue), ge = nt(), ee = Ct(n), [T, B] = p(!n), x = N(null);
174
- pt(e, () => m, [m]), Ee && !ee && n && (x.current = xe(E == null ? void 0 : E.document)), n && T && B(!1);
175
- const b = j(() => {
176
- if (m.add(), A.current = ke(document, "keydown", ve), _.current = ke(
166
+ onExit: ve,
167
+ onExited: G,
168
+ onExiting: ee,
169
+ onEnter: te,
170
+ onEntering: ne,
171
+ onEntered: oe
172
+ } = e, ye = Dt(e, Ft);
173
+ const S = Ke(), L = lt(Ee), p = Ht(pe), Ce = ct(), se = jt(n), [A, _] = C(!n), x = O(null);
174
+ St(t, () => p, [p]), Se && !se && n && (x.current = Ne(S == null ? void 0 : S.document)), n && A && _(!1);
175
+ const k = M(() => {
176
+ if (p.add(), B.current = je(document, "keydown", Re), V.current = je(
177
177
  document,
178
178
  "focus",
179
179
  // the timeout is necessary b/c this will run before the new modal is mounted
180
180
  // and so steals focus from it
181
- () => setTimeout(pe),
181
+ () => setTimeout(Te),
182
182
  !0
183
- ), X && X(), G) {
184
- var c, oe;
185
- const z = xe((c = (oe = m.dialog) == null ? void 0 : oe.ownerDocument) != null ? c : E == null ? void 0 : E.document);
186
- m.dialog && z && !Oe(m.dialog, z) && (x.current = z, m.dialog.focus());
183
+ ), Z && Z(), X) {
184
+ var u, ie;
185
+ const Q = Ne((u = (ie = p.dialog) == null ? void 0 : ie.ownerDocument) != null ? u : S == null ? void 0 : S.document);
186
+ p.dialog && Q && !Le(p.dialog, Q) && (x.current = Q, p.dialog.focus());
187
187
  }
188
- }), P = j(() => {
189
- if (m.remove(), A.current == null || A.current(), _.current == null || _.current(), O) {
190
- var c;
191
- (c = x.current) == null || c.focus == null || c.focus(de), x.current = null;
188
+ }), z = M(() => {
189
+ if (p.remove(), B.current == null || B.current(), V.current == null || V.current(), j) {
190
+ var u;
191
+ (u = x.current) == null || u.focus == null || u.focus(me), x.current = null;
192
192
  }
193
193
  });
194
- re(() => {
195
- !n || !S || b();
194
+ b(() => {
195
+ !n || !L || k();
196
196
  }, [
197
197
  n,
198
- S,
198
+ L,
199
199
  /* should never change: */
200
- b
201
- ]), re(() => {
202
- T && P();
203
- }, [T, P]), We(() => {
204
- P();
200
+ k
201
+ ]), b(() => {
202
+ A && z();
203
+ }, [A, z]), $e(() => {
204
+ z();
205
205
  });
206
- const pe = j(() => {
207
- if (!le || !ge() || !m.isTopModal())
206
+ const Te = M(() => {
207
+ if (!he || !Ce() || !p.isTopModal())
208
208
  return;
209
- const c = xe(E == null ? void 0 : E.document);
210
- m.dialog && c && !Oe(m.dialog, c) && m.dialog.focus();
211
- }), te = j((c) => {
212
- c.target === c.currentTarget && (h == null || h(c), l === !0 && H());
213
- }), ve = j((c) => {
214
- f && ot(c) && m.isTopModal() && (d == null || d(c), c.defaultPrevented || H());
215
- }), _ = N(), A = N(), ne = (...c) => {
216
- B(!0), $ == null || $(...c);
209
+ const u = Ne(S == null ? void 0 : S.document);
210
+ p.dialog && u && !Le(p.dialog, u) && p.dialog.focus();
211
+ }), re = M((u) => {
212
+ u.target === u.currentTarget && (h == null || h(u), i === !0 && $());
213
+ }), Re = M((u) => {
214
+ d && dt(u) && p.isTopModal() && (g == null || g(u), u.defaultPrevented || $());
215
+ }), V = O(), B = O(), ae = (...u) => {
216
+ _(!0), G == null || G(...u);
217
217
  };
218
- if (!S)
218
+ if (!L)
219
219
  return null;
220
- const L = Object.assign({
220
+ const P = Object.assign({
221
221
  role: o,
222
- ref: m.setDialogRef,
222
+ ref: p.setDialogRef,
223
223
  // apparently only works on the dialog role element
224
224
  "aria-modal": o === "dialog" ? !0 : void 0
225
- }, me, {
226
- style: a,
225
+ }, ye, {
226
+ style: r,
227
227
  className: s,
228
228
  tabIndex: -1
229
229
  });
230
- let K = q ? q(L) : /* @__PURE__ */ r.jsx("div", Object.assign({}, L, {
231
- children: /* @__PURE__ */ y.cloneElement(u, {
230
+ let q = Y ? Y(P) : /* @__PURE__ */ a.jsx("div", Object.assign({}, P, {
231
+ children: /* @__PURE__ */ R.cloneElement(l, {
232
232
  role: "document"
233
233
  })
234
234
  }));
235
- K = Se(v, C, {
235
+ q = _e(f, m, {
236
236
  unmountOnExit: !0,
237
237
  mountOnEnter: !0,
238
238
  appear: !0,
239
239
  in: !!n,
240
- onExit: he,
241
- onExiting: Y,
242
- onExited: ne,
243
- onEnter: J,
244
- onEntering: Q,
245
- onEntered: Z,
246
- children: K
240
+ onExit: ve,
241
+ onExiting: ee,
242
+ onExited: ae,
243
+ onEnter: te,
244
+ onEntering: ne,
245
+ onEntered: oe,
246
+ children: q
247
247
  });
248
- let I = null;
249
- return l && (I = ce({
250
- ref: m.setBackdropRef,
251
- onClick: te
252
- }), I = Se(k, ie, {
248
+ let U = null;
249
+ return i && (U = ge({
250
+ ref: p.setBackdropRef,
251
+ onClick: re
252
+ }), U = _e(T, fe, {
253
253
  in: !!n,
254
254
  appear: !0,
255
255
  mountOnEnter: !0,
256
256
  unmountOnExit: !0,
257
- children: I
258
- })), /* @__PURE__ */ r.jsx(r.Fragment, {
259
- children: /* @__PURE__ */ bt.createPortal(/* @__PURE__ */ r.jsxs(r.Fragment, {
260
- children: [I, K]
261
- }), S)
257
+ children: U
258
+ })), /* @__PURE__ */ a.jsx(a.Fragment, {
259
+ children: /* @__PURE__ */ _t.createPortal(/* @__PURE__ */ a.jsxs(a.Fragment, {
260
+ children: [U, q]
261
+ }), L)
262
262
  });
263
263
  });
264
- $e.displayName = "Modal";
265
- const St = Object.assign($e, {
266
- Manager: Ne
264
+ qe.displayName = "Modal";
265
+ const Kt = Object.assign(qe, {
266
+ Manager: Me
267
267
  });
268
- function Bt(t, e) {
269
- t.classList ? t.classList.add(e) : st(t, e) || (typeof t.className == "string" ? t.className = t.className + " " + e : t.setAttribute("class", (t.className && t.className.baseVal || "") + " " + e));
268
+ function $t(e, t) {
269
+ e.classList ? e.classList.add(t) : ut(e, t) || (typeof e.className == "string" ? e.className = e.className + " " + t : e.setAttribute("class", (e.className && e.className.baseVal || "") + " " + t));
270
270
  }
271
- function Ie(t, e) {
272
- return t.replace(new RegExp("(^|\\s)" + e + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
271
+ function De(e, t) {
272
+ return e.replace(new RegExp("(^|\\s)" + t + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
273
273
  }
274
- function At(t, e) {
275
- t.classList ? t.classList.remove(e) : typeof t.className == "string" ? t.className = Ie(t.className, e) : t.setAttribute("class", Ie(t.className && t.className.baseVal || "", e));
274
+ function Gt(e, t) {
275
+ e.classList ? e.classList.remove(t) : typeof e.className == "string" ? e.className = De(e.className, t) : e.setAttribute("class", De(e.className && e.className.baseVal || "", t));
276
276
  }
277
277
  const W = {
278
278
  FIXED_CONTENT: ".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",
279
279
  STICKY_CONTENT: ".sticky-top",
280
280
  NAVBAR_TOGGLER: ".navbar-toggler"
281
281
  };
282
- class Lt extends Ne {
283
- adjustAndStore(e, n, o) {
284
- const s = n.style[e];
285
- n.dataset[e] = s, V(n, {
286
- [e]: `${parseFloat(V(n, e)) + o}px`
282
+ class zt extends Me {
283
+ adjustAndStore(t, n, o) {
284
+ const s = n.style[t];
285
+ n.dataset[t] = s, J(n, {
286
+ [t]: `${parseFloat(J(n, t)) + o}px`
287
287
  });
288
288
  }
289
- restore(e, n) {
290
- const o = n.dataset[e];
291
- o !== void 0 && (delete n.dataset[e], V(n, {
292
- [e]: o
289
+ restore(t, n) {
290
+ const o = n.dataset[t];
291
+ o !== void 0 && (delete n.dataset[t], J(n, {
292
+ [t]: o
293
293
  }));
294
294
  }
295
- setContainerStyle(e) {
296
- super.setContainerStyle(e);
295
+ setContainerStyle(t) {
296
+ super.setContainerStyle(t);
297
297
  const n = this.getElement();
298
- if (Bt(n, "modal-open"), !e.scrollBarWidth)
298
+ if ($t(n, "modal-open"), !t.scrollBarWidth)
299
299
  return;
300
300
  const o = this.isRTL ? "paddingLeft" : "paddingRight", s = this.isRTL ? "marginLeft" : "marginRight";
301
- D(n, W.FIXED_CONTENT).forEach((a) => this.adjustAndStore(o, a, e.scrollBarWidth)), D(n, W.STICKY_CONTENT).forEach((a) => this.adjustAndStore(s, a, -e.scrollBarWidth)), D(n, W.NAVBAR_TOGGLER).forEach((a) => this.adjustAndStore(s, a, e.scrollBarWidth));
301
+ D(n, W.FIXED_CONTENT).forEach((r) => this.adjustAndStore(o, r, t.scrollBarWidth)), D(n, W.STICKY_CONTENT).forEach((r) => this.adjustAndStore(s, r, -t.scrollBarWidth)), D(n, W.NAVBAR_TOGGLER).forEach((r) => this.adjustAndStore(s, r, t.scrollBarWidth));
302
302
  }
303
- removeContainerStyle(e) {
304
- super.removeContainerStyle(e);
303
+ removeContainerStyle(t) {
304
+ super.removeContainerStyle(t);
305
305
  const n = this.getElement();
306
- At(n, "modal-open");
306
+ Gt(n, "modal-open");
307
307
  const o = this.isRTL ? "paddingLeft" : "paddingRight", s = this.isRTL ? "marginLeft" : "marginRight";
308
- D(n, W.FIXED_CONTENT).forEach((a) => this.restore(o, a)), D(n, W.STICKY_CONTENT).forEach((a) => this.restore(s, a)), D(n, W.NAVBAR_TOGGLER).forEach((a) => this.restore(s, a));
308
+ D(n, W.FIXED_CONTENT).forEach((r) => this.restore(o, r)), D(n, W.STICKY_CONTENT).forEach((r) => this.restore(s, r)), D(n, W.NAVBAR_TOGGLER).forEach((r) => this.restore(s, r));
309
309
  }
310
310
  }
311
- let Ce;
312
- function It(t) {
313
- return Ce || (Ce = new Lt(t)), Ce;
311
+ let we;
312
+ function Vt(e) {
313
+ return we || (we = new zt(e)), we;
314
314
  }
315
- const Pe = /* @__PURE__ */ y.forwardRef(({
316
- className: t,
317
- bsPrefix: e,
315
+ const Qe = /* @__PURE__ */ R.forwardRef(({
316
+ className: e,
317
+ bsPrefix: t,
318
318
  as: n = "div",
319
319
  ...o
320
- }, s) => (e = U(e, "modal-body"), /* @__PURE__ */ r.jsx(n, {
320
+ }, s) => (t = K(t, "modal-body"), /* @__PURE__ */ a.jsx(n, {
321
321
  ref: s,
322
- className: w(t, e),
322
+ className: N(e, t),
323
323
  ...o
324
324
  })));
325
- Pe.displayName = "ModalBody";
326
- const _e = /* @__PURE__ */ y.createContext({
325
+ Qe.displayName = "ModalBody";
326
+ const Je = /* @__PURE__ */ R.createContext({
327
327
  // eslint-disable-next-line @typescript-eslint/no-empty-function
328
328
  onHide() {
329
329
  }
330
- }), Te = /* @__PURE__ */ y.forwardRef(({
331
- bsPrefix: t,
332
- className: e,
330
+ }), Oe = /* @__PURE__ */ R.forwardRef(({
331
+ bsPrefix: e,
332
+ className: t,
333
333
  contentClassName: n,
334
334
  centered: o,
335
335
  size: s,
336
- fullscreen: a,
337
- children: u,
338
- scrollable: l,
339
- ...f
336
+ fullscreen: r,
337
+ children: l,
338
+ scrollable: i,
339
+ ...d
340
340
  }, h) => {
341
- t = U(t, "modal");
342
- const d = `${t}-dialog`, v = typeof a == "string" ? `${t}-fullscreen-${a}` : `${t}-fullscreen`;
343
- return /* @__PURE__ */ r.jsx("div", {
344
- ...f,
341
+ e = K(e, "modal");
342
+ const g = `${e}-dialog`, f = typeof r == "string" ? `${e}-fullscreen-${r}` : `${e}-fullscreen`;
343
+ return /* @__PURE__ */ a.jsx("div", {
344
+ ...d,
345
345
  ref: h,
346
- className: w(d, e, s && `${t}-${s}`, o && `${d}-centered`, l && `${d}-scrollable`, a && v),
347
- children: /* @__PURE__ */ r.jsx("div", {
348
- className: w(`${t}-content`, n),
349
- children: u
346
+ className: N(g, t, s && `${e}-${s}`, o && `${g}-centered`, i && `${g}-scrollable`, r && f),
347
+ children: /* @__PURE__ */ a.jsx("div", {
348
+ className: N(`${e}-content`, n),
349
+ children: l
350
350
  })
351
351
  });
352
352
  });
353
- Te.displayName = "ModalDialog";
354
- const Ke = /* @__PURE__ */ y.forwardRef(({
355
- className: t,
356
- bsPrefix: e,
353
+ Oe.displayName = "ModalDialog";
354
+ const Xe = /* @__PURE__ */ R.forwardRef(({
355
+ className: e,
356
+ bsPrefix: t,
357
357
  as: n = "div",
358
358
  ...o
359
- }, s) => (e = U(e, "modal-footer"), /* @__PURE__ */ r.jsx(n, {
359
+ }, s) => (t = K(t, "modal-footer"), /* @__PURE__ */ a.jsx(n, {
360
360
  ref: s,
361
- className: w(t, e),
361
+ className: N(e, t),
362
362
  ...o
363
363
  })));
364
- Ke.displayName = "ModalFooter";
365
- const Ft = /* @__PURE__ */ y.forwardRef(({
366
- closeLabel: t = "Close",
367
- closeVariant: e,
364
+ Xe.displayName = "ModalFooter";
365
+ const qt = /* @__PURE__ */ R.forwardRef(({
366
+ closeLabel: e = "Close",
367
+ closeVariant: t,
368
368
  closeButton: n = !1,
369
369
  onHide: o,
370
370
  children: s,
371
- ...a
372
- }, u) => {
373
- const l = ae(_e), f = j(() => {
374
- l == null || l.onHide(), o == null || o();
371
+ ...r
372
+ }, l) => {
373
+ const i = H(Je), d = M(() => {
374
+ i == null || i.onHide(), o == null || o();
375
375
  });
376
- return /* @__PURE__ */ r.jsxs("div", {
377
- ref: u,
378
- ...a,
379
- children: [s, n && /* @__PURE__ */ r.jsx(je, {
380
- "aria-label": t,
381
- variant: e,
382
- onClick: f
376
+ return /* @__PURE__ */ a.jsxs("div", {
377
+ ref: l,
378
+ ...r,
379
+ children: [s, n && /* @__PURE__ */ a.jsx(ke, {
380
+ "aria-label": e,
381
+ variant: t,
382
+ onClick: d
383
383
  })]
384
384
  });
385
- }), ze = /* @__PURE__ */ y.forwardRef(({
386
- bsPrefix: t,
387
- className: e,
385
+ }), Ye = /* @__PURE__ */ R.forwardRef(({
386
+ bsPrefix: e,
387
+ className: t,
388
388
  closeLabel: n = "Close",
389
389
  closeButton: o = !1,
390
390
  ...s
391
- }, a) => (t = U(t, "modal-header"), /* @__PURE__ */ r.jsx(Ft, {
392
- ref: a,
391
+ }, r) => (e = K(e, "modal-header"), /* @__PURE__ */ a.jsx(qt, {
392
+ ref: r,
393
393
  ...s,
394
- className: w(e, t),
394
+ className: N(t, e),
395
395
  closeLabel: n,
396
396
  closeButton: o
397
397
  })));
398
- ze.displayName = "ModalHeader";
399
- const Dt = jt("h4"), Ve = /* @__PURE__ */ y.forwardRef(({
400
- className: t,
401
- bsPrefix: e,
402
- as: n = Dt,
398
+ Ye.displayName = "ModalHeader";
399
+ const Qt = Bt("h4"), Ze = /* @__PURE__ */ R.forwardRef(({
400
+ className: e,
401
+ bsPrefix: t,
402
+ as: n = Qt,
403
403
  ...o
404
- }, s) => (e = U(e, "modal-title"), /* @__PURE__ */ r.jsx(n, {
404
+ }, s) => (t = K(t, "modal-title"), /* @__PURE__ */ a.jsx(n, {
405
405
  ref: s,
406
- className: w(t, e),
406
+ className: N(e, t),
407
407
  ...o
408
408
  })));
409
- Ve.displayName = "ModalTitle";
410
- function Wt(t) {
411
- return /* @__PURE__ */ r.jsx(Ue, {
412
- ...t,
409
+ Ze.displayName = "ModalTitle";
410
+ function Jt(e) {
411
+ return /* @__PURE__ */ a.jsx(Ge, {
412
+ ...e,
413
413
  timeout: null
414
414
  });
415
415
  }
416
- function Ut(t) {
417
- return /* @__PURE__ */ r.jsx(Ue, {
418
- ...t,
416
+ function Xt(e) {
417
+ return /* @__PURE__ */ a.jsx(Ge, {
418
+ ...e,
419
419
  timeout: null
420
420
  });
421
421
  }
422
- const Ge = /* @__PURE__ */ y.forwardRef(({
423
- bsPrefix: t,
424
- className: e,
422
+ const et = /* @__PURE__ */ R.forwardRef(({
423
+ bsPrefix: e,
424
+ className: t,
425
425
  style: n,
426
426
  dialogClassName: o,
427
427
  contentClassName: s,
428
- children: a,
429
- dialogAs: u = Te,
430
- "data-bs-theme": l,
431
- "aria-labelledby": f,
428
+ children: r,
429
+ dialogAs: l = Oe,
430
+ "data-bs-theme": i,
431
+ "aria-labelledby": d,
432
432
  "aria-describedby": h,
433
- "aria-label": d,
433
+ "aria-label": g,
434
434
  /* BaseModal props */
435
- show: v = !1,
436
- animation: C = !0,
437
- backdrop: k = !0,
438
- keyboard: ie = !0,
439
- onEscapeKeyDown: G,
440
- onShow: le,
441
- onHide: O,
442
- container: de,
443
- autoFocus: q = !0,
444
- enforceFocus: ce = !0,
445
- restoreFocus: ue = !0,
446
- restoreFocusOptions: fe,
447
- onEntered: X,
448
- onExit: H,
449
- onExiting: he,
450
- onEnter: $,
451
- onEntering: Y,
452
- onExited: J,
453
- backdropClassName: Q,
454
- manager: Z,
455
- ...me
456
- }, E) => {
457
- const [S, m] = p({}), [ge, ee] = p(!1), T = N(!1), B = N(!1), x = N(null), [b, P] = rt(), pe = at(E, P), te = j(O), ve = it();
458
- t = U(t, "modal");
459
- const _ = R(() => ({
460
- onHide: te
461
- }), [te]);
462
- function A() {
463
- return Z || It({
464
- isRTL: ve
435
+ show: f = !1,
436
+ animation: m = !0,
437
+ backdrop: T = !0,
438
+ keyboard: fe = !0,
439
+ onEscapeKeyDown: X,
440
+ onShow: he,
441
+ onHide: j,
442
+ container: me,
443
+ autoFocus: Y = !0,
444
+ enforceFocus: ge = !0,
445
+ restoreFocus: pe = !0,
446
+ restoreFocusOptions: Ee,
447
+ onEntered: Z,
448
+ onExit: $,
449
+ onExiting: ve,
450
+ onEnter: G,
451
+ onEntering: ee,
452
+ onExited: te,
453
+ backdropClassName: ne,
454
+ manager: oe,
455
+ ...ye
456
+ }, S) => {
457
+ const [L, p] = C({}), [Ce, se] = C(!1), A = O(!1), _ = O(!1), x = O(null), [k, z] = ft(), Te = ht(S, z), re = M(j), Re = mt();
458
+ e = K(e, "modal");
459
+ const V = w(() => ({
460
+ onHide: re
461
+ }), [re]);
462
+ function B() {
463
+ return oe || Vt({
464
+ isRTL: Re
465
465
  });
466
466
  }
467
- function ne(i) {
468
- if (!Ee)
467
+ function ae(c) {
468
+ if (!Se)
469
469
  return;
470
- const F = A().getScrollbarWidth() > 0, Re = i.scrollHeight > Fe(i).documentElement.clientHeight;
471
- m({
472
- paddingRight: F && !Re ? Ae() : void 0,
473
- paddingLeft: !F && Re ? Ae() : void 0
470
+ const F = B().getScrollbarWidth() > 0, Ie = c.scrollHeight > He(c).documentElement.clientHeight;
471
+ p({
472
+ paddingRight: F && !Ie ? Ue() : void 0,
473
+ paddingLeft: !F && Ie ? Ue() : void 0
474
474
  });
475
475
  }
476
- const L = j(() => {
477
- b && ne(b.dialog);
476
+ const P = M(() => {
477
+ k && ae(k.dialog);
478
478
  });
479
- We(() => {
480
- Be(window, "resize", L), x.current == null || x.current();
479
+ $e(() => {
480
+ Be(window, "resize", P), x.current == null || x.current();
481
481
  });
482
- const K = () => {
483
- T.current = !0;
484
- }, I = (i) => {
485
- T.current && b && i.target === b.dialog && (B.current = !0), T.current = !1;
486
- }, c = () => {
487
- ee(!0), x.current = dt(b.dialog, () => {
488
- ee(!1);
482
+ const q = () => {
483
+ A.current = !0;
484
+ }, U = (c) => {
485
+ A.current && k && c.target === k.dialog && (_.current = !0), A.current = !1;
486
+ }, u = () => {
487
+ se(!0), x.current = pt(k.dialog, () => {
488
+ se(!1);
489
489
  });
490
- }, oe = (i) => {
491
- i.target === i.currentTarget && c();
492
- }, z = (i) => {
493
- if (k === "static") {
494
- oe(i);
490
+ }, ie = (c) => {
491
+ c.target === c.currentTarget && u();
492
+ }, Q = (c) => {
493
+ if (T === "static") {
494
+ ie(c);
495
495
  return;
496
496
  }
497
- if (B.current || i.target !== i.currentTarget) {
498
- B.current = !1;
497
+ if (_.current || c.target !== c.currentTarget) {
498
+ _.current = !1;
499
499
  return;
500
500
  }
501
- O == null || O();
502
- }, qe = (i) => {
503
- ie ? G == null || G(i) : (i.preventDefault(), k === "static" && c());
504
- }, Xe = (i, F) => {
505
- i && ne(i), $ == null || $(i, F);
506
- }, Ye = (i) => {
507
- x.current == null || x.current(), H == null || H(i);
508
- }, Je = (i, F) => {
509
- Y == null || Y(i, F), lt(window, "resize", L);
510
- }, Qe = (i) => {
511
- i && (i.style.display = ""), J == null || J(i), Be(window, "resize", L);
512
- }, Ze = g((i) => /* @__PURE__ */ r.jsx("div", {
513
- ...i,
514
- className: w(`${t}-backdrop`, Q, !C && "show")
515
- }), [C, Q, t]), Me = {
501
+ j == null || j();
502
+ }, tt = (c) => {
503
+ fe ? X == null || X(c) : (c.preventDefault(), T === "static" && u());
504
+ }, nt = (c, F) => {
505
+ c && ae(c), G == null || G(c, F);
506
+ }, ot = (c) => {
507
+ x.current == null || x.current(), $ == null || $(c);
508
+ }, st = (c, F) => {
509
+ ee == null || ee(c, F), gt(window, "resize", P);
510
+ }, rt = (c) => {
511
+ c && (c.style.display = ""), te == null || te(c), Be(window, "resize", P);
512
+ }, at = y((c) => /* @__PURE__ */ a.jsx("div", {
513
+ ...c,
514
+ className: N(`${e}-backdrop`, ne, !m && "show")
515
+ }), [m, ne, e]), Ae = {
516
516
  ...n,
517
- ...S
517
+ ...L
518
518
  };
519
- Me.display = "block";
520
- const et = (i) => /* @__PURE__ */ r.jsx("div", {
519
+ Ae.display = "block";
520
+ const it = (c) => /* @__PURE__ */ a.jsx("div", {
521
521
  role: "dialog",
522
- ...i,
523
- style: Me,
524
- className: w(e, t, ge && `${t}-static`, !C && "show"),
525
- onClick: k ? z : void 0,
526
- onMouseUp: I,
527
- "data-bs-theme": l,
528
- "aria-label": d,
529
- "aria-labelledby": f,
522
+ ...c,
523
+ style: Ae,
524
+ className: N(t, e, Ce && `${e}-static`, !m && "show"),
525
+ onClick: T ? Q : void 0,
526
+ onMouseUp: U,
527
+ "data-bs-theme": i,
528
+ "aria-label": g,
529
+ "aria-labelledby": d,
530
530
  "aria-describedby": h,
531
- children: /* @__PURE__ */ r.jsx(u, {
532
- ...me,
533
- onMouseDown: K,
531
+ children: /* @__PURE__ */ a.jsx(l, {
532
+ ...ye,
533
+ onMouseDown: q,
534
534
  className: o,
535
535
  contentClassName: s,
536
- children: a
536
+ children: r
537
537
  })
538
538
  });
539
- return /* @__PURE__ */ r.jsx(_e.Provider, {
540
- value: _,
541
- children: /* @__PURE__ */ r.jsx(St, {
542
- show: v,
543
- ref: pe,
544
- backdrop: k,
545
- container: de,
539
+ return /* @__PURE__ */ a.jsx(Je.Provider, {
540
+ value: V,
541
+ children: /* @__PURE__ */ a.jsx(Kt, {
542
+ show: f,
543
+ ref: Te,
544
+ backdrop: T,
545
+ container: me,
546
546
  keyboard: !0,
547
- autoFocus: q,
548
- enforceFocus: ce,
549
- restoreFocus: ue,
550
- restoreFocusOptions: fe,
551
- onEscapeKeyDown: qe,
552
- onShow: le,
553
- onHide: O,
554
- onEnter: Xe,
555
- onEntering: Je,
556
- onEntered: X,
557
- onExit: Ye,
558
- onExiting: he,
559
- onExited: Qe,
560
- manager: A(),
561
- transition: C ? Wt : void 0,
562
- backdropTransition: C ? Ut : void 0,
563
- renderBackdrop: Ze,
564
- renderDialog: et
547
+ autoFocus: Y,
548
+ enforceFocus: ge,
549
+ restoreFocus: pe,
550
+ restoreFocusOptions: Ee,
551
+ onEscapeKeyDown: tt,
552
+ onShow: he,
553
+ onHide: j,
554
+ onEnter: nt,
555
+ onEntering: st,
556
+ onEntered: Z,
557
+ onExit: ot,
558
+ onExiting: ve,
559
+ onExited: rt,
560
+ manager: B(),
561
+ transition: m ? Jt : void 0,
562
+ backdropTransition: m ? Xt : void 0,
563
+ renderBackdrop: at,
564
+ renderDialog: it
565
565
  })
566
566
  });
567
567
  });
568
- Ge.displayName = "Modal";
569
- const M = Object.assign(Ge, {
570
- Body: Pe,
571
- Header: ze,
572
- Title: Ve,
573
- Footer: Ke,
574
- Dialog: Te,
568
+ et.displayName = "Modal";
569
+ const I = Object.assign(et, {
570
+ Body: Qe,
571
+ Header: Ye,
572
+ Title: Ze,
573
+ Footer: Xe,
574
+ Dialog: Oe,
575
575
  TRANSITION_DURATION: 300,
576
576
  BACKDROP_TRANSITION_DURATION: 150
577
- }), Ht = () => {
578
- const { confirmTexts: t } = ae(be), { isShown: e, text: n, onFinish: o } = vt(), { options: s } = ae(He), [a, u] = p(s.defaultValue ?? ""), l = g(() => {
577
+ }), Yt = () => {
578
+ const { confirmTexts: e } = H(ue), { isShown: t, text: n, onFinish: o } = Mt(), { options: s } = H(ze), [r, l] = C(s.defaultValue ?? ""), i = y(() => {
579
579
  o(null);
580
- }, [o]), f = g(() => {
581
- o(a);
582
- }, [o, a]);
583
- re(() => {
584
- e === !0 && u(s.defaultValue ?? "");
585
- }, [e, s.defaultValue]);
586
- const h = R(() => ({
587
- value: a,
588
- onChange: (d) => u(d.currentTarget.value),
580
+ }, [o]), d = y(() => {
581
+ o(r);
582
+ }, [o, r]);
583
+ b(() => {
584
+ t === !0 && l(s.defaultValue ?? "");
585
+ }, [t, s.defaultValue]);
586
+ const h = w(() => ({
587
+ value: r,
588
+ onChange: (g) => l(g.currentTarget.value),
589
589
  className: "w-100",
590
590
  autoFocus: !0,
591
591
  tabIndex: 0
592
- }), [a]);
593
- return /* @__PURE__ */ r.jsxs(M, { show: e, size: "sm", centered: !0, onHide: l, children: [
594
- /* @__PURE__ */ r.jsx(M.Header, { children: /* @__PURE__ */ r.jsx(M.Title, { children: n }) }),
595
- /* @__PURE__ */ r.jsxs(M.Body, { children: [
596
- s.input === "textarea" ? /* @__PURE__ */ r.jsx("textarea", { ...h, rows: 5 }) : void 0,
597
- s.input === "input" ? /* @__PURE__ */ r.jsx("input", { ...h, type: s.type }) : void 0
592
+ }), [r]);
593
+ return /* @__PURE__ */ a.jsxs(I, { show: t, size: "sm", centered: !0, onHide: i, children: [
594
+ /* @__PURE__ */ a.jsx(I.Header, { children: /* @__PURE__ */ a.jsx(I.Title, { children: n }) }),
595
+ /* @__PURE__ */ a.jsxs(I.Body, { children: [
596
+ s.input === "textarea" ? /* @__PURE__ */ a.jsx("textarea", { ...h, rows: 5 }) : void 0,
597
+ s.input === "input" ? /* @__PURE__ */ a.jsx("input", { ...h, type: s.type }) : void 0
598
598
  ] }),
599
- /* @__PURE__ */ r.jsxs(M.Footer, { children: [
600
- /* @__PURE__ */ r.jsx("button", { type: "button", className: "btn btn-secondary", onClick: l, children: t.cancel }),
601
- /* @__PURE__ */ r.jsx("button", { type: "button", className: "btn btn-primary ml", onClick: f, disabled: s.required && !a, children: t.confirm })
599
+ /* @__PURE__ */ a.jsxs(I.Footer, { children: [
600
+ /* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-secondary", onClick: i, children: e.cancel }),
601
+ /* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-primary ml", onClick: d, disabled: s.required && !r, children: e.confirm })
602
602
  ] })
603
603
  ] });
604
- }, $t = ({ children: t }) => {
605
- const [e, n] = p(!1), [o, s] = p(""), [a, u] = p({ input: "textarea", type: "text" }), l = N(() => {
606
- }), f = g((v) => {
607
- s(v), n(!0);
608
- }, []), h = g(() => {
604
+ }, Zt = ({ children: e }) => {
605
+ const [t, n] = C(!1), [o, s] = C(""), [r, l] = C({ input: "textarea", type: "text" }), i = O(() => {
606
+ }), d = y((f) => {
607
+ s(f), n(!0);
608
+ }, []), h = y(() => {
609
609
  n(!1);
610
- }, []), d = R(() => ({
611
- isShown: e,
610
+ }, []), g = w(() => ({
611
+ isShown: t,
612
612
  text: o,
613
- showPrompt: f,
613
+ showPrompt: d,
614
614
  hidePrompt: h,
615
- resolveRef: l,
616
- options: a,
617
- setOptions: u
618
- }), [e, o, f, h, a]);
619
- return /* @__PURE__ */ r.jsxs(He.Provider, { value: d, children: [
620
- t,
621
- /* @__PURE__ */ r.jsx(Ht, {})
615
+ resolveRef: i,
616
+ options: r,
617
+ setOptions: l
618
+ }), [t, o, d, h, r]);
619
+ return /* @__PURE__ */ a.jsxs(ze.Provider, { value: g, children: [
620
+ e,
621
+ /* @__PURE__ */ a.jsx(Yt, {})
622
622
  ] });
623
- }, Pt = ({ children: t }) => {
624
- const [e, n] = p(!1), [o, s] = p(""), a = g((f) => {
625
- n(!0), s(f);
626
- }, []), u = g(() => {
623
+ }, en = ({ children: e }) => {
624
+ const [t, n] = C(!1), [o, s] = C(""), r = y((d) => {
625
+ n(!0), s(d);
626
+ }, []), l = y(() => {
627
627
  n(!1);
628
- }, []), l = R(() => ({ show: e, text: o, showConfirm: a, hideConfirm: u }), [e, o, a, u]);
629
- return /* @__PURE__ */ r.jsxs(ct.Provider, { value: l, children: [
630
- /* @__PURE__ */ r.jsx(_t, {}),
631
- t
628
+ }, []), i = w(() => ({ show: t, text: o, showConfirm: r, hideConfirm: l }), [t, o, r, l]);
629
+ return /* @__PURE__ */ a.jsxs(Et.Provider, { value: i, children: [
630
+ /* @__PURE__ */ a.jsx(rn, {}),
631
+ e
632
632
  ] });
633
- }, Yt = ({ cookieDomain: t, axiosInstance: e, LinkComponent: n, language: o, axiosTexts: s, confirmTexts: a, formValidationTexts: u, homeDashboardTexts: l, formSubmitTexts: f, appSearchTexts: h, customSelectTexts: d, children: v }) => {
634
- const C = R(() => ({
635
- axiosInstance: e,
636
- cookieDomain: t,
633
+ }, hn = ({ cookieDomain: e, axiosInstance: t, LinkComponent: n, NavigateComponent: o, language: s, axiosTexts: r, confirmTexts: l, formValidationTexts: i, homeDashboardTexts: d, formSubmitTexts: h, appSearchTexts: g, customSelectTexts: f, children: m }) => {
634
+ const T = w(() => ({
635
+ axiosInstance: t,
636
+ cookieDomain: e,
637
637
  LinkComponent: n,
638
- language: o,
639
- axiosTexts: s,
640
- confirmTexts: a,
641
- formValidationTexts: u,
642
- homeDashboardTexts: l,
643
- formSubmitTexts: f,
644
- appSearchTexts: h,
645
- customSelectTexts: d
638
+ NavigateComponent: o,
639
+ language: s,
640
+ axiosTexts: r,
641
+ confirmTexts: l,
642
+ formValidationTexts: i,
643
+ homeDashboardTexts: d,
644
+ formSubmitTexts: h,
645
+ appSearchTexts: g,
646
+ customSelectTexts: f
646
647
  }), [
647
- e,
648
648
  t,
649
+ e,
649
650
  n,
650
651
  o,
651
652
  s,
652
- a,
653
- u,
653
+ r,
654
654
  l,
655
- f,
655
+ i,
656
+ d,
656
657
  h,
657
- d
658
+ g,
659
+ f
658
660
  ]);
659
- return /* @__PURE__ */ r.jsx(be.Provider, { value: C, children: /* @__PURE__ */ r.jsx(Pt, { children: /* @__PURE__ */ r.jsxs($t, { children: [
660
- /* @__PURE__ */ r.jsx(ut, {}),
661
- v
661
+ return /* @__PURE__ */ a.jsx(ue.Provider, { value: T, children: /* @__PURE__ */ a.jsx(en, { children: /* @__PURE__ */ a.jsxs(Zt, { children: [
662
+ /* @__PURE__ */ a.jsx(vt, {}),
663
+ m
662
664
  ] }) }) });
663
- }, Jt = ({ children: t }) => {
664
- const [e, n] = p(!1), [o] = p(/* @__PURE__ */ new Set()), s = g((l) => {
665
- o.add(l), n(!0);
666
- }, [o]), a = g((l) => {
667
- o.delete(l), o.size === 0 && n(!1);
668
- }, [o]), u = R(() => ({ isLoading: e, startLoading: s, stopLoading: a }), [e, s, a]);
669
- return /* @__PURE__ */ r.jsxs(ft.Provider, { value: u, children: [
670
- e && /* @__PURE__ */ r.jsx(Et, {}),
671
- t
665
+ }, mn = ({ children: e }) => {
666
+ const [t, n] = C(!1), [o] = C(/* @__PURE__ */ new Set()), s = y((i) => {
667
+ o.add(i), n(!0);
668
+ }, [o]), r = y((i) => {
669
+ o.delete(i), o.size === 0 && n(!1);
670
+ }, [o]), l = w(() => ({ isLoading: t, startLoading: s, stopLoading: r }), [t, s, r]);
671
+ return /* @__PURE__ */ a.jsxs(yt.Provider, { value: l, children: [
672
+ t && /* @__PURE__ */ a.jsx(Lt, {}),
673
+ e
672
674
  ] });
673
- }, Qt = ({ children: t }) => {
674
- const e = ht(), n = g(() => {
675
- const d = localStorage.getItem("user") ?? null;
676
- return d ? JSON.parse(d) : null;
677
- }, []), [o, s] = p(n()), a = g(async () => {
678
- let d = null;
679
- return await e.get("/user/detail").then((v) => {
680
- d = v.data;
675
+ };
676
+ /*! @azure/msal-browser v3.14.0 2024-05-07 */
677
+ class tn {
678
+ /**
679
+ * Gets interaction status from event message
680
+ * @param message
681
+ * @param currentStatus
682
+ */
683
+ static getInteractionStatusFromEvent(t, n) {
684
+ switch (t.eventType) {
685
+ case v.LOGIN_START:
686
+ return E.Login;
687
+ case v.SSO_SILENT_START:
688
+ return E.SsoSilent;
689
+ case v.ACQUIRE_TOKEN_START:
690
+ if (t.interactionType === le.Redirect || t.interactionType === le.Popup)
691
+ return E.AcquireToken;
692
+ break;
693
+ case v.HANDLE_REDIRECT_START:
694
+ return E.HandleRedirect;
695
+ case v.LOGOUT_START:
696
+ return E.Logout;
697
+ case v.SSO_SILENT_SUCCESS:
698
+ case v.SSO_SILENT_FAILURE:
699
+ if (n && n !== E.SsoSilent)
700
+ break;
701
+ return E.None;
702
+ case v.LOGOUT_END:
703
+ if (n && n !== E.Logout)
704
+ break;
705
+ return E.None;
706
+ case v.HANDLE_REDIRECT_END:
707
+ if (n && n !== E.HandleRedirect)
708
+ break;
709
+ return E.None;
710
+ case v.LOGIN_SUCCESS:
711
+ case v.LOGIN_FAILURE:
712
+ case v.ACQUIRE_TOKEN_SUCCESS:
713
+ case v.ACQUIRE_TOKEN_FAILURE:
714
+ case v.RESTORE_FROM_BFCACHE:
715
+ if (t.interactionType === le.Redirect || t.interactionType === le.Popup) {
716
+ if (n && n !== E.Login && n !== E.AcquireToken)
717
+ break;
718
+ return E.None;
719
+ }
720
+ break;
721
+ }
722
+ return null;
723
+ }
724
+ }
725
+ /*! @azure/msal-react v2.0.16 2024-05-07 */
726
+ const nn = "@azure/msal-react", We = "2.0.16";
727
+ /*! @azure/msal-react v2.0.16 2024-05-07 */
728
+ const de = {
729
+ UNBLOCK_INPROGRESS: "UNBLOCK_INPROGRESS",
730
+ EVENT: "EVENT"
731
+ }, on = (e, t) => {
732
+ const { type: n, payload: o } = t;
733
+ let s = e.inProgress;
734
+ switch (n) {
735
+ case de.UNBLOCK_INPROGRESS:
736
+ e.inProgress === E.Startup && (s = E.None, o.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));
737
+ break;
738
+ case de.EVENT:
739
+ const l = o.message, i = tn.getInteractionStatusFromEvent(l, e.inProgress);
740
+ i && (o.logger.info(`MsalProvider - ${l.eventType} results in setting inProgress from ${e.inProgress} to ${i}`), s = i);
741
+ break;
742
+ default:
743
+ throw new Error(`Unknown action type: ${n}`);
744
+ }
745
+ const r = o.instance.getAllAccounts();
746
+ return s !== e.inProgress && !Pe(r, e.accounts) ? {
747
+ ...e,
748
+ inProgress: s,
749
+ accounts: r
750
+ } : s !== e.inProgress ? {
751
+ ...e,
752
+ inProgress: s
753
+ } : Pe(r, e.accounts) ? e : {
754
+ ...e,
755
+ accounts: r
756
+ };
757
+ };
758
+ function sn({ instance: e, children: t }) {
759
+ b(() => {
760
+ e.initializeWrapperLibrary(Ct.React, We);
761
+ }, [e]);
762
+ const n = w(() => e.getLogger().clone(nn, We), [e]), [o, s] = kt(on, void 0, () => ({
763
+ inProgress: E.Startup,
764
+ accounts: e.getAllAccounts()
765
+ }));
766
+ b(() => {
767
+ const l = e.addEventCallback((i) => {
768
+ s({
769
+ payload: {
770
+ instance: e,
771
+ logger: n,
772
+ message: i
773
+ },
774
+ type: de.EVENT
775
+ });
776
+ });
777
+ return n.verbose(`MsalProvider - Registered event callback with id: ${l}`), e.initialize().then(() => {
778
+ e.handleRedirectPromise().catch(() => {
779
+ }).finally(() => {
780
+ s({
781
+ payload: {
782
+ instance: e,
783
+ logger: n
784
+ },
785
+ type: de.UNBLOCK_INPROGRESS
786
+ });
787
+ });
681
788
  }).catch(() => {
682
- d = null;
683
- }), localStorage.setItem("user", JSON.stringify(d)), d;
684
- }, [e]), u = g(() => {
789
+ }), () => {
790
+ l && (n.verbose(`MsalProvider - Removing event callback ${l}`), e.removeEventCallback(l));
791
+ };
792
+ }, [e, n]);
793
+ const r = {
794
+ instance: e,
795
+ inProgress: o.inProgress,
796
+ accounts: o.accounts,
797
+ logger: n
798
+ };
799
+ return bt.createElement(Tt.Provider, { value: r }, t);
800
+ }
801
+ const gn = ({ children: e }) => {
802
+ const t = Rt(), { msalInstance: n } = H(Ve), o = y(() => {
803
+ const f = localStorage.getItem("user") ?? null;
804
+ return f ? JSON.parse(f) : null;
805
+ }, []), [s, r] = C(o()), l = y(async (f) => {
806
+ let m = null;
807
+ return await t.get("/user/detail", f ? { headers: { Authorization: `Bearer ${f}` } } : void 0).then((T) => {
808
+ m = T.data;
809
+ }).catch(() => {
810
+ m = null;
811
+ }), localStorage.setItem("user", JSON.stringify(m)), m;
812
+ }, [t]), i = y(() => {
685
813
  localStorage.removeItem("user");
686
- }, []), l = g(async () => {
687
- const d = await a();
688
- return d ? (s(d), !0) : !1;
689
- }, [a]), f = g(() => {
690
- u(), s(null);
691
- }, [u]), h = R(() => ({ user: o, loginUser: l, logoutUser: f }), [o, l, f]);
692
- return re(() => {
693
- s(n());
694
- }, [n]), /* @__PURE__ */ r.jsx(mt.Provider, { value: h, children: t });
695
- }, _t = () => {
696
- const { confirmTexts: t } = ae(be), { onConfirm: e, onCancel: n, text: o, show: s } = yt();
697
- return /* @__PURE__ */ r.jsx(M, { show: s, size: "sm", centered: !0, onHide: n, children: /* @__PURE__ */ r.jsxs(M.Body, { children: [
698
- /* @__PURE__ */ r.jsx("div", { className: "mb-5 text-center", children: /* @__PURE__ */ r.jsx(xt, { variant: "h6", children: o }) }),
699
- /* @__PURE__ */ r.jsxs("div", { className: "w-100 d-flex gap-5", children: [
700
- /* @__PURE__ */ r.jsx("button", { type: "button", className: "btn btn-secondary w-100", onClick: n, children: t.no }),
701
- /* @__PURE__ */ r.jsx("button", { type: "button", className: "btn btn-primary w-100 ml", onClick: e, children: t.yes })
814
+ }, []), d = y(async (f) => {
815
+ const m = await l(f);
816
+ return m ? (r(m), !0) : !1;
817
+ }, [l]), h = y(() => {
818
+ i(), r(null);
819
+ }, [i]), g = w(() => ({ user: s, loginUser: d, logoutUser: h }), [s, d, h]);
820
+ return b(() => {
821
+ r(o());
822
+ }, [o]), b(() => {
823
+ if (n) {
824
+ const f = n.addEventCallback((m) => {
825
+ if (m.eventType === v.ACQUIRE_TOKEN_SUCCESS && m.payload) {
826
+ const T = m.payload;
827
+ d(T.accessToken).catch(() => h());
828
+ }
829
+ });
830
+ return () => {
831
+ f && n.removeEventCallback(f);
832
+ };
833
+ }
834
+ return () => {
835
+ };
836
+ }, [n, d, h]), /* @__PURE__ */ a.jsx(xt.Provider, { value: g, children: e });
837
+ }, pn = ({ ...e }) => {
838
+ const { cookieDomain: t } = H(ue), [, n] = Nt(["Authorization"]), [o, s] = C(null), r = w(() => ({
839
+ useMsal: e.useMsal ?? !1,
840
+ storedToken: (o == null ? void 0 : o.token) ?? null,
841
+ msalInstance: e.useMsal ? e.msalInstance ?? null : null,
842
+ msalScopes: e.useMsal ? e.msalScopes ?? [] : []
843
+ }), [e, o]);
844
+ return b(() => {
845
+ if (e.useMsal) {
846
+ const l = e.msalInstance.addEventCallback((i) => {
847
+ if (i.eventType === v.LOGIN_SUCCESS || i.eventType === v.ACQUIRE_TOKEN_SUCCESS && i.payload) {
848
+ const d = i.payload, h = d.account;
849
+ e.msalInstance.setActiveAccount(h);
850
+ const g = d.accessToken, f = d.expiresOn;
851
+ s({ token: g, expiresOn: f });
852
+ }
853
+ });
854
+ return () => {
855
+ l && e.msalInstance.removeEventCallback(l);
856
+ };
857
+ }
858
+ return () => {
859
+ };
860
+ }, [e]), b(() => {
861
+ o && n("Authorization", o.token, {
862
+ path: "/",
863
+ secure: !0,
864
+ sameSite: "none",
865
+ domain: t,
866
+ expires: o.expiresOn ?? void 0
867
+ });
868
+ }, [o, t, n]), /* @__PURE__ */ a.jsx(Ve.Provider, { value: r, children: e.useMsal ? /* @__PURE__ */ a.jsx(sn, { instance: e.msalInstance, children: e.children }) : e.children });
869
+ }, rn = () => {
870
+ const { confirmTexts: e } = H(ue), { onConfirm: t, onCancel: n, text: o, show: s } = Ot();
871
+ return /* @__PURE__ */ a.jsx(I, { show: s, size: "sm", centered: !0, onHide: n, children: /* @__PURE__ */ a.jsxs(I.Body, { children: [
872
+ /* @__PURE__ */ a.jsx("div", { className: "mb-5 text-center", children: /* @__PURE__ */ a.jsx(At, { variant: "h6", children: o }) }),
873
+ /* @__PURE__ */ a.jsxs("div", { className: "w-100 d-flex gap-5", children: [
874
+ /* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-secondary w-100", onClick: n, children: e.no }),
875
+ /* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-primary w-100 ml", onClick: t, children: e.yes })
702
876
  ] })
703
877
  ] }) });
704
878
  };
705
879
  export {
706
- ft as LoadingContext,
707
- Jt as LoadingProvider,
708
- be as LuminusComponentsContext,
709
- Yt as LuminusComponentsProvider,
710
- mt as UserContext,
711
- Qt as UserProvider
880
+ Ve as AuthContext,
881
+ pn as AuthProvider,
882
+ yt as LoadingContext,
883
+ mn as LoadingProvider,
884
+ ue as LuminusComponentsContext,
885
+ hn as LuminusComponentsProvider,
886
+ xt as UserContext,
887
+ gn as UserProvider
712
888
  };