@pittorica/popover-react 0.23.2 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Popover.d.ts +13 -12
- package/dist/Popover.d.ts.map +1 -1
- package/dist/index.js +601 -608
- package/package.json +8 -9
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as Zt, jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { useLayoutEffect as
|
|
1
|
+
import { jsxs as Zt, jsx as U } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { useLayoutEffect as mt, createContext as Jt, useState as Qt, useMemo as en, use as tn } from "react";
|
|
4
4
|
import * as ht from "react-dom";
|
|
5
5
|
function vt(e) {
|
|
6
6
|
var t, n, o = "";
|
|
@@ -21,34 +21,34 @@ function we() {
|
|
|
21
21
|
function re(e) {
|
|
22
22
|
return _e(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function B(e) {
|
|
25
25
|
var t;
|
|
26
26
|
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function K(e) {
|
|
29
29
|
var t;
|
|
30
30
|
return (t = (_e(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
31
31
|
}
|
|
32
32
|
function _e(e) {
|
|
33
|
-
return we() ? e instanceof Node || e instanceof
|
|
33
|
+
return we() ? e instanceof Node || e instanceof B(e).Node : !1;
|
|
34
34
|
}
|
|
35
35
|
function D(e) {
|
|
36
|
-
return we() ? e instanceof Element || e instanceof
|
|
36
|
+
return we() ? e instanceof Element || e instanceof B(e).Element : !1;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return we() ? e instanceof HTMLElement || e instanceof
|
|
38
|
+
function F(e) {
|
|
39
|
+
return we() ? e instanceof HTMLElement || e instanceof B(e).HTMLElement : !1;
|
|
40
40
|
}
|
|
41
41
|
function Me(e) {
|
|
42
|
-
return !we() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof
|
|
42
|
+
return !we() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof B(e).ShadowRoot;
|
|
43
43
|
}
|
|
44
44
|
const on = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
45
|
-
function
|
|
45
|
+
function le(e) {
|
|
46
46
|
const {
|
|
47
47
|
overflow: t,
|
|
48
48
|
overflowX: n,
|
|
49
49
|
overflowY: o,
|
|
50
50
|
display: r
|
|
51
|
-
} =
|
|
51
|
+
} = V(e);
|
|
52
52
|
return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !on.has(r);
|
|
53
53
|
}
|
|
54
54
|
const rn = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
@@ -65,19 +65,19 @@ function xe(e) {
|
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
const
|
|
68
|
+
const an = ["transform", "translate", "scale", "rotate", "perspective"], ln = ["transform", "translate", "scale", "rotate", "perspective", "filter"], un = ["paint", "layout", "strict", "content"];
|
|
69
69
|
function Ve(e) {
|
|
70
|
-
const t = Re(), n = D(e) ?
|
|
71
|
-
return
|
|
70
|
+
const t = Re(), n = D(e) ? V(e) : e;
|
|
71
|
+
return an.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) || ln.some((o) => (n.willChange || "").includes(o)) || un.some((o) => (n.contain || "").includes(o));
|
|
72
72
|
}
|
|
73
73
|
function fn(e) {
|
|
74
|
-
let t =
|
|
75
|
-
for (;
|
|
74
|
+
let t = q(e);
|
|
75
|
+
for (; F(t) && !Y(t); ) {
|
|
76
76
|
if (Ve(t))
|
|
77
77
|
return t;
|
|
78
78
|
if (xe(t))
|
|
79
79
|
return null;
|
|
80
|
-
t =
|
|
80
|
+
t = q(t);
|
|
81
81
|
}
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
@@ -88,8 +88,8 @@ const dn = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
|
88
88
|
function Y(e) {
|
|
89
89
|
return dn.has(re(e));
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
return
|
|
91
|
+
function V(e) {
|
|
92
|
+
return B(e).getComputedStyle(e);
|
|
93
93
|
}
|
|
94
94
|
function Ee(e) {
|
|
95
95
|
return D(e) ? {
|
|
@@ -100,7 +100,7 @@ function Ee(e) {
|
|
|
100
100
|
scrollTop: e.scrollY
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function q(e) {
|
|
104
104
|
if (re(e) === "html")
|
|
105
105
|
return e;
|
|
106
106
|
const t = (
|
|
@@ -108,28 +108,28 @@ function X(e) {
|
|
|
108
108
|
e.assignedSlot || // DOM Element detected.
|
|
109
109
|
e.parentNode || // ShadowRoot detected.
|
|
110
110
|
Me(e) && e.host || // Fallback.
|
|
111
|
-
|
|
111
|
+
K(e)
|
|
112
112
|
);
|
|
113
113
|
return Me(t) ? t.host : t;
|
|
114
114
|
}
|
|
115
115
|
function bt(e) {
|
|
116
|
-
const t =
|
|
117
|
-
return Y(t) ? e.ownerDocument ? e.ownerDocument.body : e.body :
|
|
116
|
+
const t = q(e);
|
|
117
|
+
return Y(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : F(t) && le(t) ? t : bt(t);
|
|
118
118
|
}
|
|
119
119
|
function Z(e, t, n) {
|
|
120
120
|
var o;
|
|
121
121
|
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
122
|
-
const r = bt(e), i = r === ((o = e.ownerDocument) == null ? void 0 : o.body), s =
|
|
122
|
+
const r = bt(e), i = r === ((o = e.ownerDocument) == null ? void 0 : o.body), s = B(r);
|
|
123
123
|
if (i) {
|
|
124
|
-
const c =
|
|
125
|
-
return t.concat(s, s.visualViewport || [],
|
|
124
|
+
const c = Le(s);
|
|
125
|
+
return t.concat(s, s.visualViewport || [], le(r) ? r : [], c && n ? Z(c) : []);
|
|
126
126
|
}
|
|
127
127
|
return t.concat(r, Z(r, [], n));
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function Le(e) {
|
|
130
130
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
131
131
|
}
|
|
132
|
-
const pe = Math.min, J = Math.max,
|
|
132
|
+
const pe = Math.min, J = Math.max, ge = Math.round, ue = Math.floor, H = (e) => ({
|
|
133
133
|
x: e,
|
|
134
134
|
y: e
|
|
135
135
|
}), pn = {
|
|
@@ -137,11 +137,11 @@ const pe = Math.min, J = Math.max, me = Math.round, ue = Math.floor, K = (e) =>
|
|
|
137
137
|
right: "left",
|
|
138
138
|
bottom: "top",
|
|
139
139
|
top: "bottom"
|
|
140
|
-
},
|
|
140
|
+
}, gn = {
|
|
141
141
|
start: "end",
|
|
142
142
|
end: "start"
|
|
143
143
|
};
|
|
144
|
-
function
|
|
144
|
+
function qe(e, t, n) {
|
|
145
145
|
return J(e, pe(t, n));
|
|
146
146
|
}
|
|
147
147
|
function Se(e, t) {
|
|
@@ -159,9 +159,9 @@ function yt(e) {
|
|
|
159
159
|
function wt(e) {
|
|
160
160
|
return e === "y" ? "height" : "width";
|
|
161
161
|
}
|
|
162
|
-
const
|
|
162
|
+
const mn = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
163
163
|
function G(e) {
|
|
164
|
-
return
|
|
164
|
+
return mn.has(ee(e)) ? "y" : "x";
|
|
165
165
|
}
|
|
166
166
|
function xt(e) {
|
|
167
167
|
return yt(G(e));
|
|
@@ -170,14 +170,14 @@ function hn(e, t, n) {
|
|
|
170
170
|
n === void 0 && (n = !1);
|
|
171
171
|
const o = Ce(e), r = xt(e), i = wt(r);
|
|
172
172
|
let s = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
173
|
-
return t.reference[i] > t.floating[i] && (s =
|
|
173
|
+
return t.reference[i] > t.floating[i] && (s = me(s)), [s, me(s)];
|
|
174
174
|
}
|
|
175
175
|
function vn(e) {
|
|
176
|
-
const t =
|
|
177
|
-
return [
|
|
176
|
+
const t = me(e);
|
|
177
|
+
return [ke(e), t, ke(t)];
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
return e.replace(/start|end/g, (t) =>
|
|
179
|
+
function ke(e) {
|
|
180
|
+
return e.replace(/start|end/g, (t) => gn[t]);
|
|
181
181
|
}
|
|
182
182
|
const Xe = ["left", "right"], ze = ["right", "left"], bn = ["top", "bottom"], yn = ["bottom", "top"];
|
|
183
183
|
function wn(e, t, n) {
|
|
@@ -195,9 +195,9 @@ function wn(e, t, n) {
|
|
|
195
195
|
function xn(e, t, n, o) {
|
|
196
196
|
const r = Ce(e);
|
|
197
197
|
let i = wn(ee(e), n === "start", o);
|
|
198
|
-
return r && (i = i.map((s) => s + "-" + r), t && (i = i.concat(i.map(
|
|
198
|
+
return r && (i = i.map((s) => s + "-" + r), t && (i = i.concat(i.map(ke)))), i;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function me(e) {
|
|
201
201
|
return e.replace(/left|right|bottom|top/g, (t) => pn[t]);
|
|
202
202
|
}
|
|
203
203
|
function Rn(e) {
|
|
@@ -239,7 +239,7 @@ function he(e) {
|
|
|
239
239
|
* tabbable 6.4.0
|
|
240
240
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
241
241
|
*/
|
|
242
|
-
var Sn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"],
|
|
242
|
+
var Sn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"], Ne = /* @__PURE__ */ Sn.join(","), Rt = typeof Element > "u", ce = Rt ? function() {
|
|
243
243
|
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, ve = !Rt && Element.prototype.getRootNode ? function(e) {
|
|
244
244
|
var t;
|
|
245
245
|
return e == null || (t = e.getRootNode) === null || t === void 0 ? void 0 : t.call(e);
|
|
@@ -258,25 +258,25 @@ var Sn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
258
258
|
}, Tn = function(t, n, o) {
|
|
259
259
|
if (be(t))
|
|
260
260
|
return [];
|
|
261
|
-
var r = Array.prototype.slice.apply(t.querySelectorAll(
|
|
262
|
-
return n && ce.call(t,
|
|
263
|
-
},
|
|
261
|
+
var r = Array.prototype.slice.apply(t.querySelectorAll(Ne));
|
|
262
|
+
return n && ce.call(t, Ne) && r.unshift(t), r = r.filter(o), r;
|
|
263
|
+
}, Fe = function(t, n, o) {
|
|
264
264
|
for (var r = [], i = Array.from(t); i.length; ) {
|
|
265
265
|
var s = i.shift();
|
|
266
266
|
if (!be(s, !1))
|
|
267
267
|
if (s.tagName === "SLOT") {
|
|
268
|
-
var c = s.assignedElements(),
|
|
269
|
-
o.flatten ? r.push.apply(r,
|
|
268
|
+
var c = s.assignedElements(), a = c.length ? c : s.children, l = Fe(a, !0, o);
|
|
269
|
+
o.flatten ? r.push.apply(r, l) : r.push({
|
|
270
270
|
scopeParent: s,
|
|
271
|
-
candidates:
|
|
271
|
+
candidates: l
|
|
272
272
|
});
|
|
273
273
|
} else {
|
|
274
|
-
var u = ce.call(s,
|
|
274
|
+
var u = ce.call(s, Ne);
|
|
275
275
|
u && o.filter(s) && (n || !t.includes(s)) && r.push(s);
|
|
276
276
|
var f = s.shadowRoot || // check for an undisclosed shadow
|
|
277
|
-
typeof o.getShadowRoot == "function" && o.getShadowRoot(s),
|
|
278
|
-
if (f &&
|
|
279
|
-
var d =
|
|
277
|
+
typeof o.getShadowRoot == "function" && o.getShadowRoot(s), g = !be(f, !1) && (!o.shadowRootFilter || o.shadowRootFilter(s));
|
|
278
|
+
if (f && g) {
|
|
279
|
+
var d = Fe(f === !0 ? s.children : f.children, !0, o);
|
|
280
280
|
o.flatten ? r.push.apply(r, d) : r.push({
|
|
281
281
|
scopeParent: s,
|
|
282
282
|
candidates: d
|
|
@@ -326,24 +326,24 @@ var Sn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
326
326
|
}
|
|
327
327
|
var i = Dn(r, t.form);
|
|
328
328
|
return !i || i === t;
|
|
329
|
-
}, kn = function(t) {
|
|
330
|
-
return Ct(t) && t.type === "radio";
|
|
331
|
-
}, Fn = function(t) {
|
|
332
|
-
return kn(t) && !Mn(t);
|
|
333
329
|
}, Ln = function(t) {
|
|
330
|
+
return Ct(t) && t.type === "radio";
|
|
331
|
+
}, kn = function(t) {
|
|
332
|
+
return Ln(t) && !Mn(t);
|
|
333
|
+
}, Nn = function(t) {
|
|
334
334
|
var n, o = t && ve(t), r = (n = o) === null || n === void 0 ? void 0 : n.host, i = !1;
|
|
335
335
|
if (o && o !== t) {
|
|
336
|
-
var s, c,
|
|
337
|
-
for (i = !!((s = r) !== null && s !== void 0 && (c = s.ownerDocument) !== null && c !== void 0 && c.contains(r) || t != null && (
|
|
338
|
-
var
|
|
339
|
-
o = ve(r), r = (
|
|
336
|
+
var s, c, a;
|
|
337
|
+
for (i = !!((s = r) !== null && s !== void 0 && (c = s.ownerDocument) !== null && c !== void 0 && c.contains(r) || t != null && (a = t.ownerDocument) !== null && a !== void 0 && a.contains(t)); !i && r; ) {
|
|
338
|
+
var l, u, f;
|
|
339
|
+
o = ve(r), r = (l = o) === null || l === void 0 ? void 0 : l.host, i = !!((u = r) !== null && u !== void 0 && (f = u.ownerDocument) !== null && f !== void 0 && f.contains(r));
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
return i;
|
|
343
343
|
}, Ge = function(t) {
|
|
344
344
|
var n = t.getBoundingClientRect(), o = n.width, r = n.height;
|
|
345
345
|
return o === 0 && r === 0;
|
|
346
|
-
},
|
|
346
|
+
}, Fn = function(t, n) {
|
|
347
347
|
var o = n.displayCheck, r = n.getShadowRoot;
|
|
348
348
|
if (o === "full-native" && "checkVisibility" in t) {
|
|
349
349
|
var i = t.checkVisibility({
|
|
@@ -370,22 +370,22 @@ var Sn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
370
370
|
// Element#checkVisibility is unsupported
|
|
371
371
|
o === "full-native" || o === "legacy-full") {
|
|
372
372
|
if (typeof r == "function") {
|
|
373
|
-
for (var
|
|
374
|
-
var
|
|
375
|
-
if (
|
|
373
|
+
for (var a = t; t; ) {
|
|
374
|
+
var l = t.parentElement, u = ve(t);
|
|
375
|
+
if (l && !l.shadowRoot && r(l) === !0)
|
|
376
376
|
return Ge(t);
|
|
377
|
-
t.assignedSlot ? t = t.assignedSlot : !
|
|
377
|
+
t.assignedSlot ? t = t.assignedSlot : !l && u !== t.ownerDocument ? t = u.host : t = l;
|
|
378
378
|
}
|
|
379
|
-
t =
|
|
379
|
+
t = a;
|
|
380
380
|
}
|
|
381
|
-
if (
|
|
381
|
+
if (Nn(t))
|
|
382
382
|
return !t.getClientRects().length;
|
|
383
383
|
if (o !== "legacy-full")
|
|
384
384
|
return !0;
|
|
385
385
|
} else if (o === "non-zero-area")
|
|
386
386
|
return Ge(t);
|
|
387
387
|
return !1;
|
|
388
|
-
},
|
|
388
|
+
}, $n = function(t) {
|
|
389
389
|
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))
|
|
390
390
|
for (var n = t.parentElement; n; ) {
|
|
391
391
|
if (n.tagName === "FIELDSET" && n.disabled) {
|
|
@@ -399,24 +399,24 @@ var Sn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
399
399
|
n = n.parentElement;
|
|
400
400
|
}
|
|
401
401
|
return !1;
|
|
402
|
-
},
|
|
403
|
-
return !(n.disabled || Pn(n) ||
|
|
404
|
-
In(n) ||
|
|
402
|
+
}, Bn = function(t, n) {
|
|
403
|
+
return !(n.disabled || Pn(n) || Fn(n, t) || // For a details element with a summary, the summary element gets the focus
|
|
404
|
+
In(n) || $n(n));
|
|
405
405
|
}, Ze = function(t, n) {
|
|
406
|
-
return !(
|
|
406
|
+
return !(kn(n) || St(n) < 0 || !Bn(t, n));
|
|
407
407
|
}, _n = function(t) {
|
|
408
408
|
var n = parseInt(t.getAttribute("tabindex"), 10);
|
|
409
409
|
return !!(isNaN(n) || n >= 0);
|
|
410
410
|
}, Tt = function(t) {
|
|
411
411
|
var n = [], o = [];
|
|
412
412
|
return t.forEach(function(r, i) {
|
|
413
|
-
var s = !!r.scopeParent, c = s ? r.scopeParent : r,
|
|
414
|
-
|
|
413
|
+
var s = !!r.scopeParent, c = s ? r.scopeParent : r, a = An(c, s), l = s ? Tt(r.candidates) : c;
|
|
414
|
+
a === 0 ? s ? n.push.apply(n, l) : n.push(c) : o.push({
|
|
415
415
|
documentOrder: i,
|
|
416
|
-
tabIndex:
|
|
416
|
+
tabIndex: a,
|
|
417
417
|
item: r,
|
|
418
418
|
isScope: s,
|
|
419
|
-
content:
|
|
419
|
+
content: l
|
|
420
420
|
});
|
|
421
421
|
}), o.sort(On).reduce(function(r, i) {
|
|
422
422
|
return i.isScope ? r.push.apply(r, i.content) : r.push(i.content), r;
|
|
@@ -424,7 +424,7 @@ var Sn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
424
424
|
}, At = function(t, n) {
|
|
425
425
|
n = n || {};
|
|
426
426
|
var o;
|
|
427
|
-
return n.getShadowRoot ? o =
|
|
427
|
+
return n.getShadowRoot ? o = Fe([t], n.includeContainer, {
|
|
428
428
|
filter: Ze.bind(null, n),
|
|
429
429
|
flatten: !1,
|
|
430
430
|
getShadowRoot: n.getShadowRoot,
|
|
@@ -443,7 +443,7 @@ function Hn(e) {
|
|
|
443
443
|
}
|
|
444
444
|
return t;
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function $e(e, t) {
|
|
447
447
|
if (!e || !t)
|
|
448
448
|
return !1;
|
|
449
449
|
const n = t.getRootNode == null ? void 0 : t.getRootNode();
|
|
@@ -473,13 +473,13 @@ function Ae(e, t) {
|
|
|
473
473
|
function Kn(e) {
|
|
474
474
|
return e.matches("html,body");
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function ae(e) {
|
|
477
477
|
return (e == null ? void 0 : e.ownerDocument) || document;
|
|
478
478
|
}
|
|
479
|
-
function Un(e) {
|
|
480
|
-
return N(e) && e.matches(Wn);
|
|
481
|
-
}
|
|
482
479
|
function jn(e) {
|
|
480
|
+
return F(e) && e.matches(Wn);
|
|
481
|
+
}
|
|
482
|
+
function Un(e) {
|
|
483
483
|
return e ? e.hasAttribute(Je) ? e : e.querySelector("[" + Je + "]") || e : null;
|
|
484
484
|
}
|
|
485
485
|
function fe(e, t, n) {
|
|
@@ -488,25 +488,25 @@ function fe(e, t, n) {
|
|
|
488
488
|
return r.parentId === t && (!n || ((i = r.context) == null ? void 0 : i.open));
|
|
489
489
|
}).flatMap((r) => [r, ...fe(e, r.id, n)]);
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function Yn(e) {
|
|
492
492
|
return "nativeEvent" in e;
|
|
493
493
|
}
|
|
494
494
|
function Qe(e, t) {
|
|
495
495
|
return ["mouse", "pen"].includes(e);
|
|
496
496
|
}
|
|
497
|
-
var
|
|
498
|
-
}, Q =
|
|
497
|
+
var qn = typeof document < "u", Xn = function() {
|
|
498
|
+
}, Q = qn ? mt : Xn;
|
|
499
499
|
const zn = {
|
|
500
|
-
...
|
|
500
|
+
...m
|
|
501
501
|
}, Gn = zn.useInsertionEffect, Zn = Gn || ((e) => e());
|
|
502
502
|
function ne(e) {
|
|
503
|
-
const t =
|
|
503
|
+
const t = m.useRef(() => {
|
|
504
504
|
if (process.env.NODE_ENV !== "production")
|
|
505
505
|
throw new Error("Cannot call an event handler while rendering.");
|
|
506
506
|
});
|
|
507
507
|
return Zn(() => {
|
|
508
508
|
t.current = e;
|
|
509
|
-
}),
|
|
509
|
+
}), m.useCallback(function() {
|
|
510
510
|
for (var n = arguments.length, o = new Array(n), r = 0; r < n; r++)
|
|
511
511
|
o[r] = arguments[r];
|
|
512
512
|
return t.current == null ? void 0 : t.current(...o);
|
|
@@ -524,18 +524,18 @@ const Ot = () => ({
|
|
|
524
524
|
function Pt(e, t) {
|
|
525
525
|
const n = At(e, Ot()), o = n.length;
|
|
526
526
|
if (o === 0) return;
|
|
527
|
-
const r = Hn(
|
|
527
|
+
const r = Hn(ae(e)), i = n.indexOf(r), s = i === -1 ? t === 1 ? 0 : o - 1 : i + t;
|
|
528
528
|
return n[s];
|
|
529
529
|
}
|
|
530
530
|
function Jn(e) {
|
|
531
|
-
return Pt(
|
|
531
|
+
return Pt(ae(e).body, 1) || e;
|
|
532
532
|
}
|
|
533
533
|
function Qn(e) {
|
|
534
|
-
return Pt(
|
|
534
|
+
return Pt(ae(e).body, -1) || e;
|
|
535
535
|
}
|
|
536
536
|
function Oe(e, t) {
|
|
537
537
|
const n = t || e.currentTarget, o = e.relatedTarget;
|
|
538
|
-
return !o ||
|
|
538
|
+
return !o || !$e(n, o);
|
|
539
539
|
}
|
|
540
540
|
function eo(e) {
|
|
541
541
|
At(e, Ot()).forEach((n) => {
|
|
@@ -553,9 +553,9 @@ function tt(e, t, n) {
|
|
|
553
553
|
reference: o,
|
|
554
554
|
floating: r
|
|
555
555
|
} = e;
|
|
556
|
-
const i = G(t), s = xt(t), c = wt(s),
|
|
556
|
+
const i = G(t), s = xt(t), c = wt(s), a = ee(t), l = i === "y", u = o.x + o.width / 2 - r.width / 2, f = o.y + o.height / 2 - r.height / 2, g = o[c] / 2 - r[c] / 2;
|
|
557
557
|
let d;
|
|
558
|
-
switch (
|
|
558
|
+
switch (a) {
|
|
559
559
|
case "top":
|
|
560
560
|
d = {
|
|
561
561
|
x: u,
|
|
@@ -588,10 +588,10 @@ function tt(e, t, n) {
|
|
|
588
588
|
}
|
|
589
589
|
switch (Ce(t)) {
|
|
590
590
|
case "start":
|
|
591
|
-
d[s] -=
|
|
591
|
+
d[s] -= g * (n && l ? -1 : 1);
|
|
592
592
|
break;
|
|
593
593
|
case "end":
|
|
594
|
-
d[s] +=
|
|
594
|
+
d[s] += g * (n && l ? -1 : 1);
|
|
595
595
|
break;
|
|
596
596
|
}
|
|
597
597
|
return d;
|
|
@@ -605,18 +605,18 @@ async function to(e, t) {
|
|
|
605
605
|
platform: i,
|
|
606
606
|
rects: s,
|
|
607
607
|
elements: c,
|
|
608
|
-
strategy:
|
|
608
|
+
strategy: a
|
|
609
609
|
} = e, {
|
|
610
|
-
boundary:
|
|
610
|
+
boundary: l = "clippingAncestors",
|
|
611
611
|
rootBoundary: u = "viewport",
|
|
612
612
|
elementContext: f = "floating",
|
|
613
|
-
altBoundary:
|
|
613
|
+
altBoundary: g = !1,
|
|
614
614
|
padding: d = 0
|
|
615
|
-
} = Se(t, e), h = En(d),
|
|
616
|
-
element: (n = await (i.isElement == null ? void 0 : i.isElement(
|
|
617
|
-
boundary:
|
|
615
|
+
} = Se(t, e), h = En(d), v = c[g ? f === "floating" ? "reference" : "floating" : f], y = he(await i.getClippingRect({
|
|
616
|
+
element: (n = await (i.isElement == null ? void 0 : i.isElement(v))) == null || n ? v : v.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
|
|
617
|
+
boundary: l,
|
|
618
618
|
rootBoundary: u,
|
|
619
|
-
strategy:
|
|
619
|
+
strategy: a
|
|
620
620
|
})), w = f === "floating" ? {
|
|
621
621
|
x: o,
|
|
622
622
|
y: r,
|
|
@@ -628,17 +628,17 @@ async function to(e, t) {
|
|
|
628
628
|
} : {
|
|
629
629
|
x: 1,
|
|
630
630
|
y: 1
|
|
631
|
-
},
|
|
631
|
+
}, C = he(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
632
632
|
elements: c,
|
|
633
633
|
rect: w,
|
|
634
634
|
offsetParent: x,
|
|
635
|
-
strategy:
|
|
635
|
+
strategy: a
|
|
636
636
|
}) : w);
|
|
637
637
|
return {
|
|
638
|
-
top: (y.top -
|
|
639
|
-
bottom: (
|
|
640
|
-
left: (y.left -
|
|
641
|
-
right: (
|
|
638
|
+
top: (y.top - C.top + h.top) / E.y,
|
|
639
|
+
bottom: (C.bottom - y.bottom + h.bottom) / E.y,
|
|
640
|
+
left: (y.left - C.left + h.left) / E.x,
|
|
641
|
+
right: (C.right - y.right + h.right) / E.x
|
|
642
642
|
};
|
|
643
643
|
}
|
|
644
644
|
const no = async (e, t, n) => {
|
|
@@ -647,33 +647,33 @@ const no = async (e, t, n) => {
|
|
|
647
647
|
strategy: r = "absolute",
|
|
648
648
|
middleware: i = [],
|
|
649
649
|
platform: s
|
|
650
|
-
} = n, c = i.filter(Boolean),
|
|
651
|
-
let
|
|
650
|
+
} = n, c = i.filter(Boolean), a = await (s.isRTL == null ? void 0 : s.isRTL(t));
|
|
651
|
+
let l = await s.getElementRects({
|
|
652
652
|
reference: e,
|
|
653
653
|
floating: t,
|
|
654
654
|
strategy: r
|
|
655
655
|
}), {
|
|
656
656
|
x: u,
|
|
657
657
|
y: f
|
|
658
|
-
} = tt(
|
|
659
|
-
for (let
|
|
658
|
+
} = tt(l, o, a), g = o, d = {}, h = 0;
|
|
659
|
+
for (let v = 0; v < c.length; v++) {
|
|
660
660
|
var p;
|
|
661
661
|
const {
|
|
662
662
|
name: y,
|
|
663
663
|
fn: w
|
|
664
|
-
} = c[
|
|
664
|
+
} = c[v], {
|
|
665
665
|
x,
|
|
666
666
|
y: E,
|
|
667
|
-
data:
|
|
668
|
-
reset:
|
|
667
|
+
data: C,
|
|
668
|
+
reset: T
|
|
669
669
|
} = await w({
|
|
670
670
|
x: u,
|
|
671
671
|
y: f,
|
|
672
672
|
initialPlacement: o,
|
|
673
|
-
placement:
|
|
673
|
+
placement: g,
|
|
674
674
|
strategy: r,
|
|
675
675
|
middlewareData: d,
|
|
676
|
-
rects:
|
|
676
|
+
rects: l,
|
|
677
677
|
platform: {
|
|
678
678
|
...s,
|
|
679
679
|
detectOverflow: (p = s.detectOverflow) != null ? p : to
|
|
@@ -687,21 +687,21 @@ const no = async (e, t, n) => {
|
|
|
687
687
|
...d,
|
|
688
688
|
[y]: {
|
|
689
689
|
...d[y],
|
|
690
|
-
...
|
|
690
|
+
...C
|
|
691
691
|
}
|
|
692
|
-
},
|
|
692
|
+
}, T && h <= 50 && (h++, typeof T == "object" && (T.placement && (g = T.placement), T.rects && (l = T.rects === !0 ? await s.getElementRects({
|
|
693
693
|
reference: e,
|
|
694
694
|
floating: t,
|
|
695
695
|
strategy: r
|
|
696
|
-
}) :
|
|
696
|
+
}) : T.rects), {
|
|
697
697
|
x: u,
|
|
698
698
|
y: f
|
|
699
|
-
} = tt(
|
|
699
|
+
} = tt(l, g, a)), v = -1);
|
|
700
700
|
}
|
|
701
701
|
return {
|
|
702
702
|
x: u,
|
|
703
703
|
y: f,
|
|
704
|
-
placement:
|
|
704
|
+
placement: g,
|
|
705
705
|
strategy: r,
|
|
706
706
|
middlewareData: d
|
|
707
707
|
};
|
|
@@ -716,59 +716,59 @@ const no = async (e, t, n) => {
|
|
|
716
716
|
middlewareData: i,
|
|
717
717
|
rects: s,
|
|
718
718
|
initialPlacement: c,
|
|
719
|
-
platform:
|
|
720
|
-
elements:
|
|
719
|
+
platform: a,
|
|
720
|
+
elements: l
|
|
721
721
|
} = t, {
|
|
722
722
|
mainAxis: u = !0,
|
|
723
723
|
crossAxis: f = !0,
|
|
724
|
-
fallbackPlacements:
|
|
724
|
+
fallbackPlacements: g,
|
|
725
725
|
fallbackStrategy: d = "bestFit",
|
|
726
726
|
fallbackAxisSideDirection: h = "none",
|
|
727
727
|
flipAlignment: p = !0,
|
|
728
|
-
...
|
|
728
|
+
...v
|
|
729
729
|
} = Se(e, t);
|
|
730
730
|
if ((n = i.arrow) != null && n.alignmentOffset)
|
|
731
731
|
return {};
|
|
732
|
-
const y = ee(r), w = G(c), x = ee(c) === c, E = await (
|
|
733
|
-
!
|
|
734
|
-
const
|
|
735
|
-
let
|
|
736
|
-
if (u &&
|
|
732
|
+
const y = ee(r), w = G(c), x = ee(c) === c, E = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), C = g || (x || !p ? [me(c)] : vn(c)), T = h !== "none";
|
|
733
|
+
!g && T && C.push(...xn(c, p, h, E));
|
|
734
|
+
const L = [c, ...C], k = await a.detectOverflow(t, v), S = [];
|
|
735
|
+
let N = ((o = i.flip) == null ? void 0 : o.overflows) || [];
|
|
736
|
+
if (u && S.push(k[y]), f) {
|
|
737
737
|
const R = hn(r, s, E);
|
|
738
|
-
|
|
738
|
+
S.push(k[R[0]], k[R[1]]);
|
|
739
739
|
}
|
|
740
|
-
if (
|
|
740
|
+
if (N = [...N, {
|
|
741
741
|
placement: r,
|
|
742
|
-
overflows:
|
|
743
|
-
}], !
|
|
744
|
-
var
|
|
745
|
-
const R = (((
|
|
742
|
+
overflows: S
|
|
743
|
+
}], !S.every((R) => R <= 0)) {
|
|
744
|
+
var W, X;
|
|
745
|
+
const R = (((W = i.flip) == null ? void 0 : W.index) || 0) + 1, M = L[R];
|
|
746
746
|
if (M && (!(f === "alignment" ? w !== G(M) : !1) || // We leave the current main axis only if every placement on that axis
|
|
747
747
|
// overflows the main axis.
|
|
748
|
-
|
|
748
|
+
N.every((b) => G(b.placement) === w ? b.overflows[0] > 0 : !0)))
|
|
749
749
|
return {
|
|
750
750
|
data: {
|
|
751
751
|
index: R,
|
|
752
|
-
overflows:
|
|
752
|
+
overflows: N
|
|
753
753
|
},
|
|
754
754
|
reset: {
|
|
755
755
|
placement: M
|
|
756
756
|
}
|
|
757
757
|
};
|
|
758
|
-
let O = (
|
|
758
|
+
let O = (X = N.filter((P) => P.overflows[0] <= 0).sort((P, b) => P.overflows[1] - b.overflows[1])[0]) == null ? void 0 : X.placement;
|
|
759
759
|
if (!O)
|
|
760
760
|
switch (d) {
|
|
761
761
|
case "bestFit": {
|
|
762
|
-
var
|
|
763
|
-
const P = (
|
|
764
|
-
if (
|
|
765
|
-
const
|
|
766
|
-
return
|
|
762
|
+
var _;
|
|
763
|
+
const P = (_ = N.filter((b) => {
|
|
764
|
+
if (T) {
|
|
765
|
+
const A = G(b.placement);
|
|
766
|
+
return A === w || // Create a bias to the `y` side axis due to horizontal
|
|
767
767
|
// reading directions favoring greater width.
|
|
768
|
-
|
|
768
|
+
A === "y";
|
|
769
769
|
}
|
|
770
770
|
return !0;
|
|
771
|
-
}).map((
|
|
771
|
+
}).map((b) => [b.placement, b.overflows.filter((A) => A > 0).reduce((A, I) => A + I, 0)]).sort((b, A) => b[1] - A[1])[0]) == null ? void 0 : _[0];
|
|
772
772
|
P && (O = P);
|
|
773
773
|
break;
|
|
774
774
|
}
|
|
@@ -792,9 +792,9 @@ async function io(e, t) {
|
|
|
792
792
|
placement: n,
|
|
793
793
|
platform: o,
|
|
794
794
|
elements: r
|
|
795
|
-
} = e, i = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), s = ee(n), c = Ce(n),
|
|
795
|
+
} = e, i = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), s = ee(n), c = Ce(n), a = G(n) === "y", l = ro.has(s) ? -1 : 1, u = i && a ? -1 : 1, f = Se(t, e);
|
|
796
796
|
let {
|
|
797
|
-
mainAxis:
|
|
797
|
+
mainAxis: g,
|
|
798
798
|
crossAxis: d,
|
|
799
799
|
alignmentAxis: h
|
|
800
800
|
} = typeof f == "number" ? {
|
|
@@ -806,11 +806,11 @@ async function io(e, t) {
|
|
|
806
806
|
crossAxis: f.crossAxis || 0,
|
|
807
807
|
alignmentAxis: f.alignmentAxis
|
|
808
808
|
};
|
|
809
|
-
return c && typeof h == "number" && (d = c === "end" ? h * -1 : h),
|
|
809
|
+
return c && typeof h == "number" && (d = c === "end" ? h * -1 : h), a ? {
|
|
810
810
|
x: d * u,
|
|
811
|
-
y:
|
|
811
|
+
y: g * l
|
|
812
812
|
} : {
|
|
813
|
-
x:
|
|
813
|
+
x: g * l,
|
|
814
814
|
y: d * u
|
|
815
815
|
};
|
|
816
816
|
}
|
|
@@ -825,12 +825,12 @@ const so = function(e) {
|
|
|
825
825
|
y: i,
|
|
826
826
|
placement: s,
|
|
827
827
|
middlewareData: c
|
|
828
|
-
} = t,
|
|
828
|
+
} = t, a = await io(t, e);
|
|
829
829
|
return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
|
|
830
|
-
x: r +
|
|
831
|
-
y: i +
|
|
830
|
+
x: r + a.x,
|
|
831
|
+
y: i + a.y,
|
|
832
832
|
data: {
|
|
833
|
-
...
|
|
833
|
+
...a,
|
|
834
834
|
placement: s
|
|
835
835
|
}
|
|
836
836
|
};
|
|
@@ -849,7 +849,7 @@ const so = function(e) {
|
|
|
849
849
|
} = t, {
|
|
850
850
|
mainAxis: s = !0,
|
|
851
851
|
crossAxis: c = !1,
|
|
852
|
-
limiter:
|
|
852
|
+
limiter: a = {
|
|
853
853
|
fn: (y) => {
|
|
854
854
|
let {
|
|
855
855
|
x: w,
|
|
@@ -861,33 +861,33 @@ const so = function(e) {
|
|
|
861
861
|
};
|
|
862
862
|
}
|
|
863
863
|
},
|
|
864
|
-
...
|
|
864
|
+
...l
|
|
865
865
|
} = Se(e, t), u = {
|
|
866
866
|
x: n,
|
|
867
867
|
y: o
|
|
868
|
-
}, f = await i.detectOverflow(t,
|
|
869
|
-
let h = u[d], p = u[
|
|
868
|
+
}, f = await i.detectOverflow(t, l), g = G(ee(r)), d = yt(g);
|
|
869
|
+
let h = u[d], p = u[g];
|
|
870
870
|
if (s) {
|
|
871
871
|
const y = d === "y" ? "top" : "left", w = d === "y" ? "bottom" : "right", x = h + f[y], E = h - f[w];
|
|
872
|
-
h =
|
|
872
|
+
h = qe(x, h, E);
|
|
873
873
|
}
|
|
874
874
|
if (c) {
|
|
875
|
-
const y =
|
|
876
|
-
p =
|
|
875
|
+
const y = g === "y" ? "top" : "left", w = g === "y" ? "bottom" : "right", x = p + f[y], E = p - f[w];
|
|
876
|
+
p = qe(x, p, E);
|
|
877
877
|
}
|
|
878
|
-
const
|
|
878
|
+
const v = a.fn({
|
|
879
879
|
...t,
|
|
880
880
|
[d]: h,
|
|
881
|
-
[
|
|
881
|
+
[g]: p
|
|
882
882
|
});
|
|
883
883
|
return {
|
|
884
|
-
...
|
|
884
|
+
...v,
|
|
885
885
|
data: {
|
|
886
|
-
x:
|
|
887
|
-
y:
|
|
886
|
+
x: v.x - n,
|
|
887
|
+
y: v.y - o,
|
|
888
888
|
enabled: {
|
|
889
889
|
[d]: s,
|
|
890
|
-
[
|
|
890
|
+
[g]: c
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
893
|
};
|
|
@@ -895,9 +895,9 @@ const so = function(e) {
|
|
|
895
895
|
};
|
|
896
896
|
};
|
|
897
897
|
function It(e) {
|
|
898
|
-
const t =
|
|
898
|
+
const t = V(e);
|
|
899
899
|
let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
|
|
900
|
-
const r =
|
|
900
|
+
const r = F(e), i = r ? e.offsetWidth : n, s = r ? e.offsetHeight : o, c = ge(n) !== i || ge(o) !== s;
|
|
901
901
|
return c && (n = i, o = s), {
|
|
902
902
|
width: n,
|
|
903
903
|
height: o,
|
|
@@ -909,55 +909,55 @@ function We(e) {
|
|
|
909
909
|
}
|
|
910
910
|
function oe(e) {
|
|
911
911
|
const t = We(e);
|
|
912
|
-
if (!
|
|
913
|
-
return
|
|
912
|
+
if (!F(t))
|
|
913
|
+
return H(1);
|
|
914
914
|
const n = t.getBoundingClientRect(), {
|
|
915
915
|
width: o,
|
|
916
916
|
height: r,
|
|
917
917
|
$: i
|
|
918
918
|
} = It(t);
|
|
919
|
-
let s = (i ?
|
|
919
|
+
let s = (i ? ge(n.width) : n.width) / o, c = (i ? ge(n.height) : n.height) / r;
|
|
920
920
|
return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
921
921
|
x: s,
|
|
922
922
|
y: c
|
|
923
923
|
};
|
|
924
924
|
}
|
|
925
|
-
const
|
|
925
|
+
const ao = /* @__PURE__ */ H(0);
|
|
926
926
|
function Dt(e) {
|
|
927
|
-
const t =
|
|
928
|
-
return !Re() || !t.visualViewport ?
|
|
927
|
+
const t = B(e);
|
|
928
|
+
return !Re() || !t.visualViewport ? ao : {
|
|
929
929
|
x: t.visualViewport.offsetLeft,
|
|
930
930
|
y: t.visualViewport.offsetTop
|
|
931
931
|
};
|
|
932
932
|
}
|
|
933
|
-
function
|
|
934
|
-
return t === void 0 && (t = !1), !n || t && n !==
|
|
933
|
+
function lo(e, t, n) {
|
|
934
|
+
return t === void 0 && (t = !1), !n || t && n !== B(e) ? !1 : t;
|
|
935
935
|
}
|
|
936
936
|
function te(e, t, n, o) {
|
|
937
937
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
938
938
|
const r = e.getBoundingClientRect(), i = We(e);
|
|
939
|
-
let s =
|
|
939
|
+
let s = H(1);
|
|
940
940
|
t && (o ? D(o) && (s = oe(o)) : s = oe(e));
|
|
941
|
-
const c =
|
|
942
|
-
let
|
|
941
|
+
const c = lo(i, n, o) ? Dt(i) : H(0);
|
|
942
|
+
let a = (r.left + c.x) / s.x, l = (r.top + c.y) / s.y, u = r.width / s.x, f = r.height / s.y;
|
|
943
943
|
if (i) {
|
|
944
|
-
const
|
|
945
|
-
let h =
|
|
944
|
+
const g = B(i), d = o && D(o) ? B(o) : o;
|
|
945
|
+
let h = g, p = Le(h);
|
|
946
946
|
for (; p && o && d !== h; ) {
|
|
947
|
-
const
|
|
948
|
-
|
|
947
|
+
const v = oe(p), y = p.getBoundingClientRect(), w = V(p), x = y.left + (p.clientLeft + parseFloat(w.paddingLeft)) * v.x, E = y.top + (p.clientTop + parseFloat(w.paddingTop)) * v.y;
|
|
948
|
+
a *= v.x, l *= v.y, u *= v.x, f *= v.y, a += x, l += E, h = B(p), p = Le(h);
|
|
949
949
|
}
|
|
950
950
|
}
|
|
951
951
|
return he({
|
|
952
952
|
width: u,
|
|
953
953
|
height: f,
|
|
954
|
-
x:
|
|
955
|
-
y:
|
|
954
|
+
x: a,
|
|
955
|
+
y: l
|
|
956
956
|
});
|
|
957
957
|
}
|
|
958
958
|
function Te(e, t) {
|
|
959
959
|
const n = Ee(e).scrollLeft;
|
|
960
|
-
return t ? t.left + n : te(
|
|
960
|
+
return t ? t.left + n : te(K(e)).left + n;
|
|
961
961
|
}
|
|
962
962
|
function Mt(e, t) {
|
|
963
963
|
const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft - Te(e, n), r = n.top + t.scrollTop;
|
|
@@ -973,34 +973,34 @@ function uo(e) {
|
|
|
973
973
|
offsetParent: o,
|
|
974
974
|
strategy: r
|
|
975
975
|
} = e;
|
|
976
|
-
const i = r === "fixed", s =
|
|
976
|
+
const i = r === "fixed", s = K(o), c = t ? xe(t.floating) : !1;
|
|
977
977
|
if (o === s || c && i)
|
|
978
978
|
return n;
|
|
979
|
-
let
|
|
979
|
+
let a = {
|
|
980
980
|
scrollLeft: 0,
|
|
981
981
|
scrollTop: 0
|
|
982
|
-
},
|
|
983
|
-
const u =
|
|
984
|
-
if ((f || !f && !i) && ((re(o) !== "body" ||
|
|
982
|
+
}, l = H(1);
|
|
983
|
+
const u = H(0), f = F(o);
|
|
984
|
+
if ((f || !f && !i) && ((re(o) !== "body" || le(s)) && (a = Ee(o)), F(o))) {
|
|
985
985
|
const d = te(o);
|
|
986
|
-
|
|
986
|
+
l = oe(o), u.x = d.x + o.clientLeft, u.y = d.y + o.clientTop;
|
|
987
987
|
}
|
|
988
|
-
const
|
|
988
|
+
const g = s && !f && !i ? Mt(s, a) : H(0);
|
|
989
989
|
return {
|
|
990
|
-
width: n.width *
|
|
991
|
-
height: n.height *
|
|
992
|
-
x: n.x *
|
|
993
|
-
y: n.y *
|
|
990
|
+
width: n.width * l.x,
|
|
991
|
+
height: n.height * l.y,
|
|
992
|
+
x: n.x * l.x - a.scrollLeft * l.x + u.x + g.x,
|
|
993
|
+
y: n.y * l.y - a.scrollTop * l.y + u.y + g.y
|
|
994
994
|
};
|
|
995
995
|
}
|
|
996
996
|
function fo(e) {
|
|
997
997
|
return Array.from(e.getClientRects());
|
|
998
998
|
}
|
|
999
999
|
function po(e) {
|
|
1000
|
-
const t =
|
|
1000
|
+
const t = K(e), n = Ee(e), o = e.ownerDocument.body, r = J(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), i = J(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
|
|
1001
1001
|
let s = -n.scrollLeft + Te(e);
|
|
1002
1002
|
const c = -n.scrollTop;
|
|
1003
|
-
return
|
|
1003
|
+
return V(o).direction === "rtl" && (s += J(t.clientWidth, o.clientWidth) - r), {
|
|
1004
1004
|
width: r,
|
|
1005
1005
|
height: i,
|
|
1006
1006
|
x: s,
|
|
@@ -1008,42 +1008,42 @@ function po(e) {
|
|
|
1008
1008
|
};
|
|
1009
1009
|
}
|
|
1010
1010
|
const nt = 25;
|
|
1011
|
-
function
|
|
1012
|
-
const n =
|
|
1013
|
-
let i = o.clientWidth, s = o.clientHeight, c = 0,
|
|
1011
|
+
function go(e, t) {
|
|
1012
|
+
const n = B(e), o = K(e), r = n.visualViewport;
|
|
1013
|
+
let i = o.clientWidth, s = o.clientHeight, c = 0, a = 0;
|
|
1014
1014
|
if (r) {
|
|
1015
1015
|
i = r.width, s = r.height;
|
|
1016
1016
|
const u = Re();
|
|
1017
|
-
(!u || u && t === "fixed") && (c = r.offsetLeft,
|
|
1017
|
+
(!u || u && t === "fixed") && (c = r.offsetLeft, a = r.offsetTop);
|
|
1018
1018
|
}
|
|
1019
|
-
const
|
|
1020
|
-
if (
|
|
1021
|
-
const u = o.ownerDocument, f = u.body,
|
|
1019
|
+
const l = Te(o);
|
|
1020
|
+
if (l <= 0) {
|
|
1021
|
+
const u = o.ownerDocument, f = u.body, g = getComputedStyle(f), d = u.compatMode === "CSS1Compat" && parseFloat(g.marginLeft) + parseFloat(g.marginRight) || 0, h = Math.abs(o.clientWidth - f.clientWidth - d);
|
|
1022
1022
|
h <= nt && (i -= h);
|
|
1023
|
-
} else
|
|
1023
|
+
} else l <= nt && (i += l);
|
|
1024
1024
|
return {
|
|
1025
1025
|
width: i,
|
|
1026
1026
|
height: s,
|
|
1027
1027
|
x: c,
|
|
1028
|
-
y:
|
|
1028
|
+
y: a
|
|
1029
1029
|
};
|
|
1030
1030
|
}
|
|
1031
|
-
const
|
|
1031
|
+
const mo = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
1032
1032
|
function ho(e, t) {
|
|
1033
|
-
const n = te(e, !0, t === "fixed"), o = n.top + e.clientTop, r = n.left + e.clientLeft, i =
|
|
1033
|
+
const n = te(e, !0, t === "fixed"), o = n.top + e.clientTop, r = n.left + e.clientLeft, i = F(e) ? oe(e) : H(1), s = e.clientWidth * i.x, c = e.clientHeight * i.y, a = r * i.x, l = o * i.y;
|
|
1034
1034
|
return {
|
|
1035
1035
|
width: s,
|
|
1036
1036
|
height: c,
|
|
1037
|
-
x:
|
|
1038
|
-
y:
|
|
1037
|
+
x: a,
|
|
1038
|
+
y: l
|
|
1039
1039
|
};
|
|
1040
1040
|
}
|
|
1041
1041
|
function ot(e, t, n) {
|
|
1042
1042
|
let o;
|
|
1043
1043
|
if (t === "viewport")
|
|
1044
|
-
o =
|
|
1044
|
+
o = go(e, n);
|
|
1045
1045
|
else if (t === "document")
|
|
1046
|
-
o = po(
|
|
1046
|
+
o = po(K(e));
|
|
1047
1047
|
else if (D(t))
|
|
1048
1048
|
o = ho(t, n);
|
|
1049
1049
|
else {
|
|
@@ -1057,20 +1057,20 @@ function ot(e, t, n) {
|
|
|
1057
1057
|
}
|
|
1058
1058
|
return he(o);
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1061
|
-
const n =
|
|
1062
|
-
return n === t || !D(n) || Y(n) ? !1 :
|
|
1060
|
+
function Lt(e, t) {
|
|
1061
|
+
const n = q(e);
|
|
1062
|
+
return n === t || !D(n) || Y(n) ? !1 : V(n).position === "fixed" || Lt(n, t);
|
|
1063
1063
|
}
|
|
1064
1064
|
function vo(e, t) {
|
|
1065
1065
|
const n = t.get(e);
|
|
1066
1066
|
if (n)
|
|
1067
1067
|
return n;
|
|
1068
1068
|
let o = Z(e, [], !1).filter((c) => D(c) && re(c) !== "body"), r = null;
|
|
1069
|
-
const i =
|
|
1070
|
-
let s = i ?
|
|
1069
|
+
const i = V(e).position === "fixed";
|
|
1070
|
+
let s = i ? q(e) : e;
|
|
1071
1071
|
for (; D(s) && !Y(s); ) {
|
|
1072
|
-
const c =
|
|
1073
|
-
!
|
|
1072
|
+
const c = V(s), a = Ve(s);
|
|
1073
|
+
!a && c.position === "fixed" && (r = null), (i ? !a && !r : !a && c.position === "static" && !!r && mo.has(r.position) || le(s) && !a && Lt(e, s)) ? o = o.filter((u) => u !== s) : r = c, s = q(s);
|
|
1074
1074
|
}
|
|
1075
1075
|
return t.set(e, o), o;
|
|
1076
1076
|
}
|
|
@@ -1081,15 +1081,15 @@ function bo(e) {
|
|
|
1081
1081
|
rootBoundary: o,
|
|
1082
1082
|
strategy: r
|
|
1083
1083
|
} = e;
|
|
1084
|
-
const s = [...n === "clippingAncestors" ? xe(t) ? [] : vo(t, this._c) : [].concat(n), o], c = s[0],
|
|
1084
|
+
const s = [...n === "clippingAncestors" ? xe(t) ? [] : vo(t, this._c) : [].concat(n), o], c = s[0], a = s.reduce((l, u) => {
|
|
1085
1085
|
const f = ot(t, u, r);
|
|
1086
|
-
return
|
|
1086
|
+
return l.top = J(f.top, l.top), l.right = pe(f.right, l.right), l.bottom = pe(f.bottom, l.bottom), l.left = J(f.left, l.left), l;
|
|
1087
1087
|
}, ot(t, c, r));
|
|
1088
1088
|
return {
|
|
1089
|
-
width:
|
|
1090
|
-
height:
|
|
1091
|
-
x:
|
|
1092
|
-
y:
|
|
1089
|
+
width: a.right - a.left,
|
|
1090
|
+
height: a.bottom - a.top,
|
|
1091
|
+
x: a.left,
|
|
1092
|
+
y: a.top
|
|
1093
1093
|
};
|
|
1094
1094
|
}
|
|
1095
1095
|
function yo(e) {
|
|
@@ -1103,50 +1103,50 @@ function yo(e) {
|
|
|
1103
1103
|
};
|
|
1104
1104
|
}
|
|
1105
1105
|
function wo(e, t, n) {
|
|
1106
|
-
const o =
|
|
1106
|
+
const o = F(t), r = K(t), i = n === "fixed", s = te(e, !0, i, t);
|
|
1107
1107
|
let c = {
|
|
1108
1108
|
scrollLeft: 0,
|
|
1109
1109
|
scrollTop: 0
|
|
1110
1110
|
};
|
|
1111
|
-
const
|
|
1112
|
-
function
|
|
1113
|
-
|
|
1111
|
+
const a = H(0);
|
|
1112
|
+
function l() {
|
|
1113
|
+
a.x = Te(r);
|
|
1114
1114
|
}
|
|
1115
1115
|
if (o || !o && !i)
|
|
1116
|
-
if ((re(t) !== "body" ||
|
|
1116
|
+
if ((re(t) !== "body" || le(r)) && (c = Ee(t)), o) {
|
|
1117
1117
|
const d = te(t, !0, i, t);
|
|
1118
|
-
|
|
1119
|
-
} else r &&
|
|
1120
|
-
i && !o && r &&
|
|
1121
|
-
const u = r && !o && !i ? Mt(r, c) :
|
|
1118
|
+
a.x = d.x + t.clientLeft, a.y = d.y + t.clientTop;
|
|
1119
|
+
} else r && l();
|
|
1120
|
+
i && !o && r && l();
|
|
1121
|
+
const u = r && !o && !i ? Mt(r, c) : H(0), f = s.left + c.scrollLeft - a.x - u.x, g = s.top + c.scrollTop - a.y - u.y;
|
|
1122
1122
|
return {
|
|
1123
1123
|
x: f,
|
|
1124
|
-
y:
|
|
1124
|
+
y: g,
|
|
1125
1125
|
width: s.width,
|
|
1126
1126
|
height: s.height
|
|
1127
1127
|
};
|
|
1128
1128
|
}
|
|
1129
1129
|
function Pe(e) {
|
|
1130
|
-
return
|
|
1130
|
+
return V(e).position === "static";
|
|
1131
1131
|
}
|
|
1132
1132
|
function rt(e, t) {
|
|
1133
|
-
if (!
|
|
1133
|
+
if (!F(e) || V(e).position === "fixed")
|
|
1134
1134
|
return null;
|
|
1135
1135
|
if (t)
|
|
1136
1136
|
return t(e);
|
|
1137
1137
|
let n = e.offsetParent;
|
|
1138
|
-
return
|
|
1138
|
+
return K(e) === n && (n = n.ownerDocument.body), n;
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1141
|
-
const n =
|
|
1140
|
+
function kt(e, t) {
|
|
1141
|
+
const n = B(e);
|
|
1142
1142
|
if (xe(e))
|
|
1143
1143
|
return n;
|
|
1144
|
-
if (!
|
|
1145
|
-
let r =
|
|
1144
|
+
if (!F(e)) {
|
|
1145
|
+
let r = q(e);
|
|
1146
1146
|
for (; r && !Y(r); ) {
|
|
1147
1147
|
if (D(r) && !Pe(r))
|
|
1148
1148
|
return r;
|
|
1149
|
-
r =
|
|
1149
|
+
r = q(r);
|
|
1150
1150
|
}
|
|
1151
1151
|
return n;
|
|
1152
1152
|
}
|
|
@@ -1156,7 +1156,7 @@ function Ft(e, t) {
|
|
|
1156
1156
|
return o && Y(o) && Pe(o) && !Ve(o) ? n : o || fn(e) || n;
|
|
1157
1157
|
}
|
|
1158
1158
|
const xo = async function(e) {
|
|
1159
|
-
const t = this.getOffsetParent ||
|
|
1159
|
+
const t = this.getOffsetParent || kt, n = this.getDimensions, o = await n(e.floating);
|
|
1160
1160
|
return {
|
|
1161
1161
|
reference: wo(e.reference, await t(e.floating), e.strategy),
|
|
1162
1162
|
floating: {
|
|
@@ -1168,13 +1168,13 @@ const xo = async function(e) {
|
|
|
1168
1168
|
};
|
|
1169
1169
|
};
|
|
1170
1170
|
function Ro(e) {
|
|
1171
|
-
return
|
|
1171
|
+
return V(e).direction === "rtl";
|
|
1172
1172
|
}
|
|
1173
1173
|
const Eo = {
|
|
1174
1174
|
convertOffsetParentRelativeRectToViewportRelativeRect: uo,
|
|
1175
|
-
getDocumentElement:
|
|
1175
|
+
getDocumentElement: K,
|
|
1176
1176
|
getClippingRect: bo,
|
|
1177
|
-
getOffsetParent:
|
|
1177
|
+
getOffsetParent: kt,
|
|
1178
1178
|
getElementRects: xo,
|
|
1179
1179
|
getClientRects: fo,
|
|
1180
1180
|
getDimensions: yo,
|
|
@@ -1182,50 +1182,50 @@ const Eo = {
|
|
|
1182
1182
|
isElement: D,
|
|
1183
1183
|
isRTL: Ro
|
|
1184
1184
|
};
|
|
1185
|
-
function
|
|
1185
|
+
function Nt(e, t) {
|
|
1186
1186
|
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
1187
1187
|
}
|
|
1188
1188
|
function So(e, t) {
|
|
1189
1189
|
let n = null, o;
|
|
1190
|
-
const r =
|
|
1190
|
+
const r = K(e);
|
|
1191
1191
|
function i() {
|
|
1192
1192
|
var c;
|
|
1193
1193
|
clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
|
|
1194
1194
|
}
|
|
1195
|
-
function s(c,
|
|
1196
|
-
c === void 0 && (c = !1),
|
|
1197
|
-
const
|
|
1195
|
+
function s(c, a) {
|
|
1196
|
+
c === void 0 && (c = !1), a === void 0 && (a = 1), i();
|
|
1197
|
+
const l = e.getBoundingClientRect(), {
|
|
1198
1198
|
left: u,
|
|
1199
1199
|
top: f,
|
|
1200
|
-
width:
|
|
1200
|
+
width: g,
|
|
1201
1201
|
height: d
|
|
1202
|
-
} =
|
|
1203
|
-
if (c || t(), !
|
|
1202
|
+
} = l;
|
|
1203
|
+
if (c || t(), !g || !d)
|
|
1204
1204
|
return;
|
|
1205
|
-
const h = ue(f), p = ue(r.clientWidth - (u +
|
|
1206
|
-
rootMargin: -h + "px " + -p + "px " + -
|
|
1207
|
-
threshold: J(0, pe(1,
|
|
1205
|
+
const h = ue(f), p = ue(r.clientWidth - (u + g)), v = ue(r.clientHeight - (f + d)), y = ue(u), x = {
|
|
1206
|
+
rootMargin: -h + "px " + -p + "px " + -v + "px " + -y + "px",
|
|
1207
|
+
threshold: J(0, pe(1, a)) || 1
|
|
1208
1208
|
};
|
|
1209
1209
|
let E = !0;
|
|
1210
|
-
function
|
|
1211
|
-
const
|
|
1212
|
-
if (
|
|
1210
|
+
function C(T) {
|
|
1211
|
+
const L = T[0].intersectionRatio;
|
|
1212
|
+
if (L !== a) {
|
|
1213
1213
|
if (!E)
|
|
1214
1214
|
return s();
|
|
1215
|
-
|
|
1215
|
+
L ? s(!1, L) : o = setTimeout(() => {
|
|
1216
1216
|
s(!1, 1e-7);
|
|
1217
1217
|
}, 1e3);
|
|
1218
1218
|
}
|
|
1219
|
-
|
|
1219
|
+
L === 1 && !Nt(l, e.getBoundingClientRect()) && s(), E = !1;
|
|
1220
1220
|
}
|
|
1221
1221
|
try {
|
|
1222
|
-
n = new IntersectionObserver(
|
|
1222
|
+
n = new IntersectionObserver(C, {
|
|
1223
1223
|
...x,
|
|
1224
1224
|
// Handle <iframe>s
|
|
1225
1225
|
root: r.ownerDocument
|
|
1226
1226
|
});
|
|
1227
1227
|
} catch {
|
|
1228
|
-
n = new IntersectionObserver(
|
|
1228
|
+
n = new IntersectionObserver(C, x);
|
|
1229
1229
|
}
|
|
1230
1230
|
n.observe(e);
|
|
1231
1231
|
}
|
|
@@ -1238,33 +1238,33 @@ function Co(e, t, n, o) {
|
|
|
1238
1238
|
ancestorResize: i = !0,
|
|
1239
1239
|
elementResize: s = typeof ResizeObserver == "function",
|
|
1240
1240
|
layoutShift: c = typeof IntersectionObserver == "function",
|
|
1241
|
-
animationFrame:
|
|
1242
|
-
} = o,
|
|
1241
|
+
animationFrame: a = !1
|
|
1242
|
+
} = o, l = We(e), u = r || i ? [...l ? Z(l) : [], ...Z(t)] : [];
|
|
1243
1243
|
u.forEach((y) => {
|
|
1244
1244
|
r && y.addEventListener("scroll", n, {
|
|
1245
1245
|
passive: !0
|
|
1246
1246
|
}), i && y.addEventListener("resize", n);
|
|
1247
1247
|
});
|
|
1248
|
-
const f =
|
|
1249
|
-
let
|
|
1248
|
+
const f = l && c ? So(l, n) : null;
|
|
1249
|
+
let g = -1, d = null;
|
|
1250
1250
|
s && (d = new ResizeObserver((y) => {
|
|
1251
1251
|
let [w] = y;
|
|
1252
|
-
w && w.target ===
|
|
1252
|
+
w && w.target === l && d && (d.unobserve(t), cancelAnimationFrame(g), g = requestAnimationFrame(() => {
|
|
1253
1253
|
var x;
|
|
1254
1254
|
(x = d) == null || x.observe(t);
|
|
1255
1255
|
})), n();
|
|
1256
|
-
}),
|
|
1257
|
-
let h, p =
|
|
1258
|
-
|
|
1259
|
-
function
|
|
1256
|
+
}), l && !a && d.observe(l), d.observe(t));
|
|
1257
|
+
let h, p = a ? te(e) : null;
|
|
1258
|
+
a && v();
|
|
1259
|
+
function v() {
|
|
1260
1260
|
const y = te(e);
|
|
1261
|
-
p && !
|
|
1261
|
+
p && !Nt(p, y) && n(), p = y, h = requestAnimationFrame(v);
|
|
1262
1262
|
}
|
|
1263
1263
|
return n(), () => {
|
|
1264
1264
|
var y;
|
|
1265
1265
|
u.forEach((w) => {
|
|
1266
1266
|
r && w.removeEventListener("scroll", n), i && w.removeEventListener("resize", n);
|
|
1267
|
-
}), f == null || f(), (y = d) == null || y.disconnect(), d = null,
|
|
1267
|
+
}), f == null || f(), (y = d) == null || y.disconnect(), d = null, a && cancelAnimationFrame(h);
|
|
1268
1268
|
};
|
|
1269
1269
|
}
|
|
1270
1270
|
const To = so, Ao = co, Oo = oo, Po = (e, t, n) => {
|
|
@@ -1281,7 +1281,7 @@ const To = so, Ao = co, Oo = oo, Po = (e, t, n) => {
|
|
|
1281
1281
|
});
|
|
1282
1282
|
};
|
|
1283
1283
|
var Io = typeof document < "u", Do = function() {
|
|
1284
|
-
}, de = Io ?
|
|
1284
|
+
}, de = Io ? mt : Do;
|
|
1285
1285
|
function ye(e, t) {
|
|
1286
1286
|
if (e === t)
|
|
1287
1287
|
return !0;
|
|
@@ -1312,15 +1312,15 @@ function ye(e, t) {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
return e !== e && t !== t;
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1315
|
+
function Ft(e) {
|
|
1316
1316
|
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1317
1317
|
}
|
|
1318
1318
|
function it(e, t) {
|
|
1319
|
-
const n =
|
|
1319
|
+
const n = Ft(e);
|
|
1320
1320
|
return Math.round(t * n) / n;
|
|
1321
1321
|
}
|
|
1322
1322
|
function Ie(e) {
|
|
1323
|
-
const t =
|
|
1323
|
+
const t = m.useRef(e);
|
|
1324
1324
|
return de(() => {
|
|
1325
1325
|
t.current = e;
|
|
1326
1326
|
}), t;
|
|
@@ -1337,132 +1337,132 @@ function Mo(e) {
|
|
|
1337
1337
|
floating: s
|
|
1338
1338
|
} = {},
|
|
1339
1339
|
transform: c = !0,
|
|
1340
|
-
whileElementsMounted:
|
|
1341
|
-
open:
|
|
1342
|
-
} = e, [u, f] =
|
|
1340
|
+
whileElementsMounted: a,
|
|
1341
|
+
open: l
|
|
1342
|
+
} = e, [u, f] = m.useState({
|
|
1343
1343
|
x: 0,
|
|
1344
1344
|
y: 0,
|
|
1345
1345
|
strategy: n,
|
|
1346
1346
|
placement: t,
|
|
1347
1347
|
middlewareData: {},
|
|
1348
1348
|
isPositioned: !1
|
|
1349
|
-
}), [
|
|
1350
|
-
ye(
|
|
1351
|
-
const [h, p] =
|
|
1352
|
-
|
|
1353
|
-
}, []), x =
|
|
1354
|
-
|
|
1355
|
-
}, []), E = i || h,
|
|
1356
|
-
if (!
|
|
1349
|
+
}), [g, d] = m.useState(o);
|
|
1350
|
+
ye(g, o) || d(o);
|
|
1351
|
+
const [h, p] = m.useState(null), [v, y] = m.useState(null), w = m.useCallback((b) => {
|
|
1352
|
+
b !== T.current && (T.current = b, p(b));
|
|
1353
|
+
}, []), x = m.useCallback((b) => {
|
|
1354
|
+
b !== L.current && (L.current = b, y(b));
|
|
1355
|
+
}, []), E = i || h, C = s || v, T = m.useRef(null), L = m.useRef(null), k = m.useRef(u), S = a != null, N = Ie(a), W = Ie(r), X = Ie(l), _ = m.useCallback(() => {
|
|
1356
|
+
if (!T.current || !L.current)
|
|
1357
1357
|
return;
|
|
1358
|
-
const
|
|
1358
|
+
const b = {
|
|
1359
1359
|
placement: t,
|
|
1360
1360
|
strategy: n,
|
|
1361
|
-
middleware:
|
|
1361
|
+
middleware: g
|
|
1362
1362
|
};
|
|
1363
|
-
|
|
1363
|
+
W.current && (b.platform = W.current), Po(T.current, L.current, b).then((A) => {
|
|
1364
1364
|
const I = {
|
|
1365
|
-
...
|
|
1365
|
+
...A,
|
|
1366
1366
|
// The floating element's position may be recomputed while it's closed
|
|
1367
1367
|
// but still mounted (such as when transitioning out). To ensure
|
|
1368
1368
|
// `isPositioned` will be `false` initially on the next open, avoid
|
|
1369
1369
|
// setting it to `true` when `open === false` (must be specified).
|
|
1370
|
-
isPositioned:
|
|
1370
|
+
isPositioned: X.current !== !1
|
|
1371
1371
|
};
|
|
1372
|
-
R.current && !ye(
|
|
1372
|
+
R.current && !ye(k.current, I) && (k.current = I, ht.flushSync(() => {
|
|
1373
1373
|
f(I);
|
|
1374
1374
|
}));
|
|
1375
1375
|
});
|
|
1376
|
-
}, [
|
|
1376
|
+
}, [g, t, n, W, X]);
|
|
1377
1377
|
de(() => {
|
|
1378
|
-
|
|
1379
|
-
...
|
|
1378
|
+
l === !1 && k.current.isPositioned && (k.current.isPositioned = !1, f((b) => ({
|
|
1379
|
+
...b,
|
|
1380
1380
|
isPositioned: !1
|
|
1381
1381
|
})));
|
|
1382
|
-
}, [
|
|
1383
|
-
const R =
|
|
1382
|
+
}, [l]);
|
|
1383
|
+
const R = m.useRef(!1);
|
|
1384
1384
|
de(() => (R.current = !0, () => {
|
|
1385
1385
|
R.current = !1;
|
|
1386
1386
|
}), []), de(() => {
|
|
1387
|
-
if (E && (
|
|
1388
|
-
if (
|
|
1389
|
-
return
|
|
1390
|
-
|
|
1387
|
+
if (E && (T.current = E), C && (L.current = C), E && C) {
|
|
1388
|
+
if (N.current)
|
|
1389
|
+
return N.current(E, C, _);
|
|
1390
|
+
_();
|
|
1391
1391
|
}
|
|
1392
|
-
}, [E,
|
|
1393
|
-
const M =
|
|
1394
|
-
reference:
|
|
1395
|
-
floating:
|
|
1392
|
+
}, [E, C, _, N, S]);
|
|
1393
|
+
const M = m.useMemo(() => ({
|
|
1394
|
+
reference: T,
|
|
1395
|
+
floating: L,
|
|
1396
1396
|
setReference: w,
|
|
1397
1397
|
setFloating: x
|
|
1398
|
-
}), [w, x]), O =
|
|
1398
|
+
}), [w, x]), O = m.useMemo(() => ({
|
|
1399
1399
|
reference: E,
|
|
1400
|
-
floating:
|
|
1401
|
-
}), [E,
|
|
1402
|
-
const
|
|
1400
|
+
floating: C
|
|
1401
|
+
}), [E, C]), P = m.useMemo(() => {
|
|
1402
|
+
const b = {
|
|
1403
1403
|
position: n,
|
|
1404
1404
|
left: 0,
|
|
1405
1405
|
top: 0
|
|
1406
1406
|
};
|
|
1407
1407
|
if (!O.floating)
|
|
1408
|
-
return
|
|
1409
|
-
const
|
|
1408
|
+
return b;
|
|
1409
|
+
const A = it(O.floating, u.x), I = it(O.floating, u.y);
|
|
1410
1410
|
return c ? {
|
|
1411
|
-
...
|
|
1412
|
-
transform: "translate(" +
|
|
1413
|
-
...
|
|
1411
|
+
...b,
|
|
1412
|
+
transform: "translate(" + A + "px, " + I + "px)",
|
|
1413
|
+
...Ft(O.floating) >= 1.5 && {
|
|
1414
1414
|
willChange: "transform"
|
|
1415
1415
|
}
|
|
1416
1416
|
} : {
|
|
1417
1417
|
position: n,
|
|
1418
|
-
left:
|
|
1418
|
+
left: A,
|
|
1419
1419
|
top: I
|
|
1420
1420
|
};
|
|
1421
1421
|
}, [n, c, O.floating, u.x, u.y]);
|
|
1422
|
-
return
|
|
1422
|
+
return m.useMemo(() => ({
|
|
1423
1423
|
...u,
|
|
1424
|
-
update:
|
|
1424
|
+
update: _,
|
|
1425
1425
|
refs: M,
|
|
1426
1426
|
elements: O,
|
|
1427
1427
|
floatingStyles: P
|
|
1428
|
-
}), [u,
|
|
1428
|
+
}), [u, _, M, O, P]);
|
|
1429
1429
|
}
|
|
1430
|
-
const
|
|
1430
|
+
const Lo = (e, t) => ({
|
|
1431
1431
|
...To(e),
|
|
1432
1432
|
options: [e, t]
|
|
1433
|
-
}),
|
|
1433
|
+
}), ko = (e, t) => ({
|
|
1434
1434
|
...Ao(e),
|
|
1435
1435
|
options: [e, t]
|
|
1436
|
-
}),
|
|
1436
|
+
}), No = (e, t) => ({
|
|
1437
1437
|
...Oo(e),
|
|
1438
1438
|
options: [e, t]
|
|
1439
|
-
}),
|
|
1440
|
-
...
|
|
1439
|
+
}), Fo = "data-floating-ui-focusable", st = "active", ct = "selected", $o = {
|
|
1440
|
+
...m
|
|
1441
1441
|
};
|
|
1442
|
-
let
|
|
1443
|
-
const
|
|
1442
|
+
let at = !1, Bo = 0;
|
|
1443
|
+
const lt = () => (
|
|
1444
1444
|
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
1445
1445
|
// on <React 18
|
|
1446
|
-
"floating-ui-" + Math.random().toString(36).slice(2, 6) +
|
|
1446
|
+
"floating-ui-" + Math.random().toString(36).slice(2, 6) + Bo++
|
|
1447
1447
|
);
|
|
1448
1448
|
function _o() {
|
|
1449
|
-
const [e, t] =
|
|
1449
|
+
const [e, t] = m.useState(() => at ? lt() : void 0);
|
|
1450
1450
|
return Q(() => {
|
|
1451
|
-
e == null && t(
|
|
1452
|
-
}, []),
|
|
1453
|
-
|
|
1451
|
+
e == null && t(lt());
|
|
1452
|
+
}, []), m.useEffect(() => {
|
|
1453
|
+
at = !0;
|
|
1454
1454
|
}, []), e;
|
|
1455
1455
|
}
|
|
1456
|
-
const Vo =
|
|
1457
|
-
let
|
|
1458
|
-
process.env.NODE_ENV !== "production" && (
|
|
1456
|
+
const Vo = $o.useId, He = Vo || _o;
|
|
1457
|
+
let Be;
|
|
1458
|
+
process.env.NODE_ENV !== "production" && (Be = /* @__PURE__ */ new Set());
|
|
1459
1459
|
function Wo() {
|
|
1460
1460
|
for (var e, t = arguments.length, n = new Array(t), o = 0; o < t; o++)
|
|
1461
1461
|
n[o] = arguments[o];
|
|
1462
1462
|
const r = "Floating UI: " + n.join(" ");
|
|
1463
|
-
if (!((e =
|
|
1463
|
+
if (!((e = Be) != null && e.has(r))) {
|
|
1464
1464
|
var i;
|
|
1465
|
-
(i =
|
|
1465
|
+
(i = Be) == null || i.add(r), console.error(r);
|
|
1466
1466
|
}
|
|
1467
1467
|
}
|
|
1468
1468
|
function Ho() {
|
|
@@ -1481,14 +1481,14 @@ function Ho() {
|
|
|
1481
1481
|
}
|
|
1482
1482
|
};
|
|
1483
1483
|
}
|
|
1484
|
-
const Ko = /* @__PURE__ */
|
|
1484
|
+
const Ko = /* @__PURE__ */ m.createContext(null), jo = /* @__PURE__ */ m.createContext(null), $t = () => {
|
|
1485
1485
|
var e;
|
|
1486
|
-
return ((e =
|
|
1487
|
-
},
|
|
1486
|
+
return ((e = m.useContext(Ko)) == null ? void 0 : e.id) || null;
|
|
1487
|
+
}, Bt = () => m.useContext(jo);
|
|
1488
1488
|
function Ke(e) {
|
|
1489
1489
|
return "data-floating-ui-" + e;
|
|
1490
1490
|
}
|
|
1491
|
-
const
|
|
1491
|
+
const Uo = {
|
|
1492
1492
|
border: 0,
|
|
1493
1493
|
clip: "rect(0 0 0 0)",
|
|
1494
1494
|
height: "1px",
|
|
@@ -1500,8 +1500,8 @@ const jo = {
|
|
|
1500
1500
|
width: "1px",
|
|
1501
1501
|
top: 0,
|
|
1502
1502
|
left: 0
|
|
1503
|
-
}, ut = /* @__PURE__ */
|
|
1504
|
-
const [o, r] =
|
|
1503
|
+
}, ut = /* @__PURE__ */ m.forwardRef(function(t, n) {
|
|
1504
|
+
const [o, r] = m.useState();
|
|
1505
1505
|
Q(() => {
|
|
1506
1506
|
Vn() && r("button");
|
|
1507
1507
|
}, []);
|
|
@@ -1512,42 +1512,42 @@ const jo = {
|
|
|
1512
1512
|
role: o,
|
|
1513
1513
|
"aria-hidden": o ? void 0 : !0,
|
|
1514
1514
|
[Ke("focus-guard")]: "",
|
|
1515
|
-
style:
|
|
1515
|
+
style: Uo
|
|
1516
1516
|
};
|
|
1517
|
-
return /* @__PURE__ */
|
|
1517
|
+
return /* @__PURE__ */ U("span", {
|
|
1518
1518
|
...t,
|
|
1519
1519
|
...i
|
|
1520
1520
|
});
|
|
1521
|
-
}),
|
|
1521
|
+
}), Yo = {
|
|
1522
1522
|
clipPath: "inset(50%)",
|
|
1523
1523
|
position: "fixed",
|
|
1524
1524
|
top: 0,
|
|
1525
1525
|
left: 0
|
|
1526
|
-
}, _t = /* @__PURE__ */
|
|
1527
|
-
function
|
|
1526
|
+
}, _t = /* @__PURE__ */ m.createContext(null), ft = /* @__PURE__ */ Ke("portal");
|
|
1527
|
+
function qo(e) {
|
|
1528
1528
|
e === void 0 && (e = {});
|
|
1529
1529
|
const {
|
|
1530
1530
|
id: t,
|
|
1531
1531
|
root: n
|
|
1532
|
-
} = e, o = He(), r = zo(), [i, s] =
|
|
1532
|
+
} = e, o = He(), r = zo(), [i, s] = m.useState(null), c = m.useRef(null);
|
|
1533
1533
|
return Q(() => () => {
|
|
1534
1534
|
i == null || i.remove(), queueMicrotask(() => {
|
|
1535
1535
|
c.current = null;
|
|
1536
1536
|
});
|
|
1537
1537
|
}, [i]), Q(() => {
|
|
1538
1538
|
if (!o || c.current) return;
|
|
1539
|
-
const
|
|
1540
|
-
if (!
|
|
1541
|
-
const
|
|
1542
|
-
|
|
1539
|
+
const a = t ? document.getElementById(t) : null;
|
|
1540
|
+
if (!a) return;
|
|
1541
|
+
const l = document.createElement("div");
|
|
1542
|
+
l.id = o, l.setAttribute(ft, ""), a.appendChild(l), c.current = l, s(l);
|
|
1543
1543
|
}, [t, o]), Q(() => {
|
|
1544
1544
|
if (n === null || !o || c.current) return;
|
|
1545
|
-
let
|
|
1546
|
-
|
|
1547
|
-
let
|
|
1548
|
-
t && (
|
|
1545
|
+
let a = n || (r == null ? void 0 : r.portalNode);
|
|
1546
|
+
a && !_e(a) && (a = a.current), a = a || document.body;
|
|
1547
|
+
let l = null;
|
|
1548
|
+
t && (l = document.createElement("div"), l.id = t, a.appendChild(l));
|
|
1549
1549
|
const u = document.createElement("div");
|
|
1550
|
-
u.id = o, u.setAttribute(ft, ""),
|
|
1550
|
+
u.id = o, u.setAttribute(ft, ""), a = l || a, a.appendChild(u), c.current = u, s(u);
|
|
1551
1551
|
}, [t, n, o, r]), i;
|
|
1552
1552
|
}
|
|
1553
1553
|
function Xo(e) {
|
|
@@ -1556,59 +1556,59 @@ function Xo(e) {
|
|
|
1556
1556
|
id: n,
|
|
1557
1557
|
root: o,
|
|
1558
1558
|
preserveTabOrder: r = !0
|
|
1559
|
-
} = e, i =
|
|
1559
|
+
} = e, i = qo({
|
|
1560
1560
|
id: n,
|
|
1561
1561
|
root: o
|
|
1562
|
-
}), [s, c] =
|
|
1562
|
+
}), [s, c] = m.useState(null), a = m.useRef(null), l = m.useRef(null), u = m.useRef(null), f = m.useRef(null), g = s == null ? void 0 : s.modal, d = s == null ? void 0 : s.open, h = (
|
|
1563
1563
|
// The FocusManager and therefore floating element are currently open/
|
|
1564
1564
|
// rendered.
|
|
1565
1565
|
!!s && // Guards are only for non-modal focus management.
|
|
1566
1566
|
!s.modal && // Don't render if unmount is transitioning.
|
|
1567
1567
|
s.open && r && !!(o || i)
|
|
1568
1568
|
);
|
|
1569
|
-
return
|
|
1570
|
-
if (!i || !r ||
|
|
1569
|
+
return m.useEffect(() => {
|
|
1570
|
+
if (!i || !r || g)
|
|
1571
1571
|
return;
|
|
1572
|
-
function p(
|
|
1573
|
-
i && Oe(
|
|
1572
|
+
function p(v) {
|
|
1573
|
+
i && Oe(v) && (v.type === "focusin" ? et : eo)(i);
|
|
1574
1574
|
}
|
|
1575
1575
|
return i.addEventListener("focusin", p, !0), i.addEventListener("focusout", p, !0), () => {
|
|
1576
1576
|
i.removeEventListener("focusin", p, !0), i.removeEventListener("focusout", p, !0);
|
|
1577
1577
|
};
|
|
1578
|
-
}, [i, r,
|
|
1578
|
+
}, [i, r, g]), m.useEffect(() => {
|
|
1579
1579
|
i && (d || et(i));
|
|
1580
1580
|
}, [d, i]), /* @__PURE__ */ Zt(_t.Provider, {
|
|
1581
|
-
value:
|
|
1581
|
+
value: m.useMemo(() => ({
|
|
1582
1582
|
preserveTabOrder: r,
|
|
1583
|
-
beforeOutsideRef:
|
|
1584
|
-
afterOutsideRef:
|
|
1583
|
+
beforeOutsideRef: a,
|
|
1584
|
+
afterOutsideRef: l,
|
|
1585
1585
|
beforeInsideRef: u,
|
|
1586
1586
|
afterInsideRef: f,
|
|
1587
1587
|
portalNode: i,
|
|
1588
1588
|
setFocusManagerState: c
|
|
1589
1589
|
}), [r, i]),
|
|
1590
|
-
children: [h && i && /* @__PURE__ */
|
|
1590
|
+
children: [h && i && /* @__PURE__ */ U(ut, {
|
|
1591
1591
|
"data-type": "outside",
|
|
1592
|
-
ref:
|
|
1592
|
+
ref: a,
|
|
1593
1593
|
onFocus: (p) => {
|
|
1594
1594
|
if (Oe(p, i)) {
|
|
1595
|
-
var
|
|
1596
|
-
(
|
|
1595
|
+
var v;
|
|
1596
|
+
(v = u.current) == null || v.focus();
|
|
1597
1597
|
} else {
|
|
1598
1598
|
const y = s ? s.domReference : null, w = Qn(y);
|
|
1599
1599
|
w == null || w.focus();
|
|
1600
1600
|
}
|
|
1601
1601
|
}
|
|
1602
|
-
}), h && i && /* @__PURE__ */
|
|
1602
|
+
}), h && i && /* @__PURE__ */ U("span", {
|
|
1603
1603
|
"aria-owns": i.id,
|
|
1604
|
-
style:
|
|
1605
|
-
}), i && /* @__PURE__ */ ht.createPortal(t, i), h && i && /* @__PURE__ */
|
|
1604
|
+
style: Yo
|
|
1605
|
+
}), i && /* @__PURE__ */ ht.createPortal(t, i), h && i && /* @__PURE__ */ U(ut, {
|
|
1606
1606
|
"data-type": "outside",
|
|
1607
|
-
ref:
|
|
1607
|
+
ref: l,
|
|
1608
1608
|
onFocus: (p) => {
|
|
1609
1609
|
if (Oe(p, i)) {
|
|
1610
|
-
var
|
|
1611
|
-
(
|
|
1610
|
+
var v;
|
|
1611
|
+
(v = f.current) == null || v.focus();
|
|
1612
1612
|
} else {
|
|
1613
1613
|
const y = s ? s.domReference : null, w = Jn(y);
|
|
1614
1614
|
w == null || w.focus(), s != null && s.closeOnFocusOut && (s == null || s.onOpenChange(!1, p.nativeEvent, "focus-out"));
|
|
@@ -1617,15 +1617,15 @@ function Xo(e) {
|
|
|
1617
1617
|
})]
|
|
1618
1618
|
});
|
|
1619
1619
|
}
|
|
1620
|
-
const zo = () =>
|
|
1620
|
+
const zo = () => m.useContext(_t);
|
|
1621
1621
|
function dt(e) {
|
|
1622
|
-
return
|
|
1622
|
+
return F(e.target) && e.target.tagName === "BUTTON";
|
|
1623
1623
|
}
|
|
1624
1624
|
function Go(e) {
|
|
1625
|
-
return
|
|
1625
|
+
return F(e.target) && e.target.tagName === "A";
|
|
1626
1626
|
}
|
|
1627
1627
|
function pt(e) {
|
|
1628
|
-
return
|
|
1628
|
+
return jn(e);
|
|
1629
1629
|
}
|
|
1630
1630
|
function Zo(e, t) {
|
|
1631
1631
|
t === void 0 && (t = {});
|
|
@@ -1639,34 +1639,34 @@ function Zo(e, t) {
|
|
|
1639
1639
|
} = e, {
|
|
1640
1640
|
enabled: s = !0,
|
|
1641
1641
|
event: c = "click",
|
|
1642
|
-
toggle:
|
|
1643
|
-
ignoreMouse:
|
|
1642
|
+
toggle: a = !0,
|
|
1643
|
+
ignoreMouse: l = !1,
|
|
1644
1644
|
keyboardHandlers: u = !0,
|
|
1645
1645
|
stickIfOpen: f = !0
|
|
1646
|
-
} = t,
|
|
1646
|
+
} = t, g = m.useRef(), d = m.useRef(!1), h = m.useMemo(() => ({
|
|
1647
1647
|
onPointerDown(p) {
|
|
1648
|
-
|
|
1648
|
+
g.current = p.pointerType;
|
|
1649
1649
|
},
|
|
1650
1650
|
onMouseDown(p) {
|
|
1651
|
-
const
|
|
1652
|
-
p.button === 0 && c !== "click" && (Qe(
|
|
1651
|
+
const v = g.current;
|
|
1652
|
+
p.button === 0 && c !== "click" && (Qe(v) && l || (n && a && (!(r.current.openEvent && f) || r.current.openEvent.type === "mousedown") ? o(!1, p.nativeEvent, "click") : (p.preventDefault(), o(!0, p.nativeEvent, "click"))));
|
|
1653
1653
|
},
|
|
1654
1654
|
onClick(p) {
|
|
1655
|
-
const
|
|
1656
|
-
if (c === "mousedown" &&
|
|
1657
|
-
|
|
1655
|
+
const v = g.current;
|
|
1656
|
+
if (c === "mousedown" && g.current) {
|
|
1657
|
+
g.current = void 0;
|
|
1658
1658
|
return;
|
|
1659
1659
|
}
|
|
1660
|
-
Qe(
|
|
1660
|
+
Qe(v) && l || (n && a && (!(r.current.openEvent && f) || r.current.openEvent.type === "click") ? o(!1, p.nativeEvent, "click") : o(!0, p.nativeEvent, "click"));
|
|
1661
1661
|
},
|
|
1662
1662
|
onKeyDown(p) {
|
|
1663
|
-
|
|
1663
|
+
g.current = void 0, !(p.defaultPrevented || !u || dt(p)) && (p.key === " " && !pt(i) && (p.preventDefault(), d.current = !0), !Go(p) && p.key === "Enter" && o(!(n && a), p.nativeEvent, "click"));
|
|
1664
1664
|
},
|
|
1665
1665
|
onKeyUp(p) {
|
|
1666
|
-
p.defaultPrevented || !u || dt(p) || pt(i) || p.key === " " && d.current && (d.current = !1, o(!(n &&
|
|
1666
|
+
p.defaultPrevented || !u || dt(p) || pt(i) || p.key === " " && d.current && (d.current = !1, o(!(n && a), p.nativeEvent, "click"));
|
|
1667
1667
|
}
|
|
1668
|
-
}), [r, i, c,
|
|
1669
|
-
return
|
|
1668
|
+
}), [r, i, c, l, u, o, n, f, a]);
|
|
1669
|
+
return m.useMemo(() => s ? {
|
|
1670
1670
|
reference: h
|
|
1671
1671
|
} : {}, [s, h]);
|
|
1672
1672
|
}
|
|
@@ -1678,7 +1678,7 @@ const Jo = {
|
|
|
1678
1678
|
pointerdown: "onPointerDownCapture",
|
|
1679
1679
|
mousedown: "onMouseDownCapture",
|
|
1680
1680
|
click: "onClickCapture"
|
|
1681
|
-
},
|
|
1681
|
+
}, gt = (e) => {
|
|
1682
1682
|
var t, n;
|
|
1683
1683
|
return {
|
|
1684
1684
|
escapeKey: typeof e == "boolean" ? e : (t = e == null ? void 0 : e.escapeKey) != null ? t : !1,
|
|
@@ -1695,96 +1695,96 @@ function er(e, t) {
|
|
|
1695
1695
|
} = e, {
|
|
1696
1696
|
enabled: s = !0,
|
|
1697
1697
|
escapeKey: c = !0,
|
|
1698
|
-
outsidePress:
|
|
1699
|
-
outsidePressEvent:
|
|
1698
|
+
outsidePress: a = !0,
|
|
1699
|
+
outsidePressEvent: l = "pointerdown",
|
|
1700
1700
|
referencePress: u = !1,
|
|
1701
1701
|
referencePressEvent: f = "pointerdown",
|
|
1702
|
-
ancestorScroll:
|
|
1702
|
+
ancestorScroll: g = !1,
|
|
1703
1703
|
bubbles: d,
|
|
1704
1704
|
capture: h
|
|
1705
|
-
} = t, p =
|
|
1705
|
+
} = t, p = Bt(), v = ne(typeof a == "function" ? a : () => !1), y = typeof a == "function" ? v : a, w = m.useRef(!1), {
|
|
1706
1706
|
escapeKey: x,
|
|
1707
1707
|
outsidePress: E
|
|
1708
|
-
} =
|
|
1709
|
-
escapeKey:
|
|
1710
|
-
outsidePress:
|
|
1711
|
-
} =
|
|
1708
|
+
} = gt(d), {
|
|
1709
|
+
escapeKey: C,
|
|
1710
|
+
outsidePress: T
|
|
1711
|
+
} = gt(h), L = m.useRef(!1), k = ne((R) => {
|
|
1712
1712
|
var M;
|
|
1713
|
-
if (!n || !s || !c || R.key !== "Escape" ||
|
|
1713
|
+
if (!n || !s || !c || R.key !== "Escape" || L.current)
|
|
1714
1714
|
return;
|
|
1715
1715
|
const O = (M = i.current.floatingContext) == null ? void 0 : M.nodeId, P = p ? fe(p.nodesRef.current, O) : [];
|
|
1716
1716
|
if (!x && (R.stopPropagation(), P.length > 0)) {
|
|
1717
|
-
let
|
|
1718
|
-
if (P.forEach((
|
|
1717
|
+
let b = !0;
|
|
1718
|
+
if (P.forEach((A) => {
|
|
1719
1719
|
var I;
|
|
1720
|
-
if ((I =
|
|
1721
|
-
|
|
1720
|
+
if ((I = A.context) != null && I.open && !A.context.dataRef.current.__escapeKeyBubbles) {
|
|
1721
|
+
b = !1;
|
|
1722
1722
|
return;
|
|
1723
1723
|
}
|
|
1724
|
-
}), !
|
|
1724
|
+
}), !b)
|
|
1725
1725
|
return;
|
|
1726
1726
|
}
|
|
1727
|
-
o(!1,
|
|
1728
|
-
}),
|
|
1727
|
+
o(!1, Yn(R) ? R.nativeEvent : R, "escape-key");
|
|
1728
|
+
}), S = ne((R) => {
|
|
1729
1729
|
var M;
|
|
1730
1730
|
const O = () => {
|
|
1731
1731
|
var P;
|
|
1732
|
-
|
|
1732
|
+
k(R), (P = se(R)) == null || P.removeEventListener("keydown", O);
|
|
1733
1733
|
};
|
|
1734
1734
|
(M = se(R)) == null || M.addEventListener("keydown", O);
|
|
1735
|
-
}),
|
|
1735
|
+
}), N = ne((R) => {
|
|
1736
1736
|
var M;
|
|
1737
1737
|
const O = i.current.insideReactTree;
|
|
1738
1738
|
i.current.insideReactTree = !1;
|
|
1739
1739
|
const P = w.current;
|
|
1740
|
-
if (w.current = !1,
|
|
1740
|
+
if (w.current = !1, l === "click" && P || O || typeof y == "function" && !y(R))
|
|
1741
1741
|
return;
|
|
1742
|
-
const
|
|
1743
|
-
let z = D(
|
|
1742
|
+
const b = se(R), A = "[" + Ke("inert") + "]", I = ae(r.floating).querySelectorAll(A);
|
|
1743
|
+
let z = D(b) ? b : null;
|
|
1744
1744
|
for (; z && !Y(z); ) {
|
|
1745
|
-
const
|
|
1746
|
-
if (Y(
|
|
1745
|
+
const $ = q(z);
|
|
1746
|
+
if (Y($) || !D($))
|
|
1747
1747
|
break;
|
|
1748
|
-
z =
|
|
1748
|
+
z = $;
|
|
1749
1749
|
}
|
|
1750
|
-
if (I.length && D(
|
|
1751
|
-
|
|
1750
|
+
if (I.length && D(b) && !Kn(b) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
1751
|
+
!$e(b, r.floating) && // If the target root element contains none of the markers, then the
|
|
1752
1752
|
// element was injected after the floating element rendered.
|
|
1753
|
-
Array.from(I).every((
|
|
1753
|
+
Array.from(I).every(($) => !$e(z, $)))
|
|
1754
1754
|
return;
|
|
1755
|
-
if (
|
|
1756
|
-
const
|
|
1755
|
+
if (F(b) && _) {
|
|
1756
|
+
const $ = Y(b), j = V(b), ie = /auto|scroll/, jt = $ || ie.test(j.overflowX), Ut = $ || ie.test(j.overflowY), Yt = jt && b.clientWidth > 0 && b.scrollWidth > b.clientWidth, qt = Ut && b.clientHeight > 0 && b.scrollHeight > b.clientHeight, Xt = j.direction === "rtl", zt = qt && (Xt ? R.offsetX <= b.offsetWidth - b.clientWidth : R.offsetX > b.clientWidth), Gt = Yt && R.offsetY > b.clientHeight;
|
|
1757
1757
|
if (zt || Gt)
|
|
1758
1758
|
return;
|
|
1759
1759
|
}
|
|
1760
|
-
const
|
|
1760
|
+
const Ue = (M = i.current.floatingContext) == null ? void 0 : M.nodeId, Kt = p && fe(p.nodesRef.current, Ue).some(($) => {
|
|
1761
1761
|
var j;
|
|
1762
|
-
return Ae(R, (j =
|
|
1762
|
+
return Ae(R, (j = $.context) == null ? void 0 : j.elements.floating);
|
|
1763
1763
|
});
|
|
1764
1764
|
if (Ae(R, r.floating) || Ae(R, r.domReference) || Kt)
|
|
1765
1765
|
return;
|
|
1766
|
-
const
|
|
1767
|
-
if (
|
|
1768
|
-
let
|
|
1769
|
-
if (
|
|
1766
|
+
const Ye = p ? fe(p.nodesRef.current, Ue) : [];
|
|
1767
|
+
if (Ye.length > 0) {
|
|
1768
|
+
let $ = !0;
|
|
1769
|
+
if (Ye.forEach((j) => {
|
|
1770
1770
|
var ie;
|
|
1771
1771
|
if ((ie = j.context) != null && ie.open && !j.context.dataRef.current.__outsidePressBubbles) {
|
|
1772
|
-
|
|
1772
|
+
$ = !1;
|
|
1773
1773
|
return;
|
|
1774
1774
|
}
|
|
1775
|
-
}),
|
|
1775
|
+
}), !$)
|
|
1776
1776
|
return;
|
|
1777
1777
|
}
|
|
1778
1778
|
o(!1, R, "outside-press");
|
|
1779
|
-
}),
|
|
1779
|
+
}), W = ne((R) => {
|
|
1780
1780
|
var M;
|
|
1781
1781
|
const O = () => {
|
|
1782
1782
|
var P;
|
|
1783
|
-
|
|
1783
|
+
N(R), (P = se(R)) == null || P.removeEventListener(l, O);
|
|
1784
1784
|
};
|
|
1785
|
-
(M = se(R)) == null || M.addEventListener(
|
|
1785
|
+
(M = se(R)) == null || M.addEventListener(l, O);
|
|
1786
1786
|
});
|
|
1787
|
-
|
|
1787
|
+
m.useEffect(() => {
|
|
1788
1788
|
if (!n || !s)
|
|
1789
1789
|
return;
|
|
1790
1790
|
i.current.__escapeKeyBubbles = x, i.current.__outsidePressBubbles = E;
|
|
@@ -1793,38 +1793,38 @@ function er(e, t) {
|
|
|
1793
1793
|
o(!1, I, "ancestor-scroll");
|
|
1794
1794
|
}
|
|
1795
1795
|
function O() {
|
|
1796
|
-
window.clearTimeout(R),
|
|
1796
|
+
window.clearTimeout(R), L.current = !0;
|
|
1797
1797
|
}
|
|
1798
1798
|
function P() {
|
|
1799
1799
|
R = window.setTimeout(
|
|
1800
1800
|
() => {
|
|
1801
|
-
|
|
1801
|
+
L.current = !1;
|
|
1802
1802
|
},
|
|
1803
1803
|
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
|
|
1804
1804
|
// Only apply to WebKit for the test to remain 0ms.
|
|
1805
1805
|
Re() ? 5 : 0
|
|
1806
1806
|
);
|
|
1807
1807
|
}
|
|
1808
|
-
const
|
|
1809
|
-
c && (
|
|
1810
|
-
let
|
|
1811
|
-
return
|
|
1808
|
+
const b = ae(r.floating);
|
|
1809
|
+
c && (b.addEventListener("keydown", C ? S : k, C), b.addEventListener("compositionstart", O), b.addEventListener("compositionend", P)), y && b.addEventListener(l, T ? W : N, T);
|
|
1810
|
+
let A = [];
|
|
1811
|
+
return g && (D(r.domReference) && (A = Z(r.domReference)), D(r.floating) && (A = A.concat(Z(r.floating))), !D(r.reference) && r.reference && r.reference.contextElement && (A = A.concat(Z(r.reference.contextElement)))), A = A.filter((I) => {
|
|
1812
1812
|
var z;
|
|
1813
|
-
return I !== ((z =
|
|
1814
|
-
}),
|
|
1813
|
+
return I !== ((z = b.defaultView) == null ? void 0 : z.visualViewport);
|
|
1814
|
+
}), A.forEach((I) => {
|
|
1815
1815
|
I.addEventListener("scroll", M, {
|
|
1816
1816
|
passive: !0
|
|
1817
1817
|
});
|
|
1818
1818
|
}), () => {
|
|
1819
|
-
c && (
|
|
1819
|
+
c && (b.removeEventListener("keydown", C ? S : k, C), b.removeEventListener("compositionstart", O), b.removeEventListener("compositionend", P)), y && b.removeEventListener(l, T ? W : N, T), A.forEach((I) => {
|
|
1820
1820
|
I.removeEventListener("scroll", M);
|
|
1821
1821
|
}), window.clearTimeout(R);
|
|
1822
1822
|
};
|
|
1823
|
-
}, [i, r, c, y,
|
|
1823
|
+
}, [i, r, c, y, l, n, o, g, s, x, E, k, C, S, N, T, W]), m.useEffect(() => {
|
|
1824
1824
|
i.current.insideReactTree = !1;
|
|
1825
|
-
}, [i, y,
|
|
1826
|
-
const
|
|
1827
|
-
onKeyDown:
|
|
1825
|
+
}, [i, y, l]);
|
|
1826
|
+
const X = m.useMemo(() => ({
|
|
1827
|
+
onKeyDown: k,
|
|
1828
1828
|
...u && {
|
|
1829
1829
|
[Jo[f]]: (R) => {
|
|
1830
1830
|
o(!1, R.nativeEvent, "reference-press");
|
|
@@ -1835,56 +1835,56 @@ function er(e, t) {
|
|
|
1835
1835
|
}
|
|
1836
1836
|
}
|
|
1837
1837
|
}
|
|
1838
|
-
}), [
|
|
1839
|
-
onKeyDown:
|
|
1838
|
+
}), [k, o, u, f]), _ = m.useMemo(() => ({
|
|
1839
|
+
onKeyDown: k,
|
|
1840
1840
|
onMouseDown() {
|
|
1841
1841
|
w.current = !0;
|
|
1842
1842
|
},
|
|
1843
1843
|
onMouseUp() {
|
|
1844
1844
|
w.current = !0;
|
|
1845
1845
|
},
|
|
1846
|
-
[Qo[
|
|
1846
|
+
[Qo[l]]: () => {
|
|
1847
1847
|
i.current.insideReactTree = !0;
|
|
1848
1848
|
}
|
|
1849
|
-
}), [
|
|
1850
|
-
return
|
|
1851
|
-
reference:
|
|
1852
|
-
floating:
|
|
1853
|
-
} : {}, [s,
|
|
1849
|
+
}), [k, l, i]);
|
|
1850
|
+
return m.useMemo(() => s ? {
|
|
1851
|
+
reference: X,
|
|
1852
|
+
floating: _
|
|
1853
|
+
} : {}, [s, X, _]);
|
|
1854
1854
|
}
|
|
1855
1855
|
function tr(e) {
|
|
1856
1856
|
const {
|
|
1857
1857
|
open: t = !1,
|
|
1858
1858
|
onOpenChange: n,
|
|
1859
1859
|
elements: o
|
|
1860
|
-
} = e, r = He(), i =
|
|
1860
|
+
} = e, r = He(), i = m.useRef({}), [s] = m.useState(() => Ho()), c = $t() != null;
|
|
1861
1861
|
if (process.env.NODE_ENV !== "production") {
|
|
1862
1862
|
const d = o.reference;
|
|
1863
1863
|
d && !D(d) && Wo("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
1864
1864
|
}
|
|
1865
|
-
const [
|
|
1865
|
+
const [a, l] = m.useState(o.reference), u = ne((d, h, p) => {
|
|
1866
1866
|
i.current.openEvent = d ? h : void 0, s.emit("openchange", {
|
|
1867
1867
|
open: d,
|
|
1868
1868
|
event: h,
|
|
1869
1869
|
reason: p,
|
|
1870
1870
|
nested: c
|
|
1871
1871
|
}), n == null || n(d, h, p);
|
|
1872
|
-
}), f =
|
|
1873
|
-
setPositionReference:
|
|
1874
|
-
}), []),
|
|
1875
|
-
reference:
|
|
1872
|
+
}), f = m.useMemo(() => ({
|
|
1873
|
+
setPositionReference: l
|
|
1874
|
+
}), []), g = m.useMemo(() => ({
|
|
1875
|
+
reference: a || o.reference || null,
|
|
1876
1876
|
floating: o.floating || null,
|
|
1877
1877
|
domReference: o.reference
|
|
1878
|
-
}), [
|
|
1879
|
-
return
|
|
1878
|
+
}), [a, o.reference, o.floating]);
|
|
1879
|
+
return m.useMemo(() => ({
|
|
1880
1880
|
dataRef: i,
|
|
1881
1881
|
open: t,
|
|
1882
1882
|
onOpenChange: u,
|
|
1883
|
-
elements:
|
|
1883
|
+
elements: g,
|
|
1884
1884
|
events: s,
|
|
1885
1885
|
floatingId: r,
|
|
1886
1886
|
refs: f
|
|
1887
|
-
}), [t, u,
|
|
1887
|
+
}), [t, u, g, s, r, f]);
|
|
1888
1888
|
}
|
|
1889
1889
|
function nr(e) {
|
|
1890
1890
|
e === void 0 && (e = {});
|
|
@@ -1897,7 +1897,7 @@ function nr(e) {
|
|
|
1897
1897
|
floating: null,
|
|
1898
1898
|
...e.elements
|
|
1899
1899
|
}
|
|
1900
|
-
}), o = e.rootContext || n, r = o.elements, [i, s] =
|
|
1900
|
+
}), o = e.rootContext || n, r = o.elements, [i, s] = m.useState(null), [c, a] = m.useState(null), u = (r == null ? void 0 : r.domReference) || i, f = m.useRef(null), g = Bt();
|
|
1901
1901
|
Q(() => {
|
|
1902
1902
|
u && (f.current = u);
|
|
1903
1903
|
}, [u]);
|
|
@@ -1909,43 +1909,43 @@ function nr(e) {
|
|
|
1909
1909
|
reference: c
|
|
1910
1910
|
}
|
|
1911
1911
|
}
|
|
1912
|
-
}), h =
|
|
1912
|
+
}), h = m.useCallback((x) => {
|
|
1913
1913
|
const E = D(x) ? {
|
|
1914
1914
|
getBoundingClientRect: () => x.getBoundingClientRect(),
|
|
1915
1915
|
getClientRects: () => x.getClientRects(),
|
|
1916
1916
|
contextElement: x
|
|
1917
1917
|
} : x;
|
|
1918
|
-
|
|
1919
|
-
}, [d.refs]), p =
|
|
1918
|
+
a(E), d.refs.setReference(E);
|
|
1919
|
+
}, [d.refs]), p = m.useCallback((x) => {
|
|
1920
1920
|
(D(x) || x === null) && (f.current = x, s(x)), (D(d.refs.reference.current) || d.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
1921
1921
|
// `null` to support `positionReference` + an unstable `reference`
|
|
1922
1922
|
// callback ref.
|
|
1923
1923
|
x !== null && !D(x)) && d.refs.setReference(x);
|
|
1924
|
-
}, [d.refs]),
|
|
1924
|
+
}, [d.refs]), v = m.useMemo(() => ({
|
|
1925
1925
|
...d.refs,
|
|
1926
1926
|
setReference: p,
|
|
1927
1927
|
setPositionReference: h,
|
|
1928
1928
|
domReference: f
|
|
1929
|
-
}), [d.refs, p, h]), y =
|
|
1929
|
+
}), [d.refs, p, h]), y = m.useMemo(() => ({
|
|
1930
1930
|
...d.elements,
|
|
1931
1931
|
domReference: u
|
|
1932
|
-
}), [d.elements, u]), w =
|
|
1932
|
+
}), [d.elements, u]), w = m.useMemo(() => ({
|
|
1933
1933
|
...d,
|
|
1934
1934
|
...o,
|
|
1935
|
-
refs:
|
|
1935
|
+
refs: v,
|
|
1936
1936
|
elements: y,
|
|
1937
1937
|
nodeId: t
|
|
1938
|
-
}), [d,
|
|
1938
|
+
}), [d, v, y, t, o]);
|
|
1939
1939
|
return Q(() => {
|
|
1940
1940
|
o.dataRef.current.floatingContext = w;
|
|
1941
|
-
const x =
|
|
1941
|
+
const x = g == null ? void 0 : g.nodesRef.current.find((E) => E.id === t);
|
|
1942
1942
|
x && (x.context = w);
|
|
1943
|
-
}),
|
|
1943
|
+
}), m.useMemo(() => ({
|
|
1944
1944
|
...d,
|
|
1945
1945
|
context: w,
|
|
1946
|
-
refs:
|
|
1946
|
+
refs: v,
|
|
1947
1947
|
elements: y
|
|
1948
|
-
}), [d,
|
|
1948
|
+
}), [d, v, y, w]);
|
|
1949
1949
|
}
|
|
1950
1950
|
function De(e, t, n) {
|
|
1951
1951
|
const o = /* @__PURE__ */ new Map(), r = n === "item";
|
|
@@ -1954,52 +1954,52 @@ function De(e, t, n) {
|
|
|
1954
1954
|
const {
|
|
1955
1955
|
[st]: s,
|
|
1956
1956
|
[ct]: c,
|
|
1957
|
-
...
|
|
1957
|
+
...a
|
|
1958
1958
|
} = e;
|
|
1959
|
-
i =
|
|
1959
|
+
i = a;
|
|
1960
1960
|
}
|
|
1961
1961
|
return {
|
|
1962
1962
|
...n === "floating" && {
|
|
1963
1963
|
tabIndex: -1,
|
|
1964
|
-
[
|
|
1964
|
+
[Fo]: ""
|
|
1965
1965
|
},
|
|
1966
1966
|
...i,
|
|
1967
1967
|
...t.map((s) => {
|
|
1968
1968
|
const c = s ? s[n] : null;
|
|
1969
1969
|
return typeof c == "function" ? e ? c(e) : null : c;
|
|
1970
|
-
}).concat(e).reduce((s, c) => (c && Object.entries(c).forEach((
|
|
1971
|
-
let [
|
|
1972
|
-
if (!(r && [st, ct].includes(
|
|
1973
|
-
if (
|
|
1974
|
-
if (o.has(
|
|
1970
|
+
}).concat(e).reduce((s, c) => (c && Object.entries(c).forEach((a) => {
|
|
1971
|
+
let [l, u] = a;
|
|
1972
|
+
if (!(r && [st, ct].includes(l)))
|
|
1973
|
+
if (l.indexOf("on") === 0) {
|
|
1974
|
+
if (o.has(l) || o.set(l, []), typeof u == "function") {
|
|
1975
1975
|
var f;
|
|
1976
|
-
(f = o.get(
|
|
1977
|
-
for (var
|
|
1976
|
+
(f = o.get(l)) == null || f.push(u), s[l] = function() {
|
|
1977
|
+
for (var g, d = arguments.length, h = new Array(d), p = 0; p < d; p++)
|
|
1978
1978
|
h[p] = arguments[p];
|
|
1979
|
-
return (
|
|
1979
|
+
return (g = o.get(l)) == null ? void 0 : g.map((v) => v(...h)).find((v) => v !== void 0);
|
|
1980
1980
|
};
|
|
1981
1981
|
}
|
|
1982
1982
|
} else
|
|
1983
|
-
s[
|
|
1983
|
+
s[l] = u;
|
|
1984
1984
|
}), s), {})
|
|
1985
1985
|
};
|
|
1986
1986
|
}
|
|
1987
1987
|
function or(e) {
|
|
1988
1988
|
e === void 0 && (e = []);
|
|
1989
|
-
const t = e.map((c) => c == null ? void 0 : c.reference), n = e.map((c) => c == null ? void 0 : c.floating), o = e.map((c) => c == null ? void 0 : c.item), r =
|
|
1989
|
+
const t = e.map((c) => c == null ? void 0 : c.reference), n = e.map((c) => c == null ? void 0 : c.floating), o = e.map((c) => c == null ? void 0 : c.item), r = m.useCallback(
|
|
1990
1990
|
(c) => De(c, e, "reference"),
|
|
1991
1991
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1992
1992
|
t
|
|
1993
|
-
), i =
|
|
1993
|
+
), i = m.useCallback(
|
|
1994
1994
|
(c) => De(c, e, "floating"),
|
|
1995
1995
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1996
1996
|
n
|
|
1997
|
-
), s =
|
|
1997
|
+
), s = m.useCallback(
|
|
1998
1998
|
(c) => De(c, e, "item"),
|
|
1999
1999
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2000
2000
|
o
|
|
2001
2001
|
);
|
|
2002
|
-
return
|
|
2002
|
+
return m.useMemo(() => ({
|
|
2003
2003
|
getReferenceProps: r,
|
|
2004
2004
|
getFloatingProps: i,
|
|
2005
2005
|
getItemProps: s
|
|
@@ -2015,70 +2015,70 @@ function ir(e, t) {
|
|
|
2015
2015
|
floatingId: s
|
|
2016
2016
|
} = e, {
|
|
2017
2017
|
enabled: c = !0,
|
|
2018
|
-
role:
|
|
2019
|
-
} = t,
|
|
2018
|
+
role: a = "dialog"
|
|
2019
|
+
} = t, l = He(), u = ((n = i.domReference) == null ? void 0 : n.id) || l, f = m.useMemo(() => {
|
|
2020
2020
|
var w;
|
|
2021
|
-
return ((w =
|
|
2022
|
-
}, [i.floating, s]),
|
|
2023
|
-
["aria-" + (
|
|
2021
|
+
return ((w = Un(i.floating)) == null ? void 0 : w.id) || s;
|
|
2022
|
+
}, [i.floating, s]), g = (o = rr.get(a)) != null ? o : a, h = $t() != null, p = m.useMemo(() => g === "tooltip" || a === "label" ? {
|
|
2023
|
+
["aria-" + (a === "label" ? "labelledby" : "describedby")]: r ? f : void 0
|
|
2024
2024
|
} : {
|
|
2025
2025
|
"aria-expanded": r ? "true" : "false",
|
|
2026
|
-
"aria-haspopup":
|
|
2026
|
+
"aria-haspopup": g === "alertdialog" ? "dialog" : g,
|
|
2027
2027
|
"aria-controls": r ? f : void 0,
|
|
2028
|
-
...
|
|
2028
|
+
...g === "listbox" && {
|
|
2029
2029
|
role: "combobox"
|
|
2030
2030
|
},
|
|
2031
|
-
...
|
|
2031
|
+
...g === "menu" && {
|
|
2032
2032
|
id: u
|
|
2033
2033
|
},
|
|
2034
|
-
...
|
|
2034
|
+
...g === "menu" && h && {
|
|
2035
2035
|
role: "menuitem"
|
|
2036
2036
|
},
|
|
2037
|
-
...
|
|
2037
|
+
...a === "select" && {
|
|
2038
2038
|
"aria-autocomplete": "none"
|
|
2039
2039
|
},
|
|
2040
|
-
...
|
|
2040
|
+
...a === "combobox" && {
|
|
2041
2041
|
"aria-autocomplete": "list"
|
|
2042
2042
|
}
|
|
2043
|
-
}, [
|
|
2043
|
+
}, [g, f, h, r, u, a]), v = m.useMemo(() => {
|
|
2044
2044
|
const w = {
|
|
2045
2045
|
id: f,
|
|
2046
|
-
...
|
|
2047
|
-
role:
|
|
2046
|
+
...g && {
|
|
2047
|
+
role: g
|
|
2048
2048
|
}
|
|
2049
2049
|
};
|
|
2050
|
-
return
|
|
2050
|
+
return g === "tooltip" || a === "label" ? w : {
|
|
2051
2051
|
...w,
|
|
2052
|
-
...
|
|
2052
|
+
...g === "menu" && {
|
|
2053
2053
|
"aria-labelledby": u
|
|
2054
2054
|
}
|
|
2055
2055
|
};
|
|
2056
|
-
}, [
|
|
2056
|
+
}, [g, f, u, a]), y = m.useCallback((w) => {
|
|
2057
2057
|
let {
|
|
2058
2058
|
active: x,
|
|
2059
2059
|
selected: E
|
|
2060
2060
|
} = w;
|
|
2061
|
-
const
|
|
2061
|
+
const C = {
|
|
2062
2062
|
role: "option",
|
|
2063
2063
|
...x && {
|
|
2064
2064
|
id: f + "-fui-option"
|
|
2065
2065
|
}
|
|
2066
2066
|
};
|
|
2067
|
-
switch (
|
|
2067
|
+
switch (a) {
|
|
2068
2068
|
case "select":
|
|
2069
2069
|
case "combobox":
|
|
2070
2070
|
return {
|
|
2071
|
-
...
|
|
2071
|
+
...C,
|
|
2072
2072
|
"aria-selected": E
|
|
2073
2073
|
};
|
|
2074
2074
|
}
|
|
2075
2075
|
return {};
|
|
2076
|
-
}, [f,
|
|
2077
|
-
return
|
|
2076
|
+
}, [f, a]);
|
|
2077
|
+
return m.useMemo(() => c ? {
|
|
2078
2078
|
reference: p,
|
|
2079
|
-
floating:
|
|
2079
|
+
floating: v,
|
|
2080
2080
|
item: y
|
|
2081
|
-
} : {}, [c, p,
|
|
2081
|
+
} : {}, [c, p, v, y]);
|
|
2082
2082
|
}
|
|
2083
2083
|
function Vt(e) {
|
|
2084
2084
|
var t, n, o = "";
|
|
@@ -2093,60 +2093,50 @@ function sr() {
|
|
|
2093
2093
|
for (var e, t, n = 0, o = "", r = arguments.length; n < r; n++) (e = arguments[n]) && (t = Vt(e)) && (o && (o += " "), o += t);
|
|
2094
2094
|
return o;
|
|
2095
2095
|
}
|
|
2096
|
-
const
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
type: k,
|
|
2121
|
-
name: F,
|
|
2122
|
-
disabled: _,
|
|
2096
|
+
const je = ({
|
|
2097
|
+
as: e,
|
|
2098
|
+
children: t,
|
|
2099
|
+
display: n,
|
|
2100
|
+
m: o,
|
|
2101
|
+
mt: r,
|
|
2102
|
+
mr: i,
|
|
2103
|
+
mb: s,
|
|
2104
|
+
ml: c,
|
|
2105
|
+
mx: a,
|
|
2106
|
+
my: l,
|
|
2107
|
+
p: u,
|
|
2108
|
+
pt: f,
|
|
2109
|
+
pr: g,
|
|
2110
|
+
pb: d,
|
|
2111
|
+
pl: h,
|
|
2112
|
+
px: p,
|
|
2113
|
+
py: v,
|
|
2114
|
+
width: y,
|
|
2115
|
+
height: w,
|
|
2116
|
+
position: x,
|
|
2117
|
+
style: E,
|
|
2118
|
+
className: C,
|
|
2119
|
+
disabled: T,
|
|
2123
2120
|
...L
|
|
2124
2121
|
}) => {
|
|
2125
|
-
const
|
|
2126
|
-
|
|
2127
|
-
const
|
|
2128
|
-
...
|
|
2129
|
-
...
|
|
2122
|
+
const k = e || "div", S = {};
|
|
2123
|
+
n && (S.display = n), y && (S.width = y), w && (S.height = w), x && (S.position = x), o && (S.margin = `var(--pittorica-space-${o})`), r && (S.marginTop = `var(--pittorica-space-${r})`), i && (S.marginRight = `var(--pittorica-space-${i})`), s && (S.marginBottom = `var(--pittorica-space-${s})`), c && (S.marginLeft = `var(--pittorica-space-${c})`), a && (S.marginLeft = `var(--pittorica-space-${a})`, S.marginRight = `var(--pittorica-space-${a})`), l && (S.marginTop = `var(--pittorica-space-${l})`, S.marginBottom = `var(--pittorica-space-${l})`), u && (S.padding = `var(--pittorica-space-${u})`), f && (S.paddingTop = `var(--pittorica-space-${f})`), g && (S.paddingRight = `var(--pittorica-space-${g})`), d && (S.paddingBottom = `var(--pittorica-space-${d})`), h && (S.paddingLeft = `var(--pittorica-space-${h})`), p && (S.paddingLeft = `var(--pittorica-space-${p})`, S.paddingRight = `var(--pittorica-space-${p})`), v && (S.paddingTop = `var(--pittorica-space-${v})`, S.paddingBottom = `var(--pittorica-space-${v})`);
|
|
2124
|
+
const N = {
|
|
2125
|
+
...E,
|
|
2126
|
+
...S
|
|
2130
2127
|
};
|
|
2131
|
-
return /* @__PURE__ */
|
|
2132
|
-
|
|
2128
|
+
return /* @__PURE__ */ U(
|
|
2129
|
+
k,
|
|
2133
2130
|
{
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
href: x,
|
|
2138
|
-
target: E,
|
|
2139
|
-
rel: S,
|
|
2140
|
-
htmlFor: C,
|
|
2141
|
-
type: k,
|
|
2142
|
-
name: F,
|
|
2143
|
-
disabled: _,
|
|
2131
|
+
className: sr("pittorica-box", C),
|
|
2132
|
+
style: N,
|
|
2133
|
+
disabled: T,
|
|
2144
2134
|
...L,
|
|
2145
|
-
children:
|
|
2135
|
+
children: t
|
|
2146
2136
|
}
|
|
2147
2137
|
);
|
|
2148
2138
|
};
|
|
2149
|
-
|
|
2139
|
+
je.displayName = "Box";
|
|
2150
2140
|
const Wt = Jt(null), Ht = () => {
|
|
2151
2141
|
const e = tn(Wt);
|
|
2152
2142
|
if (!e)
|
|
@@ -2158,12 +2148,12 @@ const Wt = Jt(null), Ht = () => {
|
|
|
2158
2148
|
onOpenChange: o,
|
|
2159
2149
|
placement: t,
|
|
2160
2150
|
whileElementsMounted: Co,
|
|
2161
|
-
middleware: [
|
|
2162
|
-
}), c = Zo(s),
|
|
2151
|
+
middleware: [Lo(8), No(), ko({ padding: 5 })]
|
|
2152
|
+
}), c = Zo(s), a = er(s), l = ir(s), { getReferenceProps: u, getFloatingProps: f } = or([
|
|
2163
2153
|
c,
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
]),
|
|
2154
|
+
a,
|
|
2155
|
+
l
|
|
2156
|
+
]), g = en(
|
|
2167
2157
|
() => ({
|
|
2168
2158
|
isOpen: n,
|
|
2169
2159
|
setIsOpen: o,
|
|
@@ -2174,52 +2164,55 @@ const Wt = Jt(null), Ht = () => {
|
|
|
2174
2164
|
}),
|
|
2175
2165
|
[n, r, i, u, f]
|
|
2176
2166
|
);
|
|
2177
|
-
return /* @__PURE__ */
|
|
2178
|
-
},
|
|
2167
|
+
return /* @__PURE__ */ U(Wt, { value: g, children: e });
|
|
2168
|
+
}, ar = ({
|
|
2179
2169
|
children: e,
|
|
2180
|
-
|
|
2170
|
+
as: t,
|
|
2171
|
+
ref: n,
|
|
2172
|
+
...o
|
|
2181
2173
|
}) => {
|
|
2182
|
-
const { refs:
|
|
2183
|
-
|
|
2174
|
+
const { refs: r, getReferenceProps: i } = Ht(), s = (a) => {
|
|
2175
|
+
r.setReference(a), n && (typeof n == "function" ? n(a) : typeof n == "object" && (n.current = a));
|
|
2184
2176
|
};
|
|
2185
|
-
return /* @__PURE__ */
|
|
2186
|
-
|
|
2177
|
+
return /* @__PURE__ */ U(
|
|
2178
|
+
je,
|
|
2187
2179
|
{
|
|
2188
|
-
as: "span",
|
|
2180
|
+
as: t || "span",
|
|
2189
2181
|
display: "inline-flex",
|
|
2190
|
-
...
|
|
2191
|
-
ref:
|
|
2182
|
+
...i(),
|
|
2183
|
+
ref: s,
|
|
2184
|
+
...o,
|
|
2192
2185
|
children: e
|
|
2193
2186
|
}
|
|
2194
2187
|
);
|
|
2195
|
-
},
|
|
2188
|
+
}, lr = ({
|
|
2196
2189
|
children: e,
|
|
2197
2190
|
className: t,
|
|
2198
|
-
|
|
2199
|
-
|
|
2191
|
+
as: n,
|
|
2192
|
+
ref: o,
|
|
2193
|
+
...r
|
|
2200
2194
|
}) => {
|
|
2201
|
-
const { isOpen:
|
|
2202
|
-
|
|
2203
|
-
const l = (a) => {
|
|
2204
|
-
i.setFloating(a), n && (typeof n == "function" ? n(a) : n.current = a);
|
|
2195
|
+
const { isOpen: i, refs: s, floatingStyles: c, getFloatingProps: a } = Ht(), l = (f) => {
|
|
2196
|
+
s.setFloating(f), o && (typeof o == "function" ? o(f) : typeof o == "object" && (o.current = f));
|
|
2205
2197
|
};
|
|
2206
|
-
return /* @__PURE__ */
|
|
2207
|
-
|
|
2198
|
+
return i ? /* @__PURE__ */ U(Xo, { children: /* @__PURE__ */ U(
|
|
2199
|
+
je,
|
|
2208
2200
|
{
|
|
2209
|
-
|
|
2210
|
-
...
|
|
2201
|
+
as: n || "div",
|
|
2202
|
+
...a(),
|
|
2211
2203
|
ref: l,
|
|
2212
2204
|
className: nn("pittorica-popover-content", t),
|
|
2213
|
-
style: { ...
|
|
2205
|
+
style: { ...c, ...r.style },
|
|
2206
|
+
...r,
|
|
2214
2207
|
children: e
|
|
2215
2208
|
}
|
|
2216
|
-
) });
|
|
2209
|
+
) }) : null;
|
|
2217
2210
|
};
|
|
2218
2211
|
cr.displayName = "Popover";
|
|
2219
|
-
|
|
2220
|
-
|
|
2212
|
+
ar.displayName = "Popover.Trigger";
|
|
2213
|
+
lr.displayName = "Popover.Content";
|
|
2221
2214
|
export {
|
|
2222
2215
|
cr as Popover,
|
|
2223
|
-
|
|
2224
|
-
|
|
2216
|
+
lr as PopoverContent,
|
|
2217
|
+
ar as PopoverTrigger
|
|
2225
2218
|
};
|