@alixpartners/ui-components 2.3.2 → 2.4.0

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