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