import{r,w as c,az as i,ac as f}from"./index-BEZl8isL.js";function d(n){const t=r(!1);function o(){t.value=!0}function u(s){const e=s.currentTarget;document.hasFocus()?e.contains(s.relatedTarget)||(t.value=!1):window.addEventListener("focus",function a(){window.removeEventListener("focus",a),e.isConnected&&!e.contains(document.activeElement)&&(t.value=!1)})}return c(n,(s,e)=>{e&&(e.removeEventListener("focusin",o),e.removeEventListener("focusout",u)),n&&(n.value.addEventListener("focusin",o),n.value.addEventListener("focusout",u))}),i(()=>{n.value.removeEventListener("focusin",o),n.value.removeEventListener("focusout",u)}),f(t)}export{d as u};
