import{u as n}from"./useProjectionStream-BBHmpNXC.js";import{b7 as r,b6 as s}from"./index-Dg4NaXsE.js";function u(e){const c=n({autoConnect:!1});function o(a){const t=a?.payload;if(t)switch(a.kind){case"alarm":e.onAlarm?.(t);break;case"object-created":e.onObjectCreated?.(t);break;case"object-deleted":e.onObjectDeleted?.(t);break;case"object-patched":e.onObjectPatched?.(t);break;case"object-batch-changed":e.onObjectBatchChanged?.(t);break;case"pick-result":e.onPickResult?.(t);break;case"selection-detail":e.onSelectionDetail?.(t);break;case"workspace-shortcut":e.onWorkspaceShortcut?.(t);break;case"viewport-style-updated":e.onViewportStyleUpdated?.();break}}return r(()=>{c.on(o),c.connect()}),s(()=>{c.off(o),c.disconnect()}),{connected:c.connected}}export{u};
