@getflip/swirl-components-react 0.1.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/README.md +4 -0
- package/dist/flip-action-list-item.entry.1b728e6a.js +17 -0
- package/dist/flip-action-list-section.entry.da3e6186.js +15 -0
- package/dist/flip-action-list.entry.400a309a.js +38 -0
- package/dist/flip-avatar-group.entry.71bf1f2a.js +19 -0
- package/dist/flip-avatar.entry.2eb3242e.js +47 -0
- package/dist/flip-badge.entry.ebda6058.js +19 -0
- package/dist/flip-banner.entry.b3012465.js +32 -0
- package/dist/flip-button_2.entry.a323451d.js +42 -0
- package/dist/flip-checkbox.entry.2f740fb8.js +26 -0
- package/dist/flip-chip.entry.e9729ac7.js +34 -0
- package/dist/flip-description-list-item.entry.c789511e.js +80 -0
- package/dist/flip-description-list.entry.3b158436.js +15 -0
- package/dist/flip-dialog.entry.f2be9a9c.js +139 -0
- package/dist/flip-icon-add-photo.entry.a1003bdf.js +15 -0
- package/dist/flip-icon-add.entry.7103fbe7.js +15 -0
- package/dist/flip-icon-admin-panel-settings.entry.36a12e47.js +15 -0
- package/dist/flip-icon-arrow-back.entry.e35ba078.js +15 -0
- package/dist/flip-icon-arrow-forward.entry.5138c404.js +15 -0
- package/dist/flip-icon-arrow-right-small.entry.d1eeb150.js +15 -0
- package/dist/flip-icon-attachment.entry.594b602b.js +15 -0
- package/dist/flip-icon-cancel_2.entry.eb8d1a8c.js +25 -0
- package/dist/flip-icon-chat-bubble.entry.f56fcdc4.js +15 -0
- package/dist/flip-icon-check-circle.entry.e4f8169d.js +15 -0
- package/dist/flip-icon-check-small.entry.308d57d1.js +15 -0
- package/dist/flip-icon-check-strong.entry.b61365d2.js +15 -0
- package/dist/flip-icon-check.entry.f2c6b547.js +15 -0
- package/dist/flip-icon-chevron-left.entry.dbe9b291.js +15 -0
- package/dist/flip-icon-chevron-right.entry.9565c0f1.js +15 -0
- package/dist/flip-icon-close-small.entry.8bfcf1b1.js +15 -0
- package/dist/flip-icon-close.entry.41992748.js +15 -0
- package/dist/flip-icon-comment.entry.2aac2c10.js +15 -0
- package/dist/flip-icon-copy.entry.8e59bf1d.js +15 -0
- package/dist/flip-icon-date-range.entry.c1dd2730.js +15 -0
- package/dist/flip-icon-delete.entry.bc0b61ff.js +15 -0
- package/dist/flip-icon-description.entry.e01b2d40.js +15 -0
- package/dist/flip-icon-download.entry.a512f353.js +15 -0
- package/dist/flip-icon-edit.entry.7e3cd472.js +15 -0
- package/dist/flip-icon-emoji-mood.entry.df7b536f.js +15 -0
- package/dist/flip-icon-emoji-satisfied.entry.e3e5352b.js +15 -0
- package/dist/flip-icon-error.entry.96c3c29b.js +15 -0
- package/dist/flip-icon-expand-less.entry.3e970433.js +15 -0
- package/dist/flip-icon-expand-more.entry.4c1fa160.js +15 -0
- package/dist/flip-icon-file.entry.3a18cce8.js +15 -0
- package/dist/flip-icon-folder-shared.entry.38b22cd2.js +15 -0
- package/dist/flip-icon-group-assign.entry.a640254f.js +15 -0
- package/dist/flip-icon-groups-custom.entry.d77901cd.js +15 -0
- package/dist/flip-icon-groups.entry.80196d79.js +15 -0
- package/dist/flip-icon-image.entry.601bf2ae.js +15 -0
- package/dist/flip-icon-info.entry.b480a255.js +15 -0
- package/dist/flip-icon-inventory.entry.bb8a5615.js +15 -0
- package/dist/flip-icon-like.entry.af8b36e2.js +15 -0
- package/dist/flip-icon-link.entry.be72688c.js +15 -0
- package/dist/flip-icon-lock.entry.440459fe.js +15 -0
- package/dist/flip-icon-logout.entry.dde0bfc8.js +15 -0
- package/dist/flip-icon-mail.entry.b57a0093.js +15 -0
- package/dist/flip-icon-manage-accounts.entry.11cc3149.js +15 -0
- package/dist/flip-icon-mention.entry.32771810.js +15 -0
- package/dist/flip-icon-message.entry.636088c3.js +15 -0
- package/dist/flip-icon-more-horizontal.entry.38f14508.js +15 -0
- package/dist/flip-icon-more-vertikal.entry.8a4c613a.js +15 -0
- package/dist/flip-icon-notifications-active.entry.5658308d.js +15 -0
- package/dist/flip-icon-notifications-off.entry.8d3b11ff.js +15 -0
- package/dist/flip-icon-notifications.entry.91f77dd2.js +15 -0
- package/dist/flip-icon-people-alt.entry.b0b2e20c.js +15 -0
- package/dist/flip-icon-person-off.entry.e79df0e6.js +15 -0
- package/dist/flip-icon-person.entry.1bc59e68.js +15 -0
- package/dist/flip-icon-phone.entry.03e81177.js +15 -0
- package/dist/flip-icon-poll.entry.4e059f77.js +15 -0
- package/dist/flip-icon-recieved.entry.e3410f9e.js +15 -0
- package/dist/flip-icon-search-strong.entry.ec0849a6.js +15 -0
- package/dist/flip-icon-send.entry.3f80869c.js +15 -0
- package/dist/flip-icon-settings.entry.c86a7bca.js +15 -0
- package/dist/flip-icon-time-filled.entry.ad86a08f.js +15 -0
- package/dist/flip-icon-time-outlined.entry.75a29f76.js +15 -0
- package/dist/flip-icon-today.entry.ab272990.js +15 -0
- package/dist/flip-icon-user-assign.entry.1f331180.js +15 -0
- package/dist/flip-icon-video-camera.entry.40ea3d7d.js +15 -0
- package/dist/flip-icon-visibility-off.entry.ed4db3b5.js +15 -0
- package/dist/flip-icon-visibility.entry.1a7dfd44.js +15 -0
- package/dist/flip-icon-warning.entry.1c1540b8.js +15 -0
- package/dist/flip-inline-error.entry.38c26d13.js +17 -0
- package/dist/flip-link.entry.fe817ab1.js +15 -0
- package/dist/flip-popover.entry.18c5ead6.js +878 -0
- package/dist/flip-radio-group.entry.187f29ee.js +35 -0
- package/dist/flip-radio.entry.817d976d.js +25 -0
- package/dist/flip-search.entry.6717d77a.js +30 -0
- package/dist/flip-spinner.entry.f8f179be.js +17 -0
- package/dist/flip-stack.entry.50d88d6f.js +17 -0
- package/dist/flip-switch.entry.ef96875e.js +55 -0
- package/dist/flip-tag.entry.31a7d0f7.js +20 -0
- package/dist/flip-theme-provider.entry.9c054d33.js +181 -0
- package/dist/flip-thumbnail.entry.449e93ef.js +17 -0
- package/dist/flip-toast-provider.entry.59025e1a.js +28 -0
- package/dist/flip-toast.entry.78522d59.js +38 -0
- package/dist/flip-tooltip.entry.8b5f35c7.js +102 -0
- package/dist/flip-visually-hidden.entry.ae0ff292.js +15 -0
- package/dist/index-3c78bcaf.2675909b.js +48 -0
- package/dist/main.7e7363a7.js +1322 -0
- package/dist/swirl-components-react.js +103 -0
- package/dist/swirl-components-react.umd.cjs +106 -0
- package/dist/utils-03e3261c.f5223801.js +16 -0
- package/package.json +31 -0
|
@@ -0,0 +1,878 @@
|
|
|
1
|
+
import { r as Rt, h as S, H as Tt, g as St } from "./main.7e7363a7.js";
|
|
2
|
+
import { c as Et } from "./index-3c78bcaf.2675909b.js";
|
|
3
|
+
import { q as Pt } from "./utils-03e3261c.f5223801.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
function j(t) {
|
|
7
|
+
return t.split("-")[0];
|
|
8
|
+
}
|
|
9
|
+
function pt(t) {
|
|
10
|
+
return t.split("-")[1];
|
|
11
|
+
}
|
|
12
|
+
function Q(t) {
|
|
13
|
+
return ["top", "bottom"].includes(j(t)) ? "x" : "y";
|
|
14
|
+
}
|
|
15
|
+
function ht(t) {
|
|
16
|
+
return t === "y" ? "height" : "width";
|
|
17
|
+
}
|
|
18
|
+
function it(t, e, o) {
|
|
19
|
+
let {
|
|
20
|
+
reference: n,
|
|
21
|
+
floating: i
|
|
22
|
+
} = t;
|
|
23
|
+
const s = n.x + n.width / 2 - i.width / 2, a = n.y + n.height / 2 - i.height / 2, r = Q(e), l = ht(r), c = n[l] / 2 - i[l] / 2, p = j(e), d = r === "x";
|
|
24
|
+
let f;
|
|
25
|
+
switch (p) {
|
|
26
|
+
case "top":
|
|
27
|
+
f = {
|
|
28
|
+
x: s,
|
|
29
|
+
y: n.y - i.height
|
|
30
|
+
};
|
|
31
|
+
break;
|
|
32
|
+
case "bottom":
|
|
33
|
+
f = {
|
|
34
|
+
x: s,
|
|
35
|
+
y: n.y + n.height
|
|
36
|
+
};
|
|
37
|
+
break;
|
|
38
|
+
case "right":
|
|
39
|
+
f = {
|
|
40
|
+
x: n.x + n.width,
|
|
41
|
+
y: a
|
|
42
|
+
};
|
|
43
|
+
break;
|
|
44
|
+
case "left":
|
|
45
|
+
f = {
|
|
46
|
+
x: n.x - i.width,
|
|
47
|
+
y: a
|
|
48
|
+
};
|
|
49
|
+
break;
|
|
50
|
+
default:
|
|
51
|
+
f = {
|
|
52
|
+
x: n.x,
|
|
53
|
+
y: n.y
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
switch (pt(e)) {
|
|
57
|
+
case "start":
|
|
58
|
+
f[r] -= c * (o && d ? -1 : 1);
|
|
59
|
+
break;
|
|
60
|
+
case "end":
|
|
61
|
+
f[r] += c * (o && d ? -1 : 1);
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
return f;
|
|
65
|
+
}
|
|
66
|
+
const Lt = async (t, e, o) => {
|
|
67
|
+
const {
|
|
68
|
+
placement: n = "bottom",
|
|
69
|
+
strategy: i = "absolute",
|
|
70
|
+
middleware: s = [],
|
|
71
|
+
platform: a
|
|
72
|
+
} = o, r = await (a.isRTL == null ? void 0 : a.isRTL(e));
|
|
73
|
+
let l = await a.getElementRects({
|
|
74
|
+
reference: t,
|
|
75
|
+
floating: e,
|
|
76
|
+
strategy: i
|
|
77
|
+
}), {
|
|
78
|
+
x: c,
|
|
79
|
+
y: p
|
|
80
|
+
} = it(l, n, r), d = n, f = {}, h = 0;
|
|
81
|
+
for (let m = 0; m < s.length; m++) {
|
|
82
|
+
const {
|
|
83
|
+
name: u,
|
|
84
|
+
fn: v
|
|
85
|
+
} = s[m], {
|
|
86
|
+
x: g,
|
|
87
|
+
y: w,
|
|
88
|
+
data: k,
|
|
89
|
+
reset: y
|
|
90
|
+
} = await v({
|
|
91
|
+
x: c,
|
|
92
|
+
y: p,
|
|
93
|
+
initialPlacement: n,
|
|
94
|
+
placement: d,
|
|
95
|
+
strategy: i,
|
|
96
|
+
middlewareData: f,
|
|
97
|
+
rects: l,
|
|
98
|
+
platform: a,
|
|
99
|
+
elements: {
|
|
100
|
+
reference: t,
|
|
101
|
+
floating: e
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
if (c = g != null ? g : c, p = w != null ? w : p, f = {
|
|
105
|
+
...f,
|
|
106
|
+
[u]: {
|
|
107
|
+
...f[u],
|
|
108
|
+
...k
|
|
109
|
+
}
|
|
110
|
+
}, y && h <= 50) {
|
|
111
|
+
h++, typeof y == "object" && (y.placement && (d = y.placement), y.rects && (l = y.rects === !0 ? await a.getElementRects({
|
|
112
|
+
reference: t,
|
|
113
|
+
floating: e,
|
|
114
|
+
strategy: i
|
|
115
|
+
}) : y.rects), {
|
|
116
|
+
x: c,
|
|
117
|
+
y: p
|
|
118
|
+
} = it(l, d, r)), m = -1;
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
x: c,
|
|
124
|
+
y: p,
|
|
125
|
+
placement: d,
|
|
126
|
+
strategy: i,
|
|
127
|
+
middlewareData: f
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
function Ot(t) {
|
|
131
|
+
return {
|
|
132
|
+
top: 0,
|
|
133
|
+
right: 0,
|
|
134
|
+
bottom: 0,
|
|
135
|
+
left: 0,
|
|
136
|
+
...t
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function Bt(t) {
|
|
140
|
+
return typeof t != "number" ? Ot(t) : {
|
|
141
|
+
top: t,
|
|
142
|
+
right: t,
|
|
143
|
+
bottom: t,
|
|
144
|
+
left: t
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
function N(t) {
|
|
148
|
+
return {
|
|
149
|
+
...t,
|
|
150
|
+
top: t.y,
|
|
151
|
+
left: t.x,
|
|
152
|
+
right: t.x + t.width,
|
|
153
|
+
bottom: t.y + t.height
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
async function mt(t, e) {
|
|
157
|
+
var o;
|
|
158
|
+
e === void 0 && (e = {});
|
|
159
|
+
const {
|
|
160
|
+
x: n,
|
|
161
|
+
y: i,
|
|
162
|
+
platform: s,
|
|
163
|
+
rects: a,
|
|
164
|
+
elements: r,
|
|
165
|
+
strategy: l
|
|
166
|
+
} = t, {
|
|
167
|
+
boundary: c = "clippingAncestors",
|
|
168
|
+
rootBoundary: p = "viewport",
|
|
169
|
+
elementContext: d = "floating",
|
|
170
|
+
altBoundary: f = !1,
|
|
171
|
+
padding: h = 0
|
|
172
|
+
} = e, m = Bt(h), v = r[f ? d === "floating" ? "reference" : "floating" : d], g = N(await s.getClippingRect({
|
|
173
|
+
element: (o = await (s.isElement == null ? void 0 : s.isElement(v))) == null || o ? v : v.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(r.floating)),
|
|
174
|
+
boundary: c,
|
|
175
|
+
rootBoundary: p,
|
|
176
|
+
strategy: l
|
|
177
|
+
})), w = N(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
178
|
+
rect: d === "floating" ? {
|
|
179
|
+
...a.floating,
|
|
180
|
+
x: n,
|
|
181
|
+
y: i
|
|
182
|
+
} : a.reference,
|
|
183
|
+
offsetParent: await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(r.floating)),
|
|
184
|
+
strategy: l
|
|
185
|
+
}) : a[d]);
|
|
186
|
+
return {
|
|
187
|
+
top: g.top - w.top + m.top,
|
|
188
|
+
bottom: w.bottom - g.bottom + m.bottom,
|
|
189
|
+
left: g.left - w.left + m.left,
|
|
190
|
+
right: w.right - g.right + m.right
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
const Dt = Math.min, Mt = Math.max;
|
|
194
|
+
function rt(t, e, o) {
|
|
195
|
+
return Mt(t, Dt(e, o));
|
|
196
|
+
}
|
|
197
|
+
const It = {
|
|
198
|
+
left: "right",
|
|
199
|
+
right: "left",
|
|
200
|
+
bottom: "top",
|
|
201
|
+
top: "bottom"
|
|
202
|
+
};
|
|
203
|
+
function Y(t) {
|
|
204
|
+
return t.replace(/left|right|bottom|top/g, (e) => It[e]);
|
|
205
|
+
}
|
|
206
|
+
function Ht(t, e, o) {
|
|
207
|
+
o === void 0 && (o = !1);
|
|
208
|
+
const n = pt(t), i = Q(t), s = ht(i);
|
|
209
|
+
let a = i === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
210
|
+
return e.reference[s] > e.floating[s] && (a = Y(a)), {
|
|
211
|
+
main: a,
|
|
212
|
+
cross: Y(a)
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
const Ft = {
|
|
216
|
+
start: "end",
|
|
217
|
+
end: "start"
|
|
218
|
+
};
|
|
219
|
+
function st(t) {
|
|
220
|
+
return t.replace(/start|end/g, (e) => Ft[e]);
|
|
221
|
+
}
|
|
222
|
+
function Vt(t) {
|
|
223
|
+
const e = Y(t);
|
|
224
|
+
return [st(t), e, st(e)];
|
|
225
|
+
}
|
|
226
|
+
const Wt = function(t) {
|
|
227
|
+
return t === void 0 && (t = {}), {
|
|
228
|
+
name: "flip",
|
|
229
|
+
options: t,
|
|
230
|
+
async fn(e) {
|
|
231
|
+
var o;
|
|
232
|
+
const {
|
|
233
|
+
placement: n,
|
|
234
|
+
middlewareData: i,
|
|
235
|
+
rects: s,
|
|
236
|
+
initialPlacement: a,
|
|
237
|
+
platform: r,
|
|
238
|
+
elements: l
|
|
239
|
+
} = e, {
|
|
240
|
+
mainAxis: c = !0,
|
|
241
|
+
crossAxis: p = !0,
|
|
242
|
+
fallbackPlacements: d,
|
|
243
|
+
fallbackStrategy: f = "bestFit",
|
|
244
|
+
flipAlignment: h = !0,
|
|
245
|
+
...m
|
|
246
|
+
} = t, u = j(n), g = d || (u === a || !h ? [Y(a)] : Vt(a)), w = [a, ...g], k = await mt(e, m), y = [];
|
|
247
|
+
let H = ((o = i.flip) == null ? void 0 : o.overflows) || [];
|
|
248
|
+
if (c && y.push(k[u]), p) {
|
|
249
|
+
const {
|
|
250
|
+
main: L,
|
|
251
|
+
cross: F
|
|
252
|
+
} = Ht(n, s, await (r.isRTL == null ? void 0 : r.isRTL(l.floating)));
|
|
253
|
+
y.push(k[L], k[F]);
|
|
254
|
+
}
|
|
255
|
+
if (H = [...H, {
|
|
256
|
+
placement: n,
|
|
257
|
+
overflows: y
|
|
258
|
+
}], !y.every((L) => L <= 0)) {
|
|
259
|
+
var tt, et;
|
|
260
|
+
const L = ((tt = (et = i.flip) == null ? void 0 : et.index) != null ? tt : 0) + 1, F = w[L];
|
|
261
|
+
if (F)
|
|
262
|
+
return {
|
|
263
|
+
data: {
|
|
264
|
+
index: L,
|
|
265
|
+
overflows: H
|
|
266
|
+
},
|
|
267
|
+
reset: {
|
|
268
|
+
placement: F
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
let V = "bottom";
|
|
272
|
+
switch (f) {
|
|
273
|
+
case "bestFit": {
|
|
274
|
+
var ot;
|
|
275
|
+
const nt = (ot = H.map((W) => [W, W.overflows.filter((B) => B > 0).reduce((B, _t) => B + _t, 0)]).sort((W, B) => W[1] - B[1])[0]) == null ? void 0 : ot[0].placement;
|
|
276
|
+
nt && (V = nt);
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
case "initialPlacement":
|
|
280
|
+
V = a;
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
if (n !== V)
|
|
284
|
+
return {
|
|
285
|
+
reset: {
|
|
286
|
+
placement: V
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
return {};
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
function Nt(t) {
|
|
295
|
+
return t === "x" ? "y" : "x";
|
|
296
|
+
}
|
|
297
|
+
const Yt = function(t) {
|
|
298
|
+
return t === void 0 && (t = {}), {
|
|
299
|
+
name: "shift",
|
|
300
|
+
options: t,
|
|
301
|
+
async fn(e) {
|
|
302
|
+
const {
|
|
303
|
+
x: o,
|
|
304
|
+
y: n,
|
|
305
|
+
placement: i
|
|
306
|
+
} = e, {
|
|
307
|
+
mainAxis: s = !0,
|
|
308
|
+
crossAxis: a = !1,
|
|
309
|
+
limiter: r = {
|
|
310
|
+
fn: (v) => {
|
|
311
|
+
let {
|
|
312
|
+
x: g,
|
|
313
|
+
y: w
|
|
314
|
+
} = v;
|
|
315
|
+
return {
|
|
316
|
+
x: g,
|
|
317
|
+
y: w
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
...l
|
|
322
|
+
} = t, c = {
|
|
323
|
+
x: o,
|
|
324
|
+
y: n
|
|
325
|
+
}, p = await mt(e, l), d = Q(j(i)), f = Nt(d);
|
|
326
|
+
let h = c[d], m = c[f];
|
|
327
|
+
if (s) {
|
|
328
|
+
const v = d === "y" ? "top" : "left", g = d === "y" ? "bottom" : "right", w = h + p[v], k = h - p[g];
|
|
329
|
+
h = rt(w, h, k);
|
|
330
|
+
}
|
|
331
|
+
if (a) {
|
|
332
|
+
const v = f === "y" ? "top" : "left", g = f === "y" ? "bottom" : "right", w = m + p[v], k = m - p[g];
|
|
333
|
+
m = rt(w, m, k);
|
|
334
|
+
}
|
|
335
|
+
const u = r.fn({
|
|
336
|
+
...e,
|
|
337
|
+
[d]: h,
|
|
338
|
+
[f]: m
|
|
339
|
+
});
|
|
340
|
+
return {
|
|
341
|
+
...u,
|
|
342
|
+
data: {
|
|
343
|
+
x: u.x - o,
|
|
344
|
+
y: u.y - n
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
function vt(t) {
|
|
351
|
+
return t && t.document && t.location && t.alert && t.setInterval;
|
|
352
|
+
}
|
|
353
|
+
function _(t) {
|
|
354
|
+
if (t == null)
|
|
355
|
+
return window;
|
|
356
|
+
if (!vt(t)) {
|
|
357
|
+
const e = t.ownerDocument;
|
|
358
|
+
return e && e.defaultView || window;
|
|
359
|
+
}
|
|
360
|
+
return t;
|
|
361
|
+
}
|
|
362
|
+
function b(t) {
|
|
363
|
+
return _(t).getComputedStyle(t);
|
|
364
|
+
}
|
|
365
|
+
function A(t) {
|
|
366
|
+
return vt(t) ? "" : t ? (t.nodeName || "").toLowerCase() : "";
|
|
367
|
+
}
|
|
368
|
+
function gt() {
|
|
369
|
+
const t = navigator.userAgentData;
|
|
370
|
+
return t != null && t.brands ? t.brands.map((e) => e.brand + "/" + e.version).join(" ") : navigator.userAgent;
|
|
371
|
+
}
|
|
372
|
+
function x(t) {
|
|
373
|
+
return t instanceof _(t).HTMLElement;
|
|
374
|
+
}
|
|
375
|
+
function R(t) {
|
|
376
|
+
return t instanceof _(t).Element;
|
|
377
|
+
}
|
|
378
|
+
function $t(t) {
|
|
379
|
+
return t instanceof _(t).Node;
|
|
380
|
+
}
|
|
381
|
+
function O(t) {
|
|
382
|
+
if (typeof ShadowRoot > "u")
|
|
383
|
+
return !1;
|
|
384
|
+
const e = _(t).ShadowRoot;
|
|
385
|
+
return t instanceof e || t instanceof ShadowRoot;
|
|
386
|
+
}
|
|
387
|
+
function K(t) {
|
|
388
|
+
const {
|
|
389
|
+
overflow: e,
|
|
390
|
+
overflowX: o,
|
|
391
|
+
overflowY: n
|
|
392
|
+
} = b(t);
|
|
393
|
+
return /auto|scroll|overlay|hidden/.test(e + n + o);
|
|
394
|
+
}
|
|
395
|
+
function zt(t) {
|
|
396
|
+
return ["table", "td", "th"].includes(A(t));
|
|
397
|
+
}
|
|
398
|
+
function wt(t) {
|
|
399
|
+
const e = /firefox/i.test(gt()), o = b(t);
|
|
400
|
+
return o.transform !== "none" || o.perspective !== "none" || o.contain === "paint" || ["transform", "perspective"].includes(o.willChange) || e && o.willChange === "filter" || e && (o.filter ? o.filter !== "none" : !1);
|
|
401
|
+
}
|
|
402
|
+
function yt() {
|
|
403
|
+
return !/^((?!chrome|android).)*safari/i.test(gt());
|
|
404
|
+
}
|
|
405
|
+
const at = Math.min, D = Math.max, $ = Math.round;
|
|
406
|
+
function C(t, e, o) {
|
|
407
|
+
var n, i, s, a;
|
|
408
|
+
e === void 0 && (e = !1), o === void 0 && (o = !1);
|
|
409
|
+
const r = t.getBoundingClientRect();
|
|
410
|
+
let l = 1, c = 1;
|
|
411
|
+
e && x(t) && (l = t.offsetWidth > 0 && $(r.width) / t.offsetWidth || 1, c = t.offsetHeight > 0 && $(r.height) / t.offsetHeight || 1);
|
|
412
|
+
const p = R(t) ? _(t) : window, d = !yt() && o, f = (r.left + (d && (n = (i = p.visualViewport) == null ? void 0 : i.offsetLeft) != null ? n : 0)) / l, h = (r.top + (d && (s = (a = p.visualViewport) == null ? void 0 : a.offsetTop) != null ? s : 0)) / c, m = r.width / l, u = r.height / c;
|
|
413
|
+
return {
|
|
414
|
+
width: m,
|
|
415
|
+
height: u,
|
|
416
|
+
top: h,
|
|
417
|
+
right: f + m,
|
|
418
|
+
bottom: h + u,
|
|
419
|
+
left: f,
|
|
420
|
+
x: f,
|
|
421
|
+
y: h
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
function T(t) {
|
|
425
|
+
return (($t(t) ? t.ownerDocument : t.document) || window.document).documentElement;
|
|
426
|
+
}
|
|
427
|
+
function G(t) {
|
|
428
|
+
return R(t) ? {
|
|
429
|
+
scrollLeft: t.scrollLeft,
|
|
430
|
+
scrollTop: t.scrollTop
|
|
431
|
+
} : {
|
|
432
|
+
scrollLeft: t.pageXOffset,
|
|
433
|
+
scrollTop: t.pageYOffset
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
function bt(t) {
|
|
437
|
+
return C(T(t)).left + G(t).scrollLeft;
|
|
438
|
+
}
|
|
439
|
+
function Ut(t) {
|
|
440
|
+
const e = C(t);
|
|
441
|
+
return $(e.width) !== t.offsetWidth || $(e.height) !== t.offsetHeight;
|
|
442
|
+
}
|
|
443
|
+
function qt(t, e, o) {
|
|
444
|
+
const n = x(e), i = T(e), s = C(
|
|
445
|
+
t,
|
|
446
|
+
n && Ut(e),
|
|
447
|
+
o === "fixed"
|
|
448
|
+
);
|
|
449
|
+
let a = {
|
|
450
|
+
scrollLeft: 0,
|
|
451
|
+
scrollTop: 0
|
|
452
|
+
};
|
|
453
|
+
const r = {
|
|
454
|
+
x: 0,
|
|
455
|
+
y: 0
|
|
456
|
+
};
|
|
457
|
+
if (n || !n && o !== "fixed")
|
|
458
|
+
if ((A(e) !== "body" || K(i)) && (a = G(e)), x(e)) {
|
|
459
|
+
const l = C(e, !0);
|
|
460
|
+
r.x = l.x + e.clientLeft, r.y = l.y + e.clientTop;
|
|
461
|
+
} else
|
|
462
|
+
i && (r.x = bt(i));
|
|
463
|
+
return {
|
|
464
|
+
x: s.left + a.scrollLeft - r.x,
|
|
465
|
+
y: s.top + a.scrollTop - r.y,
|
|
466
|
+
width: s.width,
|
|
467
|
+
height: s.height
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
function xt(t) {
|
|
471
|
+
return A(t) === "html" ? t : t.assignedSlot || t.parentNode || (O(t) ? t.host : null) || T(t);
|
|
472
|
+
}
|
|
473
|
+
function lt(t) {
|
|
474
|
+
return !x(t) || b(t).position === "fixed" ? null : Xt(t);
|
|
475
|
+
}
|
|
476
|
+
function Xt(t) {
|
|
477
|
+
let {
|
|
478
|
+
offsetParent: e
|
|
479
|
+
} = t, o = t, n = !1;
|
|
480
|
+
for (; o && o !== e; ) {
|
|
481
|
+
const {
|
|
482
|
+
assignedSlot: i
|
|
483
|
+
} = o;
|
|
484
|
+
if (i) {
|
|
485
|
+
let s = i.offsetParent;
|
|
486
|
+
if (b(i).display === "contents") {
|
|
487
|
+
const a = i.hasAttribute("style"), r = i.style.display;
|
|
488
|
+
i.style.display = b(o).display, s = i.offsetParent, i.style.display = r, a || i.removeAttribute("style");
|
|
489
|
+
}
|
|
490
|
+
o = i, e !== s && (e = s, n = !0);
|
|
491
|
+
} else if (O(o) && o.host && n)
|
|
492
|
+
break;
|
|
493
|
+
o = O(o) && o.host || o.parentNode;
|
|
494
|
+
}
|
|
495
|
+
return e;
|
|
496
|
+
}
|
|
497
|
+
function jt(t) {
|
|
498
|
+
let e = xt(t);
|
|
499
|
+
for (O(e) && (e = e.host); x(e) && !["html", "body"].includes(A(e)); ) {
|
|
500
|
+
if (wt(e))
|
|
501
|
+
return e;
|
|
502
|
+
{
|
|
503
|
+
const o = e.parentNode;
|
|
504
|
+
e = O(o) ? o.host : o;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
return null;
|
|
508
|
+
}
|
|
509
|
+
function J(t) {
|
|
510
|
+
const e = _(t);
|
|
511
|
+
let o = lt(t);
|
|
512
|
+
for (; o && zt(o) && b(o).position === "static"; )
|
|
513
|
+
o = lt(o);
|
|
514
|
+
return o && (A(o) === "html" || A(o) === "body" && b(o).position === "static" && !wt(o)) ? e : o || jt(t) || e;
|
|
515
|
+
}
|
|
516
|
+
function ct(t) {
|
|
517
|
+
if (x(t))
|
|
518
|
+
return {
|
|
519
|
+
width: t.offsetWidth,
|
|
520
|
+
height: t.offsetHeight
|
|
521
|
+
};
|
|
522
|
+
const e = C(t);
|
|
523
|
+
return {
|
|
524
|
+
width: e.width,
|
|
525
|
+
height: e.height
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
function Kt(t) {
|
|
529
|
+
let {
|
|
530
|
+
rect: e,
|
|
531
|
+
offsetParent: o,
|
|
532
|
+
strategy: n
|
|
533
|
+
} = t;
|
|
534
|
+
const i = x(o), s = T(o);
|
|
535
|
+
if (o === s)
|
|
536
|
+
return e;
|
|
537
|
+
let a = {
|
|
538
|
+
scrollLeft: 0,
|
|
539
|
+
scrollTop: 0
|
|
540
|
+
};
|
|
541
|
+
const r = {
|
|
542
|
+
x: 0,
|
|
543
|
+
y: 0
|
|
544
|
+
};
|
|
545
|
+
if ((i || !i && n !== "fixed") && ((A(o) !== "body" || K(s)) && (a = G(o)), x(o))) {
|
|
546
|
+
const l = C(o, !0);
|
|
547
|
+
r.x = l.x + o.clientLeft, r.y = l.y + o.clientTop;
|
|
548
|
+
}
|
|
549
|
+
return {
|
|
550
|
+
...e,
|
|
551
|
+
x: e.x - a.scrollLeft + r.x,
|
|
552
|
+
y: e.y - a.scrollTop + r.y
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
function Gt(t, e) {
|
|
556
|
+
const o = _(t), n = T(t), i = o.visualViewport;
|
|
557
|
+
let s = n.clientWidth, a = n.clientHeight, r = 0, l = 0;
|
|
558
|
+
if (i) {
|
|
559
|
+
s = i.width, a = i.height;
|
|
560
|
+
const c = yt();
|
|
561
|
+
(c || !c && e === "fixed") && (r = i.offsetLeft, l = i.offsetTop);
|
|
562
|
+
}
|
|
563
|
+
return {
|
|
564
|
+
width: s,
|
|
565
|
+
height: a,
|
|
566
|
+
x: r,
|
|
567
|
+
y: l
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
function Jt(t) {
|
|
571
|
+
var e;
|
|
572
|
+
const o = T(t), n = G(t), i = (e = t.ownerDocument) == null ? void 0 : e.body, s = D(o.scrollWidth, o.clientWidth, i ? i.scrollWidth : 0, i ? i.clientWidth : 0), a = D(o.scrollHeight, o.clientHeight, i ? i.scrollHeight : 0, i ? i.clientHeight : 0);
|
|
573
|
+
let r = -n.scrollLeft + bt(t);
|
|
574
|
+
const l = -n.scrollTop;
|
|
575
|
+
return b(i || o).direction === "rtl" && (r += D(o.clientWidth, i ? i.clientWidth : 0) - s), {
|
|
576
|
+
width: s,
|
|
577
|
+
height: a,
|
|
578
|
+
x: r,
|
|
579
|
+
y: l
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
function kt(t) {
|
|
583
|
+
const e = xt(t);
|
|
584
|
+
return ["html", "body", "#document"].includes(A(e)) ? t.ownerDocument.body : x(e) && K(e) ? e : kt(e);
|
|
585
|
+
}
|
|
586
|
+
function z(t, e) {
|
|
587
|
+
var o;
|
|
588
|
+
e === void 0 && (e = []);
|
|
589
|
+
const n = kt(t), i = n === ((o = t.ownerDocument) == null ? void 0 : o.body), s = _(n), a = i ? [s].concat(s.visualViewport || [], K(n) ? n : []) : n, r = e.concat(a);
|
|
590
|
+
return i ? r : r.concat(z(a));
|
|
591
|
+
}
|
|
592
|
+
function Qt(t, e) {
|
|
593
|
+
const o = e.getRootNode == null ? void 0 : e.getRootNode();
|
|
594
|
+
if (t.contains(e))
|
|
595
|
+
return !0;
|
|
596
|
+
if (o && O(o)) {
|
|
597
|
+
let n = e;
|
|
598
|
+
do {
|
|
599
|
+
if (n && t === n)
|
|
600
|
+
return !0;
|
|
601
|
+
n = n.parentNode || n.host;
|
|
602
|
+
} while (n);
|
|
603
|
+
}
|
|
604
|
+
return !1;
|
|
605
|
+
}
|
|
606
|
+
function Zt(t, e) {
|
|
607
|
+
const o = C(t, !1, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft;
|
|
608
|
+
return {
|
|
609
|
+
top: n,
|
|
610
|
+
left: i,
|
|
611
|
+
x: i,
|
|
612
|
+
y: n,
|
|
613
|
+
right: i + t.clientWidth,
|
|
614
|
+
bottom: n + t.clientHeight,
|
|
615
|
+
width: t.clientWidth,
|
|
616
|
+
height: t.clientHeight
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
function dt(t, e, o) {
|
|
620
|
+
return e === "viewport" ? N(Gt(t, o)) : R(e) ? Zt(e, o) : N(Jt(T(t)));
|
|
621
|
+
}
|
|
622
|
+
function te(t) {
|
|
623
|
+
const e = z(t), n = ["absolute", "fixed"].includes(b(t).position) && x(t) ? J(t) : t;
|
|
624
|
+
return R(n) ? e.filter((i) => R(i) && Qt(i, n) && A(i) !== "body") : [];
|
|
625
|
+
}
|
|
626
|
+
function ee(t) {
|
|
627
|
+
let {
|
|
628
|
+
element: e,
|
|
629
|
+
boundary: o,
|
|
630
|
+
rootBoundary: n,
|
|
631
|
+
strategy: i
|
|
632
|
+
} = t;
|
|
633
|
+
const a = [...o === "clippingAncestors" ? te(e) : [].concat(o), n], r = a[0], l = a.reduce((c, p) => {
|
|
634
|
+
const d = dt(e, p, i);
|
|
635
|
+
return c.top = D(d.top, c.top), c.right = at(d.right, c.right), c.bottom = at(d.bottom, c.bottom), c.left = D(d.left, c.left), c;
|
|
636
|
+
}, dt(e, r, i));
|
|
637
|
+
return {
|
|
638
|
+
width: l.right - l.left,
|
|
639
|
+
height: l.bottom - l.top,
|
|
640
|
+
x: l.left,
|
|
641
|
+
y: l.top
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
const oe = {
|
|
645
|
+
getClippingRect: ee,
|
|
646
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Kt,
|
|
647
|
+
isElement: R,
|
|
648
|
+
getDimensions: ct,
|
|
649
|
+
getOffsetParent: J,
|
|
650
|
+
getDocumentElement: T,
|
|
651
|
+
getElementRects: (t) => {
|
|
652
|
+
let {
|
|
653
|
+
reference: e,
|
|
654
|
+
floating: o,
|
|
655
|
+
strategy: n
|
|
656
|
+
} = t;
|
|
657
|
+
return {
|
|
658
|
+
reference: qt(e, J(o), n),
|
|
659
|
+
floating: {
|
|
660
|
+
...ct(o),
|
|
661
|
+
x: 0,
|
|
662
|
+
y: 0
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
},
|
|
666
|
+
getClientRects: (t) => Array.from(t.getClientRects()),
|
|
667
|
+
isRTL: (t) => b(t).direction === "rtl"
|
|
668
|
+
};
|
|
669
|
+
function ne(t, e, o, n) {
|
|
670
|
+
n === void 0 && (n = {});
|
|
671
|
+
const {
|
|
672
|
+
ancestorScroll: i = !0,
|
|
673
|
+
ancestorResize: s = !0,
|
|
674
|
+
elementResize: a = !0,
|
|
675
|
+
animationFrame: r = !1
|
|
676
|
+
} = n, l = i && !r, c = s && !r, p = l || c ? [...R(t) ? z(t) : [], ...z(e)] : [];
|
|
677
|
+
p.forEach((u) => {
|
|
678
|
+
l && u.addEventListener("scroll", o, {
|
|
679
|
+
passive: !0
|
|
680
|
+
}), c && u.addEventListener("resize", o);
|
|
681
|
+
});
|
|
682
|
+
let d = null;
|
|
683
|
+
if (a) {
|
|
684
|
+
let u = !0;
|
|
685
|
+
d = new ResizeObserver(() => {
|
|
686
|
+
u || o(), u = !1;
|
|
687
|
+
}), R(t) && !r && d.observe(t), d.observe(e);
|
|
688
|
+
}
|
|
689
|
+
let f, h = r ? C(t) : null;
|
|
690
|
+
r && m();
|
|
691
|
+
function m() {
|
|
692
|
+
const u = C(t);
|
|
693
|
+
h && (u.x !== h.x || u.y !== h.y || u.width !== h.width || u.height !== h.height) && o(), h = u, f = requestAnimationFrame(m);
|
|
694
|
+
}
|
|
695
|
+
return o(), () => {
|
|
696
|
+
var u;
|
|
697
|
+
p.forEach((v) => {
|
|
698
|
+
l && v.removeEventListener("scroll", o), c && v.removeEventListener("resize", o);
|
|
699
|
+
}), (u = d) == null || u.disconnect(), d = null, r && cancelAnimationFrame(f);
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
const ie = (t, e, o) => Lt(t, e, {
|
|
703
|
+
platform: oe,
|
|
704
|
+
...o
|
|
705
|
+
});
|
|
706
|
+
function re(t) {
|
|
707
|
+
if (Array.isArray(t)) {
|
|
708
|
+
for (var e = 0, o = Array(t.length); e < t.length; e++)
|
|
709
|
+
o[e] = t[e];
|
|
710
|
+
return o;
|
|
711
|
+
} else
|
|
712
|
+
return Array.from(t);
|
|
713
|
+
}
|
|
714
|
+
var Z = !1;
|
|
715
|
+
if (typeof window < "u") {
|
|
716
|
+
var ft = {
|
|
717
|
+
get passive() {
|
|
718
|
+
Z = !0;
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
window.addEventListener("testPassive", null, ft), window.removeEventListener("testPassive", null, ft);
|
|
722
|
+
}
|
|
723
|
+
var U = typeof window < "u" && window.navigator && window.navigator.platform && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === "MacIntel" && window.navigator.maxTouchPoints > 1), P = [], q = !1, At = -1, M = void 0, E = void 0, I = void 0, Ct = function(e) {
|
|
724
|
+
return P.some(function(o) {
|
|
725
|
+
return !!(o.options.allowTouchMove && o.options.allowTouchMove(e));
|
|
726
|
+
});
|
|
727
|
+
}, X = function(e) {
|
|
728
|
+
var o = e || window.event;
|
|
729
|
+
return Ct(o.target) || o.touches.length > 1 ? !0 : (o.preventDefault && o.preventDefault(), !1);
|
|
730
|
+
}, se = function(e) {
|
|
731
|
+
if (I === void 0) {
|
|
732
|
+
var o = !!e && e.reserveScrollBarGap === !0, n = window.innerWidth - document.documentElement.clientWidth;
|
|
733
|
+
if (o && n > 0) {
|
|
734
|
+
var i = parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"), 10);
|
|
735
|
+
I = document.body.style.paddingRight, document.body.style.paddingRight = i + n + "px";
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
M === void 0 && (M = document.body.style.overflow, document.body.style.overflow = "hidden");
|
|
739
|
+
}, ae = function() {
|
|
740
|
+
I !== void 0 && (document.body.style.paddingRight = I, I = void 0), M !== void 0 && (document.body.style.overflow = M, M = void 0);
|
|
741
|
+
}, le = function() {
|
|
742
|
+
return window.requestAnimationFrame(function() {
|
|
743
|
+
if (E === void 0) {
|
|
744
|
+
E = {
|
|
745
|
+
position: document.body.style.position,
|
|
746
|
+
top: document.body.style.top,
|
|
747
|
+
left: document.body.style.left
|
|
748
|
+
};
|
|
749
|
+
var e = window, o = e.scrollY, n = e.scrollX, i = e.innerHeight;
|
|
750
|
+
document.body.style.position = "fixed", document.body.style.top = -o, document.body.style.left = -n, setTimeout(function() {
|
|
751
|
+
return window.requestAnimationFrame(function() {
|
|
752
|
+
var s = i - window.innerHeight;
|
|
753
|
+
s && o >= i && (document.body.style.top = -(o + s));
|
|
754
|
+
});
|
|
755
|
+
}, 300);
|
|
756
|
+
}
|
|
757
|
+
});
|
|
758
|
+
}, ce = function() {
|
|
759
|
+
if (E !== void 0) {
|
|
760
|
+
var e = -parseInt(document.body.style.top, 10), o = -parseInt(document.body.style.left, 10);
|
|
761
|
+
document.body.style.position = E.position, document.body.style.top = E.top, document.body.style.left = E.left, window.scrollTo(o, e), E = void 0;
|
|
762
|
+
}
|
|
763
|
+
}, de = function(e) {
|
|
764
|
+
return e ? e.scrollHeight - e.scrollTop <= e.clientHeight : !1;
|
|
765
|
+
}, fe = function(e, o) {
|
|
766
|
+
var n = e.targetTouches[0].clientY - At;
|
|
767
|
+
return Ct(e.target) ? !1 : o && o.scrollTop === 0 && n > 0 || de(o) && n < 0 ? X(e) : (e.stopPropagation(), !0);
|
|
768
|
+
}, ue = function(e, o) {
|
|
769
|
+
if (!e) {
|
|
770
|
+
console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
if (!P.some(function(i) {
|
|
774
|
+
return i.targetElement === e;
|
|
775
|
+
})) {
|
|
776
|
+
var n = {
|
|
777
|
+
targetElement: e,
|
|
778
|
+
options: o || {}
|
|
779
|
+
};
|
|
780
|
+
P = [].concat(re(P), [n]), U ? le() : se(o), U && (e.ontouchstart = function(i) {
|
|
781
|
+
i.targetTouches.length === 1 && (At = i.targetTouches[0].clientY);
|
|
782
|
+
}, e.ontouchmove = function(i) {
|
|
783
|
+
i.targetTouches.length === 1 && fe(i, e);
|
|
784
|
+
}, q || (document.addEventListener("touchmove", X, Z ? { passive: !1 } : void 0), q = !0));
|
|
785
|
+
}
|
|
786
|
+
}, ut = function(e) {
|
|
787
|
+
if (!e) {
|
|
788
|
+
console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
P = P.filter(function(o) {
|
|
792
|
+
return o.targetElement !== e;
|
|
793
|
+
}), U && (e.ontouchstart = null, e.ontouchmove = null, q && P.length === 0 && (document.removeEventListener("touchmove", X, Z ? { passive: !1 } : void 0), q = !1)), U ? ce() : ae();
|
|
794
|
+
};
|
|
795
|
+
const pe = ":host{position:relative;z-index:var(--s-z-40);display:inline-flex}:host *{box-sizing:border-box}.popover--active:not(.popover--closing) .popover__backdrop{-webkit-animation:0.15s popover-fade-in;animation:0.15s popover-fade-in}@media (prefers-reduced-motion){.popover--active:not(.popover--closing) .popover__backdrop{-webkit-animation:none;animation:none}}.popover--active:not(.popover--closing) .popover__content{-webkit-animation:0.15s popover-slide-in;animation:0.15s popover-slide-in}@media (min-width: 768px){.popover--active:not(.popover--closing) .popover__content{transform-origin:top left;-webkit-animation:0.15s popover-fade-scale-in;animation:0.15s popover-fade-scale-in}}@media (prefers-reduced-motion){.popover--active:not(.popover--closing) .popover__content{-webkit-animation:none;animation:none}}.popover--closing .popover__backdrop{-webkit-animation:0.15s popover-fade-out;animation:0.15s popover-fade-out;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@media (prefers-reduced-motion){.popover--closing .popover__backdrop{-webkit-animation:none;animation:none}}.popover--closing .popover__content{-webkit-animation:0.15s popover-slide-out;animation:0.15s popover-slide-out;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@media (min-width: 768px){.popover--closing .popover__content{-webkit-animation:0.15s popover-fade-out;animation:0.15s popover-fade-out}}@media (prefers-reduced-motion){.popover--closing .popover__content{-webkit-animation:none;animation:none}}.popover--inactive .popover__content{display:none}.popover__backdrop{position:fixed;z-index:0;background-color:rgba(0, 0, 0, 0.2);-webkit-animation:0.15s popover-backdrop-fade-in;animation:0.15s popover-backdrop-fade-in;inset:0}@media (prefers-reduced-motion){.popover__backdrop{-webkit-animation:none;animation:none}}@media (min-width: 768px){.popover__backdrop{display:none}}.popover__content{position:fixed;z-index:2;right:0;bottom:0;left:0;overflow:hidden;border-top-left-radius:var(--s-border-radius-xl);border-top-right-radius:var(--s-border-radius-xl);background-color:var(--s-surface-overlay-default)}@media (min-width: 768px){.popover__content{right:unset;bottom:unset;left:unset;max-width:22.5rem;border-radius:var(--s-border-radius-xl);-webkit-animation:none;animation:none;box-shadow:0.125rem 0.25rem 2.5rem rgba(0, 0, 0, 0.14)}}.popover__scroll-container{overflow-x:hidden;overflow-y:auto;width:100%;max-height:90vh;padding-top:var(--s-space-24);padding-bottom:var(--s-space-24);overscroll-behavior:contain}@media (min-width: 768px){.popover__scroll-container{max-height:19rem;padding-top:var(--s-space-8);padding-bottom:var(--s-space-8)}}.popover__handle{position:absolute;top:var(--s-space-8);left:50%;width:2.5rem;height:0.375rem;border-radius:0.1875rem;background-color:var(--s-border-default);transform:translatex(-50%)}@media (min-width: 768px){.popover__handle{display:none}}@-webkit-keyframes popover-slide-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes popover-slide-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes popover-slide-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes popover-slide-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@-webkit-keyframes popover-fade-in{from{opacity:0}to{opacity:1}}@keyframes popover-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes popover-fade-out{from{opacity:1}to{opacity:0}}@keyframes popover-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes popover-fade-scale-in{from{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}@keyframes popover-fade-scale-in{from{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}", he = class {
|
|
796
|
+
constructor(t) {
|
|
797
|
+
Rt(this, t), this.active = !1, this.closing = !1, this.close = () => {
|
|
798
|
+
var e;
|
|
799
|
+
this.closing || (this.disableAutoUpdate && this.disableAutoUpdate(), this.closing = !0, setTimeout(() => {
|
|
800
|
+
this.active = !1, this.closing = !1, this.updateTriggerAttributes();
|
|
801
|
+
}, 150), this.unlockBodyScroll(), (e = this.triggerEl) === null || e === void 0 || e.focus());
|
|
802
|
+
}, this.open = () => {
|
|
803
|
+
this.active = !0, this.updateChildMenuItems(), this.updateTriggerAttributes(), requestAnimationFrame(async () => {
|
|
804
|
+
await this.reposition(), this.childMenuItems.length > 0 ? this.childMenuItems[0].focus() : this.contentContainer.focus(), this.disableAutoUpdate && this.disableAutoUpdate(), this.disableAutoUpdate = ne(this.triggerEl, this.contentContainer, this.reposition), this.scrollContainer.scrollTop = 0, this.lockBodyScroll();
|
|
805
|
+
});
|
|
806
|
+
}, this.toggle = () => {
|
|
807
|
+
this.active ? this.close() : this.open();
|
|
808
|
+
}, this.onKeydown = (e) => {
|
|
809
|
+
e.code === "Escape" && this.active && this.close();
|
|
810
|
+
}, this.onContentClick = () => {
|
|
811
|
+
!this.active || this.close();
|
|
812
|
+
}, this.reposition = async () => {
|
|
813
|
+
const e = !window.matchMedia("(min-width: 768px)").matches;
|
|
814
|
+
if (!(!Boolean(this.triggerEl) || !Boolean(this.contentContainer))) {
|
|
815
|
+
if (e) {
|
|
816
|
+
this.position = void 0;
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
819
|
+
this.position = await ie(this.triggerEl, this.contentContainer, {
|
|
820
|
+
middleware: [Yt(), Wt()],
|
|
821
|
+
placement: "bottom-start",
|
|
822
|
+
strategy: "fixed"
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
componentDidLoad() {
|
|
828
|
+
this.connectTrigger(), this.updateChildMenuItems(), this.updateTriggerAttributes();
|
|
829
|
+
}
|
|
830
|
+
disconnectedCallback() {
|
|
831
|
+
ut(this.scrollContainer);
|
|
832
|
+
}
|
|
833
|
+
onWindowFocusout(t) {
|
|
834
|
+
if (!this.active)
|
|
835
|
+
return;
|
|
836
|
+
const e = t.relatedTarget;
|
|
837
|
+
(e === null || !this.el.contains(e) && !this.childMenuItems.some((n) => {
|
|
838
|
+
var i;
|
|
839
|
+
return (i = e.shadowRoot) === null || i === void 0 ? void 0 : i.contains(n);
|
|
840
|
+
})) && this.close();
|
|
841
|
+
}
|
|
842
|
+
connectTrigger() {
|
|
843
|
+
var t;
|
|
844
|
+
const e = document.querySelector(`#${this.trigger}`);
|
|
845
|
+
this.triggerEl = (e == null ? void 0 : e.children[0]) || ((t = e == null ? void 0 : e.shadowRoot) === null || t === void 0 ? void 0 : t.children[0]) || e, Boolean(this.triggerEl) && this.triggerEl.addEventListener("click", this.toggle);
|
|
846
|
+
}
|
|
847
|
+
updateTriggerAttributes() {
|
|
848
|
+
!Boolean(this.triggerEl) || (this.triggerEl.setAttribute("aria-controls", this.popoverId), this.triggerEl.setAttribute("aria-expanded", String(this.active)), this.triggerEl.setAttribute("aria-haspopup", "dialog"));
|
|
849
|
+
}
|
|
850
|
+
updateChildMenuItems() {
|
|
851
|
+
this.childMenuItems = Pt(this.el, '[role="menuitem"]');
|
|
852
|
+
}
|
|
853
|
+
lockBodyScroll() {
|
|
854
|
+
window.matchMedia("(min-width: 768px)").matches || ue(this.scrollContainer);
|
|
855
|
+
}
|
|
856
|
+
unlockBodyScroll() {
|
|
857
|
+
ut(this.scrollContainer);
|
|
858
|
+
}
|
|
859
|
+
render() {
|
|
860
|
+
var t, e;
|
|
861
|
+
const o = Et("popover", {
|
|
862
|
+
"popover--closing": this.closing,
|
|
863
|
+
"popover--active": this.active,
|
|
864
|
+
"popover--inactive": !this.active
|
|
865
|
+
});
|
|
866
|
+
return S(Tt, { id: this.popoverId }, S("div", { class: o, onKeyDown: this.onKeydown }, S("div", { "aria-hidden": this.active ? "false" : "true", "aria-label": this.label, class: "popover__content", onClick: this.onContentClick, role: "dialog", tabindex: "-1", ref: (n) => this.contentContainer = n, style: {
|
|
867
|
+
top: Boolean(this.position) ? `${(t = this.position) === null || t === void 0 ? void 0 : t.y}px` : "",
|
|
868
|
+
left: Boolean(this.position) ? `${(e = this.position) === null || e === void 0 ? void 0 : e.x}px` : ""
|
|
869
|
+
} }, S("span", { class: "popover__handle" }), S("div", { class: "popover__scroll-container", ref: (n) => this.scrollContainer = n }, S("slot", null))), this.active && S("div", { class: "popover__backdrop", onClick: this.close })));
|
|
870
|
+
}
|
|
871
|
+
get el() {
|
|
872
|
+
return St(this);
|
|
873
|
+
}
|
|
874
|
+
};
|
|
875
|
+
he.style = pe;
|
|
876
|
+
export {
|
|
877
|
+
he as flip_popover
|
|
878
|
+
};
|