var S=Object.defineProperty;var g=(s,r)=>S(s,"name",{value:r,configurable:!0});import{e as k,E as x,I as T,T as $}from"./Table-3pFgIUZ2-DABgc6rj.js";import{a7 as a,a8 as u,n as l,a9 as d,k as C,R as j,s as E}from"../packem_chunks/bin.js";import{n as R}from"./spinner-0acw5pd_.js";import{D as w,W as P,T as O,C as A}from"./symbols-CQmER5MT.js";var D=Object.defineProperty,I=g((s,r)=>D(s,"name",{value:r,configurable:!0}),"l");const v=I(({rows:s})=>a.jsx(u,{flexDirection:"column",children:s.map(r=>{let t;switch(r.status){case"error":{t=a.jsx(l,{color:"red",children:A});break}case"ok":{t=a.jsx(l,{color:"green",children:O});break}case"running":{t=a.jsx(l,{color:"white",children:a.jsx(R,{type:"dots"})});break}case"warn":{t=a.jsx(l,{color:"yellow",children:P});break}default:{t=a.jsx(l,{dimColor:!0,children:w});break}}return a.jsxs(u,{children:[a.jsx(u,{width:3,children:t}),a.jsx(u,{flexGrow:1,children:a.jsx(l,{children:r.label})}),r.summary?a.jsx(u,{children:a.jsxs(l,{dimColor:!0,children:[w," ",r.summary]})}):null]},r.id)})}),"ScanProgressApp");var Y=Object.defineProperty,i=g((s,r)=>Y(s,"name",{value:r,configurable:!0}),"e");const G={error:$(d.failure),ok:T(d.success),pending:x(d.dash),skip:x(d.dash),warn:k(d.warning)},M=i((s,r,t)=>{const h=t?`${s} ${x(`— ${t}`)}`:s;return`  ${G[r]} ${h}
`},"formatStaticRow"),L=i((s,r={})=>{const t=r.stream??process.stderr,h=typeof t.isTTY=="boolean"&&t.isTTY&&!E,y=r.live??h,n=new Map;for(const e of s)n.set(e.id,{id:e.id,label:e.label,status:"pending"});if(!y||s.length===0)return{finish:i((e,o,f)=>{const c=n.get(e);c&&(n.set(e,{...c,status:o,summary:f}),t.write(M(c.label,o,f)))},"finish"),start:i(e=>{const o=n.get(e);o&&n.set(e,{...o,status:"running"})},"start"),stop:i(()=>{},"stop")};const b=i(()=>s.map(e=>n.get(e.id)),"buildRows");let m=C(j.createElement(v,{rows:b()}),{interactive:!0,patchConsole:!1});const p=i(()=>{m?.rerender(j.createElement(v,{rows:b()}))},"rerender");return{finish:i((e,o,f)=>{const c=n.get(e);c&&(n.set(e,{...c,status:o,summary:f}),p())},"finish"),start:i(e=>{const o=n.get(e);o&&(n.set(e,{...o,status:"running"}),p())},"start"),stop:i(()=>{m&&(p(),m.unmount(),m=void 0)},"stop")}},"startScanProgress");export{L as s};
