@odynn/awayz-core 0.3.11 → 0.3.13
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/assets/_styles.css +1 -1
- package/dist/assets/_styles2.css +1 -1
- package/dist/assets/_styles3.css +1 -1
- package/dist/assets/_styles4.css +1 -1
- package/dist/assets/_styles5.css +1 -0
- package/dist/components/Bookings/FlightBooking/FlightBooking.js +2 -2
- package/dist/components/Bookings/HotelBooking/HotelBooking.js +2 -2
- package/dist/components/CashValue/CashValue.js +7 -5
- package/dist/components/CashValue/CashValue.stories.js +14 -13
- package/dist/components/Menu/Menu.js +11 -10
- package/dist/components/Wallet/Card/Card.js +35 -0
- package/dist/components/Wallet/Card/Card.stories.js +62 -0
- package/dist/components/index.js +6 -4
- package/dist/configs/endpoints.js +2 -2
- package/dist/hooks/useBookingManagement/useBookingManagement.js +57 -48
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +40 -39
- package/dist/hooks/useTripManagement/useTripManagement.js +4 -3
- package/dist/hooks/useTripManagement/useTripManagement.test.js +2 -1
- package/dist/hooks/useWallet/useWallet.js +52 -33
- package/dist/hooks/useWallet/useWallet.test.js +85 -15
- package/dist/hooks/useWallet/useWallet.types.js +1 -0
- package/dist/index-BC-KTkxU.js +1571 -0
- package/dist/index-CDh8vAM_.js +132 -0
- package/dist/lib/components/Wallet/Card/Card.d.ts +6 -0
- package/dist/lib/components/Wallet/Card/Card.stories.d.ts +14 -0
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/configs/endpoints.d.ts +2 -0
- package/dist/lib/hooks/useBookingManagement/mocks/HotelBooking200.json.d.ts +608 -67
- package/dist/lib/hooks/useBookingManagement/useBookingManagement.types.d.ts +8 -0
- package/dist/lib/hooks/useWallet/mocks/AllCardsResponse200.json.d.ts +177 -0
- package/dist/lib/hooks/useWallet/mocks/GetAllProgramsReponse200.json.d.ts +705 -0
- package/dist/lib/hooks/useWallet/mocks/UserCardsResponse200.json.d.ts +139 -0
- package/dist/lib/hooks/useWallet/useWallet.d.ts +2 -16
- package/dist/lib/hooks/useWallet/useWallet.types.d.ts +50 -0
- package/dist/lib/services/wallet/WalletService.d.ts +2 -0
- package/dist/lib/services/wallet/WalletService.types.d.ts +2 -5
- package/dist/main.js +20 -18
- package/dist/providers/AwayzProvider.js +4 -3
- package/dist/services/currency/CurrencyService.js +4 -3
- package/dist/services/wallet/WalletService.js +43 -63
- package/package.json +1 -1
- package/dist/index-COgXcb6p.js +0 -1696
- package/dist/lib/hooks/useWallet/mocks/CardsResponse.json.d.ts +0 -34
|
@@ -0,0 +1,1571 @@
|
|
|
1
|
+
import * as p from "react";
|
|
2
|
+
import { useLayoutEffect as qt, useEffect as Kt } from "react";
|
|
3
|
+
import { jsx as Xt } from "react/jsx-runtime";
|
|
4
|
+
import { r as Gt } from "./index-Cv-wvFlM.js";
|
|
5
|
+
function en(t, e, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
6
|
+
return function(i) {
|
|
7
|
+
if (t == null || t(i), n === !1 || !i.defaultPrevented)
|
|
8
|
+
return e == null ? void 0 : e(i);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function Et(t, e) {
|
|
12
|
+
if (typeof t == "function")
|
|
13
|
+
return t(e);
|
|
14
|
+
t != null && (t.current = e);
|
|
15
|
+
}
|
|
16
|
+
function Jt(...t) {
|
|
17
|
+
return (e) => {
|
|
18
|
+
let n = !1;
|
|
19
|
+
const o = t.map((i) => {
|
|
20
|
+
const r = Et(i, e);
|
|
21
|
+
return !n && typeof r == "function" && (n = !0), r;
|
|
22
|
+
});
|
|
23
|
+
if (n)
|
|
24
|
+
return () => {
|
|
25
|
+
for (let i = 0; i < o.length; i++) {
|
|
26
|
+
const r = o[i];
|
|
27
|
+
typeof r == "function" ? r() : Et(t[i], null);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function Qt(...t) {
|
|
33
|
+
return p.useCallback(Jt(...t), t);
|
|
34
|
+
}
|
|
35
|
+
function nn(t, e = []) {
|
|
36
|
+
let n = [];
|
|
37
|
+
function o(r, s) {
|
|
38
|
+
const c = p.createContext(s), f = n.length;
|
|
39
|
+
n = [...n, s];
|
|
40
|
+
const l = (u) => {
|
|
41
|
+
var x;
|
|
42
|
+
const { scope: m, children: d, ...h } = u, g = ((x = m == null ? void 0 : m[t]) == null ? void 0 : x[f]) || c, w = p.useMemo(() => h, Object.values(h));
|
|
43
|
+
return /* @__PURE__ */ Xt(g.Provider, { value: w, children: d });
|
|
44
|
+
};
|
|
45
|
+
l.displayName = r + "Provider";
|
|
46
|
+
function a(u, m) {
|
|
47
|
+
var g;
|
|
48
|
+
const d = ((g = m == null ? void 0 : m[t]) == null ? void 0 : g[f]) || c, h = p.useContext(d);
|
|
49
|
+
if (h) return h;
|
|
50
|
+
if (s !== void 0) return s;
|
|
51
|
+
throw new Error(`\`${u}\` must be used within \`${r}\``);
|
|
52
|
+
}
|
|
53
|
+
return [l, a];
|
|
54
|
+
}
|
|
55
|
+
const i = () => {
|
|
56
|
+
const r = n.map((s) => p.createContext(s));
|
|
57
|
+
return function(c) {
|
|
58
|
+
const f = (c == null ? void 0 : c[t]) || r;
|
|
59
|
+
return p.useMemo(
|
|
60
|
+
() => ({ [`__scope${t}`]: { ...c, [t]: f } }),
|
|
61
|
+
[c, f]
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
return i.scopeName = t, [o, Zt(i, ...e)];
|
|
66
|
+
}
|
|
67
|
+
function Zt(...t) {
|
|
68
|
+
const e = t[0];
|
|
69
|
+
if (t.length === 1) return e;
|
|
70
|
+
const n = () => {
|
|
71
|
+
const o = t.map((i) => ({
|
|
72
|
+
useScope: i(),
|
|
73
|
+
scopeName: i.scopeName
|
|
74
|
+
}));
|
|
75
|
+
return function(r) {
|
|
76
|
+
const s = o.reduce((c, { useScope: f, scopeName: l }) => {
|
|
77
|
+
const u = f(r)[`__scope${l}`];
|
|
78
|
+
return { ...c, ...u };
|
|
79
|
+
}, {});
|
|
80
|
+
return p.useMemo(() => ({ [`__scope${e.scopeName}`]: s }), [s]);
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
return n.scopeName = e.scopeName, n;
|
|
84
|
+
}
|
|
85
|
+
function te(t) {
|
|
86
|
+
const e = p.useRef(t);
|
|
87
|
+
return p.useEffect(() => {
|
|
88
|
+
e.current = t;
|
|
89
|
+
}), p.useMemo(() => (...n) => {
|
|
90
|
+
var o;
|
|
91
|
+
return (o = e.current) == null ? void 0 : o.call(e, ...n);
|
|
92
|
+
}, []);
|
|
93
|
+
}
|
|
94
|
+
function on(t, e = globalThis == null ? void 0 : globalThis.document) {
|
|
95
|
+
const n = te(t);
|
|
96
|
+
p.useEffect(() => {
|
|
97
|
+
const o = (i) => {
|
|
98
|
+
i.key === "Escape" && n(i);
|
|
99
|
+
};
|
|
100
|
+
return e.addEventListener("keydown", o, { capture: !0 }), () => e.removeEventListener("keydown", o, { capture: !0 });
|
|
101
|
+
}, [n, e]);
|
|
102
|
+
}
|
|
103
|
+
var et = globalThis != null && globalThis.document ? p.useLayoutEffect : () => {
|
|
104
|
+
}, ee = p[" useId ".trim().toString()] || (() => {
|
|
105
|
+
}), ne = 0;
|
|
106
|
+
function rn(t) {
|
|
107
|
+
const [e, n] = p.useState(ee());
|
|
108
|
+
return et(() => {
|
|
109
|
+
n((o) => o ?? String(ne++));
|
|
110
|
+
}, [t]), e ? `radix-${e}` : "";
|
|
111
|
+
}
|
|
112
|
+
const oe = ["top", "right", "bottom", "left"], K = Math.min, F = Math.max, lt = Math.round, rt = Math.floor, V = (t) => ({
|
|
113
|
+
x: t,
|
|
114
|
+
y: t
|
|
115
|
+
}), ie = {
|
|
116
|
+
left: "right",
|
|
117
|
+
right: "left",
|
|
118
|
+
bottom: "top",
|
|
119
|
+
top: "bottom"
|
|
120
|
+
}, re = {
|
|
121
|
+
start: "end",
|
|
122
|
+
end: "start"
|
|
123
|
+
};
|
|
124
|
+
function wt(t, e, n) {
|
|
125
|
+
return F(t, K(e, n));
|
|
126
|
+
}
|
|
127
|
+
function Y(t, e) {
|
|
128
|
+
return typeof t == "function" ? t(e) : t;
|
|
129
|
+
}
|
|
130
|
+
function q(t) {
|
|
131
|
+
return t.split("-")[0];
|
|
132
|
+
}
|
|
133
|
+
function Z(t) {
|
|
134
|
+
return t.split("-")[1];
|
|
135
|
+
}
|
|
136
|
+
function vt(t) {
|
|
137
|
+
return t === "x" ? "y" : "x";
|
|
138
|
+
}
|
|
139
|
+
function bt(t) {
|
|
140
|
+
return t === "y" ? "height" : "width";
|
|
141
|
+
}
|
|
142
|
+
function j(t) {
|
|
143
|
+
return ["top", "bottom"].includes(q(t)) ? "y" : "x";
|
|
144
|
+
}
|
|
145
|
+
function At(t) {
|
|
146
|
+
return vt(j(t));
|
|
147
|
+
}
|
|
148
|
+
function se(t, e, n) {
|
|
149
|
+
n === void 0 && (n = !1);
|
|
150
|
+
const o = Z(t), i = At(t), r = bt(i);
|
|
151
|
+
let s = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
152
|
+
return e.reference[r] > e.floating[r] && (s = ft(s)), [s, ft(s)];
|
|
153
|
+
}
|
|
154
|
+
function ce(t) {
|
|
155
|
+
const e = ft(t);
|
|
156
|
+
return [xt(t), e, xt(e)];
|
|
157
|
+
}
|
|
158
|
+
function xt(t) {
|
|
159
|
+
return t.replace(/start|end/g, (e) => re[e]);
|
|
160
|
+
}
|
|
161
|
+
function le(t, e, n) {
|
|
162
|
+
const o = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
|
|
163
|
+
switch (t) {
|
|
164
|
+
case "top":
|
|
165
|
+
case "bottom":
|
|
166
|
+
return n ? e ? i : o : e ? o : i;
|
|
167
|
+
case "left":
|
|
168
|
+
case "right":
|
|
169
|
+
return e ? r : s;
|
|
170
|
+
default:
|
|
171
|
+
return [];
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function fe(t, e, n, o) {
|
|
175
|
+
const i = Z(t);
|
|
176
|
+
let r = le(q(t), n === "start", o);
|
|
177
|
+
return i && (r = r.map((s) => s + "-" + i), e && (r = r.concat(r.map(xt)))), r;
|
|
178
|
+
}
|
|
179
|
+
function ft(t) {
|
|
180
|
+
return t.replace(/left|right|bottom|top/g, (e) => ie[e]);
|
|
181
|
+
}
|
|
182
|
+
function ae(t) {
|
|
183
|
+
return {
|
|
184
|
+
top: 0,
|
|
185
|
+
right: 0,
|
|
186
|
+
bottom: 0,
|
|
187
|
+
left: 0,
|
|
188
|
+
...t
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function $t(t) {
|
|
192
|
+
return typeof t != "number" ? ae(t) : {
|
|
193
|
+
top: t,
|
|
194
|
+
right: t,
|
|
195
|
+
bottom: t,
|
|
196
|
+
left: t
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function at(t) {
|
|
200
|
+
const {
|
|
201
|
+
x: e,
|
|
202
|
+
y: n,
|
|
203
|
+
width: o,
|
|
204
|
+
height: i
|
|
205
|
+
} = t;
|
|
206
|
+
return {
|
|
207
|
+
width: o,
|
|
208
|
+
height: i,
|
|
209
|
+
top: n,
|
|
210
|
+
left: e,
|
|
211
|
+
right: e + o,
|
|
212
|
+
bottom: n + i,
|
|
213
|
+
x: e,
|
|
214
|
+
y: n
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function Pt(t, e, n) {
|
|
218
|
+
let {
|
|
219
|
+
reference: o,
|
|
220
|
+
floating: i
|
|
221
|
+
} = t;
|
|
222
|
+
const r = j(e), s = At(e), c = bt(s), f = q(e), l = r === "y", a = o.x + o.width / 2 - i.width / 2, u = o.y + o.height / 2 - i.height / 2, m = o[c] / 2 - i[c] / 2;
|
|
223
|
+
let d;
|
|
224
|
+
switch (f) {
|
|
225
|
+
case "top":
|
|
226
|
+
d = {
|
|
227
|
+
x: a,
|
|
228
|
+
y: o.y - i.height
|
|
229
|
+
};
|
|
230
|
+
break;
|
|
231
|
+
case "bottom":
|
|
232
|
+
d = {
|
|
233
|
+
x: a,
|
|
234
|
+
y: o.y + o.height
|
|
235
|
+
};
|
|
236
|
+
break;
|
|
237
|
+
case "right":
|
|
238
|
+
d = {
|
|
239
|
+
x: o.x + o.width,
|
|
240
|
+
y: u
|
|
241
|
+
};
|
|
242
|
+
break;
|
|
243
|
+
case "left":
|
|
244
|
+
d = {
|
|
245
|
+
x: o.x - i.width,
|
|
246
|
+
y: u
|
|
247
|
+
};
|
|
248
|
+
break;
|
|
249
|
+
default:
|
|
250
|
+
d = {
|
|
251
|
+
x: o.x,
|
|
252
|
+
y: o.y
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
switch (Z(e)) {
|
|
256
|
+
case "start":
|
|
257
|
+
d[s] -= m * (n && l ? -1 : 1);
|
|
258
|
+
break;
|
|
259
|
+
case "end":
|
|
260
|
+
d[s] += m * (n && l ? -1 : 1);
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
return d;
|
|
264
|
+
}
|
|
265
|
+
const ue = async (t, e, n) => {
|
|
266
|
+
const {
|
|
267
|
+
placement: o = "bottom",
|
|
268
|
+
strategy: i = "absolute",
|
|
269
|
+
middleware: r = [],
|
|
270
|
+
platform: s
|
|
271
|
+
} = n, c = r.filter(Boolean), f = await (s.isRTL == null ? void 0 : s.isRTL(e));
|
|
272
|
+
let l = await s.getElementRects({
|
|
273
|
+
reference: t,
|
|
274
|
+
floating: e,
|
|
275
|
+
strategy: i
|
|
276
|
+
}), {
|
|
277
|
+
x: a,
|
|
278
|
+
y: u
|
|
279
|
+
} = Pt(l, o, f), m = o, d = {}, h = 0;
|
|
280
|
+
for (let g = 0; g < c.length; g++) {
|
|
281
|
+
const {
|
|
282
|
+
name: w,
|
|
283
|
+
fn: x
|
|
284
|
+
} = c[g], {
|
|
285
|
+
x: v,
|
|
286
|
+
y: b,
|
|
287
|
+
data: A,
|
|
288
|
+
reset: y
|
|
289
|
+
} = await x({
|
|
290
|
+
x: a,
|
|
291
|
+
y: u,
|
|
292
|
+
initialPlacement: o,
|
|
293
|
+
placement: m,
|
|
294
|
+
strategy: i,
|
|
295
|
+
middlewareData: d,
|
|
296
|
+
rects: l,
|
|
297
|
+
platform: s,
|
|
298
|
+
elements: {
|
|
299
|
+
reference: t,
|
|
300
|
+
floating: e
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
a = v ?? a, u = b ?? u, d = {
|
|
304
|
+
...d,
|
|
305
|
+
[w]: {
|
|
306
|
+
...d[w],
|
|
307
|
+
...A
|
|
308
|
+
}
|
|
309
|
+
}, y && h <= 50 && (h++, typeof y == "object" && (y.placement && (m = y.placement), y.rects && (l = y.rects === !0 ? await s.getElementRects({
|
|
310
|
+
reference: t,
|
|
311
|
+
floating: e,
|
|
312
|
+
strategy: i
|
|
313
|
+
}) : y.rects), {
|
|
314
|
+
x: a,
|
|
315
|
+
y: u
|
|
316
|
+
} = Pt(l, m, f)), g = -1);
|
|
317
|
+
}
|
|
318
|
+
return {
|
|
319
|
+
x: a,
|
|
320
|
+
y: u,
|
|
321
|
+
placement: m,
|
|
322
|
+
strategy: i,
|
|
323
|
+
middlewareData: d
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
async function nt(t, e) {
|
|
327
|
+
var n;
|
|
328
|
+
e === void 0 && (e = {});
|
|
329
|
+
const {
|
|
330
|
+
x: o,
|
|
331
|
+
y: i,
|
|
332
|
+
platform: r,
|
|
333
|
+
rects: s,
|
|
334
|
+
elements: c,
|
|
335
|
+
strategy: f
|
|
336
|
+
} = t, {
|
|
337
|
+
boundary: l = "clippingAncestors",
|
|
338
|
+
rootBoundary: a = "viewport",
|
|
339
|
+
elementContext: u = "floating",
|
|
340
|
+
altBoundary: m = !1,
|
|
341
|
+
padding: d = 0
|
|
342
|
+
} = Y(e, t), h = $t(d), w = c[m ? u === "floating" ? "reference" : "floating" : u], x = at(await r.getClippingRect({
|
|
343
|
+
element: (n = await (r.isElement == null ? void 0 : r.isElement(w))) == null || n ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
|
|
344
|
+
boundary: l,
|
|
345
|
+
rootBoundary: a,
|
|
346
|
+
strategy: f
|
|
347
|
+
})), v = u === "floating" ? {
|
|
348
|
+
x: o,
|
|
349
|
+
y: i,
|
|
350
|
+
width: s.floating.width,
|
|
351
|
+
height: s.floating.height
|
|
352
|
+
} : s.reference, b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c.floating)), A = await (r.isElement == null ? void 0 : r.isElement(b)) ? await (r.getScale == null ? void 0 : r.getScale(b)) || {
|
|
353
|
+
x: 1,
|
|
354
|
+
y: 1
|
|
355
|
+
} : {
|
|
356
|
+
x: 1,
|
|
357
|
+
y: 1
|
|
358
|
+
}, y = at(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
359
|
+
elements: c,
|
|
360
|
+
rect: v,
|
|
361
|
+
offsetParent: b,
|
|
362
|
+
strategy: f
|
|
363
|
+
}) : v);
|
|
364
|
+
return {
|
|
365
|
+
top: (x.top - y.top + h.top) / A.y,
|
|
366
|
+
bottom: (y.bottom - x.bottom + h.bottom) / A.y,
|
|
367
|
+
left: (x.left - y.left + h.left) / A.x,
|
|
368
|
+
right: (y.right - x.right + h.right) / A.x
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
const de = (t) => ({
|
|
372
|
+
name: "arrow",
|
|
373
|
+
options: t,
|
|
374
|
+
async fn(e) {
|
|
375
|
+
const {
|
|
376
|
+
x: n,
|
|
377
|
+
y: o,
|
|
378
|
+
placement: i,
|
|
379
|
+
rects: r,
|
|
380
|
+
platform: s,
|
|
381
|
+
elements: c,
|
|
382
|
+
middlewareData: f
|
|
383
|
+
} = e, {
|
|
384
|
+
element: l,
|
|
385
|
+
padding: a = 0
|
|
386
|
+
} = Y(t, e) || {};
|
|
387
|
+
if (l == null)
|
|
388
|
+
return {};
|
|
389
|
+
const u = $t(a), m = {
|
|
390
|
+
x: n,
|
|
391
|
+
y: o
|
|
392
|
+
}, d = At(i), h = bt(d), g = await s.getDimensions(l), w = d === "y", x = w ? "top" : "left", v = w ? "bottom" : "right", b = w ? "clientHeight" : "clientWidth", A = r.reference[h] + r.reference[d] - m[d] - r.floating[h], y = m[d] - r.reference[d], S = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l));
|
|
393
|
+
let O = S ? S[b] : 0;
|
|
394
|
+
(!O || !await (s.isElement == null ? void 0 : s.isElement(S))) && (O = c.floating[b] || r.floating[h]);
|
|
395
|
+
const T = A / 2 - y / 2, W = O / 2 - g[h] / 2 - 1, C = K(u[x], W), I = K(u[v], W), k = C, L = O - g[h] - I, N = O / 2 - g[h] / 2 + T, D = wt(k, N, L), E = !f.arrow && Z(i) != null && N !== D && r.reference[h] / 2 - (N < k ? C : I) - g[h] / 2 < 0, _ = E ? N < k ? N - k : N - L : 0;
|
|
396
|
+
return {
|
|
397
|
+
[d]: m[d] + _,
|
|
398
|
+
data: {
|
|
399
|
+
[d]: D,
|
|
400
|
+
centerOffset: N - D - _,
|
|
401
|
+
...E && {
|
|
402
|
+
alignmentOffset: _
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
reset: E
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
}), me = function(t) {
|
|
409
|
+
return t === void 0 && (t = {}), {
|
|
410
|
+
name: "flip",
|
|
411
|
+
options: t,
|
|
412
|
+
async fn(e) {
|
|
413
|
+
var n, o;
|
|
414
|
+
const {
|
|
415
|
+
placement: i,
|
|
416
|
+
middlewareData: r,
|
|
417
|
+
rects: s,
|
|
418
|
+
initialPlacement: c,
|
|
419
|
+
platform: f,
|
|
420
|
+
elements: l
|
|
421
|
+
} = e, {
|
|
422
|
+
mainAxis: a = !0,
|
|
423
|
+
crossAxis: u = !0,
|
|
424
|
+
fallbackPlacements: m,
|
|
425
|
+
fallbackStrategy: d = "bestFit",
|
|
426
|
+
fallbackAxisSideDirection: h = "none",
|
|
427
|
+
flipAlignment: g = !0,
|
|
428
|
+
...w
|
|
429
|
+
} = Y(t, e);
|
|
430
|
+
if ((n = r.arrow) != null && n.alignmentOffset)
|
|
431
|
+
return {};
|
|
432
|
+
const x = q(i), v = j(c), b = q(c) === c, A = await (f.isRTL == null ? void 0 : f.isRTL(l.floating)), y = m || (b || !g ? [ft(c)] : ce(c)), S = h !== "none";
|
|
433
|
+
!m && S && y.push(...fe(c, g, h, A));
|
|
434
|
+
const O = [c, ...y], T = await nt(e, w), W = [];
|
|
435
|
+
let C = ((o = r.flip) == null ? void 0 : o.overflows) || [];
|
|
436
|
+
if (a && W.push(T[x]), u) {
|
|
437
|
+
const D = se(i, s, A);
|
|
438
|
+
W.push(T[D[0]], T[D[1]]);
|
|
439
|
+
}
|
|
440
|
+
if (C = [...C, {
|
|
441
|
+
placement: i,
|
|
442
|
+
overflows: W
|
|
443
|
+
}], !W.every((D) => D <= 0)) {
|
|
444
|
+
var I, k;
|
|
445
|
+
const D = (((I = r.flip) == null ? void 0 : I.index) || 0) + 1, E = O[D];
|
|
446
|
+
if (E) {
|
|
447
|
+
var L;
|
|
448
|
+
const R = u === "alignment" ? v !== j(E) : !1, P = ((L = C[0]) == null ? void 0 : L.overflows[0]) > 0;
|
|
449
|
+
if (!R || P)
|
|
450
|
+
return {
|
|
451
|
+
data: {
|
|
452
|
+
index: D,
|
|
453
|
+
overflows: C
|
|
454
|
+
},
|
|
455
|
+
reset: {
|
|
456
|
+
placement: E
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
let _ = (k = C.filter((R) => R.overflows[0] <= 0).sort((R, P) => R.overflows[1] - P.overflows[1])[0]) == null ? void 0 : k.placement;
|
|
461
|
+
if (!_)
|
|
462
|
+
switch (d) {
|
|
463
|
+
case "bestFit": {
|
|
464
|
+
var N;
|
|
465
|
+
const R = (N = C.filter((P) => {
|
|
466
|
+
if (S) {
|
|
467
|
+
const M = j(P.placement);
|
|
468
|
+
return M === v || // Create a bias to the `y` side axis due to horizontal
|
|
469
|
+
// reading directions favoring greater width.
|
|
470
|
+
M === "y";
|
|
471
|
+
}
|
|
472
|
+
return !0;
|
|
473
|
+
}).map((P) => [P.placement, P.overflows.filter((M) => M > 0).reduce((M, Yt) => M + Yt, 0)]).sort((P, M) => P[1] - M[1])[0]) == null ? void 0 : N[0];
|
|
474
|
+
R && (_ = R);
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
case "initialPlacement":
|
|
478
|
+
_ = c;
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
481
|
+
if (i !== _)
|
|
482
|
+
return {
|
|
483
|
+
reset: {
|
|
484
|
+
placement: _
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
return {};
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
function Mt(t, e) {
|
|
493
|
+
return {
|
|
494
|
+
top: t.top - e.height,
|
|
495
|
+
right: t.right - e.width,
|
|
496
|
+
bottom: t.bottom - e.height,
|
|
497
|
+
left: t.left - e.width
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
function Tt(t) {
|
|
501
|
+
return oe.some((e) => t[e] >= 0);
|
|
502
|
+
}
|
|
503
|
+
const he = function(t) {
|
|
504
|
+
return t === void 0 && (t = {}), {
|
|
505
|
+
name: "hide",
|
|
506
|
+
options: t,
|
|
507
|
+
async fn(e) {
|
|
508
|
+
const {
|
|
509
|
+
rects: n
|
|
510
|
+
} = e, {
|
|
511
|
+
strategy: o = "referenceHidden",
|
|
512
|
+
...i
|
|
513
|
+
} = Y(t, e);
|
|
514
|
+
switch (o) {
|
|
515
|
+
case "referenceHidden": {
|
|
516
|
+
const r = await nt(e, {
|
|
517
|
+
...i,
|
|
518
|
+
elementContext: "reference"
|
|
519
|
+
}), s = Mt(r, n.reference);
|
|
520
|
+
return {
|
|
521
|
+
data: {
|
|
522
|
+
referenceHiddenOffsets: s,
|
|
523
|
+
referenceHidden: Tt(s)
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
case "escaped": {
|
|
528
|
+
const r = await nt(e, {
|
|
529
|
+
...i,
|
|
530
|
+
altBoundary: !0
|
|
531
|
+
}), s = Mt(r, n.floating);
|
|
532
|
+
return {
|
|
533
|
+
data: {
|
|
534
|
+
escapedOffsets: s,
|
|
535
|
+
escaped: Tt(s)
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
default:
|
|
540
|
+
return {};
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
};
|
|
545
|
+
async function ge(t, e) {
|
|
546
|
+
const {
|
|
547
|
+
placement: n,
|
|
548
|
+
platform: o,
|
|
549
|
+
elements: i
|
|
550
|
+
} = t, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s = q(n), c = Z(n), f = j(n) === "y", l = ["left", "top"].includes(s) ? -1 : 1, a = r && f ? -1 : 1, u = Y(e, t);
|
|
551
|
+
let {
|
|
552
|
+
mainAxis: m,
|
|
553
|
+
crossAxis: d,
|
|
554
|
+
alignmentAxis: h
|
|
555
|
+
} = typeof u == "number" ? {
|
|
556
|
+
mainAxis: u,
|
|
557
|
+
crossAxis: 0,
|
|
558
|
+
alignmentAxis: null
|
|
559
|
+
} : {
|
|
560
|
+
mainAxis: u.mainAxis || 0,
|
|
561
|
+
crossAxis: u.crossAxis || 0,
|
|
562
|
+
alignmentAxis: u.alignmentAxis
|
|
563
|
+
};
|
|
564
|
+
return c && typeof h == "number" && (d = c === "end" ? h * -1 : h), f ? {
|
|
565
|
+
x: d * a,
|
|
566
|
+
y: m * l
|
|
567
|
+
} : {
|
|
568
|
+
x: m * l,
|
|
569
|
+
y: d * a
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
const pe = function(t) {
|
|
573
|
+
return t === void 0 && (t = 0), {
|
|
574
|
+
name: "offset",
|
|
575
|
+
options: t,
|
|
576
|
+
async fn(e) {
|
|
577
|
+
var n, o;
|
|
578
|
+
const {
|
|
579
|
+
x: i,
|
|
580
|
+
y: r,
|
|
581
|
+
placement: s,
|
|
582
|
+
middlewareData: c
|
|
583
|
+
} = e, f = await ge(e, t);
|
|
584
|
+
return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
|
|
585
|
+
x: i + f.x,
|
|
586
|
+
y: r + f.y,
|
|
587
|
+
data: {
|
|
588
|
+
...f,
|
|
589
|
+
placement: s
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
};
|
|
594
|
+
}, we = function(t) {
|
|
595
|
+
return t === void 0 && (t = {}), {
|
|
596
|
+
name: "shift",
|
|
597
|
+
options: t,
|
|
598
|
+
async fn(e) {
|
|
599
|
+
const {
|
|
600
|
+
x: n,
|
|
601
|
+
y: o,
|
|
602
|
+
placement: i
|
|
603
|
+
} = e, {
|
|
604
|
+
mainAxis: r = !0,
|
|
605
|
+
crossAxis: s = !1,
|
|
606
|
+
limiter: c = {
|
|
607
|
+
fn: (w) => {
|
|
608
|
+
let {
|
|
609
|
+
x,
|
|
610
|
+
y: v
|
|
611
|
+
} = w;
|
|
612
|
+
return {
|
|
613
|
+
x,
|
|
614
|
+
y: v
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
...f
|
|
619
|
+
} = Y(t, e), l = {
|
|
620
|
+
x: n,
|
|
621
|
+
y: o
|
|
622
|
+
}, a = await nt(e, f), u = j(q(i)), m = vt(u);
|
|
623
|
+
let d = l[m], h = l[u];
|
|
624
|
+
if (r) {
|
|
625
|
+
const w = m === "y" ? "top" : "left", x = m === "y" ? "bottom" : "right", v = d + a[w], b = d - a[x];
|
|
626
|
+
d = wt(v, d, b);
|
|
627
|
+
}
|
|
628
|
+
if (s) {
|
|
629
|
+
const w = u === "y" ? "top" : "left", x = u === "y" ? "bottom" : "right", v = h + a[w], b = h - a[x];
|
|
630
|
+
h = wt(v, h, b);
|
|
631
|
+
}
|
|
632
|
+
const g = c.fn({
|
|
633
|
+
...e,
|
|
634
|
+
[m]: d,
|
|
635
|
+
[u]: h
|
|
636
|
+
});
|
|
637
|
+
return {
|
|
638
|
+
...g,
|
|
639
|
+
data: {
|
|
640
|
+
x: g.x - n,
|
|
641
|
+
y: g.y - o,
|
|
642
|
+
enabled: {
|
|
643
|
+
[m]: r,
|
|
644
|
+
[u]: s
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
}, xe = function(t) {
|
|
651
|
+
return t === void 0 && (t = {}), {
|
|
652
|
+
options: t,
|
|
653
|
+
fn(e) {
|
|
654
|
+
const {
|
|
655
|
+
x: n,
|
|
656
|
+
y: o,
|
|
657
|
+
placement: i,
|
|
658
|
+
rects: r,
|
|
659
|
+
middlewareData: s
|
|
660
|
+
} = e, {
|
|
661
|
+
offset: c = 0,
|
|
662
|
+
mainAxis: f = !0,
|
|
663
|
+
crossAxis: l = !0
|
|
664
|
+
} = Y(t, e), a = {
|
|
665
|
+
x: n,
|
|
666
|
+
y: o
|
|
667
|
+
}, u = j(i), m = vt(u);
|
|
668
|
+
let d = a[m], h = a[u];
|
|
669
|
+
const g = Y(c, e), w = typeof g == "number" ? {
|
|
670
|
+
mainAxis: g,
|
|
671
|
+
crossAxis: 0
|
|
672
|
+
} : {
|
|
673
|
+
mainAxis: 0,
|
|
674
|
+
crossAxis: 0,
|
|
675
|
+
...g
|
|
676
|
+
};
|
|
677
|
+
if (f) {
|
|
678
|
+
const b = m === "y" ? "height" : "width", A = r.reference[m] - r.floating[b] + w.mainAxis, y = r.reference[m] + r.reference[b] - w.mainAxis;
|
|
679
|
+
d < A ? d = A : d > y && (d = y);
|
|
680
|
+
}
|
|
681
|
+
if (l) {
|
|
682
|
+
var x, v;
|
|
683
|
+
const b = m === "y" ? "width" : "height", A = ["top", "left"].includes(q(i)), y = r.reference[u] - r.floating[b] + (A && ((x = s.offset) == null ? void 0 : x[u]) || 0) + (A ? 0 : w.crossAxis), S = r.reference[u] + r.reference[b] + (A ? 0 : ((v = s.offset) == null ? void 0 : v[u]) || 0) - (A ? w.crossAxis : 0);
|
|
684
|
+
h < y ? h = y : h > S && (h = S);
|
|
685
|
+
}
|
|
686
|
+
return {
|
|
687
|
+
[m]: d,
|
|
688
|
+
[u]: h
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
}, ye = function(t) {
|
|
693
|
+
return t === void 0 && (t = {}), {
|
|
694
|
+
name: "size",
|
|
695
|
+
options: t,
|
|
696
|
+
async fn(e) {
|
|
697
|
+
var n, o;
|
|
698
|
+
const {
|
|
699
|
+
placement: i,
|
|
700
|
+
rects: r,
|
|
701
|
+
platform: s,
|
|
702
|
+
elements: c
|
|
703
|
+
} = e, {
|
|
704
|
+
apply: f = () => {
|
|
705
|
+
},
|
|
706
|
+
...l
|
|
707
|
+
} = Y(t, e), a = await nt(e, l), u = q(i), m = Z(i), d = j(i) === "y", {
|
|
708
|
+
width: h,
|
|
709
|
+
height: g
|
|
710
|
+
} = r.floating;
|
|
711
|
+
let w, x;
|
|
712
|
+
u === "top" || u === "bottom" ? (w = u, x = m === (await (s.isRTL == null ? void 0 : s.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (x = u, w = m === "end" ? "top" : "bottom");
|
|
713
|
+
const v = g - a.top - a.bottom, b = h - a.left - a.right, A = K(g - a[w], v), y = K(h - a[x], b), S = !e.middlewareData.shift;
|
|
714
|
+
let O = A, T = y;
|
|
715
|
+
if ((n = e.middlewareData.shift) != null && n.enabled.x && (T = b), (o = e.middlewareData.shift) != null && o.enabled.y && (O = v), S && !m) {
|
|
716
|
+
const C = F(a.left, 0), I = F(a.right, 0), k = F(a.top, 0), L = F(a.bottom, 0);
|
|
717
|
+
d ? T = h - 2 * (C !== 0 || I !== 0 ? C + I : F(a.left, a.right)) : O = g - 2 * (k !== 0 || L !== 0 ? k + L : F(a.top, a.bottom));
|
|
718
|
+
}
|
|
719
|
+
await f({
|
|
720
|
+
...e,
|
|
721
|
+
availableWidth: T,
|
|
722
|
+
availableHeight: O
|
|
723
|
+
});
|
|
724
|
+
const W = await s.getDimensions(c.floating);
|
|
725
|
+
return h !== W.width || g !== W.height ? {
|
|
726
|
+
reset: {
|
|
727
|
+
rects: !0
|
|
728
|
+
}
|
|
729
|
+
} : {};
|
|
730
|
+
}
|
|
731
|
+
};
|
|
732
|
+
};
|
|
733
|
+
function dt() {
|
|
734
|
+
return typeof window < "u";
|
|
735
|
+
}
|
|
736
|
+
function tt(t) {
|
|
737
|
+
return Wt(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
738
|
+
}
|
|
739
|
+
function $(t) {
|
|
740
|
+
var e;
|
|
741
|
+
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
742
|
+
}
|
|
743
|
+
function U(t) {
|
|
744
|
+
var e;
|
|
745
|
+
return (e = (Wt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
746
|
+
}
|
|
747
|
+
function Wt(t) {
|
|
748
|
+
return dt() ? t instanceof Node || t instanceof $(t).Node : !1;
|
|
749
|
+
}
|
|
750
|
+
function z(t) {
|
|
751
|
+
return dt() ? t instanceof Element || t instanceof $(t).Element : !1;
|
|
752
|
+
}
|
|
753
|
+
function H(t) {
|
|
754
|
+
return dt() ? t instanceof HTMLElement || t instanceof $(t).HTMLElement : !1;
|
|
755
|
+
}
|
|
756
|
+
function Lt(t) {
|
|
757
|
+
return !dt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof $(t).ShadowRoot;
|
|
758
|
+
}
|
|
759
|
+
function it(t) {
|
|
760
|
+
const {
|
|
761
|
+
overflow: e,
|
|
762
|
+
overflowX: n,
|
|
763
|
+
overflowY: o,
|
|
764
|
+
display: i
|
|
765
|
+
} = B(t);
|
|
766
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !["inline", "contents"].includes(i);
|
|
767
|
+
}
|
|
768
|
+
function ve(t) {
|
|
769
|
+
return ["table", "td", "th"].includes(tt(t));
|
|
770
|
+
}
|
|
771
|
+
function mt(t) {
|
|
772
|
+
return [":popover-open", ":modal"].some((e) => {
|
|
773
|
+
try {
|
|
774
|
+
return t.matches(e);
|
|
775
|
+
} catch {
|
|
776
|
+
return !1;
|
|
777
|
+
}
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
function Rt(t) {
|
|
781
|
+
const e = Ot(), n = z(t) ? B(t) : t;
|
|
782
|
+
return ["transform", "translate", "scale", "rotate", "perspective"].some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
|
|
783
|
+
}
|
|
784
|
+
function be(t) {
|
|
785
|
+
let e = X(t);
|
|
786
|
+
for (; H(e) && !Q(e); ) {
|
|
787
|
+
if (Rt(e))
|
|
788
|
+
return e;
|
|
789
|
+
if (mt(e))
|
|
790
|
+
return null;
|
|
791
|
+
e = X(e);
|
|
792
|
+
}
|
|
793
|
+
return null;
|
|
794
|
+
}
|
|
795
|
+
function Ot() {
|
|
796
|
+
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
797
|
+
}
|
|
798
|
+
function Q(t) {
|
|
799
|
+
return ["html", "body", "#document"].includes(tt(t));
|
|
800
|
+
}
|
|
801
|
+
function B(t) {
|
|
802
|
+
return $(t).getComputedStyle(t);
|
|
803
|
+
}
|
|
804
|
+
function ht(t) {
|
|
805
|
+
return z(t) ? {
|
|
806
|
+
scrollLeft: t.scrollLeft,
|
|
807
|
+
scrollTop: t.scrollTop
|
|
808
|
+
} : {
|
|
809
|
+
scrollLeft: t.scrollX,
|
|
810
|
+
scrollTop: t.scrollY
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
function X(t) {
|
|
814
|
+
if (tt(t) === "html")
|
|
815
|
+
return t;
|
|
816
|
+
const e = (
|
|
817
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
818
|
+
t.assignedSlot || // DOM Element detected.
|
|
819
|
+
t.parentNode || // ShadowRoot detected.
|
|
820
|
+
Lt(t) && t.host || // Fallback.
|
|
821
|
+
U(t)
|
|
822
|
+
);
|
|
823
|
+
return Lt(e) ? e.host : e;
|
|
824
|
+
}
|
|
825
|
+
function It(t) {
|
|
826
|
+
const e = X(t);
|
|
827
|
+
return Q(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : H(e) && it(e) ? e : It(e);
|
|
828
|
+
}
|
|
829
|
+
function ot(t, e, n) {
|
|
830
|
+
var o;
|
|
831
|
+
e === void 0 && (e = []), n === void 0 && (n = !0);
|
|
832
|
+
const i = It(t), r = i === ((o = t.ownerDocument) == null ? void 0 : o.body), s = $(i);
|
|
833
|
+
if (r) {
|
|
834
|
+
const c = yt(s);
|
|
835
|
+
return e.concat(s, s.visualViewport || [], it(i) ? i : [], c && n ? ot(c) : []);
|
|
836
|
+
}
|
|
837
|
+
return e.concat(i, ot(i, [], n));
|
|
838
|
+
}
|
|
839
|
+
function yt(t) {
|
|
840
|
+
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
841
|
+
}
|
|
842
|
+
function _t(t) {
|
|
843
|
+
const e = B(t);
|
|
844
|
+
let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
|
|
845
|
+
const i = H(t), r = i ? t.offsetWidth : n, s = i ? t.offsetHeight : o, c = lt(n) !== r || lt(o) !== s;
|
|
846
|
+
return c && (n = r, o = s), {
|
|
847
|
+
width: n,
|
|
848
|
+
height: o,
|
|
849
|
+
$: c
|
|
850
|
+
};
|
|
851
|
+
}
|
|
852
|
+
function St(t) {
|
|
853
|
+
return z(t) ? t : t.contextElement;
|
|
854
|
+
}
|
|
855
|
+
function J(t) {
|
|
856
|
+
const e = St(t);
|
|
857
|
+
if (!H(e))
|
|
858
|
+
return V(1);
|
|
859
|
+
const n = e.getBoundingClientRect(), {
|
|
860
|
+
width: o,
|
|
861
|
+
height: i,
|
|
862
|
+
$: r
|
|
863
|
+
} = _t(e);
|
|
864
|
+
let s = (r ? lt(n.width) : n.width) / o, c = (r ? lt(n.height) : n.height) / i;
|
|
865
|
+
return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
866
|
+
x: s,
|
|
867
|
+
y: c
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
const Ae = /* @__PURE__ */ V(0);
|
|
871
|
+
function zt(t) {
|
|
872
|
+
const e = $(t);
|
|
873
|
+
return !Ot() || !e.visualViewport ? Ae : {
|
|
874
|
+
x: e.visualViewport.offsetLeft,
|
|
875
|
+
y: e.visualViewport.offsetTop
|
|
876
|
+
};
|
|
877
|
+
}
|
|
878
|
+
function Re(t, e, n) {
|
|
879
|
+
return e === void 0 && (e = !1), !n || e && n !== $(t) ? !1 : e;
|
|
880
|
+
}
|
|
881
|
+
function G(t, e, n, o) {
|
|
882
|
+
e === void 0 && (e = !1), n === void 0 && (n = !1);
|
|
883
|
+
const i = t.getBoundingClientRect(), r = St(t);
|
|
884
|
+
let s = V(1);
|
|
885
|
+
e && (o ? z(o) && (s = J(o)) : s = J(t));
|
|
886
|
+
const c = Re(r, n, o) ? zt(r) : V(0);
|
|
887
|
+
let f = (i.left + c.x) / s.x, l = (i.top + c.y) / s.y, a = i.width / s.x, u = i.height / s.y;
|
|
888
|
+
if (r) {
|
|
889
|
+
const m = $(r), d = o && z(o) ? $(o) : o;
|
|
890
|
+
let h = m, g = yt(h);
|
|
891
|
+
for (; g && o && d !== h; ) {
|
|
892
|
+
const w = J(g), x = g.getBoundingClientRect(), v = B(g), b = x.left + (g.clientLeft + parseFloat(v.paddingLeft)) * w.x, A = x.top + (g.clientTop + parseFloat(v.paddingTop)) * w.y;
|
|
893
|
+
f *= w.x, l *= w.y, a *= w.x, u *= w.y, f += b, l += A, h = $(g), g = yt(h);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
return at({
|
|
897
|
+
width: a,
|
|
898
|
+
height: u,
|
|
899
|
+
x: f,
|
|
900
|
+
y: l
|
|
901
|
+
});
|
|
902
|
+
}
|
|
903
|
+
function Ct(t, e) {
|
|
904
|
+
const n = ht(t).scrollLeft;
|
|
905
|
+
return e ? e.left + n : G(U(t)).left + n;
|
|
906
|
+
}
|
|
907
|
+
function Bt(t, e, n) {
|
|
908
|
+
n === void 0 && (n = !1);
|
|
909
|
+
const o = t.getBoundingClientRect(), i = o.left + e.scrollLeft - (n ? 0 : (
|
|
910
|
+
// RTL <body> scrollbar.
|
|
911
|
+
Ct(t, o)
|
|
912
|
+
)), r = o.top + e.scrollTop;
|
|
913
|
+
return {
|
|
914
|
+
x: i,
|
|
915
|
+
y: r
|
|
916
|
+
};
|
|
917
|
+
}
|
|
918
|
+
function Oe(t) {
|
|
919
|
+
let {
|
|
920
|
+
elements: e,
|
|
921
|
+
rect: n,
|
|
922
|
+
offsetParent: o,
|
|
923
|
+
strategy: i
|
|
924
|
+
} = t;
|
|
925
|
+
const r = i === "fixed", s = U(o), c = e ? mt(e.floating) : !1;
|
|
926
|
+
if (o === s || c && r)
|
|
927
|
+
return n;
|
|
928
|
+
let f = {
|
|
929
|
+
scrollLeft: 0,
|
|
930
|
+
scrollTop: 0
|
|
931
|
+
}, l = V(1);
|
|
932
|
+
const a = V(0), u = H(o);
|
|
933
|
+
if ((u || !u && !r) && ((tt(o) !== "body" || it(s)) && (f = ht(o)), H(o))) {
|
|
934
|
+
const d = G(o);
|
|
935
|
+
l = J(o), a.x = d.x + o.clientLeft, a.y = d.y + o.clientTop;
|
|
936
|
+
}
|
|
937
|
+
const m = s && !u && !r ? Bt(s, f, !0) : V(0);
|
|
938
|
+
return {
|
|
939
|
+
width: n.width * l.x,
|
|
940
|
+
height: n.height * l.y,
|
|
941
|
+
x: n.x * l.x - f.scrollLeft * l.x + a.x + m.x,
|
|
942
|
+
y: n.y * l.y - f.scrollTop * l.y + a.y + m.y
|
|
943
|
+
};
|
|
944
|
+
}
|
|
945
|
+
function Se(t) {
|
|
946
|
+
return Array.from(t.getClientRects());
|
|
947
|
+
}
|
|
948
|
+
function Ce(t) {
|
|
949
|
+
const e = U(t), n = ht(t), o = t.ownerDocument.body, i = F(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), r = F(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
|
|
950
|
+
let s = -n.scrollLeft + Ct(t);
|
|
951
|
+
const c = -n.scrollTop;
|
|
952
|
+
return B(o).direction === "rtl" && (s += F(e.clientWidth, o.clientWidth) - i), {
|
|
953
|
+
width: i,
|
|
954
|
+
height: r,
|
|
955
|
+
x: s,
|
|
956
|
+
y: c
|
|
957
|
+
};
|
|
958
|
+
}
|
|
959
|
+
function Ee(t, e) {
|
|
960
|
+
const n = $(t), o = U(t), i = n.visualViewport;
|
|
961
|
+
let r = o.clientWidth, s = o.clientHeight, c = 0, f = 0;
|
|
962
|
+
if (i) {
|
|
963
|
+
r = i.width, s = i.height;
|
|
964
|
+
const l = Ot();
|
|
965
|
+
(!l || l && e === "fixed") && (c = i.offsetLeft, f = i.offsetTop);
|
|
966
|
+
}
|
|
967
|
+
return {
|
|
968
|
+
width: r,
|
|
969
|
+
height: s,
|
|
970
|
+
x: c,
|
|
971
|
+
y: f
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
function Pe(t, e) {
|
|
975
|
+
const n = G(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, r = H(t) ? J(t) : V(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, f = i * r.x, l = o * r.y;
|
|
976
|
+
return {
|
|
977
|
+
width: s,
|
|
978
|
+
height: c,
|
|
979
|
+
x: f,
|
|
980
|
+
y: l
|
|
981
|
+
};
|
|
982
|
+
}
|
|
983
|
+
function Nt(t, e, n) {
|
|
984
|
+
let o;
|
|
985
|
+
if (e === "viewport")
|
|
986
|
+
o = Ee(t, n);
|
|
987
|
+
else if (e === "document")
|
|
988
|
+
o = Ce(U(t));
|
|
989
|
+
else if (z(e))
|
|
990
|
+
o = Pe(e, n);
|
|
991
|
+
else {
|
|
992
|
+
const i = zt(t);
|
|
993
|
+
o = {
|
|
994
|
+
x: e.x - i.x,
|
|
995
|
+
y: e.y - i.y,
|
|
996
|
+
width: e.width,
|
|
997
|
+
height: e.height
|
|
998
|
+
};
|
|
999
|
+
}
|
|
1000
|
+
return at(o);
|
|
1001
|
+
}
|
|
1002
|
+
function Vt(t, e) {
|
|
1003
|
+
const n = X(t);
|
|
1004
|
+
return n === e || !z(n) || Q(n) ? !1 : B(n).position === "fixed" || Vt(n, e);
|
|
1005
|
+
}
|
|
1006
|
+
function Me(t, e) {
|
|
1007
|
+
const n = e.get(t);
|
|
1008
|
+
if (n)
|
|
1009
|
+
return n;
|
|
1010
|
+
let o = ot(t, [], !1).filter((c) => z(c) && tt(c) !== "body"), i = null;
|
|
1011
|
+
const r = B(t).position === "fixed";
|
|
1012
|
+
let s = r ? X(t) : t;
|
|
1013
|
+
for (; z(s) && !Q(s); ) {
|
|
1014
|
+
const c = B(s), f = Rt(s);
|
|
1015
|
+
!f && c.position === "fixed" && (i = null), (r ? !f && !i : !f && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || it(s) && !f && Vt(t, s)) ? o = o.filter((a) => a !== s) : i = c, s = X(s);
|
|
1016
|
+
}
|
|
1017
|
+
return e.set(t, o), o;
|
|
1018
|
+
}
|
|
1019
|
+
function Te(t) {
|
|
1020
|
+
let {
|
|
1021
|
+
element: e,
|
|
1022
|
+
boundary: n,
|
|
1023
|
+
rootBoundary: o,
|
|
1024
|
+
strategy: i
|
|
1025
|
+
} = t;
|
|
1026
|
+
const s = [...n === "clippingAncestors" ? mt(e) ? [] : Me(e, this._c) : [].concat(n), o], c = s[0], f = s.reduce((l, a) => {
|
|
1027
|
+
const u = Nt(e, a, i);
|
|
1028
|
+
return l.top = F(u.top, l.top), l.right = K(u.right, l.right), l.bottom = K(u.bottom, l.bottom), l.left = F(u.left, l.left), l;
|
|
1029
|
+
}, Nt(e, c, i));
|
|
1030
|
+
return {
|
|
1031
|
+
width: f.right - f.left,
|
|
1032
|
+
height: f.bottom - f.top,
|
|
1033
|
+
x: f.left,
|
|
1034
|
+
y: f.top
|
|
1035
|
+
};
|
|
1036
|
+
}
|
|
1037
|
+
function Le(t) {
|
|
1038
|
+
const {
|
|
1039
|
+
width: e,
|
|
1040
|
+
height: n
|
|
1041
|
+
} = _t(t);
|
|
1042
|
+
return {
|
|
1043
|
+
width: e,
|
|
1044
|
+
height: n
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
function Ne(t, e, n) {
|
|
1048
|
+
const o = H(e), i = U(e), r = n === "fixed", s = G(t, !0, r, e);
|
|
1049
|
+
let c = {
|
|
1050
|
+
scrollLeft: 0,
|
|
1051
|
+
scrollTop: 0
|
|
1052
|
+
};
|
|
1053
|
+
const f = V(0);
|
|
1054
|
+
function l() {
|
|
1055
|
+
f.x = Ct(i);
|
|
1056
|
+
}
|
|
1057
|
+
if (o || !o && !r)
|
|
1058
|
+
if ((tt(e) !== "body" || it(i)) && (c = ht(e)), o) {
|
|
1059
|
+
const d = G(e, !0, r, e);
|
|
1060
|
+
f.x = d.x + e.clientLeft, f.y = d.y + e.clientTop;
|
|
1061
|
+
} else i && l();
|
|
1062
|
+
r && !o && i && l();
|
|
1063
|
+
const a = i && !o && !r ? Bt(i, c) : V(0), u = s.left + c.scrollLeft - f.x - a.x, m = s.top + c.scrollTop - f.y - a.y;
|
|
1064
|
+
return {
|
|
1065
|
+
x: u,
|
|
1066
|
+
y: m,
|
|
1067
|
+
width: s.width,
|
|
1068
|
+
height: s.height
|
|
1069
|
+
};
|
|
1070
|
+
}
|
|
1071
|
+
function gt(t) {
|
|
1072
|
+
return B(t).position === "static";
|
|
1073
|
+
}
|
|
1074
|
+
function Dt(t, e) {
|
|
1075
|
+
if (!H(t) || B(t).position === "fixed")
|
|
1076
|
+
return null;
|
|
1077
|
+
if (e)
|
|
1078
|
+
return e(t);
|
|
1079
|
+
let n = t.offsetParent;
|
|
1080
|
+
return U(t) === n && (n = n.ownerDocument.body), n;
|
|
1081
|
+
}
|
|
1082
|
+
function Ht(t, e) {
|
|
1083
|
+
const n = $(t);
|
|
1084
|
+
if (mt(t))
|
|
1085
|
+
return n;
|
|
1086
|
+
if (!H(t)) {
|
|
1087
|
+
let i = X(t);
|
|
1088
|
+
for (; i && !Q(i); ) {
|
|
1089
|
+
if (z(i) && !gt(i))
|
|
1090
|
+
return i;
|
|
1091
|
+
i = X(i);
|
|
1092
|
+
}
|
|
1093
|
+
return n;
|
|
1094
|
+
}
|
|
1095
|
+
let o = Dt(t, e);
|
|
1096
|
+
for (; o && ve(o) && gt(o); )
|
|
1097
|
+
o = Dt(o, e);
|
|
1098
|
+
return o && Q(o) && gt(o) && !Rt(o) ? n : o || be(t) || n;
|
|
1099
|
+
}
|
|
1100
|
+
const De = async function(t) {
|
|
1101
|
+
const e = this.getOffsetParent || Ht, n = this.getDimensions, o = await n(t.floating);
|
|
1102
|
+
return {
|
|
1103
|
+
reference: Ne(t.reference, await e(t.floating), t.strategy),
|
|
1104
|
+
floating: {
|
|
1105
|
+
x: 0,
|
|
1106
|
+
y: 0,
|
|
1107
|
+
width: o.width,
|
|
1108
|
+
height: o.height
|
|
1109
|
+
}
|
|
1110
|
+
};
|
|
1111
|
+
};
|
|
1112
|
+
function ke(t) {
|
|
1113
|
+
return B(t).direction === "rtl";
|
|
1114
|
+
}
|
|
1115
|
+
const Fe = {
|
|
1116
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Oe,
|
|
1117
|
+
getDocumentElement: U,
|
|
1118
|
+
getClippingRect: Te,
|
|
1119
|
+
getOffsetParent: Ht,
|
|
1120
|
+
getElementRects: De,
|
|
1121
|
+
getClientRects: Se,
|
|
1122
|
+
getDimensions: Le,
|
|
1123
|
+
getScale: J,
|
|
1124
|
+
isElement: z,
|
|
1125
|
+
isRTL: ke
|
|
1126
|
+
};
|
|
1127
|
+
function Ut(t, e) {
|
|
1128
|
+
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
|
|
1129
|
+
}
|
|
1130
|
+
function $e(t, e) {
|
|
1131
|
+
let n = null, o;
|
|
1132
|
+
const i = U(t);
|
|
1133
|
+
function r() {
|
|
1134
|
+
var c;
|
|
1135
|
+
clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
|
|
1136
|
+
}
|
|
1137
|
+
function s(c, f) {
|
|
1138
|
+
c === void 0 && (c = !1), f === void 0 && (f = 1), r();
|
|
1139
|
+
const l = t.getBoundingClientRect(), {
|
|
1140
|
+
left: a,
|
|
1141
|
+
top: u,
|
|
1142
|
+
width: m,
|
|
1143
|
+
height: d
|
|
1144
|
+
} = l;
|
|
1145
|
+
if (c || e(), !m || !d)
|
|
1146
|
+
return;
|
|
1147
|
+
const h = rt(u), g = rt(i.clientWidth - (a + m)), w = rt(i.clientHeight - (u + d)), x = rt(a), b = {
|
|
1148
|
+
rootMargin: -h + "px " + -g + "px " + -w + "px " + -x + "px",
|
|
1149
|
+
threshold: F(0, K(1, f)) || 1
|
|
1150
|
+
};
|
|
1151
|
+
let A = !0;
|
|
1152
|
+
function y(S) {
|
|
1153
|
+
const O = S[0].intersectionRatio;
|
|
1154
|
+
if (O !== f) {
|
|
1155
|
+
if (!A)
|
|
1156
|
+
return s();
|
|
1157
|
+
O ? s(!1, O) : o = setTimeout(() => {
|
|
1158
|
+
s(!1, 1e-7);
|
|
1159
|
+
}, 1e3);
|
|
1160
|
+
}
|
|
1161
|
+
O === 1 && !Ut(l, t.getBoundingClientRect()) && s(), A = !1;
|
|
1162
|
+
}
|
|
1163
|
+
try {
|
|
1164
|
+
n = new IntersectionObserver(y, {
|
|
1165
|
+
...b,
|
|
1166
|
+
// Handle <iframe>s
|
|
1167
|
+
root: i.ownerDocument
|
|
1168
|
+
});
|
|
1169
|
+
} catch {
|
|
1170
|
+
n = new IntersectionObserver(y, b);
|
|
1171
|
+
}
|
|
1172
|
+
n.observe(t);
|
|
1173
|
+
}
|
|
1174
|
+
return s(!0), r;
|
|
1175
|
+
}
|
|
1176
|
+
function sn(t, e, n, o) {
|
|
1177
|
+
o === void 0 && (o = {});
|
|
1178
|
+
const {
|
|
1179
|
+
ancestorScroll: i = !0,
|
|
1180
|
+
ancestorResize: r = !0,
|
|
1181
|
+
elementResize: s = typeof ResizeObserver == "function",
|
|
1182
|
+
layoutShift: c = typeof IntersectionObserver == "function",
|
|
1183
|
+
animationFrame: f = !1
|
|
1184
|
+
} = o, l = St(t), a = i || r ? [...l ? ot(l) : [], ...ot(e)] : [];
|
|
1185
|
+
a.forEach((x) => {
|
|
1186
|
+
i && x.addEventListener("scroll", n, {
|
|
1187
|
+
passive: !0
|
|
1188
|
+
}), r && x.addEventListener("resize", n);
|
|
1189
|
+
});
|
|
1190
|
+
const u = l && c ? $e(l, n) : null;
|
|
1191
|
+
let m = -1, d = null;
|
|
1192
|
+
s && (d = new ResizeObserver((x) => {
|
|
1193
|
+
let [v] = x;
|
|
1194
|
+
v && v.target === l && d && (d.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
|
|
1195
|
+
var b;
|
|
1196
|
+
(b = d) == null || b.observe(e);
|
|
1197
|
+
})), n();
|
|
1198
|
+
}), l && !f && d.observe(l), d.observe(e));
|
|
1199
|
+
let h, g = f ? G(t) : null;
|
|
1200
|
+
f && w();
|
|
1201
|
+
function w() {
|
|
1202
|
+
const x = G(t);
|
|
1203
|
+
g && !Ut(g, x) && n(), g = x, h = requestAnimationFrame(w);
|
|
1204
|
+
}
|
|
1205
|
+
return n(), () => {
|
|
1206
|
+
var x;
|
|
1207
|
+
a.forEach((v) => {
|
|
1208
|
+
i && v.removeEventListener("scroll", n), r && v.removeEventListener("resize", n);
|
|
1209
|
+
}), u == null || u(), (x = d) == null || x.disconnect(), d = null, f && cancelAnimationFrame(h);
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
const We = pe, Ie = we, _e = me, ze = ye, Be = he, kt = de, Ve = xe, He = (t, e, n) => {
|
|
1213
|
+
const o = /* @__PURE__ */ new Map(), i = {
|
|
1214
|
+
platform: Fe,
|
|
1215
|
+
...n
|
|
1216
|
+
}, r = {
|
|
1217
|
+
...i.platform,
|
|
1218
|
+
_c: o
|
|
1219
|
+
};
|
|
1220
|
+
return ue(t, e, {
|
|
1221
|
+
...i,
|
|
1222
|
+
platform: r
|
|
1223
|
+
});
|
|
1224
|
+
};
|
|
1225
|
+
var ct = typeof document < "u" ? qt : Kt;
|
|
1226
|
+
function ut(t, e) {
|
|
1227
|
+
if (t === e)
|
|
1228
|
+
return !0;
|
|
1229
|
+
if (typeof t != typeof e)
|
|
1230
|
+
return !1;
|
|
1231
|
+
if (typeof t == "function" && t.toString() === e.toString())
|
|
1232
|
+
return !0;
|
|
1233
|
+
let n, o, i;
|
|
1234
|
+
if (t && e && typeof t == "object") {
|
|
1235
|
+
if (Array.isArray(t)) {
|
|
1236
|
+
if (n = t.length, n !== e.length) return !1;
|
|
1237
|
+
for (o = n; o-- !== 0; )
|
|
1238
|
+
if (!ut(t[o], e[o]))
|
|
1239
|
+
return !1;
|
|
1240
|
+
return !0;
|
|
1241
|
+
}
|
|
1242
|
+
if (i = Object.keys(t), n = i.length, n !== Object.keys(e).length)
|
|
1243
|
+
return !1;
|
|
1244
|
+
for (o = n; o-- !== 0; )
|
|
1245
|
+
if (!{}.hasOwnProperty.call(e, i[o]))
|
|
1246
|
+
return !1;
|
|
1247
|
+
for (o = n; o-- !== 0; ) {
|
|
1248
|
+
const r = i[o];
|
|
1249
|
+
if (!(r === "_owner" && t.$$typeof) && !ut(t[r], e[r]))
|
|
1250
|
+
return !1;
|
|
1251
|
+
}
|
|
1252
|
+
return !0;
|
|
1253
|
+
}
|
|
1254
|
+
return t !== t && e !== e;
|
|
1255
|
+
}
|
|
1256
|
+
function jt(t) {
|
|
1257
|
+
return typeof window > "u" ? 1 : (t.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1258
|
+
}
|
|
1259
|
+
function Ft(t, e) {
|
|
1260
|
+
const n = jt(t);
|
|
1261
|
+
return Math.round(e * n) / n;
|
|
1262
|
+
}
|
|
1263
|
+
function pt(t) {
|
|
1264
|
+
const e = p.useRef(t);
|
|
1265
|
+
return ct(() => {
|
|
1266
|
+
e.current = t;
|
|
1267
|
+
}), e;
|
|
1268
|
+
}
|
|
1269
|
+
function cn(t) {
|
|
1270
|
+
t === void 0 && (t = {});
|
|
1271
|
+
const {
|
|
1272
|
+
placement: e = "bottom",
|
|
1273
|
+
strategy: n = "absolute",
|
|
1274
|
+
middleware: o = [],
|
|
1275
|
+
platform: i,
|
|
1276
|
+
elements: {
|
|
1277
|
+
reference: r,
|
|
1278
|
+
floating: s
|
|
1279
|
+
} = {},
|
|
1280
|
+
transform: c = !0,
|
|
1281
|
+
whileElementsMounted: f,
|
|
1282
|
+
open: l
|
|
1283
|
+
} = t, [a, u] = p.useState({
|
|
1284
|
+
x: 0,
|
|
1285
|
+
y: 0,
|
|
1286
|
+
strategy: n,
|
|
1287
|
+
placement: e,
|
|
1288
|
+
middlewareData: {},
|
|
1289
|
+
isPositioned: !1
|
|
1290
|
+
}), [m, d] = p.useState(o);
|
|
1291
|
+
ut(m, o) || d(o);
|
|
1292
|
+
const [h, g] = p.useState(null), [w, x] = p.useState(null), v = p.useCallback((R) => {
|
|
1293
|
+
R !== S.current && (S.current = R, g(R));
|
|
1294
|
+
}, []), b = p.useCallback((R) => {
|
|
1295
|
+
R !== O.current && (O.current = R, x(R));
|
|
1296
|
+
}, []), A = r || h, y = s || w, S = p.useRef(null), O = p.useRef(null), T = p.useRef(a), W = f != null, C = pt(f), I = pt(i), k = pt(l), L = p.useCallback(() => {
|
|
1297
|
+
if (!S.current || !O.current)
|
|
1298
|
+
return;
|
|
1299
|
+
const R = {
|
|
1300
|
+
placement: e,
|
|
1301
|
+
strategy: n,
|
|
1302
|
+
middleware: m
|
|
1303
|
+
};
|
|
1304
|
+
I.current && (R.platform = I.current), He(S.current, O.current, R).then((P) => {
|
|
1305
|
+
const M = {
|
|
1306
|
+
...P,
|
|
1307
|
+
// The floating element's position may be recomputed while it's closed
|
|
1308
|
+
// but still mounted (such as when transitioning out). To ensure
|
|
1309
|
+
// `isPositioned` will be `false` initially on the next open, avoid
|
|
1310
|
+
// setting it to `true` when `open === false` (must be specified).
|
|
1311
|
+
isPositioned: k.current !== !1
|
|
1312
|
+
};
|
|
1313
|
+
N.current && !ut(T.current, M) && (T.current = M, Gt.flushSync(() => {
|
|
1314
|
+
u(M);
|
|
1315
|
+
}));
|
|
1316
|
+
});
|
|
1317
|
+
}, [m, e, n, I, k]);
|
|
1318
|
+
ct(() => {
|
|
1319
|
+
l === !1 && T.current.isPositioned && (T.current.isPositioned = !1, u((R) => ({
|
|
1320
|
+
...R,
|
|
1321
|
+
isPositioned: !1
|
|
1322
|
+
})));
|
|
1323
|
+
}, [l]);
|
|
1324
|
+
const N = p.useRef(!1);
|
|
1325
|
+
ct(() => (N.current = !0, () => {
|
|
1326
|
+
N.current = !1;
|
|
1327
|
+
}), []), ct(() => {
|
|
1328
|
+
if (A && (S.current = A), y && (O.current = y), A && y) {
|
|
1329
|
+
if (C.current)
|
|
1330
|
+
return C.current(A, y, L);
|
|
1331
|
+
L();
|
|
1332
|
+
}
|
|
1333
|
+
}, [A, y, L, C, W]);
|
|
1334
|
+
const D = p.useMemo(() => ({
|
|
1335
|
+
reference: S,
|
|
1336
|
+
floating: O,
|
|
1337
|
+
setReference: v,
|
|
1338
|
+
setFloating: b
|
|
1339
|
+
}), [v, b]), E = p.useMemo(() => ({
|
|
1340
|
+
reference: A,
|
|
1341
|
+
floating: y
|
|
1342
|
+
}), [A, y]), _ = p.useMemo(() => {
|
|
1343
|
+
const R = {
|
|
1344
|
+
position: n,
|
|
1345
|
+
left: 0,
|
|
1346
|
+
top: 0
|
|
1347
|
+
};
|
|
1348
|
+
if (!E.floating)
|
|
1349
|
+
return R;
|
|
1350
|
+
const P = Ft(E.floating, a.x), M = Ft(E.floating, a.y);
|
|
1351
|
+
return c ? {
|
|
1352
|
+
...R,
|
|
1353
|
+
transform: "translate(" + P + "px, " + M + "px)",
|
|
1354
|
+
...jt(E.floating) >= 1.5 && {
|
|
1355
|
+
willChange: "transform"
|
|
1356
|
+
}
|
|
1357
|
+
} : {
|
|
1358
|
+
position: n,
|
|
1359
|
+
left: P,
|
|
1360
|
+
top: M
|
|
1361
|
+
};
|
|
1362
|
+
}, [n, c, E.floating, a.x, a.y]);
|
|
1363
|
+
return p.useMemo(() => ({
|
|
1364
|
+
...a,
|
|
1365
|
+
update: L,
|
|
1366
|
+
refs: D,
|
|
1367
|
+
elements: E,
|
|
1368
|
+
floatingStyles: _
|
|
1369
|
+
}), [a, L, D, E, _]);
|
|
1370
|
+
}
|
|
1371
|
+
const Ue = (t) => {
|
|
1372
|
+
function e(n) {
|
|
1373
|
+
return {}.hasOwnProperty.call(n, "current");
|
|
1374
|
+
}
|
|
1375
|
+
return {
|
|
1376
|
+
name: "arrow",
|
|
1377
|
+
options: t,
|
|
1378
|
+
fn(n) {
|
|
1379
|
+
const {
|
|
1380
|
+
element: o,
|
|
1381
|
+
padding: i
|
|
1382
|
+
} = typeof t == "function" ? t(n) : t;
|
|
1383
|
+
return o && e(o) ? o.current != null ? kt({
|
|
1384
|
+
element: o.current,
|
|
1385
|
+
padding: i
|
|
1386
|
+
}).fn(n) : {} : o ? kt({
|
|
1387
|
+
element: o,
|
|
1388
|
+
padding: i
|
|
1389
|
+
}).fn(n) : {};
|
|
1390
|
+
}
|
|
1391
|
+
};
|
|
1392
|
+
}, ln = (t, e) => ({
|
|
1393
|
+
...We(t),
|
|
1394
|
+
options: [t, e]
|
|
1395
|
+
}), fn = (t, e) => ({
|
|
1396
|
+
...Ie(t),
|
|
1397
|
+
options: [t, e]
|
|
1398
|
+
}), an = (t, e) => ({
|
|
1399
|
+
...Ve(t),
|
|
1400
|
+
options: [t, e]
|
|
1401
|
+
}), un = (t, e) => ({
|
|
1402
|
+
..._e(t),
|
|
1403
|
+
options: [t, e]
|
|
1404
|
+
}), dn = (t, e) => ({
|
|
1405
|
+
...ze(t),
|
|
1406
|
+
options: [t, e]
|
|
1407
|
+
}), mn = (t, e) => ({
|
|
1408
|
+
...Be(t),
|
|
1409
|
+
options: [t, e]
|
|
1410
|
+
}), hn = (t, e) => ({
|
|
1411
|
+
...Ue(t),
|
|
1412
|
+
options: [t, e]
|
|
1413
|
+
});
|
|
1414
|
+
function gn(t) {
|
|
1415
|
+
const [e, n] = p.useState(void 0);
|
|
1416
|
+
return et(() => {
|
|
1417
|
+
if (t) {
|
|
1418
|
+
n({ width: t.offsetWidth, height: t.offsetHeight });
|
|
1419
|
+
const o = new ResizeObserver((i) => {
|
|
1420
|
+
if (!Array.isArray(i) || !i.length)
|
|
1421
|
+
return;
|
|
1422
|
+
const r = i[0];
|
|
1423
|
+
let s, c;
|
|
1424
|
+
if ("borderBoxSize" in r) {
|
|
1425
|
+
const f = r.borderBoxSize, l = Array.isArray(f) ? f[0] : f;
|
|
1426
|
+
s = l.inlineSize, c = l.blockSize;
|
|
1427
|
+
} else
|
|
1428
|
+
s = t.offsetWidth, c = t.offsetHeight;
|
|
1429
|
+
n({ width: s, height: c });
|
|
1430
|
+
});
|
|
1431
|
+
return o.observe(t, { box: "border-box" }), () => o.unobserve(t);
|
|
1432
|
+
} else
|
|
1433
|
+
n(void 0);
|
|
1434
|
+
}, [t]), e;
|
|
1435
|
+
}
|
|
1436
|
+
function je(t, e) {
|
|
1437
|
+
return p.useReducer((n, o) => e[n][o] ?? n, t);
|
|
1438
|
+
}
|
|
1439
|
+
var Ye = (t) => {
|
|
1440
|
+
const { present: e, children: n } = t, o = qe(e), i = typeof n == "function" ? n({ present: o.isPresent }) : p.Children.only(n), r = Qt(o.ref, Ke(i));
|
|
1441
|
+
return typeof n == "function" || o.isPresent ? p.cloneElement(i, { ref: r }) : null;
|
|
1442
|
+
};
|
|
1443
|
+
Ye.displayName = "Presence";
|
|
1444
|
+
function qe(t) {
|
|
1445
|
+
const [e, n] = p.useState(), o = p.useRef(null), i = p.useRef(t), r = p.useRef("none"), s = t ? "mounted" : "unmounted", [c, f] = je(s, {
|
|
1446
|
+
mounted: {
|
|
1447
|
+
UNMOUNT: "unmounted",
|
|
1448
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
1449
|
+
},
|
|
1450
|
+
unmountSuspended: {
|
|
1451
|
+
MOUNT: "mounted",
|
|
1452
|
+
ANIMATION_END: "unmounted"
|
|
1453
|
+
},
|
|
1454
|
+
unmounted: {
|
|
1455
|
+
MOUNT: "mounted"
|
|
1456
|
+
}
|
|
1457
|
+
});
|
|
1458
|
+
return p.useEffect(() => {
|
|
1459
|
+
const l = st(o.current);
|
|
1460
|
+
r.current = c === "mounted" ? l : "none";
|
|
1461
|
+
}, [c]), et(() => {
|
|
1462
|
+
const l = o.current, a = i.current;
|
|
1463
|
+
if (a !== t) {
|
|
1464
|
+
const m = r.current, d = st(l);
|
|
1465
|
+
t ? f("MOUNT") : d === "none" || (l == null ? void 0 : l.display) === "none" ? f("UNMOUNT") : f(a && m !== d ? "ANIMATION_OUT" : "UNMOUNT"), i.current = t;
|
|
1466
|
+
}
|
|
1467
|
+
}, [t, f]), et(() => {
|
|
1468
|
+
if (e) {
|
|
1469
|
+
let l;
|
|
1470
|
+
const a = e.ownerDocument.defaultView ?? window, u = (d) => {
|
|
1471
|
+
const g = st(o.current).includes(d.animationName);
|
|
1472
|
+
if (d.target === e && g && (f("ANIMATION_END"), !i.current)) {
|
|
1473
|
+
const w = e.style.animationFillMode;
|
|
1474
|
+
e.style.animationFillMode = "forwards", l = a.setTimeout(() => {
|
|
1475
|
+
e.style.animationFillMode === "forwards" && (e.style.animationFillMode = w);
|
|
1476
|
+
});
|
|
1477
|
+
}
|
|
1478
|
+
}, m = (d) => {
|
|
1479
|
+
d.target === e && (r.current = st(o.current));
|
|
1480
|
+
};
|
|
1481
|
+
return e.addEventListener("animationstart", m), e.addEventListener("animationcancel", u), e.addEventListener("animationend", u), () => {
|
|
1482
|
+
a.clearTimeout(l), e.removeEventListener("animationstart", m), e.removeEventListener("animationcancel", u), e.removeEventListener("animationend", u);
|
|
1483
|
+
};
|
|
1484
|
+
} else
|
|
1485
|
+
f("ANIMATION_END");
|
|
1486
|
+
}, [e, f]), {
|
|
1487
|
+
isPresent: ["mounted", "unmountSuspended"].includes(c),
|
|
1488
|
+
ref: p.useCallback((l) => {
|
|
1489
|
+
o.current = l ? getComputedStyle(l) : null, n(l);
|
|
1490
|
+
}, [])
|
|
1491
|
+
};
|
|
1492
|
+
}
|
|
1493
|
+
function st(t) {
|
|
1494
|
+
return (t == null ? void 0 : t.animationName) || "none";
|
|
1495
|
+
}
|
|
1496
|
+
function Ke(t) {
|
|
1497
|
+
var o, i;
|
|
1498
|
+
let e = (o = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : o.get, n = e && "isReactWarning" in e && e.isReactWarning;
|
|
1499
|
+
return n ? t.ref : (e = (i = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : i.get, n = e && "isReactWarning" in e && e.isReactWarning, n ? t.props.ref : t.props.ref || t.ref);
|
|
1500
|
+
}
|
|
1501
|
+
var Xe = p[" useInsertionEffect ".trim().toString()] || et;
|
|
1502
|
+
function pn({
|
|
1503
|
+
prop: t,
|
|
1504
|
+
defaultProp: e,
|
|
1505
|
+
onChange: n = () => {
|
|
1506
|
+
},
|
|
1507
|
+
caller: o
|
|
1508
|
+
}) {
|
|
1509
|
+
const [i, r, s] = Ge({
|
|
1510
|
+
defaultProp: e,
|
|
1511
|
+
onChange: n
|
|
1512
|
+
}), c = t !== void 0, f = c ? t : i;
|
|
1513
|
+
{
|
|
1514
|
+
const a = p.useRef(t !== void 0);
|
|
1515
|
+
p.useEffect(() => {
|
|
1516
|
+
const u = a.current;
|
|
1517
|
+
u !== c && console.warn(
|
|
1518
|
+
`${o} is changing from ${u ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
1519
|
+
), a.current = c;
|
|
1520
|
+
}, [c, o]);
|
|
1521
|
+
}
|
|
1522
|
+
const l = p.useCallback(
|
|
1523
|
+
(a) => {
|
|
1524
|
+
var u;
|
|
1525
|
+
if (c) {
|
|
1526
|
+
const m = Je(a) ? a(t) : a;
|
|
1527
|
+
m !== t && ((u = s.current) == null || u.call(s, m));
|
|
1528
|
+
} else
|
|
1529
|
+
r(a);
|
|
1530
|
+
},
|
|
1531
|
+
[c, t, r, s]
|
|
1532
|
+
);
|
|
1533
|
+
return [f, l];
|
|
1534
|
+
}
|
|
1535
|
+
function Ge({
|
|
1536
|
+
defaultProp: t,
|
|
1537
|
+
onChange: e
|
|
1538
|
+
}) {
|
|
1539
|
+
const [n, o] = p.useState(t), i = p.useRef(n), r = p.useRef(e);
|
|
1540
|
+
return Xe(() => {
|
|
1541
|
+
r.current = e;
|
|
1542
|
+
}, [e]), p.useEffect(() => {
|
|
1543
|
+
var s;
|
|
1544
|
+
i.current !== n && ((s = r.current) == null || s.call(r, n), i.current = n);
|
|
1545
|
+
}, [n, i]), [n, o, r];
|
|
1546
|
+
}
|
|
1547
|
+
function Je(t) {
|
|
1548
|
+
return typeof t == "function";
|
|
1549
|
+
}
|
|
1550
|
+
export {
|
|
1551
|
+
Ye as P,
|
|
1552
|
+
on as a,
|
|
1553
|
+
te as b,
|
|
1554
|
+
en as c,
|
|
1555
|
+
nn as d,
|
|
1556
|
+
gn as e,
|
|
1557
|
+
cn as f,
|
|
1558
|
+
et as g,
|
|
1559
|
+
un as h,
|
|
1560
|
+
dn as i,
|
|
1561
|
+
hn as j,
|
|
1562
|
+
mn as k,
|
|
1563
|
+
an as l,
|
|
1564
|
+
sn as m,
|
|
1565
|
+
rn as n,
|
|
1566
|
+
ln as o,
|
|
1567
|
+
pn as p,
|
|
1568
|
+
Jt as q,
|
|
1569
|
+
fn as s,
|
|
1570
|
+
Qt as u
|
|
1571
|
+
};
|