New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-tooltip

Package Overview
Dependencies
Maintainers
6
Versions
347
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-tooltip - npm Package Compare versions

Comparing version 5.18.1 to 5.19.0-beta.1052.0

10

dist/react-tooltip.d.ts

@@ -101,2 +101,3 @@ import React, { ElementType, ReactNode, CSSProperties, PropsWithChildren } from 'react';

isOpen?: boolean
disableStyleInjection?: boolean | 'core'
/**

@@ -157,3 +158,3 @@ * @description see https://developer.mozilla.org/en-US/docs/Web/CSS/border.

declare const TooltipController: ({ id, anchorId, anchorSelect, content, html, render, className, classNameArrow, variant, place, offset, wrapper, children, events, openOnClick, positionStrategy, middlewares, delayShow, delayHide, float, hidden, noArrow, clickable, closeOnEsc, closeOnScroll, closeOnResize, style, position, isOpen, border, opacity, setIsOpen, afterShow, afterHide, }: ITooltipController) => JSX.Element;
declare const TooltipController: ({ id, anchorId, anchorSelect, content, html, render, className, classNameArrow, variant, place, offset, wrapper, children, events, openOnClick, positionStrategy, middlewares, delayShow, delayHide, float, hidden, noArrow, clickable, closeOnEsc, closeOnScroll, closeOnResize, style, position, isOpen, disableStyleInjection, border, opacity, setIsOpen, afterShow, afterHide, }: ITooltipController) => JSX.Element;

@@ -172,7 +173,2 @@ /**

declare function removeStyle({ type, id, }?: {
type?: string;
id?: string;
}): void;
export { ChildrenType, DataAttribute, EventsType, IPosition, ITooltipController as ITooltip, ITooltipWrapper, Middleware, PlacesType, PositionStrategy, TooltipController as Tooltip, TooltipProvider, TooltipWrapper, VariantType, WrapperType, removeStyle };
export { ChildrenType, DataAttribute, EventsType, IPosition, ITooltipController as ITooltip, ITooltipWrapper, Middleware, PlacesType, PositionStrategy, TooltipController as Tooltip, TooltipProvider, TooltipWrapper, VariantType, WrapperType };

@@ -23,16 +23,7 @@

const REACT_TOOLTIP_BASE_STYLES_ID = 'react-tooltip-base-styles';
const injected = {
core: false,
base: false,
};
function injectStyle({ css, id = REACT_TOOLTIP_BASE_STYLES_ID, type = 'base', ref, }) {
var _a, _b, _c, _d;
if (type === 'core' &&
typeof process !== 'undefined' && // this validation prevents docs from breaking even with `process?`
(((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.REACT_TOOLTIP_DISABLE_CORE_STYLES) ||
((_b = process === null || process === void 0 ? void 0 : process.env) === null || _b === void 0 ? void 0 : _b.REACT_APP_REACT_TOOLTIP_DISABLE_CORE_STYLES))) {
return;
}
if (type !== 'core' &&
typeof process !== 'undefined' && // this validation prevents docs from breaking even with `process?`
(((_c = process === null || process === void 0 ? void 0 : process.env) === null || _c === void 0 ? void 0 : _c.REACT_TOOLTIP_DISABLE_BASE_STYLES) ||
((_d = process === null || process === void 0 ? void 0 : process.env) === null || _d === void 0 ? void 0 : _d.REACT_APP_REACT_TOOLTIP_DISABLE_BASE_STYLES))) {
return;
}
if (type === 'core') {

@@ -47,5 +38,13 @@ // eslint-disable-next-line no-param-reassign

const { insertAt } = ref;
if (!css || typeof document === 'undefined' || document.getElementById(id)) {
if (!css || typeof document === 'undefined' || injected[type]) {
return;
}
if (document.getElementById(id)) {
// this should never happen because of `injected[type]`
{
// eslint-disable-next-line no-console
console.warn(`[react-tooltip] Element with id '${id}' already exists. Call \`removeStyle()\` first`);
}
return;
}
const head = document.head || document.getElementsByTagName('head')[0];

@@ -73,11 +72,4 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any

}
injected[type] = true;
}
function removeStyle({ type = 'base', id = REACT_TOOLTIP_BASE_STYLES_ID, } = {}) {
if (type === 'core') {
// eslint-disable-next-line no-param-reassign
id = REACT_TOOLTIP_CORE_STYLES_ID;
}
const style = document.getElementById(id);
style === null || style === void 0 ? void 0 : style.remove();
}

@@ -836,3 +828,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

const TooltipController = ({ id, anchorId, anchorSelect, content, html, render, className, classNameArrow, variant = 'dark', place = 'top', offset = 10, wrapper = 'div', children = null, events = ['hover'], openOnClick = false, positionStrategy = 'absolute', middlewares, delayShow = 0, delayHide = 0, float = false, hidden = false, noArrow = false, clickable = false, closeOnEsc = false, closeOnScroll = false, closeOnResize = false, style, position, isOpen, border, opacity, setIsOpen, afterShow, afterHide, }) => {
const TooltipController = ({ id, anchorId, anchorSelect, content, html, render, className, classNameArrow, variant = 'dark', place = 'top', offset = 10, wrapper = 'div', children = null, events = ['hover'], openOnClick = false, positionStrategy = 'absolute', middlewares, delayShow = 0, delayHide = 0, float = false, hidden = false, noArrow = false, clickable = false, closeOnEsc = false, closeOnScroll = false, closeOnResize = false, style, position, isOpen, disableStyleInjection = false, border, opacity, setIsOpen, afterShow, afterHide, }) => {
const [tooltipContent, setTooltipContent] = React.useState(content);

@@ -851,2 +843,3 @@ const [tooltipHtml, setTooltipHtml] = React.useState(html);

const [activeAnchor, setActiveAnchor] = React.useState(null);
const styleInjectionRef = React.useRef(disableStyleInjection);
/**

@@ -950,2 +943,21 @@ * @todo Remove this in a future version (provider/wrapper method is deprecated)

React.useEffect(() => {
if (styleInjectionRef.current === disableStyleInjection) {
return;
}
{
// eslint-disable-next-line no-console
console.warn('[react-tooltip] Do not change `disableStyleInjection` dynamically.');
}
}, [disableStyleInjection]);
React.useEffect(() => {
if (typeof window !== 'undefined') {
window.dispatchEvent(new CustomEvent('react-tooltip-inject-styles', {
detail: {
disableCore: disableStyleInjection === 'core',
disableBase: disableStyleInjection,
},
}));
}
}, []);
React.useEffect(() => {
var _a;

@@ -1172,4 +1184,12 @@ const elementRefs = new Set(anchorRefs);

`;
injectStyle({ css: TooltipCoreStyles, type: 'core' });
injectStyle({ css: TooltipStyles });
if (typeof window !== 'undefined') {
window.addEventListener('react-tooltip-inject-styles', ((event) => {
if (!event.detail.disableCore) {
injectStyle({ css: TooltipCoreStyles, type: 'core' });
}
if (!event.detail.disableBase) {
injectStyle({ css: TooltipStyles, type: 'base' });
}
}));
}

@@ -1179,3 +1199,2 @@ exports.Tooltip = TooltipController;

exports.TooltipWrapper = TooltipWrapper;
exports.removeStyle = removeStyle;

@@ -1182,0 +1201,0 @@ Object.defineProperty(exports, '__esModule', { value: true });

@@ -7,3 +7,3 @@ /*

*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("classnames"),require("@floating-ui/dom")):"function"==typeof define&&define.amd?define(["exports","react","classnames","@floating-ui/dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactTooltip={},e.React,e.classNames,e.FloatingUIDOM)}(this,(function(e,t,o,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=n(t),s=n(o);const c="react-tooltip-core-styles",i="react-tooltip-base-styles";function a({css:e,id:t=i,type:o="base",ref:r}){var n,l,s,a;if("core"===o&&"undefined"!=typeof process&&((null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_CORE_STYLES)||(null===(l=null===process||void 0===process?void 0:process.env)||void 0===l?void 0:l.REACT_APP_REACT_TOOLTIP_DISABLE_CORE_STYLES)))return;if("core"!==o&&"undefined"!=typeof process&&((null===(s=null===process||void 0===process?void 0:process.env)||void 0===s?void 0:s.REACT_TOOLTIP_DISABLE_BASE_STYLES)||(null===(a=null===process||void 0===process?void 0:process.env)||void 0===a?void 0:a.REACT_APP_REACT_TOOLTIP_DISABLE_BASE_STYLES)))return;"core"===o&&(t=c),r||(r={});const{insertAt:u}=r;if(!e||"undefined"==typeof document||document.getElementById(t))return;const d=document.head||document.getElementsByTagName("head")[0],p=document.createElement("style");p.id=t,p.type="text/css","top"===u&&d.firstChild?d.insertBefore(p,d.firstChild):d.appendChild(p),p.styleSheet?p.styleSheet.cssText=e:p.appendChild(document.createTextNode(e))}const u=(e,t,o)=>{let r=null;return function(...n){const l=()=>{r=null,o||e.apply(this,n)};o&&!r&&(e.apply(this,n),r=setTimeout(l,t)),o||(r&&clearTimeout(r),r=setTimeout(l,t))}},d="DEFAULT_TOOLTIP_ID",p={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},f={getTooltipData:()=>p},v=t.createContext(f);function m(e=d){return t.useContext(v).getTooltipData(e)}const y="undefined"!=typeof window?t.useLayoutEffect:t.useEffect,h=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return"auto"===o||"scroll"===o}))},E=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(h(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},S=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:o=null,place:n="top",offset:l=10,strategy:s="absolute",middlewares:c=[r.offset(Number(l)),r.flip(),r.shift({padding:5})],border:i})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};const a=c;return o?(a.push(r.arrow({element:o,padding:5})),r.computePosition(e,t,{placement:n,strategy:s,middleware:a}).then((({x:e,y:t,placement:o,middlewareData:r})=>{var n,l;const s={left:`${e}px`,top:`${t}px`,border:i},{x:c,y:a}=null!==(n=r.arrow)&&void 0!==n?n:{x:0,y:0},u=null!==(l={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==l?l:"bottom",d=i&&{top:{borderBottom:i,borderRight:i},right:{borderBottom:i,borderLeft:i},bottom:{borderTop:i,borderLeft:i},left:{borderTop:i,borderRight:i}}[o.split("-")[0]];let p=0;if(i){const e=`${i}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:s,tooltipArrowStyles:{left:null!=c?`${c}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:o}}))):r.computePosition(e,t,{placement:"bottom",strategy:s,middleware:a}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))};var w="core-styles-module_tooltip__3vRRp",b="core-styles-module_fixed__pcSol",_="core-styles-module_arrow__cvMwQ",T="core-styles-module_noArrow__xock6",A="core-styles-module_clickable__ZuTTB",g="core-styles-module_show__Nt9eE",R={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const O=({id:e,className:o,classNameArrow:r,variant:n="dark",anchorId:c,anchorSelect:i,place:a="top",offset:d=10,events:p=["hover"],openOnClick:f=!1,positionStrategy:v="absolute",middlewares:h,wrapper:O,delayShow:L=0,delayHide:x=0,float:N=!1,hidden:k=!1,noArrow:C=!1,clickable:I=!1,closeOnEsc:$=!1,closeOnScroll:B=!1,closeOnResize:P=!1,style:D,position:j,afterShow:q,afterHide:H,content:M,contentWrapperRef:W,isOpen:z,setIsOpen:Y,activeAnchor:U,setActiveAnchor:F,border:K,opacity:X})=>{const V=t.useRef(null),Z=t.useRef(null),G=t.useRef(null),J=t.useRef(null),[Q,ee]=t.useState(a),[te,oe]=t.useState({}),[re,ne]=t.useState({}),[le,se]=t.useState(!1),[ce,ie]=t.useState(!1),ae=t.useRef(!1),ue=t.useRef(null),{anchorRefs:de,setActiveAnchor:pe}=m(e),fe=t.useRef(!1),[ve,me]=t.useState([]),ye=t.useRef(!1),he=f||p.includes("click");y((()=>(ye.current=!0,()=>{ye.current=!1})),[]),t.useEffect((()=>{if(!le){const e=setTimeout((()=>{ie(!1)}),150);return()=>{clearTimeout(e)}}return()=>null}),[le]);const Ee=e=>{ye.current&&(e&&ie(!0),setTimeout((()=>{ye.current&&(null==Y||Y(e),void 0===z&&se(e))}),10))};t.useEffect((()=>{if(void 0===z)return()=>null;z&&ie(!0);const e=setTimeout((()=>{se(z)}),10);return()=>{clearTimeout(e)}}),[z]),t.useEffect((()=>{le!==ae.current&&(ae.current=le,le?null==q||q():null==H||H())}),[le]);const Se=(e=x)=>{J.current&&clearTimeout(J.current),J.current=setTimeout((()=>{fe.current||Ee(!1)}),e)},we=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==o?void 0:o.isConnected))return F(null),void pe({current:null});L?(G.current&&clearTimeout(G.current),G.current=setTimeout((()=>{Ee(!0)}),L)):Ee(!0),F(o),pe({current:o}),J.current&&clearTimeout(J.current)},be=()=>{I?Se(x||100):x?Se():Ee(!1),G.current&&clearTimeout(G.current)},_e=({x:e,y:t})=>{S({place:a,offset:d,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:V.current,tooltipArrowReference:Z.current,strategy:v,middlewares:h,border:K}).then((e=>{Object.keys(e.tooltipStyles).length&&oe(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&ne(e.tooltipArrowStyles),ee(e.place)}))},Te=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};_e(o),ue.current=o},Ae=e=>{we(e),x&&Se()},ge=e=>{var t;[document.querySelector(`[id='${c}']`),...ve].some((t=>null==t?void 0:t.contains(e.target)))||(null===(t=V.current)||void 0===t?void 0:t.contains(e.target))||(Ee(!1),G.current&&clearTimeout(G.current))},Re=u(we,50,!0),Oe=u(be,50,!0);t.useEffect((()=>{var e,t;const o=new Set(de);ve.forEach((e=>{o.add({current:e})}));const r=document.querySelector(`[id='${c}']`);r&&o.add({current:r});const n=()=>{Ee(!1)},l=E(U),s=E(V.current);B&&(window.addEventListener("scroll",n),null==l||l.addEventListener("scroll",n),null==s||s.addEventListener("scroll",n)),P&&window.addEventListener("resize",n);const i=e=>{"Escape"===e.key&&Ee(!1)};$&&window.addEventListener("keydown",i);const a=[];he?(window.addEventListener("click",ge),a.push({event:"click",listener:Ae})):(a.push({event:"mouseenter",listener:Re},{event:"mouseleave",listener:Oe},{event:"focus",listener:Re},{event:"blur",listener:Oe}),N&&a.push({event:"mousemove",listener:Te}));const u=()=>{fe.current=!0},d=()=>{fe.current=!1,be()};return I&&!he&&(null===(e=V.current)||void 0===e||e.addEventListener("mouseenter",u),null===(t=V.current)||void 0===t||t.addEventListener("mouseleave",d)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var r;null===(r=o.current)||void 0===r||r.addEventListener(e,t)}))})),()=>{var e,t;B&&(window.removeEventListener("scroll",n),null==l||l.removeEventListener("scroll",n),null==s||s.removeEventListener("scroll",n)),P&&window.removeEventListener("resize",n),he&&window.removeEventListener("click",ge),$&&window.removeEventListener("keydown",i),I&&!he&&(null===(e=V.current)||void 0===e||e.removeEventListener("mouseenter",u),null===(t=V.current)||void 0===t||t.removeEventListener("mouseleave",d)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var r;null===(r=o.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[ce,de,ve,$,p]),t.useEffect((()=>{let t=null!=i?i:"";!t&&e&&(t=`[data-tooltip-id='${e}']`);const o=new MutationObserver((o=>{const r=[];o.forEach((o=>{if("attributes"===o.type&&"data-tooltip-id"===o.attributeName){o.target.getAttribute("data-tooltip-id")===e&&r.push(o.target)}if("childList"===o.type&&(U&&[...o.removedNodes].some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,U))&&(ie(!1),Ee(!1),F(null),G.current&&clearTimeout(G.current),J.current&&clearTimeout(J.current),!0)})),t))try{const e=[...o.addedNodes].filter((e=>1===e.nodeType));r.push(...e.filter((e=>e.matches(t)))),r.push(...e.flatMap((e=>[...e.querySelectorAll(t)])))}catch(e){}})),r.length&&me((e=>[...e,...r]))}));return o.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{o.disconnect()}}),[e,i,U]);const Le=()=>{j?_e(j):N?ue.current&&_e(ue.current):S({place:a,offset:d,elementReference:U,tooltipReference:V.current,tooltipArrowReference:Z.current,strategy:v,middlewares:h,border:K}).then((e=>{ye.current&&(Object.keys(e.tooltipStyles).length&&oe(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&ne(e.tooltipArrowStyles),ee(e.place))}))};t.useEffect((()=>{Le()}),[le,U,M,D,a,d,v,j]),t.useEffect((()=>{if(!(null==W?void 0:W.current))return()=>null;const e=new ResizeObserver((()=>{Le()}));return e.observe(W.current),()=>{e.disconnect()}}),[M,null==W?void 0:W.current]),t.useEffect((()=>{var e;const t=document.querySelector(`[id='${c}']`),o=[...ve,t];U&&o.includes(U)||F(null!==(e=ve[0])&&void 0!==e?e:t)}),[c,ve,U]),t.useEffect((()=>()=>{G.current&&clearTimeout(G.current),J.current&&clearTimeout(J.current)}),[]),t.useEffect((()=>{let t=i;if(!t&&e&&(t=`[data-tooltip-id='${e}']`),t)try{const e=Array.from(document.querySelectorAll(t));me(e)}catch(e){me([])}}),[e,i]);const xe=!k&&M&&le&&Object.keys(te).length>0;return ce?l.default.createElement(O,{id:e,role:"tooltip",className:s.default("react-tooltip",w,R.tooltip,R[n],o,`react-tooltip__place-${Q}`,{[g]:xe,[b]:"fixed"===v,[A]:I}),style:{...D,...te,opacity:void 0!==X&&xe?X:void 0},ref:V},M,l.default.createElement(O,{className:s.default("react-tooltip-arrow",_,R.arrow,r,{[T]:C}),style:re,ref:Z})):null},L=({content:e})=>l.default.createElement("span",{dangerouslySetInnerHTML:{__html:e}});a({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9}.core-styles-module_tooltip__3vRRp{visibility:hidden;position:absolute;top:0;left:0;pointer-events:none;opacity:0;transition:opacity 0.3s ease-out;will-change:opacity,visibility}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{visibility:visible;opacity:var(--rt-opacity)}`,type:"core"}),a({css:`
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px;transform:rotate(45deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`}),e.Tooltip=({id:e,anchorId:o,anchorSelect:r,content:n,html:s,render:c,className:i,classNameArrow:a,variant:u="dark",place:d="top",offset:p=10,wrapper:f="div",children:v=null,events:y=["hover"],openOnClick:h=!1,positionStrategy:E="absolute",middlewares:S,delayShow:w=0,delayHide:b=0,float:_=!1,hidden:T=!1,noArrow:A=!1,clickable:g=!1,closeOnEsc:R=!1,closeOnScroll:x=!1,closeOnResize:N=!1,style:k,position:C,isOpen:I,border:$,opacity:B,setIsOpen:P,afterShow:D,afterHide:j})=>{const[q,H]=t.useState(n),[M,W]=t.useState(s),[z,Y]=t.useState(d),[U,F]=t.useState(u),[K,X]=t.useState(p),[V,Z]=t.useState(w),[G,J]=t.useState(b),[Q,ee]=t.useState(_),[te,oe]=t.useState(T),[re,ne]=t.useState(f),[le,se]=t.useState(y),[ce,ie]=t.useState(E),[ae,ue]=t.useState(null),{anchorRefs:de,activeAnchor:pe}=m(e),fe=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var r;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(o))&&void 0!==r?r:null}return t}),{}),ve=e=>{const t={place:e=>{var t;Y(null!==(t=e)&&void 0!==t?t:d)},content:e=>{H(null!=e?e:n)},html:e=>{W(null!=e?e:s)},variant:e=>{var t;F(null!==(t=e)&&void 0!==t?t:u)},offset:e=>{X(null===e?p:Number(e))},wrapper:e=>{var t;ne(null!==(t=e)&&void 0!==t?t:f)},events:e=>{const t=null==e?void 0:e.split(" ");se(null!=t?t:y)},"position-strategy":e=>{var t;ie(null!==(t=e)&&void 0!==t?t:E)},"delay-show":e=>{Z(null===e?w:Number(e))},"delay-hide":e=>{J(null===e?b:Number(e))},float:e=>{ee(null===e?_:"true"===e)},hidden:e=>{oe(null===e?T:"true"===e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var r;null===(r=t[e])||void 0===r||r.call(t,o)}))};t.useEffect((()=>{H(n)}),[n]),t.useEffect((()=>{W(s)}),[s]),t.useEffect((()=>{Y(d)}),[d]),t.useEffect((()=>{F(u)}),[u]),t.useEffect((()=>{X(p)}),[p]),t.useEffect((()=>{Z(w)}),[w]),t.useEffect((()=>{J(b)}),[b]),t.useEffect((()=>{ee(_)}),[_]),t.useEffect((()=>{oe(T)}),[T]),t.useEffect((()=>{ie(E)}),[E]),t.useEffect((()=>{var t;const n=new Set(de);let l=r;if(!l&&e&&(l=`[data-tooltip-id='${e}']`),l)try{document.querySelectorAll(l).forEach((e=>{n.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${l}" is not a valid CSS selector`)}const s=document.querySelector(`[id='${o}']`);if(s&&n.add({current:s}),!n.size)return()=>null;const c=null!==(t=null!=ae?ae:s)&&void 0!==t?t:pe.current,i=new MutationObserver((e=>{e.forEach((e=>{var t;if(!c||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=fe(c);ve(o)}))})),a={attributes:!0,childList:!1,subtree:!1};if(c){const e=fe(c);ve(e),i.observe(c,a)}return()=>{i.disconnect()}}),[de,pe,ae,o,r]),t.useEffect((()=>{(null==k?void 0:k.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),$&&!CSS.supports("border",`${$}`)&&console.warn(`[react-tooltip] "${$}" is not a valid \`border\`.`),(null==k?void 0:k.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),B&&!CSS.supports("opacity",`${B}`)&&console.warn(`[react-tooltip] "${B}" is not a valid \`opacity\`.`)}),[]);let me=v;const ye=t.useRef(null);if(c){const e=c({content:null!=q?q:null,activeAnchor:ae});me=e?l.default.createElement("div",{ref:ye,className:"react-tooltip-content-wrapper"},e):null}else q&&(me=q);M&&(me=l.default.createElement(L,{content:M}));const he={id:e,anchorId:o,anchorSelect:r,className:i,classNameArrow:a,content:me,contentWrapperRef:ye,place:z,variant:U,offset:K,wrapper:re,events:le,openOnClick:h,positionStrategy:ce,middlewares:S,delayShow:V,delayHide:G,float:Q,hidden:te,noArrow:A,clickable:g,closeOnEsc:R,closeOnScroll:x,closeOnResize:N,style:k,position:C,isOpen:I,border:$,opacity:B,setIsOpen:P,afterShow:D,afterHide:j,activeAnchor:ae,setActiveAnchor:e=>ue(e)};return l.default.createElement(O,{...he})},e.TooltipProvider=({children:e})=>{const[o,r]=t.useState({[d]:new Set}),[n,s]=t.useState({[d]:{current:null}}),c=(e,...t)=>{r((o=>{var r;const n=null!==(r=o[e])&&void 0!==r?r:new Set;return t.forEach((e=>n.add(e))),{...o,[e]:new Set(n)}}))},i=(e,...t)=>{r((o=>{const r=o[e];return r?(t.forEach((e=>r.delete(e))),{...o}):o}))},a=t.useCallback(((e=d)=>{var t,r;return{anchorRefs:null!==(t=o[e])&&void 0!==t?t:new Set,activeAnchor:null!==(r=n[e])&&void 0!==r?r:{current:null},attach:(...t)=>c(e,...t),detach:(...t)=>i(e,...t),setActiveAnchor:t=>((e,t)=>{s((o=>{var r;return(null===(r=o[e])||void 0===r?void 0:r.current)===t.current?o:{...o,[e]:t}}))})(e,t)}}),[o,n,c,i]),u=t.useMemo((()=>({getTooltipData:a})),[a]);return l.default.createElement(v.Provider,{value:u},e)},e.TooltipWrapper=({tooltipId:e,children:o,className:r,place:n,content:c,html:i,variant:a,offset:u,wrapper:d,events:p,positionStrategy:f,delayShow:v,delayHide:y})=>{const{attach:h,detach:E}=m(e),S=t.useRef(null);return t.useEffect((()=>(h(S),()=>{E(S)})),[]),l.default.createElement("span",{ref:S,className:s.default("react-tooltip-wrapper",r),"data-tooltip-place":n,"data-tooltip-content":c,"data-tooltip-html":i,"data-tooltip-variant":a,"data-tooltip-offset":u,"data-tooltip-wrapper":d,"data-tooltip-events":p,"data-tooltip-position-strategy":f,"data-tooltip-delay-show":v,"data-tooltip-delay-hide":y},o)},e.removeStyle=function({type:e="base",id:t=i}={}){"core"===e&&(t=c);const o=document.getElementById(t);null==o||o.remove()},Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("classnames"),require("@floating-ui/dom")):"function"==typeof define&&define.amd?define(["exports","react","classnames","@floating-ui/dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactTooltip={},e.React,e.classNames,e.FloatingUIDOM)}(this,(function(e,t,o,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=n(t),s=n(o);const c="react-tooltip-core-styles",a="react-tooltip-base-styles",i={core:!1,base:!1};function u({css:e,id:t=a,type:o="base",ref:r}){"core"===o&&(t=c),r||(r={});const{insertAt:n}=r;if(!e||"undefined"==typeof document||i[o])return;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const l=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.id=t,s.type="text/css","top"===n&&l.firstChild?l.insertBefore(s,l.firstChild):l.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e)),i[o]=!0}const d=(e,t,o)=>{let r=null;return function(...n){const l=()=>{r=null,o||e.apply(this,n)};o&&!r&&(e.apply(this,n),r=setTimeout(l,t)),o||(r&&clearTimeout(r),r=setTimeout(l,t))}},p="DEFAULT_TOOLTIP_ID",f={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},m={getTooltipData:()=>f},v=t.createContext(m);function y(e=p){return t.useContext(v).getTooltipData(e)}const h="undefined"!=typeof window?t.useLayoutEffect:t.useEffect,w=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return"auto"===o||"scroll"===o}))},E=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(w(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},S=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:o=null,place:n="top",offset:l=10,strategy:s="absolute",middlewares:c=[r.offset(Number(l)),r.flip(),r.shift({padding:5})],border:a})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};const i=c;return o?(i.push(r.arrow({element:o,padding:5})),r.computePosition(e,t,{placement:n,strategy:s,middleware:i}).then((({x:e,y:t,placement:o,middlewareData:r})=>{var n,l;const s={left:`${e}px`,top:`${t}px`,border:a},{x:c,y:i}=null!==(n=r.arrow)&&void 0!==n?n:{x:0,y:0},u=null!==(l={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==l?l:"bottom",d=a&&{top:{borderBottom:a,borderRight:a},right:{borderBottom:a,borderLeft:a},bottom:{borderTop:a,borderLeft:a},left:{borderTop:a,borderRight:a}}[o.split("-")[0]];let p=0;if(a){const e=`${a}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:s,tooltipArrowStyles:{left:null!=c?`${c}px`:"",top:null!=i?`${i}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:o}}))):r.computePosition(e,t,{placement:"bottom",strategy:s,middleware:i}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))};var b="core-styles-module_tooltip__3vRRp",g="core-styles-module_fixed__pcSol",_="core-styles-module_arrow__cvMwQ",A="core-styles-module_noArrow__xock6",T="core-styles-module_clickable__ZuTTB",R="core-styles-module_show__Nt9eE",O={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const L=({id:e,className:o,classNameArrow:r,variant:n="dark",anchorId:c,anchorSelect:a,place:i="top",offset:u=10,events:p=["hover"],openOnClick:f=!1,positionStrategy:m="absolute",middlewares:v,wrapper:w,delayShow:L=0,delayHide:x=0,float:N=!1,hidden:k=!1,noArrow:$=!1,clickable:C=!1,closeOnEsc:j=!1,closeOnScroll:I=!1,closeOnResize:q=!1,style:D,position:B,afterShow:H,afterHide:M,content:W,contentWrapperRef:z,isOpen:P,setIsOpen:U,activeAnchor:F,setActiveAnchor:K,border:X,opacity:V})=>{const Z=t.useRef(null),G=t.useRef(null),J=t.useRef(null),Q=t.useRef(null),[Y,ee]=t.useState(i),[te,oe]=t.useState({}),[re,ne]=t.useState({}),[le,se]=t.useState(!1),[ce,ae]=t.useState(!1),ie=t.useRef(!1),ue=t.useRef(null),{anchorRefs:de,setActiveAnchor:pe}=y(e),fe=t.useRef(!1),[me,ve]=t.useState([]),ye=t.useRef(!1),he=f||p.includes("click");h((()=>(ye.current=!0,()=>{ye.current=!1})),[]),t.useEffect((()=>{if(!le){const e=setTimeout((()=>{ae(!1)}),150);return()=>{clearTimeout(e)}}return()=>null}),[le]);const we=e=>{ye.current&&(e&&ae(!0),setTimeout((()=>{ye.current&&(null==U||U(e),void 0===P&&se(e))}),10))};t.useEffect((()=>{if(void 0===P)return()=>null;P&&ae(!0);const e=setTimeout((()=>{se(P)}),10);return()=>{clearTimeout(e)}}),[P]),t.useEffect((()=>{le!==ie.current&&(ie.current=le,le?null==H||H():null==M||M())}),[le]);const Ee=(e=x)=>{Q.current&&clearTimeout(Q.current),Q.current=setTimeout((()=>{fe.current||we(!1)}),e)},Se=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==o?void 0:o.isConnected))return K(null),void pe({current:null});L?(J.current&&clearTimeout(J.current),J.current=setTimeout((()=>{we(!0)}),L)):we(!0),K(o),pe({current:o}),Q.current&&clearTimeout(Q.current)},be=()=>{C?Ee(x||100):x?Ee():we(!1),J.current&&clearTimeout(J.current)},ge=({x:e,y:t})=>{S({place:i,offset:u,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:Z.current,tooltipArrowReference:G.current,strategy:m,middlewares:v,border:X}).then((e=>{Object.keys(e.tooltipStyles).length&&oe(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&ne(e.tooltipArrowStyles),ee(e.place)}))},_e=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};ge(o),ue.current=o},Ae=e=>{Se(e),x&&Ee()},Te=e=>{var t;[document.querySelector(`[id='${c}']`),...me].some((t=>null==t?void 0:t.contains(e.target)))||(null===(t=Z.current)||void 0===t?void 0:t.contains(e.target))||(we(!1),J.current&&clearTimeout(J.current))},Re=d(Se,50,!0),Oe=d(be,50,!0);t.useEffect((()=>{var e,t;const o=new Set(de);me.forEach((e=>{o.add({current:e})}));const r=document.querySelector(`[id='${c}']`);r&&o.add({current:r});const n=()=>{we(!1)},l=E(F),s=E(Z.current);I&&(window.addEventListener("scroll",n),null==l||l.addEventListener("scroll",n),null==s||s.addEventListener("scroll",n)),q&&window.addEventListener("resize",n);const a=e=>{"Escape"===e.key&&we(!1)};j&&window.addEventListener("keydown",a);const i=[];he?(window.addEventListener("click",Te),i.push({event:"click",listener:Ae})):(i.push({event:"mouseenter",listener:Re},{event:"mouseleave",listener:Oe},{event:"focus",listener:Re},{event:"blur",listener:Oe}),N&&i.push({event:"mousemove",listener:_e}));const u=()=>{fe.current=!0},d=()=>{fe.current=!1,be()};return C&&!he&&(null===(e=Z.current)||void 0===e||e.addEventListener("mouseenter",u),null===(t=Z.current)||void 0===t||t.addEventListener("mouseleave",d)),i.forEach((({event:e,listener:t})=>{o.forEach((o=>{var r;null===(r=o.current)||void 0===r||r.addEventListener(e,t)}))})),()=>{var e,t;I&&(window.removeEventListener("scroll",n),null==l||l.removeEventListener("scroll",n),null==s||s.removeEventListener("scroll",n)),q&&window.removeEventListener("resize",n),he&&window.removeEventListener("click",Te),j&&window.removeEventListener("keydown",a),C&&!he&&(null===(e=Z.current)||void 0===e||e.removeEventListener("mouseenter",u),null===(t=Z.current)||void 0===t||t.removeEventListener("mouseleave",d)),i.forEach((({event:e,listener:t})=>{o.forEach((o=>{var r;null===(r=o.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[ce,de,me,j,p]),t.useEffect((()=>{let t=null!=a?a:"";!t&&e&&(t=`[data-tooltip-id='${e}']`);const o=new MutationObserver((o=>{const r=[];o.forEach((o=>{if("attributes"===o.type&&"data-tooltip-id"===o.attributeName){o.target.getAttribute("data-tooltip-id")===e&&r.push(o.target)}if("childList"===o.type&&(F&&[...o.removedNodes].some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,F))&&(ae(!1),we(!1),K(null),J.current&&clearTimeout(J.current),Q.current&&clearTimeout(Q.current),!0)})),t))try{const e=[...o.addedNodes].filter((e=>1===e.nodeType));r.push(...e.filter((e=>e.matches(t)))),r.push(...e.flatMap((e=>[...e.querySelectorAll(t)])))}catch(e){}})),r.length&&ve((e=>[...e,...r]))}));return o.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{o.disconnect()}}),[e,a,F]);const Le=()=>{B?ge(B):N?ue.current&&ge(ue.current):S({place:i,offset:u,elementReference:F,tooltipReference:Z.current,tooltipArrowReference:G.current,strategy:m,middlewares:v,border:X}).then((e=>{ye.current&&(Object.keys(e.tooltipStyles).length&&oe(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&ne(e.tooltipArrowStyles),ee(e.place))}))};t.useEffect((()=>{Le()}),[le,F,W,D,i,u,m,B]),t.useEffect((()=>{if(!(null==z?void 0:z.current))return()=>null;const e=new ResizeObserver((()=>{Le()}));return e.observe(z.current),()=>{e.disconnect()}}),[W,null==z?void 0:z.current]),t.useEffect((()=>{var e;const t=document.querySelector(`[id='${c}']`),o=[...me,t];F&&o.includes(F)||K(null!==(e=me[0])&&void 0!==e?e:t)}),[c,me,F]),t.useEffect((()=>()=>{J.current&&clearTimeout(J.current),Q.current&&clearTimeout(Q.current)}),[]),t.useEffect((()=>{let t=a;if(!t&&e&&(t=`[data-tooltip-id='${e}']`),t)try{const e=Array.from(document.querySelectorAll(t));ve(e)}catch(e){ve([])}}),[e,a]);const xe=!k&&W&&le&&Object.keys(te).length>0;return ce?l.default.createElement(w,{id:e,role:"tooltip",className:s.default("react-tooltip",b,O.tooltip,O[n],o,`react-tooltip__place-${Y}`,{[R]:xe,[g]:"fixed"===m,[T]:C}),style:{...D,...te,opacity:void 0!==V&&xe?V:void 0},ref:Z},W,l.default.createElement(w,{className:s.default("react-tooltip-arrow",_,O.arrow,r,{[A]:$}),style:re,ref:G})):null},x=({content:e})=>l.default.createElement("span",{dangerouslySetInnerHTML:{__html:e}});"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||u({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9}.core-styles-module_tooltip__3vRRp{visibility:hidden;position:absolute;top:0;left:0;pointer-events:none;opacity:0;transition:opacity 0.3s ease-out;will-change:opacity,visibility}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{visibility:visible;opacity:var(--rt-opacity)}`,type:"core"}),e.detail.disableBase||u({css:`
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px;transform:rotate(45deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})})),e.Tooltip=({id:e,anchorId:o,anchorSelect:r,content:n,html:s,render:c,className:a,classNameArrow:i,variant:u="dark",place:d="top",offset:p=10,wrapper:f="div",children:m=null,events:v=["hover"],openOnClick:h=!1,positionStrategy:w="absolute",middlewares:E,delayShow:S=0,delayHide:b=0,float:g=!1,hidden:_=!1,noArrow:A=!1,clickable:T=!1,closeOnEsc:R=!1,closeOnScroll:O=!1,closeOnResize:N=!1,style:k,position:$,isOpen:C,disableStyleInjection:j=!1,border:I,opacity:q,setIsOpen:D,afterShow:B,afterHide:H})=>{const[M,W]=t.useState(n),[z,P]=t.useState(s),[U,F]=t.useState(d),[K,X]=t.useState(u),[V,Z]=t.useState(p),[G,J]=t.useState(S),[Q,Y]=t.useState(b),[ee,te]=t.useState(g),[oe,re]=t.useState(_),[ne,le]=t.useState(f),[se,ce]=t.useState(v),[ae,ie]=t.useState(w),[ue,de]=t.useState(null),pe=t.useRef(j),{anchorRefs:fe,activeAnchor:me}=y(e),ve=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var r;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(o))&&void 0!==r?r:null}return t}),{}),ye=e=>{const t={place:e=>{var t;F(null!==(t=e)&&void 0!==t?t:d)},content:e=>{W(null!=e?e:n)},html:e=>{P(null!=e?e:s)},variant:e=>{var t;X(null!==(t=e)&&void 0!==t?t:u)},offset:e=>{Z(null===e?p:Number(e))},wrapper:e=>{var t;le(null!==(t=e)&&void 0!==t?t:f)},events:e=>{const t=null==e?void 0:e.split(" ");ce(null!=t?t:v)},"position-strategy":e=>{var t;ie(null!==(t=e)&&void 0!==t?t:w)},"delay-show":e=>{J(null===e?S:Number(e))},"delay-hide":e=>{Y(null===e?b:Number(e))},float:e=>{te(null===e?g:"true"===e)},hidden:e=>{re(null===e?_:"true"===e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var r;null===(r=t[e])||void 0===r||r.call(t,o)}))};t.useEffect((()=>{W(n)}),[n]),t.useEffect((()=>{P(s)}),[s]),t.useEffect((()=>{F(d)}),[d]),t.useEffect((()=>{X(u)}),[u]),t.useEffect((()=>{Z(p)}),[p]),t.useEffect((()=>{J(S)}),[S]),t.useEffect((()=>{Y(b)}),[b]),t.useEffect((()=>{te(g)}),[g]),t.useEffect((()=>{re(_)}),[_]),t.useEffect((()=>{ie(w)}),[w]),t.useEffect((()=>{pe.current!==j&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[j]),t.useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===j,disableBase:j}}))}),[]),t.useEffect((()=>{var t;const n=new Set(fe);let l=r;if(!l&&e&&(l=`[data-tooltip-id='${e}']`),l)try{document.querySelectorAll(l).forEach((e=>{n.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${l}" is not a valid CSS selector`)}const s=document.querySelector(`[id='${o}']`);if(s&&n.add({current:s}),!n.size)return()=>null;const c=null!==(t=null!=ue?ue:s)&&void 0!==t?t:me.current,a=new MutationObserver((e=>{e.forEach((e=>{var t;if(!c||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=ve(c);ye(o)}))})),i={attributes:!0,childList:!1,subtree:!1};if(c){const e=ve(c);ye(e),a.observe(c,i)}return()=>{a.disconnect()}}),[fe,me,ue,o,r]),t.useEffect((()=>{(null==k?void 0:k.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),I&&!CSS.supports("border",`${I}`)&&console.warn(`[react-tooltip] "${I}" is not a valid \`border\`.`),(null==k?void 0:k.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),q&&!CSS.supports("opacity",`${q}`)&&console.warn(`[react-tooltip] "${q}" is not a valid \`opacity\`.`)}),[]);let he=m;const we=t.useRef(null);if(c){const e=c({content:null!=M?M:null,activeAnchor:ue});he=e?l.default.createElement("div",{ref:we,className:"react-tooltip-content-wrapper"},e):null}else M&&(he=M);z&&(he=l.default.createElement(x,{content:z}));const Ee={id:e,anchorId:o,anchorSelect:r,className:a,classNameArrow:i,content:he,contentWrapperRef:we,place:U,variant:K,offset:V,wrapper:ne,events:se,openOnClick:h,positionStrategy:ae,middlewares:E,delayShow:G,delayHide:Q,float:ee,hidden:oe,noArrow:A,clickable:T,closeOnEsc:R,closeOnScroll:O,closeOnResize:N,style:k,position:$,isOpen:C,border:I,opacity:q,setIsOpen:D,afterShow:B,afterHide:H,activeAnchor:ue,setActiveAnchor:e=>de(e)};return l.default.createElement(L,{...Ee})},e.TooltipProvider=({children:e})=>{const[o,r]=t.useState({[p]:new Set}),[n,s]=t.useState({[p]:{current:null}}),c=(e,...t)=>{r((o=>{var r;const n=null!==(r=o[e])&&void 0!==r?r:new Set;return t.forEach((e=>n.add(e))),{...o,[e]:new Set(n)}}))},a=(e,...t)=>{r((o=>{const r=o[e];return r?(t.forEach((e=>r.delete(e))),{...o}):o}))},i=t.useCallback(((e=p)=>{var t,r;return{anchorRefs:null!==(t=o[e])&&void 0!==t?t:new Set,activeAnchor:null!==(r=n[e])&&void 0!==r?r:{current:null},attach:(...t)=>c(e,...t),detach:(...t)=>a(e,...t),setActiveAnchor:t=>((e,t)=>{s((o=>{var r;return(null===(r=o[e])||void 0===r?void 0:r.current)===t.current?o:{...o,[e]:t}}))})(e,t)}}),[o,n,c,a]),u=t.useMemo((()=>({getTooltipData:i})),[i]);return l.default.createElement(v.Provider,{value:u},e)},e.TooltipWrapper=({tooltipId:e,children:o,className:r,place:n,content:c,html:a,variant:i,offset:u,wrapper:d,events:p,positionStrategy:f,delayShow:m,delayHide:v})=>{const{attach:h,detach:w}=y(e),E=t.useRef(null);return t.useEffect((()=>(h(E),()=>{w(E)})),[]),l.default.createElement("span",{ref:E,className:s.default("react-tooltip-wrapper",r),"data-tooltip-place":n,"data-tooltip-content":c,"data-tooltip-html":a,"data-tooltip-variant":i,"data-tooltip-offset":u,"data-tooltip-wrapper":d,"data-tooltip-events":p,"data-tooltip-position-strategy":f,"data-tooltip-delay-show":m,"data-tooltip-delay-hide":v},o)},Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "react-tooltip",
"version": "5.18.1",
"version": "5.19.0-beta.1052.0",
"description": "react tooltip component",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc