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