import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{H as n,M as r,Rn as i,nt as a,t as o}from"./src-Di342QoJ.js";import{t as s}from"./useKeybinding-DPOUuymz.js";var c=e((()=>{o()}));function l(e,t,i,a=!0){let{exit:o}=n(),[s,c]=(0,u.useState)({pending:!1,keyName:null}),l=(0,u.useMemo)(()=>i??o,[i,o]),d=r(e=>c({pending:e,keyName:`Ctrl-C`}),l),f=r(e=>c({pending:e,keyName:`Ctrl-D`}),l),p=(0,u.useCallback)(()=>{t?.()||d()},[d,t]),m=(0,u.useCallback)(()=>{f()},[f]);return e((0,u.useMemo)(()=>({"app:interrupt":p,"app:exit":m}),[p,m]),{context:`Global`,isActive:a}),s}var u,d=e((()=>{u=t(i(),1),o(),c()}));function f(e,t,n){return l(a,t,e,n)}var p=e((()=>{s(),d()}));export{f as n,c as r,p as t};