import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';export type CitationBadgeStatus='default'|'high'|'medium'|'low'|'verified'|'unverified';export interface CitationActivateDetail{sourceId:string;index:number;}export interface CitationOpenDetail{sourceId:string;index:number;href?:string;}export interface LyraCitationBadgeEventMap{'lr-citation-activate':CustomEvent;'lr-citation-open':CustomEvent;} /** * `` — an inline `[n]` citation marker with a hover/ * focus preview popover and confidence/verification-status coloring. Used * for an agent response's inline citations, each carrying a `source-id` * that matches a corresponding `` shown elsewhere on the * page (a sibling component in this same family — this component doesn't * import or know anything about it, only carries the id through its * events). * * The default slot is *not* the badge's visible content — the badge always * renders `[index]` — it's reserved for optional rich preview content (e.g. * a filename + short excerpt) shown in a floating popover on hover/focus, * positioned with `internal/positioner.js`'s `place()` the same way * `` positions its own detail tooltip. No popover shows * at all when the slot carries no content, and the popover never traps * focus — it's supplementary preview content, not a modal, so Tab continues * past the badge normally even while it happens to be visible from a mouse * hover. When preview content exists, the button keeps a stable * `aria-describedby` relationship to the `role="tooltip"` panel while it is * both hidden and visible, so assistive technology can resolve the preview * as soon as focus causes it to open. * * An authored host `aria-label` deliberately names only the custom-element boundary; it is not * copied onto the internal button. Host naming does not cross the shadow boundary, so the button * retains its localized citation/index/status name as the interactive control's own name. * * Two distinct signals fire from the same badge: `lr-citation-activate` * (click, or Enter while focused — native `