@magicx-eng/ai-autocomplete-angular 0.16.2 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/esm2020/lib/ai-autocomplete/ai-autocomplete.component.mjs +12 -4
- package/esm2020/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.mjs +27 -5
- package/esm2020/lib/internal/editor-host/editor-host.directive.mjs +27 -10
- package/esm2020/lib/internal/suggestion-grid/suggestion-grid.component.mjs +7 -3
- package/esm2020/lib/internal/suggestion-item/suggestion-item.component.mjs +33 -3
- package/esm2020/public-api.mjs +5 -2
- package/fesm2015/magicx-eng-ai-autocomplete-angular.mjs +110 -26
- package/fesm2015/magicx-eng-ai-autocomplete-angular.mjs.map +1 -1
- package/fesm2020/magicx-eng-ai-autocomplete-angular.mjs +105 -22
- package/fesm2020/magicx-eng-ai-autocomplete-angular.mjs.map +1 -1
- package/lib/ai-autocomplete/ai-autocomplete.component.d.ts +5 -1
- package/lib/ai-autocomplete/ai-autocomplete.component.d.ts.map +1 -1
- package/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.d.ts +9 -1
- package/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.d.ts.map +1 -1
- package/lib/internal/editor-host/editor-host.directive.d.ts +8 -3
- package/lib/internal/editor-host/editor-host.directive.d.ts.map +1 -1
- package/lib/internal/suggestion-grid/suggestion-grid.component.d.ts +3 -1
- package/lib/internal/suggestion-grid/suggestion-grid.component.d.ts.map +1 -1
- package/lib/internal/suggestion-item/suggestion-item.component.d.ts +20 -2
- package/lib/internal/suggestion-item/suggestion-item.component.d.ts.map +1 -1
- package/package.json +2 -2
- package/public-api.d.ts +3 -1
- package/public-api.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magicx-eng-ai-autocomplete-angular.mjs","sources":["../../src/lib/internal/date-grid/date-grid.component.ts","../../src/lib/internal/date-grid/date-grid.component.html","../../src/lib/internal/layout/cluster.component.ts","../../src/lib/internal/layout/stack.component.ts","../../src/lib/internal/pill-list/pill-list.component.ts","../../src/lib/internal/pill-list/pill-list.component.html","../../src/lib/internal/product-strip/product-strip.component.ts","../../src/lib/internal/product-strip/product-strip.component.html","../../src/lib/internal/layout/grid.component.ts","../../src/lib/internal/layout/grid.component.html","../../src/lib/internal/suggestion-item/suggestion-item.component.ts","../../src/lib/internal/suggestion-item/suggestion-item.component.html","../../src/lib/internal/suggestion-grid/suggestion-grid.component.ts","../../src/lib/internal/suggestion-grid/suggestion-grid.component.html","../../src/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.ts","../../src/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.html","../../src/lib/controller/observables.ts","../../src/lib/controller/ai-autocomplete.controller.ts","../../src/lib/internal/editor-host/editor-host.directive.ts","../../src/lib/internal/submit-button/submit-button.component.ts","../../src/lib/internal/submit-button/submit-button.component.html","../../src/lib/ai-autocomplete/ai-autocomplete.component.ts","../../src/lib/ai-autocomplete/ai-autocomplete.component.html","../../src/lib/input/ai-autocomplete-input.directive.ts","../../src/lib/ai-autocomplete.module.ts","../../src/public-api.ts","../../src/magicx-eng-ai-autocomplete-angular.ts"],"sourcesContent":["import { CommonModule } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport {\n cellDay,\n cellIso,\n type DateMonthView,\n type DateRange,\n type DateSelection,\n dateCellMarks,\n isoDate,\n monthLabel,\n type SuggestionOption,\n visibleDateRange,\n WEEKDAY_LABELS,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n/**\n * The dropdown's calendar body, rendered in place of the options grid when the\n * active parameter is a date. Angular analogue of vanilla's `renderDateGrid`\n * and React's `<DateGrid>`.\n *\n * The cells carry the same `${listboxId}-option-${i}` ids, `role=\"option\"` and\n * `aria-selected` the options grid emits, and that is load-bearing rather than\n * cosmetic: the keyboard controller lives in the vanilla core for all three\n * packages, navigates by index into `filteredOptions`, and commits by clicking\n * `#${listboxId}-option-${i}`. `getEffectiveColumns` also measures the live\n * `grid-template-columns` of option-0's parent, which is why the 7 columns sit\n * on the cell container itself and not on an ancestor.\n *\n * @internal\n */\n@Component({\n selector: \"aia-date-grid\",\n standalone: true,\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./date-grid.component.html\",\n styleUrls: [\"./date-grid.component.css\"],\n})\nexport class DateGridComponent {\n /** The visible month's cells. These ARE `filteredOptions` — see `buildDateOptions`. */\n @Input() options: SuggestionOption[] = [];\n @Input() activeIndex = -1;\n @Input() listboxId = \"\";\n @Input() view: DateMonthView | null = null;\n /** What the calendar paints as answered — see the core's `dateSelectionFor`. */\n @Input() selection: DateSelection = { selectedIso: null, selectedRange: null, rangeStart: null };\n\n @Output() readonly select = new EventEmitter<SuggestionOption>();\n @Output() readonly highlight = new EventEmitter<number>();\n @Output() readonly previousMonth = new EventEmitter<void>();\n @Output() readonly nextMonth = new EventEmitter<void>();\n\n readonly weekdays = WEEKDAY_LABELS;\n\n /** Index of the cell showing a 170ms press animation, or -1. */\n pressedIndex = -1;\n\n get monthLabel(): string {\n return this.view ? monthLabel(this.view) : \"\";\n }\n\n dayOf(option: SuggestionOption): number | null {\n return cellDay(option);\n }\n\n isToday(option: SuggestionOption): boolean {\n return cellIso(option) === isoDate(new Date());\n }\n\n /** Before today: rendered dimmed, but every bit as pickable as the rest. */\n isPast(option: SuggestionOption): boolean {\n const iso = cellIso(option);\n // ISO strings order the same way the dates they name do.\n return iso != null && iso < isoDate(new Date());\n }\n\n isSelected(option: SuggestionOption): boolean {\n return dateCellMarks(cellIso(option), {\n selectedIso: this.selection.selectedIso,\n range: this.paintedRange,\n }).selected;\n }\n\n /** Between the two ends of the painted span — banded, not filled. */\n isInRange(option: SuggestionOption): boolean {\n return dateCellMarks(cellIso(option), {\n selectedIso: this.selection.selectedIso,\n range: this.paintedRange,\n }).inRange;\n }\n\n /**\n * While a start is pending, the span runs to whatever cell is highlighted —\n * the hover/arrow preview that tells the user the first tap registered.\n *\n * A getter rather than a cached field: `OnPush` re-runs the template's\n * bindings whenever `options`, `activeIndex` or `selection` changes, and each\n * of those changes this answer.\n */\n private get paintedRange(): DateRange | null {\n return visibleDateRange({\n pendingStart: this.selection.rangeStart,\n highlightedIso: cellIso(this.options[this.activeIndex]),\n selected: this.selection.selectedRange,\n });\n }\n\n onSelect(option: SuggestionOption, index: number): void {\n this.pressedIndex = index;\n this.select.emit(option);\n setTimeout(() => {\n this.pressedIndex = -1;\n }, 170);\n }\n\n onKeyDown(event: KeyboardEvent, option: SuggestionOption, index: number): void {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n this.onSelect(option, index);\n }\n }\n\n /** Keeps the input focused, which the dropdown's visibility gate depends on. */\n preventBlur(event: MouseEvent): void {\n event.preventDefault();\n }\n\n // Padding cells have no date of their own, so they key off position.\n trackByCell = (index: number, option: SuggestionOption): string =>\n cellIso(option) ?? `pad-${index}`;\n}\n","<div class=\"magicx-aia-datepicker\" data-aia-datepicker=\"\">\n <div class=\"magicx-aia-datepicker-header\">\n <!-- tabIndex -1 for the same reason the skip button is: Tab is already\n bound to walking the dropdown's options. -->\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"magicx-aia-datepicker-nav\"\n data-aia-date-prev=\"\"\n aria-label=\"Previous month\"\n (mousedown)=\"preventBlur($event)\"\n (click)=\"previousMonth.emit()\"\n >\n ‹\n </button>\n <span class=\"magicx-aia-datepicker-month\" data-aia-date-month=\"\" aria-live=\"polite\">\n {{ monthLabel }}\n </span>\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"magicx-aia-datepicker-nav\"\n data-aia-date-next=\"\"\n aria-label=\"Next month\"\n (mousedown)=\"preventBlur($event)\"\n (click)=\"nextMonth.emit()\"\n >\n ›\n </button>\n </div>\n\n <!-- Decorative: each cell announces its own full date, so repeating the\n column letters to AT adds noise — and the duplicate T/S would be\n meaningless read aloud anyway. -->\n <div class=\"magicx-aia-datepicker-weekdays\" aria-hidden=\"true\">\n <span class=\"magicx-aia-datepicker-weekday\" *ngFor=\"let label of weekdays\">{{ label }}</span>\n </div>\n\n <div class=\"magicx-aia-datepicker-grid\" data-aia-date-grid=\"\">\n <ng-container *ngFor=\"let option of options; trackBy: trackByCell; let i = index\">\n <!-- Padding for the days before the 1st / after the last. Non-tappable,\n so arrow navigation skips it; hidden from AT so the month reads as\n its own days and nothing else. -->\n <div\n *ngIf=\"dayOf(option) === null; else dayCell\"\n [id]=\"listboxId + '-option-' + i\"\n role=\"option\"\n data-aia-option=\"\"\n data-aia-date-cell=\"\"\n aria-hidden=\"true\"\n [attr.aria-selected]=\"false\"\n tabindex=\"-1\"\n class=\"magicx-aia-date-cell magicx-aia-date-cell--blank\"\n ></div>\n\n <ng-template #dayCell>\n <!-- A day already gone by is de-emphasized, not disabled: it renders\n dimmed but stays every bit as pickable as the rest of the month. -->\n <div\n [id]=\"listboxId + '-option-' + i\"\n role=\"option\"\n data-aia-option=\"\"\n data-aia-date-cell=\"\"\n [attr.aria-selected]=\"i === activeIndex\"\n [attr.aria-label]=\"option.text\"\n tabindex=\"0\"\n class=\"magicx-aia-date-cell magicx-aia-date-cell--day\"\n [class.magicx-aia-date-cell--past]=\"isPast(option)\"\n [class.magicx-aia-date-cell--highlighted]=\"i === activeIndex\"\n [class.magicx-aia-date-cell--today]=\"isToday(option)\"\n [class.magicx-aia-date-cell--in-range]=\"isInRange(option)\"\n [class.magicx-aia-date-cell--selected]=\"isSelected(option)\"\n [class.magicx-aia-date-cell--pressed]=\"i === pressedIndex\"\n (click)=\"onSelect(option, i)\"\n (keydown)=\"onKeyDown($event, option, i)\"\n (mouseenter)=\"highlight.emit(i)\"\n >\n <!-- The cell paints the day number; `option.text` is the full\n committed value (\"March 23 2026\") and is what AT announces,\n since that is what selecting it puts in the input. -->\n <span class=\"magicx-aia-date-cell-number\">{{ dayOf(option) }}</span>\n </div>\n </ng-template>\n </ng-container>\n </div>\n</div>\n","import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from \"@angular/core\";\n\n/**\n * Horizontal layout primitive — children sit in a row and wrap when out of\n * room. Mirrors the React `<Cluster>` component / vanilla `.aia-cluster` CSS\n * primitive. `noWrap` keeps a single row; `inline` makes it inline-level.\n *\n * @internal\n */\n@Component({\n selector: \"aia-cluster\",\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n template: \"<ng-content></ng-content>\",\n styleUrls: [\"./cluster.component.css\"],\n host: {\n class: \"aia-cluster\",\n \"[attr.data-align]\": \"align\",\n \"[attr.data-justify]\": \"justify\",\n \"[attr.data-nowrap]\": \"noWrap ? '' : null\",\n \"[attr.data-inline]\": \"inline ? '' : null\",\n \"[style.--aia-cluster-gap]\": \"gap\",\n },\n})\nexport class ClusterComponent {\n /** Gap between children. Any CSS length. Defaults to the CSS fallback (0.5rem). */\n @Input() gap?: string;\n /** Cross-axis alignment. Defaults to `center`. */\n @Input() align: \"start\" | \"center\" | \"end\" | \"baseline\" = \"center\";\n /** Main-axis distribution. Defaults to `start`. */\n @Input() justify: \"start\" | \"center\" | \"end\" | \"between\" | \"around\" = \"start\";\n /** When true, the cluster does NOT flex-wrap (single-row clusters). */\n @Input() noWrap = false;\n /** Render inline-level (inline-flex) instead of block. */\n @Input() inline = false;\n}\n","import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from \"@angular/core\";\n\n/**\n * Vertical layout primitive — children stack top-to-bottom with `space` gap.\n * Mirrors the React `<Stack>` component / vanilla `.aia-stack` CSS primitive.\n *\n * @internal\n */\n@Component({\n selector: \"aia-stack\",\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n template: \"<ng-content></ng-content>\",\n styleUrls: [\"./stack.component.css\"],\n host: {\n class: \"aia-stack\",\n \"[attr.data-align]\": \"align\",\n \"[style.--aia-stack-space]\": \"space\",\n },\n})\nexport class StackComponent {\n /** Gap between children. Any CSS length. Defaults to the CSS fallback (0.5rem). */\n @Input() space?: string;\n /** Cross-axis alignment of children. Defaults to `stretch` (full width). */\n @Input() align: \"start\" | \"center\" | \"end\" | \"stretch\" = \"stretch\";\n}\n","import { CommonModule } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport type { Suggestion } from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n/**\n * Internal pill list used by both the dropdown and Tier 1's inline pillbar.\n * Mirrors `packages/react/src/components/PillList.tsx` one-for-one — including\n * the per-index opacity ramp (1 / 0.7 / 0.4 / 0.2) and the skeleton-loading\n * fallback that preserves layout while the next fetch is in flight.\n *\n * @internal\n */\n@Component({\n selector: \"aia-pill-list\",\n standalone: true,\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./pill-list.component.html\",\n styleUrls: [\"./pill-list.component.css\"],\n})\nexport class PillListComponent {\n @Input() pills: Suggestion[] = [];\n @Input() activePillIndex = 0;\n @Input() rounded = false;\n /**\n * When true, pills become non-interactive shimmering skeletons. Real pills\n * (with their text) are rendered when provided so widths/positions match\n * the previous state; with no pills, fixed-width fallback placeholders are\n * rendered instead.\n */\n @Input() loading = false;\n /**\n * Whether the active (leading) pill should render selected (full opacity)\n * rather than its positional `first` tier. Auto trigger ⇒ true while a\n * dropdown option is highlighted; manual trigger ⇒ true after the user taps\n * the pill. See `AIAutocompleteController.isActivePillSelected$`.\n */\n @Input() activeSelected = false;\n\n @Output() readonly selectPill = new EventEmitter<number>();\n\n /** Fallback widths when loading with zero cached pills (matches React). */\n readonly fallbackSkeletonWidths = [125, 69];\n\n /** The active pill is \"selected\" only when `activeSelected` is set. */\n isSelected(index: number): boolean {\n return this.activeSelected && index === this.activePillIndex;\n }\n\n /**\n * Opacity per pill state — mirrors PillList.tsx `PILL_OPACITY`. The selected\n * pill is full opacity; otherwise pills take a positional tier (first / next\n * / last).\n */\n pillOpacity(index: number): number {\n if (this.isSelected(index)) return 1; // Selected\n if (index === 0) return 0.7; // First\n if (index === 1) return 0.4; // Next\n return 0.2; // Last\n }\n\n trackByType = (_: number, pill: Suggestion): string => pill.type;\n trackByWidth = (_: number, w: number): number => w;\n\n onPillClick(index: number): void {\n if (this.loading) return;\n this.selectPill.emit(index);\n }\n\n onPillMouseDown(event: Event): void {\n // Prevent the editor from losing focus when a pill is tapped.\n event.preventDefault();\n }\n}\n","<ng-container *ngIf=\"loading && pills.length === 0; else realPills\">\n <span class=\"aia-pill-list\" data-aia-pill-list-loading=\"\">\n <span\n *ngFor=\"let w of fallbackSkeletonWidths; trackBy: trackByWidth; let i = index\"\n data-aia-pill-skeleton=\"\"\n class=\"aia-pill aia-pill-skeleton\"\n [class.aia-pill-rounded]=\"rounded\"\n [style.width.px]=\"w\"\n [style.opacity]=\"pillOpacity(i)\"\n ></span>\n </span>\n</ng-container>\n\n<ng-template #realPills>\n <span\n class=\"aia-pill-list\"\n [attr.data-aia-pill-list-loading]=\"loading ? '' : null\"\n >\n <button\n *ngFor=\"let pill of pills; trackBy: trackByType; let i = index\"\n type=\"button\"\n data-aia-pill=\"\"\n [attr.data-aia-loading]=\"loading ? '' : null\"\n tabindex=\"-1\"\n class=\"aia-pill\"\n [class.aia-pill-rounded]=\"rounded\"\n [class.aia-pill-skeleton]=\"loading\"\n [style.opacity]=\"pillOpacity(i)\"\n [disabled]=\"loading\"\n (mousedown)=\"onPillMouseDown($event)\"\n (click)=\"onPillClick(i)\"\n >\n {{ pill.text }}\n </button>\n </span>\n</ng-template>\n","import { CommonModule } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport type { Product } from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n/**\n * Internal product strip rendered below the dropdown's options grid. Mirrors\n * `packages/react/src/components/ProductStrip.tsx` and the vanilla core's\n * `renderProductStrip`, so all three packages emit the same structure and\n * theme identically.\n *\n * Two layout notes carried over from the vanilla implementation:\n *\n * - The dropdown paints a background but never sets `color`, so anything here\n * relying on `color: inherit` would pick up the *host page's* text colour —\n * black text on a dark panel. Every text node resolves its colour through\n * the same `--aia-option-*` chain the options use.\n * - The options grid carries a negative bottom margin so the footer rides up\n * over its reserved band, and whatever follows the grid inherits that pull.\n * The dropdown root is marked `data-aia-has-products` and the appearance\n * layer zeroes the band at its source rather than the strip cancelling it\n * from here.\n *\n * @internal\n */\n@Component({\n selector: \"aia-product-strip\",\n standalone: true,\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./product-strip.component.html\",\n styleUrls: [\"./product-strip.component.css\"],\n})\nexport class ProductStripComponent {\n @Input() products: Product[] = [];\n /** Scopes the section label's id to the owning listbox. */\n @Input() listboxId = \"\";\n /**\n * False while the panel is fading out. The closed dropdown keeps rendering\n * its last content for the fade, and focusable cards inside it would still\n * answer Tab.\n */\n @Input() focusable = true;\n\n @Output() readonly select = new EventEmitter<Product>();\n /**\n * Focus moved into / out of the strip. The panel closes on blur by default\n * and the editor blurs the moment a card takes focus, so the dropdown\n * reports focus as still-inside rather than shutting out from under the card\n * the user just tabbed to.\n */\n @Output() readonly focusChange = new EventEmitter<boolean>();\n\n get labelId(): string {\n return `${this.listboxId}-products-label`;\n }\n\n cardId(index: number): string {\n return `${this.listboxId}-product-${index}`;\n }\n\n /**\n * Identity *and* content: a same-id result whose fields changed must\n * re-render rather than reuse the previous card's bindings.\n */\n trackByProduct = (_: number, product: Product): string =>\n [\n product.id,\n product.title,\n product.url,\n product.imageUrl ?? \"\",\n product.price ?? \"\",\n product.vendor ?? \"\",\n ].join(\"\u0000\");\n\n onClick(event: MouseEvent, product: Product): void {\n // Let the browser keep the clicks that mean \"open this somewhere else\" —\n // intercepting them would defeat the point of rendering an <a>. Those are\n // navigations the user asked for explicitly, so they don't emit.\n if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button !== 0) {\n return;\n }\n event.preventDefault();\n this.select.emit(product);\n }\n\n onKeyDown(event: KeyboardEvent, product: Product): void {\n if (event.key !== \"Enter\" && event.key !== \" \") return;\n event.preventDefault();\n this.select.emit(product);\n }\n\n onCardFocus(): void {\n this.focusChange.emit(true);\n }\n\n onCardBlur(event: FocusEvent): void {\n const next = event.relatedTarget as HTMLElement | null;\n if (next?.closest(\"[data-aia-dropdown]\")) return;\n this.focusChange.emit(false);\n }\n}\n","<!-- `group` is the one role a listbox accepts around a set of options, so the\n strip stays inside the listbox without breaking its content model. -->\n<section\n *ngIf=\"products.length > 0\"\n class=\"aia-products\"\n data-aia-products=\"\"\n role=\"group\"\n [attr.aria-labelledby]=\"labelId\"\n>\n <div class=\"aia-products-label\" [id]=\"labelId\">Products</div>\n\n <div class=\"aia-products-row\" data-aia-products-row=\"\">\n <!-- A real <a href> rather than a <div>: it keeps the browser's own link\n affordances — cmd/ctrl-click for a new tab, middle-click, right-click →\n \"copy link address\". role=\"option\" overrides how assistive tech\n announces it, which is correct inside a listbox; the deliberate trade\n is that AT no longer calls it a link. -->\n <a\n *ngFor=\"let product of products; let i = index; trackBy: trackByProduct\"\n [id]=\"cardId(i)\"\n class=\"aia-product\"\n data-aia-product=\"\"\n role=\"option\"\n [attr.aria-selected]=\"false\"\n [href]=\"product.url\"\n [attr.tabindex]=\"focusable ? 0 : -1\"\n (click)=\"onClick($event, product)\"\n (keydown)=\"onKeyDown($event, product)\"\n (focus)=\"onCardFocus()\"\n (blur)=\"onCardBlur($event)\"\n >\n <!-- Catalogues without images are common enough that the placeholder is\n a first-class state, not an error state. -->\n <span\n class=\"aia-product-media\"\n [attr.data-aia-product-placeholder]=\"product.imageUrl ? null : ''\"\n >\n <!-- alt=\"\" on purpose: the title is already the card's accessible\n name, and repeating it would have a screen reader read it twice. -->\n <img\n *ngIf=\"product.imageUrl\"\n class=\"aia-product-image\"\n [src]=\"product.imageUrl\"\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n </span>\n\n <!-- Every field but the title is optional, so absent ones render no\n element at all — the column gap can't leave a hole for a box that\n isn't there. -->\n <span class=\"aia-product-body\">\n <span *ngIf=\"product.vendor\" class=\"aia-product-vendor\">{{ product.vendor }}</span>\n <span class=\"aia-product-title\">{{ product.title }}</span>\n <span *ngIf=\"product.price\" class=\"aia-product-price\">{{ product.price }}</span>\n </span>\n </a>\n </div>\n</section>\n","import {\n ChangeDetectionStrategy,\n Component,\n type ElementRef,\n Input,\n type OnChanges,\n type SimpleChanges,\n ViewChild,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport { optionsGridTemplateColumns } from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n/**\n * Intrinsic grid layout primitive — auto-fits as many columns as fit between\n * `min` and `max` wide, wrapping to new rows when there's no more horizontal\n * room. Mirrors the React `<Grid>` component / vanilla `.aia-grid` primitive.\n *\n * Optionally scrolls (`scroll`, capped height).\n *\n * @internal\n */\n@Component({\n selector: \"aia-grid\",\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./grid.component.html\",\n styleUrls: [\"./grid.component.css\"],\n})\nexport class GridComponent implements OnChanges {\n /** Minimum cell width. CSS length, e.g. \"16rem\". Columns auto-fit at runtime. */\n @Input() min = \"16rem\";\n /** Maximum cell width. CSS length. Defaults (via CSS) to `1fr` (stretch). */\n @Input() max?: string;\n /** Gap between cells. */\n @Input() gap?: string;\n /** Cap the height and scroll vertically when content overflows. */\n @Input() scroll = false;\n /** Max height when `scroll`. CSS length. Defaults (via CSS) to 120px. */\n @Input() maxHeight?: string;\n /** Scroll back to the top whenever this key changes (`scroll` only). */\n @Input() scrollResetKey?: string;\n /** Fixed column count. Overrides the intrinsic auto-fit when set; rows fill left-to-right. */\n @Input() cols?: number;\n /** Explicit `grid-template-columns` value. Overrides `cols` when set. */\n @Input() template?: string;\n /**\n * Identity of the content group on screen, mirrored onto `data-aia-group`.\n * The core's scroll-arrow controller reads it to tell a new set of options\n * (rising in) from the same set re-rendered.\n */\n @Input() group?: string;\n\n /**\n * Explicit column template overrides the intrinsic auto-fit (inline wins).\n * The track string is built by the core so all three packages emit the same\n * one; a measured template (the two-column split) wins over the count.\n */\n get templateColumns(): string | null {\n if (this.template) return this.template;\n return this.cols ? optionsGridTemplateColumns(this.cols) : null;\n }\n\n @ViewChild(\"grid\", { static: false }) gridRef?: ElementRef<HTMLDivElement>;\n\n /**\n * A new `scrollResetKey` means a different content group is being shown (e.g.\n * the next suggestion's options after a selection) — start it from the top\n * instead of inheriting the previous group's scroll offset.\n */\n ngOnChanges(changes: SimpleChanges): void {\n const change = changes[\"scrollResetKey\"];\n if (!change || change.isFirstChange()) return;\n const grid = this.gridRef?.nativeElement;\n if (grid) grid.scrollTop = 0;\n }\n}\n","<div\n #grid\n class=\"aia-grid\"\n [attr.data-scroll]=\"scroll ? '' : null\"\n [attr.data-aia-group]=\"group ?? null\"\n [style.--aia-grid-min]=\"min\"\n [style.--aia-grid-max]=\"max\"\n [style.--aia-grid-gap]=\"gap\"\n [style.--aia-grid-max-height]=\"maxHeight\"\n [style.grid-template-columns]=\"templateColumns\"\n>\n <ng-content></ng-content>\n</div>\n","import { CommonModule } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n inject,\n type OnDestroy,\n Output,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport type { SuggestionOption } from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n/**\n * Internal single-option cell used inside the suggestion grid. Mirrors\n * `packages/react/src/components/SuggestionItem.tsx`. Handles:\n *\n * - Tappable vs non-tappable cursor + hover styling\n * - Pressed-state compress animation (170ms, single-flight)\n * - Keyboard activation (Enter/Space)\n * - ARIA `role=\"option\"` + `aria-selected` for the listbox pattern\n * - Loading skeleton when `loading=true`\n *\n * @internal\n */\n@Component({\n selector: \"aia-suggestion-item\",\n standalone: true,\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./suggestion-item.component.html\",\n styleUrls: [\"./suggestion-item.component.css\"],\n})\nexport class SuggestionItemComponent implements OnDestroy {\n @Input() option!: SuggestionOption;\n @Input() isHighlighted = false;\n @Input() id = \"\";\n @Input() loading = false;\n /** Fade this option's text toward its bottom edge (last visible row of a scrollable grid). */\n @Input() scrollHint = false;\n /**\n * Start delay of this row's entrance animation (ms) — each row rises in a\n * beat after the one nearer the input. Captured once, on first render, so a\n * later change-detection pass can't restart a row mid-rise.\n */\n @Input() set enterDelayMs(value: number) {\n if (this.enterDelay === null) this.enterDelay = value;\n }\n /**\n * The captured delay; `null` until the first `enterDelayMs` binding lands.\n * The template binds it to `--aia-option-enter-delay` (the core's\n * OPTION_ENTER_DELAY_VAR), which the stylesheet's entrance rule reads.\n */\n enterDelay: number | null = null;\n\n @Output() readonly select = new EventEmitter<SuggestionOption>();\n @Output() readonly highlight = new EventEmitter<void>();\n\n pressed = false;\n\n private readonly cdr = inject(ChangeDetectorRef);\n private pressedTimer: ReturnType<typeof setTimeout> | undefined;\n\n ngOnDestroy(): void {\n if (this.pressedTimer !== undefined) clearTimeout(this.pressedTimer);\n }\n\n onSelect(): void {\n if (this.loading || !this.option.is_tappable || this.pressed) return;\n this.pressed = true;\n this.cdr.markForCheck();\n this.select.emit(this.option);\n if (this.pressedTimer !== undefined) clearTimeout(this.pressedTimer);\n this.pressedTimer = setTimeout(() => {\n this.pressed = false;\n this.cdr.markForCheck();\n }, 170);\n }\n\n onMouseEnter(): void {\n if (this.loading || !this.option.is_tappable) return;\n this.highlight.emit();\n }\n\n onKeyDown(event: KeyboardEvent): void {\n if (this.loading || !this.option.is_tappable) return;\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n this.onSelect();\n }\n }\n}\n","<div\n [id]=\"id\"\n role=\"option\"\n data-aia-option=\"\"\n [attr.data-aia-loading]=\"loading ? '' : null\"\n [attr.aria-selected]=\"isHighlighted\"\n class=\"aia-suggestion-item\"\n [style.--aia-option-enter-delay]=\"(enterDelay ?? 0) + 'ms'\"\n [class.aia-suggestion-item-highlighted]=\"isHighlighted && !loading\"\n [class.aia-suggestion-item-tappable]=\"option.is_tappable\"\n [class.aia-suggestion-item-non-tappable]=\"!option.is_tappable\"\n [class.aia-suggestion-item-pressed]=\"pressed\"\n [class.aia-suggestion-item-scroll-hint]=\"scrollHint\"\n [attr.tabindex]=\"loading || !option.is_tappable ? -1 : 0\"\n (click)=\"onSelect()\"\n (keydown)=\"onKeyDown($event)\"\n (mouseenter)=\"onMouseEnter()\"\n>\n <span class=\"aia-suggestion-content\">\n <span class=\"aia-suggestion-text\">\n <ng-container *ngIf=\"option.icon; else noIcon\"\n >{{ option.icon }} {{ option.text }}</ng-container\n >\n <ng-template #noIcon>{{ option.text }}</ng-template>\n </span>\n <span *ngIf=\"option.tag\" class=\"aia-suggestion-tag\">{{ option.tag }}</span>\n </span>\n</div>\n","import { CommonModule } from \"@angular/common\";\nimport {\n type AfterViewChecked,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n HostListener,\n Input,\n inject,\n type OnChanges,\n Output,\n type SimpleChanges,\n ViewChild,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport {\n isOptionsGridMobileViewport,\n measureOptionsGrid,\n needsOptionsGridMeasurement,\n type OptionsGridPlan,\n optionEnterDelayMs,\n planOptionsGrid,\n type SuggestionOption,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { GridComponent } from \"../layout/grid.component\";\nimport { SuggestionItemComponent } from \"../suggestion-item/suggestion-item.component\";\n\n/**\n * Internal grid of suggestion options. Mirrors\n * `packages/react/src/components/SuggestionGrid.tsx` — a thin wrapper over the\n * `Grid` layout primitive (which owns the auto-fit columns and the\n * capped-height scroll). It only wires each option to its\n * select/highlight handlers and listbox-scoped id.\n *\n * @internal\n */\n@Component({\n selector: \"aia-suggestion-grid\",\n standalone: true,\n imports: [CommonModule, GridComponent, SuggestionItemComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./suggestion-grid.component.html\",\n})\nexport class SuggestionGridComponent implements OnChanges, AfterViewChecked {\n @Input() options: SuggestionOption[] = [];\n @Input() activeIndex = -1;\n @Input() listboxId = \"\";\n @Input() loading = false;\n /**\n * Identity of the suggestion these options belong to. When it changes the\n * grid scrolls back to the top, so the next parameter's options are read\n * from the first one instead of from the previous list's scroll offset.\n */\n @Input() groupKey = \"\";\n /**\n * Which side of the input the dropdown opens on. The rows' entrance starts\n * from the input's side outward, so \"above\" reverses the order.\n */\n @Input() optionsPosition: \"above\" | \"below\" = \"below\";\n\n @Output() readonly select = new EventEmitter<SuggestionOption>();\n @Output() readonly highlight = new EventEmitter<number>();\n\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild(GridComponent, { static: false }) private gridComp?: GridComponent;\n\n /**\n * The measured layout plan. Starts as the measurement-free baseline (one\n * column); after each view update the rendered rows are measured and the\n * plan upgrades to two columns when they provably fit — same two-pass the\n * React grid does with its layout effect, all through `planOptionsGrid`.\n */\n plan: OptionsGridPlan = planOptionsGrid(0, false, null, null);\n private needsMeasure = true;\n\n // Re-measure when the viewport changes (breakpoint or width both matter to\n // the two-column fit).\n @HostListener(\"window:resize\")\n onResize(): void {\n this.needsMeasure = true;\n this.cdr.markForCheck();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n // Only the inputs the plan depends on reset it — activeIndex changes on\n // every arrow key and must not knock a measured two-column grid back to\n // the baseline (the React grid's layout effect excludes it the same way).\n if (!changes[\"options\"] && !changes[\"loading\"]) return;\n this.needsMeasure = true;\n // The pre-measure baseline for the new inputs, so the first paint is the\n // same one-column layout the other packages start from.\n this.plan = planOptionsGrid(this.options.length, isOptionsGridMobileViewport(), null, null);\n }\n\n ngAfterViewChecked(): void {\n if (!this.needsMeasure) return;\n this.needsMeasure = false;\n const isMobile = isOptionsGridMobileViewport();\n const grid = this.gridComp?.gridRef?.nativeElement;\n // Measuring clones every row and forces a layout — skip it whenever the\n // plan would ignore the result (mobile, fewer than five options).\n const shouldMeasure =\n grid && !this.loading && needsOptionsGridMeasurement(this.options.length, isMobile);\n const measured = shouldMeasure ? measureOptionsGrid(grid) : null;\n const next = planOptionsGrid(\n this.options.length,\n isMobile,\n measured?.rowWidths ?? null,\n measured?.gridWidth ?? null,\n );\n const unchanged =\n next.template === this.plan.template &&\n next.maxHeight === this.plan.maxHeight &&\n next.scrollHintIndices.join() === this.plan.scrollHintIndices.join();\n if (unchanged) return;\n // The view was already checked this cycle — apply the measured plan in a\n // fresh microtask so OnPush picks it up without an\n // ExpressionChangedAfterItHasBeenChecked error.\n queueMicrotask(() => {\n this.plan = next;\n this.cdr.markForCheck();\n });\n }\n\n isScrollHint(index: number): boolean {\n return !this.loading && this.plan.scrollHintIndices.includes(index);\n }\n\n /**\n * Start delay of row `index`'s entrance — each row rises in a beat after\n * the one nearer the input. Skeleton rows fade in together (they're\n * placeholders, not content arriving).\n */\n enterDelayMs(index: number): number {\n if (this.loading) return 0;\n // Across the columns the measured plan settled on — the two-column\n // upgrade only decides that after the rows exist.\n return optionEnterDelayMs(index, this.plan.cols, this.options.length, this.optionsPosition);\n }\n\n /**\n * The group is part of the identity: a new suggestion's options are new\n * rows and get the entrance animation even when one spells the same as a\n * row already on screen.\n */\n trackByOptionText = (_: number, opt: SuggestionOption): string => `${this.groupKey}\\0${opt.text}`;\n}\n","<!-- max=\"1fr\": columns share out the full width, so a lone column spans the\n whole options box instead of stopping at 250px. -->\n<aia-grid\n min=\"250px\"\n max=\"1fr\"\n gap=\"0\"\n [scroll]=\"true\"\n [scrollResetKey]=\"groupKey\"\n [template]=\"plan.template\"\n [maxHeight]=\"plan.maxHeight\"\n [group]=\"groupKey\"\n>\n <aia-suggestion-item\n *ngFor=\"let option of options; trackBy: trackByOptionText; let i = index\"\n [option]=\"option\"\n [isHighlighted]=\"i === activeIndex\"\n [id]=\"listboxId + '-option-' + i\"\n [loading]=\"loading\"\n [scrollHint]=\"isScrollHint(i)\"\n [enterDelayMs]=\"enterDelayMs(i)\"\n (select)=\"select.emit($event)\"\n (highlight)=\"highlight.emit(i)\"\n ></aia-suggestion-item>\n</aia-grid>\n","import { CommonModule } from \"@angular/common\";\nimport {\n type AfterViewChecked,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n type ElementRef,\n Input,\n inject,\n type OnChanges,\n type OnDestroy,\n type OnInit,\n type SimpleChanges,\n ViewChild,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport {\n type AppearanceMode,\n attachScrollArrow,\n buildAttributionUrl,\n type DateMonthView,\n type DateSelection,\n getFooterHint,\n isCalendarFormat,\n type Product,\n SCROLL_ARROW_LABEL,\n type ScrollArrowController,\n type Suggestion,\n type SuggestionOption,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { BehaviorSubject, combineLatest, type Observable } from \"rxjs\";\nimport { map } from \"rxjs/operators\";\nimport type { AIAutocompleteController } from \"../controller/ai-autocomplete.controller\";\nimport { DateGridComponent } from \"../internal/date-grid/date-grid.component\";\nimport { ClusterComponent } from \"../internal/layout/cluster.component\";\nimport { StackComponent } from \"../internal/layout/stack.component\";\nimport { PillListComponent } from \"../internal/pill-list/pill-list.component\";\nimport { ProductStripComponent } from \"../internal/product-strip/product-strip.component\";\nimport { SuggestionGridComponent } from \"../internal/suggestion-grid/suggestion-grid.component\";\n\ninterface DropdownVm {\n pills: Suggestion[];\n options: SuggestionOption[];\n activeIndex: number;\n isActivePillSelected: boolean;\n isLoading: boolean;\n showsPills: boolean;\n /** Whether the pillbar ends in the trailing \"skip\" button. */\n showsSkip: boolean;\n /**\n * Disabled state for the skip button: loading, or the post-selection window\n * where isLoading is suppressed but the core's skipActivePill() no-ops.\n */\n skipDisabled: boolean;\n /** Active pill's label, for the skip button's aria-label. */\n activePillLabel: string;\n showsOptions: boolean;\n /** Whether the calendar body renders in place of the options grid. */\n showsDateGrid: boolean;\n /** The month the calendar shows. Null unless `showsDateGrid`. */\n dateView: DateMonthView | null;\n /** What the calendar paints as answered — see the core's `dateSelectionFor`. */\n dateSelection: DateSelection;\n showsFallbackSkeleton: boolean;\n isVisible: boolean;\n /** Product cards for the strip. Empty unless `products` is configured. */\n products: Product[];\n /** Identity of the suggestion the options belong to — drives the grid's scroll reset. */\n groupKey: string;\n footerKey: string;\n footerHint: string;\n optionsPosition: \"above\" | \"below\";\n}\n\n/** The content-bearing fields of the view-model (everything but `isVisible`). */\ntype DropdownContent = Omit<DropdownVm, \"isVisible\">;\n\n/**\n * Tier 2 dropdown component — the Angular equivalent of React's\n * `<AIAutocompleteDropdown />`. Renders the pillbar, options grid, and\n * loading skeleton based on the supplied controller's `dropdown$` snapshot.\n *\n * ```html\n * <ai-autocomplete-dropdown [controller]=\"ac\"></ai-autocomplete-dropdown>\n * ```\n *\n * All actions (pill click, option select, option highlight) are forwarded to\n * the controller. Consumers who need to observe these events can subscribe\n * to the controller's per-field observables.\n *\n * @public\n */\n@Component({\n selector: \"ai-autocomplete-dropdown\",\n standalone: true,\n imports: [\n CommonModule,\n PillListComponent,\n ProductStripComponent,\n SuggestionGridComponent,\n DateGridComponent,\n StackComponent,\n ClusterComponent,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./ai-autocomplete-dropdown.component.html\",\n // The shared appearance layer carries the design tokens + box-sizing reset +\n // optionsPosition reversal, so a standalone dropdown (no Tier 1 component on\n // the page) is fully styled once `mode` is set.\n styleUrls: [\"../shared/appearance.css\", \"./ai-autocomplete-dropdown.component.css\"],\n})\nexport class AIAutocompleteDropdownComponent\n implements OnInit, OnChanges, AfterViewChecked, OnDestroy\n{\n /** The controller that owns the autocomplete state. Required. */\n @Input() controller!: AIAutocompleteController;\n /** Whether to render the pillbar above the options grid. Default: true. */\n @Input() showPills = true;\n /**\n * Whether the pillbar ends in a small \"skip\" button that dismisses the\n * active pill — same action as pressing → at the end of the input. It sits\n * at the trailing edge of the bar: visually top-right when the dropdown\n * opens below the input, bottom-right when `optionsPosition` is \"above\".\n * Default: true. Hidden automatically during re-edit and while the fallback\n * skeleton renders.\n */\n @Input() showSkipButton = true;\n /** Optional CSS class applied to the dropdown root. */\n @Input() className?: string;\n /**\n * Color mode for a standalone dropdown. When set, the dropdown self-scopes the\n * design tokens to its own root (adds `magicx-aia` + `data-mode`), so it needs\n * no `.magicx-aia` wrapper. `\"auto\"` follows `prefers-color-scheme`. Leave it\n * unset when the dropdown sits inside a `.magicx-aia` ancestor (e.g. Tier 1).\n */\n @Input() mode?: AppearanceMode;\n\n /** Concrete resolved mode, or null when `mode` is unset (inherit from ancestor). */\n resolvedMode: \"light\" | \"dark\" | null = null;\n private modeMql?: MediaQueryList;\n private modeListener?: () => void;\n private readonly cdr = inject(ChangeDetectorRef);\n\n /** Root class list — adds `magicx-aia` only when self-scoping via `mode`. */\n get rootClass(): string {\n let cls = \"magicx-aia-dropdown\";\n if (this.resolvedMode) cls += \" magicx-aia\";\n if (this.className) cls += ` ${this.className}`;\n return cls;\n }\n\n /** Fallback skeleton-bar widths used when loading with zero cached options. */\n readonly fallbackSkeletonBarWidths = [159, 119, 164];\n\n /** Accessible name of the \"more below\" scroll arrow. */\n readonly scrollArrowLabel = SCROLL_ARROW_LABEL;\n\n // The dropdown root and the arrow button live under the `*ngIf` on vm$, so\n // they come and go with it — hence non-static queries, re-read every check.\n @ViewChild(\"dropdownRoot\", { static: false }) private dropdownRootRef?: ElementRef<HTMLElement>;\n @ViewChild(\"scrollArrow\", { static: false }) private scrollArrowRef?: ElementRef<HTMLElement>;\n /** The grid the scroll-arrow controller is currently bound to. */\n private scrollArrowBinding: { grid: HTMLElement; controller: ScrollArrowController } | null =\n null;\n\n /**\n * Attribution/branding link URL for the footer, with a `utm_source` derived\n * from the embedding page's hostname (see {@link buildAttributionUrl}).\n */\n readonly brandHref = buildAttributionUrl();\n\n /**\n * View-model derived from the controller's `dropdown$`. Adds three booleans\n * (`showsPills`, `showsOptions`, `showsFallbackSkeleton`, `isVisible`) that\n * keep template-level logic to a property read per §19.6.\n *\n * Initialized once in `ngOnInit` — must NOT be a getter. A getter returns a\n * fresh `Observable` instance on every property read; with OnPush + `async`\n * pipe that means each change-detection cycle unsubscribes/resubscribes,\n * causing the `*ngIf=\"vm$ | async as vm\"` root to briefly resolve `null`\n * and flicker the entire dropdown DOM.\n */\n vm$!: Observable<DropdownVm>;\n\n // Bridge for the @Input `showPills` into the reactive pipeline. Without this,\n // changing the input after init wouldn't trigger a new vm emission until the\n // next controller.dropdown$ tick — and we'd lose the showPills update entirely\n // if the controller is idle. Updated from ngOnChanges below.\n private readonly showPills$ = new BehaviorSubject<boolean>(true);\n // Same bridge, for `showSkipButton`.\n private readonly showSkipButton$ = new BehaviorSubject<boolean>(true);\n\n // Last content emitted while the dropdown was visible. Reused during the\n // close fade so the populated dropdown fades out as one — see initVm.\n private lastVisibleContent: DropdownContent | null = null;\n\n ngOnInit(): void {\n // Seed the input bridges from their resolved values at init time.\n this.showPills$.next(this.showPills);\n this.showSkipButton$.next(this.showSkipButton);\n this.applyMode();\n this.initVm();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes[\"showPills\"]) {\n this.showPills$.next(this.showPills);\n }\n if (changes[\"showSkipButton\"]) {\n this.showSkipButton$.next(this.showSkipButton);\n }\n if (changes[\"mode\"] && !changes[\"mode\"].firstChange) {\n this.applyMode();\n }\n // Re-bind vm$ when the controller @Input is swapped (e.g. a multi-step form\n // toggling between controllers). Without this, vm$ stays subscribed to the\n // previous controller's dropdown$ — rendering stale options, or, if that\n // controller was destroy()-ed, receiving a completion that collapses the\n // dropdown permanently. Skip the first change: ngOnChanges fires before\n // ngOnInit, which owns the initial creation.\n if (changes[\"controller\"] && !changes[\"controller\"].firstChange && this.controller) {\n this.initVm();\n }\n }\n\n /**\n * Keep the core's \"more below\" arrow controller bound to whichever options\n * grid is currently rendered — the Angular analogue of React's\n * useScrollArrow. The controller owns the behaviour (measuring, visibility,\n * the page-scroll on click — see the core's scrollArrow.ts); this only hands\n * it the live elements after each view check, re-attaching when the grid\n * element is replaced and tearing down when there is no grid.\n */\n ngAfterViewChecked(): void {\n const root = this.dropdownRootRef?.nativeElement;\n const button = this.scrollArrowRef?.nativeElement;\n const grid = root?.querySelector<HTMLElement>(\".aia-grid[data-scroll]\") ?? null;\n if (this.scrollArrowBinding && this.scrollArrowBinding.grid !== grid) {\n this.scrollArrowBinding.controller.destroy();\n this.scrollArrowBinding = null;\n }\n if (!root || !button || !grid) return;\n if (!this.scrollArrowBinding) {\n this.scrollArrowBinding = {\n grid,\n controller: attachScrollArrow({ dropdown: root, grid, button }),\n };\n return; // attach() runs the first update itself\n }\n this.scrollArrowBinding.controller.update();\n }\n\n ngOnDestroy(): void {\n this.teardownModeListener();\n this.scrollArrowBinding?.controller.destroy();\n this.scrollArrowBinding = null;\n }\n\n /**\n * Resolve the `mode` input into `resolvedMode`. Unset → null (the dropdown\n * stays class-less and inherits from a `.magicx-aia` ancestor). `\"auto\"` reads\n * `prefers-color-scheme` and tracks it live via a media-query listener.\n */\n private applyMode(): void {\n this.teardownModeListener();\n if (this.mode === undefined) {\n this.resolvedMode = null;\n return;\n }\n if (this.mode === \"light\" || this.mode === \"dark\") {\n this.resolvedMode = this.mode;\n return;\n }\n // \"auto\"\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n this.resolvedMode = \"light\";\n return;\n }\n this.modeMql = window.matchMedia(\"(prefers-color-scheme: dark)\");\n this.resolvedMode = this.modeMql.matches ? \"dark\" : \"light\";\n this.modeListener = () => {\n this.resolvedMode = this.modeMql?.matches ? \"dark\" : \"light\";\n this.cdr.markForCheck();\n };\n this.modeMql.addEventListener(\"change\", this.modeListener);\n }\n\n private teardownModeListener(): void {\n if (this.modeMql && this.modeListener) {\n this.modeMql.removeEventListener(\"change\", this.modeListener);\n }\n this.modeMql = undefined;\n this.modeListener = undefined;\n }\n\n /** Build the view-model stream from the current controller + showPills$. */\n private initVm(): void {\n this.vm$ = combineLatest([\n this.controller.dropdown$,\n this.showPills$,\n this.showSkipButton$,\n ]).pipe(\n map(([dd, showPills, showSkipButton]) => {\n const activeSuggestion = dd.suggestions[0];\n const options = activeSuggestion?.options ?? [];\n const showsPills = showPills && (dd.pills.length > 0 || dd.isLoading);\n // The trailing \"skip\" button only makes sense next to a real,\n // skippable pill — never on the fallback skeleton bar, and never\n // during re-edit (the bar then shows an already answered param).\n // Deliberately NOT gated on showsPills: with pills rendered elsewhere\n // (pillPlacement \"inline\"/\"hidden\") the bar renders as a skip-only\n // row holding just the button. Hidden while the input is empty — the\n // footer hint doesn't advertise \"→ to skip\" until the user has typed,\n // so the pristine starting state stays free of the affordance too.\n const showsSkip =\n dd.pills.length > 0 && showSkipButton && !dd.isEditing && !dd.isInputEmpty;\n // Exactly one body renders. `options` above already holds the visible\n // month's cells when this is a date — the core swapped them in its\n // derive layer — so the two are the same list drawn two different\n // ways, and never both at once (two elements answering to the same\n // option id would break keyboard commit).\n const isDate = isCalendarFormat(dd.formatType ?? \"options\") && dd.dateView != null;\n const showsOptions = options.length > 0 && !isDate;\n const showsDateGrid = options.length > 0 && isDate;\n const showsFallbackSkeleton = dd.isLoading && !showsOptions && !showsDateGrid;\n // Either half is enough to keep the panel up: products render with no\n // suggestions, suggestions render with no products.\n const isVisible =\n dd.isOpen &&\n (showsOptions || showsDateGrid || showsPills || dd.isLoading || dd.products.length > 0);\n\n // While closing, reuse the last visible content so the populated\n // dropdown fades out as one. Otherwise the pills/options vanish the\n // instant the state empties (e.g. skipping the last pill with →),\n // leaving the always-present footer alone for a flash of a footer-only\n // \"no options\" box mid-fade. Only `isVisible` tracks live state to\n // drive the opacity transition.\n if (!isVisible && this.lastVisibleContent) {\n return { ...this.lastVisibleContent, isVisible: false };\n }\n\n const optionHighlighted =\n dd.activeIndex >= 0 && Boolean(options[dd.activeIndex]?.is_tappable);\n const { key: footerKey, hint: footerHint } = getFooterHint(\n optionHighlighted,\n dd.isInputEmpty,\n );\n const content: DropdownContent = {\n pills: dd.pills,\n options,\n activeIndex: dd.activeIndex,\n isActivePillSelected: dd.isActivePillSelected,\n isLoading: dd.isLoading,\n showsPills,\n showsSkip,\n skipDisabled: dd.isLoading || Boolean(dd.inSelectionAnimation),\n activePillLabel: dd.pills[0]?.text ?? \"\",\n showsOptions,\n showsDateGrid,\n dateView: dd.dateView ?? null,\n dateSelection: {\n selectedIso: dd.selectedDateIso ?? null,\n selectedRange: dd.selectedDateRange ?? null,\n rangeStart: dd.dateRangeStart ?? null,\n },\n showsFallbackSkeleton,\n products: dd.products,\n groupKey: activeSuggestion ? `${activeSuggestion.type} ${activeSuggestion.text}` : \"\",\n footerKey,\n footerHint,\n optionsPosition: dd.optionsPosition,\n };\n if (isVisible) this.lastVisibleContent = content;\n return { ...content, isVisible };\n }),\n );\n }\n\n trackByWidth = (_: number, w: number): number => w;\n\n onPillClick(index: number): void {\n this.controller.setActivePill(index);\n }\n\n onSkip(): void {\n this.controller.skipActivePill();\n }\n\n onSelect(option: SuggestionOption): void {\n this.controller.selectOption(option);\n }\n\n onPreviousMonth(): void {\n this.controller.showPreviousMonth();\n }\n\n onNextMonth(): void {\n this.controller.showNextMonth();\n }\n\n onHighlight(index: number): void {\n this.controller.setActiveDropdownIndex(index);\n }\n\n onProductSelect(product: Product): void {\n this.controller.selectProduct(product);\n }\n\n /**\n * A card taking focus blurs the editor, which would otherwise close the\n * panel out from under the card the user just tabbed to.\n */\n onProductFocusChange(focused: boolean): void {\n this.controller.setFocused(focused);\n }\n\n preventBlur(event: Event): void {\n // Prevent the editor from losing focus when interacting with the dropdown.\n event.preventDefault();\n }\n}\n","<div\n *ngIf=\"vm$ | async as vm\"\n #dropdownRoot\n [id]=\"controller.listboxId\"\n role=\"listbox\"\n data-aia-dropdown=\"\"\n [attr.data-aia-loading]=\"vm.isLoading ? '' : null\"\n [attr.data-mode]=\"resolvedMode\"\n [attr.data-options-position]=\"vm.optionsPosition\"\n [attr.data-aia-has-products]=\"vm.products.length > 0 ? '' : null\"\n [class]=\"rootClass\"\n [class.magicx-aia-dropdown-visible]=\"vm.isVisible\"\n (mousedown)=\"preventBlur($event)\"\n>\n <aia-stack space=\"8px\">\n <aia-cluster\n *ngIf=\"vm.showsPills || vm.showsSkip\"\n class=\"magicx-aia-dropdown-pillbar\"\n data-aia-pillbar=\"\"\n [noWrap]=\"true\"\n >\n <!-- The scroll + right-edge fade live on this wrapper (not the bar) so\n the skip button stays outside the masked region — pinned and fully\n opaque while overflowing pills fade under it. Absent in a skip-only\n row (pills rendered elsewhere via pillPlacement inline/hidden). -->\n <span *ngIf=\"vm.showsPills\" class=\"magicx-aia-pill-scroll\" data-aia-pill-scroll=\"\">\n <aia-pill-list\n [pills]=\"vm.pills\"\n [activePillIndex]=\"0\"\n [activeSelected]=\"vm.isActivePillSelected\"\n [rounded]=\"true\"\n [loading]=\"vm.isLoading\"\n (selectPill)=\"onPillClick($event)\"\n ></aia-pill-list>\n </span>\n <button\n *ngIf=\"vm.showsSkip\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"magicx-aia-skip\"\n data-aia-skip=\"\"\n [disabled]=\"vm.skipDisabled\"\n [attr.aria-label]=\"vm.activePillLabel ? 'Skip ' + vm.activePillLabel : 'Skip'\"\n (click)=\"onSkip()\"\n >\n skip\n </button>\n </aia-cluster>\n\n <aia-suggestion-grid\n *ngIf=\"vm.showsOptions\"\n [options]=\"vm.options\"\n [activeIndex]=\"vm.activeIndex\"\n [listboxId]=\"controller.listboxId\"\n [loading]=\"vm.isLoading\"\n [groupKey]=\"vm.groupKey\"\n [optionsPosition]=\"vm.optionsPosition\"\n (select)=\"onSelect($event)\"\n (highlight)=\"onHighlight($event)\"\n ></aia-suggestion-grid>\n\n <aia-date-grid\n *ngIf=\"vm.showsDateGrid\"\n [options]=\"vm.options\"\n [activeIndex]=\"vm.activeIndex\"\n [listboxId]=\"controller.listboxId\"\n [view]=\"vm.dateView\"\n [selection]=\"vm.dateSelection\"\n (select)=\"onSelect($event)\"\n (highlight)=\"onHighlight($event)\"\n (previousMonth)=\"onPreviousMonth()\"\n (nextMonth)=\"onNextMonth()\"\n ></aia-date-grid>\n\n <div\n *ngIf=\"vm.showsFallbackSkeleton\"\n class=\"magicx-aia-dropdown-skeleton-bars\"\n data-aia-skeleton-bars=\"\"\n >\n <span\n *ngFor=\"let w of fallbackSkeletonBarWidths; trackBy: trackByWidth\"\n class=\"magicx-aia-dropdown-skeleton-bar\"\n [style.width.px]=\"w\"\n ></span>\n </div>\n\n <!-- *ngIf, not just the section's own guard inside the component: the host\n element is an in-flow child of .aia-stack (display:flex; gap:8px), so\n an always-instantiated zero-height host would add a SECOND 8px gap\n between the grid and the footer — in every dropdown, products or not.\n The grid's --aia-grid-overlap-bottom is tuned for exactly one gap, so\n the footer would land 8px below the band it is meant to cover. -->\n <aia-product-strip\n *ngIf=\"vm.products.length > 0\"\n [products]=\"vm.products\"\n [listboxId]=\"controller.listboxId\"\n [focusable]=\"vm.isVisible\"\n (select)=\"onProductSelect($event)\"\n (focusChange)=\"onProductFocusChange($event)\"\n ></aia-product-strip>\n\n <footer class=\"magicx-aia-footer\" data-aia-footer=\"\">\n <div class=\"magicx-aia-footer-row\">\n <span class=\"magicx-aia-footer-hint-group\">\n <kbd class=\"magicx-aia-footer-key\">{{ vm.footerKey }}</kbd>\n <span class=\"magicx-aia-footer-hint\">{{ vm.footerHint }}</span>\n </span>\n <a\n class=\"magicx-aia-footer-brand-link\"\n [href]=\"brandHref\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <span class=\"magicx-aia-footer-brand\">AI</span>\n <span class=\"magicx-aia-footer-badge\">Autocomplete</span>\n </a>\n </div>\n </footer>\n </aia-stack>\n <!-- \"More below\" arrow — an overlay on the panel, not a section of the\n stack. Shown/positioned by the core's scroll-arrow controller (see\n syncScrollArrow); markup mirrors vanilla's createScrollArrowButton. -->\n <button\n #scrollArrow\n type=\"button\"\n tabindex=\"-1\"\n class=\"magicx-aia-scroll-arrow\"\n data-aia-scroll-arrow=\"\"\n [attr.aria-label]=\"scrollArrowLabel\"\n aria-hidden=\"true\"\n >\n <svg\n viewBox=\"0 0 16 16\"\n width=\"14\"\n height=\"14\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M4 6.5 8 10.5l4-4\" />\n </svg>\n </button>\n</div>\n","import { distinctUntilChanged, map, type Observable, shareReplay } from \"rxjs\";\n\n/**\n * Per-field observable derivation factory. Enforces the §19.4 invariant:\n *\n * - `distinctUntilChanged` — prevents re-emission storms when the upstream\n * state object ticks but the field a consumer cares about hasn't changed.\n * Without this, every keystroke would re-render every async-pipe binding\n * in the consumer's template even when nothing changed for that binding.\n * - `shareReplay({ bufferSize: 1, refCount: true })` — guarantees that\n * multiple subscribers (multiple `async` pipes in a template, e.g.\n * `*ngIf=\"isLoading$ | async\"` and `[disabled]=\"isLoading$ | async\"`)\n * share a single upstream subscription. `refCount: true` is non-obvious\n * but essential: without it, the inner subscription survives after the\n * last subscriber unmounts, leaking the chain back to `state$`.\n *\n * Every public observable on {@link AIAutocompleteController} must go through\n * this factory — no exceptions.\n *\n * @internal\n */\nexport function deriveField<T, R>(\n source$: Observable<T>,\n selector: (value: T) => R,\n equalityFn?: (a: R, b: R) => boolean,\n): Observable<R> {\n return source$.pipe(\n map(selector),\n distinctUntilChanged(equalityFn),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n}\n","import {\n type AutocompleteResult,\n type CompletedParamState,\n AIAutocomplete as CoreAIAutocomplete,\n type CoreState,\n dateSelectionFor,\n type IdentifiedParamState,\n identifiedParamLabel,\n type Product,\n type Segment,\n type SkippedParamState,\n type Suggestion,\n type SuggestionOption,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { BehaviorSubject, combineLatest, map, type Observable, shareReplay } from \"rxjs\";\nimport type {\n AIAutocompleteControllerOptions,\n AIAutocompleteControllerState,\n AIAutocompleteControllerUpdate,\n AIAutocompleteDropdownState,\n} from \"../shared/types\";\nimport { deriveField } from \"./observables\";\n\n/**\n * Tier 2 logic surface for `@magicx-eng/ai-autocomplete-angular` — the Angular\n * equivalent of React's `useAIAutocomplete()` hook. Wraps a headless\n * `@magicx-eng/ai-autocomplete-vanilla` core and exposes its state as RxJS\n * observables plus thin action methods.\n *\n * The controller is consumer-managed — the consumer creates it\n * with `new`, holds the reference, and **must call `destroy()`** in their\n * own `ngOnDestroy`. The Tier 1 `<ai-autocomplete>` component does this\n * automatically; Tier 2 consumers do not get auto-cleanup.\n *\n * @public\n */\nexport class AIAutocompleteController {\n private readonly core: CoreAIAutocomplete;\n private readonly rawState$: BehaviorSubject<CoreState>;\n // optionsPosition isn't part of CoreState (it's a core option), so track it\n // here and fold it into `dropdown$` so the dropdown can read placement from\n // the controller — configured once, kept in sync through update().\n private readonly optionsPosition$ = new BehaviorSubject<\"above\" | \"below\">(\"below\");\n private readonly unsubscribeCore: () => void;\n private isDestroyed = false;\n\n // === Per-field observables ===\n // Each one runs through deriveField, which bakes in distinctUntilChanged\n // and shareReplay({ bufferSize: 1, refCount: true }) per §19.4.\n\n /** Plain-text content of the editor. */\n readonly text$: Observable<string>;\n /** Completed (bold) params currently in the editor. */\n readonly completedParams$: Observable<CompletedParamState[]>;\n /**\n * Suggestions the user dismissed with the skip key (→). Nothing renders\n * them; they exist so a hand-rolled submit can pass them to\n * `buildSubmitResult` and carry the same `text: \"skipped\"` entries the\n * SDK's own requests do.\n */\n readonly skippedParams$: Observable<SkippedParamState[]>;\n /**\n * Params the server identified in the user's own words. Already rendered\n * through `segments$`; exposed so a hand-rolled submit can pass them to\n * `buildSubmitResult` and report the same `identified_params` the SDK's\n * own results carry.\n */\n readonly identifiedParams$: Observable<IdentifiedParamState[]>;\n /** Actionable suggestion pills (first one is the active pill). */\n readonly suggestionPills$: Observable<Suggestion[]>;\n /** Text + completed-param segments for rendering the editor body. */\n readonly segments$: Observable<Segment[]>;\n /** ID of the most-recently-promoted param (drives shimmer animation). */\n readonly newParamId$: Observable<string | null>;\n /** All suggestions from the server (including non-actionable ones). */\n readonly suggestions$: Observable<Suggestion[]>;\n /**\n * Results of the latest product search. Always empty unless `products` is\n * configured on the controller — the strip is opt-in and costs nothing when\n * it isn't wired up.\n */\n readonly products$: Observable<Product[]>;\n /** Currently highlighted dropdown option index. -1 = none. */\n readonly activeIndex$: Observable<number>;\n /**\n * UI-visible loading flag — suppressed during the post-select press\n * animation and during re-edit (cached options stay visible there). Use\n * this instead of the raw core state for any loading-skeleton binding.\n */\n readonly isLoading$: Observable<boolean>;\n /** Server-reported \"query is complete\" flag. */\n readonly isReady$: Observable<boolean>;\n /** Whether the editor currently has focus. */\n readonly isFocused$: Observable<boolean>;\n /** Whether the dropdown should currently be visible. */\n readonly isDropdownOpen$: Observable<boolean>;\n /**\n * Whether the active (leading) pill should render selected (full opacity)\n * rather than the de-emphasized `first` tier. Auto trigger ⇒ true only while\n * a dropdown option is highlighted; manual ⇒ true once the pill is tapped.\n */\n readonly isActivePillSelected$: Observable<boolean>;\n /** Server-suggested placeholder text for the editor. */\n readonly placeholderText$: Observable<string>;\n /** Last fetch error, or null. */\n readonly error$: Observable<Error | null>;\n /** Param currently being re-edited, or null. */\n readonly editingParam$: Observable<CompletedParamState | null>;\n /** Plain-text offset where the edit region starts, or null. */\n readonly editingAnchor$: Observable<number | null>;\n /** Live caret offset within the editor. */\n readonly caretOffset$: Observable<number | null>;\n\n // === Composite observables ===\n\n /**\n * Snapshot of every public field in one object. Convenient for\n * `*ngIf=\"ctrl.state$ | async as state\"` templating — aliases all fields\n * under a single subscription instead of multiple `| async` pipes.\n */\n readonly state$: Observable<AIAutocompleteControllerState>;\n\n /**\n * Composite state for the dropdown view. Tier 2 consumers spread this into\n * `<ai-autocomplete-dropdown>`; Tier 1 uses the same shape internally.\n */\n readonly dropdown$: Observable<AIAutocompleteDropdownState>;\n\n /**\n * Throws if invoked outside a browser environment. For SSR / Angular\n * Universal, gate construction with `isPlatformBrowser`.\n */\n constructor(opts: AIAutocompleteControllerOptions = {}) {\n if (typeof document === \"undefined\") {\n throw new Error(\n \"AIAutocompleteController requires a browser environment. \" +\n \"For SSR / Angular Universal, gate construction with isPlatformBrowser.\",\n );\n }\n\n // Headless mode never renders to the host, so a throwaway div is fine —\n // it's required by the core's signature for symmetry with full mode.\n const host = document.createElement(\"div\");\n\n this.core = new CoreAIAutocomplete(host, {\n ...opts,\n renderMode: \"headless\",\n source: opts.source ?? \"headless-sdk\",\n // Headless mode never renders the dropdown DOM, but the keyboard\n // controller still reads `optionsPosition` to decide which vertical\n // arrow opens the dropdown from the input.\n optionsPosition: opts.optionsPosition ?? \"below\",\n });\n\n this.rawState$ = new BehaviorSubject<CoreState>(this.core.getState());\n // Push the store's *current* state, not the snapshot the listener was\n // handed. The core notifies listeners synchronously, and some actions\n // trigger reentrant `store.set` calls (e.g. typing a non-matching char\n // during re-edit makes the core synchronously exit re-edit and kick off a\n // fetch).\n //\n // The core's store used to deliver such a nested set inline and then\n // resume the outer listener loop, so a listener could be handed an older\n // state (still in re-edit) *after* a newer one (re-edit exited) — which\n // resurrected a stale `editingParam` and retriggered the editor's re-edit\n // caret-park, yanking the caret back to where re-editing started. The\n // store now queues notifications and drains them in order, so that\n // out-of-order delivery can no longer happen at the source.\n //\n // Reading `getState()` at emission time is kept as belt-and-braces: it\n // costs nothing (distinctUntilChanged downstream drops the duplicate\n // emissions) and keeps this bridge correct for any future consumer that\n // emits mid-cascade. React needs neither, since it batches renders and\n // gates its caret effects on dependencies.\n this.unsubscribeCore = this.core.subscribe(() => {\n if (!this.isDestroyed) this.rawState$.next(this.core.getState());\n });\n\n // === Per-field observables ===\n // Array-valued fields use shallow equality. The vanilla store spreads on\n // every write (`store.set({ completedParams: [...] })`), so reference\n // equality would re-fire downstream subscribers on every state tick even\n // when the array's contents are unchanged. The other fields are\n // primitives or stable object references, so default identity equality\n // works fine.\n this.text$ = deriveField(this.rawState$, (s) => s.text);\n this.completedParams$ = deriveField(this.rawState$, (s) => s.completedParams, arrEq);\n this.skippedParams$ = deriveField(this.rawState$, (s) => s.skippedParams, arrEq);\n this.identifiedParams$ = deriveField(this.rawState$, (s) => s.identifiedParams, arrEq);\n this.suggestionPills$ = deriveField(this.rawState$, (s) => s.actionableSuggestions, arrEq);\n this.segments$ = deriveField(this.rawState$, (s) => s.segments, arrEq);\n this.newParamId$ = deriveField(this.rawState$, (s) => s.newParamId);\n this.suggestions$ = deriveField(this.rawState$, (s) => s.suggestions, arrEq);\n this.products$ = deriveField(this.rawState$, (s) => s.products, arrEq);\n this.activeIndex$ = deriveField(this.rawState$, (s) => s.activeDropdownIndex);\n this.isLoading$ = deriveField(this.rawState$, computeUiLoading);\n this.isReady$ = deriveField(this.rawState$, (s) => s.isReady);\n this.isFocused$ = deriveField(this.rawState$, (s) => s.isFocused);\n this.isDropdownOpen$ = deriveField(this.rawState$, (s) => s.isDropdownOpen);\n this.isActivePillSelected$ = deriveField(this.rawState$, (s) => s.isActivePillSelected);\n this.placeholderText$ = deriveField(this.rawState$, (s) => s.placeholderText);\n this.error$ = deriveField(this.rawState$, (s) => s.error);\n this.editingParam$ = deriveField(this.rawState$, (s) => s.editingParam);\n this.editingAnchor$ = deriveField(this.rawState$, (s) => s.editingAnchor);\n this.caretOffset$ = deriveField(this.rawState$, (s) => s.caretOffset);\n\n // === Composite observables ===\n // Project directly off `rawState$` with a single map() so each store\n // tick produces exactly ONE coherent state$ emission. Using\n // `combineLatest` over the per-field observables here would fire one\n // emission per inner-source tick (up to N per store update), and the\n // editor-host directive's post-promote refocus would run against an\n // intermediate state where `newParamId` was set but `segments` /\n // `caretOffset` still held their old values — leaving the caret stuck\n // at the pre-click position.\n this.state$ = this.rawState$.pipe(\n map(computeState),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n\n this.optionsPosition$.next(opts.optionsPosition ?? \"below\");\n this.dropdown$ = combineLatest([this.rawState$, this.optionsPosition$]).pipe(\n map(([s, optionsPosition]) => computeDropdown(s, optionsPosition)),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n }\n\n // === Read-only accessors ===\n\n /** Stable ARIA listbox ID for the dropdown. Pass to `<textarea aria-controls=\"...\">`. */\n get listboxId(): string {\n return this.core.listboxId;\n }\n\n /** Whether `destroy()` has been called. After destruction all action methods no-op. */\n get destroyed(): boolean {\n return this.isDestroyed;\n }\n\n /**\n * Synchronous snapshot of the controller's current public state. Mirrors\n * the latest emission of `state$`. Useful in callbacks where you can't\n * `subscribe` (e.g. inside an event handler).\n */\n getState(): AIAutocompleteControllerState {\n return computeState(this.rawState$.value);\n }\n\n /**\n * The structured query as the SDK understands it right now — the same\n * object `onResult` delivers after each response and `onSubmit` delivers\n * on submit. Read it on demand from a place that has no event handy (a\n * custom submit button, a \"save draft\" action).\n */\n getResult(): AutocompleteResult {\n return this.core.getResult();\n }\n\n // === Action methods (pass-through to the core) ===\n //\n // Every action method begins with an `isDestroyed` guard so that callers\n // who hold a stale reference after `destroy()` don't accidentally trigger\n // work on a torn-down core. The vanilla core does not gate its own methods\n // post-dispose — `reset()`, `handleTextChange()`, and friends would still\n // schedule fetches or fire HTTP requests against an aborted controller,\n // and the responses would have nowhere to surface (rawState$ is already\n // complete). The guard makes the JSDoc-promised \"no-op silently\"\n // semantics actually true.\n\n /** Clear all state, rotate `session_id`, and re-fetch. Call after submit. */\n reset(): void {\n if (this.isDestroyed) return;\n this.core.reset();\n }\n\n /** Pick a dropdown option (or replace the re-edited param if in re-edit mode). */\n selectOption(option: SuggestionOption): void {\n if (this.isDestroyed) return;\n this.core.selectOption(option);\n }\n\n /**\n * Announce a product selection — fires the `onProductSelect` callback the\n * controller was constructed with. `<ai-autocomplete-dropdown>` calls this\n * for you; consumers rendering their own strip call it themselves.\n *\n * Emitting is the whole behaviour: the SDK deliberately does not navigate to\n * `product.url`, because only the integration knows whether a selection\n * means \"open the PDP\", \"add to cart\", or \"fill the input\".\n */\n selectProduct(product: Product): void {\n if (this.isDestroyed) return;\n this.core.selectProduct(product);\n }\n\n /** Promote the pill at `index` to active (front of the list). */\n setActivePill(index: number): void {\n if (this.isDestroyed) return;\n this.core.setActivePill(index);\n }\n\n /**\n * Skip the active pill — same action as pressing → at the end of the input.\n * The dropdown's skip button calls this; consumers rendering their own skip\n * affordance call it directly. The skipped suggestion joins `skippedParams$`.\n */\n skipActivePill(): void {\n if (this.isDestroyed) return;\n this.core.skipActivePill();\n }\n\n /** Drop the last completed param's \"completed\" status. Text stays as plain text. */\n removeLastParam(): void {\n if (this.isDestroyed) return;\n this.core.removeLastParam();\n }\n\n /** Clear the shimmer animation state for the most-recently-added param. */\n clearNewParamId(): void {\n if (this.isDestroyed) return;\n this.core.clearNewParamId();\n }\n\n /** Controlled-mode setter for editor text. */\n setValue(text: string): void {\n if (this.isDestroyed) return;\n this.core.setValue(text);\n }\n\n /** Controlled-mode setter for completed params. */\n setCompletedParams(params: CompletedParamState[]): void {\n if (this.isDestroyed) return;\n this.core.setCompletedParams(params);\n }\n\n /** Forward plain-text input from the consumer's `<textarea>` to the core. */\n handleTextChange(value: string): void {\n if (this.isDestroyed) return;\n this.core.handleTextChange(value);\n }\n\n /** Forward keyboard events from the consumer's `<textarea>` to the core. */\n handleKeyDown(event: KeyboardEvent): void {\n if (this.isDestroyed) return;\n this.core.handleKeyDown(event);\n }\n\n /** Notify the core of focus state. */\n setFocused(focused: boolean): void {\n if (this.isDestroyed) return;\n this.core.setFocused(focused);\n }\n\n /** Enter re-edit mode for the bold param with the given id. */\n startEditingParam(paramId: string): void {\n if (this.isDestroyed) return;\n this.core.startEditingParam(paramId);\n }\n\n /** Exit re-edit mode without changing the bold param. */\n exitEditMode(): void {\n if (this.isDestroyed) return;\n this.core.exitEditMode();\n }\n\n /** Forward post-input caret position (extends the edit tail). */\n handleCaretAfterInput(offset: number | null): void {\n if (this.isDestroyed) return;\n this.core.handleCaretAfterInput(offset);\n }\n\n /** Forward selection-only caret moves (may exit re-edit). */\n handleCaretMove(offset: number | null): void {\n if (this.isDestroyed) return;\n this.core.handleCaretMove(offset);\n }\n\n /** Replace the bold param being re-edited. Returns true when applied. */\n replaceEditingRange(replacement: string): boolean {\n if (this.isDestroyed) return false;\n return this.core.replaceEditingRange(replacement);\n }\n\n /** Set the highlighted option index (typically driven by hover). */\n setActiveDropdownIndex(index: number): void {\n if (this.isDestroyed) return;\n this.core.setActiveDropdownIndex(index);\n }\n\n /** Page the datepicker back one month. No-op unless a date pill is active. */\n showPreviousMonth(): void {\n if (this.isDestroyed) return;\n this.core.showPreviousMonth();\n }\n\n /** Page the datepicker forward one month. No-op unless a date pill is active. */\n showNextMonth(): void {\n if (this.isDestroyed) return;\n this.core.showNextMonth();\n }\n\n // === Lifecycle ===\n\n /**\n * Apply runtime changes to a subset of options. Event callbacks\n * (`onSubmit`, `onResult`, `onError`, etc.) cannot be swapped this way — they are\n * registered once at construction (matches the React hook's design). For\n * dynamic event reactivity, subscribe to the corresponding observable\n * (e.g. `text$` instead of `onChange`).\n */\n update(opts: AIAutocompleteControllerUpdate): void {\n if (this.isDestroyed) return;\n this.core.update(opts);\n if (opts.optionsPosition !== undefined) {\n this.optionsPosition$.next(opts.optionsPosition);\n }\n }\n\n /**\n * Release all resources — unsubscribes from the core, destroys the core,\n * and completes the internal state subject. Safe to call multiple times.\n * After destruction, action methods no-op silently.\n */\n destroy(): void {\n if (this.isDestroyed) return;\n this.isDestroyed = true;\n this.unsubscribeCore();\n this.core.destroy();\n this.rawState$.complete();\n }\n}\n\n// ===== Pure helpers — not part of the public surface =====\n\n/**\n * Shallow array equality. The vanilla store reassigns array fields on every\n * write (`store.set({ completedParams: [...prev, x] })`), so reference\n * equality alone would re-emit downstream even when the contents are\n * identical. Used for `completedParams$`, `suggestions$`, `suggestionPills$`,\n * and `segments$`.\n */\nfunction arrEq<T>(a: readonly T[], b: readonly T[]): boolean {\n if (a === b) return true;\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n}\n\n/**\n * UI-visible loading: a suggest request outside re-edit and the post-select\n * press animation, or an `optionOverrides` entry still answering for the pill\n * on screen (which shows the skeleton in any mode — its pill has nothing else\n * to show yet).\n */\nfunction computeUiLoading(s: CoreState): boolean {\n return (s.isLoading && !s.editingParam && !s.inSelectionAnimation) || s.isSearchingOptions;\n}\n\nfunction computeState(s: CoreState): AIAutocompleteControllerState {\n return {\n text: s.text,\n completedParams: s.completedParams,\n skippedParams: s.skippedParams,\n identifiedParams: s.identifiedParams,\n suggestionPills: s.actionableSuggestions,\n segments: s.segments,\n newParamId: s.newParamId,\n suggestions: s.suggestions,\n products: s.products,\n activeIndex: s.activeDropdownIndex,\n isLoading: computeUiLoading(s),\n isReady: s.isReady,\n isFocused: s.isFocused,\n isDropdownOpen: s.isDropdownOpen,\n placeholderText: s.placeholderText,\n error: s.error,\n editingParam: s.editingParam,\n editingIdentified: s.editingIdentified,\n editingAnchor: s.editingAnchor,\n caretOffset: s.caretOffset,\n };\n}\n\nfunction computeDropdown(\n s: CoreState,\n optionsPosition: \"above\" | \"below\",\n): AIAutocompleteDropdownState {\n const editingParam = s.editingParam;\n const editingIdentified = s.editingIdentified;\n const dateSelection = dateSelectionFor(s);\n const activeSuggestion = s.actionableSuggestions[0];\n const dropdownPill: Suggestion | null = editingParam\n ? {\n type: editingParam.suggestionType,\n text: editingParam.suggestionPlaceholder,\n required: true,\n options: editingParam.options,\n }\n : editingIdentified\n ? // Answering a span the user wrote themselves: the pill names the\n // parameter the server matched it to, so the calendar isn't unlabelled.\n {\n type: editingIdentified.type,\n text: identifiedParamLabel(editingIdentified.type),\n required: true,\n options: [],\n }\n : null;\n const dropdownActivePill = dropdownPill ?? activeSuggestion;\n const dropdownPills = dropdownPill ? [dropdownPill] : s.actionableSuggestions;\n return {\n suggestions: dropdownActivePill ? [{ ...dropdownActivePill, options: s.filteredOptions }] : [],\n activeIndex: s.activeDropdownIndex,\n isOpen: s.isDropdownOpen,\n pills: dropdownPills,\n isActivePillSelected: s.isActivePillSelected,\n isLoading: computeUiLoading(s),\n isInputEmpty: s.text.trim().length === 0,\n products: s.products,\n isEditing: Boolean(editingParam) || Boolean(editingIdentified),\n inSelectionAnimation: s.inSelectionAnimation,\n // Datepicker. `s.filteredOptions` above already carries the visible\n // month's cells rather than the suggestion's own options when this is\n // \"date\" — the core swapped them in its derive layer, so the dropdown only\n // has to know which body to draw.\n formatType: s.activeFormatType,\n dateView: s.dateView,\n selectedDateIso: dateSelection.selectedIso,\n selectedDateRange: dateSelection.selectedRange,\n dateRangeStart: dateSelection.rangeStart,\n optionsPosition,\n };\n}\n","import {\n Directive,\n ElementRef,\n Input,\n inject,\n NgZone,\n type OnDestroy,\n type OnInit,\n Renderer2,\n} from \"@angular/core\";\nimport {\n extractPlainText,\n getCursorOffset,\n plainTextLength,\n renderEditableContent,\n setCursorOffset,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { Subject, takeUntil } from \"rxjs\";\nimport type { AIAutocompleteController } from \"../../controller/ai-autocomplete.controller\";\n\n/**\n * Module-level cache for the one-time plaintext-only feature detection.\n * Mirrors `supportsPlaintextOnly` in useContentEditableEditor.ts.\n */\nlet plaintextOnlyCache: boolean | undefined;\nfunction supportsPlaintextOnly(): boolean {\n if (plaintextOnlyCache !== undefined) return plaintextOnlyCache;\n if (typeof document === \"undefined\") return false;\n const probe = document.createElement(\"div\");\n probe.setAttribute(\"contenteditable\", \"plaintext-only\");\n plaintextOnlyCache = probe.contentEditable === \"plaintext-only\";\n return plaintextOnlyCache;\n}\n\n/**\n * Internal directive that owns every concern specific to running the\n * autocomplete on top of a contentEditable host: composition state, caret\n * tracking, selectionchange handling, `beforeinput` interception, paste\n * sanitization, plaintext-only feature detection, segment rendering,\n * post-promote refocus, and re-edit caret park.\n *\n * Mirrors `packages/react/src/hooks/useContentEditableEditor.ts` one-for-one.\n * Used only by the Tier 1 `<ai-autocomplete>` component — never exported.\n *\n * @internal\n */\n@Directive({\n selector: \"[aiaEditorHost]\",\n standalone: true,\n host: {\n role: \"combobox\",\n \"aria-autocomplete\": \"list\",\n \"aria-haspopup\": \"listbox\",\n spellcheck: \"true\",\n enterkeyhint: \"send\",\n tabindex: \"0\",\n \"(input)\": \"onInput()\",\n \"(keydown)\": \"onKeyDown($event)\",\n \"(compositionstart)\": \"onCompositionStart()\",\n \"(compositionend)\": \"onCompositionEnd()\",\n \"(paste)\": \"onPaste($event)\",\n \"(focus)\": \"onFocus()\",\n \"(blur)\": \"onBlur()\",\n },\n})\nexport class AIAutocompleteEditorHostDirective implements OnInit, OnDestroy {\n @Input(\"aiaEditorHost\") controller!: AIAutocompleteController;\n @Input() autoFocus = true;\n\n private readonly el = inject<ElementRef<HTMLDivElement>>(ElementRef);\n private readonly renderer = inject(Renderer2);\n private readonly zone = inject(NgZone);\n private readonly destroy$ = new Subject<void>();\n\n private composing = false;\n private lastInputAt = 0;\n private lastSeenParamId = \"\";\n private lastEditingId = \"\";\n /**\n * Id of whichever chip the dropdown is currently open on — a completed param\n * being re-edited, or a span the server identified as a date. Either kind\n * counts, otherwise every caret tick inside an open date span would re-enter\n * the pick it is already in.\n */\n private editingParamId: string | null = null;\n\n private documentSelectionListener?: () => void;\n private beforeInputListener?: (event: Event) => void;\n\n ngOnInit(): void {\n if (!this.controller) {\n throw new Error(\"[aiaEditorHost] requires a controller\");\n }\n\n const el = this.el.nativeElement;\n const ceMode = supportsPlaintextOnly() ? \"plaintext-only\" : \"true\";\n this.renderer.setAttribute(el, \"contenteditable\", ceMode);\n this.renderer.setAttribute(el, \"aria-controls\", this.controller.listboxId);\n this.renderer.setAttribute(el, \"suppress-content-editable-warning\", \"true\");\n\n // Auto-focus on mount. If the editor already has focus (e.g. from a\n // click that fired before our lifecycle ran), notify the controller\n // instead of stealing focus.\n if (this.autoFocus) {\n queueMicrotask(() => {\n if (typeof document === \"undefined\") return;\n if (document.activeElement === el) {\n this.controller.setFocused(true);\n } else {\n el.focus();\n }\n });\n }\n\n this.bindDocumentSelectionListener();\n this.bindBeforeInputListener();\n this.bindStateSubscription();\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n if (this.documentSelectionListener && typeof document !== \"undefined\") {\n document.removeEventListener(\"selectionchange\", this.documentSelectionListener);\n }\n if (this.beforeInputListener) {\n this.el.nativeElement.removeEventListener(\"beforeinput\", this.beforeInputListener);\n }\n }\n\n // === Host event handlers ===\n\n onCompositionStart(): void {\n this.composing = true;\n }\n\n onCompositionEnd(): void {\n this.composing = false;\n this.fireInput();\n }\n\n onInput(): void {\n this.lastInputAt = performance.now();\n this.fireInput();\n this.controller.handleCaretAfterInput(getCursorOffset(this.el.nativeElement));\n }\n\n onKeyDown(event: KeyboardEvent): void {\n this.controller.handleKeyDown(event);\n }\n\n onPaste(event: ClipboardEvent): void {\n event.preventDefault();\n const el = this.el.nativeElement;\n const text = (event.clipboardData?.getData(\"text/plain\") ?? \"\").replace(/\\r?\\n/g, \" \");\n if (!text) return;\n const doc = el.ownerDocument ?? document;\n const sel = doc.getSelection();\n if (!sel || sel.rangeCount === 0) return;\n const range = sel.getRangeAt(0);\n if (!el.contains(range.startContainer)) return;\n range.deleteContents();\n const node = doc.createTextNode(text);\n range.insertNode(node);\n range.setStartAfter(node);\n range.collapse(true);\n sel.removeAllRanges();\n sel.addRange(range);\n this.fireInput();\n }\n\n onFocus(): void {\n this.controller.setFocused(true);\n }\n\n onBlur(): void {\n this.controller.setFocused(false);\n }\n\n // === Internal helpers ===\n\n private fireInput(): void {\n if (this.composing) return;\n const el = this.el.nativeElement;\n const raw = extractPlainText(el);\n const shouldCapitalize = raw.length > 0 && raw[0] !== raw[0].toUpperCase();\n const next = shouldCapitalize ? raw[0].toUpperCase() + raw.slice(1) : raw;\n this.controller.handleTextChange(next);\n }\n\n private bindDocumentSelectionListener(): void {\n if (typeof document === \"undefined\") return;\n const el = this.el.nativeElement;\n // selectionchange fires on every keystroke and caret move — run outside\n // Angular's zone (§16.1) and re-enter only when we actually need to\n // notify the controller of a meaningful change.\n this.zone.runOutsideAngular(() => {\n const handler = (): void => {\n const sel = document.getSelection();\n if (!sel || sel.rangeCount === 0) return;\n if (!sel.anchorNode || !el.contains(sel.anchorNode)) return;\n const anchor = sel.anchorNode;\n const startEl =\n anchor.nodeType === Node.ELEMENT_NODE ? (anchor as Element) : anchor.parentElement;\n // Only a COLLAPSED selection means \"the caret landed in a chip\". A\n // range selection (Cmd+A, shift-arrow, drag) anchors at its start,\n // which lands inside the first `<strong>` whenever the input begins\n // with a chip — starting re-edit there parks the caret on that chip\n // and destroys the user's selection.\n const strong = sel.isCollapsed\n ? // Both chip kinds report here. The core decides what a tap means — a\n // completed param re-opens its options, an identified date opens the\n // calendar, anything else is inert.\n startEl?.closest<HTMLElement>(\"strong[data-param-id]\")\n : null;\n // `DOMStringMap` is an index signature; bracket notation is required\n // by `noPropertyAccessFromIndexSignature`.\n const enclosing = strong?.dataset[\"paramId\"] ?? null;\n if (enclosing && enclosing !== this.editingParamId) {\n this.zone.run(() => this.controller.startEditingParam(enclosing));\n return;\n }\n if (performance.now() - this.lastInputAt < 50) return;\n this.zone.run(() => this.controller.handleCaretMove(getCursorOffset(el)));\n };\n this.documentSelectionListener = handler;\n document.addEventListener(\"selectionchange\", handler);\n });\n }\n\n private bindBeforeInputListener(): void {\n const el = this.el.nativeElement;\n // Native beforeinput — React's synthetic onBeforeInput is wired to the\n // legacy textInput event and doesn't fire reliably for delete* types.\n const handler = (event: Event): void => {\n const inputEvent = event as InputEvent;\n const t = inputEvent.inputType;\n if (t === \"insertParagraph\" || t === \"insertLineBreak\" || t === \"insertFromDrop\") {\n event.preventDefault();\n return;\n }\n if (t.startsWith(\"insert\") || t.startsWith(\"delete\")) {\n const replacement = t.startsWith(\"delete\") ? \"\" : (inputEvent.data ?? \"\");\n if (this.controller.replaceEditingRange(replacement)) {\n event.preventDefault();\n }\n }\n };\n this.beforeInputListener = handler;\n el.addEventListener(\"beforeinput\", handler);\n }\n\n private bindStateSubscription(): void {\n const el = this.el.nativeElement;\n this.controller.state$.pipe(takeUntil(this.destroy$)).subscribe((state) => {\n this.editingParamId = state.editingParam?.id ?? state.editingIdentified?.id ?? null;\n\n renderEditableContent({\n input: el,\n segments: state.segments,\n newParamId: state.newParamId,\n editingParamId: state.editingParam?.id ?? null,\n placeholderText: state.placeholderText,\n isFocused: state.isFocused,\n });\n\n // Post-promote refocus + caret-after-bold placement (mirrors React's\n // useLayoutEffect on newParamId).\n const currentParamId = state.newParamId ?? \"\";\n if (currentParamId && currentParamId !== this.lastSeenParamId) {\n this.lastSeenParamId = currentParamId;\n el.focus();\n const desired = state.caretOffset ?? plainTextLength(el);\n setCursorOffset(el, desired);\n } else if (!currentParamId) {\n this.lastSeenParamId = \"\";\n }\n\n // Re-edit caret park (mirrors React's useLayoutEffect on editingParam).\n const editingId = state.editingParam?.id ?? \"\";\n if (editingId && editingId !== this.lastEditingId && state.editingAnchor != null) {\n this.lastEditingId = editingId;\n setCursorOffset(el, state.editingAnchor);\n } else if (!editingId) {\n this.lastEditingId = \"\";\n }\n });\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n ViewEncapsulation,\n} from \"@angular/core\";\n\n/**\n * Internal default submit button (up-arrow). Angular analogue of React's\n * `SubmitButton`. The default/custom/hidden branching stays in the parent\n * (`AIAutocompleteComponent`); this is only the built-in button.\n *\n * @internal\n */\n@Component({\n selector: \"aia-submit-button\",\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./submit-button.component.html\",\n styleUrls: [\"./submit-button.component.css\"],\n})\nexport class SubmitButtonComponent {\n @Input() disabled = false;\n @Output() readonly submit = new EventEmitter<MouseEvent>();\n\n onClick(event: MouseEvent): void {\n this.submit.emit(event);\n }\n}\n","<button\n type=\"button\"\n data-aia-submit=\"\"\n class=\"magicx-aia-submit-button\"\n [disabled]=\"disabled\"\n aria-label=\"Submit\"\n (click)=\"onClick($event)\"\n>\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" role=\"img\" aria-label=\"Submit\">\n <path\n d=\"M9 14V4M9 4L4 9M9 4L14 9\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n</button>\n","import { CommonModule, isPlatformBrowser } from \"@angular/common\";\nimport {\n type AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n type ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n inject,\n NgZone,\n type OnChanges,\n type OnDestroy,\n type OnInit,\n Output,\n PLATFORM_ID,\n type SimpleChanges,\n type TemplateRef,\n ViewChild,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport {\n type APIConfig,\n type AppearanceMode,\n type AutocompleteResult,\n buildSubmitResult,\n type CompletedParamState,\n extractPlainText,\n ModeController,\n type OptionOverrides,\n type Product,\n type ProductsConfig,\n setCursorOffset,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { AIAutocompleteDropdownComponent } from \"../ai-autocomplete-dropdown/ai-autocomplete-dropdown.component\";\nimport { AIAutocompleteController } from \"../controller/ai-autocomplete.controller\";\nimport { AIAutocompleteEditorHostDirective } from \"../internal/editor-host/editor-host.directive\";\nimport { PillListComponent } from \"../internal/pill-list/pill-list.component\";\nimport { SubmitButtonComponent } from \"../internal/submit-button/submit-button.component\";\n\n/**\n * Tier 1 component — `<ai-autocomplete>`. The Angular equivalent of React's\n * `<AIAutocomplete />`. Owns the contentEditable editor, inline pills, mode\n * controller, submit button slot, and an embedded\n * {@link AIAutocompleteController} that drives the dropdown.\n *\n * @public\n */\n@Component({\n selector: \"ai-autocomplete\",\n standalone: true,\n imports: [\n CommonModule,\n AIAutocompleteDropdownComponent,\n AIAutocompleteEditorHostDirective,\n PillListComponent,\n SubmitButtonComponent,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./ai-autocomplete.component.html\",\n styleUrls: [\"./ai-autocomplete.component.css\"],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n useExisting: forwardRef(() => AIAutocompleteComponent),\n multi: true,\n },\n ],\n})\nexport class AIAutocompleteComponent\n implements OnInit, AfterViewInit, OnChanges, OnDestroy, ControlValueAccessor\n{\n // === Inputs (mirrors React's AIAutocompleteProps) ===\n\n @Input() apiConfig?: APIConfig;\n /**\n * Optional user context. Include whatever you know about the user — a\n * profile, preferences, workspace, anything — to personalize suggested\n * parameters and options to them. Bind a stable reference; the same swap\n * rule that applies to `apiConfig` applies here.\n */\n @Input() additionalContext?: Record<string, unknown>;\n @Input() optionOverrides?: OptionOverrides;\n @Input() maskCompletedText = false;\n @Input() columns?: number;\n /** Where unfilled pills render. Default: \"dropdown\". */\n @Input() pillPlacement: \"inline\" | \"dropdown\" | \"hidden\" = \"dropdown\";\n /** Color mode. \"auto\" follows prefers-color-scheme. Default: \"auto\". */\n @Input() mode: AppearanceMode = \"auto\";\n @Input() optionsPosition: \"above\" | \"below\" = \"below\";\n @Input() animations = true;\n @Input() dropdownTrigger?: \"auto\" | \"manual\" | \"hidden\";\n @Input() closeDropdownOnBlur?: boolean;\n @Input() showNonTappableOptions?: boolean;\n /**\n * When true (default), the dropdown's pill bar ends in a small \"skip\" button\n * that dismisses the active pill — same action as pressing → at the end of\n * the input. Set to false to hide it. When pills render elsewhere\n * (`pillPlacement: \"inline\"` / `\"hidden\"`) the bar renders as a skip-only\n * row holding just the button. Hidden while the input is empty — it appears\n * alongside the footer's \"→ to skip\" hint once the user has typed.\n */\n @Input() showSkipButton = true;\n /** Focus the editor on mount. Default: true. */\n @Input() autoFocus = true;\n /** Controlled-mode text value. */\n @Input() value?: string;\n /** Controlled-mode completed params. */\n @Input() completedParams?: CompletedParamState[];\n /**\n * Opt-in product strip. When set, the dropdown renders a horizontal row of\n * product cards below the options grid, fed by your own search endpoint on\n * the SDK's existing fetch cadence. Omit it and nothing about the dropdown\n * changes — no request, no markup, no layout shift.\n *\n * Bind a stable reference (a component field, not an inline object literal):\n * a new object on each change-detection pass reads as a swapped integration\n * and clears the current cards — the same rule that already applies to\n * `apiConfig` and `optionOverrides`.\n */\n @Input() products?: ProductsConfig;\n /**\n * Custom submit button. Pass a `<ng-template>` to replace the default arrow\n * button. Pass `null` to render no button. Default (`undefined`) renders\n * the built-in arrow.\n */\n @Input() submitButton?: TemplateRef<unknown> | null;\n\n // === Outputs ===\n\n /** Called on Enter or submit-button click. */\n @Output() readonly submitted = new EventEmitter<AutocompleteResult>();\n /**\n * Fires after every successful suggestion round-trip with the structured\n * query as the SDK now understands it — the same `AutocompleteResult` shape\n * `submitted` carries, so you can mirror the query as it is built (a live\n * preview, a draft, analytics) without waiting for submit. Fires once per\n * applied response, including the initial request on init (an empty\n * result); never for a failed, aborted or superseded request.\n */\n @Output() readonly resultChange = new EventEmitter<AutocompleteResult>();\n @Output() readonly errored = new EventEmitter<Error>();\n @Output() readonly valueChange = new EventEmitter<string>();\n @Output() readonly completedParamsChange = new EventEmitter<CompletedParamState[]>();\n @Output() readonly focused = new EventEmitter<void>();\n @Output() readonly blurred = new EventEmitter<void>();\n /**\n * Emitted when the user activates a product card. The SDK does not\n * navigate — you decide what a selection means. Modifier / middle clicks are\n * left to the browser (cmd-click still opens a tab) and don't emit.\n */\n @Output() readonly productSelect = new EventEmitter<Product>();\n\n // === View refs ===\n\n @ViewChild(\"container\", { static: true }) containerRef!: ElementRef<HTMLDivElement>;\n @ViewChild(\"editor\", { static: false }) editorRef?: ElementRef<HTMLDivElement>;\n @ViewChild(\"pillContainer\") pillContainerRef?: ElementRef<HTMLSpanElement>;\n\n // === Public state for the template ===\n\n controller!: AIAutocompleteController;\n /**\n * Concrete light/dark value bound to `[attr.data-mode]`. Seeded in ngOnInit\n * so the attribute is present during SSR (where ModeController, gated behind\n * isPlatformBrowser in ngAfterViewInit, never runs). On the browser the\n * ModeController's resolve callback keeps this in sync — so its runtime\n * prefers-color-scheme updates and this binding always agree (no clobber).\n */\n resolvedMode: \"light\" | \"dark\" = \"dark\";\n\n // === Internal ===\n\n private modeController?: ModeController;\n private resizeObserver?: ResizeObserver;\n private onChangeFn: (value: string) => void = noop;\n private onTouchedFn: () => void = noop;\n // Holds a value written by Reactive Forms before ngOnInit ran. Reactive\n // Forms can call writeValue() during dynamic form construction (e.g. when\n // a FormControl already holds a value at the moment the directive is\n // created). We stash the value here and flush it in ngOnInit *after*\n // the controller exists — otherwise the editor renders empty even though\n // the form had a value. `undefined` means \"no pending write\".\n private pendingWriteValue: string | undefined;\n\n // §16.9: prefer `inject()` over constructor-parameter DI for components.\n private readonly platformId = inject(PLATFORM_ID);\n private readonly zone = inject(NgZone);\n private readonly cdr = inject(ChangeDetectorRef);\n\n ngOnInit(): void {\n // Seed before the browser guard so SSR renders a concrete data-mode.\n this.resolvedMode = resolveInitialMode(this.mode);\n if (!isPlatformBrowser(this.platformId)) return;\n\n this.controller = new AIAutocompleteController({\n apiConfig: this.apiConfig,\n additionalContext: this.additionalContext,\n optionOverrides: this.optionOverrides,\n maskCompletedText: this.maskCompletedText,\n columns: this.columns,\n dropdownTrigger: this.dropdownTrigger,\n optionsPosition: this.optionsPosition,\n closeDropdownOnBlur: this.closeDropdownOnBlur,\n showNonTappableOptions: this.showNonTappableOptions,\n source: \"full-sdk\",\n products: this.products,\n value: this.value,\n completedParams: this.completedParams,\n onSubmit: (result) => this.handleSubmit(result),\n onResult: (result) => this.resultChange.emit(result),\n onError: (error) => this.errored.emit(error),\n onChange: (text) => {\n this.valueChange.emit(text);\n this.onChangeFn(text);\n },\n onParamsChange: (params) => this.completedParamsChange.emit(params),\n onFocus: () => this.focused.emit(),\n onProductSelect: (product) => this.productSelect.emit(product),\n onBlur: () => {\n this.blurred.emit();\n this.onTouchedFn();\n },\n setCursor: (offset) => {\n const editor = this.editorRef?.nativeElement;\n if (!editor) return;\n editor.focus();\n setCursorOffset(editor, offset);\n },\n });\n\n if (this.pendingWriteValue !== undefined) {\n this.controller.setValue(this.pendingWriteValue);\n this.pendingWriteValue = undefined;\n }\n }\n\n ngAfterViewInit(): void {\n if (!isPlatformBrowser(this.platformId)) return;\n // ModeController writes `data-mode` to the element it's given. The CSS\n // selectors are scoped to `.magicx-aia[data-mode=\"...\"]` — which lives on\n // the inner `<div class=\"magicx-aia magicx-aia-container\" #container>`,\n // NOT the host `<ai-autocomplete>` element. The resolve callback mirrors\n // the value into `resolvedMode` so the `[attr.data-mode]` binding stays in\n // lockstep with ModeController — the binding handles SSR, ModeController\n // handles runtime prefers-color-scheme switches, and because they always\n // agree neither clobbers the other.\n this.modeController = new ModeController(\n this.containerRef.nativeElement,\n this.mode,\n (resolved) => {\n this.resolvedMode = resolved;\n this.cdr.markForCheck();\n },\n );\n\n // Pill-wrap detection — when the pill list wraps below the editor's last\n // line, drop its 8px left margin via a data attribute the CSS keys off.\n // Mirrors the React component's useLayoutEffect.\n if (typeof ResizeObserver !== \"undefined\") {\n this.zone.runOutsideAngular(() => {\n this.resizeObserver = new ResizeObserver(() => this.measurePillWrap());\n const editor = this.editorRef?.nativeElement;\n if (editor) this.resizeObserver.observe(editor);\n });\n this.measurePillWrap();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.controller) return;\n // `SimpleChanges` is `{ [key: string]: SimpleChange }`, so per\n // `noPropertyAccessFromIndexSignature` each key lookup uses bracket\n // notation — this keeps the strictness contract that the rest of the\n // workspace enforces.\n // Controlled-mode propagation\n if (changes[\"value\"] && this.value !== undefined) {\n this.controller.setValue(this.value);\n }\n if (changes[\"completedParams\"] && this.completedParams !== undefined) {\n this.controller.setCompletedParams(this.completedParams);\n }\n // Reactive options\n if (\n changes[\"apiConfig\"] ||\n changes[\"additionalContext\"] ||\n changes[\"optionOverrides\"] ||\n changes[\"dropdownTrigger\"] ||\n changes[\"optionsPosition\"] ||\n changes[\"closeDropdownOnBlur\"] ||\n changes[\"showNonTappableOptions\"] ||\n changes[\"products\"]\n ) {\n this.controller.update({\n apiConfig: this.apiConfig,\n additionalContext: this.additionalContext,\n optionOverrides: this.optionOverrides,\n dropdownTrigger: this.dropdownTrigger,\n optionsPosition: this.optionsPosition,\n closeDropdownOnBlur: this.closeDropdownOnBlur,\n showNonTappableOptions: this.showNonTappableOptions,\n // Same reference on an unrelated change is a no-op in the core; only a\n // genuinely swapped (or removed) integration clears the strip.\n products: this.products,\n });\n }\n if (changes[\"mode\"]) {\n // Keep the binding correct even when ModeController doesn't exist yet\n // (SSR / pre-ngAfterViewInit). On the browser, setMode triggers the\n // resolve callback which sets the same value.\n this.resolvedMode = resolveInitialMode(this.mode);\n this.modeController?.setMode(this.mode);\n }\n }\n\n ngOnDestroy(): void {\n this.resizeObserver?.disconnect();\n this.modeController?.destroy();\n this.controller?.destroy();\n }\n\n // === Imperative API (exposed on the component instance via @ViewChild) ===\n\n /** Programmatically focus the editor. */\n focus(): void {\n this.editorRef?.nativeElement.focus();\n }\n\n /** Programmatically blur the editor. */\n blur(): void {\n this.editorRef?.nativeElement.blur();\n }\n\n /** Clear all state, rotate session, and re-fetch. */\n reset(): void {\n this.controller?.reset();\n }\n\n /**\n * Skip the active pill — same action as the dropdown's skip button / →.\n * Lets a consumer who hides the built-in button (`showSkipButton=false`)\n * drive skipping from their own UI.\n */\n skipActivePill(): void {\n this.controller?.skipActivePill();\n }\n\n /** Switch color mode at runtime. */\n setMode(mode: AppearanceMode): void {\n this.mode = mode;\n this.resolvedMode = resolveInitialMode(mode);\n this.modeController?.setMode(mode);\n this.cdr.markForCheck();\n }\n\n // === Template helpers ===\n\n /**\n * 'default' → render the built-in arrow button.\n * 'custom' → project the consumer-supplied TemplateRef.\n * 'hidden' → no button.\n */\n get submitButtonState(): \"default\" | \"custom\" | \"hidden\" {\n if (this.submitButton === null) return \"hidden\";\n if (this.submitButton === undefined) return \"default\";\n return \"custom\";\n }\n\n /** Narrowed accessor for *ngTemplateOutlet — never undefined. */\n get customSubmitTemplate(): TemplateRef<unknown> | null {\n return this.submitButton ?? null;\n }\n\n get showInlinePills(): boolean {\n return this.pillPlacement === \"inline\";\n }\n\n get showDropdownPills(): boolean {\n return this.pillPlacement === \"dropdown\";\n }\n\n /**\n * `true` when there's something to submit — driven by current segments\n * and completed params. Read off the live editor via the controller state.\n */\n canSubmit(state: { segments: { length: number }; completedParams: { length: number } }): boolean {\n return state.segments.length > 0 || state.completedParams.length > 0;\n }\n\n onWrapperClick(event: MouseEvent): void {\n // Clicking a pill should activate it without stealing focus elsewhere.\n const target = event.target as HTMLElement | null;\n if (target?.closest(\"[data-aia-pill]\")) return;\n this.focus();\n }\n\n onSubmitButtonClick(event: MouseEvent): void {\n event.stopPropagation();\n this.handleSubmitFromUserAction();\n }\n\n onSubmitSlotClick(event: MouseEvent): void {\n event.stopPropagation();\n this.handleSubmitFromUserAction();\n }\n\n onSelectPill(index: number): void {\n this.controller.setActivePill(index);\n }\n\n // === ControlValueAccessor ===\n\n writeValue(value: string | null): void {\n const next = value ?? \"\";\n if (!this.controller) {\n // Reactive Forms can call writeValue() before ngOnInit creates the\n // controller (dynamic form construction, or a FormControl that already\n // had a value at directive-creation time). Buffer the value; ngOnInit\n // flushes it as soon as the controller exists.\n this.pendingWriteValue = next;\n return;\n }\n this.controller.setValue(next);\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChangeFn = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouchedFn = fn;\n }\n\n setDisabledState(_disabled: boolean): void {\n // The contentEditable host doesn't have a native disabled attribute. For\n // v0.1 we accept the call so Angular's forms layer doesn't throw, but\n // the editor stays interactive. A future enhancement can toggle\n // contentEditable + ARIA disabled here.\n }\n\n // === Submit flow ===\n\n /**\n * Called by the controller's onSubmit callback (which fires from the\n * keyboard controller on Enter). Reads the live editor text — same trick\n * the React component uses — so the emitted query reflects whatever's in\n * the DOM right now, not a possibly-stale state snapshot.\n */\n private handleSubmit(_result: AutocompleteResult): void {\n const editor = this.editorRef?.nativeElement;\n if (!editor) return;\n const text = extractPlainText(editor);\n const state = this.controller.getState();\n const params = this.completedParams ?? state.completedParams;\n this.submitted.emit(\n buildSubmitResult(text, params, state.skippedParams, {\n identifiedParams: state.identifiedParams,\n isReady: state.isReady,\n }),\n );\n this.controller.reset();\n }\n\n private handleSubmitFromUserAction(): void {\n const state = this.controller.getState();\n if (!this.canSubmit(state)) return;\n // Synthesize the result for the submit-button click path; same shape\n // the controller would deliver from a keyboard Enter, so handleSubmit\n // can take either entry point.\n this.handleSubmit({\n query: state.text.trim(),\n raw_query: \"\",\n completed_params: [],\n identified_params: [],\n is_ready: state.isReady,\n });\n }\n\n private measurePillWrap(): void {\n const container = this.pillContainerRef?.nativeElement;\n const editor = this.editorRef?.nativeElement;\n if (!container || !editor) return;\n const inner = container.firstElementChild as HTMLElement | null;\n if (!inner) return;\n // Wrap detection: the pill row's top vs the editor's bottom. When the\n // pills sit on (or above) the editor's last line they're NOT wrapped —\n // keep the 8px margin so they don't butt against typed text or the\n // placeholder. This handles the empty-editor + placeholder case\n // naturally: the placeholder still occupies the editor's line box.\n const cRect = inner.getBoundingClientRect();\n const eRect = editor.getBoundingClientRect();\n const wrapped = cRect.top >= eRect.bottom - 2;\n this.zone.run(() => {\n if (wrapped) container.setAttribute(\"data-aia-pill-wrapped\", \"\");\n else container.removeAttribute(\"data-aia-pill-wrapped\");\n });\n }\n}\n\nfunction noop(): void {\n // Default no-op for CVA callbacks.\n}\n\n/**\n * Resolve a concrete light/dark value from the configured mode. Used to seed\n * the `data-mode` attribute synchronously (including during SSR, where\n * ModeController never runs). On the server `window` is undefined → defaults\n * to \"dark\" (matches the vanilla/React behavior).\n */\nfunction resolveInitialMode(mode: AppearanceMode): \"light\" | \"dark\" {\n if (mode !== \"auto\") return mode;\n if (typeof window === \"undefined\") return \"dark\";\n return window.matchMedia(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\";\n}\n","<div\n #container\n class=\"magicx-aia magicx-aia-container\"\n [attr.data-pill-placement]=\"pillPlacement\"\n [attr.data-options-position]=\"optionsPosition\"\n [attr.data-animations]=\"animations ? 'on' : 'off'\"\n [attr.data-mode]=\"resolvedMode\"\n>\n <ai-autocomplete-dropdown\n *ngIf=\"controller\"\n [controller]=\"controller\"\n [showPills]=\"showDropdownPills\"\n [showSkipButton]=\"showSkipButton\"\n ></ai-autocomplete-dropdown>\n\n <div\n class=\"magicx-aia-input-wrapper\"\n (click)=\"onWrapperClick($event)\"\n (keyup)=\"$event.stopPropagation()\"\n >\n <div class=\"magicx-aia-editor-area\" data-aia-editor=\"\">\n <div\n #editor\n *ngIf=\"controller\"\n [aiaEditorHost]=\"controller\"\n [autoFocus]=\"autoFocus\"\n class=\"magicx-aia-input\"\n data-aia-input=\"\"\n ></div>\n\n <ng-container *ngIf=\"controller && showInlinePills\">\n <span\n #pillContainer\n class=\"magicx-aia-pill-list-container\"\n data-aia-pill-list-container=\"\"\n *ngIf=\"\n (controller.isLoading$ | async) ||\n ((controller.suggestionPills$ | async)?.length ?? 0) > 0\n \"\n >\n <aia-pill-list\n [pills]=\"(controller.suggestionPills$ | async) ?? []\"\n [activePillIndex]=\"0\"\n [activeSelected]=\"(controller.isActivePillSelected$ | async) ?? false\"\n [loading]=\"(controller.isLoading$ | async) ?? false\"\n (selectPill)=\"onSelectPill($event)\"\n ></aia-pill-list>\n </span>\n </ng-container>\n </div>\n\n <ng-container [ngSwitch]=\"submitButtonState\">\n <aia-submit-button\n *ngSwitchCase=\"'default'\"\n [disabled]=\"\n !(\n controller &&\n canSubmit({\n segments: (controller.segments$ | async) ?? [],\n completedParams: (controller.completedParams$ | async) ?? []\n })\n )\n \"\n (submit)=\"onSubmitButtonClick($event)\"\n ></aia-submit-button>\n\n <span\n *ngSwitchCase=\"'custom'\"\n data-aia-submit=\"\"\n class=\"magicx-aia-submit-slot\"\n (click)=\"onSubmitSlotClick($event)\"\n >\n <ng-container *ngTemplateOutlet=\"customSubmitTemplate\"></ng-container>\n </span>\n </ng-container>\n </div>\n</div>\n","import {\n Directive,\n ElementRef,\n forwardRef,\n Input,\n inject,\n type OnDestroy,\n type OnInit,\n Renderer2,\n} from \"@angular/core\";\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { Subject, takeUntil } from \"rxjs\";\nimport type { AIAutocompleteController } from \"../controller/ai-autocomplete.controller\";\n\n/**\n * Tier 2 input binder. Attach to a `<textarea>` or `<input>` and pass an\n * {@link AIAutocompleteController}:\n *\n * ```html\n * <textarea [aiaInput]=\"ac\"></textarea>\n * ```\n *\n * The directive wires the input's events (input/keydown/focus/blur) to the\n * controller, mirrors controller state into ARIA attributes\n * (`role=\"combobox\"`, `aria-expanded`, `aria-activedescendant`,\n * `aria-autocomplete`, `aria-controls`), and implements\n * {@link ControlValueAccessor} so the host element participates in Reactive\n * Forms out of the box:\n *\n * ```html\n * <textarea [aiaInput]=\"ac\" [formControl]=\"myControl\"></textarea>\n * ```\n *\n * Per the React hook's behavior, the first typed character is auto-capitalized\n * — typing \"h\" becomes \"H\" before being forwarded to the controller. The\n * cursor position is preserved across that rewrite.\n *\n * @public\n */\n@Directive({\n selector: \"[aiaInput]\",\n standalone: true,\n host: {\n role: \"combobox\",\n \"aria-autocomplete\": \"list\",\n \"(input)\": \"onInput($event)\",\n \"(keydown)\": \"onKeyDown($event)\",\n \"(keyup)\": \"onCaretMove()\",\n \"(mouseup)\": \"onCaretMove()\",\n \"(focus)\": \"onFocus()\",\n \"(blur)\": \"onBlur()\",\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n useExisting: forwardRef(() => AIAutocompleteInputDirective),\n multi: true,\n },\n ],\n})\nexport class AIAutocompleteInputDirective implements OnInit, OnDestroy, ControlValueAccessor {\n /**\n * The {@link AIAutocompleteController} that owns the autocomplete state.\n * Required. The directive throws on init if this is missing.\n */\n @Input(\"aiaInput\") controller!: AIAutocompleteController;\n\n private readonly el = inject<ElementRef<HTMLInputElement | HTMLTextAreaElement>>(ElementRef);\n private readonly renderer = inject(Renderer2);\n private readonly destroy$ = new Subject<void>();\n\n private onChangeFn: (value: string) => void = noop;\n private onTouchedFn: () => void = noop;\n // Timestamp of the last `input` event. A `keyup`/`select` that fires within\n // this window is the tail of a keystroke, not a deliberate caret move, so we\n // skip the caret-move handler there (mirrors the editor host's selectionchange\n // guard). performance.now() is monotonic; 0 means \"no input yet\".\n private lastInputAt = 0;\n // Tracks the most-recently-promoted param so we only reposition the caret\n // once per option selection (mirrors the editor host's post-promote refocus).\n private lastSeenParamId = \"\";\n // Holds a value written by Reactive Forms before ngOnInit ran. Reactive\n // Forms can call writeValue() during dynamic form construction (e.g. when\n // a control is patched at the moment the directive is created), and our\n // controller binding may not be initialized yet. We stash the value here\n // and flush it into the controller in ngOnInit *before* subscribing to\n // text$, otherwise text$'s initial \"\" emission would clobber the form\n // value the textarea already shows. `undefined` means \"no pending write\".\n private pendingWriteValue: string | undefined;\n\n ngOnInit(): void {\n if (!this.controller) {\n throw new Error('[aiaInput] requires a controller — use `[aiaInput]=\"myController\"`.');\n }\n\n if (this.pendingWriteValue !== undefined) {\n this.controller.setValue(this.pendingWriteValue);\n this.pendingWriteValue = undefined;\n }\n\n const el = this.el.nativeElement;\n this.renderer.setAttribute(el, \"aria-controls\", this.controller.listboxId);\n\n // Sync editor text → DOM. Skips the write when values already match, so\n // user keystrokes don't fight with our writeback. Preserves the caret\n // position when we do write (and the element still has focus).\n this.controller.text$.pipe(takeUntil(this.destroy$)).subscribe((text) => {\n if (el.value === text) return;\n const wasFocused = typeof document !== \"undefined\" && document.activeElement === el;\n const start = el.selectionStart;\n const end = el.selectionEnd;\n this.renderer.setProperty(el, \"value\", text);\n if (wasFocused && start != null && end != null) {\n const clampedStart = Math.min(start, text.length);\n const clampedEnd = Math.min(end, text.length);\n try {\n el.setSelectionRange(clampedStart, clampedEnd);\n } catch {\n // `setSelectionRange` throws on some input types (e.g. \"number\");\n // safe to ignore — those inputs don't have a meaningful selection.\n }\n }\n });\n\n this.controller.isDropdownOpen$.pipe(takeUntil(this.destroy$)).subscribe((isOpen) => {\n this.renderer.setAttribute(el, \"aria-expanded\", String(isOpen));\n });\n\n this.controller.activeIndex$.pipe(takeUntil(this.destroy$)).subscribe((idx) => {\n if (idx >= 0) {\n this.renderer.setAttribute(\n el,\n \"aria-activedescendant\",\n `${this.controller.listboxId}-option-${idx}`,\n );\n } else {\n this.renderer.removeAttribute(el, \"aria-activedescendant\");\n }\n });\n\n // After an option selection promotes a param, the core appends its text and\n // stamps `caretOffset` at the end of the inserted text. The text$ subscriber\n // above writes the new value but *restores the pre-write caret* (correct for\n // typing echoes, wrong here), so we move the caret to the promoted position.\n // Keyed on newParamId so it fires once per selection, not on every tick.\n // Registered after text$ so the new value is in the DOM before we seek.\n this.controller.newParamId$.pipe(takeUntil(this.destroy$)).subscribe((id) => {\n const current = id ?? \"\";\n if (current && current !== this.lastSeenParamId) {\n this.lastSeenParamId = current;\n const offset = this.controller.getState().caretOffset ?? el.value.length;\n const clamped = Math.min(Math.max(offset, 0), el.value.length);\n // Only grab focus if we don't already have it — don't yank focus back\n // from wherever the user moved it after selecting (e.g. a host-app\n // button). setSelectionRange still positions the caret regardless.\n if (typeof document !== \"undefined\" && document.activeElement !== el) {\n el.focus();\n }\n try {\n el.setSelectionRange(clamped, clamped);\n } catch {\n // Some input types (e.g. \"number\") don't support setSelectionRange.\n }\n } else if (!current) {\n this.lastSeenParamId = \"\";\n }\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n // === Event handlers (wired via host metadata above) ===\n\n /**\n * Auto-capitalizes the first character on the user's first keystroke so the\n * server receives \"Create\" instead of \"create\". Matches React's\n * `handleChange` in `useAIAutocomplete`. Skipped during IME composition so\n * we don't disrupt multi-keystroke input methods (Pinyin, Hangul, etc.).\n */\n onInput(event: Event): void {\n // Stamp the input time before anything else. The autocapitalize path below\n // calls setSelectionRange, which can synchronously fire a `select` event →\n // onCaretMove; stamping first ensures that event falls inside the guard\n // window and is treated as part of this keystroke, not a caret move.\n this.lastInputAt = performance.now();\n const target = event.target as HTMLInputElement | HTMLTextAreaElement;\n const raw = target.value;\n const isComposing = (event as InputEvent).isComposing === true;\n const shouldCapitalize = raw.length > 0 && !isComposing && raw[0] !== raw[0].toUpperCase();\n\n let next = raw;\n if (shouldCapitalize) {\n const start = target.selectionStart;\n const end = target.selectionEnd;\n next = raw[0].toUpperCase() + raw.slice(1);\n this.renderer.setProperty(target, \"value\", next);\n if (start != null && end != null) {\n try {\n target.setSelectionRange(start, end);\n } catch {\n // See note in ngOnInit's text$ subscriber.\n }\n }\n }\n\n this.controller.handleTextChange(next);\n // Sync the real caret into the core. The dropdown's auto-trigger gate only\n // opens when the caret is at the end of the text; without this, the core's\n // `caretOffset` stays pinned at whatever a prior promote/select set it to\n // and goes stale as the user keeps typing, wedging the dropdown closed.\n // selectionStart is null on some input types (number/email/color); treat\n // that as \"caret at end\" rather than feeding null into the core.\n this.controller.handleCaretAfterInput(target.selectionStart ?? target.value.length);\n this.onChangeFn(next);\n }\n\n onKeyDown(event: KeyboardEvent): void {\n this.controller.handleKeyDown(event);\n }\n\n /**\n * Caret moved by something other than typing — arrow keys, Home/End, or a\n * mouse click/drag (keyup + mouseup). Forward the new offset so the core can\n * re-evaluate the caret-at-end dropdown gate (and exit re-edit if the caret\n * left the region). We deliberately do NOT listen for the `select` event:\n * programmatic `setSelectionRange` calls (the text$ writeback, the post-select\n * caret reposition) fire it in jsdom/some browsers, which would re-enter here\n * and clobber `caretOffset`. `keyup`/`mouseup` only fire for real user input.\n * Skipped right after an `input` event, where the caret is already handled by\n * `handleCaretAfterInput` above.\n */\n onCaretMove(): void {\n if (performance.now() - this.lastInputAt < 50) return;\n const el = this.el.nativeElement;\n // selectionStart is null on some input types — treat as caret at end.\n this.controller.handleCaretMove(el.selectionStart ?? el.value.length);\n }\n\n onFocus(): void {\n this.controller.setFocused(true);\n }\n\n onBlur(): void {\n this.controller.setFocused(false);\n this.onTouchedFn();\n }\n\n // === ControlValueAccessor ===\n\n writeValue(value: string | null): void {\n const next = value ?? \"\";\n this.renderer.setProperty(this.el.nativeElement, \"value\", next);\n // If Angular calls writeValue() before ngOnInit (possible during dynamic\n // form construction), queue the value and let ngOnInit flush it. We\n // can't push it into the controller now because either the controller\n // binding hasn't resolved yet, or text$'s initial subscription would\n // overwrite it moments later.\n if (this.controller) {\n this.controller.setValue(next);\n } else {\n this.pendingWriteValue = next;\n }\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChangeFn = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouchedFn = fn;\n }\n\n setDisabledState(disabled: boolean): void {\n this.renderer.setProperty(this.el.nativeElement, \"disabled\", disabled);\n }\n}\n\nfunction noop(): void {\n // Default no-op callback for CVA — overwritten by Angular's form bridge.\n}\n","import { NgModule } from \"@angular/core\";\nimport { AIAutocompleteComponent } from \"./ai-autocomplete/ai-autocomplete.component\";\nimport { AIAutocompleteDropdownComponent } from \"./ai-autocomplete-dropdown/ai-autocomplete-dropdown.component\";\nimport { AIAutocompleteInputDirective } from \"./input/ai-autocomplete-input.directive\";\n\n/**\n * Convenience NgModule that re-exports every public component and directive\n * in this package. Standalone-first consumers can import the individual\n * symbols directly; legacy NgModule-based codebases import this once and\n * get everything.\n *\n * @public\n */\n@NgModule({\n imports: [AIAutocompleteComponent, AIAutocompleteDropdownComponent, AIAutocompleteInputDirective],\n exports: [AIAutocompleteComponent, AIAutocompleteDropdownComponent, AIAutocompleteInputDirective],\n})\nexport class AIAutocompleteModule {}\n","/**\n * Public API surface for @magicx-eng/ai-autocomplete-angular.\n *\n * Populated incrementally as features land. Only symbols re-exported here\n * are considered part of the package's public contract.\n */\n\n// === Re-exported wire types ===\nexport type {\n AccessTokenConfig,\n AccessTokenResult,\n APIConfig,\n APIKeyConfig,\n AppearanceMode,\n AutocompleteResult,\n CompletedParam,\n CompletedParamState,\n DateMonthView,\n DateRange,\n FormatType,\n IdentifiedParam,\n IdentifiedParamState,\n OptionOverrides,\n Product,\n ProductsConfig,\n Segment,\n SkippedParamState,\n SubmitResultExtras,\n Suggestion,\n SuggestionOption,\n TaskKind,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n// === Submit-result builder (folds skipped params into completed_params) ===\nimport {\n buildSubmitResult as _buildSubmitResult,\n cellDay as _cellDay,\n cellIso as _cellIso,\n DATE_RANGE_META_END as _DATE_RANGE_META_END,\n DATE_RANGE_META_START as _DATE_RANGE_META_START,\n dateCellMarks as _dateCellMarks,\n formatDate as _formatDate,\n formatDateRange as _formatDateRange,\n isoDate as _isoDate,\n monthLabel as _monthLabel,\n parseDate as _parseDate,\n parseLooseDate as _parseLooseDate,\n parseLooseDateRange as _parseLooseDateRange,\n selectedRangeFor as _selectedRangeFor,\n visibleDateRange as _visibleDateRange,\n WEEKDAY_LABELS as _WEEKDAY_LABELS,\n withSkippedParams as _withSkippedParams,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n/**\n * Re-exported through local bindings rather than `export ... from`.\n *\n * ng-packagr's flat bundles drop a bare `export { x } from \"<external>\"`: the\n * name survives in the generated `.d.ts`, so consumer code typechecks, but the\n * symbol is absent from `fesm2020` — the entry point the `exports` map resolves\n * by default — and is `undefined` at runtime. Binding to a local const forces\n * it into the bundle.\n */\nexport const buildSubmitResult = _buildSubmitResult;\nexport const withSkippedParams = _withSkippedParams;\n// Date helpers, for turning a committed date back into a `Date` and for\n// rendering a custom calendar in Tier 3.\nexport const cellDay = _cellDay;\nexport const cellIso = _cellIso;\nexport const formatDate = _formatDate;\nexport const isoDate = _isoDate;\nexport const monthLabel = _monthLabel;\nexport const parseDate = _parseDate;\nexport const parseLooseDate = _parseLooseDate;\nexport const WEEKDAY_LABELS = _WEEKDAY_LABELS;\n// Range helpers, for a custom calendar that answers a span in two taps.\n// The two metadata keys are what a committed range records its ends under, so\n// a consumer reading them back never hardcodes the strings.\nexport const DATE_RANGE_META_END = _DATE_RANGE_META_END;\nexport const DATE_RANGE_META_START = _DATE_RANGE_META_START;\nexport const dateCellMarks = _dateCellMarks;\nexport const formatDateRange = _formatDateRange;\nexport const parseLooseDateRange = _parseLooseDateRange;\nexport const selectedRangeFor = _selectedRangeFor;\nexport const visibleDateRange = _visibleDateRange;\n// === Tier 1: Full component ===\nexport { AIAutocompleteComponent } from \"./lib/ai-autocomplete\";\n// === Convenience NgModule ===\nexport { AIAutocompleteModule } from \"./lib/ai-autocomplete.module\";\n// === Tier 2: Dropdown component ===\nexport { AIAutocompleteDropdownComponent } from \"./lib/ai-autocomplete-dropdown\";\n// === Tier 2: Controller (headless logic class) ===\nexport { AIAutocompleteController } from \"./lib/controller\";\n// === Tier 2: Input binder + ControlValueAccessor ===\nexport { AIAutocompleteInputDirective } from \"./lib/input\";\n// === Angular-specific public types ===\nexport type {\n AIAutocompleteControllerOptions,\n AIAutocompleteControllerState,\n AIAutocompleteControllerUpdate,\n AIAutocompleteDropdownState,\n} from \"./lib/shared/types\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["WEEKDAY_LABELS","cellIso","monthLabel","cellDay","isoDate","dateCellMarks","visibleDateRange","map","CoreAIAutocomplete","noop","buildSubmitResult","_buildSubmitResult","_withSkippedParams","_cellDay","_cellIso","_formatDate","_isoDate","_monthLabel","_parseDate","_parseLooseDate","_WEEKDAY_LABELS","_DATE_RANGE_META_END","_DATE_RANGE_META_START","_dateCellMarks","_formatDateRange","_parseLooseDateRange","_selectedRangeFor","_visibleDateRange"],"mappings":";;;;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4BH;AAqBA;;;;;;;;AAQG;AACI,MAAM,iBAAiB,GAAGE,oBAAmB;AAC7C,MAAM,iBAAiB,GAAGC,oBAAmB;AACpD;AACA;AACO,MAAM,OAAO,GAAGC,UAAS;AACzB,MAAM,OAAO,GAAGC,UAAS;AACzB,MAAM,UAAU,GAAGC,aAAY;AAC/B,MAAM,OAAO,GAAGC,UAAS;AACzB,MAAM,UAAU,GAAGC,aAAY;AAC/B,MAAM,SAAS,GAAGC,YAAW;AAC7B,MAAM,cAAc,GAAGC,iBAAgB;AACvC,MAAM,cAAc,GAAGC,iBAAgB;AAC9C;AACA;AACA;AACO,MAAM,mBAAmB,GAAGC,sBAAqB;AACjD,MAAM,qBAAqB,GAAGC,wBAAuB;AACrD,MAAM,aAAa,GAAGC,gBAAe;AACrC,MAAM,eAAe,GAAGC,kBAAiB;AACzC,MAAM,mBAAmB,GAAGC,sBAAqB;AACjD,MAAM,gBAAgB,GAAGC,mBAAkB;AAC3C,MAAM,gBAAgB,GAAGC;;ACpFhC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"magicx-eng-ai-autocomplete-angular.mjs","sources":["../../src/lib/internal/date-grid/date-grid.component.ts","../../src/lib/internal/date-grid/date-grid.component.html","../../src/lib/internal/layout/cluster.component.ts","../../src/lib/internal/layout/stack.component.ts","../../src/lib/internal/pill-list/pill-list.component.ts","../../src/lib/internal/pill-list/pill-list.component.html","../../src/lib/internal/product-strip/product-strip.component.ts","../../src/lib/internal/product-strip/product-strip.component.html","../../src/lib/internal/layout/grid.component.ts","../../src/lib/internal/layout/grid.component.html","../../src/lib/internal/suggestion-item/suggestion-item.component.ts","../../src/lib/internal/suggestion-item/suggestion-item.component.html","../../src/lib/internal/suggestion-grid/suggestion-grid.component.ts","../../src/lib/internal/suggestion-grid/suggestion-grid.component.html","../../src/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.ts","../../src/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.html","../../src/lib/controller/observables.ts","../../src/lib/controller/ai-autocomplete.controller.ts","../../src/lib/internal/editor-host/editor-host.directive.ts","../../src/lib/internal/submit-button/submit-button.component.ts","../../src/lib/internal/submit-button/submit-button.component.html","../../src/lib/ai-autocomplete/ai-autocomplete.component.ts","../../src/lib/ai-autocomplete/ai-autocomplete.component.html","../../src/lib/input/ai-autocomplete-input.directive.ts","../../src/lib/ai-autocomplete.module.ts","../../src/public-api.ts","../../src/magicx-eng-ai-autocomplete-angular.ts"],"sourcesContent":["import { CommonModule } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport {\n cellDay,\n cellIso,\n type DateMonthView,\n type DateRange,\n type DateSelection,\n dateCellMarks,\n isoDate,\n monthLabel,\n type SuggestionOption,\n visibleDateRange,\n WEEKDAY_LABELS,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n/**\n * The dropdown's calendar body, rendered in place of the options grid when the\n * active parameter is a date. Angular analogue of vanilla's `renderDateGrid`\n * and React's `<DateGrid>`.\n *\n * The cells carry the same `${listboxId}-option-${i}` ids, `role=\"option\"` and\n * `aria-selected` the options grid emits, and that is load-bearing rather than\n * cosmetic: the keyboard controller lives in the vanilla core for all three\n * packages, navigates by index into `filteredOptions`, and commits by clicking\n * `#${listboxId}-option-${i}`. `getEffectiveColumns` also measures the live\n * `grid-template-columns` of option-0's parent, which is why the 7 columns sit\n * on the cell container itself and not on an ancestor.\n *\n * @internal\n */\n@Component({\n selector: \"aia-date-grid\",\n standalone: true,\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./date-grid.component.html\",\n styleUrls: [\"./date-grid.component.css\"],\n})\nexport class DateGridComponent {\n /** The visible month's cells. These ARE `filteredOptions` — see `buildDateOptions`. */\n @Input() options: SuggestionOption[] = [];\n @Input() activeIndex = -1;\n @Input() listboxId = \"\";\n @Input() view: DateMonthView | null = null;\n /** What the calendar paints as answered — see the core's `dateSelectionFor`. */\n @Input() selection: DateSelection = { selectedIso: null, selectedRange: null, rangeStart: null };\n\n @Output() readonly select = new EventEmitter<SuggestionOption>();\n @Output() readonly highlight = new EventEmitter<number>();\n @Output() readonly previousMonth = new EventEmitter<void>();\n @Output() readonly nextMonth = new EventEmitter<void>();\n\n readonly weekdays = WEEKDAY_LABELS;\n\n /** Index of the cell showing a 170ms press animation, or -1. */\n pressedIndex = -1;\n\n get monthLabel(): string {\n return this.view ? monthLabel(this.view) : \"\";\n }\n\n dayOf(option: SuggestionOption): number | null {\n return cellDay(option);\n }\n\n isToday(option: SuggestionOption): boolean {\n return cellIso(option) === isoDate(new Date());\n }\n\n /** Before today: rendered dimmed, but every bit as pickable as the rest. */\n isPast(option: SuggestionOption): boolean {\n const iso = cellIso(option);\n // ISO strings order the same way the dates they name do.\n return iso != null && iso < isoDate(new Date());\n }\n\n isSelected(option: SuggestionOption): boolean {\n return dateCellMarks(cellIso(option), {\n selectedIso: this.selection.selectedIso,\n range: this.paintedRange,\n }).selected;\n }\n\n /** Between the two ends of the painted span — banded, not filled. */\n isInRange(option: SuggestionOption): boolean {\n return dateCellMarks(cellIso(option), {\n selectedIso: this.selection.selectedIso,\n range: this.paintedRange,\n }).inRange;\n }\n\n /**\n * While a start is pending, the span runs to whatever cell is highlighted —\n * the hover/arrow preview that tells the user the first tap registered.\n *\n * A getter rather than a cached field: `OnPush` re-runs the template's\n * bindings whenever `options`, `activeIndex` or `selection` changes, and each\n * of those changes this answer.\n */\n private get paintedRange(): DateRange | null {\n return visibleDateRange({\n pendingStart: this.selection.rangeStart,\n highlightedIso: cellIso(this.options[this.activeIndex]),\n selected: this.selection.selectedRange,\n });\n }\n\n onSelect(option: SuggestionOption, index: number): void {\n this.pressedIndex = index;\n this.select.emit(option);\n setTimeout(() => {\n this.pressedIndex = -1;\n }, 170);\n }\n\n onKeyDown(event: KeyboardEvent, option: SuggestionOption, index: number): void {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n this.onSelect(option, index);\n }\n }\n\n /** Keeps the input focused, which the dropdown's visibility gate depends on. */\n preventBlur(event: MouseEvent): void {\n event.preventDefault();\n }\n\n // Padding cells have no date of their own, so they key off position.\n trackByCell = (index: number, option: SuggestionOption): string =>\n cellIso(option) ?? `pad-${index}`;\n}\n","<div class=\"magicx-aia-datepicker\" data-aia-datepicker=\"\">\n <div class=\"magicx-aia-datepicker-header\">\n <!-- tabIndex -1 for the same reason the skip button is: Tab is already\n bound to walking the dropdown's options. -->\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"magicx-aia-datepicker-nav\"\n data-aia-date-prev=\"\"\n aria-label=\"Previous month\"\n (mousedown)=\"preventBlur($event)\"\n (click)=\"previousMonth.emit()\"\n >\n ‹\n </button>\n <span class=\"magicx-aia-datepicker-month\" data-aia-date-month=\"\" aria-live=\"polite\">\n {{ monthLabel }}\n </span>\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"magicx-aia-datepicker-nav\"\n data-aia-date-next=\"\"\n aria-label=\"Next month\"\n (mousedown)=\"preventBlur($event)\"\n (click)=\"nextMonth.emit()\"\n >\n ›\n </button>\n </div>\n\n <!-- Decorative: each cell announces its own full date, so repeating the\n column letters to AT adds noise — and the duplicate T/S would be\n meaningless read aloud anyway. -->\n <div class=\"magicx-aia-datepicker-weekdays\" aria-hidden=\"true\">\n <span class=\"magicx-aia-datepicker-weekday\" *ngFor=\"let label of weekdays\">{{ label }}</span>\n </div>\n\n <div class=\"magicx-aia-datepicker-grid\" data-aia-date-grid=\"\">\n <ng-container *ngFor=\"let option of options; trackBy: trackByCell; let i = index\">\n <!-- Padding for the days before the 1st / after the last. Non-tappable,\n so arrow navigation skips it; hidden from AT so the month reads as\n its own days and nothing else. -->\n <div\n *ngIf=\"dayOf(option) === null; else dayCell\"\n [id]=\"listboxId + '-option-' + i\"\n role=\"option\"\n data-aia-option=\"\"\n data-aia-date-cell=\"\"\n aria-hidden=\"true\"\n [attr.aria-selected]=\"false\"\n tabindex=\"-1\"\n class=\"magicx-aia-date-cell magicx-aia-date-cell--blank\"\n ></div>\n\n <ng-template #dayCell>\n <!-- A day already gone by is de-emphasized, not disabled: it renders\n dimmed but stays every bit as pickable as the rest of the month. -->\n <div\n [id]=\"listboxId + '-option-' + i\"\n role=\"option\"\n data-aia-option=\"\"\n data-aia-date-cell=\"\"\n [attr.aria-selected]=\"i === activeIndex\"\n [attr.aria-label]=\"option.text\"\n tabindex=\"0\"\n class=\"magicx-aia-date-cell magicx-aia-date-cell--day\"\n [class.magicx-aia-date-cell--past]=\"isPast(option)\"\n [class.magicx-aia-date-cell--highlighted]=\"i === activeIndex\"\n [class.magicx-aia-date-cell--today]=\"isToday(option)\"\n [class.magicx-aia-date-cell--in-range]=\"isInRange(option)\"\n [class.magicx-aia-date-cell--selected]=\"isSelected(option)\"\n [class.magicx-aia-date-cell--pressed]=\"i === pressedIndex\"\n (click)=\"onSelect(option, i)\"\n (keydown)=\"onKeyDown($event, option, i)\"\n (mouseenter)=\"highlight.emit(i)\"\n >\n <!-- The cell paints the day number; `option.text` is the full\n committed value (\"March 23 2026\") and is what AT announces,\n since that is what selecting it puts in the input. -->\n <span class=\"magicx-aia-date-cell-number\">{{ dayOf(option) }}</span>\n </div>\n </ng-template>\n </ng-container>\n </div>\n</div>\n","import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from \"@angular/core\";\n\n/**\n * Horizontal layout primitive — children sit in a row and wrap when out of\n * room. Mirrors the React `<Cluster>` component / vanilla `.aia-cluster` CSS\n * primitive. `noWrap` keeps a single row; `inline` makes it inline-level.\n *\n * @internal\n */\n@Component({\n selector: \"aia-cluster\",\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n template: \"<ng-content></ng-content>\",\n styleUrls: [\"./cluster.component.css\"],\n host: {\n class: \"aia-cluster\",\n \"[attr.data-align]\": \"align\",\n \"[attr.data-justify]\": \"justify\",\n \"[attr.data-nowrap]\": \"noWrap ? '' : null\",\n \"[attr.data-inline]\": \"inline ? '' : null\",\n \"[style.--aia-cluster-gap]\": \"gap\",\n },\n})\nexport class ClusterComponent {\n /** Gap between children. Any CSS length. Defaults to the CSS fallback (0.5rem). */\n @Input() gap?: string;\n /** Cross-axis alignment. Defaults to `center`. */\n @Input() align: \"start\" | \"center\" | \"end\" | \"baseline\" = \"center\";\n /** Main-axis distribution. Defaults to `start`. */\n @Input() justify: \"start\" | \"center\" | \"end\" | \"between\" | \"around\" = \"start\";\n /** When true, the cluster does NOT flex-wrap (single-row clusters). */\n @Input() noWrap = false;\n /** Render inline-level (inline-flex) instead of block. */\n @Input() inline = false;\n}\n","import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from \"@angular/core\";\n\n/**\n * Vertical layout primitive — children stack top-to-bottom with `space` gap.\n * Mirrors the React `<Stack>` component / vanilla `.aia-stack` CSS primitive.\n *\n * @internal\n */\n@Component({\n selector: \"aia-stack\",\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n template: \"<ng-content></ng-content>\",\n styleUrls: [\"./stack.component.css\"],\n host: {\n class: \"aia-stack\",\n \"[attr.data-align]\": \"align\",\n \"[style.--aia-stack-space]\": \"space\",\n },\n})\nexport class StackComponent {\n /** Gap between children. Any CSS length. Defaults to the CSS fallback (0.5rem). */\n @Input() space?: string;\n /** Cross-axis alignment of children. Defaults to `stretch` (full width). */\n @Input() align: \"start\" | \"center\" | \"end\" | \"stretch\" = \"stretch\";\n}\n","import { CommonModule } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport type { Suggestion } from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n/**\n * Internal pill list used by both the dropdown and Tier 1's inline pillbar.\n * Mirrors `packages/react/src/components/PillList.tsx` one-for-one — including\n * the per-index opacity ramp (1 / 0.7 / 0.4 / 0.2) and the skeleton-loading\n * fallback that preserves layout while the next fetch is in flight.\n *\n * @internal\n */\n@Component({\n selector: \"aia-pill-list\",\n standalone: true,\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./pill-list.component.html\",\n styleUrls: [\"./pill-list.component.css\"],\n})\nexport class PillListComponent {\n @Input() pills: Suggestion[] = [];\n @Input() activePillIndex = 0;\n @Input() rounded = false;\n /**\n * When true, pills become non-interactive shimmering skeletons. Real pills\n * (with their text) are rendered when provided so widths/positions match\n * the previous state; with no pills, fixed-width fallback placeholders are\n * rendered instead.\n */\n @Input() loading = false;\n /**\n * Whether the active (leading) pill should render selected (full opacity)\n * rather than its positional `first` tier. Auto trigger ⇒ true while a\n * dropdown option is highlighted; manual trigger ⇒ true after the user taps\n * the pill. See `AIAutocompleteController.isActivePillSelected$`.\n */\n @Input() activeSelected = false;\n\n @Output() readonly selectPill = new EventEmitter<number>();\n\n /** Fallback widths when loading with zero cached pills (matches React). */\n readonly fallbackSkeletonWidths = [125, 69];\n\n /** The active pill is \"selected\" only when `activeSelected` is set. */\n isSelected(index: number): boolean {\n return this.activeSelected && index === this.activePillIndex;\n }\n\n /**\n * Opacity per pill state — mirrors PillList.tsx `PILL_OPACITY`. The selected\n * pill is full opacity; otherwise pills take a positional tier (first / next\n * / last).\n */\n pillOpacity(index: number): number {\n if (this.isSelected(index)) return 1; // Selected\n if (index === 0) return 0.7; // First\n if (index === 1) return 0.4; // Next\n return 0.2; // Last\n }\n\n trackByType = (_: number, pill: Suggestion): string => pill.type;\n trackByWidth = (_: number, w: number): number => w;\n\n onPillClick(index: number): void {\n if (this.loading) return;\n this.selectPill.emit(index);\n }\n\n onPillMouseDown(event: Event): void {\n // Prevent the editor from losing focus when a pill is tapped.\n event.preventDefault();\n }\n}\n","<ng-container *ngIf=\"loading && pills.length === 0; else realPills\">\n <span class=\"aia-pill-list\" data-aia-pill-list-loading=\"\">\n <span\n *ngFor=\"let w of fallbackSkeletonWidths; trackBy: trackByWidth; let i = index\"\n data-aia-pill-skeleton=\"\"\n class=\"aia-pill aia-pill-skeleton\"\n [class.aia-pill-rounded]=\"rounded\"\n [style.width.px]=\"w\"\n [style.opacity]=\"pillOpacity(i)\"\n ></span>\n </span>\n</ng-container>\n\n<ng-template #realPills>\n <span\n class=\"aia-pill-list\"\n [attr.data-aia-pill-list-loading]=\"loading ? '' : null\"\n >\n <button\n *ngFor=\"let pill of pills; trackBy: trackByType; let i = index\"\n type=\"button\"\n data-aia-pill=\"\"\n [attr.data-aia-loading]=\"loading ? '' : null\"\n tabindex=\"-1\"\n class=\"aia-pill\"\n [class.aia-pill-rounded]=\"rounded\"\n [class.aia-pill-skeleton]=\"loading\"\n [style.opacity]=\"pillOpacity(i)\"\n [disabled]=\"loading\"\n (mousedown)=\"onPillMouseDown($event)\"\n (click)=\"onPillClick(i)\"\n >\n {{ pill.text }}\n </button>\n </span>\n</ng-template>\n","import { CommonModule } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport type { Product } from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n/**\n * Internal product strip rendered below the dropdown's options grid. Mirrors\n * `packages/react/src/components/ProductStrip.tsx` and the vanilla core's\n * `renderProductStrip`, so all three packages emit the same structure and\n * theme identically.\n *\n * Two layout notes carried over from the vanilla implementation:\n *\n * - The dropdown paints a background but never sets `color`, so anything here\n * relying on `color: inherit` would pick up the *host page's* text colour —\n * black text on a dark panel. Every text node resolves its colour through\n * the same `--aia-option-*` chain the options use.\n * - The options grid carries a negative bottom margin so the footer rides up\n * over its reserved band, and whatever follows the grid inherits that pull.\n * The dropdown root is marked `data-aia-has-products` and the appearance\n * layer zeroes the band at its source rather than the strip cancelling it\n * from here.\n *\n * @internal\n */\n@Component({\n selector: \"aia-product-strip\",\n standalone: true,\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./product-strip.component.html\",\n styleUrls: [\"./product-strip.component.css\"],\n})\nexport class ProductStripComponent {\n @Input() products: Product[] = [];\n /** Scopes the section label's id to the owning listbox. */\n @Input() listboxId = \"\";\n /**\n * False while the panel is fading out. The closed dropdown keeps rendering\n * its last content for the fade, and focusable cards inside it would still\n * answer Tab.\n */\n @Input() focusable = true;\n\n @Output() readonly select = new EventEmitter<Product>();\n /**\n * Focus moved into / out of the strip. The panel closes on blur by default\n * and the editor blurs the moment a card takes focus, so the dropdown\n * reports focus as still-inside rather than shutting out from under the card\n * the user just tabbed to.\n */\n @Output() readonly focusChange = new EventEmitter<boolean>();\n\n get labelId(): string {\n return `${this.listboxId}-products-label`;\n }\n\n cardId(index: number): string {\n return `${this.listboxId}-product-${index}`;\n }\n\n /**\n * Identity *and* content: a same-id result whose fields changed must\n * re-render rather than reuse the previous card's bindings.\n */\n trackByProduct = (_: number, product: Product): string =>\n [\n product.id,\n product.title,\n product.url,\n product.imageUrl ?? \"\",\n product.price ?? \"\",\n product.vendor ?? \"\",\n ].join(\"\u0000\");\n\n onClick(event: MouseEvent, product: Product): void {\n // Let the browser keep the clicks that mean \"open this somewhere else\" —\n // intercepting them would defeat the point of rendering an <a>. Those are\n // navigations the user asked for explicitly, so they don't emit.\n if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button !== 0) {\n return;\n }\n event.preventDefault();\n this.select.emit(product);\n }\n\n onKeyDown(event: KeyboardEvent, product: Product): void {\n if (event.key !== \"Enter\" && event.key !== \" \") return;\n event.preventDefault();\n this.select.emit(product);\n }\n\n onCardFocus(): void {\n this.focusChange.emit(true);\n }\n\n onCardBlur(event: FocusEvent): void {\n const next = event.relatedTarget as HTMLElement | null;\n if (next?.closest(\"[data-aia-dropdown]\")) return;\n this.focusChange.emit(false);\n }\n}\n","<!-- `group` is the one role a listbox accepts around a set of options, so the\n strip stays inside the listbox without breaking its content model. -->\n<section\n *ngIf=\"products.length > 0\"\n class=\"aia-products\"\n data-aia-products=\"\"\n role=\"group\"\n [attr.aria-labelledby]=\"labelId\"\n>\n <div class=\"aia-products-label\" [id]=\"labelId\">Products</div>\n\n <div class=\"aia-products-row\" data-aia-products-row=\"\">\n <!-- A real <a href> rather than a <div>: it keeps the browser's own link\n affordances — cmd/ctrl-click for a new tab, middle-click, right-click →\n \"copy link address\". role=\"option\" overrides how assistive tech\n announces it, which is correct inside a listbox; the deliberate trade\n is that AT no longer calls it a link. -->\n <a\n *ngFor=\"let product of products; let i = index; trackBy: trackByProduct\"\n [id]=\"cardId(i)\"\n class=\"aia-product\"\n data-aia-product=\"\"\n role=\"option\"\n [attr.aria-selected]=\"false\"\n [href]=\"product.url\"\n [attr.tabindex]=\"focusable ? 0 : -1\"\n (click)=\"onClick($event, product)\"\n (keydown)=\"onKeyDown($event, product)\"\n (focus)=\"onCardFocus()\"\n (blur)=\"onCardBlur($event)\"\n >\n <!-- Catalogues without images are common enough that the placeholder is\n a first-class state, not an error state. -->\n <span\n class=\"aia-product-media\"\n [attr.data-aia-product-placeholder]=\"product.imageUrl ? null : ''\"\n >\n <!-- alt=\"\" on purpose: the title is already the card's accessible\n name, and repeating it would have a screen reader read it twice. -->\n <img\n *ngIf=\"product.imageUrl\"\n class=\"aia-product-image\"\n [src]=\"product.imageUrl\"\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n </span>\n\n <!-- Every field but the title is optional, so absent ones render no\n element at all — the column gap can't leave a hole for a box that\n isn't there. -->\n <span class=\"aia-product-body\">\n <span *ngIf=\"product.vendor\" class=\"aia-product-vendor\">{{ product.vendor }}</span>\n <span class=\"aia-product-title\">{{ product.title }}</span>\n <span *ngIf=\"product.price\" class=\"aia-product-price\">{{ product.price }}</span>\n </span>\n </a>\n </div>\n</section>\n","import {\n ChangeDetectionStrategy,\n Component,\n type ElementRef,\n Input,\n type OnChanges,\n type SimpleChanges,\n ViewChild,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport { optionsGridTemplateColumns } from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n/**\n * Intrinsic grid layout primitive — auto-fits as many columns as fit between\n * `min` and `max` wide, wrapping to new rows when there's no more horizontal\n * room. Mirrors the React `<Grid>` component / vanilla `.aia-grid` primitive.\n *\n * Optionally scrolls (`scroll`, capped height).\n *\n * @internal\n */\n@Component({\n selector: \"aia-grid\",\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./grid.component.html\",\n styleUrls: [\"./grid.component.css\"],\n})\nexport class GridComponent implements OnChanges {\n /** Minimum cell width. CSS length, e.g. \"16rem\". Columns auto-fit at runtime. */\n @Input() min = \"16rem\";\n /** Maximum cell width. CSS length. Defaults (via CSS) to `1fr` (stretch). */\n @Input() max?: string;\n /** Gap between cells. */\n @Input() gap?: string;\n /** Cap the height and scroll vertically when content overflows. */\n @Input() scroll = false;\n /** Max height when `scroll`. CSS length. Defaults (via CSS) to 120px. */\n @Input() maxHeight?: string;\n /** Scroll back to the top whenever this key changes (`scroll` only). */\n @Input() scrollResetKey?: string;\n /** Fixed column count. Overrides the intrinsic auto-fit when set; rows fill left-to-right. */\n @Input() cols?: number;\n /** Explicit `grid-template-columns` value. Overrides `cols` when set. */\n @Input() template?: string;\n /**\n * Identity of the content group on screen, mirrored onto `data-aia-group`.\n * The core's scroll-arrow controller reads it to tell a new set of options\n * (rising in) from the same set re-rendered.\n */\n @Input() group?: string;\n\n /**\n * Explicit column template overrides the intrinsic auto-fit (inline wins).\n * The track string is built by the core so all three packages emit the same\n * one; a measured template (the two-column split) wins over the count.\n */\n get templateColumns(): string | null {\n if (this.template) return this.template;\n return this.cols ? optionsGridTemplateColumns(this.cols) : null;\n }\n\n @ViewChild(\"grid\", { static: false }) gridRef?: ElementRef<HTMLDivElement>;\n\n /**\n * A new `scrollResetKey` means a different content group is being shown (e.g.\n * the next suggestion's options after a selection) — start it from the top\n * instead of inheriting the previous group's scroll offset.\n */\n ngOnChanges(changes: SimpleChanges): void {\n const change = changes[\"scrollResetKey\"];\n if (!change || change.isFirstChange()) return;\n const grid = this.gridRef?.nativeElement;\n if (grid) grid.scrollTop = 0;\n }\n}\n","<div\n #grid\n class=\"aia-grid\"\n [attr.data-scroll]=\"scroll ? '' : null\"\n [attr.data-aia-group]=\"group ?? null\"\n [style.--aia-grid-min]=\"min\"\n [style.--aia-grid-max]=\"max\"\n [style.--aia-grid-gap]=\"gap\"\n [style.--aia-grid-max-height]=\"maxHeight\"\n [style.grid-template-columns]=\"templateColumns\"\n>\n <ng-content></ng-content>\n</div>\n","import { CommonModule } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n inject,\n type OnDestroy,\n Output,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport { DomSanitizer, type SafeHtml } from \"@angular/platform-browser\";\nimport {\n optionLabel,\n type SuggestionOption,\n sanitizeOptionIconSvg,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n/**\n * Internal single-option cell used inside the suggestion grid. Mirrors\n * `packages/react/src/components/SuggestionItem.tsx`. Handles:\n *\n * - Tappable vs non-tappable cursor + hover styling\n * - Pressed-state compress animation (170ms, single-flight)\n * - Keyboard activation (Enter/Space)\n * - ARIA `role=\"option\"` + `aria-selected` for the listbox pattern\n * - Loading skeleton when `loading=true`\n * - Server-provided icon (`icon_svg`), allowlisted through the core's\n * `sanitizeOptionIconSvg` before it is bound as HTML\n *\n * @internal\n */\n@Component({\n selector: \"aia-suggestion-item\",\n standalone: true,\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./suggestion-item.component.html\",\n styleUrls: [\"./suggestion-item.component.css\"],\n})\nexport class SuggestionItemComponent implements OnDestroy {\n @Input() option!: SuggestionOption;\n @Input() isHighlighted = false;\n @Input() id = \"\";\n @Input() loading = false;\n /** Whether to draw the option's `icon_svg` before its text. Default: true. */\n @Input() showIcon = true;\n /** Fade this option's text toward its bottom edge (last visible row of a scrollable grid). */\n @Input() scrollHint = false;\n /**\n * Start delay of this row's entrance animation (ms) — each row rises in a\n * beat after the one nearer the input. Captured once, on first render, so a\n * later change-detection pass can't restart a row mid-rise.\n */\n @Input() set enterDelayMs(value: number) {\n if (this.enterDelay === null) this.enterDelay = value;\n }\n /**\n * The captured delay; `null` until the first `enterDelayMs` binding lands.\n * The template binds it to `--aia-option-enter-delay` (the core's\n * OPTION_ENTER_DELAY_VAR), which the stylesheet's entrance rule reads.\n */\n enterDelay: number | null = null;\n\n @Output() readonly select = new EventEmitter<SuggestionOption>();\n @Output() readonly highlight = new EventEmitter<void>();\n\n pressed = false;\n\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly sanitizer = inject(DomSanitizer);\n private pressedTimer: ReturnType<typeof setTimeout> | undefined;\n private iconSource: string | undefined;\n private iconSafe: SafeHtml | null = null;\n\n /** The option's text, with a legacy `icon` (no `icon_svg`) prefixed. */\n get label(): string {\n return optionLabel(this.option);\n }\n\n /**\n * The option's icon as bindable HTML, or `null` when it has none (or its\n * markup failed the allowlist). Angular's own HTML sanitizer strips `<svg>`\n * wholesale, so the core's allowlisted output is marked trusted instead —\n * it is never the server's raw string. Recomputed only when the markup\n * changes; the getter runs on every OnPush check.\n */\n get iconHtml(): SafeHtml | null {\n const svg = this.showIcon ? this.option.icon_svg : undefined;\n if (svg !== this.iconSource) {\n this.iconSource = svg;\n const html = svg ? sanitizeOptionIconSvg(svg) : null;\n this.iconSafe = html ? this.sanitizer.bypassSecurityTrustHtml(html) : null;\n }\n return this.iconSafe;\n }\n\n ngOnDestroy(): void {\n if (this.pressedTimer !== undefined) clearTimeout(this.pressedTimer);\n }\n\n onSelect(): void {\n if (this.loading || !this.option.is_tappable || this.pressed) return;\n this.pressed = true;\n this.cdr.markForCheck();\n this.select.emit(this.option);\n if (this.pressedTimer !== undefined) clearTimeout(this.pressedTimer);\n this.pressedTimer = setTimeout(() => {\n this.pressed = false;\n this.cdr.markForCheck();\n }, 170);\n }\n\n onMouseEnter(): void {\n if (this.loading || !this.option.is_tappable) return;\n this.highlight.emit();\n }\n\n onKeyDown(event: KeyboardEvent): void {\n if (this.loading || !this.option.is_tappable) return;\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n this.onSelect();\n }\n }\n}\n","<div\n [id]=\"id\"\n role=\"option\"\n data-aia-option=\"\"\n [attr.data-aia-loading]=\"loading ? '' : null\"\n [attr.data-aia-icon]=\"iconHtml && option.icon ? option.icon : null\"\n [attr.aria-selected]=\"isHighlighted\"\n class=\"aia-suggestion-item\"\n [style.--aia-option-enter-delay]=\"(enterDelay ?? 0) + 'ms'\"\n [class.aia-suggestion-item-highlighted]=\"isHighlighted && !loading\"\n [class.aia-suggestion-item-tappable]=\"option.is_tappable\"\n [class.aia-suggestion-item-non-tappable]=\"!option.is_tappable\"\n [class.aia-suggestion-item-pressed]=\"pressed\"\n [class.aia-suggestion-item-scroll-hint]=\"scrollHint\"\n [attr.tabindex]=\"loading || !option.is_tappable ? -1 : 0\"\n (click)=\"onSelect()\"\n (keydown)=\"onKeyDown($event)\"\n (mouseenter)=\"onMouseEnter()\"\n>\n <span class=\"aia-suggestion-content\">\n <span\n *ngIf=\"iconHtml\"\n class=\"aia-suggestion-icon\"\n aria-hidden=\"true\"\n [innerHTML]=\"iconHtml\"\n ></span>\n <span class=\"aia-suggestion-text\">{{ label }}</span>\n <span *ngIf=\"option.tag\" class=\"aia-suggestion-tag\">{{ option.tag }}</span>\n </span>\n</div>\n","import { CommonModule } from \"@angular/common\";\nimport {\n type AfterViewChecked,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n HostListener,\n Input,\n inject,\n type OnChanges,\n Output,\n type SimpleChanges,\n ViewChild,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport {\n isOptionsGridMobileViewport,\n measureOptionsGrid,\n needsOptionsGridMeasurement,\n type OptionsGridPlan,\n optionEnterDelayMs,\n planOptionsGrid,\n type SuggestionOption,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { GridComponent } from \"../layout/grid.component\";\nimport { SuggestionItemComponent } from \"../suggestion-item/suggestion-item.component\";\n\n/**\n * Internal grid of suggestion options. Mirrors\n * `packages/react/src/components/SuggestionGrid.tsx` — a thin wrapper over the\n * `Grid` layout primitive (which owns the auto-fit columns and the\n * capped-height scroll). It only wires each option to its\n * select/highlight handlers and listbox-scoped id.\n *\n * @internal\n */\n@Component({\n selector: \"aia-suggestion-grid\",\n standalone: true,\n imports: [CommonModule, GridComponent, SuggestionItemComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./suggestion-grid.component.html\",\n})\nexport class SuggestionGridComponent implements OnChanges, AfterViewChecked {\n @Input() options: SuggestionOption[] = [];\n @Input() activeIndex = -1;\n @Input() listboxId = \"\";\n @Input() loading = false;\n /**\n * Identity of the suggestion these options belong to. When it changes the\n * grid scrolls back to the top, so the next parameter's options are read\n * from the first one instead of from the previous list's scroll offset.\n */\n @Input() groupKey = \"\";\n /**\n * Which side of the input the dropdown opens on. The rows' entrance starts\n * from the input's side outward, so \"above\" reverses the order.\n */\n @Input() optionsPosition: \"above\" | \"below\" = \"below\";\n /** Whether rows draw their `icon_svg` before the text. Default: true. */\n @Input() showIcons = true;\n\n @Output() readonly select = new EventEmitter<SuggestionOption>();\n @Output() readonly highlight = new EventEmitter<number>();\n\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild(GridComponent, { static: false }) private gridComp?: GridComponent;\n\n /**\n * The measured layout plan. Starts as the measurement-free baseline (one\n * column); after each view update the rendered rows are measured and the\n * plan upgrades to two columns when they provably fit — same two-pass the\n * React grid does with its layout effect, all through `planOptionsGrid`.\n */\n plan: OptionsGridPlan = planOptionsGrid(0, false, null, null);\n private needsMeasure = true;\n\n // Re-measure when the viewport changes (breakpoint or width both matter to\n // the two-column fit).\n @HostListener(\"window:resize\")\n onResize(): void {\n this.needsMeasure = true;\n this.cdr.markForCheck();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n // Only the inputs the plan depends on reset it — activeIndex changes on\n // every arrow key and must not knock a measured two-column grid back to\n // the baseline (the React grid's layout effect excludes it the same way).\n if (!changes[\"options\"] && !changes[\"loading\"]) return;\n this.needsMeasure = true;\n // The pre-measure baseline for the new inputs, so the first paint is the\n // same one-column layout the other packages start from.\n this.plan = planOptionsGrid(this.options.length, isOptionsGridMobileViewport(), null, null);\n }\n\n ngAfterViewChecked(): void {\n if (!this.needsMeasure) return;\n this.needsMeasure = false;\n const isMobile = isOptionsGridMobileViewport();\n const grid = this.gridComp?.gridRef?.nativeElement;\n // Measuring clones every row and forces a layout — skip it whenever the\n // plan would ignore the result (mobile, fewer than five options).\n const shouldMeasure =\n grid && !this.loading && needsOptionsGridMeasurement(this.options.length, isMobile);\n const measured = shouldMeasure ? measureOptionsGrid(grid) : null;\n const next = planOptionsGrid(\n this.options.length,\n isMobile,\n measured?.rowWidths ?? null,\n measured?.gridWidth ?? null,\n );\n const unchanged =\n next.template === this.plan.template &&\n next.maxHeight === this.plan.maxHeight &&\n next.scrollHintIndices.join() === this.plan.scrollHintIndices.join();\n if (unchanged) return;\n // The view was already checked this cycle — apply the measured plan in a\n // fresh microtask so OnPush picks it up without an\n // ExpressionChangedAfterItHasBeenChecked error.\n queueMicrotask(() => {\n this.plan = next;\n this.cdr.markForCheck();\n });\n }\n\n isScrollHint(index: number): boolean {\n return !this.loading && this.plan.scrollHintIndices.includes(index);\n }\n\n /**\n * Start delay of row `index`'s entrance — each row rises in a beat after\n * the one nearer the input. Skeleton rows fade in together (they're\n * placeholders, not content arriving).\n */\n enterDelayMs(index: number): number {\n if (this.loading) return 0;\n // Across the columns the measured plan settled on — the two-column\n // upgrade only decides that after the rows exist.\n return optionEnterDelayMs(index, this.plan.cols, this.options.length, this.optionsPosition);\n }\n\n /**\n * The group is part of the identity: a new suggestion's options are new\n * rows and get the entrance animation even when one spells the same as a\n * row already on screen.\n */\n trackByOptionText = (_: number, opt: SuggestionOption): string => `${this.groupKey}\\0${opt.text}`;\n}\n","<!-- max=\"1fr\": columns share out the full width, so a lone column spans the\n whole options box instead of stopping at 250px. -->\n<aia-grid\n min=\"250px\"\n max=\"1fr\"\n gap=\"0\"\n [scroll]=\"true\"\n [scrollResetKey]=\"groupKey\"\n [template]=\"plan.template\"\n [maxHeight]=\"plan.maxHeight\"\n [group]=\"groupKey\"\n>\n <aia-suggestion-item\n *ngFor=\"let option of options; trackBy: trackByOptionText; let i = index\"\n [option]=\"option\"\n [isHighlighted]=\"i === activeIndex\"\n [id]=\"listboxId + '-option-' + i\"\n [loading]=\"loading\"\n [showIcon]=\"showIcons\"\n [scrollHint]=\"isScrollHint(i)\"\n [enterDelayMs]=\"enterDelayMs(i)\"\n (select)=\"select.emit($event)\"\n (highlight)=\"highlight.emit(i)\"\n ></aia-suggestion-item>\n</aia-grid>\n","import { CommonModule } from \"@angular/common\";\nimport {\n type AfterViewChecked,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n type ElementRef,\n Input,\n inject,\n type OnChanges,\n type OnDestroy,\n type OnInit,\n type SimpleChanges,\n ViewChild,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport {\n type AppearanceMode,\n attachScrollArrow,\n buildAttributionUrl,\n type DateMonthView,\n type DateSelection,\n getFooterHint,\n isCalendarFormat,\n type Product,\n SCROLL_ARROW_LABEL,\n type ScrollArrowController,\n type Suggestion,\n type SuggestionOption,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { BehaviorSubject, combineLatest, type Observable } from \"rxjs\";\nimport { map } from \"rxjs/operators\";\nimport type { AIAutocompleteController } from \"../controller/ai-autocomplete.controller\";\nimport { DateGridComponent } from \"../internal/date-grid/date-grid.component\";\nimport { ClusterComponent } from \"../internal/layout/cluster.component\";\nimport { StackComponent } from \"../internal/layout/stack.component\";\nimport { PillListComponent } from \"../internal/pill-list/pill-list.component\";\nimport { ProductStripComponent } from \"../internal/product-strip/product-strip.component\";\nimport { SuggestionGridComponent } from \"../internal/suggestion-grid/suggestion-grid.component\";\n\ninterface DropdownVm {\n pills: Suggestion[];\n options: SuggestionOption[];\n activeIndex: number;\n isActivePillSelected: boolean;\n isLoading: boolean;\n showsPills: boolean;\n /** Whether the pillbar ends in the trailing \"skip\" button. */\n showsSkip: boolean;\n /**\n * Disabled state for the skip button: loading, or the post-selection window\n * where isLoading is suppressed but the core's skipActivePill() no-ops.\n */\n skipDisabled: boolean;\n /** Active pill's label, for the skip button's aria-label. */\n activePillLabel: string;\n showsOptions: boolean;\n /** Whether the calendar body renders in place of the options grid. */\n showsDateGrid: boolean;\n /** The month the calendar shows. Null unless `showsDateGrid`. */\n dateView: DateMonthView | null;\n /** What the calendar paints as answered — see the core's `dateSelectionFor`. */\n dateSelection: DateSelection;\n showsFallbackSkeleton: boolean;\n isVisible: boolean;\n /** Product cards for the strip. Empty unless `products` is configured. */\n products: Product[];\n /** Identity of the suggestion the options belong to — drives the grid's scroll reset. */\n groupKey: string;\n footerKey: string;\n footerHint: string;\n optionsPosition: \"above\" | \"below\";\n /** Whether option rows draw their `icon_svg` before the text. */\n showOptionIcons: boolean;\n}\n\n/** The content-bearing fields of the view-model (everything but `isVisible`). */\ntype DropdownContent = Omit<DropdownVm, \"isVisible\">;\n\n/**\n * Tier 2 dropdown component — the Angular equivalent of React's\n * `<AIAutocompleteDropdown />`. Renders the pillbar, options grid, and\n * loading skeleton based on the supplied controller's `dropdown$` snapshot.\n *\n * ```html\n * <ai-autocomplete-dropdown [controller]=\"ac\"></ai-autocomplete-dropdown>\n * ```\n *\n * All actions (pill click, option select, option highlight) are forwarded to\n * the controller. Consumers who need to observe these events can subscribe\n * to the controller's per-field observables.\n *\n * @public\n */\n@Component({\n selector: \"ai-autocomplete-dropdown\",\n standalone: true,\n imports: [\n CommonModule,\n PillListComponent,\n ProductStripComponent,\n SuggestionGridComponent,\n DateGridComponent,\n StackComponent,\n ClusterComponent,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./ai-autocomplete-dropdown.component.html\",\n // The shared appearance layer carries the design tokens + box-sizing reset +\n // optionsPosition reversal, so a standalone dropdown (no Tier 1 component on\n // the page) is fully styled once `mode` is set.\n styleUrls: [\"../shared/appearance.css\", \"./ai-autocomplete-dropdown.component.css\"],\n})\nexport class AIAutocompleteDropdownComponent\n implements OnInit, OnChanges, AfterViewChecked, OnDestroy\n{\n /** The controller that owns the autocomplete state. Required. */\n @Input() controller!: AIAutocompleteController;\n /** Whether to render the pillbar above the options grid. Default: true. */\n @Input() showPills = true;\n /**\n * Whether the pillbar ends in a small \"skip\" button that dismisses the\n * active pill — same action as pressing → at the end of the input. It sits\n * at the trailing edge of the bar: visually top-right when the dropdown\n * opens below the input, bottom-right when `optionsPosition` is \"above\".\n * Default: true. Hidden automatically during re-edit and while the fallback\n * skeleton renders.\n */\n @Input() showSkipButton = true;\n /**\n * Whether option rows draw their `icon_svg` before the text. Default: true.\n * Set to false to render option rows as text only.\n */\n @Input() showOptionIcons = true;\n /** Optional CSS class applied to the dropdown root. */\n @Input() className?: string;\n /**\n * Color mode for a standalone dropdown. When set, the dropdown self-scopes the\n * design tokens to its own root (adds `magicx-aia` + `data-mode`), so it needs\n * no `.magicx-aia` wrapper. `\"auto\"` follows `prefers-color-scheme`. Leave it\n * unset when the dropdown sits inside a `.magicx-aia` ancestor (e.g. Tier 1).\n */\n @Input() mode?: AppearanceMode;\n\n /** Concrete resolved mode, or null when `mode` is unset (inherit from ancestor). */\n resolvedMode: \"light\" | \"dark\" | null = null;\n private modeMql?: MediaQueryList;\n private modeListener?: () => void;\n private readonly cdr = inject(ChangeDetectorRef);\n\n /** Root class list — adds `magicx-aia` only when self-scoping via `mode`. */\n get rootClass(): string {\n let cls = \"magicx-aia-dropdown\";\n if (this.resolvedMode) cls += \" magicx-aia\";\n if (this.className) cls += ` ${this.className}`;\n return cls;\n }\n\n /** Fallback skeleton-bar widths used when loading with zero cached options. */\n readonly fallbackSkeletonBarWidths = [159, 119, 164];\n\n /** Accessible name of the \"more below\" scroll arrow. */\n readonly scrollArrowLabel = SCROLL_ARROW_LABEL;\n\n // The dropdown root and the arrow button live under the `*ngIf` on vm$, so\n // they come and go with it — hence non-static queries, re-read every check.\n @ViewChild(\"dropdownRoot\", { static: false }) private dropdownRootRef?: ElementRef<HTMLElement>;\n @ViewChild(\"scrollArrow\", { static: false }) private scrollArrowRef?: ElementRef<HTMLElement>;\n /** The grid the scroll-arrow controller is currently bound to. */\n private scrollArrowBinding: { grid: HTMLElement; controller: ScrollArrowController } | null =\n null;\n\n /**\n * Attribution/branding link URL for the footer, with a `utm_source` derived\n * from the embedding page's hostname (see {@link buildAttributionUrl}).\n */\n readonly brandHref = buildAttributionUrl();\n\n /**\n * View-model derived from the controller's `dropdown$`. Adds three booleans\n * (`showsPills`, `showsOptions`, `showsFallbackSkeleton`, `isVisible`) that\n * keep template-level logic to a property read per §19.6.\n *\n * Initialized once in `ngOnInit` — must NOT be a getter. A getter returns a\n * fresh `Observable` instance on every property read; with OnPush + `async`\n * pipe that means each change-detection cycle unsubscribes/resubscribes,\n * causing the `*ngIf=\"vm$ | async as vm\"` root to briefly resolve `null`\n * and flicker the entire dropdown DOM.\n */\n vm$!: Observable<DropdownVm>;\n\n // Bridge for the @Input `showPills` into the reactive pipeline. Without this,\n // changing the input after init wouldn't trigger a new vm emission until the\n // next controller.dropdown$ tick — and we'd lose the showPills update entirely\n // if the controller is idle. Updated from ngOnChanges below.\n private readonly showPills$ = new BehaviorSubject<boolean>(true);\n // Same bridge, for `showSkipButton`.\n private readonly showSkipButton$ = new BehaviorSubject<boolean>(true);\n // Same bridge, for `showOptionIcons`.\n private readonly showOptionIcons$ = new BehaviorSubject<boolean>(true);\n\n // Last content emitted while the dropdown was visible. Reused during the\n // close fade so the populated dropdown fades out as one — see initVm.\n private lastVisibleContent: DropdownContent | null = null;\n\n ngOnInit(): void {\n // Seed the input bridges from their resolved values at init time.\n this.showPills$.next(this.showPills);\n this.showSkipButton$.next(this.showSkipButton);\n this.showOptionIcons$.next(this.showOptionIcons);\n this.applyMode();\n this.initVm();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes[\"showPills\"]) {\n this.showPills$.next(this.showPills);\n }\n if (changes[\"showSkipButton\"]) {\n this.showSkipButton$.next(this.showSkipButton);\n }\n if (changes[\"showOptionIcons\"]) {\n this.showOptionIcons$.next(this.showOptionIcons);\n }\n if (changes[\"mode\"] && !changes[\"mode\"].firstChange) {\n this.applyMode();\n }\n // Re-bind vm$ when the controller @Input is swapped (e.g. a multi-step form\n // toggling between controllers). Without this, vm$ stays subscribed to the\n // previous controller's dropdown$ — rendering stale options, or, if that\n // controller was destroy()-ed, receiving a completion that collapses the\n // dropdown permanently. Skip the first change: ngOnChanges fires before\n // ngOnInit, which owns the initial creation.\n if (changes[\"controller\"] && !changes[\"controller\"].firstChange && this.controller) {\n this.initVm();\n }\n }\n\n /**\n * Keep the core's \"more below\" arrow controller bound to whichever options\n * grid is currently rendered — the Angular analogue of React's\n * useScrollArrow. The controller owns the behaviour (measuring, visibility,\n * the page-scroll on click — see the core's scrollArrow.ts); this only hands\n * it the live elements after each view check, re-attaching when the grid\n * element is replaced and tearing down when there is no grid.\n */\n ngAfterViewChecked(): void {\n const root = this.dropdownRootRef?.nativeElement;\n const button = this.scrollArrowRef?.nativeElement;\n const grid = root?.querySelector<HTMLElement>(\".aia-grid[data-scroll]\") ?? null;\n if (this.scrollArrowBinding && this.scrollArrowBinding.grid !== grid) {\n this.scrollArrowBinding.controller.destroy();\n this.scrollArrowBinding = null;\n }\n if (!root || !button || !grid) return;\n if (!this.scrollArrowBinding) {\n this.scrollArrowBinding = {\n grid,\n controller: attachScrollArrow({ dropdown: root, grid, button }),\n };\n return; // attach() runs the first update itself\n }\n this.scrollArrowBinding.controller.update();\n }\n\n ngOnDestroy(): void {\n this.teardownModeListener();\n this.scrollArrowBinding?.controller.destroy();\n this.scrollArrowBinding = null;\n }\n\n /**\n * Resolve the `mode` input into `resolvedMode`. Unset → null (the dropdown\n * stays class-less and inherits from a `.magicx-aia` ancestor). `\"auto\"` reads\n * `prefers-color-scheme` and tracks it live via a media-query listener.\n */\n private applyMode(): void {\n this.teardownModeListener();\n if (this.mode === undefined) {\n this.resolvedMode = null;\n return;\n }\n if (this.mode === \"light\" || this.mode === \"dark\") {\n this.resolvedMode = this.mode;\n return;\n }\n // \"auto\"\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n this.resolvedMode = \"light\";\n return;\n }\n this.modeMql = window.matchMedia(\"(prefers-color-scheme: dark)\");\n this.resolvedMode = this.modeMql.matches ? \"dark\" : \"light\";\n this.modeListener = () => {\n this.resolvedMode = this.modeMql?.matches ? \"dark\" : \"light\";\n this.cdr.markForCheck();\n };\n this.modeMql.addEventListener(\"change\", this.modeListener);\n }\n\n private teardownModeListener(): void {\n if (this.modeMql && this.modeListener) {\n this.modeMql.removeEventListener(\"change\", this.modeListener);\n }\n this.modeMql = undefined;\n this.modeListener = undefined;\n }\n\n /** Build the view-model stream from the current controller + showPills$. */\n private initVm(): void {\n this.vm$ = combineLatest([\n this.controller.dropdown$,\n this.showPills$,\n this.showSkipButton$,\n this.showOptionIcons$,\n ]).pipe(\n map(([dd, showPills, showSkipButton, showOptionIcons]) => {\n const activeSuggestion = dd.suggestions[0];\n const options = activeSuggestion?.options ?? [];\n const showsPills = showPills && (dd.pills.length > 0 || dd.isLoading);\n // The trailing \"skip\" button only makes sense next to a real,\n // skippable pill — never on the fallback skeleton bar, and never\n // during re-edit (the bar then shows an already answered param).\n // Deliberately NOT gated on showsPills: with pills rendered elsewhere\n // (pillPlacement \"inline\"/\"hidden\") the bar renders as a skip-only\n // row holding just the button. Hidden while the input is empty — the\n // footer hint doesn't advertise \"→ to skip\" until the user has typed,\n // so the pristine starting state stays free of the affordance too.\n const showsSkip =\n dd.pills.length > 0 && showSkipButton && !dd.isEditing && !dd.isInputEmpty;\n // Exactly one body renders. `options` above already holds the visible\n // month's cells when this is a date — the core swapped them in its\n // derive layer — so the two are the same list drawn two different\n // ways, and never both at once (two elements answering to the same\n // option id would break keyboard commit).\n //\n // A calendar is withheld while a request is in flight. The options\n // grid draws its cached options as skeleton rows for that window, but\n // a month of day cells has no skeleton form worth drawing — and a live\n // calendar over a loading pill bar invites an answer against\n // suggestions the response is about to replace. The fallback bars\n // stand in until it lands.\n const isDate = isCalendarFormat(dd.formatType ?? \"options\") && dd.dateView != null;\n const showsOptions = options.length > 0 && !isDate;\n const showsDateGrid = options.length > 0 && isDate && !dd.isLoading;\n const showsFallbackSkeleton = dd.isLoading && !showsOptions && !showsDateGrid;\n // Either half is enough to keep the panel up: products render with no\n // suggestions, suggestions render with no products.\n const isVisible =\n dd.isOpen &&\n (showsOptions || showsDateGrid || showsPills || dd.isLoading || dd.products.length > 0);\n\n // While closing, reuse the last visible content so the populated\n // dropdown fades out as one. Otherwise the pills/options vanish the\n // instant the state empties (e.g. skipping the last pill with →),\n // leaving the always-present footer alone for a flash of a footer-only\n // \"no options\" box mid-fade. Only `isVisible` tracks live state to\n // drive the opacity transition.\n if (!isVisible && this.lastVisibleContent) {\n return { ...this.lastVisibleContent, isVisible: false };\n }\n\n const optionHighlighted =\n dd.activeIndex >= 0 && Boolean(options[dd.activeIndex]?.is_tappable);\n const { key: footerKey, hint: footerHint } = getFooterHint(\n optionHighlighted,\n dd.isInputEmpty,\n );\n const content: DropdownContent = {\n pills: dd.pills,\n options,\n activeIndex: dd.activeIndex,\n isActivePillSelected: dd.isActivePillSelected,\n isLoading: dd.isLoading,\n showsPills,\n showsSkip,\n skipDisabled: dd.isLoading || Boolean(dd.inSelectionAnimation),\n activePillLabel: dd.pills[0]?.text ?? \"\",\n showsOptions,\n showsDateGrid,\n dateView: dd.dateView ?? null,\n dateSelection: {\n selectedIso: dd.selectedDateIso ?? null,\n selectedRange: dd.selectedDateRange ?? null,\n rangeStart: dd.dateRangeStart ?? null,\n },\n showsFallbackSkeleton,\n products: dd.products,\n groupKey: activeSuggestion ? `${activeSuggestion.type} ${activeSuggestion.text}` : \"\",\n footerKey,\n footerHint,\n optionsPosition: dd.optionsPosition,\n showOptionIcons,\n };\n if (isVisible) this.lastVisibleContent = content;\n return { ...content, isVisible };\n }),\n );\n }\n\n trackByWidth = (_: number, w: number): number => w;\n\n onPillClick(index: number): void {\n this.controller.setActivePill(index);\n }\n\n onSkip(): void {\n this.controller.skipActivePill();\n }\n\n onSelect(option: SuggestionOption): void {\n this.controller.selectOption(option);\n }\n\n onPreviousMonth(): void {\n this.controller.showPreviousMonth();\n }\n\n onNextMonth(): void {\n this.controller.showNextMonth();\n }\n\n onHighlight(index: number): void {\n this.controller.setActiveDropdownIndex(index);\n }\n\n onProductSelect(product: Product): void {\n this.controller.selectProduct(product);\n }\n\n /**\n * A card taking focus blurs the editor, which would otherwise close the\n * panel out from under the card the user just tabbed to.\n */\n onProductFocusChange(focused: boolean): void {\n this.controller.setFocused(focused);\n }\n\n preventBlur(event: Event): void {\n // Prevent the editor from losing focus when interacting with the dropdown.\n event.preventDefault();\n }\n}\n","<div\n *ngIf=\"vm$ | async as vm\"\n #dropdownRoot\n [id]=\"controller.listboxId\"\n role=\"listbox\"\n data-aia-dropdown=\"\"\n [attr.data-aia-loading]=\"vm.isLoading ? '' : null\"\n [attr.data-mode]=\"resolvedMode\"\n [attr.data-options-position]=\"vm.optionsPosition\"\n [attr.data-aia-has-products]=\"vm.products.length > 0 ? '' : null\"\n [class]=\"rootClass\"\n [class.magicx-aia-dropdown-visible]=\"vm.isVisible\"\n (mousedown)=\"preventBlur($event)\"\n>\n <aia-stack space=\"8px\">\n <aia-cluster\n *ngIf=\"vm.showsPills || vm.showsSkip\"\n class=\"magicx-aia-dropdown-pillbar\"\n data-aia-pillbar=\"\"\n [noWrap]=\"true\"\n >\n <!-- The scroll + right-edge fade live on this wrapper (not the bar) so\n the skip button stays outside the masked region — pinned and fully\n opaque while overflowing pills fade under it. Absent in a skip-only\n row (pills rendered elsewhere via pillPlacement inline/hidden). -->\n <span *ngIf=\"vm.showsPills\" class=\"magicx-aia-pill-scroll\" data-aia-pill-scroll=\"\">\n <aia-pill-list\n [pills]=\"vm.pills\"\n [activePillIndex]=\"0\"\n [activeSelected]=\"vm.isActivePillSelected\"\n [rounded]=\"true\"\n [loading]=\"vm.isLoading\"\n (selectPill)=\"onPillClick($event)\"\n ></aia-pill-list>\n </span>\n <button\n *ngIf=\"vm.showsSkip\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"magicx-aia-skip\"\n data-aia-skip=\"\"\n [disabled]=\"vm.skipDisabled\"\n [attr.aria-label]=\"vm.activePillLabel ? 'Skip ' + vm.activePillLabel : 'Skip'\"\n (click)=\"onSkip()\"\n >\n skip\n </button>\n </aia-cluster>\n\n <aia-suggestion-grid\n *ngIf=\"vm.showsOptions\"\n [options]=\"vm.options\"\n [activeIndex]=\"vm.activeIndex\"\n [listboxId]=\"controller.listboxId\"\n [loading]=\"vm.isLoading\"\n [groupKey]=\"vm.groupKey\"\n [optionsPosition]=\"vm.optionsPosition\"\n [showIcons]=\"vm.showOptionIcons\"\n (select)=\"onSelect($event)\"\n (highlight)=\"onHighlight($event)\"\n ></aia-suggestion-grid>\n\n <aia-date-grid\n *ngIf=\"vm.showsDateGrid\"\n [options]=\"vm.options\"\n [activeIndex]=\"vm.activeIndex\"\n [listboxId]=\"controller.listboxId\"\n [view]=\"vm.dateView\"\n [selection]=\"vm.dateSelection\"\n (select)=\"onSelect($event)\"\n (highlight)=\"onHighlight($event)\"\n (previousMonth)=\"onPreviousMonth()\"\n (nextMonth)=\"onNextMonth()\"\n ></aia-date-grid>\n\n <div\n *ngIf=\"vm.showsFallbackSkeleton\"\n class=\"magicx-aia-dropdown-skeleton-bars\"\n data-aia-skeleton-bars=\"\"\n >\n <span\n *ngFor=\"let w of fallbackSkeletonBarWidths; trackBy: trackByWidth\"\n class=\"magicx-aia-dropdown-skeleton-bar\"\n [style.width.px]=\"w\"\n ></span>\n </div>\n\n <!-- *ngIf, not just the section's own guard inside the component: the host\n element is an in-flow child of .aia-stack (display:flex; gap:8px), so\n an always-instantiated zero-height host would add a SECOND 8px gap\n between the grid and the footer — in every dropdown, products or not.\n The grid's --aia-grid-overlap-bottom is tuned for exactly one gap, so\n the footer would land 8px below the band it is meant to cover. -->\n <aia-product-strip\n *ngIf=\"vm.products.length > 0\"\n [products]=\"vm.products\"\n [listboxId]=\"controller.listboxId\"\n [focusable]=\"vm.isVisible\"\n (select)=\"onProductSelect($event)\"\n (focusChange)=\"onProductFocusChange($event)\"\n ></aia-product-strip>\n\n <footer class=\"magicx-aia-footer\" data-aia-footer=\"\">\n <div class=\"magicx-aia-footer-row\">\n <span class=\"magicx-aia-footer-hint-group\">\n <kbd class=\"magicx-aia-footer-key\">{{ vm.footerKey }}</kbd>\n <span class=\"magicx-aia-footer-hint\">{{ vm.footerHint }}</span>\n </span>\n <a\n class=\"magicx-aia-footer-brand-link\"\n [href]=\"brandHref\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <span class=\"magicx-aia-footer-brand\">AI</span>\n <span class=\"magicx-aia-footer-badge\">Autocomplete</span>\n </a>\n </div>\n </footer>\n </aia-stack>\n <!-- \"More below\" arrow — an overlay on the panel, not a section of the\n stack. Shown/positioned by the core's scroll-arrow controller (see\n syncScrollArrow); markup mirrors vanilla's createScrollArrowButton. -->\n <button\n #scrollArrow\n type=\"button\"\n tabindex=\"-1\"\n class=\"magicx-aia-scroll-arrow\"\n data-aia-scroll-arrow=\"\"\n [attr.aria-label]=\"scrollArrowLabel\"\n aria-hidden=\"true\"\n >\n <svg\n viewBox=\"0 0 16 16\"\n width=\"14\"\n height=\"14\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M4 6.5 8 10.5l4-4\" />\n </svg>\n </button>\n</div>\n","import { distinctUntilChanged, map, type Observable, shareReplay } from \"rxjs\";\n\n/**\n * Per-field observable derivation factory. Enforces the §19.4 invariant:\n *\n * - `distinctUntilChanged` — prevents re-emission storms when the upstream\n * state object ticks but the field a consumer cares about hasn't changed.\n * Without this, every keystroke would re-render every async-pipe binding\n * in the consumer's template even when nothing changed for that binding.\n * - `shareReplay({ bufferSize: 1, refCount: true })` — guarantees that\n * multiple subscribers (multiple `async` pipes in a template, e.g.\n * `*ngIf=\"isLoading$ | async\"` and `[disabled]=\"isLoading$ | async\"`)\n * share a single upstream subscription. `refCount: true` is non-obvious\n * but essential: without it, the inner subscription survives after the\n * last subscriber unmounts, leaking the chain back to `state$`.\n *\n * Every public observable on {@link AIAutocompleteController} must go through\n * this factory — no exceptions.\n *\n * @internal\n */\nexport function deriveField<T, R>(\n source$: Observable<T>,\n selector: (value: T) => R,\n equalityFn?: (a: R, b: R) => boolean,\n): Observable<R> {\n return source$.pipe(\n map(selector),\n distinctUntilChanged(equalityFn),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n}\n","import {\n type AutocompleteResult,\n type CompletedParamState,\n AIAutocomplete as CoreAIAutocomplete,\n type CoreState,\n dateSelectionFor,\n type IdentifiedParamState,\n identifiedParamLabel,\n type Product,\n type Segment,\n type SkippedParamState,\n type Suggestion,\n type SuggestionOption,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { BehaviorSubject, combineLatest, map, type Observable, shareReplay } from \"rxjs\";\nimport type {\n AIAutocompleteControllerOptions,\n AIAutocompleteControllerState,\n AIAutocompleteControllerUpdate,\n AIAutocompleteDropdownState,\n} from \"../shared/types\";\nimport { deriveField } from \"./observables\";\n\n/**\n * Tier 2 logic surface for `@magicx-eng/ai-autocomplete-angular` — the Angular\n * equivalent of React's `useAIAutocomplete()` hook. Wraps a headless\n * `@magicx-eng/ai-autocomplete-vanilla` core and exposes its state as RxJS\n * observables plus thin action methods.\n *\n * The controller is consumer-managed — the consumer creates it\n * with `new`, holds the reference, and **must call `destroy()`** in their\n * own `ngOnDestroy`. The Tier 1 `<ai-autocomplete>` component does this\n * automatically; Tier 2 consumers do not get auto-cleanup.\n *\n * @public\n */\nexport class AIAutocompleteController {\n private readonly core: CoreAIAutocomplete;\n private readonly rawState$: BehaviorSubject<CoreState>;\n // optionsPosition isn't part of CoreState (it's a core option), so track it\n // here and fold it into `dropdown$` so the dropdown can read placement from\n // the controller — configured once, kept in sync through update().\n private readonly optionsPosition$ = new BehaviorSubject<\"above\" | \"below\">(\"below\");\n private readonly unsubscribeCore: () => void;\n private isDestroyed = false;\n\n // === Per-field observables ===\n // Each one runs through deriveField, which bakes in distinctUntilChanged\n // and shareReplay({ bufferSize: 1, refCount: true }) per §19.4.\n\n /** Plain-text content of the editor. */\n readonly text$: Observable<string>;\n /** Completed (bold) params currently in the editor. */\n readonly completedParams$: Observable<CompletedParamState[]>;\n /**\n * Suggestions the user dismissed with the skip key (→). Nothing renders\n * them; they exist so a hand-rolled submit can pass them to\n * `buildSubmitResult` and carry the same `text: \"skipped\"` entries the\n * SDK's own requests do.\n */\n readonly skippedParams$: Observable<SkippedParamState[]>;\n /**\n * Params the server identified in the user's own words. Already rendered\n * through `segments$`; exposed so a hand-rolled submit can pass them to\n * `buildSubmitResult` and report the same `identified_params` the SDK's\n * own results carry.\n */\n readonly identifiedParams$: Observable<IdentifiedParamState[]>;\n /** Actionable suggestion pills (first one is the active pill). */\n readonly suggestionPills$: Observable<Suggestion[]>;\n /** Text + completed-param segments for rendering the editor body. */\n readonly segments$: Observable<Segment[]>;\n /** ID of the most-recently-promoted param (drives shimmer animation). */\n readonly newParamId$: Observable<string | null>;\n /** All suggestions from the server (including non-actionable ones). */\n readonly suggestions$: Observable<Suggestion[]>;\n /**\n * Results of the latest product search. Always empty unless `products` is\n * configured on the controller — the strip is opt-in and costs nothing when\n * it isn't wired up.\n */\n readonly products$: Observable<Product[]>;\n /** Currently highlighted dropdown option index. -1 = none. */\n readonly activeIndex$: Observable<number>;\n /**\n * UI-visible loading flag — suppressed during the post-select press\n * animation and during re-edit (cached options stay visible there). Use\n * this instead of the raw core state for any loading-skeleton binding.\n */\n readonly isLoading$: Observable<boolean>;\n /** Server-reported \"query is complete\" flag. */\n readonly isReady$: Observable<boolean>;\n /** Whether the editor currently has focus. */\n readonly isFocused$: Observable<boolean>;\n /** Whether the dropdown should currently be visible. */\n readonly isDropdownOpen$: Observable<boolean>;\n /**\n * Whether the active (leading) pill should render selected (full opacity)\n * rather than the de-emphasized `first` tier. Auto trigger ⇒ true only while\n * a dropdown option is highlighted; manual ⇒ true once the pill is tapped.\n */\n readonly isActivePillSelected$: Observable<boolean>;\n /** Server-suggested placeholder text for the editor. */\n readonly placeholderText$: Observable<string>;\n /** Last fetch error, or null. */\n readonly error$: Observable<Error | null>;\n /** Param currently being re-edited, or null. */\n readonly editingParam$: Observable<CompletedParamState | null>;\n /** Plain-text offset where the edit region starts, or null. */\n readonly editingAnchor$: Observable<number | null>;\n /** Live caret offset within the editor. */\n readonly caretOffset$: Observable<number | null>;\n\n // === Composite observables ===\n\n /**\n * Snapshot of every public field in one object. Convenient for\n * `*ngIf=\"ctrl.state$ | async as state\"` templating — aliases all fields\n * under a single subscription instead of multiple `| async` pipes.\n */\n readonly state$: Observable<AIAutocompleteControllerState>;\n\n /**\n * Composite state for the dropdown view. Tier 2 consumers spread this into\n * `<ai-autocomplete-dropdown>`; Tier 1 uses the same shape internally.\n */\n readonly dropdown$: Observable<AIAutocompleteDropdownState>;\n\n /**\n * Throws if invoked outside a browser environment. For SSR / Angular\n * Universal, gate construction with `isPlatformBrowser`.\n */\n constructor(opts: AIAutocompleteControllerOptions = {}) {\n if (typeof document === \"undefined\") {\n throw new Error(\n \"AIAutocompleteController requires a browser environment. \" +\n \"For SSR / Angular Universal, gate construction with isPlatformBrowser.\",\n );\n }\n\n // Headless mode never renders to the host, so a throwaway div is fine —\n // it's required by the core's signature for symmetry with full mode.\n const host = document.createElement(\"div\");\n\n this.core = new CoreAIAutocomplete(host, {\n ...opts,\n renderMode: \"headless\",\n source: opts.source ?? \"headless-sdk\",\n // Headless mode never renders the dropdown DOM, but the keyboard\n // controller still reads `optionsPosition` to decide which vertical\n // arrow opens the dropdown from the input.\n optionsPosition: opts.optionsPosition ?? \"below\",\n });\n\n this.rawState$ = new BehaviorSubject<CoreState>(this.core.getState());\n // Push the store's *current* state, not the snapshot the listener was\n // handed. The core notifies listeners synchronously, and some actions\n // trigger reentrant `store.set` calls (e.g. typing a non-matching char\n // during re-edit makes the core synchronously exit re-edit and kick off a\n // fetch).\n //\n // The core's store used to deliver such a nested set inline and then\n // resume the outer listener loop, so a listener could be handed an older\n // state (still in re-edit) *after* a newer one (re-edit exited) — which\n // resurrected a stale `editingParam` and retriggered the editor's re-edit\n // caret-park, yanking the caret back to where re-editing started. The\n // store now queues notifications and drains them in order, so that\n // out-of-order delivery can no longer happen at the source.\n //\n // Reading `getState()` at emission time is kept as belt-and-braces: it\n // costs nothing (distinctUntilChanged downstream drops the duplicate\n // emissions) and keeps this bridge correct for any future consumer that\n // emits mid-cascade. React needs neither, since it batches renders and\n // gates its caret effects on dependencies.\n this.unsubscribeCore = this.core.subscribe(() => {\n if (!this.isDestroyed) this.rawState$.next(this.core.getState());\n });\n\n // === Per-field observables ===\n // Array-valued fields use shallow equality. The vanilla store spreads on\n // every write (`store.set({ completedParams: [...] })`), so reference\n // equality would re-fire downstream subscribers on every state tick even\n // when the array's contents are unchanged. The other fields are\n // primitives or stable object references, so default identity equality\n // works fine.\n this.text$ = deriveField(this.rawState$, (s) => s.text);\n this.completedParams$ = deriveField(this.rawState$, (s) => s.completedParams, arrEq);\n this.skippedParams$ = deriveField(this.rawState$, (s) => s.skippedParams, arrEq);\n this.identifiedParams$ = deriveField(this.rawState$, (s) => s.identifiedParams, arrEq);\n this.suggestionPills$ = deriveField(this.rawState$, (s) => s.actionableSuggestions, arrEq);\n this.segments$ = deriveField(this.rawState$, (s) => s.segments, arrEq);\n this.newParamId$ = deriveField(this.rawState$, (s) => s.newParamId);\n this.suggestions$ = deriveField(this.rawState$, (s) => s.suggestions, arrEq);\n this.products$ = deriveField(this.rawState$, (s) => s.products, arrEq);\n this.activeIndex$ = deriveField(this.rawState$, (s) => s.activeDropdownIndex);\n this.isLoading$ = deriveField(this.rawState$, computeUiLoading);\n this.isReady$ = deriveField(this.rawState$, (s) => s.isReady);\n this.isFocused$ = deriveField(this.rawState$, (s) => s.isFocused);\n this.isDropdownOpen$ = deriveField(this.rawState$, (s) => s.isDropdownOpen);\n this.isActivePillSelected$ = deriveField(this.rawState$, (s) => s.isActivePillSelected);\n this.placeholderText$ = deriveField(this.rawState$, (s) => s.placeholderText);\n this.error$ = deriveField(this.rawState$, (s) => s.error);\n this.editingParam$ = deriveField(this.rawState$, (s) => s.editingParam);\n this.editingAnchor$ = deriveField(this.rawState$, (s) => s.editingAnchor);\n this.caretOffset$ = deriveField(this.rawState$, (s) => s.caretOffset);\n\n // === Composite observables ===\n // Project directly off `rawState$` with a single map() so each store\n // tick produces exactly ONE coherent state$ emission. Using\n // `combineLatest` over the per-field observables here would fire one\n // emission per inner-source tick (up to N per store update), and the\n // editor-host directive's post-promote refocus would run against an\n // intermediate state where `newParamId` was set but `segments` /\n // `caretOffset` still held their old values — leaving the caret stuck\n // at the pre-click position.\n this.state$ = this.rawState$.pipe(\n map(computeState),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n\n this.optionsPosition$.next(opts.optionsPosition ?? \"below\");\n this.dropdown$ = combineLatest([this.rawState$, this.optionsPosition$]).pipe(\n map(([s, optionsPosition]) => computeDropdown(s, optionsPosition)),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n }\n\n // === Read-only accessors ===\n\n /** Stable ARIA listbox ID for the dropdown. Pass to `<textarea aria-controls=\"...\">`. */\n get listboxId(): string {\n return this.core.listboxId;\n }\n\n /** Whether `destroy()` has been called. After destruction all action methods no-op. */\n get destroyed(): boolean {\n return this.isDestroyed;\n }\n\n /**\n * Synchronous snapshot of the controller's current public state. Mirrors\n * the latest emission of `state$`. Useful in callbacks where you can't\n * `subscribe` (e.g. inside an event handler).\n */\n getState(): AIAutocompleteControllerState {\n return computeState(this.rawState$.value);\n }\n\n /**\n * The structured query as the SDK understands it right now — the same\n * object `onResult` delivers after each response and `onSubmit` delivers\n * on submit. Read it on demand from a place that has no event handy (a\n * custom submit button, a \"save draft\" action).\n */\n getResult(): AutocompleteResult {\n return this.core.getResult();\n }\n\n // === Action methods (pass-through to the core) ===\n //\n // Every action method begins with an `isDestroyed` guard so that callers\n // who hold a stale reference after `destroy()` don't accidentally trigger\n // work on a torn-down core. The vanilla core does not gate its own methods\n // post-dispose — `reset()`, `handleTextChange()`, and friends would still\n // schedule fetches or fire HTTP requests against an aborted controller,\n // and the responses would have nowhere to surface (rawState$ is already\n // complete). The guard makes the JSDoc-promised \"no-op silently\"\n // semantics actually true.\n\n /** Clear all state, rotate `session_id`, and re-fetch. Call after submit. */\n reset(): void {\n if (this.isDestroyed) return;\n this.core.reset();\n }\n\n /** Pick a dropdown option (or replace the re-edited param if in re-edit mode). */\n selectOption(option: SuggestionOption): void {\n if (this.isDestroyed) return;\n this.core.selectOption(option);\n }\n\n /**\n * Announce a product selection — fires the `onProductSelect` callback the\n * controller was constructed with. `<ai-autocomplete-dropdown>` calls this\n * for you; consumers rendering their own strip call it themselves.\n *\n * Emitting is the whole behaviour: the SDK deliberately does not navigate to\n * `product.url`, because only the integration knows whether a selection\n * means \"open the PDP\", \"add to cart\", or \"fill the input\".\n */\n selectProduct(product: Product): void {\n if (this.isDestroyed) return;\n this.core.selectProduct(product);\n }\n\n /** Promote the pill at `index` to active (front of the list). */\n setActivePill(index: number): void {\n if (this.isDestroyed) return;\n this.core.setActivePill(index);\n }\n\n /**\n * Skip the active pill — same action as pressing → at the end of the input.\n * The dropdown's skip button calls this; consumers rendering their own skip\n * affordance call it directly. The skipped suggestion joins `skippedParams$`.\n */\n skipActivePill(): void {\n if (this.isDestroyed) return;\n this.core.skipActivePill();\n }\n\n /** Drop the last completed param's \"completed\" status. Text stays as plain text. */\n removeLastParam(): void {\n if (this.isDestroyed) return;\n this.core.removeLastParam();\n }\n\n /** Clear the shimmer animation state for the most-recently-added param. */\n clearNewParamId(): void {\n if (this.isDestroyed) return;\n this.core.clearNewParamId();\n }\n\n /** Controlled-mode setter for editor text. */\n setValue(text: string): void {\n if (this.isDestroyed) return;\n this.core.setValue(text);\n }\n\n /** Controlled-mode setter for completed params. */\n setCompletedParams(params: CompletedParamState[]): void {\n if (this.isDestroyed) return;\n this.core.setCompletedParams(params);\n }\n\n /** Forward plain-text input from the consumer's `<textarea>` to the core. */\n handleTextChange(value: string): void {\n if (this.isDestroyed) return;\n this.core.handleTextChange(value);\n }\n\n /** Forward keyboard events from the consumer's `<textarea>` to the core. */\n handleKeyDown(event: KeyboardEvent): void {\n if (this.isDestroyed) return;\n this.core.handleKeyDown(event);\n }\n\n /** Notify the core of focus state. */\n setFocused(focused: boolean): void {\n if (this.isDestroyed) return;\n this.core.setFocused(focused);\n }\n\n /** Enter re-edit mode for the bold param with the given id. */\n startEditingParam(paramId: string): void {\n if (this.isDestroyed) return;\n this.core.startEditingParam(paramId);\n }\n\n /** Exit re-edit mode without changing the bold param. */\n exitEditMode(): void {\n if (this.isDestroyed) return;\n this.core.exitEditMode();\n }\n\n /** Forward post-input caret position (extends the edit tail). */\n handleCaretAfterInput(offset: number | null): void {\n if (this.isDestroyed) return;\n this.core.handleCaretAfterInput(offset);\n }\n\n /** Forward selection-only caret moves (may exit re-edit). */\n handleCaretMove(offset: number | null): void {\n if (this.isDestroyed) return;\n this.core.handleCaretMove(offset);\n }\n\n /** Replace the bold param being re-edited. Returns true when applied. */\n replaceEditingRange(replacement: string): boolean {\n if (this.isDestroyed) return false;\n return this.core.replaceEditingRange(replacement);\n }\n\n /** Set the highlighted option index (typically driven by hover). */\n setActiveDropdownIndex(index: number): void {\n if (this.isDestroyed) return;\n this.core.setActiveDropdownIndex(index);\n }\n\n /** Page the datepicker back one month. No-op unless a date pill is active. */\n showPreviousMonth(): void {\n if (this.isDestroyed) return;\n this.core.showPreviousMonth();\n }\n\n /** Page the datepicker forward one month. No-op unless a date pill is active. */\n showNextMonth(): void {\n if (this.isDestroyed) return;\n this.core.showNextMonth();\n }\n\n // === Lifecycle ===\n\n /**\n * Apply runtime changes to a subset of options. Event callbacks\n * (`onSubmit`, `onResult`, `onError`, etc.) cannot be swapped this way — they are\n * registered once at construction (matches the React hook's design). For\n * dynamic event reactivity, subscribe to the corresponding observable\n * (e.g. `text$` instead of `onChange`).\n */\n update(opts: AIAutocompleteControllerUpdate): void {\n if (this.isDestroyed) return;\n this.core.update(opts);\n if (opts.optionsPosition !== undefined) {\n this.optionsPosition$.next(opts.optionsPosition);\n }\n }\n\n /**\n * Release all resources — unsubscribes from the core, destroys the core,\n * and completes the internal state subject. Safe to call multiple times.\n * After destruction, action methods no-op silently.\n */\n destroy(): void {\n if (this.isDestroyed) return;\n this.isDestroyed = true;\n this.unsubscribeCore();\n this.core.destroy();\n this.rawState$.complete();\n }\n}\n\n// ===== Pure helpers — not part of the public surface =====\n\n/**\n * Shallow array equality. The vanilla store reassigns array fields on every\n * write (`store.set({ completedParams: [...prev, x] })`), so reference\n * equality alone would re-emit downstream even when the contents are\n * identical. Used for `completedParams$`, `suggestions$`, `suggestionPills$`,\n * and `segments$`.\n */\nfunction arrEq<T>(a: readonly T[], b: readonly T[]): boolean {\n if (a === b) return true;\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n}\n\n/**\n * UI-visible loading: a suggest request outside re-edit and the post-select\n * press animation, or an `optionOverrides` entry still answering for the pill\n * on screen (which shows the skeleton in any mode — its pill has nothing else\n * to show yet).\n */\nfunction computeUiLoading(s: CoreState): boolean {\n return (s.isLoading && !s.editingParam && !s.inSelectionAnimation) || s.isSearchingOptions;\n}\n\nfunction computeState(s: CoreState): AIAutocompleteControllerState {\n return {\n text: s.text,\n completedParams: s.completedParams,\n skippedParams: s.skippedParams,\n identifiedParams: s.identifiedParams,\n suggestionPills: s.actionableSuggestions,\n segments: s.segments,\n newParamId: s.newParamId,\n suggestions: s.suggestions,\n products: s.products,\n activeIndex: s.activeDropdownIndex,\n isLoading: computeUiLoading(s),\n isReady: s.isReady,\n isFocused: s.isFocused,\n isDropdownOpen: s.isDropdownOpen,\n placeholderText: s.placeholderText,\n error: s.error,\n editingParam: s.editingParam,\n editingIdentified: s.editingIdentified,\n editingAnchor: s.editingAnchor,\n caretOffset: s.caretOffset,\n };\n}\n\nfunction computeDropdown(\n s: CoreState,\n optionsPosition: \"above\" | \"below\",\n): AIAutocompleteDropdownState {\n const editingParam = s.editingParam;\n const editingIdentified = s.editingIdentified;\n const dateSelection = dateSelectionFor(s);\n const activeSuggestion = s.actionableSuggestions[0];\n const dropdownPill: Suggestion | null = editingParam\n ? {\n type: editingParam.suggestionType,\n text: editingParam.suggestionPlaceholder,\n required: true,\n options: editingParam.options,\n }\n : editingIdentified\n ? // Answering a span the user wrote themselves: the pill names the\n // parameter the server matched it to, so the calendar isn't unlabelled.\n {\n type: editingIdentified.type,\n text: identifiedParamLabel(editingIdentified.type),\n required: true,\n options: [],\n }\n : null;\n const dropdownActivePill = dropdownPill ?? activeSuggestion;\n const dropdownPills = dropdownPill ? [dropdownPill] : s.actionableSuggestions;\n return {\n suggestions: dropdownActivePill ? [{ ...dropdownActivePill, options: s.filteredOptions }] : [],\n activeIndex: s.activeDropdownIndex,\n isOpen: s.isDropdownOpen,\n pills: dropdownPills,\n isActivePillSelected: s.isActivePillSelected,\n isLoading: computeUiLoading(s),\n isInputEmpty: s.text.trim().length === 0,\n products: s.products,\n isEditing: Boolean(editingParam) || Boolean(editingIdentified),\n inSelectionAnimation: s.inSelectionAnimation,\n // Datepicker. `s.filteredOptions` above already carries the visible\n // month's cells rather than the suggestion's own options when this is\n // \"date\" — the core swapped them in its derive layer, so the dropdown only\n // has to know which body to draw.\n formatType: s.activeFormatType,\n dateView: s.dateView,\n selectedDateIso: dateSelection.selectedIso,\n selectedDateRange: dateSelection.selectedRange,\n dateRangeStart: dateSelection.rangeStart,\n optionsPosition,\n };\n}\n","import {\n Directive,\n ElementRef,\n Input,\n inject,\n NgZone,\n type OnChanges,\n type OnDestroy,\n type OnInit,\n Renderer2,\n type SimpleChanges,\n} from \"@angular/core\";\nimport {\n extractPlainText,\n getCursorOffset,\n plainTextLength,\n renderEditableContent,\n setCursorOffset,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { Subject, takeUntil } from \"rxjs\";\nimport type { AIAutocompleteController } from \"../../controller/ai-autocomplete.controller\";\nimport type { AIAutocompleteControllerState } from \"../../shared/types\";\n\n/**\n * Module-level cache for the one-time plaintext-only feature detection.\n * Mirrors `supportsPlaintextOnly` in useContentEditableEditor.ts.\n */\nlet plaintextOnlyCache: boolean | undefined;\nfunction supportsPlaintextOnly(): boolean {\n if (plaintextOnlyCache !== undefined) return plaintextOnlyCache;\n if (typeof document === \"undefined\") return false;\n const probe = document.createElement(\"div\");\n probe.setAttribute(\"contenteditable\", \"plaintext-only\");\n plaintextOnlyCache = probe.contentEditable === \"plaintext-only\";\n return plaintextOnlyCache;\n}\n\n/**\n * Internal directive that owns every concern specific to running the\n * autocomplete on top of a contentEditable host: composition state, caret\n * tracking, selectionchange handling, `beforeinput` interception, paste\n * sanitization, plaintext-only feature detection, segment rendering,\n * post-promote refocus, and re-edit caret park.\n *\n * Mirrors `packages/react/src/hooks/useContentEditableEditor.ts` one-for-one.\n * Used only by the Tier 1 `<ai-autocomplete>` component — never exported.\n *\n * @internal\n */\n@Directive({\n selector: \"[aiaEditorHost]\",\n standalone: true,\n host: {\n role: \"combobox\",\n \"aria-autocomplete\": \"list\",\n \"aria-haspopup\": \"listbox\",\n spellcheck: \"true\",\n enterkeyhint: \"send\",\n tabindex: \"0\",\n \"(input)\": \"onInput()\",\n \"(keydown)\": \"onKeyDown($event)\",\n \"(compositionstart)\": \"onCompositionStart()\",\n \"(compositionend)\": \"onCompositionEnd()\",\n \"(paste)\": \"onPaste($event)\",\n \"(focus)\": \"onFocus()\",\n \"(blur)\": \"onBlur()\",\n },\n})\nexport class AIAutocompleteEditorHostDirective implements OnInit, OnChanges, OnDestroy {\n @Input(\"aiaEditorHost\") controller!: AIAutocompleteController;\n @Input() autoFocus = true;\n /** Whether completed chips draw the icon of the option that answered them. Default: true. */\n @Input() showChipIcons = true;\n\n private readonly el = inject<ElementRef<HTMLDivElement>>(ElementRef);\n private readonly renderer = inject(Renderer2);\n private readonly zone = inject(NgZone);\n private readonly destroy$ = new Subject<void>();\n\n private composing = false;\n private lastInputAt = 0;\n private lastSeenParamId = \"\";\n // The last state rendered, so a toggle of `showChipIcons` can re-render\n // the editor without waiting for the controller's next state tick.\n private lastState: AIAutocompleteControllerState | null = null;\n private lastEditingId = \"\";\n /**\n * Id of whichever chip the dropdown is currently open on — a completed param\n * being re-edited, or a span the server identified as a date. Either kind\n * counts, otherwise every caret tick inside an open date span would re-enter\n * the pick it is already in.\n */\n private editingParamId: string | null = null;\n\n private documentSelectionListener?: () => void;\n private beforeInputListener?: (event: Event) => void;\n\n ngOnInit(): void {\n if (!this.controller) {\n throw new Error(\"[aiaEditorHost] requires a controller\");\n }\n\n const el = this.el.nativeElement;\n const ceMode = supportsPlaintextOnly() ? \"plaintext-only\" : \"true\";\n this.renderer.setAttribute(el, \"contenteditable\", ceMode);\n this.renderer.setAttribute(el, \"aria-controls\", this.controller.listboxId);\n this.renderer.setAttribute(el, \"suppress-content-editable-warning\", \"true\");\n\n // Auto-focus on mount. If the editor already has focus (e.g. from a\n // click that fired before our lifecycle ran), notify the controller\n // instead of stealing focus.\n if (this.autoFocus) {\n queueMicrotask(() => {\n if (typeof document === \"undefined\") return;\n if (document.activeElement === el) {\n this.controller.setFocused(true);\n } else {\n el.focus();\n }\n });\n }\n\n this.bindDocumentSelectionListener();\n this.bindBeforeInputListener();\n this.bindStateSubscription();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes[\"showChipIcons\"] && !changes[\"showChipIcons\"].firstChange && this.lastState) {\n this.renderEditor(this.lastState);\n }\n }\n\n private renderEditor(state: AIAutocompleteControllerState): void {\n renderEditableContent({\n input: this.el.nativeElement,\n segments: state.segments,\n newParamId: state.newParamId,\n editingParamId: state.editingParam?.id ?? null,\n placeholderText: state.placeholderText,\n isFocused: state.isFocused,\n showChipIcons: this.showChipIcons,\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n if (this.documentSelectionListener && typeof document !== \"undefined\") {\n document.removeEventListener(\"selectionchange\", this.documentSelectionListener);\n }\n if (this.beforeInputListener) {\n this.el.nativeElement.removeEventListener(\"beforeinput\", this.beforeInputListener);\n }\n }\n\n // === Host event handlers ===\n\n onCompositionStart(): void {\n this.composing = true;\n }\n\n onCompositionEnd(): void {\n this.composing = false;\n this.fireInput();\n }\n\n onInput(): void {\n this.lastInputAt = performance.now();\n this.fireInput();\n this.controller.handleCaretAfterInput(getCursorOffset(this.el.nativeElement));\n }\n\n onKeyDown(event: KeyboardEvent): void {\n this.controller.handleKeyDown(event);\n }\n\n onPaste(event: ClipboardEvent): void {\n event.preventDefault();\n const el = this.el.nativeElement;\n const text = (event.clipboardData?.getData(\"text/plain\") ?? \"\").replace(/\\r?\\n/g, \" \");\n if (!text) return;\n const doc = el.ownerDocument ?? document;\n const sel = doc.getSelection();\n if (!sel || sel.rangeCount === 0) return;\n const range = sel.getRangeAt(0);\n if (!el.contains(range.startContainer)) return;\n range.deleteContents();\n const node = doc.createTextNode(text);\n range.insertNode(node);\n range.setStartAfter(node);\n range.collapse(true);\n sel.removeAllRanges();\n sel.addRange(range);\n this.fireInput();\n }\n\n onFocus(): void {\n this.controller.setFocused(true);\n }\n\n onBlur(): void {\n this.controller.setFocused(false);\n }\n\n // === Internal helpers ===\n\n private fireInput(): void {\n if (this.composing) return;\n const el = this.el.nativeElement;\n const raw = extractPlainText(el);\n const shouldCapitalize = raw.length > 0 && raw[0] !== raw[0].toUpperCase();\n const next = shouldCapitalize ? raw[0].toUpperCase() + raw.slice(1) : raw;\n this.controller.handleTextChange(next);\n }\n\n private bindDocumentSelectionListener(): void {\n if (typeof document === \"undefined\") return;\n const el = this.el.nativeElement;\n // selectionchange fires on every keystroke and caret move — run outside\n // Angular's zone (§16.1) and re-enter only when we actually need to\n // notify the controller of a meaningful change.\n this.zone.runOutsideAngular(() => {\n const handler = (): void => {\n const sel = document.getSelection();\n if (!sel || sel.rangeCount === 0) return;\n if (!sel.anchorNode || !el.contains(sel.anchorNode)) return;\n const anchor = sel.anchorNode;\n const startEl =\n anchor.nodeType === Node.ELEMENT_NODE ? (anchor as Element) : anchor.parentElement;\n // Only a COLLAPSED selection means \"the caret landed in a chip\". A\n // range selection (Cmd+A, shift-arrow, drag) anchors at its start,\n // which lands inside the first `<strong>` whenever the input begins\n // with a chip — starting re-edit there parks the caret on that chip\n // and destroys the user's selection.\n const strong = sel.isCollapsed\n ? // Both chip kinds report here. The core decides what a tap means — a\n // completed param re-opens its options, an identified date opens the\n // calendar, anything else is inert.\n startEl?.closest<HTMLElement>(\"strong[data-param-id]\")\n : null;\n // `DOMStringMap` is an index signature; bracket notation is required\n // by `noPropertyAccessFromIndexSignature`.\n const enclosing = strong?.dataset[\"paramId\"] ?? null;\n if (enclosing && enclosing !== this.editingParamId) {\n this.zone.run(() => this.controller.startEditingParam(enclosing));\n return;\n }\n if (performance.now() - this.lastInputAt < 50) return;\n this.zone.run(() => this.controller.handleCaretMove(getCursorOffset(el)));\n };\n this.documentSelectionListener = handler;\n document.addEventListener(\"selectionchange\", handler);\n });\n }\n\n private bindBeforeInputListener(): void {\n const el = this.el.nativeElement;\n // Native beforeinput — React's synthetic onBeforeInput is wired to the\n // legacy textInput event and doesn't fire reliably for delete* types.\n const handler = (event: Event): void => {\n const inputEvent = event as InputEvent;\n const t = inputEvent.inputType;\n if (t === \"insertParagraph\" || t === \"insertLineBreak\" || t === \"insertFromDrop\") {\n event.preventDefault();\n return;\n }\n if (t.startsWith(\"insert\") || t.startsWith(\"delete\")) {\n const replacement = t.startsWith(\"delete\") ? \"\" : (inputEvent.data ?? \"\");\n if (this.controller.replaceEditingRange(replacement)) {\n event.preventDefault();\n }\n }\n };\n this.beforeInputListener = handler;\n el.addEventListener(\"beforeinput\", handler);\n }\n\n private bindStateSubscription(): void {\n const el = this.el.nativeElement;\n this.controller.state$.pipe(takeUntil(this.destroy$)).subscribe((state) => {\n this.editingParamId = state.editingParam?.id ?? state.editingIdentified?.id ?? null;\n\n this.lastState = state;\n this.renderEditor(state);\n\n // Post-promote refocus + caret-after-bold placement (mirrors React's\n // useLayoutEffect on newParamId).\n const currentParamId = state.newParamId ?? \"\";\n if (currentParamId && currentParamId !== this.lastSeenParamId) {\n this.lastSeenParamId = currentParamId;\n el.focus();\n const desired = state.caretOffset ?? plainTextLength(el);\n setCursorOffset(el, desired);\n } else if (!currentParamId) {\n this.lastSeenParamId = \"\";\n }\n\n // Re-edit caret park (mirrors React's useLayoutEffect on editingParam).\n const editingId = state.editingParam?.id ?? \"\";\n if (editingId && editingId !== this.lastEditingId && state.editingAnchor != null) {\n this.lastEditingId = editingId;\n setCursorOffset(el, state.editingAnchor);\n } else if (!editingId) {\n this.lastEditingId = \"\";\n }\n });\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n ViewEncapsulation,\n} from \"@angular/core\";\n\n/**\n * Internal default submit button (up-arrow). Angular analogue of React's\n * `SubmitButton`. The default/custom/hidden branching stays in the parent\n * (`AIAutocompleteComponent`); this is only the built-in button.\n *\n * @internal\n */\n@Component({\n selector: \"aia-submit-button\",\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./submit-button.component.html\",\n styleUrls: [\"./submit-button.component.css\"],\n})\nexport class SubmitButtonComponent {\n @Input() disabled = false;\n @Output() readonly submit = new EventEmitter<MouseEvent>();\n\n onClick(event: MouseEvent): void {\n this.submit.emit(event);\n }\n}\n","<button\n type=\"button\"\n data-aia-submit=\"\"\n class=\"magicx-aia-submit-button\"\n [disabled]=\"disabled\"\n aria-label=\"Submit\"\n (click)=\"onClick($event)\"\n>\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" role=\"img\" aria-label=\"Submit\">\n <path\n d=\"M9 14V4M9 4L4 9M9 4L14 9\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n</button>\n","import { CommonModule, isPlatformBrowser } from \"@angular/common\";\nimport {\n type AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n type ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n inject,\n NgZone,\n type OnChanges,\n type OnDestroy,\n type OnInit,\n Output,\n PLATFORM_ID,\n type SimpleChanges,\n type TemplateRef,\n ViewChild,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport {\n type APIConfig,\n type AppearanceMode,\n type AutocompleteResult,\n buildSubmitResult,\n type CompletedParamState,\n extractPlainText,\n ModeController,\n type OptionOverrides,\n type Product,\n type ProductsConfig,\n setCursorOffset,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { AIAutocompleteDropdownComponent } from \"../ai-autocomplete-dropdown/ai-autocomplete-dropdown.component\";\nimport { AIAutocompleteController } from \"../controller/ai-autocomplete.controller\";\nimport { AIAutocompleteEditorHostDirective } from \"../internal/editor-host/editor-host.directive\";\nimport { PillListComponent } from \"../internal/pill-list/pill-list.component\";\nimport { SubmitButtonComponent } from \"../internal/submit-button/submit-button.component\";\n\n/**\n * Tier 1 component — `<ai-autocomplete>`. The Angular equivalent of React's\n * `<AIAutocomplete />`. Owns the contentEditable editor, inline pills, mode\n * controller, submit button slot, and an embedded\n * {@link AIAutocompleteController} that drives the dropdown.\n *\n * @public\n */\n@Component({\n selector: \"ai-autocomplete\",\n standalone: true,\n imports: [\n CommonModule,\n AIAutocompleteDropdownComponent,\n AIAutocompleteEditorHostDirective,\n PillListComponent,\n SubmitButtonComponent,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./ai-autocomplete.component.html\",\n styleUrls: [\"./ai-autocomplete.component.css\"],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n useExisting: forwardRef(() => AIAutocompleteComponent),\n multi: true,\n },\n ],\n})\nexport class AIAutocompleteComponent\n implements OnInit, AfterViewInit, OnChanges, OnDestroy, ControlValueAccessor\n{\n // === Inputs (mirrors React's AIAutocompleteProps) ===\n\n @Input() apiConfig?: APIConfig;\n /**\n * Optional user context. Include whatever you know about the user — a\n * profile, preferences, workspace, anything — to personalize suggested\n * parameters and options to them. Bind a stable reference; the same swap\n * rule that applies to `apiConfig` applies here.\n */\n @Input() additionalContext?: Record<string, unknown>;\n @Input() optionOverrides?: OptionOverrides;\n @Input() maskCompletedText = false;\n @Input() columns?: number;\n /** Where unfilled pills render. Default: \"dropdown\". */\n @Input() pillPlacement: \"inline\" | \"dropdown\" | \"hidden\" = \"dropdown\";\n /** Color mode. \"auto\" follows prefers-color-scheme. Default: \"auto\". */\n @Input() mode: AppearanceMode = \"auto\";\n @Input() optionsPosition: \"above\" | \"below\" = \"below\";\n @Input() animations = true;\n @Input() dropdownTrigger?: \"auto\" | \"manual\" | \"hidden\";\n @Input() closeDropdownOnBlur?: boolean;\n @Input() showNonTappableOptions?: boolean;\n /**\n * When true (default), the dropdown's pill bar ends in a small \"skip\" button\n * that dismisses the active pill — same action as pressing → at the end of\n * the input. Set to false to hide it. When pills render elsewhere\n * (`pillPlacement: \"inline\"` / `\"hidden\"`) the bar renders as a skip-only\n * row holding just the button. Hidden while the input is empty — it appears\n * alongside the footer's \"→ to skip\" hint once the user has typed.\n */\n @Input() showSkipButton = true;\n /** When true (default), an option that carries an `icon_svg` draws its icon before its text in the dropdown. Set to false to render option rows as text only. */\n @Input() showOptionIcons = true;\n /** When true (default), a completed chip in the input draws the icon of the option that answered it. Set to false to render chips as text only. */\n @Input() showChipIcons = true;\n /** Focus the editor on mount. Default: true. */\n @Input() autoFocus = true;\n /** Controlled-mode text value. */\n @Input() value?: string;\n /** Controlled-mode completed params. */\n @Input() completedParams?: CompletedParamState[];\n /**\n * Opt-in product strip. When set, the dropdown renders a horizontal row of\n * product cards below the options grid, fed by your own search endpoint on\n * the SDK's existing fetch cadence. Omit it and nothing about the dropdown\n * changes — no request, no markup, no layout shift.\n *\n * Bind a stable reference (a component field, not an inline object literal):\n * a new object on each change-detection pass reads as a swapped integration\n * and clears the current cards — the same rule that already applies to\n * `apiConfig` and `optionOverrides`.\n */\n @Input() products?: ProductsConfig;\n /**\n * Custom submit button. Pass a `<ng-template>` to replace the default arrow\n * button. Pass `null` to render no button. Default (`undefined`) renders\n * the built-in arrow.\n */\n @Input() submitButton?: TemplateRef<unknown> | null;\n\n // === Outputs ===\n\n /** Called on Enter or submit-button click. */\n @Output() readonly submitted = new EventEmitter<AutocompleteResult>();\n /**\n * Fires after every successful suggestion round-trip with the structured\n * query as the SDK now understands it — the same `AutocompleteResult` shape\n * `submitted` carries, so you can mirror the query as it is built (a live\n * preview, a draft, analytics) without waiting for submit. Fires once per\n * applied response, including the initial request on init (an empty\n * result); never for a failed, aborted or superseded request.\n */\n @Output() readonly resultChange = new EventEmitter<AutocompleteResult>();\n @Output() readonly errored = new EventEmitter<Error>();\n @Output() readonly valueChange = new EventEmitter<string>();\n @Output() readonly completedParamsChange = new EventEmitter<CompletedParamState[]>();\n @Output() readonly focused = new EventEmitter<void>();\n @Output() readonly blurred = new EventEmitter<void>();\n /**\n * Emitted when the user activates a product card. The SDK does not\n * navigate — you decide what a selection means. Modifier / middle clicks are\n * left to the browser (cmd-click still opens a tab) and don't emit.\n */\n @Output() readonly productSelect = new EventEmitter<Product>();\n\n // === View refs ===\n\n @ViewChild(\"container\", { static: true }) containerRef!: ElementRef<HTMLDivElement>;\n @ViewChild(\"editor\", { static: false }) editorRef?: ElementRef<HTMLDivElement>;\n @ViewChild(\"pillContainer\") pillContainerRef?: ElementRef<HTMLSpanElement>;\n\n // === Public state for the template ===\n\n controller!: AIAutocompleteController;\n /**\n * Concrete light/dark value bound to `[attr.data-mode]`. Seeded in ngOnInit\n * so the attribute is present during SSR (where ModeController, gated behind\n * isPlatformBrowser in ngAfterViewInit, never runs). On the browser the\n * ModeController's resolve callback keeps this in sync — so its runtime\n * prefers-color-scheme updates and this binding always agree (no clobber).\n */\n resolvedMode: \"light\" | \"dark\" = \"dark\";\n\n // === Internal ===\n\n private modeController?: ModeController;\n private resizeObserver?: ResizeObserver;\n private onChangeFn: (value: string) => void = noop;\n private onTouchedFn: () => void = noop;\n // Holds a value written by Reactive Forms before ngOnInit ran. Reactive\n // Forms can call writeValue() during dynamic form construction (e.g. when\n // a FormControl already holds a value at the moment the directive is\n // created). We stash the value here and flush it in ngOnInit *after*\n // the controller exists — otherwise the editor renders empty even though\n // the form had a value. `undefined` means \"no pending write\".\n private pendingWriteValue: string | undefined;\n\n // §16.9: prefer `inject()` over constructor-parameter DI for components.\n private readonly platformId = inject(PLATFORM_ID);\n private readonly zone = inject(NgZone);\n private readonly cdr = inject(ChangeDetectorRef);\n\n ngOnInit(): void {\n // Seed before the browser guard so SSR renders a concrete data-mode.\n this.resolvedMode = resolveInitialMode(this.mode);\n if (!isPlatformBrowser(this.platformId)) return;\n\n this.controller = new AIAutocompleteController({\n apiConfig: this.apiConfig,\n additionalContext: this.additionalContext,\n optionOverrides: this.optionOverrides,\n maskCompletedText: this.maskCompletedText,\n columns: this.columns,\n dropdownTrigger: this.dropdownTrigger,\n optionsPosition: this.optionsPosition,\n closeDropdownOnBlur: this.closeDropdownOnBlur,\n showNonTappableOptions: this.showNonTappableOptions,\n source: \"full-sdk\",\n products: this.products,\n value: this.value,\n completedParams: this.completedParams,\n onSubmit: (result) => this.handleSubmit(result),\n onResult: (result) => this.resultChange.emit(result),\n onError: (error) => this.errored.emit(error),\n onChange: (text) => {\n this.valueChange.emit(text);\n this.onChangeFn(text);\n },\n onParamsChange: (params) => this.completedParamsChange.emit(params),\n onFocus: () => this.focused.emit(),\n onProductSelect: (product) => this.productSelect.emit(product),\n onBlur: () => {\n this.blurred.emit();\n this.onTouchedFn();\n },\n setCursor: (offset) => {\n const editor = this.editorRef?.nativeElement;\n if (!editor) return;\n editor.focus();\n setCursorOffset(editor, offset);\n },\n });\n\n if (this.pendingWriteValue !== undefined) {\n this.controller.setValue(this.pendingWriteValue);\n this.pendingWriteValue = undefined;\n }\n }\n\n ngAfterViewInit(): void {\n if (!isPlatformBrowser(this.platformId)) return;\n // ModeController writes `data-mode` to the element it's given. The CSS\n // selectors are scoped to `.magicx-aia[data-mode=\"...\"]` — which lives on\n // the inner `<div class=\"magicx-aia magicx-aia-container\" #container>`,\n // NOT the host `<ai-autocomplete>` element. The resolve callback mirrors\n // the value into `resolvedMode` so the `[attr.data-mode]` binding stays in\n // lockstep with ModeController — the binding handles SSR, ModeController\n // handles runtime prefers-color-scheme switches, and because they always\n // agree neither clobbers the other.\n this.modeController = new ModeController(\n this.containerRef.nativeElement,\n this.mode,\n (resolved) => {\n this.resolvedMode = resolved;\n this.cdr.markForCheck();\n },\n );\n\n // Pill-wrap detection — when the pill list wraps below the editor's last\n // line, drop its 8px left margin via a data attribute the CSS keys off.\n // Mirrors the React component's useLayoutEffect.\n if (typeof ResizeObserver !== \"undefined\") {\n this.zone.runOutsideAngular(() => {\n this.resizeObserver = new ResizeObserver(() => this.measurePillWrap());\n const editor = this.editorRef?.nativeElement;\n if (editor) this.resizeObserver.observe(editor);\n });\n this.measurePillWrap();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.controller) return;\n // `SimpleChanges` is `{ [key: string]: SimpleChange }`, so per\n // `noPropertyAccessFromIndexSignature` each key lookup uses bracket\n // notation — this keeps the strictness contract that the rest of the\n // workspace enforces.\n // Controlled-mode propagation\n if (changes[\"value\"] && this.value !== undefined) {\n this.controller.setValue(this.value);\n }\n if (changes[\"completedParams\"] && this.completedParams !== undefined) {\n this.controller.setCompletedParams(this.completedParams);\n }\n // Reactive options\n if (\n changes[\"apiConfig\"] ||\n changes[\"additionalContext\"] ||\n changes[\"optionOverrides\"] ||\n changes[\"dropdownTrigger\"] ||\n changes[\"optionsPosition\"] ||\n changes[\"closeDropdownOnBlur\"] ||\n changes[\"showNonTappableOptions\"] ||\n changes[\"products\"]\n ) {\n this.controller.update({\n apiConfig: this.apiConfig,\n additionalContext: this.additionalContext,\n optionOverrides: this.optionOverrides,\n dropdownTrigger: this.dropdownTrigger,\n optionsPosition: this.optionsPosition,\n closeDropdownOnBlur: this.closeDropdownOnBlur,\n showNonTappableOptions: this.showNonTappableOptions,\n // Same reference on an unrelated change is a no-op in the core; only a\n // genuinely swapped (or removed) integration clears the strip.\n products: this.products,\n });\n }\n if (changes[\"mode\"]) {\n // Keep the binding correct even when ModeController doesn't exist yet\n // (SSR / pre-ngAfterViewInit). On the browser, setMode triggers the\n // resolve callback which sets the same value.\n this.resolvedMode = resolveInitialMode(this.mode);\n this.modeController?.setMode(this.mode);\n }\n }\n\n ngOnDestroy(): void {\n this.resizeObserver?.disconnect();\n this.modeController?.destroy();\n this.controller?.destroy();\n }\n\n // === Imperative API (exposed on the component instance via @ViewChild) ===\n\n /** Programmatically focus the editor. */\n focus(): void {\n this.editorRef?.nativeElement.focus();\n }\n\n /** Programmatically blur the editor. */\n blur(): void {\n this.editorRef?.nativeElement.blur();\n }\n\n /** Clear all state, rotate session, and re-fetch. */\n reset(): void {\n this.controller?.reset();\n }\n\n /**\n * Skip the active pill — same action as the dropdown's skip button / →.\n * Lets a consumer who hides the built-in button (`showSkipButton=false`)\n * drive skipping from their own UI.\n */\n skipActivePill(): void {\n this.controller?.skipActivePill();\n }\n\n /** Switch color mode at runtime. */\n setMode(mode: AppearanceMode): void {\n this.mode = mode;\n this.resolvedMode = resolveInitialMode(mode);\n this.modeController?.setMode(mode);\n this.cdr.markForCheck();\n }\n\n // === Template helpers ===\n\n /**\n * 'default' → render the built-in arrow button.\n * 'custom' → project the consumer-supplied TemplateRef.\n * 'hidden' → no button.\n */\n get submitButtonState(): \"default\" | \"custom\" | \"hidden\" {\n if (this.submitButton === null) return \"hidden\";\n if (this.submitButton === undefined) return \"default\";\n return \"custom\";\n }\n\n /** Narrowed accessor for *ngTemplateOutlet — never undefined. */\n get customSubmitTemplate(): TemplateRef<unknown> | null {\n return this.submitButton ?? null;\n }\n\n get showInlinePills(): boolean {\n return this.pillPlacement === \"inline\";\n }\n\n get showDropdownPills(): boolean {\n return this.pillPlacement === \"dropdown\";\n }\n\n /**\n * `true` when there's something to submit — driven by current segments\n * and completed params. Read off the live editor via the controller state.\n */\n canSubmit(state: { segments: { length: number }; completedParams: { length: number } }): boolean {\n return state.segments.length > 0 || state.completedParams.length > 0;\n }\n\n onWrapperClick(event: MouseEvent): void {\n // Clicking a pill should activate it without stealing focus elsewhere.\n const target = event.target as HTMLElement | null;\n if (target?.closest(\"[data-aia-pill]\")) return;\n this.focus();\n }\n\n onSubmitButtonClick(event: MouseEvent): void {\n event.stopPropagation();\n this.handleSubmitFromUserAction();\n }\n\n onSubmitSlotClick(event: MouseEvent): void {\n event.stopPropagation();\n this.handleSubmitFromUserAction();\n }\n\n onSelectPill(index: number): void {\n this.controller.setActivePill(index);\n }\n\n // === ControlValueAccessor ===\n\n writeValue(value: string | null): void {\n const next = value ?? \"\";\n if (!this.controller) {\n // Reactive Forms can call writeValue() before ngOnInit creates the\n // controller (dynamic form construction, or a FormControl that already\n // had a value at directive-creation time). Buffer the value; ngOnInit\n // flushes it as soon as the controller exists.\n this.pendingWriteValue = next;\n return;\n }\n this.controller.setValue(next);\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChangeFn = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouchedFn = fn;\n }\n\n setDisabledState(_disabled: boolean): void {\n // The contentEditable host doesn't have a native disabled attribute. For\n // v0.1 we accept the call so Angular's forms layer doesn't throw, but\n // the editor stays interactive. A future enhancement can toggle\n // contentEditable + ARIA disabled here.\n }\n\n // === Submit flow ===\n\n /**\n * Called by the controller's onSubmit callback (which fires from the\n * keyboard controller on Enter). Reads the live editor text — same trick\n * the React component uses — so the emitted query reflects whatever's in\n * the DOM right now, not a possibly-stale state snapshot.\n */\n private handleSubmit(_result: AutocompleteResult): void {\n const editor = this.editorRef?.nativeElement;\n if (!editor) return;\n const text = extractPlainText(editor);\n const state = this.controller.getState();\n const params = this.completedParams ?? state.completedParams;\n this.submitted.emit(\n buildSubmitResult(text, params, state.skippedParams, {\n identifiedParams: state.identifiedParams,\n isReady: state.isReady,\n }),\n );\n this.controller.reset();\n }\n\n private handleSubmitFromUserAction(): void {\n const state = this.controller.getState();\n if (!this.canSubmit(state)) return;\n // Synthesize the result for the submit-button click path; same shape\n // the controller would deliver from a keyboard Enter, so handleSubmit\n // can take either entry point.\n this.handleSubmit({\n query: state.text.trim(),\n raw_query: \"\",\n completed_params: [],\n identified_params: [],\n is_ready: state.isReady,\n });\n }\n\n private measurePillWrap(): void {\n const container = this.pillContainerRef?.nativeElement;\n const editor = this.editorRef?.nativeElement;\n if (!container || !editor) return;\n const inner = container.firstElementChild as HTMLElement | null;\n if (!inner) return;\n // Wrap detection: the pill row's top vs the editor's bottom. When the\n // pills sit on (or above) the editor's last line they're NOT wrapped —\n // keep the 8px margin so they don't butt against typed text or the\n // placeholder. This handles the empty-editor + placeholder case\n // naturally: the placeholder still occupies the editor's line box.\n const cRect = inner.getBoundingClientRect();\n const eRect = editor.getBoundingClientRect();\n const wrapped = cRect.top >= eRect.bottom - 2;\n this.zone.run(() => {\n if (wrapped) container.setAttribute(\"data-aia-pill-wrapped\", \"\");\n else container.removeAttribute(\"data-aia-pill-wrapped\");\n });\n }\n}\n\nfunction noop(): void {\n // Default no-op for CVA callbacks.\n}\n\n/**\n * Resolve a concrete light/dark value from the configured mode. Used to seed\n * the `data-mode` attribute synchronously (including during SSR, where\n * ModeController never runs). On the server `window` is undefined → defaults\n * to \"dark\" (matches the vanilla/React behavior).\n */\nfunction resolveInitialMode(mode: AppearanceMode): \"light\" | \"dark\" {\n if (mode !== \"auto\") return mode;\n if (typeof window === \"undefined\") return \"dark\";\n return window.matchMedia(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\";\n}\n","<div\n #container\n class=\"magicx-aia magicx-aia-container\"\n [attr.data-pill-placement]=\"pillPlacement\"\n [attr.data-options-position]=\"optionsPosition\"\n [attr.data-animations]=\"animations ? 'on' : 'off'\"\n [attr.data-mode]=\"resolvedMode\"\n>\n <ai-autocomplete-dropdown\n *ngIf=\"controller\"\n [controller]=\"controller\"\n [showPills]=\"showDropdownPills\"\n [showSkipButton]=\"showSkipButton\"\n [showOptionIcons]=\"showOptionIcons\"\n ></ai-autocomplete-dropdown>\n\n <div\n class=\"magicx-aia-input-wrapper\"\n (click)=\"onWrapperClick($event)\"\n (keyup)=\"$event.stopPropagation()\"\n >\n <div class=\"magicx-aia-editor-area\" data-aia-editor=\"\">\n <div\n #editor\n *ngIf=\"controller\"\n [aiaEditorHost]=\"controller\"\n [autoFocus]=\"autoFocus\"\n [showChipIcons]=\"showChipIcons\"\n class=\"magicx-aia-input\"\n data-aia-input=\"\"\n ></div>\n\n <ng-container *ngIf=\"controller && showInlinePills\">\n <span\n #pillContainer\n class=\"magicx-aia-pill-list-container\"\n data-aia-pill-list-container=\"\"\n *ngIf=\"\n (controller.isLoading$ | async) ||\n ((controller.suggestionPills$ | async)?.length ?? 0) > 0\n \"\n >\n <aia-pill-list\n [pills]=\"(controller.suggestionPills$ | async) ?? []\"\n [activePillIndex]=\"0\"\n [activeSelected]=\"(controller.isActivePillSelected$ | async) ?? false\"\n [loading]=\"(controller.isLoading$ | async) ?? false\"\n (selectPill)=\"onSelectPill($event)\"\n ></aia-pill-list>\n </span>\n </ng-container>\n </div>\n\n <ng-container [ngSwitch]=\"submitButtonState\">\n <aia-submit-button\n *ngSwitchCase=\"'default'\"\n [disabled]=\"\n !(\n controller &&\n canSubmit({\n segments: (controller.segments$ | async) ?? [],\n completedParams: (controller.completedParams$ | async) ?? []\n })\n )\n \"\n (submit)=\"onSubmitButtonClick($event)\"\n ></aia-submit-button>\n\n <span\n *ngSwitchCase=\"'custom'\"\n data-aia-submit=\"\"\n class=\"magicx-aia-submit-slot\"\n (click)=\"onSubmitSlotClick($event)\"\n >\n <ng-container *ngTemplateOutlet=\"customSubmitTemplate\"></ng-container>\n </span>\n </ng-container>\n </div>\n</div>\n","import {\n Directive,\n ElementRef,\n forwardRef,\n Input,\n inject,\n type OnDestroy,\n type OnInit,\n Renderer2,\n} from \"@angular/core\";\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { Subject, takeUntil } from \"rxjs\";\nimport type { AIAutocompleteController } from \"../controller/ai-autocomplete.controller\";\n\n/**\n * Tier 2 input binder. Attach to a `<textarea>` or `<input>` and pass an\n * {@link AIAutocompleteController}:\n *\n * ```html\n * <textarea [aiaInput]=\"ac\"></textarea>\n * ```\n *\n * The directive wires the input's events (input/keydown/focus/blur) to the\n * controller, mirrors controller state into ARIA attributes\n * (`role=\"combobox\"`, `aria-expanded`, `aria-activedescendant`,\n * `aria-autocomplete`, `aria-controls`), and implements\n * {@link ControlValueAccessor} so the host element participates in Reactive\n * Forms out of the box:\n *\n * ```html\n * <textarea [aiaInput]=\"ac\" [formControl]=\"myControl\"></textarea>\n * ```\n *\n * Per the React hook's behavior, the first typed character is auto-capitalized\n * — typing \"h\" becomes \"H\" before being forwarded to the controller. The\n * cursor position is preserved across that rewrite.\n *\n * @public\n */\n@Directive({\n selector: \"[aiaInput]\",\n standalone: true,\n host: {\n role: \"combobox\",\n \"aria-autocomplete\": \"list\",\n \"(input)\": \"onInput($event)\",\n \"(keydown)\": \"onKeyDown($event)\",\n \"(keyup)\": \"onCaretMove()\",\n \"(mouseup)\": \"onCaretMove()\",\n \"(focus)\": \"onFocus()\",\n \"(blur)\": \"onBlur()\",\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n useExisting: forwardRef(() => AIAutocompleteInputDirective),\n multi: true,\n },\n ],\n})\nexport class AIAutocompleteInputDirective implements OnInit, OnDestroy, ControlValueAccessor {\n /**\n * The {@link AIAutocompleteController} that owns the autocomplete state.\n * Required. The directive throws on init if this is missing.\n */\n @Input(\"aiaInput\") controller!: AIAutocompleteController;\n\n private readonly el = inject<ElementRef<HTMLInputElement | HTMLTextAreaElement>>(ElementRef);\n private readonly renderer = inject(Renderer2);\n private readonly destroy$ = new Subject<void>();\n\n private onChangeFn: (value: string) => void = noop;\n private onTouchedFn: () => void = noop;\n // Timestamp of the last `input` event. A `keyup`/`select` that fires within\n // this window is the tail of a keystroke, not a deliberate caret move, so we\n // skip the caret-move handler there (mirrors the editor host's selectionchange\n // guard). performance.now() is monotonic; 0 means \"no input yet\".\n private lastInputAt = 0;\n // Tracks the most-recently-promoted param so we only reposition the caret\n // once per option selection (mirrors the editor host's post-promote refocus).\n private lastSeenParamId = \"\";\n // Holds a value written by Reactive Forms before ngOnInit ran. Reactive\n // Forms can call writeValue() during dynamic form construction (e.g. when\n // a control is patched at the moment the directive is created), and our\n // controller binding may not be initialized yet. We stash the value here\n // and flush it into the controller in ngOnInit *before* subscribing to\n // text$, otherwise text$'s initial \"\" emission would clobber the form\n // value the textarea already shows. `undefined` means \"no pending write\".\n private pendingWriteValue: string | undefined;\n\n ngOnInit(): void {\n if (!this.controller) {\n throw new Error('[aiaInput] requires a controller — use `[aiaInput]=\"myController\"`.');\n }\n\n if (this.pendingWriteValue !== undefined) {\n this.controller.setValue(this.pendingWriteValue);\n this.pendingWriteValue = undefined;\n }\n\n const el = this.el.nativeElement;\n this.renderer.setAttribute(el, \"aria-controls\", this.controller.listboxId);\n\n // Sync editor text → DOM. Skips the write when values already match, so\n // user keystrokes don't fight with our writeback. Preserves the caret\n // position when we do write (and the element still has focus).\n this.controller.text$.pipe(takeUntil(this.destroy$)).subscribe((text) => {\n if (el.value === text) return;\n const wasFocused = typeof document !== \"undefined\" && document.activeElement === el;\n const start = el.selectionStart;\n const end = el.selectionEnd;\n this.renderer.setProperty(el, \"value\", text);\n if (wasFocused && start != null && end != null) {\n const clampedStart = Math.min(start, text.length);\n const clampedEnd = Math.min(end, text.length);\n try {\n el.setSelectionRange(clampedStart, clampedEnd);\n } catch {\n // `setSelectionRange` throws on some input types (e.g. \"number\");\n // safe to ignore — those inputs don't have a meaningful selection.\n }\n }\n });\n\n this.controller.isDropdownOpen$.pipe(takeUntil(this.destroy$)).subscribe((isOpen) => {\n this.renderer.setAttribute(el, \"aria-expanded\", String(isOpen));\n });\n\n this.controller.activeIndex$.pipe(takeUntil(this.destroy$)).subscribe((idx) => {\n if (idx >= 0) {\n this.renderer.setAttribute(\n el,\n \"aria-activedescendant\",\n `${this.controller.listboxId}-option-${idx}`,\n );\n } else {\n this.renderer.removeAttribute(el, \"aria-activedescendant\");\n }\n });\n\n // After an option selection promotes a param, the core appends its text and\n // stamps `caretOffset` at the end of the inserted text. The text$ subscriber\n // above writes the new value but *restores the pre-write caret* (correct for\n // typing echoes, wrong here), so we move the caret to the promoted position.\n // Keyed on newParamId so it fires once per selection, not on every tick.\n // Registered after text$ so the new value is in the DOM before we seek.\n this.controller.newParamId$.pipe(takeUntil(this.destroy$)).subscribe((id) => {\n const current = id ?? \"\";\n if (current && current !== this.lastSeenParamId) {\n this.lastSeenParamId = current;\n const offset = this.controller.getState().caretOffset ?? el.value.length;\n const clamped = Math.min(Math.max(offset, 0), el.value.length);\n // Only grab focus if we don't already have it — don't yank focus back\n // from wherever the user moved it after selecting (e.g. a host-app\n // button). setSelectionRange still positions the caret regardless.\n if (typeof document !== \"undefined\" && document.activeElement !== el) {\n el.focus();\n }\n try {\n el.setSelectionRange(clamped, clamped);\n } catch {\n // Some input types (e.g. \"number\") don't support setSelectionRange.\n }\n } else if (!current) {\n this.lastSeenParamId = \"\";\n }\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n // === Event handlers (wired via host metadata above) ===\n\n /**\n * Auto-capitalizes the first character on the user's first keystroke so the\n * server receives \"Create\" instead of \"create\". Matches React's\n * `handleChange` in `useAIAutocomplete`. Skipped during IME composition so\n * we don't disrupt multi-keystroke input methods (Pinyin, Hangul, etc.).\n */\n onInput(event: Event): void {\n // Stamp the input time before anything else. The autocapitalize path below\n // calls setSelectionRange, which can synchronously fire a `select` event →\n // onCaretMove; stamping first ensures that event falls inside the guard\n // window and is treated as part of this keystroke, not a caret move.\n this.lastInputAt = performance.now();\n const target = event.target as HTMLInputElement | HTMLTextAreaElement;\n const raw = target.value;\n const isComposing = (event as InputEvent).isComposing === true;\n const shouldCapitalize = raw.length > 0 && !isComposing && raw[0] !== raw[0].toUpperCase();\n\n let next = raw;\n if (shouldCapitalize) {\n const start = target.selectionStart;\n const end = target.selectionEnd;\n next = raw[0].toUpperCase() + raw.slice(1);\n this.renderer.setProperty(target, \"value\", next);\n if (start != null && end != null) {\n try {\n target.setSelectionRange(start, end);\n } catch {\n // See note in ngOnInit's text$ subscriber.\n }\n }\n }\n\n this.controller.handleTextChange(next);\n // Sync the real caret into the core. The dropdown's auto-trigger gate only\n // opens when the caret is at the end of the text; without this, the core's\n // `caretOffset` stays pinned at whatever a prior promote/select set it to\n // and goes stale as the user keeps typing, wedging the dropdown closed.\n // selectionStart is null on some input types (number/email/color); treat\n // that as \"caret at end\" rather than feeding null into the core.\n this.controller.handleCaretAfterInput(target.selectionStart ?? target.value.length);\n this.onChangeFn(next);\n }\n\n onKeyDown(event: KeyboardEvent): void {\n this.controller.handleKeyDown(event);\n }\n\n /**\n * Caret moved by something other than typing — arrow keys, Home/End, or a\n * mouse click/drag (keyup + mouseup). Forward the new offset so the core can\n * re-evaluate the caret-at-end dropdown gate (and exit re-edit if the caret\n * left the region). We deliberately do NOT listen for the `select` event:\n * programmatic `setSelectionRange` calls (the text$ writeback, the post-select\n * caret reposition) fire it in jsdom/some browsers, which would re-enter here\n * and clobber `caretOffset`. `keyup`/`mouseup` only fire for real user input.\n * Skipped right after an `input` event, where the caret is already handled by\n * `handleCaretAfterInput` above.\n */\n onCaretMove(): void {\n if (performance.now() - this.lastInputAt < 50) return;\n const el = this.el.nativeElement;\n // selectionStart is null on some input types — treat as caret at end.\n this.controller.handleCaretMove(el.selectionStart ?? el.value.length);\n }\n\n onFocus(): void {\n this.controller.setFocused(true);\n }\n\n onBlur(): void {\n this.controller.setFocused(false);\n this.onTouchedFn();\n }\n\n // === ControlValueAccessor ===\n\n writeValue(value: string | null): void {\n const next = value ?? \"\";\n this.renderer.setProperty(this.el.nativeElement, \"value\", next);\n // If Angular calls writeValue() before ngOnInit (possible during dynamic\n // form construction), queue the value and let ngOnInit flush it. We\n // can't push it into the controller now because either the controller\n // binding hasn't resolved yet, or text$'s initial subscription would\n // overwrite it moments later.\n if (this.controller) {\n this.controller.setValue(next);\n } else {\n this.pendingWriteValue = next;\n }\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChangeFn = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouchedFn = fn;\n }\n\n setDisabledState(disabled: boolean): void {\n this.renderer.setProperty(this.el.nativeElement, \"disabled\", disabled);\n }\n}\n\nfunction noop(): void {\n // Default no-op callback for CVA — overwritten by Angular's form bridge.\n}\n","import { NgModule } from \"@angular/core\";\nimport { AIAutocompleteComponent } from \"./ai-autocomplete/ai-autocomplete.component\";\nimport { AIAutocompleteDropdownComponent } from \"./ai-autocomplete-dropdown/ai-autocomplete-dropdown.component\";\nimport { AIAutocompleteInputDirective } from \"./input/ai-autocomplete-input.directive\";\n\n/**\n * Convenience NgModule that re-exports every public component and directive\n * in this package. Standalone-first consumers can import the individual\n * symbols directly; legacy NgModule-based codebases import this once and\n * get everything.\n *\n * @public\n */\n@NgModule({\n imports: [AIAutocompleteComponent, AIAutocompleteDropdownComponent, AIAutocompleteInputDirective],\n exports: [AIAutocompleteComponent, AIAutocompleteDropdownComponent, AIAutocompleteInputDirective],\n})\nexport class AIAutocompleteModule {}\n","/**\n * Public API surface for @magicx-eng/ai-autocomplete-angular.\n *\n * Populated incrementally as features land. Only symbols re-exported here\n * are considered part of the package's public contract.\n */\n\n// === Re-exported wire types ===\nexport type {\n AccessTokenConfig,\n AccessTokenResult,\n APIConfig,\n APIKeyConfig,\n AppearanceMode,\n AutocompleteResult,\n CompletedParam,\n CompletedParamState,\n DateMonthView,\n DateRange,\n FormatType,\n IdentifiedParam,\n IdentifiedParamState,\n OptionOverrides,\n Product,\n ProductsConfig,\n Segment,\n SkippedParamState,\n SubmitResultExtras,\n Suggestion,\n SuggestionOption,\n TaskKind,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n// === Submit-result builder (folds skipped params into completed_params) ===\nimport {\n buildSubmitResult as _buildSubmitResult,\n cellDay as _cellDay,\n cellIso as _cellIso,\n DATE_RANGE_META_END as _DATE_RANGE_META_END,\n DATE_RANGE_META_START as _DATE_RANGE_META_START,\n dateCellMarks as _dateCellMarks,\n formatDate as _formatDate,\n formatDateRange as _formatDateRange,\n isoDate as _isoDate,\n monthLabel as _monthLabel,\n optionLabel as _optionLabel,\n parseDate as _parseDate,\n parseLooseDate as _parseLooseDate,\n parseLooseDateRange as _parseLooseDateRange,\n sanitizeOptionIconSvg as _sanitizeOptionIconSvg,\n selectedRangeFor as _selectedRangeFor,\n visibleDateRange as _visibleDateRange,\n WEEKDAY_LABELS as _WEEKDAY_LABELS,\n withSkippedParams as _withSkippedParams,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n/**\n * Re-exported through local bindings rather than `export ... from`.\n *\n * ng-packagr's flat bundles drop a bare `export { x } from \"<external>\"`: the\n * name survives in the generated `.d.ts`, so consumer code typechecks, but the\n * symbol is absent from `fesm2020` — the entry point the `exports` map resolves\n * by default — and is `undefined` at runtime. Binding to a local const forces\n * it into the bundle.\n */\nexport const buildSubmitResult = _buildSubmitResult;\nexport const withSkippedParams = _withSkippedParams;\n// Date helpers, for turning a committed date back into a `Date` and for\n// rendering a custom calendar in Tier 3.\nexport const cellDay = _cellDay;\nexport const cellIso = _cellIso;\nexport const formatDate = _formatDate;\nexport const isoDate = _isoDate;\nexport const monthLabel = _monthLabel;\nexport const parseDate = _parseDate;\nexport const parseLooseDate = _parseLooseDate;\nexport const WEEKDAY_LABELS = _WEEKDAY_LABELS;\n// Range helpers, for a custom calendar that answers a span in two taps.\n// The two metadata keys are what a committed range records its ends under, so\n// a consumer reading them back never hardcodes the strings.\nexport const DATE_RANGE_META_END = _DATE_RANGE_META_END;\nexport const DATE_RANGE_META_START = _DATE_RANGE_META_START;\nexport const dateCellMarks = _dateCellMarks;\nexport const formatDateRange = _formatDateRange;\nexport const parseLooseDateRange = _parseLooseDateRange;\nexport const selectedRangeFor = _selectedRangeFor;\nexport const visibleDateRange = _visibleDateRange;\n// Option icons, for a custom dropdown that draws `icon_svg` itself.\nexport const optionLabel = _optionLabel;\nexport const sanitizeOptionIconSvg = _sanitizeOptionIconSvg;\n// === Tier 1: Full component ===\nexport { AIAutocompleteComponent } from \"./lib/ai-autocomplete\";\n// === Convenience NgModule ===\nexport { AIAutocompleteModule } from \"./lib/ai-autocomplete.module\";\n// === Tier 2: Dropdown component ===\nexport { AIAutocompleteDropdownComponent } from \"./lib/ai-autocomplete-dropdown\";\n// === Tier 2: Controller (headless logic class) ===\nexport { AIAutocompleteController } from \"./lib/controller\";\n// === Tier 2: Input binder + ControlValueAccessor ===\nexport { AIAutocompleteInputDirective } from \"./lib/input\";\n// === Angular-specific public types ===\nexport type {\n AIAutocompleteControllerOptions,\n AIAutocompleteControllerState,\n AIAutocompleteControllerUpdate,\n AIAutocompleteDropdownState,\n} from \"./lib/shared/types\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["WEEKDAY_LABELS","cellIso","monthLabel","cellDay","isoDate","dateCellMarks","visibleDateRange","optionLabel","sanitizeOptionIconSvg","map","CoreAIAutocomplete","noop","buildSubmitResult","_buildSubmitResult","_withSkippedParams","_cellDay","_cellIso","_formatDate","_isoDate","_monthLabel","_parseDate","_parseLooseDate","_WEEKDAY_LABELS","_DATE_RANGE_META_END","_DATE_RANGE_META_START","_dateCellMarks","_formatDateRange","_parseLooseDateRange","_selectedRangeFor","_visibleDateRange","_optionLabel","_sanitizeOptionIconSvg"],"mappings":";;;;;;;;;;AAuBA;;;;;;;;;;;;;;AAcG;MAUU,iBAAiB,CAAA;AAT9B,IAAA,WAAA,GAAA;;AAWW,QAAA,IAAO,CAAA,OAAA,GAAuB,EAAE,CAAC;AACjC,QAAA,IAAW,CAAA,WAAA,GAAG,CAAC,CAAC,CAAC;AACjB,QAAA,IAAS,CAAA,SAAA,GAAG,EAAE,CAAC;AACf,QAAA,IAAI,CAAA,IAAA,GAAyB,IAAI,CAAC;;AAElC,QAAA,IAAA,CAAA,SAAS,GAAkB,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;AAE9E,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,YAAY,EAAoB,CAAC;AAC9C,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,YAAY,EAAU,CAAC;AACvC,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,YAAY,EAAQ,CAAC;AACzC,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,YAAY,EAAQ,CAAC;AAE/C,QAAA,IAAQ,CAAA,QAAA,GAAGA,gBAAc,CAAC;;AAGnC,QAAA,IAAY,CAAA,YAAA,GAAG,CAAC,CAAC,CAAC;;QAyElB,IAAA,CAAA,WAAW,GAAG,CAAC,KAAa,EA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