@konstructio/ui 0.1.2-alpha.4 → 0.1.2-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Modal-V67Uz78z.js → Modal-D-NOEWMX.js} +3 -3
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/{chevron-down-BLZPftpV.js → chevron-down-MZvQoT2F.js} +2 -2
- package/dist/chevron-right-VYBOBhRt.js +19 -0
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +2 -2
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/components/Item/Item.js +24 -23
- package/dist/components/Checkbox/Checkbox.js +5 -4
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +2 -2
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +2 -2
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +545 -543
- package/dist/components/Dropdown/components/List/List.js +36 -33
- package/dist/components/Dropdown/components/ListItem/ListItem.js +19 -18
- package/dist/components/Dropdown/components/Wrapper.js +3 -3
- package/dist/components/Dropdown/contexts/dropdown.provider.js +18 -18
- package/dist/components/Dropdown/hooks/useNavigationList.js +25 -25
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Loading/Loading.js +2 -2
- package/dist/components/Modal/Modal.js +2 -2
- package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -3
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +2 -2
- package/dist/components/PieChart/PieChart.js +217 -215
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -28
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +6 -5
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Toast/Toast.js +8 -7
- package/dist/components/VirtualizedTable/VirtualizedTable.js +99 -0
- package/dist/components/VirtualizedTable/VirtualizedTable.variants.js +5 -0
- package/dist/components/VirtualizedTable/assets/chevron-down.js +25 -0
- package/dist/components/VirtualizedTable/assets/chevron-up.js +25 -0
- package/dist/components/VirtualizedTable/assets/index.js +6 -0
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +46 -0
- package/dist/components/VirtualizedTable/components/Body/Body.js +25 -0
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +165 -0
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +34 -0
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +73 -0
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +48 -0
- package/dist/components/VirtualizedTable/components/Header/Header.js +82 -0
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +45 -0
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1870 -0
- package/dist/components/VirtualizedTable/components/index.js +14 -0
- package/dist/components/VirtualizedTable/constants/index.js +5 -0
- package/dist/components/VirtualizedTable/constants/pagination.js +5 -0
- package/dist/components/VirtualizedTable/contexts/index.js +8 -0
- package/dist/components/VirtualizedTable/contexts/table.context.js +31 -0
- package/dist/components/VirtualizedTable/contexts/table.hook.js +11 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +778 -0
- package/dist/components/index.js +44 -40
- package/dist/{createLucideIcon-DbC6TvM5.js → createLucideIcon-D2CN7Ma9.js} +4 -4
- package/dist/debounce-BFejQm9P.js +200 -0
- package/dist/{index-D3xzCzcO.js → index-B7t8D14s.js} +2 -2
- package/dist/index-BAEWsOG1.js +27 -0
- package/dist/{index-C9T9HQaa.js → index-BITvcJAz.js} +1 -1
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/{index-BAraV3ai.js → index-Bnb0ezr3.js} +1 -1
- package/dist/{index-DB2XhXHn.js → index-C84F4YyO.js} +11 -10
- package/dist/index-Cd2vhaop.js +137 -0
- package/dist/{index-iXyXtdgP.js → index-DBbEcSUG.js} +1 -1
- package/dist/index-Dx2grAuN.js +1742 -0
- package/dist/{index-BXuxPoz7.js → index-DzIBBMjs.js} +18 -17
- package/dist/{index-h-Ul0anl.js → index-N2OStZoU.js} +1 -1
- package/dist/{index-Oq5GlCHP.js → index-os7vysFS.js} +1 -1
- package/dist/index-ti1b9kqV.js +14 -0
- package/dist/index.d.ts +88 -3
- package/dist/index.js +41 -37
- package/dist/package.json +19 -15
- package/dist/styles.css +1 -1
- package/dist/{x-BPcqkRZd.js → x-4F_5p77m.js} +1 -1
- package/package.json +19 -15
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/index-CZnD2QxM.js +0 -32
- package/dist/index-CrBonFvu.js +0 -144
|
@@ -0,0 +1,1870 @@
|
|
|
1
|
+
import { jsx as P, jsxs as nt } from "react/jsx-runtime";
|
|
2
|
+
import * as g from "react";
|
|
3
|
+
import { useLayoutEffect as Vt, useRef as zt, useState as jt, useCallback as Yt, useEffect as ze } from "react";
|
|
4
|
+
import { c as ot, u as je, a as Xt, b as J } from "../../../../index-BfXxHr_2.js";
|
|
5
|
+
import { u as ge, b as Gt } from "../../../../index-DQH6odE9.js";
|
|
6
|
+
import { D as qt } from "../../../../index-Cd2vhaop.js";
|
|
7
|
+
import { u as Ut } from "../../../../index-bwWKd82e.js";
|
|
8
|
+
import { r as Kt, P as we } from "../../../../index-BITvcJAz.js";
|
|
9
|
+
import { u as Zt } from "../../../../index-0ioNhtNM.js";
|
|
10
|
+
import { u as Jt } from "../../../../index-BAEWsOG1.js";
|
|
11
|
+
import { P as Qt } from "../../../../index-C1g_chDT.js";
|
|
12
|
+
import { R as en } from "../../../../index-DBbEcSUG.js";
|
|
13
|
+
import { d as tn } from "../../../../debounce-BFejQm9P.js";
|
|
14
|
+
const nn = ["top", "right", "bottom", "left"], U = Math.min, F = Math.max, de = Math.round, fe = Math.floor, j = (e) => ({
|
|
15
|
+
x: e,
|
|
16
|
+
y: e
|
|
17
|
+
}), on = {
|
|
18
|
+
left: "right",
|
|
19
|
+
right: "left",
|
|
20
|
+
bottom: "top",
|
|
21
|
+
top: "bottom"
|
|
22
|
+
}, rn = {
|
|
23
|
+
start: "end",
|
|
24
|
+
end: "start"
|
|
25
|
+
};
|
|
26
|
+
function Oe(e, t, n) {
|
|
27
|
+
return F(e, U(t, n));
|
|
28
|
+
}
|
|
29
|
+
function G(e, t) {
|
|
30
|
+
return typeof e == "function" ? e(t) : e;
|
|
31
|
+
}
|
|
32
|
+
function q(e) {
|
|
33
|
+
return e.split("-")[0];
|
|
34
|
+
}
|
|
35
|
+
function ne(e) {
|
|
36
|
+
return e.split("-")[1];
|
|
37
|
+
}
|
|
38
|
+
function Me(e) {
|
|
39
|
+
return e === "x" ? "y" : "x";
|
|
40
|
+
}
|
|
41
|
+
function ke(e) {
|
|
42
|
+
return e === "y" ? "height" : "width";
|
|
43
|
+
}
|
|
44
|
+
const sn = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
45
|
+
function z(e) {
|
|
46
|
+
return sn.has(q(e)) ? "y" : "x";
|
|
47
|
+
}
|
|
48
|
+
function _e(e) {
|
|
49
|
+
return Me(z(e));
|
|
50
|
+
}
|
|
51
|
+
function cn(e, t, n) {
|
|
52
|
+
n === void 0 && (n = !1);
|
|
53
|
+
const o = ne(e), r = _e(e), i = ke(r);
|
|
54
|
+
let s = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
55
|
+
return t.reference[i] > t.floating[i] && (s = pe(s)), [s, pe(s)];
|
|
56
|
+
}
|
|
57
|
+
function ln(e) {
|
|
58
|
+
const t = pe(e);
|
|
59
|
+
return [Ee(e), t, Ee(t)];
|
|
60
|
+
}
|
|
61
|
+
function Ee(e) {
|
|
62
|
+
return e.replace(/start|end/g, (t) => rn[t]);
|
|
63
|
+
}
|
|
64
|
+
const Ye = ["left", "right"], Xe = ["right", "left"], an = ["top", "bottom"], fn = ["bottom", "top"];
|
|
65
|
+
function un(e, t, n) {
|
|
66
|
+
switch (e) {
|
|
67
|
+
case "top":
|
|
68
|
+
case "bottom":
|
|
69
|
+
return n ? t ? Xe : Ye : t ? Ye : Xe;
|
|
70
|
+
case "left":
|
|
71
|
+
case "right":
|
|
72
|
+
return t ? an : fn;
|
|
73
|
+
default:
|
|
74
|
+
return [];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function dn(e, t, n, o) {
|
|
78
|
+
const r = ne(e);
|
|
79
|
+
let i = un(q(e), n === "start", o);
|
|
80
|
+
return r && (i = i.map((s) => s + "-" + r), t && (i = i.concat(i.map(Ee)))), i;
|
|
81
|
+
}
|
|
82
|
+
function pe(e) {
|
|
83
|
+
return e.replace(/left|right|bottom|top/g, (t) => on[t]);
|
|
84
|
+
}
|
|
85
|
+
function pn(e) {
|
|
86
|
+
return {
|
|
87
|
+
top: 0,
|
|
88
|
+
right: 0,
|
|
89
|
+
bottom: 0,
|
|
90
|
+
left: 0,
|
|
91
|
+
...e
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function rt(e) {
|
|
95
|
+
return typeof e != "number" ? pn(e) : {
|
|
96
|
+
top: e,
|
|
97
|
+
right: e,
|
|
98
|
+
bottom: e,
|
|
99
|
+
left: e
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function me(e) {
|
|
103
|
+
const {
|
|
104
|
+
x: t,
|
|
105
|
+
y: n,
|
|
106
|
+
width: o,
|
|
107
|
+
height: r
|
|
108
|
+
} = e;
|
|
109
|
+
return {
|
|
110
|
+
width: o,
|
|
111
|
+
height: r,
|
|
112
|
+
top: n,
|
|
113
|
+
left: t,
|
|
114
|
+
right: t + o,
|
|
115
|
+
bottom: n + r,
|
|
116
|
+
x: t,
|
|
117
|
+
y: n
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function Ge(e, t, n) {
|
|
121
|
+
let {
|
|
122
|
+
reference: o,
|
|
123
|
+
floating: r
|
|
124
|
+
} = e;
|
|
125
|
+
const i = z(t), s = _e(t), l = ke(s), c = q(t), f = i === "y", a = o.x + o.width / 2 - r.width / 2, u = o.y + o.height / 2 - r.height / 2, p = o[l] / 2 - r[l] / 2;
|
|
126
|
+
let d;
|
|
127
|
+
switch (c) {
|
|
128
|
+
case "top":
|
|
129
|
+
d = {
|
|
130
|
+
x: a,
|
|
131
|
+
y: o.y - r.height
|
|
132
|
+
};
|
|
133
|
+
break;
|
|
134
|
+
case "bottom":
|
|
135
|
+
d = {
|
|
136
|
+
x: a,
|
|
137
|
+
y: o.y + o.height
|
|
138
|
+
};
|
|
139
|
+
break;
|
|
140
|
+
case "right":
|
|
141
|
+
d = {
|
|
142
|
+
x: o.x + o.width,
|
|
143
|
+
y: u
|
|
144
|
+
};
|
|
145
|
+
break;
|
|
146
|
+
case "left":
|
|
147
|
+
d = {
|
|
148
|
+
x: o.x - r.width,
|
|
149
|
+
y: u
|
|
150
|
+
};
|
|
151
|
+
break;
|
|
152
|
+
default:
|
|
153
|
+
d = {
|
|
154
|
+
x: o.x,
|
|
155
|
+
y: o.y
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
switch (ne(t)) {
|
|
159
|
+
case "start":
|
|
160
|
+
d[s] -= p * (n && f ? -1 : 1);
|
|
161
|
+
break;
|
|
162
|
+
case "end":
|
|
163
|
+
d[s] += p * (n && f ? -1 : 1);
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
return d;
|
|
167
|
+
}
|
|
168
|
+
const mn = async (e, t, n) => {
|
|
169
|
+
const {
|
|
170
|
+
placement: o = "bottom",
|
|
171
|
+
strategy: r = "absolute",
|
|
172
|
+
middleware: i = [],
|
|
173
|
+
platform: s
|
|
174
|
+
} = n, l = i.filter(Boolean), c = await (s.isRTL == null ? void 0 : s.isRTL(t));
|
|
175
|
+
let f = await s.getElementRects({
|
|
176
|
+
reference: e,
|
|
177
|
+
floating: t,
|
|
178
|
+
strategy: r
|
|
179
|
+
}), {
|
|
180
|
+
x: a,
|
|
181
|
+
y: u
|
|
182
|
+
} = Ge(f, o, c), p = o, d = {}, m = 0;
|
|
183
|
+
for (let h = 0; h < l.length; h++) {
|
|
184
|
+
const {
|
|
185
|
+
name: w,
|
|
186
|
+
fn: x
|
|
187
|
+
} = l[h], {
|
|
188
|
+
x: y,
|
|
189
|
+
y: C,
|
|
190
|
+
data: v,
|
|
191
|
+
reset: b
|
|
192
|
+
} = await x({
|
|
193
|
+
x: a,
|
|
194
|
+
y: u,
|
|
195
|
+
initialPlacement: o,
|
|
196
|
+
placement: p,
|
|
197
|
+
strategy: r,
|
|
198
|
+
middlewareData: d,
|
|
199
|
+
rects: f,
|
|
200
|
+
platform: s,
|
|
201
|
+
elements: {
|
|
202
|
+
reference: e,
|
|
203
|
+
floating: t
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
a = y ?? a, u = C ?? u, d = {
|
|
207
|
+
...d,
|
|
208
|
+
[w]: {
|
|
209
|
+
...d[w],
|
|
210
|
+
...v
|
|
211
|
+
}
|
|
212
|
+
}, b && m <= 50 && (m++, typeof b == "object" && (b.placement && (p = b.placement), b.rects && (f = b.rects === !0 ? await s.getElementRects({
|
|
213
|
+
reference: e,
|
|
214
|
+
floating: t,
|
|
215
|
+
strategy: r
|
|
216
|
+
}) : b.rects), {
|
|
217
|
+
x: a,
|
|
218
|
+
y: u
|
|
219
|
+
} = Ge(f, p, c)), h = -1);
|
|
220
|
+
}
|
|
221
|
+
return {
|
|
222
|
+
x: a,
|
|
223
|
+
y: u,
|
|
224
|
+
placement: p,
|
|
225
|
+
strategy: r,
|
|
226
|
+
middlewareData: d
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
async function ie(e, t) {
|
|
230
|
+
var n;
|
|
231
|
+
t === void 0 && (t = {});
|
|
232
|
+
const {
|
|
233
|
+
x: o,
|
|
234
|
+
y: r,
|
|
235
|
+
platform: i,
|
|
236
|
+
rects: s,
|
|
237
|
+
elements: l,
|
|
238
|
+
strategy: c
|
|
239
|
+
} = e, {
|
|
240
|
+
boundary: f = "clippingAncestors",
|
|
241
|
+
rootBoundary: a = "viewport",
|
|
242
|
+
elementContext: u = "floating",
|
|
243
|
+
altBoundary: p = !1,
|
|
244
|
+
padding: d = 0
|
|
245
|
+
} = G(t, e), m = rt(d), w = l[p ? u === "floating" ? "reference" : "floating" : u], x = me(await i.getClippingRect({
|
|
246
|
+
element: (n = await (i.isElement == null ? void 0 : i.isElement(w))) == null || n ? w : w.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(l.floating)),
|
|
247
|
+
boundary: f,
|
|
248
|
+
rootBoundary: a,
|
|
249
|
+
strategy: c
|
|
250
|
+
})), y = u === "floating" ? {
|
|
251
|
+
x: o,
|
|
252
|
+
y: r,
|
|
253
|
+
width: s.floating.width,
|
|
254
|
+
height: s.floating.height
|
|
255
|
+
} : s.reference, C = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l.floating)), v = await (i.isElement == null ? void 0 : i.isElement(C)) ? await (i.getScale == null ? void 0 : i.getScale(C)) || {
|
|
256
|
+
x: 1,
|
|
257
|
+
y: 1
|
|
258
|
+
} : {
|
|
259
|
+
x: 1,
|
|
260
|
+
y: 1
|
|
261
|
+
}, b = me(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
262
|
+
elements: l,
|
|
263
|
+
rect: y,
|
|
264
|
+
offsetParent: C,
|
|
265
|
+
strategy: c
|
|
266
|
+
}) : y);
|
|
267
|
+
return {
|
|
268
|
+
top: (x.top - b.top + m.top) / v.y,
|
|
269
|
+
bottom: (b.bottom - x.bottom + m.bottom) / v.y,
|
|
270
|
+
left: (x.left - b.left + m.left) / v.x,
|
|
271
|
+
right: (b.right - x.right + m.right) / v.x
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
const hn = (e) => ({
|
|
275
|
+
name: "arrow",
|
|
276
|
+
options: e,
|
|
277
|
+
async fn(t) {
|
|
278
|
+
const {
|
|
279
|
+
x: n,
|
|
280
|
+
y: o,
|
|
281
|
+
placement: r,
|
|
282
|
+
rects: i,
|
|
283
|
+
platform: s,
|
|
284
|
+
elements: l,
|
|
285
|
+
middlewareData: c
|
|
286
|
+
} = t, {
|
|
287
|
+
element: f,
|
|
288
|
+
padding: a = 0
|
|
289
|
+
} = G(e, t) || {};
|
|
290
|
+
if (f == null)
|
|
291
|
+
return {};
|
|
292
|
+
const u = rt(a), p = {
|
|
293
|
+
x: n,
|
|
294
|
+
y: o
|
|
295
|
+
}, d = _e(r), m = ke(d), h = await s.getDimensions(f), w = d === "y", x = w ? "top" : "left", y = w ? "bottom" : "right", C = w ? "clientHeight" : "clientWidth", v = i.reference[m] + i.reference[d] - p[d] - i.floating[m], b = p[d] - i.reference[d], T = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(f));
|
|
296
|
+
let R = T ? T[C] : 0;
|
|
297
|
+
(!R || !await (s.isElement == null ? void 0 : s.isElement(T))) && (R = l.floating[C] || i.floating[m]);
|
|
298
|
+
const M = v / 2 - b / 2, H = R / 2 - h[m] / 2 - 1, D = U(u[x], H), _ = U(u[y], H), N = D, E = R - h[m] - _, O = R / 2 - h[m] / 2 + M, $ = Oe(N, O, E), S = !c.arrow && ne(r) != null && O !== $ && i.reference[m] / 2 - (O < N ? D : _) - h[m] / 2 < 0, L = S ? O < N ? O - N : O - E : 0;
|
|
299
|
+
return {
|
|
300
|
+
[d]: p[d] + L,
|
|
301
|
+
data: {
|
|
302
|
+
[d]: $,
|
|
303
|
+
centerOffset: O - $ - L,
|
|
304
|
+
...S && {
|
|
305
|
+
alignmentOffset: L
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
reset: S
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
}), gn = function(e) {
|
|
312
|
+
return e === void 0 && (e = {}), {
|
|
313
|
+
name: "flip",
|
|
314
|
+
options: e,
|
|
315
|
+
async fn(t) {
|
|
316
|
+
var n, o;
|
|
317
|
+
const {
|
|
318
|
+
placement: r,
|
|
319
|
+
middlewareData: i,
|
|
320
|
+
rects: s,
|
|
321
|
+
initialPlacement: l,
|
|
322
|
+
platform: c,
|
|
323
|
+
elements: f
|
|
324
|
+
} = t, {
|
|
325
|
+
mainAxis: a = !0,
|
|
326
|
+
crossAxis: u = !0,
|
|
327
|
+
fallbackPlacements: p,
|
|
328
|
+
fallbackStrategy: d = "bestFit",
|
|
329
|
+
fallbackAxisSideDirection: m = "none",
|
|
330
|
+
flipAlignment: h = !0,
|
|
331
|
+
...w
|
|
332
|
+
} = G(e, t);
|
|
333
|
+
if ((n = i.arrow) != null && n.alignmentOffset)
|
|
334
|
+
return {};
|
|
335
|
+
const x = q(r), y = z(l), C = q(l) === l, v = await (c.isRTL == null ? void 0 : c.isRTL(f.floating)), b = p || (C || !h ? [pe(l)] : ln(l)), T = m !== "none";
|
|
336
|
+
!p && T && b.push(...dn(l, h, m, v));
|
|
337
|
+
const R = [l, ...b], M = await ie(t, w), H = [];
|
|
338
|
+
let D = ((o = i.flip) == null ? void 0 : o.overflows) || [];
|
|
339
|
+
if (a && H.push(M[x]), u) {
|
|
340
|
+
const O = cn(r, s, v);
|
|
341
|
+
H.push(M[O[0]], M[O[1]]);
|
|
342
|
+
}
|
|
343
|
+
if (D = [...D, {
|
|
344
|
+
placement: r,
|
|
345
|
+
overflows: H
|
|
346
|
+
}], !H.every((O) => O <= 0)) {
|
|
347
|
+
var _, N;
|
|
348
|
+
const O = (((_ = i.flip) == null ? void 0 : _.index) || 0) + 1, $ = R[O];
|
|
349
|
+
if ($ && (!(u === "alignment" ? y !== z($) : !1) || // We leave the current main axis only if every placement on that axis
|
|
350
|
+
// overflows the main axis.
|
|
351
|
+
D.every((A) => z(A.placement) === y ? A.overflows[0] > 0 : !0)))
|
|
352
|
+
return {
|
|
353
|
+
data: {
|
|
354
|
+
index: O,
|
|
355
|
+
overflows: D
|
|
356
|
+
},
|
|
357
|
+
reset: {
|
|
358
|
+
placement: $
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
let S = (N = D.filter((L) => L.overflows[0] <= 0).sort((L, A) => L.overflows[1] - A.overflows[1])[0]) == null ? void 0 : N.placement;
|
|
362
|
+
if (!S)
|
|
363
|
+
switch (d) {
|
|
364
|
+
case "bestFit": {
|
|
365
|
+
var E;
|
|
366
|
+
const L = (E = D.filter((A) => {
|
|
367
|
+
if (T) {
|
|
368
|
+
const k = z(A.placement);
|
|
369
|
+
return k === y || // Create a bias to the `y` side axis due to horizontal
|
|
370
|
+
// reading directions favoring greater width.
|
|
371
|
+
k === "y";
|
|
372
|
+
}
|
|
373
|
+
return !0;
|
|
374
|
+
}).map((A) => [A.placement, A.overflows.filter((k) => k > 0).reduce((k, V) => k + V, 0)]).sort((A, k) => A[1] - k[1])[0]) == null ? void 0 : E[0];
|
|
375
|
+
L && (S = L);
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
case "initialPlacement":
|
|
379
|
+
S = l;
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
382
|
+
if (r !== S)
|
|
383
|
+
return {
|
|
384
|
+
reset: {
|
|
385
|
+
placement: S
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
return {};
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
function qe(e, t) {
|
|
394
|
+
return {
|
|
395
|
+
top: e.top - t.height,
|
|
396
|
+
right: e.right - t.width,
|
|
397
|
+
bottom: e.bottom - t.height,
|
|
398
|
+
left: e.left - t.width
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
function Ue(e) {
|
|
402
|
+
return nn.some((t) => e[t] >= 0);
|
|
403
|
+
}
|
|
404
|
+
const wn = function(e) {
|
|
405
|
+
return e === void 0 && (e = {}), {
|
|
406
|
+
name: "hide",
|
|
407
|
+
options: e,
|
|
408
|
+
async fn(t) {
|
|
409
|
+
const {
|
|
410
|
+
rects: n
|
|
411
|
+
} = t, {
|
|
412
|
+
strategy: o = "referenceHidden",
|
|
413
|
+
...r
|
|
414
|
+
} = G(e, t);
|
|
415
|
+
switch (o) {
|
|
416
|
+
case "referenceHidden": {
|
|
417
|
+
const i = await ie(t, {
|
|
418
|
+
...r,
|
|
419
|
+
elementContext: "reference"
|
|
420
|
+
}), s = qe(i, n.reference);
|
|
421
|
+
return {
|
|
422
|
+
data: {
|
|
423
|
+
referenceHiddenOffsets: s,
|
|
424
|
+
referenceHidden: Ue(s)
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
case "escaped": {
|
|
429
|
+
const i = await ie(t, {
|
|
430
|
+
...r,
|
|
431
|
+
altBoundary: !0
|
|
432
|
+
}), s = qe(i, n.floating);
|
|
433
|
+
return {
|
|
434
|
+
data: {
|
|
435
|
+
escapedOffsets: s,
|
|
436
|
+
escaped: Ue(s)
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
default:
|
|
441
|
+
return {};
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
}, it = /* @__PURE__ */ new Set(["left", "top"]);
|
|
446
|
+
async function xn(e, t) {
|
|
447
|
+
const {
|
|
448
|
+
placement: n,
|
|
449
|
+
platform: o,
|
|
450
|
+
elements: r
|
|
451
|
+
} = e, i = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), s = q(n), l = ne(n), c = z(n) === "y", f = it.has(s) ? -1 : 1, a = i && c ? -1 : 1, u = G(t, e);
|
|
452
|
+
let {
|
|
453
|
+
mainAxis: p,
|
|
454
|
+
crossAxis: d,
|
|
455
|
+
alignmentAxis: m
|
|
456
|
+
} = typeof u == "number" ? {
|
|
457
|
+
mainAxis: u,
|
|
458
|
+
crossAxis: 0,
|
|
459
|
+
alignmentAxis: null
|
|
460
|
+
} : {
|
|
461
|
+
mainAxis: u.mainAxis || 0,
|
|
462
|
+
crossAxis: u.crossAxis || 0,
|
|
463
|
+
alignmentAxis: u.alignmentAxis
|
|
464
|
+
};
|
|
465
|
+
return l && typeof m == "number" && (d = l === "end" ? m * -1 : m), c ? {
|
|
466
|
+
x: d * a,
|
|
467
|
+
y: p * f
|
|
468
|
+
} : {
|
|
469
|
+
x: p * f,
|
|
470
|
+
y: d * a
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
const yn = function(e) {
|
|
474
|
+
return e === void 0 && (e = 0), {
|
|
475
|
+
name: "offset",
|
|
476
|
+
options: e,
|
|
477
|
+
async fn(t) {
|
|
478
|
+
var n, o;
|
|
479
|
+
const {
|
|
480
|
+
x: r,
|
|
481
|
+
y: i,
|
|
482
|
+
placement: s,
|
|
483
|
+
middlewareData: l
|
|
484
|
+
} = t, c = await xn(t, e);
|
|
485
|
+
return s === ((n = l.offset) == null ? void 0 : n.placement) && (o = l.arrow) != null && o.alignmentOffset ? {} : {
|
|
486
|
+
x: r + c.x,
|
|
487
|
+
y: i + c.y,
|
|
488
|
+
data: {
|
|
489
|
+
...c,
|
|
490
|
+
placement: s
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
}, vn = function(e) {
|
|
496
|
+
return e === void 0 && (e = {}), {
|
|
497
|
+
name: "shift",
|
|
498
|
+
options: e,
|
|
499
|
+
async fn(t) {
|
|
500
|
+
const {
|
|
501
|
+
x: n,
|
|
502
|
+
y: o,
|
|
503
|
+
placement: r
|
|
504
|
+
} = t, {
|
|
505
|
+
mainAxis: i = !0,
|
|
506
|
+
crossAxis: s = !1,
|
|
507
|
+
limiter: l = {
|
|
508
|
+
fn: (w) => {
|
|
509
|
+
let {
|
|
510
|
+
x,
|
|
511
|
+
y
|
|
512
|
+
} = w;
|
|
513
|
+
return {
|
|
514
|
+
x,
|
|
515
|
+
y
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
...c
|
|
520
|
+
} = G(e, t), f = {
|
|
521
|
+
x: n,
|
|
522
|
+
y: o
|
|
523
|
+
}, a = await ie(t, c), u = z(q(r)), p = Me(u);
|
|
524
|
+
let d = f[p], m = f[u];
|
|
525
|
+
if (i) {
|
|
526
|
+
const w = p === "y" ? "top" : "left", x = p === "y" ? "bottom" : "right", y = d + a[w], C = d - a[x];
|
|
527
|
+
d = Oe(y, d, C);
|
|
528
|
+
}
|
|
529
|
+
if (s) {
|
|
530
|
+
const w = u === "y" ? "top" : "left", x = u === "y" ? "bottom" : "right", y = m + a[w], C = m - a[x];
|
|
531
|
+
m = Oe(y, m, C);
|
|
532
|
+
}
|
|
533
|
+
const h = l.fn({
|
|
534
|
+
...t,
|
|
535
|
+
[p]: d,
|
|
536
|
+
[u]: m
|
|
537
|
+
});
|
|
538
|
+
return {
|
|
539
|
+
...h,
|
|
540
|
+
data: {
|
|
541
|
+
x: h.x - n,
|
|
542
|
+
y: h.y - o,
|
|
543
|
+
enabled: {
|
|
544
|
+
[p]: i,
|
|
545
|
+
[u]: s
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
}, bn = function(e) {
|
|
552
|
+
return e === void 0 && (e = {}), {
|
|
553
|
+
options: e,
|
|
554
|
+
fn(t) {
|
|
555
|
+
const {
|
|
556
|
+
x: n,
|
|
557
|
+
y: o,
|
|
558
|
+
placement: r,
|
|
559
|
+
rects: i,
|
|
560
|
+
middlewareData: s
|
|
561
|
+
} = t, {
|
|
562
|
+
offset: l = 0,
|
|
563
|
+
mainAxis: c = !0,
|
|
564
|
+
crossAxis: f = !0
|
|
565
|
+
} = G(e, t), a = {
|
|
566
|
+
x: n,
|
|
567
|
+
y: o
|
|
568
|
+
}, u = z(r), p = Me(u);
|
|
569
|
+
let d = a[p], m = a[u];
|
|
570
|
+
const h = G(l, t), w = typeof h == "number" ? {
|
|
571
|
+
mainAxis: h,
|
|
572
|
+
crossAxis: 0
|
|
573
|
+
} : {
|
|
574
|
+
mainAxis: 0,
|
|
575
|
+
crossAxis: 0,
|
|
576
|
+
...h
|
|
577
|
+
};
|
|
578
|
+
if (c) {
|
|
579
|
+
const C = p === "y" ? "height" : "width", v = i.reference[p] - i.floating[C] + w.mainAxis, b = i.reference[p] + i.reference[C] - w.mainAxis;
|
|
580
|
+
d < v ? d = v : d > b && (d = b);
|
|
581
|
+
}
|
|
582
|
+
if (f) {
|
|
583
|
+
var x, y;
|
|
584
|
+
const C = p === "y" ? "width" : "height", v = it.has(q(r)), b = i.reference[u] - i.floating[C] + (v && ((x = s.offset) == null ? void 0 : x[u]) || 0) + (v ? 0 : w.crossAxis), T = i.reference[u] + i.reference[C] + (v ? 0 : ((y = s.offset) == null ? void 0 : y[u]) || 0) - (v ? w.crossAxis : 0);
|
|
585
|
+
m < b ? m = b : m > T && (m = T);
|
|
586
|
+
}
|
|
587
|
+
return {
|
|
588
|
+
[p]: d,
|
|
589
|
+
[u]: m
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
}, Cn = function(e) {
|
|
594
|
+
return e === void 0 && (e = {}), {
|
|
595
|
+
name: "size",
|
|
596
|
+
options: e,
|
|
597
|
+
async fn(t) {
|
|
598
|
+
var n, o;
|
|
599
|
+
const {
|
|
600
|
+
placement: r,
|
|
601
|
+
rects: i,
|
|
602
|
+
platform: s,
|
|
603
|
+
elements: l
|
|
604
|
+
} = t, {
|
|
605
|
+
apply: c = () => {
|
|
606
|
+
},
|
|
607
|
+
...f
|
|
608
|
+
} = G(e, t), a = await ie(t, f), u = q(r), p = ne(r), d = z(r) === "y", {
|
|
609
|
+
width: m,
|
|
610
|
+
height: h
|
|
611
|
+
} = i.floating;
|
|
612
|
+
let w, x;
|
|
613
|
+
u === "top" || u === "bottom" ? (w = u, x = p === (await (s.isRTL == null ? void 0 : s.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (x = u, w = p === "end" ? "top" : "bottom");
|
|
614
|
+
const y = h - a.top - a.bottom, C = m - a.left - a.right, v = U(h - a[w], y), b = U(m - a[x], C), T = !t.middlewareData.shift;
|
|
615
|
+
let R = v, M = b;
|
|
616
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (M = C), (o = t.middlewareData.shift) != null && o.enabled.y && (R = y), T && !p) {
|
|
617
|
+
const D = F(a.left, 0), _ = F(a.right, 0), N = F(a.top, 0), E = F(a.bottom, 0);
|
|
618
|
+
d ? M = m - 2 * (D !== 0 || _ !== 0 ? D + _ : F(a.left, a.right)) : R = h - 2 * (N !== 0 || E !== 0 ? N + E : F(a.top, a.bottom));
|
|
619
|
+
}
|
|
620
|
+
await c({
|
|
621
|
+
...t,
|
|
622
|
+
availableWidth: M,
|
|
623
|
+
availableHeight: R
|
|
624
|
+
});
|
|
625
|
+
const H = await s.getDimensions(l.floating);
|
|
626
|
+
return m !== H.width || h !== H.height ? {
|
|
627
|
+
reset: {
|
|
628
|
+
rects: !0
|
|
629
|
+
}
|
|
630
|
+
} : {};
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
};
|
|
634
|
+
function xe() {
|
|
635
|
+
return typeof window < "u";
|
|
636
|
+
}
|
|
637
|
+
function oe(e) {
|
|
638
|
+
return st(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
639
|
+
}
|
|
640
|
+
function W(e) {
|
|
641
|
+
var t;
|
|
642
|
+
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
643
|
+
}
|
|
644
|
+
function X(e) {
|
|
645
|
+
var t;
|
|
646
|
+
return (t = (st(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
647
|
+
}
|
|
648
|
+
function st(e) {
|
|
649
|
+
return xe() ? e instanceof Node || e instanceof W(e).Node : !1;
|
|
650
|
+
}
|
|
651
|
+
function I(e) {
|
|
652
|
+
return xe() ? e instanceof Element || e instanceof W(e).Element : !1;
|
|
653
|
+
}
|
|
654
|
+
function Y(e) {
|
|
655
|
+
return xe() ? e instanceof HTMLElement || e instanceof W(e).HTMLElement : !1;
|
|
656
|
+
}
|
|
657
|
+
function Ke(e) {
|
|
658
|
+
return !xe() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof W(e).ShadowRoot;
|
|
659
|
+
}
|
|
660
|
+
const An = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
661
|
+
function le(e) {
|
|
662
|
+
const {
|
|
663
|
+
overflow: t,
|
|
664
|
+
overflowX: n,
|
|
665
|
+
overflowY: o,
|
|
666
|
+
display: r
|
|
667
|
+
} = B(e);
|
|
668
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !An.has(r);
|
|
669
|
+
}
|
|
670
|
+
const Rn = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
671
|
+
function Pn(e) {
|
|
672
|
+
return Rn.has(oe(e));
|
|
673
|
+
}
|
|
674
|
+
const Tn = [":popover-open", ":modal"];
|
|
675
|
+
function ye(e) {
|
|
676
|
+
return Tn.some((t) => {
|
|
677
|
+
try {
|
|
678
|
+
return e.matches(t);
|
|
679
|
+
} catch {
|
|
680
|
+
return !1;
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
const On = ["transform", "translate", "scale", "rotate", "perspective"], En = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Sn = ["paint", "layout", "strict", "content"];
|
|
685
|
+
function Ne(e) {
|
|
686
|
+
const t = He(), n = I(e) ? B(e) : e;
|
|
687
|
+
return On.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || En.some((o) => (n.willChange || "").includes(o)) || Sn.some((o) => (n.contain || "").includes(o));
|
|
688
|
+
}
|
|
689
|
+
function Ln(e) {
|
|
690
|
+
let t = K(e);
|
|
691
|
+
for (; Y(t) && !ee(t); ) {
|
|
692
|
+
if (Ne(t))
|
|
693
|
+
return t;
|
|
694
|
+
if (ye(t))
|
|
695
|
+
return null;
|
|
696
|
+
t = K(t);
|
|
697
|
+
}
|
|
698
|
+
return null;
|
|
699
|
+
}
|
|
700
|
+
function He() {
|
|
701
|
+
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
702
|
+
}
|
|
703
|
+
const Dn = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
704
|
+
function ee(e) {
|
|
705
|
+
return Dn.has(oe(e));
|
|
706
|
+
}
|
|
707
|
+
function B(e) {
|
|
708
|
+
return W(e).getComputedStyle(e);
|
|
709
|
+
}
|
|
710
|
+
function ve(e) {
|
|
711
|
+
return I(e) ? {
|
|
712
|
+
scrollLeft: e.scrollLeft,
|
|
713
|
+
scrollTop: e.scrollTop
|
|
714
|
+
} : {
|
|
715
|
+
scrollLeft: e.scrollX,
|
|
716
|
+
scrollTop: e.scrollY
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
function K(e) {
|
|
720
|
+
if (oe(e) === "html")
|
|
721
|
+
return e;
|
|
722
|
+
const t = (
|
|
723
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
724
|
+
e.assignedSlot || // DOM Element detected.
|
|
725
|
+
e.parentNode || // ShadowRoot detected.
|
|
726
|
+
Ke(e) && e.host || // Fallback.
|
|
727
|
+
X(e)
|
|
728
|
+
);
|
|
729
|
+
return Ke(t) ? t.host : t;
|
|
730
|
+
}
|
|
731
|
+
function ct(e) {
|
|
732
|
+
const t = K(e);
|
|
733
|
+
return ee(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : Y(t) && le(t) ? t : ct(t);
|
|
734
|
+
}
|
|
735
|
+
function se(e, t, n) {
|
|
736
|
+
var o;
|
|
737
|
+
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
738
|
+
const r = ct(e), i = r === ((o = e.ownerDocument) == null ? void 0 : o.body), s = W(r);
|
|
739
|
+
if (i) {
|
|
740
|
+
const l = Se(s);
|
|
741
|
+
return t.concat(s, s.visualViewport || [], le(r) ? r : [], l && n ? se(l) : []);
|
|
742
|
+
}
|
|
743
|
+
return t.concat(r, se(r, [], n));
|
|
744
|
+
}
|
|
745
|
+
function Se(e) {
|
|
746
|
+
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
747
|
+
}
|
|
748
|
+
function lt(e) {
|
|
749
|
+
const t = B(e);
|
|
750
|
+
let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
|
|
751
|
+
const r = Y(e), i = r ? e.offsetWidth : n, s = r ? e.offsetHeight : o, l = de(n) !== i || de(o) !== s;
|
|
752
|
+
return l && (n = i, o = s), {
|
|
753
|
+
width: n,
|
|
754
|
+
height: o,
|
|
755
|
+
$: l
|
|
756
|
+
};
|
|
757
|
+
}
|
|
758
|
+
function $e(e) {
|
|
759
|
+
return I(e) ? e : e.contextElement;
|
|
760
|
+
}
|
|
761
|
+
function Q(e) {
|
|
762
|
+
const t = $e(e);
|
|
763
|
+
if (!Y(t))
|
|
764
|
+
return j(1);
|
|
765
|
+
const n = t.getBoundingClientRect(), {
|
|
766
|
+
width: o,
|
|
767
|
+
height: r,
|
|
768
|
+
$: i
|
|
769
|
+
} = lt(t);
|
|
770
|
+
let s = (i ? de(n.width) : n.width) / o, l = (i ? de(n.height) : n.height) / r;
|
|
771
|
+
return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
772
|
+
x: s,
|
|
773
|
+
y: l
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
const Mn = /* @__PURE__ */ j(0);
|
|
777
|
+
function at(e) {
|
|
778
|
+
const t = W(e);
|
|
779
|
+
return !He() || !t.visualViewport ? Mn : {
|
|
780
|
+
x: t.visualViewport.offsetLeft,
|
|
781
|
+
y: t.visualViewport.offsetTop
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
function kn(e, t, n) {
|
|
785
|
+
return t === void 0 && (t = !1), !n || t && n !== W(e) ? !1 : t;
|
|
786
|
+
}
|
|
787
|
+
function Z(e, t, n, o) {
|
|
788
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
789
|
+
const r = e.getBoundingClientRect(), i = $e(e);
|
|
790
|
+
let s = j(1);
|
|
791
|
+
t && (o ? I(o) && (s = Q(o)) : s = Q(e));
|
|
792
|
+
const l = kn(i, n, o) ? at(i) : j(0);
|
|
793
|
+
let c = (r.left + l.x) / s.x, f = (r.top + l.y) / s.y, a = r.width / s.x, u = r.height / s.y;
|
|
794
|
+
if (i) {
|
|
795
|
+
const p = W(i), d = o && I(o) ? W(o) : o;
|
|
796
|
+
let m = p, h = Se(m);
|
|
797
|
+
for (; h && o && d !== m; ) {
|
|
798
|
+
const w = Q(h), x = h.getBoundingClientRect(), y = B(h), C = x.left + (h.clientLeft + parseFloat(y.paddingLeft)) * w.x, v = x.top + (h.clientTop + parseFloat(y.paddingTop)) * w.y;
|
|
799
|
+
c *= w.x, f *= w.y, a *= w.x, u *= w.y, c += C, f += v, m = W(h), h = Se(m);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
return me({
|
|
803
|
+
width: a,
|
|
804
|
+
height: u,
|
|
805
|
+
x: c,
|
|
806
|
+
y: f
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
function be(e, t) {
|
|
810
|
+
const n = ve(e).scrollLeft;
|
|
811
|
+
return t ? t.left + n : Z(X(e)).left + n;
|
|
812
|
+
}
|
|
813
|
+
function ft(e, t) {
|
|
814
|
+
const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft - be(e, n), r = n.top + t.scrollTop;
|
|
815
|
+
return {
|
|
816
|
+
x: o,
|
|
817
|
+
y: r
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
function _n(e) {
|
|
821
|
+
let {
|
|
822
|
+
elements: t,
|
|
823
|
+
rect: n,
|
|
824
|
+
offsetParent: o,
|
|
825
|
+
strategy: r
|
|
826
|
+
} = e;
|
|
827
|
+
const i = r === "fixed", s = X(o), l = t ? ye(t.floating) : !1;
|
|
828
|
+
if (o === s || l && i)
|
|
829
|
+
return n;
|
|
830
|
+
let c = {
|
|
831
|
+
scrollLeft: 0,
|
|
832
|
+
scrollTop: 0
|
|
833
|
+
}, f = j(1);
|
|
834
|
+
const a = j(0), u = Y(o);
|
|
835
|
+
if ((u || !u && !i) && ((oe(o) !== "body" || le(s)) && (c = ve(o)), Y(o))) {
|
|
836
|
+
const d = Z(o);
|
|
837
|
+
f = Q(o), a.x = d.x + o.clientLeft, a.y = d.y + o.clientTop;
|
|
838
|
+
}
|
|
839
|
+
const p = s && !u && !i ? ft(s, c) : j(0);
|
|
840
|
+
return {
|
|
841
|
+
width: n.width * f.x,
|
|
842
|
+
height: n.height * f.y,
|
|
843
|
+
x: n.x * f.x - c.scrollLeft * f.x + a.x + p.x,
|
|
844
|
+
y: n.y * f.y - c.scrollTop * f.y + a.y + p.y
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
function Nn(e) {
|
|
848
|
+
return Array.from(e.getClientRects());
|
|
849
|
+
}
|
|
850
|
+
function Hn(e) {
|
|
851
|
+
const t = X(e), n = ve(e), o = e.ownerDocument.body, r = F(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), i = F(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
|
|
852
|
+
let s = -n.scrollLeft + be(e);
|
|
853
|
+
const l = -n.scrollTop;
|
|
854
|
+
return B(o).direction === "rtl" && (s += F(t.clientWidth, o.clientWidth) - r), {
|
|
855
|
+
width: r,
|
|
856
|
+
height: i,
|
|
857
|
+
x: s,
|
|
858
|
+
y: l
|
|
859
|
+
};
|
|
860
|
+
}
|
|
861
|
+
const Ze = 25;
|
|
862
|
+
function $n(e, t) {
|
|
863
|
+
const n = W(e), o = X(e), r = n.visualViewport;
|
|
864
|
+
let i = o.clientWidth, s = o.clientHeight, l = 0, c = 0;
|
|
865
|
+
if (r) {
|
|
866
|
+
i = r.width, s = r.height;
|
|
867
|
+
const a = He();
|
|
868
|
+
(!a || a && t === "fixed") && (l = r.offsetLeft, c = r.offsetTop);
|
|
869
|
+
}
|
|
870
|
+
const f = be(o);
|
|
871
|
+
if (f <= 0) {
|
|
872
|
+
const a = o.ownerDocument, u = a.body, p = getComputedStyle(u), d = a.compatMode === "CSS1Compat" && parseFloat(p.marginLeft) + parseFloat(p.marginRight) || 0, m = Math.abs(o.clientWidth - u.clientWidth - d);
|
|
873
|
+
m <= Ze && (i -= m);
|
|
874
|
+
} else f <= Ze && (i += f);
|
|
875
|
+
return {
|
|
876
|
+
width: i,
|
|
877
|
+
height: s,
|
|
878
|
+
x: l,
|
|
879
|
+
y: c
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
const Fn = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
883
|
+
function Wn(e, t) {
|
|
884
|
+
const n = Z(e, !0, t === "fixed"), o = n.top + e.clientTop, r = n.left + e.clientLeft, i = Y(e) ? Q(e) : j(1), s = e.clientWidth * i.x, l = e.clientHeight * i.y, c = r * i.x, f = o * i.y;
|
|
885
|
+
return {
|
|
886
|
+
width: s,
|
|
887
|
+
height: l,
|
|
888
|
+
x: c,
|
|
889
|
+
y: f
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
function Je(e, t, n) {
|
|
893
|
+
let o;
|
|
894
|
+
if (t === "viewport")
|
|
895
|
+
o = $n(e, n);
|
|
896
|
+
else if (t === "document")
|
|
897
|
+
o = Hn(X(e));
|
|
898
|
+
else if (I(t))
|
|
899
|
+
o = Wn(t, n);
|
|
900
|
+
else {
|
|
901
|
+
const r = at(e);
|
|
902
|
+
o = {
|
|
903
|
+
x: t.x - r.x,
|
|
904
|
+
y: t.y - r.y,
|
|
905
|
+
width: t.width,
|
|
906
|
+
height: t.height
|
|
907
|
+
};
|
|
908
|
+
}
|
|
909
|
+
return me(o);
|
|
910
|
+
}
|
|
911
|
+
function ut(e, t) {
|
|
912
|
+
const n = K(e);
|
|
913
|
+
return n === t || !I(n) || ee(n) ? !1 : B(n).position === "fixed" || ut(n, t);
|
|
914
|
+
}
|
|
915
|
+
function In(e, t) {
|
|
916
|
+
const n = t.get(e);
|
|
917
|
+
if (n)
|
|
918
|
+
return n;
|
|
919
|
+
let o = se(e, [], !1).filter((l) => I(l) && oe(l) !== "body"), r = null;
|
|
920
|
+
const i = B(e).position === "fixed";
|
|
921
|
+
let s = i ? K(e) : e;
|
|
922
|
+
for (; I(s) && !ee(s); ) {
|
|
923
|
+
const l = B(s), c = Ne(s);
|
|
924
|
+
!c && l.position === "fixed" && (r = null), (i ? !c && !r : !c && l.position === "static" && !!r && Fn.has(r.position) || le(s) && !c && ut(e, s)) ? o = o.filter((a) => a !== s) : r = l, s = K(s);
|
|
925
|
+
}
|
|
926
|
+
return t.set(e, o), o;
|
|
927
|
+
}
|
|
928
|
+
function Bn(e) {
|
|
929
|
+
let {
|
|
930
|
+
element: t,
|
|
931
|
+
boundary: n,
|
|
932
|
+
rootBoundary: o,
|
|
933
|
+
strategy: r
|
|
934
|
+
} = e;
|
|
935
|
+
const s = [...n === "clippingAncestors" ? ye(t) ? [] : In(t, this._c) : [].concat(n), o], l = s[0], c = s.reduce((f, a) => {
|
|
936
|
+
const u = Je(t, a, r);
|
|
937
|
+
return f.top = F(u.top, f.top), f.right = U(u.right, f.right), f.bottom = U(u.bottom, f.bottom), f.left = F(u.left, f.left), f;
|
|
938
|
+
}, Je(t, l, r));
|
|
939
|
+
return {
|
|
940
|
+
width: c.right - c.left,
|
|
941
|
+
height: c.bottom - c.top,
|
|
942
|
+
x: c.left,
|
|
943
|
+
y: c.top
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
function Vn(e) {
|
|
947
|
+
const {
|
|
948
|
+
width: t,
|
|
949
|
+
height: n
|
|
950
|
+
} = lt(e);
|
|
951
|
+
return {
|
|
952
|
+
width: t,
|
|
953
|
+
height: n
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
function zn(e, t, n) {
|
|
957
|
+
const o = Y(t), r = X(t), i = n === "fixed", s = Z(e, !0, i, t);
|
|
958
|
+
let l = {
|
|
959
|
+
scrollLeft: 0,
|
|
960
|
+
scrollTop: 0
|
|
961
|
+
};
|
|
962
|
+
const c = j(0);
|
|
963
|
+
function f() {
|
|
964
|
+
c.x = be(r);
|
|
965
|
+
}
|
|
966
|
+
if (o || !o && !i)
|
|
967
|
+
if ((oe(t) !== "body" || le(r)) && (l = ve(t)), o) {
|
|
968
|
+
const d = Z(t, !0, i, t);
|
|
969
|
+
c.x = d.x + t.clientLeft, c.y = d.y + t.clientTop;
|
|
970
|
+
} else r && f();
|
|
971
|
+
i && !o && r && f();
|
|
972
|
+
const a = r && !o && !i ? ft(r, l) : j(0), u = s.left + l.scrollLeft - c.x - a.x, p = s.top + l.scrollTop - c.y - a.y;
|
|
973
|
+
return {
|
|
974
|
+
x: u,
|
|
975
|
+
y: p,
|
|
976
|
+
width: s.width,
|
|
977
|
+
height: s.height
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
function Pe(e) {
|
|
981
|
+
return B(e).position === "static";
|
|
982
|
+
}
|
|
983
|
+
function Qe(e, t) {
|
|
984
|
+
if (!Y(e) || B(e).position === "fixed")
|
|
985
|
+
return null;
|
|
986
|
+
if (t)
|
|
987
|
+
return t(e);
|
|
988
|
+
let n = e.offsetParent;
|
|
989
|
+
return X(e) === n && (n = n.ownerDocument.body), n;
|
|
990
|
+
}
|
|
991
|
+
function dt(e, t) {
|
|
992
|
+
const n = W(e);
|
|
993
|
+
if (ye(e))
|
|
994
|
+
return n;
|
|
995
|
+
if (!Y(e)) {
|
|
996
|
+
let r = K(e);
|
|
997
|
+
for (; r && !ee(r); ) {
|
|
998
|
+
if (I(r) && !Pe(r))
|
|
999
|
+
return r;
|
|
1000
|
+
r = K(r);
|
|
1001
|
+
}
|
|
1002
|
+
return n;
|
|
1003
|
+
}
|
|
1004
|
+
let o = Qe(e, t);
|
|
1005
|
+
for (; o && Pn(o) && Pe(o); )
|
|
1006
|
+
o = Qe(o, t);
|
|
1007
|
+
return o && ee(o) && Pe(o) && !Ne(o) ? n : o || Ln(e) || n;
|
|
1008
|
+
}
|
|
1009
|
+
const jn = async function(e) {
|
|
1010
|
+
const t = this.getOffsetParent || dt, n = this.getDimensions, o = await n(e.floating);
|
|
1011
|
+
return {
|
|
1012
|
+
reference: zn(e.reference, await t(e.floating), e.strategy),
|
|
1013
|
+
floating: {
|
|
1014
|
+
x: 0,
|
|
1015
|
+
y: 0,
|
|
1016
|
+
width: o.width,
|
|
1017
|
+
height: o.height
|
|
1018
|
+
}
|
|
1019
|
+
};
|
|
1020
|
+
};
|
|
1021
|
+
function Yn(e) {
|
|
1022
|
+
return B(e).direction === "rtl";
|
|
1023
|
+
}
|
|
1024
|
+
const Xn = {
|
|
1025
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: _n,
|
|
1026
|
+
getDocumentElement: X,
|
|
1027
|
+
getClippingRect: Bn,
|
|
1028
|
+
getOffsetParent: dt,
|
|
1029
|
+
getElementRects: jn,
|
|
1030
|
+
getClientRects: Nn,
|
|
1031
|
+
getDimensions: Vn,
|
|
1032
|
+
getScale: Q,
|
|
1033
|
+
isElement: I,
|
|
1034
|
+
isRTL: Yn
|
|
1035
|
+
};
|
|
1036
|
+
function pt(e, t) {
|
|
1037
|
+
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
1038
|
+
}
|
|
1039
|
+
function Gn(e, t) {
|
|
1040
|
+
let n = null, o;
|
|
1041
|
+
const r = X(e);
|
|
1042
|
+
function i() {
|
|
1043
|
+
var l;
|
|
1044
|
+
clearTimeout(o), (l = n) == null || l.disconnect(), n = null;
|
|
1045
|
+
}
|
|
1046
|
+
function s(l, c) {
|
|
1047
|
+
l === void 0 && (l = !1), c === void 0 && (c = 1), i();
|
|
1048
|
+
const f = e.getBoundingClientRect(), {
|
|
1049
|
+
left: a,
|
|
1050
|
+
top: u,
|
|
1051
|
+
width: p,
|
|
1052
|
+
height: d
|
|
1053
|
+
} = f;
|
|
1054
|
+
if (l || t(), !p || !d)
|
|
1055
|
+
return;
|
|
1056
|
+
const m = fe(u), h = fe(r.clientWidth - (a + p)), w = fe(r.clientHeight - (u + d)), x = fe(a), C = {
|
|
1057
|
+
rootMargin: -m + "px " + -h + "px " + -w + "px " + -x + "px",
|
|
1058
|
+
threshold: F(0, U(1, c)) || 1
|
|
1059
|
+
};
|
|
1060
|
+
let v = !0;
|
|
1061
|
+
function b(T) {
|
|
1062
|
+
const R = T[0].intersectionRatio;
|
|
1063
|
+
if (R !== c) {
|
|
1064
|
+
if (!v)
|
|
1065
|
+
return s();
|
|
1066
|
+
R ? s(!1, R) : o = setTimeout(() => {
|
|
1067
|
+
s(!1, 1e-7);
|
|
1068
|
+
}, 1e3);
|
|
1069
|
+
}
|
|
1070
|
+
R === 1 && !pt(f, e.getBoundingClientRect()) && s(), v = !1;
|
|
1071
|
+
}
|
|
1072
|
+
try {
|
|
1073
|
+
n = new IntersectionObserver(b, {
|
|
1074
|
+
...C,
|
|
1075
|
+
// Handle <iframe>s
|
|
1076
|
+
root: r.ownerDocument
|
|
1077
|
+
});
|
|
1078
|
+
} catch {
|
|
1079
|
+
n = new IntersectionObserver(b, C);
|
|
1080
|
+
}
|
|
1081
|
+
n.observe(e);
|
|
1082
|
+
}
|
|
1083
|
+
return s(!0), i;
|
|
1084
|
+
}
|
|
1085
|
+
function qn(e, t, n, o) {
|
|
1086
|
+
o === void 0 && (o = {});
|
|
1087
|
+
const {
|
|
1088
|
+
ancestorScroll: r = !0,
|
|
1089
|
+
ancestorResize: i = !0,
|
|
1090
|
+
elementResize: s = typeof ResizeObserver == "function",
|
|
1091
|
+
layoutShift: l = typeof IntersectionObserver == "function",
|
|
1092
|
+
animationFrame: c = !1
|
|
1093
|
+
} = o, f = $e(e), a = r || i ? [...f ? se(f) : [], ...se(t)] : [];
|
|
1094
|
+
a.forEach((x) => {
|
|
1095
|
+
r && x.addEventListener("scroll", n, {
|
|
1096
|
+
passive: !0
|
|
1097
|
+
}), i && x.addEventListener("resize", n);
|
|
1098
|
+
});
|
|
1099
|
+
const u = f && l ? Gn(f, n) : null;
|
|
1100
|
+
let p = -1, d = null;
|
|
1101
|
+
s && (d = new ResizeObserver((x) => {
|
|
1102
|
+
let [y] = x;
|
|
1103
|
+
y && y.target === f && d && (d.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
|
|
1104
|
+
var C;
|
|
1105
|
+
(C = d) == null || C.observe(t);
|
|
1106
|
+
})), n();
|
|
1107
|
+
}), f && !c && d.observe(f), d.observe(t));
|
|
1108
|
+
let m, h = c ? Z(e) : null;
|
|
1109
|
+
c && w();
|
|
1110
|
+
function w() {
|
|
1111
|
+
const x = Z(e);
|
|
1112
|
+
h && !pt(h, x) && n(), h = x, m = requestAnimationFrame(w);
|
|
1113
|
+
}
|
|
1114
|
+
return n(), () => {
|
|
1115
|
+
var x;
|
|
1116
|
+
a.forEach((y) => {
|
|
1117
|
+
r && y.removeEventListener("scroll", n), i && y.removeEventListener("resize", n);
|
|
1118
|
+
}), u?.(), (x = d) == null || x.disconnect(), d = null, c && cancelAnimationFrame(m);
|
|
1119
|
+
};
|
|
1120
|
+
}
|
|
1121
|
+
const Un = yn, Kn = vn, Zn = gn, Jn = Cn, Qn = wn, et = hn, eo = bn, to = (e, t, n) => {
|
|
1122
|
+
const o = /* @__PURE__ */ new Map(), r = {
|
|
1123
|
+
platform: Xn,
|
|
1124
|
+
...n
|
|
1125
|
+
}, i = {
|
|
1126
|
+
...r.platform,
|
|
1127
|
+
_c: o
|
|
1128
|
+
};
|
|
1129
|
+
return mn(e, t, {
|
|
1130
|
+
...r,
|
|
1131
|
+
platform: i
|
|
1132
|
+
});
|
|
1133
|
+
};
|
|
1134
|
+
var no = typeof document < "u", oo = function() {
|
|
1135
|
+
}, ue = no ? Vt : oo;
|
|
1136
|
+
function he(e, t) {
|
|
1137
|
+
if (e === t)
|
|
1138
|
+
return !0;
|
|
1139
|
+
if (typeof e != typeof t)
|
|
1140
|
+
return !1;
|
|
1141
|
+
if (typeof e == "function" && e.toString() === t.toString())
|
|
1142
|
+
return !0;
|
|
1143
|
+
let n, o, r;
|
|
1144
|
+
if (e && t && typeof e == "object") {
|
|
1145
|
+
if (Array.isArray(e)) {
|
|
1146
|
+
if (n = e.length, n !== t.length) return !1;
|
|
1147
|
+
for (o = n; o-- !== 0; )
|
|
1148
|
+
if (!he(e[o], t[o]))
|
|
1149
|
+
return !1;
|
|
1150
|
+
return !0;
|
|
1151
|
+
}
|
|
1152
|
+
if (r = Object.keys(e), n = r.length, n !== Object.keys(t).length)
|
|
1153
|
+
return !1;
|
|
1154
|
+
for (o = n; o-- !== 0; )
|
|
1155
|
+
if (!{}.hasOwnProperty.call(t, r[o]))
|
|
1156
|
+
return !1;
|
|
1157
|
+
for (o = n; o-- !== 0; ) {
|
|
1158
|
+
const i = r[o];
|
|
1159
|
+
if (!(i === "_owner" && e.$$typeof) && !he(e[i], t[i]))
|
|
1160
|
+
return !1;
|
|
1161
|
+
}
|
|
1162
|
+
return !0;
|
|
1163
|
+
}
|
|
1164
|
+
return e !== e && t !== t;
|
|
1165
|
+
}
|
|
1166
|
+
function mt(e) {
|
|
1167
|
+
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1168
|
+
}
|
|
1169
|
+
function tt(e, t) {
|
|
1170
|
+
const n = mt(e);
|
|
1171
|
+
return Math.round(t * n) / n;
|
|
1172
|
+
}
|
|
1173
|
+
function Te(e) {
|
|
1174
|
+
const t = g.useRef(e);
|
|
1175
|
+
return ue(() => {
|
|
1176
|
+
t.current = e;
|
|
1177
|
+
}), t;
|
|
1178
|
+
}
|
|
1179
|
+
function ro(e) {
|
|
1180
|
+
e === void 0 && (e = {});
|
|
1181
|
+
const {
|
|
1182
|
+
placement: t = "bottom",
|
|
1183
|
+
strategy: n = "absolute",
|
|
1184
|
+
middleware: o = [],
|
|
1185
|
+
platform: r,
|
|
1186
|
+
elements: {
|
|
1187
|
+
reference: i,
|
|
1188
|
+
floating: s
|
|
1189
|
+
} = {},
|
|
1190
|
+
transform: l = !0,
|
|
1191
|
+
whileElementsMounted: c,
|
|
1192
|
+
open: f
|
|
1193
|
+
} = e, [a, u] = g.useState({
|
|
1194
|
+
x: 0,
|
|
1195
|
+
y: 0,
|
|
1196
|
+
strategy: n,
|
|
1197
|
+
placement: t,
|
|
1198
|
+
middlewareData: {},
|
|
1199
|
+
isPositioned: !1
|
|
1200
|
+
}), [p, d] = g.useState(o);
|
|
1201
|
+
he(p, o) || d(o);
|
|
1202
|
+
const [m, h] = g.useState(null), [w, x] = g.useState(null), y = g.useCallback((A) => {
|
|
1203
|
+
A !== T.current && (T.current = A, h(A));
|
|
1204
|
+
}, []), C = g.useCallback((A) => {
|
|
1205
|
+
A !== R.current && (R.current = A, x(A));
|
|
1206
|
+
}, []), v = i || m, b = s || w, T = g.useRef(null), R = g.useRef(null), M = g.useRef(a), H = c != null, D = Te(c), _ = Te(r), N = Te(f), E = g.useCallback(() => {
|
|
1207
|
+
if (!T.current || !R.current)
|
|
1208
|
+
return;
|
|
1209
|
+
const A = {
|
|
1210
|
+
placement: t,
|
|
1211
|
+
strategy: n,
|
|
1212
|
+
middleware: p
|
|
1213
|
+
};
|
|
1214
|
+
_.current && (A.platform = _.current), to(T.current, R.current, A).then((k) => {
|
|
1215
|
+
const V = {
|
|
1216
|
+
...k,
|
|
1217
|
+
// The floating element's position may be recomputed while it's closed
|
|
1218
|
+
// but still mounted (such as when transitioning out). To ensure
|
|
1219
|
+
// `isPositioned` will be `false` initially on the next open, avoid
|
|
1220
|
+
// setting it to `true` when `open === false` (must be specified).
|
|
1221
|
+
isPositioned: N.current !== !1
|
|
1222
|
+
};
|
|
1223
|
+
O.current && !he(M.current, V) && (M.current = V, Kt.flushSync(() => {
|
|
1224
|
+
u(V);
|
|
1225
|
+
}));
|
|
1226
|
+
});
|
|
1227
|
+
}, [p, t, n, _, N]);
|
|
1228
|
+
ue(() => {
|
|
1229
|
+
f === !1 && M.current.isPositioned && (M.current.isPositioned = !1, u((A) => ({
|
|
1230
|
+
...A,
|
|
1231
|
+
isPositioned: !1
|
|
1232
|
+
})));
|
|
1233
|
+
}, [f]);
|
|
1234
|
+
const O = g.useRef(!1);
|
|
1235
|
+
ue(() => (O.current = !0, () => {
|
|
1236
|
+
O.current = !1;
|
|
1237
|
+
}), []), ue(() => {
|
|
1238
|
+
if (v && (T.current = v), b && (R.current = b), v && b) {
|
|
1239
|
+
if (D.current)
|
|
1240
|
+
return D.current(v, b, E);
|
|
1241
|
+
E();
|
|
1242
|
+
}
|
|
1243
|
+
}, [v, b, E, D, H]);
|
|
1244
|
+
const $ = g.useMemo(() => ({
|
|
1245
|
+
reference: T,
|
|
1246
|
+
floating: R,
|
|
1247
|
+
setReference: y,
|
|
1248
|
+
setFloating: C
|
|
1249
|
+
}), [y, C]), S = g.useMemo(() => ({
|
|
1250
|
+
reference: v,
|
|
1251
|
+
floating: b
|
|
1252
|
+
}), [v, b]), L = g.useMemo(() => {
|
|
1253
|
+
const A = {
|
|
1254
|
+
position: n,
|
|
1255
|
+
left: 0,
|
|
1256
|
+
top: 0
|
|
1257
|
+
};
|
|
1258
|
+
if (!S.floating)
|
|
1259
|
+
return A;
|
|
1260
|
+
const k = tt(S.floating, a.x), V = tt(S.floating, a.y);
|
|
1261
|
+
return l ? {
|
|
1262
|
+
...A,
|
|
1263
|
+
transform: "translate(" + k + "px, " + V + "px)",
|
|
1264
|
+
...mt(S.floating) >= 1.5 && {
|
|
1265
|
+
willChange: "transform"
|
|
1266
|
+
}
|
|
1267
|
+
} : {
|
|
1268
|
+
position: n,
|
|
1269
|
+
left: k,
|
|
1270
|
+
top: V
|
|
1271
|
+
};
|
|
1272
|
+
}, [n, l, S.floating, a.x, a.y]);
|
|
1273
|
+
return g.useMemo(() => ({
|
|
1274
|
+
...a,
|
|
1275
|
+
update: E,
|
|
1276
|
+
refs: $,
|
|
1277
|
+
elements: S,
|
|
1278
|
+
floatingStyles: L
|
|
1279
|
+
}), [a, E, $, S, L]);
|
|
1280
|
+
}
|
|
1281
|
+
const io = (e) => {
|
|
1282
|
+
function t(n) {
|
|
1283
|
+
return {}.hasOwnProperty.call(n, "current");
|
|
1284
|
+
}
|
|
1285
|
+
return {
|
|
1286
|
+
name: "arrow",
|
|
1287
|
+
options: e,
|
|
1288
|
+
fn(n) {
|
|
1289
|
+
const {
|
|
1290
|
+
element: o,
|
|
1291
|
+
padding: r
|
|
1292
|
+
} = typeof e == "function" ? e(n) : e;
|
|
1293
|
+
return o && t(o) ? o.current != null ? et({
|
|
1294
|
+
element: o.current,
|
|
1295
|
+
padding: r
|
|
1296
|
+
}).fn(n) : {} : o ? et({
|
|
1297
|
+
element: o,
|
|
1298
|
+
padding: r
|
|
1299
|
+
}).fn(n) : {};
|
|
1300
|
+
}
|
|
1301
|
+
};
|
|
1302
|
+
}, so = (e, t) => ({
|
|
1303
|
+
...Un(e),
|
|
1304
|
+
options: [e, t]
|
|
1305
|
+
}), co = (e, t) => ({
|
|
1306
|
+
...Kn(e),
|
|
1307
|
+
options: [e, t]
|
|
1308
|
+
}), lo = (e, t) => ({
|
|
1309
|
+
...eo(e),
|
|
1310
|
+
options: [e, t]
|
|
1311
|
+
}), ao = (e, t) => ({
|
|
1312
|
+
...Zn(e),
|
|
1313
|
+
options: [e, t]
|
|
1314
|
+
}), fo = (e, t) => ({
|
|
1315
|
+
...Jn(e),
|
|
1316
|
+
options: [e, t]
|
|
1317
|
+
}), uo = (e, t) => ({
|
|
1318
|
+
...Qn(e),
|
|
1319
|
+
options: [e, t]
|
|
1320
|
+
}), po = (e, t) => ({
|
|
1321
|
+
...io(e),
|
|
1322
|
+
options: [e, t]
|
|
1323
|
+
});
|
|
1324
|
+
var mo = "Arrow", ht = g.forwardRef((e, t) => {
|
|
1325
|
+
const { children: n, width: o = 10, height: r = 5, ...i } = e;
|
|
1326
|
+
return /* @__PURE__ */ P(
|
|
1327
|
+
we.svg,
|
|
1328
|
+
{
|
|
1329
|
+
...i,
|
|
1330
|
+
ref: t,
|
|
1331
|
+
width: o,
|
|
1332
|
+
height: r,
|
|
1333
|
+
viewBox: "0 0 30 10",
|
|
1334
|
+
preserveAspectRatio: "none",
|
|
1335
|
+
children: e.asChild ? n : /* @__PURE__ */ P("polygon", { points: "0,0 30,0 15,10" })
|
|
1336
|
+
}
|
|
1337
|
+
);
|
|
1338
|
+
});
|
|
1339
|
+
ht.displayName = mo;
|
|
1340
|
+
var ho = ht, Fe = "Popper", [gt, wt] = ot(Fe), [go, xt] = gt(Fe), yt = (e) => {
|
|
1341
|
+
const { __scopePopper: t, children: n } = e, [o, r] = g.useState(null);
|
|
1342
|
+
return /* @__PURE__ */ P(go, { scope: t, anchor: o, onAnchorChange: r, children: n });
|
|
1343
|
+
};
|
|
1344
|
+
yt.displayName = Fe;
|
|
1345
|
+
var vt = "PopperAnchor", bt = g.forwardRef(
|
|
1346
|
+
(e, t) => {
|
|
1347
|
+
const { __scopePopper: n, virtualRef: o, ...r } = e, i = xt(vt, n), s = g.useRef(null), l = ge(t, s), c = g.useRef(null);
|
|
1348
|
+
return g.useEffect(() => {
|
|
1349
|
+
const f = c.current;
|
|
1350
|
+
c.current = o?.current || s.current, f !== c.current && i.onAnchorChange(c.current);
|
|
1351
|
+
}), o ? null : /* @__PURE__ */ P(we.div, { ...r, ref: l });
|
|
1352
|
+
}
|
|
1353
|
+
);
|
|
1354
|
+
bt.displayName = vt;
|
|
1355
|
+
var We = "PopperContent", [wo, xo] = gt(We), Ct = g.forwardRef(
|
|
1356
|
+
(e, t) => {
|
|
1357
|
+
const {
|
|
1358
|
+
__scopePopper: n,
|
|
1359
|
+
side: o = "bottom",
|
|
1360
|
+
sideOffset: r = 0,
|
|
1361
|
+
align: i = "center",
|
|
1362
|
+
alignOffset: s = 0,
|
|
1363
|
+
arrowPadding: l = 0,
|
|
1364
|
+
avoidCollisions: c = !0,
|
|
1365
|
+
collisionBoundary: f = [],
|
|
1366
|
+
collisionPadding: a = 0,
|
|
1367
|
+
sticky: u = "partial",
|
|
1368
|
+
hideWhenDetached: p = !1,
|
|
1369
|
+
updatePositionStrategy: d = "optimized",
|
|
1370
|
+
onPlaced: m,
|
|
1371
|
+
...h
|
|
1372
|
+
} = e, w = xt(We, n), [x, y] = g.useState(null), C = ge(t, (re) => y(re)), [v, b] = g.useState(null), T = Jt(v), R = T?.width ?? 0, M = T?.height ?? 0, H = o + (i !== "center" ? "-" + i : ""), D = typeof a == "number" ? a : { top: 0, right: 0, bottom: 0, left: 0, ...a }, _ = Array.isArray(f) ? f : [f], N = _.length > 0, E = {
|
|
1373
|
+
padding: D,
|
|
1374
|
+
boundary: _.filter(vo),
|
|
1375
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
1376
|
+
altBoundary: N
|
|
1377
|
+
}, { refs: O, floatingStyles: $, placement: S, isPositioned: L, middlewareData: A } = ro({
|
|
1378
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
1379
|
+
strategy: "fixed",
|
|
1380
|
+
placement: H,
|
|
1381
|
+
whileElementsMounted: (...re) => qn(...re, {
|
|
1382
|
+
animationFrame: d === "always"
|
|
1383
|
+
}),
|
|
1384
|
+
elements: {
|
|
1385
|
+
reference: w.anchor
|
|
1386
|
+
},
|
|
1387
|
+
middleware: [
|
|
1388
|
+
so({ mainAxis: r + M, alignmentAxis: s }),
|
|
1389
|
+
c && co({
|
|
1390
|
+
mainAxis: !0,
|
|
1391
|
+
crossAxis: !1,
|
|
1392
|
+
limiter: u === "partial" ? lo() : void 0,
|
|
1393
|
+
...E
|
|
1394
|
+
}),
|
|
1395
|
+
c && ao({ ...E }),
|
|
1396
|
+
fo({
|
|
1397
|
+
...E,
|
|
1398
|
+
apply: ({ elements: re, rects: Ve, availableWidth: Ft, availableHeight: Wt }) => {
|
|
1399
|
+
const { width: It, height: Bt } = Ve.reference, ae = re.floating.style;
|
|
1400
|
+
ae.setProperty("--radix-popper-available-width", `${Ft}px`), ae.setProperty("--radix-popper-available-height", `${Wt}px`), ae.setProperty("--radix-popper-anchor-width", `${It}px`), ae.setProperty("--radix-popper-anchor-height", `${Bt}px`);
|
|
1401
|
+
}
|
|
1402
|
+
}),
|
|
1403
|
+
v && po({ element: v, padding: l }),
|
|
1404
|
+
bo({ arrowWidth: R, arrowHeight: M }),
|
|
1405
|
+
p && uo({ strategy: "referenceHidden", ...E })
|
|
1406
|
+
]
|
|
1407
|
+
}), [k, V] = Pt(S), Be = Zt(m);
|
|
1408
|
+
je(() => {
|
|
1409
|
+
L && Be?.();
|
|
1410
|
+
}, [L, Be]);
|
|
1411
|
+
const kt = A.arrow?.x, _t = A.arrow?.y, Nt = A.arrow?.centerOffset !== 0, [Ht, $t] = g.useState();
|
|
1412
|
+
return je(() => {
|
|
1413
|
+
x && $t(window.getComputedStyle(x).zIndex);
|
|
1414
|
+
}, [x]), /* @__PURE__ */ P(
|
|
1415
|
+
"div",
|
|
1416
|
+
{
|
|
1417
|
+
ref: O.setFloating,
|
|
1418
|
+
"data-radix-popper-content-wrapper": "",
|
|
1419
|
+
style: {
|
|
1420
|
+
...$,
|
|
1421
|
+
transform: L ? $.transform : "translate(0, -200%)",
|
|
1422
|
+
// keep off the page when measuring
|
|
1423
|
+
minWidth: "max-content",
|
|
1424
|
+
zIndex: Ht,
|
|
1425
|
+
"--radix-popper-transform-origin": [
|
|
1426
|
+
A.transformOrigin?.x,
|
|
1427
|
+
A.transformOrigin?.y
|
|
1428
|
+
].join(" "),
|
|
1429
|
+
// hide the content if using the hide middleware and should be hidden
|
|
1430
|
+
// set visibility to hidden and disable pointer events so the UI behaves
|
|
1431
|
+
// as if the PopperContent isn't there at all
|
|
1432
|
+
...A.hide?.referenceHidden && {
|
|
1433
|
+
visibility: "hidden",
|
|
1434
|
+
pointerEvents: "none"
|
|
1435
|
+
}
|
|
1436
|
+
},
|
|
1437
|
+
dir: e.dir,
|
|
1438
|
+
children: /* @__PURE__ */ P(
|
|
1439
|
+
wo,
|
|
1440
|
+
{
|
|
1441
|
+
scope: n,
|
|
1442
|
+
placedSide: k,
|
|
1443
|
+
onArrowChange: b,
|
|
1444
|
+
arrowX: kt,
|
|
1445
|
+
arrowY: _t,
|
|
1446
|
+
shouldHideArrow: Nt,
|
|
1447
|
+
children: /* @__PURE__ */ P(
|
|
1448
|
+
we.div,
|
|
1449
|
+
{
|
|
1450
|
+
"data-side": k,
|
|
1451
|
+
"data-align": V,
|
|
1452
|
+
...h,
|
|
1453
|
+
ref: C,
|
|
1454
|
+
style: {
|
|
1455
|
+
...h.style,
|
|
1456
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
1457
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
1458
|
+
animation: L ? void 0 : "none"
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
)
|
|
1462
|
+
}
|
|
1463
|
+
)
|
|
1464
|
+
}
|
|
1465
|
+
);
|
|
1466
|
+
}
|
|
1467
|
+
);
|
|
1468
|
+
Ct.displayName = We;
|
|
1469
|
+
var At = "PopperArrow", yo = {
|
|
1470
|
+
top: "bottom",
|
|
1471
|
+
right: "left",
|
|
1472
|
+
bottom: "top",
|
|
1473
|
+
left: "right"
|
|
1474
|
+
}, Rt = g.forwardRef(function(t, n) {
|
|
1475
|
+
const { __scopePopper: o, ...r } = t, i = xo(At, o), s = yo[i.placedSide];
|
|
1476
|
+
return (
|
|
1477
|
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
1478
|
+
// doesn't report size as we'd expect on SVG elements.
|
|
1479
|
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
1480
|
+
/* @__PURE__ */ P(
|
|
1481
|
+
"span",
|
|
1482
|
+
{
|
|
1483
|
+
ref: i.onArrowChange,
|
|
1484
|
+
style: {
|
|
1485
|
+
position: "absolute",
|
|
1486
|
+
left: i.arrowX,
|
|
1487
|
+
top: i.arrowY,
|
|
1488
|
+
[s]: 0,
|
|
1489
|
+
transformOrigin: {
|
|
1490
|
+
top: "",
|
|
1491
|
+
right: "0 0",
|
|
1492
|
+
bottom: "center 0",
|
|
1493
|
+
left: "100% 0"
|
|
1494
|
+
}[i.placedSide],
|
|
1495
|
+
transform: {
|
|
1496
|
+
top: "translateY(100%)",
|
|
1497
|
+
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
1498
|
+
bottom: "rotate(180deg)",
|
|
1499
|
+
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
1500
|
+
}[i.placedSide],
|
|
1501
|
+
visibility: i.shouldHideArrow ? "hidden" : void 0
|
|
1502
|
+
},
|
|
1503
|
+
children: /* @__PURE__ */ P(
|
|
1504
|
+
ho,
|
|
1505
|
+
{
|
|
1506
|
+
...r,
|
|
1507
|
+
ref: n,
|
|
1508
|
+
style: {
|
|
1509
|
+
...r.style,
|
|
1510
|
+
// ensures the element can be measured correctly (mostly for if SVG)
|
|
1511
|
+
display: "block"
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
)
|
|
1515
|
+
}
|
|
1516
|
+
)
|
|
1517
|
+
);
|
|
1518
|
+
});
|
|
1519
|
+
Rt.displayName = At;
|
|
1520
|
+
function vo(e) {
|
|
1521
|
+
return e !== null;
|
|
1522
|
+
}
|
|
1523
|
+
var bo = (e) => ({
|
|
1524
|
+
name: "transformOrigin",
|
|
1525
|
+
options: e,
|
|
1526
|
+
fn(t) {
|
|
1527
|
+
const { placement: n, rects: o, middlewareData: r } = t, s = r.arrow?.centerOffset !== 0, l = s ? 0 : e.arrowWidth, c = s ? 0 : e.arrowHeight, [f, a] = Pt(n), u = { start: "0%", center: "50%", end: "100%" }[a], p = (r.arrow?.x ?? 0) + l / 2, d = (r.arrow?.y ?? 0) + c / 2;
|
|
1528
|
+
let m = "", h = "";
|
|
1529
|
+
return f === "bottom" ? (m = s ? u : `${p}px`, h = `${-c}px`) : f === "top" ? (m = s ? u : `${p}px`, h = `${o.floating.height + c}px`) : f === "right" ? (m = `${-c}px`, h = s ? u : `${d}px`) : f === "left" && (m = `${o.floating.width + c}px`, h = s ? u : `${d}px`), { data: { x: m, y: h } };
|
|
1530
|
+
}
|
|
1531
|
+
});
|
|
1532
|
+
function Pt(e) {
|
|
1533
|
+
const [t, n = "center"] = e.split("-");
|
|
1534
|
+
return [t, n];
|
|
1535
|
+
}
|
|
1536
|
+
var Co = yt, Ao = bt, Ro = Ct, Po = Rt, [Ce, rr] = ot("Tooltip", [
|
|
1537
|
+
wt
|
|
1538
|
+
]), Ae = wt(), Tt = "TooltipProvider", To = 700, Le = "tooltip.open", [Oo, Ie] = Ce(Tt), Ot = (e) => {
|
|
1539
|
+
const {
|
|
1540
|
+
__scopeTooltip: t,
|
|
1541
|
+
delayDuration: n = To,
|
|
1542
|
+
skipDelayDuration: o = 300,
|
|
1543
|
+
disableHoverableContent: r = !1,
|
|
1544
|
+
children: i
|
|
1545
|
+
} = e, s = g.useRef(!0), l = g.useRef(!1), c = g.useRef(0);
|
|
1546
|
+
return g.useEffect(() => {
|
|
1547
|
+
const f = c.current;
|
|
1548
|
+
return () => window.clearTimeout(f);
|
|
1549
|
+
}, []), /* @__PURE__ */ P(
|
|
1550
|
+
Oo,
|
|
1551
|
+
{
|
|
1552
|
+
scope: t,
|
|
1553
|
+
isOpenDelayedRef: s,
|
|
1554
|
+
delayDuration: n,
|
|
1555
|
+
onOpen: g.useCallback(() => {
|
|
1556
|
+
window.clearTimeout(c.current), s.current = !1;
|
|
1557
|
+
}, []),
|
|
1558
|
+
onClose: g.useCallback(() => {
|
|
1559
|
+
window.clearTimeout(c.current), c.current = window.setTimeout(
|
|
1560
|
+
() => s.current = !0,
|
|
1561
|
+
o
|
|
1562
|
+
);
|
|
1563
|
+
}, [o]),
|
|
1564
|
+
isPointerInTransitRef: l,
|
|
1565
|
+
onPointerInTransitChange: g.useCallback((f) => {
|
|
1566
|
+
l.current = f;
|
|
1567
|
+
}, []),
|
|
1568
|
+
disableHoverableContent: r,
|
|
1569
|
+
children: i
|
|
1570
|
+
}
|
|
1571
|
+
);
|
|
1572
|
+
};
|
|
1573
|
+
Ot.displayName = Tt;
|
|
1574
|
+
var ce = "Tooltip", [Eo, Re] = Ce(ce), Et = (e) => {
|
|
1575
|
+
const {
|
|
1576
|
+
__scopeTooltip: t,
|
|
1577
|
+
children: n,
|
|
1578
|
+
open: o,
|
|
1579
|
+
defaultOpen: r,
|
|
1580
|
+
onOpenChange: i,
|
|
1581
|
+
disableHoverableContent: s,
|
|
1582
|
+
delayDuration: l
|
|
1583
|
+
} = e, c = Ie(ce, e.__scopeTooltip), f = Ae(t), [a, u] = g.useState(null), p = Ut(), d = g.useRef(0), m = s ?? c.disableHoverableContent, h = l ?? c.delayDuration, w = g.useRef(!1), [x, y] = Xt({
|
|
1584
|
+
prop: o,
|
|
1585
|
+
defaultProp: r ?? !1,
|
|
1586
|
+
onChange: (R) => {
|
|
1587
|
+
R ? (c.onOpen(), document.dispatchEvent(new CustomEvent(Le))) : c.onClose(), i?.(R);
|
|
1588
|
+
},
|
|
1589
|
+
caller: ce
|
|
1590
|
+
}), C = g.useMemo(() => x ? w.current ? "delayed-open" : "instant-open" : "closed", [x]), v = g.useCallback(() => {
|
|
1591
|
+
window.clearTimeout(d.current), d.current = 0, w.current = !1, y(!0);
|
|
1592
|
+
}, [y]), b = g.useCallback(() => {
|
|
1593
|
+
window.clearTimeout(d.current), d.current = 0, y(!1);
|
|
1594
|
+
}, [y]), T = g.useCallback(() => {
|
|
1595
|
+
window.clearTimeout(d.current), d.current = window.setTimeout(() => {
|
|
1596
|
+
w.current = !0, y(!0), d.current = 0;
|
|
1597
|
+
}, h);
|
|
1598
|
+
}, [h, y]);
|
|
1599
|
+
return g.useEffect(() => () => {
|
|
1600
|
+
d.current && (window.clearTimeout(d.current), d.current = 0);
|
|
1601
|
+
}, []), /* @__PURE__ */ P(Co, { ...f, children: /* @__PURE__ */ P(
|
|
1602
|
+
Eo,
|
|
1603
|
+
{
|
|
1604
|
+
scope: t,
|
|
1605
|
+
contentId: p,
|
|
1606
|
+
open: x,
|
|
1607
|
+
stateAttribute: C,
|
|
1608
|
+
trigger: a,
|
|
1609
|
+
onTriggerChange: u,
|
|
1610
|
+
onTriggerEnter: g.useCallback(() => {
|
|
1611
|
+
c.isOpenDelayedRef.current ? T() : v();
|
|
1612
|
+
}, [c.isOpenDelayedRef, T, v]),
|
|
1613
|
+
onTriggerLeave: g.useCallback(() => {
|
|
1614
|
+
m ? b() : (window.clearTimeout(d.current), d.current = 0);
|
|
1615
|
+
}, [b, m]),
|
|
1616
|
+
onOpen: v,
|
|
1617
|
+
onClose: b,
|
|
1618
|
+
disableHoverableContent: m,
|
|
1619
|
+
children: n
|
|
1620
|
+
}
|
|
1621
|
+
) });
|
|
1622
|
+
};
|
|
1623
|
+
Et.displayName = ce;
|
|
1624
|
+
var De = "TooltipTrigger", St = g.forwardRef(
|
|
1625
|
+
(e, t) => {
|
|
1626
|
+
const { __scopeTooltip: n, ...o } = e, r = Re(De, n), i = Ie(De, n), s = Ae(n), l = g.useRef(null), c = ge(t, l, r.onTriggerChange), f = g.useRef(!1), a = g.useRef(!1), u = g.useCallback(() => f.current = !1, []);
|
|
1627
|
+
return g.useEffect(() => () => document.removeEventListener("pointerup", u), [u]), /* @__PURE__ */ P(Ao, { asChild: !0, ...s, children: /* @__PURE__ */ P(
|
|
1628
|
+
we.button,
|
|
1629
|
+
{
|
|
1630
|
+
"aria-describedby": r.open ? r.contentId : void 0,
|
|
1631
|
+
"data-state": r.stateAttribute,
|
|
1632
|
+
...o,
|
|
1633
|
+
ref: c,
|
|
1634
|
+
onPointerMove: J(e.onPointerMove, (p) => {
|
|
1635
|
+
p.pointerType !== "touch" && !a.current && !i.isPointerInTransitRef.current && (r.onTriggerEnter(), a.current = !0);
|
|
1636
|
+
}),
|
|
1637
|
+
onPointerLeave: J(e.onPointerLeave, () => {
|
|
1638
|
+
r.onTriggerLeave(), a.current = !1;
|
|
1639
|
+
}),
|
|
1640
|
+
onPointerDown: J(e.onPointerDown, () => {
|
|
1641
|
+
r.open && r.onClose(), f.current = !0, document.addEventListener("pointerup", u, { once: !0 });
|
|
1642
|
+
}),
|
|
1643
|
+
onFocus: J(e.onFocus, () => {
|
|
1644
|
+
f.current || r.onOpen();
|
|
1645
|
+
}),
|
|
1646
|
+
onBlur: J(e.onBlur, r.onClose),
|
|
1647
|
+
onClick: J(e.onClick, r.onClose)
|
|
1648
|
+
}
|
|
1649
|
+
) });
|
|
1650
|
+
}
|
|
1651
|
+
);
|
|
1652
|
+
St.displayName = De;
|
|
1653
|
+
var So = "TooltipPortal", [ir, Lo] = Ce(So, {
|
|
1654
|
+
forceMount: void 0
|
|
1655
|
+
}), te = "TooltipContent", Lt = g.forwardRef(
|
|
1656
|
+
(e, t) => {
|
|
1657
|
+
const n = Lo(te, e.__scopeTooltip), { forceMount: o = n.forceMount, side: r = "top", ...i } = e, s = Re(te, e.__scopeTooltip);
|
|
1658
|
+
return /* @__PURE__ */ P(Qt, { present: o || s.open, children: s.disableHoverableContent ? /* @__PURE__ */ P(Dt, { side: r, ...i, ref: t }) : /* @__PURE__ */ P(Do, { side: r, ...i, ref: t }) });
|
|
1659
|
+
}
|
|
1660
|
+
), Do = g.forwardRef((e, t) => {
|
|
1661
|
+
const n = Re(te, e.__scopeTooltip), o = Ie(te, e.__scopeTooltip), r = g.useRef(null), i = ge(t, r), [s, l] = g.useState(null), { trigger: c, onClose: f } = n, a = r.current, { onPointerInTransitChange: u } = o, p = g.useCallback(() => {
|
|
1662
|
+
l(null), u(!1);
|
|
1663
|
+
}, [u]), d = g.useCallback(
|
|
1664
|
+
(m, h) => {
|
|
1665
|
+
const w = m.currentTarget, x = { x: m.clientX, y: m.clientY }, y = Ho(x, w.getBoundingClientRect()), C = $o(x, y), v = Fo(h.getBoundingClientRect()), b = Io([...C, ...v]);
|
|
1666
|
+
l(b), u(!0);
|
|
1667
|
+
},
|
|
1668
|
+
[u]
|
|
1669
|
+
);
|
|
1670
|
+
return g.useEffect(() => () => p(), [p]), g.useEffect(() => {
|
|
1671
|
+
if (c && a) {
|
|
1672
|
+
const m = (w) => d(w, a), h = (w) => d(w, c);
|
|
1673
|
+
return c.addEventListener("pointerleave", m), a.addEventListener("pointerleave", h), () => {
|
|
1674
|
+
c.removeEventListener("pointerleave", m), a.removeEventListener("pointerleave", h);
|
|
1675
|
+
};
|
|
1676
|
+
}
|
|
1677
|
+
}, [c, a, d, p]), g.useEffect(() => {
|
|
1678
|
+
if (s) {
|
|
1679
|
+
const m = (h) => {
|
|
1680
|
+
const w = h.target, x = { x: h.clientX, y: h.clientY }, y = c?.contains(w) || a?.contains(w), C = !Wo(x, s);
|
|
1681
|
+
y ? p() : C && (p(), f());
|
|
1682
|
+
};
|
|
1683
|
+
return document.addEventListener("pointermove", m), () => document.removeEventListener("pointermove", m);
|
|
1684
|
+
}
|
|
1685
|
+
}, [c, a, s, f, p]), /* @__PURE__ */ P(Dt, { ...e, ref: i });
|
|
1686
|
+
}), [Mo, ko] = Ce(ce, { isInside: !1 }), _o = Gt("TooltipContent"), Dt = g.forwardRef(
|
|
1687
|
+
(e, t) => {
|
|
1688
|
+
const {
|
|
1689
|
+
__scopeTooltip: n,
|
|
1690
|
+
children: o,
|
|
1691
|
+
"aria-label": r,
|
|
1692
|
+
onEscapeKeyDown: i,
|
|
1693
|
+
onPointerDownOutside: s,
|
|
1694
|
+
...l
|
|
1695
|
+
} = e, c = Re(te, n), f = Ae(n), { onClose: a } = c;
|
|
1696
|
+
return g.useEffect(() => (document.addEventListener(Le, a), () => document.removeEventListener(Le, a)), [a]), g.useEffect(() => {
|
|
1697
|
+
if (c.trigger) {
|
|
1698
|
+
const u = (p) => {
|
|
1699
|
+
p.target?.contains(c.trigger) && a();
|
|
1700
|
+
};
|
|
1701
|
+
return window.addEventListener("scroll", u, { capture: !0 }), () => window.removeEventListener("scroll", u, { capture: !0 });
|
|
1702
|
+
}
|
|
1703
|
+
}, [c.trigger, a]), /* @__PURE__ */ P(
|
|
1704
|
+
qt,
|
|
1705
|
+
{
|
|
1706
|
+
asChild: !0,
|
|
1707
|
+
disableOutsidePointerEvents: !1,
|
|
1708
|
+
onEscapeKeyDown: i,
|
|
1709
|
+
onPointerDownOutside: s,
|
|
1710
|
+
onFocusOutside: (u) => u.preventDefault(),
|
|
1711
|
+
onDismiss: a,
|
|
1712
|
+
children: /* @__PURE__ */ nt(
|
|
1713
|
+
Ro,
|
|
1714
|
+
{
|
|
1715
|
+
"data-state": c.stateAttribute,
|
|
1716
|
+
...f,
|
|
1717
|
+
...l,
|
|
1718
|
+
ref: t,
|
|
1719
|
+
style: {
|
|
1720
|
+
...l.style,
|
|
1721
|
+
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
1722
|
+
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
|
1723
|
+
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
|
1724
|
+
"--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
|
|
1725
|
+
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
1726
|
+
},
|
|
1727
|
+
children: [
|
|
1728
|
+
/* @__PURE__ */ P(_o, { children: o }),
|
|
1729
|
+
/* @__PURE__ */ P(Mo, { scope: n, isInside: !0, children: /* @__PURE__ */ P(en, { id: c.contentId, role: "tooltip", children: r || o }) })
|
|
1730
|
+
]
|
|
1731
|
+
}
|
|
1732
|
+
)
|
|
1733
|
+
}
|
|
1734
|
+
);
|
|
1735
|
+
}
|
|
1736
|
+
);
|
|
1737
|
+
Lt.displayName = te;
|
|
1738
|
+
var Mt = "TooltipArrow", No = g.forwardRef(
|
|
1739
|
+
(e, t) => {
|
|
1740
|
+
const { __scopeTooltip: n, ...o } = e, r = Ae(n);
|
|
1741
|
+
return ko(
|
|
1742
|
+
Mt,
|
|
1743
|
+
n
|
|
1744
|
+
).isInside ? null : /* @__PURE__ */ P(Po, { ...r, ...o, ref: t });
|
|
1745
|
+
}
|
|
1746
|
+
);
|
|
1747
|
+
No.displayName = Mt;
|
|
1748
|
+
function Ho(e, t) {
|
|
1749
|
+
const n = Math.abs(t.top - e.y), o = Math.abs(t.bottom - e.y), r = Math.abs(t.right - e.x), i = Math.abs(t.left - e.x);
|
|
1750
|
+
switch (Math.min(n, o, r, i)) {
|
|
1751
|
+
case i:
|
|
1752
|
+
return "left";
|
|
1753
|
+
case r:
|
|
1754
|
+
return "right";
|
|
1755
|
+
case n:
|
|
1756
|
+
return "top";
|
|
1757
|
+
case o:
|
|
1758
|
+
return "bottom";
|
|
1759
|
+
default:
|
|
1760
|
+
throw new Error("unreachable");
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
function $o(e, t, n = 5) {
|
|
1764
|
+
const o = [];
|
|
1765
|
+
switch (t) {
|
|
1766
|
+
case "top":
|
|
1767
|
+
o.push(
|
|
1768
|
+
{ x: e.x - n, y: e.y + n },
|
|
1769
|
+
{ x: e.x + n, y: e.y + n }
|
|
1770
|
+
);
|
|
1771
|
+
break;
|
|
1772
|
+
case "bottom":
|
|
1773
|
+
o.push(
|
|
1774
|
+
{ x: e.x - n, y: e.y - n },
|
|
1775
|
+
{ x: e.x + n, y: e.y - n }
|
|
1776
|
+
);
|
|
1777
|
+
break;
|
|
1778
|
+
case "left":
|
|
1779
|
+
o.push(
|
|
1780
|
+
{ x: e.x + n, y: e.y - n },
|
|
1781
|
+
{ x: e.x + n, y: e.y + n }
|
|
1782
|
+
);
|
|
1783
|
+
break;
|
|
1784
|
+
case "right":
|
|
1785
|
+
o.push(
|
|
1786
|
+
{ x: e.x - n, y: e.y - n },
|
|
1787
|
+
{ x: e.x - n, y: e.y + n }
|
|
1788
|
+
);
|
|
1789
|
+
break;
|
|
1790
|
+
}
|
|
1791
|
+
return o;
|
|
1792
|
+
}
|
|
1793
|
+
function Fo(e) {
|
|
1794
|
+
const { top: t, right: n, bottom: o, left: r } = e;
|
|
1795
|
+
return [
|
|
1796
|
+
{ x: r, y: t },
|
|
1797
|
+
{ x: n, y: t },
|
|
1798
|
+
{ x: n, y: o },
|
|
1799
|
+
{ x: r, y: o }
|
|
1800
|
+
];
|
|
1801
|
+
}
|
|
1802
|
+
function Wo(e, t) {
|
|
1803
|
+
const { x: n, y: o } = e;
|
|
1804
|
+
let r = !1;
|
|
1805
|
+
for (let i = 0, s = t.length - 1; i < t.length; s = i++) {
|
|
1806
|
+
const l = t[i], c = t[s], f = l.x, a = l.y, u = c.x, p = c.y;
|
|
1807
|
+
a > o != p > o && n < (u - f) * (o - a) / (p - a) + f && (r = !r);
|
|
1808
|
+
}
|
|
1809
|
+
return r;
|
|
1810
|
+
}
|
|
1811
|
+
function Io(e) {
|
|
1812
|
+
const t = e.slice();
|
|
1813
|
+
return t.sort((n, o) => n.x < o.x ? -1 : n.x > o.x ? 1 : n.y < o.y ? -1 : n.y > o.y ? 1 : 0), Bo(t);
|
|
1814
|
+
}
|
|
1815
|
+
function Bo(e) {
|
|
1816
|
+
if (e.length <= 1) return e.slice();
|
|
1817
|
+
const t = [];
|
|
1818
|
+
for (let o = 0; o < e.length; o++) {
|
|
1819
|
+
const r = e[o];
|
|
1820
|
+
for (; t.length >= 2; ) {
|
|
1821
|
+
const i = t[t.length - 1], s = t[t.length - 2];
|
|
1822
|
+
if ((i.x - s.x) * (r.y - s.y) >= (i.y - s.y) * (r.x - s.x)) t.pop();
|
|
1823
|
+
else break;
|
|
1824
|
+
}
|
|
1825
|
+
t.push(r);
|
|
1826
|
+
}
|
|
1827
|
+
t.pop();
|
|
1828
|
+
const n = [];
|
|
1829
|
+
for (let o = e.length - 1; o >= 0; o--) {
|
|
1830
|
+
const r = e[o];
|
|
1831
|
+
for (; n.length >= 2; ) {
|
|
1832
|
+
const i = n[n.length - 1], s = n[n.length - 2];
|
|
1833
|
+
if ((i.x - s.x) * (r.y - s.y) >= (i.y - s.y) * (r.x - s.x)) n.pop();
|
|
1834
|
+
else break;
|
|
1835
|
+
}
|
|
1836
|
+
n.push(r);
|
|
1837
|
+
}
|
|
1838
|
+
return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
|
|
1839
|
+
}
|
|
1840
|
+
var Vo = Ot, zo = Et, jo = St, Yo = Lt;
|
|
1841
|
+
const sr = ({ getValue: e, value: t }) => {
|
|
1842
|
+
const n = zt(null), [o, r] = jt(!1), i = t ?? e().toLocaleLowerCase(), s = Yt(() => {
|
|
1843
|
+
const l = n.current;
|
|
1844
|
+
l && r(l.scrollWidth > l.clientWidth);
|
|
1845
|
+
}, []);
|
|
1846
|
+
return ze(() => {
|
|
1847
|
+
const l = new AbortController(), c = tn(s, 300);
|
|
1848
|
+
return window.addEventListener("resize", c, {
|
|
1849
|
+
signal: l.signal
|
|
1850
|
+
}), () => {
|
|
1851
|
+
l.abort(), c.cancel();
|
|
1852
|
+
};
|
|
1853
|
+
}, [s]), ze(() => {
|
|
1854
|
+
s();
|
|
1855
|
+
}, [s]), o ? /* @__PURE__ */ P(Vo, { delayDuration: 0, children: /* @__PURE__ */ nt(zo, { children: [
|
|
1856
|
+
/* @__PURE__ */ P(jo, { asChild: !0, children: /* @__PURE__ */ P("p", { ref: n, className: "w-full truncate cursor-pointer", children: i }) }),
|
|
1857
|
+
/* @__PURE__ */ P(
|
|
1858
|
+
Yo,
|
|
1859
|
+
{
|
|
1860
|
+
side: "bottom",
|
|
1861
|
+
align: "center",
|
|
1862
|
+
className: "animate-in fade-in-0 relative mt-1.5 overflow-visible bg-kubefirst-dark-blue-900 text-white px-3 py-2 after:content-[''] after:absolute after:left-1/2 after:-translate-x-1/2 after:top-0 after:-translate-y-full after:border-l-8 after:border-l-transparent after:border-r-8 after:border-r-transparent after:border-b-8 after:border-kubefirst-dark-blue-900",
|
|
1863
|
+
children: i
|
|
1864
|
+
}
|
|
1865
|
+
)
|
|
1866
|
+
] }) }) : /* @__PURE__ */ P("p", { ref: n, className: "w-full truncate", children: i });
|
|
1867
|
+
};
|
|
1868
|
+
export {
|
|
1869
|
+
sr as TruncateText
|
|
1870
|
+
};
|