import { html, LitElement } from "lit"; import { customElement, property } from "lit/decorators.js"; export interface UtilityVisibility { showToolCalls: boolean; showThinking: boolean; showSystemMessages: boolean; showTimestamps: boolean; } @customElement("jae-utility-toggle") export class JaeUtilityToggle extends LitElement { @property({ type: Object }) visibility: UtilityVisibility = { showToolCalls: true, showThinking: false, showSystemMessages: false, showTimestamps: true, }; @property({ type: Boolean }) open = false; protected override createRenderRoot() { return this; } private _toggle(key: keyof UtilityVisibility) { this.visibility = { ...this.visibility, [key]: !this.visibility[key] }; this.dispatchEvent( new CustomEvent("visibility-change", { detail: this.visibility, bubbles: true, composed: true, }), ); } private _items: { key: keyof UtilityVisibility; label: string; icon: string; desc: string }[] = [ { key: "showToolCalls", label: "Tool Calls", icon: "🔧", desc: "Show web search, image gen & other tool results", }, { key: "showThinking", label: "Thinking", icon: "🧠", desc: "Show model reasoning / thinking blocks" }, { key: "showSystemMessages", label: "System Messages", icon: "⚙️", desc: "Show system notifications and prompts" }, { key: "showTimestamps", label: "Timestamps", icon: "🕐", desc: "Show message timestamps" }, ]; override render() { const activeCount = Object.values(this.visibility).filter(Boolean).length; return html`