import { truncateToWidth, visibleWidth } from "@threadwell/tui";
import { theme } from "../theme/theme.js";
import { getVisualTokens } from "../theme/visual-profile.js";
export class TranscriptStatusLine {
    text;
    setText(text) {
        this.text = text;
    }
    invalidate() {
        // No cached state.
    }
    render(width) {
        if (!this.text)
            return [""];
        const visual = getVisualTokens();
        const separator = visual.enhanced ? visual.glyphs.separator : "·";
        const arrow = visual.enhanced ? "↑" : "^";
        const raw = ` ${arrow} ${this.text} ${separator} latest below `;
        const decorated = `${theme.fg("dim", "─")} ${theme.fg("muted", raw)} ${theme.fg("dim", "─")}`;
        const truncated = truncateToWidth(decorated, width, theme.fg("dim", "..."));
        const padding = Math.max(0, width - visibleWidth(truncated));
        const left = Math.floor(padding / 2);
        const right = padding - left;
        return [`${" ".repeat(left)}${truncated}${" ".repeat(right)}`];
    }
}
//# sourceMappingURL=transcript-status-line.js.map