vrembem 4.0.0-next.0 → 4.0.0-next.10
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 +21 -0
- package/README.md +4 -8
- package/dev/index.css +4388 -2767
- package/dev/index.css.map +1 -1
- package/dev/index.js +985 -1002
- package/dev/index.js.map +1 -1
- package/dev/index.umd.cjs +946 -963
- package/dev/index.umd.cjs.map +1 -1
- package/dev/root.css +197 -0
- package/dev/root.css.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +1233 -1253
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +6 -2
- package/dist/index.umd.cjs.map +1 -1
- package/dist/root.css +1 -0
- package/dist/root.css.map +1 -0
- package/index.js +4 -6
- package/index.scss +1 -4
- package/package.json +37 -29
- package/root.scss +1 -0
package/dev/index.umd.cjs
CHANGED
|
@@ -2,37 +2,33 @@
|
|
|
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
3
|
})(this, function(exports2) {
|
|
4
4
|
"use strict";
|
|
5
|
-
var b$2 = (t
|
|
6
|
-
|
|
7
|
-
throw TypeError("Cannot " + n);
|
|
5
|
+
var b$2 = (t) => {
|
|
6
|
+
throw TypeError(t);
|
|
8
7
|
};
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}, a = (t, e, n, i2) => (b$2(t, e, "write to private field"), i2 ? i2.call(t, n) : e.set(t, n), n);
|
|
14
|
-
var r$2;
|
|
15
|
-
let $$2 = class $ {
|
|
8
|
+
var g$2 = (t, e, n) => e.has(t) || b$2("Cannot " + n);
|
|
9
|
+
var o$2 = (t, e, n) => (g$2(t, e, "read from private field"), n ? n.call(t) : e.get(t)), m$2 = (t, e, n) => e.has(t) ? b$2("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), a$1 = (t, e, n, i) => (g$2(t, e, "write to private field"), e.set(t, n), n);
|
|
10
|
+
var l$1;
|
|
11
|
+
let L$2 = class L {
|
|
16
12
|
constructor(e, n) {
|
|
17
|
-
|
|
18
|
-
this.value = e, a(this,
|
|
13
|
+
m$2(this, l$1);
|
|
14
|
+
this.value = e, a$1(this, l$1, n), this.mql = null;
|
|
19
15
|
}
|
|
20
16
|
get handler() {
|
|
21
|
-
return o$
|
|
17
|
+
return o$2(this, l$1);
|
|
22
18
|
}
|
|
23
19
|
// Unmount existing handler before setting a new one.
|
|
24
20
|
set handler(e) {
|
|
25
|
-
this.mql &&
|
|
21
|
+
this.mql && this.mql.removeEventListener("change", o$2(this, l$1)), a$1(this, l$1, e);
|
|
26
22
|
}
|
|
27
23
|
mount(e, n) {
|
|
28
|
-
return e && (this.value = e), n && a(this,
|
|
24
|
+
return e && (this.value = e), n && a$1(this, l$1, n), this.value ? (this.mql = window.matchMedia(`(min-width: ${this.value})`), this.mql.addEventListener("change", o$2(this, l$1)), o$2(this, l$1).call(this, this.mql), this) : this;
|
|
29
25
|
}
|
|
30
26
|
unmount() {
|
|
31
|
-
return this.mql ? (
|
|
27
|
+
return this.mql ? (this.mql.removeEventListener("change", o$2(this, l$1)), this.value = null, a$1(this, l$1, null), this.mql = null, this) : this;
|
|
32
28
|
}
|
|
33
29
|
};
|
|
34
|
-
|
|
35
|
-
let
|
|
30
|
+
l$1 = /* @__PURE__ */ new WeakMap();
|
|
31
|
+
let S$3 = class S {
|
|
36
32
|
constructor() {
|
|
37
33
|
this.collection = [];
|
|
38
34
|
}
|
|
@@ -40,11 +36,11 @@
|
|
|
40
36
|
return await this.deregister(e), this.collection.push(e), this.collection;
|
|
41
37
|
}
|
|
42
38
|
async deregister(e) {
|
|
43
|
-
const n = this.collection.findIndex((
|
|
39
|
+
const n = this.collection.findIndex((i) => i === e);
|
|
44
40
|
if (n >= 0) {
|
|
45
|
-
const
|
|
46
|
-
Object.getOwnPropertyNames(
|
|
47
|
-
delete
|
|
41
|
+
const i = this.collection[n];
|
|
42
|
+
Object.getOwnPropertyNames(i).forEach((r) => {
|
|
43
|
+
delete i[r];
|
|
48
44
|
}), this.collection.splice(n, 1);
|
|
49
45
|
}
|
|
50
46
|
return this.collection;
|
|
@@ -60,14 +56,14 @@
|
|
|
60
56
|
return this.collection;
|
|
61
57
|
}
|
|
62
58
|
get(e, n = "id") {
|
|
63
|
-
return this.collection.find((
|
|
59
|
+
return this.collection.find((i) => i[n] === e);
|
|
64
60
|
}
|
|
65
61
|
};
|
|
66
62
|
const s = {
|
|
67
63
|
inert: ":not([inert]):not([inert] *)",
|
|
68
64
|
negTabIndex: ':not([tabindex^="-"])',
|
|
69
65
|
disabled: ":not(:disabled)"
|
|
70
|
-
},
|
|
66
|
+
}, $$2 = [
|
|
71
67
|
`a[href]${s.inert}${s.negTabIndex}`,
|
|
72
68
|
`area[href]${s.inert}${s.negTabIndex}`,
|
|
73
69
|
`input:not([type="hidden"]):not([type="radio"])${s.inert}${s.negTabIndex}${s.disabled}`,
|
|
@@ -85,19 +81,19 @@
|
|
|
85
81
|
`[contenteditable]${s.inert}${s.negTabIndex}`,
|
|
86
82
|
`[tabindex]${s.inert}${s.negTabIndex}`
|
|
87
83
|
];
|
|
88
|
-
var
|
|
89
|
-
let
|
|
84
|
+
var f$2, u$1, d$2;
|
|
85
|
+
let q$2 = class q {
|
|
90
86
|
constructor(e = null, n = "[data-focus]") {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this.el = e, this.selectorFocus = n, a(this,
|
|
87
|
+
m$2(this, f$2);
|
|
88
|
+
m$2(this, u$1);
|
|
89
|
+
m$2(this, d$2);
|
|
90
|
+
this.el = e, this.selectorFocus = n, a$1(this, u$1, v$2.bind(this)), a$1(this, d$2, y$2.bind(this));
|
|
95
91
|
}
|
|
96
92
|
get focusable() {
|
|
97
|
-
return o$
|
|
93
|
+
return o$2(this, f$2);
|
|
98
94
|
}
|
|
99
95
|
set focusable(e) {
|
|
100
|
-
a(this,
|
|
96
|
+
a$1(this, f$2, e), o$2(this, f$2).length ? (document.removeEventListener("keydown", o$2(this, d$2)), document.addEventListener("keydown", o$2(this, u$1))) : (document.removeEventListener("keydown", o$2(this, u$1)), document.addEventListener("keydown", o$2(this, d$2)));
|
|
101
97
|
}
|
|
102
98
|
get focusableFirst() {
|
|
103
99
|
return this.focusable[0];
|
|
@@ -109,180 +105,144 @@
|
|
|
109
105
|
e && (this.el = e), n && (this.selectorFocus = n), this.focusable = this.getFocusable(), this.focus();
|
|
110
106
|
}
|
|
111
107
|
unmount() {
|
|
112
|
-
this.el = null, this.focusable = [], document.removeEventListener("keydown", o$
|
|
108
|
+
this.el = null, this.focusable = [], document.removeEventListener("keydown", o$2(this, u$1)), document.removeEventListener("keydown", o$2(this, d$2));
|
|
113
109
|
}
|
|
114
110
|
focus(e = this.el, n = this.selectorFocus) {
|
|
115
111
|
(e.querySelector(n) || e).focus();
|
|
116
112
|
}
|
|
117
113
|
getFocusable(e = this.el) {
|
|
118
|
-
const n = [],
|
|
119
|
-
return e.querySelectorAll(
|
|
120
|
-
|
|
121
|
-
}), e.scrollTop =
|
|
114
|
+
const n = [], i = document.activeElement, r = e.scrollTop;
|
|
115
|
+
return e.querySelectorAll($$2.join(",")).forEach((h2) => {
|
|
116
|
+
h2.focus(), document.activeElement === h2 && n.push(h2);
|
|
117
|
+
}), e.scrollTop = r, i.focus(), n;
|
|
122
118
|
}
|
|
123
119
|
};
|
|
124
|
-
|
|
125
|
-
function
|
|
120
|
+
f$2 = /* @__PURE__ */ new WeakMap(), u$1 = /* @__PURE__ */ new WeakMap(), d$2 = /* @__PURE__ */ new WeakMap();
|
|
121
|
+
function v$2(t) {
|
|
126
122
|
(t.key === "Tab" || t.keyCode === 9) && (t.shiftKey ? (document.activeElement === this.focusableFirst || document.activeElement === this.el) && (t.preventDefault(), this.focusableLast.focus()) : (document.activeElement === this.focusableLast || document.activeElement === this.el) && (t.preventDefault(), this.focusableFirst.focus()));
|
|
127
123
|
}
|
|
128
|
-
function
|
|
124
|
+
function y$2(t) {
|
|
129
125
|
(t.key === "Tab" || t.keyCode === 9) && t.preventDefault();
|
|
130
126
|
}
|
|
131
|
-
function
|
|
132
|
-
|
|
133
|
-
return i2 ? JSON.parse(i2) : {};
|
|
127
|
+
function T$2() {
|
|
128
|
+
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
134
129
|
}
|
|
135
|
-
function
|
|
136
|
-
|
|
130
|
+
function E$2(t, e = document.body) {
|
|
131
|
+
if (t.slice(0, 2) !== "--") {
|
|
132
|
+
const i = T$2();
|
|
133
|
+
i && (t = `${i}${t}`), t = `--${t}`;
|
|
134
|
+
}
|
|
135
|
+
const n = getComputedStyle(e).getPropertyValue(t).trim();
|
|
136
|
+
if (n)
|
|
137
|
+
return n;
|
|
138
|
+
throw new Error(`CSS variable "${t}" was not found!`);
|
|
139
|
+
}
|
|
140
|
+
function F$3(t, e) {
|
|
141
|
+
const i = (t.getAttribute(`data-${e}`) || "").replace(/'/g, '"');
|
|
142
|
+
return i ? JSON.parse(i) : {};
|
|
137
143
|
}
|
|
138
|
-
function
|
|
139
|
-
const n = localStorage.getItem(t),
|
|
144
|
+
function k$3(t, e = true) {
|
|
145
|
+
const n = localStorage.getItem(t), i = n ? JSON.parse(n) : {};
|
|
140
146
|
return {
|
|
141
|
-
get(
|
|
142
|
-
return
|
|
147
|
+
get(r) {
|
|
148
|
+
return r ? i[r] : i;
|
|
143
149
|
},
|
|
144
|
-
set(
|
|
145
|
-
return c2 ?
|
|
150
|
+
set(r, c2) {
|
|
151
|
+
return c2 ? i[r] = c2 : delete i[r], e && localStorage.setItem(t, JSON.stringify(i)), i;
|
|
146
152
|
}
|
|
147
153
|
};
|
|
148
154
|
}
|
|
149
|
-
function
|
|
150
|
-
const
|
|
151
|
-
if (e =
|
|
152
|
-
|
|
153
|
-
if (typeof e[n] != "function")
|
|
154
|
-
throw new Error(`Not a valid teleport method: '${n}'`);
|
|
155
|
+
function w$2(t, e, n) {
|
|
156
|
+
const i = e.nodeType === Node.COMMENT_NODE, r = e.nodeType === Node.ELEMENT_NODE;
|
|
157
|
+
if (e = i || r ? e : document.querySelector(e), i && (n = "after"), !e) throw new Error(`Not a valid teleport reference: '${e}'`);
|
|
158
|
+
if (typeof e[n] != "function") throw new Error(`Not a valid teleport method: '${n}'`);
|
|
155
159
|
let c2 = null;
|
|
156
|
-
return
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
t.classList.remove(e.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
160
|
+
return i || (c2 = document.createComment("teleported #" + t.id), t.before(c2)), e[n](t), i && e.remove(), c2;
|
|
161
|
+
}
|
|
162
|
+
function C$2(t, e, n, i = "transition-duration") {
|
|
163
|
+
return new Promise((r) => {
|
|
164
|
+
if (typeof i == "string") {
|
|
165
|
+
const c2 = E$2(i, t), h2 = !!c2.includes("ms");
|
|
166
|
+
i = parseFloat(c2) * (h2 ? 1 : 1e3);
|
|
167
|
+
}
|
|
168
|
+
t.classList.remove(e.finish), t.classList.add(n.start), setTimeout(() => {
|
|
169
|
+
t.classList.add(n.finish), t.classList.remove(n.start), r(t);
|
|
170
|
+
}, i);
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
function p$2(t, e) {
|
|
174
|
+
e && document.querySelectorAll(e).forEach((i) => {
|
|
175
|
+
t ? i.style.overflow = "hidden" : i.style.removeProperty("overflow");
|
|
170
176
|
});
|
|
171
177
|
}
|
|
172
|
-
function
|
|
173
|
-
e && document.querySelectorAll(e).forEach((
|
|
174
|
-
t ? (
|
|
178
|
+
function x$2(t, e) {
|
|
179
|
+
e && document.querySelectorAll(e).forEach((i) => {
|
|
180
|
+
t ? (i.inert = true, i.setAttribute("aria-hidden", true)) : (i.inert = null, i.removeAttribute("aria-hidden"));
|
|
175
181
|
});
|
|
176
182
|
}
|
|
177
|
-
function
|
|
178
|
-
|
|
183
|
+
function N$3(t, e) {
|
|
184
|
+
x$2(!!t, e.selectorInert), p$2(!!t, e.selectorOverflow);
|
|
179
185
|
}
|
|
180
186
|
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
181
187
|
__proto__: null,
|
|
182
|
-
Breakpoint:
|
|
183
|
-
Collection:
|
|
184
|
-
FocusTrap:
|
|
185
|
-
|
|
186
|
-
getConfig:
|
|
187
|
-
getPrefix:
|
|
188
|
-
localStore:
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
updateGlobalState:
|
|
188
|
+
Breakpoint: L$2,
|
|
189
|
+
Collection: S$3,
|
|
190
|
+
FocusTrap: q$2,
|
|
191
|
+
cssVar: E$2,
|
|
192
|
+
getConfig: F$3,
|
|
193
|
+
getPrefix: T$2,
|
|
194
|
+
localStore: k$3,
|
|
195
|
+
teleport: w$2,
|
|
196
|
+
transition: C$2,
|
|
197
|
+
updateGlobalState: N$3
|
|
192
198
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
stateAttr: "aria-checked",
|
|
196
|
-
stateValue: "mixed"
|
|
197
|
-
};
|
|
198
|
-
let r$1 = class r {
|
|
199
|
-
constructor(t) {
|
|
200
|
-
this.defaults = i, this.settings = { ...this.defaults, ...t }, this.__handlerClick = this.handlerClick.bind(this), this.settings.autoInit && this.init();
|
|
201
|
-
}
|
|
202
|
-
init(t = null) {
|
|
203
|
-
t && (this.settings = { ...this.settings, ...t });
|
|
204
|
-
const e = `[${this.settings.stateAttr}="${this.settings.stateValue}"]`, s2 = document.querySelectorAll(e);
|
|
205
|
-
this.setIndeterminate(s2), document.addEventListener("click", this.__handlerClick, false);
|
|
206
|
-
}
|
|
207
|
-
destroy() {
|
|
208
|
-
document.removeEventListener("click", this.__handlerClick, false);
|
|
209
|
-
}
|
|
210
|
-
handlerClick(t) {
|
|
211
|
-
const e = `[${this.settings.stateAttr}="${this.settings.stateValue}"]`, s2 = t.target.closest(e);
|
|
212
|
-
s2 && (this.removeAriaState(s2), this.setIndeterminate(s2));
|
|
213
|
-
}
|
|
214
|
-
setAriaState(t, e = this.settings.stateValue) {
|
|
215
|
-
t = t.forEach ? t : [t], t.forEach((s2) => {
|
|
216
|
-
s2.setAttribute(this.settings.stateAttr, e);
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
removeAriaState(t) {
|
|
220
|
-
t = t.forEach ? t : [t], t.forEach((e) => {
|
|
221
|
-
e.removeAttribute(this.settings.stateAttr);
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
setIndeterminate(t) {
|
|
225
|
-
t = t.forEach ? t : [t], t.forEach((e) => {
|
|
226
|
-
e.hasAttribute(this.settings.stateAttr) ? e.indeterminate = true : e.indeterminate = false;
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
var S$2 = (t, e, s2) => {
|
|
231
|
-
if (!e.has(t))
|
|
232
|
-
throw TypeError("Cannot " + s2);
|
|
199
|
+
var I$1 = (t) => {
|
|
200
|
+
throw TypeError(t);
|
|
233
201
|
};
|
|
234
|
-
var
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
},
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}, l$1 = (t, e, s2) => (I$2(t, e, "read from private field"), s2 ? s2.call(t) : e.get(t)), w$1 = (t, e, s2) => {
|
|
243
|
-
if (e.has(t))
|
|
244
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
245
|
-
e instanceof WeakSet ? e.add(t) : e.set(t, s2);
|
|
246
|
-
}, h$1 = (t, e, s2, i2) => (I$2(t, e, "write to private field"), i2 ? i2.call(t, s2) : e.set(t, s2), s2), c$1;
|
|
247
|
-
let M$2 = class M {
|
|
248
|
-
constructor(e, s2) {
|
|
249
|
-
w$1(this, c$1, void 0), this.value = e, h$1(this, c$1, s2), this.mql = null;
|
|
202
|
+
var O$1 = (t, s2, e) => s2.has(t) || I$1("Cannot " + e);
|
|
203
|
+
var w$1 = (t, s2, e) => (O$1(t, s2, "read from private field"), e ? e.call(t) : s2.get(t)), S$2 = (t, s2, e) => s2.has(t) ? I$1("Cannot add the same private member more than once") : s2 instanceof WeakSet ? s2.add(t) : s2.set(t, e), k$2 = (t, s2, e, i) => (O$1(t, s2, "write to private field"), s2.set(t, e), e);
|
|
204
|
+
var M$2 = (t) => {
|
|
205
|
+
throw TypeError(t);
|
|
206
|
+
}, y$1 = (t, s2, e) => s2.has(t) || M$2("Cannot " + e), l = (t, s2, e) => (y$1(t, s2, "read from private field"), e ? e.call(t) : s2.get(t)), $$1 = (t, s2, e) => s2.has(t) ? M$2("Cannot add the same private member more than once") : s2 instanceof WeakSet ? s2.add(t) : s2.set(t, e), h$1 = (t, s2, e, i) => (y$1(t, s2, "write to private field"), s2.set(t, e), e), d$1;
|
|
207
|
+
let B$2 = class B {
|
|
208
|
+
constructor(s2, e) {
|
|
209
|
+
$$1(this, d$1), this.value = s2, h$1(this, d$1, e), this.mql = null;
|
|
250
210
|
}
|
|
251
211
|
get handler() {
|
|
252
|
-
return l
|
|
212
|
+
return l(this, d$1);
|
|
253
213
|
}
|
|
254
214
|
// Unmount existing handler before setting a new one.
|
|
255
|
-
set handler(
|
|
256
|
-
this.mql &&
|
|
215
|
+
set handler(s2) {
|
|
216
|
+
this.mql && this.mql.removeEventListener("change", l(this, d$1)), h$1(this, d$1, s2);
|
|
257
217
|
}
|
|
258
|
-
mount(
|
|
259
|
-
return
|
|
218
|
+
mount(s2, e) {
|
|
219
|
+
return s2 && (this.value = s2), e && h$1(this, d$1, e), this.value ? (this.mql = window.matchMedia(`(min-width: ${this.value})`), this.mql.addEventListener("change", l(this, d$1)), l(this, d$1).call(this, this.mql), this) : this;
|
|
260
220
|
}
|
|
261
221
|
unmount() {
|
|
262
|
-
return this.mql ? (
|
|
222
|
+
return this.mql ? (this.mql.removeEventListener("change", l(this, d$1)), this.value = null, h$1(this, d$1, null), this.mql = null, this) : this;
|
|
263
223
|
}
|
|
264
224
|
};
|
|
265
|
-
|
|
266
|
-
let
|
|
225
|
+
d$1 = /* @__PURE__ */ new WeakMap();
|
|
226
|
+
let j$1 = class j {
|
|
267
227
|
constructor() {
|
|
268
228
|
this.collection = [];
|
|
269
229
|
}
|
|
270
|
-
async register(
|
|
271
|
-
return await this.deregister(
|
|
230
|
+
async register(s2) {
|
|
231
|
+
return await this.deregister(s2), this.collection.push(s2), this.collection;
|
|
272
232
|
}
|
|
273
|
-
async deregister(
|
|
274
|
-
const
|
|
275
|
-
if (
|
|
276
|
-
const
|
|
277
|
-
Object.getOwnPropertyNames(
|
|
278
|
-
delete
|
|
279
|
-
}), this.collection.splice(
|
|
233
|
+
async deregister(s2) {
|
|
234
|
+
const e = this.collection.findIndex((i) => i === s2);
|
|
235
|
+
if (e >= 0) {
|
|
236
|
+
const i = this.collection[e];
|
|
237
|
+
Object.getOwnPropertyNames(i).forEach((n) => {
|
|
238
|
+
delete i[n];
|
|
239
|
+
}), this.collection.splice(e, 1);
|
|
280
240
|
}
|
|
281
241
|
return this.collection;
|
|
282
242
|
}
|
|
283
|
-
async registerCollection(
|
|
284
|
-
return await Promise.all(Array.from(
|
|
285
|
-
this.register(
|
|
243
|
+
async registerCollection(s2) {
|
|
244
|
+
return await Promise.all(Array.from(s2, (e) => {
|
|
245
|
+
this.register(e);
|
|
286
246
|
})), this.collection;
|
|
287
247
|
}
|
|
288
248
|
async deregisterCollection() {
|
|
@@ -290,42 +250,42 @@
|
|
|
290
250
|
await this.deregister(this.collection[0]);
|
|
291
251
|
return this.collection;
|
|
292
252
|
}
|
|
293
|
-
get(
|
|
294
|
-
return this.collection.find((
|
|
253
|
+
get(s2, e = "id") {
|
|
254
|
+
return this.collection.find((i) => i[e] === s2);
|
|
295
255
|
}
|
|
296
256
|
};
|
|
297
|
-
const
|
|
257
|
+
const o$1 = {
|
|
298
258
|
inert: ":not([inert]):not([inert] *)",
|
|
299
259
|
negTabIndex: ':not([tabindex^="-"])',
|
|
300
260
|
disabled: ":not(:disabled)"
|
|
301
|
-
},
|
|
302
|
-
`a[href]${
|
|
303
|
-
`area[href]${
|
|
304
|
-
`input:not([type="hidden"]):not([type="radio"])${
|
|
305
|
-
`input[type="radio"]${
|
|
306
|
-
`select${
|
|
307
|
-
`textarea${
|
|
308
|
-
`button${
|
|
309
|
-
`details${
|
|
261
|
+
}, N$2 = [
|
|
262
|
+
`a[href]${o$1.inert}${o$1.negTabIndex}`,
|
|
263
|
+
`area[href]${o$1.inert}${o$1.negTabIndex}`,
|
|
264
|
+
`input:not([type="hidden"]):not([type="radio"])${o$1.inert}${o$1.negTabIndex}${o$1.disabled}`,
|
|
265
|
+
`input[type="radio"]${o$1.inert}${o$1.negTabIndex}${o$1.disabled}`,
|
|
266
|
+
`select${o$1.inert}${o$1.negTabIndex}${o$1.disabled}`,
|
|
267
|
+
`textarea${o$1.inert}${o$1.negTabIndex}${o$1.disabled}`,
|
|
268
|
+
`button${o$1.inert}${o$1.negTabIndex}${o$1.disabled}`,
|
|
269
|
+
`details${o$1.inert} > summary:first-of-type${o$1.negTabIndex}`,
|
|
310
270
|
// Discard until Firefox supports `:has()`
|
|
311
271
|
// See: https://github.com/KittyGiraudel/focusable-selectors/issues/12
|
|
312
272
|
// `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,
|
|
313
|
-
`iframe${
|
|
314
|
-
`audio[controls]${
|
|
315
|
-
`video[controls]${
|
|
316
|
-
`[contenteditable]${
|
|
317
|
-
`[tabindex]${
|
|
273
|
+
`iframe${o$1.inert}${o$1.negTabIndex}`,
|
|
274
|
+
`audio[controls]${o$1.inert}${o$1.negTabIndex}`,
|
|
275
|
+
`video[controls]${o$1.inert}${o$1.negTabIndex}`,
|
|
276
|
+
`[contenteditable]${o$1.inert}${o$1.negTabIndex}`,
|
|
277
|
+
`[tabindex]${o$1.inert}${o$1.negTabIndex}`
|
|
318
278
|
];
|
|
319
|
-
var v$1,
|
|
320
|
-
let
|
|
321
|
-
constructor(
|
|
322
|
-
|
|
279
|
+
var v$1, g$1, f$1;
|
|
280
|
+
let q$1 = class q {
|
|
281
|
+
constructor(s2 = null, e = "[data-focus]") {
|
|
282
|
+
$$1(this, v$1), $$1(this, g$1), $$1(this, f$1), this.el = s2, this.selectorFocus = e, h$1(this, g$1, K$2.bind(this)), h$1(this, f$1, V$2.bind(this));
|
|
323
283
|
}
|
|
324
284
|
get focusable() {
|
|
325
|
-
return l
|
|
285
|
+
return l(this, v$1);
|
|
326
286
|
}
|
|
327
|
-
set focusable(
|
|
328
|
-
h$1(this, v$1,
|
|
287
|
+
set focusable(s2) {
|
|
288
|
+
h$1(this, v$1, s2), l(this, v$1).length ? (document.removeEventListener("keydown", l(this, f$1)), document.addEventListener("keydown", l(this, g$1))) : (document.removeEventListener("keydown", l(this, g$1)), document.addEventListener("keydown", l(this, f$1)));
|
|
329
289
|
}
|
|
330
290
|
get focusableFirst() {
|
|
331
291
|
return this.focusable[0];
|
|
@@ -333,71 +293,83 @@
|
|
|
333
293
|
get focusableLast() {
|
|
334
294
|
return this.focusable[this.focusable.length - 1];
|
|
335
295
|
}
|
|
336
|
-
mount(
|
|
337
|
-
|
|
296
|
+
mount(s2, e) {
|
|
297
|
+
s2 && (this.el = s2), e && (this.selectorFocus = e), this.focusable = this.getFocusable(), this.focus();
|
|
338
298
|
}
|
|
339
299
|
unmount() {
|
|
340
|
-
this.el = null, this.focusable = [], document.removeEventListener("keydown", l
|
|
300
|
+
this.el = null, this.focusable = [], document.removeEventListener("keydown", l(this, g$1)), document.removeEventListener("keydown", l(this, f$1));
|
|
341
301
|
}
|
|
342
|
-
focus(
|
|
343
|
-
(
|
|
302
|
+
focus(s2 = this.el, e = this.selectorFocus) {
|
|
303
|
+
(s2.querySelector(e) || s2).focus();
|
|
344
304
|
}
|
|
345
|
-
getFocusable(
|
|
346
|
-
const
|
|
347
|
-
return
|
|
348
|
-
|
|
349
|
-
}),
|
|
305
|
+
getFocusable(s2 = this.el) {
|
|
306
|
+
const e = [], i = document.activeElement, n = s2.scrollTop;
|
|
307
|
+
return s2.querySelectorAll(N$2.join(",")).forEach((c2) => {
|
|
308
|
+
c2.focus(), document.activeElement === c2 && e.push(c2);
|
|
309
|
+
}), s2.scrollTop = n, i.focus(), e;
|
|
350
310
|
}
|
|
351
311
|
};
|
|
352
|
-
v$1 = /* @__PURE__ */ new WeakMap(),
|
|
353
|
-
function
|
|
312
|
+
v$1 = /* @__PURE__ */ new WeakMap(), g$1 = /* @__PURE__ */ new WeakMap(), f$1 = /* @__PURE__ */ new WeakMap();
|
|
313
|
+
function K$2(t) {
|
|
354
314
|
(t.key === "Tab" || t.keyCode === 9) && (t.shiftKey ? (document.activeElement === this.focusableFirst || document.activeElement === this.el) && (t.preventDefault(), this.focusableLast.focus()) : (document.activeElement === this.focusableLast || document.activeElement === this.el) && (t.preventDefault(), this.focusableFirst.focus()));
|
|
355
315
|
}
|
|
356
|
-
function
|
|
316
|
+
function V$2(t) {
|
|
357
317
|
(t.key === "Tab" || t.keyCode === 9) && t.preventDefault();
|
|
358
318
|
}
|
|
359
|
-
function
|
|
360
|
-
|
|
361
|
-
return s2 ? JSON.parse(s2) : {};
|
|
319
|
+
function D$2() {
|
|
320
|
+
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
362
321
|
}
|
|
363
|
-
function W$1() {
|
|
364
|
-
|
|
322
|
+
function W$1(t, s2 = document.body) {
|
|
323
|
+
if (t.slice(0, 2) !== "--") {
|
|
324
|
+
const i = D$2();
|
|
325
|
+
i && (t = `${i}${t}`), t = `--${t}`;
|
|
326
|
+
}
|
|
327
|
+
const e = getComputedStyle(s2).getPropertyValue(t).trim();
|
|
328
|
+
if (e)
|
|
329
|
+
return e;
|
|
330
|
+
throw new Error(`CSS variable "${t}" was not found!`);
|
|
365
331
|
}
|
|
366
|
-
function
|
|
367
|
-
const
|
|
332
|
+
function _$2(t, s2) {
|
|
333
|
+
const e = (t.getAttribute(`data-${s2}`) || "").replace(/'/g, '"');
|
|
334
|
+
return e ? JSON.parse(e) : {};
|
|
335
|
+
}
|
|
336
|
+
function J$2(t, s2 = true) {
|
|
337
|
+
const e = localStorage.getItem(t), i = e ? JSON.parse(e) : {};
|
|
368
338
|
return {
|
|
369
339
|
get(n) {
|
|
370
|
-
return n ?
|
|
340
|
+
return n ? i[n] : i;
|
|
371
341
|
},
|
|
372
|
-
set(n,
|
|
373
|
-
return
|
|
342
|
+
set(n, c2) {
|
|
343
|
+
return c2 ? i[n] = c2 : delete i[n], s2 && localStorage.setItem(t, JSON.stringify(i)), i;
|
|
374
344
|
}
|
|
375
345
|
};
|
|
376
346
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
t.classList.remove(
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
function G$1(t, e) {
|
|
387
|
-
e && document.querySelectorAll(e).forEach((s2) => {
|
|
388
|
-
t ? s2.style.overflow = "hidden" : s2.style.removeProperty("overflow");
|
|
347
|
+
function F$2(t, s2, e, i = "transition-duration") {
|
|
348
|
+
return new Promise((n) => {
|
|
349
|
+
if (typeof i == "string") {
|
|
350
|
+
const c2 = W$1(i, t), r = !!c2.includes("ms");
|
|
351
|
+
i = parseFloat(c2) * (r ? 1 : 1e3);
|
|
352
|
+
}
|
|
353
|
+
t.classList.remove(s2.finish), t.classList.add(e.start), setTimeout(() => {
|
|
354
|
+
t.classList.add(e.finish), t.classList.remove(e.start), n(t);
|
|
355
|
+
}, i);
|
|
389
356
|
});
|
|
390
357
|
}
|
|
391
|
-
function
|
|
392
|
-
|
|
393
|
-
t ?
|
|
358
|
+
function z$1(t, s2) {
|
|
359
|
+
s2 && document.querySelectorAll(s2).forEach((e) => {
|
|
360
|
+
t ? e.style.overflow = "hidden" : e.style.removeProperty("overflow");
|
|
394
361
|
});
|
|
395
362
|
}
|
|
396
|
-
function
|
|
397
|
-
|
|
363
|
+
function G$1(t, s2) {
|
|
364
|
+
s2 && document.querySelectorAll(s2).forEach((e) => {
|
|
365
|
+
t ? (e.inert = true, e.setAttribute("aria-hidden", true)) : (e.inert = null, e.removeAttribute("aria-hidden"));
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
function C$1(t, s2) {
|
|
369
|
+
G$1(!!t, s2.selectorInert), z$1(!!t, s2.selectorOverflow);
|
|
398
370
|
}
|
|
399
|
-
const
|
|
400
|
-
|
|
371
|
+
const H$1 = {
|
|
372
|
+
autoMount: false,
|
|
401
373
|
// Data attributes
|
|
402
374
|
dataOpen: "drawer-open",
|
|
403
375
|
dataClose: "drawer-close",
|
|
@@ -407,6 +379,7 @@
|
|
|
407
379
|
// Selectors
|
|
408
380
|
selectorDrawer: ".drawer",
|
|
409
381
|
selectorDialog: ".drawer__dialog",
|
|
382
|
+
selectorScreen: ".drawer",
|
|
410
383
|
selectorFocus: "[data-focus]",
|
|
411
384
|
selectorInert: null,
|
|
412
385
|
selectorOverflow: "body",
|
|
@@ -424,234 +397,233 @@
|
|
|
424
397
|
store: true,
|
|
425
398
|
storeKey: "VB:DrawerState",
|
|
426
399
|
setTabindex: true,
|
|
427
|
-
transition: true
|
|
400
|
+
transition: true,
|
|
401
|
+
transitionDuration: "drawer-transition-duration"
|
|
428
402
|
};
|
|
429
|
-
function
|
|
430
|
-
|
|
403
|
+
function Q$2(t) {
|
|
404
|
+
t.store === "opened" ? t.open(false, false) : t.store === "closed" ? t.close(false, false) : t.store === "indeterminate" ? t.state = "indeterminate" : t.el.classList.contains(t.getSetting("stateOpened")) ? t.open(false, false) : t.el.classList.contains(t.getSetting("stateClosed")) ? t.close(false, false) : t.state = "indeterminate";
|
|
405
|
+
}
|
|
406
|
+
async function R$1(t) {
|
|
407
|
+
t.store === "opened" ? await t.open(false, false) : t.store === "closed" ? await t.close(false, false) : t.store === "indeterminate" ? t.state != "indeterminate" && (t.state = "indeterminate") : (t.state != t.inlineState && (t.state = t.inlineState), t.inlineState === "opened" ? await t.open(false, false) : t.inlineState === "closed" && await t.close(false, false));
|
|
408
|
+
}
|
|
409
|
+
function U(t) {
|
|
410
|
+
const s2 = D$2(), e = t.getAttribute(`data-${this.settings.dataBreakpoint}`);
|
|
411
|
+
return this.settings.breakpoints && this.settings.breakpoints[e] ? this.settings.breakpoints[e] : getComputedStyle(document.body).getPropertyValue(`--${s2}breakpoint-${e}`).trim() ? getComputedStyle(document.body).getPropertyValue(`--${s2}breakpoint-${e}`).trim() : e;
|
|
412
|
+
}
|
|
413
|
+
function m$1(t) {
|
|
414
|
+
const s2 = typeof t == "string" ? this.get(t) : this.get(t.id);
|
|
415
|
+
if (s2)
|
|
416
|
+
return s2;
|
|
417
|
+
throw new Error(`Drawer not found in collection with id of "${t.id || t}".`);
|
|
418
|
+
}
|
|
419
|
+
function P$1(t) {
|
|
420
|
+
t.state === "opened" ? t.mode === "modal" ? this.focusTrap.mount(t.dialog, this.settings.selectorFocus) : this.focusTrap.focus(t.dialog, this.settings.selectorFocus) : (t.trigger && (t.trigger.focus(), t.trigger = null), this.focusTrap.unmount());
|
|
421
|
+
}
|
|
422
|
+
async function X(t) {
|
|
423
|
+
const s2 = t.target.closest(`
|
|
431
424
|
[data-${this.settings.dataOpen}],
|
|
432
425
|
[data-${this.settings.dataToggle}],
|
|
433
426
|
[data-${this.settings.dataClose}]
|
|
434
427
|
`);
|
|
435
|
-
if (
|
|
436
|
-
t.preventDefault(),
|
|
437
|
-
const n =
|
|
438
|
-
n.trigger =
|
|
439
|
-
}),
|
|
440
|
-
const n =
|
|
441
|
-
n.trigger =
|
|
442
|
-
}),
|
|
443
|
-
if (
|
|
444
|
-
const n =
|
|
445
|
-
n.trigger =
|
|
428
|
+
if (s2) {
|
|
429
|
+
t.preventDefault(), s2.matches(`[data-${this.settings.dataToggle}]`) && s2.getAttribute(`data-${this.settings.dataToggle}`).trim().split(" ").forEach((i) => {
|
|
430
|
+
const n = m$1.call(this, i);
|
|
431
|
+
return n.trigger = s2, n.toggle();
|
|
432
|
+
}), s2.matches(`[data-${this.settings.dataOpen}]`) && s2.getAttribute(`data-${this.settings.dataOpen}`).trim().split(" ").forEach((i) => {
|
|
433
|
+
const n = m$1.call(this, i);
|
|
434
|
+
return n.trigger = s2, n.open();
|
|
435
|
+
}), s2.matches(`[data-${this.settings.dataClose}]`) && s2.getAttribute(`data-${this.settings.dataClose}`).trim().split(" ").forEach((i) => {
|
|
436
|
+
if (i) {
|
|
437
|
+
const n = m$1.call(this, i);
|
|
438
|
+
return n.trigger = s2, n.close();
|
|
446
439
|
} else {
|
|
447
440
|
const n = t.target.closest(this.settings.selectorDrawer);
|
|
448
|
-
n
|
|
441
|
+
if (n) return this.close(n);
|
|
449
442
|
}
|
|
450
443
|
});
|
|
451
444
|
return;
|
|
452
445
|
}
|
|
453
|
-
t.target.matches(this.settings.
|
|
446
|
+
if (this.activeModal && t.target.matches(this.settings.selectorScreen))
|
|
447
|
+
return this.close(this.activeModal.id);
|
|
454
448
|
}
|
|
455
|
-
function
|
|
456
|
-
if (t.key === "Escape")
|
|
457
|
-
|
|
458
|
-
e && this.close(e);
|
|
459
|
-
}
|
|
449
|
+
function Y(t) {
|
|
450
|
+
if (t.key === "Escape" && this.activeModal)
|
|
451
|
+
return this.close(this.activeModal);
|
|
460
452
|
}
|
|
461
|
-
async function L$1(t,
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
delete i2[n];
|
|
469
|
-
}), this.collection.splice(s2, 1);
|
|
453
|
+
async function L$1(t, s2 = true) {
|
|
454
|
+
const e = this.collection.findIndex((i) => i.id === t.id);
|
|
455
|
+
if (e >= 0) {
|
|
456
|
+
const i = this.collection[e];
|
|
457
|
+
s2 && i.state === "opened" && await i.close(false), this.store.set(i.id), i.unmountBreakpoint(), Object.getOwnPropertyNames(i).forEach((n) => {
|
|
458
|
+
delete i[n];
|
|
459
|
+
}), this.collection.splice(e, 1);
|
|
470
460
|
}
|
|
471
461
|
return this.collection;
|
|
472
462
|
}
|
|
473
|
-
function
|
|
474
|
-
const
|
|
475
|
-
return
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
}
|
|
483
|
-
function O$1(t) {
|
|
484
|
-
return typeof t == "string" ? t : typeof t.hasAttribute == "function" ? t.hasAttribute(`data-${this.settings.dataOpen}`) ? t.getAttribute(`data-${this.settings.dataOpen}`) : t.hasAttribute(`data-${this.settings.dataClose}`) ? t.getAttribute(`data-${this.settings.dataClose}`) || false : t.hasAttribute(`data-${this.settings.dataToggle}`) ? t.getAttribute(`data-${this.settings.dataToggle}`) : t.closest(this.settings.selectorDrawer) ? (t = t.closest(this.settings.selectorDrawer), t.id || false) : false : t.id ? t.id : false;
|
|
485
|
-
}
|
|
486
|
-
function Y(t) {
|
|
487
|
-
const e = O$1.call(this, t);
|
|
488
|
-
if (e) {
|
|
489
|
-
const s2 = document.querySelector(`#${e}`), i2 = s2 ? s2.querySelector(this.settings.selectorDialog) : null;
|
|
490
|
-
return !s2 && !i2 ? { error: new Error(`No drawer elements found using the ID: "${e}".`) } : i2 ? { drawer: s2, dialog: i2 } : { error: new Error("Drawer is missing dialog element.") };
|
|
491
|
-
} else
|
|
492
|
-
return { error: new Error("Could not resolve the drawer ID.") };
|
|
493
|
-
}
|
|
494
|
-
async function A$1(t) {
|
|
495
|
-
this.store.get(t.id) ? this.store.get(t.id) === "opened" ? await t.open(false, false) : await t.close(false, false) : t.el.classList.contains(this.settings.stateOpened) ? t.state = "opened" : (t.el.classList.remove(this.settings.stateOpening), t.el.classList.remove(this.settings.stateClosing), t.el.classList.add(this.settings.stateClosed));
|
|
496
|
-
}
|
|
497
|
-
function D$2(t) {
|
|
498
|
-
t.state === "opened" ? t.mode === "modal" ? this.focusTrap.mount(t.dialog, this.settings.selectorFocus) : this.focusTrap.focus(t.dialog, this.settings.selectorFocus) : (t.trigger && (t.trigger.focus(), t.trigger = null), this.focusTrap.unmount());
|
|
499
|
-
}
|
|
500
|
-
async function C$1(t, e, s2 = true) {
|
|
501
|
-
const i2 = y$1.call(this, t), n = { ...this.settings, ...i2.settings };
|
|
502
|
-
return e !== void 0 && (n.transition = e), i2.state === "closed" && (i2.state = "opening", await J$2(i2.el, n), i2.mode === "modal" && k$2(true, n), i2.state = "opened"), s2 && D$2.call(this, i2), i2.el.dispatchEvent(new CustomEvent(n.customEventPrefix + "opened", {
|
|
463
|
+
async function x$1(t, s2, e = true) {
|
|
464
|
+
const i = m$1.call(this, t), n = { ...this.settings, ...i.settings };
|
|
465
|
+
return s2 !== void 0 && (n.transition = s2), (i.state === "closed" || i.state === "indeterminate") && (i.state = "opening", n.transition ? await F$2(i.el, {
|
|
466
|
+
start: n.stateClosing,
|
|
467
|
+
finish: n.stateClosed
|
|
468
|
+
}, {
|
|
469
|
+
start: n.stateOpening,
|
|
470
|
+
finish: n.stateOpened
|
|
471
|
+
}, n.transitionDuration) : (i.el.classList.add(n.stateOpened), i.el.classList.remove(n.stateClosed)), i.state = "opened", i.mode === "modal" && C$1(true, n), e && P$1.call(this, i), i.el.dispatchEvent(new CustomEvent(n.customEventPrefix + "opened", {
|
|
503
472
|
detail: this,
|
|
504
473
|
bubbles: true
|
|
505
|
-
})),
|
|
474
|
+
}))), i;
|
|
506
475
|
}
|
|
507
|
-
async function
|
|
508
|
-
const
|
|
509
|
-
return
|
|
476
|
+
async function E$1(t, s2, e = true) {
|
|
477
|
+
const i = m$1.call(this, t), n = { ...this.settings, ...i.settings };
|
|
478
|
+
return s2 !== void 0 && (n.transition = s2), (i.state === "opened" || i.state === "indeterminate") && (i.state = "closing", document.activeElement.blur(), n.transition ? await F$2(i.el, {
|
|
479
|
+
start: n.stateOpening,
|
|
480
|
+
finish: n.stateOpened
|
|
481
|
+
}, {
|
|
482
|
+
start: n.stateClosing,
|
|
483
|
+
finish: n.stateClosed
|
|
484
|
+
}, n.transitionDuration) : (i.el.classList.add(n.stateClosed), i.el.classList.remove(n.stateOpened)), i.state = "closed", i.mode === "modal" && C$1(false, n), e && P$1.call(this, i), i.el.dispatchEvent(new CustomEvent(n.customEventPrefix + "closed", {
|
|
510
485
|
detail: this,
|
|
511
486
|
bubbles: true
|
|
512
|
-
}))),
|
|
487
|
+
}))), i;
|
|
513
488
|
}
|
|
514
|
-
async function
|
|
515
|
-
const
|
|
516
|
-
return
|
|
489
|
+
async function A$1(t, s2, e) {
|
|
490
|
+
const i = m$1.call(this, t);
|
|
491
|
+
return i.state === "closed" ? x$1.call(this, i, s2, e) : E$1.call(this, i, s2, e);
|
|
517
492
|
}
|
|
518
493
|
function Z$1(t) {
|
|
519
494
|
switch (t.mode) {
|
|
520
495
|
case "inline":
|
|
521
|
-
return j.call(this, t);
|
|
522
|
-
case "modal":
|
|
523
496
|
return tt$1.call(this, t);
|
|
497
|
+
case "modal":
|
|
498
|
+
return et$1.call(this, t);
|
|
524
499
|
default:
|
|
525
500
|
throw new Error(`"${t.mode}" is not a valid drawer mode.`);
|
|
526
501
|
}
|
|
527
502
|
}
|
|
528
|
-
async function
|
|
529
|
-
return t.el.classList.remove(t.getSetting("classModal")), t.dialog.removeAttribute("aria-modal"),
|
|
503
|
+
async function tt$1(t) {
|
|
504
|
+
return t.el.classList.remove(t.getSetting("classModal")), t.dialog.removeAttribute("aria-modal"), C$1(false, { ...this.settings, ...t.settings }), this.focusTrap.unmount(), await R$1(t), t.el.dispatchEvent(new CustomEvent(t.getSetting("customEventPrefix") + "switchMode", {
|
|
530
505
|
detail: this,
|
|
531
506
|
bubbles: true
|
|
532
507
|
})), t;
|
|
533
508
|
}
|
|
534
|
-
async function
|
|
535
|
-
return t.el.classList.add(t.getSetting("classModal")), t.dialog.setAttribute("aria-modal", "true"),
|
|
509
|
+
async function et$1(t) {
|
|
510
|
+
return t.el.classList.add(t.getSetting("classModal")), t.dialog.setAttribute("aria-modal", "true"), await E$1.call(this, t, false, false), t.el.dispatchEvent(new CustomEvent(t.getSetting("customEventPrefix") + "switchMode", {
|
|
536
511
|
detail: this,
|
|
537
512
|
bubbles: true
|
|
538
513
|
})), t;
|
|
539
514
|
}
|
|
540
|
-
async function
|
|
515
|
+
async function st$1(t, s2 = {}) {
|
|
541
516
|
await L$1.call(this, t, false);
|
|
542
|
-
const
|
|
543
|
-
|
|
544
|
-
|
|
517
|
+
const e = this, i = new B$2();
|
|
518
|
+
let n, c2 = "indeterminate";
|
|
519
|
+
const r = {
|
|
520
|
+
id: t.id,
|
|
521
|
+
el: t,
|
|
522
|
+
dialog: null,
|
|
523
|
+
trigger: null,
|
|
524
|
+
settings: { ..._$2(t, this.settings.dataConfig), ...s2 },
|
|
525
|
+
inlineState: "indeterminate",
|
|
526
|
+
get breakpoint() {
|
|
527
|
+
return U.call(e, t);
|
|
545
528
|
},
|
|
546
|
-
|
|
547
|
-
return
|
|
529
|
+
get store() {
|
|
530
|
+
return e.store.get(this.id);
|
|
548
531
|
},
|
|
549
|
-
|
|
550
|
-
return
|
|
532
|
+
get mode() {
|
|
533
|
+
return n;
|
|
551
534
|
},
|
|
552
|
-
|
|
553
|
-
|
|
535
|
+
set mode(a2) {
|
|
536
|
+
n = a2, Z$1.call(e, this);
|
|
554
537
|
},
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
return i2.mount(o2, d2), this;
|
|
538
|
+
get state() {
|
|
539
|
+
return c2;
|
|
558
540
|
},
|
|
559
|
-
|
|
560
|
-
|
|
541
|
+
set state(a2) {
|
|
542
|
+
c2 = a2, this.mode === "inline" && a2 != "opening" && a2 != "closing" && (this.inlineState = a2, this.getSetting("store") && e.store.set(this.id, a2)), a2 === "indeterminate" && (this.el.classList.remove(this.getSetting("stateOpened")), this.el.classList.remove(this.getSetting("stateOpening")), this.el.classList.remove(this.getSetting("stateClosed")), this.el.classList.remove(this.getSetting("stateClosing")));
|
|
561
543
|
},
|
|
562
|
-
|
|
563
|
-
return
|
|
544
|
+
open(a2, u2) {
|
|
545
|
+
return x$1.call(e, this, a2, u2);
|
|
564
546
|
},
|
|
565
|
-
|
|
566
|
-
return
|
|
567
|
-
}
|
|
568
|
-
}, a2 = {
|
|
569
|
-
id: t.id,
|
|
570
|
-
el: t,
|
|
571
|
-
dialog: e,
|
|
572
|
-
trigger: null,
|
|
573
|
-
settings: K$2(t, this.settings.dataConfig),
|
|
574
|
-
get breakpoint() {
|
|
575
|
-
return X.call(s2, t);
|
|
547
|
+
close(a2, u2) {
|
|
548
|
+
return E$1.call(e, this, a2, u2);
|
|
576
549
|
},
|
|
577
|
-
|
|
578
|
-
return
|
|
550
|
+
toggle(a2, u2) {
|
|
551
|
+
return A$1.call(e, this, a2, u2);
|
|
579
552
|
},
|
|
580
|
-
|
|
581
|
-
|
|
553
|
+
deregister() {
|
|
554
|
+
return L$1.call(e, this);
|
|
582
555
|
},
|
|
583
|
-
|
|
584
|
-
|
|
556
|
+
mountBreakpoint() {
|
|
557
|
+
const a2 = this.breakpoint, u2 = this.handleBreakpoint.bind(this);
|
|
558
|
+
return i.mount(a2, u2), this;
|
|
585
559
|
},
|
|
586
|
-
|
|
587
|
-
|
|
560
|
+
unmountBreakpoint() {
|
|
561
|
+
return i.unmount(), this;
|
|
562
|
+
},
|
|
563
|
+
handleBreakpoint(a2) {
|
|
564
|
+
const u2 = a2.matches ? "inline" : "modal";
|
|
565
|
+
return this.mode != u2 && (this.mode = u2), this;
|
|
588
566
|
},
|
|
589
|
-
|
|
567
|
+
getSetting(a2) {
|
|
568
|
+
return a2 in this.settings ? this.settings[a2] : e.settings[a2];
|
|
569
|
+
}
|
|
590
570
|
};
|
|
591
|
-
|
|
592
|
-
|
|
571
|
+
this.collection.push(r);
|
|
572
|
+
const T2 = t.querySelector(r.getSetting("selectorDialog"));
|
|
573
|
+
return r.dialog = T2 || t, r.getSetting("setTabindex") && r.dialog.setAttribute("tabindex", "-1"), await Q$2(r), r.inlineState = r.state, r.mode = t.classList.contains(r.getSetting("classModal")) ? "modal" : "inline", r.breakpoint && r.mountBreakpoint(), r;
|
|
593
574
|
}
|
|
594
|
-
var
|
|
595
|
-
let
|
|
596
|
-
constructor(
|
|
575
|
+
var p$1, b$1;
|
|
576
|
+
let nt$1 = class nt extends j$1 {
|
|
577
|
+
constructor(e) {
|
|
597
578
|
super();
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
this.defaults =
|
|
579
|
+
S$2(this, p$1);
|
|
580
|
+
S$2(this, b$1);
|
|
581
|
+
this.defaults = H$1, this.settings = { ...this.defaults, ...e }, this.focusTrap = new q$1(), this.store = J$2(this.settings.storeKey, this.settings.store), k$2(this, p$1, X.bind(this)), k$2(this, b$1, Y.bind(this)), this.settings.autoMount && this.mount();
|
|
601
582
|
}
|
|
602
583
|
get activeModal() {
|
|
603
|
-
return this.collection.find((
|
|
584
|
+
return this.collection.find((e) => e.state === "opened" && e.mode === "modal");
|
|
604
585
|
}
|
|
605
|
-
async
|
|
606
|
-
|
|
607
|
-
const
|
|
608
|
-
return await this.registerCollection(
|
|
586
|
+
async mount(e = null) {
|
|
587
|
+
e && (this.settings = { ...this.settings, ...e });
|
|
588
|
+
const i = document.querySelectorAll(this.settings.selectorDrawer);
|
|
589
|
+
return await this.registerCollection(i), this.settings.eventListeners && this.mountEventListeners(), this;
|
|
609
590
|
}
|
|
610
|
-
async
|
|
611
|
-
return await this.deregisterCollection(), this.settings.eventListeners && this.
|
|
591
|
+
async unmount() {
|
|
592
|
+
return await this.deregisterCollection(), this.settings.eventListeners && this.unmountEventListeners(), this;
|
|
612
593
|
}
|
|
613
|
-
|
|
614
|
-
document.addEventListener("click",
|
|
594
|
+
mountEventListeners() {
|
|
595
|
+
document.addEventListener("click", w$1(this, p$1), false), document.addEventListener("keydown", w$1(this, b$1), false);
|
|
615
596
|
}
|
|
616
|
-
|
|
617
|
-
document.removeEventListener("click",
|
|
597
|
+
unmountEventListeners() {
|
|
598
|
+
document.removeEventListener("click", w$1(this, p$1), false), document.removeEventListener("keydown", w$1(this, b$1), false);
|
|
618
599
|
}
|
|
619
|
-
register(
|
|
620
|
-
|
|
621
|
-
return
|
|
600
|
+
register(e, i = {}) {
|
|
601
|
+
let n = typeof e == "string" ? document.getElementById(e) : e;
|
|
602
|
+
return n ? st$1.call(this, n, i) : Promise.reject(new Error(`Failed to register; drawer not found with ID of: "${e.id || e}".`));
|
|
622
603
|
}
|
|
623
|
-
deregister(
|
|
624
|
-
|
|
625
|
-
return L$1.call(this,
|
|
604
|
+
deregister(e) {
|
|
605
|
+
let i = this.get(e.id || e);
|
|
606
|
+
return i ? L$1.call(this, i) : Promise.reject(new Error(`Failed to deregister; drawer does not exist in collection with ID of: "${e.id || e}".`));
|
|
626
607
|
}
|
|
627
|
-
open(
|
|
628
|
-
return
|
|
608
|
+
open(e, i, n) {
|
|
609
|
+
return x$1.call(this, e, i, n);
|
|
629
610
|
}
|
|
630
|
-
close(
|
|
631
|
-
return
|
|
611
|
+
close(e, i, n) {
|
|
612
|
+
return E$1.call(this, e, i, n);
|
|
632
613
|
}
|
|
633
|
-
toggle(
|
|
634
|
-
return
|
|
614
|
+
toggle(e, i, n) {
|
|
615
|
+
return A$1.call(this, e, i, n);
|
|
635
616
|
}
|
|
636
617
|
};
|
|
637
|
-
|
|
638
|
-
var
|
|
639
|
-
|
|
640
|
-
throw TypeError("Cannot " + s2);
|
|
618
|
+
p$1 = /* @__PURE__ */ new WeakMap(), b$1 = /* @__PURE__ */ new WeakMap();
|
|
619
|
+
var L = (i) => {
|
|
620
|
+
throw TypeError(i);
|
|
641
621
|
};
|
|
642
|
-
var
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
},
|
|
647
|
-
var k$1 = (t, e, s2) => {
|
|
648
|
-
if (!e.has(t))
|
|
649
|
-
throw TypeError("Cannot " + s2);
|
|
650
|
-
}, o = (t, e, s2) => (k$1(t, e, "read from private field"), s2 ? s2.call(t) : e.get(t)), y = (t, e, s2) => {
|
|
651
|
-
if (e.has(t))
|
|
652
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
653
|
-
e instanceof WeakSet ? e.add(t) : e.set(t, s2);
|
|
654
|
-
}, E = (t, e, s2, i2) => (k$1(t, e, "write to private field"), i2 ? i2.call(t, s2) : e.set(t, s2), s2);
|
|
622
|
+
var I = (i, e, t) => e.has(i) || L("Cannot " + t);
|
|
623
|
+
var f = (i, e, t) => (I(i, e, "read from private field"), t ? t.call(i) : e.get(i)), v = (i, e, t) => e.has(i) ? L("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), b = (i, e, t, s2) => (I(i, e, "write to private field"), e.set(i, t), t);
|
|
624
|
+
var S$1 = (i) => {
|
|
625
|
+
throw TypeError(i);
|
|
626
|
+
}, k$1 = (i, e, t) => e.has(i) || S$1("Cannot " + t), a = (i, e, t) => (k$1(i, e, "read from private field"), t ? t.call(i) : e.get(i)), y = (i, e, t) => e.has(i) ? S$1("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), w = (i, e, t, s2) => (k$1(i, e, "write to private field"), e.set(i, t), t);
|
|
655
627
|
class A {
|
|
656
628
|
constructor() {
|
|
657
629
|
this.collection = [];
|
|
@@ -660,18 +632,18 @@
|
|
|
660
632
|
return await this.deregister(e), this.collection.push(e), this.collection;
|
|
661
633
|
}
|
|
662
634
|
async deregister(e) {
|
|
663
|
-
const
|
|
664
|
-
if (
|
|
665
|
-
const
|
|
666
|
-
Object.getOwnPropertyNames(
|
|
667
|
-
delete
|
|
668
|
-
}), this.collection.splice(
|
|
635
|
+
const t = this.collection.findIndex((s2) => s2 === e);
|
|
636
|
+
if (t >= 0) {
|
|
637
|
+
const s2 = this.collection[t];
|
|
638
|
+
Object.getOwnPropertyNames(s2).forEach((n) => {
|
|
639
|
+
delete s2[n];
|
|
640
|
+
}), this.collection.splice(t, 1);
|
|
669
641
|
}
|
|
670
642
|
return this.collection;
|
|
671
643
|
}
|
|
672
644
|
async registerCollection(e) {
|
|
673
|
-
return await Promise.all(Array.from(e, (
|
|
674
|
-
this.register(
|
|
645
|
+
return await Promise.all(Array.from(e, (t) => {
|
|
646
|
+
this.register(t);
|
|
675
647
|
})), this.collection;
|
|
676
648
|
}
|
|
677
649
|
async deregisterCollection() {
|
|
@@ -679,42 +651,42 @@
|
|
|
679
651
|
await this.deregister(this.collection[0]);
|
|
680
652
|
return this.collection;
|
|
681
653
|
}
|
|
682
|
-
get(e,
|
|
683
|
-
return this.collection.find((
|
|
654
|
+
get(e, t = "id") {
|
|
655
|
+
return this.collection.find((s2) => s2[t] === e);
|
|
684
656
|
}
|
|
685
657
|
}
|
|
686
|
-
const
|
|
658
|
+
const o = {
|
|
687
659
|
inert: ":not([inert]):not([inert] *)",
|
|
688
660
|
negTabIndex: ':not([tabindex^="-"])',
|
|
689
661
|
disabled: ":not(:disabled)"
|
|
690
|
-
},
|
|
691
|
-
`a[href]${
|
|
692
|
-
`area[href]${
|
|
693
|
-
`input:not([type="hidden"]):not([type="radio"])${
|
|
694
|
-
`input[type="radio"]${
|
|
695
|
-
`select${
|
|
696
|
-
`textarea${
|
|
697
|
-
`button${
|
|
698
|
-
`details${
|
|
662
|
+
}, F$1 = [
|
|
663
|
+
`a[href]${o.inert}${o.negTabIndex}`,
|
|
664
|
+
`area[href]${o.inert}${o.negTabIndex}`,
|
|
665
|
+
`input:not([type="hidden"]):not([type="radio"])${o.inert}${o.negTabIndex}${o.disabled}`,
|
|
666
|
+
`input[type="radio"]${o.inert}${o.negTabIndex}${o.disabled}`,
|
|
667
|
+
`select${o.inert}${o.negTabIndex}${o.disabled}`,
|
|
668
|
+
`textarea${o.inert}${o.negTabIndex}${o.disabled}`,
|
|
669
|
+
`button${o.inert}${o.negTabIndex}${o.disabled}`,
|
|
670
|
+
`details${o.inert} > summary:first-of-type${o.negTabIndex}`,
|
|
699
671
|
// Discard until Firefox supports `:has()`
|
|
700
672
|
// See: https://github.com/KittyGiraudel/focusable-selectors/issues/12
|
|
701
673
|
// `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,
|
|
702
|
-
`iframe${
|
|
703
|
-
`audio[controls]${
|
|
704
|
-
`video[controls]${
|
|
705
|
-
`[contenteditable]${
|
|
706
|
-
`[tabindex]${
|
|
674
|
+
`iframe${o.inert}${o.negTabIndex}`,
|
|
675
|
+
`audio[controls]${o.inert}${o.negTabIndex}`,
|
|
676
|
+
`video[controls]${o.inert}${o.negTabIndex}`,
|
|
677
|
+
`[contenteditable]${o.inert}${o.negTabIndex}`,
|
|
678
|
+
`[tabindex]${o.inert}${o.negTabIndex}`
|
|
707
679
|
];
|
|
708
680
|
var g, c, d;
|
|
709
|
-
|
|
710
|
-
constructor(e = null,
|
|
711
|
-
y(this, g
|
|
681
|
+
class P {
|
|
682
|
+
constructor(e = null, t = "[data-focus]") {
|
|
683
|
+
y(this, g), y(this, c), y(this, d), this.el = e, this.selectorFocus = t, w(this, c, R.bind(this)), w(this, d, D$1.bind(this));
|
|
712
684
|
}
|
|
713
685
|
get focusable() {
|
|
714
|
-
return
|
|
686
|
+
return a(this, g);
|
|
715
687
|
}
|
|
716
688
|
set focusable(e) {
|
|
717
|
-
|
|
689
|
+
w(this, g, e), a(this, g).length ? (document.removeEventListener("keydown", a(this, d)), document.addEventListener("keydown", a(this, c))) : (document.removeEventListener("keydown", a(this, c)), document.addEventListener("keydown", a(this, d)));
|
|
718
690
|
}
|
|
719
691
|
get focusableFirst() {
|
|
720
692
|
return this.focusable[0];
|
|
@@ -722,66 +694,79 @@
|
|
|
722
694
|
get focusableLast() {
|
|
723
695
|
return this.focusable[this.focusable.length - 1];
|
|
724
696
|
}
|
|
725
|
-
mount(e,
|
|
726
|
-
e && (this.el = e),
|
|
697
|
+
mount(e, t) {
|
|
698
|
+
e && (this.el = e), t && (this.selectorFocus = t), this.focusable = this.getFocusable(), this.focus();
|
|
727
699
|
}
|
|
728
700
|
unmount() {
|
|
729
|
-
this.el = null, this.focusable = [], document.removeEventListener("keydown",
|
|
701
|
+
this.el = null, this.focusable = [], document.removeEventListener("keydown", a(this, c)), document.removeEventListener("keydown", a(this, d));
|
|
730
702
|
}
|
|
731
|
-
focus(e = this.el,
|
|
732
|
-
(e.querySelector(
|
|
703
|
+
focus(e = this.el, t = this.selectorFocus) {
|
|
704
|
+
(e.querySelector(t) || e).focus();
|
|
733
705
|
}
|
|
734
706
|
getFocusable(e = this.el) {
|
|
735
|
-
const
|
|
736
|
-
return e.querySelectorAll(
|
|
737
|
-
|
|
738
|
-
}), e.scrollTop = n,
|
|
707
|
+
const t = [], s2 = document.activeElement, n = e.scrollTop;
|
|
708
|
+
return e.querySelectorAll(F$1.join(",")).forEach((r) => {
|
|
709
|
+
r.focus(), document.activeElement === r && t.push(r);
|
|
710
|
+
}), e.scrollTop = n, s2.focus(), t;
|
|
739
711
|
}
|
|
740
|
-
}
|
|
712
|
+
}
|
|
741
713
|
g = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap();
|
|
742
|
-
function R(
|
|
743
|
-
(
|
|
714
|
+
function R(i) {
|
|
715
|
+
(i.key === "Tab" || i.keyCode === 9) && (i.shiftKey ? (document.activeElement === this.focusableFirst || document.activeElement === this.el) && (i.preventDefault(), this.focusableLast.focus()) : (document.activeElement === this.focusableLast || document.activeElement === this.el) && (i.preventDefault(), this.focusableFirst.focus()));
|
|
744
716
|
}
|
|
745
|
-
function
|
|
746
|
-
(
|
|
717
|
+
function D$1(i) {
|
|
718
|
+
(i.key === "Tab" || i.keyCode === 9) && i.preventDefault();
|
|
747
719
|
}
|
|
748
|
-
function
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
e.
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
720
|
+
function N$1() {
|
|
721
|
+
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
722
|
+
}
|
|
723
|
+
function z(i, e = document.body) {
|
|
724
|
+
if (i.slice(0, 2) !== "--") {
|
|
725
|
+
const s2 = N$1();
|
|
726
|
+
s2 && (i = `${s2}${i}`), i = `--${i}`;
|
|
727
|
+
}
|
|
728
|
+
const t = getComputedStyle(e).getPropertyValue(i).trim();
|
|
729
|
+
if (t)
|
|
730
|
+
return t;
|
|
731
|
+
throw new Error(`CSS variable "${i}" was not found!`);
|
|
732
|
+
}
|
|
733
|
+
function j(i, e) {
|
|
734
|
+
const t = (i.getAttribute(`data-${e}`) || "").replace(/'/g, '"');
|
|
735
|
+
return t ? JSON.parse(t) : {};
|
|
736
|
+
}
|
|
737
|
+
function T$1(i, e, t) {
|
|
738
|
+
const s2 = e.nodeType === Node.COMMENT_NODE, n = e.nodeType === Node.ELEMENT_NODE;
|
|
739
|
+
if (e = s2 || n ? e : document.querySelector(e), s2 && (t = "after"), !e) throw new Error(`Not a valid teleport reference: '${e}'`);
|
|
740
|
+
if (typeof e[t] != "function") throw new Error(`Not a valid teleport method: '${t}'`);
|
|
741
|
+
let r = null;
|
|
742
|
+
return s2 || (r = document.createComment("teleported #" + i.id), i.before(r)), e[t](i), s2 && e.remove(), r;
|
|
743
|
+
}
|
|
744
|
+
function O(i, e, t, s2 = "transition-duration") {
|
|
745
|
+
return new Promise((n) => {
|
|
746
|
+
if (typeof s2 == "string") {
|
|
747
|
+
const r = z(s2, i), l2 = !!r.includes("ms");
|
|
748
|
+
s2 = parseFloat(r) * (l2 ? 1 : 1e3);
|
|
749
|
+
}
|
|
750
|
+
i.classList.remove(e.finish), i.classList.add(t.start), setTimeout(() => {
|
|
751
|
+
i.classList.add(t.finish), i.classList.remove(t.start), n(i);
|
|
752
|
+
}, s2);
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
function W(i, e) {
|
|
756
|
+
e && document.querySelectorAll(e).forEach((t) => {
|
|
757
|
+
i ? t.style.overflow = "hidden" : t.style.removeProperty("overflow");
|
|
773
758
|
});
|
|
774
759
|
}
|
|
775
|
-
function
|
|
776
|
-
e && document.querySelectorAll(e).forEach((
|
|
777
|
-
|
|
760
|
+
function _$1(i, e) {
|
|
761
|
+
e && document.querySelectorAll(e).forEach((t) => {
|
|
762
|
+
i ? (t.inert = true, t.setAttribute("aria-hidden", true)) : (t.inert = null, t.removeAttribute("aria-hidden"));
|
|
778
763
|
});
|
|
779
764
|
}
|
|
780
|
-
function
|
|
781
|
-
|
|
765
|
+
function G(i, e) {
|
|
766
|
+
_$1(!!i, e.selectorInert), W(!!i, e.selectorOverflow);
|
|
782
767
|
}
|
|
783
|
-
const
|
|
784
|
-
|
|
768
|
+
const K$1 = {
|
|
769
|
+
autoMount: false,
|
|
785
770
|
// Data attributes
|
|
786
771
|
dataOpen: "modal-open",
|
|
787
772
|
dataClose: "modal-close",
|
|
@@ -790,6 +775,7 @@
|
|
|
790
775
|
// Selectors
|
|
791
776
|
selectorModal: ".modal",
|
|
792
777
|
selectorDialog: ".modal__dialog",
|
|
778
|
+
selectorScreen: ".modal",
|
|
793
779
|
selectorRequired: '[role="alertdialog"]',
|
|
794
780
|
selectorFocus: "[data-focus]",
|
|
795
781
|
selectorInert: null,
|
|
@@ -805,127 +791,134 @@
|
|
|
805
791
|
teleport: null,
|
|
806
792
|
teleportMethod: "append",
|
|
807
793
|
setTabindex: true,
|
|
808
|
-
transition: true
|
|
794
|
+
transition: true,
|
|
795
|
+
transitionDuration: "modal-transition-duration"
|
|
809
796
|
};
|
|
810
|
-
function
|
|
811
|
-
const e = typeof
|
|
797
|
+
function m(i) {
|
|
798
|
+
const e = typeof i == "string" ? this.get(i) : this.get(i.id);
|
|
812
799
|
if (e)
|
|
813
800
|
return e;
|
|
814
|
-
throw new Error(`Modal not found in collection with id of "${
|
|
815
|
-
}
|
|
816
|
-
function p(t) {
|
|
817
|
-
return typeof t == "string" ? t : typeof t.hasAttribute == "function" ? t.hasAttribute(`data-${this.settings.dataOpen}`) ? t.getAttribute(`data-${this.settings.dataOpen}`) : t.hasAttribute(`data-${this.settings.dataClose}`) ? t.getAttribute(`data-${this.settings.dataClose}`) || false : t.hasAttribute(`data-${this.settings.dataReplace}`) ? t.getAttribute(`data-${this.settings.dataReplace}`) : t.closest(this.settings.selectorModal) ? (t = t.closest(this.settings.selectorModal), t.id || false) : false : t.id ? t.id : false;
|
|
801
|
+
throw new Error(`Modal not found in collection with id of "${i.id || i}".`);
|
|
818
802
|
}
|
|
819
|
-
function
|
|
820
|
-
const e = p.call(this, t);
|
|
821
|
-
if (e) {
|
|
822
|
-
const s2 = document.querySelector(`#${e}`), i2 = s2 ? s2.querySelector(this.settings.selectorDialog) : null;
|
|
823
|
-
return !s2 && !i2 ? { error: new Error(`No modal elements found using the ID: "${e}".`) } : i2 ? { modal: s2, dialog: i2 } : { error: new Error("Modal is missing dialog element.") };
|
|
824
|
-
} else
|
|
825
|
-
return { error: new Error("Could not resolve the modal ID.") };
|
|
826
|
-
}
|
|
827
|
-
function m() {
|
|
803
|
+
function p() {
|
|
828
804
|
this.active ? this.focusTrap.mount(this.active.dialog, this.settings.selectorFocus) : (this.trigger && (this.trigger.focus(), this.trigger = null), this.focusTrap.unmount());
|
|
829
805
|
}
|
|
830
|
-
async function
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
806
|
+
async function V$1(i) {
|
|
807
|
+
const e = i.target.closest(`
|
|
808
|
+
[data-${this.settings.dataOpen}],
|
|
809
|
+
[data-${this.settings.dataReplace}],
|
|
810
|
+
[data-${this.settings.dataClose}]
|
|
811
|
+
`);
|
|
834
812
|
if (e) {
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
813
|
+
if (i.preventDefault(), e.matches(`[data-${this.settings.dataOpen}]`)) {
|
|
814
|
+
const t = e.getAttribute(`data-${this.settings.dataOpen}`).trim(), s2 = m.call(this, t);
|
|
815
|
+
return i.target.closest(this.settings.selectorModal) || (this.trigger = e), s2.open();
|
|
816
|
+
}
|
|
817
|
+
if (e.matches(`[data-${this.settings.dataReplace}]`)) {
|
|
818
|
+
const t = e.getAttribute(`data-${this.settings.dataReplace}`).trim(), s2 = m.call(this, t);
|
|
819
|
+
return i.target.closest(this.settings.selectorModal) || (this.trigger = e), s2.replace();
|
|
820
|
+
}
|
|
821
|
+
if (e.matches(`[data-${this.settings.dataClose}]`)) {
|
|
822
|
+
const t = e.getAttribute(`data-${this.settings.dataClose}`).trim();
|
|
823
|
+
return t === "*" ? this.closeAll() : this.close(t);
|
|
824
|
+
}
|
|
843
825
|
}
|
|
844
|
-
if (
|
|
845
|
-
return this.close(
|
|
826
|
+
if (this.active && i.target.matches(this.settings.selectorScreen) && !this.active.required)
|
|
827
|
+
return this.close(this.active.id);
|
|
846
828
|
}
|
|
847
|
-
function
|
|
848
|
-
if (
|
|
829
|
+
function q(i) {
|
|
830
|
+
if (i.key === "Escape" && this.active && !this.active.dialog.matches(this.settings.selectorRequired))
|
|
849
831
|
return this.close();
|
|
850
832
|
}
|
|
851
|
-
async function
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
delete i2[n];
|
|
859
|
-
}), this.collection.splice(s2, 1);
|
|
833
|
+
async function E(i, e = true) {
|
|
834
|
+
const t = this.collection.findIndex((s2) => s2.id === i.id);
|
|
835
|
+
if (t >= 0) {
|
|
836
|
+
const s2 = this.collection[t];
|
|
837
|
+
e && s2.state === "opened" ? await s2.close(false) : this.stack.remove(s2), s2.getSetting("teleport") && s2.teleportReturn(), Object.getOwnPropertyNames(s2).forEach((n) => {
|
|
838
|
+
delete s2[n];
|
|
839
|
+
}), this.collection.splice(t, 1);
|
|
860
840
|
}
|
|
861
841
|
return this.collection;
|
|
862
842
|
}
|
|
863
|
-
async function x(
|
|
864
|
-
const
|
|
865
|
-
return e !== void 0 && (n.transition = e), this.stack.moveToTop(
|
|
843
|
+
async function x(i, e, t = true) {
|
|
844
|
+
const s2 = m.call(this, i), n = { ...this.settings, ...s2.settings };
|
|
845
|
+
return e !== void 0 && (n.transition = e), this.stack.moveToTop(s2), s2.state === "closed" && (s2.state = "opening", this.stack.add(s2), n.transition ? await O(s2.el, {
|
|
846
|
+
start: n.stateClosing,
|
|
847
|
+
finish: n.stateClosed
|
|
848
|
+
}, {
|
|
849
|
+
start: n.stateOpening,
|
|
850
|
+
finish: n.stateOpened
|
|
851
|
+
}, n.transitionDuration) : (s2.el.classList.add(n.stateOpened), s2.el.classList.remove(n.stateClosed)), s2.state = "opened"), t && p.call(this), s2.el.dispatchEvent(new CustomEvent(n.customEventPrefix + "opened", {
|
|
866
852
|
detail: this,
|
|
867
853
|
bubbles: true
|
|
868
|
-
})),
|
|
869
|
-
}
|
|
870
|
-
async function C(
|
|
871
|
-
const
|
|
872
|
-
if (
|
|
873
|
-
|
|
874
|
-
const n = { ...this.settings, ...
|
|
875
|
-
e !== void 0 && (n.transition = e), document.activeElement.blur(),
|
|
854
|
+
})), s2;
|
|
855
|
+
}
|
|
856
|
+
async function C(i, e, t = true) {
|
|
857
|
+
const s2 = i ? m.call(this, i) : this.active;
|
|
858
|
+
if (s2 && s2.state === "opened") {
|
|
859
|
+
s2.state = "closing";
|
|
860
|
+
const n = { ...this.settings, ...s2.settings };
|
|
861
|
+
e !== void 0 && (n.transition = e), document.activeElement.blur(), n.transition ? await O(s2.el, {
|
|
862
|
+
start: n.stateOpening,
|
|
863
|
+
finish: n.stateOpened
|
|
864
|
+
}, {
|
|
865
|
+
start: n.stateClosing,
|
|
866
|
+
finish: n.stateClosed
|
|
867
|
+
}, n.transitionDuration) : (s2.el.classList.add(n.stateClosed), s2.el.classList.remove(n.stateOpened)), this.stack.remove(s2), s2.state = "closed", t && p.call(this), s2.el.dispatchEvent(new CustomEvent(n.customEventPrefix + "closed", {
|
|
876
868
|
detail: this,
|
|
877
869
|
bubbles: true
|
|
878
870
|
}));
|
|
879
871
|
}
|
|
880
|
-
return
|
|
872
|
+
return s2;
|
|
881
873
|
}
|
|
882
|
-
async function $(
|
|
883
|
-
const
|
|
884
|
-
return await Promise.all(this.stack.value.map(async (
|
|
885
|
-
|
|
886
|
-
})),
|
|
874
|
+
async function $(i, e) {
|
|
875
|
+
const t = [];
|
|
876
|
+
return await Promise.all(this.stack.value.map(async (s2) => {
|
|
877
|
+
i && i === s2.id ? Promise.resolve() : t.push(await C.call(this, s2, e, false)), s2.trigger = null;
|
|
878
|
+
})), t;
|
|
887
879
|
}
|
|
888
|
-
async function
|
|
889
|
-
const
|
|
890
|
-
let n,
|
|
891
|
-
return
|
|
880
|
+
async function M$1(i, e, t = true) {
|
|
881
|
+
const s2 = m.call(this, i);
|
|
882
|
+
let n, r;
|
|
883
|
+
return s2.state === "opened" ? (n = s2, r = await $.call(this, s2.id, e)) : (r = $.call(this, false, e), n = x.call(this, s2, e, false), await Promise.all([n, r])), t && p.call(this), { opened: n, closed: r };
|
|
892
884
|
}
|
|
893
|
-
async function B$1(
|
|
894
|
-
await
|
|
895
|
-
const
|
|
896
|
-
|
|
897
|
-
|
|
885
|
+
async function B$1(i, e = {}) {
|
|
886
|
+
await E.call(this, i, false);
|
|
887
|
+
const t = this, s2 = {
|
|
888
|
+
id: i.id,
|
|
889
|
+
state: "closed",
|
|
890
|
+
el: i,
|
|
891
|
+
dialog: null,
|
|
892
|
+
get required() {
|
|
893
|
+
return this.dialog.matches(this.getSetting("selectorRequired"));
|
|
894
|
+
},
|
|
895
|
+
returnRef: null,
|
|
896
|
+
settings: { ...j(i, this.settings.dataConfig), ...e },
|
|
897
|
+
open(r, l2) {
|
|
898
|
+
return x.call(t, this, r, l2);
|
|
898
899
|
},
|
|
899
|
-
close(
|
|
900
|
-
return C.call(
|
|
900
|
+
close(r, l2) {
|
|
901
|
+
return C.call(t, this, r, l2);
|
|
901
902
|
},
|
|
902
|
-
replace(
|
|
903
|
-
return
|
|
903
|
+
replace(r, l2) {
|
|
904
|
+
return M$1.call(t, this, r, l2);
|
|
904
905
|
},
|
|
905
906
|
deregister() {
|
|
906
|
-
return
|
|
907
|
+
return E.call(t, this);
|
|
907
908
|
},
|
|
908
|
-
teleport(
|
|
909
|
-
return this.returnRef ? (console.error("Element has already been teleported:", this.el), false) : (this.returnRef = T$1(this.el,
|
|
909
|
+
teleport(r = this.getSetting("teleport"), l2 = this.getSetting("teleportMethod")) {
|
|
910
|
+
return this.returnRef ? (console.error("Element has already been teleported:", this.el), false) : (this.returnRef = T$1(this.el, r, l2), this.el);
|
|
910
911
|
},
|
|
911
912
|
teleportReturn() {
|
|
912
913
|
return this.returnRef ? (this.returnRef = T$1(this.el, this.returnRef), this.el) : (console.error("No return reference found:", this.el), false);
|
|
913
914
|
},
|
|
914
|
-
getSetting(
|
|
915
|
-
return
|
|
915
|
+
getSetting(r) {
|
|
916
|
+
return r in this.settings ? this.settings[r] : t.settings[r];
|
|
916
917
|
}
|
|
917
|
-
}, n =
|
|
918
|
-
|
|
919
|
-
state: "closed",
|
|
920
|
-
el: t,
|
|
921
|
-
dialog: e,
|
|
922
|
-
returnRef: null,
|
|
923
|
-
settings: P(t, this.settings.dataConfig),
|
|
924
|
-
...i2
|
|
925
|
-
};
|
|
926
|
-
return n.dialog.setAttribute("aria-modal", "true"), n.dialog.hasAttribute("role") || n.dialog.setAttribute("role", "dialog"), n.getSetting("setTabindex") && n.dialog.setAttribute("tabindex", "-1"), n.getSetting("teleport") && n.teleport(), this.collection.push(n), n.el.classList.contains(this.settings.stateOpened) ? await n.open(false) : (n.el.classList.remove(this.settings.stateOpening), n.el.classList.remove(this.settings.stateClosing), n.el.classList.add(this.settings.stateClosed)), n;
|
|
918
|
+
}, n = i.querySelector(s2.getSetting("selectorDialog"));
|
|
919
|
+
return s2.dialog = n || i, s2.dialog.setAttribute("aria-modal", "true"), s2.dialog.hasAttribute("role") || s2.dialog.setAttribute("role", "dialog"), s2.getSetting("setTabindex") && s2.dialog.setAttribute("tabindex", "-1"), s2.getSetting("teleport") && s2.teleport(), this.collection.push(s2), s2.el.classList.contains(this.settings.stateOpened) ? await s2.open(false) : (s2.el.classList.remove(this.settings.stateOpening), s2.el.classList.remove(this.settings.stateClosing), s2.el.classList.add(this.settings.stateClosed)), s2;
|
|
927
920
|
}
|
|
928
|
-
function
|
|
921
|
+
function J$1(i) {
|
|
929
922
|
const e = [];
|
|
930
923
|
return {
|
|
931
924
|
get value() {
|
|
@@ -935,87 +928,83 @@
|
|
|
935
928
|
return e[e.length - 1];
|
|
936
929
|
},
|
|
937
930
|
updateIndex() {
|
|
938
|
-
e.forEach((
|
|
939
|
-
|
|
940
|
-
const n = getComputedStyle(
|
|
941
|
-
|
|
931
|
+
e.forEach((t, s2) => {
|
|
932
|
+
t.el.style.zIndex = null;
|
|
933
|
+
const n = getComputedStyle(t.el)["z-index"];
|
|
934
|
+
t.el.style.zIndex = parseInt(n) + s2 + 1;
|
|
942
935
|
});
|
|
943
936
|
},
|
|
944
937
|
updateGlobalState() {
|
|
945
|
-
|
|
938
|
+
G(this.top, i), this.updateIndex();
|
|
946
939
|
},
|
|
947
|
-
add(
|
|
948
|
-
|
|
949
|
-
const
|
|
950
|
-
|
|
940
|
+
add(t) {
|
|
941
|
+
t.el.style.zIndex = null;
|
|
942
|
+
const s2 = getComputedStyle(t.el)["z-index"];
|
|
943
|
+
t.el.style.zIndex = parseInt(s2) + e.length + 1, e.push(t), this.updateGlobalState();
|
|
951
944
|
},
|
|
952
|
-
remove(
|
|
953
|
-
const
|
|
954
|
-
|
|
945
|
+
remove(t) {
|
|
946
|
+
const s2 = e.findIndex((n) => n.id === t.id);
|
|
947
|
+
s2 >= 0 && (t.el.style.zIndex = null, e.splice(s2, 1), this.updateGlobalState());
|
|
955
948
|
},
|
|
956
|
-
moveToTop(
|
|
957
|
-
const
|
|
958
|
-
|
|
949
|
+
moveToTop(t) {
|
|
950
|
+
const s2 = e.findIndex((n) => n.id === t.id);
|
|
951
|
+
s2 >= 0 && (e.splice(s2, 1), this.add(t));
|
|
959
952
|
}
|
|
960
953
|
};
|
|
961
954
|
}
|
|
962
955
|
var u, h;
|
|
963
|
-
class
|
|
964
|
-
constructor(
|
|
956
|
+
let Q$1 = class Q extends A {
|
|
957
|
+
constructor(t) {
|
|
965
958
|
super();
|
|
966
|
-
v(this, u
|
|
967
|
-
v(this, h
|
|
968
|
-
this.defaults =
|
|
959
|
+
v(this, u);
|
|
960
|
+
v(this, h);
|
|
961
|
+
this.defaults = K$1, this.settings = { ...this.defaults, ...t }, this.trigger = null, this.focusTrap = new P(), this.stack = J$1(this.settings), b(this, u, V$1.bind(this)), b(this, h, q.bind(this)), this.settings.autoMount && this.mount();
|
|
969
962
|
}
|
|
970
963
|
get active() {
|
|
971
964
|
return this.stack.top;
|
|
972
965
|
}
|
|
973
|
-
async
|
|
974
|
-
|
|
975
|
-
const
|
|
976
|
-
return await this.registerCollection(
|
|
966
|
+
async mount(t) {
|
|
967
|
+
t && (this.settings = { ...this.settings, ...t });
|
|
968
|
+
const s2 = document.querySelectorAll(this.settings.selectorModal);
|
|
969
|
+
return await this.registerCollection(s2), this.settings.eventListeners && this.mountEventListeners(), this;
|
|
977
970
|
}
|
|
978
|
-
async
|
|
979
|
-
return this.trigger = null, await this.deregisterCollection(), this.settings.eventListeners && this.
|
|
971
|
+
async unmount() {
|
|
972
|
+
return this.trigger = null, await this.deregisterCollection(), this.settings.eventListeners && this.unmountEventListeners(), this;
|
|
980
973
|
}
|
|
981
|
-
|
|
974
|
+
mountEventListeners() {
|
|
982
975
|
document.addEventListener("click", f(this, u), false), document.addEventListener("keydown", f(this, h), false);
|
|
983
976
|
}
|
|
984
|
-
|
|
977
|
+
unmountEventListeners() {
|
|
985
978
|
document.removeEventListener("click", f(this, u), false), document.removeEventListener("keydown", f(this, h), false);
|
|
986
979
|
}
|
|
987
|
-
register(s2) {
|
|
988
|
-
|
|
989
|
-
return
|
|
980
|
+
register(t, s2 = {}) {
|
|
981
|
+
let n = typeof t == "string" ? document.getElementById(t) : t;
|
|
982
|
+
return n ? B$1.call(this, n, s2) : Promise.reject(new Error(`Failed to register; modal not found with ID of: "${t.id || t}".`));
|
|
990
983
|
}
|
|
991
|
-
deregister(
|
|
992
|
-
|
|
993
|
-
return
|
|
984
|
+
deregister(t) {
|
|
985
|
+
let s2 = this.get(t.id || t);
|
|
986
|
+
return s2 ? E.call(this, s2) : Promise.reject(new Error(`Failed to deregister; modal does not exist in collection with ID of: "${t.id || t}".`));
|
|
994
987
|
}
|
|
995
|
-
open(
|
|
996
|
-
return x.call(this,
|
|
988
|
+
open(t, s2, n) {
|
|
989
|
+
return x.call(this, t, s2, n);
|
|
997
990
|
}
|
|
998
|
-
close(
|
|
999
|
-
return C.call(this,
|
|
991
|
+
close(t, s2, n) {
|
|
992
|
+
return C.call(this, t, s2, n);
|
|
1000
993
|
}
|
|
1001
|
-
replace(
|
|
1002
|
-
return
|
|
994
|
+
replace(t, s2, n) {
|
|
995
|
+
return M$1.call(this, t, s2, n);
|
|
1003
996
|
}
|
|
1004
|
-
async closeAll(
|
|
1005
|
-
const
|
|
1006
|
-
return n &&
|
|
997
|
+
async closeAll(t = false, s2, n = true) {
|
|
998
|
+
const r = await $.call(this, t, s2);
|
|
999
|
+
return n && p.call(this), r;
|
|
1007
1000
|
}
|
|
1008
|
-
}
|
|
1001
|
+
};
|
|
1009
1002
|
u = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap();
|
|
1010
|
-
var Ue = (e
|
|
1011
|
-
|
|
1012
|
-
throw TypeError("Cannot " + r2);
|
|
1003
|
+
var Ue = (e) => {
|
|
1004
|
+
throw TypeError(e);
|
|
1013
1005
|
};
|
|
1014
|
-
var
|
|
1015
|
-
|
|
1016
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
1017
|
-
t instanceof WeakSet ? t.add(e) : t.set(e, r2);
|
|
1018
|
-
}, Ke = (e, t, r2, i2) => (Ue(e, t, "write to private field"), i2 ? i2.call(e, r2) : t.set(e, r2), r2);
|
|
1006
|
+
var _e = (e, t, r) => t.has(e) || Ue("Cannot " + r);
|
|
1007
|
+
var Ae = (e, t, r) => (_e(e, t, "read from private field"), r ? r.call(e) : t.get(e)), Ke = (e, t, r) => t.has(e) ? Ue("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), Ge = (e, t, r, i) => (_e(e, t, "write to private field"), t.set(e, r), r);
|
|
1019
1008
|
class Ct {
|
|
1020
1009
|
constructor() {
|
|
1021
1010
|
this.collection = [];
|
|
@@ -1024,18 +1013,18 @@
|
|
|
1024
1013
|
return await this.deregister(t), this.collection.push(t), this.collection;
|
|
1025
1014
|
}
|
|
1026
1015
|
async deregister(t) {
|
|
1027
|
-
const
|
|
1028
|
-
if (
|
|
1029
|
-
const
|
|
1030
|
-
Object.getOwnPropertyNames(
|
|
1031
|
-
delete
|
|
1032
|
-
}), this.collection.splice(
|
|
1016
|
+
const r = this.collection.findIndex((i) => i === t);
|
|
1017
|
+
if (r >= 0) {
|
|
1018
|
+
const i = this.collection[r];
|
|
1019
|
+
Object.getOwnPropertyNames(i).forEach((n) => {
|
|
1020
|
+
delete i[n];
|
|
1021
|
+
}), this.collection.splice(r, 1);
|
|
1033
1022
|
}
|
|
1034
1023
|
return this.collection;
|
|
1035
1024
|
}
|
|
1036
1025
|
async registerCollection(t) {
|
|
1037
|
-
return await Promise.all(Array.from(t, (
|
|
1038
|
-
this.register(
|
|
1026
|
+
return await Promise.all(Array.from(t, (r) => {
|
|
1027
|
+
this.register(r);
|
|
1039
1028
|
})), this.collection;
|
|
1040
1029
|
}
|
|
1041
1030
|
async deregisterCollection() {
|
|
@@ -1043,15 +1032,15 @@
|
|
|
1043
1032
|
await this.deregister(this.collection[0]);
|
|
1044
1033
|
return this.collection;
|
|
1045
1034
|
}
|
|
1046
|
-
get(t,
|
|
1047
|
-
return this.collection.find((
|
|
1035
|
+
get(t, r = "id") {
|
|
1036
|
+
return this.collection.find((i) => i[r] === t);
|
|
1048
1037
|
}
|
|
1049
1038
|
}
|
|
1050
1039
|
function kt() {
|
|
1051
|
-
return getComputedStyle(document.body).getPropertyValue("--
|
|
1040
|
+
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
1052
1041
|
}
|
|
1053
1042
|
const Dt = {
|
|
1054
|
-
|
|
1043
|
+
autoMount: false,
|
|
1055
1044
|
// Selectors
|
|
1056
1045
|
selectorPopover: ".popover",
|
|
1057
1046
|
selectorArrow: ".popover__arrow",
|
|
@@ -1062,8 +1051,8 @@
|
|
|
1062
1051
|
eventType: "click",
|
|
1063
1052
|
placement: "bottom"
|
|
1064
1053
|
};
|
|
1065
|
-
function
|
|
1066
|
-
const
|
|
1054
|
+
function at(e, t) {
|
|
1055
|
+
const r = getComputedStyle(e), i = {
|
|
1067
1056
|
placement: t.placement,
|
|
1068
1057
|
event: t.eventType,
|
|
1069
1058
|
offset: 0,
|
|
@@ -1072,43 +1061,43 @@
|
|
|
1072
1061
|
"arrow-element": t.selectorArrow,
|
|
1073
1062
|
"arrow-padding": 0
|
|
1074
1063
|
};
|
|
1075
|
-
for (const n in
|
|
1076
|
-
const o2 = kt(), l2 =
|
|
1077
|
-
l2 && (
|
|
1064
|
+
for (const n in i) {
|
|
1065
|
+
const o2 = kt(), l2 = r.getPropertyValue(`--${o2}popover-${n}`).trim();
|
|
1066
|
+
l2 && (i[n] = l2);
|
|
1078
1067
|
}
|
|
1079
|
-
return
|
|
1068
|
+
return i;
|
|
1080
1069
|
}
|
|
1081
1070
|
function Pe(e) {
|
|
1082
1071
|
let t;
|
|
1083
|
-
const
|
|
1084
|
-
switch (
|
|
1085
|
-
|
|
1086
|
-
}),
|
|
1072
|
+
const r = typeof e == "string" ? e.trim().split(" ") : [e];
|
|
1073
|
+
switch (r.forEach(function(i, n) {
|
|
1074
|
+
r[n] = parseInt(i, 10);
|
|
1075
|
+
}), r.length) {
|
|
1087
1076
|
case 1:
|
|
1088
|
-
t =
|
|
1077
|
+
t = r[0];
|
|
1089
1078
|
break;
|
|
1090
1079
|
case 2:
|
|
1091
1080
|
t = {
|
|
1092
|
-
top:
|
|
1093
|
-
right:
|
|
1094
|
-
bottom:
|
|
1095
|
-
left:
|
|
1081
|
+
top: r[0],
|
|
1082
|
+
right: r[1],
|
|
1083
|
+
bottom: r[0],
|
|
1084
|
+
left: r[1]
|
|
1096
1085
|
};
|
|
1097
1086
|
break;
|
|
1098
1087
|
case 3:
|
|
1099
1088
|
t = {
|
|
1100
|
-
top:
|
|
1101
|
-
right:
|
|
1102
|
-
bottom:
|
|
1103
|
-
left:
|
|
1089
|
+
top: r[0],
|
|
1090
|
+
right: r[1],
|
|
1091
|
+
bottom: r[2],
|
|
1092
|
+
left: r[1]
|
|
1104
1093
|
};
|
|
1105
1094
|
break;
|
|
1106
1095
|
case 4:
|
|
1107
1096
|
t = {
|
|
1108
|
-
top:
|
|
1109
|
-
right:
|
|
1110
|
-
bottom:
|
|
1111
|
-
left:
|
|
1097
|
+
top: r[0],
|
|
1098
|
+
right: r[1],
|
|
1099
|
+
bottom: r[2],
|
|
1100
|
+
left: r[3]
|
|
1112
1101
|
};
|
|
1113
1102
|
break;
|
|
1114
1103
|
default:
|
|
@@ -1141,25 +1130,25 @@
|
|
|
1141
1130
|
}
|
|
1142
1131
|
}];
|
|
1143
1132
|
}
|
|
1144
|
-
function
|
|
1133
|
+
function st(e) {
|
|
1145
1134
|
const t = typeof e == "string" ? this.get(e) : this.get(e.id);
|
|
1146
1135
|
if (t)
|
|
1147
1136
|
return t;
|
|
1148
1137
|
throw new Error(`Popover not found in collection with id of "${e}".`);
|
|
1149
1138
|
}
|
|
1150
|
-
function st(e) {
|
|
1151
|
-
return typeof e == "string" ? e : typeof e.hasAttribute == "function" ? e.closest(this.settings.selectorPopover) ? (e = e.closest(this.settings.selectorPopover), e.id) : e.hasAttribute("aria-controls") ? e.getAttribute("aria-controls") : e.hasAttribute("aria-describedby") ? e.getAttribute("aria-describedby") : false : e.id ? e.id : false;
|
|
1152
|
-
}
|
|
1153
1139
|
function Bt(e) {
|
|
1154
|
-
|
|
1140
|
+
return typeof e == "string" ? e : typeof e.hasAttribute == "function" ? e.closest(this.settings.selectorPopover) ? (e = e.closest(this.settings.selectorPopover), e.id) : e.hasAttribute("aria-controls") ? e.getAttribute("aria-controls") : e.hasAttribute("aria-describedby") ? e.getAttribute("aria-describedby") : false : false;
|
|
1141
|
+
}
|
|
1142
|
+
function Tt(e) {
|
|
1143
|
+
const t = Bt.call(this, e);
|
|
1155
1144
|
if (t) {
|
|
1156
|
-
const
|
|
1157
|
-
return !
|
|
1145
|
+
const r = document.querySelector(`#${t}`), i = document.querySelector(`[aria-controls="${t}"]`) || document.querySelector(`[aria-describedby="${t}"]`);
|
|
1146
|
+
return !i && !r ? { error: new Error(`No popover elements found using the ID: "${t}".`) } : i ? r ? { popover: r, trigger: i } : { error: new Error("No popover associated with the provided popover trigger.") } : { error: new Error("No popover trigger associated with the provided popover.") };
|
|
1158
1147
|
} else
|
|
1159
1148
|
return { error: new Error("Could not resolve the popover ID.") };
|
|
1160
1149
|
}
|
|
1161
1150
|
async function ke(e) {
|
|
1162
|
-
const t = e ?
|
|
1151
|
+
const t = e ? st.call(this, e) : await ct.call(this);
|
|
1163
1152
|
return t && t.state === "opened" && (t.el.classList.remove(this.settings.stateActive), t.trigger.hasAttribute("aria-controls") && t.trigger.setAttribute("aria-expanded", "false"), t.popper.setOptions({
|
|
1164
1153
|
modifiers: [{ name: "eventListeners", enabled: false }]
|
|
1165
1154
|
}), t.state = "closed", t.trigger === this.trigger && (this.trigger = null)), t;
|
|
@@ -1172,16 +1161,16 @@
|
|
|
1172
1161
|
}
|
|
1173
1162
|
function lt(e) {
|
|
1174
1163
|
e.state == "opened" && setTimeout(() => {
|
|
1175
|
-
const t = e.el.closest(":hover") === e.el || e.trigger.closest(":hover") === e.trigger,
|
|
1164
|
+
const t = e.el.closest(":hover") === e.el || e.trigger.closest(":hover") === e.trigger, r = document.activeElement.closest(
|
|
1176
1165
|
`#${e.id}, [aria-controls="${e.id}"], [aria-describedby="${e.id}"]`
|
|
1177
1166
|
);
|
|
1178
|
-
return !t && !
|
|
1167
|
+
return !t && !r && e.close(), e;
|
|
1179
1168
|
}, 1);
|
|
1180
1169
|
}
|
|
1181
|
-
function
|
|
1170
|
+
function St(e) {
|
|
1182
1171
|
e.state === "opened" ? e.close() : (this.trigger = e.trigger, e.open(), ft.call(this, e));
|
|
1183
1172
|
}
|
|
1184
|
-
function
|
|
1173
|
+
function Mt(e) {
|
|
1185
1174
|
switch (e.key) {
|
|
1186
1175
|
case "Escape":
|
|
1187
1176
|
this.trigger && this.trigger.focus(), ct.call(this);
|
|
@@ -1197,17 +1186,17 @@
|
|
|
1197
1186
|
}
|
|
1198
1187
|
function ft(e) {
|
|
1199
1188
|
const t = this;
|
|
1200
|
-
document.addEventListener("click", function
|
|
1201
|
-
|
|
1189
|
+
document.addEventListener("click", function r(i) {
|
|
1190
|
+
i.target.closest(
|
|
1202
1191
|
`#${e.id}, [aria-controls="${e.id}"], [aria-describedby="${e.id}"]`
|
|
1203
|
-
) ? e.el && !e.el.classList.contains(t.settings.stateActive) && this.removeEventListener("click",
|
|
1192
|
+
) ? e.el && !e.el.classList.contains(t.settings.stateActive) && this.removeEventListener("click", r) : (e.el && e.el.classList.contains(t.settings.stateActive) && e.close(), this.removeEventListener("click", r));
|
|
1204
1193
|
});
|
|
1205
1194
|
}
|
|
1206
|
-
var k = "top", S = "bottom", M = "right", D = "left", De = "auto", le = [k, S, M, D], Q = "start", se = "end",
|
|
1195
|
+
var k = "top", S = "bottom", M = "right", D = "left", De = "auto", le = [k, S, M, D], Q = "start", se = "end", jt = "clippingParents", ut = "viewport", ne = "popper", Wt = "reference", Je = /* @__PURE__ */ le.reduce(function(e, t) {
|
|
1207
1196
|
return e.concat([t + "-" + Q, t + "-" + se]);
|
|
1208
1197
|
}, []), pt = /* @__PURE__ */ [].concat(le, [De]).reduce(function(e, t) {
|
|
1209
1198
|
return e.concat([t, t + "-" + Q, t + "-" + se]);
|
|
1210
|
-
}, []),
|
|
1199
|
+
}, []), Ht = "beforeRead", Nt = "read", Vt = "afterRead", It = "beforeMain", Ft = "main", Xt = "afterMain", Yt = "beforeWrite", qt = "write", zt = "afterWrite", Ut = [Ht, Nt, Vt, It, Ft, Xt, Yt, qt, zt];
|
|
1211
1200
|
function N(e) {
|
|
1212
1201
|
return e ? (e.nodeName || "").toLowerCase() : null;
|
|
1213
1202
|
}
|
|
@@ -1234,18 +1223,18 @@
|
|
|
1234
1223
|
var t = B(e).ShadowRoot;
|
|
1235
1224
|
return e instanceof t || e instanceof ShadowRoot;
|
|
1236
1225
|
}
|
|
1237
|
-
function
|
|
1226
|
+
function _t(e) {
|
|
1238
1227
|
var t = e.state;
|
|
1239
|
-
Object.keys(t.elements).forEach(function(
|
|
1240
|
-
var
|
|
1241
|
-
!T(o2) || !N(o2) || (Object.assign(o2.style,
|
|
1228
|
+
Object.keys(t.elements).forEach(function(r) {
|
|
1229
|
+
var i = t.styles[r] || {}, n = t.attributes[r] || {}, o2 = t.elements[r];
|
|
1230
|
+
!T(o2) || !N(o2) || (Object.assign(o2.style, i), Object.keys(n).forEach(function(l2) {
|
|
1242
1231
|
var s2 = n[l2];
|
|
1243
1232
|
s2 === false ? o2.removeAttribute(l2) : o2.setAttribute(l2, s2 === true ? "" : s2);
|
|
1244
1233
|
}));
|
|
1245
1234
|
});
|
|
1246
1235
|
}
|
|
1247
|
-
function
|
|
1248
|
-
var t = e.state,
|
|
1236
|
+
function Kt(e) {
|
|
1237
|
+
var t = e.state, r = {
|
|
1249
1238
|
popper: {
|
|
1250
1239
|
position: t.options.strategy,
|
|
1251
1240
|
left: "0",
|
|
@@ -1257,9 +1246,9 @@
|
|
|
1257
1246
|
},
|
|
1258
1247
|
reference: {}
|
|
1259
1248
|
};
|
|
1260
|
-
return Object.assign(t.elements.popper.style,
|
|
1261
|
-
Object.keys(t.elements).forEach(function(
|
|
1262
|
-
var n = t.elements[
|
|
1249
|
+
return Object.assign(t.elements.popper.style, r.popper), t.styles = r, t.elements.arrow && Object.assign(t.elements.arrow.style, r.arrow), function() {
|
|
1250
|
+
Object.keys(t.elements).forEach(function(i) {
|
|
1251
|
+
var n = t.elements[i], o2 = t.attributes[i] || {}, l2 = Object.keys(t.styles.hasOwnProperty(i) ? t.styles[i] : r[i]), s2 = l2.reduce(function(a2, f2) {
|
|
1263
1252
|
return a2[f2] = "", a2;
|
|
1264
1253
|
}, {});
|
|
1265
1254
|
!T(n) || !N(n) || (Object.assign(n.style, s2), Object.keys(o2).forEach(function(a2) {
|
|
@@ -1268,12 +1257,12 @@
|
|
|
1268
1257
|
});
|
|
1269
1258
|
};
|
|
1270
1259
|
}
|
|
1271
|
-
const
|
|
1260
|
+
const Gt = {
|
|
1272
1261
|
name: "applyStyles",
|
|
1273
1262
|
enabled: true,
|
|
1274
1263
|
phase: "write",
|
|
1275
|
-
fn:
|
|
1276
|
-
effect:
|
|
1264
|
+
fn: _t,
|
|
1265
|
+
effect: Kt,
|
|
1277
1266
|
requires: ["computeStyles"]
|
|
1278
1267
|
};
|
|
1279
1268
|
function H(e) {
|
|
@@ -1289,11 +1278,11 @@
|
|
|
1289
1278
|
function dt() {
|
|
1290
1279
|
return !/^((?!chrome|android).)*safari/i.test(Le());
|
|
1291
1280
|
}
|
|
1292
|
-
function ee(e, t,
|
|
1293
|
-
t === void 0 && (t = false),
|
|
1294
|
-
var
|
|
1295
|
-
t && T(e) && (n = e.offsetWidth > 0 && Z(
|
|
1296
|
-
var l2 = K(e) ? B(e) : window, s2 = l2.visualViewport, a2 = !dt() &&
|
|
1281
|
+
function ee(e, t, r) {
|
|
1282
|
+
t === void 0 && (t = false), r === void 0 && (r = false);
|
|
1283
|
+
var i = e.getBoundingClientRect(), n = 1, o2 = 1;
|
|
1284
|
+
t && T(e) && (n = e.offsetWidth > 0 && Z(i.width) / e.offsetWidth || 1, o2 = e.offsetHeight > 0 && Z(i.height) / e.offsetHeight || 1);
|
|
1285
|
+
var l2 = K(e) ? B(e) : window, s2 = l2.visualViewport, a2 = !dt() && r, f2 = (i.left + (a2 && s2 ? s2.offsetLeft : 0)) / n, c2 = (i.top + (a2 && s2 ? s2.offsetTop : 0)) / o2, h2 = i.width / n, y2 = i.height / o2;
|
|
1297
1286
|
return {
|
|
1298
1287
|
width: h2,
|
|
1299
1288
|
height: y2,
|
|
@@ -1306,32 +1295,32 @@
|
|
|
1306
1295
|
};
|
|
1307
1296
|
}
|
|
1308
1297
|
function Be(e) {
|
|
1309
|
-
var t = ee(e),
|
|
1310
|
-
return Math.abs(t.width -
|
|
1298
|
+
var t = ee(e), r = e.offsetWidth, i = e.offsetHeight;
|
|
1299
|
+
return Math.abs(t.width - r) <= 1 && (r = t.width), Math.abs(t.height - i) <= 1 && (i = t.height), {
|
|
1311
1300
|
x: e.offsetLeft,
|
|
1312
1301
|
y: e.offsetTop,
|
|
1313
|
-
width:
|
|
1314
|
-
height:
|
|
1302
|
+
width: r,
|
|
1303
|
+
height: i
|
|
1315
1304
|
};
|
|
1316
1305
|
}
|
|
1317
1306
|
function vt(e, t) {
|
|
1318
|
-
var
|
|
1307
|
+
var r = t.getRootNode && t.getRootNode();
|
|
1319
1308
|
if (e.contains(t))
|
|
1320
1309
|
return true;
|
|
1321
|
-
if (
|
|
1322
|
-
var
|
|
1310
|
+
if (r && Re(r)) {
|
|
1311
|
+
var i = t;
|
|
1323
1312
|
do {
|
|
1324
|
-
if (
|
|
1313
|
+
if (i && e.isSameNode(i))
|
|
1325
1314
|
return true;
|
|
1326
|
-
|
|
1327
|
-
} while (
|
|
1315
|
+
i = i.parentNode || i.host;
|
|
1316
|
+
} while (i);
|
|
1328
1317
|
}
|
|
1329
1318
|
return false;
|
|
1330
1319
|
}
|
|
1331
|
-
function
|
|
1320
|
+
function V(e) {
|
|
1332
1321
|
return B(e).getComputedStyle(e);
|
|
1333
1322
|
}
|
|
1334
|
-
function
|
|
1323
|
+
function Jt(e) {
|
|
1335
1324
|
return ["table", "td", "th"].indexOf(N(e)) >= 0;
|
|
1336
1325
|
}
|
|
1337
1326
|
function F(e) {
|
|
@@ -1352,20 +1341,20 @@
|
|
|
1352
1341
|
F(e)
|
|
1353
1342
|
);
|
|
1354
1343
|
}
|
|
1355
|
-
function
|
|
1344
|
+
function Qe(e) {
|
|
1356
1345
|
return !T(e) || // https://github.com/popperjs/popper-core/issues/837
|
|
1357
|
-
|
|
1346
|
+
V(e).position === "fixed" ? null : e.offsetParent;
|
|
1358
1347
|
}
|
|
1359
|
-
function
|
|
1360
|
-
var t = /firefox/i.test(Le()),
|
|
1361
|
-
if (
|
|
1362
|
-
var
|
|
1363
|
-
if (
|
|
1348
|
+
function Qt(e) {
|
|
1349
|
+
var t = /firefox/i.test(Le()), r = /Trident/i.test(Le());
|
|
1350
|
+
if (r && T(e)) {
|
|
1351
|
+
var i = V(e);
|
|
1352
|
+
if (i.position === "fixed")
|
|
1364
1353
|
return null;
|
|
1365
1354
|
}
|
|
1366
1355
|
var n = we(e);
|
|
1367
1356
|
for (Re(n) && (n = n.host); T(n) && ["html", "body"].indexOf(N(n)) < 0; ) {
|
|
1368
|
-
var o2 =
|
|
1357
|
+
var o2 = V(n);
|
|
1369
1358
|
if (o2.transform !== "none" || o2.perspective !== "none" || o2.contain === "paint" || ["transform", "perspective"].indexOf(o2.willChange) !== -1 || t && o2.willChange === "filter" || t && o2.filter && o2.filter !== "none")
|
|
1370
1359
|
return n;
|
|
1371
1360
|
n = n.parentNode;
|
|
@@ -1373,19 +1362,19 @@
|
|
|
1373
1362
|
return null;
|
|
1374
1363
|
}
|
|
1375
1364
|
function fe(e) {
|
|
1376
|
-
for (var t = B(e),
|
|
1377
|
-
|
|
1378
|
-
return
|
|
1365
|
+
for (var t = B(e), r = Qe(e); r && Jt(r) && V(r).position === "static"; )
|
|
1366
|
+
r = Qe(r);
|
|
1367
|
+
return r && (N(r) === "html" || N(r) === "body" && V(r).position === "static") ? t : r || Qt(e) || t;
|
|
1379
1368
|
}
|
|
1380
1369
|
function Te(e) {
|
|
1381
1370
|
return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
|
|
1382
1371
|
}
|
|
1383
|
-
function oe(e, t,
|
|
1384
|
-
return _(e, ye(t,
|
|
1372
|
+
function oe(e, t, r) {
|
|
1373
|
+
return _(e, ye(t, r));
|
|
1385
1374
|
}
|
|
1386
|
-
function
|
|
1387
|
-
var
|
|
1388
|
-
return
|
|
1375
|
+
function Zt(e, t, r) {
|
|
1376
|
+
var i = oe(e, t, r);
|
|
1377
|
+
return i > r ? r : i;
|
|
1389
1378
|
}
|
|
1390
1379
|
function ht() {
|
|
1391
1380
|
return {
|
|
@@ -1399,53 +1388,53 @@
|
|
|
1399
1388
|
return Object.assign({}, ht(), e);
|
|
1400
1389
|
}
|
|
1401
1390
|
function mt(e, t) {
|
|
1402
|
-
return t.reduce(function(
|
|
1403
|
-
return
|
|
1391
|
+
return t.reduce(function(r, i) {
|
|
1392
|
+
return r[i] = e, r;
|
|
1404
1393
|
}, {});
|
|
1405
1394
|
}
|
|
1406
|
-
var
|
|
1407
|
-
return t = typeof t == "function" ? t(Object.assign({},
|
|
1408
|
-
placement:
|
|
1395
|
+
var er = function(t, r) {
|
|
1396
|
+
return t = typeof t == "function" ? t(Object.assign({}, r.rects, {
|
|
1397
|
+
placement: r.placement
|
|
1409
1398
|
})) : t, gt(typeof t != "number" ? t : mt(t, le));
|
|
1410
1399
|
};
|
|
1411
|
-
function
|
|
1412
|
-
var t,
|
|
1400
|
+
function tr(e) {
|
|
1401
|
+
var t, r = e.state, i = e.name, n = e.options, o2 = r.elements.arrow, l2 = r.modifiersData.popperOffsets, s2 = H(r.placement), a2 = Te(s2), f2 = [D, M].indexOf(s2) >= 0, c2 = f2 ? "height" : "width";
|
|
1413
1402
|
if (!(!o2 || !l2)) {
|
|
1414
|
-
var h2 =
|
|
1415
|
-
|
|
1403
|
+
var h2 = er(n.padding, r), y2 = Be(o2), u2 = a2 === "y" ? k : D, b2 = a2 === "y" ? S : M, v2 = r.rects.reference[c2] + r.rects.reference[a2] - l2[a2] - r.rects.popper[c2], d2 = l2[a2] - r.rects.reference[a2], w2 = fe(o2), O2 = w2 ? a2 === "y" ? w2.clientHeight || 0 : w2.clientWidth || 0 : 0, E2 = v2 / 2 - d2 / 2, p2 = h2[u2], g2 = O2 - y2[c2] - h2[b2], m2 = O2 / 2 - y2[c2] / 2 + E2, x2 = oe(p2, m2, g2), L2 = a2;
|
|
1404
|
+
r.modifiersData[i] = (t = {}, t[L2] = x2, t.centerOffset = x2 - m2, t);
|
|
1416
1405
|
}
|
|
1417
1406
|
}
|
|
1418
|
-
function
|
|
1419
|
-
var t = e.state,
|
|
1407
|
+
function rr(e) {
|
|
1408
|
+
var t = e.state, r = e.options, i = r.element, n = i === void 0 ? "[data-popper-arrow]" : i;
|
|
1420
1409
|
n != null && (typeof n == "string" && (n = t.elements.popper.querySelector(n), !n) || vt(t.elements.popper, n) && (t.elements.arrow = n));
|
|
1421
1410
|
}
|
|
1422
|
-
const
|
|
1411
|
+
const ir = {
|
|
1423
1412
|
name: "arrow",
|
|
1424
1413
|
enabled: true,
|
|
1425
1414
|
phase: "main",
|
|
1426
|
-
fn:
|
|
1427
|
-
effect:
|
|
1415
|
+
fn: tr,
|
|
1416
|
+
effect: rr,
|
|
1428
1417
|
requires: ["popperOffsets"],
|
|
1429
1418
|
requiresIfExists: ["preventOverflow"]
|
|
1430
1419
|
};
|
|
1431
1420
|
function te(e) {
|
|
1432
1421
|
return e.split("-")[1];
|
|
1433
1422
|
}
|
|
1434
|
-
var
|
|
1423
|
+
var nr = {
|
|
1435
1424
|
top: "auto",
|
|
1436
1425
|
right: "auto",
|
|
1437
1426
|
bottom: "auto",
|
|
1438
1427
|
left: "auto"
|
|
1439
1428
|
};
|
|
1440
|
-
function
|
|
1441
|
-
var
|
|
1429
|
+
function or(e, t) {
|
|
1430
|
+
var r = e.x, i = e.y, n = t.devicePixelRatio || 1;
|
|
1442
1431
|
return {
|
|
1443
|
-
x: Z(
|
|
1444
|
-
y: Z(
|
|
1432
|
+
x: Z(r * n) / n || 0,
|
|
1433
|
+
y: Z(i * n) / n || 0
|
|
1445
1434
|
};
|
|
1446
1435
|
}
|
|
1447
|
-
function
|
|
1448
|
-
var t,
|
|
1436
|
+
function Ze(e) {
|
|
1437
|
+
var t, r = e.popper, i = e.popperRect, n = e.placement, o2 = e.variation, l2 = e.offsets, s2 = e.position, a2 = e.gpuAcceleration, f2 = e.adaptive, c2 = e.roundOffsets, h2 = e.isFixed, y2 = l2.x, u2 = y2 === void 0 ? 0 : y2, b2 = l2.y, v2 = b2 === void 0 ? 0 : b2, d2 = typeof c2 == "function" ? c2({
|
|
1449
1438
|
x: u2,
|
|
1450
1439
|
y: v2
|
|
1451
1440
|
}) : {
|
|
@@ -1455,14 +1444,14 @@
|
|
|
1455
1444
|
u2 = d2.x, v2 = d2.y;
|
|
1456
1445
|
var w2 = l2.hasOwnProperty("x"), O2 = l2.hasOwnProperty("y"), E2 = D, p2 = k, g2 = window;
|
|
1457
1446
|
if (f2) {
|
|
1458
|
-
var m2 = fe(
|
|
1459
|
-
if (m2 === B(
|
|
1447
|
+
var m2 = fe(r), x2 = "clientHeight", L2 = "clientWidth";
|
|
1448
|
+
if (m2 === B(r) && (m2 = F(r), V(m2).position !== "static" && s2 === "absolute" && (x2 = "scrollHeight", L2 = "scrollWidth")), m2 = m2, n === k || (n === D || n === M) && o2 === se) {
|
|
1460
1449
|
p2 = S;
|
|
1461
1450
|
var P2 = h2 && m2 === g2 && g2.visualViewport ? g2.visualViewport.height : (
|
|
1462
1451
|
// $FlowFixMe[prop-missing]
|
|
1463
1452
|
m2[x2]
|
|
1464
1453
|
);
|
|
1465
|
-
v2 -= P2 -
|
|
1454
|
+
v2 -= P2 - i.height, v2 *= a2 ? 1 : -1;
|
|
1466
1455
|
}
|
|
1467
1456
|
if (n === D || (n === k || n === S) && o2 === se) {
|
|
1468
1457
|
E2 = M;
|
|
@@ -1470,26 +1459,26 @@
|
|
|
1470
1459
|
// $FlowFixMe[prop-missing]
|
|
1471
1460
|
m2[L2]
|
|
1472
1461
|
);
|
|
1473
|
-
u2 -= A2 -
|
|
1462
|
+
u2 -= A2 - i.width, u2 *= a2 ? 1 : -1;
|
|
1474
1463
|
}
|
|
1475
1464
|
}
|
|
1476
1465
|
var $2 = Object.assign({
|
|
1477
1466
|
position: s2
|
|
1478
|
-
}, f2 &&
|
|
1467
|
+
}, f2 && nr), j2 = c2 === true ? or({
|
|
1479
1468
|
x: u2,
|
|
1480
1469
|
y: v2
|
|
1481
|
-
}, B(
|
|
1470
|
+
}, B(r)) : {
|
|
1482
1471
|
x: u2,
|
|
1483
1472
|
y: v2
|
|
1484
1473
|
};
|
|
1485
|
-
if (u2 =
|
|
1474
|
+
if (u2 = j2.x, v2 = j2.y, a2) {
|
|
1486
1475
|
var C2;
|
|
1487
1476
|
return Object.assign({}, $2, (C2 = {}, C2[p2] = O2 ? "0" : "", C2[E2] = w2 ? "0" : "", C2.transform = (g2.devicePixelRatio || 1) <= 1 ? "translate(" + u2 + "px, " + v2 + "px)" : "translate3d(" + u2 + "px, " + v2 + "px, 0)", C2));
|
|
1488
1477
|
}
|
|
1489
1478
|
return Object.assign({}, $2, (t = {}, t[p2] = O2 ? v2 + "px" : "", t[E2] = w2 ? u2 + "px" : "", t.transform = "", t));
|
|
1490
1479
|
}
|
|
1491
|
-
function
|
|
1492
|
-
var t = e.state,
|
|
1480
|
+
function ar(e) {
|
|
1481
|
+
var t = e.state, r = e.options, i = r.gpuAcceleration, n = i === void 0 ? true : i, o2 = r.adaptive, l2 = o2 === void 0 ? true : o2, s2 = r.roundOffsets, a2 = s2 === void 0 ? true : s2, f2 = {
|
|
1493
1482
|
placement: H(t.placement),
|
|
1494
1483
|
variation: te(t.placement),
|
|
1495
1484
|
popper: t.elements.popper,
|
|
@@ -1497,12 +1486,12 @@
|
|
|
1497
1486
|
gpuAcceleration: n,
|
|
1498
1487
|
isFixed: t.options.strategy === "fixed"
|
|
1499
1488
|
};
|
|
1500
|
-
t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper,
|
|
1489
|
+
t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, Ze(Object.assign({}, f2, {
|
|
1501
1490
|
offsets: t.modifiersData.popperOffsets,
|
|
1502
1491
|
position: t.options.strategy,
|
|
1503
1492
|
adaptive: l2,
|
|
1504
1493
|
roundOffsets: a2
|
|
1505
|
-
})))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow,
|
|
1494
|
+
})))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, Ze(Object.assign({}, f2, {
|
|
1506
1495
|
offsets: t.modifiersData.arrow,
|
|
1507
1496
|
position: "absolute",
|
|
1508
1497
|
adaptive: false,
|
|
@@ -1511,36 +1500,36 @@
|
|
|
1511
1500
|
"data-popper-placement": t.placement
|
|
1512
1501
|
});
|
|
1513
1502
|
}
|
|
1514
|
-
const
|
|
1503
|
+
const sr = {
|
|
1515
1504
|
name: "computeStyles",
|
|
1516
1505
|
enabled: true,
|
|
1517
1506
|
phase: "beforeWrite",
|
|
1518
|
-
fn:
|
|
1507
|
+
fn: ar,
|
|
1519
1508
|
data: {}
|
|
1520
1509
|
};
|
|
1521
1510
|
var ge = {
|
|
1522
1511
|
passive: true
|
|
1523
1512
|
};
|
|
1524
|
-
function
|
|
1525
|
-
var t = e.state,
|
|
1513
|
+
function cr(e) {
|
|
1514
|
+
var t = e.state, r = e.instance, i = e.options, n = i.scroll, o2 = n === void 0 ? true : n, l2 = i.resize, s2 = l2 === void 0 ? true : l2, a2 = B(t.elements.popper), f2 = [].concat(t.scrollParents.reference, t.scrollParents.popper);
|
|
1526
1515
|
return o2 && f2.forEach(function(c2) {
|
|
1527
|
-
c2.addEventListener("scroll",
|
|
1528
|
-
}), s2 && a2.addEventListener("resize",
|
|
1516
|
+
c2.addEventListener("scroll", r.update, ge);
|
|
1517
|
+
}), s2 && a2.addEventListener("resize", r.update, ge), function() {
|
|
1529
1518
|
o2 && f2.forEach(function(c2) {
|
|
1530
|
-
c2.removeEventListener("scroll",
|
|
1531
|
-
}), s2 && a2.removeEventListener("resize",
|
|
1519
|
+
c2.removeEventListener("scroll", r.update, ge);
|
|
1520
|
+
}), s2 && a2.removeEventListener("resize", r.update, ge);
|
|
1532
1521
|
};
|
|
1533
1522
|
}
|
|
1534
|
-
const
|
|
1523
|
+
const lr = {
|
|
1535
1524
|
name: "eventListeners",
|
|
1536
1525
|
enabled: true,
|
|
1537
1526
|
phase: "write",
|
|
1538
1527
|
fn: function() {
|
|
1539
1528
|
},
|
|
1540
|
-
effect:
|
|
1529
|
+
effect: cr,
|
|
1541
1530
|
data: {}
|
|
1542
1531
|
};
|
|
1543
|
-
var
|
|
1532
|
+
var fr = {
|
|
1544
1533
|
left: "right",
|
|
1545
1534
|
right: "left",
|
|
1546
1535
|
bottom: "top",
|
|
@@ -1548,30 +1537,30 @@
|
|
|
1548
1537
|
};
|
|
1549
1538
|
function me(e) {
|
|
1550
1539
|
return e.replace(/left|right|bottom|top/g, function(t) {
|
|
1551
|
-
return
|
|
1540
|
+
return fr[t];
|
|
1552
1541
|
});
|
|
1553
1542
|
}
|
|
1554
|
-
var
|
|
1543
|
+
var ur = {
|
|
1555
1544
|
start: "end",
|
|
1556
1545
|
end: "start"
|
|
1557
1546
|
};
|
|
1558
|
-
function
|
|
1547
|
+
function et(e) {
|
|
1559
1548
|
return e.replace(/start|end/g, function(t) {
|
|
1560
|
-
return
|
|
1549
|
+
return ur[t];
|
|
1561
1550
|
});
|
|
1562
1551
|
}
|
|
1563
1552
|
function Se(e) {
|
|
1564
|
-
var t = B(e),
|
|
1553
|
+
var t = B(e), r = t.pageXOffset, i = t.pageYOffset;
|
|
1565
1554
|
return {
|
|
1566
|
-
scrollLeft:
|
|
1567
|
-
scrollTop:
|
|
1555
|
+
scrollLeft: r,
|
|
1556
|
+
scrollTop: i
|
|
1568
1557
|
};
|
|
1569
1558
|
}
|
|
1570
1559
|
function Me(e) {
|
|
1571
1560
|
return ee(F(e)).left + Se(e).scrollLeft;
|
|
1572
1561
|
}
|
|
1573
|
-
function
|
|
1574
|
-
var
|
|
1562
|
+
function pr(e, t) {
|
|
1563
|
+
var r = B(e), i = F(e), n = r.visualViewport, o2 = i.clientWidth, l2 = i.clientHeight, s2 = 0, a2 = 0;
|
|
1575
1564
|
if (n) {
|
|
1576
1565
|
o2 = n.width, l2 = n.height;
|
|
1577
1566
|
var f2 = dt();
|
|
@@ -1584,26 +1573,26 @@
|
|
|
1584
1573
|
y: a2
|
|
1585
1574
|
};
|
|
1586
1575
|
}
|
|
1587
|
-
function
|
|
1588
|
-
var t,
|
|
1589
|
-
return
|
|
1576
|
+
function dr(e) {
|
|
1577
|
+
var t, r = F(e), i = Se(e), n = (t = e.ownerDocument) == null ? void 0 : t.body, o2 = _(r.scrollWidth, r.clientWidth, n ? n.scrollWidth : 0, n ? n.clientWidth : 0), l2 = _(r.scrollHeight, r.clientHeight, n ? n.scrollHeight : 0, n ? n.clientHeight : 0), s2 = -i.scrollLeft + Me(e), a2 = -i.scrollTop;
|
|
1578
|
+
return V(n || r).direction === "rtl" && (s2 += _(r.clientWidth, n ? n.clientWidth : 0) - o2), {
|
|
1590
1579
|
width: o2,
|
|
1591
1580
|
height: l2,
|
|
1592
1581
|
x: s2,
|
|
1593
1582
|
y: a2
|
|
1594
1583
|
};
|
|
1595
1584
|
}
|
|
1596
|
-
function
|
|
1597
|
-
var t =
|
|
1598
|
-
return /auto|scroll|overlay|hidden/.test(
|
|
1585
|
+
function je(e) {
|
|
1586
|
+
var t = V(e), r = t.overflow, i = t.overflowX, n = t.overflowY;
|
|
1587
|
+
return /auto|scroll|overlay|hidden/.test(r + n + i);
|
|
1599
1588
|
}
|
|
1600
1589
|
function yt(e) {
|
|
1601
|
-
return ["html", "body", "#document"].indexOf(N(e)) >= 0 ? e.ownerDocument.body : T(e) &&
|
|
1590
|
+
return ["html", "body", "#document"].indexOf(N(e)) >= 0 ? e.ownerDocument.body : T(e) && je(e) ? e : yt(we(e));
|
|
1602
1591
|
}
|
|
1603
1592
|
function ae(e, t) {
|
|
1604
|
-
var
|
|
1593
|
+
var r;
|
|
1605
1594
|
t === void 0 && (t = []);
|
|
1606
|
-
var
|
|
1595
|
+
var i = yt(e), n = i === ((r = e.ownerDocument) == null ? void 0 : r.body), o2 = B(i), l2 = n ? [o2].concat(o2.visualViewport || [], je(i) ? i : []) : i, s2 = t.concat(l2);
|
|
1607
1596
|
return n ? s2 : (
|
|
1608
1597
|
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
1609
1598
|
s2.concat(ae(we(l2)))
|
|
@@ -1617,33 +1606,33 @@
|
|
|
1617
1606
|
bottom: e.y + e.height
|
|
1618
1607
|
});
|
|
1619
1608
|
}
|
|
1620
|
-
function
|
|
1621
|
-
var
|
|
1622
|
-
return
|
|
1609
|
+
function vr(e, t) {
|
|
1610
|
+
var r = ee(e, false, t === "fixed");
|
|
1611
|
+
return r.top = r.top + e.clientTop, r.left = r.left + e.clientLeft, r.bottom = r.top + e.clientHeight, r.right = r.left + e.clientWidth, r.width = e.clientWidth, r.height = e.clientHeight, r.x = r.left, r.y = r.top, r;
|
|
1623
1612
|
}
|
|
1624
|
-
function
|
|
1625
|
-
return t === ut ? $e(
|
|
1613
|
+
function tt(e, t, r) {
|
|
1614
|
+
return t === ut ? $e(pr(e, r)) : K(t) ? vr(t, r) : $e(dr(F(e)));
|
|
1626
1615
|
}
|
|
1627
|
-
function
|
|
1628
|
-
var t = ae(we(e)),
|
|
1629
|
-
return K(
|
|
1630
|
-
return K(n) && vt(n,
|
|
1616
|
+
function hr(e) {
|
|
1617
|
+
var t = ae(we(e)), r = ["absolute", "fixed"].indexOf(V(e).position) >= 0, i = r && T(e) ? fe(e) : e;
|
|
1618
|
+
return K(i) ? t.filter(function(n) {
|
|
1619
|
+
return K(n) && vt(n, i) && N(n) !== "body";
|
|
1631
1620
|
}) : [];
|
|
1632
1621
|
}
|
|
1633
|
-
function
|
|
1634
|
-
var n = t === "clippingParents" ?
|
|
1635
|
-
var c2 =
|
|
1622
|
+
function gr(e, t, r, i) {
|
|
1623
|
+
var n = t === "clippingParents" ? hr(e) : [].concat(t), o2 = [].concat(n, [r]), l2 = o2[0], s2 = o2.reduce(function(a2, f2) {
|
|
1624
|
+
var c2 = tt(e, f2, i);
|
|
1636
1625
|
return a2.top = _(c2.top, a2.top), a2.right = ye(c2.right, a2.right), a2.bottom = ye(c2.bottom, a2.bottom), a2.left = _(c2.left, a2.left), a2;
|
|
1637
|
-
},
|
|
1626
|
+
}, tt(e, l2, i));
|
|
1638
1627
|
return s2.width = s2.right - s2.left, s2.height = s2.bottom - s2.top, s2.x = s2.left, s2.y = s2.top, s2;
|
|
1639
1628
|
}
|
|
1640
1629
|
function wt(e) {
|
|
1641
|
-
var t = e.reference,
|
|
1630
|
+
var t = e.reference, r = e.element, i = e.placement, n = i ? H(i) : null, o2 = i ? te(i) : null, l2 = t.x + t.width / 2 - r.width / 2, s2 = t.y + t.height / 2 - r.height / 2, a2;
|
|
1642
1631
|
switch (n) {
|
|
1643
1632
|
case k:
|
|
1644
1633
|
a2 = {
|
|
1645
1634
|
x: l2,
|
|
1646
|
-
y: t.y -
|
|
1635
|
+
y: t.y - r.height
|
|
1647
1636
|
};
|
|
1648
1637
|
break;
|
|
1649
1638
|
case S:
|
|
@@ -1660,7 +1649,7 @@
|
|
|
1660
1649
|
break;
|
|
1661
1650
|
case D:
|
|
1662
1651
|
a2 = {
|
|
1663
|
-
x: t.x -
|
|
1652
|
+
x: t.x - r.width,
|
|
1664
1653
|
y: s2
|
|
1665
1654
|
};
|
|
1666
1655
|
break;
|
|
@@ -1675,10 +1664,10 @@
|
|
|
1675
1664
|
var c2 = f2 === "y" ? "height" : "width";
|
|
1676
1665
|
switch (o2) {
|
|
1677
1666
|
case Q:
|
|
1678
|
-
a2[f2] = a2[f2] - (t[c2] / 2 -
|
|
1667
|
+
a2[f2] = a2[f2] - (t[c2] / 2 - r[c2] / 2);
|
|
1679
1668
|
break;
|
|
1680
1669
|
case se:
|
|
1681
|
-
a2[f2] = a2[f2] + (t[c2] / 2 -
|
|
1670
|
+
a2[f2] = a2[f2] + (t[c2] / 2 - r[c2] / 2);
|
|
1682
1671
|
break;
|
|
1683
1672
|
}
|
|
1684
1673
|
}
|
|
@@ -1686,7 +1675,7 @@
|
|
|
1686
1675
|
}
|
|
1687
1676
|
function ce(e, t) {
|
|
1688
1677
|
t === void 0 && (t = {});
|
|
1689
|
-
var
|
|
1678
|
+
var r = t, i = r.placement, n = i === void 0 ? e.placement : i, o2 = r.strategy, l2 = o2 === void 0 ? e.strategy : o2, s2 = r.boundary, a2 = s2 === void 0 ? jt : s2, f2 = r.rootBoundary, c2 = f2 === void 0 ? ut : f2, h2 = r.elementContext, y2 = h2 === void 0 ? ne : h2, u2 = r.altBoundary, b2 = u2 === void 0 ? false : u2, v2 = r.padding, d2 = v2 === void 0 ? 0 : v2, w2 = gt(typeof d2 != "number" ? d2 : mt(d2, le)), O2 = y2 === ne ? Wt : ne, E2 = e.rects.popper, p2 = e.elements[b2 ? O2 : y2], g2 = gr(K(p2) ? p2 : p2.contextElement || F(e.elements.popper), a2, c2, l2), m2 = ee(e.elements.reference), x2 = wt({
|
|
1690
1679
|
reference: m2,
|
|
1691
1680
|
element: E2,
|
|
1692
1681
|
strategy: "absolute",
|
|
@@ -1698,17 +1687,17 @@
|
|
|
1698
1687
|
right: P2.right - g2.right + w2.right
|
|
1699
1688
|
}, $2 = e.modifiersData.offset;
|
|
1700
1689
|
if (y2 === ne && $2) {
|
|
1701
|
-
var
|
|
1690
|
+
var j2 = $2[n];
|
|
1702
1691
|
Object.keys(A2).forEach(function(C2) {
|
|
1703
|
-
var
|
|
1704
|
-
A2[C2] +=
|
|
1692
|
+
var X2 = [M, S].indexOf(C2) >= 0 ? 1 : -1, Y2 = [k, S].indexOf(C2) >= 0 ? "y" : "x";
|
|
1693
|
+
A2[C2] += j2[Y2] * X2;
|
|
1705
1694
|
});
|
|
1706
1695
|
}
|
|
1707
1696
|
return A2;
|
|
1708
1697
|
}
|
|
1709
|
-
function
|
|
1698
|
+
function mr(e, t) {
|
|
1710
1699
|
t === void 0 && (t = {});
|
|
1711
|
-
var
|
|
1700
|
+
var r = t, i = r.placement, n = r.boundary, o2 = r.rootBoundary, l2 = r.padding, s2 = r.flipVariations, a2 = r.allowedAutoPlacements, f2 = a2 === void 0 ? pt : a2, c2 = te(i), h2 = c2 ? s2 ? Je : Je.filter(function(b2) {
|
|
1712
1701
|
return te(b2) === c2;
|
|
1713
1702
|
}) : le, y2 = h2.filter(function(b2) {
|
|
1714
1703
|
return f2.indexOf(b2) >= 0;
|
|
@@ -1726,48 +1715,48 @@
|
|
|
1726
1715
|
return u2[b2] - u2[v2];
|
|
1727
1716
|
});
|
|
1728
1717
|
}
|
|
1729
|
-
function
|
|
1718
|
+
function yr(e) {
|
|
1730
1719
|
if (H(e) === De)
|
|
1731
1720
|
return [];
|
|
1732
1721
|
var t = me(e);
|
|
1733
|
-
return [
|
|
1734
|
-
}
|
|
1735
|
-
function
|
|
1736
|
-
var t = e.state,
|
|
1737
|
-
if (!t.modifiersData[
|
|
1738
|
-
for (var n =
|
|
1739
|
-
return G2.concat(H(
|
|
1740
|
-
placement:
|
|
1722
|
+
return [et(e), t, et(t)];
|
|
1723
|
+
}
|
|
1724
|
+
function wr(e) {
|
|
1725
|
+
var t = e.state, r = e.options, i = e.name;
|
|
1726
|
+
if (!t.modifiersData[i]._skip) {
|
|
1727
|
+
for (var n = r.mainAxis, o2 = n === void 0 ? true : n, l2 = r.altAxis, s2 = l2 === void 0 ? true : l2, a2 = r.fallbackPlacements, f2 = r.padding, c2 = r.boundary, h2 = r.rootBoundary, y2 = r.altBoundary, u2 = r.flipVariations, b2 = u2 === void 0 ? true : u2, v2 = r.allowedAutoPlacements, d2 = t.options.placement, w2 = H(d2), O2 = w2 === d2, E2 = a2 || (O2 || !b2 ? [me(d2)] : yr(d2)), p2 = [d2].concat(E2).reduce(function(G2, I2) {
|
|
1728
|
+
return G2.concat(H(I2) === De ? mr(t, {
|
|
1729
|
+
placement: I2,
|
|
1741
1730
|
boundary: c2,
|
|
1742
1731
|
rootBoundary: h2,
|
|
1743
1732
|
padding: f2,
|
|
1744
1733
|
flipVariations: b2,
|
|
1745
1734
|
allowedAutoPlacements: v2
|
|
1746
|
-
}) :
|
|
1735
|
+
}) : I2);
|
|
1747
1736
|
}, []), g2 = t.rects.reference, m2 = t.rects.popper, x2 = /* @__PURE__ */ new Map(), L2 = true, P2 = p2[0], A2 = 0; A2 < p2.length; A2++) {
|
|
1748
|
-
var $2 = p2[A2],
|
|
1737
|
+
var $2 = p2[A2], j2 = H($2), C2 = te($2) === Q, X2 = [k, S].indexOf(j2) >= 0, Y2 = X2 ? "width" : "height", R2 = ce(t, {
|
|
1749
1738
|
placement: $2,
|
|
1750
1739
|
boundary: c2,
|
|
1751
1740
|
rootBoundary: h2,
|
|
1752
1741
|
altBoundary: y2,
|
|
1753
1742
|
padding: f2
|
|
1754
|
-
}),
|
|
1755
|
-
g2[
|
|
1756
|
-
var ue = me(
|
|
1757
|
-
if (o2 &&
|
|
1743
|
+
}), W2 = X2 ? C2 ? M : D : C2 ? S : k;
|
|
1744
|
+
g2[Y2] > m2[Y2] && (W2 = me(W2));
|
|
1745
|
+
var ue = me(W2), q2 = [];
|
|
1746
|
+
if (o2 && q2.push(R2[j2] <= 0), s2 && q2.push(R2[W2] <= 0, R2[ue] <= 0), q2.every(function(G2) {
|
|
1758
1747
|
return G2;
|
|
1759
1748
|
})) {
|
|
1760
1749
|
P2 = $2, L2 = false;
|
|
1761
1750
|
break;
|
|
1762
1751
|
}
|
|
1763
|
-
x2.set($2,
|
|
1752
|
+
x2.set($2, q2);
|
|
1764
1753
|
}
|
|
1765
1754
|
if (L2)
|
|
1766
|
-
for (var pe = b2 ? 3 : 1, be = function(
|
|
1755
|
+
for (var pe = b2 ? 3 : 1, be = function(I2) {
|
|
1767
1756
|
var ie = p2.find(function(ve) {
|
|
1768
1757
|
var z2 = x2.get(ve);
|
|
1769
1758
|
if (z2)
|
|
1770
|
-
return z2.slice(0,
|
|
1759
|
+
return z2.slice(0, I2).every(function(xe) {
|
|
1771
1760
|
return xe;
|
|
1772
1761
|
});
|
|
1773
1762
|
});
|
|
@@ -1775,45 +1764,44 @@
|
|
|
1775
1764
|
return P2 = ie, "break";
|
|
1776
1765
|
}, re = pe; re > 0; re--) {
|
|
1777
1766
|
var de = be(re);
|
|
1778
|
-
if (de === "break")
|
|
1779
|
-
break;
|
|
1767
|
+
if (de === "break") break;
|
|
1780
1768
|
}
|
|
1781
|
-
t.placement !== P2 && (t.modifiersData[
|
|
1769
|
+
t.placement !== P2 && (t.modifiersData[i]._skip = true, t.placement = P2, t.reset = true);
|
|
1782
1770
|
}
|
|
1783
1771
|
}
|
|
1784
|
-
const
|
|
1772
|
+
const br = {
|
|
1785
1773
|
name: "flip",
|
|
1786
1774
|
enabled: true,
|
|
1787
1775
|
phase: "main",
|
|
1788
|
-
fn:
|
|
1776
|
+
fn: wr,
|
|
1789
1777
|
requiresIfExists: ["offset"],
|
|
1790
1778
|
data: {
|
|
1791
1779
|
_skip: false
|
|
1792
1780
|
}
|
|
1793
1781
|
};
|
|
1794
|
-
function
|
|
1795
|
-
return
|
|
1782
|
+
function rt(e, t, r) {
|
|
1783
|
+
return r === void 0 && (r = {
|
|
1796
1784
|
x: 0,
|
|
1797
1785
|
y: 0
|
|
1798
1786
|
}), {
|
|
1799
|
-
top: e.top - t.height -
|
|
1800
|
-
right: e.right - t.width +
|
|
1801
|
-
bottom: e.bottom - t.height +
|
|
1802
|
-
left: e.left - t.width -
|
|
1787
|
+
top: e.top - t.height - r.y,
|
|
1788
|
+
right: e.right - t.width + r.x,
|
|
1789
|
+
bottom: e.bottom - t.height + r.y,
|
|
1790
|
+
left: e.left - t.width - r.x
|
|
1803
1791
|
};
|
|
1804
1792
|
}
|
|
1805
|
-
function
|
|
1793
|
+
function it(e) {
|
|
1806
1794
|
return [k, M, S, D].some(function(t) {
|
|
1807
1795
|
return e[t] >= 0;
|
|
1808
1796
|
});
|
|
1809
1797
|
}
|
|
1810
|
-
function
|
|
1811
|
-
var t = e.state,
|
|
1798
|
+
function xr(e) {
|
|
1799
|
+
var t = e.state, r = e.name, i = t.rects.reference, n = t.rects.popper, o2 = t.modifiersData.preventOverflow, l2 = ce(t, {
|
|
1812
1800
|
elementContext: "reference"
|
|
1813
1801
|
}), s2 = ce(t, {
|
|
1814
1802
|
altBoundary: true
|
|
1815
|
-
}), a2 =
|
|
1816
|
-
t.modifiersData[
|
|
1803
|
+
}), a2 = rt(l2, i), f2 = rt(s2, n, o2), c2 = it(a2), h2 = it(f2);
|
|
1804
|
+
t.modifiersData[r] = {
|
|
1817
1805
|
referenceClippingOffsets: a2,
|
|
1818
1806
|
popperEscapeOffsets: f2,
|
|
1819
1807
|
isReferenceHidden: c2,
|
|
@@ -1823,18 +1811,18 @@
|
|
|
1823
1811
|
"data-popper-escaped": h2
|
|
1824
1812
|
});
|
|
1825
1813
|
}
|
|
1826
|
-
const
|
|
1814
|
+
const Or = {
|
|
1827
1815
|
name: "hide",
|
|
1828
1816
|
enabled: true,
|
|
1829
1817
|
phase: "main",
|
|
1830
1818
|
requiresIfExists: ["preventOverflow"],
|
|
1831
|
-
fn:
|
|
1819
|
+
fn: xr
|
|
1832
1820
|
};
|
|
1833
|
-
function
|
|
1834
|
-
var
|
|
1821
|
+
function Er(e, t, r) {
|
|
1822
|
+
var i = H(e), n = [D, k].indexOf(i) >= 0 ? -1 : 1, o2 = typeof r == "function" ? r(Object.assign({}, t, {
|
|
1835
1823
|
placement: e
|
|
1836
|
-
})) :
|
|
1837
|
-
return l2 = l2 || 0, s2 = (s2 || 0) * n, [D, M].indexOf(
|
|
1824
|
+
})) : r, l2 = o2[0], s2 = o2[1];
|
|
1825
|
+
return l2 = l2 || 0, s2 = (s2 || 0) * n, [D, M].indexOf(i) >= 0 ? {
|
|
1838
1826
|
x: s2,
|
|
1839
1827
|
y: l2
|
|
1840
1828
|
} : {
|
|
@@ -1842,45 +1830,45 @@
|
|
|
1842
1830
|
y: s2
|
|
1843
1831
|
};
|
|
1844
1832
|
}
|
|
1845
|
-
function
|
|
1846
|
-
var t = e.state,
|
|
1847
|
-
return c2[h2] =
|
|
1833
|
+
function Ar(e) {
|
|
1834
|
+
var t = e.state, r = e.options, i = e.name, n = r.offset, o2 = n === void 0 ? [0, 0] : n, l2 = pt.reduce(function(c2, h2) {
|
|
1835
|
+
return c2[h2] = Er(h2, t.rects, o2), c2;
|
|
1848
1836
|
}, {}), s2 = l2[t.placement], a2 = s2.x, f2 = s2.y;
|
|
1849
|
-
t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += a2, t.modifiersData.popperOffsets.y += f2), t.modifiersData[
|
|
1837
|
+
t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += a2, t.modifiersData.popperOffsets.y += f2), t.modifiersData[i] = l2;
|
|
1850
1838
|
}
|
|
1851
|
-
const
|
|
1839
|
+
const Pr = {
|
|
1852
1840
|
name: "offset",
|
|
1853
1841
|
enabled: true,
|
|
1854
1842
|
phase: "main",
|
|
1855
1843
|
requires: ["popperOffsets"],
|
|
1856
|
-
fn:
|
|
1844
|
+
fn: Ar
|
|
1857
1845
|
};
|
|
1858
|
-
function
|
|
1859
|
-
var t = e.state,
|
|
1860
|
-
t.modifiersData[
|
|
1846
|
+
function Lr(e) {
|
|
1847
|
+
var t = e.state, r = e.name;
|
|
1848
|
+
t.modifiersData[r] = wt({
|
|
1861
1849
|
reference: t.rects.reference,
|
|
1862
1850
|
element: t.rects.popper,
|
|
1863
1851
|
strategy: "absolute",
|
|
1864
1852
|
placement: t.placement
|
|
1865
1853
|
});
|
|
1866
1854
|
}
|
|
1867
|
-
const
|
|
1855
|
+
const $r = {
|
|
1868
1856
|
name: "popperOffsets",
|
|
1869
1857
|
enabled: true,
|
|
1870
1858
|
phase: "read",
|
|
1871
|
-
fn:
|
|
1859
|
+
fn: Lr,
|
|
1872
1860
|
data: {}
|
|
1873
1861
|
};
|
|
1874
|
-
function
|
|
1862
|
+
function Cr(e) {
|
|
1875
1863
|
return e === "x" ? "y" : "x";
|
|
1876
1864
|
}
|
|
1877
|
-
function
|
|
1878
|
-
var t = e.state,
|
|
1865
|
+
function kr(e) {
|
|
1866
|
+
var t = e.state, r = e.options, i = e.name, n = r.mainAxis, o2 = n === void 0 ? true : n, l2 = r.altAxis, s2 = l2 === void 0 ? false : l2, a2 = r.boundary, f2 = r.rootBoundary, c2 = r.altBoundary, h2 = r.padding, y2 = r.tether, u2 = y2 === void 0 ? true : y2, b2 = r.tetherOffset, v2 = b2 === void 0 ? 0 : b2, d2 = ce(t, {
|
|
1879
1867
|
boundary: a2,
|
|
1880
1868
|
rootBoundary: f2,
|
|
1881
1869
|
padding: h2,
|
|
1882
1870
|
altBoundary: c2
|
|
1883
|
-
}), w2 = H(t.placement), O2 = te(t.placement), E2 = !O2, p2 = Te(w2), g2 =
|
|
1871
|
+
}), w2 = H(t.placement), O2 = te(t.placement), E2 = !O2, p2 = Te(w2), g2 = Cr(p2), m2 = t.modifiersData.popperOffsets, x2 = t.rects.reference, L2 = t.rects.popper, P2 = typeof v2 == "function" ? v2(Object.assign({}, t.rects, {
|
|
1884
1872
|
placement: t.placement
|
|
1885
1873
|
})) : v2, A2 = typeof P2 == "number" ? {
|
|
1886
1874
|
mainAxis: P2,
|
|
@@ -1888,132 +1876,132 @@
|
|
|
1888
1876
|
} : Object.assign({
|
|
1889
1877
|
mainAxis: 0,
|
|
1890
1878
|
altAxis: 0
|
|
1891
|
-
}, P2), $2 = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null,
|
|
1879
|
+
}, P2), $2 = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, j2 = {
|
|
1892
1880
|
x: 0,
|
|
1893
1881
|
y: 0
|
|
1894
1882
|
};
|
|
1895
1883
|
if (m2) {
|
|
1896
1884
|
if (o2) {
|
|
1897
|
-
var C2,
|
|
1885
|
+
var C2, X2 = p2 === "y" ? k : D, Y2 = p2 === "y" ? S : M, R2 = p2 === "y" ? "height" : "width", W2 = m2[p2], ue = W2 + d2[X2], q2 = W2 - d2[Y2], pe = u2 ? -L2[R2] / 2 : 0, be = O2 === Q ? x2[R2] : L2[R2], re = O2 === Q ? -L2[R2] : -x2[R2], de = t.elements.arrow, G2 = u2 && de ? Be(de) : {
|
|
1898
1886
|
width: 0,
|
|
1899
1887
|
height: 0
|
|
1900
|
-
},
|
|
1901
|
-
m2[p2] = Ne,
|
|
1888
|
+
}, I2 = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : ht(), ie = I2[X2], ve = I2[Y2], z2 = oe(0, x2[R2], G2[R2]), xe = E2 ? x2[R2] / 2 - pe - z2 - ie - A2.mainAxis : be - z2 - ie - A2.mainAxis, Ot = E2 ? -x2[R2] / 2 + pe + z2 + ve + A2.mainAxis : re + z2 + ve + A2.mainAxis, Oe = t.elements.arrow && fe(t.elements.arrow), Et = Oe ? p2 === "y" ? Oe.clientTop || 0 : Oe.clientLeft || 0 : 0, He = (C2 = $2 == null ? void 0 : $2[p2]) != null ? C2 : 0, At = W2 + xe - He - Et, Pt = W2 + Ot - He, Ne = oe(u2 ? ye(ue, At) : ue, W2, u2 ? _(q2, Pt) : q2);
|
|
1889
|
+
m2[p2] = Ne, j2[p2] = Ne - W2;
|
|
1902
1890
|
}
|
|
1903
1891
|
if (s2) {
|
|
1904
|
-
var
|
|
1905
|
-
m2[g2] = ze,
|
|
1892
|
+
var Ve, Lt = p2 === "x" ? k : D, $t = p2 === "x" ? S : M, U2 = m2[g2], he = g2 === "y" ? "height" : "width", Ie = U2 + d2[Lt], Fe = U2 - d2[$t], Ee = [k, D].indexOf(w2) !== -1, Xe = (Ve = $2 == null ? void 0 : $2[g2]) != null ? Ve : 0, Ye = Ee ? Ie : U2 - x2[he] - L2[he] - Xe + A2.altAxis, qe = Ee ? U2 + x2[he] + L2[he] - Xe - A2.altAxis : Fe, ze = u2 && Ee ? Zt(Ye, U2, qe) : oe(u2 ? Ye : Ie, U2, u2 ? qe : Fe);
|
|
1893
|
+
m2[g2] = ze, j2[g2] = ze - U2;
|
|
1906
1894
|
}
|
|
1907
|
-
t.modifiersData[
|
|
1895
|
+
t.modifiersData[i] = j2;
|
|
1908
1896
|
}
|
|
1909
1897
|
}
|
|
1910
|
-
const
|
|
1898
|
+
const Dr = {
|
|
1911
1899
|
name: "preventOverflow",
|
|
1912
1900
|
enabled: true,
|
|
1913
1901
|
phase: "main",
|
|
1914
|
-
fn:
|
|
1902
|
+
fn: kr,
|
|
1915
1903
|
requiresIfExists: ["offset"]
|
|
1916
1904
|
};
|
|
1917
|
-
function
|
|
1905
|
+
function Rr(e) {
|
|
1918
1906
|
return {
|
|
1919
1907
|
scrollLeft: e.scrollLeft,
|
|
1920
1908
|
scrollTop: e.scrollTop
|
|
1921
1909
|
};
|
|
1922
1910
|
}
|
|
1923
|
-
function Rr(e) {
|
|
1924
|
-
return e === B(e) || !T(e) ? Se(e) : Dr(e);
|
|
1925
|
-
}
|
|
1926
1911
|
function Br(e) {
|
|
1927
|
-
|
|
1928
|
-
|
|
1912
|
+
return e === B(e) || !T(e) ? Se(e) : Rr(e);
|
|
1913
|
+
}
|
|
1914
|
+
function Tr(e) {
|
|
1915
|
+
var t = e.getBoundingClientRect(), r = Z(t.width) / e.offsetWidth || 1, i = Z(t.height) / e.offsetHeight || 1;
|
|
1916
|
+
return r !== 1 || i !== 1;
|
|
1929
1917
|
}
|
|
1930
|
-
function
|
|
1931
|
-
|
|
1932
|
-
var
|
|
1918
|
+
function Sr(e, t, r) {
|
|
1919
|
+
r === void 0 && (r = false);
|
|
1920
|
+
var i = T(t), n = T(t) && Tr(t), o2 = F(t), l2 = ee(e, n, r), s2 = {
|
|
1933
1921
|
scrollLeft: 0,
|
|
1934
1922
|
scrollTop: 0
|
|
1935
1923
|
}, a2 = {
|
|
1936
1924
|
x: 0,
|
|
1937
1925
|
y: 0
|
|
1938
1926
|
};
|
|
1939
|
-
return (
|
|
1940
|
-
|
|
1927
|
+
return (i || !i && !r) && ((N(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
|
|
1928
|
+
je(o2)) && (s2 = Br(t)), T(t) ? (a2 = ee(t, true), a2.x += t.clientLeft, a2.y += t.clientTop) : o2 && (a2.x = Me(o2))), {
|
|
1941
1929
|
x: l2.left + s2.scrollLeft - a2.x,
|
|
1942
1930
|
y: l2.top + s2.scrollTop - a2.y,
|
|
1943
1931
|
width: l2.width,
|
|
1944
1932
|
height: l2.height
|
|
1945
1933
|
};
|
|
1946
1934
|
}
|
|
1947
|
-
function
|
|
1948
|
-
var t = /* @__PURE__ */ new Map(),
|
|
1935
|
+
function Mr(e) {
|
|
1936
|
+
var t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = [];
|
|
1949
1937
|
e.forEach(function(o2) {
|
|
1950
1938
|
t.set(o2.name, o2);
|
|
1951
1939
|
});
|
|
1952
1940
|
function n(o2) {
|
|
1953
|
-
|
|
1941
|
+
r.add(o2.name);
|
|
1954
1942
|
var l2 = [].concat(o2.requires || [], o2.requiresIfExists || []);
|
|
1955
1943
|
l2.forEach(function(s2) {
|
|
1956
|
-
if (!
|
|
1944
|
+
if (!r.has(s2)) {
|
|
1957
1945
|
var a2 = t.get(s2);
|
|
1958
1946
|
a2 && n(a2);
|
|
1959
1947
|
}
|
|
1960
|
-
}),
|
|
1948
|
+
}), i.push(o2);
|
|
1961
1949
|
}
|
|
1962
1950
|
return e.forEach(function(o2) {
|
|
1963
|
-
|
|
1964
|
-
}),
|
|
1951
|
+
r.has(o2.name) || n(o2);
|
|
1952
|
+
}), i;
|
|
1965
1953
|
}
|
|
1966
|
-
function
|
|
1967
|
-
var t =
|
|
1968
|
-
return
|
|
1969
|
-
return
|
|
1970
|
-
return n.phase ===
|
|
1954
|
+
function jr(e) {
|
|
1955
|
+
var t = Mr(e);
|
|
1956
|
+
return Ut.reduce(function(r, i) {
|
|
1957
|
+
return r.concat(t.filter(function(n) {
|
|
1958
|
+
return n.phase === i;
|
|
1971
1959
|
}));
|
|
1972
1960
|
}, []);
|
|
1973
1961
|
}
|
|
1974
1962
|
function Wr(e) {
|
|
1975
1963
|
var t;
|
|
1976
1964
|
return function() {
|
|
1977
|
-
return t || (t = new Promise(function(
|
|
1965
|
+
return t || (t = new Promise(function(r) {
|
|
1978
1966
|
Promise.resolve().then(function() {
|
|
1979
|
-
t = void 0,
|
|
1967
|
+
t = void 0, r(e());
|
|
1980
1968
|
});
|
|
1981
1969
|
})), t;
|
|
1982
1970
|
};
|
|
1983
1971
|
}
|
|
1984
|
-
function
|
|
1985
|
-
var t = e.reduce(function(
|
|
1986
|
-
var n =
|
|
1987
|
-
return
|
|
1988
|
-
options: Object.assign({}, n.options,
|
|
1989
|
-
data: Object.assign({}, n.data,
|
|
1990
|
-
}) :
|
|
1972
|
+
function Hr(e) {
|
|
1973
|
+
var t = e.reduce(function(r, i) {
|
|
1974
|
+
var n = r[i.name];
|
|
1975
|
+
return r[i.name] = n ? Object.assign({}, n, i, {
|
|
1976
|
+
options: Object.assign({}, n.options, i.options),
|
|
1977
|
+
data: Object.assign({}, n.data, i.data)
|
|
1978
|
+
}) : i, r;
|
|
1991
1979
|
}, {});
|
|
1992
|
-
return Object.keys(t).map(function(
|
|
1993
|
-
return t[
|
|
1980
|
+
return Object.keys(t).map(function(r) {
|
|
1981
|
+
return t[r];
|
|
1994
1982
|
});
|
|
1995
1983
|
}
|
|
1996
|
-
var
|
|
1984
|
+
var nt = {
|
|
1997
1985
|
placement: "bottom",
|
|
1998
1986
|
modifiers: [],
|
|
1999
1987
|
strategy: "absolute"
|
|
2000
1988
|
};
|
|
2001
|
-
function
|
|
2002
|
-
for (var e = arguments.length, t = new Array(e),
|
|
2003
|
-
t[
|
|
2004
|
-
return !t.some(function(
|
|
2005
|
-
return !(
|
|
1989
|
+
function ot() {
|
|
1990
|
+
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
|
1991
|
+
t[r] = arguments[r];
|
|
1992
|
+
return !t.some(function(i) {
|
|
1993
|
+
return !(i && typeof i.getBoundingClientRect == "function");
|
|
2006
1994
|
});
|
|
2007
1995
|
}
|
|
2008
|
-
function
|
|
1996
|
+
function Nr(e) {
|
|
2009
1997
|
e === void 0 && (e = {});
|
|
2010
|
-
var t = e,
|
|
1998
|
+
var t = e, r = t.defaultModifiers, i = r === void 0 ? [] : r, n = t.defaultOptions, o2 = n === void 0 ? nt : n;
|
|
2011
1999
|
return function(s2, a2, f2) {
|
|
2012
2000
|
f2 === void 0 && (f2 = o2);
|
|
2013
2001
|
var c2 = {
|
|
2014
2002
|
placement: "bottom",
|
|
2015
2003
|
orderedModifiers: [],
|
|
2016
|
-
options: Object.assign({},
|
|
2004
|
+
options: Object.assign({}, nt, o2),
|
|
2017
2005
|
modifiersData: {},
|
|
2018
2006
|
elements: {
|
|
2019
2007
|
reference: s2,
|
|
@@ -2029,7 +2017,7 @@
|
|
|
2029
2017
|
reference: K(s2) ? ae(s2) : s2.contextElement ? ae(s2.contextElement) : [],
|
|
2030
2018
|
popper: ae(a2)
|
|
2031
2019
|
};
|
|
2032
|
-
var E2 =
|
|
2020
|
+
var E2 = jr(Hr([].concat(i, c2.options.modifiers)));
|
|
2033
2021
|
return c2.orderedModifiers = E2.filter(function(p2) {
|
|
2034
2022
|
return p2.enabled;
|
|
2035
2023
|
}), b2(), u2.update();
|
|
@@ -2042,9 +2030,9 @@
|
|
|
2042
2030
|
forceUpdate: function() {
|
|
2043
2031
|
if (!y2) {
|
|
2044
2032
|
var w2 = c2.elements, O2 = w2.reference, E2 = w2.popper;
|
|
2045
|
-
if (
|
|
2033
|
+
if (ot(O2, E2)) {
|
|
2046
2034
|
c2.rects = {
|
|
2047
|
-
reference:
|
|
2035
|
+
reference: Sr(O2, fe(E2), c2.options.strategy === "fixed"),
|
|
2048
2036
|
popper: Be(E2)
|
|
2049
2037
|
}, c2.reset = false, c2.placement = c2.options.placement, c2.orderedModifiers.forEach(function(A2) {
|
|
2050
2038
|
return c2.modifiersData[A2.name] = Object.assign({}, A2.data);
|
|
@@ -2076,7 +2064,7 @@
|
|
|
2076
2064
|
v2(), y2 = true;
|
|
2077
2065
|
}
|
|
2078
2066
|
};
|
|
2079
|
-
if (!
|
|
2067
|
+
if (!ot(s2, a2))
|
|
2080
2068
|
return u2;
|
|
2081
2069
|
u2.setOptions(f2).then(function(d2) {
|
|
2082
2070
|
!y2 && f2.onFirstUpdate && f2.onFirstUpdate(d2);
|
|
@@ -2104,33 +2092,31 @@
|
|
|
2104
2092
|
return u2;
|
|
2105
2093
|
};
|
|
2106
2094
|
}
|
|
2107
|
-
var
|
|
2108
|
-
defaultModifiers:
|
|
2095
|
+
var Vr = [lr, $r, sr, Gt, Pr, br, Dr, ir, Or], Ir = /* @__PURE__ */ Nr({
|
|
2096
|
+
defaultModifiers: Vr
|
|
2109
2097
|
});
|
|
2110
2098
|
async function Ce(e) {
|
|
2111
|
-
|
|
2112
|
-
return this.collection;
|
|
2113
|
-
const t = this.collection.findIndex((r2) => r2.id === e.id);
|
|
2099
|
+
const t = this.collection.findIndex((r) => r.id === e.id);
|
|
2114
2100
|
if (t >= 0) {
|
|
2115
|
-
const
|
|
2116
|
-
|
|
2117
|
-
delete
|
|
2101
|
+
const r = this.collection[t];
|
|
2102
|
+
r.state === "opened" && r.close(), r.popper.destroy(), bt(r), Object.getOwnPropertyNames(r).forEach((i) => {
|
|
2103
|
+
delete r[i];
|
|
2118
2104
|
}), this.collection.splice(t, 1);
|
|
2119
2105
|
}
|
|
2120
2106
|
return this.collection;
|
|
2121
2107
|
}
|
|
2122
2108
|
function bt(e) {
|
|
2123
2109
|
return e.__eventListeners && (e.__eventListeners.forEach((t) => {
|
|
2124
|
-
t.el.forEach((
|
|
2125
|
-
t.type.forEach((
|
|
2126
|
-
e[
|
|
2110
|
+
t.el.forEach((r) => {
|
|
2111
|
+
t.type.forEach((i) => {
|
|
2112
|
+
e[r].removeEventListener(i, t.listener, false);
|
|
2127
2113
|
});
|
|
2128
2114
|
});
|
|
2129
2115
|
}), delete e.__eventListeners), e;
|
|
2130
2116
|
}
|
|
2131
|
-
async function
|
|
2132
|
-
const t =
|
|
2133
|
-
return t.el.classList.add(this.settings.stateActive), t.trigger.hasAttribute("aria-controls") && t.trigger.setAttribute("aria-expanded", "true"), t.config =
|
|
2117
|
+
async function We(e) {
|
|
2118
|
+
const t = st.call(this, e);
|
|
2119
|
+
return t.el.classList.add(this.settings.stateActive), t.trigger.hasAttribute("aria-controls") && t.trigger.setAttribute("aria-expanded", "true"), t.config = at(t.el, this.settings), t.popper.setOptions({
|
|
2134
2120
|
placement: t.config.placement,
|
|
2135
2121
|
modifiers: [
|
|
2136
2122
|
{ name: "eventListeners", enabled: true },
|
|
@@ -2138,101 +2124,98 @@
|
|
|
2138
2124
|
]
|
|
2139
2125
|
}), t.popper.update(), t.state = "opened", t;
|
|
2140
2126
|
}
|
|
2141
|
-
async function
|
|
2127
|
+
async function Fr(e, t) {
|
|
2142
2128
|
Ce.call(this, e);
|
|
2143
|
-
const
|
|
2129
|
+
const r = this, i = {
|
|
2130
|
+
id: e.id,
|
|
2131
|
+
state: "closed",
|
|
2132
|
+
el: e,
|
|
2133
|
+
trigger: t,
|
|
2134
|
+
popper: Ir(t, e),
|
|
2135
|
+
config: at(e, this.settings),
|
|
2144
2136
|
open() {
|
|
2145
|
-
return
|
|
2137
|
+
return We.call(r, this);
|
|
2146
2138
|
},
|
|
2147
2139
|
close() {
|
|
2148
|
-
return ke.call(
|
|
2140
|
+
return ke.call(r, this);
|
|
2149
2141
|
},
|
|
2150
2142
|
deregister() {
|
|
2151
|
-
return Ce.call(
|
|
2143
|
+
return Ce.call(r, this);
|
|
2152
2144
|
}
|
|
2153
|
-
}, n = {
|
|
2154
|
-
id: e.id,
|
|
2155
|
-
state: "closed",
|
|
2156
|
-
el: e,
|
|
2157
|
-
trigger: t,
|
|
2158
|
-
popper: Ir(t, e),
|
|
2159
|
-
config: ot(e, this.settings),
|
|
2160
|
-
...i2
|
|
2161
2145
|
};
|
|
2162
|
-
return
|
|
2146
|
+
return i.trigger.hasAttribute("aria-controls") && i.trigger.setAttribute("aria-expanded", "false"), xt.call(this, i), this.collection.push(i), i.el.classList.contains(this.settings.stateActive) && (await i.open(), ft.call(this, i)), i;
|
|
2163
2147
|
}
|
|
2164
2148
|
function xt(e) {
|
|
2165
2149
|
return e.__eventListeners || (e.config.event === "hover" ? (e.__eventListeners = [{
|
|
2166
2150
|
el: ["trigger"],
|
|
2167
2151
|
type: ["mouseenter", "focus"],
|
|
2168
|
-
listener:
|
|
2152
|
+
listener: We.bind(this, e)
|
|
2169
2153
|
}, {
|
|
2170
2154
|
el: ["el", "trigger"],
|
|
2171
2155
|
type: ["mouseleave", "focusout"],
|
|
2172
2156
|
listener: lt.bind(this, e)
|
|
2173
|
-
}], e.__eventListeners.forEach((
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
e[
|
|
2157
|
+
}], e.__eventListeners.forEach((r) => {
|
|
2158
|
+
r.el.forEach((i) => {
|
|
2159
|
+
r.type.forEach((n) => {
|
|
2160
|
+
e[i].addEventListener(n, r.listener, false);
|
|
2177
2161
|
});
|
|
2178
2162
|
});
|
|
2179
2163
|
})) : (e.__eventListeners = [{
|
|
2180
2164
|
el: ["trigger"],
|
|
2181
2165
|
type: ["click"],
|
|
2182
|
-
listener:
|
|
2183
|
-
}], e.__eventListeners.forEach((
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
e[
|
|
2166
|
+
listener: St.bind(this, e)
|
|
2167
|
+
}], e.__eventListeners.forEach((r) => {
|
|
2168
|
+
r.el.forEach((i) => {
|
|
2169
|
+
r.type.forEach((n) => {
|
|
2170
|
+
e[i].addEventListener(n, r.listener, false);
|
|
2187
2171
|
});
|
|
2188
2172
|
});
|
|
2189
2173
|
}))), e;
|
|
2190
2174
|
}
|
|
2191
2175
|
var J;
|
|
2192
|
-
class
|
|
2193
|
-
constructor(
|
|
2176
|
+
class Yr extends Ct {
|
|
2177
|
+
constructor(r) {
|
|
2194
2178
|
super();
|
|
2195
|
-
|
|
2196
|
-
this.defaults = Dt, this.settings = { ...this.defaults, ...
|
|
2179
|
+
Ke(this, J);
|
|
2180
|
+
this.defaults = Dt, this.settings = { ...this.defaults, ...r }, this.trigger = null, Ge(this, J, Mt.bind(this)), this.settings.autoMount && this.mount();
|
|
2197
2181
|
}
|
|
2198
|
-
async
|
|
2199
|
-
|
|
2200
|
-
const
|
|
2201
|
-
return await this.registerCollection(
|
|
2182
|
+
async mount(r) {
|
|
2183
|
+
r && (this.settings = { ...this.settings, ...r });
|
|
2184
|
+
const i = document.querySelectorAll(this.settings.selectorPopover);
|
|
2185
|
+
return await this.registerCollection(i), this.settings.eventListeners && this.mountEventListeners(false), this;
|
|
2202
2186
|
}
|
|
2203
|
-
async
|
|
2204
|
-
return this.trigger = null, await this.deregisterCollection(), this.settings.eventListeners && this.
|
|
2187
|
+
async unmount() {
|
|
2188
|
+
return this.trigger = null, await this.deregisterCollection(), this.settings.eventListeners && this.unmountEventListeners(false), this;
|
|
2205
2189
|
}
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
xt.call(this,
|
|
2190
|
+
mountEventListeners(r = true) {
|
|
2191
|
+
r && this.collection.forEach((i) => {
|
|
2192
|
+
xt.call(this, i);
|
|
2209
2193
|
}), document.addEventListener("keydown", Ae(this, J), false);
|
|
2210
2194
|
}
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
bt(
|
|
2195
|
+
unmountEventListeners(r = true) {
|
|
2196
|
+
r && this.collection.forEach((i) => {
|
|
2197
|
+
bt(i);
|
|
2214
2198
|
}), document.removeEventListener("keydown", Ae(this, J), false);
|
|
2215
2199
|
}
|
|
2216
|
-
register(
|
|
2217
|
-
const
|
|
2218
|
-
return
|
|
2200
|
+
register(r) {
|
|
2201
|
+
const i = Tt.call(this, r);
|
|
2202
|
+
return i.error ? Promise.reject(i.error) : Fr.call(this, i.popover, i.trigger);
|
|
2219
2203
|
}
|
|
2220
|
-
deregister(
|
|
2221
|
-
|
|
2222
|
-
return Ce.call(this,
|
|
2204
|
+
deregister(r) {
|
|
2205
|
+
let i = this.get(r.id || r);
|
|
2206
|
+
return i ? Ce.call(this, i) : Promise.reject(new Error(`Failed to deregister; popover does not exist in collection with ID of: "${r.id || r}".`));
|
|
2223
2207
|
}
|
|
2224
|
-
open(
|
|
2225
|
-
return
|
|
2208
|
+
open(r) {
|
|
2209
|
+
return We.call(this, r);
|
|
2226
2210
|
}
|
|
2227
|
-
close(
|
|
2228
|
-
return ke.call(this,
|
|
2211
|
+
close(r) {
|
|
2212
|
+
return ke.call(this, r);
|
|
2229
2213
|
}
|
|
2230
2214
|
}
|
|
2231
2215
|
J = /* @__PURE__ */ new WeakMap();
|
|
2232
|
-
exports2.
|
|
2233
|
-
exports2.
|
|
2234
|
-
exports2.
|
|
2235
|
-
exports2.Popover = qr;
|
|
2216
|
+
exports2.Drawer = nt$1;
|
|
2217
|
+
exports2.Modal = Q$1;
|
|
2218
|
+
exports2.Popover = Yr;
|
|
2236
2219
|
exports2.core = index;
|
|
2237
2220
|
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
2238
2221
|
});
|