@stihl-design-system/components 1.0.0-RC.34 → 1.0.0-RC.35
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/{actionbutton.DLQJU6AV.js → actionbutton.Du5CT-Mt.js} +2 -2
- package/{actionlink.DEBrWfN3.js → actionlink.BK9CaQUY.js} +2 -2
- package/assets/Button.CmeGVEAY.css +1 -0
- package/assets/CustomReactSelect.BihX36Uo.css +1 -0
- package/assets/Fieldset.Oqu7pOBv.css +1 -0
- package/assets/InputFile.D7Ihod7B.css +1 -0
- package/assets/InputNumber.z_UqRYdv.css +1 -0
- package/assets/InputPassword.DZENjxJ9.css +1 -0
- package/assets/InputSearch.GBH9Eh6F.css +1 -0
- package/assets/LinkButton.88j5ckLu.css +1 -0
- package/assets/Select.CL0fqx7X.css +1 -0
- package/assets/Slider.DWLuIsNj.css +1 -0
- package/assets/Textarea.B1HOakic.css +1 -0
- package/assets/buttonround.DBpMesfr.css +1 -0
- package/assets/input.RPDR8qdT.css +1 -0
- package/{banner.CI5HnDqD.js → banner.D-RX60nJ.js} +1 -1
- package/{breadcrumb.CtwAux3P.js → breadcrumb.tvMByFgp.js} +3 -3
- package/button.CZupaV9L.js +12 -0
- package/buttonround.9IS0tUqw.js +96 -0
- package/{checkbox.DwccD0Mp.js → checkbox.XYQI-ubx.js} +2 -2
- package/{checkboxgroup.ZiUFfCJ1.js → checkboxgroup.CjnNJ8e6.js} +2 -2
- package/{chip.B0s_fS8L.js → chip.B-pxhsdb.js} +2 -2
- package/{chipgroup.Dpu66bo5.js → chipgroup.cGjn4LVV.js} +2 -2
- package/chunks/{ActionButton.DOYsEHPr.js → ActionButton.BOYQYo5M.js} +1 -1
- package/chunks/{ActionLink.DbyciN3Y.js → ActionLink.BlwvrnPN.js} +1 -1
- package/chunks/{Breadcrumb.BgnpTo01.js → Breadcrumb.Qr6bDP2N.js} +2 -2
- package/chunks/Button.Cn5yg7dG.js +138 -0
- package/chunks/{Checkbox.BcGXAuuP.js → Checkbox.D5X5T6Yg.js} +1 -1
- package/chunks/CheckboxGroup.CUR_0VMc.js +74 -0
- package/chunks/{Chip.D6pubCZV.js → Chip.DIp5hdRH.js} +1 -1
- package/chunks/{CustomReactSelect.Dg3wC_VH.js → CustomReactSelect.BA3hUVkh.js} +816 -800
- package/chunks/{Dialog.DpqSVrYR.js → Dialog.DRk_jSj5.js} +1 -1
- package/chunks/{Drawer.DISWybOa.js → Drawer.Dj6WeUC8.js} +1 -1
- package/chunks/Fieldset.C0RzpI-h.js +81 -0
- package/chunks/{Header.7TQL_J9t.js → Header.18sOO0Gf.js} +1 -1
- package/chunks/{Input.utils.Dkw7gRrr.js → Input.utils.CL1u4Ctq.js} +27 -25
- package/chunks/InputFile.Bki3bs3U.js +236 -0
- package/chunks/InputNumber.B43cqBH0.js +242 -0
- package/chunks/InputPassword.DcdMjsXr.js +121 -0
- package/chunks/InputSearch.CJm6ph8W.js +149 -0
- package/chunks/LinkButton.C6F-yuLL.js +139 -0
- package/chunks/{MegaMenu.CQbOeaib.js → MegaMenu.qttkjGbD.js} +7 -8
- package/chunks/{NavigationTabs.BwM-6CRm.js → NavigationTabs.CQxlahX1.js} +1 -1
- package/chunks/{Notification.CrojkJ0E.js → Notification.Qzz88ngL.js} +1 -1
- package/chunks/{Popover.Bb0Pjmvg.js → Popover.D7McfVaH.js} +9 -10
- package/chunks/RadioGroup.B2VCD9x-.js +106 -0
- package/chunks/Select.B0uMOSSD.js +147 -0
- package/chunks/Slider.YTIktxxD.js +306 -0
- package/chunks/{Stepper.PTQdQBYf.js → Stepper.BvPmbbqw.js} +2 -2
- package/chunks/{Tabs.DyP4whX0.js → Tabs.CoO_lrhV.js} +1 -1
- package/chunks/Textarea.lYiPXerd.js +181 -0
- package/chunks/{Toast.ug_RjGgF.js → Toast.L5HAuEOn.js} +1 -1
- package/chunks/floating-ui.react.COTL3jH5.js +2984 -0
- package/chunks/{useBreakpoint.BzR_yaIv.js → useBreakpoint.1txsny17.js} +8 -5
- package/combobox.CGEDlMo0.js +71 -0
- package/components/Button/Button.d.ts +5 -0
- package/components/Button/Button.utils.d.ts +4 -5
- package/components/CheckboxGroup/CheckboxGroup.d.ts +14 -1
- package/components/Combobox/Combobox.utils.d.ts +3 -2
- package/components/Combobox/CustomReactSelect/CustomReactSelect.d.ts +13 -0
- package/components/Fieldset/Fieldset.d.ts +14 -1
- package/components/Input/Input.d.ts +13 -0
- package/components/Input/Input.utils.d.ts +2 -2
- package/components/InputFile/InputFile.d.ts +13 -0
- package/components/InputFile/InputFile.utils.d.ts +4 -2
- package/components/InputNumber/InputNumber.d.ts +17 -4
- package/components/InputNumber/InputNumber.utils.d.ts +2 -2
- package/components/InputPassword/InputPassword.d.ts +13 -0
- package/components/InputPassword/InputPassword.utils.d.ts +2 -2
- package/components/InputSearch/InputSearch.d.ts +13 -0
- package/components/InputSearch/InputSearch.utils.d.ts +2 -2
- package/components/LinkButton/LinkButton.d.ts +5 -0
- package/components/LinkButton/LinkButton.utils.d.ts +4 -5
- package/components/RadioGroup/RadioGroup.d.ts +13 -0
- package/components/Select/Select.d.ts +13 -0
- package/components/Select/Select.utils.d.ts +2 -2
- package/components/Slider/Slider.d.ts +13 -0
- package/components/Textarea/Textarea.d.ts +13 -0
- package/components/Textarea/Textarea.utils.d.ts +2 -2
- package/{customreactselect.BFN8cYJi.js → customreactselect.BgYf8rKE.js} +4 -3
- package/{dialog.CzM_Cxp0.js → dialog.Bq-ZyzR8.js} +2 -2
- package/{drawer._A9MQ8Cj.js → drawer.DL5UzLWf.js} +2 -2
- package/{fieldset.CId-NtI5.js → fieldset.BFLW2D9H.js} +3 -2
- package/{filelist.DgVuWpR3.js → filelist.BG6SGVJ8.js} +1 -1
- package/{floatingactionbutton.Bsnncudt.js → floatingactionbutton.B5hJ2At2.js} +1 -1
- package/{header.CelAkqtp.js → header.A77yIAH3.js} +1 -1
- package/index.es.js +38 -38
- package/input.hBWqQr3X.js +190 -0
- package/{inputfile.BjgJGefV.js → inputfile.BSZuRujU.js} +6 -5
- package/{inputnumber.BcrxBVv0.js → inputnumber.CA4JiUmq.js} +7 -6
- package/{inputpassword.CddmBW-T.js → inputpassword.Cju_crMi.js} +4 -4
- package/{inputsearch.CFOASqrd.js → inputsearch.CU9AhVVv.js} +6 -5
- package/{link.f8MMZo-w.js → link.DoiK003-.js} +2 -2
- package/{linkbutton.BYAvi-_V.js → linkbutton.CWco_B7v.js} +4 -4
- package/{logo100years.B4d_DIiB.js → logo100years.DDzCrczW.js} +10 -10
- package/{megamenu.Cy9Cc-mC.js → megamenu.BurL9MfF.js} +3 -3
- package/{navigationtabs.Dp7D2fnc.js → navigationtabs.zhRZHjgs.js} +2 -2
- package/{notification.B-norGiB.js → notification.BiXdWNo7.js} +2 -2
- package/package.json +2 -1
- package/partials/index.js +30 -30
- package/{popover.DFVDZY-m.js → popover.79Voiadz.js} +3 -3
- package/{radiogroup.DaThoMfq.js → radiogroup.CwBh7u9L.js} +2 -2
- package/{scroller.Cu7H_VCT.js → scroller.IpfbFV8B.js} +1 -1
- package/{select.CMdKf7tC.js → select.NHaEtX_u.js} +5 -4
- package/{skiptocontent.CHVh0hbr.js → skiptocontent.X4USTODk.js} +1 -1
- package/slider.jnNGEyBq.js +12 -0
- package/{step.DKf4CHGr.js → step.D5p7qppy.js} +1 -1
- package/{stepper.CCP_igpJ.js → stepper.DnMc4ex6.js} +3 -3
- package/styles/scss/ds/lib/ds-internal/_input.scss +12 -3
- package/styles/scss/ds/lib/ds-internal/_link-button.scss +10 -2
- package/styles/scss/ds/lib/link-button.scss +11 -3
- package/{tablist.DZgo49nZ.js → tablist.BFE6RAPD.js} +1 -1
- package/{tabs.BkoT7feH.js → tabs.CsOxxQyQ.js} +2 -2
- package/{textarea.DMn20z4p.js → textarea.C9OAAjhG.js} +4 -3
- package/{toast.Dvs8woTH.js → toast.OBI9qnAM.js} +2 -2
- package/{toastmanager.pi_Fhd5t.js → toastmanager.CgsA-1y_.js} +1 -1
- package/{tooltip.QJe_bfO-.js → tooltip.Cj3AvYgB.js} +22 -23
- package/{topbar.Bxwvp9Lf.js → topbar.CAujTZAE.js} +2 -2
- package/utils/useIsomorphicLayoutEffect.d.ts +2 -2
- package/assets/Button.C8sNwIeW.css +0 -1
- package/assets/CustomReactSelect.E_jJFVew.css +0 -1
- package/assets/Fieldset.CW9dBvAo.css +0 -1
- package/assets/InputFile.BnIvK65P.css +0 -1
- package/assets/InputNumber.BoiCIR1f.css +0 -1
- package/assets/InputPassword.Dk3_vNLV.css +0 -1
- package/assets/InputSearch.C1_4cVCi.css +0 -1
- package/assets/LinkButton.B86yacK5.css +0 -1
- package/assets/Select.COxLltX7.css +0 -1
- package/assets/Slider.DPEmJ3HD.css +0 -1
- package/assets/Textarea.y3MW7VW0.css +0 -1
- package/assets/buttonround.BN3vUDc_.css +0 -1
- package/assets/input.DTu4g_iA.css +0 -1
- package/button.DHuKanZP.js +0 -13
- package/buttonround.CMlmEDaN.js +0 -96
- package/chunks/Button.DCZgBNmA.js +0 -142
- package/chunks/CheckboxGroup.BuFd1luB.js +0 -72
- package/chunks/Fieldset.DiMtr6Vw.js +0 -74
- package/chunks/InputFile.C8nt9Fu8.js +0 -218
- package/chunks/InputNumber.CbH1XJfl.js +0 -267
- package/chunks/InputPassword.DbdjuSiJ.js +0 -136
- package/chunks/InputSearch.joxmugiv.js +0 -173
- package/chunks/LinkButton.BZgIGgc8.js +0 -132
- package/chunks/RadioGroup.CexC4v2Z.js +0 -104
- package/chunks/Select.BEIdNMML.js +0 -164
- package/chunks/Slider.CR0zYHeZ.js +0 -291
- package/chunks/Textarea.Du2RII5u.js +0 -168
- package/chunks/floating-ui.dom.BT8pKtCQ.js +0 -1005
- package/chunks/floating-ui.react.3FjeMiuN.js +0 -1999
- package/combobox.jG5GRA7C.js +0 -65
- package/input.DuEbg7d6.js +0 -206
- package/slider.C5dK6KcG.js +0 -11
- /package/components/InputNumber/{InputNumberutils.test.d.ts → InputNumber.utils.test.d.ts} +0 -0
|
@@ -0,0 +1,2984 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { useLayoutEffect as wn } from "react";
|
|
4
|
+
import { jsxs as Lt, jsx as re, Fragment as Yn } from "react/jsx-runtime";
|
|
5
|
+
import * as It from "react-dom";
|
|
6
|
+
function rt() {
|
|
7
|
+
return typeof window < "u";
|
|
8
|
+
}
|
|
9
|
+
function xe(e) {
|
|
10
|
+
return kt(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
11
|
+
}
|
|
12
|
+
function ee(e) {
|
|
13
|
+
var t;
|
|
14
|
+
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
15
|
+
}
|
|
16
|
+
function ue(e) {
|
|
17
|
+
var t;
|
|
18
|
+
return (t = (kt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
19
|
+
}
|
|
20
|
+
function kt(e) {
|
|
21
|
+
return rt() ? e instanceof Node || e instanceof ee(e).Node : !1;
|
|
22
|
+
}
|
|
23
|
+
function K(e) {
|
|
24
|
+
return rt() ? e instanceof Element || e instanceof ee(e).Element : !1;
|
|
25
|
+
}
|
|
26
|
+
function U(e) {
|
|
27
|
+
return rt() ? e instanceof HTMLElement || e instanceof ee(e).HTMLElement : !1;
|
|
28
|
+
}
|
|
29
|
+
function Et(e) {
|
|
30
|
+
return !rt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof ee(e).ShadowRoot;
|
|
31
|
+
}
|
|
32
|
+
const zn = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
33
|
+
function We(e) {
|
|
34
|
+
const {
|
|
35
|
+
overflow: t,
|
|
36
|
+
overflowX: n,
|
|
37
|
+
overflowY: r,
|
|
38
|
+
display: o
|
|
39
|
+
} = oe(e);
|
|
40
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !zn.has(o);
|
|
41
|
+
}
|
|
42
|
+
const Gn = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
43
|
+
function Zn(e) {
|
|
44
|
+
return Gn.has(xe(e));
|
|
45
|
+
}
|
|
46
|
+
const Jn = [":popover-open", ":modal"];
|
|
47
|
+
function ot(e) {
|
|
48
|
+
return Jn.some((t) => {
|
|
49
|
+
try {
|
|
50
|
+
return e.matches(t);
|
|
51
|
+
} catch {
|
|
52
|
+
return !1;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const Qn = ["transform", "translate", "scale", "rotate", "perspective"], er = ["transform", "translate", "scale", "rotate", "perspective", "filter"], tr = ["paint", "layout", "strict", "content"];
|
|
57
|
+
function Dt(e) {
|
|
58
|
+
const t = it(), n = K(e) ? oe(e) : e;
|
|
59
|
+
return Qn.some((r) => n[r] ? n[r] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || er.some((r) => (n.willChange || "").includes(r)) || tr.some((r) => (n.contain || "").includes(r));
|
|
60
|
+
}
|
|
61
|
+
function nr(e) {
|
|
62
|
+
let t = ge(e);
|
|
63
|
+
for (; U(t) && !me(t); ) {
|
|
64
|
+
if (Dt(t))
|
|
65
|
+
return t;
|
|
66
|
+
if (ot(t))
|
|
67
|
+
return null;
|
|
68
|
+
t = ge(t);
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
function it() {
|
|
73
|
+
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
74
|
+
}
|
|
75
|
+
const rr = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
76
|
+
function me(e) {
|
|
77
|
+
return rr.has(xe(e));
|
|
78
|
+
}
|
|
79
|
+
function oe(e) {
|
|
80
|
+
return ee(e).getComputedStyle(e);
|
|
81
|
+
}
|
|
82
|
+
function st(e) {
|
|
83
|
+
return K(e) ? {
|
|
84
|
+
scrollLeft: e.scrollLeft,
|
|
85
|
+
scrollTop: e.scrollTop
|
|
86
|
+
} : {
|
|
87
|
+
scrollLeft: e.scrollX,
|
|
88
|
+
scrollTop: e.scrollY
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function ge(e) {
|
|
92
|
+
if (xe(e) === "html")
|
|
93
|
+
return e;
|
|
94
|
+
const t = (
|
|
95
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
96
|
+
e.assignedSlot || // DOM Element detected.
|
|
97
|
+
e.parentNode || // ShadowRoot detected.
|
|
98
|
+
Et(e) && e.host || // Fallback.
|
|
99
|
+
ue(e)
|
|
100
|
+
);
|
|
101
|
+
return Et(t) ? t.host : t;
|
|
102
|
+
}
|
|
103
|
+
function Rn(e) {
|
|
104
|
+
const t = ge(e);
|
|
105
|
+
return me(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : U(t) && We(t) ? t : Rn(t);
|
|
106
|
+
}
|
|
107
|
+
function Re(e, t, n) {
|
|
108
|
+
var r;
|
|
109
|
+
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
110
|
+
const o = Rn(e), i = o === ((r = e.ownerDocument) == null ? void 0 : r.body), s = ee(o);
|
|
111
|
+
if (i) {
|
|
112
|
+
const c = Tt(s);
|
|
113
|
+
return t.concat(s, s.visualViewport || [], We(o) ? o : [], c && n ? Re(c) : []);
|
|
114
|
+
}
|
|
115
|
+
return t.concat(o, Re(o, [], n));
|
|
116
|
+
}
|
|
117
|
+
function Tt(e) {
|
|
118
|
+
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
119
|
+
}
|
|
120
|
+
const ke = Math.min, Se = Math.max, ze = Math.round, je = Math.floor, le = (e) => ({
|
|
121
|
+
x: e,
|
|
122
|
+
y: e
|
|
123
|
+
}), or = {
|
|
124
|
+
left: "right",
|
|
125
|
+
right: "left",
|
|
126
|
+
bottom: "top",
|
|
127
|
+
top: "bottom"
|
|
128
|
+
}, ir = {
|
|
129
|
+
start: "end",
|
|
130
|
+
end: "start"
|
|
131
|
+
};
|
|
132
|
+
function St(e, t, n) {
|
|
133
|
+
return Se(e, ke(t, n));
|
|
134
|
+
}
|
|
135
|
+
function $e(e, t) {
|
|
136
|
+
return typeof e == "function" ? e(t) : e;
|
|
137
|
+
}
|
|
138
|
+
function Ce(e) {
|
|
139
|
+
return e.split("-")[0];
|
|
140
|
+
}
|
|
141
|
+
function Ve(e) {
|
|
142
|
+
return e.split("-")[1];
|
|
143
|
+
}
|
|
144
|
+
function xn(e) {
|
|
145
|
+
return e === "x" ? "y" : "x";
|
|
146
|
+
}
|
|
147
|
+
function Ft(e) {
|
|
148
|
+
return e === "y" ? "height" : "width";
|
|
149
|
+
}
|
|
150
|
+
const sr = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
151
|
+
function ye(e) {
|
|
152
|
+
return sr.has(Ce(e)) ? "y" : "x";
|
|
153
|
+
}
|
|
154
|
+
function Nt(e) {
|
|
155
|
+
return xn(ye(e));
|
|
156
|
+
}
|
|
157
|
+
function cr(e, t, n) {
|
|
158
|
+
n === void 0 && (n = !1);
|
|
159
|
+
const r = Ve(e), o = Nt(e), i = Ft(o);
|
|
160
|
+
let s = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
161
|
+
return t.reference[i] > t.floating[i] && (s = Ge(s)), [s, Ge(s)];
|
|
162
|
+
}
|
|
163
|
+
function lr(e) {
|
|
164
|
+
const t = Ge(e);
|
|
165
|
+
return [Ct(e), t, Ct(t)];
|
|
166
|
+
}
|
|
167
|
+
function Ct(e) {
|
|
168
|
+
return e.replace(/start|end/g, (t) => ir[t]);
|
|
169
|
+
}
|
|
170
|
+
const Kt = ["left", "right"], jt = ["right", "left"], ur = ["top", "bottom"], ar = ["bottom", "top"];
|
|
171
|
+
function fr(e, t, n) {
|
|
172
|
+
switch (e) {
|
|
173
|
+
case "top":
|
|
174
|
+
case "bottom":
|
|
175
|
+
return n ? t ? jt : Kt : t ? Kt : jt;
|
|
176
|
+
case "left":
|
|
177
|
+
case "right":
|
|
178
|
+
return t ? ur : ar;
|
|
179
|
+
default:
|
|
180
|
+
return [];
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
function dr(e, t, n, r) {
|
|
184
|
+
const o = Ve(e);
|
|
185
|
+
let i = fr(Ce(e), n === "start", r);
|
|
186
|
+
return o && (i = i.map((s) => s + "-" + o), t && (i = i.concat(i.map(Ct)))), i;
|
|
187
|
+
}
|
|
188
|
+
function Ge(e) {
|
|
189
|
+
return e.replace(/left|right|bottom|top/g, (t) => or[t]);
|
|
190
|
+
}
|
|
191
|
+
function mr(e) {
|
|
192
|
+
return {
|
|
193
|
+
top: 0,
|
|
194
|
+
right: 0,
|
|
195
|
+
bottom: 0,
|
|
196
|
+
left: 0,
|
|
197
|
+
...e
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function En(e) {
|
|
201
|
+
return typeof e != "number" ? mr(e) : {
|
|
202
|
+
top: e,
|
|
203
|
+
right: e,
|
|
204
|
+
bottom: e,
|
|
205
|
+
left: e
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
function Ze(e) {
|
|
209
|
+
const {
|
|
210
|
+
x: t,
|
|
211
|
+
y: n,
|
|
212
|
+
width: r,
|
|
213
|
+
height: o
|
|
214
|
+
} = e;
|
|
215
|
+
return {
|
|
216
|
+
width: r,
|
|
217
|
+
height: o,
|
|
218
|
+
top: n,
|
|
219
|
+
left: t,
|
|
220
|
+
right: t + r,
|
|
221
|
+
bottom: n + o,
|
|
222
|
+
x: t,
|
|
223
|
+
y: n
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
/*!
|
|
227
|
+
* tabbable 6.2.0
|
|
228
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
229
|
+
*/
|
|
230
|
+
var gr = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"], Je = /* @__PURE__ */ gr.join(","), Tn = typeof Element > "u", De = Tn ? function() {
|
|
231
|
+
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, Qe = !Tn && Element.prototype.getRootNode ? function(e) {
|
|
232
|
+
var t;
|
|
233
|
+
return e == null || (t = e.getRootNode) === null || t === void 0 ? void 0 : t.call(e);
|
|
234
|
+
} : function(e) {
|
|
235
|
+
return e?.ownerDocument;
|
|
236
|
+
}, et = function e(t, n) {
|
|
237
|
+
var r;
|
|
238
|
+
n === void 0 && (n = !0);
|
|
239
|
+
var o = t == null || (r = t.getAttribute) === null || r === void 0 ? void 0 : r.call(t, "inert"), i = o === "" || o === "true", s = i || n && t && e(t.parentNode);
|
|
240
|
+
return s;
|
|
241
|
+
}, pr = function(t) {
|
|
242
|
+
var n, r = t == null || (n = t.getAttribute) === null || n === void 0 ? void 0 : n.call(t, "contenteditable");
|
|
243
|
+
return r === "" || r === "true";
|
|
244
|
+
}, Sn = function(t, n, r) {
|
|
245
|
+
if (et(t))
|
|
246
|
+
return [];
|
|
247
|
+
var o = Array.prototype.slice.apply(t.querySelectorAll(Je));
|
|
248
|
+
return n && De.call(t, Je) && o.unshift(t), o = o.filter(r), o;
|
|
249
|
+
}, Cn = function e(t, n, r) {
|
|
250
|
+
for (var o = [], i = Array.from(t); i.length; ) {
|
|
251
|
+
var s = i.shift();
|
|
252
|
+
if (!et(s, !1))
|
|
253
|
+
if (s.tagName === "SLOT") {
|
|
254
|
+
var c = s.assignedElements(), l = c.length ? c : s.children, u = e(l, !0, r);
|
|
255
|
+
r.flatten ? o.push.apply(o, u) : o.push({
|
|
256
|
+
scopeParent: s,
|
|
257
|
+
candidates: u
|
|
258
|
+
});
|
|
259
|
+
} else {
|
|
260
|
+
var d = De.call(s, Je);
|
|
261
|
+
d && r.filter(s) && (n || !t.includes(s)) && o.push(s);
|
|
262
|
+
var g = s.shadowRoot || // check for an undisclosed shadow
|
|
263
|
+
typeof r.getShadowRoot == "function" && r.getShadowRoot(s), h = !et(g, !1) && (!r.shadowRootFilter || r.shadowRootFilter(s));
|
|
264
|
+
if (g && h) {
|
|
265
|
+
var a = e(g === !0 ? s.children : g.children, !0, r);
|
|
266
|
+
r.flatten ? o.push.apply(o, a) : o.push({
|
|
267
|
+
scopeParent: s,
|
|
268
|
+
candidates: a
|
|
269
|
+
});
|
|
270
|
+
} else
|
|
271
|
+
i.unshift.apply(i, s.children);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return o;
|
|
275
|
+
}, An = function(t) {
|
|
276
|
+
return !isNaN(parseInt(t.getAttribute("tabindex"), 10));
|
|
277
|
+
}, On = function(t) {
|
|
278
|
+
if (!t)
|
|
279
|
+
throw new Error("No node provided");
|
|
280
|
+
return t.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName) || pr(t)) && !An(t) ? 0 : t.tabIndex;
|
|
281
|
+
}, vr = function(t, n) {
|
|
282
|
+
var r = On(t);
|
|
283
|
+
return r < 0 && n && !An(t) ? 0 : r;
|
|
284
|
+
}, hr = function(t, n) {
|
|
285
|
+
return t.tabIndex === n.tabIndex ? t.documentOrder - n.documentOrder : t.tabIndex - n.tabIndex;
|
|
286
|
+
}, Mn = function(t) {
|
|
287
|
+
return t.tagName === "INPUT";
|
|
288
|
+
}, br = function(t) {
|
|
289
|
+
return Mn(t) && t.type === "hidden";
|
|
290
|
+
}, yr = function(t) {
|
|
291
|
+
var n = t.tagName === "DETAILS" && Array.prototype.slice.apply(t.children).some(function(r) {
|
|
292
|
+
return r.tagName === "SUMMARY";
|
|
293
|
+
});
|
|
294
|
+
return n;
|
|
295
|
+
}, wr = function(t, n) {
|
|
296
|
+
for (var r = 0; r < t.length; r++)
|
|
297
|
+
if (t[r].checked && t[r].form === n)
|
|
298
|
+
return t[r];
|
|
299
|
+
}, Rr = function(t) {
|
|
300
|
+
if (!t.name)
|
|
301
|
+
return !0;
|
|
302
|
+
var n = t.form || Qe(t), r = function(c) {
|
|
303
|
+
return n.querySelectorAll('input[type="radio"][name="' + c + '"]');
|
|
304
|
+
}, o;
|
|
305
|
+
if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
|
|
306
|
+
o = r(window.CSS.escape(t.name));
|
|
307
|
+
else
|
|
308
|
+
try {
|
|
309
|
+
o = r(t.name);
|
|
310
|
+
} catch (s) {
|
|
311
|
+
return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", s.message), !1;
|
|
312
|
+
}
|
|
313
|
+
var i = wr(o, t.form);
|
|
314
|
+
return !i || i === t;
|
|
315
|
+
}, xr = function(t) {
|
|
316
|
+
return Mn(t) && t.type === "radio";
|
|
317
|
+
}, Er = function(t) {
|
|
318
|
+
return xr(t) && !Rr(t);
|
|
319
|
+
}, Tr = function(t) {
|
|
320
|
+
var n, r = t && Qe(t), o = (n = r) === null || n === void 0 ? void 0 : n.host, i = !1;
|
|
321
|
+
if (r && r !== t) {
|
|
322
|
+
var s, c, l;
|
|
323
|
+
for (i = !!((s = o) !== null && s !== void 0 && (c = s.ownerDocument) !== null && c !== void 0 && c.contains(o) || t != null && (l = t.ownerDocument) !== null && l !== void 0 && l.contains(t)); !i && o; ) {
|
|
324
|
+
var u, d, g;
|
|
325
|
+
r = Qe(o), o = (u = r) === null || u === void 0 ? void 0 : u.host, i = !!((d = o) !== null && d !== void 0 && (g = d.ownerDocument) !== null && g !== void 0 && g.contains(o));
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return i;
|
|
329
|
+
}, qt = function(t) {
|
|
330
|
+
var n = t.getBoundingClientRect(), r = n.width, o = n.height;
|
|
331
|
+
return r === 0 && o === 0;
|
|
332
|
+
}, Sr = function(t, n) {
|
|
333
|
+
var r = n.displayCheck, o = n.getShadowRoot;
|
|
334
|
+
if (getComputedStyle(t).visibility === "hidden")
|
|
335
|
+
return !0;
|
|
336
|
+
var i = De.call(t, "details>summary:first-of-type"), s = i ? t.parentElement : t;
|
|
337
|
+
if (De.call(s, "details:not([open]) *"))
|
|
338
|
+
return !0;
|
|
339
|
+
if (!r || r === "full" || r === "legacy-full") {
|
|
340
|
+
if (typeof o == "function") {
|
|
341
|
+
for (var c = t; t; ) {
|
|
342
|
+
var l = t.parentElement, u = Qe(t);
|
|
343
|
+
if (l && !l.shadowRoot && o(l) === !0)
|
|
344
|
+
return qt(t);
|
|
345
|
+
t.assignedSlot ? t = t.assignedSlot : !l && u !== t.ownerDocument ? t = u.host : t = l;
|
|
346
|
+
}
|
|
347
|
+
t = c;
|
|
348
|
+
}
|
|
349
|
+
if (Tr(t))
|
|
350
|
+
return !t.getClientRects().length;
|
|
351
|
+
if (r !== "legacy-full")
|
|
352
|
+
return !0;
|
|
353
|
+
} else if (r === "non-zero-area")
|
|
354
|
+
return qt(t);
|
|
355
|
+
return !1;
|
|
356
|
+
}, Cr = function(t) {
|
|
357
|
+
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))
|
|
358
|
+
for (var n = t.parentElement; n; ) {
|
|
359
|
+
if (n.tagName === "FIELDSET" && n.disabled) {
|
|
360
|
+
for (var r = 0; r < n.children.length; r++) {
|
|
361
|
+
var o = n.children.item(r);
|
|
362
|
+
if (o.tagName === "LEGEND")
|
|
363
|
+
return De.call(n, "fieldset[disabled] *") ? !0 : !o.contains(t);
|
|
364
|
+
}
|
|
365
|
+
return !0;
|
|
366
|
+
}
|
|
367
|
+
n = n.parentElement;
|
|
368
|
+
}
|
|
369
|
+
return !1;
|
|
370
|
+
}, At = function(t, n) {
|
|
371
|
+
return !(n.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
|
|
372
|
+
// because we're limited in the type of selectors we can use in JSDom (see related
|
|
373
|
+
// note related to `candidateSelectors`)
|
|
374
|
+
et(n) || br(n) || Sr(n, t) || // For a details element with a summary, the summary element gets the focus
|
|
375
|
+
yr(n) || Cr(n));
|
|
376
|
+
}, Ot = function(t, n) {
|
|
377
|
+
return !(Er(n) || On(n) < 0 || !At(t, n));
|
|
378
|
+
}, Ar = function(t) {
|
|
379
|
+
var n = parseInt(t.getAttribute("tabindex"), 10);
|
|
380
|
+
return !!(isNaN(n) || n >= 0);
|
|
381
|
+
}, Or = function e(t) {
|
|
382
|
+
var n = [], r = [];
|
|
383
|
+
return t.forEach(function(o, i) {
|
|
384
|
+
var s = !!o.scopeParent, c = s ? o.scopeParent : o, l = vr(c, s), u = s ? e(o.candidates) : c;
|
|
385
|
+
l === 0 ? s ? n.push.apply(n, u) : n.push(c) : r.push({
|
|
386
|
+
documentOrder: i,
|
|
387
|
+
tabIndex: l,
|
|
388
|
+
item: o,
|
|
389
|
+
isScope: s,
|
|
390
|
+
content: u
|
|
391
|
+
});
|
|
392
|
+
}), r.sort(hr).reduce(function(o, i) {
|
|
393
|
+
return i.isScope ? o.push.apply(o, i.content) : o.push(i.content), o;
|
|
394
|
+
}, []).concat(n);
|
|
395
|
+
}, ct = function(t, n) {
|
|
396
|
+
n = n || {};
|
|
397
|
+
var r;
|
|
398
|
+
return n.getShadowRoot ? r = Cn([t], n.includeContainer, {
|
|
399
|
+
filter: Ot.bind(null, n),
|
|
400
|
+
flatten: !1,
|
|
401
|
+
getShadowRoot: n.getShadowRoot,
|
|
402
|
+
shadowRootFilter: Ar
|
|
403
|
+
}) : r = Sn(t, n.includeContainer, Ot.bind(null, n)), Or(r);
|
|
404
|
+
}, Mr = function(t, n) {
|
|
405
|
+
n = n || {};
|
|
406
|
+
var r;
|
|
407
|
+
return n.getShadowRoot ? r = Cn([t], n.includeContainer, {
|
|
408
|
+
filter: At.bind(null, n),
|
|
409
|
+
flatten: !0,
|
|
410
|
+
getShadowRoot: n.getShadowRoot
|
|
411
|
+
}) : r = Sn(t, n.includeContainer, At.bind(null, n)), r;
|
|
412
|
+
}, Pn = function(t, n) {
|
|
413
|
+
if (n = n || {}, !t)
|
|
414
|
+
throw new Error("No node provided");
|
|
415
|
+
return De.call(t, Je) === !1 ? !1 : Ot(n, t);
|
|
416
|
+
};
|
|
417
|
+
function Bt() {
|
|
418
|
+
const e = navigator.userAgentData;
|
|
419
|
+
return e != null && e.platform ? e.platform : navigator.platform;
|
|
420
|
+
}
|
|
421
|
+
function Ln() {
|
|
422
|
+
const e = navigator.userAgentData;
|
|
423
|
+
return e && Array.isArray(e.brands) ? e.brands.map((t) => {
|
|
424
|
+
let {
|
|
425
|
+
brand: n,
|
|
426
|
+
version: r
|
|
427
|
+
} = t;
|
|
428
|
+
return n + "/" + r;
|
|
429
|
+
}).join(" ") : navigator.userAgent;
|
|
430
|
+
}
|
|
431
|
+
function In() {
|
|
432
|
+
return /apple/i.test(navigator.vendor);
|
|
433
|
+
}
|
|
434
|
+
function Mt() {
|
|
435
|
+
const e = /android/i;
|
|
436
|
+
return e.test(Bt()) || e.test(Ln());
|
|
437
|
+
}
|
|
438
|
+
function Pr() {
|
|
439
|
+
return Bt().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
|
|
440
|
+
}
|
|
441
|
+
function kn() {
|
|
442
|
+
return Ln().includes("jsdom/");
|
|
443
|
+
}
|
|
444
|
+
const Xt = "data-floating-ui-focusable", Lr = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
|
|
445
|
+
function be(e) {
|
|
446
|
+
let t = e.activeElement;
|
|
447
|
+
for (; ((n = t) == null || (n = n.shadowRoot) == null ? void 0 : n.activeElement) != null; ) {
|
|
448
|
+
var n;
|
|
449
|
+
t = t.shadowRoot.activeElement;
|
|
450
|
+
}
|
|
451
|
+
return t;
|
|
452
|
+
}
|
|
453
|
+
function Z(e, t) {
|
|
454
|
+
if (!e || !t)
|
|
455
|
+
return !1;
|
|
456
|
+
const n = t.getRootNode == null ? void 0 : t.getRootNode();
|
|
457
|
+
if (e.contains(t))
|
|
458
|
+
return !0;
|
|
459
|
+
if (n && Et(n)) {
|
|
460
|
+
let r = t;
|
|
461
|
+
for (; r; ) {
|
|
462
|
+
if (e === r)
|
|
463
|
+
return !0;
|
|
464
|
+
r = r.parentNode || r.host;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
return !1;
|
|
468
|
+
}
|
|
469
|
+
function de(e) {
|
|
470
|
+
return "composedPath" in e ? e.composedPath()[0] : e.target;
|
|
471
|
+
}
|
|
472
|
+
function gt(e, t) {
|
|
473
|
+
if (t == null)
|
|
474
|
+
return !1;
|
|
475
|
+
if ("composedPath" in e)
|
|
476
|
+
return e.composedPath().includes(t);
|
|
477
|
+
const n = e;
|
|
478
|
+
return n.target != null && t.contains(n.target);
|
|
479
|
+
}
|
|
480
|
+
function Ir(e) {
|
|
481
|
+
return e.matches("html,body");
|
|
482
|
+
}
|
|
483
|
+
function J(e) {
|
|
484
|
+
return e?.ownerDocument || document;
|
|
485
|
+
}
|
|
486
|
+
function Wt(e) {
|
|
487
|
+
return U(e) && e.matches(Lr);
|
|
488
|
+
}
|
|
489
|
+
function Ut(e) {
|
|
490
|
+
return e ? e.getAttribute("role") === "combobox" && Wt(e) : !1;
|
|
491
|
+
}
|
|
492
|
+
function kr(e) {
|
|
493
|
+
if (!e || kn()) return !0;
|
|
494
|
+
try {
|
|
495
|
+
return e.matches(":focus-visible");
|
|
496
|
+
} catch {
|
|
497
|
+
return !0;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
function Pt(e) {
|
|
501
|
+
return e ? e.hasAttribute(Xt) ? e : e.querySelector("[" + Xt + "]") || e : null;
|
|
502
|
+
}
|
|
503
|
+
function Pe(e, t, n) {
|
|
504
|
+
return n === void 0 && (n = !0), e.filter((o) => {
|
|
505
|
+
var i;
|
|
506
|
+
return o.parentId === t && (!n || ((i = o.context) == null ? void 0 : i.open));
|
|
507
|
+
}).flatMap((o) => [o, ...Pe(e, o.id, n)]);
|
|
508
|
+
}
|
|
509
|
+
function Yt(e, t) {
|
|
510
|
+
var n;
|
|
511
|
+
let r = [], o = (n = e.find((i) => i.id === t)) == null ? void 0 : n.parentId;
|
|
512
|
+
for (; o; ) {
|
|
513
|
+
const i = e.find((s) => s.id === o);
|
|
514
|
+
o = i?.parentId, i && (r = r.concat(i));
|
|
515
|
+
}
|
|
516
|
+
return r;
|
|
517
|
+
}
|
|
518
|
+
function pt(e) {
|
|
519
|
+
e.preventDefault(), e.stopPropagation();
|
|
520
|
+
}
|
|
521
|
+
function Dr(e) {
|
|
522
|
+
return "nativeEvent" in e;
|
|
523
|
+
}
|
|
524
|
+
function Fr(e) {
|
|
525
|
+
return e.mozInputSource === 0 && e.isTrusted ? !0 : Mt() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
|
526
|
+
}
|
|
527
|
+
function Nr(e) {
|
|
528
|
+
return kn() ? !1 : !Mt() && e.width === 0 && e.height === 0 || Mt() && e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
|
|
529
|
+
e.width < 1 && e.height < 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "touch";
|
|
530
|
+
}
|
|
531
|
+
function Ne(e, t) {
|
|
532
|
+
const n = ["mouse", "pen"];
|
|
533
|
+
return t || n.push("", void 0), n.includes(e);
|
|
534
|
+
}
|
|
535
|
+
var Br = typeof document < "u", Wr = function() {
|
|
536
|
+
}, G = Br ? wn : Wr;
|
|
537
|
+
const $r = {
|
|
538
|
+
...f
|
|
539
|
+
};
|
|
540
|
+
function Te(e) {
|
|
541
|
+
const t = f.useRef(e);
|
|
542
|
+
return G(() => {
|
|
543
|
+
t.current = e;
|
|
544
|
+
}), t;
|
|
545
|
+
}
|
|
546
|
+
const Vr = $r.useInsertionEffect, _r = Vr || ((e) => e());
|
|
547
|
+
function Q(e) {
|
|
548
|
+
const t = f.useRef(() => {
|
|
549
|
+
if (process.env.NODE_ENV !== "production")
|
|
550
|
+
throw new Error("Cannot call an event handler while rendering.");
|
|
551
|
+
});
|
|
552
|
+
return _r(() => {
|
|
553
|
+
t.current = e;
|
|
554
|
+
}), f.useCallback(function() {
|
|
555
|
+
for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
|
|
556
|
+
r[o] = arguments[o];
|
|
557
|
+
return t.current == null ? void 0 : t.current(...r);
|
|
558
|
+
}, []);
|
|
559
|
+
}
|
|
560
|
+
const _e = () => ({
|
|
561
|
+
getShadowRoot: !0,
|
|
562
|
+
displayCheck: (
|
|
563
|
+
// JSDOM does not support the `tabbable` library. To solve this we can
|
|
564
|
+
// check if `ResizeObserver` is a real function (not polyfilled), which
|
|
565
|
+
// determines if the current environment is JSDOM-like.
|
|
566
|
+
typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
|
|
567
|
+
)
|
|
568
|
+
});
|
|
569
|
+
function Dn(e, t) {
|
|
570
|
+
const n = ct(e, _e()), r = n.length;
|
|
571
|
+
if (r === 0) return;
|
|
572
|
+
const o = be(J(e)), i = n.indexOf(o), s = i === -1 ? t === 1 ? 0 : r - 1 : i + t;
|
|
573
|
+
return n[s];
|
|
574
|
+
}
|
|
575
|
+
function Fn(e) {
|
|
576
|
+
return Dn(J(e).body, 1) || e;
|
|
577
|
+
}
|
|
578
|
+
function Nn(e) {
|
|
579
|
+
return Dn(J(e).body, -1) || e;
|
|
580
|
+
}
|
|
581
|
+
function Fe(e, t) {
|
|
582
|
+
const n = t || e.currentTarget, r = e.relatedTarget;
|
|
583
|
+
return !r || !Z(n, r);
|
|
584
|
+
}
|
|
585
|
+
function Hr(e) {
|
|
586
|
+
ct(e, _e()).forEach((n) => {
|
|
587
|
+
n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
function zt(e) {
|
|
591
|
+
e.querySelectorAll("[data-tabindex]").forEach((n) => {
|
|
592
|
+
const r = n.dataset.tabindex;
|
|
593
|
+
delete n.dataset.tabindex, r ? n.setAttribute("tabindex", r) : n.removeAttribute("tabindex");
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
function Gt(e, t, n) {
|
|
597
|
+
let {
|
|
598
|
+
reference: r,
|
|
599
|
+
floating: o
|
|
600
|
+
} = e;
|
|
601
|
+
const i = ye(t), s = Nt(t), c = Ft(s), l = Ce(t), u = i === "y", d = r.x + r.width / 2 - o.width / 2, g = r.y + r.height / 2 - o.height / 2, h = r[c] / 2 - o[c] / 2;
|
|
602
|
+
let a;
|
|
603
|
+
switch (l) {
|
|
604
|
+
case "top":
|
|
605
|
+
a = {
|
|
606
|
+
x: d,
|
|
607
|
+
y: r.y - o.height
|
|
608
|
+
};
|
|
609
|
+
break;
|
|
610
|
+
case "bottom":
|
|
611
|
+
a = {
|
|
612
|
+
x: d,
|
|
613
|
+
y: r.y + r.height
|
|
614
|
+
};
|
|
615
|
+
break;
|
|
616
|
+
case "right":
|
|
617
|
+
a = {
|
|
618
|
+
x: r.x + r.width,
|
|
619
|
+
y: g
|
|
620
|
+
};
|
|
621
|
+
break;
|
|
622
|
+
case "left":
|
|
623
|
+
a = {
|
|
624
|
+
x: r.x - o.width,
|
|
625
|
+
y: g
|
|
626
|
+
};
|
|
627
|
+
break;
|
|
628
|
+
default:
|
|
629
|
+
a = {
|
|
630
|
+
x: r.x,
|
|
631
|
+
y: r.y
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
switch (Ve(t)) {
|
|
635
|
+
case "start":
|
|
636
|
+
a[s] -= h * (n && u ? -1 : 1);
|
|
637
|
+
break;
|
|
638
|
+
case "end":
|
|
639
|
+
a[s] += h * (n && u ? -1 : 1);
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
return a;
|
|
643
|
+
}
|
|
644
|
+
const Kr = async (e, t, n) => {
|
|
645
|
+
const {
|
|
646
|
+
placement: r = "bottom",
|
|
647
|
+
strategy: o = "absolute",
|
|
648
|
+
middleware: i = [],
|
|
649
|
+
platform: s
|
|
650
|
+
} = n, c = i.filter(Boolean), l = await (s.isRTL == null ? void 0 : s.isRTL(t));
|
|
651
|
+
let u = await s.getElementRects({
|
|
652
|
+
reference: e,
|
|
653
|
+
floating: t,
|
|
654
|
+
strategy: o
|
|
655
|
+
}), {
|
|
656
|
+
x: d,
|
|
657
|
+
y: g
|
|
658
|
+
} = Gt(u, r, l), h = r, a = {}, p = 0;
|
|
659
|
+
for (let m = 0; m < c.length; m++) {
|
|
660
|
+
const {
|
|
661
|
+
name: y,
|
|
662
|
+
fn: R
|
|
663
|
+
} = c[m], {
|
|
664
|
+
x: b,
|
|
665
|
+
y: w,
|
|
666
|
+
data: S,
|
|
667
|
+
reset: A
|
|
668
|
+
} = await R({
|
|
669
|
+
x: d,
|
|
670
|
+
y: g,
|
|
671
|
+
initialPlacement: r,
|
|
672
|
+
placement: h,
|
|
673
|
+
strategy: o,
|
|
674
|
+
middlewareData: a,
|
|
675
|
+
rects: u,
|
|
676
|
+
platform: s,
|
|
677
|
+
elements: {
|
|
678
|
+
reference: e,
|
|
679
|
+
floating: t
|
|
680
|
+
}
|
|
681
|
+
});
|
|
682
|
+
d = b ?? d, g = w ?? g, a = {
|
|
683
|
+
...a,
|
|
684
|
+
[y]: {
|
|
685
|
+
...a[y],
|
|
686
|
+
...S
|
|
687
|
+
}
|
|
688
|
+
}, A && p <= 50 && (p++, typeof A == "object" && (A.placement && (h = A.placement), A.rects && (u = A.rects === !0 ? await s.getElementRects({
|
|
689
|
+
reference: e,
|
|
690
|
+
floating: t,
|
|
691
|
+
strategy: o
|
|
692
|
+
}) : A.rects), {
|
|
693
|
+
x: d,
|
|
694
|
+
y: g
|
|
695
|
+
} = Gt(u, h, l)), m = -1);
|
|
696
|
+
}
|
|
697
|
+
return {
|
|
698
|
+
x: d,
|
|
699
|
+
y: g,
|
|
700
|
+
placement: h,
|
|
701
|
+
strategy: o,
|
|
702
|
+
middlewareData: a
|
|
703
|
+
};
|
|
704
|
+
};
|
|
705
|
+
async function Bn(e, t) {
|
|
706
|
+
var n;
|
|
707
|
+
t === void 0 && (t = {});
|
|
708
|
+
const {
|
|
709
|
+
x: r,
|
|
710
|
+
y: o,
|
|
711
|
+
platform: i,
|
|
712
|
+
rects: s,
|
|
713
|
+
elements: c,
|
|
714
|
+
strategy: l
|
|
715
|
+
} = e, {
|
|
716
|
+
boundary: u = "clippingAncestors",
|
|
717
|
+
rootBoundary: d = "viewport",
|
|
718
|
+
elementContext: g = "floating",
|
|
719
|
+
altBoundary: h = !1,
|
|
720
|
+
padding: a = 0
|
|
721
|
+
} = $e(t, e), p = En(a), y = c[h ? g === "floating" ? "reference" : "floating" : g], R = Ze(await i.getClippingRect({
|
|
722
|
+
element: (n = await (i.isElement == null ? void 0 : i.isElement(y))) == null || n ? y : y.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
|
|
723
|
+
boundary: u,
|
|
724
|
+
rootBoundary: d,
|
|
725
|
+
strategy: l
|
|
726
|
+
})), b = g === "floating" ? {
|
|
727
|
+
x: r,
|
|
728
|
+
y: o,
|
|
729
|
+
width: s.floating.width,
|
|
730
|
+
height: s.floating.height
|
|
731
|
+
} : s.reference, w = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), S = await (i.isElement == null ? void 0 : i.isElement(w)) ? await (i.getScale == null ? void 0 : i.getScale(w)) || {
|
|
732
|
+
x: 1,
|
|
733
|
+
y: 1
|
|
734
|
+
} : {
|
|
735
|
+
x: 1,
|
|
736
|
+
y: 1
|
|
737
|
+
}, A = Ze(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
738
|
+
elements: c,
|
|
739
|
+
rect: b,
|
|
740
|
+
offsetParent: w,
|
|
741
|
+
strategy: l
|
|
742
|
+
}) : b);
|
|
743
|
+
return {
|
|
744
|
+
top: (R.top - A.top + p.top) / S.y,
|
|
745
|
+
bottom: (A.bottom - R.bottom + p.bottom) / S.y,
|
|
746
|
+
left: (R.left - A.left + p.left) / S.x,
|
|
747
|
+
right: (A.right - R.right + p.right) / S.x
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
const jr = (e) => ({
|
|
751
|
+
name: "arrow",
|
|
752
|
+
options: e,
|
|
753
|
+
async fn(t) {
|
|
754
|
+
const {
|
|
755
|
+
x: n,
|
|
756
|
+
y: r,
|
|
757
|
+
placement: o,
|
|
758
|
+
rects: i,
|
|
759
|
+
platform: s,
|
|
760
|
+
elements: c,
|
|
761
|
+
middlewareData: l
|
|
762
|
+
} = t, {
|
|
763
|
+
element: u,
|
|
764
|
+
padding: d = 0
|
|
765
|
+
} = $e(e, t) || {};
|
|
766
|
+
if (u == null)
|
|
767
|
+
return {};
|
|
768
|
+
const g = En(d), h = {
|
|
769
|
+
x: n,
|
|
770
|
+
y: r
|
|
771
|
+
}, a = Nt(o), p = Ft(a), m = await s.getDimensions(u), y = a === "y", R = y ? "top" : "left", b = y ? "bottom" : "right", w = y ? "clientHeight" : "clientWidth", S = i.reference[p] + i.reference[a] - h[a] - i.floating[p], A = h[a] - i.reference[a], I = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(u));
|
|
772
|
+
let M = I ? I[w] : 0;
|
|
773
|
+
(!M || !await (s.isElement == null ? void 0 : s.isElement(I))) && (M = c.floating[w] || i.floating[p]);
|
|
774
|
+
const D = S / 2 - A / 2, j = M / 2 - m[p] / 2 - 1, W = ke(g[R], j), B = ke(g[b], j), $ = W, V = M - m[p] - B, x = M / 2 - m[p] / 2 + D, E = St($, x, V), P = !l.arrow && Ve(o) != null && x !== E && i.reference[p] / 2 - (x < $ ? W : B) - m[p] / 2 < 0, T = P ? x < $ ? x - $ : x - V : 0;
|
|
775
|
+
return {
|
|
776
|
+
[a]: h[a] + T,
|
|
777
|
+
data: {
|
|
778
|
+
[a]: E,
|
|
779
|
+
centerOffset: x - E - T,
|
|
780
|
+
...P && {
|
|
781
|
+
alignmentOffset: T
|
|
782
|
+
}
|
|
783
|
+
},
|
|
784
|
+
reset: P
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
}), qr = function(e) {
|
|
788
|
+
return e === void 0 && (e = {}), {
|
|
789
|
+
name: "flip",
|
|
790
|
+
options: e,
|
|
791
|
+
async fn(t) {
|
|
792
|
+
var n, r;
|
|
793
|
+
const {
|
|
794
|
+
placement: o,
|
|
795
|
+
middlewareData: i,
|
|
796
|
+
rects: s,
|
|
797
|
+
initialPlacement: c,
|
|
798
|
+
platform: l,
|
|
799
|
+
elements: u
|
|
800
|
+
} = t, {
|
|
801
|
+
mainAxis: d = !0,
|
|
802
|
+
crossAxis: g = !0,
|
|
803
|
+
fallbackPlacements: h,
|
|
804
|
+
fallbackStrategy: a = "bestFit",
|
|
805
|
+
fallbackAxisSideDirection: p = "none",
|
|
806
|
+
flipAlignment: m = !0,
|
|
807
|
+
...y
|
|
808
|
+
} = $e(e, t);
|
|
809
|
+
if ((n = i.arrow) != null && n.alignmentOffset)
|
|
810
|
+
return {};
|
|
811
|
+
const R = Ce(o), b = ye(c), w = Ce(c) === c, S = await (l.isRTL == null ? void 0 : l.isRTL(u.floating)), A = h || (w || !m ? [Ge(c)] : lr(c)), I = p !== "none";
|
|
812
|
+
!h && I && A.push(...dr(c, m, p, S));
|
|
813
|
+
const M = [c, ...A], D = await Bn(t, y), j = [];
|
|
814
|
+
let W = ((r = i.flip) == null ? void 0 : r.overflows) || [];
|
|
815
|
+
if (d && j.push(D[R]), g) {
|
|
816
|
+
const x = cr(o, s, S);
|
|
817
|
+
j.push(D[x[0]], D[x[1]]);
|
|
818
|
+
}
|
|
819
|
+
if (W = [...W, {
|
|
820
|
+
placement: o,
|
|
821
|
+
overflows: j
|
|
822
|
+
}], !j.every((x) => x <= 0)) {
|
|
823
|
+
var B, $;
|
|
824
|
+
const x = (((B = i.flip) == null ? void 0 : B.index) || 0) + 1, E = M[x];
|
|
825
|
+
if (E && (!(g === "alignment" ? b !== ye(E) : !1) || // We leave the current main axis only if every placement on that axis
|
|
826
|
+
// overflows the main axis.
|
|
827
|
+
W.every((v) => ye(v.placement) === b ? v.overflows[0] > 0 : !0)))
|
|
828
|
+
return {
|
|
829
|
+
data: {
|
|
830
|
+
index: x,
|
|
831
|
+
overflows: W
|
|
832
|
+
},
|
|
833
|
+
reset: {
|
|
834
|
+
placement: E
|
|
835
|
+
}
|
|
836
|
+
};
|
|
837
|
+
let P = ($ = W.filter((T) => T.overflows[0] <= 0).sort((T, v) => T.overflows[1] - v.overflows[1])[0]) == null ? void 0 : $.placement;
|
|
838
|
+
if (!P)
|
|
839
|
+
switch (a) {
|
|
840
|
+
case "bestFit": {
|
|
841
|
+
var V;
|
|
842
|
+
const T = (V = W.filter((v) => {
|
|
843
|
+
if (I) {
|
|
844
|
+
const C = ye(v.placement);
|
|
845
|
+
return C === b || // Create a bias to the `y` side axis due to horizontal
|
|
846
|
+
// reading directions favoring greater width.
|
|
847
|
+
C === "y";
|
|
848
|
+
}
|
|
849
|
+
return !0;
|
|
850
|
+
}).map((v) => [v.placement, v.overflows.filter((C) => C > 0).reduce((C, L) => C + L, 0)]).sort((v, C) => v[1] - C[1])[0]) == null ? void 0 : V[0];
|
|
851
|
+
T && (P = T);
|
|
852
|
+
break;
|
|
853
|
+
}
|
|
854
|
+
case "initialPlacement":
|
|
855
|
+
P = c;
|
|
856
|
+
break;
|
|
857
|
+
}
|
|
858
|
+
if (o !== P)
|
|
859
|
+
return {
|
|
860
|
+
reset: {
|
|
861
|
+
placement: P
|
|
862
|
+
}
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
return {};
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
}, Xr = /* @__PURE__ */ new Set(["left", "top"]);
|
|
869
|
+
async function Ur(e, t) {
|
|
870
|
+
const {
|
|
871
|
+
placement: n,
|
|
872
|
+
platform: r,
|
|
873
|
+
elements: o
|
|
874
|
+
} = e, i = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), s = Ce(n), c = Ve(n), l = ye(n) === "y", u = Xr.has(s) ? -1 : 1, d = i && l ? -1 : 1, g = $e(t, e);
|
|
875
|
+
let {
|
|
876
|
+
mainAxis: h,
|
|
877
|
+
crossAxis: a,
|
|
878
|
+
alignmentAxis: p
|
|
879
|
+
} = typeof g == "number" ? {
|
|
880
|
+
mainAxis: g,
|
|
881
|
+
crossAxis: 0,
|
|
882
|
+
alignmentAxis: null
|
|
883
|
+
} : {
|
|
884
|
+
mainAxis: g.mainAxis || 0,
|
|
885
|
+
crossAxis: g.crossAxis || 0,
|
|
886
|
+
alignmentAxis: g.alignmentAxis
|
|
887
|
+
};
|
|
888
|
+
return c && typeof p == "number" && (a = c === "end" ? p * -1 : p), l ? {
|
|
889
|
+
x: a * d,
|
|
890
|
+
y: h * u
|
|
891
|
+
} : {
|
|
892
|
+
x: h * u,
|
|
893
|
+
y: a * d
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
const Yr = function(e) {
|
|
897
|
+
return e === void 0 && (e = 0), {
|
|
898
|
+
name: "offset",
|
|
899
|
+
options: e,
|
|
900
|
+
async fn(t) {
|
|
901
|
+
var n, r;
|
|
902
|
+
const {
|
|
903
|
+
x: o,
|
|
904
|
+
y: i,
|
|
905
|
+
placement: s,
|
|
906
|
+
middlewareData: c
|
|
907
|
+
} = t, l = await Ur(t, e);
|
|
908
|
+
return s === ((n = c.offset) == null ? void 0 : n.placement) && (r = c.arrow) != null && r.alignmentOffset ? {} : {
|
|
909
|
+
x: o + l.x,
|
|
910
|
+
y: i + l.y,
|
|
911
|
+
data: {
|
|
912
|
+
...l,
|
|
913
|
+
placement: s
|
|
914
|
+
}
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
}, zr = function(e) {
|
|
919
|
+
return e === void 0 && (e = {}), {
|
|
920
|
+
name: "shift",
|
|
921
|
+
options: e,
|
|
922
|
+
async fn(t) {
|
|
923
|
+
const {
|
|
924
|
+
x: n,
|
|
925
|
+
y: r,
|
|
926
|
+
placement: o
|
|
927
|
+
} = t, {
|
|
928
|
+
mainAxis: i = !0,
|
|
929
|
+
crossAxis: s = !1,
|
|
930
|
+
limiter: c = {
|
|
931
|
+
fn: (y) => {
|
|
932
|
+
let {
|
|
933
|
+
x: R,
|
|
934
|
+
y: b
|
|
935
|
+
} = y;
|
|
936
|
+
return {
|
|
937
|
+
x: R,
|
|
938
|
+
y: b
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
},
|
|
942
|
+
...l
|
|
943
|
+
} = $e(e, t), u = {
|
|
944
|
+
x: n,
|
|
945
|
+
y: r
|
|
946
|
+
}, d = await Bn(t, l), g = ye(Ce(o)), h = xn(g);
|
|
947
|
+
let a = u[h], p = u[g];
|
|
948
|
+
if (i) {
|
|
949
|
+
const y = h === "y" ? "top" : "left", R = h === "y" ? "bottom" : "right", b = a + d[y], w = a - d[R];
|
|
950
|
+
a = St(b, a, w);
|
|
951
|
+
}
|
|
952
|
+
if (s) {
|
|
953
|
+
const y = g === "y" ? "top" : "left", R = g === "y" ? "bottom" : "right", b = p + d[y], w = p - d[R];
|
|
954
|
+
p = St(b, p, w);
|
|
955
|
+
}
|
|
956
|
+
const m = c.fn({
|
|
957
|
+
...t,
|
|
958
|
+
[h]: a,
|
|
959
|
+
[g]: p
|
|
960
|
+
});
|
|
961
|
+
return {
|
|
962
|
+
...m,
|
|
963
|
+
data: {
|
|
964
|
+
x: m.x - n,
|
|
965
|
+
y: m.y - r,
|
|
966
|
+
enabled: {
|
|
967
|
+
[h]: i,
|
|
968
|
+
[g]: s
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
};
|
|
972
|
+
}
|
|
973
|
+
};
|
|
974
|
+
};
|
|
975
|
+
function Wn(e) {
|
|
976
|
+
const t = oe(e);
|
|
977
|
+
let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
|
|
978
|
+
const o = U(e), i = o ? e.offsetWidth : n, s = o ? e.offsetHeight : r, c = ze(n) !== i || ze(r) !== s;
|
|
979
|
+
return c && (n = i, r = s), {
|
|
980
|
+
width: n,
|
|
981
|
+
height: r,
|
|
982
|
+
$: c
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
function $t(e) {
|
|
986
|
+
return K(e) ? e : e.contextElement;
|
|
987
|
+
}
|
|
988
|
+
function Le(e) {
|
|
989
|
+
const t = $t(e);
|
|
990
|
+
if (!U(t))
|
|
991
|
+
return le(1);
|
|
992
|
+
const n = t.getBoundingClientRect(), {
|
|
993
|
+
width: r,
|
|
994
|
+
height: o,
|
|
995
|
+
$: i
|
|
996
|
+
} = Wn(t);
|
|
997
|
+
let s = (i ? ze(n.width) : n.width) / r, c = (i ? ze(n.height) : n.height) / o;
|
|
998
|
+
return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
999
|
+
x: s,
|
|
1000
|
+
y: c
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
const Gr = /* @__PURE__ */ le(0);
|
|
1004
|
+
function $n(e) {
|
|
1005
|
+
const t = ee(e);
|
|
1006
|
+
return !it() || !t.visualViewport ? Gr : {
|
|
1007
|
+
x: t.visualViewport.offsetLeft,
|
|
1008
|
+
y: t.visualViewport.offsetTop
|
|
1009
|
+
};
|
|
1010
|
+
}
|
|
1011
|
+
function Zr(e, t, n) {
|
|
1012
|
+
return t === void 0 && (t = !1), !n || t && n !== ee(e) ? !1 : t;
|
|
1013
|
+
}
|
|
1014
|
+
function Ae(e, t, n, r) {
|
|
1015
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
1016
|
+
const o = e.getBoundingClientRect(), i = $t(e);
|
|
1017
|
+
let s = le(1);
|
|
1018
|
+
t && (r ? K(r) && (s = Le(r)) : s = Le(e));
|
|
1019
|
+
const c = Zr(i, n, r) ? $n(i) : le(0);
|
|
1020
|
+
let l = (o.left + c.x) / s.x, u = (o.top + c.y) / s.y, d = o.width / s.x, g = o.height / s.y;
|
|
1021
|
+
if (i) {
|
|
1022
|
+
const h = ee(i), a = r && K(r) ? ee(r) : r;
|
|
1023
|
+
let p = h, m = Tt(p);
|
|
1024
|
+
for (; m && r && a !== p; ) {
|
|
1025
|
+
const y = Le(m), R = m.getBoundingClientRect(), b = oe(m), w = R.left + (m.clientLeft + parseFloat(b.paddingLeft)) * y.x, S = R.top + (m.clientTop + parseFloat(b.paddingTop)) * y.y;
|
|
1026
|
+
l *= y.x, u *= y.y, d *= y.x, g *= y.y, l += w, u += S, p = ee(m), m = Tt(p);
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
return Ze({
|
|
1030
|
+
width: d,
|
|
1031
|
+
height: g,
|
|
1032
|
+
x: l,
|
|
1033
|
+
y: u
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
function lt(e, t) {
|
|
1037
|
+
const n = st(e).scrollLeft;
|
|
1038
|
+
return t ? t.left + n : Ae(ue(e)).left + n;
|
|
1039
|
+
}
|
|
1040
|
+
function Vn(e, t) {
|
|
1041
|
+
const n = e.getBoundingClientRect(), r = n.left + t.scrollLeft - lt(e, n), o = n.top + t.scrollTop;
|
|
1042
|
+
return {
|
|
1043
|
+
x: r,
|
|
1044
|
+
y: o
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
function Jr(e) {
|
|
1048
|
+
let {
|
|
1049
|
+
elements: t,
|
|
1050
|
+
rect: n,
|
|
1051
|
+
offsetParent: r,
|
|
1052
|
+
strategy: o
|
|
1053
|
+
} = e;
|
|
1054
|
+
const i = o === "fixed", s = ue(r), c = t ? ot(t.floating) : !1;
|
|
1055
|
+
if (r === s || c && i)
|
|
1056
|
+
return n;
|
|
1057
|
+
let l = {
|
|
1058
|
+
scrollLeft: 0,
|
|
1059
|
+
scrollTop: 0
|
|
1060
|
+
}, u = le(1);
|
|
1061
|
+
const d = le(0), g = U(r);
|
|
1062
|
+
if ((g || !g && !i) && ((xe(r) !== "body" || We(s)) && (l = st(r)), U(r))) {
|
|
1063
|
+
const a = Ae(r);
|
|
1064
|
+
u = Le(r), d.x = a.x + r.clientLeft, d.y = a.y + r.clientTop;
|
|
1065
|
+
}
|
|
1066
|
+
const h = s && !g && !i ? Vn(s, l) : le(0);
|
|
1067
|
+
return {
|
|
1068
|
+
width: n.width * u.x,
|
|
1069
|
+
height: n.height * u.y,
|
|
1070
|
+
x: n.x * u.x - l.scrollLeft * u.x + d.x + h.x,
|
|
1071
|
+
y: n.y * u.y - l.scrollTop * u.y + d.y + h.y
|
|
1072
|
+
};
|
|
1073
|
+
}
|
|
1074
|
+
function Qr(e) {
|
|
1075
|
+
return Array.from(e.getClientRects());
|
|
1076
|
+
}
|
|
1077
|
+
function eo(e) {
|
|
1078
|
+
const t = ue(e), n = st(e), r = e.ownerDocument.body, o = Se(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), i = Se(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
|
|
1079
|
+
let s = -n.scrollLeft + lt(e);
|
|
1080
|
+
const c = -n.scrollTop;
|
|
1081
|
+
return oe(r).direction === "rtl" && (s += Se(t.clientWidth, r.clientWidth) - o), {
|
|
1082
|
+
width: o,
|
|
1083
|
+
height: i,
|
|
1084
|
+
x: s,
|
|
1085
|
+
y: c
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
const Zt = 25;
|
|
1089
|
+
function to(e, t) {
|
|
1090
|
+
const n = ee(e), r = ue(e), o = n.visualViewport;
|
|
1091
|
+
let i = r.clientWidth, s = r.clientHeight, c = 0, l = 0;
|
|
1092
|
+
if (o) {
|
|
1093
|
+
i = o.width, s = o.height;
|
|
1094
|
+
const d = it();
|
|
1095
|
+
(!d || d && t === "fixed") && (c = o.offsetLeft, l = o.offsetTop);
|
|
1096
|
+
}
|
|
1097
|
+
const u = lt(r);
|
|
1098
|
+
if (u <= 0) {
|
|
1099
|
+
const d = r.ownerDocument, g = d.body, h = getComputedStyle(g), a = d.compatMode === "CSS1Compat" && parseFloat(h.marginLeft) + parseFloat(h.marginRight) || 0, p = Math.abs(r.clientWidth - g.clientWidth - a);
|
|
1100
|
+
p <= Zt && (i -= p);
|
|
1101
|
+
} else u <= Zt && (i += u);
|
|
1102
|
+
return {
|
|
1103
|
+
width: i,
|
|
1104
|
+
height: s,
|
|
1105
|
+
x: c,
|
|
1106
|
+
y: l
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
1109
|
+
const no = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
1110
|
+
function ro(e, t) {
|
|
1111
|
+
const n = Ae(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, i = U(e) ? Le(e) : le(1), s = e.clientWidth * i.x, c = e.clientHeight * i.y, l = o * i.x, u = r * i.y;
|
|
1112
|
+
return {
|
|
1113
|
+
width: s,
|
|
1114
|
+
height: c,
|
|
1115
|
+
x: l,
|
|
1116
|
+
y: u
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1119
|
+
function Jt(e, t, n) {
|
|
1120
|
+
let r;
|
|
1121
|
+
if (t === "viewport")
|
|
1122
|
+
r = to(e, n);
|
|
1123
|
+
else if (t === "document")
|
|
1124
|
+
r = eo(ue(e));
|
|
1125
|
+
else if (K(t))
|
|
1126
|
+
r = ro(t, n);
|
|
1127
|
+
else {
|
|
1128
|
+
const o = $n(e);
|
|
1129
|
+
r = {
|
|
1130
|
+
x: t.x - o.x,
|
|
1131
|
+
y: t.y - o.y,
|
|
1132
|
+
width: t.width,
|
|
1133
|
+
height: t.height
|
|
1134
|
+
};
|
|
1135
|
+
}
|
|
1136
|
+
return Ze(r);
|
|
1137
|
+
}
|
|
1138
|
+
function _n(e, t) {
|
|
1139
|
+
const n = ge(e);
|
|
1140
|
+
return n === t || !K(n) || me(n) ? !1 : oe(n).position === "fixed" || _n(n, t);
|
|
1141
|
+
}
|
|
1142
|
+
function oo(e, t) {
|
|
1143
|
+
const n = t.get(e);
|
|
1144
|
+
if (n)
|
|
1145
|
+
return n;
|
|
1146
|
+
let r = Re(e, [], !1).filter((c) => K(c) && xe(c) !== "body"), o = null;
|
|
1147
|
+
const i = oe(e).position === "fixed";
|
|
1148
|
+
let s = i ? ge(e) : e;
|
|
1149
|
+
for (; K(s) && !me(s); ) {
|
|
1150
|
+
const c = oe(s), l = Dt(s);
|
|
1151
|
+
!l && c.position === "fixed" && (o = null), (i ? !l && !o : !l && c.position === "static" && !!o && no.has(o.position) || We(s) && !l && _n(e, s)) ? r = r.filter((d) => d !== s) : o = c, s = ge(s);
|
|
1152
|
+
}
|
|
1153
|
+
return t.set(e, r), r;
|
|
1154
|
+
}
|
|
1155
|
+
function io(e) {
|
|
1156
|
+
let {
|
|
1157
|
+
element: t,
|
|
1158
|
+
boundary: n,
|
|
1159
|
+
rootBoundary: r,
|
|
1160
|
+
strategy: o
|
|
1161
|
+
} = e;
|
|
1162
|
+
const s = [...n === "clippingAncestors" ? ot(t) ? [] : oo(t, this._c) : [].concat(n), r], c = s[0], l = s.reduce((u, d) => {
|
|
1163
|
+
const g = Jt(t, d, o);
|
|
1164
|
+
return u.top = Se(g.top, u.top), u.right = ke(g.right, u.right), u.bottom = ke(g.bottom, u.bottom), u.left = Se(g.left, u.left), u;
|
|
1165
|
+
}, Jt(t, c, o));
|
|
1166
|
+
return {
|
|
1167
|
+
width: l.right - l.left,
|
|
1168
|
+
height: l.bottom - l.top,
|
|
1169
|
+
x: l.left,
|
|
1170
|
+
y: l.top
|
|
1171
|
+
};
|
|
1172
|
+
}
|
|
1173
|
+
function so(e) {
|
|
1174
|
+
const {
|
|
1175
|
+
width: t,
|
|
1176
|
+
height: n
|
|
1177
|
+
} = Wn(e);
|
|
1178
|
+
return {
|
|
1179
|
+
width: t,
|
|
1180
|
+
height: n
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
function co(e, t, n) {
|
|
1184
|
+
const r = U(t), o = ue(t), i = n === "fixed", s = Ae(e, !0, i, t);
|
|
1185
|
+
let c = {
|
|
1186
|
+
scrollLeft: 0,
|
|
1187
|
+
scrollTop: 0
|
|
1188
|
+
};
|
|
1189
|
+
const l = le(0);
|
|
1190
|
+
function u() {
|
|
1191
|
+
l.x = lt(o);
|
|
1192
|
+
}
|
|
1193
|
+
if (r || !r && !i)
|
|
1194
|
+
if ((xe(t) !== "body" || We(o)) && (c = st(t)), r) {
|
|
1195
|
+
const a = Ae(t, !0, i, t);
|
|
1196
|
+
l.x = a.x + t.clientLeft, l.y = a.y + t.clientTop;
|
|
1197
|
+
} else o && u();
|
|
1198
|
+
i && !r && o && u();
|
|
1199
|
+
const d = o && !r && !i ? Vn(o, c) : le(0), g = s.left + c.scrollLeft - l.x - d.x, h = s.top + c.scrollTop - l.y - d.y;
|
|
1200
|
+
return {
|
|
1201
|
+
x: g,
|
|
1202
|
+
y: h,
|
|
1203
|
+
width: s.width,
|
|
1204
|
+
height: s.height
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
function vt(e) {
|
|
1208
|
+
return oe(e).position === "static";
|
|
1209
|
+
}
|
|
1210
|
+
function Qt(e, t) {
|
|
1211
|
+
if (!U(e) || oe(e).position === "fixed")
|
|
1212
|
+
return null;
|
|
1213
|
+
if (t)
|
|
1214
|
+
return t(e);
|
|
1215
|
+
let n = e.offsetParent;
|
|
1216
|
+
return ue(e) === n && (n = n.ownerDocument.body), n;
|
|
1217
|
+
}
|
|
1218
|
+
function Hn(e, t) {
|
|
1219
|
+
const n = ee(e);
|
|
1220
|
+
if (ot(e))
|
|
1221
|
+
return n;
|
|
1222
|
+
if (!U(e)) {
|
|
1223
|
+
let o = ge(e);
|
|
1224
|
+
for (; o && !me(o); ) {
|
|
1225
|
+
if (K(o) && !vt(o))
|
|
1226
|
+
return o;
|
|
1227
|
+
o = ge(o);
|
|
1228
|
+
}
|
|
1229
|
+
return n;
|
|
1230
|
+
}
|
|
1231
|
+
let r = Qt(e, t);
|
|
1232
|
+
for (; r && Zn(r) && vt(r); )
|
|
1233
|
+
r = Qt(r, t);
|
|
1234
|
+
return r && me(r) && vt(r) && !Dt(r) ? n : r || nr(e) || n;
|
|
1235
|
+
}
|
|
1236
|
+
const lo = async function(e) {
|
|
1237
|
+
const t = this.getOffsetParent || Hn, n = this.getDimensions, r = await n(e.floating);
|
|
1238
|
+
return {
|
|
1239
|
+
reference: co(e.reference, await t(e.floating), e.strategy),
|
|
1240
|
+
floating: {
|
|
1241
|
+
x: 0,
|
|
1242
|
+
y: 0,
|
|
1243
|
+
width: r.width,
|
|
1244
|
+
height: r.height
|
|
1245
|
+
}
|
|
1246
|
+
};
|
|
1247
|
+
};
|
|
1248
|
+
function uo(e) {
|
|
1249
|
+
return oe(e).direction === "rtl";
|
|
1250
|
+
}
|
|
1251
|
+
const ao = {
|
|
1252
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Jr,
|
|
1253
|
+
getDocumentElement: ue,
|
|
1254
|
+
getClippingRect: io,
|
|
1255
|
+
getOffsetParent: Hn,
|
|
1256
|
+
getElementRects: lo,
|
|
1257
|
+
getClientRects: Qr,
|
|
1258
|
+
getDimensions: so,
|
|
1259
|
+
getScale: Le,
|
|
1260
|
+
isElement: K,
|
|
1261
|
+
isRTL: uo
|
|
1262
|
+
};
|
|
1263
|
+
function Kn(e, t) {
|
|
1264
|
+
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
1265
|
+
}
|
|
1266
|
+
function fo(e, t) {
|
|
1267
|
+
let n = null, r;
|
|
1268
|
+
const o = ue(e);
|
|
1269
|
+
function i() {
|
|
1270
|
+
var c;
|
|
1271
|
+
clearTimeout(r), (c = n) == null || c.disconnect(), n = null;
|
|
1272
|
+
}
|
|
1273
|
+
function s(c, l) {
|
|
1274
|
+
c === void 0 && (c = !1), l === void 0 && (l = 1), i();
|
|
1275
|
+
const u = e.getBoundingClientRect(), {
|
|
1276
|
+
left: d,
|
|
1277
|
+
top: g,
|
|
1278
|
+
width: h,
|
|
1279
|
+
height: a
|
|
1280
|
+
} = u;
|
|
1281
|
+
if (c || t(), !h || !a)
|
|
1282
|
+
return;
|
|
1283
|
+
const p = je(g), m = je(o.clientWidth - (d + h)), y = je(o.clientHeight - (g + a)), R = je(d), w = {
|
|
1284
|
+
rootMargin: -p + "px " + -m + "px " + -y + "px " + -R + "px",
|
|
1285
|
+
threshold: Se(0, ke(1, l)) || 1
|
|
1286
|
+
};
|
|
1287
|
+
let S = !0;
|
|
1288
|
+
function A(I) {
|
|
1289
|
+
const M = I[0].intersectionRatio;
|
|
1290
|
+
if (M !== l) {
|
|
1291
|
+
if (!S)
|
|
1292
|
+
return s();
|
|
1293
|
+
M ? s(!1, M) : r = setTimeout(() => {
|
|
1294
|
+
s(!1, 1e-7);
|
|
1295
|
+
}, 1e3);
|
|
1296
|
+
}
|
|
1297
|
+
M === 1 && !Kn(u, e.getBoundingClientRect()) && s(), S = !1;
|
|
1298
|
+
}
|
|
1299
|
+
try {
|
|
1300
|
+
n = new IntersectionObserver(A, {
|
|
1301
|
+
...w,
|
|
1302
|
+
// Handle <iframe>s
|
|
1303
|
+
root: o.ownerDocument
|
|
1304
|
+
});
|
|
1305
|
+
} catch {
|
|
1306
|
+
n = new IntersectionObserver(A, w);
|
|
1307
|
+
}
|
|
1308
|
+
n.observe(e);
|
|
1309
|
+
}
|
|
1310
|
+
return s(!0), i;
|
|
1311
|
+
}
|
|
1312
|
+
function zo(e, t, n, r) {
|
|
1313
|
+
r === void 0 && (r = {});
|
|
1314
|
+
const {
|
|
1315
|
+
ancestorScroll: o = !0,
|
|
1316
|
+
ancestorResize: i = !0,
|
|
1317
|
+
elementResize: s = typeof ResizeObserver == "function",
|
|
1318
|
+
layoutShift: c = typeof IntersectionObserver == "function",
|
|
1319
|
+
animationFrame: l = !1
|
|
1320
|
+
} = r, u = $t(e), d = o || i ? [...u ? Re(u) : [], ...Re(t)] : [];
|
|
1321
|
+
d.forEach((R) => {
|
|
1322
|
+
o && R.addEventListener("scroll", n, {
|
|
1323
|
+
passive: !0
|
|
1324
|
+
}), i && R.addEventListener("resize", n);
|
|
1325
|
+
});
|
|
1326
|
+
const g = u && c ? fo(u, n) : null;
|
|
1327
|
+
let h = -1, a = null;
|
|
1328
|
+
s && (a = new ResizeObserver((R) => {
|
|
1329
|
+
let [b] = R;
|
|
1330
|
+
b && b.target === u && a && (a.unobserve(t), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
|
|
1331
|
+
var w;
|
|
1332
|
+
(w = a) == null || w.observe(t);
|
|
1333
|
+
})), n();
|
|
1334
|
+
}), u && !l && a.observe(u), a.observe(t));
|
|
1335
|
+
let p, m = l ? Ae(e) : null;
|
|
1336
|
+
l && y();
|
|
1337
|
+
function y() {
|
|
1338
|
+
const R = Ae(e);
|
|
1339
|
+
m && !Kn(m, R) && n(), m = R, p = requestAnimationFrame(y);
|
|
1340
|
+
}
|
|
1341
|
+
return n(), () => {
|
|
1342
|
+
var R;
|
|
1343
|
+
d.forEach((b) => {
|
|
1344
|
+
o && b.removeEventListener("scroll", n), i && b.removeEventListener("resize", n);
|
|
1345
|
+
}), g?.(), (R = a) == null || R.disconnect(), a = null, l && cancelAnimationFrame(p);
|
|
1346
|
+
};
|
|
1347
|
+
}
|
|
1348
|
+
const mo = Yr, go = zr, po = qr, en = jr, vo = (e, t, n) => {
|
|
1349
|
+
const r = /* @__PURE__ */ new Map(), o = {
|
|
1350
|
+
platform: ao,
|
|
1351
|
+
...n
|
|
1352
|
+
}, i = {
|
|
1353
|
+
...o.platform,
|
|
1354
|
+
_c: r
|
|
1355
|
+
};
|
|
1356
|
+
return Kr(e, t, {
|
|
1357
|
+
...o,
|
|
1358
|
+
platform: i
|
|
1359
|
+
});
|
|
1360
|
+
};
|
|
1361
|
+
var ho = typeof document < "u", bo = function() {
|
|
1362
|
+
}, Ye = ho ? wn : bo;
|
|
1363
|
+
function tt(e, t) {
|
|
1364
|
+
if (e === t)
|
|
1365
|
+
return !0;
|
|
1366
|
+
if (typeof e != typeof t)
|
|
1367
|
+
return !1;
|
|
1368
|
+
if (typeof e == "function" && e.toString() === t.toString())
|
|
1369
|
+
return !0;
|
|
1370
|
+
let n, r, o;
|
|
1371
|
+
if (e && t && typeof e == "object") {
|
|
1372
|
+
if (Array.isArray(e)) {
|
|
1373
|
+
if (n = e.length, n !== t.length) return !1;
|
|
1374
|
+
for (r = n; r-- !== 0; )
|
|
1375
|
+
if (!tt(e[r], t[r]))
|
|
1376
|
+
return !1;
|
|
1377
|
+
return !0;
|
|
1378
|
+
}
|
|
1379
|
+
if (o = Object.keys(e), n = o.length, n !== Object.keys(t).length)
|
|
1380
|
+
return !1;
|
|
1381
|
+
for (r = n; r-- !== 0; )
|
|
1382
|
+
if (!{}.hasOwnProperty.call(t, o[r]))
|
|
1383
|
+
return !1;
|
|
1384
|
+
for (r = n; r-- !== 0; ) {
|
|
1385
|
+
const i = o[r];
|
|
1386
|
+
if (!(i === "_owner" && e.$$typeof) && !tt(e[i], t[i]))
|
|
1387
|
+
return !1;
|
|
1388
|
+
}
|
|
1389
|
+
return !0;
|
|
1390
|
+
}
|
|
1391
|
+
return e !== e && t !== t;
|
|
1392
|
+
}
|
|
1393
|
+
function jn(e) {
|
|
1394
|
+
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1395
|
+
}
|
|
1396
|
+
function tn(e, t) {
|
|
1397
|
+
const n = jn(e);
|
|
1398
|
+
return Math.round(t * n) / n;
|
|
1399
|
+
}
|
|
1400
|
+
function ht(e) {
|
|
1401
|
+
const t = f.useRef(e);
|
|
1402
|
+
return Ye(() => {
|
|
1403
|
+
t.current = e;
|
|
1404
|
+
}), t;
|
|
1405
|
+
}
|
|
1406
|
+
function yo(e) {
|
|
1407
|
+
e === void 0 && (e = {});
|
|
1408
|
+
const {
|
|
1409
|
+
placement: t = "bottom",
|
|
1410
|
+
strategy: n = "absolute",
|
|
1411
|
+
middleware: r = [],
|
|
1412
|
+
platform: o,
|
|
1413
|
+
elements: {
|
|
1414
|
+
reference: i,
|
|
1415
|
+
floating: s
|
|
1416
|
+
} = {},
|
|
1417
|
+
transform: c = !0,
|
|
1418
|
+
whileElementsMounted: l,
|
|
1419
|
+
open: u
|
|
1420
|
+
} = e, [d, g] = f.useState({
|
|
1421
|
+
x: 0,
|
|
1422
|
+
y: 0,
|
|
1423
|
+
strategy: n,
|
|
1424
|
+
placement: t,
|
|
1425
|
+
middlewareData: {},
|
|
1426
|
+
isPositioned: !1
|
|
1427
|
+
}), [h, a] = f.useState(r);
|
|
1428
|
+
tt(h, r) || a(r);
|
|
1429
|
+
const [p, m] = f.useState(null), [y, R] = f.useState(null), b = f.useCallback((v) => {
|
|
1430
|
+
v !== I.current && (I.current = v, m(v));
|
|
1431
|
+
}, []), w = f.useCallback((v) => {
|
|
1432
|
+
v !== M.current && (M.current = v, R(v));
|
|
1433
|
+
}, []), S = i || p, A = s || y, I = f.useRef(null), M = f.useRef(null), D = f.useRef(d), j = l != null, W = ht(l), B = ht(o), $ = ht(u), V = f.useCallback(() => {
|
|
1434
|
+
if (!I.current || !M.current)
|
|
1435
|
+
return;
|
|
1436
|
+
const v = {
|
|
1437
|
+
placement: t,
|
|
1438
|
+
strategy: n,
|
|
1439
|
+
middleware: h
|
|
1440
|
+
};
|
|
1441
|
+
B.current && (v.platform = B.current), vo(I.current, M.current, v).then((C) => {
|
|
1442
|
+
const L = {
|
|
1443
|
+
...C,
|
|
1444
|
+
// The floating element's position may be recomputed while it's closed
|
|
1445
|
+
// but still mounted (such as when transitioning out). To ensure
|
|
1446
|
+
// `isPositioned` will be `false` initially on the next open, avoid
|
|
1447
|
+
// setting it to `true` when `open === false` (must be specified).
|
|
1448
|
+
isPositioned: $.current !== !1
|
|
1449
|
+
};
|
|
1450
|
+
x.current && !tt(D.current, L) && (D.current = L, It.flushSync(() => {
|
|
1451
|
+
g(L);
|
|
1452
|
+
}));
|
|
1453
|
+
});
|
|
1454
|
+
}, [h, t, n, B, $]);
|
|
1455
|
+
Ye(() => {
|
|
1456
|
+
u === !1 && D.current.isPositioned && (D.current.isPositioned = !1, g((v) => ({
|
|
1457
|
+
...v,
|
|
1458
|
+
isPositioned: !1
|
|
1459
|
+
})));
|
|
1460
|
+
}, [u]);
|
|
1461
|
+
const x = f.useRef(!1);
|
|
1462
|
+
Ye(() => (x.current = !0, () => {
|
|
1463
|
+
x.current = !1;
|
|
1464
|
+
}), []), Ye(() => {
|
|
1465
|
+
if (S && (I.current = S), A && (M.current = A), S && A) {
|
|
1466
|
+
if (W.current)
|
|
1467
|
+
return W.current(S, A, V);
|
|
1468
|
+
V();
|
|
1469
|
+
}
|
|
1470
|
+
}, [S, A, V, W, j]);
|
|
1471
|
+
const E = f.useMemo(() => ({
|
|
1472
|
+
reference: I,
|
|
1473
|
+
floating: M,
|
|
1474
|
+
setReference: b,
|
|
1475
|
+
setFloating: w
|
|
1476
|
+
}), [b, w]), P = f.useMemo(() => ({
|
|
1477
|
+
reference: S,
|
|
1478
|
+
floating: A
|
|
1479
|
+
}), [S, A]), T = f.useMemo(() => {
|
|
1480
|
+
const v = {
|
|
1481
|
+
position: n,
|
|
1482
|
+
left: 0,
|
|
1483
|
+
top: 0
|
|
1484
|
+
};
|
|
1485
|
+
if (!P.floating)
|
|
1486
|
+
return v;
|
|
1487
|
+
const C = tn(P.floating, d.x), L = tn(P.floating, d.y);
|
|
1488
|
+
return c ? {
|
|
1489
|
+
...v,
|
|
1490
|
+
transform: "translate(" + C + "px, " + L + "px)",
|
|
1491
|
+
...jn(P.floating) >= 1.5 && {
|
|
1492
|
+
willChange: "transform"
|
|
1493
|
+
}
|
|
1494
|
+
} : {
|
|
1495
|
+
position: n,
|
|
1496
|
+
left: C,
|
|
1497
|
+
top: L
|
|
1498
|
+
};
|
|
1499
|
+
}, [n, c, P.floating, d.x, d.y]);
|
|
1500
|
+
return f.useMemo(() => ({
|
|
1501
|
+
...d,
|
|
1502
|
+
update: V,
|
|
1503
|
+
refs: E,
|
|
1504
|
+
elements: P,
|
|
1505
|
+
floatingStyles: T
|
|
1506
|
+
}), [d, V, E, P, T]);
|
|
1507
|
+
}
|
|
1508
|
+
const wo = (e) => {
|
|
1509
|
+
function t(n) {
|
|
1510
|
+
return {}.hasOwnProperty.call(n, "current");
|
|
1511
|
+
}
|
|
1512
|
+
return {
|
|
1513
|
+
name: "arrow",
|
|
1514
|
+
options: e,
|
|
1515
|
+
fn(n) {
|
|
1516
|
+
const {
|
|
1517
|
+
element: r,
|
|
1518
|
+
padding: o
|
|
1519
|
+
} = typeof e == "function" ? e(n) : e;
|
|
1520
|
+
return r && t(r) ? r.current != null ? en({
|
|
1521
|
+
element: r.current,
|
|
1522
|
+
padding: o
|
|
1523
|
+
}).fn(n) : {} : r ? en({
|
|
1524
|
+
element: r,
|
|
1525
|
+
padding: o
|
|
1526
|
+
}).fn(n) : {};
|
|
1527
|
+
}
|
|
1528
|
+
};
|
|
1529
|
+
}, Go = (e, t) => ({
|
|
1530
|
+
...mo(e),
|
|
1531
|
+
options: [e, t]
|
|
1532
|
+
}), Zo = (e, t) => ({
|
|
1533
|
+
...go(e),
|
|
1534
|
+
options: [e, t]
|
|
1535
|
+
}), Jo = (e, t) => ({
|
|
1536
|
+
...po(e),
|
|
1537
|
+
options: [e, t]
|
|
1538
|
+
}), Qo = (e, t) => ({
|
|
1539
|
+
...wo(e),
|
|
1540
|
+
options: [e, t]
|
|
1541
|
+
});
|
|
1542
|
+
function ei(e) {
|
|
1543
|
+
const t = f.useRef(void 0), n = f.useCallback((r) => {
|
|
1544
|
+
const o = e.map((i) => {
|
|
1545
|
+
if (i != null) {
|
|
1546
|
+
if (typeof i == "function") {
|
|
1547
|
+
const s = i, c = s(r);
|
|
1548
|
+
return typeof c == "function" ? c : () => {
|
|
1549
|
+
s(null);
|
|
1550
|
+
};
|
|
1551
|
+
}
|
|
1552
|
+
return i.current = r, () => {
|
|
1553
|
+
i.current = null;
|
|
1554
|
+
};
|
|
1555
|
+
}
|
|
1556
|
+
});
|
|
1557
|
+
return () => {
|
|
1558
|
+
o.forEach((i) => i?.());
|
|
1559
|
+
};
|
|
1560
|
+
}, e);
|
|
1561
|
+
return f.useMemo(() => e.every((r) => r == null) ? null : (r) => {
|
|
1562
|
+
t.current && (t.current(), t.current = void 0), r != null && (t.current = n(r));
|
|
1563
|
+
}, e);
|
|
1564
|
+
}
|
|
1565
|
+
const Ro = "data-floating-ui-focusable", nn = "active", rn = "selected", xo = {
|
|
1566
|
+
...f
|
|
1567
|
+
};
|
|
1568
|
+
let on = !1, Eo = 0;
|
|
1569
|
+
const sn = () => (
|
|
1570
|
+
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
1571
|
+
// on <React 18
|
|
1572
|
+
"floating-ui-" + Math.random().toString(36).slice(2, 6) + Eo++
|
|
1573
|
+
);
|
|
1574
|
+
function To() {
|
|
1575
|
+
const [e, t] = f.useState(() => on ? sn() : void 0);
|
|
1576
|
+
return G(() => {
|
|
1577
|
+
e == null && t(sn());
|
|
1578
|
+
}, []), f.useEffect(() => {
|
|
1579
|
+
on = !0;
|
|
1580
|
+
}, []), e;
|
|
1581
|
+
}
|
|
1582
|
+
const So = xo.useId, ut = So || To;
|
|
1583
|
+
let Be;
|
|
1584
|
+
process.env.NODE_ENV !== "production" && (Be = /* @__PURE__ */ new Set());
|
|
1585
|
+
function Co() {
|
|
1586
|
+
for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
1587
|
+
n[r] = arguments[r];
|
|
1588
|
+
const o = "Floating UI: " + n.join(" ");
|
|
1589
|
+
if (!((e = Be) != null && e.has(o))) {
|
|
1590
|
+
var i;
|
|
1591
|
+
(i = Be) == null || i.add(o), console.warn(o);
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
function Ao() {
|
|
1595
|
+
for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
1596
|
+
n[r] = arguments[r];
|
|
1597
|
+
const o = "Floating UI: " + n.join(" ");
|
|
1598
|
+
if (!((e = Be) != null && e.has(o))) {
|
|
1599
|
+
var i;
|
|
1600
|
+
(i = Be) == null || i.add(o), console.error(o);
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
const ti = /* @__PURE__ */ f.forwardRef(function(t, n) {
|
|
1604
|
+
const {
|
|
1605
|
+
context: {
|
|
1606
|
+
placement: r,
|
|
1607
|
+
elements: {
|
|
1608
|
+
floating: o
|
|
1609
|
+
},
|
|
1610
|
+
middlewareData: {
|
|
1611
|
+
arrow: i,
|
|
1612
|
+
shift: s
|
|
1613
|
+
}
|
|
1614
|
+
},
|
|
1615
|
+
width: c = 14,
|
|
1616
|
+
height: l = 7,
|
|
1617
|
+
tipRadius: u = 0,
|
|
1618
|
+
strokeWidth: d = 0,
|
|
1619
|
+
staticOffset: g,
|
|
1620
|
+
stroke: h,
|
|
1621
|
+
d: a,
|
|
1622
|
+
style: {
|
|
1623
|
+
transform: p,
|
|
1624
|
+
...m
|
|
1625
|
+
} = {},
|
|
1626
|
+
...y
|
|
1627
|
+
} = t;
|
|
1628
|
+
process.env.NODE_ENV !== "production" && (n || Co("The `ref` prop is required for `FloatingArrow`."));
|
|
1629
|
+
const R = ut(), [b, w] = f.useState(!1);
|
|
1630
|
+
if (G(() => {
|
|
1631
|
+
if (!o) return;
|
|
1632
|
+
oe(o).direction === "rtl" && w(!0);
|
|
1633
|
+
}, [o]), !o)
|
|
1634
|
+
return null;
|
|
1635
|
+
const [S, A] = r.split("-"), I = S === "top" || S === "bottom";
|
|
1636
|
+
let M = g;
|
|
1637
|
+
(I && s != null && s.x || !I && s != null && s.y) && (M = null);
|
|
1638
|
+
const D = d * 2, j = D / 2, W = c / 2 * (u / -8 + 1), B = l / 2 * u / 4, $ = !!a, V = M && A === "end" ? "bottom" : "top";
|
|
1639
|
+
let x = M && A === "end" ? "right" : "left";
|
|
1640
|
+
M && b && (x = A === "end" ? "left" : "right");
|
|
1641
|
+
const E = i?.x != null ? M || i.x : "", P = i?.y != null ? M || i.y : "", T = a || "M0,0" + (" H" + c) + (" L" + (c - W) + "," + (l - B)) + (" Q" + c / 2 + "," + l + " " + W + "," + (l - B)) + " Z", v = {
|
|
1642
|
+
top: $ ? "rotate(180deg)" : "",
|
|
1643
|
+
left: $ ? "rotate(90deg)" : "rotate(-90deg)",
|
|
1644
|
+
bottom: $ ? "" : "rotate(180deg)",
|
|
1645
|
+
right: $ ? "rotate(-90deg)" : "rotate(90deg)"
|
|
1646
|
+
}[S];
|
|
1647
|
+
return /* @__PURE__ */ Lt("svg", {
|
|
1648
|
+
...y,
|
|
1649
|
+
"aria-hidden": !0,
|
|
1650
|
+
ref: n,
|
|
1651
|
+
width: $ ? c : c + D,
|
|
1652
|
+
height: c,
|
|
1653
|
+
viewBox: "0 0 " + c + " " + (l > c ? l : c),
|
|
1654
|
+
style: {
|
|
1655
|
+
position: "absolute",
|
|
1656
|
+
pointerEvents: "none",
|
|
1657
|
+
[x]: E,
|
|
1658
|
+
[V]: P,
|
|
1659
|
+
[S]: I || $ ? "100%" : "calc(100% - " + D / 2 + "px)",
|
|
1660
|
+
transform: [v, p].filter((C) => !!C).join(" "),
|
|
1661
|
+
...m
|
|
1662
|
+
},
|
|
1663
|
+
children: [D > 0 && /* @__PURE__ */ re("path", {
|
|
1664
|
+
clipPath: "url(#" + R + ")",
|
|
1665
|
+
fill: "none",
|
|
1666
|
+
stroke: h,
|
|
1667
|
+
strokeWidth: D + (a ? 0 : 1),
|
|
1668
|
+
d: T
|
|
1669
|
+
}), /* @__PURE__ */ re("path", {
|
|
1670
|
+
stroke: D && !a ? y.fill : "none",
|
|
1671
|
+
d: T
|
|
1672
|
+
}), /* @__PURE__ */ re("clipPath", {
|
|
1673
|
+
id: R,
|
|
1674
|
+
children: /* @__PURE__ */ re("rect", {
|
|
1675
|
+
x: -j,
|
|
1676
|
+
y: j * ($ ? -1 : 1),
|
|
1677
|
+
width: c + D,
|
|
1678
|
+
height: c
|
|
1679
|
+
})
|
|
1680
|
+
})]
|
|
1681
|
+
});
|
|
1682
|
+
});
|
|
1683
|
+
function Oo() {
|
|
1684
|
+
const e = /* @__PURE__ */ new Map();
|
|
1685
|
+
return {
|
|
1686
|
+
emit(t, n) {
|
|
1687
|
+
var r;
|
|
1688
|
+
(r = e.get(t)) == null || r.forEach((o) => o(n));
|
|
1689
|
+
},
|
|
1690
|
+
on(t, n) {
|
|
1691
|
+
e.has(t) || e.set(t, /* @__PURE__ */ new Set()), e.get(t).add(n);
|
|
1692
|
+
},
|
|
1693
|
+
off(t, n) {
|
|
1694
|
+
var r;
|
|
1695
|
+
(r = e.get(t)) == null || r.delete(n);
|
|
1696
|
+
}
|
|
1697
|
+
};
|
|
1698
|
+
}
|
|
1699
|
+
const Mo = /* @__PURE__ */ f.createContext(null), Po = /* @__PURE__ */ f.createContext(null), Vt = () => {
|
|
1700
|
+
var e;
|
|
1701
|
+
return ((e = f.useContext(Mo)) == null ? void 0 : e.id) || null;
|
|
1702
|
+
}, at = () => f.useContext(Po);
|
|
1703
|
+
function Oe(e) {
|
|
1704
|
+
return "data-floating-ui-" + e;
|
|
1705
|
+
}
|
|
1706
|
+
function ne(e) {
|
|
1707
|
+
e.current !== -1 && (clearTimeout(e.current), e.current = -1);
|
|
1708
|
+
}
|
|
1709
|
+
const cn = /* @__PURE__ */ Oe("safe-polygon");
|
|
1710
|
+
function bt(e, t, n) {
|
|
1711
|
+
if (n && !Ne(n))
|
|
1712
|
+
return 0;
|
|
1713
|
+
if (typeof e == "number")
|
|
1714
|
+
return e;
|
|
1715
|
+
if (typeof e == "function") {
|
|
1716
|
+
const r = e();
|
|
1717
|
+
return typeof r == "number" ? r : r?.[t];
|
|
1718
|
+
}
|
|
1719
|
+
return e?.[t];
|
|
1720
|
+
}
|
|
1721
|
+
function yt(e) {
|
|
1722
|
+
return typeof e == "function" ? e() : e;
|
|
1723
|
+
}
|
|
1724
|
+
function ni(e, t) {
|
|
1725
|
+
t === void 0 && (t = {});
|
|
1726
|
+
const {
|
|
1727
|
+
open: n,
|
|
1728
|
+
onOpenChange: r,
|
|
1729
|
+
dataRef: o,
|
|
1730
|
+
events: i,
|
|
1731
|
+
elements: s
|
|
1732
|
+
} = e, {
|
|
1733
|
+
enabled: c = !0,
|
|
1734
|
+
delay: l = 0,
|
|
1735
|
+
handleClose: u = null,
|
|
1736
|
+
mouseOnly: d = !1,
|
|
1737
|
+
restMs: g = 0,
|
|
1738
|
+
move: h = !0
|
|
1739
|
+
} = t, a = at(), p = Vt(), m = Te(u), y = Te(l), R = Te(n), b = Te(g), w = f.useRef(), S = f.useRef(-1), A = f.useRef(), I = f.useRef(-1), M = f.useRef(!0), D = f.useRef(!1), j = f.useRef(() => {
|
|
1740
|
+
}), W = f.useRef(!1), B = Q(() => {
|
|
1741
|
+
var T;
|
|
1742
|
+
const v = (T = o.current.openEvent) == null ? void 0 : T.type;
|
|
1743
|
+
return v?.includes("mouse") && v !== "mousedown";
|
|
1744
|
+
});
|
|
1745
|
+
f.useEffect(() => {
|
|
1746
|
+
if (!c) return;
|
|
1747
|
+
function T(v) {
|
|
1748
|
+
let {
|
|
1749
|
+
open: C
|
|
1750
|
+
} = v;
|
|
1751
|
+
C || (ne(S), ne(I), M.current = !0, W.current = !1);
|
|
1752
|
+
}
|
|
1753
|
+
return i.on("openchange", T), () => {
|
|
1754
|
+
i.off("openchange", T);
|
|
1755
|
+
};
|
|
1756
|
+
}, [c, i]), f.useEffect(() => {
|
|
1757
|
+
if (!c || !m.current || !n) return;
|
|
1758
|
+
function T(C) {
|
|
1759
|
+
B() && r(!1, C, "hover");
|
|
1760
|
+
}
|
|
1761
|
+
const v = J(s.floating).documentElement;
|
|
1762
|
+
return v.addEventListener("mouseleave", T), () => {
|
|
1763
|
+
v.removeEventListener("mouseleave", T);
|
|
1764
|
+
};
|
|
1765
|
+
}, [s.floating, n, r, c, m, B]);
|
|
1766
|
+
const $ = f.useCallback(function(T, v, C) {
|
|
1767
|
+
v === void 0 && (v = !0), C === void 0 && (C = "hover");
|
|
1768
|
+
const L = bt(y.current, "close", w.current);
|
|
1769
|
+
L && !A.current ? (ne(S), S.current = window.setTimeout(() => r(!1, T, C), L)) : v && (ne(S), r(!1, T, C));
|
|
1770
|
+
}, [y, r]), V = Q(() => {
|
|
1771
|
+
j.current(), A.current = void 0;
|
|
1772
|
+
}), x = Q(() => {
|
|
1773
|
+
if (D.current) {
|
|
1774
|
+
const T = J(s.floating).body;
|
|
1775
|
+
T.style.pointerEvents = "", T.removeAttribute(cn), D.current = !1;
|
|
1776
|
+
}
|
|
1777
|
+
}), E = Q(() => o.current.openEvent ? ["click", "mousedown"].includes(o.current.openEvent.type) : !1);
|
|
1778
|
+
f.useEffect(() => {
|
|
1779
|
+
if (!c) return;
|
|
1780
|
+
function T(F) {
|
|
1781
|
+
if (ne(S), M.current = !1, d && !Ne(w.current) || yt(b.current) > 0 && !bt(y.current, "open"))
|
|
1782
|
+
return;
|
|
1783
|
+
const O = bt(y.current, "open", w.current);
|
|
1784
|
+
O ? S.current = window.setTimeout(() => {
|
|
1785
|
+
R.current || r(!0, F, "hover");
|
|
1786
|
+
}, O) : n || r(!0, F, "hover");
|
|
1787
|
+
}
|
|
1788
|
+
function v(F) {
|
|
1789
|
+
if (E()) {
|
|
1790
|
+
x();
|
|
1791
|
+
return;
|
|
1792
|
+
}
|
|
1793
|
+
j.current();
|
|
1794
|
+
const O = J(s.floating);
|
|
1795
|
+
if (ne(I), W.current = !1, m.current && o.current.floatingContext) {
|
|
1796
|
+
n || ne(S), A.current = m.current({
|
|
1797
|
+
...o.current.floatingContext,
|
|
1798
|
+
tree: a,
|
|
1799
|
+
x: F.clientX,
|
|
1800
|
+
y: F.clientY,
|
|
1801
|
+
onClose() {
|
|
1802
|
+
x(), V(), E() || $(F, !0, "safe-polygon");
|
|
1803
|
+
}
|
|
1804
|
+
});
|
|
1805
|
+
const q = A.current;
|
|
1806
|
+
O.addEventListener("mousemove", q), j.current = () => {
|
|
1807
|
+
O.removeEventListener("mousemove", q);
|
|
1808
|
+
};
|
|
1809
|
+
return;
|
|
1810
|
+
}
|
|
1811
|
+
(w.current === "touch" ? !Z(s.floating, F.relatedTarget) : !0) && $(F);
|
|
1812
|
+
}
|
|
1813
|
+
function C(F) {
|
|
1814
|
+
E() || o.current.floatingContext && (m.current == null || m.current({
|
|
1815
|
+
...o.current.floatingContext,
|
|
1816
|
+
tree: a,
|
|
1817
|
+
x: F.clientX,
|
|
1818
|
+
y: F.clientY,
|
|
1819
|
+
onClose() {
|
|
1820
|
+
x(), V(), E() || $(F);
|
|
1821
|
+
}
|
|
1822
|
+
})(F));
|
|
1823
|
+
}
|
|
1824
|
+
function L() {
|
|
1825
|
+
ne(S);
|
|
1826
|
+
}
|
|
1827
|
+
function Y(F) {
|
|
1828
|
+
E() || $(F, !1);
|
|
1829
|
+
}
|
|
1830
|
+
if (K(s.domReference)) {
|
|
1831
|
+
const F = s.domReference, O = s.floating;
|
|
1832
|
+
return n && F.addEventListener("mouseleave", C), h && F.addEventListener("mousemove", T, {
|
|
1833
|
+
once: !0
|
|
1834
|
+
}), F.addEventListener("mouseenter", T), F.addEventListener("mouseleave", v), O && (O.addEventListener("mouseleave", C), O.addEventListener("mouseenter", L), O.addEventListener("mouseleave", Y)), () => {
|
|
1835
|
+
n && F.removeEventListener("mouseleave", C), h && F.removeEventListener("mousemove", T), F.removeEventListener("mouseenter", T), F.removeEventListener("mouseleave", v), O && (O.removeEventListener("mouseleave", C), O.removeEventListener("mouseenter", L), O.removeEventListener("mouseleave", Y));
|
|
1836
|
+
};
|
|
1837
|
+
}
|
|
1838
|
+
}, [s, c, e, d, h, $, V, x, r, n, R, a, y, m, o, E, b]), G(() => {
|
|
1839
|
+
var T;
|
|
1840
|
+
if (c && n && (T = m.current) != null && (T = T.__options) != null && T.blockPointerEvents && B()) {
|
|
1841
|
+
D.current = !0;
|
|
1842
|
+
const C = s.floating;
|
|
1843
|
+
if (K(s.domReference) && C) {
|
|
1844
|
+
var v;
|
|
1845
|
+
const L = J(s.floating).body;
|
|
1846
|
+
L.setAttribute(cn, "");
|
|
1847
|
+
const Y = s.domReference, F = a == null || (v = a.nodesRef.current.find((O) => O.id === p)) == null || (v = v.context) == null ? void 0 : v.elements.floating;
|
|
1848
|
+
return F && (F.style.pointerEvents = ""), L.style.pointerEvents = "none", Y.style.pointerEvents = "auto", C.style.pointerEvents = "auto", () => {
|
|
1849
|
+
L.style.pointerEvents = "", Y.style.pointerEvents = "", C.style.pointerEvents = "";
|
|
1850
|
+
};
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
}, [c, n, p, s, a, m, B]), G(() => {
|
|
1854
|
+
n || (w.current = void 0, W.current = !1, V(), x());
|
|
1855
|
+
}, [n, V, x]), f.useEffect(() => () => {
|
|
1856
|
+
V(), ne(S), ne(I), x();
|
|
1857
|
+
}, [c, s.domReference, V, x]);
|
|
1858
|
+
const P = f.useMemo(() => {
|
|
1859
|
+
function T(v) {
|
|
1860
|
+
w.current = v.pointerType;
|
|
1861
|
+
}
|
|
1862
|
+
return {
|
|
1863
|
+
onPointerDown: T,
|
|
1864
|
+
onPointerEnter: T,
|
|
1865
|
+
onMouseMove(v) {
|
|
1866
|
+
const {
|
|
1867
|
+
nativeEvent: C
|
|
1868
|
+
} = v;
|
|
1869
|
+
function L() {
|
|
1870
|
+
!M.current && !R.current && r(!0, C, "hover");
|
|
1871
|
+
}
|
|
1872
|
+
d && !Ne(w.current) || n || yt(b.current) === 0 || W.current && v.movementX ** 2 + v.movementY ** 2 < 2 || (ne(I), w.current === "touch" ? L() : (W.current = !0, I.current = window.setTimeout(L, yt(b.current))));
|
|
1873
|
+
}
|
|
1874
|
+
};
|
|
1875
|
+
}, [d, r, n, R, b]);
|
|
1876
|
+
return f.useMemo(() => c ? {
|
|
1877
|
+
reference: P
|
|
1878
|
+
} : {}, [c, P]);
|
|
1879
|
+
}
|
|
1880
|
+
let ln = 0;
|
|
1881
|
+
function Me(e, t) {
|
|
1882
|
+
t === void 0 && (t = {});
|
|
1883
|
+
const {
|
|
1884
|
+
preventScroll: n = !1,
|
|
1885
|
+
cancelPrevious: r = !0,
|
|
1886
|
+
sync: o = !1
|
|
1887
|
+
} = t;
|
|
1888
|
+
r && cancelAnimationFrame(ln);
|
|
1889
|
+
const i = () => e?.focus({
|
|
1890
|
+
preventScroll: n
|
|
1891
|
+
});
|
|
1892
|
+
o ? i() : ln = requestAnimationFrame(i);
|
|
1893
|
+
}
|
|
1894
|
+
function Lo(e) {
|
|
1895
|
+
return e?.ownerDocument || document;
|
|
1896
|
+
}
|
|
1897
|
+
const Ie = {
|
|
1898
|
+
inert: /* @__PURE__ */ new WeakMap(),
|
|
1899
|
+
"aria-hidden": /* @__PURE__ */ new WeakMap(),
|
|
1900
|
+
none: /* @__PURE__ */ new WeakMap()
|
|
1901
|
+
};
|
|
1902
|
+
function un(e) {
|
|
1903
|
+
return e === "inert" ? Ie.inert : e === "aria-hidden" ? Ie["aria-hidden"] : Ie.none;
|
|
1904
|
+
}
|
|
1905
|
+
let qe = /* @__PURE__ */ new WeakSet(), Xe = {}, wt = 0;
|
|
1906
|
+
const Io = () => typeof HTMLElement < "u" && "inert" in HTMLElement.prototype, qn = (e) => e && (e.host || qn(e.parentNode)), ko = (e, t) => t.map((n) => {
|
|
1907
|
+
if (e.contains(n))
|
|
1908
|
+
return n;
|
|
1909
|
+
const r = qn(n);
|
|
1910
|
+
return e.contains(r) ? r : null;
|
|
1911
|
+
}).filter((n) => n != null);
|
|
1912
|
+
function Do(e, t, n, r) {
|
|
1913
|
+
const o = "data-floating-ui-inert", i = r ? "inert" : n ? "aria-hidden" : null, s = ko(t, e), c = /* @__PURE__ */ new Set(), l = new Set(s), u = [];
|
|
1914
|
+
Xe[o] || (Xe[o] = /* @__PURE__ */ new WeakMap());
|
|
1915
|
+
const d = Xe[o];
|
|
1916
|
+
s.forEach(g), h(t), c.clear();
|
|
1917
|
+
function g(a) {
|
|
1918
|
+
!a || c.has(a) || (c.add(a), a.parentNode && g(a.parentNode));
|
|
1919
|
+
}
|
|
1920
|
+
function h(a) {
|
|
1921
|
+
!a || l.has(a) || [].forEach.call(a.children, (p) => {
|
|
1922
|
+
if (xe(p) !== "script")
|
|
1923
|
+
if (c.has(p))
|
|
1924
|
+
h(p);
|
|
1925
|
+
else {
|
|
1926
|
+
const m = i ? p.getAttribute(i) : null, y = m !== null && m !== "false", R = un(i), b = (R.get(p) || 0) + 1, w = (d.get(p) || 0) + 1;
|
|
1927
|
+
R.set(p, b), d.set(p, w), u.push(p), b === 1 && y && qe.add(p), w === 1 && p.setAttribute(o, ""), !y && i && p.setAttribute(i, i === "inert" ? "" : "true");
|
|
1928
|
+
}
|
|
1929
|
+
});
|
|
1930
|
+
}
|
|
1931
|
+
return wt++, () => {
|
|
1932
|
+
u.forEach((a) => {
|
|
1933
|
+
const p = un(i), y = (p.get(a) || 0) - 1, R = (d.get(a) || 0) - 1;
|
|
1934
|
+
p.set(a, y), d.set(a, R), y || (!qe.has(a) && i && a.removeAttribute(i), qe.delete(a)), R || a.removeAttribute(o);
|
|
1935
|
+
}), wt--, wt || (Ie.inert = /* @__PURE__ */ new WeakMap(), Ie["aria-hidden"] = /* @__PURE__ */ new WeakMap(), Ie.none = /* @__PURE__ */ new WeakMap(), qe = /* @__PURE__ */ new WeakSet(), Xe = {});
|
|
1936
|
+
};
|
|
1937
|
+
}
|
|
1938
|
+
function an(e, t, n) {
|
|
1939
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
1940
|
+
const r = Lo(e[0]).body;
|
|
1941
|
+
return Do(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))), r, t, n);
|
|
1942
|
+
}
|
|
1943
|
+
const ft = {
|
|
1944
|
+
border: 0,
|
|
1945
|
+
clip: "rect(0 0 0 0)",
|
|
1946
|
+
height: "1px",
|
|
1947
|
+
margin: "-1px",
|
|
1948
|
+
overflow: "hidden",
|
|
1949
|
+
padding: 0,
|
|
1950
|
+
position: "fixed",
|
|
1951
|
+
whiteSpace: "nowrap",
|
|
1952
|
+
width: "1px",
|
|
1953
|
+
top: 0,
|
|
1954
|
+
left: 0
|
|
1955
|
+
}, nt = /* @__PURE__ */ f.forwardRef(function(t, n) {
|
|
1956
|
+
const [r, o] = f.useState();
|
|
1957
|
+
G(() => {
|
|
1958
|
+
In() && o("button");
|
|
1959
|
+
}, []);
|
|
1960
|
+
const i = {
|
|
1961
|
+
ref: n,
|
|
1962
|
+
tabIndex: 0,
|
|
1963
|
+
// Role is only for VoiceOver
|
|
1964
|
+
role: r,
|
|
1965
|
+
"aria-hidden": r ? void 0 : !0,
|
|
1966
|
+
[Oe("focus-guard")]: "",
|
|
1967
|
+
style: ft
|
|
1968
|
+
};
|
|
1969
|
+
return /* @__PURE__ */ re("span", {
|
|
1970
|
+
...t,
|
|
1971
|
+
...i
|
|
1972
|
+
});
|
|
1973
|
+
}), Xn = /* @__PURE__ */ f.createContext(null), fn = /* @__PURE__ */ Oe("portal");
|
|
1974
|
+
function Fo(e) {
|
|
1975
|
+
e === void 0 && (e = {});
|
|
1976
|
+
const {
|
|
1977
|
+
id: t,
|
|
1978
|
+
root: n
|
|
1979
|
+
} = e, r = ut(), o = Un(), [i, s] = f.useState(null), c = f.useRef(null);
|
|
1980
|
+
return G(() => () => {
|
|
1981
|
+
i?.remove(), queueMicrotask(() => {
|
|
1982
|
+
c.current = null;
|
|
1983
|
+
});
|
|
1984
|
+
}, [i]), G(() => {
|
|
1985
|
+
if (!r || c.current) return;
|
|
1986
|
+
const l = t ? document.getElementById(t) : null;
|
|
1987
|
+
if (!l) return;
|
|
1988
|
+
const u = document.createElement("div");
|
|
1989
|
+
u.id = r, u.setAttribute(fn, ""), l.appendChild(u), c.current = u, s(u);
|
|
1990
|
+
}, [t, r]), G(() => {
|
|
1991
|
+
if (n === null || !r || c.current) return;
|
|
1992
|
+
let l = n || o?.portalNode;
|
|
1993
|
+
l && !kt(l) && (l = l.current), l = l || document.body;
|
|
1994
|
+
let u = null;
|
|
1995
|
+
t && (u = document.createElement("div"), u.id = t, l.appendChild(u));
|
|
1996
|
+
const d = document.createElement("div");
|
|
1997
|
+
d.id = r, d.setAttribute(fn, ""), l = u || l, l.appendChild(d), c.current = d, s(d);
|
|
1998
|
+
}, [t, n, r, o]), i;
|
|
1999
|
+
}
|
|
2000
|
+
function ri(e) {
|
|
2001
|
+
const {
|
|
2002
|
+
children: t,
|
|
2003
|
+
id: n,
|
|
2004
|
+
root: r,
|
|
2005
|
+
preserveTabOrder: o = !0
|
|
2006
|
+
} = e, i = Fo({
|
|
2007
|
+
id: n,
|
|
2008
|
+
root: r
|
|
2009
|
+
}), [s, c] = f.useState(null), l = f.useRef(null), u = f.useRef(null), d = f.useRef(null), g = f.useRef(null), h = s?.modal, a = s?.open, p = (
|
|
2010
|
+
// The FocusManager and therefore floating element are currently open/
|
|
2011
|
+
// rendered.
|
|
2012
|
+
!!s && // Guards are only for non-modal focus management.
|
|
2013
|
+
!s.modal && // Don't render if unmount is transitioning.
|
|
2014
|
+
s.open && o && !!(r || i)
|
|
2015
|
+
);
|
|
2016
|
+
return f.useEffect(() => {
|
|
2017
|
+
if (!i || !o || h)
|
|
2018
|
+
return;
|
|
2019
|
+
function m(y) {
|
|
2020
|
+
i && Fe(y) && (y.type === "focusin" ? zt : Hr)(i);
|
|
2021
|
+
}
|
|
2022
|
+
return i.addEventListener("focusin", m, !0), i.addEventListener("focusout", m, !0), () => {
|
|
2023
|
+
i.removeEventListener("focusin", m, !0), i.removeEventListener("focusout", m, !0);
|
|
2024
|
+
};
|
|
2025
|
+
}, [i, o, h]), f.useEffect(() => {
|
|
2026
|
+
i && (a || zt(i));
|
|
2027
|
+
}, [a, i]), /* @__PURE__ */ Lt(Xn.Provider, {
|
|
2028
|
+
value: f.useMemo(() => ({
|
|
2029
|
+
preserveTabOrder: o,
|
|
2030
|
+
beforeOutsideRef: l,
|
|
2031
|
+
afterOutsideRef: u,
|
|
2032
|
+
beforeInsideRef: d,
|
|
2033
|
+
afterInsideRef: g,
|
|
2034
|
+
portalNode: i,
|
|
2035
|
+
setFocusManagerState: c
|
|
2036
|
+
}), [o, i]),
|
|
2037
|
+
children: [p && i && /* @__PURE__ */ re(nt, {
|
|
2038
|
+
"data-type": "outside",
|
|
2039
|
+
ref: l,
|
|
2040
|
+
onFocus: (m) => {
|
|
2041
|
+
if (Fe(m, i)) {
|
|
2042
|
+
var y;
|
|
2043
|
+
(y = d.current) == null || y.focus();
|
|
2044
|
+
} else {
|
|
2045
|
+
const R = s ? s.domReference : null, b = Nn(R);
|
|
2046
|
+
b?.focus();
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
}), p && i && /* @__PURE__ */ re("span", {
|
|
2050
|
+
"aria-owns": i.id,
|
|
2051
|
+
style: ft
|
|
2052
|
+
}), i && /* @__PURE__ */ It.createPortal(t, i), p && i && /* @__PURE__ */ re(nt, {
|
|
2053
|
+
"data-type": "outside",
|
|
2054
|
+
ref: u,
|
|
2055
|
+
onFocus: (m) => {
|
|
2056
|
+
if (Fe(m, i)) {
|
|
2057
|
+
var y;
|
|
2058
|
+
(y = g.current) == null || y.focus();
|
|
2059
|
+
} else {
|
|
2060
|
+
const R = s ? s.domReference : null, b = Fn(R);
|
|
2061
|
+
b?.focus(), s?.closeOnFocusOut && s?.onOpenChange(!1, m.nativeEvent, "focus-out");
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
})]
|
|
2065
|
+
});
|
|
2066
|
+
}
|
|
2067
|
+
const Un = () => f.useContext(Xn);
|
|
2068
|
+
function dn(e) {
|
|
2069
|
+
return f.useMemo(() => (t) => {
|
|
2070
|
+
e.forEach((n) => {
|
|
2071
|
+
n && (n.current = t);
|
|
2072
|
+
});
|
|
2073
|
+
}, e);
|
|
2074
|
+
}
|
|
2075
|
+
const No = 20;
|
|
2076
|
+
let we = [];
|
|
2077
|
+
function _t() {
|
|
2078
|
+
we = we.filter((e) => e.isConnected);
|
|
2079
|
+
}
|
|
2080
|
+
function Bo(e) {
|
|
2081
|
+
_t(), e && xe(e) !== "body" && (we.push(e), we.length > No && (we = we.slice(-20)));
|
|
2082
|
+
}
|
|
2083
|
+
function mn() {
|
|
2084
|
+
return _t(), we[we.length - 1];
|
|
2085
|
+
}
|
|
2086
|
+
function Wo(e) {
|
|
2087
|
+
const t = _e();
|
|
2088
|
+
return Pn(e, t) ? e : ct(e, t)[0] || e;
|
|
2089
|
+
}
|
|
2090
|
+
function gn(e, t) {
|
|
2091
|
+
var n;
|
|
2092
|
+
if (!t.current.includes("floating") && !((n = e.getAttribute("role")) != null && n.includes("dialog")))
|
|
2093
|
+
return;
|
|
2094
|
+
const r = _e(), i = Mr(e, r).filter((c) => {
|
|
2095
|
+
const l = c.getAttribute("data-tabindex") || "";
|
|
2096
|
+
return Pn(c, r) || c.hasAttribute("data-tabindex") && !l.startsWith("-");
|
|
2097
|
+
}), s = e.getAttribute("tabindex");
|
|
2098
|
+
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"));
|
|
2099
|
+
}
|
|
2100
|
+
const $o = /* @__PURE__ */ f.forwardRef(function(t, n) {
|
|
2101
|
+
return /* @__PURE__ */ re("button", {
|
|
2102
|
+
...t,
|
|
2103
|
+
type: "button",
|
|
2104
|
+
ref: n,
|
|
2105
|
+
tabIndex: -1,
|
|
2106
|
+
style: ft
|
|
2107
|
+
});
|
|
2108
|
+
});
|
|
2109
|
+
function oi(e) {
|
|
2110
|
+
const {
|
|
2111
|
+
context: t,
|
|
2112
|
+
children: n,
|
|
2113
|
+
disabled: r = !1,
|
|
2114
|
+
order: o = ["content"],
|
|
2115
|
+
guards: i = !0,
|
|
2116
|
+
initialFocus: s = 0,
|
|
2117
|
+
returnFocus: c = !0,
|
|
2118
|
+
restoreFocus: l = !1,
|
|
2119
|
+
modal: u = !0,
|
|
2120
|
+
visuallyHiddenDismiss: d = !1,
|
|
2121
|
+
closeOnFocusOut: g = !0,
|
|
2122
|
+
outsideElementsInert: h = !1,
|
|
2123
|
+
getInsideElements: a = () => []
|
|
2124
|
+
} = e, {
|
|
2125
|
+
open: p,
|
|
2126
|
+
onOpenChange: m,
|
|
2127
|
+
events: y,
|
|
2128
|
+
dataRef: R,
|
|
2129
|
+
elements: {
|
|
2130
|
+
domReference: b,
|
|
2131
|
+
floating: w
|
|
2132
|
+
}
|
|
2133
|
+
} = t, S = Q(() => {
|
|
2134
|
+
var k;
|
|
2135
|
+
return (k = R.current.floatingContext) == null ? void 0 : k.nodeId;
|
|
2136
|
+
}), A = Q(a), I = typeof s == "number" && s < 0, M = Ut(b) && I, D = Io(), j = D ? i : !0, W = !j || D && h, B = Te(o), $ = Te(s), V = Te(c), x = at(), E = Un(), P = f.useRef(null), T = f.useRef(null), v = f.useRef(!1), C = f.useRef(!1), L = f.useRef(-1), Y = f.useRef(-1), F = E != null, O = Pt(w), ce = Q(function(k) {
|
|
2137
|
+
return k === void 0 && (k = O), k ? ct(k, _e()) : [];
|
|
2138
|
+
}), q = Q((k) => {
|
|
2139
|
+
const _ = ce(k);
|
|
2140
|
+
return B.current.map((N) => b && N === "reference" ? b : O && N === "floating" ? O : _).filter(Boolean).flat();
|
|
2141
|
+
});
|
|
2142
|
+
f.useEffect(() => {
|
|
2143
|
+
if (r || !u) return;
|
|
2144
|
+
function k(N) {
|
|
2145
|
+
if (N.key === "Tab") {
|
|
2146
|
+
Z(O, be(J(O))) && ce().length === 0 && !M && pt(N);
|
|
2147
|
+
const X = q(), z = de(N);
|
|
2148
|
+
B.current[0] === "reference" && z === b && (pt(N), N.shiftKey ? Me(X[X.length - 1]) : Me(X[1])), B.current[1] === "floating" && z === O && N.shiftKey && (pt(N), Me(X[0]));
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
const _ = J(O);
|
|
2152
|
+
return _.addEventListener("keydown", k), () => {
|
|
2153
|
+
_.removeEventListener("keydown", k);
|
|
2154
|
+
};
|
|
2155
|
+
}, [r, b, O, u, B, M, ce, q]), f.useEffect(() => {
|
|
2156
|
+
if (r || !w) return;
|
|
2157
|
+
function k(_) {
|
|
2158
|
+
const N = de(_), z = ce().indexOf(N);
|
|
2159
|
+
z !== -1 && (L.current = z);
|
|
2160
|
+
}
|
|
2161
|
+
return w.addEventListener("focusin", k), () => {
|
|
2162
|
+
w.removeEventListener("focusin", k);
|
|
2163
|
+
};
|
|
2164
|
+
}, [r, w, ce]), f.useEffect(() => {
|
|
2165
|
+
if (r || !g) return;
|
|
2166
|
+
function k() {
|
|
2167
|
+
C.current = !0, setTimeout(() => {
|
|
2168
|
+
C.current = !1;
|
|
2169
|
+
});
|
|
2170
|
+
}
|
|
2171
|
+
function _(z) {
|
|
2172
|
+
const H = z.relatedTarget, ae = z.currentTarget, se = de(z);
|
|
2173
|
+
queueMicrotask(() => {
|
|
2174
|
+
const te = S(), Ee = !(Z(b, H) || Z(w, H) || Z(H, w) || Z(E?.portalNode, H) || H != null && H.hasAttribute(Oe("focus-guard")) || x && (Pe(x.nodesRef.current, te).find((ve) => {
|
|
2175
|
+
var fe, he;
|
|
2176
|
+
return Z((fe = ve.context) == null ? void 0 : fe.elements.floating, H) || Z((he = ve.context) == null ? void 0 : he.elements.domReference, H);
|
|
2177
|
+
}) || Yt(x.nodesRef.current, te).find((ve) => {
|
|
2178
|
+
var fe, he, Ht;
|
|
2179
|
+
return [(fe = ve.context) == null ? void 0 : fe.elements.floating, Pt((he = ve.context) == null ? void 0 : he.elements.floating)].includes(H) || ((Ht = ve.context) == null ? void 0 : Ht.elements.domReference) === H;
|
|
2180
|
+
})));
|
|
2181
|
+
if (ae === b && O && gn(O, B), l && ae !== b && !(se != null && se.isConnected) && be(J(O)) === J(O).body) {
|
|
2182
|
+
U(O) && O.focus();
|
|
2183
|
+
const ve = L.current, fe = ce(), he = fe[ve] || fe[fe.length - 1] || O;
|
|
2184
|
+
U(he) && he.focus();
|
|
2185
|
+
}
|
|
2186
|
+
if (R.current.insideReactTree) {
|
|
2187
|
+
R.current.insideReactTree = !1;
|
|
2188
|
+
return;
|
|
2189
|
+
}
|
|
2190
|
+
(M || !u) && H && Ee && !C.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
|
|
2191
|
+
H !== mn() && (v.current = !0, m(!1, z, "focus-out"));
|
|
2192
|
+
});
|
|
2193
|
+
}
|
|
2194
|
+
const N = !!(!x && E);
|
|
2195
|
+
function X() {
|
|
2196
|
+
ne(Y), R.current.insideReactTree = !0, Y.current = window.setTimeout(() => {
|
|
2197
|
+
R.current.insideReactTree = !1;
|
|
2198
|
+
});
|
|
2199
|
+
}
|
|
2200
|
+
if (w && U(b))
|
|
2201
|
+
return b.addEventListener("focusout", _), b.addEventListener("pointerdown", k), w.addEventListener("focusout", _), N && w.addEventListener("focusout", X, !0), () => {
|
|
2202
|
+
b.removeEventListener("focusout", _), b.removeEventListener("pointerdown", k), w.removeEventListener("focusout", _), N && w.removeEventListener("focusout", X, !0);
|
|
2203
|
+
};
|
|
2204
|
+
}, [r, b, w, O, u, x, E, m, g, l, ce, M, S, B, R]);
|
|
2205
|
+
const ie = f.useRef(null), pe = f.useRef(null), dt = dn([ie, E?.beforeInsideRef]), mt = dn([pe, E?.afterInsideRef]);
|
|
2206
|
+
f.useEffect(() => {
|
|
2207
|
+
var k, _;
|
|
2208
|
+
if (r || !w) return;
|
|
2209
|
+
const N = Array.from((E == null || (k = E.portalNode) == null ? void 0 : k.querySelectorAll("[" + Oe("portal") + "]")) || []), z = (_ = (x ? Yt(x.nodesRef.current, S()) : []).find((se) => {
|
|
2210
|
+
var te;
|
|
2211
|
+
return Ut(((te = se.context) == null ? void 0 : te.elements.domReference) || null);
|
|
2212
|
+
})) == null || (_ = _.context) == null ? void 0 : _.elements.domReference, H = [w, z, ...N, ...A(), P.current, T.current, ie.current, pe.current, E?.beforeOutsideRef.current, E?.afterOutsideRef.current, B.current.includes("reference") || M ? b : null].filter((se) => se != null), ae = u || M ? an(H, !W, W) : an(H);
|
|
2213
|
+
return () => {
|
|
2214
|
+
ae();
|
|
2215
|
+
};
|
|
2216
|
+
}, [r, b, w, u, B, E, M, j, W, x, S, A]), G(() => {
|
|
2217
|
+
if (r || !U(O)) return;
|
|
2218
|
+
const k = J(O), _ = be(k);
|
|
2219
|
+
queueMicrotask(() => {
|
|
2220
|
+
const N = q(O), X = $.current, z = (typeof X == "number" ? N[X] : X.current) || O, H = Z(O, _);
|
|
2221
|
+
!I && !H && p && Me(z, {
|
|
2222
|
+
preventScroll: z === O
|
|
2223
|
+
});
|
|
2224
|
+
});
|
|
2225
|
+
}, [r, p, O, I, q, $]), G(() => {
|
|
2226
|
+
if (r || !O) return;
|
|
2227
|
+
const k = J(O), _ = be(k);
|
|
2228
|
+
Bo(_);
|
|
2229
|
+
function N(H) {
|
|
2230
|
+
let {
|
|
2231
|
+
reason: ae,
|
|
2232
|
+
event: se,
|
|
2233
|
+
nested: te
|
|
2234
|
+
} = H;
|
|
2235
|
+
if (["hover", "safe-polygon"].includes(ae) && se.type === "mouseleave" && (v.current = !0), ae === "outside-press")
|
|
2236
|
+
if (te)
|
|
2237
|
+
v.current = !1;
|
|
2238
|
+
else if (Fr(se) || Nr(se))
|
|
2239
|
+
v.current = !1;
|
|
2240
|
+
else {
|
|
2241
|
+
let Ee = !1;
|
|
2242
|
+
document.createElement("div").focus({
|
|
2243
|
+
get preventScroll() {
|
|
2244
|
+
return Ee = !0, !1;
|
|
2245
|
+
}
|
|
2246
|
+
}), Ee ? v.current = !1 : v.current = !0;
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
y.on("openchange", N);
|
|
2250
|
+
const X = k.createElement("span");
|
|
2251
|
+
X.setAttribute("tabindex", "-1"), X.setAttribute("aria-hidden", "true"), Object.assign(X.style, ft), F && b && b.insertAdjacentElement("afterend", X);
|
|
2252
|
+
function z() {
|
|
2253
|
+
if (typeof V.current == "boolean") {
|
|
2254
|
+
const H = b || mn();
|
|
2255
|
+
return H && H.isConnected ? H : X;
|
|
2256
|
+
}
|
|
2257
|
+
return V.current.current || X;
|
|
2258
|
+
}
|
|
2259
|
+
return () => {
|
|
2260
|
+
y.off("openchange", N);
|
|
2261
|
+
const H = be(k), ae = Z(w, H) || x && Pe(x.nodesRef.current, S(), !1).some((te) => {
|
|
2262
|
+
var Ee;
|
|
2263
|
+
return Z((Ee = te.context) == null ? void 0 : Ee.elements.floating, H);
|
|
2264
|
+
}), se = z();
|
|
2265
|
+
queueMicrotask(() => {
|
|
2266
|
+
const te = Wo(se);
|
|
2267
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2268
|
+
V.current && !v.current && U(te) && // If the focus moved somewhere else after mount, avoid returning focus
|
|
2269
|
+
// since it likely entered a different element which should be
|
|
2270
|
+
// respected: https://github.com/floating-ui/floating-ui/issues/2607
|
|
2271
|
+
(!(te !== H && H !== k.body) || ae) && te.focus({
|
|
2272
|
+
preventScroll: !0
|
|
2273
|
+
}), X.remove();
|
|
2274
|
+
});
|
|
2275
|
+
};
|
|
2276
|
+
}, [r, w, O, V, R, y, x, F, b, S]), f.useEffect(() => (queueMicrotask(() => {
|
|
2277
|
+
v.current = !1;
|
|
2278
|
+
}), () => {
|
|
2279
|
+
queueMicrotask(_t);
|
|
2280
|
+
}), [r]), G(() => {
|
|
2281
|
+
if (!r && E)
|
|
2282
|
+
return E.setFocusManagerState({
|
|
2283
|
+
modal: u,
|
|
2284
|
+
closeOnFocusOut: g,
|
|
2285
|
+
open: p,
|
|
2286
|
+
onOpenChange: m,
|
|
2287
|
+
domReference: b
|
|
2288
|
+
}), () => {
|
|
2289
|
+
E.setFocusManagerState(null);
|
|
2290
|
+
};
|
|
2291
|
+
}, [r, E, u, p, m, g, b]), G(() => {
|
|
2292
|
+
r || O && gn(O, B);
|
|
2293
|
+
}, [r, O, B]);
|
|
2294
|
+
function He(k) {
|
|
2295
|
+
return r || !d || !u ? null : /* @__PURE__ */ re($o, {
|
|
2296
|
+
ref: k === "start" ? P : T,
|
|
2297
|
+
onClick: (_) => m(!1, _.nativeEvent),
|
|
2298
|
+
children: typeof d == "string" ? d : "Dismiss"
|
|
2299
|
+
});
|
|
2300
|
+
}
|
|
2301
|
+
const Ke = !r && j && (u ? !M : !0) && (F || u);
|
|
2302
|
+
return /* @__PURE__ */ Lt(Yn, {
|
|
2303
|
+
children: [Ke && /* @__PURE__ */ re(nt, {
|
|
2304
|
+
"data-type": "inside",
|
|
2305
|
+
ref: dt,
|
|
2306
|
+
onFocus: (k) => {
|
|
2307
|
+
if (u) {
|
|
2308
|
+
const N = q();
|
|
2309
|
+
Me(o[0] === "reference" ? N[0] : N[N.length - 1]);
|
|
2310
|
+
} else if (E != null && E.preserveTabOrder && E.portalNode)
|
|
2311
|
+
if (v.current = !1, Fe(k, E.portalNode)) {
|
|
2312
|
+
const N = Fn(b);
|
|
2313
|
+
N?.focus();
|
|
2314
|
+
} else {
|
|
2315
|
+
var _;
|
|
2316
|
+
(_ = E.beforeOutsideRef.current) == null || _.focus();
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
}), !M && He("start"), n, He("end"), Ke && /* @__PURE__ */ re(nt, {
|
|
2320
|
+
"data-type": "inside",
|
|
2321
|
+
ref: mt,
|
|
2322
|
+
onFocus: (k) => {
|
|
2323
|
+
if (u)
|
|
2324
|
+
Me(q()[0]);
|
|
2325
|
+
else if (E != null && E.preserveTabOrder && E.portalNode)
|
|
2326
|
+
if (g && (v.current = !0), Fe(k, E.portalNode)) {
|
|
2327
|
+
const N = Nn(b);
|
|
2328
|
+
N?.focus();
|
|
2329
|
+
} else {
|
|
2330
|
+
var _;
|
|
2331
|
+
(_ = E.afterOutsideRef.current) == null || _.focus();
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2334
|
+
})]
|
|
2335
|
+
});
|
|
2336
|
+
}
|
|
2337
|
+
let Ue = 0;
|
|
2338
|
+
const pn = "--floating-ui-scrollbar-width";
|
|
2339
|
+
function Vo() {
|
|
2340
|
+
const e = Bt(), t = /iP(hone|ad|od)|iOS/.test(e) || // iPads can claim to be MacIntel
|
|
2341
|
+
e === "MacIntel" && navigator.maxTouchPoints > 1, n = document.body.style, o = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft ? "paddingLeft" : "paddingRight", i = window.innerWidth - document.documentElement.clientWidth, s = n.left ? parseFloat(n.left) : window.scrollX, c = n.top ? parseFloat(n.top) : window.scrollY;
|
|
2342
|
+
if (n.overflow = "hidden", n.setProperty(pn, i + "px"), i && (n[o] = i + "px"), t) {
|
|
2343
|
+
var l, u;
|
|
2344
|
+
const d = ((l = window.visualViewport) == null ? void 0 : l.offsetLeft) || 0, g = ((u = window.visualViewport) == null ? void 0 : u.offsetTop) || 0;
|
|
2345
|
+
Object.assign(n, {
|
|
2346
|
+
position: "fixed",
|
|
2347
|
+
top: -(c - Math.floor(g)) + "px",
|
|
2348
|
+
left: -(s - Math.floor(d)) + "px",
|
|
2349
|
+
right: "0"
|
|
2350
|
+
});
|
|
2351
|
+
}
|
|
2352
|
+
return () => {
|
|
2353
|
+
Object.assign(n, {
|
|
2354
|
+
overflow: "",
|
|
2355
|
+
[o]: ""
|
|
2356
|
+
}), n.removeProperty(pn), t && (Object.assign(n, {
|
|
2357
|
+
position: "",
|
|
2358
|
+
top: "",
|
|
2359
|
+
left: "",
|
|
2360
|
+
right: ""
|
|
2361
|
+
}), window.scrollTo(s, c));
|
|
2362
|
+
};
|
|
2363
|
+
}
|
|
2364
|
+
let vn = () => {
|
|
2365
|
+
};
|
|
2366
|
+
const ii = /* @__PURE__ */ f.forwardRef(function(t, n) {
|
|
2367
|
+
const {
|
|
2368
|
+
lockScroll: r = !1,
|
|
2369
|
+
...o
|
|
2370
|
+
} = t;
|
|
2371
|
+
return G(() => {
|
|
2372
|
+
if (r)
|
|
2373
|
+
return Ue++, Ue === 1 && (vn = Vo()), () => {
|
|
2374
|
+
Ue--, Ue === 0 && vn();
|
|
2375
|
+
};
|
|
2376
|
+
}, [r]), /* @__PURE__ */ re("div", {
|
|
2377
|
+
ref: n,
|
|
2378
|
+
...o,
|
|
2379
|
+
style: {
|
|
2380
|
+
position: "fixed",
|
|
2381
|
+
overflow: "auto",
|
|
2382
|
+
top: 0,
|
|
2383
|
+
right: 0,
|
|
2384
|
+
bottom: 0,
|
|
2385
|
+
left: 0,
|
|
2386
|
+
...o.style
|
|
2387
|
+
}
|
|
2388
|
+
});
|
|
2389
|
+
});
|
|
2390
|
+
function hn(e) {
|
|
2391
|
+
return U(e.target) && e.target.tagName === "BUTTON";
|
|
2392
|
+
}
|
|
2393
|
+
function _o(e) {
|
|
2394
|
+
return U(e.target) && e.target.tagName === "A";
|
|
2395
|
+
}
|
|
2396
|
+
function bn(e) {
|
|
2397
|
+
return Wt(e);
|
|
2398
|
+
}
|
|
2399
|
+
function si(e, t) {
|
|
2400
|
+
t === void 0 && (t = {});
|
|
2401
|
+
const {
|
|
2402
|
+
open: n,
|
|
2403
|
+
onOpenChange: r,
|
|
2404
|
+
dataRef: o,
|
|
2405
|
+
elements: {
|
|
2406
|
+
domReference: i
|
|
2407
|
+
}
|
|
2408
|
+
} = e, {
|
|
2409
|
+
enabled: s = !0,
|
|
2410
|
+
event: c = "click",
|
|
2411
|
+
toggle: l = !0,
|
|
2412
|
+
ignoreMouse: u = !1,
|
|
2413
|
+
keyboardHandlers: d = !0,
|
|
2414
|
+
stickIfOpen: g = !0
|
|
2415
|
+
} = t, h = f.useRef(), a = f.useRef(!1), p = f.useMemo(() => ({
|
|
2416
|
+
onPointerDown(m) {
|
|
2417
|
+
h.current = m.pointerType;
|
|
2418
|
+
},
|
|
2419
|
+
onMouseDown(m) {
|
|
2420
|
+
const y = h.current;
|
|
2421
|
+
m.button === 0 && c !== "click" && (Ne(y, !0) && u || (n && l && (!(o.current.openEvent && g) || o.current.openEvent.type === "mousedown") ? r(!1, m.nativeEvent, "click") : (m.preventDefault(), r(!0, m.nativeEvent, "click"))));
|
|
2422
|
+
},
|
|
2423
|
+
onClick(m) {
|
|
2424
|
+
const y = h.current;
|
|
2425
|
+
if (c === "mousedown" && h.current) {
|
|
2426
|
+
h.current = void 0;
|
|
2427
|
+
return;
|
|
2428
|
+
}
|
|
2429
|
+
Ne(y, !0) && u || (n && l && (!(o.current.openEvent && g) || o.current.openEvent.type === "click") ? r(!1, m.nativeEvent, "click") : r(!0, m.nativeEvent, "click"));
|
|
2430
|
+
},
|
|
2431
|
+
onKeyDown(m) {
|
|
2432
|
+
h.current = void 0, !(m.defaultPrevented || !d || hn(m)) && (m.key === " " && !bn(i) && (m.preventDefault(), a.current = !0), !_o(m) && m.key === "Enter" && r(!(n && l), m.nativeEvent, "click"));
|
|
2433
|
+
},
|
|
2434
|
+
onKeyUp(m) {
|
|
2435
|
+
m.defaultPrevented || !d || hn(m) || bn(i) || m.key === " " && a.current && (a.current = !1, r(!(n && l), m.nativeEvent, "click"));
|
|
2436
|
+
}
|
|
2437
|
+
}), [o, i, c, u, d, r, n, g, l]);
|
|
2438
|
+
return f.useMemo(() => s ? {
|
|
2439
|
+
reference: p
|
|
2440
|
+
} : {}, [s, p]);
|
|
2441
|
+
}
|
|
2442
|
+
const Ho = {
|
|
2443
|
+
pointerdown: "onPointerDown",
|
|
2444
|
+
mousedown: "onMouseDown",
|
|
2445
|
+
click: "onClick"
|
|
2446
|
+
}, Ko = {
|
|
2447
|
+
pointerdown: "onPointerDownCapture",
|
|
2448
|
+
mousedown: "onMouseDownCapture",
|
|
2449
|
+
click: "onClickCapture"
|
|
2450
|
+
}, yn = (e) => {
|
|
2451
|
+
var t, n;
|
|
2452
|
+
return {
|
|
2453
|
+
escapeKey: typeof e == "boolean" ? e : (t = e?.escapeKey) != null ? t : !1,
|
|
2454
|
+
outsidePress: typeof e == "boolean" ? e : (n = e?.outsidePress) != null ? n : !0
|
|
2455
|
+
};
|
|
2456
|
+
};
|
|
2457
|
+
function ci(e, t) {
|
|
2458
|
+
t === void 0 && (t = {});
|
|
2459
|
+
const {
|
|
2460
|
+
open: n,
|
|
2461
|
+
onOpenChange: r,
|
|
2462
|
+
elements: o,
|
|
2463
|
+
dataRef: i
|
|
2464
|
+
} = e, {
|
|
2465
|
+
enabled: s = !0,
|
|
2466
|
+
escapeKey: c = !0,
|
|
2467
|
+
outsidePress: l = !0,
|
|
2468
|
+
outsidePressEvent: u = "pointerdown",
|
|
2469
|
+
referencePress: d = !1,
|
|
2470
|
+
referencePressEvent: g = "pointerdown",
|
|
2471
|
+
ancestorScroll: h = !1,
|
|
2472
|
+
bubbles: a,
|
|
2473
|
+
capture: p
|
|
2474
|
+
} = t, m = at(), y = Q(typeof l == "function" ? l : () => !1), R = typeof l == "function" ? y : l, b = f.useRef(!1), {
|
|
2475
|
+
escapeKey: w,
|
|
2476
|
+
outsidePress: S
|
|
2477
|
+
} = yn(a), {
|
|
2478
|
+
escapeKey: A,
|
|
2479
|
+
outsidePress: I
|
|
2480
|
+
} = yn(p), M = f.useRef(!1), D = Q((x) => {
|
|
2481
|
+
var E;
|
|
2482
|
+
if (!n || !s || !c || x.key !== "Escape" || M.current)
|
|
2483
|
+
return;
|
|
2484
|
+
const P = (E = i.current.floatingContext) == null ? void 0 : E.nodeId, T = m ? Pe(m.nodesRef.current, P) : [];
|
|
2485
|
+
if (!w && (x.stopPropagation(), T.length > 0)) {
|
|
2486
|
+
let v = !0;
|
|
2487
|
+
if (T.forEach((C) => {
|
|
2488
|
+
var L;
|
|
2489
|
+
if ((L = C.context) != null && L.open && !C.context.dataRef.current.__escapeKeyBubbles) {
|
|
2490
|
+
v = !1;
|
|
2491
|
+
return;
|
|
2492
|
+
}
|
|
2493
|
+
}), !v)
|
|
2494
|
+
return;
|
|
2495
|
+
}
|
|
2496
|
+
r(!1, Dr(x) ? x.nativeEvent : x, "escape-key");
|
|
2497
|
+
}), j = Q((x) => {
|
|
2498
|
+
var E;
|
|
2499
|
+
const P = () => {
|
|
2500
|
+
var T;
|
|
2501
|
+
D(x), (T = de(x)) == null || T.removeEventListener("keydown", P);
|
|
2502
|
+
};
|
|
2503
|
+
(E = de(x)) == null || E.addEventListener("keydown", P);
|
|
2504
|
+
}), W = Q((x) => {
|
|
2505
|
+
var E;
|
|
2506
|
+
const P = i.current.insideReactTree;
|
|
2507
|
+
i.current.insideReactTree = !1;
|
|
2508
|
+
const T = b.current;
|
|
2509
|
+
if (b.current = !1, u === "click" && T || P || typeof R == "function" && !R(x))
|
|
2510
|
+
return;
|
|
2511
|
+
const v = de(x), C = "[" + Oe("inert") + "]", L = J(o.floating).querySelectorAll(C);
|
|
2512
|
+
let Y = K(v) ? v : null;
|
|
2513
|
+
for (; Y && !me(Y); ) {
|
|
2514
|
+
const q = ge(Y);
|
|
2515
|
+
if (me(q) || !K(q))
|
|
2516
|
+
break;
|
|
2517
|
+
Y = q;
|
|
2518
|
+
}
|
|
2519
|
+
if (L.length && K(v) && !Ir(v) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
2520
|
+
!Z(v, o.floating) && // If the target root element contains none of the markers, then the
|
|
2521
|
+
// element was injected after the floating element rendered.
|
|
2522
|
+
Array.from(L).every((q) => !Z(Y, q)))
|
|
2523
|
+
return;
|
|
2524
|
+
if (U(v) && V) {
|
|
2525
|
+
const q = me(v), ie = oe(v), pe = /auto|scroll/, dt = q || pe.test(ie.overflowX), mt = q || pe.test(ie.overflowY), He = dt && v.clientWidth > 0 && v.scrollWidth > v.clientWidth, Ke = mt && v.clientHeight > 0 && v.scrollHeight > v.clientHeight, k = ie.direction === "rtl", _ = Ke && (k ? x.offsetX <= v.offsetWidth - v.clientWidth : x.offsetX > v.clientWidth), N = He && x.offsetY > v.clientHeight;
|
|
2526
|
+
if (_ || N)
|
|
2527
|
+
return;
|
|
2528
|
+
}
|
|
2529
|
+
const F = (E = i.current.floatingContext) == null ? void 0 : E.nodeId, O = m && Pe(m.nodesRef.current, F).some((q) => {
|
|
2530
|
+
var ie;
|
|
2531
|
+
return gt(x, (ie = q.context) == null ? void 0 : ie.elements.floating);
|
|
2532
|
+
});
|
|
2533
|
+
if (gt(x, o.floating) || gt(x, o.domReference) || O)
|
|
2534
|
+
return;
|
|
2535
|
+
const ce = m ? Pe(m.nodesRef.current, F) : [];
|
|
2536
|
+
if (ce.length > 0) {
|
|
2537
|
+
let q = !0;
|
|
2538
|
+
if (ce.forEach((ie) => {
|
|
2539
|
+
var pe;
|
|
2540
|
+
if ((pe = ie.context) != null && pe.open && !ie.context.dataRef.current.__outsidePressBubbles) {
|
|
2541
|
+
q = !1;
|
|
2542
|
+
return;
|
|
2543
|
+
}
|
|
2544
|
+
}), !q)
|
|
2545
|
+
return;
|
|
2546
|
+
}
|
|
2547
|
+
r(!1, x, "outside-press");
|
|
2548
|
+
}), B = Q((x) => {
|
|
2549
|
+
var E;
|
|
2550
|
+
const P = () => {
|
|
2551
|
+
var T;
|
|
2552
|
+
W(x), (T = de(x)) == null || T.removeEventListener(u, P);
|
|
2553
|
+
};
|
|
2554
|
+
(E = de(x)) == null || E.addEventListener(u, P);
|
|
2555
|
+
});
|
|
2556
|
+
f.useEffect(() => {
|
|
2557
|
+
if (!n || !s)
|
|
2558
|
+
return;
|
|
2559
|
+
i.current.__escapeKeyBubbles = w, i.current.__outsidePressBubbles = S;
|
|
2560
|
+
let x = -1;
|
|
2561
|
+
function E(L) {
|
|
2562
|
+
r(!1, L, "ancestor-scroll");
|
|
2563
|
+
}
|
|
2564
|
+
function P() {
|
|
2565
|
+
window.clearTimeout(x), M.current = !0;
|
|
2566
|
+
}
|
|
2567
|
+
function T() {
|
|
2568
|
+
x = window.setTimeout(
|
|
2569
|
+
() => {
|
|
2570
|
+
M.current = !1;
|
|
2571
|
+
},
|
|
2572
|
+
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
|
|
2573
|
+
// Only apply to WebKit for the test to remain 0ms.
|
|
2574
|
+
it() ? 5 : 0
|
|
2575
|
+
);
|
|
2576
|
+
}
|
|
2577
|
+
const v = J(o.floating);
|
|
2578
|
+
c && (v.addEventListener("keydown", A ? j : D, A), v.addEventListener("compositionstart", P), v.addEventListener("compositionend", T)), R && v.addEventListener(u, I ? B : W, I);
|
|
2579
|
+
let C = [];
|
|
2580
|
+
return h && (K(o.domReference) && (C = Re(o.domReference)), K(o.floating) && (C = C.concat(Re(o.floating))), !K(o.reference) && o.reference && o.reference.contextElement && (C = C.concat(Re(o.reference.contextElement)))), C = C.filter((L) => {
|
|
2581
|
+
var Y;
|
|
2582
|
+
return L !== ((Y = v.defaultView) == null ? void 0 : Y.visualViewport);
|
|
2583
|
+
}), C.forEach((L) => {
|
|
2584
|
+
L.addEventListener("scroll", E, {
|
|
2585
|
+
passive: !0
|
|
2586
|
+
});
|
|
2587
|
+
}), () => {
|
|
2588
|
+
c && (v.removeEventListener("keydown", A ? j : D, A), v.removeEventListener("compositionstart", P), v.removeEventListener("compositionend", T)), R && v.removeEventListener(u, I ? B : W, I), C.forEach((L) => {
|
|
2589
|
+
L.removeEventListener("scroll", E);
|
|
2590
|
+
}), window.clearTimeout(x);
|
|
2591
|
+
};
|
|
2592
|
+
}, [i, o, c, R, u, n, r, h, s, w, S, D, A, j, W, I, B]), f.useEffect(() => {
|
|
2593
|
+
i.current.insideReactTree = !1;
|
|
2594
|
+
}, [i, R, u]);
|
|
2595
|
+
const $ = f.useMemo(() => ({
|
|
2596
|
+
onKeyDown: D,
|
|
2597
|
+
...d && {
|
|
2598
|
+
[Ho[g]]: (x) => {
|
|
2599
|
+
r(!1, x.nativeEvent, "reference-press");
|
|
2600
|
+
},
|
|
2601
|
+
...g !== "click" && {
|
|
2602
|
+
onClick(x) {
|
|
2603
|
+
r(!1, x.nativeEvent, "reference-press");
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
}), [D, r, d, g]), V = f.useMemo(() => ({
|
|
2608
|
+
onKeyDown: D,
|
|
2609
|
+
onMouseDown() {
|
|
2610
|
+
b.current = !0;
|
|
2611
|
+
},
|
|
2612
|
+
onMouseUp() {
|
|
2613
|
+
b.current = !0;
|
|
2614
|
+
},
|
|
2615
|
+
[Ko[u]]: () => {
|
|
2616
|
+
i.current.insideReactTree = !0;
|
|
2617
|
+
}
|
|
2618
|
+
}), [D, u, i]);
|
|
2619
|
+
return f.useMemo(() => s ? {
|
|
2620
|
+
reference: $,
|
|
2621
|
+
floating: V
|
|
2622
|
+
} : {}, [s, $, V]);
|
|
2623
|
+
}
|
|
2624
|
+
function jo(e) {
|
|
2625
|
+
const {
|
|
2626
|
+
open: t = !1,
|
|
2627
|
+
onOpenChange: n,
|
|
2628
|
+
elements: r
|
|
2629
|
+
} = e, o = ut(), i = f.useRef({}), [s] = f.useState(() => Oo()), c = Vt() != null;
|
|
2630
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2631
|
+
const a = r.reference;
|
|
2632
|
+
a && !K(a) && Ao("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
2633
|
+
}
|
|
2634
|
+
const [l, u] = f.useState(r.reference), d = Q((a, p, m) => {
|
|
2635
|
+
i.current.openEvent = a ? p : void 0, s.emit("openchange", {
|
|
2636
|
+
open: a,
|
|
2637
|
+
event: p,
|
|
2638
|
+
reason: m,
|
|
2639
|
+
nested: c
|
|
2640
|
+
}), n?.(a, p, m);
|
|
2641
|
+
}), g = f.useMemo(() => ({
|
|
2642
|
+
setPositionReference: u
|
|
2643
|
+
}), []), h = f.useMemo(() => ({
|
|
2644
|
+
reference: l || r.reference || null,
|
|
2645
|
+
floating: r.floating || null,
|
|
2646
|
+
domReference: r.reference
|
|
2647
|
+
}), [l, r.reference, r.floating]);
|
|
2648
|
+
return f.useMemo(() => ({
|
|
2649
|
+
dataRef: i,
|
|
2650
|
+
open: t,
|
|
2651
|
+
onOpenChange: d,
|
|
2652
|
+
elements: h,
|
|
2653
|
+
events: s,
|
|
2654
|
+
floatingId: o,
|
|
2655
|
+
refs: g
|
|
2656
|
+
}), [t, d, h, s, o, g]);
|
|
2657
|
+
}
|
|
2658
|
+
function li(e) {
|
|
2659
|
+
e === void 0 && (e = {});
|
|
2660
|
+
const {
|
|
2661
|
+
nodeId: t
|
|
2662
|
+
} = e, n = jo({
|
|
2663
|
+
...e,
|
|
2664
|
+
elements: {
|
|
2665
|
+
reference: null,
|
|
2666
|
+
floating: null,
|
|
2667
|
+
...e.elements
|
|
2668
|
+
}
|
|
2669
|
+
}), r = e.rootContext || n, o = r.elements, [i, s] = f.useState(null), [c, l] = f.useState(null), d = o?.domReference || i, g = f.useRef(null), h = at();
|
|
2670
|
+
G(() => {
|
|
2671
|
+
d && (g.current = d);
|
|
2672
|
+
}, [d]);
|
|
2673
|
+
const a = yo({
|
|
2674
|
+
...e,
|
|
2675
|
+
elements: {
|
|
2676
|
+
...o,
|
|
2677
|
+
...c && {
|
|
2678
|
+
reference: c
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
}), p = f.useCallback((w) => {
|
|
2682
|
+
const S = K(w) ? {
|
|
2683
|
+
getBoundingClientRect: () => w.getBoundingClientRect(),
|
|
2684
|
+
getClientRects: () => w.getClientRects(),
|
|
2685
|
+
contextElement: w
|
|
2686
|
+
} : w;
|
|
2687
|
+
l(S), a.refs.setReference(S);
|
|
2688
|
+
}, [a.refs]), m = f.useCallback((w) => {
|
|
2689
|
+
(K(w) || w === null) && (g.current = w, s(w)), (K(a.refs.reference.current) || a.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
2690
|
+
// `null` to support `positionReference` + an unstable `reference`
|
|
2691
|
+
// callback ref.
|
|
2692
|
+
w !== null && !K(w)) && a.refs.setReference(w);
|
|
2693
|
+
}, [a.refs]), y = f.useMemo(() => ({
|
|
2694
|
+
...a.refs,
|
|
2695
|
+
setReference: m,
|
|
2696
|
+
setPositionReference: p,
|
|
2697
|
+
domReference: g
|
|
2698
|
+
}), [a.refs, m, p]), R = f.useMemo(() => ({
|
|
2699
|
+
...a.elements,
|
|
2700
|
+
domReference: d
|
|
2701
|
+
}), [a.elements, d]), b = f.useMemo(() => ({
|
|
2702
|
+
...a,
|
|
2703
|
+
...r,
|
|
2704
|
+
refs: y,
|
|
2705
|
+
elements: R,
|
|
2706
|
+
nodeId: t
|
|
2707
|
+
}), [a, y, R, t, r]);
|
|
2708
|
+
return G(() => {
|
|
2709
|
+
r.dataRef.current.floatingContext = b;
|
|
2710
|
+
const w = h?.nodesRef.current.find((S) => S.id === t);
|
|
2711
|
+
w && (w.context = b);
|
|
2712
|
+
}), f.useMemo(() => ({
|
|
2713
|
+
...a,
|
|
2714
|
+
context: b,
|
|
2715
|
+
refs: y,
|
|
2716
|
+
elements: R
|
|
2717
|
+
}), [a, y, R, b]);
|
|
2718
|
+
}
|
|
2719
|
+
function Rt() {
|
|
2720
|
+
return Pr() && In();
|
|
2721
|
+
}
|
|
2722
|
+
function ui(e, t) {
|
|
2723
|
+
t === void 0 && (t = {});
|
|
2724
|
+
const {
|
|
2725
|
+
open: n,
|
|
2726
|
+
onOpenChange: r,
|
|
2727
|
+
events: o,
|
|
2728
|
+
dataRef: i,
|
|
2729
|
+
elements: s
|
|
2730
|
+
} = e, {
|
|
2731
|
+
enabled: c = !0,
|
|
2732
|
+
visibleOnly: l = !0
|
|
2733
|
+
} = t, u = f.useRef(!1), d = f.useRef(-1), g = f.useRef(!0);
|
|
2734
|
+
f.useEffect(() => {
|
|
2735
|
+
if (!c) return;
|
|
2736
|
+
const a = ee(s.domReference);
|
|
2737
|
+
function p() {
|
|
2738
|
+
!n && U(s.domReference) && s.domReference === be(J(s.domReference)) && (u.current = !0);
|
|
2739
|
+
}
|
|
2740
|
+
function m() {
|
|
2741
|
+
g.current = !0;
|
|
2742
|
+
}
|
|
2743
|
+
function y() {
|
|
2744
|
+
g.current = !1;
|
|
2745
|
+
}
|
|
2746
|
+
return a.addEventListener("blur", p), Rt() && (a.addEventListener("keydown", m, !0), a.addEventListener("pointerdown", y, !0)), () => {
|
|
2747
|
+
a.removeEventListener("blur", p), Rt() && (a.removeEventListener("keydown", m, !0), a.removeEventListener("pointerdown", y, !0));
|
|
2748
|
+
};
|
|
2749
|
+
}, [s.domReference, n, c]), f.useEffect(() => {
|
|
2750
|
+
if (!c) return;
|
|
2751
|
+
function a(p) {
|
|
2752
|
+
let {
|
|
2753
|
+
reason: m
|
|
2754
|
+
} = p;
|
|
2755
|
+
(m === "reference-press" || m === "escape-key") && (u.current = !0);
|
|
2756
|
+
}
|
|
2757
|
+
return o.on("openchange", a), () => {
|
|
2758
|
+
o.off("openchange", a);
|
|
2759
|
+
};
|
|
2760
|
+
}, [o, c]), f.useEffect(() => () => {
|
|
2761
|
+
ne(d);
|
|
2762
|
+
}, []);
|
|
2763
|
+
const h = f.useMemo(() => ({
|
|
2764
|
+
onMouseLeave() {
|
|
2765
|
+
u.current = !1;
|
|
2766
|
+
},
|
|
2767
|
+
onFocus(a) {
|
|
2768
|
+
if (u.current) return;
|
|
2769
|
+
const p = de(a.nativeEvent);
|
|
2770
|
+
if (l && K(p)) {
|
|
2771
|
+
if (Rt() && !a.relatedTarget) {
|
|
2772
|
+
if (!g.current && !Wt(p))
|
|
2773
|
+
return;
|
|
2774
|
+
} else if (!kr(p))
|
|
2775
|
+
return;
|
|
2776
|
+
}
|
|
2777
|
+
r(!0, a.nativeEvent, "focus");
|
|
2778
|
+
},
|
|
2779
|
+
onBlur(a) {
|
|
2780
|
+
u.current = !1;
|
|
2781
|
+
const p = a.relatedTarget, m = a.nativeEvent, y = K(p) && p.hasAttribute(Oe("focus-guard")) && p.getAttribute("data-type") === "outside";
|
|
2782
|
+
d.current = window.setTimeout(() => {
|
|
2783
|
+
var R;
|
|
2784
|
+
const b = be(s.domReference ? s.domReference.ownerDocument : document);
|
|
2785
|
+
!p && b === s.domReference || Z((R = i.current.floatingContext) == null ? void 0 : R.refs.floating.current, b) || Z(s.domReference, b) || y || r(!1, m, "focus");
|
|
2786
|
+
});
|
|
2787
|
+
}
|
|
2788
|
+
}), [i, s.domReference, r, l]);
|
|
2789
|
+
return f.useMemo(() => c ? {
|
|
2790
|
+
reference: h
|
|
2791
|
+
} : {}, [c, h]);
|
|
2792
|
+
}
|
|
2793
|
+
function xt(e, t, n) {
|
|
2794
|
+
const r = /* @__PURE__ */ new Map(), o = n === "item";
|
|
2795
|
+
let i = e;
|
|
2796
|
+
if (o && e) {
|
|
2797
|
+
const {
|
|
2798
|
+
[nn]: s,
|
|
2799
|
+
[rn]: c,
|
|
2800
|
+
...l
|
|
2801
|
+
} = e;
|
|
2802
|
+
i = l;
|
|
2803
|
+
}
|
|
2804
|
+
return {
|
|
2805
|
+
...n === "floating" && {
|
|
2806
|
+
tabIndex: -1,
|
|
2807
|
+
[Ro]: ""
|
|
2808
|
+
},
|
|
2809
|
+
...i,
|
|
2810
|
+
...t.map((s) => {
|
|
2811
|
+
const c = s ? s[n] : null;
|
|
2812
|
+
return typeof c == "function" ? e ? c(e) : null : c;
|
|
2813
|
+
}).concat(e).reduce((s, c) => (c && Object.entries(c).forEach((l) => {
|
|
2814
|
+
let [u, d] = l;
|
|
2815
|
+
if (!(o && [nn, rn].includes(u)))
|
|
2816
|
+
if (u.indexOf("on") === 0) {
|
|
2817
|
+
if (r.has(u) || r.set(u, []), typeof d == "function") {
|
|
2818
|
+
var g;
|
|
2819
|
+
(g = r.get(u)) == null || g.push(d), s[u] = function() {
|
|
2820
|
+
for (var h, a = arguments.length, p = new Array(a), m = 0; m < a; m++)
|
|
2821
|
+
p[m] = arguments[m];
|
|
2822
|
+
return (h = r.get(u)) == null ? void 0 : h.map((y) => y(...p)).find((y) => y !== void 0);
|
|
2823
|
+
};
|
|
2824
|
+
}
|
|
2825
|
+
} else
|
|
2826
|
+
s[u] = d;
|
|
2827
|
+
}), s), {})
|
|
2828
|
+
};
|
|
2829
|
+
}
|
|
2830
|
+
function ai(e) {
|
|
2831
|
+
e === void 0 && (e = []);
|
|
2832
|
+
const t = e.map((c) => c?.reference), n = e.map((c) => c?.floating), r = e.map((c) => c?.item), o = f.useCallback(
|
|
2833
|
+
(c) => xt(c, e, "reference"),
|
|
2834
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2835
|
+
t
|
|
2836
|
+
), i = f.useCallback(
|
|
2837
|
+
(c) => xt(c, e, "floating"),
|
|
2838
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2839
|
+
n
|
|
2840
|
+
), s = f.useCallback(
|
|
2841
|
+
(c) => xt(c, e, "item"),
|
|
2842
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2843
|
+
r
|
|
2844
|
+
);
|
|
2845
|
+
return f.useMemo(() => ({
|
|
2846
|
+
getReferenceProps: o,
|
|
2847
|
+
getFloatingProps: i,
|
|
2848
|
+
getItemProps: s
|
|
2849
|
+
}), [o, i, s]);
|
|
2850
|
+
}
|
|
2851
|
+
const qo = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
|
|
2852
|
+
function fi(e, t) {
|
|
2853
|
+
var n, r;
|
|
2854
|
+
t === void 0 && (t = {});
|
|
2855
|
+
const {
|
|
2856
|
+
open: o,
|
|
2857
|
+
elements: i,
|
|
2858
|
+
floatingId: s
|
|
2859
|
+
} = e, {
|
|
2860
|
+
enabled: c = !0,
|
|
2861
|
+
role: l = "dialog"
|
|
2862
|
+
} = t, u = ut(), d = ((n = i.domReference) == null ? void 0 : n.id) || u, g = f.useMemo(() => {
|
|
2863
|
+
var b;
|
|
2864
|
+
return ((b = Pt(i.floating)) == null ? void 0 : b.id) || s;
|
|
2865
|
+
}, [i.floating, s]), h = (r = qo.get(l)) != null ? r : l, p = Vt() != null, m = f.useMemo(() => h === "tooltip" || l === "label" ? {
|
|
2866
|
+
["aria-" + (l === "label" ? "labelledby" : "describedby")]: o ? g : void 0
|
|
2867
|
+
} : {
|
|
2868
|
+
"aria-expanded": o ? "true" : "false",
|
|
2869
|
+
"aria-haspopup": h === "alertdialog" ? "dialog" : h,
|
|
2870
|
+
"aria-controls": o ? g : void 0,
|
|
2871
|
+
...h === "listbox" && {
|
|
2872
|
+
role: "combobox"
|
|
2873
|
+
},
|
|
2874
|
+
...h === "menu" && {
|
|
2875
|
+
id: d
|
|
2876
|
+
},
|
|
2877
|
+
...h === "menu" && p && {
|
|
2878
|
+
role: "menuitem"
|
|
2879
|
+
},
|
|
2880
|
+
...l === "select" && {
|
|
2881
|
+
"aria-autocomplete": "none"
|
|
2882
|
+
},
|
|
2883
|
+
...l === "combobox" && {
|
|
2884
|
+
"aria-autocomplete": "list"
|
|
2885
|
+
}
|
|
2886
|
+
}, [h, g, p, o, d, l]), y = f.useMemo(() => {
|
|
2887
|
+
const b = {
|
|
2888
|
+
id: g,
|
|
2889
|
+
...h && {
|
|
2890
|
+
role: h
|
|
2891
|
+
}
|
|
2892
|
+
};
|
|
2893
|
+
return h === "tooltip" || l === "label" ? b : {
|
|
2894
|
+
...b,
|
|
2895
|
+
...h === "menu" && {
|
|
2896
|
+
"aria-labelledby": d
|
|
2897
|
+
}
|
|
2898
|
+
};
|
|
2899
|
+
}, [h, g, d, l]), R = f.useCallback((b) => {
|
|
2900
|
+
let {
|
|
2901
|
+
active: w,
|
|
2902
|
+
selected: S
|
|
2903
|
+
} = b;
|
|
2904
|
+
const A = {
|
|
2905
|
+
role: "option",
|
|
2906
|
+
...w && {
|
|
2907
|
+
id: g + "-fui-option"
|
|
2908
|
+
}
|
|
2909
|
+
};
|
|
2910
|
+
switch (l) {
|
|
2911
|
+
case "select":
|
|
2912
|
+
case "combobox":
|
|
2913
|
+
return {
|
|
2914
|
+
...A,
|
|
2915
|
+
"aria-selected": S
|
|
2916
|
+
};
|
|
2917
|
+
}
|
|
2918
|
+
return {};
|
|
2919
|
+
}, [g, l]);
|
|
2920
|
+
return f.useMemo(() => c ? {
|
|
2921
|
+
reference: m,
|
|
2922
|
+
floating: y,
|
|
2923
|
+
item: R
|
|
2924
|
+
} : {}, [c, m, y, R]);
|
|
2925
|
+
}
|
|
2926
|
+
function Xo(e, t) {
|
|
2927
|
+
const [n, r] = f.useState(e);
|
|
2928
|
+
return e && !n && r(!0), f.useEffect(() => {
|
|
2929
|
+
if (!e && n) {
|
|
2930
|
+
const o = setTimeout(() => r(!1), t);
|
|
2931
|
+
return () => clearTimeout(o);
|
|
2932
|
+
}
|
|
2933
|
+
}, [e, n, t]), n;
|
|
2934
|
+
}
|
|
2935
|
+
function di(e, t) {
|
|
2936
|
+
t === void 0 && (t = {});
|
|
2937
|
+
const {
|
|
2938
|
+
open: n,
|
|
2939
|
+
elements: {
|
|
2940
|
+
floating: r
|
|
2941
|
+
}
|
|
2942
|
+
} = e, {
|
|
2943
|
+
duration: o = 250
|
|
2944
|
+
} = t, s = (typeof o == "number" ? o : o.close) || 0, [c, l] = f.useState("unmounted"), u = Xo(n, s);
|
|
2945
|
+
return !u && c === "close" && l("unmounted"), G(() => {
|
|
2946
|
+
if (r) {
|
|
2947
|
+
if (n) {
|
|
2948
|
+
l("initial");
|
|
2949
|
+
const d = requestAnimationFrame(() => {
|
|
2950
|
+
It.flushSync(() => {
|
|
2951
|
+
l("open");
|
|
2952
|
+
});
|
|
2953
|
+
});
|
|
2954
|
+
return () => {
|
|
2955
|
+
cancelAnimationFrame(d);
|
|
2956
|
+
};
|
|
2957
|
+
}
|
|
2958
|
+
l("close");
|
|
2959
|
+
}
|
|
2960
|
+
}, [n, r]), {
|
|
2961
|
+
isMounted: u,
|
|
2962
|
+
status: c
|
|
2963
|
+
};
|
|
2964
|
+
}
|
|
2965
|
+
export {
|
|
2966
|
+
oi as F,
|
|
2967
|
+
zo as a,
|
|
2968
|
+
si as b,
|
|
2969
|
+
ci as c,
|
|
2970
|
+
fi as d,
|
|
2971
|
+
ai as e,
|
|
2972
|
+
ei as f,
|
|
2973
|
+
di as g,
|
|
2974
|
+
ii as h,
|
|
2975
|
+
ri as i,
|
|
2976
|
+
Jo as j,
|
|
2977
|
+
Qo as k,
|
|
2978
|
+
ti as l,
|
|
2979
|
+
ni as m,
|
|
2980
|
+
ui as n,
|
|
2981
|
+
Go as o,
|
|
2982
|
+
Zo as s,
|
|
2983
|
+
li as u
|
|
2984
|
+
};
|