{"version":3,"sources":["jsdelivr-header.js","/npm/@copilotkitnext/angular@0.0.25/src/lib/config.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/human-in-the-loop.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/copilotkit.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/tools.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/render-tool-calls.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/agent.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/chat-config.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/chat-state.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/scroll-position.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/resize-observer.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/utils.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/agent-context.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/slots/slot.types.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/slots/slot.utils.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/slots/copilot-slot.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/directives/copilotkit-agent-context.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/directives/stick-to-bottom.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/directives/tooltip.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-tool-calls-view.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-assistant-message-renderer.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-assistant-message-buttons.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-assistant-message-toolbar.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-view-handlers.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-assistant-message.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-user-message-renderer.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-user-message-buttons.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-user-message-toolbar.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-user-message-branch-navigation.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-user-message.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-message-view-cursor.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-message-view.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-view-scroll-to-bottom-button.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-view-scroll-view.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-view-feather.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-textarea.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-input.types.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-audio-recorder.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-buttons.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-toolbar.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-tools-menu.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-input.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-view-disclaimer.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-view-input-container.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-view.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat.ts","/npm/@copilotkitnext/angular@0.0.25/src/lib/components/chat/copilot-chat-input-defaults.ts"],"names":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AEA,WAAA,CAAY,GACV,KAAK,WAAW,IAAI,EACtB,C,2FA3HW,YAAW,KAAA,GAAA,OAAA,GAAA,gBAAA,YAAX,aAAA,GAAA,sBAAA,WAAA,SAAA,QAAA,UAAA,KAAA,YAAW,cAAA,EAAA,SAAA,eAAA,OAAA,CAAA,QAAA,CAAA,kBAAA,UAAA,WAAA,UAAA,UAAA,EAAA,YAAA,EAAA,kBAAA,MAAA,SAAA,CAAA,kBAAA,WAAA,WAAA,WAAA,UAAA,EAAA,YAAA,EAAA,kBAAA,MAAA,eAAA,CAAA,kBAAA,iBAAA,WAAA,iBAAA,UAAA,EAAA,YAAA,EAAA,kBAAA,OAAA,UAPX,CACT,CACE,QAAS,UACT,YAAa,cAEhB,SAAA,GAAA,SAfS,qPAST,UAAA,EAAA,aAAA,EAAA,KAAA,WAAA,KAZS,cAAY,CAAA,KAAA,YAAA,KAAE,gBAAe,SAAA,oBAAA,OAAA,2eAAA,QAAA,yJAAA,gBAAA,GAAA,wBAAA,OAAA,cAAA,GAAA,kBAAA,O,oFAoB5B,YAAW,WAAA,E,KAvBvB,UAAU,KAAA,EACT,SAAU,eACV,YAAY,EACZ,QAAS,CAAC,aAAc,iBACxB,gBAAiB,wBAAwB,OACzC,cAAe,kBAAkB,KACjC,SAAU,qPAUV,UAAW,CACT,CACE,QAAS,UACT,YAAW,kB,8BCfJ,yBACX,gBAA2B,oBAC3B,qBAAgC,yBAChC,kBAA6B,sBAC7B,6BAAwC,iCACxC,8BAAyC,kCACzC,8BAAyC,kCACzC,qBAAgC,yBAChC,eAA0B,mBAC1B,iBAA4B,4B","file":"/npm/@copilotkitnext/angular@0.0.25/dist/fesm2022/copilotkitnext-angular.mjs","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@copilotkitnext/angular@0.0.25/dist/fesm2022/copilotkitnext-angular.mjs\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { inject, InjectionToken, Provider } from \"@angular/core\";\nimport { AbstractAgent } from \"@ag-ui/client\";\nimport {\n  ClientTool,\n  FrontendToolConfig,\n  HumanInTheLoopConfig,\n  RenderToolCallConfig,\n} from \"./tools\";\n\nexport interface CopilotKitConfig {\n  runtimeUrl?: string;\n  headers?: Record<string, string>;\n  properties?: Record<string, unknown>;\n  agents?: Record<string, AbstractAgent>;\n  tools?: ClientTool[];\n  renderToolCalls?: RenderToolCallConfig[];\n  frontendTools?: FrontendToolConfig[];\n  humanInTheLoop?: HumanInTheLoopConfig[];\n}\n\nexport const COPILOT_KIT_CONFIG = new InjectionToken<CopilotKitConfig>(\n  \"COPILOT_KIT_CONFIG\"\n);\n\nexport function injectCopilotKitConfig(): CopilotKitConfig {\n  return inject(COPILOT_KIT_CONFIG);\n}\n\nexport function provideCopilotKit(config: CopilotKitConfig): Provider {\n  return { provide: COPILOT_KIT_CONFIG, useValue: config };\n}\n","import { Injectable } from \"@angular/core\";\nimport { filter, lastValueFrom, Subject, take } from \"rxjs\";\n\n@Injectable({ providedIn: \"root\" })\nexport class HumanInTheLoop {\n  results = new Subject<{\n    toolCallId: string;\n    toolName: string;\n    result: unknown;\n  }>();\n\n  addResult(toolCallId: string, toolName: string, result: unknown) {\n    this.results.next({ toolCallId, toolName, result });\n  }\n\n  onResult(toolCallId: string, toolName: string): Promise<unknown> {\n    return lastValueFrom(\n      this.results.pipe(\n        filter(\n          (result) =>\n            result.toolCallId === toolCallId && result.toolName === toolName\n        ),\n        take(1)\n      )\n    );\n  }\n}\n","import { AbstractAgent } from \"@ag-ui/client\";\nimport { FrontendTool, CopilotKitCore } from \"@copilotkitnext/core\";\nimport { Injectable, Injector, Signal, WritableSignal, runInInjectionContext, signal, inject } from \"@angular/core\";\nimport { FrontendToolConfig, HumanInTheLoopConfig, RenderToolCallConfig } from \"./tools\";\nimport { injectCopilotKitConfig } from \"./config\";\nimport { HumanInTheLoop } from \"./human-in-the-loop\";\n\n@Injectable({ providedIn: \"root\" })\nexport class CopilotKit {\n  readonly #config = injectCopilotKitConfig();\n  readonly #hitl = inject(HumanInTheLoop);\n  readonly #rootInjector = inject(Injector);\n  readonly #agents = signal<Record<string, AbstractAgent>>(this.#config.agents ?? {});\n  readonly agents = this.#agents.asReadonly();\n\n  readonly core = new CopilotKitCore({\n    runtimeUrl: this.#config.runtimeUrl,\n    headers: this.#config.headers,\n    properties: this.#config.properties,\n    agents__unsafe_dev_only: this.#config.agents,\n    tools: this.#config.tools,\n  });\n\n  readonly #toolCallRenderConfigs: WritableSignal<RenderToolCallConfig[]> = signal([]);\n  readonly #clientToolCallRenderConfigs: WritableSignal<FrontendToolConfig[]> = signal([]);\n  readonly #humanInTheLoopToolRenderConfigs: WritableSignal<HumanInTheLoopConfig[]> = signal([]);\n\n  readonly toolCallRenderConfigs: Signal<RenderToolCallConfig[]> = this.#toolCallRenderConfigs.asReadonly();\n  readonly clientToolCallRenderConfigs: Signal<FrontendToolConfig[]> = this.#clientToolCallRenderConfigs.asReadonly();\n  readonly humanInTheLoopToolRenderConfigs: Signal<HumanInTheLoopConfig[]> =\n    this.#humanInTheLoopToolRenderConfigs.asReadonly();\n\n  constructor() {\n    this.#config.renderToolCalls?.forEach((renderConfig) => {\n      this.addRenderToolCall(renderConfig);\n    });\n\n    this.#config.tools?.forEach((tool) => {\n      if (tool.renderer && tool.parameters) {\n        this.addRenderToolCall({\n          name: tool.name,\n          args: tool.parameters,\n          component: tool.renderer,\n          agentId: tool.agentId,\n        });\n      }\n    });\n\n    this.#config.frontendTools?.forEach((clientTool) => {\n      this.addFrontendTool({ ...clientTool, injector: this.#rootInjector });\n    });\n\n    this.#config.humanInTheLoop?.forEach((humanInTheLoopTool) => {\n      this.addHumanInTheLoop(humanInTheLoopTool);\n    });\n\n    this.core.subscribe({\n      onAgentsChanged: () => {\n        this.#agents.set(this.core.agents);\n      },\n    });\n  }\n\n  #bindClientTool(\n    clientToolWithInjector: FrontendToolConfig & {\n      injector: Injector;\n    },\n  ): FrontendTool {\n    const { injector, handler, ...frontendCandidate } = clientToolWithInjector;\n\n    return {\n      ...frontendCandidate,\n      handler: (args) => runInInjectionContext(injector, () => handler(args)),\n    };\n  }\n\n  addFrontendTool(\n    clientToolWithInjector: FrontendToolConfig & {\n      injector: Injector;\n    },\n  ): void {\n    const tool = this.#bindClientTool(clientToolWithInjector);\n\n    this.core.addTool(tool);\n\n    this.#clientToolCallRenderConfigs.update((current) => [...current, clientToolWithInjector]);\n  }\n\n  addRenderToolCall(renderConfig: RenderToolCallConfig): void {\n    this.#toolCallRenderConfigs.update((current) => [...current, renderConfig]);\n  }\n\n  #bindHumanInTheLoopTool(humanInTheLoopTool: HumanInTheLoopConfig): FrontendTool {\n    return {\n      ...humanInTheLoopTool,\n      handler: (args, toolCall) => {\n        return this.#hitl.onResult(toolCall.id, humanInTheLoopTool.name);\n      },\n    };\n  }\n\n  addHumanInTheLoop(humanInTheLoopTool: HumanInTheLoopConfig): void {\n    this.#humanInTheLoopToolRenderConfigs.update((current) => [...current, humanInTheLoopTool]);\n\n    const tool = this.#bindHumanInTheLoopTool(humanInTheLoopTool);\n\n    this.core.addTool(tool);\n  }\n\n  #isSameAgentId<T extends { agentId?: string }>(target: T, agentId?: string): boolean {\n    if (agentId) {\n      return target.agentId === agentId;\n    }\n\n    return true;\n  }\n\n  removeTool(toolName: string, agentId?: string): void {\n    this.core.removeTool(toolName);\n    this.#clientToolCallRenderConfigs.update((current) =>\n      current.filter((renderConfig) => renderConfig.name !== toolName && this.#isSameAgentId(renderConfig, agentId)),\n    );\n    this.#humanInTheLoopToolRenderConfigs.update((current) =>\n      current.filter((renderConfig) => renderConfig.name !== toolName && this.#isSameAgentId(renderConfig, agentId)),\n    );\n    this.#toolCallRenderConfigs.update((current) =>\n      current.filter((renderConfig) => renderConfig.name !== toolName && this.#isSameAgentId(renderConfig, agentId)),\n    );\n  }\n\n  getAgent(agentId: string): AbstractAgent | undefined {\n    return this.core.getAgent(agentId);\n  }\n\n  updateRuntime(options: {\n    runtimeUrl?: string;\n    headers?: Record<string, string>;\n    properties?: Record<string, unknown>;\n    agents?: Record<string, AbstractAgent>;\n  }): void {\n    if (options.runtimeUrl !== undefined) {\n      this.core.setRuntimeUrl(options.runtimeUrl);\n    }\n    if (options.headers !== undefined) {\n      this.core.setHeaders(options.headers);\n    }\n    if (options.properties !== undefined) {\n      this.core.setProperties(options.properties);\n    }\n    if (options.agents !== undefined) {\n      this.core.setAgents__unsafe_dev_only(options.agents);\n    }\n  }\n}\n","import { DestroyRef, Injector, Signal, Type, inject } from \"@angular/core\";\nimport { FrontendTool } from \"@copilotkitnext/core\";\nimport { z } from \"zod\";\nimport { CopilotKit } from \"./copilotkit\";\n\nexport type AngularToolCall<Args extends Record<string, unknown> = Record<string, unknown>> =\n  | {\n      args: Partial<Args>;\n      status: \"in-progress\";\n      result: undefined;\n    }\n  | {\n      args: Args;\n      status: \"executing\";\n      result: undefined;\n    }\n  | {\n      args: Args;\n      status: \"complete\";\n      result: string;\n    };\n\nexport type HumanInTheLoopToolCall<Args extends Record<string, unknown> = Record<string, unknown>> =\n  | {\n      args: Partial<Args>;\n      status: \"in-progress\";\n      result: undefined;\n      respond: (result: unknown) => void;\n    }\n  | {\n      args: Args;\n      status: \"executing\";\n      result: undefined;\n      respond: (result: unknown) => void;\n    }\n  | {\n      args: Args;\n      status: \"complete\";\n      result: string;\n      respond: (result: unknown) => void;\n    };\n\nexport interface ToolRenderer<Args extends Record<string, unknown> = Record<string, unknown>> {\n  toolCall: Signal<AngularToolCall<Args>>;\n}\n\nexport interface HumanInTheLoopToolRenderer<Args extends Record<string, unknown> = Record<string, unknown>> {\n  toolCall: Signal<HumanInTheLoopToolCall<Args>>;\n}\n\nexport type ClientTool<Args extends Record<string, unknown> = Record<string, unknown>> = Omit<\n  FrontendTool<Args>,\n  \"handler\"\n> & {\n  renderer?: Type<ToolRenderer<Args>>;\n};\n\nexport interface RenderToolCallConfig<Args extends Record<string, unknown> = Record<string, unknown>> {\n  name: string;\n  args: z.ZodType<Args>;\n  component: Type<ToolRenderer<Args>>;\n  agentId?: string;\n}\n\nexport interface FrontendToolConfig<Args extends Record<string, unknown> = Record<string, unknown>> {\n  name: string;\n  description: string;\n  parameters: z.ZodType<Args>;\n  component?: Type<ToolRenderer<Args>>;\n  handler: (args: Args) => Promise<unknown>;\n  agentId?: string;\n}\n\nexport interface HumanInTheLoopConfig<Args extends Record<string, unknown> = Record<string, unknown>> {\n  name: string;\n  description: string;\n  parameters: z.ZodType<Args>;\n  component: Type<HumanInTheLoopToolRenderer<Args>>;\n  agentId?: string;\n}\n\nexport function registerRenderToolCall<Args extends Record<string, unknown> = Record<string, unknown>>(\n  renderToolCall: RenderToolCallConfig<Args>,\n): void {\n  const copilotKit = inject(CopilotKit);\n  const destroyRef = inject(DestroyRef);\n\n  copilotKit.addRenderToolCall(renderToolCall);\n\n  destroyRef.onDestroy(() => {\n    copilotKit.removeTool(renderToolCall.name, renderToolCall.agentId);\n  });\n}\n\nexport function registerFrontendTool<Args extends Record<string, unknown> = Record<string, unknown>>(\n  frontendTool: FrontendToolConfig<Args>,\n): void {\n  const injector = inject(Injector);\n  const destroyRef = inject(DestroyRef);\n  const copilotKit = inject(CopilotKit);\n\n  copilotKit.addFrontendTool({\n    ...(frontendTool as FrontendToolConfig),\n    injector,\n  });\n\n  destroyRef.onDestroy(() => {\n    copilotKit.removeTool(frontendTool.name);\n  });\n}\n\nexport function registerHumanInTheLoop<Args extends Record<string, unknown> = Record<string, unknown>>(\n  humanInTheLoop: HumanInTheLoopConfig<Args>,\n): void {\n  const destroyRef = inject(DestroyRef);\n  const copilotKit = inject(CopilotKit);\n\n  copilotKit.addHumanInTheLoop(humanInTheLoop);\n\n  destroyRef.onDestroy(() => {\n    copilotKit.removeTool(humanInTheLoop.name);\n  });\n}\n","import { NgComponentOutlet } from \"@angular/common\";\nimport { Component, inject, input } from \"@angular/core\";\nimport { AssistantMessage, Message, ToolCall, ToolMessage } from \"@ag-ui/client\";\nimport { CopilotKit } from \"./copilotkit\";\nimport {\n  FrontendToolConfig,\n  HumanInTheLoopToolCall,\n  HumanInTheLoopConfig,\n  AngularToolCall,\n  RenderToolCallConfig,\n} from \"./tools\";\nimport { partialJSONParse } from \"@copilotkitnext/shared\";\nimport { HumanInTheLoop } from \"./human-in-the-loop\";\n\ntype RendererToolCallHandler = {\n  type: \"renderer\";\n  config: RenderToolCallConfig;\n};\ntype ClientToolCallHandler = {\n  type: \"clientTool\";\n  config: FrontendToolConfig;\n};\ntype HumanInTheLoopToolCallHandler = {\n  type: \"humanInTheLoopTool\";\n  config: HumanInTheLoopConfig;\n};\n\ntype ToolCallHandler = RendererToolCallHandler | ClientToolCallHandler | HumanInTheLoopToolCallHandler;\n\n@Component({\n  selector: \"copilot-render-tool-calls\",\n  standalone: true,\n  imports: [NgComponentOutlet],\n  template: `\n    @for (toolCall of message().toolCalls ?? []; track toolCall.id) {\n      @let renderConfig = pickRenderer(toolCall.function.name);\n      @if (renderConfig && renderConfig.type !== \"humanInTheLoopTool\" && renderConfig.config.component) {\n        <ng-container\n          *ngComponentOutlet=\"renderConfig.config.component; inputs: { toolCall: buildToolCall(toolCall) }\"\n        />\n      }\n      @if (renderConfig && renderConfig.type === \"humanInTheLoopTool\" && renderConfig.config.component) {\n        <ng-container\n          *ngComponentOutlet=\"\n            renderConfig.config.component;\n            inputs: { toolCall: buildHumanInTheLoopToolCall(toolCall) }\n          \"\n        />\n      }\n    }\n  `,\n})\nexport class RenderToolCalls {\n  readonly #copilotKit = inject(CopilotKit);\n  readonly #hitl = inject(HumanInTheLoop);\n  readonly message = input.required<AssistantMessage>();\n  readonly messages = input.required<Message[]>();\n  readonly isLoading = input<boolean>(false);\n\n  protected pickRenderer(name: string): ToolCallHandler | undefined {\n    type AssistantMessageWithAgent = AssistantMessage & {\n      agentId?: string;\n    };\n    const messageAgentId = (this.message() as AssistantMessageWithAgent).agentId;\n    const renderers = this.#copilotKit.toolCallRenderConfigs();\n    const clientTools = this.#copilotKit.clientToolCallRenderConfigs();\n    const humanInTheLoopTools = this.#copilotKit.humanInTheLoopToolRenderConfigs();\n\n    const renderer = renderers.find(\n      (candidate) =>\n        candidate.name === name && (candidate.agentId === undefined || candidate.agentId === messageAgentId),\n    );\n\n    if (renderer) return { type: \"renderer\", config: renderer };\n\n    const clientTool = clientTools.find(\n      (candidate) =>\n        candidate.name === name && (candidate.agentId === undefined || candidate.agentId === messageAgentId),\n    );\n    if (clientTool) return { type: \"clientTool\", config: clientTool };\n\n    const humanInTheLoopTool = humanInTheLoopTools.find(\n      (candidate) =>\n        candidate.name === name && (candidate.agentId === undefined || candidate.agentId === messageAgentId),\n    );\n    if (humanInTheLoopTool) return { type: \"humanInTheLoopTool\", config: humanInTheLoopTool };\n\n    const starRenderer = renderers.find((candidate) => candidate.name === \"*\");\n    if (starRenderer) return { type: \"renderer\", config: starRenderer };\n\n    return undefined;\n  }\n\n  protected buildToolCall<Args extends Record<string, unknown>>(toolCall: ToolCall): AngularToolCall<Args> {\n    const args = partialJSONParse(toolCall.function.arguments);\n    const message = this.#getToolMessage(toolCall.id);\n\n    if (message) {\n      return {\n        args,\n        status: \"complete\",\n        result: message.content,\n      };\n    } else if (this.isLoading()) {\n      return {\n        args,\n        status: \"in-progress\",\n        result: undefined,\n      };\n    } else {\n      return {\n        args,\n        status: \"executing\",\n        result: undefined,\n      };\n    }\n  }\n\n  protected buildHumanInTheLoopToolCall<Args extends Record<string, unknown>>(\n    toolCall: ToolCall,\n  ): HumanInTheLoopToolCall<Args> {\n    const args = partialJSONParse(toolCall.function.arguments);\n    const message = this.#getToolMessage(toolCall.id);\n    const respond = (result: unknown) => {\n      this.#hitl.addResult(toolCall.id, toolCall.function.name, result);\n    };\n\n    if (message) {\n      return {\n        args,\n        status: \"complete\",\n        result: message.content!,\n        respond,\n      };\n    } else if (this.isLoading()) {\n      return {\n        args,\n        status: \"in-progress\",\n        result: undefined,\n        respond,\n      };\n    } else {\n      return {\n        args,\n        status: \"executing\",\n        result: undefined,\n        respond,\n      };\n    }\n  }\n\n  #getToolMessage(toolCallId: string): ToolMessage | undefined {\n    const message = this.messages().find((m): m is ToolMessage => m.role === \"tool\" && m.toolCallId === toolCallId);\n\n    return message;\n  }\n}\n","import {\n  DestroyRef,\n  Injectable,\n  inject,\n  signal,\n  computed,\n  Signal,\n} from \"@angular/core\";\nimport { CopilotKit } from \"./copilotkit\";\nimport type { AbstractAgent } from \"@ag-ui/client\";\nimport type { Message } from \"@ag-ui/client\";\nimport { DEFAULT_AGENT_ID } from \"@copilotkitnext/shared\";\n\nexport class AgentStore {\n  readonly #subscription?: {\n    unsubscribe: () => void;\n  };\n  readonly #isRunning = signal<boolean>(false);\n  readonly #messages = signal<Message[]>([]);\n  readonly #state = signal<any>(undefined);\n\n  readonly agent: AbstractAgent;\n  readonly isRunning = this.#isRunning.asReadonly();\n  readonly messages = this.#messages.asReadonly();\n  readonly state = this.#state.asReadonly();\n\n  constructor(abstractAgent: AbstractAgent, destroyRef: DestroyRef) {\n    this.agent = abstractAgent;\n\n    this.#subscription = abstractAgent.subscribe({\n      onMessagesChanged: () => {\n        this.#messages.set(abstractAgent.messages);\n      },\n      onStateChanged: () => {\n        this.#state.set(abstractAgent.state);\n      },\n      onRunInitialized: () => {\n        this.#isRunning.set(true);\n      },\n      onRunFinalized: () => {\n        this.#isRunning.set(false);\n      },\n      onRunFailed: () => {\n        this.#isRunning.set(false);\n      },\n    });\n\n    destroyRef.onDestroy(() => {\n      this.teardown();\n    });\n  }\n\n  teardown(): void {\n    if (this.#subscription) {\n      this.#subscription.unsubscribe();\n    }\n  }\n}\n\n@Injectable({ providedIn: \"root\" })\nexport class CopilotkitAgentFactory {\n  readonly #copilotkit = inject(CopilotKit);\n\n  createAgentStoreSignal(\n    agentId: Signal<string | undefined>,\n    destroyRef: DestroyRef\n  ): Signal<AgentStore | undefined> {\n    let lastAgentStore: AgentStore | undefined;\n\n    return computed(() => {\n      this.#copilotkit.agents();\n\n      if (lastAgentStore) {\n        lastAgentStore.teardown();\n        lastAgentStore = undefined;\n      }\n\n      const abstractAgent = this.#copilotkit.getAgent(\n        agentId() || DEFAULT_AGENT_ID\n      );\n      if (!abstractAgent) return undefined;\n\n      lastAgentStore = new AgentStore(abstractAgent, destroyRef);\n      return lastAgentStore;\n    });\n  }\n}\n\nexport function injectAgentStore(\n  agentId: string | Signal<string | undefined>\n): Signal<AgentStore | undefined> {\n  const agentFactory = inject(CopilotkitAgentFactory);\n  const destroyRef = inject(DestroyRef);\n  const agentIdSignal =\n    typeof agentId === \"function\" ? agentId : computed(() => agentId);\n\n  return agentFactory.createAgentStoreSignal(agentIdSignal, destroyRef);\n}\n","import { inject, InjectionToken, Provider } from \"@angular/core\";\n\n// Type for chat labels\nexport interface CopilotChatLabels {\n  chatInputPlaceholder: string;\n  chatInputToolbarStartTranscribeButtonLabel: string;\n  chatInputToolbarCancelTranscribeButtonLabel: string;\n  chatInputToolbarFinishTranscribeButtonLabel: string;\n  chatInputToolbarAddButtonLabel: string;\n  chatInputToolbarToolsButtonLabel: string;\n  assistantMessageToolbarCopyCodeLabel: string;\n  assistantMessageToolbarCopyCodeCopiedLabel: string;\n  assistantMessageToolbarCopyMessageLabel: string;\n  assistantMessageToolbarThumbsUpLabel: string;\n  assistantMessageToolbarThumbsDownLabel: string;\n  assistantMessageToolbarReadAloudLabel: string;\n  assistantMessageToolbarRegenerateLabel: string;\n  userMessageToolbarCopyMessageLabel: string;\n  userMessageToolbarEditMessageLabel: string;\n  chatDisclaimerText: string;\n}\n\n// Default labels constant\nexport const COPILOT_CHAT_DEFAULT_LABELS: CopilotChatLabels = {\n  chatInputPlaceholder: \"Type a message...\",\n  chatInputToolbarStartTranscribeButtonLabel: \"Transcribe\",\n  chatInputToolbarCancelTranscribeButtonLabel: \"Cancel\",\n  chatInputToolbarFinishTranscribeButtonLabel: \"Finish\",\n  chatInputToolbarAddButtonLabel: \"Add photos or files\",\n  chatInputToolbarToolsButtonLabel: \"Tools\",\n  assistantMessageToolbarCopyCodeLabel: \"Copy\",\n  assistantMessageToolbarCopyCodeCopiedLabel: \"Copied\",\n  assistantMessageToolbarCopyMessageLabel: \"Copy\",\n  assistantMessageToolbarThumbsUpLabel: \"Good response\",\n  assistantMessageToolbarThumbsDownLabel: \"Bad response\",\n  assistantMessageToolbarReadAloudLabel: \"Read aloud\",\n  assistantMessageToolbarRegenerateLabel: \"Regenerate\",\n  userMessageToolbarCopyMessageLabel: \"Copy\",\n  userMessageToolbarEditMessageLabel: \"Edit\",\n  chatDisclaimerText:\n    \"AI can make mistakes. Please verify important information.\",\n};\n\nexport const COPILOT_CHAT_LABELS = new InjectionToken<CopilotChatLabels>(\n  \"COPILOT_CHAT_LABELS\"\n);\n\nexport function injectChatLabels(): CopilotChatLabels {\n  return (\n    inject(COPILOT_CHAT_LABELS, { optional: true }) ??\n    COPILOT_CHAT_DEFAULT_LABELS\n  );\n}\n\nexport function provideCopilotChatLabels(\n  config: Partial<CopilotChatLabels>\n): Provider {\n  return {\n    provide: COPILOT_CHAT_LABELS,\n    useValue: {\n      ...COPILOT_CHAT_DEFAULT_LABELS,\n      ...config,\n    },\n  };\n}\n","import { inject, Injectable, WritableSignal } from \"@angular/core\";\n\n@Injectable()\nexport abstract class ChatState {\n  abstract readonly inputValue: WritableSignal<string>;\n\n  abstract submitInput(value: string): void;\n  abstract changeInput(value: string): void;\n}\n\nexport function injectChatState(): ChatState {\n  try {\n    return inject(ChatState);\n  } catch {\n    throw new Error(\n      \"ChatState not found. A parent component must provide ChatState.\"\n    );\n  }\n}\n","import { Injectable, ElementRef, NgZone, OnDestroy } from \"@angular/core\";\nimport { ScrollDispatcher, ViewportRuler } from \"@angular/cdk/scrolling\";\nimport {\n  Observable,\n  Subject,\n  BehaviorSubject,\n  fromEvent,\n  merge,\n  animationFrameScheduler,\n} from \"rxjs\";\nimport {\n  takeUntil,\n  debounceTime,\n  throttleTime,\n  distinctUntilChanged,\n  map,\n  startWith,\n} from \"rxjs/operators\";\n\nexport interface ScrollState {\n  isAtBottom: boolean;\n  scrollTop: number;\n  scrollHeight: number;\n  clientHeight: number;\n}\n\n@Injectable({\n  providedIn: \"root\",\n})\nexport class ScrollPosition implements OnDestroy {\n  private destroy$ = new Subject<void>();\n  private scrollStateSubject = new BehaviorSubject<ScrollState>({\n    isAtBottom: true,\n    scrollTop: 0,\n    scrollHeight: 0,\n    clientHeight: 0,\n  });\n\n  public scrollState$ = this.scrollStateSubject.asObservable();\n\n  constructor(\n    private scrollDispatcher: ScrollDispatcher,\n    private viewportRuler: ViewportRuler,\n    private ngZone: NgZone\n  ) {}\n\n  /**\n   * Monitor scroll position of an element\n   * @param element The element to monitor\n   * @param threshold Pixels from bottom to consider \"at bottom\" (default 10)\n   */\n  monitorScrollPosition(\n    element: ElementRef<HTMLElement> | HTMLElement,\n    threshold: number = 10\n  ): Observable<ScrollState> {\n    const el = element instanceof ElementRef ? element.nativeElement : element;\n\n    // Create scroll observable\n    const scroll$ = merge(\n      fromEvent(el, \"scroll\"),\n      this.viewportRuler.change(150) // Monitor viewport changes\n    ).pipe(\n      startWith(null), // Emit initial state\n      throttleTime(16, animationFrameScheduler, { trailing: true }), // ~60fps\n      map(() => this.getScrollState(el, threshold)),\n      distinctUntilChanged(\n        (a, b) =>\n          a.isAtBottom === b.isAtBottom &&\n          a.scrollTop === b.scrollTop &&\n          a.scrollHeight === b.scrollHeight\n      ),\n      takeUntil(this.destroy$)\n    );\n\n    // Subscribe and update subject\n    scroll$.subscribe((state) => {\n      this.scrollStateSubject.next(state);\n    });\n\n    return scroll$;\n  }\n\n  /**\n   * Scroll element to bottom with smooth animation\n   * @param element The element to scroll\n   * @param smooth Whether to use smooth scrolling\n   */\n  scrollToBottom(\n    element: ElementRef<HTMLElement> | HTMLElement,\n    smooth: boolean = true\n  ): void {\n    const el = element instanceof ElementRef ? element.nativeElement : element;\n\n    this.ngZone.runOutsideAngular(() => {\n      if (smooth && \"scrollBehavior\" in document.documentElement.style) {\n        el.scrollTo({\n          top: el.scrollHeight,\n          behavior: \"smooth\",\n        });\n      } else {\n        el.scrollTop = el.scrollHeight;\n      }\n    });\n  }\n\n  /**\n   * Check if element is at bottom\n   * @param element The element to check\n   * @param threshold Pixels from bottom to consider \"at bottom\"\n   */\n  isAtBottom(\n    element: ElementRef<HTMLElement> | HTMLElement,\n    threshold: number = 10\n  ): boolean {\n    const el = element instanceof ElementRef ? element.nativeElement : element;\n    return this.getScrollState(el, threshold).isAtBottom;\n  }\n\n  /**\n   * Get current scroll state of element\n   */\n  public getScrollState(element: HTMLElement, threshold: number): ScrollState {\n    const scrollTop = element.scrollTop;\n    const scrollHeight = element.scrollHeight;\n    const clientHeight = element.clientHeight;\n    const distanceFromBottom = scrollHeight - scrollTop - clientHeight;\n    const isAtBottom = distanceFromBottom <= threshold;\n\n    return {\n      isAtBottom,\n      scrollTop,\n      scrollHeight,\n      clientHeight,\n    };\n  }\n\n  /**\n   * Create a ResizeObserver for element size changes\n   * @param element The element to observe\n   * @param debounceMs Debounce time in milliseconds\n   */\n  observeResize(\n    element: ElementRef<HTMLElement> | HTMLElement,\n    debounceMs: number = 250\n  ): Observable<ResizeObserverEntry> {\n    const el = element instanceof ElementRef ? element.nativeElement : element;\n    const resize$ = new Subject<ResizeObserverEntry>();\n\n    const resizeObserver = new ResizeObserver((entries) => {\n      const entry = entries[0];\n      if (entry) {\n        this.ngZone.run(() => {\n          resize$.next(entry);\n        });\n      }\n    });\n\n    resizeObserver.observe(el);\n\n    // Cleanup on destroy\n    this.destroy$.subscribe(() => {\n      resizeObserver.disconnect();\n    });\n\n    return resize$.pipe(debounceTime(debounceMs), takeUntil(this.destroy$));\n  }\n\n  ngOnDestroy(): void {\n    this.destroy$.next();\n    this.destroy$.complete();\n    this.scrollStateSubject.complete();\n  }\n}\n","import { Injectable, ElementRef, NgZone, OnDestroy } from \"@angular/core\";\nimport { Observable, Subject, BehaviorSubject } from \"rxjs\";\nimport { debounceTime, takeUntil, distinctUntilChanged } from \"rxjs/operators\";\n\nexport interface ResizeState {\n  width: number;\n  height: number;\n  isResizing: boolean;\n}\n\n@Injectable({\n  providedIn: \"root\",\n})\nexport class ResizeObserverService implements OnDestroy {\n  private destroy$ = new Subject<void>();\n  private observers = new Map<HTMLElement, ResizeObserver>();\n  private resizeStates = new Map<HTMLElement, BehaviorSubject<ResizeState>>();\n  private resizeTimeouts = new Map<HTMLElement, number>();\n\n  constructor(private ngZone: NgZone) {}\n\n  /**\n   * Observe element resize with debouncing and resizing state\n   * @param element Element to observe\n   * @param debounceMs Debounce time (default 250ms)\n   * @param resizingDurationMs How long to show \"isResizing\" state (default 250ms)\n   */\n  observeElement(\n    element: ElementRef<HTMLElement> | HTMLElement,\n    debounceMs: number = 0,\n    resizingDurationMs: number = 250\n  ): Observable<ResizeState> {\n    const el = element instanceof ElementRef ? element.nativeElement : element;\n\n    // Return existing observer if already observing\n    if (this.resizeStates.has(el)) {\n      return this.resizeStates.get(el)!.asObservable();\n    }\n\n    // Create new subject for this element\n    const resizeState$ = new BehaviorSubject<ResizeState>({\n      width: el.offsetWidth,\n      height: el.offsetHeight,\n      isResizing: false,\n    });\n\n    this.resizeStates.set(el, resizeState$);\n\n    // Create ResizeObserver\n    const resizeObserver = new ResizeObserver((entries) => {\n      if (entries.length === 0) return;\n\n      const entry = entries[0];\n      if (!entry) return;\n\n      const { width, height } = entry.contentRect;\n\n      this.ngZone.run(() => {\n        // Clear existing timeout\n        const existingTimeout = this.resizeTimeouts.get(el);\n        if (existingTimeout) {\n          clearTimeout(existingTimeout);\n        }\n\n        // Update state with isResizing = true\n        resizeState$.next({\n          width,\n          height,\n          isResizing: true,\n        });\n\n        // Set timeout to clear isResizing flag\n        if (resizingDurationMs > 0) {\n          const timeout = window.setTimeout(() => {\n            resizeState$.next({\n              width,\n              height,\n              isResizing: false,\n            });\n            this.resizeTimeouts.delete(el);\n          }, resizingDurationMs);\n\n          this.resizeTimeouts.set(el, timeout);\n        } else {\n          // If no duration, immediately set isResizing to false\n          resizeState$.next({\n            width,\n            height,\n            isResizing: false,\n          });\n        }\n      });\n    });\n\n    // Start observing\n    resizeObserver.observe(el);\n    this.observers.set(el, resizeObserver);\n\n    // Return observable with debouncing if specified\n    const observable = resizeState$.asObservable().pipe(\n      debounceMs > 0 ? debounceTime(debounceMs) : (source) => source,\n      distinctUntilChanged(\n        (a, b) =>\n          a.width === b.width &&\n          a.height === b.height &&\n          a.isResizing === b.isResizing\n      ),\n      takeUntil(this.destroy$)\n    );\n\n    return observable;\n  }\n\n  /**\n   * Stop observing an element\n   * @param element Element to stop observing\n   */\n  unobserve(element: ElementRef<HTMLElement> | HTMLElement): void {\n    const el = element instanceof ElementRef ? element.nativeElement : element;\n\n    // Clear timeout if exists\n    const timeout = this.resizeTimeouts.get(el);\n    if (timeout) {\n      clearTimeout(timeout);\n      this.resizeTimeouts.delete(el);\n    }\n\n    // Disconnect observer\n    const observer = this.observers.get(el);\n    if (observer) {\n      observer.disconnect();\n      this.observers.delete(el);\n    }\n\n    // Complete and remove subject\n    const subject = this.resizeStates.get(el);\n    if (subject) {\n      subject.complete();\n      this.resizeStates.delete(el);\n    }\n  }\n\n  /**\n   * Get current size of element\n   * @param element Element to measure\n   */\n  getCurrentSize(element: ElementRef<HTMLElement> | HTMLElement): {\n    width: number;\n    height: number;\n  } {\n    const el = element instanceof ElementRef ? element.nativeElement : element;\n    return {\n      width: el.offsetWidth,\n      height: el.offsetHeight,\n    };\n  }\n\n  /**\n   * Get current resize state of element\n   * @param element Element to check\n   */\n  getCurrentState(\n    element: ElementRef<HTMLElement> | HTMLElement\n  ): ResizeState | null {\n    const el = element instanceof ElementRef ? element.nativeElement : element;\n    const subject = this.resizeStates.get(el);\n    return subject ? subject.value : null;\n  }\n\n  ngOnDestroy(): void {\n    // Clear all timeouts\n    this.resizeTimeouts.forEach((timeout) => clearTimeout(timeout));\n    this.resizeTimeouts.clear();\n\n    // Disconnect all observers\n    this.observers.forEach((observer) => observer.disconnect());\n    this.observers.clear();\n\n    // Complete all subjects\n    this.resizeStates.forEach((subject) => subject.complete());\n    this.resizeStates.clear();\n\n    // Complete destroy subject\n    this.destroy$.next();\n    this.destroy$.complete();\n  }\n}\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Utility function to merge Tailwind CSS classes\n * Combines clsx for conditional classes and tailwind-merge for proper Tailwind class merging\n */\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n","import { effect, inject, Injector, runInInjectionContext, Signal } from \"@angular/core\";\nimport { Context } from \"@ag-ui/client\";\nimport { CopilotKit } from \"./copilotkit\";\n\nexport interface ConnectAgentContextConfig {\n  injector?: Injector;\n}\n\n/**\n * Connects context to the agent.\n *\n * @param context - The context (or a signal of context) to connect to the agent.\n * @param config - Optional configuration for connecting the context.\n */\nexport function connectAgentContext(context: Context | Signal<Context>, config?: ConnectAgentContextConfig) {\n  const injector = inject(Injector, { optional: true }) ?? config?.injector;\n\n  if (!injector) {\n    throw new Error(\n      \"Injector not found. You must call connectAgentContext in an injector context or pass an injector in the config\",\n    );\n  }\n\n  runInInjectionContext(injector, () => {\n    const copilotkit = inject(CopilotKit);\n\n    effect((teardown) => {\n      const contextValue = typeof context === \"function\" ? context() : context;\n      const id = copilotkit.core.addContext(contextValue);\n\n      teardown(() => {\n        copilotkit.core.removeContext(id);\n      });\n    });\n  });\n}\n","import { Type, TemplateRef, InjectionToken } from \"@angular/core\";\n\n/**\n * Represents a value that can be used as a slot override.\n * Can be a component type or template reference only.\n * @internal - This type is for internal use only\n */\nexport type SlotValue<T = any> = Type<T> | TemplateRef<T>;\n\n/**\n * Configuration for a slot\n * @internal - This interface is for internal use only\n */\nexport interface SlotConfig<T = any> {\n  value?: SlotValue<T>;\n  default?: Type<T>;\n}\n\n/**\n * Context passed to slot templates\n */\nexport interface SlotContext<T = any> {\n  $implicit: T;\n  props?: Partial<T>;\n  [key: string]: any;\n}\n\n/**\n * Slot registry entry\n * @internal - This interface is for internal use only\n */\nexport interface SlotRegistryEntry<T = any> {\n  component?: Type<T>;\n  template?: TemplateRef<T>;\n}\n\n/**\n * Options for rendering a slot\n */\nexport interface RenderSlotOptions<T = any> {\n  slot?: SlotValue<T>;\n  defaultComponent: Type<T>;\n  props?: Partial<T>;\n  injector?: any;\n  outputs?: Record<string, (event: any) => void>;\n}\n\n/**\n * Injection token for slot configuration\n */\nexport const SLOT_CONFIG = new InjectionToken<\n  ReadonlyMap<string, SlotRegistryEntry>\n>(\"SLOT_CONFIG\");\n\n/**\n * Type for components with slots\n */\nexport type WithSlots<S extends Record<string, Type<any>>, Rest = object> = {\n  [K in keyof S as `${string & K}Component`]?: Type<any>;\n} & {\n  [K in keyof S as `${string & K}Template`]?: TemplateRef<any>;\n} & {\n  [K in keyof S as `${string & K}Class`]?: string;\n} & Rest;\n","import {\n  Type,\n  TemplateRef,\n  ViewContainerRef,\n  ComponentRef,\n  EmbeddedViewRef,\n  Injector,\n  inject,\n} from \"@angular/core\";\nimport {\n  SlotValue,\n  RenderSlotOptions,\n  SlotRegistryEntry,\n  SLOT_CONFIG,\n} from \"./slot.types\";\n\n/**\n * Renders a slot value into a ViewContainerRef.\n * This is the core utility for slot rendering.\n *\n * @param viewContainer - The ViewContainerRef to render into\n * @param options - Options for rendering the slot\n * @returns The created component or embedded view reference\n *\n * @example\n * ```typescript\n * export class MyComponent {\n *   @ViewChild('container', { read: ViewContainerRef }) container!: ViewContainerRef;\n *\n *   renderButton() {\n *     renderSlot(this.container, {\n *       slot: this.buttonOverride,\n *       defaultComponent: DefaultButton,\n *       props: { text: 'Click me' },\n *       outputs: { click: (event) => this.handleClick(event) }\n *     });\n *   }\n * }\n * ```\n */\nexport function renderSlot<T = any>(\n  viewContainer: ViewContainerRef,\n  options: RenderSlotOptions<T>\n): ComponentRef<T> | EmbeddedViewRef<T> | null {\n  const { slot, defaultComponent, props, injector, outputs } = options;\n\n  viewContainer.clear();\n\n  const effectiveSlot = slot ?? defaultComponent;\n  const effectiveInjector = injector ?? viewContainer.injector;\n\n  if (effectiveSlot instanceof TemplateRef) {\n    // TemplateRef: render template\n    return viewContainer.createEmbeddedView(effectiveSlot, {\n      $implicit: props ?? {},\n      props: props ?? {},\n    } as any);\n  } else if (isComponentType(effectiveSlot)) {\n    // Component type - wrap in try/catch for safety\n    try {\n      return createComponent(\n        viewContainer,\n        effectiveSlot as Type<T>,\n        props,\n        effectiveInjector,\n        outputs\n      );\n    } catch (error) {\n      console.warn(\"Failed to create component:\", effectiveSlot, error);\n      // Fall through to default component\n    }\n  }\n\n  // Default: render default component if provided\n  return defaultComponent\n    ? createComponent(\n        viewContainer,\n        defaultComponent,\n        props,\n        effectiveInjector,\n        outputs\n      )\n    : null;\n}\n\n/**\n * Creates a component and applies properties.\n */\nfunction createComponent<T>(\n  viewContainer: ViewContainerRef,\n  component: Type<T>,\n  props?: Partial<T>,\n  injector?: Injector,\n  outputs?: Record<string, (event: any) => void>\n): ComponentRef<T> {\n  const componentRef = viewContainer.createComponent(component, {\n    injector,\n  });\n\n  if (props) {\n    // Apply props using setInput, but only for declared inputs\n    const cmpDef: any = (component as any).ɵcmp;\n    const declaredInputs = new Set<string>(Object.keys(cmpDef?.inputs ?? {}));\n\n    if (declaredInputs.has(\"props\")) {\n      componentRef.setInput(\"props\", props as any);\n    } else {\n      for (const key in props) {\n        if (declaredInputs.has(key)) {\n          const value = (props as any)[key];\n          componentRef.setInput(key, value);\n        }\n      }\n    }\n  }\n\n  if (outputs) {\n    // Wire up output event handlers with proper cleanup\n    const instance = componentRef.instance as any;\n    const subscriptions: any[] = [];\n\n    for (const [eventName, handler] of Object.entries(outputs)) {\n      if (instance[eventName]?.subscribe) {\n        const subscription = instance[eventName].subscribe(handler);\n        subscriptions.push(subscription);\n      }\n    }\n\n    // Register cleanup on component destroy\n    componentRef.onDestroy(() => {\n      subscriptions.forEach((sub) => sub.unsubscribe());\n    });\n  }\n\n  // Trigger change detection\n  componentRef.changeDetectorRef.detectChanges();\n\n  return componentRef;\n}\n\n/**\n * Checks if a value is a component type.\n * Simplified check - rely on try/catch for actual validation.\n */\nexport function isComponentType(value: any): boolean {\n  // Arrow functions and regular functions without a prototype are not components\n  return typeof value === \"function\" && !!value.prototype;\n}\n\n/**\n * Checks if a value is a valid slot value.\n */\nexport function isSlotValue(value: any): value is SlotValue {\n  return value instanceof TemplateRef || isComponentType(value);\n}\n\n/**\n * Normalizes a slot value to a consistent format.\n */\nexport function normalizeSlotValue<T = any>(\n  value: SlotValue<T> | undefined,\n  defaultComponent: Type<T> | undefined\n): SlotRegistryEntry<T> {\n  if (!value) {\n    return { component: defaultComponent };\n  }\n\n  if (value instanceof TemplateRef) {\n    return { template: value };\n  }\n\n  if (isComponentType(value)) {\n    return { component: value as Type<T> };\n  }\n\n  return { component: defaultComponent };\n}\n\n/**\n * Creates a slot configuration map for a component.\n * \n * @example\n * ```typescript\n * const slots = createSlotConfig({\n    standalone: true,\n*   sendButton: CustomSendButton,\n *   toolbar: 'custom-toolbar-class',\n *   footer: footerTemplate\n * }, {\n *   sendButton: DefaultSendButton,\n *   toolbar: DefaultToolbar,\n *   footer: DefaultFooter\n * });\n * ```\n */\nexport function createSlotConfig<T extends Record<string, Type<any>>>(\n  overrides: Partial<Record<keyof T, SlotValue>>,\n  defaults: T\n): Map<keyof T, SlotRegistryEntry> {\n  const config = new Map<keyof T, SlotRegistryEntry>();\n\n  for (const key in defaults) {\n    const override = overrides[key];\n    const defaultComponent = defaults[key];\n    config.set(key, normalizeSlotValue(override, defaultComponent));\n  }\n\n  return config;\n}\n\n/**\n * Provides slot configuration to child components via DI.\n * \n * @example\n * ```typescript\n * @Component({\n  standalone: true,\n*   providers: [\n *     provideSlots({\n *       sendButton: CustomSendButton,\n *       toolbar: CustomToolbar\n *     })\n *   ]\n * })\n * ```\n */\nexport function provideSlots(slots: Record<string, Type<any>>) {\n  const slotMap = new Map<string, SlotRegistryEntry>();\n\n  // Only accept component types in DI (templates lack view context)\n  for (const [key, value] of Object.entries(slots)) {\n    if (isComponentType(value)) {\n      slotMap.set(key, { component: value as Type<any> });\n    }\n  }\n\n  return {\n    provide: SLOT_CONFIG,\n    useValue: slotMap,\n  };\n}\n\n/**\n * Gets slot configuration from DI.\n * Must be called within an injection context.\n *\n * @example\n * ```typescript\n * export class MyComponent {\n *   slots = getSlotConfig();\n *\n *   ngOnInit() {\n *     const sendButton = this.slots?.get('sendButton');\n *   }\n * }\n * ```\n */\nexport function getSlotConfig(): ReadonlyMap<string, SlotRegistryEntry> | null {\n  return inject(SLOT_CONFIG, { optional: true });\n}\n\n/**\n * Creates a render function for a specific slot.\n * Useful for creating reusable slot renderers.\n *\n * @example\n * ```typescript\n * const renderSendButton = createSlotRenderer(\n *   DefaultSendButton,\n *   'sendButton'\n * );\n *\n * // Later in template\n * renderSendButton(this.viewContainer, this.sendButtonOverride);\n * ```\n */\nexport function createSlotRenderer<T>(\n  defaultComponent: Type<T>,\n  slotName?: string\n) {\n  // Get config in the injection context when the renderer is created\n  const config = slotName ? getSlotConfig() : null;\n\n  return (\n    viewContainer: ViewContainerRef,\n    slot?: SlotValue<T>,\n    props?: Partial<T>,\n    outputs?: Record<string, (event: any) => void>\n  ) => {\n    // Check DI for overrides if slot name provided\n    if (slotName && !slot && config) {\n      const entry = config.get(slotName);\n      if (entry) {\n        if (entry.component) slot = entry.component;\n        else if (entry.template) slot = entry.template;\n      }\n    }\n\n    return renderSlot(viewContainer, {\n      slot,\n      defaultComponent,\n      props,\n      outputs,\n    });\n  };\n}\n","import {\n  Component,\n  TemplateRef,\n  ViewContainerRef,\n  OnInit,\n  OnChanges,\n  SimpleChanges,\n  Inject,\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n  input,\n  ViewChild,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { renderSlot } from \"./slot.utils\";\nimport { Type } from \"@angular/core\";\n\n/**\n * @internal - This component is for internal use only.\n * Simple slot component for rendering custom content or defaults.\n * Supports templates and components only.\n *\n * @example\n * ```html\n * <!-- With template -->\n * <copilot-slot [slot]=\"sendButtonTemplate\" [context]=\"buttonContext\">\n *   <button class=\"default-btn\">Default</button>\n * </copilot-slot>\n * ```\n */\n@Component({\n  standalone: true,\n  selector: \"copilot-slot\",\n  imports: [CommonModule],\n  template: `\n    <!-- If slot template provided, render it -->\n    @if (slot() && isTemplate(slot)) {\n      <ng-container\n        [ngTemplateOutlet]=\"slot\"\n        [ngTemplateOutletContext]=\"context || {}\"\n      >\n      </ng-container>\n    }\n\n    <!-- If not a template, we'll handle in code -->\n    <ng-container #slotContainer></ng-container>\n\n    <!-- Default content (only shown if no slot) -->\n    @if (!slot && !defaultComponent) {\n      <ng-content></ng-content>\n    }\n  `,\n  changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CopilotSlot implements OnInit, OnChanges {\n  slot = input<TemplateRef<any> | Type<any> | undefined>(undefined);\n  context = input<any | undefined>(undefined);\n  defaultComponent = input<Type<any> | undefined>(undefined);\n  outputs = input<Record<string, (event: any) => void> | undefined>(undefined);\n\n  @ViewChild(\"slotContainer\", { read: ViewContainerRef, static: true })\n  private slotContainer!: ViewContainerRef;\n\n  private componentRef?: any;\n\n  constructor(\n    @Inject(ViewContainerRef) private viewContainer: ViewContainerRef,\n    private cdr: ChangeDetectorRef\n  ) {}\n\n  ngOnInit(): void {\n    this.renderSlot();\n  }\n\n  ngOnChanges(changes: SimpleChanges): void {\n    if (changes[\"slot\"]) {\n      // Slot changed, need to re-render completely\n      this.renderSlot();\n    } else if (changes[\"context\"] && this.componentRef) {\n      // Just context changed, update existing component\n      this.updateComponentProps();\n      this.cdr.detectChanges();\n    } else if (changes[\"context\"]) {\n      // No component ref yet, render the slot\n      this.renderSlot();\n    }\n  }\n\n  isTemplate(value: any): value is TemplateRef<any> {\n    return value instanceof TemplateRef;\n  }\n\n  private renderSlot(): void {\n    // Skip if it's a template (handled by ngTemplateOutlet)\n    if (this.slot() && this.isTemplate(this.slot())) {\n      this.componentRef = null;\n      return;\n    }\n\n    // Clear previous content\n    this.slotContainer.clear();\n    this.componentRef = null;\n\n    // Skip if no slot and no default component\n    if (!this.slot() && !this.defaultComponent()) {\n      return;\n    }\n\n    // Use the utility to render other slot types\n    if (this.slot() || this.defaultComponent()) {\n      this.componentRef = renderSlot(this.slotContainer, {\n        slot: this.slot(),\n        defaultComponent: this.defaultComponent()!,\n        props: this.context(),\n        outputs: this.outputs(),\n      });\n    }\n  }\n\n  private updateComponentProps(): void {\n    if (!this.componentRef || !this.componentRef.instance) {\n      return;\n    }\n\n    const props = this.context();\n\n    // Update props using setInput, only for declared inputs\n    if (props) {\n      const ctor = this.componentRef.instance.constructor as any;\n      const cmpDef: any = ctor?.ɵcmp;\n      const declaredInputs = new Set<string>(Object.keys(cmpDef?.inputs ?? {}));\n\n      if (declaredInputs.has(\"props\")) {\n        this.componentRef.setInput(\"props\", props);\n      } else {\n        for (const key in props) {\n          if (declaredInputs.has(key)) {\n            const value = props[key];\n            this.componentRef.setInput(key, value);\n          }\n        }\n      }\n    }\n\n    // Trigger change detection\n    if (this.componentRef.changeDetectorRef) {\n      this.componentRef.changeDetectorRef.detectChanges();\n    }\n  }\n}\n","import {\n  Directive,\n  Input,\n  OnInit,\n  OnChanges,\n  OnDestroy,\n  SimpleChanges,\n  Inject,\n} from \"@angular/core\";\nimport { CopilotKit } from \"../copilotkit\";\nimport type { Context } from \"@ag-ui/client\";\n\n/**\n * Directive to manage agent context in CopilotKit.\n * Automatically adds context on init, updates on changes, and removes on destroy.\n *\n * @example\n * ```html\n * <!-- With separate inputs -->\n * <div copilotkitAgentContext\n *      [description]=\"'User preferences'\"\n *      [value]=\"userSettings\">\n * </div>\n *\n * <!-- With context object -->\n * <div [copilotkitAgentContext]=\"contextObject\">\n * </div>\n *\n * <!-- With dynamic values -->\n * <div copilotkitAgentContext\n *      description=\"Form state\"\n *      [value]=\"formData$ | async\">\n * </div>\n * ```\n */\n@Directive({\n  selector: \"[copilotkitAgentContext]\",\n  standalone: true,\n})\nexport class CopilotKitAgentContext implements OnInit, OnChanges, OnDestroy {\n  private contextId?: string;\n\n  constructor(@Inject(CopilotKit) private readonly copilotkit: CopilotKit) {}\n\n  /**\n   * Context object containing both description and value.\n   * If provided, this takes precedence over individual inputs.\n   */\n  @Input(\"copilotkitAgentContext\") context?: Context;\n\n  /**\n   * Description of the context.\n   * Used when context object is not provided.\n   */\n  @Input() description?: string;\n\n  /**\n   * Value of the context.\n   * Used when context object is not provided.\n   */\n  @Input() value?: any;\n\n  ngOnInit(): void {\n    this.addContext();\n  }\n\n  ngOnChanges(changes: SimpleChanges): void {\n    // Check if any relevant input has changed\n    const hasContextChange = \"context\" in changes;\n    const hasDescriptionChange = \"description\" in changes;\n    const hasValueChange = \"value\" in changes;\n\n    if (hasContextChange || hasDescriptionChange || hasValueChange) {\n      // Skip the first change as ngOnInit handles initial setup\n      if (this.contextId) {\n        this.updateContext();\n      }\n    }\n  }\n\n  ngOnDestroy(): void {\n    this.removeContext();\n  }\n\n  /**\n   * Adds the context to CopilotKit\n   */\n  private addContext(): void {\n    const contextToAdd = this.getContext();\n\n    if (contextToAdd) {\n      this.contextId = this.copilotkit.core.addContext(contextToAdd);\n    }\n  }\n\n  /**\n   * Updates the context by removing the old one and adding a new one\n   */\n  private updateContext(): void {\n    this.removeContext();\n    this.addContext();\n  }\n\n  /**\n   * Removes the current context from CopilotKit\n   */\n  private removeContext(): void {\n    if (this.contextId) {\n      this.copilotkit.core.removeContext(this.contextId);\n      this.contextId = undefined;\n    }\n  }\n\n  /**\n   * Gets the context object from inputs\n   */\n  private getContext(): Context | null {\n    // If context object is provided, use it\n    if (this.context) {\n      return this.context;\n    }\n\n    // Otherwise, build from individual inputs\n    // Note: null is a valid value, but undefined means not set\n    if (this.description !== undefined && this.value !== undefined) {\n      return {\n        description: this.description,\n        value: this.value,\n      };\n    }\n\n    return null;\n  }\n}\n","import {\n  Directive,\n  ElementRef,\n  OnInit,\n  OnDestroy,\n  AfterViewInit,\n  inject,\n  input,\n  output,\n} from \"@angular/core\";\nimport { ScrollPosition } from \"../scroll-position\";\nimport { ResizeObserverService } from \"../resize-observer\";\nimport { Subject } from \"rxjs\";\nimport {\n  takeUntil,\n  debounceTime,\n  filter,\n  distinctUntilChanged,\n} from \"rxjs/operators\";\n\nexport type ScrollBehavior = \"smooth\" | \"instant\" | \"auto\";\n\n/**\n * Directive for implementing stick-to-bottom scroll behavior\n * Similar to the React use-stick-to-bottom library\n *\n * @example\n * ```html\n * <div copilotStickToBottom\n *      [enabled]=\"true\"\n *      [threshold]=\"10\"\n *      [initialBehavior]=\"'smooth'\"\n *      [resizeBehavior]=\"'smooth'\"\n *      (isAtBottomChange)=\"onBottomChange($event)\">\n *   <!-- Content -->\n * </div>\n * ```\n */\n@Directive({\n  standalone: true,\n  selector: \"[copilotStickToBottom]\",\n  providers: [ScrollPosition, ResizeObserverService],\n})\nexport class StickToBottom implements OnInit, AfterViewInit, OnDestroy {\n  enabled = input<boolean>(true);\n  threshold = input<number>(10);\n  initialBehavior = input<ScrollBehavior>(\"smooth\");\n  resizeBehavior = input<ScrollBehavior>(\"smooth\");\n  debounceMs = input<number>(100);\n\n  isAtBottomChange = output<boolean>();\n  scrollToBottomRequested = output<void>();\n\n  private elementRef = inject(ElementRef);\n  private scrollService = inject(ScrollPosition);\n  private resizeService = inject(ResizeObserverService);\n\n  private destroy$ = new Subject<void>();\n  private contentElement?: HTMLElement;\n  private wasAtBottom = true;\n  private hasInitialized = false;\n  private userHasScrolled = false;\n\n  ngOnInit(): void {\n    // Setup will happen in ngAfterViewInit\n  }\n\n  ngAfterViewInit(): void {\n    const element = this.elementRef.nativeElement as HTMLElement;\n\n    // Find or create content wrapper\n    this.contentElement = element.querySelector(\n      \"[data-stick-to-bottom-content]\"\n    ) as HTMLElement;\n    if (!this.contentElement) {\n      this.contentElement = element;\n    }\n\n    this.setupScrollMonitoring();\n    this.setupResizeMonitoring();\n    this.setupContentMutationObserver();\n\n    // Initial scroll to bottom if enabled\n    setTimeout(() => {\n      this.hasInitialized = true;\n      if (this.enabled()) {\n        this.scrollToBottom(this.initialBehavior());\n      }\n    }, 0);\n  }\n\n  private setupScrollMonitoring(): void {\n    if (!this.enabled()) return;\n\n    const element = this.elementRef.nativeElement;\n\n    // Monitor scroll position\n    this.scrollService\n      .monitorScrollPosition(element, this.threshold())\n      .pipe(\n        takeUntil(this.destroy$),\n        debounceTime(this.debounceMs()),\n        distinctUntilChanged((a, b) => a.isAtBottom === b.isAtBottom)\n      )\n      .subscribe((state) => {\n        const wasAtBottom = this.wasAtBottom;\n        this.wasAtBottom = state.isAtBottom;\n\n        // Detect user scroll\n        if (!state.isAtBottom && wasAtBottom && this.hasInitialized) {\n          this.userHasScrolled = true;\n        } else if (state.isAtBottom) {\n          this.userHasScrolled = false;\n        }\n\n        // Emit change\n        this.isAtBottomChange.emit(state.isAtBottom);\n      });\n  }\n\n  private setupResizeMonitoring(): void {\n    if (!this.enabled() || !this.contentElement) return;\n\n    // Monitor content resize\n    this.resizeService\n      .observeElement(this.contentElement, 0, 250)\n      .pipe(\n        takeUntil(this.destroy$),\n        filter(() => this.enabled() && !this.userHasScrolled)\n      )\n      .subscribe((state) => {\n        // Auto-scroll on resize if we were at bottom\n        if (this.wasAtBottom && !state.isResizing) {\n          this.scrollToBottom(this.resizeBehavior());\n        }\n      });\n\n    // Monitor container resize\n    const element = this.elementRef.nativeElement;\n    this.resizeService\n      .observeElement(element, 0, 250)\n      .pipe(\n        takeUntil(this.destroy$),\n        filter(\n          () => this.enabled() && !this.userHasScrolled && this.wasAtBottom\n        )\n      )\n      .subscribe(() => {\n        // Adjust scroll on container resize\n        this.scrollToBottom(this.resizeBehavior());\n      });\n  }\n\n  private setupContentMutationObserver(): void {\n    if (!this.enabled() || !this.contentElement) return;\n\n    const mutationObserver = new MutationObserver(() => {\n      if (this.enabled() && this.wasAtBottom && !this.userHasScrolled) {\n        // Content changed, scroll to bottom if we were there\n        requestAnimationFrame(() => {\n          this.scrollToBottom(this.resizeBehavior());\n        });\n      }\n    });\n\n    mutationObserver.observe(this.contentElement, {\n      childList: true,\n      subtree: true,\n      characterData: true,\n    });\n\n    // Cleanup on destroy\n    this.destroy$.subscribe(() => {\n      mutationObserver.disconnect();\n    });\n  }\n\n  /**\n   * Public method to scroll to bottom\n   * Can be called from parent component\n   */\n  public scrollToBottom(behavior: ScrollBehavior = \"smooth\"): void {\n    const element = this.elementRef.nativeElement;\n    const smooth = behavior === \"smooth\";\n\n    this.scrollService.scrollToBottom(element, smooth);\n    this.userHasScrolled = false;\n    this.scrollToBottomRequested.emit();\n  }\n\n  /**\n   * Check if currently at bottom\n   */\n  public isAtBottom(): boolean {\n    return this.scrollService.isAtBottom(\n      this.elementRef.nativeElement,\n      this.threshold()\n    );\n  }\n\n  /**\n   * Get current scroll state\n   */\n  public getScrollState() {\n    const element = this.elementRef.nativeElement;\n    return {\n      scrollTop: element.scrollTop,\n      scrollHeight: element.scrollHeight,\n      clientHeight: element.clientHeight,\n      isAtBottom: this.isAtBottom(),\n    };\n  }\n\n  ngOnDestroy(): void {\n    this.destroy$.next();\n    this.destroy$.complete();\n  }\n}\n","import {\n  Directive,\n  Input,\n  ElementRef,\n  HostListener,\n  OnDestroy,\n  inject,\n  ViewContainerRef,\n} from \"@angular/core\";\nimport {\n  Overlay,\n  OverlayRef,\n  OverlayPositionBuilder,\n  ConnectedPosition,\n} from \"@angular/cdk/overlay\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport {\n  Component,\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n} from \"@angular/core\";\n\n@Component({\n  selector: \"copilot-tooltip-content\",\n  standalone: true,\n  template: `\n    <div class=\"copilot-tooltip-wrapper\" [attr.data-position]=\"position\">\n      <div class=\"copilot-tooltip\">\n        {{ text }}\n      </div>\n      <div class=\"copilot-tooltip-arrow\"></div>\n    </div>\n  `,\n  styles: [\n    `\n      .copilot-tooltip-wrapper {\n        position: relative;\n        display: inline-block;\n        animation: fadeIn 0.15s ease-in-out;\n      }\n\n      .copilot-tooltip {\n        background-color: #1a1a1a;\n        color: white;\n        padding: 6px 10px;\n        border-radius: 6px;\n        font-size: 12px;\n        font-weight: 500;\n        white-space: nowrap;\n        max-width: 200px;\n        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n      }\n\n      .copilot-tooltip-arrow {\n        position: absolute;\n        width: 0;\n        height: 0;\n        border-style: solid;\n      }\n\n      /* Arrow for tooltip below element (arrow points up to tooltip) */\n      .copilot-tooltip-wrapper[data-position=\"below\"] .copilot-tooltip-arrow {\n        top: -4px;\n        left: 50%;\n        transform: translateX(-50%);\n        border-width: 0 4px 4px 4px;\n        border-color: transparent transparent #1a1a1a transparent;\n      }\n\n      /* Arrow for tooltip above element (arrow points down to element) */\n      .copilot-tooltip-wrapper[data-position=\"above\"] .copilot-tooltip-arrow {\n        bottom: -4px;\n        left: 50%;\n        transform: translateX(-50%);\n        border-width: 4px 4px 0 4px;\n        border-color: #1a1a1a transparent transparent transparent;\n      }\n\n      /* Arrow for tooltip to the left */\n      .copilot-tooltip-wrapper[data-position=\"left\"] .copilot-tooltip-arrow {\n        right: -4px;\n        top: 50%;\n        transform: translateY(-50%);\n        border-width: 4px 0 4px 4px;\n        border-color: transparent transparent transparent #1a1a1a;\n      }\n\n      /* Arrow for tooltip to the right */\n      .copilot-tooltip-wrapper[data-position=\"right\"] .copilot-tooltip-arrow {\n        left: -4px;\n        top: 50%;\n        transform: translateY(-50%);\n        border-width: 4px 4px 4px 0;\n        border-color: transparent #1a1a1a transparent transparent;\n      }\n\n      @keyframes fadeIn {\n        from {\n          opacity: 0;\n          transform: translateY(2px);\n        }\n        to {\n          opacity: 1;\n          transform: translateY(0);\n        }\n      }\n    `,\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TooltipContent {\n  text = \"\";\n  private _position: \"above\" | \"below\" | \"left\" | \"right\" = \"below\";\n\n  get position(): \"above\" | \"below\" | \"left\" | \"right\" {\n    return this._position;\n  }\n\n  set position(value: \"above\" | \"below\" | \"left\" | \"right\") {\n    this._position = value;\n    this.cdr.markForCheck();\n  }\n\n  constructor(private cdr: ChangeDetectorRef) {}\n}\n\n@Directive({\n  selector: \"[copilotTooltip]\",\n  standalone: true,\n})\nexport class CopilotTooltip implements OnDestroy {\n  @Input(\"copilotTooltip\") tooltipText = \"\";\n  @Input() tooltipPosition: \"above\" | \"below\" | \"left\" | \"right\" = \"below\";\n  @Input() tooltipDelay = 500; // milliseconds\n\n  private overlay = inject(Overlay);\n  private overlayPositionBuilder = inject(OverlayPositionBuilder);\n  private elementRef = inject(ElementRef);\n  private viewContainerRef = inject(ViewContainerRef);\n\n  private overlayRef?: OverlayRef;\n  private tooltipTimeout?: number;\n  private originalTitle?: string;\n\n  @HostListener(\"mouseenter\")\n  onMouseEnter(): void {\n    if (!this.tooltipText) return;\n\n    // Store and remove native title to prevent OS tooltip\n    const element = this.elementRef.nativeElement;\n    if (element.hasAttribute(\"title\")) {\n      this.originalTitle = element.getAttribute(\"title\");\n      element.removeAttribute(\"title\");\n    }\n\n    // Clear any existing timeout\n    if (this.tooltipTimeout) {\n      clearTimeout(this.tooltipTimeout);\n    }\n\n    // Set timeout to show tooltip after delay\n    this.tooltipTimeout = window.setTimeout(() => {\n      this.show();\n    }, this.tooltipDelay);\n  }\n\n  @HostListener(\"mouseleave\")\n  onMouseLeave(): void {\n    // Clear timeout if mouse leaves before tooltip shows\n    if (this.tooltipTimeout) {\n      clearTimeout(this.tooltipTimeout);\n      this.tooltipTimeout = undefined;\n    }\n\n    // Restore original title if it existed\n    if (this.originalTitle !== undefined) {\n      this.elementRef.nativeElement.setAttribute(\"title\", this.originalTitle);\n      this.originalTitle = undefined;\n    }\n\n    // Hide tooltip if it's showing\n    this.hide();\n  }\n\n  private show(): void {\n    if (this.overlayRef) {\n      return;\n    }\n\n    // Create overlay\n    const positionStrategy = this.overlayPositionBuilder\n      .flexibleConnectedTo(this.elementRef)\n      .withPositions(this.getPositions())\n      .withPush(false);\n\n    this.overlayRef = this.overlay.create({\n      positionStrategy,\n      scrollStrategy: this.overlay.scrollStrategies.close(),\n      hasBackdrop: false,\n    });\n\n    // Create component portal and attach\n    const portal = new ComponentPortal(TooltipContent, this.viewContainerRef);\n    const componentRef = this.overlayRef.attach(portal);\n    componentRef.instance.text = this.tooltipText;\n\n    // Detect actual position after overlay is positioned\n    setTimeout(() => {\n      if (this.overlayRef && this.elementRef.nativeElement) {\n        const tooltipRect =\n          this.overlayRef.overlayElement.getBoundingClientRect();\n        const elementRect =\n          this.elementRef.nativeElement.getBoundingClientRect();\n\n        let actualPosition: \"above\" | \"below\" | \"left\" | \"right\" = \"below\";\n\n        // Determine actual position based on relative positions\n        if (tooltipRect.bottom <= elementRect.top) {\n          actualPosition = \"above\";\n        } else if (tooltipRect.top >= elementRect.bottom) {\n          actualPosition = \"below\";\n        } else if (tooltipRect.right <= elementRect.left) {\n          actualPosition = \"left\";\n        } else if (tooltipRect.left >= elementRect.right) {\n          actualPosition = \"right\";\n        }\n\n        componentRef.instance.position = actualPosition;\n      }\n    }, 0);\n  }\n\n  private hide(): void {\n    if (this.overlayRef) {\n      this.overlayRef.dispose();\n      this.overlayRef = undefined;\n    }\n  }\n\n  private getPositions(): ConnectedPosition[] {\n    const positions: Record<string, ConnectedPosition[]> = {\n      above: [\n        {\n          originX: \"center\",\n          originY: \"top\",\n          overlayX: \"center\",\n          overlayY: \"bottom\",\n          offsetY: -12,\n        },\n      ],\n      below: [\n        {\n          originX: \"center\",\n          originY: \"bottom\",\n          overlayX: \"center\",\n          overlayY: \"top\",\n          offsetY: 12,\n        },\n      ],\n      left: [\n        {\n          originX: \"start\",\n          originY: \"center\",\n          overlayX: \"end\",\n          overlayY: \"center\",\n          offsetX: -12,\n        },\n      ],\n      right: [\n        {\n          originX: \"end\",\n          originY: \"center\",\n          overlayX: \"start\",\n          overlayY: \"center\",\n          offsetX: 12,\n        },\n      ],\n    };\n\n    // Prefer below position, but use above as fallback\n    const primary = positions[this.tooltipPosition] || positions.below;\n    // For below position, add above as first fallback\n    const fallbacks =\n      this.tooltipPosition === \"below\"\n        ? [\n            ...(positions.above || []),\n            ...(positions.left || []),\n            ...(positions.right || []),\n          ]\n        : Object.values(positions)\n            .filter((p) => p !== primary)\n            .flat();\n\n    return [...(primary || []), ...fallbacks];\n  }\n\n  ngOnDestroy(): void {\n    if (this.tooltipTimeout) {\n      clearTimeout(this.tooltipTimeout);\n    }\n    // Restore original title if it existed\n    if (this.originalTitle !== undefined) {\n      this.elementRef.nativeElement.setAttribute(\"title\", this.originalTitle);\n    }\n    this.hide();\n  }\n}\n","import { Component, ChangeDetectionStrategy, input } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport type { AssistantMessage, Message } from \"@ag-ui/core\";\nimport { RenderToolCalls } from \"../../render-tool-calls\";\n\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-tool-calls-view\",\n  imports: [CommonModule, RenderToolCalls],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  template: `\n    <copilot-render-tool-calls\n      [message]=\"message()\"\n      [messages]=\"messages()\"\n      [isLoading]=\"isLoading()\"\n    >\n    </copilot-render-tool-calls>\n  `,\n})\nexport class CopilotChatToolCallsView {\n  readonly message = input.required<AssistantMessage>();\n  readonly messages = input.required<Message[]>();\n  readonly isLoading = input<boolean>(false);\n}\n","import {\n  Component,\n  input,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n  computed,\n  effect,\n  inject,\n  ElementRef,\n  AfterViewInit,\n  ViewChild,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { Marked } from \"marked\";\nimport hljs from \"highlight.js\";\nimport * as katex from \"katex\";\nimport { completePartialMarkdown } from \"@copilotkitnext/core\";\nimport { LucideAngularModule } from \"lucide-angular\";\nimport { injectChatLabels } from \"../../chat-config\";\n\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-assistant-message-renderer\",\n  imports: [CommonModule, LucideAngularModule],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <div\n      #markdownContainer\n      [class]=\"inputClass()\"\n      (click)=\"handleClick($event)\"\n    ></div>\n  `,\n  styles: [\n    `\n      copilot-chat-assistant-message-renderer {\n        display: block;\n        width: 100%;\n      }\n\n      /* Inline code styling */\n      copilot-chat-assistant-message-renderer code:not(pre code) {\n        padding: 2.5px 4.8px;\n        background-color: rgb(236, 236, 236);\n        border-radius: 0.25rem;\n        font-size: 0.875rem;\n        font-family:\n          ui-monospace, SFMono-Regular, \"SF Mono\", Consolas, \"Liberation Mono\",\n          Menlo, monospace;\n        font-weight: 500;\n        color: #000000;\n      }\n\n      .dark copilot-chat-assistant-message-renderer code:not(pre code) {\n        background-color: #171717; /* same as code blocks */\n        color: rgb(248, 250, 252); /* text-foreground in dark mode */\n      }\n\n      /* Code block container */\n      copilot-chat-assistant-message-renderer .code-block-container {\n        position: relative;\n        margin: 0.25rem 0;\n        background-color: rgb(249, 249, 249);\n        border-radius: 1rem;\n      }\n\n      .dark copilot-chat-assistant-message-renderer .code-block-container {\n        background-color: #171717;\n      }\n\n      copilot-chat-assistant-message-renderer .code-block-header {\n        display: flex;\n        align-items: center;\n        justify-content: space-between;\n        padding: 0.75rem 1rem 0.75rem 1rem;\n        font-size: 0.75rem;\n        background-color: transparent;\n      }\n\n      copilot-chat-assistant-message-renderer .code-block-language {\n        font-weight: 400;\n        color: rgba(115, 115, 115, 1);\n      }\n\n      .dark copilot-chat-assistant-message-renderer .code-block-language {\n        color: white;\n      }\n\n      copilot-chat-assistant-message-renderer .code-block-copy-button {\n        display: flex;\n        align-items: center;\n        gap: 0.125rem;\n        padding: 0 0.5rem;\n        font-size: 0.75rem;\n        color: rgba(115, 115, 115, 1);\n        cursor: pointer;\n        background: none;\n        border: none;\n        transition: opacity 0.2s;\n      }\n\n      .dark copilot-chat-assistant-message-renderer .code-block-copy-button {\n        color: white;\n      }\n\n      copilot-chat-assistant-message-renderer .code-block-copy-button:hover {\n        opacity: 0.8;\n      }\n\n      copilot-chat-assistant-message-renderer .code-block-copy-button svg {\n        width: 10px;\n        height: 10px;\n      }\n\n      copilot-chat-assistant-message-renderer .code-block-copy-button span {\n        font-size: 11px;\n      }\n\n      copilot-chat-assistant-message-renderer pre {\n        margin: 0;\n        padding: 0 1rem 1rem 1rem;\n        overflow-x: auto;\n        background-color: transparent;\n        border-radius: 1rem;\n      }\n\n      .dark copilot-chat-assistant-message-renderer pre {\n        background-color: transparent;\n      }\n\n      copilot-chat-assistant-message-renderer pre code {\n        background-color: transparent;\n        padding: 0;\n        font-size: 0.875rem;\n        font-family:\n          ui-monospace, SFMono-Regular, \"SF Mono\", Consolas, \"Liberation Mono\",\n          Menlo, monospace;\n      }\n\n      /* Highlight.js theme adjustments */\n      copilot-chat-assistant-message-renderer .hljs {\n        background: transparent;\n        color: rgb(56, 58, 66);\n      }\n\n      .dark copilot-chat-assistant-message-renderer .hljs {\n        background: transparent;\n        color: #abb2bf;\n      }\n\n      /* Math equations */\n      copilot-chat-assistant-message-renderer .katex-display {\n        overflow-x: auto;\n        overflow-y: hidden;\n        padding: 1rem 0;\n      }\n    `,\n  ],\n})\nexport class CopilotChatAssistantMessageRenderer implements AfterViewInit {\n  readonly content = input<string>(\"\");\n  readonly inputClass = input<string | undefined>();\n  readonly labels = injectChatLabels();\n\n  @ViewChild(\"markdownContainer\", { static: false })\n  markdownContainer?: ElementRef<HTMLDivElement>;\n\n  private elementRef = inject(ElementRef);\n\n  // Track copy states for code blocks (DOM-updated; no signal needed)\n  private copyStates = new Map<string, boolean>();\n\n  readonly renderedHtml = computed(() => {\n    const currentContent = this.content();\n    const completedMarkdown = completePartialMarkdown(currentContent);\n    return this.renderMarkdown(completedMarkdown);\n  });\n\n  constructor() {\n    // React to content changes using signals\n    effect(() => {\n      // Read content to establish dependency\n      this.content();\n      // Reset copy states when content changes\n      this.copyStates.clear();\n      // If view is ready, update DOM\n      if (this.markdownContainer) {\n        this.updateContent();\n        this.renderMathEquations();\n      }\n    });\n  }\n\n  ngAfterViewInit(): void {\n    this.updateContent();\n    this.renderMathEquations();\n  }\n\n  private updateContent(): void {\n    if (!this.markdownContainer) return;\n    const container = this.markdownContainer.nativeElement;\n    const html = this.renderedHtml();\n    container.innerHTML = html;\n  }\n\n  private codeBlocksMap = new Map<string, string>();\n  private markedInstance: Marked | null = null;\n\n  private initializeMarked(): void {\n    if (this.markedInstance) return;\n\n    // Store highlighted code blocks temporarily\n    const highlightedBlocks = new Map<string, string>();\n\n    // Create a new Marked instance\n    this.markedInstance = new Marked();\n\n    // Configure marked options\n    this.markedInstance.setOptions({\n      gfm: true,\n      breaks: true,\n    });\n\n    // Add a walkTokens function to process code tokens before rendering\n    this.markedInstance.use({\n      walkTokens: (token: any) => {\n        if (token.type === \"code\") {\n          const rawCode = token.text;\n          const lang = token.lang || \"\";\n\n          const blockId = this.generateBlockId(rawCode);\n          // Store the raw code in our map for copying\n          this.codeBlocksMap.set(blockId, rawCode);\n\n          const copyLabel = this.labels.assistantMessageToolbarCopyCodeLabel;\n\n          // Manually highlight the code\n          const language = hljs.getLanguage(lang) ? lang : \"plaintext\";\n          const highlighted = hljs.highlight(rawCode, { language }).value;\n          const codeClass = lang ? `hljs language-${lang}` : \"hljs\";\n\n          // Create the full HTML with header and highlighted code\n          const fullHtml = `\n            <div class=\"code-block-container\">\n              <div class=\"code-block-header\">\n                ${lang ? `<span class=\"code-block-language\">${lang}</span>` : \"<span></span>\"}\n                <button \n                  class=\"code-block-copy-button\" \n                  data-code-block-id=\"${blockId}\"\n                  aria-label=\"${copyLabel} code\">\n                  <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"10\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"/><path d=\"M4 16c-1.11 0-2-.9-2-2V4c0-1.11.89-2 2-2h10c1.11 0 2 .89 2 2\"/></svg>\n                  <span>${copyLabel}</span>\n                </button>\n              </div>\n              <pre><code class=\"${codeClass}\">${highlighted}</code></pre>\n            </div>\n          `;\n\n          // Store the highlighted HTML\n          highlightedBlocks.set(blockId, fullHtml);\n\n          // Change the token to an html token to bypass marked's escaping\n          token.type = \"html\";\n          token.text = fullHtml;\n        }\n      },\n    });\n  }\n\n  private renderMarkdown(content: string): string {\n    // Initialize marked if not already done\n    this.initializeMarked();\n\n    // Clear the code blocks map for new render\n    this.codeBlocksMap.clear();\n\n    // Parse markdown\n    let html = this.markedInstance!.parse(content) as string;\n\n    // Process math equations\n    html = this.processMathEquations(html);\n\n    return html;\n  }\n\n  private processMathEquations(html: string): string {\n    // First, temporarily replace code blocks with placeholders to protect them from math processing\n    const codeBlocks: string[] = [];\n    const placeholder = \"___CODE_BLOCK_PLACEHOLDER_\";\n\n    // Store code blocks and replace with placeholders\n    html = html.replace(/<pre><code[\\s\\S]*?<\\/code><\\/pre>/g, (match) => {\n      const index = codeBlocks.length;\n      codeBlocks.push(match);\n      return `${placeholder}${index}___`;\n    });\n\n    // Also protect inline code\n    const inlineCode: string[] = [];\n    const inlinePlaceholder = \"___INLINE_CODE_PLACEHOLDER_\";\n    html = html.replace(/<code>[\\s\\S]*?<\\/code>/g, (match) => {\n      const index = inlineCode.length;\n      inlineCode.push(match);\n      return `${inlinePlaceholder}${index}___`;\n    });\n\n    // Process display math $$ ... $$\n    html = html.replace(/\\$\\$([\\s\\S]*?)\\$\\$/g, (match, equation) => {\n      try {\n        return katex.renderToString(equation, {\n          displayMode: true,\n          throwOnError: false,\n        });\n      } catch {\n        return match;\n      }\n    });\n\n    // Process inline math $ ... $\n    html = html.replace(/\\$([^$]+)\\$/g, (match, equation) => {\n      try {\n        return katex.renderToString(equation, {\n          displayMode: false,\n          throwOnError: false,\n        });\n      } catch {\n        return match;\n      }\n    });\n\n    // Restore code blocks\n    codeBlocks.forEach((block, index) => {\n      html = html.replace(`${placeholder}${index}___`, block);\n    });\n\n    // Restore inline code\n    inlineCode.forEach((code, index) => {\n      html = html.replace(`${inlinePlaceholder}${index}___`, code);\n    });\n\n    return html;\n  }\n\n  private renderMathEquations(): void {\n    if (!this.markdownContainer) return;\n\n    const container = this.markdownContainer.nativeElement;\n\n    // Find all math placeholders and render them\n    const mathElements = container.querySelectorAll(\".math-placeholder\");\n    mathElements.forEach((element) => {\n      const equation = element.getAttribute(\"data-equation\");\n      const displayMode = element.getAttribute(\"data-display\") === \"true\";\n\n      if (equation) {\n        try {\n          katex.render(equation, element as HTMLElement, {\n            displayMode,\n            throwOnError: false,\n          });\n        } catch (error) {\n          console.error(\"Failed to render math equation:\", error);\n        }\n      }\n    });\n  }\n\n  handleClick(event: MouseEvent): void {\n    const target = event.target as HTMLElement;\n\n    // Check if clicked on copy button or its children\n    const copyButton = target.closest(\n      \".code-block-copy-button\"\n    ) as HTMLButtonElement;\n    if (copyButton) {\n      event.preventDefault();\n      const blockId = copyButton.getAttribute(\"data-code-block-id\");\n\n      if (blockId) {\n        // Get the raw code from our map instead of from DOM\n        const code = this.codeBlocksMap.get(blockId);\n        if (code) {\n          this.copyCodeBlock(blockId, code);\n        }\n      }\n    }\n  }\n\n  private copyCodeBlock(blockId: string, code: string): void {\n    navigator.clipboard.writeText(code).then(\n      () => {\n        // Update the button in the DOM\n        const button = this.elementRef.nativeElement.querySelector(\n          `[data-code-block-id=\"${blockId}\"]`\n        );\n        if (button) {\n          const originalHTML = button.innerHTML;\n          button.innerHTML = `\n            <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"10\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20 6 9 17l-5-5\"/></svg>\n            <span>${this.labels.assistantMessageToolbarCopyCodeCopiedLabel}</span>\n          `;\n          button.setAttribute(\n            \"aria-label\",\n            `${this.labels.assistantMessageToolbarCopyCodeCopiedLabel} code`\n          );\n\n          // Reset after 2 seconds\n          setTimeout(() => {\n            button.innerHTML = originalHTML;\n            button.setAttribute(\n              \"aria-label\",\n              `${this.labels.assistantMessageToolbarCopyCodeLabel} code`\n            );\n          }, 2000);\n        }\n      },\n      (err) => {\n        console.error(\"Failed to copy code:\", err);\n      }\n    );\n  }\n\n  private generateBlockId(code: string): string {\n    // Simple hash function for generating unique IDs\n    let hash = 0;\n    for (let i = 0; i < code.length; i++) {\n      const char = code.charCodeAt(i);\n      hash = (hash << 5) - hash + char;\n      hash = hash & hash; // Convert to 32-bit integer\n    }\n    return `code-block-${hash}`;\n  }\n\n  private escapeHtml(text: string): string {\n    const div = document.createElement(\"div\");\n    div.textContent = text;\n    return div.innerHTML;\n  }\n}\n","import {\n  Component,\n  input,\n  output,\n  signal,\n  computed,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport {\n  LucideAngularModule,\n  Copy,\n  Check,\n  ThumbsUp,\n  ThumbsDown,\n  Volume2,\n  RefreshCw,\n} from \"lucide-angular\";\nimport { CopilotTooltip } from \"../../directives/tooltip\";\nimport { cn } from \"../../utils\";\nimport { injectChatLabels } from \"../../chat-config\";\n\n// Base toolbar button component\n@Component({\n  standalone: true,\n  selector: \"button[copilotChatAssistantMessageToolbarButton]\",\n  imports: [CommonModule],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: ` <ng-content></ng-content> `,\n  host: {\n    \"[class]\": \"computedClass()\",\n    \"[attr.disabled]\": \"disabled() ? true : null\",\n    type: \"button\",\n    \"[attr.aria-label]\": \"title()\",\n  },\n  hostDirectives: [\n    {\n      directive: CopilotTooltip,\n      inputs: [\"copilotTooltip: title\", \"tooltipPosition\", \"tooltipDelay\"],\n    },\n  ],\n})\nexport class CopilotChatAssistantMessageToolbarButton {\n  title = input<string>(\"\");\n  disabled = input<boolean>(false);\n  inputClass = input<string | undefined>();\n\n  computedClass = computed(() => {\n    return cn(\n      // Flex centering with gap (from React button base styles)\n      \"inline-flex items-center justify-center gap-2\",\n      // Cursor\n      \"cursor-pointer\",\n      // Background and text\n      \"p-0 text-[rgb(93,93,93)] hover:bg-[#E8E8E8]\",\n      // Dark mode\n      \"dark:text-[rgb(243,243,243)] dark:hover:bg-[#303030]\",\n      // Shape and sizing\n      \"h-8 w-8 rounded-md\",\n      // Interactions\n      \"transition-colors\",\n      // Hover states\n      \"hover:text-[rgb(93,93,93)]\",\n      \"dark:hover:text-[rgb(243,243,243)]\",\n      // Focus states\n      \"focus:outline-none focus:ring-2 focus:ring-offset-2\",\n      // Disabled state\n      \"disabled:opacity-50 disabled:cursor-not-allowed\",\n      // SVG styling from React Button component\n      \"[&_svg]:pointer-events-none [&_svg]:shrink-0\",\n      // Ensure proper sizing\n      \"shrink-0\",\n      this.inputClass()\n    );\n  });\n}\n\n// Copy button component\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-assistant-message-copy-button\",\n  imports: [\n    CommonModule,\n    LucideAngularModule,\n    CopilotChatAssistantMessageToolbarButton,\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <button\n      copilotChatAssistantMessageToolbarButton\n      [title]=\"title() || labels.assistantMessageToolbarCopyMessageLabel\"\n      [disabled]=\"disabled()\"\n      [inputClass]=\"inputClass()\"\n      (click)=\"handleCopy($event)\"\n    >\n      @if (copied()) {\n        <lucide-angular [img]=\"CheckIcon\" [size]=\"18\"></lucide-angular>\n      } @else {\n        <lucide-angular [img]=\"CopyIcon\" [size]=\"18\"></lucide-angular>\n      }\n    </button>\n  `,\n})\nexport class CopilotChatAssistantMessageCopyButton {\n  readonly title = input<string | undefined>();\n  readonly disabled = input<boolean>(false);\n  readonly inputClass = input<string | undefined>();\n  readonly content = input<string | undefined>();\n  readonly clicked = output<void>();\n  readonly CopyIcon = Copy;\n  readonly CheckIcon = Check;\n  readonly copied = signal(false);\n  readonly labels = injectChatLabels();\n\n  handleCopy(event?: Event): void {\n    event?.stopPropagation();\n    if (!this.content()) return;\n\n    // Set copied immediately for instant feedback\n    this.copied.set(true);\n    setTimeout(() => this.copied.set(false), 2000);\n\n    // Copy to clipboard (fire and forget)\n    navigator.clipboard.writeText(this.content()!).then(\n      () => this.clicked.emit(),\n      (err) => {\n        console.error(\"Failed to copy message:\", err);\n        this.copied.set(false);\n      }\n    );\n  }\n}\n\n// Thumbs up button component\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-assistant-message-thumbs-up-button\",\n  imports: [\n    CommonModule,\n    LucideAngularModule,\n    CopilotChatAssistantMessageToolbarButton,\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <button\n      copilotChatAssistantMessageToolbarButton\n      [title]=\"title() || labels.assistantMessageToolbarThumbsUpLabel\"\n      [disabled]=\"disabled()\"\n      [inputClass]=\"inputClass()\"\n      (click)=\"handleClick($event)\"\n    >\n      <lucide-angular [img]=\"ThumbsUpIcon\" [size]=\"18\"></lucide-angular>\n    </button>\n  `,\n})\nexport class CopilotChatAssistantMessageThumbsUpButton {\n  readonly title = input<string | undefined>();\n  readonly disabled = input<boolean>(false);\n  readonly inputClass = input<string | undefined>();\n  readonly clicked = output<void>();\n  readonly ThumbsUpIcon = ThumbsUp;\n  readonly labels = injectChatLabels();\n\n  handleClick(event?: Event): void {\n    event?.stopPropagation();\n    if (!this.disabled()) {\n      this.clicked.emit();\n    }\n  }\n}\n\n// Thumbs down button component\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-assistant-message-thumbs-down-button\",\n  imports: [\n    CommonModule,\n    LucideAngularModule,\n    CopilotChatAssistantMessageToolbarButton,\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <button\n      copilotChatAssistantMessageToolbarButton\n      [title]=\"title() || labels.assistantMessageToolbarThumbsDownLabel\"\n      [disabled]=\"disabled()\"\n      [inputClass]=\"inputClass()\"\n      (click)=\"handleClick($event)\"\n    >\n      <lucide-angular [img]=\"ThumbsDownIcon\" [size]=\"18\"></lucide-angular>\n    </button>\n  `,\n})\nexport class CopilotChatAssistantMessageThumbsDownButton {\n  readonly title = input<string | undefined>();\n  readonly disabled = input<boolean>(false);\n  readonly inputClass = input<string | undefined>();\n  readonly clicked = output<void>();\n  readonly ThumbsDownIcon = ThumbsDown;\n  readonly labels = injectChatLabels();\n\n  handleClick(event?: Event): void {\n    event?.stopPropagation();\n    if (!this.disabled()) {\n      this.clicked.emit();\n    }\n  }\n}\n\n// Read aloud button component\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-assistant-message-read-aloud-button\",\n  imports: [\n    CommonModule,\n    LucideAngularModule,\n    CopilotChatAssistantMessageToolbarButton,\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <button\n      copilotChatAssistantMessageToolbarButton\n      [title]=\"title() || labels.assistantMessageToolbarReadAloudLabel\"\n      [disabled]=\"disabled()\"\n      [inputClass]=\"inputClass()\"\n      (click)=\"handleClick($event)\"\n    >\n      <lucide-angular [img]=\"Volume2Icon\" [size]=\"20\"></lucide-angular>\n    </button>\n  `,\n})\nexport class CopilotChatAssistantMessageReadAloudButton {\n  readonly title = input<string | undefined>();\n  readonly disabled = input<boolean>(false);\n  readonly inputClass = input<string | undefined>();\n  readonly clicked = output<void>();\n  readonly Volume2Icon = Volume2;\n  readonly labels = injectChatLabels();\n\n  handleClick(event?: Event): void {\n    event?.stopPropagation();\n    if (!this.disabled()) {\n      this.clicked.emit();\n    }\n  }\n}\n\n// Regenerate button component\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-assistant-message-regenerate-button\",\n  imports: [\n    CommonModule,\n    LucideAngularModule,\n    CopilotChatAssistantMessageToolbarButton,\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <button\n      copilotChatAssistantMessageToolbarButton\n      [title]=\"title() || labels.assistantMessageToolbarRegenerateLabel\"\n      [disabled]=\"disabled()\"\n      [inputClass]=\"inputClass()\"\n      (click)=\"handleClick($event)\"\n    >\n      <lucide-angular [img]=\"RefreshCwIcon\" [size]=\"18\"></lucide-angular>\n    </button>\n  `,\n})\nexport class CopilotChatAssistantMessageRegenerateButton {\n  readonly title = input<string | undefined>();\n  readonly disabled = input<boolean>(false);\n  readonly inputClass = input<string | undefined>();\n  readonly clicked = output<void>();\n  readonly RefreshCwIcon = RefreshCw;\n  readonly labels = injectChatLabels();\n\n  handleClick(event?: Event): void {\n    event?.stopPropagation();\n    if (!this.disabled()) {\n      this.clicked.emit();\n    }\n  }\n}\n","import { Directive, input, computed } from \"@angular/core\";\nimport { cn } from \"../../utils\";\n\n@Directive({\n  standalone: true,\n  selector: \"[copilotChatAssistantMessageToolbar]\",\n  host: {\n    \"[class]\": \"computedClass()\",\n  },\n})\nexport class CopilotChatAssistantMessageToolbar {\n  readonly inputClass = input<string | undefined>();\n\n  readonly computedClass = computed(() => {\n    return cn(\n      \"w-full bg-transparent flex items-center -ml-[5px] -mt-[0px]\",\n      this.inputClass()\n    );\n  });\n}\n","import { Injectable, signal } from \"@angular/core\";\n\n@Injectable({ providedIn: \"root\" })\nexport class CopilotChatViewHandlers {\n  // Assistant message handler availability\n  hasAssistantThumbsUpHandler = signal(false);\n  hasAssistantThumbsDownHandler = signal(false);\n  hasAssistantReadAloudHandler = signal(false);\n  hasAssistantRegenerateHandler = signal(false);\n\n  // User message handler availability\n  hasUserCopyHandler = signal(false);\n  hasUserEditHandler = signal(false);\n}\n","import {\n  Component,\n  TemplateRef,\n  ContentChild,\n  signal,\n  computed,\n  Type,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n  Optional,\n  Inject,\n  input,\n  output,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { CopilotSlot } from \"../../slots/copilot-slot\";\nimport { CopilotChatToolCallsView } from \"./copilot-chat-tool-calls-view\";\nimport type { Message } from \"@ag-ui/core\";\nimport {\n  type AssistantMessage,\n  type CopilotChatAssistantMessageOnThumbsUpProps,\n  type CopilotChatAssistantMessageOnThumbsDownProps,\n  type CopilotChatAssistantMessageOnReadAloudProps,\n  type CopilotChatAssistantMessageOnRegenerateProps,\n  type AssistantMessageMarkdownRendererContext,\n  type AssistantMessageCopyButtonContext,\n  type ThumbsUpButtonContext,\n  type ThumbsDownButtonContext,\n  type ReadAloudButtonContext,\n  type RegenerateButtonContext,\n  type AssistantMessageToolbarContext,\n} from \"./copilot-chat-assistant-message.types\";\nimport { CopilotChatAssistantMessageRenderer } from \"./copilot-chat-assistant-message-renderer\";\nimport {\n  CopilotChatAssistantMessageCopyButton,\n  CopilotChatAssistantMessageThumbsUpButton,\n  CopilotChatAssistantMessageThumbsDownButton,\n} from \"./copilot-chat-assistant-message-buttons\";\nimport { CopilotChatAssistantMessageToolbar } from \"./copilot-chat-assistant-message-toolbar\";\nimport { cn } from \"../../utils\";\nimport { CopilotChatViewHandlers } from \"./copilot-chat-view-handlers\";\n\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-assistant-message\",\n  imports: [\n    CommonModule,\n    CopilotSlot,\n    CopilotChatAssistantMessageRenderer,\n    CopilotChatAssistantMessageCopyButton,\n    CopilotChatAssistantMessageToolbar,\n    CopilotChatToolCallsView,\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <div [class]=\"computedClass()\" [attr.data-message-id]=\"message().id\">\n      <!-- Markdown Renderer -->\n      @if (markdownRendererTemplate || markdownRendererComponent()) {\n        <copilot-slot\n          [slot]=\"markdownRendererTemplate || markdownRendererComponent()\"\n          [context]=\"markdownRendererContext()\"\n          [defaultComponent]=\"CopilotChatAssistantMessageRenderer\"\n        >\n        </copilot-slot>\n      } @else {\n        <copilot-chat-assistant-message-renderer\n          [content]=\"message().content || ''\"\n          [inputClass]=\"markdownRendererClass()\"\n        >\n        </copilot-chat-assistant-message-renderer>\n      }\n\n      <!-- Tool Calls View -->\n      @if (toolCallsViewTemplate || toolCallsViewComponent()) {\n        <copilot-slot\n          [slot]=\"toolCallsViewTemplate || toolCallsViewComponent()\"\n          [context]=\"toolCallsViewContext()\"\n          [defaultComponent]=\"CopilotChatToolCallsView\"\n        >\n        </copilot-slot>\n      } @else if (message().toolCalls && message()!.toolCalls!.length > 0) {\n        <copilot-chat-tool-calls-view\n          [message]=\"message()!\"\n          [messages]=\"messages()\"\n          [isLoading]=\"isLoading()\"\n        >\n        </copilot-chat-tool-calls-view>\n      }\n\n      <!-- Toolbar: show only when there is assistant text content -->\n      @if (toolbarVisible() && hasMessageContent()) {\n        @if (toolbarTemplate || toolbarComponent()) {\n          <copilot-slot\n            [slot]=\"toolbarTemplate || toolbarComponent()\"\n            [context]=\"toolbarContext()\"\n            [defaultComponent]=\"CopilotChatAssistantMessageToolbar\"\n          >\n          </copilot-slot>\n        } @else {\n          <div copilotChatAssistantMessageToolbar [inputClass]=\"toolbarClass()\">\n            <div class=\"flex items-center gap-1\">\n              <!-- Copy button -->\n              @if (copyButtonTemplate || copyButtonComponent()) {\n                <copilot-slot\n                  [slot]=\"copyButtonTemplate || copyButtonComponent()\"\n                  [context]=\"{ content: message().content || '' }\"\n                  [defaultComponent]=\"CopilotChatAssistantMessageCopyButton\"\n                  [outputs]=\"copyButtonOutputs\"\n                >\n                </copilot-slot>\n              } @else {\n                <copilot-chat-assistant-message-copy-button\n                  [content]=\"message().content\"\n                  [inputClass]=\"copyButtonClass()\"\n                  (clicked)=\"handleCopy()\"\n                >\n                </copilot-chat-assistant-message-copy-button>\n              }\n\n              <!-- Thumbs up button - show if custom slot provided OR if handler available at top level -->\n              @if (\n                thumbsUpButtonComponent() ||\n                thumbsUpButtonTemplate ||\n                handlers.hasAssistantThumbsUpHandler()\n              ) {\n                <copilot-slot\n                  [slot]=\"thumbsUpButtonTemplate || thumbsUpButtonComponent()\"\n                  [context]=\"{}\"\n                  [defaultComponent]=\"defaultThumbsUpButtonComponent\"\n                  [outputs]=\"thumbsUpButtonOutputs\"\n                >\n                </copilot-slot>\n              }\n\n              <!-- Thumbs down button - show if custom slot provided OR if handler available at top level -->\n              @if (\n                thumbsDownButtonComponent() ||\n                thumbsDownButtonTemplate ||\n                handlers.hasAssistantThumbsDownHandler()\n              ) {\n                <copilot-slot\n                  [slot]=\"\n                    thumbsDownButtonTemplate || thumbsDownButtonComponent()\n                  \"\n                  [context]=\"{}\"\n                  [defaultComponent]=\"defaultThumbsDownButtonComponent\"\n                  [outputs]=\"thumbsDownButtonOutputs\"\n                >\n                </copilot-slot>\n              }\n\n              <!-- Read aloud button - only show if custom slot provided -->\n              @if (readAloudButtonComponent() || readAloudButtonTemplate) {\n                <copilot-slot\n                  [slot]=\"readAloudButtonTemplate || readAloudButtonComponent()\"\n                  [context]=\"{}\"\n                  [outputs]=\"readAloudButtonOutputs\"\n                >\n                </copilot-slot>\n              }\n\n              <!-- Regenerate button - only show if custom slot provided -->\n              @if (regenerateButtonComponent() || regenerateButtonTemplate) {\n                <copilot-slot\n                  [slot]=\"\n                    regenerateButtonTemplate || regenerateButtonComponent()\n                  \"\n                  [context]=\"{}\"\n                  [outputs]=\"regenerateButtonOutputs\"\n                >\n                </copilot-slot>\n              }\n\n              <!-- Additional toolbar items -->\n              @if (additionalToolbarItems()) {\n                <ng-container\n                  [ngTemplateOutlet]=\"additionalToolbarItems() || null\"\n                ></ng-container>\n              }\n            </div>\n          </div>\n        }\n      }\n    </div>\n  `,\n  styles: [\n    `\n      /* Import KaTeX styles */\n      @import \"katex/dist/katex.min.css\";\n\n      :host {\n        display: block;\n        width: 100%;\n      }\n\n      /* Atom One Light theme for highlight.js */\n      .hljs {\n        color: rgb(56, 58, 66);\n        background: transparent;\n      }\n\n      .hljs-comment,\n      .hljs-quote {\n        color: #a0a1a7;\n        font-style: italic;\n      }\n\n      .hljs-doctag,\n      .hljs-formula,\n      .hljs-keyword {\n        color: #a626a4;\n      }\n\n      .hljs-deletion,\n      .hljs-name,\n      .hljs-section,\n      .hljs-selector-tag,\n      .hljs-subst {\n        color: #e45649;\n      }\n\n      .hljs-literal {\n        color: #0184bb;\n      }\n\n      .hljs-addition,\n      .hljs-attribute,\n      .hljs-meta .hljs-string,\n      .hljs-regexp,\n      .hljs-string {\n        color: #50a14f;\n      }\n\n      .hljs-attr,\n      .hljs-number,\n      .hljs-selector-attr,\n      .hljs-selector-class,\n      .hljs-selector-pseudo,\n      .hljs-template-variable,\n      .hljs-type,\n      .hljs-variable {\n        color: #986801;\n      }\n\n      .hljs-params {\n        color: rgb(56, 58, 66);\n      }\n\n      .hljs-bullet,\n      .hljs-link,\n      .hljs-meta,\n      .hljs-selector-id,\n      .hljs-symbol,\n      .hljs-title {\n        color: #4078f2;\n      }\n\n      .hljs-built_in,\n      .hljs-class .hljs-title,\n      .hljs-title.class_ {\n        color: #c18401;\n      }\n\n      .hljs-emphasis {\n        font-style: italic;\n      }\n\n      .hljs-strong {\n        font-weight: 700;\n      }\n\n      .hljs-link {\n        text-decoration: underline;\n      }\n\n      /* Atom One Dark theme for highlight.js */\n      .dark .hljs {\n        color: #abb2bf;\n        background: transparent;\n      }\n\n      .dark .hljs-comment,\n      .dark .hljs-quote {\n        color: #5c6370;\n        font-style: italic;\n      }\n\n      .dark .hljs-doctag,\n      .dark .hljs-formula,\n      .dark .hljs-keyword {\n        color: #c678dd;\n      }\n\n      .dark .hljs-deletion,\n      .dark .hljs-name,\n      .dark .hljs-section,\n      .dark .hljs-selector-tag,\n      .dark .hljs-subst {\n        color: #e06c75;\n      }\n\n      .dark .hljs-literal {\n        color: #56b6c2;\n      }\n\n      .dark .hljs-addition,\n      .dark .hljs-attribute,\n      .dark .hljs-meta .hljs-string,\n      .dark .hljs-regexp,\n      .dark .hljs-string {\n        color: #98c379;\n      }\n\n      .dark .hljs-attr,\n      .dark .hljs-number,\n      .dark .hljs-selector-attr,\n      .dark .hljs-selector-class,\n      .dark .hljs-selector-pseudo,\n      .dark .hljs-template-variable,\n      .dark .hljs-type,\n      .dark .hljs-variable {\n        color: #d19a66;\n      }\n\n      .dark .hljs-bullet,\n      .dark .hljs-link,\n      .dark .hljs-meta,\n      .dark .hljs-selector-id,\n      .dark .hljs-symbol,\n      .dark .hljs-title {\n        color: #61aeee;\n      }\n\n      .dark .hljs-built_in,\n      .dark .hljs-class .hljs-title,\n      .dark .hljs-title.class_ {\n        color: #e6c07b;\n      }\n\n      .dark .hljs-params {\n        color: #abb2bf; /* same as regular text */\n      }\n\n      .dark .hljs-emphasis {\n        font-style: italic;\n      }\n\n      .dark .hljs-strong {\n        font-weight: 700;\n      }\n\n      .dark .hljs-link {\n        text-decoration: underline;\n      }\n    `,\n  ],\n})\nexport class CopilotChatAssistantMessage {\n  // Capture templates from content projection\n  @ContentChild(\"markdownRenderer\", { read: TemplateRef })\n  markdownRendererTemplate?: TemplateRef<AssistantMessageMarkdownRendererContext>;\n  @ContentChild(\"toolbar\", { read: TemplateRef })\n  toolbarTemplate?: TemplateRef<AssistantMessageToolbarContext>;\n  @ContentChild(\"copyButton\", { read: TemplateRef })\n  copyButtonTemplate?: TemplateRef<AssistantMessageCopyButtonContext>;\n  @ContentChild(\"thumbsUpButton\", { read: TemplateRef })\n  thumbsUpButtonTemplate?: TemplateRef<ThumbsUpButtonContext>;\n  @ContentChild(\"thumbsDownButton\", { read: TemplateRef })\n  thumbsDownButtonTemplate?: TemplateRef<ThumbsDownButtonContext>;\n  @ContentChild(\"readAloudButton\", { read: TemplateRef })\n  readAloudButtonTemplate?: TemplateRef<ReadAloudButtonContext>;\n  @ContentChild(\"regenerateButton\", { read: TemplateRef })\n  regenerateButtonTemplate?: TemplateRef<RegenerateButtonContext>;\n  @ContentChild(\"toolCallsView\", { read: TemplateRef })\n  toolCallsViewTemplate?: TemplateRef<any>;\n\n  // Class inputs for styling default components\n  readonly markdownRendererClass = input<string | undefined>(undefined);\n  readonly toolbarClass = input<string | undefined>(undefined);\n  readonly copyButtonClass = input<string | undefined>(undefined);\n  readonly thumbsUpButtonClass = input<string | undefined>(undefined);\n  readonly thumbsDownButtonClass = input<string | undefined>(undefined);\n  readonly readAloudButtonClass = input<string | undefined>(undefined);\n  readonly regenerateButtonClass = input<string | undefined>(undefined);\n  readonly toolCallsViewClass = input<string | undefined>(undefined);\n\n  // Component inputs for overrides\n  readonly markdownRendererComponent = input<Type<any> | undefined>(undefined);\n  readonly toolbarComponent = input<Type<any> | undefined>(undefined);\n  readonly copyButtonComponent = input<Type<any> | undefined>(undefined);\n  readonly thumbsUpButtonComponent = input<Type<any> | undefined>(undefined);\n  readonly thumbsDownButtonComponent = input<Type<any> | undefined>(undefined);\n  readonly readAloudButtonComponent = input<Type<any> | undefined>(undefined);\n  readonly regenerateButtonComponent = input<Type<any> | undefined>(undefined);\n  readonly toolCallsViewComponent = input<Type<any> | undefined>(undefined);\n\n  // Regular inputs\n  readonly message = input.required<AssistantMessage>();\n  readonly messages = input<Message[]>([]);\n  readonly isLoading = input<boolean>(false);\n  readonly additionalToolbarItems = input<TemplateRef<any> | undefined>(\n    undefined\n  );\n  readonly toolbarVisible = input<boolean>(true);\n  readonly inputClass = input<string | undefined>(undefined);\n\n  // DI service exposes handler availability scoped to CopilotChatView\n  // Make it optional with a default fallback for testing\n  handlers: CopilotChatViewHandlers;\n\n  constructor(\n    @Optional()\n    @Inject(CopilotChatViewHandlers)\n    handlers?: CopilotChatViewHandlers | null\n  ) {\n    this.handlers = handlers || new CopilotChatViewHandlers();\n  }\n\n  // Output events\n  thumbsUp = output<CopilotChatAssistantMessageOnThumbsUpProps>();\n  thumbsDown = output<CopilotChatAssistantMessageOnThumbsDownProps>();\n  readAloud = output<CopilotChatAssistantMessageOnReadAloudProps>();\n  regenerate = output<CopilotChatAssistantMessageOnRegenerateProps>();\n\n  // Signals\n  customClass = signal<string | undefined>(undefined);\n\n  // Computed values\n  computedClass = computed(() => {\n    return cn(\n      \"prose max-w-full break-words dark:prose-invert\",\n      this.customClass()\n    );\n  });\n\n  // Default components\n  protected readonly defaultThumbsUpButtonComponent =\n    CopilotChatAssistantMessageThumbsUpButton;\n  protected readonly defaultThumbsDownButtonComponent =\n    CopilotChatAssistantMessageThumbsDownButton;\n  protected readonly CopilotChatAssistantMessageRenderer =\n    CopilotChatAssistantMessageRenderer;\n  protected readonly CopilotChatAssistantMessageToolbar =\n    CopilotChatAssistantMessageToolbar;\n  protected readonly CopilotChatAssistantMessageCopyButton =\n    CopilotChatAssistantMessageCopyButton;\n  protected readonly CopilotChatToolCallsView = CopilotChatToolCallsView;\n\n  // Context for slots (reactive via signals)\n  markdownRendererContext = computed<AssistantMessageMarkdownRendererContext>(\n    () => ({\n      content: this.message()?.content || \"\",\n    })\n  );\n\n  // Output maps for slots\n  copyButtonOutputs = { clicked: () => this.handleCopy() };\n  thumbsUpButtonOutputs = { clicked: () => this.handleThumbsUp() };\n  thumbsDownButtonOutputs = { clicked: () => this.handleThumbsDown() };\n  readAloudButtonOutputs = { clicked: () => this.handleReadAloud() };\n  regenerateButtonOutputs = { clicked: () => this.handleRegenerate() };\n\n  toolbarContext = computed<AssistantMessageToolbarContext>(() => ({\n    children: null, // Will be populated by the toolbar content\n  }));\n\n  // Return true if assistant message has non-empty text content\n  hasMessageContent(): boolean {\n    const raw = (this.message()?.content ?? \"\") as any;\n    const content = typeof raw === \"string\" ? raw : String(raw ?? \"\");\n    return content.trim().length > 0;\n  }\n\n  toolCallsViewContext = computed(() => ({\n    message: this.message(),\n    messages: this.messages(),\n    isLoading: this.isLoading(),\n  }));\n\n  handleCopy(): void {\n    // Copy is handled by the button component itself\n    // This is just for any additional logic if needed\n  }\n\n  handleThumbsUp(): void {\n    this.thumbsUp.emit({ message: this.message() });\n  }\n\n  handleThumbsDown(): void {\n    this.thumbsDown.emit({ message: this.message() });\n  }\n\n  handleReadAloud(): void {\n    this.readAloud.emit({ message: this.message() });\n  }\n\n  handleRegenerate(): void {\n    this.regenerate.emit({ message: this.message() });\n  }\n}\n","import {\n  Component,\n  input,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n  computed,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { cn } from \"../../utils\";\n\n@Component({\n  selector: \"copilot-chat-user-message-renderer\",\n  standalone: true,\n  imports: [CommonModule],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  host: {\n    \"[class]\": \"computedClass()\",\n  },\n  template: `{{ content() }}`,\n})\nexport class CopilotChatUserMessageRenderer {\n  readonly content = input<string>(\"\");\n  readonly inputClass = input<string | undefined>();\n\n  readonly computedClass = computed(() => {\n    return cn(\n      \"prose dark:prose-invert bg-muted relative max-w-[80%] rounded-[18px] px-4 py-1.5 data-[multiline]:py-3 inline-block whitespace-pre-wrap\",\n      this.inputClass()\n    );\n  });\n}\n","import {\n  Component,\n  input,\n  output,\n  signal,\n  computed,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { LucideAngularModule, Copy, Check, Edit } from \"lucide-angular\";\nimport { CopilotTooltip } from \"../../directives/tooltip\";\nimport { cn } from \"../../utils\";\nimport { injectChatLabels } from \"../../chat-config\";\n\n// Base toolbar button component\n@Component({\n  selector: \"button[copilotChatUserMessageToolbarButton]\",\n  standalone: true,\n  imports: [CommonModule],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: ` <ng-content></ng-content> `,\n  host: {\n    \"[class]\": \"computedClass()\",\n    \"[attr.disabled]\": \"disabled() ? true : null\",\n    type: \"button\",\n    \"[attr.aria-label]\": \"title()\",\n  },\n  hostDirectives: [\n    {\n      directive: CopilotTooltip,\n      inputs: [\"copilotTooltip: title\", \"tooltipPosition\", \"tooltipDelay\"],\n    },\n  ],\n})\nexport class CopilotChatUserMessageToolbarButton {\n  title = input<string>(\"\");\n  disabled = input<boolean>(false);\n  inputClass = input<string | undefined>();\n\n  computedClass = computed(() => {\n    return cn(\n      // Flex centering\n      \"inline-flex items-center justify-center\",\n      // Cursor\n      \"cursor-pointer\",\n      // Background and text\n      \"p-0 text-[rgb(93,93,93)] hover:bg-[#E8E8E8]\",\n      // Dark mode\n      \"dark:text-[rgb(243,243,243)] dark:hover:bg-[#303030]\",\n      // Shape and sizing\n      \"h-8 w-8 rounded-md\",\n      // Interactions\n      \"transition-colors\",\n      // Hover states\n      \"hover:text-[rgb(93,93,93)]\",\n      \"dark:hover:text-[rgb(243,243,243)]\",\n      // Focus states\n      \"focus:outline-none focus:ring-2 focus:ring-offset-2\",\n      // Disabled state\n      \"disabled:opacity-50 disabled:cursor-not-allowed\",\n      this.inputClass()\n    );\n  });\n}\n\n// Copy button component\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-user-message-copy-button\",\n  imports: [\n    CommonModule,\n    LucideAngularModule,\n    CopilotChatUserMessageToolbarButton,\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <button\n      copilotChatUserMessageToolbarButton\n      [title]=\"title() || labels.userMessageToolbarCopyMessageLabel\"\n      [disabled]=\"disabled()\"\n      [inputClass]=\"inputClass()\"\n      (click)=\"handleCopy()\"\n    >\n      @if (copied()) {\n        <lucide-angular [img]=\"CheckIcon\" [size]=\"18\"></lucide-angular>\n      } @else {\n        <lucide-angular [img]=\"CopyIcon\" [size]=\"18\"></lucide-angular>\n      }\n    </button>\n  `,\n})\nexport class CopilotChatUserMessageCopyButton {\n  readonly title = input<string | undefined>();\n  readonly disabled = input<boolean>(false);\n  readonly inputClass = input<string | undefined>();\n  readonly content = input<string | undefined>();\n  readonly clicked = output<void>();\n  readonly CopyIcon = Copy;\n  readonly CheckIcon = Check;\n  readonly copied = signal(false);\n  readonly labels = injectChatLabels();\n\n  handleCopy(): void {\n    if (!this.content()) return;\n\n    // Set copied immediately for instant feedback\n    this.copied.set(true);\n    setTimeout(() => this.copied.set(false), 2000);\n\n    // Copy to clipboard (fire and forget)\n    navigator.clipboard.writeText(this.content()!).then(\n      () => this.clicked.emit(),\n      (err) => {\n        console.error(\"Failed to copy message:\", err);\n        this.copied.set(false);\n      }\n    );\n  }\n}\n\n// Edit button component\n@Component({\n  selector: \"copilot-chat-user-message-edit-button\",\n  standalone: true,\n  imports: [\n    CommonModule,\n    LucideAngularModule,\n    CopilotChatUserMessageToolbarButton,\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <button\n      copilotChatUserMessageToolbarButton\n      [title]=\"title() || labels.userMessageToolbarEditMessageLabel\"\n      [disabled]=\"disabled()\"\n      [inputClass]=\"inputClass()\"\n      (click)=\"handleEdit()\"\n    >\n      <lucide-angular [img]=\"EditIcon\" [size]=\"18\"></lucide-angular>\n    </button>\n  `,\n})\nexport class CopilotChatUserMessageEditButton {\n  title = input<string | undefined>();\n  disabled = input<boolean>(false);\n  inputClass = input<string | undefined>();\n  clicked = output<void>();\n\n  readonly EditIcon = Edit;\n  readonly labels = injectChatLabels();\n\n  handleEdit(): void {\n    if (!this.disabled()) {\n      this.clicked.emit();\n    }\n  }\n}\n","import {\n  Component,\n  input,\n  computed,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { cn } from \"../../utils\";\n\n@Component({\n  selector: \"div[copilotChatUserMessageToolbar]\",\n  standalone: true,\n  imports: [CommonModule],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: ` <ng-content></ng-content> `,\n  host: {\n    \"[class]\": \"computedClass()\",\n  },\n})\nexport class CopilotChatUserMessageToolbar {\n  readonly inputClass = input<string | undefined>();\n\n  readonly computedClass = computed(() =>\n    cn(\n      \"w-full bg-transparent flex items-center justify-end mt-[4px] invisible group-hover:visible\",\n      this.inputClass()\n    )\n  );\n}\n","import { Component, input, output, ChangeDetectionStrategy, ViewEncapsulation, computed } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { LucideAngularModule, ChevronLeft, ChevronRight } from \"lucide-angular\";\nimport { type CopilotChatUserMessageOnSwitchToBranchProps } from \"./copilot-chat-user-message.types\";\nimport { cn } from \"../../utils\";\nimport { UserMessage } from \"@ag-ui/core\";\n\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-user-message-branch-navigation\",\n  imports: [CommonModule, LucideAngularModule],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    @if (showNavigation()) {\n      <div [class]=\"computedClass()\">\n        <button type=\"button\" [class]=\"buttonClass\" [disabled]=\"!canGoPrev()\" (click)=\"handlePrevious()\">\n          <lucide-angular [img]=\"ChevronLeftIcon\" [size]=\"20\"></lucide-angular>\n        </button>\n        <span class=\"text-sm text-muted-foreground px-0 font-medium\">\n          {{ currentBranch() + 1 }}/{{ numberOfBranches() }}\n        </span>\n        <button type=\"button\" [class]=\"buttonClass\" [disabled]=\"!canGoNext()\" (click)=\"handleNext()\">\n          <lucide-angular [img]=\"ChevronRightIcon\" [size]=\"20\"></lucide-angular>\n        </button>\n      </div>\n    }\n  `,\n})\nexport class CopilotChatUserMessageBranchNavigation {\n  currentBranch = input<number>(0);\n  numberOfBranches = input<number>(1);\n  message = input<UserMessage>();\n  inputClass = input<string | undefined>();\n  switchToBranch = output<CopilotChatUserMessageOnSwitchToBranchProps>();\n\n  readonly ChevronLeftIcon = ChevronLeft;\n  readonly ChevronRightIcon = ChevronRight;\n\n  readonly buttonClass = cn(\n    // Flex centering\n    \"inline-flex items-center justify-center\",\n    // Cursor\n    \"cursor-pointer\",\n    // Background and text\n    \"p-0 text-[rgb(93,93,93)] hover:bg-[#E8E8E8]\",\n    // Dark mode\n    \"dark:text-[rgb(243,243,243)] dark:hover:bg-[#303030]\",\n    // Shape and sizing\n    \"h-6 w-6 rounded-md\",\n    // Interactions\n    \"transition-colors\",\n    // Disabled state\n    \"disabled:opacity-50 disabled:cursor-not-allowed\",\n  );\n\n  showNavigation = computed(() => this.numberOfBranches() > 1);\n\n  canGoPrev = computed(() => this.currentBranch() > 0);\n\n  canGoNext = computed(() => this.currentBranch() < this.numberOfBranches() - 1);\n\n  computedClass = computed(() => {\n    return cn(\"flex items-center gap-1\", this.inputClass());\n  });\n\n  handlePrevious(): void {\n    if (this.canGoPrev()) {\n      const newIndex = this.currentBranch() - 1;\n      this.switchToBranch.emit({\n        branchIndex: newIndex,\n        numberOfBranches: this.numberOfBranches(),\n        message: this.message()!,\n      });\n    }\n  }\n\n  handleNext(): void {\n    if (this.canGoNext()) {\n      const newIndex = this.currentBranch() + 1;\n      this.switchToBranch.emit({\n        branchIndex: newIndex,\n        numberOfBranches: this.numberOfBranches(),\n        message: this.message()!,\n      });\n    }\n  }\n}\n","import {\n  Component,\n  input,\n  output,\n  TemplateRef,\n  ContentChild,\n  computed,\n  Type,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { CopilotSlot } from \"../../slots/copilot-slot\";\nimport {\n  type CopilotChatUserMessageOnEditMessageProps,\n  type CopilotChatUserMessageOnSwitchToBranchProps,\n  type MessageRendererContext,\n  type CopyButtonContext,\n  type EditButtonContext,\n  type BranchNavigationContext,\n  type UserMessageToolbarContext,\n} from \"./copilot-chat-user-message.types\";\nimport { CopilotChatUserMessageRenderer } from \"./copilot-chat-user-message-renderer\";\nimport {\n  CopilotChatUserMessageCopyButton,\n  CopilotChatUserMessageEditButton,\n} from \"./copilot-chat-user-message-buttons\";\nimport { CopilotChatUserMessageToolbar } from \"./copilot-chat-user-message-toolbar\";\nimport { CopilotChatUserMessageBranchNavigation } from \"./copilot-chat-user-message-branch-navigation\";\nimport { cn } from \"../../utils\";\nimport { UserMessage } from \"@ag-ui/core\";\n\nfunction flattenUserMessageContent(content?: UserMessage[\"content\"]): string {\n  if (!content) {\n    return \"\";\n  }\n\n  if (typeof content === \"string\") {\n    return content;\n  }\n\n  return content\n    .map((part) => {\n      if (\n        part &&\n        typeof part === \"object\" &&\n        \"type\" in part &&\n        (part as { type?: unknown }).type === \"text\" &&\n        typeof (part as { text?: unknown }).text === \"string\"\n      ) {\n        return (part as { text: string }).text;\n      }\n      return \"\";\n    })\n    .filter((text) => text.length > 0)\n    .join(\"\\n\");\n}\n\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-user-message\",\n  imports: [\n    CommonModule,\n    CopilotSlot,\n    CopilotChatUserMessageRenderer,\n    CopilotChatUserMessageCopyButton,\n    CopilotChatUserMessageEditButton,\n    CopilotChatUserMessageToolbar,\n    CopilotChatUserMessageBranchNavigation,\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <div [class]=\"computedClass()\" [attr.data-message-id]=\"message()?.id\">\n      <!-- Message Renderer -->\n      @if (messageRendererTemplate || messageRendererComponent()) {\n        <copilot-slot\n          [slot]=\"messageRendererTemplate || messageRendererComponent()\"\n          [context]=\"messageRendererContext()\"\n          [defaultComponent]=\"CopilotChatUserMessageRenderer\"\n        >\n        </copilot-slot>\n      } @else {\n        <copilot-chat-user-message-renderer [content]=\"flattenedContent()\" [inputClass]=\"messageRendererClass()\">\n        </copilot-chat-user-message-renderer>\n      }\n\n      <!-- Toolbar -->\n      @if (toolbarTemplate || toolbarComponent()) {\n        <copilot-slot\n          [slot]=\"toolbarTemplate || toolbarComponent()\"\n          [context]=\"toolbarContext()\"\n          [defaultComponent]=\"CopilotChatUserMessageToolbar\"\n        >\n        </copilot-slot>\n      } @else {\n        <div copilotChatUserMessageToolbar [inputClass]=\"toolbarClass()\">\n          <div class=\"flex items-center gap-1 justify-end\">\n            <!-- Additional toolbar items -->\n            @if (additionalToolbarItems()) {\n              <ng-container [ngTemplateOutlet]=\"additionalToolbarItems() || null\"></ng-container>\n            }\n\n            <!-- Copy button -->\n            @if (copyButtonTemplate || copyButtonComponent()) {\n              <copilot-slot\n                [slot]=\"copyButtonTemplate || copyButtonComponent()\"\n                [context]=\"{ content: flattenedContent() }\"\n                [outputs]=\"copyButtonOutputs\"\n                [defaultComponent]=\"CopilotChatUserMessageCopyButton\"\n              >\n              </copilot-slot>\n            } @else {\n              <copilot-chat-user-message-copy-button\n                [content]=\"flattenedContent()\"\n                [inputClass]=\"copyButtonClass()\"\n                (clicked)=\"handleCopy()\"\n              >\n              </copilot-chat-user-message-copy-button>\n            }\n\n            <!-- Edit button -->\n            @if (true) {\n              @if (editButtonTemplate || editButtonComponent()) {\n                <copilot-slot\n                  [slot]=\"editButtonTemplate || editButtonComponent()\"\n                  [context]=\"{}\"\n                  [outputs]=\"editButtonOutputs\"\n                  [defaultComponent]=\"CopilotChatUserMessageEditButton\"\n                >\n                </copilot-slot>\n              } @else {\n                <copilot-chat-user-message-edit-button [inputClass]=\"editButtonClass()\" (clicked)=\"handleEdit()\">\n                </copilot-chat-user-message-edit-button>\n              }\n            }\n\n            <!-- Branch navigation -->\n            @if (showBranchNavigation()) {\n              @if (branchNavigationTemplate || branchNavigationComponent()) {\n                <copilot-slot\n                  [slot]=\"branchNavigationTemplate || branchNavigationComponent()\"\n                  [context]=\"branchNavigationContext()\"\n                  [defaultComponent]=\"CopilotChatUserMessageBranchNavigation\"\n                >\n                </copilot-slot>\n              } @else {\n                <copilot-chat-user-message-branch-navigation\n                  [currentBranch]=\"branchIndexValue()\"\n                  [numberOfBranches]=\"numberOfBranchesValue()\"\n                  [message]=\"message()!\"\n                  [inputClass]=\"branchNavigationClass()\"\n                  (switchToBranch)=\"handleSwitchToBranch($event)\"\n                >\n                </copilot-chat-user-message-branch-navigation>\n              }\n            }\n          </div>\n        </div>\n      }\n    </div>\n  `,\n  styles: [\n    `\n      :host {\n        display: block;\n        width: 100%;\n      }\n    `,\n  ],\n})\nexport class CopilotChatUserMessage {\n  // Capture templates from content projection\n  @ContentChild(\"messageRenderer\", { read: TemplateRef })\n  messageRendererTemplate?: TemplateRef<MessageRendererContext>;\n  @ContentChild(\"toolbar\", { read: TemplateRef })\n  toolbarTemplate?: TemplateRef<UserMessageToolbarContext>;\n  @ContentChild(\"copyButton\", { read: TemplateRef })\n  copyButtonTemplate?: TemplateRef<CopyButtonContext>;\n  @ContentChild(\"editButton\", { read: TemplateRef })\n  editButtonTemplate?: TemplateRef<EditButtonContext>;\n  @ContentChild(\"branchNavigation\", { read: TemplateRef })\n  branchNavigationTemplate?: TemplateRef<BranchNavigationContext>;\n\n  // Props for tweaking default components\n  messageRendererClass = input<string | undefined>();\n  toolbarClass = input<string | undefined>();\n  copyButtonClass = input<string | undefined>();\n  editButtonClass = input<string | undefined>();\n  branchNavigationClass = input<string | undefined>();\n\n  // Component inputs for overrides\n  messageRendererComponent = input<Type<any> | undefined>();\n  toolbarComponent = input<Type<any> | undefined>();\n  copyButtonComponent = input<Type<any> | undefined>();\n  editButtonComponent = input<Type<any> | undefined>();\n  branchNavigationComponent = input<Type<any> | undefined>();\n\n  // Regular inputs\n  message = input<UserMessage>();\n  branchIndex = input<number | undefined>();\n  numberOfBranches = input<number | undefined>();\n  additionalToolbarItems = input<TemplateRef<any> | undefined>();\n  inputClass = input<string | undefined>();\n\n  // Output events\n  editMessage = output<CopilotChatUserMessageOnEditMessageProps>();\n  switchToBranch = output<CopilotChatUserMessageOnSwitchToBranchProps>();\n\n  // Derived values\n  branchIndexValue = computed(() => this.branchIndex() ?? 0);\n  numberOfBranchesValue = computed(() => this.numberOfBranches() ?? 1);\n\n  // Default components\n  CopilotChatUserMessageRenderer = CopilotChatUserMessageRenderer;\n  CopilotChatUserMessageToolbar = CopilotChatUserMessageToolbar;\n  CopilotChatUserMessageCopyButton = CopilotChatUserMessageCopyButton;\n  CopilotChatUserMessageEditButton = CopilotChatUserMessageEditButton;\n  CopilotChatUserMessageBranchNavigation = CopilotChatUserMessageBranchNavigation;\n\n  // Computed values\n  showBranchNavigation = computed(() => (this.numberOfBranches() ?? 1) > 1);\n\n  computedClass = computed(() => cn(\"flex flex-col items-end group pt-10\", this.inputClass()));\n\n  // Context for slots (reactive via signals)\n  flattenedContent = computed(() => flattenUserMessageContent(this.message()?.content));\n\n  messageRendererContext = computed<MessageRendererContext>(() => ({\n    content: this.flattenedContent(),\n  }));\n\n  // Output maps for slots\n  copyButtonOutputs = { clicked: () => this.handleCopy() };\n  editButtonOutputs = { clicked: () => this.handleEdit() };\n\n  branchNavigationContext = computed<BranchNavigationContext>(() => ({\n    currentBranch: this.branchIndexValue(),\n    numberOfBranches: this.numberOfBranchesValue(),\n    onSwitchToBranch: (props) => this.handleSwitchToBranch(props),\n    message: this.message()!,\n  }));\n\n  toolbarContext = computed<UserMessageToolbarContext>(() => ({\n    children: null, // Will be populated by the toolbar content\n  }));\n\n  handleCopy(): void {\n    // Copy is handled by the button component itself\n    // This is just for any additional logic if needed\n  }\n\n  handleEdit(): void {\n    this.editMessage.emit({ message: this.message()! });\n  }\n\n  handleSwitchToBranch(props: CopilotChatUserMessageOnSwitchToBranchProps): void {\n    this.switchToBranch.emit(props);\n  }\n  constructor() {}\n}\n","import {\n  Component,\n  input,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n  computed,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { cn } from \"../../utils\";\n\n/**\n * Cursor component that matches the React implementation exactly.\n * Shows a pulsing dot animation to indicate activity.\n */\n@Component({\n  selector: \"copilot-chat-message-view-cursor\",\n  standalone: true,\n  imports: [CommonModule],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: ` <div [class]=\"computedClass()\"></div> `,\n})\nexport class CopilotChatMessageViewCursor {\n  inputClass = input<string | undefined>();\n\n  // Computed class that matches React exactly: w-[11px] h-[11px] rounded-full bg-foreground animate-pulse-cursor ml-1\n  computedClass = computed(() =>\n    cn(\n      \"w-[11px] h-[11px] rounded-full bg-foreground animate-pulse-cursor ml-1\",\n      this.inputClass()\n    )\n  );\n}\n","import {\n  Component,\n  input,\n  output,\n  ContentChild,\n  TemplateRef,\n  Type,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n  computed,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { CopilotSlot } from \"../../slots/copilot-slot\";\nimport type { Message } from \"@ag-ui/core\";\nimport { CopilotChatAssistantMessage } from \"./copilot-chat-assistant-message\";\nimport { CopilotChatUserMessage } from \"./copilot-chat-user-message\";\nimport { CopilotChatMessageViewCursor } from \"./copilot-chat-message-view-cursor\";\nimport { cn } from \"../../utils\";\n\n/**\n * CopilotChatMessageView component - Angular port of the React component.\n * Renders a list of chat messages with support for custom slots and layouts.\n * DOM structure and Tailwind classes match the React implementation exactly.\n */\n@Component({\n  selector: \"copilot-chat-message-view\",\n  standalone: true,\n  imports: [\n    CommonModule,\n    CopilotSlot,\n    CopilotChatAssistantMessage,\n    CopilotChatUserMessage,\n    CopilotChatMessageViewCursor,\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <!-- Custom layout template support (render prop pattern) -->\n    @if (customLayoutTemplate) {\n      <ng-container\n        [ngTemplateOutlet]=\"customLayoutTemplate\"\n        [ngTemplateOutletContext]=\"layoutContext()\"\n      ></ng-container>\n    } @else {\n      <!-- Default layout - exact React DOM structure: div with \"flex flex-col\" classes -->\n      <div [class]=\"computedClass()\">\n        <!-- Message iteration - simplified without tool calls -->\n        @for (\n          message of messagesValue();\n          track trackByMessageId($index, message)\n        ) {\n          @if (message && message.role === \"assistant\") {\n            <!-- Assistant message with slot support -->\n            @if (assistantMessageComponent() || assistantMessageTemplate()) {\n              <copilot-slot\n                [slot]=\"\n                  assistantMessageTemplate() || assistantMessageComponent()\n                \"\n                [context]=\"mergeAssistantProps(message)\"\n                [defaultComponent]=\"defaultAssistantComponent\"\n              >\n              </copilot-slot>\n            } @else {\n              <copilot-chat-assistant-message\n                [message]=\"message\"\n                [messages]=\"messagesValue()\"\n                [isLoading]=\"isLoadingValue()\"\n                [inputClass]=\"assistantMessageClass()\"\n                (thumbsUp)=\"handleAssistantThumbsUp($event)\"\n                (thumbsDown)=\"handleAssistantThumbsDown($event)\"\n                (readAloud)=\"handleAssistantReadAloud($event)\"\n                (regenerate)=\"handleAssistantRegenerate($event)\"\n              >\n              </copilot-chat-assistant-message>\n            }\n          } @else if (message && message.role === \"user\") {\n            <!-- User message with slot support -->\n            @if (userMessageComponent() || userMessageTemplate()) {\n              <copilot-slot\n                [slot]=\"userMessageTemplate() || userMessageComponent()\"\n                [context]=\"mergeUserProps(message)\"\n                [defaultComponent]=\"defaultUserComponent\"\n              >\n              </copilot-slot>\n            } @else {\n              <copilot-chat-user-message\n                [message]=\"message\"\n                [inputClass]=\"userMessageClass()\"\n              >\n              </copilot-chat-user-message>\n            }\n          }\n        }\n\n        <!-- Cursor - exactly like React's conditional rendering -->\n        @if (showCursorValue()) {\n          @if (cursorComponent() || cursorTemplate()) {\n            <copilot-slot\n              [slot]=\"cursorTemplate() || cursorComponent()\"\n              [context]=\"{ inputClass: cursorClass() }\"\n              [defaultComponent]=\"defaultCursorComponent\"\n            >\n            </copilot-slot>\n          } @else {\n            <copilot-chat-message-view-cursor [inputClass]=\"cursorClass()\">\n            </copilot-chat-message-view-cursor>\n          }\n        }\n      </div>\n    }\n  `,\n})\nexport class CopilotChatMessageView {\n  // Core inputs matching React props\n  messages = input<Message[]>([]);\n  showCursor = input<boolean>(false);\n  isLoading = input<boolean>(false);\n  inputClass = input<string | undefined>();\n\n  // Handler availability handled via DI service\n\n  // Assistant message slot inputs\n  assistantMessageComponent = input<Type<any> | undefined>();\n  assistantMessageTemplate = input<TemplateRef<any> | undefined>();\n  assistantMessageClass = input<string | undefined>();\n\n  // User message slot inputs\n  userMessageComponent = input<Type<any> | undefined>();\n  userMessageTemplate = input<TemplateRef<any> | undefined>();\n  userMessageClass = input<string | undefined>();\n\n  // Cursor slot inputs\n  cursorComponent = input<Type<any> | undefined>();\n  cursorTemplate = input<TemplateRef<any> | undefined>();\n  cursorClass = input<string | undefined>();\n\n  // Custom layout template (render prop pattern)\n  @ContentChild(\"customLayout\") customLayoutTemplate?: TemplateRef<any>;\n\n  // Output events (bubbled from child components)\n  assistantMessageThumbsUp = output<{ message: Message }>();\n  assistantMessageThumbsDown = output<{ message: Message }>();\n  assistantMessageReadAloud = output<{ message: Message }>();\n  assistantMessageRegenerate = output<{ message: Message }>();\n  userMessageCopy = output<{ message: Message }>();\n  userMessageEdit = output<{ message: Message }>();\n\n  // Default components for slots\n  protected readonly defaultAssistantComponent = CopilotChatAssistantMessage;\n  protected readonly defaultUserComponent = CopilotChatUserMessage;\n  protected readonly defaultCursorComponent = CopilotChatMessageViewCursor;\n\n  // Derived values from inputs\n  protected messagesValue = computed(() => this.messages());\n  protected showCursorValue = computed(() => this.showCursor());\n  protected isLoadingValue = computed(() => this.isLoading());\n\n  // Computed class matching React: twMerge(\"flex flex-col\", className)\n  computedClass = computed(() => cn(\"flex flex-col\", this.inputClass()));\n\n  // Layout context for custom templates (render prop pattern)\n  layoutContext = computed(() => ({\n    isLoading: this.isLoadingValue(),\n    messages: this.messagesValue(),\n    showCursor: this.showCursorValue(),\n    messageElements: this.messagesValue().filter(\n      (m) => m && (m.role === \"assistant\" || m.role === \"user\")\n    ),\n  }));\n\n  // Slot resolution computed signals\n  assistantMessageSlot = computed(\n    () => this.assistantMessageComponent() || this.assistantMessageClass()\n  );\n\n  userMessageSlot = computed(\n    () => this.userMessageComponent() || this.userMessageClass()\n  );\n\n  cursorSlot = computed(() => this.cursorComponent() || this.cursorClass());\n\n  // Props merging helpers\n  mergeAssistantProps(message: Message) {\n    return {\n      message,\n      messages: this.messagesValue(),\n      isLoading: this.isLoadingValue(),\n      inputClass: this.assistantMessageClass(),\n    };\n  }\n\n  mergeUserProps(message: Message) {\n    return {\n      message,\n      inputClass: this.userMessageClass(),\n    };\n  }\n\n  // TrackBy function for performance optimization\n  trackByMessageId(index: number, message: Message): string {\n    return message?.id || `index-${index}`;\n  }\n\n  constructor() {}\n\n  // Event handlers - just pass them through\n  handleAssistantThumbsUp(event: { message: Message }): void {\n    this.assistantMessageThumbsUp.emit(event);\n  }\n\n  handleAssistantThumbsDown(event: { message: Message }): void {\n    this.assistantMessageThumbsDown.emit(event);\n  }\n\n  handleAssistantReadAloud(event: { message: Message }): void {\n    this.assistantMessageReadAloud.emit(event);\n  }\n\n  handleAssistantRegenerate(event: { message: Message }): void {\n    this.assistantMessageRegenerate.emit(event);\n  }\n}\n","import {\n  Component,\n  input,\n  output,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { LucideAngularModule, ChevronDown } from \"lucide-angular\";\nimport { cn } from \"../../utils\";\n\n/**\n * ScrollToBottomButton component for CopilotChatView\n * Matches React implementation exactly with same Tailwind classes\n */\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-view-scroll-to-bottom-button\",\n  imports: [CommonModule, LucideAngularModule],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <button\n      type=\"button\"\n      [class]=\"computedClass\"\n      [disabled]=\"disabled()\"\n      (click)=\"handleClick()\"\n    >\n      <lucide-angular\n        [img]=\"ChevronDown\"\n        class=\"w-4 h-4 text-gray-600 dark:text-white\"\n      >\n      </lucide-angular>\n    </button>\n  `,\n})\nexport class CopilotChatViewScrollToBottomButton {\n  inputClass = input<string | undefined>();\n  disabled = input<boolean>(false);\n  // Support function-style click handler via slot context\n  onClick = input<(() => void) | undefined>();\n\n  // Simple, idiomatic Angular output\n  clicked = output<void>();\n\n  // Icon reference\n  protected readonly ChevronDown = ChevronDown;\n\n  // Computed class matching React exactly\n  get computedClass(): string {\n    return cn(\n      // Base button styles\n      \"rounded-full w-10 h-10 p-0\",\n      // Background colors\n      \"bg-white dark:bg-gray-900\",\n      // Border and shadow\n      \"shadow-lg border border-gray-200 dark:border-gray-700\",\n      // Hover states\n      \"hover:bg-gray-50 dark:hover:bg-gray-800\",\n      // Layout\n      \"flex items-center justify-center cursor-pointer\",\n      // Transition\n      \"transition-colors\",\n      // Focus states\n      \"focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2\",\n      // Custom classes\n      this.inputClass()\n    );\n  }\n\n  handleClick(): void {\n    if (!this.disabled()) {\n      // Call input handler if provided (slot-style)\n      if (this.onClick()) {\n        this.onClick()!();\n      }\n      this.clicked.emit();\n    }\n  }\n}\n","import {\n  Component,\n  input,\n  output,\n  ViewChild,\n  ElementRef,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n  signal,\n  computed,\n  OnInit,\n  AfterViewInit,\n  OnDestroy,\n  inject,\n  PLATFORM_ID,\n  ChangeDetectorRef,\n} from \"@angular/core\";\nimport { CommonModule, isPlatformBrowser } from \"@angular/common\";\nimport { ScrollingModule } from \"@angular/cdk/scrolling\";\nimport { CopilotSlot } from \"../../slots/copilot-slot\";\nimport { CopilotChatMessageView } from \"./copilot-chat-message-view\";\nimport { CopilotChatViewScrollToBottomButton } from \"./copilot-chat-view-scroll-to-bottom-button\";\nimport { StickToBottom } from \"../../directives/stick-to-bottom\";\nimport { ScrollPosition } from \"../../scroll-position\";\nimport { Message } from \"@ag-ui/client\";\nimport { cn } from \"../../utils\";\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\n\n/**\n * ScrollView component for CopilotChatView\n * Handles auto-scrolling and scroll position management\n */\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-view-scroll-view\",\n  imports: [\n    CommonModule,\n    ScrollingModule,\n    CopilotSlot,\n    CopilotChatMessageView,\n    StickToBottom,\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  providers: [ScrollPosition],\n  template: `\n    @if (!hasMounted()) {\n      <!-- SSR/Initial render without stick-to-bottom -->\n      <div\n        class=\"h-full max-h-full flex flex-col min-h-0 overflow-y-scroll overflow-x-hidden\"\n      >\n        <div class=\"px-4 sm:px-0\">\n          <ng-content></ng-content>\n        </div>\n      </div>\n    } @else if (!autoScroll()) {\n      <!-- Manual scroll mode -->\n      <div class=\"h-full max-h-full flex flex-col min-h-0 relative\">\n        <div\n          #scrollContainer\n          cdkScrollable\n          [class]=\"computedClass()\"\n          class=\"overflow-y-scroll overflow-x-hidden\"\n        >\n          <div #contentContainer class=\"px-4 sm:px-0\">\n            <!-- Content with padding-bottom matching React -->\n            <div [style.padding-bottom.px]=\"paddingBottom()\">\n              <div class=\"max-w-3xl mx-auto\">\n                @if (messageView()) {\n                  <copilot-slot\n                    [slot]=\"messageView()\"\n                    [context]=\"messageViewContext()\"\n                    [defaultComponent]=\"defaultMessageViewComponent\"\n                  >\n                  </copilot-slot>\n                } @else {\n                  <copilot-chat-message-view\n                    [messages]=\"messages()\"\n                    [inputClass]=\"messageViewClass()\"\n                    [showCursor]=\"showCursor()\"\n                    (assistantMessageThumbsUp)=\"\n                      assistantMessageThumbsUp.emit($event)\n                    \"\n                    (assistantMessageThumbsDown)=\"\n                      assistantMessageThumbsDown.emit($event)\n                    \"\n                    (assistantMessageReadAloud)=\"\n                      assistantMessageReadAloud.emit($event)\n                    \"\n                    (assistantMessageRegenerate)=\"\n                      assistantMessageRegenerate.emit($event)\n                    \"\n                    (userMessageCopy)=\"userMessageCopy.emit($event)\"\n                    (userMessageEdit)=\"userMessageEdit.emit($event)\"\n                  >\n                  </copilot-chat-message-view>\n                }\n              </div>\n            </div>\n          </div>\n        </div>\n\n        <!-- Scroll to bottom button for manual mode, OUTSIDE scrollable content -->\n        @if (showScrollButton() && !isResizing()) {\n          <div\n            class=\"absolute inset-x-0 flex justify-center z-30\"\n            [style.bottom.px]=\"inputContainerHeight() + 16\"\n          >\n            <copilot-slot\n              [slot]=\"scrollToBottomButton()\"\n              [context]=\"scrollToBottomContext()\"\n              [defaultComponent]=\"defaultScrollToBottomButtonComponent\"\n              [outputs]=\"scrollToBottomOutputs\"\n            >\n            </copilot-slot>\n          </div>\n        }\n      </div>\n    } @else {\n      <!-- Auto-scroll mode with StickToBottom directive -->\n      <div class=\"h-full max-h-full flex flex-col min-h-0 relative\">\n        <div\n          #scrollContainer\n          cdkScrollable\n          copilotStickToBottom\n          [enabled]=\"autoScroll()\"\n          [threshold]=\"10\"\n          [debounceMs]=\"0\"\n          [initialBehavior]=\"'smooth'\"\n          [resizeBehavior]=\"'smooth'\"\n          (isAtBottomChange)=\"onIsAtBottomChange($event)\"\n          [class]=\"computedClass()\"\n          class=\"overflow-y-scroll overflow-x-hidden\"\n        >\n          <!-- Scrollable content wrapper -->\n          <div class=\"px-4 sm:px-0\">\n            <!-- Content with padding-bottom matching React -->\n            <div [style.padding-bottom.px]=\"paddingBottom()\">\n              <div class=\"max-w-3xl mx-auto\">\n                @if (messageView()) {\n                  <copilot-slot\n                    [slot]=\"messageView()\"\n                    [context]=\"messageViewContext()\"\n                    [defaultComponent]=\"defaultMessageViewComponent\"\n                  >\n                  </copilot-slot>\n                } @else {\n                  <copilot-chat-message-view\n                    [messages]=\"messages()\"\n                    [inputClass]=\"messageViewClass()\"\n                    [showCursor]=\"showCursor()\"\n                    (assistantMessageThumbsUp)=\"\n                      assistantMessageThumbsUp.emit($event)\n                    \"\n                    (assistantMessageThumbsDown)=\"\n                      assistantMessageThumbsDown.emit($event)\n                    \"\n                    (assistantMessageReadAloud)=\"\n                      assistantMessageReadAloud.emit($event)\n                    \"\n                    (assistantMessageRegenerate)=\"\n                      assistantMessageRegenerate.emit($event)\n                    \"\n                    (userMessageCopy)=\"userMessageCopy.emit($event)\"\n                    (userMessageEdit)=\"userMessageEdit.emit($event)\"\n                  >\n                  </copilot-chat-message-view>\n                }\n              </div>\n            </div>\n          </div>\n        </div>\n\n        <!-- Scroll to bottom button - hidden during resize, OUTSIDE scrollable content -->\n        @if (!isAtBottom() && !isResizing()) {\n          <div\n            class=\"absolute inset-x-0 flex justify-center z-30\"\n            [style.bottom.px]=\"inputContainerHeight() + 16\"\n          >\n            <copilot-slot\n              [slot]=\"scrollToBottomButton()\"\n              [context]=\"scrollToBottomFromStickContext()\"\n              [defaultComponent]=\"defaultScrollToBottomButtonComponent\"\n              [outputs]=\"scrollToBottomFromStickOutputs\"\n            >\n            </copilot-slot>\n          </div>\n        }\n      </div>\n    }\n  `,\n})\nexport class CopilotChatViewScrollView\n  implements OnInit, AfterViewInit, OnDestroy\n{\n  private cdr = inject(ChangeDetectorRef);\n\n  autoScroll = input<boolean>(true);\n\n  inputContainerHeight = input<number>(0);\n\n  isResizing = input<boolean>(false);\n  inputClass = input<string | undefined>();\n  messages = input<Message[]>([]);\n  messageView = input<any | undefined>();\n  messageViewClass = input<string | undefined>();\n  showCursor = input<boolean>(false);\n\n  // Handler availability flags removed in favor of DI service\n\n  // Slot inputs\n  scrollToBottomButton = input<any | undefined>();\n  scrollToBottomButtonClass = input<string | undefined>();\n\n  // Output events (bubbled from message view)\n  assistantMessageThumbsUp = output<{ message: Message }>();\n  assistantMessageThumbsDown = output<{ message: Message }>();\n  assistantMessageReadAloud = output<{ message: Message }>();\n  assistantMessageRegenerate = output<{ message: Message }>();\n  userMessageCopy = output<{ message: Message }>();\n  userMessageEdit = output<{ message: Message }>();\n\n  // ViewChild references\n  @ViewChild(\"scrollContainer\", { read: ElementRef })\n  scrollContainer?: ElementRef<HTMLElement>;\n  @ViewChild(\"contentContainer\", { read: ElementRef })\n  contentContainer?: ElementRef<HTMLElement>;\n  @ViewChild(StickToBottom) stickToBottomDirective?: StickToBottom;\n\n  // Default components\n  protected readonly defaultMessageViewComponent = CopilotChatMessageView;\n  protected readonly defaultScrollToBottomButtonComponent =\n    CopilotChatViewScrollToBottomButton;\n\n  // Signals\n  protected hasMounted = signal(false);\n  protected showScrollButton = signal(false);\n  protected isAtBottom = signal(true);\n  protected paddingBottom = computed(() => this.inputContainerHeight() + 32);\n\n  // Computed class\n  protected computedClass = computed(() => cn(this.inputClass()));\n\n  private destroy$ = new Subject<void>();\n  private platformId = inject(PLATFORM_ID);\n  private scrollPositionService = inject(ScrollPosition);\n\n  // No mirroring of inputs; derive directly via computed()\n\n  ngOnInit(): void {\n    // Check if we're in the browser\n    if (isPlatformBrowser(this.platformId)) {\n      // Set mounted after a tick to allow for hydration\n      setTimeout(() => {\n        this.hasMounted.set(true);\n      }, 0);\n    }\n  }\n\n  ngAfterViewInit(): void {\n    if (!this.autoScroll()) {\n      // Wait for the view to be fully rendered after hasMounted is set\n      setTimeout(() => {\n        if (this.scrollContainer) {\n          // Check initial scroll position\n          const initialState = this.scrollPositionService.getScrollState(\n            this.scrollContainer.nativeElement,\n            10\n          );\n          this.showScrollButton.set(!initialState.isAtBottom);\n\n          // Monitor scroll position for manual mode\n          this.scrollPositionService\n            .monitorScrollPosition(this.scrollContainer, 10)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((state) => {\n              this.showScrollButton.set(!state.isAtBottom);\n            });\n        }\n      }, 100);\n    }\n  }\n\n  /**\n   * Handle isAtBottom change from StickToBottom directive\n   */\n  onIsAtBottomChange(isAtBottom: boolean): void {\n    this.isAtBottom.set(isAtBottom);\n  }\n\n  /**\n   * Scroll to bottom for manual mode\n   */\n  scrollToBottom(): void {\n    if (this.scrollContainer) {\n      this.scrollPositionService.scrollToBottom(this.scrollContainer, true);\n    }\n  }\n\n  /**\n   * Scroll to bottom for stick-to-bottom mode\n   */\n  scrollToBottomFromStick(): void {\n    if (this.stickToBottomDirective) {\n      this.stickToBottomDirective.scrollToBottom(\"smooth\");\n    }\n  }\n\n  ngOnDestroy(): void {\n    this.destroy$.next();\n    this.destroy$.complete();\n  }\n\n  // Output maps for slots\n  scrollToBottomOutputs = { clicked: () => this.scrollToBottom() };\n  scrollToBottomFromStickOutputs = {\n    clicked: () => this.scrollToBottomFromStick(),\n  };\n\n  // Context methods for templates\n  messageViewContext(): any {\n    return {\n      messages: this.messages(),\n      inputClass: this.messageViewClass(),\n      showCursor: this.showCursor(),\n    };\n  }\n\n  scrollToBottomContext(): any {\n    return {\n      inputClass: this.scrollToBottomButtonClass(),\n      onClick: () => this.scrollToBottom(),\n    };\n  }\n\n  scrollToBottomFromStickContext(): any {\n    return {\n      inputClass: this.scrollToBottomButtonClass(),\n      onClick: () => this.scrollToBottomFromStick(),\n    };\n  }\n}\n","import {\n  Component,\n  input,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { cn } from \"../../utils\";\n\n/**\n * Feather component for CopilotChatView\n * Creates a gradient overlay effect between messages and input\n * Matches React implementation exactly with same Tailwind classes\n */\n@Component({\n  selector: \"copilot-chat-view-feather\",\n  standalone: true,\n  imports: [CommonModule],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: ` <div [class]=\"computedClass\" [style]=\"style()\"></div> `,\n})\nexport class CopilotChatViewFeather {\n  inputClass = input<string | undefined>();\n  style = input<{ [key: string]: any } | undefined>();\n\n  // Computed class matching React exactly\n  get computedClass(): string {\n    return cn(\n      // Positioning\n      \"absolute bottom-0 left-0 right-4 h-24 pointer-events-none z-10\",\n      // Gradient\n      \"bg-gradient-to-t\",\n      // Light mode colors\n      \"from-white via-white to-transparent\",\n      // Dark mode colors\n      \"dark:from-[rgb(33,33,33)] dark:via-[rgb(33,33,33)]\",\n      // Custom classes\n      this.inputClass()\n    );\n  }\n}\n","import {\n  Component,\n  input,\n  output,\n  ElementRef,\n  AfterViewInit,\n  signal,\n  computed,\n  inject,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n} from \"@angular/core\";\nimport { cn } from \"../../utils\";\nimport { injectChatLabels } from \"../../chat-config\";\nimport { injectChatState } from \"../../chat-state\";\n\n@Component({\n  selector: \"textarea[copilotChatTextarea]\",\n  standalone: true,\n  imports: [],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  host: {\n    \"[value]\": \"computedValue()\",\n    \"[placeholder]\": \"placeholder()\",\n    \"[disabled]\": \"disabled()\",\n    \"[class]\": \"computedClass()\",\n    \"[style.max-height.px]\": \"maxHeight()\",\n    \"[style.overflow]\": \"'auto'\",\n    \"[style.resize]\": \"'none'\",\n    \"(input)\": \"onInput($event)\",\n    \"(keydown)\": \"onKeyDown($event)\",\n    \"[attr.rows]\": \"1\",\n  },\n  template: \"\",\n  styles: [],\n})\nexport class CopilotChatTextarea implements AfterViewInit {\n  private elementRef = inject(ElementRef<HTMLTextAreaElement>);\n  get textareaRef() {\n    return this.elementRef;\n  }\n\n  inputValue = input<string | undefined>();\n  inputPlaceholder = input<string | undefined>();\n  inputMaxRows = input<number | undefined>();\n  inputAutoFocus = input<boolean | undefined>();\n  inputDisabled = input<boolean | undefined>();\n  inputClass = input<string | undefined>();\n\n  valueChange = output<string>();\n  keyDown = output<KeyboardEvent>();\n\n  readonly chatLabels = injectChatLabels();\n  readonly chatState = injectChatState();\n\n  // Internal signals\n  maxHeight = signal<number>(0);\n\n  // Computed values\n  computedValue = computed(\n    () => this.inputValue() ?? this.chatState.inputValue() ?? \"\"\n  );\n  placeholder = computed(\n    () => this.inputPlaceholder() || this.chatLabels.chatInputPlaceholder\n  );\n  disabled = computed(() => this.inputDisabled() ?? false);\n\n  computedClass = computed(() => {\n    const baseClasses = cn(\n      // Layout and sizing\n      \"w-full p-5 pb-0\",\n      // Behavior\n      \"outline-none resize-none\",\n      // Background\n      \"bg-transparent\",\n      // Typography\n      \"antialiased font-regular leading-relaxed text-[16px]\",\n      // Placeholder styles\n      \"placeholder:text-[#00000077] dark:placeholder:text-[#fffc]\"\n    );\n    return cn(baseClasses, this.inputClass());\n  });\n\n  constructor() {}\n\n  ngAfterViewInit(): void {\n    this.calculateMaxHeight();\n    this.adjustHeight();\n\n    if (this.inputAutoFocus() ?? true) {\n      setTimeout(() => {\n        this.elementRef.nativeElement.focus();\n      });\n    }\n  }\n\n  onInput(event: Event): void {\n    const textarea = event.target as HTMLTextAreaElement;\n    const newValue = textarea.value;\n    this.valueChange.emit(newValue);\n\n    this.chatState.changeInput(newValue);\n\n    this.adjustHeight();\n  }\n\n  onKeyDown(event: KeyboardEvent): void {\n    // Check for Enter key without Shift\n    if (event.key === \"Enter\" && !event.shiftKey) {\n      event.preventDefault();\n      this.keyDown.emit(event);\n    } else {\n      this.keyDown.emit(event);\n    }\n  }\n\n  private calculateMaxHeight(): void {\n    const textarea = this.elementRef.nativeElement;\n    const maxRowsValue = this.inputMaxRows() ?? 5;\n\n    // Save current value\n    const currentValue = textarea.value;\n\n    // Clear content to measure single row height\n    textarea.value = \"\";\n    textarea.style.height = \"auto\";\n\n    // Get computed styles to account for padding\n    const computedStyle = window.getComputedStyle(textarea);\n    const paddingTop = parseFloat(computedStyle.paddingTop);\n    const paddingBottom = parseFloat(computedStyle.paddingBottom);\n\n    // Calculate actual content height (without padding)\n    const contentHeight = textarea.scrollHeight - paddingTop - paddingBottom;\n\n    // Calculate max height: content height for maxRows + padding\n    const calculatedMaxHeight =\n      contentHeight * maxRowsValue + paddingTop + paddingBottom;\n    this.maxHeight.set(calculatedMaxHeight);\n\n    // Restore original value\n    textarea.value = currentValue;\n\n    // Adjust height after calculating maxHeight\n    if (currentValue) {\n      this.adjustHeight();\n    }\n  }\n\n  private adjustHeight(): void {\n    const textarea = this.elementRef.nativeElement;\n    const maxHeightValue = this.maxHeight();\n\n    if (maxHeightValue > 0) {\n      textarea.style.height = \"auto\";\n      textarea.style.height = `${Math.min(textarea.scrollHeight, maxHeightValue)}px`;\n    }\n  }\n\n  /**\n   * Public method to focus the textarea\n   */\n  focus(): void {\n    this.elementRef.nativeElement.focus();\n  }\n\n  /**\n   * Public method to get current value\n   */\n  getValue(): string {\n    return this.elementRef.nativeElement.value;\n  }\n\n  /**\n   * Public method to set value programmatically\n   */\n  setValue(value: string): void {\n    this.elementRef.nativeElement.value = value;\n    this.valueChange.emit(value);\n\n    this.chatState.changeInput(value);\n\n    setTimeout(() => this.adjustHeight());\n  }\n}\n","import type { Type, TemplateRef } from \"@angular/core\";\n\n/**\n * Mode of the chat input component\n */\nexport type CopilotChatInputMode = \"input\" | \"transcribe\" | \"processing\";\n\n/**\n * Represents a menu item in the tools menu\n */\nexport type ToolsMenuItem = {\n  label: string;\n} & (\n  | {\n      action: () => void;\n      items?: never;\n    }\n  | {\n      action?: never;\n      items: (ToolsMenuItem | \"-\")[];\n    }\n);\n\n/**\n * Audio recorder state\n */\nexport type AudioRecorderState = \"idle\" | \"recording\" | \"processing\";\n\n/**\n * Error class for audio recorder failures\n */\nexport class AudioRecorderError extends Error {\n  constructor(message: string) {\n    super(message);\n    this.name = \"AudioRecorderError\";\n  }\n}\n\n/**\n * Props for textarea component\n */\nexport interface CopilotChatTextareaProps {\n  value?: string;\n  placeholder?: string;\n  maxRows?: number;\n  autoFocus?: boolean;\n  disabled?: boolean;\n  onChange?: (value: string) => void;\n  onKeyDown?: (event: KeyboardEvent) => void;\n  inputClass?: string;\n  style?: any;\n  rows?: number;\n  cols?: number;\n  readonly?: boolean;\n  spellcheck?: boolean;\n  wrap?: \"hard\" | \"soft\" | \"off\";\n}\n\n/**\n * Props for button components\n */\nexport interface CopilotChatButtonProps {\n  disabled?: boolean;\n  onClick?: () => void;\n  inputClass?: string;\n  style?: any;\n  type?: \"button\" | \"submit\" | \"reset\";\n  ariaLabel?: string;\n  ariaPressed?: boolean;\n  ariaExpanded?: boolean;\n  title?: string;\n}\n\n/**\n * Props for toolbar button with tooltip\n */\nexport interface CopilotChatToolbarButtonProps extends CopilotChatButtonProps {\n  icon?: TemplateRef<any>;\n  tooltip?: string;\n  variant?: \"primary\" | \"secondary\";\n}\n\n/**\n * Props for tools menu button\n */\nexport interface CopilotChatToolsButtonProps extends CopilotChatButtonProps {\n  toolsMenu?: (ToolsMenuItem | \"-\")[];\n}\n\n/**\n * Props for audio recorder\n */\nexport interface CopilotChatAudioRecorderProps {\n  inputClass?: string;\n  style?: any;\n  onStateChange?: (state: AudioRecorderState) => void;\n  showControls?: boolean;\n  maxDuration?: number;\n}\n\n/**\n * Props for toolbar\n */\nexport interface CopilotChatToolbarProps {\n  inputClass?: string;\n  style?: any;\n  position?: \"top\" | \"bottom\";\n  alignment?: \"left\" | \"center\" | \"right\" | \"space-between\";\n}\n\n/**\n * Slot configuration for chat input\n */\nexport interface CopilotChatInputSlots {\n  textArea?: Type<any> | TemplateRef<any>;\n  sendButton?: Type<any> | TemplateRef<any>;\n  startTranscribeButton?: Type<any> | TemplateRef<any>;\n  cancelTranscribeButton?: Type<any> | TemplateRef<any>;\n  finishTranscribeButton?: Type<any> | TemplateRef<any>;\n  addFileButton?: Type<any> | TemplateRef<any>;\n  toolsButton?: Type<any> | TemplateRef<any>;\n  toolbar?: Type<any> | TemplateRef<any>;\n  audioRecorder?: Type<any> | TemplateRef<any>;\n}\n\n/**\n * Input configuration for the chat input component\n */\nexport interface CopilotChatInputConfig {\n  mode?: CopilotChatInputMode;\n  toolsMenu?: (ToolsMenuItem | \"-\")[];\n  autoFocus?: boolean;\n  additionalToolbarItems?: TemplateRef<any>;\n  value?: string;\n  class?: string;\n}\n\n/**\n * Output events for the chat input component\n */\nexport interface CopilotChatInputOutputs {\n  submitMessage: (value: string) => void;\n  startTranscribe: () => void;\n  cancelTranscribe: () => void;\n  finishTranscribe: () => void;\n  addFile: () => void;\n  changeValue: (value: string) => void;\n}\n","import {\n  Component,\n  input,\n  output,\n  ViewChild,\n  ElementRef,\n  AfterViewInit,\n  OnDestroy,\n  signal,\n  computed,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n} from \"@angular/core\";\nimport {\n  AudioRecorderState,\n  AudioRecorderError,\n} from \"./copilot-chat-input.types\";\n\n@Component({\n  selector: \"copilot-chat-audio-recorder\",\n  standalone: true,\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <div [class]=\"computedClass()\">\n      <canvas\n        #canvasRef\n        class=\"w-full h-full\"\n        [style.imageRendering]=\"'pixelated'\"\n      ></canvas>\n    </div>\n  `,\n  styles: [],\n  host: {\n    \"[class.copilot-chat-audio-recorder]\": \"true\",\n  },\n})\nexport class CopilotChatAudioRecorder implements AfterViewInit, OnDestroy {\n  @ViewChild(\"canvasRef\", { static: true })\n  canvasRef!: ElementRef<HTMLCanvasElement>;\n\n  inputClass = input<string | undefined>();\n  inputShowControls = input<boolean>(false);\n\n  stateChange = output<AudioRecorderState>();\n  error = output<AudioRecorderError>();\n\n  // Signals for state management\n  state = signal<AudioRecorderState>(\"idle\");\n  showControls = signal<boolean>(false);\n\n  // Computed values\n  computedClass = computed(() => {\n    const baseClasses = \"h-11 w-full px-5\";\n    return `${baseClasses} ${this.inputClass() || \"\"}`;\n  });\n\n  statusText = computed(() => {\n    switch (this.state()) {\n      case \"recording\":\n        return \"Recording...\";\n      case \"processing\":\n        return \"Processing...\";\n      default:\n        return \"Ready\";\n    }\n  });\n\n  // Animation and canvas properties\n  private animationFrameId?: number;\n\n  // Sync inputShowControls into internal signal\n  constructor() {\n    // Use microtask to avoid constructor signal writes complaint in some setups\n    Promise.resolve().then(() => {\n      this.showControls.set(this.inputShowControls() ?? false);\n    });\n  }\n\n  ngAfterViewInit(): void {\n    this.startAnimation();\n  }\n\n  ngOnDestroy(): void {\n    this.dispose();\n  }\n\n  /**\n   * Start recording audio\n   */\n  async start(): Promise<void> {\n    try {\n      if (this.state() === \"recording\") {\n        return;\n      }\n\n      this.setState(\"recording\");\n      this.startAnimation();\n\n      // In a real implementation, this would start actual audio recording\n      // For now, we just simulate the recording state\n    } catch (err) {\n      const error = new AudioRecorderError(\n        err instanceof Error ? err.message : \"Failed to start recording\"\n      );\n      this.error.emit(error);\n      this.setState(\"idle\");\n      throw error;\n    }\n  }\n\n  /**\n   * Stop recording audio and return blob\n   */\n  async stop(): Promise<Blob> {\n    try {\n      this.setState(\"idle\");\n      // Return empty blob - stub implementation\n      const emptyBlob = new Blob([], { type: \"audio/webm\" });\n      return emptyBlob;\n    } catch (err) {\n      const error = new AudioRecorderError(\n        err instanceof Error ? err.message : \"Failed to stop recording\"\n      );\n      this.error.emit(error);\n      this.setState(\"idle\");\n      throw error;\n    }\n  }\n\n  /**\n   * Get current recorder state\n   */\n  getState(): AudioRecorderState {\n    return this.state();\n  }\n\n  /**\n   * Dispose of resources\n   */\n  dispose(): void {\n    this.stopAnimation();\n  }\n\n  private setState(state: AudioRecorderState): void {\n    this.state.set(state);\n    this.stateChange.emit(state);\n  }\n\n  private startAnimation(): void {\n    const canvas = this.canvasRef.nativeElement;\n    if (!canvas) return;\n\n    const ctx = canvas.getContext(\"2d\");\n    if (!ctx) return;\n\n    const draw = () => {\n      const rect = canvas.getBoundingClientRect();\n      const dpr = window.devicePixelRatio || 1;\n\n      // Update canvas dimensions if container resized\n      if (\n        canvas.width !== rect.width * dpr ||\n        canvas.height !== rect.height * dpr\n      ) {\n        canvas.width = rect.width * dpr;\n        canvas.height = rect.height * dpr;\n        ctx.scale(dpr, dpr);\n        ctx.imageSmoothingEnabled = false;\n      }\n\n      // Configuration\n      const barWidth = 2;\n      const minHeight = 2;\n      const maxHeight = 20;\n      const gap = 2;\n      const numSamples = Math.ceil(rect.width / (barWidth + gap));\n\n      // Get loudness data\n      const loudnessData = this.getLoudness(numSamples);\n\n      // Clear canvas\n      ctx.clearRect(0, 0, rect.width, rect.height);\n\n      // Get current foreground color\n      const computedStyle = getComputedStyle(canvas);\n      const currentForeground = computedStyle.color;\n\n      // Draw bars\n      ctx.fillStyle = currentForeground;\n      const centerY = rect.height / 2;\n\n      for (let i = 0; i < loudnessData.length; i++) {\n        const sample = loudnessData[i] ?? 0;\n        const barHeight = Math.round(\n          sample * (maxHeight - minHeight) + minHeight\n        );\n        const x = Math.round(i * (barWidth + gap));\n        const y = Math.round(centerY - barHeight / 2);\n\n        ctx.fillRect(x, y, barWidth, barHeight);\n      }\n\n      this.animationFrameId = requestAnimationFrame(draw);\n    };\n\n    draw();\n  }\n\n  private stopAnimation(): void {\n    if (this.animationFrameId) {\n      cancelAnimationFrame(this.animationFrameId);\n      this.animationFrameId = undefined;\n    }\n  }\n\n  private getLoudness(n: number): number[] {\n    const elapsed = Date.now() / 1000; // Use current timestamp directly\n    const samples: number[] = [];\n\n    for (let i = 0; i < n; i++) {\n      // Create a position that moves from left to right over time\n      const position = (i / n) * 10 + elapsed * 0.5; // Scroll speed (slower)\n\n      // Generate waveform using multiple sine waves for realism\n      const wave1 = Math.sin(position * 2) * 0.3;\n      const wave2 = Math.sin(position * 5 + elapsed) * 0.2;\n      const wave3 = Math.sin(position * 0.5 + elapsed * 0.3) * 0.4;\n\n      // Add some randomness for natural variation\n      const noise = (Math.random() - 0.5) * 0.1;\n\n      // Combine waves and add envelope for realistic amplitude variation\n      const envelope = Math.sin(elapsed * 0.7) * 0.5 + 0.5; // Slow amplitude modulation\n      let amplitude = (wave1 + wave2 + wave3 + noise) * envelope;\n\n      // Clamp to 0-1 range\n      amplitude = Math.max(0, Math.min(1, amplitude * 0.5 + 0.3));\n\n      samples.push(amplitude);\n    }\n\n    return samples;\n  }\n}\n","import {\n  Component,\n  input,\n  output,\n  ChangeDetectionStrategy,\n  signal,\n  computed,\n  ViewEncapsulation,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport {\n  LucideAngularModule,\n  ArrowUp,\n  Mic,\n  X,\n  Check,\n  Plus,\n} from \"lucide-angular\";\nimport { injectChatLabels } from \"../../chat-config\";\nimport { CopilotTooltip } from \"../../directives/tooltip\";\nimport { cn } from \"../../utils\";\n\n// Base button classes matching React's button variants\nconst buttonBase = cn(\n  \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium\",\n  \"transition-all disabled:pointer-events-none disabled:opacity-50\",\n  \"shrink-0 outline-none\",\n  \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\"\n);\n\nconst chatInputToolbarPrimary = cn(\n  \"cursor-pointer\",\n  // Background and text\n  \"bg-black text-white\",\n  // Dark mode\n  \"dark:bg-white dark:text-black dark:focus-visible:outline-white\",\n  // Shape and sizing\n  \"rounded-full h-9 w-9\",\n  // Interactions\n  \"transition-colors\",\n  // Focus states\n  \"focus:outline-none\",\n  // Hover states\n  \"hover:opacity-70 disabled:hover:opacity-100\",\n  // Disabled states\n  \"disabled:cursor-not-allowed disabled:bg-[#00000014] disabled:text-[rgb(13,13,13)]\",\n  \"dark:disabled:bg-[#454545] dark:disabled:text-white\"\n);\n\nconst chatInputToolbarSecondary = cn(\n  \"cursor-pointer\",\n  // Background and text\n  \"bg-transparent text-[#444444]\",\n  // Dark mode\n  \"dark:text-white dark:border-[#404040]\",\n  // Shape and sizing\n  \"rounded-full h-9 w-9\",\n  // Interactions\n  \"transition-colors\",\n  // Focus states\n  \"focus:outline-none\",\n  // Hover states\n  \"hover:bg-[#f8f8f8] hover:text-[#333333]\",\n  \"dark:hover:bg-[#404040] dark:hover:text-[#FFFFFF]\",\n  // Disabled states\n  \"disabled:cursor-not-allowed disabled:opacity-50\",\n  \"disabled:hover:bg-transparent disabled:hover:text-[#444444]\",\n  \"dark:disabled:hover:bg-transparent dark:disabled:hover:text-[#CCCCCC]\"\n);\n\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-send-button\",\n  imports: [CommonModule, LucideAngularModule],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <div class=\"mr-[10px]\">\n      <button\n        type=\"button\"\n        [disabled]=\"disabled()\"\n        [class]=\"buttonClass\"\n        (click)=\"onClick()\"\n      >\n        <lucide-angular [img]=\"ArrowUpIcon\" [size]=\"18\"></lucide-angular>\n      </button>\n    </div>\n  `,\n  styles: [``],\n})\nexport class CopilotChatSendButton {\n  disabled = input(false);\n  clicked = output<void>();\n\n  readonly ArrowUpIcon = ArrowUp;\n  buttonClass = cn(buttonBase, chatInputToolbarPrimary);\n\n  onClick(): void {\n    if (!this.disabled) {\n      this.clicked.emit();\n    }\n  }\n}\n\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-start-transcribe-button\",\n  imports: [CommonModule, LucideAngularModule, CopilotTooltip],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <button\n      type=\"button\"\n      [disabled]=\"disabled()\"\n      [class]=\"buttonClass\"\n      [copilotTooltip]=\"label\"\n      tooltipPosition=\"below\"\n      (click)=\"onClick()\"\n    >\n      <lucide-angular [img]=\"MicIcon\" [size]=\"18\"></lucide-angular>\n    </button>\n  `,\n  styles: [``],\n})\nexport class CopilotChatStartTranscribeButton {\n  disabled = input(false);\n  clicked = output<void>();\n\n  readonly labels = injectChatLabels();\n\n  readonly MicIcon = Mic;\n  buttonClass = cn(buttonBase, chatInputToolbarSecondary, \"mr-2\");\n\n  get label(): string {\n    return this.labels.chatInputToolbarStartTranscribeButtonLabel;\n  }\n\n  onClick(): void {\n    if (!this.disabled()) {\n      this.clicked.emit();\n    }\n  }\n}\n\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-cancel-transcribe-button\",\n  imports: [CommonModule, LucideAngularModule, CopilotTooltip],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <button\n      type=\"button\"\n      [disabled]=\"disabled()\"\n      [class]=\"buttonClass\"\n      [copilotTooltip]=\"label\"\n      tooltipPosition=\"below\"\n      (click)=\"onClick()\"\n    >\n      <lucide-angular [img]=\"XIcon\" [size]=\"18\"></lucide-angular>\n    </button>\n  `,\n  styles: [``],\n})\nexport class CopilotChatCancelTranscribeButton {\n  disabled = input(false);\n  clicked = output<void>();\n\n  readonly labels = injectChatLabels();\n\n  readonly XIcon = X;\n  buttonClass = cn(buttonBase, chatInputToolbarSecondary, \"mr-2\");\n\n  get label(): string {\n    return this.labels.chatInputToolbarCancelTranscribeButtonLabel;\n  }\n\n  onClick(): void {\n    if (!this.disabled()) {\n      this.clicked.emit();\n    }\n  }\n}\n\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-finish-transcribe-button\",\n  imports: [CommonModule, LucideAngularModule, CopilotTooltip],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <button\n      type=\"button\"\n      [disabled]=\"disabled()\"\n      [class]=\"buttonClass\"\n      [copilotTooltip]=\"label\"\n      tooltipPosition=\"below\"\n      (click)=\"onClick()\"\n    >\n      <lucide-angular [img]=\"CheckIcon\" [size]=\"18\"></lucide-angular>\n    </button>\n  `,\n  styles: [``],\n})\nexport class CopilotChatFinishTranscribeButton {\n  disabled = input(false);\n  clicked = output<void>();\n\n  readonly labels = injectChatLabels();\n\n  readonly CheckIcon = Check;\n  buttonClass = cn(buttonBase, chatInputToolbarSecondary, \"mr-[10px]\");\n\n  get label(): string {\n    return this.labels.chatInputToolbarFinishTranscribeButtonLabel;\n  }\n\n  onClick(): void {\n    if (!this.disabled()) {\n      this.clicked.emit();\n    }\n  }\n}\n\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-add-file-button\",\n  imports: [CommonModule, LucideAngularModule, CopilotTooltip],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <button\n      type=\"button\"\n      [disabled]=\"disabled()\"\n      [class]=\"buttonClass\"\n      [copilotTooltip]=\"label\"\n      tooltipPosition=\"below\"\n      (click)=\"onClick()\"\n    >\n      <lucide-angular [img]=\"PlusIcon\" [size]=\"20\"></lucide-angular>\n    </button>\n  `,\n  styles: [``],\n})\nexport class CopilotChatAddFileButton {\n  disabled = input(false);\n  clicked = output<void>();\n\n  readonly labels = injectChatLabels();\n\n  readonly PlusIcon = Plus;\n  buttonClass = cn(buttonBase, chatInputToolbarSecondary, \"ml-2\");\n\n  get label(): string {\n    return this.labels.chatInputToolbarAddButtonLabel;\n  }\n\n  onClick(): void {\n    if (!this.disabled()) {\n      this.clicked.emit();\n    }\n  }\n}\n\n// Base toolbar button component that other buttons can use\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-toolbar-button\",\n  imports: [CommonModule, CopilotTooltip],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <button\n      type=\"button\"\n      [disabled]=\"disabled()\"\n      [class]=\"computedClass()\"\n      [copilotTooltip]=\"title()\"\n      tooltipPosition=\"below\"\n      (click)=\"onClick()\"\n    >\n      <ng-content></ng-content>\n    </button>\n  `,\n  styles: [``],\n})\nexport class CopilotChatToolbarButton {\n  disabled = signal(false);\n  variant = signal<\"primary\" | \"secondary\">(\"secondary\");\n  customClass = signal(\"\");\n  title = signal(\"\");\n\n  clicked = output<void>();\n\n  computedClass = computed(() => {\n    const variantClass =\n      this.variant() === \"primary\"\n        ? chatInputToolbarPrimary\n        : chatInputToolbarSecondary;\n    return cn(buttonBase, variantClass, this.customClass());\n  });\n\n  onClick(): void {\n    if (!this.disabled()) {\n      this.clicked.emit();\n    }\n  }\n}\n","import {\n  Component,\n  input,\n  computed,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { cn } from \"../../utils\";\n\n@Component({\n  selector: \"div[copilotChatToolbar]\",\n  standalone: true,\n  imports: [CommonModule],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  host: {\n    \"[class]\": \"computedClass()\",\n  },\n  template: `<ng-content></ng-content>`,\n  styles: [],\n})\nexport class CopilotChatToolbar {\n  readonly inputClass = input<string | undefined>();\n\n  readonly computedClass = computed(() => {\n    const baseClasses =\n      \"w-full h-[60px] bg-transparent flex items-center justify-between\";\n    return cn(baseClasses, this.inputClass());\n  });\n}\n","import {\n  Component,\n  input,\n  computed,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { CdkMenuModule } from \"@angular/cdk/menu\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { LucideAngularModule, Settings2, ChevronRight } from \"lucide-angular\";\nimport type { ToolsMenuItem } from \"./copilot-chat-input.types\";\nimport { cn } from \"../../utils\";\nimport { injectChatLabels } from \"../../chat-config\";\n\n@Component({\n  selector: \"copilot-chat-tools-menu\",\n  standalone: true,\n  imports: [CommonModule, CdkMenuModule, OverlayModule, LucideAngularModule],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    @if (hasItems()) {\n      <button\n        type=\"button\"\n        [disabled]=\"disabled()\"\n        [class]=\"buttonClass()\"\n        [cdkMenuTriggerFor]=\"menu\"\n      >\n        <lucide-angular [img]=\"Settings2Icon\" [size]=\"18\"></lucide-angular>\n        <span class=\"text-sm font-normal\">{{ label }}</span>\n      </button>\n\n      <ng-template #menu>\n        <div\n          class=\"min-w-[200px] bg-white dark:bg-[#1F1F1F] border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg p-1\"\n          cdkMenu\n        >\n          @for (item of toolsMenu(); track $index) {\n            @if (item === \"-\") {\n              <div class=\"h-px bg-gray-200 dark:bg-gray-700 my-1\"></div>\n            } @else if (isMenuItem(item)) {\n              @if (item.items && item.items.length > 0) {\n                <!-- Submenu trigger -->\n                <button\n                  type=\"button\"\n                  class=\"w-full px-3 py-2 text-left bg-transparent border-none rounded hover:bg-gray-100 dark:hover:bg-gray-800 cursor-pointer text-sm flex items-center justify-between\"\n                  [cdkMenuTriggerFor]=\"submenu\"\n                  cdkMenuItem\n                >\n                  {{ item.label }}\n                  <lucide-angular\n                    [img]=\"ChevronRightIcon\"\n                    [size]=\"12\"\n                    class=\"ml-auto\"\n                  ></lucide-angular>\n                </button>\n\n                <!-- Submenu template -->\n                <ng-template #submenu>\n                  <div\n                    class=\"min-w-[200px] bg-white dark:bg-[#1F1F1F] border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg p-1\"\n                    cdkMenu\n                  >\n                    @for (subItem of item.items; track $index) {\n                      @if (subItem === \"-\") {\n                        <div\n                          class=\"h-px bg-gray-200 dark:bg-gray-700 my-1\"\n                        ></div>\n                      } @else if (isMenuItem(subItem)) {\n                        <button\n                          type=\"button\"\n                          class=\"w-full px-3 py-2 text-left bg-transparent border-none rounded hover:bg-gray-100 dark:hover:bg-gray-800 cursor-pointer text-sm\"\n                          (click)=\"handleItemClick(subItem)\"\n                          cdkMenuItem\n                        >\n                          {{ subItem.label }}\n                        </button>\n                      }\n                    }\n                  </div>\n                </ng-template>\n              } @else {\n                <!-- Regular menu item -->\n                <button\n                  type=\"button\"\n                  class=\"w-full px-3 py-2 text-left bg-transparent border-none rounded hover:bg-gray-100 dark:hover:bg-gray-800 cursor-pointer text-sm\"\n                  (click)=\"handleItemClick(item)\"\n                  cdkMenuItem\n                >\n                  {{ item.label }}\n                </button>\n              }\n            }\n          }\n        </div>\n      </ng-template>\n    }\n  `,\n  styles: [\n    `\n      /* CDK Overlay styles for positioning */\n      .cdk-overlay-pane {\n        position: absolute;\n        pointer-events: auto;\n        z-index: 1000;\n      }\n\n      /* Ensure menu appears above other content */\n      .cdk-overlay-container {\n        position: fixed;\n        z-index: 1000;\n      }\n\n      /* Menu animation */\n      [cdkMenu] {\n        animation: menuFadeIn 0.15s ease-out;\n      }\n\n      @keyframes menuFadeIn {\n        from {\n          opacity: 0;\n          transform: translateY(4px);\n        }\n        to {\n          opacity: 1;\n          transform: translateY(0);\n        }\n      }\n    `,\n  ],\n})\nexport class CopilotChatToolsMenu {\n  readonly Settings2Icon = Settings2;\n  readonly ChevronRightIcon = ChevronRight;\n  inputToolsMenu = input<(ToolsMenuItem | \"-\")[] | undefined>();\n  inputDisabled = input<boolean | undefined>();\n  inputClass = input<string | undefined>();\n\n  private labels = injectChatLabels();\n\n  // Derive state from inputs\n  toolsMenu = computed(() => this.inputToolsMenu() ?? []);\n  disabled = computed(() => this.inputDisabled() ?? false);\n  customClass = computed(() => this.inputClass());\n\n  hasItems = computed(() => this.toolsMenu().length > 0);\n\n  readonly label = this.labels.chatInputToolbarToolsButtonLabel;\n\n  buttonClass = computed(() => {\n    const baseClasses = cn(\n      // Base button styles\n      \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-full text-sm font-medium\",\n      \"transition-all disabled:pointer-events-none disabled:opacity-50\",\n      \"shrink-0 outline-none\",\n      \"focus-visible:ring-[3px]\",\n      // chatInputToolbarSecondary variant\n      \"cursor-pointer\",\n      \"bg-transparent text-[#444444]\",\n      \"dark:text-white dark:border-[#404040]\",\n      \"transition-colors\",\n      \"focus:outline-none\",\n      \"hover:bg-[#f8f8f8] hover:text-[#333333]\",\n      \"dark:hover:bg-[#404040] dark:hover:text-[#FFFFFF]\",\n      \"disabled:cursor-not-allowed disabled:opacity-50\",\n      \"disabled:hover:bg-transparent disabled:hover:text-[#444444]\",\n      \"dark:disabled:hover:bg-transparent dark:disabled:hover:text-[#CCCCCC]\",\n      // Size\n      \"h-9 px-3 gap-2 font-normal\"\n    );\n    return cn(baseClasses, this.customClass());\n  });\n\n  isMenuItem(item: any): item is ToolsMenuItem {\n    return item && typeof item === \"object\" && \"label\" in item;\n  }\n\n  handleItemClick(item: ToolsMenuItem): void {\n    if (item.action) {\n      item.action();\n    }\n  }\n}\n","import {\n  Component,\n  TemplateRef,\n  signal,\n  computed,\n  effect,\n  ChangeDetectionStrategy,\n  AfterViewInit,\n  OnDestroy,\n  Type,\n  ViewEncapsulation,\n  ContentChild,\n  input,\n  output,\n  ViewChild,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { CopilotSlot } from \"../../slots/copilot-slot\";\nimport { injectChatLabels } from \"../../chat-config\";\nimport { LucideAngularModule, ArrowUp } from \"lucide-angular\";\nimport { CopilotChatTextarea } from \"./copilot-chat-textarea\";\nimport { CopilotChatAudioRecorder } from \"./copilot-chat-audio-recorder\";\nimport {\n  CopilotChatStartTranscribeButton,\n  CopilotChatCancelTranscribeButton,\n  CopilotChatFinishTranscribeButton,\n  CopilotChatAddFileButton,\n} from \"./copilot-chat-buttons\";\nimport { CopilotChatToolbar } from \"./copilot-chat-toolbar\";\nimport { CopilotChatToolsMenu } from \"./copilot-chat-tools-menu\";\nimport type {\n  CopilotChatInputMode,\n  ToolsMenuItem,\n} from \"./copilot-chat-input.types\";\nimport { cn } from \"../../utils\";\nimport { injectChatState } from \"../../chat-state\";\n\n/**\n * Context provided to slot templates\n */\nexport interface SendButtonContext {\n  send: () => void;\n  disabled: boolean;\n  value: string;\n}\n\nexport interface ToolbarContext {\n  mode: CopilotChatInputMode;\n  value: string;\n}\n\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-input\",\n  imports: [\n    CommonModule,\n    CopilotSlot,\n    LucideAngularModule,\n    CopilotChatTextarea,\n    CopilotChatAudioRecorder,\n    CopilotChatStartTranscribeButton,\n    CopilotChatCancelTranscribeButton,\n    CopilotChatFinishTranscribeButton,\n    CopilotChatAddFileButton,\n    CopilotChatToolbar,\n    CopilotChatToolsMenu,\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <div [class]=\"computedClass()\">\n      <!-- Main input area: either textarea or audio recorder -->\n      @if (computedMode() === \"transcribe\") {\n        @if (audioRecorderTemplate || audioRecorderComponent()) {\n          <copilot-slot\n            [slot]=\"audioRecorderTemplate || audioRecorderComponent()\"\n            [context]=\"audioRecorderContext()\"\n            [defaultComponent]=\"defaultAudioRecorder\"\n          >\n          </copilot-slot>\n        } @else {\n          <copilot-chat-audio-recorder [inputShowControls]=\"true\">\n          </copilot-chat-audio-recorder>\n        }\n      } @else {\n        @if (textAreaTemplate || textAreaComponent()) {\n          <copilot-slot\n            [slot]=\"textAreaTemplate || textAreaComponent()\"\n            [context]=\"textAreaContext()\"\n          >\n          </copilot-slot>\n        } @else {\n          <textarea\n            copilotChatTextarea\n            [inputValue]=\"computedValue()\"\n            [inputAutoFocus]=\"computedAutoFocus()\"\n            [inputDisabled]=\"computedMode() === 'processing'\"\n            [inputClass]=\"textAreaClass()\"\n            [inputMaxRows]=\"textAreaMaxRows()\"\n            [inputPlaceholder]=\"textAreaPlaceholder()\"\n            (keyDown)=\"handleKeyDown($event)\"\n            (valueChange)=\"handleValueChange($event)\"\n          ></textarea>\n        }\n      }\n\n      <!-- Toolbar -->\n      @if (toolbarTemplate || toolbarComponent()) {\n        <copilot-slot\n          [slot]=\"toolbarTemplate || toolbarComponent()\"\n          [context]=\"toolbarContext()\"\n          [defaultComponent]=\"CopilotChatToolbar\"\n        >\n        </copilot-slot>\n      } @else {\n        <div copilotChatToolbar>\n          <div class=\"flex items-center\">\n            @if (addFileButtonTemplate || addFileButtonComponent()) {\n              <copilot-slot\n                [slot]=\"addFileButtonTemplate || addFileButtonComponent()\"\n                [context]=\"{ inputDisabled: computedMode() === 'transcribe' }\"\n                [outputs]=\"addFileButtonOutputs\"\n                [defaultComponent]=\"CopilotChatAddFileButton\"\n              >\n              </copilot-slot>\n            } @else {\n              <copilot-chat-add-file-button\n                [disabled]=\"computedMode() === 'transcribe'\"\n                (clicked)=\"handleAddFile()\"\n              >\n              </copilot-chat-add-file-button>\n            }\n            @if (computedToolsMenu().length > 0) {\n              @if (toolsButtonTemplate || toolsButtonComponent()) {\n                <copilot-slot\n                  [slot]=\"toolsButtonTemplate || toolsButtonComponent()\"\n                  [context]=\"toolsContext()\"\n                  [defaultComponent]=\"CopilotChatToolsMenu\"\n                >\n                </copilot-slot>\n              } @else {\n                <copilot-chat-tools-menu\n                  [inputToolsMenu]=\"computedToolsMenu()\"\n                  [inputDisabled]=\"computedMode() === 'transcribe'\"\n                >\n                </copilot-chat-tools-menu>\n              }\n            }\n            @if (additionalToolbarItems()) {\n              <ng-container\n                [ngTemplateOutlet]=\"additionalToolbarItems() || null\"\n              ></ng-container>\n            }\n          </div>\n          <div class=\"flex items-center\">\n            @if (computedMode() === \"transcribe\") {\n              @if (\n                cancelTranscribeButtonTemplate ||\n                cancelTranscribeButtonComponent()\n              ) {\n                <copilot-slot\n                  [slot]=\"\n                    cancelTranscribeButtonTemplate ||\n                    cancelTranscribeButtonComponent()\n                  \"\n                  [context]=\"{}\"\n                  [outputs]=\"cancelTranscribeButtonOutputs\"\n                  [defaultComponent]=\"CopilotChatCancelTranscribeButton\"\n                >\n                </copilot-slot>\n              } @else {\n                <copilot-chat-cancel-transcribe-button\n                  (clicked)=\"handleCancelTranscribe()\"\n                >\n                </copilot-chat-cancel-transcribe-button>\n              }\n              @if (\n                finishTranscribeButtonTemplate ||\n                finishTranscribeButtonComponent()\n              ) {\n                <copilot-slot\n                  [slot]=\"\n                    finishTranscribeButtonTemplate ||\n                    finishTranscribeButtonComponent()\n                  \"\n                  [context]=\"{}\"\n                  [outputs]=\"finishTranscribeButtonOutputs\"\n                  [defaultComponent]=\"CopilotChatFinishTranscribeButton\"\n                >\n                </copilot-slot>\n              } @else {\n                <copilot-chat-finish-transcribe-button\n                  (clicked)=\"handleFinishTranscribe()\"\n                >\n                </copilot-chat-finish-transcribe-button>\n              }\n            } @else {\n              @if (\n                startTranscribeButtonTemplate ||\n                startTranscribeButtonComponent()\n              ) {\n                <copilot-slot\n                  [slot]=\"\n                    startTranscribeButtonTemplate ||\n                    startTranscribeButtonComponent()\n                  \"\n                  [context]=\"{}\"\n                  [outputs]=\"startTranscribeButtonOutputs\"\n                  [defaultComponent]=\"CopilotChatStartTranscribeButton\"\n                >\n                </copilot-slot>\n              } @else {\n                <copilot-chat-start-transcribe-button\n                  (clicked)=\"handleStartTranscribe()\"\n                >\n                </copilot-chat-start-transcribe-button>\n              }\n              <!-- Send button with slot -->\n              @if (sendButtonTemplate || sendButtonComponent()) {\n                <copilot-slot\n                  [slot]=\"sendButtonTemplate || sendButtonComponent()\"\n                  [context]=\"sendButtonContext()\"\n                  [outputs]=\"sendButtonOutputs\"\n                >\n                </copilot-slot>\n              } @else {\n                <div class=\"mr-[10px]\">\n                  <button\n                    type=\"button\"\n                    [class]=\"sendButtonClass() || defaultButtonClass\"\n                    [disabled]=\"\n                      !computedValue().trim() || computedMode() === 'processing'\n                    \"\n                    (click)=\"send()\"\n                  >\n                    <lucide-angular\n                      [img]=\"ArrowUpIcon\"\n                      [size]=\"18\"\n                    ></lucide-angular>\n                  </button>\n                </div>\n              }\n            }\n          </div>\n        </div>\n      }\n    </div>\n  `,\n  styles: [\n    `\n      :host {\n        display: block;\n        width: 100%;\n      }\n      .shadow-\\\\[0_4px_4px_0_\\\\#0000000a\\\\2c_0_0_1px_0_\\\\#0000009e\\\\] {\n        box-shadow:\n          0 4px 4px 0 #0000000a,\n          0 0 1px 0 #0000009e !important;\n      }\n    `,\n  ],\n})\nexport class CopilotChatInput implements AfterViewInit, OnDestroy {\n  @ViewChild(CopilotChatTextarea, { read: CopilotChatTextarea })\n  textAreaRef?: CopilotChatTextarea;\n\n  @ViewChild(CopilotChatAudioRecorder)\n  audioRecorderRef?: CopilotChatAudioRecorder;\n\n  // Capture templates from content projection\n  @ContentChild(\"sendButton\", { read: TemplateRef })\n  sendButtonTemplate?: TemplateRef<SendButtonContext>;\n  @ContentChild(\"toolbar\", { read: TemplateRef })\n  toolbarTemplate?: TemplateRef<ToolbarContext>;\n  @ContentChild(\"textArea\", { read: TemplateRef })\n  textAreaTemplate?: TemplateRef<any>;\n  @ContentChild(\"audioRecorder\", { read: TemplateRef })\n  audioRecorderTemplate?: TemplateRef<any>;\n  @ContentChild(\"startTranscribeButton\", { read: TemplateRef })\n  startTranscribeButtonTemplate?: TemplateRef<any>;\n  @ContentChild(\"cancelTranscribeButton\", { read: TemplateRef })\n  cancelTranscribeButtonTemplate?: TemplateRef<any>;\n  @ContentChild(\"finishTranscribeButton\", { read: TemplateRef })\n  finishTranscribeButtonTemplate?: TemplateRef<any>;\n  @ContentChild(\"addFileButton\", { read: TemplateRef })\n  addFileButtonTemplate?: TemplateRef<any>;\n  @ContentChild(\"toolsButton\", { read: TemplateRef })\n  toolsButtonTemplate?: TemplateRef<any>;\n\n  // Class inputs for styling default components\n  sendButtonClass = input<string | undefined>(undefined);\n  toolbarClass = input<string | undefined>(undefined);\n  textAreaClass = input<string | undefined>(undefined);\n  textAreaMaxRows = input<number | undefined>(undefined);\n  textAreaPlaceholder = input<string | undefined>(undefined);\n  audioRecorderClass = input<string | undefined>(undefined);\n  startTranscribeButtonClass = input<string | undefined>(undefined);\n  cancelTranscribeButtonClass = input<string | undefined>(undefined);\n  finishTranscribeButtonClass = input<string | undefined>(undefined);\n  addFileButtonClass = input<string | undefined>(undefined);\n  toolsButtonClass = input<string | undefined>(undefined);\n\n  // Component inputs for overrides\n  sendButtonComponent = input<Type<any> | undefined>(undefined);\n  toolbarComponent = input<Type<any> | undefined>(undefined);\n  textAreaComponent = input<Type<any> | undefined>(undefined);\n  audioRecorderComponent = input<Type<any> | undefined>(undefined);\n  startTranscribeButtonComponent = input<Type<any> | undefined>(undefined);\n  cancelTranscribeButtonComponent = input<Type<any> | undefined>(undefined);\n  finishTranscribeButtonComponent = input<Type<any> | undefined>(undefined);\n  addFileButtonComponent = input<Type<any> | undefined>(undefined);\n  toolsButtonComponent = input<Type<any> | undefined>(undefined);\n\n  // Regular inputs\n  mode = input<CopilotChatInputMode | undefined>(undefined);\n  toolsMenu = input<(ToolsMenuItem | \"-\")[] | undefined>(undefined);\n  autoFocus = input<boolean | undefined>(undefined);\n  value = input<string | undefined>(undefined);\n  inputClass = input<string | undefined>(undefined);\n  // Note: Prefer host `class` for styling this component;\n  // keep only `inputClass` to style the internal wrapper if needed.\n  additionalToolbarItems = input<TemplateRef<any> | undefined>(undefined);\n\n  // Output events\n  submitMessage = output<string>();\n  startTranscribe = output<void>();\n  cancelTranscribe = output<void>();\n  finishTranscribe = output<void>();\n  addFile = output<void>();\n  valueChange = output<string>();\n\n  // Icons and default classes\n  readonly ArrowUpIcon = ArrowUp;\n  readonly defaultButtonClass = cn(\n    // Base button styles\n    \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium\",\n    \"transition-all disabled:pointer-events-none disabled:opacity-50\",\n    \"shrink-0 outline-none\",\n    \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n    // chatInputToolbarPrimary variant\n    \"cursor-pointer\",\n    \"bg-black text-white\",\n    \"dark:bg-white dark:text-black dark:focus-visible:outline-white\",\n    \"rounded-full h-9 w-9\",\n    \"transition-colors\",\n    \"focus:outline-none\",\n    \"hover:opacity-70 disabled:hover:opacity-100\",\n    \"disabled:cursor-not-allowed disabled:bg-[#00000014] disabled:text-[rgb(13,13,13)]\",\n    \"dark:disabled:bg-[#454545] dark:disabled:text-white\"\n  );\n\n  // Services\n  readonly labels = injectChatLabels();\n  // readonly chatConfig = injectChatConfig();\n  readonly chatState = injectChatState();\n\n  // Signals\n  modeSignal = signal<CopilotChatInputMode>(\"input\");\n  toolsMenuSignal = signal<(ToolsMenuItem | \"-\")[]>([]);\n  autoFocusSignal = signal<boolean>(true);\n  customClass = signal<string | undefined>(undefined);\n\n  // Default components\n  // Note: CopilotChatTextarea uses attribute selector but is a component\n  defaultAudioRecorder = CopilotChatAudioRecorder;\n  defaultSendButton: any = null; // Will be set to avoid circular dependency\n  CopilotChatToolbar = CopilotChatToolbar;\n  CopilotChatAddFileButton = CopilotChatAddFileButton;\n  CopilotChatToolsMenu = CopilotChatToolsMenu;\n  CopilotChatCancelTranscribeButton = CopilotChatCancelTranscribeButton;\n  CopilotChatFinishTranscribeButton = CopilotChatFinishTranscribeButton;\n  CopilotChatStartTranscribeButton = CopilotChatStartTranscribeButton;\n\n  // Computed values\n  computedMode = computed(() => this.modeSignal());\n  computedToolsMenu = computed(() => this.toolsMenu() ?? []);\n  computedAutoFocus = computed(() => this.autoFocus() ?? true);\n  computedValue = computed(() => {\n    const customValue = this.value() ?? \"\";\n    const configValue = this.chatState.inputValue();\n    return customValue || configValue || \"\";\n  });\n\n  computedClass = computed(() => {\n    const baseClasses = cn(\n      // Layout\n      \"flex w-full flex-col items-center justify-center\",\n      // Interaction\n      \"cursor-text\",\n      // Overflow and clipping\n      \"overflow-visible bg-clip-padding contain-inline-size\",\n      // Background\n      \"bg-white dark:bg-[#303030]\",\n      // Visual effects\n      \"shadow-[0_4px_4px_0_#0000000a,0_0_1px_0_#0000009e] rounded-[28px]\"\n    );\n    return cn(baseClasses, this.customClass());\n  });\n\n  // Context for slots (reactive via signals)\n  sendButtonContext = computed<SendButtonContext>(() => ({\n    send: () => this.send(),\n    disabled:\n      !this.computedValue().trim() || this.computedMode() === \"processing\",\n    value: this.computedValue(),\n  }));\n\n  toolbarContext = computed<ToolbarContext>(() => ({\n    mode: this.computedMode(),\n    value: this.computedValue(),\n  }));\n\n  textAreaContext = computed(() => ({\n    value: this.computedValue(),\n    autoFocus: this.computedAutoFocus(),\n    disabled: this.computedMode() === \"processing\",\n    maxRows: this.textAreaMaxRows(),\n    placeholder: this.textAreaPlaceholder(),\n    inputClass: this.textAreaClass(),\n    onKeyDown: (event: KeyboardEvent) => this.handleKeyDown(event),\n    onChange: (value: string) => this.handleValueChange(value),\n  }));\n\n  audioRecorderContext = computed(() => ({\n    inputShowControls: true,\n  }));\n\n  // Button contexts removed - now using outputs map for click handlers\n\n  toolsContext = computed(() => ({\n    inputToolsMenu: this.computedToolsMenu(),\n    inputDisabled: this.computedMode() === \"transcribe\",\n  }));\n\n  constructor() {\n    // Effect to handle mode changes (no signal writes)\n    effect(() => {\n      const currentMode = this.computedMode();\n      if (currentMode === \"transcribe\" && this.audioRecorderRef) {\n        this.audioRecorderRef.start().catch(console.error);\n      } else if (this.audioRecorderRef?.getState() === \"recording\") {\n        this.audioRecorderRef.stop().catch(console.error);\n      }\n    });\n  }\n\n  // Output maps for slots\n  addFileButtonOutputs = { clicked: () => this.handleAddFile() };\n  cancelTranscribeButtonOutputs = {\n    clicked: () => this.handleCancelTranscribe(),\n  };\n  finishTranscribeButtonOutputs = {\n    clicked: () => this.handleFinishTranscribe(),\n  };\n  startTranscribeButtonOutputs = {\n    clicked: () => this.handleStartTranscribe(),\n  };\n  // Support both `clicked` (idiomatic in our slots) and `click` (legacy)\n  sendButtonOutputs = { clicked: () => this.send(), click: () => this.send() };\n\n  ngAfterViewInit(): void {\n    // Auto-focus if needed\n    if (this.computedAutoFocus() && this.textAreaRef) {\n      setTimeout(() => {\n        this.textAreaRef?.focus();\n      });\n    }\n  }\n\n  ngOnDestroy(): void {\n    // Clean up any resources\n    if (this.audioRecorderRef?.getState() === \"recording\") {\n      this.audioRecorderRef?.stop().catch(console.error);\n    }\n  }\n\n  handleKeyDown(event: KeyboardEvent): void {\n    if (event.key === \"Enter\" && !event.shiftKey) {\n      event.preventDefault();\n      this.send();\n    }\n  }\n\n  handleValueChange(value: string): void {\n    this.valueChange.emit(value);\n    if (this.chatState) this.chatState.changeInput(value);\n  }\n\n  send(): void {\n    const trimmed = this.computedValue().trim();\n    if (trimmed) {\n      this.submitMessage.emit(trimmed);\n\n      this.chatState.submitInput(trimmed);\n\n      if (this.chatState) this.chatState.changeInput(\"\");\n      if (this.textAreaRef) this.textAreaRef.setValue(\"\");\n\n      // Refocus input\n      if (this.textAreaRef) {\n        setTimeout(() => {\n          this.textAreaRef?.focus();\n        });\n      }\n    }\n  }\n\n  handleStartTranscribe(): void {\n    this.startTranscribe.emit();\n    this.modeSignal.set(\"transcribe\");\n  }\n\n  handleCancelTranscribe(): void {\n    this.cancelTranscribe.emit();\n    this.modeSignal.set(\"input\");\n  }\n\n  handleFinishTranscribe(): void {\n    this.finishTranscribe.emit();\n    this.modeSignal.set(\"input\");\n  }\n\n  handleAddFile(): void {\n    this.addFile.emit();\n  }\n}\n","import {\n  Component,\n  input,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { cn } from \"../..//utils\";\nimport { injectChatLabels } from \"../../chat-config\";\n\n/**\n * Disclaimer component for CopilotChatView\n * Shows configurable disclaimer text below the input\n * Integrates with CopilotChatConfigurationService for labels\n */\n@Component({\n  selector: \"copilot-chat-view-disclaimer\",\n  standalone: true,\n  imports: [CommonModule],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <div [class]=\"computedClass\">\n      {{ disclaimerText }}\n    </div>\n  `,\n})\nexport class CopilotChatViewDisclaimer {\n  inputClass = input<string | undefined>();\n  text = input<string | undefined>();\n\n  readonly labels = injectChatLabels();\n\n  // Get disclaimer text from input or configuration\n  get disclaimerText(): string {\n    if (this.text()) {\n      return this.text() as string;\n    }\n\n    return this.labels.chatDisclaimerText;\n  }\n\n  // Computed class matching React exactly\n  get computedClass(): string {\n    return cn(\n      \"text-center text-xs text-muted-foreground py-3 px-4 max-w-3xl mx-auto\",\n      this.inputClass()\n    );\n  }\n}\n","import {\n  Component,\n  input,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n  forwardRef,\n  ElementRef,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { CopilotSlot } from \"../../slots/copilot-slot\";\nimport { CopilotChatInput } from \"./copilot-chat-input\";\nimport { CopilotChatViewDisclaimer } from \"./copilot-chat-view-disclaimer\";\nimport { cn } from \"../../utils\";\n\n/**\n * InputContainer component for CopilotChatView\n * Container for input and disclaimer components\n * Uses ForwardRef for DOM access\n */\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-view-input-container\",\n  imports: [CommonModule, CopilotSlot],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  providers: [\n    {\n      provide: ElementRef,\n      useExisting: forwardRef(() => CopilotChatViewInputContainer),\n    },\n  ],\n  template: `\n    <div [class]=\"computedClass\">\n      <!-- Input component -->\n      <div class=\"max-w-3xl mx-auto py-0 px-4 sm:px-0\">\n        <copilot-slot\n          [slot]=\"input()\"\n          [context]=\"{ inputClass: inputClass() }\"\n          [defaultComponent]=\"defaultInputComponent\"\n        >\n        </copilot-slot>\n      </div>\n\n      <!-- Disclaimer - always rendered like in React -->\n      <copilot-slot\n        [slot]=\"disclaimer()\"\n        [context]=\"{ text: disclaimerText(), inputClass: disclaimerClass() }\"\n        [defaultComponent]=\"defaultDisclaimerComponent\"\n      >\n      </copilot-slot>\n    </div>\n  `,\n})\nexport class CopilotChatViewInputContainer extends ElementRef {\n  inputContainerClass = input<string | undefined>();\n\n  // Input slot configuration\n  input = input<any | undefined>();\n  inputClass = input<string | undefined>();\n\n  // Disclaimer slot configuration\n  disclaimer = input<any | undefined>();\n  disclaimerText = input<string | undefined>();\n  disclaimerClass = input<string | undefined>();\n\n  // Default components\n  protected readonly defaultInputComponent = CopilotChatInput;\n  protected readonly defaultDisclaimerComponent = CopilotChatViewDisclaimer;\n\n  constructor(elementRef: ElementRef) {\n    super(elementRef.nativeElement);\n  }\n\n  get computedClass(): string {\n    return cn(\n      \"absolute bottom-0 left-0 right-0 z-20\",\n      this.inputContainerClass()\n    );\n  }\n}\n","import {\n  Component,\n  ContentChild,\n  TemplateRef,\n  Type,\n  ViewChild,\n  ElementRef,\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n  ViewEncapsulation,\n  computed,\n  signal,\n  OnInit,\n  OnChanges,\n  OnDestroy,\n  AfterViewInit,\n  input,\n  output,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { CopilotSlot } from \"../../slots/copilot-slot\";\nimport { CopilotChatViewScrollView } from \"./copilot-chat-view-scroll-view\";\nimport { CopilotChatViewScrollToBottomButton } from \"./copilot-chat-view-scroll-to-bottom-button\";\nimport { CopilotChatViewFeather } from \"./copilot-chat-view-feather\";\nimport { CopilotChatViewInputContainer } from \"./copilot-chat-view-input-container\";\nimport { CopilotChatViewDisclaimer } from \"./copilot-chat-view-disclaimer\";\nimport { Message } from \"@ag-ui/client\";\nimport { cn } from \"../../utils\";\nimport { ResizeObserverService } from \"../../resize-observer\";\nimport { CopilotChatViewHandlers } from \"./copilot-chat-view-handlers\";\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\n\n/**\n * CopilotChatView component - Angular port of the React component.\n * A complete chat interface with message feed and input components.\n *\n * @example\n * ```html\n * <copilot-chat-view\n *   [messages]=\"messages\"\n *   [autoScroll]=\"true\"\n *   [messageViewProps]=\"{ assistantMessage: { onThumbsUp: handleThumbsUp } }\">\n * </copilot-chat-view>\n * ```\n */\n@Component({\n  standalone: true,\n  selector: \"copilot-chat-view\",\n  imports: [CommonModule, CopilotSlot, CopilotChatViewScrollView],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  providers: [ResizeObserverService, CopilotChatViewHandlers],\n  template: `\n    <!-- Custom layout template support (render prop pattern) -->\n    @if (customLayoutTemplate) {\n      <ng-container\n        [ngTemplateOutlet]=\"customLayoutTemplate\"\n        [ngTemplateOutletContext]=\"layoutContext()\"\n      ></ng-container>\n    } @else {\n      <!-- Default layout - exact React DOM structure -->\n      <div [class]=\"computedClass()\">\n        <!-- ScrollView -->\n        <copilot-chat-view-scroll-view\n          [autoScroll]=\"autoScrollSignal()\"\n          [inputContainerHeight]=\"inputContainerHeight()\"\n          [isResizing]=\"isResizing()\"\n          [messages]=\"messagesValue()\"\n          [messageView]=\"messageViewSlot()\"\n          [messageViewClass]=\"messageViewClass()\"\n          [scrollToBottomButton]=\"scrollToBottomButtonSlot()\"\n          [scrollToBottomButtonClass]=\"scrollToBottomButtonClass()\"\n          [showCursor]=\"showCursorSignal()\"\n          (assistantMessageThumbsUp)=\"assistantMessageThumbsUp.emit($event)\"\n          (assistantMessageThumbsDown)=\"assistantMessageThumbsDown.emit($event)\"\n          (assistantMessageReadAloud)=\"assistantMessageReadAloud.emit($event)\"\n          (assistantMessageRegenerate)=\"assistantMessageRegenerate.emit($event)\"\n          (userMessageCopy)=\"userMessageCopy.emit($event)\"\n          (userMessageEdit)=\"userMessageEdit.emit($event)\"\n        >\n        </copilot-chat-view-scroll-view>\n\n        <!-- Feather effect -->\n        <copilot-slot\n          [slot]=\"featherSlot()\"\n          [context]=\"{ inputClass: featherClass }\"\n          [defaultComponent]=\"defaultFeatherComponent\"\n        >\n        </copilot-slot>\n\n        <!-- Input container -->\n        <copilot-slot\n          #inputContainerSlotRef\n          [slot]=\"inputContainerSlot()\"\n          [context]=\"inputContainerContext()\"\n          [defaultComponent]=\"defaultInputContainerComponent\"\n        >\n        </copilot-slot>\n      </div>\n    }\n  `,\n})\nexport class CopilotChatView\n  implements OnInit, OnChanges, AfterViewInit, OnDestroy\n{\n  // Core inputs matching React props\n  messages = input<Message[]>([]);\n  autoScroll = input<boolean>(true);\n  showCursor = input<boolean>(false);\n\n  // MessageView slot inputs\n  messageViewComponent = input<Type<any> | undefined>(undefined);\n  messageViewTemplate = input<TemplateRef<any> | undefined>(undefined);\n  messageViewClass = input<string | undefined>(undefined);\n\n  // ScrollView slot inputs\n  scrollViewComponent = input<Type<any> | undefined>(undefined);\n  scrollViewTemplate = input<TemplateRef<any> | undefined>(undefined);\n  scrollViewClass = input<string | undefined>(undefined);\n\n  // ScrollToBottomButton slot inputs\n  scrollToBottomButtonComponent = input<Type<any> | undefined>(undefined);\n  scrollToBottomButtonTemplate = input<TemplateRef<any> | undefined>(undefined);\n  scrollToBottomButtonClass = input<string | undefined>(undefined);\n\n  // Input slot inputs\n  inputComponent = input<Type<any> | undefined>(undefined);\n  inputTemplate = input<TemplateRef<any> | undefined>(undefined);\n\n  // InputContainer slot inputs\n  inputContainerComponent = input<Type<any> | undefined>(undefined);\n  inputContainerTemplate = input<TemplateRef<any> | undefined>(undefined);\n  inputContainerClass = input<string | undefined>(undefined);\n\n  // Feather slot inputs\n  featherComponent = input<Type<any> | undefined>(undefined);\n  featherTemplate = input<TemplateRef<any> | undefined>(undefined);\n  featherClass = input<string | undefined>(undefined);\n\n  // Disclaimer slot inputs\n  disclaimerComponent = input<Type<any> | undefined>(undefined);\n  disclaimerTemplate = input<TemplateRef<any> | undefined>(undefined);\n  disclaimerClass = input<string | undefined>(undefined);\n  disclaimerText = input<string | undefined>(undefined);\n\n  // Custom layout template (render prop pattern)\n  @ContentChild(\"customLayout\") customLayoutTemplate?: TemplateRef<any>;\n\n  // Named template slots for deep customization\n  @ContentChild(\"sendButton\") sendButtonTemplate?: TemplateRef<any>;\n  @ContentChild(\"toolbar\") toolbarTemplate?: TemplateRef<any>;\n  @ContentChild(\"textArea\") textAreaTemplate?: TemplateRef<any>;\n  @ContentChild(\"audioRecorder\") audioRecorderTemplate?: TemplateRef<any>;\n  @ContentChild(\"assistantMessageMarkdownRenderer\")\n  assistantMessageMarkdownRendererTemplate?: TemplateRef<any>;\n  @ContentChild(\"thumbsUpButton\") thumbsUpButtonTemplate?: TemplateRef<any>;\n  @ContentChild(\"thumbsDownButton\") thumbsDownButtonTemplate?: TemplateRef<any>;\n  @ContentChild(\"readAloudButton\") readAloudButtonTemplate?: TemplateRef<any>;\n  @ContentChild(\"regenerateButton\") regenerateButtonTemplate?: TemplateRef<any>;\n\n  // Output events for assistant message actions (bubbled from child components)\n  assistantMessageThumbsUp = output<{ message: Message }>();\n  assistantMessageThumbsDown = output<{ message: Message }>();\n  assistantMessageReadAloud = output<{ message: Message }>();\n  assistantMessageRegenerate = output<{ message: Message }>();\n\n  // Output events for user message actions (if applicable)\n  userMessageCopy = output<{ message: Message }>();\n  userMessageEdit = output<{ message: Message }>();\n\n  // ViewChild references\n  @ViewChild(\"inputContainerSlotRef\", { read: ElementRef })\n  inputContainerSlotRef?: ElementRef;\n\n  // Default components for slots\n  protected readonly defaultScrollViewComponent = CopilotChatViewScrollView;\n  protected readonly defaultScrollToBottomButtonComponent =\n    CopilotChatViewScrollToBottomButton;\n  protected readonly defaultInputContainerComponent =\n    CopilotChatViewInputContainer;\n  protected readonly defaultFeatherComponent = CopilotChatViewFeather;\n  protected readonly defaultDisclaimerComponent = CopilotChatViewDisclaimer;\n\n  // Signals for reactive state\n  protected messagesValue = computed(() => this.messages());\n  protected autoScrollSignal = computed(() => this.autoScroll());\n  protected showCursorSignal = computed(() => this.showCursor());\n  protected disclaimerTextSignal = computed(() => this.disclaimerText());\n  protected disclaimerClassSignal = computed(() => this.disclaimerClass());\n  protected inputContainerHeight = signal<number>(0);\n  protected isResizing = signal<boolean>(false);\n  protected contentPaddingBottom = computed(\n    () => this.inputContainerHeight() + 32\n  );\n\n  // Computed signals\n  protected computedClass = computed(() => cn(\"relative h-full\"));\n\n  // Slot resolution computed signals\n  protected messageViewSlot = computed(\n    () => this.messageViewTemplate() || this.messageViewComponent()\n  );\n\n  protected scrollViewSlot = computed(\n    () => this.scrollViewTemplate() || this.scrollViewComponent()\n  );\n\n  protected scrollToBottomButtonSlot = computed(\n    () =>\n      this.scrollToBottomButtonTemplate() ||\n      this.scrollToBottomButtonComponent()\n  );\n\n  protected inputSlot = computed(\n    () => this.inputTemplate() || this.inputComponent()\n  );\n\n  protected inputContainerSlot = computed(\n    () => this.inputContainerTemplate() || this.inputContainerComponent()\n  );\n\n  protected featherSlot = computed(\n    () => this.featherTemplate() || this.featherComponent()\n  );\n\n  protected disclaimerSlot = computed(\n    () => this.disclaimerTemplate() || this.disclaimerComponent()\n  );\n\n  // Context objects for slots\n  protected scrollViewContext = computed(() => ({\n    autoScroll: this.autoScrollSignal(),\n    scrollToBottomButton: this.scrollToBottomButtonSlot(),\n    scrollToBottomButtonClass: this.scrollToBottomButtonClass(),\n    inputContainerHeight: this.inputContainerHeight(),\n    isResizing: this.isResizing(),\n    messages: this.messagesValue(),\n    messageView: this.messageViewSlot(),\n    messageViewClass: this.messageViewClass(),\n  }));\n\n  // Removed scrollViewPropsComputed - no longer needed\n\n  protected inputContainerContext = computed(() => ({\n    input: this.inputSlot(),\n    disclaimer: this.disclaimerSlot(),\n    disclaimerText: this.disclaimerTextSignal(),\n    disclaimerClass: this.disclaimerClassSignal(),\n    inputContainerClass: this.inputContainerClass(),\n  }));\n\n  // Removed inputContainerPropsComputed - no longer needed\n\n  // Layout context for custom templates (render prop pattern)\n  protected layoutContext = computed(() => ({\n    messageView: this.messageViewSlot(),\n    input: this.inputSlot(),\n    scrollView: this.scrollViewSlot(),\n    scrollToBottomButton: this.scrollToBottomButtonSlot(),\n    feather: this.featherSlot(),\n    inputContainer: this.inputContainerSlot(),\n    disclaimer: this.disclaimerSlot(),\n  }));\n\n  private destroy$ = new Subject<void>();\n  private resizeTimeoutRef?: number;\n\n  constructor(\n    private resizeObserverService: ResizeObserverService,\n    private cdr: ChangeDetectorRef,\n    private handlers: CopilotChatViewHandlers\n  ) {\n    // Clear any pending resize timeout when toggling isResizing, without signal writes here\n  }\n\n  ngOnInit(): void {\n    // Initialize handler availability in the view-scoped service\n    // OutputEmitterRef doesn't expose 'observed'; default to true to enable UI affordances\n    this.handlers.hasAssistantThumbsUpHandler.set(true);\n    this.handlers.hasAssistantThumbsDownHandler.set(true);\n    this.handlers.hasAssistantReadAloudHandler.set(true);\n    this.handlers.hasAssistantRegenerateHandler.set(true);\n    this.handlers.hasUserCopyHandler.set(true);\n    this.handlers.hasUserEditHandler.set(true);\n  }\n\n  ngOnChanges(): void {\n    // Keep handler availability in sync (assume available)\n    this.handlers.hasAssistantThumbsUpHandler.set(true);\n    this.handlers.hasAssistantThumbsDownHandler.set(true);\n    this.handlers.hasAssistantReadAloudHandler.set(true);\n    this.handlers.hasAssistantRegenerateHandler.set(true);\n    this.handlers.hasUserCopyHandler.set(true);\n    this.handlers.hasUserEditHandler.set(true);\n  }\n\n  ngAfterViewInit(): void {\n    // Don't set a default height - measure it dynamically\n\n    // Set up input container height monitoring\n    const measureAndObserve = () => {\n      if (\n        !this.inputContainerSlotRef ||\n        !this.inputContainerSlotRef.nativeElement\n      ) {\n        return false;\n      }\n\n      // The slot ref points to the copilot-slot element\n      // We need to find the actual input container component inside it\n      const slotElement = this.inputContainerSlotRef.nativeElement;\n      const componentElement = slotElement.querySelector(\n        \"copilot-chat-view-input-container\"\n      );\n\n      if (!componentElement) {\n        return false;\n      }\n\n      // Look for the absolute positioned div that contains the input\n      let innerDiv = componentElement.querySelector(\n        \"div.absolute\"\n      ) as HTMLElement;\n\n      // If not found by class, try first child\n      if (!innerDiv) {\n        innerDiv = componentElement.firstElementChild as HTMLElement;\n      }\n\n      if (!innerDiv) {\n        return false;\n      }\n\n      // Measure the actual height\n      const measuredHeight = innerDiv.offsetHeight;\n\n      if (measuredHeight === 0) {\n        return false;\n      }\n\n      // Success! Set the initial height\n      this.inputContainerHeight.set(measuredHeight);\n      this.cdr.detectChanges();\n\n      // Create an ElementRef wrapper for ResizeObserver\n      const innerDivRef = new ElementRef(innerDiv);\n\n      // Set up ResizeObserver to track changes\n      this.resizeObserverService\n        .observeElement(innerDivRef, 0, 250)\n        .pipe(takeUntil(this.destroy$))\n        .subscribe((state) => {\n          const newHeight = state.height;\n\n          if (newHeight !== this.inputContainerHeight() && newHeight > 0) {\n            this.inputContainerHeight.set(newHeight);\n            this.isResizing.set(true);\n            this.cdr.detectChanges();\n\n            // Clear existing timeout\n            if (this.resizeTimeoutRef) {\n              clearTimeout(this.resizeTimeoutRef);\n            }\n\n            // Set isResizing to false after a short delay\n            this.resizeTimeoutRef = window.setTimeout(() => {\n              this.isResizing.set(false);\n              this.resizeTimeoutRef = undefined;\n              this.cdr.detectChanges();\n            }, 250);\n          }\n        });\n\n      return true;\n    };\n\n    // Try to measure immediately\n    if (!measureAndObserve()) {\n      // If failed, retry with increasing delays\n      let attempts = 0;\n      const maxAttempts = 10;\n\n      const retry = () => {\n        attempts++;\n        if (measureAndObserve()) {\n          // Successfully measured\n        } else if (attempts < maxAttempts) {\n          // Exponential backoff: 50ms, 100ms, 200ms, 400ms, etc.\n          const delay = 50 * Math.pow(2, Math.min(attempts - 1, 4));\n          setTimeout(retry, delay);\n        } else {\n          // Failed to measure after max attempts\n        }\n      };\n\n      // Start retry with first delay\n      setTimeout(retry, 50);\n    }\n  }\n\n  ngOnDestroy(): void {\n    if (this.resizeTimeoutRef) {\n      clearTimeout(this.resizeTimeoutRef);\n    }\n    this.destroy$.next();\n    this.destroy$.complete();\n  }\n}\n","import {\n  Component,\n  input,\n  ChangeDetectionStrategy,\n  ViewEncapsulation,\n  signal,\n  effect,\n  ChangeDetectorRef,\n  Injector,\n  Type,\n  computed,\n  inject,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { CopilotChatView } from \"./copilot-chat-view\";\n\nimport { DEFAULT_AGENT_ID, randomUUID } from \"@copilotkitnext/shared\";\nimport { Message, AbstractAgent } from \"@ag-ui/client\";\nimport { injectAgentStore } from \"../../agent\";\nimport { ChatState } from \"../../chat-state\";\n\n/**\n * CopilotChat component - Angular equivalent of React's <CopilotChat>\n * Provides a complete chat interface that wires an agent to the chat view\n *\n * @example\n * ```html\n * <copilot-chat [agentId]=\"'default'\" [threadId]=\"'abc123'\"></copilot-chat>\n * ```\n */\n@Component({\n  selector: \"copilot-chat\",\n  standalone: true,\n  imports: [CommonModule, CopilotChatView],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  template: `\n    <copilot-chat-view\n      [messages]=\"messages() ?? []\"\n      [autoScroll]=\"true\"\n      [messageViewClass]=\"'w-full'\"\n      [showCursor]=\"showCursor()\"\n      [inputComponent]=\"inputComponent()\"\n    >\n    </copilot-chat-view>\n  `,\n  providers: [\n    {\n      provide: ChatState,\n      useExisting: CopilotChat,\n    },\n  ],\n})\nexport class CopilotChat implements ChatState {\n  readonly inputValue = signal<string>(\"\");\n  readonly agentId = input<string | undefined>();\n  readonly threadId = input<string | undefined>();\n  readonly inputComponent = input<Type<any> | undefined>();\n  private readonly resolvedAgentId = computed(\n    () => this.agentId() ?? DEFAULT_AGENT_ID\n  );\n  readonly agentStore = injectAgentStore(this.resolvedAgentId);\n  // readonly chatConfig = injectChatConfig();\n  readonly cdr = inject(ChangeDetectorRef);\n  readonly injector = inject(Injector);\n\n  protected messages = computed(() => this.agentStore()?.messages());\n  protected isRunning = computed(() => this.agentStore()?.isRunning());\n  protected showCursor = signal<boolean>(false);\n\n  private generatedThreadId: string = randomUUID();\n  private hasConnectedOnce = false;\n\n  constructor() {\n    // Connect once when agent becomes available\n    // Connect once when agent becomes available\n    effect(\n      () => {\n        const a = this.agentStore()?.agent;\n        if (!a) return;\n        // Apply thread id when agent is available\n        a.threadId = this.threadId() || this.generatedThreadId;\n        if (!this.hasConnectedOnce) {\n          this.hasConnectedOnce = true;\n          if (\"isCopilotKitAgent\" in (a as any)) {\n            this.connectToAgent(a);\n          } else {\n            // Non-CopilotKit agent: nothing to connect; keep default cursor state\n          }\n        }\n      },\n      { allowSignalWrites: true }\n    );\n\n    // Keep agent threadId in sync with input\n    effect(() => {\n      const a = this.agentStore()?.agent;\n      if (a) {\n        a.threadId = this.threadId() || this.generatedThreadId;\n      }\n    });\n  }\n\n  private async connectToAgent(agent: AbstractAgent): Promise<void> {\n    if (!agent) return;\n\n    this.showCursor.set(true);\n    this.cdr.markForCheck();\n\n    try {\n      await agent.runAgent(\n        { forwardedProps: { __copilotkitConnect: true } },\n        {\n          onTextMessageStartEvent: () => {\n            this.showCursor.set(false);\n            this.cdr.detectChanges();\n          },\n          onToolCallStartEvent: () => {\n            this.showCursor.set(false);\n            this.cdr.detectChanges();\n          },\n        }\n      );\n      this.showCursor.set(false);\n      this.cdr.markForCheck();\n    } catch (error) {\n      console.error(\"Failed to connect to agent:\", error);\n      this.showCursor.set(false);\n      this.cdr.markForCheck();\n    }\n  }\n\n  async submitInput(value: string): Promise<void> {\n    const agent = this.agentStore()?.agent;\n    if (!agent || !value.trim()) return;\n\n    // Add user message\n    const userMessage: Message = {\n      id: randomUUID(),\n      role: \"user\",\n      content: value,\n    };\n    agent.addMessage(userMessage);\n\n    // Clear the input\n    this.inputValue.set(\"\");\n\n    // Show cursor while processing\n    this.showCursor.set(true);\n    this.cdr.markForCheck();\n\n    // Run the agent with named subscriber callbacks\n    try {\n      await agent.runAgent(\n        {},\n        {\n          onTextMessageStartEvent: () => {\n            this.showCursor.set(false);\n            this.cdr.detectChanges();\n          },\n          onToolCallStartEvent: () => {\n            this.showCursor.set(false);\n            this.cdr.detectChanges();\n          },\n        }\n      );\n    } catch (error) {\n      console.error(\"Agent run error:\", error);\n    } finally {\n      this.showCursor.set(false);\n      this.cdr.markForCheck();\n    }\n  }\n\n  changeInput(value: string): void {\n    this.inputValue.set(value);\n  }\n}\n","import { CopilotChatTextarea } from \"./copilot-chat-textarea\";\nimport { CopilotChatAudioRecorder } from \"./copilot-chat-audio-recorder\";\nimport {\n  CopilotChatSendButton,\n  CopilotChatStartTranscribeButton,\n  CopilotChatCancelTranscribeButton,\n  CopilotChatFinishTranscribeButton,\n  CopilotChatAddFileButton,\n} from \"./copilot-chat-buttons\";\nimport { CopilotChatToolbar } from \"./copilot-chat-toolbar\";\nimport { CopilotChatToolsMenu } from \"./copilot-chat-tools-menu\";\n\n/**\n * Default components used by CopilotChatInput.\n * These can be imported and reused when creating custom slot implementations.\n *\n * @example\n * ```typescript\n * import { CopilotChatInputDefaults } from '@copilotkitnext/angular';\n *\n * @Component({\n  standalone: true,\n*   template: `\n *     <copilot-chat-input [sendButtonSlot]=\"CustomSendButton\">\n *     </copilot-chat-input>\n *   `\n * })\n * export class MyComponent {\n *   CustomSendButton = class extends CopilotChatInputDefaults.SendButton {\n *     // Custom implementation\n *   };\n * }\n * ```\n */\nexport class CopilotChatInputDefaults {\n  static readonly TextArea = CopilotChatTextarea;\n  static readonly AudioRecorder = CopilotChatAudioRecorder;\n  static readonly SendButton = CopilotChatSendButton;\n  static readonly StartTranscribeButton = CopilotChatStartTranscribeButton;\n  static readonly CancelTranscribeButton = CopilotChatCancelTranscribeButton;\n  static readonly FinishTranscribeButton = CopilotChatFinishTranscribeButton;\n  static readonly AddFileButton = CopilotChatAddFileButton;\n  static readonly Toolbar = CopilotChatToolbar;\n  static readonly ToolsMenu = CopilotChatToolsMenu;\n}\n"]}