import{r as s}from"./vendor-react-wBh_31cN.js";import{u,O as c}from"./useOS-CLE6F2cY.js";import{a as w}from"./index-dNe6i2rS.js";const m={Meta:"Control"},v=n=>{const[i,t]=s.useState(!1);s.useEffect(()=>{const e=()=>t(!1);return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[]);const{name:d}=u(),o=s.useMemo(()=>d===c.MAC?n:w(n,n,m),[d,n]),r=s.useCallback(({key:e})=>{e===o&&t(!0)},[o]),a=s.useCallback(({key:e})=>{e===o&&t(!1)},[o]);return s.useEffect(()=>(window.addEventListener("keydown",r),window.addEventListener("keyup",a),()=>{window.removeEventListener("keydown",r),window.removeEventListener("keyup",a)}),[r,a]),i};export{v as u};
