vrembem 4.0.0-next.3 → 4.0.0-next.4

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