import{n as e}from"./chunk-DR8-3Aex.js";import{U as t,l as n,p as r,z as i}from"./debug-otxXY3j-.js";import{i as a,n as o,r as s}from"./computerUseLock-Diig5B8p.js";import{f as c,i as l,p as u,t as d}from"./escHotkey-D8WgbSyj.js";async function f(e){let t=e.getAppState().computerUseMcpState?.hiddenDuringTurn;if(t&&t.size>0){let{unhideComputerUseApps:n}=await import(`./executor-CvTuHx-k.js`),a=n([...t]).catch(e=>r(`[Computer Use MCP] auto-unhide failed: ${i(e)}`)),o=u(),s=setTimeout(o.resolve,p);await Promise.race([a,o.promise]).finally(()=>clearTimeout(s)),e.setAppState(e=>e.computerUseMcpState?.hiddenDuringTurn===void 0?e:{...e,computerUseMcpState:{...e.computerUseMcpState,hiddenDuringTurn:void 0}})}if(s()){try{l()}catch(e){r(`[Computer Use MCP] unregisterEscHotkey failed: ${i(e)}`)}await a()&&e.sendOSNotification?.({message:`Claude is done using your computer`,notificationType:`computer_use_exit`})}}var p;e((()=>{n(),t(),c(),o(),d(),p=5e3}))();export{f as cleanupComputerUseAfterTurn};