@tencentcloud/chat-uikit-react 3.0.3 → 3.4.2

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 (113) hide show
  1. package/.eslintrc.cjs +5 -4
  2. package/CHANGELOG.md +9 -0
  3. package/dist/components/Chat/Chat.d.ts +1 -1
  4. package/dist/components/Chat/Chat.js +18 -23
  5. package/dist/components/ChatHeader/AudioCallPicker/AudioCallPicker.d.ts +30 -0
  6. package/dist/components/ChatHeader/AudioCallPicker/AudioCallPicker.js +135 -0
  7. package/dist/components/ChatHeader/AudioCallPicker/index.d.ts +1 -0
  8. package/dist/components/ChatHeader/AudioCallPicker/index.js +4 -0
  9. package/dist/components/ChatHeader/ChatHeader.d.ts +6 -0
  10. package/dist/components/ChatHeader/ChatHeader.js +43 -41
  11. package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.d.ts +12 -7
  12. package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.js +47 -65
  13. package/dist/components/ChatHeader/VideoCallPicker/VideoCallPicker.d.ts +30 -0
  14. package/dist/components/ChatHeader/VideoCallPicker/VideoCallPicker.js +135 -0
  15. package/dist/components/ChatHeader/VideoCallPicker/index.d.ts +1 -0
  16. package/dist/components/ChatHeader/VideoCallPicker/index.js +4 -0
  17. package/dist/components/ChatHeader/index.d.ts +2 -1
  18. package/dist/components/ChatHeader/index.js +4 -2
  19. package/dist/components/Checkbox/index.js +1 -1
  20. package/dist/components/Modal/Modal.js +1 -1
  21. package/dist/components/Model/index.js +1 -1
  22. package/dist/components/Plugins/index.js +1 -1
  23. package/dist/components/Popup/index.js +1 -1
  24. package/dist/components/PopupNew/Popup.js +1 -1
  25. package/dist/components/Profile/Profile.js +20 -22
  26. package/dist/components/Profile/ProfileDefault.d.ts +3 -2
  27. package/dist/components/Profile/ProfileDefault.js +55 -56
  28. package/dist/components/Profile/hooks/useMyProfile.d.ts +2 -3
  29. package/dist/components/Profile/hooks/useMyProfile.js +1 -1
  30. package/dist/components/Profile/myProfile/MyProfile.d.ts +1 -1
  31. package/dist/components/Profile/myProfile/MyProfile.js +12 -16
  32. package/dist/components/index.js +27 -25
  33. package/dist/context/ChatContext.d.ts +1 -1
  34. package/dist/context/ChatContext.js +11 -16
  35. package/dist/context/ContactContext.d.ts +1 -1
  36. package/dist/external_modules/mui-BhvHeL5-.js +2253 -0
  37. package/dist/hooks/index.d.ts +2 -2
  38. package/dist/hooks/index.js +2 -2
  39. package/dist/{states/ChatHeaderState.d.ts → hooks/useChatHeader.d.ts} +6 -6
  40. package/dist/hooks/useChatHeader.js +41 -0
  41. package/dist/index-UBuvRM8r-DTXQB6zV.js +34000 -0
  42. package/dist/index.d.ts +3 -1
  43. package/dist/index.js +93 -4133
  44. package/dist/server/mainServer.js +2 -2
  45. package/dist/states/UIManagerState.d.ts +5 -5
  46. package/dist/states/UIManagerState.js +2 -2
  47. package/dist/states/index.d.ts +0 -1
  48. package/dist/states/index.js +2 -4
  49. package/dist/styles/AudioCallPicker.css +1 -0
  50. package/dist/styles/ChatHeaderUI.css +1 -1
  51. package/dist/styles/VideoCallPicker.css +1 -0
  52. package/dist/styles/index-UBuvRM8r.css +1 -0
  53. package/dist/styles/index.css +1 -1
  54. package/dist/styles/index2.css +1 -1
  55. package/dist/styles/index3.css +1 -1
  56. package/dist/styles/index4.css +1 -1
  57. package/dist/styles/index5.css +1 -1
  58. package/dist/types/message.d.ts +1 -1
  59. package/dist/types/user.d.ts +4 -4
  60. package/package.json +12 -20
  61. package/src/components/ChatHeader/AudioCallPicker/AudioCallPicker.module.scss +57 -0
  62. package/src/components/ChatHeader/AudioCallPicker/AudioCallPicker.tsx +234 -0
  63. package/src/components/ChatHeader/AudioCallPicker/index.ts +1 -0
  64. package/src/components/ChatHeader/ChatHeader.tsx +15 -3
  65. package/src/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.tsx +29 -36
  66. package/src/components/ChatHeader/VideoCallPicker/VideoCallPicker.module.scss +57 -0
  67. package/src/components/ChatHeader/VideoCallPicker/VideoCallPicker.tsx +233 -0
  68. package/src/components/ChatHeader/VideoCallPicker/index.ts +1 -0
  69. package/src/components/ChatHeader/index.ts +2 -1
  70. package/src/components/Profile/Profile.tsx +7 -6
  71. package/src/components/Profile/ProfileDefault.tsx +8 -8
  72. package/src/components/Profile/hooks/useMyProfile.tsx +2 -3
  73. package/src/components/Profile/myProfile/MyProfile.tsx +1 -1
  74. package/src/context/ChatContext.tsx +1 -1
  75. package/src/context/ContactContext.tsx +1 -1
  76. package/src/hooks/index.ts +2 -2
  77. package/src/{states/ChatHeaderState.ts → hooks/useChatHeader.ts} +15 -17
  78. package/src/index.ts +3 -5
  79. package/src/server/mainServer.ts +2 -2
  80. package/src/states/UIManagerState.ts +9 -9
  81. package/src/states/index.ts +0 -2
  82. package/src/styles/index.scss +0 -1
  83. package/src/types/message.ts +1 -1
  84. package/src/types/user.ts +4 -4
  85. package/vite.config.ts +4 -25
  86. package/dist/ChatSetting-LYkP2NWu.js +0 -29890
  87. package/dist/assets/fonts/iconfont.ttf +0 -0
  88. package/dist/assets/fonts/iconfont.woff +0 -0
  89. package/dist/assets/fonts/iconfont.woff2 +0 -0
  90. package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.d.ts +0 -11
  91. package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.js +0 -79
  92. package/dist/components/ChatHeader/ChatHeaderActions/index.d.ts +0 -1
  93. package/dist/components/ChatHeader/ChatHeaderActions/index.js +0 -4
  94. package/dist/components/IconFont/Icon.d.ts +0 -21
  95. package/dist/components/IconFont/Icon.js +0 -47
  96. package/dist/components/IconFont/index.d.ts +0 -2
  97. package/dist/components/IconFont/index.js +0 -4
  98. package/dist/external_modules/lodash-vwDjcXxQ.js +0 -0
  99. package/dist/external_modules/mui-BcA3SBHM.js +0 -2473
  100. package/dist/states/ChatHeaderState.js +0 -46
  101. package/dist/styles/ChatHeaderActions.css +0 -1
  102. package/dist/styles/ChatSetting.css +0 -1
  103. package/dist/styles/Icon2.css +0 -1
  104. package/src/assets/fonts/iconfont.ttf +0 -0
  105. package/src/assets/fonts/iconfont.woff +0 -0
  106. package/src/assets/fonts/iconfont.woff2 +0 -0
  107. package/src/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.module.scss +0 -44
  108. package/src/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.tsx +0 -105
  109. package/src/components/ChatHeader/ChatHeaderActions/index.ts +0 -1
  110. package/src/components/IconFont/Icon.module.scss +0 -42
  111. package/src/components/IconFont/Icon.tsx +0 -68
  112. package/src/components/IconFont/index.ts +0 -3
  113. package/src/styles/fonts/icon-font.scss +0 -18
@@ -1,2473 +0,0 @@
1
- import * as m from "react";
2
- import { useLayoutEffect as Dt } from "react";
3
- import { P as u } from "./react-vendors-3raCpd-g.js";
4
- import * as rt from "react-dom";
5
- import { jsx as U, jsxs as st } from "react/jsx-runtime";
6
- const ue = Math.min, G = Math.max, fe = Math.round, le = Math.floor, j = (e) => ({
7
- x: e,
8
- y: e
9
- }), Mt = {
10
- left: "right",
11
- right: "left",
12
- bottom: "top",
13
- top: "bottom"
14
- }, Ft = {
15
- start: "end",
16
- end: "start"
17
- };
18
- function _e(e, t, o) {
19
- return G(e, ue(t, o));
20
- }
21
- function Ee(e, t) {
22
- return typeof e == "function" ? e(t) : e;
23
- }
24
- function Z(e) {
25
- return e.split("-")[0];
26
- }
27
- function ve(e) {
28
- return e.split("-")[1];
29
- }
30
- function it(e) {
31
- return e === "x" ? "y" : "x";
32
- }
33
- function ct(e) {
34
- return e === "y" ? "height" : "width";
35
- }
36
- const Lt = /* @__PURE__ */ new Set(["top", "bottom"]);
37
- function z(e) {
38
- return Lt.has(Z(e)) ? "y" : "x";
39
- }
40
- function lt(e) {
41
- return it(z(e));
42
- }
43
- function Vt(e, t, o) {
44
- o === void 0 && (o = !1);
45
- const n = ve(e), r = lt(e), s = ct(r);
46
- let i = r === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
47
- return t.reference[s] > t.floating[s] && (i = de(i)), [i, de(i)];
48
- }
49
- function It(e) {
50
- const t = de(e);
51
- return [Se(e), t, Se(t)];
52
- }
53
- function Se(e) {
54
- return e.replace(/start|end/g, (t) => Ft[t]);
55
- }
56
- const We = ["left", "right"], Ue = ["right", "left"], Bt = ["top", "bottom"], $t = ["bottom", "top"];
57
- function _t(e, t, o) {
58
- switch (e) {
59
- case "top":
60
- case "bottom":
61
- return o ? t ? Ue : We : t ? We : Ue;
62
- case "left":
63
- case "right":
64
- return t ? Bt : $t;
65
- default:
66
- return [];
67
- }
68
- }
69
- function Wt(e, t, o, n) {
70
- const r = ve(e);
71
- let s = _t(Z(e), o === "start", n);
72
- return r && (s = s.map((i) => i + "-" + r), t && (s = s.concat(s.map(Se)))), s;
73
- }
74
- function de(e) {
75
- return e.replace(/left|right|bottom|top/g, (t) => Mt[t]);
76
- }
77
- function Ut(e) {
78
- return {
79
- top: 0,
80
- right: 0,
81
- bottom: 0,
82
- left: 0,
83
- ...e
84
- };
85
- }
86
- function jt(e) {
87
- return typeof e != "number" ? Ut(e) : {
88
- top: e,
89
- right: e,
90
- bottom: e,
91
- left: e
92
- };
93
- }
94
- function pe(e) {
95
- const {
96
- x: t,
97
- y: o,
98
- width: n,
99
- height: r
100
- } = e;
101
- return {
102
- width: n,
103
- height: r,
104
- top: o,
105
- left: t,
106
- right: t + n,
107
- bottom: o + r,
108
- x: t,
109
- y: o
110
- };
111
- }
112
- function je(e, t, o) {
113
- let {
114
- reference: n,
115
- floating: r
116
- } = e;
117
- const s = z(t), i = lt(t), c = ct(i), l = Z(t), a = s === "y", f = n.x + n.width / 2 - r.width / 2, d = n.y + n.height / 2 - r.height / 2, h = n[c] / 2 - r[c] / 2;
118
- let p;
119
- switch (l) {
120
- case "top":
121
- p = {
122
- x: f,
123
- y: n.y - r.height
124
- };
125
- break;
126
- case "bottom":
127
- p = {
128
- x: f,
129
- y: n.y + n.height
130
- };
131
- break;
132
- case "right":
133
- p = {
134
- x: n.x + n.width,
135
- y: d
136
- };
137
- break;
138
- case "left":
139
- p = {
140
- x: n.x - r.width,
141
- y: d
142
- };
143
- break;
144
- default:
145
- p = {
146
- x: n.x,
147
- y: n.y
148
- };
149
- }
150
- switch (ve(t)) {
151
- case "start":
152
- p[i] -= h * (o && a ? -1 : 1);
153
- break;
154
- case "end":
155
- p[i] += h * (o && a ? -1 : 1);
156
- break;
157
- }
158
- return p;
159
- }
160
- const Kt = async (e, t, o) => {
161
- const {
162
- placement: n = "bottom",
163
- strategy: r = "absolute",
164
- middleware: s = [],
165
- platform: i
166
- } = o, c = s.filter(Boolean), l = await (i.isRTL == null ? void 0 : i.isRTL(t));
167
- let a = await i.getElementRects({
168
- reference: e,
169
- floating: t,
170
- strategy: r
171
- }), {
172
- x: f,
173
- y: d
174
- } = je(a, n, l), h = n, p = {}, g = 0;
175
- for (let E = 0; E < c.length; E++) {
176
- const {
177
- name: T,
178
- fn: w
179
- } = c[E], {
180
- x: R,
181
- y: x,
182
- data: N,
183
- reset: v
184
- } = await w({
185
- x: f,
186
- y: d,
187
- initialPlacement: n,
188
- placement: h,
189
- strategy: r,
190
- middlewareData: p,
191
- rects: a,
192
- platform: i,
193
- elements: {
194
- reference: e,
195
- floating: t
196
- }
197
- });
198
- f = R ?? f, d = x ?? d, p = {
199
- ...p,
200
- [T]: {
201
- ...p[T],
202
- ...N
203
- }
204
- }, v && g <= 50 && (g++, typeof v == "object" && (v.placement && (h = v.placement), v.rects && (a = v.rects === !0 ? await i.getElementRects({
205
- reference: e,
206
- floating: t,
207
- strategy: r
208
- }) : v.rects), {
209
- x: f,
210
- y: d
211
- } = je(a, h, l)), E = -1);
212
- }
213
- return {
214
- x: f,
215
- y: d,
216
- placement: h,
217
- strategy: r,
218
- middlewareData: p
219
- };
220
- };
221
- async function at(e, t) {
222
- var o;
223
- t === void 0 && (t = {});
224
- const {
225
- x: n,
226
- y: r,
227
- platform: s,
228
- rects: i,
229
- elements: c,
230
- strategy: l
231
- } = e, {
232
- boundary: a = "clippingAncestors",
233
- rootBoundary: f = "viewport",
234
- elementContext: d = "floating",
235
- altBoundary: h = !1,
236
- padding: p = 0
237
- } = Ee(t, e), g = jt(p), T = c[h ? d === "floating" ? "reference" : "floating" : d], w = pe(await s.getClippingRect({
238
- element: (o = await (s.isElement == null ? void 0 : s.isElement(T))) == null || o ? T : T.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(c.floating)),
239
- boundary: a,
240
- rootBoundary: f,
241
- strategy: l
242
- })), R = d === "floating" ? {
243
- x: n,
244
- y: r,
245
- width: i.floating.width,
246
- height: i.floating.height
247
- } : i.reference, x = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), N = await (s.isElement == null ? void 0 : s.isElement(x)) ? await (s.getScale == null ? void 0 : s.getScale(x)) || {
248
- x: 1,
249
- y: 1
250
- } : {
251
- x: 1,
252
- y: 1
253
- }, v = pe(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
254
- elements: c,
255
- rect: R,
256
- offsetParent: x,
257
- strategy: l
258
- }) : R);
259
- return {
260
- top: (w.top - v.top + g.top) / N.y,
261
- bottom: (v.bottom - w.bottom + g.bottom) / N.y,
262
- left: (w.left - v.left + g.left) / N.x,
263
- right: (v.right - w.right + g.right) / N.x
264
- };
265
- }
266
- const qt = function(e) {
267
- return e === void 0 && (e = {}), {
268
- name: "flip",
269
- options: e,
270
- async fn(t) {
271
- var o, n;
272
- const {
273
- placement: r,
274
- middlewareData: s,
275
- rects: i,
276
- initialPlacement: c,
277
- platform: l,
278
- elements: a
279
- } = t, {
280
- mainAxis: f = !0,
281
- crossAxis: d = !0,
282
- fallbackPlacements: h,
283
- fallbackStrategy: p = "bestFit",
284
- fallbackAxisSideDirection: g = "none",
285
- flipAlignment: E = !0,
286
- ...T
287
- } = Ee(e, t);
288
- if ((o = s.arrow) != null && o.alignmentOffset)
289
- return {};
290
- const w = Z(r), R = z(c), x = Z(c) === c, N = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), v = h || (x || !E ? [de(c)] : It(c)), D = g !== "none";
291
- !h && D && v.push(...Wt(c, E, g, N));
292
- const S = [c, ...v], M = await at(t, T), k = [];
293
- let L = ((n = s.flip) == null ? void 0 : n.overflows) || [];
294
- if (f && k.push(M[w]), d) {
295
- const F = Vt(r, i, N);
296
- k.push(M[F[0]], M[F[1]]);
297
- }
298
- if (L = [...L, {
299
- placement: r,
300
- overflows: k
301
- }], !k.every((F) => F <= 0)) {
302
- var y, b;
303
- const F = (((y = s.flip) == null ? void 0 : y.index) || 0) + 1, B = S[F];
304
- if (B && (!(d === "alignment" ? R !== z(B) : !1) || // We leave the current main axis only if every placement on that axis
305
- // overflows the main axis.
306
- L.every((O) => z(O.placement) === R ? O.overflows[0] > 0 : !0)))
307
- return {
308
- data: {
309
- index: F,
310
- overflows: L
311
- },
312
- reset: {
313
- placement: B
314
- }
315
- };
316
- let P = (b = L.filter((A) => A.overflows[0] <= 0).sort((A, O) => A.overflows[1] - O.overflows[1])[0]) == null ? void 0 : b.placement;
317
- if (!P)
318
- switch (p) {
319
- case "bestFit": {
320
- var C;
321
- const A = (C = L.filter((O) => {
322
- if (D) {
323
- const V = z(O.placement);
324
- return V === R || // Create a bias to the `y` side axis due to horizontal
325
- // reading directions favoring greater width.
326
- V === "y";
327
- }
328
- return !0;
329
- }).map((O) => [O.placement, O.overflows.filter((V) => V > 0).reduce((V, $) => V + $, 0)]).sort((O, V) => O[1] - V[1])[0]) == null ? void 0 : C[0];
330
- A && (P = A);
331
- break;
332
- }
333
- case "initialPlacement":
334
- P = c;
335
- break;
336
- }
337
- if (r !== P)
338
- return {
339
- reset: {
340
- placement: P
341
- }
342
- };
343
- }
344
- return {};
345
- }
346
- };
347
- }, zt = /* @__PURE__ */ new Set(["left", "top"]);
348
- async function Yt(e, t) {
349
- const {
350
- placement: o,
351
- platform: n,
352
- elements: r
353
- } = e, s = await (n.isRTL == null ? void 0 : n.isRTL(r.floating)), i = Z(o), c = ve(o), l = z(o) === "y", a = zt.has(i) ? -1 : 1, f = s && l ? -1 : 1, d = Ee(t, e);
354
- let {
355
- mainAxis: h,
356
- crossAxis: p,
357
- alignmentAxis: g
358
- } = typeof d == "number" ? {
359
- mainAxis: d,
360
- crossAxis: 0,
361
- alignmentAxis: null
362
- } : {
363
- mainAxis: d.mainAxis || 0,
364
- crossAxis: d.crossAxis || 0,
365
- alignmentAxis: d.alignmentAxis
366
- };
367
- return c && typeof g == "number" && (p = c === "end" ? g * -1 : g), l ? {
368
- x: p * f,
369
- y: h * a
370
- } : {
371
- x: h * a,
372
- y: p * f
373
- };
374
- }
375
- const Xt = function(e) {
376
- return e === void 0 && (e = 0), {
377
- name: "offset",
378
- options: e,
379
- async fn(t) {
380
- var o, n;
381
- const {
382
- x: r,
383
- y: s,
384
- placement: i,
385
- middlewareData: c
386
- } = t, l = await Yt(t, e);
387
- return i === ((o = c.offset) == null ? void 0 : o.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
388
- x: r + l.x,
389
- y: s + l.y,
390
- data: {
391
- ...l,
392
- placement: i
393
- }
394
- };
395
- }
396
- };
397
- }, Gt = function(e) {
398
- return e === void 0 && (e = {}), {
399
- name: "shift",
400
- options: e,
401
- async fn(t) {
402
- const {
403
- x: o,
404
- y: n,
405
- placement: r
406
- } = t, {
407
- mainAxis: s = !0,
408
- crossAxis: i = !1,
409
- limiter: c = {
410
- fn: (T) => {
411
- let {
412
- x: w,
413
- y: R
414
- } = T;
415
- return {
416
- x: w,
417
- y: R
418
- };
419
- }
420
- },
421
- ...l
422
- } = Ee(e, t), a = {
423
- x: o,
424
- y: n
425
- }, f = await at(t, l), d = z(Z(r)), h = it(d);
426
- let p = a[h], g = a[d];
427
- if (s) {
428
- const T = h === "y" ? "top" : "left", w = h === "y" ? "bottom" : "right", R = p + f[T], x = p - f[w];
429
- p = _e(R, p, x);
430
- }
431
- if (i) {
432
- const T = d === "y" ? "top" : "left", w = d === "y" ? "bottom" : "right", R = g + f[T], x = g - f[w];
433
- g = _e(R, g, x);
434
- }
435
- const E = c.fn({
436
- ...t,
437
- [h]: p,
438
- [d]: g
439
- });
440
- return {
441
- ...E,
442
- data: {
443
- x: E.x - o,
444
- y: E.y - n,
445
- enabled: {
446
- [h]: s,
447
- [d]: i
448
- }
449
- }
450
- };
451
- }
452
- };
453
- };
454
- function Re() {
455
- return typeof window < "u";
456
- }
457
- function te(e) {
458
- return ut(e) ? (e.nodeName || "").toLowerCase() : "#document";
459
- }
460
- function I(e) {
461
- var t;
462
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
463
- }
464
- function q(e) {
465
- var t;
466
- return (t = (ut(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
467
- }
468
- function ut(e) {
469
- return Re() ? e instanceof Node || e instanceof I(e).Node : !1;
470
- }
471
- function _(e) {
472
- return Re() ? e instanceof Element || e instanceof I(e).Element : !1;
473
- }
474
- function K(e) {
475
- return Re() ? e instanceof HTMLElement || e instanceof I(e).HTMLElement : !1;
476
- }
477
- function Ke(e) {
478
- return !Re() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof I(e).ShadowRoot;
479
- }
480
- const Zt = /* @__PURE__ */ new Set(["inline", "contents"]);
481
- function ie(e) {
482
- const {
483
- overflow: t,
484
- overflowX: o,
485
- overflowY: n,
486
- display: r
487
- } = W(e);
488
- return /auto|scroll|overlay|hidden|clip/.test(t + n + o) && !Zt.has(r);
489
- }
490
- const Jt = /* @__PURE__ */ new Set(["table", "td", "th"]);
491
- function Qt(e) {
492
- return Jt.has(te(e));
493
- }
494
- const Ht = [":popover-open", ":modal"];
495
- function Te(e) {
496
- return Ht.some((t) => {
497
- try {
498
- return e.matches(t);
499
- } catch {
500
- return !1;
501
- }
502
- });
503
- }
504
- const en = ["transform", "translate", "scale", "rotate", "perspective"], tn = ["transform", "translate", "scale", "rotate", "perspective", "filter"], nn = ["paint", "layout", "strict", "content"];
505
- function De(e) {
506
- const t = Me(), o = _(e) ? W(e) : e;
507
- return en.some((n) => o[n] ? o[n] !== "none" : !1) || (o.containerType ? o.containerType !== "normal" : !1) || !t && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !t && (o.filter ? o.filter !== "none" : !1) || tn.some((n) => (o.willChange || "").includes(n)) || nn.some((n) => (o.contain || "").includes(n));
508
- }
509
- function on(e) {
510
- let t = Y(e);
511
- for (; K(t) && !ee(t); ) {
512
- if (De(t))
513
- return t;
514
- if (Te(t))
515
- return null;
516
- t = Y(t);
517
- }
518
- return null;
519
- }
520
- function Me() {
521
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
522
- }
523
- const rn = /* @__PURE__ */ new Set(["html", "body", "#document"]);
524
- function ee(e) {
525
- return rn.has(te(e));
526
- }
527
- function W(e) {
528
- return I(e).getComputedStyle(e);
529
- }
530
- function Ne(e) {
531
- return _(e) ? {
532
- scrollLeft: e.scrollLeft,
533
- scrollTop: e.scrollTop
534
- } : {
535
- scrollLeft: e.scrollX,
536
- scrollTop: e.scrollY
537
- };
538
- }
539
- function Y(e) {
540
- if (te(e) === "html")
541
- return e;
542
- const t = (
543
- // Step into the shadow DOM of the parent of a slotted node.
544
- e.assignedSlot || // DOM Element detected.
545
- e.parentNode || // ShadowRoot detected.
546
- Ke(e) && e.host || // Fallback.
547
- q(e)
548
- );
549
- return Ke(t) ? t.host : t;
550
- }
551
- function ft(e) {
552
- const t = Y(e);
553
- return ee(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : K(t) && ie(t) ? t : ft(t);
554
- }
555
- function re(e, t, o) {
556
- var n;
557
- t === void 0 && (t = []), o === void 0 && (o = !0);
558
- const r = ft(e), s = r === ((n = e.ownerDocument) == null ? void 0 : n.body), i = I(r);
559
- if (s) {
560
- const c = ke(i);
561
- return t.concat(i, i.visualViewport || [], ie(r) ? r : [], c && o ? re(c) : []);
562
- }
563
- return t.concat(r, re(r, [], o));
564
- }
565
- function ke(e) {
566
- return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
567
- }
568
- function dt(e) {
569
- const t = W(e);
570
- let o = parseFloat(t.width) || 0, n = parseFloat(t.height) || 0;
571
- const r = K(e), s = r ? e.offsetWidth : o, i = r ? e.offsetHeight : n, c = fe(o) !== s || fe(n) !== i;
572
- return c && (o = s, n = i), {
573
- width: o,
574
- height: n,
575
- $: c
576
- };
577
- }
578
- function Fe(e) {
579
- return _(e) ? e : e.contextElement;
580
- }
581
- function H(e) {
582
- const t = Fe(e);
583
- if (!K(t))
584
- return j(1);
585
- const o = t.getBoundingClientRect(), {
586
- width: n,
587
- height: r,
588
- $: s
589
- } = dt(t);
590
- let i = (s ? fe(o.width) : o.width) / n, c = (s ? fe(o.height) : o.height) / r;
591
- return (!i || !Number.isFinite(i)) && (i = 1), (!c || !Number.isFinite(c)) && (c = 1), {
592
- x: i,
593
- y: c
594
- };
595
- }
596
- const sn = /* @__PURE__ */ j(0);
597
- function pt(e) {
598
- const t = I(e);
599
- return !Me() || !t.visualViewport ? sn : {
600
- x: t.visualViewport.offsetLeft,
601
- y: t.visualViewport.offsetTop
602
- };
603
- }
604
- function cn(e, t, o) {
605
- return t === void 0 && (t = !1), !o || t && o !== I(e) ? !1 : t;
606
- }
607
- function J(e, t, o, n) {
608
- t === void 0 && (t = !1), o === void 0 && (o = !1);
609
- const r = e.getBoundingClientRect(), s = Fe(e);
610
- let i = j(1);
611
- t && (n ? _(n) && (i = H(n)) : i = H(e));
612
- const c = cn(s, o, n) ? pt(s) : j(0);
613
- let l = (r.left + c.x) / i.x, a = (r.top + c.y) / i.y, f = r.width / i.x, d = r.height / i.y;
614
- if (s) {
615
- const h = I(s), p = n && _(n) ? I(n) : n;
616
- let g = h, E = ke(g);
617
- for (; E && n && p !== g; ) {
618
- const T = H(E), w = E.getBoundingClientRect(), R = W(E), x = w.left + (E.clientLeft + parseFloat(R.paddingLeft)) * T.x, N = w.top + (E.clientTop + parseFloat(R.paddingTop)) * T.y;
619
- l *= T.x, a *= T.y, f *= T.x, d *= T.y, l += x, a += N, g = I(E), E = ke(g);
620
- }
621
- }
622
- return pe({
623
- width: f,
624
- height: d,
625
- x: l,
626
- y: a
627
- });
628
- }
629
- function Le(e, t) {
630
- const o = Ne(e).scrollLeft;
631
- return t ? t.left + o : J(q(e)).left + o;
632
- }
633
- function mt(e, t, o) {
634
- o === void 0 && (o = !1);
635
- const n = e.getBoundingClientRect(), r = n.left + t.scrollLeft - (o ? 0 : (
636
- // RTL <body> scrollbar.
637
- Le(e, n)
638
- )), s = n.top + t.scrollTop;
639
- return {
640
- x: r,
641
- y: s
642
- };
643
- }
644
- function ln(e) {
645
- let {
646
- elements: t,
647
- rect: o,
648
- offsetParent: n,
649
- strategy: r
650
- } = e;
651
- const s = r === "fixed", i = q(n), c = t ? Te(t.floating) : !1;
652
- if (n === i || c && s)
653
- return o;
654
- let l = {
655
- scrollLeft: 0,
656
- scrollTop: 0
657
- }, a = j(1);
658
- const f = j(0), d = K(n);
659
- if ((d || !d && !s) && ((te(n) !== "body" || ie(i)) && (l = Ne(n)), K(n))) {
660
- const p = J(n);
661
- a = H(n), f.x = p.x + n.clientLeft, f.y = p.y + n.clientTop;
662
- }
663
- const h = i && !d && !s ? mt(i, l, !0) : j(0);
664
- return {
665
- width: o.width * a.x,
666
- height: o.height * a.y,
667
- x: o.x * a.x - l.scrollLeft * a.x + f.x + h.x,
668
- y: o.y * a.y - l.scrollTop * a.y + f.y + h.y
669
- };
670
- }
671
- function an(e) {
672
- return Array.from(e.getClientRects());
673
- }
674
- function un(e) {
675
- const t = q(e), o = Ne(e), n = e.ownerDocument.body, r = G(t.scrollWidth, t.clientWidth, n.scrollWidth, n.clientWidth), s = G(t.scrollHeight, t.clientHeight, n.scrollHeight, n.clientHeight);
676
- let i = -o.scrollLeft + Le(e);
677
- const c = -o.scrollTop;
678
- return W(n).direction === "rtl" && (i += G(t.clientWidth, n.clientWidth) - r), {
679
- width: r,
680
- height: s,
681
- x: i,
682
- y: c
683
- };
684
- }
685
- function fn(e, t) {
686
- const o = I(e), n = q(e), r = o.visualViewport;
687
- let s = n.clientWidth, i = n.clientHeight, c = 0, l = 0;
688
- if (r) {
689
- s = r.width, i = r.height;
690
- const a = Me();
691
- (!a || a && t === "fixed") && (c = r.offsetLeft, l = r.offsetTop);
692
- }
693
- return {
694
- width: s,
695
- height: i,
696
- x: c,
697
- y: l
698
- };
699
- }
700
- const dn = /* @__PURE__ */ new Set(["absolute", "fixed"]);
701
- function pn(e, t) {
702
- const o = J(e, !0, t === "fixed"), n = o.top + e.clientTop, r = o.left + e.clientLeft, s = K(e) ? H(e) : j(1), i = e.clientWidth * s.x, c = e.clientHeight * s.y, l = r * s.x, a = n * s.y;
703
- return {
704
- width: i,
705
- height: c,
706
- x: l,
707
- y: a
708
- };
709
- }
710
- function qe(e, t, o) {
711
- let n;
712
- if (t === "viewport")
713
- n = fn(e, o);
714
- else if (t === "document")
715
- n = un(q(e));
716
- else if (_(t))
717
- n = pn(t, o);
718
- else {
719
- const r = pt(e);
720
- n = {
721
- x: t.x - r.x,
722
- y: t.y - r.y,
723
- width: t.width,
724
- height: t.height
725
- };
726
- }
727
- return pe(n);
728
- }
729
- function gt(e, t) {
730
- const o = Y(e);
731
- return o === t || !_(o) || ee(o) ? !1 : W(o).position === "fixed" || gt(o, t);
732
- }
733
- function mn(e, t) {
734
- const o = t.get(e);
735
- if (o)
736
- return o;
737
- let n = re(e, [], !1).filter((c) => _(c) && te(c) !== "body"), r = null;
738
- const s = W(e).position === "fixed";
739
- let i = s ? Y(e) : e;
740
- for (; _(i) && !ee(i); ) {
741
- const c = W(i), l = De(i);
742
- !l && c.position === "fixed" && (r = null), (s ? !l && !r : !l && c.position === "static" && !!r && dn.has(r.position) || ie(i) && !l && gt(e, i)) ? n = n.filter((f) => f !== i) : r = c, i = Y(i);
743
- }
744
- return t.set(e, n), n;
745
- }
746
- function gn(e) {
747
- let {
748
- element: t,
749
- boundary: o,
750
- rootBoundary: n,
751
- strategy: r
752
- } = e;
753
- const i = [...o === "clippingAncestors" ? Te(t) ? [] : mn(t, this._c) : [].concat(o), n], c = i[0], l = i.reduce((a, f) => {
754
- const d = qe(t, f, r);
755
- return a.top = G(d.top, a.top), a.right = ue(d.right, a.right), a.bottom = ue(d.bottom, a.bottom), a.left = G(d.left, a.left), a;
756
- }, qe(t, c, r));
757
- return {
758
- width: l.right - l.left,
759
- height: l.bottom - l.top,
760
- x: l.left,
761
- y: l.top
762
- };
763
- }
764
- function hn(e) {
765
- const {
766
- width: t,
767
- height: o
768
- } = dt(e);
769
- return {
770
- width: t,
771
- height: o
772
- };
773
- }
774
- function yn(e, t, o) {
775
- const n = K(t), r = q(t), s = o === "fixed", i = J(e, !0, s, t);
776
- let c = {
777
- scrollLeft: 0,
778
- scrollTop: 0
779
- };
780
- const l = j(0);
781
- function a() {
782
- l.x = Le(r);
783
- }
784
- if (n || !n && !s)
785
- if ((te(t) !== "body" || ie(r)) && (c = Ne(t)), n) {
786
- const p = J(t, !0, s, t);
787
- l.x = p.x + t.clientLeft, l.y = p.y + t.clientTop;
788
- } else r && a();
789
- s && !n && r && a();
790
- const f = r && !n && !s ? mt(r, c) : j(0), d = i.left + c.scrollLeft - l.x - f.x, h = i.top + c.scrollTop - l.y - f.y;
791
- return {
792
- x: d,
793
- y: h,
794
- width: i.width,
795
- height: i.height
796
- };
797
- }
798
- function Oe(e) {
799
- return W(e).position === "static";
800
- }
801
- function ze(e, t) {
802
- if (!K(e) || W(e).position === "fixed")
803
- return null;
804
- if (t)
805
- return t(e);
806
- let o = e.offsetParent;
807
- return q(e) === o && (o = o.ownerDocument.body), o;
808
- }
809
- function ht(e, t) {
810
- const o = I(e);
811
- if (Te(e))
812
- return o;
813
- if (!K(e)) {
814
- let r = Y(e);
815
- for (; r && !ee(r); ) {
816
- if (_(r) && !Oe(r))
817
- return r;
818
- r = Y(r);
819
- }
820
- return o;
821
- }
822
- let n = ze(e, t);
823
- for (; n && Qt(n) && Oe(n); )
824
- n = ze(n, t);
825
- return n && ee(n) && Oe(n) && !De(n) ? o : n || on(e) || o;
826
- }
827
- const bn = async function(e) {
828
- const t = this.getOffsetParent || ht, o = this.getDimensions, n = await o(e.floating);
829
- return {
830
- reference: yn(e.reference, await t(e.floating), e.strategy),
831
- floating: {
832
- x: 0,
833
- y: 0,
834
- width: n.width,
835
- height: n.height
836
- }
837
- };
838
- };
839
- function xn(e) {
840
- return W(e).direction === "rtl";
841
- }
842
- const wn = {
843
- convertOffsetParentRelativeRectToViewportRelativeRect: ln,
844
- getDocumentElement: q,
845
- getClippingRect: gn,
846
- getOffsetParent: ht,
847
- getElementRects: bn,
848
- getClientRects: an,
849
- getDimensions: hn,
850
- getScale: H,
851
- isElement: _,
852
- isRTL: xn
853
- };
854
- function yt(e, t) {
855
- return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
856
- }
857
- function En(e, t) {
858
- let o = null, n;
859
- const r = q(e);
860
- function s() {
861
- var c;
862
- clearTimeout(n), (c = o) == null || c.disconnect(), o = null;
863
- }
864
- function i(c, l) {
865
- c === void 0 && (c = !1), l === void 0 && (l = 1), s();
866
- const a = e.getBoundingClientRect(), {
867
- left: f,
868
- top: d,
869
- width: h,
870
- height: p
871
- } = a;
872
- if (c || t(), !h || !p)
873
- return;
874
- const g = le(d), E = le(r.clientWidth - (f + h)), T = le(r.clientHeight - (d + p)), w = le(f), x = {
875
- rootMargin: -g + "px " + -E + "px " + -T + "px " + -w + "px",
876
- threshold: G(0, ue(1, l)) || 1
877
- };
878
- let N = !0;
879
- function v(D) {
880
- const S = D[0].intersectionRatio;
881
- if (S !== l) {
882
- if (!N)
883
- return i();
884
- S ? i(!1, S) : n = setTimeout(() => {
885
- i(!1, 1e-7);
886
- }, 1e3);
887
- }
888
- S === 1 && !yt(a, e.getBoundingClientRect()) && i(), N = !1;
889
- }
890
- try {
891
- o = new IntersectionObserver(v, {
892
- ...x,
893
- // Handle <iframe>s
894
- root: r.ownerDocument
895
- });
896
- } catch {
897
- o = new IntersectionObserver(v, x);
898
- }
899
- o.observe(e);
900
- }
901
- return i(!0), s;
902
- }
903
- function Ye(e, t, o, n) {
904
- n === void 0 && (n = {});
905
- const {
906
- ancestorScroll: r = !0,
907
- ancestorResize: s = !0,
908
- elementResize: i = typeof ResizeObserver == "function",
909
- layoutShift: c = typeof IntersectionObserver == "function",
910
- animationFrame: l = !1
911
- } = n, a = Fe(e), f = r || s ? [...a ? re(a) : [], ...re(t)] : [];
912
- f.forEach((w) => {
913
- r && w.addEventListener("scroll", o, {
914
- passive: !0
915
- }), s && w.addEventListener("resize", o);
916
- });
917
- const d = a && c ? En(a, o) : null;
918
- let h = -1, p = null;
919
- i && (p = new ResizeObserver((w) => {
920
- let [R] = w;
921
- R && R.target === a && p && (p.unobserve(t), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
922
- var x;
923
- (x = p) == null || x.observe(t);
924
- })), o();
925
- }), a && !l && p.observe(a), p.observe(t));
926
- let g, E = l ? J(e) : null;
927
- l && T();
928
- function T() {
929
- const w = J(e);
930
- E && !yt(E, w) && o(), E = w, g = requestAnimationFrame(T);
931
- }
932
- return o(), () => {
933
- var w;
934
- f.forEach((R) => {
935
- r && R.removeEventListener("scroll", o), s && R.removeEventListener("resize", o);
936
- }), d == null || d(), (w = p) == null || w.disconnect(), p = null, l && cancelAnimationFrame(g);
937
- };
938
- }
939
- const vn = Xt, Rn = Gt, Tn = qt, Nn = (e, t, o) => {
940
- const n = /* @__PURE__ */ new Map(), r = {
941
- platform: wn,
942
- ...o
943
- }, s = {
944
- ...r.platform,
945
- _c: n
946
- };
947
- return Kt(e, t, {
948
- ...r,
949
- platform: s
950
- });
951
- };
952
- var Cn = typeof document < "u", On = function() {
953
- }, ae = Cn ? Dt : On;
954
- function me(e, t) {
955
- if (e === t)
956
- return !0;
957
- if (typeof e != typeof t)
958
- return !1;
959
- if (typeof e == "function" && e.toString() === t.toString())
960
- return !0;
961
- let o, n, r;
962
- if (e && t && typeof e == "object") {
963
- if (Array.isArray(e)) {
964
- if (o = e.length, o !== t.length) return !1;
965
- for (n = o; n-- !== 0; )
966
- if (!me(e[n], t[n]))
967
- return !1;
968
- return !0;
969
- }
970
- if (r = Object.keys(e), o = r.length, o !== Object.keys(t).length)
971
- return !1;
972
- for (n = o; n-- !== 0; )
973
- if (!{}.hasOwnProperty.call(t, r[n]))
974
- return !1;
975
- for (n = o; n-- !== 0; ) {
976
- const s = r[n];
977
- if (!(s === "_owner" && e.$$typeof) && !me(e[s], t[s]))
978
- return !1;
979
- }
980
- return !0;
981
- }
982
- return e !== e && t !== t;
983
- }
984
- function bt(e) {
985
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
986
- }
987
- function Xe(e, t) {
988
- const o = bt(e);
989
- return Math.round(t * o) / o;
990
- }
991
- function Pe(e) {
992
- const t = m.useRef(e);
993
- return ae(() => {
994
- t.current = e;
995
- }), t;
996
- }
997
- function Pn(e) {
998
- e === void 0 && (e = {});
999
- const {
1000
- placement: t = "bottom",
1001
- strategy: o = "absolute",
1002
- middleware: n = [],
1003
- platform: r,
1004
- elements: {
1005
- reference: s,
1006
- floating: i
1007
- } = {},
1008
- transform: c = !0,
1009
- whileElementsMounted: l,
1010
- open: a
1011
- } = e, [f, d] = m.useState({
1012
- x: 0,
1013
- y: 0,
1014
- strategy: o,
1015
- placement: t,
1016
- middlewareData: {},
1017
- isPositioned: !1
1018
- }), [h, p] = m.useState(n);
1019
- me(h, n) || p(n);
1020
- const [g, E] = m.useState(null), [T, w] = m.useState(null), R = m.useCallback((O) => {
1021
- O !== D.current && (D.current = O, E(O));
1022
- }, []), x = m.useCallback((O) => {
1023
- O !== S.current && (S.current = O, w(O));
1024
- }, []), N = s || g, v = i || T, D = m.useRef(null), S = m.useRef(null), M = m.useRef(f), k = l != null, L = Pe(l), y = Pe(r), b = Pe(a), C = m.useCallback(() => {
1025
- if (!D.current || !S.current)
1026
- return;
1027
- const O = {
1028
- placement: t,
1029
- strategy: o,
1030
- middleware: h
1031
- };
1032
- y.current && (O.platform = y.current), Nn(D.current, S.current, O).then((V) => {
1033
- const $ = {
1034
- ...V,
1035
- // The floating element's position may be recomputed while it's closed
1036
- // but still mounted (such as when transitioning out). To ensure
1037
- // `isPositioned` will be `false` initially on the next open, avoid
1038
- // setting it to `true` when `open === false` (must be specified).
1039
- isPositioned: b.current !== !1
1040
- };
1041
- F.current && !me(M.current, $) && (M.current = $, rt.flushSync(() => {
1042
- d($);
1043
- }));
1044
- });
1045
- }, [h, t, o, y, b]);
1046
- ae(() => {
1047
- a === !1 && M.current.isPositioned && (M.current.isPositioned = !1, d((O) => ({
1048
- ...O,
1049
- isPositioned: !1
1050
- })));
1051
- }, [a]);
1052
- const F = m.useRef(!1);
1053
- ae(() => (F.current = !0, () => {
1054
- F.current = !1;
1055
- }), []), ae(() => {
1056
- if (N && (D.current = N), v && (S.current = v), N && v) {
1057
- if (L.current)
1058
- return L.current(N, v, C);
1059
- C();
1060
- }
1061
- }, [N, v, C, L, k]);
1062
- const B = m.useMemo(() => ({
1063
- reference: D,
1064
- floating: S,
1065
- setReference: R,
1066
- setFloating: x
1067
- }), [R, x]), P = m.useMemo(() => ({
1068
- reference: N,
1069
- floating: v
1070
- }), [N, v]), A = m.useMemo(() => {
1071
- const O = {
1072
- position: o,
1073
- left: 0,
1074
- top: 0
1075
- };
1076
- if (!P.floating)
1077
- return O;
1078
- const V = Xe(P.floating, f.x), $ = Xe(P.floating, f.y);
1079
- return c ? {
1080
- ...O,
1081
- transform: "translate(" + V + "px, " + $ + "px)",
1082
- ...bt(P.floating) >= 1.5 && {
1083
- willChange: "transform"
1084
- }
1085
- } : {
1086
- position: o,
1087
- left: V,
1088
- top: $
1089
- };
1090
- }, [o, c, P.floating, f.x, f.y]);
1091
- return m.useMemo(() => ({
1092
- ...f,
1093
- update: C,
1094
- refs: B,
1095
- elements: P,
1096
- floatingStyles: A
1097
- }), [f, C, B, P, A]);
1098
- }
1099
- const Ge = (e, t) => ({
1100
- ...vn(e),
1101
- options: [e, t]
1102
- }), An = (e, t) => ({
1103
- ...Rn(e),
1104
- options: [e, t]
1105
- }), Sn = (e, t) => ({
1106
- ...Tn(e),
1107
- options: [e, t]
1108
- });
1109
- function xt(e, t) {
1110
- return process.env.NODE_ENV === "production" ? () => null : function(...n) {
1111
- return e(...n) || t(...n);
1112
- };
1113
- }
1114
- function kn(e) {
1115
- const {
1116
- prototype: t = {}
1117
- } = e;
1118
- return !!t.isReactComponent;
1119
- }
1120
- function wt(e, t, o, n, r) {
1121
- const s = e[t], i = r || t;
1122
- if (s == null || // When server-side rendering React doesn't warn either.
1123
- // This is not an accurate check for SSR.
1124
- // This is only in place for Emotion compat.
1125
- // TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
1126
- typeof window > "u")
1127
- return null;
1128
- let c;
1129
- const l = s.type;
1130
- return typeof l == "function" && !kn(l) && (c = "Did you accidentally use a plain function component for an element instead?"), c !== void 0 ? new Error(`Invalid ${n} \`${i}\` supplied to \`${o}\`. Expected an element that can hold a ref. ${c} For more information see https://mui.com/r/caveat-with-refs-guide`) : null;
1131
- }
1132
- const Ve = xt(u.element, wt);
1133
- Ve.isRequired = xt(u.element.isRequired, wt);
1134
- const Dn = "exact-prop: ​";
1135
- function Et(e) {
1136
- return process.env.NODE_ENV === "production" ? e : {
1137
- ...e,
1138
- [Dn]: (t) => {
1139
- const o = Object.keys(t).filter((n) => !e.hasOwnProperty(n));
1140
- return o.length > 0 ? new Error(`The following props are not supported: ${o.map((n) => `\`${n}\``).join(", ")}. Please remove them.`) : null;
1141
- }
1142
- };
1143
- }
1144
- function ge(e, t, o, n, r) {
1145
- if (process.env.NODE_ENV === "production")
1146
- return null;
1147
- const s = e[t], i = r || t;
1148
- return s == null ? null : s && s.nodeType !== 1 ? new Error(`Invalid ${n} \`${i}\` supplied to \`${o}\`. Expected an HTMLElement.`) : null;
1149
- }
1150
- function Ze(...e) {
1151
- return e.reduce((t, o) => o == null ? t : function(...r) {
1152
- t.apply(this, r), o.apply(this, r);
1153
- }, () => {
1154
- });
1155
- }
1156
- function Q(e) {
1157
- return e && e.ownerDocument || document;
1158
- }
1159
- function he(e) {
1160
- return Q(e).defaultView || window;
1161
- }
1162
- function Je(e, t) {
1163
- typeof e == "function" ? e(t) : e && (e.current = t);
1164
- }
1165
- const ye = typeof window < "u" ? m.useLayoutEffect : m.useEffect;
1166
- function Qe(e) {
1167
- const t = m.useRef(e);
1168
- return ye(() => {
1169
- t.current = e;
1170
- }), m.useRef((...o) => (
1171
- // @ts-expect-error hide `this`
1172
- (0, t.current)(...o)
1173
- )).current;
1174
- }
1175
- function ne(...e) {
1176
- const t = m.useRef(void 0), o = m.useCallback((n) => {
1177
- const r = e.map((s) => {
1178
- if (s == null)
1179
- return null;
1180
- if (typeof s == "function") {
1181
- const i = s, c = i(n);
1182
- return typeof c == "function" ? c : () => {
1183
- i(null);
1184
- };
1185
- }
1186
- return s.current = n, () => {
1187
- s.current = null;
1188
- };
1189
- });
1190
- return () => {
1191
- r.forEach((s) => s == null ? void 0 : s());
1192
- };
1193
- }, e);
1194
- return m.useMemo(() => e.every((n) => n == null) ? null : (n) => {
1195
- t.current && (t.current(), t.current = void 0), n != null && (t.current = o(n));
1196
- }, e);
1197
- }
1198
- function He(e) {
1199
- try {
1200
- return e.matches(":focus-visible");
1201
- } catch {
1202
- process.env.NODE_ENV !== "production" && !/jsdom/.test(window.navigator.userAgent) && console.warn(["MUI: The `:focus-visible` pseudo class is not supported in this browser.", "Some components rely on this feature to work properly."].join(`
1203
- `));
1204
- }
1205
- return !1;
1206
- }
1207
- function Mn(e = window) {
1208
- const t = e.document.documentElement.clientWidth;
1209
- return e.innerWidth - t;
1210
- }
1211
- function Ie(e, t, o = void 0) {
1212
- const n = {};
1213
- for (const r in e) {
1214
- const s = e[r];
1215
- let i = "", c = !0;
1216
- for (let l = 0; l < s.length; l += 1) {
1217
- const a = s[l];
1218
- a && (i += (c === !0 ? "" : " ") + t(a), c = !1, o && o[a] && (i += " " + o[a]));
1219
- }
1220
- n[r] = i;
1221
- }
1222
- return n;
1223
- }
1224
- const Fn = {
1225
- active: "active",
1226
- checked: "checked",
1227
- completed: "completed",
1228
- disabled: "disabled",
1229
- error: "error",
1230
- expanded: "expanded",
1231
- focused: "focused",
1232
- focusVisible: "focusVisible",
1233
- open: "open",
1234
- readOnly: "readOnly",
1235
- required: "required",
1236
- selected: "selected"
1237
- };
1238
- function Ln(e) {
1239
- return typeof e == "string";
1240
- }
1241
- function Vn(e, t, o) {
1242
- return e === void 0 || Ln(e) ? t : {
1243
- ...t,
1244
- ownerState: {
1245
- ...t.ownerState,
1246
- ...o
1247
- }
1248
- };
1249
- }
1250
- function vt(e) {
1251
- var t, o, n = "";
1252
- if (typeof e == "string" || typeof e == "number") n += e;
1253
- else if (typeof e == "object") if (Array.isArray(e)) {
1254
- var r = e.length;
1255
- for (t = 0; t < r; t++) e[t] && (o = vt(e[t])) && (n && (n += " "), n += o);
1256
- } else for (o in e) e[o] && (n && (n += " "), n += o);
1257
- return n;
1258
- }
1259
- function et() {
1260
- for (var e, t, o = 0, n = "", r = arguments.length; o < r; o++) (e = arguments[o]) && (t = vt(e)) && (n && (n += " "), n += t);
1261
- return n;
1262
- }
1263
- function be(e, t = []) {
1264
- if (e === void 0)
1265
- return {};
1266
- const o = {};
1267
- return Object.keys(e).filter((n) => n.match(/^on[A-Z]/) && typeof e[n] == "function" && !t.includes(n)).forEach((n) => {
1268
- o[n] = e[n];
1269
- }), o;
1270
- }
1271
- function tt(e) {
1272
- if (e === void 0)
1273
- return {};
1274
- const t = {};
1275
- return Object.keys(e).filter((o) => !(o.match(/^on[A-Z]/) && typeof e[o] == "function")).forEach((o) => {
1276
- t[o] = e[o];
1277
- }), t;
1278
- }
1279
- function In(e) {
1280
- const {
1281
- getSlotProps: t,
1282
- additionalProps: o,
1283
- externalSlotProps: n,
1284
- externalForwardedProps: r,
1285
- className: s
1286
- } = e;
1287
- if (!t) {
1288
- const p = et(o == null ? void 0 : o.className, s, r == null ? void 0 : r.className, n == null ? void 0 : n.className), g = {
1289
- ...o == null ? void 0 : o.style,
1290
- ...r == null ? void 0 : r.style,
1291
- ...n == null ? void 0 : n.style
1292
- }, E = {
1293
- ...o,
1294
- ...r,
1295
- ...n
1296
- };
1297
- return p.length > 0 && (E.className = p), Object.keys(g).length > 0 && (E.style = g), {
1298
- props: E,
1299
- internalRef: void 0
1300
- };
1301
- }
1302
- const i = be({
1303
- ...r,
1304
- ...n
1305
- }), c = tt(n), l = tt(r), a = t(i), f = et(a == null ? void 0 : a.className, o == null ? void 0 : o.className, s, r == null ? void 0 : r.className, n == null ? void 0 : n.className), d = {
1306
- ...a == null ? void 0 : a.style,
1307
- ...o == null ? void 0 : o.style,
1308
- ...r == null ? void 0 : r.style,
1309
- ...n == null ? void 0 : n.style
1310
- }, h = {
1311
- ...a,
1312
- ...o,
1313
- ...l,
1314
- ...c
1315
- };
1316
- return f.length > 0 && (h.className = f), Object.keys(d).length > 0 && (h.style = d), {
1317
- props: h,
1318
- internalRef: a.ref
1319
- };
1320
- }
1321
- function Bn(e, t, o) {
1322
- return typeof e == "function" ? e(t, o) : e;
1323
- }
1324
- function xe(e) {
1325
- var d;
1326
- const {
1327
- elementType: t,
1328
- externalSlotProps: o,
1329
- ownerState: n,
1330
- skipResolvingSlotProps: r = !1,
1331
- ...s
1332
- } = e, i = r ? {} : Bn(o, n), {
1333
- props: c,
1334
- internalRef: l
1335
- } = In({
1336
- ...s,
1337
- externalSlotProps: i
1338
- }), a = ne(l, i == null ? void 0 : i.ref, (d = e.additionalProps) == null ? void 0 : d.ref);
1339
- return Vn(t, {
1340
- ...c,
1341
- ref: a
1342
- }, n);
1343
- }
1344
- function Rt(e) {
1345
- var t;
1346
- return parseInt(m.version, 10) >= 19 ? ((t = e == null ? void 0 : e.props) == null ? void 0 : t.ref) || null : (e == null ? void 0 : e.ref) || null;
1347
- }
1348
- function $n(e) {
1349
- return typeof e == "function" ? e() : e;
1350
- }
1351
- const se = /* @__PURE__ */ m.forwardRef(function(t, o) {
1352
- const {
1353
- children: n,
1354
- container: r,
1355
- disablePortal: s = !1
1356
- } = t, [i, c] = m.useState(null), l = ne(/* @__PURE__ */ m.isValidElement(n) ? Rt(n) : null, o);
1357
- if (ye(() => {
1358
- s || c($n(r) || document.body);
1359
- }, [r, s]), ye(() => {
1360
- if (i && !s)
1361
- return Je(o, i), () => {
1362
- Je(o, null);
1363
- };
1364
- }, [o, i, s]), s) {
1365
- if (/* @__PURE__ */ m.isValidElement(n)) {
1366
- const a = {
1367
- ref: l
1368
- };
1369
- return /* @__PURE__ */ m.cloneElement(n, a);
1370
- }
1371
- return n;
1372
- }
1373
- return i && /* @__PURE__ */ rt.createPortal(n, i);
1374
- });
1375
- process.env.NODE_ENV !== "production" && (se.propTypes = {
1376
- // ┌────────────────────────────── Warning ──────────────────────────────┐
1377
- // │ These PropTypes are generated from the TypeScript type definitions. │
1378
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
1379
- // └─────────────────────────────────────────────────────────────────────┘
1380
- /**
1381
- * The children to render into the `container`.
1382
- */
1383
- children: u.node,
1384
- /**
1385
- * An HTML element or function that returns one.
1386
- * The `container` will have the portal children appended to it.
1387
- *
1388
- * You can also provide a callback, which is called in a React layout effect.
1389
- * This lets you set the container from a ref, and also makes server-side rendering possible.
1390
- *
1391
- * By default, it uses the body of the top-level document object,
1392
- * so it's simply `document.body` most of the time.
1393
- */
1394
- container: u.oneOfType([ge, u.func]),
1395
- /**
1396
- * The `children` will be under the DOM hierarchy of the parent component.
1397
- * @default false
1398
- */
1399
- disablePortal: u.bool
1400
- });
1401
- process.env.NODE_ENV !== "production" && (se.propTypes = Et(se.propTypes));
1402
- const _n = {
1403
- disableDefaultClasses: !1
1404
- }, Tt = /* @__PURE__ */ m.createContext(_n);
1405
- process.env.NODE_ENV !== "production" && (Tt.displayName = "ClassNameConfiguratorContext");
1406
- function Be(e) {
1407
- const {
1408
- disableDefaultClasses: t
1409
- } = m.useContext(Tt);
1410
- return (o) => t ? "" : e(o);
1411
- }
1412
- function Wn(e) {
1413
- const {
1414
- rootElementName: t = "",
1415
- componentName: o
1416
- } = e, [n, r] = m.useState(t.toUpperCase());
1417
- process.env.NODE_ENV !== "production" && m.useEffect(() => {
1418
- t && n !== t.toUpperCase() && console.error(`useRootElementName: the \`rootElementName\` prop of ${o ? `the ${o} component` : "a component"} expected the '${t}' element, but a '${n.toLowerCase()}' was rendered instead`, "This may cause hydration issues in an SSR context, for example in a Next.js app");
1419
- }, [t, n, o]);
1420
- const s = m.useCallback((i) => {
1421
- r((i == null ? void 0 : i.tagName) ?? "");
1422
- }, []);
1423
- return [n, s];
1424
- }
1425
- const Nt = "base";
1426
- function Un(e) {
1427
- return `${Nt}--${e}`;
1428
- }
1429
- function jn(e, t) {
1430
- return `${Nt}-${e}-${t}`;
1431
- }
1432
- function Ce(e, t) {
1433
- const o = Fn[t];
1434
- return o ? Un(o) : jn(e, t);
1435
- }
1436
- function $e(e, t) {
1437
- const o = {};
1438
- return t.forEach((n) => {
1439
- o[n] = Ce(e, n);
1440
- }), o;
1441
- }
1442
- const Ct = "Popup";
1443
- function Kn(e) {
1444
- return Ce(Ct, e);
1445
- }
1446
- $e(Ct, ["root", "open"]);
1447
- const Ot = /* @__PURE__ */ m.createContext(null);
1448
- process.env.NODE_ENV !== "production" && (Ot.displayName = "TransitionContext");
1449
- function qn(e) {
1450
- const [t, o] = m.useState(!0), n = m.useRef(!1), r = m.useRef(0), [s, i] = m.useState(!1), c = m.useRef(e);
1451
- m.useEffect(() => {
1452
- !e && // checking registeredTransitions.current instead of hasTransition to avoid this effect re-firing whenever hasTransition changes
1453
- r.current > 0 && // prevents waiting for a pending transition right after mounting
1454
- c.current !== e && (n.current = !0, o(!1)), c.current = e;
1455
- }, [e]);
1456
- const l = m.useCallback(() => {
1457
- n.current = !1, o(!0);
1458
- }, []), a = m.useCallback(() => (r.current += 1, i(!0), () => {
1459
- r.current -= 1, r.current === 0 && i(!1);
1460
- }), []);
1461
- let f;
1462
- return s ? e ? f = !1 : f = !n.current && t : f = !e, {
1463
- contextValue: m.useMemo(() => ({
1464
- requestedEnter: e,
1465
- onExited: l,
1466
- registerTransition: a,
1467
- hasExited: f
1468
- }), [l, e, a, f]),
1469
- hasExited: f
1470
- };
1471
- }
1472
- const Pt = /* @__PURE__ */ m.createContext(null);
1473
- process.env.NODE_ENV !== "production" && (Pt.displayName = "PopupContext");
1474
- function zn(e) {
1475
- const {
1476
- open: t
1477
- } = e;
1478
- return Ie({
1479
- root: ["root", t && "open"]
1480
- }, Be(Kn));
1481
- }
1482
- function Yn(e) {
1483
- return typeof e == "function" ? e() : e;
1484
- }
1485
- const Xn = /* @__PURE__ */ m.forwardRef(function(t, o) {
1486
- const {
1487
- anchor: n,
1488
- children: r,
1489
- container: s,
1490
- disablePortal: i = !1,
1491
- keepMounted: c = !1,
1492
- middleware: l,
1493
- offset: a = 0,
1494
- open: f = !1,
1495
- placement: d = "bottom",
1496
- slotProps: h = {},
1497
- slots: p = {},
1498
- strategy: g = "absolute",
1499
- ...E
1500
- } = t, {
1501
- refs: T,
1502
- elements: w,
1503
- floatingStyles: R,
1504
- update: x,
1505
- placement: N
1506
- } = Pn({
1507
- elements: {
1508
- reference: Yn(n)
1509
- },
1510
- open: f,
1511
- middleware: l ?? [Ge(a ?? 0), Sn(), An()],
1512
- placement: d,
1513
- strategy: g,
1514
- whileElementsMounted: c ? void 0 : Ye
1515
- }), v = ne(T.setFloating, o);
1516
- ye(() => {
1517
- if (c && f && w.reference && w.floating)
1518
- return Ye(w.reference, w.floating, x);
1519
- }, [c, f, w, x]);
1520
- const D = {
1521
- ...t,
1522
- disablePortal: i,
1523
- keepMounted: c,
1524
- offset: Ge,
1525
- open: f,
1526
- placement: d,
1527
- finalPlacement: N,
1528
- strategy: g
1529
- }, {
1530
- contextValue: S,
1531
- hasExited: M
1532
- } = qn(f), k = c && M ? "hidden" : void 0, L = zn(D), y = (p == null ? void 0 : p.root) ?? "div", b = xe({
1533
- elementType: y,
1534
- externalSlotProps: h.root,
1535
- externalForwardedProps: E,
1536
- ownerState: D,
1537
- className: L.root,
1538
- additionalProps: {
1539
- ref: v,
1540
- role: "tooltip",
1541
- style: {
1542
- ...R,
1543
- visibility: k
1544
- }
1545
- }
1546
- }), C = m.useMemo(() => ({
1547
- placement: N
1548
- }), [N]);
1549
- return c || !M ? /* @__PURE__ */ U(se, {
1550
- disablePortal: i,
1551
- container: s,
1552
- children: /* @__PURE__ */ U(Pt.Provider, {
1553
- value: C,
1554
- children: /* @__PURE__ */ U(Ot.Provider, {
1555
- value: S,
1556
- children: /* @__PURE__ */ U(y, {
1557
- ...b,
1558
- children: r
1559
- })
1560
- })
1561
- })
1562
- }) : null;
1563
- });
1564
- process.env.NODE_ENV !== "production" && (Xn.propTypes = {
1565
- // ┌────────────────────────────── Warning ──────────────────────────────┐
1566
- // │ These PropTypes are generated from the TypeScript type definitions. │
1567
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
1568
- // └─────────────────────────────────────────────────────────────────────┘
1569
- /**
1570
- * An HTML element, [virtual element](https://floating-ui.com/docs/virtual-elements),
1571
- * or a function that returns either.
1572
- * It's used to set the position of the popup.
1573
- */
1574
- anchor: u.oneOfType([ge, u.object, u.func]),
1575
- /**
1576
- * @ignore
1577
- */
1578
- children: u.oneOfType([u.node, u.func]),
1579
- /**
1580
- * An HTML element or function that returns one. The container will have the portal children appended to it.
1581
- * By default, it uses the body of the top-level document object, so it's `document.body` in these cases.
1582
- */
1583
- container: u.oneOfType([ge, u.func]),
1584
- /**
1585
- * If `true`, the popup will be rendered where it is defined, without the use of portals.
1586
- * @default false
1587
- */
1588
- disablePortal: u.bool,
1589
- /**
1590
- * If `true`, the popup will exist in the DOM even if it's closed.
1591
- * Its visibility will be controlled by the `visibility` CSS property.
1592
- *
1593
- * Otherwise, a closed popup will be removed from the DOM.
1594
- *
1595
- * @default false
1596
- */
1597
- keepMounted: u.bool,
1598
- /**
1599
- * Collection of Floating UI middleware to use when positioning the popup.
1600
- * If not provided, the [`offset`](https://floating-ui.com/docs/offset)
1601
- * and [`flip`](https://floating-ui.com/docs/flip) functions will be used.
1602
- *
1603
- * @see https://floating-ui.com/docs/computePosition#middleware
1604
- */
1605
- middleware: u.arrayOf(u.oneOfType([u.oneOf([!1]), u.shape({
1606
- fn: u.func.isRequired,
1607
- name: u.string.isRequired,
1608
- options: u.any
1609
- })])),
1610
- /**
1611
- * Distance between a popup and the trigger element.
1612
- * This prop is ignored when custom `middleware` is provided.
1613
- *
1614
- * @default 0
1615
- * @see https://floating-ui.com/docs/offset
1616
- */
1617
- offset: u.oneOfType([u.func, u.number, u.shape({
1618
- alignmentAxis: u.number,
1619
- crossAxis: u.number,
1620
- mainAxis: u.number
1621
- })]),
1622
- /**
1623
- * If `true`, the popup is visible.
1624
- *
1625
- * @default false
1626
- */
1627
- open: u.bool,
1628
- /**
1629
- * Determines where to place the popup relative to the trigger element.
1630
- *
1631
- * @default 'bottom'
1632
- * @see https://floating-ui.com/docs/computePosition#placement
1633
- */
1634
- placement: u.oneOf(["bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
1635
- /**
1636
- * The props used for each slot inside the Popup.
1637
- *
1638
- * @default {}
1639
- */
1640
- slotProps: u.shape({
1641
- root: u.oneOfType([u.func, u.object])
1642
- }),
1643
- /**
1644
- * The components used for each slot inside the Popup.
1645
- * Either a string to use a HTML element or a component.
1646
- *
1647
- * @default {}
1648
- */
1649
- slots: u.shape({
1650
- root: u.elementType
1651
- }),
1652
- /**
1653
- * The type of CSS position property to use (absolute or fixed).
1654
- *
1655
- * @default 'absolute'
1656
- * @see https://floating-ui.com/docs/computePosition#strategy
1657
- */
1658
- strategy: u.oneOf(["absolute", "fixed"])
1659
- });
1660
- function Gn(e) {
1661
- const t = Q(e);
1662
- return t.body === e ? he(e).innerWidth > t.documentElement.clientWidth : e.scrollHeight > e.clientHeight;
1663
- }
1664
- function oe(e, t) {
1665
- t ? e.setAttribute("aria-hidden", "true") : e.removeAttribute("aria-hidden");
1666
- }
1667
- function nt(e) {
1668
- return parseInt(he(e).getComputedStyle(e).paddingRight, 10) || 0;
1669
- }
1670
- function Zn(e) {
1671
- const o = ["TEMPLATE", "SCRIPT", "STYLE", "LINK", "MAP", "META", "NOSCRIPT", "PICTURE", "COL", "COLGROUP", "PARAM", "SLOT", "SOURCE", "TRACK"].includes(e.tagName), n = e.tagName === "INPUT" && e.getAttribute("type") === "hidden";
1672
- return o || n;
1673
- }
1674
- function ot(e, t, o, n, r) {
1675
- const s = [t, o, ...n];
1676
- [].forEach.call(e.children, (i) => {
1677
- const c = !s.includes(i), l = !Zn(i);
1678
- c && l && oe(i, r);
1679
- });
1680
- }
1681
- function Ae(e, t) {
1682
- let o = -1;
1683
- return e.some((n, r) => t(n) ? (o = r, !0) : !1), o;
1684
- }
1685
- function Jn(e, t) {
1686
- const o = [], n = e.container;
1687
- if (!t.disableScrollLock) {
1688
- if (Gn(n)) {
1689
- const i = Mn(he(n));
1690
- o.push({
1691
- value: n.style.paddingRight,
1692
- property: "padding-right",
1693
- el: n
1694
- }), n.style.paddingRight = `${nt(n) + i}px`;
1695
- const c = Q(n).querySelectorAll(".mui-fixed");
1696
- [].forEach.call(c, (l) => {
1697
- o.push({
1698
- value: l.style.paddingRight,
1699
- property: "padding-right",
1700
- el: l
1701
- }), l.style.paddingRight = `${nt(l) + i}px`;
1702
- });
1703
- }
1704
- let s;
1705
- if (n.parentNode instanceof DocumentFragment)
1706
- s = Q(n).body;
1707
- else {
1708
- const i = n.parentElement, c = he(n);
1709
- s = (i == null ? void 0 : i.nodeName) === "HTML" && c.getComputedStyle(i).overflowY === "scroll" ? i : n;
1710
- }
1711
- o.push({
1712
- value: s.style.overflow,
1713
- property: "overflow",
1714
- el: s
1715
- }, {
1716
- value: s.style.overflowX,
1717
- property: "overflow-x",
1718
- el: s
1719
- }, {
1720
- value: s.style.overflowY,
1721
- property: "overflow-y",
1722
- el: s
1723
- }), s.style.overflow = "hidden";
1724
- }
1725
- return () => {
1726
- o.forEach(({
1727
- value: s,
1728
- el: i,
1729
- property: c
1730
- }) => {
1731
- s ? i.style.setProperty(c, s) : i.style.removeProperty(c);
1732
- });
1733
- };
1734
- }
1735
- function Qn(e) {
1736
- const t = [];
1737
- return [].forEach.call(e.children, (o) => {
1738
- o.getAttribute("aria-hidden") === "true" && t.push(o);
1739
- }), t;
1740
- }
1741
- class Hn {
1742
- constructor() {
1743
- this.modals = [], this.containers = [];
1744
- }
1745
- add(t, o) {
1746
- let n = this.modals.indexOf(t);
1747
- if (n !== -1)
1748
- return n;
1749
- n = this.modals.length, this.modals.push(t), t.modalRef && oe(t.modalRef, !1);
1750
- const r = Qn(o);
1751
- ot(o, t.mount, t.modalRef, r, !0);
1752
- const s = Ae(this.containers, (i) => i.container === o);
1753
- return s !== -1 ? (this.containers[s].modals.push(t), n) : (this.containers.push({
1754
- modals: [t],
1755
- container: o,
1756
- restore: null,
1757
- hiddenSiblings: r
1758
- }), n);
1759
- }
1760
- mount(t, o) {
1761
- const n = Ae(this.containers, (s) => s.modals.includes(t)), r = this.containers[n];
1762
- r.restore || (r.restore = Jn(r, o));
1763
- }
1764
- remove(t, o = !0) {
1765
- const n = this.modals.indexOf(t);
1766
- if (n === -1)
1767
- return n;
1768
- const r = Ae(this.containers, (i) => i.modals.includes(t)), s = this.containers[r];
1769
- if (s.modals.splice(s.modals.indexOf(t), 1), this.modals.splice(n, 1), s.modals.length === 0)
1770
- s.restore && s.restore(), t.modalRef && oe(t.modalRef, o), ot(s.container, t.mount, t.modalRef, s.hiddenSiblings, !1), this.containers.splice(r, 1);
1771
- else {
1772
- const i = s.modals[s.modals.length - 1];
1773
- i.modalRef && oe(i.modalRef, !1);
1774
- }
1775
- return n;
1776
- }
1777
- isTopModal(t) {
1778
- return this.modals.length > 0 && this.modals[this.modals.length - 1] === t;
1779
- }
1780
- }
1781
- function eo(e) {
1782
- return typeof e == "function" ? e() : e;
1783
- }
1784
- function to(e) {
1785
- return e ? e.props.hasOwnProperty("in") : !1;
1786
- }
1787
- const no = new Hn();
1788
- function oo(e) {
1789
- const {
1790
- container: t,
1791
- disableEscapeKeyDown: o = !1,
1792
- disableScrollLock: n = !1,
1793
- // @ts-ignore internal logic - Base UI supports the manager as a prop too
1794
- manager: r = no,
1795
- closeAfterTransition: s = !1,
1796
- onTransitionEnter: i,
1797
- onTransitionExited: c,
1798
- children: l,
1799
- onClose: a,
1800
- open: f,
1801
- rootRef: d
1802
- } = e, h = m.useRef({}), p = m.useRef(null), g = m.useRef(null), E = ne(g, d), [T, w] = m.useState(!f), R = to(l);
1803
- let x = !0;
1804
- (e["aria-hidden"] === "false" || e["aria-hidden"] === !1) && (x = !1);
1805
- const N = () => Q(p.current), v = () => (h.current.modalRef = g.current, h.current.mount = p.current, h.current), D = () => {
1806
- r.mount(v(), {
1807
- disableScrollLock: n
1808
- }), g.current && (g.current.scrollTop = 0);
1809
- }, S = Qe(() => {
1810
- const P = eo(t) || N().body;
1811
- r.add(v(), P), g.current && D();
1812
- }), M = m.useCallback(() => r.isTopModal(v()), [r]), k = Qe((P) => {
1813
- p.current = P, P && (f && M() ? D() : g.current && oe(g.current, x));
1814
- }), L = m.useCallback(() => {
1815
- r.remove(v(), x);
1816
- }, [x, r]);
1817
- m.useEffect(() => () => {
1818
- L();
1819
- }, [L]), m.useEffect(() => {
1820
- f ? S() : (!R || !s) && L();
1821
- }, [f, L, R, s, S]);
1822
- const y = (P) => (A) => {
1823
- var O;
1824
- (O = P.onKeyDown) == null || O.call(P, A), !(A.key !== "Escape" || A.which === 229 || // Wait until IME is settled.
1825
- !M()) && (o || (A.stopPropagation(), a && a(A, "escapeKeyDown")));
1826
- }, b = (P) => (A) => {
1827
- var O;
1828
- (O = P.onClick) == null || O.call(P, A), A.target === A.currentTarget && a && a(A, "backdropClick");
1829
- };
1830
- return {
1831
- getRootProps: (P = {}) => {
1832
- const A = be(e);
1833
- delete A.onTransitionEnter, delete A.onTransitionExited;
1834
- const O = {
1835
- ...A,
1836
- ...P
1837
- };
1838
- return {
1839
- /*
1840
- * Marking an element with the role presentation indicates to assistive technology
1841
- * that this element should be ignored; it exists to support the web application and
1842
- * is not meant for humans to interact with directly.
1843
- * https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md
1844
- */
1845
- role: "presentation",
1846
- ...O,
1847
- onKeyDown: y(O),
1848
- ref: E
1849
- };
1850
- },
1851
- getBackdropProps: (P = {}) => {
1852
- const A = P;
1853
- return {
1854
- "aria-hidden": !0,
1855
- ...A,
1856
- onClick: b(A),
1857
- open: f
1858
- };
1859
- },
1860
- getTransitionProps: () => {
1861
- const P = () => {
1862
- w(!1), i && i();
1863
- }, A = () => {
1864
- w(!0), c && c(), s && L();
1865
- };
1866
- return {
1867
- onEnter: Ze(P, l == null ? void 0 : l.props.onEnter),
1868
- onExited: Ze(A, l == null ? void 0 : l.props.onExited)
1869
- };
1870
- },
1871
- rootRef: E,
1872
- portalRef: k,
1873
- isTopModal: M,
1874
- exited: T,
1875
- hasTransition: R
1876
- };
1877
- }
1878
- const ro = ["input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])'].join(",");
1879
- function so(e) {
1880
- const t = parseInt(e.getAttribute("tabindex") || "", 10);
1881
- return Number.isNaN(t) ? e.contentEditable === "true" || (e.nodeName === "AUDIO" || e.nodeName === "VIDEO" || e.nodeName === "DETAILS") && e.getAttribute("tabindex") === null ? 0 : e.tabIndex : t;
1882
- }
1883
- function io(e) {
1884
- if (e.tagName !== "INPUT" || e.type !== "radio" || !e.name)
1885
- return !1;
1886
- const t = (n) => e.ownerDocument.querySelector(`input[type="radio"]${n}`);
1887
- let o = t(`[name="${e.name}"]:checked`);
1888
- return o || (o = t(`[name="${e.name}"]`)), o !== e;
1889
- }
1890
- function co(e) {
1891
- return !(e.disabled || e.tagName === "INPUT" && e.type === "hidden" || io(e));
1892
- }
1893
- function lo(e) {
1894
- const t = [], o = [];
1895
- return Array.from(e.querySelectorAll(ro)).forEach((n, r) => {
1896
- const s = so(n);
1897
- s === -1 || !co(n) || (s === 0 ? t.push(n) : o.push({
1898
- documentOrder: r,
1899
- tabIndex: s,
1900
- node: n
1901
- }));
1902
- }), o.sort((n, r) => n.tabIndex === r.tabIndex ? n.documentOrder - r.documentOrder : n.tabIndex - r.tabIndex).map((n) => n.node).concat(t);
1903
- }
1904
- function ao() {
1905
- return !0;
1906
- }
1907
- function we(e) {
1908
- const {
1909
- children: t,
1910
- disableAutoFocus: o = !1,
1911
- disableEnforceFocus: n = !1,
1912
- disableRestoreFocus: r = !1,
1913
- getTabbable: s = lo,
1914
- isEnabled: i = ao,
1915
- open: c
1916
- } = e, l = m.useRef(!1), a = m.useRef(null), f = m.useRef(null), d = m.useRef(null), h = m.useRef(null), p = m.useRef(!1), g = m.useRef(null), E = ne(Rt(t), g), T = m.useRef(null);
1917
- m.useEffect(() => {
1918
- !c || !g.current || (p.current = !o);
1919
- }, [o, c]), m.useEffect(() => {
1920
- if (!c || !g.current)
1921
- return;
1922
- const x = Q(g.current);
1923
- return g.current.contains(x.activeElement) || (g.current.hasAttribute("tabIndex") || (process.env.NODE_ENV !== "production" && console.error(["MUI: The modal content node does not accept focus.", 'For the benefit of assistive technologies, the tabIndex of the node is being set to "-1".'].join(`
1924
- `)), g.current.setAttribute("tabIndex", "-1")), p.current && g.current.focus()), () => {
1925
- r || (d.current && d.current.focus && (l.current = !0, d.current.focus()), d.current = null);
1926
- };
1927
- }, [c]), m.useEffect(() => {
1928
- if (!c || !g.current)
1929
- return;
1930
- const x = Q(g.current), N = (S) => {
1931
- T.current = S, !(n || !i() || S.key !== "Tab") && x.activeElement === g.current && S.shiftKey && (l.current = !0, f.current && f.current.focus());
1932
- }, v = () => {
1933
- var k, L;
1934
- const S = g.current;
1935
- if (S === null)
1936
- return;
1937
- if (!x.hasFocus() || !i() || l.current) {
1938
- l.current = !1;
1939
- return;
1940
- }
1941
- if (S.contains(x.activeElement) || n && x.activeElement !== a.current && x.activeElement !== f.current)
1942
- return;
1943
- if (x.activeElement !== h.current)
1944
- h.current = null;
1945
- else if (h.current !== null)
1946
- return;
1947
- if (!p.current)
1948
- return;
1949
- let M = [];
1950
- if ((x.activeElement === a.current || x.activeElement === f.current) && (M = s(g.current)), M.length > 0) {
1951
- const y = !!((k = T.current) != null && k.shiftKey && ((L = T.current) == null ? void 0 : L.key) === "Tab"), b = M[0], C = M[M.length - 1];
1952
- typeof b != "string" && typeof C != "string" && (y ? C.focus() : b.focus());
1953
- } else
1954
- S.focus();
1955
- };
1956
- x.addEventListener("focusin", v), x.addEventListener("keydown", N, !0);
1957
- const D = setInterval(() => {
1958
- x.activeElement && x.activeElement.tagName === "BODY" && v();
1959
- }, 50);
1960
- return () => {
1961
- clearInterval(D), x.removeEventListener("focusin", v), x.removeEventListener("keydown", N, !0);
1962
- };
1963
- }, [o, n, r, i, c, s]);
1964
- const w = (x) => {
1965
- d.current === null && (d.current = x.relatedTarget), p.current = !0, h.current = x.target;
1966
- const N = t.props.onFocus;
1967
- N && N(x);
1968
- }, R = (x) => {
1969
- d.current === null && (d.current = x.relatedTarget), p.current = !0;
1970
- };
1971
- return /* @__PURE__ */ st(m.Fragment, {
1972
- children: [/* @__PURE__ */ U("div", {
1973
- tabIndex: c ? 0 : -1,
1974
- onFocus: R,
1975
- ref: a,
1976
- "data-testid": "sentinelStart"
1977
- }), /* @__PURE__ */ m.cloneElement(t, {
1978
- ref: E,
1979
- onFocus: w
1980
- }), /* @__PURE__ */ U("div", {
1981
- tabIndex: c ? 0 : -1,
1982
- onFocus: R,
1983
- ref: f,
1984
- "data-testid": "sentinelEnd"
1985
- })]
1986
- });
1987
- }
1988
- process.env.NODE_ENV !== "production" && (we.propTypes = {
1989
- // ┌────────────────────────────── Warning ──────────────────────────────┐
1990
- // │ These PropTypes are generated from the TypeScript type definitions. │
1991
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
1992
- // └─────────────────────────────────────────────────────────────────────┘
1993
- /**
1994
- * A single child content element.
1995
- */
1996
- children: Ve,
1997
- /**
1998
- * If `true`, the focus trap will not automatically shift focus to itself when it opens, and
1999
- * replace it to the last focused element when it closes.
2000
- * This also works correctly with any focus trap children that have the `disableAutoFocus` prop.
2001
- *
2002
- * Generally this should never be set to `true` as it makes the focus trap less
2003
- * accessible to assistive technologies, like screen readers.
2004
- * @default false
2005
- */
2006
- disableAutoFocus: u.bool,
2007
- /**
2008
- * If `true`, the focus trap will not prevent focus from leaving the focus trap while open.
2009
- *
2010
- * Generally this should never be set to `true` as it makes the focus trap less
2011
- * accessible to assistive technologies, like screen readers.
2012
- * @default false
2013
- */
2014
- disableEnforceFocus: u.bool,
2015
- /**
2016
- * If `true`, the focus trap will not restore focus to previously focused element once
2017
- * focus trap is hidden or unmounted.
2018
- * @default false
2019
- */
2020
- disableRestoreFocus: u.bool,
2021
- /**
2022
- * Returns an array of ordered tabbable nodes (i.e. in tab order) within the root.
2023
- * For instance, you can provide the "tabbable" npm dependency.
2024
- * @param {HTMLElement} root
2025
- */
2026
- getTabbable: u.func,
2027
- /**
2028
- * This prop extends the `open` prop.
2029
- * It allows to toggle the open state without having to wait for a rerender when changing the `open` prop.
2030
- * This prop should be memoized.
2031
- * It can be used to support multiple focus trap mounted at the same time.
2032
- * @default function defaultIsEnabled(): boolean {
2033
- * return true;
2034
- * }
2035
- */
2036
- isEnabled: u.func,
2037
- /**
2038
- * If `true`, focus is locked.
2039
- */
2040
- open: u.bool.isRequired
2041
- });
2042
- process.env.NODE_ENV !== "production" && (we.propTypes = Et(we.propTypes));
2043
- const At = "Modal";
2044
- function uo(e) {
2045
- return Ce(At, e);
2046
- }
2047
- $e(At, ["root", "hidden", "backdrop"]);
2048
- const fo = (e) => {
2049
- const {
2050
- open: t,
2051
- exited: o
2052
- } = e;
2053
- return Ie({
2054
- root: ["root", !t && o && "hidden"],
2055
- backdrop: ["backdrop"]
2056
- }, Be(uo));
2057
- }, po = /* @__PURE__ */ m.forwardRef(function(t, o) {
2058
- const {
2059
- children: n,
2060
- closeAfterTransition: r = !1,
2061
- container: s,
2062
- disableAutoFocus: i = !1,
2063
- disableEnforceFocus: c = !1,
2064
- disableEscapeKeyDown: l = !1,
2065
- disablePortal: a = !1,
2066
- disableRestoreFocus: f = !1,
2067
- disableScrollLock: d = !1,
2068
- hideBackdrop: h = !1,
2069
- keepMounted: p = !1,
2070
- onBackdropClick: g,
2071
- onClose: E,
2072
- onKeyDown: T,
2073
- open: w,
2074
- onTransitionEnter: R,
2075
- onTransitionExited: x,
2076
- slotProps: N = {},
2077
- slots: v = {},
2078
- ...D
2079
- } = t, S = {
2080
- ...t,
2081
- closeAfterTransition: r,
2082
- disableAutoFocus: i,
2083
- disableEnforceFocus: c,
2084
- disableEscapeKeyDown: l,
2085
- disablePortal: a,
2086
- disableRestoreFocus: f,
2087
- disableScrollLock: d,
2088
- hideBackdrop: h,
2089
- keepMounted: p
2090
- }, {
2091
- getRootProps: M,
2092
- getBackdropProps: k,
2093
- getTransitionProps: L,
2094
- portalRef: y,
2095
- isTopModal: b,
2096
- exited: C,
2097
- hasTransition: F
2098
- } = oo({
2099
- ...S,
2100
- rootRef: o
2101
- }), B = {
2102
- ...S,
2103
- exited: C,
2104
- hasTransition: F
2105
- }, P = fo(B), A = {};
2106
- if (n.props.tabIndex === void 0 && (A.tabIndex = "-1"), F) {
2107
- const {
2108
- onEnter: X,
2109
- onExited: ce
2110
- } = L();
2111
- A.onEnter = X, A.onExited = ce;
2112
- }
2113
- const O = v.root ?? "div", V = xe({
2114
- elementType: O,
2115
- externalSlotProps: N.root,
2116
- externalForwardedProps: D,
2117
- getSlotProps: M,
2118
- className: P.root,
2119
- ownerState: B
2120
- }), $ = v.backdrop, kt = xe({
2121
- elementType: $,
2122
- externalSlotProps: N.backdrop,
2123
- getSlotProps: (X) => k({
2124
- ...X,
2125
- onClick: (ce) => {
2126
- g && g(ce), X != null && X.onClick && X.onClick(ce);
2127
- }
2128
- }),
2129
- className: P.backdrop,
2130
- ownerState: B
2131
- });
2132
- return !p && !w && (!F || C) ? null : /* @__PURE__ */ U(se, {
2133
- ref: y,
2134
- container: s,
2135
- disablePortal: a,
2136
- children: /* @__PURE__ */ st(O, {
2137
- ...V,
2138
- children: [!h && $ ? /* @__PURE__ */ U($, {
2139
- ...kt
2140
- }) : null, /* @__PURE__ */ U(we, {
2141
- disableEnforceFocus: c,
2142
- disableAutoFocus: i,
2143
- disableRestoreFocus: f,
2144
- isEnabled: b,
2145
- open: w,
2146
- children: /* @__PURE__ */ m.cloneElement(n, A)
2147
- })]
2148
- })
2149
- });
2150
- });
2151
- process.env.NODE_ENV !== "production" && (po.propTypes = {
2152
- // ┌────────────────────────────── Warning ──────────────────────────────┐
2153
- // │ These PropTypes are generated from the TypeScript type definitions. │
2154
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
2155
- // └─────────────────────────────────────────────────────────────────────┘
2156
- /**
2157
- * A single child content element.
2158
- */
2159
- children: Ve.isRequired,
2160
- /**
2161
- * When set to true the Modal waits until a nested Transition is completed before closing.
2162
- * @default false
2163
- */
2164
- closeAfterTransition: u.bool,
2165
- /**
2166
- * An HTML element or function that returns one.
2167
- * The `container` will have the portal children appended to it.
2168
- *
2169
- * You can also provide a callback, which is called in a React layout effect.
2170
- * This lets you set the container from a ref, and also makes server-side rendering possible.
2171
- *
2172
- * By default, it uses the body of the top-level document object,
2173
- * so it's simply `document.body` most of the time.
2174
- */
2175
- container: u.oneOfType([ge, u.func]),
2176
- /**
2177
- * If `true`, the modal will not automatically shift focus to itself when it opens, and
2178
- * replace it to the last focused element when it closes.
2179
- * This also works correctly with any modal children that have the `disableAutoFocus` prop.
2180
- *
2181
- * Generally this should never be set to `true` as it makes the modal less
2182
- * accessible to assistive technologies, like screen readers.
2183
- * @default false
2184
- */
2185
- disableAutoFocus: u.bool,
2186
- /**
2187
- * If `true`, the modal will not prevent focus from leaving the modal while open.
2188
- *
2189
- * Generally this should never be set to `true` as it makes the modal less
2190
- * accessible to assistive technologies, like screen readers.
2191
- * @default false
2192
- */
2193
- disableEnforceFocus: u.bool,
2194
- /**
2195
- * If `true`, hitting escape will not fire the `onClose` callback.
2196
- * @default false
2197
- */
2198
- disableEscapeKeyDown: u.bool,
2199
- /**
2200
- * The `children` will be under the DOM hierarchy of the parent component.
2201
- * @default false
2202
- */
2203
- disablePortal: u.bool,
2204
- /**
2205
- * If `true`, the modal will not restore focus to previously focused element once
2206
- * modal is hidden or unmounted.
2207
- * @default false
2208
- */
2209
- disableRestoreFocus: u.bool,
2210
- /**
2211
- * Disable the scroll lock behavior.
2212
- * @default false
2213
- */
2214
- disableScrollLock: u.bool,
2215
- /**
2216
- * If `true`, the backdrop is not rendered.
2217
- * @default false
2218
- */
2219
- hideBackdrop: u.bool,
2220
- /**
2221
- * Always keep the children in the DOM.
2222
- * This prop can be useful in SEO situation or
2223
- * when you want to maximize the responsiveness of the Modal.
2224
- * @default false
2225
- */
2226
- keepMounted: u.bool,
2227
- /**
2228
- * Callback fired when the backdrop is clicked.
2229
- * @deprecated Use the `onClose` prop with the `reason` argument to handle the `backdropClick` events.
2230
- */
2231
- onBackdropClick: u.func,
2232
- /**
2233
- * Callback fired when the component requests to be closed.
2234
- * The `reason` parameter can optionally be used to control the response to `onClose`.
2235
- *
2236
- * @param {object} event The event source of the callback.
2237
- * @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`.
2238
- */
2239
- onClose: u.func,
2240
- /**
2241
- * A function called when a transition enters.
2242
- */
2243
- onTransitionEnter: u.func,
2244
- /**
2245
- * A function called when a transition has exited.
2246
- */
2247
- onTransitionExited: u.func,
2248
- /**
2249
- * If `true`, the component is shown.
2250
- */
2251
- open: u.bool.isRequired,
2252
- /**
2253
- * The props used for each slot inside the Modal.
2254
- * @default {}
2255
- */
2256
- slotProps: u.shape({
2257
- backdrop: u.oneOfType([u.func, u.object]),
2258
- root: u.oneOfType([u.func, u.object])
2259
- }),
2260
- /**
2261
- * The components used for each slot inside the Modal.
2262
- * Either a string to use a HTML element or a component.
2263
- * @default {}
2264
- */
2265
- slots: u.shape({
2266
- backdrop: u.elementType,
2267
- root: u.elementType
2268
- })
2269
- });
2270
- const St = "Button";
2271
- function mo(e) {
2272
- return Ce(St, e);
2273
- }
2274
- $e(St, ["root", "active", "disabled", "focusVisible"]);
2275
- function go(e = {}) {
2276
- const {
2277
- disabled: t = !1,
2278
- focusableWhenDisabled: o,
2279
- href: n,
2280
- rootRef: r,
2281
- tabIndex: s,
2282
- to: i,
2283
- type: c,
2284
- rootElementName: l
2285
- } = e, a = m.useRef(null), [f, d] = m.useState(!1), [h, p] = m.useState(!1);
2286
- t && !o && h && p(!1);
2287
- const [g, E] = Wn({
2288
- rootElementName: l ?? (n || i ? "a" : void 0),
2289
- componentName: "Button"
2290
- }), T = (y) => (b) => {
2291
- var C;
2292
- h && b.preventDefault(), (C = y.onMouseLeave) == null || C.call(y, b);
2293
- }, w = (y) => (b) => {
2294
- var C;
2295
- He(b.target) || p(!1), (C = y.onBlur) == null || C.call(y, b);
2296
- }, R = (y) => (b) => {
2297
- var C, F;
2298
- a.current || (a.current = b.currentTarget), He(b.target) && (p(!0), (C = y.onFocusVisible) == null || C.call(y, b)), (F = y.onFocus) == null || F.call(y, b);
2299
- }, x = () => {
2300
- const y = a.current;
2301
- return g === "BUTTON" || g === "INPUT" && ["button", "submit", "reset"].includes(y == null ? void 0 : y.type) || g === "A" && (y == null ? void 0 : y.href);
2302
- }, N = (y) => (b) => {
2303
- var C;
2304
- t || (C = y.onClick) == null || C.call(y, b);
2305
- }, v = (y) => (b) => {
2306
- var C;
2307
- t || (d(!0), document.addEventListener("mouseup", () => {
2308
- d(!1);
2309
- }, {
2310
- once: !0
2311
- })), (C = y.onMouseDown) == null || C.call(y, b);
2312
- }, D = (y) => (b) => {
2313
- var C, F;
2314
- (C = y.onKeyDown) == null || C.call(y, b), !b.defaultMuiPrevented && (b.target === b.currentTarget && !x() && b.key === " " && b.preventDefault(), b.target === b.currentTarget && b.key === " " && !t && d(!0), b.target === b.currentTarget && !x() && b.key === "Enter" && !t && ((F = y.onClick) == null || F.call(y, b), b.preventDefault()));
2315
- }, S = (y) => (b) => {
2316
- var C, F;
2317
- b.target === b.currentTarget && d(!1), (C = y.onKeyUp) == null || C.call(y, b), b.target === b.currentTarget && !x() && !t && b.key === " " && !b.defaultMuiPrevented && ((F = y.onClick) == null || F.call(y, b));
2318
- }, M = ne(E, r, a), k = {};
2319
- return s !== void 0 && (k.tabIndex = s), g === "BUTTON" ? (k.type = c ?? "button", o ? k["aria-disabled"] = t : k.disabled = t) : g === "INPUT" ? c && ["button", "submit", "reset"].includes(c) && (o ? k["aria-disabled"] = t : k.disabled = t) : g !== "" && (!n && !i && (k.role = "button", k.tabIndex = s ?? 0), t && (k["aria-disabled"] = t, k.tabIndex = o ? s ?? 0 : -1)), {
2320
- getRootProps: (y = {}) => {
2321
- const b = {
2322
- ...be(e),
2323
- ...be(y)
2324
- }, C = {
2325
- type: c,
2326
- ...b,
2327
- ...k,
2328
- ...y,
2329
- onBlur: w(b),
2330
- onClick: N(b),
2331
- onFocus: R(b),
2332
- onKeyDown: D(b),
2333
- onKeyUp: S(b),
2334
- onMouseDown: v(b),
2335
- onMouseLeave: T(b),
2336
- ref: M
2337
- };
2338
- return delete C.onFocusVisible, C;
2339
- },
2340
- focusVisible: h,
2341
- setFocusVisible: p,
2342
- active: f,
2343
- rootRef: M
2344
- };
2345
- }
2346
- const ho = (e) => {
2347
- const {
2348
- active: t,
2349
- disabled: o,
2350
- focusVisible: n
2351
- } = e;
2352
- return Ie({
2353
- root: ["root", o && "disabled", n && "focusVisible", t && "active"]
2354
- }, Be(mo));
2355
- }, yo = /* @__PURE__ */ m.forwardRef(function(t, o) {
2356
- const {
2357
- action: n,
2358
- children: r,
2359
- disabled: s,
2360
- focusableWhenDisabled: i = !1,
2361
- onFocusVisible: c,
2362
- slotProps: l = {},
2363
- slots: a = {},
2364
- rootElementName: f = "button",
2365
- ...d
2366
- } = t, h = m.useRef(null);
2367
- let p = f;
2368
- typeof a.root == "string" ? p = a.root : (d.href || d.to) && (p = "a");
2369
- const {
2370
- active: g,
2371
- focusVisible: E,
2372
- setFocusVisible: T,
2373
- getRootProps: w
2374
- } = go({
2375
- ...t,
2376
- focusableWhenDisabled: i,
2377
- rootElementName: p
2378
- });
2379
- m.useImperativeHandle(n, () => ({
2380
- focusVisible: () => {
2381
- T(!0), h.current.focus();
2382
- }
2383
- }), [T]);
2384
- const R = {
2385
- ...t,
2386
- active: g,
2387
- focusableWhenDisabled: i,
2388
- focusVisible: E
2389
- }, x = ho(R), N = d.href || d.to ? "a" : "button", v = a.root ?? N, D = xe({
2390
- elementType: v,
2391
- getSlotProps: w,
2392
- externalForwardedProps: d,
2393
- externalSlotProps: l.root,
2394
- additionalProps: {
2395
- ref: o
2396
- },
2397
- ownerState: R,
2398
- className: x.root
2399
- });
2400
- return /* @__PURE__ */ U(v, {
2401
- ...D,
2402
- children: r
2403
- });
2404
- });
2405
- process.env.NODE_ENV !== "production" && (yo.propTypes = {
2406
- // ┌────────────────────────────── Warning ──────────────────────────────┐
2407
- // │ These PropTypes are generated from the TypeScript type definitions. │
2408
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
2409
- // └─────────────────────────────────────────────────────────────────────┘
2410
- /**
2411
- * A ref for imperative actions. It currently only supports `focusVisible()` action.
2412
- */
2413
- action: u.oneOfType([u.func, u.shape({
2414
- current: u.shape({
2415
- focusVisible: u.func.isRequired
2416
- })
2417
- })]),
2418
- /**
2419
- * @ignore
2420
- */
2421
- children: u.node,
2422
- /**
2423
- * @ignore
2424
- */
2425
- className: u.string,
2426
- /**
2427
- * If `true`, the component is disabled.
2428
- * @default false
2429
- */
2430
- disabled: u.bool,
2431
- /**
2432
- * If `true`, allows a disabled button to receive focus.
2433
- * @default false
2434
- */
2435
- focusableWhenDisabled: u.bool,
2436
- /**
2437
- * @ignore
2438
- */
2439
- href: u.string,
2440
- /**
2441
- * @ignore
2442
- */
2443
- onFocusVisible: u.func,
2444
- /**
2445
- * The HTML element that is ultimately rendered, for example 'button' or 'a'
2446
- * @default 'button'
2447
- */
2448
- rootElementName: u.string,
2449
- /**
2450
- * The props used for each slot inside the Button.
2451
- * @default {}
2452
- */
2453
- slotProps: u.shape({
2454
- root: u.oneOfType([u.func, u.object])
2455
- }),
2456
- /**
2457
- * The components used for each slot inside the Button.
2458
- * Either a string to use a HTML element or a component.
2459
- * @default {}
2460
- */
2461
- slots: u.shape({
2462
- root: u.elementType
2463
- }),
2464
- /**
2465
- * @ignore
2466
- */
2467
- to: u.string
2468
- });
2469
- export {
2470
- yo as B,
2471
- po as M,
2472
- Xn as P
2473
- };