@magicx-eng/ai-autocomplete-angular 0.63.1 → 0.64.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.
@@ -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/location-field/location-field.component.ts","../../src/lib/internal/location-field/location-field.component.html","../../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/internal/time-wheel/time-wheel.component.ts","../../src/lib/internal/time-wheel/time-wheel.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 isDimmedDay,\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\n /** The pointer left cell `index` — the dropdown clears a highlight still on it. */\n @Output() readonly unhighlight = 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, or before the earliest day the question takes: rendered dimmed. A day gone by stays pickable. A day before the earliest one does not. */\n isPast(option: SuggestionOption): boolean {\n // ISO strings order the same way the dates they name do.\n return isDimmedDay(cellIso(option), isoDate(new Date()), this.selection.floor);\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 /** A day another answer already holds: boxed for reference, still pickable. */\n isReference(option: SuggestionOption): boolean {\n return dateCellMarks(cellIso(option), {\n selectedIso: this.selection.selectedIso,\n range: this.paintedRange,\n references: this.selection.references,\n }).reference;\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 floor: this.selection.floor,\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 &lsaquo;\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 &rsaquo;\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--reference]=\"isReference(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 (mouseleave)=\"unhighlight.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 type AfterViewChecked,\n ChangeDetectionStrategy,\n Component,\n type ElementRef,\n EventEmitter,\n Input,\n type OnDestroy,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport type { LocationPlace, LocationView } from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n// One stable id per mounted field, for the rows' aria-activedescendant.\nlet fieldSeq = 0;\n\n/**\n * The focused element as seen from `node`'s root. Inside a shadow root\n * `document.activeElement` is the host, so focus checks must ask the\n * element's own root (vanilla's `activeElementFor`).\n */\nfunction activeElementFor(node: Node): Element | null {\n const root = node.getRootNode() as Document | ShadowRoot;\n return root.activeElement ?? null;\n}\n\n/** The selection that owns `node`: its shadow root's where the engine has one, else the document's. */\nfunction selectionFor(node: Node): Selection | null {\n const root = node.getRootNode() as (Document | ShadowRoot) & {\n getSelection?: () => Selection | null;\n };\n return root.getSelection?.() ?? document.getSelection();\n}\n\n/** The caret inside a contentEditable `el`, to hand back later; null for anything else. */\nfunction captureCaret(el: HTMLElement): Range | null {\n if (!el.isContentEditable) return null;\n const selection = selectionFor(el);\n if (!selection || selection.rangeCount === 0) return null;\n const range = selection.getRangeAt(0);\n return el.contains(range.startContainer) ? range.cloneRange() : null;\n}\n\n/**\n * Focus `target` with its caret where it was. `focus()` on a contentEditable\n * puts the caret at its start in Chrome, so the user's next keystroke would\n * land before everything they wrote. The saved caret is used while its nodes\n * are still in the input (a re-render replaces them); otherwise the end.\n */\nfunction focusWithCaret(target: HTMLElement, saved: Range | null): void {\n target.focus({ preventScroll: true });\n if (!target.isContentEditable) return;\n const selection = selectionFor(target);\n if (!selection) return;\n let range = saved;\n if (!range || !range.startContainer.isConnected || !target.contains(range.startContainer)) {\n range = document.createRange();\n range.selectNodeContents(target);\n range.collapse(false);\n }\n selection.removeAllRanges();\n selection.addRange(range);\n}\n\n/**\n * The dropdown's location body, rendered in place of the options grid for a\n * location parameter that came with no options. Angular analogue of vanilla's\n * `renderLocationField` and React's `<LocationField>`: a search field over\n * the server's location search, and the places it returned.\n *\n * The search itself — debounce, cancellation, results, highlight — lives in\n * the core. This component only moves focus: into the field when a saved\n * location is re-edited (a click into it focuses it as any input), and back\n * to the input it came from before an answer, on Escape or backspacing out of\n * an empty field, or when the field goes away.\n *\n * @internal\n */\n@Component({\n selector: \"aia-location-field\",\n standalone: true,\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./location-field.component.html\",\n styleUrls: [\"./location-field.component.css\"],\n})\nexport class LocationFieldComponent implements AfterViewChecked, OnDestroy {\n /** The core's `locationView`: the field's text and the places found for it. */\n @Input() view: LocationView | null = null;\n /** Placeholder and accessible name of the field (\"Say a location\"). */\n @Input() searchLabel = \"\";\n /** Shown when a search found nothing (\"No places found\"). */\n @Input() noResultsLabel = \"\";\n /** Says Enter answers with the typed text (\"Press Enter to use what you typed\"). */\n @Input() useTypedLabel = \"\";\n /**\n * Whether the widget has focus. Opening the field leaves the caret in the\n * input; the field only takes focus on its own for a re-edit (`reediting`),\n * and never pulls focus onto a page the user wasn't typing in.\n */\n @Input() widgetFocused = false;\n /**\n * True while a saved location is being re-edited (its chip tapped): the\n * field takes focus with that answer selected, so typing replaces it.\n * Otherwise the field takes focus only when the user clicks into it.\n */\n @Input() reediting = false;\n /** False while the panel is closed: the field leaves the tab order. */\n @Input() visible = true;\n /**\n * False for the press window after an answer: the answered pill's field is\n * still on screen and must not take a second answer.\n */\n @Input() interactive = true;\n\n /** The field's text changed — the core's `setLocationQuery`. */\n @Output() readonly query = new EventEmitter<string>();\n /** ArrowDown / ArrowUp — the core's `moveLocationHighlight`. */\n @Output() readonly move = new EventEmitter<number>();\n /** Answer: the place at the index, else the highlighted place, else the typed text — the core's `commitLocation`. */\n @Output() readonly answer = new EventEmitter<number | undefined>();\n /** The field took or let go of focus — the core's `setLocationFieldFocused`. */\n @Output() readonly focusChange = new EventEmitter<boolean>();\n\n @ViewChild(\"input\", { static: true }) inputRef!: ElementRef<HTMLInputElement>;\n @ViewChild(\"root\", { static: true }) rootRef!: ElementRef<HTMLElement>;\n @ViewChild(\"field\", { static: true }) fieldRef!: ElementRef<HTMLElement>;\n\n readonly fieldId = `aia-location-${++fieldSeq}`;\n // Where focus goes back to: the input the field took it from.\n private returnTo: HTMLElement | null = null;\n // The caret `returnTo` had when the field took focus; restored on the way back.\n private returnRange: Range | null = null;\n // Set while the field hands focus back, so its own blur isn't read as leaving.\n private returning = false;\n // The user left the field for the input; don't pull focus back until the\n // widget loses focus altogether.\n private declined = false;\n // Whether the last check was a re-edit; a re-edit starting clears `declined`.\n private wasReediting = false;\n private focusQueued = false;\n // Whether the core was last told the field holds focus. A field that goes\n // away while this is set must release the claim, or the widget counts as\n // focused with nothing focused.\n private claimed = false;\n\n get trimmedQuery(): string {\n return this.view?.query.trim() ?? \"\";\n }\n\n get activeDescendant(): string | null {\n const view = this.view;\n if (!view || view.highlighted < 0 || view.highlighted >= view.places.length) return null;\n return this.rowId(view.highlighted);\n }\n\n rowId(index: number): string {\n return `${this.fieldId}-row-${index}`;\n }\n\n trackPlace(_index: number, place: LocationPlace): string {\n return place.id;\n }\n\n ngAfterViewChecked(): void {\n // A re-edit starting clears an earlier decline: with two location questions\n // in a row the field never goes away, so a decline left over from the\n // other question would stop the tapped answer from opening. Read only\n // while the widget has focus: the checks of a click back into the input\n // can briefly drop it, and that must not count as a new re-edit.\n if (this.widgetFocused) {\n if (this.reediting && !this.wasReediting) this.declined = false;\n this.wasReediting = this.reediting;\n }\n const input = this.inputRef.nativeElement;\n const view = this.view;\n // Never fight the user's caret: only an outside change (a re-edit opening\n // the field on its answer) writes the text.\n if (view && input.value !== view.query && !this.hasFocus()) {\n input.value = view.query;\n }\n // The panel closed with focus still in the field — the core let go of the\n // location pill (a skip, say) while the field held focus, and the closing\n // panel keeps drawing it to fade out. Focus must not stay in a field\n // nobody can see: hand it back to the input it came from.\n if (!this.visible && this.hasFocus()) {\n this.declined = true;\n this.handBack();\n return;\n }\n if (!this.widgetFocused) {\n // Only once focus has really left the widget. Focus moving straight\n // from the field to the input (a click on it, Tab) blurs the field\n // before the input gains focus, and a check in between sees the widget\n // unfocused; resetting there made the input's focus read as \"came back\n // to the widget\", and the field took focus straight back. A task, not\n // a microtask: the browser runs microtasks between the blur and the\n // focus of a single click, so only a task sees where focus landed.\n setTimeout(() => {\n if (this.widgetFocused) return;\n const target = this.returnTo;\n if (target && activeElementFor(target) === target) return;\n this.declined = false;\n }, 0);\n return;\n }\n // Only a re-edit moves the caret into the field; a fresh location question\n // leaves it in the input. Not during the press window either: the\n // answered field is on its way out.\n if (\n !this.reediting ||\n this.declined ||\n !this.interactive ||\n this.focusQueued ||\n this.hasFocus()\n ) {\n return;\n }\n // After this check, so the focus events don't land mid change detection.\n this.focusQueued = true;\n queueMicrotask(() => {\n this.focusQueued = false;\n if (\n !input.isConnected ||\n !this.reediting ||\n this.declined ||\n !this.widgetFocused ||\n !this.interactive\n )\n return;\n if (this.hasFocus()) return;\n this.rememberReturn();\n // Claim focus before the input's blur, which would otherwise close the panel.\n this.reportFocus(true);\n input.focus({ preventScroll: true });\n // focus() can be refused (a field still hidden by the panel's\n // transition, say). No blur follows a focus that never arrived, so\n // release the claim here or the widget counts as focused forever.\n // Stop trying until the widget next gains focus: releasing the claim\n // re-runs change detection, and a retry on every check would loop forever.\n if (!this.hasFocus()) {\n this.declined = true;\n this.reportFocus(false);\n return;\n }\n // A re-edit opens the field on its answer: selected, so typing replaces it.\n if (input.value) input.select();\n });\n }\n\n /**\n * The field can go away while it holds focus — the dropdown withholds it\n * while a request is in flight (a skip that fetches, say). Angular removes\n * the node before this hook runs, so focus may already have fallen to the\n * body: hand it back to the input it came from, and release the claim.\n */\n ngOnDestroy(): void {\n if (!this.claimed) return;\n this.claimed = false;\n this.restoreAfterRemoval();\n this.focusChange.emit(false);\n }\n\n /**\n * A press anywhere on the field (the input, its search icon, its padding —\n * the label focuses the input for all of them) must reach it: the dropdown\n * root cancels every mousedown inside it, so this one stops here — and\n * claims focus before the editor's blur, which would otherwise close the\n * panel.\n */\n onPress(event: MouseEvent): void {\n if (!(event.target instanceof Node) || !this.fieldRef.nativeElement.contains(event.target)) {\n return;\n }\n event.stopPropagation();\n this.rememberReturn();\n this.reportFocus(true);\n }\n\n onInput(): void {\n this.query.emit(this.inputRef.nativeElement.value);\n }\n\n onFocus(event?: FocusEvent): void {\n this.rememberKeyboardReturn(event?.relatedTarget ?? null);\n this.reportFocus(true);\n }\n\n onBlur(): void {\n if (this.returning) return;\n this.declined = true;\n this.reportFocus(false);\n // A blur fired by the field's own removal (some engines fire one) leaves\n // focus on the body; once the removal is done, hand it back.\n queueMicrotask(() => this.restoreAfterRemoval());\n }\n\n onKeydown(event: KeyboardEvent): void {\n if (event.isComposing) return;\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowUp\":\n event.preventDefault();\n this.move.emit(event.key === \"ArrowDown\" ? 1 : -1);\n return;\n case \"Enter\":\n event.preventDefault();\n if (!this.interactive) return;\n this.handBack(true);\n this.answer.emit(undefined);\n return;\n // Tab is left to the browser. The dropdown sits before the input in\n // the DOM, so the field is the input's previous tab stop: Tab goes\n // forward to the input, Shift+Tab to whatever precedes the widget.\n case \"Escape\":\n // Back to the input, the pill left as it was.\n event.preventDefault();\n event.stopPropagation();\n this.declined = true;\n this.handBack();\n return;\n case \"Backspace\":\n // Backspacing past the start of an empty field goes back to the input.\n if (this.inputRef.nativeElement.value !== \"\") return;\n event.preventDefault();\n this.declined = true;\n this.handBack();\n return;\n }\n }\n\n /**\n * Taps on result rows are handled here, on the results container, never by\n * listeners on the rows — rows appear when a search lands, and content that\n * appears mid-tap carrying its own listeners cancels the tap on iOS.\n */\n onResultsClick(event: MouseEvent): void {\n if (!this.interactive || !(event.target instanceof Element)) return;\n const row = event.target.closest<HTMLElement>(\"[data-aia-location-row]\");\n if (!row) return;\n this.handBack(true);\n this.answer.emit(Number(row.getAttribute(\"data-aia-index\")));\n }\n\n private hasFocus(): boolean {\n const input = this.inputRef.nativeElement;\n return activeElementFor(input) === input;\n }\n\n private reportFocus(focused: boolean): void {\n this.claimed = focused;\n this.focusChange.emit(focused);\n }\n\n /** After the field left the document with focus in it: focus back on the input it came from. */\n private restoreAfterRemoval(): void {\n const input = this.inputRef.nativeElement;\n const target = this.returnTo;\n if (input.isConnected || !target?.isConnected) return;\n const active = activeElementFor(target);\n if (active && active !== document.body && active !== input) return;\n focusWithCaret(target, this.returnRange);\n }\n\n private rememberReturn(): void {\n const active = activeElementFor(this.rootRef.nativeElement);\n const input = this.inputRef.nativeElement;\n if (\n active instanceof HTMLElement &&\n active !== input &&\n active !== document.body &&\n !this.rootRef.nativeElement.contains(active)\n ) {\n this.returnTo = active;\n this.returnRange = captureCaret(active);\n }\n }\n\n /**\n * Focus arriving without a press (Shift+Tab) records where it came from, so\n * Escape and Backspace can hand it back; a press already recorded it.\n */\n private rememberKeyboardReturn(from: EventTarget | null): void {\n if (!(from instanceof HTMLElement) || from === this.returnTo) return;\n if (from === document.body || this.rootRef.nativeElement.contains(from)) return;\n this.returnTo = from;\n this.returnRange = captureCaret(from);\n }\n\n /** Hand focus back to the input before an answer, so the field going away never strands it. */\n private handBack(answered = false): void {\n // An answered field stays on screen through the press window; it must not\n // take focus back in that time, or focus is stranded when it goes.\n if (answered) this.declined = true;\n const target = this.returnTo;\n if (target?.isConnected && this.hasFocus()) {\n this.returning = true;\n focusWithCaret(target, this.returnRange);\n this.returning = false;\n }\n this.reportFocus(false);\n }\n}\n","<div #root class=\"magicx-aia-location\" data-aia-location (mousedown)=\"onPress($event)\">\n <label #field class=\"magicx-aia-location-field\">\n <svg class=\"magicx-aia-location-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\"></circle>\n <path d=\"m20 20-3.5-3.5\"></path>\n </svg>\n <input\n #input\n type=\"text\"\n class=\"magicx-aia-location-input\"\n data-aia-location-input\n autocomplete=\"off\"\n autocapitalize=\"words\"\n enterkeyhint=\"done\"\n spellcheck=\"false\"\n [attr.placeholder]=\"searchLabel\"\n [attr.aria-label]=\"searchLabel\"\n [attr.aria-activedescendant]=\"activeDescendant\"\n [tabIndex]=\"visible ? 0 : -1\"\n (input)=\"onInput()\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\"\n />\n </label>\n <div\n class=\"magicx-aia-location-results\"\n data-aia-location-results\n aria-live=\"polite\"\n (click)=\"onResultsClick($event)\"\n >\n <ng-container *ngIf=\"view && view.places.length > 0; else noPlaces\">\n <div\n *ngFor=\"let place of view.places; let i = index; trackBy: trackPlace\"\n class=\"magicx-aia-location-row\"\n [class.magicx-aia-location-row--highlighted]=\"i === view.highlighted\"\n data-aia-location-row\n [attr.data-aia-index]=\"i\"\n role=\"option\"\n [attr.aria-selected]=\"i === view.highlighted\"\n [id]=\"rowId(i)\"\n >\n <span class=\"magicx-aia-location-pin\">\n <svg class=\"magicx-aia-location-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z\"></path>\n <circle cx=\"12\" cy=\"9.5\" r=\"2.5\"></circle>\n </svg>\n </span>\n <span class=\"magicx-aia-location-text\">\n <span class=\"magicx-aia-location-name\">{{ place.name }}</span>\n <span *ngIf=\"place.secondary\" class=\"magicx-aia-location-secondary\">{{ place.secondary }}</span>\n </span>\n </div>\n </ng-container>\n <ng-template #noPlaces>\n <div *ngIf=\"view?.status === 'loading'\" class=\"magicx-aia-location-loading\" data-aia-location-loading>\n <span class=\"magicx-aia-location-loading-bar\"></span>\n <span class=\"magicx-aia-location-loading-bar\"></span>\n <span class=\"magicx-aia-location-loading-bar\"></span>\n </div>\n <div\n *ngIf=\"view?.status !== 'loading' && trimmedQuery\"\n class=\"magicx-aia-location-note\"\n data-aia-location-note\n >\n <span *ngIf=\"view?.status === 'done'\" class=\"magicx-aia-location-empty\">{{ noResultsLabel }}</span>\n <span>{{ useTypedLabel }}</span>\n </div>\n </ng-template>\n </div>\n</div>\n","import { CommonModule } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n inject,\n Output,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport { DomSanitizer, type SafeHtml } from \"@angular/platform-browser\";\nimport {\n isSmartSuggestion,\n isTraditionalAutocompleteSuggestion,\n SMART_SUGGESTION_SPARKLE_SVG,\n type Suggestion,\n} 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 /** The sparkle after the Smart Suggestion header; a fixed SDK constant, so it is trusted as is. */\n readonly sparkleSvg: SafeHtml = inject(DomSanitizer).bypassSecurityTrustHtml(\n SMART_SUGGESTION_SPARKLE_SVG,\n );\n\n /** The traditional autocomplete suggestion heads completions instead of asking a question. */\n readonly isSmartSuggestion = isSmartSuggestion;\n /** The inert header over completions, which takes no pointer; a marked question stays tappable. */\n readonly isCompletionHeader = isTraditionalAutocompleteSuggestion;\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.parameter;\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.--aia-pill-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-pill-active]=\"i === activePillIndex ? '' : null\"\n [attr.data-aia-loading]=\"loading ? '' : null\"\n [attr.data-aia-smart-suggestion]=\"isSmartSuggestion(pill) ? (isCompletionHeader(pill) ? 'header' : '') : null\"\n tabindex=\"-1\"\n class=\"aia-pill\"\n [class.aia-pill-rounded]=\"rounded\"\n [class.aia-pill-skeleton]=\"loading\"\n [style.--aia-pill-opacity]=\"pillOpacity(i)\"\n [disabled]=\"loading\"\n (mousedown)=\"onPillMouseDown($event)\"\n (click)=\"onPillClick(i)\"\n >\n <ng-container *ngIf=\"isSmartSuggestion(pill); else plainLabel\"\n ><span class=\"aia-smart-suggestion-text\">{{ pill.text }}</span\n ><span class=\"aia-smart-suggestion-sparkle\" [innerHTML]=\"sparkleSvg\"></span\n ></ng-container>\n <ng-template #plainLabel>{{ pill.text }}</ng-template>\n </button>\n </span>\n</ng-template>\n","import { CommonModule } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n type ElementRef,\n EventEmitter,\n Input,\n inject,\n type OnChanges,\n type OnDestroy,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport {\n attachProductRowWheel,\n type Product,\n type ProductImageFallback,\n type ProductsLayout,\n productImageSources,\n productInitial,\n productPhotoFill,\n type UIStrings,\n uiStringsFor,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\n\ntype CartState = \"adding\" | \"added\";\n\n/**\n * What makes a card's product \"the same\" for its cart button: every field\n * vanilla's `cardKey` rebuilds the card on. A price-only change keeps it.\n */\nfunction cartIdentity(product: Product): string {\n return [product.id, product.title, product.url, product.imageUrl, product.vendor]\n .map((field) => field ?? \"\")\n .join(\"\\0\");\n}\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 implements OnDestroy, OnChanges {\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 /** How the cards lay out — a scrolling row, or stacked as full-width rows. Default: \"row\". */\n @Input() layout: ProductsLayout = \"row\";\n @Input() imageFallback: ProductImageFallback = \"image\";\n /** Whether the cards draw the vendor line above the title. Default: true. */\n @Input() showVendor = true;\n /** The words of the widget language. Default: English. */\n @Input() strings: UIStrings = uiStringsFor();\n /** True while a request is in flight: the strip fades out with the options. */\n @Input() loading = false;\n /**\n * The `id` of the product whose selection is in progress: its card shows a\n * spinner over its picture. Selecting it again is ignored by the core.\n */\n @Input() busyProductId: string | null = null;\n /**\n * Set when the integration adds to cart: each card that is not sold out\n * draws a cart button, whose press calls this instead of emitting `select`.\n */\n @Input() addToCart: ((product: Product) => void | PromiseLike<unknown>) | null = null;\n readonly initial = productInitial;\n /**\n * Per product id, the `src`s that failed to load: a card moves on to the\n * next source (a Shopify thumbnail falls back to the original) and shows its\n * placeholder once none is left.\n */\n private readonly failedImages = new Map<string, string[]>();\n /** Per product id, the `src` that last finished loading; its tile drops the fill. */\n private readonly loadedImages = new Map<string, string>();\n\n ngOnChanges(): void {\n const sources = new Map(\n this.products.map((product) => [product.id, productImageSources(product.imageUrl)]),\n );\n for (const [id, failed] of this.failedImages) {\n const current = sources.get(id) ?? [];\n if (!failed.every((src) => current.includes(src))) this.failedImages.delete(id);\n }\n // A card whose product changed, left the strip or lost its button puts the\n // button back at rest — what rebuilding the card does in vanilla.\n const byId = new Map(this.products.map((product) => [product.id, product]));\n for (const [id, cart] of this.carts) {\n const product = byId.get(id);\n if (!product || !this.hasCart(product) || cartIdentity(product) !== cart.identity) {\n this.carts.delete(id);\n }\n }\n }\n\n imageSource(product: Product): string | null {\n const failed = this.failedImages.get(product.id) ?? [];\n return productImageSources(product.imageUrl).find((src) => !failed.includes(src)) ?? null;\n }\n\n /** Whether the card's photo has loaded, so the placeholder fill steps aside. */\n imageLoaded(product: Product): boolean {\n const src = this.imageSource(product);\n return src !== null && this.loadedImages.get(product.id) === src;\n }\n\n onImageLoad(product: Product, src: string, event?: Event): void {\n this.loadedImages.set(product.id, src);\n const img = event?.target as HTMLImageElement | null;\n const fill = img ? productPhotoFill(img.naturalWidth, img.naturalHeight) : null;\n if (fill) this.photoFills.set(product.id, fill);\n else this.photoFills.delete(product.id);\n }\n\n onImageError(product: Product): void {\n const src = this.imageSource(product);\n if (src) this.failedImages.set(product.id, [...(this.failedImages.get(product.id) ?? []), src]);\n // The next source, or the placeholder, fills the tile until it loads.\n this.photoFills.delete(product.id);\n }\n\n /** Per product id, how much of the tile the loaded photo fills (productPhotoFill). */\n private readonly photoFills = new Map<string, { x: number; y: number }>();\n\n /**\n * The card's photo-fill custom properties, which put the cart button inside\n * the photo's own corner. Null until the photo loads.\n */\n photoFillStyle(product: Product): Record<string, string> | null {\n const fill = this.photoFills.get(product.id);\n // Only the photo on screen counts: a changed or removed image drops it.\n if (!fill || !this.imageLoaded(product)) return null;\n return {\n \"--aia-product-photo-fill-x\": String(fill.x),\n \"--aia-product-photo-fill-y\": String(fill.y),\n };\n }\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 private detachWheel: (() => void) | null = null;\n private readonly cdr = inject(ChangeDetectorRef);\n /**\n * Per product id, the cart button's state while it isn't at rest, with the\n * product identity it belongs to and the press that set it (a settle from an\n * earlier press, or for a card since reset, is dropped).\n */\n private readonly carts = new Map<string, { state: CartState; identity: string; press: object }>();\n private destroyed = false;\n\n /**\n * A mouse wheel over the row scrolls it sideways. The row sits inside the\n * section's `*ngIf`, so the query fires with the element as products arrive\n * and with `undefined` as they go; the binding follows it either way.\n */\n @ViewChild(\"row\")\n set row(ref: ElementRef<HTMLElement> | undefined) {\n this.detachWheel?.();\n this.detachWheel = ref ? attachProductRowWheel(ref.nativeElement) : null;\n }\n\n ngOnDestroy(): void {\n this.destroyed = true;\n this.detachWheel?.();\n this.detachWheel = null;\n }\n\n /** A sold-out product can't be added, so its card has no button at all. */\n hasCart(product: Product): boolean {\n return this.addToCart !== null && product.available !== false;\n }\n\n cartState(product: Product): CartState | null {\n return this.carts.get(product.id)?.state ?? null;\n }\n\n onCartKeyDown(event: KeyboardEvent, product: Product): void {\n // Keys never reach the card, whose own Enter / Space would select it.\n if (event.key !== \"Enter\" && event.key !== \" \") return;\n this.onCartPress(event, product);\n }\n\n /**\n * Mirrors vanilla's `buildCartButton` press: adding → added, or rest on a\n * rejection. The check stays until the product changes; another press adds again.\n */\n onCartPress(event: Event, product: Product): void {\n event.preventDefault();\n event.stopPropagation();\n const handler = this.addToCart;\n if (!handler || this.cartState(product) === \"adding\") return;\n const id = product.id;\n const press = {};\n this.carts.set(id, { state: \"adding\", identity: cartIdentity(product), press });\n this.cdr.markForCheck();\n let pending: PromiseLike<unknown>;\n try {\n pending = Promise.resolve(handler(product));\n } catch (error) {\n pending = Promise.reject(error);\n }\n pending.then(\n () => this.settleCart(id, press, \"added\"),\n () => this.settleCart(id, press, null),\n );\n }\n\n private settleCart(id: string, press: object, state: CartState | null): void {\n const cart = this.carts.get(id);\n if (this.destroyed || cart?.press !== press) return;\n if (state) cart.state = state;\n else this.carts.delete(id);\n this.cdr.markForCheck();\n }\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 trackByProduct = (_: number, product: Product): string => product.id;\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 [attr.data-aia-loading]=\"loading ? '' : null\"\n [attr.data-aia-products-layout]=\"layout\"\n role=\"group\"\n [attr.aria-labelledby]=\"labelId\"\n>\n <!-- data-aia-products-label: the scroll arrow centres itself on this row. -->\n <div class=\"aia-products-label\" [id]=\"labelId\" data-aia-products-label=\"\">{{ strings.products }}</div>\n\n <!-- #row: the component binds wheel-to-sideways scrolling on it. -->\n <div #row 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. An attribute binding, so a\n product without a url gets no href at all rather than \"null\". -->\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 [attr.data-aia-product-sold-out]=\"product.available === false ? '' : null\"\n [attr.data-aia-product-has-cart]=\"hasCart(product) ? '' : null\"\n [attr.data-aia-product-state]=\"product.id === busyProductId ? 'busy' : null\"\n [attr.aria-busy]=\"product.id === busyProductId ? 'true' : null\"\n [style]=\"photoFillStyle(product)\"\n role=\"option\"\n [attr.aria-selected]=\"false\"\n [attr.href]=\"product.url ?? null\"\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 <span\n class=\"aia-product-media\"\n data-aia-product-media=\"\"\n aria-hidden=\"true\"\n [attr.data-aia-product-placeholder]=\"!imageSource(product) && imageFallback === 'image' ? '' : null\"\n [attr.data-aia-product-initial]=\"!imageSource(product) && imageFallback === 'initial' ? '' : null\"\n [attr.data-aia-image-loaded]=\"imageLoaded(product) ? '' : 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=\"imageSource(product) as src\"\n class=\"aia-product-image\"\n [src]=\"src\"\n (load)=\"onImageLoad(product, src, $event)\"\n (error)=\"onImageError(product)\"\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n <ng-container *ngIf=\"!imageSource(product) && imageFallback === 'initial'\">{{ initial(product.title) }}</ng-container>\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=\"showVendor && 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 }}<s *ngIf=\"product.compareAtPrice\" class=\"aia-product-compare-at\">{{ product.compareAtPrice }}</s></span>\n <!-- In the text column rather than the aria-hidden media tile, so the\n card's accessible name says it; the stylesheet lifts it over the\n image. -->\n <span *ngIf=\"product.available === false\" class=\"aia-product-badge\">{{ strings.soldOut }}</span>\n </span>\n\n <!-- The add-to-cart button: a child of the card rather than of the\n aria-hidden media tile; the stylesheet lifts it over the tile's\n bottom right corner. A role=\"button\" span, not a <button>:\n interactive content inside an <a> is invalid HTML. Its press never\n reaches the card, so it never selects. Sold-out cards have none. -->\n <span\n *ngIf=\"hasCart(product)\"\n class=\"aia-product-cart\"\n data-aia-product-cart=\"\"\n role=\"button\"\n [attr.aria-label]=\"strings.addToCart + ': ' + product.title\"\n [attr.tabindex]=\"focusable ? 0 : -1\"\n [attr.data-aia-cart-state]=\"cartState(product)\"\n [attr.aria-busy]=\"cartState(product) === 'adding' ? 'true' : null\"\n (click)=\"onCartPress($event, product)\"\n (keydown)=\"onCartKeyDown($event, product)\"\n (focus)=\"onCardFocus()\"\n (blur)=\"onCardBlur($event)\"\n >\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n <path class=\"aia-product-cart-glyph\" d=\"M2 3h2.2l2.4 11.2a2 2 0 0 0 2 1.6h8.9a2 2 0 0 0 1.9-1.5L21 8H6\" />\n <path class=\"aia-product-cart-glyph\" d=\"M13.5 6.5v-4M11.5 4.5h4\" />\n <path class=\"aia-product-cart-check\" d=\"M5 12.5l4.5 4.5L19 7.5\" />\n <path class=\"aia-product-cart-spinner\" d=\"M12 4a8 8 0 1 0 8 8\" />\n <circle class=\"aia-product-cart-glyph\" cx=\"9\" cy=\"20\" r=\"1.3\" />\n <circle class=\"aia-product-cart-glyph\" cx=\"17.5\" cy=\"20\" r=\"1.3\" />\n </svg>\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 host: { class: \"aia-grid-host\" },\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 formatOptionCount,\n highlightParts,\n isMultiSelectToggleTap,\n optionImageSources,\n optionLabel,\n type SuggestionOption,\n sanitizeOptionIconSvg,\n type TextPart,\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 * - Server-provided picture (`image_url`) as a square thumbnail in place of\n * the icon, and item count (`item_count`) at the row's trailing edge\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() checked?: boolean;\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 /** Whether to draw the option's `image_url` as a thumbnail before its text, in place of the icon. Default: true. */\n @Input() showImage = true;\n /** Whether to show the option's `item_count` at the row's trailing edge. Default: true. */\n @Input() showCount = 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 /**\n * A multi_select row was clicked on its text rather than its checkbox:\n * answer with the option right away instead of only ticking it.\n */\n @Output() readonly commitSelect = new EventEmitter<SuggestionOption>();\n /** The pointer entered this row. Carries the mouse event, as `unhighlight` does. */\n @Output() readonly highlight = new EventEmitter<MouseEvent>();\n /**\n * The pointer left this row. The owner clears the highlight if it is still\n * on this row: a hover highlight ends with the hover, so Enter afterwards\n * submits instead of picking a row the pointer is no longer on.\n */\n @Output() readonly unhighlight = new EventEmitter<MouseEvent>();\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 `src`s that failed to load: the row moves on to the next source (a\n * Shopify thumbnail falls back to the original), and the tile keeps its\n * placeholder fill once none is left.\n */\n private failedSrcs: readonly string[] = [];\n /** The `src` that last finished loading; the tile drops its fill for it. */\n private loadedSrc: string | null = null;\n\n /** The label split so the typed fragment's match can be drawn in bold. */\n get parts(): TextPart[] {\n return highlightParts(this.label, this.option.matchedText);\n }\n\n /** `parts` is rebuilt on every check, so its nodes are kept by position. */\n trackByIndex(index: number): number {\n return index;\n }\n\n /** The option's text. `icon` is the icon's name and is never shown as text. */\n get label(): string {\n return optionLabel(this.option);\n }\n\n /**\n * The picture's `src`, or `null` when the row draws none: images off, no\n * `image_url`, or one that is not an http(s) URL. A picture stands in for\n * the icon — a row never leads with two visuals.\n */\n get imageSrc(): string | null {\n const sources = this.imageSources;\n return (\n sources.find((src) => !this.failedSrcs.includes(src)) ?? sources[sources.length - 1] ?? null\n );\n }\n\n /** Whether every source of the picture failed to load (the tile's fill stays). */\n get imageFailed(): boolean {\n const sources = this.imageSources;\n return sources.length > 0 && sources.every((src) => this.failedSrcs.includes(src));\n }\n\n /** Whether the shown picture has loaded, so the placeholder fill steps aside. */\n get imageLoaded(): boolean {\n return !this.imageFailed && this.imageSrc !== null && this.loadedSrc === this.imageSrc;\n }\n\n onImageLoad(src: string): void {\n this.loadedSrc = src;\n this.cdr.markForCheck();\n }\n\n onImageError(): void {\n const src = this.imageSrc;\n if (src !== null && !this.failedSrcs.includes(src)) this.failedSrcs = [...this.failedSrcs, src];\n this.cdr.markForCheck();\n }\n\n /**\n * The pictures the All row's tile shows together (appearance.css lays out\n * `data-aia-collage`), or none for any other row, which shows one.\n */\n get collage(): string[] {\n if (!this.showImage) return [];\n const sources = (this.option.imageCollage ?? [])\n .map((url) => optionImageSources(url)[0])\n .filter((src): src is string => src !== undefined);\n return sources.length > 1 ? sources : [];\n }\n\n collageLoaded = false;\n\n onCollageLoad(): void {\n this.collageLoaded = true;\n this.cdr.markForCheck();\n }\n\n onCollageError(event: Event): void {\n (event.target as HTMLImageElement).hidden = true;\n }\n\n private get imageSources(): string[] {\n return this.showImage ? optionImageSources(this.option.image_url) : [];\n }\n\n /**\n * The count as printed (\"1,284\"), or `null` when the row shows none. The\n * unit word after it is the stylesheet's (`--aia-option-count-unit`).\n */\n get countLabel(): string | null {\n return this.showCount ? formatOptionCount(this.option.item_count) : null;\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.imageSrc ? 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 /** `event` is the click that picked the row; a key press passes none. */\n onSelect(event?: MouseEvent): void {\n if (this.loading || !this.option.is_tappable || (this.pressed && this.checked === undefined))\n return;\n this.pressed = true;\n this.cdr.markForCheck();\n const row = event?.currentTarget;\n const commit =\n this.checked !== undefined &&\n event !== undefined &&\n row instanceof HTMLElement &&\n !isMultiSelectToggleTap(row, row.querySelector(\".aia-checkbox\"), event);\n if (commit) this.commitSelect.emit(this.option);\n else 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(event: MouseEvent): void {\n if (this.loading || !this.option.is_tappable) return;\n this.highlight.emit(event);\n }\n\n onMouseLeave(event: MouseEvent): void {\n this.unhighlight.emit(event);\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.data-aia-image]=\"imageSrc ? '' : null\"\n [attr.data-aia-item-count]=\"countLabel !== null ? option.item_count : null\"\n [attr.aria-selected]=\"checked === undefined ? isHighlighted : checked\"\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-live-match]=\"option.liveMatch && !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($event)\"\n (keydown)=\"onKeyDown($event)\"\n (mouseenter)=\"onMouseEnter($event)\"\n (mouseleave)=\"onMouseLeave($event)\"\n>\n <span class=\"aia-suggestion-content\">\n <span *ngIf=\"checked !== undefined && option.is_tappable\" class=\"aia-checkbox\" aria-hidden=\"true\" [attr.data-checked]=\"checked\">{{ checked ? \"✓\" : \"\" }}</span>\n <!-- The tile keeps a placeholder fill until the picture loads, so a slow\n or failed load leaves a neutral square rather than a gap. The picture\n is decorative: the text is the option's accessible name. -->\n <span\n *ngIf=\"imageSrc && collage.length > 1\"\n class=\"aia-suggestion-image\"\n aria-hidden=\"true\"\n [attr.data-aia-collage]=\"collage.length\"\n [attr.data-aia-image-loaded]=\"collageLoaded ? '' : null\"\n >\n <img\n *ngFor=\"let src of collage\"\n [src]=\"src\"\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n referrerpolicy=\"no-referrer\"\n draggable=\"false\"\n (load)=\"onCollageLoad()\"\n (error)=\"onCollageError($event)\"\n />\n </span>\n <span\n *ngIf=\"collage.length <= 1 && imageSrc as src\"\n class=\"aia-suggestion-image\"\n aria-hidden=\"true\"\n [attr.data-aia-image-loaded]=\"imageLoaded ? '' : null\"\n >\n <img\n [src]=\"src\"\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n referrerpolicy=\"no-referrer\"\n draggable=\"false\"\n [hidden]=\"imageFailed\"\n (load)=\"onImageLoad(src)\"\n (error)=\"onImageError()\"\n />\n </span>\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\"\n ><ng-container *ngFor=\"let part of parts; trackBy: trackByIndex\"\n ><strong\n *ngIf=\"part.bold; else plain\"\n class=\"aia-suggestion-match\"\n [attr.data-aia-match-partial]=\"part.partial ? '' : null\"\n >{{ part.text }}</strong\n ><ng-template #plain>{{ part.text }}</ng-template></ng-container\n ><ng-container *ngIf=\"option.parameterLabel\"\n >{{ \" \" }}<span class=\"aia-suggestion-parameter\">{{ option.parameterLabel }}</span></ng-container\n ></span\n >\n <span *ngIf=\"option.tag\" class=\"aia-suggestion-tag\">{{ option.tag }}</span>\n <!-- Part of the row's accessible name, read after the option's text. -->\n <span *ngIf=\"countLabel !== null\" class=\"aia-suggestion-count\">{{ countLabel }}</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 NgZone,\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 optionsShowLeadingVisuals,\n planOptionsGrid,\n pointerMayHighlight,\n releasePanelHug,\n type SuggestionOption,\n sameOptionRows,\n syncHighlightScroll,\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() picked?: string[];\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 /** Whether rows draw their `image_url` as a thumbnail before the text. Default: true. */\n @Input() showImages = true;\n /** Whether rows show their `item_count` at the trailing edge. Default: true. */\n @Input() showCounts = true;\n\n /**\n * Icons and pictures are all-or-nothing across the list — no single row can\n * decide its own (see `optionsShowLeadingVisuals`).\n */\n get leadingVisuals(): boolean {\n return optionsShowLeadingVisuals(this.options, this.showIcons, this.showImages);\n }\n\n @Output() readonly select = new EventEmitter<SuggestionOption>();\n /** A multi_select row was clicked on its text: answer with it right away. */\n @Output() readonly commitSelect = new EventEmitter<SuggestionOption>();\n @Output() readonly highlight = new EventEmitter<number>();\n /** The pointer left option `index` — the dropdown clears a highlight still on it. */\n @Output() readonly unhighlight = new EventEmitter<number>();\n\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly zone = inject(NgZone);\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 * The rows the current plan was measured from. A skeleton mirroring them\n * keeps that plan — see `sameOptionRows`.\n */\n private measuredRows: SuggestionOption[] | null = null;\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 if (this.loading && sameOptionRows(this.measuredRows, this.options)) return;\n this.measuredRows = this.loading ? null : this.options;\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 /** The grid element, once the view has it. */\n private get gridElement(): HTMLDivElement | undefined {\n return this.gridComp?.gridRef?.nativeElement;\n }\n\n /**\n * The pointer entered row `index`. `pointerMayHighlight` marks the highlight\n * as the pointer's, so the list does not scroll for it, and refuses the\n * events a list scrolled by a key sends a resting cursor.\n */\n onRowHighlight(index: number, event: MouseEvent): void {\n if (pointerMayHighlight(this.gridElement, index, event)) this.highlight.emit(index);\n }\n\n /** The pointer left row `index`. */\n onRowUnhighlight(index: number, event: MouseEvent): void {\n if (pointerMayHighlight(this.gridElement, -1, event)) this.unhighlight.emit(index);\n }\n\n ngAfterViewChecked(): void {\n // A new plan lands in a microtask and the view is checked again: the\n // highlight is brought into view then, in the columns it will be shown in.\n if (this.measurePlan()) return;\n // A highlight the keyboard moved brings its row into view. After the\n // view update, so the grid's own scroll reset for a new group has run.\n // Outside the zone: the scroll runs on animation frames, and none of\n // them changes anything a binding reads. Skeleton rows show none.\n const grid = this.gridElement;\n if (!grid) return;\n const index = this.loading ? -1 : this.activeIndex;\n this.zone.runOutsideAngular(() => syncHighlightScroll(grid, index));\n }\n\n /**\n * Measure the rendered rows when the inputs changed, and schedule the plan\n * they give. True when a different plan is on its way.\n */\n private measurePlan(): boolean {\n if (!this.needsMeasure) return false;\n this.needsMeasure = false;\n const isMobile = isOptionsGridMobileViewport();\n const grid = this.gridElement;\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 // Measure at the panel's full width; the dropdown hugs it again after.\n const panel = grid?.closest<HTMLElement>(\"[data-aia-dropdown]\");\n if (shouldMeasure && panel) releasePanelHug(panel);\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 false;\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 return true;\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. So is the parameter: a smart suggestion offers one\n * text under several parameters (\"Shoes\" under Women type and Men type).\n */\n trackByOptionText = (_: number, opt: SuggestionOption): string =>\n `${this.groupKey}\\0${opt.parameter ?? \"\"}\\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 [checked]=\"picked ? picked.includes(option.text) : undefined\"\n [id]=\"listboxId + '-option-' + i\"\n [loading]=\"loading\"\n [showIcon]=\"showIcons && leadingVisuals\"\n [showImage]=\"showImages && leadingVisuals\"\n [showCount]=\"showCounts\"\n [scrollHint]=\"isScrollHint(i)\"\n [enterDelayMs]=\"enterDelayMs(i)\"\n (select)=\"select.emit($event)\"\n (commitSelect)=\"commitSelect.emit($event)\"\n (highlight)=\"onRowHighlight(i, $event)\"\n (unhighlight)=\"onRowUnhighlight(i, $event)\"\n ></aia-suggestion-item>\n</aia-grid>\n","import { CommonModule } from \"@angular/common\";\nimport {\n type AfterViewChecked,\n ChangeDetectionStrategy,\n Component,\n type ElementRef,\n EventEmitter,\n Input,\n type OnDestroy,\n Output,\n type QueryList,\n ViewChildren,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport {\n formatTime,\n TIME_WHEEL_COLUMNS,\n TIME_WHEEL_ROW_HEIGHT,\n type TimeView,\n type TimeWheelColumn,\n type TimeWheelRow,\n timeWheelIndex,\n timeWheelIndexFromScroll,\n timeWheelRows,\n withTimeWheelIndex,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n/** How long a column's scroll must be still before the row it rests on counts. */\nconst SCROLL_SETTLE_MS = 120;\n\n/**\n * Per-column scroll bookkeeping. `syncedTop` is the offset this component last\n * scrolled the column to itself, so the scroll event that echoes it is not\n * mistaken for the user turning the wheel; `settle` is the pending read of a\n * scroll the user is still making.\n */\ninterface ColumnScroll {\n syncedTop: number | null;\n settle: ReturnType<typeof setTimeout> | null;\n}\n\n/**\n * The dropdown's time body, rendered in place of the options grid when the\n * active parameter is a time. Angular analogue of vanilla's `renderTimeWheel`\n * and React's `<TimeWheel>`: three wheels — hour, minutes in fives, AM/PM —\n * whose top rows read as the time, and a Done button.\n *\n * The wheels hold no time of their own. `view.minutes` is the time; turning a\n * wheel emits the new time and the next render scrolls every wheel to it. That\n * is what lets the keyboard (ArrowUp/ArrowDown in the input, handled by the\n * core) and the pointer move the same time.\n *\n * @internal\n */\n@Component({\n selector: \"aia-time-wheel\",\n standalone: true,\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./time-wheel.component.html\",\n styleUrls: [\"./time-wheel.component.css\"],\n})\nexport class TimeWheelComponent implements AfterViewChecked, OnDestroy {\n /** The core's `timeView`: the time on the wheels' top rows. */\n @Input() view: TimeView | null = null;\n /** Accessible name for the wheel (\"Time\"). */\n @Input() label = \"\";\n /** Text of the button that answers with the time (\"Done\"). */\n @Input() doneLabel = \"\";\n /**\n * False for the press window after an answer: the answered pill's wheel is\n * still on screen and must not take a second answer.\n */\n @Input() interactive = true;\n\n /** The user turned a wheel; the value is the whole new time. Commits nothing. */\n @Output() readonly timeChange = new EventEmitter<number>();\n /** Done — answer the pill with the time on the wheels. */\n @Output() readonly commit = new EventEmitter<void>();\n\n @ViewChildren(\"wheelColumn\") wheelColumns?: QueryList<ElementRef<HTMLElement>>;\n\n readonly columns = TIME_WHEEL_COLUMNS;\n\n private readonly scroll = new Map<TimeWheelColumn, ColumnScroll>();\n\n get valueLabel(): string {\n return this.view ? formatTime(this.view.minutes) : \"\";\n }\n\n rowsOf(column: TimeWheelColumn): readonly TimeWheelRow[] {\n return timeWheelRows(column);\n }\n\n indexOf(column: TimeWheelColumn): number {\n return this.view ? timeWheelIndex(column, this.view.minutes) : -1;\n }\n\n /** Scroll each wheel so its chosen row is on top. Idempotent, so cheap to run on every check. */\n ngAfterViewChecked(): void {\n if (!this.view || !this.wheelColumns) return;\n for (const ref of this.wheelColumns) {\n const el = ref.nativeElement;\n const column = el.getAttribute(\"data-aia-time-column\") as TimeWheelColumn;\n const state = this.scrollStateOf(column);\n // Never yank a wheel the user is still turning: their scroll settles\n // into a time of its own.\n if (state.settle) continue;\n const top = timeWheelIndex(column, this.view.minutes) * TIME_WHEEL_ROW_HEIGHT;\n if (Math.abs(el.scrollTop - top) < 1) continue;\n state.syncedTop = top;\n el.scrollTop = top;\n }\n }\n\n ngOnDestroy(): void {\n for (const state of this.scroll.values()) {\n if (state.settle) clearTimeout(state.settle);\n }\n }\n\n onClick(event: MouseEvent): void {\n if (!this.interactive || !this.view) return;\n const target = event.target instanceof Element ? event.target : null;\n if (target?.closest(\"[data-aia-time-done]\")) {\n this.commit.emit();\n return;\n }\n const row = target?.closest<HTMLElement>(\"[data-aia-time-row]\");\n const column = row?.getAttribute(\"data-aia-time-column\") as TimeWheelColumn | null;\n if (!row || !column) return;\n const index = Number(row.getAttribute(\"data-aia-index\"));\n this.timeChange.emit(withTimeWheelIndex(column, this.view.minutes, index));\n }\n\n onScroll(column: TimeWheelColumn, event: Event): void {\n const el = event.target as HTMLElement;\n const state = this.scrollStateOf(column);\n if (state.syncedTop != null && Math.abs(el.scrollTop - state.syncedTop) < 1) {\n state.syncedTop = null;\n return;\n }\n state.syncedTop = null;\n if (state.settle) clearTimeout(state.settle);\n state.settle = setTimeout(() => this.settle(column, el), SCROLL_SETTLE_MS);\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 trackByColumn = (_: number, column: TimeWheelColumn): string => column;\n trackByRow = (_: number, row: TimeWheelRow): string => row.label;\n\n private settle(column: TimeWheelColumn, el: HTMLElement): void {\n this.scrollStateOf(column).settle = null;\n if (!this.interactive || !this.view) return;\n const index = timeWheelIndexFromScroll(column, el.scrollTop);\n if (index === timeWheelIndex(column, this.view.minutes)) return;\n this.timeChange.emit(withTimeWheelIndex(column, this.view.minutes, index));\n }\n\n private scrollStateOf(column: TimeWheelColumn): ColumnScroll {\n let state = this.scroll.get(column);\n if (!state) {\n state = { syncedTop: null, settle: null };\n this.scroll.set(column, state);\n }\n return state;\n }\n}\n","<!-- One click listener for the whole wheel (see onClick): the wheel appears\n when a response lands, and content that appears mid-tap carrying its own\n listeners cancels the tap on iOS. -->\n<div\n class=\"magicx-aia-time-wheel\"\n data-aia-time-wheel=\"\"\n role=\"group\"\n [attr.aria-label]=\"label\"\n (mousedown)=\"preventBlur($event)\"\n (click)=\"onClick($event)\"\n>\n <!-- The wheels are a pointer surface; keyboard users move the time from the\n input. So the columns are hidden from AT and the time is announced\n from here instead. -->\n <span class=\"magicx-aia-time-wheel-value\" data-aia-time-value=\"\" aria-live=\"polite\">{{\n valueLabel\n }}</span>\n <div class=\"magicx-aia-time-wheel-columns\" aria-hidden=\"true\">\n <div class=\"magicx-aia-time-wheel-band\"></div>\n <ng-container *ngFor=\"let column of columns; trackBy: trackByColumn\">\n <span *ngIf=\"column === 'minute'\" class=\"magicx-aia-time-wheel-separator\">:</span>\n <div\n #wheelColumn\n class=\"magicx-aia-time-wheel-column\"\n [attr.data-aia-time-column]=\"column\"\n (scroll)=\"onScroll(column, $event)\"\n >\n <div\n *ngFor=\"let row of rowsOf(column); let i = index; trackBy: trackByRow\"\n class=\"magicx-aia-time-wheel-row\"\n [class.magicx-aia-time-wheel-row--selected]=\"i === indexOf(column)\"\n data-aia-time-row=\"\"\n [attr.data-aia-time-column]=\"column\"\n [attr.data-aia-index]=\"i\"\n >\n {{ row.label }}\n </div>\n </div>\n </ng-container>\n </div>\n <!-- Out of the tab order, as the calendar's buttons are: Tab is bound to the\n dropdown, and Enter in the input already commits a moved wheel. -->\n <button type=\"button\" tabindex=\"-1\" class=\"magicx-aia-time-wheel-done\" data-aia-time-done=\"\">\n {{ doneLabel }}\n </button>\n</div>\n","import { CommonModule } from \"@angular/common\";\nimport {\n type AfterViewChecked,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n inject,\n NgZone,\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 attachViewportFit,\n buildAttributionUrl,\n containScroll,\n type DateMonthView,\n type DateSelection,\n dateFloorFor,\n destroyPanelMorph,\n findMultiSelectDone,\n fitMultiSelectDone,\n getFooterHint,\n hasSkippablePill,\n isCalendarFormat,\n type LocationView,\n labelTraditionalAutocomplete,\n type Product,\n type ProductImageFallback,\n type ProductsLayout,\n queryLive,\n type ScrollArrowController,\n type Suggestion,\n type SuggestionOption,\n settlePanelMorph,\n syncPanelHug,\n type TimeView,\n type UIStrings,\n uiStringsFor,\n type ViewportFitController,\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 { LocationFieldComponent } from \"../internal/location-field/location-field.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\";\nimport { TimeWheelComponent } from \"../internal/time-wheel/time-wheel.component\";\n\ninterface DropdownVm {\n pills: Suggestion[];\n options: SuggestionOption[];\n activeIndex: number;\n isActivePillSelected: boolean;\n isLoading: boolean;\n /** The loading skeleton is fading out before the response's options replace it. */\n skeletonExiting: 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 /** Whether the time wheel renders in place of the options grid. */\n showsTimeWheel: boolean;\n /** What the time wheel shows. Null unless `showsTimeWheel`. */\n timeView: TimeView | null;\n multiSelectView: { picked: string[] } | null;\n /** True for a location pill without options: the search field replaces the grid. */\n showsLocationField: boolean;\n /** What the location field shows. Null unless `showsLocationField`. */\n locationView: LocationView | null;\n /** Whether the widget has focus. */\n widgetFocused: boolean;\n /** True while a saved answer is re-edited: the location field then takes focus. */\n isReediting: boolean;\n showsFallbackSkeleton: boolean;\n isVisible: boolean;\n /** Product cards for the strip. Empty unless `products` is configured. */\n products: Product[];\n /** Whether the cards draw an add-to-cart button — the controller has a handler. */\n hasProductAddToCart: boolean;\n /** The product whose selection is in progress: its card shows a spinner. */\n busyProductId: string | null;\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 /** The words of the widget language. */\n strings: UIStrings;\n optionsPosition: \"above\" | \"below\";\n /** Whether option rows draw their `icon_svg` before the text. */\n showOptionIcons: boolean;\n /** Whether option rows draw their `image_url` as a thumbnail before the text. */\n showOptionImages: boolean;\n /** Whether option rows show their `item_count` at the trailing edge. */\n showOptionCounts: 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 TimeWheelComponent,\n LocationFieldComponent,\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 header row's trailing edge, across from the parameter label; a\n * skip-only row (`showPills` false) holds it alone at that edge too.\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 /**\n * Whether option rows draw their `image_url` as a square thumbnail before\n * the text, in place of the icon. Default: true. Set to false to render\n * option rows without pictures.\n */\n @Input() showOptionImages = true;\n /**\n * Whether option rows show their `item_count` as a muted label at the\n * trailing edge (\"12 items\"). Default: true. Set to false to hide the counts.\n */\n @Input() showOptionCounts = true;\n /**\n * How the product strip lays its cards out: a horizontally scrolling row\n * (the default), or the same cards stacked as full-width rows.\n */\n @Input() productsLayout: ProductsLayout = \"row\";\n /** Missing/failed image fallback. Style initials with `[data-aia-product-initial]`. */\n @Input() productImageFallback: ProductImageFallback = \"image\";\n /** When true (default), product cards draw the product's `vendor` as a line above the title. Set to false when your product titles already name the brand, so a card does not show it twice. */\n @Input() showProductVendor = 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 * The widget language. Tier 1 passes its own `language`.\n * UI languages: en, es, fr, pt-BR, it, tr, id, pl, de, nl, sv, nb, da, fi, ja, ko, zh-CN and zh-TW.\n * Only this input selects the UI language. Unsupported languages use English.\n */\n @Input() language?: string;\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 private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly zone = inject(NgZone);\n private releaseScroll?: () => void;\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 get scrollArrowLabel(): string {\n return uiStringsFor(this.language).scrollArrow;\n }\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 })\n private scrollArrowRef?: ElementRef<HTMLButtonElement>;\n /** The grid the scroll-arrow controller is currently bound to. */\n private viewportFitBinding: { root: HTMLElement; controller: ViewportFitController } | null =\n null;\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 // Same bridge, for `showOptionImages` and `showOptionCounts`.\n private readonly showOptionImages$ = new BehaviorSubject<boolean>(true);\n private readonly showOptionCounts$ = new BehaviorSubject<boolean>(true);\n // Same bridge, for `language`.\n private readonly language$ = new BehaviorSubject<string | undefined>(undefined);\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.showOptionImages$.next(this.showOptionImages);\n this.showOptionCounts$.next(this.showOptionCounts);\n this.language$.next(this.language);\n this.applyMode();\n this.initVm();\n // Wheel/touch over the dropdown never scrolls the page behind it. On the\n // host, so it survives the *ngIf root coming and going; outside the zone,\n // so a wheel gesture doesn't run change detection on every event.\n this.zone.runOutsideAngular(() => {\n this.releaseScroll = containScroll(this.host.nativeElement);\n });\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[\"showOptionImages\"]) {\n this.showOptionImages$.next(this.showOptionImages);\n }\n if (changes[\"showOptionCounts\"]) {\n this.showOptionCounts$.next(this.showOptionCounts);\n }\n if (changes[\"language\"]) {\n this.language$.next(this.language);\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 * The Done wrapper spans the panel but the button is only as wide as the\n * options, so commit only for a tap on the button itself, as vanilla and\n * React do. The listener stays on the wrapper because the button is\n * re-created and must carry none of its own.\n */\n onMultiDoneClick(event: Event, skipDisabled: boolean): void {\n if (skipDisabled) return;\n if (!(event.target as HTMLElement | null)?.closest(\"[data-aia-multi-done]\")) return;\n this.controller.commitMultiSelect();\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 done = findMultiSelectDone(this.host.nativeElement);\n if (done) {\n // Kept mounted, disabled, while the next step loads, so it fades out\n // with the options; armed (after a settle) once the panel is idle.\n // The dropdown root carries data-aia-loading while a request loads; keep Done disabled then.\n if (done.closest(\"[data-aia-loading]\")) done.disabled = true;\n else if (done.disabled) {\n void done.offsetHeight;\n done.disabled = false;\n }\n }\n fitMultiSelectDone(this.host.nativeElement, done);\n const root = this.dropdownRootRef?.nativeElement;\n // The panel hugs its options (the core's panelHugWidth.ts), before the\n // viewport fit and the morph measure it.\n if (root) syncPanelHug(root);\n this.syncViewportFit();\n this.syncPanelMorph(root);\n const button = this.scrollArrowRef?.nativeElement;\n const grid = root ? queryLive<HTMLElement>(root, \".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 if (this.morphRoot) destroyPanelMorph(this.morphRoot);\n this.morphRoot = null;\n this.teardownModeListener();\n this.releaseScroll?.();\n this.scrollArrowBinding?.controller.destroy();\n this.scrollArrowBinding = null;\n this.viewportFitBinding?.controller.destroy();\n this.viewportFitBinding = null;\n }\n\n private morphRoot: HTMLElement | null = null;\n\n /**\n * The open panel's height glide and question crossfade, shared with vanilla\n * and React (the core's panelMorph.ts). Keyed on the active pill's text, as\n * the other two packages key it. The crossfade's ghost is a node the core\n * appends to the root and removes itself; Angular's renderer never owns it.\n */\n private syncPanelMorph(root: HTMLElement | undefined): void {\n if (this.morphRoot && this.morphRoot !== root) destroyPanelMorph(this.morphRoot);\n this.morphRoot = root ?? null;\n if (!root) return;\n // The crossfade copy keeps the previous question's active pill; only the live panel counts.\n const pill = queryLive(root, \"[data-aia-pill-active]\");\n const key = pill?.textContent?.trim() || null;\n settlePanelMorph(root, key, {\n visible: root.classList.contains(\"magicx-aia-dropdown-visible\"),\n anchorBottom: root.getAttribute(\"data-options-position\") === \"above\",\n });\n }\n\n /**\n * Keep the open panel inside the visible viewport — above a phone's\n * keyboard — through the core's fit controller (see the core's\n * viewportFit.ts), which owns the measuring and the listeners. Re-measures\n * after each view check, re-attaching if the root element is replaced.\n */\n private syncViewportFit(): void {\n const root = this.dropdownRootRef?.nativeElement ?? null;\n if (this.viewportFitBinding && this.viewportFitBinding.root !== root) {\n this.viewportFitBinding.controller.destroy();\n this.viewportFitBinding = null;\n }\n if (!root) return;\n if (!this.viewportFitBinding) {\n this.viewportFitBinding = {\n root,\n // Outside the zone: its viewport and scroll listeners must not run\n // change detection on every scroll frame.\n controller: this.zone.runOutsideAngular(() =>\n attachViewportFit({\n dropdown: root,\n isOpen: () => root.classList.contains(\"magicx-aia-dropdown-visible\"),\n }),\n ),\n };\n return; // attach() runs the first update itself\n }\n this.viewportFitBinding.controller.update();\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 this.showOptionImages$,\n this.showOptionCounts$,\n this.language$,\n ]).pipe(\n map(\n ([\n dd,\n showPills,\n showSkipButton,\n showOptionIcons,\n showOptionImages,\n showOptionCounts,\n language,\n ]) => {\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 hasSkippablePill(dd.pills) && 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 // The time wheel and the location field are withheld while a request is\n // in flight, for the calendar's reasons above. Their pills have no\n // options by design, so it is the format — not the option count — that\n // says they show.\n const showsTimeWheel = dd.formatType === \"time\" && dd.timeView != null && !dd.isLoading;\n const showsLocationField =\n dd.formatType === \"location\" && dd.locationView != null && !dd.isLoading;\n const showsFallbackSkeleton =\n dd.isLoading &&\n !showsOptions &&\n !showsDateGrid &&\n !showsTimeWheel &&\n !showsLocationField;\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 ||\n showsDateGrid ||\n showsTimeWheel ||\n showsLocationField ||\n showsPills ||\n dd.isLoading ||\n 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, widgetFocused: false, isVisible: false };\n }\n\n const optionHighlighted =\n dd.activeIndex >= 0 && Boolean(options[dd.activeIndex]?.is_tappable);\n const strings = uiStringsFor(language);\n const pills = labelTraditionalAutocomplete(dd.pills, strings.keepTyping);\n const { key: footerKey, hint: footerHint } = getFooterHint(\n optionHighlighted,\n dd.isInputEmpty,\n strings,\n );\n const content: DropdownContent = {\n pills,\n options,\n activeIndex: dd.activeIndex,\n isActivePillSelected: dd.isActivePillSelected,\n isLoading: dd.isLoading,\n skeletonExiting: Boolean(dd.skeletonExiting),\n showsPills,\n showsSkip,\n skipDisabled: dd.isLoading || Boolean(dd.inSelectionAnimation),\n activePillLabel: 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 floor: dateFloorFor(dd.formatType, dd.dateRangeStart),\n references: dd.dateReferences ?? [],\n },\n showsTimeWheel,\n timeView: dd.timeView ?? null,\n multiSelectView: dd.multiSelectView ?? null,\n showsLocationField,\n locationView: dd.locationView ?? null,\n widgetFocused: Boolean(dd.isFocused),\n isReediting: Boolean(dd.isReediting),\n showsFallbackSkeleton,\n products: dd.products,\n hasProductAddToCart: Boolean(dd.hasProductAddToCart),\n busyProductId: dd.busyProductId ?? null,\n groupKey: activeSuggestion\n ? `${activeSuggestion.parameter} ${activeSuggestion.text}`\n : \"\",\n footerKey,\n footerHint,\n strings,\n optionsPosition: dd.optionsPosition,\n showOptionIcons,\n showOptionImages,\n showOptionCounts,\n };\n if (isVisible) this.lastVisibleContent = content;\n return { ...content, isVisible };\n },\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 onCommitSelect(option: SuggestionOption): void {\n this.controller.selectOption(option, { commit: true });\n }\n\n onPreviousMonth(): void {\n this.controller.showPreviousMonth();\n }\n\n onNextMonth(): void {\n this.controller.showNextMonth();\n }\n\n onTimeChange(minutes: number): void {\n this.controller.setTime(minutes);\n }\n\n onTimeCommit(): void {\n this.controller.commitTime();\n }\n\n onLocationQuery(query: string): void {\n this.controller.setLocationQuery(query);\n }\n\n onLocationMove(delta: number): void {\n this.controller.moveLocationHighlight(delta);\n }\n\n onLocationAnswer(index: number | undefined): void {\n this.controller.commitLocation(index);\n }\n\n /** The field taking focus blurs the input, which must not close the panel it lives in. */\n onLocationFocusChange(focused: boolean): void {\n this.controller.setLocationFieldFocused(focused);\n }\n\n onHighlight(index: number): void {\n this.controller.setActiveDropdownIndex(index);\n }\n\n // A hover highlight ends with the hover — see the core's `clearHighlight`.\n onUnhighlight(index: number): void {\n this.controller.clearHighlight(index);\n }\n\n onProductSelect(product: Product): void {\n this.controller.selectProduct(product);\n }\n\n /**\n * The strip's cart buttons. A stable arrow reading the current controller,\n * so the strip's input doesn't change on every pass.\n */\n readonly addProductToCart = (product: Product): Promise<void> =>\n this.controller.addProductToCart(product);\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 [attr.aria-multiselectable]=\"!!vm.multiSelectView\"\n data-aia-dropdown=\"\"\n [attr.data-aia-loading]=\"vm.isLoading ? '' : null\"\n [attr.data-aia-skeleton-exiting]=\"vm.skeletonExiting ? '' : 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]=\"\n vm.activePillLabel ? vm.strings.skipLabel + ' ' + vm.activePillLabel : vm.strings.skipLabel\n \"\n (click)=\"onSkip()\"\n >\n {{ vm.strings.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 [showImages]=\"vm.showOptionImages\"\n [showCounts]=\"vm.showOptionCounts\"\n [picked]=\"vm.multiSelectView?.picked\"\n (select)=\"onSelect($event)\"\n (commitSelect)=\"onCommitSelect($event)\"\n (highlight)=\"onHighlight($event)\"\n (unhighlight)=\"onUnhighlight($event)\"\n ></aia-suggestion-grid>\n\n <div *ngIf=\"vm.multiSelectView\" data-aia-multi-actions=\"\" (click)=\"onMultiDoneClick($event, vm.skipDisabled || vm.isLoading)\">\n <button type=\"button\" tabindex=\"-1\" disabled data-aia-multi-done=\"\" class=\"magicx-aia-multi-done\">{{ vm.strings.done }}</button>\n </div>\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 (unhighlight)=\"onUnhighlight($event)\"\n (previousMonth)=\"onPreviousMonth()\"\n (nextMonth)=\"onNextMonth()\"\n ></aia-date-grid>\n\n <aia-time-wheel\n *ngIf=\"vm.showsTimeWheel\"\n [view]=\"vm.timeView\"\n [label]=\"vm.strings.timeLabel\"\n [doneLabel]=\"vm.strings.done\"\n [interactive]=\"!vm.skipDisabled\"\n (timeChange)=\"onTimeChange($event)\"\n (commit)=\"onTimeCommit()\"\n ></aia-time-wheel>\n <aia-location-field\n *ngIf=\"vm.showsLocationField\"\n [view]=\"vm.locationView\"\n [searchLabel]=\"vm.strings.locationSearch\"\n [noResultsLabel]=\"vm.strings.locationNoResults\"\n [useTypedLabel]=\"vm.strings.locationUseTyped\"\n [widgetFocused]=\"vm.widgetFocused && vm.isVisible\"\n [reediting]=\"vm.isReediting\"\n [visible]=\"vm.isVisible\"\n [interactive]=\"!vm.skipDisabled\"\n (query)=\"onLocationQuery($event)\"\n (move)=\"onLocationMove($event)\"\n (answer)=\"onLocationAnswer($event)\"\n (focusChange)=\"onLocationFocusChange($event)\"\n ></aia-location-field>\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 && !vm.isLoading\"\n [loading]=\"vm.isLoading\"\n [layout]=\"productsLayout\"\n [imageFallback]=\"productImageFallback\"\n [showVendor]=\"showProductVendor\"\n [strings]=\"vm.strings\"\n [addToCart]=\"vm.hasProductAddToCart ? addProductToCart : null\"\n [busyProductId]=\"vm.busyProductId\"\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-badge\">\n <span class=\"magicx-aia-footer-brand\">Powered by Intent-1</span>\n </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=\"18\"\n height=\"18\"\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 type CustomFieldsReport,\n dateSelectionFor,\n dropdownPillsFor,\n editingSuggestion,\n type IdentifiedParamState,\n identifiedParamLabel,\n type Product,\n type Segment,\n type SelectOptionOptions,\n type SkippedParamState,\n type Suggestion,\n type SuggestionOption,\n withoutTraditionalAutocomplete,\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 // The add-to-cart handler lives here rather than in the core, so update()\n // can swap or remove it (the core takes it once); the core gets a forwarder.\n // Whether one is set folds into `dropdown$`, which draws the buttons off it.\n private productAddToCart: AIAutocompleteControllerOptions[\"onProductAddToCart\"];\n private readonly hasProductAddToCart$ = new BehaviorSubject<boolean>(false);\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 * What the product strip shows: the items the latest `/suggest` response\n * reported as matching the query, or — with `products` configured on the\n * controller — the results of that custom search.\n */\n readonly products$: Observable<Product[]>;\n /**\n * The catalog grounding report the latest response carried, or null when it\n * carried none: which of the query's constraints the catalog applied, which\n * it dropped, and how many items (and which) the applied ones left\n * standing. Null is \"no news\", not an empty catalog.\n */\n readonly customFields$: Observable<CustomFieldsReport | null>;\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 /**\n * A submit is in progress: it was handed to the integration and the page it\n * opens has not taken over yet. The submit button shows a spinner and Enter\n * is ignored; skip your own button's submit while it is true. It ends when\n * the input changes, when the shopper presses or types somewhere else,\n * when the page is shown again from the back/forward cache, on\n * `endSubmitProgress()`, when a promise given to `holdSubmit()` settles, or\n * after 8 seconds.\n */\n readonly isSubmitting$: 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 const { onProductAddToCart, ...coreOpts } = opts;\n this.productAddToCart = onProductAddToCart;\n this.hasProductAddToCart$.next(typeof onProductAddToCart === \"function\");\n\n this.core = new CoreAIAutocomplete(host, {\n ...coreOpts,\n onProductAddToCart: (product) => this.productAddToCart?.(product),\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(\n this.rawState$,\n (s) => withoutTraditionalAutocomplete(s.actionableSuggestions),\n arrEq,\n );\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.customFields$ = deriveField(this.rawState$, (s) => s.customFields);\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.isSubmitting$ = deriveField(this.rawState$, (s) => s.isSubmitting);\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([\n this.rawState$,\n this.optionsPosition$,\n this.hasProductAddToCart$,\n ]).pipe(\n map(([s, optionsPosition, hasCart]) => computeDropdown(s, optionsPosition, hasCart)),\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 /**\n * Prepare the typed word before you build a submit result from your own button.\n * A typed value with no pill yet joins `identifiedParams` only in this call. Read `getState()` after it.\n */\n prepareSubmit(): void {\n if (this.isDestroyed) return;\n this.core.prepareSubmit();\n }\n\n /**\n * Records a submit in telemetry. Enter is recorded by the SDK; call this\n * from a submit button you render, so each submit is counted once.\n */\n recordSubmit(result: AutocompleteResult): void {\n if (this.isDestroyed) return;\n this.core.recordSubmit(result);\n }\n\n /**\n * Marks a submit you ran from your own button as in progress\n * (`isSubmitting$`): call it right after you hand the submit on. A promise\n * passed in ends it when it settles; otherwise it ends when the input\n * changes, when the page is shown again from the back/forward cache, or\n * after 8 seconds. Enter is marked by the SDK.\n */\n holdSubmit(returned?: unknown): void {\n if (this.isDestroyed) return;\n this.core.holdSubmit(returned);\n }\n\n /**\n * Ends whatever is in progress, a submit or a product selection, at once:\n * call it when the work your handler started is done and the shopper is\n * still on the page (a quick view opened, inline results drawn).\n */\n endSubmitProgress(): void {\n if (this.isDestroyed) return;\n this.core.endSubmitProgress();\n }\n\n /**\n * The search in progress, to send with your own events from it. Undefined\n * until the feature is enabled for your account. Read it in your submit or\n * product handler: the shopper's next input starts another search.\n */\n getSearchId(): string | undefined {\n if (this.isDestroyed) return undefined;\n return this.core.getSearchId();\n }\n\n /**\n * The visitor id the events carry right now, to send with your own events.\n * Undefined while there is none: before the first response, or without\n * `visitorId` and without consent.\n */\n getVisitorId(): string | undefined {\n if (this.isDestroyed) return undefined;\n return this.core.getVisitorId();\n }\n\n /**\n * Reads `analyticsConsent` again now. Call it when the visitor changes their\n * choice, so a declined one removes the stored id at once.\n */\n refreshAnalyticsConsent(): void {\n if (this.isDestroyed) return;\n this.core.refreshAnalyticsConsent();\n }\n\n /**\n * Pick a dropdown option (or replace the re-edited param if in re-edit mode).\n * In a multi_select question this ticks the option; pass `{ commit: true }`\n * to answer with it right away instead.\n */\n selectOption(option: SuggestionOption, how?: SelectOptionOptions): void {\n if (this.isDestroyed) return;\n this.core.selectOption(option, how);\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 /**\n * Add a product to the cart through `onProductAddToCart`.\n * `<ai-autocomplete-dropdown>`'s cart buttons call this for you; consumers\n * rendering their own strip call it themselves. Resolves once the handler's\n * promise settles and rejects with its error. Without a handler it does\n * nothing.\n */\n addProductToCart(product: Product): Promise<void> {\n if (this.isDestroyed || !this.productAddToCart) return Promise.resolve();\n return this.core.addProductToCart(product);\n }\n\n /** Whether cards draw a cart button: an `onProductAddToCart` handler is set. */\n hasProductAddToCart(): boolean {\n return typeof this.productAddToCart === \"function\";\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 the editor text while an IME composes. Only completions for the word are shown. */\n handleCompositionText(value: string): void {\n if (this.isDestroyed) return;\n this.core.handleCompositionText(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 /** Remove the chip (completed or identified) with the given id (the chip's \"×\", `showChipRemove`); the same result as Backspace at the chip's trailing edge. Returns false when no chip has that id. */\n removeParam(paramId: string): boolean {\n if (this.isDestroyed) return false;\n return this.core.removeParam(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 /**\n * The pointer left option `index`: clear the highlight if it is still on it,\n * so Enter afterwards submits instead of picking an option the pointer is no\n * longer on. A highlight the keyboard has since moved is left alone.\n */\n clearHighlight(index: number): void {\n if (this.isDestroyed) return;\n this.core.clearHighlight(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 /**\n * Turn the time wheel to `minutes` past midnight, snapped to its 5-minute\n * step. Commits nothing. No-op unless a time pill is active.\n */\n setTime(minutes: number): void {\n if (this.isDestroyed) return;\n this.core.setTime(minutes);\n }\n\n /** Answer the active time pill with the time on the wheel. No-op unless a time pill is active. */\n toggleMultiSelectOption(option: SuggestionOption): void {\n if (this.destroyed) return;\n this.core.toggleMultiSelectOption(option);\n }\n\n commitMultiSelect(): void {\n if (this.destroyed) return;\n this.core.commitMultiSelect();\n }\n\n commitTime(): void {\n if (this.isDestroyed) return;\n this.core.commitTime();\n }\n\n /**\n * Set the text of the location search field, which searches the server's\n * location search after a short pause. No-op unless a location pill (a\n * location parameter without options) is active.\n */\n setLocationQuery(query: string): void {\n if (this.isDestroyed) return;\n this.core.setLocationQuery(query);\n }\n\n /** Move the highlight through the location results (ArrowDown / ArrowUp in the field). */\n moveLocationHighlight(delta: number): void {\n if (this.isDestroyed) return;\n this.core.moveLocationHighlight(delta);\n }\n\n /**\n * Answer the active location pill: with the place at `index`, else the\n * highlighted place, else the typed text as written.\n */\n commitLocation(index?: number): void {\n if (this.isDestroyed) return;\n this.core.commitLocation(index);\n }\n\n /**\n * Report that the location field holds focus (or is about to take it), so\n * the input's blur doesn't close the panel the field lives in.\n */\n setLocationFieldFocused(focused: boolean): void {\n if (this.isDestroyed) return;\n this.core.setLocationFieldFocused(focused);\n }\n\n /**\n * Runs mapProducts synchronously on the shown items again without a request.\n * Keeps the same cards while updating their content.\n * Does nothing without mapProducts or with a custom products integration.\n */\n refreshProducts(): void {\n if (this.isDestroyed) return;\n this.core.refreshProducts();\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`). The exception is\n * `onProductAddToCart`, a handler rather than an event: passing the key sets,\n * swaps or (with `undefined`) removes it, and the cart buttons follow.\n */\n update(opts: AIAutocompleteControllerUpdate): void {\n if (this.isDestroyed) return;\n const { onProductAddToCart, ...coreOpts } = opts;\n if (\"onProductAddToCart\" in opts) {\n this.productAddToCart = onProductAddToCart;\n this.hasProductAddToCart$.next(typeof onProductAddToCart === \"function\");\n }\n this.core.update(coreOpts);\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/** UI-visible loading — the core's `dropdownLoading` (see its docs). */\nfunction computeUiLoading(s: CoreState): boolean {\n return s.dropdownLoading;\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: withoutTraditionalAutocomplete(s.actionableSuggestions),\n segments: s.segments,\n newParamId: s.newParamId,\n suggestions: s.suggestions,\n products: s.products,\n customFields: s.customFields,\n activeIndex: s.activeDropdownIndex,\n isLoading: computeUiLoading(s),\n isReady: s.isReady,\n isSubmitting: s.isSubmitting,\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 hasProductAddToCart: boolean,\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 ? editingSuggestion(editingParam)\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 parameter: editingIdentified.parameter,\n text: identifiedParamLabel(editingIdentified.parameter),\n required: true,\n options: [],\n }\n : null;\n const dropdownActivePill = s.dropdownSuggestion ?? dropdownPill ?? activeSuggestion;\n const dropdownPills = dropdownPillsFor(\n s.dropdownSuggestion,\n dropdownPill,\n s.actionableSuggestions,\n );\n return {\n suggestions: dropdownActivePill ? [{ ...dropdownActivePill, options: s.dropdownOptions }] : [],\n activeIndex: s.activeDropdownIndex,\n isOpen: s.isDropdownOpen,\n pills: dropdownPills,\n isActivePillSelected: s.isActivePillSelected,\n isLoading: computeUiLoading(s),\n skeletonExiting: s.skeletonExiting,\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 dateReferences: dateSelection.references,\n // Time wheel. As for a calendar, `s.filteredOptions` is empty — the wheel\n // is drawn from `timeView`, not from the suggestion's options.\n timeView: s.timeView,\n multiSelectView: s.dropdownMultiSelect,\n // Location search, for a location parameter without options. The field\n // lives in the dropdown; the caret stays in the input unless a saved\n // location is re-edited, when the field takes focus with it selected.\n locationView: s.locationView,\n isReediting: s.editingParam != null,\n isFocused: s.isFocused || s.locationFieldFocused,\n optionsPosition,\n hasProductAddToCart,\n busyProductId: s.selectingProductId,\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 attachChipRemove,\n cancelStartingHint,\n chipIdFromTap,\n extractPlainText,\n getCursorOffset,\n keepCaretOnChip,\n plainTextLength,\n renderEditableContent,\n setCursorOffset,\n startingHintOptions,\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 \"(click)\": \"onClick($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 /** Whether completed chips draw the picture of the option that answered them, in place of the icon. Default: true. */\n @Input() showChipImages = true;\n /** Whether chips (completed and identified) end in a faint \"×\" that removes them. Default: false. */\n @Input() showChipRemove = false;\n /** Pills drawn inline beside the text replace the empty-box hint. */\n @Input() showInlinePills = false;\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 private detachChipRemove?: () => void;\n private chipRemoveReady = false;\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.chipRemoveReady = true;\n this.syncChipRemove();\n this.bindStateSubscription();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const toggled =\n (changes[\"showChipIcons\"] ??\n changes[\"showChipImages\"] ??\n changes[\"showChipRemove\"] ??\n changes[\"showInlinePills\"]) !== undefined;\n const first =\n changes[\"showChipIcons\"]?.firstChange ??\n changes[\"showChipImages\"]?.firstChange ??\n changes[\"showChipRemove\"]?.firstChange ??\n changes[\"showInlinePills\"]?.firstChange;\n if (changes[\"showChipRemove\"]) this.syncChipRemove();\n if (toggled && !first && this.lastState) {\n this.renderEditor(this.lastState);\n }\n }\n\n /**\n * The chips' \"×\" (showChipRemove): the listeners shared with the vanilla and\n * React editors, attached only while the option is on.\n */\n private syncChipRemove(): void {\n if (!this.chipRemoveReady) return;\n if (this.showChipRemove === (this.detachChipRemove !== undefined)) return;\n this.detachChipRemove?.();\n this.detachChipRemove = this.showChipRemove\n ? this.zone.runOutsideAngular(() =>\n attachChipRemove(this.el.nativeElement, (id) =>\n this.zone.run(() => this.controller.removeParam(id)),\n ),\n )\n : undefined;\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 showChipImages: this.showChipImages,\n showChipRemove: this.showChipRemove,\n hintOptions: this.showInlinePills ? [] : startingHintOptions(state.suggestionPills),\n });\n }\n\n ngOnDestroy(): void {\n cancelStartingHint(this.el.nativeElement);\n this.destroy$.next();\n this.destroy$.complete();\n this.detachChipRemove?.();\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 /**\n * A tap on a chip opens *that* chip. Touch browsers place the caret where\n * they see fit (iOS snaps it to a word boundary, and the focusing tap often\n * parks it at the end of the text — inside the last chip when the input ends\n * with one), so the selectionchange path can miss the tapped chip or open\n * the wrong one. The click target is the element actually hit and overrides\n * it; `keepCaretOnChip` then pulls a stray caret onto the tapped chip so the\n * next selectionchange doesn't close or redirect what the tap opened.\n */\n onClick(event: MouseEvent): void {\n const el = this.el.nativeElement;\n const id = chipIdFromTap(el, event.target);\n if (!id) return;\n this.controller.startEditingParam(id);\n keepCaretOnChip(el, id);\n }\n\n onCompositionStart(): void {\n this.composing = true;\n this.el.nativeElement.setAttribute(\"data-aia-composing\", \"true\");\n }\n\n onCompositionEnd(): void {\n this.composing = false;\n this.el.nativeElement.removeAttribute(\"data-aia-composing\");\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 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 // While composing, the core only previews the text.\n if (this.composing) {\n this.controller.handleCompositionText(next);\n return;\n }\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\";\nimport { uiStringsFor } from \"@magicx-eng/ai-autocomplete-vanilla\";\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 /** The request is complete: the button lights up to invite the submit. */\n @Input() ready = false;\n /**\n * A submit is in progress: the arrow gives way to a spinner. The button\n * stays enabled, so focus stays where it is; the submit ignores a press.\n */\n @Input() busy = false;\n /** The accessible name. Default: the English word. */\n @Input() label = uiStringsFor().submit;\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 [attr.data-aia-ready]=\"ready ? '' : null\"\n [attr.data-aia-submit-state]=\"busy ? 'busy' : null\"\n [attr.aria-busy]=\"busy ? 'true' : null\"\n [attr.aria-label]=\"label\"\n (click)=\"onClick($event)\"\n>\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" role=\"img\" [attr.aria-label]=\"label\">\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 type CoreOptions,\n type CurrencyOptions,\n extractPlainText,\n HANDOFF_NOT_HANDLED,\n ModeController,\n type OptionOverrides,\n type Product,\n type ProductImageFallback,\n type ProductsConfig,\n type ProductsLayout,\n setCursorOffset,\n uiStringsFor,\n watchEditorHeight,\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 /**\n * BCP 47 language tag (e.g. `\"es\"`), sent with every suggestion request.\n * Default: the browser language (`navigator.language`), else `\"en-US\"`.\n */\n @Input() language?: string;\n /** Sends currency context with suggestions when the code and a finite positive rate are set. */\n @Input() currency?: CurrencyOptions;\n /**\n * Your product id. When set, what the dropdown offers before anything is\n * typed is read from a cacheable URL for your product, with no credential,\n * instead of a suggestion request; it falls back to a suggestion request\n * when it cannot be read.\n */\n @Input() productId?: string;\n /**\n * Stable id for this visitor, kept by the host across page loads. Rides on\n * telemetry events so searches can be joined to what the visitor does\n * afterwards. Must be a UUID v4; omit to send none. A function is called\n * only once the server has funnel telemetry on.\n */\n @Input() visitorId?: string | (() => string | undefined);\n /**\n * Whether the visitor allowed analytics: `true`, `false`, or a function\n * returning either, or `undefined` while they have not answered. Once\n * allowed, and while the feature is enabled for your account, a site that\n * passes no `visitorId` gets one kept in the first-party cookie `aia_vid`\n * (a UUID v4, one year, renewed on use). Declined, that cookie is removed.\n * Omit it and the SDK never touches the cookie. Ignored when `visitorId` is\n * passed.\n */\n @Input() analyticsConsent?: boolean | (() => boolean | undefined);\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 /**\n * The options box's look and motion. Default `\"floating\"`: no stroke, sized\n * to the text, and it dissolves in where it sits and glides between\n * questions. `\"classic\"` brings back the earlier stroke, size and motion:\n * it unfolds out of the input with a stroke, at full size. The new header\n * layout stays.\n */\n @Input() optionsStyle: \"floating\" | \"classic\" = \"floating\";\n @Input() dropdownTrigger?: \"auto\" | \"manual\" | \"hidden\";\n @Input() closeDropdownOnBlur?: boolean;\n @Input() prependPlaceholder?: boolean;\n @Input() showNonTappableOptions?: boolean;\n /**\n * When true, a plain question of two or more options past the starting\n * state leads with an All option; picking it skips the question. Default false.\n */\n @Input() allOption?: boolean;\n /**\n * When true (default), a location parameter without options searches the\n * server's location search as the user types in its field. Set to false to\n * take typed text only.\n */\n @Input() locationSearch?: 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), an option that carries an `image_url` draws it as a square thumbnail before its text in the dropdown (in place of its `icon_svg`). Set to false to render option rows without pictures. */\n @Input() showOptionImages = true;\n /** When true (default), an option that carries an `item_count` shows it as a muted label at the row's trailing edge (\"12 items\"). Set to false to hide the counts. */\n @Input() showOptionCounts = true;\n /**\n * How the product strip lays its cards out. `\"row\"` (the default) is a\n * horizontally scrolling shelf of cards. `\"list\"` stacks the same cards as\n * full-width rows — thumbnail on the left, title, vendor and price on the\n * right — for results that read as a list (courses, listings, documents)\n * rather than products on a shelf; the column scrolls vertically inside\n * `--aia-product-list-max-height`.\n */\n @Input() productsLayout: ProductsLayout = \"row\";\n /** Missing/failed image fallback. Style initials with `[data-aia-product-initial]`. */\n @Input() productImageFallback: ProductImageFallback = \"image\";\n /** When true (default), product cards draw the product's `vendor` as a line above the title. Set to false when your product titles already name the brand, so a card does not show it twice. */\n @Input() showProductVendor = 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 /** When true (default), a completed chip in the input draws the picture (`image_url`) of the option that answered it, in place of its icon. Set to false to render chips without pictures. */\n @Input() showChipImages = true;\n /** When true, every chip in the input (completed, or identified by the server in typed text) ends in a small, faint \"×\" that removes the chip in one tap (the same result as Backspace at the chip's trailing edge). Default: false. */\n @Input() showChipRemove = false;\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 * When true (default), the dropdown renders a horizontal row of product\n * cards below the options grid whenever it has products to show: by default\n * the items the `/suggest` response reports as matching the query, or the\n * results of a custom `products` search. Set to false to render no strip\n * and run no custom search.\n */\n @Input() showProducts = true;\n /**\n * When true (default), a submit and a product card tap show that they took\n * while the page they open loads: the submit controls and the tapped card\n * show a spinner, and a repeat of the same tap is ignored until it is over\n * (a promise the handler returned settles, the input changes, the shopper\n * presses or types somewhere else, the page is shown again from the\n * back/forward cache, or 8 seconds pass). Set to false to turn\n * all of it off: nothing is marked, and every press emits.\n */\n @Input() submitProgress = true;\n /**\n * Custom source for the product strip. Omit it and the strip shows the\n * items the `/suggest` response itself reports as matching the query, with\n * no extra request. Set it and the dropdown is fed by your own search\n * endpoint on the SDK's existing fetch cadence instead; the server's items\n * are then not rendered.\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 @Input() mapProducts?: CoreOptions[\"mapProducts\"];\n /**\n * Adds a product to the cart from its card. When set, every card that isn't\n * sold out (`available: false`) shows an add-to-cart button in the bottom\n * right corner of its image; when unset, no card has one. Pressing the button\n * calls this, not `productSelect`, and the panel stays open. The SDK never\n * touches a cart itself.\n *\n * An input rather than an output because its result matters: return a\n * promise to have the button show progress. It carries\n * `data-aia-cart-state=\"adding\"` until the promise settles, then `\"added\"`\n * if it resolved. `\"added\"` stays until the card's product changes; pressing\n * again adds another unit (adding → added again). A rejection puts the\n * button back at rest.\n */\n @Input() onProductAddToCart?: (product: Product) => void | PromiseLike<unknown>;\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 * When true (default), the editor is cleared and a new session starts after\n * `submitted` emits — on Enter and on the submit button. Set to false to\n * leave the query in place: when the handler navigates away, a cleared field\n * flashes empty until the next page paints. Call `reset()` yourself when you\n * want a fresh session.\n */\n @Input() resetOnSubmit = true;\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 @ViewChild(\"editorArea\", { static: true }) editorAreaRef!: ElementRef<HTMLDivElement>;\n private stopEditorHeight?: () => void;\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 language: this.language,\n currency: this.currency,\n productId: this.productId,\n visitorId: this.visitorId,\n analyticsConsent: this.analyticsConsent,\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 prependPlaceholder: this.prependPlaceholder,\n showNonTappableOptions: this.showNonTappableOptions,\n allOption: this.allOption,\n locationSearch: this.locationSearch,\n showProducts: this.showProducts,\n submitProgress: this.submitProgress,\n source: \"full-sdk\",\n products: this.products,\n mapProducts: this.mapProducts,\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 // Registered whatever is bound to the output, so say when nothing is:\n // a tap that opens nothing must not be marked in progress.\n onProductSelect: (product) =>\n this.productSelect.observed\n ? this.productSelect.emit(product)\n : (HANDOFF_NOT_HANDLED as unknown as undefined),\n onProductAddToCart: this.onProductAddToCart,\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 // A new line opens smoothly instead of popping in (see watchEditorHeight).\n this.zone.runOutsideAngular(() => {\n this.stopEditorHeight = watchEditorHeight(this.editorAreaRef.nativeElement);\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[\"language\"] ||\n changes[\"currency\"] ||\n changes[\"productId\"] ||\n changes[\"visitorId\"] ||\n changes[\"analyticsConsent\"] ||\n changes[\"optionOverrides\"] ||\n changes[\"dropdownTrigger\"] ||\n changes[\"optionsPosition\"] ||\n changes[\"closeDropdownOnBlur\"] ||\n changes[\"prependPlaceholder\"] ||\n changes[\"showNonTappableOptions\"] ||\n changes[\"allOption\"] ||\n changes[\"locationSearch\"] ||\n changes[\"showProducts\"] ||\n changes[\"submitProgress\"] ||\n changes[\"products\"] ||\n changes[\"mapProducts\"]\n ) {\n this.controller.update({\n apiConfig: this.apiConfig,\n additionalContext: this.additionalContext,\n language: this.language,\n currency: this.currency,\n productId: this.productId,\n visitorId: this.visitorId,\n analyticsConsent: this.analyticsConsent,\n optionOverrides: this.optionOverrides,\n dropdownTrigger: this.dropdownTrigger,\n optionsPosition: this.optionsPosition,\n closeDropdownOnBlur: this.closeDropdownOnBlur,\n prependPlaceholder: this.prependPlaceholder,\n showNonTappableOptions: this.showNonTappableOptions,\n allOption: this.allOption,\n locationSearch: this.locationSearch,\n showProducts: this.showProducts,\n submitProgress: this.submitProgress,\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 mapProducts: this.mapProducts,\n });\n }\n if (changes[\"onProductAddToCart\"]) {\n this.controller.update({ onProductAddToCart: this.onProductAddToCart });\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.stopEditorHeight?.();\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 /**\n * Runs mapProducts synchronously on the shown items again without a request.\n * Keeps the same cards while updating their content.\n * Does nothing without mapProducts or with a custom products integration.\n */\n refreshProducts(): void {\n this.controller?.refreshProducts();\n }\n\n /** Clear all state, rotate session, and re-fetch. */\n reset(): void {\n this.controller?.reset();\n }\n\n /**\n * Ends whatever is in progress, a submit or a product selection, at once:\n * call it when the work your `(submitted)` / `(productSelect)` handler\n * started is done and the shopper is still on the page. An output cannot\n * return a promise, so this is how a handler says it is finished.\n */\n endSubmitProgress(): void {\n this.controller?.endSubmitProgress();\n }\n\n /** The search in progress, or `undefined` until the feature is enabled for your account. */\n getSearchId(): string | undefined {\n return this.controller?.getSearchId();\n }\n\n /** The visitor id the events carry right now, or `undefined` while there is none. */\n getVisitorId(): string | undefined {\n return this.controller?.getVisitorId();\n }\n\n /** Reads `analyticsConsent` again now, after the visitor changes their choice. */\n refreshAnalyticsConsent(): void {\n this.controller?.refreshAnalyticsConsent();\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 /** The default submit button's name, in the widget language. */\n get submitLabel(): string {\n return uiStringsFor(this.language).submit;\n }\n\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 // Tapping a location chip re-opens the location field, which takes focus\n // during the tap; the click that ends the tap must not take it back.\n if (document.activeElement?.closest(\"[data-aia-location]\")) 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 // `fromButton`: the SDK records an Enter submit itself before it calls back\n // here; a click on our own button never passes through it.\n private handleSubmit(_result: AutocompleteResult, fromButton = false): 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 const result = buildSubmitResult(text, params, state.skippedParams, {\n identifiedParams: state.identifiedParams,\n isReady: state.isReady,\n customFields: state.customFields,\n });\n if (fromButton) this.controller.recordSubmit(result);\n this.submitted.emit(result);\n // The core marks Enter's submit in progress itself; the button's is\n // marked here (a no-op when the handler already did, with its own\n // promise). Not when the reset below follows: nothing would show, so\n // nothing is written only to be taken back.\n if (fromButton && !this.resetOnSubmit) this.controller.holdSubmit();\n if (this.resetOnSubmit) this.controller.reset();\n }\n\n private handleSubmitFromUserAction(): void {\n const state = this.controller.getState();\n if (!this.canSubmit(state)) return;\n // A submit already in progress: this press is the same submit again.\n // (The core ignores a second Enter itself.)\n if (state.isSubmitting) return;\n this.controller.prepareSubmit();\n // Use the same handler for button clicks and Enter.\n this.handleSubmit(\n {\n query: state.text.trim(),\n raw_query: \"\",\n completed_params: [],\n identified_params: [],\n is_ready: state.isReady,\n },\n true,\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-aia-options-style]=\"optionsStyle\"\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 [showOptionImages]=\"showOptionImages\"\n [showOptionCounts]=\"showOptionCounts\"\n [productsLayout]=\"productsLayout\"\n [productImageFallback]=\"productImageFallback\"\n [showProductVendor]=\"showProductVendor\"\n [language]=\"language\"\n ></ai-autocomplete-dropdown>\n\n <div\n class=\"magicx-aia-input-wrapper\"\n data-aia-input-wrapper=\"\"\n (click)=\"onWrapperClick($event)\"\n (keyup)=\"$event.stopPropagation()\"\n >\n <div #editorArea 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 [showChipImages]=\"showChipImages\"\n [showChipRemove]=\"showChipRemove\"\n [showInlinePills]=\"showInlinePills\"\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 [ready]=\"\n !!controller &&\n !!(controller.isReady$ | async) &&\n canSubmit({\n segments: (controller.segments$ | async) ?? [],\n completedParams: (controller.completedParams$ | async) ?? []\n })\n \"\n [busy]=\"!!controller && !!(controller.isSubmitting$ | async)\"\n [label]=\"submitLabel\"\n (submit)=\"onSubmitButtonClick($event)\"\n ></aia-submit-button>\n\n <span\n *ngSwitchCase=\"'custom'\"\n data-aia-submit=\"\"\n data-aia-submit-slot=\"\"\n [attr.data-aia-submit-state]=\"controller && (controller.isSubmitting$ | async) ? 'busy' : null\"\n [attr.aria-busy]=\"controller && (controller.isSubmitting$ | async) ? 'true' : null\"\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 CurrencyOptions,\n CustomFieldsReport,\n DateMonthView,\n DateRange,\n ExpressedFilter,\n FilterOp,\n FormatType,\n IdentifiedParam,\n IdentifiedParamState,\n LocationPlace,\n LocationView,\n MatchedItem,\n MatchedItems,\n OptionOverrides,\n Product,\n ProductImageFallback,\n ProductsConfig,\n ProductsLayout,\n Segment,\n SelectOptionOptions,\n SkippedParamState,\n SubmitResultExtras,\n Suggestion,\n SuggestionOption,\n TaskKind,\n TimeView,\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 DEFAULT_OPTION_COUNT_UNIT as _DEFAULT_OPTION_COUNT_UNIT,\n dateCellMarks as _dateCellMarks,\n formatDate as _formatDate,\n formatDateRange as _formatDateRange,\n formatOptionCount as _formatOptionCount,\n formatPlace as _formatPlace,\n formatTime as _formatTime,\n isoDate as _isoDate,\n LOCATION_META_KEY as _LOCATION_META_KEY,\n monthLabel as _monthLabel,\n optionCountLabel as _optionCountLabel,\n optionHasImage as _optionHasImage,\n optionImageSources as _optionImageSources,\n optionImageSrc as _optionImageSrc,\n optionLabel as _optionLabel,\n optionsShowLeadingVisuals as _optionsShowLeadingVisuals,\n PRODUCT_PATH_PREFIX as _PRODUCT_PATH_PREFIX,\n parseDate as _parseDate,\n parseLooseDate as _parseLooseDate,\n parseLooseDateRange as _parseLooseDateRange,\n parseTime as _parseTime,\n productFromMatchedItem as _productFromMatchedItem,\n productImageSources as _productImageSources,\n productsFromCustomFields as _productsFromCustomFields,\n sanitizeOptionIconSvg as _sanitizeOptionIconSvg,\n selectedRangeFor as _selectedRangeFor,\n TIME_META_KEY as _TIME_META_KEY,\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// Time helpers: the written form a committed time takes, reading it back, and\n// the metadata key the exact 24-hour time is recorded under.\nexport const formatTime = _formatTime;\nexport const parseTime = _parseTime;\nexport const TIME_META_KEY = _TIME_META_KEY;\n// Location search: how a picked place reads, and the metadata key its\n// provider place ID is recorded under.\nexport const formatPlace = _formatPlace;\nexport const LOCATION_META_KEY = _LOCATION_META_KEY;\n// Option icons, for a custom dropdown that draws `icon_svg` itself.\nexport const optionLabel = _optionLabel;\nexport const sanitizeOptionIconSvg = _sanitizeOptionIconSvg;\n// Option pictures and counts, for a custom dropdown that draws `image_url`\n// and `item_count` itself.\nexport const DEFAULT_OPTION_COUNT_UNIT = _DEFAULT_OPTION_COUNT_UNIT;\nexport const formatOptionCount = _formatOptionCount;\nexport const optionCountLabel = _optionCountLabel;\nexport const optionHasImage = _optionHasImage;\nexport const optionImageSrc = _optionImageSrc;\nexport const optionImageSources = _optionImageSources;\nexport const optionsShowLeadingVisuals = _optionsShowLeadingVisuals;\n// Product strip helpers, for a custom strip fed from `customFields$`.\nexport const PRODUCT_PATH_PREFIX = _PRODUCT_PATH_PREFIX;\nexport const productFromMatchedItem = _productFromMatchedItem;\nexport const productImageSources = _productImageSources;\nexport const productsFromCustomFields = _productsFromCustomFields;\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","productImageSources","optionLabel","optionImageSources","formatOptionCount","sanitizeOptionIconSvg","optionsShowLeadingVisuals","formatTime","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","_formatTime","_parseTime","_TIME_META_KEY","_formatPlace","_LOCATION_META_KEY","_optionLabel","_sanitizeOptionIconSvg","_DEFAULT_OPTION_COUNT_UNIT","_formatOptionCount","_optionCountLabel","_optionHasImage","_optionImageSrc","_optionImageSources","_optionsShowLeadingVisuals","_PRODUCT_PATH_PREFIX","_productFromMatchedItem","_productImageSources","_productsFromCustomFields"],"mappings":";;;;;;;;;;AAwBA;;;;;;;;;;;;;;AAcG;MAUU,iBAAiB,CAAA;AAT9B,IAAA,WAAA,GAAA;;QAWW,IAAO,CAAA,OAAA,GAAuB,EAAE,CAAC;QACjC,IAAW,CAAA,WAAA,GAAG,CAAC,CAAC,CAAC;QACjB,IAAS,CAAA,SAAA,GAAG,EAAE,CAAC;QACf,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;AAE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3C,MAAM,cAAc,GAAGC,iBAAgB;AACvC,MAAM,cAAc,GAAGC,iBAAgB;AACvC,MAAM,kBAAkB,GAAGC,qBAAoB;AAC/C,MAAM,yBAAyB,GAAGC,4BAA2B;AACpE;AACO,MAAM,mBAAmB,GAAGC,sBAAqB;AACjD,MAAM,sBAAsB,GAAGC,yBAAwB;AACvD,MAAM,mBAAmB,GAAGC,sBAAqB;AACjD,MAAM,wBAAwB,GAAGC;;AC5IxC;;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/location-field/location-field.component.ts","../../src/lib/internal/location-field/location-field.component.html","../../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/internal/time-wheel/time-wheel.component.ts","../../src/lib/internal/time-wheel/time-wheel.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 isDimmedDay,\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\n /** The pointer left cell `index` — the dropdown clears a highlight still on it. */\n @Output() readonly unhighlight = 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, or before the earliest day the question takes: rendered dimmed. A day gone by stays pickable. A day before the earliest one does not. */\n isPast(option: SuggestionOption): boolean {\n // ISO strings order the same way the dates they name do.\n return isDimmedDay(cellIso(option), isoDate(new Date()), this.selection.floor);\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 /** A day another answer already holds: boxed for reference, still pickable. */\n isReference(option: SuggestionOption): boolean {\n return dateCellMarks(cellIso(option), {\n selectedIso: this.selection.selectedIso,\n range: this.paintedRange,\n references: this.selection.references,\n }).reference;\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 floor: this.selection.floor,\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 &lsaquo;\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 &rsaquo;\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--reference]=\"isReference(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 (mouseleave)=\"unhighlight.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 type AfterViewChecked,\n ChangeDetectionStrategy,\n Component,\n type ElementRef,\n EventEmitter,\n Input,\n type OnDestroy,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport type { LocationPlace, LocationView } from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n// One stable id per mounted field, for the rows' aria-activedescendant.\nlet fieldSeq = 0;\n\n/**\n * The focused element as seen from `node`'s root. Inside a shadow root\n * `document.activeElement` is the host, so focus checks must ask the\n * element's own root (vanilla's `activeElementFor`).\n */\nfunction activeElementFor(node: Node): Element | null {\n const root = node.getRootNode() as Document | ShadowRoot;\n return root.activeElement ?? null;\n}\n\n/** The selection that owns `node`: its shadow root's where the engine has one, else the document's. */\nfunction selectionFor(node: Node): Selection | null {\n const root = node.getRootNode() as (Document | ShadowRoot) & {\n getSelection?: () => Selection | null;\n };\n return root.getSelection?.() ?? document.getSelection();\n}\n\n/** The caret inside a contentEditable `el`, to hand back later; null for anything else. */\nfunction captureCaret(el: HTMLElement): Range | null {\n if (!el.isContentEditable) return null;\n const selection = selectionFor(el);\n if (!selection || selection.rangeCount === 0) return null;\n const range = selection.getRangeAt(0);\n return el.contains(range.startContainer) ? range.cloneRange() : null;\n}\n\n/**\n * Focus `target` with its caret where it was. `focus()` on a contentEditable\n * puts the caret at its start in Chrome, so the user's next keystroke would\n * land before everything they wrote. The saved caret is used while its nodes\n * are still in the input (a re-render replaces them); otherwise the end.\n */\nfunction focusWithCaret(target: HTMLElement, saved: Range | null): void {\n target.focus({ preventScroll: true });\n if (!target.isContentEditable) return;\n const selection = selectionFor(target);\n if (!selection) return;\n let range = saved;\n if (!range || !range.startContainer.isConnected || !target.contains(range.startContainer)) {\n range = document.createRange();\n range.selectNodeContents(target);\n range.collapse(false);\n }\n selection.removeAllRanges();\n selection.addRange(range);\n}\n\n/**\n * The dropdown's location body, rendered in place of the options grid for a\n * location parameter that came with no options. Angular analogue of vanilla's\n * `renderLocationField` and React's `<LocationField>`: a search field over\n * the server's location search, and the places it returned.\n *\n * The search itself — debounce, cancellation, results, highlight — lives in\n * the core. This component only moves focus: into the field when a saved\n * location is re-edited (a click into it focuses it as any input), and back\n * to the input it came from before an answer, on Escape or backspacing out of\n * an empty field, or when the field goes away.\n *\n * @internal\n */\n@Component({\n selector: \"aia-location-field\",\n standalone: true,\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./location-field.component.html\",\n styleUrls: [\"./location-field.component.css\"],\n})\nexport class LocationFieldComponent implements AfterViewChecked, OnDestroy {\n /** The core's `locationView`: the field's text and the places found for it. */\n @Input() view: LocationView | null = null;\n /** Placeholder and accessible name of the field (\"Say a location\"). */\n @Input() searchLabel = \"\";\n /** Shown when a search found nothing (\"No places found\"). */\n @Input() noResultsLabel = \"\";\n /** Says Enter answers with the typed text (\"Press Enter to use what you typed\"). */\n @Input() useTypedLabel = \"\";\n /**\n * Whether the widget has focus. Opening the field leaves the caret in the\n * input; the field only takes focus on its own for a re-edit (`reediting`),\n * and never pulls focus onto a page the user wasn't typing in.\n */\n @Input() widgetFocused = false;\n /**\n * True while a saved location is being re-edited (its chip tapped): the\n * field takes focus with that answer selected, so typing replaces it.\n * Otherwise the field takes focus only when the user clicks into it.\n */\n @Input() reediting = false;\n /** False while the panel is closed: the field leaves the tab order. */\n @Input() visible = true;\n /**\n * False for the press window after an answer: the answered pill's field is\n * still on screen and must not take a second answer.\n */\n @Input() interactive = true;\n\n /** The field's text changed — the core's `setLocationQuery`. */\n @Output() readonly query = new EventEmitter<string>();\n /** ArrowDown / ArrowUp — the core's `moveLocationHighlight`. */\n @Output() readonly move = new EventEmitter<number>();\n /** Answer: the place at the index, else the highlighted place, else the typed text — the core's `commitLocation`. */\n @Output() readonly answer = new EventEmitter<number | undefined>();\n /** The field took or let go of focus — the core's `setLocationFieldFocused`. */\n @Output() readonly focusChange = new EventEmitter<boolean>();\n\n @ViewChild(\"input\", { static: true }) inputRef!: ElementRef<HTMLInputElement>;\n @ViewChild(\"root\", { static: true }) rootRef!: ElementRef<HTMLElement>;\n @ViewChild(\"field\", { static: true }) fieldRef!: ElementRef<HTMLElement>;\n\n readonly fieldId = `aia-location-${++fieldSeq}`;\n // Where focus goes back to: the input the field took it from.\n private returnTo: HTMLElement | null = null;\n // The caret `returnTo` had when the field took focus; restored on the way back.\n private returnRange: Range | null = null;\n // Set while the field hands focus back, so its own blur isn't read as leaving.\n private returning = false;\n // The user left the field for the input; don't pull focus back until the\n // widget loses focus altogether.\n private declined = false;\n // Whether the last check was a re-edit; a re-edit starting clears `declined`.\n private wasReediting = false;\n private focusQueued = false;\n // Whether the core was last told the field holds focus. A field that goes\n // away while this is set must release the claim, or the widget counts as\n // focused with nothing focused.\n private claimed = false;\n\n get trimmedQuery(): string {\n return this.view?.query.trim() ?? \"\";\n }\n\n get activeDescendant(): string | null {\n const view = this.view;\n if (!view || view.highlighted < 0 || view.highlighted >= view.places.length) return null;\n return this.rowId(view.highlighted);\n }\n\n rowId(index: number): string {\n return `${this.fieldId}-row-${index}`;\n }\n\n trackPlace(_index: number, place: LocationPlace): string {\n return place.id;\n }\n\n ngAfterViewChecked(): void {\n // A re-edit starting clears an earlier decline: with two location questions\n // in a row the field never goes away, so a decline left over from the\n // other question would stop the tapped answer from opening. Read only\n // while the widget has focus: the checks of a click back into the input\n // can briefly drop it, and that must not count as a new re-edit.\n if (this.widgetFocused) {\n if (this.reediting && !this.wasReediting) this.declined = false;\n this.wasReediting = this.reediting;\n }\n const input = this.inputRef.nativeElement;\n const view = this.view;\n // Never fight the user's caret: only an outside change (a re-edit opening\n // the field on its answer) writes the text.\n if (view && input.value !== view.query && !this.hasFocus()) {\n input.value = view.query;\n }\n // The panel closed with focus still in the field — the core let go of the\n // location pill (a skip, say) while the field held focus, and the closing\n // panel keeps drawing it to fade out. Focus must not stay in a field\n // nobody can see: hand it back to the input it came from.\n if (!this.visible && this.hasFocus()) {\n this.declined = true;\n this.handBack();\n return;\n }\n if (!this.widgetFocused) {\n // Only once focus has really left the widget. Focus moving straight\n // from the field to the input (a click on it, Tab) blurs the field\n // before the input gains focus, and a check in between sees the widget\n // unfocused; resetting there made the input's focus read as \"came back\n // to the widget\", and the field took focus straight back. A task, not\n // a microtask: the browser runs microtasks between the blur and the\n // focus of a single click, so only a task sees where focus landed.\n setTimeout(() => {\n if (this.widgetFocused) return;\n const target = this.returnTo;\n if (target && activeElementFor(target) === target) return;\n this.declined = false;\n }, 0);\n return;\n }\n // Only a re-edit moves the caret into the field; a fresh location question\n // leaves it in the input. Not during the press window either: the\n // answered field is on its way out.\n if (\n !this.reediting ||\n this.declined ||\n !this.interactive ||\n this.focusQueued ||\n this.hasFocus()\n ) {\n return;\n }\n // After this check, so the focus events don't land mid change detection.\n this.focusQueued = true;\n queueMicrotask(() => {\n this.focusQueued = false;\n if (\n !input.isConnected ||\n !this.reediting ||\n this.declined ||\n !this.widgetFocused ||\n !this.interactive\n )\n return;\n if (this.hasFocus()) return;\n this.rememberReturn();\n // Claim focus before the input's blur, which would otherwise close the panel.\n this.reportFocus(true);\n input.focus({ preventScroll: true });\n // focus() can be refused (a field still hidden by the panel's\n // transition, say). No blur follows a focus that never arrived, so\n // release the claim here or the widget counts as focused forever.\n // Stop trying until the widget next gains focus: releasing the claim\n // re-runs change detection, and a retry on every check would loop forever.\n if (!this.hasFocus()) {\n this.declined = true;\n this.reportFocus(false);\n return;\n }\n // A re-edit opens the field on its answer: selected, so typing replaces it.\n if (input.value) input.select();\n });\n }\n\n /**\n * The field can go away while it holds focus — the dropdown withholds it\n * while a request is in flight (a skip that fetches, say). Angular removes\n * the node before this hook runs, so focus may already have fallen to the\n * body: hand it back to the input it came from, and release the claim.\n */\n ngOnDestroy(): void {\n if (!this.claimed) return;\n this.claimed = false;\n this.restoreAfterRemoval();\n this.focusChange.emit(false);\n }\n\n /**\n * A press anywhere on the field (the input, its search icon, its padding —\n * the label focuses the input for all of them) must reach it: the dropdown\n * root cancels every mousedown inside it, so this one stops here — and\n * claims focus before the editor's blur, which would otherwise close the\n * panel.\n */\n onPress(event: MouseEvent): void {\n if (!(event.target instanceof Node) || !this.fieldRef.nativeElement.contains(event.target)) {\n return;\n }\n event.stopPropagation();\n this.rememberReturn();\n this.reportFocus(true);\n }\n\n onInput(): void {\n this.query.emit(this.inputRef.nativeElement.value);\n }\n\n onFocus(event?: FocusEvent): void {\n this.rememberKeyboardReturn(event?.relatedTarget ?? null);\n this.reportFocus(true);\n }\n\n onBlur(): void {\n if (this.returning) return;\n this.declined = true;\n this.reportFocus(false);\n // A blur fired by the field's own removal (some engines fire one) leaves\n // focus on the body; once the removal is done, hand it back.\n queueMicrotask(() => this.restoreAfterRemoval());\n }\n\n onKeydown(event: KeyboardEvent): void {\n if (event.isComposing) return;\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowUp\":\n event.preventDefault();\n this.move.emit(event.key === \"ArrowDown\" ? 1 : -1);\n return;\n case \"Enter\":\n event.preventDefault();\n if (!this.interactive) return;\n this.handBack(true);\n this.answer.emit(undefined);\n return;\n // Tab is left to the browser. The dropdown sits before the input in\n // the DOM, so the field is the input's previous tab stop: Tab goes\n // forward to the input, Shift+Tab to whatever precedes the widget.\n case \"Escape\":\n // Back to the input, the pill left as it was.\n event.preventDefault();\n event.stopPropagation();\n this.declined = true;\n this.handBack();\n return;\n case \"Backspace\":\n // Backspacing past the start of an empty field goes back to the input.\n if (this.inputRef.nativeElement.value !== \"\") return;\n event.preventDefault();\n this.declined = true;\n this.handBack();\n return;\n }\n }\n\n /**\n * Taps on result rows are handled here, on the results container, never by\n * listeners on the rows — rows appear when a search lands, and content that\n * appears mid-tap carrying its own listeners cancels the tap on iOS.\n */\n onResultsClick(event: MouseEvent): void {\n if (!this.interactive || !(event.target instanceof Element)) return;\n const row = event.target.closest<HTMLElement>(\"[data-aia-location-row]\");\n if (!row) return;\n this.handBack(true);\n this.answer.emit(Number(row.getAttribute(\"data-aia-index\")));\n }\n\n private hasFocus(): boolean {\n const input = this.inputRef.nativeElement;\n return activeElementFor(input) === input;\n }\n\n private reportFocus(focused: boolean): void {\n this.claimed = focused;\n this.focusChange.emit(focused);\n }\n\n /** After the field left the document with focus in it: focus back on the input it came from. */\n private restoreAfterRemoval(): void {\n const input = this.inputRef.nativeElement;\n const target = this.returnTo;\n if (input.isConnected || !target?.isConnected) return;\n const active = activeElementFor(target);\n if (active && active !== document.body && active !== input) return;\n focusWithCaret(target, this.returnRange);\n }\n\n private rememberReturn(): void {\n const active = activeElementFor(this.rootRef.nativeElement);\n const input = this.inputRef.nativeElement;\n if (\n active instanceof HTMLElement &&\n active !== input &&\n active !== document.body &&\n !this.rootRef.nativeElement.contains(active)\n ) {\n this.returnTo = active;\n this.returnRange = captureCaret(active);\n }\n }\n\n /**\n * Focus arriving without a press (Shift+Tab) records where it came from, so\n * Escape and Backspace can hand it back; a press already recorded it.\n */\n private rememberKeyboardReturn(from: EventTarget | null): void {\n if (!(from instanceof HTMLElement) || from === this.returnTo) return;\n if (from === document.body || this.rootRef.nativeElement.contains(from)) return;\n this.returnTo = from;\n this.returnRange = captureCaret(from);\n }\n\n /** Hand focus back to the input before an answer, so the field going away never strands it. */\n private handBack(answered = false): void {\n // An answered field stays on screen through the press window; it must not\n // take focus back in that time, or focus is stranded when it goes.\n if (answered) this.declined = true;\n const target = this.returnTo;\n if (target?.isConnected && this.hasFocus()) {\n this.returning = true;\n focusWithCaret(target, this.returnRange);\n this.returning = false;\n }\n this.reportFocus(false);\n }\n}\n","<div #root class=\"magicx-aia-location\" data-aia-location (mousedown)=\"onPress($event)\">\n <label #field class=\"magicx-aia-location-field\">\n <svg class=\"magicx-aia-location-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\"></circle>\n <path d=\"m20 20-3.5-3.5\"></path>\n </svg>\n <input\n #input\n type=\"text\"\n class=\"magicx-aia-location-input\"\n data-aia-location-input\n autocomplete=\"off\"\n autocapitalize=\"words\"\n enterkeyhint=\"done\"\n spellcheck=\"false\"\n [attr.placeholder]=\"searchLabel\"\n [attr.aria-label]=\"searchLabel\"\n [attr.aria-activedescendant]=\"activeDescendant\"\n [tabIndex]=\"visible ? 0 : -1\"\n (input)=\"onInput()\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\"\n />\n </label>\n <div\n class=\"magicx-aia-location-results\"\n data-aia-location-results\n aria-live=\"polite\"\n (click)=\"onResultsClick($event)\"\n >\n <ng-container *ngIf=\"view && view.places.length > 0; else noPlaces\">\n <div\n *ngFor=\"let place of view.places; let i = index; trackBy: trackPlace\"\n class=\"magicx-aia-location-row\"\n [class.magicx-aia-location-row--highlighted]=\"i === view.highlighted\"\n data-aia-location-row\n [attr.data-aia-index]=\"i\"\n role=\"option\"\n [attr.aria-selected]=\"i === view.highlighted\"\n [id]=\"rowId(i)\"\n >\n <span class=\"magicx-aia-location-pin\">\n <svg class=\"magicx-aia-location-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z\"></path>\n <circle cx=\"12\" cy=\"9.5\" r=\"2.5\"></circle>\n </svg>\n </span>\n <span class=\"magicx-aia-location-text\">\n <span class=\"magicx-aia-location-name\">{{ place.name }}</span>\n <span *ngIf=\"place.secondary\" class=\"magicx-aia-location-secondary\">{{ place.secondary }}</span>\n </span>\n </div>\n </ng-container>\n <ng-template #noPlaces>\n <div *ngIf=\"view?.status === 'loading'\" class=\"magicx-aia-location-loading\" data-aia-location-loading>\n <span class=\"magicx-aia-location-loading-bar\"></span>\n <span class=\"magicx-aia-location-loading-bar\"></span>\n <span class=\"magicx-aia-location-loading-bar\"></span>\n </div>\n <div\n *ngIf=\"view?.status !== 'loading' && trimmedQuery\"\n class=\"magicx-aia-location-note\"\n data-aia-location-note\n >\n <span *ngIf=\"view?.status === 'done'\" class=\"magicx-aia-location-empty\">{{ noResultsLabel }}</span>\n <span>{{ useTypedLabel }}</span>\n </div>\n </ng-template>\n </div>\n</div>\n","import { CommonModule } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n inject,\n Output,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport { DomSanitizer, type SafeHtml } from \"@angular/platform-browser\";\nimport {\n isSmartSuggestion,\n isTraditionalAutocompleteSuggestion,\n SMART_SUGGESTION_SPARKLE_SVG,\n type Suggestion,\n} 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 /** The sparkle after the Smart Suggestion header; a fixed SDK constant, so it is trusted as is. */\n readonly sparkleSvg: SafeHtml = inject(DomSanitizer).bypassSecurityTrustHtml(\n SMART_SUGGESTION_SPARKLE_SVG,\n );\n\n /** The traditional autocomplete suggestion heads completions instead of asking a question. */\n readonly isSmartSuggestion = isSmartSuggestion;\n /** The inert header over completions, which takes no pointer; a marked question stays tappable. */\n readonly isCompletionHeader = isTraditionalAutocompleteSuggestion;\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.parameter;\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.--aia-pill-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-pill-active]=\"i === activePillIndex ? '' : null\"\n [attr.data-aia-loading]=\"loading ? '' : null\"\n [attr.data-aia-smart-suggestion]=\"isSmartSuggestion(pill) ? (isCompletionHeader(pill) ? 'header' : '') : null\"\n tabindex=\"-1\"\n class=\"aia-pill\"\n [class.aia-pill-rounded]=\"rounded\"\n [class.aia-pill-skeleton]=\"loading\"\n [style.--aia-pill-opacity]=\"pillOpacity(i)\"\n [disabled]=\"loading\"\n (mousedown)=\"onPillMouseDown($event)\"\n (click)=\"onPillClick(i)\"\n >\n <ng-container *ngIf=\"isSmartSuggestion(pill); else plainLabel\"\n ><span class=\"aia-smart-suggestion-text\">{{ pill.text }}</span\n ><span class=\"aia-smart-suggestion-sparkle\" [innerHTML]=\"sparkleSvg\"></span\n ></ng-container>\n <ng-template #plainLabel>{{ pill.text }}</ng-template>\n </button>\n </span>\n</ng-template>\n","import { CommonModule } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n type ElementRef,\n EventEmitter,\n Input,\n inject,\n type OnChanges,\n type OnDestroy,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport {\n attachProductRowWheel,\n type Product,\n type ProductImageFallback,\n type ProductsLayout,\n productImageSources,\n productInitial,\n productPhotoFill,\n type UIStrings,\n uiStringsFor,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\n\ntype CartState = \"adding\" | \"added\";\n\n/**\n * What makes a card's product \"the same\" for its cart button: every field\n * vanilla's `cardKey` rebuilds the card on. A price-only change keeps it.\n */\nfunction cartIdentity(product: Product): string {\n return [product.id, product.title, product.url, product.imageUrl, product.vendor]\n .map((field) => field ?? \"\")\n .join(\"\\0\");\n}\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 implements OnDestroy, OnChanges {\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 /** How the cards lay out — a scrolling row, or stacked as full-width rows. Default: \"row\". */\n @Input() layout: ProductsLayout = \"row\";\n @Input() imageFallback: ProductImageFallback = \"image\";\n /** Whether the cards draw the vendor line above the title. Default: true. */\n @Input() showVendor = true;\n /** The words of the widget language. Default: English. */\n @Input() strings: UIStrings = uiStringsFor();\n /** True while a request is in flight: the strip fades out with the options. */\n @Input() loading = false;\n /**\n * The `id` of the product whose selection is in progress: its card shows a\n * spinner over its picture. Selecting it again is ignored by the core.\n */\n @Input() busyProductId: string | null = null;\n /**\n * Set when the integration adds to cart: each card that is not sold out\n * draws a cart button, whose press calls this instead of emitting `select`.\n */\n @Input() addToCart: ((product: Product) => void | PromiseLike<unknown>) | null = null;\n readonly initial = productInitial;\n /**\n * Per product id, the `src`s that failed to load: a card moves on to the\n * next source (a Shopify thumbnail falls back to the original) and shows its\n * placeholder once none is left.\n */\n private readonly failedImages = new Map<string, string[]>();\n /** Per product id, the `src` that last finished loading; its tile drops the fill. */\n private readonly loadedImages = new Map<string, string>();\n\n ngOnChanges(): void {\n const sources = new Map(\n this.products.map((product) => [product.id, productImageSources(product.imageUrl)]),\n );\n for (const [id, failed] of this.failedImages) {\n const current = sources.get(id) ?? [];\n if (!failed.every((src) => current.includes(src))) this.failedImages.delete(id);\n }\n // A card whose product changed, left the strip or lost its button puts the\n // button back at rest — what rebuilding the card does in vanilla.\n const byId = new Map(this.products.map((product) => [product.id, product]));\n for (const [id, cart] of this.carts) {\n const product = byId.get(id);\n if (!product || !this.hasCart(product) || cartIdentity(product) !== cart.identity) {\n this.carts.delete(id);\n }\n }\n }\n\n imageSource(product: Product): string | null {\n const failed = this.failedImages.get(product.id) ?? [];\n return productImageSources(product.imageUrl).find((src) => !failed.includes(src)) ?? null;\n }\n\n /** Whether the card's photo has loaded, so the placeholder fill steps aside. */\n imageLoaded(product: Product): boolean {\n const src = this.imageSource(product);\n return src !== null && this.loadedImages.get(product.id) === src;\n }\n\n onImageLoad(product: Product, src: string, event?: Event): void {\n this.loadedImages.set(product.id, src);\n const img = event?.target as HTMLImageElement | null;\n const fill = img ? productPhotoFill(img.naturalWidth, img.naturalHeight) : null;\n if (fill) this.photoFills.set(product.id, fill);\n else this.photoFills.delete(product.id);\n }\n\n onImageError(product: Product): void {\n const src = this.imageSource(product);\n if (src) this.failedImages.set(product.id, [...(this.failedImages.get(product.id) ?? []), src]);\n // The next source, or the placeholder, fills the tile until it loads.\n this.photoFills.delete(product.id);\n }\n\n /** Per product id, how much of the tile the loaded photo fills (productPhotoFill). */\n private readonly photoFills = new Map<string, { x: number; y: number }>();\n\n /**\n * The card's photo-fill custom properties, which put the cart button inside\n * the photo's own corner. Null until the photo loads.\n */\n photoFillStyle(product: Product): Record<string, string> | null {\n const fill = this.photoFills.get(product.id);\n // Only the photo on screen counts: a changed or removed image drops it.\n if (!fill || !this.imageLoaded(product)) return null;\n return {\n \"--aia-product-photo-fill-x\": String(fill.x),\n \"--aia-product-photo-fill-y\": String(fill.y),\n };\n }\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 private detachWheel: (() => void) | null = null;\n private readonly cdr = inject(ChangeDetectorRef);\n /**\n * Per product id, the cart button's state while it isn't at rest, with the\n * product identity it belongs to and the press that set it (a settle from an\n * earlier press, or for a card since reset, is dropped).\n */\n private readonly carts = new Map<string, { state: CartState; identity: string; press: object }>();\n private destroyed = false;\n\n /**\n * A mouse wheel over the row scrolls it sideways. The row sits inside the\n * section's `*ngIf`, so the query fires with the element as products arrive\n * and with `undefined` as they go; the binding follows it either way.\n */\n @ViewChild(\"row\")\n set row(ref: ElementRef<HTMLElement> | undefined) {\n this.detachWheel?.();\n this.detachWheel = ref ? attachProductRowWheel(ref.nativeElement) : null;\n }\n\n ngOnDestroy(): void {\n this.destroyed = true;\n this.detachWheel?.();\n this.detachWheel = null;\n }\n\n /** A sold-out product can't be added, so its card has no button at all. */\n hasCart(product: Product): boolean {\n return this.addToCart !== null && product.available !== false;\n }\n\n cartState(product: Product): CartState | null {\n return this.carts.get(product.id)?.state ?? null;\n }\n\n onCartKeyDown(event: KeyboardEvent, product: Product): void {\n // Keys never reach the card, whose own Enter / Space would select it.\n if (event.key !== \"Enter\" && event.key !== \" \") return;\n this.onCartPress(event, product);\n }\n\n /**\n * Mirrors vanilla's `buildCartButton` press: adding → added, or rest on a\n * rejection. The check stays until the product changes; another press adds again.\n */\n onCartPress(event: Event, product: Product): void {\n event.preventDefault();\n event.stopPropagation();\n const handler = this.addToCart;\n if (!handler || this.cartState(product) === \"adding\") return;\n const id = product.id;\n const press = {};\n this.carts.set(id, { state: \"adding\", identity: cartIdentity(product), press });\n this.cdr.markForCheck();\n let pending: PromiseLike<unknown>;\n try {\n pending = Promise.resolve(handler(product));\n } catch (error) {\n pending = Promise.reject(error);\n }\n pending.then(\n () => this.settleCart(id, press, \"added\"),\n () => this.settleCart(id, press, null),\n );\n }\n\n private settleCart(id: string, press: object, state: CartState | null): void {\n const cart = this.carts.get(id);\n if (this.destroyed || cart?.press !== press) return;\n if (state) cart.state = state;\n else this.carts.delete(id);\n this.cdr.markForCheck();\n }\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 trackByProduct = (_: number, product: Product): string => product.id;\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 [attr.data-aia-loading]=\"loading ? '' : null\"\n [attr.data-aia-products-layout]=\"layout\"\n role=\"group\"\n [attr.aria-labelledby]=\"labelId\"\n>\n <!-- data-aia-products-label: the scroll arrow centres itself on this row. -->\n <div class=\"aia-products-label\" [id]=\"labelId\" data-aia-products-label=\"\">{{ strings.products }}</div>\n\n <!-- #row: the component binds wheel-to-sideways scrolling on it. -->\n <div #row 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. An attribute binding, so a\n product without a url gets no href at all rather than \"null\". -->\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 [attr.data-aia-product-sold-out]=\"product.available === false ? '' : null\"\n [attr.data-aia-product-has-cart]=\"hasCart(product) ? '' : null\"\n [attr.data-aia-product-state]=\"product.id === busyProductId ? 'busy' : null\"\n [attr.aria-busy]=\"product.id === busyProductId ? 'true' : null\"\n [style]=\"photoFillStyle(product)\"\n role=\"option\"\n [attr.aria-selected]=\"false\"\n [attr.href]=\"product.url ?? null\"\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 <span\n class=\"aia-product-media\"\n data-aia-product-media=\"\"\n aria-hidden=\"true\"\n [attr.data-aia-product-placeholder]=\"!imageSource(product) && imageFallback === 'image' ? '' : null\"\n [attr.data-aia-product-initial]=\"!imageSource(product) && imageFallback === 'initial' ? '' : null\"\n [attr.data-aia-image-loaded]=\"imageLoaded(product) ? '' : 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=\"imageSource(product) as src\"\n class=\"aia-product-image\"\n [src]=\"src\"\n (load)=\"onImageLoad(product, src, $event)\"\n (error)=\"onImageError(product)\"\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n <ng-container *ngIf=\"!imageSource(product) && imageFallback === 'initial'\">{{ initial(product.title) }}</ng-container>\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=\"showVendor && 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 }}<s *ngIf=\"product.compareAtPrice\" class=\"aia-product-compare-at\">{{ product.compareAtPrice }}</s></span>\n <!-- In the text column rather than the aria-hidden media tile, so the\n card's accessible name says it; the stylesheet lifts it over the\n image. -->\n <span *ngIf=\"product.available === false\" class=\"aia-product-badge\">{{ strings.soldOut }}</span>\n </span>\n\n <!-- The add-to-cart button: a child of the card rather than of the\n aria-hidden media tile; the stylesheet lifts it over the tile's\n bottom right corner. A role=\"button\" span, not a <button>:\n interactive content inside an <a> is invalid HTML. Its press never\n reaches the card, so it never selects. Sold-out cards have none. -->\n <span\n *ngIf=\"hasCart(product)\"\n class=\"aia-product-cart\"\n data-aia-product-cart=\"\"\n role=\"button\"\n [attr.aria-label]=\"strings.addToCart + ': ' + product.title\"\n [attr.tabindex]=\"focusable ? 0 : -1\"\n [attr.data-aia-cart-state]=\"cartState(product)\"\n [attr.aria-busy]=\"cartState(product) === 'adding' ? 'true' : null\"\n (click)=\"onCartPress($event, product)\"\n (keydown)=\"onCartKeyDown($event, product)\"\n (focus)=\"onCardFocus()\"\n (blur)=\"onCardBlur($event)\"\n >\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n <path class=\"aia-product-cart-glyph\" d=\"M2 3h2.2l2.4 11.2a2 2 0 0 0 2 1.6h8.9a2 2 0 0 0 1.9-1.5L21 8H6\" />\n <path class=\"aia-product-cart-glyph\" d=\"M13.5 6.5v-4M11.5 4.5h4\" />\n <path class=\"aia-product-cart-check\" d=\"M5 12.5l4.5 4.5L19 7.5\" />\n <path class=\"aia-product-cart-spinner\" d=\"M12 4a8 8 0 1 0 8 8\" />\n <circle class=\"aia-product-cart-glyph\" cx=\"9\" cy=\"20\" r=\"1.3\" />\n <circle class=\"aia-product-cart-glyph\" cx=\"17.5\" cy=\"20\" r=\"1.3\" />\n </svg>\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 host: { class: \"aia-grid-host\" },\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 formatOptionCount,\n highlightParts,\n isMultiSelectToggleTap,\n optionImageSources,\n optionLabel,\n type SuggestionOption,\n sanitizeOptionIconSvg,\n type TextPart,\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 * - Server-provided picture (`image_url`) as a square thumbnail in place of\n * the icon, and item count (`item_count`) at the row's trailing edge\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() checked?: boolean;\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 /** Whether to draw the option's `image_url` as a thumbnail before its text, in place of the icon. Default: true. */\n @Input() showImage = true;\n /** Whether to show the option's `item_count` at the row's trailing edge. Default: true. */\n @Input() showCount = 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 /**\n * A multi_select row was clicked on its text rather than its checkbox:\n * answer with the option right away instead of only ticking it.\n */\n @Output() readonly commitSelect = new EventEmitter<SuggestionOption>();\n /** The pointer entered this row. Carries the mouse event, as `unhighlight` does. */\n @Output() readonly highlight = new EventEmitter<MouseEvent>();\n /**\n * The pointer left this row. The owner clears the highlight if it is still\n * on this row: a hover highlight ends with the hover, so Enter afterwards\n * submits instead of picking a row the pointer is no longer on.\n */\n @Output() readonly unhighlight = new EventEmitter<MouseEvent>();\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 `src`s that failed to load: the row moves on to the next source (a\n * Shopify thumbnail falls back to the original), and the tile keeps its\n * placeholder fill once none is left.\n */\n private failedSrcs: readonly string[] = [];\n /** The `src` that last finished loading; the tile drops its fill for it. */\n private loadedSrc: string | null = null;\n\n /** The label split so the typed fragment's match can be drawn in bold. */\n get parts(): TextPart[] {\n return highlightParts(this.label, this.option.matchedText);\n }\n\n /** `parts` is rebuilt on every check, so its nodes are kept by position. */\n trackByIndex(index: number): number {\n return index;\n }\n\n /** The option's text. `icon` is the icon's name and is never shown as text. */\n get label(): string {\n return optionLabel(this.option);\n }\n\n /**\n * The picture's `src`, or `null` when the row draws none: images off, no\n * `image_url`, or one that is not an http(s) URL. A picture stands in for\n * the icon — a row never leads with two visuals.\n */\n get imageSrc(): string | null {\n const sources = this.imageSources;\n return (\n sources.find((src) => !this.failedSrcs.includes(src)) ?? sources[sources.length - 1] ?? null\n );\n }\n\n /** Whether every source of the picture failed to load (the tile's fill stays). */\n get imageFailed(): boolean {\n const sources = this.imageSources;\n return sources.length > 0 && sources.every((src) => this.failedSrcs.includes(src));\n }\n\n /** Whether the shown picture has loaded, so the placeholder fill steps aside. */\n get imageLoaded(): boolean {\n return !this.imageFailed && this.imageSrc !== null && this.loadedSrc === this.imageSrc;\n }\n\n onImageLoad(src: string): void {\n this.loadedSrc = src;\n this.cdr.markForCheck();\n }\n\n onImageError(): void {\n const src = this.imageSrc;\n if (src !== null && !this.failedSrcs.includes(src)) this.failedSrcs = [...this.failedSrcs, src];\n this.cdr.markForCheck();\n }\n\n /**\n * The pictures the All row's tile shows together (appearance.css lays out\n * `data-aia-collage`), or none for any other row, which shows one.\n */\n get collage(): string[] {\n if (!this.showImage) return [];\n const sources = (this.option.imageCollage ?? [])\n .map((url) => optionImageSources(url)[0])\n .filter((src): src is string => src !== undefined);\n return sources.length > 1 ? sources : [];\n }\n\n collageLoaded = false;\n\n onCollageLoad(): void {\n this.collageLoaded = true;\n this.cdr.markForCheck();\n }\n\n onCollageError(event: Event): void {\n (event.target as HTMLImageElement).hidden = true;\n }\n\n private get imageSources(): string[] {\n return this.showImage ? optionImageSources(this.option.image_url) : [];\n }\n\n /**\n * The count as printed (\"1,284\"), or `null` when the row shows none. The\n * unit word after it is the stylesheet's (`--aia-option-count-unit`).\n */\n get countLabel(): string | null {\n return this.showCount ? formatOptionCount(this.option.item_count) : null;\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.imageSrc ? 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 /** `event` is the click that picked the row; a key press passes none. */\n onSelect(event?: MouseEvent): void {\n if (this.loading || !this.option.is_tappable || (this.pressed && this.checked === undefined))\n return;\n this.pressed = true;\n this.cdr.markForCheck();\n const row = event?.currentTarget;\n const commit =\n this.checked !== undefined &&\n event !== undefined &&\n row instanceof HTMLElement &&\n !isMultiSelectToggleTap(row, row.querySelector(\".aia-checkbox\"), event);\n if (commit) this.commitSelect.emit(this.option);\n else 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(event: MouseEvent): void {\n if (this.loading || !this.option.is_tappable) return;\n this.highlight.emit(event);\n }\n\n onMouseLeave(event: MouseEvent): void {\n this.unhighlight.emit(event);\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.data-aia-image]=\"imageSrc ? '' : null\"\n [attr.data-aia-item-count]=\"countLabel !== null ? option.item_count : null\"\n [attr.aria-selected]=\"checked === undefined ? isHighlighted : checked\"\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-live-match]=\"option.liveMatch && !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($event)\"\n (keydown)=\"onKeyDown($event)\"\n (mouseenter)=\"onMouseEnter($event)\"\n (mouseleave)=\"onMouseLeave($event)\"\n>\n <span class=\"aia-suggestion-content\">\n <span *ngIf=\"checked !== undefined && option.is_tappable\" class=\"aia-checkbox\" aria-hidden=\"true\" [attr.data-checked]=\"checked\">{{ checked ? \"✓\" : \"\" }}</span>\n <!-- The tile keeps a placeholder fill until the picture loads, so a slow\n or failed load leaves a neutral square rather than a gap. The picture\n is decorative: the text is the option's accessible name. -->\n <span\n *ngIf=\"imageSrc && collage.length > 1\"\n class=\"aia-suggestion-image\"\n aria-hidden=\"true\"\n [attr.data-aia-collage]=\"collage.length\"\n [attr.data-aia-image-loaded]=\"collageLoaded ? '' : null\"\n >\n <img\n *ngFor=\"let src of collage\"\n [src]=\"src\"\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n referrerpolicy=\"no-referrer\"\n draggable=\"false\"\n (load)=\"onCollageLoad()\"\n (error)=\"onCollageError($event)\"\n />\n </span>\n <span\n *ngIf=\"collage.length <= 1 && imageSrc as src\"\n class=\"aia-suggestion-image\"\n aria-hidden=\"true\"\n [attr.data-aia-image-loaded]=\"imageLoaded ? '' : null\"\n >\n <img\n [src]=\"src\"\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n referrerpolicy=\"no-referrer\"\n draggable=\"false\"\n [hidden]=\"imageFailed\"\n (load)=\"onImageLoad(src)\"\n (error)=\"onImageError()\"\n />\n </span>\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\"\n ><ng-container *ngFor=\"let part of parts; trackBy: trackByIndex\"\n ><strong\n *ngIf=\"part.bold; else plain\"\n class=\"aia-suggestion-match\"\n [attr.data-aia-match-partial]=\"part.partial ? '' : null\"\n >{{ part.text }}</strong\n ><ng-template #plain>{{ part.text }}</ng-template></ng-container\n ><ng-container *ngIf=\"option.parameterLabel\"\n >{{ \" \" }}<span class=\"aia-suggestion-parameter\">{{ option.parameterLabel }}</span></ng-container\n ></span\n >\n <span *ngIf=\"option.tag\" class=\"aia-suggestion-tag\">{{ option.tag }}</span>\n <!-- Part of the row's accessible name, read after the option's text. -->\n <span *ngIf=\"countLabel !== null\" class=\"aia-suggestion-count\">{{ countLabel }}</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 NgZone,\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 optionsShowLeadingVisuals,\n planOptionsGrid,\n pointerMayHighlight,\n releasePanelHug,\n type SuggestionOption,\n sameOptionRows,\n syncHighlightScroll,\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() picked?: string[];\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 /** Whether rows draw their `image_url` as a thumbnail before the text. Default: true. */\n @Input() showImages = true;\n /** Whether rows show their `item_count` at the trailing edge. Default: true. */\n @Input() showCounts = true;\n\n /**\n * Icons and pictures are all-or-nothing across the list — no single row can\n * decide its own (see `optionsShowLeadingVisuals`).\n */\n get leadingVisuals(): boolean {\n return optionsShowLeadingVisuals(this.options, this.showIcons, this.showImages);\n }\n\n @Output() readonly select = new EventEmitter<SuggestionOption>();\n /** A multi_select row was clicked on its text: answer with it right away. */\n @Output() readonly commitSelect = new EventEmitter<SuggestionOption>();\n @Output() readonly highlight = new EventEmitter<number>();\n /** The pointer left option `index` — the dropdown clears a highlight still on it. */\n @Output() readonly unhighlight = new EventEmitter<number>();\n\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly zone = inject(NgZone);\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 * The rows the current plan was measured from. A skeleton mirroring them\n * keeps that plan — see `sameOptionRows`.\n */\n private measuredRows: SuggestionOption[] | null = null;\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 if (this.loading && sameOptionRows(this.measuredRows, this.options)) return;\n this.measuredRows = this.loading ? null : this.options;\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 /** The grid element, once the view has it. */\n private get gridElement(): HTMLDivElement | undefined {\n return this.gridComp?.gridRef?.nativeElement;\n }\n\n /**\n * The pointer entered row `index`. `pointerMayHighlight` marks the highlight\n * as the pointer's, so the list does not scroll for it, and refuses the\n * events a list scrolled by a key sends a resting cursor.\n */\n onRowHighlight(index: number, event: MouseEvent): void {\n if (pointerMayHighlight(this.gridElement, index, event)) this.highlight.emit(index);\n }\n\n /** The pointer left row `index`. */\n onRowUnhighlight(index: number, event: MouseEvent): void {\n if (pointerMayHighlight(this.gridElement, -1, event)) this.unhighlight.emit(index);\n }\n\n ngAfterViewChecked(): void {\n // A new plan lands in a microtask and the view is checked again: the\n // highlight is brought into view then, in the columns it will be shown in.\n if (this.measurePlan()) return;\n // A highlight the keyboard moved brings its row into view. After the\n // view update, so the grid's own scroll reset for a new group has run.\n // Outside the zone: the scroll runs on animation frames, and none of\n // them changes anything a binding reads. Skeleton rows show none.\n const grid = this.gridElement;\n if (!grid) return;\n const index = this.loading ? -1 : this.activeIndex;\n this.zone.runOutsideAngular(() => syncHighlightScroll(grid, index));\n }\n\n /**\n * Measure the rendered rows when the inputs changed, and schedule the plan\n * they give. True when a different plan is on its way.\n */\n private measurePlan(): boolean {\n if (!this.needsMeasure) return false;\n this.needsMeasure = false;\n const isMobile = isOptionsGridMobileViewport();\n const grid = this.gridElement;\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 // Measure at the panel's full width; the dropdown hugs it again after.\n const panel = grid?.closest<HTMLElement>(\"[data-aia-dropdown]\");\n if (shouldMeasure && panel) releasePanelHug(panel);\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 false;\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 return true;\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. So is the parameter: a smart suggestion offers one\n * text under several parameters (\"Shoes\" under Women type and Men type).\n */\n trackByOptionText = (_: number, opt: SuggestionOption): string =>\n `${this.groupKey}\\0${opt.parameter ?? \"\"}\\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 [checked]=\"picked ? picked.includes(option.text) : undefined\"\n [id]=\"listboxId + '-option-' + i\"\n [loading]=\"loading\"\n [showIcon]=\"showIcons && leadingVisuals\"\n [showImage]=\"showImages && leadingVisuals\"\n [showCount]=\"showCounts\"\n [scrollHint]=\"isScrollHint(i)\"\n [enterDelayMs]=\"enterDelayMs(i)\"\n (select)=\"select.emit($event)\"\n (commitSelect)=\"commitSelect.emit($event)\"\n (highlight)=\"onRowHighlight(i, $event)\"\n (unhighlight)=\"onRowUnhighlight(i, $event)\"\n ></aia-suggestion-item>\n</aia-grid>\n","import { CommonModule } from \"@angular/common\";\nimport {\n type AfterViewChecked,\n ChangeDetectionStrategy,\n Component,\n type ElementRef,\n EventEmitter,\n Input,\n type OnDestroy,\n Output,\n type QueryList,\n ViewChildren,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport {\n formatTime,\n TIME_WHEEL_COLUMNS,\n TIME_WHEEL_ROW_HEIGHT,\n type TimeView,\n type TimeWheelColumn,\n type TimeWheelRow,\n timeWheelIndex,\n timeWheelIndexFromScroll,\n timeWheelRows,\n withTimeWheelIndex,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\n\n/** How long a column's scroll must be still before the row it rests on counts. */\nconst SCROLL_SETTLE_MS = 120;\n\n/**\n * Per-column scroll bookkeeping. `syncedTop` is the offset this component last\n * scrolled the column to itself, so the scroll event that echoes it is not\n * mistaken for the user turning the wheel; `settle` is the pending read of a\n * scroll the user is still making.\n */\ninterface ColumnScroll {\n syncedTop: number | null;\n settle: ReturnType<typeof setTimeout> | null;\n}\n\n/**\n * The dropdown's time body, rendered in place of the options grid when the\n * active parameter is a time. Angular analogue of vanilla's `renderTimeWheel`\n * and React's `<TimeWheel>`: three wheels — hour, minutes in fives, AM/PM —\n * whose top rows read as the time, and a Done button.\n *\n * The wheels hold no time of their own. `view.minutes` is the time; turning a\n * wheel emits the new time and the next render scrolls every wheel to it. That\n * is what lets the keyboard (ArrowUp/ArrowDown in the input, handled by the\n * core) and the pointer move the same time.\n *\n * @internal\n */\n@Component({\n selector: \"aia-time-wheel\",\n standalone: true,\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n templateUrl: \"./time-wheel.component.html\",\n styleUrls: [\"./time-wheel.component.css\"],\n})\nexport class TimeWheelComponent implements AfterViewChecked, OnDestroy {\n /** The core's `timeView`: the time on the wheels' top rows. */\n @Input() view: TimeView | null = null;\n /** Accessible name for the wheel (\"Time\"). */\n @Input() label = \"\";\n /** Text of the button that answers with the time (\"Done\"). */\n @Input() doneLabel = \"\";\n /**\n * False for the press window after an answer: the answered pill's wheel is\n * still on screen and must not take a second answer.\n */\n @Input() interactive = true;\n\n /** The user turned a wheel; the value is the whole new time. Commits nothing. */\n @Output() readonly timeChange = new EventEmitter<number>();\n /** Done — answer the pill with the time on the wheels. */\n @Output() readonly commit = new EventEmitter<void>();\n\n @ViewChildren(\"wheelColumn\") wheelColumns?: QueryList<ElementRef<HTMLElement>>;\n\n readonly columns = TIME_WHEEL_COLUMNS;\n\n private readonly scroll = new Map<TimeWheelColumn, ColumnScroll>();\n\n get valueLabel(): string {\n return this.view ? formatTime(this.view.minutes) : \"\";\n }\n\n rowsOf(column: TimeWheelColumn): readonly TimeWheelRow[] {\n return timeWheelRows(column);\n }\n\n indexOf(column: TimeWheelColumn): number {\n return this.view ? timeWheelIndex(column, this.view.minutes) : -1;\n }\n\n /** Scroll each wheel so its chosen row is on top. Idempotent, so cheap to run on every check. */\n ngAfterViewChecked(): void {\n if (!this.view || !this.wheelColumns) return;\n for (const ref of this.wheelColumns) {\n const el = ref.nativeElement;\n const column = el.getAttribute(\"data-aia-time-column\") as TimeWheelColumn;\n const state = this.scrollStateOf(column);\n // Never yank a wheel the user is still turning: their scroll settles\n // into a time of its own.\n if (state.settle) continue;\n const top = timeWheelIndex(column, this.view.minutes) * TIME_WHEEL_ROW_HEIGHT;\n if (Math.abs(el.scrollTop - top) < 1) continue;\n state.syncedTop = top;\n el.scrollTop = top;\n }\n }\n\n ngOnDestroy(): void {\n for (const state of this.scroll.values()) {\n if (state.settle) clearTimeout(state.settle);\n }\n }\n\n onClick(event: MouseEvent): void {\n if (!this.interactive || !this.view) return;\n const target = event.target instanceof Element ? event.target : null;\n if (target?.closest(\"[data-aia-time-done]\")) {\n this.commit.emit();\n return;\n }\n const row = target?.closest<HTMLElement>(\"[data-aia-time-row]\");\n const column = row?.getAttribute(\"data-aia-time-column\") as TimeWheelColumn | null;\n if (!row || !column) return;\n const index = Number(row.getAttribute(\"data-aia-index\"));\n this.timeChange.emit(withTimeWheelIndex(column, this.view.minutes, index));\n }\n\n onScroll(column: TimeWheelColumn, event: Event): void {\n const el = event.target as HTMLElement;\n const state = this.scrollStateOf(column);\n if (state.syncedTop != null && Math.abs(el.scrollTop - state.syncedTop) < 1) {\n state.syncedTop = null;\n return;\n }\n state.syncedTop = null;\n if (state.settle) clearTimeout(state.settle);\n state.settle = setTimeout(() => this.settle(column, el), SCROLL_SETTLE_MS);\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 trackByColumn = (_: number, column: TimeWheelColumn): string => column;\n trackByRow = (_: number, row: TimeWheelRow): string => row.label;\n\n private settle(column: TimeWheelColumn, el: HTMLElement): void {\n this.scrollStateOf(column).settle = null;\n if (!this.interactive || !this.view) return;\n const index = timeWheelIndexFromScroll(column, el.scrollTop);\n if (index === timeWheelIndex(column, this.view.minutes)) return;\n this.timeChange.emit(withTimeWheelIndex(column, this.view.minutes, index));\n }\n\n private scrollStateOf(column: TimeWheelColumn): ColumnScroll {\n let state = this.scroll.get(column);\n if (!state) {\n state = { syncedTop: null, settle: null };\n this.scroll.set(column, state);\n }\n return state;\n }\n}\n","<!-- One click listener for the whole wheel (see onClick): the wheel appears\n when a response lands, and content that appears mid-tap carrying its own\n listeners cancels the tap on iOS. -->\n<div\n class=\"magicx-aia-time-wheel\"\n data-aia-time-wheel=\"\"\n role=\"group\"\n [attr.aria-label]=\"label\"\n (mousedown)=\"preventBlur($event)\"\n (click)=\"onClick($event)\"\n>\n <!-- The wheels are a pointer surface; keyboard users move the time from the\n input. So the columns are hidden from AT and the time is announced\n from here instead. -->\n <span class=\"magicx-aia-time-wheel-value\" data-aia-time-value=\"\" aria-live=\"polite\">{{\n valueLabel\n }}</span>\n <div class=\"magicx-aia-time-wheel-columns\" aria-hidden=\"true\">\n <div class=\"magicx-aia-time-wheel-band\"></div>\n <ng-container *ngFor=\"let column of columns; trackBy: trackByColumn\">\n <span *ngIf=\"column === 'minute'\" class=\"magicx-aia-time-wheel-separator\">:</span>\n <div\n #wheelColumn\n class=\"magicx-aia-time-wheel-column\"\n [attr.data-aia-time-column]=\"column\"\n (scroll)=\"onScroll(column, $event)\"\n >\n <div\n *ngFor=\"let row of rowsOf(column); let i = index; trackBy: trackByRow\"\n class=\"magicx-aia-time-wheel-row\"\n [class.magicx-aia-time-wheel-row--selected]=\"i === indexOf(column)\"\n data-aia-time-row=\"\"\n [attr.data-aia-time-column]=\"column\"\n [attr.data-aia-index]=\"i\"\n >\n {{ row.label }}\n </div>\n </div>\n </ng-container>\n </div>\n <!-- Out of the tab order, as the calendar's buttons are: Tab is bound to the\n dropdown, and Enter in the input already commits a moved wheel. -->\n <button type=\"button\" tabindex=\"-1\" class=\"magicx-aia-time-wheel-done\" data-aia-time-done=\"\">\n {{ doneLabel }}\n </button>\n</div>\n","import { CommonModule } from \"@angular/common\";\nimport {\n type AfterViewChecked,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n inject,\n NgZone,\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 attachViewportFit,\n buildAttributionUrl,\n containScroll,\n type DateMonthView,\n type DateSelection,\n dateFloorFor,\n destroyPanelMorph,\n findMultiSelectDone,\n fitMultiSelectDone,\n getFooterHint,\n hasSkippablePill,\n isCalendarFormat,\n type LocationView,\n labelTraditionalAutocomplete,\n type Product,\n type ProductImageFallback,\n type ProductsLayout,\n queryLive,\n type ScrollArrowController,\n type Suggestion,\n type SuggestionOption,\n settlePanelMorph,\n syncPanelHug,\n type TimeView,\n type UIStrings,\n uiStringsFor,\n type ViewportFitController,\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 { LocationFieldComponent } from \"../internal/location-field/location-field.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\";\nimport { TimeWheelComponent } from \"../internal/time-wheel/time-wheel.component\";\n\ninterface DropdownVm {\n pills: Suggestion[];\n options: SuggestionOption[];\n activeIndex: number;\n isActivePillSelected: boolean;\n isLoading: boolean;\n /** The loading skeleton is fading out before the response's options replace it. */\n skeletonExiting: 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 /** Whether the time wheel renders in place of the options grid. */\n showsTimeWheel: boolean;\n /** What the time wheel shows. Null unless `showsTimeWheel`. */\n timeView: TimeView | null;\n multiSelectView: { picked: string[] } | null;\n /** True for a location pill without options: the search field replaces the grid. */\n showsLocationField: boolean;\n /** What the location field shows. Null unless `showsLocationField`. */\n locationView: LocationView | null;\n /** Whether the widget has focus. */\n widgetFocused: boolean;\n /** True while a saved answer is re-edited: the location field then takes focus. */\n isReediting: boolean;\n showsFallbackSkeleton: boolean;\n isVisible: boolean;\n /** Product cards for the strip. Empty unless `products` is configured. */\n products: Product[];\n /** Whether the cards draw an add-to-cart button — the controller has a handler. */\n hasProductAddToCart: boolean;\n /** The product whose selection is in progress: its card shows a spinner. */\n busyProductId: string | null;\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 /** The words of the widget language. */\n strings: UIStrings;\n optionsPosition: \"above\" | \"below\";\n /** Whether option rows draw their `icon_svg` before the text. */\n showOptionIcons: boolean;\n /** Whether option rows draw their `image_url` as a thumbnail before the text. */\n showOptionImages: boolean;\n /** Whether option rows show their `item_count` at the trailing edge. */\n showOptionCounts: 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 TimeWheelComponent,\n LocationFieldComponent,\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 header row's trailing edge, across from the parameter label; a\n * skip-only row (`showPills` false) holds it alone at that edge too.\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 /**\n * Whether option rows draw their `image_url` as a square thumbnail before\n * the text, in place of the icon. Default: true. Set to false to render\n * option rows without pictures.\n */\n @Input() showOptionImages = true;\n /**\n * Whether option rows show their `item_count` as a muted label at the\n * trailing edge (\"12 items\"). Default: true. Set to false to hide the counts.\n */\n @Input() showOptionCounts = true;\n /**\n * How the product strip lays its cards out: a horizontally scrolling row\n * (the default), or the same cards stacked as full-width rows.\n */\n @Input() productsLayout: ProductsLayout = \"row\";\n /** Missing/failed image fallback. Style initials with `[data-aia-product-initial]`. */\n @Input() productImageFallback: ProductImageFallback = \"image\";\n /** When true (default), product cards draw the product's `vendor` as a line above the title. Set to false when your product titles already name the brand, so a card does not show it twice. */\n @Input() showProductVendor = 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 * The widget language. Tier 1 passes its own `language`.\n * UI languages: en, es, fr, pt-BR, it, tr, id, pl, de, nl, sv, nb, da, fi, ja, ko, zh-CN and zh-TW.\n * Only this input selects the UI language. Unsupported languages use English.\n */\n @Input() language?: string;\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 private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly zone = inject(NgZone);\n private releaseScroll?: () => void;\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 get scrollArrowLabel(): string {\n return uiStringsFor(this.language).scrollArrow;\n }\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 })\n private scrollArrowRef?: ElementRef<HTMLButtonElement>;\n /** The grid the scroll-arrow controller is currently bound to. */\n private viewportFitBinding: { root: HTMLElement; controller: ViewportFitController } | null =\n null;\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 // Same bridge, for `showOptionImages` and `showOptionCounts`.\n private readonly showOptionImages$ = new BehaviorSubject<boolean>(true);\n private readonly showOptionCounts$ = new BehaviorSubject<boolean>(true);\n // Same bridge, for `language`.\n private readonly language$ = new BehaviorSubject<string | undefined>(undefined);\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.showOptionImages$.next(this.showOptionImages);\n this.showOptionCounts$.next(this.showOptionCounts);\n this.language$.next(this.language);\n this.applyMode();\n this.initVm();\n // Wheel/touch over the dropdown never scrolls the page behind it. On the\n // host, so it survives the *ngIf root coming and going; outside the zone,\n // so a wheel gesture doesn't run change detection on every event.\n this.zone.runOutsideAngular(() => {\n this.releaseScroll = containScroll(this.host.nativeElement);\n });\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[\"showOptionImages\"]) {\n this.showOptionImages$.next(this.showOptionImages);\n }\n if (changes[\"showOptionCounts\"]) {\n this.showOptionCounts$.next(this.showOptionCounts);\n }\n if (changes[\"language\"]) {\n this.language$.next(this.language);\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 * The Done wrapper spans the panel but the button is only as wide as the\n * options, so commit only for a tap on the button itself, as vanilla and\n * React do. The listener stays on the wrapper because the button is\n * re-created and must carry none of its own.\n */\n onMultiDoneClick(event: Event, skipDisabled: boolean): void {\n if (skipDisabled) return;\n if (!(event.target as HTMLElement | null)?.closest(\"[data-aia-multi-done]\")) return;\n this.controller.commitMultiSelect();\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 done = findMultiSelectDone(this.host.nativeElement);\n if (done) {\n // Kept mounted, disabled, while the next step loads, so it fades out\n // with the options; armed (after a settle) once the panel is idle.\n // The dropdown root carries data-aia-loading while a request loads; keep Done disabled then.\n if (done.closest(\"[data-aia-loading]\")) done.disabled = true;\n else if (done.disabled) {\n void done.offsetHeight;\n done.disabled = false;\n }\n }\n fitMultiSelectDone(this.host.nativeElement, done);\n const root = this.dropdownRootRef?.nativeElement;\n // The panel hugs its options (the core's panelHugWidth.ts), before the\n // viewport fit and the morph measure it.\n if (root) syncPanelHug(root);\n this.syncViewportFit();\n this.syncPanelMorph(root);\n const button = this.scrollArrowRef?.nativeElement;\n const grid = root ? queryLive<HTMLElement>(root, \".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 if (this.morphRoot) destroyPanelMorph(this.morphRoot);\n this.morphRoot = null;\n this.teardownModeListener();\n this.releaseScroll?.();\n this.scrollArrowBinding?.controller.destroy();\n this.scrollArrowBinding = null;\n this.viewportFitBinding?.controller.destroy();\n this.viewportFitBinding = null;\n }\n\n private morphRoot: HTMLElement | null = null;\n\n /**\n * The open panel's height glide and question crossfade, shared with vanilla\n * and React (the core's panelMorph.ts). Keyed on the active pill's text, as\n * the other two packages key it. The crossfade's ghost is a node the core\n * appends to the root and removes itself; Angular's renderer never owns it.\n */\n private syncPanelMorph(root: HTMLElement | undefined): void {\n if (this.morphRoot && this.morphRoot !== root) destroyPanelMorph(this.morphRoot);\n this.morphRoot = root ?? null;\n if (!root) return;\n // The crossfade copy keeps the previous question's active pill; only the live panel counts.\n const pill = queryLive(root, \"[data-aia-pill-active]\");\n const key = pill?.textContent?.trim() || null;\n settlePanelMorph(root, key, {\n visible: root.classList.contains(\"magicx-aia-dropdown-visible\"),\n anchorBottom: root.getAttribute(\"data-options-position\") === \"above\",\n });\n }\n\n /**\n * Keep the open panel inside the visible viewport — above a phone's\n * keyboard — through the core's fit controller (see the core's\n * viewportFit.ts), which owns the measuring and the listeners. Re-measures\n * after each view check, re-attaching if the root element is replaced.\n */\n private syncViewportFit(): void {\n const root = this.dropdownRootRef?.nativeElement ?? null;\n if (this.viewportFitBinding && this.viewportFitBinding.root !== root) {\n this.viewportFitBinding.controller.destroy();\n this.viewportFitBinding = null;\n }\n if (!root) return;\n if (!this.viewportFitBinding) {\n this.viewportFitBinding = {\n root,\n // Outside the zone: its viewport and scroll listeners must not run\n // change detection on every scroll frame.\n controller: this.zone.runOutsideAngular(() =>\n attachViewportFit({\n dropdown: root,\n isOpen: () => root.classList.contains(\"magicx-aia-dropdown-visible\"),\n }),\n ),\n };\n return; // attach() runs the first update itself\n }\n this.viewportFitBinding.controller.update();\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 this.showOptionImages$,\n this.showOptionCounts$,\n this.language$,\n ]).pipe(\n map(\n ([\n dd,\n showPills,\n showSkipButton,\n showOptionIcons,\n showOptionImages,\n showOptionCounts,\n language,\n ]) => {\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 hasSkippablePill(dd.pills) && 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 // The time wheel and the location field are withheld while a request is\n // in flight, for the calendar's reasons above. Their pills have no\n // options by design, so it is the format — not the option count — that\n // says they show.\n const showsTimeWheel = dd.formatType === \"time\" && dd.timeView != null && !dd.isLoading;\n const showsLocationField =\n dd.formatType === \"location\" && dd.locationView != null && !dd.isLoading;\n const showsFallbackSkeleton =\n dd.isLoading &&\n !showsOptions &&\n !showsDateGrid &&\n !showsTimeWheel &&\n !showsLocationField;\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 ||\n showsDateGrid ||\n showsTimeWheel ||\n showsLocationField ||\n showsPills ||\n dd.isLoading ||\n 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, widgetFocused: false, isVisible: false };\n }\n\n const optionHighlighted =\n dd.activeIndex >= 0 && Boolean(options[dd.activeIndex]?.is_tappable);\n const strings = uiStringsFor(language);\n const pills = labelTraditionalAutocomplete(dd.pills, strings.keepTyping);\n const { key: footerKey, hint: footerHint } = getFooterHint(\n optionHighlighted,\n dd.isInputEmpty,\n strings,\n );\n const content: DropdownContent = {\n pills,\n options,\n activeIndex: dd.activeIndex,\n isActivePillSelected: dd.isActivePillSelected,\n isLoading: dd.isLoading,\n skeletonExiting: Boolean(dd.skeletonExiting),\n showsPills,\n showsSkip,\n skipDisabled: dd.isLoading || Boolean(dd.inSelectionAnimation),\n activePillLabel: 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 floor: dateFloorFor(dd.formatType, dd.dateRangeStart),\n references: dd.dateReferences ?? [],\n },\n showsTimeWheel,\n timeView: dd.timeView ?? null,\n multiSelectView: dd.multiSelectView ?? null,\n showsLocationField,\n locationView: dd.locationView ?? null,\n widgetFocused: Boolean(dd.isFocused),\n isReediting: Boolean(dd.isReediting),\n showsFallbackSkeleton,\n products: dd.products,\n hasProductAddToCart: Boolean(dd.hasProductAddToCart),\n busyProductId: dd.busyProductId ?? null,\n groupKey: activeSuggestion\n ? `${activeSuggestion.parameter} ${activeSuggestion.text}`\n : \"\",\n footerKey,\n footerHint,\n strings,\n optionsPosition: dd.optionsPosition,\n showOptionIcons,\n showOptionImages,\n showOptionCounts,\n };\n if (isVisible) this.lastVisibleContent = content;\n return { ...content, isVisible };\n },\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 onCommitSelect(option: SuggestionOption): void {\n this.controller.selectOption(option, { commit: true });\n }\n\n onPreviousMonth(): void {\n this.controller.showPreviousMonth();\n }\n\n onNextMonth(): void {\n this.controller.showNextMonth();\n }\n\n onTimeChange(minutes: number): void {\n this.controller.setTime(minutes);\n }\n\n onTimeCommit(): void {\n this.controller.commitTime();\n }\n\n onLocationQuery(query: string): void {\n this.controller.setLocationQuery(query);\n }\n\n onLocationMove(delta: number): void {\n this.controller.moveLocationHighlight(delta);\n }\n\n onLocationAnswer(index: number | undefined): void {\n this.controller.commitLocation(index);\n }\n\n /** The field taking focus blurs the input, which must not close the panel it lives in. */\n onLocationFocusChange(focused: boolean): void {\n this.controller.setLocationFieldFocused(focused);\n }\n\n onHighlight(index: number): void {\n this.controller.setActiveDropdownIndex(index);\n }\n\n // A hover highlight ends with the hover — see the core's `clearHighlight`.\n onUnhighlight(index: number): void {\n this.controller.clearHighlight(index);\n }\n\n onProductSelect(product: Product): void {\n this.controller.selectProduct(product);\n }\n\n /**\n * The strip's cart buttons. A stable arrow reading the current controller,\n * so the strip's input doesn't change on every pass.\n */\n readonly addProductToCart = (product: Product): Promise<void> =>\n this.controller.addProductToCart(product);\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 [attr.aria-multiselectable]=\"!!vm.multiSelectView\"\n data-aia-dropdown=\"\"\n [attr.data-aia-loading]=\"vm.isLoading ? '' : null\"\n [attr.data-aia-skeleton-exiting]=\"vm.skeletonExiting ? '' : 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]=\"\n vm.activePillLabel ? vm.strings.skipLabel + ' ' + vm.activePillLabel : vm.strings.skipLabel\n \"\n (click)=\"onSkip()\"\n >\n {{ vm.strings.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 [showImages]=\"vm.showOptionImages\"\n [showCounts]=\"vm.showOptionCounts\"\n [picked]=\"vm.multiSelectView?.picked\"\n (select)=\"onSelect($event)\"\n (commitSelect)=\"onCommitSelect($event)\"\n (highlight)=\"onHighlight($event)\"\n (unhighlight)=\"onUnhighlight($event)\"\n ></aia-suggestion-grid>\n\n <div *ngIf=\"vm.multiSelectView\" data-aia-multi-actions=\"\" (click)=\"onMultiDoneClick($event, vm.skipDisabled || vm.isLoading)\">\n <button type=\"button\" tabindex=\"-1\" disabled data-aia-multi-done=\"\" class=\"magicx-aia-multi-done\">{{ vm.strings.done }}</button>\n </div>\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 (unhighlight)=\"onUnhighlight($event)\"\n (previousMonth)=\"onPreviousMonth()\"\n (nextMonth)=\"onNextMonth()\"\n ></aia-date-grid>\n\n <aia-time-wheel\n *ngIf=\"vm.showsTimeWheel\"\n [view]=\"vm.timeView\"\n [label]=\"vm.strings.timeLabel\"\n [doneLabel]=\"vm.strings.done\"\n [interactive]=\"!vm.skipDisabled\"\n (timeChange)=\"onTimeChange($event)\"\n (commit)=\"onTimeCommit()\"\n ></aia-time-wheel>\n <aia-location-field\n *ngIf=\"vm.showsLocationField\"\n [view]=\"vm.locationView\"\n [searchLabel]=\"vm.strings.locationSearch\"\n [noResultsLabel]=\"vm.strings.locationNoResults\"\n [useTypedLabel]=\"vm.strings.locationUseTyped\"\n [widgetFocused]=\"vm.widgetFocused && vm.isVisible\"\n [reediting]=\"vm.isReediting\"\n [visible]=\"vm.isVisible\"\n [interactive]=\"!vm.skipDisabled\"\n (query)=\"onLocationQuery($event)\"\n (move)=\"onLocationMove($event)\"\n (answer)=\"onLocationAnswer($event)\"\n (focusChange)=\"onLocationFocusChange($event)\"\n ></aia-location-field>\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 && !vm.isLoading\"\n [loading]=\"vm.isLoading\"\n [layout]=\"productsLayout\"\n [imageFallback]=\"productImageFallback\"\n [showVendor]=\"showProductVendor\"\n [strings]=\"vm.strings\"\n [addToCart]=\"vm.hasProductAddToCart ? addProductToCart : null\"\n [busyProductId]=\"vm.busyProductId\"\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-badge\">\n <span class=\"magicx-aia-footer-brand\">Powered by Intent-1</span>\n </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=\"18\"\n height=\"18\"\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 type CustomFieldsReport,\n dateSelectionFor,\n dropdownPillsFor,\n editingSuggestion,\n type IdentifiedParamState,\n identifiedParamLabel,\n type Product,\n type Segment,\n type SelectOptionOptions,\n type SkippedParamState,\n type Suggestion,\n type SuggestionOption,\n withoutTraditionalAutocomplete,\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 // The add-to-cart handler lives here rather than in the core, so update()\n // can swap or remove it (the core takes it once); the core gets a forwarder.\n // Whether one is set folds into `dropdown$`, which draws the buttons off it.\n private productAddToCart: AIAutocompleteControllerOptions[\"onProductAddToCart\"];\n private readonly hasProductAddToCart$ = new BehaviorSubject<boolean>(false);\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 * What the product strip shows: the items the latest `/suggest` response\n * reported as matching the query, or — with `products` configured on the\n * controller — the results of that custom search.\n */\n readonly products$: Observable<Product[]>;\n /**\n * The catalog grounding report the latest response carried, or null when it\n * carried none: which of the query's constraints the catalog applied, which\n * it dropped, and how many items (and which) the applied ones left\n * standing. Null is \"no news\", not an empty catalog.\n */\n readonly customFields$: Observable<CustomFieldsReport | null>;\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 /**\n * A submit is in progress: it was handed to the integration and the page it\n * opens has not taken over yet. The submit button shows a spinner and Enter\n * is ignored; skip your own button's submit while it is true. It ends when\n * the input changes, when the shopper presses or types somewhere else,\n * when the page is shown again from the back/forward cache, on\n * `endSubmitProgress()`, when a promise given to `holdSubmit()` settles, or\n * after 8 seconds.\n */\n readonly isSubmitting$: 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 const { onProductAddToCart, ...coreOpts } = opts;\n this.productAddToCart = onProductAddToCart;\n this.hasProductAddToCart$.next(typeof onProductAddToCart === \"function\");\n\n this.core = new CoreAIAutocomplete(host, {\n ...coreOpts,\n onProductAddToCart: (product) => this.productAddToCart?.(product),\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(\n this.rawState$,\n (s) => withoutTraditionalAutocomplete(s.actionableSuggestions),\n arrEq,\n );\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.customFields$ = deriveField(this.rawState$, (s) => s.customFields);\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.isSubmitting$ = deriveField(this.rawState$, (s) => s.isSubmitting);\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([\n this.rawState$,\n this.optionsPosition$,\n this.hasProductAddToCart$,\n ]).pipe(\n map(([s, optionsPosition, hasCart]) => computeDropdown(s, optionsPosition, hasCart)),\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 /**\n * Prepare the typed word before you build a submit result from your own button.\n * A typed value with no pill yet joins `identifiedParams` only in this call. Read `getState()` after it.\n */\n prepareSubmit(): void {\n if (this.isDestroyed) return;\n this.core.prepareSubmit();\n }\n\n /**\n * The result to submit from your own button, with `custom_fields` that\n * answer it: prepares the submit as `prepareSubmit()` does, then waits for\n * the answer to the query when the stored one is for another, for up to\n * `submitAnswerTimeoutMs`, with `isSubmitting$` true meanwhile. Resolves\n * without a `custom_fields` key when no answer came, and to null when there\n * is nothing to submit (the input changed while it waited, or a submit is\n * already in progress).\n */\n awaitSubmitResult(): Promise<AutocompleteResult | null> {\n if (this.isDestroyed) return Promise.resolve(null);\n return this.core.awaitSubmitResult();\n }\n\n /**\n * Records a submit in telemetry. Enter is recorded by the SDK; call this\n * from a submit button you render, so each submit is counted once.\n */\n recordSubmit(result: AutocompleteResult): void {\n if (this.isDestroyed) return;\n this.core.recordSubmit(result);\n }\n\n /**\n * Marks a submit you ran from your own button as in progress\n * (`isSubmitting$`): call it right after you hand the submit on. A promise\n * passed in ends it when it settles; otherwise it ends when the input\n * changes, when the page is shown again from the back/forward cache, or\n * after 8 seconds. Enter is marked by the SDK.\n */\n holdSubmit(returned?: unknown): void {\n if (this.isDestroyed) return;\n this.core.holdSubmit(returned);\n }\n\n /**\n * Ends whatever is in progress, a submit or a product selection, at once:\n * call it when the work your handler started is done and the shopper is\n * still on the page (a quick view opened, inline results drawn).\n */\n endSubmitProgress(): void {\n if (this.isDestroyed) return;\n this.core.endSubmitProgress();\n }\n\n /**\n * The search in progress, to send with your own events from it. Undefined\n * until the feature is enabled for your account. Read it in your submit or\n * product handler: the shopper's next input starts another search.\n */\n getSearchId(): string | undefined {\n if (this.isDestroyed) return undefined;\n return this.core.getSearchId();\n }\n\n /**\n * The visitor id the events carry right now, to send with your own events.\n * Undefined while there is none: before the first response, or without\n * `visitorId` and without consent.\n */\n getVisitorId(): string | undefined {\n if (this.isDestroyed) return undefined;\n return this.core.getVisitorId();\n }\n\n /**\n * Reads `analyticsConsent` again now. Call it when the visitor changes their\n * choice, so a declined one removes the stored id at once.\n */\n refreshAnalyticsConsent(): void {\n if (this.isDestroyed) return;\n this.core.refreshAnalyticsConsent();\n }\n\n /**\n * Pick a dropdown option (or replace the re-edited param if in re-edit mode).\n * In a multi_select question this ticks the option; pass `{ commit: true }`\n * to answer with it right away instead.\n */\n selectOption(option: SuggestionOption, how?: SelectOptionOptions): void {\n if (this.isDestroyed) return;\n this.core.selectOption(option, how);\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 /**\n * Add a product to the cart through `onProductAddToCart`.\n * `<ai-autocomplete-dropdown>`'s cart buttons call this for you; consumers\n * rendering their own strip call it themselves. Resolves once the handler's\n * promise settles and rejects with its error. Without a handler it does\n * nothing.\n */\n addProductToCart(product: Product): Promise<void> {\n if (this.isDestroyed || !this.productAddToCart) return Promise.resolve();\n return this.core.addProductToCart(product);\n }\n\n /** Whether cards draw a cart button: an `onProductAddToCart` handler is set. */\n hasProductAddToCart(): boolean {\n return typeof this.productAddToCart === \"function\";\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 the editor text while an IME composes. Only completions for the word are shown. */\n handleCompositionText(value: string): void {\n if (this.isDestroyed) return;\n this.core.handleCompositionText(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 /**\n * Whether a pick puts focus in the field (`focusInputOnSelect`): by default\n * yes where the pointer hovers, no on a touch device.\n */\n focusesInputOnSelect(): boolean {\n return this.isDestroyed ? false : this.core.focusesInputOnSelect();\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 /** Remove the chip (completed or identified) with the given id (the chip's \"×\", `showChipRemove`); the same result as Backspace at the chip's trailing edge. Returns false when no chip has that id. */\n removeParam(paramId: string): boolean {\n if (this.isDestroyed) return false;\n return this.core.removeParam(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 /**\n * The pointer left option `index`: clear the highlight if it is still on it,\n * so Enter afterwards submits instead of picking an option the pointer is no\n * longer on. A highlight the keyboard has since moved is left alone.\n */\n clearHighlight(index: number): void {\n if (this.isDestroyed) return;\n this.core.clearHighlight(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 /**\n * Turn the time wheel to `minutes` past midnight, snapped to its 5-minute\n * step. Commits nothing. No-op unless a time pill is active.\n */\n setTime(minutes: number): void {\n if (this.isDestroyed) return;\n this.core.setTime(minutes);\n }\n\n /** Answer the active time pill with the time on the wheel. No-op unless a time pill is active. */\n toggleMultiSelectOption(option: SuggestionOption): void {\n if (this.destroyed) return;\n this.core.toggleMultiSelectOption(option);\n }\n\n commitMultiSelect(): void {\n if (this.destroyed) return;\n this.core.commitMultiSelect();\n }\n\n commitTime(): void {\n if (this.isDestroyed) return;\n this.core.commitTime();\n }\n\n /**\n * Set the text of the location search field, which searches the server's\n * location search after a short pause. No-op unless a location pill (a\n * location parameter without options) is active.\n */\n setLocationQuery(query: string): void {\n if (this.isDestroyed) return;\n this.core.setLocationQuery(query);\n }\n\n /** Move the highlight through the location results (ArrowDown / ArrowUp in the field). */\n moveLocationHighlight(delta: number): void {\n if (this.isDestroyed) return;\n this.core.moveLocationHighlight(delta);\n }\n\n /**\n * Answer the active location pill: with the place at `index`, else the\n * highlighted place, else the typed text as written.\n */\n commitLocation(index?: number): void {\n if (this.isDestroyed) return;\n this.core.commitLocation(index);\n }\n\n /**\n * Report that the location field holds focus (or is about to take it), so\n * the input's blur doesn't close the panel the field lives in.\n */\n setLocationFieldFocused(focused: boolean): void {\n if (this.isDestroyed) return;\n this.core.setLocationFieldFocused(focused);\n }\n\n /**\n * Runs mapProducts synchronously on the shown items again without a request.\n * Keeps the same cards while updating their content.\n * Does nothing without mapProducts or with a custom products integration.\n */\n refreshProducts(): void {\n if (this.isDestroyed) return;\n this.core.refreshProducts();\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`). The exception is\n * `onProductAddToCart`, a handler rather than an event: passing the key sets,\n * swaps or (with `undefined`) removes it, and the cart buttons follow.\n */\n update(opts: AIAutocompleteControllerUpdate): void {\n if (this.isDestroyed) return;\n const { onProductAddToCart, ...coreOpts } = opts;\n if (\"onProductAddToCart\" in opts) {\n this.productAddToCart = onProductAddToCart;\n this.hasProductAddToCart$.next(typeof onProductAddToCart === \"function\");\n }\n this.core.update(coreOpts);\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/** UI-visible loading — the core's `dropdownLoading` (see its docs). */\nfunction computeUiLoading(s: CoreState): boolean {\n return s.dropdownLoading;\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: withoutTraditionalAutocomplete(s.actionableSuggestions),\n segments: s.segments,\n newParamId: s.newParamId,\n suggestions: s.suggestions,\n products: s.products,\n customFields: s.customFields,\n activeIndex: s.activeDropdownIndex,\n isLoading: computeUiLoading(s),\n isReady: s.isReady,\n isSubmitting: s.isSubmitting,\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 hasProductAddToCart: boolean,\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 ? editingSuggestion(editingParam)\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 parameter: editingIdentified.parameter,\n text: identifiedParamLabel(editingIdentified.parameter),\n required: true,\n options: [],\n }\n : null;\n const dropdownActivePill = s.dropdownSuggestion ?? dropdownPill ?? activeSuggestion;\n const dropdownPills = dropdownPillsFor(\n s.dropdownSuggestion,\n dropdownPill,\n s.actionableSuggestions,\n );\n return {\n suggestions: dropdownActivePill ? [{ ...dropdownActivePill, options: s.dropdownOptions }] : [],\n activeIndex: s.activeDropdownIndex,\n isOpen: s.isDropdownOpen,\n pills: dropdownPills,\n isActivePillSelected: s.isActivePillSelected,\n isLoading: computeUiLoading(s),\n skeletonExiting: s.skeletonExiting,\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 dateReferences: dateSelection.references,\n // Time wheel. As for a calendar, `s.filteredOptions` is empty — the wheel\n // is drawn from `timeView`, not from the suggestion's options.\n timeView: s.timeView,\n multiSelectView: s.dropdownMultiSelect,\n // Location search, for a location parameter without options. The field\n // lives in the dropdown; the caret stays in the input unless a saved\n // location is re-edited, when the field takes focus with it selected.\n locationView: s.locationView,\n isReediting: s.editingParam != null,\n isFocused: s.isFocused || s.locationFieldFocused,\n optionsPosition,\n hasProductAddToCart,\n busyProductId: s.selectingProductId,\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 attachChipRemove,\n cancelStartingHint,\n chipIdFromTap,\n extractPlainText,\n getCursorOffset,\n keepCaretOnChip,\n plainTextLength,\n renderEditableContent,\n setCursorOffset,\n settlePickFocus,\n startingHintOptions,\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 \"(click)\": \"onClick($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 /** Whether completed chips draw the picture of the option that answered them, in place of the icon. Default: true. */\n @Input() showChipImages = true;\n /** Whether chips (completed and identified) end in a faint \"×\" that removes them. Default: false. */\n @Input() showChipRemove = false;\n /** Pills drawn inline beside the text replace the empty-box hint. */\n @Input() showInlinePills = false;\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 private detachChipRemove?: () => void;\n private chipRemoveReady = false;\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.chipRemoveReady = true;\n this.syncChipRemove();\n this.bindStateSubscription();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const toggled =\n (changes[\"showChipIcons\"] ??\n changes[\"showChipImages\"] ??\n changes[\"showChipRemove\"] ??\n changes[\"showInlinePills\"]) !== undefined;\n const first =\n changes[\"showChipIcons\"]?.firstChange ??\n changes[\"showChipImages\"]?.firstChange ??\n changes[\"showChipRemove\"]?.firstChange ??\n changes[\"showInlinePills\"]?.firstChange;\n if (changes[\"showChipRemove\"]) this.syncChipRemove();\n if (toggled && !first && this.lastState) {\n this.renderEditor(this.lastState);\n }\n }\n\n /**\n * The chips' \"×\" (showChipRemove): the listeners shared with the vanilla and\n * React editors, attached only while the option is on.\n */\n private syncChipRemove(): void {\n if (!this.chipRemoveReady) return;\n if (this.showChipRemove === (this.detachChipRemove !== undefined)) return;\n this.detachChipRemove?.();\n this.detachChipRemove = this.showChipRemove\n ? this.zone.runOutsideAngular(() =>\n attachChipRemove(this.el.nativeElement, (id) =>\n this.zone.run(() => this.controller.removeParam(id)),\n ),\n )\n : undefined;\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 showChipImages: this.showChipImages,\n showChipRemove: this.showChipRemove,\n hintOptions: this.showInlinePills ? [] : startingHintOptions(state.suggestionPills),\n });\n }\n\n ngOnDestroy(): void {\n cancelStartingHint(this.el.nativeElement);\n this.destroy$.next();\n this.destroy$.complete();\n this.detachChipRemove?.();\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 /**\n * A tap on a chip opens *that* chip. Touch browsers place the caret where\n * they see fit (iOS snaps it to a word boundary, and the focusing tap often\n * parks it at the end of the text — inside the last chip when the input ends\n * with one), so the selectionchange path can miss the tapped chip or open\n * the wrong one. The click target is the element actually hit and overrides\n * it; `keepCaretOnChip` then pulls a stray caret onto the tapped chip so the\n * next selectionchange doesn't close or redirect what the tap opened.\n */\n onClick(event: MouseEvent): void {\n const el = this.el.nativeElement;\n const id = chipIdFromTap(el, event.target);\n if (!id) return;\n this.controller.startEditingParam(id);\n keepCaretOnChip(el, id);\n }\n\n onCompositionStart(): void {\n this.composing = true;\n this.el.nativeElement.setAttribute(\"data-aia-composing\", \"true\");\n }\n\n onCompositionEnd(): void {\n this.composing = false;\n this.el.nativeElement.removeAttribute(\"data-aia-composing\");\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 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 // While composing, the core only previews the text.\n if (this.composing) {\n this.controller.handleCompositionText(next);\n return;\n }\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). Where a pick leaves the editor\n // unfocused (a touch device by default), see `settlePickFocus`.\n const currentParamId = state.newParamId ?? \"\";\n if (currentParamId && currentParamId !== this.lastSeenParamId) {\n this.lastSeenParamId = currentParamId;\n const desired = state.caretOffset ?? plainTextLength(el);\n settlePickFocus(el, desired, this.controller.focusesInputOnSelect());\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\";\nimport { uiStringsFor } from \"@magicx-eng/ai-autocomplete-vanilla\";\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 /** The request is complete: the button lights up to invite the submit. */\n @Input() ready = false;\n /**\n * A submit is in progress: the arrow gives way to a spinner. The button\n * stays enabled, so focus stays where it is; the submit ignores a press.\n */\n @Input() busy = false;\n /** The accessible name. Default: the English word. */\n @Input() label = uiStringsFor().submit;\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 [attr.data-aia-ready]=\"ready ? '' : null\"\n [attr.data-aia-submit-state]=\"busy ? 'busy' : null\"\n [attr.aria-busy]=\"busy ? 'true' : null\"\n [attr.aria-label]=\"label\"\n (click)=\"onClick($event)\"\n>\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" role=\"img\" [attr.aria-label]=\"label\">\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 type CoreOptions,\n type CurrencyOptions,\n extractPlainText,\n focusEditorFromTap,\n HANDOFF_NOT_HANDLED,\n ModeController,\n type OptionOverrides,\n type Product,\n type ProductImageFallback,\n type ProductsConfig,\n type ProductsLayout,\n setCursorOffset,\n uiStringsFor,\n watchEditorHeight,\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 /**\n * BCP 47 language tag (e.g. `\"es\"`), sent with every suggestion request.\n * Default: the browser language (`navigator.language`), else `\"en-US\"`.\n */\n @Input() language?: string;\n /** Sends currency context with suggestions when the code and a finite positive rate are set. */\n @Input() currency?: CurrencyOptions;\n /**\n * Your product id. When set, what the dropdown offers before anything is\n * typed is read from a cacheable URL for your product, with no credential,\n * instead of a suggestion request; it falls back to a suggestion request\n * when it cannot be read.\n */\n @Input() productId?: string;\n /**\n * Stable id for this visitor, kept by the host across page loads. Rides on\n * telemetry events so searches can be joined to what the visitor does\n * afterwards. Must be a UUID v4; omit to send none. A function is called\n * only once the server has funnel telemetry on.\n */\n @Input() visitorId?: string | (() => string | undefined);\n /**\n * Whether the visitor allowed analytics: `true`, `false`, or a function\n * returning either, or `undefined` while they have not answered. Once\n * allowed, and while the feature is enabled for your account, a site that\n * passes no `visitorId` gets one kept in the first-party cookie `aia_vid`\n * (a UUID v4, one year, renewed on use). Declined, that cookie is removed.\n * Omit it and the SDK never touches the cookie. Ignored when `visitorId` is\n * passed.\n */\n @Input() analyticsConsent?: boolean | (() => boolean | undefined);\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 /**\n * The options box's look and motion. Default `\"floating\"`: no stroke, sized\n * to the text, and it dissolves in where it sits and glides between\n * questions. `\"classic\"` brings back the earlier stroke, size and motion:\n * it unfolds out of the input with a stroke, at full size. The new header\n * layout stays.\n */\n @Input() optionsStyle: \"floating\" | \"classic\" = \"floating\";\n @Input() dropdownTrigger?: \"auto\" | \"manual\" | \"hidden\";\n @Input() closeDropdownOnBlur?: boolean;\n /** Whether a pick puts focus in the input. Default `\"auto\"`: on a desktop, not on a touch device. */\n @Input() focusInputOnSelect?: \"auto\" | \"always\" | \"never\";\n /** `false` requests and shows nothing while the input is empty; typed text works as usual. Default: true. */\n @Input() startingState?: boolean;\n @Input() prependPlaceholder?: boolean;\n @Input() showNonTappableOptions?: boolean;\n /**\n * When true, a plain question of two or more options past the starting\n * state leads with an All option; picking it skips the question. Default false.\n */\n @Input() allOption?: boolean;\n /**\n * When true (default), a location parameter without options searches the\n * server's location search as the user types in its field. Set to false to\n * take typed text only.\n */\n @Input() locationSearch?: 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), an option that carries an `image_url` draws it as a square thumbnail before its text in the dropdown (in place of its `icon_svg`). Set to false to render option rows without pictures. */\n @Input() showOptionImages = true;\n /** When true (default), an option that carries an `item_count` shows it as a muted label at the row's trailing edge (\"12 items\"). Set to false to hide the counts. */\n @Input() showOptionCounts = true;\n /**\n * How the product strip lays its cards out. `\"row\"` (the default) is a\n * horizontally scrolling shelf of cards. `\"list\"` stacks the same cards as\n * full-width rows — thumbnail on the left, title, vendor and price on the\n * right — for results that read as a list (courses, listings, documents)\n * rather than products on a shelf; the column scrolls vertically inside\n * `--aia-product-list-max-height`.\n */\n @Input() productsLayout: ProductsLayout = \"row\";\n /** Missing/failed image fallback. Style initials with `[data-aia-product-initial]`. */\n @Input() productImageFallback: ProductImageFallback = \"image\";\n /** When true (default), product cards draw the product's `vendor` as a line above the title. Set to false when your product titles already name the brand, so a card does not show it twice. */\n @Input() showProductVendor = 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 /** When true (default), a completed chip in the input draws the picture (`image_url`) of the option that answered it, in place of its icon. Set to false to render chips without pictures. */\n @Input() showChipImages = true;\n /** When true, every chip in the input (completed, or identified by the server in typed text) ends in a small, faint \"×\" that removes the chip in one tap (the same result as Backspace at the chip's trailing edge). Default: false. */\n @Input() showChipRemove = false;\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 * When true (default), the dropdown renders a horizontal row of product\n * cards below the options grid whenever it has products to show: by default\n * the items the `/suggest` response reports as matching the query, or the\n * results of a custom `products` search. Set to false to render no strip\n * and run no custom search.\n */\n @Input() showProducts = true;\n /**\n * When true (default), a submit and a product card tap show that they took\n * while the page they open loads: the submit controls and the tapped card\n * show a spinner, and a repeat of the same tap is ignored until it is over\n * (a promise the handler returned settles, the input changes, the shopper\n * presses or types somewhere else, the page is shown again from the\n * back/forward cache, or 8 seconds pass). Set to false to turn\n * all of it off: nothing is marked, and every press emits.\n */\n @Input() submitProgress = true;\n /**\n * When true, a submit (Enter, the submit button) whose `custom_fields` do\n * not answer the submitted query first gets the full answer for it, then\n * emits `submitted` with that answer's `custom_fields`. The submit shows as\n * in progress while it waits, a second submit is ignored, and typing,\n * tapping or pressing elsewhere cancels it without emitting. After\n * `submitAnswerTimeoutMs`, or when the request fails, `submitted` emits\n * once with no `custom_fields` key: treat a missing block as \"no filters\n * known\". Default: false, where `submitted` emits at once and a block that\n * does not answer the query is marked `custom_fields_stale: true`.\n */\n @Input() awaitAnswerOnSubmit = false;\n /** The longest a submit waits for its answer, in milliseconds. Default: 2500. */\n @Input() submitAnswerTimeoutMs?: number;\n /**\n * Custom source for the product strip. Omit it and the strip shows the\n * items the `/suggest` response itself reports as matching the query, with\n * no extra request. Set it and the dropdown is fed by your own search\n * endpoint on the SDK's existing fetch cadence instead; the server's items\n * are then not rendered.\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 @Input() mapProducts?: CoreOptions[\"mapProducts\"];\n /**\n * Adds a product to the cart from its card. When set, every card that isn't\n * sold out (`available: false`) shows an add-to-cart button in the bottom\n * right corner of its image; when unset, no card has one. Pressing the button\n * calls this, not `productSelect`, and the panel stays open. The SDK never\n * touches a cart itself.\n *\n * An input rather than an output because its result matters: return a\n * promise to have the button show progress. It carries\n * `data-aia-cart-state=\"adding\"` until the promise settles, then `\"added\"`\n * if it resolved. `\"added\"` stays until the card's product changes; pressing\n * again adds another unit (adding → added again). A rejection puts the\n * button back at rest.\n */\n @Input() onProductAddToCart?: (product: Product) => void | PromiseLike<unknown>;\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 * When true (default), the editor is cleared and a new session starts after\n * `submitted` emits — on Enter and on the submit button. Set to false to\n * leave the query in place: when the handler navigates away, a cleared field\n * flashes empty until the next page paints. Call `reset()` yourself when you\n * want a fresh session.\n */\n @Input() resetOnSubmit = true;\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 @ViewChild(\"editorArea\", { static: true }) editorAreaRef!: ElementRef<HTMLDivElement>;\n private stopEditorHeight?: () => void;\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 language: this.language,\n currency: this.currency,\n productId: this.productId,\n visitorId: this.visitorId,\n analyticsConsent: this.analyticsConsent,\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 focusInputOnSelect: this.focusInputOnSelect,\n startingState: this.startingState,\n prependPlaceholder: this.prependPlaceholder,\n showNonTappableOptions: this.showNonTappableOptions,\n allOption: this.allOption,\n locationSearch: this.locationSearch,\n showProducts: this.showProducts,\n submitProgress: this.submitProgress,\n awaitAnswerOnSubmit: this.awaitAnswerOnSubmit,\n submitAnswerTimeoutMs: this.submitAnswerTimeoutMs,\n source: \"full-sdk\",\n products: this.products,\n mapProducts: this.mapProducts,\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 // Registered whatever is bound to the output, so say when nothing is:\n // a tap that opens nothing must not be marked in progress.\n onProductSelect: (product) =>\n this.productSelect.observed\n ? this.productSelect.emit(product)\n : (HANDOFF_NOT_HANDLED as unknown as undefined),\n onProductAddToCart: this.onProductAddToCart,\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 // A new line opens smoothly instead of popping in (see watchEditorHeight).\n this.zone.runOutsideAngular(() => {\n this.stopEditorHeight = watchEditorHeight(this.editorAreaRef.nativeElement);\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[\"language\"] ||\n changes[\"currency\"] ||\n changes[\"productId\"] ||\n changes[\"visitorId\"] ||\n changes[\"analyticsConsent\"] ||\n changes[\"optionOverrides\"] ||\n changes[\"dropdownTrigger\"] ||\n changes[\"optionsPosition\"] ||\n changes[\"closeDropdownOnBlur\"] ||\n changes[\"focusInputOnSelect\"] ||\n changes[\"startingState\"] ||\n changes[\"prependPlaceholder\"] ||\n changes[\"showNonTappableOptions\"] ||\n changes[\"allOption\"] ||\n changes[\"locationSearch\"] ||\n changes[\"showProducts\"] ||\n changes[\"submitProgress\"] ||\n changes[\"awaitAnswerOnSubmit\"] ||\n changes[\"submitAnswerTimeoutMs\"] ||\n changes[\"products\"] ||\n changes[\"mapProducts\"]\n ) {\n this.controller.update({\n apiConfig: this.apiConfig,\n additionalContext: this.additionalContext,\n language: this.language,\n currency: this.currency,\n productId: this.productId,\n visitorId: this.visitorId,\n analyticsConsent: this.analyticsConsent,\n optionOverrides: this.optionOverrides,\n dropdownTrigger: this.dropdownTrigger,\n optionsPosition: this.optionsPosition,\n closeDropdownOnBlur: this.closeDropdownOnBlur,\n focusInputOnSelect: this.focusInputOnSelect,\n startingState: this.startingState,\n prependPlaceholder: this.prependPlaceholder,\n showNonTappableOptions: this.showNonTappableOptions,\n allOption: this.allOption,\n locationSearch: this.locationSearch,\n showProducts: this.showProducts,\n submitProgress: this.submitProgress,\n awaitAnswerOnSubmit: this.awaitAnswerOnSubmit,\n submitAnswerTimeoutMs: this.submitAnswerTimeoutMs,\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 mapProducts: this.mapProducts,\n });\n }\n if (changes[\"onProductAddToCart\"]) {\n this.controller.update({ onProductAddToCart: this.onProductAddToCart });\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.stopEditorHeight?.();\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 /**\n * Runs mapProducts synchronously on the shown items again without a request.\n * Keeps the same cards while updating their content.\n * Does nothing without mapProducts or with a custom products integration.\n */\n refreshProducts(): void {\n this.controller?.refreshProducts();\n }\n\n /** Clear all state, rotate session, and re-fetch. */\n reset(): void {\n this.controller?.reset();\n }\n\n /**\n * Ends whatever is in progress, a submit or a product selection, at once:\n * call it when the work your `(submitted)` / `(productSelect)` handler\n * started is done and the shopper is still on the page. An output cannot\n * return a promise, so this is how a handler says it is finished.\n */\n endSubmitProgress(): void {\n this.controller?.endSubmitProgress();\n }\n\n /** The search in progress, or `undefined` until the feature is enabled for your account. */\n getSearchId(): string | undefined {\n return this.controller?.getSearchId();\n }\n\n /** The visitor id the events carry right now, or `undefined` while there is none. */\n getVisitorId(): string | undefined {\n return this.controller?.getVisitorId();\n }\n\n /** Reads `analyticsConsent` again now, after the visitor changes their choice. */\n refreshAnalyticsConsent(): void {\n this.controller?.refreshAnalyticsConsent();\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 /** The default submit button's name, in the widget language. */\n get submitLabel(): string {\n return uiStringsFor(this.language).submit;\n }\n\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 // Tapping a location chip re-opens the location field, which takes focus\n // during the tap; the click that ends the tap must not take it back.\n if (document.activeElement?.closest(\"[data-aia-location]\")) return;\n const editor = this.editorRef?.nativeElement;\n if (editor) focusEditorFromTap(editor);\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 // `answered` is the core's own result for the submit: its catalog report\n // answers the query, or is left out or marked, where the report in state is\n // the last response's and may be an earlier query's.\n // `fromButton`: the SDK records an Enter submit itself before it calls back\n // here; a click on our own button never passes through it.\n private handleSubmit(answered: AutocompleteResult, fromButton = false): 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 const result = buildSubmitResult(text, params, state.skippedParams, {\n identifiedParams: state.identifiedParams,\n isReady: state.isReady,\n customFields: answered.custom_fields ?? null,\n customFieldsStale: answered.custom_fields_stale === true,\n });\n if (fromButton) this.controller.recordSubmit(result);\n this.submitted.emit(result);\n // The core marks Enter's submit in progress itself; the button's is\n // marked here (a no-op when the handler already did, with its own\n // promise). Not when the reset below follows: nothing would show, so\n // nothing is written only to be taken back.\n if (fromButton && !this.resetOnSubmit) this.controller.holdSubmit();\n if (this.resetOnSubmit) this.controller.reset();\n }\n\n private handleSubmitFromUserAction(): void {\n const state = this.controller.getState();\n if (!this.canSubmit(state)) return;\n // A submit already in progress: this press is the same submit again.\n // (The core ignores a second Enter itself.)\n if (state.isSubmitting) return;\n if (this.awaitAnswerOnSubmit) {\n // The core calls back for Enter once the answer to the submit arrived;\n // the button waits for it here. Null: the shopper changed the input\n // while it waited.\n void this.controller.awaitSubmitResult().then((answered) => {\n if (answered) this.handleSubmit(answered, true);\n });\n return;\n }\n this.controller.prepareSubmit();\n // Use the same handler for button clicks and Enter.\n this.handleSubmit(this.controller.getResult(), true);\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-aia-options-style]=\"optionsStyle\"\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 [showOptionImages]=\"showOptionImages\"\n [showOptionCounts]=\"showOptionCounts\"\n [productsLayout]=\"productsLayout\"\n [productImageFallback]=\"productImageFallback\"\n [showProductVendor]=\"showProductVendor\"\n [language]=\"language\"\n ></ai-autocomplete-dropdown>\n\n <div\n class=\"magicx-aia-input-wrapper\"\n data-aia-input-wrapper=\"\"\n (click)=\"onWrapperClick($event)\"\n (keyup)=\"$event.stopPropagation()\"\n >\n <div #editorArea 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 [showChipImages]=\"showChipImages\"\n [showChipRemove]=\"showChipRemove\"\n [showInlinePills]=\"showInlinePills\"\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 [ready]=\"\n !!controller &&\n !!(controller.isReady$ | async) &&\n canSubmit({\n segments: (controller.segments$ | async) ?? [],\n completedParams: (controller.completedParams$ | async) ?? []\n })\n \"\n [busy]=\"!!controller && !!(controller.isSubmitting$ | async)\"\n [label]=\"submitLabel\"\n (submit)=\"onSubmitButtonClick($event)\"\n ></aia-submit-button>\n\n <span\n *ngSwitchCase=\"'custom'\"\n data-aia-submit=\"\"\n data-aia-submit-slot=\"\"\n [attr.data-aia-submit-state]=\"controller && (controller.isSubmitting$ | async) ? 'busy' : null\"\n [attr.aria-busy]=\"controller && (controller.isSubmitting$ | async) ? 'true' : null\"\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 const focused = typeof document !== \"undefined\" && document.activeElement === el;\n // Where a pick does not focus the field (a touch device by default,\n // `focusInputOnSelect`), the keyboard stays away: no focus, and no\n // caret either (`setSelectionRange` focuses the field in Safari). The\n // next tap on the field places the caret.\n if (!focused && !this.controller.focusesInputOnSelect()) return;\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 (!focused && typeof document !== \"undefined\") el.focus();\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 CurrencyOptions,\n CustomFieldsReport,\n DateMonthView,\n DateRange,\n ExpressedFilter,\n FilterOp,\n FormatType,\n IdentifiedParam,\n IdentifiedParamState,\n LocationPlace,\n LocationView,\n MatchedItem,\n MatchedItems,\n OptionOverrides,\n Product,\n ProductImageFallback,\n ProductsConfig,\n ProductsLayout,\n Segment,\n SelectOptionOptions,\n SkippedParamState,\n SubmitResultExtras,\n Suggestion,\n SuggestionOption,\n TaskKind,\n TimeView,\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 DEFAULT_OPTION_COUNT_UNIT as _DEFAULT_OPTION_COUNT_UNIT,\n dateCellMarks as _dateCellMarks,\n formatDate as _formatDate,\n formatDateRange as _formatDateRange,\n formatOptionCount as _formatOptionCount,\n formatPlace as _formatPlace,\n formatTime as _formatTime,\n isoDate as _isoDate,\n LOCATION_META_KEY as _LOCATION_META_KEY,\n monthLabel as _monthLabel,\n optionCountLabel as _optionCountLabel,\n optionHasImage as _optionHasImage,\n optionImageSources as _optionImageSources,\n optionImageSrc as _optionImageSrc,\n optionLabel as _optionLabel,\n optionsShowLeadingVisuals as _optionsShowLeadingVisuals,\n PRODUCT_PATH_PREFIX as _PRODUCT_PATH_PREFIX,\n parseDate as _parseDate,\n parseLooseDate as _parseLooseDate,\n parseLooseDateRange as _parseLooseDateRange,\n parseTime as _parseTime,\n productFromMatchedItem as _productFromMatchedItem,\n productImageSources as _productImageSources,\n productsFromCustomFields as _productsFromCustomFields,\n sanitizeOptionIconSvg as _sanitizeOptionIconSvg,\n selectedRangeFor as _selectedRangeFor,\n TIME_META_KEY as _TIME_META_KEY,\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// Time helpers: the written form a committed time takes, reading it back, and\n// the metadata key the exact 24-hour time is recorded under.\nexport const formatTime = _formatTime;\nexport const parseTime = _parseTime;\nexport const TIME_META_KEY = _TIME_META_KEY;\n// Location search: how a picked place reads, and the metadata key its\n// provider place ID is recorded under.\nexport const formatPlace = _formatPlace;\nexport const LOCATION_META_KEY = _LOCATION_META_KEY;\n// Option icons, for a custom dropdown that draws `icon_svg` itself.\nexport const optionLabel = _optionLabel;\nexport const sanitizeOptionIconSvg = _sanitizeOptionIconSvg;\n// Option pictures and counts, for a custom dropdown that draws `image_url`\n// and `item_count` itself.\nexport const DEFAULT_OPTION_COUNT_UNIT = _DEFAULT_OPTION_COUNT_UNIT;\nexport const formatOptionCount = _formatOptionCount;\nexport const optionCountLabel = _optionCountLabel;\nexport const optionHasImage = _optionHasImage;\nexport const optionImageSrc = _optionImageSrc;\nexport const optionImageSources = _optionImageSources;\nexport const optionsShowLeadingVisuals = _optionsShowLeadingVisuals;\n// Product strip helpers, for a custom strip fed from `customFields$`.\nexport const PRODUCT_PATH_PREFIX = _PRODUCT_PATH_PREFIX;\nexport const productFromMatchedItem = _productFromMatchedItem;\nexport const productImageSources = _productImageSources;\nexport const productsFromCustomFields = _productsFromCustomFields;\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","productImageSources","optionLabel","optionImageSources","formatOptionCount","sanitizeOptionIconSvg","optionsShowLeadingVisuals","formatTime","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","_formatTime","_parseTime","_TIME_META_KEY","_formatPlace","_LOCATION_META_KEY","_optionLabel","_sanitizeOptionIconSvg","_DEFAULT_OPTION_COUNT_UNIT","_formatOptionCount","_optionCountLabel","_optionHasImage","_optionImageSrc","_optionImageSources","_optionsShowLeadingVisuals","_PRODUCT_PATH_PREFIX","_productFromMatchedItem","_productImageSources","_productsFromCustomFields"],"mappings":";;;;;;;;;;AAwBA;;;;;;;;;;;;;;AAcG;MAUU,iBAAiB,CAAA;AAT9B,IAAA,WAAA,GAAA;;QAWW,IAAO,CAAA,OAAA,GAAuB,EAAE,CAAC;QACjC,IAAW,CAAA,WAAA,GAAG,CAAC,CAAC,CAAC;QACjB,IAAS,CAAA,SAAA,GAAG,EAAE,CAAC;QACf,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;;AAGvC,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,YAAY,EAAU,CAAC;AACzC,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,YAAY,EAAQ,CAAC;AACzC,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,YAAY,EAAQ,CAAC;QAE/C,IAAQ,CAAA,QAAA,GAAGA,gBAAc,CAAC;;QAGnC,IAAY,CAAA,YAAA,GAAG,CAAC,CAAC,CAAC;;AAkFlB,QAAA,IAAA,CAAA,WAAW,GAAG,CAAC,KAAa,EAAE,MAAwB,KACpDC,SAAO,C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