"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.UserMessageComponent = void 0;var _piTui = require("@mariozechner/pi-tui"); var _theme = require("../theme/theme.js"); const OSC133_ZONE_START = "\x1b]133;A\x07"; const OSC133_ZONE_END = "\x1b]133;B\x07"; /** * Component that renders a user message */ class UserMessageComponent extends _piTui.Container { constructor(text, markdownTheme = (0, _theme.getMarkdownTheme)()) { super(); this.addChild(new _piTui.Spacer(1)); this.addChild(new _piTui.Markdown(text, 1, 1, markdownTheme, { bgColor: (text) => _theme.theme.bg("userMessageBg", text), color: (text) => _theme.theme.fg("userMessageText", text) })); } render(width) { const lines = super.render(width); if (lines.length === 0) { return lines; } lines[0] = OSC133_ZONE_START + lines[0]; lines[lines.length - 1] = lines[lines.length - 1] + OSC133_ZONE_END; return lines; } }exports.UserMessageComponent = UserMessageComponent; /* v9-727833eb4cec080d */