import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{H as n,Mt as r,Rn as i,Tn as a,t as o,wn as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{PassThrough as l}from"stream";function u({children:e}){let{exit:t}=n();return(0,m.useLayoutEffect)(()=>{let e=setTimeout(t,0);return()=>clearTimeout(e)},[t]),(0,h.jsx)(h.Fragment,{children:e})}function d(e){let t=e.indexOf(g);if(t===-1)return e;let n=t+8,r=e.indexOf(_,n);return r===-1?e:e.slice(n,r)}async function f(e,t){let n=``,i=new l;return t!==void 0&&(i.columns=t),i.on(`data`,e=>{n+=e.toString()}),await(await r((0,h.jsx)(u,{children:e}),{stdout:i,patchConsole:!1})).waitUntilExit(),d(n)}async function p(e,t){return a(await f(e,t))}var m,h,g,_,v=e((()=>{i(),m=t(i(),1),s(),o(),h=c(),g=`\x1B[?2026h`,_=`\x1B[?2026l`}));export{f as n,p as r,v as t};