react-luminus-components 1.1.27 → 1.1.28

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,26 +1,26 @@
1
- import { j as r, c as x, e as ve, f as Ce, o as Fe, s as G, g as Ie, h as tt, i as nt, k as b, l as Re, m as ke, n as De, p as ot, r as Oe, q as st, t as $, v as rt, w as at, x as it, y as Se, F as $e, z as lt, A as dt, L as Ee, P as ct, C as ut, I as ft, B as ht, b as mt, U as gt } from "./UserAvatarToggle-CsMWlplC.js";
2
- import * as v from "react";
3
- import { forwardRef as pt, useState as p, useRef as M, useImperativeHandle as vt, useEffect as re, useCallback as m, useContext as be, useMemo as W } from "react";
4
- import { a as yt, u as xt } from "./useConfirm-CXFo5fIW.js";
5
- import { T as wt } from "./Typography-CmC4x8yQ.js";
6
- import { d as Ct, u as Et, q as I, L as bt } from "./DataKey-DLEAAtqJ.js";
1
+ import { j as r, c as w, e as ye, f as be, o as Fe, s as G, g as Ie, h as nt, i as ot, k as E, l as Re, m as ke, n as De, p as st, r as Oe, q as rt, t as W, v as at, w as it, x as lt, y as Se, F as $e, z as dt, A as ct, L as Ee, P as We, C as ut, I as ft, B as ht, b as mt, U as gt } from "./UserAvatarToggle-I_MgjXhA.js";
2
+ import * as y from "react";
3
+ import { forwardRef as pt, useState as p, useRef as M, useImperativeHandle as vt, useEffect as re, useCallback as g, useContext as ae, useMemo as R } from "react";
4
+ import { a as yt, u as xt } from "./useConfirm-BGatkLkP.js";
5
+ import { T as wt } from "./Typography-DUoLZCdX.js";
6
+ import { d as Ct, u as bt, q as D, L as Et } from "./DataKey-C3jtX0q4.js";
7
7
  import Mt from "react-dom";
8
- const Tt = (t) => /* @__PURE__ */ v.forwardRef((e, n) => /* @__PURE__ */ r.jsx("div", {
8
+ const Tt = (t) => /* @__PURE__ */ y.forwardRef((e, n) => /* @__PURE__ */ r.jsx("div", {
9
9
  ...e,
10
10
  ref: n,
11
- className: x(e.className, t)
11
+ className: w(e.className, t)
12
12
  })), jt = {
13
13
  /** An accessible label indicating the relevant information about the Close Button. */
14
- "aria-label": ve.string,
14
+ "aria-label": ye.string,
15
15
  /** A callback fired after the Close Button is clicked. */
16
- onClick: ve.func,
16
+ onClick: ye.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: ve.oneOf(["white"])
23
- }, Me = /* @__PURE__ */ v.forwardRef(({
22
+ variant: ye.oneOf(["white"])
23
+ }, Me = /* @__PURE__ */ y.forwardRef(({
24
24
  className: t,
25
25
  variant: e,
26
26
  "aria-label": n = "Close",
@@ -28,7 +28,7 @@ const Tt = (t) => /* @__PURE__ */ v.forwardRef((e, n) => /* @__PURE__ */ r.jsx("
28
28
  }, s) => /* @__PURE__ */ r.jsx("button", {
29
29
  ref: s,
30
30
  type: "button",
31
- className: x("btn-close", e && `btn-close-${e}`, t),
31
+ className: w("btn-close", e && `btn-close-${e}`, t),
32
32
  "aria-label": n,
33
33
  ...o
34
34
  }));
@@ -37,13 +37,13 @@ Me.propTypes = jt;
37
37
  const Nt = Me;
38
38
  var se;
39
39
  function Be(t) {
40
- if ((!se && se !== 0 || t) && Ce) {
40
+ if ((!se && se !== 0 || t) && be) {
41
41
  var e = document.createElement("div");
42
42
  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);
43
43
  }
44
44
  return se;
45
45
  }
46
- function ye(t) {
46
+ function xe(t) {
47
47
  t === void 0 && (t = Fe());
48
48
  try {
49
49
  var e = t.activeElement;
@@ -115,11 +115,11 @@ function St(t, e) {
115
115
  s = o[a], !(e.indexOf(s) >= 0) && (n[s] = t[s]);
116
116
  return n;
117
117
  }
118
- let xe;
118
+ let we;
119
119
  function Bt(t) {
120
- return xe || (xe = new Te({
120
+ return we || (we = new Te({
121
121
  ownerDocument: t == null ? void 0 : t.document
122
- })), xe;
122
+ })), we;
123
123
  }
124
124
  function At(t) {
125
125
  const e = Ie(), n = t || Bt(e), o = M({
@@ -130,115 +130,115 @@ function At(t) {
130
130
  add: () => n.add(o.current),
131
131
  remove: () => n.remove(o.current),
132
132
  isTopModal: () => n.isTopModal(o.current),
133
- setDialogRef: m((s) => {
133
+ setDialogRef: g((s) => {
134
134
  o.current.dialog = s;
135
135
  }, []),
136
- setBackdropRef: m((s) => {
136
+ setBackdropRef: g((s) => {
137
137
  o.current.backdrop = s;
138
138
  }, [])
139
139
  });
140
140
  }
141
- const We = /* @__PURE__ */ pt((t, e) => {
141
+ const He = /* @__PURE__ */ pt((t, e) => {
142
142
  let {
143
143
  show: n = !1,
144
144
  role: o = "dialog",
145
145
  className: s,
146
146
  style: a,
147
- children: d,
147
+ children: u,
148
148
  backdrop: l = !0,
149
149
  keyboard: f = !0,
150
- onBackdropClick: g,
151
- onEscapeKeyDown: u,
152
- transition: w,
150
+ onBackdropClick: h,
151
+ onEscapeKeyDown: d,
152
+ transition: v,
153
153
  runTransition: T,
154
- backdropTransition: R,
155
- runBackdropTransition: ae,
154
+ backdropTransition: k,
155
+ runBackdropTransition: ie,
156
156
  autoFocus: V = !0,
157
- enforceFocus: ie = !0,
158
- restoreFocus: k = !0,
159
- restoreFocusOptions: le,
157
+ enforceFocus: le = !0,
158
+ restoreFocus: O = !0,
159
+ restoreFocusOptions: de,
160
160
  renderDialog: q,
161
- renderBackdrop: de = (c) => /* @__PURE__ */ r.jsx("div", Object.assign({}, c)),
162
- manager: ce,
163
- container: ue,
161
+ renderBackdrop: ce = (c) => /* @__PURE__ */ r.jsx("div", Object.assign({}, c)),
162
+ manager: ue,
163
+ container: fe,
164
164
  onShow: X,
165
165
  onHide: H = () => {
166
166
  },
167
- onExit: fe,
167
+ onExit: he,
168
168
  onExited: U,
169
169
  onExiting: Y,
170
170
  onEnter: J,
171
171
  onEntering: Q,
172
172
  onEntered: Z
173
- } = t, he = St(t, Ot);
174
- const C = Ie(), O = tt(ue), h = At(ce), me = nt(), ee = Et(n), [j, S] = p(!n), y = M(null);
175
- vt(e, () => h, [h]), Ce && !ee && n && (y.current = ye(C == null ? void 0 : C.document)), n && j && S(!1);
176
- const E = b(() => {
177
- if (h.add(), B.current = Re(document, "keydown", pe), _.current = Re(
173
+ } = t, me = St(t, Ot);
174
+ const C = Ie(), S = nt(fe), m = At(ue), ge = ot(), ee = bt(n), [j, B] = p(!n), x = M(null);
175
+ vt(e, () => m, [m]), be && !ee && n && (x.current = xe(C == null ? void 0 : C.document)), n && j && B(!1);
176
+ const b = E(() => {
177
+ if (m.add(), A.current = Re(document, "keydown", ve), _.current = Re(
178
178
  document,
179
179
  "focus",
180
180
  // the timeout is necessary b/c this will run before the new modal is mounted
181
181
  // and so steals focus from it
182
- () => setTimeout(ge),
182
+ () => setTimeout(pe),
183
183
  !0
184
184
  ), X && X(), V) {
185
185
  var c, oe;
186
- const z = ye((c = (oe = h.dialog) == null ? void 0 : oe.ownerDocument) != null ? c : C == null ? void 0 : C.document);
187
- h.dialog && z && !ke(h.dialog, z) && (y.current = z, h.dialog.focus());
186
+ const z = xe((c = (oe = m.dialog) == null ? void 0 : oe.ownerDocument) != null ? c : C == null ? void 0 : C.document);
187
+ m.dialog && z && !ke(m.dialog, z) && (x.current = z, m.dialog.focus());
188
188
  }
189
- }), P = b(() => {
190
- if (h.remove(), B.current == null || B.current(), _.current == null || _.current(), k) {
189
+ }), P = E(() => {
190
+ if (m.remove(), A.current == null || A.current(), _.current == null || _.current(), O) {
191
191
  var c;
192
- (c = y.current) == null || c.focus == null || c.focus(le), y.current = null;
192
+ (c = x.current) == null || c.focus == null || c.focus(de), x.current = null;
193
193
  }
194
194
  });
195
195
  re(() => {
196
- !n || !O || E();
196
+ !n || !S || b();
197
197
  }, [
198
198
  n,
199
- O,
199
+ S,
200
200
  /* should never change: */
201
- E
201
+ b
202
202
  ]), re(() => {
203
203
  j && P();
204
204
  }, [j, P]), De(() => {
205
205
  P();
206
206
  });
207
- const ge = b(() => {
208
- if (!ie || !me() || !h.isTopModal())
207
+ const pe = E(() => {
208
+ if (!le || !ge() || !m.isTopModal())
209
209
  return;
210
- const c = ye(C == null ? void 0 : C.document);
211
- h.dialog && c && !ke(h.dialog, c) && h.dialog.focus();
212
- }), te = b((c) => {
213
- c.target === c.currentTarget && (g == null || g(c), l === !0 && H());
214
- }), pe = b((c) => {
215
- f && ot(c) && h.isTopModal() && (u == null || u(c), c.defaultPrevented || H());
216
- }), _ = M(), B = M(), ne = (...c) => {
217
- S(!0), U == null || U(...c);
210
+ const c = xe(C == null ? void 0 : C.document);
211
+ m.dialog && c && !ke(m.dialog, c) && m.dialog.focus();
212
+ }), te = E((c) => {
213
+ c.target === c.currentTarget && (h == null || h(c), l === !0 && H());
214
+ }), ve = E((c) => {
215
+ f && st(c) && m.isTopModal() && (d == null || d(c), c.defaultPrevented || H());
216
+ }), _ = M(), A = M(), ne = (...c) => {
217
+ B(!0), U == null || U(...c);
218
218
  };
219
- if (!O)
219
+ if (!S)
220
220
  return null;
221
- const A = Object.assign({
221
+ const L = Object.assign({
222
222
  role: o,
223
- ref: h.setDialogRef,
223
+ ref: m.setDialogRef,
224
224
  // apparently only works on the dialog role element
225
225
  "aria-modal": o === "dialog" ? !0 : void 0
226
- }, he, {
226
+ }, me, {
227
227
  style: a,
228
228
  className: s,
229
229
  tabIndex: -1
230
230
  });
231
- let K = q ? q(A) : /* @__PURE__ */ r.jsx("div", Object.assign({}, A, {
232
- children: /* @__PURE__ */ v.cloneElement(d, {
231
+ let K = q ? q(L) : /* @__PURE__ */ r.jsx("div", Object.assign({}, L, {
232
+ children: /* @__PURE__ */ y.cloneElement(u, {
233
233
  role: "document"
234
234
  })
235
235
  }));
236
- K = Oe(w, T, {
236
+ K = Oe(v, T, {
237
237
  unmountOnExit: !0,
238
238
  mountOnEnter: !0,
239
239
  appear: !0,
240
240
  in: !!n,
241
- onExit: fe,
241
+ onExit: he,
242
242
  onExiting: Y,
243
243
  onExited: ne,
244
244
  onEnter: J,
@@ -246,28 +246,28 @@ const We = /* @__PURE__ */ pt((t, e) => {
246
246
  onEntered: Z,
247
247
  children: K
248
248
  });
249
- let L = null;
250
- return l && (L = de({
251
- ref: h.setBackdropRef,
249
+ let F = null;
250
+ return l && (F = ce({
251
+ ref: m.setBackdropRef,
252
252
  onClick: te
253
- }), L = Oe(R, ae, {
253
+ }), F = Oe(k, ie, {
254
254
  in: !!n,
255
255
  appear: !0,
256
256
  mountOnEnter: !0,
257
257
  unmountOnExit: !0,
258
- children: L
258
+ children: F
259
259
  })), /* @__PURE__ */ r.jsx(r.Fragment, {
260
260
  children: /* @__PURE__ */ Mt.createPortal(/* @__PURE__ */ r.jsxs(r.Fragment, {
261
- children: [L, K]
262
- }), O)
261
+ children: [F, K]
262
+ }), S)
263
263
  });
264
264
  });
265
- We.displayName = "Modal";
266
- const Lt = Object.assign(We, {
265
+ He.displayName = "Modal";
266
+ const Lt = Object.assign(He, {
267
267
  Manager: Te
268
268
  });
269
269
  function Ft(t, e) {
270
- 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));
270
+ t.classList ? t.classList.add(e) : rt(t, e) || (typeof t.className == "string" ? t.className = t.className + " " + e : t.setAttribute("class", (t.className && t.className.baseVal || "") + " " + e));
271
271
  }
272
272
  function Le(t, e) {
273
273
  return t.replace(new RegExp("(^|\\s)" + e + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
@@ -275,7 +275,7 @@ function Le(t, e) {
275
275
  function It(t, e) {
276
276
  t.classList ? t.classList.remove(e) : typeof t.className == "string" ? t.className = Le(t.className, e) : t.setAttribute("class", Le(t.className && t.className.baseVal || "", e));
277
277
  }
278
- const D = {
278
+ const $ = {
279
279
  FIXED_CONTENT: ".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",
280
280
  STICKY_CONTENT: ".sticky-top",
281
281
  NAVBAR_TOGGLER: ".navbar-toggler"
@@ -299,83 +299,83 @@ class Dt extends Te {
299
299
  if (Ft(n, "modal-open"), !e.scrollBarWidth)
300
300
  return;
301
301
  const o = this.isRTL ? "paddingLeft" : "paddingRight", s = this.isRTL ? "marginLeft" : "marginRight";
302
- I(n, D.FIXED_CONTENT).forEach((a) => this.adjustAndStore(o, a, e.scrollBarWidth)), I(n, D.STICKY_CONTENT).forEach((a) => this.adjustAndStore(s, a, -e.scrollBarWidth)), I(n, D.NAVBAR_TOGGLER).forEach((a) => this.adjustAndStore(s, a, e.scrollBarWidth));
302
+ D(n, $.FIXED_CONTENT).forEach((a) => this.adjustAndStore(o, a, e.scrollBarWidth)), D(n, $.STICKY_CONTENT).forEach((a) => this.adjustAndStore(s, a, -e.scrollBarWidth)), D(n, $.NAVBAR_TOGGLER).forEach((a) => this.adjustAndStore(s, a, e.scrollBarWidth));
303
303
  }
304
304
  removeContainerStyle(e) {
305
305
  super.removeContainerStyle(e);
306
306
  const n = this.getElement();
307
307
  It(n, "modal-open");
308
308
  const o = this.isRTL ? "paddingLeft" : "paddingRight", s = this.isRTL ? "marginLeft" : "marginRight";
309
- I(n, D.FIXED_CONTENT).forEach((a) => this.restore(o, a)), I(n, D.STICKY_CONTENT).forEach((a) => this.restore(s, a)), I(n, D.NAVBAR_TOGGLER).forEach((a) => this.restore(s, a));
309
+ D(n, $.FIXED_CONTENT).forEach((a) => this.restore(o, a)), D(n, $.STICKY_CONTENT).forEach((a) => this.restore(s, a)), D(n, $.NAVBAR_TOGGLER).forEach((a) => this.restore(s, a));
310
310
  }
311
311
  }
312
- let we;
312
+ let Ce;
313
313
  function $t(t) {
314
- return we || (we = new Dt(t)), we;
314
+ return Ce || (Ce = new Dt(t)), Ce;
315
315
  }
316
- const He = /* @__PURE__ */ v.forwardRef(({
316
+ const Ue = /* @__PURE__ */ y.forwardRef(({
317
317
  className: t,
318
318
  bsPrefix: e,
319
319
  as: n = "div",
320
320
  ...o
321
- }, s) => (e = $(e, "modal-body"), /* @__PURE__ */ r.jsx(n, {
321
+ }, s) => (e = W(e, "modal-body"), /* @__PURE__ */ r.jsx(n, {
322
322
  ref: s,
323
- className: x(t, e),
323
+ className: w(t, e),
324
324
  ...o
325
325
  })));
326
- He.displayName = "ModalBody";
327
- const Wt = He, Ht = /* @__PURE__ */ v.createContext({
326
+ Ue.displayName = "ModalBody";
327
+ const Wt = Ue, Ht = /* @__PURE__ */ y.createContext({
328
328
  // eslint-disable-next-line @typescript-eslint/no-empty-function
329
329
  onHide() {
330
330
  }
331
- }), Ue = Ht, Pe = /* @__PURE__ */ v.forwardRef(({
331
+ }), Pe = Ht, _e = /* @__PURE__ */ y.forwardRef(({
332
332
  bsPrefix: t,
333
333
  className: e,
334
334
  contentClassName: n,
335
335
  centered: o,
336
336
  size: s,
337
337
  fullscreen: a,
338
- children: d,
338
+ children: u,
339
339
  scrollable: l,
340
340
  ...f
341
- }, g) => {
342
- t = $(t, "modal");
343
- const u = `${t}-dialog`, w = typeof a == "string" ? `${t}-fullscreen-${a}` : `${t}-fullscreen`;
341
+ }, h) => {
342
+ t = W(t, "modal");
343
+ const d = `${t}-dialog`, v = typeof a == "string" ? `${t}-fullscreen-${a}` : `${t}-fullscreen`;
344
344
  return /* @__PURE__ */ r.jsx("div", {
345
345
  ...f,
346
- ref: g,
347
- className: x(u, e, s && `${t}-${s}`, o && `${u}-centered`, l && `${u}-scrollable`, a && w),
346
+ ref: h,
347
+ className: w(d, e, s && `${t}-${s}`, o && `${d}-centered`, l && `${d}-scrollable`, a && v),
348
348
  children: /* @__PURE__ */ r.jsx("div", {
349
- className: x(`${t}-content`, n),
350
- children: d
349
+ className: w(`${t}-content`, n),
350
+ children: u
351
351
  })
352
352
  });
353
353
  });
354
- Pe.displayName = "ModalDialog";
355
- const _e = Pe, Ke = /* @__PURE__ */ v.forwardRef(({
354
+ _e.displayName = "ModalDialog";
355
+ const Ke = _e, ze = /* @__PURE__ */ y.forwardRef(({
356
356
  className: t,
357
357
  bsPrefix: e,
358
358
  as: n = "div",
359
359
  ...o
360
- }, s) => (e = $(e, "modal-footer"), /* @__PURE__ */ r.jsx(n, {
360
+ }, s) => (e = W(e, "modal-footer"), /* @__PURE__ */ r.jsx(n, {
361
361
  ref: s,
362
- className: x(t, e),
362
+ className: w(t, e),
363
363
  ...o
364
364
  })));
365
- Ke.displayName = "ModalFooter";
366
- const Ut = Ke, Pt = /* @__PURE__ */ v.forwardRef(({
365
+ ze.displayName = "ModalFooter";
366
+ const Ut = ze, Pt = /* @__PURE__ */ y.forwardRef(({
367
367
  closeLabel: t = "Close",
368
368
  closeVariant: e,
369
369
  closeButton: n = !1,
370
370
  onHide: o,
371
371
  children: s,
372
372
  ...a
373
- }, d) => {
374
- const l = be(Ue), f = b(() => {
373
+ }, u) => {
374
+ const l = ae(Pe), f = E(() => {
375
375
  l == null || l.onHide(), o == null || o();
376
376
  });
377
377
  return /* @__PURE__ */ r.jsxs("div", {
378
- ref: d,
378
+ ref: u,
379
379
  ...a,
380
380
  children: [s, n && /* @__PURE__ */ r.jsx(Nt, {
381
381
  "aria-label": t,
@@ -383,32 +383,32 @@ const Ut = Ke, Pt = /* @__PURE__ */ v.forwardRef(({
383
383
  onClick: f
384
384
  })]
385
385
  });
386
- }), _t = Pt, ze = /* @__PURE__ */ v.forwardRef(({
386
+ }), _t = Pt, Ge = /* @__PURE__ */ y.forwardRef(({
387
387
  bsPrefix: t,
388
388
  className: e,
389
389
  closeLabel: n = "Close",
390
390
  closeButton: o = !1,
391
391
  ...s
392
- }, a) => (t = $(t, "modal-header"), /* @__PURE__ */ r.jsx(_t, {
392
+ }, a) => (t = W(t, "modal-header"), /* @__PURE__ */ r.jsx(_t, {
393
393
  ref: a,
394
394
  ...s,
395
- className: x(e, t),
395
+ className: w(e, t),
396
396
  closeLabel: n,
397
397
  closeButton: o
398
398
  })));
399
- ze.displayName = "ModalHeader";
400
- const Kt = ze, zt = Tt("h4"), Ge = /* @__PURE__ */ v.forwardRef(({
399
+ Ge.displayName = "ModalHeader";
400
+ const Kt = Ge, zt = Tt("h4"), Ve = /* @__PURE__ */ y.forwardRef(({
401
401
  className: t,
402
402
  bsPrefix: e,
403
403
  as: n = zt,
404
404
  ...o
405
- }, s) => (e = $(e, "modal-title"), /* @__PURE__ */ r.jsx(n, {
405
+ }, s) => (e = W(e, "modal-title"), /* @__PURE__ */ r.jsx(n, {
406
406
  ref: s,
407
- className: x(t, e),
407
+ className: w(t, e),
408
408
  ...o
409
409
  })));
410
- Ge.displayName = "ModalTitle";
411
- const Gt = Ge;
410
+ Ve.displayName = "ModalTitle";
411
+ const Gt = Ve;
412
412
  function Vt(t) {
413
413
  return /* @__PURE__ */ r.jsx($e, {
414
414
  ...t,
@@ -421,220 +421,235 @@ function qt(t) {
421
421
  timeout: null
422
422
  });
423
423
  }
424
- const Ve = /* @__PURE__ */ v.forwardRef(({
424
+ const qe = /* @__PURE__ */ y.forwardRef(({
425
425
  bsPrefix: t,
426
426
  className: e,
427
427
  style: n,
428
428
  dialogClassName: o,
429
429
  contentClassName: s,
430
430
  children: a,
431
- dialogAs: d = _e,
431
+ dialogAs: u = Ke,
432
432
  "data-bs-theme": l,
433
433
  "aria-labelledby": f,
434
- "aria-describedby": g,
435
- "aria-label": u,
434
+ "aria-describedby": h,
435
+ "aria-label": d,
436
436
  /* BaseModal props */
437
- show: w = !1,
437
+ show: v = !1,
438
438
  animation: T = !0,
439
- backdrop: R = !0,
440
- keyboard: ae = !0,
439
+ backdrop: k = !0,
440
+ keyboard: ie = !0,
441
441
  onEscapeKeyDown: V,
442
- onShow: ie,
443
- onHide: k,
444
- container: le,
442
+ onShow: le,
443
+ onHide: O,
444
+ container: de,
445
445
  autoFocus: q = !0,
446
- enforceFocus: de = !0,
447
- restoreFocus: ce = !0,
448
- restoreFocusOptions: ue,
446
+ enforceFocus: ce = !0,
447
+ restoreFocus: ue = !0,
448
+ restoreFocusOptions: fe,
449
449
  onEntered: X,
450
450
  onExit: H,
451
- onExiting: fe,
451
+ onExiting: he,
452
452
  onEnter: U,
453
453
  onEntering: Y,
454
454
  onExited: J,
455
455
  backdropClassName: Q,
456
456
  manager: Z,
457
- ...he
457
+ ...me
458
458
  }, C) => {
459
- const [O, h] = p({}), [me, ee] = p(!1), j = M(!1), S = M(!1), y = M(null), [E, P] = rt(), ge = at(C, P), te = b(k), pe = it();
460
- t = $(t, "modal");
461
- const _ = W(() => ({
459
+ const [S, m] = p({}), [ge, ee] = p(!1), j = M(!1), B = M(!1), x = M(null), [b, P] = at(), pe = it(C, P), te = E(O), ve = lt();
460
+ t = W(t, "modal");
461
+ const _ = R(() => ({
462
462
  onHide: te
463
463
  }), [te]);
464
- function B() {
464
+ function A() {
465
465
  return Z || $t({
466
- isRTL: pe
466
+ isRTL: ve
467
467
  });
468
468
  }
469
469
  function ne(i) {
470
- if (!Ce)
470
+ if (!be)
471
471
  return;
472
- const F = B().getScrollbarWidth() > 0, Ne = i.scrollHeight > Fe(i).documentElement.clientHeight;
473
- h({
474
- paddingRight: F && !Ne ? Be() : void 0,
475
- paddingLeft: !F && Ne ? Be() : void 0
472
+ const I = A().getScrollbarWidth() > 0, Ne = i.scrollHeight > Fe(i).documentElement.clientHeight;
473
+ m({
474
+ paddingRight: I && !Ne ? Be() : void 0,
475
+ paddingLeft: !I && Ne ? Be() : void 0
476
476
  });
477
477
  }
478
- const A = b(() => {
479
- E && ne(E.dialog);
478
+ const L = E(() => {
479
+ b && ne(b.dialog);
480
480
  });
481
481
  De(() => {
482
- Se(window, "resize", A), y.current == null || y.current();
482
+ Se(window, "resize", L), x.current == null || x.current();
483
483
  });
484
484
  const K = () => {
485
485
  j.current = !0;
486
- }, L = (i) => {
487
- j.current && E && i.target === E.dialog && (S.current = !0), j.current = !1;
486
+ }, F = (i) => {
487
+ j.current && b && i.target === b.dialog && (B.current = !0), j.current = !1;
488
488
  }, c = () => {
489
- ee(!0), y.current = dt(E.dialog, () => {
489
+ ee(!0), x.current = ct(b.dialog, () => {
490
490
  ee(!1);
491
491
  });
492
492
  }, oe = (i) => {
493
493
  i.target === i.currentTarget && c();
494
494
  }, z = (i) => {
495
- if (R === "static") {
495
+ if (k === "static") {
496
496
  oe(i);
497
497
  return;
498
498
  }
499
- if (S.current || i.target !== i.currentTarget) {
500
- S.current = !1;
499
+ if (B.current || i.target !== i.currentTarget) {
500
+ B.current = !1;
501
501
  return;
502
502
  }
503
- k == null || k();
504
- }, qe = (i) => {
505
- ae ? V == null || V(i) : (i.preventDefault(), R === "static" && c());
506
- }, Xe = (i, F) => {
507
- i && ne(i), U == null || U(i, F);
508
- }, Ye = (i) => {
509
- y.current == null || y.current(), H == null || H(i);
510
- }, Je = (i, F) => {
511
- Y == null || Y(i, F), lt(window, "resize", A);
512
- }, Qe = (i) => {
513
- i && (i.style.display = ""), J == null || J(i), Se(window, "resize", A);
514
- }, Ze = m((i) => /* @__PURE__ */ r.jsx("div", {
503
+ O == null || O();
504
+ }, Xe = (i) => {
505
+ ie ? V == null || V(i) : (i.preventDefault(), k === "static" && c());
506
+ }, Ye = (i, I) => {
507
+ i && ne(i), U == null || U(i, I);
508
+ }, Je = (i) => {
509
+ x.current == null || x.current(), H == null || H(i);
510
+ }, Qe = (i, I) => {
511
+ Y == null || Y(i, I), dt(window, "resize", L);
512
+ }, Ze = (i) => {
513
+ i && (i.style.display = ""), J == null || J(i), Se(window, "resize", L);
514
+ }, et = g((i) => /* @__PURE__ */ r.jsx("div", {
515
515
  ...i,
516
- className: x(`${t}-backdrop`, Q, !T && "show")
516
+ className: w(`${t}-backdrop`, Q, !T && "show")
517
517
  }), [T, Q, t]), je = {
518
518
  ...n,
519
- ...O
519
+ ...S
520
520
  };
521
521
  je.display = "block";
522
- const et = (i) => /* @__PURE__ */ r.jsx("div", {
522
+ const tt = (i) => /* @__PURE__ */ r.jsx("div", {
523
523
  role: "dialog",
524
524
  ...i,
525
525
  style: je,
526
- className: x(e, t, me && `${t}-static`, !T && "show"),
527
- onClick: R ? z : void 0,
528
- onMouseUp: L,
526
+ className: w(e, t, ge && `${t}-static`, !T && "show"),
527
+ onClick: k ? z : void 0,
528
+ onMouseUp: F,
529
529
  "data-bs-theme": l,
530
- "aria-label": u,
530
+ "aria-label": d,
531
531
  "aria-labelledby": f,
532
- "aria-describedby": g,
533
- children: /* @__PURE__ */ r.jsx(d, {
534
- ...he,
532
+ "aria-describedby": h,
533
+ children: /* @__PURE__ */ r.jsx(u, {
534
+ ...me,
535
535
  onMouseDown: K,
536
536
  className: o,
537
537
  contentClassName: s,
538
538
  children: a
539
539
  })
540
540
  });
541
- return /* @__PURE__ */ r.jsx(Ue.Provider, {
541
+ return /* @__PURE__ */ r.jsx(Pe.Provider, {
542
542
  value: _,
543
543
  children: /* @__PURE__ */ r.jsx(Lt, {
544
- show: w,
545
- ref: ge,
546
- backdrop: R,
547
- container: le,
544
+ show: v,
545
+ ref: pe,
546
+ backdrop: k,
547
+ container: de,
548
548
  keyboard: !0,
549
549
  autoFocus: q,
550
- enforceFocus: de,
551
- restoreFocus: ce,
552
- restoreFocusOptions: ue,
553
- onEscapeKeyDown: qe,
554
- onShow: ie,
555
- onHide: k,
556
- onEnter: Xe,
557
- onEntering: Je,
550
+ enforceFocus: ce,
551
+ restoreFocus: ue,
552
+ restoreFocusOptions: fe,
553
+ onEscapeKeyDown: Xe,
554
+ onShow: le,
555
+ onHide: O,
556
+ onEnter: Ye,
557
+ onEntering: Qe,
558
558
  onEntered: X,
559
- onExit: Ye,
560
- onExiting: fe,
561
- onExited: Qe,
562
- manager: B(),
559
+ onExit: Je,
560
+ onExiting: he,
561
+ onExited: Ze,
562
+ manager: A(),
563
563
  transition: T ? Vt : void 0,
564
564
  backdropTransition: T ? qt : void 0,
565
- renderBackdrop: Ze,
566
- renderDialog: et
565
+ renderBackdrop: et,
566
+ renderDialog: tt
567
567
  })
568
568
  });
569
569
  });
570
- Ve.displayName = "Modal";
571
- const N = Object.assign(Ve, {
570
+ qe.displayName = "Modal";
571
+ const N = Object.assign(qe, {
572
572
  Body: Wt,
573
573
  Header: Kt,
574
574
  Title: Gt,
575
575
  Footer: Ut,
576
- Dialog: _e,
576
+ Dialog: Ke,
577
577
  TRANSITION_DURATION: 300,
578
578
  BACKDROP_TRANSITION_DURATION: 150
579
579
  }), Xt = () => {
580
- const { confirmTexts: t } = be(Ee), { isShown: e, text: n, onFinish: o } = yt(), [s, a] = p(""), d = m(() => {
580
+ const { confirmTexts: t } = ae(Ee), { isShown: e, text: n, onFinish: o } = yt(), { options: s } = ae(We), [a, u] = p(""), l = g(() => {
581
581
  o(null);
582
- }, [o]), l = m(() => {
583
- o(s);
584
- }, [o, s]);
585
- return re(() => {
586
- e === !0 && a("");
587
- }, [e]), /* @__PURE__ */ r.jsxs(N, { show: e, size: "sm", centered: !0, onHide: d, children: [
582
+ }, [o]), f = g(() => {
583
+ o(a);
584
+ }, [o, a]);
585
+ re(() => {
586
+ e === !0 && u("");
587
+ }, [e]);
588
+ const h = R(() => ({
589
+ value: a,
590
+ onChange: (d) => u(d.currentTarget.value),
591
+ className: "w-100",
592
+ autoFocus: !0,
593
+ tabIndex: 0
594
+ }), [a]);
595
+ return /* @__PURE__ */ r.jsxs(N, { show: e, size: "sm", centered: !0, onHide: l, children: [
588
596
  /* @__PURE__ */ r.jsx(N.Header, { children: /* @__PURE__ */ r.jsx(N.Title, { children: n }) }),
589
- /* @__PURE__ */ r.jsx(N.Body, { children: /* @__PURE__ */ r.jsx(
590
- "textarea",
591
- {
592
- autoFocus: !0,
593
- tabIndex: 0,
594
- value: s,
595
- onChange: (f) => a(f.currentTarget.value),
596
- className: "w-100",
597
- rows: 5
598
- }
599
- ) }),
597
+ /* @__PURE__ */ r.jsxs(N.Body, { children: [
598
+ s.input === "textarea" ? /* @__PURE__ */ r.jsx(
599
+ "textarea",
600
+ {
601
+ ...h,
602
+ rows: 5
603
+ }
604
+ ) : void 0,
605
+ s.input === "input" ? /* @__PURE__ */ r.jsx("input", { ...h, type: s.type }) : void 0
606
+ ] }),
600
607
  /* @__PURE__ */ r.jsxs(N.Footer, { children: [
601
- /* @__PURE__ */ r.jsx("button", { type: "button", className: "btn btn-secondary", onClick: d, children: t.cancel }),
602
- /* @__PURE__ */ r.jsx("button", { type: "button", className: "btn btn-primary ml", onClick: l, children: t.confirm })
608
+ /* @__PURE__ */ r.jsx("button", { type: "button", className: "btn btn-secondary", onClick: l, children: t.cancel }),
609
+ /* @__PURE__ */ r.jsx("button", { type: "button", className: "btn btn-primary ml", onClick: f, disabled: s.required && !a, children: t.confirm })
603
610
  ] })
604
611
  ] });
605
612
  }, Yt = ({ children: t }) => {
606
- const [e, n] = p(!1), [o, s] = p(""), a = M(() => {
607
- }), d = m((g) => {
608
- s(g), n(!0), console.log("showprompt");
609
- }, []), l = m(() => {
613
+ const [e, n] = p(!1), [o, s] = p(""), [a, u] = p({ input: "textarea", type: "text" }), l = M(() => {
614
+ }), f = g((v) => {
615
+ s(v), n(!0), console.log("showprompt");
616
+ }, []), h = g(() => {
610
617
  n(!1);
611
- }, []), f = W(() => ({ isShown: e, text: o, showPrompt: d, hidePrompt: l, resolveRef: a }), [l, e, d, o, a]);
612
- return /* @__PURE__ */ r.jsxs(ct.Provider, { value: f, children: [
618
+ }, []), d = R(() => ({
619
+ isShown: e,
620
+ text: o,
621
+ showPrompt: f,
622
+ hidePrompt: h,
623
+ resolveRef: l,
624
+ options: a,
625
+ setOptions: u
626
+ }), [e, o, f, h, a]);
627
+ return /* @__PURE__ */ r.jsxs(We.Provider, { value: d, children: [
613
628
  t,
614
629
  /* @__PURE__ */ r.jsx(Xt, {})
615
630
  ] });
616
631
  }, Jt = ({ children: t }) => {
617
- const [e, n] = p(!1), [o, s] = p(""), a = m((f) => {
632
+ const [e, n] = p(!1), [o, s] = p(""), a = g((f) => {
618
633
  n(!0), s(f);
619
- }, []), d = m(() => {
634
+ }, []), u = g(() => {
620
635
  n(!1);
621
- }, []), l = W(() => ({ show: e, text: o, showConfirm: a, hideConfirm: d }), [e, o, a, d]);
636
+ }, []), l = R(() => ({ show: e, text: o, showConfirm: a, hideConfirm: u }), [e, o, a, u]);
622
637
  return /* @__PURE__ */ r.jsxs(ut.Provider, { value: l, children: [
623
638
  /* @__PURE__ */ r.jsx(Qt, {}),
624
639
  t
625
640
  ] });
626
- }, rn = ({ cookieDomain: t, axiosInstance: e, LinkComponent: n, language: o, axiosTexts: s, confirmTexts: a, formValidationTexts: d, homeDashboardTexts: l, formSubmitTexts: f, appSearchTexts: g, children: u }) => {
627
- const w = W(() => ({
641
+ }, rn = ({ cookieDomain: t, axiosInstance: e, LinkComponent: n, language: o, axiosTexts: s, confirmTexts: a, formValidationTexts: u, homeDashboardTexts: l, formSubmitTexts: f, appSearchTexts: h, children: d }) => {
642
+ const v = R(() => ({
628
643
  axiosInstance: e,
629
644
  cookieDomain: t,
630
645
  LinkComponent: n,
631
646
  language: o,
632
647
  axiosTexts: s,
633
648
  confirmTexts: a,
634
- formValidationTexts: d,
649
+ formValidationTexts: u,
635
650
  homeDashboardTexts: l,
636
651
  formSubmitTexts: f,
637
- appSearchTexts: g
652
+ appSearchTexts: h
638
653
  }), [
639
654
  e,
640
655
  t,
@@ -642,49 +657,49 @@ const N = Object.assign(Ve, {
642
657
  o,
643
658
  s,
644
659
  a,
645
- d,
660
+ u,
646
661
  l,
647
662
  f,
648
- g
663
+ h
649
664
  ]);
650
- return /* @__PURE__ */ r.jsx(Ee.Provider, { value: w, children: /* @__PURE__ */ r.jsx(Jt, { children: /* @__PURE__ */ r.jsxs(Yt, { children: [
665
+ return /* @__PURE__ */ r.jsx(Ee.Provider, { value: v, children: /* @__PURE__ */ r.jsx(Jt, { children: /* @__PURE__ */ r.jsxs(Yt, { children: [
651
666
  /* @__PURE__ */ r.jsx(ft, {}),
652
- u
667
+ d
653
668
  ] }) }) });
654
669
  }, an = ({ children: t }) => {
655
- const [e, n] = p(!1), [o] = p(/* @__PURE__ */ new Set()), s = m((l) => {
670
+ const [e, n] = p(!1), [o] = p(/* @__PURE__ */ new Set()), s = g((l) => {
656
671
  o.add(l), n(!0);
657
- }, [o]), a = m((l) => {
672
+ }, [o]), a = g((l) => {
658
673
  o.delete(l), o.size === 0 && n(!1);
659
- }, [o]), d = W(() => ({ isLoading: e, startLoading: s, stopLoading: a }), [e, s, a]);
660
- return /* @__PURE__ */ r.jsxs(ht.Provider, { value: d, children: [
661
- e && /* @__PURE__ */ r.jsx(bt, {}),
674
+ }, [o]), u = R(() => ({ isLoading: e, startLoading: s, stopLoading: a }), [e, s, a]);
675
+ return /* @__PURE__ */ r.jsxs(ht.Provider, { value: u, children: [
676
+ e && /* @__PURE__ */ r.jsx(Et, {}),
662
677
  t
663
678
  ] });
664
679
  }, ln = ({ children: t }) => {
665
- const e = mt(), n = m(() => {
666
- const u = localStorage.getItem("user") ?? null;
667
- return u ? JSON.parse(u) : null;
668
- }, []), [o, s] = p(n()), a = m(async () => {
669
- let u = null;
670
- return await e.get("/user/detail").then((w) => {
671
- u = w.data;
680
+ const e = mt(), n = g(() => {
681
+ const d = localStorage.getItem("user") ?? null;
682
+ return d ? JSON.parse(d) : null;
683
+ }, []), [o, s] = p(n()), a = g(async () => {
684
+ let d = null;
685
+ return await e.get("/user/detail").then((v) => {
686
+ d = v.data;
672
687
  }).catch(() => {
673
- u = null;
674
- }), localStorage.setItem("user", JSON.stringify(u)), u;
675
- }, [e]), d = m(() => {
688
+ d = null;
689
+ }), localStorage.setItem("user", JSON.stringify(d)), d;
690
+ }, [e]), u = g(() => {
676
691
  localStorage.removeItem("user");
677
- }, []), l = m(async () => {
678
- const u = await a();
679
- return u ? (s(u), !0) : !1;
680
- }, [a]), f = m(() => {
681
- d(), s(null);
682
- }, [d]), g = W(() => ({ user: o, loginUser: l, logoutUser: f }), [o, l, f]);
692
+ }, []), l = g(async () => {
693
+ const d = await a();
694
+ return d ? (s(d), !0) : !1;
695
+ }, [a]), f = g(() => {
696
+ u(), s(null);
697
+ }, [u]), h = R(() => ({ user: o, loginUser: l, logoutUser: f }), [o, l, f]);
683
698
  return re(() => {
684
699
  s(n());
685
- }, [n]), /* @__PURE__ */ r.jsx(gt.Provider, { value: g, children: t });
700
+ }, [n]), /* @__PURE__ */ r.jsx(gt.Provider, { value: h, children: t });
686
701
  }, Qt = () => {
687
- const { confirmTexts: t } = be(Ee), { onConfirm: e, onCancel: n, text: o, show: s } = xt();
702
+ const { confirmTexts: t } = ae(Ee), { onConfirm: e, onCancel: n, text: o, show: s } = xt();
688
703
  return /* @__PURE__ */ r.jsx(N, { show: s, size: "sm", centered: !0, onHide: n, children: /* @__PURE__ */ r.jsxs(N.Body, { children: [
689
704
  /* @__PURE__ */ r.jsx("div", { className: "mb-5 text-center", children: /* @__PURE__ */ r.jsx(wt, { variant: "h6", children: o }) }),
690
705
  /* @__PURE__ */ r.jsxs("div", { className: "w-100 d-flex gap-5", children: [