react-tooltip 6.0.3 → 6.0.4-beta.1275.rc.0

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.
@@ -4,6 +4,6 @@
4
4
  * @copyright ReactTooltip Team
5
5
  * @license MIT
6
6
  */
7
- "use strict";var e=require("react"),t=require("clsx"),o=require("react-dom"),r=require("@floating-ui/dom");const n={core:!1,base:!1};function l({css:e,id:t="react-tooltip-base-styles",type:o="base",ref:r,state:l={}}){if(!e||"undefined"==typeof document||(void 0!==l[o]?l[o]:n[o]))return;if("core"===o&&"undefined"!=typeof process&&process.env&&process.env.REACT_TOOLTIP_DISABLE_CORE_STYLES)return;if("base"===o&&"undefined"!=typeof process&&process.env&&process.env.REACT_TOOLTIP_DISABLE_BASE_STYLES)return;"core"===o&&(t="react-tooltip-core-styles"),r||(r={});const{insertAt:c}=r;if(document.getElementById(t))return;const s=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.id=t,i.type="text/css","top"===c&&s.firstChild?s.insertBefore(i,s.firstChild):s.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e)),void 0!==l[o]?l[o]=!0:n[o]=!0}const c=r.flip({fallbackAxisSideDirection:"start"}),s=r.shift({padding:5}),i=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:o=null,place:n="top",offset:l=10,strategy:i="absolute",middlewares:u=[r.offset(Number(l)),c,s],border:a,arrowSize:d=8})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};const p=[...u];return o?(p.push(r.arrow({element:o,padding:5})),r.computePosition(e,t,{placement:n,strategy:i,middleware:p}).then(({x:e,y:t,placement:o,middlewareData:r})=>{var n,l;const c={left:`${e}px`,top:`${t}px`,border:a},{x:s,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",p=a&&{borderBottom:a,borderRight:a};let f=0;if(a){const e=`${a}`.match(/(\d+)px/);f=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:c,tooltipArrowStyles:{left:null!=s?`${s}px`:"",top:null!=i?`${i}px`:"",right:"",bottom:"",...p,[u]:`-${d/2+f-1}px`},place:o}})):r.computePosition(e,t,{placement:"bottom",strategy:i,middleware:p}).then(({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o}))},u=(e,t,o)=>{let r=null,n=e;const l=function(...e){const o=()=>{r=null};r||(n.apply(this,e),r=setTimeout(o,t))};return l.cancel=()=>{r&&(clearTimeout(r),r=null)},l.setCallback=e=>{n=e},l},a=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})},d=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(a(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},p="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect,f=e=>{e.current&&(clearTimeout(e.current),e.current=null)};var v={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",content:"core-styles-module_content__BRKdB",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},m={tooltip:"styles-module_tooltip__mnnfp",content:"styles-module_content__ydYdI",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 h=new Map;let y=null;function w(e){const t=e.match(/^\[data-tooltip-id=(['"])((?:\\.|(?!\1).)*)\1\]$/);return t?t[2].replace(/\\(['"])/g,"$1"):null}function b(e){try{return{anchors:Array.from(document.querySelectorAll(e)),error:null}}catch(e){return{anchors:[],error:e instanceof Error?e:new Error(String(e))}}}function S(e,t){var o,r,n,l;const c=b(e),s=null!==(r=null===(o=c.error)||void 0===o?void 0:o.message)&&void 0!==r?r:null,i=null!==(l=null===(n=t.error)||void 0===n?void 0:n.message)&&void 0!==l?l:null;if(u=t.anchors,a=c.anchors,u.length===a.length&&u.every((e,t)=>e===a[t])&&s===i)return;var u,a;const d={...t,anchors:c.anchors,error:c.error};h.set(e,d),function(e){e.subscribers.forEach(t=>t(e.anchors,e.error))}(d)}let E=!1,g=null,A=!1;function R(e){if(e?(g||(g=new Set),e.forEach(e=>g.add(e))):A=!0,E)return;E=!0;const t=()=>{E=!1;const e=A,t=g;var o;A=!1,g=null,e?h.forEach((e,t)=>{S(t,e)}):t&&t.size>0&&(o=t,h.forEach((e,t)=>{(null===e.tooltipId||o.has(e.tooltipId))&&S(t,e)}))};"function"==typeof requestAnimationFrame?requestAnimationFrame(t):Promise.resolve().then(t)}function _(){y||"undefined"==typeof MutationObserver||(y=new MutationObserver(e=>{const t=function(e){var t;if(h.size<=4)return null;const o=new Set;for(const r of e){if("attributes"===r.type){const e=r.target,n=null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"data-tooltip-id");n&&o.add(n),r.oldValue&&o.add(r.oldValue);continue}if("childList"===r.type){const e=e=>{var t,r;for(let n=0;n<e.length;n++){const l=e[n];if(l.nodeType!==Node.ELEMENT_NODE)continue;const c=l,s=null===(t=c.getAttribute)||void 0===t?void 0:t.call(c,"data-tooltip-id");s&&o.add(s);const i=null===(r=c.querySelectorAll)||void 0===r?void 0:r.call(c,"[data-tooltip-id]");if(i){if(i.length>50)return!0;for(let e=0;e<i.length;e++){const t=i[e].getAttribute("data-tooltip-id");t&&o.add(t)}}}return!1};if(e(r.addedNodes)||e(r.removedNodes))return null;continue}}return o}(e);R(t)}),y.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}))}function T(e,t){let o=h.get(e);if(!o){const t=b(e);o={anchors:t.anchors,error:t.error,subscribers:new Set,tooltipId:w(e)},h.set(e,o)}return o.subscribers.add(t),_(),t([...o.anchors],o.error),()=>{const o=h.get(e);o&&(o.subscribers.delete(t),0===o.subscribers.size&&h.delete(e),0===h.size&&y&&(y.disconnect(),y=null))}}const k=new Map;function C(e){const t=k.get(e.type);t&&t.forEach(t=>{t(e)})}function O(e,t){const o=function(e){let t=k.get(e);return t||(t=new Set,k.set(e,t),document.addEventListener(e,C)),t}(e);return o.add(t),()=>{o.delete(t),0===o.size&&(k.delete(e),document.removeEventListener(e,C))}}let L=null;var x=e.memo(({forwardRef:n,id:l,className:c,classNameArrow:s,variant:a="dark",portalRoot:h,anchorSelect:y,place:w="top",offset:b=10,openOnClick:S=!1,positionStrategy:E="absolute",middlewares:g,wrapper:A,delayShow:R=0,delayHide:_=0,autoClose:k,float:C=!1,hidden:x=!1,noArrow:N=!1,clickable:B=!1,openEvents:z,closeEvents:M,globalCloseEvents:I,imperativeModeOnly:$,style:j,position:H,afterShow:D,afterHide:P,disableTooltip:q,content:W,contentWrapperRef:F,isOpen:V,defaultIsOpen:K=!1,setIsOpen:Y,previousActiveAnchor:X,activeAnchor:G,setActiveAnchor:Z,border:J,opacity:Q,arrowColor:U,arrowSize:ee=8,role:te="tooltip"})=>{var oe;const re=e.useRef(null),ne=e.useRef(null),le=e.useRef(null),ce=e.useRef(null),se=e.useRef(null),ie=e.useRef(null),[ue,ae]=e.useState({tooltipStyles:{},tooltipArrowStyles:{},place:w}),[de,pe]=e.useState(!1),[fe,ve]=e.useState(!1),[me,he]=e.useState(null),ye=e.useRef(!1),we=e.useRef(null),be=e.useRef(!1),Se=e.useRef(!1),Ee=e.useRef({getBoundingClientRect:()=>({x:0,y:0,width:0,height:0,top:0,left:0,right:0,bottom:0})});p(()=>(Se.current=!0,()=>{Se.current=!1}),[]);const ge=e.useCallback(e=>{Se.current&&(e&&ve(!0),setTimeout(()=>{Se.current&&(null==Y||Y(e),void 0===V&&pe(e))},10))},[V,Y]);e.useEffect(()=>{if(l){if(de){t(X);const o=e(G),r=[...new Set([...o,l])].filter(Boolean).join(" ");null==G||G.setAttribute("aria-describedby",r)}else t(G);return()=>{t(G),t(X)}}function e(e){var t;return(null===(t=null==e?void 0:e.getAttribute("aria-describedby"))||void 0===t?void 0:t.split(" "))||[]}function t(t){const o=e(t).filter(e=>e!==l);o.length?null==t||t.setAttribute("aria-describedby",o.join(" ")):null==t||t.removeAttribute("aria-describedby")}},[G,de,l,X]),e.useEffect(()=>{if(void 0===V)return()=>null;V&&ve(!0);const e=setTimeout(()=>{pe(V)},10);return()=>{clearTimeout(e)}},[V]),e.useEffect(()=>{if(de!==ye.current)if(f(ie),ye.current=de,de)null==D||D();else{if(null===L){const e=getComputedStyle(document.body);L=(e=>{const t=e.match(/^([\d.]+)(m?s)$/);if(!t)return 0;const[,o,r]=t;return Number(o)*("ms"===r?1:1e3)})(e.getPropertyValue("--rt-transition-show-delay"))}const e=L;ie.current=setTimeout(()=>{ve(!1),he(null),null==P||P()},e+25)}},[P,D,de]),e.useEffect(()=>(f(se),!de||!k||k<=0||(se.current=setTimeout(()=>{ge(!1)},k)),()=>{f(se)}),[G,k,ge,de]);const Ae=e.useCallback(e=>{Se.current&&ae(t=>t.place===e.place&&t.tooltipStyles.left===e.tooltipStyles.left&&t.tooltipStyles.top===e.tooltipStyles.top&&t.tooltipStyles.border===e.tooltipStyles.border&&t.tooltipArrowStyles.left===e.tooltipArrowStyles.left&&t.tooltipArrowStyles.top===e.tooltipArrowStyles.top&&t.tooltipArrowStyles.right===e.tooltipArrowStyles.right&&t.tooltipArrowStyles.bottom===e.tooltipArrowStyles.bottom&&t.tooltipArrowStyles.borderBottom===e.tooltipArrowStyles.borderBottom&&t.tooltipArrowStyles.borderRight===e.tooltipArrowStyles.borderRight?t:e)},[]),Re=e.useRef(fe);Re.current=fe;const _e=e.useCallback((e=R)=>{le.current&&clearTimeout(le.current),Re.current?ge(!0):le.current=setTimeout(()=>{ge(!0)},e)},[R,ge]),Te=e.useCallback((e=_)=>{ce.current&&clearTimeout(ce.current),ce.current=setTimeout(()=>{be.current||ge(!1)},e)},[_,ge]),ke=e.useCallback(({x:e,y:t})=>{var o;Ee.current.getBoundingClientRect=()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t}),i({place:null!==(o=null==me?void 0:me.place)&&void 0!==o?o:w,offset:b,elementReference:Ee.current,tooltipReference:re.current,tooltipArrowReference:ne.current,strategy:E,middlewares:g,border:J,arrowSize:ee}).then(e=>{Ae(e)})},[null==me?void 0:me.place,w,b,E,g,J,ee,Ae]),Ce=e.useCallback(()=>{var e,t;const o=null!==(e=null==me?void 0:me.position)&&void 0!==e?e:H;o?ke(o):C?we.current&&ke(we.current):(null==G?void 0:G.isConnected)&&i({place:null!==(t=null==me?void 0:me.place)&&void 0!==t?t:w,offset:b,elementReference:G,tooltipReference:re.current,tooltipArrowReference:ne.current,strategy:E,middlewares:g,border:J,arrowSize:ee}).then(e=>{Se.current&&Ae(e)})},[null==me?void 0:me.position,null==me?void 0:me.place,H,C,G,w,b,E,g,J,ke,Ae,ee]),Oe=e.useCallback(()=>{ve(!1),ge(!1),Z(null),f(le),f(ce),f(se)},[ge,Z]),Le=fe||K||Boolean(V)||Boolean(G)||Boolean(null==me?void 0:me.anchorSelect),{anchorElements:xe,selector:Ne}=(({id:t,anchorSelect:o,imperativeAnchorSelect:r,activeAnchor:n,disableTooltip:l,onActiveAnchorRemoved:c,trackAnchors:s})=>{const[i,u]=e.useState([]),[a,d]=e.useState(null),p=e.useRef(null),f=e.useMemo(()=>(({id:e,anchorSelect:t,imperativeAnchorSelect:o})=>{var r;let n=null!==(r=null!=o?o:t)&&void 0!==r?r:"";return!n&&e&&(n=`[data-tooltip-id='${e.replace(/'/g,"\\'")}']`),n})({id:t,anchorSelect:o,imperativeAnchorSelect:r}),[t,o,r]),v=e.useMemo(()=>i.filter(e=>!(null==l?void 0:l(e))),[i,l]),m=e.useMemo(()=>{if(!n||!f)return!1;try{return n.matches(f)}catch(e){return!1}},[n,f,v]);return e.useEffect(()=>f&&s?T(f,(e,t)=>{u(e),d(t)}):(u([]),void d(null)),[f,s]),e.useEffect(()=>{a&&p.current!==f&&(p.current=f)},[f,a]),e.useEffect(()=>{n&&(n.isConnected&&(v.includes(n)||m)||c())},[n,v,m,c]),{anchorElements:v,selector:f}})({id:l,anchorSelect:y,imperativeAnchorSelect:null==me?void 0:me.anchorSelect,activeAnchor:G,disableTooltip:q,onActiveAnchorRemoved:Oe,trackAnchors:Le});(({activeAnchor:t,anchorElements:o,anchorSelector:n,clickable:l,closeEvents:c,delayHide:s,delayShow:i,disableTooltip:a,float:p,globalCloseEvents:v,handleHideTooltipDelayed:m,handleShow:h,handleShowTooltipDelayed:y,handleTooltipPosition:w,hoveringTooltip:b,imperativeModeOnly:S,lastFloatPosition:E,openEvents:g,openOnClick:A,rendered:R,setActiveAnchor:_,show:T,tooltipHideDelayTimerRef:k,tooltipRef:C,tooltipShowDelayTimerRef:L,updateTooltipPosition:x})=>{const N=e.useRef(u(e=>{},50)),B=e.useRef(u(()=>{},50)),z=e.useRef(null),M=e.useRef(null),I=e.useRef(null),$=e.useRef(null);t!==I.current&&(I.current=t,z.current=d(t));const j=C.current;j!==$.current&&($.current=j,M.current=d(j));const H=A||(null==g?void 0:g.click)||(null==g?void 0:g.dblclick)||(null==g?void 0:g.mousedown),D=e.useMemo(()=>{const e=g?{...g}:{mouseenter:!0,focus:!0,click:!1,dblclick:!1,mousedown:!1};return!g&&A&&Object.assign(e,{mouseenter:!1,focus:!1,click:!0}),S&&Object.assign(e,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),e},[g,A,S]),P=e.useMemo(()=>{const e=c?{...c}:{mouseleave:!0,blur:!0,click:!1,dblclick:!1,mouseup:!1};return!c&&A&&Object.assign(e,{mouseleave:!1,blur:!1}),S&&Object.assign(e,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),e},[c,A,S]),q=e.useMemo(()=>{const e=v?{...v}:{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:H||!1};return S&&Object.assign(e,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1}),e},[v,H,S]),W=e.useRef(t);W.current=t;const F=e.useRef(T);F.current=T;const V=e.useRef(o);V.current=o;const K=e.useRef(h);K.current=h;const Y=e.useRef(w);Y.current=w;const X=e.useRef(x);X.current=x;const G=e.useRef(()=>null),Z=e.useRef(()=>{}),J=e.useRef(()=>{}),Q=n?function(e){const t=e.match(/^\[data-tooltip-id=(['"])((?:\\.|(?!\1).)*)\1\]$/);return t?t[2].replace(/\\(['"])/g,"$1"):null}(n):null;G.current=e=>{var t,o;const r=e;if(!(null==r?void 0:r.isConnected))return null;if(Q){const e=function(e,t){let o=e;for(;o;){if(o.dataset.tooltipId===t)return o;o=o.parentElement}return null}(r,Q);if(e&&!(null==a?void 0:a(e)))return e}else if(n)try{const e=null!==(t=r.matches(n)?r:r.closest(n))&&void 0!==t?t:null;if(e&&!(null==a?void 0:a(e)))return e}catch(e){return null}return null!==(o=V.current.find(e=>e===r||e.contains(r)))&&void 0!==o?o:null},Z.current=e=>{e&&(e.isConnected?(null==a?void 0:a(e))||(i&&W.current&&e!==W.current?(L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{_(e),h(!0)},i)):(_(e),i?y():h(!0)),k.current&&clearTimeout(k.current)):_(null))},J.current=()=>{l?m(s||100):s?m():h(!1),L.current&&clearTimeout(L.current)};const U=N.current,ee=B.current;U.setCallback(e=>Z.current(e)),ee.setCallback(()=>J.current()),e.useEffect(()=>{const e=[],t=(t,o)=>{e.push(O(t,o))},o=e=>{var t;return Boolean((null==e?void 0:e.target)&&(null===(t=W.current)||void 0===t?void 0:t.contains(e.target)))},r=e=>{ee.cancel(),U(e)},n=()=>{U.cancel(),ee()},c=()=>{t("mouseover",e=>{const t=G.current(e.target);t&&G.current(e.relatedTarget)!==t&&r(t)})},s=()=>{t("mouseout",e=>{const t=G.current(e.target);if(!t&&!o(e))return;const r=e.relatedTarget,l=t||W.current;(null==l?void 0:l.contains(r))||n()})};D.mouseenter&&c(),P.mouseleave&&s(),D.mouseover&&c(),P.mouseout&&s(),D.focus&&t("focusin",e=>{r(G.current(e.target))}),P.blur&&t("focusout",e=>{const t=G.current(e.target);if(!t&&!o(e))return;const r=e.relatedTarget,l=t||W.current;(null==l?void 0:l.contains(r))||n()});const i=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],u=["click","dblclick","mousedown","mouseup"],a=e=>{var t;const o=G.current(null!==(t=null==e?void 0:e.target)&&void 0!==t?t:null);o&&(F.current&&W.current===o||Z.current(o))},d=e=>{F.current&&o(e)&&J.current()};Object.entries(D).forEach(([e,o])=>{o&&!i.includes(e)&&u.includes(e)&&t(e,a)}),Object.entries(P).forEach(([e,o])=>{o&&!i.includes(e)&&u.includes(e)&&t(e,d)}),p&&t("pointermove",e=>{const t=W.current;if(!t)return;if(G.current(e.target)!==t)return;const o=e,r={x:o.clientX,y:o.clientY};Y.current(r),E.current=r});const f=C.current,v=()=>{b.current=!0},m=()=>{b.current=!1,J.current()},h=l&&(P.mouseout||P.mouseleave);return h&&(null==f||f.addEventListener("mouseover",v),null==f||f.addEventListener("mouseout",m)),()=>{e.forEach(e=>e()),h&&(null==f||f.removeEventListener("mouseover",v),null==f||f.removeEventListener("mouseout",m)),U.cancel(),ee.cancel()}},[D,P,p,l,R]),e.useEffect(()=>{const e=()=>{K.current(!1)},o=M.current,n=z.current;q.scroll&&(window.addEventListener("scroll",e),null==n||n.addEventListener("scroll",e),null==o||o.addEventListener("scroll",e));let l=null;q.resize?window.addEventListener("resize",e):t&&C.current&&(l=r.autoUpdate(t,C.current,()=>X.current(),{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const c=e=>{"Escape"===e.key&&K.current(!1)};q.escape&&window.addEventListener("keydown",c);const s=e=>{var t,o;if(!F.current)return;const r=e.target;(null==r?void 0:r.isConnected)&&((null===(t=C.current)||void 0===t?void 0:t.contains(r))||(null===(o=W.current)||void 0===o?void 0:o.contains(r))||V.current.some(e=>null==e?void 0:e.contains(r))||(K.current(!1),f(L)))};return q.clickOutsideAnchor&&window.addEventListener("click",s),()=>{q.scroll&&(window.removeEventListener("scroll",e),null==n||n.removeEventListener("scroll",e),null==o||o.removeEventListener("scroll",e)),q.resize&&window.removeEventListener("resize",e),l&&l(),q.escape&&window.removeEventListener("keydown",c),q.clickOutsideAnchor&&window.removeEventListener("click",s)}},[q,t])})({activeAnchor:G,anchorElements:xe,anchorSelector:Ne,clickable:B,closeEvents:M,delayHide:_,delayShow:R,disableTooltip:q,float:C,globalCloseEvents:I,handleHideTooltipDelayed:Te,handleShow:ge,handleShowTooltipDelayed:_e,handleTooltipPosition:ke,hoveringTooltip:be,imperativeModeOnly:$,lastFloatPosition:we,openEvents:z,openOnClick:S,rendered:fe,setActiveAnchor:Z,show:de,tooltipHideDelayTimerRef:ce,tooltipRef:re,tooltipShowDelayTimerRef:le,updateTooltipPosition:Ce});const Be=e.useRef(Ce);Be.current=Ce,e.useEffect(()=>{fe&&Ce()},[fe,Ce]),e.useEffect(()=>{if(!fe||!(null==F?void 0:F.current))return()=>null;let e=null;const t=new ResizeObserver(()=>{e&&clearTimeout(e),e=setTimeout(()=>{Se.current&&Be.current(),e=null},0)});return t.observe(F.current),()=>{t.disconnect(),e&&clearTimeout(e)}},[W,F,fe]),e.useEffect(()=>{var e;if(!(K||Boolean(V)))return;const t=(()=>{if(!G||!(null==me?void 0:me.anchorSelect))return!1;try{return G.matches(me.anchorSelect)}catch(e){return!1}})();if(!G||!xe.includes(G)){if(t)return;Z(null!==(e=xe[0])&&void 0!==e?e:null)}},[G,xe,K,null==me?void 0:me.anchorSelect,V,fe,Z]),e.useEffect(()=>(K&&ge(!0),()=>{f(le),f(ce),f(se),f(ie)}),[K,ge]),e.useEffect(()=>{le.current&&(f(le),_e(R))},[R,_e]);const ze=null!==(oe=null==me?void 0:me.content)&&void 0!==oe?oe:W,Me=null!=ze,Ie=de&&void 0!==ue.tooltipStyles.left,$e=e.useMemo(()=>({...j,...ue.tooltipStyles,opacity:void 0!==Q&&Ie?Q:void 0}),[j,ue.tooltipStyles,Q,Ie]),je=e.useMemo(()=>U?`linear-gradient(to right bottom, transparent 50%, ${U} 50%)`:void 0,[U]),He=e.useMemo(()=>({...ue.tooltipArrowStyles,background:je,"--rt-arrow-size":`${ee}px`}),[ue.tooltipArrowStyles,je,ee]);e.useImperativeHandle(n,()=>({open:e=>{let t=null;if(null==e?void 0:e.anchorSelect){try{t=document.querySelector(e.anchorSelect)}catch(e){return}if(!t)return}t&&Z(t),he(null!=e?e:null),(null==e?void 0:e.delay)?_e(e.delay):ge(!0)},close:e=>{(null==e?void 0:e.delay)?Te(e.delay):ge(!1)},activeAnchor:G,place:ue.place,isOpen:Boolean(fe&&!x&&Me&&Ie)})),e.useEffect(()=>()=>{f(le),f(ce),f(se),f(ie)},[]);const De=fe&&!x&&Me?e.createElement(A,{id:l,role:te,className:t("react-tooltip",v.tooltip,m.tooltip,m[a],c,`react-tooltip__place-${ue.place}`,v[Ie?"show":"closing"],Ie?"react-tooltip__show":"react-tooltip__closing","fixed"===E&&v.fixed,B&&v.clickable),onTransitionEnd:e=>{f(ie),de||"opacity"!==e.propertyName||(ve(!1),he(null),null==P||P())},style:$e,ref:re},e.createElement(A,{className:t("react-tooltip-content-wrapper",v.content,m.content)},ze),e.createElement(A,{className:t("react-tooltip-arrow",v.arrow,m.arrow,s,N&&v.noArrow),style:He,ref:ne})):null;return De?h?o.createPortal(De,h):De:null});const N=new Map;let B=null;const z={attributes:!0,childList:!1,subtree:!1};function M(e,t){const o=(B||(B=new MutationObserver(e=>{var t;for(const o of e){if("attributes"!==o.type||!(null===(t=o.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))continue;const e=o.target,r=N.get(e);r&&r.forEach(t=>t(e))}})),B);let r=N.get(e);return r||(r=new Set,N.set(e,r),o.observe(e,z)),r.add(t),()=>{const r=N.get(e);r&&(r.delete(t),0===r.size&&(N.delete(e),0===N.size?o.disconnect():(o.disconnect(),N.forEach((e,t)=>{o.observe(t,z)}))))}}const I=e.forwardRef(({id:o,anchorSelect:r,content:n,render:l,className:c,classNameArrow:s,variant:i="dark",portalRoot:u,place:a="top",offset:d=10,wrapper:p="div",children:f=null,openOnClick:v=!1,positionStrategy:m="absolute",middlewares:h,delayShow:y=0,delayHide:w=0,autoClose:b,float:S=!1,hidden:E=!1,noArrow:g=!1,clickable:A=!1,openEvents:R,closeEvents:_,globalCloseEvents:T,imperativeModeOnly:k=!1,style:C,position:O,isOpen:L,defaultIsOpen:N=!1,disableStyleInjection:B=!1,border:z,opacity:I,arrowColor:$,arrowSize:j,setIsOpen:H,afterShow:D,afterHide:P,disableTooltip:q,role:W="tooltip"},F)=>{var V,K,Y,X,G,Z,J,Q;const[U,ee]=e.useState(null),[te,oe]=e.useState({}),re=e.useRef(null),ne=e.useRef(B),le=e.useCallback(e=>{ee(t=>((null==e?void 0:e.isSameNode(t))||(re.current=t),e))},[]),ce=e=>{const t=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},{});return t};e.useEffect(()=>{ne.current},[B]),e.useEffect(()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===B,disableBase:B}}))},[]),e.useEffect(()=>{if(!U)return oe({}),()=>{};const e=e=>{const t=ce(e);oe(e=>{const o=Object.keys(t),r=Object.keys(e);return o.length===r.length&&o.every(o=>t[o]===e[o])?e:t})};e(U);return M(U,e)},[U,r]),e.useEffect(()=>{},[z,I,null==C?void 0:C.border,null==C?void 0:C.opacity]);const se=U?ce(U):te,ie=null!==(V=se.content)&&void 0!==V?V:n,ue=null!==(K=se.place)&&void 0!==K?K:a,ae=null!==(Y=se.variant)&&void 0!==Y?Y:i,de=null==se.offset?d:Number(se.offset),pe=null!==(X=se.wrapper)&&void 0!==X?X:p,fe=null!==(G=se["position-strategy"])&&void 0!==G?G:m,ve=null==se["delay-show"]?y:Number(se["delay-show"]),me=null==se["delay-hide"]?w:Number(se["delay-hide"]),he=null==se["auto-close"]?b:Number(se["auto-close"]),ye=null==se.float?S:"true"===se.float,we=null==se.hidden?E:"true"===se.hidden,be=null!==(Z=se["class-name"])&&void 0!==Z?Z:null;let Se=f;const Ee=e.useRef(null);if(l){const t=l({content:null!==(Q=null!==(J=se.content)&&void 0!==J?J:ie)&&void 0!==Q?Q:null,activeAnchor:U});Se=t?e.createElement("div",{ref:Ee,className:"react-tooltip-content-wrapper"},t):null}else null!=ie&&(Se=ie);const ge={forwardRef:F,id:o,anchorSelect:r,className:t(c,be),classNameArrow:s,content:Se,contentWrapperRef:Ee,portalRoot:u,place:ue,variant:ae,offset:de,wrapper:pe,openOnClick:v,positionStrategy:fe,middlewares:h,delayShow:ve,delayHide:me,autoClose:he,float:ye,hidden:we,noArrow:g,clickable:A,openEvents:R,closeEvents:_,globalCloseEvents:T,imperativeModeOnly:k,style:C,position:O,isOpen:L,defaultIsOpen:N,border:z,opacity:I,arrowColor:$,arrowSize:j,setIsOpen:H,afterShow:D,afterHide:P,disableTooltip:q,activeAnchor:U,previousActiveAnchor:re.current,setActiveAnchor:le,role:W};return e.createElement(x,{...ge})});var $=e.memo(I);"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",e=>{e.detail.disableCore||l({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;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s;--rt-arrow-size:8px}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit;z-index:-1;-webkit-backface-visibility:hidden;backface-visibility:hidden}.core-styles-module_content__BRKdB{position:relative;z-index:1}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out;will-change:opacity}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in;will-change:opacity}`,type:"core"}),e.detail.disableBase||l({css:`
8
- .styles-module_tooltip__mnnfp{border-radius:3px;font-size:90%;width:max-content}.styles-module_content__ydYdI{background:inherit;border-radius:inherit;padding:8px 16px}.styles-module_arrow__K0L3T{width:var(--rt-arrow-size);height:var(--rt-arrow-size)}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.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"})}),exports.Tooltip=$;
7
+ "use strict";var e=require("react"),t=require("clsx"),o=require("react-dom"),r=require("@floating-ui/dom");const n={core:!1,base:!1};function l({css:e,id:t="react-tooltip-base-styles",type:o="base",ref:r,state:l={}}){if(!e||"undefined"==typeof document||(void 0!==l[o]?l[o]:n[o]))return;if("core"===o&&"undefined"!=typeof process&&process.env&&process.env.REACT_TOOLTIP_DISABLE_CORE_STYLES)return;if("base"===o&&"undefined"!=typeof process&&process.env&&process.env.REACT_TOOLTIP_DISABLE_BASE_STYLES)return;"core"===o&&(t="react-tooltip-core-styles"),r||(r={});const{insertAt:c}=r;if(document.getElementById(t))return;const s=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.id=t,i.type="text/css","top"===c&&s.firstChild?s.insertBefore(i,s.firstChild):s.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e)),void 0!==l[o]?l[o]=!0:n[o]=!0}const c=r.flip({fallbackAxisSideDirection:"start"}),s=r.shift({padding:5}),i=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:o=null,place:n="top",offset:l=10,strategy:i="absolute",middlewares:u=[r.offset(Number(l)),c,s],border:a,arrowSize:d=8})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};const p=[...u];return o?(p.push(r.arrow({element:o,padding:5})),r.computePosition(e,t,{placement:n,strategy:i,middleware:p}).then(({x:e,y:t,placement:o,middlewareData:r})=>{var n,l;const c={left:`${e}px`,top:`${t}px`,border:a},{x:s,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",p=a&&{borderBottom:a,borderRight:a};let f=0;if(a){const e=`${a}`.match(/(\d+)px/);f=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:c,tooltipArrowStyles:{left:null!=s?`${s}px`:"",top:null!=i?`${i}px`:"",right:"",bottom:"",...p,[u]:`-${d/2+f-1}px`},place:o}})):r.computePosition(e,t,{placement:"bottom",strategy:i,middleware:p}).then(({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o}))},u=(e,t,o)=>{let r=null,n=e;const l=function(...e){const o=()=>{r=null};r||(n.apply(this,e),r=setTimeout(o,t))};return l.cancel=()=>{r&&(clearTimeout(r),r=null)},l.setCallback=e=>{n=e},l},a=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})},d=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(a(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},p="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect,f=e=>{e.current&&(clearTimeout(e.current),e.current=null)};var v={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",content:"core-styles-module_content__BRKdB",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},m={tooltip:"styles-module_tooltip__mnnfp",content:"styles-module_content__ydYdI",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 h=new Map;let y=null;function w(e){const t=e.match(/^\[data-tooltip-id=(['"])((?:\\.|(?!\1).)*)\1\]$/);return t?t[2].replace(/\\(['"])/g,"$1"):null}function b(e){try{return{anchors:Array.from(document.querySelectorAll(e)),error:null}}catch(e){return{anchors:[],error:e instanceof Error?e:new Error(String(e))}}}function S(e,t){var o,r,n,l;const c=b(e),s=null!==(r=null===(o=c.error)||void 0===o?void 0:o.message)&&void 0!==r?r:null,i=null!==(l=null===(n=t.error)||void 0===n?void 0:n.message)&&void 0!==l?l:null;if(u=t.anchors,a=c.anchors,u.length===a.length&&u.every((e,t)=>e===a[t])&&s===i)return;var u,a;const d={...t,anchors:c.anchors,error:c.error};h.set(e,d),function(e){e.subscribers.forEach(t=>t(e.anchors,e.error))}(d)}let E=!1,g=null,A=!1;function R(e){if(e?(g||(g=new Set),e.forEach(e=>g.add(e))):A=!0,E)return;E=!0;const t=()=>{E=!1;const e=A,t=g;var o;A=!1,g=null,e?h.forEach((e,t)=>{S(t,e)}):t&&t.size>0&&(o=t,h.forEach((e,t)=>{(null===e.tooltipId||o.has(e.tooltipId))&&S(t,e)}))};"function"==typeof requestAnimationFrame?requestAnimationFrame(t):Promise.resolve().then(t)}function _(){y||"undefined"==typeof MutationObserver||(y=new MutationObserver(e=>{const t=function(e){var t;if(h.size<=4)return null;const o=new Set;for(const r of e){if("attributes"===r.type){const e=r.target,n=null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"data-tooltip-id");n&&o.add(n),r.oldValue&&o.add(r.oldValue);continue}if("childList"===r.type){const e=e=>{var t,r;for(let n=0;n<e.length;n++){const l=e[n];if(l.nodeType!==Node.ELEMENT_NODE)continue;const c=l,s=null===(t=c.getAttribute)||void 0===t?void 0:t.call(c,"data-tooltip-id");s&&o.add(s);const i=null===(r=c.querySelectorAll)||void 0===r?void 0:r.call(c,"[data-tooltip-id]");if(i){if(i.length>50)return!0;for(let e=0;e<i.length;e++){const t=i[e].getAttribute("data-tooltip-id");t&&o.add(t)}}}return!1};if(e(r.addedNodes)||e(r.removedNodes))return null;continue}}return o}(e);R(t)}),y.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}))}function T(e,t){let o=h.get(e);if(!o){const t=b(e);o={anchors:t.anchors,error:t.error,subscribers:new Set,tooltipId:w(e)},h.set(e,o)}return o.subscribers.add(t),_(),t([...o.anchors],o.error),()=>{const o=h.get(e);o&&(o.subscribers.delete(t),0===o.subscribers.size&&h.delete(e),0===h.size&&y&&(y.disconnect(),y=null))}}const k=new Map;function C(e,t){return`${e}:${t?"capture":"bubble"}`}function O(e,t,o={}){const r=Boolean(o.capture),n=C(e,r),l=function(e,t){const o=C(e,t);let r=k.get(o);if(!r){const n=new Set,l=e=>{n.forEach(t=>{t(e)})};r={handlers:n,dispatch:l,eventType:e,capture:t},k.set(o,r),document.addEventListener(e,l,{capture:t})}return r}(e,r);return l.handlers.add(t),()=>{l.handlers.delete(t),0===l.handlers.size&&(k.delete(n),document.removeEventListener(e,l.dispatch,{capture:r}))}}let L=null;var x=e.memo(({forwardRef:n,id:l,className:c,classNameArrow:s,variant:a="dark",portalRoot:h,anchorSelect:y,place:w="top",offset:b=10,openOnClick:S=!1,positionStrategy:E="absolute",middlewares:g,wrapper:A,delayShow:R=0,delayHide:_=0,autoClose:k,float:C=!1,hidden:x=!1,noArrow:N=!1,clickable:B=!1,openEvents:z,closeEvents:M,globalCloseEvents:$,imperativeModeOnly:I,style:j,position:H,afterShow:D,afterHide:P,disableTooltip:q,content:W,contentWrapperRef:F,isOpen:V,defaultIsOpen:K=!1,setIsOpen:Y,previousActiveAnchor:X,activeAnchor:G,setActiveAnchor:Z,border:J,opacity:Q,arrowColor:U,arrowSize:ee=8,role:te="tooltip"})=>{var oe;const re=e.useRef(null),ne=e.useRef(null),le=e.useRef(null),ce=e.useRef(null),se=e.useRef(null),ie=e.useRef(null),[ue,ae]=e.useState({tooltipStyles:{},tooltipArrowStyles:{},place:w}),[de,pe]=e.useState(!1),[fe,ve]=e.useState(!1),[me,he]=e.useState(null),ye=e.useRef(!1),we=e.useRef(null),be=e.useRef(!1),Se=e.useRef(!1),Ee=e.useRef({getBoundingClientRect:()=>({x:0,y:0,width:0,height:0,top:0,left:0,right:0,bottom:0})});p(()=>(Se.current=!0,()=>{Se.current=!1}),[]);const ge=e.useCallback(e=>{Se.current&&(e&&ve(!0),setTimeout(()=>{Se.current&&(null==Y||Y(e),void 0===V&&pe(e))},10))},[V,Y]);e.useEffect(()=>{if(l){if(de){t(X);const o=e(G),r=[...new Set([...o,l])].filter(Boolean).join(" ");null==G||G.setAttribute("aria-describedby",r)}else t(G);return()=>{t(G),t(X)}}function e(e){var t;return(null===(t=null==e?void 0:e.getAttribute("aria-describedby"))||void 0===t?void 0:t.split(" "))||[]}function t(t){const o=e(t).filter(e=>e!==l);o.length?null==t||t.setAttribute("aria-describedby",o.join(" ")):null==t||t.removeAttribute("aria-describedby")}},[G,de,l,X]),e.useEffect(()=>{if(void 0===V)return()=>null;V&&ve(!0);const e=setTimeout(()=>{pe(V)},10);return()=>{clearTimeout(e)}},[V]),e.useEffect(()=>{if(de!==ye.current)if(f(ie),ye.current=de,de)null==D||D();else{if(null===L){const e=getComputedStyle(document.body);L=(e=>{const t=e.match(/^([\d.]+)(m?s)$/);if(!t)return 0;const[,o,r]=t;return Number(o)*("ms"===r?1:1e3)})(e.getPropertyValue("--rt-transition-show-delay"))}const e=L;ie.current=setTimeout(()=>{ve(!1),he(null),null==P||P()},e+25)}},[P,D,de]),e.useEffect(()=>(f(se),!de||!k||k<=0||(se.current=setTimeout(()=>{ge(!1)},k)),()=>{f(se)}),[G,k,ge,de]);const Ae=e.useCallback(e=>{Se.current&&ae(t=>t.place===e.place&&t.tooltipStyles.left===e.tooltipStyles.left&&t.tooltipStyles.top===e.tooltipStyles.top&&t.tooltipStyles.border===e.tooltipStyles.border&&t.tooltipArrowStyles.left===e.tooltipArrowStyles.left&&t.tooltipArrowStyles.top===e.tooltipArrowStyles.top&&t.tooltipArrowStyles.right===e.tooltipArrowStyles.right&&t.tooltipArrowStyles.bottom===e.tooltipArrowStyles.bottom&&t.tooltipArrowStyles.borderBottom===e.tooltipArrowStyles.borderBottom&&t.tooltipArrowStyles.borderRight===e.tooltipArrowStyles.borderRight?t:e)},[]),Re=e.useRef(fe);Re.current=fe;const _e=e.useCallback((e=R)=>{le.current&&clearTimeout(le.current),Re.current?ge(!0):le.current=setTimeout(()=>{ge(!0)},e)},[R,ge]),Te=e.useCallback((e=_)=>{ce.current&&clearTimeout(ce.current),ce.current=setTimeout(()=>{be.current||ge(!1)},e)},[_,ge]),ke=e.useCallback(({x:e,y:t})=>{var o;Ee.current.getBoundingClientRect=()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t}),i({place:null!==(o=null==me?void 0:me.place)&&void 0!==o?o:w,offset:b,elementReference:Ee.current,tooltipReference:re.current,tooltipArrowReference:ne.current,strategy:E,middlewares:g,border:J,arrowSize:ee}).then(e=>{Ae(e)})},[null==me?void 0:me.place,w,b,E,g,J,ee,Ae]),Ce=e.useCallback(()=>{var e,t;const o=null!==(e=null==me?void 0:me.position)&&void 0!==e?e:H;o?ke(o):C?we.current&&ke(we.current):(null==G?void 0:G.isConnected)&&i({place:null!==(t=null==me?void 0:me.place)&&void 0!==t?t:w,offset:b,elementReference:G,tooltipReference:re.current,tooltipArrowReference:ne.current,strategy:E,middlewares:g,border:J,arrowSize:ee}).then(e=>{Se.current&&Ae(e)})},[null==me?void 0:me.position,null==me?void 0:me.place,H,C,G,w,b,E,g,J,ke,Ae,ee]),Oe=e.useCallback(()=>{ve(!1),ge(!1),Z(null),f(le),f(ce),f(se)},[ge,Z]),Le=fe||K||Boolean(V)||Boolean(G)||Boolean(null==me?void 0:me.anchorSelect),{anchorElements:xe,selector:Ne}=(({id:t,anchorSelect:o,imperativeAnchorSelect:r,activeAnchor:n,disableTooltip:l,onActiveAnchorRemoved:c,trackAnchors:s})=>{const[i,u]=e.useState([]),[a,d]=e.useState(null),p=e.useRef(null),f=e.useMemo(()=>(({id:e,anchorSelect:t,imperativeAnchorSelect:o})=>{var r;let n=null!==(r=null!=o?o:t)&&void 0!==r?r:"";return!n&&e&&(n=`[data-tooltip-id='${e.replace(/'/g,"\\'")}']`),n})({id:t,anchorSelect:o,imperativeAnchorSelect:r}),[t,o,r]),v=e.useMemo(()=>i.filter(e=>!(null==l?void 0:l(e))),[i,l]),m=e.useMemo(()=>{if(!n||!f)return!1;try{return n.matches(f)}catch(e){return!1}},[n,f,v]);return e.useEffect(()=>f&&s?T(f,(e,t)=>{u(e),d(t)}):(u([]),void d(null)),[f,s]),e.useEffect(()=>{a&&p.current!==f&&(p.current=f)},[f,a]),e.useEffect(()=>{n&&(n.isConnected&&(v.includes(n)||m)||c())},[n,v,m,c]),{anchorElements:v,selector:f}})({id:l,anchorSelect:y,imperativeAnchorSelect:null==me?void 0:me.anchorSelect,activeAnchor:G,disableTooltip:q,onActiveAnchorRemoved:Oe,trackAnchors:Le});(({activeAnchor:t,anchorElements:o,anchorSelector:n,clickable:l,closeEvents:c,delayHide:s,delayShow:i,disableTooltip:a,float:p,globalCloseEvents:v,handleHideTooltipDelayed:m,handleShow:h,handleShowTooltipDelayed:y,handleTooltipPosition:w,hoveringTooltip:b,imperativeModeOnly:S,lastFloatPosition:E,openEvents:g,openOnClick:A,rendered:R,setActiveAnchor:_,show:T,tooltipHideDelayTimerRef:k,tooltipRef:C,tooltipShowDelayTimerRef:L,updateTooltipPosition:x})=>{const N=e.useRef(u(e=>{},50)),B=e.useRef(u(()=>{},50)),z=e.useRef(null),M=e.useRef(null),$=e.useRef(null),I=e.useRef(null);t!==$.current&&($.current=t,z.current=d(t));const j=C.current;j!==I.current&&(I.current=j,M.current=d(j));const H=A||(null==g?void 0:g.click)||(null==g?void 0:g.dblclick)||(null==g?void 0:g.mousedown),D=e.useMemo(()=>{const e=g?{...g}:{mouseenter:!0,focus:!0,click:!1,dblclick:!1,mousedown:!1};return!g&&A&&Object.assign(e,{mouseenter:!1,focus:!1,click:!0}),S&&Object.assign(e,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),e},[g,A,S]),P=e.useMemo(()=>{const e=c?{...c}:{mouseleave:!0,blur:!0,click:!1,dblclick:!1,mouseup:!1};return!c&&A&&Object.assign(e,{mouseleave:!1,blur:!1}),S&&Object.assign(e,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),e},[c,A,S]),q=e.useMemo(()=>{const e=v?{...v}:{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:H||!1};return S&&Object.assign(e,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1}),e},[v,H,S]),W=e.useRef(t);W.current=t;const F=e.useRef(T);F.current=T;const V=e.useRef(o);V.current=o;const K=e.useRef(h);K.current=h;const Y=e.useRef(w);Y.current=w;const X=e.useRef(x);X.current=x;const G=e.useRef(()=>null),Z=e.useRef(()=>{}),J=e.useRef(()=>{}),Q=n?function(e){const t=e.match(/^\[data-tooltip-id=(['"])((?:\\.|(?!\1).)*)\1\]$/);return t?t[2].replace(/\\(['"])/g,"$1"):null}(n):null;G.current=e=>{var t,o;const r=e;if(!(null==r?void 0:r.isConnected))return null;if(Q){const e=function(e,t){let o=e;for(;o;){if(o.dataset.tooltipId===t)return o;o=o.parentElement}return null}(r,Q);if(e&&!(null==a?void 0:a(e)))return e}else if(n)try{const e=null!==(t=r.matches(n)?r:r.closest(n))&&void 0!==t?t:null;if(e&&!(null==a?void 0:a(e)))return e}catch(e){return null}return null!==(o=V.current.find(e=>e===r||e.contains(r)))&&void 0!==o?o:null},Z.current=e=>{e&&(e.isConnected?(null==a?void 0:a(e))||(i&&W.current&&e!==W.current?(L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{_(e),h(!0)},i)):(_(e),i?y():h(!0)),k.current&&clearTimeout(k.current)):_(null))},J.current=()=>{l?m(s||100):s?m():h(!1),L.current&&clearTimeout(L.current)};const U=N.current,ee=B.current;U.setCallback(e=>Z.current(e)),ee.setCallback(()=>J.current()),e.useEffect(()=>{const e=[],t=(t,o,r)=>{e.push(O(t,o,r))},o=e=>{var t;return Boolean((null==e?void 0:e.target)&&(null===(t=W.current)||void 0===t?void 0:t.contains(e.target)))},r=e=>{ee.cancel(),U(e)},n=()=>{U.cancel(),ee()},c=()=>{t("mouseover",e=>{const t=G.current(e.target);t&&G.current(e.relatedTarget)!==t&&r(t)})},s=()=>{t("mouseout",e=>{const t=G.current(e.target);if(!t&&!o(e))return;const r=e.relatedTarget,l=t||W.current;(null==l?void 0:l.contains(r))||n()})};D.mouseenter&&c(),P.mouseleave&&s(),D.mouseover&&c(),P.mouseout&&s(),D.focus&&t("focusin",e=>{r(G.current(e.target))}),P.blur&&t("focusout",e=>{const t=G.current(e.target);if(!t&&!o(e))return;const r=e.relatedTarget,l=t||W.current;(null==l?void 0:l.contains(r))||n()});const i=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],u=["click","dblclick","mousedown","mouseup"],a=e=>{var t;const o=G.current(null!==(t=null==e?void 0:e.target)&&void 0!==t?t:null);o&&(F.current&&W.current===o||Z.current(o))},d=e=>{F.current&&o(e)&&J.current()};Object.entries(D).forEach(([e,o])=>{o&&!i.includes(e)&&u.includes(e)&&t(e,a,{capture:!0})}),Object.entries(P).forEach(([e,o])=>{o&&!i.includes(e)&&u.includes(e)&&t(e,d,{capture:!0})}),p&&t("pointermove",e=>{const t=W.current;if(!t)return;if(G.current(e.target)!==t)return;const o=e,r={x:o.clientX,y:o.clientY};Y.current(r),E.current=r});const f=C.current,v=()=>{b.current=!0},m=()=>{b.current=!1,J.current()},h=l&&(P.mouseout||P.mouseleave);return h&&(null==f||f.addEventListener("mouseover",v),null==f||f.addEventListener("mouseout",m)),()=>{e.forEach(e=>e()),h&&(null==f||f.removeEventListener("mouseover",v),null==f||f.removeEventListener("mouseout",m)),U.cancel(),ee.cancel()}},[D,P,p,l,R]),e.useEffect(()=>{const e=()=>{K.current(!1)},o=M.current,n=z.current;q.scroll&&(window.addEventListener("scroll",e),null==n||n.addEventListener("scroll",e),null==o||o.addEventListener("scroll",e));let l=null;q.resize?window.addEventListener("resize",e):t&&C.current&&(l=r.autoUpdate(t,C.current,()=>X.current(),{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const c=e=>{"Escape"===e.key&&K.current(!1)};q.escape&&window.addEventListener("keydown",c);const s=e=>{var t,o;if(!F.current)return;const r=e.target;(null==r?void 0:r.isConnected)&&((null===(t=C.current)||void 0===t?void 0:t.contains(r))||(null===(o=W.current)||void 0===o?void 0:o.contains(r))||V.current.some(e=>null==e?void 0:e.contains(r))||(K.current(!1),f(L)))};return q.clickOutsideAnchor&&window.addEventListener("click",s),()=>{q.scroll&&(window.removeEventListener("scroll",e),null==n||n.removeEventListener("scroll",e),null==o||o.removeEventListener("scroll",e)),q.resize&&window.removeEventListener("resize",e),l&&l(),q.escape&&window.removeEventListener("keydown",c),q.clickOutsideAnchor&&window.removeEventListener("click",s)}},[q,t])})({activeAnchor:G,anchorElements:xe,anchorSelector:Ne,clickable:B,closeEvents:M,delayHide:_,delayShow:R,disableTooltip:q,float:C,globalCloseEvents:$,handleHideTooltipDelayed:Te,handleShow:ge,handleShowTooltipDelayed:_e,handleTooltipPosition:ke,hoveringTooltip:be,imperativeModeOnly:I,lastFloatPosition:we,openEvents:z,openOnClick:S,rendered:fe,setActiveAnchor:Z,show:de,tooltipHideDelayTimerRef:ce,tooltipRef:re,tooltipShowDelayTimerRef:le,updateTooltipPosition:Ce});const Be=e.useRef(Ce);Be.current=Ce,e.useEffect(()=>{fe&&Ce()},[fe,Ce]),e.useEffect(()=>{if(!fe||!(null==F?void 0:F.current))return()=>null;let e=null;const t=new ResizeObserver(()=>{e&&clearTimeout(e),e=setTimeout(()=>{Se.current&&Be.current(),e=null},0)});return t.observe(F.current),()=>{t.disconnect(),e&&clearTimeout(e)}},[W,F,fe]),e.useEffect(()=>{var e;if(!(K||Boolean(V)))return;const t=(()=>{if(!G||!(null==me?void 0:me.anchorSelect))return!1;try{return G.matches(me.anchorSelect)}catch(e){return!1}})();if(!G||!xe.includes(G)){if(t)return;Z(null!==(e=xe[0])&&void 0!==e?e:null)}},[G,xe,K,null==me?void 0:me.anchorSelect,V,fe,Z]),e.useEffect(()=>(K&&ge(!0),()=>{f(le),f(ce),f(se),f(ie)}),[K,ge]),e.useEffect(()=>{le.current&&(f(le),_e(R))},[R,_e]);const ze=null!==(oe=null==me?void 0:me.content)&&void 0!==oe?oe:W,Me=null!=ze,$e=de&&void 0!==ue.tooltipStyles.left,Ie=e.useMemo(()=>({...j,...ue.tooltipStyles,opacity:void 0!==Q&&$e?Q:void 0}),[j,ue.tooltipStyles,Q,$e]),je=e.useMemo(()=>U?`linear-gradient(to right bottom, transparent 50%, ${U} 50%)`:void 0,[U]),He=e.useMemo(()=>({...ue.tooltipArrowStyles,background:je,"--rt-arrow-size":`${ee}px`}),[ue.tooltipArrowStyles,je,ee]);e.useImperativeHandle(n,()=>({open:e=>{let t=null;if(null==e?void 0:e.anchorSelect){try{t=document.querySelector(e.anchorSelect)}catch(e){return}if(!t)return}t&&Z(t),he(null!=e?e:null),(null==e?void 0:e.delay)?_e(e.delay):ge(!0)},close:e=>{(null==e?void 0:e.delay)?Te(e.delay):ge(!1)},activeAnchor:G,place:ue.place,isOpen:Boolean(fe&&!x&&Me&&$e)})),e.useEffect(()=>()=>{f(le),f(ce),f(se),f(ie)},[]);const De=fe&&!x&&Me?e.createElement(A,{id:l,role:te,className:t("react-tooltip",v.tooltip,m.tooltip,m[a],c,`react-tooltip__place-${ue.place}`,v[$e?"show":"closing"],$e?"react-tooltip__show":"react-tooltip__closing","fixed"===E&&v.fixed,B&&v.clickable),onTransitionEnd:e=>{f(ie),de||"opacity"!==e.propertyName||(ve(!1),he(null),null==P||P())},style:Ie,ref:re},e.createElement(A,{className:t("react-tooltip-content-wrapper",v.content,m.content)},ze),e.createElement(A,{className:t("react-tooltip-arrow",v.arrow,m.arrow,s,N&&v.noArrow),style:He,ref:ne})):null;return De?h?o.createPortal(De,h):De:null});const N=new Map;let B=null;const z={attributes:!0,childList:!1,subtree:!1};function M(e,t){const o=(B||(B=new MutationObserver(e=>{var t;for(const o of e){if("attributes"!==o.type||!(null===(t=o.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))continue;const e=o.target,r=N.get(e);r&&r.forEach(t=>t(e))}})),B);let r=N.get(e);return r||(r=new Set,N.set(e,r),o.observe(e,z)),r.add(t),()=>{const r=N.get(e);r&&(r.delete(t),0===r.size&&(N.delete(e),0===N.size?o.disconnect():(o.disconnect(),N.forEach((e,t)=>{o.observe(t,z)}))))}}const $=e.forwardRef(({id:o,anchorSelect:r,content:n,render:l,className:c,classNameArrow:s,variant:i="dark",portalRoot:u,place:a="top",offset:d=10,wrapper:p="div",children:f=null,openOnClick:v=!1,positionStrategy:m="absolute",middlewares:h,delayShow:y=0,delayHide:w=0,autoClose:b,float:S=!1,hidden:E=!1,noArrow:g=!1,clickable:A=!1,openEvents:R,closeEvents:_,globalCloseEvents:T,imperativeModeOnly:k=!1,style:C,position:O,isOpen:L,defaultIsOpen:N=!1,disableStyleInjection:B=!1,border:z,opacity:$,arrowColor:I,arrowSize:j,setIsOpen:H,afterShow:D,afterHide:P,disableTooltip:q,role:W="tooltip"},F)=>{var V,K,Y,X,G,Z,J,Q;const[U,ee]=e.useState(null),[te,oe]=e.useState({}),re=e.useRef(null),ne=e.useRef(B),le=e.useCallback(e=>{ee(t=>((null==e?void 0:e.isSameNode(t))||(re.current=t),e))},[]),ce=e=>{const t=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},{});return t};e.useEffect(()=>{ne.current},[B]),e.useEffect(()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===B,disableBase:B}}))},[]),e.useEffect(()=>{if(!U)return oe({}),()=>{};const e=e=>{const t=ce(e);oe(e=>{const o=Object.keys(t),r=Object.keys(e);return o.length===r.length&&o.every(o=>t[o]===e[o])?e:t})};e(U);return M(U,e)},[U,r]),e.useEffect(()=>{},[z,$,null==C?void 0:C.border,null==C?void 0:C.opacity]);const se=U?ce(U):te,ie=null!==(V=se.content)&&void 0!==V?V:n,ue=null!==(K=se.place)&&void 0!==K?K:a,ae=null!==(Y=se.variant)&&void 0!==Y?Y:i,de=null==se.offset?d:Number(se.offset),pe=null!==(X=se.wrapper)&&void 0!==X?X:p,fe=null!==(G=se["position-strategy"])&&void 0!==G?G:m,ve=null==se["delay-show"]?y:Number(se["delay-show"]),me=null==se["delay-hide"]?w:Number(se["delay-hide"]),he=null==se["auto-close"]?b:Number(se["auto-close"]),ye=null==se.float?S:"true"===se.float,we=null==se.hidden?E:"true"===se.hidden,be=null!==(Z=se["class-name"])&&void 0!==Z?Z:null;let Se=f;const Ee=e.useRef(null);if(l){const t=l({content:null!==(Q=null!==(J=se.content)&&void 0!==J?J:ie)&&void 0!==Q?Q:null,activeAnchor:U});Se=t?e.createElement("div",{ref:Ee,className:"react-tooltip-content-wrapper"},t):null}else null!=ie&&(Se=ie);const ge={forwardRef:F,id:o,anchorSelect:r,className:t(c,be),classNameArrow:s,content:Se,contentWrapperRef:Ee,portalRoot:u,place:ue,variant:ae,offset:de,wrapper:pe,openOnClick:v,positionStrategy:fe,middlewares:h,delayShow:ve,delayHide:me,autoClose:he,float:ye,hidden:we,noArrow:g,clickable:A,openEvents:R,closeEvents:_,globalCloseEvents:T,imperativeModeOnly:k,style:C,position:O,isOpen:L,defaultIsOpen:N,border:z,opacity:$,arrowColor:I,arrowSize:j,setIsOpen:H,afterShow:D,afterHide:P,disableTooltip:q,activeAnchor:U,previousActiveAnchor:re.current,setActiveAnchor:le,role:W};return e.createElement(x,{...ge})});var I=e.memo($);"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",e=>{e.detail.disableCore||l({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;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s;--rt-arrow-size:8px}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit;z-index:-1;-webkit-backface-visibility:hidden;backface-visibility:hidden}.core-styles-module_content__BRKdB{position:relative;z-index:1}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out;will-change:opacity}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in;will-change:opacity}`,type:"core"}),e.detail.disableBase||l({css:`
8
+ .styles-module_tooltip__mnnfp{border-radius:3px;font-size:90%;width:max-content}.styles-module_content__ydYdI{background:inherit;border-radius:inherit;padding:8px 16px}.styles-module_arrow__K0L3T{width:var(--rt-arrow-size);height:var(--rt-arrow-size)}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.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"})}),exports.Tooltip=I;
9
9
  //# sourceMappingURL=react-tooltip.min.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-tooltip.min.cjs","sources":["../../src/utils/handle-style.ts","../../src/utils/compute-tooltip-position.ts","../../src/utils/debounce.ts","../../src/utils/get-scroll-parent.ts","../../src/utils/use-isomorphic-layout-effect.ts","../../src/utils/clear-timeout-ref.ts","../../src/components/Tooltip/anchor-registry.ts","../../src/components/Tooltip/use-tooltip-anchors.tsx","../../src/components/Tooltip/event-delegation.ts","../../src/components/Tooltip/Tooltip.tsx","../../src/utils/css-time-to-ms.ts","../../src/components/Tooltip/use-tooltip-events.tsx","../../src/utils/parse-data-tooltip-id-selector.ts","../../src/utils/resolve-data-tooltip-anchor.ts","../../src/components/TooltipController/shared-attribute-observer.ts","../../src/components/TooltipController/TooltipController.tsx","../../src/index.tsx"],"names":["injected","core","base","injectStyle","css","id","type","ref","state","document","process","env","REACT_TOOLTIP_DISABLE_CORE_STYLES","REACT_TOOLTIP_DISABLE_BASE_STYLES","insertAt","getElementById","head","getElementsByTagName","style","createElement","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","defaultFlip","flip","fallbackAxisSideDirection","defaultShift","shift","padding","computeTooltipPosition","async","elementReference","tooltipReference","tooltipArrowReference","place","offset","offsetValue","strategy","middlewares","Number","border","arrowSize","tooltipStyles","tooltipArrowStyles","middleware","push","arrow","element","computePosition","placement","then","x","y","middlewareData","styles","left","top","arrowX","arrowY","_a","staticSide","_b","right","bottom","split","borderSide","borderBottom","borderRight","borderWidth","match","debounce","func","wait","immediate","timeout","currentFunc","debounced","args","later","apply","this","setTimeout","cancel","clearTimeout","setCallback","newFunc","isScrollable","node","HTMLElement","SVGElement","getComputedStyle","some","propertyName","value","getPropertyValue","getScrollParent","currentParent","parentElement","scrollingElement","documentElement","useIsomorphicLayoutEffect","window","useLayoutEffect","useEffect","clearTimeoutRef","current","registry","Map","documentObserver","extractTooltipId","selector","replace","readAnchorsForSelector","anchors","Array","from","querySelectorAll","error","Error","String","refreshEntry","entry","nextState","nextErrorMessage","message","previousErrorMessage","_d","_c","length","every","anchor","index","nextEntry","set","subscribers","forEach","subscriber","notifySubscribers","refreshScheduled","pendingTooltipIds","pendingFullRefresh","scheduleRefresh","affectedTooltipIds","Set","add","flush","fullRefresh","ids","affectedIds","size","tooltipId","has","requestAnimationFrame","Promise","resolve","ensureDocumentObserver","MutationObserver","records","record","target","currentId","getAttribute","call","oldValue","gatherIds","nodes","i","nodeType","Node","ELEMENT_NODE","el","descendants","j","descId","addedNodes","removedNodes","collectAffectedTooltipIds","observe","body","childList","subtree","attributes","attributeFilter","attributeOldValue","subscribeAnchorSelector","get","initialState","currentEntry","delete","disconnect","handlersByType","dispatch","event","handlers","handler","addDelegatedEventListener","eventType","addEventListener","getOrCreateSet","removeEventListener","globalTransitionShowDelay","Tooltip$1","memo","forwardRef","className","classNameArrow","variant","portalRoot","anchorSelect","openOnClick","positionStrategy","wrapper","WrapperElement","delayShow","delayHide","autoClose","float","hidden","noArrow","clickable","openEvents","closeEvents","globalCloseEvents","imperativeModeOnly","externalStyles","position","afterShow","afterHide","disableTooltip","content","contentWrapperRef","isOpen","defaultIsOpen","setIsOpen","previousActiveAnchor","activeAnchor","setActiveAnchor","opacity","arrowColor","role","tooltipRef","useRef","tooltipArrowRef","tooltipShowDelayTimerRef","tooltipHideDelayTimerRef","tooltipAutoCloseTimerRef","missedTransitionTimerRef","computedPosition","setComputedPosition","useState","show","setShow","rendered","setRendered","imperativeOptions","setImperativeOptions","wasShowing","lastFloatPosition","hoveringTooltip","mounted","virtualElementRef","getBoundingClientRect","width","height","handleShow","useCallback","undefined","removeAriaDescribedBy","currentDescribedBy","getAriaDescribedBy","describedBy","filter","Boolean","join","setAttribute","newDescribedBy","s","removeAttribute","time","amount","unit","cssTimeToMs","transitionShowDelay","handleComputedPosition","newComputedPosition","oldComputedPosition","renderedRef","handleShowTooltipDelayed","delay","handleHideTooltipDelayed","handleTooltipPosition","computedStylesData","updateTooltipPosition","actualPosition","isConnected","handleActiveAnchorRemoved","shouldTrackAnchors","anchorElements","anchorSelector","imperativeAnchorSelect","onActiveAnchorRemoved","trackAnchors","rawAnchorElements","setRawAnchorElements","selectorError","setSelectorError","warnedSelectorRef","useMemo","getAnchorSelector","activeAnchorMatchesSelector","matches","includes","useTooltipAnchors","debouncedShowRef","_anchor","debouncedHideRef","anchorScrollParentRef","tooltipScrollParentRef","prevAnchorRef","prevTooltipRef","currentTooltipEl","hasClickEvent","click","dblclick","mousedown","actualOpenEvents","events","mouseenter","focus","Object","assign","actualCloseEvents","mouseleave","blur","mouseup","actualGlobalCloseEvents","escape","scroll","resize","clickOutsideAnchor","activeAnchorRef","showRef","anchorElementsRef","handleShowRef","handleTooltipPositionRef","updateTooltipPositionRef","resolveAnchorElementRef","handleShowTooltipRef","handleHideTooltipRef","dataTooltipId","parseDataTooltipIdSelector","targetElement","matchedAnchor","currentElement","dataset","resolveDataTooltipAnchor","closest","find","contains","debouncedShow","debouncedHide","cleanupFns","addDelegatedListener","listener","activeAnchorContainsTarget","debouncedHandleShowTooltip","debouncedHandleHideTooltip","addDelegatedHoverOpenListener","relatedTarget","addDelegatedHoverCloseListener","targetAnchor","containerAnchor","mouseover","mouseout","regularEvents","clickEvents","handleClickOpenTooltipAnchor","handleClickCloseTooltipAnchor","entries","enabled","currentActiveAnchor","mouseEvent","mousePosition","clientX","clientY","tooltipElement","handleMouseOverTooltip","handleMouseOutTooltip","addHoveringTooltipListeners","fn","handleScrollResize","tooltipScrollParent","anchorScrollParent","updateTooltipCleanup","autoUpdate","ancestorResize","elementResize","layoutShift","handleEsc","key","handleClickOutsideAnchors","useTooltipEvents","timeoutId","contentObserver","ResizeObserver","activeAnchorMatchesImperativeSelector","actualContent","hasContent","canShow","tooltipStyle","arrowBackground","arrowStyle","background","useImperativeHandle","open","options","imperativeAnchor","querySelector","close","tooltipNode","React","clsx","coreStyles","onTransitionEnd","createPortal","observedElements","sharedObserver","observerConfig","observeAnchorAttributes","callback","observer","mutationList","mutation","attributeName","startsWith","callbacks","cb","cbs","_cbs","TooltipController","render","children","disableStyleInjection","anchorDataAttributes","setAnchorDataAttributes","previousActiveAnchorRef","styleInjectionRef","handleSetActiveAnchor","prev","isSameNode","getDataAttributesFromAnchorElement","dataAttributes","getAttributeNames","reduce","acc","name","dispatchEvent","CustomEvent","detail","disableCore","disableBase","updateAttributes","attrs","keys","prevKeys","currentAnchorDataAttributes","tooltipContent","tooltipPlace","tooltipVariant","tooltipOffset","tooltipWrapper","tooltipPositionStrategy","_e","tooltipDelayShow","tooltipDelayHide","tooltipAutoClose","tooltipFloat","tooltipHidden","tooltipClassName","_f","renderedContent","_h","_g","props","Tooltip","TooltipController_default"],"mappings":";;;;;;2GACA,MAIMA,EAAW,CACfC,MAAM,EACNC,MAAM,GAQR,SAASC,GAAYC,IACnBA,EAAGC,GACHA,EAdmC,4BAcFC,KACjCA,EAAO,OAAMC,IACbA,EAAGC,MACHA,EAAQ,CAAA,IASR,IACGJ,GACmB,oBAAbK,gBACiB,IAAhBD,EAAMF,GAAwBE,EAAMF,GAAQN,EAASM,IAE7D,OAGF,GACW,SAATA,GACmB,oBAAZI,SACPA,QAAQC,KACRD,QAAQC,IAAIC,kCAEZ,OAGF,GACW,SAATN,GACmB,oBAAZI,SACPA,QAAQC,KACRD,QAAQC,IAAIE,kCAEZ,OAGW,SAATP,IACFD,EAvDiC,6BA0D9BE,IACHA,EAAM,CAAA,GAER,MAAMO,SAAEA,GAAaP,EAErB,GAAIE,SAASM,eAAeV,GAE1B,OAGF,MAAMW,EAAOP,SAASO,MAAQP,SAASQ,qBAAqB,QAAQ,GAE9DC,EAAaT,SAASU,cAAc,SAC1CD,EAAMb,GAAKA,EACXa,EAAMZ,KAAO,WAEI,QAAbQ,GACEE,EAAKI,WACPJ,EAAKK,aAAaH,EAAOF,EAAKI,YAKhCJ,EAAKM,YAAYJ,GAGfA,EAAMK,WACRL,EAAMK,WAAWC,QAAUpB,EAE3Bc,EAAMI,YAAYb,SAASgB,eAAerB,SAGjB,IAAhBI,EAAMF,GACfE,EAAMF,IAAQ,EAEdN,EAASM,IAAQ,CAErB,CC5FA,MAAMoB,EAAcC,EAAAA,KAAK,CAAEC,0BAA2B,UAChDC,EAAeC,EAAAA,MAAM,CAAEC,QAAS,IAEhCC,EAAyBC,OAC7BC,mBAAmB,KACnBC,mBAAmB,KACnBC,wBAAwB,KACxBC,QAA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oQ,GACXnQ,MAAOoQ,GACPnQ,OAAQoQ,GACRnQ,UACAC,YACAC,aACAC,cACAC,oBACAC,qBACAhN,QACAkN,WACAM,SACAC,gBACAhM,SACAqM,UACAC,aACArM,YACAgM,YACAP,YACAC,YACAC,iBACAO,eACAD,qBAAsBmN,GAAwBpV,QAC9CmI,gBAAiBmN,GACjBhN,QAGF,OAAOqL,EAAApZ,cAACod,EAAO,IAAKD,OAIxB,IAAAE,EAAe3R,EAAAA,KAAK6O,GCpPE,oBAAXlV,QACTA,OAAOgG,iBAAiB,8BACtBL,IAEKA,EAAM0Q,OAAOC,aAChB3c,EAAY,CAAEC,IARM,qCAQkBE,KAAM,SAEzC6L,EAAM0Q,OAAOE,aAChB5c,EAAY,CAAEC,IAVE,gCAUkBE,KAAM,QAE3C"}
1
+ {"version":3,"file":"react-tooltip.min.cjs","sources":["../src/utils/handle-style.ts","../src/utils/compute-tooltip-position.ts","../src/utils/debounce.ts","../src/utils/get-scroll-parent.ts","../src/utils/use-isomorphic-layout-effect.ts","../src/utils/clear-timeout-ref.ts","../src/components/Tooltip/anchor-registry.ts","../src/components/Tooltip/use-tooltip-anchors.tsx","../src/components/Tooltip/event-delegation.ts","../src/components/Tooltip/Tooltip.tsx","../src/utils/css-time-to-ms.ts","../src/components/Tooltip/use-tooltip-events.tsx","../src/utils/parse-data-tooltip-id-selector.ts","../src/utils/resolve-data-tooltip-anchor.ts","../src/components/TooltipController/shared-attribute-observer.ts","../src/components/TooltipController/TooltipController.tsx","../src/index.tsx"],"sourcesContent":["// This is the ID for the core styles of ReactTooltip\nconst REACT_TOOLTIP_CORE_STYLES_ID = 'react-tooltip-core-styles'\n// This is the ID for the visual styles of ReactTooltip\nconst REACT_TOOLTIP_BASE_STYLES_ID = 'react-tooltip-base-styles'\n\nconst injected = {\n core: false,\n base: false,\n}\n\n/**\n * Note about `state` parameter:\n * This parameter is used to keep track of the state of the styles\n * into the tests since the const `injected` is not acessible or resettable in the tests\n */\nfunction injectStyle({\n css,\n id = REACT_TOOLTIP_BASE_STYLES_ID,\n type = 'base',\n ref,\n state = {},\n}: {\n css: string\n id?: string\n type?: 'core' | 'base'\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref?: any\n state?: { [key: string]: boolean }\n}) {\n if (\n !css ||\n typeof document === 'undefined' ||\n (typeof state[type] !== 'undefined' ? state[type] : injected[type])\n ) {\n return\n }\n\n if (\n type === 'core' &&\n typeof process !== 'undefined' && // this validation prevents docs from breaking even with `process?`\n process.env &&\n process.env.REACT_TOOLTIP_DISABLE_CORE_STYLES\n ) {\n return\n }\n\n if (\n type === 'base' &&\n typeof process !== 'undefined' && // this validation prevents docs from breaking even with `process?`\n process.env &&\n process.env.REACT_TOOLTIP_DISABLE_BASE_STYLES\n ) {\n return\n }\n\n if (type === 'core') {\n id = REACT_TOOLTIP_CORE_STYLES_ID\n }\n\n if (!ref) {\n ref = {}\n }\n const { insertAt } = ref\n\n if (document.getElementById(id)) {\n // this could happen in cases the tooltip is imported by multiple js modules\n return\n }\n\n const head = document.head || document.getElementsByTagName('head')[0]\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const style: any = document.createElement('style')\n style.id = id\n style.type = 'text/css'\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n\n if (typeof state[type] !== 'undefined') {\n state[type] = true\n } else {\n injected[type] = true // internal global state that jest doesn't have access\n }\n}\n\nexport { injectStyle, injected }\n","import { computePosition, offset, shift, arrow, flip } from '@floating-ui/dom'\nimport type { IComputePositionArgs } from './compute-tooltip-position-types'\n\n// Hoisted constant middlewares — these configs never change\nconst defaultFlip = flip({ fallbackAxisSideDirection: 'start' })\nconst defaultShift = shift({ padding: 5 })\n\nconst computeTooltipPosition = async ({\n elementReference = null,\n tooltipReference = null,\n tooltipArrowReference = null,\n place = 'top',\n offset: offsetValue = 10,\n strategy = 'absolute',\n middlewares = [offset(Number(offsetValue)), defaultFlip, defaultShift],\n border,\n arrowSize = 8,\n}: IComputePositionArgs) => {\n if (!elementReference) {\n // elementReference can be null or undefined and we will not compute the position\n\n // console.error('The reference element for tooltip was not defined: ', elementReference)\n return { tooltipStyles: {}, tooltipArrowStyles: {}, place }\n }\n\n if (tooltipReference === null) {\n return { tooltipStyles: {}, tooltipArrowStyles: {}, place }\n }\n\n const middleware = [...middlewares]\n\n if (tooltipArrowReference) {\n middleware.push(arrow({ element: tooltipArrowReference as HTMLElement, padding: 5 }))\n\n return computePosition(elementReference as HTMLElement, tooltipReference as HTMLElement, {\n placement: place,\n strategy,\n middleware,\n }).then(({ x, y, placement, middlewareData }) => {\n const styles = { left: `${x}px`, top: `${y}px`, border }\n\n /* c8 ignore start */\n const { x: arrowX, y: arrowY } = middlewareData.arrow ?? { x: 0, y: 0 }\n\n const staticSide =\n {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }[placement.split('-')[0]] ?? 'bottom'\n /* c8 ignore end */\n\n const borderSide = border && {\n borderBottom: border,\n borderRight: border,\n }\n\n let borderWidth = 0\n if (border) {\n const match = `${border}`.match(/(\\d+)px/)\n if (match?.[1]) {\n borderWidth = Number(match[1])\n } else {\n /**\n * this means `border` was set without `width`,\n * or non-px value (such as `medium`, `thick`, ...)\n */\n borderWidth = 1\n }\n }\n\n /* c8 ignore start */\n const arrowStyle = {\n left: arrowX != null ? `${arrowX}px` : '',\n top: arrowY != null ? `${arrowY}px` : '',\n right: '',\n bottom: '',\n ...borderSide,\n [staticSide]: `-${arrowSize / 2 + borderWidth - 1}px`,\n }\n /* c8 ignore end */\n\n return { tooltipStyles: styles, tooltipArrowStyles: arrowStyle, place: placement }\n })\n }\n\n return computePosition(elementReference as HTMLElement, tooltipReference as HTMLElement, {\n placement: 'bottom',\n strategy,\n middleware,\n }).then(({ x, y, placement }) => {\n const styles = { left: `${x}px`, top: `${y}px` }\n\n return { tooltipStyles: styles, tooltipArrowStyles: {}, place: placement }\n })\n}\n\nexport default computeTooltipPosition\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * This function debounce the received function\n * @param { function } \tfunc\t\t\t\tFunction to be debounced\n * @param { number } \t\twait\t\t\t\tTime to wait before execut the function\n * @param { boolean } \timmediate\t\tParam to define if the function will be executed immediately\n */\nconst debounce = <T, A extends any[]>(\n func: (...args: A) => void,\n wait?: number,\n immediate?: boolean,\n) => {\n let timeout: NodeJS.Timeout | null = null\n let currentFunc = func\n\n const debounced = function debounced(this: T, ...args: A): void {\n const later = () => {\n timeout = null\n if (!immediate) {\n currentFunc.apply(this, args)\n }\n }\n\n if (immediate && !timeout) {\n /**\n * there's no need to clear the timeout\n * since we expect it to resolve and set `timeout = null`\n */\n currentFunc.apply(this, args)\n timeout = setTimeout(later, wait)\n }\n\n if (!immediate) {\n if (timeout) {\n clearTimeout(timeout)\n }\n timeout = setTimeout(later, wait)\n }\n }\n\n debounced.cancel = () => {\n /* c8 ignore start */\n if (!timeout) {\n return\n }\n /* c8 ignore end */\n clearTimeout(timeout)\n timeout = null\n }\n\n debounced.setCallback = (newFunc: (...args: A) => void) => {\n currentFunc = newFunc\n }\n\n return debounced\n}\n\nexport default debounce\n","export const isScrollable = (node: Element) => {\n if (!(node instanceof HTMLElement || node instanceof SVGElement)) {\n return false\n }\n const style = getComputedStyle(node)\n return ['overflow', 'overflow-x', 'overflow-y'].some((propertyName) => {\n const value = style.getPropertyValue(propertyName)\n return value === 'auto' || value === 'scroll'\n })\n}\n\nconst getScrollParent = (node: Element | null) => {\n if (!node) {\n return null\n }\n let currentParent = node.parentElement\n while (currentParent) {\n if (isScrollable(currentParent)) {\n return currentParent\n }\n currentParent = currentParent.parentElement\n }\n return document.scrollingElement || document.documentElement\n}\n\nexport default getScrollParent\n","import { useLayoutEffect, useEffect } from 'react'\n\n// React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser. We need useLayoutEffect to ensure the store\n// subscription callback always has the selector from the latest render commit\n// available, otherwise a store update may happen between render and the effect,\n// which may cause missed updates; we also must ensure the store subscription\n// is created synchronously, otherwise a store update may occur before the\n// subscription is created and an inconsistent state may be observed\nconst isHopefullyDomEnvironment =\n typeof window !== 'undefined' &&\n typeof window.document !== 'undefined' &&\n typeof window.document.createElement !== 'undefined'\n\nconst useIsomorphicLayoutEffect = isHopefullyDomEnvironment ? useLayoutEffect : useEffect\n\nexport default useIsomorphicLayoutEffect\n","const clearTimeoutRef = (ref: React.RefObject<NodeJS.Timeout | null>) => {\n if (ref.current) {\n clearTimeout(ref.current)\n\n ref.current = null\n }\n}\n\nexport default clearTimeoutRef\n","type AnchorRegistrySubscriber = (anchors: HTMLElement[], error: Error | null) => void\n\ntype AnchorRegistryEntry = {\n anchors: HTMLElement[]\n error: Error | null\n subscribers: Set<AnchorRegistrySubscriber>\n /**\n * When the selector is a simple `[data-tooltip-id='value']` pattern,\n * this holds the extracted tooltip ID so we can skip expensive\n * querySelectorAll calls when the mutation doesn't affect it.\n */\n tooltipId: string | null\n}\n\nconst registry = new Map<string, AnchorRegistryEntry>()\n\nlet documentObserver: MutationObserver | null = null\n\n/**\n * Extract a tooltip ID from a simple `[data-tooltip-id='value']` selector.\n * Returns null for complex or custom selectors.\n */\nfunction extractTooltipId(selector: string): string | null {\n const match = selector.match(/^\\[data-tooltip-id=(['\"])((?:\\\\.|(?!\\1).)*)\\1\\]$/)\n return match ? match[2].replace(/\\\\(['\"])/g, '$1') : null\n}\n\nfunction areAnchorListsEqual(left: HTMLElement[], right: HTMLElement[]) {\n if (left.length !== right.length) {\n return false\n }\n\n return left.every((anchor, index) => anchor === right[index])\n}\n\nfunction readAnchorsForSelector(selector: string) {\n try {\n return {\n anchors: Array.from(document.querySelectorAll<HTMLElement>(selector)),\n error: null,\n }\n } catch (error) {\n return {\n anchors: [],\n error: error instanceof Error ? error : new Error(String(error)),\n }\n }\n}\n\nfunction notifySubscribers(entry: AnchorRegistryEntry) {\n entry.subscribers.forEach((subscriber) => subscriber(entry.anchors, entry.error))\n}\n\nfunction refreshEntry(selector: string, entry: AnchorRegistryEntry) {\n const nextState = readAnchorsForSelector(selector)\n const nextErrorMessage = nextState.error?.message ?? null\n const previousErrorMessage = entry.error?.message ?? null\n\n if (\n areAnchorListsEqual(entry.anchors, nextState.anchors) &&\n nextErrorMessage === previousErrorMessage\n ) {\n return\n }\n\n const nextEntry = {\n ...entry,\n anchors: nextState.anchors,\n error: nextState.error,\n }\n\n registry.set(selector, nextEntry)\n notifySubscribers(nextEntry)\n}\n\nfunction refreshAllEntries() {\n registry.forEach((entry, selector) => {\n refreshEntry(selector, entry)\n })\n}\n\nlet refreshScheduled = false\nlet pendingTooltipIds: Set<string> | null = null\nlet pendingFullRefresh = false\n\nfunction scheduleRefresh(affectedTooltipIds: Set<string> | null) {\n if (affectedTooltipIds) {\n if (!pendingTooltipIds) {\n pendingTooltipIds = new Set()\n }\n affectedTooltipIds.forEach((id) => pendingTooltipIds!.add(id))\n } else {\n pendingFullRefresh = true\n }\n\n if (refreshScheduled) {\n return\n }\n refreshScheduled = true\n\n const flush = () => {\n refreshScheduled = false\n const fullRefresh = pendingFullRefresh\n const ids = pendingTooltipIds\n pendingFullRefresh = false\n pendingTooltipIds = null\n\n if (fullRefresh) {\n refreshAllEntries()\n } else if (ids && ids.size > 0) {\n refreshEntriesForTooltipIds(ids)\n }\n }\n\n if (typeof requestAnimationFrame === 'function') {\n requestAnimationFrame(flush)\n } else {\n Promise.resolve().then(flush)\n }\n}\n\n/**\n * Only refresh entries whose tooltipId is in the affected set,\n * plus any entries with custom (non-tooltipId) selectors.\n */\nfunction refreshEntriesForTooltipIds(affectedIds: Set<string>) {\n registry.forEach((entry, selector) => {\n if (entry.tooltipId === null || affectedIds.has(entry.tooltipId)) {\n refreshEntry(selector, entry)\n }\n })\n}\n\n/**\n * Collect tooltip IDs from mutation records. Returns null when targeted\n * analysis is not worthwhile (few registry entries, or too many nodes to scan).\n */\nfunction collectAffectedTooltipIds(records: MutationRecord[]): Set<string> | null {\n // Targeted refresh only pays off when there are many distinct selectors.\n // With few entries, full refresh is already cheap — skip the analysis overhead.\n if (registry.size <= 4) {\n return null\n }\n\n const ids = new Set<string>()\n\n for (const record of records) {\n if (record.type === 'attributes') {\n const target = record.target as HTMLElement\n const currentId = target.getAttribute?.('data-tooltip-id')\n if (currentId) ids.add(currentId)\n if (record.oldValue) ids.add(record.oldValue)\n continue\n }\n\n if (record.type === 'childList') {\n const gatherIds = (nodes: NodeList) => {\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i]\n if (node.nodeType !== Node.ELEMENT_NODE) continue\n const el = node as HTMLElement\n const id = el.getAttribute?.('data-tooltip-id')\n if (id) ids.add(id)\n // For large subtrees, bail out to full refresh to avoid double-scanning\n const descendants = el.querySelectorAll?.('[data-tooltip-id]')\n if (descendants) {\n if (descendants.length > 50) {\n return true // signal bail-out\n }\n for (let j = 0; j < descendants.length; j++) {\n const descId = descendants[j].getAttribute('data-tooltip-id')\n if (descId) ids.add(descId)\n }\n }\n }\n return false\n }\n if (gatherIds(record.addedNodes) || gatherIds(record.removedNodes)) {\n return null // large mutation — full refresh is cheaper\n }\n continue\n }\n }\n\n return ids\n}\n\nfunction ensureDocumentObserver() {\n if (documentObserver || typeof MutationObserver === 'undefined') {\n return\n }\n\n documentObserver = new MutationObserver((records) => {\n const affectedIds = collectAffectedTooltipIds(records)\n scheduleRefresh(affectedIds)\n })\n\n documentObserver.observe(document.body, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['data-tooltip-id'],\n attributeOldValue: true,\n })\n}\n\nfunction cleanupDocumentObserverIfUnused() {\n if (registry.size !== 0 || !documentObserver) {\n return\n }\n\n documentObserver.disconnect()\n documentObserver = null\n}\n\nexport function subscribeAnchorSelector(selector: string, subscriber: AnchorRegistrySubscriber) {\n let entry = registry.get(selector)\n\n if (!entry) {\n const initialState = readAnchorsForSelector(selector)\n entry = {\n anchors: initialState.anchors,\n error: initialState.error,\n subscribers: new Set(),\n tooltipId: extractTooltipId(selector),\n }\n registry.set(selector, entry)\n }\n\n entry.subscribers.add(subscriber)\n ensureDocumentObserver()\n subscriber([...entry.anchors], entry.error)\n\n return () => {\n const currentEntry = registry.get(selector)\n if (!currentEntry) {\n return\n }\n\n currentEntry.subscribers.delete(subscriber)\n if (currentEntry.subscribers.size === 0) {\n registry.delete(selector)\n }\n cleanupDocumentObserverIfUnused()\n }\n}\n\n/** @internal Reset module state between tests */\nexport function resetAnchorRegistry() {\n registry.clear()\n if (documentObserver) {\n documentObserver.disconnect()\n documentObserver = null\n }\n refreshScheduled = false\n pendingTooltipIds = null\n pendingFullRefresh = false\n}\n","import { useEffect, useMemo, useRef, useState } from 'react'\nimport { subscribeAnchorSelector } from './anchor-registry'\n\nconst getAnchorSelector = ({\n id,\n anchorSelect,\n imperativeAnchorSelect,\n}: {\n id?: string\n anchorSelect?: string\n imperativeAnchorSelect?: string\n}) => {\n let selector = imperativeAnchorSelect ?? anchorSelect ?? ''\n if (!selector && id) {\n selector = `[data-tooltip-id='${id.replace(/'/g, \"\\\\'\")}']`\n }\n return selector\n}\n\nconst useTooltipAnchors = ({\n id,\n anchorSelect,\n imperativeAnchorSelect,\n activeAnchor,\n disableTooltip,\n onActiveAnchorRemoved,\n trackAnchors,\n}: {\n id?: string\n anchorSelect?: string\n imperativeAnchorSelect?: string\n activeAnchor: HTMLElement | null\n disableTooltip?: (anchorRef: HTMLElement | null) => boolean\n onActiveAnchorRemoved: () => void\n trackAnchors: boolean\n}) => {\n const [rawAnchorElements, setRawAnchorElements] = useState<HTMLElement[]>([])\n const [selectorError, setSelectorError] = useState<Error | null>(null)\n const warnedSelectorRef = useRef<string | null>(null)\n const selector = useMemo(\n () => getAnchorSelector({ id, anchorSelect, imperativeAnchorSelect }),\n [id, anchorSelect, imperativeAnchorSelect],\n )\n const anchorElements = useMemo(\n () => rawAnchorElements.filter((anchor) => !disableTooltip?.(anchor)),\n [rawAnchorElements, disableTooltip],\n )\n\n const activeAnchorMatchesSelector = useMemo(() => {\n if (!activeAnchor || !selector) {\n return false\n }\n\n try {\n return activeAnchor.matches(selector)\n } catch {\n return false\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeAnchor, selector, anchorElements])\n\n useEffect(() => {\n if (!selector || !trackAnchors) {\n setRawAnchorElements([])\n setSelectorError(null)\n return undefined\n }\n\n return subscribeAnchorSelector(selector, (anchors, error) => {\n setRawAnchorElements(anchors)\n setSelectorError(error)\n })\n }, [selector, trackAnchors])\n\n useEffect(() => {\n if (!selectorError || warnedSelectorRef.current === selector) {\n return\n }\n warnedSelectorRef.current = selector\n /* c8 ignore start */\n if (!process.env.NODE_ENV || process.env.NODE_ENV !== 'production') {\n console.warn(`[react-tooltip] \"${selector}\" is not a valid CSS selector`)\n }\n /* c8 ignore end */\n }, [selector, selectorError])\n\n useEffect(() => {\n if (!activeAnchor) {\n return\n }\n\n if (!activeAnchor.isConnected) {\n onActiveAnchorRemoved()\n return\n }\n\n if (!anchorElements.includes(activeAnchor) && !activeAnchorMatchesSelector) {\n onActiveAnchorRemoved()\n }\n }, [activeAnchor, anchorElements, activeAnchorMatchesSelector, onActiveAnchorRemoved])\n\n return {\n anchorElements,\n selector,\n }\n}\n\nexport default useTooltipAnchors\n","/**\n * Shared document event delegation.\n *\n * Instead of N tooltips each calling document.addEventListener(type, handler),\n * we maintain ONE document listener per event type. When the event fires,\n * we iterate through all registered handlers for that type.\n *\n * This reduces document-level listeners from O(N × eventTypes) to O(eventTypes).\n */\n\ntype Handler = (event: Event) => void\n\ntype DelegatedListener = {\n handlers: Set<Handler>\n dispatch: (event: Event) => void\n eventType: string\n capture: boolean\n}\n\nconst handlersByType = new Map<string, DelegatedListener>()\n\nfunction getListenerKey(eventType: string, capture: boolean): string {\n return `${eventType}:${capture ? 'capture' : 'bubble'}`\n}\n\nfunction getOrCreateListener(eventType: string, capture: boolean): DelegatedListener {\n const key = getListenerKey(eventType, capture)\n let listener = handlersByType.get(key)\n if (!listener) {\n const handlers = new Set<Handler>()\n const dispatch = (event: Event): void => {\n handlers.forEach((handler) => {\n handler(event)\n })\n }\n listener = { handlers, dispatch, eventType, capture }\n handlersByType.set(key, listener)\n document.addEventListener(eventType, dispatch, { capture })\n }\n return listener\n}\n\n/**\n * Register a handler for a document-level event type.\n * Returns an unsubscribe function.\n */\nexport function addDelegatedEventListener(\n eventType: string,\n handler: Handler,\n options: AddEventListenerOptions = {},\n): () => void {\n const capture = Boolean(options.capture)\n const key = getListenerKey(eventType, capture)\n const listener = getOrCreateListener(eventType, capture)\n listener.handlers.add(handler)\n\n return () => {\n listener.handlers.delete(handler)\n if (listener.handlers.size === 0) {\n handlersByType.delete(key)\n document.removeEventListener(eventType, listener.dispatch, { capture })\n }\n }\n}\n\n/**\n * Reset for testing purposes.\n */\nexport function resetEventDelegation(): void {\n handlersByType.forEach((listener) => {\n document.removeEventListener(listener.eventType, listener.dispatch, {\n capture: listener.capture,\n })\n })\n handlersByType.clear()\n}\n","import React, {\n useEffect,\n useMemo,\n useState,\n useRef,\n useCallback,\n useImperativeHandle,\n memo,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport clsx from 'clsx'\nimport {\n useIsomorphicLayoutEffect,\n computeTooltipPosition,\n cssTimeToMs,\n clearTimeoutRef,\n} from '../../utils'\nimport type { IComputedPosition } from '../../utils'\nimport coreStyles from './core-styles.module.css'\nimport styles from './styles.module.css'\nimport useTooltipAnchors from './use-tooltip-anchors'\nimport useTooltipEvents from './use-tooltip-events'\nimport type { IPosition, ITooltip, TooltipImperativeOpenOptions } from './TooltipTypes'\n\n// Shared across all tooltip instances — the CSS variable is on :root and never changes per-instance\nlet globalTransitionShowDelay: number | null = null\n\nconst Tooltip = ({\n // props\n forwardRef,\n id,\n className,\n classNameArrow,\n variant = 'dark',\n portalRoot,\n anchorSelect,\n place = 'top',\n offset = 10,\n openOnClick = false,\n positionStrategy = 'absolute',\n middlewares,\n wrapper: WrapperElement,\n delayShow = 0,\n delayHide = 0,\n autoClose,\n float = false,\n hidden = false,\n noArrow = false,\n clickable = false,\n openEvents,\n closeEvents,\n globalCloseEvents,\n imperativeModeOnly,\n style: externalStyles,\n position,\n afterShow,\n afterHide,\n disableTooltip,\n // props handled by controller\n content,\n contentWrapperRef,\n isOpen,\n defaultIsOpen = false,\n setIsOpen,\n previousActiveAnchor,\n activeAnchor,\n setActiveAnchor,\n border,\n opacity,\n arrowColor,\n arrowSize = 8,\n role = 'tooltip',\n}: ITooltip) => {\n const tooltipRef = useRef<HTMLElement>(null)\n const tooltipArrowRef = useRef<HTMLElement>(null)\n const tooltipShowDelayTimerRef = useRef<NodeJS.Timeout | null>(null)\n const tooltipHideDelayTimerRef = useRef<NodeJS.Timeout | null>(null)\n const tooltipAutoCloseTimerRef = useRef<NodeJS.Timeout | null>(null)\n const missedTransitionTimerRef = useRef<NodeJS.Timeout | null>(null)\n const [computedPosition, setComputedPosition] = useState<IComputedPosition>({\n tooltipStyles: {},\n tooltipArrowStyles: {},\n place,\n })\n const [show, setShow] = useState(false)\n const [rendered, setRendered] = useState(false)\n const [imperativeOptions, setImperativeOptions] = useState<TooltipImperativeOpenOptions | null>(\n null,\n )\n const wasShowing = useRef(false)\n const lastFloatPosition = useRef<IPosition | null>(null)\n const hoveringTooltip = useRef(false)\n const mounted = useRef(false)\n const virtualElementRef = useRef({\n getBoundingClientRect: () => ({\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n }),\n })\n\n /**\n * useLayoutEffect runs before useEffect,\n * but should be used carefully because of caveats\n * https://beta.reactjs.org/reference/react/useLayoutEffect#caveats\n */\n useIsomorphicLayoutEffect(() => {\n mounted.current = true\n return () => {\n mounted.current = false\n }\n }, [])\n\n const handleShow = useCallback(\n (value: boolean) => {\n if (!mounted.current) {\n return\n }\n if (value) {\n setRendered(true)\n }\n /**\n * wait for the component to render and calculate position\n * before actually showing\n */\n setTimeout(() => {\n if (!mounted.current) {\n return\n }\n setIsOpen?.(value)\n if (isOpen === undefined) {\n setShow(value)\n }\n }, 10)\n },\n [isOpen, setIsOpen],\n )\n\n /**\n * Add aria-describedby to activeAnchor when tooltip is active\n */\n useEffect(() => {\n if (!id) return\n\n function getAriaDescribedBy(element: HTMLElement | null) {\n return element?.getAttribute('aria-describedby')?.split(' ') || []\n }\n\n function removeAriaDescribedBy(element: HTMLElement | null) {\n const newDescribedBy = getAriaDescribedBy(element).filter((s) => s !== id)\n if (newDescribedBy.length) {\n element?.setAttribute('aria-describedby', newDescribedBy.join(' '))\n } else {\n element?.removeAttribute('aria-describedby')\n }\n }\n\n if (show) {\n removeAriaDescribedBy(previousActiveAnchor)\n const currentDescribedBy = getAriaDescribedBy(activeAnchor)\n const describedBy = [...new Set([...currentDescribedBy, id])].filter(Boolean).join(' ')\n activeAnchor?.setAttribute('aria-describedby', describedBy)\n } else {\n removeAriaDescribedBy(activeAnchor)\n }\n\n return () => {\n // cleanup aria-describedby when the tooltip is closed\n removeAriaDescribedBy(activeAnchor)\n removeAriaDescribedBy(previousActiveAnchor)\n }\n }, [activeAnchor, show, id, previousActiveAnchor])\n\n /**\n * this replicates the effect from `handleShow()`\n * when `isOpen` is changed from outside\n */\n useEffect(() => {\n if (isOpen === undefined) {\n return () => null\n }\n if (isOpen) {\n setRendered(true)\n }\n const timeout = setTimeout(() => {\n setShow(isOpen)\n }, 10)\n return () => {\n clearTimeout(timeout)\n }\n }, [isOpen])\n\n useEffect(() => {\n if (show === wasShowing.current) {\n return\n }\n clearTimeoutRef(missedTransitionTimerRef)\n wasShowing.current = show\n if (show) {\n afterShow?.()\n } else {\n /**\n * see `onTransitionEnd` on tooltip wrapper\n */\n if (globalTransitionShowDelay === null) {\n const style = getComputedStyle(document.body)\n globalTransitionShowDelay = cssTimeToMs(\n style.getPropertyValue('--rt-transition-show-delay'),\n )\n }\n const transitionShowDelay = globalTransitionShowDelay\n missedTransitionTimerRef.current = setTimeout(() => {\n /**\n * if the tooltip switches from `show === true` to `show === false` too fast\n * the transition never runs, so `onTransitionEnd` callback never gets fired\n */\n setRendered(false)\n setImperativeOptions(null)\n afterHide?.()\n // +25ms just to make sure `onTransitionEnd` (if it gets fired) has time to run\n }, transitionShowDelay + 25)\n }\n }, [afterHide, afterShow, show])\n\n useEffect(() => {\n clearTimeoutRef(tooltipAutoCloseTimerRef)\n\n if (!show || !autoClose || autoClose <= 0) {\n return () => {\n clearTimeoutRef(tooltipAutoCloseTimerRef)\n }\n }\n\n tooltipAutoCloseTimerRef.current = setTimeout(() => {\n handleShow(false)\n }, autoClose)\n\n return () => {\n clearTimeoutRef(tooltipAutoCloseTimerRef)\n }\n }, [activeAnchor, autoClose, handleShow, show])\n\n const handleComputedPosition = useCallback((newComputedPosition: IComputedPosition) => {\n if (!mounted.current) {\n return\n }\n setComputedPosition((oldComputedPosition) => {\n if (\n oldComputedPosition.place === newComputedPosition.place &&\n oldComputedPosition.tooltipStyles.left === newComputedPosition.tooltipStyles.left &&\n oldComputedPosition.tooltipStyles.top === newComputedPosition.tooltipStyles.top &&\n oldComputedPosition.tooltipStyles.border === newComputedPosition.tooltipStyles.border &&\n oldComputedPosition.tooltipArrowStyles.left ===\n newComputedPosition.tooltipArrowStyles.left &&\n oldComputedPosition.tooltipArrowStyles.top === newComputedPosition.tooltipArrowStyles.top &&\n oldComputedPosition.tooltipArrowStyles.right ===\n newComputedPosition.tooltipArrowStyles.right &&\n oldComputedPosition.tooltipArrowStyles.bottom ===\n newComputedPosition.tooltipArrowStyles.bottom &&\n oldComputedPosition.tooltipArrowStyles.borderBottom ===\n newComputedPosition.tooltipArrowStyles.borderBottom &&\n oldComputedPosition.tooltipArrowStyles.borderRight ===\n newComputedPosition.tooltipArrowStyles.borderRight\n ) {\n return oldComputedPosition\n }\n return newComputedPosition\n })\n }, [])\n\n const renderedRef = useRef(rendered)\n renderedRef.current = rendered\n\n const handleShowTooltipDelayed = useCallback(\n (delay = delayShow) => {\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n\n if (renderedRef.current) {\n // if the tooltip is already rendered, ignore delay\n handleShow(true)\n return\n }\n\n tooltipShowDelayTimerRef.current = setTimeout(() => {\n handleShow(true)\n }, delay)\n },\n [delayShow, handleShow],\n )\n\n const handleHideTooltipDelayed = useCallback(\n (delay = delayHide) => {\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n\n tooltipHideDelayTimerRef.current = setTimeout(() => {\n if (hoveringTooltip.current) {\n return\n }\n handleShow(false)\n }, delay)\n },\n [delayHide, handleShow],\n )\n\n const handleTooltipPosition = useCallback(\n ({ x, y }: IPosition) => {\n virtualElementRef.current.getBoundingClientRect = () => ({\n x,\n y,\n width: 0,\n height: 0,\n top: y,\n left: x,\n right: x,\n bottom: y,\n })\n computeTooltipPosition({\n place: imperativeOptions?.place ?? place,\n offset,\n elementReference: virtualElementRef.current as unknown as Element,\n tooltipReference: tooltipRef.current,\n tooltipArrowReference: tooltipArrowRef.current,\n strategy: positionStrategy,\n middlewares,\n border,\n arrowSize,\n }).then((computedStylesData) => {\n handleComputedPosition(computedStylesData)\n })\n },\n [\n imperativeOptions?.place,\n place,\n offset,\n positionStrategy,\n middlewares,\n border,\n arrowSize,\n handleComputedPosition,\n ],\n )\n\n const updateTooltipPosition = useCallback(() => {\n const actualPosition = imperativeOptions?.position ?? position\n if (actualPosition) {\n // if `position` is set, override regular and `float` positioning\n handleTooltipPosition(actualPosition)\n return\n }\n\n if (float) {\n if (lastFloatPosition.current) {\n /*\n Without this, changes to `content`, `place`, `offset`, ..., will only\n trigger a position calculation after a `mousemove` event.\n\n To see why this matters, comment this line, run `yarn dev` and click the\n \"Hover me!\" anchor.\n */\n handleTooltipPosition(lastFloatPosition.current)\n }\n // if `float` is set, override regular positioning\n return\n }\n\n if (!activeAnchor?.isConnected) {\n return\n }\n\n computeTooltipPosition({\n place: imperativeOptions?.place ?? place,\n offset,\n elementReference: activeAnchor,\n tooltipReference: tooltipRef.current,\n tooltipArrowReference: tooltipArrowRef.current,\n strategy: positionStrategy,\n middlewares,\n border,\n arrowSize,\n }).then((computedStylesData) => {\n if (!mounted.current) {\n // invalidate computed positions after remount\n return\n }\n handleComputedPosition(computedStylesData)\n })\n }, [\n imperativeOptions?.position,\n imperativeOptions?.place,\n position,\n float,\n activeAnchor,\n place,\n offset,\n positionStrategy,\n middlewares,\n border,\n handleTooltipPosition,\n handleComputedPosition,\n arrowSize,\n ])\n\n const handleActiveAnchorRemoved = useCallback(() => {\n setRendered(false)\n handleShow(false)\n setActiveAnchor(null)\n clearTimeoutRef(tooltipShowDelayTimerRef)\n clearTimeoutRef(tooltipHideDelayTimerRef)\n clearTimeoutRef(tooltipAutoCloseTimerRef)\n }, [handleShow, setActiveAnchor])\n\n const shouldTrackAnchors =\n rendered ||\n defaultIsOpen ||\n Boolean(isOpen) ||\n Boolean(activeAnchor) ||\n Boolean(imperativeOptions?.anchorSelect)\n\n const { anchorElements, selector: anchorSelector } = useTooltipAnchors({\n id,\n anchorSelect,\n imperativeAnchorSelect: imperativeOptions?.anchorSelect,\n activeAnchor,\n disableTooltip,\n onActiveAnchorRemoved: handleActiveAnchorRemoved,\n trackAnchors: shouldTrackAnchors,\n })\n\n useTooltipEvents({\n activeAnchor,\n anchorElements,\n anchorSelector,\n clickable,\n closeEvents,\n delayHide,\n delayShow,\n disableTooltip,\n float,\n globalCloseEvents,\n handleHideTooltipDelayed,\n handleShow,\n handleShowTooltipDelayed,\n handleTooltipPosition,\n hoveringTooltip,\n imperativeModeOnly,\n lastFloatPosition,\n openEvents,\n openOnClick,\n rendered,\n setActiveAnchor,\n show,\n tooltipHideDelayTimerRef,\n tooltipRef,\n tooltipShowDelayTimerRef,\n updateTooltipPosition,\n })\n\n const updateTooltipPositionRef = useRef(updateTooltipPosition)\n updateTooltipPositionRef.current = updateTooltipPosition\n\n useEffect(() => {\n if (!rendered) {\n return\n }\n updateTooltipPosition()\n }, [rendered, updateTooltipPosition])\n\n useEffect(() => {\n if (!rendered || !contentWrapperRef?.current) {\n return () => null\n }\n\n let timeoutId: NodeJS.Timeout | null = null\n const contentObserver = new ResizeObserver(() => {\n // Clear any existing timeout to prevent memory leaks\n if (timeoutId) {\n clearTimeout(timeoutId)\n }\n timeoutId = setTimeout(() => {\n if (mounted.current) {\n updateTooltipPositionRef.current()\n }\n timeoutId = null\n }, 0)\n })\n contentObserver.observe(contentWrapperRef.current)\n\n return () => {\n contentObserver.disconnect()\n if (timeoutId) {\n clearTimeout(timeoutId)\n }\n }\n }, [content, contentWrapperRef, rendered])\n\n useEffect(() => {\n const shouldResolveInitialActiveAnchor = defaultIsOpen || Boolean(isOpen)\n\n if (!shouldResolveInitialActiveAnchor) {\n return\n }\n\n const activeAnchorMatchesImperativeSelector = (() => {\n if (!activeAnchor || !imperativeOptions?.anchorSelect) {\n return false\n }\n\n try {\n return activeAnchor.matches(imperativeOptions.anchorSelect)\n } catch {\n return false\n }\n })()\n\n if (!activeAnchor || !anchorElements.includes(activeAnchor)) {\n /**\n * if there is no active anchor,\n * or if the current active anchor is not amongst the allowed ones,\n * reset it\n */\n if (activeAnchorMatchesImperativeSelector) {\n return\n }\n setActiveAnchor(anchorElements[0] ?? null)\n }\n }, [\n activeAnchor,\n anchorElements,\n defaultIsOpen,\n imperativeOptions?.anchorSelect,\n isOpen,\n rendered,\n setActiveAnchor,\n ])\n\n useEffect(() => {\n if (defaultIsOpen) {\n handleShow(true)\n }\n return () => {\n clearTimeoutRef(tooltipShowDelayTimerRef)\n clearTimeoutRef(tooltipHideDelayTimerRef)\n clearTimeoutRef(tooltipAutoCloseTimerRef)\n clearTimeoutRef(missedTransitionTimerRef)\n }\n }, [defaultIsOpen, handleShow])\n\n useEffect(() => {\n if (tooltipShowDelayTimerRef.current) {\n /**\n * if the delay changes while the tooltip is waiting to show,\n * reset the timer with the new delay\n */\n clearTimeoutRef(tooltipShowDelayTimerRef)\n handleShowTooltipDelayed(delayShow)\n }\n }, [delayShow, handleShowTooltipDelayed])\n\n const actualContent = imperativeOptions?.content ?? content\n const hasContent = actualContent !== null && actualContent !== undefined\n const canShow = show && computedPosition.tooltipStyles.left !== undefined\n\n const tooltipStyle = useMemo(\n () => ({\n ...externalStyles,\n ...computedPosition.tooltipStyles,\n opacity: opacity !== undefined && canShow ? opacity : undefined,\n }),\n [externalStyles, computedPosition.tooltipStyles, opacity, canShow],\n )\n\n const arrowBackground = useMemo(\n () =>\n arrowColor\n ? `linear-gradient(to right bottom, transparent 50%, ${arrowColor} 50%)`\n : undefined,\n [arrowColor],\n )\n\n const arrowStyle = useMemo(\n () => ({\n ...computedPosition.tooltipArrowStyles,\n background: arrowBackground,\n '--rt-arrow-size': `${arrowSize}px`,\n }),\n [computedPosition.tooltipArrowStyles, arrowBackground, arrowSize],\n )\n\n useImperativeHandle(forwardRef, () => ({\n open: (options) => {\n let imperativeAnchor: HTMLElement | null = null\n if (options?.anchorSelect) {\n try {\n imperativeAnchor = document.querySelector<HTMLElement>(options.anchorSelect)\n } catch {\n if (!process.env.NODE_ENV || process.env.NODE_ENV !== 'production') {\n console.warn(`[react-tooltip] \"${options.anchorSelect}\" is not a valid CSS selector`)\n }\n return\n }\n if (!imperativeAnchor) {\n return\n }\n }\n if (imperativeAnchor) {\n setActiveAnchor(imperativeAnchor)\n }\n setImperativeOptions(options ?? null)\n if (options?.delay) {\n handleShowTooltipDelayed(options.delay)\n } else {\n handleShow(true)\n }\n },\n close: (options) => {\n if (options?.delay) {\n handleHideTooltipDelayed(options.delay)\n } else {\n handleShow(false)\n }\n },\n activeAnchor,\n place: computedPosition.place,\n isOpen: Boolean(rendered && !hidden && hasContent && canShow),\n }))\n\n useEffect(() => {\n return () => {\n // Final cleanup to ensure no memory leaks\n clearTimeoutRef(tooltipShowDelayTimerRef)\n clearTimeoutRef(tooltipHideDelayTimerRef)\n clearTimeoutRef(tooltipAutoCloseTimerRef)\n clearTimeoutRef(missedTransitionTimerRef)\n }\n }, [])\n\n const tooltipNode =\n rendered && !hidden && hasContent ? (\n <WrapperElement\n id={id}\n role={role}\n className={clsx(\n 'react-tooltip',\n coreStyles['tooltip'],\n styles['tooltip'],\n styles[variant],\n className,\n `react-tooltip__place-${computedPosition.place}`,\n coreStyles[canShow ? 'show' : 'closing'],\n canShow ? 'react-tooltip__show' : 'react-tooltip__closing',\n positionStrategy === 'fixed' && coreStyles['fixed'],\n clickable && coreStyles['clickable'],\n )}\n onTransitionEnd={(event: TransitionEvent) => {\n clearTimeoutRef(missedTransitionTimerRef)\n if (show || event.propertyName !== 'opacity') {\n return\n }\n setRendered(false)\n setImperativeOptions(null)\n afterHide?.()\n }}\n style={tooltipStyle}\n ref={tooltipRef}\n >\n <WrapperElement\n className={clsx(\n 'react-tooltip-content-wrapper',\n coreStyles['content'],\n styles['content'],\n )}\n >\n {actualContent}\n </WrapperElement>\n <WrapperElement\n className={clsx(\n 'react-tooltip-arrow',\n coreStyles['arrow'],\n styles['arrow'],\n classNameArrow,\n noArrow && coreStyles['noArrow'],\n )}\n style={arrowStyle}\n ref={tooltipArrowRef}\n />\n </WrapperElement>\n ) : null\n\n if (!tooltipNode) {\n return null\n }\n\n if (portalRoot) {\n return createPortal(tooltipNode, portalRoot)\n }\n\n return tooltipNode\n}\n\nexport default memo(Tooltip)\n","const cssTimeToMs = (time: string): number => {\n const match = time.match(/^([\\d.]+)(m?s)$/)\n if (!match) {\n return 0\n }\n const [, amount, unit] = match\n return Number(amount) * (unit === 'ms' ? 1 : 1000)\n}\n\nexport default cssTimeToMs\n","import { useEffect, useMemo, useRef } from 'react'\nimport type { RefObject } from 'react'\nimport { autoUpdate } from '@floating-ui/dom'\nimport {\n debounce,\n getScrollParent,\n clearTimeoutRef,\n parseDataTooltipIdSelector,\n resolveDataTooltipAnchor,\n} from '../../utils'\nimport type {\n AnchorCloseEvents,\n AnchorOpenEvents,\n GlobalCloseEvents,\n IPosition,\n} from './TooltipTypes'\nimport { addDelegatedEventListener } from './event-delegation'\n\nconst useTooltipEvents = ({\n activeAnchor,\n anchorElements,\n anchorSelector,\n clickable,\n closeEvents,\n delayHide,\n delayShow,\n disableTooltip,\n float,\n globalCloseEvents,\n handleHideTooltipDelayed,\n handleShow,\n handleShowTooltipDelayed,\n handleTooltipPosition,\n hoveringTooltip,\n imperativeModeOnly,\n lastFloatPosition,\n openEvents,\n openOnClick,\n rendered,\n setActiveAnchor,\n show,\n tooltipHideDelayTimerRef,\n tooltipRef,\n tooltipShowDelayTimerRef,\n updateTooltipPosition,\n}: {\n activeAnchor: HTMLElement | null\n anchorElements: HTMLElement[]\n anchorSelector: string\n clickable: boolean\n closeEvents?: AnchorCloseEvents\n delayHide: number\n delayShow: number\n disableTooltip?: (anchorRef: HTMLElement | null) => boolean\n float: boolean\n globalCloseEvents?: GlobalCloseEvents\n handleHideTooltipDelayed: (delay?: number) => void\n handleShow: (value: boolean) => void\n handleShowTooltipDelayed: (delay?: number) => void\n handleTooltipPosition: ({ x, y }: IPosition) => void\n hoveringTooltip: RefObject<boolean>\n imperativeModeOnly?: boolean\n lastFloatPosition: RefObject<IPosition | null>\n openEvents?: AnchorOpenEvents\n openOnClick: boolean\n rendered: boolean\n setActiveAnchor: (anchor: HTMLElement | null) => void\n show: boolean\n tooltipHideDelayTimerRef: RefObject<NodeJS.Timeout | null>\n tooltipRef: RefObject<HTMLElement | null>\n tooltipShowDelayTimerRef: RefObject<NodeJS.Timeout | null>\n updateTooltipPosition: () => void\n}) => {\n // Ref-stable debounced handlers — avoids recreating debounce instances on every effect run\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const debouncedShowRef = useRef(debounce((_anchor: HTMLElement | null) => {}, 50, true))\n const debouncedHideRef = useRef(debounce(() => {}, 50, true))\n\n // Cache scroll parents — only recompute when the element actually changes\n const anchorScrollParentRef = useRef<Element | null>(null)\n const tooltipScrollParentRef = useRef<Element | null>(null)\n const prevAnchorRef = useRef<HTMLElement | null>(null)\n const prevTooltipRef = useRef<HTMLElement | null>(null)\n\n if (activeAnchor !== prevAnchorRef.current) {\n prevAnchorRef.current = activeAnchor\n anchorScrollParentRef.current = getScrollParent(activeAnchor)\n }\n const currentTooltipEl = tooltipRef.current\n if (currentTooltipEl !== prevTooltipRef.current) {\n prevTooltipRef.current = currentTooltipEl\n tooltipScrollParentRef.current = getScrollParent(currentTooltipEl)\n }\n\n // Memoize event config objects — only rebuild when the relevant props change\n const hasClickEvent =\n openOnClick || openEvents?.click || openEvents?.dblclick || openEvents?.mousedown\n const actualOpenEvents: AnchorOpenEvents = useMemo(() => {\n const events: AnchorOpenEvents = openEvents\n ? { ...openEvents }\n : {\n mouseenter: true,\n focus: true,\n click: false,\n dblclick: false,\n mousedown: false,\n }\n if (!openEvents && openOnClick) {\n Object.assign(events, {\n mouseenter: false,\n focus: false,\n click: true,\n })\n }\n if (imperativeModeOnly) {\n Object.assign(events, {\n mouseenter: false,\n focus: false,\n click: false,\n dblclick: false,\n mousedown: false,\n })\n }\n return events\n }, [openEvents, openOnClick, imperativeModeOnly])\n\n const actualCloseEvents: AnchorCloseEvents = useMemo(() => {\n const events: AnchorCloseEvents = closeEvents\n ? { ...closeEvents }\n : {\n mouseleave: true,\n blur: true,\n click: false,\n dblclick: false,\n mouseup: false,\n }\n if (!closeEvents && openOnClick) {\n Object.assign(events, {\n mouseleave: false,\n blur: false,\n })\n }\n if (imperativeModeOnly) {\n Object.assign(events, {\n mouseleave: false,\n blur: false,\n click: false,\n dblclick: false,\n mouseup: false,\n })\n }\n return events\n }, [closeEvents, openOnClick, imperativeModeOnly])\n\n const actualGlobalCloseEvents: GlobalCloseEvents = useMemo(() => {\n const events: GlobalCloseEvents = globalCloseEvents\n ? { ...globalCloseEvents }\n : {\n escape: false,\n scroll: false,\n resize: false,\n clickOutsideAnchor: hasClickEvent || false,\n }\n if (imperativeModeOnly) {\n Object.assign(events, {\n escape: false,\n scroll: false,\n resize: false,\n clickOutsideAnchor: false,\n })\n }\n return events\n }, [globalCloseEvents, hasClickEvent, imperativeModeOnly])\n\n // --- Refs for values read inside event handlers (avoids effect deps) ---\n const activeAnchorRef = useRef(activeAnchor)\n activeAnchorRef.current = activeAnchor\n const showRef = useRef(show)\n showRef.current = show\n const anchorElementsRef = useRef(anchorElements)\n anchorElementsRef.current = anchorElements\n const handleShowRef = useRef(handleShow)\n handleShowRef.current = handleShow\n const handleTooltipPositionRef = useRef(handleTooltipPosition)\n handleTooltipPositionRef.current = handleTooltipPosition\n const updateTooltipPositionRef = useRef(updateTooltipPosition)\n updateTooltipPositionRef.current = updateTooltipPosition\n\n // --- Handler refs (updated every render, read via ref indirection in effects) ---\n const resolveAnchorElementRef = useRef<(target: EventTarget | null) => HTMLElement | null>(\n () => null,\n )\n const handleShowTooltipRef = useRef<(anchor: HTMLElement | null) => void>(() => {})\n const handleHideTooltipRef = useRef<() => void>(() => {})\n\n const dataTooltipId = anchorSelector ? parseDataTooltipIdSelector(anchorSelector) : null\n\n resolveAnchorElementRef.current = (target: EventTarget | null) => {\n const targetElement = target as HTMLElement | null\n\n if (!targetElement?.isConnected) {\n return null\n }\n\n if (dataTooltipId) {\n const matchedAnchor = resolveDataTooltipAnchor(targetElement, dataTooltipId)\n\n if (matchedAnchor && !disableTooltip?.(matchedAnchor)) {\n return matchedAnchor\n }\n } else if (anchorSelector) {\n try {\n const matchedAnchor =\n (targetElement.matches(anchorSelector)\n ? targetElement\n : targetElement.closest(anchorSelector)) ?? null\n\n if (matchedAnchor && !disableTooltip?.(matchedAnchor as HTMLElement)) {\n return matchedAnchor as HTMLElement\n }\n } catch {\n return null\n }\n }\n\n return (\n anchorElementsRef.current.find(\n (anchor) => anchor === targetElement || anchor.contains(targetElement),\n ) ?? null\n )\n }\n\n handleShowTooltipRef.current = (anchor: HTMLElement | null) => {\n if (!anchor) {\n return\n }\n if (!anchor.isConnected) {\n setActiveAnchor(null)\n return\n }\n if (disableTooltip?.(anchor)) {\n return\n }\n if (delayShow && activeAnchorRef.current && anchor !== activeAnchorRef.current) {\n // Moving to a different anchor while one is already active — defer the anchor\n // switch until the show delay fires to prevent content/position from updating\n // before visibility transitions complete.\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n tooltipShowDelayTimerRef.current = setTimeout(() => {\n setActiveAnchor(anchor)\n handleShow(true)\n }, delayShow)\n } else {\n setActiveAnchor(anchor)\n if (delayShow) {\n handleShowTooltipDelayed()\n } else {\n handleShow(true)\n }\n }\n\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n }\n\n handleHideTooltipRef.current = () => {\n if (clickable) {\n handleHideTooltipDelayed(delayHide || 100)\n } else if (delayHide) {\n handleHideTooltipDelayed()\n } else {\n handleShow(false)\n }\n\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n }\n\n // Update debounced callbacks to always delegate to latest handler refs\n const debouncedShow = debouncedShowRef.current\n const debouncedHide = debouncedHideRef.current\n debouncedShow.setCallback((anchor: HTMLElement | null) => handleShowTooltipRef.current(anchor))\n debouncedHide.setCallback(() => handleHideTooltipRef.current())\n\n // --- Effect 1: Delegated anchor events + tooltip hover ---\n // Only re-runs when the set of active event types or interaction mode changes.\n // Handlers read reactive values (activeAnchor, show, etc.) from refs at invocation\n // time, so this effect is decoupled from show/hide state changes.\n useEffect(() => {\n const cleanupFns: (() => void)[] = []\n\n const addDelegatedListener = (\n eventType: string,\n listener: (event: Event) => void,\n options?: AddEventListenerOptions,\n ) => {\n cleanupFns.push(addDelegatedEventListener(eventType, listener, options))\n }\n\n const activeAnchorContainsTarget = (event?: Event): boolean =>\n Boolean(event?.target && activeAnchorRef.current?.contains(event.target as HTMLElement))\n\n const debouncedHandleShowTooltip = (anchor: HTMLElement | null) => {\n debouncedHide.cancel()\n debouncedShow(anchor)\n }\n const debouncedHandleHideTooltip = () => {\n debouncedShow.cancel()\n debouncedHide()\n }\n\n const addDelegatedHoverOpenListener = () => {\n addDelegatedListener('mouseover', (event) => {\n const anchor = resolveAnchorElementRef.current(event.target)\n if (!anchor) {\n return\n }\n const relatedAnchor = resolveAnchorElementRef.current((event as MouseEvent).relatedTarget)\n if (relatedAnchor === anchor) {\n return\n }\n debouncedHandleShowTooltip(anchor)\n })\n }\n\n const addDelegatedHoverCloseListener = () => {\n addDelegatedListener('mouseout', (event) => {\n const targetAnchor = resolveAnchorElementRef.current(event.target)\n if (!targetAnchor && !activeAnchorContainsTarget(event)) {\n return\n }\n const relatedTarget = (event as MouseEvent).relatedTarget as HTMLElement | null\n const containerAnchor = targetAnchor || activeAnchorRef.current\n if (containerAnchor?.contains(relatedTarget)) {\n return\n }\n debouncedHandleHideTooltip()\n })\n }\n\n if (actualOpenEvents.mouseenter) {\n addDelegatedHoverOpenListener()\n }\n if (actualCloseEvents.mouseleave) {\n addDelegatedHoverCloseListener()\n }\n if (actualOpenEvents.mouseover) {\n addDelegatedHoverOpenListener()\n }\n if (actualCloseEvents.mouseout) {\n addDelegatedHoverCloseListener()\n }\n if (actualOpenEvents.focus) {\n addDelegatedListener('focusin', (event) => {\n debouncedHandleShowTooltip(resolveAnchorElementRef.current(event.target))\n })\n }\n if (actualCloseEvents.blur) {\n addDelegatedListener('focusout', (event) => {\n const targetAnchor = resolveAnchorElementRef.current(event.target)\n if (!targetAnchor && !activeAnchorContainsTarget(event)) {\n return\n }\n const relatedTarget = (event as FocusEvent).relatedTarget as HTMLElement | null\n const containerAnchor = targetAnchor || activeAnchorRef.current\n if (containerAnchor?.contains(relatedTarget)) {\n return\n }\n debouncedHandleHideTooltip()\n })\n }\n\n const regularEvents = ['mouseover', 'mouseout', 'mouseenter', 'mouseleave', 'focus', 'blur']\n const clickEvents = ['click', 'dblclick', 'mousedown', 'mouseup']\n\n const handleClickOpenTooltipAnchor = (event?: Event) => {\n const anchor = resolveAnchorElementRef.current(event?.target ?? null)\n if (!anchor) {\n return\n }\n if (showRef.current && activeAnchorRef.current === anchor) {\n return\n }\n handleShowTooltipRef.current(anchor)\n }\n const handleClickCloseTooltipAnchor = (event?: Event) => {\n if (!showRef.current || !activeAnchorContainsTarget(event)) {\n return\n }\n handleHideTooltipRef.current()\n }\n\n Object.entries(actualOpenEvents).forEach(([event, enabled]) => {\n if (!enabled || regularEvents.includes(event)) {\n return\n }\n if (clickEvents.includes(event)) {\n addDelegatedListener(event, handleClickOpenTooltipAnchor as (event: Event) => void, {\n capture: true,\n })\n }\n })\n\n Object.entries(actualCloseEvents).forEach(([event, enabled]) => {\n if (!enabled || regularEvents.includes(event)) {\n return\n }\n if (clickEvents.includes(event)) {\n addDelegatedListener(event, handleClickCloseTooltipAnchor as (event: Event) => void, {\n capture: true,\n })\n }\n })\n\n if (float) {\n addDelegatedListener('pointermove', (event) => {\n const currentActiveAnchor = activeAnchorRef.current\n if (!currentActiveAnchor) {\n return\n }\n const targetAnchor = resolveAnchorElementRef.current(event.target)\n if (targetAnchor !== currentActiveAnchor) {\n return\n }\n const mouseEvent = event as MouseEvent\n const mousePosition = {\n x: mouseEvent.clientX,\n y: mouseEvent.clientY,\n }\n handleTooltipPositionRef.current(mousePosition)\n lastFloatPosition.current = mousePosition\n })\n }\n\n const tooltipElement = tooltipRef.current\n const handleMouseOverTooltip = () => {\n hoveringTooltip.current = true\n }\n const handleMouseOutTooltip = () => {\n hoveringTooltip.current = false\n handleHideTooltipRef.current()\n }\n\n const addHoveringTooltipListeners =\n clickable && (actualCloseEvents.mouseout || actualCloseEvents.mouseleave)\n if (addHoveringTooltipListeners) {\n tooltipElement?.addEventListener('mouseover', handleMouseOverTooltip)\n tooltipElement?.addEventListener('mouseout', handleMouseOutTooltip)\n }\n\n return () => {\n cleanupFns.forEach((fn) => fn())\n if (addHoveringTooltipListeners) {\n tooltipElement?.removeEventListener('mouseover', handleMouseOverTooltip)\n tooltipElement?.removeEventListener('mouseout', handleMouseOutTooltip)\n }\n debouncedShow.cancel()\n debouncedHide.cancel()\n }\n // `rendered` needs to be a dependency because `tooltipRef` becomes stale when the\n // tooltip is removed from / added to the DOM.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [actualOpenEvents, actualCloseEvents, float, clickable, rendered])\n\n // --- Effect 2: Global close events + auto-update ---\n // Re-runs when the global close config changes, or when the active anchor changes\n // (for scroll parent listeners and floating-ui autoUpdate).\n useEffect(() => {\n const handleScrollResize = () => {\n handleShowRef.current(false)\n }\n\n const tooltipScrollParent = tooltipScrollParentRef.current\n const anchorScrollParent = anchorScrollParentRef.current\n\n if (actualGlobalCloseEvents.scroll) {\n window.addEventListener('scroll', handleScrollResize)\n anchorScrollParent?.addEventListener('scroll', handleScrollResize)\n tooltipScrollParent?.addEventListener('scroll', handleScrollResize)\n }\n let updateTooltipCleanup: null | (() => void) = null\n if (actualGlobalCloseEvents.resize) {\n window.addEventListener('resize', handleScrollResize)\n } else if (activeAnchor && tooltipRef.current) {\n updateTooltipCleanup = autoUpdate(\n activeAnchor as HTMLElement,\n tooltipRef.current as HTMLElement,\n () => updateTooltipPositionRef.current(),\n {\n ancestorResize: true,\n elementResize: true,\n layoutShift: true,\n },\n )\n }\n\n const handleEsc = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') {\n return\n }\n handleShowRef.current(false)\n }\n if (actualGlobalCloseEvents.escape) {\n window.addEventListener('keydown', handleEsc)\n }\n\n const handleClickOutsideAnchors = (event: Event) => {\n if (!showRef.current) {\n return\n }\n const target = (event as MouseEvent).target as HTMLElement\n if (!target?.isConnected) {\n return\n }\n if (tooltipRef.current?.contains(target)) {\n return\n }\n if (activeAnchorRef.current?.contains(target)) {\n return\n }\n if (anchorElementsRef.current.some((anchor) => anchor?.contains(target))) {\n return\n }\n handleShowRef.current(false)\n clearTimeoutRef(tooltipShowDelayTimerRef)\n }\n\n if (actualGlobalCloseEvents.clickOutsideAnchor) {\n window.addEventListener('click', handleClickOutsideAnchors)\n }\n\n return () => {\n if (actualGlobalCloseEvents.scroll) {\n window.removeEventListener('scroll', handleScrollResize)\n anchorScrollParent?.removeEventListener('scroll', handleScrollResize)\n tooltipScrollParent?.removeEventListener('scroll', handleScrollResize)\n }\n if (actualGlobalCloseEvents.resize) {\n window.removeEventListener('resize', handleScrollResize)\n }\n if (updateTooltipCleanup) {\n updateTooltipCleanup()\n }\n if (actualGlobalCloseEvents.escape) {\n window.removeEventListener('keydown', handleEsc)\n }\n if (actualGlobalCloseEvents.clickOutsideAnchor) {\n window.removeEventListener('click', handleClickOutsideAnchors)\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [actualGlobalCloseEvents, activeAnchor])\n}\n\nexport default useTooltipEvents\n","function parseDataTooltipIdSelector(selector: string) {\n const match = selector.match(/^\\[data-tooltip-id=(['\"])((?:\\\\.|(?!\\1).)*)\\1\\]$/)\n\n if (!match) {\n return null\n }\n\n return match[2].replace(/\\\\(['\"])/g, '$1')\n}\n\nexport default parseDataTooltipIdSelector\n","function resolveDataTooltipAnchor(targetElement: HTMLElement, tooltipId: string) {\n let currentElement: HTMLElement | null = targetElement\n\n while (currentElement) {\n if (currentElement.dataset.tooltipId === tooltipId) {\n return currentElement\n }\n currentElement = currentElement.parentElement\n }\n\n return null\n}\n\nexport default resolveDataTooltipAnchor\n","/**\n * Shared MutationObserver for data-tooltip-* attribute changes.\n * Instead of N observers (one per tooltip), a single observer watches\n * all active anchors and dispatches changes to registered callbacks.\n */\n\ntype AttributeCallback = (element: HTMLElement) => void\n\nconst observedElements = new Map<HTMLElement, Set<AttributeCallback>>()\n\nlet sharedObserver: MutationObserver | null = null\n\nconst observerConfig: MutationObserverInit = {\n attributes: true,\n childList: false,\n subtree: false,\n}\n\nfunction getObserver(): MutationObserver {\n if (!sharedObserver) {\n sharedObserver = new MutationObserver((mutationList) => {\n for (const mutation of mutationList) {\n if (\n mutation.type !== 'attributes' ||\n !mutation.attributeName?.startsWith('data-tooltip-')\n ) {\n continue\n }\n const target = mutation.target as HTMLElement\n const callbacks = observedElements.get(target)\n if (callbacks) {\n callbacks.forEach((cb) => cb(target))\n }\n }\n })\n }\n return sharedObserver\n}\n\nexport function observeAnchorAttributes(\n element: HTMLElement,\n callback: AttributeCallback,\n): () => void {\n const observer = getObserver()\n let callbacks = observedElements.get(element)\n if (!callbacks) {\n callbacks = new Set()\n observedElements.set(element, callbacks)\n observer.observe(element, observerConfig)\n }\n callbacks.add(callback)\n\n return () => {\n const cbs = observedElements.get(element)\n if (cbs) {\n cbs.delete(callback)\n if (cbs.size === 0) {\n observedElements.delete(element)\n // MutationObserver doesn't have unobserve — if no elements left, disconnect & reset\n if (observedElements.size === 0) {\n observer.disconnect()\n } else {\n // Re-observe remaining elements (MutationObserver has no per-target unobserve)\n observer.disconnect()\n observedElements.forEach((_cbs, el) => {\n observer.observe(el, observerConfig)\n })\n }\n }\n }\n }\n}\n\n/**\n * Reset for testing purposes\n */\nexport function resetSharedAttributeObserver(): void {\n sharedObserver?.disconnect()\n sharedObserver = null\n observedElements.clear()\n}\n","import React, { useCallback, useEffect, useRef, useState, memo } from 'react'\nimport clsx from 'clsx'\nimport { Tooltip } from '../Tooltip'\nimport type {\n PositionStrategy,\n PlacesType,\n VariantType,\n WrapperType,\n DataAttribute,\n ITooltip,\n TooltipRefProps,\n} from '../Tooltip/TooltipTypes'\nimport type { ITooltipController } from './TooltipControllerTypes'\nimport { observeAnchorAttributes } from './shared-attribute-observer'\n\nconst TooltipController = React.forwardRef<TooltipRefProps, ITooltipController>(\n (\n {\n id,\n anchorSelect,\n content,\n render,\n className,\n classNameArrow,\n variant = 'dark',\n portalRoot,\n place = 'top',\n offset = 10,\n wrapper = 'div',\n children = null,\n openOnClick = false,\n positionStrategy = 'absolute',\n middlewares,\n delayShow = 0,\n delayHide = 0,\n autoClose,\n float = false,\n hidden = false,\n noArrow = false,\n clickable = false,\n openEvents,\n closeEvents,\n globalCloseEvents,\n imperativeModeOnly = false,\n style,\n position,\n isOpen,\n defaultIsOpen = false,\n disableStyleInjection = false,\n border,\n opacity,\n arrowColor,\n arrowSize,\n setIsOpen,\n afterShow,\n afterHide,\n disableTooltip,\n role = 'tooltip',\n }: ITooltipController,\n ref,\n ) => {\n const [activeAnchor, setActiveAnchor] = useState<HTMLElement | null>(null)\n const [anchorDataAttributes, setAnchorDataAttributes] = useState<\n Partial<Record<DataAttribute, string | null>>\n >({})\n const previousActiveAnchorRef = useRef<HTMLElement | null>(null)\n const styleInjectionRef = useRef(disableStyleInjection)\n\n const handleSetActiveAnchor = useCallback((anchor: HTMLElement | null) => {\n setActiveAnchor((prev) => {\n if (!anchor?.isSameNode(prev)) {\n previousActiveAnchorRef.current = prev\n }\n return anchor\n })\n }, [])\n\n /* c8 ignore start */\n const getDataAttributesFromAnchorElement = (elementReference: HTMLElement) => {\n const dataAttributes = elementReference?.getAttributeNames().reduce(\n (acc, name) => {\n if (name.startsWith('data-tooltip-')) {\n const parsedAttribute = name.replace(/^data-tooltip-/, '') as DataAttribute\n acc[parsedAttribute] = elementReference?.getAttribute(name) ?? null\n }\n return acc\n },\n {} as Record<DataAttribute, string | null>,\n )\n\n return dataAttributes\n }\n /* c8 ignore end */\n\n useEffect(() => {\n if (styleInjectionRef.current === disableStyleInjection) {\n return\n }\n /* c8 ignore start */\n if (process.env.NODE_ENV !== 'production') {\n console.warn('[react-tooltip] Do not change `disableStyleInjection` dynamically.')\n }\n /* c8 ignore end */\n }, [disableStyleInjection])\n\n useEffect(() => {\n if (typeof window !== 'undefined') {\n window.dispatchEvent(\n new CustomEvent('react-tooltip-inject-styles', {\n detail: {\n disableCore: disableStyleInjection === 'core',\n disableBase: disableStyleInjection,\n },\n }),\n )\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n useEffect(() => {\n if (!activeAnchor) {\n setAnchorDataAttributes({})\n return () => {}\n }\n\n const updateAttributes = (element: HTMLElement) => {\n const attrs = getDataAttributesFromAnchorElement(element)\n setAnchorDataAttributes((prev) => {\n const keys = Object.keys(attrs) as DataAttribute[]\n const prevKeys = Object.keys(prev) as DataAttribute[]\n if (keys.length === prevKeys.length && keys.every((key) => attrs[key] === prev[key])) {\n return prev\n }\n return attrs\n })\n }\n\n updateAttributes(activeAnchor)\n\n const unsubscribe = observeAnchorAttributes(activeAnchor, updateAttributes)\n\n return unsubscribe\n }, [activeAnchor, anchorSelect])\n\n useEffect(() => {\n /* c8 ignore start */\n if (process.env.NODE_ENV === 'production') {\n return\n }\n /* c8 ignore end */\n if (style?.border) {\n console.warn('[react-tooltip] Do not set `style.border`. Use `border` prop instead.')\n }\n if (style?.opacity) {\n console.warn('[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead.')\n }\n }, [border, opacity, style?.border, style?.opacity])\n\n const currentAnchorDataAttributes = activeAnchor\n ? getDataAttributesFromAnchorElement(activeAnchor)\n : anchorDataAttributes\n\n /**\n * content priority: children < render or content < html\n * children should be lower priority so that it can be used as the \"default\" content\n */\n const tooltipContent = currentAnchorDataAttributes.content ?? content\n const tooltipPlace = (currentAnchorDataAttributes.place as PlacesType | undefined) ?? place\n const tooltipVariant =\n (currentAnchorDataAttributes.variant as VariantType | undefined) ?? variant\n const tooltipOffset =\n currentAnchorDataAttributes.offset == null\n ? offset\n : Number(currentAnchorDataAttributes.offset)\n const tooltipWrapper =\n (currentAnchorDataAttributes.wrapper as WrapperType | undefined) ?? wrapper\n const tooltipPositionStrategy =\n (currentAnchorDataAttributes['position-strategy'] as PositionStrategy | undefined) ??\n positionStrategy\n const tooltipDelayShow =\n currentAnchorDataAttributes['delay-show'] == null\n ? delayShow\n : Number(currentAnchorDataAttributes['delay-show'])\n const tooltipDelayHide =\n currentAnchorDataAttributes['delay-hide'] == null\n ? delayHide\n : Number(currentAnchorDataAttributes['delay-hide'])\n const tooltipAutoClose =\n currentAnchorDataAttributes['auto-close'] == null\n ? autoClose\n : Number(currentAnchorDataAttributes['auto-close'])\n const tooltipFloat =\n currentAnchorDataAttributes.float == null\n ? float\n : currentAnchorDataAttributes.float === 'true'\n const tooltipHidden =\n currentAnchorDataAttributes.hidden == null\n ? hidden\n : currentAnchorDataAttributes.hidden === 'true'\n const tooltipClassName = currentAnchorDataAttributes['class-name'] ?? null\n\n let renderedContent = children\n const contentWrapperRef = useRef<HTMLDivElement>(null)\n if (render) {\n const actualContent = currentAnchorDataAttributes.content ?? tooltipContent ?? null\n const rendered = render({ content: actualContent, activeAnchor }) as React.ReactNode\n renderedContent = rendered ? (\n <div ref={contentWrapperRef} className=\"react-tooltip-content-wrapper\">\n {rendered}\n </div>\n ) : null\n } else if (tooltipContent !== null && tooltipContent !== undefined) {\n renderedContent = tooltipContent\n }\n\n const props: ITooltip = {\n forwardRef: ref,\n id,\n anchorSelect,\n className: clsx(className, tooltipClassName),\n classNameArrow,\n content: renderedContent,\n contentWrapperRef,\n portalRoot,\n place: tooltipPlace,\n variant: tooltipVariant,\n offset: tooltipOffset,\n wrapper: tooltipWrapper,\n openOnClick,\n positionStrategy: tooltipPositionStrategy,\n middlewares,\n delayShow: tooltipDelayShow,\n delayHide: tooltipDelayHide,\n autoClose: tooltipAutoClose,\n float: tooltipFloat,\n hidden: tooltipHidden,\n noArrow,\n clickable,\n openEvents,\n closeEvents,\n globalCloseEvents,\n imperativeModeOnly,\n style,\n position,\n isOpen,\n defaultIsOpen,\n border,\n opacity,\n arrowColor,\n arrowSize,\n setIsOpen,\n afterShow,\n afterHide,\n disableTooltip,\n activeAnchor,\n previousActiveAnchor: previousActiveAnchorRef.current,\n setActiveAnchor: handleSetActiveAnchor,\n role,\n }\n\n return <Tooltip {...props} />\n },\n)\n\nexport default memo(TooltipController)\n","import './tokens.css'\n\nimport { injectStyle } from './utils/handle-style'\n\nimport type {\n DataAttribute,\n PlacesType,\n PositionStrategy,\n VariantType,\n WrapperType,\n IPosition,\n Middleware,\n TooltipRefProps,\n} from './components/Tooltip/TooltipTypes'\nimport type { ITooltipController } from './components/TooltipController/TooltipControllerTypes'\n\n// those content will be replaced in build time with the `react-tooltip.css` builded content\nconst TooltipCoreStyles = 'react-tooltip-core-css-placeholder'\nconst TooltipStyles = 'react-tooltip-css-placeholder'\n\nif (typeof window !== 'undefined') {\n window.addEventListener('react-tooltip-inject-styles', ((\n event: CustomEvent<{ disableCore: boolean; disableBase: boolean }>,\n ) => {\n if (!event.detail.disableCore) {\n injectStyle({ css: TooltipCoreStyles, type: 'core' })\n }\n if (!event.detail.disableBase) {\n injectStyle({ css: TooltipStyles, type: 'base' })\n }\n }) as EventListener)\n}\n\nexport { TooltipController as Tooltip } from './components/TooltipController'\nexport type {\n DataAttribute,\n PlacesType,\n PositionStrategy,\n VariantType,\n WrapperType,\n ITooltipController as ITooltip,\n IPosition,\n Middleware,\n TooltipRefProps,\n}\n"],"names":["injected","core","base","injectStyle","css","id","type","ref","state","document","process","env","REACT_TOOLTIP_DISABLE_CORE_STYLES","REACT_TOOLTIP_DISABLE_BASE_STYLES","insertAt","getElementById","head","getElementsByTagName","style","createElement","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","defaultFlip","flip","fallbackAxisSideDirection","defaultShift","shift","padding","computeTooltipPosition","async","elementReference","tooltipReference","tooltipArrowReference","place","offset","offsetValue","strategy","middlewares","Number","border","arrowSize","tooltipStyles","tooltipArrowStyles","middleware","push","arrow","element","computePosition","placement","then","x","y","middlewareData","styles","left","top","arrowX","arrowY","_a","staticSide","_b","right","bottom","split","borderSide","borderBottom","borderRight","borderWidth","match","debounce","func","wait","immediate","timeout","currentFunc","debounced","args","later","apply","this","setTimeout","cancel","clearTimeout","setCallback","newFunc","isScrollable","node","HTMLElement","SVGElement","getComputedStyle","some","propertyName","value","getPropertyValue","getScrollParent","currentParent","parentElement","scrollingElement","documentElement","useIsomorphicLayoutEffect","window","useLayoutEffect","useEffect","clearTimeoutRef","current","registry","Map","documentObserver","extractTooltipId","selector","replace","readAnchorsForSelector","anchors","Array","from","querySelectorAll","error","Error","String","refreshEntry","entry","nextState","nextErrorMessage","message","previousErrorMessage","_d","_c","length","every","anchor","index","nextEntry","set","subscribers","forEach","subscriber","notifySubscribers","refreshScheduled","pendingTooltipIds","pendingFullRefresh","scheduleRefresh","affectedTooltipIds","Set","add","flush","fullRefresh","ids","affectedIds","size","tooltipId","has","requestAnimationFrame","Promise","resolve","ensureDocumentObserver","MutationObserver","records","record","target","currentId","getAttribute","call","oldValue","gatherIds","nodes","i","nodeType","Node","ELEMENT_NODE","el","descendants","j","descId","addedNodes","removedNodes","collectAffectedTooltipIds","observe","body","childList","subtree","attributes","attributeFilter","attributeOldValue","subscribeAnchorSelector","get","initialState","currentEntry","delete","disconnect","handlersByType","getListenerKey","eventType","capture","addDelegatedEventListener","handler","options","Boolean","key","listener","handlers","dispatch","event","addEventListener","getOrCreateListener","removeEventListener","globalTransitionShowDelay","Tooltip$1","memo","forwardRef","className","classNameArrow","variant","portalRoot","anchorSelect","openOnClick","positionStrategy","wrapper","WrapperElement","delayShow","delayHide","autoClose","float","hidden","noArrow","clickable","openEvents","closeEvents","globalCloseEvents","imperativeModeOnly","externalStyles","position","afterShow","afterHide","disableTooltip","content","contentWrapperRef","isOpen","defaultIsOpen","setIsOpen","previousActiveAnchor","activeAnchor","setActiveAnchor","opacity","arrowColor","role","tooltipRef","useRef","tooltipArrowRef","tooltipShowDelayTimerRef","tooltipHideDelayTimerRef","tooltipAutoCloseTimerRef","missedTransitionTimerRef","computedPosition","setComputedPosition","useState","show","setShow","rendered","setRendered","imperativeOptions","setImperativeOptions","wasShowing","lastFloatPosition","hoveringTooltip","mounted","virtualElementRef","getBoundingClientRect","width","height","handleShow","useCallback","undefined","removeAriaDescribedBy","currentDescribedBy","getAriaDescribedBy","describedBy","filter","join","setAttribute","newDescribedBy","s","removeAttribute","time","amount","unit","cssTimeToMs","transitionShowDelay","handleComputedPosition","newComputedPosition","oldComputedPosition","renderedRef","handleShowTooltipDelayed","delay","handleHideTooltipDelayed","handleTooltipPosition","computedStylesData","updateTooltipPosition","actualPosition","isConnected","handleActiveAnchorRemoved","shouldTrackAnchors","anchorElements","anchorSelector","imperativeAnchorSelect","onActiveAnchorRemoved","trackAnchors","rawAnchorElements","setRawAnchorElements","selectorError","setSelectorError","warnedSelectorRef","useMemo","getAnchorSelector","activeAnchorMatchesSelector","matches","includes","useTooltipAnchors","debouncedShowRef","_anchor","debouncedHideRef","anchorScrollParentRef","tooltipScrollParentRef","prevAnchorRef","prevTooltipRef","currentTooltipEl","hasClickEvent","click","dblclick","mousedown","actualOpenEvents","events","mouseenter","focus","Object","assign","actualCloseEvents","mouseleave","blur","mouseup","actualGlobalCloseEvents","escape","scroll","resize","clickOutsideAnchor","activeAnchorRef","showRef","anchorElementsRef","handleShowRef","handleTooltipPositionRef","updateTooltipPositionRef","resolveAnchorElementRef","handleShowTooltipRef","handleHideTooltipRef","dataTooltipId","parseDataTooltipIdSelector","targetElement","matchedAnchor","currentElement","dataset","resolveDataTooltipAnchor","closest","find","contains","debouncedShow","debouncedHide","cleanupFns","addDelegatedListener","activeAnchorContainsTarget","debouncedHandleShowTooltip","debouncedHandleHideTooltip","addDelegatedHoverOpenListener","relatedTarget","addDelegatedHoverCloseListener","targetAnchor","containerAnchor","mouseover","mouseout","regularEvents","clickEvents","handleClickOpenTooltipAnchor","handleClickCloseTooltipAnchor","entries","enabled","currentActiveAnchor","mouseEvent","mousePosition","clientX","clientY","tooltipElement","handleMouseOverTooltip","handleMouseOutTooltip","addHoveringTooltipListeners","fn","handleScrollResize","tooltipScrollParent","anchorScrollParent","updateTooltipCleanup","autoUpdate","ancestorResize","elementResize","layoutShift","handleEsc","handleClickOutsideAnchors","useTooltipEvents","timeoutId","contentObserver","ResizeObserver","activeAnchorMatchesImperativeSelector","actualContent","hasContent","canShow","tooltipStyle","arrowBackground","arrowStyle","background","useImperativeHandle","open","imperativeAnchor","querySelector","close","tooltipNode","React","clsx","coreStyles","onTransitionEnd","createPortal","observedElements","sharedObserver","observerConfig","observeAnchorAttributes","callback","observer","mutationList","mutation","attributeName","startsWith","callbacks","cb","cbs","_cbs","TooltipController","render","children","disableStyleInjection","anchorDataAttributes","setAnchorDataAttributes","previousActiveAnchorRef","styleInjectionRef","handleSetActiveAnchor","prev","isSameNode","getDataAttributesFromAnchorElement","dataAttributes","getAttributeNames","reduce","acc","name","dispatchEvent","CustomEvent","detail","disableCore","disableBase","updateAttributes","attrs","keys","prevKeys","currentAnchorDataAttributes","tooltipContent","tooltipPlace","tooltipVariant","tooltipOffset","tooltipWrapper","tooltipPositionStrategy","_e","tooltipDelayShow","tooltipDelayHide","tooltipAutoClose","tooltipFloat","tooltipHidden","tooltipClassName","_f","renderedContent","_h","_g","props","Tooltip","TooltipController_default"],"mappings":";;;;;;2GACA,MAIMA,EAAW,CACfC,MAAM,EACNC,MAAM,GAQR,SAASC,GAAYC,IACnBA,EAAGC,GACHA,EAdmC,4BAcFC,KACjCA,EAAO,OAAMC,IACbA,EAAGC,MACHA,EAAQ,CAAA,IASR,IACGJ,GACmB,oBAAbK,gBACiB,IAAhBD,EAAMF,GAAwBE,EAAMF,GAAQN,EAASM,IAE7D,OAGF,GACW,SAATA,GACmB,oBAAZI,SACPA,QAAQC,KACRD,QAAQC,IAAIC,kCAEZ,OAGF,GACW,SAATN,GACmB,oBAAZI,SACPA,QAAQC,KACRD,QAAQC,IAAIE,kCAEZ,OAGW,SAATP,IACFD,EAvDiC,6BA0D9BE,IACHA,EAAM,CAAA,GAER,MAAMO,SAAEA,GAAaP,EAErB,GAAIE,SAASM,eAAeV,GAE1B,OAGF,MAAMW,EAAOP,SAASO,MAAQP,SAASQ,qBAAqB,QAAQ,GAE9DC,EAAaT,SAASU,cAAc,SAC1CD,EAAMb,GAAKA,EACXa,EAAMZ,KAAO,WAEI,QAAbQ,GACEE,EAAKI,WACPJ,EAAKK,aAAaH,EAAOF,EAAKI,YAKhCJ,EAAKM,YAAYJ,GAGfA,EAAMK,WACRL,EAAMK,WAAWC,QAAUpB,EAE3Bc,EAAMI,YAAYb,SAASgB,eAAerB,SAGjB,IAAhBI,EAAMF,GACfE,EAAMF,IAAQ,EAEdN,EAASM,IAAQ,CAErB,CC5FA,MAAMoB,EAAcC,EAA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