vrembem 4.0.0-next.33 → 4.0.0-next.34
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/LICENSE +1 -1
- package/dev/base.css +20 -8
- package/dev/base.css.map +1 -1
- package/dev/index.css +23 -12
- package/dev/index.css.map +1 -1
- package/dev/index.js +1542 -1520
- package/dev/index.js.map +1 -1
- package/dev/index.umd.cjs +1509 -1487
- package/dev/index.umd.cjs.map +1 -1
- package/dev/root.css +3 -4
- package/dev/root.css.map +1 -1
- package/dist/base.css +1 -1
- package/dist/base.css.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +2072 -2059
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +9 -9
- package/dist/index.umd.cjs.map +1 -1
- package/dist/root.css +1 -1
- package/dist/root.css.map +1 -1
- package/package.json +22 -22
package/dev/index.js
CHANGED
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
const
|
|
2
|
-
`a[href]${
|
|
3
|
-
`area[href]${
|
|
4
|
-
`input:not([type="hidden"]):not([type="radio"])${
|
|
5
|
-
`input[type="radio"]${
|
|
6
|
-
`select${
|
|
7
|
-
`textarea${
|
|
8
|
-
`button${
|
|
9
|
-
`details${
|
|
10
|
-
`iframe${
|
|
11
|
-
`audio[controls]${
|
|
12
|
-
`video[controls]${
|
|
13
|
-
`[contenteditable]${
|
|
14
|
-
`[tabindex]${
|
|
1
|
+
const l$2 = ":not([inert])", u$2 = ':not([tabindex^="-"])', m$2 = ":not(:disabled)", C$2 = [
|
|
2
|
+
`a[href]${l$2}${u$2}`,
|
|
3
|
+
`area[href]${l$2}${u$2}`,
|
|
4
|
+
`input:not([type="hidden"]):not([type="radio"])${l$2}${u$2}${m$2}`,
|
|
5
|
+
`input[type="radio"]${l$2}${u$2}${m$2}`,
|
|
6
|
+
`select${l$2}${u$2}${m$2}`,
|
|
7
|
+
`textarea${l$2}${u$2}${m$2}`,
|
|
8
|
+
`button${l$2}${u$2}${m$2}`,
|
|
9
|
+
`details${l$2} > summary:first-of-type${u$2}`,
|
|
10
|
+
`iframe${l$2}${u$2}`,
|
|
11
|
+
`audio[controls]${l$2}${u$2}`,
|
|
12
|
+
`video[controls]${l$2}${u$2}`,
|
|
13
|
+
`[contenteditable]${l$2}${u$2}`,
|
|
14
|
+
`[tabindex]${l$2}${u$2}`
|
|
15
15
|
];
|
|
16
|
-
function
|
|
17
|
-
const
|
|
18
|
-
return
|
|
16
|
+
function x$2(i, t = "config") {
|
|
17
|
+
const o = (i.getAttribute(`data-${t}`) || "").replace(/'/g, '"');
|
|
18
|
+
return o ? JSON.parse(o) : {};
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
if (typeof
|
|
22
|
-
const t = document.getElementById(
|
|
20
|
+
function v$2(i) {
|
|
21
|
+
if (typeof i == "string") {
|
|
22
|
+
const t = document.getElementById(i);
|
|
23
23
|
if (t) return t;
|
|
24
|
-
throw new Error(`Element not found with ID: "${
|
|
25
|
-
} else if (
|
|
26
|
-
if (!
|
|
24
|
+
throw new Error(`Element not found with ID: "${i}"`);
|
|
25
|
+
} else if (i instanceof HTMLElement) {
|
|
26
|
+
if (!i.id)
|
|
27
27
|
throw new Error("HTMLElement must have an ID");
|
|
28
|
-
return
|
|
28
|
+
return i;
|
|
29
29
|
} else
|
|
30
30
|
throw new Error("Invalid argument: query must be a string or HTMLElement");
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
function h$2(i, ...t) {
|
|
33
|
+
return typeof i == "function" ? i(...t) : i;
|
|
34
|
+
}
|
|
35
|
+
async function g$2(i, t, ...e) {
|
|
36
|
+
t in i && typeof i[t] == "function" && await i[t](...e);
|
|
34
37
|
}
|
|
35
|
-
function
|
|
38
|
+
function k$3(i, t, e) {
|
|
36
39
|
if (typeof t == "string") {
|
|
37
40
|
const r2 = document.querySelector(t);
|
|
38
41
|
if (!r2)
|
|
@@ -42,121 +45,143 @@ function x$2(n, t, e) {
|
|
|
42
45
|
throw new Error(`Not a valid teleport reference: '${t}'`);
|
|
43
46
|
if (typeof t[e] != "function")
|
|
44
47
|
throw new Error(`Not a valid teleport method: '${e}'`);
|
|
45
|
-
let
|
|
46
|
-
"teleported #" +
|
|
48
|
+
let o = document.createComment(
|
|
49
|
+
"teleported #" + i.id
|
|
47
50
|
);
|
|
48
|
-
return
|
|
49
|
-
|
|
51
|
+
return i.before(o), t[e](i), () => {
|
|
52
|
+
o && (o.after(i), o.remove(), o = null);
|
|
50
53
|
};
|
|
51
54
|
}
|
|
52
|
-
function
|
|
53
|
-
return
|
|
55
|
+
function R$1(i) {
|
|
56
|
+
return i.split("-").map(
|
|
54
57
|
(t, e) => e === 0 ? t : t.charAt(0).toUpperCase() + t.slice(1)
|
|
55
58
|
).join("");
|
|
56
59
|
}
|
|
57
|
-
function
|
|
58
|
-
return
|
|
60
|
+
function M$2(i) {
|
|
61
|
+
return i.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
59
62
|
}
|
|
60
|
-
function
|
|
61
|
-
if (typeof
|
|
62
|
-
return
|
|
63
|
-
const t = parseFloat(
|
|
63
|
+
function A$3(i) {
|
|
64
|
+
if (typeof i == "number")
|
|
65
|
+
return i;
|
|
66
|
+
const t = parseFloat(i);
|
|
64
67
|
if (!Number.isNaN(t)) {
|
|
65
|
-
const e =
|
|
68
|
+
const e = i.includes("ms");
|
|
66
69
|
return t * (e ? 1 : 1e3);
|
|
67
70
|
}
|
|
68
|
-
throw new Error(`Could not convert value to milliseconds: ${
|
|
71
|
+
throw new Error(`Could not convert value to milliseconds: ${i}`);
|
|
69
72
|
}
|
|
70
|
-
function
|
|
71
|
-
return new Promise((
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
73
|
+
function W$1(i, t, e, o, r2 = 0) {
|
|
74
|
+
return new Promise((n) => {
|
|
75
|
+
i.classList.remove(t), i.classList.add(e), setTimeout(() => {
|
|
76
|
+
i.classList.add(o), i.classList.remove(e), n(i);
|
|
77
|
+
}, A$3(r2));
|
|
75
78
|
});
|
|
76
79
|
}
|
|
77
|
-
function
|
|
80
|
+
function S$3(i, t = {}) {
|
|
78
81
|
const e = {
|
|
79
82
|
fallback: null,
|
|
80
83
|
element: document.body,
|
|
81
84
|
...t
|
|
82
85
|
};
|
|
83
|
-
if (!
|
|
86
|
+
if (!i.startsWith("--")) {
|
|
84
87
|
const r2 = y$2();
|
|
85
|
-
r2 && (
|
|
88
|
+
r2 && (i = `${r2}${i}`), i = `--${i}`;
|
|
86
89
|
}
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
89
|
-
return
|
|
90
|
+
const o = getComputedStyle(e.element).getPropertyValue(i).trim();
|
|
91
|
+
if (o)
|
|
92
|
+
return o;
|
|
90
93
|
if (e.fallback)
|
|
91
94
|
return e.fallback;
|
|
92
|
-
throw new Error(`CSS variable "${
|
|
95
|
+
throw new Error(`CSS variable "${i}" was not found!`);
|
|
93
96
|
}
|
|
94
|
-
async function
|
|
95
|
-
await g$
|
|
96
|
-
for (const
|
|
97
|
-
await g$
|
|
98
|
-
await t.emit(
|
|
97
|
+
async function d$1(i, t, e) {
|
|
98
|
+
await g$2(t, i, e), e && await g$2(e, i);
|
|
99
|
+
for (const o of t.plugins)
|
|
100
|
+
await g$2(o, i, { parent: t, entry: e });
|
|
101
|
+
await t.emit(i, { parent: t, entry: e });
|
|
99
102
|
}
|
|
100
|
-
function
|
|
101
|
-
const t = getComputedStyle(
|
|
102
|
-
for (let r2 = 0; r2 <
|
|
103
|
-
const
|
|
104
|
-
|
|
103
|
+
function b$2(i) {
|
|
104
|
+
const t = getComputedStyle(i.el), e = {}, o = i.config.get("customProps");
|
|
105
|
+
for (let r2 = 0; r2 < o.length; r2++) {
|
|
106
|
+
const n = y$2(), s = i.parent.name.toLowerCase(), c2 = M$2(o[r2]), a2 = t.getPropertyValue(`--${n}${s}-${c2}`).trim();
|
|
107
|
+
a2 && (e[R$1(c2)] = a2);
|
|
105
108
|
}
|
|
106
109
|
return e;
|
|
107
110
|
}
|
|
108
111
|
function y$2() {
|
|
109
112
|
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
110
113
|
}
|
|
111
|
-
function P$3(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
function A$2(n, t = {}) {
|
|
115
|
-
const {
|
|
116
|
-
fallback: e,
|
|
117
|
-
props: s = ["dataConfig", "customProps", "settings", "parent.settings"]
|
|
118
|
-
} = t;
|
|
119
|
-
for (const r2 of s) {
|
|
120
|
-
const a2 = r2 !== "customProps" ? "camel" : "kebab", o = P$3.call(this, r2, n, a2);
|
|
121
|
-
if (o !== void 0)
|
|
122
|
-
return o;
|
|
123
|
-
}
|
|
124
|
-
if (e !== void 0)
|
|
125
|
-
return e;
|
|
126
|
-
throw new Error(`${this.parent.module} setting does not exist: ${n}`);
|
|
127
|
-
}
|
|
128
|
-
function T$3(n, t) {
|
|
129
|
-
t && document.querySelectorAll(t).forEach((s) => {
|
|
130
|
-
n ? s.style.overflow = "hidden" : s.style.removeProperty("overflow");
|
|
114
|
+
function P$3(i, t) {
|
|
115
|
+
t && document.querySelectorAll(t).forEach((o) => {
|
|
116
|
+
i ? o.style.overflow = "hidden" : o.style.removeProperty("overflow");
|
|
131
117
|
});
|
|
132
118
|
}
|
|
133
|
-
function
|
|
134
|
-
t && document.querySelectorAll(t).forEach((
|
|
135
|
-
|
|
119
|
+
function T$2(i, t) {
|
|
120
|
+
t && document.querySelectorAll(t).forEach((o) => {
|
|
121
|
+
o.inert = i;
|
|
136
122
|
});
|
|
137
123
|
}
|
|
138
|
-
function
|
|
139
|
-
|
|
124
|
+
function Z(i, t, e) {
|
|
125
|
+
T$2(!!i, t), P$3(!!i, e);
|
|
140
126
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
127
|
+
let I$3 = class I {
|
|
128
|
+
#t;
|
|
129
|
+
#e;
|
|
130
|
+
constructor() {
|
|
131
|
+
this.#t = {}, this.#e = [];
|
|
132
|
+
}
|
|
133
|
+
get(t, e) {
|
|
134
|
+
const { fallback: o, source: r2 } = e ?? {};
|
|
135
|
+
if (r2) {
|
|
136
|
+
const n = this.#t?.[r2]?.[t];
|
|
137
|
+
if (n !== void 0)
|
|
138
|
+
return n;
|
|
139
|
+
} else
|
|
140
|
+
for (const n of this.#e) {
|
|
141
|
+
const s = this.#t?.[n]?.[t];
|
|
142
|
+
if (s !== void 0)
|
|
143
|
+
return s;
|
|
144
|
+
}
|
|
145
|
+
if (o !== void 0)
|
|
146
|
+
return o;
|
|
147
|
+
throw new Error(`Config does not exist: ${t}`);
|
|
148
|
+
}
|
|
149
|
+
set(t, e = {}) {
|
|
150
|
+
let o, r2;
|
|
151
|
+
return typeof t == "string" ? (o = t, r2 = e) : (o = "entry", r2 = t), this.#t[o] ? Object.assign(this.#t[o], r2) : (this.#e.unshift(o), this.#t[o] = r2), this.#t[o];
|
|
152
|
+
}
|
|
153
|
+
remove(t) {
|
|
154
|
+
const e = this.#e.indexOf(t);
|
|
155
|
+
e !== -1 && this.#e.splice(e, 1), delete this.#t[t];
|
|
156
|
+
}
|
|
157
|
+
setSourceOrder(t) {
|
|
158
|
+
const e = Object.keys(this.#t).reverse(), o = t.filter((r2) => e.includes(r2));
|
|
159
|
+
for (const r2 of e)
|
|
160
|
+
o.includes(r2) || o.push(r2);
|
|
161
|
+
return this.#e = o;
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
let L$2 = class L {
|
|
165
|
+
constructor() {
|
|
166
|
+
this.events = {};
|
|
167
|
+
}
|
|
168
|
+
on(t, e, ...o) {
|
|
169
|
+
this.events[t] || (this.events[t] = []), this.events[t].some(
|
|
170
|
+
(n) => n.listener === e
|
|
171
|
+
) || this.events[t].push({ listener: e, args: o });
|
|
172
|
+
}
|
|
173
|
+
off(t, e) {
|
|
174
|
+
this.events[t] && (this.events[t] = this.events[t].filter(
|
|
175
|
+
(o) => o.listener !== e
|
|
151
176
|
));
|
|
152
|
-
}
|
|
153
|
-
async emit(
|
|
154
|
-
if (
|
|
155
|
-
for (const { listener:
|
|
156
|
-
await e
|
|
177
|
+
}
|
|
178
|
+
async emit(t, ...e) {
|
|
179
|
+
if (t = t.startsWith("on") ? t.slice(2, 3).toLowerCase() + t.slice(3) : t, !!this.events[t])
|
|
180
|
+
for (const { listener: o, args: r2 } of this.events[t])
|
|
181
|
+
await o(...e, ...r2);
|
|
157
182
|
}
|
|
158
183
|
};
|
|
159
|
-
let
|
|
184
|
+
let U$1 = class U extends Array {
|
|
160
185
|
constructor(t = null) {
|
|
161
186
|
super(), this.el = t, this.el && this.set();
|
|
162
187
|
}
|
|
@@ -173,70 +198,70 @@ let O$2 = class O extends Array {
|
|
|
173
198
|
this.length = 0;
|
|
174
199
|
}
|
|
175
200
|
};
|
|
176
|
-
let
|
|
201
|
+
let D$2 = class D {
|
|
177
202
|
constructor(t = null) {
|
|
178
|
-
this.el = t, this.focusable = new
|
|
203
|
+
this.el = t, this.focusable = new U$1(), this.handleFocusTrap = O$2.bind(this);
|
|
179
204
|
}
|
|
180
205
|
on(t = this.el) {
|
|
181
|
-
this.focusable.set(t), this.focusable.length ? document.addEventListener("keydown", this.handleFocusTrap) : document.addEventListener("keydown",
|
|
206
|
+
this.focusable.set(t), this.focusable.length ? document.addEventListener("keydown", this.handleFocusTrap) : document.addEventListener("keydown", $$2);
|
|
182
207
|
}
|
|
183
208
|
off() {
|
|
184
|
-
this.focusable.clear(), document.removeEventListener("keydown", this.handleFocusTrap), document.removeEventListener("keydown",
|
|
209
|
+
this.focusable.clear(), document.removeEventListener("keydown", this.handleFocusTrap), document.removeEventListener("keydown", $$2);
|
|
185
210
|
}
|
|
186
211
|
};
|
|
187
|
-
function
|
|
188
|
-
(
|
|
212
|
+
function $$2(i) {
|
|
213
|
+
(i.key === "Tab" || i.keyCode === 9) && i.preventDefault();
|
|
189
214
|
}
|
|
190
|
-
function
|
|
191
|
-
if (
|
|
192
|
-
const { activeElement: t } = document, { el: e, focusable:
|
|
193
|
-
if (r2 &&
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
|
|
215
|
+
function O$2(i) {
|
|
216
|
+
if (i.key !== "Tab" && i.keyCode !== 9) return;
|
|
217
|
+
const { activeElement: t } = document, { el: e, focusable: o } = this, r2 = i.shiftKey, n = t === o.first || t === e, s = t === o.last || t === e;
|
|
218
|
+
if (r2 && n || !r2 && s) {
|
|
219
|
+
i.preventDefault();
|
|
220
|
+
const c2 = r2 ? o.last : o.first;
|
|
221
|
+
c2 && typeof c2.focus == "function" && c2.focus();
|
|
197
222
|
}
|
|
198
223
|
}
|
|
199
|
-
function w$2(
|
|
200
|
-
const e = localStorage.getItem(
|
|
224
|
+
function w$2(i, t = true) {
|
|
225
|
+
const e = localStorage.getItem(i), o = e ? JSON.parse(e) : {};
|
|
201
226
|
return {
|
|
202
|
-
get(r2,
|
|
203
|
-
return r2 ? r2 in
|
|
227
|
+
get(r2, n) {
|
|
228
|
+
return r2 ? r2 in o ? o[r2] : n : o;
|
|
204
229
|
},
|
|
205
|
-
set(r2,
|
|
206
|
-
return
|
|
230
|
+
set(r2, n) {
|
|
231
|
+
return n ? o[r2] = n : delete o[r2], t && localStorage.setItem(i, JSON.stringify(o)), o;
|
|
207
232
|
}
|
|
208
233
|
};
|
|
209
234
|
}
|
|
210
|
-
|
|
235
|
+
class H extends Array {
|
|
211
236
|
constructor(t = {}) {
|
|
212
237
|
super(), this.presets = t;
|
|
213
238
|
}
|
|
214
|
-
|
|
215
|
-
const e =
|
|
216
|
-
t.
|
|
239
|
+
#t(t) {
|
|
240
|
+
const e = this.presets?.[t.name] || {}, o = t?.options || {};
|
|
241
|
+
t.config = { ...t.config, ...e, ...o };
|
|
217
242
|
}
|
|
218
|
-
|
|
243
|
+
#e(t) {
|
|
219
244
|
return !("name" in t) || typeof t.name != "string" ? (console.error("Plugin requires a name!"), false) : true;
|
|
220
245
|
}
|
|
221
246
|
get(t) {
|
|
222
|
-
return this.find((e) => e.name === t);
|
|
247
|
+
return this.find((e) => e.name === t) || null;
|
|
223
248
|
}
|
|
224
249
|
add(t) {
|
|
225
250
|
if (Array.isArray(t))
|
|
226
251
|
t.forEach((e) => this.add(e));
|
|
227
|
-
else if (this
|
|
228
|
-
const e = this.findIndex((
|
|
252
|
+
else if (this.#t(t), this.#e(t)) {
|
|
253
|
+
const e = this.findIndex((o) => o.name === t.name);
|
|
229
254
|
~e ? this[e] = t : this.push(t);
|
|
230
255
|
}
|
|
231
256
|
}
|
|
232
257
|
remove(t) {
|
|
233
|
-
const e = this.findIndex((
|
|
258
|
+
const e = this.findIndex((o) => o.name === t);
|
|
234
259
|
~e && this.splice(e, 1);
|
|
235
260
|
}
|
|
236
|
-
}
|
|
237
|
-
class
|
|
261
|
+
}
|
|
262
|
+
class _ extends Array {
|
|
238
263
|
constructor(t = {}) {
|
|
239
|
-
super(), this.
|
|
264
|
+
super(), this.config = t;
|
|
240
265
|
}
|
|
241
266
|
get copy() {
|
|
242
267
|
return [...this];
|
|
@@ -248,49 +273,104 @@ class W extends Array {
|
|
|
248
273
|
updateIndex() {
|
|
249
274
|
this.forEach((t, e) => {
|
|
250
275
|
t.el.style.zIndex = "";
|
|
251
|
-
const
|
|
252
|
-
t.el.style.zIndex =
|
|
276
|
+
const o = getComputedStyle(t.el).getPropertyValue("z-index"), r2 = parseInt(o, 10), n = String((Number.isNaN(r2) ? 0 : r2) + e + 1);
|
|
277
|
+
t.el.style.zIndex = n;
|
|
253
278
|
});
|
|
254
279
|
}
|
|
255
280
|
onChange() {
|
|
256
|
-
this.updateIndex(), typeof this.
|
|
281
|
+
this.updateIndex(), typeof this.config.onChange == "function" && this.config.onChange();
|
|
257
282
|
}
|
|
258
283
|
add(t) {
|
|
259
284
|
this.push(t), this.onChange();
|
|
260
285
|
}
|
|
261
286
|
remove(t) {
|
|
262
|
-
const e = this.findIndex((
|
|
287
|
+
const e = this.findIndex((o) => o.id === t.id);
|
|
263
288
|
~e && (t.el.style.zIndex = "", this.splice(e, 1), this.onChange());
|
|
264
289
|
}
|
|
265
290
|
moveToTop(t) {
|
|
266
|
-
const e = this.findIndex((
|
|
291
|
+
const e = this.findIndex((o) => o.id === t.id);
|
|
267
292
|
~e && (this.splice(e, 1), this.add(t));
|
|
268
293
|
}
|
|
269
294
|
}
|
|
270
295
|
const N$1 = {
|
|
296
|
+
attr: "config",
|
|
297
|
+
sourceKey: "attr"
|
|
298
|
+
};
|
|
299
|
+
function X$1(i = {}) {
|
|
300
|
+
return { ...{
|
|
301
|
+
name: "attrConfig",
|
|
302
|
+
config: N$1,
|
|
303
|
+
options: i
|
|
304
|
+
}, ...{
|
|
305
|
+
onCreateEntry({ entry: o }) {
|
|
306
|
+
const r2 = x$2(o.el, this.config.attr);
|
|
307
|
+
o.config.set(this.config.sourceKey, r2);
|
|
308
|
+
},
|
|
309
|
+
onDestroyEntry({ entry: o }) {
|
|
310
|
+
o.config.remove(this.config.sourceKey);
|
|
311
|
+
}
|
|
312
|
+
} };
|
|
313
|
+
}
|
|
314
|
+
const K$1 = {
|
|
315
|
+
sourceKey: "css"
|
|
316
|
+
};
|
|
317
|
+
function Y$1(i = {}) {
|
|
318
|
+
const t = {
|
|
319
|
+
name: "cssConfig",
|
|
320
|
+
config: K$1,
|
|
321
|
+
options: i
|
|
322
|
+
}, e = {
|
|
323
|
+
setup(r2) {
|
|
324
|
+
r2.on("updateCustomProps", o, this);
|
|
325
|
+
},
|
|
326
|
+
teardown(r2) {
|
|
327
|
+
r2.off("updateCustomProps", o);
|
|
328
|
+
},
|
|
329
|
+
onCreateEntry({ entry: r2 }) {
|
|
330
|
+
const n = b$2(r2);
|
|
331
|
+
r2.config.set(this.config.sourceKey, n);
|
|
332
|
+
},
|
|
333
|
+
onDestroyEntry({ entry: r2 }) {
|
|
334
|
+
r2.config.remove(this.config.sourceKey);
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
function o(r2, n) {
|
|
338
|
+
const s = b$2(r2);
|
|
339
|
+
r2.config.set(n.config.sourceKey, s);
|
|
340
|
+
}
|
|
341
|
+
return { ...t, ...e };
|
|
342
|
+
}
|
|
343
|
+
const Q = {
|
|
271
344
|
condition: true
|
|
272
|
-
},
|
|
345
|
+
}, q$2 = {
|
|
273
346
|
primary: "hsl(152deg 60% 50%)",
|
|
274
347
|
secondary: "hsl(214deg 50% 50%)",
|
|
275
348
|
neutral: "hsl(214deg 20% 50%)",
|
|
276
349
|
important: "hsl(0deg 80% 50%)"
|
|
277
350
|
};
|
|
278
|
-
function
|
|
351
|
+
function tt$1(i = {}) {
|
|
279
352
|
const t = {
|
|
280
353
|
name: "debug",
|
|
281
|
-
|
|
282
|
-
options:
|
|
354
|
+
config: Q,
|
|
355
|
+
options: i
|
|
283
356
|
};
|
|
284
|
-
function e(
|
|
285
|
-
const
|
|
286
|
-
console.log(`%c📡 DEBUG: %c${
|
|
287
|
-
}
|
|
288
|
-
function s(o, ...i) {
|
|
289
|
-
return typeof o == "function" ? o(...i) : o;
|
|
357
|
+
function e(n, s = [], c2 = ["primary", "secondary"]) {
|
|
358
|
+
const a2 = c2.map((f2) => `color: ${q$2[f2]}`);
|
|
359
|
+
console.log(`%c📡 DEBUG: %c${n}`, ...a2, ...s);
|
|
290
360
|
}
|
|
291
|
-
const
|
|
292
|
-
beforeMountRef: e.bind(
|
|
293
|
-
|
|
361
|
+
const o = {
|
|
362
|
+
beforeMountRef: e.bind(
|
|
363
|
+
null,
|
|
364
|
+
"Event > beforeMount()",
|
|
365
|
+
[],
|
|
366
|
+
["primary", "secondary"]
|
|
367
|
+
),
|
|
368
|
+
afterMountRef: e.bind(
|
|
369
|
+
null,
|
|
370
|
+
"Event > afterMount()",
|
|
371
|
+
[],
|
|
372
|
+
["primary", "secondary"]
|
|
373
|
+
),
|
|
294
374
|
beforeUnmountRef: e.bind(
|
|
295
375
|
null,
|
|
296
376
|
"Event > beforeUnmount()",
|
|
@@ -303,33 +383,33 @@ function Z(n = {}) {
|
|
|
303
383
|
[],
|
|
304
384
|
["important", "neutral"]
|
|
305
385
|
),
|
|
306
|
-
createEntryRef: (
|
|
307
|
-
if (
|
|
308
|
-
const
|
|
309
|
-
e(`Event > createEntry() > [${
|
|
386
|
+
createEntryRef: ({ parent: n, entry: s }, c2) => {
|
|
387
|
+
if (h$2(c2.config.condition, s)) {
|
|
388
|
+
const a2 = n.collection.length;
|
|
389
|
+
e(`Event > createEntry() > [${a2}] #${s.id}`);
|
|
310
390
|
}
|
|
311
391
|
},
|
|
312
|
-
registerEntryRef: (
|
|
313
|
-
if (
|
|
314
|
-
const
|
|
315
|
-
e(`Event > registerEntry() > [${
|
|
392
|
+
registerEntryRef: ({ parent: n, entry: s }, c2) => {
|
|
393
|
+
if (h$2(c2.config.condition, s)) {
|
|
394
|
+
const a2 = n.collection.length;
|
|
395
|
+
e(`Event > registerEntry() > [${a2}] #${s.id}`);
|
|
316
396
|
}
|
|
317
397
|
},
|
|
318
|
-
destroyEntryRef: (
|
|
319
|
-
if (
|
|
320
|
-
const
|
|
398
|
+
destroyEntryRef: ({ parent: n, entry: s }, c2) => {
|
|
399
|
+
if (h$2(c2.config.condition, s)) {
|
|
400
|
+
const a2 = n.collection.length;
|
|
321
401
|
e(
|
|
322
|
-
`Event > destroyEntry() > [${
|
|
402
|
+
`Event > destroyEntry() > [${a2}] #${s.id}`,
|
|
323
403
|
[],
|
|
324
404
|
["important", "neutral"]
|
|
325
405
|
);
|
|
326
406
|
}
|
|
327
407
|
},
|
|
328
|
-
deregisterEntryRef: (
|
|
329
|
-
if (
|
|
330
|
-
const
|
|
408
|
+
deregisterEntryRef: ({ parent: n, entry: s }, c2) => {
|
|
409
|
+
if (h$2(c2.config.condition, s)) {
|
|
410
|
+
const a2 = n.collection.length;
|
|
331
411
|
e(
|
|
332
|
-
`Event > deregisterEntry() > [${
|
|
412
|
+
`Event > deregisterEntry() > [${a2}]`,
|
|
333
413
|
[],
|
|
334
414
|
["important", "neutral"]
|
|
335
415
|
);
|
|
@@ -338,39 +418,33 @@ function Z(n = {}) {
|
|
|
338
418
|
};
|
|
339
419
|
return { ...t, ...{
|
|
340
420
|
// Plugin setup/teardown methods
|
|
341
|
-
setup(
|
|
342
|
-
e("Plugin > setup()", Array.from(arguments), ["secondary", "neutral"]),
|
|
343
|
-
parent: o,
|
|
344
|
-
plugin: this
|
|
345
|
-
}), o.on("afterMount", r2.afterMountRef), o.on("beforeUnmount", r2.beforeUnmountRef), o.on("destroyEntry", r2.destroyEntryRef, { parent: o, plugin: this }), o.on("deregisterEntry", r2.deregisterEntryRef, {
|
|
346
|
-
parent: o,
|
|
347
|
-
plugin: this
|
|
348
|
-
}), o.on("afterUnmount", r2.afterUnmountRef);
|
|
421
|
+
setup(n) {
|
|
422
|
+
e("Plugin > setup()", Array.from(arguments), ["secondary", "neutral"]), n.on("beforeMount", o.beforeMountRef), n.on("createEntry", o.createEntryRef, this), n.on("registerEntry", o.registerEntryRef, this), n.on("afterMount", o.afterMountRef), n.on("beforeUnmount", o.beforeUnmountRef), n.on("destroyEntry", o.destroyEntryRef, this), n.on("deregisterEntry", o.deregisterEntryRef, this), n.on("afterUnmount", o.afterUnmountRef);
|
|
349
423
|
},
|
|
350
|
-
teardown(
|
|
424
|
+
teardown(n) {
|
|
351
425
|
e("Plugin > teardown()", Array.from(arguments), [
|
|
352
426
|
"secondary",
|
|
353
427
|
"neutral"
|
|
354
|
-
]),
|
|
428
|
+
]), n.off("beforeMount", o.beforeMountRef), n.off("createEntry", o.createEntryRef), n.off("registerEntry", o.registerEntryRef), n.off("afterMount", o.afterMountRef), n.off("beforeUnmount", o.beforeUnmountRef), n.off("destroyEntry", o.destroyEntryRef), n.off("deregisterEntry", o.deregisterEntryRef), n.off("afterUnmount", o.afterUnmountRef);
|
|
355
429
|
},
|
|
356
430
|
// Mount lifecycle hooks
|
|
357
431
|
beforeMount() {
|
|
358
432
|
e("Hook > beforeMount()", Array.from(arguments));
|
|
359
433
|
},
|
|
360
|
-
onCreateEntry({ parent:
|
|
361
|
-
if (
|
|
362
|
-
const c2 =
|
|
434
|
+
onCreateEntry({ parent: n, entry: s }) {
|
|
435
|
+
if (h$2(this.config.condition, s)) {
|
|
436
|
+
const c2 = n.collection.length;
|
|
363
437
|
e(
|
|
364
|
-
`Hook > onCreateEntry() > [${c2}] #${
|
|
438
|
+
`Hook > onCreateEntry() > [${c2}] #${s.id}`,
|
|
365
439
|
Array.from(arguments)
|
|
366
440
|
);
|
|
367
441
|
}
|
|
368
442
|
},
|
|
369
|
-
onRegisterEntry({ parent:
|
|
370
|
-
if (
|
|
371
|
-
const c2 =
|
|
443
|
+
onRegisterEntry({ parent: n, entry: s }) {
|
|
444
|
+
if (h$2(this.config.condition, s)) {
|
|
445
|
+
const c2 = n.collection.length - 1;
|
|
372
446
|
e(
|
|
373
|
-
`Hook > onRegisterEntry() > [${c2}] #${
|
|
447
|
+
`Hook > onRegisterEntry() > [${c2}] #${s.id}`,
|
|
374
448
|
Array.from(arguments)
|
|
375
449
|
);
|
|
376
450
|
}
|
|
@@ -385,19 +459,19 @@ function Z(n = {}) {
|
|
|
385
459
|
"neutral"
|
|
386
460
|
]);
|
|
387
461
|
},
|
|
388
|
-
onDestroyEntry({ parent:
|
|
389
|
-
if (
|
|
390
|
-
const c2 =
|
|
462
|
+
onDestroyEntry({ parent: n, entry: s }) {
|
|
463
|
+
if (h$2(this.config.condition, s)) {
|
|
464
|
+
const c2 = n.collection.length - 1;
|
|
391
465
|
e(
|
|
392
|
-
`Hook > onDestroyEntry() > [${c2}] #${
|
|
466
|
+
`Hook > onDestroyEntry() > [${c2}] #${s.id}`,
|
|
393
467
|
Array.from(arguments),
|
|
394
468
|
["important", "neutral"]
|
|
395
469
|
);
|
|
396
470
|
}
|
|
397
471
|
},
|
|
398
|
-
onDeregisterEntry({ parent:
|
|
399
|
-
if (
|
|
400
|
-
const c2 =
|
|
472
|
+
onDeregisterEntry({ parent: n, entry: s }) {
|
|
473
|
+
if (h$2(this.config.condition, s)) {
|
|
474
|
+
const c2 = n.collection.length;
|
|
401
475
|
e(`Hook > onDeregisterEntry() > [${c2}]`, Array.from(arguments), [
|
|
402
476
|
"important",
|
|
403
477
|
"neutral"
|
|
@@ -412,43 +486,40 @@ function Z(n = {}) {
|
|
|
412
486
|
}
|
|
413
487
|
} };
|
|
414
488
|
}
|
|
415
|
-
const
|
|
489
|
+
const F$1 = {
|
|
416
490
|
condition: true
|
|
417
491
|
};
|
|
418
|
-
function
|
|
492
|
+
function et$1(i = {}) {
|
|
419
493
|
const t = {
|
|
420
494
|
name: "focusTrap",
|
|
421
|
-
|
|
422
|
-
options:
|
|
495
|
+
config: F$1,
|
|
496
|
+
options: i
|
|
423
497
|
}, e = {
|
|
424
|
-
setup(
|
|
425
|
-
|
|
498
|
+
setup(n) {
|
|
499
|
+
n.on("opened", o, this), n.on("closed", r2, this);
|
|
426
500
|
},
|
|
427
|
-
teardown(
|
|
428
|
-
|
|
501
|
+
teardown(n) {
|
|
502
|
+
n.off("opened", o), n.off("closed", r2);
|
|
429
503
|
},
|
|
430
|
-
onCreateEntry({ entry:
|
|
431
|
-
|
|
504
|
+
onCreateEntry({ entry: n }) {
|
|
505
|
+
n.focusTrap = new D$2();
|
|
432
506
|
}
|
|
433
507
|
};
|
|
434
|
-
function
|
|
435
|
-
|
|
508
|
+
function o(n, s) {
|
|
509
|
+
const c2 = { plugin: s, parent: n.parent, entry: n };
|
|
510
|
+
n.focusTrap && h$2(s.config.condition, c2) && n.focusTrap.on(n.dialog);
|
|
436
511
|
}
|
|
437
|
-
function r2(
|
|
438
|
-
const c2 = { plugin:
|
|
439
|
-
s
|
|
440
|
-
}
|
|
441
|
-
function a2(o, i) {
|
|
442
|
-
const c2 = { plugin: i, parent: o.parent, entry: o };
|
|
443
|
-
s(i.settings.condition, c2) && o.focusTrap?.off();
|
|
512
|
+
function r2(n, s) {
|
|
513
|
+
const c2 = { plugin: s, parent: n.parent, entry: n };
|
|
514
|
+
n.focusTrap && h$2(s.config.condition, c2) && n.focusTrap.off();
|
|
444
515
|
}
|
|
445
516
|
return { ...t, ...e };
|
|
446
517
|
}
|
|
447
|
-
const
|
|
518
|
+
const V = {
|
|
448
519
|
// The data attributes to get the breakpoint values from
|
|
449
|
-
|
|
520
|
+
attrBreakpoint: "breakpoint",
|
|
450
521
|
// The data attributes to get the media query value from
|
|
451
|
-
|
|
522
|
+
attrMediaQuery: "media-query",
|
|
452
523
|
// The string token to replace in the media query string
|
|
453
524
|
token: "{{BP}}",
|
|
454
525
|
// Sets a global breakpoint. Can be overridden by setting a data attribute
|
|
@@ -469,47 +540,47 @@ const F$2 = {
|
|
|
469
540
|
onChange: () => {
|
|
470
541
|
}
|
|
471
542
|
};
|
|
472
|
-
function
|
|
543
|
+
function ot$1(i = {}) {
|
|
473
544
|
const t = {
|
|
474
545
|
name: "mediaQuery",
|
|
475
|
-
|
|
476
|
-
options:
|
|
546
|
+
config: V,
|
|
547
|
+
options: i
|
|
477
548
|
}, e = {
|
|
478
549
|
// Run when an entry is created
|
|
479
550
|
// Sets up the MediaQueryList and event listener
|
|
480
|
-
onCreateEntry({ entry:
|
|
481
|
-
|
|
551
|
+
onCreateEntry({ entry: c2 }) {
|
|
552
|
+
n.call(this, c2);
|
|
482
553
|
},
|
|
483
554
|
// Run when an entry is destroyed
|
|
484
555
|
// Removes the MediaQueryList and event listener
|
|
485
|
-
onDestroyEntry({ entry:
|
|
486
|
-
|
|
556
|
+
onDestroyEntry({ entry: c2 }) {
|
|
557
|
+
s(c2);
|
|
487
558
|
}
|
|
488
559
|
};
|
|
489
|
-
function
|
|
490
|
-
const
|
|
491
|
-
return !
|
|
492
|
-
}
|
|
493
|
-
function r2(
|
|
494
|
-
let
|
|
495
|
-
return !
|
|
496
|
-
}
|
|
497
|
-
function
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
this.
|
|
505
|
-
}, this.
|
|
506
|
-
}
|
|
507
|
-
function
|
|
508
|
-
|
|
560
|
+
function o(c2) {
|
|
561
|
+
const a2 = c2.el.getAttribute(`data-${this.config.attrMediaQuery}`);
|
|
562
|
+
return !a2 && c2.id in this.config.mediaQueries ? this.config.mediaQueries[c2.id] : a2 || void 0;
|
|
563
|
+
}
|
|
564
|
+
function r2(c2) {
|
|
565
|
+
let a2 = c2.el.getAttribute(`data-${this.config.attrBreakpoint}`);
|
|
566
|
+
return !a2 && c2.id in this.config.breakpoints && (a2 = this.config.breakpoints[c2.id]), a2 && a2 in this.config.breakpoints && (a2 = this.config.breakpoints[a2]), a2 && (a2 = getComputedStyle(document.body).getPropertyValue(`--${y$2()}breakpoint-${a2}`).trim() || a2), a2 || this.config.breakpoint;
|
|
567
|
+
}
|
|
568
|
+
function n(c2) {
|
|
569
|
+
const a2 = r2.call(this, c2);
|
|
570
|
+
if (!a2) return;
|
|
571
|
+
let f2 = o.call(this, c2) || this.config.mediaQuery;
|
|
572
|
+
if (!f2) return;
|
|
573
|
+
const p2 = f2.replace(new RegExp(`${this.config.token}`, "g"), a2);
|
|
574
|
+
c2.mql = window.matchMedia(p2), c2.mql.onchange = (E2) => {
|
|
575
|
+
this.config.onChange(E2, c2);
|
|
576
|
+
}, this.config.onChange(c2.mql, c2);
|
|
577
|
+
}
|
|
578
|
+
function s(c2) {
|
|
579
|
+
c2.mql && (c2.mql.onchange = null, c2.mql = null);
|
|
509
580
|
}
|
|
510
581
|
return { ...t, ...e };
|
|
511
582
|
}
|
|
512
|
-
const
|
|
583
|
+
const B = {
|
|
513
584
|
// The property on entry objects to watch
|
|
514
585
|
prop: "state",
|
|
515
586
|
// The default value or a function to compute the initial value
|
|
@@ -525,289 +596,251 @@ const V$1 = {
|
|
|
525
596
|
onChange() {
|
|
526
597
|
}
|
|
527
598
|
};
|
|
528
|
-
function
|
|
599
|
+
function nt$1(i = {}) {
|
|
529
600
|
const t = {
|
|
530
601
|
name: "propStore",
|
|
531
|
-
|
|
532
|
-
options:
|
|
602
|
+
config: B,
|
|
603
|
+
options: i,
|
|
533
604
|
store: null
|
|
534
605
|
}, e = {
|
|
535
|
-
setup(
|
|
536
|
-
this.store = w$2(
|
|
606
|
+
setup(s) {
|
|
607
|
+
this.store = w$2(n.call(this, s.name));
|
|
537
608
|
},
|
|
538
|
-
async onCreateEntry({ entry:
|
|
539
|
-
await
|
|
609
|
+
async onCreateEntry({ entry: s }) {
|
|
610
|
+
await o.call(this, s);
|
|
540
611
|
},
|
|
541
|
-
onDestroyEntry({ entry:
|
|
542
|
-
|
|
612
|
+
onDestroyEntry({ entry: s }) {
|
|
613
|
+
r2.call(this, s);
|
|
543
614
|
}
|
|
544
615
|
};
|
|
545
|
-
async function s
|
|
546
|
-
let c2 =
|
|
547
|
-
const
|
|
548
|
-
Object.defineProperty(
|
|
616
|
+
async function o(s) {
|
|
617
|
+
let c2 = s[this.config.prop] || null;
|
|
618
|
+
const a2 = { plugin: this, parent: s.parent, entry: s };
|
|
619
|
+
Object.defineProperty(s, this.config.prop, {
|
|
549
620
|
configurable: true,
|
|
550
621
|
get() {
|
|
551
622
|
return c2;
|
|
552
623
|
},
|
|
553
|
-
set: async (
|
|
554
|
-
if (c2 ===
|
|
624
|
+
set: async (f2) => {
|
|
625
|
+
if (c2 === f2) return;
|
|
555
626
|
const p2 = c2;
|
|
556
|
-
c2 =
|
|
557
|
-
this.
|
|
558
|
-
|
|
559
|
-
|
|
627
|
+
c2 = f2, h$2(
|
|
628
|
+
this.config.condition,
|
|
629
|
+
a2,
|
|
630
|
+
f2,
|
|
560
631
|
p2
|
|
561
|
-
) && this.store
|
|
632
|
+
) && this.store?.set(s.id, f2), await this.config.onChange(a2, f2, p2);
|
|
562
633
|
}
|
|
563
|
-
}), Object.defineProperty(
|
|
634
|
+
}), Object.defineProperty(s, "store", {
|
|
564
635
|
configurable: true,
|
|
565
|
-
get: () => this.store
|
|
566
|
-
set: (
|
|
567
|
-
|
|
636
|
+
get: () => this.store?.get(s.id),
|
|
637
|
+
set: (f2) => {
|
|
638
|
+
s[this.config.prop] = f2;
|
|
568
639
|
}
|
|
569
|
-
}),
|
|
570
|
-
}
|
|
571
|
-
function r2(i, ...c2) {
|
|
572
|
-
return typeof i == "function" ? i(...c2) : i;
|
|
640
|
+
}), s[this.config.prop] = await h$2(this.config.value, a2) || s[this.config.prop];
|
|
573
641
|
}
|
|
574
|
-
async function
|
|
575
|
-
const c2 =
|
|
576
|
-
delete
|
|
642
|
+
async function r2(s) {
|
|
643
|
+
const c2 = s[this.config.prop];
|
|
644
|
+
delete s[this.config.prop], s[this.config.prop] = c2, this.store?.set(s.id, null);
|
|
577
645
|
}
|
|
578
|
-
function
|
|
579
|
-
const c2 = this.
|
|
580
|
-
return this.
|
|
646
|
+
function n(s) {
|
|
647
|
+
const c2 = this.config.prop.charAt(0).toUpperCase() + this.config.prop.slice(1), a2 = this.config.key || s + c2;
|
|
648
|
+
return this.config.keyPrefix + a2;
|
|
581
649
|
}
|
|
582
650
|
return { ...t, ...e };
|
|
583
651
|
}
|
|
584
|
-
const
|
|
652
|
+
const j$1 = {
|
|
585
653
|
where: null,
|
|
586
654
|
how: "append"
|
|
587
655
|
};
|
|
588
|
-
function
|
|
656
|
+
function it$1(i = {}) {
|
|
589
657
|
const t = {
|
|
590
658
|
name: "teleport",
|
|
591
|
-
|
|
592
|
-
options:
|
|
659
|
+
config: j$1,
|
|
660
|
+
options: i
|
|
593
661
|
}, e = {
|
|
594
|
-
onCreateEntry({
|
|
595
|
-
|
|
662
|
+
onCreateEntry({ entry: n }) {
|
|
663
|
+
o(this, n);
|
|
596
664
|
},
|
|
597
|
-
onDestroyEntry({
|
|
598
|
-
r2(
|
|
665
|
+
onDestroyEntry({ entry: n }) {
|
|
666
|
+
r2(this, n);
|
|
599
667
|
}
|
|
600
668
|
};
|
|
601
|
-
function
|
|
602
|
-
|
|
603
|
-
typeof
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
669
|
+
function o(n, s) {
|
|
670
|
+
s.teleport = () => {
|
|
671
|
+
typeof s.teleportReturn == "function" && s.teleportReturn(), s.teleportReturn = k$3(
|
|
672
|
+
s.el,
|
|
673
|
+
s.config.get("teleport", { fallback: n.config.where }),
|
|
674
|
+
s.config.get("teleportMethod", { fallback: n.config.how })
|
|
607
675
|
);
|
|
608
|
-
},
|
|
676
|
+
}, s.teleport(), s.parent.emit("teleport", { plugin: n, parent: s.parent, entry: s });
|
|
609
677
|
}
|
|
610
|
-
function r2(
|
|
611
|
-
typeof
|
|
612
|
-
plugin:
|
|
613
|
-
parent:
|
|
614
|
-
entry:
|
|
678
|
+
function r2(n, s) {
|
|
679
|
+
typeof s.teleportReturn == "function" && s.teleportReturn(), s.parent.emit("teleportReturn", {
|
|
680
|
+
plugin: n,
|
|
681
|
+
parent: s.parent,
|
|
682
|
+
entry: s
|
|
615
683
|
});
|
|
616
684
|
}
|
|
617
685
|
return { ...t, ...e };
|
|
618
686
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
};
|
|
623
|
-
let z$2 = class z {
|
|
624
|
-
constructor(t, e, s = {}) {
|
|
625
|
-
this.parent = t, this.el = E$3(e), this.settings = { ...s }, this.dataConfig = {}, this.customProps = {};
|
|
626
|
-
}
|
|
627
|
-
get id() {
|
|
628
|
-
return this.el.id;
|
|
629
|
-
}
|
|
630
|
-
applySettings(t) {
|
|
631
|
-
return Object.assign(this.settings, t);
|
|
632
|
-
}
|
|
633
|
-
getSetting(t, e) {
|
|
634
|
-
return A$2.call(this, t, e);
|
|
635
|
-
}
|
|
636
|
-
buildDataConfig() {
|
|
637
|
-
return Object.assign(
|
|
638
|
-
this.dataConfig,
|
|
639
|
-
k$3(this.el, this.getSetting("dataConfig"))
|
|
640
|
-
);
|
|
641
|
-
}
|
|
642
|
-
buildCustomProps() {
|
|
643
|
-
return Object.assign(this.customProps, M$2(this));
|
|
644
|
-
}
|
|
645
|
-
async init(t = {}) {
|
|
646
|
-
this.applySettings(t), this.buildDataConfig(), this.buildCustomProps();
|
|
647
|
-
}
|
|
648
|
-
async destroy() {
|
|
649
|
-
Object.getOwnPropertyNames(this).forEach((t) => {
|
|
650
|
-
delete this[t];
|
|
651
|
-
});
|
|
687
|
+
let z$1 = class z {
|
|
688
|
+
constructor(t, e) {
|
|
689
|
+
this.config = new I$3(), this.parent = t, this.el = v$2(e), this.id = this.el.id, this.config.set("parent", this.parent.config), this.config.set("entry", {});
|
|
652
690
|
}
|
|
653
691
|
};
|
|
654
|
-
|
|
692
|
+
const J$1 = {
|
|
693
|
+
selector: "",
|
|
694
|
+
plugins: [],
|
|
695
|
+
presets: {}
|
|
696
|
+
};
|
|
697
|
+
let st$1 = class st {
|
|
655
698
|
constructor(t = {}) {
|
|
656
|
-
this.
|
|
699
|
+
this.#t = new L$2(), this.events = this.#t.events, this.on = this.#t.on.bind(this.#t), this.off = this.#t.off.bind(this.#t), this.emit = this.#t.emit.bind(this.#t), this.collection = [], this.entryClass = z$1, this.name = this.constructor.name, this.config = { ...J$1, ...t }, this.plugins = new H(this.config.presets);
|
|
657
700
|
}
|
|
701
|
+
#t;
|
|
658
702
|
get(t, e = "id") {
|
|
659
|
-
return this.collection.find((
|
|
703
|
+
return this.collection.find((o) => o[e] === t);
|
|
660
704
|
}
|
|
661
705
|
getOrThrow(t, e = "id") {
|
|
662
|
-
const
|
|
663
|
-
if (
|
|
664
|
-
return
|
|
706
|
+
const o = this.get(t, e);
|
|
707
|
+
if (o)
|
|
708
|
+
return o;
|
|
665
709
|
throw new Error(
|
|
666
|
-
`${this.
|
|
710
|
+
`${this.name} entry not found in collection with ${String(e)} of "${t}"`
|
|
667
711
|
);
|
|
668
712
|
}
|
|
669
|
-
|
|
670
|
-
return Object.assign(this.
|
|
713
|
+
updateConfig(t = {}) {
|
|
714
|
+
return Object.assign(this.config, t);
|
|
671
715
|
}
|
|
672
|
-
async createEntry(t
|
|
673
|
-
const
|
|
674
|
-
return await g$
|
|
716
|
+
async createEntry(t) {
|
|
717
|
+
const e = new this.entryClass(this, t);
|
|
718
|
+
return await g$2(e, "init"), await d$1("onCreateEntry", this, e), e;
|
|
675
719
|
}
|
|
676
720
|
async destroyEntry(t) {
|
|
677
|
-
return await
|
|
678
|
-
}
|
|
679
|
-
async register(t
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
const a2 = this.collection[r2];
|
|
683
|
-
return a2.el = s, typeof a2.init == "function" && await a2.init(e), a2;
|
|
684
|
-
} else {
|
|
685
|
-
const a2 = await this.createEntry(s, e);
|
|
686
|
-
return this.collection.push(a2), await h$1("onRegisterEntry", this, a2), a2;
|
|
687
|
-
}
|
|
721
|
+
return await d$1("onDestroyEntry", this, t), await g$2(t, "destroy"), t;
|
|
722
|
+
}
|
|
723
|
+
async register(t) {
|
|
724
|
+
const e = this.collection.findIndex((o) => o.id === t.id);
|
|
725
|
+
return ~e ? this.collection[e] = t : this.collection.push(t), await d$1("onRegisterEntry", this, t), t;
|
|
688
726
|
}
|
|
689
727
|
async deregister(t) {
|
|
690
|
-
const e = this.collection.findIndex((
|
|
728
|
+
const e = this.collection.findIndex((o) => o.id === t.id);
|
|
691
729
|
if (~e) {
|
|
692
|
-
|
|
693
|
-
return await h$1(
|
|
730
|
+
await d$1(
|
|
694
731
|
"onDeregisterEntry",
|
|
695
732
|
this,
|
|
696
733
|
this.collection[e]
|
|
697
|
-
)
|
|
734
|
+
);
|
|
735
|
+
const [o] = this.collection.splice(e, 1);
|
|
698
736
|
}
|
|
699
|
-
return
|
|
737
|
+
return t;
|
|
700
738
|
}
|
|
701
|
-
async mount(t =
|
|
702
|
-
this.
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
return await
|
|
712
|
-
}
|
|
713
|
-
async unmount() {
|
|
714
|
-
for (await
|
|
715
|
-
await this.
|
|
716
|
-
await
|
|
717
|
-
for (const
|
|
718
|
-
await g$
|
|
719
|
-
for (const
|
|
720
|
-
this.plugins.remove(
|
|
739
|
+
async mount(t = (e) => e) {
|
|
740
|
+
for (const e of this.config?.plugins || [])
|
|
741
|
+
this.plugins.add(e);
|
|
742
|
+
for (const e of this.plugins)
|
|
743
|
+
await g$2(e, "setup", this);
|
|
744
|
+
if (await d$1("beforeMount", this), this.config.selector) {
|
|
745
|
+
const e = document.querySelectorAll(this.config.selector);
|
|
746
|
+
for (const o of e)
|
|
747
|
+
await this.createEntry(o).then((r2) => t(r2)).then((r2) => this.register(r2));
|
|
748
|
+
}
|
|
749
|
+
return await d$1("afterMount", this), this;
|
|
750
|
+
}
|
|
751
|
+
async unmount(t = (e) => e) {
|
|
752
|
+
for (await d$1("beforeUnmount", this); this.collection.length > 0; )
|
|
753
|
+
await this.destroyEntry(this.collection[0]).then((e) => t(e)).then((e) => this.deregister(e));
|
|
754
|
+
await d$1("afterUnmount", this);
|
|
755
|
+
for (const e of this.plugins)
|
|
756
|
+
await g$2(e, "teardown", this);
|
|
757
|
+
for (const e of [...this.plugins])
|
|
758
|
+
this.plugins.remove(e.name);
|
|
721
759
|
return this;
|
|
722
760
|
}
|
|
723
761
|
};
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
settings: t,
|
|
762
|
+
const G = {
|
|
763
|
+
prefix: S$3("theme-prefix", { fallback: "vb-theme-" }),
|
|
764
|
+
storeKey: "VB:Profile",
|
|
765
|
+
fallback: "root",
|
|
766
|
+
themes: ["root", "light", "dark"],
|
|
767
|
+
onInit() {
|
|
768
|
+
},
|
|
769
|
+
onChange() {
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
function rt$1(i = {}) {
|
|
773
|
+
const t = { ...G, ...i };
|
|
774
|
+
function e(n) {
|
|
775
|
+
t[n].call(r2);
|
|
776
|
+
}
|
|
777
|
+
const o = w$2(t.storeKey), r2 = {
|
|
778
|
+
// Store our config in the API
|
|
779
|
+
config: t,
|
|
743
780
|
// Actions
|
|
744
|
-
add(
|
|
745
|
-
t.themes.push(
|
|
746
|
-
},
|
|
747
|
-
remove(a2) {
|
|
748
|
-
const o = t.themes.indexOf(a2);
|
|
749
|
-
~o && t.themes.splice(o, 1);
|
|
781
|
+
add(n) {
|
|
782
|
+
t.themes.push(n);
|
|
750
783
|
},
|
|
751
|
-
|
|
752
|
-
|
|
784
|
+
remove(n) {
|
|
785
|
+
const s = t.themes.indexOf(n);
|
|
786
|
+
~s && t.themes.splice(s, 1);
|
|
753
787
|
},
|
|
754
788
|
// Getters
|
|
755
789
|
get class() {
|
|
756
790
|
return `${t.prefix}${this.theme}`;
|
|
757
791
|
},
|
|
758
792
|
get classes() {
|
|
759
|
-
return t.themes.map((
|
|
793
|
+
return t.themes.map((n) => `${t.prefix}${n}`);
|
|
760
794
|
},
|
|
761
795
|
get themes() {
|
|
762
796
|
return t.themes;
|
|
763
797
|
},
|
|
764
798
|
// Setup the theme get and set methods
|
|
765
799
|
get theme() {
|
|
766
|
-
return
|
|
800
|
+
return o.get("theme") || t.fallback;
|
|
767
801
|
},
|
|
768
|
-
set theme(
|
|
769
|
-
t.themes.includes(
|
|
802
|
+
set theme(n) {
|
|
803
|
+
t.themes.includes(n) ? this.theme != n && (o.set("theme", n), document.documentElement.classList.remove(...this.classes), document.documentElement.classList.add(`${t.prefix}${n}`), e("onChange")) : console.error(`Not a valid theme value: "${n}"`);
|
|
770
804
|
}
|
|
771
805
|
};
|
|
772
|
-
return
|
|
806
|
+
return e("onInit"), r2;
|
|
773
807
|
}
|
|
774
808
|
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
775
809
|
__proto__: null,
|
|
776
|
-
Collection:
|
|
777
|
-
CollectionEntry: z$
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
810
|
+
Collection: st$1,
|
|
811
|
+
CollectionEntry: z$1,
|
|
812
|
+
ConfigManager: I$3,
|
|
813
|
+
EventEmitter: L$2,
|
|
814
|
+
FocusTrap: D$2,
|
|
815
|
+
FocusableArray: U$1,
|
|
816
|
+
PluginArray: H,
|
|
817
|
+
StackArray: _,
|
|
818
|
+
attrConfig: X$1,
|
|
819
|
+
cssConfig: Y$1,
|
|
820
|
+
cssVar: S$3,
|
|
821
|
+
debug: tt$1,
|
|
822
|
+
dispatchLifecycleHook: d$1,
|
|
823
|
+
focusTrap: et$1,
|
|
787
824
|
focusableSelectors: C$2,
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
getElement:
|
|
825
|
+
getAttrData: x$2,
|
|
826
|
+
getCustomProps: b$2,
|
|
827
|
+
getElement: v$2,
|
|
791
828
|
getPrefix: y$2,
|
|
792
|
-
|
|
829
|
+
getValue: h$2,
|
|
793
830
|
localStore: w$2,
|
|
794
|
-
maybeRunMethod: g$
|
|
795
|
-
mediaQuery:
|
|
796
|
-
propStore:
|
|
797
|
-
setGlobalState:
|
|
798
|
-
teleport:
|
|
799
|
-
teleportElement:
|
|
800
|
-
themeStore:
|
|
801
|
-
toCamel:
|
|
802
|
-
toKebab:
|
|
803
|
-
toMilliseconds:
|
|
804
|
-
transition:
|
|
831
|
+
maybeRunMethod: g$2,
|
|
832
|
+
mediaQuery: ot$1,
|
|
833
|
+
propStore: nt$1,
|
|
834
|
+
setGlobalState: Z,
|
|
835
|
+
teleport: it$1,
|
|
836
|
+
teleportElement: k$3,
|
|
837
|
+
themeStore: rt$1,
|
|
838
|
+
toCamel: R$1,
|
|
839
|
+
toKebab: M$2,
|
|
840
|
+
toMilliseconds: A$3,
|
|
841
|
+
transition: W$1
|
|
805
842
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
806
|
-
function
|
|
807
|
-
const s = (t.getAttribute(`data-${e}`) || "").replace(/'/g, '"');
|
|
808
|
-
return s ? JSON.parse(s) : {};
|
|
809
|
-
}
|
|
810
|
-
function f$1(t) {
|
|
843
|
+
function p$1(t) {
|
|
811
844
|
if (typeof t == "string") {
|
|
812
845
|
const e = document.getElementById(t);
|
|
813
846
|
if (e) return e;
|
|
@@ -822,15 +855,7 @@ function f$1(t) {
|
|
|
822
855
|
async function r$1(t, e, ...s) {
|
|
823
856
|
e in t && typeof t[e] == "function" && await t[e](...s);
|
|
824
857
|
}
|
|
825
|
-
function
|
|
826
|
-
return t.split("-").map(
|
|
827
|
-
(e, s) => s === 0 ? e : e.charAt(0).toUpperCase() + e.slice(1)
|
|
828
|
-
).join("");
|
|
829
|
-
}
|
|
830
|
-
function p$1(t) {
|
|
831
|
-
return t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
832
|
-
}
|
|
833
|
-
function C$1(t) {
|
|
858
|
+
function w$1(t) {
|
|
834
859
|
if (typeof t == "number")
|
|
835
860
|
return t;
|
|
836
861
|
const e = parseFloat(t);
|
|
@@ -840,96 +865,127 @@ function C$1(t) {
|
|
|
840
865
|
}
|
|
841
866
|
throw new Error(`Could not convert value to milliseconds: ${t}`);
|
|
842
867
|
}
|
|
843
|
-
function
|
|
844
|
-
return new Promise((
|
|
868
|
+
function f(t, e, s, i, o = 0) {
|
|
869
|
+
return new Promise((n) => {
|
|
845
870
|
t.classList.remove(e), t.classList.add(s), setTimeout(() => {
|
|
846
|
-
t.classList.add(i), t.classList.remove(s),
|
|
847
|
-
},
|
|
871
|
+
t.classList.add(i), t.classList.remove(s), n(t);
|
|
872
|
+
}, w$1(o));
|
|
848
873
|
});
|
|
849
874
|
}
|
|
875
|
+
function v$1(t, e = {}) {
|
|
876
|
+
const s = {
|
|
877
|
+
fallback: null,
|
|
878
|
+
element: document.body,
|
|
879
|
+
...e
|
|
880
|
+
};
|
|
881
|
+
if (!t.startsWith("--")) {
|
|
882
|
+
const o = E$1();
|
|
883
|
+
o && (t = `${o}${t}`), t = `--${t}`;
|
|
884
|
+
}
|
|
885
|
+
const i = getComputedStyle(s.element).getPropertyValue(t).trim();
|
|
886
|
+
if (i)
|
|
887
|
+
return i;
|
|
888
|
+
if (s.fallback)
|
|
889
|
+
return s.fallback;
|
|
890
|
+
throw new Error(`CSS variable "${t}" was not found!`);
|
|
891
|
+
}
|
|
850
892
|
async function a$1(t, e, s) {
|
|
851
893
|
await r$1(e, t, s), s && await r$1(s, t);
|
|
852
894
|
for (const i of e.plugins)
|
|
853
|
-
await r$1(i, t, {
|
|
854
|
-
await e.emit(t, s);
|
|
895
|
+
await r$1(i, t, { parent: e, entry: s });
|
|
896
|
+
await e.emit(t, { parent: e, entry: s });
|
|
855
897
|
}
|
|
856
|
-
function
|
|
857
|
-
const e = getComputedStyle(t.el), s = {}, i = t.getSetting("customProps");
|
|
858
|
-
for (let n = 0; n < i.length; n++) {
|
|
859
|
-
const o = L$1(), l = t.parent.module.toLowerCase(), h2 = p$1(i[n]), u2 = e.getPropertyValue(`--${o}${l}-${h2}`).trim();
|
|
860
|
-
u2 && (s[h2] = u2);
|
|
861
|
-
}
|
|
862
|
-
return s;
|
|
863
|
-
}
|
|
864
|
-
function L$1() {
|
|
898
|
+
function E$1() {
|
|
865
899
|
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
866
900
|
}
|
|
867
|
-
function
|
|
868
|
-
return e = s === "camel" ? b$1(e) : p$1(e), t.split(".").concat(e).reduce((i, n) => i?.[n], this);
|
|
869
|
-
}
|
|
870
|
-
function M$1(t, e = {}) {
|
|
871
|
-
const {
|
|
872
|
-
fallback: s,
|
|
873
|
-
props: i = ["dataConfig", "customProps", "settings", "parent.settings"]
|
|
874
|
-
} = e;
|
|
875
|
-
for (const n of i) {
|
|
876
|
-
const o = n !== "customProps" ? "camel" : "kebab", l = $$1.call(this, n, t, o);
|
|
877
|
-
if (l !== void 0)
|
|
878
|
-
return l;
|
|
879
|
-
}
|
|
880
|
-
if (s !== void 0)
|
|
881
|
-
return s;
|
|
882
|
-
throw new Error(`${this.parent.module} setting does not exist: ${t}`);
|
|
883
|
-
}
|
|
884
|
-
function P$2(t, e) {
|
|
901
|
+
function b$1(t, e) {
|
|
885
902
|
e && document.querySelectorAll(e).forEach((s) => {
|
|
886
903
|
t ? s.style.overflow = "hidden" : s.style.removeProperty("overflow");
|
|
887
904
|
});
|
|
888
905
|
}
|
|
889
|
-
function
|
|
906
|
+
function C$1(t, e) {
|
|
890
907
|
e && document.querySelectorAll(e).forEach((s) => {
|
|
891
908
|
s.inert = t;
|
|
892
909
|
});
|
|
893
910
|
}
|
|
894
911
|
function c$1(t, e, s) {
|
|
895
|
-
|
|
912
|
+
C$1(!!t, e), b$1(!!t, s);
|
|
896
913
|
}
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
914
|
+
let S$2 = class S {
|
|
915
|
+
#t;
|
|
916
|
+
#e;
|
|
917
|
+
constructor() {
|
|
918
|
+
this.#t = {}, this.#e = [];
|
|
919
|
+
}
|
|
920
|
+
get(e, s) {
|
|
921
|
+
const { fallback: i, source: o } = s ?? {};
|
|
922
|
+
if (o) {
|
|
923
|
+
const n = this.#t?.[o]?.[e];
|
|
924
|
+
if (n !== void 0)
|
|
925
|
+
return n;
|
|
926
|
+
} else
|
|
927
|
+
for (const n of this.#e) {
|
|
928
|
+
const d2 = this.#t?.[n]?.[e];
|
|
929
|
+
if (d2 !== void 0)
|
|
930
|
+
return d2;
|
|
931
|
+
}
|
|
932
|
+
if (i !== void 0)
|
|
933
|
+
return i;
|
|
934
|
+
throw new Error(`Config does not exist: ${e}`);
|
|
935
|
+
}
|
|
936
|
+
set(e, s = {}) {
|
|
937
|
+
let i, o;
|
|
938
|
+
return typeof e == "string" ? (i = e, o = s) : (i = "entry", o = e), this.#t[i] ? Object.assign(this.#t[i], o) : (this.#e.unshift(i), this.#t[i] = o), this.#t[i];
|
|
939
|
+
}
|
|
940
|
+
remove(e) {
|
|
941
|
+
const s = this.#e.indexOf(e);
|
|
942
|
+
s !== -1 && this.#e.splice(s, 1), delete this.#t[e];
|
|
943
|
+
}
|
|
944
|
+
setSourceOrder(e) {
|
|
945
|
+
const s = Object.keys(this.#t).reverse(), i = e.filter((o) => s.includes(o));
|
|
946
|
+
for (const o of s)
|
|
947
|
+
i.includes(o) || i.push(o);
|
|
948
|
+
return this.#e = i;
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
let O$1 = class O {
|
|
952
|
+
constructor() {
|
|
953
|
+
this.events = {};
|
|
954
|
+
}
|
|
955
|
+
on(e, s, ...i) {
|
|
956
|
+
this.events[e] || (this.events[e] = []), this.events[e].some(
|
|
957
|
+
(o) => o.listener === s
|
|
958
|
+
) || this.events[e].push({ listener: s, args: i });
|
|
959
|
+
}
|
|
960
|
+
off(e, s) {
|
|
961
|
+
this.events[e] && (this.events[e] = this.events[e].filter(
|
|
962
|
+
(i) => i.listener !== s
|
|
907
963
|
));
|
|
908
|
-
}
|
|
909
|
-
async emit(
|
|
910
|
-
if (
|
|
911
|
-
for (const { listener:
|
|
912
|
-
await s
|
|
964
|
+
}
|
|
965
|
+
async emit(e, ...s) {
|
|
966
|
+
if (e = e.startsWith("on") ? e.slice(2, 3).toLowerCase() + e.slice(3) : e, !!this.events[e])
|
|
967
|
+
for (const { listener: i, args: o } of this.events[e])
|
|
968
|
+
await i(...s, ...o);
|
|
913
969
|
}
|
|
914
970
|
};
|
|
915
|
-
let
|
|
971
|
+
let L$1 = class L2 extends Array {
|
|
916
972
|
constructor(e = {}) {
|
|
917
973
|
super(), this.presets = e;
|
|
918
974
|
}
|
|
919
|
-
|
|
920
|
-
const s =
|
|
921
|
-
e.
|
|
975
|
+
#t(e) {
|
|
976
|
+
const s = this.presets?.[e.name] || {}, i = e?.options || {};
|
|
977
|
+
e.config = { ...e.config, ...s, ...i };
|
|
922
978
|
}
|
|
923
|
-
|
|
979
|
+
#e(e) {
|
|
924
980
|
return !("name" in e) || typeof e.name != "string" ? (console.error("Plugin requires a name!"), false) : true;
|
|
925
981
|
}
|
|
926
982
|
get(e) {
|
|
927
|
-
return this.find((s) => s.name === e);
|
|
983
|
+
return this.find((s) => s.name === e) || null;
|
|
928
984
|
}
|
|
929
985
|
add(e) {
|
|
930
986
|
if (Array.isArray(e))
|
|
931
987
|
e.forEach((s) => this.add(s));
|
|
932
|
-
else if (this
|
|
988
|
+
else if (this.#t(e), this.#e(e)) {
|
|
933
989
|
const s = this.findIndex((i) => i.name === e.name);
|
|
934
990
|
~s ? this[s] = e : this.push(e);
|
|
935
991
|
}
|
|
@@ -939,45 +995,21 @@ let y$1 = class y extends Array {
|
|
|
939
995
|
~s && this.splice(s, 1);
|
|
940
996
|
}
|
|
941
997
|
};
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
};
|
|
946
|
-
let w$1 = class w {
|
|
947
|
-
constructor(e, s, i = {}) {
|
|
948
|
-
this.parent = e, this.el = f$1(s), this.settings = { ...i }, this.dataConfig = {}, this.customProps = {};
|
|
949
|
-
}
|
|
950
|
-
get id() {
|
|
951
|
-
return this.el.id;
|
|
952
|
-
}
|
|
953
|
-
applySettings(e) {
|
|
954
|
-
return Object.assign(this.settings, e);
|
|
955
|
-
}
|
|
956
|
-
getSetting(e, s) {
|
|
957
|
-
return M$1.call(this, e, s);
|
|
958
|
-
}
|
|
959
|
-
buildDataConfig() {
|
|
960
|
-
return Object.assign(
|
|
961
|
-
this.dataConfig,
|
|
962
|
-
E$2(this.el, this.getSetting("dataConfig"))
|
|
963
|
-
);
|
|
964
|
-
}
|
|
965
|
-
buildCustomProps() {
|
|
966
|
-
return Object.assign(this.customProps, O$1(this));
|
|
967
|
-
}
|
|
968
|
-
async init(e = {}) {
|
|
969
|
-
this.applySettings(e), this.buildDataConfig(), this.buildCustomProps();
|
|
970
|
-
}
|
|
971
|
-
async destroy() {
|
|
972
|
-
Object.getOwnPropertyNames(this).forEach((e) => {
|
|
973
|
-
delete this[e];
|
|
974
|
-
});
|
|
998
|
+
let g$1 = class g {
|
|
999
|
+
constructor(e, s) {
|
|
1000
|
+
this.config = new S$2(), this.parent = e, this.el = p$1(s), this.id = this.el.id, this.config.set("parent", this.parent.config), this.config.set("entry", {});
|
|
975
1001
|
}
|
|
976
1002
|
};
|
|
977
|
-
|
|
1003
|
+
const M$1 = {
|
|
1004
|
+
selector: "",
|
|
1005
|
+
plugins: [],
|
|
1006
|
+
presets: {}
|
|
1007
|
+
};
|
|
1008
|
+
let x$1 = class x {
|
|
978
1009
|
constructor(e = {}) {
|
|
979
|
-
this.
|
|
1010
|
+
this.#t = new O$1(), this.events = this.#t.events, this.on = this.#t.on.bind(this.#t), this.off = this.#t.off.bind(this.#t), this.emit = this.#t.emit.bind(this.#t), this.collection = [], this.entryClass = g$1, this.name = this.constructor.name, this.config = { ...M$1, ...e }, this.plugins = new L$1(this.config.presets);
|
|
980
1011
|
}
|
|
1012
|
+
#t;
|
|
981
1013
|
get(e, s = "id") {
|
|
982
1014
|
return this.collection.find((i) => i[s] === e);
|
|
983
1015
|
}
|
|
@@ -986,65 +1018,60 @@ let D$2 = class D {
|
|
|
986
1018
|
if (i)
|
|
987
1019
|
return i;
|
|
988
1020
|
throw new Error(
|
|
989
|
-
`${this.
|
|
1021
|
+
`${this.name} entry not found in collection with ${String(s)} of "${e}"`
|
|
990
1022
|
);
|
|
991
1023
|
}
|
|
992
|
-
|
|
993
|
-
return Object.assign(this.
|
|
1024
|
+
updateConfig(e = {}) {
|
|
1025
|
+
return Object.assign(this.config, e);
|
|
994
1026
|
}
|
|
995
|
-
async createEntry(e
|
|
996
|
-
const
|
|
997
|
-
return await r$1(
|
|
1027
|
+
async createEntry(e) {
|
|
1028
|
+
const s = new this.entryClass(this, e);
|
|
1029
|
+
return await r$1(s, "init"), await a$1("onCreateEntry", this, s), s;
|
|
998
1030
|
}
|
|
999
1031
|
async destroyEntry(e) {
|
|
1000
1032
|
return await a$1("onDestroyEntry", this, e), await r$1(e, "destroy"), e;
|
|
1001
1033
|
}
|
|
1002
|
-
async register(e
|
|
1003
|
-
const
|
|
1004
|
-
|
|
1005
|
-
const o = this.collection[n];
|
|
1006
|
-
return o.el = i, typeof o.init == "function" && await o.init(s), o;
|
|
1007
|
-
} else {
|
|
1008
|
-
const o = await this.createEntry(i, s);
|
|
1009
|
-
return this.collection.push(o), await a$1("onRegisterEntry", this, o), o;
|
|
1010
|
-
}
|
|
1034
|
+
async register(e) {
|
|
1035
|
+
const s = this.collection.findIndex((i) => i.id === e.id);
|
|
1036
|
+
return ~s ? this.collection[s] = e : this.collection.push(e), await a$1("onRegisterEntry", this, e), e;
|
|
1011
1037
|
}
|
|
1012
1038
|
async deregister(e) {
|
|
1013
|
-
const s = this.collection.findIndex((i) => i.id === e);
|
|
1039
|
+
const s = this.collection.findIndex((i) => i.id === e.id);
|
|
1014
1040
|
if (~s) {
|
|
1015
|
-
|
|
1016
|
-
return await a$1(
|
|
1041
|
+
await a$1(
|
|
1017
1042
|
"onDeregisterEntry",
|
|
1018
1043
|
this,
|
|
1019
1044
|
this.collection[s]
|
|
1020
|
-
)
|
|
1045
|
+
);
|
|
1046
|
+
const [i] = this.collection.splice(s, 1);
|
|
1021
1047
|
}
|
|
1022
|
-
return
|
|
1048
|
+
return e;
|
|
1023
1049
|
}
|
|
1024
|
-
async mount(e =
|
|
1025
|
-
this.
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1050
|
+
async mount(e = (s) => s) {
|
|
1051
|
+
for (const s of this.config?.plugins || [])
|
|
1052
|
+
this.plugins.add(s);
|
|
1053
|
+
for (const s of this.plugins)
|
|
1054
|
+
await r$1(s, "setup", this);
|
|
1055
|
+
if (await a$1("beforeMount", this), this.config.selector) {
|
|
1056
|
+
const s = document.querySelectorAll(this.config.selector);
|
|
1057
|
+
for (const i of s)
|
|
1058
|
+
await this.createEntry(i).then((o) => e(o)).then((o) => this.register(o));
|
|
1059
|
+
}
|
|
1034
1060
|
return await a$1("afterMount", this), this;
|
|
1035
1061
|
}
|
|
1036
|
-
async unmount() {
|
|
1062
|
+
async unmount(e = (s) => s) {
|
|
1037
1063
|
for (await a$1("beforeUnmount", this); this.collection.length > 0; )
|
|
1038
|
-
await this.
|
|
1064
|
+
await this.destroyEntry(this.collection[0]).then((s) => e(s)).then((s) => this.deregister(s));
|
|
1039
1065
|
await a$1("afterUnmount", this);
|
|
1040
|
-
for (const
|
|
1041
|
-
await r$1(
|
|
1042
|
-
for (const
|
|
1043
|
-
this.plugins.remove(
|
|
1066
|
+
for (const s of this.plugins)
|
|
1067
|
+
await r$1(s, "teardown", this);
|
|
1068
|
+
for (const s of [...this.plugins])
|
|
1069
|
+
this.plugins.remove(s.name);
|
|
1044
1070
|
return this;
|
|
1045
1071
|
}
|
|
1046
1072
|
};
|
|
1047
|
-
|
|
1073
|
+
v$1("theme-prefix", { fallback: "vb-theme-" });
|
|
1074
|
+
const T$1 = {
|
|
1048
1075
|
focusTrap: {
|
|
1049
1076
|
condition: ({ entry: t }) => t.state === "closed" || t.state === "opened" && t.mode === "modal"
|
|
1050
1077
|
},
|
|
@@ -1059,11 +1086,11 @@ const I$2 = {
|
|
|
1059
1086
|
condition: ({ entry: t }) => ["opened", "closed", "indeterminate"].includes(t.state),
|
|
1060
1087
|
onChange: ({ entry: t }) => t.applyState()
|
|
1061
1088
|
}
|
|
1062
|
-
},
|
|
1063
|
-
presets:
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1089
|
+
}, $$1 = {
|
|
1090
|
+
presets: T$1,
|
|
1091
|
+
attrOpen: "drawer-open",
|
|
1092
|
+
attrClose: "drawer-close",
|
|
1093
|
+
attrToggle: "drawer-toggle",
|
|
1067
1094
|
selector: ".drawer",
|
|
1068
1095
|
selectorDialog: ".drawer__dialog",
|
|
1069
1096
|
selectorScreen: ".drawer",
|
|
@@ -1082,93 +1109,93 @@ const I$2 = {
|
|
|
1082
1109
|
transition: true,
|
|
1083
1110
|
transitionDuration: 300
|
|
1084
1111
|
};
|
|
1085
|
-
function
|
|
1112
|
+
function k$2(t) {
|
|
1086
1113
|
switch (t.mode) {
|
|
1087
1114
|
case "inline":
|
|
1088
|
-
return
|
|
1115
|
+
return D$1(t);
|
|
1089
1116
|
case "modal":
|
|
1090
|
-
return
|
|
1117
|
+
return I$2(t);
|
|
1091
1118
|
default:
|
|
1092
1119
|
throw new Error(`"${t.mode}" is not a valid drawer mode.`);
|
|
1093
1120
|
}
|
|
1094
1121
|
}
|
|
1095
|
-
async function
|
|
1096
|
-
return t.el.classList.remove(t.
|
|
1122
|
+
async function D$1(t) {
|
|
1123
|
+
return t.el.classList.remove(t.config.get("classModal")), t.dialog.removeAttribute("aria-modal"), c$1(
|
|
1097
1124
|
false,
|
|
1098
|
-
t.
|
|
1099
|
-
t.
|
|
1125
|
+
t.config.get("selectorInert"),
|
|
1126
|
+
t.config.get("selectorOverflow")
|
|
1100
1127
|
), t.applyState(), t.el.dispatchEvent(
|
|
1101
|
-
new CustomEvent(t.
|
|
1128
|
+
new CustomEvent(t.config.get("customEventPrefix") + "switchMode", {
|
|
1102
1129
|
detail: t.parent,
|
|
1103
1130
|
bubbles: true
|
|
1104
1131
|
})
|
|
1105
1132
|
), await t.parent.emit("switchMode", t), t;
|
|
1106
1133
|
}
|
|
1107
|
-
async function
|
|
1108
|
-
return t.el.classList.add(t.
|
|
1109
|
-
new CustomEvent(t.
|
|
1134
|
+
async function I$2(t) {
|
|
1135
|
+
return t.el.classList.add(t.config.get("classModal")), t.dialog.setAttribute("aria-modal", "true"), await t.close(false, false), t.el.dispatchEvent(
|
|
1136
|
+
new CustomEvent(t.config.get("customEventPrefix") + "switchMode", {
|
|
1110
1137
|
detail: t.parent,
|
|
1111
1138
|
bubbles: true
|
|
1112
1139
|
})
|
|
1113
1140
|
), await t.parent.emit("switchMode", t), t;
|
|
1114
1141
|
}
|
|
1115
|
-
function
|
|
1116
|
-
t.dialog && t.state === "opened" ? (t.dialog.querySelector(t.
|
|
1142
|
+
function u$1(t) {
|
|
1143
|
+
t.dialog && t.state === "opened" ? (t.dialog.querySelector(t.config.get("selectorFocus")) || t.dialog).focus() : t.trigger && (t.trigger.focus(), t.trigger = null);
|
|
1117
1144
|
}
|
|
1118
|
-
async function
|
|
1119
|
-
return (t.state === "closed" || t.state === "indeterminate" || t.state === null) && (t.setState("opening"), e ?? t.
|
|
1145
|
+
async function l$1(t, e, s = true) {
|
|
1146
|
+
return (t.state === "closed" || t.state === "indeterminate" || t.state === null) && (t.setState("opening"), e ?? t.config.get("transition") ? await f(
|
|
1120
1147
|
t.el,
|
|
1121
|
-
t.
|
|
1122
|
-
t.
|
|
1123
|
-
t.
|
|
1124
|
-
t.
|
|
1125
|
-
) : (t.el.classList.add(t.
|
|
1148
|
+
t.config.get("stateClosed"),
|
|
1149
|
+
t.config.get("stateOpening"),
|
|
1150
|
+
t.config.get("stateOpened"),
|
|
1151
|
+
t.config.get("transitionDuration")
|
|
1152
|
+
) : (t.el.classList.add(t.config.get("stateOpened")), t.el.classList.remove(t.config.get("stateClosed"))), t.setState("opened"), t.mode === "modal" && c$1(
|
|
1126
1153
|
true,
|
|
1127
|
-
t.
|
|
1128
|
-
t.
|
|
1129
|
-
), s &&
|
|
1130
|
-
new CustomEvent(t.
|
|
1154
|
+
t.config.get("selectorInert"),
|
|
1155
|
+
t.config.get("selectorOverflow")
|
|
1156
|
+
), s && u$1(t), t.el.dispatchEvent(
|
|
1157
|
+
new CustomEvent(t.config.get("customEventPrefix") + "opened", {
|
|
1131
1158
|
detail: t.parent,
|
|
1132
1159
|
bubbles: true
|
|
1133
1160
|
})
|
|
1134
1161
|
), await t.parent.emit("opened", t)), t;
|
|
1135
1162
|
}
|
|
1136
|
-
async function
|
|
1137
|
-
return (t.state === "opened" || t.state === "indeterminate" || t.state === null) && (t.setState("closing"), document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), e ?? t.
|
|
1163
|
+
async function h$1(t, e, s = true) {
|
|
1164
|
+
return (t.state === "opened" || t.state === "indeterminate" || t.state === null) && (t.setState("closing"), document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), e ?? t.config.get("transition") ? await f(
|
|
1138
1165
|
t.el,
|
|
1139
|
-
t.
|
|
1140
|
-
t.
|
|
1141
|
-
t.
|
|
1142
|
-
t.
|
|
1143
|
-
) : (t.el.classList.add(t.
|
|
1166
|
+
t.config.get("stateOpened"),
|
|
1167
|
+
t.config.get("stateClosing"),
|
|
1168
|
+
t.config.get("stateClosed"),
|
|
1169
|
+
t.config.get("transitionDuration")
|
|
1170
|
+
) : (t.el.classList.add(t.config.get("stateClosed")), t.el.classList.remove(t.config.get("stateOpened"))), t.setState("closed"), t.mode === "modal" && c$1(
|
|
1144
1171
|
false,
|
|
1145
|
-
t.
|
|
1146
|
-
t.
|
|
1147
|
-
), s &&
|
|
1148
|
-
new CustomEvent(t.
|
|
1172
|
+
t.config.get("selectorInert"),
|
|
1173
|
+
t.config.get("selectorOverflow")
|
|
1174
|
+
), s && u$1(t), t.el.dispatchEvent(
|
|
1175
|
+
new CustomEvent(t.config.get("customEventPrefix") + "closed", {
|
|
1149
1176
|
detail: t.parent,
|
|
1150
1177
|
bubbles: true
|
|
1151
1178
|
})
|
|
1152
1179
|
), await t.parent.emit("closed", t)), t;
|
|
1153
1180
|
}
|
|
1154
|
-
async function
|
|
1155
|
-
return t.state === "closed" ?
|
|
1181
|
+
async function m$1(t, e, s) {
|
|
1182
|
+
return t.state === "closed" ? l$1(t, e, s) : h$1(t, e, s);
|
|
1156
1183
|
}
|
|
1157
|
-
class
|
|
1184
|
+
let A$2 = class A extends g$1 {
|
|
1158
1185
|
#t;
|
|
1159
|
-
constructor(e, s
|
|
1160
|
-
super(e, s
|
|
1186
|
+
constructor(e, s) {
|
|
1187
|
+
super(e, s), this.#t = "indeterminate", this.dialog = this.el.querySelector(this.config.get("selectorDialog")) || this.el, this.trigger = null, this.state = null, this.inlineState = null;
|
|
1161
1188
|
}
|
|
1162
1189
|
get mode() {
|
|
1163
1190
|
return this.#t;
|
|
1164
1191
|
}
|
|
1165
1192
|
set mode(e) {
|
|
1166
|
-
this.#t !== e && (this.#t = e,
|
|
1193
|
+
this.#t !== e && (this.#t = e, k$2(this));
|
|
1167
1194
|
}
|
|
1168
1195
|
setState(e) {
|
|
1169
1196
|
this.state = e;
|
|
1170
1197
|
const s = ["opening", "closing"];
|
|
1171
|
-
this.mode === "inline" && !s.includes(e) && (this.inlineState = e), e === "indeterminate" && (this.el.classList.remove(this.
|
|
1198
|
+
this.mode === "inline" && !s.includes(e) && (this.inlineState = e), e === "indeterminate" && (this.el.classList.remove(this.config.get("stateOpened")), this.el.classList.remove(this.config.get("stateOpening")), this.el.classList.remove(this.config.get("stateClosed")), this.el.classList.remove(this.config.get("stateClosing")));
|
|
1172
1199
|
}
|
|
1173
1200
|
async applyState() {
|
|
1174
1201
|
if (this.mode === "modal") return this;
|
|
@@ -1177,86 +1204,86 @@ class N extends w$1 {
|
|
|
1177
1204
|
if (this.inlineState === "closed")
|
|
1178
1205
|
return await this.close(false, false);
|
|
1179
1206
|
if (this.state === null) {
|
|
1180
|
-
if (this.el.classList.contains(this.
|
|
1207
|
+
if (this.el.classList.contains(this.config.get("stateOpened")))
|
|
1181
1208
|
return await this.open(false, false);
|
|
1182
|
-
if (this.el.classList.contains(this.
|
|
1209
|
+
if (this.el.classList.contains(this.config.get("stateClosed")))
|
|
1183
1210
|
return await this.close(false, false);
|
|
1184
1211
|
}
|
|
1185
1212
|
return this.setState("indeterminate"), this;
|
|
1186
1213
|
}
|
|
1187
1214
|
async open(e, s) {
|
|
1188
|
-
return
|
|
1215
|
+
return l$1(this, e, s);
|
|
1189
1216
|
}
|
|
1190
1217
|
async close(e, s) {
|
|
1191
|
-
return
|
|
1218
|
+
return h$1(this, e, s);
|
|
1192
1219
|
}
|
|
1193
1220
|
async toggle(e, s) {
|
|
1194
|
-
return
|
|
1221
|
+
return m$1(this, e, s);
|
|
1195
1222
|
}
|
|
1196
1223
|
async deregister() {
|
|
1197
|
-
return this.parent.deregister(this
|
|
1224
|
+
return this.parent.deregister(this);
|
|
1198
1225
|
}
|
|
1199
1226
|
async onCreateEntry() {
|
|
1200
|
-
this.
|
|
1227
|
+
this.config.get("setTabindex") && this.dialog && this.dialog.setAttribute("tabindex", "-1"), await this.applyState(), this.inlineState = this.state, this.mode = this.el && this.el.classList.contains(this.config.get("classModal")) ? "modal" : "inline";
|
|
1201
1228
|
}
|
|
1202
1229
|
async onDestroyEntry() {
|
|
1203
1230
|
this.mode === "modal" && this.state === "opened" && await this.close(false);
|
|
1204
1231
|
}
|
|
1205
|
-
}
|
|
1206
|
-
async function
|
|
1232
|
+
};
|
|
1233
|
+
async function P$2(t) {
|
|
1207
1234
|
const e = t.target;
|
|
1208
1235
|
if (e) {
|
|
1209
1236
|
const s = e.closest(`
|
|
1210
|
-
[data-${this.
|
|
1211
|
-
[data-${this.
|
|
1212
|
-
[data-${this.
|
|
1237
|
+
[data-${this.config.attrOpen}],
|
|
1238
|
+
[data-${this.config.attrToggle}],
|
|
1239
|
+
[data-${this.config.attrClose}]
|
|
1213
1240
|
`);
|
|
1214
1241
|
if (s) {
|
|
1215
|
-
t.preventDefault(), s.matches(`[data-${this.
|
|
1216
|
-
const
|
|
1217
|
-
return
|
|
1218
|
-
}), s.matches(`[data-${this.
|
|
1219
|
-
const
|
|
1220
|
-
return
|
|
1221
|
-
}), s.matches(`[data-${this.
|
|
1222
|
-
if (
|
|
1223
|
-
const
|
|
1224
|
-
return
|
|
1242
|
+
t.preventDefault(), s.matches(`[data-${this.config.attrToggle}]`) && s.getAttribute(`data-${this.config.attrToggle}`)?.trim().split(" ")?.forEach((o) => {
|
|
1243
|
+
const n = this.getOrThrow(o);
|
|
1244
|
+
return n.trigger = s, n.toggle();
|
|
1245
|
+
}), s.matches(`[data-${this.config.attrOpen}]`) && s.getAttribute(`data-${this.config.attrOpen}`)?.trim().split(" ")?.forEach((o) => {
|
|
1246
|
+
const n = this.getOrThrow(o);
|
|
1247
|
+
return n.trigger = s, n.open();
|
|
1248
|
+
}), s.matches(`[data-${this.config.attrClose}]`) && s.getAttribute(`data-${this.config.attrClose}`)?.trim().split(" ")?.forEach((o) => {
|
|
1249
|
+
if (o) {
|
|
1250
|
+
const n = this.getOrThrow(o);
|
|
1251
|
+
return n.trigger = s, n.close();
|
|
1225
1252
|
} else {
|
|
1226
|
-
const
|
|
1227
|
-
if (
|
|
1253
|
+
const n = e.closest(this.config.selector);
|
|
1254
|
+
if (n) return this.close(n.id);
|
|
1228
1255
|
}
|
|
1229
1256
|
});
|
|
1230
1257
|
return;
|
|
1231
1258
|
}
|
|
1232
|
-
if (this.activeModal && e.matches(this.
|
|
1259
|
+
if (this.activeModal && e.matches(this.config.selectorScreen))
|
|
1233
1260
|
return this.close(this.activeModal.id);
|
|
1234
1261
|
}
|
|
1235
1262
|
}
|
|
1236
|
-
function
|
|
1263
|
+
function y$1(t) {
|
|
1237
1264
|
if (t.key === "Escape" && this.activeModal)
|
|
1238
1265
|
return this.close(this.activeModal.id);
|
|
1239
1266
|
}
|
|
1240
|
-
class
|
|
1241
|
-
#t;
|
|
1242
|
-
#e;
|
|
1267
|
+
let q$1 = class q extends x$1 {
|
|
1243
1268
|
constructor(e) {
|
|
1244
|
-
super({
|
|
1269
|
+
super({ ...$$1, ...e }), this.entryClass = A$2, this.name = "Drawer", this.#t = P$2.bind(this), this.#e = y$1.bind(this);
|
|
1245
1270
|
}
|
|
1271
|
+
#t;
|
|
1272
|
+
#e;
|
|
1246
1273
|
get activeModal() {
|
|
1247
1274
|
return this.collection.find((e) => e.state === "opened" && e.mode === "modal");
|
|
1248
1275
|
}
|
|
1249
1276
|
async open(e, s, i) {
|
|
1250
|
-
const
|
|
1251
|
-
return
|
|
1277
|
+
const o = this.getOrThrow(e);
|
|
1278
|
+
return l$1(o, s, i);
|
|
1252
1279
|
}
|
|
1253
1280
|
async close(e, s, i) {
|
|
1254
|
-
const
|
|
1255
|
-
return
|
|
1281
|
+
const o = this.getOrThrow(e);
|
|
1282
|
+
return h$1(o, s, i);
|
|
1256
1283
|
}
|
|
1257
1284
|
async toggle(e, s, i) {
|
|
1258
|
-
const
|
|
1259
|
-
return
|
|
1285
|
+
const o = this.getOrThrow(e);
|
|
1286
|
+
return m$1(o, s, i);
|
|
1260
1287
|
}
|
|
1261
1288
|
async afterMount() {
|
|
1262
1289
|
document.addEventListener("click", this.#t, false), document.addEventListener("keydown", this.#e, false);
|
|
@@ -1264,146 +1291,165 @@ class _ extends D$2 {
|
|
|
1264
1291
|
async afterUnmount() {
|
|
1265
1292
|
document.removeEventListener("click", this.#t, false), document.removeEventListener("keydown", this.#e, false);
|
|
1266
1293
|
}
|
|
1267
|
-
}
|
|
1268
|
-
function
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
}
|
|
1272
|
-
function f(e) {
|
|
1273
|
-
if (typeof e == "string") {
|
|
1274
|
-
const t = document.getElementById(e);
|
|
1294
|
+
};
|
|
1295
|
+
function p(s) {
|
|
1296
|
+
if (typeof s == "string") {
|
|
1297
|
+
const t = document.getElementById(s);
|
|
1275
1298
|
if (t) return t;
|
|
1276
|
-
throw new Error(`Element not found with ID: "${
|
|
1277
|
-
} else if (
|
|
1278
|
-
if (!
|
|
1299
|
+
throw new Error(`Element not found with ID: "${s}"`);
|
|
1300
|
+
} else if (s instanceof HTMLElement) {
|
|
1301
|
+
if (!s.id)
|
|
1279
1302
|
throw new Error("HTMLElement must have an ID");
|
|
1280
|
-
return
|
|
1303
|
+
return s;
|
|
1281
1304
|
} else
|
|
1282
1305
|
throw new Error("Invalid argument: query must be a string or HTMLElement");
|
|
1283
1306
|
}
|
|
1284
|
-
async function
|
|
1285
|
-
t in
|
|
1286
|
-
}
|
|
1287
|
-
function C(e) {
|
|
1288
|
-
return e.split("-").map(
|
|
1289
|
-
(t, s) => s === 0 ? t : t.charAt(0).toUpperCase() + t.slice(1)
|
|
1290
|
-
).join("");
|
|
1291
|
-
}
|
|
1292
|
-
function p(e) {
|
|
1293
|
-
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1307
|
+
async function a(s, t, ...e) {
|
|
1308
|
+
t in s && typeof s[t] == "function" && await s[t](...e);
|
|
1294
1309
|
}
|
|
1295
|
-
function
|
|
1296
|
-
if (typeof
|
|
1297
|
-
return
|
|
1298
|
-
const t = parseFloat(
|
|
1310
|
+
function m(s) {
|
|
1311
|
+
if (typeof s == "number")
|
|
1312
|
+
return s;
|
|
1313
|
+
const t = parseFloat(s);
|
|
1299
1314
|
if (!Number.isNaN(t)) {
|
|
1300
|
-
const
|
|
1301
|
-
return t * (
|
|
1315
|
+
const e = s.includes("ms");
|
|
1316
|
+
return t * (e ? 1 : 1e3);
|
|
1302
1317
|
}
|
|
1303
|
-
throw new Error(`Could not convert value to milliseconds: ${
|
|
1318
|
+
throw new Error(`Could not convert value to milliseconds: ${s}`);
|
|
1304
1319
|
}
|
|
1305
|
-
function
|
|
1320
|
+
function u(s, t, e, i, n = 0) {
|
|
1306
1321
|
return new Promise((o) => {
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
},
|
|
1322
|
+
s.classList.remove(t), s.classList.add(e), setTimeout(() => {
|
|
1323
|
+
s.classList.add(i), s.classList.remove(e), o(s);
|
|
1324
|
+
}, m(n));
|
|
1310
1325
|
});
|
|
1311
1326
|
}
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
}
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
const o = b(), l = e.parent.module.toLowerCase(), u2 = p(i[n]), g2 = t.getPropertyValue(`--${o}${l}-${u2}`).trim();
|
|
1322
|
-
g2 && (s[u2] = g2);
|
|
1327
|
+
function w(s, t = {}) {
|
|
1328
|
+
const e = {
|
|
1329
|
+
fallback: null,
|
|
1330
|
+
element: document.body,
|
|
1331
|
+
...t
|
|
1332
|
+
};
|
|
1333
|
+
if (!s.startsWith("--")) {
|
|
1334
|
+
const n = v();
|
|
1335
|
+
n && (s = `${n}${s}`), s = `--${s}`;
|
|
1323
1336
|
}
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1337
|
+
const i = getComputedStyle(e.element).getPropertyValue(s).trim();
|
|
1338
|
+
if (i)
|
|
1339
|
+
return i;
|
|
1340
|
+
if (e.fallback)
|
|
1341
|
+
return e.fallback;
|
|
1342
|
+
throw new Error(`CSS variable "${s}" was not found!`);
|
|
1328
1343
|
}
|
|
1329
|
-
function
|
|
1330
|
-
|
|
1344
|
+
async function r(s, t, e) {
|
|
1345
|
+
await a(t, s, e), e && await a(e, s);
|
|
1346
|
+
for (const i of t.plugins)
|
|
1347
|
+
await a(i, s, { parent: t, entry: e });
|
|
1348
|
+
await t.emit(s, { parent: t, entry: e });
|
|
1331
1349
|
}
|
|
1332
|
-
function
|
|
1333
|
-
|
|
1334
|
-
fallback: s,
|
|
1335
|
-
props: i = ["dataConfig", "customProps", "settings", "parent.settings"]
|
|
1336
|
-
} = t;
|
|
1337
|
-
for (const n of i) {
|
|
1338
|
-
const o = n !== "customProps" ? "camel" : "kebab", l = O2.call(this, n, e, o);
|
|
1339
|
-
if (l !== void 0)
|
|
1340
|
-
return l;
|
|
1341
|
-
}
|
|
1342
|
-
if (s !== void 0)
|
|
1343
|
-
return s;
|
|
1344
|
-
throw new Error(`${this.parent.module} setting does not exist: ${e}`);
|
|
1350
|
+
function v() {
|
|
1351
|
+
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
1345
1352
|
}
|
|
1346
|
-
function
|
|
1347
|
-
t && document.querySelectorAll(t).forEach((
|
|
1348
|
-
|
|
1353
|
+
function y(s, t) {
|
|
1354
|
+
t && document.querySelectorAll(t).forEach((e) => {
|
|
1355
|
+
s ? e.style.overflow = "hidden" : e.style.removeProperty("overflow");
|
|
1349
1356
|
});
|
|
1350
1357
|
}
|
|
1351
|
-
function
|
|
1352
|
-
t && document.querySelectorAll(t).forEach((
|
|
1353
|
-
|
|
1358
|
+
function E(s, t) {
|
|
1359
|
+
t && document.querySelectorAll(t).forEach((e) => {
|
|
1360
|
+
e.inert = s;
|
|
1354
1361
|
});
|
|
1355
1362
|
}
|
|
1356
|
-
function
|
|
1357
|
-
|
|
1363
|
+
function b(s, t, e) {
|
|
1364
|
+
E(!!s, t), y(!!s, e);
|
|
1358
1365
|
}
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1366
|
+
class C {
|
|
1367
|
+
#t;
|
|
1368
|
+
#e;
|
|
1369
|
+
constructor() {
|
|
1370
|
+
this.#t = {}, this.#e = [];
|
|
1371
|
+
}
|
|
1372
|
+
get(t, e) {
|
|
1373
|
+
const { fallback: i, source: n } = e ?? {};
|
|
1374
|
+
if (n) {
|
|
1375
|
+
const o = this.#t?.[n]?.[t];
|
|
1376
|
+
if (o !== void 0)
|
|
1377
|
+
return o;
|
|
1378
|
+
} else
|
|
1379
|
+
for (const o of this.#e) {
|
|
1380
|
+
const f2 = this.#t?.[o]?.[t];
|
|
1381
|
+
if (f2 !== void 0)
|
|
1382
|
+
return f2;
|
|
1383
|
+
}
|
|
1384
|
+
if (i !== void 0)
|
|
1385
|
+
return i;
|
|
1386
|
+
throw new Error(`Config does not exist: ${t}`);
|
|
1387
|
+
}
|
|
1388
|
+
set(t, e = {}) {
|
|
1389
|
+
let i, n;
|
|
1390
|
+
return typeof t == "string" ? (i = t, n = e) : (i = "entry", n = t), this.#t[i] ? Object.assign(this.#t[i], n) : (this.#e.unshift(i), this.#t[i] = n), this.#t[i];
|
|
1391
|
+
}
|
|
1392
|
+
remove(t) {
|
|
1393
|
+
const e = this.#e.indexOf(t);
|
|
1394
|
+
e !== -1 && this.#e.splice(e, 1), delete this.#t[t];
|
|
1395
|
+
}
|
|
1396
|
+
setSourceOrder(t) {
|
|
1397
|
+
const e = Object.keys(this.#t).reverse(), i = t.filter((n) => e.includes(n));
|
|
1398
|
+
for (const n of e)
|
|
1399
|
+
i.includes(n) || i.push(n);
|
|
1400
|
+
return this.#e = i;
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
class x2 {
|
|
1404
|
+
constructor() {
|
|
1405
|
+
this.events = {};
|
|
1406
|
+
}
|
|
1407
|
+
on(t, e, ...i) {
|
|
1408
|
+
this.events[t] || (this.events[t] = []), this.events[t].some(
|
|
1409
|
+
(n) => n.listener === e
|
|
1410
|
+
) || this.events[t].push({ listener: e, args: i });
|
|
1411
|
+
}
|
|
1412
|
+
off(t, e) {
|
|
1413
|
+
this.events[t] && (this.events[t] = this.events[t].filter(
|
|
1414
|
+
(i) => i.listener !== e
|
|
1369
1415
|
));
|
|
1370
|
-
},
|
|
1371
|
-
async emit(e, t) {
|
|
1372
|
-
if (e = e.startsWith("on") ? e.slice(2, 3).toLowerCase() + e.slice(3) : e, !!this.events[e])
|
|
1373
|
-
for (const { listener: s, args: i } of this.events[e])
|
|
1374
|
-
await s(t, ...i);
|
|
1375
1416
|
}
|
|
1376
|
-
|
|
1377
|
-
|
|
1417
|
+
async emit(t, ...e) {
|
|
1418
|
+
if (t = t.startsWith("on") ? t.slice(2, 3).toLowerCase() + t.slice(3) : t, !!this.events[t])
|
|
1419
|
+
for (const { listener: i, args: n } of this.events[t])
|
|
1420
|
+
await i(...e, ...n);
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
class O2 extends Array {
|
|
1378
1424
|
constructor(t = {}) {
|
|
1379
1425
|
super(), this.presets = t;
|
|
1380
1426
|
}
|
|
1381
|
-
|
|
1382
|
-
const
|
|
1383
|
-
t.
|
|
1427
|
+
#t(t) {
|
|
1428
|
+
const e = this.presets?.[t.name] || {}, i = t?.options || {};
|
|
1429
|
+
t.config = { ...t.config, ...e, ...i };
|
|
1384
1430
|
}
|
|
1385
|
-
|
|
1431
|
+
#e(t) {
|
|
1386
1432
|
return !("name" in t) || typeof t.name != "string" ? (console.error("Plugin requires a name!"), false) : true;
|
|
1387
1433
|
}
|
|
1388
1434
|
get(t) {
|
|
1389
|
-
return this.find((
|
|
1435
|
+
return this.find((e) => e.name === t) || null;
|
|
1390
1436
|
}
|
|
1391
1437
|
add(t) {
|
|
1392
1438
|
if (Array.isArray(t))
|
|
1393
|
-
t.forEach((
|
|
1394
|
-
else if (this
|
|
1395
|
-
const
|
|
1396
|
-
~
|
|
1439
|
+
t.forEach((e) => this.add(e));
|
|
1440
|
+
else if (this.#t(t), this.#e(t)) {
|
|
1441
|
+
const e = this.findIndex((i) => i.name === t.name);
|
|
1442
|
+
~e ? this[e] = t : this.push(t);
|
|
1397
1443
|
}
|
|
1398
1444
|
}
|
|
1399
1445
|
remove(t) {
|
|
1400
|
-
const
|
|
1401
|
-
~
|
|
1446
|
+
const e = this.findIndex((i) => i.name === t);
|
|
1447
|
+
~e && this.splice(e, 1);
|
|
1402
1448
|
}
|
|
1403
|
-
}
|
|
1404
|
-
|
|
1449
|
+
}
|
|
1450
|
+
class L3 extends Array {
|
|
1405
1451
|
constructor(t = {}) {
|
|
1406
|
-
super(), this.
|
|
1452
|
+
super(), this.config = t;
|
|
1407
1453
|
}
|
|
1408
1454
|
get copy() {
|
|
1409
1455
|
return [...this];
|
|
@@ -1412,137 +1458,108 @@ let T$1 = class T extends Array {
|
|
|
1412
1458
|
return this[this.length - 1] || null;
|
|
1413
1459
|
}
|
|
1414
1460
|
updateIndex() {
|
|
1415
|
-
this.forEach((t,
|
|
1461
|
+
this.forEach((t, e) => {
|
|
1416
1462
|
t.el.style.zIndex = "";
|
|
1417
|
-
const i = getComputedStyle(t.el)
|
|
1418
|
-
t.el.style.zIndex =
|
|
1463
|
+
const i = getComputedStyle(t.el).getPropertyValue("z-index"), n = parseInt(i, 10), o = String((Number.isNaN(n) ? 0 : n) + e + 1);
|
|
1464
|
+
t.el.style.zIndex = o;
|
|
1419
1465
|
});
|
|
1420
1466
|
}
|
|
1421
1467
|
onChange() {
|
|
1422
|
-
this.updateIndex(), typeof this.
|
|
1468
|
+
this.updateIndex(), typeof this.config.onChange == "function" && this.config.onChange();
|
|
1423
1469
|
}
|
|
1424
1470
|
add(t) {
|
|
1425
1471
|
this.push(t), this.onChange();
|
|
1426
1472
|
}
|
|
1427
1473
|
remove(t) {
|
|
1428
|
-
const
|
|
1429
|
-
~
|
|
1474
|
+
const e = this.findIndex((i) => i.id === t.id);
|
|
1475
|
+
~e && (t.el.style.zIndex = "", this.splice(e, 1), this.onChange());
|
|
1430
1476
|
}
|
|
1431
1477
|
moveToTop(t) {
|
|
1432
|
-
const
|
|
1433
|
-
~
|
|
1434
|
-
}
|
|
1435
|
-
};
|
|
1436
|
-
const k$1 = {
|
|
1437
|
-
dataConfig: "config",
|
|
1438
|
-
customProps: []
|
|
1439
|
-
};
|
|
1440
|
-
class w2 {
|
|
1441
|
-
constructor(t, s, i = {}) {
|
|
1442
|
-
this.parent = t, this.el = f(s), this.settings = { ...i }, this.dataConfig = {}, this.customProps = {};
|
|
1443
|
-
}
|
|
1444
|
-
get id() {
|
|
1445
|
-
return this.el.id;
|
|
1446
|
-
}
|
|
1447
|
-
applySettings(t) {
|
|
1448
|
-
return Object.assign(this.settings, t);
|
|
1449
|
-
}
|
|
1450
|
-
getSetting(t, s) {
|
|
1451
|
-
return x.call(this, t, s);
|
|
1452
|
-
}
|
|
1453
|
-
buildDataConfig() {
|
|
1454
|
-
return Object.assign(
|
|
1455
|
-
this.dataConfig,
|
|
1456
|
-
y2(this.el, this.getSetting("dataConfig"))
|
|
1457
|
-
);
|
|
1458
|
-
}
|
|
1459
|
-
buildCustomProps() {
|
|
1460
|
-
return Object.assign(this.customProps, E$1(this));
|
|
1461
|
-
}
|
|
1462
|
-
async init(t = {}) {
|
|
1463
|
-
this.applySettings(t), this.buildDataConfig(), this.buildCustomProps();
|
|
1478
|
+
const e = this.findIndex((i) => i.id === t.id);
|
|
1479
|
+
~e && (this.splice(e, 1), this.add(t));
|
|
1464
1480
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
});
|
|
1481
|
+
}
|
|
1482
|
+
class d {
|
|
1483
|
+
constructor(t, e) {
|
|
1484
|
+
this.config = new C(), this.parent = t, this.el = p(e), this.id = this.el.id, this.config.set("parent", this.parent.config), this.config.set("entry", {});
|
|
1469
1485
|
}
|
|
1470
1486
|
}
|
|
1471
|
-
|
|
1487
|
+
const k$1 = {
|
|
1488
|
+
selector: "",
|
|
1489
|
+
plugins: [],
|
|
1490
|
+
presets: {}
|
|
1491
|
+
};
|
|
1492
|
+
let A$1 = class A2 {
|
|
1472
1493
|
constructor(t = {}) {
|
|
1473
|
-
this.
|
|
1494
|
+
this.#t = new x2(), this.events = this.#t.events, this.on = this.#t.on.bind(this.#t), this.off = this.#t.off.bind(this.#t), this.emit = this.#t.emit.bind(this.#t), this.collection = [], this.entryClass = d, this.name = this.constructor.name, this.config = { ...k$1, ...t }, this.plugins = new O2(this.config.presets);
|
|
1474
1495
|
}
|
|
1475
|
-
|
|
1476
|
-
|
|
1496
|
+
#t;
|
|
1497
|
+
get(t, e = "id") {
|
|
1498
|
+
return this.collection.find((i) => i[e] === t);
|
|
1477
1499
|
}
|
|
1478
|
-
getOrThrow(t,
|
|
1479
|
-
const i = this.get(t,
|
|
1500
|
+
getOrThrow(t, e = "id") {
|
|
1501
|
+
const i = this.get(t, e);
|
|
1480
1502
|
if (i)
|
|
1481
1503
|
return i;
|
|
1482
1504
|
throw new Error(
|
|
1483
|
-
`${this.
|
|
1505
|
+
`${this.name} entry not found in collection with ${String(e)} of "${t}"`
|
|
1484
1506
|
);
|
|
1485
1507
|
}
|
|
1486
|
-
|
|
1487
|
-
return Object.assign(this.
|
|
1508
|
+
updateConfig(t = {}) {
|
|
1509
|
+
return Object.assign(this.config, t);
|
|
1488
1510
|
}
|
|
1489
|
-
async createEntry(t
|
|
1490
|
-
const
|
|
1491
|
-
return await
|
|
1511
|
+
async createEntry(t) {
|
|
1512
|
+
const e = new this.entryClass(this, t);
|
|
1513
|
+
return await a(e, "init"), await r("onCreateEntry", this, e), e;
|
|
1492
1514
|
}
|
|
1493
1515
|
async destroyEntry(t) {
|
|
1494
|
-
return await
|
|
1516
|
+
return await r("onDestroyEntry", this, t), await a(t, "destroy"), t;
|
|
1495
1517
|
}
|
|
1496
|
-
async register(t
|
|
1497
|
-
const
|
|
1498
|
-
|
|
1499
|
-
const o = this.collection[n];
|
|
1500
|
-
return o.el = i, typeof o.init == "function" && await o.init(s), o;
|
|
1501
|
-
} else {
|
|
1502
|
-
const o = await this.createEntry(i, s);
|
|
1503
|
-
return this.collection.push(o), await a("onRegisterEntry", this, o), o;
|
|
1504
|
-
}
|
|
1518
|
+
async register(t) {
|
|
1519
|
+
const e = this.collection.findIndex((i) => i.id === t.id);
|
|
1520
|
+
return ~e ? this.collection[e] = t : this.collection.push(t), await r("onRegisterEntry", this, t), t;
|
|
1505
1521
|
}
|
|
1506
1522
|
async deregister(t) {
|
|
1507
|
-
const
|
|
1508
|
-
if (~
|
|
1509
|
-
|
|
1510
|
-
return await a(
|
|
1523
|
+
const e = this.collection.findIndex((i) => i.id === t.id);
|
|
1524
|
+
if (~e) {
|
|
1525
|
+
await r(
|
|
1511
1526
|
"onDeregisterEntry",
|
|
1512
1527
|
this,
|
|
1513
|
-
this.collection[
|
|
1514
|
-
)
|
|
1528
|
+
this.collection[e]
|
|
1529
|
+
);
|
|
1530
|
+
const [i] = this.collection.splice(e, 1);
|
|
1515
1531
|
}
|
|
1516
|
-
return
|
|
1532
|
+
return t;
|
|
1533
|
+
}
|
|
1534
|
+
async mount(t = (e) => e) {
|
|
1535
|
+
for (const e of this.config?.plugins || [])
|
|
1536
|
+
this.plugins.add(e);
|
|
1537
|
+
for (const e of this.plugins)
|
|
1538
|
+
await a(e, "setup", this);
|
|
1539
|
+
if (await r("beforeMount", this), this.config.selector) {
|
|
1540
|
+
const e = document.querySelectorAll(this.config.selector);
|
|
1541
|
+
for (const i of e)
|
|
1542
|
+
await this.createEntry(i).then((n) => t(n)).then((n) => this.register(n));
|
|
1543
|
+
}
|
|
1544
|
+
return await r("afterMount", this), this;
|
|
1517
1545
|
}
|
|
1518
|
-
async
|
|
1519
|
-
this.
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
for (const
|
|
1523
|
-
await
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
for (const i of s)
|
|
1527
|
-
await this.register(i);
|
|
1528
|
-
return await a("afterMount", this), this;
|
|
1529
|
-
}
|
|
1530
|
-
async unmount() {
|
|
1531
|
-
for (await a("beforeUnmount", this); this.collection.length > 0; )
|
|
1532
|
-
await this.deregister(this.collection[0].id);
|
|
1533
|
-
await a("afterUnmount", this);
|
|
1534
|
-
for (const t of this.plugins)
|
|
1535
|
-
await r(t, "teardown", { plugin: t, parent: this });
|
|
1536
|
-
for (const t of [...this.plugins])
|
|
1537
|
-
this.plugins.remove(t.name);
|
|
1546
|
+
async unmount(t = (e) => e) {
|
|
1547
|
+
for (await r("beforeUnmount", this); this.collection.length > 0; )
|
|
1548
|
+
await this.destroyEntry(this.collection[0]).then((e) => t(e)).then((e) => this.deregister(e));
|
|
1549
|
+
await r("afterUnmount", this);
|
|
1550
|
+
for (const e of this.plugins)
|
|
1551
|
+
await a(e, "teardown", this);
|
|
1552
|
+
for (const e of [...this.plugins])
|
|
1553
|
+
this.plugins.remove(e.name);
|
|
1538
1554
|
return this;
|
|
1539
1555
|
}
|
|
1540
|
-
}
|
|
1541
|
-
|
|
1556
|
+
};
|
|
1557
|
+
w("theme-prefix", { fallback: "vb-theme-" });
|
|
1558
|
+
const I$1 = {
|
|
1542
1559
|
// Data attributes
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1560
|
+
attrOpen: "modal-open",
|
|
1561
|
+
attrClose: "modal-close",
|
|
1562
|
+
attrReplace: "modal-replace",
|
|
1546
1563
|
// Selectors
|
|
1547
1564
|
selector: ".modal",
|
|
1548
1565
|
selectorDialog: ".modal__dialog",
|
|
@@ -1556,149 +1573,153 @@ const D$1 = {
|
|
|
1556
1573
|
stateOpening: "is-opening",
|
|
1557
1574
|
stateClosing: "is-closing",
|
|
1558
1575
|
stateClosed: "is-closed",
|
|
1559
|
-
// Feature
|
|
1576
|
+
// Feature configurations
|
|
1560
1577
|
customProps: ["transition-duration"],
|
|
1561
1578
|
customEventPrefix: "modal:",
|
|
1562
1579
|
setTabindex: true,
|
|
1563
1580
|
transition: true,
|
|
1564
1581
|
transitionDuration: 300
|
|
1565
1582
|
};
|
|
1566
|
-
function c(
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1583
|
+
function c(s) {
|
|
1584
|
+
if (s.active) {
|
|
1585
|
+
const t = s.active.dialog.querySelector(s.config.selectorFocus) || s.active.dialog;
|
|
1586
|
+
"focus" in t && typeof t.focus == "function" && t.focus();
|
|
1587
|
+
} else
|
|
1588
|
+
s.trigger && (s.trigger.focus(), s.trigger = null);
|
|
1589
|
+
}
|
|
1590
|
+
async function l(s, t, e = true) {
|
|
1591
|
+
return s.parent.stack.moveToTop(s), s.state === "closed" && (s.state = "opening", s.parent.stack.add(s), t ?? s.config.get("transition") ? await u(
|
|
1592
|
+
s.el,
|
|
1593
|
+
s.config.get("stateClosed"),
|
|
1594
|
+
s.config.get("stateOpening"),
|
|
1595
|
+
s.config.get("stateOpened"),
|
|
1596
|
+
s.config.get("transitionDuration")
|
|
1597
|
+
) : (s.el.classList.add(s.config.get("stateOpened")), s.el.classList.remove(s.config.get("stateClosed"))), s.state = "opened"), e && c(s.parent), s.el.dispatchEvent(
|
|
1598
|
+
new CustomEvent(s.config.get("customEventPrefix") + "opened", {
|
|
1599
|
+
detail: s.parent,
|
|
1579
1600
|
bubbles: true
|
|
1580
1601
|
})
|
|
1581
|
-
), await
|
|
1582
|
-
}
|
|
1583
|
-
async function
|
|
1584
|
-
return
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
) : (
|
|
1591
|
-
new CustomEvent(
|
|
1592
|
-
detail:
|
|
1602
|
+
), await s.parent.emit("opened", s), s;
|
|
1603
|
+
}
|
|
1604
|
+
async function h(s, t, e = true) {
|
|
1605
|
+
return s && s.state === "opened" && (s.state = "closing", document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), t ?? s.config.get("transition") ? await u(
|
|
1606
|
+
s.el,
|
|
1607
|
+
s.config.get("stateOpened"),
|
|
1608
|
+
s.config.get("stateClosing"),
|
|
1609
|
+
s.config.get("stateClosed"),
|
|
1610
|
+
s.config.get("transitionDuration")
|
|
1611
|
+
) : (s.el.classList.add(s.config.get("stateClosed")), s.el.classList.remove(s.config.get("stateOpened"))), s.parent.stack.remove(s), s.state = "closed", e && c(s.parent), s.el.dispatchEvent(
|
|
1612
|
+
new CustomEvent(s.config.get("customEventPrefix") + "closed", {
|
|
1613
|
+
detail: s.parent,
|
|
1593
1614
|
bubbles: true
|
|
1594
1615
|
})
|
|
1595
|
-
), await
|
|
1616
|
+
), await s.parent.emit("closed", s)), s;
|
|
1596
1617
|
}
|
|
1597
|
-
async function
|
|
1618
|
+
async function g2(s, t, e = true) {
|
|
1598
1619
|
let i, n;
|
|
1599
|
-
return
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
]),
|
|
1620
|
+
return s.state === "opened" ? (i = s, n = await s.parent.closeAll(s.id, t)) : [n, i] = await Promise.all([
|
|
1621
|
+
s.parent.closeAll("", t),
|
|
1622
|
+
l(s, t, false)
|
|
1623
|
+
]), e && c(s.parent), { opened: i, closed: n };
|
|
1603
1624
|
}
|
|
1604
|
-
|
|
1605
|
-
constructor(t,
|
|
1606
|
-
super(t,
|
|
1625
|
+
class $ extends d {
|
|
1626
|
+
constructor(t, e) {
|
|
1627
|
+
super(t, e), this.state = "closed", this.dialog = this.el.querySelector(this.config.get("selectorDialog")) || this.el;
|
|
1607
1628
|
}
|
|
1608
1629
|
get isRequired() {
|
|
1609
|
-
return this.dialog.matches(this.
|
|
1630
|
+
return this.dialog.matches(this.config.get("selectorRequired"));
|
|
1610
1631
|
}
|
|
1611
|
-
async open(t,
|
|
1612
|
-
return
|
|
1632
|
+
async open(t, e) {
|
|
1633
|
+
return l(this, t, e);
|
|
1613
1634
|
}
|
|
1614
|
-
async close(t,
|
|
1615
|
-
return
|
|
1635
|
+
async close(t, e) {
|
|
1636
|
+
return h(this, t, e);
|
|
1616
1637
|
}
|
|
1617
|
-
async replace(t,
|
|
1618
|
-
return
|
|
1638
|
+
async replace(t, e) {
|
|
1639
|
+
return g2(this, t, e);
|
|
1619
1640
|
}
|
|
1620
1641
|
async deregister() {
|
|
1621
|
-
return this.parent.deregister(this
|
|
1642
|
+
return this.parent.deregister(this);
|
|
1622
1643
|
}
|
|
1623
1644
|
async onCreateEntry() {
|
|
1624
|
-
this.dialog.setAttribute("aria-modal", "true"), this.dialog.hasAttribute("role") || this.dialog.setAttribute("role", "dialog"), this.
|
|
1645
|
+
this.dialog.setAttribute("aria-modal", "true"), this.dialog.hasAttribute("role") || this.dialog.setAttribute("role", "dialog"), this.config.get("setTabindex") && this.dialog.setAttribute("tabindex", "-1");
|
|
1625
1646
|
}
|
|
1626
1647
|
async onRegisterEntry() {
|
|
1627
|
-
this.el.classList.contains(this.
|
|
1648
|
+
this.el.classList.contains(this.config.get("stateOpened")) ? await this.open(false) : (this.el.classList.remove(this.config.get("stateOpening")), this.el.classList.remove(this.config.get("stateClosing")), this.el.classList.add(this.config.get("stateClosed")));
|
|
1628
1649
|
}
|
|
1629
1650
|
async onDestroyEntry() {
|
|
1630
1651
|
this.state === "opened" && await this.close(false);
|
|
1631
1652
|
}
|
|
1632
|
-
}
|
|
1633
|
-
async function
|
|
1634
|
-
const t =
|
|
1653
|
+
}
|
|
1654
|
+
async function T(s) {
|
|
1655
|
+
const t = s.target;
|
|
1635
1656
|
if (t) {
|
|
1636
|
-
const
|
|
1637
|
-
[data-${this.
|
|
1638
|
-
[data-${this.
|
|
1639
|
-
[data-${this.
|
|
1657
|
+
const e = t.closest(`
|
|
1658
|
+
[data-${this.config.attrOpen}],
|
|
1659
|
+
[data-${this.config.attrReplace}],
|
|
1660
|
+
[data-${this.config.attrClose}]
|
|
1640
1661
|
`);
|
|
1641
|
-
if (
|
|
1642
|
-
if (
|
|
1643
|
-
const i =
|
|
1644
|
-
return t.closest(this.
|
|
1662
|
+
if (e) {
|
|
1663
|
+
if (s.preventDefault(), e.matches(`[data-${this.config.attrOpen}]`)) {
|
|
1664
|
+
const i = e.getAttribute(`data-${this.config.attrOpen}`)?.trim(), n = this.getOrThrow(i);
|
|
1665
|
+
return t.closest(this.config.selector) || (this.trigger = e), n.open();
|
|
1645
1666
|
}
|
|
1646
|
-
if (
|
|
1647
|
-
const i =
|
|
1648
|
-
return t.closest(this.
|
|
1667
|
+
if (e.matches(`[data-${this.config.attrReplace}]`)) {
|
|
1668
|
+
const i = e.getAttribute(`data-${this.config.attrReplace}`)?.trim(), n = this.getOrThrow(i);
|
|
1669
|
+
return t.closest(this.config.selector) || (this.trigger = e), n.replace();
|
|
1649
1670
|
}
|
|
1650
|
-
if (
|
|
1651
|
-
const i =
|
|
1671
|
+
if (e.matches(`[data-${this.config.attrClose}]`)) {
|
|
1672
|
+
const i = e.getAttribute(`data-${this.config.attrClose}`)?.trim();
|
|
1652
1673
|
return i === "*" ? this.closeAll() : this.close(i || "");
|
|
1653
1674
|
}
|
|
1654
1675
|
}
|
|
1655
|
-
if (this.active && t.matches(this.
|
|
1676
|
+
if (this.active && t.matches(this.config.selectorScreen) && !this.active.isRequired)
|
|
1656
1677
|
return this.close();
|
|
1657
1678
|
}
|
|
1658
1679
|
}
|
|
1659
|
-
function
|
|
1660
|
-
if (
|
|
1680
|
+
function S$1(s) {
|
|
1681
|
+
if (s.key === "Escape" && this.active && !this.active.dialog.matches(this.config.selectorRequired))
|
|
1661
1682
|
return this.close();
|
|
1662
1683
|
}
|
|
1663
|
-
async function
|
|
1664
|
-
const
|
|
1684
|
+
async function M(s = "", t) {
|
|
1685
|
+
const e = [];
|
|
1665
1686
|
return await Promise.all(
|
|
1666
1687
|
this.stack.copy.map(async (i) => {
|
|
1667
|
-
|
|
1688
|
+
s && s === i.id || e.push(await h(i, t, false));
|
|
1668
1689
|
})
|
|
1669
|
-
),
|
|
1690
|
+
), e;
|
|
1670
1691
|
}
|
|
1671
|
-
let
|
|
1672
|
-
#t;
|
|
1673
|
-
#e;
|
|
1692
|
+
let P$1 = class P extends A$1 {
|
|
1674
1693
|
constructor(t) {
|
|
1675
|
-
super({ ...
|
|
1694
|
+
super({ ...I$1, ...t }), this.entryClass = $, this.name = "Modal", this.trigger = null, this.#t = T.bind(this), this.#e = S$1.bind(this), this.stack = new L3({
|
|
1676
1695
|
onChange: () => {
|
|
1677
|
-
|
|
1696
|
+
b(
|
|
1678
1697
|
!!this.stack.top,
|
|
1679
|
-
this.
|
|
1680
|
-
this.
|
|
1698
|
+
this.config.selectorInert,
|
|
1699
|
+
this.config.selectorOverflow
|
|
1681
1700
|
);
|
|
1682
1701
|
}
|
|
1683
1702
|
});
|
|
1684
1703
|
}
|
|
1704
|
+
#t;
|
|
1705
|
+
#e;
|
|
1685
1706
|
get active() {
|
|
1686
1707
|
return this.stack.top;
|
|
1687
1708
|
}
|
|
1688
|
-
async open(t,
|
|
1709
|
+
async open(t, e, i) {
|
|
1689
1710
|
const n = this.getOrThrow(t);
|
|
1690
|
-
return
|
|
1711
|
+
return l(n, e, i);
|
|
1691
1712
|
}
|
|
1692
|
-
async close(t,
|
|
1713
|
+
async close(t, e, i) {
|
|
1693
1714
|
const n = t ? this.getOrThrow(t) : this.active;
|
|
1694
|
-
return
|
|
1715
|
+
return h(n, e, i);
|
|
1695
1716
|
}
|
|
1696
|
-
async replace(t,
|
|
1717
|
+
async replace(t, e, i) {
|
|
1697
1718
|
const n = this.getOrThrow(t);
|
|
1698
|
-
return
|
|
1719
|
+
return g2(n, e, i);
|
|
1699
1720
|
}
|
|
1700
|
-
async closeAll(t,
|
|
1701
|
-
const n = await
|
|
1721
|
+
async closeAll(t, e, i = true) {
|
|
1722
|
+
const n = await M.call(this, t, e);
|
|
1702
1723
|
return i && c(this), n;
|
|
1703
1724
|
}
|
|
1704
1725
|
async afterMount() {
|
|
@@ -1711,11 +1732,7 @@ let H$1 = class H2 extends M {
|
|
|
1711
1732
|
document.removeEventListener("click", this.#t, false), document.removeEventListener("keydown", this.#e, false);
|
|
1712
1733
|
}
|
|
1713
1734
|
};
|
|
1714
|
-
function
|
|
1715
|
-
const n = (t.getAttribute(`data-${e}`) || "").replace(/'/g, '"');
|
|
1716
|
-
return n ? JSON.parse(n) : {};
|
|
1717
|
-
}
|
|
1718
|
-
function Rt(t) {
|
|
1735
|
+
function jt(t) {
|
|
1719
1736
|
if (typeof t == "string") {
|
|
1720
1737
|
const e = document.getElementById(t);
|
|
1721
1738
|
if (e) return e;
|
|
@@ -1730,84 +1747,107 @@ function Rt(t) {
|
|
|
1730
1747
|
async function z2(t, e, ...n) {
|
|
1731
1748
|
e in t && typeof t[e] == "function" && await t[e](...n);
|
|
1732
1749
|
}
|
|
1733
|
-
function
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1750
|
+
function Kt(t, e = {}) {
|
|
1751
|
+
const n = {
|
|
1752
|
+
fallback: null,
|
|
1753
|
+
element: document.body,
|
|
1754
|
+
...e
|
|
1755
|
+
};
|
|
1756
|
+
if (!t.startsWith("--")) {
|
|
1757
|
+
const s = Jt();
|
|
1758
|
+
s && (t = `${s}${t}`), t = `--${t}`;
|
|
1759
|
+
}
|
|
1760
|
+
const i = getComputedStyle(n.element).getPropertyValue(t).trim();
|
|
1761
|
+
if (i)
|
|
1762
|
+
return i;
|
|
1763
|
+
if (n.fallback)
|
|
1764
|
+
return n.fallback;
|
|
1765
|
+
throw new Error(`CSS variable "${t}" was not found!`);
|
|
1766
|
+
}
|
|
1767
|
+
async function N(t, e, n) {
|
|
1742
1768
|
await z2(e, t, n), n && await z2(n, t);
|
|
1743
1769
|
for (const i of e.plugins)
|
|
1744
|
-
await z2(i, t, {
|
|
1745
|
-
await e.emit(t, n);
|
|
1770
|
+
await z2(i, t, { parent: e, entry: n });
|
|
1771
|
+
await e.emit(t, { parent: e, entry: n });
|
|
1746
1772
|
}
|
|
1747
|
-
function
|
|
1748
|
-
const e = getComputedStyle(t.el), n = {}, i = t.getSetting("customProps");
|
|
1749
|
-
for (let s = 0; s < i.length; s++) {
|
|
1750
|
-
const o = Qt(), r2 = t.parent.module.toLowerCase(), c2 = kt(i[s]), l = e.getPropertyValue(`--${o}${r2}-${c2}`).trim();
|
|
1751
|
-
l && (n[c2] = l);
|
|
1752
|
-
}
|
|
1753
|
-
return n;
|
|
1754
|
-
}
|
|
1755
|
-
function Qt() {
|
|
1773
|
+
function Jt() {
|
|
1756
1774
|
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
1757
1775
|
}
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1776
|
+
class Gt {
|
|
1777
|
+
#t;
|
|
1778
|
+
#e;
|
|
1779
|
+
constructor() {
|
|
1780
|
+
this.#t = {}, this.#e = [];
|
|
1781
|
+
}
|
|
1782
|
+
get(e, n) {
|
|
1783
|
+
const { fallback: i, source: s } = n ?? {};
|
|
1784
|
+
if (s) {
|
|
1785
|
+
const o = this.#t?.[s]?.[e];
|
|
1786
|
+
if (o !== void 0)
|
|
1787
|
+
return o;
|
|
1788
|
+
} else
|
|
1789
|
+
for (const o of this.#e) {
|
|
1790
|
+
const r2 = this.#t?.[o]?.[e];
|
|
1791
|
+
if (r2 !== void 0)
|
|
1792
|
+
return r2;
|
|
1793
|
+
}
|
|
1794
|
+
if (i !== void 0)
|
|
1795
|
+
return i;
|
|
1796
|
+
throw new Error(`Config does not exist: ${e}`);
|
|
1797
|
+
}
|
|
1798
|
+
set(e, n = {}) {
|
|
1799
|
+
let i, s;
|
|
1800
|
+
return typeof e == "string" ? (i = e, s = n) : (i = "entry", s = e), this.#t[i] ? Object.assign(this.#t[i], s) : (this.#e.unshift(i), this.#t[i] = s), this.#t[i];
|
|
1801
|
+
}
|
|
1802
|
+
remove(e) {
|
|
1803
|
+
const n = this.#e.indexOf(e);
|
|
1804
|
+
n !== -1 && this.#e.splice(n, 1), delete this.#t[e];
|
|
1805
|
+
}
|
|
1806
|
+
setSourceOrder(e) {
|
|
1807
|
+
const n = Object.keys(this.#t).reverse(), i = e.filter((s) => n.includes(s));
|
|
1808
|
+
for (const s of n)
|
|
1809
|
+
i.includes(s) || i.push(s);
|
|
1810
|
+
return this.#e = i;
|
|
1811
|
+
}
|
|
1774
1812
|
}
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1813
|
+
class Qt {
|
|
1814
|
+
constructor() {
|
|
1815
|
+
this.events = {};
|
|
1816
|
+
}
|
|
1817
|
+
on(e, n, ...i) {
|
|
1818
|
+
this.events[e] || (this.events[e] = []), this.events[e].some(
|
|
1819
|
+
(s) => s.listener === n
|
|
1820
|
+
) || this.events[e].push({ listener: n, args: i });
|
|
1821
|
+
}
|
|
1822
|
+
off(e, n) {
|
|
1823
|
+
this.events[e] && (this.events[e] = this.events[e].filter(
|
|
1824
|
+
(i) => i.listener !== n
|
|
1785
1825
|
));
|
|
1786
|
-
},
|
|
1787
|
-
async emit(t, e) {
|
|
1788
|
-
if (t = t.startsWith("on") ? t.slice(2, 3).toLowerCase() + t.slice(3) : t, !!this.events[t])
|
|
1789
|
-
for (const { listener: n, args: i } of this.events[t])
|
|
1790
|
-
await n(e, ...i);
|
|
1791
1826
|
}
|
|
1792
|
-
|
|
1793
|
-
|
|
1827
|
+
async emit(e, ...n) {
|
|
1828
|
+
if (e = e.startsWith("on") ? e.slice(2, 3).toLowerCase() + e.slice(3) : e, !!this.events[e])
|
|
1829
|
+
for (const { listener: i, args: s } of this.events[e])
|
|
1830
|
+
await i(...n, ...s);
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
class Zt extends Array {
|
|
1794
1834
|
constructor(e = {}) {
|
|
1795
1835
|
super(), this.presets = e;
|
|
1796
1836
|
}
|
|
1797
|
-
|
|
1798
|
-
const n =
|
|
1799
|
-
e.
|
|
1837
|
+
#t(e) {
|
|
1838
|
+
const n = this.presets?.[e.name] || {}, i = e?.options || {};
|
|
1839
|
+
e.config = { ...e.config, ...n, ...i };
|
|
1800
1840
|
}
|
|
1801
|
-
|
|
1841
|
+
#e(e) {
|
|
1802
1842
|
return !("name" in e) || typeof e.name != "string" ? (console.error("Plugin requires a name!"), false) : true;
|
|
1803
1843
|
}
|
|
1804
1844
|
get(e) {
|
|
1805
|
-
return this.find((n) => n.name === e);
|
|
1845
|
+
return this.find((n) => n.name === e) || null;
|
|
1806
1846
|
}
|
|
1807
1847
|
add(e) {
|
|
1808
1848
|
if (Array.isArray(e))
|
|
1809
1849
|
e.forEach((n) => this.add(n));
|
|
1810
|
-
else if (this
|
|
1850
|
+
else if (this.#t(e), this.#e(e)) {
|
|
1811
1851
|
const n = this.findIndex((i) => i.name === e.name);
|
|
1812
1852
|
~n ? this[n] = e : this.push(e);
|
|
1813
1853
|
}
|
|
@@ -1817,45 +1857,21 @@ class ie extends Array {
|
|
|
1817
1857
|
~n && this.splice(n, 1);
|
|
1818
1858
|
}
|
|
1819
1859
|
}
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
};
|
|
1824
|
-
class Dt {
|
|
1825
|
-
constructor(e, n, i = {}) {
|
|
1826
|
-
this.parent = e, this.el = Rt(n), this.settings = { ...i }, this.dataConfig = {}, this.customProps = {};
|
|
1827
|
-
}
|
|
1828
|
-
get id() {
|
|
1829
|
-
return this.el.id;
|
|
1830
|
-
}
|
|
1831
|
-
applySettings(e) {
|
|
1832
|
-
return Object.assign(this.settings, e);
|
|
1833
|
-
}
|
|
1834
|
-
getSetting(e, n) {
|
|
1835
|
-
return ee.call(this, e, n);
|
|
1836
|
-
}
|
|
1837
|
-
buildDataConfig() {
|
|
1838
|
-
return Object.assign(
|
|
1839
|
-
this.dataConfig,
|
|
1840
|
-
Jt(this.el, this.getSetting("dataConfig"))
|
|
1841
|
-
);
|
|
1842
|
-
}
|
|
1843
|
-
buildCustomProps() {
|
|
1844
|
-
return Object.assign(this.customProps, Gt(this));
|
|
1845
|
-
}
|
|
1846
|
-
async init(e = {}) {
|
|
1847
|
-
this.applySettings(e), this.buildDataConfig(), this.buildCustomProps();
|
|
1848
|
-
}
|
|
1849
|
-
async destroy() {
|
|
1850
|
-
Object.getOwnPropertyNames(this).forEach((e) => {
|
|
1851
|
-
delete this[e];
|
|
1852
|
-
});
|
|
1860
|
+
class Pt {
|
|
1861
|
+
constructor(e, n) {
|
|
1862
|
+
this.config = new Gt(), this.parent = e, this.el = jt(n), this.id = this.el.id, this.config.set("parent", this.parent.config), this.config.set("entry", {});
|
|
1853
1863
|
}
|
|
1854
1864
|
}
|
|
1855
|
-
|
|
1865
|
+
const te = {
|
|
1866
|
+
selector: "",
|
|
1867
|
+
plugins: [],
|
|
1868
|
+
presets: {}
|
|
1869
|
+
};
|
|
1870
|
+
class ee {
|
|
1856
1871
|
constructor(e = {}) {
|
|
1857
|
-
this.
|
|
1872
|
+
this.#t = new Qt(), this.events = this.#t.events, this.on = this.#t.on.bind(this.#t), this.off = this.#t.off.bind(this.#t), this.emit = this.#t.emit.bind(this.#t), this.collection = [], this.entryClass = Pt, this.name = this.constructor.name, this.config = { ...te, ...e }, this.plugins = new Zt(this.config.presets);
|
|
1858
1873
|
}
|
|
1874
|
+
#t;
|
|
1859
1875
|
get(e, n = "id") {
|
|
1860
1876
|
return this.collection.find((i) => i[n] === e);
|
|
1861
1877
|
}
|
|
@@ -1864,65 +1880,60 @@ class oe {
|
|
|
1864
1880
|
if (i)
|
|
1865
1881
|
return i;
|
|
1866
1882
|
throw new Error(
|
|
1867
|
-
`${this.
|
|
1883
|
+
`${this.name} entry not found in collection with ${String(n)} of "${e}"`
|
|
1868
1884
|
);
|
|
1869
1885
|
}
|
|
1870
|
-
|
|
1871
|
-
return Object.assign(this.
|
|
1886
|
+
updateConfig(e = {}) {
|
|
1887
|
+
return Object.assign(this.config, e);
|
|
1872
1888
|
}
|
|
1873
|
-
async createEntry(e
|
|
1874
|
-
const
|
|
1875
|
-
return await z2(
|
|
1889
|
+
async createEntry(e) {
|
|
1890
|
+
const n = new this.entryClass(this, e);
|
|
1891
|
+
return await z2(n, "init"), await N("onCreateEntry", this, n), n;
|
|
1876
1892
|
}
|
|
1877
1893
|
async destroyEntry(e) {
|
|
1878
|
-
return await
|
|
1894
|
+
return await N("onDestroyEntry", this, e), await z2(e, "destroy"), e;
|
|
1879
1895
|
}
|
|
1880
|
-
async register(e
|
|
1881
|
-
const
|
|
1882
|
-
|
|
1883
|
-
const o = this.collection[s];
|
|
1884
|
-
return o.el = i, typeof o.init == "function" && await o.init(n), o;
|
|
1885
|
-
} else {
|
|
1886
|
-
const o = await this.createEntry(i, n);
|
|
1887
|
-
return this.collection.push(o), await H3("onRegisterEntry", this, o), o;
|
|
1888
|
-
}
|
|
1896
|
+
async register(e) {
|
|
1897
|
+
const n = this.collection.findIndex((i) => i.id === e.id);
|
|
1898
|
+
return ~n ? this.collection[n] = e : this.collection.push(e), await N("onRegisterEntry", this, e), e;
|
|
1889
1899
|
}
|
|
1890
1900
|
async deregister(e) {
|
|
1891
|
-
const n = this.collection.findIndex((i) => i.id === e);
|
|
1901
|
+
const n = this.collection.findIndex((i) => i.id === e.id);
|
|
1892
1902
|
if (~n) {
|
|
1893
|
-
|
|
1894
|
-
return await H3(
|
|
1903
|
+
await N(
|
|
1895
1904
|
"onDeregisterEntry",
|
|
1896
1905
|
this,
|
|
1897
1906
|
this.collection[n]
|
|
1898
|
-
)
|
|
1907
|
+
);
|
|
1908
|
+
const [i] = this.collection.splice(n, 1);
|
|
1899
1909
|
}
|
|
1900
|
-
return
|
|
1910
|
+
return e;
|
|
1901
1911
|
}
|
|
1902
|
-
async mount(e =
|
|
1903
|
-
this.
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
return await
|
|
1913
|
-
}
|
|
1914
|
-
async unmount() {
|
|
1915
|
-
for (await
|
|
1916
|
-
await this.
|
|
1917
|
-
await
|
|
1918
|
-
for (const
|
|
1919
|
-
await z2(
|
|
1920
|
-
for (const
|
|
1921
|
-
this.plugins.remove(
|
|
1912
|
+
async mount(e = (n) => n) {
|
|
1913
|
+
for (const n of this.config?.plugins || [])
|
|
1914
|
+
this.plugins.add(n);
|
|
1915
|
+
for (const n of this.plugins)
|
|
1916
|
+
await z2(n, "setup", this);
|
|
1917
|
+
if (await N("beforeMount", this), this.config.selector) {
|
|
1918
|
+
const n = document.querySelectorAll(this.config.selector);
|
|
1919
|
+
for (const i of n)
|
|
1920
|
+
await this.createEntry(i).then((s) => e(s)).then((s) => this.register(s));
|
|
1921
|
+
}
|
|
1922
|
+
return await N("afterMount", this), this;
|
|
1923
|
+
}
|
|
1924
|
+
async unmount(e = (n) => n) {
|
|
1925
|
+
for (await N("beforeUnmount", this); this.collection.length > 0; )
|
|
1926
|
+
await this.destroyEntry(this.collection[0]).then((n) => e(n)).then((n) => this.deregister(n));
|
|
1927
|
+
await N("afterUnmount", this);
|
|
1928
|
+
for (const n of this.plugins)
|
|
1929
|
+
await z2(n, "teardown", this);
|
|
1930
|
+
for (const n of [...this.plugins])
|
|
1931
|
+
this.plugins.remove(n.name);
|
|
1922
1932
|
return this;
|
|
1923
1933
|
}
|
|
1924
1934
|
}
|
|
1925
|
-
|
|
1935
|
+
Kt("theme-prefix", { fallback: "vb-theme-" });
|
|
1936
|
+
const ne = {
|
|
1926
1937
|
// Selectors
|
|
1927
1938
|
selector: ".popover",
|
|
1928
1939
|
selectorTooltip: ".popover_tooltip",
|
|
@@ -1947,28 +1958,28 @@ const re = {
|
|
|
1947
1958
|
shiftPadding: 0,
|
|
1948
1959
|
arrowPadding: 0,
|
|
1949
1960
|
toggleDelay: 0
|
|
1950
|
-
},
|
|
1961
|
+
}, j = Math.min, q2 = Math.max, st2 = Math.round, it = Math.floor, P2 = (t) => ({
|
|
1951
1962
|
x: t,
|
|
1952
1963
|
y: t
|
|
1953
|
-
}),
|
|
1964
|
+
}), ie = {
|
|
1954
1965
|
left: "right",
|
|
1955
1966
|
right: "left",
|
|
1956
1967
|
bottom: "top",
|
|
1957
1968
|
top: "bottom"
|
|
1958
|
-
},
|
|
1969
|
+
}, se = {
|
|
1959
1970
|
start: "end",
|
|
1960
1971
|
end: "start"
|
|
1961
1972
|
};
|
|
1962
|
-
function
|
|
1963
|
-
return
|
|
1973
|
+
function ht(t, e, n) {
|
|
1974
|
+
return q2(t, j(e, n));
|
|
1964
1975
|
}
|
|
1965
|
-
function
|
|
1976
|
+
function X(t, e) {
|
|
1966
1977
|
return typeof t == "function" ? t(e) : t;
|
|
1967
1978
|
}
|
|
1968
1979
|
function I2(t) {
|
|
1969
1980
|
return t.split("-")[0];
|
|
1970
1981
|
}
|
|
1971
|
-
function
|
|
1982
|
+
function et(t) {
|
|
1972
1983
|
return t.split("-")[1];
|
|
1973
1984
|
}
|
|
1974
1985
|
function pt(t) {
|
|
@@ -1977,48 +1988,48 @@ function pt(t) {
|
|
|
1977
1988
|
function wt(t) {
|
|
1978
1989
|
return t === "y" ? "height" : "width";
|
|
1979
1990
|
}
|
|
1980
|
-
const
|
|
1991
|
+
const oe = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
1981
1992
|
function F(t) {
|
|
1982
|
-
return
|
|
1993
|
+
return oe.has(I2(t)) ? "y" : "x";
|
|
1983
1994
|
}
|
|
1984
1995
|
function yt(t) {
|
|
1985
1996
|
return pt(F(t));
|
|
1986
1997
|
}
|
|
1987
|
-
function
|
|
1998
|
+
function re(t, e, n) {
|
|
1988
1999
|
n === void 0 && (n = false);
|
|
1989
|
-
const i =
|
|
2000
|
+
const i = et(t), s = yt(t), o = wt(s);
|
|
1990
2001
|
let r2 = s === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
1991
2002
|
return e.reference[o] > e.floating[o] && (r2 = ot(r2)), [r2, ot(r2)];
|
|
1992
2003
|
}
|
|
1993
|
-
function
|
|
2004
|
+
function ce(t) {
|
|
1994
2005
|
const e = ot(t);
|
|
1995
|
-
return [
|
|
2006
|
+
return [gt(t), e, gt(e)];
|
|
1996
2007
|
}
|
|
1997
|
-
function
|
|
1998
|
-
return t.replace(/start|end/g, (e) =>
|
|
2008
|
+
function gt(t) {
|
|
2009
|
+
return t.replace(/start|end/g, (e) => se[e]);
|
|
1999
2010
|
}
|
|
2000
|
-
const
|
|
2001
|
-
function
|
|
2011
|
+
const Et = ["left", "right"], At = ["right", "left"], le = ["top", "bottom"], ae = ["bottom", "top"];
|
|
2012
|
+
function fe(t, e, n) {
|
|
2002
2013
|
switch (t) {
|
|
2003
2014
|
case "top":
|
|
2004
2015
|
case "bottom":
|
|
2005
|
-
return n ? e ?
|
|
2016
|
+
return n ? e ? At : Et : e ? Et : At;
|
|
2006
2017
|
case "left":
|
|
2007
2018
|
case "right":
|
|
2008
|
-
return e ?
|
|
2019
|
+
return e ? le : ae;
|
|
2009
2020
|
default:
|
|
2010
2021
|
return [];
|
|
2011
2022
|
}
|
|
2012
2023
|
}
|
|
2013
|
-
function
|
|
2014
|
-
const s =
|
|
2015
|
-
let o =
|
|
2016
|
-
return s && (o = o.map((r2) => r2 + "-" + s), e && (o = o.concat(o.map(
|
|
2024
|
+
function ue(t, e, n, i) {
|
|
2025
|
+
const s = et(t);
|
|
2026
|
+
let o = fe(I2(t), n === "start", i);
|
|
2027
|
+
return s && (o = o.map((r2) => r2 + "-" + s), e && (o = o.concat(o.map(gt)))), o;
|
|
2017
2028
|
}
|
|
2018
2029
|
function ot(t) {
|
|
2019
|
-
return t.replace(/left|right|bottom|top/g, (e) =>
|
|
2030
|
+
return t.replace(/left|right|bottom|top/g, (e) => ie[e]);
|
|
2020
2031
|
}
|
|
2021
|
-
function
|
|
2032
|
+
function de(t) {
|
|
2022
2033
|
return {
|
|
2023
2034
|
top: 0,
|
|
2024
2035
|
right: 0,
|
|
@@ -2027,8 +2038,8 @@ function pe(t) {
|
|
|
2027
2038
|
...t
|
|
2028
2039
|
};
|
|
2029
2040
|
}
|
|
2030
|
-
function
|
|
2031
|
-
return typeof t != "number" ?
|
|
2041
|
+
function kt(t) {
|
|
2042
|
+
return typeof t != "number" ? de(t) : {
|
|
2032
2043
|
top: t,
|
|
2033
2044
|
right: t,
|
|
2034
2045
|
bottom: t,
|
|
@@ -2058,9 +2069,9 @@ function Ct(t, e, n) {
|
|
|
2058
2069
|
reference: i,
|
|
2059
2070
|
floating: s
|
|
2060
2071
|
} = t;
|
|
2061
|
-
const o = F(e), r2 = yt(e), c2 = wt(r2),
|
|
2072
|
+
const o = F(e), r2 = yt(e), c2 = wt(r2), a2 = I2(e), l2 = o === "y", d2 = i.x + i.width / 2 - s.width / 2, u2 = i.y + i.height / 2 - s.height / 2, h2 = i[c2] / 2 - s[c2] / 2;
|
|
2062
2073
|
let f2;
|
|
2063
|
-
switch (
|
|
2074
|
+
switch (a2) {
|
|
2064
2075
|
case "top":
|
|
2065
2076
|
f2 = {
|
|
2066
2077
|
x: d2,
|
|
@@ -2091,78 +2102,78 @@ function Ct(t, e, n) {
|
|
|
2091
2102
|
y: i.y
|
|
2092
2103
|
};
|
|
2093
2104
|
}
|
|
2094
|
-
switch (
|
|
2105
|
+
switch (et(e)) {
|
|
2095
2106
|
case "start":
|
|
2096
|
-
f2[r2] -=
|
|
2107
|
+
f2[r2] -= h2 * (n && l2 ? -1 : 1);
|
|
2097
2108
|
break;
|
|
2098
2109
|
case "end":
|
|
2099
|
-
f2[r2] +=
|
|
2110
|
+
f2[r2] += h2 * (n && l2 ? -1 : 1);
|
|
2100
2111
|
break;
|
|
2101
2112
|
}
|
|
2102
2113
|
return f2;
|
|
2103
2114
|
}
|
|
2104
|
-
const
|
|
2115
|
+
const he = async (t, e, n) => {
|
|
2105
2116
|
const {
|
|
2106
2117
|
placement: i = "bottom",
|
|
2107
2118
|
strategy: s = "absolute",
|
|
2108
2119
|
middleware: o = [],
|
|
2109
2120
|
platform: r2
|
|
2110
|
-
} = n, c2 = o.filter(Boolean),
|
|
2111
|
-
let
|
|
2121
|
+
} = n, c2 = o.filter(Boolean), a2 = await (r2.isRTL == null ? void 0 : r2.isRTL(e));
|
|
2122
|
+
let l2 = await r2.getElementRects({
|
|
2112
2123
|
reference: t,
|
|
2113
2124
|
floating: e,
|
|
2114
2125
|
strategy: s
|
|
2115
2126
|
}), {
|
|
2116
2127
|
x: d2,
|
|
2117
2128
|
y: u2
|
|
2118
|
-
} = Ct(
|
|
2129
|
+
} = Ct(l2, i, a2), h2 = i, f2 = {}, g3 = 0;
|
|
2119
2130
|
for (let m2 = 0; m2 < c2.length; m2++) {
|
|
2120
2131
|
const {
|
|
2121
2132
|
name: p2,
|
|
2122
|
-
fn:
|
|
2133
|
+
fn: w2
|
|
2123
2134
|
} = c2[m2], {
|
|
2124
|
-
x:
|
|
2125
|
-
y:
|
|
2126
|
-
data:
|
|
2127
|
-
reset:
|
|
2128
|
-
} = await
|
|
2135
|
+
x: y2,
|
|
2136
|
+
y: x3,
|
|
2137
|
+
data: b2,
|
|
2138
|
+
reset: v2
|
|
2139
|
+
} = await w2({
|
|
2129
2140
|
x: d2,
|
|
2130
2141
|
y: u2,
|
|
2131
2142
|
initialPlacement: i,
|
|
2132
|
-
placement:
|
|
2143
|
+
placement: h2,
|
|
2133
2144
|
strategy: s,
|
|
2134
2145
|
middlewareData: f2,
|
|
2135
|
-
rects:
|
|
2146
|
+
rects: l2,
|
|
2136
2147
|
platform: r2,
|
|
2137
2148
|
elements: {
|
|
2138
2149
|
reference: t,
|
|
2139
2150
|
floating: e
|
|
2140
2151
|
}
|
|
2141
2152
|
});
|
|
2142
|
-
d2 =
|
|
2153
|
+
d2 = y2 ?? d2, u2 = x3 ?? u2, f2 = {
|
|
2143
2154
|
...f2,
|
|
2144
2155
|
[p2]: {
|
|
2145
2156
|
...f2[p2],
|
|
2146
|
-
...
|
|
2157
|
+
...b2
|
|
2147
2158
|
}
|
|
2148
|
-
},
|
|
2159
|
+
}, v2 && g3 <= 50 && (g3++, typeof v2 == "object" && (v2.placement && (h2 = v2.placement), v2.rects && (l2 = v2.rects === true ? await r2.getElementRects({
|
|
2149
2160
|
reference: t,
|
|
2150
2161
|
floating: e,
|
|
2151
2162
|
strategy: s
|
|
2152
|
-
}) :
|
|
2163
|
+
}) : v2.rects), {
|
|
2153
2164
|
x: d2,
|
|
2154
2165
|
y: u2
|
|
2155
|
-
} = Ct(
|
|
2166
|
+
} = Ct(l2, h2, a2)), m2 = -1);
|
|
2156
2167
|
}
|
|
2157
2168
|
return {
|
|
2158
2169
|
x: d2,
|
|
2159
2170
|
y: u2,
|
|
2160
|
-
placement:
|
|
2171
|
+
placement: h2,
|
|
2161
2172
|
strategy: s,
|
|
2162
2173
|
middlewareData: f2
|
|
2163
2174
|
};
|
|
2164
2175
|
};
|
|
2165
|
-
async function
|
|
2176
|
+
async function Dt(t, e) {
|
|
2166
2177
|
var n;
|
|
2167
2178
|
e === void 0 && (e = {});
|
|
2168
2179
|
const {
|
|
@@ -2171,43 +2182,43 @@ async function $t(t, e) {
|
|
|
2171
2182
|
platform: o,
|
|
2172
2183
|
rects: r2,
|
|
2173
2184
|
elements: c2,
|
|
2174
|
-
strategy:
|
|
2185
|
+
strategy: a2
|
|
2175
2186
|
} = t, {
|
|
2176
|
-
boundary:
|
|
2187
|
+
boundary: l2 = "clippingAncestors",
|
|
2177
2188
|
rootBoundary: d2 = "viewport",
|
|
2178
2189
|
elementContext: u2 = "floating",
|
|
2179
|
-
altBoundary:
|
|
2190
|
+
altBoundary: h2 = false,
|
|
2180
2191
|
padding: f2 = 0
|
|
2181
|
-
} =
|
|
2192
|
+
} = X(e, t), g3 = kt(f2), p2 = c2[h2 ? u2 === "floating" ? "reference" : "floating" : u2], w2 = rt(await o.getClippingRect({
|
|
2182
2193
|
element: (n = await (o.isElement == null ? void 0 : o.isElement(p2))) == null || n ? p2 : p2.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(c2.floating)),
|
|
2183
|
-
boundary:
|
|
2194
|
+
boundary: l2,
|
|
2184
2195
|
rootBoundary: d2,
|
|
2185
|
-
strategy:
|
|
2186
|
-
})),
|
|
2196
|
+
strategy: a2
|
|
2197
|
+
})), y2 = u2 === "floating" ? {
|
|
2187
2198
|
x: i,
|
|
2188
2199
|
y: s,
|
|
2189
2200
|
width: r2.floating.width,
|
|
2190
2201
|
height: r2.floating.height
|
|
2191
|
-
} : r2.reference,
|
|
2202
|
+
} : r2.reference, x3 = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c2.floating)), b2 = await (o.isElement == null ? void 0 : o.isElement(x3)) ? await (o.getScale == null ? void 0 : o.getScale(x3)) || {
|
|
2192
2203
|
x: 1,
|
|
2193
2204
|
y: 1
|
|
2194
2205
|
} : {
|
|
2195
2206
|
x: 1,
|
|
2196
2207
|
y: 1
|
|
2197
|
-
},
|
|
2208
|
+
}, v2 = rt(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
2198
2209
|
elements: c2,
|
|
2199
|
-
rect:
|
|
2200
|
-
offsetParent:
|
|
2201
|
-
strategy:
|
|
2202
|
-
}) :
|
|
2210
|
+
rect: y2,
|
|
2211
|
+
offsetParent: x3,
|
|
2212
|
+
strategy: a2
|
|
2213
|
+
}) : y2);
|
|
2203
2214
|
return {
|
|
2204
|
-
top: (
|
|
2205
|
-
bottom: (
|
|
2206
|
-
left: (
|
|
2207
|
-
right: (
|
|
2215
|
+
top: (w2.top - v2.top + g3.top) / b2.y,
|
|
2216
|
+
bottom: (v2.bottom - w2.bottom + g3.bottom) / b2.y,
|
|
2217
|
+
left: (w2.left - v2.left + g3.left) / b2.x,
|
|
2218
|
+
right: (v2.right - w2.right + g3.right) / b2.x
|
|
2208
2219
|
};
|
|
2209
2220
|
}
|
|
2210
|
-
const
|
|
2221
|
+
const ge = (t) => ({
|
|
2211
2222
|
name: "arrow",
|
|
2212
2223
|
options: t,
|
|
2213
2224
|
async fn(e) {
|
|
@@ -2218,33 +2229,33 @@ const ye = (t) => ({
|
|
|
2218
2229
|
rects: o,
|
|
2219
2230
|
platform: r2,
|
|
2220
2231
|
elements: c2,
|
|
2221
|
-
middlewareData:
|
|
2232
|
+
middlewareData: a2
|
|
2222
2233
|
} = e, {
|
|
2223
|
-
element:
|
|
2234
|
+
element: l2,
|
|
2224
2235
|
padding: d2 = 0
|
|
2225
|
-
} =
|
|
2226
|
-
if (
|
|
2236
|
+
} = X(t, e) || {};
|
|
2237
|
+
if (l2 == null)
|
|
2227
2238
|
return {};
|
|
2228
|
-
const u2 =
|
|
2239
|
+
const u2 = kt(d2), h2 = {
|
|
2229
2240
|
x: n,
|
|
2230
2241
|
y: i
|
|
2231
|
-
}, f2 = yt(s),
|
|
2232
|
-
let
|
|
2233
|
-
(!
|
|
2234
|
-
const
|
|
2242
|
+
}, f2 = yt(s), g3 = wt(f2), m2 = await r2.getDimensions(l2), p2 = f2 === "y", w2 = p2 ? "top" : "left", y2 = p2 ? "bottom" : "right", x3 = p2 ? "clientHeight" : "clientWidth", b2 = o.reference[g3] + o.reference[f2] - h2[f2] - o.floating[g3], v2 = h2[f2] - o.reference[f2], C2 = await (r2.getOffsetParent == null ? void 0 : r2.getOffsetParent(l2));
|
|
2243
|
+
let L4 = C2 ? C2[x3] : 0;
|
|
2244
|
+
(!L4 || !await (r2.isElement == null ? void 0 : r2.isElement(C2))) && (L4 = c2.floating[x3] || o.floating[g3]);
|
|
2245
|
+
const G2 = b2 / 2 - v2 / 2, V2 = L4 / 2 - m2[g3] / 2 - 1, M2 = j(u2[w2], V2), Q2 = j(u2[y2], V2), B2 = M2, Z2 = L4 - m2[g3] - Q2, E2 = L4 / 2 - m2[g3] / 2 + G2, _2 = ht(B2, E2, Z2), $2 = !a2.arrow && et(s) != null && E2 !== _2 && o.reference[g3] / 2 - (E2 < B2 ? M2 : Q2) - m2[g3] / 2 < 0, O3 = $2 ? E2 < B2 ? E2 - B2 : E2 - Z2 : 0;
|
|
2235
2246
|
return {
|
|
2236
|
-
[f2]:
|
|
2247
|
+
[f2]: h2[f2] + O3,
|
|
2237
2248
|
data: {
|
|
2238
2249
|
[f2]: _2,
|
|
2239
|
-
centerOffset:
|
|
2250
|
+
centerOffset: E2 - _2 - O3,
|
|
2240
2251
|
...$2 && {
|
|
2241
|
-
alignmentOffset:
|
|
2252
|
+
alignmentOffset: O3
|
|
2242
2253
|
}
|
|
2243
2254
|
},
|
|
2244
2255
|
reset: $2
|
|
2245
2256
|
};
|
|
2246
2257
|
}
|
|
2247
|
-
}),
|
|
2258
|
+
}), me = function(t) {
|
|
2248
2259
|
return t === void 0 && (t = {}), {
|
|
2249
2260
|
name: "flip",
|
|
2250
2261
|
options: t,
|
|
@@ -2255,60 +2266,60 @@ const ye = (t) => ({
|
|
|
2255
2266
|
middlewareData: o,
|
|
2256
2267
|
rects: r2,
|
|
2257
2268
|
initialPlacement: c2,
|
|
2258
|
-
platform:
|
|
2259
|
-
elements:
|
|
2269
|
+
platform: a2,
|
|
2270
|
+
elements: l2
|
|
2260
2271
|
} = e, {
|
|
2261
2272
|
mainAxis: d2 = true,
|
|
2262
2273
|
crossAxis: u2 = true,
|
|
2263
|
-
fallbackPlacements:
|
|
2274
|
+
fallbackPlacements: h2,
|
|
2264
2275
|
fallbackStrategy: f2 = "bestFit",
|
|
2265
|
-
fallbackAxisSideDirection:
|
|
2276
|
+
fallbackAxisSideDirection: g3 = "none",
|
|
2266
2277
|
flipAlignment: m2 = true,
|
|
2267
2278
|
...p2
|
|
2268
|
-
} =
|
|
2279
|
+
} = X(t, e);
|
|
2269
2280
|
if ((n = o.arrow) != null && n.alignmentOffset)
|
|
2270
2281
|
return {};
|
|
2271
|
-
const
|
|
2272
|
-
!
|
|
2273
|
-
const
|
|
2282
|
+
const w2 = I2(s), y2 = F(c2), x3 = I2(c2) === c2, b2 = await (a2.isRTL == null ? void 0 : a2.isRTL(l2.floating)), v2 = h2 || (x3 || !m2 ? [ot(c2)] : ce(c2)), C2 = g3 !== "none";
|
|
2283
|
+
!h2 && C2 && v2.push(...ue(c2, m2, g3, b2));
|
|
2284
|
+
const L4 = [c2, ...v2], G2 = await Dt(e, p2), V2 = [];
|
|
2274
2285
|
let M2 = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
2275
|
-
if (d2 &&
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2286
|
+
if (d2 && V2.push(G2[w2]), u2) {
|
|
2287
|
+
const E2 = re(s, r2, b2);
|
|
2288
|
+
V2.push(G2[E2[0]], G2[E2[1]]);
|
|
2278
2289
|
}
|
|
2279
2290
|
if (M2 = [...M2, {
|
|
2280
2291
|
placement: s,
|
|
2281
|
-
overflows:
|
|
2282
|
-
}], !
|
|
2283
|
-
var
|
|
2284
|
-
const
|
|
2285
|
-
if (_2 && (!(u2 === "alignment" ?
|
|
2292
|
+
overflows: V2
|
|
2293
|
+
}], !V2.every((E2) => E2 <= 0)) {
|
|
2294
|
+
var Q2, B2;
|
|
2295
|
+
const E2 = (((Q2 = o.flip) == null ? void 0 : Q2.index) || 0) + 1, _2 = L4[E2];
|
|
2296
|
+
if (_2 && (!(u2 === "alignment" ? y2 !== F(_2) : false) || // We leave the current main axis only if every placement on that axis
|
|
2286
2297
|
// overflows the main axis.
|
|
2287
|
-
M2.every((
|
|
2298
|
+
M2.every((T2) => F(T2.placement) === y2 ? T2.overflows[0] > 0 : true)))
|
|
2288
2299
|
return {
|
|
2289
2300
|
data: {
|
|
2290
|
-
index:
|
|
2301
|
+
index: E2,
|
|
2291
2302
|
overflows: M2
|
|
2292
2303
|
},
|
|
2293
2304
|
reset: {
|
|
2294
2305
|
placement: _2
|
|
2295
2306
|
}
|
|
2296
2307
|
};
|
|
2297
|
-
let $2 = (B2 = M2.filter((
|
|
2308
|
+
let $2 = (B2 = M2.filter((O3) => O3.overflows[0] <= 0).sort((O3, T2) => O3.overflows[1] - T2.overflows[1])[0]) == null ? void 0 : B2.placement;
|
|
2298
2309
|
if (!$2)
|
|
2299
2310
|
switch (f2) {
|
|
2300
2311
|
case "bestFit": {
|
|
2301
|
-
var
|
|
2302
|
-
const
|
|
2312
|
+
var Z2;
|
|
2313
|
+
const O3 = (Z2 = M2.filter((T2) => {
|
|
2303
2314
|
if (C2) {
|
|
2304
|
-
const
|
|
2305
|
-
return
|
|
2315
|
+
const H2 = F(T2.placement);
|
|
2316
|
+
return H2 === y2 || // Create a bias to the `y` side axis due to horizontal
|
|
2306
2317
|
// reading directions favoring greater width.
|
|
2307
|
-
|
|
2318
|
+
H2 === "y";
|
|
2308
2319
|
}
|
|
2309
2320
|
return true;
|
|
2310
|
-
}).map((
|
|
2311
|
-
|
|
2321
|
+
}).map((T2) => [T2.placement, T2.overflows.filter((H2) => H2 > 0).reduce((H2, Yt) => H2 + Yt, 0)]).sort((T2, H2) => T2[1] - H2[1])[0]) == null ? void 0 : Z2[0];
|
|
2322
|
+
O3 && ($2 = O3);
|
|
2312
2323
|
break;
|
|
2313
2324
|
}
|
|
2314
2325
|
case "initialPlacement":
|
|
@@ -2325,17 +2336,17 @@ const ye = (t) => ({
|
|
|
2325
2336
|
return {};
|
|
2326
2337
|
}
|
|
2327
2338
|
};
|
|
2328
|
-
},
|
|
2329
|
-
async function
|
|
2339
|
+
}, Mt = /* @__PURE__ */ new Set(["left", "top"]);
|
|
2340
|
+
async function pe(t, e) {
|
|
2330
2341
|
const {
|
|
2331
2342
|
placement: n,
|
|
2332
2343
|
platform: i,
|
|
2333
2344
|
elements: s
|
|
2334
|
-
} = t, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r2 = I2(n), c2 =
|
|
2345
|
+
} = t, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r2 = I2(n), c2 = et(n), a2 = F(n) === "y", l2 = Mt.has(r2) ? -1 : 1, d2 = o && a2 ? -1 : 1, u2 = X(e, t);
|
|
2335
2346
|
let {
|
|
2336
|
-
mainAxis:
|
|
2347
|
+
mainAxis: h2,
|
|
2337
2348
|
crossAxis: f2,
|
|
2338
|
-
alignmentAxis:
|
|
2349
|
+
alignmentAxis: g3
|
|
2339
2350
|
} = typeof u2 == "number" ? {
|
|
2340
2351
|
mainAxis: u2,
|
|
2341
2352
|
crossAxis: 0,
|
|
@@ -2345,15 +2356,15 @@ async function be(t, e) {
|
|
|
2345
2356
|
crossAxis: u2.crossAxis || 0,
|
|
2346
2357
|
alignmentAxis: u2.alignmentAxis
|
|
2347
2358
|
};
|
|
2348
|
-
return c2 && typeof
|
|
2359
|
+
return c2 && typeof g3 == "number" && (f2 = c2 === "end" ? g3 * -1 : g3), a2 ? {
|
|
2349
2360
|
x: f2 * d2,
|
|
2350
|
-
y:
|
|
2361
|
+
y: h2 * l2
|
|
2351
2362
|
} : {
|
|
2352
|
-
x:
|
|
2363
|
+
x: h2 * l2,
|
|
2353
2364
|
y: f2 * d2
|
|
2354
2365
|
};
|
|
2355
2366
|
}
|
|
2356
|
-
const
|
|
2367
|
+
const we = function(t) {
|
|
2357
2368
|
return t === void 0 && (t = 0), {
|
|
2358
2369
|
name: "offset",
|
|
2359
2370
|
options: t,
|
|
@@ -2364,18 +2375,18 @@ const ve = function(t) {
|
|
|
2364
2375
|
y: o,
|
|
2365
2376
|
placement: r2,
|
|
2366
2377
|
middlewareData: c2
|
|
2367
|
-
} = e,
|
|
2378
|
+
} = e, a2 = await pe(e, t);
|
|
2368
2379
|
return r2 === ((n = c2.offset) == null ? void 0 : n.placement) && (i = c2.arrow) != null && i.alignmentOffset ? {} : {
|
|
2369
|
-
x: s +
|
|
2370
|
-
y: o +
|
|
2380
|
+
x: s + a2.x,
|
|
2381
|
+
y: o + a2.y,
|
|
2371
2382
|
data: {
|
|
2372
|
-
...
|
|
2383
|
+
...a2,
|
|
2373
2384
|
placement: r2
|
|
2374
2385
|
}
|
|
2375
2386
|
};
|
|
2376
2387
|
}
|
|
2377
2388
|
};
|
|
2378
|
-
},
|
|
2389
|
+
}, ye = function(t) {
|
|
2379
2390
|
return t === void 0 && (t = {}), {
|
|
2380
2391
|
name: "shift",
|
|
2381
2392
|
options: t,
|
|
@@ -2390,33 +2401,33 @@ const ve = function(t) {
|
|
|
2390
2401
|
limiter: c2 = {
|
|
2391
2402
|
fn: (p2) => {
|
|
2392
2403
|
let {
|
|
2393
|
-
x:
|
|
2394
|
-
y:
|
|
2404
|
+
x: w2,
|
|
2405
|
+
y: y2
|
|
2395
2406
|
} = p2;
|
|
2396
2407
|
return {
|
|
2397
|
-
x:
|
|
2398
|
-
y:
|
|
2408
|
+
x: w2,
|
|
2409
|
+
y: y2
|
|
2399
2410
|
};
|
|
2400
2411
|
}
|
|
2401
2412
|
},
|
|
2402
|
-
...
|
|
2403
|
-
} =
|
|
2413
|
+
...a2
|
|
2414
|
+
} = X(t, e), l2 = {
|
|
2404
2415
|
x: n,
|
|
2405
2416
|
y: i
|
|
2406
|
-
}, d2 = await
|
|
2407
|
-
let f2 =
|
|
2417
|
+
}, d2 = await Dt(e, a2), u2 = F(I2(s)), h2 = pt(u2);
|
|
2418
|
+
let f2 = l2[h2], g3 = l2[u2];
|
|
2408
2419
|
if (o) {
|
|
2409
|
-
const p2 =
|
|
2410
|
-
f2 =
|
|
2420
|
+
const p2 = h2 === "y" ? "top" : "left", w2 = h2 === "y" ? "bottom" : "right", y2 = f2 + d2[p2], x3 = f2 - d2[w2];
|
|
2421
|
+
f2 = ht(y2, f2, x3);
|
|
2411
2422
|
}
|
|
2412
2423
|
if (r2) {
|
|
2413
|
-
const p2 = u2 === "y" ? "top" : "left",
|
|
2414
|
-
|
|
2424
|
+
const p2 = u2 === "y" ? "top" : "left", w2 = u2 === "y" ? "bottom" : "right", y2 = g3 + d2[p2], x3 = g3 - d2[w2];
|
|
2425
|
+
g3 = ht(y2, g3, x3);
|
|
2415
2426
|
}
|
|
2416
2427
|
const m2 = c2.fn({
|
|
2417
2428
|
...e,
|
|
2418
|
-
[
|
|
2419
|
-
[u2]:
|
|
2429
|
+
[h2]: f2,
|
|
2430
|
+
[u2]: g3
|
|
2420
2431
|
});
|
|
2421
2432
|
return {
|
|
2422
2433
|
...m2,
|
|
@@ -2424,14 +2435,14 @@ const ve = function(t) {
|
|
|
2424
2435
|
x: m2.x - n,
|
|
2425
2436
|
y: m2.y - i,
|
|
2426
2437
|
enabled: {
|
|
2427
|
-
[
|
|
2438
|
+
[h2]: o,
|
|
2428
2439
|
[u2]: r2
|
|
2429
2440
|
}
|
|
2430
2441
|
}
|
|
2431
2442
|
};
|
|
2432
2443
|
}
|
|
2433
2444
|
};
|
|
2434
|
-
},
|
|
2445
|
+
}, xe = function(t) {
|
|
2435
2446
|
return t === void 0 && (t = {}), {
|
|
2436
2447
|
options: t,
|
|
2437
2448
|
fn(e) {
|
|
@@ -2443,14 +2454,14 @@ const ve = function(t) {
|
|
|
2443
2454
|
middlewareData: r2
|
|
2444
2455
|
} = e, {
|
|
2445
2456
|
offset: c2 = 0,
|
|
2446
|
-
mainAxis:
|
|
2447
|
-
crossAxis:
|
|
2448
|
-
} =
|
|
2457
|
+
mainAxis: a2 = true,
|
|
2458
|
+
crossAxis: l2 = true
|
|
2459
|
+
} = X(t, e), d2 = {
|
|
2449
2460
|
x: n,
|
|
2450
2461
|
y: i
|
|
2451
|
-
}, u2 = F(s),
|
|
2452
|
-
let f2 = d2[
|
|
2453
|
-
const m2 =
|
|
2462
|
+
}, u2 = F(s), h2 = pt(u2);
|
|
2463
|
+
let f2 = d2[h2], g3 = d2[u2];
|
|
2464
|
+
const m2 = X(c2, e), p2 = typeof m2 == "number" ? {
|
|
2454
2465
|
mainAxis: m2,
|
|
2455
2466
|
crossAxis: 0
|
|
2456
2467
|
} : {
|
|
@@ -2458,18 +2469,18 @@ const ve = function(t) {
|
|
|
2458
2469
|
crossAxis: 0,
|
|
2459
2470
|
...m2
|
|
2460
2471
|
};
|
|
2461
|
-
if (l) {
|
|
2462
|
-
const x2 = g2 === "y" ? "height" : "width", v2 = o.reference[g2] - o.floating[x2] + p2.mainAxis, b2 = o.reference[g2] + o.reference[x2] - p2.mainAxis;
|
|
2463
|
-
f2 < v2 ? f2 = v2 : f2 > b2 && (f2 = b2);
|
|
2464
|
-
}
|
|
2465
2472
|
if (a2) {
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2473
|
+
const x3 = h2 === "y" ? "height" : "width", b2 = o.reference[h2] - o.floating[x3] + p2.mainAxis, v2 = o.reference[h2] + o.reference[x3] - p2.mainAxis;
|
|
2474
|
+
f2 < b2 ? f2 = b2 : f2 > v2 && (f2 = v2);
|
|
2475
|
+
}
|
|
2476
|
+
if (l2) {
|
|
2477
|
+
var w2, y2;
|
|
2478
|
+
const x3 = h2 === "y" ? "width" : "height", b2 = Mt.has(I2(s)), v2 = o.reference[u2] - o.floating[x3] + (b2 && ((w2 = r2.offset) == null ? void 0 : w2[u2]) || 0) + (b2 ? 0 : p2.crossAxis), C2 = o.reference[u2] + o.reference[x3] + (b2 ? 0 : ((y2 = r2.offset) == null ? void 0 : y2[u2]) || 0) - (b2 ? p2.crossAxis : 0);
|
|
2479
|
+
g3 < v2 ? g3 = v2 : g3 > C2 && (g3 = C2);
|
|
2469
2480
|
}
|
|
2470
2481
|
return {
|
|
2471
|
-
[
|
|
2472
|
-
[u2]:
|
|
2482
|
+
[h2]: f2,
|
|
2483
|
+
[u2]: g3
|
|
2473
2484
|
};
|
|
2474
2485
|
}
|
|
2475
2486
|
};
|
|
@@ -2478,45 +2489,45 @@ function ct() {
|
|
|
2478
2489
|
return typeof window < "u";
|
|
2479
2490
|
}
|
|
2480
2491
|
function J(t) {
|
|
2481
|
-
return
|
|
2492
|
+
return $t(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
2482
2493
|
}
|
|
2483
|
-
function
|
|
2494
|
+
function A3(t) {
|
|
2484
2495
|
var e;
|
|
2485
2496
|
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
2486
2497
|
}
|
|
2487
2498
|
function D2(t) {
|
|
2488
2499
|
var e;
|
|
2489
|
-
return (e = (
|
|
2500
|
+
return (e = ($t(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
2490
2501
|
}
|
|
2491
|
-
function
|
|
2492
|
-
return ct() ? t instanceof Node || t instanceof
|
|
2502
|
+
function $t(t) {
|
|
2503
|
+
return ct() ? t instanceof Node || t instanceof A3(t).Node : false;
|
|
2493
2504
|
}
|
|
2494
|
-
function
|
|
2495
|
-
return ct() ? t instanceof Element || t instanceof
|
|
2505
|
+
function S2(t) {
|
|
2506
|
+
return ct() ? t instanceof Element || t instanceof A3(t).Element : false;
|
|
2496
2507
|
}
|
|
2497
2508
|
function k(t) {
|
|
2498
|
-
return ct() ? t instanceof HTMLElement || t instanceof
|
|
2509
|
+
return ct() ? t instanceof HTMLElement || t instanceof A3(t).HTMLElement : false;
|
|
2499
2510
|
}
|
|
2500
|
-
function
|
|
2501
|
-
return !ct() || typeof ShadowRoot > "u" ? false : t instanceof ShadowRoot || t instanceof
|
|
2511
|
+
function Lt(t) {
|
|
2512
|
+
return !ct() || typeof ShadowRoot > "u" ? false : t instanceof ShadowRoot || t instanceof A3(t).ShadowRoot;
|
|
2502
2513
|
}
|
|
2503
|
-
const
|
|
2514
|
+
const ve = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
2504
2515
|
function nt(t) {
|
|
2505
2516
|
const {
|
|
2506
2517
|
overflow: e,
|
|
2507
2518
|
overflowX: n,
|
|
2508
2519
|
overflowY: i,
|
|
2509
2520
|
display: s
|
|
2510
|
-
} =
|
|
2511
|
-
return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && !
|
|
2521
|
+
} = R(t);
|
|
2522
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && !ve.has(s);
|
|
2512
2523
|
}
|
|
2513
|
-
const
|
|
2514
|
-
function
|
|
2515
|
-
return
|
|
2524
|
+
const be = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
2525
|
+
function Ee(t) {
|
|
2526
|
+
return be.has(J(t));
|
|
2516
2527
|
}
|
|
2517
|
-
const
|
|
2528
|
+
const Ae = [":popover-open", ":modal"];
|
|
2518
2529
|
function lt(t) {
|
|
2519
|
-
return
|
|
2530
|
+
return Ae.some((e) => {
|
|
2520
2531
|
try {
|
|
2521
2532
|
return t.matches(e);
|
|
2522
2533
|
} catch {
|
|
@@ -2524,34 +2535,34 @@ function lt(t) {
|
|
|
2524
2535
|
}
|
|
2525
2536
|
});
|
|
2526
2537
|
}
|
|
2527
|
-
const
|
|
2538
|
+
const Ce = ["transform", "translate", "scale", "rotate", "perspective"], Le = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Oe = ["paint", "layout", "strict", "content"];
|
|
2528
2539
|
function xt(t) {
|
|
2529
|
-
const e =
|
|
2530
|
-
return
|
|
2540
|
+
const e = vt(), n = S2(t) ? R(t) : t;
|
|
2541
|
+
return Ce.some((i) => n[i] ? n[i] !== "none" : false) || (n.containerType ? n.containerType !== "normal" : false) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : false) || !e && (n.filter ? n.filter !== "none" : false) || Le.some((i) => (n.willChange || "").includes(i)) || Oe.some((i) => (n.contain || "").includes(i));
|
|
2531
2542
|
}
|
|
2532
|
-
function
|
|
2533
|
-
let e =
|
|
2543
|
+
function Te(t) {
|
|
2544
|
+
let e = W(t);
|
|
2534
2545
|
for (; k(e) && !K(e); ) {
|
|
2535
2546
|
if (xt(e))
|
|
2536
2547
|
return e;
|
|
2537
2548
|
if (lt(e))
|
|
2538
2549
|
return null;
|
|
2539
|
-
e =
|
|
2550
|
+
e = W(e);
|
|
2540
2551
|
}
|
|
2541
2552
|
return null;
|
|
2542
2553
|
}
|
|
2543
|
-
function
|
|
2554
|
+
function vt() {
|
|
2544
2555
|
return typeof CSS > "u" || !CSS.supports ? false : CSS.supports("-webkit-backdrop-filter", "none");
|
|
2545
2556
|
}
|
|
2546
|
-
const
|
|
2557
|
+
const Se = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
2547
2558
|
function K(t) {
|
|
2548
|
-
return
|
|
2559
|
+
return Se.has(J(t));
|
|
2549
2560
|
}
|
|
2550
|
-
function
|
|
2551
|
-
return
|
|
2561
|
+
function R(t) {
|
|
2562
|
+
return A3(t).getComputedStyle(t);
|
|
2552
2563
|
}
|
|
2553
2564
|
function at(t) {
|
|
2554
|
-
return
|
|
2565
|
+
return S2(t) ? {
|
|
2555
2566
|
scrollLeft: t.scrollLeft,
|
|
2556
2567
|
scrollTop: t.scrollTop
|
|
2557
2568
|
} : {
|
|
@@ -2559,26 +2570,26 @@ function at(t) {
|
|
|
2559
2570
|
scrollTop: t.scrollY
|
|
2560
2571
|
};
|
|
2561
2572
|
}
|
|
2562
|
-
function
|
|
2573
|
+
function W(t) {
|
|
2563
2574
|
if (J(t) === "html")
|
|
2564
2575
|
return t;
|
|
2565
2576
|
const e = (
|
|
2566
2577
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
2567
2578
|
t.assignedSlot || // DOM Element detected.
|
|
2568
2579
|
t.parentNode || // ShadowRoot detected.
|
|
2569
|
-
|
|
2580
|
+
Lt(t) && t.host || // Fallback.
|
|
2570
2581
|
D2(t)
|
|
2571
2582
|
);
|
|
2572
|
-
return
|
|
2583
|
+
return Lt(e) ? e.host : e;
|
|
2573
2584
|
}
|
|
2574
|
-
function
|
|
2575
|
-
const e =
|
|
2576
|
-
return K(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k(e) && nt(e) ? e :
|
|
2585
|
+
function Ft(t) {
|
|
2586
|
+
const e = W(t);
|
|
2587
|
+
return K(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k(e) && nt(e) ? e : Ft(e);
|
|
2577
2588
|
}
|
|
2578
2589
|
function tt(t, e, n) {
|
|
2579
2590
|
var i;
|
|
2580
2591
|
e === void 0 && (e = []), n === void 0 && (n = true);
|
|
2581
|
-
const s =
|
|
2592
|
+
const s = Ft(t), o = s === ((i = t.ownerDocument) == null ? void 0 : i.body), r2 = A3(s);
|
|
2582
2593
|
if (o) {
|
|
2583
2594
|
const c2 = mt(r2);
|
|
2584
2595
|
return e.concat(r2, r2.visualViewport || [], nt(s) ? s : [], c2 && n ? tt(c2) : []);
|
|
@@ -2588,79 +2599,79 @@ function tt(t, e, n) {
|
|
|
2588
2599
|
function mt(t) {
|
|
2589
2600
|
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
2590
2601
|
}
|
|
2591
|
-
function
|
|
2592
|
-
const e =
|
|
2602
|
+
function Ht(t) {
|
|
2603
|
+
const e = R(t);
|
|
2593
2604
|
let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
|
|
2594
|
-
const s = k(t), o = s ? t.offsetWidth : n, r2 = s ? t.offsetHeight : i, c2 =
|
|
2605
|
+
const s = k(t), o = s ? t.offsetWidth : n, r2 = s ? t.offsetHeight : i, c2 = st2(n) !== o || st2(i) !== r2;
|
|
2595
2606
|
return c2 && (n = o, i = r2), {
|
|
2596
2607
|
width: n,
|
|
2597
2608
|
height: i,
|
|
2598
2609
|
$: c2
|
|
2599
2610
|
};
|
|
2600
2611
|
}
|
|
2601
|
-
function
|
|
2602
|
-
return
|
|
2612
|
+
function bt(t) {
|
|
2613
|
+
return S2(t) ? t : t.contextElement;
|
|
2603
2614
|
}
|
|
2604
|
-
function
|
|
2605
|
-
const e =
|
|
2615
|
+
function Y(t) {
|
|
2616
|
+
const e = bt(t);
|
|
2606
2617
|
if (!k(e))
|
|
2607
|
-
return
|
|
2618
|
+
return P2(1);
|
|
2608
2619
|
const n = e.getBoundingClientRect(), {
|
|
2609
2620
|
width: i,
|
|
2610
2621
|
height: s,
|
|
2611
2622
|
$: o
|
|
2612
|
-
} =
|
|
2613
|
-
let r2 = (o ?
|
|
2623
|
+
} = Ht(e);
|
|
2624
|
+
let r2 = (o ? st2(n.width) : n.width) / i, c2 = (o ? st2(n.height) : n.height) / s;
|
|
2614
2625
|
return (!r2 || !Number.isFinite(r2)) && (r2 = 1), (!c2 || !Number.isFinite(c2)) && (c2 = 1), {
|
|
2615
2626
|
x: r2,
|
|
2616
2627
|
y: c2
|
|
2617
2628
|
};
|
|
2618
2629
|
}
|
|
2619
|
-
const
|
|
2620
|
-
function
|
|
2621
|
-
const e =
|
|
2622
|
-
return !
|
|
2630
|
+
const Re = /* @__PURE__ */ P2(0);
|
|
2631
|
+
function Nt(t) {
|
|
2632
|
+
const e = A3(t);
|
|
2633
|
+
return !vt() || !e.visualViewport ? Re : {
|
|
2623
2634
|
x: e.visualViewport.offsetLeft,
|
|
2624
2635
|
y: e.visualViewport.offsetTop
|
|
2625
2636
|
};
|
|
2626
2637
|
}
|
|
2627
|
-
function
|
|
2628
|
-
return e === void 0 && (e = false), !n || e && n !==
|
|
2638
|
+
function Pe(t, e, n) {
|
|
2639
|
+
return e === void 0 && (e = false), !n || e && n !== A3(t) ? false : e;
|
|
2629
2640
|
}
|
|
2630
2641
|
function U2(t, e, n, i) {
|
|
2631
2642
|
e === void 0 && (e = false), n === void 0 && (n = false);
|
|
2632
|
-
const s = t.getBoundingClientRect(), o =
|
|
2633
|
-
let r2 =
|
|
2634
|
-
e && (i ?
|
|
2635
|
-
const c2 =
|
|
2636
|
-
let
|
|
2643
|
+
const s = t.getBoundingClientRect(), o = bt(t);
|
|
2644
|
+
let r2 = P2(1);
|
|
2645
|
+
e && (i ? S2(i) && (r2 = Y(i)) : r2 = Y(t));
|
|
2646
|
+
const c2 = Pe(o, n, i) ? Nt(o) : P2(0);
|
|
2647
|
+
let a2 = (s.left + c2.x) / r2.x, l2 = (s.top + c2.y) / r2.y, d2 = s.width / r2.x, u2 = s.height / r2.y;
|
|
2637
2648
|
if (o) {
|
|
2638
|
-
const
|
|
2639
|
-
let
|
|
2640
|
-
for (; m2 && i && f2 !==
|
|
2641
|
-
const p2 =
|
|
2642
|
-
|
|
2649
|
+
const h2 = A3(o), f2 = i && S2(i) ? A3(i) : i;
|
|
2650
|
+
let g3 = h2, m2 = mt(g3);
|
|
2651
|
+
for (; m2 && i && f2 !== g3; ) {
|
|
2652
|
+
const p2 = Y(m2), w2 = m2.getBoundingClientRect(), y2 = R(m2), x3 = w2.left + (m2.clientLeft + parseFloat(y2.paddingLeft)) * p2.x, b2 = w2.top + (m2.clientTop + parseFloat(y2.paddingTop)) * p2.y;
|
|
2653
|
+
a2 *= p2.x, l2 *= p2.y, d2 *= p2.x, u2 *= p2.y, a2 += x3, l2 += b2, g3 = A3(m2), m2 = mt(g3);
|
|
2643
2654
|
}
|
|
2644
2655
|
}
|
|
2645
2656
|
return rt({
|
|
2646
2657
|
width: d2,
|
|
2647
2658
|
height: u2,
|
|
2648
|
-
x:
|
|
2649
|
-
y:
|
|
2659
|
+
x: a2,
|
|
2660
|
+
y: l2
|
|
2650
2661
|
});
|
|
2651
2662
|
}
|
|
2652
2663
|
function ft(t, e) {
|
|
2653
2664
|
const n = at(t).scrollLeft;
|
|
2654
2665
|
return e ? e.left + n : U2(D2(t)).left + n;
|
|
2655
2666
|
}
|
|
2656
|
-
function
|
|
2667
|
+
function It(t, e) {
|
|
2657
2668
|
const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - ft(t, n), s = n.top + e.scrollTop;
|
|
2658
2669
|
return {
|
|
2659
2670
|
x: i,
|
|
2660
2671
|
y: s
|
|
2661
2672
|
};
|
|
2662
2673
|
}
|
|
2663
|
-
function
|
|
2674
|
+
function ke(t) {
|
|
2664
2675
|
let {
|
|
2665
2676
|
elements: e,
|
|
2666
2677
|
rect: n,
|
|
@@ -2670,78 +2681,78 @@ function Fe(t) {
|
|
|
2670
2681
|
const o = s === "fixed", r2 = D2(i), c2 = e ? lt(e.floating) : false;
|
|
2671
2682
|
if (i === r2 || c2 && o)
|
|
2672
2683
|
return n;
|
|
2673
|
-
let
|
|
2684
|
+
let a2 = {
|
|
2674
2685
|
scrollLeft: 0,
|
|
2675
2686
|
scrollTop: 0
|
|
2676
|
-
},
|
|
2677
|
-
const d2 =
|
|
2678
|
-
if ((u2 || !u2 && !o) && ((J(i) !== "body" || nt(r2)) && (
|
|
2687
|
+
}, l2 = P2(1);
|
|
2688
|
+
const d2 = P2(0), u2 = k(i);
|
|
2689
|
+
if ((u2 || !u2 && !o) && ((J(i) !== "body" || nt(r2)) && (a2 = at(i)), k(i))) {
|
|
2679
2690
|
const f2 = U2(i);
|
|
2680
|
-
|
|
2691
|
+
l2 = Y(i), d2.x = f2.x + i.clientLeft, d2.y = f2.y + i.clientTop;
|
|
2681
2692
|
}
|
|
2682
|
-
const
|
|
2693
|
+
const h2 = r2 && !u2 && !o ? It(r2, a2) : P2(0);
|
|
2683
2694
|
return {
|
|
2684
|
-
width: n.width *
|
|
2685
|
-
height: n.height *
|
|
2686
|
-
x: n.x *
|
|
2687
|
-
y: n.y *
|
|
2695
|
+
width: n.width * l2.x,
|
|
2696
|
+
height: n.height * l2.y,
|
|
2697
|
+
x: n.x * l2.x - a2.scrollLeft * l2.x + d2.x + h2.x,
|
|
2698
|
+
y: n.y * l2.y - a2.scrollTop * l2.y + d2.y + h2.y
|
|
2688
2699
|
};
|
|
2689
2700
|
}
|
|
2690
|
-
function
|
|
2701
|
+
function De(t) {
|
|
2691
2702
|
return Array.from(t.getClientRects());
|
|
2692
2703
|
}
|
|
2693
|
-
function
|
|
2694
|
-
const e = D2(t), n = at(t), i = t.ownerDocument.body, s =
|
|
2704
|
+
function Me(t) {
|
|
2705
|
+
const e = D2(t), n = at(t), i = t.ownerDocument.body, s = q2(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), o = q2(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
|
|
2695
2706
|
let r2 = -n.scrollLeft + ft(t);
|
|
2696
2707
|
const c2 = -n.scrollTop;
|
|
2697
|
-
return
|
|
2708
|
+
return R(i).direction === "rtl" && (r2 += q2(e.clientWidth, i.clientWidth) - s), {
|
|
2698
2709
|
width: s,
|
|
2699
2710
|
height: o,
|
|
2700
2711
|
x: r2,
|
|
2701
2712
|
y: c2
|
|
2702
2713
|
};
|
|
2703
2714
|
}
|
|
2704
|
-
const
|
|
2705
|
-
function
|
|
2706
|
-
const n =
|
|
2707
|
-
let o = i.clientWidth, r2 = i.clientHeight, c2 = 0,
|
|
2715
|
+
const Ot = 25;
|
|
2716
|
+
function $e(t, e) {
|
|
2717
|
+
const n = A3(t), i = D2(t), s = n.visualViewport;
|
|
2718
|
+
let o = i.clientWidth, r2 = i.clientHeight, c2 = 0, a2 = 0;
|
|
2708
2719
|
if (s) {
|
|
2709
2720
|
o = s.width, r2 = s.height;
|
|
2710
|
-
const d2 =
|
|
2711
|
-
(!d2 || d2 && e === "fixed") && (c2 = s.offsetLeft,
|
|
2712
|
-
}
|
|
2713
|
-
const
|
|
2714
|
-
if (
|
|
2715
|
-
const d2 = i.ownerDocument, u2 = d2.body,
|
|
2716
|
-
|
|
2717
|
-
} else
|
|
2721
|
+
const d2 = vt();
|
|
2722
|
+
(!d2 || d2 && e === "fixed") && (c2 = s.offsetLeft, a2 = s.offsetTop);
|
|
2723
|
+
}
|
|
2724
|
+
const l2 = ft(i);
|
|
2725
|
+
if (l2 <= 0) {
|
|
2726
|
+
const d2 = i.ownerDocument, u2 = d2.body, h2 = getComputedStyle(u2), f2 = d2.compatMode === "CSS1Compat" && parseFloat(h2.marginLeft) + parseFloat(h2.marginRight) || 0, g3 = Math.abs(i.clientWidth - u2.clientWidth - f2);
|
|
2727
|
+
g3 <= Ot && (o -= g3);
|
|
2728
|
+
} else l2 <= Ot && (o += l2);
|
|
2718
2729
|
return {
|
|
2719
2730
|
width: o,
|
|
2720
2731
|
height: r2,
|
|
2721
2732
|
x: c2,
|
|
2722
|
-
y:
|
|
2733
|
+
y: a2
|
|
2723
2734
|
};
|
|
2724
2735
|
}
|
|
2725
|
-
const
|
|
2726
|
-
function
|
|
2727
|
-
const n = U2(t, true, e === "fixed"), i = n.top + t.clientTop, s = n.left + t.clientLeft, o = k(t) ?
|
|
2736
|
+
const Fe = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
2737
|
+
function He(t, e) {
|
|
2738
|
+
const n = U2(t, true, e === "fixed"), i = n.top + t.clientTop, s = n.left + t.clientLeft, o = k(t) ? Y(t) : P2(1), r2 = t.clientWidth * o.x, c2 = t.clientHeight * o.y, a2 = s * o.x, l2 = i * o.y;
|
|
2728
2739
|
return {
|
|
2729
2740
|
width: r2,
|
|
2730
2741
|
height: c2,
|
|
2731
|
-
x:
|
|
2732
|
-
y:
|
|
2742
|
+
x: a2,
|
|
2743
|
+
y: l2
|
|
2733
2744
|
};
|
|
2734
2745
|
}
|
|
2735
|
-
function
|
|
2746
|
+
function Tt(t, e, n) {
|
|
2736
2747
|
let i;
|
|
2737
2748
|
if (e === "viewport")
|
|
2738
|
-
i =
|
|
2749
|
+
i = $e(t, n);
|
|
2739
2750
|
else if (e === "document")
|
|
2740
|
-
i =
|
|
2741
|
-
else if (
|
|
2742
|
-
i =
|
|
2751
|
+
i = Me(D2(t));
|
|
2752
|
+
else if (S2(e))
|
|
2753
|
+
i = He(e, n);
|
|
2743
2754
|
else {
|
|
2744
|
-
const s =
|
|
2755
|
+
const s = Nt(t);
|
|
2745
2756
|
i = {
|
|
2746
2757
|
x: e.x - s.x,
|
|
2747
2758
|
y: e.y - s.y,
|
|
@@ -2751,108 +2762,108 @@ function Ot(t, e, n) {
|
|
|
2751
2762
|
}
|
|
2752
2763
|
return rt(i);
|
|
2753
2764
|
}
|
|
2754
|
-
function
|
|
2755
|
-
const n =
|
|
2756
|
-
return n === e || !
|
|
2765
|
+
function Wt(t, e) {
|
|
2766
|
+
const n = W(t);
|
|
2767
|
+
return n === e || !S2(n) || K(n) ? false : R(n).position === "fixed" || Wt(n, e);
|
|
2757
2768
|
}
|
|
2758
|
-
function
|
|
2769
|
+
function Ne(t, e) {
|
|
2759
2770
|
const n = e.get(t);
|
|
2760
2771
|
if (n)
|
|
2761
2772
|
return n;
|
|
2762
|
-
let i = tt(t, [], false).filter((c2) =>
|
|
2763
|
-
const o =
|
|
2764
|
-
let r2 = o ?
|
|
2765
|
-
for (;
|
|
2766
|
-
const c2 =
|
|
2767
|
-
!
|
|
2773
|
+
let i = tt(t, [], false).filter((c2) => S2(c2) && J(c2) !== "body"), s = null;
|
|
2774
|
+
const o = R(t).position === "fixed";
|
|
2775
|
+
let r2 = o ? W(t) : t;
|
|
2776
|
+
for (; S2(r2) && !K(r2); ) {
|
|
2777
|
+
const c2 = R(r2), a2 = xt(r2);
|
|
2778
|
+
!a2 && c2.position === "fixed" && (s = null), (o ? !a2 && !s : !a2 && c2.position === "static" && !!s && Fe.has(s.position) || nt(r2) && !a2 && Wt(t, r2)) ? i = i.filter((d2) => d2 !== r2) : s = c2, r2 = W(r2);
|
|
2768
2779
|
}
|
|
2769
2780
|
return e.set(t, i), i;
|
|
2770
2781
|
}
|
|
2771
|
-
function
|
|
2782
|
+
function Ie(t) {
|
|
2772
2783
|
let {
|
|
2773
2784
|
element: e,
|
|
2774
2785
|
boundary: n,
|
|
2775
2786
|
rootBoundary: i,
|
|
2776
2787
|
strategy: s
|
|
2777
2788
|
} = t;
|
|
2778
|
-
const r2 = [...n === "clippingAncestors" ? lt(e) ? [] :
|
|
2779
|
-
const u2 =
|
|
2780
|
-
return
|
|
2781
|
-
},
|
|
2789
|
+
const r2 = [...n === "clippingAncestors" ? lt(e) ? [] : Ne(e, this._c) : [].concat(n), i], c2 = r2[0], a2 = r2.reduce((l2, d2) => {
|
|
2790
|
+
const u2 = Tt(e, d2, s);
|
|
2791
|
+
return l2.top = q2(u2.top, l2.top), l2.right = j(u2.right, l2.right), l2.bottom = j(u2.bottom, l2.bottom), l2.left = q2(u2.left, l2.left), l2;
|
|
2792
|
+
}, Tt(e, c2, s));
|
|
2782
2793
|
return {
|
|
2783
|
-
width:
|
|
2784
|
-
height:
|
|
2785
|
-
x:
|
|
2786
|
-
y:
|
|
2794
|
+
width: a2.right - a2.left,
|
|
2795
|
+
height: a2.bottom - a2.top,
|
|
2796
|
+
x: a2.left,
|
|
2797
|
+
y: a2.top
|
|
2787
2798
|
};
|
|
2788
2799
|
}
|
|
2789
|
-
function
|
|
2800
|
+
function We(t) {
|
|
2790
2801
|
const {
|
|
2791
2802
|
width: e,
|
|
2792
2803
|
height: n
|
|
2793
|
-
} =
|
|
2804
|
+
} = Ht(t);
|
|
2794
2805
|
return {
|
|
2795
2806
|
width: e,
|
|
2796
2807
|
height: n
|
|
2797
2808
|
};
|
|
2798
2809
|
}
|
|
2799
|
-
function
|
|
2810
|
+
function Ve(t, e, n) {
|
|
2800
2811
|
const i = k(e), s = D2(e), o = n === "fixed", r2 = U2(t, true, o, e);
|
|
2801
2812
|
let c2 = {
|
|
2802
2813
|
scrollLeft: 0,
|
|
2803
2814
|
scrollTop: 0
|
|
2804
2815
|
};
|
|
2805
|
-
const
|
|
2806
|
-
function
|
|
2807
|
-
|
|
2816
|
+
const a2 = P2(0);
|
|
2817
|
+
function l2() {
|
|
2818
|
+
a2.x = ft(s);
|
|
2808
2819
|
}
|
|
2809
2820
|
if (i || !i && !o)
|
|
2810
2821
|
if ((J(e) !== "body" || nt(s)) && (c2 = at(e)), i) {
|
|
2811
2822
|
const f2 = U2(e, true, o, e);
|
|
2812
|
-
|
|
2813
|
-
} else s &&
|
|
2814
|
-
o && !i && s &&
|
|
2815
|
-
const d2 = s && !i && !o ?
|
|
2823
|
+
a2.x = f2.x + e.clientLeft, a2.y = f2.y + e.clientTop;
|
|
2824
|
+
} else s && l2();
|
|
2825
|
+
o && !i && s && l2();
|
|
2826
|
+
const d2 = s && !i && !o ? It(s, c2) : P2(0), u2 = r2.left + c2.scrollLeft - a2.x - d2.x, h2 = r2.top + c2.scrollTop - a2.y - d2.y;
|
|
2816
2827
|
return {
|
|
2817
2828
|
x: u2,
|
|
2818
|
-
y:
|
|
2829
|
+
y: h2,
|
|
2819
2830
|
width: r2.width,
|
|
2820
2831
|
height: r2.height
|
|
2821
2832
|
};
|
|
2822
2833
|
}
|
|
2823
2834
|
function ut(t) {
|
|
2824
|
-
return
|
|
2835
|
+
return R(t).position === "static";
|
|
2825
2836
|
}
|
|
2826
|
-
function
|
|
2827
|
-
if (!k(t) ||
|
|
2837
|
+
function St(t, e) {
|
|
2838
|
+
if (!k(t) || R(t).position === "fixed")
|
|
2828
2839
|
return null;
|
|
2829
2840
|
if (e)
|
|
2830
2841
|
return e(t);
|
|
2831
2842
|
let n = t.offsetParent;
|
|
2832
2843
|
return D2(t) === n && (n = n.ownerDocument.body), n;
|
|
2833
2844
|
}
|
|
2834
|
-
function
|
|
2835
|
-
const n =
|
|
2845
|
+
function Vt(t, e) {
|
|
2846
|
+
const n = A3(t);
|
|
2836
2847
|
if (lt(t))
|
|
2837
2848
|
return n;
|
|
2838
2849
|
if (!k(t)) {
|
|
2839
|
-
let s =
|
|
2850
|
+
let s = W(t);
|
|
2840
2851
|
for (; s && !K(s); ) {
|
|
2841
|
-
if (
|
|
2852
|
+
if (S2(s) && !ut(s))
|
|
2842
2853
|
return s;
|
|
2843
|
-
s =
|
|
2854
|
+
s = W(s);
|
|
2844
2855
|
}
|
|
2845
2856
|
return n;
|
|
2846
2857
|
}
|
|
2847
|
-
let i =
|
|
2848
|
-
for (; i &&
|
|
2849
|
-
i =
|
|
2850
|
-
return i && K(i) && ut(i) && !xt(i) ? n : i ||
|
|
2858
|
+
let i = St(t, e);
|
|
2859
|
+
for (; i && Ee(i) && ut(i); )
|
|
2860
|
+
i = St(i, e);
|
|
2861
|
+
return i && K(i) && ut(i) && !xt(i) ? n : i || Te(t) || n;
|
|
2851
2862
|
}
|
|
2852
|
-
const
|
|
2853
|
-
const e = this.getOffsetParent ||
|
|
2863
|
+
const Be = async function(t) {
|
|
2864
|
+
const e = this.getOffsetParent || Vt, n = this.getDimensions, i = await n(t.floating);
|
|
2854
2865
|
return {
|
|
2855
|
-
reference:
|
|
2866
|
+
reference: Ve(t.reference, await e(t.floating), t.strategy),
|
|
2856
2867
|
floating: {
|
|
2857
2868
|
x: 0,
|
|
2858
2869
|
y: 0,
|
|
@@ -2861,127 +2872,127 @@ const qe = async function(t) {
|
|
|
2861
2872
|
}
|
|
2862
2873
|
};
|
|
2863
2874
|
};
|
|
2864
|
-
function
|
|
2865
|
-
return
|
|
2875
|
+
function _e(t) {
|
|
2876
|
+
return R(t).direction === "rtl";
|
|
2866
2877
|
}
|
|
2867
|
-
const
|
|
2868
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
2878
|
+
const ze = {
|
|
2879
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ke,
|
|
2869
2880
|
getDocumentElement: D2,
|
|
2870
|
-
getClippingRect:
|
|
2871
|
-
getOffsetParent:
|
|
2872
|
-
getElementRects:
|
|
2873
|
-
getClientRects:
|
|
2874
|
-
getDimensions:
|
|
2875
|
-
getScale:
|
|
2876
|
-
isElement:
|
|
2877
|
-
isRTL:
|
|
2881
|
+
getClippingRect: Ie,
|
|
2882
|
+
getOffsetParent: Vt,
|
|
2883
|
+
getElementRects: Be,
|
|
2884
|
+
getClientRects: De,
|
|
2885
|
+
getDimensions: We,
|
|
2886
|
+
getScale: Y,
|
|
2887
|
+
isElement: S2,
|
|
2888
|
+
isRTL: _e
|
|
2878
2889
|
};
|
|
2879
|
-
function
|
|
2890
|
+
function Bt(t, e) {
|
|
2880
2891
|
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
|
|
2881
2892
|
}
|
|
2882
|
-
function
|
|
2893
|
+
function qe(t, e) {
|
|
2883
2894
|
let n = null, i;
|
|
2884
2895
|
const s = D2(t);
|
|
2885
2896
|
function o() {
|
|
2886
2897
|
var c2;
|
|
2887
2898
|
clearTimeout(i), (c2 = n) == null || c2.disconnect(), n = null;
|
|
2888
2899
|
}
|
|
2889
|
-
function r2(c2,
|
|
2890
|
-
c2 === void 0 && (c2 = false),
|
|
2891
|
-
const
|
|
2900
|
+
function r2(c2, a2) {
|
|
2901
|
+
c2 === void 0 && (c2 = false), a2 === void 0 && (a2 = 1), o();
|
|
2902
|
+
const l2 = t.getBoundingClientRect(), {
|
|
2892
2903
|
left: d2,
|
|
2893
2904
|
top: u2,
|
|
2894
|
-
width:
|
|
2905
|
+
width: h2,
|
|
2895
2906
|
height: f2
|
|
2896
|
-
} =
|
|
2897
|
-
if (c2 || e(), !
|
|
2907
|
+
} = l2;
|
|
2908
|
+
if (c2 || e(), !h2 || !f2)
|
|
2898
2909
|
return;
|
|
2899
|
-
const
|
|
2900
|
-
rootMargin: -
|
|
2901
|
-
threshold:
|
|
2910
|
+
const g3 = it(u2), m2 = it(s.clientWidth - (d2 + h2)), p2 = it(s.clientHeight - (u2 + f2)), w2 = it(d2), x3 = {
|
|
2911
|
+
rootMargin: -g3 + "px " + -m2 + "px " + -p2 + "px " + -w2 + "px",
|
|
2912
|
+
threshold: q2(0, j(1, a2)) || 1
|
|
2902
2913
|
};
|
|
2903
|
-
let
|
|
2904
|
-
function
|
|
2905
|
-
const
|
|
2906
|
-
if (
|
|
2907
|
-
if (!
|
|
2914
|
+
let b2 = true;
|
|
2915
|
+
function v2(C2) {
|
|
2916
|
+
const L4 = C2[0].intersectionRatio;
|
|
2917
|
+
if (L4 !== a2) {
|
|
2918
|
+
if (!b2)
|
|
2908
2919
|
return r2();
|
|
2909
|
-
|
|
2920
|
+
L4 ? r2(false, L4) : i = setTimeout(() => {
|
|
2910
2921
|
r2(false, 1e-7);
|
|
2911
2922
|
}, 1e3);
|
|
2912
2923
|
}
|
|
2913
|
-
|
|
2924
|
+
L4 === 1 && !Bt(l2, t.getBoundingClientRect()) && r2(), b2 = false;
|
|
2914
2925
|
}
|
|
2915
2926
|
try {
|
|
2916
|
-
n = new IntersectionObserver(
|
|
2917
|
-
...
|
|
2927
|
+
n = new IntersectionObserver(v2, {
|
|
2928
|
+
...x3,
|
|
2918
2929
|
// Handle <iframe>s
|
|
2919
2930
|
root: s.ownerDocument
|
|
2920
2931
|
});
|
|
2921
2932
|
} catch {
|
|
2922
|
-
n = new IntersectionObserver(
|
|
2933
|
+
n = new IntersectionObserver(v2, x3);
|
|
2923
2934
|
}
|
|
2924
2935
|
n.observe(t);
|
|
2925
2936
|
}
|
|
2926
2937
|
return r2(true), o;
|
|
2927
2938
|
}
|
|
2928
|
-
function
|
|
2939
|
+
function Xe(t, e, n, i) {
|
|
2929
2940
|
i === void 0 && (i = {});
|
|
2930
2941
|
const {
|
|
2931
2942
|
ancestorScroll: s = true,
|
|
2932
2943
|
ancestorResize: o = true,
|
|
2933
2944
|
elementResize: r2 = typeof ResizeObserver == "function",
|
|
2934
2945
|
layoutShift: c2 = typeof IntersectionObserver == "function",
|
|
2935
|
-
animationFrame:
|
|
2936
|
-
} = i,
|
|
2937
|
-
d2.forEach((
|
|
2938
|
-
s &&
|
|
2946
|
+
animationFrame: a2 = false
|
|
2947
|
+
} = i, l2 = bt(t), d2 = s || o ? [...l2 ? tt(l2) : [], ...tt(e)] : [];
|
|
2948
|
+
d2.forEach((w2) => {
|
|
2949
|
+
s && w2.addEventListener("scroll", n, {
|
|
2939
2950
|
passive: true
|
|
2940
|
-
}), o &&
|
|
2951
|
+
}), o && w2.addEventListener("resize", n);
|
|
2941
2952
|
});
|
|
2942
|
-
const u2 =
|
|
2943
|
-
let
|
|
2944
|
-
r2 && (f2 = new ResizeObserver((
|
|
2945
|
-
let [
|
|
2946
|
-
|
|
2947
|
-
var
|
|
2948
|
-
(
|
|
2953
|
+
const u2 = l2 && c2 ? qe(l2, n) : null;
|
|
2954
|
+
let h2 = -1, f2 = null;
|
|
2955
|
+
r2 && (f2 = new ResizeObserver((w2) => {
|
|
2956
|
+
let [y2] = w2;
|
|
2957
|
+
y2 && y2.target === l2 && f2 && (f2.unobserve(e), cancelAnimationFrame(h2), h2 = requestAnimationFrame(() => {
|
|
2958
|
+
var x3;
|
|
2959
|
+
(x3 = f2) == null || x3.observe(e);
|
|
2949
2960
|
})), n();
|
|
2950
|
-
}),
|
|
2951
|
-
let
|
|
2952
|
-
|
|
2961
|
+
}), l2 && !a2 && f2.observe(l2), f2.observe(e));
|
|
2962
|
+
let g3, m2 = a2 ? U2(t) : null;
|
|
2963
|
+
a2 && p2();
|
|
2953
2964
|
function p2() {
|
|
2954
|
-
const
|
|
2955
|
-
m2 && !
|
|
2965
|
+
const w2 = U2(t);
|
|
2966
|
+
m2 && !Bt(m2, w2) && n(), m2 = w2, g3 = requestAnimationFrame(p2);
|
|
2956
2967
|
}
|
|
2957
2968
|
return n(), () => {
|
|
2958
|
-
var
|
|
2959
|
-
d2.forEach((
|
|
2960
|
-
s &&
|
|
2961
|
-
}), u2?.(), (
|
|
2969
|
+
var w2;
|
|
2970
|
+
d2.forEach((y2) => {
|
|
2971
|
+
s && y2.removeEventListener("scroll", n), o && y2.removeEventListener("resize", n);
|
|
2972
|
+
}), u2?.(), (w2 = f2) == null || w2.disconnect(), f2 = null, a2 && cancelAnimationFrame(g3);
|
|
2962
2973
|
};
|
|
2963
2974
|
}
|
|
2964
|
-
const
|
|
2975
|
+
const Ue = we, Ye = ye, je = me, Ke = ge, Je = xe, Ge = (t, e, n) => {
|
|
2965
2976
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
2966
|
-
platform:
|
|
2977
|
+
platform: ze,
|
|
2967
2978
|
...n
|
|
2968
2979
|
}, o = {
|
|
2969
2980
|
...s.platform,
|
|
2970
2981
|
_c: i
|
|
2971
2982
|
};
|
|
2972
|
-
return
|
|
2983
|
+
return he(t, e, {
|
|
2973
2984
|
...s,
|
|
2974
2985
|
platform: o
|
|
2975
2986
|
});
|
|
2976
2987
|
};
|
|
2977
|
-
function
|
|
2988
|
+
function Rt(t, e, n) {
|
|
2978
2989
|
Object.assign(t.style, {
|
|
2979
2990
|
left: e != null ? `${e}px` : "",
|
|
2980
2991
|
top: n != null ? `${n}px` : ""
|
|
2981
2992
|
});
|
|
2982
2993
|
}
|
|
2983
|
-
function
|
|
2984
|
-
let n = t.
|
|
2994
|
+
function _t(t, e) {
|
|
2995
|
+
let n = t.config.get("toggleDelay");
|
|
2985
2996
|
typeof n == "string" && (n.indexOf(",") > -1 && (n = n.split(",")), n.indexOf(" ") > -1 && (n = n.split(" "))), Array.isArray(n) && (n = n[e]);
|
|
2986
2997
|
const i = Number(n);
|
|
2987
2998
|
if (Number.isNaN(i))
|
|
@@ -3027,31 +3038,31 @@ function dt(t) {
|
|
|
3027
3038
|
}
|
|
3028
3039
|
return e;
|
|
3029
3040
|
}
|
|
3030
|
-
function
|
|
3041
|
+
function Qe(t) {
|
|
3031
3042
|
return {
|
|
3032
|
-
offset: Number(t.
|
|
3043
|
+
offset: Number(t.config.get("offset")),
|
|
3033
3044
|
flip: {
|
|
3034
|
-
padding: dt(t.
|
|
3045
|
+
padding: dt(t.config.get("flipPadding"))
|
|
3035
3046
|
},
|
|
3036
3047
|
shift: {
|
|
3037
|
-
padding: dt(t.
|
|
3048
|
+
padding: dt(t.config.get("shiftPadding"))
|
|
3038
3049
|
},
|
|
3039
3050
|
arrow: {
|
|
3040
|
-
selector: t.
|
|
3051
|
+
selector: t.config.get("selectorArrow"),
|
|
3041
3052
|
element: null,
|
|
3042
|
-
padding: dt(t.
|
|
3053
|
+
padding: dt(t.config.get("arrowPadding"))
|
|
3043
3054
|
}
|
|
3044
3055
|
};
|
|
3045
3056
|
}
|
|
3046
|
-
async function
|
|
3047
|
-
return t && t.state === "opened" && (t.el.inert = true, t.el.classList.remove(t.
|
|
3048
|
-
new CustomEvent(t.
|
|
3057
|
+
async function zt(t) {
|
|
3058
|
+
return t && t.state === "opened" && (t.el.inert = true, t.el.classList.remove(t.config.get("stateActive")), t.isTooltip || t.trigger?.setAttribute("aria-expanded", "false"), t.floatingCleanup(), t.state = "closed", t.trigger === t.parent.trigger && (t.parent.trigger = null), t.el.dispatchEvent(
|
|
3059
|
+
new CustomEvent(t.config.get("customEventPrefix") + "closed", {
|
|
3049
3060
|
detail: t.parent,
|
|
3050
3061
|
bubbles: true
|
|
3051
3062
|
})
|
|
3052
3063
|
), await t.parent.emit("closed", t)), t;
|
|
3053
3064
|
}
|
|
3054
|
-
async function
|
|
3065
|
+
async function qt(t) {
|
|
3055
3066
|
const e = [];
|
|
3056
3067
|
for (const n of t.collection)
|
|
3057
3068
|
n.state === "opened" && e.push(await n.close());
|
|
@@ -3062,35 +3073,35 @@ function Xt(t) {
|
|
|
3062
3073
|
`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`
|
|
3063
3074
|
) || t.close(), t), 1);
|
|
3064
3075
|
}
|
|
3065
|
-
function
|
|
3076
|
+
function Ze(t) {
|
|
3066
3077
|
t.state === "opened" ? t.close() : (this.trigger = t.trigger, t.open());
|
|
3067
3078
|
}
|
|
3068
|
-
function
|
|
3079
|
+
function tn(t) {
|
|
3069
3080
|
t.isTooltip && (t.toggleDelayId && clearTimeout(t.toggleDelayId), t.close());
|
|
3070
3081
|
}
|
|
3071
|
-
function
|
|
3072
|
-
if (t.isHovered = e, e.type == "focus" && t.trigger && !t.trigger.matches(":focus-visible"))
|
|
3082
|
+
function en(t, e) {
|
|
3083
|
+
if (!(e instanceof MouseEvent) || (t.isHovered = e, e.type == "focus" && t.trigger && !t.trigger.matches(":focus-visible")))
|
|
3073
3084
|
return;
|
|
3074
3085
|
t.toggleDelayId && clearTimeout(t.toggleDelayId);
|
|
3075
3086
|
const n = t.trigger?.getAttribute("aria-expanded");
|
|
3076
3087
|
if (n && n == "true") return;
|
|
3077
|
-
const i = this.activeHover ? 0 :
|
|
3088
|
+
const i = this.activeHover ? 0 : _t(t, 0);
|
|
3078
3089
|
this.activeHover && this.activeHover.close(), t.toggleDelayId = setTimeout(() => {
|
|
3079
3090
|
t.id && t.open();
|
|
3080
3091
|
}, i);
|
|
3081
3092
|
}
|
|
3082
|
-
function
|
|
3083
|
-
setTimeout(() => {
|
|
3093
|
+
function nn(t, e) {
|
|
3094
|
+
e instanceof MouseEvent && setTimeout(() => {
|
|
3084
3095
|
t.isHovered = e, !t.isHovered && (t.toggleDelayId && clearTimeout(t.toggleDelayId), t.toggleDelayId = setTimeout(
|
|
3085
3096
|
() => Xt(t),
|
|
3086
|
-
|
|
3097
|
+
_t(t, 1)
|
|
3087
3098
|
));
|
|
3088
3099
|
}, 1);
|
|
3089
3100
|
}
|
|
3090
|
-
function
|
|
3101
|
+
function sn(t) {
|
|
3091
3102
|
switch (t.key) {
|
|
3092
3103
|
case "Escape":
|
|
3093
|
-
this.trigger && this.trigger.focus(),
|
|
3104
|
+
this.trigger && this.trigger.focus(), qt(this);
|
|
3094
3105
|
return;
|
|
3095
3106
|
case "Tab":
|
|
3096
3107
|
this.collection.forEach((e) => {
|
|
@@ -3101,62 +3112,61 @@ function ln(t) {
|
|
|
3101
3112
|
return;
|
|
3102
3113
|
}
|
|
3103
3114
|
}
|
|
3104
|
-
function
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
s && (s.closest(
|
|
3115
|
+
function on(t) {
|
|
3116
|
+
document.addEventListener("click", function e(n) {
|
|
3117
|
+
const i = n.target;
|
|
3118
|
+
i && (i.closest(
|
|
3109
3119
|
`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`
|
|
3110
|
-
) ? t.el && !t.el.classList.contains(
|
|
3120
|
+
) ? t.el && !t.el.classList.contains(t.config.get("stateActive")) && this.removeEventListener("click", e) : (t.el && t.el.classList.contains(t.config.get("stateActive")) && t.close(), this.removeEventListener("click", e)));
|
|
3111
3121
|
});
|
|
3112
3122
|
}
|
|
3113
|
-
async function
|
|
3114
|
-
t.el.inert = false, t.el.classList.add(t.
|
|
3115
|
-
const e =
|
|
3123
|
+
async function Ut(t) {
|
|
3124
|
+
t.el.inert = false, t.el.classList.add(t.config.get("stateActive")), t.isTooltip || t.trigger?.setAttribute("aria-expanded", "true"), await t.parent.emit("updateCustomProps", t);
|
|
3125
|
+
const e = Qe(t), n = t.el.querySelector(
|
|
3116
3126
|
e.arrow.selector
|
|
3117
3127
|
);
|
|
3118
|
-
return e.arrow.element = n || null, t.trigger instanceof HTMLElement && (t.floatingCleanup =
|
|
3128
|
+
return e.arrow.element = n || null, t.trigger instanceof HTMLElement && (t.floatingCleanup = Xe(t.trigger, t.el, () => {
|
|
3119
3129
|
const i = [
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3130
|
+
je(e.flip),
|
|
3131
|
+
Ye({ ...e.shift, limiter: Je() }),
|
|
3132
|
+
Ue(e.offset)
|
|
3123
3133
|
];
|
|
3124
3134
|
e.arrow.element && i.push(
|
|
3125
|
-
|
|
3135
|
+
Ke({
|
|
3126
3136
|
...e.arrow,
|
|
3127
3137
|
element: e.arrow.element
|
|
3128
3138
|
})
|
|
3129
|
-
),
|
|
3130
|
-
placement: t.
|
|
3139
|
+
), Ge(t.trigger, t.el, {
|
|
3140
|
+
placement: t.config.get("placement"),
|
|
3131
3141
|
middleware: i
|
|
3132
3142
|
}).then(({ x: s, y: o, placement: r2, middlewareData: c2 }) => {
|
|
3133
3143
|
if (t.el) {
|
|
3134
|
-
if (
|
|
3135
|
-
const { x:
|
|
3136
|
-
|
|
3144
|
+
if (Rt(t.el, s, o), e.arrow.element && c2.arrow) {
|
|
3145
|
+
const { x: a2, y: l2 } = c2.arrow;
|
|
3146
|
+
Rt(e.arrow.element, a2, l2);
|
|
3137
3147
|
}
|
|
3138
3148
|
t.el.setAttribute("data-floating-placement", r2);
|
|
3139
3149
|
}
|
|
3140
3150
|
});
|
|
3141
|
-
})), t.state = "opened", t.
|
|
3142
|
-
new CustomEvent(t.
|
|
3151
|
+
})), t.state = "opened", t.config.get("event") === "click" && on.call(t.parent, t), t.el.dispatchEvent(
|
|
3152
|
+
new CustomEvent(t.config.get("customEventPrefix") + "opened", {
|
|
3143
3153
|
detail: t.parent,
|
|
3144
3154
|
bubbles: true
|
|
3145
3155
|
})
|
|
3146
3156
|
), await t.parent.emit("opened", t), t;
|
|
3147
3157
|
}
|
|
3148
|
-
class
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
constructor(e, n, i = {}) {
|
|
3152
|
-
super(e, n, i), this.state = "closed", this.toggleDelayId = null, this.trigger = null, this.#t = null, this.#e = {
|
|
3158
|
+
class rn extends Pt {
|
|
3159
|
+
constructor(e, n) {
|
|
3160
|
+
super(e, n), this.#t = [], this.#e = {
|
|
3153
3161
|
el: false,
|
|
3154
3162
|
trigger: false
|
|
3155
|
-
}, this.floatingCleanup = () => {
|
|
3163
|
+
}, this.state = "closed", this.trigger = null, this.toggleDelayId = null, this.floatingCleanup = () => {
|
|
3156
3164
|
};
|
|
3157
3165
|
}
|
|
3166
|
+
#t;
|
|
3167
|
+
#e;
|
|
3158
3168
|
get isTooltip() {
|
|
3159
|
-
return !!this.el.closest(this.
|
|
3169
|
+
return !!this.el.closest(this.config.get("selectorTooltip")) || this.el.getAttribute("role") == "tooltip";
|
|
3160
3170
|
}
|
|
3161
3171
|
get isHovered() {
|
|
3162
3172
|
return this.#e.el || this.#e.trigger;
|
|
@@ -3174,47 +3184,55 @@ class fn extends Dt {
|
|
|
3174
3184
|
}
|
|
3175
3185
|
}
|
|
3176
3186
|
async open() {
|
|
3177
|
-
return
|
|
3187
|
+
return Ut(this);
|
|
3178
3188
|
}
|
|
3179
3189
|
async close() {
|
|
3180
|
-
return
|
|
3190
|
+
return zt(this);
|
|
3181
3191
|
}
|
|
3182
3192
|
async deregister() {
|
|
3183
|
-
return this.parent.deregister(this
|
|
3193
|
+
return this.parent.deregister(this);
|
|
3184
3194
|
}
|
|
3185
3195
|
registerEventListeners() {
|
|
3186
|
-
this.#t || (this.
|
|
3196
|
+
this.#t.length || (this.config.get("event") === "hover" ? (this.#t = [
|
|
3187
3197
|
{
|
|
3188
3198
|
el: ["el", "trigger"],
|
|
3189
3199
|
type: ["mouseenter", "focus"],
|
|
3190
|
-
listener:
|
|
3200
|
+
listener: en.bind(this.parent, this)
|
|
3191
3201
|
},
|
|
3192
3202
|
{
|
|
3193
3203
|
el: ["el", "trigger"],
|
|
3194
3204
|
type: ["mouseleave", "focusout"],
|
|
3195
|
-
listener:
|
|
3205
|
+
listener: nn.bind(this.parent, this)
|
|
3196
3206
|
},
|
|
3197
3207
|
{
|
|
3198
3208
|
el: ["trigger"],
|
|
3199
3209
|
type: ["click"],
|
|
3200
|
-
listener:
|
|
3210
|
+
listener: tn.bind(this.parent, this)
|
|
3201
3211
|
}
|
|
3202
3212
|
], this.#t.forEach((n) => {
|
|
3203
3213
|
n.el.forEach((i) => {
|
|
3204
3214
|
n.type.forEach((s) => {
|
|
3205
|
-
this[i].addEventListener(
|
|
3215
|
+
this[i].addEventListener(
|
|
3216
|
+
s,
|
|
3217
|
+
n.listener,
|
|
3218
|
+
false
|
|
3219
|
+
);
|
|
3206
3220
|
});
|
|
3207
3221
|
});
|
|
3208
3222
|
})) : (this.#t = [
|
|
3209
3223
|
{
|
|
3210
3224
|
el: ["trigger"],
|
|
3211
3225
|
type: ["click"],
|
|
3212
|
-
listener:
|
|
3226
|
+
listener: Ze.bind(this.parent, this)
|
|
3213
3227
|
}
|
|
3214
3228
|
], this.#t.forEach((n) => {
|
|
3215
3229
|
n.el.forEach((i) => {
|
|
3216
3230
|
n.type.forEach((s) => {
|
|
3217
|
-
this[i].addEventListener(
|
|
3231
|
+
this[i].addEventListener(
|
|
3232
|
+
s,
|
|
3233
|
+
n.listener,
|
|
3234
|
+
false
|
|
3235
|
+
);
|
|
3218
3236
|
});
|
|
3219
3237
|
});
|
|
3220
3238
|
})));
|
|
@@ -3223,41 +3241,45 @@ class fn extends Dt {
|
|
|
3223
3241
|
this.#t && (this.#t.forEach((e) => {
|
|
3224
3242
|
e.el.forEach((n) => {
|
|
3225
3243
|
e.type.forEach((i) => {
|
|
3226
|
-
this[n].removeEventListener(
|
|
3244
|
+
this[n].removeEventListener(
|
|
3245
|
+
i,
|
|
3246
|
+
e.listener,
|
|
3247
|
+
false
|
|
3248
|
+
);
|
|
3227
3249
|
});
|
|
3228
3250
|
});
|
|
3229
|
-
}), this.#t =
|
|
3251
|
+
}), this.#t = []);
|
|
3230
3252
|
}
|
|
3231
3253
|
async onCreateEntry() {
|
|
3232
3254
|
this.trigger = document.querySelector(
|
|
3233
3255
|
`[aria-controls="${this.id}"], [aria-describedby="${this.id}"]`
|
|
3234
|
-
), this.isTooltip ? (this.
|
|
3256
|
+
), this.isTooltip ? (this.config.set({ event: "hover" }), this.el.setAttribute("role", "tooltip")) : this.trigger && this.trigger instanceof HTMLElement && this.trigger.setAttribute("aria-expanded", "false");
|
|
3235
3257
|
}
|
|
3236
3258
|
async onRegisterEntry() {
|
|
3237
|
-
this.el.classList.contains(this.
|
|
3259
|
+
this.registerEventListeners(), this.el.classList.contains(this.config.get("stateActive")) ? await this.open() : this.el.inert = true;
|
|
3238
3260
|
}
|
|
3239
3261
|
async onDestroyEntry() {
|
|
3240
3262
|
this.state === "opened" && await this.close(), this.floatingCleanup(), this.deregisterEventListeners();
|
|
3241
3263
|
}
|
|
3242
3264
|
}
|
|
3243
|
-
class
|
|
3244
|
-
#t;
|
|
3265
|
+
class cn extends ee {
|
|
3245
3266
|
constructor(e) {
|
|
3246
|
-
super({ ...
|
|
3267
|
+
super({ ...ne, ...e }), this.entryClass = rn, this.name = "Popover", this.trigger = null, this.#t = sn.bind(this);
|
|
3247
3268
|
}
|
|
3269
|
+
#t;
|
|
3248
3270
|
get active() {
|
|
3249
3271
|
return this.get("opened", "state");
|
|
3250
3272
|
}
|
|
3251
3273
|
get activeHover() {
|
|
3252
|
-
return this.collection.find((e) => e.state == "opened" && e.
|
|
3274
|
+
return this.collection.find((e) => e.state == "opened" && e.config.get("event") == "hover");
|
|
3253
3275
|
}
|
|
3254
3276
|
async open(e) {
|
|
3255
3277
|
const n = this.getOrThrow(e);
|
|
3256
|
-
return
|
|
3278
|
+
return Ut(n);
|
|
3257
3279
|
}
|
|
3258
3280
|
async close(e) {
|
|
3259
3281
|
const n = e ? this.getOrThrow(e) : void 0;
|
|
3260
|
-
return n ?
|
|
3282
|
+
return n ? zt(n) : qt(this);
|
|
3261
3283
|
}
|
|
3262
3284
|
async afterMount() {
|
|
3263
3285
|
document.addEventListener("keydown", this.#t, false);
|
|
@@ -3270,9 +3292,9 @@ class un extends oe {
|
|
|
3270
3292
|
}
|
|
3271
3293
|
}
|
|
3272
3294
|
export {
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3295
|
+
q$1 as Drawer,
|
|
3296
|
+
P$1 as Modal,
|
|
3297
|
+
cn as Popover,
|
|
3276
3298
|
index as core
|
|
3277
3299
|
};
|
|
3278
3300
|
//# sourceMappingURL=index.js.map
|