import picocolors from"#compiled/picocolors/index.js";function applyTone(e,t,n){switch(t){case`accent`:return e.accent(n);case`danger`:return e.danger(n);case`info`:return e.info(n);case`muted`:return e.muted(n);case`subagent`:return e.subagent(n);case`success`:return e.success(n);case`warning`:return e.warning(n);default:return e.plain(n)}}function renderIndentedLines(e,t){let[n=``,...r]=e;return[n,...r.map(e=>`${t}${e}`)]}function renderOrangeText(e){return e.color?`\u001B[38;5;208m${e.text}\u001B[39m`:e.text}function createCliTheme(t={}){let n=picocolors.createColors(t.color??!!process.stdout.isTTY);return{accent:e=>n.cyan(e),color:n.isColorSupported,danger:e=>n.red(e),heading:e=>n.bold(n.cyan(e)),info:e=>n.blue(e),label:e=>n.bold(e),muted:e=>n.dim(e),plain:e=>e,subagent:e=>renderOrangeText({color:n.isColorSupported,text:e}),success:e=>n.green(e),warning:e=>n.yellow(e)}}function renderCliBanner(e,t){let n=[e.heading(t.title),e.muted(`=`.repeat(t.title.length))];return t.subtitle&&n.push(e.muted(t.subtitle)),n.join(`
`)}function renderCliSection(e,t){let n=t.rows.reduce((e,t)=>Math.max(e,t.label.length),0),r=[e.accent(t.title)];for(let i of t.rows){let[t=``,...a]=renderIndentedLines(applyTone(e,i.tone??`default`,i.value).split(`
`),`${` `.repeat(n)}  `);r.push(`${e.label(i.label.padEnd(n))}  ${t}`),r.push(...a)}return r.join(`
`)}function renderCliTaggedLine(e,t){let n=`[${t.tag.toUpperCase()}]`,[r=``,...i]=renderIndentedLines(applyTone(e,t.tone??`default`,t.message).split(`
`),`${` `.repeat(n.length)} `);return[e.muted(n),r].join(` `)+(i.length>0?`\n${i.join(`
`)}`:``)}function renderCliSpeakerLine(e,t){let n=`${t.speaker}>`,[r=``,...i]=renderIndentedLines(applyTone(e,t.tone??`default`,t.message).split(`
`),`${` `.repeat(n.length)} `);return[e.muted(n),r].join(` `)+(i.length>0?`\n${i.join(`
`)}`:``)}export{createCliTheme,renderCliBanner,renderCliSection,renderCliSpeakerLine,renderCliTaggedLine};