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