v-float 0.1.0 → 0.2.1

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,93 +1,82 @@
1
- var gt = Object.defineProperty;
2
- var Ie = (e) => {
1
+ var Nt = Object.defineProperty;
2
+ var ot = (e) => {
3
3
  throw TypeError(e);
4
4
  };
5
- var yt = (e, t, n) => t in e ? gt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
6
- var U = (e, t, n) => yt(e, typeof t != "symbol" ? t + "" : t, n), Ee = (e, t, n) => t.has(e) || Ie("Cannot " + n);
7
- var Te = (e, t, n) => (Ee(e, t, "read from private field"), n ? n.call(e) : t.get(e)), de = (e, t, n) => t.has(e) ? Ie("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Le = (e, t, n, o) => (Ee(e, t, "write to private field"), o ? o.call(e, n) : t.set(e, n), n), Oe = (e, t, n) => (Ee(e, t, "access private method"), n);
8
- import { ref as _, computed as O, toValue as T, shallowRef as Me, watch as ve, onWatcherCleanup as q, onScopeDispose as ae, watchPostEffect as re, getCurrentScope as wt, unref as xt, onMounted as bt, watchEffect as Ae, readonly as Et, shallowReactive as Tt } from "vue";
9
- function Ye(e, t) {
10
- const n = it(e);
11
- return Math.round(t * n) / n;
12
- }
13
- function it(e) {
14
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
15
- }
16
- let Lt = 0;
17
- function Ot() {
18
- return `vfloat-id-${Lt++}`;
19
- }
20
- const Rt = ["top", "right", "bottom", "left"], ee = Math.min, G = Math.max, pe = Math.round, he = Math.floor, F = (e) => ({
5
+ var kt = (e, t, n) => t in e ? Nt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
6
+ var z = (e, t, n) => kt(e, typeof t != "symbol" ? t + "" : t, n), Se = (e, t, n) => t.has(e) || ot("Cannot " + n);
7
+ var Re = (e, t, n) => (Se(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Te = (e, t, n) => t.has(e) ? ot("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Ne = (e, t, n, o) => (Se(e, t, "write to private field"), o ? o.call(e, n) : t.set(e, n), n), ke = (e, t, n) => (Se(e, t, "access private method"), n);
8
+ import { ref as G, computed as A, toValue as P, shallowRef as We, watch as pe, onWatcherCleanup as B, onScopeDispose as re, watchPostEffect as me, getCurrentScope as Ht, unref as Ft, onMounted as $t, watchEffect as Ve, readonly as It, shallowReactive as Wt } from "vue";
9
+ const Vt = ["top", "right", "bottom", "left"], le = Math.min, ee = Math.max, Le = Math.round, xe = Math.floor, K = (e) => ({
21
10
  x: e,
22
11
  y: e
23
- }), Pt = {
12
+ }), Yt = {
24
13
  left: "right",
25
14
  right: "left",
26
15
  bottom: "top",
27
16
  top: "bottom"
28
- }, Ct = {
17
+ }, Xt = {
29
18
  start: "end",
30
19
  end: "start"
31
20
  };
32
- function De(e, t, n) {
33
- return G(e, ee(t, n));
21
+ function Ye(e, t, n) {
22
+ return ee(e, le(t, n));
34
23
  }
35
- function oe(e, t) {
24
+ function ue(e, t) {
36
25
  return typeof e == "function" ? e(t) : e;
37
26
  }
38
- function J(e) {
27
+ function te(e) {
39
28
  return e.split("-")[0];
40
29
  }
41
- function ue(e) {
30
+ function ye(e) {
42
31
  return e.split("-")[1];
43
32
  }
44
- function rt(e) {
33
+ function Tt(e) {
45
34
  return e === "x" ? "y" : "x";
46
35
  }
47
- function He(e) {
36
+ function Ke(e) {
48
37
  return e === "y" ? "height" : "width";
49
38
  }
50
- function te(e) {
51
- return ["top", "bottom"].includes(J(e)) ? "y" : "x";
39
+ function ae(e) {
40
+ return ["top", "bottom"].includes(te(e)) ? "y" : "x";
52
41
  }
53
- function Fe(e) {
54
- return rt(te(e));
42
+ function Ue(e) {
43
+ return Tt(ae(e));
55
44
  }
56
- function Mt(e, t, n) {
45
+ function jt(e, t, n) {
57
46
  n === void 0 && (n = !1);
58
- const o = ue(e), i = Fe(e), s = He(i);
59
- let r = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
60
- return t.reference[s] > t.floating[s] && (r = me(r)), [r, me(r)];
47
+ const o = ye(e), i = Ue(e), r = Ke(i);
48
+ let s = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
49
+ return t.reference[r] > t.floating[r] && (s = Pe(s)), [s, Pe(s)];
61
50
  }
62
- function At(e) {
63
- const t = me(e);
64
- return [Ne(e), t, Ne(t)];
51
+ function _t(e) {
52
+ const t = Pe(e);
53
+ return [Xe(e), t, Xe(t)];
65
54
  }
66
- function Ne(e) {
67
- return e.replace(/start|end/g, (t) => Ct[t]);
55
+ function Xe(e) {
56
+ return e.replace(/start|end/g, (t) => Xt[t]);
68
57
  }
69
- function Dt(e, t, n) {
70
- const o = ["left", "right"], i = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
58
+ function Kt(e, t, n) {
59
+ const o = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
71
60
  switch (e) {
72
61
  case "top":
73
62
  case "bottom":
74
63
  return n ? t ? i : o : t ? o : i;
75
64
  case "left":
76
65
  case "right":
77
- return t ? s : r;
66
+ return t ? r : s;
78
67
  default:
79
68
  return [];
80
69
  }
81
70
  }
82
- function Nt(e, t, n, o) {
83
- const i = ue(e);
84
- let s = Dt(J(e), n === "start", o);
85
- return i && (s = s.map((r) => r + "-" + i), t && (s = s.concat(s.map(Ne)))), s;
71
+ function Ut(e, t, n, o) {
72
+ const i = ye(e);
73
+ let r = Kt(te(e), n === "start", o);
74
+ return i && (r = r.map((s) => s + "-" + i), t && (r = r.concat(r.map(Xe)))), r;
86
75
  }
87
- function me(e) {
88
- return e.replace(/left|right|bottom|top/g, (t) => Pt[t]);
76
+ function Pe(e) {
77
+ return e.replace(/left|right|bottom|top/g, (t) => Yt[t]);
89
78
  }
90
- function St(e) {
79
+ function qt(e) {
91
80
  return {
92
81
  top: 0,
93
82
  right: 0,
@@ -96,15 +85,15 @@ function St(e) {
96
85
  ...e
97
86
  };
98
87
  }
99
- function st(e) {
100
- return typeof e != "number" ? St(e) : {
88
+ function xt(e) {
89
+ return typeof e != "number" ? qt(e) : {
101
90
  top: e,
102
91
  right: e,
103
92
  bottom: e,
104
93
  left: e
105
94
  };
106
95
  }
107
- function ge(e) {
96
+ function Oe(e) {
108
97
  const {
109
98
  x: t,
110
99
  y: n,
@@ -122,161 +111,161 @@ function ge(e) {
122
111
  y: n
123
112
  };
124
113
  }
125
- function je(e, t, n) {
114
+ function it(e, t, n) {
126
115
  let {
127
116
  reference: o,
128
117
  floating: i
129
118
  } = e;
130
- const s = te(t), r = Fe(t), l = He(r), a = J(t), c = s === "y", f = o.x + o.width / 2 - i.width / 2, u = o.y + o.height / 2 - i.height / 2, m = o[l] / 2 - i[l] / 2;
131
- let h;
132
- switch (a) {
119
+ const r = ae(t), s = Ue(t), c = Ke(s), f = te(t), a = r === "y", h = o.x + o.width / 2 - i.width / 2, d = o.y + o.height / 2 - i.height / 2, v = o[c] / 2 - i[c] / 2;
120
+ let u;
121
+ switch (f) {
133
122
  case "top":
134
- h = {
135
- x: f,
123
+ u = {
124
+ x: h,
136
125
  y: o.y - i.height
137
126
  };
138
127
  break;
139
128
  case "bottom":
140
- h = {
141
- x: f,
129
+ u = {
130
+ x: h,
142
131
  y: o.y + o.height
143
132
  };
144
133
  break;
145
134
  case "right":
146
- h = {
135
+ u = {
147
136
  x: o.x + o.width,
148
- y: u
137
+ y: d
149
138
  };
150
139
  break;
151
140
  case "left":
152
- h = {
141
+ u = {
153
142
  x: o.x - i.width,
154
- y: u
143
+ y: d
155
144
  };
156
145
  break;
157
146
  default:
158
- h = {
147
+ u = {
159
148
  x: o.x,
160
149
  y: o.y
161
150
  };
162
151
  }
163
- switch (ue(t)) {
152
+ switch (ye(t)) {
164
153
  case "start":
165
- h[r] -= m * (n && c ? -1 : 1);
154
+ u[s] -= v * (n && a ? -1 : 1);
166
155
  break;
167
156
  case "end":
168
- h[r] += m * (n && c ? -1 : 1);
157
+ u[s] += v * (n && a ? -1 : 1);
169
158
  break;
170
159
  }
171
- return h;
160
+ return u;
172
161
  }
173
- const kt = async (e, t, n) => {
162
+ const Gt = async (e, t, n) => {
174
163
  const {
175
164
  placement: o = "bottom",
176
165
  strategy: i = "absolute",
177
- middleware: s = [],
178
- platform: r
179
- } = n, l = s.filter(Boolean), a = await (r.isRTL == null ? void 0 : r.isRTL(t));
180
- let c = await r.getElementRects({
166
+ middleware: r = [],
167
+ platform: s
168
+ } = n, c = r.filter(Boolean), f = await (s.isRTL == null ? void 0 : s.isRTL(t));
169
+ let a = await s.getElementRects({
181
170
  reference: e,
182
171
  floating: t,
183
172
  strategy: i
184
173
  }), {
185
- x: f,
186
- y: u
187
- } = je(c, o, a), m = o, h = {}, p = 0;
188
- for (let d = 0; d < l.length; d++) {
174
+ x: h,
175
+ y: d
176
+ } = it(a, o, f), v = o, u = {}, g = 0;
177
+ for (let p = 0; p < c.length; p++) {
189
178
  const {
190
- name: v,
179
+ name: m,
191
180
  fn: y
192
- } = l[d], {
193
- x: E,
194
- y: x,
195
- data: g,
196
- reset: b
181
+ } = c[p], {
182
+ x,
183
+ y: T,
184
+ data: w,
185
+ reset: L
197
186
  } = await y({
198
- x: f,
199
- y: u,
187
+ x: h,
188
+ y: d,
200
189
  initialPlacement: o,
201
- placement: m,
190
+ placement: v,
202
191
  strategy: i,
203
- middlewareData: h,
204
- rects: c,
205
- platform: r,
192
+ middlewareData: u,
193
+ rects: a,
194
+ platform: s,
206
195
  elements: {
207
196
  reference: e,
208
197
  floating: t
209
198
  }
210
199
  });
211
- f = E ?? f, u = x ?? u, h = {
212
- ...h,
213
- [v]: {
214
- ...h[v],
215
- ...g
200
+ h = x ?? h, d = T ?? d, u = {
201
+ ...u,
202
+ [m]: {
203
+ ...u[m],
204
+ ...w
216
205
  }
217
- }, b && p <= 50 && (p++, typeof b == "object" && (b.placement && (m = b.placement), b.rects && (c = b.rects === !0 ? await r.getElementRects({
206
+ }, L && g <= 50 && (g++, typeof L == "object" && (L.placement && (v = L.placement), L.rects && (a = L.rects === !0 ? await s.getElementRects({
218
207
  reference: e,
219
208
  floating: t,
220
209
  strategy: i
221
- }) : b.rects), {
222
- x: f,
223
- y: u
224
- } = je(c, m, a)), d = -1);
210
+ }) : L.rects), {
211
+ x: h,
212
+ y: d
213
+ } = it(a, v, f)), p = -1);
225
214
  }
226
215
  return {
227
- x: f,
228
- y: u,
229
- placement: m,
216
+ x: h,
217
+ y: d,
218
+ placement: v,
230
219
  strategy: i,
231
- middlewareData: h
220
+ middlewareData: u
232
221
  };
233
222
  };
234
- async function ye(e, t) {
223
+ async function Ce(e, t) {
235
224
  var n;
236
225
  t === void 0 && (t = {});
237
226
  const {
238
227
  x: o,
239
228
  y: i,
240
- platform: s,
241
- rects: r,
242
- elements: l,
243
- strategy: a
229
+ platform: r,
230
+ rects: s,
231
+ elements: c,
232
+ strategy: f
244
233
  } = e, {
245
- boundary: c = "clippingAncestors",
246
- rootBoundary: f = "viewport",
247
- elementContext: u = "floating",
248
- altBoundary: m = !1,
249
- padding: h = 0
250
- } = oe(t, e), p = st(h), v = l[m ? u === "floating" ? "reference" : "floating" : u], y = ge(await s.getClippingRect({
251
- element: (n = await (s.isElement == null ? void 0 : s.isElement(v))) == null || n ? v : v.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(l.floating)),
252
- boundary: c,
253
- rootBoundary: f,
254
- strategy: a
255
- })), E = u === "floating" ? {
234
+ boundary: a = "clippingAncestors",
235
+ rootBoundary: h = "viewport",
236
+ elementContext: d = "floating",
237
+ altBoundary: v = !1,
238
+ padding: u = 0
239
+ } = ue(t, e), g = xt(u), m = c[v ? d === "floating" ? "reference" : "floating" : d], y = Oe(await r.getClippingRect({
240
+ element: (n = await (r.isElement == null ? void 0 : r.isElement(m))) == null || n ? m : m.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
241
+ boundary: a,
242
+ rootBoundary: h,
243
+ strategy: f
244
+ })), x = d === "floating" ? {
256
245
  x: o,
257
246
  y: i,
258
- width: r.floating.width,
259
- height: r.floating.height
260
- } : r.reference, x = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l.floating)), g = await (s.isElement == null ? void 0 : s.isElement(x)) ? await (s.getScale == null ? void 0 : s.getScale(x)) || {
247
+ width: s.floating.width,
248
+ height: s.floating.height
249
+ } : s.reference, T = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c.floating)), w = await (r.isElement == null ? void 0 : r.isElement(T)) ? await (r.getScale == null ? void 0 : r.getScale(T)) || {
261
250
  x: 1,
262
251
  y: 1
263
252
  } : {
264
253
  x: 1,
265
254
  y: 1
266
- }, b = ge(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
267
- elements: l,
268
- rect: E,
269
- offsetParent: x,
270
- strategy: a
271
- }) : E);
255
+ }, L = Oe(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
256
+ elements: c,
257
+ rect: x,
258
+ offsetParent: T,
259
+ strategy: f
260
+ }) : x);
272
261
  return {
273
- top: (y.top - b.top + p.top) / g.y,
274
- bottom: (b.bottom - y.bottom + p.bottom) / g.y,
275
- left: (y.left - b.left + p.left) / g.x,
276
- right: (b.right - y.right + p.right) / g.x
262
+ top: (y.top - L.top + g.top) / w.y,
263
+ bottom: (L.bottom - y.bottom + g.bottom) / w.y,
264
+ left: (y.left - L.left + g.left) / w.x,
265
+ right: (L.right - y.right + g.right) / w.x
277
266
  };
278
267
  }
279
- const Ht = (e) => ({
268
+ const Jt = (e) => ({
280
269
  name: "arrow",
281
270
  options: e,
282
271
  async fn(t) {
@@ -284,36 +273,36 @@ const Ht = (e) => ({
284
273
  x: n,
285
274
  y: o,
286
275
  placement: i,
287
- rects: s,
288
- platform: r,
289
- elements: l,
290
- middlewareData: a
276
+ rects: r,
277
+ platform: s,
278
+ elements: c,
279
+ middlewareData: f
291
280
  } = t, {
292
- element: c,
293
- padding: f = 0
294
- } = oe(e, t) || {};
295
- if (c == null)
281
+ element: a,
282
+ padding: h = 0
283
+ } = ue(e, t) || {};
284
+ if (a == null)
296
285
  return {};
297
- const u = st(f), m = {
286
+ const d = xt(h), v = {
298
287
  x: n,
299
288
  y: o
300
- }, h = Fe(i), p = He(h), d = await r.getDimensions(c), v = h === "y", y = v ? "top" : "left", E = v ? "bottom" : "right", x = v ? "clientHeight" : "clientWidth", g = s.reference[p] + s.reference[h] - m[h] - s.floating[p], b = m[h] - s.reference[h], R = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c));
301
- let L = R ? R[x] : 0;
302
- (!L || !await (r.isElement == null ? void 0 : r.isElement(R))) && (L = l.floating[x] || s.floating[p]);
303
- const W = g / 2 - b / 2, k = L / 2 - d[p] / 2 - 1, A = ee(u[y], k), I = ee(u[E], k), w = A, C = L - d[p] - I, P = L / 2 - d[p] / 2 + W, Y = De(w, P, C), V = !a.arrow && ue(i) != null && P !== Y && s.reference[p] / 2 - (P < w ? A : I) - d[p] / 2 < 0, H = V ? P < w ? P - w : P - C : 0;
289
+ }, u = Ue(i), g = Ke(u), p = await s.getDimensions(a), m = u === "y", y = m ? "top" : "left", x = m ? "bottom" : "right", T = m ? "clientHeight" : "clientWidth", w = r.reference[g] + r.reference[u] - v[u] - r.floating[g], L = v[u] - r.reference[u], O = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a));
290
+ let M = O ? O[T] : 0;
291
+ (!M || !await (s.isElement == null ? void 0 : s.isElement(O))) && (M = c.floating[T] || r.floating[g]);
292
+ const H = w / 2 - L / 2, b = M / 2 - p[g] / 2 - 1, l = le(d[y], b), k = le(d[x], b), S = l, W = M - p[g] - k, C = M / 2 - p[g] / 2 + H, D = Ye(S, C, W), E = !f.arrow && ye(i) != null && C !== D && r.reference[g] / 2 - (C < S ? l : k) - p[g] / 2 < 0, R = E ? C < S ? C - S : C - W : 0;
304
293
  return {
305
- [h]: m[h] + H,
294
+ [u]: v[u] + R,
306
295
  data: {
307
- [h]: Y,
308
- centerOffset: P - Y - H,
309
- ...V && {
310
- alignmentOffset: H
296
+ [u]: D,
297
+ centerOffset: C - D - R,
298
+ ...E && {
299
+ alignmentOffset: R
311
300
  }
312
301
  },
313
- reset: V
302
+ reset: E
314
303
  };
315
304
  }
316
- }), Ft = function(e) {
305
+ }), Qt = function(e) {
317
306
  return e === void 0 && (e = {}), {
318
307
  name: "flip",
319
308
  options: e,
@@ -321,71 +310,71 @@ const Ht = (e) => ({
321
310
  var n, o;
322
311
  const {
323
312
  placement: i,
324
- middlewareData: s,
325
- rects: r,
326
- initialPlacement: l,
327
- platform: a,
328
- elements: c
313
+ middlewareData: r,
314
+ rects: s,
315
+ initialPlacement: c,
316
+ platform: f,
317
+ elements: a
329
318
  } = t, {
330
- mainAxis: f = !0,
331
- crossAxis: u = !0,
332
- fallbackPlacements: m,
333
- fallbackStrategy: h = "bestFit",
334
- fallbackAxisSideDirection: p = "none",
335
- flipAlignment: d = !0,
336
- ...v
337
- } = oe(e, t);
338
- if ((n = s.arrow) != null && n.alignmentOffset)
319
+ mainAxis: h = !0,
320
+ crossAxis: d = !0,
321
+ fallbackPlacements: v,
322
+ fallbackStrategy: u = "bestFit",
323
+ fallbackAxisSideDirection: g = "none",
324
+ flipAlignment: p = !0,
325
+ ...m
326
+ } = ue(e, t);
327
+ if ((n = r.arrow) != null && n.alignmentOffset)
339
328
  return {};
340
- const y = J(i), E = te(l), x = J(l) === l, g = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), b = m || (x || !d ? [me(l)] : At(l)), R = p !== "none";
341
- !m && R && b.push(...Nt(l, d, p, g));
342
- const L = [l, ...b], W = await ye(t, v), k = [];
343
- let A = ((o = s.flip) == null ? void 0 : o.overflows) || [];
344
- if (f && k.push(W[y]), u) {
345
- const P = Mt(i, r, g);
346
- k.push(W[P[0]], W[P[1]]);
329
+ const y = te(i), x = ae(c), T = te(c) === c, w = await (f.isRTL == null ? void 0 : f.isRTL(a.floating)), L = v || (T || !p ? [Pe(c)] : _t(c)), O = g !== "none";
330
+ !v && O && L.push(...Ut(c, p, g, w));
331
+ const M = [c, ...L], H = await Ce(t, m), b = [];
332
+ let l = ((o = r.flip) == null ? void 0 : o.overflows) || [];
333
+ if (h && b.push(H[y]), d) {
334
+ const C = jt(i, s, w);
335
+ b.push(H[C[0]], H[C[1]]);
347
336
  }
348
- if (A = [...A, {
337
+ if (l = [...l, {
349
338
  placement: i,
350
- overflows: k
351
- }], !k.every((P) => P <= 0)) {
352
- var I, w;
353
- const P = (((I = s.flip) == null ? void 0 : I.index) || 0) + 1, Y = L[P];
354
- if (Y)
339
+ overflows: b
340
+ }], !b.every((C) => C <= 0)) {
341
+ var k, S;
342
+ const C = (((k = r.flip) == null ? void 0 : k.index) || 0) + 1, D = M[C];
343
+ if (D)
355
344
  return {
356
345
  data: {
357
- index: P,
358
- overflows: A
346
+ index: C,
347
+ overflows: l
359
348
  },
360
349
  reset: {
361
- placement: Y
350
+ placement: D
362
351
  }
363
352
  };
364
- let V = (w = A.filter((H) => H.overflows[0] <= 0).sort((H, j) => H.overflows[1] - j.overflows[1])[0]) == null ? void 0 : w.placement;
365
- if (!V)
366
- switch (h) {
353
+ let E = (S = l.filter((R) => R.overflows[0] <= 0).sort((R, F) => R.overflows[1] - F.overflows[1])[0]) == null ? void 0 : S.placement;
354
+ if (!E)
355
+ switch (u) {
367
356
  case "bestFit": {
368
- var C;
369
- const H = (C = A.filter((j) => {
370
- if (R) {
371
- const X = te(j.placement);
372
- return X === E || // Create a bias to the `y` side axis due to horizontal
357
+ var W;
358
+ const R = (W = l.filter((F) => {
359
+ if (O) {
360
+ const $ = ae(F.placement);
361
+ return $ === x || // Create a bias to the `y` side axis due to horizontal
373
362
  // reading directions favoring greater width.
374
- X === "y";
363
+ $ === "y";
375
364
  }
376
365
  return !0;
377
- }).map((j) => [j.placement, j.overflows.filter((X) => X > 0).reduce((X, mt) => X + mt, 0)]).sort((j, X) => j[1] - X[1])[0]) == null ? void 0 : C[0];
378
- H && (V = H);
366
+ }).map((F) => [F.placement, F.overflows.filter(($) => $ > 0).reduce(($, _) => $ + _, 0)]).sort((F, $) => F[1] - $[1])[0]) == null ? void 0 : W[0];
367
+ R && (E = R);
379
368
  break;
380
369
  }
381
370
  case "initialPlacement":
382
- V = l;
371
+ E = c;
383
372
  break;
384
373
  }
385
- if (i !== V)
374
+ if (i !== E)
386
375
  return {
387
376
  reset: {
388
- placement: V
377
+ placement: E
389
378
  }
390
379
  };
391
380
  }
@@ -393,7 +382,7 @@ const Ht = (e) => ({
393
382
  }
394
383
  };
395
384
  };
396
- function Xe(e, t) {
385
+ function st(e, t) {
397
386
  return {
398
387
  top: e.top - t.height,
399
388
  right: e.right - t.width,
@@ -401,10 +390,10 @@ function Xe(e, t) {
401
390
  left: e.left - t.width
402
391
  };
403
392
  }
404
- function _e(e) {
405
- return Rt.some((t) => e[t] >= 0);
393
+ function rt(e) {
394
+ return Vt.some((t) => e[t] >= 0);
406
395
  }
407
- const Bt = function(e) {
396
+ const Zt = function(e) {
408
397
  return e === void 0 && (e = {}), {
409
398
  name: "hide",
410
399
  options: e,
@@ -414,29 +403,29 @@ const Bt = function(e) {
414
403
  } = t, {
415
404
  strategy: o = "referenceHidden",
416
405
  ...i
417
- } = oe(e, t);
406
+ } = ue(e, t);
418
407
  switch (o) {
419
408
  case "referenceHidden": {
420
- const s = await ye(t, {
409
+ const r = await Ce(t, {
421
410
  ...i,
422
411
  elementContext: "reference"
423
- }), r = Xe(s, n.reference);
412
+ }), s = st(r, n.reference);
424
413
  return {
425
414
  data: {
426
- referenceHiddenOffsets: r,
427
- referenceHidden: _e(r)
415
+ referenceHiddenOffsets: s,
416
+ referenceHidden: rt(s)
428
417
  }
429
418
  };
430
419
  }
431
420
  case "escaped": {
432
- const s = await ye(t, {
421
+ const r = await Ce(t, {
433
422
  ...i,
434
423
  altBoundary: !0
435
- }), r = Xe(s, n.floating);
424
+ }), s = st(r, n.floating);
436
425
  return {
437
426
  data: {
438
- escapedOffsets: r,
439
- escaped: _e(r)
427
+ escapedOffsets: s,
428
+ escaped: rt(s)
440
429
  }
441
430
  };
442
431
  }
@@ -446,34 +435,34 @@ const Bt = function(e) {
446
435
  }
447
436
  };
448
437
  };
449
- async function $t(e, t) {
438
+ async function zt(e, t) {
450
439
  const {
451
440
  placement: n,
452
441
  platform: o,
453
442
  elements: i
454
- } = e, s = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), r = J(n), l = ue(n), a = te(n) === "y", c = ["left", "top"].includes(r) ? -1 : 1, f = s && a ? -1 : 1, u = oe(t, e);
443
+ } = e, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s = te(n), c = ye(n), f = ae(n) === "y", a = ["left", "top"].includes(s) ? -1 : 1, h = r && f ? -1 : 1, d = ue(t, e);
455
444
  let {
456
- mainAxis: m,
457
- crossAxis: h,
458
- alignmentAxis: p
459
- } = typeof u == "number" ? {
460
- mainAxis: u,
445
+ mainAxis: v,
446
+ crossAxis: u,
447
+ alignmentAxis: g
448
+ } = typeof d == "number" ? {
449
+ mainAxis: d,
461
450
  crossAxis: 0,
462
451
  alignmentAxis: null
463
452
  } : {
464
- mainAxis: u.mainAxis || 0,
465
- crossAxis: u.crossAxis || 0,
466
- alignmentAxis: u.alignmentAxis
453
+ mainAxis: d.mainAxis || 0,
454
+ crossAxis: d.crossAxis || 0,
455
+ alignmentAxis: d.alignmentAxis
467
456
  };
468
- return l && typeof p == "number" && (h = l === "end" ? p * -1 : p), a ? {
469
- x: h * f,
470
- y: m * c
457
+ return c && typeof g == "number" && (u = c === "end" ? g * -1 : g), f ? {
458
+ x: u * h,
459
+ y: v * a
471
460
  } : {
472
- x: m * c,
473
- y: h * f
461
+ x: v * a,
462
+ y: u * h
474
463
  };
475
464
  }
476
- const Vt = function(e) {
465
+ const Bt = function(e) {
477
466
  return e === void 0 && (e = 0), {
478
467
  name: "offset",
479
468
  options: e,
@@ -481,21 +470,21 @@ const Vt = function(e) {
481
470
  var n, o;
482
471
  const {
483
472
  x: i,
484
- y: s,
485
- placement: r,
486
- middlewareData: l
487
- } = t, a = await $t(t, e);
488
- return r === ((n = l.offset) == null ? void 0 : n.placement) && (o = l.arrow) != null && o.alignmentOffset ? {} : {
489
- x: i + a.x,
490
- y: s + a.y,
473
+ y: r,
474
+ placement: s,
475
+ middlewareData: c
476
+ } = t, f = await zt(t, e);
477
+ return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
478
+ x: i + f.x,
479
+ y: r + f.y,
491
480
  data: {
492
- ...a,
493
- placement: r
481
+ ...f,
482
+ placement: s
494
483
  }
495
484
  };
496
485
  }
497
486
  };
498
- }, Wt = function(e) {
487
+ }, en = function(e) {
499
488
  return e === void 0 && (e = {}), {
500
489
  name: "shift",
501
490
  options: e,
@@ -505,92 +494,92 @@ const Vt = function(e) {
505
494
  y: o,
506
495
  placement: i
507
496
  } = t, {
508
- mainAxis: s = !0,
509
- crossAxis: r = !1,
510
- limiter: l = {
511
- fn: (v) => {
497
+ mainAxis: r = !0,
498
+ crossAxis: s = !1,
499
+ limiter: c = {
500
+ fn: (m) => {
512
501
  let {
513
502
  x: y,
514
- y: E
515
- } = v;
503
+ y: x
504
+ } = m;
516
505
  return {
517
506
  x: y,
518
- y: E
507
+ y: x
519
508
  };
520
509
  }
521
510
  },
522
- ...a
523
- } = oe(e, t), c = {
511
+ ...f
512
+ } = ue(e, t), a = {
524
513
  x: n,
525
514
  y: o
526
- }, f = await ye(t, a), u = te(J(i)), m = rt(u);
527
- let h = c[m], p = c[u];
528
- if (s) {
529
- const v = m === "y" ? "top" : "left", y = m === "y" ? "bottom" : "right", E = h + f[v], x = h - f[y];
530
- h = De(E, h, x);
531
- }
515
+ }, h = await Ce(t, f), d = ae(te(i)), v = Tt(d);
516
+ let u = a[v], g = a[d];
532
517
  if (r) {
533
- const v = u === "y" ? "top" : "left", y = u === "y" ? "bottom" : "right", E = p + f[v], x = p - f[y];
534
- p = De(E, p, x);
518
+ const m = v === "y" ? "top" : "left", y = v === "y" ? "bottom" : "right", x = u + h[m], T = u - h[y];
519
+ u = Ye(x, u, T);
520
+ }
521
+ if (s) {
522
+ const m = d === "y" ? "top" : "left", y = d === "y" ? "bottom" : "right", x = g + h[m], T = g - h[y];
523
+ g = Ye(x, g, T);
535
524
  }
536
- const d = l.fn({
525
+ const p = c.fn({
537
526
  ...t,
538
- [m]: h,
539
- [u]: p
527
+ [v]: u,
528
+ [d]: g
540
529
  });
541
530
  return {
542
- ...d,
531
+ ...p,
543
532
  data: {
544
- x: d.x - n,
545
- y: d.y - o,
533
+ x: p.x - n,
534
+ y: p.y - o,
546
535
  enabled: {
547
- [m]: s,
548
- [u]: r
536
+ [v]: r,
537
+ [d]: s
549
538
  }
550
539
  }
551
540
  };
552
541
  }
553
542
  };
554
543
  };
555
- function we() {
544
+ function Me() {
556
545
  return typeof window < "u";
557
546
  }
558
- function ie(e) {
559
- return lt(e) ? (e.nodeName || "").toLowerCase() : "#document";
547
+ function fe(e) {
548
+ return Lt(e) ? (e.nodeName || "").toLowerCase() : "#document";
560
549
  }
561
- function M(e) {
550
+ function V(e) {
562
551
  var t;
563
552
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
564
553
  }
565
- function $(e) {
554
+ function q(e) {
566
555
  var t;
567
- return (t = (lt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
556
+ return (t = (Lt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
568
557
  }
569
- function lt(e) {
570
- return we() ? e instanceof Node || e instanceof M(e).Node : !1;
558
+ function Lt(e) {
559
+ return Me() ? e instanceof Node || e instanceof V(e).Node : !1;
571
560
  }
572
- function N(e) {
573
- return we() ? e instanceof Element || e instanceof M(e).Element : !1;
561
+ function X(e) {
562
+ return Me() ? e instanceof Element || e instanceof V(e).Element : !1;
574
563
  }
575
- function B(e) {
576
- return we() ? e instanceof HTMLElement || e instanceof M(e).HTMLElement : !1;
564
+ function U(e) {
565
+ return Me() ? e instanceof HTMLElement || e instanceof V(e).HTMLElement : !1;
577
566
  }
578
- function Ke(e) {
579
- return !we() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof M(e).ShadowRoot;
567
+ function lt(e) {
568
+ return !Me() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof V(e).ShadowRoot;
580
569
  }
581
- function fe(e) {
570
+ function be(e) {
582
571
  const {
583
572
  overflow: t,
584
573
  overflowX: n,
585
574
  overflowY: o,
586
575
  display: i
587
- } = S(e);
576
+ } = j(e);
588
577
  return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !["inline", "contents"].includes(i);
589
578
  }
590
- function It(e) {
591
- return ["table", "td", "th"].includes(ie(e));
579
+ function tn(e) {
580
+ return ["table", "td", "th"].includes(fe(e));
592
581
  }
593
- function xe(e) {
582
+ function Ae(e) {
594
583
  return [":popover-open", ":modal"].some((t) => {
595
584
  try {
596
585
  return e.matches(t);
@@ -599,32 +588,32 @@ function xe(e) {
599
588
  }
600
589
  });
601
590
  }
602
- function Be(e) {
603
- const t = $e(), n = N(e) ? S(e) : e;
591
+ function qe(e) {
592
+ const t = Ge(), n = X(e) ? j(e) : e;
604
593
  return ["transform", "translate", "scale", "rotate", "perspective"].some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
605
594
  }
606
- function Yt(e) {
607
- let t = K(e);
608
- for (; B(t) && !ne(t); ) {
609
- if (Be(t))
595
+ function nn(e) {
596
+ let t = J(e);
597
+ for (; U(t) && !ce(t); ) {
598
+ if (qe(t))
610
599
  return t;
611
- if (xe(t))
600
+ if (Ae(t))
612
601
  return null;
613
- t = K(t);
602
+ t = J(t);
614
603
  }
615
604
  return null;
616
605
  }
617
- function $e() {
606
+ function Ge() {
618
607
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
619
608
  }
620
- function ne(e) {
621
- return ["html", "body", "#document"].includes(ie(e));
609
+ function ce(e) {
610
+ return ["html", "body", "#document"].includes(fe(e));
622
611
  }
623
- function S(e) {
624
- return M(e).getComputedStyle(e);
612
+ function j(e) {
613
+ return V(e).getComputedStyle(e);
625
614
  }
626
- function be(e) {
627
- return N(e) ? {
615
+ function De(e) {
616
+ return X(e) ? {
628
617
  scrollLeft: e.scrollLeft,
629
618
  scrollTop: e.scrollTop
630
619
  } : {
@@ -632,186 +621,186 @@ function be(e) {
632
621
  scrollTop: e.scrollY
633
622
  };
634
623
  }
635
- function K(e) {
636
- if (ie(e) === "html")
624
+ function J(e) {
625
+ if (fe(e) === "html")
637
626
  return e;
638
627
  const t = (
639
628
  // Step into the shadow DOM of the parent of a slotted node.
640
629
  e.assignedSlot || // DOM Element detected.
641
630
  e.parentNode || // ShadowRoot detected.
642
- Ke(e) && e.host || // Fallback.
643
- $(e)
631
+ lt(e) && e.host || // Fallback.
632
+ q(e)
644
633
  );
645
- return Ke(t) ? t.host : t;
634
+ return lt(t) ? t.host : t;
646
635
  }
647
- function ct(e) {
648
- const t = K(e);
649
- return ne(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : B(t) && fe(t) ? t : ct(t);
636
+ function Pt(e) {
637
+ const t = J(e);
638
+ return ce(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : U(t) && be(t) ? t : Pt(t);
650
639
  }
651
- function Q(e, t, n) {
640
+ function ne(e, t, n) {
652
641
  var o;
653
642
  t === void 0 && (t = []), n === void 0 && (n = !0);
654
- const i = ct(e), s = i === ((o = e.ownerDocument) == null ? void 0 : o.body), r = M(i);
655
- if (s) {
656
- const l = Se(r);
657
- return t.concat(r, r.visualViewport || [], fe(i) ? i : [], l && n ? Q(l) : []);
643
+ const i = Pt(e), r = i === ((o = e.ownerDocument) == null ? void 0 : o.body), s = V(i);
644
+ if (r) {
645
+ const c = je(s);
646
+ return t.concat(s, s.visualViewport || [], be(i) ? i : [], c && n ? ne(c) : []);
658
647
  }
659
- return t.concat(i, Q(i, [], n));
648
+ return t.concat(i, ne(i, [], n));
660
649
  }
661
- function Se(e) {
650
+ function je(e) {
662
651
  return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
663
652
  }
664
- function at(e) {
665
- const t = S(e);
653
+ function Ot(e) {
654
+ const t = j(e);
666
655
  let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
667
- const i = B(e), s = i ? e.offsetWidth : n, r = i ? e.offsetHeight : o, l = pe(n) !== s || pe(o) !== r;
668
- return l && (n = s, o = r), {
656
+ const i = U(e), r = i ? e.offsetWidth : n, s = i ? e.offsetHeight : o, c = Le(n) !== r || Le(o) !== s;
657
+ return c && (n = r, o = s), {
669
658
  width: n,
670
659
  height: o,
671
- $: l
660
+ $: c
672
661
  };
673
662
  }
674
- function Ve(e) {
675
- return N(e) ? e : e.contextElement;
663
+ function Je(e) {
664
+ return X(e) ? e : e.contextElement;
676
665
  }
677
- function z(e) {
678
- const t = Ve(e);
679
- if (!B(t))
680
- return F(1);
666
+ function se(e) {
667
+ const t = Je(e);
668
+ if (!U(t))
669
+ return K(1);
681
670
  const n = t.getBoundingClientRect(), {
682
671
  width: o,
683
672
  height: i,
684
- $: s
685
- } = at(t);
686
- let r = (s ? pe(n.width) : n.width) / o, l = (s ? pe(n.height) : n.height) / i;
687
- return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
688
- x: r,
689
- y: l
673
+ $: r
674
+ } = Ot(t);
675
+ let s = (r ? Le(n.width) : n.width) / o, c = (r ? Le(n.height) : n.height) / i;
676
+ return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
677
+ x: s,
678
+ y: c
690
679
  };
691
680
  }
692
- const jt = /* @__PURE__ */ F(0);
693
- function ut(e) {
694
- const t = M(e);
695
- return !$e() || !t.visualViewport ? jt : {
681
+ const on = /* @__PURE__ */ K(0);
682
+ function Ct(e) {
683
+ const t = V(e);
684
+ return !Ge() || !t.visualViewport ? on : {
696
685
  x: t.visualViewport.offsetLeft,
697
686
  y: t.visualViewport.offsetTop
698
687
  };
699
688
  }
700
- function Xt(e, t, n) {
701
- return t === void 0 && (t = !1), !n || t && n !== M(e) ? !1 : t;
689
+ function sn(e, t, n) {
690
+ return t === void 0 && (t = !1), !n || t && n !== V(e) ? !1 : t;
702
691
  }
703
- function Z(e, t, n, o) {
692
+ function oe(e, t, n, o) {
704
693
  t === void 0 && (t = !1), n === void 0 && (n = !1);
705
- const i = e.getBoundingClientRect(), s = Ve(e);
706
- let r = F(1);
707
- t && (o ? N(o) && (r = z(o)) : r = z(e));
708
- const l = Xt(s, n, o) ? ut(s) : F(0);
709
- let a = (i.left + l.x) / r.x, c = (i.top + l.y) / r.y, f = i.width / r.x, u = i.height / r.y;
710
- if (s) {
711
- const m = M(s), h = o && N(o) ? M(o) : o;
712
- let p = m, d = Se(p);
713
- for (; d && o && h !== p; ) {
714
- const v = z(d), y = d.getBoundingClientRect(), E = S(d), x = y.left + (d.clientLeft + parseFloat(E.paddingLeft)) * v.x, g = y.top + (d.clientTop + parseFloat(E.paddingTop)) * v.y;
715
- a *= v.x, c *= v.y, f *= v.x, u *= v.y, a += x, c += g, p = M(d), d = Se(p);
694
+ const i = e.getBoundingClientRect(), r = Je(e);
695
+ let s = K(1);
696
+ t && (o ? X(o) && (s = se(o)) : s = se(e));
697
+ const c = sn(r, n, o) ? Ct(r) : K(0);
698
+ let f = (i.left + c.x) / s.x, a = (i.top + c.y) / s.y, h = i.width / s.x, d = i.height / s.y;
699
+ if (r) {
700
+ const v = V(r), u = o && X(o) ? V(o) : o;
701
+ let g = v, p = je(g);
702
+ for (; p && o && u !== g; ) {
703
+ const m = se(p), y = p.getBoundingClientRect(), x = j(p), T = y.left + (p.clientLeft + parseFloat(x.paddingLeft)) * m.x, w = y.top + (p.clientTop + parseFloat(x.paddingTop)) * m.y;
704
+ f *= m.x, a *= m.y, h *= m.x, d *= m.y, f += T, a += w, g = V(p), p = je(g);
716
705
  }
717
706
  }
718
- return ge({
719
- width: f,
720
- height: u,
721
- x: a,
722
- y: c
707
+ return Oe({
708
+ width: h,
709
+ height: d,
710
+ x: f,
711
+ y: a
723
712
  });
724
713
  }
725
- function We(e, t) {
726
- const n = be(e).scrollLeft;
727
- return t ? t.left + n : Z($(e)).left + n;
714
+ function Qe(e, t) {
715
+ const n = De(e).scrollLeft;
716
+ return t ? t.left + n : oe(q(e)).left + n;
728
717
  }
729
- function ft(e, t, n) {
718
+ function Mt(e, t, n) {
730
719
  n === void 0 && (n = !1);
731
720
  const o = e.getBoundingClientRect(), i = o.left + t.scrollLeft - (n ? 0 : (
732
721
  // RTL <body> scrollbar.
733
- We(e, o)
734
- )), s = o.top + t.scrollTop;
722
+ Qe(e, o)
723
+ )), r = o.top + t.scrollTop;
735
724
  return {
736
725
  x: i,
737
- y: s
726
+ y: r
738
727
  };
739
728
  }
740
- function _t(e) {
729
+ function rn(e) {
741
730
  let {
742
731
  elements: t,
743
732
  rect: n,
744
733
  offsetParent: o,
745
734
  strategy: i
746
735
  } = e;
747
- const s = i === "fixed", r = $(o), l = t ? xe(t.floating) : !1;
748
- if (o === r || l && s)
736
+ const r = i === "fixed", s = q(o), c = t ? Ae(t.floating) : !1;
737
+ if (o === s || c && r)
749
738
  return n;
750
- let a = {
739
+ let f = {
751
740
  scrollLeft: 0,
752
741
  scrollTop: 0
753
- }, c = F(1);
754
- const f = F(0), u = B(o);
755
- if ((u || !u && !s) && ((ie(o) !== "body" || fe(r)) && (a = be(o)), B(o))) {
756
- const h = Z(o);
757
- c = z(o), f.x = h.x + o.clientLeft, f.y = h.y + o.clientTop;
742
+ }, a = K(1);
743
+ const h = K(0), d = U(o);
744
+ if ((d || !d && !r) && ((fe(o) !== "body" || be(s)) && (f = De(o)), U(o))) {
745
+ const u = oe(o);
746
+ a = se(o), h.x = u.x + o.clientLeft, h.y = u.y + o.clientTop;
758
747
  }
759
- const m = r && !u && !s ? ft(r, a, !0) : F(0);
748
+ const v = s && !d && !r ? Mt(s, f, !0) : K(0);
760
749
  return {
761
- width: n.width * c.x,
762
- height: n.height * c.y,
763
- x: n.x * c.x - a.scrollLeft * c.x + f.x + m.x,
764
- y: n.y * c.y - a.scrollTop * c.y + f.y + m.y
750
+ width: n.width * a.x,
751
+ height: n.height * a.y,
752
+ x: n.x * a.x - f.scrollLeft * a.x + h.x + v.x,
753
+ y: n.y * a.y - f.scrollTop * a.y + h.y + v.y
765
754
  };
766
755
  }
767
- function Kt(e) {
756
+ function ln(e) {
768
757
  return Array.from(e.getClientRects());
769
758
  }
770
- function Ut(e) {
771
- const t = $(e), n = be(e), o = e.ownerDocument.body, i = G(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), s = G(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
772
- let r = -n.scrollLeft + We(e);
773
- const l = -n.scrollTop;
774
- return S(o).direction === "rtl" && (r += G(t.clientWidth, o.clientWidth) - i), {
759
+ function an(e) {
760
+ const t = q(e), n = De(e), o = e.ownerDocument.body, i = ee(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), r = ee(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
761
+ let s = -n.scrollLeft + Qe(e);
762
+ const c = -n.scrollTop;
763
+ return j(o).direction === "rtl" && (s += ee(t.clientWidth, o.clientWidth) - i), {
775
764
  width: i,
776
- height: s,
777
- x: r,
778
- y: l
765
+ height: r,
766
+ x: s,
767
+ y: c
779
768
  };
780
769
  }
781
- function qt(e, t) {
782
- const n = M(e), o = $(e), i = n.visualViewport;
783
- let s = o.clientWidth, r = o.clientHeight, l = 0, a = 0;
770
+ function cn(e, t) {
771
+ const n = V(e), o = q(e), i = n.visualViewport;
772
+ let r = o.clientWidth, s = o.clientHeight, c = 0, f = 0;
784
773
  if (i) {
785
- s = i.width, r = i.height;
786
- const c = $e();
787
- (!c || c && t === "fixed") && (l = i.offsetLeft, a = i.offsetTop);
774
+ r = i.width, s = i.height;
775
+ const a = Ge();
776
+ (!a || a && t === "fixed") && (c = i.offsetLeft, f = i.offsetTop);
788
777
  }
789
778
  return {
790
- width: s,
791
- height: r,
792
- x: l,
793
- y: a
779
+ width: r,
780
+ height: s,
781
+ x: c,
782
+ y: f
794
783
  };
795
784
  }
796
- function Gt(e, t) {
797
- const n = Z(e, !0, t === "fixed"), o = n.top + e.clientTop, i = n.left + e.clientLeft, s = B(e) ? z(e) : F(1), r = e.clientWidth * s.x, l = e.clientHeight * s.y, a = i * s.x, c = o * s.y;
785
+ function un(e, t) {
786
+ const n = oe(e, !0, t === "fixed"), o = n.top + e.clientTop, i = n.left + e.clientLeft, r = U(e) ? se(e) : K(1), s = e.clientWidth * r.x, c = e.clientHeight * r.y, f = i * r.x, a = o * r.y;
798
787
  return {
799
- width: r,
800
- height: l,
801
- x: a,
802
- y: c
788
+ width: s,
789
+ height: c,
790
+ x: f,
791
+ y: a
803
792
  };
804
793
  }
805
- function Ue(e, t, n) {
794
+ function at(e, t, n) {
806
795
  let o;
807
796
  if (t === "viewport")
808
- o = qt(e, n);
797
+ o = cn(e, n);
809
798
  else if (t === "document")
810
- o = Ut($(e));
811
- else if (N(t))
812
- o = Gt(t, n);
799
+ o = an(q(e));
800
+ else if (X(t))
801
+ o = un(t, n);
813
802
  else {
814
- const i = ut(e);
803
+ const i = Ct(e);
815
804
  o = {
816
805
  x: t.x - i.x,
817
806
  y: t.y - i.y,
@@ -819,106 +808,106 @@ function Ue(e, t, n) {
819
808
  height: t.height
820
809
  };
821
810
  }
822
- return ge(o);
811
+ return Oe(o);
823
812
  }
824
- function dt(e, t) {
825
- const n = K(e);
826
- return n === t || !N(n) || ne(n) ? !1 : S(n).position === "fixed" || dt(n, t);
813
+ function At(e, t) {
814
+ const n = J(e);
815
+ return n === t || !X(n) || ce(n) ? !1 : j(n).position === "fixed" || At(n, t);
827
816
  }
828
- function Jt(e, t) {
817
+ function fn(e, t) {
829
818
  const n = t.get(e);
830
819
  if (n)
831
820
  return n;
832
- let o = Q(e, [], !1).filter((l) => N(l) && ie(l) !== "body"), i = null;
833
- const s = S(e).position === "fixed";
834
- let r = s ? K(e) : e;
835
- for (; N(r) && !ne(r); ) {
836
- const l = S(r), a = Be(r);
837
- !a && l.position === "fixed" && (i = null), (s ? !a && !i : !a && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || fe(r) && !a && dt(e, r)) ? o = o.filter((f) => f !== r) : i = l, r = K(r);
821
+ let o = ne(e, [], !1).filter((c) => X(c) && fe(c) !== "body"), i = null;
822
+ const r = j(e).position === "fixed";
823
+ let s = r ? J(e) : e;
824
+ for (; X(s) && !ce(s); ) {
825
+ const c = j(s), f = qe(s);
826
+ !f && c.position === "fixed" && (i = null), (r ? !f && !i : !f && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || be(s) && !f && At(e, s)) ? o = o.filter((h) => h !== s) : i = c, s = J(s);
838
827
  }
839
828
  return t.set(e, o), o;
840
829
  }
841
- function Qt(e) {
830
+ function dn(e) {
842
831
  let {
843
832
  element: t,
844
833
  boundary: n,
845
834
  rootBoundary: o,
846
835
  strategy: i
847
836
  } = e;
848
- const r = [...n === "clippingAncestors" ? xe(t) ? [] : Jt(t, this._c) : [].concat(n), o], l = r[0], a = r.reduce((c, f) => {
849
- const u = Ue(t, f, i);
850
- return c.top = G(u.top, c.top), c.right = ee(u.right, c.right), c.bottom = ee(u.bottom, c.bottom), c.left = G(u.left, c.left), c;
851
- }, Ue(t, l, i));
837
+ const s = [...n === "clippingAncestors" ? Ae(t) ? [] : fn(t, this._c) : [].concat(n), o], c = s[0], f = s.reduce((a, h) => {
838
+ const d = at(t, h, i);
839
+ return a.top = ee(d.top, a.top), a.right = le(d.right, a.right), a.bottom = le(d.bottom, a.bottom), a.left = ee(d.left, a.left), a;
840
+ }, at(t, c, i));
852
841
  return {
853
- width: a.right - a.left,
854
- height: a.bottom - a.top,
855
- x: a.left,
856
- y: a.top
842
+ width: f.right - f.left,
843
+ height: f.bottom - f.top,
844
+ x: f.left,
845
+ y: f.top
857
846
  };
858
847
  }
859
- function Zt(e) {
848
+ function hn(e) {
860
849
  const {
861
850
  width: t,
862
851
  height: n
863
- } = at(e);
852
+ } = Ot(e);
864
853
  return {
865
854
  width: t,
866
855
  height: n
867
856
  };
868
857
  }
869
- function zt(e, t, n) {
870
- const o = B(t), i = $(t), s = n === "fixed", r = Z(e, !0, s, t);
871
- let l = {
858
+ function pn(e, t, n) {
859
+ const o = U(t), i = q(t), r = n === "fixed", s = oe(e, !0, r, t);
860
+ let c = {
872
861
  scrollLeft: 0,
873
862
  scrollTop: 0
874
863
  };
875
- const a = F(0);
876
- if (o || !o && !s)
877
- if ((ie(t) !== "body" || fe(i)) && (l = be(t)), o) {
878
- const m = Z(t, !0, s, t);
879
- a.x = m.x + t.clientLeft, a.y = m.y + t.clientTop;
880
- } else i && (a.x = We(i));
881
- const c = i && !o && !s ? ft(i, l) : F(0), f = r.left + l.scrollLeft - a.x - c.x, u = r.top + l.scrollTop - a.y - c.y;
864
+ const f = K(0);
865
+ if (o || !o && !r)
866
+ if ((fe(t) !== "body" || be(i)) && (c = De(t)), o) {
867
+ const v = oe(t, !0, r, t);
868
+ f.x = v.x + t.clientLeft, f.y = v.y + t.clientTop;
869
+ } else i && (f.x = Qe(i));
870
+ const a = i && !o && !r ? Mt(i, c) : K(0), h = s.left + c.scrollLeft - f.x - a.x, d = s.top + c.scrollTop - f.y - a.y;
882
871
  return {
883
- x: f,
884
- y: u,
885
- width: r.width,
886
- height: r.height
872
+ x: h,
873
+ y: d,
874
+ width: s.width,
875
+ height: s.height
887
876
  };
888
877
  }
889
- function Re(e) {
890
- return S(e).position === "static";
878
+ function He(e) {
879
+ return j(e).position === "static";
891
880
  }
892
- function qe(e, t) {
893
- if (!B(e) || S(e).position === "fixed")
881
+ function ct(e, t) {
882
+ if (!U(e) || j(e).position === "fixed")
894
883
  return null;
895
884
  if (t)
896
885
  return t(e);
897
886
  let n = e.offsetParent;
898
- return $(e) === n && (n = n.ownerDocument.body), n;
887
+ return q(e) === n && (n = n.ownerDocument.body), n;
899
888
  }
900
- function ht(e, t) {
901
- const n = M(e);
902
- if (xe(e))
889
+ function Dt(e, t) {
890
+ const n = V(e);
891
+ if (Ae(e))
903
892
  return n;
904
- if (!B(e)) {
905
- let i = K(e);
906
- for (; i && !ne(i); ) {
907
- if (N(i) && !Re(i))
893
+ if (!U(e)) {
894
+ let i = J(e);
895
+ for (; i && !ce(i); ) {
896
+ if (X(i) && !He(i))
908
897
  return i;
909
- i = K(i);
898
+ i = J(i);
910
899
  }
911
900
  return n;
912
901
  }
913
- let o = qe(e, t);
914
- for (; o && It(o) && Re(o); )
915
- o = qe(o, t);
916
- return o && ne(o) && Re(o) && !Be(o) ? n : o || Yt(e) || n;
902
+ let o = ct(e, t);
903
+ for (; o && tn(o) && He(o); )
904
+ o = ct(o, t);
905
+ return o && ce(o) && He(o) && !qe(o) ? n : o || nn(e) || n;
917
906
  }
918
- const en = async function(e) {
919
- const t = this.getOffsetParent || ht, n = this.getDimensions, o = await n(e.floating);
907
+ const mn = async function(e) {
908
+ const t = this.getOffsetParent || Dt, n = this.getDimensions, o = await n(e.floating);
920
909
  return {
921
- reference: zt(e.reference, await t(e.floating), e.strategy),
910
+ reference: pn(e.reference, await t(e.floating), e.strategy),
922
911
  floating: {
923
912
  x: 0,
924
913
  y: 0,
@@ -927,338 +916,582 @@ const en = async function(e) {
927
916
  }
928
917
  };
929
918
  };
930
- function tn(e) {
931
- return S(e).direction === "rtl";
932
- }
933
- const nn = {
934
- convertOffsetParentRelativeRectToViewportRelativeRect: _t,
935
- getDocumentElement: $,
936
- getClippingRect: Qt,
937
- getOffsetParent: ht,
938
- getElementRects: en,
939
- getClientRects: Kt,
940
- getDimensions: Zt,
941
- getScale: z,
942
- isElement: N,
943
- isRTL: tn
919
+ function vn(e) {
920
+ return j(e).direction === "rtl";
921
+ }
922
+ const gn = {
923
+ convertOffsetParentRelativeRectToViewportRelativeRect: rn,
924
+ getDocumentElement: q,
925
+ getClippingRect: dn,
926
+ getOffsetParent: Dt,
927
+ getElementRects: mn,
928
+ getClientRects: ln,
929
+ getDimensions: hn,
930
+ getScale: se,
931
+ isElement: X,
932
+ isRTL: vn
944
933
  };
945
- function vt(e, t) {
934
+ function St(e, t) {
946
935
  return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
947
936
  }
948
- function on(e, t) {
937
+ function wn(e, t) {
949
938
  let n = null, o;
950
- const i = $(e);
951
- function s() {
952
- var l;
953
- clearTimeout(o), (l = n) == null || l.disconnect(), n = null;
939
+ const i = q(e);
940
+ function r() {
941
+ var c;
942
+ clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
954
943
  }
955
- function r(l, a) {
956
- l === void 0 && (l = !1), a === void 0 && (a = 1), s();
957
- const c = e.getBoundingClientRect(), {
958
- left: f,
959
- top: u,
960
- width: m,
961
- height: h
962
- } = c;
963
- if (l || t(), !m || !h)
944
+ function s(c, f) {
945
+ c === void 0 && (c = !1), f === void 0 && (f = 1), r();
946
+ const a = e.getBoundingClientRect(), {
947
+ left: h,
948
+ top: d,
949
+ width: v,
950
+ height: u
951
+ } = a;
952
+ if (c || t(), !v || !u)
964
953
  return;
965
- const p = he(u), d = he(i.clientWidth - (f + m)), v = he(i.clientHeight - (u + h)), y = he(f), x = {
966
- rootMargin: -p + "px " + -d + "px " + -v + "px " + -y + "px",
967
- threshold: G(0, ee(1, a)) || 1
954
+ const g = xe(d), p = xe(i.clientWidth - (h + v)), m = xe(i.clientHeight - (d + u)), y = xe(h), T = {
955
+ rootMargin: -g + "px " + -p + "px " + -m + "px " + -y + "px",
956
+ threshold: ee(0, le(1, f)) || 1
968
957
  };
969
- let g = !0;
970
- function b(R) {
971
- const L = R[0].intersectionRatio;
972
- if (L !== a) {
973
- if (!g)
974
- return r();
975
- L ? r(!1, L) : o = setTimeout(() => {
976
- r(!1, 1e-7);
958
+ let w = !0;
959
+ function L(O) {
960
+ const M = O[0].intersectionRatio;
961
+ if (M !== f) {
962
+ if (!w)
963
+ return s();
964
+ M ? s(!1, M) : o = setTimeout(() => {
965
+ s(!1, 1e-7);
977
966
  }, 1e3);
978
967
  }
979
- L === 1 && !vt(c, e.getBoundingClientRect()) && r(), g = !1;
968
+ M === 1 && !St(a, e.getBoundingClientRect()) && s(), w = !1;
980
969
  }
981
970
  try {
982
- n = new IntersectionObserver(b, {
983
- ...x,
971
+ n = new IntersectionObserver(L, {
972
+ ...T,
984
973
  // Handle <iframe>s
985
974
  root: i.ownerDocument
986
975
  });
987
976
  } catch {
988
- n = new IntersectionObserver(b, x);
977
+ n = new IntersectionObserver(L, T);
989
978
  }
990
979
  n.observe(e);
991
980
  }
992
- return r(!0), s;
981
+ return s(!0), r;
993
982
  }
994
- function pt(e, t, n, o) {
983
+ function yn(e, t, n, o) {
995
984
  o === void 0 && (o = {});
996
985
  const {
997
986
  ancestorScroll: i = !0,
998
- ancestorResize: s = !0,
999
- elementResize: r = typeof ResizeObserver == "function",
1000
- layoutShift: l = typeof IntersectionObserver == "function",
1001
- animationFrame: a = !1
1002
- } = o, c = Ve(e), f = i || s ? [...c ? Q(c) : [], ...Q(t)] : [];
1003
- f.forEach((y) => {
987
+ ancestorResize: r = !0,
988
+ elementResize: s = typeof ResizeObserver == "function",
989
+ layoutShift: c = typeof IntersectionObserver == "function",
990
+ animationFrame: f = !1
991
+ } = o, a = Je(e), h = i || r ? [...a ? ne(a) : [], ...ne(t)] : [];
992
+ h.forEach((y) => {
1004
993
  i && y.addEventListener("scroll", n, {
1005
994
  passive: !0
1006
- }), s && y.addEventListener("resize", n);
995
+ }), r && y.addEventListener("resize", n);
1007
996
  });
1008
- const u = c && l ? on(c, n) : null;
1009
- let m = -1, h = null;
1010
- r && (h = new ResizeObserver((y) => {
1011
- let [E] = y;
1012
- E && E.target === c && h && (h.unobserve(t), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1013
- var x;
1014
- (x = h) == null || x.observe(t);
997
+ const d = a && c ? wn(a, n) : null;
998
+ let v = -1, u = null;
999
+ s && (u = new ResizeObserver((y) => {
1000
+ let [x] = y;
1001
+ x && x.target === a && u && (u.unobserve(t), cancelAnimationFrame(v), v = requestAnimationFrame(() => {
1002
+ var T;
1003
+ (T = u) == null || T.observe(t);
1015
1004
  })), n();
1016
- }), c && !a && h.observe(c), h.observe(t));
1017
- let p, d = a ? Z(e) : null;
1018
- a && v();
1019
- function v() {
1020
- const y = Z(e);
1021
- d && !vt(d, y) && n(), d = y, p = requestAnimationFrame(v);
1005
+ }), a && !f && u.observe(a), u.observe(t));
1006
+ let g, p = f ? oe(e) : null;
1007
+ f && m();
1008
+ function m() {
1009
+ const y = oe(e);
1010
+ p && !St(p, y) && n(), p = y, g = requestAnimationFrame(m);
1022
1011
  }
1023
1012
  return n(), () => {
1024
1013
  var y;
1025
- f.forEach((E) => {
1026
- i && E.removeEventListener("scroll", n), s && E.removeEventListener("resize", n);
1027
- }), u == null || u(), (y = h) == null || y.disconnect(), h = null, a && cancelAnimationFrame(p);
1014
+ h.forEach((x) => {
1015
+ i && x.removeEventListener("scroll", n), r && x.removeEventListener("resize", n);
1016
+ }), d == null || d(), (y = u) == null || y.disconnect(), u = null, f && cancelAnimationFrame(g);
1028
1017
  };
1029
1018
  }
1030
- const Rn = Vt, Pn = Wt, Cn = Ft, Mn = Bt, rn = Ht, sn = (e, t, n) => {
1019
+ const Un = Bt, qn = en, Gn = Qt, Jn = Zt, bn = Jt, En = (e, t, n) => {
1031
1020
  const o = /* @__PURE__ */ new Map(), i = {
1032
- platform: nn,
1021
+ platform: gn,
1033
1022
  ...n
1034
- }, s = {
1023
+ }, r = {
1035
1024
  ...i.platform,
1036
1025
  _c: o
1037
1026
  };
1038
- return kt(e, t, {
1027
+ return Gt(e, t, {
1039
1028
  ...i,
1040
- platform: s
1029
+ platform: r
1041
1030
  });
1042
1031
  };
1043
- function An(e, t, n = {}) {
1032
+ function Qn(e, t, n = {}) {
1044
1033
  const {
1045
1034
  transform: o = !0,
1046
1035
  middlewares: i,
1047
- whileElementsMounted: s,
1048
- open: r = _(!1),
1049
- setOpen: l = (x) => {
1050
- r.value = x;
1051
- }
1052
- } = n, a = O(() => T(n.placement) ?? "bottom"), c = O(() => T(n.strategy) ?? "absolute"), f = _(0), u = _(0), m = _(a.value), h = _(c.value), p = Me({}), d = _(!1), v = async () => {
1036
+ autoUpdate: r = !0,
1037
+ open: s = G(!1)
1038
+ } = n, c = (T) => {
1039
+ s.value = T;
1040
+ }, f = A(() => P(n.placement) ?? "bottom"), a = A(() => P(n.strategy) ?? "absolute"), h = G(0), d = G(0), v = G(f.value), u = G(a.value), g = We({}), p = G(!1), m = async () => {
1053
1041
  if (!e.value || !t.value) return;
1054
- const x = await sn(e.value, t.value, {
1055
- placement: a.value,
1056
- strategy: c.value,
1042
+ const T = await En(e.value, t.value, {
1043
+ placement: f.value,
1044
+ strategy: a.value,
1057
1045
  middleware: i
1058
1046
  });
1059
- f.value = x.x, u.value = x.y, m.value = x.placement, h.value = x.strategy, p.value = x.middlewareData, d.value = r.value;
1047
+ h.value = T.x, d.value = T.y, v.value = T.placement, u.value = T.strategy, g.value = T.middlewareData, p.value = s.value;
1060
1048
  };
1061
- ve([a, c], () => {
1062
- r.value && v();
1049
+ pe([f, a], () => {
1050
+ s.value && m();
1063
1051
  });
1064
1052
  let y;
1065
- ve(
1066
- [e, t, r],
1067
- ([x, g, b]) => {
1068
- !b || !x || !g || (s ? y = s(x, g, v) : y = pt(x, g, v), q(() => {
1053
+ pe(
1054
+ [e, t, s],
1055
+ ([T, w, L]) => {
1056
+ !L || !T || !w || (r && (y = yn(
1057
+ T,
1058
+ w,
1059
+ m,
1060
+ typeof r == "object" ? r : void 0
1061
+ )), B(() => {
1069
1062
  y == null || y(), y = void 0;
1070
1063
  }));
1071
1064
  },
1072
1065
  { immediate: !0 }
1073
- ), ae(() => y == null ? void 0 : y()), ve(r, (x) => {
1074
- x || (d.value = !1);
1066
+ ), re(() => y == null ? void 0 : y()), pe(s, (T) => {
1067
+ T || (p.value = !1);
1075
1068
  });
1076
- const E = O(() => {
1077
- const x = {
1078
- position: h.value,
1079
- left: "0",
1080
- top: "0"
1081
- };
1082
- if (!d.value || !t.value)
1083
- return x;
1084
- const g = Ye(t.value, f.value), b = Ye(t.value, u.value);
1085
- return T(o) ? {
1086
- ...x,
1087
- transform: `translate(${g}px, ${b}px)`,
1088
- ...it(t.value) >= 1.5 && {
1089
- willChange: "transform"
1090
- }
1091
- } : {
1092
- ...x,
1093
- left: `${g}px`,
1094
- top: `${b}px`
1095
- };
1069
+ const x = G({
1070
+ position: a.value,
1071
+ left: "0",
1072
+ top: "0"
1096
1073
  });
1097
- return {
1098
- x: f,
1099
- y: u,
1100
- strategy: h,
1101
- placement: m,
1102
- middlewareData: p,
1103
- isPositioned: d,
1104
- floatingStyles: E,
1105
- update: v,
1074
+ return pe(
1075
+ [h, d, () => P(o)],
1076
+ ([T, w, L]) => {
1077
+ const O = t.value;
1078
+ if (!O) return;
1079
+ const M = {
1080
+ position: u.value,
1081
+ left: "0",
1082
+ top: "0"
1083
+ }, H = ut(O, T), b = ut(O, w);
1084
+ L ? x.value = {
1085
+ ...M,
1086
+ transform: `translate(${H}px, ${b}px)`,
1087
+ ...Rt(O) >= 1.5 && {
1088
+ "will-change": "transform"
1089
+ }
1090
+ } : x.value = {
1091
+ ...M,
1092
+ left: `${H}px`,
1093
+ top: `${b}px`
1094
+ };
1095
+ },
1096
+ { immediate: !0 }
1097
+ ), {
1098
+ x: h,
1099
+ y: d,
1100
+ strategy: u,
1101
+ placement: v,
1102
+ middlewareData: g,
1103
+ isPositioned: p,
1104
+ floatingStyles: x,
1105
+ update: m,
1106
1106
  refs: {
1107
1107
  anchorEl: e,
1108
1108
  floatingEl: t
1109
1109
  },
1110
- open: r,
1111
- setOpen: l
1110
+ open: s,
1111
+ setOpen: c
1112
1112
  };
1113
1113
  }
1114
- function Dn(e, t, n, o = {}) {
1115
- return pt(e, t, n, o);
1116
- }
1117
- function Nn(e, t = {}) {
1118
- const { middlewareData: n, placement: o } = e, { offset: i = "-12px" } = t, s = O(() => {
1119
- var a;
1120
- return ((a = n.value.arrow) == null ? void 0 : a.x) ?? 0;
1121
- }), r = O(() => {
1122
- var a;
1123
- return ((a = n.value.arrow) == null ? void 0 : a.y) ?? 0;
1124
- }), l = O(() => {
1125
- const a = {
1126
- top: "inset-block-end",
1127
- right: "inset-inline-start",
1128
- bottom: "inset-block-start",
1129
- left: "inset-inline-end"
1130
- }[T(o).split("-")[0]], c = s.value != null ? `${s.value}px` : "", f = r.value != null ? `${r.value}px` : "";
1131
- return {
1132
- "inset-inline-start": c,
1133
- "inset-block-start": f,
1134
- [a]: i
1135
- };
1114
+ function ut(e, t) {
1115
+ const n = Rt(e);
1116
+ return Math.round(t * n) / n;
1117
+ }
1118
+ function Rt(e) {
1119
+ return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1120
+ }
1121
+ function Zn(e, t = {}) {
1122
+ const { middlewareData: n, placement: o } = e, { offset: i = "-4px" } = t, r = A(() => {
1123
+ var f;
1124
+ return ((f = n.value.arrow) == null ? void 0 : f.x) ?? 0;
1125
+ }), s = A(() => {
1126
+ var f;
1127
+ return ((f = n.value.arrow) == null ? void 0 : f.y) ?? 0;
1128
+ }), c = A(() => {
1129
+ const f = P(o).split("-")[0], a = r.value, h = s.value;
1130
+ return f === "bottom" ? {
1131
+ "inset-inline-start": `${a}px`,
1132
+ "inset-block-start": i
1133
+ } : f === "top" ? {
1134
+ "inset-inline-start": `${a}px`,
1135
+ "inset-block-end": i
1136
+ } : f === "right" ? {
1137
+ "inset-block-start": `${h}px`,
1138
+ "inset-inline-start": i
1139
+ } : f === "left" ? {
1140
+ "inset-block-start": `${h}px`,
1141
+ "inset-inline-end": i
1142
+ } : {};
1136
1143
  });
1137
1144
  return {
1138
- arrowX: s,
1139
- arrowY: r,
1140
- arrowStyles: l
1145
+ arrowX: r,
1146
+ arrowY: s,
1147
+ arrowStyles: c
1141
1148
  };
1142
1149
  }
1143
- const Ge = 10;
1144
- function ln(e) {
1150
+ let Tn = 0;
1151
+ function xn() {
1152
+ return `vfloat-id-${Tn++}`;
1153
+ }
1154
+ function ft(e) {
1155
+ return typeof e == "object" && e instanceof HTMLElement;
1156
+ }
1157
+ function Fe(e, t) {
1158
+ return e.contains(t);
1159
+ }
1160
+ function Ln(e) {
1161
+ return e.target;
1162
+ }
1163
+ function dt(e, t) {
1164
+ const [n, o] = e;
1165
+ let i = !1;
1166
+ const r = t.length;
1167
+ for (let s = 0, c = r - 1; s < r; c = s++) {
1168
+ const [f, a] = t[s] || [0, 0], [h, d] = t[c] || [0, 0];
1169
+ a >= o != d >= o && n <= (h - f) * (o - a) / (d - a) + f && (i = !i);
1170
+ }
1171
+ return i;
1172
+ }
1173
+ function Pn(e, t) {
1174
+ return e[0] >= t.x && e[0] <= t.x + t.width && e[1] >= t.y && e[1] <= t.y + t.height;
1175
+ }
1176
+ function On(e = {}) {
1177
+ const { requireIntent: t = !0 } = e;
1178
+ let n, o = !1, i = null, r = null, s = performance.now();
1179
+ function c(f, a) {
1180
+ const h = performance.now(), d = h - s;
1181
+ if (i === null || r === null || d === 0)
1182
+ return i = f, r = a, s = h, null;
1183
+ const v = f - i, u = a - r, p = Math.sqrt(v * v + u * u) / d;
1184
+ return i = f, r = a, s = h, p;
1185
+ }
1186
+ return function({
1187
+ x: a,
1188
+ y: h,
1189
+ placement: d,
1190
+ elements: v,
1191
+ buffer: u,
1192
+ onClose: g
1193
+ }) {
1194
+ const p = A(() => {
1195
+ const m = v.domReference;
1196
+ return ft(m) ? m : (m == null ? void 0 : m.contextElement) ?? null;
1197
+ });
1198
+ return function(y) {
1199
+ var he, Ze, ze, Be, et, tt, nt;
1200
+ function x() {
1201
+ clearTimeout(n), g();
1202
+ }
1203
+ if (clearTimeout(n), !v.domReference || !v.floating || d == null || a == null || h == null)
1204
+ return;
1205
+ const { clientX: T, clientY: w } = y, L = Ln(y), O = y.type === "mouseleave", M = v.floating && Fe(v.floating, L), H = p.value && Fe(p.value, L), b = (he = p.value) == null ? void 0 : he.getBoundingClientRect(), l = (Ze = v.floating) == null ? void 0 : Ze.getBoundingClientRect(), k = d.split("-")[0], S = a > ((l == null ? void 0 : l.right) ?? 0) - ((l == null ? void 0 : l.width) ?? 0) / 2, W = h > ((l == null ? void 0 : l.bottom) ?? 0) - ((l == null ? void 0 : l.height) ?? 0) / 2, C = ((l == null ? void 0 : l.width) ?? 0) > ((b == null ? void 0 : b.width) ?? 0), D = ((l == null ? void 0 : l.height) ?? 0) > ((b == null ? void 0 : b.height) ?? 0), E = ((ze = C ? b : l) == null ? void 0 : ze.left) ?? 0, R = ((Be = C ? b : l) == null ? void 0 : Be.right) ?? 0, F = ((et = D ? b : l) == null ? void 0 : et.top) ?? 0, $ = ((tt = D ? b : l) == null ? void 0 : tt.bottom) ?? 0;
1206
+ if (M && (o = !0, !O))
1207
+ return;
1208
+ if (H && (o = !1), H && !O) {
1209
+ o = !0;
1210
+ return;
1211
+ }
1212
+ if (O && ft(y.relatedTarget) && v.floating && Fe(v.floating, y.relatedTarget))
1213
+ return;
1214
+ if (k === "top" && h >= ((b == null ? void 0 : b.bottom) ?? 0) - 1 || k === "bottom" && h <= ((b == null ? void 0 : b.top) ?? 0) + 1 || k === "left" && a >= ((b == null ? void 0 : b.right) ?? 0) - 1 || k === "right" && a <= ((b == null ? void 0 : b.left) ?? 0) + 1)
1215
+ return x();
1216
+ let _ = [];
1217
+ switch (k) {
1218
+ case "top":
1219
+ _ = [
1220
+ [E, ((b == null ? void 0 : b.top) ?? 0) + 1],
1221
+ [E, ((l == null ? void 0 : l.bottom) ?? 0) - 1],
1222
+ [R, ((l == null ? void 0 : l.bottom) ?? 0) - 1],
1223
+ [R, ((b == null ? void 0 : b.top) ?? 0) + 1]
1224
+ ];
1225
+ break;
1226
+ case "bottom":
1227
+ _ = [
1228
+ [E, ((l == null ? void 0 : l.top) ?? 0) + 1],
1229
+ [E, ((b == null ? void 0 : b.bottom) ?? 0) - 1],
1230
+ [R, ((b == null ? void 0 : b.bottom) ?? 0) - 1],
1231
+ [R, ((l == null ? void 0 : l.top) ?? 0) + 1]
1232
+ ];
1233
+ break;
1234
+ case "left":
1235
+ _ = [
1236
+ [((l == null ? void 0 : l.right) ?? 0) - 1, $],
1237
+ [((l == null ? void 0 : l.right) ?? 0) - 1, F],
1238
+ [((b == null ? void 0 : b.left) ?? 0) + 1, F],
1239
+ [((b == null ? void 0 : b.left) ?? 0) + 1, $]
1240
+ ];
1241
+ break;
1242
+ case "right":
1243
+ _ = [
1244
+ [((b == null ? void 0 : b.right) ?? 0) - 1, $],
1245
+ [((b == null ? void 0 : b.right) ?? 0) - 1, F],
1246
+ [((l == null ? void 0 : l.left) ?? 0) + 1, F],
1247
+ [((l == null ? void 0 : l.left) ?? 0) + 1, $]
1248
+ ];
1249
+ break;
1250
+ }
1251
+ function Ee([N, I]) {
1252
+ switch (k) {
1253
+ case "top": {
1254
+ const Q = [
1255
+ C ? N + u / 2 : S ? N + u * 4 : N - u * 4,
1256
+ I + u + 1
1257
+ ], Z = [
1258
+ C ? N - u / 2 : S ? N + u * 4 : N - u * 4,
1259
+ I + u + 1
1260
+ ], ie = [
1261
+ [
1262
+ (l == null ? void 0 : l.left) ?? 0,
1263
+ S || C ? ((l == null ? void 0 : l.bottom) ?? 0) - u : (l == null ? void 0 : l.top) ?? 0
1264
+ ],
1265
+ [
1266
+ (l == null ? void 0 : l.right) ?? 0,
1267
+ S ? C ? ((l == null ? void 0 : l.bottom) ?? 0) - u : (l == null ? void 0 : l.top) ?? 0 : ((l == null ? void 0 : l.bottom) ?? 0) - u
1268
+ ]
1269
+ ];
1270
+ return [Q, Z, ...ie];
1271
+ }
1272
+ case "bottom": {
1273
+ const Q = [
1274
+ C ? N + u / 2 : S ? N + u * 4 : N - u * 4,
1275
+ I - u
1276
+ ], Z = [
1277
+ C ? N - u / 2 : S ? N + u * 4 : N - u * 4,
1278
+ I - u
1279
+ ], ie = [
1280
+ [
1281
+ (l == null ? void 0 : l.left) ?? 0,
1282
+ S || C ? ((l == null ? void 0 : l.top) ?? 0) + u : (l == null ? void 0 : l.bottom) ?? 0
1283
+ ],
1284
+ [
1285
+ (l == null ? void 0 : l.right) ?? 0,
1286
+ S ? C ? ((l == null ? void 0 : l.top) ?? 0) + u : (l == null ? void 0 : l.bottom) ?? 0 : ((l == null ? void 0 : l.top) ?? 0) + u
1287
+ ]
1288
+ ];
1289
+ return [Q, Z, ...ie];
1290
+ }
1291
+ case "left": {
1292
+ const Q = [
1293
+ N + u + 1,
1294
+ D ? I + u / 2 : W ? I + u * 4 : I - u * 4
1295
+ ], Z = [
1296
+ N + u + 1,
1297
+ D ? I - u / 2 : W ? I + u * 4 : I - u * 4
1298
+ ];
1299
+ return [...[
1300
+ [
1301
+ W || D ? ((l == null ? void 0 : l.right) ?? 0) - u : (l == null ? void 0 : l.left) ?? 0,
1302
+ (l == null ? void 0 : l.top) ?? 0
1303
+ ],
1304
+ [
1305
+ W ? D ? ((l == null ? void 0 : l.right) ?? 0) - u : (l == null ? void 0 : l.left) ?? 0 : ((l == null ? void 0 : l.right) ?? 0) - u,
1306
+ (l == null ? void 0 : l.bottom) ?? 0
1307
+ ]
1308
+ ], Q, Z];
1309
+ }
1310
+ case "right": {
1311
+ const Q = [
1312
+ N - u,
1313
+ D ? I + u / 2 : W ? I + u * 4 : I - u * 4
1314
+ ], Z = [
1315
+ N - u,
1316
+ D ? I - u / 2 : W ? I + u * 4 : I - u * 4
1317
+ ], ie = [
1318
+ [
1319
+ W || D ? ((l == null ? void 0 : l.left) ?? 0) + u : (l == null ? void 0 : l.right) ?? 0,
1320
+ (l == null ? void 0 : l.top) ?? 0
1321
+ ],
1322
+ [
1323
+ W ? D ? ((l == null ? void 0 : l.left) ?? 0) + u : (l == null ? void 0 : l.right) ?? 0 : ((l == null ? void 0 : l.left) ?? 0) + u,
1324
+ (l == null ? void 0 : l.bottom) ?? 0
1325
+ ]
1326
+ ];
1327
+ return [Q, Z, ...ie];
1328
+ }
1329
+ }
1330
+ }
1331
+ if (dt([T, w], _))
1332
+ return;
1333
+ if (o && b && !Pn([T, w], b))
1334
+ return x();
1335
+ if (!O && t) {
1336
+ const N = c(y.clientX, y.clientY);
1337
+ if (N !== null && N < 0.1)
1338
+ return x();
1339
+ }
1340
+ const de = Ee([a, h]);
1341
+ (nt = e.onPolygonChange) == null || nt.call(e, de), dt([T, w], de) ? !o && t && (n = window.setTimeout(x, 40)) : x();
1342
+ };
1343
+ };
1344
+ }
1345
+ const ht = 10;
1346
+ function Cn(e) {
1145
1347
  return e === "mouse" || e === "pen";
1146
1348
  }
1147
- function cn(e, t, n) {
1148
- const { delay: o } = n, i = O(() => {
1149
- const c = T(o);
1150
- return (typeof c == "number" ? c : c.open) ?? 0;
1151
- }), s = O(() => {
1152
- const c = T(o);
1153
- return (typeof c == "number" ? c : c.close) ?? 0;
1349
+ function Mn(e, t, n) {
1350
+ const { delay: o } = n, i = A(() => {
1351
+ const a = P(o);
1352
+ return (typeof a == "number" ? a : a.open) ?? 0;
1353
+ }), r = A(() => {
1354
+ const a = P(o);
1355
+ return (typeof a == "number" ? a : a.close) ?? 0;
1154
1356
  });
1155
- let r, l;
1156
- const a = () => {
1157
- clearTimeout(r), clearTimeout(l);
1357
+ let s, c;
1358
+ const f = () => {
1359
+ clearTimeout(s), clearTimeout(c);
1158
1360
  };
1159
- return ae(a), {
1160
- show: (c) => {
1161
- a();
1162
- const f = c ?? i.value;
1163
- f === 0 ? e() : r = setTimeout(e, f);
1361
+ return re(f), {
1362
+ show: (a) => {
1363
+ f();
1364
+ const h = a ?? i.value;
1365
+ h === 0 ? e() : s = setTimeout(e, h);
1164
1366
  },
1165
- hide: (c) => {
1166
- a();
1167
- const f = c ?? s.value;
1168
- f === 0 ? t() : l = setTimeout(t, f);
1367
+ hide: (a) => {
1368
+ f();
1369
+ const h = a ?? r.value;
1370
+ h === 0 ? t() : c = setTimeout(t, h);
1169
1371
  },
1170
1372
  showDelay: i,
1171
- hideDelay: s,
1172
- clearTimeouts: a
1373
+ hideDelay: r,
1374
+ clearTimeouts: f
1173
1375
  };
1174
1376
  }
1175
- function Sn(e, t = {}) {
1377
+ function zn(e, t = {}) {
1176
1378
  const {
1177
1379
  open: n,
1178
1380
  setOpen: o,
1179
- refs: { anchorEl: i, floatingEl: s }
1381
+ refs: { anchorEl: i, floatingEl: r }
1180
1382
  } = e, {
1181
- enabled: r = !0,
1182
- delay: l = 0,
1183
- restMs: a = 0,
1184
- mouseOnly: c = !1
1185
- } = t, f = O(() => T(r)), u = O(() => T(a)), m = O(() => {
1186
- const w = i.value;
1187
- return !w || w instanceof HTMLElement ? w : w.contextElement ?? null;
1188
- }), { hide: h, show: p, showDelay: d, clearTimeouts: v } = cn(
1383
+ enabled: s = !0,
1384
+ delay: c = 0,
1385
+ restMs: f = 0,
1386
+ mouseOnly: a = !1,
1387
+ safePolygon: h = !1
1388
+ } = t, d = A(() => P(s)), v = A(() => P(f)), u = A(() => {
1389
+ const E = i.value;
1390
+ return !E || E instanceof HTMLElement ? E : E.contextElement ?? null;
1391
+ }), { hide: g, show: p, showDelay: m, clearTimeouts: y } = Mn(
1189
1392
  () => {
1190
1393
  n.value || o(!0);
1191
1394
  },
1192
1395
  () => {
1193
1396
  n.value && o(!1);
1194
1397
  },
1195
- { delay: l }
1398
+ { delay: c }
1196
1399
  );
1197
- let y = null, E;
1198
- const x = O(() => d.value === 0 && u.value > 0);
1199
- function g(w) {
1200
- if (!f.value || !L(w) || !x.value || !y) return;
1201
- const C = { x: w.clientX, y: w.clientY }, P = Math.abs(C.x - y.x), Y = Math.abs(C.y - y.y);
1202
- (P > Ge || Y > Ge) && (y = C, clearTimeout(E), E = setTimeout(() => {
1400
+ let x = null, T;
1401
+ const w = A(() => m.value === 0 && v.value > 0);
1402
+ function L(E) {
1403
+ if (!d.value || !H(E) || !w.value || !x) return;
1404
+ const R = { x: E.clientX, y: E.clientY }, F = Math.abs(R.x - x.x), $ = Math.abs(R.y - x.y);
1405
+ (F > ht || $ > ht) && (x = R, clearTimeout(T), T = setTimeout(() => {
1203
1406
  p(0);
1204
- }, u.value));
1407
+ }, v.value));
1205
1408
  }
1206
- function b(w) {
1207
- !f.value || !L(w) || !x.value || (y = { x: w.clientX, y: w.clientY }, E = setTimeout(() => {
1409
+ function O(E) {
1410
+ !d.value || !H(E) || !w.value || (x = { x: E.clientX, y: E.clientY }, T = setTimeout(() => {
1208
1411
  p(0);
1209
- }, u.value));
1412
+ }, v.value));
1210
1413
  }
1211
- function R() {
1212
- clearTimeout(E), y = null;
1414
+ function M() {
1415
+ clearTimeout(T), x = null;
1213
1416
  }
1214
- re(() => {
1215
- const w = m.value;
1216
- !w || !f.value || !x.value || (w.addEventListener("pointerenter", b), w.addEventListener("pointermove", g), w.addEventListener("pointerleave", R), q(() => {
1217
- w.removeEventListener("pointerenter", b), w.removeEventListener("pointermove", g), w.removeEventListener("pointerleave", R);
1417
+ me(() => {
1418
+ const E = u.value;
1419
+ !E || !d.value || !w.value || (E.addEventListener("pointerenter", O), E.addEventListener("pointermove", L), E.addEventListener("pointerleave", M), B(() => {
1420
+ E.removeEventListener("pointerenter", O), E.removeEventListener("pointermove", L), E.removeEventListener("pointerleave", M);
1218
1421
  }));
1219
- }), ae(() => {
1220
- clearTimeout(E);
1422
+ }), re(() => {
1423
+ clearTimeout(T);
1221
1424
  });
1222
- function L(w) {
1223
- return !(T(c) && !ln(w.pointerType));
1425
+ function H(E) {
1426
+ return !(P(a) && !Cn(E.pointerType));
1224
1427
  }
1225
- function W(w) {
1226
- !f.value || !L(w) || x.value || p();
1428
+ function b(E) {
1429
+ !d.value || !H(E) || w.value || p();
1227
1430
  }
1228
- function k(w) {
1229
- !f.value || !L(w) || v();
1431
+ function l(E) {
1432
+ !d.value || !H(E) || (y(), S());
1230
1433
  }
1231
- function A(w) {
1232
- var C;
1233
- !f.value || !L(w) || (C = s.value) != null && C.contains(w.relatedTarget) || h();
1434
+ let k = null;
1435
+ function S() {
1436
+ k && (document.removeEventListener("pointermove", k), k = null);
1234
1437
  }
1235
- function I(w) {
1236
- var C;
1237
- !f.value || !L(w) || (C = m.value) != null && C.contains(w.relatedTarget) || h();
1438
+ const W = A(() => !!P(h)), C = A(() => {
1439
+ const E = P(h);
1440
+ if (typeof E == "object" && E) return E;
1441
+ if (E === !0) return {};
1442
+ });
1443
+ function D(E) {
1444
+ var _;
1445
+ if (!d.value || !H(E)) return;
1446
+ const { clientX: R, clientY: F } = E, $ = E.relatedTarget;
1447
+ W.value ? setTimeout(() => {
1448
+ var he;
1449
+ S();
1450
+ const Ee = u.value, de = r.value;
1451
+ if (!Ee || !de) {
1452
+ g();
1453
+ return;
1454
+ }
1455
+ k = On(C.value)({
1456
+ x: R,
1457
+ y: F,
1458
+ placement: e.placement.value,
1459
+ elements: {
1460
+ domReference: Ee,
1461
+ floating: de
1462
+ },
1463
+ buffer: ((he = C.value) == null ? void 0 : he.buffer) ?? 1,
1464
+ onClose: () => {
1465
+ S(), g();
1466
+ }
1467
+ }), document.addEventListener("pointermove", k);
1468
+ }, 0) : (_ = r.value) != null && _.contains($) || g();
1238
1469
  }
1239
- re(() => {
1240
- const w = m.value;
1241
- !w || !f.value || (w.addEventListener("pointerenter", W), w.addEventListener("pointerleave", A), q(() => {
1242
- w.removeEventListener("pointerenter", W), w.removeEventListener("pointerleave", A);
1470
+ me(() => {
1471
+ const E = u.value;
1472
+ !E || !d.value || (E.addEventListener("pointerenter", b), E.addEventListener("pointerleave", D), B(() => {
1473
+ E.removeEventListener("pointerenter", b), E.removeEventListener("pointerleave", D);
1243
1474
  }));
1244
- }), re(() => {
1245
- const w = s.value;
1246
- !w || !f.value || (w.addEventListener("pointerenter", k), w.addEventListener("pointerleave", I), q(() => {
1247
- w.removeEventListener("pointerenter", k), w.removeEventListener("pointerleave", I);
1475
+ }), me(() => {
1476
+ const E = r.value;
1477
+ !E || !d.value || (E.addEventListener("pointerenter", l), E.addEventListener("pointerleave", D), B(() => {
1478
+ E.removeEventListener("pointerenter", l), E.removeEventListener("pointerleave", D);
1248
1479
  }));
1480
+ }), re(() => {
1481
+ S();
1249
1482
  });
1250
1483
  }
1251
- function an(e) {
1252
- return wt() ? (ae(e), !0) : !1;
1484
+ function An(e) {
1485
+ return Ht() ? (re(e), !0) : !1;
1253
1486
  }
1254
- const un = typeof window < "u" && typeof document < "u";
1487
+ const Dn = typeof window < "u" && typeof document < "u";
1255
1488
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
1256
- const fn = Object.prototype.toString, dn = (e) => fn.call(e) === "[object Object]";
1257
- function Pe(e) {
1489
+ const Sn = Object.prototype.toString, Rn = (e) => Sn.call(e) === "[object Object]";
1490
+ function $e(e) {
1258
1491
  return Array.isArray(e) ? e : [e];
1259
1492
  }
1260
- function hn(e, t, n) {
1261
- return ve(
1493
+ function Nn(e, t, n) {
1494
+ return pe(
1262
1495
  e,
1263
1496
  t,
1264
1497
  {
@@ -1267,354 +1500,354 @@ function hn(e, t, n) {
1267
1500
  }
1268
1501
  );
1269
1502
  }
1270
- const vn = un ? window : void 0;
1271
- function pn(e) {
1503
+ const kn = Dn ? window : void 0;
1504
+ function Hn(e) {
1272
1505
  var t;
1273
- const n = T(e);
1506
+ const n = P(e);
1274
1507
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
1275
1508
  }
1276
- function D(...e) {
1509
+ function Y(...e) {
1277
1510
  const t = [], n = () => {
1278
- t.forEach((l) => l()), t.length = 0;
1279
- }, o = (l, a, c, f) => (l.addEventListener(a, c, f), () => l.removeEventListener(a, c, f)), i = O(() => {
1280
- const l = Pe(T(e[0])).filter((a) => a != null);
1281
- return l.every((a) => typeof a != "string") ? l : void 0;
1282
- }), s = hn(
1511
+ t.forEach((c) => c()), t.length = 0;
1512
+ }, o = (c, f, a, h) => (c.addEventListener(f, a, h), () => c.removeEventListener(f, a, h)), i = A(() => {
1513
+ const c = $e(P(e[0])).filter((f) => f != null);
1514
+ return c.every((f) => typeof f != "string") ? c : void 0;
1515
+ }), r = Nn(
1283
1516
  () => {
1284
- var l, a;
1517
+ var c, f;
1285
1518
  return [
1286
- (a = (l = i.value) == null ? void 0 : l.map((c) => pn(c))) != null ? a : [vn].filter((c) => c != null),
1287
- Pe(T(i.value ? e[1] : e[0])),
1288
- Pe(xt(i.value ? e[2] : e[1])),
1519
+ (f = (c = i.value) == null ? void 0 : c.map((a) => Hn(a))) != null ? f : [kn].filter((a) => a != null),
1520
+ $e(P(i.value ? e[1] : e[0])),
1521
+ $e(Ft(i.value ? e[2] : e[1])),
1289
1522
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
1290
- T(i.value ? e[3] : e[2])
1523
+ P(i.value ? e[3] : e[2])
1291
1524
  ];
1292
1525
  },
1293
- ([l, a, c, f]) => {
1294
- if (n(), !(l != null && l.length) || !(a != null && a.length) || !(c != null && c.length))
1526
+ ([c, f, a, h]) => {
1527
+ if (n(), !(c != null && c.length) || !(f != null && f.length) || !(a != null && a.length))
1295
1528
  return;
1296
- const u = dn(f) ? { ...f } : f;
1529
+ const d = Rn(h) ? { ...h } : h;
1297
1530
  t.push(
1298
- ...l.flatMap(
1299
- (m) => a.flatMap(
1300
- (h) => c.map((p) => o(m, h, p, u))
1531
+ ...c.flatMap(
1532
+ (v) => f.flatMap(
1533
+ (u) => a.map((g) => o(v, u, g, d))
1301
1534
  )
1302
1535
  )
1303
1536
  );
1304
1537
  },
1305
1538
  { flush: "post" }
1306
- ), r = () => {
1307
- s(), n();
1539
+ ), s = () => {
1540
+ r(), n();
1308
1541
  };
1309
- return an(n), r;
1542
+ return An(n), s;
1310
1543
  }
1311
- function kn(e, t = {}) {
1544
+ function Bn(e, t = {}) {
1312
1545
  const {
1313
1546
  open: n,
1314
1547
  setOpen: o,
1315
- refs: { floatingEl: i, anchorEl: s }
1316
- } = e, { enabled: r = !0, requireFocusVisible: l = !0 } = t, a = O(() => s.value ? s.value instanceof HTMLElement ? s.value : s.value.contextElement : null);
1317
- let c = !1, f = !0, u;
1318
- D(window, "blur", () => {
1319
- !n.value && a.value && a.value === document.activeElement && (c = !0);
1320
- }), D(window, "focus", () => {
1321
- c = !1;
1322
- }), bt(() => {
1323
- Je() && Qe() && (D(
1548
+ refs: { floatingEl: i, anchorEl: r }
1549
+ } = e, { enabled: s = !0, requireFocusVisible: c = !0 } = t, f = A(() => r.value ? r.value instanceof HTMLElement ? r.value : r.value.contextElement : null);
1550
+ let a = !1, h = !0, d;
1551
+ Y(window, "blur", () => {
1552
+ !n.value && f.value && f.value === document.activeElement && (a = !0);
1553
+ }), Y(window, "focus", () => {
1554
+ a = !1;
1555
+ }), $t(() => {
1556
+ pt() && mt() && (Y(
1324
1557
  window,
1325
1558
  "keydown",
1326
1559
  () => {
1327
- f = !0;
1560
+ h = !0;
1328
1561
  },
1329
1562
  { capture: !0 }
1330
- ), D(
1563
+ ), Y(
1331
1564
  window,
1332
1565
  "pointerdown",
1333
1566
  () => {
1334
- f = !1;
1567
+ h = !1;
1335
1568
  },
1336
1569
  { capture: !0 }
1337
1570
  ));
1338
1571
  });
1339
- function m(p) {
1340
- if (c) {
1341
- c = !1;
1572
+ function v(g) {
1573
+ if (a) {
1574
+ a = !1;
1342
1575
  return;
1343
1576
  }
1344
- const d = p.target;
1345
- if (T(l) && d) {
1346
- if (Je() && Qe() && !p.relatedTarget) {
1347
- if (!f && !mn(d))
1577
+ const p = g.target;
1578
+ if (P(c) && p) {
1579
+ if (pt() && mt() && !g.relatedTarget) {
1580
+ if (!h && !Fn(p))
1348
1581
  return;
1349
- } else if (!gn(d))
1582
+ } else if (!$n(p))
1350
1583
  return;
1351
1584
  }
1352
1585
  o(!0);
1353
1586
  }
1354
- function h(p) {
1355
- clearTimeout(u), u = window.setTimeout(() => {
1587
+ function u(g) {
1588
+ clearTimeout(d), d = window.setTimeout(() => {
1356
1589
  var y;
1357
- const v = (((y = a.value) == null ? void 0 : y.ownerDocument) ?? document).activeElement;
1358
- !p.relatedTarget && v === a.value || i.value && v && i.value.contains(v) || o(!1);
1590
+ const m = (((y = f.value) == null ? void 0 : y.ownerDocument) ?? document).activeElement;
1591
+ !g.relatedTarget && m === f.value || i.value && m && i.value.contains(m) || o(!1);
1359
1592
  }, 0);
1360
1593
  }
1361
- re(() => {
1362
- if (!T(r)) return;
1363
- const p = a.value;
1364
- !p || !(p instanceof HTMLElement) || (p.addEventListener("focus", m), p.addEventListener("blur", h), q(() => {
1365
- p.removeEventListener("focus", m), p.removeEventListener("blur", h);
1594
+ me(() => {
1595
+ if (!P(s)) return;
1596
+ const g = f.value;
1597
+ !g || !(g instanceof HTMLElement) || (g.addEventListener("focus", v), g.addEventListener("blur", u), B(() => {
1598
+ g.removeEventListener("focus", v), g.removeEventListener("blur", u);
1366
1599
  }));
1367
- }), ae(() => {
1368
- clearTimeout(u);
1600
+ }), re(() => {
1601
+ clearTimeout(d);
1369
1602
  });
1370
1603
  }
1371
- function Je() {
1604
+ function pt() {
1372
1605
  return navigator.platform.toUpperCase().indexOf("MAC") >= 0;
1373
1606
  }
1374
- function Qe() {
1607
+ function mt() {
1375
1608
  return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
1376
1609
  }
1377
- function mn(e) {
1610
+ function Fn(e) {
1378
1611
  return e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement;
1379
1612
  }
1380
- function gn(e) {
1613
+ function $n(e) {
1381
1614
  return e.matches(":focus-visible");
1382
1615
  }
1383
- function Hn(e, t = {}) {
1616
+ function eo(e, t = {}) {
1384
1617
  const { open: n, setOpen: o, refs: i } = e, {
1385
- enabled: s = !0,
1386
- event: r = "click",
1387
- toggle: l = !0,
1388
- ignoreMouse: a = !1,
1389
- keyboardHandlers: c = !0
1618
+ enabled: r = !0,
1619
+ event: s = "click",
1620
+ toggle: c = !0,
1621
+ ignoreMouse: f = !1,
1622
+ keyboardHandlers: a = !0
1390
1623
  } = t;
1391
- let f, u = !1;
1392
- const m = O(() => T(s)), h = O(
1624
+ let h, d = !1;
1625
+ const v = A(() => P(r)), u = A(
1393
1626
  () => i.anchorEl.value instanceof HTMLElement ? i.anchorEl.value : null
1394
1627
  );
1395
- function p() {
1396
- n.value ? T(l) && o(!1) : o(!0);
1628
+ function g() {
1629
+ n.value ? P(c) && o(!1) : o(!0);
1397
1630
  }
1398
- function d(g) {
1399
- f = g.pointerType;
1631
+ function p(w) {
1632
+ h = w.pointerType;
1400
1633
  }
1401
- function v(g) {
1402
- if (g.button !== 0 || T(r) === "click" || Ze(f) && T(a)) return;
1403
- const b = g.target;
1404
- !n.value && b === h.value && g.preventDefault(), p();
1634
+ function m(w) {
1635
+ if (w.button !== 0 || P(s) === "click" || vt(h) && P(f)) return;
1636
+ const L = w.target;
1637
+ !n.value && L === u.value && w.preventDefault(), g();
1405
1638
  }
1406
1639
  function y() {
1407
- if (T(r) === "mousedown" && f) {
1408
- f = void 0;
1640
+ if (P(s) === "mousedown" && h) {
1641
+ h = void 0;
1409
1642
  return;
1410
1643
  }
1411
- if (Ze(f) && T(a)) {
1412
- f = void 0;
1644
+ if (vt(h) && P(f)) {
1645
+ h = void 0;
1413
1646
  return;
1414
1647
  }
1415
- p(), f = void 0;
1648
+ g(), h = void 0;
1416
1649
  }
1417
- function E(g) {
1418
- if (f = void 0, g.defaultPrevented || !T(c) || ze(g))
1650
+ function x(w) {
1651
+ if (h = void 0, w.defaultPrevented || !P(a) || gt(w))
1419
1652
  return;
1420
- const b = h.value;
1421
- b && (g.key === " " && !et(b) && (g.preventDefault(), u = !0), g.key === "Enter" && p());
1653
+ const L = u.value;
1654
+ L && (w.key === " " && !wt(L) && (w.preventDefault(), d = !0), w.key === "Enter" && g());
1422
1655
  }
1423
- function x(g) {
1424
- const b = h.value;
1425
- b && (g.defaultPrevented || !T(c) || ze(g) || et(b) || g.key === " " && u && (u = !1, p()));
1656
+ function T(w) {
1657
+ const L = u.value;
1658
+ L && (w.defaultPrevented || !P(a) || gt(w) || wt(L) || w.key === " " && d && (d = !1, g()));
1426
1659
  }
1427
- re(() => {
1428
- const g = h.value;
1429
- !m.value || !g || (g.addEventListener("pointerdown", d), g.addEventListener("mousedown", v), g.addEventListener("click", y), g.addEventListener("keydown", E), g.addEventListener("keyup", x), q(() => {
1430
- g.removeEventListener("pointerdown", d), g.removeEventListener("mousedown", v), g.removeEventListener("click", y), g.removeEventListener("keydown", E), g.removeEventListener("keyup", x);
1660
+ me(() => {
1661
+ const w = u.value;
1662
+ !v.value || !w || (w.addEventListener("pointerdown", p), w.addEventListener("mousedown", m), w.addEventListener("click", y), w.addEventListener("keydown", x), w.addEventListener("keyup", T), B(() => {
1663
+ w.removeEventListener("pointerdown", p), w.removeEventListener("mousedown", m), w.removeEventListener("click", y), w.removeEventListener("keydown", x), w.removeEventListener("keyup", T);
1431
1664
  }));
1432
1665
  });
1433
1666
  }
1434
- function Ze(e, t) {
1667
+ function vt(e, t) {
1435
1668
  return e === void 0 ? !1 : e === "mouse";
1436
1669
  }
1437
- function ze(e) {
1670
+ function gt(e) {
1438
1671
  return e.target instanceof HTMLElement && e.target.tagName === "BUTTON";
1439
1672
  }
1440
- function yn(e) {
1673
+ function In(e) {
1441
1674
  return e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
1442
1675
  }
1443
- function et(e) {
1444
- return yn(e);
1676
+ function wt(e) {
1677
+ return In(e);
1445
1678
  }
1446
- function wn() {
1447
- const e = _(!1);
1448
- return D(document, "compositionstart", () => {
1449
- e.value = !0;
1450
- }), D(document, "compositionend", () => {
1451
- e.value = !1;
1452
- }), {
1453
- isComposing: () => e.value
1454
- };
1455
- }
1456
- function xn(e) {
1457
- return {
1458
- escapeKey: typeof e == "boolean" ? e : (e == null ? void 0 : e.escapeKey) ?? !1,
1459
- outsidePress: typeof e == "boolean" ? e : (e == null ? void 0 : e.outsidePress) ?? !0
1460
- };
1461
- }
1462
- function Ce(e) {
1463
- return e instanceof Element && e instanceof HTMLElement;
1464
- }
1465
- function tt(e, t) {
1466
- return t ? "composedPath" in e && typeof e.composedPath == "function" ? e.composedPath().includes(t) : t.contains(e.target) : !1;
1467
- }
1468
- function bn(e, t) {
1469
- const n = t.offsetWidth - t.clientWidth, o = t.offsetHeight - t.clientHeight;
1470
- return n > 0 && e.clientX > t.clientWidth || o > 0 && e.clientY > t.clientHeight;
1471
- }
1472
- function Fn(e, t = {}) {
1679
+ function to(e, t = {}) {
1473
1680
  const {
1474
1681
  enabled: n = !0,
1475
1682
  escapeKey: o = !0,
1476
1683
  outsidePress: i = !0,
1477
- outsidePressEvent: s = "pointerdown",
1478
- anchorPress: r = !1,
1479
- anchorPressEvent: l = "pointerdown",
1480
- ancestorScroll: a = !1,
1481
- capture: c
1482
- } = t, f = O(() => T(n)), u = e.refs.floatingEl, m = O(() => {
1483
- const g = e.refs.anchorEl.value;
1484
- return g ? g instanceof HTMLElement ? g : g.contextElement instanceof HTMLElement ? g.contextElement : null : null;
1485
- }), { isComposing: h } = wn(), { escapeKey: p, outsidePress: d } = xn(c);
1486
- let v = !1;
1487
- const y = (g) => {
1488
- !f.value || !e.open.value || !T(o) || g.key !== "Escape" || h() || e.setOpen(!1);
1489
- }, E = (g) => {
1490
- if (!f.value || !e.open.value)
1684
+ outsidePressEvent: r = "pointerdown",
1685
+ anchorPress: s = !1,
1686
+ anchorPressEvent: c = "pointerdown",
1687
+ ancestorScroll: f = !1,
1688
+ capture: a
1689
+ } = t, h = A(() => P(n)), d = e.refs.floatingEl, v = A(() => {
1690
+ const w = e.refs.anchorEl.value;
1691
+ return w ? w instanceof HTMLElement ? w : w.contextElement instanceof HTMLElement ? w.contextElement : null : null;
1692
+ }), { isComposing: u } = Yn(), { escapeKey: g, outsidePress: p } = Wn(a);
1693
+ let m = !1;
1694
+ const y = (w) => {
1695
+ !h.value || !e.open.value || !P(o) || w.key !== "Escape" || u() || e.setOpen(!1);
1696
+ }, x = (w) => {
1697
+ if (!h.value || !e.open.value)
1491
1698
  return;
1492
- if (s === "click" && v) {
1493
- v = !1;
1699
+ if (r === "click" && m) {
1700
+ m = !1;
1494
1701
  return;
1495
1702
  }
1496
- const b = T(i);
1497
- if (!b || typeof b == "function" && !b(g))
1703
+ const L = P(i);
1704
+ if (!L || typeof L == "function" && !L(w))
1498
1705
  return;
1499
- const R = g.target;
1500
- R && (Ce(R) && u.value && bn(g, R) || tt(g, m.value) || tt(g, u.value) || e.setOpen(!1));
1501
- }, x = () => {
1502
- f.value && e.open.value && T(r) && e.setOpen(!1);
1706
+ const O = w.target;
1707
+ O && (Ie(O) && d.value && Vn(w, O) || yt(w, v.value) || yt(w, d.value) || e.setOpen(!1));
1708
+ }, T = () => {
1709
+ h.value && e.open.value && P(s) && e.setOpen(!1);
1503
1710
  };
1504
- Ae((g) => {
1505
- if (!f.value || !e.open.value || !T(a))
1711
+ Ve((w) => {
1712
+ if (!h.value || !e.open.value || !P(f))
1506
1713
  return;
1507
- const b = () => {
1714
+ const L = () => {
1508
1715
  e.open.value && e.setOpen(!1);
1509
- }, R = [];
1510
- m.value && R.push(...Q(m.value).filter(Ce)), u.value && R.push(...Q(u.value).filter(Ce));
1511
- for (const L of R)
1512
- L.addEventListener("scroll", b, { passive: !0 });
1513
- g(() => {
1514
- for (const L of R)
1515
- L.removeEventListener("scroll", b);
1716
+ }, O = [];
1717
+ v.value && O.push(...ne(v.value).filter(Ie)), d.value && O.push(...ne(d.value).filter(Ie));
1718
+ for (const M of O)
1719
+ M.addEventListener("scroll", L, { passive: !0 });
1720
+ w(() => {
1721
+ for (const M of O)
1722
+ M.removeEventListener("scroll", L);
1516
1723
  });
1517
- }), D(document, "keydown", y, T(p)), D(document, s, E, T(d)), D(m, l, x), D(
1518
- u,
1724
+ }), Y(document, "keydown", y, P(g)), Y(document, r, x, P(p)), Y(v, c, T), Y(
1725
+ d,
1519
1726
  "mousedown",
1520
1727
  () => {
1521
- v = !0;
1728
+ m = !0;
1522
1729
  },
1523
1730
  { capture: !0 }
1524
- ), D(
1525
- u,
1731
+ ), Y(
1732
+ d,
1526
1733
  "mouseup",
1527
1734
  () => {
1528
- v = !0;
1735
+ m = !0;
1529
1736
  },
1530
1737
  { capture: !0 }
1531
1738
  );
1532
1739
  }
1533
- function Bn(e, t, n = {}) {
1740
+ function Wn(e) {
1741
+ return {
1742
+ escapeKey: typeof e == "boolean" ? e : (e == null ? void 0 : e.escapeKey) ?? !1,
1743
+ outsidePress: typeof e == "boolean" ? e : (e == null ? void 0 : e.outsidePress) ?? !0
1744
+ };
1745
+ }
1746
+ function Ie(e) {
1747
+ return e instanceof Element && e instanceof HTMLElement;
1748
+ }
1749
+ function yt(e, t) {
1750
+ return t ? "composedPath" in e && typeof e.composedPath == "function" ? e.composedPath().includes(t) : t.contains(e.target) : !1;
1751
+ }
1752
+ function Vn(e, t) {
1753
+ const n = t.offsetWidth - t.clientWidth, o = t.offsetHeight - t.clientHeight;
1754
+ return n > 0 && e.clientX > t.clientWidth || o > 0 && e.clientY > t.clientHeight;
1755
+ }
1756
+ function Yn() {
1757
+ const e = G(!1);
1758
+ return Y(document, "compositionstart", () => {
1759
+ e.value = !0;
1760
+ }), Y(document, "compositionend", () => {
1761
+ e.value = !1;
1762
+ }), {
1763
+ isComposing: () => e.value
1764
+ };
1765
+ }
1766
+ function no(e, t, n = {}) {
1534
1767
  const { open: o, refs: i } = t;
1535
- let s;
1536
- const r = _({ x: null, y: null }), l = O(() => T(n.axis ?? "both")), a = O(() => T(n.enabled ?? !0)), c = O(() => T(n.x ?? null)), f = O(() => T(n.y ?? null)), u = (d, v) => {
1537
- r.value = {
1538
- x: d,
1539
- y: v
1540
- }, o.value && (i.anchorEl.value = En(
1768
+ let r;
1769
+ const s = G({ x: null, y: null }), c = A(() => P(n.axis ?? "both")), f = A(() => P(n.enabled ?? !0)), a = A(() => P(n.x ?? null)), h = A(() => P(n.y ?? null)), d = (p, m) => {
1770
+ s.value = {
1771
+ x: p,
1772
+ y: m
1773
+ }, o.value && (i.anchorEl.value = Xn(
1541
1774
  e.value,
1542
- l.value,
1543
- r.value
1775
+ c.value,
1776
+ s.value
1544
1777
  ));
1545
1778
  };
1546
- Ae(() => {
1547
- const d = c.value, v = f.value;
1548
- a.value && d != null && v != null && u(d, v);
1779
+ Ve(() => {
1780
+ const p = a.value, m = h.value;
1781
+ f.value && p != null && m != null && d(p, m);
1549
1782
  });
1550
- const m = (d) => {
1551
- s = d.pointerType, u(d.clientX, d.clientY);
1552
- }, h = (d) => {
1553
- s = d.pointerType, !o.value && nt(s, !0) && u(d.clientX, d.clientY);
1554
- }, p = (d) => {
1555
- o.value && nt(s, !0) && u(d.clientX, d.clientY);
1783
+ const v = (p) => {
1784
+ r = p.pointerType, d(p.clientX, p.clientY);
1785
+ }, u = (p) => {
1786
+ r = p.pointerType, !o.value && bt(r, !0) && d(p.clientX, p.clientY);
1787
+ }, g = (p) => {
1788
+ o.value && bt(r, !0) && d(p.clientX, p.clientY);
1556
1789
  };
1557
- return Ae(() => {
1558
- if (c.value != null || f.value != null) return;
1559
- const d = e.value;
1560
- !d || !a.value || (d.addEventListener("pointerenter", h), d.addEventListener("pointerdown", m), d.addEventListener("pointermove", p), q(() => {
1561
- d == null || d.removeEventListener("pointerenter", h), d == null || d.removeEventListener("pointerdown", m), d == null || d.removeEventListener("pointermove", p);
1790
+ return Ve(() => {
1791
+ if (a.value != null || h.value != null) return;
1792
+ const p = e.value;
1793
+ !p || !f.value || (p.addEventListener("pointerenter", u), p.addEventListener("pointerdown", v), p.addEventListener("pointermove", g), B(() => {
1794
+ p == null || p.removeEventListener("pointerenter", u), p == null || p.removeEventListener("pointerdown", v), p == null || p.removeEventListener("pointermove", g);
1562
1795
  }));
1563
1796
  }), {
1564
- coordinates: Et(r),
1565
- updatePosition: u
1797
+ coordinates: It(s),
1798
+ updatePosition: d
1566
1799
  };
1567
1800
  }
1568
- function En(e, t, n) {
1801
+ function Xn(e, t, n) {
1569
1802
  let o = null, i = null;
1570
- const s = e;
1803
+ const r = e;
1571
1804
  return {
1572
- contextElement: s || void 0,
1805
+ contextElement: r || void 0,
1573
1806
  getBoundingClientRect: () => {
1574
- const r = (s == null ? void 0 : s.getBoundingClientRect()) ?? {
1807
+ const s = (r == null ? void 0 : r.getBoundingClientRect()) ?? {
1575
1808
  width: 0,
1576
1809
  height: 0,
1577
1810
  x: 0,
1578
1811
  y: 0
1579
- }, l = t === "x" || t === "both", a = t === "y" || t === "both";
1580
- let c = 0, f = 0, u = r.x, m = r.y;
1581
- return s && (o == null && n.x != null && l && (o = r.x - n.x), i == null && n.y != null && a && (i = r.y - n.y), u -= o || 0, m -= i || 0), l && n.x != null ? u = n.x : (o = null, c = r.width), a && n.y != null ? m = n.y : (i = null, f = r.height), t === "both" && (c = 0, f = 0), {
1582
- width: c,
1583
- height: f,
1584
- x: u,
1585
- y: m,
1586
- top: m,
1587
- right: u + c,
1588
- bottom: m + f,
1589
- left: u
1812
+ }, c = t === "x" || t === "both", f = t === "y" || t === "both";
1813
+ let a = 0, h = 0, d = s.x, v = s.y;
1814
+ return r && (o == null && n.x != null && c && (o = s.x - n.x), i == null && n.y != null && f && (i = s.y - n.y), d -= o || 0, v -= i || 0), c && n.x != null ? d = n.x : (o = null, a = s.width), f && n.y != null ? v = n.y : (i = null, h = s.height), t === "both" && (a = 0, h = 0), {
1815
+ width: a,
1816
+ height: h,
1817
+ x: d,
1818
+ y: v,
1819
+ top: v,
1820
+ right: d + a,
1821
+ bottom: v + h,
1822
+ left: d
1590
1823
  };
1591
1824
  }
1592
1825
  };
1593
1826
  }
1594
- function nt(e, t) {
1827
+ function bt(e, t) {
1595
1828
  if (e === void 0) return !1;
1596
1829
  const n = e === "mouse";
1597
1830
  return t ? n : n || e === "pen";
1598
1831
  }
1599
- function $n(e) {
1832
+ function oo(e) {
1600
1833
  return {
1601
1834
  name: "arrow",
1602
1835
  options: e,
1603
1836
  fn(t) {
1604
- const n = T(e.element);
1605
- return n == null ? {} : rn({ element: n, padding: e.padding }).fn(t);
1837
+ const n = P(e.element);
1838
+ return n == null ? {} : bn({ element: n, padding: e.padding }).fn(t);
1606
1839
  }
1607
1840
  };
1608
1841
  }
1609
- var se;
1610
- class ot {
1842
+ var ve;
1843
+ class Et {
1611
1844
  constructor(t, n = null, o = {}, i = !1) {
1612
- U(this, "id");
1613
- U(this, "data");
1614
- U(this, "parent");
1615
- U(this, "children");
1616
- de(this, se);
1617
- this.id = o.id ?? Ot(), this.data = t, this.parent = Me(n), this.children = Me([]), Le(this, se, i);
1845
+ z(this, "id");
1846
+ z(this, "data");
1847
+ z(this, "parent");
1848
+ z(this, "children");
1849
+ Te(this, ve);
1850
+ this.id = o.id ?? xn(), this.data = t, this.parent = We(n), this.children = We([]), Ne(this, ve, i);
1618
1851
  }
1619
1852
  /**
1620
1853
  * Adds an existing node instance to this node's children array.
@@ -1634,16 +1867,6 @@ class ot {
1634
1867
  _removeChildInstance(t) {
1635
1868
  return this.children.value.includes(t) ? (this.children.value = this.children.value.filter((n) => n.id !== t.id), t.parent.value = null, !0) : !1;
1636
1869
  }
1637
- /**
1638
- * Updates the node's data.
1639
- * If T is an object, performs a shallow merge using Object.assign.
1640
- * If T is a primitive, replaces the value.
1641
- * @param newData Partial data for objects, or the new value for primitives.
1642
- */
1643
- updateData(t) {
1644
- const n = this.data;
1645
- typeof n == "object" && n !== null && typeof t == "object" && t !== null ? this.data = Object.assign({}, n, t) : this.data = t;
1646
- }
1647
1870
  /**
1648
1871
  * Finds the first direct child matching the predicate.
1649
1872
  * @param predicate Function to test each child node.
@@ -1695,16 +1918,16 @@ class ot {
1695
1918
  }
1696
1919
  /** Checks if the node is the true root of the tree, distinct from an orphaned node. */
1697
1920
  get isRoot() {
1698
- return Te(this, se);
1921
+ return Re(this, ve);
1699
1922
  }
1700
1923
  /** Checks if the node is a leaf node (has no children). */
1701
1924
  get isLeaf() {
1702
1925
  return this.children.value.length === 0;
1703
1926
  }
1704
1927
  }
1705
- se = new WeakMap();
1706
- var le, ce, ke;
1707
- class Tn {
1928
+ ve = new WeakMap();
1929
+ var ge, we, _e;
1930
+ class jn {
1708
1931
  /**
1709
1932
  * Creates a new Tree instance.
1710
1933
  * @param initialRootData Data for the root node.
@@ -1717,13 +1940,13 @@ class Tn {
1717
1940
  * ```
1718
1941
  */
1719
1942
  constructor(t, n) {
1720
- de(this, ce);
1943
+ Te(this, we);
1721
1944
  /** The root node of the tree. */
1722
- U(this, "root");
1945
+ z(this, "root");
1723
1946
  /** Readonly reactive map of node IDs to TreeNode instances for quick lookups. */
1724
- U(this, "nodeMap");
1725
- de(this, le);
1726
- Le(this, le, (n == null ? void 0 : n.deleteStrategy) ?? "recursive"), this.nodeMap = Tt(/* @__PURE__ */ new Map()), this.root = new ot(t, null, {}, !0), this.nodeMap.set(this.root.id, this.root);
1947
+ z(this, "nodeMap");
1948
+ Te(this, ge);
1949
+ Ne(this, ge, (n == null ? void 0 : n.deleteStrategy) ?? "recursive"), this.nodeMap = Wt(/* @__PURE__ */ new Map()), this.root = new Et(t, null, {}, !0), this.nodeMap.set(this.root.id, this.root);
1727
1950
  }
1728
1951
  /**
1729
1952
  * Finds a node anywhere in the tree by its ID.
@@ -1745,8 +1968,8 @@ class Tn {
1745
1968
  if (!i)
1746
1969
  return console.error(`Tree addNode: Parent node with ID ${n} not found.`), null;
1747
1970
  o.id && this.nodeMap.has(o.id) && (o.id = void 0);
1748
- const s = new ot(t, i, o);
1749
- return this.nodeMap.set(s.id, s), i.addChild(s), s;
1971
+ const r = new Et(t, i, o);
1972
+ return this.nodeMap.set(r.id, r), i.addChild(r), r;
1750
1973
  }
1751
1974
  /**
1752
1975
  * Removes a node from the tree by its ID.
@@ -1756,20 +1979,20 @@ class Tn {
1756
1979
  * @returns True if the node was successfully removed, false otherwise.
1757
1980
  */
1758
1981
  removeNode(t, n) {
1759
- const o = n ?? Te(this, le), i = this.findNodeById(t);
1982
+ const o = n ?? Re(this, ge), i = this.findNodeById(t);
1760
1983
  if (!i)
1761
1984
  return !1;
1762
1985
  if (i.isRoot)
1763
1986
  return console.error("Tree removeNode: Cannot remove the root node."), !1;
1764
- const s = i.parent.value;
1987
+ const r = i.parent.value;
1765
1988
  if (o === "recursive")
1766
- Oe(this, ce, ke).call(this, i);
1989
+ ke(this, we, _e).call(this, i);
1767
1990
  else {
1768
- for (const r of i.children.value)
1769
- r.parent.value = null;
1991
+ for (const s of i.children.value)
1992
+ s.parent.value = null;
1770
1993
  i.children.value = [], this.nodeMap.delete(i.id);
1771
1994
  }
1772
- return s._removeChildInstance(i);
1995
+ return r._removeChildInstance(i);
1773
1996
  }
1774
1997
  /**
1775
1998
  * Moves a node to become a child of a new parent.
@@ -1790,9 +2013,9 @@ class Tn {
1790
2013
  return console.error(`Tree moveNode: New parent node with ID ${n} not found.`), !1;
1791
2014
  if (i.isDescendantOf(o))
1792
2015
  return console.error("Tree moveNode: Cannot move a node to become its own descendant."), !1;
1793
- const s = o.parent.value;
1794
- if (s) {
1795
- if (!s._removeChildInstance(o))
2016
+ const r = o.parent.value;
2017
+ if (r) {
2018
+ if (!r._removeChildInstance(o))
1796
2019
  return console.error("Tree moveNode: Failed to remove node from its original parent."), !1;
1797
2020
  } else if (o.isRoot) {
1798
2021
  if (o.isRoot)
@@ -1813,18 +2036,18 @@ class Tn {
1813
2036
  if (t === "dfs") {
1814
2037
  const i = [n];
1815
2038
  for (; i.length > 0; ) {
1816
- const s = i.pop();
1817
- o.push(s);
1818
- for (let r = s.children.value.length - 1; r >= 0; r--)
1819
- i.push(s.children.value[r]);
2039
+ const r = i.pop();
2040
+ o.push(r);
2041
+ for (let s = r.children.value.length - 1; s >= 0; s--)
2042
+ i.push(r.children.value[s]);
1820
2043
  }
1821
2044
  } else {
1822
2045
  const i = [n];
1823
2046
  for (; i.length > 0; ) {
1824
- const s = i.shift();
1825
- o.push(s);
1826
- for (const r of s.children.value)
1827
- i.push(r);
2047
+ const r = i.shift();
2048
+ o.push(r);
2049
+ for (const s of r.children.value)
2050
+ i.push(s);
1828
2051
  }
1829
2052
  }
1830
2053
  return o;
@@ -1839,15 +2062,15 @@ class Tn {
1839
2062
  this.nodeMap.clear();
1840
2063
  }
1841
2064
  }
1842
- le = new WeakMap(), ce = new WeakSet(), // --- Internal Recursive Helper for Deletion/Cleanup ---
1843
- ke = function(t) {
2065
+ ge = new WeakMap(), we = new WeakSet(), // --- Internal Recursive Helper for Deletion/Cleanup ---
2066
+ _e = function(t) {
1844
2067
  const n = [...t.children.value];
1845
2068
  for (const o of n)
1846
- Oe(this, ce, ke).call(this, o);
2069
+ ke(this, we, _e).call(this, o);
1847
2070
  this.nodeMap.delete(t.id), t.children.value = [];
1848
2071
  };
1849
- function Vn(e, t = {}) {
1850
- const n = new Tn(e, t);
2072
+ function io(e, t = {}) {
2073
+ const n = new jn(e, t);
1851
2074
  return {
1852
2075
  // Wrap original Tree methods in arrow functions to preserve context
1853
2076
  get nodeMap() {
@@ -1856,101 +2079,100 @@ function Vn(e, t = {}) {
1856
2079
  get root() {
1857
2080
  return n.root;
1858
2081
  },
1859
- findNodeById: (r) => n.findNodeById(r),
1860
- moveNode: (r, l) => n.moveNode(r, l),
2082
+ findNodeById: (s) => n.findNodeById(s),
2083
+ moveNode: (s, c) => n.moveNode(s, c),
1861
2084
  dispose: () => n.dispose(),
1862
- addNode: (r, l) => n.addNode(r, l),
1863
- removeNode: (r, l) => n.removeNode(r, l),
1864
- traverse: (r, l) => n.traverse(r, l),
1865
- isTopmost: (r) => {
1866
- const l = n.findNodeById(r);
1867
- if (!l || !l.data.open.value)
2085
+ addNode: (s, c) => n.addNode(s, c),
2086
+ removeNode: (s, c) => n.removeNode(s, c),
2087
+ traverse: (s, c) => n.traverse(s, c),
2088
+ isTopmost: (s) => {
2089
+ const c = n.findNodeById(s);
2090
+ if (!c || !c.data.open.value)
1868
2091
  return !1;
1869
- let a = l.parent.value;
1870
- for (; a; ) {
1871
- if (a.data.open.value)
2092
+ let f = c.parent.value;
2093
+ for (; f; ) {
2094
+ if (f.data.open.value)
1872
2095
  return !1;
1873
- a = a.parent.value;
2096
+ f = f.parent.value;
1874
2097
  }
1875
2098
  return !0;
1876
2099
  },
1877
2100
  getAllOpenNodes: () => {
1878
- const r = [];
1879
- for (const l of n.nodeMap.values())
1880
- l.data.open.value && r.push(l);
1881
- return r;
2101
+ const s = [];
2102
+ for (const c of n.nodeMap.values())
2103
+ c.data.open.value && s.push(c);
2104
+ return s;
1882
2105
  },
1883
- forEach: (r, l, a = {}) => {
1884
- const { relationship: c = "self-and-children", applyToMatching: f = !0 } = a, u = n.findNodeById(r);
1885
- if (!u)
2106
+ forEach: (s, c, f = {}) => {
2107
+ const { relationship: a = "self-and-children", applyToMatching: h = !0 } = f, d = n.findNodeById(s);
2108
+ if (!d)
1886
2109
  return;
1887
- const m = [], h = /* @__PURE__ */ new Set(), p = (v) => {
1888
- v && !h.has(v.id) && (m.push(v), h.add(v.id));
1889
- }, d = (v) => {
1890
- for (const y of v)
1891
- p(y);
2110
+ const v = [], u = /* @__PURE__ */ new Set(), g = (m) => {
2111
+ m && !u.has(m.id) && (v.push(m), u.add(m.id));
2112
+ }, p = (m) => {
2113
+ for (const y of m)
2114
+ g(y);
1892
2115
  };
1893
- if (c === "ancestors-only")
1894
- for (const v of u.getPath())
1895
- v.id !== u.id && p(v);
1896
- else if (c === "siblings-only") {
1897
- if (u.parent.value)
1898
- for (const v of u.parent.value.children.value)
1899
- v.id !== u.id && p(v);
1900
- } else if (c === "descendants-only")
1901
- for (const v of n.traverse("dfs", u))
1902
- v.id !== u.id && p(v);
1903
- else if (c === "children-only")
1904
- d(u.children.value);
1905
- else if (c === "self-and-ancestors")
1906
- d(u.getPath());
1907
- else if (c === "self-and-children")
1908
- p(u), d(u.children.value);
1909
- else if (c === "self-and-descendants")
1910
- d(n.traverse("dfs", u));
1911
- else if (c === "self-and-siblings")
1912
- p(u), u.parent.value && d(u.parent.value.children.value);
1913
- else if (c === "self-ancestors-and-children")
1914
- d(u.getPath()), d(u.children.value);
1915
- else if (c === "full-branch")
1916
- d(u.getPath()), d(n.traverse("dfs", u));
1917
- else if (c === "all-except-branch") {
1918
- const v = /* @__PURE__ */ new Set();
1919
- for (const y of u.getPath())
1920
- v.add(y.id);
1921
- for (const y of n.traverse("dfs", u))
1922
- v.add(y.id);
2116
+ if (a === "ancestors-only")
2117
+ for (const m of d.getPath())
2118
+ m.id !== d.id && g(m);
2119
+ else if (a === "siblings-only") {
2120
+ if (d.parent.value)
2121
+ for (const m of d.parent.value.children.value)
2122
+ m.id !== d.id && g(m);
2123
+ } else if (a === "descendants-only")
2124
+ for (const m of n.traverse("dfs", d))
2125
+ m.id !== d.id && g(m);
2126
+ else if (a === "children-only")
2127
+ p(d.children.value);
2128
+ else if (a === "self-and-ancestors")
2129
+ p(d.getPath());
2130
+ else if (a === "self-and-children")
2131
+ g(d), p(d.children.value);
2132
+ else if (a === "self-and-descendants")
2133
+ p(n.traverse("dfs", d));
2134
+ else if (a === "self-and-siblings")
2135
+ g(d), d.parent.value && p(d.parent.value.children.value);
2136
+ else if (a === "self-ancestors-and-children")
2137
+ p(d.getPath()), p(d.children.value);
2138
+ else if (a === "full-branch")
2139
+ p(d.getPath()), p(n.traverse("dfs", d));
2140
+ else if (a === "all-except-branch") {
2141
+ const m = /* @__PURE__ */ new Set();
2142
+ for (const y of d.getPath())
2143
+ m.add(y.id);
2144
+ for (const y of n.traverse("dfs", d))
2145
+ m.add(y.id);
1923
2146
  for (const y of n.nodeMap.values())
1924
- !v.has(y.id) === f && l(y);
2147
+ !m.has(y.id) === h && c(y);
1925
2148
  return;
1926
2149
  } else {
1927
- console.warn(`forEach: Unknown relationship "${c}".`);
2150
+ console.warn(`forEach: Unknown relationship "${a}".`);
1928
2151
  return;
1929
2152
  }
1930
- if (f)
1931
- for (const v of m)
1932
- l(v);
2153
+ if (h)
2154
+ for (const m of v)
2155
+ c(m);
1933
2156
  else
1934
- for (const v of n.nodeMap.values())
1935
- h.has(v.id) || l(v);
2157
+ for (const m of n.nodeMap.values())
2158
+ u.has(m.id) || c(m);
1936
2159
  }
1937
2160
  };
1938
2161
  }
1939
2162
  export {
1940
- Tn as Tree,
1941
- ot as TreeNode,
1942
- $n as arrow,
1943
- Dn as autoUpdate,
1944
- Cn as flip,
1945
- Mn as hide,
1946
- Rn as offset,
1947
- Pn as shift,
1948
- Nn as useArrow,
1949
- Hn as useClick,
1950
- Bn as useClientPoint,
1951
- Fn as useDismiss,
1952
- An as useFloating,
1953
- Vn as useFloatingTree,
1954
- kn as useFocus,
1955
- Sn as useHover
2163
+ jn as Tree,
2164
+ Et as TreeNode,
2165
+ oo as arrow,
2166
+ Gn as flip,
2167
+ Jn as hide,
2168
+ Un as offset,
2169
+ qn as shift,
2170
+ Zn as useArrow,
2171
+ eo as useClick,
2172
+ no as useClientPoint,
2173
+ to as useDismiss,
2174
+ Qn as useFloating,
2175
+ io as useFloatingTree,
2176
+ Bn as useFocus,
2177
+ zn as useHover
1956
2178
  };