@tedi-design-system/react 18.0.0-rc.3 → 18.0.0-rc.5
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/bundle-stats.html +1 -1
- package/external/@floating-ui/core/dist/floating-ui.core.cjs.js +1 -1
- package/external/@floating-ui/core/dist/floating-ui.core.es.js +275 -271
- package/external/@floating-ui/dom/dist/floating-ui.dom.cjs.js +1 -1
- package/external/@floating-ui/dom/dist/floating-ui.dom.es.js +189 -188
- package/external/@floating-ui/react/dist/floating-ui.react.cjs.js +1 -1
- package/external/@floating-ui/react/dist/floating-ui.react.es.js +1419 -1538
- package/external/@floating-ui/react/dist/floating-ui.react.utils.cjs.js +1 -1
- package/external/@floating-ui/react/dist/floating-ui.react.utils.es.js +348 -81
- package/external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js +1 -1
- package/external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js +113 -93
- package/external/@floating-ui/utils/dist/floating-ui.utils.cjs.js +1 -1
- package/external/@floating-ui/utils/dist/floating-ui.utils.dom.cjs.js +1 -1
- package/external/@floating-ui/utils/dist/floating-ui.utils.dom.es.js +97 -97
- package/external/@floating-ui/utils/dist/floating-ui.utils.es.js +66 -68
- package/external/lodash-es/_baseUnset.cjs.js +1 -1
- package/external/lodash-es/_baseUnset.es.js +12 -19
- package/external/tabbable/dist/index.esm.cjs.js +1 -1
- package/external/tabbable/dist/index.esm.es.js +72 -63
- package/index.css +1 -1
- package/package.json +4 -4
- package/src/community/components/modal/modal-closer.d.ts +6 -0
- package/src/community/components/modal/modal-provider.d.ts +6 -0
- package/src/community/components/modal/modal-trigger.d.ts +6 -0
- package/src/community/components/modal/modal.d.ts +6 -0
- package/src/tedi/components/buttons/button-group/button-group.cjs.js +1 -1
- package/src/tedi/components/buttons/button-group/button-group.es.js +4 -4
- package/src/tedi/components/buttons/collapse/collapse.cjs.js +1 -1
- package/src/tedi/components/buttons/collapse/collapse.d.ts +15 -0
- package/src/tedi/components/buttons/collapse/collapse.es.js +55 -54
- package/src/tedi/components/content/table/index.d.ts +6 -0
- package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.cjs.js +1 -0
- package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.d.ts +15 -0
- package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.es.js +37 -0
- package/src/tedi/components/content/table/table-context.cjs.js +1 -0
- package/src/tedi/components/content/table/table-context.d.ts +3 -0
- package/src/tedi/components/content/table/table-context.es.js +11 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.cjs.js +1 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.d.ts +51 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.es.js +42 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.module.scss.cjs.js +1 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.module.scss.es.js +7 -0
- package/src/tedi/components/content/table/table-toolbar/table-toolbar.cjs.js +1 -0
- package/src/tedi/components/content/table/table-toolbar/table-toolbar.d.ts +21 -0
- package/src/tedi/components/content/table/table-toolbar/table-toolbar.es.js +9 -0
- package/src/tedi/components/content/table/table.cjs.js +1 -0
- package/src/tedi/components/content/table/table.d.ts +519 -0
- package/src/tedi/components/content/table/table.es.js +856 -0
- package/src/tedi/components/content/table/table.module.scss.cjs.js +1 -0
- package/src/tedi/components/content/table/table.module.scss.es.js +54 -0
- package/src/tedi/components/content/table/use-table-persistence.cjs.js +1 -0
- package/src/tedi/components/content/table/use-table-persistence.d.ts +13 -0
- package/src/tedi/components/content/table/use-table-persistence.es.js +53 -0
- package/src/tedi/components/form/time-field/time-field.es.js +3 -3
- package/src/tedi/components/navigation/pagination/pagination.cjs.js +1 -1
- package/src/tedi/components/navigation/pagination/pagination.d.ts +7 -0
- package/src/tedi/components/navigation/pagination/pagination.es.js +132 -91
- package/src/tedi/components/navigation/pagination/pagination.module.scss.cjs.js +1 -1
- package/src/tedi/components/navigation/pagination/pagination.module.scss.es.js +7 -1
- package/src/tedi/components/navigation/pagination/pagination.types.d.ts +100 -0
- package/src/tedi/components/overlays/modal/index.d.ts +8 -0
- package/src/tedi/components/overlays/modal/modal-body/modal-body.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-body/modal-body.d.ts +22 -0
- package/src/tedi/components/overlays/modal/modal-body/modal-body.es.js +21 -0
- package/src/tedi/components/overlays/modal/modal-closer/modal-closer.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-closer/modal-closer.d.ts +15 -0
- package/src/tedi/components/overlays/modal/modal-closer/modal-closer.es.js +16 -0
- package/src/tedi/components/overlays/modal/modal-content/modal-content.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-content/modal-content.d.ts +108 -0
- package/src/tedi/components/overlays/modal/modal-content/modal-content.es.js +81 -0
- package/src/tedi/components/overlays/modal/modal-context.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-context.d.ts +59 -0
- package/src/tedi/components/overlays/modal/modal-context.es.js +15 -0
- package/src/tedi/components/overlays/modal/modal-footer/modal-footer.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-footer/modal-footer.d.ts +22 -0
- package/src/tedi/components/overlays/modal/modal-footer/modal-footer.es.js +25 -0
- package/src/tedi/components/overlays/modal/modal-header/modal-header.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-header/modal-header.d.ts +58 -0
- package/src/tedi/components/overlays/modal/modal-header/modal-header.es.js +25 -0
- package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.d.ts +13 -0
- package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.es.js +14 -0
- package/src/tedi/components/overlays/modal/modal.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal.d.ts +68 -0
- package/src/tedi/components/overlays/modal/modal.es.js +76 -0
- package/src/tedi/components/overlays/modal/modal.module.scss.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal.module.scss.es.js +36 -0
- package/src/tedi/components/overlays/tooltip/tooltip.cjs.js +1 -1
- package/src/tedi/components/overlays/tooltip/tooltip.es.js +14 -6
- package/src/tedi/helpers/hooks/use-sidenav-state.d.ts +1 -1
- package/src/tedi/index.d.ts +2 -0
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +132 -6
- package/src/tedi/providers/label-provider/labels-map.es.js +146 -11
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +203 -171
|
@@ -1,627 +1,449 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import * as c from "react";
|
|
2
|
+
import { useModernLayoutEffect as ee, isMouseLikePointerType as Ae, getFloatingFocusElement as Qe, useEffectEvent as ce, getDocument as ge, isTypeableCombobox as mt, useLatestRef as Re, getNodeAncestors as wt, activeElement as we, contains as ae, getNodeChildren as Se, isVirtualClick as Gt, isVirtualPointerEvent as jt, isOutsideEvent as De, getNextTabbable as Ut, getPreviousTabbable as zt, isIndexOutOfListBounds as xt, getMinListIndex as tt, getMaxListIndex as It, getDeepestNode as fn, stopEvent as he, enableFocusInside as Tt, getTarget as xe, isTypeableElement as Qt, matchesFocusVisible as dn, isReactEvent as mn, isRootElement as pn, isEventTargetWithin as nt, getPlatform as gn, getTabbableOptions as pt, isSafari as Zt, createGridCellMap as vn, isListIndexDisabled as rt, getGridNavigatedIndex as bn, getGridCellIndexOfCorner as Rn, getGridCellIndices as hn, findNonDisabledListIndex as qe, disableFocusInside as En, isMac as yn } from "./floating-ui.react.utils.es.js";
|
|
3
|
+
import { jsx as ve, jsxs as gt, Fragment as wn } from "react/jsx-runtime";
|
|
4
|
+
import { isElement as fe, getOverflowAncestors as ot, isHTMLElement as ye, getWindow as xn, isWebKit as In, isLastTraversableNode as st, getParentNode as Tn, getComputedStyle as Jt, getNodeName as en, isNode as Cn, isShadowRoot as tn } from "../../utils/dist/floating-ui.utils.dom.es.js";
|
|
5
|
+
import { tabbable as nn, isTabbable as rn, focusable as Mn } from "../../../tabbable/dist/index.esm.es.js";
|
|
6
|
+
import * as Pn from "react-dom";
|
|
7
|
+
import { useFloating as kn } from "../../react-dom/dist/floating-ui.react-dom.es.js";
|
|
8
|
+
import { arrow as Tr, flip as Cr, offset as Mr, shift as Pr, size as kr } from "../../react-dom/dist/floating-ui.react-dom.es.js";
|
|
9
|
+
function cr(e) {
|
|
10
|
+
const t = c.useRef(void 0), r = c.useCallback((n) => {
|
|
11
|
+
const o = e.map((i) => {
|
|
12
|
+
if (i != null) {
|
|
13
|
+
if (typeof i == "function") {
|
|
14
|
+
const s = i, a = s(n);
|
|
15
|
+
return typeof a == "function" ? a : () => {
|
|
16
|
+
s(null);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return i.current = n, () => {
|
|
20
|
+
i.current = null;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
14
23
|
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (process.env.NODE_ENV !== "production")
|
|
23
|
-
throw new Error("Cannot call an event handler while rendering.");
|
|
24
|
-
});
|
|
25
|
-
return pn(() => {
|
|
26
|
-
e.current = t;
|
|
27
|
-
}), u.useCallback(function() {
|
|
28
|
-
for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
|
|
29
|
-
r[o] = arguments[o];
|
|
30
|
-
return e.current == null ? void 0 : e.current(...r);
|
|
31
|
-
}, []);
|
|
32
|
-
}
|
|
33
|
-
const ft = "ArrowUp", _e = "ArrowDown", ye = "ArrowLeft", xe = "ArrowRight";
|
|
34
|
-
function qe(t, e, n) {
|
|
35
|
-
return Math.floor(t / e) !== n;
|
|
36
|
-
}
|
|
37
|
-
function Se(t, e) {
|
|
38
|
-
return e < 0 || e >= t.current.length;
|
|
39
|
-
}
|
|
40
|
-
function tt(t, e) {
|
|
41
|
-
return se(t, {
|
|
42
|
-
disabledIndices: e
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
function Et(t, e) {
|
|
46
|
-
return se(t, {
|
|
47
|
-
decrement: !0,
|
|
48
|
-
startingIndex: t.current.length,
|
|
49
|
-
disabledIndices: e
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
function se(t, e) {
|
|
53
|
-
let {
|
|
54
|
-
startingIndex: n = -1,
|
|
55
|
-
decrement: r = !1,
|
|
56
|
-
disabledIndices: o,
|
|
57
|
-
amount: s = 1
|
|
58
|
-
} = e === void 0 ? {} : e;
|
|
59
|
-
const i = t.current;
|
|
60
|
-
let c = n;
|
|
61
|
-
do
|
|
62
|
-
c += r ? -s : s;
|
|
63
|
-
while (c >= 0 && c <= i.length - 1 && Ue(i, c, o));
|
|
64
|
-
return c;
|
|
65
|
-
}
|
|
66
|
-
function gn(t, e) {
|
|
67
|
-
let {
|
|
68
|
-
event: n,
|
|
69
|
-
orientation: r,
|
|
70
|
-
loop: o,
|
|
71
|
-
rtl: s,
|
|
72
|
-
cols: i,
|
|
73
|
-
disabledIndices: c,
|
|
74
|
-
minIndex: v,
|
|
75
|
-
maxIndex: f,
|
|
76
|
-
prevIndex: m,
|
|
77
|
-
stopEvent: b = !1
|
|
78
|
-
} = e, p = m;
|
|
79
|
-
if (n.key === ft) {
|
|
80
|
-
if (b && ie(n), m === -1)
|
|
81
|
-
p = f;
|
|
82
|
-
else if (p = se(t, {
|
|
83
|
-
startingIndex: p,
|
|
84
|
-
amount: i,
|
|
85
|
-
decrement: !0,
|
|
86
|
-
disabledIndices: c
|
|
87
|
-
}), o && (m - i < v || p < 0)) {
|
|
88
|
-
const l = m % i, g = f % i, a = f - (g - l);
|
|
89
|
-
g === l ? p = f : p = g > l ? a : a - i;
|
|
90
|
-
}
|
|
91
|
-
Se(t, p) && (p = m);
|
|
92
|
-
}
|
|
93
|
-
if (n.key === _e && (b && ie(n), m === -1 ? p = v : (p = se(t, {
|
|
94
|
-
startingIndex: m,
|
|
95
|
-
amount: i,
|
|
96
|
-
disabledIndices: c
|
|
97
|
-
}), o && m + i > f && (p = se(t, {
|
|
98
|
-
startingIndex: m % i - i,
|
|
99
|
-
amount: i,
|
|
100
|
-
disabledIndices: c
|
|
101
|
-
}))), Se(t, p) && (p = m)), r === "both") {
|
|
102
|
-
const l = bt(m / i);
|
|
103
|
-
n.key === (s ? ye : xe) && (b && ie(n), m % i !== i - 1 ? (p = se(t, {
|
|
104
|
-
startingIndex: m,
|
|
105
|
-
disabledIndices: c
|
|
106
|
-
}), o && qe(p, i, l) && (p = se(t, {
|
|
107
|
-
startingIndex: m - m % i - 1,
|
|
108
|
-
disabledIndices: c
|
|
109
|
-
}))) : o && (p = se(t, {
|
|
110
|
-
startingIndex: m - m % i - 1,
|
|
111
|
-
disabledIndices: c
|
|
112
|
-
})), qe(p, i, l) && (p = m)), n.key === (s ? xe : ye) && (b && ie(n), m % i !== 0 ? (p = se(t, {
|
|
113
|
-
startingIndex: m,
|
|
114
|
-
decrement: !0,
|
|
115
|
-
disabledIndices: c
|
|
116
|
-
}), o && qe(p, i, l) && (p = se(t, {
|
|
117
|
-
startingIndex: m + (i - m % i),
|
|
118
|
-
decrement: !0,
|
|
119
|
-
disabledIndices: c
|
|
120
|
-
}))) : o && (p = se(t, {
|
|
121
|
-
startingIndex: m + (i - m % i),
|
|
122
|
-
decrement: !0,
|
|
123
|
-
disabledIndices: c
|
|
124
|
-
})), qe(p, i, l) && (p = m));
|
|
125
|
-
const g = bt(f / i) === l;
|
|
126
|
-
Se(t, p) && (o && g ? p = n.key === (s ? xe : ye) ? f : se(t, {
|
|
127
|
-
startingIndex: m - m % i - 1,
|
|
128
|
-
disabledIndices: c
|
|
129
|
-
}) : p = m);
|
|
130
|
-
}
|
|
131
|
-
return p;
|
|
132
|
-
}
|
|
133
|
-
function vn(t, e, n) {
|
|
134
|
-
const r = [];
|
|
135
|
-
let o = 0;
|
|
136
|
-
return t.forEach((s, i) => {
|
|
137
|
-
let {
|
|
138
|
-
width: c,
|
|
139
|
-
height: v
|
|
140
|
-
} = s;
|
|
141
|
-
if (c > e && process.env.NODE_ENV !== "production")
|
|
142
|
-
throw new Error("[Floating UI]: Invalid grid - item width at index " + i + " is greater than grid columns");
|
|
143
|
-
let f = !1;
|
|
144
|
-
for (n && (o = 0); !f; ) {
|
|
145
|
-
const m = [];
|
|
146
|
-
for (let b = 0; b < c; b++)
|
|
147
|
-
for (let p = 0; p < v; p++)
|
|
148
|
-
m.push(o + b + p * e);
|
|
149
|
-
o % e + c <= e && m.every((b) => r[b] == null) ? (m.forEach((b) => {
|
|
150
|
-
r[b] = i;
|
|
151
|
-
}), f = !0) : o++;
|
|
152
|
-
}
|
|
153
|
-
}), [...r];
|
|
154
|
-
}
|
|
155
|
-
function bn(t, e, n, r, o) {
|
|
156
|
-
if (t === -1) return -1;
|
|
157
|
-
const s = n.indexOf(t), i = e[t];
|
|
158
|
-
switch (o) {
|
|
159
|
-
case "tl":
|
|
160
|
-
return s;
|
|
161
|
-
case "tr":
|
|
162
|
-
return i ? s + i.width - 1 : s;
|
|
163
|
-
case "bl":
|
|
164
|
-
return i ? s + (i.height - 1) * r : s;
|
|
165
|
-
case "br":
|
|
166
|
-
return n.lastIndexOf(t);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
function hn(t, e) {
|
|
170
|
-
return e.flatMap((n, r) => t.includes(n) ? [r] : []);
|
|
171
|
-
}
|
|
172
|
-
function Ue(t, e, n) {
|
|
173
|
-
if (n)
|
|
174
|
-
return n.includes(e);
|
|
175
|
-
const r = t[e];
|
|
176
|
-
return r == null || r.hasAttribute("disabled") || r.getAttribute("aria-disabled") === "true";
|
|
177
|
-
}
|
|
178
|
-
var G = typeof document < "u" ? en : tn;
|
|
179
|
-
function Pe() {
|
|
180
|
-
return Pe = Object.assign ? Object.assign.bind() : function(t) {
|
|
181
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
182
|
-
var n = arguments[e];
|
|
183
|
-
for (var r in n)
|
|
184
|
-
Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
|
|
185
|
-
}
|
|
186
|
-
return t;
|
|
187
|
-
}, Pe.apply(this, arguments);
|
|
24
|
+
return () => {
|
|
25
|
+
o.forEach((i) => i == null ? void 0 : i());
|
|
26
|
+
};
|
|
27
|
+
}, e);
|
|
28
|
+
return c.useMemo(() => e.every((n) => n == null) ? null : (n) => {
|
|
29
|
+
t.current && (t.current(), t.current = void 0), n != null && (t.current = r(n));
|
|
30
|
+
}, e);
|
|
188
31
|
}
|
|
189
|
-
|
|
190
|
-
|
|
32
|
+
const On = "data-floating-ui-focusable", Ct = "active", Mt = "selected", _e = "ArrowLeft", Ke = "ArrowRight", on = "ArrowUp", Je = "ArrowDown", Ln = {
|
|
33
|
+
...c
|
|
34
|
+
};
|
|
35
|
+
let Pt = !1, Fn = 0;
|
|
36
|
+
const kt = () => (
|
|
191
37
|
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
192
38
|
// on <React 18
|
|
193
|
-
"floating-ui-" + Math.random().toString(36).slice(2, 6) +
|
|
39
|
+
"floating-ui-" + Math.random().toString(36).slice(2, 6) + Fn++
|
|
194
40
|
);
|
|
195
|
-
function
|
|
196
|
-
const [
|
|
197
|
-
return
|
|
198
|
-
|
|
199
|
-
}, []),
|
|
200
|
-
|
|
201
|
-
}, []),
|
|
41
|
+
function Sn() {
|
|
42
|
+
const [e, t] = c.useState(() => Pt ? kt() : void 0);
|
|
43
|
+
return ee(() => {
|
|
44
|
+
e == null && t(kt());
|
|
45
|
+
}, []), c.useEffect(() => {
|
|
46
|
+
Pt = !0;
|
|
47
|
+
}, []), e;
|
|
202
48
|
}
|
|
203
|
-
const
|
|
49
|
+
const Dn = Ln.useId, We = Dn || Sn;
|
|
204
50
|
let Ne;
|
|
205
51
|
process.env.NODE_ENV !== "production" && (Ne = /* @__PURE__ */ new Set());
|
|
206
|
-
function
|
|
207
|
-
for (var
|
|
208
|
-
n
|
|
209
|
-
const o = "Floating UI: " +
|
|
210
|
-
if (!((
|
|
211
|
-
var
|
|
212
|
-
(
|
|
52
|
+
function ze() {
|
|
53
|
+
for (var e, t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
|
54
|
+
r[n] = arguments[n];
|
|
55
|
+
const o = "Floating UI: " + r.join(" ");
|
|
56
|
+
if (!((e = Ne) != null && e.has(o))) {
|
|
57
|
+
var i;
|
|
58
|
+
(i = Ne) == null || i.add(o), console.warn(o);
|
|
213
59
|
}
|
|
214
60
|
}
|
|
215
|
-
function
|
|
216
|
-
for (var
|
|
217
|
-
n
|
|
218
|
-
const o = "Floating UI: " +
|
|
219
|
-
if (!((
|
|
220
|
-
var
|
|
221
|
-
(
|
|
61
|
+
function An() {
|
|
62
|
+
for (var e, t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
|
63
|
+
r[n] = arguments[n];
|
|
64
|
+
const o = "Floating UI: " + r.join(" ");
|
|
65
|
+
if (!((e = Ne) != null && e.has(o))) {
|
|
66
|
+
var i;
|
|
67
|
+
(i = Ne) == null || i.add(o), console.error(o);
|
|
222
68
|
}
|
|
223
69
|
}
|
|
224
|
-
const
|
|
70
|
+
const lr = /* @__PURE__ */ c.forwardRef(function(t, r) {
|
|
225
71
|
const {
|
|
226
72
|
context: {
|
|
227
|
-
placement:
|
|
73
|
+
placement: n,
|
|
228
74
|
elements: {
|
|
229
75
|
floating: o
|
|
230
76
|
},
|
|
231
77
|
middlewareData: {
|
|
232
|
-
arrow:
|
|
233
|
-
shift:
|
|
78
|
+
arrow: i,
|
|
79
|
+
shift: s
|
|
234
80
|
}
|
|
235
81
|
},
|
|
236
|
-
width:
|
|
237
|
-
height:
|
|
238
|
-
tipRadius:
|
|
239
|
-
strokeWidth:
|
|
240
|
-
staticOffset:
|
|
241
|
-
stroke:
|
|
242
|
-
d:
|
|
82
|
+
width: a = 14,
|
|
83
|
+
height: g = 7,
|
|
84
|
+
tipRadius: m = 0,
|
|
85
|
+
strokeWidth: R = 0,
|
|
86
|
+
staticOffset: x,
|
|
87
|
+
stroke: E,
|
|
88
|
+
d: f,
|
|
243
89
|
style: {
|
|
244
|
-
transform:
|
|
245
|
-
...
|
|
90
|
+
transform: v,
|
|
91
|
+
...l
|
|
246
92
|
} = {},
|
|
247
|
-
...
|
|
248
|
-
} =
|
|
249
|
-
process.env.NODE_ENV !== "production" && (
|
|
250
|
-
const
|
|
251
|
-
if (
|
|
93
|
+
...w
|
|
94
|
+
} = t;
|
|
95
|
+
process.env.NODE_ENV !== "production" && (r || ze("The `ref` prop is required for `FloatingArrow`."));
|
|
96
|
+
const k = We(), [b, h] = c.useState(!1);
|
|
97
|
+
if (ee(() => {
|
|
252
98
|
if (!o) return;
|
|
253
|
-
|
|
99
|
+
Jt(o).direction === "rtl" && h(!0);
|
|
254
100
|
}, [o]), !o)
|
|
255
101
|
return null;
|
|
256
|
-
const [
|
|
257
|
-
let
|
|
258
|
-
(
|
|
259
|
-
const
|
|
260
|
-
let
|
|
261
|
-
|
|
262
|
-
const
|
|
263
|
-
top:
|
|
264
|
-
left:
|
|
265
|
-
bottom:
|
|
266
|
-
right:
|
|
267
|
-
}[
|
|
268
|
-
return /* @__PURE__ */
|
|
102
|
+
const [T, $] = n.split("-"), H = T === "top" || T === "bottom";
|
|
103
|
+
let B = x;
|
|
104
|
+
(H && s != null && s.x || !H && s != null && s.y) && (B = null);
|
|
105
|
+
const _ = R * 2, oe = _ / 2, j = a / 2 * (m / -8 + 1), q = g / 2 * m / 4, X = !!f, F = B && $ === "end" ? "bottom" : "top";
|
|
106
|
+
let u = B && $ === "end" ? "right" : "left";
|
|
107
|
+
B && b && (u = $ === "end" ? "left" : "right");
|
|
108
|
+
const p = (i == null ? void 0 : i.x) != null ? B || i.x : "", K = (i == null ? void 0 : i.y) != null ? B || i.y : "", y = f || "M0,0" + (" H" + a) + (" L" + (a - j) + "," + (g - q)) + (" Q" + a / 2 + "," + g + " " + j + "," + (g - q)) + " Z", d = {
|
|
109
|
+
top: X ? "rotate(180deg)" : "",
|
|
110
|
+
left: X ? "rotate(90deg)" : "rotate(-90deg)",
|
|
111
|
+
bottom: X ? "" : "rotate(180deg)",
|
|
112
|
+
right: X ? "rotate(-90deg)" : "rotate(90deg)"
|
|
113
|
+
}[T];
|
|
114
|
+
return /* @__PURE__ */ gt("svg", {
|
|
115
|
+
...w,
|
|
269
116
|
"aria-hidden": !0,
|
|
270
|
-
ref:
|
|
271
|
-
width:
|
|
272
|
-
height:
|
|
273
|
-
viewBox: "0 0 " +
|
|
117
|
+
ref: r,
|
|
118
|
+
width: X ? a : a + _,
|
|
119
|
+
height: a,
|
|
120
|
+
viewBox: "0 0 " + a + " " + (g > a ? g : a),
|
|
274
121
|
style: {
|
|
275
122
|
position: "absolute",
|
|
276
123
|
pointerEvents: "none",
|
|
277
|
-
[
|
|
278
|
-
[
|
|
279
|
-
[
|
|
280
|
-
transform: [
|
|
281
|
-
...
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
124
|
+
[u]: p,
|
|
125
|
+
[F]: K,
|
|
126
|
+
[T]: H || X ? "100%" : "calc(100% - " + _ / 2 + "px)",
|
|
127
|
+
transform: [d, v].filter((I) => !!I).join(" "),
|
|
128
|
+
...l
|
|
129
|
+
},
|
|
130
|
+
children: [_ > 0 && /* @__PURE__ */ ve("path", {
|
|
131
|
+
clipPath: "url(#" + k + ")",
|
|
132
|
+
fill: "none",
|
|
133
|
+
stroke: E,
|
|
134
|
+
strokeWidth: _ + (f ? 0 : 1),
|
|
135
|
+
d: y
|
|
136
|
+
}), /* @__PURE__ */ ve("path", {
|
|
137
|
+
stroke: _ && !f ? w.fill : "none",
|
|
138
|
+
d: y
|
|
139
|
+
}), /* @__PURE__ */ ve("clipPath", {
|
|
140
|
+
id: k,
|
|
141
|
+
children: /* @__PURE__ */ ve("rect", {
|
|
142
|
+
x: -oe,
|
|
143
|
+
y: oe * (X ? -1 : 1),
|
|
144
|
+
width: a + _,
|
|
145
|
+
height: a
|
|
146
|
+
})
|
|
147
|
+
})]
|
|
148
|
+
});
|
|
300
149
|
});
|
|
301
|
-
function
|
|
302
|
-
const
|
|
150
|
+
function Nn() {
|
|
151
|
+
const e = /* @__PURE__ */ new Map();
|
|
303
152
|
return {
|
|
304
|
-
emit(
|
|
305
|
-
var
|
|
306
|
-
(
|
|
153
|
+
emit(t, r) {
|
|
154
|
+
var n;
|
|
155
|
+
(n = e.get(t)) == null || n.forEach((o) => o(r));
|
|
307
156
|
},
|
|
308
|
-
on(
|
|
309
|
-
t.set(
|
|
157
|
+
on(t, r) {
|
|
158
|
+
e.has(t) || e.set(t, /* @__PURE__ */ new Set()), e.get(t).add(r);
|
|
310
159
|
},
|
|
311
|
-
off(
|
|
312
|
-
var
|
|
313
|
-
|
|
160
|
+
off(t, r) {
|
|
161
|
+
var n;
|
|
162
|
+
(n = e.get(t)) == null || n.delete(r);
|
|
314
163
|
}
|
|
315
164
|
};
|
|
316
165
|
}
|
|
317
|
-
const
|
|
318
|
-
var
|
|
319
|
-
return ((
|
|
320
|
-
},
|
|
321
|
-
function
|
|
322
|
-
const
|
|
323
|
-
return
|
|
324
|
-
|
|
325
|
-
|
|
166
|
+
const _n = /* @__PURE__ */ c.createContext(null), Kn = /* @__PURE__ */ c.createContext(null), Ve = () => {
|
|
167
|
+
var e;
|
|
168
|
+
return ((e = c.useContext(_n)) == null ? void 0 : e.id) || null;
|
|
169
|
+
}, Oe = () => c.useContext(Kn);
|
|
170
|
+
function ar(e) {
|
|
171
|
+
const t = We(), r = Oe(), o = Ve();
|
|
172
|
+
return ee(() => {
|
|
173
|
+
if (!t) return;
|
|
174
|
+
const i = {
|
|
175
|
+
id: t,
|
|
326
176
|
parentId: o
|
|
327
177
|
};
|
|
328
|
-
return
|
|
329
|
-
|
|
178
|
+
return r == null || r.addNode(i), () => {
|
|
179
|
+
r == null || r.removeNode(i);
|
|
330
180
|
};
|
|
331
|
-
}, [
|
|
181
|
+
}, [r, t, o]), t;
|
|
182
|
+
}
|
|
183
|
+
function Pe(e) {
|
|
184
|
+
return "data-floating-ui-" + e;
|
|
332
185
|
}
|
|
333
|
-
function
|
|
334
|
-
|
|
186
|
+
function me(e) {
|
|
187
|
+
e.current !== -1 && (clearTimeout(e.current), e.current = -1);
|
|
335
188
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
189
|
+
const Ot = /* @__PURE__ */ Pe("safe-polygon");
|
|
190
|
+
function it(e, t, r) {
|
|
191
|
+
if (r && !Ae(r))
|
|
192
|
+
return 0;
|
|
193
|
+
if (typeof e == "number")
|
|
194
|
+
return e;
|
|
195
|
+
if (typeof e == "function") {
|
|
196
|
+
const n = e();
|
|
197
|
+
return typeof n == "number" ? n : n == null ? void 0 : n[t];
|
|
198
|
+
}
|
|
199
|
+
return e == null ? void 0 : e[t];
|
|
341
200
|
}
|
|
342
|
-
|
|
343
|
-
function
|
|
344
|
-
return n && !Ae(n) ? 0 : typeof t == "number" ? t : t == null ? void 0 : t[e];
|
|
201
|
+
function ut(e) {
|
|
202
|
+
return typeof e == "function" ? e() : e;
|
|
345
203
|
}
|
|
346
|
-
function
|
|
347
|
-
|
|
204
|
+
function fr(e, t) {
|
|
205
|
+
t === void 0 && (t = {});
|
|
348
206
|
const {
|
|
349
|
-
open:
|
|
350
|
-
onOpenChange:
|
|
207
|
+
open: r,
|
|
208
|
+
onOpenChange: n,
|
|
351
209
|
dataRef: o,
|
|
352
|
-
events:
|
|
353
|
-
elements:
|
|
354
|
-
} =
|
|
355
|
-
enabled:
|
|
356
|
-
delay:
|
|
357
|
-
handleClose:
|
|
358
|
-
mouseOnly:
|
|
359
|
-
restMs:
|
|
360
|
-
move:
|
|
361
|
-
} =
|
|
362
|
-
}),
|
|
363
|
-
var
|
|
364
|
-
const
|
|
365
|
-
return (
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
if (!
|
|
369
|
-
function
|
|
210
|
+
events: i,
|
|
211
|
+
elements: s
|
|
212
|
+
} = e, {
|
|
213
|
+
enabled: a = !0,
|
|
214
|
+
delay: g = 0,
|
|
215
|
+
handleClose: m = null,
|
|
216
|
+
mouseOnly: R = !1,
|
|
217
|
+
restMs: x = 0,
|
|
218
|
+
move: E = !0
|
|
219
|
+
} = t, f = Oe(), v = Ve(), l = Re(m), w = Re(g), k = Re(r), b = Re(x), h = c.useRef(), T = c.useRef(-1), $ = c.useRef(), H = c.useRef(-1), B = c.useRef(!0), _ = c.useRef(!1), oe = c.useRef(() => {
|
|
220
|
+
}), j = c.useRef(!1), q = ce(() => {
|
|
221
|
+
var y;
|
|
222
|
+
const d = (y = o.current.openEvent) == null ? void 0 : y.type;
|
|
223
|
+
return (d == null ? void 0 : d.includes("mouse")) && d !== "mousedown";
|
|
224
|
+
});
|
|
225
|
+
c.useEffect(() => {
|
|
226
|
+
if (!a) return;
|
|
227
|
+
function y(d) {
|
|
370
228
|
let {
|
|
371
|
-
open:
|
|
372
|
-
} =
|
|
373
|
-
|
|
229
|
+
open: I
|
|
230
|
+
} = d;
|
|
231
|
+
I || (me(T), me(H), B.current = !0, j.current = !1);
|
|
374
232
|
}
|
|
375
|
-
return
|
|
376
|
-
|
|
233
|
+
return i.on("openchange", y), () => {
|
|
234
|
+
i.off("openchange", y);
|
|
377
235
|
};
|
|
378
|
-
}, [
|
|
379
|
-
if (!
|
|
380
|
-
function
|
|
381
|
-
|
|
236
|
+
}, [a, i]), c.useEffect(() => {
|
|
237
|
+
if (!a || !l.current || !r) return;
|
|
238
|
+
function y(I) {
|
|
239
|
+
q() && n(!1, I, "hover");
|
|
382
240
|
}
|
|
383
|
-
const
|
|
384
|
-
return
|
|
385
|
-
|
|
241
|
+
const d = ge(s.floating).documentElement;
|
|
242
|
+
return d.addEventListener("mouseleave", y), () => {
|
|
243
|
+
d.removeEventListener("mouseleave", y);
|
|
386
244
|
};
|
|
387
|
-
}, [
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
const
|
|
391
|
-
|
|
392
|
-
}, [
|
|
393
|
-
|
|
394
|
-
}),
|
|
395
|
-
if (
|
|
396
|
-
const
|
|
397
|
-
|
|
245
|
+
}, [s.floating, r, n, a, l, q]);
|
|
246
|
+
const X = c.useCallback(function(y, d, I) {
|
|
247
|
+
d === void 0 && (d = !0), I === void 0 && (I = "hover");
|
|
248
|
+
const O = it(w.current, "close", h.current);
|
|
249
|
+
O && !$.current ? (me(T), T.current = window.setTimeout(() => n(!1, y, I), O)) : d && (me(T), n(!1, y, I));
|
|
250
|
+
}, [w, n]), F = ce(() => {
|
|
251
|
+
oe.current(), $.current = void 0;
|
|
252
|
+
}), u = ce(() => {
|
|
253
|
+
if (_.current) {
|
|
254
|
+
const y = ge(s.floating).body;
|
|
255
|
+
y.style.pointerEvents = "", y.removeAttribute(Ot), _.current = !1;
|
|
398
256
|
}
|
|
399
|
-
}),
|
|
400
|
-
|
|
401
|
-
if (!
|
|
402
|
-
function
|
|
403
|
-
if (
|
|
257
|
+
}), p = ce(() => o.current.openEvent ? ["click", "mousedown"].includes(o.current.openEvent.type) : !1);
|
|
258
|
+
c.useEffect(() => {
|
|
259
|
+
if (!a) return;
|
|
260
|
+
function y(S) {
|
|
261
|
+
if (me(T), B.current = !1, R && !Ae(h.current) || ut(b.current) > 0 && !it(w.current, "open"))
|
|
404
262
|
return;
|
|
405
|
-
const
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
},
|
|
263
|
+
const M = it(w.current, "open", h.current);
|
|
264
|
+
M ? T.current = window.setTimeout(() => {
|
|
265
|
+
k.current || n(!0, S, "hover");
|
|
266
|
+
}, M) : r || n(!0, S, "hover");
|
|
409
267
|
}
|
|
410
|
-
function
|
|
411
|
-
if (
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
268
|
+
function d(S) {
|
|
269
|
+
if (p()) {
|
|
270
|
+
u();
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
oe.current();
|
|
274
|
+
const M = ge(s.floating);
|
|
275
|
+
if (me(H), j.current = !1, l.current && o.current.floatingContext) {
|
|
276
|
+
r || me(T), $.current = l.current({
|
|
416
277
|
...o.current.floatingContext,
|
|
417
|
-
tree:
|
|
418
|
-
x:
|
|
419
|
-
y:
|
|
278
|
+
tree: f,
|
|
279
|
+
x: S.clientX,
|
|
280
|
+
y: S.clientY,
|
|
420
281
|
onClose() {
|
|
421
|
-
|
|
282
|
+
u(), F(), p() || X(S, !0, "safe-polygon");
|
|
422
283
|
}
|
|
423
284
|
});
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
-
|
|
285
|
+
const N = $.current;
|
|
286
|
+
M.addEventListener("mousemove", N), oe.current = () => {
|
|
287
|
+
M.removeEventListener("mousemove", N);
|
|
427
288
|
};
|
|
428
289
|
return;
|
|
429
290
|
}
|
|
430
|
-
(
|
|
291
|
+
(h.current === "touch" ? !ae(s.floating, S.relatedTarget) : !0) && X(S);
|
|
431
292
|
}
|
|
432
|
-
function
|
|
433
|
-
|
|
293
|
+
function I(S) {
|
|
294
|
+
p() || o.current.floatingContext && (l.current == null || l.current({
|
|
434
295
|
...o.current.floatingContext,
|
|
435
|
-
tree:
|
|
436
|
-
x:
|
|
437
|
-
y:
|
|
296
|
+
tree: f,
|
|
297
|
+
x: S.clientX,
|
|
298
|
+
y: S.clientY,
|
|
438
299
|
onClose() {
|
|
439
|
-
|
|
300
|
+
u(), F(), p() || X(S);
|
|
440
301
|
}
|
|
441
|
-
})(
|
|
302
|
+
})(S));
|
|
303
|
+
}
|
|
304
|
+
function O() {
|
|
305
|
+
me(T);
|
|
306
|
+
}
|
|
307
|
+
function G(S) {
|
|
308
|
+
p() || X(S, !1);
|
|
442
309
|
}
|
|
443
|
-
if (
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
return n && O.addEventListener("mouseleave", d), (C = i.floating) == null || C.addEventListener("mouseleave", d), p && O.addEventListener("mousemove", x, {
|
|
310
|
+
if (fe(s.domReference)) {
|
|
311
|
+
const S = s.domReference, M = s.floating;
|
|
312
|
+
return r && S.addEventListener("mouseleave", I), E && S.addEventListener("mousemove", y, {
|
|
447
313
|
once: !0
|
|
448
|
-
}),
|
|
449
|
-
|
|
450
|
-
n && O.removeEventListener("mouseleave", d), (H = i.floating) == null || H.removeEventListener("mouseleave", d), p && O.removeEventListener("mousemove", x), O.removeEventListener("mouseenter", x), O.removeEventListener("mouseleave", T);
|
|
314
|
+
}), S.addEventListener("mouseenter", y), S.addEventListener("mouseleave", d), M && (M.addEventListener("mouseleave", I), M.addEventListener("mouseenter", O), M.addEventListener("mouseleave", G)), () => {
|
|
315
|
+
r && S.removeEventListener("mouseleave", I), E && S.removeEventListener("mousemove", y), S.removeEventListener("mouseenter", y), S.removeEventListener("mouseleave", d), M && (M.removeEventListener("mouseleave", I), M.removeEventListener("mouseenter", O), M.removeEventListener("mouseleave", G));
|
|
451
316
|
};
|
|
452
317
|
}
|
|
453
|
-
}, [
|
|
454
|
-
var
|
|
455
|
-
if (
|
|
456
|
-
|
|
457
|
-
const
|
|
458
|
-
if (
|
|
459
|
-
var
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
const
|
|
463
|
-
return
|
|
464
|
-
|
|
318
|
+
}, [s, a, e, R, E, X, F, u, n, r, k, f, w, l, o, p, b]), ee(() => {
|
|
319
|
+
var y;
|
|
320
|
+
if (a && r && (y = l.current) != null && (y = y.__options) != null && y.blockPointerEvents && q()) {
|
|
321
|
+
_.current = !0;
|
|
322
|
+
const I = s.floating;
|
|
323
|
+
if (fe(s.domReference) && I) {
|
|
324
|
+
var d;
|
|
325
|
+
const O = ge(s.floating).body;
|
|
326
|
+
O.setAttribute(Ot, "");
|
|
327
|
+
const G = s.domReference, S = f == null || (d = f.nodesRef.current.find((M) => M.id === v)) == null || (d = d.context) == null ? void 0 : d.elements.floating;
|
|
328
|
+
return S && (S.style.pointerEvents = ""), O.style.pointerEvents = "none", G.style.pointerEvents = "auto", I.style.pointerEvents = "auto", () => {
|
|
329
|
+
O.style.pointerEvents = "", G.style.pointerEvents = "", I.style.pointerEvents = "";
|
|
465
330
|
};
|
|
466
331
|
}
|
|
467
332
|
}
|
|
468
|
-
}, [
|
|
469
|
-
|
|
470
|
-
}, [
|
|
471
|
-
|
|
472
|
-
}, [
|
|
473
|
-
const
|
|
474
|
-
function
|
|
475
|
-
|
|
333
|
+
}, [a, r, v, s, f, l, q]), ee(() => {
|
|
334
|
+
r || (h.current = void 0, j.current = !1, F(), u());
|
|
335
|
+
}, [r, F, u]), c.useEffect(() => () => {
|
|
336
|
+
F(), me(T), me(H), u();
|
|
337
|
+
}, [a, s.domReference, F, u]);
|
|
338
|
+
const K = c.useMemo(() => {
|
|
339
|
+
function y(d) {
|
|
340
|
+
h.current = d.pointerType;
|
|
476
341
|
}
|
|
477
342
|
return {
|
|
478
|
-
onPointerDown:
|
|
479
|
-
onPointerEnter:
|
|
480
|
-
onMouseMove(
|
|
343
|
+
onPointerDown: y,
|
|
344
|
+
onPointerEnter: y,
|
|
345
|
+
onMouseMove(d) {
|
|
481
346
|
const {
|
|
482
|
-
nativeEvent:
|
|
483
|
-
} =
|
|
484
|
-
function
|
|
485
|
-
!
|
|
347
|
+
nativeEvent: I
|
|
348
|
+
} = d;
|
|
349
|
+
function O() {
|
|
350
|
+
!B.current && !k.current && n(!0, I, "hover");
|
|
486
351
|
}
|
|
487
|
-
|
|
352
|
+
R && !Ae(h.current) || r || ut(b.current) === 0 || j.current && d.movementX ** 2 + d.movementY ** 2 < 2 || (me(H), h.current === "touch" ? O() : (j.current = !0, H.current = window.setTimeout(O, ut(b.current))));
|
|
488
353
|
}
|
|
489
354
|
};
|
|
490
|
-
}, [
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
onMouseLeave(x) {
|
|
495
|
-
E() || B(x.nativeEvent, !1);
|
|
496
|
-
}
|
|
497
|
-
}), [B, E]);
|
|
498
|
-
return u.useMemo(() => c ? {
|
|
499
|
-
reference: w,
|
|
500
|
-
floating: y
|
|
501
|
-
} : {}, [c, w, y]);
|
|
355
|
+
}, [R, n, r, k, b]);
|
|
356
|
+
return c.useMemo(() => a ? {
|
|
357
|
+
reference: K
|
|
358
|
+
} : {}, [a, K]);
|
|
502
359
|
}
|
|
503
|
-
let
|
|
504
|
-
function
|
|
505
|
-
|
|
360
|
+
let Lt = 0;
|
|
361
|
+
function Me(e, t) {
|
|
362
|
+
t === void 0 && (t = {});
|
|
506
363
|
const {
|
|
507
|
-
preventScroll:
|
|
508
|
-
cancelPrevious:
|
|
364
|
+
preventScroll: r = !1,
|
|
365
|
+
cancelPrevious: n = !0,
|
|
509
366
|
sync: o = !1
|
|
510
|
-
} =
|
|
511
|
-
|
|
512
|
-
const
|
|
513
|
-
preventScroll:
|
|
367
|
+
} = t;
|
|
368
|
+
n && cancelAnimationFrame(Lt);
|
|
369
|
+
const i = () => e == null ? void 0 : e.focus({
|
|
370
|
+
preventScroll: r
|
|
514
371
|
});
|
|
515
|
-
o ?
|
|
372
|
+
o ? i() : Lt = requestAnimationFrame(i);
|
|
516
373
|
}
|
|
517
|
-
function
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
374
|
+
function ct(e, t) {
|
|
375
|
+
if (!e || !t)
|
|
376
|
+
return !1;
|
|
377
|
+
const r = t.getRootNode == null ? void 0 : t.getRootNode();
|
|
378
|
+
if (e.contains(t))
|
|
379
|
+
return !0;
|
|
380
|
+
if (r && tn(r)) {
|
|
381
|
+
let n = t;
|
|
382
|
+
for (; n; ) {
|
|
383
|
+
if (e === n)
|
|
384
|
+
return !0;
|
|
385
|
+
n = n.parentNode || n.host;
|
|
386
|
+
}
|
|
523
387
|
}
|
|
524
|
-
return
|
|
388
|
+
return !1;
|
|
525
389
|
}
|
|
526
|
-
function
|
|
527
|
-
|
|
528
|
-
var s;
|
|
529
|
-
return o.parentId === e && ((s = o.context) == null ? void 0 : s.open);
|
|
530
|
-
}), r = n;
|
|
531
|
-
for (; r.length; )
|
|
532
|
-
r = t.filter((o) => {
|
|
533
|
-
var s;
|
|
534
|
-
return (s = r) == null ? void 0 : s.some((i) => {
|
|
535
|
-
var c;
|
|
536
|
-
return o.parentId === i.id && ((c = o.context) == null ? void 0 : c.open);
|
|
537
|
-
});
|
|
538
|
-
}), n = n.concat(r);
|
|
539
|
-
return n;
|
|
390
|
+
function Wn(e) {
|
|
391
|
+
return "composedPath" in e ? e.composedPath()[0] : e.target;
|
|
540
392
|
}
|
|
541
|
-
function
|
|
542
|
-
|
|
543
|
-
function o(s, i) {
|
|
544
|
-
i > r && (n = s, r = i), Ce(t, s).forEach((v) => {
|
|
545
|
-
o(v.id, i + 1);
|
|
546
|
-
});
|
|
547
|
-
}
|
|
548
|
-
return o(e, 0), t.find((s) => s.id === n);
|
|
393
|
+
function Vn(e) {
|
|
394
|
+
return (e == null ? void 0 : e.ownerDocument) || document;
|
|
549
395
|
}
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
396
|
+
const ke = {
|
|
397
|
+
inert: /* @__PURE__ */ new WeakMap(),
|
|
398
|
+
"aria-hidden": /* @__PURE__ */ new WeakMap(),
|
|
399
|
+
none: /* @__PURE__ */ new WeakMap()
|
|
400
|
+
};
|
|
401
|
+
function Ft(e) {
|
|
402
|
+
return e === "inert" ? ke.inert : e === "aria-hidden" ? ke["aria-hidden"] : ke.none;
|
|
403
|
+
}
|
|
404
|
+
let Xe = /* @__PURE__ */ new WeakSet(), Ge = {}, lt = 0;
|
|
405
|
+
const Hn = () => typeof HTMLElement < "u" && "inert" in HTMLElement.prototype;
|
|
406
|
+
function sn(e) {
|
|
407
|
+
return e ? tn(e) ? e.host : sn(e.parentNode) : null;
|
|
408
|
+
}
|
|
409
|
+
const Bn = (e, t) => t.map((r) => {
|
|
410
|
+
if (e.contains(r))
|
|
411
|
+
return r;
|
|
412
|
+
const n = sn(r);
|
|
413
|
+
return e.contains(n) ? n : null;
|
|
414
|
+
}).filter((r) => r != null);
|
|
415
|
+
function $n(e, t, r, n) {
|
|
416
|
+
const o = "data-floating-ui-inert", i = n ? "inert" : r ? "aria-hidden" : null, s = Bn(t, e), a = /* @__PURE__ */ new Set(), g = new Set(s), m = [];
|
|
417
|
+
Ge[o] || (Ge[o] = /* @__PURE__ */ new WeakMap());
|
|
418
|
+
const R = Ge[o];
|
|
419
|
+
s.forEach(x), E(t), a.clear();
|
|
420
|
+
function x(f) {
|
|
421
|
+
!f || a.has(f) || (a.add(f), f.parentNode && x(f.parentNode));
|
|
564
422
|
}
|
|
565
|
-
function
|
|
566
|
-
!
|
|
567
|
-
if (
|
|
568
|
-
if (
|
|
569
|
-
|
|
423
|
+
function E(f) {
|
|
424
|
+
!f || g.has(f) || [].forEach.call(f.children, (v) => {
|
|
425
|
+
if (en(v) !== "script")
|
|
426
|
+
if (a.has(v))
|
|
427
|
+
E(v);
|
|
570
428
|
else {
|
|
571
|
-
const
|
|
572
|
-
|
|
429
|
+
const l = i ? v.getAttribute(i) : null, w = l !== null && l !== "false", k = Ft(i), b = (k.get(v) || 0) + 1, h = (R.get(v) || 0) + 1;
|
|
430
|
+
k.set(v, b), R.set(v, h), m.push(v), b === 1 && w && Xe.add(v), h === 1 && v.setAttribute(o, ""), !w && i && v.setAttribute(i, i === "inert" ? "" : "true");
|
|
573
431
|
}
|
|
574
432
|
});
|
|
575
433
|
}
|
|
576
|
-
return
|
|
577
|
-
|
|
578
|
-
const
|
|
579
|
-
|
|
580
|
-
}),
|
|
434
|
+
return lt++, () => {
|
|
435
|
+
m.forEach((f) => {
|
|
436
|
+
const v = Ft(i), w = (v.get(f) || 0) - 1, k = (R.get(f) || 0) - 1;
|
|
437
|
+
v.set(f, w), R.set(f, k), w || (!Xe.has(f) && i && f.removeAttribute(i), Xe.delete(f)), k || f.removeAttribute(o);
|
|
438
|
+
}), lt--, lt || (ke.inert = /* @__PURE__ */ new WeakMap(), ke["aria-hidden"] = /* @__PURE__ */ new WeakMap(), ke.none = /* @__PURE__ */ new WeakMap(), Xe = /* @__PURE__ */ new WeakSet(), Ge = {});
|
|
581
439
|
};
|
|
582
440
|
}
|
|
583
|
-
function
|
|
584
|
-
|
|
585
|
-
const
|
|
586
|
-
return
|
|
587
|
-
}
|
|
588
|
-
const Ke = () => ({
|
|
589
|
-
getShadowRoot: !0,
|
|
590
|
-
displayCheck: (
|
|
591
|
-
// JSDOM does not support the `tabbable` library. To solve this we can
|
|
592
|
-
// check if `ResizeObserver` is a real function (not polyfilled), which
|
|
593
|
-
// determines if the current environment is JSDOM-like.
|
|
594
|
-
typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
|
|
595
|
-
)
|
|
596
|
-
});
|
|
597
|
-
function Ut(t, e) {
|
|
598
|
-
const n = Ge(t, Ke());
|
|
599
|
-
e === "prev" && n.reverse();
|
|
600
|
-
const r = n.indexOf(ae(re(t)));
|
|
601
|
-
return n.slice(r + 1)[0];
|
|
602
|
-
}
|
|
603
|
-
function $t() {
|
|
604
|
-
return Ut(document.body, "next");
|
|
605
|
-
}
|
|
606
|
-
function zt() {
|
|
607
|
-
return Ut(document.body, "prev");
|
|
608
|
-
}
|
|
609
|
-
function De(t, e) {
|
|
610
|
-
const n = e || t.currentTarget, r = t.relatedTarget;
|
|
611
|
-
return !r || !ee(n, r);
|
|
612
|
-
}
|
|
613
|
-
function Fn(t) {
|
|
614
|
-
Ge(t, Ke()).forEach((n) => {
|
|
615
|
-
n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
function Tt(t) {
|
|
619
|
-
t.querySelectorAll("[data-tabindex]").forEach((n) => {
|
|
620
|
-
const r = n.dataset.tabindex;
|
|
621
|
-
delete n.dataset.tabindex, r ? n.setAttribute("tabindex", r) : n.removeAttribute("tabindex");
|
|
622
|
-
});
|
|
441
|
+
function St(e, t, r) {
|
|
442
|
+
t === void 0 && (t = !1), r === void 0 && (r = !1);
|
|
443
|
+
const n = Vn(e[0]).body;
|
|
444
|
+
return $n(e.concat(Array.from(n.querySelectorAll('[aria-live],[role="status"],output'))), n, t, r);
|
|
623
445
|
}
|
|
624
|
-
const
|
|
446
|
+
const vt = {
|
|
625
447
|
border: 0,
|
|
626
448
|
clip: "rect(0 0 0 0)",
|
|
627
449
|
height: "1px",
|
|
@@ -633,399 +455,440 @@ const Qe = {
|
|
|
633
455
|
width: "1px",
|
|
634
456
|
top: 0,
|
|
635
457
|
left: 0
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
}
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
G(() => (at() && o("button"), document.addEventListener("keydown", Ct), () => {
|
|
644
|
-
document.removeEventListener("keydown", Ct);
|
|
645
|
-
}), []);
|
|
646
|
-
const s = {
|
|
647
|
-
ref: n,
|
|
458
|
+
}, Ze = /* @__PURE__ */ c.forwardRef(function(t, r) {
|
|
459
|
+
const [n, o] = c.useState();
|
|
460
|
+
ee(() => {
|
|
461
|
+
Zt() && o("button");
|
|
462
|
+
}, []);
|
|
463
|
+
const i = {
|
|
464
|
+
ref: r,
|
|
648
465
|
tabIndex: 0,
|
|
649
466
|
// Role is only for VoiceOver
|
|
650
|
-
role:
|
|
651
|
-
"aria-hidden":
|
|
652
|
-
[
|
|
653
|
-
style:
|
|
467
|
+
role: n,
|
|
468
|
+
"aria-hidden": n ? void 0 : !0,
|
|
469
|
+
[Pe("focus-guard")]: "",
|
|
470
|
+
style: vt
|
|
654
471
|
};
|
|
655
|
-
return /* @__PURE__ */
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
472
|
+
return /* @__PURE__ */ ve("span", {
|
|
473
|
+
...t,
|
|
474
|
+
...i
|
|
475
|
+
});
|
|
476
|
+
}), Yn = {
|
|
477
|
+
clipPath: "inset(50%)",
|
|
478
|
+
position: "fixed",
|
|
479
|
+
top: 0,
|
|
480
|
+
left: 0
|
|
481
|
+
}, un = /* @__PURE__ */ c.createContext(null), Dt = /* @__PURE__ */ Pe("portal");
|
|
482
|
+
function qn(e) {
|
|
483
|
+
e === void 0 && (e = {});
|
|
659
484
|
const {
|
|
660
|
-
id:
|
|
661
|
-
root:
|
|
662
|
-
} =
|
|
663
|
-
return
|
|
664
|
-
|
|
665
|
-
|
|
485
|
+
id: t,
|
|
486
|
+
root: r
|
|
487
|
+
} = e, n = We(), o = cn(), [i, s] = c.useState(null), a = c.useRef(null);
|
|
488
|
+
return ee(() => () => {
|
|
489
|
+
i == null || i.remove(), queueMicrotask(() => {
|
|
490
|
+
a.current = null;
|
|
666
491
|
});
|
|
667
|
-
}, [
|
|
668
|
-
if (!
|
|
669
|
-
const
|
|
670
|
-
if (!
|
|
671
|
-
const f = document.createElement("div");
|
|
672
|
-
f.id = r, f.setAttribute(Ot, ""), v.appendChild(f), c.current = f, i(f);
|
|
673
|
-
}, [e, r]), G(() => {
|
|
674
|
-
if (n === null || !r || c.current) return;
|
|
675
|
-
let v = n || (o == null ? void 0 : o.portalNode);
|
|
676
|
-
v && !oe(v) && (v = v.current), v = v || document.body;
|
|
677
|
-
let f = null;
|
|
678
|
-
e && (f = document.createElement("div"), f.id = e, v.appendChild(f));
|
|
492
|
+
}, [i]), ee(() => {
|
|
493
|
+
if (!n || a.current) return;
|
|
494
|
+
const g = t ? document.getElementById(t) : null;
|
|
495
|
+
if (!g) return;
|
|
679
496
|
const m = document.createElement("div");
|
|
680
|
-
m.id =
|
|
681
|
-
}, [
|
|
497
|
+
m.id = n, m.setAttribute(Dt, ""), g.appendChild(m), a.current = m, s(m);
|
|
498
|
+
}, [t, n]), ee(() => {
|
|
499
|
+
if (r === null || !n || a.current) return;
|
|
500
|
+
let g = r || (o == null ? void 0 : o.portalNode);
|
|
501
|
+
g && !Cn(g) && (g = g.current), g = g || document.body;
|
|
502
|
+
let m = null;
|
|
503
|
+
t && (m = document.createElement("div"), m.id = t, g.appendChild(m));
|
|
504
|
+
const R = document.createElement("div");
|
|
505
|
+
R.id = n, R.setAttribute(Dt, ""), g = m || g, g.appendChild(R), a.current = R, s(R);
|
|
506
|
+
}, [t, r, n, o]), i;
|
|
682
507
|
}
|
|
683
|
-
function
|
|
508
|
+
function dr(e) {
|
|
684
509
|
const {
|
|
685
|
-
children:
|
|
686
|
-
id:
|
|
687
|
-
root:
|
|
510
|
+
children: t,
|
|
511
|
+
id: r,
|
|
512
|
+
root: n,
|
|
688
513
|
preserveTabOrder: o = !0
|
|
689
|
-
} =
|
|
690
|
-
id:
|
|
691
|
-
root:
|
|
692
|
-
}), [
|
|
514
|
+
} = e, i = qn({
|
|
515
|
+
id: r,
|
|
516
|
+
root: n
|
|
517
|
+
}), [s, a] = c.useState(null), g = c.useRef(null), m = c.useRef(null), R = c.useRef(null), x = c.useRef(null), E = s == null ? void 0 : s.modal, f = s == null ? void 0 : s.open, v = (
|
|
693
518
|
// The FocusManager and therefore floating element are currently open/
|
|
694
519
|
// rendered.
|
|
695
|
-
!!
|
|
696
|
-
!
|
|
697
|
-
|
|
520
|
+
!!s && // Guards are only for non-modal focus management.
|
|
521
|
+
!s.modal && // Don't render if unmount is transitioning.
|
|
522
|
+
s.open && o && !!(n || i)
|
|
698
523
|
);
|
|
699
|
-
return
|
|
700
|
-
if (!
|
|
524
|
+
return c.useEffect(() => {
|
|
525
|
+
if (!i || !o || E)
|
|
701
526
|
return;
|
|
702
|
-
function
|
|
703
|
-
|
|
527
|
+
function l(w) {
|
|
528
|
+
i && De(w) && (w.type === "focusin" ? Tt : En)(i);
|
|
704
529
|
}
|
|
705
|
-
return
|
|
706
|
-
|
|
530
|
+
return i.addEventListener("focusin", l, !0), i.addEventListener("focusout", l, !0), () => {
|
|
531
|
+
i.removeEventListener("focusin", l, !0), i.removeEventListener("focusout", l, !0);
|
|
707
532
|
};
|
|
708
|
-
}, [
|
|
709
|
-
|
|
710
|
-
}, [
|
|
711
|
-
value:
|
|
533
|
+
}, [i, o, E]), c.useEffect(() => {
|
|
534
|
+
i && (f || Tt(i));
|
|
535
|
+
}, [f, i]), /* @__PURE__ */ gt(un.Provider, {
|
|
536
|
+
value: c.useMemo(() => ({
|
|
712
537
|
preserveTabOrder: o,
|
|
713
|
-
beforeOutsideRef:
|
|
714
|
-
afterOutsideRef:
|
|
715
|
-
beforeInsideRef:
|
|
716
|
-
afterInsideRef:
|
|
717
|
-
portalNode:
|
|
718
|
-
setFocusManagerState:
|
|
719
|
-
}), [o,
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
538
|
+
beforeOutsideRef: g,
|
|
539
|
+
afterOutsideRef: m,
|
|
540
|
+
beforeInsideRef: R,
|
|
541
|
+
afterInsideRef: x,
|
|
542
|
+
portalNode: i,
|
|
543
|
+
setFocusManagerState: a
|
|
544
|
+
}), [o, i]),
|
|
545
|
+
children: [v && i && /* @__PURE__ */ ve(Ze, {
|
|
546
|
+
"data-type": "outside",
|
|
547
|
+
ref: g,
|
|
548
|
+
onFocus: (l) => {
|
|
549
|
+
if (De(l, i)) {
|
|
550
|
+
var w;
|
|
551
|
+
(w = R.current) == null || w.focus();
|
|
552
|
+
} else {
|
|
553
|
+
const k = s ? s.domReference : null, b = zt(k);
|
|
554
|
+
b == null || b.focus();
|
|
555
|
+
}
|
|
730
556
|
}
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
557
|
+
}), v && i && /* @__PURE__ */ ve("span", {
|
|
558
|
+
"aria-owns": i.id,
|
|
559
|
+
style: Yn
|
|
560
|
+
}), i && /* @__PURE__ */ Pn.createPortal(t, i), v && i && /* @__PURE__ */ ve(Ze, {
|
|
561
|
+
"data-type": "outside",
|
|
562
|
+
ref: m,
|
|
563
|
+
onFocus: (l) => {
|
|
564
|
+
if (De(l, i)) {
|
|
565
|
+
var w;
|
|
566
|
+
(w = x.current) == null || w.focus();
|
|
567
|
+
} else {
|
|
568
|
+
const k = s ? s.domReference : null, b = Ut(k);
|
|
569
|
+
b == null || b.focus(), s != null && s.closeOnFocusOut && (s == null || s.onOpenChange(!1, l.nativeEvent, "focus-out"));
|
|
570
|
+
}
|
|
745
571
|
}
|
|
746
|
-
}
|
|
747
|
-
})
|
|
572
|
+
})]
|
|
573
|
+
});
|
|
748
574
|
}
|
|
749
|
-
const
|
|
750
|
-
function
|
|
751
|
-
return
|
|
575
|
+
const cn = () => c.useContext(un);
|
|
576
|
+
function At(e) {
|
|
577
|
+
return c.useMemo(() => (t) => {
|
|
578
|
+
e.forEach((r) => {
|
|
579
|
+
r && (r.current = t);
|
|
580
|
+
});
|
|
581
|
+
}, e);
|
|
752
582
|
}
|
|
753
|
-
const
|
|
583
|
+
const Nt = 20;
|
|
754
584
|
let Te = [];
|
|
755
|
-
function
|
|
756
|
-
Te = Te.filter((
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
const n = Ge(e, Ke())[0];
|
|
761
|
-
n && (e = n);
|
|
762
|
-
}
|
|
763
|
-
Te.push(e), Te.length > Mt && (Te = Te.slice(-Mt));
|
|
764
|
-
}
|
|
585
|
+
function bt() {
|
|
586
|
+
Te = Te.filter((e) => {
|
|
587
|
+
var t;
|
|
588
|
+
return (t = e.deref()) == null ? void 0 : t.isConnected;
|
|
589
|
+
});
|
|
765
590
|
}
|
|
766
|
-
function
|
|
767
|
-
|
|
591
|
+
function Xn(e) {
|
|
592
|
+
bt(), e && en(e) !== "body" && (Te.push(new WeakRef(e)), Te.length > Nt && (Te = Te.slice(-Nt)));
|
|
768
593
|
}
|
|
769
|
-
|
|
770
|
-
|
|
594
|
+
function _t() {
|
|
595
|
+
bt();
|
|
596
|
+
const e = Te[Te.length - 1];
|
|
597
|
+
return e == null ? void 0 : e.deref();
|
|
598
|
+
}
|
|
599
|
+
function Gn(e) {
|
|
600
|
+
const t = pt();
|
|
601
|
+
return rn(e, t) ? e : nn(e, t)[0] || e;
|
|
602
|
+
}
|
|
603
|
+
function Kt(e, t) {
|
|
604
|
+
var r;
|
|
605
|
+
if (!t.current.includes("floating") && !((r = e.getAttribute("role")) != null && r.includes("dialog")))
|
|
606
|
+
return;
|
|
607
|
+
const n = pt(), i = Mn(e, n).filter((a) => {
|
|
608
|
+
const g = a.getAttribute("data-tabindex") || "";
|
|
609
|
+
return rn(a, n) || a.hasAttribute("data-tabindex") && !g.startsWith("-");
|
|
610
|
+
}), s = e.getAttribute("tabindex");
|
|
611
|
+
t.current.includes("floating") || i.length === 0 ? s !== "0" && e.setAttribute("tabindex", "0") : (s !== "-1" || e.hasAttribute("data-tabindex") && e.getAttribute("data-tabindex") !== "-1") && (e.setAttribute("tabindex", "-1"), e.setAttribute("data-tabindex", "-1"));
|
|
612
|
+
}
|
|
613
|
+
const jn = /* @__PURE__ */ c.forwardRef(function(t, r) {
|
|
614
|
+
return /* @__PURE__ */ ve("button", {
|
|
615
|
+
...t,
|
|
771
616
|
type: "button",
|
|
772
|
-
ref:
|
|
617
|
+
ref: r,
|
|
773
618
|
tabIndex: -1,
|
|
774
|
-
style:
|
|
775
|
-
})
|
|
619
|
+
style: vt
|
|
620
|
+
});
|
|
776
621
|
});
|
|
777
|
-
function
|
|
622
|
+
function mr(e) {
|
|
778
623
|
const {
|
|
779
|
-
context:
|
|
780
|
-
children:
|
|
781
|
-
disabled:
|
|
624
|
+
context: t,
|
|
625
|
+
children: r,
|
|
626
|
+
disabled: n = !1,
|
|
782
627
|
order: o = ["content"],
|
|
783
|
-
guards:
|
|
784
|
-
initialFocus:
|
|
785
|
-
returnFocus:
|
|
786
|
-
restoreFocus:
|
|
787
|
-
modal:
|
|
788
|
-
visuallyHiddenDismiss:
|
|
789
|
-
closeOnFocusOut:
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
onOpenChange:
|
|
795
|
-
events:
|
|
796
|
-
dataRef:
|
|
797
|
-
floatingId: N,
|
|
628
|
+
guards: i = !0,
|
|
629
|
+
initialFocus: s = 0,
|
|
630
|
+
returnFocus: a = !0,
|
|
631
|
+
restoreFocus: g = !1,
|
|
632
|
+
modal: m = !0,
|
|
633
|
+
visuallyHiddenDismiss: R = !1,
|
|
634
|
+
closeOnFocusOut: x = !0,
|
|
635
|
+
outsideElementsInert: E = !1,
|
|
636
|
+
getInsideElements: f = () => []
|
|
637
|
+
} = e, {
|
|
638
|
+
open: v,
|
|
639
|
+
onOpenChange: l,
|
|
640
|
+
events: w,
|
|
641
|
+
dataRef: k,
|
|
798
642
|
elements: {
|
|
799
|
-
domReference:
|
|
800
|
-
floating:
|
|
643
|
+
domReference: b,
|
|
644
|
+
floating: h
|
|
801
645
|
}
|
|
802
|
-
} =
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
return
|
|
646
|
+
} = t, T = ce(() => {
|
|
647
|
+
var L;
|
|
648
|
+
return (L = k.current.floatingContext) == null ? void 0 : L.nodeId;
|
|
649
|
+
}), $ = ce(f), H = typeof s == "number" && s < 0, B = mt(b) && H, _ = Hn(), oe = _ ? i : !0, j = !oe || _ && E, q = Re(o), X = Re(s), F = Re(a), u = Oe(), p = cn(), K = c.useRef(null), y = c.useRef(null), d = c.useRef(!1), I = c.useRef(!1), O = c.useRef(-1), G = c.useRef(-1), S = p != null, M = Qe(h), U = ce(function(L) {
|
|
650
|
+
return L === void 0 && (L = M), L ? nn(L, pt()) : [];
|
|
651
|
+
}), N = ce((L) => {
|
|
652
|
+
const W = U(L);
|
|
653
|
+
return q.current.map((D) => b && D === "reference" ? b : M && D === "floating" ? M : W).filter(Boolean).flat();
|
|
807
654
|
});
|
|
808
|
-
|
|
809
|
-
if (
|
|
810
|
-
function L(
|
|
811
|
-
if (
|
|
812
|
-
|
|
813
|
-
const
|
|
814
|
-
q.current[0] === "reference" &&
|
|
655
|
+
c.useEffect(() => {
|
|
656
|
+
if (n || !m) return;
|
|
657
|
+
function L(D) {
|
|
658
|
+
if (D.key === "Tab") {
|
|
659
|
+
ae(M, we(ge(M))) && U().length === 0 && !B && he(D);
|
|
660
|
+
const z = N(), te = xe(D);
|
|
661
|
+
q.current[0] === "reference" && te === b && (he(D), D.shiftKey ? Me(z[z.length - 1]) : Me(z[1])), q.current[1] === "floating" && te === M && D.shiftKey && (he(D), Me(z[0]));
|
|
815
662
|
}
|
|
816
663
|
}
|
|
817
|
-
const
|
|
818
|
-
return
|
|
819
|
-
|
|
664
|
+
const W = ge(M);
|
|
665
|
+
return W.addEventListener("keydown", L), () => {
|
|
666
|
+
W.removeEventListener("keydown", L);
|
|
820
667
|
};
|
|
821
|
-
}, [
|
|
822
|
-
if (
|
|
823
|
-
function L(
|
|
824
|
-
const
|
|
825
|
-
|
|
668
|
+
}, [n, b, M, m, q, B, U, N]), c.useEffect(() => {
|
|
669
|
+
if (n || !h) return;
|
|
670
|
+
function L(W) {
|
|
671
|
+
const D = xe(W), te = U().indexOf(D);
|
|
672
|
+
te !== -1 && (O.current = te);
|
|
826
673
|
}
|
|
827
|
-
return
|
|
828
|
-
|
|
674
|
+
return h.addEventListener("focusin", L), () => {
|
|
675
|
+
h.removeEventListener("focusin", L);
|
|
829
676
|
};
|
|
830
|
-
}, [
|
|
831
|
-
if (
|
|
677
|
+
}, [n, h, U]), c.useEffect(() => {
|
|
678
|
+
if (n || !x) return;
|
|
832
679
|
function L() {
|
|
833
|
-
|
|
834
|
-
|
|
680
|
+
I.current = !0, setTimeout(() => {
|
|
681
|
+
I.current = !1;
|
|
835
682
|
});
|
|
836
683
|
}
|
|
837
|
-
function
|
|
838
|
-
const
|
|
684
|
+
function W(te) {
|
|
685
|
+
const V = te.relatedTarget, de = te.currentTarget, ue = xe(te);
|
|
839
686
|
queueMicrotask(() => {
|
|
840
|
-
const
|
|
841
|
-
var
|
|
842
|
-
return
|
|
843
|
-
}) ||
|
|
844
|
-
var
|
|
845
|
-
return (
|
|
687
|
+
const le = T(), Ee = !(ae(b, V) || ae(h, V) || ae(V, h) || ae(p == null ? void 0 : p.portalNode, V) || V != null && V.hasAttribute(Pe("focus-guard")) || u && (Se(u.nodesRef.current, le).find((P) => {
|
|
688
|
+
var A, C;
|
|
689
|
+
return ae((A = P.context) == null ? void 0 : A.elements.floating, V) || ae((C = P.context) == null ? void 0 : C.elements.domReference, V);
|
|
690
|
+
}) || wt(u.nodesRef.current, le).find((P) => {
|
|
691
|
+
var A, C, Y;
|
|
692
|
+
return [(A = P.context) == null ? void 0 : A.elements.floating, Qe((C = P.context) == null ? void 0 : C.elements.floating)].includes(V) || ((Y = P.context) == null ? void 0 : Y.elements.domReference) === V;
|
|
846
693
|
})));
|
|
847
|
-
if (
|
|
848
|
-
|
|
849
|
-
const
|
|
850
|
-
|
|
694
|
+
if (de === b && M && Kt(M, q), g && de !== b && !(ue != null && ue.isConnected) && we(ge(M)) === ge(M).body) {
|
|
695
|
+
ye(M) && M.focus();
|
|
696
|
+
const P = O.current, A = U(), C = A[P] || A[A.length - 1] || M;
|
|
697
|
+
ye(C) && C.focus();
|
|
851
698
|
}
|
|
852
|
-
(
|
|
853
|
-
|
|
699
|
+
if (k.current.insideReactTree) {
|
|
700
|
+
k.current.insideReactTree = !1;
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
(B || !m) && V && Ee && !I.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
|
|
704
|
+
V !== _t() && (d.current = !0, l(!1, te, "focus-out"));
|
|
854
705
|
});
|
|
855
706
|
}
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
var L;
|
|
862
|
-
if (r) return;
|
|
863
|
-
const K = Array.from((R == null || (L = R.portalNode) == null ? void 0 : L.querySelectorAll("[" + Oe("portal") + "]")) || []);
|
|
864
|
-
if (F) {
|
|
865
|
-
const M = [F, ...K, I.current, E.current, q.current.includes("reference") || V ? h : null].filter((P) => P != null), D = f || V ? It(M, X, !X) : It(M);
|
|
866
|
-
return () => {
|
|
867
|
-
D();
|
|
868
|
-
};
|
|
707
|
+
const D = !!(!u && p);
|
|
708
|
+
function z() {
|
|
709
|
+
me(G), k.current.insideReactTree = !0, G.current = window.setTimeout(() => {
|
|
710
|
+
k.current.insideReactTree = !1;
|
|
711
|
+
});
|
|
869
712
|
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
713
|
+
if (h && ye(b))
|
|
714
|
+
return b.addEventListener("focusout", W), b.addEventListener("pointerdown", L), h.addEventListener("focusout", W), D && h.addEventListener("focusout", z, !0), () => {
|
|
715
|
+
b.removeEventListener("focusout", W), b.removeEventListener("pointerdown", L), h.removeEventListener("focusout", W), D && h.removeEventListener("focusout", z, !0);
|
|
716
|
+
};
|
|
717
|
+
}, [n, b, h, M, m, u, p, l, x, g, U, B, T, q, k]);
|
|
718
|
+
const ne = c.useRef(null), se = c.useRef(null), Z = At([ne, p == null ? void 0 : p.beforeInsideRef]), J = At([se, p == null ? void 0 : p.afterInsideRef]);
|
|
719
|
+
c.useEffect(() => {
|
|
720
|
+
var L, W;
|
|
721
|
+
if (n || !h) return;
|
|
722
|
+
const D = Array.from((p == null || (L = p.portalNode) == null ? void 0 : L.querySelectorAll("[" + Pe("portal") + "]")) || []), te = (W = (u ? wt(u.nodesRef.current, T()) : []).find((ue) => {
|
|
723
|
+
var le;
|
|
724
|
+
return mt(((le = ue.context) == null ? void 0 : le.elements.domReference) || null);
|
|
725
|
+
})) == null || (W = W.context) == null ? void 0 : W.elements.domReference, V = [h, te, ...D, ...$(), K.current, y.current, ne.current, se.current, p == null ? void 0 : p.beforeOutsideRef.current, p == null ? void 0 : p.afterOutsideRef.current, q.current.includes("reference") || B ? b : null].filter((ue) => ue != null), de = m || B ? St(V, !j, j) : St(V);
|
|
726
|
+
return () => {
|
|
727
|
+
de();
|
|
728
|
+
};
|
|
729
|
+
}, [n, b, h, m, q, p, B, oe, j, u, T, $]), ee(() => {
|
|
730
|
+
if (n || !ye(M)) return;
|
|
731
|
+
const L = ge(M), W = we(L);
|
|
873
732
|
queueMicrotask(() => {
|
|
874
|
-
const
|
|
875
|
-
!
|
|
876
|
-
preventScroll:
|
|
733
|
+
const D = N(M), z = X.current, te = (typeof z == "number" ? D[z] : z.current) || M, V = ae(M, W);
|
|
734
|
+
!H && !V && v && Me(te, {
|
|
735
|
+
preventScroll: te === M
|
|
877
736
|
});
|
|
878
737
|
});
|
|
879
|
-
}, [
|
|
880
|
-
if (
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
ot(M);
|
|
885
|
-
function W(te) {
|
|
738
|
+
}, [n, v, M, H, N, X]), ee(() => {
|
|
739
|
+
if (n || !M) return;
|
|
740
|
+
const L = ge(M), W = we(L);
|
|
741
|
+
Xn(W);
|
|
742
|
+
function D(V) {
|
|
886
743
|
let {
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
744
|
+
reason: de,
|
|
745
|
+
event: ue,
|
|
746
|
+
nested: le
|
|
747
|
+
} = V;
|
|
748
|
+
if (["hover", "safe-polygon"].includes(de) && ue.type === "mouseleave" && (d.current = !0), de === "outside-press")
|
|
749
|
+
if (le)
|
|
750
|
+
d.current = !1;
|
|
751
|
+
else if (Gt(ue) || jt(ue))
|
|
752
|
+
d.current = !1;
|
|
753
|
+
else {
|
|
754
|
+
let Ee = !1;
|
|
755
|
+
document.createElement("div").focus({
|
|
756
|
+
get preventScroll() {
|
|
757
|
+
return Ee = !0, !1;
|
|
758
|
+
}
|
|
759
|
+
}), Ee ? d.current = !1 : d.current = !0;
|
|
760
|
+
}
|
|
893
761
|
}
|
|
894
|
-
|
|
895
|
-
const
|
|
896
|
-
|
|
897
|
-
function
|
|
898
|
-
|
|
762
|
+
w.on("openchange", D);
|
|
763
|
+
const z = L.createElement("span");
|
|
764
|
+
z.setAttribute("tabindex", "-1"), z.setAttribute("aria-hidden", "true"), Object.assign(z.style, vt), S && b && b.insertAdjacentElement("afterend", z);
|
|
765
|
+
function te() {
|
|
766
|
+
if (typeof F.current == "boolean") {
|
|
767
|
+
const V = b || _t();
|
|
768
|
+
return V && V.isConnected ? V : z;
|
|
769
|
+
}
|
|
770
|
+
return F.current.current || z;
|
|
899
771
|
}
|
|
900
772
|
return () => {
|
|
901
|
-
|
|
902
|
-
const
|
|
903
|
-
var
|
|
904
|
-
return
|
|
905
|
-
});
|
|
906
|
-
(we || P && ["click", "mousedown"].includes(P.type)) && l.domReference.current && ot(l.domReference.current);
|
|
907
|
-
const ce = J();
|
|
773
|
+
w.off("openchange", D);
|
|
774
|
+
const V = we(L), de = ae(h, V) || u && Se(u.nodesRef.current, T(), !1).some((le) => {
|
|
775
|
+
var Ee;
|
|
776
|
+
return ae((Ee = le.context) == null ? void 0 : Ee.elements.floating, V);
|
|
777
|
+
}), ue = te();
|
|
908
778
|
queueMicrotask(() => {
|
|
779
|
+
const le = Gn(ue);
|
|
909
780
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
910
|
-
|
|
781
|
+
F.current && !d.current && ye(le) && // If the focus moved somewhere else after mount, avoid returning focus
|
|
911
782
|
// since it likely entered a different element which should be
|
|
912
783
|
// respected: https://github.com/floating-ui/floating-ui/issues/2607
|
|
913
|
-
(!(
|
|
914
|
-
preventScroll:
|
|
915
|
-
}),
|
|
784
|
+
(!(le !== V && V !== L.body) || de) && le.focus({
|
|
785
|
+
preventScroll: !0
|
|
786
|
+
}), z.remove();
|
|
916
787
|
});
|
|
917
788
|
};
|
|
918
|
-
}, [
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
}, [
|
|
923
|
-
if (!
|
|
924
|
-
return
|
|
925
|
-
modal:
|
|
926
|
-
closeOnFocusOut:
|
|
927
|
-
open:
|
|
928
|
-
onOpenChange:
|
|
929
|
-
|
|
789
|
+
}, [n, h, M, F, k, w, u, S, b, T]), c.useEffect(() => (queueMicrotask(() => {
|
|
790
|
+
d.current = !1;
|
|
791
|
+
}), () => {
|
|
792
|
+
queueMicrotask(bt);
|
|
793
|
+
}), [n]), ee(() => {
|
|
794
|
+
if (!n && p)
|
|
795
|
+
return p.setFocusManagerState({
|
|
796
|
+
modal: m,
|
|
797
|
+
closeOnFocusOut: x,
|
|
798
|
+
open: v,
|
|
799
|
+
onOpenChange: l,
|
|
800
|
+
domReference: b
|
|
930
801
|
}), () => {
|
|
931
|
-
|
|
802
|
+
p.setFocusManagerState(null);
|
|
932
803
|
};
|
|
933
|
-
}, [
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
childList: !0,
|
|
943
|
-
subtree: !0,
|
|
944
|
-
attributes: !0
|
|
945
|
-
}), () => {
|
|
946
|
-
K.disconnect();
|
|
947
|
-
};
|
|
948
|
-
}, [r, F, d, l, q, C, Y]);
|
|
949
|
-
function H(L) {
|
|
950
|
-
return r || !m || !f ? null : /* @__PURE__ */ u.createElement(Dn, {
|
|
951
|
-
ref: L === "start" ? I : E,
|
|
952
|
-
onClick: (K) => a(!1, K.nativeEvent)
|
|
953
|
-
}, typeof m == "string" ? m : "Dismiss");
|
|
804
|
+
}, [n, p, m, v, l, x, b]), ee(() => {
|
|
805
|
+
n || M && Kt(M, q);
|
|
806
|
+
}, [n, M, q]);
|
|
807
|
+
function ie(L) {
|
|
808
|
+
return n || !R || !m ? null : /* @__PURE__ */ ve(jn, {
|
|
809
|
+
ref: L === "start" ? K : y,
|
|
810
|
+
onClick: (W) => l(!1, W.nativeEvent),
|
|
811
|
+
children: typeof R == "string" ? R : "Dismiss"
|
|
812
|
+
});
|
|
954
813
|
}
|
|
955
|
-
const
|
|
956
|
-
return /* @__PURE__ */
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
if (
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
"
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
if (
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
814
|
+
const pe = !n && oe && (m ? !B : !0) && (S || m);
|
|
815
|
+
return /* @__PURE__ */ gt(wn, {
|
|
816
|
+
children: [pe && /* @__PURE__ */ ve(Ze, {
|
|
817
|
+
"data-type": "inside",
|
|
818
|
+
ref: Z,
|
|
819
|
+
onFocus: (L) => {
|
|
820
|
+
if (m) {
|
|
821
|
+
const D = N();
|
|
822
|
+
Me(o[0] === "reference" ? D[0] : D[D.length - 1]);
|
|
823
|
+
} else if (p != null && p.preserveTabOrder && p.portalNode)
|
|
824
|
+
if (d.current = !1, De(L, p.portalNode)) {
|
|
825
|
+
const D = Ut(b);
|
|
826
|
+
D == null || D.focus();
|
|
827
|
+
} else {
|
|
828
|
+
var W;
|
|
829
|
+
(W = p.beforeOutsideRef.current) == null || W.focus();
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
}), !B && ie("start"), r, ie("end"), pe && /* @__PURE__ */ ve(Ze, {
|
|
833
|
+
"data-type": "inside",
|
|
834
|
+
ref: J,
|
|
835
|
+
onFocus: (L) => {
|
|
836
|
+
if (m)
|
|
837
|
+
Me(N()[0]);
|
|
838
|
+
else if (p != null && p.preserveTabOrder && p.portalNode)
|
|
839
|
+
if (x && (d.current = !0), De(L, p.portalNode)) {
|
|
840
|
+
const D = zt(b);
|
|
841
|
+
D == null || D.focus();
|
|
842
|
+
} else {
|
|
843
|
+
var W;
|
|
844
|
+
(W = p.afterOutsideRef.current) == null || W.focus();
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
})]
|
|
848
|
+
});
|
|
988
849
|
}
|
|
989
|
-
let
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
850
|
+
let je = 0;
|
|
851
|
+
const Wt = "--floating-ui-scrollbar-width";
|
|
852
|
+
function Un() {
|
|
853
|
+
const e = gn(), t = /iP(hone|ad|od)|iOS/.test(e) || // iPads can claim to be MacIntel
|
|
854
|
+
e === "MacIntel" && navigator.maxTouchPoints > 1, r = document.body.style, o = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft ? "paddingLeft" : "paddingRight", i = window.innerWidth - document.documentElement.clientWidth, s = r.left ? parseFloat(r.left) : window.scrollX, a = r.top ? parseFloat(r.top) : window.scrollY;
|
|
855
|
+
if (r.overflow = "hidden", r.setProperty(Wt, i + "px"), i && (r[o] = i + "px"), t) {
|
|
856
|
+
var g, m;
|
|
857
|
+
const R = ((g = window.visualViewport) == null ? void 0 : g.offsetLeft) || 0, x = ((m = window.visualViewport) == null ? void 0 : m.offsetTop) || 0;
|
|
858
|
+
Object.assign(r, {
|
|
996
859
|
position: "fixed",
|
|
997
|
-
top: -(
|
|
998
|
-
left: -(s - Math.floor(
|
|
860
|
+
top: -(a - Math.floor(x)) + "px",
|
|
861
|
+
left: -(s - Math.floor(R)) + "px",
|
|
999
862
|
right: "0"
|
|
1000
863
|
});
|
|
1001
864
|
}
|
|
1002
865
|
return () => {
|
|
1003
|
-
Object.assign(
|
|
866
|
+
Object.assign(r, {
|
|
1004
867
|
overflow: "",
|
|
1005
|
-
[
|
|
1006
|
-
}), t && (Object.assign(
|
|
868
|
+
[o]: ""
|
|
869
|
+
}), r.removeProperty(Wt), t && (Object.assign(r, {
|
|
1007
870
|
position: "",
|
|
1008
871
|
top: "",
|
|
1009
872
|
left: "",
|
|
1010
873
|
right: ""
|
|
1011
|
-
}), window.scrollTo(s,
|
|
874
|
+
}), window.scrollTo(s, a));
|
|
1012
875
|
};
|
|
1013
876
|
}
|
|
1014
|
-
let
|
|
877
|
+
let Vt = () => {
|
|
1015
878
|
};
|
|
1016
|
-
const
|
|
879
|
+
const pr = /* @__PURE__ */ c.forwardRef(function(t, r) {
|
|
1017
880
|
const {
|
|
1018
|
-
lockScroll:
|
|
881
|
+
lockScroll: n = !1,
|
|
1019
882
|
...o
|
|
1020
|
-
} =
|
|
1021
|
-
return
|
|
1022
|
-
if (
|
|
1023
|
-
return
|
|
1024
|
-
|
|
883
|
+
} = t;
|
|
884
|
+
return ee(() => {
|
|
885
|
+
if (n)
|
|
886
|
+
return je++, je === 1 && (Vt = Un()), () => {
|
|
887
|
+
je--, je === 0 && Vt();
|
|
1025
888
|
};
|
|
1026
|
-
}, [
|
|
1027
|
-
ref:
|
|
1028
|
-
|
|
889
|
+
}, [n]), /* @__PURE__ */ ve("div", {
|
|
890
|
+
ref: r,
|
|
891
|
+
...o,
|
|
1029
892
|
style: {
|
|
1030
893
|
position: "fixed",
|
|
1031
894
|
overflow: "auto",
|
|
@@ -1035,964 +898,982 @@ const er = /* @__PURE__ */ u.forwardRef(function(e, n) {
|
|
|
1035
898
|
left: 0,
|
|
1036
899
|
...o.style
|
|
1037
900
|
}
|
|
1038
|
-
})
|
|
901
|
+
});
|
|
1039
902
|
});
|
|
1040
|
-
function
|
|
1041
|
-
return
|
|
903
|
+
function Ht(e) {
|
|
904
|
+
return ye(e.target) && e.target.tagName === "BUTTON";
|
|
1042
905
|
}
|
|
1043
|
-
function
|
|
1044
|
-
return
|
|
906
|
+
function zn(e) {
|
|
907
|
+
return ye(e.target) && e.target.tagName === "A";
|
|
1045
908
|
}
|
|
1046
|
-
function
|
|
1047
|
-
|
|
909
|
+
function Bt(e) {
|
|
910
|
+
return Qt(e);
|
|
911
|
+
}
|
|
912
|
+
function gr(e, t) {
|
|
913
|
+
t === void 0 && (t = {});
|
|
1048
914
|
const {
|
|
1049
|
-
open:
|
|
1050
|
-
onOpenChange:
|
|
915
|
+
open: r,
|
|
916
|
+
onOpenChange: n,
|
|
1051
917
|
dataRef: o,
|
|
1052
918
|
elements: {
|
|
1053
|
-
domReference:
|
|
919
|
+
domReference: i
|
|
1054
920
|
}
|
|
1055
|
-
} =
|
|
1056
|
-
enabled:
|
|
1057
|
-
event:
|
|
1058
|
-
toggle:
|
|
1059
|
-
ignoreMouse:
|
|
1060
|
-
keyboardHandlers:
|
|
1061
|
-
stickIfOpen:
|
|
1062
|
-
} =
|
|
1063
|
-
onPointerDown(
|
|
1064
|
-
|
|
921
|
+
} = e, {
|
|
922
|
+
enabled: s = !0,
|
|
923
|
+
event: a = "click",
|
|
924
|
+
toggle: g = !0,
|
|
925
|
+
ignoreMouse: m = !1,
|
|
926
|
+
keyboardHandlers: R = !0,
|
|
927
|
+
stickIfOpen: x = !0
|
|
928
|
+
} = t, E = c.useRef(), f = c.useRef(!1), v = c.useMemo(() => ({
|
|
929
|
+
onPointerDown(l) {
|
|
930
|
+
E.current = l.pointerType;
|
|
1065
931
|
},
|
|
1066
|
-
onMouseDown(
|
|
1067
|
-
const
|
|
1068
|
-
|
|
932
|
+
onMouseDown(l) {
|
|
933
|
+
const w = E.current;
|
|
934
|
+
l.button === 0 && a !== "click" && (Ae(w, !0) && m || (r && g && (!(o.current.openEvent && x) || o.current.openEvent.type === "mousedown") ? n(!1, l.nativeEvent, "click") : (l.preventDefault(), n(!0, l.nativeEvent, "click"))));
|
|
1069
935
|
},
|
|
1070
|
-
onClick(
|
|
1071
|
-
const
|
|
1072
|
-
if (
|
|
1073
|
-
|
|
936
|
+
onClick(l) {
|
|
937
|
+
const w = E.current;
|
|
938
|
+
if (a === "mousedown" && E.current) {
|
|
939
|
+
E.current = void 0;
|
|
1074
940
|
return;
|
|
1075
941
|
}
|
|
1076
|
-
Ae(
|
|
942
|
+
Ae(w, !0) && m || (r && g && (!(o.current.openEvent && x) || o.current.openEvent.type === "click") ? n(!1, l.nativeEvent, "click") : n(!0, l.nativeEvent, "click"));
|
|
1077
943
|
},
|
|
1078
|
-
onKeyDown(
|
|
1079
|
-
|
|
944
|
+
onKeyDown(l) {
|
|
945
|
+
E.current = void 0, !(l.defaultPrevented || !R || Ht(l)) && (l.key === " " && !Bt(i) && (l.preventDefault(), f.current = !0), !zn(l) && l.key === "Enter" && n(!(r && g), l.nativeEvent, "click"));
|
|
1080
946
|
},
|
|
1081
|
-
onKeyUp(
|
|
1082
|
-
|
|
947
|
+
onKeyUp(l) {
|
|
948
|
+
l.defaultPrevented || !R || Ht(l) || Bt(i) || l.key === " " && f.current && (f.current = !1, n(!(r && g), l.nativeEvent, "click"));
|
|
1083
949
|
}
|
|
1084
|
-
}), [o,
|
|
1085
|
-
return
|
|
1086
|
-
reference:
|
|
1087
|
-
} : {}, [
|
|
950
|
+
}), [o, i, a, m, R, n, r, x, g]);
|
|
951
|
+
return c.useMemo(() => s ? {
|
|
952
|
+
reference: v
|
|
953
|
+
} : {}, [s, v]);
|
|
1088
954
|
}
|
|
1089
|
-
const
|
|
955
|
+
const Qn = {
|
|
1090
956
|
pointerdown: "onPointerDown",
|
|
1091
957
|
mousedown: "onMouseDown",
|
|
1092
958
|
click: "onClick"
|
|
1093
|
-
},
|
|
959
|
+
}, Zn = {
|
|
1094
960
|
pointerdown: "onPointerDownCapture",
|
|
1095
961
|
mousedown: "onMouseDownCapture",
|
|
1096
962
|
click: "onClickCapture"
|
|
1097
|
-
},
|
|
1098
|
-
var
|
|
963
|
+
}, $t = (e) => {
|
|
964
|
+
var t, r;
|
|
1099
965
|
return {
|
|
1100
|
-
escapeKey: typeof
|
|
1101
|
-
outsidePress: typeof
|
|
966
|
+
escapeKey: typeof e == "boolean" ? e : (t = e == null ? void 0 : e.escapeKey) != null ? t : !1,
|
|
967
|
+
outsidePress: typeof e == "boolean" ? e : (r = e == null ? void 0 : e.outsidePress) != null ? r : !0
|
|
1102
968
|
};
|
|
1103
969
|
};
|
|
1104
|
-
function
|
|
1105
|
-
|
|
970
|
+
function vr(e, t) {
|
|
971
|
+
t === void 0 && (t = {});
|
|
1106
972
|
const {
|
|
1107
|
-
open:
|
|
1108
|
-
onOpenChange:
|
|
973
|
+
open: r,
|
|
974
|
+
onOpenChange: n,
|
|
1109
975
|
elements: o,
|
|
1110
|
-
dataRef:
|
|
1111
|
-
} =
|
|
1112
|
-
enabled:
|
|
1113
|
-
escapeKey:
|
|
1114
|
-
outsidePress:
|
|
1115
|
-
outsidePressEvent:
|
|
1116
|
-
referencePress:
|
|
1117
|
-
referencePressEvent:
|
|
1118
|
-
ancestorScroll:
|
|
1119
|
-
bubbles:
|
|
1120
|
-
capture:
|
|
1121
|
-
} =
|
|
1122
|
-
escapeKey:
|
|
1123
|
-
outsidePress:
|
|
1124
|
-
} =
|
|
1125
|
-
escapeKey:
|
|
1126
|
-
outsidePress:
|
|
1127
|
-
} =
|
|
1128
|
-
var
|
|
1129
|
-
if (!
|
|
976
|
+
dataRef: i
|
|
977
|
+
} = e, {
|
|
978
|
+
enabled: s = !0,
|
|
979
|
+
escapeKey: a = !0,
|
|
980
|
+
outsidePress: g = !0,
|
|
981
|
+
outsidePressEvent: m = "pointerdown",
|
|
982
|
+
referencePress: R = !1,
|
|
983
|
+
referencePressEvent: x = "pointerdown",
|
|
984
|
+
ancestorScroll: E = !1,
|
|
985
|
+
bubbles: f,
|
|
986
|
+
capture: v
|
|
987
|
+
} = t, l = Oe(), w = ce(typeof g == "function" ? g : () => !1), k = typeof g == "function" ? w : g, b = c.useRef(!1), {
|
|
988
|
+
escapeKey: h,
|
|
989
|
+
outsidePress: T
|
|
990
|
+
} = $t(f), {
|
|
991
|
+
escapeKey: $,
|
|
992
|
+
outsidePress: H
|
|
993
|
+
} = $t(v), B = c.useRef(!1), _ = ce((u) => {
|
|
994
|
+
var p;
|
|
995
|
+
if (!r || !s || !a || u.key !== "Escape" || B.current)
|
|
1130
996
|
return;
|
|
1131
|
-
const
|
|
1132
|
-
if (!
|
|
997
|
+
const K = (p = i.current.floatingContext) == null ? void 0 : p.nodeId, y = l ? Se(l.nodesRef.current, K) : [];
|
|
998
|
+
if (!h && (u.stopPropagation(), y.length > 0)) {
|
|
1133
999
|
let d = !0;
|
|
1134
|
-
if (
|
|
1000
|
+
if (y.forEach((I) => {
|
|
1135
1001
|
var O;
|
|
1136
|
-
if ((O =
|
|
1002
|
+
if ((O = I.context) != null && O.open && !I.context.dataRef.current.__escapeKeyBubbles) {
|
|
1137
1003
|
d = !1;
|
|
1138
1004
|
return;
|
|
1139
1005
|
}
|
|
1140
1006
|
}), !d)
|
|
1141
1007
|
return;
|
|
1142
1008
|
}
|
|
1143
|
-
|
|
1144
|
-
}),
|
|
1145
|
-
var
|
|
1146
|
-
const
|
|
1147
|
-
var
|
|
1148
|
-
|
|
1009
|
+
n(!1, mn(u) ? u.nativeEvent : u, "escape-key");
|
|
1010
|
+
}), oe = ce((u) => {
|
|
1011
|
+
var p;
|
|
1012
|
+
const K = () => {
|
|
1013
|
+
var y;
|
|
1014
|
+
_(u), (y = xe(u)) == null || y.removeEventListener("keydown", K);
|
|
1149
1015
|
};
|
|
1150
|
-
(
|
|
1151
|
-
}),
|
|
1152
|
-
var
|
|
1153
|
-
const
|
|
1154
|
-
|
|
1155
|
-
const
|
|
1156
|
-
if (
|
|
1016
|
+
(p = xe(u)) == null || p.addEventListener("keydown", K);
|
|
1017
|
+
}), j = ce((u) => {
|
|
1018
|
+
var p;
|
|
1019
|
+
const K = i.current.insideReactTree;
|
|
1020
|
+
i.current.insideReactTree = !1;
|
|
1021
|
+
const y = b.current;
|
|
1022
|
+
if (b.current = !1, m === "click" && y || K || typeof k == "function" && !k(u))
|
|
1157
1023
|
return;
|
|
1158
|
-
const d =
|
|
1159
|
-
let
|
|
1160
|
-
for (;
|
|
1161
|
-
const
|
|
1162
|
-
if (
|
|
1024
|
+
const d = xe(u), I = "[" + Pe("inert") + "]", O = ge(o.floating).querySelectorAll(I);
|
|
1025
|
+
let G = fe(d) ? d : null;
|
|
1026
|
+
for (; G && !st(G); ) {
|
|
1027
|
+
const N = Tn(G);
|
|
1028
|
+
if (st(N) || !fe(N))
|
|
1163
1029
|
break;
|
|
1164
|
-
|
|
1030
|
+
G = N;
|
|
1165
1031
|
}
|
|
1166
|
-
if (O.length &&
|
|
1167
|
-
!
|
|
1032
|
+
if (O.length && fe(d) && !pn(d) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
1033
|
+
!ae(d, o.floating) && // If the target root element contains none of the markers, then the
|
|
1168
1034
|
// element was injected after the floating element rendered.
|
|
1169
|
-
Array.from(O).every((
|
|
1035
|
+
Array.from(O).every((N) => !ae(G, N)))
|
|
1170
1036
|
return;
|
|
1171
|
-
if (
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1174
|
-
if (D && qt(d).direction === "rtl" && (P = w.offsetX <= d.offsetWidth - d.clientWidth), P || M && w.offsetY > d.clientHeight)
|
|
1037
|
+
if (ye(d) && F) {
|
|
1038
|
+
const N = st(d), ne = Jt(d), se = /auto|scroll/, Z = N || se.test(ne.overflowX), J = N || se.test(ne.overflowY), ie = Z && d.clientWidth > 0 && d.scrollWidth > d.clientWidth, pe = J && d.clientHeight > 0 && d.scrollHeight > d.clientHeight, L = ne.direction === "rtl", W = pe && (L ? u.offsetX <= d.offsetWidth - d.clientWidth : u.offsetX > d.clientWidth), D = ie && u.offsetY > d.clientHeight;
|
|
1039
|
+
if (W || D)
|
|
1175
1040
|
return;
|
|
1176
1041
|
}
|
|
1177
|
-
const
|
|
1178
|
-
var
|
|
1179
|
-
return
|
|
1042
|
+
const S = (p = i.current.floatingContext) == null ? void 0 : p.nodeId, M = l && Se(l.nodesRef.current, S).some((N) => {
|
|
1043
|
+
var ne;
|
|
1044
|
+
return nt(u, (ne = N.context) == null ? void 0 : ne.elements.floating);
|
|
1180
1045
|
});
|
|
1181
|
-
if (
|
|
1046
|
+
if (nt(u, o.floating) || nt(u, o.domReference) || M)
|
|
1182
1047
|
return;
|
|
1183
|
-
const
|
|
1184
|
-
if (
|
|
1185
|
-
let
|
|
1186
|
-
if (
|
|
1187
|
-
var
|
|
1188
|
-
if ((
|
|
1189
|
-
|
|
1048
|
+
const U = l ? Se(l.nodesRef.current, S) : [];
|
|
1049
|
+
if (U.length > 0) {
|
|
1050
|
+
let N = !0;
|
|
1051
|
+
if (U.forEach((ne) => {
|
|
1052
|
+
var se;
|
|
1053
|
+
if ((se = ne.context) != null && se.open && !ne.context.dataRef.current.__outsidePressBubbles) {
|
|
1054
|
+
N = !1;
|
|
1190
1055
|
return;
|
|
1191
1056
|
}
|
|
1192
|
-
}), !
|
|
1057
|
+
}), !N)
|
|
1193
1058
|
return;
|
|
1194
1059
|
}
|
|
1195
|
-
|
|
1196
|
-
}),
|
|
1197
|
-
var
|
|
1198
|
-
const
|
|
1199
|
-
var
|
|
1200
|
-
|
|
1060
|
+
n(!1, u, "outside-press");
|
|
1061
|
+
}), q = ce((u) => {
|
|
1062
|
+
var p;
|
|
1063
|
+
const K = () => {
|
|
1064
|
+
var y;
|
|
1065
|
+
j(u), (y = xe(u)) == null || y.removeEventListener(m, K);
|
|
1201
1066
|
};
|
|
1202
|
-
(
|
|
1067
|
+
(p = xe(u)) == null || p.addEventListener(m, K);
|
|
1203
1068
|
});
|
|
1204
|
-
|
|
1205
|
-
if (!
|
|
1069
|
+
c.useEffect(() => {
|
|
1070
|
+
if (!r || !s)
|
|
1206
1071
|
return;
|
|
1207
|
-
|
|
1208
|
-
let
|
|
1209
|
-
function
|
|
1210
|
-
|
|
1072
|
+
i.current.__escapeKeyBubbles = h, i.current.__outsidePressBubbles = T;
|
|
1073
|
+
let u = -1;
|
|
1074
|
+
function p(O) {
|
|
1075
|
+
n(!1, O, "ancestor-scroll");
|
|
1211
1076
|
}
|
|
1212
|
-
function
|
|
1213
|
-
window.clearTimeout(
|
|
1077
|
+
function K() {
|
|
1078
|
+
window.clearTimeout(u), B.current = !0;
|
|
1214
1079
|
}
|
|
1215
|
-
function
|
|
1216
|
-
|
|
1080
|
+
function y() {
|
|
1081
|
+
u = window.setTimeout(
|
|
1217
1082
|
() => {
|
|
1218
|
-
|
|
1083
|
+
B.current = !1;
|
|
1219
1084
|
},
|
|
1220
1085
|
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
|
|
1221
1086
|
// Only apply to WebKit for the test to remain 0ms.
|
|
1222
|
-
|
|
1087
|
+
In() ? 5 : 0
|
|
1223
1088
|
);
|
|
1224
1089
|
}
|
|
1225
|
-
const d =
|
|
1226
|
-
|
|
1227
|
-
let
|
|
1228
|
-
return
|
|
1229
|
-
var
|
|
1230
|
-
return O !== ((
|
|
1231
|
-
}),
|
|
1232
|
-
O.addEventListener("scroll",
|
|
1090
|
+
const d = ge(o.floating);
|
|
1091
|
+
a && (d.addEventListener("keydown", $ ? oe : _, $), d.addEventListener("compositionstart", K), d.addEventListener("compositionend", y)), k && d.addEventListener(m, H ? q : j, H);
|
|
1092
|
+
let I = [];
|
|
1093
|
+
return E && (fe(o.domReference) && (I = ot(o.domReference)), fe(o.floating) && (I = I.concat(ot(o.floating))), !fe(o.reference) && o.reference && o.reference.contextElement && (I = I.concat(ot(o.reference.contextElement)))), I = I.filter((O) => {
|
|
1094
|
+
var G;
|
|
1095
|
+
return O !== ((G = d.defaultView) == null ? void 0 : G.visualViewport);
|
|
1096
|
+
}), I.forEach((O) => {
|
|
1097
|
+
O.addEventListener("scroll", p, {
|
|
1233
1098
|
passive: !0
|
|
1234
1099
|
});
|
|
1235
1100
|
}), () => {
|
|
1236
|
-
|
|
1237
|
-
O.removeEventListener("scroll",
|
|
1238
|
-
}), window.clearTimeout(
|
|
1101
|
+
a && (d.removeEventListener("keydown", $ ? oe : _, $), d.removeEventListener("compositionstart", K), d.removeEventListener("compositionend", y)), k && d.removeEventListener(m, H ? q : j, H), I.forEach((O) => {
|
|
1102
|
+
O.removeEventListener("scroll", p);
|
|
1103
|
+
}), window.clearTimeout(u);
|
|
1239
1104
|
};
|
|
1240
|
-
}, [
|
|
1241
|
-
|
|
1242
|
-
}, [
|
|
1243
|
-
const
|
|
1244
|
-
onKeyDown:
|
|
1245
|
-
|
|
1246
|
-
|
|
1105
|
+
}, [i, o, a, k, m, r, n, E, s, h, T, _, $, oe, j, H, q]), c.useEffect(() => {
|
|
1106
|
+
i.current.insideReactTree = !1;
|
|
1107
|
+
}, [i, k, m]);
|
|
1108
|
+
const X = c.useMemo(() => ({
|
|
1109
|
+
onKeyDown: _,
|
|
1110
|
+
...R && {
|
|
1111
|
+
[Qn[x]]: (u) => {
|
|
1112
|
+
n(!1, u.nativeEvent, "reference-press");
|
|
1113
|
+
},
|
|
1114
|
+
...x !== "click" && {
|
|
1115
|
+
onClick(u) {
|
|
1116
|
+
n(!1, u.nativeEvent, "reference-press");
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1247
1119
|
}
|
|
1248
|
-
}), [
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
h.current = !0;
|
|
1252
|
-
},
|
|
1253
|
-
onMouseUp() {
|
|
1254
|
-
h.current = !0;
|
|
1255
|
-
},
|
|
1256
|
-
[Kn[f]]: () => {
|
|
1257
|
-
N.current = !0;
|
|
1120
|
+
}), [_, n, R, x]), F = c.useMemo(() => {
|
|
1121
|
+
function u(p) {
|
|
1122
|
+
p.button === 0 && (b.current = !0);
|
|
1258
1123
|
}
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1124
|
+
return {
|
|
1125
|
+
onKeyDown: _,
|
|
1126
|
+
onMouseDown: u,
|
|
1127
|
+
onMouseUp: u,
|
|
1128
|
+
[Zn[m]]: () => {
|
|
1129
|
+
i.current.insideReactTree = !0;
|
|
1130
|
+
}
|
|
1131
|
+
};
|
|
1132
|
+
}, [_, m, i]);
|
|
1133
|
+
return c.useMemo(() => s ? {
|
|
1134
|
+
reference: X,
|
|
1135
|
+
floating: F
|
|
1136
|
+
} : {}, [s, X, F]);
|
|
1264
1137
|
}
|
|
1265
|
-
function
|
|
1138
|
+
function Jn(e) {
|
|
1266
1139
|
const {
|
|
1267
|
-
open:
|
|
1268
|
-
onOpenChange:
|
|
1269
|
-
elements:
|
|
1270
|
-
} =
|
|
1140
|
+
open: t = !1,
|
|
1141
|
+
onOpenChange: r,
|
|
1142
|
+
elements: n
|
|
1143
|
+
} = e, o = We(), i = c.useRef({}), [s] = c.useState(() => Nn()), a = Ve() != null;
|
|
1271
1144
|
if (process.env.NODE_ENV !== "production") {
|
|
1272
|
-
const
|
|
1273
|
-
|
|
1145
|
+
const f = n.reference;
|
|
1146
|
+
f && !fe(f) && An("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
1274
1147
|
}
|
|
1275
|
-
const [
|
|
1276
|
-
|
|
1277
|
-
open:
|
|
1278
|
-
event:
|
|
1279
|
-
reason:
|
|
1280
|
-
nested:
|
|
1281
|
-
}),
|
|
1282
|
-
}),
|
|
1283
|
-
setPositionReference:
|
|
1284
|
-
}), []),
|
|
1285
|
-
reference:
|
|
1286
|
-
floating:
|
|
1287
|
-
domReference:
|
|
1288
|
-
}), [
|
|
1289
|
-
return
|
|
1290
|
-
dataRef:
|
|
1291
|
-
open:
|
|
1292
|
-
onOpenChange:
|
|
1293
|
-
elements:
|
|
1294
|
-
events:
|
|
1148
|
+
const [g, m] = c.useState(n.reference), R = ce((f, v, l) => {
|
|
1149
|
+
i.current.openEvent = f ? v : void 0, s.emit("openchange", {
|
|
1150
|
+
open: f,
|
|
1151
|
+
event: v,
|
|
1152
|
+
reason: l,
|
|
1153
|
+
nested: a
|
|
1154
|
+
}), r == null || r(f, v, l);
|
|
1155
|
+
}), x = c.useMemo(() => ({
|
|
1156
|
+
setPositionReference: m
|
|
1157
|
+
}), []), E = c.useMemo(() => ({
|
|
1158
|
+
reference: g || n.reference || null,
|
|
1159
|
+
floating: n.floating || null,
|
|
1160
|
+
domReference: n.reference
|
|
1161
|
+
}), [g, n.reference, n.floating]);
|
|
1162
|
+
return c.useMemo(() => ({
|
|
1163
|
+
dataRef: i,
|
|
1164
|
+
open: t,
|
|
1165
|
+
onOpenChange: R,
|
|
1166
|
+
elements: E,
|
|
1167
|
+
events: s,
|
|
1295
1168
|
floatingId: o,
|
|
1296
|
-
refs:
|
|
1297
|
-
}), [
|
|
1169
|
+
refs: x
|
|
1170
|
+
}), [t, R, E, s, o, x]);
|
|
1298
1171
|
}
|
|
1299
|
-
function
|
|
1300
|
-
|
|
1172
|
+
function br(e) {
|
|
1173
|
+
e === void 0 && (e = {});
|
|
1301
1174
|
const {
|
|
1302
|
-
nodeId:
|
|
1303
|
-
} =
|
|
1304
|
-
...
|
|
1175
|
+
nodeId: t
|
|
1176
|
+
} = e, r = Jn({
|
|
1177
|
+
...e,
|
|
1305
1178
|
elements: {
|
|
1306
1179
|
reference: null,
|
|
1307
1180
|
floating: null,
|
|
1308
|
-
...
|
|
1181
|
+
...e.elements
|
|
1309
1182
|
}
|
|
1310
|
-
}),
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
}, [
|
|
1314
|
-
const
|
|
1315
|
-
...
|
|
1183
|
+
}), n = e.rootContext || r, o = n.elements, [i, s] = c.useState(null), [a, g] = c.useState(null), R = (o == null ? void 0 : o.domReference) || i, x = c.useRef(null), E = Oe();
|
|
1184
|
+
ee(() => {
|
|
1185
|
+
R && (x.current = R);
|
|
1186
|
+
}, [R]);
|
|
1187
|
+
const f = kn({
|
|
1188
|
+
...e,
|
|
1316
1189
|
elements: {
|
|
1317
1190
|
...o,
|
|
1318
|
-
...
|
|
1319
|
-
reference:
|
|
1191
|
+
...a && {
|
|
1192
|
+
reference: a
|
|
1320
1193
|
}
|
|
1321
1194
|
}
|
|
1322
|
-
}),
|
|
1323
|
-
const
|
|
1195
|
+
}), v = c.useCallback((h) => {
|
|
1196
|
+
const T = fe(h) ? {
|
|
1324
1197
|
getBoundingClientRect: () => h.getBoundingClientRect(),
|
|
1198
|
+
getClientRects: () => h.getClientRects(),
|
|
1325
1199
|
contextElement: h
|
|
1326
1200
|
} : h;
|
|
1327
|
-
|
|
1328
|
-
}, [
|
|
1329
|
-
(
|
|
1201
|
+
g(T), f.refs.setReference(T);
|
|
1202
|
+
}, [f.refs]), l = c.useCallback((h) => {
|
|
1203
|
+
(fe(h) || h === null) && (x.current = h, s(h)), (fe(f.refs.reference.current) || f.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
1330
1204
|
// `null` to support `positionReference` + an unstable `reference`
|
|
1331
1205
|
// callback ref.
|
|
1332
|
-
h !== null && !
|
|
1333
|
-
}, [
|
|
1334
|
-
...
|
|
1335
|
-
setReference:
|
|
1336
|
-
setPositionReference:
|
|
1337
|
-
domReference:
|
|
1338
|
-
}), [
|
|
1339
|
-
...
|
|
1340
|
-
domReference:
|
|
1341
|
-
}), [
|
|
1342
|
-
...
|
|
1343
|
-
...
|
|
1344
|
-
refs:
|
|
1345
|
-
elements:
|
|
1346
|
-
nodeId:
|
|
1347
|
-
}), [
|
|
1348
|
-
return
|
|
1349
|
-
|
|
1350
|
-
const h =
|
|
1351
|
-
h && (h.context =
|
|
1352
|
-
}),
|
|
1353
|
-
...
|
|
1354
|
-
context:
|
|
1355
|
-
refs:
|
|
1356
|
-
elements:
|
|
1357
|
-
}), [
|
|
1206
|
+
h !== null && !fe(h)) && f.refs.setReference(h);
|
|
1207
|
+
}, [f.refs]), w = c.useMemo(() => ({
|
|
1208
|
+
...f.refs,
|
|
1209
|
+
setReference: l,
|
|
1210
|
+
setPositionReference: v,
|
|
1211
|
+
domReference: x
|
|
1212
|
+
}), [f.refs, l, v]), k = c.useMemo(() => ({
|
|
1213
|
+
...f.elements,
|
|
1214
|
+
domReference: R
|
|
1215
|
+
}), [f.elements, R]), b = c.useMemo(() => ({
|
|
1216
|
+
...f,
|
|
1217
|
+
...n,
|
|
1218
|
+
refs: w,
|
|
1219
|
+
elements: k,
|
|
1220
|
+
nodeId: t
|
|
1221
|
+
}), [f, w, k, t, n]);
|
|
1222
|
+
return ee(() => {
|
|
1223
|
+
n.dataRef.current.floatingContext = b;
|
|
1224
|
+
const h = E == null ? void 0 : E.nodesRef.current.find((T) => T.id === t);
|
|
1225
|
+
h && (h.context = b);
|
|
1226
|
+
}), c.useMemo(() => ({
|
|
1227
|
+
...f,
|
|
1228
|
+
context: b,
|
|
1229
|
+
refs: w,
|
|
1230
|
+
elements: k
|
|
1231
|
+
}), [f, w, k, b]);
|
|
1358
1232
|
}
|
|
1359
|
-
function
|
|
1360
|
-
|
|
1233
|
+
function at() {
|
|
1234
|
+
return yn() && Zt();
|
|
1235
|
+
}
|
|
1236
|
+
function Rr(e, t) {
|
|
1237
|
+
t === void 0 && (t = {});
|
|
1361
1238
|
const {
|
|
1362
|
-
open:
|
|
1363
|
-
onOpenChange:
|
|
1239
|
+
open: r,
|
|
1240
|
+
onOpenChange: n,
|
|
1364
1241
|
events: o,
|
|
1365
|
-
dataRef:
|
|
1366
|
-
elements:
|
|
1367
|
-
} =
|
|
1368
|
-
enabled:
|
|
1369
|
-
visibleOnly:
|
|
1370
|
-
} =
|
|
1371
|
-
|
|
1372
|
-
if (!
|
|
1373
|
-
const
|
|
1374
|
-
function
|
|
1375
|
-
!
|
|
1242
|
+
dataRef: i,
|
|
1243
|
+
elements: s
|
|
1244
|
+
} = e, {
|
|
1245
|
+
enabled: a = !0,
|
|
1246
|
+
visibleOnly: g = !0
|
|
1247
|
+
} = t, m = c.useRef(!1), R = c.useRef(-1), x = c.useRef(!0);
|
|
1248
|
+
c.useEffect(() => {
|
|
1249
|
+
if (!a) return;
|
|
1250
|
+
const f = xn(s.domReference);
|
|
1251
|
+
function v() {
|
|
1252
|
+
!r && ye(s.domReference) && s.domReference === we(ge(s.domReference)) && (m.current = !0);
|
|
1376
1253
|
}
|
|
1377
|
-
function
|
|
1378
|
-
|
|
1254
|
+
function l() {
|
|
1255
|
+
x.current = !0;
|
|
1379
1256
|
}
|
|
1380
|
-
|
|
1381
|
-
|
|
1257
|
+
function w() {
|
|
1258
|
+
x.current = !1;
|
|
1259
|
+
}
|
|
1260
|
+
return f.addEventListener("blur", v), at() && (f.addEventListener("keydown", l, !0), f.addEventListener("pointerdown", w, !0)), () => {
|
|
1261
|
+
f.removeEventListener("blur", v), at() && (f.removeEventListener("keydown", l, !0), f.removeEventListener("pointerdown", w, !0));
|
|
1382
1262
|
};
|
|
1383
|
-
}, [
|
|
1384
|
-
if (!
|
|
1385
|
-
function
|
|
1263
|
+
}, [s.domReference, r, a]), c.useEffect(() => {
|
|
1264
|
+
if (!a) return;
|
|
1265
|
+
function f(v) {
|
|
1386
1266
|
let {
|
|
1387
|
-
reason:
|
|
1388
|
-
} =
|
|
1389
|
-
(
|
|
1267
|
+
reason: l
|
|
1268
|
+
} = v;
|
|
1269
|
+
(l === "reference-press" || l === "escape-key") && (m.current = !0);
|
|
1390
1270
|
}
|
|
1391
|
-
return o.on("openchange",
|
|
1392
|
-
o.off("openchange",
|
|
1271
|
+
return o.on("openchange", f), () => {
|
|
1272
|
+
o.off("openchange", f);
|
|
1393
1273
|
};
|
|
1394
|
-
}, [o,
|
|
1395
|
-
|
|
1274
|
+
}, [o, a]), c.useEffect(() => () => {
|
|
1275
|
+
me(R);
|
|
1396
1276
|
}, []);
|
|
1397
|
-
const
|
|
1398
|
-
onPointerDown(l) {
|
|
1399
|
-
lt(l.nativeEvent) || (b.current = !1);
|
|
1400
|
-
},
|
|
1277
|
+
const E = c.useMemo(() => ({
|
|
1401
1278
|
onMouseLeave() {
|
|
1402
|
-
|
|
1279
|
+
m.current = !1;
|
|
1403
1280
|
},
|
|
1404
|
-
onFocus(
|
|
1405
|
-
if (
|
|
1406
|
-
const
|
|
1407
|
-
if (
|
|
1408
|
-
|
|
1409
|
-
if (
|
|
1410
|
-
if (!g.matches(":focus-visible")) return;
|
|
1411
|
-
} catch {
|
|
1412
|
-
if (!b.current && !Bt(g))
|
|
1281
|
+
onFocus(f) {
|
|
1282
|
+
if (m.current) return;
|
|
1283
|
+
const v = xe(f.nativeEvent);
|
|
1284
|
+
if (g && fe(v)) {
|
|
1285
|
+
if (at() && !f.relatedTarget) {
|
|
1286
|
+
if (!x.current && !Qt(v))
|
|
1413
1287
|
return;
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1288
|
+
} else if (!dn(v))
|
|
1289
|
+
return;
|
|
1290
|
+
}
|
|
1291
|
+
n(!0, f.nativeEvent, "focus");
|
|
1416
1292
|
},
|
|
1417
|
-
onBlur(
|
|
1418
|
-
|
|
1419
|
-
const
|
|
1420
|
-
|
|
1421
|
-
var
|
|
1422
|
-
const
|
|
1423
|
-
!
|
|
1293
|
+
onBlur(f) {
|
|
1294
|
+
m.current = !1;
|
|
1295
|
+
const v = f.relatedTarget, l = f.nativeEvent, w = fe(v) && v.hasAttribute(Pe("focus-guard")) && v.getAttribute("data-type") === "outside";
|
|
1296
|
+
R.current = window.setTimeout(() => {
|
|
1297
|
+
var k;
|
|
1298
|
+
const b = we(s.domReference ? s.domReference.ownerDocument : document);
|
|
1299
|
+
!v && b === s.domReference || ae((k = i.current.floatingContext) == null ? void 0 : k.refs.floating.current, b) || ae(s.domReference, b) || w || n(!1, l, "focus");
|
|
1424
1300
|
});
|
|
1425
1301
|
}
|
|
1426
|
-
}), [
|
|
1427
|
-
return
|
|
1428
|
-
reference:
|
|
1429
|
-
} : {}, [
|
|
1302
|
+
}), [i, s.domReference, n, g]);
|
|
1303
|
+
return c.useMemo(() => a ? {
|
|
1304
|
+
reference: E
|
|
1305
|
+
} : {}, [a, E]);
|
|
1430
1306
|
}
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
if (o && t) {
|
|
1307
|
+
function ft(e, t, r) {
|
|
1308
|
+
const n = /* @__PURE__ */ new Map(), o = r === "item";
|
|
1309
|
+
let i = e;
|
|
1310
|
+
if (o && e) {
|
|
1436
1311
|
const {
|
|
1437
|
-
[
|
|
1438
|
-
[
|
|
1439
|
-
...
|
|
1440
|
-
} =
|
|
1441
|
-
|
|
1312
|
+
[Ct]: s,
|
|
1313
|
+
[Mt]: a,
|
|
1314
|
+
...g
|
|
1315
|
+
} = e;
|
|
1316
|
+
i = g;
|
|
1442
1317
|
}
|
|
1443
1318
|
return {
|
|
1444
|
-
...
|
|
1319
|
+
...r === "floating" && {
|
|
1445
1320
|
tabIndex: -1,
|
|
1446
|
-
[
|
|
1321
|
+
[On]: ""
|
|
1447
1322
|
},
|
|
1448
|
-
...
|
|
1449
|
-
...
|
|
1450
|
-
const
|
|
1451
|
-
return typeof
|
|
1452
|
-
}).concat(
|
|
1453
|
-
let [
|
|
1454
|
-
if (!(o && [
|
|
1455
|
-
if (
|
|
1456
|
-
if (
|
|
1457
|
-
var
|
|
1458
|
-
(
|
|
1459
|
-
for (var
|
|
1460
|
-
|
|
1461
|
-
return (
|
|
1323
|
+
...i,
|
|
1324
|
+
...t.map((s) => {
|
|
1325
|
+
const a = s ? s[r] : null;
|
|
1326
|
+
return typeof a == "function" ? e ? a(e) : null : a;
|
|
1327
|
+
}).concat(e).reduce((s, a) => (a && Object.entries(a).forEach((g) => {
|
|
1328
|
+
let [m, R] = g;
|
|
1329
|
+
if (!(o && [Ct, Mt].includes(m)))
|
|
1330
|
+
if (m.indexOf("on") === 0) {
|
|
1331
|
+
if (n.has(m) || n.set(m, []), typeof R == "function") {
|
|
1332
|
+
var x;
|
|
1333
|
+
(x = n.get(m)) == null || x.push(R), s[m] = function() {
|
|
1334
|
+
for (var E, f = arguments.length, v = new Array(f), l = 0; l < f; l++)
|
|
1335
|
+
v[l] = arguments[l];
|
|
1336
|
+
return (E = n.get(m)) == null ? void 0 : E.map((w) => w(...v)).find((w) => w !== void 0);
|
|
1462
1337
|
};
|
|
1463
1338
|
}
|
|
1464
1339
|
} else
|
|
1465
|
-
|
|
1466
|
-
}),
|
|
1340
|
+
s[m] = R;
|
|
1341
|
+
}), s), {})
|
|
1467
1342
|
};
|
|
1468
1343
|
}
|
|
1469
|
-
function
|
|
1470
|
-
|
|
1471
|
-
const
|
|
1472
|
-
(
|
|
1344
|
+
function hr(e) {
|
|
1345
|
+
e === void 0 && (e = []);
|
|
1346
|
+
const t = e.map((a) => a == null ? void 0 : a.reference), r = e.map((a) => a == null ? void 0 : a.floating), n = e.map((a) => a == null ? void 0 : a.item), o = c.useCallback(
|
|
1347
|
+
(a) => ft(a, e, "reference"),
|
|
1473
1348
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1474
|
-
|
|
1475
|
-
),
|
|
1476
|
-
(
|
|
1477
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1478
|
-
n
|
|
1479
|
-
), i = u.useCallback(
|
|
1480
|
-
(c) => st(c, t, "item"),
|
|
1349
|
+
t
|
|
1350
|
+
), i = c.useCallback(
|
|
1351
|
+
(a) => ft(a, e, "floating"),
|
|
1481
1352
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1482
1353
|
r
|
|
1354
|
+
), s = c.useCallback(
|
|
1355
|
+
(a) => ft(a, e, "item"),
|
|
1356
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1357
|
+
n
|
|
1483
1358
|
);
|
|
1484
|
-
return
|
|
1359
|
+
return c.useMemo(() => ({
|
|
1485
1360
|
getReferenceProps: o,
|
|
1486
|
-
getFloatingProps:
|
|
1487
|
-
getItemProps:
|
|
1488
|
-
}), [o,
|
|
1361
|
+
getFloatingProps: i,
|
|
1362
|
+
getItemProps: s
|
|
1363
|
+
}), [o, i, s]);
|
|
1489
1364
|
}
|
|
1490
|
-
|
|
1491
|
-
function
|
|
1492
|
-
switch (
|
|
1365
|
+
const er = "Escape";
|
|
1366
|
+
function et(e, t, r) {
|
|
1367
|
+
switch (e) {
|
|
1493
1368
|
case "vertical":
|
|
1494
|
-
return
|
|
1369
|
+
return t;
|
|
1495
1370
|
case "horizontal":
|
|
1496
|
-
return
|
|
1371
|
+
return r;
|
|
1497
1372
|
default:
|
|
1498
|
-
return
|
|
1373
|
+
return t || r;
|
|
1499
1374
|
}
|
|
1500
1375
|
}
|
|
1501
|
-
function
|
|
1502
|
-
return
|
|
1376
|
+
function Ue(e, t) {
|
|
1377
|
+
return et(t, e === on || e === Je, e === _e || e === Ke);
|
|
1503
1378
|
}
|
|
1504
|
-
function
|
|
1505
|
-
return
|
|
1379
|
+
function dt(e, t, r) {
|
|
1380
|
+
return et(t, e === Je, r ? e === _e : e === Ke) || e === "Enter" || e === " " || e === "";
|
|
1506
1381
|
}
|
|
1507
|
-
function
|
|
1508
|
-
return
|
|
1382
|
+
function Yt(e, t, r) {
|
|
1383
|
+
return et(t, r ? e === _e : e === Ke, e === Je);
|
|
1509
1384
|
}
|
|
1510
|
-
function
|
|
1511
|
-
|
|
1385
|
+
function qt(e, t, r, n) {
|
|
1386
|
+
const o = r ? e === Ke : e === _e, i = e === on;
|
|
1387
|
+
return t === "both" || t === "horizontal" && n && n > 1 ? e === er : et(t, o, i);
|
|
1512
1388
|
}
|
|
1513
|
-
function
|
|
1389
|
+
function Er(e, t) {
|
|
1514
1390
|
const {
|
|
1515
|
-
open:
|
|
1516
|
-
onOpenChange:
|
|
1517
|
-
elements: o
|
|
1518
|
-
|
|
1391
|
+
open: r,
|
|
1392
|
+
onOpenChange: n,
|
|
1393
|
+
elements: o,
|
|
1394
|
+
floatingId: i
|
|
1395
|
+
} = e, {
|
|
1519
1396
|
listRef: s,
|
|
1520
|
-
activeIndex:
|
|
1521
|
-
onNavigate:
|
|
1397
|
+
activeIndex: a,
|
|
1398
|
+
onNavigate: g = () => {
|
|
1522
1399
|
},
|
|
1523
|
-
enabled:
|
|
1524
|
-
selectedIndex:
|
|
1525
|
-
allowEscape:
|
|
1526
|
-
loop:
|
|
1527
|
-
nested:
|
|
1528
|
-
rtl:
|
|
1529
|
-
virtual:
|
|
1530
|
-
focusItemOnOpen:
|
|
1400
|
+
enabled: m = !0,
|
|
1401
|
+
selectedIndex: R = null,
|
|
1402
|
+
allowEscape: x = !1,
|
|
1403
|
+
loop: E = !1,
|
|
1404
|
+
nested: f = !1,
|
|
1405
|
+
rtl: v = !1,
|
|
1406
|
+
virtual: l = !1,
|
|
1407
|
+
focusItemOnOpen: w = "auto",
|
|
1531
1408
|
focusItemOnHover: k = !0,
|
|
1532
|
-
openOnArrowKeyDown:
|
|
1533
|
-
disabledIndices:
|
|
1534
|
-
orientation:
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1409
|
+
openOnArrowKeyDown: b = !0,
|
|
1410
|
+
disabledIndices: h = void 0,
|
|
1411
|
+
orientation: T = "vertical",
|
|
1412
|
+
parentOrientation: $,
|
|
1413
|
+
cols: H = 1,
|
|
1414
|
+
scrollItemIntoView: B = !0,
|
|
1415
|
+
virtualItemRef: _,
|
|
1416
|
+
itemSizes: oe,
|
|
1417
|
+
dense: j = !1
|
|
1418
|
+
} = t;
|
|
1419
|
+
process.env.NODE_ENV !== "production" && (x && (E || ze("`useListNavigation` looping must be enabled to allow escaping."), l || ze("`useListNavigation` must be virtual to allow escaping.")), T === "vertical" && H > 1 && ze("In grid list navigation mode (`cols` > 1), the `orientation` should", 'be either "horizontal" or "both".'));
|
|
1420
|
+
const q = Qe(o.floating), X = Re(q), F = Ve(), u = Oe();
|
|
1421
|
+
ee(() => {
|
|
1422
|
+
e.dataRef.current.orientation = T;
|
|
1423
|
+
}, [e, T]);
|
|
1424
|
+
const p = ce(() => {
|
|
1425
|
+
g(d.current === -1 ? null : d.current);
|
|
1426
|
+
}), K = mt(o.domReference), y = c.useRef(w), d = c.useRef(R ?? -1), I = c.useRef(null), O = c.useRef(!0), G = c.useRef(p), S = c.useRef(!!o.floating), M = c.useRef(r), U = c.useRef(!1), N = c.useRef(!1), ne = Re(h), se = Re(r), Z = Re(B), J = Re(R), [ie, pe] = c.useState(), [L, W] = c.useState(), D = ce(() => {
|
|
1427
|
+
function P(Q) {
|
|
1428
|
+
if (l) {
|
|
1429
|
+
var re;
|
|
1430
|
+
(re = Q.id) != null && re.endsWith("-fui-option") && (Q.id = i + "-" + Math.random().toString(16).slice(2, 10)), pe(Q.id), u == null || u.events.emit("virtualfocus", Q), _ && (_.current = Q);
|
|
1431
|
+
} else
|
|
1432
|
+
Me(Q, {
|
|
1433
|
+
sync: U.current,
|
|
1434
|
+
preventScroll: !0
|
|
1435
|
+
});
|
|
1557
1436
|
}
|
|
1558
|
-
const
|
|
1559
|
-
|
|
1560
|
-
const
|
|
1561
|
-
if (!
|
|
1562
|
-
|
|
1563
|
-
const
|
|
1564
|
-
|
|
1437
|
+
const A = s.current[d.current], C = N.current;
|
|
1438
|
+
A && P(A), (U.current ? (Q) => Q() : requestAnimationFrame)(() => {
|
|
1439
|
+
const Q = s.current[d.current] || A;
|
|
1440
|
+
if (!Q) return;
|
|
1441
|
+
A || P(Q);
|
|
1442
|
+
const re = Z.current;
|
|
1443
|
+
re && te && (C || !O.current) && (Q.scrollIntoView == null || Q.scrollIntoView(typeof re == "boolean" ? {
|
|
1565
1444
|
block: "nearest",
|
|
1566
1445
|
inline: "nearest"
|
|
1567
|
-
} :
|
|
1446
|
+
} : re));
|
|
1568
1447
|
});
|
|
1569
1448
|
});
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
}, []), G(() => {
|
|
1577
|
-
v && (n && o.floating ? w.current && f != null && (ne.current = !0, y.current = f, I(f)) : C.current && (y.current = -1, d.current(null)));
|
|
1578
|
-
}, [v, n, o.floating, f, I]), G(() => {
|
|
1579
|
-
if (v && n && o.floating)
|
|
1580
|
-
if (i == null) {
|
|
1581
|
-
if (H.current = !1, D.current != null)
|
|
1449
|
+
ee(() => {
|
|
1450
|
+
m && (r && o.floating ? y.current && R != null && (N.current = !0, d.current = R, p()) : S.current && (d.current = -1, G.current()));
|
|
1451
|
+
}, [m, r, o.floating, R, p]), ee(() => {
|
|
1452
|
+
if (m && r && o.floating)
|
|
1453
|
+
if (a == null) {
|
|
1454
|
+
if (U.current = !1, J.current != null)
|
|
1582
1455
|
return;
|
|
1583
|
-
if (
|
|
1584
|
-
let
|
|
1585
|
-
const
|
|
1586
|
-
s.current[0] == null ? (
|
|
1456
|
+
if (S.current && (d.current = -1, D()), (!M.current || !S.current) && y.current && (I.current != null || y.current === !0 && I.current == null)) {
|
|
1457
|
+
let P = 0;
|
|
1458
|
+
const A = () => {
|
|
1459
|
+
s.current[0] == null ? (P < 2 && (P ? requestAnimationFrame : queueMicrotask)(A), P++) : (d.current = I.current == null || dt(I.current, T, v) || f ? tt(s, ne.current) : It(s, ne.current), I.current = null, p());
|
|
1587
1460
|
};
|
|
1588
|
-
|
|
1461
|
+
A();
|
|
1589
1462
|
}
|
|
1590
|
-
} else
|
|
1591
|
-
}, [
|
|
1592
|
-
var
|
|
1593
|
-
if (!
|
|
1463
|
+
} else xt(s, a) || (d.current = a, D(), N.current = !1);
|
|
1464
|
+
}, [m, r, o.floating, a, J, f, s, T, v, p, D, ne]), ee(() => {
|
|
1465
|
+
var P;
|
|
1466
|
+
if (!m || o.floating || !u || l || !S.current)
|
|
1594
1467
|
return;
|
|
1595
|
-
const
|
|
1596
|
-
|
|
1468
|
+
const A = u.nodesRef.current, C = (P = A.find((re) => re.id === F)) == null || (P = P.context) == null ? void 0 : P.elements.floating, Y = we(ge(o.floating)), Q = A.some((re) => re.context && ae(re.context.elements.floating, Y));
|
|
1469
|
+
C && !Q && O.current && C.focus({
|
|
1597
1470
|
preventScroll: !0
|
|
1598
1471
|
});
|
|
1599
|
-
}, [
|
|
1600
|
-
if (!
|
|
1601
|
-
function
|
|
1602
|
-
|
|
1472
|
+
}, [m, o.floating, u, F, l]), ee(() => {
|
|
1473
|
+
if (!m || !u || !l || F) return;
|
|
1474
|
+
function P(A) {
|
|
1475
|
+
W(A.id), _ && (_.current = A);
|
|
1603
1476
|
}
|
|
1604
|
-
return
|
|
1605
|
-
|
|
1477
|
+
return u.events.on("virtualfocus", P), () => {
|
|
1478
|
+
u.events.off("virtualfocus", P);
|
|
1606
1479
|
};
|
|
1607
|
-
}, [
|
|
1608
|
-
|
|
1609
|
-
}),
|
|
1610
|
-
|
|
1611
|
-
}, [
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
const z = s.current.indexOf(S);
|
|
1618
|
-
z !== -1 && I(z);
|
|
1480
|
+
}, [m, u, l, F, _]), ee(() => {
|
|
1481
|
+
G.current = p, M.current = r, S.current = !!o.floating;
|
|
1482
|
+
}), ee(() => {
|
|
1483
|
+
r || (I.current = null, y.current = w);
|
|
1484
|
+
}, [r, w]);
|
|
1485
|
+
const z = a != null, te = c.useMemo(() => {
|
|
1486
|
+
function P(C) {
|
|
1487
|
+
if (!se.current) return;
|
|
1488
|
+
const Y = s.current.indexOf(C);
|
|
1489
|
+
Y !== -1 && d.current !== Y && (d.current = Y, p());
|
|
1619
1490
|
}
|
|
1620
1491
|
return {
|
|
1621
|
-
onFocus(
|
|
1492
|
+
onFocus(C) {
|
|
1622
1493
|
let {
|
|
1623
|
-
currentTarget:
|
|
1624
|
-
} =
|
|
1625
|
-
|
|
1494
|
+
currentTarget: Y
|
|
1495
|
+
} = C;
|
|
1496
|
+
U.current = !0, P(Y);
|
|
1626
1497
|
},
|
|
1627
|
-
onClick: (
|
|
1498
|
+
onClick: (C) => {
|
|
1628
1499
|
let {
|
|
1629
|
-
currentTarget:
|
|
1630
|
-
} =
|
|
1631
|
-
return
|
|
1500
|
+
currentTarget: Y
|
|
1501
|
+
} = C;
|
|
1502
|
+
return Y.focus({
|
|
1632
1503
|
preventScroll: !0
|
|
1633
1504
|
});
|
|
1634
1505
|
},
|
|
1635
1506
|
// Safari
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1507
|
+
onMouseMove(C) {
|
|
1508
|
+
let {
|
|
1509
|
+
currentTarget: Y
|
|
1510
|
+
} = C;
|
|
1511
|
+
U.current = !0, N.current = !1, k && P(Y);
|
|
1512
|
+
},
|
|
1513
|
+
onPointerLeave(C) {
|
|
1514
|
+
let {
|
|
1515
|
+
pointerType: Y
|
|
1516
|
+
} = C;
|
|
1517
|
+
if (!(!O.current || Y === "touch") && (U.current = !0, !!k && (d.current = -1, p(), !l))) {
|
|
1518
|
+
var Q;
|
|
1519
|
+
(Q = X.current) == null || Q.focus({
|
|
1648
1520
|
preventScroll: !0
|
|
1649
|
-
})
|
|
1521
|
+
});
|
|
1650
1522
|
}
|
|
1651
1523
|
}
|
|
1652
1524
|
};
|
|
1653
|
-
}, [
|
|
1654
|
-
|
|
1525
|
+
}, [se, X, k, s, p, l]), V = c.useCallback(() => {
|
|
1526
|
+
var P;
|
|
1527
|
+
return $ ?? (u == null || (P = u.nodesRef.current.find((A) => A.id === F)) == null || (P = P.context) == null || (P = P.dataRef) == null ? void 0 : P.current.orientation);
|
|
1528
|
+
}, [F, u, $]), de = ce((P) => {
|
|
1529
|
+
if (O.current = !1, U.current = !0, P.which === 229 || !se.current && P.currentTarget === X.current)
|
|
1655
1530
|
return;
|
|
1656
|
-
if (
|
|
1657
|
-
|
|
1531
|
+
if (f && qt(P.key, T, v, H)) {
|
|
1532
|
+
Ue(P.key, V()) || he(P), n(!1, P.nativeEvent, "list-navigation"), ye(o.domReference) && (l ? u == null || u.events.emit("virtualfocus", o.domReference) : o.domReference.focus());
|
|
1658
1533
|
return;
|
|
1659
1534
|
}
|
|
1660
|
-
const
|
|
1661
|
-
if (
|
|
1662
|
-
const
|
|
1535
|
+
const A = d.current, C = tt(s, h), Y = It(s, h);
|
|
1536
|
+
if (K || (P.key === "Home" && (he(P), d.current = C, p()), P.key === "End" && (he(P), d.current = Y, p())), H > 1) {
|
|
1537
|
+
const Q = oe || Array.from({
|
|
1663
1538
|
length: s.current.length
|
|
1664
1539
|
}, () => ({
|
|
1665
1540
|
width: 1,
|
|
1666
1541
|
height: 1
|
|
1667
|
-
})),
|
|
1668
|
-
current:
|
|
1542
|
+
})), re = vn(Q, H, j), Le = re.findIndex((be) => be != null && !rt(s, be, h)), He = re.reduce((be, Ce, Be) => Ce != null && !rt(s, Ce, h) ? Be : be, -1), Fe = re[bn({
|
|
1543
|
+
current: re.map((be) => be != null ? s.current[be] : null)
|
|
1669
1544
|
}, {
|
|
1670
|
-
event:
|
|
1671
|
-
orientation:
|
|
1672
|
-
loop:
|
|
1673
|
-
rtl:
|
|
1674
|
-
cols:
|
|
1545
|
+
event: P,
|
|
1546
|
+
orientation: T,
|
|
1547
|
+
loop: E,
|
|
1548
|
+
rtl: v,
|
|
1549
|
+
cols: H,
|
|
1675
1550
|
// treat undefined (empty grid spaces) as disabled indices so we
|
|
1676
1551
|
// don't end up in them
|
|
1677
|
-
disabledIndices: hn([...
|
|
1678
|
-
minIndex:
|
|
1679
|
-
maxIndex:
|
|
1680
|
-
prevIndex:
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1552
|
+
disabledIndices: hn([...(typeof h != "function" ? h : null) || s.current.map((be, Ce) => rt(s, Ce, h) ? Ce : void 0), void 0], re),
|
|
1553
|
+
minIndex: Le,
|
|
1554
|
+
maxIndex: He,
|
|
1555
|
+
prevIndex: Rn(
|
|
1556
|
+
d.current > Y ? C : d.current,
|
|
1557
|
+
Q,
|
|
1558
|
+
re,
|
|
1559
|
+
H,
|
|
1685
1560
|
// use a corner matching the edge closest to the direction
|
|
1686
1561
|
// we're moving in so we don't end up in the same item. Prefer
|
|
1687
1562
|
// top/left over bottom/right.
|
|
1688
|
-
|
|
1563
|
+
P.key === Je ? "bl" : P.key === (v ? _e : Ke) ? "tr" : "tl"
|
|
1689
1564
|
),
|
|
1690
1565
|
stopEvent: !0
|
|
1691
1566
|
})];
|
|
1692
|
-
if (
|
|
1567
|
+
if (Fe != null && (d.current = Fe, p()), T === "both")
|
|
1693
1568
|
return;
|
|
1694
1569
|
}
|
|
1695
|
-
if (
|
|
1696
|
-
if (
|
|
1697
|
-
|
|
1570
|
+
if (Ue(P.key, T)) {
|
|
1571
|
+
if (he(P), r && !l && we(P.currentTarget.ownerDocument) === P.currentTarget) {
|
|
1572
|
+
d.current = dt(P.key, T, v) ? C : Y, p();
|
|
1698
1573
|
return;
|
|
1699
1574
|
}
|
|
1700
|
-
|
|
1701
|
-
startingIndex:
|
|
1702
|
-
disabledIndices:
|
|
1703
|
-
}) :
|
|
1704
|
-
startingIndex:
|
|
1705
|
-
disabledIndices:
|
|
1706
|
-
})) :
|
|
1707
|
-
startingIndex:
|
|
1575
|
+
dt(P.key, T, v) ? E ? d.current = A >= Y ? x && A !== s.current.length ? -1 : C : qe(s, {
|
|
1576
|
+
startingIndex: A,
|
|
1577
|
+
disabledIndices: h
|
|
1578
|
+
}) : d.current = Math.min(Y, qe(s, {
|
|
1579
|
+
startingIndex: A,
|
|
1580
|
+
disabledIndices: h
|
|
1581
|
+
})) : E ? d.current = A <= C ? x && A !== -1 ? s.current.length : Y : qe(s, {
|
|
1582
|
+
startingIndex: A,
|
|
1708
1583
|
decrement: !0,
|
|
1709
|
-
disabledIndices:
|
|
1710
|
-
}) :
|
|
1711
|
-
startingIndex:
|
|
1584
|
+
disabledIndices: h
|
|
1585
|
+
}) : d.current = Math.max(C, qe(s, {
|
|
1586
|
+
startingIndex: A,
|
|
1712
1587
|
decrement: !0,
|
|
1713
|
-
disabledIndices:
|
|
1714
|
-
})),
|
|
1588
|
+
disabledIndices: h
|
|
1589
|
+
})), xt(s, d.current) && (d.current = -1), p();
|
|
1715
1590
|
}
|
|
1716
|
-
}),
|
|
1717
|
-
"aria-activedescendant":
|
|
1718
|
-
}, [
|
|
1719
|
-
"aria-orientation":
|
|
1720
|
-
|
|
1721
|
-
onKeyDown:
|
|
1591
|
+
}), ue = c.useMemo(() => l && r && z && {
|
|
1592
|
+
"aria-activedescendant": L || ie
|
|
1593
|
+
}, [l, r, z, L, ie]), le = c.useMemo(() => ({
|
|
1594
|
+
"aria-orientation": T === "both" ? void 0 : T,
|
|
1595
|
+
...K ? {} : ue,
|
|
1596
|
+
onKeyDown: de,
|
|
1722
1597
|
onPointerMove() {
|
|
1723
|
-
|
|
1598
|
+
O.current = !0;
|
|
1724
1599
|
}
|
|
1725
|
-
}), [
|
|
1726
|
-
function
|
|
1727
|
-
|
|
1600
|
+
}), [ue, de, T, K]), Ee = c.useMemo(() => {
|
|
1601
|
+
function P(C) {
|
|
1602
|
+
w === "auto" && Gt(C.nativeEvent) && (y.current = !0);
|
|
1728
1603
|
}
|
|
1729
|
-
function
|
|
1730
|
-
|
|
1604
|
+
function A(C) {
|
|
1605
|
+
y.current = w, w === "auto" && jt(C.nativeEvent) && (y.current = !0);
|
|
1731
1606
|
}
|
|
1732
1607
|
return {
|
|
1733
|
-
...
|
|
1734
|
-
onKeyDown(
|
|
1735
|
-
|
|
1736
|
-
const
|
|
1737
|
-
if (
|
|
1738
|
-
const
|
|
1739
|
-
if (
|
|
1740
|
-
const
|
|
1741
|
-
key:
|
|
1608
|
+
...ue,
|
|
1609
|
+
onKeyDown(C) {
|
|
1610
|
+
O.current = !1;
|
|
1611
|
+
const Y = C.key.startsWith("Arrow"), Q = ["Home", "End"].includes(C.key), re = Y || Q, Le = Yt(C.key, T, v), He = qt(C.key, T, v, H), Fe = Yt(C.key, V(), v), be = Ue(C.key, T), Ce = (f ? Fe : be) || C.key === "Enter" || C.key.trim() === "";
|
|
1612
|
+
if (l && r) {
|
|
1613
|
+
const $e = u == null ? void 0 : u.nodesRef.current.find((Ye) => Ye.parentId == null), Ie = u && $e ? fn(u.nodesRef.current, $e.id) : null;
|
|
1614
|
+
if (re && Ie && _) {
|
|
1615
|
+
const Ye = new KeyboardEvent("keydown", {
|
|
1616
|
+
key: C.key,
|
|
1742
1617
|
bubbles: !0
|
|
1743
1618
|
});
|
|
1744
|
-
if (
|
|
1745
|
-
var
|
|
1746
|
-
const
|
|
1747
|
-
|
|
1619
|
+
if (Le || He) {
|
|
1620
|
+
var Be, Rt;
|
|
1621
|
+
const an = ((Be = Ie.context) == null ? void 0 : Be.elements.domReference) === C.currentTarget, Et = He && !an ? (Rt = Ie.context) == null ? void 0 : Rt.elements.domReference : Le ? s.current.find((yt) => (yt == null ? void 0 : yt.id) === ie) : null;
|
|
1622
|
+
Et && (he(C), Et.dispatchEvent(Ye), W(void 0));
|
|
1748
1623
|
}
|
|
1749
|
-
if ((
|
|
1750
|
-
var
|
|
1751
|
-
|
|
1624
|
+
if ((be || Q) && Ie.context && Ie.context.open && Ie.parentId && C.currentTarget !== Ie.context.elements.domReference) {
|
|
1625
|
+
var ht;
|
|
1626
|
+
he(C), (ht = Ie.context.elements.domReference) == null || ht.dispatchEvent(Ye);
|
|
1752
1627
|
return;
|
|
1753
1628
|
}
|
|
1754
1629
|
}
|
|
1755
|
-
return
|
|
1630
|
+
return de(C);
|
|
1756
1631
|
}
|
|
1757
|
-
if (!(!
|
|
1758
|
-
if (
|
|
1759
|
-
|
|
1632
|
+
if (!(!r && !b && Y)) {
|
|
1633
|
+
if (Ce) {
|
|
1634
|
+
const $e = Ue(C.key, V());
|
|
1635
|
+
I.current = f && $e ? null : C.key;
|
|
1636
|
+
}
|
|
1637
|
+
if (f) {
|
|
1638
|
+
Fe && (he(C), r ? (d.current = tt(s, ne.current), p()) : n(!0, C.nativeEvent, "list-navigation"));
|
|
1760
1639
|
return;
|
|
1761
1640
|
}
|
|
1762
|
-
|
|
1641
|
+
be && (R != null && (d.current = R), he(C), !r && b ? n(!0, C.nativeEvent, "list-navigation") : de(C), r && p());
|
|
1763
1642
|
}
|
|
1764
1643
|
},
|
|
1765
1644
|
onFocus() {
|
|
1766
|
-
|
|
1645
|
+
r && !l && (d.current = -1, p());
|
|
1767
1646
|
},
|
|
1768
|
-
onPointerDown:
|
|
1769
|
-
|
|
1770
|
-
|
|
1647
|
+
onPointerDown: A,
|
|
1648
|
+
onPointerEnter: A,
|
|
1649
|
+
onMouseDown: P,
|
|
1650
|
+
onClick: P
|
|
1771
1651
|
};
|
|
1772
|
-
}, [
|
|
1773
|
-
return
|
|
1774
|
-
reference:
|
|
1775
|
-
floating:
|
|
1776
|
-
item:
|
|
1777
|
-
} : {}, [
|
|
1652
|
+
}, [ie, ue, H, de, ne, w, s, f, p, n, r, b, T, V, v, R, u, l, _]);
|
|
1653
|
+
return c.useMemo(() => m ? {
|
|
1654
|
+
reference: Ee,
|
|
1655
|
+
floating: le,
|
|
1656
|
+
item: te
|
|
1657
|
+
} : {}, [m, Ee, le, te]);
|
|
1778
1658
|
}
|
|
1779
|
-
const
|
|
1780
|
-
function
|
|
1781
|
-
var n;
|
|
1782
|
-
|
|
1659
|
+
const tr = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
|
|
1660
|
+
function yr(e, t) {
|
|
1661
|
+
var r, n;
|
|
1662
|
+
t === void 0 && (t = {});
|
|
1783
1663
|
const {
|
|
1784
|
-
open:
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1664
|
+
open: o,
|
|
1665
|
+
elements: i,
|
|
1666
|
+
floatingId: s
|
|
1667
|
+
} = e, {
|
|
1668
|
+
enabled: a = !0,
|
|
1669
|
+
role: g = "dialog"
|
|
1670
|
+
} = t, m = We(), R = ((r = i.domReference) == null ? void 0 : r.id) || m, x = c.useMemo(() => {
|
|
1671
|
+
var b;
|
|
1672
|
+
return ((b = Qe(i.floating)) == null ? void 0 : b.id) || s;
|
|
1673
|
+
}, [i.floating, s]), E = (n = tr.get(g)) != null ? n : g, v = Ve() != null, l = c.useMemo(() => E === "tooltip" || g === "label" ? {
|
|
1674
|
+
["aria-" + (g === "label" ? "labelledby" : "describedby")]: o ? x : void 0
|
|
1791
1675
|
} : {
|
|
1792
|
-
"aria-expanded":
|
|
1793
|
-
"aria-haspopup":
|
|
1794
|
-
"aria-controls":
|
|
1795
|
-
...
|
|
1676
|
+
"aria-expanded": o ? "true" : "false",
|
|
1677
|
+
"aria-haspopup": E === "alertdialog" ? "dialog" : E,
|
|
1678
|
+
"aria-controls": o ? x : void 0,
|
|
1679
|
+
...E === "listbox" && {
|
|
1796
1680
|
role: "combobox"
|
|
1797
1681
|
},
|
|
1798
|
-
...
|
|
1799
|
-
id:
|
|
1682
|
+
...E === "menu" && {
|
|
1683
|
+
id: R
|
|
1800
1684
|
},
|
|
1801
|
-
...
|
|
1685
|
+
...E === "menu" && v && {
|
|
1802
1686
|
role: "menuitem"
|
|
1803
1687
|
},
|
|
1804
|
-
...
|
|
1688
|
+
...g === "select" && {
|
|
1805
1689
|
"aria-autocomplete": "none"
|
|
1806
1690
|
},
|
|
1807
|
-
...
|
|
1691
|
+
...g === "combobox" && {
|
|
1808
1692
|
"aria-autocomplete": "list"
|
|
1809
1693
|
}
|
|
1810
|
-
}, [
|
|
1811
|
-
const
|
|
1812
|
-
id:
|
|
1813
|
-
...
|
|
1814
|
-
role:
|
|
1694
|
+
}, [E, x, v, o, R, g]), w = c.useMemo(() => {
|
|
1695
|
+
const b = {
|
|
1696
|
+
id: x,
|
|
1697
|
+
...E && {
|
|
1698
|
+
role: E
|
|
1815
1699
|
}
|
|
1816
1700
|
};
|
|
1817
|
-
return
|
|
1818
|
-
...
|
|
1819
|
-
...
|
|
1820
|
-
"aria-labelledby":
|
|
1701
|
+
return E === "tooltip" || g === "label" ? b : {
|
|
1702
|
+
...b,
|
|
1703
|
+
...E === "menu" && {
|
|
1704
|
+
"aria-labelledby": R
|
|
1821
1705
|
}
|
|
1822
1706
|
};
|
|
1823
|
-
}, [
|
|
1707
|
+
}, [E, x, R, g]), k = c.useCallback((b) => {
|
|
1824
1708
|
let {
|
|
1825
|
-
active:
|
|
1826
|
-
selected:
|
|
1827
|
-
} =
|
|
1828
|
-
const
|
|
1709
|
+
active: h,
|
|
1710
|
+
selected: T
|
|
1711
|
+
} = b;
|
|
1712
|
+
const $ = {
|
|
1829
1713
|
role: "option",
|
|
1830
|
-
...
|
|
1831
|
-
id:
|
|
1714
|
+
...h && {
|
|
1715
|
+
id: x + "-fui-option"
|
|
1832
1716
|
}
|
|
1833
1717
|
};
|
|
1834
|
-
switch (
|
|
1718
|
+
switch (g) {
|
|
1835
1719
|
case "select":
|
|
1836
|
-
return {
|
|
1837
|
-
...A,
|
|
1838
|
-
"aria-selected": a && k
|
|
1839
|
-
};
|
|
1840
1720
|
case "combobox":
|
|
1841
1721
|
return {
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
"aria-selected": !0
|
|
1845
|
-
}
|
|
1722
|
+
...$,
|
|
1723
|
+
"aria-selected": T
|
|
1846
1724
|
};
|
|
1847
1725
|
}
|
|
1848
1726
|
return {};
|
|
1849
|
-
}, [
|
|
1850
|
-
return
|
|
1851
|
-
reference:
|
|
1852
|
-
floating:
|
|
1853
|
-
item:
|
|
1854
|
-
} : {}, [
|
|
1727
|
+
}, [x, g]);
|
|
1728
|
+
return c.useMemo(() => a ? {
|
|
1729
|
+
reference: l,
|
|
1730
|
+
floating: w,
|
|
1731
|
+
item: k
|
|
1732
|
+
} : {}, [a, l, w, k]);
|
|
1855
1733
|
}
|
|
1856
|
-
function
|
|
1857
|
-
|
|
1734
|
+
function ln(e, t, r) {
|
|
1735
|
+
return r === void 0 && (r = !0), e.filter((o) => {
|
|
1736
|
+
var i;
|
|
1737
|
+
return o.parentId === t && (!r || ((i = o.context) == null ? void 0 : i.open));
|
|
1738
|
+
}).flatMap((o) => [o, ...ln(e, o.id, r)]);
|
|
1739
|
+
}
|
|
1740
|
+
function Xt(e, t) {
|
|
1741
|
+
const [r, n] = e;
|
|
1858
1742
|
let o = !1;
|
|
1859
|
-
const
|
|
1860
|
-
for (let
|
|
1861
|
-
const [
|
|
1862
|
-
|
|
1743
|
+
const i = t.length;
|
|
1744
|
+
for (let s = 0, a = i - 1; s < i; a = s++) {
|
|
1745
|
+
const [g, m] = t[s] || [0, 0], [R, x] = t[a] || [0, 0];
|
|
1746
|
+
m >= n != x >= n && r <= (R - g) * (n - m) / (x - m) + g && (o = !o);
|
|
1863
1747
|
}
|
|
1864
1748
|
return o;
|
|
1865
1749
|
}
|
|
1866
|
-
function
|
|
1867
|
-
return
|
|
1750
|
+
function nr(e, t) {
|
|
1751
|
+
return e[0] >= t.x && e[0] <= t.x + t.width && e[1] >= t.y && e[1] <= t.y + t.height;
|
|
1868
1752
|
}
|
|
1869
|
-
function
|
|
1870
|
-
|
|
1753
|
+
function wr(e) {
|
|
1754
|
+
e === void 0 && (e = {});
|
|
1871
1755
|
const {
|
|
1872
|
-
buffer:
|
|
1873
|
-
blockPointerEvents:
|
|
1874
|
-
requireIntent:
|
|
1875
|
-
} =
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1756
|
+
buffer: t = 0.5,
|
|
1757
|
+
blockPointerEvents: r = !1,
|
|
1758
|
+
requireIntent: n = !0
|
|
1759
|
+
} = e, o = {
|
|
1760
|
+
current: -1
|
|
1761
|
+
};
|
|
1762
|
+
let i = !1, s = null, a = null, g = typeof performance < "u" ? performance.now() : 0;
|
|
1763
|
+
function m(x, E) {
|
|
1764
|
+
const f = performance.now(), v = f - g;
|
|
1765
|
+
if (s === null || a === null || v === 0)
|
|
1766
|
+
return s = x, a = E, g = f, null;
|
|
1767
|
+
const l = x - s, w = E - a, b = Math.sqrt(l * l + w * w) / v;
|
|
1768
|
+
return s = x, a = E, g = f, b;
|
|
1883
1769
|
}
|
|
1884
|
-
const
|
|
1770
|
+
const R = (x) => {
|
|
1885
1771
|
let {
|
|
1886
|
-
x:
|
|
1887
|
-
y:
|
|
1888
|
-
placement:
|
|
1889
|
-
elements:
|
|
1890
|
-
onClose:
|
|
1891
|
-
nodeId:
|
|
1892
|
-
tree:
|
|
1893
|
-
} =
|
|
1894
|
-
return function(
|
|
1895
|
-
function
|
|
1896
|
-
|
|
1772
|
+
x: E,
|
|
1773
|
+
y: f,
|
|
1774
|
+
placement: v,
|
|
1775
|
+
elements: l,
|
|
1776
|
+
onClose: w,
|
|
1777
|
+
nodeId: k,
|
|
1778
|
+
tree: b
|
|
1779
|
+
} = x;
|
|
1780
|
+
return function(T) {
|
|
1781
|
+
function $() {
|
|
1782
|
+
me(o), w();
|
|
1897
1783
|
}
|
|
1898
|
-
if (
|
|
1784
|
+
if (me(o), !l.domReference || !l.floating || v == null || E == null || f == null)
|
|
1899
1785
|
return;
|
|
1900
1786
|
const {
|
|
1901
|
-
clientX:
|
|
1902
|
-
clientY:
|
|
1903
|
-
} =
|
|
1904
|
-
if (
|
|
1787
|
+
clientX: H,
|
|
1788
|
+
clientY: B
|
|
1789
|
+
} = T, _ = [H, B], oe = Wn(T), j = T.type === "mouseleave", q = ct(l.floating, oe), X = ct(l.domReference, oe), F = l.domReference.getBoundingClientRect(), u = l.floating.getBoundingClientRect(), p = v.split("-")[0], K = E > u.right - u.width / 2, y = f > u.bottom - u.height / 2, d = nr(_, F), I = u.width > F.width, O = u.height > F.height, G = (I ? F : u).left, S = (I ? F : u).right, M = (O ? F : u).top, U = (O ? F : u).bottom;
|
|
1790
|
+
if (q && (i = !0, !j))
|
|
1905
1791
|
return;
|
|
1906
|
-
if (
|
|
1907
|
-
|
|
1792
|
+
if (X && (i = !1), X && !j) {
|
|
1793
|
+
i = !0;
|
|
1908
1794
|
return;
|
|
1909
1795
|
}
|
|
1910
|
-
if (
|
|
1911
|
-
let {
|
|
1912
|
-
context: P
|
|
1913
|
-
} = D;
|
|
1914
|
-
return P == null ? void 0 : P.open;
|
|
1915
|
-
}))
|
|
1796
|
+
if (j && fe(T.relatedTarget) && ct(l.floating, T.relatedTarget) || b && ln(b.nodesRef.current, k).length)
|
|
1916
1797
|
return;
|
|
1917
|
-
if (
|
|
1918
|
-
return
|
|
1919
|
-
let
|
|
1920
|
-
switch (
|
|
1798
|
+
if (p === "top" && f >= F.bottom - 1 || p === "bottom" && f <= F.top + 1 || p === "left" && E >= F.right - 1 || p === "right" && E <= F.left + 1)
|
|
1799
|
+
return $();
|
|
1800
|
+
let N = [];
|
|
1801
|
+
switch (p) {
|
|
1921
1802
|
case "top":
|
|
1922
|
-
|
|
1803
|
+
N = [[G, F.top + 1], [G, u.bottom - 1], [S, u.bottom - 1], [S, F.top + 1]];
|
|
1923
1804
|
break;
|
|
1924
1805
|
case "bottom":
|
|
1925
|
-
|
|
1806
|
+
N = [[G, u.top + 1], [G, F.bottom - 1], [S, F.bottom - 1], [S, u.top + 1]];
|
|
1926
1807
|
break;
|
|
1927
1808
|
case "left":
|
|
1928
|
-
|
|
1809
|
+
N = [[u.right - 1, U], [u.right - 1, M], [F.left + 1, M], [F.left + 1, U]];
|
|
1929
1810
|
break;
|
|
1930
1811
|
case "right":
|
|
1931
|
-
|
|
1812
|
+
N = [[F.right - 1, U], [F.right - 1, M], [u.left + 1, M], [u.left + 1, U]];
|
|
1932
1813
|
break;
|
|
1933
1814
|
}
|
|
1934
|
-
function
|
|
1935
|
-
let [
|
|
1936
|
-
switch (
|
|
1815
|
+
function ne(se) {
|
|
1816
|
+
let [Z, J] = se;
|
|
1817
|
+
switch (p) {
|
|
1937
1818
|
case "top": {
|
|
1938
|
-
const
|
|
1939
|
-
return [
|
|
1819
|
+
const ie = [I ? Z + t / 2 : K ? Z + t * 4 : Z - t * 4, J + t + 1], pe = [I ? Z - t / 2 : K ? Z + t * 4 : Z - t * 4, J + t + 1], L = [[u.left, K || I ? u.bottom - t : u.top], [u.right, K ? I ? u.bottom - t : u.top : u.bottom - t]];
|
|
1820
|
+
return [ie, pe, ...L];
|
|
1940
1821
|
}
|
|
1941
1822
|
case "bottom": {
|
|
1942
|
-
const
|
|
1943
|
-
return [
|
|
1823
|
+
const ie = [I ? Z + t / 2 : K ? Z + t * 4 : Z - t * 4, J - t], pe = [I ? Z - t / 2 : K ? Z + t * 4 : Z - t * 4, J - t], L = [[u.left, K || I ? u.top + t : u.bottom], [u.right, K ? I ? u.top + t : u.bottom : u.top + t]];
|
|
1824
|
+
return [ie, pe, ...L];
|
|
1944
1825
|
}
|
|
1945
1826
|
case "left": {
|
|
1946
|
-
const
|
|
1947
|
-
return [...[[
|
|
1827
|
+
const ie = [Z + t + 1, O ? J + t / 2 : y ? J + t * 4 : J - t * 4], pe = [Z + t + 1, O ? J - t / 2 : y ? J + t * 4 : J - t * 4];
|
|
1828
|
+
return [...[[y || O ? u.right - t : u.left, u.top], [y ? O ? u.right - t : u.left : u.right - t, u.bottom]], ie, pe];
|
|
1948
1829
|
}
|
|
1949
1830
|
case "right": {
|
|
1950
|
-
const
|
|
1951
|
-
return [
|
|
1831
|
+
const ie = [Z - t, O ? J + t / 2 : y ? J + t * 4 : J - t * 4], pe = [Z - t, O ? J - t / 2 : y ? J + t * 4 : J - t * 4], L = [[y || O ? u.left + t : u.right, u.top], [y ? O ? u.left + t : u.right : u.left + t, u.bottom]];
|
|
1832
|
+
return [ie, pe, ...L];
|
|
1952
1833
|
}
|
|
1953
1834
|
}
|
|
1954
1835
|
}
|
|
1955
|
-
if (!
|
|
1956
|
-
if (
|
|
1957
|
-
return
|
|
1958
|
-
if (
|
|
1959
|
-
const
|
|
1960
|
-
if (
|
|
1961
|
-
return
|
|
1836
|
+
if (!Xt([H, B], N)) {
|
|
1837
|
+
if (i && !d)
|
|
1838
|
+
return $();
|
|
1839
|
+
if (!j && n) {
|
|
1840
|
+
const se = m(T.clientX, T.clientY);
|
|
1841
|
+
if (se !== null && se < 0.1)
|
|
1842
|
+
return $();
|
|
1962
1843
|
}
|
|
1963
|
-
|
|
1844
|
+
Xt([H, B], ne([E, f])) ? !i && n && (o.current = window.setTimeout($, 40)) : $();
|
|
1964
1845
|
}
|
|
1965
1846
|
};
|
|
1966
1847
|
};
|
|
1967
|
-
return
|
|
1968
|
-
blockPointerEvents:
|
|
1969
|
-
},
|
|
1848
|
+
return R.__options = {
|
|
1849
|
+
blockPointerEvents: r
|
|
1850
|
+
}, R;
|
|
1970
1851
|
}
|
|
1971
1852
|
export {
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1853
|
+
lr as FloatingArrow,
|
|
1854
|
+
mr as FloatingFocusManager,
|
|
1855
|
+
pr as FloatingOverlay,
|
|
1856
|
+
dr as FloatingPortal,
|
|
1857
|
+
Tr as arrow,
|
|
1858
|
+
Cr as flip,
|
|
1859
|
+
ot as getOverflowAncestors,
|
|
1860
|
+
Mr as offset,
|
|
1861
|
+
wr as safePolygon,
|
|
1862
|
+
Pr as shift,
|
|
1863
|
+
kr as size,
|
|
1864
|
+
gr as useClick,
|
|
1865
|
+
vr as useDismiss,
|
|
1866
|
+
br as useFloating,
|
|
1867
|
+
ar as useFloatingNodeId,
|
|
1868
|
+
Ve as useFloatingParentNodeId,
|
|
1869
|
+
qn as useFloatingPortalNode,
|
|
1870
|
+
Jn as useFloatingRootContext,
|
|
1871
|
+
Oe as useFloatingTree,
|
|
1872
|
+
Rr as useFocus,
|
|
1873
|
+
fr as useHover,
|
|
1874
|
+
We as useId,
|
|
1875
|
+
hr as useInteractions,
|
|
1876
|
+
Er as useListNavigation,
|
|
1877
|
+
cr as useMergeRefs,
|
|
1878
|
+
yr as useRole
|
|
1998
1879
|
};
|