"use strict";const o=require("react");function f(){let n=o.useRef(new Map),u=o.useCallback((e,l,r,t)=>{let a=t?.once?(...s)=>{n.current.delete(r),r(...s)}:r;n.current.set(r,{type:l,eventTarget:e,fn:a,options:t}),e.addEventListener(l,a,t)},[]),c=o.useCallback((e,l,r,t)=>{var a;let s=((a=n.current.get(r))===null||a===void 0?void 0:a.fn)||r;e.removeEventListener(l,s,t),n.current.delete(r)},[]),d=o.useCallback(()=>{n.current.forEach((e,l)=>{c(e.eventTarget,e.type,l,e.options)})},[c]);return o.useEffect(()=>d,[d]),{addGlobalListener:u,removeGlobalListener:c,removeAllGlobalListeners:d}}exports.$03deb23ff14920c4$export$4eaf04e54aa8eed6=f;
//# sourceMappingURL=useGlobalListeners-CwGh-cDn.cjs.js.map
