vrembem 4.0.0-next.11 → 4.0.0-next.13

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