import type{LyraEventDetailSnapshot}from'../../../internal/lyra-element.js';import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{Citation,CitationSelectEventDetail,DocumentRef,GroundedClaim,GroundingAssessment}from'../../../ai/types.js';export type LyraRagAnswerState='idle'|'loading'|'answer'|'error';export interface LyraRagCitationSelectDetail extends CitationSelectEventDetail{ /** The one presentation owner that produced the action. */ section:'answer'|'grounding';}export interface LyraRagAnswerEventMap{'lr-citation-select':CustomEvent>;'lr-claim-select':CustomEvent>;'lr-retry':CustomEvent;} /** * `` — a controlled grounded-answer surface combining sanitized Markdown, citation * badges, a grounding assessment, and source previews. It performs no model call, retrieval, * citation parsing, or source fetching. * * Public collection properties take bounded, clone-owned readonly snapshots. Create a new * collection and reassign it after changes; mutating the assigned array does not update the view. * Blank citation/source/claim ids and later duplicates are ignored before lookup, counts, * rendering, or activation. The first record for an id wins. * Both child citation signals (`lr-citation-activate` and `lr-citation-open`) are contained and * translated to this component's single `lr-citation-select` event, with `section` identifying * whether the answer citation row or grounding summary owned the badge. * * @customElement lr-rag-answer * @slot answer - Replaces the data-driven Markdown answer body. * @slot sources - Replaces the data-driven source list. * @event lr-citation-select - A citation badge was activated. `detail: { citation, section }`; * `section` is the single presentation owner (`answer` or `grounding`). * @event lr-claim-select - A claim was activated. `detail: { claim }`. * @event lr-retry - The retry button was activated after an error. * @csspart base - The root answer wrapper. * @csspart answer - The answer content wrapper. * @csspart loading - The loading indicator. * @csspart error - The neutral, visible caller-supplied error message. New non-empty errors are * announced through a shared assertive light-DOM region; initial and reconnect content is not * replayed unless `announce` is set, which reads the error present at first mount once. * @csspart retry - The retry button. * @csspart grounding - The grounding assessment. * @csspart citations - The citation section. * @csspart citation-list - The citation badge row. * @csspart sources - The source section. * @csspart source-list - The data-driven source list. * @csspart section-heading - A localized section heading. * @status stable * @since 6.2.0 */ export declare class LyraRagAnswer extends LyraElement{protected static readonly ownedCollectionProperties:readonly string[];static styles:import("lit").CSSResultGroup[];protected static readonly immutableEventDetails:readonly string[]; /** Markdown answer content rendered when the `answer` slot is empty. */ answer:string; /** Citations referenced by the answer and grounding assessment. */ citations:readonly Citation[]; /** Source records rendered when the `sources` slot is empty. */ sources:readonly DocumentRef[]; /** Optional grounding assessment summarized above the citations. */ assessment:Readonly |null; /** Marks answer generation as pending. Busy semantics and the loading cue remain present while * partial property or slotted answer content streams; `errorText` takes state precedence if a * host supplies both flags during a transition. */ loading:boolean; /** Caller-supplied error text. The visible message is deliberately not a shadow live region; * new non-empty values are announced through a shared assertive light-DOM region. Content * present on the initial render or reconnect is not replayed unless `announce` is set. */ errorText:string; /** Opts this answer into announcing the error it is already presenting the first time it * mounts, through the same shared assertive light-DOM region and the same verbatim * caller-supplied text a later `errorText` change takes. Set it where the answer is rendered * in response to a request the user just made and nothing else reports the failure; leave it * unset for an answer that is part of the page a user is arriving on, whose error text is * already read in document order. Read once, when the answer first mounts: a later * reconnection or adoption stages the existing error again rather than replaying it, and * later `errorText` changes are announced either way. An answer with no error announces * nothing. Remove any host `role="status"`/`role="alert"` hand-added before this property * existed once it is set -- otherwise the initial error is announced twice, through the native * role and again through the shared sink. */ announce:boolean; /** Whether the source section is rendered when source data or slotted content exists. */ showSources:boolean; /** Whether claim-level details are forwarded to the grounding summary. */ showClaims:boolean; /** Visible answer label and fallback article name, used when omitted; falls back to the * localized `ragAnswerLabel`. An explicitly empty override stays empty. */ label?:string; /** JS-only accessible-name override for the article while the host attribute is absent. A * non-empty markup `aria-label` makes the host the sole overall owner; an explicitly empty host * label stays empty on the article. */ accessibleLabel:string|null;private isMounting;private initialStateAnnounced;private connectionGeneration;private errorAnnouncementSink?;private slotObserver?;connectedCallback():void;disconnectedCallback():void;protected updated(changed:PropertyValues):void; /** Announce whichever state this answer is presenting right now. Only the error state has an * announcement: a rendered answer is ordinary content, read in document order. */ private announcePresentedState;private hasSlot;private get normalizedCitations();private get normalizedSources();private get normalizedAssessment();private onAnswerCitationAction;private onGroundingCitationSelect;private onGroundingCitationOpen;private stopOwnedEvent;private presentationState;private renderSource;private renderSourceItems;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-rag-answer':LyraRagAnswer;}}