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