react-tooltip 5.10.1-beta.4 → 5.10.1

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.
@@ -6,16 +6,13 @@
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __getProtoOf = Object.getPrototypeOf;
8
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __require = /* @__PURE__ */ ((x3) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x3, {
10
- get: (a3, b3) => (typeof require !== "undefined" ? require : a3)[b3]
11
- }) : x3)(function(x3) {
9
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
+ }) : x)(function(x) {
12
12
  if (typeof require !== "undefined")
13
13
  return require.apply(this, arguments);
14
- throw new Error('Dynamic require of "' + x3 + '" is not supported');
14
+ throw new Error('Dynamic require of "' + x + '" is not supported');
15
15
  });
16
- var __commonJS = (cb, mod) => function __require2() {
17
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
- };
19
16
  var __copyProps = (to, from, except, desc) => {
20
17
  if (from && typeof from === "object" || typeof from === "function") {
21
18
  for (let key of __getOwnPropNames(from))
@@ -33,63 +30,12 @@
33
30
  mod
34
31
  ));
35
32
 
36
- // node_modules/classnames/index.js
37
- var require_classnames = __commonJS({
38
- "node_modules/classnames/index.js"(exports, module) {
39
- (function() {
40
- "use strict";
41
- var hasOwn = {}.hasOwnProperty;
42
- var nativeCodeString = "[native code]";
43
- function classNames3() {
44
- var classes = [];
45
- for (var i3 = 0; i3 < arguments.length; i3++) {
46
- var arg = arguments[i3];
47
- if (!arg)
48
- continue;
49
- var argType = typeof arg;
50
- if (argType === "string" || argType === "number") {
51
- classes.push(arg);
52
- } else if (Array.isArray(arg)) {
53
- if (arg.length) {
54
- var inner = classNames3.apply(null, arg);
55
- if (inner) {
56
- classes.push(inner);
57
- }
58
- }
59
- } else if (argType === "object") {
60
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
61
- classes.push(arg.toString());
62
- continue;
63
- }
64
- for (var key in arg) {
65
- if (hasOwn.call(arg, key) && arg[key]) {
66
- classes.push(key);
67
- }
68
- }
69
- }
70
- }
71
- return classes.join(" ");
72
- }
73
- if (typeof module !== "undefined" && module.exports) {
74
- classNames3.default = classNames3;
75
- module.exports = classNames3;
76
- } else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
77
- define("classnames", [], function() {
78
- return classNames3;
79
- });
80
- } else {
81
- window.classNames = classNames3;
82
- }
83
- })();
84
- }
85
- });
86
-
87
33
  // src/components/TooltipController/TooltipController.tsx
88
34
  var import_react5 = __require("react");
89
35
 
90
36
  // src/components/Tooltip/Tooltip.tsx
91
37
  var import_react4 = __require("react");
92
- var import_classnames2 = __toESM(require_classnames());
38
+ var import_classnames2 = __toESM(__require("classnames"));
93
39
 
94
40
  // src/utils/debounce.ts
95
41
  var debounce = (func, wait, immediate) => {
@@ -188,7 +134,7 @@
188
134
 
189
135
  // src/components/TooltipProvider/TooltipWrapper.tsx
190
136
  var import_react2 = __require("react");
191
- var import_classnames = __toESM(require_classnames());
137
+ var import_classnames = __toESM(__require("classnames"));
192
138
  var import_jsx_runtime2 = __require("react/jsx-runtime");
193
139
  var TooltipWrapper = ({
194
140
  tooltipId,
@@ -198,7 +144,7 @@
198
144
  content,
199
145
  html,
200
146
  variant,
201
- offset,
147
+ offset: offset2,
202
148
  wrapper,
203
149
  events,
204
150
  positionStrategy,
@@ -222,7 +168,7 @@
222
168
  "data-tooltip-content": content,
223
169
  "data-tooltip-html": html,
224
170
  "data-tooltip-variant": variant,
225
- "data-tooltip-offset": offset,
171
+ "data-tooltip-offset": offset2,
226
172
  "data-tooltip-wrapper": wrapper,
227
173
  "data-tooltip-events": events,
228
174
  "data-tooltip-position-strategy": positionStrategy,
@@ -239,416 +185,8 @@
239
185
  var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react3.useLayoutEffect : import_react3.useEffect;
240
186
  var use_isomorphic_layout_effect_default = useIsomorphicLayoutEffect;
241
187
 
242
- // node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs
243
- function t(t2) {
244
- return t2.split("-")[1];
245
- }
246
- function e(t2) {
247
- return "y" === t2 ? "height" : "width";
248
- }
249
- function n(t2) {
250
- return t2.split("-")[0];
251
- }
252
- function o(t2) {
253
- return ["top", "bottom"].includes(n(t2)) ? "x" : "y";
254
- }
255
- function i(i3, r3, a3) {
256
- let { reference: l3, floating: s3 } = i3;
257
- const c3 = l3.x + l3.width / 2 - s3.width / 2, f3 = l3.y + l3.height / 2 - s3.height / 2, m3 = o(r3), u3 = e(m3), g3 = l3[u3] / 2 - s3[u3] / 2, d3 = "x" === m3;
258
- let p3;
259
- switch (n(r3)) {
260
- case "top":
261
- p3 = { x: c3, y: l3.y - s3.height };
262
- break;
263
- case "bottom":
264
- p3 = { x: c3, y: l3.y + l3.height };
265
- break;
266
- case "right":
267
- p3 = { x: l3.x + l3.width, y: f3 };
268
- break;
269
- case "left":
270
- p3 = { x: l3.x - s3.width, y: f3 };
271
- break;
272
- default:
273
- p3 = { x: l3.x, y: l3.y };
274
- }
275
- switch (t(r3)) {
276
- case "start":
277
- p3[m3] -= g3 * (a3 && d3 ? -1 : 1);
278
- break;
279
- case "end":
280
- p3[m3] += g3 * (a3 && d3 ? -1 : 1);
281
- }
282
- return p3;
283
- }
284
- var r = async (t2, e2, n3) => {
285
- const { placement: o3 = "bottom", strategy: r3 = "absolute", middleware: a3 = [], platform: l3 } = n3, s3 = a3.filter(Boolean), c3 = await (null == l3.isRTL ? void 0 : l3.isRTL(e2));
286
- let f3 = await l3.getElementRects({ reference: t2, floating: e2, strategy: r3 }), { x: m3, y: u3 } = i(f3, o3, c3), g3 = o3, d3 = {}, p3 = 0;
287
- for (let n4 = 0; n4 < s3.length; n4++) {
288
- const { name: a4, fn: h3 } = s3[n4], { x: y3, y: x3, data: w3, reset: v3 } = await h3({ x: m3, y: u3, initialPlacement: o3, placement: g3, strategy: r3, middlewareData: d3, rects: f3, platform: l3, elements: { reference: t2, floating: e2 } });
289
- m3 = null != y3 ? y3 : m3, u3 = null != x3 ? x3 : u3, d3 = { ...d3, [a4]: { ...d3[a4], ...w3 } }, v3 && p3 <= 50 && (p3++, "object" == typeof v3 && (v3.placement && (g3 = v3.placement), v3.rects && (f3 = true === v3.rects ? await l3.getElementRects({ reference: t2, floating: e2, strategy: r3 }) : v3.rects), { x: m3, y: u3 } = i(f3, g3, c3)), n4 = -1);
290
- }
291
- return { x: m3, y: u3, placement: g3, strategy: r3, middlewareData: d3 };
292
- };
293
- function a(t2) {
294
- return "number" != typeof t2 ? function(t3) {
295
- return { top: 0, right: 0, bottom: 0, left: 0, ...t3 };
296
- }(t2) : { top: t2, right: t2, bottom: t2, left: t2 };
297
- }
298
- function l(t2) {
299
- return { ...t2, top: t2.y, left: t2.x, right: t2.x + t2.width, bottom: t2.y + t2.height };
300
- }
301
- async function s(t2, e2) {
302
- var n3;
303
- void 0 === e2 && (e2 = {});
304
- const { x: o3, y: i3, platform: r3, rects: s3, elements: c3, strategy: f3 } = t2, { boundary: m3 = "clippingAncestors", rootBoundary: u3 = "viewport", elementContext: g3 = "floating", altBoundary: d3 = false, padding: p3 = 0 } = e2, h3 = a(p3), y3 = c3[d3 ? "floating" === g3 ? "reference" : "floating" : g3], x3 = l(await r3.getClippingRect({ element: null == (n3 = await (null == r3.isElement ? void 0 : r3.isElement(y3))) || n3 ? y3 : y3.contextElement || await (null == r3.getDocumentElement ? void 0 : r3.getDocumentElement(c3.floating)), boundary: m3, rootBoundary: u3, strategy: f3 })), w3 = "floating" === g3 ? { ...s3.floating, x: o3, y: i3 } : s3.reference, v3 = await (null == r3.getOffsetParent ? void 0 : r3.getOffsetParent(c3.floating)), b3 = await (null == r3.isElement ? void 0 : r3.isElement(v3)) && await (null == r3.getScale ? void 0 : r3.getScale(v3)) || { x: 1, y: 1 }, R2 = l(r3.convertOffsetParentRelativeRectToViewportRelativeRect ? await r3.convertOffsetParentRelativeRectToViewportRelativeRect({ rect: w3, offsetParent: v3, strategy: f3 }) : w3);
305
- return { top: (x3.top - R2.top + h3.top) / b3.y, bottom: (R2.bottom - x3.bottom + h3.bottom) / b3.y, left: (x3.left - R2.left + h3.left) / b3.x, right: (R2.right - x3.right + h3.right) / b3.x };
306
- }
307
- var c = Math.min;
308
- var f = Math.max;
309
- function m(t2, e2, n3) {
310
- return f(t2, c(e2, n3));
311
- }
312
- var u = (n3) => ({ name: "arrow", options: n3, async fn(i3) {
313
- const { element: r3, padding: l3 = 0 } = n3 || {}, { x: s3, y: c3, placement: f3, rects: u3, platform: g3, elements: d3 } = i3;
314
- if (null == r3)
315
- return {};
316
- const p3 = a(l3), h3 = { x: s3, y: c3 }, y3 = o(f3), x3 = e(y3), w3 = await g3.getDimensions(r3), v3 = "y" === y3, b3 = v3 ? "top" : "left", R2 = v3 ? "bottom" : "right", A2 = v3 ? "clientHeight" : "clientWidth", P2 = u3.reference[x3] + u3.reference[y3] - h3[y3] - u3.floating[x3], T3 = h3[y3] - u3.reference[y3], O3 = await (null == g3.getOffsetParent ? void 0 : g3.getOffsetParent(r3));
317
- let E3 = O3 ? O3[A2] : 0;
318
- E3 && await (null == g3.isElement ? void 0 : g3.isElement(O3)) || (E3 = d3.floating[A2] || u3.floating[x3]);
319
- const D3 = P2 / 2 - T3 / 2, L3 = p3[b3], k2 = E3 - w3[x3] - p3[R2], B = E3 / 2 - w3[x3] / 2 + D3, C2 = m(L3, B, k2), H2 = null != t(f3) && B != C2 && u3.reference[x3] / 2 - (B < L3 ? p3[b3] : p3[R2]) - w3[x3] / 2 < 0;
320
- return { [y3]: h3[y3] - (H2 ? B < L3 ? L3 - B : k2 - B : 0), data: { [y3]: C2, centerOffset: B - C2 } };
321
- } });
322
- var g = ["top", "right", "bottom", "left"];
323
- var d = g.reduce((t2, e2) => t2.concat(e2, e2 + "-start", e2 + "-end"), []);
324
- var p = { left: "right", right: "left", bottom: "top", top: "bottom" };
325
- function h(t2) {
326
- return t2.replace(/left|right|bottom|top/g, (t3) => p[t3]);
327
- }
328
- function y(n3, i3, r3) {
329
- void 0 === r3 && (r3 = false);
330
- const a3 = t(n3), l3 = o(n3), s3 = e(l3);
331
- let c3 = "x" === l3 ? a3 === (r3 ? "end" : "start") ? "right" : "left" : "start" === a3 ? "bottom" : "top";
332
- return i3.reference[s3] > i3.floating[s3] && (c3 = h(c3)), { main: c3, cross: h(c3) };
333
- }
334
- var x = { start: "end", end: "start" };
335
- function w(t2) {
336
- return t2.replace(/start|end/g, (t3) => x[t3]);
337
- }
338
- var b = function(e2) {
339
- return void 0 === e2 && (e2 = {}), { name: "flip", options: e2, async fn(o3) {
340
- var i3;
341
- const { placement: r3, middlewareData: a3, rects: l3, initialPlacement: c3, platform: f3, elements: m3 } = o3, { mainAxis: u3 = true, crossAxis: g3 = true, fallbackPlacements: d3, fallbackStrategy: p3 = "bestFit", fallbackAxisSideDirection: x3 = "none", flipAlignment: v3 = true, ...b3 } = e2, R2 = n(r3), A2 = n(c3) === c3, P2 = await (null == f3.isRTL ? void 0 : f3.isRTL(m3.floating)), T3 = d3 || (A2 || !v3 ? [h(c3)] : function(t2) {
342
- const e3 = h(t2);
343
- return [w(t2), e3, w(e3)];
344
- }(c3));
345
- d3 || "none" === x3 || T3.push(...function(e3, o4, i4, r4) {
346
- const a4 = t(e3);
347
- let l4 = function(t2, e4, n3) {
348
- const o5 = ["left", "right"], i5 = ["right", "left"], r5 = ["top", "bottom"], a5 = ["bottom", "top"];
349
- switch (t2) {
350
- case "top":
351
- case "bottom":
352
- return n3 ? e4 ? i5 : o5 : e4 ? o5 : i5;
353
- case "left":
354
- case "right":
355
- return e4 ? r5 : a5;
356
- default:
357
- return [];
358
- }
359
- }(n(e3), "start" === i4, r4);
360
- return a4 && (l4 = l4.map((t2) => t2 + "-" + a4), o4 && (l4 = l4.concat(l4.map(w)))), l4;
361
- }(c3, v3, x3, P2));
362
- const O3 = [c3, ...T3], E3 = await s(o3, b3), D3 = [];
363
- let L3 = (null == (i3 = a3.flip) ? void 0 : i3.overflows) || [];
364
- if (u3 && D3.push(E3[R2]), g3) {
365
- const { main: t2, cross: e3 } = y(r3, l3, P2);
366
- D3.push(E3[t2], E3[e3]);
367
- }
368
- if (L3 = [...L3, { placement: r3, overflows: D3 }], !D3.every((t2) => t2 <= 0)) {
369
- var k2, B;
370
- const t2 = ((null == (k2 = a3.flip) ? void 0 : k2.index) || 0) + 1, e3 = O3[t2];
371
- if (e3)
372
- return { data: { index: t2, overflows: L3 }, reset: { placement: e3 } };
373
- let n3 = null == (B = L3.filter((t3) => t3.overflows[0] <= 0).sort((t3, e4) => t3.overflows[1] - e4.overflows[1])[0]) ? void 0 : B.placement;
374
- if (!n3)
375
- switch (p3) {
376
- case "bestFit": {
377
- var C2;
378
- const t3 = null == (C2 = L3.map((t4) => [t4.placement, t4.overflows.filter((t5) => t5 > 0).reduce((t5, e4) => t5 + e4, 0)]).sort((t4, e4) => t4[1] - e4[1])[0]) ? void 0 : C2[0];
379
- t3 && (n3 = t3);
380
- break;
381
- }
382
- case "initialPlacement":
383
- n3 = c3;
384
- }
385
- if (r3 !== n3)
386
- return { reset: { placement: n3 } };
387
- }
388
- return {};
389
- } };
390
- };
391
- var O = function(e2) {
392
- return void 0 === e2 && (e2 = 0), { name: "offset", options: e2, async fn(i3) {
393
- const { x: r3, y: a3 } = i3, l3 = await async function(e3, i4) {
394
- const { placement: r4, platform: a4, elements: l4 } = e3, s3 = await (null == a4.isRTL ? void 0 : a4.isRTL(l4.floating)), c3 = n(r4), f3 = t(r4), m3 = "x" === o(r4), u3 = ["left", "top"].includes(c3) ? -1 : 1, g3 = s3 && m3 ? -1 : 1, d3 = "function" == typeof i4 ? i4(e3) : i4;
395
- let { mainAxis: p3, crossAxis: h3, alignmentAxis: y3 } = "number" == typeof d3 ? { mainAxis: d3, crossAxis: 0, alignmentAxis: null } : { mainAxis: 0, crossAxis: 0, alignmentAxis: null, ...d3 };
396
- return f3 && "number" == typeof y3 && (h3 = "end" === f3 ? -1 * y3 : y3), m3 ? { x: h3 * g3, y: p3 * u3 } : { x: p3 * u3, y: h3 * g3 };
397
- }(i3, e2);
398
- return { x: r3 + l3.x, y: a3 + l3.y, data: l3 };
399
- } };
400
- };
401
- function E(t2) {
402
- return "x" === t2 ? "y" : "x";
403
- }
404
- var D = function(t2) {
405
- return void 0 === t2 && (t2 = {}), { name: "shift", options: t2, async fn(e2) {
406
- const { x: i3, y: r3, placement: a3 } = e2, { mainAxis: l3 = true, crossAxis: c3 = false, limiter: f3 = { fn: (t3) => {
407
- let { x: e3, y: n3 } = t3;
408
- return { x: e3, y: n3 };
409
- } }, ...u3 } = t2, g3 = { x: i3, y: r3 }, d3 = await s(e2, u3), p3 = o(n(a3)), h3 = E(p3);
410
- let y3 = g3[p3], x3 = g3[h3];
411
- if (l3) {
412
- const t3 = "y" === p3 ? "bottom" : "right";
413
- y3 = m(y3 + d3["y" === p3 ? "top" : "left"], y3, y3 - d3[t3]);
414
- }
415
- if (c3) {
416
- const t3 = "y" === h3 ? "bottom" : "right";
417
- x3 = m(x3 + d3["y" === h3 ? "top" : "left"], x3, x3 - d3[t3]);
418
- }
419
- const w3 = f3.fn({ ...e2, [p3]: y3, [h3]: x3 });
420
- return { ...w3, data: { x: w3.x - i3, y: w3.y - r3 } };
421
- } };
422
- };
423
-
424
- // node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs
425
- function n2(t2) {
426
- var e2;
427
- return (null == (e2 = t2.ownerDocument) ? void 0 : e2.defaultView) || window;
428
- }
429
- function o2(t2) {
430
- return n2(t2).getComputedStyle(t2);
431
- }
432
- var i2 = Math.min;
433
- var r2 = Math.max;
434
- var l2 = Math.round;
435
- function c2(t2) {
436
- const e2 = o2(t2);
437
- let n3 = parseFloat(e2.width), i3 = parseFloat(e2.height);
438
- const r3 = t2.offsetWidth, c3 = t2.offsetHeight, s3 = l2(n3) !== r3 || l2(i3) !== c3;
439
- return s3 && (n3 = r3, i3 = c3), { width: n3, height: i3, fallback: s3 };
440
- }
441
- function s2(t2) {
442
- return h2(t2) ? (t2.nodeName || "").toLowerCase() : "";
443
- }
444
- var f2;
445
- function u2() {
446
- if (f2)
447
- return f2;
448
- const t2 = navigator.userAgentData;
449
- return t2 && Array.isArray(t2.brands) ? (f2 = t2.brands.map((t3) => t3.brand + "/" + t3.version).join(" "), f2) : navigator.userAgent;
450
- }
451
- function a2(t2) {
452
- return t2 instanceof n2(t2).HTMLElement;
453
- }
454
- function d2(t2) {
455
- return t2 instanceof n2(t2).Element;
456
- }
457
- function h2(t2) {
458
- return t2 instanceof n2(t2).Node;
459
- }
460
- function p2(t2) {
461
- if ("undefined" == typeof ShadowRoot)
462
- return false;
463
- return t2 instanceof n2(t2).ShadowRoot || t2 instanceof ShadowRoot;
464
- }
465
- function g2(t2) {
466
- const { overflow: e2, overflowX: n3, overflowY: i3, display: r3 } = o2(t2);
467
- return /auto|scroll|overlay|hidden|clip/.test(e2 + i3 + n3) && !["inline", "contents"].includes(r3);
468
- }
469
- function m2(t2) {
470
- return ["table", "td", "th"].includes(s2(t2));
471
- }
472
- function y2(t2) {
473
- const e2 = /firefox/i.test(u2()), n3 = o2(t2), i3 = n3.backdropFilter || n3.WebkitBackdropFilter;
474
- return "none" !== n3.transform || "none" !== n3.perspective || !!i3 && "none" !== i3 || e2 && "filter" === n3.willChange || e2 && !!n3.filter && "none" !== n3.filter || ["transform", "perspective"].some((t3) => n3.willChange.includes(t3)) || ["paint", "layout", "strict", "content"].some((t3) => {
475
- const e3 = n3.contain;
476
- return null != e3 && e3.includes(t3);
477
- });
478
- }
479
- function x2() {
480
- return /^((?!chrome|android).)*safari/i.test(u2());
481
- }
482
- function w2(t2) {
483
- return ["html", "body", "#document"].includes(s2(t2));
484
- }
485
- function v2(t2) {
486
- return d2(t2) ? t2 : t2.contextElement;
487
- }
488
- var b2 = { x: 1, y: 1 };
489
- function L2(t2) {
490
- const e2 = v2(t2);
491
- if (!a2(e2))
492
- return b2;
493
- const n3 = e2.getBoundingClientRect(), { width: o3, height: i3, fallback: r3 } = c2(e2);
494
- let s3 = (r3 ? l2(n3.width) : n3.width) / o3, f3 = (r3 ? l2(n3.height) : n3.height) / i3;
495
- return s3 && Number.isFinite(s3) || (s3 = 1), f3 && Number.isFinite(f3) || (f3 = 1), { x: s3, y: f3 };
496
- }
497
- function E2(e2, o3, i3, r3) {
498
- var l3, c3;
499
- void 0 === o3 && (o3 = false), void 0 === i3 && (i3 = false);
500
- const s3 = e2.getBoundingClientRect(), f3 = v2(e2);
501
- let u3 = b2;
502
- o3 && (r3 ? d2(r3) && (u3 = L2(r3)) : u3 = L2(e2));
503
- const a3 = f3 ? n2(f3) : window, h3 = x2() && i3;
504
- let p3 = (s3.left + (h3 && (null == (l3 = a3.visualViewport) ? void 0 : l3.offsetLeft) || 0)) / u3.x, g3 = (s3.top + (h3 && (null == (c3 = a3.visualViewport) ? void 0 : c3.offsetTop) || 0)) / u3.y, m3 = s3.width / u3.x, y3 = s3.height / u3.y;
505
- if (f3) {
506
- const t2 = n2(f3), e3 = r3 && d2(r3) ? n2(r3) : r3;
507
- let o4 = t2.frameElement;
508
- for (; o4 && r3 && e3 !== t2; ) {
509
- const t3 = L2(o4), e4 = o4.getBoundingClientRect(), i4 = getComputedStyle(o4);
510
- e4.x += (o4.clientLeft + parseFloat(i4.paddingLeft)) * t3.x, e4.y += (o4.clientTop + parseFloat(i4.paddingTop)) * t3.y, p3 *= t3.x, g3 *= t3.y, m3 *= t3.x, y3 *= t3.y, p3 += e4.x, g3 += e4.y, o4 = n2(o4).frameElement;
511
- }
512
- }
513
- return l({ width: m3, height: y3, x: p3, y: g3 });
514
- }
515
- function R(t2) {
516
- return ((h2(t2) ? t2.ownerDocument : t2.document) || window.document).documentElement;
517
- }
518
- function T2(t2) {
519
- return d2(t2) ? { scrollLeft: t2.scrollLeft, scrollTop: t2.scrollTop } : { scrollLeft: t2.pageXOffset, scrollTop: t2.pageYOffset };
520
- }
521
- function C(t2) {
522
- return E2(R(t2)).left + T2(t2).scrollLeft;
523
- }
524
- function F(t2) {
525
- if ("html" === s2(t2))
526
- return t2;
527
- const e2 = t2.assignedSlot || t2.parentNode || p2(t2) && t2.host || R(t2);
528
- return p2(e2) ? e2.host : e2;
529
- }
530
- function W(t2) {
531
- const e2 = F(t2);
532
- return w2(e2) ? e2.ownerDocument.body : a2(e2) && g2(e2) ? e2 : W(e2);
533
- }
534
- function D2(t2, e2) {
535
- var o3;
536
- void 0 === e2 && (e2 = []);
537
- const i3 = W(t2), r3 = i3 === (null == (o3 = t2.ownerDocument) ? void 0 : o3.body), l3 = n2(i3);
538
- return r3 ? e2.concat(l3, l3.visualViewport || [], g2(i3) ? i3 : []) : e2.concat(i3, D2(i3));
539
- }
540
- function S(e2, i3, l3) {
541
- let c3;
542
- if ("viewport" === i3)
543
- c3 = function(t2, e3) {
544
- const o3 = n2(t2), i4 = R(t2), r3 = o3.visualViewport;
545
- let l4 = i4.clientWidth, c4 = i4.clientHeight, s4 = 0, f4 = 0;
546
- if (r3) {
547
- l4 = r3.width, c4 = r3.height;
548
- const t3 = x2();
549
- (!t3 || t3 && "fixed" === e3) && (s4 = r3.offsetLeft, f4 = r3.offsetTop);
550
- }
551
- return { width: l4, height: c4, x: s4, y: f4 };
552
- }(e2, l3);
553
- else if ("document" === i3)
554
- c3 = function(t2) {
555
- const e3 = R(t2), n3 = T2(t2), i4 = t2.ownerDocument.body, l4 = r2(e3.scrollWidth, e3.clientWidth, i4.scrollWidth, i4.clientWidth), c4 = r2(e3.scrollHeight, e3.clientHeight, i4.scrollHeight, i4.clientHeight);
556
- let s4 = -n3.scrollLeft + C(t2);
557
- const f4 = -n3.scrollTop;
558
- return "rtl" === o2(i4).direction && (s4 += r2(e3.clientWidth, i4.clientWidth) - l4), { width: l4, height: c4, x: s4, y: f4 };
559
- }(R(e2));
560
- else if (d2(i3))
561
- c3 = function(t2, e3) {
562
- const n3 = E2(t2, true, "fixed" === e3), o3 = n3.top + t2.clientTop, i4 = n3.left + t2.clientLeft, r3 = a2(t2) ? L2(t2) : { x: 1, y: 1 };
563
- return { width: t2.clientWidth * r3.x, height: t2.clientHeight * r3.y, x: i4 * r3.x, y: o3 * r3.y };
564
- }(i3, l3);
565
- else {
566
- const t2 = { ...i3 };
567
- if (x2()) {
568
- var s3, f3;
569
- const o3 = n2(e2);
570
- t2.x -= (null == (s3 = o3.visualViewport) ? void 0 : s3.offsetLeft) || 0, t2.y -= (null == (f3 = o3.visualViewport) ? void 0 : f3.offsetTop) || 0;
571
- }
572
- c3 = t2;
573
- }
574
- return l(c3);
575
- }
576
- function A(t2, e2) {
577
- return a2(t2) && "fixed" !== o2(t2).position ? e2 ? e2(t2) : t2.offsetParent : null;
578
- }
579
- function H(t2, e2) {
580
- const i3 = n2(t2);
581
- if (!a2(t2))
582
- return i3;
583
- let r3 = A(t2, e2);
584
- for (; r3 && m2(r3) && "static" === o2(r3).position; )
585
- r3 = A(r3, e2);
586
- return r3 && ("html" === s2(r3) || "body" === s2(r3) && "static" === o2(r3).position && !y2(r3)) ? i3 : r3 || function(t3) {
587
- let e3 = F(t3);
588
- for (; a2(e3) && !w2(e3); ) {
589
- if (y2(e3))
590
- return e3;
591
- e3 = F(e3);
592
- }
593
- return null;
594
- }(t2) || i3;
595
- }
596
- function V(t2, e2, n3) {
597
- const o3 = a2(e2), i3 = R(e2), r3 = E2(t2, true, "fixed" === n3, e2);
598
- let l3 = { scrollLeft: 0, scrollTop: 0 };
599
- const c3 = { x: 0, y: 0 };
600
- if (o3 || !o3 && "fixed" !== n3)
601
- if (("body" !== s2(e2) || g2(i3)) && (l3 = T2(e2)), a2(e2)) {
602
- const t3 = E2(e2, true);
603
- c3.x = t3.x + e2.clientLeft, c3.y = t3.y + e2.clientTop;
604
- } else
605
- i3 && (c3.x = C(i3));
606
- return { x: r3.left + l3.scrollLeft - c3.x, y: r3.top + l3.scrollTop - c3.y, width: r3.width, height: r3.height };
607
- }
608
- var O2 = { getClippingRect: function(t2) {
609
- let { element: e2, boundary: n3, rootBoundary: l3, strategy: c3 } = t2;
610
- const f3 = "clippingAncestors" === n3 ? function(t3, e3) {
611
- const n4 = e3.get(t3);
612
- if (n4)
613
- return n4;
614
- let i3 = D2(t3).filter((t4) => d2(t4) && "body" !== s2(t4)), r3 = null;
615
- const l4 = "fixed" === o2(t3).position;
616
- let c4 = l4 ? F(t3) : t3;
617
- for (; d2(c4) && !w2(c4); ) {
618
- const t4 = o2(c4), e4 = y2(c4);
619
- "fixed" === t4.position ? r3 = null : (l4 ? e4 || r3 : e4 || "static" !== t4.position || !r3 || !["absolute", "fixed"].includes(r3.position)) ? r3 = t4 : i3 = i3.filter((t5) => t5 !== c4), c4 = F(c4);
620
- }
621
- return e3.set(t3, i3), i3;
622
- }(e2, this._c) : [].concat(n3), u3 = [...f3, l3], a3 = u3[0], h3 = u3.reduce((t3, n4) => {
623
- const o3 = S(e2, n4, c3);
624
- return t3.top = r2(o3.top, t3.top), t3.right = i2(o3.right, t3.right), t3.bottom = i2(o3.bottom, t3.bottom), t3.left = r2(o3.left, t3.left), t3;
625
- }, S(e2, a3, c3));
626
- return { width: h3.right - h3.left, height: h3.bottom - h3.top, x: h3.left, y: h3.top };
627
- }, convertOffsetParentRelativeRectToViewportRelativeRect: function(t2) {
628
- let { rect: e2, offsetParent: n3, strategy: o3 } = t2;
629
- const i3 = a2(n3), r3 = R(n3);
630
- if (n3 === r3)
631
- return e2;
632
- let l3 = { scrollLeft: 0, scrollTop: 0 }, c3 = { x: 1, y: 1 };
633
- const f3 = { x: 0, y: 0 };
634
- if ((i3 || !i3 && "fixed" !== o3) && (("body" !== s2(n3) || g2(r3)) && (l3 = T2(n3)), a2(n3))) {
635
- const t3 = E2(n3);
636
- c3 = L2(n3), f3.x = t3.x + n3.clientLeft, f3.y = t3.y + n3.clientTop;
637
- }
638
- return { width: e2.width * c3.x, height: e2.height * c3.y, x: e2.x * c3.x - l3.scrollLeft * c3.x + f3.x, y: e2.y * c3.y - l3.scrollTop * c3.y + f3.y };
639
- }, isElement: d2, getDimensions: function(t2) {
640
- return a2(t2) ? c2(t2) : t2.getBoundingClientRect();
641
- }, getOffsetParent: H, getDocumentElement: R, getScale: L2, async getElementRects(t2) {
642
- let { reference: e2, floating: n3, strategy: o3 } = t2;
643
- const i3 = this.getOffsetParent || H, r3 = this.getDimensions;
644
- return { reference: V(e2, await i3(n3), o3), floating: { x: 0, y: 0, ...await r3(n3) } };
645
- }, getClientRects: (t2) => Array.from(t2.getClientRects()), isRTL: (t2) => "rtl" === o2(t2).direction };
646
- var z = (t2, n3, o3) => {
647
- const i3 = /* @__PURE__ */ new Map(), r3 = { platform: O2, ...o3 }, l3 = { ...r3.platform, _c: i3 };
648
- return r(t2, n3, { ...r3, platform: l3 });
649
- };
650
-
651
188
  // src/utils/compute-positions.ts
189
+ var import_dom = __require("@floating-ui/dom");
652
190
  var computeTooltipPosition = async ({
653
191
  elementReference = null,
654
192
  tooltipReference = null,
@@ -656,7 +194,7 @@
656
194
  place = "top",
657
195
  offset: offsetValue = 10,
658
196
  strategy = "absolute",
659
- middlewares = [O(Number(offsetValue)), b(), D({ padding: 5 })]
197
+ middlewares = [(0, import_dom.offset)(Number(offsetValue)), (0, import_dom.flip)(), (0, import_dom.shift)({ padding: 5 })]
660
198
  }) => {
661
199
  if (!elementReference) {
662
200
  return { tooltipStyles: {}, tooltipArrowStyles: {}, place };
@@ -666,14 +204,14 @@
666
204
  }
667
205
  const middleware = middlewares;
668
206
  if (tooltipArrowReference) {
669
- middleware.push(u({ element: tooltipArrowReference, padding: 5 }));
670
- return z(elementReference, tooltipReference, {
207
+ middleware.push((0, import_dom.arrow)({ element: tooltipArrowReference, padding: 5 }));
208
+ return (0, import_dom.computePosition)(elementReference, tooltipReference, {
671
209
  placement: place,
672
210
  strategy,
673
211
  middleware
674
- }).then(({ x: x3, y: y3, placement, middlewareData }) => {
212
+ }).then(({ x, y, placement, middlewareData }) => {
675
213
  var _a, _b;
676
- const styles = { left: `${x3}px`, top: `${y3}px` };
214
+ const styles = { left: `${x}px`, top: `${y}px` };
677
215
  const { x: arrowX, y: arrowY } = (_a = middlewareData.arrow) != null ? _a : { x: 0, y: 0 };
678
216
  const staticSide = (_b = {
679
217
  top: "bottom",
@@ -691,12 +229,12 @@
691
229
  return { tooltipStyles: styles, tooltipArrowStyles: arrowStyle, place: placement };
692
230
  });
693
231
  }
694
- return z(elementReference, tooltipReference, {
232
+ return (0, import_dom.computePosition)(elementReference, tooltipReference, {
695
233
  placement: "bottom",
696
234
  strategy,
697
235
  middleware
698
- }).then(({ x: x3, y: y3, placement }) => {
699
- const styles = { left: `${x3}px`, top: `${y3}px` };
236
+ }).then(({ x, y, placement }) => {
237
+ const styles = { left: `${x}px`, top: `${y}px` };
700
238
  return { tooltipStyles: styles, tooltipArrowStyles: {}, place: placement };
701
239
  });
702
240
  };
@@ -715,7 +253,7 @@
715
253
  anchorId,
716
254
  anchorSelect,
717
255
  place = "top",
718
- offset = 10,
256
+ offset: offset2 = 10,
719
257
  events = ["hover"],
720
258
  openOnClick = false,
721
259
  positionStrategy = "absolute",
@@ -861,24 +399,24 @@
861
399
  clearTimeout(tooltipShowDelayTimerRef.current);
862
400
  }
863
401
  };
864
- const handleTooltipPosition = ({ x: x3, y: y3 }) => {
402
+ const handleTooltipPosition = ({ x, y }) => {
865
403
  const virtualElement = {
866
404
  getBoundingClientRect() {
867
405
  return {
868
- x: x3,
869
- y: y3,
406
+ x,
407
+ y,
870
408
  width: 0,
871
409
  height: 0,
872
- top: y3,
873
- left: x3,
874
- right: x3,
875
- bottom: y3
410
+ top: y,
411
+ left: x,
412
+ right: x,
413
+ bottom: y
876
414
  };
877
415
  }
878
416
  };
879
417
  computeTooltipPosition({
880
418
  place,
881
- offset,
419
+ offset: offset2,
882
420
  elementReference: virtualElement,
883
421
  tooltipReference: tooltipRef.current,
884
422
  tooltipArrowReference: tooltipArrowRef.current,
@@ -1020,7 +558,8 @@
1020
558
  if (activeAnchor) {
1021
559
  ;
1022
560
  [...mutation.removedNodes].some((node) => {
1023
- if (node.contains(activeAnchor)) {
561
+ var _a;
562
+ if ((_a = node == null ? void 0 : node.contains) == null ? void 0 : _a.call(node, activeAnchor)) {
1024
563
  setRendered(false);
1025
564
  handleShow(false);
1026
565
  setActiveAnchor(null);
@@ -1044,7 +583,7 @@
1044
583
  (element) => [...element.querySelectorAll(selector)]
1045
584
  )
1046
585
  );
1047
- } catch (e2) {
586
+ } catch (e) {
1048
587
  }
1049
588
  });
1050
589
  if (newAnchors.length) {
@@ -1075,7 +614,7 @@
1075
614
  }
1076
615
  computeTooltipPosition({
1077
616
  place,
1078
- offset,
617
+ offset: offset2,
1079
618
  elementReference: activeAnchor,
1080
619
  tooltipReference: tooltipRef.current,
1081
620
  tooltipArrowReference: tooltipArrowRef.current,
@@ -1093,7 +632,7 @@
1093
632
  }
1094
633
  setActualPlacement(computedStylesData.place);
1095
634
  });
1096
- }, [show, activeAnchor, content, place, offset, positionStrategy, position]);
635
+ }, [show, activeAnchor, content, place, offset2, positionStrategy, position]);
1097
636
  (0, import_react4.useEffect)(() => {
1098
637
  var _a;
1099
638
  const anchorById = document.querySelector(`[id='${anchorId}']`);
@@ -1123,7 +662,7 @@
1123
662
  try {
1124
663
  const anchors = Array.from(document.querySelectorAll(selector));
1125
664
  setAnchorsBySelect(anchors);
1126
- } catch (e2) {
665
+ } catch (e) {
1127
666
  setAnchorsBySelect([]);
1128
667
  }
1129
668
  }, [id, anchorSelect]);
@@ -1189,7 +728,7 @@
1189
728
  classNameArrow,
1190
729
  variant = "dark",
1191
730
  place = "top",
1192
- offset = 10,
731
+ offset: offset2 = 10,
1193
732
  wrapper = "div",
1194
733
  children = null,
1195
734
  events = ["hover"],
@@ -1213,7 +752,7 @@
1213
752
  const [tooltipHtml, setTooltipHtml] = (0, import_react5.useState)(html);
1214
753
  const [tooltipPlace, setTooltipPlace] = (0, import_react5.useState)(place);
1215
754
  const [tooltipVariant, setTooltipVariant] = (0, import_react5.useState)(variant);
1216
- const [tooltipOffset, setTooltipOffset] = (0, import_react5.useState)(offset);
755
+ const [tooltipOffset, setTooltipOffset] = (0, import_react5.useState)(offset2);
1217
756
  const [tooltipDelayShow, setTooltipDelayShow] = (0, import_react5.useState)(delayShow);
1218
757
  const [tooltipDelayHide, setTooltipDelayHide] = (0, import_react5.useState)(delayHide);
1219
758
  const [tooltipFloat, setTooltipFloat] = (0, import_react5.useState)(float);
@@ -1248,7 +787,7 @@
1248
787
  setTooltipVariant(value != null ? value : variant);
1249
788
  },
1250
789
  offset: (value) => {
1251
- setTooltipOffset(value === null ? offset : Number(value));
790
+ setTooltipOffset(value === null ? offset2 : Number(value));
1252
791
  },
1253
792
  wrapper: (value) => {
1254
793
  setTooltipWrapper(value != null ? value : wrapper);
@@ -1298,7 +837,7 @@
1298
837
  anchorsBySelect.forEach((anchor) => {
1299
838
  elementRefs.add({ current: anchor });
1300
839
  });
1301
- } catch (e2) {
840
+ } catch (e) {
1302
841
  if (true) {
1303
842
  console.warn(`[react-tooltip] "${anchorSelect}" is not a valid CSS selector`);
1304
843
  }
@@ -1376,13 +915,4 @@
1376
915
  };
1377
916
  var TooltipController_default = TooltipController;
1378
917
  })();
1379
- /*! Bundled license information:
1380
-
1381
- classnames/index.js:
1382
- (*!
1383
- Copyright (c) 2018 Jed Watson.
1384
- Licensed under the MIT License (MIT), see
1385
- http://jedwatson.github.io/classnames
1386
- *)
1387
- */
1388
918
  //# sourceMappingURL=react-tooltip.iife.js.map