@versini/ui-tooltip 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,56 +1,56 @@
1
- import { jsxs as vt, jsx as _t } from "react/jsx-runtime";
2
- import { useRef as J, useEffect as gt, useState as ut, useCallback as dt } from "react";
1
+ import { jsxs as bt, jsx as It } from "react/jsx-runtime";
2
+ import { useRef as G, useEffect as pt, useState as ft, useCallback as ut } from "react";
3
3
  import Y from "clsx";
4
- const jt = "av-tooltip", Yt = "av-tooltip-arrow", Q = Math.min, K = Math.max, it = Math.round, D = (t) => ({
4
+ const _t = "av-tooltip", jt = "av-tooltip-arrow", J = Math.min, X = Math.max, ot = Math.round, D = (t) => ({
5
5
  x: t,
6
6
  y: t
7
- }), zt = {
7
+ }), Yt = {
8
8
  left: "right",
9
9
  right: "left",
10
10
  bottom: "top",
11
11
  top: "bottom"
12
- }, Xt = {
12
+ }, zt = {
13
13
  start: "end",
14
14
  end: "start"
15
15
  };
16
- function mt(t, e, o) {
17
- return K(t, Q(e, o));
16
+ function dt(t, e, o) {
17
+ return X(t, J(e, o));
18
18
  }
19
- function tt(t, e) {
19
+ function Z(t, e) {
20
20
  return typeof t == "function" ? t(e) : t;
21
21
  }
22
- function X(t) {
22
+ function z(t) {
23
23
  return t.split("-")[0];
24
24
  }
25
- function et(t) {
25
+ function tt(t) {
26
26
  return t.split("-")[1];
27
27
  }
28
- function kt(t) {
28
+ function Et(t) {
29
29
  return t === "x" ? "y" : "x";
30
30
  }
31
- function ht(t) {
31
+ function gt(t) {
32
32
  return t === "y" ? "height" : "width";
33
33
  }
34
- function z(t) {
35
- return ["top", "bottom"].includes(X(t)) ? "y" : "x";
34
+ function $(t) {
35
+ return ["top", "bottom"].includes(z(t)) ? "y" : "x";
36
36
  }
37
- function wt(t) {
38
- return kt(z(t));
37
+ function ht(t) {
38
+ return Et($(t));
39
39
  }
40
- function Kt(t, e, o) {
40
+ function Xt(t, e, o) {
41
41
  o === void 0 && (o = !1);
42
- const n = et(t), i = wt(t), s = ht(i);
42
+ const n = tt(t), i = ht(t), s = gt(i);
43
43
  let r = i === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
44
- return e.reference[s] > e.floating[s] && (r = st(r)), [r, st(r)];
44
+ return e.reference[s] > e.floating[s] && (r = it(r)), [r, it(r)];
45
45
  }
46
- function Ut(t) {
47
- const e = st(t);
48
- return [pt(t), e, pt(e)];
46
+ function Kt(t) {
47
+ const e = it(t);
48
+ return [mt(t), e, mt(e)];
49
49
  }
50
- function pt(t) {
51
- return t.replace(/start|end/g, (e) => Xt[e]);
50
+ function mt(t) {
51
+ return t.replace(/start|end/g, (e) => zt[e]);
52
52
  }
53
- function qt(t, e, o) {
53
+ function Ut(t, e, o) {
54
54
  const n = ["left", "right"], i = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
55
55
  switch (t) {
56
56
  case "top":
@@ -63,15 +63,15 @@ function qt(t, e, o) {
63
63
  return [];
64
64
  }
65
65
  }
66
- function Gt(t, e, o, n) {
67
- const i = et(t);
68
- let s = qt(X(t), o === "start", n);
69
- return i && (s = s.map((r) => r + "-" + i), e && (s = s.concat(s.map(pt)))), s;
66
+ function qt(t, e, o, n) {
67
+ const i = tt(t);
68
+ let s = Ut(z(t), o === "start", n);
69
+ return i && (s = s.map((r) => r + "-" + i), e && (s = s.concat(s.map(mt)))), s;
70
70
  }
71
- function st(t) {
72
- return t.replace(/left|right|bottom|top/g, (e) => zt[e]);
71
+ function it(t) {
72
+ return t.replace(/left|right|bottom|top/g, (e) => Yt[e]);
73
73
  }
74
- function Jt(t) {
74
+ function Gt(t) {
75
75
  return {
76
76
  top: 0,
77
77
  right: 0,
@@ -80,15 +80,15 @@ function Jt(t) {
80
80
  ...t
81
81
  };
82
82
  }
83
- function St(t) {
84
- return typeof t != "number" ? Jt(t) : {
83
+ function kt(t) {
84
+ return typeof t != "number" ? Gt(t) : {
85
85
  top: t,
86
86
  right: t,
87
87
  bottom: t,
88
88
  left: t
89
89
  };
90
90
  }
91
- function rt(t) {
91
+ function st(t) {
92
92
  const {
93
93
  x: e,
94
94
  y: o,
@@ -106,12 +106,12 @@ function rt(t) {
106
106
  y: o
107
107
  };
108
108
  }
109
- function At(t, e, o) {
109
+ function vt(t, e, o) {
110
110
  let {
111
111
  reference: n,
112
112
  floating: i
113
113
  } = t;
114
- const s = z(e), r = wt(e), c = ht(r), l = X(e), a = s === "y", d = n.x + n.width / 2 - i.width / 2, f = n.y + n.height / 2 - i.height / 2, p = n[c] / 2 - i[c] / 2;
114
+ const s = $(e), r = ht(e), c = gt(r), l = z(e), a = s === "y", d = n.x + n.width / 2 - i.width / 2, f = n.y + n.height / 2 - i.height / 2, p = n[c] / 2 - i[c] / 2;
115
115
  let u;
116
116
  switch (l) {
117
117
  case "top":
@@ -144,7 +144,7 @@ function At(t, e, o) {
144
144
  y: n.y
145
145
  };
146
146
  }
147
- switch (et(e)) {
147
+ switch (tt(e)) {
148
148
  case "start":
149
149
  u[r] -= p * (o && a ? -1 : 1);
150
150
  break;
@@ -154,7 +154,7 @@ function At(t, e, o) {
154
154
  }
155
155
  return u;
156
156
  }
157
- const Qt = async (t, e, o) => {
157
+ const Jt = async (t, e, o) => {
158
158
  const {
159
159
  placement: n = "bottom",
160
160
  strategy: i = "absolute",
@@ -168,17 +168,17 @@ const Qt = async (t, e, o) => {
168
168
  }), {
169
169
  x: d,
170
170
  y: f
171
- } = At(a, n, l), p = n, u = {}, m = 0;
171
+ } = vt(a, n, l), p = n, u = {}, m = 0;
172
172
  for (let g = 0; g < c.length; g++) {
173
173
  const {
174
174
  name: h,
175
- fn: w
175
+ fn: x
176
176
  } = c[g], {
177
- x,
177
+ x: w,
178
178
  y,
179
- data: v,
179
+ data: A,
180
180
  reset: b
181
- } = await w({
181
+ } = await x({
182
182
  x: d,
183
183
  y: f,
184
184
  initialPlacement: n,
@@ -192,11 +192,11 @@ const Qt = async (t, e, o) => {
192
192
  floating: e
193
193
  }
194
194
  });
195
- d = x ?? d, f = y ?? f, u = {
195
+ d = w ?? d, f = y ?? f, u = {
196
196
  ...u,
197
197
  [h]: {
198
198
  ...u[h],
199
- ...v
199
+ ...A
200
200
  }
201
201
  }, b && m <= 50 && (m++, typeof b == "object" && (b.placement && (p = b.placement), b.rects && (a = b.rects === !0 ? await r.getElementRects({
202
202
  reference: t,
@@ -205,7 +205,7 @@ const Qt = async (t, e, o) => {
205
205
  }) : b.rects), {
206
206
  x: d,
207
207
  y: f
208
- } = At(a, p, l)), g = -1);
208
+ } = vt(a, p, l)), g = -1);
209
209
  }
210
210
  return {
211
211
  x: d,
@@ -215,7 +215,7 @@ const Qt = async (t, e, o) => {
215
215
  middlewareData: u
216
216
  };
217
217
  };
218
- async function Pt(t, e) {
218
+ async function St(t, e) {
219
219
  var o;
220
220
  e === void 0 && (e = {});
221
221
  const {
@@ -231,36 +231,36 @@ async function Pt(t, e) {
231
231
  elementContext: f = "floating",
232
232
  altBoundary: p = !1,
233
233
  padding: u = 0
234
- } = tt(e, t), m = St(u), h = c[p ? f === "floating" ? "reference" : "floating" : f], w = rt(await s.getClippingRect({
234
+ } = Z(e, t), m = kt(u), h = c[p ? f === "floating" ? "reference" : "floating" : f], x = st(await s.getClippingRect({
235
235
  element: (o = await (s.isElement == null ? void 0 : s.isElement(h))) == null || o ? h : h.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(c.floating)),
236
236
  boundary: a,
237
237
  rootBoundary: d,
238
238
  strategy: l
239
- })), x = f === "floating" ? {
239
+ })), w = f === "floating" ? {
240
240
  x: n,
241
241
  y: i,
242
242
  width: r.floating.width,
243
243
  height: r.floating.height
244
- } : r.reference, y = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), v = await (s.isElement == null ? void 0 : s.isElement(y)) ? await (s.getScale == null ? void 0 : s.getScale(y)) || {
244
+ } : r.reference, y = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), A = await (s.isElement == null ? void 0 : s.isElement(y)) ? await (s.getScale == null ? void 0 : s.getScale(y)) || {
245
245
  x: 1,
246
246
  y: 1
247
247
  } : {
248
248
  x: 1,
249
249
  y: 1
250
- }, b = rt(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
250
+ }, b = st(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
251
251
  elements: c,
252
- rect: x,
252
+ rect: w,
253
253
  offsetParent: y,
254
254
  strategy: l
255
- }) : x);
255
+ }) : w);
256
256
  return {
257
- top: (w.top - b.top + m.top) / v.y,
258
- bottom: (b.bottom - w.bottom + m.bottom) / v.y,
259
- left: (w.left - b.left + m.left) / v.x,
260
- right: (b.right - w.right + m.right) / v.x
257
+ top: (x.top - b.top + m.top) / A.y,
258
+ bottom: (b.bottom - x.bottom + m.bottom) / A.y,
259
+ left: (x.left - b.left + m.left) / A.x,
260
+ right: (b.right - x.right + m.right) / A.x
261
261
  };
262
262
  }
263
- const Zt = (t) => ({
263
+ const Qt = (t) => ({
264
264
  name: "arrow",
265
265
  options: t,
266
266
  async fn(e) {
@@ -275,29 +275,29 @@ const Zt = (t) => ({
275
275
  } = e, {
276
276
  element: a,
277
277
  padding: d = 0
278
- } = tt(t, e) || {};
278
+ } = Z(t, e) || {};
279
279
  if (a == null)
280
280
  return {};
281
- const f = St(d), p = {
281
+ const f = kt(d), p = {
282
282
  x: o,
283
283
  y: n
284
- }, u = wt(i), m = ht(u), g = await r.getDimensions(a), h = u === "y", w = h ? "top" : "left", x = h ? "bottom" : "right", y = h ? "clientHeight" : "clientWidth", v = s.reference[m] + s.reference[u] - p[u] - s.floating[m], b = p[u] - s.reference[u], M = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a));
285
- let E = M ? M[y] : 0;
286
- (!E || !await (r.isElement == null ? void 0 : r.isElement(M))) && (E = c.floating[y] || s.floating[m]);
287
- const V = v / 2 - b / 2, k = E / 2 - g[m] / 2 - 1, T = Q(f[w], k), I = Q(f[x], k), S = T, _ = E - g[m] - I, C = E / 2 - g[m] / 2 + V, O = mt(S, C, _), j = !l.arrow && et(i) != null && C !== O && s.reference[m] / 2 - (C < S ? T : I) - g[m] / 2 < 0, B = j ? C < S ? C - S : C - _ : 0;
284
+ }, u = ht(i), m = gt(u), g = await r.getDimensions(a), h = u === "y", x = h ? "top" : "left", w = h ? "bottom" : "right", y = h ? "clientHeight" : "clientWidth", A = s.reference[m] + s.reference[u] - p[u] - s.floating[m], b = p[u] - s.reference[u], M = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a));
285
+ let k = M ? M[y] : 0;
286
+ (!k || !await (r.isElement == null ? void 0 : r.isElement(M))) && (k = c.floating[y] || s.floating[m]);
287
+ const V = A / 2 - b / 2, S = k / 2 - g[m] / 2 - 1, T = J(f[x], S), I = J(f[w], S), P = T, _ = k - g[m] - I, v = k / 2 - g[m] / 2 + V, j = dt(P, v, _), B = !l.arrow && tt(i) != null && v !== j && s.reference[m] / 2 - (v < P ? T : I) - g[m] / 2 < 0, O = B ? v < P ? v - P : v - _ : 0;
288
288
  return {
289
- [u]: p[u] + B,
289
+ [u]: p[u] + O,
290
290
  data: {
291
- [u]: O,
292
- centerOffset: C - O - B,
293
- ...j && {
294
- alignmentOffset: B
291
+ [u]: j,
292
+ centerOffset: v - j - O,
293
+ ...B && {
294
+ alignmentOffset: O
295
295
  }
296
296
  },
297
- reset: j
297
+ reset: B
298
298
  };
299
299
  }
300
- }), te = function(t) {
300
+ }), Zt = function(t) {
301
301
  return t === void 0 && (t = {}), {
302
302
  name: "flip",
303
303
  options: t,
@@ -318,52 +318,50 @@ const Zt = (t) => ({
318
318
  fallbackAxisSideDirection: m = "none",
319
319
  flipAlignment: g = !0,
320
320
  ...h
321
- } = tt(t, e);
321
+ } = Z(t, e);
322
322
  if ((o = s.arrow) != null && o.alignmentOffset)
323
323
  return {};
324
- const w = X(i), x = z(c), y = X(c) === c, v = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), b = p || (y || !g ? [st(c)] : Ut(c)), M = m !== "none";
325
- !p && M && b.push(...Gt(c, g, m, v));
326
- const E = [c, ...b], V = await Pt(e, h), k = [];
324
+ const x = z(i), w = $(c), y = z(c) === c, A = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), b = p || (y || !g ? [it(c)] : Kt(c)), M = m !== "none";
325
+ !p && M && b.push(...qt(c, g, m, A));
326
+ const k = [c, ...b], V = await St(e, h), S = [];
327
327
  let T = ((n = s.flip) == null ? void 0 : n.overflows) || [];
328
- if (d && k.push(V[w]), f) {
329
- const O = Kt(i, r, v);
330
- k.push(V[O[0]], V[O[1]]);
328
+ if (d && S.push(V[x]), f) {
329
+ const v = Xt(i, r, A);
330
+ S.push(V[v[0]], V[v[1]]);
331
331
  }
332
332
  if (T = [...T, {
333
333
  placement: i,
334
- overflows: k
335
- }], !k.every((O) => O <= 0)) {
336
- var I, S;
337
- const O = (((I = s.flip) == null ? void 0 : I.index) || 0) + 1, j = E[O];
338
- if (j) {
339
- var _;
340
- const W = f === "alignment" ? x !== z(j) : !1, P = ((_ = T[0]) == null ? void 0 : _.overflows[0]) > 0;
341
- if (!W || P)
342
- return {
343
- data: {
344
- index: O,
345
- overflows: T
346
- },
347
- reset: {
348
- placement: j
349
- }
350
- };
351
- }
352
- let B = (S = T.filter((W) => W.overflows[0] <= 0).sort((W, P) => W.overflows[1] - P.overflows[1])[0]) == null ? void 0 : S.placement;
334
+ overflows: S
335
+ }], !S.every((v) => v <= 0)) {
336
+ var I, P;
337
+ const v = (((I = s.flip) == null ? void 0 : I.index) || 0) + 1, j = k[v];
338
+ if (j && (!(f === "alignment" ? w !== $(j) : !1) || // We leave the current main axis only if every placement on that axis
339
+ // overflows the main axis.
340
+ T.every((R) => R.overflows[0] > 0 && $(R.placement) === w)))
341
+ return {
342
+ data: {
343
+ index: v,
344
+ overflows: T
345
+ },
346
+ reset: {
347
+ placement: j
348
+ }
349
+ };
350
+ let B = (P = T.filter((O) => O.overflows[0] <= 0).sort((O, R) => O.overflows[1] - R.overflows[1])[0]) == null ? void 0 : P.placement;
353
351
  if (!B)
354
352
  switch (u) {
355
353
  case "bestFit": {
356
- var C;
357
- const W = (C = T.filter((P) => {
354
+ var _;
355
+ const O = (_ = T.filter((R) => {
358
356
  if (M) {
359
- const $ = z(P.placement);
360
- return $ === x || // Create a bias to the `y` side axis due to horizontal
357
+ const W = $(R.placement);
358
+ return W === w || // Create a bias to the `y` side axis due to horizontal
361
359
  // reading directions favoring greater width.
362
- $ === "y";
360
+ W === "y";
363
361
  }
364
362
  return !0;
365
- }).map((P) => [P.placement, P.overflows.filter(($) => $ > 0).reduce(($, It) => $ + It, 0)]).sort((P, $) => P[1] - $[1])[0]) == null ? void 0 : C[0];
366
- W && (B = W);
363
+ }).map((R) => [R.placement, R.overflows.filter((W) => W > 0).reduce((W, Ht) => W + Ht, 0)]).sort((R, W) => R[1] - W[1])[0]) == null ? void 0 : _[0];
364
+ O && (B = O);
367
365
  break;
368
366
  }
369
367
  case "initialPlacement":
@@ -381,12 +379,12 @@ const Zt = (t) => ({
381
379
  }
382
380
  };
383
381
  };
384
- async function ee(t, e) {
382
+ async function te(t, e) {
385
383
  const {
386
384
  placement: o,
387
385
  platform: n,
388
386
  elements: i
389
- } = t, s = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), r = X(o), c = et(o), l = z(o) === "y", a = ["left", "top"].includes(r) ? -1 : 1, d = s && l ? -1 : 1, f = tt(e, t);
387
+ } = t, s = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), r = z(o), c = tt(o), l = $(o) === "y", a = ["left", "top"].includes(r) ? -1 : 1, d = s && l ? -1 : 1, f = Z(e, t);
390
388
  let {
391
389
  mainAxis: p,
392
390
  crossAxis: u,
@@ -408,7 +406,7 @@ async function ee(t, e) {
408
406
  y: u * d
409
407
  };
410
408
  }
411
- const ne = function(t) {
409
+ const ee = function(t) {
412
410
  return t === void 0 && (t = 0), {
413
411
  name: "offset",
414
412
  options: t,
@@ -419,7 +417,7 @@ const ne = function(t) {
419
417
  y: s,
420
418
  placement: r,
421
419
  middlewareData: c
422
- } = e, l = await ee(e, t);
420
+ } = e, l = await te(e, t);
423
421
  return r === ((o = c.offset) == null ? void 0 : o.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
424
422
  x: i + l.x,
425
423
  y: s + l.y,
@@ -430,7 +428,7 @@ const ne = function(t) {
430
428
  };
431
429
  }
432
430
  };
433
- }, oe = function(t) {
431
+ }, ne = function(t) {
434
432
  return t === void 0 && (t = {}), {
435
433
  name: "shift",
436
434
  options: t,
@@ -445,28 +443,28 @@ const ne = function(t) {
445
443
  limiter: c = {
446
444
  fn: (h) => {
447
445
  let {
448
- x: w,
449
- y: x
446
+ x,
447
+ y: w
450
448
  } = h;
451
449
  return {
452
- x: w,
453
- y: x
450
+ x,
451
+ y: w
454
452
  };
455
453
  }
456
454
  },
457
455
  ...l
458
- } = tt(t, e), a = {
456
+ } = Z(t, e), a = {
459
457
  x: o,
460
458
  y: n
461
- }, d = await Pt(e, l), f = z(X(i)), p = kt(f);
459
+ }, d = await St(e, l), f = $(z(i)), p = Et(f);
462
460
  let u = a[p], m = a[f];
463
461
  if (s) {
464
- const h = p === "y" ? "top" : "left", w = p === "y" ? "bottom" : "right", x = u + d[h], y = u - d[w];
465
- u = mt(x, u, y);
462
+ const h = p === "y" ? "top" : "left", x = p === "y" ? "bottom" : "right", w = u + d[h], y = u - d[x];
463
+ u = dt(w, u, y);
466
464
  }
467
465
  if (r) {
468
- const h = f === "y" ? "top" : "left", w = f === "y" ? "bottom" : "right", x = m + d[h], y = m - d[w];
469
- m = mt(x, m, y);
466
+ const h = f === "y" ? "top" : "left", x = f === "y" ? "bottom" : "right", w = m + d[h], y = m - d[x];
467
+ m = dt(w, m, y);
470
468
  }
471
469
  const g = c.fn({
472
470
  ...e,
@@ -487,45 +485,45 @@ const ne = function(t) {
487
485
  }
488
486
  };
489
487
  };
490
- function ct() {
488
+ function rt() {
491
489
  return typeof window < "u";
492
490
  }
493
- function G(t) {
494
- return Dt(t) ? (t.nodeName || "").toLowerCase() : "#document";
491
+ function q(t) {
492
+ return Pt(t) ? (t.nodeName || "").toLowerCase() : "#document";
495
493
  }
496
- function A(t) {
494
+ function C(t) {
497
495
  var e;
498
496
  return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
499
497
  }
500
498
  function F(t) {
501
499
  var e;
502
- return (e = (Dt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
500
+ return (e = (Pt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
503
501
  }
504
- function Dt(t) {
505
- return ct() ? t instanceof Node || t instanceof A(t).Node : !1;
502
+ function Pt(t) {
503
+ return rt() ? t instanceof Node || t instanceof C(t).Node : !1;
506
504
  }
507
- function R(t) {
508
- return ct() ? t instanceof Element || t instanceof A(t).Element : !1;
505
+ function L(t) {
506
+ return rt() ? t instanceof Element || t instanceof C(t).Element : !1;
509
507
  }
510
508
  function N(t) {
511
- return ct() ? t instanceof HTMLElement || t instanceof A(t).HTMLElement : !1;
509
+ return rt() ? t instanceof HTMLElement || t instanceof C(t).HTMLElement : !1;
512
510
  }
513
- function Ct(t) {
514
- return !ct() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof A(t).ShadowRoot;
511
+ function At(t) {
512
+ return !rt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof C(t).ShadowRoot;
515
513
  }
516
- function nt(t) {
514
+ function et(t) {
517
515
  const {
518
516
  overflow: e,
519
517
  overflowX: o,
520
518
  overflowY: n,
521
519
  display: i
522
- } = L(t);
520
+ } = E(t);
523
521
  return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !["inline", "contents"].includes(i);
524
522
  }
525
- function ie(t) {
526
- return ["table", "td", "th"].includes(G(t));
523
+ function oe(t) {
524
+ return ["table", "td", "th"].includes(q(t));
527
525
  }
528
- function lt(t) {
526
+ function ct(t) {
529
527
  return [":popover-open", ":modal"].some((e) => {
530
528
  try {
531
529
  return t.matches(e);
@@ -534,32 +532,32 @@ function lt(t) {
534
532
  }
535
533
  });
536
534
  }
537
- function xt(t) {
538
- const e = yt(), o = R(t) ? L(t) : t;
535
+ function wt(t) {
536
+ const e = xt(), o = L(t) ? E(t) : t;
539
537
  return ["transform", "translate", "scale", "rotate", "perspective"].some((n) => o[n] ? o[n] !== "none" : !1) || (o.containerType ? o.containerType !== "normal" : !1) || !e && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !e && (o.filter ? o.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((n) => (o.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (o.contain || "").includes(n));
540
538
  }
541
- function se(t) {
539
+ function ie(t) {
542
540
  let e = H(t);
543
- for (; N(e) && !q(e); ) {
544
- if (xt(e))
541
+ for (; N(e) && !U(e); ) {
542
+ if (wt(e))
545
543
  return e;
546
- if (lt(e))
544
+ if (ct(e))
547
545
  return null;
548
546
  e = H(e);
549
547
  }
550
548
  return null;
551
549
  }
552
- function yt() {
550
+ function xt() {
553
551
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
554
552
  }
555
- function q(t) {
556
- return ["html", "body", "#document"].includes(G(t));
553
+ function U(t) {
554
+ return ["html", "body", "#document"].includes(q(t));
557
555
  }
558
- function L(t) {
559
- return A(t).getComputedStyle(t);
556
+ function E(t) {
557
+ return C(t).getComputedStyle(t);
560
558
  }
561
- function at(t) {
562
- return R(t) ? {
559
+ function lt(t) {
560
+ return L(t) ? {
563
561
  scrollLeft: t.scrollLeft,
564
562
  scrollTop: t.scrollTop
565
563
  } : {
@@ -568,114 +566,114 @@ function at(t) {
568
566
  };
569
567
  }
570
568
  function H(t) {
571
- if (G(t) === "html")
569
+ if (q(t) === "html")
572
570
  return t;
573
571
  const e = (
574
572
  // Step into the shadow DOM of the parent of a slotted node.
575
573
  t.assignedSlot || // DOM Element detected.
576
574
  t.parentNode || // ShadowRoot detected.
577
- Ct(t) && t.host || // Fallback.
575
+ At(t) && t.host || // Fallback.
578
576
  F(t)
579
577
  );
580
- return Ct(e) ? e.host : e;
578
+ return At(e) ? e.host : e;
581
579
  }
582
- function Nt(t) {
580
+ function Dt(t) {
583
581
  const e = H(t);
584
- return q(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : N(e) && nt(e) ? e : Nt(e);
582
+ return U(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : N(e) && et(e) ? e : Dt(e);
585
583
  }
586
- function Mt(t, e, o) {
584
+ function Nt(t, e, o) {
587
585
  var n;
588
586
  e === void 0 && (e = []);
589
- const i = Nt(t), s = i === ((n = t.ownerDocument) == null ? void 0 : n.body), r = A(i);
590
- return s ? e.concat(r, r.visualViewport || [], nt(i) ? i : [], []) : e.concat(i, Mt(i, []));
587
+ const i = Dt(t), s = i === ((n = t.ownerDocument) == null ? void 0 : n.body), r = C(i);
588
+ return s ? e.concat(r, r.visualViewport || [], et(i) ? i : [], []) : e.concat(i, Nt(i, []));
591
589
  }
592
- function Tt(t) {
590
+ function Ct(t) {
593
591
  return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
594
592
  }
595
- function Bt(t) {
596
- const e = L(t);
593
+ function Mt(t) {
594
+ const e = E(t);
597
595
  let o = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
598
- const i = N(t), s = i ? t.offsetWidth : o, r = i ? t.offsetHeight : n, c = it(o) !== s || it(n) !== r;
596
+ const i = N(t), s = i ? t.offsetWidth : o, r = i ? t.offsetHeight : n, c = ot(o) !== s || ot(n) !== r;
599
597
  return c && (o = s, n = r), {
600
598
  width: o,
601
599
  height: n,
602
600
  $: c
603
601
  };
604
602
  }
605
- function Ft(t) {
606
- return R(t) ? t : t.contextElement;
603
+ function Bt(t) {
604
+ return L(t) ? t : t.contextElement;
607
605
  }
608
- function U(t) {
609
- const e = Ft(t);
606
+ function K(t) {
607
+ const e = Bt(t);
610
608
  if (!N(e))
611
609
  return D(1);
612
610
  const o = e.getBoundingClientRect(), {
613
611
  width: n,
614
612
  height: i,
615
613
  $: s
616
- } = Bt(e);
617
- let r = (s ? it(o.width) : o.width) / n, c = (s ? it(o.height) : o.height) / i;
614
+ } = Mt(e);
615
+ let r = (s ? ot(o.width) : o.width) / n, c = (s ? ot(o.height) : o.height) / i;
618
616
  return (!r || !Number.isFinite(r)) && (r = 1), (!c || !Number.isFinite(c)) && (c = 1), {
619
617
  x: r,
620
618
  y: c
621
619
  };
622
620
  }
623
- const re = /* @__PURE__ */ D(0);
624
- function Vt(t) {
625
- const e = A(t);
626
- return !yt() || !e.visualViewport ? re : {
621
+ const se = /* @__PURE__ */ D(0);
622
+ function Ft(t) {
623
+ const e = C(t);
624
+ return !xt() || !e.visualViewport ? se : {
627
625
  x: e.visualViewport.offsetLeft,
628
626
  y: e.visualViewport.offsetTop
629
627
  };
630
628
  }
631
- function ce(t, e, o) {
632
- return e === void 0 && (e = !1), !o || e && o !== A(t) ? !1 : e;
629
+ function re(t, e, o) {
630
+ return e === void 0 && (e = !1), !o || e && o !== C(t) ? !1 : e;
633
631
  }
634
- function Z(t, e, o, n) {
632
+ function Q(t, e, o, n) {
635
633
  e === void 0 && (e = !1), o === void 0 && (o = !1);
636
- const i = t.getBoundingClientRect(), s = Ft(t);
634
+ const i = t.getBoundingClientRect(), s = Bt(t);
637
635
  let r = D(1);
638
- e && (n ? R(n) && (r = U(n)) : r = U(t));
639
- const c = ce(s, o, n) ? Vt(s) : D(0);
636
+ e && (n ? L(n) && (r = K(n)) : r = K(t));
637
+ const c = re(s, o, n) ? Ft(s) : D(0);
640
638
  let l = (i.left + c.x) / r.x, a = (i.top + c.y) / r.y, d = i.width / r.x, f = i.height / r.y;
641
639
  if (s) {
642
- const p = A(s), u = n && R(n) ? A(n) : n;
643
- let m = p, g = Tt(m);
640
+ const p = C(s), u = n && L(n) ? C(n) : n;
641
+ let m = p, g = Ct(m);
644
642
  for (; g && n && u !== m; ) {
645
- const h = U(g), w = g.getBoundingClientRect(), x = L(g), y = w.left + (g.clientLeft + parseFloat(x.paddingLeft)) * h.x, v = w.top + (g.clientTop + parseFloat(x.paddingTop)) * h.y;
646
- l *= h.x, a *= h.y, d *= h.x, f *= h.y, l += y, a += v, m = A(g), g = Tt(m);
643
+ const h = K(g), x = g.getBoundingClientRect(), w = E(g), y = x.left + (g.clientLeft + parseFloat(w.paddingLeft)) * h.x, A = x.top + (g.clientTop + parseFloat(w.paddingTop)) * h.y;
644
+ l *= h.x, a *= h.y, d *= h.x, f *= h.y, l += y, a += A, m = C(g), g = Ct(m);
647
645
  }
648
646
  }
649
- return rt({
647
+ return st({
650
648
  width: d,
651
649
  height: f,
652
650
  x: l,
653
651
  y: a
654
652
  });
655
653
  }
656
- function bt(t, e) {
657
- const o = at(t).scrollLeft;
658
- return e ? e.left + o : Z(F(t)).left + o;
654
+ function yt(t, e) {
655
+ const o = lt(t).scrollLeft;
656
+ return e ? e.left + o : Q(F(t)).left + o;
659
657
  }
660
- function Wt(t, e, o) {
658
+ function Vt(t, e, o) {
661
659
  o === void 0 && (o = !1);
662
660
  const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - (o ? 0 : (
663
661
  // RTL <body> scrollbar.
664
- bt(t, n)
662
+ yt(t, n)
665
663
  )), s = n.top + e.scrollTop;
666
664
  return {
667
665
  x: i,
668
666
  y: s
669
667
  };
670
668
  }
671
- function le(t) {
669
+ function ce(t) {
672
670
  let {
673
671
  elements: e,
674
672
  rect: o,
675
673
  offsetParent: n,
676
674
  strategy: i
677
675
  } = t;
678
- const s = i === "fixed", r = F(n), c = e ? lt(e.floating) : !1;
676
+ const s = i === "fixed", r = F(n), c = e ? ct(e.floating) : !1;
679
677
  if (n === r || c && s)
680
678
  return o;
681
679
  let l = {
@@ -683,11 +681,11 @@ function le(t) {
683
681
  scrollTop: 0
684
682
  }, a = D(1);
685
683
  const d = D(0), f = N(n);
686
- if ((f || !f && !s) && ((G(n) !== "body" || nt(r)) && (l = at(n)), N(n))) {
687
- const u = Z(n);
688
- a = U(n), d.x = u.x + n.clientLeft, d.y = u.y + n.clientTop;
684
+ if ((f || !f && !s) && ((q(n) !== "body" || et(r)) && (l = lt(n)), N(n))) {
685
+ const u = Q(n);
686
+ a = K(n), d.x = u.x + n.clientLeft, d.y = u.y + n.clientTop;
689
687
  }
690
- const p = r && !f && !s ? Wt(r, l, !0) : D(0);
688
+ const p = r && !f && !s ? Vt(r, l, !0) : D(0);
691
689
  return {
692
690
  width: o.width * a.x,
693
691
  height: o.height * a.y,
@@ -695,26 +693,26 @@ function le(t) {
695
693
  y: o.y * a.y - l.scrollTop * a.y + d.y + p.y
696
694
  };
697
695
  }
698
- function ae(t) {
696
+ function le(t) {
699
697
  return Array.from(t.getClientRects());
700
698
  }
701
- function fe(t) {
702
- const e = F(t), o = at(t), n = t.ownerDocument.body, i = K(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), s = K(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
703
- let r = -o.scrollLeft + bt(t);
699
+ function ae(t) {
700
+ const e = F(t), o = lt(t), n = t.ownerDocument.body, i = X(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), s = X(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
701
+ let r = -o.scrollLeft + yt(t);
704
702
  const c = -o.scrollTop;
705
- return L(n).direction === "rtl" && (r += K(e.clientWidth, n.clientWidth) - i), {
703
+ return E(n).direction === "rtl" && (r += X(e.clientWidth, n.clientWidth) - i), {
706
704
  width: i,
707
705
  height: s,
708
706
  x: r,
709
707
  y: c
710
708
  };
711
709
  }
712
- function ue(t, e) {
713
- const o = A(t), n = F(t), i = o.visualViewport;
710
+ function fe(t, e) {
711
+ const o = C(t), n = F(t), i = o.visualViewport;
714
712
  let s = n.clientWidth, r = n.clientHeight, c = 0, l = 0;
715
713
  if (i) {
716
714
  s = i.width, r = i.height;
717
- const a = yt();
715
+ const a = xt();
718
716
  (!a || a && e === "fixed") && (c = i.offsetLeft, l = i.offsetTop);
719
717
  }
720
718
  return {
@@ -724,8 +722,8 @@ function ue(t, e) {
724
722
  y: l
725
723
  };
726
724
  }
727
- function de(t, e) {
728
- const o = Z(t, !0, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft, s = N(t) ? U(t) : D(1), r = t.clientWidth * s.x, c = t.clientHeight * s.y, l = i * s.x, a = n * s.y;
725
+ function ue(t, e) {
726
+ const o = Q(t, !0, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft, s = N(t) ? K(t) : D(1), r = t.clientWidth * s.x, c = t.clientHeight * s.y, l = i * s.x, a = n * s.y;
729
727
  return {
730
728
  width: r,
731
729
  height: c,
@@ -733,16 +731,16 @@ function de(t, e) {
733
731
  y: a
734
732
  };
735
733
  }
736
- function Ot(t, e, o) {
734
+ function Tt(t, e, o) {
737
735
  let n;
738
736
  if (e === "viewport")
739
- n = ue(t, o);
737
+ n = fe(t, o);
740
738
  else if (e === "document")
741
- n = fe(F(t));
742
- else if (R(e))
743
- n = de(e, o);
739
+ n = ae(F(t));
740
+ else if (L(e))
741
+ n = ue(e, o);
744
742
  else {
745
- const i = Vt(t);
743
+ const i = Ft(t);
746
744
  n = {
747
745
  x: e.x - i.x,
748
746
  y: e.y - i.y,
@@ -750,36 +748,36 @@ function Ot(t, e, o) {
750
748
  height: e.height
751
749
  };
752
750
  }
753
- return rt(n);
751
+ return st(n);
754
752
  }
755
- function $t(t, e) {
753
+ function Wt(t, e) {
756
754
  const o = H(t);
757
- return o === e || !R(o) || q(o) ? !1 : L(o).position === "fixed" || $t(o, e);
755
+ return o === e || !L(o) || U(o) ? !1 : E(o).position === "fixed" || Wt(o, e);
758
756
  }
759
- function me(t, e) {
757
+ function de(t, e) {
760
758
  const o = e.get(t);
761
759
  if (o)
762
760
  return o;
763
- let n = Mt(t, []).filter((c) => R(c) && G(c) !== "body"), i = null;
764
- const s = L(t).position === "fixed";
761
+ let n = Nt(t, []).filter((c) => L(c) && q(c) !== "body"), i = null;
762
+ const s = E(t).position === "fixed";
765
763
  let r = s ? H(t) : t;
766
- for (; R(r) && !q(r); ) {
767
- const c = L(r), l = xt(r);
768
- !l && c.position === "fixed" && (i = null), (s ? !l && !i : !l && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || nt(r) && !l && $t(t, r)) ? n = n.filter((d) => d !== r) : i = c, r = H(r);
764
+ for (; L(r) && !U(r); ) {
765
+ const c = E(r), l = wt(r);
766
+ !l && c.position === "fixed" && (i = null), (s ? !l && !i : !l && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || et(r) && !l && Wt(t, r)) ? n = n.filter((d) => d !== r) : i = c, r = H(r);
769
767
  }
770
768
  return e.set(t, n), n;
771
769
  }
772
- function pe(t) {
770
+ function me(t) {
773
771
  let {
774
772
  element: e,
775
773
  boundary: o,
776
774
  rootBoundary: n,
777
775
  strategy: i
778
776
  } = t;
779
- const r = [...o === "clippingAncestors" ? lt(e) ? [] : me(e, this._c) : [].concat(o), n], c = r[0], l = r.reduce((a, d) => {
780
- const f = Ot(e, d, i);
781
- return a.top = K(f.top, a.top), a.right = Q(f.right, a.right), a.bottom = Q(f.bottom, a.bottom), a.left = K(f.left, a.left), a;
782
- }, Ot(e, c, i));
777
+ const r = [...o === "clippingAncestors" ? ct(e) ? [] : de(e, this._c) : [].concat(o), n], c = r[0], l = r.reduce((a, d) => {
778
+ const f = Tt(e, d, i);
779
+ return a.top = X(f.top, a.top), a.right = J(f.right, a.right), a.bottom = J(f.bottom, a.bottom), a.left = X(f.left, a.left), a;
780
+ }, Tt(e, c, i));
783
781
  return {
784
782
  width: l.right - l.left,
785
783
  height: l.bottom - l.top,
@@ -787,33 +785,33 @@ function pe(t) {
787
785
  y: l.top
788
786
  };
789
787
  }
790
- function ge(t) {
788
+ function pe(t) {
791
789
  const {
792
790
  width: e,
793
791
  height: o
794
- } = Bt(t);
792
+ } = Mt(t);
795
793
  return {
796
794
  width: e,
797
795
  height: o
798
796
  };
799
797
  }
800
- function he(t, e, o) {
801
- const n = N(e), i = F(e), s = o === "fixed", r = Z(t, !0, s, e);
798
+ function ge(t, e, o) {
799
+ const n = N(e), i = F(e), s = o === "fixed", r = Q(t, !0, s, e);
802
800
  let c = {
803
801
  scrollLeft: 0,
804
802
  scrollTop: 0
805
803
  };
806
804
  const l = D(0);
807
805
  function a() {
808
- l.x = bt(i);
806
+ l.x = yt(i);
809
807
  }
810
808
  if (n || !n && !s)
811
- if ((G(e) !== "body" || nt(i)) && (c = at(e)), n) {
812
- const u = Z(e, !0, s, e);
809
+ if ((q(e) !== "body" || et(i)) && (c = lt(e)), n) {
810
+ const u = Q(e, !0, s, e);
813
811
  l.x = u.x + e.clientLeft, l.y = u.y + e.clientTop;
814
812
  } else i && a();
815
813
  s && !n && i && a();
816
- const d = i && !n && !s ? Wt(i, c) : D(0), f = r.left + c.scrollLeft - l.x - d.x, p = r.top + c.scrollTop - l.y - d.y;
814
+ const d = i && !n && !s ? Vt(i, c) : D(0), f = r.left + c.scrollLeft - l.x - d.x, p = r.top + c.scrollTop - l.y - d.y;
817
815
  return {
818
816
  x: f,
819
817
  y: p,
@@ -821,39 +819,39 @@ function he(t, e, o) {
821
819
  height: r.height
822
820
  };
823
821
  }
824
- function ft(t) {
825
- return L(t).position === "static";
822
+ function at(t) {
823
+ return E(t).position === "static";
826
824
  }
827
- function Rt(t, e) {
828
- if (!N(t) || L(t).position === "fixed")
825
+ function Ot(t, e) {
826
+ if (!N(t) || E(t).position === "fixed")
829
827
  return null;
830
828
  if (e)
831
829
  return e(t);
832
830
  let o = t.offsetParent;
833
831
  return F(t) === o && (o = o.ownerDocument.body), o;
834
832
  }
835
- function Ht(t, e) {
836
- const o = A(t);
837
- if (lt(t))
833
+ function $t(t, e) {
834
+ const o = C(t);
835
+ if (ct(t))
838
836
  return o;
839
837
  if (!N(t)) {
840
838
  let i = H(t);
841
- for (; i && !q(i); ) {
842
- if (R(i) && !ft(i))
839
+ for (; i && !U(i); ) {
840
+ if (L(i) && !at(i))
843
841
  return i;
844
842
  i = H(i);
845
843
  }
846
844
  return o;
847
845
  }
848
- let n = Rt(t, e);
849
- for (; n && ie(n) && ft(n); )
850
- n = Rt(n, e);
851
- return n && q(n) && ft(n) && !xt(n) ? o : n || se(t) || o;
846
+ let n = Ot(t, e);
847
+ for (; n && oe(n) && at(n); )
848
+ n = Ot(n, e);
849
+ return n && U(n) && at(n) && !wt(n) ? o : n || ie(t) || o;
852
850
  }
853
- const we = async function(t) {
854
- const e = this.getOffsetParent || Ht, o = this.getDimensions, n = await o(t.floating);
851
+ const he = async function(t) {
852
+ const e = this.getOffsetParent || $t, o = this.getDimensions, n = await o(t.floating);
855
853
  return {
856
- reference: he(t.reference, await e(t.floating), t.strategy),
854
+ reference: ge(t.reference, await e(t.floating), t.strategy),
857
855
  floating: {
858
856
  x: 0,
859
857
  y: 0,
@@ -862,36 +860,36 @@ const we = async function(t) {
862
860
  }
863
861
  };
864
862
  };
865
- function xe(t) {
866
- return L(t).direction === "rtl";
863
+ function we(t) {
864
+ return E(t).direction === "rtl";
867
865
  }
868
- const ye = {
869
- convertOffsetParentRelativeRectToViewportRelativeRect: le,
866
+ const xe = {
867
+ convertOffsetParentRelativeRectToViewportRelativeRect: ce,
870
868
  getDocumentElement: F,
871
- getClippingRect: pe,
872
- getOffsetParent: Ht,
873
- getElementRects: we,
874
- getClientRects: ae,
875
- getDimensions: ge,
876
- getScale: U,
877
- isElement: R,
878
- isRTL: xe
879
- }, be = ne, ve = oe, Ae = te, Ce = Zt, Te = (t, e, o) => {
869
+ getClippingRect: me,
870
+ getOffsetParent: $t,
871
+ getElementRects: he,
872
+ getClientRects: le,
873
+ getDimensions: pe,
874
+ getScale: K,
875
+ isElement: L,
876
+ isRTL: we
877
+ }, ye = ee, be = ne, ve = Zt, Ae = Qt, Ce = (t, e, o) => {
880
878
  const n = /* @__PURE__ */ new Map(), i = {
881
- platform: ye,
879
+ platform: xe,
882
880
  ...o
883
881
  }, s = {
884
882
  ...i.platform,
885
883
  _c: n
886
884
  };
887
- return Qt(t, e, {
885
+ return Jt(t, e, {
888
886
  ...i,
889
887
  platform: s
890
888
  });
891
- }, Lt = ["mousedown", "touchstart"];
892
- function Oe(t, e, o) {
893
- const n = J(null);
894
- return gt(() => {
889
+ }, Rt = ["mousedown", "touchstart"];
890
+ function Te(t, e, o) {
891
+ const n = G(null);
892
+ return pt(() => {
895
893
  const i = (s) => {
896
894
  const r = s ? s.target : void 0;
897
895
  if (Array.isArray(o)) {
@@ -901,59 +899,59 @@ function Oe(t, e, o) {
901
899
  ) && !c && t();
902
900
  } else n.current && !n.current.contains(r) && t();
903
901
  };
904
- return Lt.forEach(
902
+ return Rt.forEach(
905
903
  (s) => document.addEventListener(s, i)
906
904
  ), () => {
907
- Lt.forEach(
905
+ Rt.forEach(
908
906
  (s) => document.removeEventListener(s, i)
909
907
  );
910
908
  };
911
909
  }, [t, o, e]), n;
912
910
  }
913
- function Re(t, e) {
914
- const [o, n] = ut(!1), i = J(null), s = J(null), r = dt(() => {
911
+ function Oe(t, e) {
912
+ const [o, n] = ft(!1), i = G(null), s = G(null), r = ut(() => {
915
913
  n((l) => (!l && (!i.current || i.current === -1) && (i.current = window.setInterval(s.current, e)), !0));
916
- }, [e]), c = dt(() => {
914
+ }, [e]), c = ut(() => {
917
915
  n(!1), window.clearInterval(i.current || -1), i.current = -1;
918
916
  }, []);
919
- return gt(() => (s.current = t, o && r(), c), [t, o, r, c]), { start: r, stop: c, active: o };
917
+ return pt(() => (s.current = t, o && r(), c), [t, o, r, c]), { start: r, stop: c, active: o };
920
918
  }
921
- const ot = (t, e = "px") => typeof t > "u" ? "" : `${Math.round(t)}${e}`, Le = () => Y("absolute top-0 left-0 w-max py-1 px-2 rounded-sm text-sm z-50"), Et = ({
919
+ const nt = (t, e = "px") => typeof t > "u" ? "" : `${Math.round(t)}${e}`, Re = () => Y("absolute top-0 left-0 w-max py-1 px-2 rounded-sm text-sm z-50"), Lt = ({
922
920
  mode: t
923
921
  }) => Y({
924
922
  "bg-surface-darker": t === "dark" || t === "system",
925
923
  "bg-surface-light": t === "light" || t === "alt-system",
926
924
  "dark:bg-surface-light": t === "system",
927
925
  "dark:bg-surface-darker": t === "alt-system"
928
- }), Ee = ({
926
+ }), Le = ({
929
927
  mode: t
930
928
  }) => Y({
931
929
  "text-copy-light": t === "dark" || t === "system",
932
930
  "text-copy-dark": t === "light" || t === "alt-system",
933
931
  "dark:text-copy-dark": t === "system",
934
932
  "dark:text-copy-light": t === "alt-system"
935
- }), ke = () => Y("absolute", "size-2", "transform rotate-45"), Se = ({
933
+ }), Ee = () => Y("absolute", "size-2", "transform rotate-45"), ke = ({
936
934
  mode: t,
937
935
  className: e,
938
936
  tooltipClassName: o,
939
937
  arrowClassName: n
940
938
  }) => {
941
939
  const i = Y("relative inline-block", e), s = Y(
942
- jt,
943
- Le(),
944
- Et({ mode: t }),
945
- Ee({ mode: t }),
940
+ _t,
941
+ Re(),
942
+ Lt({ mode: t }),
943
+ Le({ mode: t }),
946
944
  o
947
945
  ), r = Y(
948
- Yt,
949
- ke(),
950
- Et({ mode: t }),
946
+ jt,
947
+ Ee(),
948
+ Lt({ mode: t }),
951
949
  n
952
950
  );
953
951
  return { tooltip: s, arrow: r, wrapper: i };
954
- }, Pe = ({ delay: t = 300 }) => ({
952
+ }, Se = ({ delay: t = 300 }) => ({
955
953
  animation: `av-tooltip-fade-in ${t}ms ease-in-out`
956
- }), De = 5e3, Fe = ({
954
+ }), Pe = 5e3, Be = ({
957
955
  trigger: t,
958
956
  label: e,
959
957
  placement: o = "top",
@@ -963,76 +961,76 @@ const ot = (t, e = "px") => typeof t > "u" ? "" : `${Math.round(t)}${e}`, Le = (
963
961
  tooltipClassName: r,
964
962
  arrowClassName: c
965
963
  }) => {
966
- const l = Oe(() => {
964
+ const l = Te(() => {
967
965
  g.stop(), m(!1);
968
- }), a = J(null), d = J(null), [f, p] = ut(!1), [u, m] = ut(!1), g = Re(() => {
966
+ }), a = G(null), d = G(null), [f, p] = ft(!1), [u, m] = ft(!1), g = Oe(() => {
969
967
  m(!1);
970
- }, De), h = Se({
968
+ }, Pe), h = ke({
971
969
  mode: n,
972
970
  className: s,
973
971
  tooltipClassName: r,
974
972
  arrowClassName: c
975
- }), w = Pe({ delay: i }), x = dt(async () => {
976
- var M, E, V, k;
973
+ }), x = Se({ delay: i }), w = ut(async () => {
974
+ var M, k, V, S;
977
975
  if (l.current && a.current && d.current) {
978
976
  const {
979
977
  x: T,
980
978
  y: I,
981
- middlewareData: S,
979
+ middlewareData: P,
982
980
  placement: _
983
- } = await Te(l.current, a.current, {
981
+ } = await Ce(l.current, a.current, {
984
982
  placement: o,
985
983
  middleware: [
986
- be(10),
987
- Ae({
984
+ ye(10),
985
+ ve({
988
986
  crossAxis: o.includes("-"),
989
987
  fallbackAxisSideDirection: "start"
990
988
  }),
991
- ve({ padding: 5 }),
992
- Ce({ element: d.current })
989
+ be({ padding: 5 }),
990
+ Ae({ element: d.current })
993
991
  ]
994
992
  });
995
993
  (M = a == null ? void 0 : a.current) != null && M.style && Object.assign(a.current.style, {
996
- left: ot(T),
997
- top: ot(I),
998
- ...w
994
+ left: nt(T),
995
+ top: nt(I),
996
+ ...x
999
997
  });
1000
- const C = {
998
+ const v = {
1001
999
  top: "bottom",
1002
1000
  right: "left",
1003
1001
  bottom: "top",
1004
1002
  left: "right"
1005
1003
  }[_.split("-")[0]];
1006
- (E = d == null ? void 0 : d.current) != null && E.style && Object.assign(d.current.style, {
1007
- left: ot((V = S.arrow) == null ? void 0 : V.x),
1008
- top: ot((k = S.arrow) == null ? void 0 : k.y),
1004
+ (k = d == null ? void 0 : d.current) != null && k.style && Object.assign(d.current.style, {
1005
+ left: nt((V = P.arrow) == null ? void 0 : V.x),
1006
+ top: nt((S = P.arrow) == null ? void 0 : S.y),
1009
1007
  right: "",
1010
1008
  bottom: "",
1011
- [C]: "-4px"
1009
+ [v]: "-4px"
1012
1010
  });
1013
1011
  }
1014
- }, [o, w, l]);
1015
- gt(() => {
1016
- (async () => f && await x())();
1017
- }, [x, f]);
1012
+ }, [o, x, l]);
1013
+ pt(() => {
1014
+ (async () => f && await w())();
1015
+ }, [w, f]);
1018
1016
  const y = () => {
1019
1017
  p(!1), m(!0), g.start();
1020
- }, v = () => {
1018
+ }, A = () => {
1021
1019
  u || p(!0);
1022
1020
  }, b = () => {
1023
1021
  u || p(!1);
1024
1022
  };
1025
- return /* @__PURE__ */ vt(
1023
+ return /* @__PURE__ */ bt(
1026
1024
  "div",
1027
1025
  {
1028
1026
  className: h.wrapper,
1029
1027
  ref: l,
1030
- onMouseEnter: v,
1028
+ onMouseEnter: A,
1031
1029
  onMouseLeave: b,
1032
1030
  onClick: y,
1033
1031
  children: [
1034
1032
  t,
1035
- f && /* @__PURE__ */ vt(
1033
+ f && /* @__PURE__ */ bt(
1036
1034
  "div",
1037
1035
  {
1038
1036
  role: "tooltip",
@@ -1040,7 +1038,7 @@ const ot = (t, e = "px") => typeof t > "u" ? "" : `${Math.round(t)}${e}`, Le = (
1040
1038
  className: h.tooltip,
1041
1039
  children: [
1042
1040
  e,
1043
- /* @__PURE__ */ _t("div", { ref: d, className: h.arrow })
1041
+ /* @__PURE__ */ It("div", { ref: d, className: h.arrow })
1044
1042
  ]
1045
1043
  }
1046
1044
  )
@@ -1049,7 +1047,7 @@ const ot = (t, e = "px") => typeof t > "u" ? "" : `${Math.round(t)}${e}`, Le = (
1049
1047
  );
1050
1048
  };
1051
1049
  export {
1052
- Yt as TOOLTIP_ARROW_CLASSNAME,
1053
- jt as TOOLTIP_CLASSNAME,
1054
- Fe as Tooltip
1050
+ jt as TOOLTIP_ARROW_CLASSNAME,
1051
+ _t as TOOLTIP_CLASSNAME,
1052
+ Be as Tooltip
1055
1053
  };
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { TOOLTIP_ARROW_CLASSNAME as T, TOOLTIP_CLASSNAME as I, Tooltip as e } from "./components/Tooltip/Tooltip.js";
2
2
  /*!
3
- @versini/ui-tooltip v2.0.3
3
+ @versini/ui-tooltip v2.0.4
4
4
  © 2025 gizmette.com
5
5
  */
6
6
  try {
7
7
  window.__VERSINI_UI_TOOLTIP__ || (window.__VERSINI_UI_TOOLTIP__ = {
8
- version: "2.0.3",
9
- buildTime: "05/26/2025 03:48 PM EDT",
8
+ version: "2.0.4",
9
+ buildTime: "06/20/2025 05:22 PM EDT",
10
10
  homepage: "https://github.com/aversini/ui-components",
11
11
  license: "MIT"
12
12
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-tooltip",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -39,17 +39,17 @@
39
39
  "react-dom": "^18.3.1 || ^19.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@versini/ui-types": "5.0.3"
42
+ "@versini/ui-types": "5.0.4"
43
43
  },
44
44
  "dependencies": {
45
- "@floating-ui/dom": "1.7.0",
45
+ "@floating-ui/dom": "1.7.1",
46
46
  "@tailwindcss/typography": "0.5.16",
47
- "@versini/ui-hooks": "4.7.3",
47
+ "@versini/ui-hooks": "4.7.4",
48
48
  "clsx": "2.1.1",
49
- "tailwindcss": "4.1.7"
49
+ "tailwindcss": "4.1.10"
50
50
  },
51
51
  "sideEffects": [
52
52
  "**/*.css"
53
53
  ],
54
- "gitHead": "863a399128080a19f2668e458d495110aa0f68f8"
54
+ "gitHead": "2fffae99315244f0662bdecbe45a89bc770f0f15"
55
55
  }