wj-elements 0.7.7 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animations.js +28 -51
- package/dist/animations.js.map +1 -1
- package/dist/base-path.js +19 -31
- package/dist/base-path.js.map +1 -1
- package/dist/custom-elements.json +11504 -11499
- package/dist/dark.css +1 -302
- package/dist/date.js +16 -36
- package/dist/date.js.map +1 -1
- package/dist/element-utils.js +20 -81
- package/dist/element-utils.js.map +1 -1
- package/dist/event.js +49 -165
- package/dist/event.js.map +1 -1
- package/dist/form-associated-element-BjeJn7j8.js +101 -0
- package/dist/{form-associated-element-DEQ4y-jn.js.map → form-associated-element-BjeJn7j8.js.map} +1 -1
- package/dist/icon-DmsqtDpL.js +102 -0
- package/dist/{icon-CReYMzAK.js.map → icon-DmsqtDpL.js.map} +1 -1
- package/dist/light.css +1 -731
- package/dist/localize.js +36 -111
- package/dist/localize.js.map +1 -1
- package/dist/packages/wje-accordion-item/accordion-item.element.d.ts +3 -2
- package/dist/permissions.js +14 -41
- package/dist/permissions.js.map +1 -1
- package/dist/popup.element-CbkhthPP.js +806 -0
- package/dist/{popup.element-CwXvVFK7.js.map → popup.element-CbkhthPP.js.map} +1 -1
- package/dist/router-links-CNsJ-elb.js +105 -0
- package/dist/{router-links-wjqCnncc.js.map → router-links-CNsJ-elb.js.map} +1 -1
- package/dist/skeleton.css +1 -197
- package/dist/styles.css +1 -866
- package/dist/universal-service.js +48 -109
- package/dist/universal-service.js.map +1 -1
- package/dist/utils.js +11 -18
- package/dist/utils.js.map +1 -1
- package/dist/web-types.json +760 -760
- package/dist/wje-accordion-item.js +33 -106
- package/dist/wje-accordion-item.js.map +1 -1
- package/dist/wje-accordion.js +19 -84
- package/dist/wje-accordion.js.map +1 -1
- package/dist/wje-animation.js +37 -4258
- package/dist/wje-animation.js.map +1 -1
- package/dist/wje-aside.js +9 -34
- package/dist/wje-aside.js.map +1 -1
- package/dist/wje-avatar.js +36 -126
- package/dist/wje-avatar.js.map +1 -1
- package/dist/wje-badge.js +10 -52
- package/dist/wje-badge.js.map +1 -1
- package/dist/wje-breadcrumb.js +205 -672
- package/dist/wje-breadcrumb.js.map +1 -1
- package/dist/wje-breadcrumbs.js +177 -633
- package/dist/wje-breadcrumbs.js.map +1 -1
- package/dist/wje-button-group.js +48 -153
- package/dist/wje-button-group.js.map +1 -1
- package/dist/wje-button.js +92 -413
- package/dist/wje-button.js.map +1 -1
- package/dist/wje-card-content.js +7 -30
- package/dist/wje-card-content.js.map +1 -1
- package/dist/wje-card-controls.js +7 -30
- package/dist/wje-card-controls.js.map +1 -1
- package/dist/wje-card-header.js +7 -30
- package/dist/wje-card-header.js.map +1 -1
- package/dist/wje-card-subtitle.js +7 -34
- package/dist/wje-card-subtitle.js.map +1 -1
- package/dist/wje-card-title.js +7 -34
- package/dist/wje-card-title.js.map +1 -1
- package/dist/wje-card.js +15 -71
- package/dist/wje-card.js.map +1 -1
- package/dist/wje-carousel-item.js +12 -56
- package/dist/wje-carousel-item.js.map +1 -1
- package/dist/wje-carousel.js +154 -509
- package/dist/wje-carousel.js.map +1 -1
- package/dist/wje-checkbox.js +50 -227
- package/dist/wje-checkbox.js.map +1 -1
- package/dist/wje-chip.js +43 -160
- package/dist/wje-chip.js.map +1 -1
- package/dist/wje-col.js +7 -20
- package/dist/wje-col.js.map +1 -1
- package/dist/wje-color-picker.js +445 -1464
- package/dist/wje-color-picker.js.map +1 -1
- package/dist/wje-container.js +9 -35
- package/dist/wje-container.js.map +1 -1
- package/dist/wje-copy-button.js +64 -204
- package/dist/wje-copy-button.js.map +1 -1
- package/dist/wje-dialog.js +85 -553
- package/dist/wje-dialog.js.map +1 -1
- package/dist/wje-divider.js +7 -34
- package/dist/wje-divider.js.map +1 -1
- package/dist/wje-dropdown.js +78 -305
- package/dist/wje-dropdown.js.map +1 -1
- package/dist/wje-element.js +191 -700
- package/dist/wje-element.js.map +1 -1
- package/dist/wje-file-upload-item.js +51 -156
- package/dist/wje-file-upload-item.js.map +1 -1
- package/dist/wje-file-upload.js +181 -619
- package/dist/wje-file-upload.js.map +1 -1
- package/dist/wje-footer.js +7 -31
- package/dist/wje-footer.js.map +1 -1
- package/dist/wje-form.js +7 -32
- package/dist/wje-form.js.map +1 -1
- package/dist/wje-format-digital.js +26 -118
- package/dist/wje-format-digital.js.map +1 -1
- package/dist/wje-grid.js +7 -33
- package/dist/wje-grid.js.map +1 -1
- package/dist/wje-header.js +9 -35
- package/dist/wje-header.js.map +1 -1
- package/dist/wje-icon-library.js +12 -18
- package/dist/wje-icon-library.js.map +1 -1
- package/dist/wje-icon-picker.js +65 -320
- package/dist/wje-icon-picker.js.map +1 -1
- package/dist/wje-icon.js +1 -1
- package/dist/wje-img-comparer.js +37 -114
- package/dist/wje-img-comparer.js.map +1 -1
- package/dist/wje-img.js +50 -198
- package/dist/wje-img.js.map +1 -1
- package/dist/wje-infinite-scroll.js +94 -346
- package/dist/wje-infinite-scroll.js.map +1 -1
- package/dist/wje-input-file.js +23 -84
- package/dist/wje-input-file.js.map +1 -1
- package/dist/wje-input.js +78 -392
- package/dist/wje-input.js.map +1 -1
- package/dist/wje-item.js +11 -64
- package/dist/wje-item.js.map +1 -1
- package/dist/wje-kanban.js +124 -401
- package/dist/wje-kanban.js.map +1 -1
- package/dist/wje-label.js +9 -32
- package/dist/wje-label.js.map +1 -1
- package/dist/wje-level-indicator.js +38 -157
- package/dist/wje-level-indicator.js.map +1 -1
- package/dist/wje-list.js +10 -40
- package/dist/wje-list.js.map +1 -1
- package/dist/wje-main.js +7 -31
- package/dist/wje-main.js.map +1 -1
- package/dist/wje-masonry.js +66 -211
- package/dist/wje-masonry.js.map +1 -1
- package/dist/wje-master.js +45 -161
- package/dist/wje-master.js.map +1 -1
- package/dist/wje-menu-button.js +10 -38
- package/dist/wje-menu-button.js.map +1 -1
- package/dist/wje-menu-item.js +127 -577
- package/dist/wje-menu-item.js.map +1 -1
- package/dist/wje-menu-label.js +9 -35
- package/dist/wje-menu-label.js.map +1 -1
- package/dist/wje-menu.js +14 -49
- package/dist/wje-menu.js.map +1 -1
- package/dist/wje-option.js +48 -279
- package/dist/wje-option.js.map +1 -1
- package/dist/wje-options.js +130 -384
- package/dist/wje-options.js.map +1 -1
- package/dist/wje-orgchart-group.js +16 -52
- package/dist/wje-orgchart-group.js.map +1 -1
- package/dist/wje-orgchart-item.js +24 -93
- package/dist/wje-orgchart-item.js.map +1 -1
- package/dist/wje-orgchart.js +18 -68
- package/dist/wje-orgchart.js.map +1 -1
- package/dist/wje-pagination.js +113 -397
- package/dist/wje-pagination.js.map +1 -1
- package/dist/wje-popup.js +3 -3
- package/dist/wje-popup.js.map +1 -1
- package/dist/wje-progress-bar.js +53 -205
- package/dist/wje-progress-bar.js.map +1 -1
- package/dist/wje-qr-code.js +398 -2980
- package/dist/wje-qr-code.js.map +1 -1
- package/dist/wje-radio-group.js +52 -190
- package/dist/wje-radio-group.js.map +1 -1
- package/dist/wje-radio.js +24 -118
- package/dist/wje-radio.js.map +1 -1
- package/dist/wje-rate.js +62 -266
- package/dist/wje-rate.js.map +1 -1
- package/dist/wje-relative-time.js +24 -99
- package/dist/wje-relative-time.js.map +1 -1
- package/dist/wje-reorder-dropzone.js +9 -31
- package/dist/wje-reorder-dropzone.js.map +1 -1
- package/dist/wje-reorder-handle.js +67 -204
- package/dist/wje-reorder-handle.js.map +1 -1
- package/dist/wje-reorder-item.js +14 -44
- package/dist/wje-reorder-item.js.map +1 -1
- package/dist/wje-reorder.js +61 -246
- package/dist/wje-reorder.js.map +1 -1
- package/dist/wje-route.js +6 -24
- package/dist/wje-route.js.map +1 -1
- package/dist/wje-router-link.js +11 -39
- package/dist/wje-router-link.js.map +1 -1
- package/dist/wje-router-outlet.js +76 -172
- package/dist/wje-router-outlet.js.map +1 -1
- package/dist/wje-routerx.js +537 -1331
- package/dist/wje-routerx.js.map +1 -1
- package/dist/wje-row.js +9 -31
- package/dist/wje-row.js.map +1 -1
- package/dist/wje-select.js +326 -1152
- package/dist/wje-select.js.map +1 -1
- package/dist/wje-slider.js +44 -225
- package/dist/wje-slider.js.map +1 -1
- package/dist/wje-sliding-container.js +295 -1319
- package/dist/wje-sliding-container.js.map +1 -1
- package/dist/wje-split-view.js +35 -121
- package/dist/wje-split-view.js.map +1 -1
- package/dist/wje-status.js +14 -45
- package/dist/wje-status.js.map +1 -1
- package/dist/wje-step.js +9 -32
- package/dist/wje-step.js.map +1 -1
- package/dist/wje-stepper.js +109 -357
- package/dist/wje-stepper.js.map +1 -1
- package/dist/wje-store.js +67 -360
- package/dist/wje-store.js.map +1 -1
- package/dist/wje-tab-group.js +85 -314
- package/dist/wje-tab-group.js.map +1 -1
- package/dist/wje-tab-panel.js +7 -28
- package/dist/wje-tab-panel.js.map +1 -1
- package/dist/wje-tab.js +21 -198
- package/dist/wje-tab.js.map +1 -1
- package/dist/wje-textarea.js +64 -264
- package/dist/wje-textarea.js.map +1 -1
- package/dist/wje-thumbnail.js +10 -51
- package/dist/wje-thumbnail.js.map +1 -1
- package/dist/wje-toast.js +127 -632
- package/dist/wje-toast.js.map +1 -1
- package/dist/wje-toggle.js +52 -177
- package/dist/wje-toggle.js.map +1 -1
- package/dist/wje-toolbar-action.js +128 -456
- package/dist/wje-toolbar-action.js.map +1 -1
- package/dist/wje-toolbar.js +75 -270
- package/dist/wje-toolbar.js.map +1 -1
- package/dist/wje-tooltip.js +50 -161
- package/dist/wje-tooltip.js.map +1 -1
- package/dist/wje-tree-item.js +70 -301
- package/dist/wje-tree-item.js.map +1 -1
- package/dist/wje-tree.js +145 -489
- package/dist/wje-tree.js.map +1 -1
- package/dist/wje-visually-hidden.js +7 -34
- package/dist/wje-visually-hidden.js.map +1 -1
- package/package.json +3 -2
- package/dist/form-associated-element-DEQ4y-jn.js +0 -245
- package/dist/icon-CReYMzAK.js +0 -245
- package/dist/popup.element-CwXvVFK7.js +0 -2133
- package/dist/router-links-wjqCnncc.js +0 -156
|
@@ -0,0 +1,806 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import t from "./wje-element.js";
|
|
5
|
+
import { event as e } from "./event.js";
|
|
6
|
+
const o = Math.min, i = Math.max, n = Math.round, r = Math.floor, s = (t2) => ({ x: t2, y: t2 }), a = { left: "right", right: "left", bottom: "top", top: "bottom" }, l = { start: "end", end: "start" };
|
|
7
|
+
function c(t2, e2, n2) {
|
|
8
|
+
return i(t2, o(e2, n2));
|
|
9
|
+
}
|
|
10
|
+
function h(t2, e2) {
|
|
11
|
+
return "function" == typeof t2 ? t2(e2) : t2;
|
|
12
|
+
}
|
|
13
|
+
function p(t2) {
|
|
14
|
+
return t2.split("-")[0];
|
|
15
|
+
}
|
|
16
|
+
function d(t2) {
|
|
17
|
+
return t2.split("-")[1];
|
|
18
|
+
}
|
|
19
|
+
function u(t2) {
|
|
20
|
+
return "y" === t2 ? "height" : "width";
|
|
21
|
+
}
|
|
22
|
+
const f = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
23
|
+
function m(t2) {
|
|
24
|
+
return f.has(p(t2)) ? "y" : "x";
|
|
25
|
+
}
|
|
26
|
+
function g(t2) {
|
|
27
|
+
return "x" === m(t2) ? "y" : "x";
|
|
28
|
+
}
|
|
29
|
+
function v(t2) {
|
|
30
|
+
return t2.replace(/start|end/g, (t3) => l[t3]);
|
|
31
|
+
}
|
|
32
|
+
const w = ["left", "right"], b = ["right", "left"], y = ["top", "bottom"], E = ["bottom", "top"];
|
|
33
|
+
function x(t2, e2, o2, i2) {
|
|
34
|
+
const n2 = d(t2);
|
|
35
|
+
let r2 = (function(t3, e3, o3) {
|
|
36
|
+
switch (t3) {
|
|
37
|
+
case "top":
|
|
38
|
+
case "bottom":
|
|
39
|
+
return o3 ? e3 ? b : w : e3 ? w : b;
|
|
40
|
+
case "left":
|
|
41
|
+
case "right":
|
|
42
|
+
return e3 ? y : E;
|
|
43
|
+
default:
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
})(p(t2), "start" === o2, i2);
|
|
47
|
+
return n2 && (r2 = r2.map((t3) => t3 + "-" + n2), e2 && (r2 = r2.concat(r2.map(v)))), r2;
|
|
48
|
+
}
|
|
49
|
+
function _(t2) {
|
|
50
|
+
return t2.replace(/left|right|bottom|top/g, (t3) => a[t3]);
|
|
51
|
+
}
|
|
52
|
+
function S(t2) {
|
|
53
|
+
return "number" != typeof t2 ? (function(t3) {
|
|
54
|
+
return { top: 0, right: 0, bottom: 0, left: 0, ...t3 };
|
|
55
|
+
})(t2) : { top: t2, right: t2, bottom: t2, left: t2 };
|
|
56
|
+
}
|
|
57
|
+
function A(t2) {
|
|
58
|
+
const { x: e2, y: o2, width: i2, height: n2 } = t2;
|
|
59
|
+
return { width: i2, height: n2, top: o2, left: e2, right: e2 + i2, bottom: o2 + n2, x: e2, y: o2 };
|
|
60
|
+
}
|
|
61
|
+
function L(t2, e2, o2) {
|
|
62
|
+
let { reference: i2, floating: n2 } = t2;
|
|
63
|
+
const r2 = m(e2), s2 = g(e2), a2 = u(s2), l2 = p(e2), c2 = "y" === r2, h2 = i2.x + i2.width / 2 - n2.width / 2, f2 = i2.y + i2.height / 2 - n2.height / 2, v2 = i2[a2] / 2 - n2[a2] / 2;
|
|
64
|
+
let w2;
|
|
65
|
+
switch (l2) {
|
|
66
|
+
case "top":
|
|
67
|
+
w2 = { x: h2, y: i2.y - n2.height };
|
|
68
|
+
break;
|
|
69
|
+
case "bottom":
|
|
70
|
+
w2 = { x: h2, y: i2.y + i2.height };
|
|
71
|
+
break;
|
|
72
|
+
case "right":
|
|
73
|
+
w2 = { x: i2.x + i2.width, y: f2 };
|
|
74
|
+
break;
|
|
75
|
+
case "left":
|
|
76
|
+
w2 = { x: i2.x - n2.width, y: f2 };
|
|
77
|
+
break;
|
|
78
|
+
default:
|
|
79
|
+
w2 = { x: i2.x, y: i2.y };
|
|
80
|
+
}
|
|
81
|
+
switch (d(e2)) {
|
|
82
|
+
case "start":
|
|
83
|
+
w2[s2] -= v2 * (o2 && c2 ? -1 : 1);
|
|
84
|
+
break;
|
|
85
|
+
case "end":
|
|
86
|
+
w2[s2] += v2 * (o2 && c2 ? -1 : 1);
|
|
87
|
+
}
|
|
88
|
+
return w2;
|
|
89
|
+
}
|
|
90
|
+
async function k(t2, e2) {
|
|
91
|
+
var o2;
|
|
92
|
+
void 0 === e2 && (e2 = {});
|
|
93
|
+
const { x: i2, y: n2, platform: r2, rects: s2, elements: a2, strategy: l2 } = t2, { boundary: c2 = "clippingAncestors", rootBoundary: p2 = "viewport", elementContext: d2 = "floating", altBoundary: u2 = false, padding: f2 = 0 } = h(e2, t2), m2 = S(f2), g2 = a2[u2 ? "floating" === d2 ? "reference" : "floating" : d2], v2 = A(await r2.getClippingRect({ element: null == (o2 = await (null == r2.isElement ? void 0 : r2.isElement(g2))) || o2 ? g2 : g2.contextElement || await (null == r2.getDocumentElement ? void 0 : r2.getDocumentElement(a2.floating)), boundary: c2, rootBoundary: p2, strategy: l2 })), w2 = "floating" === d2 ? { x: i2, y: n2, width: s2.floating.width, height: s2.floating.height } : s2.reference, b2 = await (null == r2.getOffsetParent ? void 0 : r2.getOffsetParent(a2.floating)), y2 = await (null == r2.isElement ? void 0 : r2.isElement(b2)) && await (null == r2.getScale ? void 0 : r2.getScale(b2)) || { x: 1, y: 1 }, E2 = A(r2.convertOffsetParentRelativeRectToViewportRelativeRect ? await r2.convertOffsetParentRelativeRectToViewportRelativeRect({ elements: a2, rect: w2, offsetParent: b2, strategy: l2 }) : w2);
|
|
94
|
+
return { top: (v2.top - E2.top + m2.top) / y2.y, bottom: (E2.bottom - v2.bottom + m2.bottom) / y2.y, left: (v2.left - E2.left + m2.left) / y2.x, right: (E2.right - v2.right + m2.right) / y2.x };
|
|
95
|
+
}
|
|
96
|
+
const R = /* @__PURE__ */ new Set(["left", "top"]);
|
|
97
|
+
function C() {
|
|
98
|
+
return "undefined" != typeof window;
|
|
99
|
+
}
|
|
100
|
+
function T(t2) {
|
|
101
|
+
return j(t2) ? (t2.nodeName || "").toLowerCase() : "#document";
|
|
102
|
+
}
|
|
103
|
+
function B(t2) {
|
|
104
|
+
var e2;
|
|
105
|
+
return (null == t2 || null == (e2 = t2.ownerDocument) ? void 0 : e2.defaultView) || window;
|
|
106
|
+
}
|
|
107
|
+
function P(t2) {
|
|
108
|
+
var e2;
|
|
109
|
+
return null == (e2 = (j(t2) ? t2.ownerDocument : t2.document) || window.document) ? void 0 : e2.documentElement;
|
|
110
|
+
}
|
|
111
|
+
function j(t2) {
|
|
112
|
+
return !!C() && (t2 instanceof Node || t2 instanceof B(t2).Node);
|
|
113
|
+
}
|
|
114
|
+
function N(t2) {
|
|
115
|
+
return !!C() && (t2 instanceof Element || t2 instanceof B(t2).Element);
|
|
116
|
+
}
|
|
117
|
+
function D(t2) {
|
|
118
|
+
return !!C() && (t2 instanceof HTMLElement || t2 instanceof B(t2).HTMLElement);
|
|
119
|
+
}
|
|
120
|
+
function O(t2) {
|
|
121
|
+
return !(!C() || "undefined" == typeof ShadowRoot) && (t2 instanceof ShadowRoot || t2 instanceof B(t2).ShadowRoot);
|
|
122
|
+
}
|
|
123
|
+
const F = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
124
|
+
function H(t2) {
|
|
125
|
+
const { overflow: e2, overflowX: o2, overflowY: i2, display: n2 } = G(t2);
|
|
126
|
+
return /auto|scroll|overlay|hidden|clip/.test(e2 + i2 + o2) && !F.has(n2);
|
|
127
|
+
}
|
|
128
|
+
const M = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
129
|
+
function W(t2) {
|
|
130
|
+
return M.has(T(t2));
|
|
131
|
+
}
|
|
132
|
+
const z = [":popover-open", ":modal"];
|
|
133
|
+
function V(t2) {
|
|
134
|
+
return z.some((e2) => {
|
|
135
|
+
try {
|
|
136
|
+
return t2.matches(e2);
|
|
137
|
+
} catch (t3) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
const q = ["transform", "translate", "scale", "rotate", "perspective"], I = ["transform", "translate", "scale", "rotate", "perspective", "filter"], X = ["paint", "layout", "strict", "content"];
|
|
143
|
+
function Y(t2) {
|
|
144
|
+
const e2 = $(), o2 = N(t2) ? G(t2) : t2;
|
|
145
|
+
return q.some((t3) => !!o2[t3] && "none" !== o2[t3]) || !!o2.containerType && "normal" !== o2.containerType || !e2 && !!o2.backdropFilter && "none" !== o2.backdropFilter || !e2 && !!o2.filter && "none" !== o2.filter || I.some((t3) => (o2.willChange || "").includes(t3)) || X.some((t3) => (o2.contain || "").includes(t3));
|
|
146
|
+
}
|
|
147
|
+
function $() {
|
|
148
|
+
return !("undefined" == typeof CSS || !CSS.supports) && CSS.supports("-webkit-backdrop-filter", "none");
|
|
149
|
+
}
|
|
150
|
+
const J = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
151
|
+
function U(t2) {
|
|
152
|
+
return J.has(T(t2));
|
|
153
|
+
}
|
|
154
|
+
function G(t2) {
|
|
155
|
+
return B(t2).getComputedStyle(t2);
|
|
156
|
+
}
|
|
157
|
+
function K(t2) {
|
|
158
|
+
return N(t2) ? { scrollLeft: t2.scrollLeft, scrollTop: t2.scrollTop } : { scrollLeft: t2.scrollX, scrollTop: t2.scrollY };
|
|
159
|
+
}
|
|
160
|
+
function Q(t2) {
|
|
161
|
+
if ("html" === T(t2)) return t2;
|
|
162
|
+
const e2 = t2.assignedSlot || t2.parentNode || O(t2) && t2.host || P(t2);
|
|
163
|
+
return O(e2) ? e2.host : e2;
|
|
164
|
+
}
|
|
165
|
+
function Z(t2) {
|
|
166
|
+
const e2 = Q(t2);
|
|
167
|
+
return U(e2) ? t2.ownerDocument ? t2.ownerDocument.body : t2.body : D(e2) && H(e2) ? e2 : Z(e2);
|
|
168
|
+
}
|
|
169
|
+
function tt(t2, e2, o2) {
|
|
170
|
+
var i2;
|
|
171
|
+
void 0 === e2 && (e2 = []), void 0 === o2 && (o2 = true);
|
|
172
|
+
const n2 = Z(t2), r2 = n2 === (null == (i2 = t2.ownerDocument) ? void 0 : i2.body), s2 = B(n2);
|
|
173
|
+
if (r2) {
|
|
174
|
+
const t3 = et(s2);
|
|
175
|
+
return e2.concat(s2, s2.visualViewport || [], H(n2) ? n2 : [], t3 && o2 ? tt(t3) : []);
|
|
176
|
+
}
|
|
177
|
+
return e2.concat(n2, tt(n2, [], o2));
|
|
178
|
+
}
|
|
179
|
+
function et(t2) {
|
|
180
|
+
return t2.parent && Object.getPrototypeOf(t2.parent) ? t2.frameElement : null;
|
|
181
|
+
}
|
|
182
|
+
function ot(t2) {
|
|
183
|
+
const e2 = G(t2);
|
|
184
|
+
let o2 = parseFloat(e2.width) || 0, i2 = parseFloat(e2.height) || 0;
|
|
185
|
+
const r2 = D(t2), s2 = r2 ? t2.offsetWidth : o2, a2 = r2 ? t2.offsetHeight : i2, l2 = n(o2) !== s2 || n(i2) !== a2;
|
|
186
|
+
return l2 && (o2 = s2, i2 = a2), { width: o2, height: i2, $: l2 };
|
|
187
|
+
}
|
|
188
|
+
function it(t2) {
|
|
189
|
+
return N(t2) ? t2 : t2.contextElement;
|
|
190
|
+
}
|
|
191
|
+
function nt(t2) {
|
|
192
|
+
const e2 = it(t2);
|
|
193
|
+
if (!D(e2)) return s(1);
|
|
194
|
+
const o2 = e2.getBoundingClientRect(), { width: i2, height: r2, $: a2 } = ot(e2);
|
|
195
|
+
let l2 = (a2 ? n(o2.width) : o2.width) / i2, c2 = (a2 ? n(o2.height) : o2.height) / r2;
|
|
196
|
+
return l2 && Number.isFinite(l2) || (l2 = 1), c2 && Number.isFinite(c2) || (c2 = 1), { x: l2, y: c2 };
|
|
197
|
+
}
|
|
198
|
+
const rt = s(0);
|
|
199
|
+
function st(t2) {
|
|
200
|
+
const e2 = B(t2);
|
|
201
|
+
return $() && e2.visualViewport ? { x: e2.visualViewport.offsetLeft, y: e2.visualViewport.offsetTop } : rt;
|
|
202
|
+
}
|
|
203
|
+
function at(t2, e2, o2, i2) {
|
|
204
|
+
void 0 === e2 && (e2 = false), void 0 === o2 && (o2 = false);
|
|
205
|
+
const n2 = t2.getBoundingClientRect(), r2 = it(t2);
|
|
206
|
+
let a2 = s(1);
|
|
207
|
+
e2 && (i2 ? N(i2) && (a2 = nt(i2)) : a2 = nt(t2));
|
|
208
|
+
const l2 = (function(t3, e3, o3) {
|
|
209
|
+
return void 0 === e3 && (e3 = false), !(!o3 || e3 && o3 !== B(t3)) && e3;
|
|
210
|
+
})(r2, o2, i2) ? st(r2) : s(0);
|
|
211
|
+
let c2 = (n2.left + l2.x) / a2.x, h2 = (n2.top + l2.y) / a2.y, p2 = n2.width / a2.x, d2 = n2.height / a2.y;
|
|
212
|
+
if (r2) {
|
|
213
|
+
const t3 = B(r2), e3 = i2 && N(i2) ? B(i2) : i2;
|
|
214
|
+
let o3 = t3, n3 = et(o3);
|
|
215
|
+
for (; n3 && i2 && e3 !== o3; ) {
|
|
216
|
+
const t4 = nt(n3), e4 = n3.getBoundingClientRect(), i3 = G(n3), r3 = e4.left + (n3.clientLeft + parseFloat(i3.paddingLeft)) * t4.x, s2 = e4.top + (n3.clientTop + parseFloat(i3.paddingTop)) * t4.y;
|
|
217
|
+
c2 *= t4.x, h2 *= t4.y, p2 *= t4.x, d2 *= t4.y, c2 += r3, h2 += s2, o3 = B(n3), n3 = et(o3);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return A({ width: p2, height: d2, x: c2, y: h2 });
|
|
221
|
+
}
|
|
222
|
+
function lt(t2, e2) {
|
|
223
|
+
const o2 = K(t2).scrollLeft;
|
|
224
|
+
return e2 ? e2.left + o2 : at(P(t2)).left + o2;
|
|
225
|
+
}
|
|
226
|
+
function ct(t2, e2) {
|
|
227
|
+
const o2 = t2.getBoundingClientRect();
|
|
228
|
+
return { x: o2.left + e2.scrollLeft - lt(t2, o2), y: o2.top + e2.scrollTop };
|
|
229
|
+
}
|
|
230
|
+
const ht = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
231
|
+
function pt(t2, e2, o2) {
|
|
232
|
+
let n2;
|
|
233
|
+
if ("viewport" === e2) n2 = (function(t3, e3) {
|
|
234
|
+
const o3 = B(t3), i2 = P(t3), n3 = o3.visualViewport;
|
|
235
|
+
let r2 = i2.clientWidth, s2 = i2.clientHeight, a2 = 0, l2 = 0;
|
|
236
|
+
if (n3) {
|
|
237
|
+
r2 = n3.width, s2 = n3.height;
|
|
238
|
+
const t4 = $();
|
|
239
|
+
(!t4 || t4 && "fixed" === e3) && (a2 = n3.offsetLeft, l2 = n3.offsetTop);
|
|
240
|
+
}
|
|
241
|
+
const c2 = lt(i2);
|
|
242
|
+
if (c2 <= 0) {
|
|
243
|
+
const t4 = i2.ownerDocument, e4 = t4.body, o4 = getComputedStyle(e4), n4 = "CSS1Compat" === t4.compatMode && parseFloat(o4.marginLeft) + parseFloat(o4.marginRight) || 0, s3 = Math.abs(i2.clientWidth - e4.clientWidth - n4);
|
|
244
|
+
s3 <= 25 && (r2 -= s3);
|
|
245
|
+
} else c2 <= 25 && (r2 += c2);
|
|
246
|
+
return { width: r2, height: s2, x: a2, y: l2 };
|
|
247
|
+
})(t2, o2);
|
|
248
|
+
else if ("document" === e2) n2 = (function(t3) {
|
|
249
|
+
const e3 = P(t3), o3 = K(t3), n3 = t3.ownerDocument.body, r2 = i(e3.scrollWidth, e3.clientWidth, n3.scrollWidth, n3.clientWidth), s2 = i(e3.scrollHeight, e3.clientHeight, n3.scrollHeight, n3.clientHeight);
|
|
250
|
+
let a2 = -o3.scrollLeft + lt(t3);
|
|
251
|
+
const l2 = -o3.scrollTop;
|
|
252
|
+
return "rtl" === G(n3).direction && (a2 += i(e3.clientWidth, n3.clientWidth) - r2), { width: r2, height: s2, x: a2, y: l2 };
|
|
253
|
+
})(P(t2));
|
|
254
|
+
else if (N(e2)) n2 = (function(t3, e3) {
|
|
255
|
+
const o3 = at(t3, true, "fixed" === e3), i2 = o3.top + t3.clientTop, n3 = o3.left + t3.clientLeft, r2 = D(t3) ? nt(t3) : s(1);
|
|
256
|
+
return { width: t3.clientWidth * r2.x, height: t3.clientHeight * r2.y, x: n3 * r2.x, y: i2 * r2.y };
|
|
257
|
+
})(e2, o2);
|
|
258
|
+
else {
|
|
259
|
+
const o3 = st(t2);
|
|
260
|
+
n2 = { x: e2.x - o3.x, y: e2.y - o3.y, width: e2.width, height: e2.height };
|
|
261
|
+
}
|
|
262
|
+
return A(n2);
|
|
263
|
+
}
|
|
264
|
+
function dt(t2, e2) {
|
|
265
|
+
const o2 = Q(t2);
|
|
266
|
+
return !(o2 === e2 || !N(o2) || U(o2)) && ("fixed" === G(o2).position || dt(o2, e2));
|
|
267
|
+
}
|
|
268
|
+
function ut(t2, e2, o2) {
|
|
269
|
+
const i2 = D(e2), n2 = P(e2), r2 = "fixed" === o2, a2 = at(t2, true, r2, e2);
|
|
270
|
+
let l2 = { scrollLeft: 0, scrollTop: 0 };
|
|
271
|
+
const c2 = s(0);
|
|
272
|
+
function h2() {
|
|
273
|
+
c2.x = lt(n2);
|
|
274
|
+
}
|
|
275
|
+
if (i2 || !i2 && !r2) if (("body" !== T(e2) || H(n2)) && (l2 = K(e2)), i2) {
|
|
276
|
+
const t3 = at(e2, true, r2, e2);
|
|
277
|
+
c2.x = t3.x + e2.clientLeft, c2.y = t3.y + e2.clientTop;
|
|
278
|
+
} else n2 && h2();
|
|
279
|
+
r2 && !i2 && n2 && h2();
|
|
280
|
+
const p2 = !n2 || i2 || r2 ? s(0) : ct(n2, l2);
|
|
281
|
+
return { x: a2.left + l2.scrollLeft - c2.x - p2.x, y: a2.top + l2.scrollTop - c2.y - p2.y, width: a2.width, height: a2.height };
|
|
282
|
+
}
|
|
283
|
+
function ft(t2) {
|
|
284
|
+
return "static" === G(t2).position;
|
|
285
|
+
}
|
|
286
|
+
function mt(t2, e2) {
|
|
287
|
+
if (!D(t2) || "fixed" === G(t2).position) return null;
|
|
288
|
+
if (e2) return e2(t2);
|
|
289
|
+
let o2 = t2.offsetParent;
|
|
290
|
+
return P(t2) === o2 && (o2 = o2.ownerDocument.body), o2;
|
|
291
|
+
}
|
|
292
|
+
function gt(t2, e2) {
|
|
293
|
+
const o2 = B(t2);
|
|
294
|
+
if (V(t2)) return o2;
|
|
295
|
+
if (!D(t2)) {
|
|
296
|
+
let e3 = Q(t2);
|
|
297
|
+
for (; e3 && !U(e3); ) {
|
|
298
|
+
if (N(e3) && !ft(e3)) return e3;
|
|
299
|
+
e3 = Q(e3);
|
|
300
|
+
}
|
|
301
|
+
return o2;
|
|
302
|
+
}
|
|
303
|
+
let i2 = mt(t2, e2);
|
|
304
|
+
for (; i2 && W(i2) && ft(i2); ) i2 = mt(i2, e2);
|
|
305
|
+
return i2 && U(i2) && ft(i2) && !Y(i2) ? o2 : i2 || (function(t3) {
|
|
306
|
+
let e3 = Q(t3);
|
|
307
|
+
for (; D(e3) && !U(e3); ) {
|
|
308
|
+
if (Y(e3)) return e3;
|
|
309
|
+
if (V(e3)) return null;
|
|
310
|
+
e3 = Q(e3);
|
|
311
|
+
}
|
|
312
|
+
return null;
|
|
313
|
+
})(t2) || o2;
|
|
314
|
+
}
|
|
315
|
+
const vt = { convertOffsetParentRelativeRectToViewportRelativeRect: function(t2) {
|
|
316
|
+
let { elements: e2, rect: o2, offsetParent: i2, strategy: n2 } = t2;
|
|
317
|
+
const r2 = "fixed" === n2, a2 = P(i2), l2 = !!e2 && V(e2.floating);
|
|
318
|
+
if (i2 === a2 || l2 && r2) return o2;
|
|
319
|
+
let c2 = { scrollLeft: 0, scrollTop: 0 }, h2 = s(1);
|
|
320
|
+
const p2 = s(0), d2 = D(i2);
|
|
321
|
+
if ((d2 || !d2 && !r2) && (("body" !== T(i2) || H(a2)) && (c2 = K(i2)), D(i2))) {
|
|
322
|
+
const t3 = at(i2);
|
|
323
|
+
h2 = nt(i2), p2.x = t3.x + i2.clientLeft, p2.y = t3.y + i2.clientTop;
|
|
324
|
+
}
|
|
325
|
+
const u2 = !a2 || d2 || r2 ? s(0) : ct(a2, c2);
|
|
326
|
+
return { width: o2.width * h2.x, height: o2.height * h2.y, x: o2.x * h2.x - c2.scrollLeft * h2.x + p2.x + u2.x, y: o2.y * h2.y - c2.scrollTop * h2.y + p2.y + u2.y };
|
|
327
|
+
}, getDocumentElement: P, getClippingRect: function(t2) {
|
|
328
|
+
let { element: e2, boundary: n2, rootBoundary: r2, strategy: s2 } = t2;
|
|
329
|
+
const a2 = [..."clippingAncestors" === n2 ? V(e2) ? [] : (function(t3, e3) {
|
|
330
|
+
const o2 = e3.get(t3);
|
|
331
|
+
if (o2) return o2;
|
|
332
|
+
let i2 = tt(t3, [], false).filter((t4) => N(t4) && "body" !== T(t4)), n3 = null;
|
|
333
|
+
const r3 = "fixed" === G(t3).position;
|
|
334
|
+
let s3 = r3 ? Q(t3) : t3;
|
|
335
|
+
for (; N(s3) && !U(s3); ) {
|
|
336
|
+
const e4 = G(s3), o3 = Y(s3);
|
|
337
|
+
o3 || "fixed" !== e4.position || (n3 = null), (r3 ? !o3 && !n3 : !o3 && "static" === e4.position && n3 && ht.has(n3.position) || H(s3) && !o3 && dt(t3, s3)) ? i2 = i2.filter((t4) => t4 !== s3) : n3 = e4, s3 = Q(s3);
|
|
338
|
+
}
|
|
339
|
+
return e3.set(t3, i2), i2;
|
|
340
|
+
})(e2, this._c) : [].concat(n2), r2], l2 = a2[0], c2 = a2.reduce((t3, n3) => {
|
|
341
|
+
const r3 = pt(e2, n3, s2);
|
|
342
|
+
return t3.top = i(r3.top, t3.top), t3.right = o(r3.right, t3.right), t3.bottom = o(r3.bottom, t3.bottom), t3.left = i(r3.left, t3.left), t3;
|
|
343
|
+
}, pt(e2, l2, s2));
|
|
344
|
+
return { width: c2.right - c2.left, height: c2.bottom - c2.top, x: c2.left, y: c2.top };
|
|
345
|
+
}, getOffsetParent: gt, getElementRects: async function(t2) {
|
|
346
|
+
const e2 = this.getOffsetParent || gt, o2 = this.getDimensions, i2 = await o2(t2.floating);
|
|
347
|
+
return { reference: ut(t2.reference, await e2(t2.floating), t2.strategy), floating: { x: 0, y: 0, width: i2.width, height: i2.height } };
|
|
348
|
+
}, getClientRects: function(t2) {
|
|
349
|
+
return Array.from(t2.getClientRects());
|
|
350
|
+
}, getDimensions: function(t2) {
|
|
351
|
+
const { width: e2, height: o2 } = ot(t2);
|
|
352
|
+
return { width: e2, height: o2 };
|
|
353
|
+
}, getScale: nt, isElement: N, isRTL: function(t2) {
|
|
354
|
+
return "rtl" === G(t2).direction;
|
|
355
|
+
} };
|
|
356
|
+
function wt(t2, e2) {
|
|
357
|
+
return t2.x === e2.x && t2.y === e2.y && t2.width === e2.width && t2.height === e2.height;
|
|
358
|
+
}
|
|
359
|
+
function bt(t2, e2, n2, s2) {
|
|
360
|
+
void 0 === s2 && (s2 = {});
|
|
361
|
+
const { ancestorScroll: a2 = true, ancestorResize: l2 = true, elementResize: c2 = "function" == typeof ResizeObserver, layoutShift: h2 = "function" == typeof IntersectionObserver, animationFrame: p2 = false } = s2, d2 = it(t2), u2 = a2 || l2 ? [...d2 ? tt(d2) : [], ...tt(e2)] : [];
|
|
362
|
+
u2.forEach((t3) => {
|
|
363
|
+
a2 && t3.addEventListener("scroll", n2, { passive: true }), l2 && t3.addEventListener("resize", n2);
|
|
364
|
+
});
|
|
365
|
+
const f2 = d2 && h2 ? (function(t3, e3) {
|
|
366
|
+
let n3, s3 = null;
|
|
367
|
+
const a3 = P(t3);
|
|
368
|
+
function l3() {
|
|
369
|
+
var t4;
|
|
370
|
+
clearTimeout(n3), null == (t4 = s3) || t4.disconnect(), s3 = null;
|
|
371
|
+
}
|
|
372
|
+
return (function c3(h3, p3) {
|
|
373
|
+
void 0 === h3 && (h3 = false), void 0 === p3 && (p3 = 1), l3();
|
|
374
|
+
const d3 = t3.getBoundingClientRect(), { left: u3, top: f3, width: m3, height: g3 } = d3;
|
|
375
|
+
if (h3 || e3(), !m3 || !g3) return;
|
|
376
|
+
const v3 = { rootMargin: -r(f3) + "px " + -r(a3.clientWidth - (u3 + m3)) + "px " + -r(a3.clientHeight - (f3 + g3)) + "px " + -r(u3) + "px", threshold: i(0, o(1, p3)) || 1 };
|
|
377
|
+
let w3 = true;
|
|
378
|
+
function b2(e4) {
|
|
379
|
+
const o2 = e4[0].intersectionRatio;
|
|
380
|
+
if (o2 !== p3) {
|
|
381
|
+
if (!w3) return c3();
|
|
382
|
+
o2 ? c3(false, o2) : n3 = setTimeout(() => {
|
|
383
|
+
c3(false, 1e-7);
|
|
384
|
+
}, 1e3);
|
|
385
|
+
}
|
|
386
|
+
1 !== o2 || wt(d3, t3.getBoundingClientRect()) || c3(), w3 = false;
|
|
387
|
+
}
|
|
388
|
+
try {
|
|
389
|
+
s3 = new IntersectionObserver(b2, { ...v3, root: a3.ownerDocument });
|
|
390
|
+
} catch (t4) {
|
|
391
|
+
s3 = new IntersectionObserver(b2, v3);
|
|
392
|
+
}
|
|
393
|
+
s3.observe(t3);
|
|
394
|
+
})(true), l3;
|
|
395
|
+
})(d2, n2) : null;
|
|
396
|
+
let m2, g2 = -1, v2 = null;
|
|
397
|
+
c2 && (v2 = new ResizeObserver((t3) => {
|
|
398
|
+
let [o2] = t3;
|
|
399
|
+
o2 && o2.target === d2 && v2 && (v2.unobserve(e2), cancelAnimationFrame(g2), g2 = requestAnimationFrame(() => {
|
|
400
|
+
var t4;
|
|
401
|
+
null == (t4 = v2) || t4.observe(e2);
|
|
402
|
+
})), n2();
|
|
403
|
+
}), d2 && !p2 && v2.observe(d2), v2.observe(e2));
|
|
404
|
+
let w2 = p2 ? at(t2) : null;
|
|
405
|
+
return p2 && (function e3() {
|
|
406
|
+
const o2 = at(t2);
|
|
407
|
+
w2 && !wt(w2, o2) && n2();
|
|
408
|
+
w2 = o2, m2 = requestAnimationFrame(e3);
|
|
409
|
+
})(), n2(), () => {
|
|
410
|
+
var t3;
|
|
411
|
+
u2.forEach((t4) => {
|
|
412
|
+
a2 && t4.removeEventListener("scroll", n2), l2 && t4.removeEventListener("resize", n2);
|
|
413
|
+
}), null == f2 || f2(), null == (t3 = v2) || t3.disconnect(), v2 = null, p2 && cancelAnimationFrame(m2);
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
const yt = function(t2) {
|
|
417
|
+
return void 0 === t2 && (t2 = 0), { name: "offset", options: t2, async fn(e2) {
|
|
418
|
+
var o2, i2;
|
|
419
|
+
const { x: n2, y: r2, placement: s2, middlewareData: a2 } = e2, l2 = await (async function(t3, e3) {
|
|
420
|
+
const { placement: o3, platform: i3, elements: n3 } = t3, r3 = await (null == i3.isRTL ? void 0 : i3.isRTL(n3.floating)), s3 = p(o3), a3 = d(o3), l3 = "y" === m(o3), c2 = R.has(s3) ? -1 : 1, u2 = r3 && l3 ? -1 : 1, f2 = h(e3, t3);
|
|
421
|
+
let { mainAxis: g2, crossAxis: v2, alignmentAxis: w2 } = "number" == typeof f2 ? { mainAxis: f2, crossAxis: 0, alignmentAxis: null } : { mainAxis: f2.mainAxis || 0, crossAxis: f2.crossAxis || 0, alignmentAxis: f2.alignmentAxis };
|
|
422
|
+
return a3 && "number" == typeof w2 && (v2 = "end" === a3 ? -1 * w2 : w2), l3 ? { x: v2 * u2, y: g2 * c2 } : { x: g2 * c2, y: v2 * u2 };
|
|
423
|
+
})(e2, t2);
|
|
424
|
+
return s2 === (null == (o2 = a2.offset) ? void 0 : o2.placement) && null != (i2 = a2.arrow) && i2.alignmentOffset ? {} : { x: n2 + l2.x, y: r2 + l2.y, data: { ...l2, placement: s2 } };
|
|
425
|
+
} };
|
|
426
|
+
}, Et = function(t2) {
|
|
427
|
+
return void 0 === t2 && (t2 = {}), { name: "flip", options: t2, async fn(e2) {
|
|
428
|
+
var o2, i2;
|
|
429
|
+
const { placement: n2, middlewareData: r2, rects: s2, initialPlacement: a2, platform: l2, elements: c2 } = e2, { mainAxis: f2 = true, crossAxis: w2 = true, fallbackPlacements: b2, fallbackStrategy: y2 = "bestFit", fallbackAxisSideDirection: E2 = "none", flipAlignment: S2 = true, ...A2 } = h(t2, e2);
|
|
430
|
+
if (null != (o2 = r2.arrow) && o2.alignmentOffset) return {};
|
|
431
|
+
const L2 = p(n2), k2 = m(a2), R2 = p(a2) === a2, C2 = await (null == l2.isRTL ? void 0 : l2.isRTL(c2.floating)), T2 = b2 || (R2 || !S2 ? [_(a2)] : (function(t3) {
|
|
432
|
+
const e3 = _(t3);
|
|
433
|
+
return [v(t3), e3, v(e3)];
|
|
434
|
+
})(a2)), B2 = "none" !== E2;
|
|
435
|
+
!b2 && B2 && T2.push(...x(a2, S2, E2, C2));
|
|
436
|
+
const P2 = [a2, ...T2], j2 = await l2.detectOverflow(e2, A2), N2 = [];
|
|
437
|
+
let D2 = (null == (i2 = r2.flip) ? void 0 : i2.overflows) || [];
|
|
438
|
+
if (f2 && N2.push(j2[L2]), w2) {
|
|
439
|
+
const t3 = (function(t4, e3, o3) {
|
|
440
|
+
void 0 === o3 && (o3 = false);
|
|
441
|
+
const i3 = d(t4), n3 = g(t4), r3 = u(n3);
|
|
442
|
+
let s3 = "x" === n3 ? i3 === (o3 ? "end" : "start") ? "right" : "left" : "start" === i3 ? "bottom" : "top";
|
|
443
|
+
return e3.reference[r3] > e3.floating[r3] && (s3 = _(s3)), [s3, _(s3)];
|
|
444
|
+
})(n2, s2, C2);
|
|
445
|
+
N2.push(j2[t3[0]], j2[t3[1]]);
|
|
446
|
+
}
|
|
447
|
+
if (D2 = [...D2, { placement: n2, overflows: N2 }], !N2.every((t3) => t3 <= 0)) {
|
|
448
|
+
var O2, F2;
|
|
449
|
+
const t3 = ((null == (O2 = r2.flip) ? void 0 : O2.index) || 0) + 1, e3 = P2[t3];
|
|
450
|
+
if (e3) {
|
|
451
|
+
if (!("alignment" === w2 && k2 !== m(e3)) || D2.every((t4) => m(t4.placement) !== k2 || t4.overflows[0] > 0)) return { data: { index: t3, overflows: D2 }, reset: { placement: e3 } };
|
|
452
|
+
}
|
|
453
|
+
let o3 = null == (F2 = D2.filter((t4) => t4.overflows[0] <= 0).sort((t4, e4) => t4.overflows[1] - e4.overflows[1])[0]) ? void 0 : F2.placement;
|
|
454
|
+
if (!o3) switch (y2) {
|
|
455
|
+
case "bestFit": {
|
|
456
|
+
var H2;
|
|
457
|
+
const t4 = null == (H2 = D2.filter((t5) => {
|
|
458
|
+
if (B2) {
|
|
459
|
+
const e4 = m(t5.placement);
|
|
460
|
+
return e4 === k2 || "y" === e4;
|
|
461
|
+
}
|
|
462
|
+
return true;
|
|
463
|
+
}).map((t5) => [t5.placement, t5.overflows.filter((t6) => t6 > 0).reduce((t6, e4) => t6 + e4, 0)]).sort((t5, e4) => t5[1] - e4[1])[0]) ? void 0 : H2[0];
|
|
464
|
+
t4 && (o3 = t4);
|
|
465
|
+
break;
|
|
466
|
+
}
|
|
467
|
+
case "initialPlacement":
|
|
468
|
+
o3 = a2;
|
|
469
|
+
}
|
|
470
|
+
if (n2 !== o3) return { reset: { placement: o3 } };
|
|
471
|
+
}
|
|
472
|
+
return {};
|
|
473
|
+
} };
|
|
474
|
+
}, xt = function(t2) {
|
|
475
|
+
return void 0 === t2 && (t2 = {}), { name: "size", options: t2, async fn(e2) {
|
|
476
|
+
var n2, r2;
|
|
477
|
+
const { placement: s2, rects: a2, platform: l2, elements: c2 } = e2, { apply: u2 = () => {
|
|
478
|
+
}, ...f2 } = h(t2, e2), g2 = await l2.detectOverflow(e2, f2), v2 = p(s2), w2 = d(s2), b2 = "y" === m(s2), { width: y2, height: E2 } = a2.floating;
|
|
479
|
+
let x2, _2;
|
|
480
|
+
"top" === v2 || "bottom" === v2 ? (x2 = v2, _2 = w2 === (await (null == l2.isRTL ? void 0 : l2.isRTL(c2.floating)) ? "start" : "end") ? "left" : "right") : (_2 = v2, x2 = "end" === w2 ? "top" : "bottom");
|
|
481
|
+
const S2 = E2 - g2.top - g2.bottom, A2 = y2 - g2.left - g2.right, L2 = o(E2 - g2[x2], S2), k2 = o(y2 - g2[_2], A2), R2 = !e2.middlewareData.shift;
|
|
482
|
+
let C2 = L2, T2 = k2;
|
|
483
|
+
if (null != (n2 = e2.middlewareData.shift) && n2.enabled.x && (T2 = A2), null != (r2 = e2.middlewareData.shift) && r2.enabled.y && (C2 = S2), R2 && !w2) {
|
|
484
|
+
const t3 = i(g2.left, 0), e3 = i(g2.right, 0), o2 = i(g2.top, 0), n3 = i(g2.bottom, 0);
|
|
485
|
+
b2 ? T2 = y2 - 2 * (0 !== t3 || 0 !== e3 ? t3 + e3 : i(g2.left, g2.right)) : C2 = E2 - 2 * (0 !== o2 || 0 !== n3 ? o2 + n3 : i(g2.top, g2.bottom));
|
|
486
|
+
}
|
|
487
|
+
await u2({ ...e2, availableWidth: T2, availableHeight: C2 });
|
|
488
|
+
const B2 = await l2.getDimensions(c2.floating);
|
|
489
|
+
return y2 !== B2.width || E2 !== B2.height ? { reset: { rects: true } } : {};
|
|
490
|
+
} };
|
|
491
|
+
}, _t = (t2) => ({ name: "arrow", options: t2, async fn(e2) {
|
|
492
|
+
const { x: i2, y: n2, placement: r2, rects: s2, platform: a2, elements: l2, middlewareData: p2 } = e2, { element: f2, padding: m2 = 0 } = h(t2, e2) || {};
|
|
493
|
+
if (null == f2) return {};
|
|
494
|
+
const v2 = S(m2), w2 = { x: i2, y: n2 }, b2 = g(r2), y2 = u(b2), E2 = await a2.getDimensions(f2), x2 = "y" === b2, _2 = x2 ? "top" : "left", A2 = x2 ? "bottom" : "right", L2 = x2 ? "clientHeight" : "clientWidth", k2 = s2.reference[y2] + s2.reference[b2] - w2[b2] - s2.floating[y2], R2 = w2[b2] - s2.reference[b2], C2 = await (null == a2.getOffsetParent ? void 0 : a2.getOffsetParent(f2));
|
|
495
|
+
let T2 = C2 ? C2[L2] : 0;
|
|
496
|
+
T2 && await (null == a2.isElement ? void 0 : a2.isElement(C2)) || (T2 = l2.floating[L2] || s2.floating[y2]);
|
|
497
|
+
const B2 = k2 / 2 - R2 / 2, P2 = T2 / 2 - E2[y2] / 2 - 1, j2 = o(v2[_2], P2), N2 = o(v2[A2], P2), D2 = j2, O2 = T2 - E2[y2] - N2, F2 = T2 / 2 - E2[y2] / 2 + B2, H2 = c(D2, F2, O2), M2 = !p2.arrow && null != d(r2) && F2 !== H2 && s2.reference[y2] / 2 - (F2 < D2 ? j2 : N2) - E2[y2] / 2 < 0, W2 = M2 ? F2 < D2 ? F2 - D2 : F2 - O2 : 0;
|
|
498
|
+
return { [b2]: w2[b2] + W2, data: { [b2]: H2, centerOffset: F2 - H2 - W2, ...M2 && { alignmentOffset: W2 } }, reset: M2 };
|
|
499
|
+
} }), St = (t2, e2, o2) => {
|
|
500
|
+
const i2 = /* @__PURE__ */ new Map(), n2 = { platform: vt, ...o2 }, r2 = { ...n2.platform, _c: i2 };
|
|
501
|
+
return (async (t3, e3, o3) => {
|
|
502
|
+
const { placement: i3 = "bottom", strategy: n3 = "absolute", middleware: r3 = [], platform: s2 } = o3, a2 = r3.filter(Boolean), l2 = await (null == s2.isRTL ? void 0 : s2.isRTL(e3));
|
|
503
|
+
let c2 = await s2.getElementRects({ reference: t3, floating: e3, strategy: n3 }), { x: h2, y: p2 } = L(c2, i3, l2), d2 = i3, u2 = {}, f2 = 0;
|
|
504
|
+
for (let o4 = 0; o4 < a2.length; o4++) {
|
|
505
|
+
var m2;
|
|
506
|
+
const { name: r4, fn: g2 } = a2[o4], { x: v2, y: w2, data: b2, reset: y2 } = await g2({ x: h2, y: p2, initialPlacement: i3, placement: d2, strategy: n3, middlewareData: u2, rects: c2, platform: { ...s2, detectOverflow: null != (m2 = s2.detectOverflow) ? m2 : k }, elements: { reference: t3, floating: e3 } });
|
|
507
|
+
h2 = null != v2 ? v2 : h2, p2 = null != w2 ? w2 : p2, u2 = { ...u2, [r4]: { ...u2[r4], ...b2 } }, y2 && f2 <= 50 && (f2++, "object" == typeof y2 && (y2.placement && (d2 = y2.placement), y2.rects && (c2 = true === y2.rects ? await s2.getElementRects({ reference: t3, floating: e3, strategy: n3 }) : y2.rects), { x: h2, y: p2 } = L(c2, d2, l2)), o4 = -1);
|
|
508
|
+
}
|
|
509
|
+
return { x: h2, y: p2, placement: d2, strategy: n3, middlewareData: u2 };
|
|
510
|
+
})(t2, e2, { ...n2, platform: r2 });
|
|
511
|
+
};
|
|
512
|
+
class At extends t {
|
|
513
|
+
constructor() {
|
|
514
|
+
super();
|
|
515
|
+
__publicField(this, "className", "Popup");
|
|
516
|
+
__publicField(this, "manualCallback", (t2) => {
|
|
517
|
+
this.hasAttribute("disabled") || this.showHide();
|
|
518
|
+
});
|
|
519
|
+
__publicField(this, "clickHandler", (t2) => {
|
|
520
|
+
const e2 = "function" == typeof t2.composedPath ? t2.composedPath() : [];
|
|
521
|
+
if (e2.some((t3) => t3 && ("WJE-MENU-ITEM" === t3.tagName || "WJE-MENU" === t3.tagName))) return;
|
|
522
|
+
!(e2.includes(this) || this.floatingEl && e2.includes(this.floatingEl)) && this.hasAttribute("active") && this.hide(true);
|
|
523
|
+
});
|
|
524
|
+
__publicField(this, "handleBackdropClick", (t2) => {
|
|
525
|
+
var _a;
|
|
526
|
+
this.hasAttribute("active") && ((_a = this.floatingEl) == null ? void 0 : _a.classList.contains("popup-mobile-sheet")) && (t2.stopPropagation(), this.hide(true));
|
|
527
|
+
});
|
|
528
|
+
__publicField(this, "handleViewportResize", () => {
|
|
529
|
+
this.mobilePresentation && this.hasAttribute("active") && this.syncResponsivePresentation();
|
|
530
|
+
});
|
|
531
|
+
__publicField(this, "handleHide", () => {
|
|
532
|
+
this.removeAttribute("active");
|
|
533
|
+
});
|
|
534
|
+
this._manual = false, this._contentAwareSize = false, this._contentReadyHandler = () => this.markContentReady(), this._bottomSheetRestoreTimeout = null;
|
|
535
|
+
}
|
|
536
|
+
set loader(t2) {
|
|
537
|
+
t2 ? (this.setAttribute("loader", ""), this._showLoader()) : (this.removeAttribute("loader"), this._hideLoader());
|
|
538
|
+
}
|
|
539
|
+
get loader() {
|
|
540
|
+
return this.hasAttribute("loader");
|
|
541
|
+
}
|
|
542
|
+
set contentAwareSize(t2) {
|
|
543
|
+
this._contentAwareSize = Boolean(t2);
|
|
544
|
+
}
|
|
545
|
+
get contentAwareSize() {
|
|
546
|
+
return true === this._contentAwareSize;
|
|
547
|
+
}
|
|
548
|
+
set manual(t2) {
|
|
549
|
+
t2 ? this.setAttribute("manual", "") : this.removeAttribute("manual");
|
|
550
|
+
}
|
|
551
|
+
get manual() {
|
|
552
|
+
return this.hasAttribute("manual");
|
|
553
|
+
}
|
|
554
|
+
set portal(t2) {
|
|
555
|
+
t2 ? this.setAttribute("portal", t2) : this.removeAttribute("portal");
|
|
556
|
+
}
|
|
557
|
+
get portal() {
|
|
558
|
+
return this.hasAttribute("portal");
|
|
559
|
+
}
|
|
560
|
+
set mobilePresentation(t2) {
|
|
561
|
+
t2 ? this.setAttribute("mobile-presentation", t2) : this.removeAttribute("mobile-presentation");
|
|
562
|
+
}
|
|
563
|
+
get mobilePresentation() {
|
|
564
|
+
return this.getAttribute("mobile-presentation");
|
|
565
|
+
}
|
|
566
|
+
set mobileBreakPoint(t2) {
|
|
567
|
+
t2 ? this.setAttribute("mobile-break-point", t2) : this.removeAttribute("mobile-break-point");
|
|
568
|
+
}
|
|
569
|
+
get mobileBreakPoint() {
|
|
570
|
+
return this.getAttribute("mobile-break-point") || "768";
|
|
571
|
+
}
|
|
572
|
+
get floatingEl() {
|
|
573
|
+
return this._floatingEl || this.native;
|
|
574
|
+
}
|
|
575
|
+
get backdropEl() {
|
|
576
|
+
return this._portaled ? this._portalBackdrop : this.backdrop;
|
|
577
|
+
}
|
|
578
|
+
static get cssStyleSheet() {
|
|
579
|
+
return ":host{--wje-popup-top: auto;--wje-popup-left: auto;--wje-popup-mobile-transition-duration: .25s;--wje-popup-mobile-transition-easing: ease;display:flex}.popup-backdrop{display:none}.native-popup{position:absolute;isolation:isolate;z-index:999;left:var(--wje-popup-left);top:var(--wje-popup-top)}.native-popup:not(.popup-active){display:none}.popup-backdrop.popup-mobile-sheet{display:block;position:fixed;top:0;right:0;bottom:0;left:0;z-index:998;opacity:0;pointer-events:none;background:var( --wje-popup-backdrop-background, var(--wje-sliding-container-backdrop-background, var(--wje-backdrop, rgba(0, 0, 0, .35))) );transition:opacity var(--wje-popup-mobile-transition-duration) var(--wje-popup-mobile-transition-easing),visibility 0s linear var(--wje-popup-mobile-transition-duration);visibility:hidden}.popup-backdrop.popup-mobile-sheet.popup-active{opacity:var( --wje-popup-backdrop-opacity, var(--wje-sliding-container-backdrop-opacity, var(--wje-backdrop-opacity, 1)) );pointer-events:auto;visibility:visible;transition-delay:0s}.native-popup.popup-mobile-sheet{display:flex;flex-direction:column;align-items:stretch;position:fixed;inset:auto 0 0 0;left:0;right:0;top:auto;width:100vw;max-width:100vw;max-height:var(--wje-popup-mobile-max-height, 90vh);overflow:auto;background:var( --wje-popup-mobile-background, var(--wje-select-options-background-color, var(--wje-color-contrast-0, #fff)) );box-shadow:var(--wje-popup-mobile-box-shadow, 0 -8px 32px rgba(0, 0, 0, .16));border-radius:var( --wje-popup-mobile-border-radius, var( --wje-sliding-container-sheet-border-radius, var(--wje-border-radius-large, 16px) var(--wje-border-radius-large, 16px) 0 0 ) );padding-bottom:env(safe-area-inset-bottom,0);transform:translateY(100%);transition:transform var(--wje-popup-mobile-transition-duration) var(--wje-popup-mobile-transition-easing),visibility 0s linear var(--wje-popup-mobile-transition-duration);visibility:hidden;pointer-events:none}.native-popup.popup-mobile-sheet.popup-active{transform:translateY(0);visibility:visible;pointer-events:auto;transition-delay:0s}.popup-loader.overlay{position:absolute;inset:var(--wje-popup-loader-inset, 0);background:var( --wje-popup-overlay-background, var(--wje-select-options-background-color, var(--wje-color-contrast-0, #fff)) );display:flex;align-items:center;justify-content:center;z-index:1}.popup-loader.fade-out{opacity:0;transition:opacity .3s ease;pointer-events:none}";
|
|
580
|
+
}
|
|
581
|
+
static get observedAttributes() {
|
|
582
|
+
return [];
|
|
583
|
+
}
|
|
584
|
+
setupAttributes() {
|
|
585
|
+
this.isShadowRoot = "open", this._hideFloatingLightDomContentBeforeRender();
|
|
586
|
+
}
|
|
587
|
+
_hideFloatingLightDomContentBeforeRender() {
|
|
588
|
+
if (this._hiddenFloatingLightDomContent) return;
|
|
589
|
+
const t2 = Array.from(this.children).filter((t3) => "anchor" !== t3.getAttribute("slot"));
|
|
590
|
+
0 !== t2.length && (this._hiddenFloatingLightDomContent = t2.map((t3) => {
|
|
591
|
+
const e2 = t3.style.getPropertyValue("display"), o2 = t3.style.getPropertyPriority("display");
|
|
592
|
+
return t3.style.setProperty("display", "none"), { el: t3, display: e2, priority: o2 };
|
|
593
|
+
}));
|
|
594
|
+
}
|
|
595
|
+
_restoreFloatingLightDomContentAfterRender() {
|
|
596
|
+
var _a;
|
|
597
|
+
(_a = this._hiddenFloatingLightDomContent) == null ? void 0 : _a.forEach(({ el: t2, display: e2, priority: o2 }) => {
|
|
598
|
+
e2 ? t2.style.setProperty("display", e2, o2) : t2.style.removeProperty("display");
|
|
599
|
+
}), this._hiddenFloatingLightDomContent = null;
|
|
600
|
+
}
|
|
601
|
+
afterDisconnect() {
|
|
602
|
+
var _a, _b, _c;
|
|
603
|
+
this.clearBottomSheetRestoreTimeout(), window.removeEventListener("resize", this.handleViewportResize), e.removeListener(this.anchorEl, "click", this.manualCallback), document.removeEventListener("click", this.clickHandler, { capture: true }), this.removeEventListener("wje-popup:content-ready", this._contentReadyHandler), this._contentReadyListenerAttached = false, (_a = this.backdrop) == null ? void 0 : _a.removeEventListener("click", this.handleBackdropClick), (_b = this._portalBackdrop) == null ? void 0 : _b.removeEventListener("click", this.handleBackdropClick), this._restoreContentFromPortal(), (_c = this.cleanup) == null ? void 0 : _c.call(this);
|
|
604
|
+
}
|
|
605
|
+
beforeDraw(t2, e2, o2) {
|
|
606
|
+
var _a;
|
|
607
|
+
(_a = this.cleanup) == null ? void 0 : _a.call(this);
|
|
608
|
+
}
|
|
609
|
+
draw() {
|
|
610
|
+
let t2 = document.createDocumentFragment(), e2 = document.createElement("slot");
|
|
611
|
+
e2.setAttribute("name", "anchor");
|
|
612
|
+
let o2 = document.createElement("slot");
|
|
613
|
+
o2.setAttribute("name", "arrow");
|
|
614
|
+
let i2 = document.createElement("div");
|
|
615
|
+
i2.setAttribute("part", "backdrop"), i2.classList.add("popup-backdrop"), i2.addEventListener("click", this.handleBackdropClick);
|
|
616
|
+
let n2 = document.createElement("div");
|
|
617
|
+
n2.setAttribute("part", "native"), n2.classList.add("native-popup");
|
|
618
|
+
let r2 = document.createElement("slot"), s2 = document.createElement("div");
|
|
619
|
+
return s2.classList.add("popup-loader", "overlay"), s2.setAttribute("part", "loader"), s2.textContent = "Loading...", this.loader && n2.append(s2), n2.append(r2), n2.append(o2), t2.append(e2), t2.append(i2), t2.append(n2), this.slotAnchor = e2, this.slotArrow = o2, this.defaultSlot = r2, this.backdrop = i2, this.native = n2, this.loaderEl = s2, t2;
|
|
620
|
+
}
|
|
621
|
+
afterDraw() {
|
|
622
|
+
this._restoreFloatingLightDomContentAfterRender(), this.setAnchor(), window.removeEventListener("resize", this.handleViewportResize), window.addEventListener("resize", this.handleViewportResize), this._contentReadyListenerAttached || (this.addEventListener("wje-popup:content-ready", this._contentReadyHandler), this._contentReadyListenerAttached = true), this.hasAttribute("active") && this.show(false), this.hasAttribute("active") || this.hide(false);
|
|
623
|
+
}
|
|
624
|
+
setAnchor() {
|
|
625
|
+
if (this.slotAnchor && "string" == typeof this.anchor) {
|
|
626
|
+
const t2 = this.getRootNode();
|
|
627
|
+
this.anchorEl = t2.querySelector("#" + this.anchor);
|
|
628
|
+
} else this.slotAnchor instanceof HTMLSlotElement && (this.anchorEl = this.slotAnchor.assignedElements({ flatten: true })[0]);
|
|
629
|
+
this.manual && e.addListener(this.anchorEl, "click", null, this.manualCallback, { stopPropagation: true });
|
|
630
|
+
}
|
|
631
|
+
clearBottomSheetRestoreTimeout() {
|
|
632
|
+
null !== this._bottomSheetRestoreTimeout && (window.clearTimeout(this._bottomSheetRestoreTimeout), this._bottomSheetRestoreTimeout = null);
|
|
633
|
+
}
|
|
634
|
+
isBottomSheetActive() {
|
|
635
|
+
return "bottom-sheet" === this.mobilePresentation && window.innerWidth <= +this.mobileBreakPoint;
|
|
636
|
+
}
|
|
637
|
+
setBottomSheetState(t2) {
|
|
638
|
+
const e2 = this.floatingEl, o2 = this.backdropEl;
|
|
639
|
+
e2 && o2 && (e2.classList.add("popup-mobile-sheet"), o2.classList.add("popup-mobile-sheet"), e2.classList.toggle("popup-active", t2), o2.classList.toggle("popup-active", t2));
|
|
640
|
+
}
|
|
641
|
+
clearBottomSheetState() {
|
|
642
|
+
[this.native, this.backdrop, this._portalNative, this._portalBackdrop].forEach((t2) => {
|
|
643
|
+
t2 == null ? void 0 : t2.classList.remove("popup-mobile-sheet", "popup-active");
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
rebindPortaledRouter() {
|
|
647
|
+
if (!this._portalShadow) return;
|
|
648
|
+
const t2 = { root: this._portalShadow, container: this._portalContainer, floating: this._portalNative };
|
|
649
|
+
document.dispatchEvent(new CustomEvent("wje-router:rebind", { bubbles: true, composed: true, detail: t2 })), "function" == typeof window.bindRouterLinks && window.bindRouterLinks(this._portalShadow);
|
|
650
|
+
}
|
|
651
|
+
syncResponsivePresentation() {
|
|
652
|
+
var _a, _b, _c, _d, _e, _f;
|
|
653
|
+
const t2 = this.isBottomSheetActive(), e2 = (_b = (_a = this.floatingEl) == null ? void 0 : _a.classList) == null ? void 0 : _b.contains("popup-mobile-sheet");
|
|
654
|
+
if (t2) return (_c = this.cleanup) == null ? void 0 : _c.call(this), this.cleanup = void 0, this._portaled || (this._mountContentToPortal(), this.rebindPortaledRouter()), this.setBottomSheetState(false), (_d = this.floatingEl) == null ? void 0 : _d.getBoundingClientRect(), (_e = this.backdropEl) == null ? void 0 : _e.getBoundingClientRect(), void requestAnimationFrame(() => {
|
|
655
|
+
this.hasAttribute("active") && this.isBottomSheetActive() && this.setBottomSheetState(true);
|
|
656
|
+
});
|
|
657
|
+
e2 && (this.clearBottomSheetRestoreTimeout(), this.clearBottomSheetState(), !this.portal && this._portaled && this._restoreContentFromPortal()), this.anchorEl && this.floatingEl && (this.floatingEl.classList.add("popup-active"), (_f = this.cleanup) == null ? void 0 : _f.call(this), this.cleanup = bt(this.anchorEl, this.floatingEl, () => {
|
|
658
|
+
this.reposition();
|
|
659
|
+
}), this.reposition());
|
|
660
|
+
}
|
|
661
|
+
getBottomSheetTransitionDurationMs() {
|
|
662
|
+
const t2 = (t3) => {
|
|
663
|
+
const e3 = t3 == null ? void 0 : t3.trim();
|
|
664
|
+
return e3 ? e3.endsWith("ms") ? Number.parseFloat(e3) || 0 : e3.endsWith("s") ? 1e3 * (Number.parseFloat(e3) || 0) : Number.parseFloat(e3) || 0 : 0;
|
|
665
|
+
}, e2 = (e3) => {
|
|
666
|
+
if (!e3) return 0;
|
|
667
|
+
const o2 = getComputedStyle(e3), i2 = o2.transitionDuration.split(","), n2 = o2.transitionDelay.split(","), r2 = Math.max(i2.length, n2.length);
|
|
668
|
+
let s2 = 0;
|
|
669
|
+
for (let e4 = 0; e4 < r2; e4++) {
|
|
670
|
+
const o3 = t2(i2[e4] || i2[i2.length - 1]), r3 = t2(n2[e4] || n2[n2.length - 1]);
|
|
671
|
+
s2 = Math.max(s2, o3 + r3);
|
|
672
|
+
}
|
|
673
|
+
return s2;
|
|
674
|
+
};
|
|
675
|
+
return Math.max(e2(this.floatingEl), e2(this.backdropEl)) || 250;
|
|
676
|
+
}
|
|
677
|
+
showHide() {
|
|
678
|
+
this.hasAttribute("active") ? this.hide() : (e.dispatchCustomEvent(this, "wje-popup:beforeshow"), this.show(), e.dispatchCustomEvent(this, "wje-popup:aftershow"));
|
|
679
|
+
}
|
|
680
|
+
reposition() {
|
|
681
|
+
var _a, _b;
|
|
682
|
+
if ((_b = (_a = this.floatingEl) == null ? void 0 : _a.classList) == null ? void 0 : _b.contains("popup-mobile-sheet")) return;
|
|
683
|
+
const t2 = [];
|
|
684
|
+
this.offsetCalc = +this.offset || 0, this.portal && this._portaled && this.floatingEl ? this.arrow = this.floatingEl.querySelector('[slot="arrow"]') : this.slotArrow instanceof HTMLSlotElement && (this.arrow = this.slotArrow.assignedElements({ flatten: true })[0]), this.arrow && (t2.push(_t({ element: this.arrow })), this.offsetCalc = Math.sqrt(2 * this.arrow.offsetWidth ** 2) / 2 + +this.offset), t2.push(yt(this.offsetCalc)), t2.push(Et()), this.hasAttribute("size") && t2.push(xt({ apply: ({ elements: t3 }) => {
|
|
685
|
+
this.contentAwareSize ? Object.assign(t3.floating.style, { minWidth: `${t3.reference.offsetWidth}px`, width: "" }) : Object.assign(t3.floating.style, { minWidth: "", width: `${t3.reference.offsetWidth}px` });
|
|
686
|
+
} })), St(this.anchorEl, this.floatingEl, { placement: this.placement || "bottom", strategy: "fixed", middleware: t2 }).then(({ x: t3, y: e2, middlewareData: o2, placement: i2, strategy: n2 }) => {
|
|
687
|
+
if (this.floatingEl.style.setProperty("--wje-popup-left", t3 + "px"), this.floatingEl.style.setProperty("--wje-popup-top", e2 + "px"), this.floatingEl.style.position = n2, this.arrow) {
|
|
688
|
+
const t4 = { top: "bottom", right: "left", bottom: "top", left: "right" }[i2];
|
|
689
|
+
if (o2.arrow) {
|
|
690
|
+
const { width: e3, height: i3 } = this.floatingEl.getBoundingClientRect();
|
|
691
|
+
let n3 = o2.arrow.x, r2 = o2.arrow.y;
|
|
692
|
+
Object.assign(this.arrow.style, { left: null != n3 ? e3 / 2 - this.arrow.offsetWidth / 2 + "px" : "", top: null != r2 ? i3 / 2 - this.arrow.offsetHeight / 2 + "px" : "", [t4]: -this.arrow.offsetHeight / 2 + "px" });
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}), e.dispatchCustomEvent(this, "wje-popup:reposition", { data: { top: "bottom", right: "left", bottom: "top", left: "right" }, context: this, event: this });
|
|
696
|
+
}
|
|
697
|
+
_mountContentToPortal() {
|
|
698
|
+
if (this._portaled) return;
|
|
699
|
+
this._ensurePortalRoot(), this._portalNative || (this._portalBackdrop = document.createElement("div"), this._portalBackdrop.setAttribute("part", "backdrop"), this._portalBackdrop.classList.add("popup-backdrop"), this._portalBackdrop.addEventListener("click", this.handleBackdropClick), this._portalNative = document.createElement("div"), this._portalNative.setAttribute("part", "native"), this._portalNative.classList.add("native-popup"), this._portalSlot = document.createElement("slot"), this._portalArrowSlot = document.createElement("slot"), this._portalArrowSlot.setAttribute("name", "arrow"), this._portalNative.append(this._portalSlot, this._portalArrowSlot)), this._portalShadow.append(this._portalBackdrop), this._portalShadow.append(this._portalNative);
|
|
700
|
+
(() => {
|
|
701
|
+
for (const { name: t3 } of Array.from(this._portalContainer.attributes)) "data-wje-popup-portal" !== t3 && this._portalContainer.removeAttribute(t3);
|
|
702
|
+
for (const t3 of Array.from(this.attributes)) this._portalContainer.setAttribute(t3.name, t3.value ?? "");
|
|
703
|
+
this._portalContainer.setAttribute("class", this.getAttribute("class") || "");
|
|
704
|
+
})(), this._portalAttrObserver = new MutationObserver((t3) => {
|
|
705
|
+
for (const e2 of t3) if ("attributes" === e2.type) {
|
|
706
|
+
const t4 = e2.attributeName, o3 = this.getAttribute(t4);
|
|
707
|
+
null === o3 ? this._portalContainer.removeAttribute(t4) : this._portalContainer.setAttribute(t4, o3);
|
|
708
|
+
}
|
|
709
|
+
}), this._portalAttrObserver.observe(this, { attributes: true });
|
|
710
|
+
const t2 = this.defaultSlot, o2 = (t2 ? t2.assignedNodes({ flatten: true }) : []).filter((t3) => t3 && t3.nodeType === Node.ELEMENT_NODE || t3 && t3.nodeType === Node.TEXT_NODE);
|
|
711
|
+
this._defPlaceholders = [];
|
|
712
|
+
for (const t3 of o2) {
|
|
713
|
+
const e2 = document.createComment("wje-portal-default");
|
|
714
|
+
this._defPlaceholders.push({ node: t3, ph: e2 }), t3.parentNode && t3.parentNode.insertBefore(e2, t3.nextSibling), this._portalContainer.append(t3);
|
|
715
|
+
}
|
|
716
|
+
const i2 = (this.slotArrow instanceof HTMLSlotElement ? this.slotArrow.assignedNodes({ flatten: true }) : []).filter((t3) => t3 && t3.nodeType === Node.ELEMENT_NODE || t3 && t3.nodeType === Node.TEXT_NODE);
|
|
717
|
+
this._arrowPlaceholders = [];
|
|
718
|
+
for (const t3 of i2) {
|
|
719
|
+
const e2 = document.createComment("wje-portal-arrow");
|
|
720
|
+
this._arrowPlaceholders.push({ node: t3, ph: e2 }), t3.parentNode && t3.parentNode.insertBefore(e2, t3.nextSibling), this._portalContainer.append(t3);
|
|
721
|
+
}
|
|
722
|
+
this._floatingEl = this._portalNative, this._portaled = true, this._floatingEl = this._portalNative, this._portaled = true, e.dispatchCustomEvent(this, "wje-router:rebind", { root: this._portalShadow, container: this._portalContainer, floating: this._portalNative });
|
|
723
|
+
}
|
|
724
|
+
_restoreContentFromPortal() {
|
|
725
|
+
if (!this._portaled) return;
|
|
726
|
+
if (Array.isArray(this._defPlaceholders)) for (const { node: t3, ph: e2 } of this._defPlaceholders) e2 && e2.parentNode && (e2.parentNode.insertBefore(t3, e2), e2.remove());
|
|
727
|
+
if (this._defPlaceholders = void 0, Array.isArray(this._arrowPlaceholders)) for (const { node: t3, ph: e2 } of this._arrowPlaceholders) e2 && e2.parentNode && (e2.parentNode.insertBefore(t3, e2), e2.remove());
|
|
728
|
+
this._arrowPlaceholders = void 0, this._portalAttrObserver && (this._portalAttrObserver.disconnect(), this._portalAttrObserver = null), this._portalNative && this._portalNative.parentNode && this._portalNative.remove(), this._portalBackdrop && this._portalBackdrop.parentNode && this._portalBackdrop.remove(), this._floatingEl = void 0, this._portaled = false, this._portalContainer && (this._portalContainer.remove(), this._portalContainer = null, this._portalShadow = null);
|
|
729
|
+
const t2 = { root: this.shadowRoot, container: this, floating: this.native };
|
|
730
|
+
this.dispatchEvent(new CustomEvent("wje-portal:restored", { bubbles: true, composed: true, detail: t2 }));
|
|
731
|
+
try {
|
|
732
|
+
"function" == typeof window.bindRouterLinks && window.bindRouterLinks(this.shadowRoot), document.dispatchEvent(new CustomEvent("wje-router:rebind", { bubbles: true, composed: true, detail: t2 }));
|
|
733
|
+
} catch {
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
_ensurePortalRoot() {
|
|
737
|
+
var _a, _b;
|
|
738
|
+
if (this._portalContainer && this._portalShadow) return;
|
|
739
|
+
const t2 = document.createElement("div");
|
|
740
|
+
t2.setAttribute("data-wje-popup-portal", "");
|
|
741
|
+
const e2 = t2.attachShadow({ mode: "open" }), o2 = this.constructor.cssStyleSheet;
|
|
742
|
+
try {
|
|
743
|
+
if (o2 instanceof CSSStyleSheet) e2.adoptedStyleSheets = [o2];
|
|
744
|
+
else if ("string" == typeof o2 && "adoptedStyleSheets" in Document.prototype) {
|
|
745
|
+
const t3 = new CSSStyleSheet();
|
|
746
|
+
t3.replaceSync(o2), e2.adoptedStyleSheets = [t3];
|
|
747
|
+
} else {
|
|
748
|
+
const t3 = document.createElement("style");
|
|
749
|
+
t3.textContent = "string" == typeof o2 ? o2 : ((_a = o2 == null ? void 0 : o2.toString) == null ? void 0 : _a.call(o2)) || "", e2.append(t3);
|
|
750
|
+
}
|
|
751
|
+
} catch (t3) {
|
|
752
|
+
const i3 = document.createElement("style");
|
|
753
|
+
i3.textContent = "string" == typeof o2 ? o2 : ((_b = o2 == null ? void 0 : o2.toString) == null ? void 0 : _b.call(o2)) || "", e2.append(i3);
|
|
754
|
+
}
|
|
755
|
+
const i2 = getComputedStyle(this);
|
|
756
|
+
for (let e3 = 0; e3 < i2.length; e3++) {
|
|
757
|
+
const o3 = i2[e3];
|
|
758
|
+
o3.startsWith("--") && t2.style.setProperty(o3, i2.getPropertyValue(o3));
|
|
759
|
+
}
|
|
760
|
+
if ("dialog" === this.getAttribute("portal") || this.isBottomSheetActive() && this.findDialog(this)) {
|
|
761
|
+
const e3 = this.findDialog(this);
|
|
762
|
+
e3 ? e3.append(t2) : document.body.append(t2);
|
|
763
|
+
} else document.body.append(t2);
|
|
764
|
+
this._portalContainer = t2, this._portalShadow = e2;
|
|
765
|
+
}
|
|
766
|
+
findDialog(t2) {
|
|
767
|
+
var _a;
|
|
768
|
+
for (; t2; ) {
|
|
769
|
+
const e2 = (_a = t2.closest) == null ? void 0 : _a.call(t2, "wje-dialog");
|
|
770
|
+
if (e2) return e2;
|
|
771
|
+
t2 = t2.getRootNode().host || t2.parentElement;
|
|
772
|
+
}
|
|
773
|
+
return null;
|
|
774
|
+
}
|
|
775
|
+
show(t2 = true) {
|
|
776
|
+
var _a, _b, _c, _d, _e;
|
|
777
|
+
this.clearBottomSheetRestoreTimeout(), e.dispatchCustomEvent(document, "wje-popup:opened", { popup: this }), (this.portal || this.isBottomSheetActive()) && (this._mountContentToPortal(), this.rebindPortaledRouter()), this.loader && this._showLoader(), t2 && e.dispatchCustomEvent(this, "wje-popup:show"), this.isBottomSheetActive() ? (this.setBottomSheetState(false), (_a = this.floatingEl) == null ? void 0 : _a.getBoundingClientRect(), (_b = this.backdropEl) == null ? void 0 : _b.getBoundingClientRect(), requestAnimationFrame(() => {
|
|
778
|
+
this.hasAttribute("active") && this.setBottomSheetState(true);
|
|
779
|
+
}), document.addEventListener("click", this.clickHandler, { capture: true })) : this.anchorEl && this.floatingEl && (this.clearBottomSheetState(), (_d = (_c = this.floatingEl) == null ? void 0 : _c.classList) == null ? void 0 : _d.add("popup-active"), (_e = this.cleanup) == null ? void 0 : _e.call(this), this.cleanup = bt(this.anchorEl, this.floatingEl, () => {
|
|
780
|
+
this.reposition();
|
|
781
|
+
}), document.addEventListener("click", this.clickHandler, { capture: true })), this.hasAttribute("active") || this.setAttribute("active", "");
|
|
782
|
+
}
|
|
783
|
+
hide(t2 = true) {
|
|
784
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
785
|
+
t2 && e.dispatchCustomEvent(this, "wje-popup:hide"), (_a = this.cleanup) == null ? void 0 : _a.call(this), this.cleanup = void 0, document.removeEventListener("click", this.clickHandler, { capture: true });
|
|
786
|
+
const o2 = (_c = (_b = this.floatingEl) == null ? void 0 : _b.classList) == null ? void 0 : _c.contains("popup-mobile-sheet");
|
|
787
|
+
o2 ? ((_e = (_d = this.backdropEl) == null ? void 0 : _d.classList) == null ? void 0 : _e.remove("popup-active"), (_g = (_f = this.floatingEl) == null ? void 0 : _f.classList) == null ? void 0 : _g.remove("popup-active"), this.clearBottomSheetRestoreTimeout(), this._bottomSheetRestoreTimeout = window.setTimeout(() => {
|
|
788
|
+
this.clearBottomSheetState(), this._portaled && this._restoreContentFromPortal(), this._bottomSheetRestoreTimeout = null;
|
|
789
|
+
}, this.getBottomSheetTransitionDurationMs())) : ((_i = (_h = this.floatingEl) == null ? void 0 : _h.classList) == null ? void 0 : _i.remove("popup-active"), this.clearBottomSheetState(), this._portaled && this._restoreContentFromPortal()), this.hasAttribute("active") && this.removeAttribute("active");
|
|
790
|
+
}
|
|
791
|
+
_showLoader() {
|
|
792
|
+
const t2 = this.floatingEl;
|
|
793
|
+
t2 instanceof HTMLElement && this.loaderEl instanceof HTMLElement && (t2.classList.add("loading"), this.loaderEl.classList.remove("fade-out"), this.loaderEl.parentElement !== t2 && t2.prepend(this.loaderEl));
|
|
794
|
+
}
|
|
795
|
+
_hideLoader() {
|
|
796
|
+
var _a, _b, _c, _d, _e, _f;
|
|
797
|
+
(_b = (_a = this.native) == null ? void 0 : _a.classList) == null ? void 0 : _b.remove("loading"), (_d = (_c = this._portalNative) == null ? void 0 : _c.classList) == null ? void 0 : _d.remove("loading"), (_f = (_e = this.floatingEl) == null ? void 0 : _e.classList) == null ? void 0 : _f.remove("loading"), this.loaderEl instanceof HTMLElement && (this.loaderEl.classList.remove("fade-out"), this.loaderEl.remove());
|
|
798
|
+
}
|
|
799
|
+
markContentReady() {
|
|
800
|
+
this.loader = false;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
export {
|
|
804
|
+
At as P
|
|
805
|
+
};
|
|
806
|
+
//# sourceMappingURL=popup.element-CbkhthPP.js.map
|