/* esm.sh - @radix-ui/react-focus-guards@1.2.0 */
"use client";import*as u from"../../../../react@19.3.1/es2022/react.mjs";var d=Object.defineProperty,a=(e,n)=>d(e,"name",{value:n,configurable:!0}),r=0,t=null;function c(e){return s(),e.children}a(c,"FocusGuards");function s(){u.useEffect(()=>{t||(t={start:o(),end:o()});let{start:e,end:n}=t;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==n&&document.body.insertAdjacentElement("beforeend",n),r++,()=>{r===1&&(t?.start.remove(),t?.end.remove(),t=null),r=Math.max(0,r-1)}},[])}a(s,"useFocusGuards");function o(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}a(o,"createFocusGuard");export{c as FocusGuards,c as Root,s as useFocusGuards};
//# sourceMappingURL=react-focus-guards.mjs.map