@arcadeai/design-system 3.33.0 → 3.33.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 (75) hide show
  1. package/dist/assets/icons/attio.js +6 -6
  2. package/dist/assets/icons/daytona.js +6 -6
  3. package/dist/assets/icons/math-toolkit.js +10 -0
  4. package/dist/components/index.js +431 -404
  5. package/dist/components/ui/atoms/command.js +288 -364
  6. package/dist/components/ui/atoms/copy-button.d.ts.map +1 -1
  7. package/dist/components/ui/atoms/copy-button.js +3 -2
  8. package/dist/components/ui/atoms/dropdown-menu.js +1 -1
  9. package/dist/components/ui/atoms/hover-card.js +1 -1
  10. package/dist/components/ui/atoms/icons/attio.d.ts.map +1 -1
  11. package/dist/components/ui/atoms/icons/attio.js +13 -25
  12. package/dist/components/ui/atoms/icons/daytona.d.ts.map +1 -1
  13. package/dist/components/ui/atoms/icons/daytona.js +9 -14
  14. package/dist/components/ui/atoms/icons/index.d.ts +1 -0
  15. package/dist/components/ui/atoms/icons/index.d.ts.map +1 -1
  16. package/dist/components/ui/atoms/icons/index.js +138 -136
  17. package/dist/components/ui/atoms/icons/math-toolkit.d.ts +4 -0
  18. package/dist/components/ui/atoms/icons/math-toolkit.d.ts.map +1 -0
  19. package/dist/components/ui/atoms/icons/math-toolkit.js +15 -0
  20. package/dist/components/ui/atoms/index.d.ts +1 -0
  21. package/dist/components/ui/atoms/index.d.ts.map +1 -1
  22. package/dist/components/ui/atoms/index.js +295 -289
  23. package/dist/components/ui/atoms/markdown.js +1 -1
  24. package/dist/components/ui/atoms/popover.js +1 -1
  25. package/dist/components/ui/atoms/scroll-button.d.ts.map +1 -1
  26. package/dist/components/ui/atoms/scroll-button.js +34 -28
  27. package/dist/components/ui/atoms/select.js +1 -1
  28. package/dist/components/ui/atoms/step-indicator.d.ts +17 -0
  29. package/dist/components/ui/atoms/step-indicator.d.ts.map +1 -0
  30. package/dist/components/ui/atoms/step-indicator.js +151 -0
  31. package/dist/components/ui/atoms/tooltip.js +1 -1
  32. package/dist/components/ui/index.js +431 -404
  33. package/dist/components/ui/molecules/chat-message-list.d.ts +74 -0
  34. package/dist/components/ui/molecules/chat-message-list.d.ts.map +1 -0
  35. package/dist/components/ui/molecules/chat-message-list.js +121 -0
  36. package/dist/components/ui/molecules/index.d.ts +6 -0
  37. package/dist/components/ui/molecules/index.d.ts.map +1 -1
  38. package/dist/components/ui/molecules/index.js +29 -20
  39. package/dist/components/ui/molecules/message.js +1 -1
  40. package/dist/components/ui/molecules/prompt-input.d.ts.map +1 -1
  41. package/dist/components/ui/molecules/prompt-input.js +42 -43
  42. package/dist/components/ui/molecules/requirement-badges.js +3 -3
  43. package/dist/components/ui/molecules/steps-progress.d.ts +13 -0
  44. package/dist/components/ui/molecules/steps-progress.d.ts.map +1 -0
  45. package/dist/components/ui/molecules/steps-progress.js +66 -0
  46. package/dist/components/ui/molecules/suggestion-card.d.ts +11 -0
  47. package/dist/components/ui/molecules/suggestion-card.d.ts.map +1 -0
  48. package/dist/components/ui/molecules/suggestion-card.js +53 -0
  49. package/dist/components/ui/molecules/toolkit-card.js +1 -1
  50. package/dist/components/ui/pages/chat-page.d.ts +75 -0
  51. package/dist/components/ui/pages/chat-page.d.ts.map +1 -0
  52. package/dist/components/ui/pages/chat-page.js +300 -0
  53. package/dist/components/ui/pages/index.d.ts +2 -0
  54. package/dist/components/ui/pages/index.d.ts.map +1 -1
  55. package/dist/components/ui/pages/index.js +2 -0
  56. package/dist/components/ui/templates/chat-template.d.ts +20 -0
  57. package/dist/components/ui/templates/chat-template.d.ts.map +1 -0
  58. package/dist/components/ui/templates/chat-template.js +148 -0
  59. package/dist/components/ui/templates/index.d.ts +2 -0
  60. package/dist/components/ui/templates/index.d.ts.map +1 -1
  61. package/dist/components/ui/templates/index.js +19 -9
  62. package/dist/highlighted-body-TPN3WLV5-DyOGcftJ.js +19 -0
  63. package/dist/index-BEZCAdXQ.js +1568 -0
  64. package/dist/main.js +461 -434
  65. package/dist/{markdown-ChximrBv.js → markdown-9KGBuupR.js} +6264 -6046
  66. package/dist/mermaid-O7DHMXV3-CUp9wvRi.js +4 -0
  67. package/dist/metadata/toolkit-icons.d.ts.map +1 -1
  68. package/dist/metadata/toolkit-icons.js +268 -259
  69. package/dist/metadata/toolkits.d.ts.map +1 -1
  70. package/dist/metadata/toolkits.js +80 -2
  71. package/dist/{toolkit-card-B0syFJQ6.js → toolkit-card-k8jio69G.js} +2 -2
  72. package/package.json +1 -1
  73. package/dist/highlighted-body-B3W2YXNL-D6XBJnwx.js +0 -19
  74. package/dist/index-DO05OIM5.js +0 -1545
  75. package/dist/mermaid-3ZIDBTTL-DtIP-JZq.js +0 -4
@@ -0,0 +1,1568 @@
1
+ import * as O from "react";
2
+ import { useLayoutEffect as Re } from "react";
3
+ import * as Oe from "react-dom";
4
+ import { P as Rt } from "./index-DLohNuco.js";
5
+ import { jsx as Y } from "react/jsx-runtime";
6
+ import { u as jt } from "./index-D2LZVjSn.js";
7
+ import { c as Ce } from "./index-DFZozV_h.js";
8
+ import { u as Pe } from "./index-0ioNhtNM.js";
9
+ import { u as Nt } from "./index-CCKe-Mpx.js";
10
+ import { u as Se } from "./index-BGQepRFJ.js";
11
+ const Ee = ["top", "right", "bottom", "left"], K = Math.min, W = Math.max, at = Math.round, ct = Math.floor, I = (t) => ({
12
+ x: t,
13
+ y: t
14
+ }), De = {
15
+ left: "right",
16
+ right: "left",
17
+ bottom: "top",
18
+ top: "bottom"
19
+ };
20
+ function vt(t, e, n) {
21
+ return W(t, K(e, n));
22
+ }
23
+ function j(t, e) {
24
+ return typeof t == "function" ? t(e) : t;
25
+ }
26
+ function q(t) {
27
+ return t.split("-")[0];
28
+ }
29
+ function et(t) {
30
+ return t.split("-")[1];
31
+ }
32
+ function Ot(t) {
33
+ return t === "x" ? "y" : "x";
34
+ }
35
+ function Ct(t) {
36
+ return t === "y" ? "height" : "width";
37
+ }
38
+ function z(t) {
39
+ const e = t[0];
40
+ return e === "t" || e === "b" ? "y" : "x";
41
+ }
42
+ function Pt(t) {
43
+ return Ot(z(t));
44
+ }
45
+ function Le(t, e, n) {
46
+ n === void 0 && (n = !1);
47
+ const o = et(t), r = Pt(t), i = Ct(r);
48
+ let s = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
49
+ return e.reference[i] > e.floating[i] && (s = ft(s)), [s, ft(s)];
50
+ }
51
+ function Me(t) {
52
+ const e = ft(t);
53
+ return [bt(t), e, bt(e)];
54
+ }
55
+ function bt(t) {
56
+ return t.includes("start") ? t.replace("start", "end") : t.replace("end", "start");
57
+ }
58
+ const kt = ["left", "right"], Ft = ["right", "left"], Te = ["top", "bottom"], $e = ["bottom", "top"];
59
+ function Ne(t, e, n) {
60
+ switch (t) {
61
+ case "top":
62
+ case "bottom":
63
+ return n ? e ? Ft : kt : e ? kt : Ft;
64
+ case "left":
65
+ case "right":
66
+ return e ? Te : $e;
67
+ default:
68
+ return [];
69
+ }
70
+ }
71
+ function ke(t, e, n, o) {
72
+ const r = et(t);
73
+ let i = Ne(q(t), n === "start", o);
74
+ return r && (i = i.map((s) => s + "-" + r), e && (i = i.concat(i.map(bt)))), i;
75
+ }
76
+ function ft(t) {
77
+ const e = q(t);
78
+ return De[e] + t.slice(e.length);
79
+ }
80
+ function Fe(t) {
81
+ return {
82
+ top: 0,
83
+ right: 0,
84
+ bottom: 0,
85
+ left: 0,
86
+ ...t
87
+ };
88
+ }
89
+ function qt(t) {
90
+ return typeof t != "number" ? Fe(t) : {
91
+ top: t,
92
+ right: t,
93
+ bottom: t,
94
+ left: t
95
+ };
96
+ }
97
+ function ut(t) {
98
+ const {
99
+ x: e,
100
+ y: n,
101
+ width: o,
102
+ height: r
103
+ } = t;
104
+ return {
105
+ width: o,
106
+ height: r,
107
+ top: n,
108
+ left: e,
109
+ right: e + o,
110
+ bottom: n + r,
111
+ x: e,
112
+ y: n
113
+ };
114
+ }
115
+ function Wt(t, e, n) {
116
+ let {
117
+ reference: o,
118
+ floating: r
119
+ } = t;
120
+ const i = z(e), s = Pt(e), c = Ct(s), l = q(e), u = i === "y", a = o.x + o.width / 2 - r.width / 2, d = o.y + o.height / 2 - r.height / 2, m = o[c] / 2 - r[c] / 2;
121
+ let f;
122
+ switch (l) {
123
+ case "top":
124
+ f = {
125
+ x: a,
126
+ y: o.y - r.height
127
+ };
128
+ break;
129
+ case "bottom":
130
+ f = {
131
+ x: a,
132
+ y: o.y + o.height
133
+ };
134
+ break;
135
+ case "right":
136
+ f = {
137
+ x: o.x + o.width,
138
+ y: d
139
+ };
140
+ break;
141
+ case "left":
142
+ f = {
143
+ x: o.x - r.width,
144
+ y: d
145
+ };
146
+ break;
147
+ default:
148
+ f = {
149
+ x: o.x,
150
+ y: o.y
151
+ };
152
+ }
153
+ switch (et(e)) {
154
+ case "start":
155
+ f[s] -= m * (n && u ? -1 : 1);
156
+ break;
157
+ case "end":
158
+ f[s] += m * (n && u ? -1 : 1);
159
+ break;
160
+ }
161
+ return f;
162
+ }
163
+ async function We(t, e) {
164
+ var n;
165
+ e === void 0 && (e = {});
166
+ const {
167
+ x: o,
168
+ y: r,
169
+ platform: i,
170
+ rects: s,
171
+ elements: c,
172
+ strategy: l
173
+ } = t, {
174
+ boundary: u = "clippingAncestors",
175
+ rootBoundary: a = "viewport",
176
+ elementContext: d = "floating",
177
+ altBoundary: m = !1,
178
+ padding: f = 0
179
+ } = j(e, t), p = qt(f), x = c[m ? d === "floating" ? "reference" : "floating" : d], g = ut(await i.getClippingRect({
180
+ element: (n = await (i.isElement == null ? void 0 : i.isElement(x))) == null || n ? x : x.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
181
+ boundary: u,
182
+ rootBoundary: a,
183
+ strategy: l
184
+ })), v = d === "floating" ? {
185
+ x: o,
186
+ y: r,
187
+ width: s.floating.width,
188
+ height: s.floating.height
189
+ } : s.reference, y = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), w = await (i.isElement == null ? void 0 : i.isElement(y)) ? await (i.getScale == null ? void 0 : i.getScale(y)) || {
190
+ x: 1,
191
+ y: 1
192
+ } : {
193
+ x: 1,
194
+ y: 1
195
+ }, A = ut(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
196
+ elements: c,
197
+ rect: v,
198
+ offsetParent: y,
199
+ strategy: l
200
+ }) : v);
201
+ return {
202
+ top: (g.top - A.top + p.top) / w.y,
203
+ bottom: (A.bottom - g.bottom + p.bottom) / w.y,
204
+ left: (g.left - A.left + p.left) / w.x,
205
+ right: (A.right - g.right + p.right) / w.x
206
+ };
207
+ }
208
+ const _e = 50, He = async (t, e, n) => {
209
+ const {
210
+ placement: o = "bottom",
211
+ strategy: r = "absolute",
212
+ middleware: i = [],
213
+ platform: s
214
+ } = n, c = s.detectOverflow ? s : {
215
+ ...s,
216
+ detectOverflow: We
217
+ }, l = await (s.isRTL == null ? void 0 : s.isRTL(e));
218
+ let u = await s.getElementRects({
219
+ reference: t,
220
+ floating: e,
221
+ strategy: r
222
+ }), {
223
+ x: a,
224
+ y: d
225
+ } = Wt(u, o, l), m = o, f = 0;
226
+ const p = {};
227
+ for (let h = 0; h < i.length; h++) {
228
+ const x = i[h];
229
+ if (!x)
230
+ continue;
231
+ const {
232
+ name: g,
233
+ fn: v
234
+ } = x, {
235
+ x: y,
236
+ y: w,
237
+ data: A,
238
+ reset: R
239
+ } = await v({
240
+ x: a,
241
+ y: d,
242
+ initialPlacement: o,
243
+ placement: m,
244
+ strategy: r,
245
+ middlewareData: p,
246
+ rects: u,
247
+ platform: c,
248
+ elements: {
249
+ reference: t,
250
+ floating: e
251
+ }
252
+ });
253
+ a = y ?? a, d = w ?? d, p[g] = {
254
+ ...p[g],
255
+ ...A
256
+ }, R && f < _e && (f++, typeof R == "object" && (R.placement && (m = R.placement), R.rects && (u = R.rects === !0 ? await s.getElementRects({
257
+ reference: t,
258
+ floating: e,
259
+ strategy: r
260
+ }) : R.rects), {
261
+ x: a,
262
+ y: d
263
+ } = Wt(u, m, l)), h = -1);
264
+ }
265
+ return {
266
+ x: a,
267
+ y: d,
268
+ placement: m,
269
+ strategy: r,
270
+ middlewareData: p
271
+ };
272
+ }, Be = (t) => ({
273
+ name: "arrow",
274
+ options: t,
275
+ async fn(e) {
276
+ const {
277
+ x: n,
278
+ y: o,
279
+ placement: r,
280
+ rects: i,
281
+ platform: s,
282
+ elements: c,
283
+ middlewareData: l
284
+ } = e, {
285
+ element: u,
286
+ padding: a = 0
287
+ } = j(t, e) || {};
288
+ if (u == null)
289
+ return {};
290
+ const d = qt(a), m = {
291
+ x: n,
292
+ y: o
293
+ }, f = Pt(r), p = Ct(f), h = await s.getDimensions(u), x = f === "y", g = x ? "top" : "left", v = x ? "bottom" : "right", y = x ? "clientHeight" : "clientWidth", w = i.reference[p] + i.reference[f] - m[f] - i.floating[p], A = m[f] - i.reference[f], R = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(u));
294
+ let C = R ? R[y] : 0;
295
+ (!C || !await (s.isElement == null ? void 0 : s.isElement(R))) && (C = c.floating[y] || i.floating[p]);
296
+ const M = w / 2 - A / 2, k = C / 2 - h[p] / 2 - 1, L = K(d[g], k), $ = K(d[v], k), N = L, S = C - h[p] - $, P = C / 2 - h[p] / 2 + M, F = vt(N, P, S), E = !l.arrow && et(r) != null && P !== F && i.reference[p] / 2 - (P < N ? L : $) - h[p] / 2 < 0, D = E ? P < N ? P - N : P - S : 0;
297
+ return {
298
+ [f]: m[f] + D,
299
+ data: {
300
+ [f]: F,
301
+ centerOffset: P - F - D,
302
+ ...E && {
303
+ alignmentOffset: D
304
+ }
305
+ },
306
+ reset: E
307
+ };
308
+ }
309
+ }), Ve = function(t) {
310
+ return t === void 0 && (t = {}), {
311
+ name: "flip",
312
+ options: t,
313
+ async fn(e) {
314
+ var n, o;
315
+ const {
316
+ placement: r,
317
+ middlewareData: i,
318
+ rects: s,
319
+ initialPlacement: c,
320
+ platform: l,
321
+ elements: u
322
+ } = e, {
323
+ mainAxis: a = !0,
324
+ crossAxis: d = !0,
325
+ fallbackPlacements: m,
326
+ fallbackStrategy: f = "bestFit",
327
+ fallbackAxisSideDirection: p = "none",
328
+ flipAlignment: h = !0,
329
+ ...x
330
+ } = j(t, e);
331
+ if ((n = i.arrow) != null && n.alignmentOffset)
332
+ return {};
333
+ const g = q(r), v = z(c), y = q(c) === c, w = await (l.isRTL == null ? void 0 : l.isRTL(u.floating)), A = m || (y || !h ? [ft(c)] : Me(c)), R = p !== "none";
334
+ !m && R && A.push(...ke(c, h, p, w));
335
+ const C = [c, ...A], M = await l.detectOverflow(e, x), k = [];
336
+ let L = ((o = i.flip) == null ? void 0 : o.overflows) || [];
337
+ if (a && k.push(M[g]), d) {
338
+ const P = Le(r, s, w);
339
+ k.push(M[P[0]], M[P[1]]);
340
+ }
341
+ if (L = [...L, {
342
+ placement: r,
343
+ overflows: k
344
+ }], !k.every((P) => P <= 0)) {
345
+ var $, N;
346
+ const P = ((($ = i.flip) == null ? void 0 : $.index) || 0) + 1, F = C[P];
347
+ if (F && (!(d === "alignment" ? v !== z(F) : !1) || // We leave the current main axis only if every placement on that axis
348
+ // overflows the main axis.
349
+ L.every((b) => z(b.placement) === v ? b.overflows[0] > 0 : !0)))
350
+ return {
351
+ data: {
352
+ index: P,
353
+ overflows: L
354
+ },
355
+ reset: {
356
+ placement: F
357
+ }
358
+ };
359
+ let E = (N = L.filter((D) => D.overflows[0] <= 0).sort((D, b) => D.overflows[1] - b.overflows[1])[0]) == null ? void 0 : N.placement;
360
+ if (!E)
361
+ switch (f) {
362
+ case "bestFit": {
363
+ var S;
364
+ const D = (S = L.filter((b) => {
365
+ if (R) {
366
+ const T = z(b.placement);
367
+ return T === v || // Create a bias to the `y` side axis due to horizontal
368
+ // reading directions favoring greater width.
369
+ T === "y";
370
+ }
371
+ return !0;
372
+ }).map((b) => [b.placement, b.overflows.filter((T) => T > 0).reduce((T, V) => T + V, 0)]).sort((b, T) => b[1] - T[1])[0]) == null ? void 0 : S[0];
373
+ D && (E = D);
374
+ break;
375
+ }
376
+ case "initialPlacement":
377
+ E = c;
378
+ break;
379
+ }
380
+ if (r !== E)
381
+ return {
382
+ reset: {
383
+ placement: E
384
+ }
385
+ };
386
+ }
387
+ return {};
388
+ }
389
+ };
390
+ };
391
+ function _t(t, e) {
392
+ return {
393
+ top: t.top - e.height,
394
+ right: t.right - e.width,
395
+ bottom: t.bottom - e.height,
396
+ left: t.left - e.width
397
+ };
398
+ }
399
+ function Ht(t) {
400
+ return Ee.some((e) => t[e] >= 0);
401
+ }
402
+ const ze = function(t) {
403
+ return t === void 0 && (t = {}), {
404
+ name: "hide",
405
+ options: t,
406
+ async fn(e) {
407
+ const {
408
+ rects: n,
409
+ platform: o
410
+ } = e, {
411
+ strategy: r = "referenceHidden",
412
+ ...i
413
+ } = j(t, e);
414
+ switch (r) {
415
+ case "referenceHidden": {
416
+ const s = await o.detectOverflow(e, {
417
+ ...i,
418
+ elementContext: "reference"
419
+ }), c = _t(s, n.reference);
420
+ return {
421
+ data: {
422
+ referenceHiddenOffsets: c,
423
+ referenceHidden: Ht(c)
424
+ }
425
+ };
426
+ }
427
+ case "escaped": {
428
+ const s = await o.detectOverflow(e, {
429
+ ...i,
430
+ altBoundary: !0
431
+ }), c = _t(s, n.floating);
432
+ return {
433
+ data: {
434
+ escapedOffsets: c,
435
+ escaped: Ht(c)
436
+ }
437
+ };
438
+ }
439
+ default:
440
+ return {};
441
+ }
442
+ }
443
+ };
444
+ }, Ut = /* @__PURE__ */ new Set(["left", "top"]);
445
+ async function Ie(t, e) {
446
+ const {
447
+ placement: n,
448
+ platform: o,
449
+ elements: r
450
+ } = t, i = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), s = q(n), c = et(n), l = z(n) === "y", u = Ut.has(s) ? -1 : 1, a = i && l ? -1 : 1, d = j(e, t);
451
+ let {
452
+ mainAxis: m,
453
+ crossAxis: f,
454
+ alignmentAxis: p
455
+ } = typeof d == "number" ? {
456
+ mainAxis: d,
457
+ crossAxis: 0,
458
+ alignmentAxis: null
459
+ } : {
460
+ mainAxis: d.mainAxis || 0,
461
+ crossAxis: d.crossAxis || 0,
462
+ alignmentAxis: d.alignmentAxis
463
+ };
464
+ return c && typeof p == "number" && (f = c === "end" ? p * -1 : p), l ? {
465
+ x: f * a,
466
+ y: m * u
467
+ } : {
468
+ x: m * u,
469
+ y: f * a
470
+ };
471
+ }
472
+ const Xe = function(t) {
473
+ return t === void 0 && (t = 0), {
474
+ name: "offset",
475
+ options: t,
476
+ async fn(e) {
477
+ var n, o;
478
+ const {
479
+ x: r,
480
+ y: i,
481
+ placement: s,
482
+ middlewareData: c
483
+ } = e, l = await Ie(e, t);
484
+ return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
485
+ x: r + l.x,
486
+ y: i + l.y,
487
+ data: {
488
+ ...l,
489
+ placement: s
490
+ }
491
+ };
492
+ }
493
+ };
494
+ }, Ye = function(t) {
495
+ return t === void 0 && (t = {}), {
496
+ name: "shift",
497
+ options: t,
498
+ async fn(e) {
499
+ const {
500
+ x: n,
501
+ y: o,
502
+ placement: r,
503
+ platform: i
504
+ } = e, {
505
+ mainAxis: s = !0,
506
+ crossAxis: c = !1,
507
+ limiter: l = {
508
+ fn: (g) => {
509
+ let {
510
+ x: v,
511
+ y
512
+ } = g;
513
+ return {
514
+ x: v,
515
+ y
516
+ };
517
+ }
518
+ },
519
+ ...u
520
+ } = j(t, e), a = {
521
+ x: n,
522
+ y: o
523
+ }, d = await i.detectOverflow(e, u), m = z(q(r)), f = Ot(m);
524
+ let p = a[f], h = a[m];
525
+ if (s) {
526
+ const g = f === "y" ? "top" : "left", v = f === "y" ? "bottom" : "right", y = p + d[g], w = p - d[v];
527
+ p = vt(y, p, w);
528
+ }
529
+ if (c) {
530
+ const g = m === "y" ? "top" : "left", v = m === "y" ? "bottom" : "right", y = h + d[g], w = h - d[v];
531
+ h = vt(y, h, w);
532
+ }
533
+ const x = l.fn({
534
+ ...e,
535
+ [f]: p,
536
+ [m]: h
537
+ });
538
+ return {
539
+ ...x,
540
+ data: {
541
+ x: x.x - n,
542
+ y: x.y - o,
543
+ enabled: {
544
+ [f]: s,
545
+ [m]: c
546
+ }
547
+ }
548
+ };
549
+ }
550
+ };
551
+ }, je = function(t) {
552
+ return t === void 0 && (t = {}), {
553
+ options: t,
554
+ fn(e) {
555
+ const {
556
+ x: n,
557
+ y: o,
558
+ placement: r,
559
+ rects: i,
560
+ middlewareData: s
561
+ } = e, {
562
+ offset: c = 0,
563
+ mainAxis: l = !0,
564
+ crossAxis: u = !0
565
+ } = j(t, e), a = {
566
+ x: n,
567
+ y: o
568
+ }, d = z(r), m = Ot(d);
569
+ let f = a[m], p = a[d];
570
+ const h = j(c, e), x = typeof h == "number" ? {
571
+ mainAxis: h,
572
+ crossAxis: 0
573
+ } : {
574
+ mainAxis: 0,
575
+ crossAxis: 0,
576
+ ...h
577
+ };
578
+ if (l) {
579
+ const y = m === "y" ? "height" : "width", w = i.reference[m] - i.floating[y] + x.mainAxis, A = i.reference[m] + i.reference[y] - x.mainAxis;
580
+ f < w ? f = w : f > A && (f = A);
581
+ }
582
+ if (u) {
583
+ var g, v;
584
+ const y = m === "y" ? "width" : "height", w = Ut.has(q(r)), A = i.reference[d] - i.floating[y] + (w && ((g = s.offset) == null ? void 0 : g[d]) || 0) + (w ? 0 : x.crossAxis), R = i.reference[d] + i.reference[y] + (w ? 0 : ((v = s.offset) == null ? void 0 : v[d]) || 0) - (w ? x.crossAxis : 0);
585
+ p < A ? p = A : p > R && (p = R);
586
+ }
587
+ return {
588
+ [m]: f,
589
+ [d]: p
590
+ };
591
+ }
592
+ };
593
+ }, qe = function(t) {
594
+ return t === void 0 && (t = {}), {
595
+ name: "size",
596
+ options: t,
597
+ async fn(e) {
598
+ var n, o;
599
+ const {
600
+ placement: r,
601
+ rects: i,
602
+ platform: s,
603
+ elements: c
604
+ } = e, {
605
+ apply: l = () => {
606
+ },
607
+ ...u
608
+ } = j(t, e), a = await s.detectOverflow(e, u), d = q(r), m = et(r), f = z(r) === "y", {
609
+ width: p,
610
+ height: h
611
+ } = i.floating;
612
+ let x, g;
613
+ d === "top" || d === "bottom" ? (x = d, g = m === (await (s.isRTL == null ? void 0 : s.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (g = d, x = m === "end" ? "top" : "bottom");
614
+ const v = h - a.top - a.bottom, y = p - a.left - a.right, w = K(h - a[x], v), A = K(p - a[g], y), R = !e.middlewareData.shift;
615
+ let C = w, M = A;
616
+ if ((n = e.middlewareData.shift) != null && n.enabled.x && (M = y), (o = e.middlewareData.shift) != null && o.enabled.y && (C = v), R && !m) {
617
+ const L = W(a.left, 0), $ = W(a.right, 0), N = W(a.top, 0), S = W(a.bottom, 0);
618
+ f ? M = p - 2 * (L !== 0 || $ !== 0 ? L + $ : W(a.left, a.right)) : C = h - 2 * (N !== 0 || S !== 0 ? N + S : W(a.top, a.bottom));
619
+ }
620
+ await l({
621
+ ...e,
622
+ availableWidth: M,
623
+ availableHeight: C
624
+ });
625
+ const k = await s.getDimensions(c.floating);
626
+ return p !== k.width || h !== k.height ? {
627
+ reset: {
628
+ rects: !0
629
+ }
630
+ } : {};
631
+ }
632
+ };
633
+ };
634
+ function mt() {
635
+ return typeof window < "u";
636
+ }
637
+ function nt(t) {
638
+ return Kt(t) ? (t.nodeName || "").toLowerCase() : "#document";
639
+ }
640
+ function _(t) {
641
+ var e;
642
+ return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
643
+ }
644
+ function X(t) {
645
+ var e;
646
+ return (e = (Kt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
647
+ }
648
+ function Kt(t) {
649
+ return mt() ? t instanceof Node || t instanceof _(t).Node : !1;
650
+ }
651
+ function H(t) {
652
+ return mt() ? t instanceof Element || t instanceof _(t).Element : !1;
653
+ }
654
+ function U(t) {
655
+ return mt() ? t instanceof HTMLElement || t instanceof _(t).HTMLElement : !1;
656
+ }
657
+ function Bt(t) {
658
+ return !mt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof _(t).ShadowRoot;
659
+ }
660
+ function it(t) {
661
+ const {
662
+ overflow: e,
663
+ overflowX: n,
664
+ overflowY: o,
665
+ display: r
666
+ } = B(t);
667
+ return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && r !== "inline" && r !== "contents";
668
+ }
669
+ function Ue(t) {
670
+ return /^(table|td|th)$/.test(nt(t));
671
+ }
672
+ function pt(t) {
673
+ try {
674
+ if (t.matches(":popover-open"))
675
+ return !0;
676
+ } catch {
677
+ }
678
+ try {
679
+ return t.matches(":modal");
680
+ } catch {
681
+ return !1;
682
+ }
683
+ }
684
+ const Ke = /transform|translate|scale|rotate|perspective|filter/, Ze = /paint|layout|strict|content/, G = (t) => !!t && t !== "none";
685
+ let wt;
686
+ function St(t) {
687
+ const e = H(t) ? B(t) : t;
688
+ return G(e.transform) || G(e.translate) || G(e.scale) || G(e.rotate) || G(e.perspective) || !Et() && (G(e.backdropFilter) || G(e.filter)) || Ke.test(e.willChange || "") || Ze.test(e.contain || "");
689
+ }
690
+ function Ge(t) {
691
+ let e = Z(t);
692
+ for (; U(e) && !tt(e); ) {
693
+ if (St(e))
694
+ return e;
695
+ if (pt(e))
696
+ return null;
697
+ e = Z(e);
698
+ }
699
+ return null;
700
+ }
701
+ function Et() {
702
+ return wt == null && (wt = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), wt;
703
+ }
704
+ function tt(t) {
705
+ return /^(html|body|#document)$/.test(nt(t));
706
+ }
707
+ function B(t) {
708
+ return _(t).getComputedStyle(t);
709
+ }
710
+ function ht(t) {
711
+ return H(t) ? {
712
+ scrollLeft: t.scrollLeft,
713
+ scrollTop: t.scrollTop
714
+ } : {
715
+ scrollLeft: t.scrollX,
716
+ scrollTop: t.scrollY
717
+ };
718
+ }
719
+ function Z(t) {
720
+ if (nt(t) === "html")
721
+ return t;
722
+ const e = (
723
+ // Step into the shadow DOM of the parent of a slotted node.
724
+ t.assignedSlot || // DOM Element detected.
725
+ t.parentNode || // ShadowRoot detected.
726
+ Bt(t) && t.host || // Fallback.
727
+ X(t)
728
+ );
729
+ return Bt(e) ? e.host : e;
730
+ }
731
+ function Zt(t) {
732
+ const e = Z(t);
733
+ return tt(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : U(e) && it(e) ? e : Zt(e);
734
+ }
735
+ function rt(t, e, n) {
736
+ var o;
737
+ e === void 0 && (e = []), n === void 0 && (n = !0);
738
+ const r = Zt(t), i = r === ((o = t.ownerDocument) == null ? void 0 : o.body), s = _(r);
739
+ if (i) {
740
+ const c = At(s);
741
+ return e.concat(s, s.visualViewport || [], it(r) ? r : [], c && n ? rt(c) : []);
742
+ } else
743
+ return e.concat(r, rt(r, [], n));
744
+ }
745
+ function At(t) {
746
+ return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
747
+ }
748
+ function Gt(t) {
749
+ const e = B(t);
750
+ let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
751
+ const r = U(t), i = r ? t.offsetWidth : n, s = r ? t.offsetHeight : o, c = at(n) !== i || at(o) !== s;
752
+ return c && (n = i, o = s), {
753
+ width: n,
754
+ height: o,
755
+ $: c
756
+ };
757
+ }
758
+ function Dt(t) {
759
+ return H(t) ? t : t.contextElement;
760
+ }
761
+ function Q(t) {
762
+ const e = Dt(t);
763
+ if (!U(e))
764
+ return I(1);
765
+ const n = e.getBoundingClientRect(), {
766
+ width: o,
767
+ height: r,
768
+ $: i
769
+ } = Gt(e);
770
+ let s = (i ? at(n.width) : n.width) / o, c = (i ? at(n.height) : n.height) / r;
771
+ return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
772
+ x: s,
773
+ y: c
774
+ };
775
+ }
776
+ const Je = /* @__PURE__ */ I(0);
777
+ function Jt(t) {
778
+ const e = _(t);
779
+ return !Et() || !e.visualViewport ? Je : {
780
+ x: e.visualViewport.offsetLeft,
781
+ y: e.visualViewport.offsetTop
782
+ };
783
+ }
784
+ function Qe(t, e, n) {
785
+ return e === void 0 && (e = !1), !n || e && n !== _(t) ? !1 : e;
786
+ }
787
+ function J(t, e, n, o) {
788
+ e === void 0 && (e = !1), n === void 0 && (n = !1);
789
+ const r = t.getBoundingClientRect(), i = Dt(t);
790
+ let s = I(1);
791
+ e && (o ? H(o) && (s = Q(o)) : s = Q(t));
792
+ const c = Qe(i, n, o) ? Jt(i) : I(0);
793
+ let l = (r.left + c.x) / s.x, u = (r.top + c.y) / s.y, a = r.width / s.x, d = r.height / s.y;
794
+ if (i) {
795
+ const m = _(i), f = o && H(o) ? _(o) : o;
796
+ let p = m, h = At(p);
797
+ for (; h && o && f !== p; ) {
798
+ const x = Q(h), g = h.getBoundingClientRect(), v = B(h), y = g.left + (h.clientLeft + parseFloat(v.paddingLeft)) * x.x, w = g.top + (h.clientTop + parseFloat(v.paddingTop)) * x.y;
799
+ l *= x.x, u *= x.y, a *= x.x, d *= x.y, l += y, u += w, p = _(h), h = At(p);
800
+ }
801
+ }
802
+ return ut({
803
+ width: a,
804
+ height: d,
805
+ x: l,
806
+ y: u
807
+ });
808
+ }
809
+ function gt(t, e) {
810
+ const n = ht(t).scrollLeft;
811
+ return e ? e.left + n : J(X(t)).left + n;
812
+ }
813
+ function Qt(t, e) {
814
+ const n = t.getBoundingClientRect(), o = n.left + e.scrollLeft - gt(t, n), r = n.top + e.scrollTop;
815
+ return {
816
+ x: o,
817
+ y: r
818
+ };
819
+ }
820
+ function tn(t) {
821
+ let {
822
+ elements: e,
823
+ rect: n,
824
+ offsetParent: o,
825
+ strategy: r
826
+ } = t;
827
+ const i = r === "fixed", s = X(o), c = e ? pt(e.floating) : !1;
828
+ if (o === s || c && i)
829
+ return n;
830
+ let l = {
831
+ scrollLeft: 0,
832
+ scrollTop: 0
833
+ }, u = I(1);
834
+ const a = I(0), d = U(o);
835
+ if ((d || !d && !i) && ((nt(o) !== "body" || it(s)) && (l = ht(o)), d)) {
836
+ const f = J(o);
837
+ u = Q(o), a.x = f.x + o.clientLeft, a.y = f.y + o.clientTop;
838
+ }
839
+ const m = s && !d && !i ? Qt(s, l) : I(0);
840
+ return {
841
+ width: n.width * u.x,
842
+ height: n.height * u.y,
843
+ x: n.x * u.x - l.scrollLeft * u.x + a.x + m.x,
844
+ y: n.y * u.y - l.scrollTop * u.y + a.y + m.y
845
+ };
846
+ }
847
+ function en(t) {
848
+ return Array.from(t.getClientRects());
849
+ }
850
+ function nn(t) {
851
+ const e = X(t), n = ht(t), o = t.ownerDocument.body, r = W(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), i = W(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
852
+ let s = -n.scrollLeft + gt(t);
853
+ const c = -n.scrollTop;
854
+ return B(o).direction === "rtl" && (s += W(e.clientWidth, o.clientWidth) - r), {
855
+ width: r,
856
+ height: i,
857
+ x: s,
858
+ y: c
859
+ };
860
+ }
861
+ const Vt = 25;
862
+ function on(t, e) {
863
+ const n = _(t), o = X(t), r = n.visualViewport;
864
+ let i = o.clientWidth, s = o.clientHeight, c = 0, l = 0;
865
+ if (r) {
866
+ i = r.width, s = r.height;
867
+ const a = Et();
868
+ (!a || a && e === "fixed") && (c = r.offsetLeft, l = r.offsetTop);
869
+ }
870
+ const u = gt(o);
871
+ if (u <= 0) {
872
+ const a = o.ownerDocument, d = a.body, m = getComputedStyle(d), f = a.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, p = Math.abs(o.clientWidth - d.clientWidth - f);
873
+ p <= Vt && (i -= p);
874
+ } else u <= Vt && (i += u);
875
+ return {
876
+ width: i,
877
+ height: s,
878
+ x: c,
879
+ y: l
880
+ };
881
+ }
882
+ function rn(t, e) {
883
+ const n = J(t, !0, e === "fixed"), o = n.top + t.clientTop, r = n.left + t.clientLeft, i = U(t) ? Q(t) : I(1), s = t.clientWidth * i.x, c = t.clientHeight * i.y, l = r * i.x, u = o * i.y;
884
+ return {
885
+ width: s,
886
+ height: c,
887
+ x: l,
888
+ y: u
889
+ };
890
+ }
891
+ function zt(t, e, n) {
892
+ let o;
893
+ if (e === "viewport")
894
+ o = on(t, n);
895
+ else if (e === "document")
896
+ o = nn(X(t));
897
+ else if (H(e))
898
+ o = rn(e, n);
899
+ else {
900
+ const r = Jt(t);
901
+ o = {
902
+ x: e.x - r.x,
903
+ y: e.y - r.y,
904
+ width: e.width,
905
+ height: e.height
906
+ };
907
+ }
908
+ return ut(o);
909
+ }
910
+ function te(t, e) {
911
+ const n = Z(t);
912
+ return n === e || !H(n) || tt(n) ? !1 : B(n).position === "fixed" || te(n, e);
913
+ }
914
+ function sn(t, e) {
915
+ const n = e.get(t);
916
+ if (n)
917
+ return n;
918
+ let o = rt(t, [], !1).filter((c) => H(c) && nt(c) !== "body"), r = null;
919
+ const i = B(t).position === "fixed";
920
+ let s = i ? Z(t) : t;
921
+ for (; H(s) && !tt(s); ) {
922
+ const c = B(s), l = St(s);
923
+ !l && c.position === "fixed" && (r = null), (i ? !l && !r : !l && c.position === "static" && !!r && (r.position === "absolute" || r.position === "fixed") || it(s) && !l && te(t, s)) ? o = o.filter((a) => a !== s) : r = c, s = Z(s);
924
+ }
925
+ return e.set(t, o), o;
926
+ }
927
+ function cn(t) {
928
+ let {
929
+ element: e,
930
+ boundary: n,
931
+ rootBoundary: o,
932
+ strategy: r
933
+ } = t;
934
+ const s = [...n === "clippingAncestors" ? pt(e) ? [] : sn(e, this._c) : [].concat(n), o], c = zt(e, s[0], r);
935
+ let l = c.top, u = c.right, a = c.bottom, d = c.left;
936
+ for (let m = 1; m < s.length; m++) {
937
+ const f = zt(e, s[m], r);
938
+ l = W(f.top, l), u = K(f.right, u), a = K(f.bottom, a), d = W(f.left, d);
939
+ }
940
+ return {
941
+ width: u - d,
942
+ height: a - l,
943
+ x: d,
944
+ y: l
945
+ };
946
+ }
947
+ function ln(t) {
948
+ const {
949
+ width: e,
950
+ height: n
951
+ } = Gt(t);
952
+ return {
953
+ width: e,
954
+ height: n
955
+ };
956
+ }
957
+ function an(t, e, n) {
958
+ const o = U(e), r = X(e), i = n === "fixed", s = J(t, !0, i, e);
959
+ let c = {
960
+ scrollLeft: 0,
961
+ scrollTop: 0
962
+ };
963
+ const l = I(0);
964
+ function u() {
965
+ l.x = gt(r);
966
+ }
967
+ if (o || !o && !i)
968
+ if ((nt(e) !== "body" || it(r)) && (c = ht(e)), o) {
969
+ const f = J(e, !0, i, e);
970
+ l.x = f.x + e.clientLeft, l.y = f.y + e.clientTop;
971
+ } else r && u();
972
+ i && !o && r && u();
973
+ const a = r && !o && !i ? Qt(r, c) : I(0), d = s.left + c.scrollLeft - l.x - a.x, m = s.top + c.scrollTop - l.y - a.y;
974
+ return {
975
+ x: d,
976
+ y: m,
977
+ width: s.width,
978
+ height: s.height
979
+ };
980
+ }
981
+ function xt(t) {
982
+ return B(t).position === "static";
983
+ }
984
+ function It(t, e) {
985
+ if (!U(t) || B(t).position === "fixed")
986
+ return null;
987
+ if (e)
988
+ return e(t);
989
+ let n = t.offsetParent;
990
+ return X(t) === n && (n = n.ownerDocument.body), n;
991
+ }
992
+ function ee(t, e) {
993
+ const n = _(t);
994
+ if (pt(t))
995
+ return n;
996
+ if (!U(t)) {
997
+ let r = Z(t);
998
+ for (; r && !tt(r); ) {
999
+ if (H(r) && !xt(r))
1000
+ return r;
1001
+ r = Z(r);
1002
+ }
1003
+ return n;
1004
+ }
1005
+ let o = It(t, e);
1006
+ for (; o && Ue(o) && xt(o); )
1007
+ o = It(o, e);
1008
+ return o && tt(o) && xt(o) && !St(o) ? n : o || Ge(t) || n;
1009
+ }
1010
+ const fn = async function(t) {
1011
+ const e = this.getOffsetParent || ee, n = this.getDimensions, o = await n(t.floating);
1012
+ return {
1013
+ reference: an(t.reference, await e(t.floating), t.strategy),
1014
+ floating: {
1015
+ x: 0,
1016
+ y: 0,
1017
+ width: o.width,
1018
+ height: o.height
1019
+ }
1020
+ };
1021
+ };
1022
+ function un(t) {
1023
+ return B(t).direction === "rtl";
1024
+ }
1025
+ const dn = {
1026
+ convertOffsetParentRelativeRectToViewportRelativeRect: tn,
1027
+ getDocumentElement: X,
1028
+ getClippingRect: cn,
1029
+ getOffsetParent: ee,
1030
+ getElementRects: fn,
1031
+ getClientRects: en,
1032
+ getDimensions: ln,
1033
+ getScale: Q,
1034
+ isElement: H,
1035
+ isRTL: un
1036
+ };
1037
+ function ne(t, e) {
1038
+ return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1039
+ }
1040
+ function mn(t, e) {
1041
+ let n = null, o;
1042
+ const r = X(t);
1043
+ function i() {
1044
+ var c;
1045
+ clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
1046
+ }
1047
+ function s(c, l) {
1048
+ c === void 0 && (c = !1), l === void 0 && (l = 1), i();
1049
+ const u = t.getBoundingClientRect(), {
1050
+ left: a,
1051
+ top: d,
1052
+ width: m,
1053
+ height: f
1054
+ } = u;
1055
+ if (c || e(), !m || !f)
1056
+ return;
1057
+ const p = ct(d), h = ct(r.clientWidth - (a + m)), x = ct(r.clientHeight - (d + f)), g = ct(a), y = {
1058
+ rootMargin: -p + "px " + -h + "px " + -x + "px " + -g + "px",
1059
+ threshold: W(0, K(1, l)) || 1
1060
+ };
1061
+ let w = !0;
1062
+ function A(R) {
1063
+ const C = R[0].intersectionRatio;
1064
+ if (C !== l) {
1065
+ if (!w)
1066
+ return s();
1067
+ C ? s(!1, C) : o = setTimeout(() => {
1068
+ s(!1, 1e-7);
1069
+ }, 1e3);
1070
+ }
1071
+ C === 1 && !ne(u, t.getBoundingClientRect()) && s(), w = !1;
1072
+ }
1073
+ try {
1074
+ n = new IntersectionObserver(A, {
1075
+ ...y,
1076
+ // Handle <iframe>s
1077
+ root: r.ownerDocument
1078
+ });
1079
+ } catch {
1080
+ n = new IntersectionObserver(A, y);
1081
+ }
1082
+ n.observe(t);
1083
+ }
1084
+ return s(!0), i;
1085
+ }
1086
+ function pn(t, e, n, o) {
1087
+ o === void 0 && (o = {});
1088
+ const {
1089
+ ancestorScroll: r = !0,
1090
+ ancestorResize: i = !0,
1091
+ elementResize: s = typeof ResizeObserver == "function",
1092
+ layoutShift: c = typeof IntersectionObserver == "function",
1093
+ animationFrame: l = !1
1094
+ } = o, u = Dt(t), a = r || i ? [...u ? rt(u) : [], ...e ? rt(e) : []] : [];
1095
+ a.forEach((g) => {
1096
+ r && g.addEventListener("scroll", n, {
1097
+ passive: !0
1098
+ }), i && g.addEventListener("resize", n);
1099
+ });
1100
+ const d = u && c ? mn(u, n) : null;
1101
+ let m = -1, f = null;
1102
+ s && (f = new ResizeObserver((g) => {
1103
+ let [v] = g;
1104
+ v && v.target === u && f && e && (f.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1105
+ var y;
1106
+ (y = f) == null || y.observe(e);
1107
+ })), n();
1108
+ }), u && !l && f.observe(u), e && f.observe(e));
1109
+ let p, h = l ? J(t) : null;
1110
+ l && x();
1111
+ function x() {
1112
+ const g = J(t);
1113
+ h && !ne(h, g) && n(), h = g, p = requestAnimationFrame(x);
1114
+ }
1115
+ return n(), () => {
1116
+ var g;
1117
+ a.forEach((v) => {
1118
+ r && v.removeEventListener("scroll", n), i && v.removeEventListener("resize", n);
1119
+ }), d?.(), (g = f) == null || g.disconnect(), f = null, l && cancelAnimationFrame(p);
1120
+ };
1121
+ }
1122
+ const hn = Xe, gn = Ye, wn = Ve, xn = qe, yn = ze, Xt = Be, vn = je, bn = (t, e, n) => {
1123
+ const o = /* @__PURE__ */ new Map(), r = {
1124
+ platform: dn,
1125
+ ...n
1126
+ }, i = {
1127
+ ...r.platform,
1128
+ _c: o
1129
+ };
1130
+ return He(t, e, {
1131
+ ...r,
1132
+ platform: i
1133
+ });
1134
+ };
1135
+ var An = typeof document < "u", Rn = function() {
1136
+ }, lt = An ? Re : Rn;
1137
+ function dt(t, e) {
1138
+ if (t === e)
1139
+ return !0;
1140
+ if (typeof t != typeof e)
1141
+ return !1;
1142
+ if (typeof t == "function" && t.toString() === e.toString())
1143
+ return !0;
1144
+ let n, o, r;
1145
+ if (t && e && typeof t == "object") {
1146
+ if (Array.isArray(t)) {
1147
+ if (n = t.length, n !== e.length) return !1;
1148
+ for (o = n; o-- !== 0; )
1149
+ if (!dt(t[o], e[o]))
1150
+ return !1;
1151
+ return !0;
1152
+ }
1153
+ if (r = Object.keys(t), n = r.length, n !== Object.keys(e).length)
1154
+ return !1;
1155
+ for (o = n; o-- !== 0; )
1156
+ if (!{}.hasOwnProperty.call(e, r[o]))
1157
+ return !1;
1158
+ for (o = n; o-- !== 0; ) {
1159
+ const i = r[o];
1160
+ if (!(i === "_owner" && t.$$typeof) && !dt(t[i], e[i]))
1161
+ return !1;
1162
+ }
1163
+ return !0;
1164
+ }
1165
+ return t !== t && e !== e;
1166
+ }
1167
+ function oe(t) {
1168
+ return typeof window > "u" ? 1 : (t.ownerDocument.defaultView || window).devicePixelRatio || 1;
1169
+ }
1170
+ function Yt(t, e) {
1171
+ const n = oe(t);
1172
+ return Math.round(e * n) / n;
1173
+ }
1174
+ function yt(t) {
1175
+ const e = O.useRef(t);
1176
+ return lt(() => {
1177
+ e.current = t;
1178
+ }), e;
1179
+ }
1180
+ function On(t) {
1181
+ t === void 0 && (t = {});
1182
+ const {
1183
+ placement: e = "bottom",
1184
+ strategy: n = "absolute",
1185
+ middleware: o = [],
1186
+ platform: r,
1187
+ elements: {
1188
+ reference: i,
1189
+ floating: s
1190
+ } = {},
1191
+ transform: c = !0,
1192
+ whileElementsMounted: l,
1193
+ open: u
1194
+ } = t, [a, d] = O.useState({
1195
+ x: 0,
1196
+ y: 0,
1197
+ strategy: n,
1198
+ placement: e,
1199
+ middlewareData: {},
1200
+ isPositioned: !1
1201
+ }), [m, f] = O.useState(o);
1202
+ dt(m, o) || f(o);
1203
+ const [p, h] = O.useState(null), [x, g] = O.useState(null), v = O.useCallback((b) => {
1204
+ b !== R.current && (R.current = b, h(b));
1205
+ }, []), y = O.useCallback((b) => {
1206
+ b !== C.current && (C.current = b, g(b));
1207
+ }, []), w = i || p, A = s || x, R = O.useRef(null), C = O.useRef(null), M = O.useRef(a), k = l != null, L = yt(l), $ = yt(r), N = yt(u), S = O.useCallback(() => {
1208
+ if (!R.current || !C.current)
1209
+ return;
1210
+ const b = {
1211
+ placement: e,
1212
+ strategy: n,
1213
+ middleware: m
1214
+ };
1215
+ $.current && (b.platform = $.current), bn(R.current, C.current, b).then((T) => {
1216
+ const V = {
1217
+ ...T,
1218
+ // The floating element's position may be recomputed while it's closed
1219
+ // but still mounted (such as when transitioning out). To ensure
1220
+ // `isPositioned` will be `false` initially on the next open, avoid
1221
+ // setting it to `true` when `open === false` (must be specified).
1222
+ isPositioned: N.current !== !1
1223
+ };
1224
+ P.current && !dt(M.current, V) && (M.current = V, Oe.flushSync(() => {
1225
+ d(V);
1226
+ }));
1227
+ });
1228
+ }, [m, e, n, $, N]);
1229
+ lt(() => {
1230
+ u === !1 && M.current.isPositioned && (M.current.isPositioned = !1, d((b) => ({
1231
+ ...b,
1232
+ isPositioned: !1
1233
+ })));
1234
+ }, [u]);
1235
+ const P = O.useRef(!1);
1236
+ lt(() => (P.current = !0, () => {
1237
+ P.current = !1;
1238
+ }), []), lt(() => {
1239
+ if (w && (R.current = w), A && (C.current = A), w && A) {
1240
+ if (L.current)
1241
+ return L.current(w, A, S);
1242
+ S();
1243
+ }
1244
+ }, [w, A, S, L, k]);
1245
+ const F = O.useMemo(() => ({
1246
+ reference: R,
1247
+ floating: C,
1248
+ setReference: v,
1249
+ setFloating: y
1250
+ }), [v, y]), E = O.useMemo(() => ({
1251
+ reference: w,
1252
+ floating: A
1253
+ }), [w, A]), D = O.useMemo(() => {
1254
+ const b = {
1255
+ position: n,
1256
+ left: 0,
1257
+ top: 0
1258
+ };
1259
+ if (!E.floating)
1260
+ return b;
1261
+ const T = Yt(E.floating, a.x), V = Yt(E.floating, a.y);
1262
+ return c ? {
1263
+ ...b,
1264
+ transform: "translate(" + T + "px, " + V + "px)",
1265
+ ...oe(E.floating) >= 1.5 && {
1266
+ willChange: "transform"
1267
+ }
1268
+ } : {
1269
+ position: n,
1270
+ left: T,
1271
+ top: V
1272
+ };
1273
+ }, [n, c, E.floating, a.x, a.y]);
1274
+ return O.useMemo(() => ({
1275
+ ...a,
1276
+ update: S,
1277
+ refs: F,
1278
+ elements: E,
1279
+ floatingStyles: D
1280
+ }), [a, S, F, E, D]);
1281
+ }
1282
+ const Cn = (t) => {
1283
+ function e(n) {
1284
+ return {}.hasOwnProperty.call(n, "current");
1285
+ }
1286
+ return {
1287
+ name: "arrow",
1288
+ options: t,
1289
+ fn(n) {
1290
+ const {
1291
+ element: o,
1292
+ padding: r
1293
+ } = typeof t == "function" ? t(n) : t;
1294
+ return o && e(o) ? o.current != null ? Xt({
1295
+ element: o.current,
1296
+ padding: r
1297
+ }).fn(n) : {} : o ? Xt({
1298
+ element: o,
1299
+ padding: r
1300
+ }).fn(n) : {};
1301
+ }
1302
+ };
1303
+ }, Pn = (t, e) => {
1304
+ const n = hn(t);
1305
+ return {
1306
+ name: n.name,
1307
+ fn: n.fn,
1308
+ options: [t, e]
1309
+ };
1310
+ }, Sn = (t, e) => {
1311
+ const n = gn(t);
1312
+ return {
1313
+ name: n.name,
1314
+ fn: n.fn,
1315
+ options: [t, e]
1316
+ };
1317
+ }, En = (t, e) => ({
1318
+ fn: vn(t).fn,
1319
+ options: [t, e]
1320
+ }), Dn = (t, e) => {
1321
+ const n = wn(t);
1322
+ return {
1323
+ name: n.name,
1324
+ fn: n.fn,
1325
+ options: [t, e]
1326
+ };
1327
+ }, Ln = (t, e) => {
1328
+ const n = xn(t);
1329
+ return {
1330
+ name: n.name,
1331
+ fn: n.fn,
1332
+ options: [t, e]
1333
+ };
1334
+ }, Mn = (t, e) => {
1335
+ const n = yn(t);
1336
+ return {
1337
+ name: n.name,
1338
+ fn: n.fn,
1339
+ options: [t, e]
1340
+ };
1341
+ }, Tn = (t, e) => {
1342
+ const n = Cn(t);
1343
+ return {
1344
+ name: n.name,
1345
+ fn: n.fn,
1346
+ options: [t, e]
1347
+ };
1348
+ };
1349
+ var $n = "Arrow", re = O.forwardRef((t, e) => {
1350
+ const { children: n, width: o = 10, height: r = 5, ...i } = t;
1351
+ return /* @__PURE__ */ Y(
1352
+ Rt.svg,
1353
+ {
1354
+ ...i,
1355
+ ref: e,
1356
+ width: o,
1357
+ height: r,
1358
+ viewBox: "0 0 30 10",
1359
+ preserveAspectRatio: "none",
1360
+ children: t.asChild ? n : /* @__PURE__ */ Y("polygon", { points: "0,0 30,0 15,10" })
1361
+ }
1362
+ );
1363
+ });
1364
+ re.displayName = $n;
1365
+ var Nn = re, Lt = "Popper", [ie, Kn] = Ce(Lt), [kn, se] = ie(Lt), ce = (t) => {
1366
+ const { __scopePopper: e, children: n } = t, [o, r] = O.useState(null);
1367
+ return /* @__PURE__ */ Y(kn, { scope: e, anchor: o, onAnchorChange: r, children: n });
1368
+ };
1369
+ ce.displayName = Lt;
1370
+ var le = "PopperAnchor", ae = O.forwardRef(
1371
+ (t, e) => {
1372
+ const { __scopePopper: n, virtualRef: o, ...r } = t, i = se(le, n), s = O.useRef(null), c = jt(e, s), l = O.useRef(null);
1373
+ return O.useEffect(() => {
1374
+ const u = l.current;
1375
+ l.current = o?.current || s.current, u !== l.current && i.onAnchorChange(l.current);
1376
+ }), o ? null : /* @__PURE__ */ Y(Rt.div, { ...r, ref: c });
1377
+ }
1378
+ );
1379
+ ae.displayName = le;
1380
+ var Mt = "PopperContent", [Fn, Wn] = ie(Mt), fe = O.forwardRef(
1381
+ (t, e) => {
1382
+ const {
1383
+ __scopePopper: n,
1384
+ side: o = "bottom",
1385
+ sideOffset: r = 0,
1386
+ align: i = "center",
1387
+ alignOffset: s = 0,
1388
+ arrowPadding: c = 0,
1389
+ avoidCollisions: l = !0,
1390
+ collisionBoundary: u = [],
1391
+ collisionPadding: a = 0,
1392
+ sticky: d = "partial",
1393
+ hideWhenDetached: m = !1,
1394
+ updatePositionStrategy: f = "optimized",
1395
+ onPlaced: p,
1396
+ ...h
1397
+ } = t, x = se(Mt, n), [g, v] = O.useState(null), y = jt(e, (ot) => v(ot)), [w, A] = O.useState(null), R = Se(w), C = R?.width ?? 0, M = R?.height ?? 0, k = o + (i !== "center" ? "-" + i : ""), L = typeof a == "number" ? a : { top: 0, right: 0, bottom: 0, left: 0, ...a }, $ = Array.isArray(u) ? u : [u], N = $.length > 0, S = {
1398
+ padding: L,
1399
+ boundary: $.filter(Hn),
1400
+ // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
1401
+ altBoundary: N
1402
+ }, { refs: P, floatingStyles: F, placement: E, isPositioned: D, middlewareData: b } = On({
1403
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
1404
+ strategy: "fixed",
1405
+ placement: k,
1406
+ whileElementsMounted: (...ot) => pn(...ot, {
1407
+ animationFrame: f === "always"
1408
+ }),
1409
+ elements: {
1410
+ reference: x.anchor
1411
+ },
1412
+ middleware: [
1413
+ Pn({ mainAxis: r + M, alignmentAxis: s }),
1414
+ l && Sn({
1415
+ mainAxis: !0,
1416
+ crossAxis: !1,
1417
+ limiter: d === "partial" ? En() : void 0,
1418
+ ...S
1419
+ }),
1420
+ l && Dn({ ...S }),
1421
+ Ln({
1422
+ ...S,
1423
+ apply: ({ elements: ot, rects: $t, availableWidth: ye, availableHeight: ve }) => {
1424
+ const { width: be, height: Ae } = $t.reference, st = ot.floating.style;
1425
+ st.setProperty("--radix-popper-available-width", `${ye}px`), st.setProperty("--radix-popper-available-height", `${ve}px`), st.setProperty("--radix-popper-anchor-width", `${be}px`), st.setProperty("--radix-popper-anchor-height", `${Ae}px`);
1426
+ }
1427
+ }),
1428
+ w && Tn({ element: w, padding: c }),
1429
+ Bn({ arrowWidth: C, arrowHeight: M }),
1430
+ m && Mn({ strategy: "referenceHidden", ...S })
1431
+ ]
1432
+ }), [T, V] = me(E), Tt = Pe(p);
1433
+ Nt(() => {
1434
+ D && Tt?.();
1435
+ }, [D, Tt]);
1436
+ const pe = b.arrow?.x, he = b.arrow?.y, ge = b.arrow?.centerOffset !== 0, [we, xe] = O.useState();
1437
+ return Nt(() => {
1438
+ g && xe(window.getComputedStyle(g).zIndex);
1439
+ }, [g]), /* @__PURE__ */ Y(
1440
+ "div",
1441
+ {
1442
+ ref: P.setFloating,
1443
+ "data-radix-popper-content-wrapper": "",
1444
+ style: {
1445
+ ...F,
1446
+ transform: D ? F.transform : "translate(0, -200%)",
1447
+ // keep off the page when measuring
1448
+ minWidth: "max-content",
1449
+ zIndex: we,
1450
+ "--radix-popper-transform-origin": [
1451
+ b.transformOrigin?.x,
1452
+ b.transformOrigin?.y
1453
+ ].join(" "),
1454
+ // hide the content if using the hide middleware and should be hidden
1455
+ // set visibility to hidden and disable pointer events so the UI behaves
1456
+ // as if the PopperContent isn't there at all
1457
+ ...b.hide?.referenceHidden && {
1458
+ visibility: "hidden",
1459
+ pointerEvents: "none"
1460
+ }
1461
+ },
1462
+ dir: t.dir,
1463
+ children: /* @__PURE__ */ Y(
1464
+ Fn,
1465
+ {
1466
+ scope: n,
1467
+ placedSide: T,
1468
+ onArrowChange: A,
1469
+ arrowX: pe,
1470
+ arrowY: he,
1471
+ shouldHideArrow: ge,
1472
+ children: /* @__PURE__ */ Y(
1473
+ Rt.div,
1474
+ {
1475
+ "data-side": T,
1476
+ "data-align": V,
1477
+ ...h,
1478
+ ref: y,
1479
+ style: {
1480
+ ...h.style,
1481
+ // if the PopperContent hasn't been placed yet (not all measurements done)
1482
+ // we prevent animations so that users's animation don't kick in too early referring wrong sides
1483
+ animation: D ? void 0 : "none"
1484
+ }
1485
+ }
1486
+ )
1487
+ }
1488
+ )
1489
+ }
1490
+ );
1491
+ }
1492
+ );
1493
+ fe.displayName = Mt;
1494
+ var ue = "PopperArrow", _n = {
1495
+ top: "bottom",
1496
+ right: "left",
1497
+ bottom: "top",
1498
+ left: "right"
1499
+ }, de = O.forwardRef(function(e, n) {
1500
+ const { __scopePopper: o, ...r } = e, i = Wn(ue, o), s = _n[i.placedSide];
1501
+ return (
1502
+ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
1503
+ // doesn't report size as we'd expect on SVG elements.
1504
+ // it reports their bounding box which is effectively the largest path inside the SVG.
1505
+ /* @__PURE__ */ Y(
1506
+ "span",
1507
+ {
1508
+ ref: i.onArrowChange,
1509
+ style: {
1510
+ position: "absolute",
1511
+ left: i.arrowX,
1512
+ top: i.arrowY,
1513
+ [s]: 0,
1514
+ transformOrigin: {
1515
+ top: "",
1516
+ right: "0 0",
1517
+ bottom: "center 0",
1518
+ left: "100% 0"
1519
+ }[i.placedSide],
1520
+ transform: {
1521
+ top: "translateY(100%)",
1522
+ right: "translateY(50%) rotate(90deg) translateX(-50%)",
1523
+ bottom: "rotate(180deg)",
1524
+ left: "translateY(50%) rotate(-90deg) translateX(50%)"
1525
+ }[i.placedSide],
1526
+ visibility: i.shouldHideArrow ? "hidden" : void 0
1527
+ },
1528
+ children: /* @__PURE__ */ Y(
1529
+ Nn,
1530
+ {
1531
+ ...r,
1532
+ ref: n,
1533
+ style: {
1534
+ ...r.style,
1535
+ // ensures the element can be measured correctly (mostly for if SVG)
1536
+ display: "block"
1537
+ }
1538
+ }
1539
+ )
1540
+ }
1541
+ )
1542
+ );
1543
+ });
1544
+ de.displayName = ue;
1545
+ function Hn(t) {
1546
+ return t !== null;
1547
+ }
1548
+ var Bn = (t) => ({
1549
+ name: "transformOrigin",
1550
+ options: t,
1551
+ fn(e) {
1552
+ const { placement: n, rects: o, middlewareData: r } = e, s = r.arrow?.centerOffset !== 0, c = s ? 0 : t.arrowWidth, l = s ? 0 : t.arrowHeight, [u, a] = me(n), d = { start: "0%", center: "50%", end: "100%" }[a], m = (r.arrow?.x ?? 0) + c / 2, f = (r.arrow?.y ?? 0) + l / 2;
1553
+ let p = "", h = "";
1554
+ return u === "bottom" ? (p = s ? d : `${m}px`, h = `${-l}px`) : u === "top" ? (p = s ? d : `${m}px`, h = `${o.floating.height + l}px`) : u === "right" ? (p = `${-l}px`, h = s ? d : `${f}px`) : u === "left" && (p = `${o.floating.width + l}px`, h = s ? d : `${f}px`), { data: { x: p, y: h } };
1555
+ }
1556
+ });
1557
+ function me(t) {
1558
+ const [e, n = "center"] = t.split("-");
1559
+ return [e, n];
1560
+ }
1561
+ var Zn = ce, Gn = ae, Jn = fe, Qn = de;
1562
+ export {
1563
+ Gn as A,
1564
+ Jn as C,
1565
+ Zn as R,
1566
+ Qn as a,
1567
+ Kn as c
1568
+ };