import{D as e,N as t,X as n}from"./Tooltip.CcubhKj6.js";import{o as r}from"./useFocusRing.DKgtHVTa.js";var i=`default`,a=``,o=new WeakMap;function s(r){if(t()&&e()){if(i==="default"){let e=n(r);a=e.documentElement.style.webkitUserSelect,e.documentElement.style.webkitUserSelect=`none`}i=`disabled`}else if(r instanceof HTMLElement||r instanceof SVGElement){let e=`userSelect`in r.style?`userSelect`:`webkitUserSelect`;o.set(r,r.style[e]),r.style[e]=`none`}}function c(s){if(t()&&e()){if(i!==`disabled`)return;i=`restoring`,setTimeout(()=>{r(()=>{if(i===`restoring`){let e=n(s);e.documentElement.style.webkitUserSelect===`none`&&(e.documentElement.style.webkitUserSelect=a||``),a=``,i=`default`}})},300)}else if((s instanceof HTMLElement||s instanceof SVGElement)&&s&&o.has(s)){let e=o.get(s),t=`userSelect`in s.style?`userSelect`:`webkitUserSelect`;s.style[t]===`none`&&(s.style[t]=e),s.getAttribute(`style`)===``&&s.removeAttribute(`style`),o.delete(s)}}export{c as n,s as t};