wj-elements 0.1.0 → 0.1.2

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.
Files changed (49) hide show
  1. package/dist/dark.css +1 -1
  2. package/dist/light.css +1 -1
  3. package/dist/{localize-7fxVJArK.js → localize-DVuO3S17.js} +1 -1
  4. package/dist/{popup.element-BXak-Fgc.js → popup.element-Dj9j__Dh.js} +329 -350
  5. package/dist/styles.css +1 -1
  6. package/dist/wje-accordion-item.js +88 -0
  7. package/dist/wje-accordion.js +79 -0
  8. package/dist/wje-animation.js +10 -11
  9. package/dist/wje-avatar.js +31 -29
  10. package/dist/wje-badge.js +7 -7
  11. package/dist/wje-breadcrumb.js +11 -11
  12. package/dist/wje-button.js +22 -29
  13. package/dist/wje-carousel.js +8 -9
  14. package/dist/wje-checkbox.js +81 -23
  15. package/dist/wje-dialog.js +53 -25
  16. package/dist/wje-dropdown.js +36 -23
  17. package/dist/wje-element.js +100 -89
  18. package/dist/wje-file-upload-item.js +3 -4
  19. package/dist/wje-file-upload.js +40 -43
  20. package/dist/wje-format-digital.js +1 -1
  21. package/dist/wje-icon-picker.js +1 -1
  22. package/dist/wje-icon.js +115 -3
  23. package/dist/wje-img-comparer.js +1 -2
  24. package/dist/wje-infinite-scroll.js +71 -41
  25. package/dist/wje-inline-edit.js +1 -2
  26. package/dist/wje-input-file.js +26 -18
  27. package/dist/wje-input.js +1 -1
  28. package/dist/wje-master.js +323 -168
  29. package/dist/wje-menu-item.js +33 -31
  30. package/dist/wje-menu.js +7 -7
  31. package/dist/wje-option.js +97 -3
  32. package/dist/wje-options.js +1 -1
  33. package/dist/wje-popup.js +1 -1
  34. package/dist/wje-progress-bar.js +5 -5
  35. package/dist/wje-radio-group.js +1 -1
  36. package/dist/wje-radio.js +1 -1
  37. package/dist/wje-relative-time.js +4 -13
  38. package/dist/wje-select.js +9 -10
  39. package/dist/wje-slider.js +40 -79
  40. package/dist/wje-tab.js +9 -9
  41. package/dist/wje-toast.js +16 -16
  42. package/dist/wje-toggle.js +39 -15
  43. package/dist/wje-tooltip.js +47 -23
  44. package/package.json +2 -1
  45. package/dist/custom-elements.json +0 -12216
  46. package/dist/icon.element-DOiXP3pi.js +0 -115
  47. package/dist/option.element-CpeafIM-.js +0 -98
  48. package/dist/styles-4vJ2wdTZ.js +0 -4
  49. package/dist/web-types.json +0 -2756
@@ -1,20 +1,20 @@
1
- var Lt = Object.defineProperty;
2
- var Tt = (t, e, n) => e in t ? Lt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var ut = (t, e, n) => (Tt(t, typeof e != "symbol" ? e + "" : e, n), n);
4
- import Pt, { event as U } from "./wje-element.js";
1
+ var Ot = Object.defineProperty;
2
+ var Lt = (t, e, n) => e in t ? Ot(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var ut = (t, e, n) => (Lt(t, typeof e != "symbol" ? e + "" : e, n), n);
4
+ import Tt, { event as U } from "./wje-element.js";
5
5
  const N = Math.min, R = Math.max, Z = Math.round, Q = Math.floor, B = (t) => ({
6
6
  x: t,
7
7
  y: t
8
- }), St = {
8
+ }), Pt = {
9
9
  left: "right",
10
10
  right: "left",
11
11
  bottom: "top",
12
12
  top: "bottom"
13
- }, Dt = {
13
+ }, St = {
14
14
  start: "end",
15
15
  end: "start"
16
16
  };
17
- function kt(t, e, n) {
17
+ function Dt(t, e, n) {
18
18
  return R(t, N(e, n));
19
19
  }
20
20
  function K(t, e) {
@@ -23,10 +23,10 @@ function K(t, e) {
23
23
  function j(t) {
24
24
  return t.split("-")[0];
25
25
  }
26
- function I(t) {
26
+ function _(t) {
27
27
  return t.split("-")[1];
28
28
  }
29
- function Wt(t) {
29
+ function kt(t) {
30
30
  return t === "x" ? "y" : "x";
31
31
  }
32
32
  function rt(t) {
@@ -35,21 +35,21 @@ function rt(t) {
35
35
  function nt(t) {
36
36
  return ["top", "bottom"].includes(j(t)) ? "y" : "x";
37
37
  }
38
- function lt(t) {
39
- return Wt(nt(t));
38
+ function ct(t) {
39
+ return kt(nt(t));
40
40
  }
41
- function Ft(t, e, n) {
41
+ function Ht(t, e, n) {
42
42
  n === void 0 && (n = !1);
43
- const o = I(t), i = lt(t), s = rt(i);
43
+ const o = _(t), i = ct(t), s = rt(i);
44
44
  let r = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
45
45
  return e.reference[s] > e.floating[s] && (r = tt(r)), [r, tt(r)];
46
46
  }
47
- function Ht(t) {
47
+ function Wt(t) {
48
48
  const e = tt(t);
49
49
  return [st(t), e, st(e)];
50
50
  }
51
51
  function st(t) {
52
- return t.replace(/start|end/g, (e) => Dt[e]);
52
+ return t.replace(/start|end/g, (e) => St[e]);
53
53
  }
54
54
  function Mt(t, e, n) {
55
55
  const o = ["left", "right"], i = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
@@ -64,15 +64,15 @@ function Mt(t, e, n) {
64
64
  return [];
65
65
  }
66
66
  }
67
- function Nt(t, e, n, o) {
68
- const i = I(t);
67
+ function Ft(t, e, n, o) {
68
+ const i = _(t);
69
69
  let s = Mt(j(t), n === "start", o);
70
70
  return i && (s = s.map((r) => r + "-" + i), e && (s = s.concat(s.map(st)))), s;
71
71
  }
72
72
  function tt(t) {
73
- return t.replace(/left|right|bottom|top/g, (e) => St[e]);
73
+ return t.replace(/left|right|bottom|top/g, (e) => Pt[e]);
74
74
  }
75
- function Bt(t) {
75
+ function Nt(t) {
76
76
  return {
77
77
  top: 0,
78
78
  right: 0,
@@ -82,7 +82,7 @@ function Bt(t) {
82
82
  };
83
83
  }
84
84
  function gt(t) {
85
- return typeof t != "number" ? Bt(t) : {
85
+ return typeof t != "number" ? Nt(t) : {
86
86
  top: t,
87
87
  right: t,
88
88
  bottom: t,
@@ -103,31 +103,31 @@ function ht(t, e, n) {
103
103
  reference: o,
104
104
  floating: i
105
105
  } = t;
106
- const s = nt(e), r = lt(e), c = rt(r), l = j(e), a = s === "y", h = o.x + o.width / 2 - i.width / 2, u = o.y + o.height / 2 - i.height / 2, p = o[c] / 2 - i[c] / 2;
106
+ const s = nt(e), r = ct(e), l = rt(r), c = j(e), a = s === "y", d = o.x + o.width / 2 - i.width / 2, h = o.y + o.height / 2 - i.height / 2, p = o[l] / 2 - i[l] / 2;
107
107
  let f;
108
- switch (l) {
108
+ switch (c) {
109
109
  case "top":
110
110
  f = {
111
- x: h,
111
+ x: d,
112
112
  y: o.y - i.height
113
113
  };
114
114
  break;
115
115
  case "bottom":
116
116
  f = {
117
- x: h,
117
+ x: d,
118
118
  y: o.y + o.height
119
119
  };
120
120
  break;
121
121
  case "right":
122
122
  f = {
123
123
  x: o.x + o.width,
124
- y: u
124
+ y: h
125
125
  };
126
126
  break;
127
127
  case "left":
128
128
  f = {
129
129
  x: o.x - i.width,
130
- y: u
130
+ y: h
131
131
  };
132
132
  break;
133
133
  default:
@@ -136,7 +136,7 @@ function ht(t, e, n) {
136
136
  y: o.y
137
137
  };
138
138
  }
139
- switch (I(e)) {
139
+ switch (_(e)) {
140
140
  case "start":
141
141
  f[r] -= p * (n && a ? -1 : 1);
142
142
  break;
@@ -146,33 +146,33 @@ function ht(t, e, n) {
146
146
  }
147
147
  return f;
148
148
  }
149
- const Vt = async (t, e, n) => {
149
+ const Bt = async (t, e, n) => {
150
150
  const {
151
151
  placement: o = "bottom",
152
152
  strategy: i = "absolute",
153
153
  middleware: s = [],
154
154
  platform: r
155
- } = n, c = s.filter(Boolean), l = await (r.isRTL == null ? void 0 : r.isRTL(e));
155
+ } = n, l = s.filter(Boolean), c = await (r.isRTL == null ? void 0 : r.isRTL(e));
156
156
  let a = await r.getElementRects({
157
157
  reference: t,
158
158
  floating: e,
159
159
  strategy: i
160
160
  }), {
161
- x: h,
162
- y: u
163
- } = ht(a, o, l), p = o, f = {}, d = 0;
164
- for (let m = 0; m < c.length; m++) {
161
+ x: d,
162
+ y: h
163
+ } = ht(a, o, c), p = o, f = {}, u = 0;
164
+ for (let m = 0; m < l.length; m++) {
165
165
  const {
166
166
  name: w,
167
167
  fn: g
168
- } = c[m], {
169
- x: v,
170
- y: x,
171
- data: b,
172
- reset: y
168
+ } = l[m], {
169
+ x,
170
+ y,
171
+ data: A,
172
+ reset: v
173
173
  } = await g({
174
- x: h,
175
- y: u,
174
+ x: d,
175
+ y: h,
176
176
  initialPlacement: o,
177
177
  placement: p,
178
178
  strategy: i,
@@ -184,24 +184,27 @@ const Vt = async (t, e, n) => {
184
184
  floating: e
185
185
  }
186
186
  });
187
- h = v ?? h, u = x ?? u, f = {
187
+ if (d = x ?? d, h = y ?? h, f = {
188
188
  ...f,
189
189
  [w]: {
190
190
  ...f[w],
191
- ...b
191
+ ...A
192
192
  }
193
- }, y && d <= 50 && (d++, typeof y == "object" && (y.placement && (p = y.placement), y.rects && (a = y.rects === !0 ? await r.getElementRects({
194
- reference: t,
195
- floating: e,
196
- strategy: i
197
- }) : y.rects), {
198
- x: h,
199
- y: u
200
- } = ht(a, p, l)), m = -1);
193
+ }, v && u <= 50) {
194
+ u++, typeof v == "object" && (v.placement && (p = v.placement), v.rects && (a = v.rects === !0 ? await r.getElementRects({
195
+ reference: t,
196
+ floating: e,
197
+ strategy: i
198
+ }) : v.rects), {
199
+ x: d,
200
+ y: h
201
+ } = ht(a, p, c)), m = -1;
202
+ continue;
203
+ }
201
204
  }
202
205
  return {
203
- x: h,
204
- y: u,
206
+ x: d,
207
+ y: h,
205
208
  placement: p,
206
209
  strategy: i,
207
210
  middlewareData: f
@@ -215,43 +218,42 @@ async function wt(t, e) {
215
218
  y: i,
216
219
  platform: s,
217
220
  rects: r,
218
- elements: c,
219
- strategy: l
221
+ elements: l,
222
+ strategy: c
220
223
  } = t, {
221
224
  boundary: a = "clippingAncestors",
222
- rootBoundary: h = "viewport",
223
- elementContext: u = "floating",
225
+ rootBoundary: d = "viewport",
226
+ elementContext: h = "floating",
224
227
  altBoundary: p = !1,
225
228
  padding: f = 0
226
- } = K(e, t), d = gt(f), w = c[p ? u === "floating" ? "reference" : "floating" : u], g = et(await s.getClippingRect({
227
- element: (n = await (s.isElement == null ? void 0 : s.isElement(w))) == null || n ? w : w.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(c.floating)),
229
+ } = K(e, t), u = gt(f), w = l[p ? h === "floating" ? "reference" : "floating" : h], g = et(await s.getClippingRect({
230
+ element: (n = await (s.isElement == null ? void 0 : s.isElement(w))) == null || n ? w : w.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(l.floating)),
228
231
  boundary: a,
229
- rootBoundary: h,
230
- strategy: l
231
- })), v = u === "floating" ? {
232
+ rootBoundary: d,
233
+ strategy: c
234
+ })), x = h === "floating" ? {
232
235
  ...r.floating,
233
236
  x: o,
234
237
  y: i
235
- } : r.reference, x = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), b = await (s.isElement == null ? void 0 : s.isElement(x)) ? await (s.getScale == null ? void 0 : s.getScale(x)) || {
238
+ } : r.reference, y = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l.floating)), A = await (s.isElement == null ? void 0 : s.isElement(y)) ? await (s.getScale == null ? void 0 : s.getScale(y)) || {
236
239
  x: 1,
237
240
  y: 1
238
241
  } : {
239
242
  x: 1,
240
243
  y: 1
241
- }, y = et(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
242
- elements: c,
243
- rect: v,
244
- offsetParent: x,
245
- strategy: l
246
- }) : v);
244
+ }, v = et(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
245
+ rect: x,
246
+ offsetParent: y,
247
+ strategy: c
248
+ }) : x);
247
249
  return {
248
- top: (g.top - y.top + d.top) / b.y,
249
- bottom: (y.bottom - g.bottom + d.bottom) / b.y,
250
- left: (g.left - y.left + d.left) / b.x,
251
- right: (y.right - g.right + d.right) / b.x
250
+ top: (g.top - v.top + u.top) / A.y,
251
+ bottom: (v.bottom - g.bottom + u.bottom) / A.y,
252
+ left: (g.left - v.left + u.left) / A.x,
253
+ right: (v.right - g.right + u.right) / A.x
252
254
  };
253
255
  }
254
- const jt = (t) => ({
256
+ const Vt = (t) => ({
255
257
  name: "arrow",
256
258
  options: t,
257
259
  async fn(e) {
@@ -261,34 +263,34 @@ const jt = (t) => ({
261
263
  placement: i,
262
264
  rects: s,
263
265
  platform: r,
264
- elements: c,
265
- middlewareData: l
266
+ elements: l,
267
+ middlewareData: c
266
268
  } = e, {
267
269
  element: a,
268
- padding: h = 0
270
+ padding: d = 0
269
271
  } = K(t, e) || {};
270
272
  if (a == null)
271
273
  return {};
272
- const u = gt(h), p = {
274
+ const h = gt(d), p = {
273
275
  x: n,
274
276
  y: o
275
- }, f = lt(i), d = rt(f), m = await r.getDimensions(a), w = f === "y", g = w ? "top" : "left", v = w ? "bottom" : "right", x = w ? "clientHeight" : "clientWidth", b = s.reference[d] + s.reference[f] - p[f] - s.floating[d], y = p[f] - s.reference[f], A = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a));
276
- let E = A ? A[x] : 0;
277
- (!E || !await (r.isElement == null ? void 0 : r.isElement(A))) && (E = c.floating[x] || s.floating[d]);
278
- const P = b / 2 - y / 2, M = E / 2 - m[d] / 2 - 1, Y = N(u[g], M), X = N(u[v], M), L = Y, q = E - m[d] - X, C = E / 2 - m[d] / 2 + P, S = kt(L, C, q), D = !l.arrow && I(i) != null && C !== S && s.reference[d] / 2 - (C < L ? Y : X) - m[d] / 2 < 0, W = D ? C < L ? C - L : C - q : 0;
277
+ }, f = ct(i), u = rt(f), m = await r.getDimensions(a), w = f === "y", g = w ? "top" : "left", x = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", A = s.reference[u] + s.reference[f] - p[f] - s.floating[u], v = p[f] - s.reference[f], b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a));
278
+ let E = b ? b[y] : 0;
279
+ (!E || !await (r.isElement == null ? void 0 : r.isElement(b))) && (E = l.floating[y] || s.floating[u]);
280
+ const P = A / 2 - v / 2, F = E / 2 - m[u] / 2 - 1, Y = N(h[g], F), X = N(h[x], F), L = Y, q = E - m[u] - X, C = E / 2 - m[u] / 2 + P, S = Dt(L, C, q), D = !c.arrow && _(i) != null && C != S && s.reference[u] / 2 - (C < L ? Y : X) - m[u] / 2 < 0, H = D ? C < L ? C - L : C - q : 0;
279
281
  return {
280
- [f]: p[f] + W,
282
+ [f]: p[f] + H,
281
283
  data: {
282
284
  [f]: S,
283
- centerOffset: C - S - W,
285
+ centerOffset: C - S - H,
284
286
  ...D && {
285
- alignmentOffset: W
287
+ alignmentOffset: H
286
288
  }
287
289
  },
288
290
  reset: D
289
291
  };
290
292
  }
291
- }), zt = function(t) {
293
+ }), jt = function(t) {
292
294
  return t === void 0 && (t = {}), {
293
295
  name: "flip",
294
296
  options: t,
@@ -298,34 +300,34 @@ const jt = (t) => ({
298
300
  placement: i,
299
301
  middlewareData: s,
300
302
  rects: r,
301
- initialPlacement: c,
302
- platform: l,
303
+ initialPlacement: l,
304
+ platform: c,
303
305
  elements: a
304
306
  } = e, {
305
- mainAxis: h = !0,
306
- crossAxis: u = !0,
307
+ mainAxis: d = !0,
308
+ crossAxis: h = !0,
307
309
  fallbackPlacements: p,
308
310
  fallbackStrategy: f = "bestFit",
309
- fallbackAxisSideDirection: d = "none",
311
+ fallbackAxisSideDirection: u = "none",
310
312
  flipAlignment: m = !0,
311
313
  ...w
312
314
  } = K(t, e);
313
315
  if ((n = s.arrow) != null && n.alignmentOffset)
314
316
  return {};
315
- const g = j(i), v = j(c) === c, x = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), b = p || (v || !m ? [tt(c)] : Ht(c));
316
- !p && d !== "none" && b.push(...Nt(c, m, d, x));
317
- const y = [c, ...b], A = await wt(e, w), E = [];
317
+ const g = j(i), x = j(l) === l, y = await (c.isRTL == null ? void 0 : c.isRTL(a.floating)), A = p || (x || !m ? [tt(l)] : Wt(l));
318
+ !p && u !== "none" && A.push(...Ft(l, m, u, y));
319
+ const v = [l, ...A], b = await wt(e, w), E = [];
318
320
  let P = ((o = s.flip) == null ? void 0 : o.overflows) || [];
319
- if (h && E.push(A[g]), u) {
320
- const L = Ft(i, r, x);
321
- E.push(A[L[0]], A[L[1]]);
321
+ if (d && E.push(b[g]), h) {
322
+ const L = Ht(i, r, y);
323
+ E.push(b[L[0]], b[L[1]]);
322
324
  }
323
325
  if (P = [...P, {
324
326
  placement: i,
325
327
  overflows: E
326
328
  }], !E.every((L) => L <= 0)) {
327
- var M, Y;
328
- const L = (((M = s.flip) == null ? void 0 : M.index) || 0) + 1, q = y[L];
329
+ var F, Y;
330
+ const L = (((F = s.flip) == null ? void 0 : F.index) || 0) + 1, q = v[L];
329
331
  if (q)
330
332
  return {
331
333
  data: {
@@ -341,12 +343,12 @@ const jt = (t) => ({
341
343
  switch (f) {
342
344
  case "bestFit": {
343
345
  var X;
344
- const S = (X = P.map((D) => [D.placement, D.overflows.filter((W) => W > 0).reduce((W, Ot) => W + Ot, 0)]).sort((D, W) => D[1] - W[1])[0]) == null ? void 0 : X[0];
346
+ const S = (X = P.map((D) => [D.placement, D.overflows.filter((H) => H > 0).reduce((H, Rt) => H + Rt, 0)]).sort((D, H) => D[1] - H[1])[0]) == null ? void 0 : X[0];
345
347
  S && (C = S);
346
348
  break;
347
349
  }
348
350
  case "initialPlacement":
349
- C = c;
351
+ C = l;
350
352
  break;
351
353
  }
352
354
  if (i !== C)
@@ -360,53 +362,47 @@ const jt = (t) => ({
360
362
  }
361
363
  };
362
364
  };
363
- async function $t(t, e) {
365
+ async function zt(t, e) {
364
366
  const {
365
367
  placement: n,
366
368
  platform: o,
367
369
  elements: i
368
- } = t, s = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), r = j(n), c = I(n), l = nt(n) === "y", a = ["left", "top"].includes(r) ? -1 : 1, h = s && l ? -1 : 1, u = K(e, t);
370
+ } = t, s = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), r = j(n), l = _(n), c = nt(n) === "y", a = ["left", "top"].includes(r) ? -1 : 1, d = s && c ? -1 : 1, h = K(e, t);
369
371
  let {
370
372
  mainAxis: p,
371
373
  crossAxis: f,
372
- alignmentAxis: d
373
- } = typeof u == "number" ? {
374
- mainAxis: u,
374
+ alignmentAxis: u
375
+ } = typeof h == "number" ? {
376
+ mainAxis: h,
375
377
  crossAxis: 0,
376
378
  alignmentAxis: null
377
379
  } : {
378
380
  mainAxis: 0,
379
381
  crossAxis: 0,
380
382
  alignmentAxis: null,
381
- ...u
383
+ ...h
382
384
  };
383
- return c && typeof d == "number" && (f = c === "end" ? d * -1 : d), l ? {
384
- x: f * h,
385
+ return l && typeof u == "number" && (f = l === "end" ? u * -1 : u), c ? {
386
+ x: f * d,
385
387
  y: p * a
386
388
  } : {
387
389
  x: p * a,
388
- y: f * h
390
+ y: f * d
389
391
  };
390
392
  }
391
- const _t = function(t) {
393
+ const $t = function(t) {
392
394
  return t === void 0 && (t = 0), {
393
395
  name: "offset",
394
396
  options: t,
395
397
  async fn(e) {
396
- var n, o;
397
398
  const {
398
- x: i,
399
- y: s,
400
- placement: r,
401
- middlewareData: c
402
- } = e, l = await $t(e, t);
403
- return r === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
404
- x: i + l.x,
405
- y: s + l.y,
406
- data: {
407
- ...l,
408
- placement: r
409
- }
399
+ x: n,
400
+ y: o
401
+ } = e, i = await zt(e, t);
402
+ return {
403
+ x: n + i.x,
404
+ y: o + i.y,
405
+ data: i
410
406
  };
411
407
  }
412
408
  };
@@ -423,33 +419,33 @@ const _t = function(t) {
423
419
  } = e, {
424
420
  apply: r = () => {
425
421
  },
426
- ...c
427
- } = K(t, e), l = await wt(e, c), a = j(n), h = I(n), u = nt(n) === "y", {
422
+ ...l
423
+ } = K(t, e), c = await wt(e, l), a = j(n), d = _(n), h = nt(n) === "y", {
428
424
  width: p,
429
425
  height: f
430
426
  } = o.floating;
431
- let d, m;
432
- a === "top" || a === "bottom" ? (d = a, m = h === (await (i.isRTL == null ? void 0 : i.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (m = a, d = h === "end" ? "top" : "bottom");
433
- const w = f - l[d], g = p - l[m], v = !e.middlewareData.shift;
434
- let x = w, b = g;
435
- if (u) {
436
- const A = p - l.left - l.right;
437
- b = h || v ? N(g, A) : A;
427
+ let u, m;
428
+ a === "top" || a === "bottom" ? (u = a, m = d === (await (i.isRTL == null ? void 0 : i.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (m = a, u = d === "end" ? "top" : "bottom");
429
+ const w = f - c[u], g = p - c[m], x = !e.middlewareData.shift;
430
+ let y = w, A = g;
431
+ if (h) {
432
+ const b = p - c.left - c.right;
433
+ A = d || x ? N(g, b) : b;
438
434
  } else {
439
- const A = f - l.top - l.bottom;
440
- x = h || v ? N(w, A) : A;
435
+ const b = f - c.top - c.bottom;
436
+ y = d || x ? N(w, b) : b;
441
437
  }
442
- if (v && !h) {
443
- const A = R(l.left, 0), E = R(l.right, 0), P = R(l.top, 0), M = R(l.bottom, 0);
444
- u ? b = p - 2 * (A !== 0 || E !== 0 ? A + E : R(l.left, l.right)) : x = f - 2 * (P !== 0 || M !== 0 ? P + M : R(l.top, l.bottom));
438
+ if (x && !d) {
439
+ const b = R(c.left, 0), E = R(c.right, 0), P = R(c.top, 0), F = R(c.bottom, 0);
440
+ h ? A = p - 2 * (b !== 0 || E !== 0 ? b + E : R(c.left, c.right)) : y = f - 2 * (P !== 0 || F !== 0 ? P + F : R(c.top, c.bottom));
445
441
  }
446
442
  await r({
447
443
  ...e,
448
- availableWidth: b,
449
- availableHeight: x
444
+ availableWidth: A,
445
+ availableHeight: y
450
446
  });
451
- const y = await i.getDimensions(s.floating);
452
- return p !== y.width || f !== y.height ? {
447
+ const v = await i.getDimensions(s.floating);
448
+ return p !== v.width || f !== v.height ? {
453
449
  reset: {
454
450
  rects: !0
455
451
  }
@@ -464,14 +460,14 @@ function O(t) {
464
460
  var e;
465
461
  return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
466
462
  }
467
- function H(t) {
463
+ function M(t) {
468
464
  var e;
469
465
  return (e = (vt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
470
466
  }
471
467
  function vt(t) {
472
468
  return t instanceof Node || t instanceof O(t).Node;
473
469
  }
474
- function F(t) {
470
+ function W(t) {
475
471
  return t instanceof Element || t instanceof O(t).Element;
476
472
  }
477
473
  function k(t) {
@@ -489,19 +485,19 @@ function G(t) {
489
485
  } = T(t);
490
486
  return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !["inline", "contents"].includes(i);
491
487
  }
492
- function Yt(t) {
488
+ function _t(t) {
493
489
  return ["table", "td", "th"].includes(V(t));
494
490
  }
495
- function ct(t) {
491
+ function lt(t) {
496
492
  const e = at(), n = T(t);
497
493
  return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
498
494
  }
499
- function Xt(t) {
500
- let e = _(t);
495
+ function Yt(t) {
496
+ let e = I(t);
501
497
  for (; k(e) && !ot(e); ) {
502
- if (ct(e))
498
+ if (lt(e))
503
499
  return e;
504
- e = _(e);
500
+ e = I(e);
505
501
  }
506
502
  return null;
507
503
  }
@@ -515,7 +511,7 @@ function T(t) {
515
511
  return O(t).getComputedStyle(t);
516
512
  }
517
513
  function it(t) {
518
- return F(t) ? {
514
+ return W(t) ? {
519
515
  scrollLeft: t.scrollLeft,
520
516
  scrollTop: t.scrollTop
521
517
  } : {
@@ -523,7 +519,7 @@ function it(t) {
523
519
  scrollTop: t.pageYOffset
524
520
  };
525
521
  }
526
- function _(t) {
522
+ function I(t) {
527
523
  if (V(t) === "html")
528
524
  return t;
529
525
  const e = (
@@ -531,12 +527,12 @@ function _(t) {
531
527
  t.assignedSlot || // DOM Element detected.
532
528
  t.parentNode || // ShadowRoot detected.
533
529
  dt(t) && t.host || // Fallback.
534
- H(t)
530
+ M(t)
535
531
  );
536
532
  return dt(e) ? e.host : e;
537
533
  }
538
534
  function xt(t) {
539
- const e = _(t);
535
+ const e = I(t);
540
536
  return ot(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k(e) && G(e) ? e : xt(e);
541
537
  }
542
538
  function J(t, e, n) {
@@ -548,15 +544,15 @@ function J(t, e, n) {
548
544
  function yt(t) {
549
545
  const e = T(t);
550
546
  let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
551
- const i = k(t), s = i ? t.offsetWidth : n, r = i ? t.offsetHeight : o, c = Z(n) !== s || Z(o) !== r;
552
- return c && (n = s, o = r), {
547
+ const i = k(t), s = i ? t.offsetWidth : n, r = i ? t.offsetHeight : o, l = Z(n) !== s || Z(o) !== r;
548
+ return l && (n = s, o = r), {
553
549
  width: n,
554
550
  height: o,
555
- $: c
551
+ $: l
556
552
  };
557
553
  }
558
554
  function ft(t) {
559
- return F(t) ? t : t.contextElement;
555
+ return W(t) ? t : t.contextElement;
560
556
  }
561
557
  function $(t) {
562
558
  const e = ft(t);
@@ -567,130 +563,119 @@ function $(t) {
567
563
  height: i,
568
564
  $: s
569
565
  } = yt(e);
570
- let r = (s ? Z(n.width) : n.width) / o, c = (s ? Z(n.height) : n.height) / i;
571
- return (!r || !Number.isFinite(r)) && (r = 1), (!c || !Number.isFinite(c)) && (c = 1), {
566
+ let r = (s ? Z(n.width) : n.width) / o, l = (s ? Z(n.height) : n.height) / i;
567
+ return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
572
568
  x: r,
573
- y: c
569
+ y: l
574
570
  };
575
571
  }
576
- const qt = /* @__PURE__ */ B(0);
572
+ const Xt = /* @__PURE__ */ B(0);
577
573
  function bt(t) {
578
574
  const e = O(t);
579
- return !at() || !e.visualViewport ? qt : {
575
+ return !at() || !e.visualViewport ? Xt : {
580
576
  x: e.visualViewport.offsetLeft,
581
577
  y: e.visualViewport.offsetTop
582
578
  };
583
579
  }
584
- function Ut(t, e, n) {
580
+ function qt(t, e, n) {
585
581
  return e === void 0 && (e = !1), !n || e && n !== O(t) ? !1 : e;
586
582
  }
587
583
  function z(t, e, n, o) {
588
584
  e === void 0 && (e = !1), n === void 0 && (n = !1);
589
585
  const i = t.getBoundingClientRect(), s = ft(t);
590
586
  let r = B(1);
591
- e && (o ? F(o) && (r = $(o)) : r = $(t));
592
- const c = Ut(s, n, o) ? bt(s) : B(0);
593
- let l = (i.left + c.x) / r.x, a = (i.top + c.y) / r.y, h = i.width / r.x, u = i.height / r.y;
587
+ e && (o ? W(o) && (r = $(o)) : r = $(t));
588
+ const l = qt(s, n, o) ? bt(s) : B(0);
589
+ let c = (i.left + l.x) / r.x, a = (i.top + l.y) / r.y, d = i.width / r.x, h = i.height / r.y;
594
590
  if (s) {
595
- const p = O(s), f = o && F(o) ? O(o) : o;
596
- let d = p, m = d.frameElement;
597
- for (; m && o && f !== d; ) {
598
- const w = $(m), g = m.getBoundingClientRect(), v = T(m), x = g.left + (m.clientLeft + parseFloat(v.paddingLeft)) * w.x, b = g.top + (m.clientTop + parseFloat(v.paddingTop)) * w.y;
599
- l *= w.x, a *= w.y, h *= w.x, u *= w.y, l += x, a += b, d = O(m), m = d.frameElement;
591
+ const p = O(s), f = o && W(o) ? O(o) : o;
592
+ let u = p.frameElement;
593
+ for (; u && o && f !== p; ) {
594
+ const m = $(u), w = u.getBoundingClientRect(), g = T(u), x = w.left + (u.clientLeft + parseFloat(g.paddingLeft)) * m.x, y = w.top + (u.clientTop + parseFloat(g.paddingTop)) * m.y;
595
+ c *= m.x, a *= m.y, d *= m.x, h *= m.y, c += x, a += y, u = O(u).frameElement;
600
596
  }
601
597
  }
602
598
  return et({
603
- width: h,
604
- height: u,
605
- x: l,
599
+ width: d,
600
+ height: h,
601
+ x: c,
606
602
  y: a
607
603
  });
608
604
  }
609
- const Jt = [":popover-open", ":modal"];
610
- function At(t) {
611
- return Jt.some((e) => {
612
- try {
613
- return t.matches(e);
614
- } catch {
615
- return !1;
616
- }
617
- });
618
- }
619
- function Kt(t) {
605
+ function Ut(t) {
620
606
  let {
621
- elements: e,
622
- rect: n,
623
- offsetParent: o,
624
- strategy: i
607
+ rect: e,
608
+ offsetParent: n,
609
+ strategy: o
625
610
  } = t;
626
- const s = i === "fixed", r = H(o), c = e ? At(e.floating) : !1;
627
- if (o === r || c && s)
628
- return n;
629
- let l = {
611
+ const i = k(n), s = M(n);
612
+ if (n === s)
613
+ return e;
614
+ let r = {
630
615
  scrollLeft: 0,
631
616
  scrollTop: 0
632
- }, a = B(1);
633
- const h = B(0), u = k(o);
634
- if ((u || !u && !s) && ((V(o) !== "body" || G(r)) && (l = it(o)), k(o))) {
635
- const p = z(o);
636
- a = $(o), h.x = p.x + o.clientLeft, h.y = p.y + o.clientTop;
617
+ }, l = B(1);
618
+ const c = B(0);
619
+ if ((i || !i && o !== "fixed") && ((V(n) !== "body" || G(s)) && (r = it(n)), k(n))) {
620
+ const a = z(n);
621
+ l = $(n), c.x = a.x + n.clientLeft, c.y = a.y + n.clientTop;
637
622
  }
638
623
  return {
639
- width: n.width * a.x,
640
- height: n.height * a.y,
641
- x: n.x * a.x - l.scrollLeft * a.x + h.x,
642
- y: n.y * a.y - l.scrollTop * a.y + h.y
624
+ width: e.width * l.x,
625
+ height: e.height * l.y,
626
+ x: e.x * l.x - r.scrollLeft * l.x + c.x,
627
+ y: e.y * l.y - r.scrollTop * l.y + c.y
643
628
  };
644
629
  }
645
- function Gt(t) {
630
+ function Jt(t) {
646
631
  return Array.from(t.getClientRects());
647
632
  }
648
- function Et(t) {
649
- return z(H(t)).left + it(t).scrollLeft;
633
+ function At(t) {
634
+ return z(M(t)).left + it(t).scrollLeft;
650
635
  }
651
- function Qt(t) {
652
- const e = H(t), n = it(t), o = t.ownerDocument.body, i = R(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), s = R(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
653
- let r = -n.scrollLeft + Et(t);
654
- const c = -n.scrollTop;
636
+ function Kt(t) {
637
+ const e = M(t), n = it(t), o = t.ownerDocument.body, i = R(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), s = R(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
638
+ let r = -n.scrollLeft + At(t);
639
+ const l = -n.scrollTop;
655
640
  return T(o).direction === "rtl" && (r += R(e.clientWidth, o.clientWidth) - i), {
656
641
  width: i,
657
642
  height: s,
658
643
  x: r,
659
- y: c
644
+ y: l
660
645
  };
661
646
  }
662
- function Zt(t, e) {
663
- const n = O(t), o = H(t), i = n.visualViewport;
664
- let s = o.clientWidth, r = o.clientHeight, c = 0, l = 0;
647
+ function Gt(t, e) {
648
+ const n = O(t), o = M(t), i = n.visualViewport;
649
+ let s = o.clientWidth, r = o.clientHeight, l = 0, c = 0;
665
650
  if (i) {
666
651
  s = i.width, r = i.height;
667
652
  const a = at();
668
- (!a || a && e === "fixed") && (c = i.offsetLeft, l = i.offsetTop);
653
+ (!a || a && e === "fixed") && (l = i.offsetLeft, c = i.offsetTop);
669
654
  }
670
655
  return {
671
656
  width: s,
672
657
  height: r,
673
- x: c,
674
- y: l
658
+ x: l,
659
+ y: c
675
660
  };
676
661
  }
677
- function te(t, e) {
678
- const n = z(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, s = k(t) ? $(t) : B(1), r = t.clientWidth * s.x, c = t.clientHeight * s.y, l = i * s.x, a = o * s.y;
662
+ function Qt(t, e) {
663
+ const n = z(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, s = k(t) ? $(t) : B(1), r = t.clientWidth * s.x, l = t.clientHeight * s.y, c = i * s.x, a = o * s.y;
679
664
  return {
680
665
  width: r,
681
- height: c,
682
- x: l,
666
+ height: l,
667
+ x: c,
683
668
  y: a
684
669
  };
685
670
  }
686
671
  function pt(t, e, n) {
687
672
  let o;
688
673
  if (e === "viewport")
689
- o = Zt(t, n);
674
+ o = Gt(t, n);
690
675
  else if (e === "document")
691
- o = Qt(H(t));
692
- else if (F(e))
693
- o = te(e, n);
676
+ o = Kt(M(t));
677
+ else if (W(e))
678
+ o = Qt(e, n);
694
679
  else {
695
680
  const i = bt(t);
696
681
  o = {
@@ -701,68 +686,60 @@ function pt(t, e, n) {
701
686
  }
702
687
  return et(o);
703
688
  }
704
- function Ct(t, e) {
705
- const n = _(t);
706
- return n === e || !F(n) || ot(n) ? !1 : T(n).position === "fixed" || Ct(n, e);
689
+ function Et(t, e) {
690
+ const n = I(t);
691
+ return n === e || !W(n) || ot(n) ? !1 : T(n).position === "fixed" || Et(n, e);
707
692
  }
708
- function ee(t, e) {
693
+ function Zt(t, e) {
709
694
  const n = e.get(t);
710
695
  if (n)
711
696
  return n;
712
- let o = J(t, [], !1).filter((c) => F(c) && V(c) !== "body"), i = null;
697
+ let o = J(t, [], !1).filter((l) => W(l) && V(l) !== "body"), i = null;
713
698
  const s = T(t).position === "fixed";
714
- let r = s ? _(t) : t;
715
- for (; F(r) && !ot(r); ) {
716
- const c = T(r), l = ct(r);
717
- !l && c.position === "fixed" && (i = null), (s ? !l && !i : !l && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || G(r) && !l && Ct(t, r)) ? o = o.filter((h) => h !== r) : i = c, r = _(r);
699
+ let r = s ? I(t) : t;
700
+ for (; W(r) && !ot(r); ) {
701
+ const l = T(r), c = lt(r);
702
+ !c && l.position === "fixed" && (i = null), (s ? !c && !i : !c && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || G(r) && !c && Et(t, r)) ? o = o.filter((d) => d !== r) : i = l, r = I(r);
718
703
  }
719
704
  return e.set(t, o), o;
720
705
  }
721
- function ne(t) {
706
+ function te(t) {
722
707
  let {
723
708
  element: e,
724
709
  boundary: n,
725
710
  rootBoundary: o,
726
711
  strategy: i
727
712
  } = t;
728
- const r = [...n === "clippingAncestors" ? ee(e, this._c) : [].concat(n), o], c = r[0], l = r.reduce((a, h) => {
729
- const u = pt(e, h, i);
730
- return a.top = R(u.top, a.top), a.right = N(u.right, a.right), a.bottom = N(u.bottom, a.bottom), a.left = R(u.left, a.left), a;
731
- }, pt(e, c, i));
713
+ const r = [...n === "clippingAncestors" ? Zt(e, this._c) : [].concat(n), o], l = r[0], c = r.reduce((a, d) => {
714
+ const h = pt(e, d, i);
715
+ return a.top = R(h.top, a.top), a.right = N(h.right, a.right), a.bottom = N(h.bottom, a.bottom), a.left = R(h.left, a.left), a;
716
+ }, pt(e, l, i));
732
717
  return {
733
- width: l.right - l.left,
734
- height: l.bottom - l.top,
735
- x: l.left,
736
- y: l.top
718
+ width: c.right - c.left,
719
+ height: c.bottom - c.top,
720
+ x: c.left,
721
+ y: c.top
737
722
  };
738
723
  }
739
- function oe(t) {
740
- const {
741
- width: e,
742
- height: n
743
- } = yt(t);
744
- return {
745
- width: e,
746
- height: n
747
- };
724
+ function ee(t) {
725
+ return yt(t);
748
726
  }
749
- function ie(t, e, n) {
750
- const o = k(e), i = H(e), s = n === "fixed", r = z(t, !0, s, e);
751
- let c = {
727
+ function ne(t, e, n) {
728
+ const o = k(e), i = M(e), s = n === "fixed", r = z(t, !0, s, e);
729
+ let l = {
752
730
  scrollLeft: 0,
753
731
  scrollTop: 0
754
732
  };
755
- const l = B(0);
733
+ const c = B(0);
756
734
  if (o || !o && !s)
757
- if ((V(e) !== "body" || G(i)) && (c = it(e)), o) {
758
- const u = z(e, !0, s, e);
759
- l.x = u.x + e.clientLeft, l.y = u.y + e.clientTop;
735
+ if ((V(e) !== "body" || G(i)) && (l = it(e)), o) {
736
+ const a = z(e, !0, s, e);
737
+ c.x = a.x + e.clientLeft, c.y = a.y + e.clientTop;
760
738
  } else
761
- i && (l.x = Et(i));
762
- const a = r.left + c.scrollLeft - l.x, h = r.top + c.scrollTop - l.y;
739
+ i && (c.x = At(i));
763
740
  return {
764
- x: a,
765
- y: h,
741
+ x: r.left + l.scrollLeft - c.x,
742
+ y: r.top + l.scrollTop - c.y,
766
743
  width: r.width,
767
744
  height: r.height
768
745
  };
@@ -770,137 +747,139 @@ function ie(t, e, n) {
770
747
  function mt(t, e) {
771
748
  return !k(t) || T(t).position === "fixed" ? null : e ? e(t) : t.offsetParent;
772
749
  }
773
- function Rt(t, e) {
750
+ function Ct(t, e) {
774
751
  const n = O(t);
775
- if (!k(t) || At(t))
752
+ if (!k(t))
776
753
  return n;
777
754
  let o = mt(t, e);
778
- for (; o && Yt(o) && T(o).position === "static"; )
755
+ for (; o && _t(o) && T(o).position === "static"; )
779
756
  o = mt(o, e);
780
- return o && (V(o) === "html" || V(o) === "body" && T(o).position === "static" && !ct(o)) ? n : o || Xt(t) || n;
757
+ return o && (V(o) === "html" || V(o) === "body" && T(o).position === "static" && !lt(o)) ? n : o || Yt(t) || n;
781
758
  }
782
- const se = async function(t) {
783
- const e = this.getOffsetParent || Rt, n = this.getDimensions;
759
+ const oe = async function(t) {
760
+ let {
761
+ reference: e,
762
+ floating: n,
763
+ strategy: o
764
+ } = t;
765
+ const i = this.getOffsetParent || Ct, s = this.getDimensions;
784
766
  return {
785
- reference: ie(t.reference, await e(t.floating), t.strategy),
767
+ reference: ne(e, await i(n), o),
786
768
  floating: {
787
769
  x: 0,
788
770
  y: 0,
789
- ...await n(t.floating)
771
+ ...await s(n)
790
772
  }
791
773
  };
792
774
  };
793
- function re(t) {
775
+ function ie(t) {
794
776
  return T(t).direction === "rtl";
795
777
  }
796
- const le = {
797
- convertOffsetParentRelativeRectToViewportRelativeRect: Kt,
798
- getDocumentElement: H,
799
- getClippingRect: ne,
800
- getOffsetParent: Rt,
801
- getElementRects: se,
802
- getClientRects: Gt,
803
- getDimensions: oe,
778
+ const se = {
779
+ convertOffsetParentRelativeRectToViewportRelativeRect: Ut,
780
+ getDocumentElement: M,
781
+ getClippingRect: te,
782
+ getOffsetParent: Ct,
783
+ getElementRects: oe,
784
+ getClientRects: Jt,
785
+ getDimensions: ee,
804
786
  getScale: $,
805
- isElement: F,
806
- isRTL: re
787
+ isElement: W,
788
+ isRTL: ie
807
789
  };
808
- function ce(t, e) {
790
+ function re(t, e) {
809
791
  let n = null, o;
810
- const i = H(t);
792
+ const i = M(t);
811
793
  function s() {
812
- var c;
813
- clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
794
+ clearTimeout(o), n && n.disconnect(), n = null;
814
795
  }
815
- function r(c, l) {
816
- c === void 0 && (c = !1), l === void 0 && (l = 1), s();
796
+ function r(l, c) {
797
+ l === void 0 && (l = !1), c === void 0 && (c = 1), s();
817
798
  const {
818
799
  left: a,
819
- top: h,
820
- width: u,
800
+ top: d,
801
+ width: h,
821
802
  height: p
822
803
  } = t.getBoundingClientRect();
823
- if (c || e(), !u || !p)
804
+ if (l || e(), !h || !p)
824
805
  return;
825
- const f = Q(h), d = Q(i.clientWidth - (a + u)), m = Q(i.clientHeight - (h + p)), w = Q(a), v = {
826
- rootMargin: -f + "px " + -d + "px " + -m + "px " + -w + "px",
827
- threshold: R(0, N(1, l)) || 1
806
+ const f = Q(d), u = Q(i.clientWidth - (a + h)), m = Q(i.clientHeight - (d + p)), w = Q(a), x = {
807
+ rootMargin: -f + "px " + -u + "px " + -m + "px " + -w + "px",
808
+ threshold: R(0, N(1, c)) || 1
828
809
  };
829
- let x = !0;
830
- function b(y) {
831
- const A = y[0].intersectionRatio;
832
- if (A !== l) {
833
- if (!x)
810
+ let y = !0;
811
+ function A(v) {
812
+ const b = v[0].intersectionRatio;
813
+ if (b !== c) {
814
+ if (!y)
834
815
  return r();
835
- A ? r(!1, A) : o = setTimeout(() => {
816
+ b ? r(!1, b) : o = setTimeout(() => {
836
817
  r(!1, 1e-7);
837
818
  }, 100);
838
819
  }
839
- x = !1;
820
+ y = !1;
840
821
  }
841
822
  try {
842
- n = new IntersectionObserver(b, {
843
- ...v,
823
+ n = new IntersectionObserver(A, {
824
+ ...x,
844
825
  // Handle <iframe>s
845
826
  root: i.ownerDocument
846
827
  });
847
828
  } catch {
848
- n = new IntersectionObserver(b, v);
829
+ n = new IntersectionObserver(A, x);
849
830
  }
850
831
  n.observe(t);
851
832
  }
852
833
  return r(!0), s;
853
834
  }
854
- function ae(t, e, n, o) {
835
+ function ce(t, e, n, o) {
855
836
  o === void 0 && (o = {});
856
837
  const {
857
838
  ancestorScroll: i = !0,
858
839
  ancestorResize: s = !0,
859
840
  elementResize: r = typeof ResizeObserver == "function",
860
- layoutShift: c = typeof IntersectionObserver == "function",
861
- animationFrame: l = !1
862
- } = o, a = ft(t), h = i || s ? [...a ? J(a) : [], ...J(e)] : [];
863
- h.forEach((g) => {
841
+ layoutShift: l = typeof IntersectionObserver == "function",
842
+ animationFrame: c = !1
843
+ } = o, a = ft(t), d = i || s ? [...a ? J(a) : [], ...J(e)] : [];
844
+ d.forEach((g) => {
864
845
  i && g.addEventListener("scroll", n, {
865
846
  passive: !0
866
847
  }), s && g.addEventListener("resize", n);
867
848
  });
868
- const u = a && c ? ce(a, n) : null;
849
+ const h = a && l ? re(a, n) : null;
869
850
  let p = -1, f = null;
870
851
  r && (f = new ResizeObserver((g) => {
871
- let [v] = g;
872
- v && v.target === a && f && (f.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
873
- var x;
874
- (x = f) == null || x.observe(e);
852
+ let [x] = g;
853
+ x && x.target === a && f && (f.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
854
+ f && f.observe(e);
875
855
  })), n();
876
- }), a && !l && f.observe(a), f.observe(e));
877
- let d, m = l ? z(t) : null;
878
- l && w();
856
+ }), a && !c && f.observe(a), f.observe(e));
857
+ let u, m = c ? z(t) : null;
858
+ c && w();
879
859
  function w() {
880
860
  const g = z(t);
881
- m && (g.x !== m.x || g.y !== m.y || g.width !== m.width || g.height !== m.height) && n(), m = g, d = requestAnimationFrame(w);
861
+ m && (g.x !== m.x || g.y !== m.y || g.width !== m.width || g.height !== m.height) && n(), m = g, u = requestAnimationFrame(w);
882
862
  }
883
863
  return n(), () => {
884
- var g;
885
- h.forEach((v) => {
886
- i && v.removeEventListener("scroll", n), s && v.removeEventListener("resize", n);
887
- }), u == null || u(), (g = f) == null || g.disconnect(), f = null, l && cancelAnimationFrame(d);
864
+ d.forEach((g) => {
865
+ i && g.removeEventListener("scroll", n), s && g.removeEventListener("resize", n);
866
+ }), h && h(), f && f.disconnect(), f = null, c && cancelAnimationFrame(u);
888
867
  };
889
868
  }
890
- const fe = zt, ue = It, he = jt, de = (t, e, n) => {
869
+ const le = (t, e, n) => {
891
870
  const o = /* @__PURE__ */ new Map(), i = {
892
- platform: le,
871
+ platform: se,
893
872
  ...n
894
873
  }, s = {
895
874
  ...i.platform,
896
875
  _c: o
897
876
  };
898
- return Vt(t, e, {
877
+ return Bt(t, e, {
899
878
  ...i,
900
879
  platform: s
901
880
  });
902
- }, pe = ":host{--wje-popup-top: auto;--wje-popup-left: auto;display:flex}.native-popup{position:absolute;isolation:isolate;z-index:999;left:var(--wje-popup-left);top:var(--wje-popup-top)}.native-popup:not(.popup-active){display:none}";
903
- class we extends Pt {
881
+ }, ae = ":host{--wje-popup-top: auto;--wje-popup-left: auto;display:flex}.native-popup{position:absolute;isolation:isolate;z-index:999;left:var(--wje-popup-left);top:var(--wje-popup-top)}.native-popup:not(.popup-active){display:none}";
882
+ class he extends Tt {
904
883
  /**
905
884
  * Creates an instance of Popup.
906
885
  *
@@ -934,7 +913,7 @@ class we extends Pt {
934
913
  * @returns {CSSStyleSheet}
935
914
  */
936
915
  static get cssStyleSheet() {
937
- return pe;
916
+ return ae;
938
917
  }
939
918
  /**
940
919
  * Returns the list of attributes to observe for changes.
@@ -972,12 +951,12 @@ class we extends Pt {
972
951
  draw(n, o, i) {
973
952
  let s = document.createDocumentFragment(), r = document.createElement("slot");
974
953
  r.setAttribute("name", "anchor");
975
- let c = document.createElement("slot");
976
- c.setAttribute("name", "arrow");
977
- let l = document.createElement("div");
978
- l.setAttribute("part", "native"), l.classList.add("native-popup");
954
+ let l = document.createElement("slot");
955
+ l.setAttribute("name", "arrow");
956
+ let c = document.createElement("div");
957
+ c.setAttribute("part", "native"), c.classList.add("native-popup");
979
958
  let a = document.createElement("slot");
980
- return l.appendChild(a), l.appendChild(c), s.appendChild(r), s.appendChild(l), this.slotAnchor = r, this.slotArrow = c, this.native = l, s;
959
+ return c.appendChild(a), c.appendChild(l), s.appendChild(r), s.appendChild(c), this.slotAnchor = r, this.slotArrow = l, this.native = c, s;
981
960
  }
982
961
  afterDraw(n, o, i) {
983
962
  this.setAnchor();
@@ -992,7 +971,7 @@ class we extends Pt {
992
971
  this.anchorEl = n.getElementById(this.anchor);
993
972
  } else
994
973
  this.slotAnchor instanceof HTMLSlotElement && (this.anchorEl = this.slotAnchor.assignedElements({ flatten: !0 })[0]);
995
- U.addListener(this.anchorEl, "click", null, (n) => {
974
+ this.manual || U.addListener(this.anchorEl, "click", null, (n) => {
996
975
  this.hasAttribute("disabled") || this.showHide();
997
976
  }, { stopPropagation: !0 }), document.addEventListener("click", (n) => {
998
977
  n.composedPath().some((i) => i === this) || this.hasAttribute("active") && this.removeAttribute("active");
@@ -1011,39 +990,39 @@ class we extends Pt {
1011
990
  reposition() {
1012
991
  const n = [];
1013
992
  this.offsetCalc = +this.offset || 0, this.slotArrow instanceof HTMLSlotElement && (this.arrow = this.slotArrow.assignedElements({ flatten: !0 })[0], this.arrow && (n.push(
1014
- he({
993
+ Vt({
1015
994
  element: this.arrow
1016
995
  })
1017
996
  ), this.offsetCalc = Math.sqrt(2 * this.arrow.offsetWidth ** 2) / 2 + +this.offset)), n.push(
1018
- _t(this.offsetCalc)
997
+ $t(this.offsetCalc)
1019
998
  ), n.push(
1020
- fe()
999
+ jt()
1021
1000
  ), this.hasAttribute("size") && n.push(
1022
- ue({
1001
+ It({
1023
1002
  apply({ availableWidth: o, availableHeight: i, elements: s }) {
1024
1003
  Object.assign(s.floating.style, {
1025
1004
  width: `${s.reference.offsetWidth}px`
1026
1005
  });
1027
1006
  }
1028
1007
  })
1029
- ), de(this.anchorEl, this.native, {
1008
+ ), le(this.anchorEl, this.native, {
1030
1009
  placement: this.placement || "bottom",
1031
1010
  strategy: "fixed",
1032
1011
  middleware: n
1033
- }).then(({ x: o, y: i, middlewareData: s, placement: r, strategy: c }) => {
1034
- if (this.native.style.setProperty("--wje-popup-left", o + "px"), this.native.style.setProperty("--wje-popup-top", i + "px"), this.native.style.position = c, this.arrow) {
1035
- const l = this.placement.split("-")[0], a = {
1012
+ }).then(({ x: o, y: i, middlewareData: s, placement: r, strategy: l }) => {
1013
+ if (this.native.style.setProperty("--wje-popup-left", o + "px"), this.native.style.setProperty("--wje-popup-top", i + "px"), this.native.style.position = l, this.arrow) {
1014
+ const c = {
1036
1015
  top: "bottom",
1037
1016
  right: "left",
1038
1017
  bottom: "top",
1039
1018
  left: "right"
1040
- }[l];
1019
+ }[r];
1041
1020
  if (s.arrow) {
1042
- const { x: h, y: u } = s.arrow;
1021
+ const { width: a, height: d } = this.native.getBoundingClientRect(), { x: h, y: p } = s.arrow;
1043
1022
  Object.assign(this.arrow.style, {
1044
- left: h != null ? `${h}px` : "",
1045
- top: u != null ? `${u}px` : "",
1046
- [a]: `${-this.arrow.offsetWidth / 2}px`
1023
+ left: h != null ? `${a / 2 - this.arrow.offsetWidth / 2}px` : "",
1024
+ top: p != null ? `${d / 2 - this.arrow.offsetHeight / 2}px` : "",
1025
+ [c]: `${-this.arrow.offsetHeight / 2}px`
1047
1026
  });
1048
1027
  }
1049
1028
  }
@@ -1059,9 +1038,9 @@ class we extends Pt {
1059
1038
  * Sets up auto update for repositioning.
1060
1039
  */
1061
1040
  show() {
1062
- U.dispatchCustomEvent(this, "wje-popup:show"), this.native.classList.add("popup-active"), this.cleanup = ae(this.anchorEl, this.native, () => {
1041
+ U.dispatchCustomEvent(this, "wje-popup:show"), this.native.classList.add("popup-active"), this.cleanup = ce(this.anchorEl, this.native, () => {
1063
1042
  this.reposition();
1064
- });
1043
+ }), this.hasAttribute("active") || this.setAttribute("active", "");
1065
1044
  }
1066
1045
  /**
1067
1046
  * Hides the popup.
@@ -1069,7 +1048,7 @@ class we extends Pt {
1069
1048
  * Cleans up the auto update for repositioning.
1070
1049
  */
1071
1050
  hide() {
1072
- U.dispatchCustomEvent(this, "wje-popup:hide"), this.native.classList.remove("popup-active"), this.cleanup, this.cleanup = void 0;
1051
+ U.dispatchCustomEvent(this, "wje-popup:hide"), this.native.classList.remove("popup-active"), this.removeAttribute("active"), this.cleanup, this.cleanup = void 0;
1073
1052
  }
1074
1053
  /**
1075
1054
  * Removes the active attribute when the popup is hidden.
@@ -1085,5 +1064,5 @@ class we extends Pt {
1085
1064
  }
1086
1065
  }
1087
1066
  export {
1088
- we as P
1067
+ he as P
1089
1068
  };