@magicx-eng/ai-autocomplete-react 0.67.0 → 0.67.2

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,"sources":["../src/index.ts","../src/AIAutocomplete.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/AIAutocomplete.module.css.js","../src/AIAutocompleteDropdown.tsx","plain-css:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/appearance.css.js","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/AIAutocompleteDropdown.module.css.js","../src/components/DateGrid.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/DateGrid.module.css.js","../src/components/DropdownFooter.tsx","plain-css:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/layout/Cluster.css.js","../src/layout/Cluster.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/DropdownFooter.module.css.js","../src/components/LocationField.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/LocationField.module.css.js","../src/components/PillList.tsx","../src/components/ParamPill.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/ParamPill.module.css.js","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/PillList.module.css.js","../src/components/ProductStrip.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/ProductStrip.module.css.js","../src/components/SuggestionGrid.tsx","../src/layout/Grid.tsx","plain-css:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/layout/Grid.css.js","../src/components/SuggestionItem.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/SuggestionItem.module.css.js","../src/components/TimeWheel.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/TimeWheel.module.css.js","plain-css:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/layout/Stack.css.js","../src/layout/Stack.tsx","../src/components/SubmitButton.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/SubmitButton.module.css.js","../src/hooks/useAIAutocomplete.ts","../src/hooks/useOptionOverridesProxy.ts","../src/hooks/useProductsProxy.ts","../src/hooks/useContentEditableEditor.ts"],"sourcesContent":["export type { FocusInputOnSelect } from \"@magicx-eng/ai-autocomplete-vanilla\";\nexport {\n buildSubmitResult,\n // Date helpers, for turning a committed date back into a `Date` and for\n // rendering a custom calendar in Tier 3.\n cellDay,\n cellIso,\n // The metadata keys a committed range records its two ends under, so a\n // consumer reading them back never hardcodes the strings.\n DATE_RANGE_META_END,\n DATE_RANGE_META_START,\n // Option pictures and counts, for a custom dropdown that draws `image_url`\n // and `item_count` itself.\n DEFAULT_OPTION_COUNT_UNIT,\n // Range helpers, for a custom calendar that answers a span in two taps.\n dateCellMarks,\n // Focus after a pick: whether the SDK focuses the input, for code that\n // owns one (see `focusInputOnSelect`).\n focusesInputOnSelect,\n formatDate,\n formatDateRange,\n formatOptionCount,\n formatPlace,\n // Time helpers: the written form a committed time takes, reading it back,\n // and the metadata key the exact 24-hour time is recorded under.\n formatTime,\n isoDate,\n isTouchPrimary,\n // Location search: the metadata key a picked place's ID is recorded under,\n // and how a place reads once picked.\n LOCATION_META_KEY,\n monthLabel,\n optionCountLabel,\n optionHasImage,\n optionImageSources,\n optionImageSrc,\n // Option icons, for a custom dropdown that draws `icon_svg` itself.\n optionLabel,\n optionsShowLeadingVisuals,\n PRODUCT_PATH_PREFIX,\n parseDate,\n parseLooseDate,\n parseLooseDateRange,\n parseTime,\n // Product strip helpers (with PRODUCT_PATH_PREFIX above), for a custom\n // strip fed from `customFields`.\n productFromMatchedItem,\n productImageSources,\n productsFromCustomFields,\n sanitizeOptionIconSvg,\n selectedRangeFor,\n TIME_META_KEY,\n visibleDateRange,\n WEEKDAY_LABELS,\n withSkippedParams,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nexport { AIAutocomplete } from \"./AIAutocomplete\";\nexport { AIAutocompleteDropdown } from \"./AIAutocompleteDropdown\";\nexport { useAIAutocomplete } from \"./hooks/useAIAutocomplete\";\nexport type {\n AccessTokenConfig,\n AccessTokenResult,\n AIAutocompleteDropdownProps,\n AIAutocompleteHandle,\n AIAutocompleteProps,\n APIConfig,\n APIKeyConfig,\n AppearanceMode,\n AutocompleteResult,\n BlockingChip,\n BlockingFilter,\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 UseAIAutocompleteOptions,\n UseAIAutocompleteReturn,\n} from \"./types\";\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n} from \"react\";\nimport styles from \"./AIAutocomplete.module.css\";\nimport { AIAutocompleteDropdown } from \"./AIAutocompleteDropdown\";\nimport \"./appearance.css\";\nimport {\n type AppearanceMode,\n type AutocompleteResult,\n buildSubmitResult,\n focusEditorFromTap,\n ModeController,\n setCursorOffset,\n uiStringsFor,\n watchEditorHeight,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { PillList } from \"./components/PillList\";\nimport { SubmitButton } from \"./components/SubmitButton\";\nimport { useAIAutocomplete } from \"./hooks/useAIAutocomplete\";\nimport { useContentEditableEditor } from \"./hooks/useContentEditableEditor\";\nimport type { AIAutocompleteHandle, AIAutocompleteProps } from \"./types\";\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\nexport const AIAutocomplete = forwardRef<AIAutocompleteHandle, AIAutocompleteProps>(\n function AIAutocomplete(\n {\n onSubmit,\n onResult,\n onError,\n optionOverrides,\n maskCompletedText,\n className,\n apiConfig,\n additionalContext,\n language,\n currency,\n productId,\n visitorId,\n analyticsConsent,\n columns,\n pillPlacement = \"dropdown\",\n mode = \"auto\",\n optionsPosition = \"below\",\n animations = true,\n optionsStyle = \"floating\",\n dropdownTrigger,\n closeDropdownOnBlur,\n focusInputOnSelect,\n startingState,\n prependPlaceholder,\n allOption,\n showNonTappableOptions,\n locationSearch,\n showOptionIcons = true,\n showChipIcons = true,\n showChipImages = true,\n showChipRemove = false,\n showOptionImages = true,\n showOptionCounts = true,\n showSkipButton,\n showProducts,\n submitProgress,\n awaitAnswerOnSubmit,\n submitAnswerTimeoutMs,\n productsLayout,\n productImageFallback,\n showProductVendor,\n autoFocus = true,\n onFocus,\n onBlur,\n value,\n completedParams: controlledParams,\n onChange: onChangeProp,\n onParamsChange,\n products,\n mapProducts,\n onProductSelect,\n onProductAddToCart,\n submitButton,\n resetOnSubmit = true,\n seeAllResults = false,\n },\n ref,\n ) {\n const containerRef = useRef<HTMLDivElement>(null);\n const pillContainerRef = useRef<HTMLSpanElement>(null);\n const editorAreaRef = useRef<HTMLDivElement>(null);\n const handleSubmitRef = useRef<(result: AutocompleteResult) => void | PromiseLike<unknown>>(\n () => {},\n );\n const modeControllerRef = useRef<ModeController | null>(null);\n // Holds the editor's input *ref object* (not its current value) so the\n // setCursor callback — defined before useContentEditableEditor runs — can\n // dereference the live DOM element at call time without a one-render lag.\n const editorInputRefHolder = useRef<React.RefObject<HTMLDivElement> | null>(null);\n\n useEffect(() => {\n const el = containerRef.current;\n if (!el) return;\n if (modeControllerRef.current) {\n modeControllerRef.current.setMode(mode);\n } else {\n modeControllerRef.current = new ModeController(el, mode);\n }\n return () => {\n modeControllerRef.current?.destroy();\n modeControllerRef.current = null;\n };\n }, [mode]);\n\n const handleSetCursor = useCallback((offset: number) => {\n const el = editorInputRefHolder.current?.current;\n if (!el) return;\n el.focus();\n setCursorOffset(el, offset);\n }, []);\n\n const {\n completedParams,\n suggestionPills,\n setActivePill,\n skipActivePill,\n segments,\n newParamId,\n clearNewParamId,\n placeholderText,\n isFocused,\n isDropdownOpen,\n isActivePillSelected,\n blockingChips,\n isLoading,\n isReady,\n activeIndex,\n listboxId,\n handleTextChange,\n handleCompositionText,\n handleKeyDown,\n setFocused,\n editingParam,\n editingIdentified,\n editingAnchor,\n caretOffset,\n startEditingParam,\n removeParam,\n handleCaretAfterInput,\n handleCaretMove,\n replaceEditingRange,\n dropdownProps,\n reset,\n refreshProducts,\n prepareSubmit,\n getState,\n getResult,\n awaitSubmitResult,\n recordSubmit,\n holdSubmit,\n endSubmitProgress,\n getSearchId,\n getVisitorId,\n refreshAnalyticsConsent,\n isSubmitting,\n } = useAIAutocomplete({\n onSubmit: (result) => handleSubmitRef.current(result),\n onResult,\n onError,\n optionOverrides,\n maskCompletedText,\n apiConfig,\n additionalContext,\n language,\n currency,\n productId,\n visitorId,\n analyticsConsent,\n columns,\n dropdownTrigger,\n optionsPosition,\n closeDropdownOnBlur,\n focusInputOnSelect,\n startingState,\n prependPlaceholder,\n allOption,\n showNonTappableOptions,\n locationSearch,\n showOptionIcons,\n showOptionImages,\n showOptionCounts,\n showSkipButton,\n showProducts,\n submitProgress,\n awaitAnswerOnSubmit,\n submitAnswerTimeoutMs,\n onFocus,\n onBlur,\n value,\n completedParams: controlledParams,\n onChange: onChangeProp,\n onParamsChange,\n products,\n mapProducts,\n onProductSelect,\n onProductAddToCart,\n source: \"full-sdk\",\n setCursor: handleSetCursor,\n });\n\n // Shimmer auto-clear after the animation finishes.\n useEffect(() => {\n if (!newParamId) return;\n const t = window.setTimeout(() => clearNewParamId(), 650);\n return () => window.clearTimeout(t);\n }, [newParamId, clearNewParamId]);\n\n const blockingParamIds = useMemo(\n () => blockingChips.map((chip) => chip.paramId),\n [blockingChips],\n );\n\n const activeDescendantId = activeIndex >= 0 ? `${listboxId}-option-${activeIndex}` : undefined;\n\n const { inputRef, editorProps, focus, blur, getPlainText } = useContentEditableEditor({\n segments,\n newParamId,\n editingParam,\n editingIdentified,\n editingAnchor,\n caretOffset,\n placeholderText,\n hintSuggestions: pillPlacement === \"inline\" ? [] : suggestionPills,\n isFocused,\n showChipIcons,\n showChipImages,\n showChipRemove,\n blockingParamIds,\n removeParam,\n focusInputOnSelect,\n isDropdownOpen,\n listboxId,\n activeDescendantId,\n autoFocus,\n handleTextChange,\n handleCompositionText,\n handleKeyDown,\n handleCaretAfterInput,\n handleCaretMove,\n startEditingParam,\n replaceEditingRange,\n setFocused,\n });\n\n // Wire the holder to the hook's ref. The ref *object* is stable across\n // renders, so this assignment is idempotent and reaches the live DOM\n // element via `.current` without snapshotting null on the first render.\n editorInputRefHolder.current = inputRef;\n\n // The pill list sits inline-adjacent to the editor and carries an 8px\n // left margin so it doesn't butt against the editor's text. When the\n // editor's text fills its line and the pill list wraps to a new line,\n // that margin becomes a stray indent at the start of the wrapped line —\n // detect that case and drop the margin via a data attribute the CSS\n // keys off. The wrap detection (pill row's top vs editor's bottom)\n // already handles the placeholder-only case correctly: the placeholder\n // still occupies the editor's line box, so pills sitting beside it are\n // NOT wrapped and the margin stays.\n // biome-ignore lint/correctness/useExhaustiveDependencies: segments/suggestionPills/isLoading are intentional re-measure triggers, not reads\n useLayoutEffect(() => {\n const container = pillContainerRef.current;\n const editor = inputRef.current;\n if (!container || !editor) return;\n\n const update = () => {\n const inner = container.firstElementChild as HTMLElement | null;\n if (!inner) return;\n const cRect = inner.getBoundingClientRect();\n const eRect = editor.getBoundingClientRect();\n const wrapped = cRect.top >= eRect.bottom - 2;\n if (wrapped) container.setAttribute(\"data-aia-pill-wrapped\", \"\");\n else container.removeAttribute(\"data-aia-pill-wrapped\");\n };\n\n update();\n const ro = new ResizeObserver(update);\n ro.observe(editor);\n return () => ro.disconnect();\n }, [segments, suggestionPills.length, isLoading, inputRef]);\n\n // A new line opens smoothly instead of popping in (see watchEditorHeight).\n useEffect(() => {\n const area = editorAreaRef.current;\n if (!area) return;\n return watchEditorHeight(area);\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n focus,\n blur,\n reset,\n refreshProducts,\n setMode: (m) => modeControllerRef.current?.setMode(m),\n skipActivePill,\n endSubmitProgress,\n getSearchId,\n getVisitorId,\n refreshAnalyticsConsent,\n }),\n [\n focus,\n blur,\n reset,\n refreshProducts,\n skipActivePill,\n endSubmitProgress,\n getSearchId,\n getVisitorId,\n refreshAnalyticsConsent,\n ],\n );\n\n const canSubmit = !!segments.length || completedParams.length > 0;\n\n // Hands a submit to `onSubmit`. `answered` is the core's own result for\n // it, whose catalog report answers the query or is left out or marked:\n // the report in state is the last response's, which may be an earlier\n // query's. The text is read from the editor.\n const deliverSubmit = useCallback(\n (fromButton: boolean, answered: AutocompleteResult) => {\n const state = getState();\n const result = buildSubmitResult(\n getPlainText(),\n state.completedParams,\n state.skippedParams,\n {\n identifiedParams: state.identifiedParams,\n isReady: state.isReady,\n customFields: answered.custom_fields ?? null,\n customFieldsStale: answered.custom_fields_stale === true,\n },\n );\n if (fromButton) recordSubmit(result);\n const returned = onSubmit(result);\n // The core marks Enter's submit in progress from what this returns;\n // the button's is marked here. Not when the reset below follows:\n // nothing would show, so nothing is written only to be taken back.\n if (fromButton && !resetOnSubmit) holdSubmit(returned);\n if (resetOnSubmit) reset();\n return returned;\n },\n [recordSubmit, holdSubmit, resetOnSubmit, getState, onSubmit, reset, getPlainText],\n );\n\n // The core prepares and records Enter before it calls back, after the\n // answer to it arrived when `awaitAnswerOnSubmit` is on. The button does\n // the same here.\n const handleButtonSubmit = useCallback(() => {\n if (!canSubmit) return;\n // A submit already in progress: this press is the same submit again.\n // (The core ignores a second Enter itself.)\n if (getState().isSubmitting) return;\n if (awaitAnswerOnSubmit) {\n // Null: the shopper changed the input while it waited.\n void awaitSubmitResult().then((answered) => {\n if (answered) deliverSubmit(true, answered);\n });\n return;\n }\n prepareSubmit();\n deliverSubmit(true, getResult());\n }, [\n canSubmit,\n getState,\n awaitAnswerOnSubmit,\n awaitSubmitResult,\n prepareSubmit,\n getResult,\n deliverSubmit,\n ]);\n\n handleSubmitRef.current = (answered) =>\n canSubmit ? deliverSubmit(false, answered) : undefined;\n\n // \"See all results\" submits as the submit button does, while typed text is\n // in the field (vanilla's renderInput gate).\n const showsSeeAll = seeAllResults && !dropdownProps.isInputEmpty && canSubmit;\n const handleSeeAllResults = handleButtonSubmit;\n\n const handleWrapperClick = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n // Clicking a pill activates it; don't steal focus away from where it lands.\n const target = e.target as HTMLElement | null;\n if (target?.closest(\"[data-aia-pill]\")) return;\n // Tapping a location chip re-opens the location field, which takes\n // focus during the tap; the click that ends the tap must not take it back.\n if (document.activeElement?.closest(\"[data-aia-location]\")) return;\n if (inputRef.current) focusEditorFromTap(inputRef.current);\n },\n [inputRef],\n );\n\n const showInlinePills = pillPlacement === \"inline\";\n const showDropdownPills = pillPlacement === \"dropdown\";\n\n return (\n <div\n ref={containerRef}\n className={`magicx-aia ${styles.container} ${className ?? \"\"}`}\n data-pill-placement={pillPlacement}\n data-options-position={optionsPosition}\n data-animations={animations ? \"on\" : \"off\"}\n data-aia-options-style={optionsStyle}\n data-mode={resolveInitialMode(mode)}\n >\n <AIAutocompleteDropdown\n {...dropdownProps}\n showPills={showDropdownPills}\n productsLayout={productsLayout}\n productImageFallback={productImageFallback}\n showProductVendor={showProductVendor}\n onSeeAllResults={showsSeeAll ? handleSeeAllResults : undefined}\n fullWidth={seeAllResults}\n />\n {/* biome-ignore lint/a11y/useKeyWithClickEvents: container click delegates to editor focus */}\n {/* biome-ignore lint/a11y/noStaticElementInteractions: wrapper delegates focus to editor */}\n <div className={styles.inputWrapper} data-aia-input-wrapper=\"\" onClick={handleWrapperClick}>\n <div ref={editorAreaRef} className={styles.editorArea} data-aia-editor=\"\">\n <div {...editorProps} className={styles.input} data-aia-input=\"\" />\n {showInlinePills && (isLoading || suggestionPills.length > 0) && (\n <span\n ref={pillContainerRef}\n className={styles.pillListContainer}\n data-aia-pill-list-container=\"\"\n >\n <PillList\n pills={suggestionPills}\n activePillIndex={0}\n activeSelected={isActivePillSelected}\n onSelectPill={setActivePill}\n loading={isLoading}\n />\n </span>\n )}\n </div>\n {submitButton === null ? null : submitButton === undefined ? (\n <SubmitButton\n disabled={!canSubmit}\n ready={canSubmit && isReady}\n busy={isSubmitting}\n onClick={handleButtonSubmit}\n label={uiStringsFor(language).submit}\n />\n ) : (\n // biome-ignore lint/a11y/useKeyWithClickEvents: consumer-provided element handles its own keyboard interaction\n // biome-ignore lint/a11y/noStaticElementInteractions: transparent slot — click bubbles from consumer's element\n <span\n data-aia-submit=\"\"\n data-aia-submit-slot=\"\"\n // A submit in progress ignores a press here too; the attribute\n // is what the consumer's own button shows that from.\n data-aia-submit-state={isSubmitting ? \"busy\" : undefined}\n aria-busy={isSubmitting ? true : undefined}\n className={styles.submitSlot}\n onClick={(e) => {\n if (!canSubmit) return;\n e.stopPropagation();\n handleButtonSubmit();\n }}\n >\n {submitButton}\n </span>\n )}\n </div>\n </div>\n );\n },\n);\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-67791514\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-67791514\";\n s.textContent = `.aia-container-KKjFU {\n position: relative;\n /* Inherits the host page's font by default. Consumers can pin a specific\n font on the library via \\`--aia-font-family: 'Custom Font'\\` without\n affecting the surrounding page. */\n font-family: var(--aia-font-family, inherit);\n container-type: inline-size;\n}\n\n.aia-inputWrapper-FLq1b {\n /* The left inset is a token shared with the dropdown (which insets its\n content by the same amount), so the typed text, the parameter label,\n the option text and the product strip share one left edge. A host that\n pads the field to clear its own leading icon sets --aia-content-inset-left\n and the dropdown follows. Floored at 10px — the dropdown's sections inset\n their text by 10px and its own padding can't go below zero, so below\n 10px the two sides would diverge; flooring both keeps them together. */\n padding: 12px 16px 12px max(10px, var(--aia-content-inset-left, 16px));\n border: 1px solid var(--aia-border, #b0b0b0);\n border-radius: var(--aia-input-radius, 10px);\n background: var(--aia-surface, #ffffff);\n /* Flat by default; consumers can set --aia-shadow for elevation. */\n box-shadow: var(--aia-shadow, none);\n overflow: hidden;\n display: flex;\n /* Top-align so the submit button stays by the first line while the editor\n grows downward and then scrolls internally. */\n align-items: flex-start;\n gap: 12px;\n}\n\n/* Opt-in focus ring on the whole field while the editor (or anything else in\n it) has focus. Off by default: set --aia-focus-ring to an outline value\n (\\`2px solid #1668e3\\`) and --aia-focus-ring-offset to pull it inside the\n border (negative) or push it out. An outline, not a shadow, so it never\n replaces --aia-shadow, and it follows the field's corner radius. */\n.aia-inputWrapper-FLq1b:focus-within {\n outline: var(--aia-focus-ring, none);\n outline-offset: var(--aia-focus-ring-offset, 0px);\n}\n\n.aia-editorArea-7rBWq {\n position: relative;\n flex: 1;\n min-width: 0;\n min-height: 22px;\n /* Airy line box so wrapped rows of chips (and plain text) don't touch. */\n line-height: var(--aia-editor-line-height, 1.9);\n font-family: inherit;\n font-size: var(--aia-written-text-font-size, 14px);\n white-space: pre-wrap;\n word-break: break-word;\n overflow-wrap: anywhere;\n /* Grow with content up to a cap of five rows, then hold height and scroll\n internally — the caret stays in view as the text is pushed up. The\n scrollbar is hidden so the box reads as a clean growing field. The cap is\n five line boxes rather than a fixed pixel height so it still lands on a\n whole row when a consumer resizes the text via\n --aia-written-text-font-size (\\`em\\` here resolves against this element's\n own font-size, which is that token). */\n max-height: var(--aia-editor-max-height, calc(var(--aia-editor-line-height, 1.9) * 5em));\n overflow-y: auto;\n scrollbar-width: none;\n}\n\n.aia-editorArea-7rBWq::-webkit-scrollbar {\n display: none;\n}\n\n.aia-input-IW-P- {\n display: inline;\n outline: none;\n background: transparent;\n color: var(--aia-written-text-color, var(--aia-color-text-default, #fff));\n caret-color: var(\n --aia-caret-color,\n var(--aia-written-text-color, var(--aia-color-text-default, #fff))\n );\n font-weight: var(--aia-written-text-font-weight, 300);\n /* Align the text's inline box with the pill list (also vertical-align: middle)\n so they share a vertical center when pills stretch the line box to ~36px. */\n vertical-align: middle;\n}\n\n/* WebKit implements \\`contenteditable\\` as a \\`-webkit-user-modify\\` presentational\n hint, and the consumer-isolation reset's \\`all: revert\\` rolls presentational\n hints back — without this the editor computes to \\`read-only\\` there and\n nothing can be typed into it (verified in WebKit 26.0 and 26.6; Chromium\n keeps the attribute's effect). Pinned by class per attribute value, which\n outranks the reset. Other engines ignore the property. */\n.aia-input-IW-P-[contenteditable=\"true\"] {\n -webkit-user-modify: read-write;\n}\n.aia-input-IW-P-[contenteditable=\"plaintext-only\"] {\n -webkit-user-modify: read-write-plaintext-only;\n}\n\n/* The editor never draws a focus ring of its own; the field shows focus\n instead (--aia-focus-ring above). A page-wide \\`:focus-visible { outline … }\\`\n names a pseudo-class, so the consumer-isolation reset can't stop it, and it\n ties with the editor's \\`outline: none\\` — whichever stylesheet loaded last\n wins, and the page's loads last under a dev server, CSS-in-JS or\n route-split CSS. The ring then outlines the bare editor: a blue bar beside\n the caret while it is empty, a box around the text once it isn't. Pinned at\n (0,3,0) so the editor stays bare whatever the load order. */\n.aia-input-IW-P-[contenteditable]:focus,\n.aia-input-IW-P-[contenteditable]:focus-visible {\n outline: none;\n}\n\n/* Completed params render as inline pills (Figma \"RichTextPill\") — a compact\n ~26px chip with regular-weight primary-color text on a faint-gray fill.\n inline-block gives the padding/radius a box while the text stays part of the\n editable plain text (the caret system counts characters inside this\n <strong>). The completed class is stamped by the shared renderer as a global\n string, so match it via [class~=] to bypass CSS Modules' hashing. */\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-segment--completed\"] {\n /* inline-block, so the chip is one unit on its line: when the line runs out\n the whole chip moves to the next one instead of breaking in the middle\n (between its icon and its text, or at a space). max-width keeps a chip\n wider than the whole field inside it: its text then wraps within the\n chip, drawn as one rounded box of several lines (white-space: normal\n below; the field's overflow-wrap / word-break are inherited, so one very\n long word cannot push it out either). */\n display: inline-block;\n box-sizing: border-box;\n max-width: 100%;\n padding: 3px 6px;\n /* An inline-block counts its vertical padding in the line box, where the\n inline chip this replaces did not. The negative margin takes it back out,\n and the baseline alignment keeps the chip's text on the surrounding\n text's baseline, so rows of chips sit exactly --aia-editor-line-height\n apart, as plain text does. */\n margin: -3px 0;\n vertical-align: baseline;\n /* Rounded rectangle, not a full capsule. */\n border-radius: 6px;\n background: var(--aia-completed-pill-bg, rgba(189, 189, 189, 0.105));\n color: var(--aia-completed-pill-color, var(--aia-written-text-color, #fff));\n font-size: var(--aia-pill-font-size, 14px);\n font-weight: 400;\n line-height: normal;\n white-space: normal;\n /* Tighten the tracking so the chip's horizontal padding doesn't make the\n recognized phrase read wider than the same words as plain text. The exact\n per-chip amount is set inline by the renderer (renderEditable); this is a\n fallback for any chip the renderer didn't stamp. */\n letter-spacing: var(--aia-completed-pill-tracking, -0.02em);\n cursor: pointer;\n /* Smooth hover fade. Neutralized by the data-animations=\"off\" block. */\n transition: background-color 150ms ease;\n}\n\n/* Hover highlight — a slightly stronger fill so a pointed-at pill reads as\n tappable. Declared between the base and editing rules so editing wins. */\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-segment--completed\"]:hover {\n background: var(--aia-completed-pill-bg-active, rgba(189, 189, 189, 0.35));\n}\n\n/* A chip whose removal finds items when the search found none (custom_fields.blocking_filters).\n Greyed out at half opacity. After the hover rule, so it stays greyed while pointed at. */\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-segment--blocking\"] {\n opacity: var(--aia-blocking-chip-opacity, 0.5);\n}\n\n/* The × of a greyed chip keeps its normal weight: its opacity multiplies with the chip's, so it is divided back out. */\n:where(.aia-input-IW-P-)\n strong[class~=\"magicx-aia-segment--blocking\"]\n span[class~=\"magicx-aia-segment-remove\"] {\n opacity: calc(var(--aia-chip-remove-opacity, 0.32) / var(--aia-blocking-chip-opacity, 0.5));\n}\n\n@media (hover: hover) {\n :where(.aia-input-IW-P-)\n strong[class~=\"magicx-aia-segment--blocking\"]\n span[class~=\"magicx-aia-segment-remove\"]:hover {\n opacity: calc(\n var(--aia-chip-remove-opacity-hover, 0.7) /\n var(--aia-blocking-chip-opacity, 0.5)\n );\n }\n}\n\n/* The picked option's icon inside a completed chip (see \\`icon_svg\\` on\n CompletedParamState). Inline-block, one em square and sat on the text\n baseline; the chip is one inline-block, so the icon never ends a line\n apart from its text. contentEditable is off on it (the renderer sets that) so it adds\n no characters to the caret's plain text. */\n:where(.aia-input-IW-P-) span[class~=\"magicx-aia-segment-icon\"] {\n display: inline-block;\n width: 1em;\n height: 1em;\n margin-right: 4px;\n vertical-align: -0.125em;\n pointer-events: none;\n user-select: none;\n /* Own compositing layer. The row (entrance) and the chip (promotion fade)\n animate on a layer WebKit drops when the animation ends; content drawn at\n a fractional x then re-rasterizes on a different sub-pixel, which crisp\n SVG strokes show as a nudge to the right. A permanent layer keeps the\n glyph's rasterization stable across that hand-off. */\n will-change: transform;\n}\n\n:where(.aia-input-IW-P-) span[class~=\"magicx-aia-segment-icon\"] svg {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n/* The chip's remove \"×\" (\\`showChipRemove\\`). Deliberately quiet: a thin glyph\n a little smaller than the text, at low opacity, that firms up on hover. Its\n tap area is padded out past the glyph (a negative margin keeps the chip the\n same width) so it is easy to hit without looking like a button. */\n:where(.aia-input-IW-P-) span[class~=\"magicx-aia-segment-remove\"] {\n display: inline-block;\n width: 0.62em;\n height: 0.62em;\n margin-left: 5px;\n padding: 4px;\n margin-top: -4px;\n margin-bottom: -4px;\n margin-right: -4px;\n box-sizing: content-box;\n vertical-align: -0.02em;\n color: currentColor;\n opacity: var(--aia-chip-remove-opacity, 0.32);\n cursor: pointer;\n user-select: none;\n -webkit-user-select: none;\n /* Safari: the caret cannot be placed inside it. */\n -webkit-user-modify: read-only;\n transition: opacity 120ms ease;\n}\n\n/* Only where a pointer can hover: a touch would leave it stuck firmed up. */\n@media (hover: hover) {\n :where(.aia-input-IW-P-) span[class~=\"magicx-aia-segment-remove\"]:hover {\n opacity: var(--aia-chip-remove-opacity-hover, 0.7);\n }\n}\n\n:where(.aia-input-IW-P-) span[class~=\"magicx-aia-segment-remove\"] svg {\n display: block;\n width: 100%;\n height: 100%;\n fill: none;\n stroke: currentColor;\n stroke-width: 1.3;\n stroke-linecap: round;\n}\n\n/* By class: a page's \\`svg path { fill: … }\\` would beat the attribute-less path. */\n:where(.aia-input-IW-P-) span[class~=\"magicx-aia-segment-remove\"] svg path {\n fill: none;\n stroke: currentColor;\n}\n\n/* The picked option's picture: a small rounded tile inline before the chip\n text, in place of the icon. It is an empty inline span whose left padding\n is the tile's width and whose background is the picture (set inline as\n --aia-chip-image by the renderer) over a placeholder fill — not an <img>,\n which as an atomic inline would let the line break between it and the\n chip's text. The tile's height is the chip's own content height, so it\n never grows the input's line. The fill shows until the picture paints and\n stays if it never does; contentEditable is off on it (the renderer sets\n that) so it adds no characters to the caret's plain text. */\n:where(.aia-input-IW-P-) span[class~=\"magicx-aia-segment-image\"] {\n display: inline;\n padding-left: min(\n var(--aia-chip-image-size, 1.25em),\n var(--aia-chip-image-fit, var(--aia-chip-image-size, 1.25em))\n );\n margin-right: 5px;\n border-radius: var(--aia-chip-image-radius, 4px);\n background:\n var(--aia-chip-image, none) center / contain no-repeat,\n var(--aia-chip-image-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.083)));\n pointer-events: none;\n user-select: none;\n}\n\n/* Once the picture has loaded the placeholder fill steps aside, so a picture\n that doesn't fill the tile sits on the chip rather than on a grey box. The\n renderer sets the attribute when the picture loads, and narrows the tile to\n a tall picture's own width (--aia-chip-image-fit, capped by the size above)\n so the radius rounds the picture itself. */\n:where(.aia-input-IW-P-) span[class~=\"magicx-aia-segment-image\"][data-aia-image-loaded] {\n background: var(--aia-chip-image, none) center / contain no-repeat;\n}\n\n/* Re-edit highlight — applied to the completed pill being re-edited (after a\n tap). Reuses the exact hover fill so the highlight persists from tap until an\n option is selected. Hides the native caret; cursor switches to text since the\n pill is in text-replacement mode. The editing class is written by the shared\n renderer (a global string), so target it via an attribute selector to bypass\n CSS Modules' hashing. Declared last so it wins on a strong carrying both\n classes. */\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-segment--editing\"] {\n background: var(--aia-completed-pill-bg-active, rgba(189, 189, 189, 0.35));\n caret-color: transparent;\n cursor: text;\n}\n\n/* In re-edit mode the caret is parked just *before* the bold strong (see\n useContentEditableEditor.ts) — that means it sits in the parent .input, not\n inside the strong, so the rule above doesn't hide it. Use :has() to hide\n the caret on the whole editor while any completed param is selected. */\n.aia-input-IW-P-:has(strong[class~=\"magicx-aia-segment--editing\"]) {\n caret-color: transparent;\n}\n\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-segment--editing\"]::selection {\n background: transparent;\n color: inherit;\n}\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-segment--editing\"]::-moz-selection {\n background: transparent;\n color: inherit;\n}\n\n/* Placeholder via ::before so it doesn't enter the editable DOM. The text is\n typed in one character at a time by the core's typewriter (the attribute\n holds the typed prefix); the only fade is the outgoing phrase when the\n placeholder changes — its duration mirrors PLACEHOLDER_FADE_OUT_MS. */\n.aia-input-IW-P-[data-aia-empty=\"true\"][data-placeholder]::before {\n content: attr(data-placeholder);\n color: var(--aia-color-text-muted, #c1c4cb);\n opacity: 0.7;\n pointer-events: none;\n transition: opacity var(--aia-placeholder-fade, 120ms) ease-out;\n}\n\n/* The core updates state only at compositionend, so the editor still reads empty during IME composition.\n Hide the placeholder beside the composing text. */\n.aia-input-IW-P-[data-aia-empty=\"true\"][data-placeholder][data-aia-composing]::before {\n content: none;\n}\n\n.aia-input-IW-P-[data-aia-placeholder-leaving]::before {\n opacity: 0;\n}\n\n/* The empty box's hint (the lead word and the starting options, swapping\n one at a time) is a sibling laid over the input; while it shows, the\n input's own placeholder steps aside, and during IME composition the hint\n steps aside for the composing text. */\n.aia-input-IW-P-[data-aia-empty=\"true\"][data-placeholder][data-aia-hint]::before {\n content: none;\n}\n\n[data-aia-hint-el]:has(+ .aia-input-IW-P-[data-aia-composing]) {\n visibility: hidden;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-input-IW-P-[data-aia-empty=\"true\"][data-placeholder]::before {\n transition-duration: 0s;\n }\n}\n\n/* Empty inline contentEditables have no inline box for the caret to render\n in. Switch to inline-block (min-width matches the caret line) when empty,\n so the caret stays visible while focused. */\n.aia-input-IW-P-[data-aia-empty=\"true\"] {\n display: inline-block;\n min-width: 1px;\n}\n\n.aia-pillListContainer-h92IA {\n display: inline;\n margin-left: 8px;\n}\n\n.aia-pillListContainer-h92IA:empty,\n.aia-pillListContainer-h92IA[data-aia-pill-wrapped] {\n margin-left: 0;\n}\n\n.aia-submitSlot-GhuCM {\n display: contents;\n}\n\n/* Word → chip. A newly recognised param (renderEditable stamps shimmer-sweep\n on it) keeps its text in place while the chip forms around it: the fill and\n padding grow in over 300ms, and the picked option's icon or picture grows in\n front of the word — its width opening the room (so the words slide over),\n a small spring on its scale, a quick fade. The text itself never fades, so\n a typed word turns into a chip rather than vanishing and coming back. */\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-shimmer-sweep\"] {\n animation: aia-aiaChipForm-tKbNc 300ms ease both;\n}\n\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-shimmer-sweep\"] span[class~=\"magicx-aia-segment-icon\"] {\n animation:\n aia-aiaTileGrow-j9Pat 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both,\n aia-aiaTileSpring-FEwNg 380ms cubic-bezier(0.3, 1.5, 0.5, 1) both,\n aia-aiaTileFade-H1LDQ 200ms ease both;\n}\n\n/* The picture tile is an inline box (see its own rule), which can't scale, so\n it opens and fades without the spring. */\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-shimmer-sweep\"] span[class~=\"magicx-aia-segment-image\"] {\n animation:\n aia-aiaImageGrow-i9yw8 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both,\n aia-aiaTileFade-H1LDQ 200ms ease both;\n}\n\n@keyframes aia-aiaChipForm-tKbNc {\n from {\n background-color: transparent;\n padding-left: 0;\n padding-right: 0;\n }\n}\n\n@keyframes aia-aiaTileGrow-j9Pat {\n from {\n width: 0;\n margin-right: 0;\n }\n}\n\n@keyframes aia-aiaTileSpring-FEwNg {\n from {\n transform: scale(0.4);\n }\n}\n\n/* A hair above zero, like the other fades — see magicx-aia-fadeIn. */\n@keyframes aia-aiaTileFade-H1LDQ {\n from {\n opacity: 0.01;\n }\n}\n\n@keyframes aia-aiaImageGrow-i9yw8 {\n from {\n padding-left: 0;\n margin-right: 0;\n }\n}\n\n/* Reduced motion: a word becomes a chip at once. */\n@media (prefers-reduced-motion: reduce) {\n :where(.aia-input-IW-P-) strong[class~=\"magicx-aia-shimmer-sweep\"],\n :where(.aia-input-IW-P-) strong[class~=\"magicx-aia-shimmer-sweep\"] span[class~=\"magicx-aia-segment-icon\"],\n :where(.aia-input-IW-P-) strong[class~=\"magicx-aia-shimmer-sweep\"] span[class~=\"magicx-aia-segment-image\"] {\n animation: none;\n }\n}\n\n/* --- Text box growth ---\n watchEditorHeight writes the editor's height on every change, so a new line\n opens over EDITOR_GROW_MS (340ms) instead of popping in. Reduced motion and\n \\`animations: false\\` drop the slide; the height still follows the text. */\n.aia-editorArea-7rBWq {\n transition: height 340ms cubic-bezier(0.2, 0.8, 0.2, 1);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-editorArea-7rBWq {\n transition: none;\n }\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"container\":\"aia-container-KKjFU\",\"inputWrapper\":\"aia-inputWrapper-FLq1b\",\"editorArea\":\"aia-editorArea-7rBWq\",\"input\":\"aia-input-IW-P-\",\"pillListContainer\":\"aia-pillListContainer-h92IA\",\"submitSlot\":\"aia-submitSlot-GhuCM\",\"aiaChipForm\":\"aia-aiaChipForm-tKbNc\",\"aiaTileGrow\":\"aia-aiaTileGrow-j9Pat\",\"aiaTileSpring\":\"aia-aiaTileSpring-FEwNg\",\"aiaTileFade\":\"aia-aiaTileFade-H1LDQ\",\"aiaImageGrow\":\"aia-aiaImageGrow-i9yw8\"};","import {\n attachScrollArrow,\n attachViewportFit,\n containScroll,\n dateFloorFor,\n destroyPanelMorph,\n findMultiSelectDone,\n fitMultiSelectDone,\n hasSkippablePill,\n isCalendarFormat,\n labelTraditionalAutocomplete,\n panelMorphKey,\n queryLive,\n type ScrollArrowController,\n settlePanelMorph,\n syncPanelHug,\n uiStringsFor,\n type ViewportFitController,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { type RefObject, useEffect, useLayoutEffect, useRef, useState } from \"react\";\n\n// Layout effect in the browser (no wide-then-narrow flash), plain effect on the server.\nconst useIsoLayoutEffect = typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n// Self-inject the appearance layer (design tokens, box-sizing reset, and the\n// optionsPosition=\"above\" layout-reversal rules). Tier 1 already imports this,\n// but headless consumers render only this dropdown — importing it here means\n// they get correct styling and a working `optionsPosition` with no extra setup.\nimport \"./appearance.css\";\nimport styles from \"./AIAutocompleteDropdown.module.css\";\nimport { DateGrid } from \"./components/DateGrid\";\nimport { DropdownFooter } from \"./components/DropdownFooter\";\nimport { LocationField } from \"./components/LocationField\";\nimport { PillList } from \"./components/PillList\";\nimport { ProductStrip } from \"./components/ProductStrip\";\nimport { SuggestionGrid } from \"./components/SuggestionGrid\";\nimport { TimeWheel } from \"./components/TimeWheel\";\nimport { Cluster } from \"./layout/Cluster\";\nimport { Stack } from \"./layout/Stack\";\nimport type { AIAutocompleteDropdownProps } from \"./types\";\n\nconst FALLBACK_SKELETON_BAR_WIDTHS = [159, 119, 164];\n\n// Module constant, not an inline arrow: a fresh closure per render would defeat\n// ProductStrip's prop stability for no reason. Reached only by a Tier 2\n// consumer who renders products without wiring onProductSelect.\nconst NOOP_PRODUCT_SELECT = () => {};\n/** A Tier 2 consumer who renders the dropdown without wiring month paging gets inert arrows, not a crash. */\nconst NOOP_MONTH = () => {};\nconst NOOP_TIME_CHANGE = (_minutes: number) => {};\nconst NOOP_TIME_COMMIT = () => {};\nconst NOOP_LOCATION_QUERY = (_query: string) => {};\nconst NOOP_LOCATION_MOVE = (_delta: number) => {};\nconst NOOP_LOCATION_COMMIT = (_index?: number) => {};\nconst NOOP_LOCATION_FOCUS = (_focused: boolean) => {};\n\n/**\n * Resolve the `mode` prop to a concrete `\"light\" | \"dark\"` (or `undefined` when\n * unset, meaning \"don't self-scope — inherit from a `.magicx-aia` ancestor\").\n * `\"auto\"` tracks `prefers-color-scheme` live.\n */\nfunction useResolvedMode(\n mode: \"light\" | \"dark\" | \"auto\" | undefined,\n): \"light\" | \"dark\" | undefined {\n const prefersDark = () =>\n typeof window !== \"undefined\" &&\n typeof window.matchMedia === \"function\" &&\n window.matchMedia(\"(prefers-color-scheme: dark)\").matches;\n const [systemDark, setSystemDark] = useState(prefersDark);\n\n useEffect(() => {\n if (\n mode !== \"auto\" ||\n typeof window === \"undefined\" ||\n typeof window.matchMedia !== \"function\"\n ) {\n return;\n }\n const mq = window.matchMedia(\"(prefers-color-scheme: dark)\");\n const onChange = () => setSystemDark(mq.matches);\n mq.addEventListener(\"change\", onChange);\n return () => mq.removeEventListener(\"change\", onChange);\n }, [mode]);\n\n if (mode === undefined) return undefined;\n if (mode === \"auto\") return systemDark ? \"dark\" : \"light\";\n return mode;\n}\n\n/**\n * Keeps the core's \"more below\" arrow controller bound to whichever options\n * grid the dropdown currently renders. The controller owns the behaviour\n * (measuring, visibility, the page-scroll on click — see the core's\n * scrollArrow.ts); this hook only hands it the live elements and tells it to\n * re-measure after every render, re-attaching when the grid element is\n * replaced and tearing down when there is no grid.\n */\nfunction useScrollArrow(\n rootRef: RefObject<HTMLDivElement>,\n buttonRef: RefObject<HTMLButtonElement>,\n): void {\n const boundRef = useRef<{ grid: HTMLElement; controller: ScrollArrowController } | null>(null);\n\n // No dependency array on purpose: the grid can come and go with any render,\n // and update() is a cheap attribute compare when nothing changed. This\n // effect deliberately returns no cleanup — a cleanup here would run before\n // every re-run and tear the controller down on each render (re-arming its\n // \"new group\" gate every time). The controller's lifetime is instead tied to\n // the grid element (destroyed when the grid is replaced or gone, below) and\n // to the component (the mount-only effect after this one), which also\n // survives StrictMode's mount → cleanup → mount pass.\n // biome-ignore lint/correctness/useExhaustiveDependencies: runs after every render by design\n useEffect(() => {\n const root = rootRef.current;\n const button = buttonRef.current;\n if (!root || !button) return;\n const grid = queryLive<HTMLElement>(root, \".aia-grid[data-scroll]\");\n if (boundRef.current && boundRef.current.grid !== grid) {\n boundRef.current.controller.destroy();\n boundRef.current = null;\n }\n if (grid && !boundRef.current) {\n boundRef.current = {\n grid,\n controller: attachScrollArrow({ dropdown: root, grid, button }),\n };\n return; // attach() runs the first update itself\n }\n boundRef.current?.controller.update();\n });\n\n useEffect(\n () => () => {\n boundRef.current?.controller.destroy();\n boundRef.current = null;\n },\n [],\n );\n}\n\n/**\n * Keeps the open panel inside the visible viewport — above a phone's keyboard\n * — through the core's fit controller (see the core's viewportFit.ts), which\n * owns the measuring and the listeners. Like useScrollArrow, it re-measures\n * after every render; `isVisible` is read through a ref so the controller,\n * attached once, always sees the latest value. The update is a layout effect\n * declared before the panel morph's, so in one commit the fit caps the height\n * first and the morph glides from the capped height, never a stale one.\n */\nfunction useViewportFit(rootRef: RefObject<HTMLDivElement>, isVisible: boolean): void {\n const visibleRef = useRef(isVisible);\n visibleRef.current = isVisible;\n const fitRef = useRef<ViewportFitController | null>(null);\n\n // No dependency array on purpose — see useScrollArrow.\n // biome-ignore lint/correctness/useExhaustiveDependencies: runs after every render by design\n useLayoutEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n if (!fitRef.current) {\n fitRef.current = attachViewportFit({ dropdown: root, isOpen: () => visibleRef.current });\n return; // attach() runs the first update itself\n }\n fitRef.current.update();\n });\n\n useEffect(\n () => () => {\n fitRef.current?.destroy();\n fitRef.current = null;\n },\n [],\n );\n}\n\nexport function AIAutocompleteDropdown({\n suggestions,\n activeIndex,\n onSelect,\n onHighlight,\n onUnhighlight,\n isOpen,\n id,\n className,\n pills,\n onPillClick,\n showPills = true,\n onSkip,\n showSkipButton = true,\n showOptionIcons = true,\n showOptionImages = true,\n showOptionCounts = true,\n skipDisabled = false,\n activeSelected = false,\n isLoading = false,\n skeletonExiting = false,\n isInputEmpty = false,\n language,\n products,\n onProductSelect,\n onProductAddToCart,\n onProductFocusChange,\n productsLayout = \"row\",\n productImageFallback = \"image\",\n showProductVendor = true,\n formatType = \"options\",\n dateView = null,\n selectedDateIso = null,\n selectedDateRange = null,\n dateRangeStart = null,\n dateReferences,\n onPreviousMonth,\n onNextMonth,\n timeView = null,\n multiSelectView = null,\n onMultiSelectCommit,\n onSeeAllResults,\n seeAllBusy = false,\n busyProductId = null,\n fullWidth = false,\n onTimeChange,\n onTimeCommit,\n locationView = null,\n isReediting = false,\n onLocationQuery,\n onLocationMove,\n onLocationCommit,\n onLocationFocusChange,\n isFocused = false,\n optionsPosition = \"below\",\n mode,\n}: AIAutocompleteDropdownProps) {\n // When `mode` is set, self-scope: add `magicx-aia` + `data-mode` to our own\n // root so the dropdown is styled without a `.magicx-aia` wrapper. When unset,\n // stay class-less and inherit from an ancestor (Tier 1 / a custom wrapper).\n const resolvedMode = useResolvedMode(mode);\n const selfScope = resolvedMode !== undefined;\n\n const rootRef = useRef<HTMLDivElement>(null);\n const scrollArrowRef = useRef<HTMLButtonElement>(null);\n useScrollArrow(rootRef, scrollArrowRef);\n\n // Wheel/touch over the dropdown never scrolls the page behind it. A native\n // listener, not onWheel: React registers wheel/touch handlers as passive, so\n // their preventDefault is ignored.\n useEffect(() => {\n if (!rootRef.current) return;\n return containScroll(rootRef.current);\n }, []);\n\n // Visibility is computed from the CURRENT props and drives the opacity fade.\n const liveOptions = suggestions[0]?.options ?? [];\n const liveHasRealPills = Boolean(pills && pills.length > 0 && onPillClick);\n // Either half is enough to keep the panel up: products render with no\n // suggestions, suggestions render with no products.\n const liveHasProducts = Boolean(products && products.length > 0);\n // A time pill has no options by design — the wheel is its whole body.\n const liveHasTimeWheel = formatType === \"time\" && timeView != null;\n // A location pill has no options by design: the search field is its whole body.\n const liveHasLocationField = formatType === \"location\" && locationView != null;\n const isVisible =\n isOpen &&\n (liveOptions.length > 0 ||\n (showPills && liveHasRealPills) ||\n isLoading ||\n liveHasProducts ||\n liveHasTimeWheel ||\n liveHasLocationField);\n useViewportFit(rootRef, isVisible);\n // Every render: Done is sized to the widest option the panel now shows, and\n // the panel hugs its options.\n useIsoLayoutEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n fitMultiSelectDone(root, findMultiSelectDone(root));\n // The panel hugs its options (the core's panelHugWidth.ts).\n syncPanelHug(root);\n });\n\n // Freeze the content-driving values while the dropdown is open. When it\n // closes we render this frozen snapshot during the 400ms opacity fade, so the\n // whole populated dropdown fades out as one. Otherwise the pills/options\n // unmount the instant the underlying state empties (e.g. skipping the last\n // pill with →), leaving the always-present footer alone for a flash of a\n // footer-only \"no options\" box. Content is refreshed on the next open.\n const snapshot = {\n suggestions,\n activeIndex,\n pills,\n showPills,\n showSkipButton,\n showOptionIcons,\n showOptionImages,\n showOptionCounts,\n skipDisabled,\n activeSelected,\n isLoading,\n skeletonExiting,\n isInputEmpty,\n products,\n formatType,\n dateView,\n selectedDateIso,\n selectedDateRange,\n dateRangeStart,\n dateReferences,\n timeView,\n multiSelectView,\n locationView,\n isReediting,\n showsSeeAll: Boolean(onSeeAllResults),\n };\n const lastVisibleRef = useRef(snapshot);\n if (isVisible) lastVisibleRef.current = snapshot;\n const content = isVisible ? snapshot : lastVisibleRef.current;\n // Only the explicit language prop picks the words, as in the vanilla widget.\n const strings = uiStringsFor(language);\n\n const activeSuggestion = content.suggestions[0];\n const options = activeSuggestion?.options ?? [];\n const isOptionHighlighted =\n content.activeIndex >= 0 && Boolean(options[content.activeIndex]?.is_tappable);\n const shownPills = labelTraditionalAutocomplete(content.pills ?? [], strings.keepTyping);\n const hasRealPills = Boolean(shownPills.length > 0 && onPillClick);\n // Guarantee at least one option bar during loading — if the cached state\n // had no options, render the fallback skeleton bars regardless of whether\n // pills are present, so the dropdown never shows pills with an empty body.\n const showsRealPills = content.showPills && hasRealPills;\n const showsLoadingPills = content.showPills && !hasRealPills && content.isLoading;\n const showsPillBar = showsRealPills || showsLoadingPills;\n // The trailing \"skip\" button only makes sense next to a real, skippable\n // pill — the fallback skeleton bar has nothing to skip. Requires onSkip:\n // a Tier 2 consumer rendering the dropdown without wiring it gets no\n // dead button. Deliberately NOT gated on showPills: with pills rendered\n // elsewhere (pillPlacement \"inline\"/\"hidden\") the bar renders as a\n // skip-only row holding just the button. Hidden while the input is empty —\n // the 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 hasRealPills &&\n hasSkippablePill(shownPills) &&\n content.showSkipButton &&\n !content.isInputEmpty &&\n Boolean(onSkip);\n const activePillLabel = shownPills[0]?.text;\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 derive\n // layer — so the two are the same list drawn two different ways, and never\n // both at once (two elements answering to `#${id}-option-0` would break\n // keyboard commit).\n //\n // A calendar is withheld while a request is in flight. The options grid\n // draws its cached options as skeleton rows for that window, but a month of\n // day cells has no skeleton form worth drawing — and a live calendar over a\n // loading pill bar invites an answer against suggestions the response is\n // about to replace. The fallback bars stand in until it lands.\n const isDate = isCalendarFormat(content.formatType) && content.dateView != null;\n const showsOptions = options.length > 0 && !isDate;\n const showsDateGrid = options.length > 0 && isDate && !content.isLoading;\n // The time wheel and the location field are withheld while a request is in\n // flight, for the calendar's reasons above: each belongs to the pill the\n // response will confirm. Their pills have no options by design, so it is the\n // format — not the option count — that says they show.\n const showsTimeWheel =\n content.formatType === \"time\" && content.timeView != null && !content.isLoading;\n const showsLocationField =\n content.formatType === \"location\" && content.locationView != null && !content.isLoading;\n const showsFallbackSkeleton =\n content.isLoading && !showsOptions && !showsDateGrid && !showsTimeWheel && !showsLocationField;\n // `data-aia-has-products` below is the layout hook: the band the footer\n // rides up over only makes sense when the footer sits directly on the\n // scrolling option list, and appearance.css reads the attribute to zero it\n // at the source when a strip is in between.\n const stripProducts = content.products ?? [];\n\n // The open panel's height glide and question crossfade, shared with vanilla\n // and Angular (panelMorph.ts). Runs before paint after a commit that changes\n // what the panel shows; a highlight, caret or focus commit is left out, so it\n // never restarts a running glide (the core also skips unchanged content).\n const morphKey = panelMorphKey(showsRealPills ? shownPills : []);\n // biome-ignore lint/correctness/useExhaustiveDependencies: the content values are re-settle triggers, not reads\n useLayoutEffect(() => {\n if (!rootRef.current) return;\n settlePanelMorph(rootRef.current, morphKey, {\n visible: isVisible,\n anchorBottom: optionsPosition === \"above\",\n });\n }, [\n morphKey,\n isVisible,\n optionsPosition,\n content.suggestions,\n content.pills,\n content.isLoading,\n content.skeletonExiting,\n content.isInputEmpty,\n content.products,\n content.formatType,\n content.dateView,\n content.selectedDateIso,\n content.selectedDateRange,\n content.dateRangeStart,\n content.dateReferences,\n content.timeView,\n content.multiSelectView,\n content.locationView,\n content.showPills,\n content.showSkipButton,\n content.showOptionIcons,\n content.showOptionImages,\n content.showOptionCounts,\n content.showsSeeAll,\n // \"list\" restacks the product strip as full-width rows.\n productsLayout,\n // The words on show (skip, the loading line) change height with the language.\n language,\n ]);\n useEffect(() => {\n const el = rootRef.current;\n return () => {\n if (el) destroyPanelMorph(el);\n };\n }, []);\n\n return (\n <div\n ref={rootRef}\n id={id}\n role=\"listbox\"\n aria-multiselectable={Boolean(content.multiSelectView)}\n data-aia-dropdown=\"\"\n data-options-position={optionsPosition}\n data-mode={resolvedMode}\n data-aia-loading={content.isLoading ? \"\" : undefined}\n data-aia-skeleton-exiting={content.skeletonExiting ? \"\" : undefined}\n data-aia-has-products={stripProducts.length > 0 ? \"\" : undefined}\n data-aia-full-width={fullWidth ? \"\" : undefined}\n className={`${selfScope ? \"magicx-aia \" : \"\"}${styles.dropdown} ${isVisible ? styles.visible : \"\"} ${className ?? \"\"}`}\n onMouseDown={(e) => e.preventDefault()}\n >\n <Stack space=\"8px\">\n {(showsPillBar || showsSkip) && (\n <Cluster noWrap className={styles.pillBar} data-aia-pillbar=\"\">\n {/* The scroll + right-edge fade live on this wrapper (not the bar)\n so the skip button stays outside the masked region — pinned and\n fully opaque while overflowing pills fade under it. The\n data-aia-pill-scroll attribute is the public styling hook for\n the mask, since the module class hash isn't part of the API.\n Absent in a skip-only row (pills rendered elsewhere). */}\n {showsPillBar && (\n <span className={styles.pillScroll} data-aia-pill-scroll=\"\">\n <PillList\n pills={shownPills}\n activePillIndex={0}\n activeSelected={content.activeSelected}\n onSelectPill={onPillClick ?? (() => {})}\n rounded\n loading={content.isLoading}\n />\n </span>\n )}\n {showsSkip && (\n <button\n type=\"button\"\n tabIndex={-1}\n className={styles.skip}\n data-aia-skip=\"\"\n disabled={content.isLoading || content.skipDisabled}\n aria-label={\n activePillLabel ? `${strings.skipLabel} ${activePillLabel}` : strings.skipLabel\n }\n onClick={onSkip}\n >\n {strings.skip}\n </button>\n )}\n </Cluster>\n )}\n {showsOptions && (\n <SuggestionGrid\n options={options}\n activeIndex={content.activeIndex}\n onSelect={onSelect}\n onHighlight={onHighlight}\n onUnhighlight={onUnhighlight}\n listboxId={id}\n loading={content.isLoading}\n groupKey={\n activeSuggestion ? `${activeSuggestion.parameter} ${activeSuggestion.text}` : \"\"\n }\n optionsPosition={optionsPosition}\n showIcons={content.showOptionIcons}\n showImages={content.showOptionImages}\n showCounts={content.showOptionCounts}\n picked={content.multiSelectView?.picked}\n />\n )}\n {content.multiSelectView && (\n // biome-ignore lint/a11y/noStaticElementInteractions: Delegates clicks from the native button to preserve iOS taps.\n // biome-ignore lint/a11y/useKeyWithClickEvents: The native button generates keyboard clicks.\n <div\n data-aia-multi-actions=\"\"\n onClick={(event) => {\n if (\n (event.target as HTMLElement).closest(\"[data-aia-multi-done]\") &&\n !content.skipDisabled &&\n !content.isLoading\n )\n onMultiSelectCommit?.();\n }}\n >\n <button\n type=\"button\"\n tabIndex={-1}\n disabled={true}\n data-aia-multi-done=\"\"\n className={styles.multiDone}\n ref={(button) => {\n if (!button) return;\n button.disabled = true;\n void button.offsetHeight;\n button.disabled = content.skipDisabled || content.isLoading;\n }}\n >\n {strings.done}\n </button>\n </div>\n )}\n {showsDateGrid && content.dateView && (\n <DateGrid\n options={options}\n activeIndex={content.activeIndex}\n listboxId={id}\n view={content.dateView}\n selection={{\n selectedIso: content.selectedDateIso ?? null,\n selectedRange: content.selectedDateRange ?? null,\n rangeStart: content.dateRangeStart ?? null,\n floor: dateFloorFor(content.formatType, content.dateRangeStart),\n references: content.dateReferences ?? [],\n }}\n onSelect={onSelect}\n onHighlight={onHighlight}\n onUnhighlight={onUnhighlight}\n onPreviousMonth={onPreviousMonth ?? NOOP_MONTH}\n onNextMonth={onNextMonth ?? NOOP_MONTH}\n />\n )}\n {showsTimeWheel && content.timeView && (\n <TimeWheel\n view={content.timeView}\n label={strings.timeLabel}\n doneLabel={strings.done}\n // The press window after an answer, as for the option grid.\n interactive={!content.skipDisabled}\n onTimeChange={onTimeChange ?? NOOP_TIME_CHANGE}\n onTimeCommit={onTimeCommit ?? NOOP_TIME_COMMIT}\n />\n )}\n {showsLocationField && content.locationView && (\n <LocationField\n view={content.locationView}\n searchLabel={strings.locationSearch}\n noResultsLabel={strings.locationNoResults}\n useTypedLabel={strings.locationUseTyped}\n widgetFocused={isFocused && isVisible}\n reediting={content.isReediting}\n visible={isVisible}\n interactive={!content.skipDisabled}\n onQuery={onLocationQuery ?? NOOP_LOCATION_QUERY}\n onMove={onLocationMove ?? NOOP_LOCATION_MOVE}\n onCommit={onLocationCommit ?? NOOP_LOCATION_COMMIT}\n onFocusChange={onLocationFocusChange ?? NOOP_LOCATION_FOCUS}\n />\n )}\n {showsFallbackSkeleton && (\n <div className={styles.skeletonBars} data-aia-skeleton-bars=\"\">\n {FALLBACK_SKELETON_BAR_WIDTHS.map((w) => (\n <span key={`bar-${w}`} className={styles.skeletonBar} style={{ width: w }} />\n ))}\n </div>\n )}\n <ProductStrip\n products={stripProducts}\n listboxId={id}\n onSelect={onProductSelect ?? NOOP_PRODUCT_SELECT}\n busyProductId={busyProductId}\n onAddToCart={onProductAddToCart}\n onFocusChange={onProductFocusChange}\n focusable={isVisible && !content.isLoading}\n loading={content.isLoading}\n layout={productsLayout}\n imageFallback={productImageFallback}\n showVendor={showProductVendor}\n strings={strings}\n />\n {content.showsSeeAll && (\n // Delegated from the native button, like Done: iOS keeps the tap.\n // The button is armed only after it is laid out, so a response\n // landing mid-tap never cancels a tap elsewhere.\n // biome-ignore lint/a11y/noStaticElementInteractions: Delegates clicks from the native button to preserve iOS taps.\n // biome-ignore lint/a11y/useKeyWithClickEvents: The native button generates keyboard clicks.\n <div\n className={styles.seeAllRow}\n data-aia-see-all=\"\"\n onClick={(event) => {\n if (!(event.target as HTMLElement).closest(\"[data-aia-see-all-button]\")) return;\n // The panel sits inside the widget: a click bubbling on would read\n // as a click on the input and reopen what the submit just closed.\n event.stopPropagation();\n // A submit in progress: this press is the same submit again.\n if (content.isLoading || seeAllBusy) return;\n onSeeAllResults?.();\n }}\n >\n <button\n type=\"button\"\n tabIndex={-1}\n disabled={true}\n data-aia-see-all-button=\"\"\n data-aia-see-all-state={seeAllBusy ? \"busy\" : undefined}\n aria-busy={seeAllBusy ? true : undefined}\n className={styles.seeAll}\n ref={(button) => {\n if (!button) return;\n button.disabled = true;\n void button.offsetHeight;\n button.disabled = content.isLoading;\n }}\n >\n {strings.seeAllResults}\n </button>\n </div>\n )}\n <DropdownFooter\n isOptionHighlighted={isOptionHighlighted}\n isInputEmpty={content.isInputEmpty}\n strings={strings}\n />\n </Stack>\n {/* \"More below\" arrow — an overlay on the panel, not a section of the\n stack. Shown/positioned by the core's controller (useScrollArrow);\n markup mirrors vanilla's createScrollArrowButton. */}\n <button\n ref={scrollArrowRef}\n type=\"button\"\n tabIndex={-1}\n className={styles.scrollArrow}\n data-aia-scroll-arrow=\"\"\n aria-label={strings.scrollArrow}\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 strokeWidth=\"1.75\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"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 );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-0ae03977\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-0ae03977\";\n s.textContent = `/*\n * Built-in appearance defaults — zero specificity via :where().\n * Consumer CSS always wins without !important.\n *\n * Resolution priority (highest wins):\n * 1. Consumer CSS targeting new vars (--aia-pill-bg, etc.)\n * 2. Consumer CSS targeting legacy vars (--aia-color-*, via fallback chain)\n * 3. These built-in defaults\n */\n\n/*\n * Library-scoped box-sizing reset. The SDK's pill / option / wrapper styles\n * mix explicit dimensions with padding (e.g. .magicx-aia-pill has height:36px\n * + padding:13px) and were authored assuming \\`border-box\\`. In consumer apps\n * without a global \\`* { box-sizing: border-box }\\` reset the pill rendered\n * ~62px tall instead of 36px. The root gets it here; everything under the SDK's\n * own roots gets it from the isolation rule below, and nothing else does.\n */\n:where(.magicx-aia) {\n box-sizing: border-box;\n}\n\n/*\n * Consumer isolation. Everything the SDK renders sits under one of two roots\n * it owns — the Tier 1 input wrapper and the dropdown — and every element\n * under them rolls its author-level styles back to the browser defaults\n * (\\`all: revert\\`) before the SDK's own rules apply. A page's element and\n * universal rules (\\`button { … }\\`, \\`a { … }\\`, \\`* { … }\\`, a CSS reset, a\n * framework's preflight) therefore never reach the widget.\n *\n * The selector is shaped for specificity (0,0,5) on purpose:\n * - \\`:where(...)\\` contributes nothing, so the scope never outranks anything;\n * - five \\`:not(html)\\` add one type-level unit each — enough to beat any\n * type-only page selector up to five compounds deep (\\`html body main form\n * button\\`), and still below every rule that names a class, attribute or id.\n * The SDK's own class rules, and a consumer's intentional overrides on the\n * \\`data-aia-*\\` hooks, therefore win exactly as before.\n *\n * Left alone: the roots' ancestors (the consumer's container), inline SVG\n * (\\`revert\\` strips presentation attributes such as \\`stroke\\` and \\`d\\`, which\n * would blank the icons), and the consumer's own submit button and whatever\n * is inside it (\\`[data-aia-submit-slot]\\`). Custom properties are outside\n * \\`all\\`, so \\`--aia-*\\` theming still flows in from the page.\n *\n * Every SDK rule must therefore carry at least one class or attribute; a\n * type-only or \\`:where()\\`-only rule would lose to this one, and a rule inside\n * a cascade layer would lose to it whatever its specificity.\n * \\`packages/vanilla/tests/packaging/consumerIsolation.test.ts\\` enforces both\n * and keeps the four copies of this block identical.\n */\n:where(\n [data-aia-input-wrapper],\n [data-aia-input-wrapper] *,\n [data-aia-dropdown],\n [data-aia-dropdown] *\n ):not(:where(svg, svg *, [data-aia-submit-slot], [data-aia-submit-slot] *)):not(html):not(\n html\n ):not(html):not(html):not(html),\n:where(\n [data-aia-input-wrapper],\n [data-aia-input-wrapper] *,\n [data-aia-dropdown],\n [data-aia-dropdown] *\n ):not(:where(svg, svg *, [data-aia-submit-slot], [data-aia-submit-slot] *)):not(html):not(\n html\n ):not(html):not(html):not(html)::before,\n:where(\n [data-aia-input-wrapper],\n [data-aia-input-wrapper] *,\n [data-aia-dropdown],\n [data-aia-dropdown] *\n ):not(:where(svg, svg *, [data-aia-submit-slot], [data-aia-submit-slot] *)):not(html):not(\n html\n ):not(html):not(html):not(html)::after {\n all: revert;\n box-sizing: border-box;\n}\n\n/* Inherited typography stops at the roots too. \\`revert\\` leaves an inherited\n property to inherit, so a page's \\`body { line-height: 1.8; letter-spacing:\n 0.05em; text-transform: uppercase }\\` would still flow into the widget through\n its container. The font itself (family, size, weight) and the text colour are\n meant to come from the page — see --aia-font-family — so they keep\n inheriting; the adjustments below return to their initial values at the two\n roots and inherit from there. Same specificity as the reset above and after\n it in source order, so it wins the tie on the roots. */\n:where([data-aia-input-wrapper], [data-aia-dropdown]):not(html):not(html):not(html):not(html):not(\n html\n ) {\n line-height: normal;\n letter-spacing: normal;\n word-spacing: normal;\n text-transform: none;\n text-indent: 0;\n text-align: start;\n text-shadow: none;\n font-style: normal;\n font-variant: normal;\n white-space: normal;\n visibility: visible;\n cursor: auto;\n}\n\n/* Inline SVG is outside the reset: \\`revert\\` would strip an icon's presentation\n attributes (\\`stroke\\`, \\`d\\`, \\`fill=\"none\"\\`) and blank it. A page's\n \\`svg { display: block; max-width: 100%; margin: 0 auto; transition: … }\\`\n would therefore still reach every icon, so the box properties a page puts\n on \\`svg\\` are reverted here by name — never width, height, fill, the stroke\n family, opacity or transform, which an icon carries as attributes. Size and\n paint are pinned by class where the SDK draws an icon itself (the submit\n arrow, the scroll chevron; option icons are sized by their own class rule).\n The consumer's submit slot keeps its own icon styling. Same (0,0,5) as the\n reset; the second rule is for a \\`* { transition }\\` reaching the paths. */\n:where([data-aia-input-wrapper] svg, [data-aia-dropdown] svg):not(\n :where([data-aia-submit-slot] *)\n ):not(html):not(html):not(html):not(html):not(html) {\n display: revert;\n vertical-align: revert;\n position: revert;\n inset: revert;\n float: revert;\n margin: revert;\n padding: revert;\n border: revert;\n border-radius: revert;\n outline: revert;\n background: revert;\n box-shadow: revert;\n min-width: revert;\n max-width: revert;\n min-height: revert;\n max-height: revert;\n flex: revert;\n transition: revert;\n animation: revert;\n rotate: revert;\n scale: revert;\n translate: revert;\n}\n:where([data-aia-input-wrapper] svg *, [data-aia-dropdown] svg *):not(\n :where([data-aia-submit-slot] *)\n ):not(html):not(html):not(html):not(html):not(html) {\n transition: revert;\n animation: revert;\n}\n\n/*\n * Primitive color ramp — single source of truth, mirroring the Figma\n * \"Primitives\" collection. INTERNAL: theme via the public --aia-* vars below,\n * not these. Mode-independent (raw values; the same in light and dark).\n */\n:where(.magicx-aia) {\n --aia-primitive-neutral-0: #000000;\n --aia-primitive-neutral-150: #1a1b1d;\n --aia-primitive-neutral-250: #323232;\n --aia-primitive-neutral-300: #333539;\n --aia-primitive-neutral-400: #4a4a4a;\n --aia-primitive-neutral-500: #505050;\n --aia-primitive-neutral-700: #b0b0b0;\n --aia-primitive-neutral-750: #bdbdbd;\n --aia-primitive-neutral-900: #e7e7e7;\n --aia-primitive-neutral-1000: #ffffff;\n --aia-primitive-blue-50: #eef2ff;\n --aia-primitive-neutral-750-a50: rgba(189, 189, 189, 0.51);\n --aia-primitive-neutral-750-a25: rgba(189, 189, 189, 0.25);\n /* One third of a25's alpha: the light-mode skeleton fill. */\n --aia-primitive-neutral-750-a8: rgba(189, 189, 189, 0.083);\n --aia-primitive-neutral-750-a35: rgba(189, 189, 189, 0.35);\n --aia-primitive-neutral-750-a30: rgba(189, 189, 189, 0.3);\n --aia-primitive-neutral-750-a15: rgba(189, 189, 189, 0.15);\n /* a105 is a15 lightened 30% (0.15 -> 0.105) — a fainter tint of the same\n gray, not a new color. Light mode only: over a WHITE surface a weaker\n tint is lighter, but over the dark theme's black surface it would be\n darker, so dark mode keeps a15. */\n --aia-primitive-neutral-750-a105: rgba(189, 189, 189, 0.105);\n --aia-primitive-neutral-700-a40: rgba(176, 176, 176, 0.4);\n /* Exactly 0.5, unlike the older 750-a50 above (0.51). */\n --aia-primitive-neutral-900-a50: rgba(231, 231, 231, 0.5);\n --aia-primitive-neutral-400-a50: rgba(74, 74, 74, 0.5);\n}\n\n/* Light mode defaults (base) — public --aia-* vars resolve to primitives */\n:where(.magicx-aia),\n:where(.magicx-aia[data-mode=\"light\"]) {\n --aia-surface: var(--aia-primitive-neutral-1000);\n --aia-border: rgba(17, 24, 39, 0.14); /* subtle slate hairline (off-palette) */\n /* Flat by default — no elevation on the input container. Consumers set\n --aia-shadow to add one. */\n --aia-shadow: none;\n /* Half-strength stroke: neutral-900 (was #e5e7eb — snapped to palette,\n Δ2) at 50% alpha over the surface, so the hairline lands exactly\n halfway between its old value and the white behind it. */\n --aia-dropdown-border: transparent; /* no stroke by default */\n --aia-dropdown-shadow: none; /* flat by default */\n /* Suggestion pills (Figma \"ParamPill\"): transparent fill, no visible border;\n per-pill opacity via getPillOpacity. */\n --aia-pill-bg: var(--aia-primitive-neutral-750);\n --aia-pill-color: var(--aia-primitive-neutral-300);\n --aia-pill-font-size: 16px;\n /* Smart Suggestion sparkle, matched text, and the shimmer's bright centre. */\n --aia-smart-suggestion-accent: #b84549;\n --aia-smart-suggestion-glint: #f3c4c5;\n /* How strongly a half-built syllable at the end of a match shows the accent. */\n --aia-option-match-partial-opacity: 0.45;\n\n /* Completed params (Figma \"RichTextPill\"): compact faint-gray chip with\n primary-color regular-weight text. -active is the hover / tapped (re-edit)\n highlight — an alpha over the input background, so one value works in both\n themes. */\n --aia-completed-pill-bg: var(--aia-primitive-neutral-750-a105);\n --aia-completed-pill-bg-active: var(--aia-primitive-neutral-750-a35);\n --aia-completed-pill-color: var(--aia-primitive-neutral-0);\n\n --aia-option-bg: var(--aia-primitive-blue-50);\n /* Option text: a softer grey than the parameter label above it. */\n --aia-option-color: var(--aia-primitive-neutral-500);\n /* The floating box's thin options scrollbar: track and thumb. */\n --aia-scrollbar-track: rgba(15, 23, 42, 0.05);\n --aia-scrollbar-thumb: rgba(15, 23, 42, 0.22);\n --aia-option-color-selected: var(--aia-primitive-neutral-0);\n --aia-option-font-size: 16px;\n\n --aia-written-text-color: var(--aia-primitive-neutral-0);\n /* The typed query keeps its full size; only the options box below it is\n scaled down, so the query reads larger than the choices. */\n --aia-written-text-font-size: 16px;\n --aia-caret-color: var(--aia-written-text-color, #000000);\n\n --aia-submit-bg: var(--aia-primitive-neutral-0);\n --aia-submit-color: var(--aia-primitive-neutral-1000);\n\n --aia-color-text-muted: #6b7280; /* off shared palette (slate) */\n\n /* Loading bars sit at half the contrast of the surrounding chrome so they\n read as a placeholder, not as content (a50 -> a25 over the light surface). */\n --aia-skeleton-bg: var(--aia-primitive-neutral-750-a8);\n\n --aia-streak-rgb: 99, 102, 241; /* off shared palette (indigo effect) */\n /* Solid confirm fill: the pickers' Done buttons and a ticked multi-select\n checkbox. A near-black gray on light, so white reads on it. */\n --aia-confirm-bg: #262626;\n --aia-confirm-bg-hover: #404040;\n --aia-confirm-color: #ffffff;\n /* The pickers' Done buttons: a soft blue-gray under dark navy text, the\n Real-time One playground's Done (the ticked checkbox keeps the solid\n confirm fill above). */\n --aia-done-bg: #e4e8f0;\n --aia-done-bg-hover: #d8dde8;\n --aia-done-color: #2a3150;\n /* The opt-in \"See all results\" button (\\`seeAllResults\\`): a solid\n near-black button under white text. */\n --aia-see-all-bg: #2b2b2b;\n --aia-see-all-bg-hover: #3d3d3d;\n --aia-see-all-color: #ffffff;\n\n --aia-footer-hint-color: var(--aia-primitive-neutral-500);\n --aia-footer-brand-color: var(--aia-primitive-neutral-700);\n --aia-footer-badge-border: var(--aia-primitive-neutral-750-a50);\n}\n\n/* Dark mode defaults */\n:where(.magicx-aia[data-mode=\"dark\"]) {\n --aia-surface: var(--aia-primitive-neutral-0);\n --aia-border: var(--aia-primitive-neutral-500);\n /* Flat by default — no elevation on the input container. Consumers set\n --aia-shadow to add one. */\n --aia-shadow: none;\n /* Half-strength stroke — neutral-400 (was #484848 — snapped to palette,\n Δ2) at 50% alpha; see the light-mode note above. */\n --aia-dropdown-border: transparent; /* no stroke by default */\n --aia-dropdown-shadow: none; /* flat by default */\n /* Suggestion pills (Figma \"ParamPill\"): transparent fill, no visible border. */\n --aia-pill-bg: var(--aia-primitive-neutral-750);\n --aia-pill-color: var(--aia-primitive-neutral-700);\n --aia-pill-font-size: 16px;\n /* Smart Suggestion sparkle, matched text, and the shimmer's bright centre. */\n --aia-smart-suggestion-accent: #e0787b;\n --aia-smart-suggestion-glint: #ffe1e1;\n\n /* Completed params (Figma \"RichTextPill\") — dark theme (design source):\n white text on a faint-gray chip. -active is the hover / tapped highlight.\n Deliberately still a15 while light mode moved to a105: the fill is a light\n gray tinting the surface, so thinning it lightens over white but DARKENS\n over this theme's black. Lightening the dark chip means a stronger tint,\n which is a design call, not a mechanical one — left for design to make. */\n --aia-completed-pill-bg: var(--aia-primitive-neutral-750-a15);\n --aia-completed-pill-bg-active: var(--aia-primitive-neutral-750-a35);\n --aia-completed-pill-color: var(--aia-primitive-neutral-1000);\n\n --aia-option-bg: var(--aia-primitive-neutral-250);\n /* Option text: a softer grey than the parameter label above it. */\n --aia-option-color: var(--aia-primitive-neutral-750);\n --aia-scrollbar-track: rgba(255, 255, 255, 0.08);\n --aia-scrollbar-thumb: rgba(255, 255, 255, 0.28);\n --aia-option-color-selected: var(--aia-primitive-neutral-1000);\n --aia-option-font-size: 16px;\n\n --aia-written-text-color: var(--aia-primitive-neutral-1000);\n --aia-written-text-font-size: 16px;\n --aia-caret-color: var(--aia-written-text-color, #ffffff);\n\n --aia-submit-bg: var(--aia-primitive-neutral-1000);\n --aia-submit-color: var(--aia-primitive-neutral-0);\n\n --aia-color-text-muted: #c1c4cb; /* off shared palette (slate) */\n\n /* Half as light against the dark surface as the old neutral-300 fill — the\n dark-mode counterpart of the light theme's a50 -> a25 step-down. */\n --aia-skeleton-bg: var(--aia-primitive-neutral-150);\n\n --aia-streak-rgb: 255, 255, 255;\n /* The light theme's solid confirm fill, inverted: a soft gray (not white,\n which glares on the dark surface) under dark text. */\n --aia-confirm-bg: #a6a6a6;\n --aia-confirm-bg-hover: #b8b8b8;\n --aia-confirm-color: #000000;\n /* Done keeps the dark theme's confirm colors. */\n --aia-done-bg: var(--aia-confirm-bg);\n --aia-done-bg-hover: var(--aia-confirm-bg-hover);\n --aia-done-color: var(--aia-confirm-color);\n /* A black pill vanishes on the dark surface, so \"See all results\" takes the\n dark theme's confirm colors too. */\n --aia-see-all-bg: var(--aia-confirm-bg);\n --aia-see-all-bg-hover: var(--aia-confirm-bg-hover);\n --aia-see-all-color: var(--aia-confirm-color);\n\n --aia-footer-hint-color: var(--aia-primitive-neutral-700);\n --aia-footer-brand-color: var(--aia-primitive-neutral-500);\n --aia-footer-badge-border: var(--aia-primitive-neutral-500);\n}\n\n/* Footer band — the option list runs *under* the dropdown footer and dissolves\n into it, instead of being cut off mid-row above it. The band is the footer's\n own height — its top inset (--aia-footer-gap) + --aia-footer-row-height:\n - the options grid reserves it as bottom padding, so the last option can\n still be scrolled fully clear of the footer;\n - --aia-grid-overlap-bottom (the band + the 8px stack gap) pulls the footer\n back up over that band;\n - the footer's background is the fade: transparent at the band's top edge,\n the full dropdown surface at its bottom, so a row dissolves as it passes\n behind. Its hint and branding groups sit on a 65%-opaque fill of their\n own (--aia-footer-chip-bg) so they stay legible across it.\n Lives here rather than with the dropdown's own rules so the\n optionsPosition=\"above\" reset below always follows it in the cascade. */\n[data-aia-dropdown] {\n /* Height of the footer's hint / branding row — the badge is its tallest item\n (the kbd is shorter and centers against it). The band derives from it, so\n restyling the badge's height keeps the overlap in step. */\n --aia-footer-row-height: 23px;\n --aia-footer-band: calc(var(--aia-footer-gap, 12px) + var(--aia-footer-row-height, 23px));\n --aia-grid-scroll-bottom: var(--aia-footer-band);\n --aia-grid-overlap-bottom: calc(-1 * (var(--aia-footer-band) + 8px));\n /* How far above the band the fade starts. */\n --aia-footer-fade-lead: 20px;\n --aia-footer-fade-inset: calc(-1 * var(--aia-footer-fade-lead)) 0 0;\n}\n\n/* In the dropdown, the parameter label reads as a section header for the\n options beneath it — not an outlined chip floating over them. It drops the\n pill's inner horizontal padding and left-aligns its text with the option\n text below, which sits 10px in from the dropdown's content edge. The label's\n own list wrapper carries that 10px so the text lands exactly on the option\n text's left edge.\n\n Selector shape differs from the vanilla/Angular copies (which target the\n \\`.aia-pill-list\\` / \\`.aia-pill\\` class names): the module classes here are\n hash-scoped locals, unreachable from this global stylesheet. The bar's\n direct \\`> span\\` child is the masked scroll wrapper (\\`.pillScroll\\`, tagged\n \\`data-aia-pill-scroll\\`) that holds PillList, so the 10px indent lands on\n the wrapper and the module zeroes PillList's own base padding underneath\n (\\`.pillScroll > span\\` in AIAutocompleteDropdown.module.css — remove one\n only with the other). Pills are matched via \\`[data-aia-pill]\\` (unique to\n ParamPill). Like the sibling structural \\`[data-aia-dropdown]\\` rules below,\n this is deliberately NOT \\`:where()\\`-wrapped — it must win over ParamPill's\n own \\`.pill\\` base rule. */\n[data-aia-dropdown] [data-aia-pillbar] > span {\n padding-inline: 10px;\n}\n[data-aia-dropdown] [data-aia-pillbar] [data-aia-pill] {\n justify-content: flex-start;\n border-inline-width: 0;\n padding-inline: 0;\n padding-block: 5px;\n}\n\n/* The reserved band the footer overlaps. Declared here, apart from the grid\n primitive, because it is the dropdown's concern rather than the grid's — and\n it once lived inside a \\`@layer layout\\` block, where a consumer's unlayered\n reset zeroed it silently. No SDK rule is layered any more (the isolation\n rule above is unlayered, and a layered rule would lose to it). */\n[data-aia-dropdown] .aia-grid[data-scroll] {\n padding-top: var(--aia-grid-scroll-top, 0);\n padding-bottom: var(--aia-grid-scroll-bottom, 0);\n margin-top: var(--aia-grid-overlap-top, 0);\n margin-bottom: var(--aia-grid-overlap-bottom, 0);\n}\n\n/* The fade. Painted on a pseudo-element rather than the footer box so it can\n start --aia-footer-fade-lead above the band's top edge: a row is then already\n dissolving by the time it reaches the hint / branding line, instead of\n crossing it at half strength. --aia-surface is what the dropdown paints\n itself with, so theming the surface retints the fade with it. z-index: -1\n keeps it under the footer's own content but, via the footer's stacking\n context, above the option rows.\n The gradient is solid from the footer's top edge, so no option shows\n behind the hint, badge or scroll arrow. */\n[data-aia-dropdown] [data-aia-footer]::before {\n content: \"\";\n position: absolute;\n inset: var(--aia-footer-fade-inset, -20px 0 0);\n z-index: -1;\n pointer-events: none;\n background: linear-gradient(\n to bottom,\n transparent,\n var(--aia-surface, #ffffff) var(--aia-footer-fade-lead, 20px)\n );\n}\n\n/* The glass surface is translucent — there's no solid color to dissolve into,\n and a fill behind the hint / branding would paint an opaque patch on a\n frosted panel. Both opt out. */\n[data-aia-dropdown][data-aia-surface=\"glass\"] {\n --aia-footer-chip-bg: transparent;\n}\n\n[data-aia-dropdown][data-aia-surface=\"glass\"] [data-aia-footer]::before {\n display: none;\n}\n\n/* optionsPosition: dropdown above the input. The sections live inside the\n dropdown's .aia-stack, so the reversal targets the stack (not the dropdown,\n whose only child is the stack).\n Two forms are supported:\n 1. ancestor form — Tier 1 sets data-options-position on the .magicx-aia\n container and the dropdown is a descendant.\n 2. self form — headless consumers spread \\`optionsPosition\\` from the hook's\n dropdownProps, so the attribute lands on the dropdown element itself.\n This lets the dropdown position above with NO wrapper attribute and no\n hand-copied CSS. */\n:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown],\n[data-aia-dropdown][data-options-position=\"above\"] {\n /* The stack is reversed here (the footer sits on top of the list), so the\n reserved band and the overlap flip to the top edge. */\n --aia-grid-scroll-bottom: 0px;\n --aia-grid-overlap-bottom: 0px;\n --aia-grid-scroll-top: var(--aia-footer-band);\n --aia-grid-overlap-top: calc(-1 * (var(--aia-footer-band) + 8px));\n --aia-footer-fade-inset: 0 0 calc(-1 * var(--aia-footer-fade-lead));\n top: auto;\n bottom: 100%;\n margin-top: 0;\n margin-bottom: var(--aia-dropdown-offset, 13px);\n}\n\n/* Declared after the optionsPosition=\"above\" block on purpose: that rule's\n second selector ([data-aia-dropdown][data-options-position=\"above\"]) has the\n same two-attribute specificity as this one, so source order is what decides\n which wins when a strip is present in an above-positioned dropdown. */\n/* Product strip present: the footer no longer sits on the scrolling option\n list — the strip is between them — so there is nothing to ride up over and\n nothing to reserve. Zeroing the band HERE, where it is defined, is the fix:\n the pull is a property of \"footer directly over the list\", not of the grid,\n and any section rendered after the grid would otherwise inherit it and land\n on top of the last option row. Both edges are zeroed because\n optionsPosition=\"above\" flips which one is in play. */\n[data-aia-dropdown][data-aia-has-products] {\n --aia-grid-scroll-bottom: 0px;\n --aia-grid-overlap-bottom: 0px;\n --aia-grid-scroll-top: 0px;\n --aia-grid-overlap-top: 0px;\n /* The fade exists to dissolve rows sliding under the footer. With the strip\n in between it has nothing to dissolve and would just wash over the cards. */\n --aia-footer-fade-lead: 0px;\n /* Nor does the footer's row need to fill a band that is not reserved: it\n holds that height only to cover the band (the footer-row rule), and here\n an empty row would just leave a blank strip under the cards. */\n --aia-footer-row-min-height: 0px;\n}\n\n:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] .aia-stack,\n[data-aia-dropdown][data-options-position=\"above\"] .aia-stack {\n flex-direction: column-reverse;\n}\n\n/* The footer now sits on top of the list, so its breathing room flips to the\n bottom edge — the side the option rows scroll under. */\n:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer],\n[data-aia-dropdown][data-options-position=\"above\"] [data-aia-footer] {\n padding: 0 0 var(--aia-footer-gap, 12px) 8px;\n}\n\n/* ...and the fade runs the other way, out of the footer and down into the list. */\n:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer]::before,\n[data-aia-dropdown][data-options-position=\"above\"] [data-aia-footer]::before {\n background: linear-gradient(\n to top,\n transparent,\n var(--aia-surface, #ffffff) var(--aia-footer-fade-lead, 20px)\n );\n}\n\n/* Disable all animations when data-animations=\"off\" */\n:where(.magicx-aia[data-animations=\"off\"]) *,\n:where(.magicx-aia[data-animations=\"off\"]) *::before,\n:where(.magicx-aia[data-animations=\"off\"]) *::after {\n animation-duration: 0s !important;\n transition-duration: 0s !important;\n /* biome-ignore lint/complexity/noImportantStyles: a delayed close must not linger with animations off */\n transition-delay: 0s !important;\n}\n\n/* Desktop footer is opaque: the option list clips at the footer's edge instead\n of showing through it — the scroll cue lives in the last visible row's own\n text instead (the option scroll-hint rule). Mobile keeps the fade. Declared\n last, and carrying the unwrapped above-position selector some copies use\n (so it ties that rule's higher specificity and wins on cascade order);\n the glass surface still hides this pseudo-element entirely. */\n@media (min-width: 769px) {\n [data-aia-dropdown] [data-aia-footer]::before,\n [data-aia-dropdown][data-options-position=\"above\"] [data-aia-footer]::before,\n :where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer]::before {\n inset: 0;\n background: var(--aia-surface, #ffffff);\n }\n}\n\n/* Fitted to the visible viewport. When the open panel would run past the\n screen's edge (a phone's keyboard, a short window), the core's viewportFit\n controller sets data-aia-fit and caps the panel at the space that is left\n (--aia-dropdown-fit-height). The section stack becomes the one scroll box:\n the options grid drops its own row cap, so options, product strip and\n footer scroll together and the strip is reached by scrolling past the last\n option instead of being cut off below it. Nothing slides under the footer\n any more, so its reserved band goes, as it does with a product strip.\n Declared last: the two-attribute selector ties the unwrapped\n above-position rule some copies carry, and must win it on source order. */\n[data-aia-dropdown][data-aia-fit] {\n max-height: var(--aia-dropdown-fit-height, none);\n --aia-grid-scroll-bottom: 0px;\n --aia-grid-overlap-bottom: 0px;\n --aia-grid-scroll-top: 0px;\n --aia-grid-overlap-top: 0px;\n --aia-footer-fade-lead: 0px;\n --aia-footer-row-min-height: 0px;\n}\n\n/* The stack is the panel's flex child, so it shrinks to the cap and scrolls.\n It reaches 6px into the panel's side padding on each side: the product row\n hangs that far outside the stack (its cards' hover fill), and a scroll box\n clips sideways as well as down. The scrollbar is hidden, as the grid's is. */\n[data-aia-dropdown][data-aia-fit] > .aia-stack {\n flex: 1 1 auto;\n min-height: 0;\n margin-inline: -6px;\n padding-inline: 6px;\n overflow-x: hidden;\n overflow-y: auto;\n overscroll-behavior: contain;\n scrollbar-width: none;\n}\n\n[data-aia-dropdown][data-aia-fit] > .aia-stack::-webkit-scrollbar {\n display: none;\n}\n\n/* Sections keep their own height and overflow the stack instead. Flex items\n shrink by default, and one that clips (the pill bar is overflow: hidden)\n has no content floor to stop it — it collapsed to nothing. */\n[data-aia-dropdown][data-aia-fit] > .aia-stack > * {\n flex-shrink: 0;\n}\n\n/* The grid shows every row and leaves the scrolling to the stack. Not a\n scroll box at all, so a swipe that starts on an option scrolls the panel. */\n[data-aia-dropdown][data-aia-fit] .aia-grid[data-scroll] {\n max-height: none;\n overflow: visible;\n}\n\n/* A calendar is the exception to \"sections keep their own height\": a month\n cut off mid-week reads as broken, and nothing shows that the rest is a\n scroll away. So it gives instead: its weeks squeeze to share the space that\n is left (the datepicker's weeks rule, which sets the floor), and only below\n that floor does the stack scroll. */\n[data-aia-dropdown][data-aia-fit] [data-aia-datepicker] {\n flex-shrink: 1;\n min-height: 0;\n}\n\n/* The footer goes while a calendar is fitted. Its keyboard hint and badge\n would take a week and a half of rows from a month that is already short of\n room, and the calendar's own bottom padding then closes the panel. */\n[data-aia-dropdown][data-aia-fit]:has([data-aia-datepicker]) [data-aia-footer] {\n display: none;\n}\n\n[data-aia-dropdown][aria-multiselectable=\"true\"] {\n --aia-grid-scroll-bottom: 0px;\n --aia-grid-overlap-bottom: 0px;\n --aia-grid-scroll-top: 0px;\n --aia-grid-overlap-top: 0px;\n --aia-footer-fade-lead: 0px;\n --aia-footer-row-min-height: 0px;\n}\n\n/* A multi-select shows three rows and scrolls the rest, in every layout (one\n column, two columns, phone), so its Done button always sits right under\n the third row. The planned cap (--aia-grid-max-height) still wins when it\n is smaller: three rows of options or fewer. --aia-option-peek (a unitless\n number of rows, 0 or more, default 0, set by the consumer on the widget or\n any ancestor) shows that much of the next row when the list scrolls; the\n planned cap carries it too, but only for a list that scrolls, so a list of\n three or fewer is never padded out. max() reads a negative as 0. A value\n with a unit makes the calc invalid and the cap is lost: nothing here can\n catch that, and the reference says so. */\n[data-aia-dropdown][aria-multiselectable=\"true\"] .aia-grid[data-scroll] {\n max-height: min(\n var(--aia-grid-max-height, 120px),\n calc((3 + max(0, var(--aia-option-peek, 0))) * var(--aia-option-row-height, 37px))\n );\n}\n\n/* Fitted to the viewport, every other grid hands its scrolling to the panel,\n which would carry Done off screen with the rows. A multi-select keeps its\n own three-row scroll box, and gives up rows before the panel has to scroll,\n so Done stays in view. */\n[data-aia-dropdown][data-aia-fit][aria-multiselectable=\"true\"] .aia-grid[data-scroll] {\n flex-shrink: 1;\n min-height: var(--aia-option-row-height, 37px);\n max-height: min(\n var(--aia-grid-max-height, 120px),\n calc((3 + max(0, var(--aia-option-peek, 0))) * var(--aia-option-row-height, 37px))\n );\n overflow-y: auto;\n}\n\n/* Floating options box (2026-11). The panel reads as a light sheet under the\n text: no footer, only the parameter being asked (sentence case), \"skip\" at\n the header row's trailing edge, and roomier rows. With no footer there is\n no band for the rows to slide under, so it is zeroed in every layout.\n Declared last so it follows every rule that sets the band. Mirrored in all\n four appearance copies; floatingOptionsParity.test.ts pins them together. */\n[data-aia-dropdown] [data-aia-footer] {\n display: none;\n}\n/* Doubled attribute: ties the above-position rule's specificity and wins on\n source order, so both edges are zeroed whichever side the panel opens on. */\n[data-aia-dropdown][data-aia-dropdown] {\n --aia-grid-scroll-bottom: 0px;\n --aia-grid-overlap-bottom: 0px;\n --aia-grid-scroll-top: 0px;\n --aia-grid-overlap-top: 0px;\n --aia-footer-fade-lead: 0px;\n --aia-footer-row-min-height: 0px;\n}\n[data-aia-dropdown] [data-aia-pillbar] [data-aia-pill]:not([data-aia-pill-active]) {\n display: none;\n}\n/* One label, one placeholder: the loading skeletons carry no data-aia-pill, so\n the rule above leaves them alone. Keep the first and hide the rest. */\n[data-aia-dropdown] [data-aia-pillbar] [data-aia-pill-skeleton] ~ [data-aia-pill-skeleton] {\n display: none;\n}\n[data-aia-dropdown] [data-aia-pillbar] [data-aia-pill-scroll] {\n flex: 0 1 auto;\n mask-image: none;\n -webkit-mask-image: none;\n}\n/* The live label reads at full strength. The pill's positional opacity ramp\n is a custom property the pill's own rule reads, so this plain declaration\n wins by specificity, and the pill's entrance fade and a loading chip's\n skeleton fades still animate over it. */\n[data-aia-dropdown] [data-aia-pillbar] [data-aia-pill][data-aia-pill-active] {\n text-transform: none;\n letter-spacing: normal;\n font-size: var(--aia-param-label-font-size, 17px);\n font-weight: 500;\n opacity: 1;\n}\n/* A flex container has no ::first-letter; the label is plain text, so an\n inline block lays it out the same and lets it take a capital. A Smart\n Suggestion header keeps its flex layout: its gap and centring hold the\n sparkle beside the text. */\n[data-aia-dropdown]\n [data-aia-pillbar]\n [data-aia-pill][data-aia-pill-active]:not([data-aia-smart-suggestion]) {\n display: inline-block;\n}\n[data-aia-dropdown]\n [data-aia-pillbar]\n [data-aia-pill][data-aia-pill-active]:not([data-aia-smart-suggestion])::first-letter {\n text-transform: uppercase;\n}\n[data-aia-dropdown] [data-aia-pillbar] [data-aia-skip] {\n padding-inline: 8px;\n font-size: var(--aia-skip-font-size, 13.5px);\n}\n/* Roomier rows: 15px above and below each option instead of 8px. The\n row height feeds the visible-rows cap (planOptionsGrid), so it moves with\n the padding; picture and parameter-line rows add the same padding to their\n own heights. Tokens on the themed root at zero specificity, like the rest,\n so a consumer's value wins and the classic block below can restore its own. */\n:where(.magicx-aia) {\n --aia-option-padding-block: 15px;\n --aia-option-row-height: calc(21px + 2 * var(--aia-option-padding-block));\n}\n/* The panel hugs its options (panelHugWidth): as wide as the widest option\n times the columns, plus the panel's padding and 36px of breathing room,\n never under the header row (the whole label and \"skip\") or the minimum,\n nor over the full width. Desktop only: on a phone the panel keeps the\n full width. The width is set only on a panel of plain options; pickers and\n product strips stay full width. The rules below skip optionsStyle:\n \"classic\", which keeps the full-width panel, the fitted Done and the\n chevron. */\n@media (min-width: 769px) {\n [data-aia-dropdown][data-aia-hug]:not(:where([data-aia-options-style=\"classic\"] *)) {\n inset-inline-end: auto;\n width: clamp(\n min(var(--aia-panel-min-width, 160px), 100%),\n var(--aia-panel-fit-width, 100%),\n 100%\n );\n }\n}\n/* While the panel glides to a new width (panelMorph.ts), its new content is\n laid out at the width it lands at, so it never rewraps under the glide:\n wider, the panel, which clips, reveals it as it opens; narrower, it starts\n at its final width instead of squeezing frame by frame. The leaving copy\n keeps its own width. */\n[data-aia-dropdown][data-aia-glide-width]\n > :not(.magicx-aia-panel-ghost):not([data-aia-scroll-arrow]) {\n min-width: var(--aia-glide-content-width, auto);\n max-width: var(--aia-glide-content-width, none);\n}\n/* The All row's tile shows the first options' pictures together: two side by\n side, three as a tall half and two quarters, four in a 2x2 grid. Each is\n cropped to its cell, since a contained picture would leave the cells\n mostly empty. */\n[data-aia-option] [data-aia-collage] {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1px;\n}\n[data-aia-option] [data-aia-collage=\"3\"],\n[data-aia-option] [data-aia-collage=\"4\"] {\n grid-template-rows: 1fr 1fr;\n}\n[data-aia-option] [data-aia-collage=\"3\"] > img:first-child {\n grid-row: 1 / span 2;\n}\n[data-aia-option] [data-aia-collage] > img {\n width: 100%;\n height: 100%;\n min-width: 0;\n min-height: 0;\n object-fit: cover;\n}\n/* Done spans the panel, whatever the panel's width. */\n[data-aia-dropdown]:not(:where([data-aia-options-style=\"classic\"] *)) [data-aia-multi-done] {\n width: var(--aia-multi-done-width, 100%);\n}\n/* A long list shows a thin scrollbar on its right edge instead of the\n \"more below\" chevron: the same button (scrollArrow.ts), drawn as a 3px\n rounded thumb on a faint track, placed and sized by the inline\n --aia-scroll-track-* / --aia-scroll-thumb-* vars. Shown whenever the list\n overflows (data-aia-scrollable), at the top, mid-scroll and at the end;\n it takes no clicks, the list scrolls by wheel, touch and keyboard. */\n[data-aia-dropdown]:not(:where([data-aia-options-style=\"classic\"] *)) [data-aia-scroll-arrow] {\n top: var(--aia-scroll-track-top, 0px);\n right: var(--aia-scroll-track-right, 0px);\n bottom: auto;\n left: auto;\n width: 3px;\n height: var(--aia-scroll-track-height, 0px);\n margin: 0 2px 0 0;\n border-radius: 3px;\n background: var(--aia-scrollbar-track, rgba(15, 23, 42, 0.05));\n pointer-events: none;\n animation: none;\n transition: opacity 200ms ease-out;\n}\n[data-aia-dropdown]:not(:where([data-aia-options-style=\"classic\"] *)) [data-aia-scroll-arrow] svg {\n display: none;\n}\n[data-aia-dropdown]:not(:where([data-aia-options-style=\"classic\"] *))\n [data-aia-scroll-arrow]::after {\n content: \"\";\n position: absolute;\n top: var(--aia-scroll-thumb-top, 0px);\n left: 0;\n width: 100%;\n height: var(--aia-scroll-thumb-height, 0px);\n border-radius: 3px;\n background: var(--aia-scrollbar-thumb, rgba(15, 23, 42, 0.22));\n}\n[data-aia-dropdown]:not(:where([data-aia-options-style=\"classic\"] *))\n [data-aia-scroll-arrow][data-aia-visible] {\n pointer-events: none;\n opacity: 0;\n}\n[data-aia-dropdown]:not(:where([data-aia-options-style=\"classic\"] *))\n [data-aia-scroll-arrow][data-aia-scrollable] {\n opacity: 1;\n}\n/* Room between the last row and Done, so the last line reads clear of it. */\n[data-aia-dropdown]:not(:where([data-aia-options-style=\"classic\"] *)) [data-aia-multi-actions] {\n padding-top: 14px;\n}\n/* End floating options box. */\n\n/* Classic options box (optionsStyle: \"classic\"): the panel as it was\n before the floating box: it unfolds out of the input with a stroke, at\n full size. Generated from the values the floating-box changes replaced;\n keep in step across the vanilla, React and Angular copies. */\n/* The attribute may sit on the themed root itself (Tier 1) or on an ancestor\n of it: a standalone dropdown given \\`mode\\` carries \\`.magicx-aia\\` on its own\n root, below the element the consumer marks classic. Both forms are zero\n specificity and come after the floating tokens, so they win on order while\n a consumer's own value still beats them. */\n:where(.magicx-aia[data-aia-options-style=\"classic\"]),\n:where(.magicx-aia[data-aia-options-style=\"classic\"][data-mode=\"light\"]),\n:where([data-aia-options-style=\"classic\"] .magicx-aia),\n:where([data-aia-options-style=\"classic\"] .magicx-aia[data-mode=\"light\"]) {\n --aia-dropdown-border: var(--aia-primitive-neutral-900-a50);\n --aia-option-font-size: 16px;\n /* Full-size rows with classic's own 8px padding. The first two selectors\n match in dark mode too, so the rows hold in both. */\n --aia-option-padding-block: 8px;\n --aia-option-row-height: 37px;\n}\n:where(.magicx-aia[data-aia-options-style=\"classic\"][data-mode=\"dark\"]),\n:where([data-aia-options-style=\"classic\"] .magicx-aia[data-mode=\"dark\"]) {\n --aia-dropdown-border: var(--aia-primitive-neutral-400-a50);\n --aia-option-font-size: 16px;\n}\n:where(.magicx-aia[data-aia-options-style=\"classic\"][data-options-position=\"above\"])\n [data-aia-dropdown],\n:where([data-aia-options-style=\"classic\"]) [data-aia-dropdown][data-options-position=\"above\"] {\n transform-origin: 50% 100%;\n}\n:where([data-aia-options-style=\"classic\"]) [data-aia-dropdown] [data-aia-pillbar] [data-aia-pill] {\n padding-block: 5px;\n}\n:where([data-aia-options-style=\"classic\"])\n [data-aia-dropdown][aria-multiselectable=\"true\"]\n .aia-grid[data-scroll] {\n max-height: min(\n var(--aia-grid-max-height, 120px),\n calc((3 + max(0, var(--aia-option-peek, 0))) * var(--aia-option-row-height, 37px))\n );\n}\n:where([data-aia-options-style=\"classic\"])\n [data-aia-dropdown][data-aia-fit][aria-multiselectable=\"true\"]\n .aia-grid[data-scroll] {\n min-height: var(--aia-option-row-height, 37px);\n max-height: min(\n var(--aia-grid-max-height, 120px),\n calc((3 + max(0, var(--aia-option-peek, 0))) * var(--aia-option-row-height, 37px))\n );\n}\n:where([data-aia-options-style=\"classic\"])\n [data-aia-dropdown]\n [data-aia-pillbar]\n [data-aia-pill][data-aia-pill-active] {\n font-size: var(--aia-param-label-font-size, 13.5px);\n}\n:where([data-aia-options-style=\"classic\"]) [data-aia-dropdown] [data-aia-pillbar] [data-aia-skip] {\n padding-inline: 8px;\n font-size: var(--aia-skip-font-size, 13.5px);\n}\n`;\n document.head.appendChild(s);\n}\nexport {};","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-3819c762\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-3819c762\";\n s.textContent = `.aia-dropdown-yz2KC {\n position: absolute;\n left: 0;\n right: 0;\n top: 100%;\n /* Widest the panel gets; \\`none\\` lets it span the whole field. */\n max-width: var(--aia-dropdown-max-width, 544px);\n /* Gap between the input box and the dropdown. Tunable via --aia-dropdown-offset. */\n margin-top: var(--aia-dropdown-offset, 13px);\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n /* The left padding derives from --aia-content-inset-left, the token the\n input wrapper reads for its own left padding. The option text and the\n parameter label sit 10px inside this padding edge (the option's padding;\n the pill bar's list wrapper carries the same 10px — see appearance.css),\n and the product strip is inset to the same line, so the whole panel's\n content starts exactly under the typed text. max() keeps the padding at\n zero (never negative, which CSS would clamp anyway) for a token under\n 10px — the input wrapper floors the token at 10px to match. */\n padding: 10px 8px 10px max(0px, calc(var(--aia-content-inset-left, 16px) - 10px));\n overflow: hidden;\n container-type: inline-size;\n z-index: 10;\n opacity: 0;\n pointer-events: none;\n /* Closed, the panel rests in place, transparent and softly blurred, so it\n floats in as a dissolve rather than dropping down (the Real-time One\n motion, 2026-11): out is 280ms on a soft ease back to opacity 0 and a 2px\n blur. */\n filter: blur(2px);\n /* The 220ms beat before closing covers the gap between a keystroke that\n filters every option away and the next response, so typing never blinks\n the panel out and back. */\n /* Closed, the panel keeps its full size (the floating box does not collapse\n it), so pointer-events: none alone would still leave an invisible box\n over the page: a descendant that sets pointer-events: auto (the pill row,\n the scroll arrow) takes taps through it, and it stays in the tab order.\n visibility: hidden once the fade has run removes it from hit testing and\n focus; the 0s visibility transition waits out the beat and the fade\n (220ms + 280ms), so the dissolve still plays. */\n visibility: hidden;\n transition:\n opacity 280ms cubic-bezier(0.25, 0.1, 0.25, 1) 220ms,\n filter 280ms cubic-bezier(0.25, 0.1, 0.25, 1) 220ms,\n visibility 0s linear 500ms;\n /* Solid surface is the default (matches the Figma components). Opt into the\n frosted-glass look with data-aia-surface=\"glass\". */\n background: var(--aia-surface, #ffffff);\n /* No stroke by default: the 1px border stays (transparent) so the\n geometry does not move; set --aia-dropdown-border to draw one. */\n border: 1px solid var(--aia-dropdown-border, transparent);\n border-radius: 9px;\n /* Flat by default; consumers can set --aia-dropdown-shadow for elevation. */\n box-shadow: var(--aia-dropdown-shadow, none);\n}\n\n/* A calendar has nothing wide to read, so the whole panel narrows with it —\n the option grid's 544px cap leaves a month floating in empty panel. The\n :has() argument is the datepicker's data attribute, which all three packages\n emit identically; only the panel class differs per copy. */\n.aia-dropdown-yz2KC:has([data-aia-datepicker]) {\n max-width: var(--aia-date-panel-width, 312px);\n}\n\n/* The time wheel is narrower still — three short wheels and a button. */\n.aia-dropdown-yz2KC:has([data-aia-time-wheel]) {\n max-width: var(--aia-time-panel-width, 240px);\n}\n\n.aia-dropdown-yz2KC[data-aia-surface=\"glass\"] {\n background: transparent;\n border-color: transparent;\n box-shadow:\n hsla(0, 0%, 100%, 1) -3.2px -3.2px 3.2px -3.2px inset,\n hsla(0, 0%, 100%, 1) 6.4px 6.4px 1.6px -8px inset,\n var(--aia-dropdown-bg, transparent) -6.4px 6.4px 1.6px -8px inset, /* same color as bg */\n var(--aia-dropdown-bg, transparent) 6.4px -6.4px 1.6px -8px inset, /* same color as bg */\n hsla(0, 0%, 100%, 0.15) -1.6px 0px 0px -1.6px inset,\n hsla(0, 0%, 100%, 0.15) 0px -1.6px 0px -1.6px inset,\n hsla(0, 0%, 100%, 0.3) 0px 1.6px 0px 0px inset,\n hsla(0, 0%, 100%, 0.3) 1.6px 0px 0px 0px inset,\n inset 0 0 30px 5px hsla(0, 0%, 0%, 0.05);\n backdrop-filter: blur(30px);\n}\n\n/* Opening: the panel dissolves in where it sits — opacity and the 2px blur\n resolve together over 320ms after a 40ms beat — while the option rows\n cascade in on top of it. */\n.aia-visible-QCoXj {\n opacity: 1;\n pointer-events: auto;\n filter: none;\n visibility: visible;\n transition:\n opacity 320ms cubic-bezier(0.25, 0.1, 0.25, 1) 40ms,\n filter 320ms cubic-bezier(0.25, 0.1, 0.25, 1) 40ms,\n visibility 0s;\n}\n\n/* \"More below\" scroll arrow — see the core's render/scrollArrow.ts.\n A bare down chevron at the bottom-centre of the option list, shown while\n there is more to scroll to — no disc, border or shadow around it. It rests\n just above the grid's reserved band, or — when a product strip follows the\n grid — centred on the strip's \"Items\" label row, off the last option row\n (--aia-scroll-arrow-bottom is measured and set inline by the controller so\n it tracks the layout). It never travels with the scroll: the controller toggles\n data-aia-visible and the only thing that transitions is opacity — a slow,\n even second in and the same second out. Its one motion is an idle bob, a few\n pixels up and back over a couple of seconds, running all the time so a fade\n never restarts it mid-stroke. z-index 4 puts it over the option rows and the\n footer (z-index 3), whose opaque fade plate would otherwise bury it.\n Declarations mirror vanilla's .magicx-aia-scroll-arrow and Angular's copy —\n change all three in the same commit. */\n.aia-scrollArrow-uUzV0 {\n position: absolute;\n left: 50%;\n bottom: var(--aia-scroll-arrow-bottom, 8px);\n /* Above the footer (z-index 3): its fade plate is opaque on desktop and\n would otherwise bury the chevron, which sits half over it by design. */\n z-index: 4;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n margin: 0 0 0 -16px;\n padding: 0;\n /* Just the chevron: the 32px box is the hit target, nothing is drawn on it. */\n border: 0;\n border-radius: 0;\n background: transparent;\n color: var(\n --aia-scroll-arrow-color,\n var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb))\n );\n box-shadow: none;\n cursor: pointer;\n pointer-events: none;\n /* Hidden: transparent, in place. Only opacity ever transitions, so the\n chevron cannot travel. One second each way — SCROLL_ARROW_FADE_MS in\n scrollArrow.ts documents this number; change both together. */\n opacity: 0;\n transition: opacity 1000ms cubic-bezier(0.4, 0, 0.2, 1);\n /* The idle bob: 3px up and back, eased both ways, always running. */\n animation: aia-magicx-aia-scroll-arrow-bob-z-HXC 2600ms ease-in-out infinite;\n}\n\n@keyframes aia-magicx-aia-scroll-arrow-bob-z-HXC {\n 0%,\n 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-3px);\n }\n}\n\n.aia-scrollArrow-uUzV0[data-aia-visible] {\n pointer-events: auto;\n opacity: 1;\n}\n\n/* Visible but not yet armed: the arrow is disabled for the length of its\n fade-in (scrollArrow.ts — a native button appearing clickable cancels an\n iOS tap in flight). No pointer cursor over a button that takes no click. */\n.aia-scrollArrow-uUzV0:disabled {\n cursor: default;\n}\n\n/* The chevron's size and paint by class — a page's \\`svg { … }\\` type rule\n would otherwise beat its presentation attributes. */\n.aia-scrollArrow-uUzV0 svg {\n width: 14px;\n height: 14px;\n fill: none;\n stroke: currentColor;\n}\n.aia-scrollArrow-uUzV0 svg path {\n fill: none;\n stroke: currentColor;\n}\n\n.aia-scrollArrow-uUzV0:hover {\n color: var(\n --aia-scroll-arrow-color-hover,\n var(--aia-option-color-selected, var(--aia-color-text-default, #fff))\n );\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-scrollArrow-uUzV0,\n .aia-dropdown-yz2KC {\n animation-duration: 0s;\n animation-delay: 0s;\n transition-duration: 0s;\n transition-delay: 0s;\n }\n}\n\n/* The dropdown container owns the 10px/8px edge padding and the 8px section\n gaps (matching Figma); the pill row adds none. The horizontal scroll + fade\n live on the inner .pillScroll wrapper, NOT the bar itself: the trailing skip\n button is the bar's other child, and a mask on the bar would fade it out\n along with the overflowing pills it's meant to sit beside. */\n.aia-pillBar-pwTXe {\n overflow: hidden;\n}\n\n/* Scrollable region for the pills. The appearance layer's\n \\`[data-aia-pillbar] > span\\` rule lands here (10px inline padding aligning\n the param label with the option text), so the inner PillList span must not\n add its own base padding on top — see the child rule below. */\n.aia-pillScroll-Tpzus {\n display: inline-flex;\n align-items: center;\n flex: 1 1 auto;\n min-width: 0;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 48px), transparent 100%);\n -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 48px), transparent 100%);\n}\n\n.aia-pillScroll-Tpzus > span {\n padding-inline: 0;\n}\n\n.aia-pillScroll-Tpzus::-webkit-scrollbar {\n display: none;\n}\n\n/* Trailing \"skip\" button — dismisses the active pill, same action as pressing\n → at the end of the input. Pinned at the bar's far edge (auto inline-start\n margin), outside the masked scroller. Typography follows the footer hint\n (quiet chrome), not the pills. Declarations mirror \\`.magicx-aia-skip\\` in the\n vanilla stylesheet — change both in the same commit. */\n.aia-skip-7-olS {\n display: inline-flex;\n align-items: center;\n margin-inline-start: auto;\n flex-shrink: 0;\n padding: 5px 8px;\n border: none;\n /* Matches the completed-param chip radius, so the hover fill reads as a\n soft rectangle rather than a capsule. */\n border-radius: 6px;\n background: transparent;\n font-family: inherit;\n font-size: var(--aia-skip-font-size, 13.5px);\n line-height: 18px;\n color: var(--aia-skip-color, var(--aia-footer-hint-color, #505050));\n cursor: pointer;\n white-space: nowrap;\n transition:\n color 150ms ease-out,\n background-color 150ms ease-out,\n opacity 160ms ease-out;\n}\n\n.aia-skip-7-olS:hover {\n color: var(--aia-skip-color-hover, var(--aia-pill-color, var(--aia-color-text-muted, #c1c4cb)));\n /* Same fill as a highlighted option row (--aia-option-bg), so the hover\n reads with the dropdown's own hover language and stays visible on both\n mode surfaces. */\n background: var(--aia-skip-hover-bg, var(--aia-option-bg, transparent));\n}\n\n/* Disabled while a request is in flight (and in the press window after a\n pick, which always starts one): it fades out with the options and back in\n when the response lands. */\n.aia-skip-7-olS:disabled {\n pointer-events: none;\n cursor: default;\n /* 0.01, never 0: iOS reads exactly 0 as hidden, and this button is\n re-enabled in place, so a tap in flight would be cancelled. */\n opacity: 0.01;\n}\n\n/* --- Fallback loading space (only when no pills/options are cached) ---\n Holds the box's height while a request is in flight; nothing is drawn. */\n.aia-skeletonBars-HVr9C {\n display: flex;\n flex-direction: column;\n gap: 20px;\n padding: 7px 8px;\n visibility: hidden;\n}\n\n.aia-skeletonBar-O3xIx {\n display: block;\n height: 14px;\n}\n\n/* A picker with its own Done button (multi-select, time wheel) ends on that\n button: the footer is not shown under it. */\n.aia-dropdown-yz2KC:has([data-aia-multi-done]) [data-aia-footer],\n.aia-dropdown-yz2KC:has([data-aia-time-wheel]) [data-aia-footer] {\n display: none;\n}\n\n/* The multi-select Done button: the time wheel's Done, full width. */\n.aia-multiDone-y12U7 {\n display: block;\n /* As wide as the widest option (set by fitMultiSelectDone), never\n narrower than the minimum nor wider than the panel. */\n width: var(--aia-multi-done-width, var(--aia-multi-done-fit, 100%));\n min-width: min(var(--aia-multi-done-min-width, 120px), 100%);\n max-width: 100%;\n height: 44px;\n padding: 0 12px;\n border: none;\n border-radius: 12px;\n background: var(--aia-multi-done-bg, var(--aia-done-bg, #e4e8f0));\n color: var(--aia-multi-done-color, var(--aia-done-color, #2a3150));\n font-family: inherit;\n font-size: 15px;\n font-weight: 600;\n line-height: 20px;\n cursor: pointer;\n transition: background-color 150ms ease-out;\n}\n\n.aia-multiDone-y12U7:hover {\n background: var(--aia-multi-done-bg-hover, var(--aia-done-bg-hover, #d8dde8));\n}\n\n/* With a \"See all results\" button in the same panel, that button is the\n filled one: Done drops its fill so the panel does not end on two solid\n bars (vanilla's styles.css explains the two tokens). */\n.aia-dropdown-yz2KC:has([data-aia-see-all]) .aia-multiDone-y12U7:not(:hover) {\n background: var(--aia-multi-done-bg-beside-see-all, transparent);\n color: var(--aia-multi-done-color-beside-see-all, var(--aia-option-color-selected, #2a3150));\n}\n\n/* --- See all results (opt-in: \\`seeAllResults\\`) ---\n A button under the products that submits the query: near-black in light\n mode, the confirm gray in dark (appearance.css sets both). The same box as\n the multi-select Done above it. Declarations match vanilla's styles.css\n (seeAllResultsParity.test.ts). */\n.aia-seeAllRow-icrau {\n padding: 4px 0 0;\n}\n\n.aia-seeAll-0Zbgc {\n display: block;\n width: 100%;\n min-height: var(--aia-see-all-height, 48px);\n padding: 0 16px;\n border: none;\n border-radius: var(--aia-see-all-radius, 12px);\n background: var(--aia-see-all-bg, #2b2b2b);\n color: var(--aia-see-all-color, #ffffff);\n font-family: inherit;\n font-size: var(--aia-see-all-font-size, 16px);\n font-weight: 700;\n line-height: 20px;\n text-align: center;\n cursor: pointer;\n transition: background-color 150ms ease-out;\n}\n\n.aia-seeAll-0Zbgc:hover {\n background: var(--aia-see-all-bg-hover, #3d3d3d);\n}\n\n/* A submit in progress: the add-to-cart button's spinning arc turns beside\n the label, in the label's colour, until the page the submit opens takes\n over. Its margins cancel its width and its height at any\n --aia-spinner-size, so it takes no room in the line: the label stays where\n it was and the button keeps its size. A slower turn under reduced motion. The state sits\n in :where(), so a page's own rule on the attribute restyles or hides it. */\n.aia-seeAll-0Zbgc:where([data-aia-see-all-state=\"busy\"])::after {\n content: \"\";\n display: inline-block;\n margin: calc(var(--aia-spinner-size, 16px) / -2) calc(-8px - var(--aia-spinner-size, 16px))\n calc(var(--aia-spinner-size, 16px) / -2) 8px;\n vertical-align: middle;\n box-sizing: border-box;\n width: var(--aia-spinner-size, 16px);\n height: var(--aia-spinner-size, 16px);\n border: var(--aia-spinner-width, 2px) solid var(--aia-see-all-spinner-color, currentColor);\n border-right-color: transparent;\n border-radius: 50%;\n animation: aia-seeAllSpin-jlsZP 0.8s linear infinite;\n}\n\n@keyframes aia-seeAllSpin-jlsZP {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-seeAll-0Zbgc:where([data-aia-see-all-state=\"busy\"])::after {\n animation-duration: 2s;\n }\n}\n\n/* The open panel's leaving ghost (panelMorph.ts) is a frozen copy of the\n last step: the rows' own entrance must not replay in it while it fades. */\n.aia-dropdown-yz2KC .magicx-aia-panel-ghost,\n.aia-dropdown-yz2KC .magicx-aia-panel-ghost * {\n /* biome-ignore lint/complexity/noImportantStyles: the copy must not replay the rows' own motion */\n animation: none !important;\n /* biome-ignore lint/complexity/noImportantStyles: the copy must not replay the rows' own motion */\n transition: none !important;\n /* biome-ignore lint/complexity/noImportantStyles: a row's own pointer-events: auto must not make the leaving copy catch taps */\n pointer-events: none !important;\n}\n\n/* Classic options box (optionsStyle: \"classic\"): the panel as it was\n before the floating box: it unfolds out of the input with a stroke, at\n full size. Generated from the values the floating-box changes replaced;\n keep in step across the vanilla, React and Angular copies. */\n:where([data-aia-options-style=\"classic\"]) .aia-dropdown-yz2KC {\n filter: none;\n /* Closed, the panel is only squashed (scaleY), which leaves it in hit\n testing and the tab order. Hidden once the 400ms fade has run, as the\n floating box is; the open rule shows it again at once. */\n visibility: hidden;\n transition:\n opacity 400ms cubic-bezier(0.4, 0, 0.2, 1),\n transform 0s 400ms,\n visibility 0s linear 400ms;\n border: 1px solid var(--aia-dropdown-border, rgba(231, 231, 231, 0.5));\n transform-origin: 50% 0;\n transform: scaleY(var(--aia-dropdown-reveal-scale, 0.02));\n}\n:where([data-aia-options-style=\"classic\"]) .aia-visible-QCoXj {\n filter: none;\n visibility: visible;\n transition:\n opacity 100ms cubic-bezier(0.4, 0, 0.2, 1),\n transform 320ms cubic-bezier(0.22, 1.28, 0.36, 1),\n visibility 0s;\n transform: scaleY(1);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-skip-7-olS {\n padding: 5px 8px;\n border-radius: 6px;\n font-size: var(--aia-skip-font-size, 13.5px);\n line-height: 18px;\n}\n/* Reduced motion still wins over the classic transitions above. */\n@media (prefers-reduced-motion: reduce) {\n :where([data-aia-options-style=\"classic\"]) .aia-dropdown-yz2KC,\n :where([data-aia-options-style=\"classic\"]) .aia-visible-QCoXj {\n transition-duration: 0s;\n transition-delay: 0s;\n }\n}\n\n/* The multi-select Done row stays mounted while a request loads, so it leaves\n and returns with the options on the same 160ms instead of standing at full\n strength over rows that are gone (vanilla's styles.css does the same). */\n.aia-dropdown-yz2KC[data-aia-loading] [data-aia-multi-actions] {\n pointer-events: none;\n animation: aia-multiActionsLoadingOut-lSdMh 160ms ease-in forwards;\n}\n\n.aia-dropdown-yz2KC:not([data-aia-loading]) [data-aia-multi-actions] {\n animation: aia-multiActionsFadeIn-zbGTG 160ms ease-out;\n}\n\n/* \"See all results\" leaves and returns with the options the same way. */\n.aia-dropdown-yz2KC[data-aia-loading] [data-aia-see-all] {\n pointer-events: none;\n animation: aia-seeAllLoadingOut-THnrl 160ms ease-in forwards;\n}\n\n.aia-dropdown-yz2KC:not([data-aia-loading]) [data-aia-see-all] {\n animation: aia-seeAllFadeIn-1GWpl 160ms ease-out;\n}\n\n/* Ends and starts a hair above zero: iOS cancels a tap on an element at 0. */\n@keyframes aia-seeAllLoadingOut-THnrl {\n to {\n opacity: 0.01;\n }\n}\n\n@keyframes aia-seeAllFadeIn-1GWpl {\n from {\n opacity: 0.01;\n }\n}\n\n@keyframes aia-multiActionsLoadingOut-lSdMh {\n to {\n opacity: 0.01;\n }\n}\n\n@keyframes aia-multiActionsFadeIn-zbGTG {\n from {\n opacity: 0.01;\n }\n to {\n opacity: 1;\n }\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"dropdown\":\"aia-dropdown-yz2KC\",\"visible\":\"aia-visible-QCoXj\",\"scrollArrow\":\"aia-scrollArrow-uUzV0\",\"magicx-aia-scroll-arrow-bob\":\"aia-magicx-aia-scroll-arrow-bob-z-HXC\",\"pillBar\":\"aia-pillBar-pwTXe\",\"pillScroll\":\"aia-pillScroll-Tpzus\",\"skip\":\"aia-skip-7-olS\",\"skeletonBars\":\"aia-skeletonBars-HVr9C\",\"skeletonBar\":\"aia-skeletonBar-O3xIx\",\"multiDone\":\"aia-multiDone-y12U7\",\"seeAllRow\":\"aia-seeAllRow-icrau\",\"seeAll\":\"aia-seeAll-0Zbgc\",\"seeAllSpin\":\"aia-seeAllSpin-jlsZP\",\"multiActionsLoadingOut\":\"aia-multiActionsLoadingOut-lSdMh\",\"multiActionsFadeIn\":\"aia-multiActionsFadeIn-zbGTG\",\"seeAllLoadingOut\":\"aia-seeAllLoadingOut-THnrl\",\"seeAllFadeIn\":\"aia-seeAllFadeIn-1GWpl\"};","import {\n cellDay,\n cellIso,\n type DateMonthView,\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\";\nimport { useState } from \"react\";\nimport styles from \"./DateGrid.module.css\";\n\n/**\n * Stable keys for the weekday row. The labels themselves repeat (\"S\", \"T\"), so\n * they can't key the list, and the index can't either without tripping\n * `noArrayIndexKey` — the row is static and never reorders, but the linter has\n * no way to know that.\n */\nconst WEEKDAY_KEYS = [\"sunday\", \"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\"];\n\nexport interface DateGridProps {\n /** The visible month's cells. These ARE `filteredOptions` — see `buildDateOptions`. */\n options: SuggestionOption[];\n activeIndex: number;\n listboxId: string;\n view: DateMonthView;\n /** What the calendar paints as answered — see the core's `dateSelectionFor`. */\n selection: DateSelection;\n onSelect: (option: SuggestionOption) => void;\n onHighlight: (index: number) => void;\n /** The pointer left cell `index` — see AIAutocompleteDropdownProps.onUnhighlight. */\n onUnhighlight?: (index: number) => void;\n onPreviousMonth: () => void;\n onNextMonth: () => void;\n}\n\n/**\n * The dropdown's calendar body, rendered in place of the options grid when the\n * active parameter is a date. React analogue of vanilla's `renderDateGrid`.\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 */\nexport function DateGrid({\n options,\n activeIndex,\n listboxId,\n view,\n selection,\n onSelect,\n onHighlight,\n onUnhighlight,\n onPreviousMonth,\n onNextMonth,\n}: DateGridProps) {\n const today = isoDate(new Date());\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 const range = visibleDateRange({\n pendingStart: selection.rangeStart,\n highlightedIso: cellIso(options[activeIndex]),\n selected: selection.selectedRange,\n floor: selection.floor,\n });\n\n return (\n <div className={styles.datepicker} data-aia-datepicker=\"\">\n <div className={styles.header}>\n <button\n type=\"button\"\n // Out of the tab order for the same reason the skip button is: Tab is\n // already bound to walking the dropdown's options.\n tabIndex={-1}\n className={styles.nav}\n data-aia-date-prev=\"\"\n aria-label=\"Previous month\"\n // Keeps the input focused, which the visibility gate depends on.\n onMouseDown={(e) => e.preventDefault()}\n onClick={onPreviousMonth}\n >\n ‹\n </button>\n <span className={styles.month} data-aia-date-month=\"\" aria-live=\"polite\">\n {monthLabel(view)}\n </span>\n <button\n type=\"button\"\n tabIndex={-1}\n className={styles.nav}\n data-aia-date-next=\"\"\n aria-label=\"Next month\"\n onMouseDown={(e) => e.preventDefault()}\n onClick={onNextMonth}\n >\n ›\n </button>\n </div>\n\n {/* Decorative: each cell announces its own full date, so repeating the\n column letters to AT adds noise — and the duplicate T/S would be\n meaningless read aloud anyway. */}\n <div className={styles.weekdays} aria-hidden=\"true\">\n {WEEKDAY_LABELS.map((label, i) => (\n <span key={WEEKDAY_KEYS[i]} className={styles.weekday}>\n {label}\n </span>\n ))}\n </div>\n\n <div className={styles.grid} data-aia-date-grid=\"\">\n {options.map((option, i) => (\n <DateCell\n // Padding cells have no date of their own, so they key off position.\n key={cellIso(option) ?? `pad-${i}`}\n option={option}\n id={`${listboxId}-option-${i}`}\n index={i}\n isHighlighted={i === activeIndex && option.is_tappable}\n isToday={cellIso(option) === today}\n isPast={isDimmedDay(cellIso(option), today, selection.floor)}\n marks={dateCellMarks(cellIso(option), {\n selectedIso: selection.selectedIso,\n range,\n references: selection.references,\n })}\n onSelect={onSelect}\n onHighlight={onHighlight}\n onUnhighlight={onUnhighlight}\n />\n ))}\n </div>\n </div>\n );\n}\n\ninterface DateCellProps {\n option: SuggestionOption;\n id: string;\n index: number;\n isHighlighted: boolean;\n isToday: boolean;\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: boolean;\n /** Filled at either end of a picked span (or on the one picked day), banded in between. */\n marks: { selected: boolean; inRange: boolean; reference: boolean };\n onSelect: (option: SuggestionOption) => void;\n onHighlight: (index: number) => void;\n onUnhighlight?: (index: number) => void;\n}\n\nfunction DateCell({\n option,\n id,\n index,\n isHighlighted,\n isToday,\n isPast,\n marks,\n onSelect,\n onHighlight,\n onUnhighlight,\n}: DateCellProps) {\n const [pressed, setPressed] = useState(false);\n const day = cellDay(option);\n\n if (day == null) {\n // Padding for the days before the 1st / after the last. Non-tappable, so\n // arrow navigation skips it; hidden from AT so the month reads as its own\n // days and nothing else.\n return (\n <div\n id={id}\n role=\"option\"\n data-aia-option=\"\"\n data-aia-date-cell=\"\"\n aria-hidden=\"true\"\n aria-selected={false}\n tabIndex={-1}\n className={`${styles.cell} ${styles.blank}`}\n />\n );\n }\n\n const handleSelect = () => {\n setPressed(true);\n onSelect(option);\n setTimeout(() => setPressed(false), 170);\n };\n\n const className = [\n styles.cell,\n styles.day,\n isPast ? styles.past : \"\",\n isHighlighted ? styles.highlighted : \"\",\n isToday ? styles.today : \"\",\n marks.inRange ? styles.inRange : \"\",\n marks.selected ? styles.selected : \"\",\n marks.reference ? styles.reference : \"\",\n pressed ? styles.pressed : \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div\n id={id}\n role=\"option\"\n data-aia-option=\"\"\n data-aia-date-cell=\"\"\n aria-selected={isHighlighted}\n // The cell paints the day number; `option.text` is the full committed\n // value (\"March 23 2026\") and is what AT should announce, since that is\n // what selecting it puts in the input.\n aria-label={option.text}\n tabIndex={0}\n className={className}\n onClick={handleSelect}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n handleSelect();\n }\n }}\n onMouseEnter={() => onHighlight(index)}\n // The hover highlight ends with the hover — see SuggestionItem.\n onMouseLeave={onUnhighlight ? () => onUnhighlight(index) : undefined}\n >\n <span className={styles.number}>{day}</span>\n </div>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-f687bd03\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-f687bd03\";\n s.textContent = `/* --- Datepicker (replaces the options grid for date suggestions) ---\n\n One of three hand-maintained copies (vanilla styles.css, this file, Angular's\n date-grid.component.css). Only the class-naming layer differs — the\n declarations must match, and \\`datepickerParity.test.ts\\` fails the build if\n they drift. See CLAUDE.md's duplicated-stylesheet rule.\n\n Every colour resolves through the same --aia-option-* chain the option rows\n use. The dropdown paints a background but sets no \\`color\\`, so anything here\n relying on \\`color: inherit\\` would pick up the HOST page's text colour and go\n black on a dark panel — and \\`prefers-color-scheme\\` can't be used to guess,\n because the panel's darkness comes from --aia-surface, which the media query\n says nothing about. Going through the option chain means one consumer\n override restyles the calendar and the options together. */\n.aia-datepicker-6RrTs {\n display: flex;\n flex-direction: column;\n gap: 4px;\n /* Bottom-heavier trim than the top: the compression the compact calendar\n asks for comes out of the bottom edge and the space between cells, never\n the header area or the side gutters. */\n padding: 4px 2px 4px;\n}\n\n.aia-header-z4LRk {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 2px 6px 6px;\n}\n\n.aia-month-urB2T {\n font-family: inherit;\n font-size: var(--aia-date-month-font-size, 14px);\n font-weight: 500;\n line-height: 20px;\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n}\n\n.aia-nav-ap4AN {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n padding: 0;\n border: none;\n border-radius: 6px;\n background: transparent;\n font-family: inherit;\n font-size: 16px;\n line-height: 1;\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n cursor: pointer;\n transition:\n color 150ms ease-out,\n background-color 150ms ease-out;\n}\n\n.aia-nav-ap4AN:hover {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n background: var(--aia-option-bg, transparent);\n}\n\n.aia-weekdays-3EA3q,\n.aia-grid-mQCgw {\n display: grid;\n /* The 7 columns live on the cell container itself, not on an ancestor:\n KeyboardController.getEffectiveColumns() measures grid-template-columns by\n walking up from option-0's PARENT, and it is this number that makes\n ArrowDown mean \"+1 week\". */\n grid-template-columns: repeat(7, minmax(0, 1fr));\n}\n\n/* The weeks. A row is --aia-date-row-height tall whenever there is room, which\n keeps a month readable in a narrow dropdown without letting a 6-row month\n grow the panel past the options grid it replaces. In a panel fitted to a\n short window (data-aia-fit, see appearance.css) the calendar is the section\n that gives: the rows share what is left, down to --aia-date-row-min-height,\n so the whole month stays on screen with its bottom padding instead of the\n last week being sliced by the panel's edge. Only below that floor does the\n panel scroll. */\n.aia-grid-mQCgw {\n flex: 1 1 auto;\n /* Without it the grid's automatic minimum is its full-height rows, and\n nothing squeezes. */\n min-height: 0;\n /* The floor never exceeds the chosen height, so a host that set a row\n shorter than the floor still gets exactly its own height. */\n grid-auto-rows: minmax(\n min(var(--aia-date-row-min-height, 20px), var(--aia-date-row-height, 28px)),\n var(--aia-date-row-height, 28px)\n );\n}\n\n.aia-weekday-3lF4B {\n padding: 2px 0;\n text-align: center;\n font-family: inherit;\n font-size: var(--aia-date-weekday-font-size, 11px);\n font-weight: 500;\n line-height: 16px;\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n opacity: 0.7;\n}\n\n.aia-cell-59k0y {\n display: flex;\n align-items: center;\n justify-content: center;\n /* Deliberately NOT sized here. Giving the grid item a definite size (an\n aspect-ratio, a width) stops it stretching to its track, so it parks at\n the track's start edge and the whole month drifts left of the weekday\n header above it — the two grids agree on their columns, and only the\n items disagree, which makes it look like a column-count bug. The cell\n fills its track; the square is the number span inside it. */\n min-width: 0;\n /* No height of its own: the cell fills its row, and the row's height is the\n grid's to give (see the weeks rule above), so a short window can squeeze\n the weeks instead of cutting the last one off. */\n font-family: inherit;\n font-size: var(--aia-date-cell-font-size, 13px);\n font-weight: 450;\n line-height: 20px;\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n}\n\n/* The visual box: everything a cell paints — fill, ring, press — lands here so\n it reads as a square centred in its column rather than a full-width band. */\n.aia-number-aoT01 {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--aia-date-cell-size, 26px);\n height: var(--aia-date-cell-size, 26px);\n /* A squeezed row (see the weeks rule) is shorter than the square: it stays\n inside its own row rather than touching the week above and below. */\n max-height: 100%;\n border-radius: 6px;\n}\n\n.aia-day-cB3u9 {\n cursor: pointer;\n}\n\n.aia-blank-ivgRC {\n cursor: default;\n}\n\n/* A day before today: dimmed so the month visibly starts at today, but still\n fully interactive — hover and click behave like any other day. */\n.aia-past-CEZsj {\n opacity: 0.35;\n}\n\n.aia-day-cB3u9:hover .aia-number-aoT01,\n.aia-highlighted-YIdtK .aia-number-aoT01 {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n background: var(--aia-option-bg, transparent);\n font-weight: 500;\n}\n\n/* Today reads as an outline, the committed answer as a fill — so a re-edited\n date can show both at once without either being ambiguous. */\n.aia-today-iI3ME .aia-number-aoT01 {\n box-shadow: inset 0 0 0 1px\n var(--aia-date-today-ring, var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb)));\n}\n\n/* Between the two ends of a picked span. The band sits on the CELL, not on the\n number square inside it, so consecutive days join into one continuous strip\n instead of a row of separate pills — the ends stay the two filled squares. */\n.aia-inRange-r9S2q {\n background: var(--aia-date-range-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06));\n}\n\n.aia-selected-28KDn .aia-number-aoT01 {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n background: var(--aia-date-selected-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.12));\n font-weight: 500;\n}\n\n/* A day another answer already holds (the pickup date while the return date is\n asked): a filled box for reference, still pickable. The fill is mixed from\n the day's own text colour, not the streak tint, so it shows on a light panel\n and a dark one alike, whatever the theme sets. */\n.aia-reference-Q5bXf .aia-number-aoT01 {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n background: var(--aia-date-reference-bg, color-mix(in srgb, currentColor 14%, transparent));\n font-weight: 500;\n}\n\n.aia-pressed-bEyyN .aia-number-aoT01 {\n opacity: 0.8;\n background: rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"datepicker\":\"aia-datepicker-6RrTs\",\"header\":\"aia-header-z4LRk\",\"month\":\"aia-month-urB2T\",\"nav\":\"aia-nav-ap4AN\",\"weekdays\":\"aia-weekdays-3EA3q\",\"grid\":\"aia-grid-mQCgw\",\"weekday\":\"aia-weekday-3lF4B\",\"cell\":\"aia-cell-59k0y\",\"number\":\"aia-number-aoT01\",\"day\":\"aia-day-cB3u9\",\"blank\":\"aia-blank-ivgRC\",\"past\":\"aia-past-CEZsj\",\"highlighted\":\"aia-highlighted-YIdtK\",\"today\":\"aia-today-iI3ME\",\"inRange\":\"aia-inRange-r9S2q\",\"selected\":\"aia-selected-28KDn\",\"reference\":\"aia-reference-Q5bXf\",\"pressed\":\"aia-pressed-bEyyN\"};","import {\n ATTRIBUTION_URL,\n buildAttributionUrl,\n getFooterHint,\n type UIStrings,\n uiStringsFor,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { useEffect, useState } from \"react\";\nimport { Cluster } from \"../layout/Cluster\";\nimport styles from \"./DropdownFooter.module.css\";\n\ninterface DropdownFooterProps {\n /**\n * Whether an option is currently highlighted. Takes priority: when true the\n * hint reads \"enter to proceed\".\n */\n isOptionHighlighted?: boolean;\n /**\n * Whether the input has no typed text. When true (and no option is\n * highlighted) the hint reads \"tab to select\" — see {@link getFooterHint}.\n */\n isInputEmpty?: boolean;\n /** The words of the widget language. Default: English. */\n strings?: UIStrings;\n}\n\n// Dropdown chrome: a keyboard hint on the left, AI-Autocomplete branding on the\n// right.\nexport function DropdownFooter({\n isOptionHighlighted = false,\n isInputEmpty = false,\n strings = uiStringsFor(),\n}: DropdownFooterProps) {\n const { key, hint } = getFooterHint(isOptionHighlighted, isInputEmpty, strings);\n // Initial state is the bare base URL so it matches server-rendered output (no\n // hydration mismatch); the effect appends utm_source after mount on the client.\n const [brandHref, setBrandHref] = useState(ATTRIBUTION_URL);\n useEffect(() => {\n setBrandHref(buildAttributionUrl());\n }, []);\n return (\n <footer className={styles.footer} data-aia-footer=\"\">\n <Cluster justify=\"between\" noWrap className={styles.row}>\n <Cluster gap=\"5px\" className={styles.hintGroup}>\n <kbd className={styles.key}>{key}</kbd>\n <span className={styles.hint}>{hint}</span>\n </Cluster>\n <a className={styles.brandLink} href={brandHref} target=\"_blank\" rel=\"noopener noreferrer\">\n <span className={styles.badge}>\n <span className={styles.brand}>Powered by Intent-1</span>\n </span>\n </a>\n </Cluster>\n </footer>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-5259a217\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-5259a217\";\n s.textContent = `.aia-cluster {\n display: flex;\n flex-wrap: wrap;\n gap: var(--aia-cluster-gap, 0.5rem);\n}\n/* Inline-level variant — used when the cluster must sit inline (e.g. inside\n a contentEditable). Rendered on a <span> so it's valid inline content. */\n.aia-cluster[data-inline] {\n display: inline-flex;\n}\n.aia-cluster[data-nowrap] {\n flex-wrap: nowrap;\n}\n.aia-cluster[data-align=\"start\"] {\n align-items: start;\n}\n.aia-cluster[data-align=\"center\"] {\n align-items: center;\n}\n.aia-cluster[data-align=\"end\"] {\n align-items: end;\n}\n.aia-cluster[data-align=\"baseline\"] {\n align-items: baseline;\n}\n.aia-cluster[data-justify=\"start\"] {\n justify-content: start;\n}\n.aia-cluster[data-justify=\"center\"] {\n justify-content: center;\n}\n.aia-cluster[data-justify=\"end\"] {\n justify-content: end;\n}\n.aia-cluster[data-justify=\"between\"] {\n justify-content: space-between;\n}\n.aia-cluster[data-justify=\"around\"] {\n justify-content: space-around;\n}\n`;\n document.head.appendChild(s);\n}\nexport {};","import type { ComponentPropsWithoutRef, CSSProperties, ReactNode } from \"react\";\nimport \"./Cluster.css\";\n\ninterface ClusterProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"className\"> {\n /** Gap between children. Any CSS length. Defaults to `0.5rem`. */\n gap?: string;\n /** Cross-axis alignment. Defaults to `center`. */\n align?: \"start\" | \"center\" | \"end\" | \"baseline\";\n /** Main-axis distribution. Defaults to `start`. */\n justify?: \"start\" | \"center\" | \"end\" | \"between\" | \"around\";\n /** When true, the wrapper does NOT flex-wrap (single-row clusters). */\n noWrap?: boolean;\n /** Render as an inline-level `<span>` (inline-flex) instead of a block `<div>`. */\n inline?: boolean;\n className?: string;\n children: ReactNode;\n}\n\n// Horizontal layout primitive — wraps when out of room. `noWrap` for single-row clusters. Internal.\nexport function Cluster({\n gap,\n align = \"center\",\n justify = \"start\",\n noWrap = false,\n inline = false,\n className,\n children,\n ...rest\n}: ClusterProps) {\n const style = gap ? ({ \"--aia-cluster-gap\": gap } as CSSProperties) : undefined;\n const props = {\n className: className ? `aia-cluster ${className}` : \"aia-cluster\",\n \"data-align\": align,\n \"data-justify\": justify,\n \"data-nowrap\": noWrap || undefined,\n \"data-inline\": inline || undefined,\n style,\n ...rest,\n };\n if (inline) return <span {...props}>{children}</span>;\n return <div {...props}>{children}</div>;\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-56b0c577\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-56b0c577\";\n s.textContent = `/* The footer adds its own 8px horizontal inset so it stays clear of the\n dropdown's rounded edges. The top inset (--aia-footer-gap) adds breathing\n room above the hint/branding row so the footer doesn't butt against the last\n option row — additive to the dropdown's 8px section gap. */\n.aia-footer-qQQ7x {\n display: flex;\n flex-direction: column;\n gap: 8px;\n /* No right inset: the brand pill's own padding (below) supplies it, so the\n badge sits as far from the right edge as it does from the bottom — 12px\n both ways (dropdown padding 10 + pill 2 down, dropdown padding 8 + pill 4\n across). */\n padding: var(--aia-footer-gap, 12px) 0 0 8px;\n /* The fade itself lives in appearance.css, on the footer's background.\n Paints above the rows it covers: option content sits at z-index 2 (see\n SuggestionItem.module.css) in this same stacking context, so anything\n lower would end up *behind* the rows. */\n position: relative;\n z-index: 3;\n /* Sitting on top of the list would otherwise swallow clicks and hovers on\n the rows scrolling under it — only the branding link needs to be hit. */\n pointer-events: none;\n}\n\n/* The hint / branding row is at least --aia-footer-row-height tall, the\n height the footer band under the options grid reserves for it\n (appearance.css). The badge is normally the row's tallest item and holds it\n there; without it — a consumer hiding the brand link, or a phone, where the\n keyboard hint is hidden too — the row shrank to the hint's 22px or to\n nothing, the footer's plate stopped short of the band and the rows scrolling\n under it showed below the footer (on a phone, the grid ran past the\n dropdown's bottom edge). The product strip zeroes the band and this floor\n with it (--aia-footer-row-min-height, appearance.css). */\n.aia-row-BgZ6Q {\n min-height: var(--aia-footer-row-min-height, var(--aia-footer-row-height, 23px));\n}\n\n.aia-hintGroup-ZzbPf {\n min-width: 0;\n}\n\n/* Re-enabled over the footer's \\`pointer-events: none\\`: both groups are visible\n chips sitting on the scroll band, so a click on one must land on the chip\n rather than falling through to the option row behind it. */\n.aia-hintGroup-ZzbPf,\n.aia-brandLink-r4f3R {\n pointer-events: auto;\n}\n\n.aia-brandLink-r4f3R {\n display: inline-flex;\n align-items: center;\n gap: 2px;\n text-decoration: none;\n cursor: pointer;\n transition: opacity 150ms ease-out;\n}\n\n/* The two content groups carry a solid surface fill so the keyboard hint and\n the AI-Autocomplete badge stay fully legible over whatever option row is\n scrolling behind the footer. The inline padding keeps the fill from hugging\n the glyphs. --aia-footer-chip-bg resolves to \\`transparent\\` on the glass\n surface, where there's no solid color to fill with. */\n.aia-hintGroup-ZzbPf,\n.aia-brandLink-r4f3R {\n /* Mixed here rather than declared on the container: a custom property\n substitutes var() on the element its declaration applies to, so a mix\n computed upstream would freeze the *theme's* surface and miss a\n dropdown-level --aia-surface retint. Computed on the footer, it picks up\n whichever ancestor set the surface. --aia-footer-chip-bg stays the\n override hook — consumers set it, and the glass surface zeroes it. */\n background: var(\n --aia-footer-chip-bg,\n color-mix(in srgb, var(--aia-surface, #ffffff) 65%, transparent)\n );\n padding-inline: 4px;\n border-radius: 6px;\n}\n\n/* The brand sits at the right edge where option rows scroll under the fade, so\n \"AI\" was getting clipped / washed out. Give the whole brand its own opaque,\n fully-rounded surface pill so it always reads clearly over the fade. Declared\n after the shared .hintGroup/.brandLink chip rule so it wins. */\n.aia-brandLink-r4f3R {\n background: var(--aia-footer-brand-pill-bg, var(--aia-surface, #ffffff));\n border-radius: 999px;\n padding: 2px 4px;\n gap: 4px;\n}\n\n.aia-brandLink-r4f3R:hover {\n opacity: 0.7;\n}\n\n.aia-key-Bz1H- {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 30px;\n height: 22px;\n padding: 2px 6px;\n border: 0.5px solid var(--aia-footer-hint-color, #505050);\n border-radius: 5px;\n font-family: inherit;\n font-size: 11px;\n line-height: 18px;\n color: var(--aia-footer-hint-color, #505050);\n}\n\n.aia-hint-GKEOH {\n font-family: inherit;\n font-size: 11px;\n line-height: 18px;\n color: var(--aia-footer-hint-color, #505050);\n}\n\n.aia-brand-Al-lR {\n font-family: inherit;\n font-size: 10px;\n line-height: 18px;\n color: var(--aia-footer-brand-color, #b0b0b0);\n}\n\n.aia-badge-Fk9vg {\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n height: var(--aia-footer-row-height, 23px);\n padding: 2.5px 5.5px;\n border: 0.5px solid var(--aia-footer-badge-border, rgba(189, 189, 189, 0.51));\n border-radius: 999px;\n font-family: inherit;\n font-size: 10px;\n line-height: 18px;\n color: var(--aia-footer-brand-color, #b0b0b0);\n}\n\n/* Mobile footer variant (Figma \"Mobile\"): on phone-width viewports drop the\n keyboard hint (\"tab to select\" is meaningless on touch), leaving only the\n AI-Autocomplete brand pinned to the right. */\n@media (max-width: 768px) {\n .aia-hintGroup-ZzbPf {\n display: none;\n }\n .aia-row-BgZ6Q {\n justify-content: flex-end;\n }\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"footer\":\"aia-footer-qQQ7x\",\"row\":\"aia-row-BgZ6Q\",\"hintGroup\":\"aia-hintGroup-ZzbPf\",\"brandLink\":\"aia-brandLink-r4f3R\",\"key\":\"aia-key-Bz1H-\",\"hint\":\"aia-hint-GKEOH\",\"brand\":\"aia-brand-Al-lR\",\"badge\":\"aia-badge-Fk9vg\"};","import type { LocationView } from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { type ReactNode, useEffect, useLayoutEffect, useRef } from \"react\";\nimport styles from \"./LocationField.module.css\";\n\nexport interface LocationFieldProps {\n /** The core's `locationView`: the field's text and the places found for it. */\n view: LocationView;\n /** Placeholder and accessible name of the field (\"Say a location\"). */\n searchLabel: string;\n /** Shown when a search found nothing (\"No places found\"). */\n noResultsLabel: string;\n /** Says Enter answers with the typed text (\"Press Enter to use what you typed\"). */\n useTypedLabel: string;\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 widgetFocused: boolean;\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 reediting?: boolean;\n /** False while the panel is closed: the field leaves the tab order. */\n visible?: boolean;\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 interactive?: boolean;\n /** The field's text changed — the core's `setLocationQuery`. */\n onQuery: (query: string) => void;\n /** ArrowDown / ArrowUp — the core's `moveLocationHighlight`. */\n onMove: (delta: number) => void;\n /** Answer: the place at `index`, else the highlighted place, else the typed text — the core's `commitLocation`. */\n onCommit: (index?: number) => void;\n /** The field took or let go of focus — the core's `setLocationFieldFocused`. */\n onFocusChange: (focused: boolean) => void;\n}\n\n// React 17 has no useId; one stable id per mounted field is all this needs.\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\nconst PIN = (\n <svg\n className={styles.icon}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z\" />\n <circle cx=\"12\" cy=\"9.5\" r=\"2.5\" />\n </svg>\n);\n\nconst SEARCH = (\n <svg\n className={styles.icon}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n aria-hidden=\"true\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </svg>\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. React analogue of vanilla's\n * `renderLocationField`: a search field over the server's location search,\n * 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 */\nexport function LocationField({\n view,\n searchLabel,\n noResultsLabel,\n useTypedLabel,\n widgetFocused,\n reediting = false,\n visible = true,\n interactive = true,\n onQuery,\n onMove,\n onCommit,\n onFocusChange,\n}: LocationFieldProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n const rootRef = useRef<HTMLDivElement>(null);\n const fieldRef = useRef<HTMLLabelElement>(null);\n // Where focus goes back to: the input the field took it from.\n const returnTo = useRef<HTMLElement | null>(null);\n // The caret `returnTo` had when the field took focus; restored on the way back.\n const returnRange = useRef<Range | null>(null);\n // Set while the field hands focus back, so its own blur isn't read as leaving.\n const returning = useRef(false);\n // The user left the field for the input; don't pull focus back until the\n // widget loses focus altogether.\n const declined = useRef(false);\n // Whether the last render was a re-edit; a re-edit starting clears `declined`.\n const wasReediting = useRef(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 const claimed = useRef(false);\n const widgetFocusedRef = useRef(widgetFocused);\n widgetFocusedRef.current = widgetFocused;\n const onFocusChangeRef = useRef(onFocusChange);\n onFocusChangeRef.current = onFocusChange;\n const reportFocus = (focused: boolean) => {\n claimed.current = focused;\n onFocusChange(focused);\n };\n const hasFocus = () => {\n const input = inputRef.current;\n return input != null && activeElementFor(input) === input;\n };\n const rememberReturn = () => {\n const root = rootRef.current;\n if (!root) return;\n const active = activeElementFor(root);\n if (\n active instanceof HTMLElement &&\n active !== inputRef.current &&\n active !== document.body &&\n !root.contains(active)\n ) {\n returnTo.current = active;\n returnRange.current = captureCaret(active);\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 const rememberKeyboardReturn = (from: EventTarget | null) => {\n const root = rootRef.current;\n if (!root || !(from instanceof HTMLElement) || from === returnTo.current) return;\n if (from === document.body || root.contains(from)) return;\n returnTo.current = from;\n returnRange.current = captureCaret(from);\n };\n const fieldId = useRef<string | null>(null);\n if (fieldId.current === null) fieldId.current = `aia-location-${++fieldSeq}`;\n const rowIdPrefix = `${fieldId.current}-row-`;\n\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 useEffect(() => {\n const input = inputRef.current;\n if (input && input.value !== view.query && activeElementFor(input) !== input) {\n input.value = view.query;\n }\n }, [view.query]);\n\n useEffect(() => {\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 renders of a click back into the input\n // can briefly drop it, and that must not count as a new re-edit.\n if (widgetFocused) {\n if (reediting && !wasReediting.current) declined.current = false;\n wasReediting.current = reediting;\n }\n const input = inputRef.current;\n if (!input) return;\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 (!visible && hasFocus()) {\n declined.current = true;\n handBack();\n return;\n }\n if (!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 render 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 (widgetFocusedRef.current) return;\n const target = returnTo.current;\n if (target && activeElementFor(target) === target) return;\n declined.current = 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 (!reediting || declined.current || !interactive || hasFocus()) return;\n rememberReturn();\n // Claim focus before the input's blur, which would otherwise close the panel.\n reportFocus(true);\n input.focus({ preventScroll: true });\n // focus() can be refused (a field still hidden by the panel's transition,\n // say). No blur follows a focus that never arrived, so release the claim\n // here or the widget counts as focused forever.\n // Stop trying until the widget next gains focus: releasing the claim\n // re-renders, and a retry on every render would loop forever.\n if (!hasFocus()) {\n declined.current = true;\n 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 // 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). Hand focus back\n // and release the claim before the node is removed: a layout-effect cleanup\n // runs while the input is still in the document, a passive one doesn't.\n useLayoutEffect(\n () => () => {\n if (!claimed.current) return;\n const input = inputRef.current;\n const target = returnTo.current;\n if (target?.isConnected && input && activeElementFor(input) === input) {\n returning.current = true;\n focusWithCaret(target, returnRange.current);\n returning.current = false;\n }\n claimed.current = false;\n onFocusChangeRef.current(false);\n },\n [],\n );\n\n const handBack = (answered = false) => {\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) declined.current = true;\n const target = returnTo.current;\n if (target?.isConnected && hasFocus()) {\n returning.current = true;\n focusWithCaret(target, returnRange.current);\n returning.current = false;\n }\n reportFocus(false);\n };\n\n const trimmed = view.query.trim();\n const highlightedId =\n view.highlighted >= 0 && view.highlighted < view.places.length\n ? `${rowIdPrefix}${view.highlighted}`\n : undefined;\n\n let body: ReactNode = null;\n if (view.places.length > 0) {\n body = view.places.map((place, index) => (\n // biome-ignore lint/a11y/useKeyWithClickEvents: the field drives the list from the keyboard (ArrowUp/ArrowDown/Enter).\n // biome-ignore lint/a11y/useFocusableInteractive: rows are never focused; the field points at the highlighted one with aria-activedescendant.\n <div\n key={place.id}\n id={`${rowIdPrefix}${index}`}\n role=\"option\"\n aria-selected={index === view.highlighted}\n className={index === view.highlighted ? `${styles.row} ${styles.highlighted}` : styles.row}\n data-aia-location-row=\"\"\n data-aia-index={index}\n onClick={() => {\n if (!interactive) return;\n handBack(true);\n onCommit(index);\n }}\n >\n <span className={styles.pin}>{PIN}</span>\n <span className={styles.text}>\n <span className={styles.name}>{place.name}</span>\n {place.secondary && <span className={styles.secondary}>{place.secondary}</span>}\n </span>\n </div>\n ));\n } else if (view.status === \"loading\") {\n body = (\n <div className={styles.loading} data-aia-location-loading=\"\">\n <span className={styles.loadingBar} />\n <span className={styles.loadingBar} />\n <span className={styles.loadingBar} />\n </div>\n );\n } else if (trimmed) {\n body = (\n <div className={styles.note} data-aia-location-note=\"\">\n {view.status === \"done\" && <span className={styles.empty}>{noResultsLabel}</span>}\n <span>{useTypedLabel}</span>\n </div>\n );\n }\n\n return (\n // biome-ignore lint/a11y/noStaticElementInteractions: only lets a press on the field through the dropdown's mousedown guard; it handles no interaction itself.\n <div\n ref={rootRef}\n className={styles.location}\n data-aia-location=\"\"\n // A press anywhere on the field (the input, its search icon, its\n // padding — the label focuses the input for all of them) must reach it:\n // the dropdown root cancels every mousedown inside it, so this one stops\n // here — and claims focus before the editor's blur, which would\n // otherwise close the panel.\n onMouseDown={(e) => {\n if (!(e.target instanceof Node) || !fieldRef.current?.contains(e.target)) return;\n e.stopPropagation();\n rememberReturn();\n reportFocus(true);\n }}\n >\n <label ref={fieldRef} className={styles.field}>\n {SEARCH}\n <input\n ref={inputRef}\n type=\"text\"\n className={styles.input}\n data-aia-location-input=\"\"\n defaultValue={view.query}\n placeholder={searchLabel}\n aria-label={searchLabel}\n aria-activedescendant={highlightedId}\n autoComplete=\"off\"\n autoCapitalize=\"words\"\n // Enter answers the pill, so mobile keyboards label it \"done\".\n enterKeyHint=\"done\"\n spellCheck={false}\n tabIndex={visible ? 0 : -1}\n onChange={(e) => onQuery(e.target.value)}\n onFocus={(e) => {\n rememberKeyboardReturn(e.relatedTarget);\n reportFocus(true);\n }}\n onBlur={() => {\n if (returning.current) return;\n declined.current = true;\n reportFocus(false);\n }}\n onKeyDown={(e) => {\n if (e.nativeEvent.isComposing) return;\n switch (e.key) {\n case \"ArrowDown\":\n case \"ArrowUp\":\n e.preventDefault();\n onMove(e.key === \"ArrowDown\" ? 1 : -1);\n return;\n case \"Enter\":\n e.preventDefault();\n if (!interactive) return;\n handBack(true);\n onCommit();\n return;\n // Tab is left to the browser. The dropdown sits before the\n // input in the DOM, so the field is the input's previous tab\n // stop: Tab goes forward to the input, Shift+Tab to whatever\n // precedes the widget.\n case \"Escape\":\n // Back to the input, the pill left as it was.\n e.preventDefault();\n e.stopPropagation();\n declined.current = true;\n handBack();\n return;\n case \"Backspace\":\n // Backspacing past the start of an empty field goes back to the input.\n if (e.currentTarget.value !== \"\") return;\n e.preventDefault();\n declined.current = true;\n handBack();\n return;\n }\n }}\n />\n </label>\n <div className={styles.results} data-aia-location-results=\"\" aria-live=\"polite\">\n {body}\n </div>\n </div>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-2feec02e\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-2feec02e\";\n s.textContent = `/* Location search — React copy of the vanilla rules in styles.css (and of the\n Angular copy). The three are kept identical by\n packages/vanilla/tests/render/locationFieldParity.test.ts. */\n.aia-location-6-fsr {\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: 6px 6px 4px;\n}\n\n.aia-field-xEzwi {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 10px;\n border-radius: var(--aia-location-field-radius, 10px);\n background: var(--aia-location-field-bg-idle, transparent);\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n cursor: text;\n transition: background-color 120ms ease;\n}\n\n.aia-field-xEzwi:hover,\n.aia-field-xEzwi:focus-within {\n background: var(--aia-location-field-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06));\n}\n\n.aia-icon-czx6C {\n display: block;\n width: 15px;\n height: 15px;\n}\n\n.aia-input-Yi9V- {\n flex: 1;\n min-width: 0;\n padding: 0;\n border: 0;\n outline: 0;\n background: transparent;\n font: inherit;\n /* Never under 16px: iOS Safari zooms the page into a smaller field it focuses. */\n font-size: max(16px, var(--aia-location-font-size, 15px));\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n}\n\n.aia-input-Yi9V-::placeholder {\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n font-weight: 300;\n opacity: 0.7;\n}\n\n.aia-results-C3O0V {\n display: flex;\n flex-direction: column;\n}\n\n.aia-row-Q9y8g {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 8px 10px;\n border-radius: 8px;\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n cursor: pointer;\n}\n\n.aia-row-Q9y8g:hover,\n.aia-highlighted-RJjPx {\n background: var(\n --aia-location-row-bg-highlighted,\n rgba(var(--aia-streak-rgb, 255, 255, 255), 0.08)\n );\n}\n\n.aia-pin-OjabL {\n flex: 0 0 15px;\n}\n\n.aia-text-Xs84O {\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n\n.aia-name-Z-WJR {\n overflow: hidden;\n font-size: var(--aia-location-font-size, 15px);\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.aia-secondary-4sCT1 {\n overflow: hidden;\n font-size: 13px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.aia-note-xCSvY {\n display: flex;\n flex-direction: column;\n gap: 2px;\n padding: 8px 10px;\n font-size: 13px;\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n}\n\n.aia-empty-SYBzi {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n}\n\n.aia-loading-Ih1gi {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 10px;\n}\n\n.aia-loadingBar-OLCr4 {\n width: 70%;\n height: 12px;\n border-radius: 6px;\n background: var(--aia-skeleton-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.08));\n}\n\n.aia-loadingBar-OLCr4:nth-child(2) {\n width: 50%;\n}\n\n.aia-loadingBar-OLCr4:nth-child(3) {\n width: 60%;\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"location\":\"aia-location-6-fsr\",\"field\":\"aia-field-xEzwi\",\"icon\":\"aia-icon-czx6C\",\"input\":\"aia-input-Yi9V-\",\"results\":\"aia-results-C3O0V\",\"row\":\"aia-row-Q9y8g\",\"highlighted\":\"aia-highlighted-RJjPx\",\"pin\":\"aia-pin-OjabL\",\"text\":\"aia-text-Xs84O\",\"name\":\"aia-name-Z-WJR\",\"secondary\":\"aia-secondary-4sCT1\",\"note\":\"aia-note-xCSvY\",\"empty\":\"aia-empty-SYBzi\",\"loading\":\"aia-loading-Ih1gi\",\"loadingBar\":\"aia-loadingBar-OLCr4\"};","import {\n isSmartSuggestion,\n isTraditionalAutocompleteSuggestion,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport type { CSSProperties } from \"react\";\nimport type { Suggestion } from \"../types\";\nimport { PARAM_PILL_OPACITY, ParamPill, type PillState } from \"./ParamPill\";\nimport pillStyles from \"./ParamPill.module.css\";\nimport styles from \"./PillList.module.css\";\n\ninterface PillListProps {\n pills: Suggestion[];\n activePillIndex: number;\n onSelectPill: (index: number) => void;\n /**\n * Whether the active pill should render in the `selected` state (full\n * opacity) rather than its positional `first` tier. In `auto` dropdown mode\n * this is true only while a dropdown option is highlighted; in `manual` mode\n * it becomes true once the user taps a pill. Default: false.\n */\n activeSelected?: boolean;\n /** Use capsule-shaped pills (fully rounded). Default: false. */\n rounded?: boolean;\n /**\n * When true, the rendered pills become non-interactive shimmering skeletons.\n * Real pills (with their text) are rendered when provided so widths/positions\n * match the previous state; when `pills` is empty, fixed-width fallback\n * placeholders are rendered instead.\n */\n loading?: boolean;\n}\n\nconst FALLBACK_SKELETON_WIDTHS = [125, 69];\n\n/**\n * Map a pill's index to its positional emphasis tier. The selected (active)\n * pill is handled separately — only the at-most-three positions get a tier\n * here: first, next, then last for everything after.\n */\nfunction pillStateForIndex(index: number): PillState {\n if (index === 0) return \"first\";\n if (index === 1) return \"next\";\n return \"last\";\n}\n\nexport function PillList({\n pills,\n activePillIndex,\n onSelectPill,\n activeSelected,\n rounded,\n loading,\n}: PillListProps) {\n if (loading && pills.length === 0) {\n return (\n <span className={styles.list} data-aia-pill-list-loading=\"\">\n {FALLBACK_SKELETON_WIDTHS.map((w, i) => (\n <span\n key={`skel-${w}`}\n data-aia-pill-skeleton=\"\"\n className={`${pillStyles.pill} ${rounded ? pillStyles.rounded : \"\"} ${pillStyles.skeleton}`}\n style={\n {\n width: w,\n \"--aia-pill-opacity\": PARAM_PILL_OPACITY[pillStateForIndex(i)],\n } as CSSProperties\n }\n />\n ))}\n </span>\n );\n }\n\n return (\n <span className={styles.list} data-aia-pill-list-loading={loading ? \"\" : undefined}>\n {pills.map((pill, i) => {\n // The active pill is \"selected\" only when activeSelected is set;\n // otherwise it shows its positional tier (first/next/last).\n const selected = Boolean(activeSelected) && i === activePillIndex;\n return (\n <ParamPill\n key={`${pill.parameter}-${pill.text}`}\n label={pill.text}\n state={selected ? \"selected\" : pillStateForIndex(i)}\n selected={selected}\n active={i === activePillIndex}\n rounded={rounded}\n loading={loading}\n smartSuggestion={isSmartSuggestion(pill)}\n completionHeader={isTraditionalAutocompleteSuggestion(pill)}\n onClick={() => onSelectPill(i)}\n />\n );\n })}\n </span>\n );\n}\n","import { SMART_SUGGESTION_SPARKLE_SVG } from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport type { CSSProperties, MouseEvent } from \"react\";\nimport styles from \"./ParamPill.module.css\";\n\n/**\n * Visual emphasis tier for a pill. The selected (active) pill renders in the\n * `selected` state; every other pill takes its tier from its position in the\n * upcoming-params sequence — `first`, `next`, then `last` for the rest —\n * progressively de-emphasized.\n */\nexport type PillState = \"selected\" | \"first\" | \"next\" | \"last\";\n\n/** Opacity applied per state. Kept here so `PillList` skeletons stay in sync. */\nexport const PARAM_PILL_OPACITY: Record<PillState, number> = {\n selected: 1,\n first: 0.7,\n next: 0.4,\n last: 0.2,\n};\n\ninterface ParamPillProps {\n /** Pill label text. */\n label: string;\n /** Visual emphasis tier (drives opacity). */\n state: PillState;\n /** Renders the selection outline (the pill at the active index). */\n selected?: boolean;\n /** The pill at the active index — the parameter the options below answer. */\n active?: boolean;\n /** Capsule shape (fully rounded). Default: false. */\n rounded?: boolean;\n /** Non-interactive shimmering skeleton. */\n loading?: boolean;\n /** The Smart Suggestion look: sentence case, with a shimmer and a sparkle. */\n smartSuggestion?: boolean;\n /** The inert header over traditional autocomplete completions, which takes no pointer. */\n completionHeader?: boolean;\n onClick?: () => void;\n}\n\n/**\n * ParamPill — the unfilled suggestion pill (Figma component \"ParamPill\",\n * formerly \"Pill\"). Rendered in the dropdown pill-bar and the inline pill list.\n */\nexport function ParamPill({\n label,\n state,\n active,\n rounded,\n loading,\n smartSuggestion,\n completionHeader,\n onClick,\n}: ParamPillProps) {\n const className = [styles.pill, rounded ? styles.rounded : \"\", loading ? styles.skeleton : \"\"]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <button\n type=\"button\"\n data-aia-pill=\"\"\n data-aia-pill-active={active ? \"\" : undefined}\n data-aia-loading={loading ? \"\" : undefined}\n data-aia-smart-suggestion={smartSuggestion ? (completionHeader ? \"header\" : \"\") : undefined}\n tabIndex={-1}\n contentEditable={false}\n suppressContentEditableWarning\n className={className}\n style={{ \"--aia-pill-opacity\": PARAM_PILL_OPACITY[state] } as CSSProperties}\n onMouseDown={(e: MouseEvent) => e.preventDefault()}\n onClick={loading ? undefined : onClick}\n disabled={loading}\n >\n {smartSuggestion ? (\n <>\n <span className={`${styles.smartText} magicx-aia-smart-suggestion-text`}>{label}</span>\n <span\n className={`${styles.smartSparkle} magicx-aia-smart-suggestion-sparkle`}\n // biome-ignore lint/security/noDangerouslySetInnerHtml: a fixed SDK constant, never server markup\n dangerouslySetInnerHTML={{ __html: SMART_SUGGESTION_SPARKLE_SVG }}\n />\n </>\n ) : (\n label\n )}\n </button>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-199d0432\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-199d0432\";\n s.textContent = `/* ParamPill (Figma \"ParamPill\") — unfilled suggestion pill: transparent fill,\n no outline. ~28px via 6px padding + 14px text + the 1px border (border-box).\n The border is kept as a 1px transparent line so the box stays the same size\n as it was when the outline was dashed. */\n.aia-pill-6Ga7S {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 5px 8px;\n border: 1px solid transparent;\n border-radius: 7px;\n background: transparent;\n color: var(--aia-pill-color, var(--aia-color-text-muted, #c1c4cb));\n font-family: inherit;\n /* Param labels read as small-caps section headers: distinctly smaller than\n the options they head (0.8× the pill knob), uppercased, and letter-spaced. */\n font-size: calc(var(--aia-pill-font-size, 14px) * 0.8);\n font-weight: 600;\n line-height: normal;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n cursor: pointer;\n white-space: nowrap;\n /* The positional opacity ramp, set inline per pill as a custom property so\n a rule can read the live label at full strength without !important. */\n opacity: var(--aia-pill-opacity, 1);\n animation: aia-fadeIn-Ux4eQ 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;\n}\n\n.aia-rounded-y7xA9 {\n border-radius: 999px;\n}\n\n/* Smart Suggestion header: the question label's type, with a sparkle after\n it, over the completions of the word being typed or on a question the server\n marks. When it appears a glint of the accent sweeps the text twice and the\n sparkle twinkles as each lands. Only the header over completions\n (\"header\") takes no pointer: a marked question is tapped like any pill. */\n.aia-pill-6Ga7S[data-aia-smart-suggestion] {\n gap: 0.35em;\n}\n\n.aia-pill-6Ga7S[data-aia-smart-suggestion=\"header\"] {\n cursor: default;\n}\n\n.aia-smartText-R0cfw {\n background:\n linear-gradient(\n 105deg,\n var(--aia-pill-color, var(--aia-color-text-muted, #c1c4cb)) 34%,\n var(--aia-smart-suggestion-accent, #b84549) 44%,\n var(--aia-smart-suggestion-glint, #f3c4c5) 50%,\n var(--aia-smart-suggestion-accent, #b84549) 56%,\n var(--aia-pill-color, var(--aia-color-text-muted, #c1c4cb)) 66%\n )\n 100% 0 / 300% 100%;\n -webkit-background-clip: text;\n background-clip: text;\n -webkit-text-fill-color: transparent;\n animation: aia-smartSuggestion-shimmer-F-yoD 2.5s ease-in-out 2;\n}\n\n.aia-smartSparkle-IVabG {\n display: inline-flex;\n color: var(--aia-smart-suggestion-accent, #b84549);\n}\n\n.aia-smartSparkle-IVabG .aia-sparkle-large,\n.aia-smartSparkle-IVabG .aia-sparkle-small {\n transform-box: fill-box;\n transform-origin: center;\n animation: aia-smartSuggestion-sparkle-Wfj-4 2.5s ease-in-out 2;\n}\n\n.aia-smartSparkle-IVabG .aia-sparkle-small {\n animation-name: aia-smartSuggestion-sparkle-small-3VsWJ;\n}\n\n@keyframes aia-smartSuggestion-shimmer-F-yoD {\n 0% {\n background-position: 100% 0;\n }\n 60%,\n 100% {\n background-position: 0 0;\n }\n}\n\n@keyframes aia-smartSuggestion-sparkle-Wfj-4 {\n 0%,\n 45%,\n 75%,\n 100% {\n transform: scale(1);\n }\n 60% {\n transform: scale(1.12);\n }\n}\n\n@keyframes aia-smartSuggestion-sparkle-small-3VsWJ {\n 0%,\n 45%,\n 75%,\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n 60% {\n transform: scale(1.5);\n opacity: 0.55;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-smartText-R0cfw,\n .aia-smartSparkle-IVabG .aia-sparkle-large,\n .aia-smartSparkle-IVabG .aia-sparkle-small {\n animation: none;\n }\n}\n\n/* Forced colours drop the background-clip paint, so the text is drawn plainly. */\n@media (forced-colors: active) {\n .aia-smartText-R0cfw {\n background: none;\n -webkit-text-fill-color: currentColor;\n animation: none;\n }\n}\n\n/* Loading — a pill kept from the last response fades out while the next one\n is fetched; a placeholder pill (no cached pills) only holds its space. */\n.aia-skeleton-57P0T {\n pointer-events: none;\n cursor: default;\n animation: aia-loadingOut-Aj9xO 160ms ease-in forwards;\n}\n\n.aia-skeleton-57P0T[data-aia-pill-skeleton] {\n visibility: hidden;\n animation: none;\n}\n\n/* Ends a hair above zero, like magicx-aia-fadeIn starts: a pill kept by key\n is re-enabled in place, and iOS cancels a tap on an element leaving 0. */\n@keyframes aia-loadingOut-Aj9xO {\n to {\n opacity: 0.01;\n }\n}\n\n@keyframes aia-fadeIn-Ux4eQ {\n from {\n opacity: 0;\n }\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"pill\":\"aia-pill-6Ga7S\",\"fadeIn\":\"aia-fadeIn-Ux4eQ\",\"rounded\":\"aia-rounded-y7xA9\",\"smartText\":\"aia-smartText-R0cfw\",\"smartSuggestion-shimmer\":\"aia-smartSuggestion-shimmer-F-yoD\",\"smartSparkle\":\"aia-smartSparkle-IVabG\",\"smartSuggestion-sparkle\":\"aia-smartSuggestion-sparkle-Wfj-4\",\"smartSuggestion-sparkle-small\":\"aia-smartSuggestion-sparkle-small-3VsWJ\",\"skeleton\":\"aia-skeleton-57P0T\",\"loadingOut\":\"aia-loadingOut-Aj9xO\"};","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-0fcb7940\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-0fcb7940\";\n s.textContent = `.aia-list-qvLqO {\n position: relative;\n z-index: 1;\n pointer-events: auto;\n display: inline-flex;\n gap: 7px;\n padding: 0 8px;\n align-items: center;\n vertical-align: middle;\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"list\":\"aia-list-qvLqO\"};","import {\n attachProductRowWheel,\n productImageSources,\n productImageSrc,\n productInitial,\n productPhotoFill,\n type UIStrings,\n uiStringsFor,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport {\n type CSSProperties,\n type KeyboardEvent as ReactKeyboardEvent,\n type MouseEvent as ReactMouseEvent,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport type { Product, ProductImageFallback, ProductsLayout } from \"../types\";\nimport styles from \"./ProductStrip.module.css\";\n\ninterface ProductStripProps {\n products: Product[];\n /** Scopes the section label's id to the owning listbox. */\n listboxId: string;\n onSelect: (product: Product) => void;\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 busyProductId?: string | 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 `onSelect`.\n */\n onAddToCart?: (product: Product) => void | PromiseLike<unknown>;\n /**\n * Focus moved into / out of the strip. The panel closes on blur by default\n * and the input blurs the moment a card takes focus, so the dropdown reports\n * focus as still-inside rather than shutting out from under the card.\n */\n onFocusChange?: (focused: boolean) => void;\n /**\n * True while a request is in flight: the strip fades out with the options\n * and back in when the response lands.\n */\n loading?: boolean;\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 focusable?: boolean;\n /** How the cards lay out — a scrolling row, or stacked as full-width rows. Default: \"row\". */\n layout?: ProductsLayout;\n imageFallback?: ProductImageFallback;\n /** Whether the cards draw the vendor line above the title. Default: true. */\n showVendor?: boolean;\n /** The words of the widget language. Default: English. */\n strings?: UIStrings;\n}\n\n/**\n * The dropdown's product strip: a labelled section holding a horizontally\n * scrolling row of product cards. Sits below the options grid and above the\n * footer, and renders only when there are products — the panel's two halves\n * are independent, so an empty strip leaves no gap and an empty options grid\n * leaves the strip alone.\n *\n * Mirrors the vanilla core's `renderProductStrip` markup and class contract so\n * both packages theme identically. Two layout notes carried over from it:\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 * Every text node resolves its colour through the same `--aia-option-*`\n * chain the options use (see ProductStrip.module.css).\n * - The options grid carries a negative bottom margin so the footer rides up\n * over its reserved band; whatever follows the grid inherits that pull. The\n * dropdown root is marked `data-aia-has-products` and appearance.css zeroes\n * the band at its source rather than the strip cancelling it from here.\n */\nexport function ProductStrip({\n products,\n listboxId,\n onSelect,\n busyProductId = null,\n onAddToCart,\n onFocusChange,\n focusable = true,\n loading = false,\n layout = \"row\",\n imageFallback = \"image\",\n showVendor = true,\n strings = uiStringsFor(),\n}: ProductStripProps) {\n const hasProducts = products.length > 0;\n const rowRef = useRef<HTMLDivElement>(null);\n\n // A mouse wheel over the row scrolls it sideways. Bound through the ref\n // rather than `onWheel`: React registers wheel listeners passively, so a\n // `preventDefault` from the prop would not keep the page still. The row\n // element is stable while there are products and unmounts with the section,\n // so the binding follows `hasProducts`.\n useEffect(() => {\n const row = rowRef.current;\n if (!hasProducts || !row) return;\n return attachProductRowWheel(row);\n }, [hasProducts]);\n\n if (!hasProducts) return null;\n\n const labelId = `${listboxId}-products-label`;\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: the rule suggests <fieldset>, which groups form controls and drags in legend semantics and UA styling. `group` is the one role a listbox accepts around a set of options, so the explicit ARIA role is exactly the point.\n <section\n className={styles.section}\n data-aia-products=\"\"\n data-aia-loading={loading ? \"\" : undefined}\n // The layout is CSS keyed off this attribute — the same cards, stacked\n // as rows under \"list\".\n data-aia-products-layout={layout}\n // `group` is the one role a listbox accepts around a set of options, so\n // the strip stays inside the listbox without breaking its content model.\n role=\"group\"\n aria-labelledby={labelId}\n >\n {/* data-aia-products-label: the scroll arrow centres itself on this row. */}\n <div className={styles.label} id={labelId} data-aia-products-label=\"\">\n {strings.products}\n </div>\n <div ref={rowRef} className={styles.row} data-aia-products-row=\"\">\n {products.map((product, i) => (\n <ProductCard\n key={product.id}\n product={product}\n id={`${listboxId}-product-${i}`}\n onSelect={onSelect}\n busy={product.id === busyProductId}\n onAddToCart={onAddToCart}\n onFocusChange={onFocusChange}\n focusable={focusable}\n imageFallback={imageFallback}\n showVendor={showVendor}\n soldOut={strings.soldOut}\n addToCart={strings.addToCart}\n />\n ))}\n </div>\n </section>\n );\n}\n\ninterface ProductCardProps {\n product: Product;\n id: string;\n onSelect: (product: Product) => void;\n busy: boolean;\n onAddToCart?: (product: Product) => void | PromiseLike<unknown>;\n onFocusChange?: (focused: boolean) => void;\n focusable: boolean;\n imageFallback: ProductImageFallback;\n showVendor: boolean;\n soldOut: string;\n addToCart: string;\n}\n\nfunction ProductCard({\n product,\n id,\n onSelect,\n busy,\n onAddToCart,\n onFocusChange,\n focusable,\n imageFallback,\n showVendor,\n soldOut,\n addToCart,\n}: ProductCardProps) {\n // A sold-out product can't be added, so its card has no button at all.\n const hasCart = Boolean(onAddToCart) && product.available !== false;\n // How much of the tile the photo fills, so the cart button sits inside the\n // photo's own corner (productPhotoFill). Null until it loads.\n const [photoFill, setPhotoFill] = useState<{ x: number; y: number } | null>(null);\n const handleBlur = (e: { relatedTarget: EventTarget | null }) => {\n const next = e.relatedTarget as HTMLElement | null;\n if (next?.closest(\"[data-aia-dropdown]\")) return;\n onFocusChange?.(false);\n };\n const handleClick = (e: ReactMouseEvent<HTMLAnchorElement>) => {\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 (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0) return;\n e.preventDefault();\n onSelect(product);\n };\n\n return (\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 is\n // that AT no longer calls it a link.\n <a\n id={id}\n className={styles.card}\n data-aia-product=\"\"\n data-aia-product-sold-out={product.available === false ? \"\" : undefined}\n data-aia-product-has-cart={hasCart ? \"\" : undefined}\n data-aia-product-state={busy ? \"busy\" : undefined}\n aria-busy={busy ? true : undefined}\n role=\"option\"\n aria-selected={false}\n style={\n photoFill\n ? ({\n \"--aia-product-photo-fill-x\": String(photoFill.x),\n \"--aia-product-photo-fill-y\": String(photoFill.y),\n } as CSSProperties)\n : undefined\n }\n href={product.url}\n tabIndex={focusable ? 0 : -1}\n onClick={handleClick}\n onKeyDown={(e) => {\n if (e.key !== \"Enter\" && e.key !== \" \") return;\n e.preventDefault();\n onSelect(product);\n }}\n onFocus={() => onFocusChange?.(true)}\n onBlur={handleBlur}\n >\n <ProductMedia\n key={productImageSrc(product.imageUrl) ?? \"\"}\n sources={productImageSources(product.imageUrl)}\n title={product.title}\n fallback={imageFallback}\n onPhotoFill={setPhotoFill}\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 className={styles.body}>\n {showVendor && product.vendor ? (\n <span className={styles.vendor}>{product.vendor}</span>\n ) : null}\n <span className={styles.title}>{product.title}</span>\n {product.price ? (\n <span className={styles.price}>\n {product.price}\n {product.compareAtPrice ? (\n <s className={styles.compareAt}>{product.compareAtPrice}</s>\n ) : null}\n </span>\n ) : null}\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 {product.available === false ? <span className={styles.badge}>{soldOut}</span> : null}\n </span>\n {hasCart && onAddToCart ? (\n <CartButton\n // A changed product (anything but its price — vanilla's `cardKey`)\n // remounts the button, which puts an \"added\" check back at rest.\n key={cartIdentity(product)}\n product={product}\n label={`${addToCart}: ${product.title}`}\n focusable={focusable}\n onAddToCart={onAddToCart}\n onFocus={() => onFocusChange?.(true)}\n onBlur={handleBlur}\n />\n ) : null}\n </a>\n );\n}\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\ntype CartState = \"adding\" | \"added\" | null;\n\n/**\n * The card's add-to-cart button. A child of the card rather than of the media\n * tile, which is aria-hidden; the stylesheet lifts it over the tile's bottom\n * right corner. A `role=\"button\"` span, not a <button>: the card is an <a>,\n * and interactive content inside an anchor is invalid HTML (React's\n * validateDOMNesting warns about it). Its press never reaches the card, so it\n * never selects. Mirrors vanilla's `buildCartButton`.\n */\nfunction CartButton({\n product,\n label,\n focusable,\n onAddToCart,\n onFocus,\n onBlur,\n}: {\n product: Product;\n label: string;\n focusable: boolean;\n onAddToCart: (product: Product) => void | PromiseLike<unknown>;\n onFocus: () => void;\n onBlur: (e: { relatedTarget: EventTarget | null }) => void;\n}) {\n const [state, setState] = useState<CartState>(null);\n // The press guard reads a ref, not the state: a second click landing before\n // the re-render must still see \"adding\".\n const stateRef = useRef<CartState>(null);\n // The latest product, so a price change mid-flight adds what the card shows.\n const productRef = useRef(product);\n productRef.current = product;\n const mounted = useRef(true);\n\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n\n const set = (next: CartState) => {\n stateRef.current = next;\n if (mounted.current) setState(next);\n };\n\n const press = (e: ReactMouseEvent<HTMLElement> | ReactKeyboardEvent<HTMLElement>) => {\n e.preventDefault();\n e.stopPropagation();\n if (stateRef.current === \"adding\") return;\n set(\"adding\");\n let pending: PromiseLike<unknown>;\n try {\n pending = Promise.resolve(onAddToCart(productRef.current));\n } catch (error) {\n pending = Promise.reject(error);\n }\n pending.then(\n // The check stays until the product changes; another press adds again.\n () => set(\"added\"),\n () => set(null),\n );\n };\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: the button sits inside the card's <a>, and a <button> there is invalid HTML that React's validateDOMNesting warns about — hence the explicit role on a span.\n <span\n className={styles.cart}\n data-aia-product-cart=\"\"\n data-aia-cart-state={state ?? undefined}\n aria-busy={state === \"adding\" ? true : undefined}\n role=\"button\"\n aria-label={label}\n tabIndex={focusable ? 0 : -1}\n onClick={press}\n // Keys never reach the card, whose own Enter / Space would select it.\n onKeyDown={(e) => {\n if (e.key !== \"Enter\" && e.key !== \" \") return;\n press(e);\n }}\n onFocus={(e) => {\n // The card's own onFocus would report the same thing again.\n e.stopPropagation();\n onFocus();\n }}\n onBlur={(e) => {\n e.stopPropagation();\n onBlur(e);\n }}\n >\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n <path\n className={styles.cartGlyph}\n 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 />\n <path className={styles.cartGlyph} d=\"M13.5 6.5v-4M11.5 4.5h4\" />\n <path className={styles.cartCheck} d=\"M5 12.5l4.5 4.5L19 7.5\" />\n <path className={styles.cartSpinner} d=\"M12 4a8 8 0 1 0 8 8\" />\n <circle className={styles.cartGlyph} cx=\"9\" cy=\"20\" r=\"1.3\" />\n <circle className={styles.cartGlyph} cx=\"17.5\" cy=\"20\" r=\"1.3\" />\n </svg>\n </span>\n );\n}\n\nfunction ProductMedia({\n sources,\n title,\n fallback,\n onPhotoFill,\n}: {\n /** URLs to try in order: the thumbnail, then the original. */\n sources: string[];\n title: string;\n fallback: ProductImageFallback;\n /** How much of the tile the loaded photo fills; null once none can load. */\n onPhotoFill: (fill: { x: number; y: number } | null) => void;\n}) {\n // How many sources have failed to load; the card shows the next one, and\n // its placeholder once none is left. Keyed by the parent on the first src.\n const [failed, setFailed] = useState(0);\n const src = sources[failed];\n const hasImage = Boolean(src);\n // The src that last finished loading: once it is the one shown, the tile's\n // placeholder fill steps aside.\n const [loadedSrc, setLoadedSrc] = useState<string | null>(null);\n const showInitial = !hasImage && fallback === \"initial\";\n // Keyed on the first source, so a changed or removed image remounts this\n // tile: the old photo's fill goes with it, and the new one's load sets its own.\n useEffect(() => () => onPhotoFill(null), [onPhotoFill]);\n return (\n <span\n className={styles.media}\n // A styling hook that reads the same in every package (the class does not).\n data-aia-product-media=\"\"\n aria-hidden=\"true\"\n data-aia-product-placeholder={!hasImage && !showInitial ? \"\" : undefined}\n data-aia-product-initial={showInitial ? \"\" : undefined}\n data-aia-image-loaded={hasImage && loadedSrc === src ? \"\" : undefined}\n >\n {hasImage ? (\n <img\n className={styles.image}\n src={src}\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n onLoad={(e) => {\n setLoadedSrc(src);\n onPhotoFill(\n productPhotoFill(e.currentTarget.naturalWidth, e.currentTarget.naturalHeight),\n );\n }}\n onError={() => {\n // The last source failing leaves the placeholder, which fills the tile.\n if (failed + 1 >= sources.length) onPhotoFill(null);\n setFailed((count) => count + 1);\n }}\n />\n ) : null}\n {showInitial ? productInitial(title) : null}\n </span>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-fef1688d\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-fef1688d\";\n s.textContent = `/* Product strip — the React counterpart of the vanilla core's strip rules\n (packages/vanilla/src/styles.css). Same tokens, same defaults, so a consumer\n theming one package sees the same result in the other.\n\n Nothing here is allowed to say \\`color: inherit\\`: the dropdown paints a\n background but never sets a \\`color\\`, so an inheriting node would pick up the\n HOST PAGE's text colour and render black text on a dark panel. For the same\n reason there is no \\`prefers-color-scheme\\` rule in this file — the panel's\n darkness comes from --aia-surface, which is independent of the OS setting. */\n\n.aia-section-Hugfg {\n display: flex;\n flex-direction: column;\n gap: 6px;\n /* The option text sits 10px inside the dropdown's padding edge (the\n option's own padding), so the section carries the same 10px and its\n label lands on the option text's left edge — which the dropdown in turn\n places under the typed text (--aia-content-inset-left). */\n padding: 0 10px;\n min-width: 0;\n}\n\n.aia-label-nuc93 {\n font-family: inherit;\n font-size: var(--aia-products-label-font-size, 11px);\n font-weight: 500;\n line-height: 18px;\n letter-spacing: 0.02em;\n color: var(\n --aia-products-label-color,\n var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb))\n );\n}\n\n/* The scroll container. Horizontal overflow is confined here — the dropdown\n itself is \\`overflow: hidden\\`, so the page can never gain a sideways\n scrollbar no matter how many cards there are. \\`overscroll-behavior-x\\` stops\n a trackpad fling at either end from chaining out to the page. */\n.aia-row-WDVBX {\n display: flex;\n gap: var(--aia-product-gap, 8px);\n min-width: 0;\n overflow-x: auto;\n overflow-y: hidden;\n overscroll-behavior-x: contain;\n padding-bottom: 2px;\n /* Pull the row out by the card's own 6px padding so the first card's\n image tile — not its hover fill — starts on the label's left edge, the\n same way the option's highlight fill hangs outside its text. */\n margin-inline: -6px;\n /* Hide the scrollbar chrome across all three engines while leaving the box\n scrollable by trackpad, touch and keyboard. A mouse wheel is vertical and\n would otherwise have no way through a row with no scrollbar to grab, so\n ProductStrip.tsx binds the vanilla package's attachProductRowWheel on the\n row to turn a wheel over it into sideways travel. */\n scrollbar-width: none;\n -ms-overflow-style: none;\n}\n\n.aia-row-WDVBX::-webkit-scrollbar {\n display: none;\n}\n\n.aia-card-JBGYT {\n flex: 0 0 auto;\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: var(--aia-product-card-width, 116px);\n padding: 6px;\n border-radius: 10px;\n background: var(--aia-product-bg, transparent);\n /* Explicit, never inherited — see the file header. */\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n text-decoration: none;\n cursor: pointer;\n transition: background-color 150ms ease;\n /* The sold-out badge is positioned against the card. */\n position: relative;\n}\n\n.aia-card-JBGYT:hover {\n background: var(--aia-product-bg-active, var(--aia-option-bg, transparent));\n}\n\n/* Focus is the only cue a keyboard user gets, so it is a real ring rather than\n a background change. Drawn INSIDE the card (negative offset): the row is a\n scroll container with clipped overflow, so an outset ring is cut off on the\n first and last cards and on every card's top and bottom edge. */\n.aia-card-JBGYT:focus-visible {\n outline: 2px solid var(--aia-product-focus-ring, var(--aia-option-color-selected, currentColor));\n outline-offset: -2px;\n}\n\n/* Square media tile. aspect-ratio (not a fixed height) keeps it square at any\n --aia-product-card-width a consumer sets. The fill is the placeholder: it\n shows across the whole tile until the photo paints (a photo's size isn't\n known before it loads), and behind both fallback tiles. */\n.aia-media-RrbGe {\n display: block;\n position: relative;\n width: 100%;\n aspect-ratio: 1 / 1;\n border-radius: 8px;\n overflow: hidden;\n background: var(--aia-product-media-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.25)));\n}\n\n/* Once the photo has loaded the placeholder steps aside: a contained photo\n that doesn't fill the tile sits on the panel's own background rather than\n on a grey box. The renderer sets the attribute from the photo's \\`load\\`\n event. */\n.aia-media-RrbGe[data-aia-image-loaded] {\n background: transparent;\n}\n\n/* \\`contain\\`, not \\`cover\\`: catalog photos come in any aspect ratio, and a\n square crop cuts the top and bottom off a tall one (a gallon jug). The\n picture fills the tile's height and takes only the width its ratio needs,\n centred, so a tall picture's box is the picture itself and its own corner\n radius rounds it. A wide one is clamped to the tile's width and contained\n inside it; a square one fills the tile. */\n.aia-image-5pNL7 {\n display: block;\n width: auto;\n max-width: 100%;\n height: 100%;\n margin: 0 auto;\n border-radius: var(--aia-product-image-radius, 8px);\n object-fit: contain;\n}\n\n/* Placeholder tile for a product with no image — a storefront pictogram on\n the same media fill, so a card without art reads as \"no photo\" instead of\n broken. The pictogram is inlined as a data URI so the placeholder needs no\n network and no asset pipeline; --aia-product-placeholder-image swaps it. */\n.aia-media-RrbGe:where([data-aia-product-initial]) {\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--aia-product-title-color, var(--aia-option-color-selected, currentColor));\n font-size: 24px;\n font-weight: 600;\n line-height: 1;\n}\n\n.aia-media-RrbGe[data-aia-product-placeholder]::after {\n content: \"\";\n position: absolute;\n inset: 22%;\n background:\n var(\n --aia-product-placeholder-image,\n url(\"data:image/svg+xml,%3Csvg viewBox='0 -0.5 32 32' fill-rule='evenodd' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform='matrix(1,0,0,1,-384,-144)'%3E%3Cg transform='matrix(0.875,0,0,0.875,90.25,19.125)'%3E%3Cpath d='M340.924,147.74C341.224,146.789 342.107,146.143 343.104,146.143C347.705,146.143 360.491,146.143 364.985,146.143C365.965,146.143 366.836,146.768 367.15,147.697C368.119,150.386 370,155.73 370,157C370,159.208 368.208,161 366,161C363.792,161 362,159.208 362,157C362,159.208 360.208,161 358,161C355.792,161 354,159.208 354,157C354,159.208 352.208,161 350,161C347.792,161 346,159.208 346,157C346,159.208 344.208,161 342,161C340.53,161 339.244,160.205 338.549,159.022C338.057,158.185 337.944,157.179 338.236,156.254C338.787,154.507 340.172,150.121 340.924,147.74Z' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1,0,0,1.32454,48,-56.1457)'%3E%3Cpath d='M341.026,160.675C341.026,160.675 341.01,168.196 341.003,171.488C341.002,171.889 341.213,172.273 341.588,172.557C341.963,172.841 342.472,173 343.003,173C347.188,173 356.817,173 361,173C361.53,173 362.039,172.841 362.414,172.558C362.789,172.275 363,171.891 363,171.49C363,168.2 363,160.675 363,160.675' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1,0,0,1,48,0)'%3E%3Cpath d='M355,168C355,166.895 354.105,166 353,166C352.356,166 351.644,166 351,166C349.895,166 349,166.895 349,168C349,170.069 349,173 349,173L355,173L355,168Z' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1.11111,0,0,1.11111,-47.2678,-87.5361)'%3E%3Ccircle cx='411.5' cy='213.5' r='4.5' fill='%2390e0ef'%3E%3C/circle%3E%3C/g%3E%3Cpath d='M405.529,146C406.628,144.773 408.225,144 410,144C413.311,144 416,146.689 416,150C416,151.549 415.412,152.962 414.446,154.027C414.775,155.15 415,156.076 415,156.5C415,158.459 413.746,160.127 411.998,160.744L411.998,171C411.998,171.796 411.682,172.559 411.119,173.121C410.557,173.684 409.794,174 408.998,174L391.002,174C390.205,174 389.441,173.683 388.879,173.119C388.316,172.555 388,171.79 388.002,170.994L388.024,160.752C387.007,160.399 386.155,159.691 385.618,158.776L385.618,158.776C385.044,157.799 384.912,156.626 385.253,155.546L387.605,148.097C387.999,146.849 389.157,146 390.466,146L405.529,146ZM409.998,160.972C408.79,160.838 407.726,160.225 407,159.327C406.175,160.347 404.913,161 403.5,161C402.087,161 400.825,160.347 400,159.327C399.175,160.347 397.913,161 396.5,161C395.087,161 393.825,160.347 393,159.327C392.278,160.219 391.222,160.831 390.023,160.97L390.002,170.998C390.002,171.263 390.107,171.518 390.294,171.706C390.482,171.894 390.736,172 391.002,172L396,172L396,168C396,166.343 397.343,165 399,165L401,165C402.657,165 404,166.343 404,168L404,172L408.998,172C409.263,172 409.517,171.895 409.705,171.707C409.893,171.52 409.998,171.265 409.998,171L409.998,160.972ZM402,172L398,172L398,168C398,167.448 398.448,167 399,167C399,167 401,167 401,167C401.552,167 402,167.448 402,168L402,172ZM404.342,148L390.466,148C390.03,148 389.644,148.283 389.512,148.699L387.16,156.148C386.99,156.688 387.056,157.275 387.342,157.763C387.777,158.503 388.581,159 389.5,159C390.88,159 392,157.88 392,156.5C392,155.003 394,155.003 394,156.5C394,157.88 395.12,159 396.5,159C397.88,159 399,157.88 399,156.5C399,155.004 401,155.004 401,156.5C401,157.88 402.12,159 403.5,159C404.88,159 406,157.88 406,156.5C406,154.986 408,154.986 408,156.5C408,157.88 409.12,159 410.5,159C411.88,159 413,157.88 413,156.5C413,156.259 412.917,155.843 412.779,155.318C411.948,155.753 411.003,156 410,156C406.689,156 404,153.311 404,150C404,149.299 404.12,148.626 404.342,148ZM410,146C412.208,146 414,147.792 414,150C414,152.208 412.208,154 410,154C407.792,154 406,152.208 406,150C406,147.792 407.792,146 410,146ZM407.543,151.207L408.546,152.21C408.733,152.397 408.988,152.503 409.253,152.503C409.519,152.503 409.773,152.397 409.961,152.209L412.458,149.706C412.848,149.316 412.847,148.682 412.456,148.292C412.066,147.902 411.432,147.903 411.042,148.294L409.252,150.088C409.252,150.088 408.957,149.793 408.957,149.793C408.567,149.403 407.933,149.403 407.543,149.793C407.153,150.183 407.153,150.817 407.543,151.207Z' fill='%231990a7'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\")\n )\n center / contain no-repeat;\n}\n\n/* The text column. Only the title is guaranteed; vendor and price render no\n element at all when absent, so the gap can't reserve space for a missing\n line. */\n.aia-body-ly032 {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n}\n\n.aia-vendor-Gvu7G {\n font-family: inherit;\n font-size: var(--aia-product-vendor-font-size, 10px);\n line-height: 14px;\n color: var(\n --aia-product-vendor-color,\n var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb))\n );\n opacity: 0.8;\n /* Vendor names are frequently long — one line, clipped. */\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.aia-title-gCNmq {\n font-family: inherit;\n font-size: var(--aia-product-title-font-size, 12px);\n font-weight: 400;\n line-height: 16px;\n /* The card's most prominent text uses the same token the *highlighted*\n option text does, so it stays legible on any --aia-surface a consumer\n sets — light or dark — without a second theming control. */\n color: var(\n --aia-product-title-color,\n var(--aia-option-color-selected, var(--aia-color-text-default, #fff))\n );\n display: -webkit-box;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n}\n\n.aia-price-gULcE {\n font-family: inherit;\n font-size: var(--aia-product-price-font-size, 11px);\n font-weight: 500;\n line-height: 15px;\n color: var(\n --aia-product-price-color,\n var(--aia-option-color-selected, var(--aia-color-text-default, #fff))\n );\n /* The price and the struck price are two items on one line that wrap as\n whole figures: a long pair drops the struck price to the next line rather\n than running past the card's edge. */\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n column-gap: 4px;\n}\n\n/* The price before a markdown, struck through after the price, on the same\n line when both fit. It inherits the price's size and takes its colour dimmed, so it reads\n as secondary on any surface without a second theming control. */\n.aia-compareAt-ewE54 {\n font-weight: 400;\n color: var(--aia-product-compare-at-color, currentColor);\n opacity: var(--aia-product-compare-at-opacity, 0.6);\n}\n\n/* Sold-out badge. It sits last in the text column, so the card's accessible\n name ends with it, and is lifted over the image's top-left corner: card\n padding (6px) plus the same again. A light chip with dark, tracked capitals\n reads on any photo, light or dark, and on either panel surface. */\n.aia-badge-j9Hcd {\n position: absolute;\n top: var(--aia-product-badge-inset, 12px);\n left: var(--aia-product-badge-inset, 12px);\n padding: 3px 6px;\n border-radius: 4px;\n background: var(--aia-product-badge-bg, rgba(255, 255, 255, 0.94));\n color: var(--aia-product-badge-color, #1f2328);\n /* A hairline ring keeps the chip's edge on a pale image or a light panel. */\n box-shadow:\n 0 0 0 1px rgba(0, 0, 0, 0.08),\n 0 1px 2px rgba(0, 0, 0, 0.18);\n font-family: inherit;\n font-size: var(--aia-product-badge-font-size, 9px);\n font-weight: 600;\n line-height: 1;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n white-space: nowrap;\n pointer-events: none;\n}\n\n/* Add-to-cart button (\\`onProductAddToCart\\`). A child of the card, lifted\n over the bottom right corner of the square media tile: the tile starts\n below the card's 6px padding and is the card's width less both paddings\n wide, so its bottom edge is the card width less 6px down, and the button\n sits 6px inside that corner. A light disc with a dark glyph, like the\n sold-out chip, reads on any photo; a store's accent goes in through the\n tokens. */\n.aia-cart-kSlqU {\n position: absolute;\n /* The tile's corner moved in by the margin a photo leaves when it doesn't\n fill the square (--aia-product-photo-fill-x / -y, set on the card when\n the photo loads; 1, the tile's own corner, until then). */\n top: calc(\n var(--aia-product-card-width, 116px) -\n 12px -\n var(--aia-product-cart-size, 28px) -\n (var(--aia-product-card-width, 116px) - 12px) *\n (1 - var(--aia-product-photo-fill-y, 1)) /\n 2\n );\n right: calc(\n 12px +\n (var(--aia-product-card-width, 116px) - 12px) *\n (1 - var(--aia-product-photo-fill-x, 1)) /\n 2\n );\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--aia-product-cart-size, 28px);\n height: var(--aia-product-cart-size, 28px);\n border-radius: 999px;\n background: var(--aia-product-cart-bg, rgba(255, 255, 255, 0.94));\n color: var(--aia-product-cart-color, #1f2328);\n box-shadow:\n 0 0 0 1px rgba(0, 0, 0, 0.08),\n 0 1px 3px rgba(0, 0, 0, 0.22);\n cursor: pointer;\n transition:\n transform 150ms ease,\n opacity 150ms ease;\n}\n\n.aia-cart-kSlqU:hover {\n transform: scale(1.08);\n}\n\n.aia-cart-kSlqU:focus-visible {\n outline: 2px solid var(--aia-product-focus-ring, var(--aia-option-color-selected, currentColor));\n outline-offset: 2px;\n}\n\n.aia-cart-kSlqU svg {\n display: block;\n width: 16px;\n height: 16px;\n fill: none;\n stroke: currentColor;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n/* The glyph's shapes carry no paint attributes of their own, so a page's\n \\`path { … }\\` / \\`circle { … }\\` would beat what they inherit from the svg;\n pin it by class, like the submit arrow's. */\n.aia-cart-kSlqU svg path {\n fill: none;\n stroke: currentColor;\n}\n\n.aia-cart-kSlqU svg circle {\n fill: none;\n stroke: currentColor;\n}\n\n.aia-cartCheck-YTTQ6 {\n display: none;\n}\n\n/* While the integration's promise is in flight the button ignores presses\n and shows a spinner (below) — the only cue: the pointer stays as it is.\n Once it resolves the cart turns into a check, which stays. */\n.aia-cart-kSlqU[data-aia-cart-state=\"added\"] .aia-cartGlyph-cmqAk {\n display: none;\n}\n\n.aia-cart-kSlqU[data-aia-cart-state=\"added\"] .aia-cartCheck-YTTQ6 {\n display: inline;\n}\n\n/* While the add is in flight the cart gives way to a spinning arc. A slower\n turn under reduced motion: it is the only sign the press took. */\n.aia-cartSpinner-442rc {\n display: none;\n}\n\n.aia-cart-kSlqU[data-aia-cart-state=\"adding\"] .aia-cartGlyph-cmqAk {\n display: none;\n}\n\n.aia-cart-kSlqU[data-aia-cart-state=\"adding\"] .aia-cartSpinner-442rc {\n display: inline;\n}\n\n.aia-cart-kSlqU[data-aia-cart-state=\"adding\"] svg {\n animation: aia-magicx-aia-product-cart-spin-x8mgr 0.8s linear infinite;\n}\n\n@keyframes aia-magicx-aia-product-cart-spin-x8mgr {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-cart-kSlqU[data-aia-cart-state=\"adding\"] svg {\n animation-duration: 2s;\n }\n}\n\n/* A selection in progress (\\`onProductSelect\\` ran, its page has not taken\n over): the add-to-cart button's disc and spinning arc sit on the middle of\n the tapped card's picture. The disc is the arc's own fill and spread, so\n the turn moves only the arc, and nothing in the card changes size. A slower\n turn under reduced motion: it is the only sign the tap took. The state\n sits in :where(), so a page's own rule on the attribute restyles or hides\n it. */\n.aia-card-JBGYT:where([data-aia-product-state=\"busy\"]) .aia-media-RrbGe::before {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: 1;\n margin: calc(var(--aia-spinner-size, 16px) / -2) 0 0 calc(var(--aia-spinner-size, 16px) / -2);\n box-sizing: border-box;\n width: var(--aia-spinner-size, 16px);\n height: var(--aia-spinner-size, 16px);\n border: var(--aia-spinner-width, 2px) solid\n var(--aia-product-spinner-color, var(--aia-product-cart-color, #1f2328));\n border-right-color: transparent;\n border-radius: 50%;\n animation: aia-magicx-aia-product-cart-spin-x8mgr 0.8s linear infinite;\n background: var(--aia-product-spinner-bg, var(--aia-product-cart-bg, rgba(255, 255, 255, 0.94)));\n box-shadow:\n 0 0 0 6px var(--aia-product-spinner-bg, var(--aia-product-cart-bg, rgba(255, 255, 255, 0.94))),\n 0 0 0 7px rgba(0, 0, 0, 0.08);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-card-JBGYT:where([data-aia-product-state=\"busy\"]) .aia-media-RrbGe::before {\n animation-duration: 2s;\n }\n}\n\n/* A sold-out product's image steps back, so the badge is not the only cue.\n Desaturated rather than faded: opacity lets the panel show through, which\n muddies a photo on a dark surface. */\n.aia-card-JBGYT[data-aia-product-sold-out] .aia-image-5pNL7 {\n filter: grayscale(0.55);\n}\n\n/* --- List layout (\\`productsLayout: \"list\"\\`) ---\n The same cards stacked as full-width rows — thumbnail on the left, text on\n the right — for results that read as a list (courses, listings, documents)\n rather than a shelf. The column scrolls vertically inside its own cap\n instead of sideways; the dropdown's \\`overflow: hidden\\` still contains it\n and the hidden scrollbar chrome above carries over. Appended after the row\n rules on purpose: the parity test finds each base rule by its first\n occurrence, and these selectors contain the base selectors. */\n.aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-row-WDVBX {\n flex-direction: column;\n gap: var(--aia-product-list-gap, 2px);\n max-height: var(--aia-product-list-max-height, 320px);\n overflow-x: hidden;\n overflow-y: auto;\n overscroll-behavior-y: contain;\n}\n\n.aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-card-JBGYT {\n flex-direction: row;\n align-items: center;\n gap: 10px;\n width: auto;\n padding: 6px 8px;\n}\n\n/* A fixed square thumbnail: width and height together, so the row's height\n is the tile's, not the card width's. */\n.aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-media-RrbGe {\n flex: 0 0 auto;\n width: var(--aia-product-list-media-size, 44px);\n height: var(--aia-product-list-media-size, 44px);\n}\n\n.aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-body-ly032 {\n flex: 1 1 auto;\n}\n\n/* In a list the badge is a banner across the bottom of the thumbnail. The\n thumbnail is centred in the card and the card's top and bottom padding\n match, so its bottom edge is half a thumbnail below the card's centre; its\n left edge is the card's 8px inline padding. */\n.aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-badge-j9Hcd {\n top: calc(50% + var(--aia-product-list-media-size, 44px) / 2);\n left: 8px;\n width: var(--aia-product-list-media-size, 44px);\n transform: translateY(-100%);\n padding: 2px 0;\n border-radius: 0 0 8px 8px;\n /* A dark scrim rather than the light chip: a light banner at a tile's edge\n merges with a light panel and reads as a cropped photo. */\n background: var(--aia-product-badge-list-bg, rgba(17, 17, 17, 0.72));\n color: var(--aia-product-badge-list-color, #fff);\n box-shadow: none;\n font-size: var(--aia-product-badge-list-font-size, 7px);\n letter-spacing: 0.02em;\n text-align: center;\n}\n\n/* In a list the button rides the row's right end, centred, and the text\n column stops short of it. */\n.aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-cart-kSlqU {\n top: 50%;\n right: 8px;\n transform: translateY(-50%);\n}\n\n.aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-cart-kSlqU:hover {\n transform: translateY(-50%) scale(1.08);\n}\n\n.aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-card-JBGYT[data-aia-product-has-cart] {\n padding-right: calc(var(--aia-product-cart-size, 28px) + 16px);\n}\n\n/* Classic options box (optionsStyle: \"classic\"): the panel as it was\n before the floating box: it unfolds out of the input with a stroke, at\n full size. Generated from the values the floating-box changes replaced;\n keep in step across the vanilla, React and Angular copies. */\n:where([data-aia-options-style=\"classic\"]) .aia-section-Hugfg {\n gap: 6px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-label-nuc93 {\n font-size: var(--aia-products-label-font-size, 11px);\n line-height: 18px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-row-WDVBX {\n gap: var(--aia-product-gap, 8px);\n padding-bottom: 2px;\n margin-inline: -6px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-card-JBGYT {\n gap: 6px;\n width: var(--aia-product-card-width, 116px);\n padding: 6px;\n border-radius: 10px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-media-RrbGe {\n border-radius: 8px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-image-5pNL7 {\n border-radius: var(--aia-product-image-radius, 8px);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-media-RrbGe:where([data-aia-product-initial]) {\n font-size: 24px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-body-ly032 {\n gap: 2px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-vendor-Gvu7G {\n font-size: var(--aia-product-vendor-font-size, 10px);\n line-height: 14px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-title-gCNmq {\n font-size: var(--aia-product-title-font-size, 12px);\n line-height: 16px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-price-gULcE {\n font-size: var(--aia-product-price-font-size, 11px);\n line-height: 15px;\n column-gap: 4px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-badge-j9Hcd {\n top: var(--aia-product-badge-inset, 12px);\n left: var(--aia-product-badge-inset, 12px);\n padding: 3px 6px;\n border-radius: 4px;\n font-size: var(--aia-product-badge-font-size, 9px);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-cart-kSlqU {\n top: calc(\n var(--aia-product-card-width, 116px) -\n 12px -\n var(--aia-product-cart-size, 28px) -\n (var(--aia-product-card-width, 116px) - 12px) *\n (1 - var(--aia-product-photo-fill-y, 1)) /\n 2\n );\n right: calc(\n 12px +\n (var(--aia-product-card-width, 116px) - 12px) *\n (1 - var(--aia-product-photo-fill-x, 1)) /\n 2\n );\n width: var(--aia-product-cart-size, 28px);\n height: var(--aia-product-cart-size, 28px);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-cart-kSlqU svg {\n width: 16px;\n height: 16px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-row-WDVBX {\n gap: var(--aia-product-list-gap, 2px);\n max-height: var(--aia-product-list-max-height, 320px);\n}\n:where([data-aia-options-style=\"classic\"])\n .aia-section-Hugfg[data-aia-products-layout=\"list\"]\n .aia-card-JBGYT {\n gap: 10px;\n padding: 6px 8px;\n}\n:where([data-aia-options-style=\"classic\"])\n .aia-section-Hugfg[data-aia-products-layout=\"list\"]\n .aia-media-RrbGe {\n width: var(--aia-product-list-media-size, 44px);\n height: var(--aia-product-list-media-size, 44px);\n}\n:where([data-aia-options-style=\"classic\"])\n .aia-section-Hugfg[data-aia-products-layout=\"list\"]\n .aia-badge-j9Hcd {\n top: calc(50% + var(--aia-product-list-media-size, 44px) / 2);\n left: 8px;\n width: var(--aia-product-list-media-size, 44px);\n padding: 2px 0;\n border-radius: 0 0 8px 8px;\n font-size: var(--aia-product-badge-list-font-size, 7px);\n}\n:where([data-aia-options-style=\"classic\"])\n .aia-section-Hugfg[data-aia-products-layout=\"list\"]\n .aia-cart-kSlqU {\n right: 8px;\n}\n:where([data-aia-options-style=\"classic\"])\n .aia-section-Hugfg[data-aia-products-layout=\"list\"]\n .aia-card-JBGYT[data-aia-product-has-cart] {\n padding-right: calc(var(--aia-product-cart-size, 28px) + 16px);\n}\n\n/* The strip leaves and returns with the options: it fades out on the same\n 160ms while a request loads and fades back when the response lands, so a\n step change never leaves it at full strength over rows that are gone. */\n.aia-section-Hugfg[data-aia-loading] {\n pointer-events: none;\n animation: aia-stripLoadingOut-0jOOQ 160ms ease-in forwards;\n}\n\n.aia-section-Hugfg:not([data-aia-loading]) {\n animation: aia-stripFadeIn-0p9qx 160ms ease-out;\n}\n\n@keyframes aia-stripLoadingOut-0jOOQ {\n to {\n opacity: 0.01;\n }\n}\n\n@keyframes aia-stripFadeIn-0p9qx {\n from {\n opacity: 0.01;\n }\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"section\":\"aia-section-Hugfg\",\"label\":\"aia-label-nuc93\",\"row\":\"aia-row-WDVBX\",\"card\":\"aia-card-JBGYT\",\"media\":\"aia-media-RrbGe\",\"image\":\"aia-image-5pNL7\",\"body\":\"aia-body-ly032\",\"vendor\":\"aia-vendor-Gvu7G\",\"title\":\"aia-title-gCNmq\",\"price\":\"aia-price-gULcE\",\"compareAt\":\"aia-compareAt-ewE54\",\"badge\":\"aia-badge-j9Hcd\",\"cart\":\"aia-cart-kSlqU\",\"cartCheck\":\"aia-cartCheck-YTTQ6\",\"cartGlyph\":\"aia-cartGlyph-cmqAk\",\"cartSpinner\":\"aia-cartSpinner-442rc\",\"magicx-aia-product-cart-spin\":\"aia-magicx-aia-product-cart-spin-x8mgr\",\"stripLoadingOut\":\"aia-stripLoadingOut-0jOOQ\",\"stripFadeIn\":\"aia-stripFadeIn-0p9qx\"};","import {\n isOptionsGridMobileViewport,\n measureOptionsGrid,\n needsOptionsGridMeasurement,\n OPTIONS_GRID_MOBILE_QUERY,\n type OptionsGridPlan,\n optionEnterDelayMs,\n optionsShowLeadingVisuals,\n planOptionsGrid,\n pointerMayHighlight,\n releasePanelHug,\n type SelectOptionOptions,\n sameOptionRows,\n syncHighlightScroll,\n syncPanelHug,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport { Grid } from \"../layout/Grid\";\nimport type { SuggestionOption } from \"../types\";\nimport { SuggestionItem } from \"./SuggestionItem\";\n\n/**\n * Tracks the phone-width breakpoint the options grid switches on. The core\n * owns the query itself (and the vanilla/Angular grids watch the same one) so\n * the three packages can't drift onto different breakpoints.\n */\nfunction useIsMobile(): boolean {\n const [isMobile, setIsMobile] = useState(isOptionsGridMobileViewport);\n useEffect(() => {\n if (typeof window === \"undefined\" || !window.matchMedia) return;\n const mq = window.matchMedia(OPTIONS_GRID_MOBILE_QUERY);\n const onChange = () => setIsMobile(mq.matches);\n onChange();\n mq.addEventListener(\"change\", onChange);\n return () => mq.removeEventListener(\"change\", onChange);\n }, []);\n return isMobile;\n}\n\ninterface SuggestionGridProps {\n options: SuggestionOption[];\n picked?: string[];\n activeIndex: number;\n onSelect: (option: SuggestionOption, how?: SelectOptionOptions) => void;\n onHighlight: (index: number) => void;\n /** The pointer left option `index` — see AIAutocompleteDropdownProps.onUnhighlight. */\n onUnhighlight?: (index: number) => void;\n listboxId: string;\n loading?: boolean;\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 groupKey?: string;\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 optionsPosition?: \"above\" | \"below\";\n /** Whether rows draw their `icon_svg` before the text. Default: true. */\n showIcons?: boolean;\n /** Whether rows draw their `image_url` as a thumbnail before the text. Default: true. */\n showImages?: boolean;\n /** Whether rows show their `item_count` at the trailing edge. Default: true. */\n showCounts?: boolean;\n}\n\n/**\n * The dropdown's option grid: a thin wrapper that lays `SuggestionItem`s out\n * with the `Grid` layout primitive. `Grid` owns the auto-fit columns and the\n * capped-height scroll, so this component only wires each option to its\n * highlight/select handlers and listbox-scoped id.\n */\nexport function SuggestionGrid({\n options,\n activeIndex,\n picked,\n onSelect,\n onHighlight,\n onUnhighlight,\n listboxId,\n loading,\n groupKey = \"\",\n optionsPosition = \"below\",\n showIcons = true,\n showImages = true,\n showCounts = true,\n}: SuggestionGridProps) {\n const isMobile = useIsMobile();\n const gridEl = useRef<HTMLDivElement | null>(null);\n // Two-pass: the first render lays out the measurement-free baseline (one\n // column), then the layout effect measures the rendered rows and upgrades to\n // the two-column plan when they provably fit — same policy as the vanilla\n // and Angular grids, all through `planOptionsGrid`. activeIndex is\n // deliberately not a dependency: highlighting can't change the plan, and\n // measuring clones every row and forces a layout. The needs-measurement gate\n // skips that cost entirely whenever the plan would ignore the result\n // (mobile, fewer than five options). jsdom measures every row at 0, so the\n // upgrade never fires in tests — the fit decision is asserted in the core's\n // own suite.\n const [measuredPlan, setMeasuredPlan] = useState<OptionsGridPlan | null>(null);\n // The rows the current plan was measured from. A skeleton mirroring them\n // keeps that plan — see `sameOptionRows`.\n const measuredRows = useRef<SuggestionOption[] | null>(null);\n useLayoutEffect(() => {\n if (loading && sameOptionRows(measuredRows.current, options)) return;\n measuredRows.current = loading ? null : options;\n const el = gridEl.current;\n const shouldMeasure = el && !loading && needsOptionsGridMeasurement(options.length, isMobile);\n // Measure at the panel's full width; the dropdown hugs it again after.\n const panel = el?.closest<HTMLElement>(\"[data-aia-dropdown]\");\n if (shouldMeasure && panel) releasePanelHug(panel);\n const measured = shouldMeasure ? measureOptionsGrid(el) : null;\n setMeasuredPlan(\n measured\n ? planOptionsGrid(options.length, isMobile, measured.rowWidths, measured.gridWidth)\n : null,\n );\n }, [options, isMobile, loading]);\n const plan = measuredPlan ?? planOptionsGrid(options.length, isMobile, null, null);\n // A new column plan or a mobile flip renders only here (the dropdown does not\n // re-render with it), so the hug is fitted again once the grid carries the plan's columns.\n // biome-ignore lint/correctness/useExhaustiveDependencies: plan.template and isMobile are the re-fit triggers, not reads\n useLayoutEffect(() => {\n const panel = gridEl.current?.closest<HTMLElement>(\"[data-aia-dropdown]\");\n if (panel) syncPanelHug(panel);\n }, [plan.template, isMobile]);\n // A highlight the keyboard moved brings its row into view; one the pointer\n // set does not (the hover handlers below say which, through\n // `pointerMayHighlight`). Declared after the Grid child, whose own layout\n // effect resets the scroll for a new group first. Skeleton rows show none.\n const shownIndex = loading ? -1 : activeIndex;\n useLayoutEffect(() => {\n if (gridEl.current) syncHighlightScroll(gridEl.current, shownIndex);\n }, [shownIndex]);\n // Icons and pictures are all-or-nothing across the list — no single row can\n // decide its own (see `optionsShowLeadingVisuals`).\n const leadingVisuals = optionsShowLeadingVisuals(options, showIcons, showImages);\n return (\n <Grid\n min=\"250px\"\n max=\"1fr\"\n gap=\"0\"\n scroll\n scrollResetKey={groupKey}\n template={plan.template}\n maxHeight={plan.maxHeight}\n innerRef={(el) => {\n gridEl.current = el;\n }}\n // Read by the scroll arrow to tell a new set of options (rising in)\n // from the same set re-rendered.\n data-aia-group={groupKey}\n >\n {options.map((option, i) => (\n <SuggestionItem\n // The group is part of the key: a new suggestion's options are new\n // rows and get the entrance animation even when one spells the same\n // as a row already on screen. The parameter is part of it too: a\n // smart suggestion offers one text under several parameters\n // (\"Shoes\" under Women type and Men type), each a row of its own.\n key={`${groupKey}\\0${option.parameter ?? \"\"}\\0${option.text}`}\n option={option}\n isHighlighted={i === activeIndex}\n checked={picked ? picked.includes(option.text) : undefined}\n onSelect={onSelect}\n onHighlight={(event) => {\n if (pointerMayHighlight(gridEl.current, i, event)) onHighlight(i);\n }}\n onUnhighlight={\n onUnhighlight\n ? (event) => {\n if (pointerMayHighlight(gridEl.current, -1, event)) onUnhighlight(i);\n }\n : undefined\n }\n id={`${listboxId}-option-${i}`}\n loading={loading}\n showIcon={showIcons && leadingVisuals}\n showImage={showImages && leadingVisuals}\n showCount={showCounts}\n scrollHint={!loading && plan.scrollHintIndices.includes(i)}\n // Skeleton rows fade in together — they're placeholders, not content.\n enterDelayMs={\n loading ? 0 : optionEnterDelayMs(i, plan.cols, options.length, optionsPosition)\n }\n />\n ))}\n </Grid>\n );\n}\n","import { optionsGridTemplateColumns } from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport {\n type ComponentPropsWithoutRef,\n type CSSProperties,\n type ReactNode,\n useLayoutEffect,\n useRef,\n} from \"react\";\nimport \"./Grid.css\";\n\ninterface GridProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"className\"> {\n /** Minimum cell width. CSS length, e.g. \"16rem\". Columns auto-fit at runtime. */\n min?: string;\n /** Maximum cell width. CSS length. Defaults to `1fr` (stretch to fill). */\n max?: string;\n /** Gap between cells. Defaults to `0`. */\n gap?: string;\n /** Cap the height and scroll vertically when content overflows. */\n scroll?: boolean;\n /** Max height when `scroll`. CSS length. Defaults to `120px`. */\n maxHeight?: string;\n /** Scroll back to the top whenever this key changes (`scroll` only). */\n scrollResetKey?: string;\n /** Fixed column count. Overrides the intrinsic auto-fit when set; rows fill left-to-right. */\n cols?: number;\n /** Explicit `grid-template-columns` value. Overrides `cols` when set. */\n template?: string;\n /** Also receives the grid element (for callers that measure it). */\n innerRef?: (el: HTMLDivElement | null) => void;\n className?: string;\n children: ReactNode;\n}\n\n// Intrinsic grid — auto-fits as many columns as fit between `min` and `max`\n// wide, wrapping to new rows when there's no more horizontal room. Optionally\n// scrolls (capped height). Internal.\nexport function Grid({\n min = \"16rem\",\n max,\n gap,\n scroll = false,\n maxHeight,\n scrollResetKey,\n cols,\n template,\n innerRef,\n className,\n children,\n ...rest\n}: GridProps) {\n const gridRef = useRef<HTMLDivElement | null>(null);\n\n // A new key means a different content group is being shown (e.g. the next\n // suggestion's options after a selection) — start it from the top instead of\n // inheriting the previous group's scroll offset. Layout effect so the reset\n // lands in the same frame the new content paints.\n useLayoutEffect(() => {\n if (scrollResetKey === undefined) return;\n const el = gridRef.current;\n if (el) el.scrollTop = 0;\n }, [scrollResetKey]);\n\n const style: CSSProperties = { \"--aia-grid-min\": min } as CSSProperties;\n if (max) (style as Record<string, string>)[\"--aia-grid-max\"] = max;\n if (gap) (style as Record<string, string>)[\"--aia-grid-gap\"] = gap;\n if (maxHeight) (style as Record<string, string>)[\"--aia-grid-max-height\"] = maxHeight;\n // Explicit column count overrides the intrinsic auto-fit (inline wins). The\n // track string is built by the core so all three packages emit the same one.\n // An explicit template (the measured two-column split) wins over both.\n if (cols) style.gridTemplateColumns = optionsGridTemplateColumns(cols);\n if (template) style.gridTemplateColumns = template;\n\n return (\n <div\n ref={(el) => {\n gridRef.current = el;\n innerRef?.(el);\n }}\n className={className ? `aia-grid ${className}` : \"aia-grid\"}\n data-scroll={scroll || undefined}\n style={style}\n {...rest}\n >\n {children}\n </div>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-948e58da\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-948e58da\";\n s.textContent = `.aia-grid {\n display: grid;\n grid-template-columns: repeat(\n auto-fit,\n minmax(min(var(--aia-grid-min), 100%), var(--aia-grid-max, 1fr))\n );\n gap: var(--aia-grid-gap, 0);\n}\n\n/* Scrollable variant — capped height, rows packed from the top instead of\n stretching to fill the container.\n\n The scrollbar is hidden in every engine, as the product strip's and the\n input's already are: the list stays scrollable by wheel, trackpad, touch\n and keyboard, and the dropdown's \"more below\" arrow says there is more.\n Styling it instead (a thin, tinted bar) looked right only in Chrome, whose\n macOS overlay scrollbar ignores the ::-webkit-scrollbar rules — Safari drew\n a permanent bar over the list.\n\n overscroll-behavior: contain keeps a wheel or trackpad fling that runs past\n either end of the list from scrolling the page behind the dropdown. */\n.aia-grid[data-scroll] {\n grid-auto-rows: min-content;\n align-content: start;\n justify-content: start;\n /* The scroll box's reserved band (--aia-grid-scroll-* / --aia-grid-overlap-*)\n is deliberately NOT declared here — see the rule in\n appearance.css for why. */\n max-height: var(--aia-grid-max-height, 120px);\n overflow-y: auto;\n overscroll-behavior: contain;\n scrollbar-width: none;\n}\n.aia-grid[data-scroll]::-webkit-scrollbar {\n display: none;\n}\n\n/* Classic options box (optionsStyle: \"classic\"): the panel as it was\n before the floating box: it unfolds out of the input with a stroke, at\n full size. Generated from the values the floating-box changes replaced;\n keep in step across the vanilla, React and Angular copies. */\n:where([data-aia-options-style=\"classic\"]) .aia-grid[data-scroll] {\n max-height: var(--aia-grid-max-height, 120px);\n}\n`;\n document.head.appendChild(s);\n}\nexport {};","import {\n clearPanelMorphPressLook,\n formatOptionCount,\n highlightParts,\n isMultiSelectToggleTap,\n OPTION_ENTER_DELAY_VAR,\n optionImageSources,\n optionLabel,\n type SelectOptionOptions,\n sanitizeOptionIconSvg,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { type CSSProperties, type MouseEvent, useEffect, useMemo, useRef, useState } from \"react\";\nimport type { SuggestionOption } from \"../types\";\nimport styles from \"./SuggestionItem.module.css\";\n\ninterface SuggestionItemProps {\n option: SuggestionOption;\n isHighlighted: boolean;\n checked?: boolean;\n onSelect: (option: SuggestionOption, how?: SelectOptionOptions) => void;\n /** The pointer entered this row (only called for a row that can be picked). */\n onHighlight: (event: MouseEvent) => void;\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 onUnhighlight?: (event: MouseEvent) => void;\n id: string;\n loading?: boolean;\n /** Whether to draw the option's `icon_svg` before its text. Default: true. */\n showIcon?: boolean;\n /** Whether to draw the option's `image_url` as a thumbnail before its text, in place of the icon. Default: true. */\n showImage?: boolean;\n /** Whether to show the option's `item_count` at the row's trailing edge. Default: true. */\n showCount?: boolean;\n /** Fade this option's text toward its bottom edge (last visible row of a scrollable grid). */\n scrollHint?: boolean;\n /**\n * Start delay of this row's entrance animation (ms) — each row rises in a\n * beat after the one nearer the input. Fixed for the row's lifetime: it's\n * read once on mount, so a re-render can't restart a row mid-rise.\n */\n enterDelayMs?: number;\n}\n\n/** Longest a pick keeps its press look when no new question replaces it. */\nconst PRESS_HOLD_MS = 2000;\n\n/**\n * A second pick of the same row this soon is the same tap landing twice\n * (a fast double click): ignored, so it can't answer the next question with\n * this row's option. Matches the core's selection animation window, which\n * vanilla's grid gates on; a later tap (say after a failed request) works.\n */\nconst REPEAT_PICK_MS = 170;\n\nexport function SuggestionItem({\n option,\n isHighlighted,\n checked,\n onSelect,\n onHighlight,\n onUnhighlight,\n id,\n loading,\n showIcon = true,\n showImage = true,\n showCount = true,\n scrollHint,\n enterDelayMs = 0,\n}: SuggestionItemProps) {\n const [enterDelay] = useState(enterDelayMs);\n const [pressed, setPressed] = useState(false);\n // Server-provided picture, drawn as a square thumbnail before the text. It\n // stands in for the icon: a row never leads with two visuals.\n const imageSources = showImage ? optionImageSources(option.image_url) : [];\n const imageSrc = imageSources[0] ?? null;\n // A thumbnail that fails to load falls back to the original; when every\n // source has failed the picture hides itself and the tile's placeholder\n // fill stays, so the rows keep their alignment. Keyed on the srcs, so a row\n // reused for a different picture tries again.\n const [failedSrcs, setFailedSrcs] = useState<readonly string[]>([]);\n const shownSrc = imageSources.find((src) => !failedSrcs.includes(src)) ?? null;\n // The All row's tile shows the first options' pictures together\n // (appearance.css lays out `data-aia-collage`); any other row shows one.\n const collage = showImage\n ? (option.imageCollage ?? [])\n .map((url) => optionImageSources(url)[0])\n .filter((src): src is string => src !== undefined)\n : [];\n const [collageLoaded, setCollageLoaded] = useState(false);\n // The src that last finished loading: once it is the one shown, the tile's\n // placeholder fill steps aside.\n const [loadedSrc, setLoadedSrc] = useState<string | null>(null);\n // Server-provided icon, allowlisted before it touches the DOM. Memoised on\n // the markup: the same row re-renders on every highlight change.\n const iconHtml = useMemo(\n () =>\n !imageSrc && showIcon && option.icon_svg ? sanitizeOptionIconSvg(option.icon_svg) : null,\n [imageSrc, showIcon, option.icon_svg],\n );\n // The number alone; the unit word after it is the stylesheet's\n // (`--aia-option-count-unit`), appended by the count's ::after.\n const countLabel = showCount ? formatOptionCount(option.item_count) : null;\n const timerRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const rowRef = useRef<HTMLDivElement>(null);\n const lastPickRef = useRef(Number.NEGATIVE_INFINITY);\n\n useEffect(() => {\n return () => clearTimeout(timerRef.current);\n }, []);\n\n // `event` is the click that picked the row; a key press passes none. In a\n // multi_select question a click on the checkbox ticks it and waits for\n // Done, while a click on the rest of the row answers with it right away.\n const handleSelect = (event?: MouseEvent<HTMLElement>) => {\n if (loading || !option.is_tappable) return;\n const row = event?.currentTarget;\n const commit =\n checked !== undefined &&\n row !== undefined &&\n event !== undefined &&\n !isMultiSelectToggleTap(row, row.querySelector(\"[data-aia-checkbox]\"), event);\n const tick = checked !== undefined && !commit;\n if (!tick) {\n const now = performance.now();\n if (now - lastPickRef.current < REPEAT_PICK_MS) return;\n lastPickRef.current = now;\n }\n if (commit) onSelect(option, { commit: true });\n else onSelect(option);\n // A tick that waits for Done changes only the checkbox. A pick holds the\n // press look until the next question replaces this row (its key carries\n // the question), so the other rows stay dim while the answer loads; the\n // timer only releases a press nothing replaces.\n if (tick) return;\n setPressed(true);\n clearTimeout(timerRef.current);\n timerRef.current = setTimeout(() => {\n setPressed(false);\n clearPanelMorphPressLook(rowRef.current?.closest<HTMLElement>(\"[data-aia-dropdown]\"));\n }, PRESS_HOLD_MS);\n };\n\n const className = [\n styles.item,\n isHighlighted && !loading ? styles.highlighted : \"\",\n option.liveMatch && !loading ? styles.liveMatch : \"\",\n option.is_tappable ? styles.tappable : styles.nonTappable,\n pressed ? styles.pressed : \"\",\n scrollHint ? styles.scrollHint : \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div\n ref={rowRef}\n id={id}\n role=\"option\"\n data-aia-option=\"\"\n data-aia-loading={loading ? \"\" : undefined}\n data-aia-icon={iconHtml && option.icon ? option.icon : undefined}\n data-aia-image={imageSrc ? \"\" : undefined}\n data-aia-item-count={countLabel !== null ? option.item_count : undefined}\n aria-selected={checked ?? isHighlighted}\n className={className}\n style={{ [OPTION_ENTER_DELAY_VAR]: `${enterDelay}ms` } as CSSProperties}\n tabIndex={loading || !option.is_tappable ? -1 : 0}\n onClick={handleSelect}\n onKeyDown={(e) => {\n if (!loading && option.is_tappable && (e.key === \"Enter\" || e.key === \" \")) {\n e.preventDefault();\n handleSelect();\n }\n }}\n onMouseEnter={!loading && option.is_tappable ? onHighlight : undefined}\n onMouseLeave={onUnhighlight}\n >\n <span className={styles.content}>\n {/* Only a row that can be picked gets a box: a hint row (\"or type\n something else…\") is not an answer to tick. It still reports\n aria-selected=\"false\" like every unpicked row. */}\n {checked !== undefined && option.is_tappable && (\n <span\n className={styles.checkbox}\n aria-hidden=\"true\"\n data-aia-checkbox=\"\"\n data-checked={checked}\n />\n )}\n {imageSrc && collage.length > 1 && (\n <span\n className={`${styles.image} magicx-aia-option-image`}\n aria-hidden=\"true\"\n data-aia-collage={collage.length}\n data-aia-image-loaded={collageLoaded ? \"\" : undefined}\n >\n {collage.map((src) => (\n <img\n // The core drops repeated pictures, so each source is unique.\n key={src}\n src={src}\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n referrerPolicy=\"no-referrer\"\n draggable={false}\n onLoad={() => setCollageLoaded(true)}\n onError={(event) => {\n event.currentTarget.hidden = true;\n }}\n />\n ))}\n </span>\n )}\n {imageSrc && collage.length <= 1 && (\n // The tile keeps a placeholder fill until the picture loads, so a\n // slow or failed load leaves a neutral square rather than a gap. The\n // picture is decorative — the text is the option's accessible name.\n <span\n className={`${styles.image} magicx-aia-option-image`}\n aria-hidden=\"true\"\n data-aia-image-loaded={shownSrc !== null && loadedSrc === shownSrc ? \"\" : undefined}\n >\n <img\n src={shownSrc ?? imageSrc}\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n referrerPolicy=\"no-referrer\"\n draggable={false}\n hidden={shownSrc === null}\n onLoad={() => setLoadedSrc(shownSrc)}\n onError={() => {\n if (shownSrc !== null) setFailedSrcs((failed) => [...failed, shownSrc]);\n }}\n />\n </span>\n )}\n {iconHtml && (\n // The glyph is decorative — the text is the option's accessible\n // name — and the markup is the sanitizer's allowlisted output, never\n // the server's raw string.\n <span\n // The global class is the stable hook for consumer CSS across all\n // three packages; the module class carries this package's styles.\n className={`${styles.icon} magicx-aia-option-icon`}\n aria-hidden=\"true\"\n // biome-ignore lint/security/noDangerouslySetInnerHtml: sanitizeOptionIconSvg output only\n dangerouslySetInnerHTML={{ __html: iconHtml }}\n />\n )}\n <span className={styles.text}>\n {option.matchedText\n ? highlightParts(optionLabel(option), option.matchedText).map((part, index) =>\n part.bold ? (\n <strong\n // biome-ignore lint/suspicious/noArrayIndexKey: parts are positional and never reorder\n key={index}\n className={`${styles.match} magicx-aia-option-match`}\n data-aia-match-partial={part.partial ? \"\" : undefined}\n >\n {part.text}\n </strong>\n ) : (\n part.text\n ),\n )\n : optionLabel(option)}\n {option.parameterLabel && (\n // The space keeps the accessible name \"Pizza Flavor\" whatever the line's display is.\n <>\n {\" \"}\n <span className={`${styles.parameter} magicx-aia-option-parameter`}>\n {option.parameterLabel}\n </span>\n </>\n )}\n </span>\n {option.tag && <span className={styles.tag}>{option.tag}</span>}\n {countLabel !== null && (\n // Part of the row's accessible name, read after the option's text.\n <span className={`${styles.count} magicx-aia-option-count`}>{countLabel}</span>\n )}\n </span>\n </div>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-82820da7\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-82820da7\";\n s.textContent = `.aia-item-d4vpD {\n position: relative;\n /* Clip, not visible: the entrance rise below runs on the inner content,\n and a transformed box extends its scroll container's scrollable area.\n Unclipped, the rows rising 7px from below made the option grid overflow\n for the length of the entrance whenever nothing sat under the grid to\n absorb it (product strip, optionsPosition=\"above\"), so a scrollbar\n flashed in and out and the columns shifted sideways by its width. The\n cell's own children never paint outside it (the streak layer clips\n itself; press and highlight stay inside the box), so nothing is lost.\n \\`hidden\\` first for engines without \\`clip\\`. */\n overflow: hidden;\n overflow: clip;\n display: flex;\n /* Top-align so single-line and multi-line options in the same row share\n the same baseline at the top edge of the cell. */\n align-items: flex-start;\n font-family: inherit;\n font-size: var(--aia-option-font-size, 16px);\n font-weight: 450;\n line-height: 21px;\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n white-space: normal;\n word-break: break-word;\n /* 8px radius on the highlighted fill (--aia-option-bg), matching the Figma\n SuggestionItem selection. The 8px/10px inset is the item's own padding. */\n border-radius: 8px;\n padding: var(--aia-option-padding-block, 8px) 10px;\n /* No entrance animation on the row itself — deliberately. The row is the\n tappable element, and iOS Safari drops a tap on a scripted-clickable\n element (a div with a click handler; a native button is exempt) whose\n own opacity is mid-animation — its tap-or-hover pass counts the change\n as content moving under the finger, fires only the hover events (the\n row highlights) and never the click. Both halves of the entrance run\n on the inner content instead (next rule). */\n}\n\n@keyframes aia-fadeIn-I8u35 {\n from {\n opacity: 0;\n }\n}\n\n@keyframes aia-riseIn-etXZT {\n from {\n transform: translateY(7px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-item-d4vpD,\n .aia-content-T-Qba {\n animation-duration: 0s;\n animation-delay: 0s;\n transition-duration: 0s;\n }\n}\n\n.aia-content-T-Qba {\n position: relative;\n z-index: 2;\n /* The entrance: fade in while rising into place, each row a beat after the\n one before it (--aia-option-enter-delay is set inline per row from the\n core's optionEnterDelayMs). Both run here, on the inner content, never on\n the row: the rise because a transformed cell extends the grid's\n scrollable area (see the overflow note on the row), the fade because iOS\n Safari drops a tap on a tappable element whose own opacity is animating\n (see the row's own comment). The durations and distance mirror\n OPTION_ENTER_* in the core's derive/optionsEntrance.ts — change both together. */\n animation:\n aia-riseIn-etXZT 340ms cubic-bezier(0.2, 0.8, 0.2, 1) both,\n aia-fadeIn-I8u35 340ms cubic-bezier(0.2, 0.8, 0.2, 1) both;\n animation-delay: var(--aia-option-enter-delay, 0ms);\n}\n\n.aia-tappable-70KcX {\n cursor: pointer;\n}\n\n.aia-tappable-70KcX:hover {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n}\n\n.aia-nonTappable-xSZM- {\n cursor: default;\n}\n\n.aia-highlighted-Hb0SU,\n.aia-liveMatch--eYfs {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n background: var(--aia-option-bg, transparent);\n font-weight: 500;\n}\n\n/* Live match: while a word is typed, the row it is spelling out lights up\n (the rule above) and every other row steps back, so the choice reads as\n locked in before the word is finished. The core marks the row\n (\\`liveMatch\\`). The step back is a filter on the inner content: on iOS a tap\n on a row whose own opacity is changing is dropped (lessons.md), and the\n content's entrance already owns its opacity. */\n.aia-item-d4vpD {\n transition: background-color 180ms ease;\n}\n\n.aia-content-T-Qba {\n transition: filter 180ms ease;\n}\n\n[role=\"listbox\"]:has(.aia-liveMatch--eYfs) .aia-item-d4vpD:not(.aia-liveMatch--eYfs):not(.aia-highlighted-Hb0SU) .aia-content-T-Qba {\n filter: opacity(0.42);\n}\n\n.aia-tag-e3Fwe {\n font-size: 11px;\n margin-left: 6px;\n opacity: 0.5;\n}\n\n/* Press feedback: the picked option fills with the option background (the\n row's own background transition) while every other option steps back in\n opacity. No scale: a row that shrinks and springs back reads as a jolt,\n and the next question then arrives on top of it. The press stays on until\n the options leave, so the picked row never flashes back to normal first. */\n.aia-pressed-98o-r {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n background: var(--aia-option-bg, transparent);\n font-weight: 500;\n}\n\n[role=\"listbox\"]:has(.aia-pressed-98o-r) .aia-item-d4vpD:not(.aia-pressed-98o-r) {\n opacity: 0.35;\n transition:\n background-color 180ms ease,\n opacity 120ms ease;\n}\n\n/* Scroll hint — the last visible row of a scrollable web grid fades toward its\n bottom edge, signalling more options below (the desktop footer is opaque, so\n rows no longer dissolve through it). A mask instead of a color so any themed\n option color fades the same way. */\n.aia-scrollHint-xKXPt .aia-content-T-Qba {\n -webkit-mask-image: linear-gradient(to bottom, rgb(0 0 0), rgb(0 0 0 / 0.6));\n mask-image: linear-gradient(to bottom, rgb(0 0 0), rgb(0 0 0 / 0.6));\n}\n\n/* A panel fitted to the viewport (data-aia-fit, see appearance.css) shows\n every row, so the row the hint picked is not the last one on screen. */\n[data-aia-fit] .aia-scrollHint-xKXPt .aia-content-T-Qba {\n -webkit-mask-image: none;\n mask-image: none;\n}\n\n/* Loading — a row kept from the last response fades out while the next one\n is fetched, text and all; nothing else changes, so the box does not move. */\n.aia-item-d4vpD[data-aia-loading] {\n cursor: default;\n pointer-events: none;\n animation: aia-loadingOut-hI-qI 160ms ease-in forwards;\n}\n\n.aia-item-d4vpD[data-aia-loading] .aia-content-T-Qba {\n animation: none;\n}\n\n/* Ends a hair above zero, like magicx-aia-fadeIn starts: a pill kept by key\n is re-enabled in place, and iOS cancels a tap on an element leaving 0. */\n@keyframes aia-loadingOut-hI-qI {\n to {\n opacity: 0.01;\n }\n}\n\n/* The parameter an option is a value of, under its text (\"Flavor\", \"Subcategory\"):\n muted and smaller, so options that read alike are told apart. Block inside the\n text box, so a hanging indent never moves it. */\n.aia-parameter-Dt2zF {\n display: block;\n font-size: var(--aia-option-parameter-font-size, 12px);\n font-weight: 400;\n line-height: 16px;\n text-indent: 0;\n color: var(--aia-option-parameter-color, inherit);\n opacity: var(--aia-option-parameter-opacity, 0.6);\n}\n\n/* The part of a completion the typed text matches, in the Smart Suggestion accent. */\n.aia-match-pp-9v {\n color: var(--aia-smart-suggestion-accent, #b84549);\n font-weight: 600;\n}\n\n/* A half-built syllable at the end of the match (an IME has typed 녀 of 년):\n the same accent, drawn fainter, since part of one glyph can not be colored. */\n.aia-match-pp-9v:where([data-aia-match-partial]) {\n opacity: var(--aia-option-match-partial-opacity, 0.45);\n}\n\n/* Server-provided option icon (\\`icon_svg\\` on the option): a box exactly one\n text line tall, top-aligned, so it sits centred on the first line of a\n wrapped option and never grows the line box. The glyph draws in\n currentColor, so it follows the option's text color through hover and\n highlight, and is sized in em so --aia-option-font-size scales it. */\n.aia-icon-Qw938 {\n display: inline-flex;\n align-items: center;\n height: 21px; /* = the option's line-height */\n margin-right: 8px;\n vertical-align: top;\n /* Own compositing layer. The row (entrance) and the chip (promotion fade)\n animate on a layer WebKit drops when the animation ends; content drawn at\n a fractional x then re-rasterizes on a different sub-pixel, which crisp\n SVG strokes show as a nudge to the right. A permanent layer keeps the\n glyph's rasterization stable across that hand-off. */\n will-change: transform;\n}\n\n.aia-icon-Qw938 svg {\n display: block;\n width: 1em;\n height: 1em;\n}\n\n/* With an icon, the content box hangs its continuation lines: a left pad the\n width of the icon plus its gap, and a matching negative first-line indent\n that pulls the icon back into that pad. Wrapped lines then start under the\n first line's text rather than under the icon. \\`.content\\` is a flex item\n (blockified), so text-indent applies to it directly. Skeleton rows keep\n it too: their icon is hidden but still occupies its column. */\n.aia-content-T-Qba:not(:has(.aia-count-IpYbQ)):has(.aia-icon-Qw938) {\n padding-left: calc(1em + 8px);\n text-indent: calc(-1em - 8px);\n}\n\n/* --- Option pictures and counts ---\n A row that carries a thumbnail (\\`image_url\\`) or a count (\\`item_count\\`) lays\n its content out as a flex row instead of inline flow: the text becomes its\n own box, so wrapped lines start under the first line without the hanging\n indent, and the count can sit at the trailing edge. It also fills the row —\n the content is a flex item of the row that would otherwise shrink to its\n text, leaving the count's auto margin nothing to push against. The inline\n flow is kept for every other row, so nothing existing moves. */\n.aia-content-T-Qba:has(.aia-image-YZAbO),\n.aia-content-T-Qba:has(.aia-count-IpYbQ) {\n display: flex;\n flex: 1 1 auto;\n align-items: flex-start;\n min-width: 0;\n}\n\n.aia-content-T-Qba:has(.aia-image-YZAbO) .aia-text-yqoh9,\n.aia-content-T-Qba:has(.aia-count-IpYbQ) .aia-text-yqoh9 {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n/* The picture: a square tile, centred on the text beside it (a one-line\n option reads as the reference row; a wrapped one keeps the tile on its\n vertical middle). Sized and rounded by token so a consumer can shrink it\n or square it off. The fill is the placeholder: it shows across the whole\n tile until the picture paints (a picture's size isn't known before it\n loads) and stays if it never does. */\n.aia-content-T-Qba:has(.aia-image-YZAbO) {\n align-items: center;\n gap: var(--aia-option-image-gap, 12px);\n}\n\n.aia-image-YZAbO {\n flex: 0 0 auto;\n display: block;\n width: var(--aia-option-image-size, 40px);\n height: var(--aia-option-image-size, 40px);\n border-radius: var(--aia-option-image-radius, 12px);\n overflow: hidden;\n background: var(--aia-option-image-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.083)));\n}\n\n/* Once the picture has loaded the placeholder steps aside: a contained\n picture that doesn't fill the tile sits on the dropdown's own background\n rather than on a grey box. The renderer sets the attribute from the\n picture's \\`load\\` event. */\n.aia-image-YZAbO[data-aia-image-loaded] {\n background: transparent;\n}\n\n/* \\`contain\\`, not \\`cover\\`: option pictures come in any aspect ratio, and a\n square crop cuts the top and bottom off a tall one (a pint bottle). The\n picture fills the tile's height and takes only the width its ratio needs,\n centred, so a tall picture's box is the picture itself and its own corner\n radius rounds it. A wide one is clamped to the tile's width and contained\n inside it; a square one fills the tile, whose larger radius clips it. */\n.aia-image-YZAbO img {\n display: block;\n width: auto;\n max-width: 100%;\n height: 100%;\n margin: 0 auto;\n border-radius: var(--aia-option-picture-radius, 6px);\n object-fit: contain;\n}\n\n/* A picture that failed to load hides itself with the \\`hidden\\` attribute.\n The tile's \\`display: block\\` above would win over the browser's own\n \\`[hidden] { display: none }\\` (an author rule beats a user-agent rule at\n any specificity), so the attribute is honoured here explicitly. */\n.aia-image-YZAbO img[hidden] {\n display: none;\n}\n\n/* The count: a muted, tabular label at the trailing edge, on the first\n line's baseline. Never wraps — a long option wraps its text instead. */\n.aia-count-IpYbQ {\n flex: 0 0 auto;\n margin-left: auto;\n padding-left: 12px;\n font-size: var(--aia-option-count-font-size, 12px);\n font-weight: 400;\n line-height: 21px; /* = the option's line-height */\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n color: var(--aia-option-count-color, inherit);\n opacity: var(--aia-option-count-opacity, 0.6);\n}\n\n/* The unit word after the number is a token, so a consumer names what is\n being counted (\"sneakers\", \"towels\") or blanks it (an empty string) without\n a render option. A count of one reads the singular token, which falls back\n to the plural one, so a consumer who sets only \\`--aia-option-count-unit\\`\n gets that word for every count. Generated content joins the row's\n accessible name after the number, the way the word did as text. */\n.aia-count-IpYbQ::after {\n content: \" \" var(--aia-option-count-unit, \"items\");\n}\n\n.aia-item-d4vpD[data-aia-item-count=\"1\"] .aia-count-IpYbQ::after {\n content: \" \" var(--aia-option-count-unit-one, var(--aia-option-count-unit, \"item\"));\n}\n\n/* A grid of rows with a parameter line is taller per row: the row's text\n line and padding plus the parameter line, so the visible-rows cap\n (\\`--aia-grid-max-height\\`) does not cut the last row. Before the picture rule,\n which wins when a group has both. */\n[data-aia-group]:has(.aia-parameter-Dt2zF) {\n --aia-option-row-height: calc(37px + 2 * var(--aia-option-padding-block, 8px));\n}\n\n/* A grid of picture rows is taller per row: the visible-rows cap\n (\\`--aia-grid-max-height\\`, computed from \\`--aia-option-row-height\\` by\n planOptionsGrid) follows the tile's height plus the row's padding, so the\n same number of rows shows before the list scrolls. */\n[data-aia-group]:has(.aia-image-YZAbO) {\n --aia-option-row-height: calc(\n var(--aia-option-image-size, 40px) +\n 2 *\n var(--aia-option-padding-block, 8px)\n );\n}\n\n/* A row without a picture, in a grid where other rows have one, lines up\n with them: it becomes the same centred flex row, and its icon sits centred\n in a tile-sized box, so an icon row's text starts where a picture row's\n does. A row with neither a picture nor an icon is not indented to match:\n its text sits flush left, as it would in a grid with no pictures. Grids\n with no pictures keep the inline icon and hanging indent above. The text\n is left to size itself. */\n[data-aia-group]:has(.aia-image-YZAbO) .aia-content-T-Qba:not(:has(.aia-image-YZAbO)) {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n gap: var(--aia-option-image-gap, 12px);\n min-width: 0;\n min-height: var(--aia-option-image-size, 40px);\n padding-left: 0;\n text-indent: 0;\n}\n\n[data-aia-group]:has(.aia-image-YZAbO) .aia-content-T-Qba:not(:has(.aia-image-YZAbO)) .aia-icon-Qw938 {\n flex: 0 0 auto;\n justify-content: center;\n width: var(--aia-option-image-size, 40px);\n height: var(--aia-option-image-size, 40px);\n margin-right: 0;\n}\n\n/* The glyph scales up with its box: at one text line (1em) it reads as a speck\n beside the picture tiles in the same column. 1.5em (24px at the default\n option font size) is 60% of the default tile, about where a picture's\n subject sits in its frame. Still em-based, so --aia-option-font-size scales\n it; --aia-option-tile-icon-size overrides it. */\n[data-aia-group]:has(.aia-image-YZAbO) .aia-content-T-Qba:not(:has(.aia-image-YZAbO)) .aia-icon-Qw938 svg {\n width: var(--aia-option-tile-icon-size, 1.5em);\n height: var(--aia-option-tile-icon-size, 1.5em);\n}\n\n/* --- Loading fades ---\n Nothing extra plays while the dropdown carries data-aia-skeleton-exiting:\n the loading rows have already faded out, and a second animation would\n restart the fade from full strength. */\n\n.aia-content-T-Qba:has(.aia-checkbox-KGRhg) {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n\n/* A checkbox row is a flex row, so its icon is a flex item beside the text,\n not an inline box hung in a left pad. Undo the hanging indent the icon rule\n sets: the pad would push the whole row right, and the negative indent,\n inherited by the text box, would pull the text back over the icon. The\n row's gap replaces the icon's own margin. */\n.aia-content-T-Qba:has(.aia-checkbox-KGRhg):has(.aia-icon-Qw938) {\n padding-left: 0;\n text-indent: 0;\n}\n\n.aia-content-T-Qba:has(.aia-checkbox-KGRhg) .aia-icon-Qw938 {\n margin-right: 0;\n}\n\n.aia-checkbox-KGRhg {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n /* An indent inherited from the row (an icon row hangs its text with one)\n would slide the mark out of the box. */\n text-indent: 0;\n flex: 0 0 18px;\n width: 18px;\n height: 18px;\n border: 1px solid var(--aia-border);\n border-radius: 6px;\n background: var(--aia-surface);\n color: transparent;\n line-height: 1;\n /* A tick animates the box alone: the row stays put (no press, no dimming),\n since a multi-select tap keeps the list open for the next tick. */\n transition:\n background-color 140ms ease,\n border-color 140ms ease,\n color 140ms ease;\n}\n\n/* The tick is drawn, not typed: a rounded stroke with a short left leg and a\n long right one, shaped like Apple's SF Symbols \"checkmark\". The text \"✓\"\n it replaces changes with the font and reads thin and cheap. It is painted\n in the box's text colour, so it fades in with the fill. */\n.aia-checkbox-KGRhg::after {\n content: \"\";\n width: 14px;\n height: 14px;\n background: currentColor;\n -webkit-mask:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.2 12.6l4.6 4.6 9-10.6' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\")\n center / contain no-repeat;\n mask:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.2 12.6l4.6 4.6 9-10.6' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\")\n center / contain no-repeat;\n}\n\n/* Forced colours replace backgrounds with Canvas, which would hide a tick\n painted as a background; draw it in the forced text colour instead. */\n@media (forced-colors: active) {\n .aia-checkbox-KGRhg[data-checked=\"true\"]::after {\n forced-color-adjust: none;\n background: CanvasText;\n }\n}\n\n.aia-checkbox-KGRhg[data-checked=\"true\"] {\n background: var(--aia-confirm-bg, #262626);\n border-color: var(--aia-confirm-bg, #262626);\n color: var(--aia-confirm-color, #ffffff);\n animation: aia-checkPop-CCWRW 160ms ease-out;\n}\n\n@keyframes aia-checkPop-CCWRW {\n 0% {\n transform: scale(0.82);\n }\n 100% {\n transform: scale(1);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-checkbox-KGRhg[data-checked=\"true\"] {\n animation: none;\n }\n}\n\n.aia-item-d4vpD:has(.aia-checkbox-KGRhg[data-checked=\"true\"]) {\n background: var(--aia-option-bg, transparent);\n}\n\n/* Classic options box (optionsStyle: \"classic\"): the panel as it was\n before the floating box: it unfolds out of the input with a stroke, at\n full size. Generated from the values the floating-box changes replaced;\n keep in step across the vanilla, React and Angular copies. */\n:where([data-aia-options-style=\"classic\"]) .aia-item-d4vpD {\n font-size: var(--aia-option-font-size, 16px);\n line-height: 21px;\n border-radius: 8px;\n padding: 8px 10px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-tag-e3Fwe {\n font-size: 11px;\n margin-left: 6px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-parameter-Dt2zF {\n font-size: var(--aia-option-parameter-font-size, 12px);\n line-height: 16px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-icon-Qw938 {\n height: 21px;\n margin-right: 8px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-content-T-Qba:not(:has(.aia-count-IpYbQ)):has(.aia-icon-Qw938) {\n padding-left: calc(1em + 8px);\n text-indent: calc(-1em - 8px);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-content-T-Qba:has(.aia-image-YZAbO) {\n gap: var(--aia-option-image-gap, 12px);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-image-YZAbO {\n width: var(--aia-option-image-size, 40px);\n height: var(--aia-option-image-size, 40px);\n border-radius: var(--aia-option-image-radius, 12px);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-image-YZAbO img {\n border-radius: var(--aia-option-picture-radius, 6px);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-count-IpYbQ {\n padding-left: 12px;\n font-size: var(--aia-option-count-font-size, 12px);\n line-height: 21px;\n}\n:where([data-aia-options-style=\"classic\"]) [data-aia-group]:has(.aia-parameter-Dt2zF) {\n --aia-option-row-height: 53px;\n}\n:where([data-aia-options-style=\"classic\"]) [data-aia-group]:has(.aia-image-YZAbO) {\n --aia-option-row-height: calc(var(--aia-option-image-size, 40px) + 16px);\n}\n:where([data-aia-options-style=\"classic\"])\n [data-aia-group]:has(.aia-image-YZAbO)\n .aia-content-T-Qba:not(:has(.aia-image-YZAbO)) {\n gap: var(--aia-option-image-gap, 12px);\n min-height: var(--aia-option-image-size, 40px);\n}\n:where([data-aia-options-style=\"classic\"])\n [data-aia-group]:has(.aia-image-YZAbO)\n .aia-content-T-Qba:not(:has(.aia-image-YZAbO))\n .aia-icon-Qw938 {\n width: var(--aia-option-image-size, 40px);\n height: var(--aia-option-image-size, 40px);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-content-T-Qba:has(.aia-checkbox-KGRhg) {\n gap: 10px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-checkbox-KGRhg {\n flex: 0 0 18px;\n width: 18px;\n height: 18px;\n border-radius: 6px;\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"item\":\"aia-item-d4vpD\",\"content\":\"aia-content-T-Qba\",\"riseIn\":\"aia-riseIn-etXZT\",\"fadeIn\":\"aia-fadeIn-I8u35\",\"tappable\":\"aia-tappable-70KcX\",\"nonTappable\":\"aia-nonTappable-xSZM-\",\"highlighted\":\"aia-highlighted-Hb0SU\",\"liveMatch\":\"aia-liveMatch--eYfs\",\"tag\":\"aia-tag-e3Fwe\",\"pressed\":\"aia-pressed-98o-r\",\"scrollHint\":\"aia-scrollHint-xKXPt\",\"loadingOut\":\"aia-loadingOut-hI-qI\",\"parameter\":\"aia-parameter-Dt2zF\",\"match\":\"aia-match-pp-9v\",\"icon\":\"aia-icon-Qw938\",\"count\":\"aia-count-IpYbQ\",\"image\":\"aia-image-YZAbO\",\"text\":\"aia-text-yqoh9\",\"checkbox\":\"aia-checkbox-KGRhg\",\"checkPop\":\"aia-checkPop-CCWRW\"};","import {\n formatTime,\n TIME_WHEEL_COLUMNS,\n TIME_WHEEL_ROW_HEIGHT,\n type TimeView,\n type TimeWheelColumn,\n timeWheelIndex,\n timeWheelIndexFromScroll,\n timeWheelRows,\n withTimeWheelIndex,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { Fragment, useEffect, useLayoutEffect, useRef } from \"react\";\nimport styles from \"./TimeWheel.module.css\";\n\n/** How long a column's scroll must be still before the row it rests on counts. */\nconst SCROLL_SETTLE_MS = 120;\n\nexport interface TimeWheelProps {\n /** The core's `timeView`: the time on the wheels' top rows. */\n view: TimeView;\n /** Accessible name for the wheel (\"Time\"). */\n label: string;\n /** Text of the button that answers with the time (\"Done\"). */\n doneLabel: string;\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 interactive?: boolean;\n /** The user turned a wheel; `minutes` is the whole new time. Commits nothing. */\n onTimeChange: (minutes: number) => void;\n /** Done — answer the pill with the time on the wheels. */\n onTimeCommit: () => void;\n}\n\n/**\n * The dropdown's time body, rendered in place of the options grid when the\n * active parameter is a time. React analogue of vanilla's `renderTimeWheel`:\n * three wheels — hour, minutes in fives, AM/PM — whose top rows read as the\n * time, and a Done button.\n *\n * The wheels hold no time of their own. `view.minutes` is the time; turning a\n * wheel reports the new time and the next render scrolls every wheel to it.\n * That is what lets the keyboard (ArrowUp/ArrowDown in the input, handled by\n * the core) and the pointer move the same time.\n */\nexport function TimeWheel({\n view,\n label,\n doneLabel,\n interactive = true,\n onTimeChange,\n onTimeCommit,\n}: TimeWheelProps) {\n return (\n // biome-ignore lint/a11y/useSemanticElements: a <fieldset> groups form controls; this groups a pointer widget the input drives, and would bring a fieldset's default chrome into the three copies of this stylesheet.\n <div\n className={styles.timeWheel}\n data-aia-time-wheel=\"\"\n role=\"group\"\n aria-label={label}\n onMouseDown={(e) => e.preventDefault()}\n >\n {/* The wheels are a pointer surface; keyboard users move the time from\n the input. So the columns are hidden from AT and the time is\n announced from here instead. */}\n <span className={styles.value} data-aia-time-value=\"\" aria-live=\"polite\">\n {formatTime(view.minutes)}\n </span>\n <div className={styles.columns} aria-hidden=\"true\">\n <div className={styles.band} />\n {TIME_WHEEL_COLUMNS.map((column) => (\n <Fragment key={column}>\n {column === \"minute\" && <span className={styles.separator}>:</span>}\n <WheelColumn\n column={column}\n minutes={view.minutes}\n interactive={interactive}\n onTimeChange={onTimeChange}\n />\n </Fragment>\n ))}\n </div>\n <button\n type=\"button\"\n // Out of the tab order, as the calendar's buttons are: Tab is bound to\n // the dropdown, and Enter in the input already commits a moved wheel.\n tabIndex={-1}\n className={styles.done}\n data-aia-time-done=\"\"\n onClick={() => {\n if (interactive) onTimeCommit();\n }}\n >\n {doneLabel}\n </button>\n </div>\n );\n}\n\ninterface WheelColumnProps {\n column: TimeWheelColumn;\n minutes: number;\n interactive: boolean;\n onTimeChange: (minutes: number) => void;\n}\n\nfunction WheelColumn({ column, minutes, interactive, onTimeChange }: WheelColumnProps) {\n const ref = useRef<HTMLDivElement>(null);\n // The offset this component last scrolled to itself, so the scroll event\n // that echoes it isn't mistaken for the user turning the wheel.\n const syncedTop = useRef<number | null>(null);\n // The pending read of a scroll the user is still making.\n const settle = useRef<ReturnType<typeof setTimeout> | null>(null);\n // Read at settle time, so a scroll that rests after a re-render answers\n // against the current time, not the one it started on.\n const latest = useRef({ minutes, interactive, onTimeChange });\n latest.current = { minutes, interactive, onTimeChange };\n const index = timeWheelIndex(column, minutes);\n\n // Scroll to the row the time puts on top — but never yank a wheel the user\n // is still turning: their scroll settles into a time of its own.\n useLayoutEffect(() => {\n const el = ref.current;\n if (!el || settle.current) return;\n const top = index * TIME_WHEEL_ROW_HEIGHT;\n if (Math.abs(el.scrollTop - top) < 1) return;\n syncedTop.current = top;\n el.scrollTop = top;\n }, [index]);\n\n useEffect(\n () => () => {\n if (settle.current) clearTimeout(settle.current);\n },\n [],\n );\n\n const settleNow = () => {\n settle.current = null;\n const el = ref.current;\n const current = latest.current;\n if (!el || !current.interactive) return;\n const next = timeWheelIndexFromScroll(column, el.scrollTop);\n if (next === timeWheelIndex(column, current.minutes)) return;\n current.onTimeChange(withTimeWheelIndex(column, current.minutes, next));\n };\n\n const onScroll = () => {\n const el = ref.current;\n if (!el) return;\n if (syncedTop.current != null && Math.abs(el.scrollTop - syncedTop.current) < 1) {\n syncedTop.current = null;\n return;\n }\n syncedTop.current = null;\n if (settle.current) clearTimeout(settle.current);\n settle.current = setTimeout(settleNow, SCROLL_SETTLE_MS);\n };\n\n return (\n <div ref={ref} className={styles.column} data-aia-time-column={column} onScroll={onScroll}>\n {timeWheelRows(column).map((row, i) => (\n // biome-ignore lint/a11y/useKeyWithClickEvents: the wheels are aria-hidden; the keyboard moves the time from the input.\n // biome-ignore lint/a11y/noStaticElementInteractions: as above.\n <div\n key={row.label}\n className={i === index ? `${styles.row} ${styles.selected}` : styles.row}\n data-aia-time-row=\"\"\n data-aia-index={i}\n onClick={() => {\n if (latest.current.interactive) {\n onTimeChange(withTimeWheelIndex(column, latest.current.minutes, i));\n }\n }}\n >\n {row.label}\n </div>\n ))}\n </div>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-52a922cb\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-52a922cb\";\n s.textContent = `/* --- Time wheel (replaces the options grid for time suggestions) ---\n\n One of three hand-maintained copies (vanilla styles.css, this file, Angular's\n time-wheel.component.css). Only the class-naming layer differs — the\n declarations must match, and \\`timeWheelParity.test.ts\\` fails the build if\n they drift. See CLAUDE.md's duplicated-stylesheet rule.\n\n Colours go through the same --aia-option-* chain as the option rows and the\n calendar (see DateGrid.module.css for why). The 30px row height is\n load-bearing: the component turns a column's scroll offset into a row as\n \\`scrollTop / 30\\` (TIME_WHEEL_ROW_HEIGHT in the core), so it is not a token. */\n.aia-timeWheel-KdR4A {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n padding: 6px 6px 4px;\n}\n\n/* Announces the time to AT (the wheels themselves are aria-hidden). */\n.aia-value--wqvm {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n\n.aia-columns-TaD-f {\n position: relative;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n gap: 2px;\n width: 100%;\n}\n\n/* The one soft band the chosen time sits in, behind the wheels' top rows. */\n.aia-band-pVy-f {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n height: 30px;\n border-radius: 8px;\n background: var(--aia-time-band-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.08));\n pointer-events: none;\n}\n\n.aia-column-lwtdd {\n position: relative;\n flex: 0 0 auto;\n width: 44px;\n /* Three rows show: the chosen one and the two after it. The bottom padding\n lets the last row scroll up to the top; border-box keeps it inside those\n 90px, where it only adds scroll range, rather than adding 60px of visible\n column below them. */\n height: 90px;\n padding-bottom: 60px;\n box-sizing: border-box;\n overflow-y: auto;\n overscroll-behavior: contain;\n scroll-snap-type: y mandatory;\n scrollbar-width: none;\n -webkit-mask-image: linear-gradient(to bottom, #000 34%, transparent 100%);\n mask-image: linear-gradient(to bottom, #000 34%, transparent 100%);\n}\n\n.aia-column-lwtdd::-webkit-scrollbar {\n display: none;\n}\n\n.aia-row-A3pAx {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 30px;\n scroll-snap-align: start;\n font-family: inherit;\n font-size: var(--aia-time-font-size, 15px);\n font-variant-numeric: tabular-nums;\n font-weight: 450;\n line-height: 20px;\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n cursor: pointer;\n}\n\n.aia-selected-xgOWY {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n font-weight: 500;\n}\n\n.aia-separator-kX9WO {\n display: flex;\n align-items: center;\n height: 30px;\n font-size: var(--aia-time-font-size, 15px);\n font-weight: 500;\n line-height: 20px;\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n}\n\n.aia-done-llNY5 {\n align-self: stretch;\n height: 44px;\n padding: 0 12px;\n border: none;\n border-radius: 12px;\n background: var(--aia-time-done-bg, var(--aia-done-bg, #e4e8f0));\n font-family: inherit;\n font-size: 15px;\n font-weight: 600;\n line-height: 20px;\n color: var(--aia-time-done-color, var(--aia-done-color, #2a3150));\n cursor: pointer;\n transition: background-color 150ms ease-out;\n}\n\n.aia-done-llNY5:hover {\n background: var(--aia-time-done-bg-hover, var(--aia-done-bg-hover, #d8dde8));\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"timeWheel\":\"aia-timeWheel-KdR4A\",\"value\":\"aia-value--wqvm\",\"columns\":\"aia-columns-TaD-f\",\"band\":\"aia-band-pVy-f\",\"column\":\"aia-column-lwtdd\",\"row\":\"aia-row-A3pAx\",\"selected\":\"aia-selected-xgOWY\",\"separator\":\"aia-separator-kX9WO\",\"done\":\"aia-done-llNY5\"};","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-8414cd5f\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-8414cd5f\";\n s.textContent = `.aia-stack {\n display: flex;\n flex-direction: column;\n gap: var(--aia-stack-space, 0.5rem);\n}\n.aia-stack[data-align=\"start\"] {\n align-items: start;\n}\n.aia-stack[data-align=\"center\"] {\n align-items: center;\n}\n.aia-stack[data-align=\"end\"] {\n align-items: end;\n}\n/* data-align=\"stretch\" is the flex default — no rule needed. */\n`;\n document.head.appendChild(s);\n}\nexport {};","import type { ComponentPropsWithoutRef, CSSProperties, ReactNode } from \"react\";\nimport \"./Stack.css\";\n\ninterface StackProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"className\"> {\n /** Gap between children. Any CSS length. Defaults to `0.5rem`. */\n space?: string;\n /** Cross-axis alignment of children. Defaults to `stretch` (full width). */\n align?: \"start\" | \"center\" | \"end\" | \"stretch\";\n className?: string;\n children: ReactNode;\n}\n\n// Vertical layout primitive — children stack top-to-bottom with `space` gap. Internal.\nexport function Stack({ space, align = \"stretch\", className, children, ...rest }: StackProps) {\n const style = space ? ({ \"--aia-stack-space\": space } as CSSProperties) : undefined;\n return (\n <div\n className={className ? `aia-stack ${className}` : \"aia-stack\"}\n data-align={align}\n style={style}\n {...rest}\n >\n {children}\n </div>\n );\n}\n","import { uiStringsFor } from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport styles from \"./SubmitButton.module.css\";\n\ninterface SubmitButtonProps {\n /** Disabled when there's nothing to submit. */\n disabled?: boolean;\n /** The request is complete: the button lights up to invite the submit. */\n ready?: boolean;\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 busy?: boolean;\n onClick: () => void;\n /** The accessible name. Default: the English word. */\n label?: string;\n}\n\n/**\n * The default circular submit button (up-arrow). Tier 1 renders this when the\n * consumer doesn't supply a custom `submitButton`. Themed via `--aia-submit-*`.\n */\nexport function SubmitButton({\n disabled,\n ready,\n busy = false,\n onClick,\n label = uiStringsFor().submit,\n}: SubmitButtonProps) {\n return (\n <button\n type=\"button\"\n data-aia-submit=\"\"\n className={styles.submitButton}\n disabled={disabled}\n data-aia-ready={ready ? \"\" : undefined}\n data-aia-submit-state={busy ? \"busy\" : undefined}\n aria-busy={busy ? true : undefined}\n onClick={(e) => {\n e.stopPropagation();\n onClick();\n }}\n aria-label={label}\n >\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" role=\"img\" aria-label={label}>\n <path\n d=\"M9 14V4M9 4L4 9M9 4L14 9\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-fdee06e6\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-fdee06e6\";\n s.textContent = `.aia-submitButton-otz7H {\n flex-shrink: 0;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n border: none;\n background: var(--aia-submit-bg, var(--aia-color-text-default, #fff));\n color: var(--aia-submit-color, var(--aia-color-bg-default, #000));\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n transition:\n opacity 0.2s ease,\n background-color 250ms ease,\n transform 250ms ease;\n}\n\n/* Size and paint by class as well as by attribute: a presentation attribute\n has no specificity, so a page's \\`svg { width: 100%; fill: currentColor }\\`\n would otherwise resize the arrow and fill it solid — the consumer-isolation\n reset leaves inline SVG alone. A class rule outranks any type selector. */\n.aia-submitButton-otz7H svg {\n width: 18px;\n height: 18px;\n fill: none;\n /* The root draws nothing and the path pins its own stroke, but a page's\n \\`svg { stroke: … }\\` would otherwise still land here; say none, as the\n markup does. */\n stroke: none;\n}\n.aia-submitButton-otz7H svg path {\n fill: none;\n stroke: currentColor;\n}\n\n.aia-submitButton-otz7H:hover {\n opacity: 0.85;\n}\n\n/* Disabled (empty input) keeps the solid themed look by default — the disabled\n tokens fall back to the enabled ones, so a consumer's themed color is never\n washed out. Opt into a faded/dimmed rest state by setting\n --aia-submit-bg-disabled / --aia-submit-color-disabled. */\n.aia-submitButton-otz7H:disabled {\n background: var(\n --aia-submit-bg-disabled,\n var(--aia-submit-bg, var(--aia-color-text-default, #fff))\n );\n color: var(\n --aia-submit-color-disabled,\n var(--aia-submit-color, var(--aia-color-bg-default, #000))\n );\n cursor: default;\n}\n\n/* Ready: the request is complete, so the button lifts slightly and takes its\n ready color (--aia-submit-bg-ready, defaulting to the normal one). The state\n sits in :where() so a theme's own \\`.x .magicx-aia-submit { background }\\`\n still wins. */\n.aia-submitButton-otz7H:where([data-aia-ready]:not(:disabled)) {\n background: var(--aia-submit-bg-ready, var(--aia-submit-bg, var(--aia-color-text-default, #fff)));\n transform: scale(1.08);\n}\n\n/* A submit in progress (Enter, this button, \"See all results\"): the arrow\n gives way to the spinning arc the add-to-cart button shows, in the arrow's\n colour, until the page the submit opens takes over. The button keeps its\n size and stays enabled; a press is ignored. A slower turn under reduced\n motion: it is the only sign the submit took. The state sits in :where(),\n so a page's own rule on the attribute restyles or hides it. */\n.aia-submitButton-otz7H:where([data-aia-submit-state=\"busy\"]) svg {\n display: none;\n}\n\n.aia-submitButton-otz7H:where([data-aia-submit-state=\"busy\"])::after {\n content: \"\";\n box-sizing: border-box;\n width: var(--aia-spinner-size, 16px);\n height: var(--aia-spinner-size, 16px);\n border: var(--aia-spinner-width, 2px) solid var(--aia-submit-spinner-color, currentColor);\n border-right-color: transparent;\n border-radius: 50%;\n animation: aia-submitSpin-0llcF 0.8s linear infinite;\n}\n\n@keyframes aia-submitSpin-0llcF {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-submitButton-otz7H:where([data-aia-submit-state=\"busy\"])::after {\n animation-duration: 2s;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-submitButton-otz7H {\n transition: none;\n }\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"submitButton\":\"aia-submitButton-otz7H\",\"submitSpin\":\"aia-submitSpin-0llcF\"};","import {\n type AutocompleteResult,\n AIAutocomplete as CoreAIAutocomplete,\n type CoreState,\n dateSelectionFor,\n dropdownPillsFor,\n editingSuggestion,\n HANDOFF_NOT_HANDLED,\n identifiedParamLabel,\n type Product,\n type SelectOptionOptions,\n type Suggestion,\n type SuggestionOption,\n withoutTraditionalAutocomplete,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport {\n type ChangeEvent,\n type KeyboardEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { UseAIAutocompleteOptions, UseAIAutocompleteReturn } from \"../types\";\nimport { useOptionOverridesProxy } from \"./useOptionOverridesProxy\";\nimport { useProductsProxy } from \"./useProductsProxy\";\n\n/** What `getResult()` answers before the core exists. */\nconst EMPTY_RESULT: AutocompleteResult = {\n query: \"\",\n raw_query: \"\",\n completed_params: [],\n identified_params: [],\n is_ready: false,\n};\n\n/**\n * Pre-mount / SSR fallback. Identical shape to the post-mount CoreState so\n * the hook's return is single-shaped — no `if (!instance) return ...` branch.\n * `isLoading: true` matches the historical SSR bail-out: consumers using\n * `isLoading` to render a skeleton see one on the first paint instead of a\n * flash of blank content while the mount effect creates the core instance.\n */\nconst EMPTY_STATE: CoreState = {\n text: \"\",\n composing: null,\n completedParams: [],\n identifiedParams: [],\n skippedParams: [],\n pendingSpan: null,\n suggestions: [],\n // Pre-mount there is no core and therefore no response to read items from.\n products: [],\n traditionalAutocomplete: false,\n customFields: null,\n // …nor an option override being asked.\n optionSearch: null,\n activeDropdownIndex: -1,\n highlightByPointer: false,\n newParamId: null,\n isLoading: true,\n isReady: false,\n error: null,\n segments: [],\n actionableSuggestions: [],\n filteredOptions: [],\n dropdownLoading: true,\n dropdownOptions: [],\n skeletonOptions: null,\n skeletonSuggestion: null,\n skeletonPicked: null,\n dropdownSuggestion: null,\n skeletonRequested: false,\n skeletonExiting: false,\n // Pre-mount there is no active suggestion, so nothing can be a date yet.\n activeFormatType: \"options\",\n dateView: null,\n dateRangeStart: null,\n dateReferences: [],\n dateFloor: null,\n timeView: null,\n multiSelectView: null,\n dropdownMultiSelect: null,\n multiSelectDraft: null,\n locationView: null,\n locationSearch: null,\n locationAutocomplete: true,\n locationFieldFocused: false,\n isSubmitting: false,\n selectingProductId: null,\n placeholderText: \"\",\n leadInText: \"\",\n optionQuery: \"\",\n isSearchingOptions: false,\n isDropdownOpen: false,\n isActivePillSelected: false,\n blockingChips: [],\n filterBase: 0,\n filterInProgress: false,\n pillTapped: false,\n skipNextFetch: false,\n lastRawQuery: \"\",\n isFocused: false,\n dropdownHeld: false,\n editingParam: null,\n editingIdentified: null,\n editingAnchor: null,\n editingTail: null,\n caretOffset: null,\n inSelectionAnimation: false,\n dateViewMonth: null,\n pendingRangeStart: null,\n timeDraft: null,\n};\n\ninterface CoreActions {\n handleTextChange: (value: string) => void;\n handleCompositionText: (value: string) => void;\n handleKeyDown: (e: KeyboardEvent<HTMLElement> | globalThis.KeyboardEvent) => void;\n setFocused: (focused: boolean) => void;\n startEditingParam: (paramId: string) => void;\n removeParam: (paramId: string) => boolean;\n exitEditMode: () => void;\n handleCaretAfterInput: (offset: number | null) => void;\n handleCaretMove: (offset: number | null) => void;\n replaceEditingRange: (replacement: string) => boolean;\n setActivePill: (index: number) => void;\n skipActivePill: () => void;\n removeLastParam: () => void;\n clearNewParamId: () => void;\n reset: () => void;\n refreshProducts: () => void;\n prepareSubmit: () => void;\n getState: () => CoreState;\n getResult: () => AutocompleteResult;\n awaitSubmitResult: () => Promise<AutocompleteResult | null>;\n recordSubmit: (result: AutocompleteResult) => void;\n holdSubmit: (returned?: unknown) => void;\n endSubmitProgress: () => void;\n getSearchId: () => string | undefined;\n getVisitorId: () => string | undefined;\n refreshAnalyticsConsent: () => void;\n selectOption: (option: SuggestionOption, how?: SelectOptionOptions) => void;\n selectProduct: (product: Product) => void;\n addProductToCart: (product: Product) => Promise<void>;\n setActiveDropdownIndex: (index: number) => void;\n /** Clear the highlight if it is still on option `index` — the core's `clearHighlight`. */\n clearHighlight: (index: number) => void;\n showPreviousMonth: () => void;\n showNextMonth: () => void;\n /** Turn the time wheel to `minutes` past midnight. Commits nothing — see the core's `setTime`. */\n setTime: (minutes: number) => void;\n /** Answer the time pill with the time on the wheel — the core's `commitTime`. */\n commitTime: () => void;\n toggleMultiSelectOption: (option: SuggestionOption) => void;\n commitMultiSelect: () => void;\n /** Set the location search field's text — the core's `setLocationQuery`. */\n setLocationQuery: (query: string) => void;\n /** Move the highlight through the location results — the core's `moveLocationHighlight`. */\n moveLocationHighlight: (delta: number) => void;\n /** Answer the location pill — the core's `commitLocation`. */\n commitLocation: (index?: number) => void;\n /** The location field took or let go of focus — the core's `setLocationFieldFocused`. */\n setLocationFieldFocused: (focused: boolean) => void;\n handleFocus: () => void;\n handleBlur: () => void;\n}\n\nexport function useAIAutocomplete({\n onSubmit,\n onResult,\n onError,\n optionOverrides,\n maskCompletedText,\n apiConfig,\n additionalContext,\n language,\n currency,\n productId,\n visitorId,\n analyticsConsent,\n columns = 2,\n dropdownTrigger,\n optionsPosition,\n closeDropdownOnBlur,\n focusInputOnSelect,\n startingState,\n prependPlaceholder,\n allOption,\n showNonTappableOptions,\n locationSearch,\n showOptionIcons,\n showOptionImages,\n showOptionCounts,\n showSkipButton,\n showProducts,\n submitProgress,\n awaitAnswerOnSubmit,\n submitAnswerTimeoutMs,\n productImageFallback = \"image\",\n showProductVendor = true,\n onFocus,\n onBlur,\n value: controlledValue,\n completedParams: controlledParams,\n onChange: onChangeProp,\n onParamsChange,\n products,\n mapProducts,\n onProductSelect,\n onProductAddToCart,\n source,\n setCursor,\n}: UseAIAutocompleteOptions): UseAIAutocompleteReturn {\n const instanceRef = useRef<CoreAIAutocomplete | null>(null);\n const [coreState, setCoreState] = useState<CoreState | null>(null);\n\n // Refs for caller-supplied callbacks. The CoreAIAutocomplete instance is\n // mount-only (created once); these refs let the stable proxy callbacks\n // inside it pick up the latest props on every render.\n const onSubmitRef = useRef(onSubmit);\n onSubmitRef.current = onSubmit;\n const onResultRef = useRef(onResult);\n onResultRef.current = onResult;\n const onErrorRef = useRef(onError);\n onErrorRef.current = onError;\n const onChangeRef = useRef(onChangeProp);\n onChangeRef.current = onChangeProp;\n const onParamsChangeRef = useRef(onParamsChange);\n onParamsChangeRef.current = onParamsChange;\n const onFocusRef = useRef(onFocus);\n onFocusRef.current = onFocus;\n const onBlurRef = useRef(onBlur);\n onBlurRef.current = onBlur;\n const setCursorRef = useRef(setCursor);\n setCursorRef.current = setCursor;\n const onProductSelectRef = useRef(onProductSelect);\n onProductSelectRef.current = onProductSelect;\n const onProductAddToCartRef = useRef(onProductAddToCart);\n onProductAddToCartRef.current = onProductAddToCart;\n // The core gets one stable resolver reading the latest prop, so an inline\n // `visitorId={() => readCookie()}` is not a changed option on every render.\n // A resolver is only called once the server has funnel telemetry on.\n const visitorIdRef = useRef(visitorId);\n visitorIdRef.current = visitorId;\n const resolveVisitorId = useRef(() => {\n const v = visitorIdRef.current;\n return typeof v === \"function\" ? v() : v;\n }).current;\n // Only a host that passes visitorId gets the resolver: without one, the\n // core keeps its own id (analyticsConsent), which a resolver standing in\n // for a missing prop would block.\n const hasVisitorId = visitorId !== undefined;\n // Same treatment for the consent: one stable reader of the latest prop. A\n // missing prop reads as unanswered, which touches no cookie.\n const analyticsConsentRef = useRef(analyticsConsent);\n analyticsConsentRef.current = analyticsConsent;\n const readAnalyticsConsent = useRef(() => {\n const c = analyticsConsentRef.current;\n return typeof c === \"function\" ? c() : c;\n }).current;\n\n // Stable proxy so an inline `products={{ … }}` doesn't read as a swapped\n // integration on every render — see useProductsProxy for the full rationale.\n const productsProxy = useProductsProxy(products);\n const mapperRef = useRef(mapProducts);\n mapperRef.current = mapProducts;\n const forwardMapper = useRef<NonNullable<UseAIAutocompleteOptions[\"mapProducts\"]>>(\n (cards, items) => {\n const mapper = mapperRef.current;\n return mapper ? mapper(cards, items) : cards;\n },\n ).current;\n const mapperProxy = mapProducts ? forwardMapper : undefined;\n // Same treatment for `optionOverrides`: the core would read a fresh inline\n // record as a swap and re-ask the pill on screen — see useOptionOverridesProxy.\n const overridesProxy = useOptionOverridesProxy(optionOverrides);\n\n // Create, subscribe, and destroy the core instance in one mount-only effect.\n // Keeping creation out of render (and pairing it with the cleanup) is what\n // makes this StrictMode-safe — otherwise cleanup nulls the ref, render\n // re-creates, and the store subscription drives an infinite setState loop.\n // biome-ignore lint/correctness/useExhaustiveDependencies: initial-opts snapshot; later changes are synced by the update-effect below\n useEffect(() => {\n if (typeof document === \"undefined\") return;\n const instance = new CoreAIAutocomplete(document.createElement(\"div\"), {\n renderMode: \"headless\",\n apiConfig,\n additionalContext,\n language,\n currency,\n productId,\n visitorId: hasVisitorId ? resolveVisitorId : undefined,\n analyticsConsent: readAnalyticsConsent,\n optionOverrides: overridesProxy.overrides,\n maskCompletedText,\n columns,\n dropdownTrigger,\n optionsPosition,\n closeDropdownOnBlur,\n focusInputOnSelect,\n startingState,\n prependPlaceholder,\n allOption,\n showNonTappableOptions,\n locationSearch,\n showProducts,\n submitProgress,\n awaitAnswerOnSubmit,\n submitAnswerTimeoutMs,\n source,\n value: controlledValue,\n completedParams: controlledParams,\n onSubmit: (...args) => onSubmitRef.current?.(...args),\n onResult: (...args) => onResultRef.current?.(...args),\n onError: (...args) => onErrorRef.current?.(...args),\n onChange: (...args) => onChangeRef.current?.(...args),\n onParamsChange: (...args) => onParamsChangeRef.current?.(...args),\n onFocus: () => onFocusRef.current?.(),\n onBlur: () => onBlurRef.current?.(),\n // Registered whatever the consumer passed (the listener set is fixed\n // at construction), so say when there is no handler behind it: a tap\n // that opens nothing must not be marked in progress.\n onProductSelect: (product) =>\n onProductSelectRef.current\n ? onProductSelectRef.current(product)\n : (HANDOFF_NOT_HANDLED as unknown as undefined),\n // Always a forwarder, so a handler added after mount still reaches the\n // core. Whether cards draw the button follows the prop itself (see\n // `dropdownProps`), and `addProductToCart` below skips the core while\n // no handler is set.\n onProductAddToCart: (product) => onProductAddToCartRef.current?.(product),\n setCursor: (offset) => setCursorRef.current?.(offset),\n products: productsProxy.config,\n mapProducts: mapperProxy,\n });\n instanceRef.current = instance;\n setCoreState(instance.getState());\n const unsub = instance.subscribe((state) => setCoreState(state));\n return () => {\n unsub();\n instance.destroy();\n if (instanceRef.current === instance) instanceRef.current = null;\n };\n }, []);\n\n // A visitorId added or removed after mount moves the id between the host\n // and the core. The consent goes with it, so a core taking the id back\n // reads the answer at once (a declined one removes a stored id).\n const mountedVisitorIdRef = useRef(hasVisitorId);\n useEffect(() => {\n if (mountedVisitorIdRef.current === hasVisitorId) return;\n mountedVisitorIdRef.current = hasVisitorId;\n instanceRef.current?.update({\n visitorId: hasVisitorId ? resolveVisitorId : undefined,\n analyticsConsent: readAnalyticsConsent,\n });\n }, [hasVisitorId, resolveVisitorId, readAnalyticsConsent]);\n\n // A changed answer applies at once (a declined one removes the stored id).\n // A function is read when needed, so only a changed value is a change here.\n const consentKey = typeof analyticsConsent === \"function\" ? \"function\" : analyticsConsent;\n const mountedConsentKeyRef = useRef(consentKey);\n useEffect(() => {\n if (mountedConsentKeyRef.current === consentKey) return;\n mountedConsentKeyRef.current = consentKey;\n instanceRef.current?.refreshAnalyticsConsent();\n }, [consentKey]);\n\n // Sync controlled value\n useEffect(() => {\n if (controlledValue !== undefined) instanceRef.current?.setValue(controlledValue);\n }, [controlledValue]);\n\n // Sync controlled params\n useEffect(() => {\n if (controlledParams !== undefined) instanceRef.current?.setCompletedParams(controlledParams);\n }, [controlledParams]);\n\n // Sync apiConfig/optionOverrides/dropdownTrigger when values change\n const apiConfigJson = JSON.stringify(apiConfig ?? null);\n // Unlike apiConfig (a narrow typed shape), additionalContext is consumer-supplied\n // free-form JSON — a circular reference or a BigInt would throw here, which runs\n // during render. Fall back to a constant so a bad value is silently dropped\n // (never synced to the core) instead of crashing the render.\n let additionalContextJson: string;\n try {\n additionalContextJson = JSON.stringify(additionalContext ?? null);\n } catch {\n additionalContextJson = \"[unstringifiable]\";\n }\n // biome-ignore lint/correctness/useExhaustiveDependencies: overridesProxy.key tracks override changes. Currency fields track currency changes. The proxy reads callbacks live.\n useEffect(() => {\n instanceRef.current?.update({\n apiConfig,\n additionalContext,\n language,\n currency,\n productId,\n optionOverrides: overridesProxy.overrides,\n dropdownTrigger,\n optionsPosition,\n closeDropdownOnBlur,\n focusInputOnSelect,\n startingState,\n prependPlaceholder,\n allOption,\n showNonTappableOptions,\n locationSearch,\n showProducts,\n submitProgress,\n awaitAnswerOnSubmit,\n submitAnswerTimeoutMs,\n });\n }, [\n apiConfigJson,\n additionalContextJson,\n language,\n currency?.code,\n currency?.rate,\n currency?.country,\n productId,\n overridesProxy.key,\n dropdownTrigger,\n optionsPosition,\n closeDropdownOnBlur,\n focusInputOnSelect,\n startingState,\n prependPlaceholder,\n allOption,\n showNonTappableOptions,\n locationSearch,\n showProducts,\n submitProgress,\n awaitAnswerOnSubmit,\n submitAnswerTimeoutMs,\n ]);\n\n // Toggling the strip on or off is the only products change the core needs to\n // hear about — the proxy handles everything else — and it deliberately\n // clears the cards on the way out. Skips the mount pass: the constructor\n // above already applied the initial value, and a redundant update() here\n // would clear a strip the first fetch had populated.\n //\n // `productsProxy.config` is intentionally not a dependency: its identity is\n // stable by construction, so `enabled` is the only thing that can change.\n const productsMountedRef = useRef(false);\n // biome-ignore lint/correctness/useExhaustiveDependencies: config is stable by construction; `enabled` is the only real change\n useEffect(() => {\n if (!productsMountedRef.current) {\n productsMountedRef.current = true;\n return;\n }\n instanceRef.current?.update({ products: productsProxy.config });\n }, [productsProxy.enabled]);\n\n useEffect(() => {\n instanceRef.current?.update({ mapProducts: mapperProxy });\n }, [mapperProxy]);\n\n // Single stable action surface. Built once via the useRef-with-null-init\n // pattern (the idiomatic \"create once, never recreate\" idiom in React — see\n // https://react.dev/reference/react/useRef). Every entry forwards to the\n // current core instance via `instanceRef.current` so the closure picks up\n // the live instance even though the actions object itself never changes.\n const actionsRef = useRef<CoreActions | null>(null);\n if (actionsRef.current === null) {\n actionsRef.current = {\n handleTextChange: (value) => instanceRef.current?.handleTextChange(value),\n handleCompositionText: (value) => instanceRef.current?.handleCompositionText(value),\n handleKeyDown: (e) => {\n const native = \"nativeEvent\" in e ? e.nativeEvent : e;\n instanceRef.current?.handleKeyDown(native);\n },\n setFocused: (focused) => instanceRef.current?.setFocused(focused),\n startEditingParam: (paramId) => instanceRef.current?.startEditingParam(paramId),\n removeParam: (paramId) => instanceRef.current?.removeParam(paramId) ?? false,\n exitEditMode: () => instanceRef.current?.exitEditMode(),\n handleCaretAfterInput: (offset) => instanceRef.current?.handleCaretAfterInput(offset),\n handleCaretMove: (offset) => instanceRef.current?.handleCaretMove(offset),\n replaceEditingRange: (replacement) =>\n instanceRef.current?.replaceEditingRange(replacement) ?? false,\n setActivePill: (index) => instanceRef.current?.setActivePill(index),\n skipActivePill: () => instanceRef.current?.skipActivePill(),\n removeLastParam: () => instanceRef.current?.removeLastParam(),\n clearNewParamId: () => instanceRef.current?.clearNewParamId(),\n reset: () => instanceRef.current?.reset(),\n refreshProducts: () => instanceRef.current?.refreshProducts(),\n prepareSubmit: () => instanceRef.current?.prepareSubmit(),\n getState: () => instanceRef.current?.getState() ?? EMPTY_STATE,\n getResult: () => instanceRef.current?.getResult() ?? EMPTY_RESULT,\n awaitSubmitResult: () => instanceRef.current?.awaitSubmitResult() ?? Promise.resolve(null),\n recordSubmit: (result) => instanceRef.current?.recordSubmit(result),\n holdSubmit: (returned) => instanceRef.current?.holdSubmit(returned),\n endSubmitProgress: () => instanceRef.current?.endSubmitProgress(),\n getSearchId: () => instanceRef.current?.getSearchId(),\n getVisitorId: () => instanceRef.current?.getVisitorId(),\n refreshAnalyticsConsent: () => instanceRef.current?.refreshAnalyticsConsent(),\n selectOption: (option, how) => instanceRef.current?.selectOption(option, how),\n selectProduct: (product) => instanceRef.current?.selectProduct(product),\n addProductToCart: (product) => {\n const instance = instanceRef.current;\n if (!instance || !onProductAddToCartRef.current) return Promise.resolve();\n return instance.addProductToCart(product);\n },\n setActiveDropdownIndex: (index) => instanceRef.current?.setActiveDropdownIndex(index),\n clearHighlight: (index) => instanceRef.current?.clearHighlight(index),\n showPreviousMonth: () => instanceRef.current?.showPreviousMonth(),\n showNextMonth: () => instanceRef.current?.showNextMonth(),\n setTime: (minutes) => instanceRef.current?.setTime(minutes),\n commitTime: () => instanceRef.current?.commitTime(),\n toggleMultiSelectOption: (option) => instanceRef.current?.toggleMultiSelectOption(option),\n commitMultiSelect: () => instanceRef.current?.commitMultiSelect(),\n setLocationQuery: (query) => instanceRef.current?.setLocationQuery(query),\n moveLocationHighlight: (delta) => instanceRef.current?.moveLocationHighlight(delta),\n commitLocation: (index) => instanceRef.current?.commitLocation(index),\n setLocationFieldFocused: (focused) => instanceRef.current?.setLocationFieldFocused(focused),\n handleFocus: () => instanceRef.current?.setFocused(true),\n handleBlur: () => instanceRef.current?.setFocused(false),\n };\n }\n const actions = actionsRef.current;\n\n // textarea-specific adapter — capitalizes the first character on first\n // keystroke. Kept separate from `actions.handleTextChange` because the\n // capitalization rule belongs to the textarea host, not the core.\n const handleChange = useCallback((e: ChangeEvent<HTMLTextAreaElement>) => {\n const raw = e.target.value;\n const shouldCapitalize =\n raw.length > 0 &&\n !(e.nativeEvent as InputEvent)?.isComposing &&\n raw[0] !== raw[0].toUpperCase();\n const newValue = shouldCapitalize ? raw[0].toUpperCase() + raw.slice(1) : raw;\n instanceRef.current?.handleTextChange(newValue);\n }, []);\n\n const handleKeyDownTextarea = useCallback((e: KeyboardEvent<HTMLTextAreaElement>) => {\n instanceRef.current?.handleKeyDown(e.nativeEvent);\n }, []);\n\n // Snapshot the live instance + state for this render.\n const instance = instanceRef.current;\n const state = coreState ?? EMPTY_STATE;\n const text = controlledValue !== undefined ? controlledValue : state.text;\n const completedParams = controlledParams !== undefined ? controlledParams : state.completedParams;\n\n const actionableSuggestions = state.actionableSuggestions;\n const activeSuggestion: Suggestion | undefined = actionableSuggestions[0];\n // The traditional autocomplete suggestion is never a pill.\n // Memoized so consumers that depend on the pills (the empty box's hint)\n // only re-run when the suggestions change.\n const pillSuggestions = useMemo(\n () => withoutTraditionalAutocomplete(actionableSuggestions),\n [actionableSuggestions],\n );\n const listboxId = instance?.listboxId ?? \"\";\n\n const activeDescendantId =\n state.activeDropdownIndex >= 0 && instance\n ? `${listboxId}-option-${state.activeDropdownIndex}`\n : undefined;\n\n // In re-edit mode, the dropdown's pill bar shows a synthetic pill built\n // from the edited param's cached suggestion metadata. The options grid\n // shows the cached options regardless of the latest server response.\n const editingParam = state.editingParam;\n const editingIdentified = state.editingIdentified;\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 = state.dropdownSuggestion ?? dropdownPill ?? activeSuggestion;\n const dropdownPills = dropdownPillsFor(\n state.dropdownSuggestion,\n dropdownPill,\n actionableSuggestions,\n );\n\n // UI-visible loading — the core's `dropdownLoading` (see its docs). Pre-mount\n // we report loading=true so SSR / first-paint consumers render a skeleton\n // instead of a flash of blank content while the mount effect runs.\n const dateSelection = dateSelectionFor(state);\n\n const uiLoading = !instance || state.dropdownLoading;\n\n return {\n completedParams,\n multiSelectView: state.multiSelectView,\n toggleMultiSelectOption: actions.toggleMultiSelectOption,\n commitMultiSelect: actions.commitMultiSelect,\n skippedParams: state.skippedParams,\n identifiedParams: state.identifiedParams,\n suggestionPills: pillSuggestions,\n setActivePill: actions.setActivePill,\n skipActivePill: actions.skipActivePill,\n removeLastParam: actions.removeLastParam,\n segments: state.segments,\n newParamId: state.newParamId,\n clearNewParamId: actions.clearNewParamId,\n suggestions: state.suggestions,\n activeIndex: state.activeDropdownIndex,\n isReady: state.isReady,\n isLoading: uiLoading,\n isFocused: state.isFocused,\n isDropdownOpen: state.isDropdownOpen,\n isActivePillSelected: state.isActivePillSelected,\n blockingChips: state.blockingChips,\n placeholderText: state.placeholderText,\n listboxId,\n error: state.error,\n products: state.products,\n customFields: state.customFields,\n selectProduct: actions.selectProduct,\n addProductToCart: actions.addProductToCart,\n handleTextChange: actions.handleTextChange,\n handleCompositionText: actions.handleCompositionText,\n handleKeyDown: actions.handleKeyDown,\n setFocused: actions.setFocused,\n editingParam,\n editingIdentified,\n editingAnchor: state.editingAnchor,\n caretOffset: state.caretOffset,\n startEditingParam: actions.startEditingParam,\n removeParam: actions.removeParam,\n exitEditMode: actions.exitEditMode,\n handleCaretAfterInput: actions.handleCaretAfterInput,\n handleCaretMove: actions.handleCaretMove,\n replaceEditingRange: actions.replaceEditingRange,\n inputProps: {\n value: text,\n placeholder: state.placeholderText || undefined,\n onChange: handleChange,\n onKeyDown: handleKeyDownTextarea,\n onFocus: actions.handleFocus,\n onBlur: actions.handleBlur,\n role: \"combobox\" as const,\n \"aria-expanded\": state.isDropdownOpen,\n \"aria-activedescendant\": activeDescendantId,\n \"aria-autocomplete\": \"list\" as const,\n \"aria-controls\": listboxId,\n },\n reset: actions.reset,\n refreshProducts: actions.refreshProducts,\n prepareSubmit: actions.prepareSubmit,\n getState: actions.getState,\n getResult: actions.getResult,\n awaitSubmitResult: actions.awaitSubmitResult,\n recordSubmit: actions.recordSubmit,\n holdSubmit: actions.holdSubmit,\n endSubmitProgress: actions.endSubmitProgress,\n getSearchId: actions.getSearchId,\n getVisitorId: actions.getVisitorId,\n refreshAnalyticsConsent: actions.refreshAnalyticsConsent,\n isSubmitting: state.isSubmitting,\n selectingProductId: state.selectingProductId,\n dropdownProps: {\n suggestions: dropdownActivePill\n ? [{ ...dropdownActivePill, options: state.dropdownOptions }]\n : [],\n activeIndex: state.activeDropdownIndex,\n onSelect: actions.selectOption,\n onHighlight: actions.setActiveDropdownIndex,\n onUnhighlight: actions.clearHighlight,\n isOpen: state.isDropdownOpen,\n id: listboxId,\n pills: dropdownPills,\n activeSelected: state.isActivePillSelected,\n onPillClick: actions.setActivePill,\n onSkip: actions.skipActivePill,\n // Hidden while re-editing: the bar then shows the param being re-edited,\n // and an already answered param isn't skippable.\n showSkipButton: (showSkipButton ?? true) && !editingParam && !editingIdentified,\n showOptionIcons: showOptionIcons ?? true,\n showOptionImages: showOptionImages ?? true,\n showOptionCounts: showOptionCounts ?? true,\n // uiLoading is suppressed during the selection animation, but\n // skipActivePill no-ops in that window — mirror the guard visually.\n skipDisabled: state.inSelectionAnimation,\n isLoading: uiLoading,\n skeletonExiting: state.skeletonExiting,\n isInputEmpty: text.trim().length === 0,\n language,\n products: state.products,\n productImageFallback,\n showProductVendor,\n onProductSelect: actions.selectProduct,\n busyProductId: state.selectingProductId,\n seeAllBusy: state.isSubmitting,\n // Only with a handler: the prop's presence is what draws the buttons.\n onProductAddToCart: onProductAddToCart ? actions.addProductToCart : undefined,\n // A card taking focus blurs the input, which would otherwise close the\n // panel out from under the card the user just tabbed to.\n onProductFocusChange: actions.setFocused,\n // Datepicker. `filteredOptions` above already carries the visible month's\n // cells rather than the suggestion's own options when this is \"date\" —\n // the core swapped them in its derive layer, so the dropdown only has to\n // know which body to draw.\n formatType: state.activeFormatType,\n dateView: state.dateView,\n selectedDateIso: dateSelection.selectedIso,\n selectedDateRange: dateSelection.selectedRange,\n dateRangeStart: dateSelection.rangeStart,\n dateReferences: dateSelection.references,\n onPreviousMonth: actions.showPreviousMonth,\n onNextMonth: actions.showNextMonth,\n // Time wheel. As for a calendar, `filteredOptions` is empty — the wheel\n // is drawn from `timeView`, not from the suggestion's options.\n timeView: state.timeView,\n multiSelectView: state.dropdownMultiSelect,\n onMultiSelectCommit: actions.commitMultiSelect,\n onTimeChange: actions.setTime,\n onTimeCommit: actions.commitTime,\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: state.locationView,\n isReediting: state.editingParam != null,\n onLocationQuery: actions.setLocationQuery,\n onLocationMove: actions.moveLocationHighlight,\n onLocationCommit: actions.commitLocation,\n onLocationFocusChange: actions.setLocationFieldFocused,\n isFocused: state.isFocused || state.locationFieldFocused,\n // Flow the configured position into the dropdown so a headless consumer\n // who spreads `dropdownProps` gets above/below placement + layout reversal\n // automatically — no wrapper attribute or hand-copied CSS required.\n optionsPosition: optionsPosition ?? \"below\",\n },\n };\n}\n","import type { OptionOverride, OptionOverrides } from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { useRef } from \"react\";\n\nexport interface OptionOverridesProxy {\n /**\n * Stable record to hand the core. Its identity changes only when the SET of\n * overridden types changes, so `update()` sees a swap — and re-asks the pill\n * on screen — for a real change, never for a re-render.\n */\n overrides: OptionOverrides | undefined;\n /** The overridden types, joined — the only change worth an `update()` call. */\n key: string;\n}\n\n/**\n * Forwards `optionOverrides` to the core through a **stable proxy**.\n *\n * Consumers write the record inline, so the object and every function in it\n * get a fresh identity on each render. Handing that to the core would look\n * like a swapped record on every render, and the core answers a swap by\n * abandoning the ask in flight and asking again — with an inline record that\n * is a re-ask per render, and each answer re-renders. So calls go through a\n * ref instead, exactly as the hook's `on*` callbacks and `products` do: the\n * function the core calls is always the latest one rendered.\n *\n * The proxy is rebuilt only when the set of types changes, which is the one\n * change the core has to hear about (a pill of a newly overridden type may be\n * on screen).\n */\nexport function useOptionOverridesProxy(\n optionOverrides: OptionOverrides | undefined,\n): OptionOverridesProxy {\n const liveRef = useRef(optionOverrides);\n liveRef.current = optionOverrides;\n\n const key = Object.keys(optionOverrides ?? {})\n .sort()\n .join(\"\\u0000\");\n const proxyRef = useRef<{ key: string; overrides: OptionOverrides | undefined }>({\n key: \"\\u0001\",\n overrides: undefined,\n });\n if (proxyRef.current.key !== key) {\n const overrides: OptionOverrides = {};\n for (const type of Object.keys(optionOverrides ?? {})) {\n const forward: OptionOverride = (query, signal, suggestion) => {\n const fn = liveRef.current?.[type];\n // Unreachable while the type is overridden; an empty answer keeps a\n // torn-down entry on the path the core already treats as \"no options\".\n return fn ? fn(query, signal, suggestion) : [];\n };\n overrides[type] = forward;\n }\n proxyRef.current = { key, overrides: optionOverrides ? overrides : undefined };\n }\n return { overrides: proxyRef.current.overrides, key };\n}\n","import type { ProductsConfig } from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { useRef } from \"react\";\n\nexport interface ProductsProxy {\n /**\n * Stable object to hand the core. Identity never changes for the lifetime of\n * the hook, so `update()` never mistakes a re-render for a swapped\n * integration. `undefined` while the consumer hasn't configured `products` —\n * the core must see exactly that to stay completely inert.\n */\n config: ProductsConfig | undefined;\n /**\n * Whether `products` is configured. The only products change worth an\n * `update()` call, and therefore the only sane effect dependency: everything\n * else is picked up live through the proxy.\n */\n enabled: boolean;\n}\n\n/**\n * Forwards a `products` config to the core through a **stable proxy**.\n *\n * Consumers write the config inline (`products={{ fetch, transform }}`), so the\n * object and its function members get a fresh identity on every render. Handing\n * that straight to the core would look like a swapped integration on each\n * keystroke and clear the strip — so calls are forwarded through a ref instead,\n * exactly as the hook's `on*` callbacks already are. `limit` is a **getter**\n * because it's a value rather than a function: without one it would freeze at\n * whatever the first render passed.\n *\n * Note the trade this makes deliberately: identity can no longer distinguish\n * \"same integration, new object literal\" from \"genuinely different\n * integration\", so swapping one live config for another does NOT clear the\n * previous integration's cards — they're replaced when the next request lands.\n * Documented on the `products` prop.\n */\nexport function useProductsProxy(products: ProductsConfig | undefined): ProductsProxy {\n const productsRef = useRef(products);\n productsRef.current = products;\n\n const proxyRef = useRef<ProductsConfig | null>(null);\n if (proxyRef.current === null) {\n proxyRef.current = {\n fetch: (query, signal) => {\n const config = productsRef.current;\n // Unreachable while configured; a rejected promise (rather than a\n // throw) keeps the failure on the path the core already treats as\n // \"silent failure\" if the config is torn down mid-flight.\n if (!config) return Promise.reject(new Error(\"products config removed\"));\n return config.fetch(query, signal);\n },\n transform: (raw) => productsRef.current?.transform(raw) ?? [],\n get limit() {\n return productsRef.current?.limit;\n },\n };\n }\n\n const enabled = products !== undefined;\n return { config: enabled ? proxyRef.current : undefined, enabled };\n}\n","import {\n attachChipRemove,\n type CompletedParamState,\n cancelStartingHint,\n chipIdFromTap,\n extractPlainText,\n type FocusInputOnSelect,\n focusesInputOnSelect,\n getCursorOffset,\n keepCaretOnChip,\n plainTextLength,\n renderEditableContent,\n type Segment,\n type Suggestion,\n setCursorOffset,\n settlePickFocus,\n startingHintOptions,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport {\n type ClipboardEvent as ReactClipboardEvent,\n type KeyboardEvent as ReactKeyboardEvent,\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n} from \"react\";\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\nexport interface UseContentEditableEditorOptions {\n /** Derived segments (text + bold completed-param runs) for the editor body. */\n segments: readonly Segment[];\n /** The most recently promoted param — shimmer + post-promote refocus key. */\n newParamId: string | null;\n /** The bold param currently being re-edited (or null). */\n editingParam: CompletedParamState | null;\n /** Set while picking a date for a span the server identified as one. */\n editingIdentified: { id: string } | null;\n /** Plain-text offset where re-edit started; caret parks here on entry. */\n editingAnchor: number | null;\n /** Live caret offset within the editor, used by post-promote refocus. */\n caretOffset: number | null;\n /** Server-suggested placeholder (rendered via ::before when empty). */\n placeholderText: string;\n /** The suggestions whose first question's options the empty box's hint\n * cycles through (\"Find a table\" → \"Find a date spot\"). */\n hintSuggestions?: readonly Suggestion[];\n /** Whether the editor currently has focus — passes through to segment renderer. */\n isFocused: boolean;\n /** ARIA `aria-expanded` value for the input. */\n isDropdownOpen: boolean;\n /** ARIA `aria-controls` value pointing at the listbox. */\n listboxId: string;\n /** ARIA `aria-activedescendant` value pointing at the highlighted option (or undefined). */\n activeDescendantId: string | undefined;\n /** Focus the editor on mount (Tier 1 default). */\n autoFocus: boolean;\n /** Forwarded to the core whenever the plain-text content changes. */\n handleTextChange: (value: string) => void;\n /** Forwarded to the core while an IME composes, in place of `handleTextChange`. */\n handleCompositionText: (value: string) => void;\n /** Forwarded to the core for keyboard handling. */\n handleKeyDown: (e: ReactKeyboardEvent<HTMLElement> | globalThis.KeyboardEvent) => void;\n /** Forwarded to the core after each input event (extends edit tail, etc.). */\n handleCaretAfterInput: (offset: number | null) => void;\n /** Forwarded to the core on selectionchange (exits re-edit when caret leaves). */\n handleCaretMove: (offset: number | null) => void;\n /** Forwarded to the core when the caret lands inside a bold param's strong. */\n startEditingParam: (id: string) => void;\n /** Forwarded to the core during a `beforeinput` — atomic re-edit replacement. */\n replaceEditingRange: (replacement: string) => boolean;\n /** Forwarded to the core on native focus/blur. */\n setFocused: (focused: boolean) => void;\n /** Whether completed chips draw the icon of the option that answered them. Default: true. */\n showChipIcons?: boolean;\n /** Whether completed chips draw the picture of the option that answered them, in place of the icon. Default: true. */\n showChipImages?: boolean;\n /** Whether chips (completed and identified) end in a faint \"×\" that removes them. Default: false. */\n showChipRemove?: boolean;\n /** Chips whose removal finds items when the search found none. */\n blockingParamIds?: readonly string[];\n /** Whether a pick puts focus in the editor. Default: \"auto\" (not on a touch device). */\n focusInputOnSelect?: FocusInputOnSelect;\n /** Forwarded to the core when a chip's \"×\" is pressed. */\n removeParam?: (id: string) => void;\n}\n\nexport interface UseContentEditableEditorReturn {\n inputRef: React.RefObject<HTMLDivElement>;\n // Spread onto the contentEditable element; consumer supplies className.\n editorProps: {\n ref: React.RefObject<HTMLDivElement>;\n contentEditable: boolean;\n suppressContentEditableWarning: true;\n tabIndex: 0;\n role: \"combobox\";\n \"aria-autocomplete\": \"list\";\n \"aria-haspopup\": \"listbox\";\n \"aria-controls\": string;\n \"aria-expanded\": boolean;\n \"aria-activedescendant\": string | undefined;\n spellCheck: true;\n enterKeyHint: \"send\";\n onInput: () => void;\n onKeyDown: (e: ReactKeyboardEvent<HTMLDivElement>) => void;\n onCompositionStart: () => void;\n onCompositionEnd: () => void;\n onPaste: (e: ReactClipboardEvent<HTMLDivElement>) => void;\n onFocus: () => void;\n onBlur: () => void;\n };\n /** Current plain-text content of the editor (used by submit). */\n getPlainText: () => string;\n /** Imperative focus / blur (used by the parent's imperative handle). */\n focus: () => void;\n blur: () => void;\n}\n\n/**\n * Owns every concern that's specific to running the autocomplete on top of a\n * contentEditable host: composition state, caret tracking, selectionchange,\n * `beforeinput` interception, paste sanitization, plaintext-only feature\n * detection, segment rendering, post-promote refocus, and re-edit caret park.\n *\n * The hook stays React-agnostic above the contentEditable adapter — see\n * `core/render/renderEditable.ts` for the underlying DOM mutations. Callers\n * spread `editorProps` onto a `<div>` (className is theirs to provide).\n */\nexport function useContentEditableEditor(\n opts: UseContentEditableEditorOptions,\n): UseContentEditableEditorReturn {\n const {\n segments,\n showChipIcons = true,\n showChipImages = true,\n showChipRemove = false,\n blockingParamIds,\n focusInputOnSelect,\n removeParam,\n newParamId,\n editingParam,\n editingIdentified,\n editingAnchor,\n caretOffset,\n placeholderText,\n hintSuggestions,\n isFocused,\n isDropdownOpen,\n listboxId,\n activeDescendantId,\n autoFocus,\n handleTextChange,\n handleCompositionText,\n handleKeyDown,\n handleCaretAfterInput,\n handleCaretMove,\n startEditingParam,\n replaceEditingRange,\n setFocused,\n } = opts;\n\n const inputRef = useRef<HTMLDivElement>(null);\n const composingRef = useRef(false);\n const lastSeenParamIdRef = useRef(\"\");\n const lastEditingIdRef = useRef(\"\");\n const caretOffsetRef = useRef<number | null>(null);\n // Set in the input event handler; selectionchange suppresses post-input\n // caret-move tracking within this window so typing doesn't get treated\n // as navigation.\n const lastInputAtRef = useRef(0);\n\n caretOffsetRef.current = caretOffset;\n const focusModeRef = useRef(focusInputOnSelect);\n focusModeRef.current = focusInputOnSelect;\n\n // Auto-focus on mount once the host element is mounted.\n useEffect(() => {\n if (!autoFocus) return;\n const el = inputRef.current;\n if (!el) return;\n if (document.activeElement === el) {\n setFocused(true);\n } else {\n el.focus();\n }\n // Focusing an empty contentEditable doesn't always create a selection\n // Range, so no caret blinks until the user clicks. Place a collapsed caret\n // at the start so the field is visibly ready immediately. Skip if the caret\n // already sits inside the editor (e.g. the user clicked before this ran).\n const doc = el.ownerDocument ?? document;\n const sel = doc.getSelection();\n const caretInside = sel && sel.rangeCount > 0 && el.contains(sel.anchorNode);\n if (sel && !caretInside) {\n const range = doc.createRange();\n range.selectNodeContents(el);\n range.collapse(true);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n }, [autoFocus, setFocused]);\n\n // `selectionchange` is the canonical signal for \"caret moved\" in\n // contentEditable land. Anchored inside the editor: a caret that lands\n // inside a `<strong>` triggers re-edit mode; a caret that leaves the\n // current editing region exits it.\n useEffect(() => {\n const el = inputRef.current;\n if (!el) return;\n const doc = el.ownerDocument ?? document;\n const onSelectionChange = () => {\n const sel = doc.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 range\n // selection (Cmd+A, shift-arrow, drag) anchors at its start, which lands\n // inside the first `<strong>` whenever the input begins with a chip —\n // starting re-edit there parks the caret on that chip and destroys the\n // 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 const enclosing = strong?.dataset.paramId ?? null;\n // Either kind counts as \"already open on this chip\" — without the\n // identified id here, every caret tick inside a date span would re-enter\n // the pick it is already in.\n const openChipId = editingParam?.id ?? editingIdentified?.id ?? null;\n if (enclosing && enclosing !== openChipId) {\n startEditingParam(enclosing);\n return;\n }\n if (performance.now() - lastInputAtRef.current < 50) return;\n handleCaretMove(getCursorOffset(el));\n };\n doc.addEventListener(\"selectionchange\", onSelectionChange);\n return () => doc.removeEventListener(\"selectionchange\", onSelectionChange);\n }, [editingParam, editingIdentified, startEditingParam, handleCaretMove]);\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 above can miss the tapped chip or\n // open the wrong one. The click target is the element actually hit and\n // overrides it; `keepCaretOnChip` then pulls a stray caret onto the tapped\n // chip so the next selectionchange doesn't close or redirect what the tap\n // opened.\n useEffect(() => {\n const el = inputRef.current;\n if (!el) return;\n const onClick = (e: MouseEvent) => {\n const id = chipIdFromTap(el, e.target);\n if (!id) return;\n startEditingParam(id);\n keepCaretOnChip(el, id);\n };\n el.addEventListener(\"click\", onClick);\n return () => el.removeEventListener(\"click\", onClick);\n }, [startEditingParam]);\n\n // The chips' \"×\": the listeners shared with the vanilla and Angular editors,\n // attached only while the option is on or a chip that empties the search\n // draws one (the listeners include a non-passive touchstart).\n const listensForChipRemove = showChipRemove || (blockingParamIds?.length ?? 0) > 0;\n useEffect(() => {\n const el = inputRef.current;\n if (!el || !removeParam || !listensForChipRemove) return;\n return attachChipRemove(el, removeParam);\n }, [removeParam, listensForChipRemove]);\n\n // Render segments imperatively into the contentEditable. useLayoutEffect\n // runs before paint so the caret is restored without a one-frame flicker.\n // MUST run before the post-promote refocus + re-edit caret park effects\n // below — keep this declaration order.\n useLayoutEffect(() => {\n const el = inputRef.current;\n if (!el) return;\n renderEditableContent({\n input: el,\n segments: segments as Segment[],\n newParamId,\n editingParamId: editingParam?.id ?? null,\n placeholderText: placeholderText ?? \"\",\n isFocused,\n showChipIcons,\n showChipImages,\n showChipRemove,\n blockingParamIds,\n hintOptions: startingHintOptions(hintSuggestions ?? []),\n });\n }, [\n segments,\n newParamId,\n editingParam,\n placeholderText,\n hintSuggestions,\n isFocused,\n showChipIcons,\n showChipImages,\n showChipRemove,\n blockingParamIds,\n ]);\n\n // The empty box's hint keeps a timer; drop it with the editor.\n useEffect(() => {\n const el = inputRef.current;\n return () => {\n if (el) cancelStartingHint(el);\n };\n }, []);\n\n // After a fresh option selection (newParamId changed), refocus the editor\n // and place the caret at the end of the just-promoted segment. Mirrors the\n // vanilla core's `justSelected` logic in renderInput.ts, including where a\n // pick leaves the editor unfocused (a touch device by default,\n // `focusInputOnSelect`): see `settlePickFocus`.\n useLayoutEffect(() => {\n const previous = lastSeenParamIdRef.current;\n const current = newParamId ?? \"\";\n lastSeenParamIdRef.current = current;\n if (!current || current === previous) return;\n const el = inputRef.current;\n if (!el) return;\n // Every promote path stamps `caretOffset` with the position right after\n // the new param's trailing space, so use it. Read via ref so the effect\n // stays gated on newParamId (not every caret-move).\n const desired = caretOffsetRef.current ?? plainTextLength(el);\n settlePickFocus(el, desired, focusesInputOnSelect(focusModeRef.current));\n }, [newParamId]);\n\n // On re-edit-mode entry, park the caret just BEFORE the bold strong so\n // typing/backspace via the `beforeinput` intercept replaces the param\n // cleanly (instead of inserting mid-letter inside the bold span).\n useLayoutEffect(() => {\n const previous = lastEditingIdRef.current;\n const current = editingParam?.id ?? \"\";\n lastEditingIdRef.current = current;\n if (!current || current === previous || editingAnchor == null) return;\n const el = inputRef.current;\n if (!el) return;\n setCursorOffset(el, editingAnchor);\n }, [editingParam, editingAnchor]);\n\n const fireInput = useCallback(() => {\n const el = inputRef.current;\n if (!el) return;\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 (composingRef.current) {\n handleCompositionText(next);\n return;\n }\n handleTextChange(next);\n }, [handleTextChange, handleCompositionText]);\n\n const handleInputEvent = useCallback(() => {\n lastInputAtRef.current = performance.now();\n fireInput();\n const el = inputRef.current;\n if (el) handleCaretAfterInput(getCursorOffset(el));\n }, [fireInput, handleCaretAfterInput]);\n\n // React's synthetic `onBeforeInput` is wired to the legacy `textInput`\n // event and doesn't reliably fire for `delete*` input types, so we attach\n // a native `beforeinput` listener directly on the editor.\n useEffect(() => {\n const el = inputRef.current;\n if (!el) return;\n const onBeforeInput = (e: Event) => {\n const inputEvent = e as InputEvent;\n const t = inputEvent.inputType;\n if (t === \"insertParagraph\" || t === \"insertLineBreak\" || t === \"insertFromDrop\") {\n e.preventDefault();\n return;\n }\n if (t.startsWith(\"insert\") || t.startsWith(\"delete\")) {\n const replacement = t.startsWith(\"delete\") ? \"\" : (inputEvent.data ?? \"\");\n if (replaceEditingRange(replacement)) {\n e.preventDefault();\n }\n }\n };\n el.addEventListener(\"beforeinput\", onBeforeInput);\n return () => el.removeEventListener(\"beforeinput\", onBeforeInput);\n }, [replaceEditingRange]);\n\n const handleCompositionStart = useCallback(() => {\n composingRef.current = true;\n inputRef.current?.setAttribute(\"data-aia-composing\", \"true\");\n }, []);\n\n const handleCompositionEnd = useCallback(() => {\n composingRef.current = false;\n inputRef.current?.removeAttribute(\"data-aia-composing\");\n fireInput();\n }, [fireInput]);\n\n const handlePaste = useCallback(\n (e: ReactClipboardEvent<HTMLDivElement>) => {\n e.preventDefault();\n const el = inputRef.current;\n if (!el) return;\n const text = (e.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 fireInput();\n },\n [fireInput],\n );\n\n const handleKeyDownReact = useCallback(\n (e: ReactKeyboardEvent<HTMLDivElement>) => handleKeyDown(e),\n [handleKeyDown],\n );\n\n const handleFocus = useCallback(() => setFocused(true), [setFocused]);\n const handleBlur = useCallback(() => setFocused(false), [setFocused]);\n\n const focus = useCallback(() => inputRef.current?.focus(), []);\n const blur = useCallback(() => inputRef.current?.blur(), []);\n const getPlainText = useCallback(() => {\n const el = inputRef.current;\n return el ? extractPlainText(el) : \"\";\n }, []);\n\n const ceMode = supportsPlaintextOnly() ? \"plaintext-only\" : \"true\";\n\n return {\n inputRef,\n editorProps: {\n ref: inputRef,\n contentEditable: ceMode as unknown as boolean,\n suppressContentEditableWarning: true,\n tabIndex: 0,\n role: \"combobox\",\n \"aria-autocomplete\": \"list\",\n \"aria-haspopup\": \"listbox\",\n \"aria-controls\": listboxId,\n \"aria-expanded\": isDropdownOpen,\n \"aria-activedescendant\": activeDescendantId,\n spellCheck: true,\n enterKeyHint: \"send\",\n onInput: handleInputEvent,\n onKeyDown: handleKeyDownReact,\n onCompositionStart: handleCompositionStart,\n onCompositionEnd: handleCompositionEnd,\n onPaste: handlePaste,\n onFocus: handleFocus,\n onBlur: handleBlur,\n },\n getPlainText,\n focus,\n blur,\n };\n}\n"],"mappings":"AACA,OACE,qBAAAA,GAGA,WAAAC,GACA,WAAAC,GAGA,uBAAAC,GACA,yBAAAC,GAGA,6BAAAC,GAEA,iBAAAC,GAGA,wBAAAC,GACA,cAAAC,GACA,mBAAAC,GACA,qBAAAC,GACA,eAAAC,GAGA,cAAAC,GACA,WAAAC,GACA,kBAAAC,GAGA,qBAAAC,GACA,cAAAC,GACA,oBAAAC,GACA,kBAAAC,GACA,sBAAAC,GACA,kBAAAC,GAEA,eAAAC,GACA,6BAAAC,GACA,uBAAAC,GACA,aAAAC,GACA,kBAAAC,GACA,uBAAAC,GACA,aAAAC,GAGA,0BAAAC,GACA,uBAAAC,GACA,4BAAAC,GACA,yBAAAC,GACA,oBAAAC,GACA,iBAAAC,GACA,oBAAAC,GACA,kBAAAC,GACA,qBAAAC,OACK,sCCvDP,OACE,cAAAC,GACA,eAAAC,GACA,aAAAC,GACA,uBAAAC,GACA,mBAAAC,GACA,WAAAC,GACA,UAAAC,OACK,QCRP,GAAI,OAAO,SAAa,KAAe,CAAC,SAAS,eAAe,mBAAmB,EAAG,CACpF,IAAMC,EAAI,SAAS,cAAc,OAAO,EACxCA,EAAE,GAAK,oBACPA,EAAE,YAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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+J,GAAA,CACE,GAAGvD,EACJ,UAAWqD,GACX,eAAgBlH,GAChB,qBAAsBC,GACtB,kBAAmBC,GACnB,gBAAiB0G,GAAcC,GAAsB,OACrD,UAAW7F,GACb,EAGA1D,GAAC,OAAI,UAAW6J,GAAO,aAAc,yBAAuB,GAAG,QAASL,GACtE,UAAAxJ,GAAC,OAAI,IAAK+D,GAAe,UAAW8F,GAAO,WAAY,kBAAgB,GACrE,UAAA9J,GAAC,OAAK,GAAG8H,GAAa,UAAWgC,GAAO,MAAO,iBAAe,GAAG,EAChEF,KAAoBrE,IAAaX,GAAgB,OAAS,IACzD5E,GAAC,QACC,IAAK+D,GACL,UAAW+F,GAAO,kBAClB,+BAA6B,GAE7B,SAAA9J,GAACgK,GAAA,CACC,MAAOpF,GACP,gBAAiB,EACjB,eAAgBS,EAChB,aAAcR,GACd,QAASU,GACX,EACF,GAEJ,EACC9B,IAAiB,KAAO,KAAOA,IAAiB,OAC/CzD,GAACiK,GAAA,CACC,SAAU,CAAClB,GACX,MAAOA,IAAavD,GACpB,KAAM6B,GACN,QAASiC,GACT,MAAOY,GAAapJ,CAAQ,EAAE,OAChC,EAIAd,GAAC,QACC,kBAAgB,GAChB,uBAAqB,GAGrB,wBAAuBqH,GAAe,OAAS,OAC/C,YAAWA,GAAe,GAAO,OACjC,UAAWyC,GAAO,WAClB,QAAUJ,GAAM,CACTX,KACLW,EAAE,gBAAgB,EAClBJ,GAAmB,EACrB,EAEC,SAAA7F,EACH,GAEJ,GACF,CAEJ,CACF","names":["buildSubmitResult","cellDay","cellIso","DATE_RANGE_META_END","DATE_RANGE_META_START","DEFAULT_OPTION_COUNT_UNIT","dateCellMarks","focusesInputOnSelect","formatDate","formatDateRange","formatOptionCount","formatPlace","formatTime","isoDate","isTouchPrimary","LOCATION_META_KEY","monthLabel","optionCountLabel","optionHasImage","optionImageSources","optionImageSrc","optionLabel","optionsShowLeadingVisuals","PRODUCT_PATH_PREFIX","parseDate","parseLooseDate","parseLooseDateRange","parseTime","productFromMatchedItem","productImageSources","productsFromCustomFields","sanitizeOptionIconSvg","selectedRangeFor","TIME_META_KEY","visibleDateRange","WEEKDAY_LABELS","withSkippedParams","forwardRef","useCallback","useEffect","useImperativeHandle","useLayoutEffect","useMemo","useRef","s","AIAutocomplete_module_css_default","attachScrollArrow","attachViewportFit","containScroll","dateFloorFor","destroyPanelMorph","findMultiSelectDone","fitMultiSelectDone","hasSkippablePill","isCalendarFormat","labelTraditionalAutocomplete","panelMorphKey","queryLive","settlePanelMorph","syncPanelHug","uiStringsFor","useEffect","useLayoutEffect","useRef","useState","s","s","AIAutocompleteDropdown_module_css_default","cellDay","cellIso","dateCellMarks","isDimmedDay","isoDate","monthLabel","visibleDateRange","WEEKDAY_LABELS","useState","s","DateGrid_module_css_default","jsx","jsxs","WEEKDAY_KEYS","DateGrid","options","activeIndex","listboxId","view","selection","onSelect","onHighlight","onUnhighlight","onPreviousMonth","onNextMonth","today","isoDate","range","visibleDateRange","cellIso","DateGrid_module_css_default","e","monthLabel","WEEKDAY_LABELS","label","i","option","DateCell","isDimmedDay","dateCellMarks","id","index","isHighlighted","isToday","isPast","marks","pressed","setPressed","useState","day","cellDay","handleSelect","className","ATTRIBUTION_URL","buildAttributionUrl","getFooterHint","uiStringsFor","useEffect","useState","s","jsx","Cluster","gap","align","justify","noWrap","inline","className","children","rest","style","props","s","DropdownFooter_module_css_default","jsx","jsxs","DropdownFooter","isOptionHighlighted","isInputEmpty","strings","uiStringsFor","key","hint","getFooterHint","brandHref","setBrandHref","useState","ATTRIBUTION_URL","useEffect","buildAttributionUrl","DropdownFooter_module_css_default","Cluster","useEffect","useLayoutEffect","useRef","s","LocationField_module_css_default","jsx","jsxs","fieldSeq","activeElementFor","node","selectionFor","captureCaret","el","selection","range","focusWithCaret","target","saved","PIN","LocationField_module_css_default","SEARCH","LocationField","view","searchLabel","noResultsLabel","useTypedLabel","widgetFocused","reediting","visible","interactive","onQuery","onMove","onCommit","onFocusChange","inputRef","useRef","rootRef","fieldRef","returnTo","returnRange","returning","declined","wasReediting","claimed","widgetFocusedRef","onFocusChangeRef","reportFocus","focused","hasFocus","input","rememberReturn","root","active","rememberKeyboardReturn","from","fieldId","rowIdPrefix","useEffect","handBack","useLayoutEffect","answered","trimmed","highlightedId","body","place","index","e","isSmartSuggestion","isTraditionalAutocompleteSuggestion","SMART_SUGGESTION_SPARKLE_SVG","s","ParamPill_module_css_default","Fragment","jsx","jsxs","PARAM_PILL_OPACITY","ParamPill","label","state","active","rounded","loading","smartSuggestion","completionHeader","onClick","className","ParamPill_module_css_default","e","SMART_SUGGESTION_SPARKLE_SVG","s","PillList_module_css_default","jsx","FALLBACK_SKELETON_WIDTHS","pillStateForIndex","index","PillList","pills","activePillIndex","onSelectPill","activeSelected","rounded","loading","PillList_module_css_default","w","i","ParamPill_module_css_default","PARAM_PILL_OPACITY","pill","selected","ParamPill","isSmartSuggestion","isTraditionalAutocompleteSuggestion","attachProductRowWheel","productImageSources","productImageSrc","productInitial","productPhotoFill","uiStringsFor","useEffect","useRef","useState","s","ProductStrip_module_css_default","jsx","jsxs","ProductStrip","products","listboxId","onSelect","busyProductId","onAddToCart","onFocusChange","focusable","loading","layout","imageFallback","showVendor","strings","uiStringsFor","hasProducts","rowRef","useRef","useEffect","row","attachProductRowWheel","labelId","ProductStrip_module_css_default","product","i","ProductCard","id","busy","soldOut","addToCart","hasCart","photoFill","setPhotoFill","useState","handleBlur","e","handleClick","ProductMedia","productImageSources","productImageSrc","CartButton","cartIdentity","field","label","onFocus","onBlur","state","setState","stateRef","productRef","mounted","set","next","press","pending","error","sources","title","fallback","onPhotoFill","failed","setFailed","src","hasImage","loadedSrc","setLoadedSrc","showInitial","productPhotoFill","count","productInitial","isOptionsGridMobileViewport","measureOptionsGrid","needsOptionsGridMeasurement","OPTIONS_GRID_MOBILE_QUERY","optionEnterDelayMs","optionsShowLeadingVisuals","planOptionsGrid","pointerMayHighlight","releasePanelHug","sameOptionRows","syncHighlightScroll","syncPanelHug","useEffect","useLayoutEffect","useRef","useState","optionsGridTemplateColumns","useLayoutEffect","useRef","s","jsx","Grid","min","max","gap","scroll","maxHeight","scrollResetKey","cols","template","innerRef","className","children","rest","gridRef","useRef","useLayoutEffect","el","style","optionsGridTemplateColumns","clearPanelMorphPressLook","formatOptionCount","highlightParts","isMultiSelectToggleTap","OPTION_ENTER_DELAY_VAR","optionImageSources","optionLabel","sanitizeOptionIconSvg","useEffect","useMemo","useRef","useState","s","SuggestionItem_module_css_default","Fragment","jsx","jsxs","PRESS_HOLD_MS","REPEAT_PICK_MS","SuggestionItem","option","isHighlighted","checked","onSelect","onHighlight","onUnhighlight","id","loading","showIcon","showImage","showCount","scrollHint","enterDelayMs","enterDelay","useState","pressed","setPressed","imageSources","optionImageSources","imageSrc","failedSrcs","setFailedSrcs","shownSrc","src","collage","url","collageLoaded","setCollageLoaded","loadedSrc","setLoadedSrc","iconHtml","useMemo","sanitizeOptionIconSvg","countLabel","formatOptionCount","timerRef","useRef","rowRef","lastPickRef","useEffect","handleSelect","event","row","commit","isMultiSelectToggleTap","tick","now","clearPanelMorphPressLook","className","SuggestionItem_module_css_default","OPTION_ENTER_DELAY_VAR","e","failed","highlightParts","optionLabel","part","index","jsx","useIsMobile","isMobile","setIsMobile","useState","isOptionsGridMobileViewport","useEffect","mq","OPTIONS_GRID_MOBILE_QUERY","onChange","SuggestionGrid","options","activeIndex","picked","onSelect","onHighlight","onUnhighlight","listboxId","loading","groupKey","optionsPosition","showIcons","showImages","showCounts","gridEl","useRef","measuredPlan","setMeasuredPlan","measuredRows","useLayoutEffect","sameOptionRows","el","shouldMeasure","needsOptionsGridMeasurement","panel","releasePanelHug","measured","measureOptionsGrid","planOptionsGrid","plan","syncPanelHug","shownIndex","syncHighlightScroll","leadingVisuals","optionsShowLeadingVisuals","Grid","option","i","SuggestionItem","event","pointerMayHighlight","optionEnterDelayMs","formatTime","TIME_WHEEL_COLUMNS","TIME_WHEEL_ROW_HEIGHT","timeWheelIndex","timeWheelIndexFromScroll","timeWheelRows","withTimeWheelIndex","Fragment","useEffect","useLayoutEffect","useRef","s","TimeWheel_module_css_default","jsx","jsxs","SCROLL_SETTLE_MS","TimeWheel","view","label","doneLabel","interactive","onTimeChange","onTimeCommit","TimeWheel_module_css_default","e","formatTime","TIME_WHEEL_COLUMNS","column","Fragment","WheelColumn","minutes","ref","useRef","syncedTop","settle","latest","index","timeWheelIndex","useLayoutEffect","el","top","TIME_WHEEL_ROW_HEIGHT","useEffect","settleNow","current","next","timeWheelIndexFromScroll","withTimeWheelIndex","onScroll","timeWheelRows","row","i","s","jsx","Stack","space","align","className","children","rest","style","jsx","jsxs","useIsoLayoutEffect","useEffect","useLayoutEffect","FALLBACK_SKELETON_BAR_WIDTHS","NOOP_PRODUCT_SELECT","NOOP_MONTH","NOOP_TIME_CHANGE","_minutes","NOOP_TIME_COMMIT","NOOP_LOCATION_QUERY","_query","NOOP_LOCATION_MOVE","_delta","NOOP_LOCATION_COMMIT","_index","NOOP_LOCATION_FOCUS","_focused","useResolvedMode","mode","prefersDark","systemDark","setSystemDark","useState","mq","onChange","useScrollArrow","rootRef","buttonRef","boundRef","useRef","root","button","grid","queryLive","attachScrollArrow","useViewportFit","isVisible","visibleRef","fitRef","attachViewportFit","AIAutocompleteDropdown","suggestions","activeIndex","onSelect","onHighlight","onUnhighlight","isOpen","id","className","pills","onPillClick","showPills","onSkip","showSkipButton","showOptionIcons","showOptionImages","showOptionCounts","skipDisabled","activeSelected","isLoading","skeletonExiting","isInputEmpty","language","products","onProductSelect","onProductAddToCart","onProductFocusChange","productsLayout","productImageFallback","showProductVendor","formatType","dateView","selectedDateIso","selectedDateRange","dateRangeStart","dateReferences","onPreviousMonth","onNextMonth","timeView","multiSelectView","onMultiSelectCommit","onSeeAllResults","seeAllBusy","busyProductId","fullWidth","onTimeChange","onTimeCommit","locationView","isReediting","onLocationQuery","onLocationMove","onLocationCommit","onLocationFocusChange","isFocused","optionsPosition","resolvedMode","selfScope","scrollArrowRef","containScroll","liveOptions","liveHasRealPills","liveHasProducts","liveHasTimeWheel","liveHasLocationField","fitMultiSelectDone","findMultiSelectDone","syncPanelHug","snapshot","lastVisibleRef","content","strings","uiStringsFor","activeSuggestion","options","isOptionHighlighted","shownPills","labelTraditionalAutocomplete","hasRealPills","showsRealPills","showsLoadingPills","showsPillBar","showsSkip","hasSkippablePill","activePillLabel","isDate","isCalendarFormat","showsOptions","showsDateGrid","showsTimeWheel","showsLocationField","showsFallbackSkeleton","stripProducts","morphKey","panelMorphKey","settlePanelMorph","el","destroyPanelMorph","AIAutocompleteDropdown_module_css_default","e","Stack","Cluster","PillList","SuggestionGrid","event","DateGrid","dateFloorFor","TimeWheel","LocationField","w","ProductStrip","DropdownFooter","buildSubmitResult","focusEditorFromTap","ModeController","setCursorOffset","uiStringsFor","watchEditorHeight","uiStringsFor","s","SubmitButton_module_css_default","jsx","SubmitButton","disabled","ready","busy","onClick","label","uiStringsFor","SubmitButton_module_css_default","e","CoreAIAutocomplete","dateSelectionFor","dropdownPillsFor","editingSuggestion","HANDOFF_NOT_HANDLED","identifiedParamLabel","withoutTraditionalAutocomplete","useCallback","useEffect","useMemo","useRef","useState","useRef","useOptionOverridesProxy","optionOverrides","liveRef","key","proxyRef","overrides","type","forward","query","signal","suggestion","fn","useRef","useProductsProxy","products","productsRef","proxyRef","query","signal","config","raw","enabled","EMPTY_RESULT","EMPTY_STATE","useAIAutocomplete","onSubmit","onResult","onError","optionOverrides","maskCompletedText","apiConfig","additionalContext","language","currency","productId","visitorId","analyticsConsent","columns","dropdownTrigger","optionsPosition","closeDropdownOnBlur","focusInputOnSelect","startingState","prependPlaceholder","allOption","showNonTappableOptions","locationSearch","showOptionIcons","showOptionImages","showOptionCounts","showSkipButton","showProducts","submitProgress","awaitAnswerOnSubmit","submitAnswerTimeoutMs","productImageFallback","showProductVendor","onFocus","onBlur","controlledValue","controlledParams","onChangeProp","onParamsChange","products","mapProducts","onProductSelect","onProductAddToCart","source","setCursor","instanceRef","useRef","coreState","setCoreState","useState","onSubmitRef","onResultRef","onErrorRef","onChangeRef","onParamsChangeRef","onFocusRef","onBlurRef","setCursorRef","onProductSelectRef","onProductAddToCartRef","visitorIdRef","resolveVisitorId","v","hasVisitorId","analyticsConsentRef","readAnalyticsConsent","c","productsProxy","useProductsProxy","mapperRef","forwardMapper","cards","items","mapper","mapperProxy","overridesProxy","useOptionOverridesProxy","useEffect","instance","CoreAIAutocomplete","args","product","HANDOFF_NOT_HANDLED","offset","unsub","state","mountedVisitorIdRef","consentKey","mountedConsentKeyRef","apiConfigJson","additionalContextJson","productsMountedRef","actionsRef","value","e","native","focused","paramId","replacement","index","result","returned","option","how","minutes","query","delta","actions","handleChange","useCallback","raw","newValue","handleKeyDownTextarea","text","completedParams","actionableSuggestions","activeSuggestion","pillSuggestions","useMemo","withoutTraditionalAutocomplete","listboxId","activeDescendantId","editingParam","editingIdentified","dropdownPill","editingSuggestion","identifiedParamLabel","dropdownActivePill","dropdownPills","dropdownPillsFor","dateSelection","dateSelectionFor","uiLoading","attachChipRemove","cancelStartingHint","chipIdFromTap","extractPlainText","focusesInputOnSelect","getCursorOffset","keepCaretOnChip","plainTextLength","renderEditableContent","setCursorOffset","settlePickFocus","startingHintOptions","useCallback","useEffect","useLayoutEffect","useRef","plaintextOnlyCache","supportsPlaintextOnly","probe","useContentEditableEditor","opts","segments","showChipIcons","showChipImages","showChipRemove","blockingParamIds","focusInputOnSelect","removeParam","newParamId","editingParam","editingIdentified","editingAnchor","caretOffset","placeholderText","hintSuggestions","isFocused","isDropdownOpen","listboxId","activeDescendantId","autoFocus","handleTextChange","handleCompositionText","handleKeyDown","handleCaretAfterInput","handleCaretMove","startEditingParam","replaceEditingRange","setFocused","inputRef","composingRef","lastSeenParamIdRef","lastEditingIdRef","caretOffsetRef","lastInputAtRef","focusModeRef","el","doc","sel","caretInside","range","onSelectionChange","anchor","startEl","enclosing","openChipId","onClick","e","id","listensForChipRemove","previous","current","desired","fireInput","raw","next","handleInputEvent","onBeforeInput","inputEvent","t","replacement","handleCompositionStart","handleCompositionEnd","handlePaste","text","node","handleKeyDownReact","handleFocus","handleBlur","focus","blur","getPlainText","ceMode","jsx","jsxs","resolveInitialMode","mode","AIAutocomplete","forwardRef","onSubmit","onResult","onError","optionOverrides","maskCompletedText","className","apiConfig","additionalContext","language","currency","productId","visitorId","analyticsConsent","columns","pillPlacement","optionsPosition","animations","optionsStyle","dropdownTrigger","closeDropdownOnBlur","focusInputOnSelect","startingState","prependPlaceholder","allOption","showNonTappableOptions","locationSearch","showOptionIcons","showChipIcons","showChipImages","showChipRemove","showOptionImages","showOptionCounts","showSkipButton","showProducts","submitProgress","awaitAnswerOnSubmit","submitAnswerTimeoutMs","productsLayout","productImageFallback","showProductVendor","autoFocus","onFocus","onBlur","value","controlledParams","onChangeProp","onParamsChange","products","mapProducts","onProductSelect","onProductAddToCart","submitButton","resetOnSubmit","seeAllResults","ref","containerRef","useRef","pillContainerRef","editorAreaRef","handleSubmitRef","modeControllerRef","editorInputRefHolder","useEffect","el","ModeController","handleSetCursor","useCallback","offset","setCursorOffset","completedParams","suggestionPills","setActivePill","skipActivePill","segments","newParamId","clearNewParamId","placeholderText","isFocused","isDropdownOpen","isActivePillSelected","blockingChips","isLoading","isReady","activeIndex","listboxId","handleTextChange","handleCompositionText","handleKeyDown","setFocused","editingParam","editingIdentified","editingAnchor","caretOffset","startEditingParam","removeParam","handleCaretAfterInput","handleCaretMove","replaceEditingRange","dropdownProps","reset","refreshProducts","prepareSubmit","getState","getResult","awaitSubmitResult","recordSubmit","holdSubmit","endSubmitProgress","getSearchId","getVisitorId","refreshAnalyticsConsent","isSubmitting","useAIAutocomplete","result","t","blockingParamIds","useMemo","chip","activeDescendantId","inputRef","editorProps","focus","blur","getPlainText","useContentEditableEditor","useLayoutEffect","container","editor","update","inner","cRect","eRect","ro","area","watchEditorHeight","useImperativeHandle","m","canSubmit","deliverSubmit","fromButton","answered","state","buildSubmitResult","returned","handleButtonSubmit","showsSeeAll","handleSeeAllResults","handleWrapperClick","e","focusEditorFromTap","showInlinePills","showDropdownPills","AIAutocomplete_module_css_default","AIAutocompleteDropdown","PillList","SubmitButton","uiStringsFor"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/AIAutocomplete.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/AIAutocomplete.module.css.js","../src/AIAutocompleteDropdown.tsx","plain-css:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/appearance.css.js","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/AIAutocompleteDropdown.module.css.js","../src/components/DateGrid.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/DateGrid.module.css.js","../src/components/DropdownFooter.tsx","plain-css:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/layout/Cluster.css.js","../src/layout/Cluster.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/DropdownFooter.module.css.js","../src/components/LocationField.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/LocationField.module.css.js","../src/components/PillList.tsx","../src/components/ParamPill.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/ParamPill.module.css.js","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/PillList.module.css.js","../src/components/ProductStrip.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/ProductStrip.module.css.js","../src/components/SuggestionGrid.tsx","../src/layout/Grid.tsx","plain-css:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/layout/Grid.css.js","../src/components/SuggestionItem.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/SuggestionItem.module.css.js","../src/components/TimeWheel.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/TimeWheel.module.css.js","plain-css:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/layout/Stack.css.js","../src/layout/Stack.tsx","../src/components/SubmitButton.tsx","css-module:/home/runner/work/ai-autocomplete-sdk-js/ai-autocomplete-sdk-js/packages/react/src/components/SubmitButton.module.css.js","../src/hooks/useAIAutocomplete.ts","../src/hooks/useOptionOverridesProxy.ts","../src/hooks/useProductsProxy.ts","../src/hooks/useContentEditableEditor.ts"],"sourcesContent":["export type { FocusInputOnSelect } from \"@magicx-eng/ai-autocomplete-vanilla\";\nexport {\n buildSubmitResult,\n // Date helpers, for turning a committed date back into a `Date` and for\n // rendering a custom calendar in Tier 3.\n cellDay,\n cellIso,\n // The metadata keys a committed range records its two ends under, so a\n // consumer reading them back never hardcodes the strings.\n DATE_RANGE_META_END,\n DATE_RANGE_META_START,\n // Option pictures and counts, for a custom dropdown that draws `image_url`\n // and `item_count` itself.\n DEFAULT_OPTION_COUNT_UNIT,\n // Range helpers, for a custom calendar that answers a span in two taps.\n dateCellMarks,\n // Focus after a pick: whether the SDK focuses the input, for code that\n // owns one (see `focusInputOnSelect`).\n focusesInputOnSelect,\n formatDate,\n formatDateRange,\n formatOptionCount,\n formatPlace,\n // Time helpers: the written form a committed time takes, reading it back,\n // and the metadata key the exact 24-hour time is recorded under.\n formatTime,\n isoDate,\n isTouchPrimary,\n // Location search: the metadata key a picked place's ID is recorded under,\n // and how a place reads once picked.\n LOCATION_META_KEY,\n monthLabel,\n optionCountLabel,\n optionHasImage,\n optionImageSources,\n optionImageSrc,\n // Option icons, for a custom dropdown that draws `icon_svg` itself.\n optionLabel,\n optionsShowLeadingVisuals,\n PRODUCT_PATH_PREFIX,\n parseDate,\n parseLooseDate,\n parseLooseDateRange,\n parseTime,\n // Product strip helpers (with PRODUCT_PATH_PREFIX above), for a custom\n // strip fed from `customFields`.\n productFromMatchedItem,\n productImageSources,\n productsFromCustomFields,\n sanitizeOptionIconSvg,\n selectedRangeFor,\n TIME_META_KEY,\n visibleDateRange,\n WEEKDAY_LABELS,\n withSkippedParams,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nexport { AIAutocomplete } from \"./AIAutocomplete\";\nexport { AIAutocompleteDropdown } from \"./AIAutocompleteDropdown\";\nexport { useAIAutocomplete } from \"./hooks/useAIAutocomplete\";\nexport type {\n AccessTokenConfig,\n AccessTokenResult,\n AIAutocompleteDropdownProps,\n AIAutocompleteHandle,\n AIAutocompleteProps,\n APIConfig,\n APIKeyConfig,\n AppearanceMode,\n AutocompleteResult,\n BlockingChip,\n BlockingFilter,\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 UseAIAutocompleteOptions,\n UseAIAutocompleteReturn,\n} from \"./types\";\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n} from \"react\";\nimport styles from \"./AIAutocomplete.module.css\";\nimport { AIAutocompleteDropdown } from \"./AIAutocompleteDropdown\";\nimport \"./appearance.css\";\nimport {\n type AppearanceMode,\n type AutocompleteResult,\n buildSubmitResult,\n focusEditorFromTap,\n ModeController,\n setCursorOffset,\n uiStringsFor,\n watchEditorHeight,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { PillList } from \"./components/PillList\";\nimport { SubmitButton } from \"./components/SubmitButton\";\nimport { useAIAutocomplete } from \"./hooks/useAIAutocomplete\";\nimport { useContentEditableEditor } from \"./hooks/useContentEditableEditor\";\nimport type { AIAutocompleteHandle, AIAutocompleteProps } from \"./types\";\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\nexport const AIAutocomplete = forwardRef<AIAutocompleteHandle, AIAutocompleteProps>(\n function AIAutocomplete(\n {\n onSubmit,\n onResult,\n onError,\n optionOverrides,\n maskCompletedText,\n className,\n apiConfig,\n additionalContext,\n language,\n currency,\n productId,\n visitorId,\n analyticsConsent,\n columns,\n pillPlacement = \"dropdown\",\n mode = \"auto\",\n optionsPosition = \"below\",\n animations = true,\n optionsStyle = \"floating\",\n dropdownTrigger,\n closeDropdownOnBlur,\n focusInputOnSelect,\n startingState,\n prependPlaceholder,\n allOption,\n showNonTappableOptions,\n locationSearch,\n showOptionIcons = true,\n showChipIcons = true,\n showChipImages = true,\n showChipRemove = false,\n showOptionImages = true,\n showOptionCounts = true,\n showSkipButton,\n showProducts,\n submitProgress,\n awaitAnswerOnSubmit,\n submitAnswerTimeoutMs,\n productsLayout,\n productImageFallback,\n showProductVendor,\n autoFocus = true,\n onFocus,\n onBlur,\n value,\n completedParams: controlledParams,\n onChange: onChangeProp,\n onParamsChange,\n products,\n mapProducts,\n onProductSelect,\n onProductAddToCart,\n submitButton,\n resetOnSubmit = true,\n seeAllResults = false,\n },\n ref,\n ) {\n const containerRef = useRef<HTMLDivElement>(null);\n const pillContainerRef = useRef<HTMLSpanElement>(null);\n const editorAreaRef = useRef<HTMLDivElement>(null);\n const handleSubmitRef = useRef<(result: AutocompleteResult) => void | PromiseLike<unknown>>(\n () => {},\n );\n const modeControllerRef = useRef<ModeController | null>(null);\n // Holds the editor's input *ref object* (not its current value) so the\n // setCursor callback — defined before useContentEditableEditor runs — can\n // dereference the live DOM element at call time without a one-render lag.\n const editorInputRefHolder = useRef<React.RefObject<HTMLDivElement> | null>(null);\n\n useEffect(() => {\n const el = containerRef.current;\n if (!el) return;\n if (modeControllerRef.current) {\n modeControllerRef.current.setMode(mode);\n } else {\n modeControllerRef.current = new ModeController(el, mode);\n }\n return () => {\n modeControllerRef.current?.destroy();\n modeControllerRef.current = null;\n };\n }, [mode]);\n\n const handleSetCursor = useCallback((offset: number) => {\n const el = editorInputRefHolder.current?.current;\n if (!el) return;\n el.focus();\n setCursorOffset(el, offset);\n }, []);\n\n const {\n completedParams,\n suggestionPills,\n setActivePill,\n skipActivePill,\n segments,\n newParamId,\n clearNewParamId,\n placeholderText,\n isFocused,\n isDropdownOpen,\n isActivePillSelected,\n blockingChips,\n isLoading,\n isReady,\n activeIndex,\n listboxId,\n handleTextChange,\n handleCompositionText,\n handleKeyDown,\n setFocused,\n editingParam,\n editingIdentified,\n editingAnchor,\n caretOffset,\n startEditingParam,\n removeParam,\n handleCaretAfterInput,\n handleCaretMove,\n replaceEditingRange,\n dropdownProps,\n reset,\n refreshProducts,\n prepareSubmit,\n getState,\n getResult,\n awaitSubmitResult,\n recordSubmit,\n holdSubmit,\n endSubmitProgress,\n getSearchId,\n getVisitorId,\n refreshAnalyticsConsent,\n isSubmitting,\n } = useAIAutocomplete({\n onSubmit: (result) => handleSubmitRef.current(result),\n onResult,\n onError,\n optionOverrides,\n maskCompletedText,\n apiConfig,\n additionalContext,\n language,\n currency,\n productId,\n visitorId,\n analyticsConsent,\n columns,\n dropdownTrigger,\n optionsPosition,\n closeDropdownOnBlur,\n focusInputOnSelect,\n startingState,\n prependPlaceholder,\n allOption,\n showNonTappableOptions,\n locationSearch,\n showOptionIcons,\n showOptionImages,\n showOptionCounts,\n showSkipButton,\n showProducts,\n submitProgress,\n awaitAnswerOnSubmit,\n submitAnswerTimeoutMs,\n onFocus,\n onBlur,\n value,\n completedParams: controlledParams,\n onChange: onChangeProp,\n onParamsChange,\n products,\n mapProducts,\n onProductSelect,\n onProductAddToCart,\n source: \"full-sdk\",\n setCursor: handleSetCursor,\n });\n\n // Shimmer auto-clear after the animation finishes.\n useEffect(() => {\n if (!newParamId) return;\n const t = window.setTimeout(() => clearNewParamId(), 650);\n return () => window.clearTimeout(t);\n }, [newParamId, clearNewParamId]);\n\n const blockingParamIds = useMemo(\n () => blockingChips.map((chip) => chip.paramId),\n [blockingChips],\n );\n\n const activeDescendantId = activeIndex >= 0 ? `${listboxId}-option-${activeIndex}` : undefined;\n\n const { inputRef, editorProps, focus, blur, getPlainText } = useContentEditableEditor({\n segments,\n newParamId,\n editingParam,\n editingIdentified,\n editingAnchor,\n caretOffset,\n placeholderText,\n hintSuggestions: pillPlacement === \"inline\" ? [] : suggestionPills,\n isFocused,\n showChipIcons,\n showChipImages,\n showChipRemove,\n blockingParamIds,\n removeParam,\n focusInputOnSelect,\n isDropdownOpen,\n listboxId,\n activeDescendantId,\n autoFocus,\n handleTextChange,\n handleCompositionText,\n handleKeyDown,\n handleCaretAfterInput,\n handleCaretMove,\n startEditingParam,\n replaceEditingRange,\n setFocused,\n });\n\n // Wire the holder to the hook's ref. The ref *object* is stable across\n // renders, so this assignment is idempotent and reaches the live DOM\n // element via `.current` without snapshotting null on the first render.\n editorInputRefHolder.current = inputRef;\n\n // The pill list sits inline-adjacent to the editor and carries an 8px\n // left margin so it doesn't butt against the editor's text. When the\n // editor's text fills its line and the pill list wraps to a new line,\n // that margin becomes a stray indent at the start of the wrapped line —\n // detect that case and drop the margin via a data attribute the CSS\n // keys off. The wrap detection (pill row's top vs editor's bottom)\n // already handles the placeholder-only case correctly: the placeholder\n // still occupies the editor's line box, so pills sitting beside it are\n // NOT wrapped and the margin stays.\n // biome-ignore lint/correctness/useExhaustiveDependencies: segments/suggestionPills/isLoading are intentional re-measure triggers, not reads\n useLayoutEffect(() => {\n const container = pillContainerRef.current;\n const editor = inputRef.current;\n if (!container || !editor) return;\n\n const update = () => {\n const inner = container.firstElementChild as HTMLElement | null;\n if (!inner) return;\n const cRect = inner.getBoundingClientRect();\n const eRect = editor.getBoundingClientRect();\n const wrapped = cRect.top >= eRect.bottom - 2;\n if (wrapped) container.setAttribute(\"data-aia-pill-wrapped\", \"\");\n else container.removeAttribute(\"data-aia-pill-wrapped\");\n };\n\n update();\n const ro = new ResizeObserver(update);\n ro.observe(editor);\n return () => ro.disconnect();\n }, [segments, suggestionPills.length, isLoading, inputRef]);\n\n // A new line opens smoothly instead of popping in (see watchEditorHeight).\n useEffect(() => {\n const area = editorAreaRef.current;\n if (!area) return;\n return watchEditorHeight(area);\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n focus,\n blur,\n reset,\n refreshProducts,\n setMode: (m) => modeControllerRef.current?.setMode(m),\n skipActivePill,\n endSubmitProgress,\n getSearchId,\n getVisitorId,\n refreshAnalyticsConsent,\n }),\n [\n focus,\n blur,\n reset,\n refreshProducts,\n skipActivePill,\n endSubmitProgress,\n getSearchId,\n getVisitorId,\n refreshAnalyticsConsent,\n ],\n );\n\n const canSubmit = !!segments.length || completedParams.length > 0;\n\n // Hands a submit to `onSubmit`. `answered` is the core's own result for\n // it, whose catalog report answers the query or is left out or marked:\n // the report in state is the last response's, which may be an earlier\n // query's. The text is read from the editor.\n const deliverSubmit = useCallback(\n (fromButton: boolean, answered: AutocompleteResult) => {\n const state = getState();\n const result = buildSubmitResult(\n getPlainText(),\n state.completedParams,\n state.skippedParams,\n {\n identifiedParams: state.identifiedParams,\n isReady: state.isReady,\n customFields: answered.custom_fields ?? null,\n customFieldsStale: answered.custom_fields_stale === true,\n },\n );\n if (fromButton) recordSubmit(result);\n const returned = onSubmit(result);\n // The core marks Enter's submit in progress from what this returns;\n // the button's is marked here. Not when the reset below follows:\n // nothing would show, so nothing is written only to be taken back.\n if (fromButton && !resetOnSubmit) holdSubmit(returned);\n if (resetOnSubmit) reset();\n return returned;\n },\n [recordSubmit, holdSubmit, resetOnSubmit, getState, onSubmit, reset, getPlainText],\n );\n\n // The core prepares and records Enter before it calls back, after the\n // answer to it arrived when `awaitAnswerOnSubmit` is on. The button does\n // the same here.\n const handleButtonSubmit = useCallback(() => {\n if (!canSubmit) return;\n // A submit already in progress: this press is the same submit again.\n // (The core ignores a second Enter itself.)\n if (getState().isSubmitting) return;\n if (awaitAnswerOnSubmit) {\n // Null: the shopper changed the input while it waited.\n void awaitSubmitResult().then((answered) => {\n if (answered) deliverSubmit(true, answered);\n });\n return;\n }\n prepareSubmit();\n deliverSubmit(true, getResult());\n }, [\n canSubmit,\n getState,\n awaitAnswerOnSubmit,\n awaitSubmitResult,\n prepareSubmit,\n getResult,\n deliverSubmit,\n ]);\n\n handleSubmitRef.current = (answered) =>\n canSubmit ? deliverSubmit(false, answered) : undefined;\n\n // \"See all results\" submits as the submit button does, while typed text is\n // in the field (vanilla's renderInput gate).\n const showsSeeAll = seeAllResults && !dropdownProps.isInputEmpty && canSubmit;\n const handleSeeAllResults = handleButtonSubmit;\n\n const handleWrapperClick = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n // Clicking a pill activates it; don't steal focus away from where it lands.\n const target = e.target as HTMLElement | null;\n if (target?.closest(\"[data-aia-pill]\")) return;\n // Tapping a location chip re-opens the location field, which takes\n // focus during the tap; the click that ends the tap must not take it back.\n if (document.activeElement?.closest(\"[data-aia-location]\")) return;\n if (inputRef.current) focusEditorFromTap(inputRef.current);\n },\n [inputRef],\n );\n\n const showInlinePills = pillPlacement === \"inline\";\n const showDropdownPills = pillPlacement === \"dropdown\";\n\n return (\n <div\n ref={containerRef}\n className={`magicx-aia ${styles.container} ${className ?? \"\"}`}\n data-pill-placement={pillPlacement}\n data-options-position={optionsPosition}\n data-animations={animations ? \"on\" : \"off\"}\n data-aia-options-style={optionsStyle}\n data-mode={resolveInitialMode(mode)}\n >\n <AIAutocompleteDropdown\n {...dropdownProps}\n showPills={showDropdownPills}\n productsLayout={productsLayout}\n productImageFallback={productImageFallback}\n showProductVendor={showProductVendor}\n onSeeAllResults={showsSeeAll ? handleSeeAllResults : undefined}\n fullWidth={seeAllResults}\n />\n {/* biome-ignore lint/a11y/useKeyWithClickEvents: container click delegates to editor focus */}\n {/* biome-ignore lint/a11y/noStaticElementInteractions: wrapper delegates focus to editor */}\n <div className={styles.inputWrapper} data-aia-input-wrapper=\"\" onClick={handleWrapperClick}>\n <div ref={editorAreaRef} className={styles.editorArea} data-aia-editor=\"\">\n <div {...editorProps} className={styles.input} data-aia-input=\"\" />\n {showInlinePills && (isLoading || suggestionPills.length > 0) && (\n <span\n ref={pillContainerRef}\n className={styles.pillListContainer}\n data-aia-pill-list-container=\"\"\n >\n <PillList\n pills={suggestionPills}\n activePillIndex={0}\n activeSelected={isActivePillSelected}\n onSelectPill={setActivePill}\n loading={isLoading}\n />\n </span>\n )}\n </div>\n {submitButton === null ? null : submitButton === undefined ? (\n <SubmitButton\n disabled={!canSubmit}\n ready={canSubmit && isReady}\n busy={isSubmitting}\n onClick={handleButtonSubmit}\n label={uiStringsFor(language).submit}\n />\n ) : (\n // biome-ignore lint/a11y/useKeyWithClickEvents: consumer-provided element handles its own keyboard interaction\n // biome-ignore lint/a11y/noStaticElementInteractions: transparent slot — click bubbles from consumer's element\n <span\n data-aia-submit=\"\"\n data-aia-submit-slot=\"\"\n // A submit in progress ignores a press here too; the attribute\n // is what the consumer's own button shows that from.\n data-aia-submit-state={isSubmitting ? \"busy\" : undefined}\n aria-busy={isSubmitting ? true : undefined}\n className={styles.submitSlot}\n onClick={(e) => {\n if (!canSubmit) return;\n e.stopPropagation();\n handleButtonSubmit();\n }}\n >\n {submitButton}\n </span>\n )}\n </div>\n </div>\n );\n },\n);\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-67791514\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-67791514\";\n s.textContent = `.aia-container-KKjFU {\n position: relative;\n /* Inherits the host page's font by default. Consumers can pin a specific\n font on the library via \\`--aia-font-family: 'Custom Font'\\` without\n affecting the surrounding page. */\n font-family: var(--aia-font-family, inherit);\n container-type: inline-size;\n}\n\n.aia-inputWrapper-FLq1b {\n /* The left inset is a token shared with the dropdown (which insets its\n content by the same amount), so the typed text, the parameter label,\n the option text and the product strip share one left edge. A host that\n pads the field to clear its own leading icon sets --aia-content-inset-left\n and the dropdown follows. Floored at 10px — the dropdown's sections inset\n their text by 10px and its own padding can't go below zero, so below\n 10px the two sides would diverge; flooring both keeps them together. */\n padding: 12px 16px 12px max(10px, var(--aia-content-inset-left, 16px));\n border: 1px solid var(--aia-border, #b0b0b0);\n border-radius: var(--aia-input-radius, 10px);\n background: var(--aia-surface, #ffffff);\n /* Flat by default; consumers can set --aia-shadow for elevation. */\n box-shadow: var(--aia-shadow, none);\n overflow: hidden;\n display: flex;\n /* Top-align so the submit button stays by the first line while the editor\n grows downward and then scrolls internally. */\n align-items: flex-start;\n gap: 12px;\n}\n\n/* Opt-in focus ring on the whole field while the editor (or anything else in\n it) has focus. Off by default: set --aia-focus-ring to an outline value\n (\\`2px solid #1668e3\\`) and --aia-focus-ring-offset to pull it inside the\n border (negative) or push it out. An outline, not a shadow, so it never\n replaces --aia-shadow, and it follows the field's corner radius. */\n.aia-inputWrapper-FLq1b:focus-within {\n outline: var(--aia-focus-ring, none);\n outline-offset: var(--aia-focus-ring-offset, 0px);\n}\n\n.aia-editorArea-7rBWq {\n position: relative;\n flex: 1;\n min-width: 0;\n min-height: 22px;\n /* Airy line box so wrapped rows of chips (and plain text) don't touch. */\n line-height: var(--aia-editor-line-height, 1.9);\n font-family: inherit;\n font-size: var(--aia-written-text-font-size, 14px);\n white-space: pre-wrap;\n word-break: break-word;\n overflow-wrap: anywhere;\n /* Grow with content up to a cap of five rows, then hold height and scroll\n internally — the caret stays in view as the text is pushed up. The\n scrollbar is hidden so the box reads as a clean growing field. The cap is\n five line boxes rather than a fixed pixel height so it still lands on a\n whole row when a consumer resizes the text via\n --aia-written-text-font-size (\\`em\\` here resolves against this element's\n own font-size, which is that token). */\n max-height: var(--aia-editor-max-height, calc(var(--aia-editor-line-height, 1.9) * 5em));\n overflow-y: auto;\n scrollbar-width: none;\n}\n\n.aia-editorArea-7rBWq::-webkit-scrollbar {\n display: none;\n}\n\n.aia-input-IW-P- {\n display: inline;\n outline: none;\n background: transparent;\n color: var(--aia-written-text-color, var(--aia-color-text-default, #fff));\n caret-color: var(\n --aia-caret-color,\n var(--aia-written-text-color, var(--aia-color-text-default, #fff))\n );\n font-weight: var(--aia-written-text-font-weight, 300);\n /* Align the text's inline box with the pill list (also vertical-align: middle)\n so they share a vertical center when pills stretch the line box to ~36px. */\n vertical-align: middle;\n}\n\n/* WebKit implements \\`contenteditable\\` as a \\`-webkit-user-modify\\` presentational\n hint, and the consumer-isolation reset's \\`all: revert\\` rolls presentational\n hints back — without this the editor computes to \\`read-only\\` there and\n nothing can be typed into it (verified in WebKit 26.0 and 26.6; Chromium\n keeps the attribute's effect). Pinned by class per attribute value, which\n outranks the reset. Other engines ignore the property. */\n.aia-input-IW-P-[contenteditable=\"true\"] {\n -webkit-user-modify: read-write;\n}\n.aia-input-IW-P-[contenteditable=\"plaintext-only\"] {\n -webkit-user-modify: read-write-plaintext-only;\n}\n\n/* The editor never draws a focus ring of its own; the field shows focus\n instead (--aia-focus-ring above). A page-wide \\`:focus-visible { outline … }\\`\n names a pseudo-class, so the consumer-isolation reset can't stop it, and it\n ties with the editor's \\`outline: none\\` — whichever stylesheet loaded last\n wins, and the page's loads last under a dev server, CSS-in-JS or\n route-split CSS. The ring then outlines the bare editor: a blue bar beside\n the caret while it is empty, a box around the text once it isn't. Pinned at\n (0,3,0) so the editor stays bare whatever the load order. */\n.aia-input-IW-P-[contenteditable]:focus,\n.aia-input-IW-P-[contenteditable]:focus-visible {\n outline: none;\n}\n\n/* Completed params render as inline pills (Figma \"RichTextPill\") — a compact\n ~26px chip with regular-weight primary-color text on a faint-gray fill.\n inline-block gives the padding/radius a box while the text stays part of the\n editable plain text (the caret system counts characters inside this\n <strong>). The completed class is stamped by the shared renderer as a global\n string, so match it via [class~=] to bypass CSS Modules' hashing. */\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-segment--completed\"] {\n /* inline-block, so the chip is one unit on its line: when the line runs out\n the whole chip moves to the next one instead of breaking in the middle\n (between its icon and its text, or at a space). max-width keeps a chip\n wider than the whole field inside it: its text then wraps within the\n chip, drawn as one rounded box of several lines (white-space: normal\n below; the field's overflow-wrap / word-break are inherited, so one very\n long word cannot push it out either). */\n display: inline-block;\n box-sizing: border-box;\n max-width: 100%;\n padding: 3px 6px;\n /* An inline-block counts its vertical padding in the line box, where the\n inline chip this replaces did not. The negative margin takes it back out,\n and the baseline alignment keeps the chip's text on the surrounding\n text's baseline, so rows of chips sit exactly --aia-editor-line-height\n apart, as plain text does. */\n margin: -3px 0;\n vertical-align: baseline;\n /* Rounded rectangle, not a full capsule. */\n border-radius: 6px;\n background: var(--aia-completed-pill-bg, rgba(189, 189, 189, 0.105));\n color: var(--aia-completed-pill-color, var(--aia-written-text-color, #fff));\n font-size: var(--aia-pill-font-size, 14px);\n font-weight: 400;\n line-height: normal;\n white-space: normal;\n /* Tighten the tracking so the chip's horizontal padding doesn't make the\n recognized phrase read wider than the same words as plain text. The exact\n per-chip amount is set inline by the renderer (renderEditable); this is a\n fallback for any chip the renderer didn't stamp. */\n letter-spacing: var(--aia-completed-pill-tracking, -0.02em);\n cursor: pointer;\n /* Smooth hover fade. Neutralized by the data-animations=\"off\" block. */\n transition: background-color 150ms ease;\n}\n\n/* Hover highlight — a slightly stronger fill so a pointed-at pill reads as\n tappable. Declared between the base and editing rules so editing wins. */\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-segment--completed\"]:hover {\n background: var(--aia-completed-pill-bg-active, rgba(189, 189, 189, 0.35));\n}\n\n/* A chip whose removal finds items when the search found none (custom_fields.blocking_filters).\n Greyed out at half opacity. After the hover rule, so it stays greyed while pointed at. */\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-segment--blocking\"] {\n opacity: var(--aia-blocking-chip-opacity, 0.5);\n}\n\n/* The × of a greyed chip keeps its normal weight: its opacity multiplies with the chip's, so it is divided back out. */\n:where(.aia-input-IW-P-)\n strong[class~=\"magicx-aia-segment--blocking\"]\n span[class~=\"magicx-aia-segment-remove\"] {\n opacity: calc(var(--aia-chip-remove-opacity, 0.32) / var(--aia-blocking-chip-opacity, 0.5));\n}\n\n@media (hover: hover) {\n :where(.aia-input-IW-P-)\n strong[class~=\"magicx-aia-segment--blocking\"]\n span[class~=\"magicx-aia-segment-remove\"]:hover {\n opacity: calc(\n var(--aia-chip-remove-opacity-hover, 0.7) /\n var(--aia-blocking-chip-opacity, 0.5)\n );\n }\n}\n\n/* The picked option's icon inside a completed chip (see \\`icon_svg\\` on\n CompletedParamState). Inline-block, one em square and sat on the text\n baseline; the chip is one inline-block, so the icon never ends a line\n apart from its text. contentEditable is off on it (the renderer sets that) so it adds\n no characters to the caret's plain text. */\n:where(.aia-input-IW-P-) span[class~=\"magicx-aia-segment-icon\"] {\n display: inline-block;\n width: 1em;\n height: 1em;\n margin-right: 4px;\n vertical-align: -0.125em;\n pointer-events: none;\n user-select: none;\n /* Own compositing layer. The row (entrance) and the chip (promotion fade)\n animate on a layer WebKit drops when the animation ends; content drawn at\n a fractional x then re-rasterizes on a different sub-pixel, which crisp\n SVG strokes show as a nudge to the right. A permanent layer keeps the\n glyph's rasterization stable across that hand-off. */\n will-change: transform;\n}\n\n:where(.aia-input-IW-P-) span[class~=\"magicx-aia-segment-icon\"] svg {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n/* The chip's remove \"×\" (\\`showChipRemove\\`). Deliberately quiet: a thin glyph\n a little smaller than the text, at low opacity, that firms up on hover. Its\n tap area is padded out past the glyph (a negative margin keeps the chip the\n same width) so it is easy to hit without looking like a button. */\n:where(.aia-input-IW-P-) span[class~=\"magicx-aia-segment-remove\"] {\n display: inline-block;\n width: 0.62em;\n height: 0.62em;\n margin-left: 5px;\n padding: 4px;\n margin-top: -4px;\n margin-bottom: -4px;\n margin-right: -4px;\n box-sizing: content-box;\n vertical-align: -0.02em;\n color: currentColor;\n opacity: var(--aia-chip-remove-opacity, 0.32);\n cursor: pointer;\n user-select: none;\n -webkit-user-select: none;\n /* Safari: the caret cannot be placed inside it. */\n -webkit-user-modify: read-only;\n transition: opacity 120ms ease;\n}\n\n/* Only where a pointer can hover: a touch would leave it stuck firmed up. */\n@media (hover: hover) {\n :where(.aia-input-IW-P-) span[class~=\"magicx-aia-segment-remove\"]:hover {\n opacity: var(--aia-chip-remove-opacity-hover, 0.7);\n }\n}\n\n:where(.aia-input-IW-P-) span[class~=\"magicx-aia-segment-remove\"] svg {\n display: block;\n width: 100%;\n height: 100%;\n fill: none;\n stroke: currentColor;\n stroke-width: 1.3;\n stroke-linecap: round;\n}\n\n/* By class: a page's \\`svg path { fill: … }\\` would beat the attribute-less path. */\n:where(.aia-input-IW-P-) span[class~=\"magicx-aia-segment-remove\"] svg path {\n fill: none;\n stroke: currentColor;\n}\n\n/* The picked option's picture: a small rounded tile inline before the chip\n text, in place of the icon. It is an empty inline span whose left padding\n is the tile's width and whose background is the picture (set inline as\n --aia-chip-image by the renderer) over a placeholder fill — not an <img>,\n which as an atomic inline would let the line break between it and the\n chip's text. The tile's height is the chip's own content height, so it\n never grows the input's line. The fill shows until the picture paints and\n stays if it never does; contentEditable is off on it (the renderer sets\n that) so it adds no characters to the caret's plain text. */\n:where(.aia-input-IW-P-) span[class~=\"magicx-aia-segment-image\"] {\n display: inline;\n padding-left: min(\n var(--aia-chip-image-size, 1.25em),\n var(--aia-chip-image-fit, var(--aia-chip-image-size, 1.25em))\n );\n margin-right: 5px;\n border-radius: var(--aia-chip-image-radius, 4px);\n background:\n var(--aia-chip-image, none) center / contain no-repeat,\n var(--aia-chip-image-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.083)));\n pointer-events: none;\n user-select: none;\n}\n\n/* Once the picture has loaded the placeholder fill steps aside, so a picture\n that doesn't fill the tile sits on the chip rather than on a grey box. The\n renderer sets the attribute when the picture loads, and narrows the tile to\n a tall picture's own width (--aia-chip-image-fit, capped by the size above)\n so the radius rounds the picture itself. */\n:where(.aia-input-IW-P-) span[class~=\"magicx-aia-segment-image\"][data-aia-image-loaded] {\n background: var(--aia-chip-image, none) center / contain no-repeat;\n}\n\n/* Re-edit highlight — applied to the completed pill being re-edited (after a\n tap). Reuses the exact hover fill so the highlight persists from tap until an\n option is selected. Hides the native caret; cursor switches to text since the\n pill is in text-replacement mode. The editing class is written by the shared\n renderer (a global string), so target it via an attribute selector to bypass\n CSS Modules' hashing. Declared last so it wins on a strong carrying both\n classes. */\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-segment--editing\"] {\n background: var(--aia-completed-pill-bg-active, rgba(189, 189, 189, 0.35));\n caret-color: transparent;\n cursor: text;\n}\n\n/* In re-edit mode the caret is parked just *before* the bold strong (see\n useContentEditableEditor.ts) — that means it sits in the parent .input, not\n inside the strong, so the rule above doesn't hide it. Use :has() to hide\n the caret on the whole editor while any completed param is selected. */\n.aia-input-IW-P-:has(strong[class~=\"magicx-aia-segment--editing\"]) {\n caret-color: transparent;\n}\n\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-segment--editing\"]::selection {\n background: transparent;\n color: inherit;\n}\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-segment--editing\"]::-moz-selection {\n background: transparent;\n color: inherit;\n}\n\n/* Placeholder via ::before so it doesn't enter the editable DOM. The text is\n typed in one character at a time by the core's typewriter (the attribute\n holds the typed prefix); the only fade is the outgoing phrase when the\n placeholder changes — its duration mirrors PLACEHOLDER_FADE_OUT_MS. */\n.aia-input-IW-P-[data-aia-empty=\"true\"][data-placeholder]::before {\n content: attr(data-placeholder);\n color: var(--aia-color-text-muted, #c1c4cb);\n opacity: 0.7;\n pointer-events: none;\n transition: opacity var(--aia-placeholder-fade, 120ms) ease-out;\n}\n\n/* The core updates state only at compositionend, so the editor still reads empty during IME composition.\n Hide the placeholder beside the composing text. */\n.aia-input-IW-P-[data-aia-empty=\"true\"][data-placeholder][data-aia-composing]::before {\n content: none;\n}\n\n.aia-input-IW-P-[data-aia-placeholder-leaving]::before {\n opacity: 0;\n}\n\n/* The empty box's hint (the lead word and the starting options, swapping\n one at a time) is a sibling laid over the input; while it shows, the\n input's own placeholder steps aside, and during IME composition the hint\n steps aside for the composing text. */\n.aia-input-IW-P-[data-aia-empty=\"true\"][data-placeholder][data-aia-hint]::before {\n content: none;\n}\n\n[data-aia-hint-el]:has(+ .aia-input-IW-P-[data-aia-composing]) {\n visibility: hidden;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-input-IW-P-[data-aia-empty=\"true\"][data-placeholder]::before {\n transition-duration: 0s;\n }\n}\n\n/* Empty inline contentEditables have no inline box for the caret to render\n in. Switch to inline-block (min-width matches the caret line) when empty,\n so the caret stays visible while focused. */\n.aia-input-IW-P-[data-aia-empty=\"true\"] {\n display: inline-block;\n min-width: 1px;\n}\n\n.aia-pillListContainer-h92IA {\n display: inline;\n margin-left: 8px;\n}\n\n.aia-pillListContainer-h92IA:empty,\n.aia-pillListContainer-h92IA[data-aia-pill-wrapped] {\n margin-left: 0;\n}\n\n.aia-submitSlot-GhuCM {\n display: contents;\n}\n\n/* Word → chip. A newly recognised param (renderEditable stamps shimmer-sweep\n on it) keeps its text in place while the chip forms around it: the fill and\n padding grow in over 300ms, and the picked option's icon or picture grows in\n front of the word — its width opening the room (so the words slide over),\n a small spring on its scale, a quick fade. The text itself never fades, so\n a typed word turns into a chip rather than vanishing and coming back. */\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-shimmer-sweep\"] {\n animation: aia-aiaChipForm-tKbNc 300ms ease both;\n}\n\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-shimmer-sweep\"] span[class~=\"magicx-aia-segment-icon\"] {\n animation:\n aia-aiaTileGrow-j9Pat 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both,\n aia-aiaTileSpring-FEwNg 380ms cubic-bezier(0.3, 1.5, 0.5, 1) both,\n aia-aiaTileFade-H1LDQ 200ms ease both;\n}\n\n/* The picture tile is an inline box (see its own rule), which can't scale, so\n it opens and fades without the spring. */\n:where(.aia-input-IW-P-) strong[class~=\"magicx-aia-shimmer-sweep\"] span[class~=\"magicx-aia-segment-image\"] {\n animation:\n aia-aiaImageGrow-i9yw8 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both,\n aia-aiaTileFade-H1LDQ 200ms ease both;\n}\n\n@keyframes aia-aiaChipForm-tKbNc {\n from {\n background-color: transparent;\n padding-left: 0;\n padding-right: 0;\n }\n}\n\n@keyframes aia-aiaTileGrow-j9Pat {\n from {\n width: 0;\n margin-right: 0;\n }\n}\n\n@keyframes aia-aiaTileSpring-FEwNg {\n from {\n transform: scale(0.4);\n }\n}\n\n/* A hair above zero, like the other fades — see magicx-aia-fadeIn. */\n@keyframes aia-aiaTileFade-H1LDQ {\n from {\n opacity: 0.01;\n }\n}\n\n@keyframes aia-aiaImageGrow-i9yw8 {\n from {\n padding-left: 0;\n margin-right: 0;\n }\n}\n\n/* Reduced motion: a word becomes a chip at once. */\n@media (prefers-reduced-motion: reduce) {\n :where(.aia-input-IW-P-) strong[class~=\"magicx-aia-shimmer-sweep\"],\n :where(.aia-input-IW-P-) strong[class~=\"magicx-aia-shimmer-sweep\"] span[class~=\"magicx-aia-segment-icon\"],\n :where(.aia-input-IW-P-) strong[class~=\"magicx-aia-shimmer-sweep\"] span[class~=\"magicx-aia-segment-image\"] {\n animation: none;\n }\n}\n\n/* --- Text box growth ---\n watchEditorHeight writes the editor's height on every change, so a new line\n opens over EDITOR_GROW_MS (340ms) instead of popping in. Reduced motion and\n \\`animations: false\\` drop the slide; the height still follows the text. */\n.aia-editorArea-7rBWq {\n transition: height 340ms cubic-bezier(0.2, 0.8, 0.2, 1);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-editorArea-7rBWq {\n transition: none;\n }\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"container\":\"aia-container-KKjFU\",\"inputWrapper\":\"aia-inputWrapper-FLq1b\",\"editorArea\":\"aia-editorArea-7rBWq\",\"input\":\"aia-input-IW-P-\",\"pillListContainer\":\"aia-pillListContainer-h92IA\",\"submitSlot\":\"aia-submitSlot-GhuCM\",\"aiaChipForm\":\"aia-aiaChipForm-tKbNc\",\"aiaTileGrow\":\"aia-aiaTileGrow-j9Pat\",\"aiaTileSpring\":\"aia-aiaTileSpring-FEwNg\",\"aiaTileFade\":\"aia-aiaTileFade-H1LDQ\",\"aiaImageGrow\":\"aia-aiaImageGrow-i9yw8\"};","import {\n attachScrollArrow,\n attachViewportFit,\n containScroll,\n dateFloorFor,\n destroyPanelMorph,\n findMultiSelectDone,\n fitMultiSelectDone,\n hasSkippablePill,\n isCalendarFormat,\n labelTraditionalAutocomplete,\n panelMorphKey,\n queryLive,\n type ScrollArrowController,\n settlePanelMorph,\n syncPanelHug,\n uiStringsFor,\n type ViewportFitController,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { type RefObject, useEffect, useLayoutEffect, useRef, useState } from \"react\";\n\n// Layout effect in the browser (no wide-then-narrow flash), plain effect on the server.\nconst useIsoLayoutEffect = typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n// Self-inject the appearance layer (design tokens, box-sizing reset, and the\n// optionsPosition=\"above\" layout-reversal rules). Tier 1 already imports this,\n// but headless consumers render only this dropdown — importing it here means\n// they get correct styling and a working `optionsPosition` with no extra setup.\nimport \"./appearance.css\";\nimport styles from \"./AIAutocompleteDropdown.module.css\";\nimport { DateGrid } from \"./components/DateGrid\";\nimport { DropdownFooter } from \"./components/DropdownFooter\";\nimport { LocationField } from \"./components/LocationField\";\nimport { PillList } from \"./components/PillList\";\nimport { ProductStrip } from \"./components/ProductStrip\";\nimport { SuggestionGrid } from \"./components/SuggestionGrid\";\nimport { TimeWheel } from \"./components/TimeWheel\";\nimport { Cluster } from \"./layout/Cluster\";\nimport { Stack } from \"./layout/Stack\";\nimport type { AIAutocompleteDropdownProps } from \"./types\";\n\nconst FALLBACK_SKELETON_BAR_WIDTHS = [159, 119, 164];\n\n// Module constant, not an inline arrow: a fresh closure per render would defeat\n// ProductStrip's prop stability for no reason. Reached only by a Tier 2\n// consumer who renders products without wiring onProductSelect.\nconst NOOP_PRODUCT_SELECT = () => {};\n/** A Tier 2 consumer who renders the dropdown without wiring month paging gets inert arrows, not a crash. */\nconst NOOP_MONTH = () => {};\nconst NOOP_TIME_CHANGE = (_minutes: number) => {};\nconst NOOP_TIME_COMMIT = () => {};\nconst NOOP_LOCATION_QUERY = (_query: string) => {};\nconst NOOP_LOCATION_MOVE = (_delta: number) => {};\nconst NOOP_LOCATION_COMMIT = (_index?: number) => {};\nconst NOOP_LOCATION_FOCUS = (_focused: boolean) => {};\n\n/**\n * Resolve the `mode` prop to a concrete `\"light\" | \"dark\"` (or `undefined` when\n * unset, meaning \"don't self-scope — inherit from a `.magicx-aia` ancestor\").\n * `\"auto\"` tracks `prefers-color-scheme` live.\n */\nfunction useResolvedMode(\n mode: \"light\" | \"dark\" | \"auto\" | undefined,\n): \"light\" | \"dark\" | undefined {\n const prefersDark = () =>\n typeof window !== \"undefined\" &&\n typeof window.matchMedia === \"function\" &&\n window.matchMedia(\"(prefers-color-scheme: dark)\").matches;\n const [systemDark, setSystemDark] = useState(prefersDark);\n\n useEffect(() => {\n if (\n mode !== \"auto\" ||\n typeof window === \"undefined\" ||\n typeof window.matchMedia !== \"function\"\n ) {\n return;\n }\n const mq = window.matchMedia(\"(prefers-color-scheme: dark)\");\n const onChange = () => setSystemDark(mq.matches);\n mq.addEventListener(\"change\", onChange);\n return () => mq.removeEventListener(\"change\", onChange);\n }, [mode]);\n\n if (mode === undefined) return undefined;\n if (mode === \"auto\") return systemDark ? \"dark\" : \"light\";\n return mode;\n}\n\n/**\n * Keeps the core's \"more below\" arrow controller bound to whichever options\n * grid the dropdown currently renders. The controller owns the behaviour\n * (measuring, visibility, the page-scroll on click — see the core's\n * scrollArrow.ts); this hook only hands it the live elements and tells it to\n * re-measure after every render, re-attaching when the grid element is\n * replaced and tearing down when there is no grid.\n */\nfunction useScrollArrow(\n rootRef: RefObject<HTMLDivElement>,\n buttonRef: RefObject<HTMLButtonElement>,\n): void {\n const boundRef = useRef<{ grid: HTMLElement; controller: ScrollArrowController } | null>(null);\n\n // No dependency array on purpose: the grid can come and go with any render,\n // and update() is a cheap attribute compare when nothing changed. This\n // effect deliberately returns no cleanup — a cleanup here would run before\n // every re-run and tear the controller down on each render (re-arming its\n // \"new group\" gate every time). The controller's lifetime is instead tied to\n // the grid element (destroyed when the grid is replaced or gone, below) and\n // to the component (the mount-only effect after this one), which also\n // survives StrictMode's mount → cleanup → mount pass.\n // biome-ignore lint/correctness/useExhaustiveDependencies: runs after every render by design\n useEffect(() => {\n const root = rootRef.current;\n const button = buttonRef.current;\n if (!root || !button) return;\n const grid = queryLive<HTMLElement>(root, \".aia-grid[data-scroll]\");\n if (boundRef.current && boundRef.current.grid !== grid) {\n boundRef.current.controller.destroy();\n boundRef.current = null;\n }\n if (grid && !boundRef.current) {\n boundRef.current = {\n grid,\n controller: attachScrollArrow({ dropdown: root, grid, button }),\n };\n return; // attach() runs the first update itself\n }\n boundRef.current?.controller.update();\n });\n\n useEffect(\n () => () => {\n boundRef.current?.controller.destroy();\n boundRef.current = null;\n },\n [],\n );\n}\n\n/**\n * Keeps the open panel inside the visible viewport — above a phone's keyboard\n * — through the core's fit controller (see the core's viewportFit.ts), which\n * owns the measuring and the listeners. Like useScrollArrow, it re-measures\n * after every render; `isVisible` is read through a ref so the controller,\n * attached once, always sees the latest value. The update is a layout effect\n * declared before the panel morph's, so in one commit the fit caps the height\n * first and the morph glides from the capped height, never a stale one.\n */\nfunction useViewportFit(rootRef: RefObject<HTMLDivElement>, isVisible: boolean): void {\n const visibleRef = useRef(isVisible);\n visibleRef.current = isVisible;\n const fitRef = useRef<ViewportFitController | null>(null);\n\n // No dependency array on purpose — see useScrollArrow.\n // biome-ignore lint/correctness/useExhaustiveDependencies: runs after every render by design\n useLayoutEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n if (!fitRef.current) {\n fitRef.current = attachViewportFit({ dropdown: root, isOpen: () => visibleRef.current });\n return; // attach() runs the first update itself\n }\n fitRef.current.update();\n });\n\n useEffect(\n () => () => {\n fitRef.current?.destroy();\n fitRef.current = null;\n },\n [],\n );\n}\n\nexport function AIAutocompleteDropdown({\n suggestions,\n activeIndex,\n onSelect,\n onHighlight,\n onUnhighlight,\n isOpen,\n id,\n className,\n pills,\n onPillClick,\n showPills = true,\n onSkip,\n showSkipButton = true,\n showOptionIcons = true,\n showOptionImages = true,\n showOptionCounts = true,\n skipDisabled = false,\n activeSelected = false,\n isLoading = false,\n skeletonExiting = false,\n isInputEmpty = false,\n language,\n products,\n onProductSelect,\n onProductAddToCart,\n onProductFocusChange,\n productsLayout = \"row\",\n productImageFallback = \"image\",\n showProductVendor = true,\n formatType = \"options\",\n dateView = null,\n selectedDateIso = null,\n selectedDateRange = null,\n dateRangeStart = null,\n dateReferences,\n onPreviousMonth,\n onNextMonth,\n timeView = null,\n multiSelectView = null,\n onMultiSelectCommit,\n onSeeAllResults,\n seeAllBusy = false,\n busyProductId = null,\n fullWidth = false,\n onTimeChange,\n onTimeCommit,\n locationView = null,\n isReediting = false,\n onLocationQuery,\n onLocationMove,\n onLocationCommit,\n onLocationFocusChange,\n isFocused = false,\n optionsPosition = \"below\",\n mode,\n}: AIAutocompleteDropdownProps) {\n // When `mode` is set, self-scope: add `magicx-aia` + `data-mode` to our own\n // root so the dropdown is styled without a `.magicx-aia` wrapper. When unset,\n // stay class-less and inherit from an ancestor (Tier 1 / a custom wrapper).\n const resolvedMode = useResolvedMode(mode);\n const selfScope = resolvedMode !== undefined;\n\n const rootRef = useRef<HTMLDivElement>(null);\n const scrollArrowRef = useRef<HTMLButtonElement>(null);\n useScrollArrow(rootRef, scrollArrowRef);\n\n // Wheel/touch over the dropdown never scrolls the page behind it. A native\n // listener, not onWheel: React registers wheel/touch handlers as passive, so\n // their preventDefault is ignored.\n useEffect(() => {\n if (!rootRef.current) return;\n return containScroll(rootRef.current);\n }, []);\n\n // Visibility is computed from the CURRENT props and drives the opacity fade.\n const liveOptions = suggestions[0]?.options ?? [];\n const liveHasRealPills = Boolean(pills && pills.length > 0 && onPillClick);\n // Either half is enough to keep the panel up: products render with no\n // suggestions, suggestions render with no products.\n const liveHasProducts = Boolean(products && products.length > 0);\n // A time pill has no options by design — the wheel is its whole body.\n const liveHasTimeWheel = formatType === \"time\" && timeView != null;\n // A location pill has no options by design: the search field is its whole body.\n const liveHasLocationField = formatType === \"location\" && locationView != null;\n const isVisible =\n isOpen &&\n (liveOptions.length > 0 ||\n (showPills && liveHasRealPills) ||\n isLoading ||\n liveHasProducts ||\n liveHasTimeWheel ||\n liveHasLocationField);\n useViewportFit(rootRef, isVisible);\n // Every render: Done is sized to the widest option the panel now shows, and\n // the panel hugs its options.\n useIsoLayoutEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n fitMultiSelectDone(root, findMultiSelectDone(root));\n // The panel hugs its options (the core's panelHugWidth.ts).\n syncPanelHug(root);\n });\n\n // Freeze the content-driving values while the dropdown is open. When it\n // closes we render this frozen snapshot during the 400ms opacity fade, so the\n // whole populated dropdown fades out as one. Otherwise the pills/options\n // unmount the instant the underlying state empties (e.g. skipping the last\n // pill with →), leaving the always-present footer alone for a flash of a\n // footer-only \"no options\" box. Content is refreshed on the next open.\n const snapshot = {\n suggestions,\n activeIndex,\n pills,\n showPills,\n showSkipButton,\n showOptionIcons,\n showOptionImages,\n showOptionCounts,\n skipDisabled,\n activeSelected,\n isLoading,\n skeletonExiting,\n isInputEmpty,\n products,\n formatType,\n dateView,\n selectedDateIso,\n selectedDateRange,\n dateRangeStart,\n dateReferences,\n timeView,\n multiSelectView,\n locationView,\n isReediting,\n showsSeeAll: Boolean(onSeeAllResults),\n };\n const lastVisibleRef = useRef(snapshot);\n if (isVisible) lastVisibleRef.current = snapshot;\n const content = isVisible ? snapshot : lastVisibleRef.current;\n // Only the explicit language prop picks the words, as in the vanilla widget.\n const strings = uiStringsFor(language);\n\n const activeSuggestion = content.suggestions[0];\n const options = activeSuggestion?.options ?? [];\n const isOptionHighlighted =\n content.activeIndex >= 0 && Boolean(options[content.activeIndex]?.is_tappable);\n const shownPills = labelTraditionalAutocomplete(content.pills ?? [], strings.keepTyping);\n const hasRealPills = Boolean(shownPills.length > 0 && onPillClick);\n // Guarantee at least one option bar during loading — if the cached state\n // had no options, render the fallback skeleton bars regardless of whether\n // pills are present, so the dropdown never shows pills with an empty body.\n const showsRealPills = content.showPills && hasRealPills;\n const showsLoadingPills = content.showPills && !hasRealPills && content.isLoading;\n const showsPillBar = showsRealPills || showsLoadingPills;\n // The trailing \"skip\" button only makes sense next to a real, skippable\n // pill — the fallback skeleton bar has nothing to skip. Requires onSkip:\n // a Tier 2 consumer rendering the dropdown without wiring it gets no\n // dead button. Deliberately NOT gated on showPills: with pills rendered\n // elsewhere (pillPlacement \"inline\"/\"hidden\") the bar renders as a\n // skip-only row holding just the button. Hidden while the input is empty —\n // the 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 hasRealPills &&\n hasSkippablePill(shownPills) &&\n content.showSkipButton &&\n !content.isInputEmpty &&\n Boolean(onSkip);\n const activePillLabel = shownPills[0]?.text;\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 derive\n // layer — so the two are the same list drawn two different ways, and never\n // both at once (two elements answering to `#${id}-option-0` would break\n // keyboard commit).\n //\n // A calendar is withheld while a request is in flight. The options grid\n // draws its cached options as skeleton rows for that window, but a month of\n // day cells has no skeleton form worth drawing — and a live calendar over a\n // loading pill bar invites an answer against suggestions the response is\n // about to replace. The fallback bars stand in until it lands.\n const isDate = isCalendarFormat(content.formatType) && content.dateView != null;\n const showsOptions = options.length > 0 && !isDate;\n const showsDateGrid = options.length > 0 && isDate && !content.isLoading;\n // The time wheel and the location field are withheld while a request is in\n // flight, for the calendar's reasons above: each belongs to the pill the\n // response will confirm. Their pills have no options by design, so it is the\n // format — not the option count — that says they show.\n const showsTimeWheel =\n content.formatType === \"time\" && content.timeView != null && !content.isLoading;\n const showsLocationField =\n content.formatType === \"location\" && content.locationView != null && !content.isLoading;\n const showsFallbackSkeleton =\n content.isLoading && !showsOptions && !showsDateGrid && !showsTimeWheel && !showsLocationField;\n // `data-aia-has-products` below is the layout hook: the band the footer\n // rides up over only makes sense when the footer sits directly on the\n // scrolling option list, and appearance.css reads the attribute to zero it\n // at the source when a strip is in between.\n const stripProducts = content.products ?? [];\n\n // The open panel's height glide and question crossfade, shared with vanilla\n // and Angular (panelMorph.ts). Runs before paint after a commit that changes\n // what the panel shows; a highlight, caret or focus commit is left out, so it\n // never restarts a running glide (the core also skips unchanged content).\n const morphKey = panelMorphKey(showsRealPills ? shownPills : []);\n // biome-ignore lint/correctness/useExhaustiveDependencies: the content values are re-settle triggers, not reads\n useLayoutEffect(() => {\n if (!rootRef.current) return;\n settlePanelMorph(rootRef.current, morphKey, {\n visible: isVisible,\n anchorBottom: optionsPosition === \"above\",\n });\n }, [\n morphKey,\n isVisible,\n optionsPosition,\n content.suggestions,\n content.pills,\n content.isLoading,\n content.skeletonExiting,\n content.isInputEmpty,\n content.products,\n content.formatType,\n content.dateView,\n content.selectedDateIso,\n content.selectedDateRange,\n content.dateRangeStart,\n content.dateReferences,\n content.timeView,\n content.multiSelectView,\n content.locationView,\n content.showPills,\n content.showSkipButton,\n content.showOptionIcons,\n content.showOptionImages,\n content.showOptionCounts,\n content.showsSeeAll,\n // \"list\" restacks the product strip as full-width rows.\n productsLayout,\n // The words on show (skip, the loading line) change height with the language.\n language,\n ]);\n useEffect(() => {\n const el = rootRef.current;\n return () => {\n if (el) destroyPanelMorph(el);\n };\n }, []);\n\n return (\n <div\n ref={rootRef}\n id={id}\n role=\"listbox\"\n aria-multiselectable={Boolean(content.multiSelectView)}\n data-aia-dropdown=\"\"\n data-options-position={optionsPosition}\n data-mode={resolvedMode}\n data-aia-loading={content.isLoading ? \"\" : undefined}\n data-aia-skeleton-exiting={content.skeletonExiting ? \"\" : undefined}\n data-aia-has-products={stripProducts.length > 0 ? \"\" : undefined}\n data-aia-full-width={fullWidth ? \"\" : undefined}\n className={`${selfScope ? \"magicx-aia \" : \"\"}${styles.dropdown} ${isVisible ? styles.visible : \"\"} ${className ?? \"\"}`}\n onMouseDown={(e) => e.preventDefault()}\n >\n <Stack space=\"8px\">\n {(showsPillBar || showsSkip) && (\n <Cluster noWrap className={styles.pillBar} data-aia-pillbar=\"\">\n {/* The scroll + right-edge fade live on this wrapper (not the bar)\n so the skip button stays outside the masked region — pinned and\n fully opaque while overflowing pills fade under it. The\n data-aia-pill-scroll attribute is the public styling hook for\n the mask, since the module class hash isn't part of the API.\n Absent in a skip-only row (pills rendered elsewhere). */}\n {showsPillBar && (\n <span className={styles.pillScroll} data-aia-pill-scroll=\"\">\n <PillList\n pills={shownPills}\n activePillIndex={0}\n activeSelected={content.activeSelected}\n onSelectPill={onPillClick ?? (() => {})}\n rounded\n loading={content.isLoading}\n />\n </span>\n )}\n {showsSkip && (\n <button\n type=\"button\"\n tabIndex={-1}\n className={styles.skip}\n data-aia-skip=\"\"\n disabled={content.isLoading || content.skipDisabled}\n aria-label={\n activePillLabel ? `${strings.skipLabel} ${activePillLabel}` : strings.skipLabel\n }\n onClick={onSkip}\n >\n {strings.skip}\n </button>\n )}\n </Cluster>\n )}\n {showsOptions && (\n <SuggestionGrid\n options={options}\n activeIndex={content.activeIndex}\n onSelect={onSelect}\n onHighlight={onHighlight}\n onUnhighlight={onUnhighlight}\n listboxId={id}\n loading={content.isLoading}\n groupKey={\n activeSuggestion ? `${activeSuggestion.parameter} ${activeSuggestion.text}` : \"\"\n }\n optionsPosition={optionsPosition}\n showIcons={content.showOptionIcons}\n showImages={content.showOptionImages}\n showCounts={content.showOptionCounts}\n picked={content.multiSelectView?.picked}\n />\n )}\n {content.multiSelectView && (\n // biome-ignore lint/a11y/noStaticElementInteractions: Delegates clicks from the native button to preserve iOS taps.\n // biome-ignore lint/a11y/useKeyWithClickEvents: The native button generates keyboard clicks.\n <div\n data-aia-multi-actions=\"\"\n onClick={(event) => {\n if (\n (event.target as HTMLElement).closest(\"[data-aia-multi-done]\") &&\n !content.skipDisabled &&\n !content.isLoading\n )\n onMultiSelectCommit?.();\n }}\n >\n <button\n type=\"button\"\n tabIndex={-1}\n disabled={true}\n data-aia-multi-done=\"\"\n className={styles.multiDone}\n ref={(button) => {\n if (!button) return;\n button.disabled = true;\n void button.offsetHeight;\n button.disabled = content.skipDisabled || content.isLoading;\n }}\n >\n {strings.done}\n </button>\n </div>\n )}\n {showsDateGrid && content.dateView && (\n <DateGrid\n options={options}\n activeIndex={content.activeIndex}\n listboxId={id}\n view={content.dateView}\n selection={{\n selectedIso: content.selectedDateIso ?? null,\n selectedRange: content.selectedDateRange ?? null,\n rangeStart: content.dateRangeStart ?? null,\n floor: dateFloorFor(content.formatType, content.dateRangeStart),\n references: content.dateReferences ?? [],\n }}\n onSelect={onSelect}\n onHighlight={onHighlight}\n onUnhighlight={onUnhighlight}\n onPreviousMonth={onPreviousMonth ?? NOOP_MONTH}\n onNextMonth={onNextMonth ?? NOOP_MONTH}\n />\n )}\n {showsTimeWheel && content.timeView && (\n <TimeWheel\n view={content.timeView}\n label={strings.timeLabel}\n doneLabel={strings.done}\n // The press window after an answer, as for the option grid.\n interactive={!content.skipDisabled}\n onTimeChange={onTimeChange ?? NOOP_TIME_CHANGE}\n onTimeCommit={onTimeCommit ?? NOOP_TIME_COMMIT}\n />\n )}\n {showsLocationField && content.locationView && (\n <LocationField\n view={content.locationView}\n searchLabel={strings.locationSearch}\n noResultsLabel={strings.locationNoResults}\n useTypedLabel={strings.locationUseTyped}\n widgetFocused={isFocused && isVisible}\n reediting={content.isReediting}\n visible={isVisible}\n interactive={!content.skipDisabled}\n onQuery={onLocationQuery ?? NOOP_LOCATION_QUERY}\n onMove={onLocationMove ?? NOOP_LOCATION_MOVE}\n onCommit={onLocationCommit ?? NOOP_LOCATION_COMMIT}\n onFocusChange={onLocationFocusChange ?? NOOP_LOCATION_FOCUS}\n />\n )}\n {showsFallbackSkeleton && (\n <div className={styles.skeletonBars} data-aia-skeleton-bars=\"\">\n {FALLBACK_SKELETON_BAR_WIDTHS.map((w) => (\n <span key={`bar-${w}`} className={styles.skeletonBar} style={{ width: w }} />\n ))}\n </div>\n )}\n <ProductStrip\n products={stripProducts}\n listboxId={id}\n onSelect={onProductSelect ?? NOOP_PRODUCT_SELECT}\n busyProductId={busyProductId}\n onAddToCart={onProductAddToCart}\n onFocusChange={onProductFocusChange}\n focusable={isVisible && !content.isLoading}\n loading={content.isLoading}\n layout={productsLayout}\n imageFallback={productImageFallback}\n showVendor={showProductVendor}\n strings={strings}\n />\n {content.showsSeeAll && (\n // Delegated from the native button, like Done: iOS keeps the tap.\n // The button is armed only after it is laid out, so a response\n // landing mid-tap never cancels a tap elsewhere.\n // biome-ignore lint/a11y/noStaticElementInteractions: Delegates clicks from the native button to preserve iOS taps.\n // biome-ignore lint/a11y/useKeyWithClickEvents: The native button generates keyboard clicks.\n <div\n className={styles.seeAllRow}\n data-aia-see-all=\"\"\n onClick={(event) => {\n if (!(event.target as HTMLElement).closest(\"[data-aia-see-all-button]\")) return;\n // The panel sits inside the widget: a click bubbling on would read\n // as a click on the input and reopen what the submit just closed.\n event.stopPropagation();\n // A submit in progress: this press is the same submit again.\n if (content.isLoading || seeAllBusy) return;\n onSeeAllResults?.();\n }}\n >\n <button\n type=\"button\"\n tabIndex={-1}\n disabled={true}\n data-aia-see-all-button=\"\"\n data-aia-see-all-state={seeAllBusy ? \"busy\" : undefined}\n aria-busy={seeAllBusy ? true : undefined}\n className={styles.seeAll}\n ref={(button) => {\n if (!button) return;\n button.disabled = true;\n void button.offsetHeight;\n button.disabled = content.isLoading;\n }}\n >\n {strings.seeAllResults}\n </button>\n </div>\n )}\n <DropdownFooter\n isOptionHighlighted={isOptionHighlighted}\n isInputEmpty={content.isInputEmpty}\n strings={strings}\n />\n </Stack>\n {/* \"More below\" arrow — an overlay on the panel, not a section of the\n stack. Shown/positioned by the core's controller (useScrollArrow);\n markup mirrors vanilla's createScrollArrowButton. */}\n <button\n ref={scrollArrowRef}\n type=\"button\"\n tabIndex={-1}\n className={styles.scrollArrow}\n data-aia-scroll-arrow=\"\"\n aria-label={strings.scrollArrow}\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 strokeWidth=\"1.75\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"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 );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-0ae03977\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-0ae03977\";\n s.textContent = `/*\n * Built-in appearance defaults — zero specificity via :where().\n * Consumer CSS always wins without !important.\n *\n * Resolution priority (highest wins):\n * 1. Consumer CSS targeting new vars (--aia-pill-bg, etc.)\n * 2. Consumer CSS targeting legacy vars (--aia-color-*, via fallback chain)\n * 3. These built-in defaults\n */\n\n/*\n * Library-scoped box-sizing reset. The SDK's pill / option / wrapper styles\n * mix explicit dimensions with padding (e.g. .magicx-aia-pill has height:36px\n * + padding:13px) and were authored assuming \\`border-box\\`. In consumer apps\n * without a global \\`* { box-sizing: border-box }\\` reset the pill rendered\n * ~62px tall instead of 36px. The root gets it here; everything under the SDK's\n * own roots gets it from the isolation rule below, and nothing else does.\n */\n:where(.magicx-aia) {\n box-sizing: border-box;\n}\n\n/*\n * Consumer isolation. Everything the SDK renders sits under one of two roots\n * it owns — the Tier 1 input wrapper and the dropdown — and every element\n * under them rolls its author-level styles back to the browser defaults\n * (\\`all: revert\\`) before the SDK's own rules apply. A page's element and\n * universal rules (\\`button { … }\\`, \\`a { … }\\`, \\`* { … }\\`, a CSS reset, a\n * framework's preflight) therefore never reach the widget.\n *\n * The selector is shaped for specificity (0,0,5) on purpose:\n * - \\`:where(...)\\` contributes nothing, so the scope never outranks anything;\n * - five \\`:not(html)\\` add one type-level unit each — enough to beat any\n * type-only page selector up to five compounds deep (\\`html body main form\n * button\\`), and still below every rule that names a class, attribute or id.\n * The SDK's own class rules, and a consumer's intentional overrides on the\n * \\`data-aia-*\\` hooks, therefore win exactly as before.\n *\n * Left alone: the roots' ancestors (the consumer's container), inline SVG\n * (\\`revert\\` strips presentation attributes such as \\`stroke\\` and \\`d\\`, which\n * would blank the icons), and the consumer's own submit button and whatever\n * is inside it (\\`[data-aia-submit-slot]\\`). Custom properties are outside\n * \\`all\\`, so \\`--aia-*\\` theming still flows in from the page.\n *\n * Every SDK rule must therefore carry at least one class or attribute; a\n * type-only or \\`:where()\\`-only rule would lose to this one, and a rule inside\n * a cascade layer would lose to it whatever its specificity.\n * \\`packages/vanilla/tests/packaging/consumerIsolation.test.ts\\` enforces both\n * and keeps the four copies of this block identical.\n */\n:where(\n [data-aia-input-wrapper],\n [data-aia-input-wrapper] *,\n [data-aia-dropdown],\n [data-aia-dropdown] *\n ):not(:where(svg, svg *, [data-aia-submit-slot], [data-aia-submit-slot] *)):not(html):not(\n html\n ):not(html):not(html):not(html),\n:where(\n [data-aia-input-wrapper],\n [data-aia-input-wrapper] *,\n [data-aia-dropdown],\n [data-aia-dropdown] *\n ):not(:where(svg, svg *, [data-aia-submit-slot], [data-aia-submit-slot] *)):not(html):not(\n html\n ):not(html):not(html):not(html)::before,\n:where(\n [data-aia-input-wrapper],\n [data-aia-input-wrapper] *,\n [data-aia-dropdown],\n [data-aia-dropdown] *\n ):not(:where(svg, svg *, [data-aia-submit-slot], [data-aia-submit-slot] *)):not(html):not(\n html\n ):not(html):not(html):not(html)::after {\n all: revert;\n box-sizing: border-box;\n}\n\n/* Inherited typography stops at the roots too. \\`revert\\` leaves an inherited\n property to inherit, so a page's \\`body { line-height: 1.8; letter-spacing:\n 0.05em; text-transform: uppercase }\\` would still flow into the widget through\n its container. The font itself (family, size, weight) and the text colour are\n meant to come from the page — see --aia-font-family — so they keep\n inheriting; the adjustments below return to their initial values at the two\n roots and inherit from there. Same specificity as the reset above and after\n it in source order, so it wins the tie on the roots. */\n:where([data-aia-input-wrapper], [data-aia-dropdown]):not(html):not(html):not(html):not(html):not(\n html\n ) {\n line-height: normal;\n letter-spacing: normal;\n word-spacing: normal;\n text-transform: none;\n text-indent: 0;\n text-align: start;\n text-shadow: none;\n font-style: normal;\n font-variant: normal;\n white-space: normal;\n visibility: visible;\n cursor: auto;\n}\n\n/* Inline SVG is outside the reset: \\`revert\\` would strip an icon's presentation\n attributes (\\`stroke\\`, \\`d\\`, \\`fill=\"none\"\\`) and blank it. A page's\n \\`svg { display: block; max-width: 100%; margin: 0 auto; transition: … }\\`\n would therefore still reach every icon, so the box properties a page puts\n on \\`svg\\` are reverted here by name — never width, height, fill, the stroke\n family, opacity or transform, which an icon carries as attributes. Size and\n paint are pinned by class where the SDK draws an icon itself (the submit\n arrow, the scroll chevron; option icons are sized by their own class rule).\n The consumer's submit slot keeps its own icon styling. Same (0,0,5) as the\n reset; the second rule is for a \\`* { transition }\\` reaching the paths. */\n:where([data-aia-input-wrapper] svg, [data-aia-dropdown] svg):not(\n :where([data-aia-submit-slot] *)\n ):not(html):not(html):not(html):not(html):not(html) {\n display: revert;\n vertical-align: revert;\n position: revert;\n inset: revert;\n float: revert;\n margin: revert;\n padding: revert;\n border: revert;\n border-radius: revert;\n outline: revert;\n background: revert;\n box-shadow: revert;\n min-width: revert;\n max-width: revert;\n min-height: revert;\n max-height: revert;\n flex: revert;\n transition: revert;\n animation: revert;\n rotate: revert;\n scale: revert;\n translate: revert;\n}\n:where([data-aia-input-wrapper] svg *, [data-aia-dropdown] svg *):not(\n :where([data-aia-submit-slot] *)\n ):not(html):not(html):not(html):not(html):not(html) {\n transition: revert;\n animation: revert;\n}\n\n/*\n * Primitive color ramp — single source of truth, mirroring the Figma\n * \"Primitives\" collection. INTERNAL: theme via the public --aia-* vars below,\n * not these. Mode-independent (raw values; the same in light and dark).\n */\n:where(.magicx-aia) {\n --aia-primitive-neutral-0: #000000;\n --aia-primitive-neutral-150: #1a1b1d;\n --aia-primitive-neutral-250: #323232;\n --aia-primitive-neutral-300: #333539;\n --aia-primitive-neutral-400: #4a4a4a;\n --aia-primitive-neutral-500: #505050;\n --aia-primitive-neutral-700: #b0b0b0;\n --aia-primitive-neutral-750: #bdbdbd;\n --aia-primitive-neutral-900: #e7e7e7;\n --aia-primitive-neutral-1000: #ffffff;\n --aia-primitive-blue-50: #eef2ff;\n --aia-primitive-neutral-750-a50: rgba(189, 189, 189, 0.51);\n --aia-primitive-neutral-750-a25: rgba(189, 189, 189, 0.25);\n /* One third of a25's alpha: the light-mode skeleton fill. */\n --aia-primitive-neutral-750-a8: rgba(189, 189, 189, 0.083);\n --aia-primitive-neutral-750-a35: rgba(189, 189, 189, 0.35);\n --aia-primitive-neutral-750-a30: rgba(189, 189, 189, 0.3);\n --aia-primitive-neutral-750-a15: rgba(189, 189, 189, 0.15);\n /* a105 is a15 lightened 30% (0.15 -> 0.105) — a fainter tint of the same\n gray, not a new color. Light mode only: over a WHITE surface a weaker\n tint is lighter, but over the dark theme's black surface it would be\n darker, so dark mode keeps a15. */\n --aia-primitive-neutral-750-a105: rgba(189, 189, 189, 0.105);\n --aia-primitive-neutral-700-a40: rgba(176, 176, 176, 0.4);\n /* Exactly 0.5, unlike the older 750-a50 above (0.51). */\n --aia-primitive-neutral-900-a50: rgba(231, 231, 231, 0.5);\n --aia-primitive-neutral-400-a50: rgba(74, 74, 74, 0.5);\n}\n\n/* Light mode defaults (base) — public --aia-* vars resolve to primitives */\n:where(.magicx-aia),\n:where(.magicx-aia[data-mode=\"light\"]) {\n --aia-surface: var(--aia-primitive-neutral-1000);\n --aia-border: rgba(17, 24, 39, 0.14); /* subtle slate hairline (off-palette) */\n /* Flat by default — no elevation on the input container. Consumers set\n --aia-shadow to add one. */\n --aia-shadow: none;\n /* Half-strength stroke: neutral-900 (was #e5e7eb — snapped to palette,\n Δ2) at 50% alpha over the surface, so the hairline lands exactly\n halfway between its old value and the white behind it. */\n --aia-dropdown-border: transparent; /* no stroke by default */\n --aia-dropdown-shadow: none; /* flat by default */\n /* Suggestion pills (Figma \"ParamPill\"): transparent fill, no visible border;\n per-pill opacity via getPillOpacity. */\n --aia-pill-bg: var(--aia-primitive-neutral-750);\n --aia-pill-color: var(--aia-primitive-neutral-300);\n --aia-pill-font-size: 16px;\n /* Smart Suggestion sparkle, matched text, and the shimmer's bright centre. */\n --aia-smart-suggestion-accent: #b84549;\n --aia-smart-suggestion-glint: #f3c4c5;\n /* How strongly a half-built syllable at the end of a match shows the accent. */\n --aia-option-match-partial-opacity: 0.45;\n\n /* Completed params (Figma \"RichTextPill\"): compact faint-gray chip with\n primary-color regular-weight text. -active is the hover / tapped (re-edit)\n highlight — an alpha over the input background, so one value works in both\n themes. */\n --aia-completed-pill-bg: var(--aia-primitive-neutral-750-a105);\n --aia-completed-pill-bg-active: var(--aia-primitive-neutral-750-a35);\n --aia-completed-pill-color: var(--aia-primitive-neutral-0);\n\n --aia-option-bg: var(--aia-primitive-blue-50);\n /* Option text: a softer grey than the parameter label above it. */\n --aia-option-color: var(--aia-primitive-neutral-500);\n /* The floating box's thin options scrollbar: track and thumb. */\n --aia-scrollbar-track: rgba(15, 23, 42, 0.05);\n --aia-scrollbar-thumb: rgba(15, 23, 42, 0.22);\n --aia-option-color-selected: var(--aia-primitive-neutral-0);\n --aia-option-font-size: 16px;\n\n --aia-written-text-color: var(--aia-primitive-neutral-0);\n /* The typed query keeps its full size; only the options box below it is\n scaled down, so the query reads larger than the choices. */\n --aia-written-text-font-size: 16px;\n --aia-caret-color: var(--aia-written-text-color, #000000);\n\n --aia-submit-bg: var(--aia-primitive-neutral-0);\n --aia-submit-color: var(--aia-primitive-neutral-1000);\n\n --aia-color-text-muted: #6b7280; /* off shared palette (slate) */\n\n /* Loading bars sit at half the contrast of the surrounding chrome so they\n read as a placeholder, not as content (a50 -> a25 over the light surface). */\n --aia-skeleton-bg: var(--aia-primitive-neutral-750-a8);\n\n --aia-streak-rgb: 99, 102, 241; /* off shared palette (indigo effect) */\n /* Solid confirm fill: the pickers' Done buttons and a ticked multi-select\n checkbox. A near-black gray on light, so white reads on it. */\n --aia-confirm-bg: #262626;\n --aia-confirm-bg-hover: #404040;\n --aia-confirm-color: #ffffff;\n /* The pickers' Done buttons: a soft blue-gray under dark navy text, the\n pickers' shared Done style (the ticked checkbox keeps the solid\n confirm fill above). */\n --aia-done-bg: #e4e8f0;\n --aia-done-bg-hover: #d8dde8;\n --aia-done-color: #2a3150;\n /* The opt-in \"See all results\" button (\\`seeAllResults\\`): a solid\n near-black button under white text. */\n --aia-see-all-bg: #2b2b2b;\n --aia-see-all-bg-hover: #3d3d3d;\n --aia-see-all-color: #ffffff;\n\n --aia-footer-hint-color: var(--aia-primitive-neutral-500);\n --aia-footer-brand-color: var(--aia-primitive-neutral-700);\n --aia-footer-badge-border: var(--aia-primitive-neutral-750-a50);\n}\n\n/* Dark mode defaults */\n:where(.magicx-aia[data-mode=\"dark\"]) {\n --aia-surface: var(--aia-primitive-neutral-0);\n --aia-border: var(--aia-primitive-neutral-500);\n /* Flat by default — no elevation on the input container. Consumers set\n --aia-shadow to add one. */\n --aia-shadow: none;\n /* Half-strength stroke — neutral-400 (was #484848 — snapped to palette,\n Δ2) at 50% alpha; see the light-mode note above. */\n --aia-dropdown-border: transparent; /* no stroke by default */\n --aia-dropdown-shadow: none; /* flat by default */\n /* Suggestion pills (Figma \"ParamPill\"): transparent fill, no visible border. */\n --aia-pill-bg: var(--aia-primitive-neutral-750);\n --aia-pill-color: var(--aia-primitive-neutral-700);\n --aia-pill-font-size: 16px;\n /* Smart Suggestion sparkle, matched text, and the shimmer's bright centre. */\n --aia-smart-suggestion-accent: #e0787b;\n --aia-smart-suggestion-glint: #ffe1e1;\n\n /* Completed params (Figma \"RichTextPill\") — dark theme (design source):\n white text on a faint-gray chip. -active is the hover / tapped highlight.\n Deliberately still a15 while light mode moved to a105: the fill is a light\n gray tinting the surface, so thinning it lightens over white but DARKENS\n over this theme's black. Lightening the dark chip means a stronger tint,\n which is a design call, not a mechanical one — left for design to make. */\n --aia-completed-pill-bg: var(--aia-primitive-neutral-750-a15);\n --aia-completed-pill-bg-active: var(--aia-primitive-neutral-750-a35);\n --aia-completed-pill-color: var(--aia-primitive-neutral-1000);\n\n --aia-option-bg: var(--aia-primitive-neutral-250);\n /* Option text: a softer grey than the parameter label above it. */\n --aia-option-color: var(--aia-primitive-neutral-750);\n --aia-scrollbar-track: rgba(255, 255, 255, 0.08);\n --aia-scrollbar-thumb: rgba(255, 255, 255, 0.28);\n --aia-option-color-selected: var(--aia-primitive-neutral-1000);\n --aia-option-font-size: 16px;\n\n --aia-written-text-color: var(--aia-primitive-neutral-1000);\n --aia-written-text-font-size: 16px;\n --aia-caret-color: var(--aia-written-text-color, #ffffff);\n\n --aia-submit-bg: var(--aia-primitive-neutral-1000);\n --aia-submit-color: var(--aia-primitive-neutral-0);\n\n --aia-color-text-muted: #c1c4cb; /* off shared palette (slate) */\n\n /* Half as light against the dark surface as the old neutral-300 fill — the\n dark-mode counterpart of the light theme's a50 -> a25 step-down. */\n --aia-skeleton-bg: var(--aia-primitive-neutral-150);\n\n --aia-streak-rgb: 255, 255, 255;\n /* The light theme's solid confirm fill, inverted: a soft gray (not white,\n which glares on the dark surface) under dark text. */\n --aia-confirm-bg: #a6a6a6;\n --aia-confirm-bg-hover: #b8b8b8;\n --aia-confirm-color: #000000;\n /* Done keeps the dark theme's confirm colors. */\n --aia-done-bg: var(--aia-confirm-bg);\n --aia-done-bg-hover: var(--aia-confirm-bg-hover);\n --aia-done-color: var(--aia-confirm-color);\n /* A black pill vanishes on the dark surface, so \"See all results\" takes the\n dark theme's confirm colors too. */\n --aia-see-all-bg: var(--aia-confirm-bg);\n --aia-see-all-bg-hover: var(--aia-confirm-bg-hover);\n --aia-see-all-color: var(--aia-confirm-color);\n\n --aia-footer-hint-color: var(--aia-primitive-neutral-700);\n --aia-footer-brand-color: var(--aia-primitive-neutral-500);\n --aia-footer-badge-border: var(--aia-primitive-neutral-500);\n}\n\n/* Footer band — the option list runs *under* the dropdown footer and dissolves\n into it, instead of being cut off mid-row above it. The band is the footer's\n own height — its top inset (--aia-footer-gap) + --aia-footer-row-height:\n - the options grid reserves it as bottom padding, so the last option can\n still be scrolled fully clear of the footer;\n - --aia-grid-overlap-bottom (the band + the 8px stack gap) pulls the footer\n back up over that band;\n - the footer's background is the fade: transparent at the band's top edge,\n the full dropdown surface at its bottom, so a row dissolves as it passes\n behind. Its hint and branding groups sit on a 65%-opaque fill of their\n own (--aia-footer-chip-bg) so they stay legible across it.\n Lives here rather than with the dropdown's own rules so the\n optionsPosition=\"above\" reset below always follows it in the cascade. */\n[data-aia-dropdown] {\n /* Height of the footer's hint / branding row — the badge is its tallest item\n (the kbd is shorter and centers against it). The band derives from it, so\n restyling the badge's height keeps the overlap in step. */\n --aia-footer-row-height: 23px;\n --aia-footer-band: calc(var(--aia-footer-gap, 12px) + var(--aia-footer-row-height, 23px));\n --aia-grid-scroll-bottom: var(--aia-footer-band);\n --aia-grid-overlap-bottom: calc(-1 * (var(--aia-footer-band) + 8px));\n /* How far above the band the fade starts. */\n --aia-footer-fade-lead: 20px;\n --aia-footer-fade-inset: calc(-1 * var(--aia-footer-fade-lead)) 0 0;\n}\n\n/* In the dropdown, the parameter label reads as a section header for the\n options beneath it — not an outlined chip floating over them. It drops the\n pill's inner horizontal padding and left-aligns its text with the option\n text below, which sits 10px in from the dropdown's content edge. The label's\n own list wrapper carries that 10px so the text lands exactly on the option\n text's left edge.\n\n Selector shape differs from the vanilla/Angular copies (which target the\n \\`.aia-pill-list\\` / \\`.aia-pill\\` class names): the module classes here are\n hash-scoped locals, unreachable from this global stylesheet. The bar's\n direct \\`> span\\` child is the masked scroll wrapper (\\`.pillScroll\\`, tagged\n \\`data-aia-pill-scroll\\`) that holds PillList, so the 10px indent lands on\n the wrapper and the module zeroes PillList's own base padding underneath\n (\\`.pillScroll > span\\` in AIAutocompleteDropdown.module.css — remove one\n only with the other). Pills are matched via \\`[data-aia-pill]\\` (unique to\n ParamPill). Like the sibling structural \\`[data-aia-dropdown]\\` rules below,\n this is deliberately NOT \\`:where()\\`-wrapped — it must win over ParamPill's\n own \\`.pill\\` base rule. */\n[data-aia-dropdown] [data-aia-pillbar] > span {\n padding-inline: 10px;\n}\n[data-aia-dropdown] [data-aia-pillbar] [data-aia-pill] {\n justify-content: flex-start;\n border-inline-width: 0;\n padding-inline: 0;\n padding-block: 5px;\n}\n\n/* The reserved band the footer overlaps. Declared here, apart from the grid\n primitive, because it is the dropdown's concern rather than the grid's — and\n it once lived inside a \\`@layer layout\\` block, where a consumer's unlayered\n reset zeroed it silently. No SDK rule is layered any more (the isolation\n rule above is unlayered, and a layered rule would lose to it). */\n[data-aia-dropdown] .aia-grid[data-scroll] {\n padding-top: var(--aia-grid-scroll-top, 0);\n padding-bottom: var(--aia-grid-scroll-bottom, 0);\n margin-top: var(--aia-grid-overlap-top, 0);\n margin-bottom: var(--aia-grid-overlap-bottom, 0);\n}\n\n/* The fade. Painted on a pseudo-element rather than the footer box so it can\n start --aia-footer-fade-lead above the band's top edge: a row is then already\n dissolving by the time it reaches the hint / branding line, instead of\n crossing it at half strength. --aia-surface is what the dropdown paints\n itself with, so theming the surface retints the fade with it. z-index: -1\n keeps it under the footer's own content but, via the footer's stacking\n context, above the option rows.\n The gradient is solid from the footer's top edge, so no option shows\n behind the hint, badge or scroll arrow. */\n[data-aia-dropdown] [data-aia-footer]::before {\n content: \"\";\n position: absolute;\n inset: var(--aia-footer-fade-inset, -20px 0 0);\n z-index: -1;\n pointer-events: none;\n background: linear-gradient(\n to bottom,\n transparent,\n var(--aia-surface, #ffffff) var(--aia-footer-fade-lead, 20px)\n );\n}\n\n/* The glass surface is translucent — there's no solid color to dissolve into,\n and a fill behind the hint / branding would paint an opaque patch on a\n frosted panel. Both opt out. */\n[data-aia-dropdown][data-aia-surface=\"glass\"] {\n --aia-footer-chip-bg: transparent;\n}\n\n[data-aia-dropdown][data-aia-surface=\"glass\"] [data-aia-footer]::before {\n display: none;\n}\n\n/* optionsPosition: dropdown above the input. The sections live inside the\n dropdown's .aia-stack, so the reversal targets the stack (not the dropdown,\n whose only child is the stack).\n Two forms are supported:\n 1. ancestor form — Tier 1 sets data-options-position on the .magicx-aia\n container and the dropdown is a descendant.\n 2. self form — headless consumers spread \\`optionsPosition\\` from the hook's\n dropdownProps, so the attribute lands on the dropdown element itself.\n This lets the dropdown position above with NO wrapper attribute and no\n hand-copied CSS. */\n:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown],\n[data-aia-dropdown][data-options-position=\"above\"] {\n /* The stack is reversed here (the footer sits on top of the list), so the\n reserved band and the overlap flip to the top edge. */\n --aia-grid-scroll-bottom: 0px;\n --aia-grid-overlap-bottom: 0px;\n --aia-grid-scroll-top: var(--aia-footer-band);\n --aia-grid-overlap-top: calc(-1 * (var(--aia-footer-band) + 8px));\n --aia-footer-fade-inset: 0 0 calc(-1 * var(--aia-footer-fade-lead));\n top: auto;\n bottom: 100%;\n margin-top: 0;\n margin-bottom: var(--aia-dropdown-offset, 13px);\n}\n\n/* Declared after the optionsPosition=\"above\" block on purpose: that rule's\n second selector ([data-aia-dropdown][data-options-position=\"above\"]) has the\n same two-attribute specificity as this one, so source order is what decides\n which wins when a strip is present in an above-positioned dropdown. */\n/* Product strip present: the footer no longer sits on the scrolling option\n list — the strip is between them — so there is nothing to ride up over and\n nothing to reserve. Zeroing the band HERE, where it is defined, is the fix:\n the pull is a property of \"footer directly over the list\", not of the grid,\n and any section rendered after the grid would otherwise inherit it and land\n on top of the last option row. Both edges are zeroed because\n optionsPosition=\"above\" flips which one is in play. */\n[data-aia-dropdown][data-aia-has-products] {\n --aia-grid-scroll-bottom: 0px;\n --aia-grid-overlap-bottom: 0px;\n --aia-grid-scroll-top: 0px;\n --aia-grid-overlap-top: 0px;\n /* The fade exists to dissolve rows sliding under the footer. With the strip\n in between it has nothing to dissolve and would just wash over the cards. */\n --aia-footer-fade-lead: 0px;\n /* Nor does the footer's row need to fill a band that is not reserved: it\n holds that height only to cover the band (the footer-row rule), and here\n an empty row would just leave a blank strip under the cards. */\n --aia-footer-row-min-height: 0px;\n}\n\n:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] .aia-stack,\n[data-aia-dropdown][data-options-position=\"above\"] .aia-stack {\n flex-direction: column-reverse;\n}\n\n/* The footer now sits on top of the list, so its breathing room flips to the\n bottom edge — the side the option rows scroll under. */\n:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer],\n[data-aia-dropdown][data-options-position=\"above\"] [data-aia-footer] {\n padding: 0 0 var(--aia-footer-gap, 12px) 8px;\n}\n\n/* ...and the fade runs the other way, out of the footer and down into the list. */\n:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer]::before,\n[data-aia-dropdown][data-options-position=\"above\"] [data-aia-footer]::before {\n background: linear-gradient(\n to top,\n transparent,\n var(--aia-surface, #ffffff) var(--aia-footer-fade-lead, 20px)\n );\n}\n\n/* Disable all animations when data-animations=\"off\" */\n:where(.magicx-aia[data-animations=\"off\"]) *,\n:where(.magicx-aia[data-animations=\"off\"]) *::before,\n:where(.magicx-aia[data-animations=\"off\"]) *::after {\n animation-duration: 0s !important;\n transition-duration: 0s !important;\n /* biome-ignore lint/complexity/noImportantStyles: a delayed close must not linger with animations off */\n transition-delay: 0s !important;\n}\n\n/* Desktop footer is opaque: the option list clips at the footer's edge instead\n of showing through it — the scroll cue lives in the last visible row's own\n text instead (the option scroll-hint rule). Mobile keeps the fade. Declared\n last, and carrying the unwrapped above-position selector some copies use\n (so it ties that rule's higher specificity and wins on cascade order);\n the glass surface still hides this pseudo-element entirely. */\n@media (min-width: 769px) {\n [data-aia-dropdown] [data-aia-footer]::before,\n [data-aia-dropdown][data-options-position=\"above\"] [data-aia-footer]::before,\n :where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer]::before {\n inset: 0;\n background: var(--aia-surface, #ffffff);\n }\n}\n\n/* Fitted to the visible viewport. When the open panel would run past the\n screen's edge (a phone's keyboard, a short window), the core's viewportFit\n controller sets data-aia-fit and caps the panel at the space that is left\n (--aia-dropdown-fit-height). The section stack becomes the one scroll box:\n the options grid drops its own row cap, so options, product strip and\n footer scroll together and the strip is reached by scrolling past the last\n option instead of being cut off below it. Nothing slides under the footer\n any more, so its reserved band goes, as it does with a product strip.\n Declared last: the two-attribute selector ties the unwrapped\n above-position rule some copies carry, and must win it on source order. */\n[data-aia-dropdown][data-aia-fit] {\n max-height: var(--aia-dropdown-fit-height, none);\n --aia-grid-scroll-bottom: 0px;\n --aia-grid-overlap-bottom: 0px;\n --aia-grid-scroll-top: 0px;\n --aia-grid-overlap-top: 0px;\n --aia-footer-fade-lead: 0px;\n --aia-footer-row-min-height: 0px;\n}\n\n/* The stack is the panel's flex child, so it shrinks to the cap and scrolls.\n It reaches 6px into the panel's side padding on each side: the product row\n hangs that far outside the stack (its cards' hover fill), and a scroll box\n clips sideways as well as down. The scrollbar is hidden, as the grid's is. */\n[data-aia-dropdown][data-aia-fit] > .aia-stack {\n flex: 1 1 auto;\n min-height: 0;\n margin-inline: -6px;\n padding-inline: 6px;\n overflow-x: hidden;\n overflow-y: auto;\n overscroll-behavior: contain;\n scrollbar-width: none;\n}\n\n[data-aia-dropdown][data-aia-fit] > .aia-stack::-webkit-scrollbar {\n display: none;\n}\n\n/* Sections keep their own height and overflow the stack instead. Flex items\n shrink by default, and one that clips (the pill bar is overflow: hidden)\n has no content floor to stop it — it collapsed to nothing. */\n[data-aia-dropdown][data-aia-fit] > .aia-stack > * {\n flex-shrink: 0;\n}\n\n/* The grid shows every row and leaves the scrolling to the stack. Not a\n scroll box at all, so a swipe that starts on an option scrolls the panel. */\n[data-aia-dropdown][data-aia-fit] .aia-grid[data-scroll] {\n max-height: none;\n overflow: visible;\n}\n\n/* A calendar is the exception to \"sections keep their own height\": a month\n cut off mid-week reads as broken, and nothing shows that the rest is a\n scroll away. So it gives instead: its weeks squeeze to share the space that\n is left (the datepicker's weeks rule, which sets the floor), and only below\n that floor does the stack scroll. */\n[data-aia-dropdown][data-aia-fit] [data-aia-datepicker] {\n flex-shrink: 1;\n min-height: 0;\n}\n\n/* The footer goes while a calendar is fitted. Its keyboard hint and badge\n would take a week and a half of rows from a month that is already short of\n room, and the calendar's own bottom padding then closes the panel. */\n[data-aia-dropdown][data-aia-fit]:has([data-aia-datepicker]) [data-aia-footer] {\n display: none;\n}\n\n[data-aia-dropdown][aria-multiselectable=\"true\"] {\n --aia-grid-scroll-bottom: 0px;\n --aia-grid-overlap-bottom: 0px;\n --aia-grid-scroll-top: 0px;\n --aia-grid-overlap-top: 0px;\n --aia-footer-fade-lead: 0px;\n --aia-footer-row-min-height: 0px;\n}\n\n/* A multi-select shows three rows and scrolls the rest, in every layout (one\n column, two columns, phone), so its Done button always sits right under\n the third row. The planned cap (--aia-grid-max-height) still wins when it\n is smaller: three rows of options or fewer. --aia-option-peek (a unitless\n number of rows, 0 or more, default 0, set by the consumer on the widget or\n any ancestor) shows that much of the next row when the list scrolls; the\n planned cap carries it too, but only for a list that scrolls, so a list of\n three or fewer is never padded out. max() reads a negative as 0. A value\n with a unit makes the calc invalid and the cap is lost: nothing here can\n catch that, and the reference says so. */\n[data-aia-dropdown][aria-multiselectable=\"true\"] .aia-grid[data-scroll] {\n max-height: min(\n var(--aia-grid-max-height, 120px),\n calc((3 + max(0, var(--aia-option-peek, 0))) * var(--aia-option-row-height, 37px))\n );\n}\n\n/* Fitted to the viewport, every other grid hands its scrolling to the panel,\n which would carry Done off screen with the rows. A multi-select keeps its\n own three-row scroll box, and gives up rows before the panel has to scroll,\n so Done stays in view. */\n[data-aia-dropdown][data-aia-fit][aria-multiselectable=\"true\"] .aia-grid[data-scroll] {\n flex-shrink: 1;\n min-height: var(--aia-option-row-height, 37px);\n max-height: min(\n var(--aia-grid-max-height, 120px),\n calc((3 + max(0, var(--aia-option-peek, 0))) * var(--aia-option-row-height, 37px))\n );\n overflow-y: auto;\n}\n\n/* Floating options box (2026-11). The panel reads as a light sheet under the\n text: no footer, only the parameter being asked (sentence case), \"skip\" at\n the header row's trailing edge, and roomier rows. With no footer there is\n no band for the rows to slide under, so it is zeroed in every layout.\n Declared last so it follows every rule that sets the band. Mirrored in all\n four appearance copies; floatingOptionsParity.test.ts pins them together. */\n[data-aia-dropdown] [data-aia-footer] {\n display: none;\n}\n/* Doubled attribute: ties the above-position rule's specificity and wins on\n source order, so both edges are zeroed whichever side the panel opens on. */\n[data-aia-dropdown][data-aia-dropdown] {\n --aia-grid-scroll-bottom: 0px;\n --aia-grid-overlap-bottom: 0px;\n --aia-grid-scroll-top: 0px;\n --aia-grid-overlap-top: 0px;\n --aia-footer-fade-lead: 0px;\n --aia-footer-row-min-height: 0px;\n}\n[data-aia-dropdown] [data-aia-pillbar] [data-aia-pill]:not([data-aia-pill-active]) {\n display: none;\n}\n/* One label, one placeholder: the loading skeletons carry no data-aia-pill, so\n the rule above leaves them alone. Keep the first and hide the rest. */\n[data-aia-dropdown] [data-aia-pillbar] [data-aia-pill-skeleton] ~ [data-aia-pill-skeleton] {\n display: none;\n}\n[data-aia-dropdown] [data-aia-pillbar] [data-aia-pill-scroll] {\n flex: 0 1 auto;\n mask-image: none;\n -webkit-mask-image: none;\n}\n/* The live label reads at full strength. The pill's positional opacity ramp\n is a custom property the pill's own rule reads, so this plain declaration\n wins by specificity, and the pill's entrance fade and a loading chip's\n skeleton fades still animate over it. */\n[data-aia-dropdown] [data-aia-pillbar] [data-aia-pill][data-aia-pill-active] {\n text-transform: none;\n letter-spacing: normal;\n font-size: var(--aia-param-label-font-size, 17px);\n font-weight: 500;\n opacity: 1;\n}\n/* A flex container has no ::first-letter; the label is plain text, so an\n inline block lays it out the same and lets it take a capital. A Smart\n Suggestion header keeps its flex layout: its gap and centring hold the\n sparkle beside the text. */\n[data-aia-dropdown]\n [data-aia-pillbar]\n [data-aia-pill][data-aia-pill-active]:not([data-aia-smart-suggestion]) {\n display: inline-block;\n}\n[data-aia-dropdown]\n [data-aia-pillbar]\n [data-aia-pill][data-aia-pill-active]:not([data-aia-smart-suggestion])::first-letter {\n text-transform: uppercase;\n}\n[data-aia-dropdown] [data-aia-pillbar] [data-aia-skip] {\n padding-inline: 8px;\n font-size: var(--aia-skip-font-size, 13.5px);\n}\n/* Roomier rows: 15px above and below each option instead of 8px. The\n row height feeds the visible-rows cap (planOptionsGrid), so it moves with\n the padding; picture and parameter-line rows add the same padding to their\n own heights. Tokens on the themed root at zero specificity, like the rest,\n so a consumer's value wins and the classic block below can restore its own. */\n:where(.magicx-aia) {\n --aia-option-padding-block: 15px;\n --aia-option-row-height: calc(21px + 2 * var(--aia-option-padding-block));\n}\n/* The panel hugs its options (panelHugWidth): as wide as the widest option\n times the columns, plus the panel's padding and 36px of breathing room,\n never under the header row (the whole label and \"skip\") or the minimum,\n nor over the full width. Desktop only: on a phone the panel keeps the\n full width. The width is set only on a panel of plain options; pickers and\n product strips stay full width. The rules below skip optionsStyle:\n \"classic\", which keeps the full-width panel, the fitted Done and the\n chevron. */\n@media (min-width: 769px) {\n [data-aia-dropdown][data-aia-hug]:not(:where([data-aia-options-style=\"classic\"] *)) {\n inset-inline-end: auto;\n width: clamp(\n min(var(--aia-panel-min-width, 160px), 100%),\n var(--aia-panel-fit-width, 100%),\n 100%\n );\n }\n}\n/* While the panel glides to a new width (panelMorph.ts), its new content is\n laid out at the width it lands at, so it never rewraps under the glide:\n wider, the panel, which clips, reveals it as it opens; narrower, it starts\n at its final width instead of squeezing frame by frame. The leaving copy\n keeps its own width. */\n[data-aia-dropdown][data-aia-glide-width]\n > :not(.magicx-aia-panel-ghost):not([data-aia-scroll-arrow]) {\n min-width: var(--aia-glide-content-width, auto);\n max-width: var(--aia-glide-content-width, none);\n}\n/* The All row's tile shows the first options' pictures together: two side by\n side, three as a tall half and two quarters, four in a 2x2 grid. Each is\n cropped to its cell, since a contained picture would leave the cells\n mostly empty. */\n[data-aia-option] [data-aia-collage] {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1px;\n}\n[data-aia-option] [data-aia-collage=\"3\"],\n[data-aia-option] [data-aia-collage=\"4\"] {\n grid-template-rows: 1fr 1fr;\n}\n[data-aia-option] [data-aia-collage=\"3\"] > img:first-child {\n grid-row: 1 / span 2;\n}\n[data-aia-option] [data-aia-collage] > img {\n width: 100%;\n height: 100%;\n min-width: 0;\n min-height: 0;\n object-fit: cover;\n}\n/* Done spans the panel, whatever the panel's width. */\n[data-aia-dropdown]:not(:where([data-aia-options-style=\"classic\"] *)) [data-aia-multi-done] {\n width: var(--aia-multi-done-width, 100%);\n}\n/* A long list shows a thin scrollbar on its right edge instead of the\n \"more below\" chevron: the same button (scrollArrow.ts), drawn as a 3px\n rounded thumb on a faint track, placed and sized by the inline\n --aia-scroll-track-* / --aia-scroll-thumb-* vars. Shown whenever the list\n overflows (data-aia-scrollable), at the top, mid-scroll and at the end;\n it takes no clicks, the list scrolls by wheel, touch and keyboard. */\n[data-aia-dropdown]:not(:where([data-aia-options-style=\"classic\"] *)) [data-aia-scroll-arrow] {\n top: var(--aia-scroll-track-top, 0px);\n right: var(--aia-scroll-track-right, 0px);\n bottom: auto;\n left: auto;\n width: 3px;\n height: var(--aia-scroll-track-height, 0px);\n margin: 0 2px 0 0;\n border-radius: 3px;\n background: var(--aia-scrollbar-track, rgba(15, 23, 42, 0.05));\n pointer-events: none;\n animation: none;\n transition: opacity 200ms ease-out;\n}\n[data-aia-dropdown]:not(:where([data-aia-options-style=\"classic\"] *)) [data-aia-scroll-arrow] svg {\n display: none;\n}\n[data-aia-dropdown]:not(:where([data-aia-options-style=\"classic\"] *))\n [data-aia-scroll-arrow]::after {\n content: \"\";\n position: absolute;\n top: var(--aia-scroll-thumb-top, 0px);\n left: 0;\n width: 100%;\n height: var(--aia-scroll-thumb-height, 0px);\n border-radius: 3px;\n background: var(--aia-scrollbar-thumb, rgba(15, 23, 42, 0.22));\n}\n[data-aia-dropdown]:not(:where([data-aia-options-style=\"classic\"] *))\n [data-aia-scroll-arrow][data-aia-visible] {\n pointer-events: none;\n opacity: 0;\n}\n[data-aia-dropdown]:not(:where([data-aia-options-style=\"classic\"] *))\n [data-aia-scroll-arrow][data-aia-scrollable] {\n opacity: 1;\n}\n/* Room between the last row and Done, so the last line reads clear of it. */\n[data-aia-dropdown]:not(:where([data-aia-options-style=\"classic\"] *)) [data-aia-multi-actions] {\n padding-top: 14px;\n}\n/* End floating options box. */\n\n/* Classic options box (optionsStyle: \"classic\"): the panel as it was\n before the floating box: it unfolds out of the input with a stroke, at\n full size. Generated from the values the floating-box changes replaced;\n keep in step across the vanilla, React and Angular copies. */\n/* The attribute may sit on the themed root itself (Tier 1) or on an ancestor\n of it: a standalone dropdown given \\`mode\\` carries \\`.magicx-aia\\` on its own\n root, below the element the consumer marks classic. Both forms are zero\n specificity and come after the floating tokens, so they win on order while\n a consumer's own value still beats them. */\n:where(.magicx-aia[data-aia-options-style=\"classic\"]),\n:where(.magicx-aia[data-aia-options-style=\"classic\"][data-mode=\"light\"]),\n:where([data-aia-options-style=\"classic\"] .magicx-aia),\n:where([data-aia-options-style=\"classic\"] .magicx-aia[data-mode=\"light\"]) {\n --aia-dropdown-border: var(--aia-primitive-neutral-900-a50);\n --aia-option-font-size: 16px;\n /* Full-size rows with classic's own 8px padding. The first two selectors\n match in dark mode too, so the rows hold in both. */\n --aia-option-padding-block: 8px;\n --aia-option-row-height: 37px;\n}\n:where(.magicx-aia[data-aia-options-style=\"classic\"][data-mode=\"dark\"]),\n:where([data-aia-options-style=\"classic\"] .magicx-aia[data-mode=\"dark\"]) {\n --aia-dropdown-border: var(--aia-primitive-neutral-400-a50);\n --aia-option-font-size: 16px;\n}\n:where(.magicx-aia[data-aia-options-style=\"classic\"][data-options-position=\"above\"])\n [data-aia-dropdown],\n:where([data-aia-options-style=\"classic\"]) [data-aia-dropdown][data-options-position=\"above\"] {\n transform-origin: 50% 100%;\n}\n:where([data-aia-options-style=\"classic\"]) [data-aia-dropdown] [data-aia-pillbar] [data-aia-pill] {\n padding-block: 5px;\n}\n:where([data-aia-options-style=\"classic\"])\n [data-aia-dropdown][aria-multiselectable=\"true\"]\n .aia-grid[data-scroll] {\n max-height: min(\n var(--aia-grid-max-height, 120px),\n calc((3 + max(0, var(--aia-option-peek, 0))) * var(--aia-option-row-height, 37px))\n );\n}\n:where([data-aia-options-style=\"classic\"])\n [data-aia-dropdown][data-aia-fit][aria-multiselectable=\"true\"]\n .aia-grid[data-scroll] {\n min-height: var(--aia-option-row-height, 37px);\n max-height: min(\n var(--aia-grid-max-height, 120px),\n calc((3 + max(0, var(--aia-option-peek, 0))) * var(--aia-option-row-height, 37px))\n );\n}\n:where([data-aia-options-style=\"classic\"])\n [data-aia-dropdown]\n [data-aia-pillbar]\n [data-aia-pill][data-aia-pill-active] {\n font-size: var(--aia-param-label-font-size, 13.5px);\n}\n:where([data-aia-options-style=\"classic\"]) [data-aia-dropdown] [data-aia-pillbar] [data-aia-skip] {\n padding-inline: 8px;\n font-size: var(--aia-skip-font-size, 13.5px);\n}\n`;\n document.head.appendChild(s);\n}\nexport {};","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-3819c762\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-3819c762\";\n s.textContent = `.aia-dropdown-yz2KC {\n position: absolute;\n left: 0;\n right: 0;\n top: 100%;\n /* Widest the panel gets; \\`none\\` lets it span the whole field. */\n max-width: var(--aia-dropdown-max-width, 544px);\n /* Gap between the input box and the dropdown. Tunable via --aia-dropdown-offset. */\n margin-top: var(--aia-dropdown-offset, 13px);\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n /* The left padding derives from --aia-content-inset-left, the token the\n input wrapper reads for its own left padding. The option text and the\n parameter label sit 10px inside this padding edge (the option's padding;\n the pill bar's list wrapper carries the same 10px — see appearance.css),\n and the product strip is inset to the same line, so the whole panel's\n content starts exactly under the typed text. max() keeps the padding at\n zero (never negative, which CSS would clamp anyway) for a token under\n 10px — the input wrapper floors the token at 10px to match. */\n padding: 10px 8px 10px max(0px, calc(var(--aia-content-inset-left, 16px) - 10px));\n overflow: hidden;\n container-type: inline-size;\n z-index: 10;\n opacity: 0;\n pointer-events: none;\n /* Closed, the panel rests in place, transparent and softly blurred, so it\n floats in as a dissolve rather than dropping down (the panel's dissolve\n motion): out is 280ms on a soft ease back to opacity 0 and a 2px\n blur. */\n filter: blur(2px);\n /* The 220ms beat before closing covers the gap between a keystroke that\n filters every option away and the next response, so typing never blinks\n the panel out and back. */\n /* Closed, the panel keeps its full size (the floating box does not collapse\n it), so pointer-events: none alone would still leave an invisible box\n over the page: a descendant that sets pointer-events: auto (the pill row,\n the scroll arrow) takes taps through it, and it stays in the tab order.\n visibility: hidden once the fade has run removes it from hit testing and\n focus; the 0s visibility transition waits out the beat and the fade\n (220ms + 280ms), so the dissolve still plays. */\n visibility: hidden;\n transition:\n opacity 280ms cubic-bezier(0.25, 0.1, 0.25, 1) 220ms,\n filter 280ms cubic-bezier(0.25, 0.1, 0.25, 1) 220ms,\n visibility 0s linear 500ms;\n /* Solid surface is the default (matches the Figma components). Opt into the\n frosted-glass look with data-aia-surface=\"glass\". */\n background: var(--aia-surface, #ffffff);\n /* No stroke by default: the 1px border stays (transparent) so the\n geometry does not move; set --aia-dropdown-border to draw one. */\n border: 1px solid var(--aia-dropdown-border, transparent);\n border-radius: 9px;\n /* Flat by default; consumers can set --aia-dropdown-shadow for elevation. */\n box-shadow: var(--aia-dropdown-shadow, none);\n}\n\n/* A calendar has nothing wide to read, so the whole panel narrows with it —\n the option grid's 544px cap leaves a month floating in empty panel. The\n :has() argument is the datepicker's data attribute, which all three packages\n emit identically; only the panel class differs per copy. */\n.aia-dropdown-yz2KC:has([data-aia-datepicker]) {\n max-width: var(--aia-date-panel-width, 312px);\n}\n\n/* The time wheel is narrower still — three short wheels and a button. */\n.aia-dropdown-yz2KC:has([data-aia-time-wheel]) {\n max-width: var(--aia-time-panel-width, 240px);\n}\n\n.aia-dropdown-yz2KC[data-aia-surface=\"glass\"] {\n background: transparent;\n border-color: transparent;\n box-shadow:\n hsla(0, 0%, 100%, 1) -3.2px -3.2px 3.2px -3.2px inset,\n hsla(0, 0%, 100%, 1) 6.4px 6.4px 1.6px -8px inset,\n var(--aia-dropdown-bg, transparent) -6.4px 6.4px 1.6px -8px inset, /* same color as bg */\n var(--aia-dropdown-bg, transparent) 6.4px -6.4px 1.6px -8px inset, /* same color as bg */\n hsla(0, 0%, 100%, 0.15) -1.6px 0px 0px -1.6px inset,\n hsla(0, 0%, 100%, 0.15) 0px -1.6px 0px -1.6px inset,\n hsla(0, 0%, 100%, 0.3) 0px 1.6px 0px 0px inset,\n hsla(0, 0%, 100%, 0.3) 1.6px 0px 0px 0px inset,\n inset 0 0 30px 5px hsla(0, 0%, 0%, 0.05);\n backdrop-filter: blur(30px);\n}\n\n/* Opening: the panel dissolves in where it sits — opacity and the 2px blur\n resolve together over 320ms after a 40ms beat — while the option rows\n cascade in on top of it. */\n.aia-visible-QCoXj {\n opacity: 1;\n pointer-events: auto;\n filter: none;\n visibility: visible;\n transition:\n opacity 320ms cubic-bezier(0.25, 0.1, 0.25, 1) 40ms,\n filter 320ms cubic-bezier(0.25, 0.1, 0.25, 1) 40ms,\n visibility 0s;\n}\n\n/* \"More below\" scroll arrow — see the core's render/scrollArrow.ts.\n A bare down chevron at the bottom-centre of the option list, shown while\n there is more to scroll to — no disc, border or shadow around it. It rests\n just above the grid's reserved band, or — when a product strip follows the\n grid — centred on the strip's \"Items\" label row, off the last option row\n (--aia-scroll-arrow-bottom is measured and set inline by the controller so\n it tracks the layout). It never travels with the scroll: the controller toggles\n data-aia-visible and the only thing that transitions is opacity — a slow,\n even second in and the same second out. Its one motion is an idle bob, a few\n pixels up and back over a couple of seconds, running all the time so a fade\n never restarts it mid-stroke. z-index 4 puts it over the option rows and the\n footer (z-index 3), whose opaque fade plate would otherwise bury it.\n Declarations mirror vanilla's .magicx-aia-scroll-arrow and Angular's copy —\n change all three in the same commit. */\n.aia-scrollArrow-uUzV0 {\n position: absolute;\n left: 50%;\n bottom: var(--aia-scroll-arrow-bottom, 8px);\n /* Above the footer (z-index 3): its fade plate is opaque on desktop and\n would otherwise bury the chevron, which sits half over it by design. */\n z-index: 4;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n margin: 0 0 0 -16px;\n padding: 0;\n /* Just the chevron: the 32px box is the hit target, nothing is drawn on it. */\n border: 0;\n border-radius: 0;\n background: transparent;\n color: var(\n --aia-scroll-arrow-color,\n var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb))\n );\n box-shadow: none;\n cursor: pointer;\n pointer-events: none;\n /* Hidden: transparent, in place. Only opacity ever transitions, so the\n chevron cannot travel. One second each way — SCROLL_ARROW_FADE_MS in\n scrollArrow.ts documents this number; change both together. */\n opacity: 0;\n transition: opacity 1000ms cubic-bezier(0.4, 0, 0.2, 1);\n /* The idle bob: 3px up and back, eased both ways, always running. */\n animation: aia-magicx-aia-scroll-arrow-bob-z-HXC 2600ms ease-in-out infinite;\n}\n\n@keyframes aia-magicx-aia-scroll-arrow-bob-z-HXC {\n 0%,\n 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-3px);\n }\n}\n\n.aia-scrollArrow-uUzV0[data-aia-visible] {\n pointer-events: auto;\n opacity: 1;\n}\n\n/* Visible but not yet armed: the arrow is disabled for the length of its\n fade-in (scrollArrow.ts — a native button appearing clickable cancels an\n iOS tap in flight). No pointer cursor over a button that takes no click. */\n.aia-scrollArrow-uUzV0:disabled {\n cursor: default;\n}\n\n/* The chevron's size and paint by class — a page's \\`svg { … }\\` type rule\n would otherwise beat its presentation attributes. */\n.aia-scrollArrow-uUzV0 svg {\n width: 14px;\n height: 14px;\n fill: none;\n stroke: currentColor;\n}\n.aia-scrollArrow-uUzV0 svg path {\n fill: none;\n stroke: currentColor;\n}\n\n.aia-scrollArrow-uUzV0:hover {\n color: var(\n --aia-scroll-arrow-color-hover,\n var(--aia-option-color-selected, var(--aia-color-text-default, #fff))\n );\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-scrollArrow-uUzV0,\n .aia-dropdown-yz2KC {\n animation-duration: 0s;\n animation-delay: 0s;\n transition-duration: 0s;\n transition-delay: 0s;\n }\n}\n\n/* The dropdown container owns the 10px/8px edge padding and the 8px section\n gaps (matching Figma); the pill row adds none. The horizontal scroll + fade\n live on the inner .pillScroll wrapper, NOT the bar itself: the trailing skip\n button is the bar's other child, and a mask on the bar would fade it out\n along with the overflowing pills it's meant to sit beside. */\n.aia-pillBar-pwTXe {\n overflow: hidden;\n}\n\n/* Scrollable region for the pills. The appearance layer's\n \\`[data-aia-pillbar] > span\\` rule lands here (10px inline padding aligning\n the param label with the option text), so the inner PillList span must not\n add its own base padding on top — see the child rule below. */\n.aia-pillScroll-Tpzus {\n display: inline-flex;\n align-items: center;\n flex: 1 1 auto;\n min-width: 0;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 48px), transparent 100%);\n -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 48px), transparent 100%);\n}\n\n.aia-pillScroll-Tpzus > span {\n padding-inline: 0;\n}\n\n.aia-pillScroll-Tpzus::-webkit-scrollbar {\n display: none;\n}\n\n/* Trailing \"skip\" button — dismisses the active pill, same action as pressing\n → at the end of the input. Pinned at the bar's far edge (auto inline-start\n margin), outside the masked scroller. Typography follows the footer hint\n (quiet chrome), not the pills. Declarations mirror \\`.magicx-aia-skip\\` in the\n vanilla stylesheet — change both in the same commit. */\n.aia-skip-7-olS {\n display: inline-flex;\n align-items: center;\n margin-inline-start: auto;\n flex-shrink: 0;\n padding: 5px 8px;\n border: none;\n /* Matches the completed-param chip radius, so the hover fill reads as a\n soft rectangle rather than a capsule. */\n border-radius: 6px;\n background: transparent;\n font-family: inherit;\n font-size: var(--aia-skip-font-size, 13.5px);\n line-height: 18px;\n color: var(--aia-skip-color, var(--aia-footer-hint-color, #505050));\n cursor: pointer;\n white-space: nowrap;\n transition:\n color 150ms ease-out,\n background-color 150ms ease-out,\n opacity 160ms ease-out;\n}\n\n.aia-skip-7-olS:hover {\n color: var(--aia-skip-color-hover, var(--aia-pill-color, var(--aia-color-text-muted, #c1c4cb)));\n /* Same fill as a highlighted option row (--aia-option-bg), so the hover\n reads with the dropdown's own hover language and stays visible on both\n mode surfaces. */\n background: var(--aia-skip-hover-bg, var(--aia-option-bg, transparent));\n}\n\n/* Disabled while a request is in flight (and in the press window after a\n pick, which always starts one): it fades out with the options and back in\n when the response lands. */\n.aia-skip-7-olS:disabled {\n pointer-events: none;\n cursor: default;\n /* 0.01, never 0: iOS reads exactly 0 as hidden, and this button is\n re-enabled in place, so a tap in flight would be cancelled. */\n opacity: 0.01;\n}\n\n/* --- Fallback loading space (only when no pills/options are cached) ---\n Holds the box's height while a request is in flight; nothing is drawn. */\n.aia-skeletonBars-HVr9C {\n display: flex;\n flex-direction: column;\n gap: 20px;\n padding: 7px 8px;\n visibility: hidden;\n}\n\n.aia-skeletonBar-O3xIx {\n display: block;\n height: 14px;\n}\n\n/* A picker with its own Done button (multi-select, time wheel) ends on that\n button: the footer is not shown under it. */\n.aia-dropdown-yz2KC:has([data-aia-multi-done]) [data-aia-footer],\n.aia-dropdown-yz2KC:has([data-aia-time-wheel]) [data-aia-footer] {\n display: none;\n}\n\n/* The multi-select Done button: the time wheel's Done, full width. */\n.aia-multiDone-y12U7 {\n display: block;\n /* As wide as the widest option (set by fitMultiSelectDone), never\n narrower than the minimum nor wider than the panel. */\n width: var(--aia-multi-done-width, var(--aia-multi-done-fit, 100%));\n min-width: min(var(--aia-multi-done-min-width, 120px), 100%);\n max-width: 100%;\n height: 44px;\n padding: 0 12px;\n border: none;\n border-radius: 12px;\n background: var(--aia-multi-done-bg, var(--aia-done-bg, #e4e8f0));\n color: var(--aia-multi-done-color, var(--aia-done-color, #2a3150));\n font-family: inherit;\n font-size: 15px;\n font-weight: 600;\n line-height: 20px;\n cursor: pointer;\n transition: background-color 150ms ease-out;\n}\n\n.aia-multiDone-y12U7:hover {\n background: var(--aia-multi-done-bg-hover, var(--aia-done-bg-hover, #d8dde8));\n}\n\n/* With a \"See all results\" button in the same panel, that button is the\n filled one: Done drops its fill so the panel does not end on two solid\n bars (vanilla's styles.css explains the two tokens). */\n.aia-dropdown-yz2KC:has([data-aia-see-all]) .aia-multiDone-y12U7:not(:hover) {\n background: var(--aia-multi-done-bg-beside-see-all, transparent);\n color: var(--aia-multi-done-color-beside-see-all, var(--aia-option-color-selected, #2a3150));\n}\n\n/* --- See all results (opt-in: \\`seeAllResults\\`) ---\n A button under the products that submits the query: near-black in light\n mode, the confirm gray in dark (appearance.css sets both). The same box as\n the multi-select Done above it. Declarations match vanilla's styles.css\n (seeAllResultsParity.test.ts). */\n.aia-seeAllRow-icrau {\n padding: 4px 0 0;\n}\n\n.aia-seeAll-0Zbgc {\n display: block;\n width: 100%;\n min-height: var(--aia-see-all-height, 48px);\n padding: 0 16px;\n border: none;\n border-radius: var(--aia-see-all-radius, 12px);\n background: var(--aia-see-all-bg, #2b2b2b);\n color: var(--aia-see-all-color, #ffffff);\n font-family: inherit;\n font-size: var(--aia-see-all-font-size, 16px);\n font-weight: 700;\n line-height: 20px;\n text-align: center;\n cursor: pointer;\n transition: background-color 150ms ease-out;\n}\n\n.aia-seeAll-0Zbgc:hover {\n background: var(--aia-see-all-bg-hover, #3d3d3d);\n}\n\n/* A submit in progress: the add-to-cart button's spinning arc turns beside\n the label, in the label's colour, until the page the submit opens takes\n over. Its margins cancel its width and its height at any\n --aia-spinner-size, so it takes no room in the line: the label stays where\n it was and the button keeps its size. A slower turn under reduced motion. The state sits\n in :where(), so a page's own rule on the attribute restyles or hides it. */\n.aia-seeAll-0Zbgc:where([data-aia-see-all-state=\"busy\"])::after {\n content: \"\";\n display: inline-block;\n margin: calc(var(--aia-spinner-size, 16px) / -2) calc(-8px - var(--aia-spinner-size, 16px))\n calc(var(--aia-spinner-size, 16px) / -2) 8px;\n vertical-align: middle;\n box-sizing: border-box;\n width: var(--aia-spinner-size, 16px);\n height: var(--aia-spinner-size, 16px);\n border: var(--aia-spinner-width, 2px) solid var(--aia-see-all-spinner-color, currentColor);\n border-right-color: transparent;\n border-radius: 50%;\n animation: aia-seeAllSpin-jlsZP 0.8s linear infinite;\n}\n\n@keyframes aia-seeAllSpin-jlsZP {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-seeAll-0Zbgc:where([data-aia-see-all-state=\"busy\"])::after {\n animation-duration: 2s;\n }\n}\n\n/* The open panel's leaving ghost (panelMorph.ts) is a frozen copy of the\n last step: the rows' own entrance must not replay in it while it fades. */\n.aia-dropdown-yz2KC .magicx-aia-panel-ghost,\n.aia-dropdown-yz2KC .magicx-aia-panel-ghost * {\n /* biome-ignore lint/complexity/noImportantStyles: the copy must not replay the rows' own motion */\n animation: none !important;\n /* biome-ignore lint/complexity/noImportantStyles: the copy must not replay the rows' own motion */\n transition: none !important;\n /* biome-ignore lint/complexity/noImportantStyles: a row's own pointer-events: auto must not make the leaving copy catch taps */\n pointer-events: none !important;\n}\n\n/* Classic options box (optionsStyle: \"classic\"): the panel as it was\n before the floating box: it unfolds out of the input with a stroke, at\n full size. Generated from the values the floating-box changes replaced;\n keep in step across the vanilla, React and Angular copies. */\n:where([data-aia-options-style=\"classic\"]) .aia-dropdown-yz2KC {\n filter: none;\n /* Closed, the panel is only squashed (scaleY), which leaves it in hit\n testing and the tab order. Hidden once the 400ms fade has run, as the\n floating box is; the open rule shows it again at once. */\n visibility: hidden;\n transition:\n opacity 400ms cubic-bezier(0.4, 0, 0.2, 1),\n transform 0s 400ms,\n visibility 0s linear 400ms;\n border: 1px solid var(--aia-dropdown-border, rgba(231, 231, 231, 0.5));\n transform-origin: 50% 0;\n transform: scaleY(var(--aia-dropdown-reveal-scale, 0.02));\n}\n:where([data-aia-options-style=\"classic\"]) .aia-visible-QCoXj {\n filter: none;\n visibility: visible;\n transition:\n opacity 100ms cubic-bezier(0.4, 0, 0.2, 1),\n transform 320ms cubic-bezier(0.22, 1.28, 0.36, 1),\n visibility 0s;\n transform: scaleY(1);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-skip-7-olS {\n padding: 5px 8px;\n border-radius: 6px;\n font-size: var(--aia-skip-font-size, 13.5px);\n line-height: 18px;\n}\n/* Reduced motion still wins over the classic transitions above. */\n@media (prefers-reduced-motion: reduce) {\n :where([data-aia-options-style=\"classic\"]) .aia-dropdown-yz2KC,\n :where([data-aia-options-style=\"classic\"]) .aia-visible-QCoXj {\n transition-duration: 0s;\n transition-delay: 0s;\n }\n}\n\n/* The multi-select Done row stays mounted while a request loads, so it leaves\n and returns with the options on the same 160ms instead of standing at full\n strength over rows that are gone (vanilla's styles.css does the same). */\n.aia-dropdown-yz2KC[data-aia-loading] [data-aia-multi-actions] {\n pointer-events: none;\n animation: aia-multiActionsLoadingOut-lSdMh 160ms ease-in forwards;\n}\n\n.aia-dropdown-yz2KC:not([data-aia-loading]) [data-aia-multi-actions] {\n animation: aia-multiActionsFadeIn-zbGTG 160ms ease-out;\n}\n\n/* \"See all results\" leaves and returns with the options the same way. */\n.aia-dropdown-yz2KC[data-aia-loading] [data-aia-see-all] {\n pointer-events: none;\n animation: aia-seeAllLoadingOut-THnrl 160ms ease-in forwards;\n}\n\n.aia-dropdown-yz2KC:not([data-aia-loading]) [data-aia-see-all] {\n animation: aia-seeAllFadeIn-1GWpl 160ms ease-out;\n}\n\n/* Ends and starts a hair above zero: iOS cancels a tap on an element at 0. */\n@keyframes aia-seeAllLoadingOut-THnrl {\n to {\n opacity: 0.01;\n }\n}\n\n@keyframes aia-seeAllFadeIn-1GWpl {\n from {\n opacity: 0.01;\n }\n}\n\n@keyframes aia-multiActionsLoadingOut-lSdMh {\n to {\n opacity: 0.01;\n }\n}\n\n@keyframes aia-multiActionsFadeIn-zbGTG {\n from {\n opacity: 0.01;\n }\n to {\n opacity: 1;\n }\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"dropdown\":\"aia-dropdown-yz2KC\",\"visible\":\"aia-visible-QCoXj\",\"scrollArrow\":\"aia-scrollArrow-uUzV0\",\"magicx-aia-scroll-arrow-bob\":\"aia-magicx-aia-scroll-arrow-bob-z-HXC\",\"pillBar\":\"aia-pillBar-pwTXe\",\"pillScroll\":\"aia-pillScroll-Tpzus\",\"skip\":\"aia-skip-7-olS\",\"skeletonBars\":\"aia-skeletonBars-HVr9C\",\"skeletonBar\":\"aia-skeletonBar-O3xIx\",\"multiDone\":\"aia-multiDone-y12U7\",\"seeAllRow\":\"aia-seeAllRow-icrau\",\"seeAll\":\"aia-seeAll-0Zbgc\",\"seeAllSpin\":\"aia-seeAllSpin-jlsZP\",\"multiActionsLoadingOut\":\"aia-multiActionsLoadingOut-lSdMh\",\"multiActionsFadeIn\":\"aia-multiActionsFadeIn-zbGTG\",\"seeAllLoadingOut\":\"aia-seeAllLoadingOut-THnrl\",\"seeAllFadeIn\":\"aia-seeAllFadeIn-1GWpl\"};","import {\n cellDay,\n cellIso,\n type DateMonthView,\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\";\nimport { useState } from \"react\";\nimport styles from \"./DateGrid.module.css\";\n\n/**\n * Stable keys for the weekday row. The labels themselves repeat (\"S\", \"T\"), so\n * they can't key the list, and the index can't either without tripping\n * `noArrayIndexKey` — the row is static and never reorders, but the linter has\n * no way to know that.\n */\nconst WEEKDAY_KEYS = [\"sunday\", \"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\"];\n\nexport interface DateGridProps {\n /** The visible month's cells. These ARE `filteredOptions` — see `buildDateOptions`. */\n options: SuggestionOption[];\n activeIndex: number;\n listboxId: string;\n view: DateMonthView;\n /** What the calendar paints as answered — see the core's `dateSelectionFor`. */\n selection: DateSelection;\n onSelect: (option: SuggestionOption) => void;\n onHighlight: (index: number) => void;\n /** The pointer left cell `index` — see AIAutocompleteDropdownProps.onUnhighlight. */\n onUnhighlight?: (index: number) => void;\n onPreviousMonth: () => void;\n onNextMonth: () => void;\n}\n\n/**\n * The dropdown's calendar body, rendered in place of the options grid when the\n * active parameter is a date. React analogue of vanilla's `renderDateGrid`.\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 */\nexport function DateGrid({\n options,\n activeIndex,\n listboxId,\n view,\n selection,\n onSelect,\n onHighlight,\n onUnhighlight,\n onPreviousMonth,\n onNextMonth,\n}: DateGridProps) {\n const today = isoDate(new Date());\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 const range = visibleDateRange({\n pendingStart: selection.rangeStart,\n highlightedIso: cellIso(options[activeIndex]),\n selected: selection.selectedRange,\n floor: selection.floor,\n });\n\n return (\n <div className={styles.datepicker} data-aia-datepicker=\"\">\n <div className={styles.header}>\n <button\n type=\"button\"\n // Out of the tab order for the same reason the skip button is: Tab is\n // already bound to walking the dropdown's options.\n tabIndex={-1}\n className={styles.nav}\n data-aia-date-prev=\"\"\n aria-label=\"Previous month\"\n // Keeps the input focused, which the visibility gate depends on.\n onMouseDown={(e) => e.preventDefault()}\n onClick={onPreviousMonth}\n >\n ‹\n </button>\n <span className={styles.month} data-aia-date-month=\"\" aria-live=\"polite\">\n {monthLabel(view)}\n </span>\n <button\n type=\"button\"\n tabIndex={-1}\n className={styles.nav}\n data-aia-date-next=\"\"\n aria-label=\"Next month\"\n onMouseDown={(e) => e.preventDefault()}\n onClick={onNextMonth}\n >\n ›\n </button>\n </div>\n\n {/* Decorative: each cell announces its own full date, so repeating the\n column letters to AT adds noise — and the duplicate T/S would be\n meaningless read aloud anyway. */}\n <div className={styles.weekdays} aria-hidden=\"true\">\n {WEEKDAY_LABELS.map((label, i) => (\n <span key={WEEKDAY_KEYS[i]} className={styles.weekday}>\n {label}\n </span>\n ))}\n </div>\n\n <div className={styles.grid} data-aia-date-grid=\"\">\n {options.map((option, i) => (\n <DateCell\n // Padding cells have no date of their own, so they key off position.\n key={cellIso(option) ?? `pad-${i}`}\n option={option}\n id={`${listboxId}-option-${i}`}\n index={i}\n isHighlighted={i === activeIndex && option.is_tappable}\n isToday={cellIso(option) === today}\n isPast={isDimmedDay(cellIso(option), today, selection.floor)}\n marks={dateCellMarks(cellIso(option), {\n selectedIso: selection.selectedIso,\n range,\n references: selection.references,\n })}\n onSelect={onSelect}\n onHighlight={onHighlight}\n onUnhighlight={onUnhighlight}\n />\n ))}\n </div>\n </div>\n );\n}\n\ninterface DateCellProps {\n option: SuggestionOption;\n id: string;\n index: number;\n isHighlighted: boolean;\n isToday: boolean;\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: boolean;\n /** Filled at either end of a picked span (or on the one picked day), banded in between. */\n marks: { selected: boolean; inRange: boolean; reference: boolean };\n onSelect: (option: SuggestionOption) => void;\n onHighlight: (index: number) => void;\n onUnhighlight?: (index: number) => void;\n}\n\nfunction DateCell({\n option,\n id,\n index,\n isHighlighted,\n isToday,\n isPast,\n marks,\n onSelect,\n onHighlight,\n onUnhighlight,\n}: DateCellProps) {\n const [pressed, setPressed] = useState(false);\n const day = cellDay(option);\n\n if (day == null) {\n // Padding for the days before the 1st / after the last. Non-tappable, so\n // arrow navigation skips it; hidden from AT so the month reads as its own\n // days and nothing else.\n return (\n <div\n id={id}\n role=\"option\"\n data-aia-option=\"\"\n data-aia-date-cell=\"\"\n aria-hidden=\"true\"\n aria-selected={false}\n tabIndex={-1}\n className={`${styles.cell} ${styles.blank}`}\n />\n );\n }\n\n const handleSelect = () => {\n setPressed(true);\n onSelect(option);\n setTimeout(() => setPressed(false), 170);\n };\n\n const className = [\n styles.cell,\n styles.day,\n isPast ? styles.past : \"\",\n isHighlighted ? styles.highlighted : \"\",\n isToday ? styles.today : \"\",\n marks.inRange ? styles.inRange : \"\",\n marks.selected ? styles.selected : \"\",\n marks.reference ? styles.reference : \"\",\n pressed ? styles.pressed : \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div\n id={id}\n role=\"option\"\n data-aia-option=\"\"\n data-aia-date-cell=\"\"\n aria-selected={isHighlighted}\n // The cell paints the day number; `option.text` is the full committed\n // value (\"March 23 2026\") and is what AT should announce, since that is\n // what selecting it puts in the input.\n aria-label={option.text}\n tabIndex={0}\n className={className}\n onClick={handleSelect}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n handleSelect();\n }\n }}\n onMouseEnter={() => onHighlight(index)}\n // The hover highlight ends with the hover — see SuggestionItem.\n onMouseLeave={onUnhighlight ? () => onUnhighlight(index) : undefined}\n >\n <span className={styles.number}>{day}</span>\n </div>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-f687bd03\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-f687bd03\";\n s.textContent = `/* --- Datepicker (replaces the options grid for date suggestions) ---\n\n One of three hand-maintained copies (vanilla styles.css, this file, Angular's\n date-grid.component.css). Only the class-naming layer differs — the\n declarations must match, and \\`datepickerParity.test.ts\\` fails the build if\n they drift. See CLAUDE.md's duplicated-stylesheet rule.\n\n Every colour resolves through the same --aia-option-* chain the option rows\n use. The dropdown paints a background but sets no \\`color\\`, so anything here\n relying on \\`color: inherit\\` would pick up the HOST page's text colour and go\n black on a dark panel — and \\`prefers-color-scheme\\` can't be used to guess,\n because the panel's darkness comes from --aia-surface, which the media query\n says nothing about. Going through the option chain means one consumer\n override restyles the calendar and the options together. */\n.aia-datepicker-6RrTs {\n display: flex;\n flex-direction: column;\n gap: 4px;\n /* Bottom-heavier trim than the top: the compression the compact calendar\n asks for comes out of the bottom edge and the space between cells, never\n the header area or the side gutters. */\n padding: 4px 2px 4px;\n}\n\n.aia-header-z4LRk {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 2px 6px 6px;\n}\n\n.aia-month-urB2T {\n font-family: inherit;\n font-size: var(--aia-date-month-font-size, 14px);\n font-weight: 500;\n line-height: 20px;\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n}\n\n.aia-nav-ap4AN {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n padding: 0;\n border: none;\n border-radius: 6px;\n background: transparent;\n font-family: inherit;\n font-size: 16px;\n line-height: 1;\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n cursor: pointer;\n transition:\n color 150ms ease-out,\n background-color 150ms ease-out;\n}\n\n.aia-nav-ap4AN:hover {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n background: var(--aia-option-bg, transparent);\n}\n\n.aia-weekdays-3EA3q,\n.aia-grid-mQCgw {\n display: grid;\n /* The 7 columns live on the cell container itself, not on an ancestor:\n KeyboardController.getEffectiveColumns() measures grid-template-columns by\n walking up from option-0's PARENT, and it is this number that makes\n ArrowDown mean \"+1 week\". */\n grid-template-columns: repeat(7, minmax(0, 1fr));\n}\n\n/* The weeks. A row is --aia-date-row-height tall whenever there is room, which\n keeps a month readable in a narrow dropdown without letting a 6-row month\n grow the panel past the options grid it replaces. In a panel fitted to a\n short window (data-aia-fit, see appearance.css) the calendar is the section\n that gives: the rows share what is left, down to --aia-date-row-min-height,\n so the whole month stays on screen with its bottom padding instead of the\n last week being sliced by the panel's edge. Only below that floor does the\n panel scroll. */\n.aia-grid-mQCgw {\n flex: 1 1 auto;\n /* Without it the grid's automatic minimum is its full-height rows, and\n nothing squeezes. */\n min-height: 0;\n /* The floor never exceeds the chosen height, so a host that set a row\n shorter than the floor still gets exactly its own height. */\n grid-auto-rows: minmax(\n min(var(--aia-date-row-min-height, 20px), var(--aia-date-row-height, 28px)),\n var(--aia-date-row-height, 28px)\n );\n}\n\n.aia-weekday-3lF4B {\n padding: 2px 0;\n text-align: center;\n font-family: inherit;\n font-size: var(--aia-date-weekday-font-size, 11px);\n font-weight: 500;\n line-height: 16px;\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n opacity: 0.7;\n}\n\n.aia-cell-59k0y {\n display: flex;\n align-items: center;\n justify-content: center;\n /* Deliberately NOT sized here. Giving the grid item a definite size (an\n aspect-ratio, a width) stops it stretching to its track, so it parks at\n the track's start edge and the whole month drifts left of the weekday\n header above it — the two grids agree on their columns, and only the\n items disagree, which makes it look like a column-count bug. The cell\n fills its track; the square is the number span inside it. */\n min-width: 0;\n /* No height of its own: the cell fills its row, and the row's height is the\n grid's to give (see the weeks rule above), so a short window can squeeze\n the weeks instead of cutting the last one off. */\n font-family: inherit;\n font-size: var(--aia-date-cell-font-size, 13px);\n font-weight: 450;\n line-height: 20px;\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n}\n\n/* The visual box: everything a cell paints — fill, ring, press — lands here so\n it reads as a square centred in its column rather than a full-width band. */\n.aia-number-aoT01 {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--aia-date-cell-size, 26px);\n height: var(--aia-date-cell-size, 26px);\n /* A squeezed row (see the weeks rule) is shorter than the square: it stays\n inside its own row rather than touching the week above and below. */\n max-height: 100%;\n border-radius: 6px;\n}\n\n.aia-day-cB3u9 {\n cursor: pointer;\n}\n\n.aia-blank-ivgRC {\n cursor: default;\n}\n\n/* A day before today: dimmed so the month visibly starts at today, but still\n fully interactive — hover and click behave like any other day. */\n.aia-past-CEZsj {\n opacity: 0.35;\n}\n\n.aia-day-cB3u9:hover .aia-number-aoT01,\n.aia-highlighted-YIdtK .aia-number-aoT01 {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n background: var(--aia-option-bg, transparent);\n font-weight: 500;\n}\n\n/* Today reads as an outline, the committed answer as a fill — so a re-edited\n date can show both at once without either being ambiguous. */\n.aia-today-iI3ME .aia-number-aoT01 {\n box-shadow: inset 0 0 0 1px\n var(--aia-date-today-ring, var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb)));\n}\n\n/* Between the two ends of a picked span. The band sits on the CELL, not on the\n number square inside it, so consecutive days join into one continuous strip\n instead of a row of separate pills — the ends stay the two filled squares. */\n.aia-inRange-r9S2q {\n background: var(--aia-date-range-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06));\n}\n\n.aia-selected-28KDn .aia-number-aoT01 {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n background: var(--aia-date-selected-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.12));\n font-weight: 500;\n}\n\n/* A day another answer already holds (the pickup date while the return date is\n asked): a filled box for reference, still pickable. The fill is mixed from\n the day's own text colour, not the streak tint, so it shows on a light panel\n and a dark one alike, whatever the theme sets. */\n.aia-reference-Q5bXf .aia-number-aoT01 {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n background: var(--aia-date-reference-bg, color-mix(in srgb, currentColor 14%, transparent));\n font-weight: 500;\n}\n\n.aia-pressed-bEyyN .aia-number-aoT01 {\n opacity: 0.8;\n background: rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"datepicker\":\"aia-datepicker-6RrTs\",\"header\":\"aia-header-z4LRk\",\"month\":\"aia-month-urB2T\",\"nav\":\"aia-nav-ap4AN\",\"weekdays\":\"aia-weekdays-3EA3q\",\"grid\":\"aia-grid-mQCgw\",\"weekday\":\"aia-weekday-3lF4B\",\"cell\":\"aia-cell-59k0y\",\"number\":\"aia-number-aoT01\",\"day\":\"aia-day-cB3u9\",\"blank\":\"aia-blank-ivgRC\",\"past\":\"aia-past-CEZsj\",\"highlighted\":\"aia-highlighted-YIdtK\",\"today\":\"aia-today-iI3ME\",\"inRange\":\"aia-inRange-r9S2q\",\"selected\":\"aia-selected-28KDn\",\"reference\":\"aia-reference-Q5bXf\",\"pressed\":\"aia-pressed-bEyyN\"};","import {\n ATTRIBUTION_URL,\n buildAttributionUrl,\n getFooterHint,\n type UIStrings,\n uiStringsFor,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { useEffect, useState } from \"react\";\nimport { Cluster } from \"../layout/Cluster\";\nimport styles from \"./DropdownFooter.module.css\";\n\ninterface DropdownFooterProps {\n /**\n * Whether an option is currently highlighted. Takes priority: when true the\n * hint reads \"enter to proceed\".\n */\n isOptionHighlighted?: boolean;\n /**\n * Whether the input has no typed text. When true (and no option is\n * highlighted) the hint reads \"tab to select\" — see {@link getFooterHint}.\n */\n isInputEmpty?: boolean;\n /** The words of the widget language. Default: English. */\n strings?: UIStrings;\n}\n\n// Dropdown chrome: a keyboard hint on the left, AI-Autocomplete branding on the\n// right.\nexport function DropdownFooter({\n isOptionHighlighted = false,\n isInputEmpty = false,\n strings = uiStringsFor(),\n}: DropdownFooterProps) {\n const { key, hint } = getFooterHint(isOptionHighlighted, isInputEmpty, strings);\n // Initial state is the bare base URL so it matches server-rendered output (no\n // hydration mismatch); the effect appends utm_source after mount on the client.\n const [brandHref, setBrandHref] = useState(ATTRIBUTION_URL);\n useEffect(() => {\n setBrandHref(buildAttributionUrl());\n }, []);\n return (\n <footer className={styles.footer} data-aia-footer=\"\">\n <Cluster justify=\"between\" noWrap className={styles.row}>\n <Cluster gap=\"5px\" className={styles.hintGroup}>\n <kbd className={styles.key}>{key}</kbd>\n <span className={styles.hint}>{hint}</span>\n </Cluster>\n <a className={styles.brandLink} href={brandHref} target=\"_blank\" rel=\"noopener noreferrer\">\n <span className={styles.badge}>\n <span className={styles.brand}>Powered by Intent-1</span>\n </span>\n </a>\n </Cluster>\n </footer>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-5259a217\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-5259a217\";\n s.textContent = `.aia-cluster {\n display: flex;\n flex-wrap: wrap;\n gap: var(--aia-cluster-gap, 0.5rem);\n}\n/* Inline-level variant — used when the cluster must sit inline (e.g. inside\n a contentEditable). Rendered on a <span> so it's valid inline content. */\n.aia-cluster[data-inline] {\n display: inline-flex;\n}\n.aia-cluster[data-nowrap] {\n flex-wrap: nowrap;\n}\n.aia-cluster[data-align=\"start\"] {\n align-items: start;\n}\n.aia-cluster[data-align=\"center\"] {\n align-items: center;\n}\n.aia-cluster[data-align=\"end\"] {\n align-items: end;\n}\n.aia-cluster[data-align=\"baseline\"] {\n align-items: baseline;\n}\n.aia-cluster[data-justify=\"start\"] {\n justify-content: start;\n}\n.aia-cluster[data-justify=\"center\"] {\n justify-content: center;\n}\n.aia-cluster[data-justify=\"end\"] {\n justify-content: end;\n}\n.aia-cluster[data-justify=\"between\"] {\n justify-content: space-between;\n}\n.aia-cluster[data-justify=\"around\"] {\n justify-content: space-around;\n}\n`;\n document.head.appendChild(s);\n}\nexport {};","import type { ComponentPropsWithoutRef, CSSProperties, ReactNode } from \"react\";\nimport \"./Cluster.css\";\n\ninterface ClusterProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"className\"> {\n /** Gap between children. Any CSS length. Defaults to `0.5rem`. */\n gap?: string;\n /** Cross-axis alignment. Defaults to `center`. */\n align?: \"start\" | \"center\" | \"end\" | \"baseline\";\n /** Main-axis distribution. Defaults to `start`. */\n justify?: \"start\" | \"center\" | \"end\" | \"between\" | \"around\";\n /** When true, the wrapper does NOT flex-wrap (single-row clusters). */\n noWrap?: boolean;\n /** Render as an inline-level `<span>` (inline-flex) instead of a block `<div>`. */\n inline?: boolean;\n className?: string;\n children: ReactNode;\n}\n\n// Horizontal layout primitive — wraps when out of room. `noWrap` for single-row clusters. Internal.\nexport function Cluster({\n gap,\n align = \"center\",\n justify = \"start\",\n noWrap = false,\n inline = false,\n className,\n children,\n ...rest\n}: ClusterProps) {\n const style = gap ? ({ \"--aia-cluster-gap\": gap } as CSSProperties) : undefined;\n const props = {\n className: className ? `aia-cluster ${className}` : \"aia-cluster\",\n \"data-align\": align,\n \"data-justify\": justify,\n \"data-nowrap\": noWrap || undefined,\n \"data-inline\": inline || undefined,\n style,\n ...rest,\n };\n if (inline) return <span {...props}>{children}</span>;\n return <div {...props}>{children}</div>;\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-56b0c577\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-56b0c577\";\n s.textContent = `/* The footer adds its own 8px horizontal inset so it stays clear of the\n dropdown's rounded edges. The top inset (--aia-footer-gap) adds breathing\n room above the hint/branding row so the footer doesn't butt against the last\n option row — additive to the dropdown's 8px section gap. */\n.aia-footer-qQQ7x {\n display: flex;\n flex-direction: column;\n gap: 8px;\n /* No right inset: the brand pill's own padding (below) supplies it, so the\n badge sits as far from the right edge as it does from the bottom — 12px\n both ways (dropdown padding 10 + pill 2 down, dropdown padding 8 + pill 4\n across). */\n padding: var(--aia-footer-gap, 12px) 0 0 8px;\n /* The fade itself lives in appearance.css, on the footer's background.\n Paints above the rows it covers: option content sits at z-index 2 (see\n SuggestionItem.module.css) in this same stacking context, so anything\n lower would end up *behind* the rows. */\n position: relative;\n z-index: 3;\n /* Sitting on top of the list would otherwise swallow clicks and hovers on\n the rows scrolling under it — only the branding link needs to be hit. */\n pointer-events: none;\n}\n\n/* The hint / branding row is at least --aia-footer-row-height tall, the\n height the footer band under the options grid reserves for it\n (appearance.css). The badge is normally the row's tallest item and holds it\n there; without it — a consumer hiding the brand link, or a phone, where the\n keyboard hint is hidden too — the row shrank to the hint's 22px or to\n nothing, the footer's plate stopped short of the band and the rows scrolling\n under it showed below the footer (on a phone, the grid ran past the\n dropdown's bottom edge). The product strip zeroes the band and this floor\n with it (--aia-footer-row-min-height, appearance.css). */\n.aia-row-BgZ6Q {\n min-height: var(--aia-footer-row-min-height, var(--aia-footer-row-height, 23px));\n}\n\n.aia-hintGroup-ZzbPf {\n min-width: 0;\n}\n\n/* Re-enabled over the footer's \\`pointer-events: none\\`: both groups are visible\n chips sitting on the scroll band, so a click on one must land on the chip\n rather than falling through to the option row behind it. */\n.aia-hintGroup-ZzbPf,\n.aia-brandLink-r4f3R {\n pointer-events: auto;\n}\n\n.aia-brandLink-r4f3R {\n display: inline-flex;\n align-items: center;\n gap: 2px;\n text-decoration: none;\n cursor: pointer;\n transition: opacity 150ms ease-out;\n}\n\n/* The two content groups carry a solid surface fill so the keyboard hint and\n the AI-Autocomplete badge stay fully legible over whatever option row is\n scrolling behind the footer. The inline padding keeps the fill from hugging\n the glyphs. --aia-footer-chip-bg resolves to \\`transparent\\` on the glass\n surface, where there's no solid color to fill with. */\n.aia-hintGroup-ZzbPf,\n.aia-brandLink-r4f3R {\n /* Mixed here rather than declared on the container: a custom property\n substitutes var() on the element its declaration applies to, so a mix\n computed upstream would freeze the *theme's* surface and miss a\n dropdown-level --aia-surface retint. Computed on the footer, it picks up\n whichever ancestor set the surface. --aia-footer-chip-bg stays the\n override hook — consumers set it, and the glass surface zeroes it. */\n background: var(\n --aia-footer-chip-bg,\n color-mix(in srgb, var(--aia-surface, #ffffff) 65%, transparent)\n );\n padding-inline: 4px;\n border-radius: 6px;\n}\n\n/* The brand sits at the right edge where option rows scroll under the fade, so\n \"AI\" was getting clipped / washed out. Give the whole brand its own opaque,\n fully-rounded surface pill so it always reads clearly over the fade. Declared\n after the shared .hintGroup/.brandLink chip rule so it wins. */\n.aia-brandLink-r4f3R {\n background: var(--aia-footer-brand-pill-bg, var(--aia-surface, #ffffff));\n border-radius: 999px;\n padding: 2px 4px;\n gap: 4px;\n}\n\n.aia-brandLink-r4f3R:hover {\n opacity: 0.7;\n}\n\n.aia-key-Bz1H- {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 30px;\n height: 22px;\n padding: 2px 6px;\n border: 0.5px solid var(--aia-footer-hint-color, #505050);\n border-radius: 5px;\n font-family: inherit;\n font-size: 11px;\n line-height: 18px;\n color: var(--aia-footer-hint-color, #505050);\n}\n\n.aia-hint-GKEOH {\n font-family: inherit;\n font-size: 11px;\n line-height: 18px;\n color: var(--aia-footer-hint-color, #505050);\n}\n\n.aia-brand-Al-lR {\n font-family: inherit;\n font-size: 10px;\n line-height: 18px;\n color: var(--aia-footer-brand-color, #b0b0b0);\n}\n\n.aia-badge-Fk9vg {\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n height: var(--aia-footer-row-height, 23px);\n padding: 2.5px 5.5px;\n border: 0.5px solid var(--aia-footer-badge-border, rgba(189, 189, 189, 0.51));\n border-radius: 999px;\n font-family: inherit;\n font-size: 10px;\n line-height: 18px;\n color: var(--aia-footer-brand-color, #b0b0b0);\n}\n\n/* Mobile footer variant (Figma \"Mobile\"): on phone-width viewports drop the\n keyboard hint (\"tab to select\" is meaningless on touch), leaving only the\n AI-Autocomplete brand pinned to the right. */\n@media (max-width: 768px) {\n .aia-hintGroup-ZzbPf {\n display: none;\n }\n .aia-row-BgZ6Q {\n justify-content: flex-end;\n }\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"footer\":\"aia-footer-qQQ7x\",\"row\":\"aia-row-BgZ6Q\",\"hintGroup\":\"aia-hintGroup-ZzbPf\",\"brandLink\":\"aia-brandLink-r4f3R\",\"key\":\"aia-key-Bz1H-\",\"hint\":\"aia-hint-GKEOH\",\"brand\":\"aia-brand-Al-lR\",\"badge\":\"aia-badge-Fk9vg\"};","import type { LocationView } from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { type ReactNode, useEffect, useLayoutEffect, useRef } from \"react\";\nimport styles from \"./LocationField.module.css\";\n\nexport interface LocationFieldProps {\n /** The core's `locationView`: the field's text and the places found for it. */\n view: LocationView;\n /** Placeholder and accessible name of the field (\"Say a location\"). */\n searchLabel: string;\n /** Shown when a search found nothing (\"No places found\"). */\n noResultsLabel: string;\n /** Says Enter answers with the typed text (\"Press Enter to use what you typed\"). */\n useTypedLabel: string;\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 widgetFocused: boolean;\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 reediting?: boolean;\n /** False while the panel is closed: the field leaves the tab order. */\n visible?: boolean;\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 interactive?: boolean;\n /** The field's text changed — the core's `setLocationQuery`. */\n onQuery: (query: string) => void;\n /** ArrowDown / ArrowUp — the core's `moveLocationHighlight`. */\n onMove: (delta: number) => void;\n /** Answer: the place at `index`, else the highlighted place, else the typed text — the core's `commitLocation`. */\n onCommit: (index?: number) => void;\n /** The field took or let go of focus — the core's `setLocationFieldFocused`. */\n onFocusChange: (focused: boolean) => void;\n}\n\n// React 17 has no useId; one stable id per mounted field is all this needs.\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\nconst PIN = (\n <svg\n className={styles.icon}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z\" />\n <circle cx=\"12\" cy=\"9.5\" r=\"2.5\" />\n </svg>\n);\n\nconst SEARCH = (\n <svg\n className={styles.icon}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n aria-hidden=\"true\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </svg>\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. React analogue of vanilla's\n * `renderLocationField`: a search field over the server's location search,\n * 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 */\nexport function LocationField({\n view,\n searchLabel,\n noResultsLabel,\n useTypedLabel,\n widgetFocused,\n reediting = false,\n visible = true,\n interactive = true,\n onQuery,\n onMove,\n onCommit,\n onFocusChange,\n}: LocationFieldProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n const rootRef = useRef<HTMLDivElement>(null);\n const fieldRef = useRef<HTMLLabelElement>(null);\n // Where focus goes back to: the input the field took it from.\n const returnTo = useRef<HTMLElement | null>(null);\n // The caret `returnTo` had when the field took focus; restored on the way back.\n const returnRange = useRef<Range | null>(null);\n // Set while the field hands focus back, so its own blur isn't read as leaving.\n const returning = useRef(false);\n // The user left the field for the input; don't pull focus back until the\n // widget loses focus altogether.\n const declined = useRef(false);\n // Whether the last render was a re-edit; a re-edit starting clears `declined`.\n const wasReediting = useRef(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 const claimed = useRef(false);\n const widgetFocusedRef = useRef(widgetFocused);\n widgetFocusedRef.current = widgetFocused;\n const onFocusChangeRef = useRef(onFocusChange);\n onFocusChangeRef.current = onFocusChange;\n const reportFocus = (focused: boolean) => {\n claimed.current = focused;\n onFocusChange(focused);\n };\n const hasFocus = () => {\n const input = inputRef.current;\n return input != null && activeElementFor(input) === input;\n };\n const rememberReturn = () => {\n const root = rootRef.current;\n if (!root) return;\n const active = activeElementFor(root);\n if (\n active instanceof HTMLElement &&\n active !== inputRef.current &&\n active !== document.body &&\n !root.contains(active)\n ) {\n returnTo.current = active;\n returnRange.current = captureCaret(active);\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 const rememberKeyboardReturn = (from: EventTarget | null) => {\n const root = rootRef.current;\n if (!root || !(from instanceof HTMLElement) || from === returnTo.current) return;\n if (from === document.body || root.contains(from)) return;\n returnTo.current = from;\n returnRange.current = captureCaret(from);\n };\n const fieldId = useRef<string | null>(null);\n if (fieldId.current === null) fieldId.current = `aia-location-${++fieldSeq}`;\n const rowIdPrefix = `${fieldId.current}-row-`;\n\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 useEffect(() => {\n const input = inputRef.current;\n if (input && input.value !== view.query && activeElementFor(input) !== input) {\n input.value = view.query;\n }\n }, [view.query]);\n\n useEffect(() => {\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 renders of a click back into the input\n // can briefly drop it, and that must not count as a new re-edit.\n if (widgetFocused) {\n if (reediting && !wasReediting.current) declined.current = false;\n wasReediting.current = reediting;\n }\n const input = inputRef.current;\n if (!input) return;\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 (!visible && hasFocus()) {\n declined.current = true;\n handBack();\n return;\n }\n if (!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 render 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 (widgetFocusedRef.current) return;\n const target = returnTo.current;\n if (target && activeElementFor(target) === target) return;\n declined.current = 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 (!reediting || declined.current || !interactive || hasFocus()) return;\n rememberReturn();\n // Claim focus before the input's blur, which would otherwise close the panel.\n reportFocus(true);\n input.focus({ preventScroll: true });\n // focus() can be refused (a field still hidden by the panel's transition,\n // say). No blur follows a focus that never arrived, so release the claim\n // here or the widget counts as focused forever.\n // Stop trying until the widget next gains focus: releasing the claim\n // re-renders, and a retry on every render would loop forever.\n if (!hasFocus()) {\n declined.current = true;\n 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 // 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). Hand focus back\n // and release the claim before the node is removed: a layout-effect cleanup\n // runs while the input is still in the document, a passive one doesn't.\n useLayoutEffect(\n () => () => {\n if (!claimed.current) return;\n const input = inputRef.current;\n const target = returnTo.current;\n if (target?.isConnected && input && activeElementFor(input) === input) {\n returning.current = true;\n focusWithCaret(target, returnRange.current);\n returning.current = false;\n }\n claimed.current = false;\n onFocusChangeRef.current(false);\n },\n [],\n );\n\n const handBack = (answered = false) => {\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) declined.current = true;\n const target = returnTo.current;\n if (target?.isConnected && hasFocus()) {\n returning.current = true;\n focusWithCaret(target, returnRange.current);\n returning.current = false;\n }\n reportFocus(false);\n };\n\n const trimmed = view.query.trim();\n const highlightedId =\n view.highlighted >= 0 && view.highlighted < view.places.length\n ? `${rowIdPrefix}${view.highlighted}`\n : undefined;\n\n let body: ReactNode = null;\n if (view.places.length > 0) {\n body = view.places.map((place, index) => (\n // biome-ignore lint/a11y/useKeyWithClickEvents: the field drives the list from the keyboard (ArrowUp/ArrowDown/Enter).\n // biome-ignore lint/a11y/useFocusableInteractive: rows are never focused; the field points at the highlighted one with aria-activedescendant.\n <div\n key={place.id}\n id={`${rowIdPrefix}${index}`}\n role=\"option\"\n aria-selected={index === view.highlighted}\n className={index === view.highlighted ? `${styles.row} ${styles.highlighted}` : styles.row}\n data-aia-location-row=\"\"\n data-aia-index={index}\n onClick={() => {\n if (!interactive) return;\n handBack(true);\n onCommit(index);\n }}\n >\n <span className={styles.pin}>{PIN}</span>\n <span className={styles.text}>\n <span className={styles.name}>{place.name}</span>\n {place.secondary && <span className={styles.secondary}>{place.secondary}</span>}\n </span>\n </div>\n ));\n } else if (view.status === \"loading\") {\n body = (\n <div className={styles.loading} data-aia-location-loading=\"\">\n <span className={styles.loadingBar} />\n <span className={styles.loadingBar} />\n <span className={styles.loadingBar} />\n </div>\n );\n } else if (trimmed) {\n body = (\n <div className={styles.note} data-aia-location-note=\"\">\n {view.status === \"done\" && <span className={styles.empty}>{noResultsLabel}</span>}\n <span>{useTypedLabel}</span>\n </div>\n );\n }\n\n return (\n // biome-ignore lint/a11y/noStaticElementInteractions: only lets a press on the field through the dropdown's mousedown guard; it handles no interaction itself.\n <div\n ref={rootRef}\n className={styles.location}\n data-aia-location=\"\"\n // A press anywhere on the field (the input, its search icon, its\n // padding — the label focuses the input for all of them) must reach it:\n // the dropdown root cancels every mousedown inside it, so this one stops\n // here — and claims focus before the editor's blur, which would\n // otherwise close the panel.\n onMouseDown={(e) => {\n if (!(e.target instanceof Node) || !fieldRef.current?.contains(e.target)) return;\n e.stopPropagation();\n rememberReturn();\n reportFocus(true);\n }}\n >\n <label ref={fieldRef} className={styles.field}>\n {SEARCH}\n <input\n ref={inputRef}\n type=\"text\"\n className={styles.input}\n data-aia-location-input=\"\"\n defaultValue={view.query}\n placeholder={searchLabel}\n aria-label={searchLabel}\n aria-activedescendant={highlightedId}\n autoComplete=\"off\"\n autoCapitalize=\"words\"\n // Enter answers the pill, so mobile keyboards label it \"done\".\n enterKeyHint=\"done\"\n spellCheck={false}\n tabIndex={visible ? 0 : -1}\n onChange={(e) => onQuery(e.target.value)}\n onFocus={(e) => {\n rememberKeyboardReturn(e.relatedTarget);\n reportFocus(true);\n }}\n onBlur={() => {\n if (returning.current) return;\n declined.current = true;\n reportFocus(false);\n }}\n onKeyDown={(e) => {\n if (e.nativeEvent.isComposing) return;\n switch (e.key) {\n case \"ArrowDown\":\n case \"ArrowUp\":\n e.preventDefault();\n onMove(e.key === \"ArrowDown\" ? 1 : -1);\n return;\n case \"Enter\":\n e.preventDefault();\n if (!interactive) return;\n handBack(true);\n onCommit();\n return;\n // Tab is left to the browser. The dropdown sits before the\n // input in the DOM, so the field is the input's previous tab\n // stop: Tab goes forward to the input, Shift+Tab to whatever\n // precedes the widget.\n case \"Escape\":\n // Back to the input, the pill left as it was.\n e.preventDefault();\n e.stopPropagation();\n declined.current = true;\n handBack();\n return;\n case \"Backspace\":\n // Backspacing past the start of an empty field goes back to the input.\n if (e.currentTarget.value !== \"\") return;\n e.preventDefault();\n declined.current = true;\n handBack();\n return;\n }\n }}\n />\n </label>\n <div className={styles.results} data-aia-location-results=\"\" aria-live=\"polite\">\n {body}\n </div>\n </div>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-2feec02e\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-2feec02e\";\n s.textContent = `/* Location search — React copy of the vanilla rules in styles.css (and of the\n Angular copy). The three are kept identical by\n packages/vanilla/tests/render/locationFieldParity.test.ts. */\n.aia-location-6-fsr {\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: 6px 6px 4px;\n}\n\n.aia-field-xEzwi {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 10px;\n border-radius: var(--aia-location-field-radius, 10px);\n background: var(--aia-location-field-bg-idle, transparent);\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n cursor: text;\n transition: background-color 120ms ease;\n}\n\n.aia-field-xEzwi:hover,\n.aia-field-xEzwi:focus-within {\n background: var(--aia-location-field-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06));\n}\n\n.aia-icon-czx6C {\n display: block;\n width: 15px;\n height: 15px;\n}\n\n.aia-input-Yi9V- {\n flex: 1;\n min-width: 0;\n padding: 0;\n border: 0;\n outline: 0;\n background: transparent;\n font: inherit;\n /* Never under 16px: iOS Safari zooms the page into a smaller field it focuses. */\n font-size: max(16px, var(--aia-location-font-size, 15px));\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n}\n\n.aia-input-Yi9V-::placeholder {\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n font-weight: 300;\n opacity: 0.7;\n}\n\n.aia-results-C3O0V {\n display: flex;\n flex-direction: column;\n}\n\n.aia-row-Q9y8g {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 8px 10px;\n border-radius: 8px;\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n cursor: pointer;\n}\n\n.aia-row-Q9y8g:hover,\n.aia-highlighted-RJjPx {\n background: var(\n --aia-location-row-bg-highlighted,\n rgba(var(--aia-streak-rgb, 255, 255, 255), 0.08)\n );\n}\n\n.aia-pin-OjabL {\n flex: 0 0 15px;\n}\n\n.aia-text-Xs84O {\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n\n.aia-name-Z-WJR {\n overflow: hidden;\n font-size: var(--aia-location-font-size, 15px);\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.aia-secondary-4sCT1 {\n overflow: hidden;\n font-size: 13px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.aia-note-xCSvY {\n display: flex;\n flex-direction: column;\n gap: 2px;\n padding: 8px 10px;\n font-size: 13px;\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n}\n\n.aia-empty-SYBzi {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n}\n\n.aia-loading-Ih1gi {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 10px;\n}\n\n.aia-loadingBar-OLCr4 {\n width: 70%;\n height: 12px;\n border-radius: 6px;\n background: var(--aia-skeleton-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.08));\n}\n\n.aia-loadingBar-OLCr4:nth-child(2) {\n width: 50%;\n}\n\n.aia-loadingBar-OLCr4:nth-child(3) {\n width: 60%;\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"location\":\"aia-location-6-fsr\",\"field\":\"aia-field-xEzwi\",\"icon\":\"aia-icon-czx6C\",\"input\":\"aia-input-Yi9V-\",\"results\":\"aia-results-C3O0V\",\"row\":\"aia-row-Q9y8g\",\"highlighted\":\"aia-highlighted-RJjPx\",\"pin\":\"aia-pin-OjabL\",\"text\":\"aia-text-Xs84O\",\"name\":\"aia-name-Z-WJR\",\"secondary\":\"aia-secondary-4sCT1\",\"note\":\"aia-note-xCSvY\",\"empty\":\"aia-empty-SYBzi\",\"loading\":\"aia-loading-Ih1gi\",\"loadingBar\":\"aia-loadingBar-OLCr4\"};","import {\n isSmartSuggestion,\n isTraditionalAutocompleteSuggestion,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport type { CSSProperties } from \"react\";\nimport type { Suggestion } from \"../types\";\nimport { PARAM_PILL_OPACITY, ParamPill, type PillState } from \"./ParamPill\";\nimport pillStyles from \"./ParamPill.module.css\";\nimport styles from \"./PillList.module.css\";\n\ninterface PillListProps {\n pills: Suggestion[];\n activePillIndex: number;\n onSelectPill: (index: number) => void;\n /**\n * Whether the active pill should render in the `selected` state (full\n * opacity) rather than its positional `first` tier. In `auto` dropdown mode\n * this is true only while a dropdown option is highlighted; in `manual` mode\n * it becomes true once the user taps a pill. Default: false.\n */\n activeSelected?: boolean;\n /** Use capsule-shaped pills (fully rounded). Default: false. */\n rounded?: boolean;\n /**\n * When true, the rendered pills become non-interactive shimmering skeletons.\n * Real pills (with their text) are rendered when provided so widths/positions\n * match the previous state; when `pills` is empty, fixed-width fallback\n * placeholders are rendered instead.\n */\n loading?: boolean;\n}\n\nconst FALLBACK_SKELETON_WIDTHS = [125, 69];\n\n/**\n * Map a pill's index to its positional emphasis tier. The selected (active)\n * pill is handled separately — only the at-most-three positions get a tier\n * here: first, next, then last for everything after.\n */\nfunction pillStateForIndex(index: number): PillState {\n if (index === 0) return \"first\";\n if (index === 1) return \"next\";\n return \"last\";\n}\n\nexport function PillList({\n pills,\n activePillIndex,\n onSelectPill,\n activeSelected,\n rounded,\n loading,\n}: PillListProps) {\n if (loading && pills.length === 0) {\n return (\n <span className={styles.list} data-aia-pill-list-loading=\"\">\n {FALLBACK_SKELETON_WIDTHS.map((w, i) => (\n <span\n key={`skel-${w}`}\n data-aia-pill-skeleton=\"\"\n className={`${pillStyles.pill} ${rounded ? pillStyles.rounded : \"\"} ${pillStyles.skeleton}`}\n style={\n {\n width: w,\n \"--aia-pill-opacity\": PARAM_PILL_OPACITY[pillStateForIndex(i)],\n } as CSSProperties\n }\n />\n ))}\n </span>\n );\n }\n\n return (\n <span className={styles.list} data-aia-pill-list-loading={loading ? \"\" : undefined}>\n {pills.map((pill, i) => {\n // The active pill is \"selected\" only when activeSelected is set;\n // otherwise it shows its positional tier (first/next/last).\n const selected = Boolean(activeSelected) && i === activePillIndex;\n return (\n <ParamPill\n key={`${pill.parameter}-${pill.text}`}\n label={pill.text}\n state={selected ? \"selected\" : pillStateForIndex(i)}\n selected={selected}\n active={i === activePillIndex}\n rounded={rounded}\n loading={loading}\n smartSuggestion={isSmartSuggestion(pill)}\n completionHeader={isTraditionalAutocompleteSuggestion(pill)}\n onClick={() => onSelectPill(i)}\n />\n );\n })}\n </span>\n );\n}\n","import { SMART_SUGGESTION_SPARKLE_SVG } from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport type { CSSProperties, MouseEvent } from \"react\";\nimport styles from \"./ParamPill.module.css\";\n\n/**\n * Visual emphasis tier for a pill. The selected (active) pill renders in the\n * `selected` state; every other pill takes its tier from its position in the\n * upcoming-params sequence — `first`, `next`, then `last` for the rest —\n * progressively de-emphasized.\n */\nexport type PillState = \"selected\" | \"first\" | \"next\" | \"last\";\n\n/** Opacity applied per state. Kept here so `PillList` skeletons stay in sync. */\nexport const PARAM_PILL_OPACITY: Record<PillState, number> = {\n selected: 1,\n first: 0.7,\n next: 0.4,\n last: 0.2,\n};\n\ninterface ParamPillProps {\n /** Pill label text. */\n label: string;\n /** Visual emphasis tier (drives opacity). */\n state: PillState;\n /** Renders the selection outline (the pill at the active index). */\n selected?: boolean;\n /** The pill at the active index — the parameter the options below answer. */\n active?: boolean;\n /** Capsule shape (fully rounded). Default: false. */\n rounded?: boolean;\n /** Non-interactive shimmering skeleton. */\n loading?: boolean;\n /** The Smart Suggestion look: sentence case, with a shimmer and a sparkle. */\n smartSuggestion?: boolean;\n /** The inert header over traditional autocomplete completions, which takes no pointer. */\n completionHeader?: boolean;\n onClick?: () => void;\n}\n\n/**\n * ParamPill — the unfilled suggestion pill (Figma component \"ParamPill\",\n * formerly \"Pill\"). Rendered in the dropdown pill-bar and the inline pill list.\n */\nexport function ParamPill({\n label,\n state,\n active,\n rounded,\n loading,\n smartSuggestion,\n completionHeader,\n onClick,\n}: ParamPillProps) {\n const className = [styles.pill, rounded ? styles.rounded : \"\", loading ? styles.skeleton : \"\"]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <button\n type=\"button\"\n data-aia-pill=\"\"\n data-aia-pill-active={active ? \"\" : undefined}\n data-aia-loading={loading ? \"\" : undefined}\n data-aia-smart-suggestion={smartSuggestion ? (completionHeader ? \"header\" : \"\") : undefined}\n tabIndex={-1}\n contentEditable={false}\n suppressContentEditableWarning\n className={className}\n style={{ \"--aia-pill-opacity\": PARAM_PILL_OPACITY[state] } as CSSProperties}\n onMouseDown={(e: MouseEvent) => e.preventDefault()}\n onClick={loading ? undefined : onClick}\n disabled={loading}\n >\n {smartSuggestion ? (\n <>\n <span className={`${styles.smartText} magicx-aia-smart-suggestion-text`}>{label}</span>\n <span\n className={`${styles.smartSparkle} magicx-aia-smart-suggestion-sparkle`}\n // biome-ignore lint/security/noDangerouslySetInnerHtml: a fixed SDK constant, never server markup\n dangerouslySetInnerHTML={{ __html: SMART_SUGGESTION_SPARKLE_SVG }}\n />\n </>\n ) : (\n label\n )}\n </button>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-199d0432\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-199d0432\";\n s.textContent = `/* ParamPill (Figma \"ParamPill\") — unfilled suggestion pill: transparent fill,\n no outline. ~28px via 6px padding + 14px text + the 1px border (border-box).\n The border is kept as a 1px transparent line so the box stays the same size\n as it was when the outline was dashed. */\n.aia-pill-6Ga7S {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 5px 8px;\n border: 1px solid transparent;\n border-radius: 7px;\n background: transparent;\n color: var(--aia-pill-color, var(--aia-color-text-muted, #c1c4cb));\n font-family: inherit;\n /* Param labels read as small-caps section headers: distinctly smaller than\n the options they head (0.8× the pill knob), uppercased, and letter-spaced. */\n font-size: calc(var(--aia-pill-font-size, 14px) * 0.8);\n font-weight: 600;\n line-height: normal;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n cursor: pointer;\n white-space: nowrap;\n /* The positional opacity ramp, set inline per pill as a custom property so\n a rule can read the live label at full strength without !important. */\n opacity: var(--aia-pill-opacity, 1);\n animation: aia-fadeIn-Ux4eQ 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;\n}\n\n.aia-rounded-y7xA9 {\n border-radius: 999px;\n}\n\n/* Smart Suggestion header: the question label's type, with a sparkle after\n it, over the completions of the word being typed or on a question the server\n marks. When it appears a glint of the accent sweeps the text twice and the\n sparkle twinkles as each lands. Only the header over completions\n (\"header\") takes no pointer: a marked question is tapped like any pill. */\n.aia-pill-6Ga7S[data-aia-smart-suggestion] {\n gap: 0.35em;\n}\n\n.aia-pill-6Ga7S[data-aia-smart-suggestion=\"header\"] {\n cursor: default;\n}\n\n.aia-smartText-R0cfw {\n background:\n linear-gradient(\n 105deg,\n var(--aia-pill-color, var(--aia-color-text-muted, #c1c4cb)) 34%,\n var(--aia-smart-suggestion-accent, #b84549) 44%,\n var(--aia-smart-suggestion-glint, #f3c4c5) 50%,\n var(--aia-smart-suggestion-accent, #b84549) 56%,\n var(--aia-pill-color, var(--aia-color-text-muted, #c1c4cb)) 66%\n )\n 100% 0 / 300% 100%;\n -webkit-background-clip: text;\n background-clip: text;\n -webkit-text-fill-color: transparent;\n animation: aia-smartSuggestion-shimmer-F-yoD 2.5s ease-in-out 2;\n}\n\n.aia-smartSparkle-IVabG {\n display: inline-flex;\n color: var(--aia-smart-suggestion-accent, #b84549);\n}\n\n.aia-smartSparkle-IVabG .aia-sparkle-large,\n.aia-smartSparkle-IVabG .aia-sparkle-small {\n transform-box: fill-box;\n transform-origin: center;\n animation: aia-smartSuggestion-sparkle-Wfj-4 2.5s ease-in-out 2;\n}\n\n.aia-smartSparkle-IVabG .aia-sparkle-small {\n animation-name: aia-smartSuggestion-sparkle-small-3VsWJ;\n}\n\n@keyframes aia-smartSuggestion-shimmer-F-yoD {\n 0% {\n background-position: 100% 0;\n }\n 60%,\n 100% {\n background-position: 0 0;\n }\n}\n\n@keyframes aia-smartSuggestion-sparkle-Wfj-4 {\n 0%,\n 45%,\n 75%,\n 100% {\n transform: scale(1);\n }\n 60% {\n transform: scale(1.12);\n }\n}\n\n@keyframes aia-smartSuggestion-sparkle-small-3VsWJ {\n 0%,\n 45%,\n 75%,\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n 60% {\n transform: scale(1.5);\n opacity: 0.55;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-smartText-R0cfw,\n .aia-smartSparkle-IVabG .aia-sparkle-large,\n .aia-smartSparkle-IVabG .aia-sparkle-small {\n animation: none;\n }\n}\n\n/* Forced colours drop the background-clip paint, so the text is drawn plainly. */\n@media (forced-colors: active) {\n .aia-smartText-R0cfw {\n background: none;\n -webkit-text-fill-color: currentColor;\n animation: none;\n }\n}\n\n/* Loading — a pill kept from the last response fades out while the next one\n is fetched; a placeholder pill (no cached pills) only holds its space. */\n.aia-skeleton-57P0T {\n pointer-events: none;\n cursor: default;\n animation: aia-loadingOut-Aj9xO 160ms ease-in forwards;\n}\n\n.aia-skeleton-57P0T[data-aia-pill-skeleton] {\n visibility: hidden;\n animation: none;\n}\n\n/* Ends a hair above zero, like magicx-aia-fadeIn starts: a pill kept by key\n is re-enabled in place, and iOS cancels a tap on an element leaving 0. */\n@keyframes aia-loadingOut-Aj9xO {\n to {\n opacity: 0.01;\n }\n}\n\n@keyframes aia-fadeIn-Ux4eQ {\n from {\n opacity: 0;\n }\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"pill\":\"aia-pill-6Ga7S\",\"fadeIn\":\"aia-fadeIn-Ux4eQ\",\"rounded\":\"aia-rounded-y7xA9\",\"smartText\":\"aia-smartText-R0cfw\",\"smartSuggestion-shimmer\":\"aia-smartSuggestion-shimmer-F-yoD\",\"smartSparkle\":\"aia-smartSparkle-IVabG\",\"smartSuggestion-sparkle\":\"aia-smartSuggestion-sparkle-Wfj-4\",\"smartSuggestion-sparkle-small\":\"aia-smartSuggestion-sparkle-small-3VsWJ\",\"skeleton\":\"aia-skeleton-57P0T\",\"loadingOut\":\"aia-loadingOut-Aj9xO\"};","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-0fcb7940\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-0fcb7940\";\n s.textContent = `.aia-list-qvLqO {\n position: relative;\n z-index: 1;\n pointer-events: auto;\n display: inline-flex;\n gap: 7px;\n padding: 0 8px;\n align-items: center;\n vertical-align: middle;\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"list\":\"aia-list-qvLqO\"};","import {\n attachProductRowWheel,\n productImageSources,\n productImageSrc,\n productInitial,\n productPhotoFill,\n type UIStrings,\n uiStringsFor,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport {\n type CSSProperties,\n type KeyboardEvent as ReactKeyboardEvent,\n type MouseEvent as ReactMouseEvent,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport type { Product, ProductImageFallback, ProductsLayout } from \"../types\";\nimport styles from \"./ProductStrip.module.css\";\n\ninterface ProductStripProps {\n products: Product[];\n /** Scopes the section label's id to the owning listbox. */\n listboxId: string;\n onSelect: (product: Product) => void;\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 busyProductId?: string | 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 `onSelect`.\n */\n onAddToCart?: (product: Product) => void | PromiseLike<unknown>;\n /**\n * Focus moved into / out of the strip. The panel closes on blur by default\n * and the input blurs the moment a card takes focus, so the dropdown reports\n * focus as still-inside rather than shutting out from under the card.\n */\n onFocusChange?: (focused: boolean) => void;\n /**\n * True while a request is in flight: the strip fades out with the options\n * and back in when the response lands.\n */\n loading?: boolean;\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 focusable?: boolean;\n /** How the cards lay out — a scrolling row, or stacked as full-width rows. Default: \"row\". */\n layout?: ProductsLayout;\n imageFallback?: ProductImageFallback;\n /** Whether the cards draw the vendor line above the title. Default: true. */\n showVendor?: boolean;\n /** The words of the widget language. Default: English. */\n strings?: UIStrings;\n}\n\n/**\n * The dropdown's product strip: a labelled section holding a horizontally\n * scrolling row of product cards. Sits below the options grid and above the\n * footer, and renders only when there are products — the panel's two halves\n * are independent, so an empty strip leaves no gap and an empty options grid\n * leaves the strip alone.\n *\n * Mirrors the vanilla core's `renderProductStrip` markup and class contract so\n * both packages theme identically. Two layout notes carried over from it:\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 * Every text node resolves its colour through the same `--aia-option-*`\n * chain the options use (see ProductStrip.module.css).\n * - The options grid carries a negative bottom margin so the footer rides up\n * over its reserved band; whatever follows the grid inherits that pull. The\n * dropdown root is marked `data-aia-has-products` and appearance.css zeroes\n * the band at its source rather than the strip cancelling it from here.\n */\nexport function ProductStrip({\n products,\n listboxId,\n onSelect,\n busyProductId = null,\n onAddToCart,\n onFocusChange,\n focusable = true,\n loading = false,\n layout = \"row\",\n imageFallback = \"image\",\n showVendor = true,\n strings = uiStringsFor(),\n}: ProductStripProps) {\n const hasProducts = products.length > 0;\n const rowRef = useRef<HTMLDivElement>(null);\n\n // A mouse wheel over the row scrolls it sideways. Bound through the ref\n // rather than `onWheel`: React registers wheel listeners passively, so a\n // `preventDefault` from the prop would not keep the page still. The row\n // element is stable while there are products and unmounts with the section,\n // so the binding follows `hasProducts`.\n useEffect(() => {\n const row = rowRef.current;\n if (!hasProducts || !row) return;\n return attachProductRowWheel(row);\n }, [hasProducts]);\n\n if (!hasProducts) return null;\n\n const labelId = `${listboxId}-products-label`;\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: the rule suggests <fieldset>, which groups form controls and drags in legend semantics and UA styling. `group` is the one role a listbox accepts around a set of options, so the explicit ARIA role is exactly the point.\n <section\n className={styles.section}\n data-aia-products=\"\"\n data-aia-loading={loading ? \"\" : undefined}\n // The layout is CSS keyed off this attribute — the same cards, stacked\n // as rows under \"list\".\n data-aia-products-layout={layout}\n // `group` is the one role a listbox accepts around a set of options, so\n // the strip stays inside the listbox without breaking its content model.\n role=\"group\"\n aria-labelledby={labelId}\n >\n {/* data-aia-products-label: the scroll arrow centres itself on this row. */}\n <div className={styles.label} id={labelId} data-aia-products-label=\"\">\n {strings.products}\n </div>\n <div ref={rowRef} className={styles.row} data-aia-products-row=\"\">\n {products.map((product, i) => (\n <ProductCard\n key={product.id}\n product={product}\n id={`${listboxId}-product-${i}`}\n onSelect={onSelect}\n busy={product.id === busyProductId}\n onAddToCart={onAddToCart}\n onFocusChange={onFocusChange}\n focusable={focusable}\n imageFallback={imageFallback}\n showVendor={showVendor}\n soldOut={strings.soldOut}\n addToCart={strings.addToCart}\n />\n ))}\n </div>\n </section>\n );\n}\n\ninterface ProductCardProps {\n product: Product;\n id: string;\n onSelect: (product: Product) => void;\n busy: boolean;\n onAddToCart?: (product: Product) => void | PromiseLike<unknown>;\n onFocusChange?: (focused: boolean) => void;\n focusable: boolean;\n imageFallback: ProductImageFallback;\n showVendor: boolean;\n soldOut: string;\n addToCart: string;\n}\n\nfunction ProductCard({\n product,\n id,\n onSelect,\n busy,\n onAddToCart,\n onFocusChange,\n focusable,\n imageFallback,\n showVendor,\n soldOut,\n addToCart,\n}: ProductCardProps) {\n // A sold-out product can't be added, so its card has no button at all.\n const hasCart = Boolean(onAddToCart) && product.available !== false;\n // How much of the tile the photo fills, so the cart button sits inside the\n // photo's own corner (productPhotoFill). Null until it loads.\n const [photoFill, setPhotoFill] = useState<{ x: number; y: number } | null>(null);\n const handleBlur = (e: { relatedTarget: EventTarget | null }) => {\n const next = e.relatedTarget as HTMLElement | null;\n if (next?.closest(\"[data-aia-dropdown]\")) return;\n onFocusChange?.(false);\n };\n const handleClick = (e: ReactMouseEvent<HTMLAnchorElement>) => {\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 (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0) return;\n e.preventDefault();\n onSelect(product);\n };\n\n return (\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 is\n // that AT no longer calls it a link.\n <a\n id={id}\n className={styles.card}\n data-aia-product=\"\"\n data-aia-product-sold-out={product.available === false ? \"\" : undefined}\n data-aia-product-has-cart={hasCart ? \"\" : undefined}\n data-aia-product-state={busy ? \"busy\" : undefined}\n aria-busy={busy ? true : undefined}\n role=\"option\"\n aria-selected={false}\n style={\n photoFill\n ? ({\n \"--aia-product-photo-fill-x\": String(photoFill.x),\n \"--aia-product-photo-fill-y\": String(photoFill.y),\n } as CSSProperties)\n : undefined\n }\n href={product.url}\n tabIndex={focusable ? 0 : -1}\n onClick={handleClick}\n onKeyDown={(e) => {\n if (e.key !== \"Enter\" && e.key !== \" \") return;\n e.preventDefault();\n onSelect(product);\n }}\n onFocus={() => onFocusChange?.(true)}\n onBlur={handleBlur}\n >\n <ProductMedia\n key={productImageSrc(product.imageUrl) ?? \"\"}\n sources={productImageSources(product.imageUrl)}\n title={product.title}\n fallback={imageFallback}\n onPhotoFill={setPhotoFill}\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 className={styles.body}>\n {showVendor && product.vendor ? (\n <span className={styles.vendor}>{product.vendor}</span>\n ) : null}\n <span className={styles.title}>{product.title}</span>\n {product.price ? (\n <span className={styles.price}>\n {product.price}\n {product.compareAtPrice ? (\n <s className={styles.compareAt}>{product.compareAtPrice}</s>\n ) : null}\n </span>\n ) : null}\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 {product.available === false ? <span className={styles.badge}>{soldOut}</span> : null}\n </span>\n {hasCart && onAddToCart ? (\n <CartButton\n // A changed product (anything but its price — vanilla's `cardKey`)\n // remounts the button, which puts an \"added\" check back at rest.\n key={cartIdentity(product)}\n product={product}\n label={`${addToCart}: ${product.title}`}\n focusable={focusable}\n onAddToCart={onAddToCart}\n onFocus={() => onFocusChange?.(true)}\n onBlur={handleBlur}\n />\n ) : null}\n </a>\n );\n}\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\ntype CartState = \"adding\" | \"added\" | null;\n\n/**\n * The card's add-to-cart button. A child of the card rather than of the media\n * tile, which is aria-hidden; the stylesheet lifts it over the tile's bottom\n * right corner. A `role=\"button\"` span, not a <button>: the card is an <a>,\n * and interactive content inside an anchor is invalid HTML (React's\n * validateDOMNesting warns about it). Its press never reaches the card, so it\n * never selects. Mirrors vanilla's `buildCartButton`.\n */\nfunction CartButton({\n product,\n label,\n focusable,\n onAddToCart,\n onFocus,\n onBlur,\n}: {\n product: Product;\n label: string;\n focusable: boolean;\n onAddToCart: (product: Product) => void | PromiseLike<unknown>;\n onFocus: () => void;\n onBlur: (e: { relatedTarget: EventTarget | null }) => void;\n}) {\n const [state, setState] = useState<CartState>(null);\n // The press guard reads a ref, not the state: a second click landing before\n // the re-render must still see \"adding\".\n const stateRef = useRef<CartState>(null);\n // The latest product, so a price change mid-flight adds what the card shows.\n const productRef = useRef(product);\n productRef.current = product;\n const mounted = useRef(true);\n\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n\n const set = (next: CartState) => {\n stateRef.current = next;\n if (mounted.current) setState(next);\n };\n\n const press = (e: ReactMouseEvent<HTMLElement> | ReactKeyboardEvent<HTMLElement>) => {\n e.preventDefault();\n e.stopPropagation();\n if (stateRef.current === \"adding\") return;\n set(\"adding\");\n let pending: PromiseLike<unknown>;\n try {\n pending = Promise.resolve(onAddToCart(productRef.current));\n } catch (error) {\n pending = Promise.reject(error);\n }\n pending.then(\n // The check stays until the product changes; another press adds again.\n () => set(\"added\"),\n () => set(null),\n );\n };\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: the button sits inside the card's <a>, and a <button> there is invalid HTML that React's validateDOMNesting warns about — hence the explicit role on a span.\n <span\n className={styles.cart}\n data-aia-product-cart=\"\"\n data-aia-cart-state={state ?? undefined}\n aria-busy={state === \"adding\" ? true : undefined}\n role=\"button\"\n aria-label={label}\n tabIndex={focusable ? 0 : -1}\n onClick={press}\n // Keys never reach the card, whose own Enter / Space would select it.\n onKeyDown={(e) => {\n if (e.key !== \"Enter\" && e.key !== \" \") return;\n press(e);\n }}\n onFocus={(e) => {\n // The card's own onFocus would report the same thing again.\n e.stopPropagation();\n onFocus();\n }}\n onBlur={(e) => {\n e.stopPropagation();\n onBlur(e);\n }}\n >\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n <path\n className={styles.cartGlyph}\n 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 />\n <path className={styles.cartGlyph} d=\"M13.5 6.5v-4M11.5 4.5h4\" />\n <path className={styles.cartCheck} d=\"M5 12.5l4.5 4.5L19 7.5\" />\n <path className={styles.cartSpinner} d=\"M12 4a8 8 0 1 0 8 8\" />\n <circle className={styles.cartGlyph} cx=\"9\" cy=\"20\" r=\"1.3\" />\n <circle className={styles.cartGlyph} cx=\"17.5\" cy=\"20\" r=\"1.3\" />\n </svg>\n </span>\n );\n}\n\nfunction ProductMedia({\n sources,\n title,\n fallback,\n onPhotoFill,\n}: {\n /** URLs to try in order: the thumbnail, then the original. */\n sources: string[];\n title: string;\n fallback: ProductImageFallback;\n /** How much of the tile the loaded photo fills; null once none can load. */\n onPhotoFill: (fill: { x: number; y: number } | null) => void;\n}) {\n // How many sources have failed to load; the card shows the next one, and\n // its placeholder once none is left. Keyed by the parent on the first src.\n const [failed, setFailed] = useState(0);\n const src = sources[failed];\n const hasImage = Boolean(src);\n // The src that last finished loading: once it is the one shown, the tile's\n // placeholder fill steps aside.\n const [loadedSrc, setLoadedSrc] = useState<string | null>(null);\n const showInitial = !hasImage && fallback === \"initial\";\n // Keyed on the first source, so a changed or removed image remounts this\n // tile: the old photo's fill goes with it, and the new one's load sets its own.\n useEffect(() => () => onPhotoFill(null), [onPhotoFill]);\n return (\n <span\n className={styles.media}\n // A styling hook that reads the same in every package (the class does not).\n data-aia-product-media=\"\"\n aria-hidden=\"true\"\n data-aia-product-placeholder={!hasImage && !showInitial ? \"\" : undefined}\n data-aia-product-initial={showInitial ? \"\" : undefined}\n data-aia-image-loaded={hasImage && loadedSrc === src ? \"\" : undefined}\n >\n {hasImage ? (\n <img\n className={styles.image}\n src={src}\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n onLoad={(e) => {\n setLoadedSrc(src);\n onPhotoFill(\n productPhotoFill(e.currentTarget.naturalWidth, e.currentTarget.naturalHeight),\n );\n }}\n onError={() => {\n // The last source failing leaves the placeholder, which fills the tile.\n if (failed + 1 >= sources.length) onPhotoFill(null);\n setFailed((count) => count + 1);\n }}\n />\n ) : null}\n {showInitial ? productInitial(title) : null}\n </span>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-fef1688d\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-fef1688d\";\n s.textContent = `/* Product strip — the React counterpart of the vanilla core's strip rules\n (packages/vanilla/src/styles.css). Same tokens, same defaults, so a consumer\n theming one package sees the same result in the other.\n\n Nothing here is allowed to say \\`color: inherit\\`: the dropdown paints a\n background but never sets a \\`color\\`, so an inheriting node would pick up the\n HOST PAGE's text colour and render black text on a dark panel. For the same\n reason there is no \\`prefers-color-scheme\\` rule in this file — the panel's\n darkness comes from --aia-surface, which is independent of the OS setting. */\n\n.aia-section-Hugfg {\n display: flex;\n flex-direction: column;\n gap: 6px;\n /* The option text sits 10px inside the dropdown's padding edge (the\n option's own padding), so the section carries the same 10px and its\n label lands on the option text's left edge — which the dropdown in turn\n places under the typed text (--aia-content-inset-left). */\n padding: 0 10px;\n min-width: 0;\n}\n\n.aia-label-nuc93 {\n font-family: inherit;\n font-size: var(--aia-products-label-font-size, 11px);\n font-weight: 500;\n line-height: 18px;\n letter-spacing: 0.02em;\n color: var(\n --aia-products-label-color,\n var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb))\n );\n}\n\n/* The scroll container. Horizontal overflow is confined here — the dropdown\n itself is \\`overflow: hidden\\`, so the page can never gain a sideways\n scrollbar no matter how many cards there are. \\`overscroll-behavior-x\\` stops\n a trackpad fling at either end from chaining out to the page. */\n.aia-row-WDVBX {\n display: flex;\n gap: var(--aia-product-gap, 8px);\n min-width: 0;\n overflow-x: auto;\n overflow-y: hidden;\n overscroll-behavior-x: contain;\n padding-bottom: 2px;\n /* Pull the row out by the card's own 6px padding so the first card's\n image tile — not its hover fill — starts on the label's left edge, the\n same way the option's highlight fill hangs outside its text. */\n margin-inline: -6px;\n /* Hide the scrollbar chrome across all three engines while leaving the box\n scrollable by trackpad, touch and keyboard. A mouse wheel is vertical and\n would otherwise have no way through a row with no scrollbar to grab, so\n ProductStrip.tsx binds the vanilla package's attachProductRowWheel on the\n row to turn a wheel over it into sideways travel. */\n scrollbar-width: none;\n -ms-overflow-style: none;\n}\n\n.aia-row-WDVBX::-webkit-scrollbar {\n display: none;\n}\n\n.aia-card-JBGYT {\n flex: 0 0 auto;\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: var(--aia-product-card-width, 116px);\n padding: 6px;\n border-radius: 10px;\n background: var(--aia-product-bg, transparent);\n /* Explicit, never inherited — see the file header. */\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n text-decoration: none;\n cursor: pointer;\n transition: background-color 150ms ease;\n /* The sold-out badge is positioned against the card. */\n position: relative;\n}\n\n.aia-card-JBGYT:hover {\n background: var(--aia-product-bg-active, var(--aia-option-bg, transparent));\n}\n\n/* Focus is the only cue a keyboard user gets, so it is a real ring rather than\n a background change. Drawn INSIDE the card (negative offset): the row is a\n scroll container with clipped overflow, so an outset ring is cut off on the\n first and last cards and on every card's top and bottom edge. */\n.aia-card-JBGYT:focus-visible {\n outline: 2px solid var(--aia-product-focus-ring, var(--aia-option-color-selected, currentColor));\n outline-offset: -2px;\n}\n\n/* Square media tile. aspect-ratio (not a fixed height) keeps it square at any\n --aia-product-card-width a consumer sets. The fill is the placeholder: it\n shows across the whole tile until the photo paints (a photo's size isn't\n known before it loads), and behind both fallback tiles. */\n.aia-media-RrbGe {\n display: block;\n position: relative;\n width: 100%;\n aspect-ratio: 1 / 1;\n border-radius: 8px;\n overflow: hidden;\n background: var(--aia-product-media-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.25)));\n}\n\n/* Once the photo has loaded the placeholder steps aside: a contained photo\n that doesn't fill the tile sits on the panel's own background rather than\n on a grey box. The renderer sets the attribute from the photo's \\`load\\`\n event. */\n.aia-media-RrbGe[data-aia-image-loaded] {\n background: transparent;\n}\n\n/* \\`contain\\`, not \\`cover\\`: catalog photos come in any aspect ratio, and a\n square crop cuts the top and bottom off a tall one (a gallon jug). The\n picture fills the tile's height and takes only the width its ratio needs,\n centred, so a tall picture's box is the picture itself and its own corner\n radius rounds it. A wide one is clamped to the tile's width and contained\n inside it; a square one fills the tile. */\n.aia-image-5pNL7 {\n display: block;\n width: auto;\n max-width: 100%;\n height: 100%;\n margin: 0 auto;\n border-radius: var(--aia-product-image-radius, 8px);\n object-fit: contain;\n}\n\n/* Placeholder tile for a product with no image — a storefront pictogram on\n the same media fill, so a card without art reads as \"no photo\" instead of\n broken. The pictogram is inlined as a data URI so the placeholder needs no\n network and no asset pipeline; --aia-product-placeholder-image swaps it. */\n.aia-media-RrbGe:where([data-aia-product-initial]) {\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--aia-product-title-color, var(--aia-option-color-selected, currentColor));\n font-size: 24px;\n font-weight: 600;\n line-height: 1;\n}\n\n.aia-media-RrbGe[data-aia-product-placeholder]::after {\n content: \"\";\n position: absolute;\n inset: 22%;\n background:\n var(\n --aia-product-placeholder-image,\n url(\"data:image/svg+xml,%3Csvg viewBox='0 -0.5 32 32' fill-rule='evenodd' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform='matrix(1,0,0,1,-384,-144)'%3E%3Cg transform='matrix(0.875,0,0,0.875,90.25,19.125)'%3E%3Cpath d='M340.924,147.74C341.224,146.789 342.107,146.143 343.104,146.143C347.705,146.143 360.491,146.143 364.985,146.143C365.965,146.143 366.836,146.768 367.15,147.697C368.119,150.386 370,155.73 370,157C370,159.208 368.208,161 366,161C363.792,161 362,159.208 362,157C362,159.208 360.208,161 358,161C355.792,161 354,159.208 354,157C354,159.208 352.208,161 350,161C347.792,161 346,159.208 346,157C346,159.208 344.208,161 342,161C340.53,161 339.244,160.205 338.549,159.022C338.057,158.185 337.944,157.179 338.236,156.254C338.787,154.507 340.172,150.121 340.924,147.74Z' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1,0,0,1.32454,48,-56.1457)'%3E%3Cpath d='M341.026,160.675C341.026,160.675 341.01,168.196 341.003,171.488C341.002,171.889 341.213,172.273 341.588,172.557C341.963,172.841 342.472,173 343.003,173C347.188,173 356.817,173 361,173C361.53,173 362.039,172.841 362.414,172.558C362.789,172.275 363,171.891 363,171.49C363,168.2 363,160.675 363,160.675' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1,0,0,1,48,0)'%3E%3Cpath d='M355,168C355,166.895 354.105,166 353,166C352.356,166 351.644,166 351,166C349.895,166 349,166.895 349,168C349,170.069 349,173 349,173L355,173L355,168Z' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1.11111,0,0,1.11111,-47.2678,-87.5361)'%3E%3Ccircle cx='411.5' cy='213.5' r='4.5' fill='%2390e0ef'%3E%3C/circle%3E%3C/g%3E%3Cpath d='M405.529,146C406.628,144.773 408.225,144 410,144C413.311,144 416,146.689 416,150C416,151.549 415.412,152.962 414.446,154.027C414.775,155.15 415,156.076 415,156.5C415,158.459 413.746,160.127 411.998,160.744L411.998,171C411.998,171.796 411.682,172.559 411.119,173.121C410.557,173.684 409.794,174 408.998,174L391.002,174C390.205,174 389.441,173.683 388.879,173.119C388.316,172.555 388,171.79 388.002,170.994L388.024,160.752C387.007,160.399 386.155,159.691 385.618,158.776L385.618,158.776C385.044,157.799 384.912,156.626 385.253,155.546L387.605,148.097C387.999,146.849 389.157,146 390.466,146L405.529,146ZM409.998,160.972C408.79,160.838 407.726,160.225 407,159.327C406.175,160.347 404.913,161 403.5,161C402.087,161 400.825,160.347 400,159.327C399.175,160.347 397.913,161 396.5,161C395.087,161 393.825,160.347 393,159.327C392.278,160.219 391.222,160.831 390.023,160.97L390.002,170.998C390.002,171.263 390.107,171.518 390.294,171.706C390.482,171.894 390.736,172 391.002,172L396,172L396,168C396,166.343 397.343,165 399,165L401,165C402.657,165 404,166.343 404,168L404,172L408.998,172C409.263,172 409.517,171.895 409.705,171.707C409.893,171.52 409.998,171.265 409.998,171L409.998,160.972ZM402,172L398,172L398,168C398,167.448 398.448,167 399,167C399,167 401,167 401,167C401.552,167 402,167.448 402,168L402,172ZM404.342,148L390.466,148C390.03,148 389.644,148.283 389.512,148.699L387.16,156.148C386.99,156.688 387.056,157.275 387.342,157.763C387.777,158.503 388.581,159 389.5,159C390.88,159 392,157.88 392,156.5C392,155.003 394,155.003 394,156.5C394,157.88 395.12,159 396.5,159C397.88,159 399,157.88 399,156.5C399,155.004 401,155.004 401,156.5C401,157.88 402.12,159 403.5,159C404.88,159 406,157.88 406,156.5C406,154.986 408,154.986 408,156.5C408,157.88 409.12,159 410.5,159C411.88,159 413,157.88 413,156.5C413,156.259 412.917,155.843 412.779,155.318C411.948,155.753 411.003,156 410,156C406.689,156 404,153.311 404,150C404,149.299 404.12,148.626 404.342,148ZM410,146C412.208,146 414,147.792 414,150C414,152.208 412.208,154 410,154C407.792,154 406,152.208 406,150C406,147.792 407.792,146 410,146ZM407.543,151.207L408.546,152.21C408.733,152.397 408.988,152.503 409.253,152.503C409.519,152.503 409.773,152.397 409.961,152.209L412.458,149.706C412.848,149.316 412.847,148.682 412.456,148.292C412.066,147.902 411.432,147.903 411.042,148.294L409.252,150.088C409.252,150.088 408.957,149.793 408.957,149.793C408.567,149.403 407.933,149.403 407.543,149.793C407.153,150.183 407.153,150.817 407.543,151.207Z' fill='%231990a7'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\")\n )\n center / contain no-repeat;\n}\n\n/* The text column. Only the title is guaranteed; vendor and price render no\n element at all when absent, so the gap can't reserve space for a missing\n line. */\n.aia-body-ly032 {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n}\n\n.aia-vendor-Gvu7G {\n font-family: inherit;\n font-size: var(--aia-product-vendor-font-size, 10px);\n line-height: 14px;\n color: var(\n --aia-product-vendor-color,\n var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb))\n );\n opacity: 0.8;\n /* Vendor names are frequently long — one line, clipped. */\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.aia-title-gCNmq {\n font-family: inherit;\n font-size: var(--aia-product-title-font-size, 12px);\n font-weight: 400;\n line-height: 16px;\n /* The card's most prominent text uses the same token the *highlighted*\n option text does, so it stays legible on any --aia-surface a consumer\n sets — light or dark — without a second theming control. */\n color: var(\n --aia-product-title-color,\n var(--aia-option-color-selected, var(--aia-color-text-default, #fff))\n );\n display: -webkit-box;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n}\n\n.aia-price-gULcE {\n font-family: inherit;\n font-size: var(--aia-product-price-font-size, 11px);\n font-weight: 500;\n line-height: 15px;\n color: var(\n --aia-product-price-color,\n var(--aia-option-color-selected, var(--aia-color-text-default, #fff))\n );\n /* The price and the struck price are two items on one line that wrap as\n whole figures: a long pair drops the struck price to the next line rather\n than running past the card's edge. */\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n column-gap: 4px;\n}\n\n/* The price before a markdown, struck through after the price, on the same\n line when both fit. It inherits the price's size and takes its colour dimmed, so it reads\n as secondary on any surface without a second theming control. */\n.aia-compareAt-ewE54 {\n font-weight: 400;\n color: var(--aia-product-compare-at-color, currentColor);\n opacity: var(--aia-product-compare-at-opacity, 0.6);\n}\n\n/* Sold-out badge. It sits last in the text column, so the card's accessible\n name ends with it, and is lifted over the image's top-left corner: card\n padding (6px) plus the same again. A light chip with dark, tracked capitals\n reads on any photo, light or dark, and on either panel surface. */\n.aia-badge-j9Hcd {\n position: absolute;\n top: var(--aia-product-badge-inset, 12px);\n left: var(--aia-product-badge-inset, 12px);\n padding: 3px 6px;\n border-radius: 4px;\n background: var(--aia-product-badge-bg, rgba(255, 255, 255, 0.94));\n color: var(--aia-product-badge-color, #1f2328);\n /* A hairline ring keeps the chip's edge on a pale image or a light panel. */\n box-shadow:\n 0 0 0 1px rgba(0, 0, 0, 0.08),\n 0 1px 2px rgba(0, 0, 0, 0.18);\n font-family: inherit;\n font-size: var(--aia-product-badge-font-size, 9px);\n font-weight: 600;\n line-height: 1;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n white-space: nowrap;\n pointer-events: none;\n}\n\n/* Add-to-cart button (\\`onProductAddToCart\\`). A child of the card, lifted\n over the bottom right corner of the square media tile: the tile starts\n below the card's 6px padding and is the card's width less both paddings\n wide, so its bottom edge is the card width less 6px down, and the button\n sits 6px inside that corner. A light disc with a dark glyph, like the\n sold-out chip, reads on any photo; a store's accent goes in through the\n tokens. */\n.aia-cart-kSlqU {\n position: absolute;\n /* The tile's corner moved in by the margin a photo leaves when it doesn't\n fill the square (--aia-product-photo-fill-x / -y, set on the card when\n the photo loads; 1, the tile's own corner, until then). */\n top: calc(\n var(--aia-product-card-width, 116px) -\n 12px -\n var(--aia-product-cart-size, 28px) -\n (var(--aia-product-card-width, 116px) - 12px) *\n (1 - var(--aia-product-photo-fill-y, 1)) /\n 2\n );\n right: calc(\n 12px +\n (var(--aia-product-card-width, 116px) - 12px) *\n (1 - var(--aia-product-photo-fill-x, 1)) /\n 2\n );\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--aia-product-cart-size, 28px);\n height: var(--aia-product-cart-size, 28px);\n border-radius: 999px;\n background: var(--aia-product-cart-bg, rgba(255, 255, 255, 0.94));\n color: var(--aia-product-cart-color, #1f2328);\n box-shadow:\n 0 0 0 1px rgba(0, 0, 0, 0.08),\n 0 1px 3px rgba(0, 0, 0, 0.22);\n cursor: pointer;\n transition:\n transform 150ms ease,\n opacity 150ms ease;\n}\n\n.aia-cart-kSlqU:hover {\n transform: scale(1.08);\n}\n\n.aia-cart-kSlqU:focus-visible {\n outline: 2px solid var(--aia-product-focus-ring, var(--aia-option-color-selected, currentColor));\n outline-offset: 2px;\n}\n\n.aia-cart-kSlqU svg {\n display: block;\n width: 16px;\n height: 16px;\n fill: none;\n stroke: currentColor;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n/* The glyph's shapes carry no paint attributes of their own, so a page's\n \\`path { … }\\` / \\`circle { … }\\` would beat what they inherit from the svg;\n pin it by class, like the submit arrow's. */\n.aia-cart-kSlqU svg path {\n fill: none;\n stroke: currentColor;\n}\n\n.aia-cart-kSlqU svg circle {\n fill: none;\n stroke: currentColor;\n}\n\n.aia-cartCheck-YTTQ6 {\n display: none;\n}\n\n/* While the integration's promise is in flight the button ignores presses\n and shows a spinner (below) — the only cue: the pointer stays as it is.\n Once it resolves the cart turns into a check, which stays. */\n.aia-cart-kSlqU[data-aia-cart-state=\"added\"] .aia-cartGlyph-cmqAk {\n display: none;\n}\n\n.aia-cart-kSlqU[data-aia-cart-state=\"added\"] .aia-cartCheck-YTTQ6 {\n display: inline;\n}\n\n/* While the add is in flight the cart gives way to a spinning arc. A slower\n turn under reduced motion: it is the only sign the press took. */\n.aia-cartSpinner-442rc {\n display: none;\n}\n\n.aia-cart-kSlqU[data-aia-cart-state=\"adding\"] .aia-cartGlyph-cmqAk {\n display: none;\n}\n\n.aia-cart-kSlqU[data-aia-cart-state=\"adding\"] .aia-cartSpinner-442rc {\n display: inline;\n}\n\n.aia-cart-kSlqU[data-aia-cart-state=\"adding\"] svg {\n animation: aia-magicx-aia-product-cart-spin-x8mgr 0.8s linear infinite;\n}\n\n@keyframes aia-magicx-aia-product-cart-spin-x8mgr {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-cart-kSlqU[data-aia-cart-state=\"adding\"] svg {\n animation-duration: 2s;\n }\n}\n\n/* A selection in progress (\\`onProductSelect\\` ran, its page has not taken\n over): the add-to-cart button's disc and spinning arc sit on the middle of\n the tapped card's picture. The disc is the arc's own fill and spread, so\n the turn moves only the arc, and nothing in the card changes size. A slower\n turn under reduced motion: it is the only sign the tap took. The state\n sits in :where(), so a page's own rule on the attribute restyles or hides\n it. */\n.aia-card-JBGYT:where([data-aia-product-state=\"busy\"]) .aia-media-RrbGe::before {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: 1;\n margin: calc(var(--aia-spinner-size, 16px) / -2) 0 0 calc(var(--aia-spinner-size, 16px) / -2);\n box-sizing: border-box;\n width: var(--aia-spinner-size, 16px);\n height: var(--aia-spinner-size, 16px);\n border: var(--aia-spinner-width, 2px) solid\n var(--aia-product-spinner-color, var(--aia-product-cart-color, #1f2328));\n border-right-color: transparent;\n border-radius: 50%;\n animation: aia-magicx-aia-product-cart-spin-x8mgr 0.8s linear infinite;\n background: var(--aia-product-spinner-bg, var(--aia-product-cart-bg, rgba(255, 255, 255, 0.94)));\n box-shadow:\n 0 0 0 6px var(--aia-product-spinner-bg, var(--aia-product-cart-bg, rgba(255, 255, 255, 0.94))),\n 0 0 0 7px rgba(0, 0, 0, 0.08);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-card-JBGYT:where([data-aia-product-state=\"busy\"]) .aia-media-RrbGe::before {\n animation-duration: 2s;\n }\n}\n\n/* A sold-out product's image steps back, so the badge is not the only cue.\n Desaturated rather than faded: opacity lets the panel show through, which\n muddies a photo on a dark surface. */\n.aia-card-JBGYT[data-aia-product-sold-out] .aia-image-5pNL7 {\n filter: grayscale(0.55);\n}\n\n/* --- List layout (\\`productsLayout: \"list\"\\`) ---\n The same cards stacked as full-width rows — thumbnail on the left, text on\n the right — for results that read as a list (courses, listings, documents)\n rather than a shelf. The column scrolls vertically inside its own cap\n instead of sideways; the dropdown's \\`overflow: hidden\\` still contains it\n and the hidden scrollbar chrome above carries over. Appended after the row\n rules on purpose: the parity test finds each base rule by its first\n occurrence, and these selectors contain the base selectors. */\n.aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-row-WDVBX {\n flex-direction: column;\n gap: var(--aia-product-list-gap, 2px);\n max-height: var(--aia-product-list-max-height, 320px);\n overflow-x: hidden;\n overflow-y: auto;\n overscroll-behavior-y: contain;\n}\n\n.aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-card-JBGYT {\n flex-direction: row;\n align-items: center;\n gap: 10px;\n width: auto;\n padding: 6px 8px;\n}\n\n/* A fixed square thumbnail: width and height together, so the row's height\n is the tile's, not the card width's. */\n.aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-media-RrbGe {\n flex: 0 0 auto;\n width: var(--aia-product-list-media-size, 44px);\n height: var(--aia-product-list-media-size, 44px);\n}\n\n.aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-body-ly032 {\n flex: 1 1 auto;\n}\n\n/* In a list the badge is a banner across the bottom of the thumbnail. The\n thumbnail is centred in the card and the card's top and bottom padding\n match, so its bottom edge is half a thumbnail below the card's centre; its\n left edge is the card's 8px inline padding. */\n.aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-badge-j9Hcd {\n top: calc(50% + var(--aia-product-list-media-size, 44px) / 2);\n left: 8px;\n width: var(--aia-product-list-media-size, 44px);\n transform: translateY(-100%);\n padding: 2px 0;\n border-radius: 0 0 8px 8px;\n /* A dark scrim rather than the light chip: a light banner at a tile's edge\n merges with a light panel and reads as a cropped photo. */\n background: var(--aia-product-badge-list-bg, rgba(17, 17, 17, 0.72));\n color: var(--aia-product-badge-list-color, #fff);\n box-shadow: none;\n font-size: var(--aia-product-badge-list-font-size, 7px);\n letter-spacing: 0.02em;\n text-align: center;\n}\n\n/* In a list the button rides the row's right end, centred, and the text\n column stops short of it. */\n.aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-cart-kSlqU {\n top: 50%;\n right: 8px;\n transform: translateY(-50%);\n}\n\n.aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-cart-kSlqU:hover {\n transform: translateY(-50%) scale(1.08);\n}\n\n.aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-card-JBGYT[data-aia-product-has-cart] {\n padding-right: calc(var(--aia-product-cart-size, 28px) + 16px);\n}\n\n/* Classic options box (optionsStyle: \"classic\"): the panel as it was\n before the floating box: it unfolds out of the input with a stroke, at\n full size. Generated from the values the floating-box changes replaced;\n keep in step across the vanilla, React and Angular copies. */\n:where([data-aia-options-style=\"classic\"]) .aia-section-Hugfg {\n gap: 6px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-label-nuc93 {\n font-size: var(--aia-products-label-font-size, 11px);\n line-height: 18px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-row-WDVBX {\n gap: var(--aia-product-gap, 8px);\n padding-bottom: 2px;\n margin-inline: -6px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-card-JBGYT {\n gap: 6px;\n width: var(--aia-product-card-width, 116px);\n padding: 6px;\n border-radius: 10px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-media-RrbGe {\n border-radius: 8px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-image-5pNL7 {\n border-radius: var(--aia-product-image-radius, 8px);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-media-RrbGe:where([data-aia-product-initial]) {\n font-size: 24px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-body-ly032 {\n gap: 2px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-vendor-Gvu7G {\n font-size: var(--aia-product-vendor-font-size, 10px);\n line-height: 14px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-title-gCNmq {\n font-size: var(--aia-product-title-font-size, 12px);\n line-height: 16px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-price-gULcE {\n font-size: var(--aia-product-price-font-size, 11px);\n line-height: 15px;\n column-gap: 4px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-badge-j9Hcd {\n top: var(--aia-product-badge-inset, 12px);\n left: var(--aia-product-badge-inset, 12px);\n padding: 3px 6px;\n border-radius: 4px;\n font-size: var(--aia-product-badge-font-size, 9px);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-cart-kSlqU {\n top: calc(\n var(--aia-product-card-width, 116px) -\n 12px -\n var(--aia-product-cart-size, 28px) -\n (var(--aia-product-card-width, 116px) - 12px) *\n (1 - var(--aia-product-photo-fill-y, 1)) /\n 2\n );\n right: calc(\n 12px +\n (var(--aia-product-card-width, 116px) - 12px) *\n (1 - var(--aia-product-photo-fill-x, 1)) /\n 2\n );\n width: var(--aia-product-cart-size, 28px);\n height: var(--aia-product-cart-size, 28px);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-cart-kSlqU svg {\n width: 16px;\n height: 16px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-section-Hugfg[data-aia-products-layout=\"list\"] .aia-row-WDVBX {\n gap: var(--aia-product-list-gap, 2px);\n max-height: var(--aia-product-list-max-height, 320px);\n}\n:where([data-aia-options-style=\"classic\"])\n .aia-section-Hugfg[data-aia-products-layout=\"list\"]\n .aia-card-JBGYT {\n gap: 10px;\n padding: 6px 8px;\n}\n:where([data-aia-options-style=\"classic\"])\n .aia-section-Hugfg[data-aia-products-layout=\"list\"]\n .aia-media-RrbGe {\n width: var(--aia-product-list-media-size, 44px);\n height: var(--aia-product-list-media-size, 44px);\n}\n:where([data-aia-options-style=\"classic\"])\n .aia-section-Hugfg[data-aia-products-layout=\"list\"]\n .aia-badge-j9Hcd {\n top: calc(50% + var(--aia-product-list-media-size, 44px) / 2);\n left: 8px;\n width: var(--aia-product-list-media-size, 44px);\n padding: 2px 0;\n border-radius: 0 0 8px 8px;\n font-size: var(--aia-product-badge-list-font-size, 7px);\n}\n:where([data-aia-options-style=\"classic\"])\n .aia-section-Hugfg[data-aia-products-layout=\"list\"]\n .aia-cart-kSlqU {\n right: 8px;\n}\n:where([data-aia-options-style=\"classic\"])\n .aia-section-Hugfg[data-aia-products-layout=\"list\"]\n .aia-card-JBGYT[data-aia-product-has-cart] {\n padding-right: calc(var(--aia-product-cart-size, 28px) + 16px);\n}\n\n/* The strip leaves and returns with the options: it fades out on the same\n 160ms while a request loads and fades back when the response lands, so a\n step change never leaves it at full strength over rows that are gone. */\n.aia-section-Hugfg[data-aia-loading] {\n pointer-events: none;\n animation: aia-stripLoadingOut-0jOOQ 160ms ease-in forwards;\n}\n\n.aia-section-Hugfg:not([data-aia-loading]) {\n animation: aia-stripFadeIn-0p9qx 160ms ease-out;\n}\n\n@keyframes aia-stripLoadingOut-0jOOQ {\n to {\n opacity: 0.01;\n }\n}\n\n@keyframes aia-stripFadeIn-0p9qx {\n from {\n opacity: 0.01;\n }\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"section\":\"aia-section-Hugfg\",\"label\":\"aia-label-nuc93\",\"row\":\"aia-row-WDVBX\",\"card\":\"aia-card-JBGYT\",\"media\":\"aia-media-RrbGe\",\"image\":\"aia-image-5pNL7\",\"body\":\"aia-body-ly032\",\"vendor\":\"aia-vendor-Gvu7G\",\"title\":\"aia-title-gCNmq\",\"price\":\"aia-price-gULcE\",\"compareAt\":\"aia-compareAt-ewE54\",\"badge\":\"aia-badge-j9Hcd\",\"cart\":\"aia-cart-kSlqU\",\"cartCheck\":\"aia-cartCheck-YTTQ6\",\"cartGlyph\":\"aia-cartGlyph-cmqAk\",\"cartSpinner\":\"aia-cartSpinner-442rc\",\"magicx-aia-product-cart-spin\":\"aia-magicx-aia-product-cart-spin-x8mgr\",\"stripLoadingOut\":\"aia-stripLoadingOut-0jOOQ\",\"stripFadeIn\":\"aia-stripFadeIn-0p9qx\"};","import {\n isOptionsGridMobileViewport,\n measureOptionsGrid,\n needsOptionsGridMeasurement,\n OPTIONS_GRID_MOBILE_QUERY,\n type OptionsGridPlan,\n optionEnterDelayMs,\n optionsShowLeadingVisuals,\n planOptionsGrid,\n pointerMayHighlight,\n releasePanelHug,\n type SelectOptionOptions,\n sameOptionRows,\n syncHighlightScroll,\n syncPanelHug,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport { Grid } from \"../layout/Grid\";\nimport type { SuggestionOption } from \"../types\";\nimport { SuggestionItem } from \"./SuggestionItem\";\n\n/**\n * Tracks the phone-width breakpoint the options grid switches on. The core\n * owns the query itself (and the vanilla/Angular grids watch the same one) so\n * the three packages can't drift onto different breakpoints.\n */\nfunction useIsMobile(): boolean {\n const [isMobile, setIsMobile] = useState(isOptionsGridMobileViewport);\n useEffect(() => {\n if (typeof window === \"undefined\" || !window.matchMedia) return;\n const mq = window.matchMedia(OPTIONS_GRID_MOBILE_QUERY);\n const onChange = () => setIsMobile(mq.matches);\n onChange();\n mq.addEventListener(\"change\", onChange);\n return () => mq.removeEventListener(\"change\", onChange);\n }, []);\n return isMobile;\n}\n\ninterface SuggestionGridProps {\n options: SuggestionOption[];\n picked?: string[];\n activeIndex: number;\n onSelect: (option: SuggestionOption, how?: SelectOptionOptions) => void;\n onHighlight: (index: number) => void;\n /** The pointer left option `index` — see AIAutocompleteDropdownProps.onUnhighlight. */\n onUnhighlight?: (index: number) => void;\n listboxId: string;\n loading?: boolean;\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 groupKey?: string;\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 optionsPosition?: \"above\" | \"below\";\n /** Whether rows draw their `icon_svg` before the text. Default: true. */\n showIcons?: boolean;\n /** Whether rows draw their `image_url` as a thumbnail before the text. Default: true. */\n showImages?: boolean;\n /** Whether rows show their `item_count` at the trailing edge. Default: true. */\n showCounts?: boolean;\n}\n\n/**\n * The dropdown's option grid: a thin wrapper that lays `SuggestionItem`s out\n * with the `Grid` layout primitive. `Grid` owns the auto-fit columns and the\n * capped-height scroll, so this component only wires each option to its\n * highlight/select handlers and listbox-scoped id.\n */\nexport function SuggestionGrid({\n options,\n activeIndex,\n picked,\n onSelect,\n onHighlight,\n onUnhighlight,\n listboxId,\n loading,\n groupKey = \"\",\n optionsPosition = \"below\",\n showIcons = true,\n showImages = true,\n showCounts = true,\n}: SuggestionGridProps) {\n const isMobile = useIsMobile();\n const gridEl = useRef<HTMLDivElement | null>(null);\n // Two-pass: the first render lays out the measurement-free baseline (one\n // column), then the layout effect measures the rendered rows and upgrades to\n // the two-column plan when they provably fit — same policy as the vanilla\n // and Angular grids, all through `planOptionsGrid`. activeIndex is\n // deliberately not a dependency: highlighting can't change the plan, and\n // measuring clones every row and forces a layout. The needs-measurement gate\n // skips that cost entirely whenever the plan would ignore the result\n // (mobile, fewer than five options). jsdom measures every row at 0, so the\n // upgrade never fires in tests — the fit decision is asserted in the core's\n // own suite.\n const [measuredPlan, setMeasuredPlan] = useState<OptionsGridPlan | null>(null);\n // The rows the current plan was measured from. A skeleton mirroring them\n // keeps that plan — see `sameOptionRows`.\n const measuredRows = useRef<SuggestionOption[] | null>(null);\n useLayoutEffect(() => {\n if (loading && sameOptionRows(measuredRows.current, options)) return;\n measuredRows.current = loading ? null : options;\n const el = gridEl.current;\n const shouldMeasure = el && !loading && needsOptionsGridMeasurement(options.length, isMobile);\n // Measure at the panel's full width; the dropdown hugs it again after.\n const panel = el?.closest<HTMLElement>(\"[data-aia-dropdown]\");\n if (shouldMeasure && panel) releasePanelHug(panel);\n const measured = shouldMeasure ? measureOptionsGrid(el) : null;\n setMeasuredPlan(\n measured\n ? planOptionsGrid(options.length, isMobile, measured.rowWidths, measured.gridWidth)\n : null,\n );\n }, [options, isMobile, loading]);\n const plan = measuredPlan ?? planOptionsGrid(options.length, isMobile, null, null);\n // A new column plan or a mobile flip renders only here (the dropdown does not\n // re-render with it), so the hug is fitted again once the grid carries the plan's columns.\n // biome-ignore lint/correctness/useExhaustiveDependencies: plan.template and isMobile are the re-fit triggers, not reads\n useLayoutEffect(() => {\n const panel = gridEl.current?.closest<HTMLElement>(\"[data-aia-dropdown]\");\n if (panel) syncPanelHug(panel);\n }, [plan.template, isMobile]);\n // A highlight the keyboard moved brings its row into view; one the pointer\n // set does not (the hover handlers below say which, through\n // `pointerMayHighlight`). Declared after the Grid child, whose own layout\n // effect resets the scroll for a new group first. Skeleton rows show none.\n const shownIndex = loading ? -1 : activeIndex;\n useLayoutEffect(() => {\n if (gridEl.current) syncHighlightScroll(gridEl.current, shownIndex);\n }, [shownIndex]);\n // Icons and pictures are all-or-nothing across the list — no single row can\n // decide its own (see `optionsShowLeadingVisuals`).\n const leadingVisuals = optionsShowLeadingVisuals(options, showIcons, showImages);\n return (\n <Grid\n min=\"250px\"\n max=\"1fr\"\n gap=\"0\"\n scroll\n scrollResetKey={groupKey}\n template={plan.template}\n maxHeight={plan.maxHeight}\n innerRef={(el) => {\n gridEl.current = el;\n }}\n // Read by the scroll arrow to tell a new set of options (rising in)\n // from the same set re-rendered.\n data-aia-group={groupKey}\n >\n {options.map((option, i) => (\n <SuggestionItem\n // The group is part of the key: a new suggestion's options are new\n // rows and get the entrance animation even when one spells the same\n // as a row already on screen. The parameter is part of it too: a\n // smart suggestion offers one text under several parameters\n // (\"Shoes\" under Women type and Men type), each a row of its own.\n key={`${groupKey}\\0${option.parameter ?? \"\"}\\0${option.text}`}\n option={option}\n isHighlighted={i === activeIndex}\n checked={picked ? picked.includes(option.text) : undefined}\n onSelect={onSelect}\n onHighlight={(event) => {\n if (pointerMayHighlight(gridEl.current, i, event)) onHighlight(i);\n }}\n onUnhighlight={\n onUnhighlight\n ? (event) => {\n if (pointerMayHighlight(gridEl.current, -1, event)) onUnhighlight(i);\n }\n : undefined\n }\n id={`${listboxId}-option-${i}`}\n loading={loading}\n showIcon={showIcons && leadingVisuals}\n showImage={showImages && leadingVisuals}\n showCount={showCounts}\n scrollHint={!loading && plan.scrollHintIndices.includes(i)}\n // Skeleton rows fade in together — they're placeholders, not content.\n enterDelayMs={\n loading ? 0 : optionEnterDelayMs(i, plan.cols, options.length, optionsPosition)\n }\n />\n ))}\n </Grid>\n );\n}\n","import { optionsGridTemplateColumns } from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport {\n type ComponentPropsWithoutRef,\n type CSSProperties,\n type ReactNode,\n useLayoutEffect,\n useRef,\n} from \"react\";\nimport \"./Grid.css\";\n\ninterface GridProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"className\"> {\n /** Minimum cell width. CSS length, e.g. \"16rem\". Columns auto-fit at runtime. */\n min?: string;\n /** Maximum cell width. CSS length. Defaults to `1fr` (stretch to fill). */\n max?: string;\n /** Gap between cells. Defaults to `0`. */\n gap?: string;\n /** Cap the height and scroll vertically when content overflows. */\n scroll?: boolean;\n /** Max height when `scroll`. CSS length. Defaults to `120px`. */\n maxHeight?: string;\n /** Scroll back to the top whenever this key changes (`scroll` only). */\n scrollResetKey?: string;\n /** Fixed column count. Overrides the intrinsic auto-fit when set; rows fill left-to-right. */\n cols?: number;\n /** Explicit `grid-template-columns` value. Overrides `cols` when set. */\n template?: string;\n /** Also receives the grid element (for callers that measure it). */\n innerRef?: (el: HTMLDivElement | null) => void;\n className?: string;\n children: ReactNode;\n}\n\n// Intrinsic grid — auto-fits as many columns as fit between `min` and `max`\n// wide, wrapping to new rows when there's no more horizontal room. Optionally\n// scrolls (capped height). Internal.\nexport function Grid({\n min = \"16rem\",\n max,\n gap,\n scroll = false,\n maxHeight,\n scrollResetKey,\n cols,\n template,\n innerRef,\n className,\n children,\n ...rest\n}: GridProps) {\n const gridRef = useRef<HTMLDivElement | null>(null);\n\n // A new key means a different content group is being shown (e.g. the next\n // suggestion's options after a selection) — start it from the top instead of\n // inheriting the previous group's scroll offset. Layout effect so the reset\n // lands in the same frame the new content paints.\n useLayoutEffect(() => {\n if (scrollResetKey === undefined) return;\n const el = gridRef.current;\n if (el) el.scrollTop = 0;\n }, [scrollResetKey]);\n\n const style: CSSProperties = { \"--aia-grid-min\": min } as CSSProperties;\n if (max) (style as Record<string, string>)[\"--aia-grid-max\"] = max;\n if (gap) (style as Record<string, string>)[\"--aia-grid-gap\"] = gap;\n if (maxHeight) (style as Record<string, string>)[\"--aia-grid-max-height\"] = maxHeight;\n // Explicit column count overrides the intrinsic auto-fit (inline wins). The\n // track string is built by the core so all three packages emit the same one.\n // An explicit template (the measured two-column split) wins over both.\n if (cols) style.gridTemplateColumns = optionsGridTemplateColumns(cols);\n if (template) style.gridTemplateColumns = template;\n\n return (\n <div\n ref={(el) => {\n gridRef.current = el;\n innerRef?.(el);\n }}\n className={className ? `aia-grid ${className}` : \"aia-grid\"}\n data-scroll={scroll || undefined}\n style={style}\n {...rest}\n >\n {children}\n </div>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-948e58da\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-948e58da\";\n s.textContent = `.aia-grid {\n display: grid;\n grid-template-columns: repeat(\n auto-fit,\n minmax(min(var(--aia-grid-min), 100%), var(--aia-grid-max, 1fr))\n );\n gap: var(--aia-grid-gap, 0);\n}\n\n/* Scrollable variant — capped height, rows packed from the top instead of\n stretching to fill the container.\n\n The scrollbar is hidden in every engine, as the product strip's and the\n input's already are: the list stays scrollable by wheel, trackpad, touch\n and keyboard, and the dropdown's \"more below\" arrow says there is more.\n Styling it instead (a thin, tinted bar) looked right only in Chrome, whose\n macOS overlay scrollbar ignores the ::-webkit-scrollbar rules — Safari drew\n a permanent bar over the list.\n\n overscroll-behavior: contain keeps a wheel or trackpad fling that runs past\n either end of the list from scrolling the page behind the dropdown. */\n.aia-grid[data-scroll] {\n grid-auto-rows: min-content;\n align-content: start;\n justify-content: start;\n /* The scroll box's reserved band (--aia-grid-scroll-* / --aia-grid-overlap-*)\n is deliberately NOT declared here — see the rule in\n appearance.css for why. */\n max-height: var(--aia-grid-max-height, 120px);\n overflow-y: auto;\n overscroll-behavior: contain;\n scrollbar-width: none;\n}\n.aia-grid[data-scroll]::-webkit-scrollbar {\n display: none;\n}\n\n/* Classic options box (optionsStyle: \"classic\"): the panel as it was\n before the floating box: it unfolds out of the input with a stroke, at\n full size. Generated from the values the floating-box changes replaced;\n keep in step across the vanilla, React and Angular copies. */\n:where([data-aia-options-style=\"classic\"]) .aia-grid[data-scroll] {\n max-height: var(--aia-grid-max-height, 120px);\n}\n`;\n document.head.appendChild(s);\n}\nexport {};","import {\n clearPanelMorphPressLook,\n formatOptionCount,\n highlightParts,\n isMultiSelectToggleTap,\n OPTION_ENTER_DELAY_VAR,\n optionImageSources,\n optionLabel,\n type SelectOptionOptions,\n sanitizeOptionIconSvg,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { type CSSProperties, type MouseEvent, useEffect, useMemo, useRef, useState } from \"react\";\nimport type { SuggestionOption } from \"../types\";\nimport styles from \"./SuggestionItem.module.css\";\n\ninterface SuggestionItemProps {\n option: SuggestionOption;\n isHighlighted: boolean;\n checked?: boolean;\n onSelect: (option: SuggestionOption, how?: SelectOptionOptions) => void;\n /** The pointer entered this row (only called for a row that can be picked). */\n onHighlight: (event: MouseEvent) => void;\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 onUnhighlight?: (event: MouseEvent) => void;\n id: string;\n loading?: boolean;\n /** Whether to draw the option's `icon_svg` before its text. Default: true. */\n showIcon?: boolean;\n /** Whether to draw the option's `image_url` as a thumbnail before its text, in place of the icon. Default: true. */\n showImage?: boolean;\n /** Whether to show the option's `item_count` at the row's trailing edge. Default: true. */\n showCount?: boolean;\n /** Fade this option's text toward its bottom edge (last visible row of a scrollable grid). */\n scrollHint?: boolean;\n /**\n * Start delay of this row's entrance animation (ms) — each row rises in a\n * beat after the one nearer the input. Fixed for the row's lifetime: it's\n * read once on mount, so a re-render can't restart a row mid-rise.\n */\n enterDelayMs?: number;\n}\n\n/** Longest a pick keeps its press look when no new question replaces it. */\nconst PRESS_HOLD_MS = 2000;\n\n/**\n * A second pick of the same row this soon is the same tap landing twice\n * (a fast double click): ignored, so it can't answer the next question with\n * this row's option. Matches the core's selection animation window, which\n * vanilla's grid gates on; a later tap (say after a failed request) works.\n */\nconst REPEAT_PICK_MS = 170;\n\nexport function SuggestionItem({\n option,\n isHighlighted,\n checked,\n onSelect,\n onHighlight,\n onUnhighlight,\n id,\n loading,\n showIcon = true,\n showImage = true,\n showCount = true,\n scrollHint,\n enterDelayMs = 0,\n}: SuggestionItemProps) {\n const [enterDelay] = useState(enterDelayMs);\n const [pressed, setPressed] = useState(false);\n // Server-provided picture, drawn as a square thumbnail before the text. It\n // stands in for the icon: a row never leads with two visuals.\n const imageSources = showImage ? optionImageSources(option.image_url) : [];\n const imageSrc = imageSources[0] ?? null;\n // A thumbnail that fails to load falls back to the original; when every\n // source has failed the picture hides itself and the tile's placeholder\n // fill stays, so the rows keep their alignment. Keyed on the srcs, so a row\n // reused for a different picture tries again.\n const [failedSrcs, setFailedSrcs] = useState<readonly string[]>([]);\n const shownSrc = imageSources.find((src) => !failedSrcs.includes(src)) ?? null;\n // The All row's tile shows the first options' pictures together\n // (appearance.css lays out `data-aia-collage`); any other row shows one.\n const collage = showImage\n ? (option.imageCollage ?? [])\n .map((url) => optionImageSources(url)[0])\n .filter((src): src is string => src !== undefined)\n : [];\n const [collageLoaded, setCollageLoaded] = useState(false);\n // The src that last finished loading: once it is the one shown, the tile's\n // placeholder fill steps aside.\n const [loadedSrc, setLoadedSrc] = useState<string | null>(null);\n // Server-provided icon, allowlisted before it touches the DOM. Memoised on\n // the markup: the same row re-renders on every highlight change.\n const iconHtml = useMemo(\n () =>\n !imageSrc && showIcon && option.icon_svg ? sanitizeOptionIconSvg(option.icon_svg) : null,\n [imageSrc, showIcon, option.icon_svg],\n );\n // The number alone; the unit word after it is the stylesheet's\n // (`--aia-option-count-unit`), appended by the count's ::after.\n const countLabel = showCount ? formatOptionCount(option.item_count) : null;\n const timerRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const rowRef = useRef<HTMLDivElement>(null);\n const lastPickRef = useRef(Number.NEGATIVE_INFINITY);\n\n useEffect(() => {\n return () => clearTimeout(timerRef.current);\n }, []);\n\n // `event` is the click that picked the row; a key press passes none. In a\n // multi_select question a click on the checkbox ticks it and waits for\n // Done, while a click on the rest of the row answers with it right away.\n const handleSelect = (event?: MouseEvent<HTMLElement>) => {\n if (loading || !option.is_tappable) return;\n const row = event?.currentTarget;\n const commit =\n checked !== undefined &&\n row !== undefined &&\n event !== undefined &&\n !isMultiSelectToggleTap(row, row.querySelector(\"[data-aia-checkbox]\"), event);\n const tick = checked !== undefined && !commit;\n if (!tick) {\n const now = performance.now();\n if (now - lastPickRef.current < REPEAT_PICK_MS) return;\n lastPickRef.current = now;\n }\n if (commit) onSelect(option, { commit: true });\n else onSelect(option);\n // A tick that waits for Done changes only the checkbox. A pick holds the\n // press look until the next question replaces this row (its key carries\n // the question), so the other rows stay dim while the answer loads; the\n // timer only releases a press nothing replaces.\n if (tick) return;\n setPressed(true);\n clearTimeout(timerRef.current);\n timerRef.current = setTimeout(() => {\n setPressed(false);\n clearPanelMorphPressLook(rowRef.current?.closest<HTMLElement>(\"[data-aia-dropdown]\"));\n }, PRESS_HOLD_MS);\n };\n\n const className = [\n styles.item,\n isHighlighted && !loading ? styles.highlighted : \"\",\n option.liveMatch && !loading ? styles.liveMatch : \"\",\n option.is_tappable ? styles.tappable : styles.nonTappable,\n pressed ? styles.pressed : \"\",\n scrollHint ? styles.scrollHint : \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div\n ref={rowRef}\n id={id}\n role=\"option\"\n data-aia-option=\"\"\n data-aia-loading={loading ? \"\" : undefined}\n data-aia-icon={iconHtml && option.icon ? option.icon : undefined}\n data-aia-image={imageSrc ? \"\" : undefined}\n data-aia-item-count={countLabel !== null ? option.item_count : undefined}\n aria-selected={checked ?? isHighlighted}\n className={className}\n style={{ [OPTION_ENTER_DELAY_VAR]: `${enterDelay}ms` } as CSSProperties}\n tabIndex={loading || !option.is_tappable ? -1 : 0}\n onClick={handleSelect}\n onKeyDown={(e) => {\n if (!loading && option.is_tappable && (e.key === \"Enter\" || e.key === \" \")) {\n e.preventDefault();\n handleSelect();\n }\n }}\n onMouseEnter={!loading && option.is_tappable ? onHighlight : undefined}\n onMouseLeave={onUnhighlight}\n >\n <span className={styles.content}>\n {/* Only a row that can be picked gets a box: a hint row (\"or type\n something else…\") is not an answer to tick. It still reports\n aria-selected=\"false\" like every unpicked row. */}\n {checked !== undefined && option.is_tappable && (\n <span\n className={styles.checkbox}\n aria-hidden=\"true\"\n data-aia-checkbox=\"\"\n data-checked={checked}\n />\n )}\n {imageSrc && collage.length > 1 && (\n <span\n className={`${styles.image} magicx-aia-option-image`}\n aria-hidden=\"true\"\n data-aia-collage={collage.length}\n data-aia-image-loaded={collageLoaded ? \"\" : undefined}\n >\n {collage.map((src) => (\n <img\n // The core drops repeated pictures, so each source is unique.\n key={src}\n src={src}\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n referrerPolicy=\"no-referrer\"\n draggable={false}\n onLoad={() => setCollageLoaded(true)}\n onError={(event) => {\n event.currentTarget.hidden = true;\n }}\n />\n ))}\n </span>\n )}\n {imageSrc && collage.length <= 1 && (\n // The tile keeps a placeholder fill until the picture loads, so a\n // slow or failed load leaves a neutral square rather than a gap. The\n // picture is decorative — the text is the option's accessible name.\n <span\n className={`${styles.image} magicx-aia-option-image`}\n aria-hidden=\"true\"\n data-aia-image-loaded={shownSrc !== null && loadedSrc === shownSrc ? \"\" : undefined}\n >\n <img\n src={shownSrc ?? imageSrc}\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n referrerPolicy=\"no-referrer\"\n draggable={false}\n hidden={shownSrc === null}\n onLoad={() => setLoadedSrc(shownSrc)}\n onError={() => {\n if (shownSrc !== null) setFailedSrcs((failed) => [...failed, shownSrc]);\n }}\n />\n </span>\n )}\n {iconHtml && (\n // The glyph is decorative — the text is the option's accessible\n // name — and the markup is the sanitizer's allowlisted output, never\n // the server's raw string.\n <span\n // The global class is the stable hook for consumer CSS across all\n // three packages; the module class carries this package's styles.\n className={`${styles.icon} magicx-aia-option-icon`}\n aria-hidden=\"true\"\n // biome-ignore lint/security/noDangerouslySetInnerHtml: sanitizeOptionIconSvg output only\n dangerouslySetInnerHTML={{ __html: iconHtml }}\n />\n )}\n <span className={styles.text}>\n {option.matchedText\n ? highlightParts(optionLabel(option), option.matchedText).map((part, index) =>\n part.bold ? (\n <strong\n // biome-ignore lint/suspicious/noArrayIndexKey: parts are positional and never reorder\n key={index}\n className={`${styles.match} magicx-aia-option-match`}\n data-aia-match-partial={part.partial ? \"\" : undefined}\n >\n {part.text}\n </strong>\n ) : (\n part.text\n ),\n )\n : optionLabel(option)}\n {option.parameterLabel && (\n // The space keeps the accessible name \"Pizza Flavor\" whatever the line's display is.\n <>\n {\" \"}\n <span className={`${styles.parameter} magicx-aia-option-parameter`}>\n {option.parameterLabel}\n </span>\n </>\n )}\n </span>\n {option.tag && <span className={styles.tag}>{option.tag}</span>}\n {countLabel !== null && (\n // Part of the row's accessible name, read after the option's text.\n <span className={`${styles.count} magicx-aia-option-count`}>{countLabel}</span>\n )}\n </span>\n </div>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-82820da7\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-82820da7\";\n s.textContent = `.aia-item-d4vpD {\n position: relative;\n /* Clip, not visible: the entrance rise below runs on the inner content,\n and a transformed box extends its scroll container's scrollable area.\n Unclipped, the rows rising 7px from below made the option grid overflow\n for the length of the entrance whenever nothing sat under the grid to\n absorb it (product strip, optionsPosition=\"above\"), so a scrollbar\n flashed in and out and the columns shifted sideways by its width. The\n cell's own children never paint outside it (the streak layer clips\n itself; press and highlight stay inside the box), so nothing is lost.\n \\`hidden\\` first for engines without \\`clip\\`. */\n overflow: hidden;\n overflow: clip;\n display: flex;\n /* Top-align so single-line and multi-line options in the same row share\n the same baseline at the top edge of the cell. */\n align-items: flex-start;\n font-family: inherit;\n font-size: var(--aia-option-font-size, 16px);\n font-weight: 450;\n line-height: 21px;\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n white-space: normal;\n word-break: break-word;\n /* 8px radius on the highlighted fill (--aia-option-bg), matching the Figma\n SuggestionItem selection. The 8px/10px inset is the item's own padding. */\n border-radius: 8px;\n padding: var(--aia-option-padding-block, 8px) 10px;\n /* No entrance animation on the row itself — deliberately. The row is the\n tappable element, and iOS Safari drops a tap on a scripted-clickable\n element (a div with a click handler; a native button is exempt) whose\n own opacity is mid-animation — its tap-or-hover pass counts the change\n as content moving under the finger, fires only the hover events (the\n row highlights) and never the click. Both halves of the entrance run\n on the inner content instead (next rule). */\n}\n\n@keyframes aia-fadeIn-I8u35 {\n from {\n opacity: 0;\n }\n}\n\n@keyframes aia-riseIn-etXZT {\n from {\n transform: translateY(7px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-item-d4vpD,\n .aia-content-T-Qba {\n animation-duration: 0s;\n animation-delay: 0s;\n transition-duration: 0s;\n }\n}\n\n.aia-content-T-Qba {\n position: relative;\n z-index: 2;\n /* The entrance: fade in while rising into place, each row a beat after the\n one before it (--aia-option-enter-delay is set inline per row from the\n core's optionEnterDelayMs). Both run here, on the inner content, never on\n the row: the rise because a transformed cell extends the grid's\n scrollable area (see the overflow note on the row), the fade because iOS\n Safari drops a tap on a tappable element whose own opacity is animating\n (see the row's own comment). The durations and distance mirror\n OPTION_ENTER_* in the core's derive/optionsEntrance.ts — change both together. */\n animation:\n aia-riseIn-etXZT 340ms cubic-bezier(0.2, 0.8, 0.2, 1) both,\n aia-fadeIn-I8u35 340ms cubic-bezier(0.2, 0.8, 0.2, 1) both;\n animation-delay: var(--aia-option-enter-delay, 0ms);\n}\n\n.aia-tappable-70KcX {\n cursor: pointer;\n}\n\n.aia-tappable-70KcX:hover {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n}\n\n.aia-nonTappable-xSZM- {\n cursor: default;\n}\n\n.aia-highlighted-Hb0SU,\n.aia-liveMatch--eYfs {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n background: var(--aia-option-bg, transparent);\n font-weight: 500;\n}\n\n/* Live match: while a word is typed, the row it is spelling out lights up\n (the rule above) and every other row steps back, so the choice reads as\n locked in before the word is finished. The core marks the row\n (\\`liveMatch\\`). The step back is a filter on the inner content: on iOS a tap\n on a row whose own opacity is changing is dropped (lessons.md), and the\n content's entrance already owns its opacity. */\n.aia-item-d4vpD {\n transition: background-color 180ms ease;\n}\n\n.aia-content-T-Qba {\n transition: filter 180ms ease;\n}\n\n[role=\"listbox\"]:has(.aia-liveMatch--eYfs) .aia-item-d4vpD:not(.aia-liveMatch--eYfs):not(.aia-highlighted-Hb0SU) .aia-content-T-Qba {\n filter: opacity(0.42);\n}\n\n.aia-tag-e3Fwe {\n font-size: 11px;\n margin-left: 6px;\n opacity: 0.5;\n}\n\n/* Press feedback: the picked option fills with the option background (the\n row's own background transition) while every other option steps back in\n opacity. No scale: a row that shrinks and springs back reads as a jolt,\n and the next question then arrives on top of it. The press stays on until\n the options leave, so the picked row never flashes back to normal first. */\n.aia-pressed-98o-r {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n background: var(--aia-option-bg, transparent);\n font-weight: 500;\n}\n\n[role=\"listbox\"]:has(.aia-pressed-98o-r) .aia-item-d4vpD:not(.aia-pressed-98o-r) {\n opacity: 0.35;\n transition:\n background-color 180ms ease,\n opacity 120ms ease;\n}\n\n/* Scroll hint — the last visible row of a scrollable web grid fades toward its\n bottom edge, signalling more options below (the desktop footer is opaque, so\n rows no longer dissolve through it). A mask instead of a color so any themed\n option color fades the same way. */\n.aia-scrollHint-xKXPt .aia-content-T-Qba {\n -webkit-mask-image: linear-gradient(to bottom, rgb(0 0 0), rgb(0 0 0 / 0.6));\n mask-image: linear-gradient(to bottom, rgb(0 0 0), rgb(0 0 0 / 0.6));\n}\n\n/* A panel fitted to the viewport (data-aia-fit, see appearance.css) shows\n every row, so the row the hint picked is not the last one on screen. */\n[data-aia-fit] .aia-scrollHint-xKXPt .aia-content-T-Qba {\n -webkit-mask-image: none;\n mask-image: none;\n}\n\n/* Loading — a row kept from the last response fades out while the next one\n is fetched, text and all; nothing else changes, so the box does not move. */\n.aia-item-d4vpD[data-aia-loading] {\n cursor: default;\n pointer-events: none;\n animation: aia-loadingOut-hI-qI 160ms ease-in forwards;\n}\n\n.aia-item-d4vpD[data-aia-loading] .aia-content-T-Qba {\n animation: none;\n}\n\n/* Ends a hair above zero, like magicx-aia-fadeIn starts: a pill kept by key\n is re-enabled in place, and iOS cancels a tap on an element leaving 0. */\n@keyframes aia-loadingOut-hI-qI {\n to {\n opacity: 0.01;\n }\n}\n\n/* The parameter an option is a value of, under its text (\"Flavor\", \"Subcategory\"):\n muted and smaller, so options that read alike are told apart. Block inside the\n text box, so a hanging indent never moves it. */\n.aia-parameter-Dt2zF {\n display: block;\n font-size: var(--aia-option-parameter-font-size, 12px);\n font-weight: 400;\n line-height: 16px;\n text-indent: 0;\n color: var(--aia-option-parameter-color, inherit);\n opacity: var(--aia-option-parameter-opacity, 0.6);\n}\n\n/* The part of a completion the typed text matches, in the Smart Suggestion accent. */\n.aia-match-pp-9v {\n color: var(--aia-smart-suggestion-accent, #b84549);\n font-weight: 600;\n}\n\n/* A half-built syllable at the end of the match (an IME has typed 녀 of 년):\n the same accent, drawn fainter, since part of one glyph can not be colored. */\n.aia-match-pp-9v:where([data-aia-match-partial]) {\n opacity: var(--aia-option-match-partial-opacity, 0.45);\n}\n\n/* Server-provided option icon (\\`icon_svg\\` on the option): a box exactly one\n text line tall, top-aligned, so it sits centred on the first line of a\n wrapped option and never grows the line box. The glyph draws in\n currentColor, so it follows the option's text color through hover and\n highlight, and is sized in em so --aia-option-font-size scales it. */\n.aia-icon-Qw938 {\n display: inline-flex;\n align-items: center;\n height: 21px; /* = the option's line-height */\n margin-right: 8px;\n vertical-align: top;\n /* Own compositing layer. The row (entrance) and the chip (promotion fade)\n animate on a layer WebKit drops when the animation ends; content drawn at\n a fractional x then re-rasterizes on a different sub-pixel, which crisp\n SVG strokes show as a nudge to the right. A permanent layer keeps the\n glyph's rasterization stable across that hand-off. */\n will-change: transform;\n}\n\n.aia-icon-Qw938 svg {\n display: block;\n width: 1em;\n height: 1em;\n}\n\n/* With an icon, the content box hangs its continuation lines: a left pad the\n width of the icon plus its gap, and a matching negative first-line indent\n that pulls the icon back into that pad. Wrapped lines then start under the\n first line's text rather than under the icon. \\`.content\\` is a flex item\n (blockified), so text-indent applies to it directly. Skeleton rows keep\n it too: their icon is hidden but still occupies its column. */\n.aia-content-T-Qba:not(:has(.aia-count-IpYbQ)):has(.aia-icon-Qw938) {\n padding-left: calc(1em + 8px);\n text-indent: calc(-1em - 8px);\n}\n\n/* --- Option pictures and counts ---\n A row that carries a thumbnail (\\`image_url\\`) or a count (\\`item_count\\`) lays\n its content out as a flex row instead of inline flow: the text becomes its\n own box, so wrapped lines start under the first line without the hanging\n indent, and the count can sit at the trailing edge. It also fills the row —\n the content is a flex item of the row that would otherwise shrink to its\n text, leaving the count's auto margin nothing to push against. The inline\n flow is kept for every other row, so nothing existing moves. */\n.aia-content-T-Qba:has(.aia-image-YZAbO),\n.aia-content-T-Qba:has(.aia-count-IpYbQ) {\n display: flex;\n flex: 1 1 auto;\n align-items: flex-start;\n min-width: 0;\n}\n\n.aia-content-T-Qba:has(.aia-image-YZAbO) .aia-text-yqoh9,\n.aia-content-T-Qba:has(.aia-count-IpYbQ) .aia-text-yqoh9 {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n/* The picture: a square tile, centred on the text beside it (a one-line\n option reads as the reference row; a wrapped one keeps the tile on its\n vertical middle). Sized and rounded by token so a consumer can shrink it\n or square it off. The fill is the placeholder: it shows across the whole\n tile until the picture paints (a picture's size isn't known before it\n loads) and stays if it never does. */\n.aia-content-T-Qba:has(.aia-image-YZAbO) {\n align-items: center;\n gap: var(--aia-option-image-gap, 12px);\n}\n\n.aia-image-YZAbO {\n flex: 0 0 auto;\n display: block;\n width: var(--aia-option-image-size, 40px);\n height: var(--aia-option-image-size, 40px);\n border-radius: var(--aia-option-image-radius, 12px);\n overflow: hidden;\n background: var(--aia-option-image-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.083)));\n}\n\n/* Once the picture has loaded the placeholder steps aside: a contained\n picture that doesn't fill the tile sits on the dropdown's own background\n rather than on a grey box. The renderer sets the attribute from the\n picture's \\`load\\` event. */\n.aia-image-YZAbO[data-aia-image-loaded] {\n background: transparent;\n}\n\n/* \\`contain\\`, not \\`cover\\`: option pictures come in any aspect ratio, and a\n square crop cuts the top and bottom off a tall one (a pint bottle). The\n picture fills the tile's height and takes only the width its ratio needs,\n centred, so a tall picture's box is the picture itself and its own corner\n radius rounds it. A wide one is clamped to the tile's width and contained\n inside it; a square one fills the tile, whose larger radius clips it. */\n.aia-image-YZAbO img {\n display: block;\n width: auto;\n max-width: 100%;\n height: 100%;\n margin: 0 auto;\n border-radius: var(--aia-option-picture-radius, 6px);\n object-fit: contain;\n}\n\n/* A picture that failed to load hides itself with the \\`hidden\\` attribute.\n The tile's \\`display: block\\` above would win over the browser's own\n \\`[hidden] { display: none }\\` (an author rule beats a user-agent rule at\n any specificity), so the attribute is honoured here explicitly. */\n.aia-image-YZAbO img[hidden] {\n display: none;\n}\n\n/* The count: a muted, tabular label at the trailing edge, on the first\n line's baseline. Never wraps — a long option wraps its text instead. */\n.aia-count-IpYbQ {\n flex: 0 0 auto;\n margin-left: auto;\n padding-left: 12px;\n font-size: var(--aia-option-count-font-size, 12px);\n font-weight: 400;\n line-height: 21px; /* = the option's line-height */\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n color: var(--aia-option-count-color, inherit);\n opacity: var(--aia-option-count-opacity, 0.6);\n}\n\n/* The unit word after the number is a token, so a consumer names what is\n being counted (\"sneakers\", \"towels\") or blanks it (an empty string) without\n a render option. A count of one reads the singular token, which falls back\n to the plural one, so a consumer who sets only \\`--aia-option-count-unit\\`\n gets that word for every count. Generated content joins the row's\n accessible name after the number, the way the word did as text. */\n.aia-count-IpYbQ::after {\n content: \" \" var(--aia-option-count-unit, \"items\");\n}\n\n.aia-item-d4vpD[data-aia-item-count=\"1\"] .aia-count-IpYbQ::after {\n content: \" \" var(--aia-option-count-unit-one, var(--aia-option-count-unit, \"item\"));\n}\n\n/* A grid of rows with a parameter line is taller per row: the row's text\n line and padding plus the parameter line, so the visible-rows cap\n (\\`--aia-grid-max-height\\`) does not cut the last row. Before the picture rule,\n which wins when a group has both. */\n[data-aia-group]:has(.aia-parameter-Dt2zF) {\n --aia-option-row-height: calc(37px + 2 * var(--aia-option-padding-block, 8px));\n}\n\n/* A grid of picture rows is taller per row: the visible-rows cap\n (\\`--aia-grid-max-height\\`, computed from \\`--aia-option-row-height\\` by\n planOptionsGrid) follows the tile's height plus the row's padding, so the\n same number of rows shows before the list scrolls. */\n[data-aia-group]:has(.aia-image-YZAbO) {\n --aia-option-row-height: calc(\n var(--aia-option-image-size, 40px) +\n 2 *\n var(--aia-option-padding-block, 8px)\n );\n}\n\n/* A row without a picture, in a grid where other rows have one, lines up\n with them: it becomes the same centred flex row, and its icon sits centred\n in a tile-sized box, so an icon row's text starts where a picture row's\n does. A row with neither a picture nor an icon is not indented to match:\n its text sits flush left, as it would in a grid with no pictures. Grids\n with no pictures keep the inline icon and hanging indent above. The text\n is left to size itself. */\n[data-aia-group]:has(.aia-image-YZAbO) .aia-content-T-Qba:not(:has(.aia-image-YZAbO)) {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n gap: var(--aia-option-image-gap, 12px);\n min-width: 0;\n min-height: var(--aia-option-image-size, 40px);\n padding-left: 0;\n text-indent: 0;\n}\n\n[data-aia-group]:has(.aia-image-YZAbO) .aia-content-T-Qba:not(:has(.aia-image-YZAbO)) .aia-icon-Qw938 {\n flex: 0 0 auto;\n justify-content: center;\n width: var(--aia-option-image-size, 40px);\n height: var(--aia-option-image-size, 40px);\n margin-right: 0;\n}\n\n/* The glyph scales up with its box: at one text line (1em) it reads as a speck\n beside the picture tiles in the same column. 1.5em (24px at the default\n option font size) is 60% of the default tile, about where a picture's\n subject sits in its frame. Still em-based, so --aia-option-font-size scales\n it; --aia-option-tile-icon-size overrides it. */\n[data-aia-group]:has(.aia-image-YZAbO) .aia-content-T-Qba:not(:has(.aia-image-YZAbO)) .aia-icon-Qw938 svg {\n width: var(--aia-option-tile-icon-size, 1.5em);\n height: var(--aia-option-tile-icon-size, 1.5em);\n}\n\n/* --- Loading fades ---\n Nothing extra plays while the dropdown carries data-aia-skeleton-exiting:\n the loading rows have already faded out, and a second animation would\n restart the fade from full strength. */\n\n.aia-content-T-Qba:has(.aia-checkbox-KGRhg) {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n\n/* A checkbox row is a flex row, so its icon is a flex item beside the text,\n not an inline box hung in a left pad. Undo the hanging indent the icon rule\n sets: the pad would push the whole row right, and the negative indent,\n inherited by the text box, would pull the text back over the icon. The\n row's gap replaces the icon's own margin. */\n.aia-content-T-Qba:has(.aia-checkbox-KGRhg):has(.aia-icon-Qw938) {\n padding-left: 0;\n text-indent: 0;\n}\n\n.aia-content-T-Qba:has(.aia-checkbox-KGRhg) .aia-icon-Qw938 {\n margin-right: 0;\n}\n\n.aia-checkbox-KGRhg {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n /* An indent inherited from the row (an icon row hangs its text with one)\n would slide the mark out of the box. */\n text-indent: 0;\n flex: 0 0 18px;\n width: 18px;\n height: 18px;\n border: 1px solid var(--aia-border);\n border-radius: 6px;\n background: var(--aia-surface);\n color: transparent;\n line-height: 1;\n /* A tick animates the box alone: the row stays put (no press, no dimming),\n since a multi-select tap keeps the list open for the next tick. */\n transition:\n background-color 140ms ease,\n border-color 140ms ease,\n color 140ms ease;\n}\n\n/* The tick is drawn, not typed: a rounded stroke with a short left leg and a\n long right one, shaped like Apple's SF Symbols \"checkmark\". The text \"✓\"\n it replaces changes with the font and reads thin and cheap. It is painted\n in the box's text colour, so it fades in with the fill. */\n.aia-checkbox-KGRhg::after {\n content: \"\";\n width: 14px;\n height: 14px;\n background: currentColor;\n -webkit-mask:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.2 12.6l4.6 4.6 9-10.6' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\")\n center / contain no-repeat;\n mask:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.2 12.6l4.6 4.6 9-10.6' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\")\n center / contain no-repeat;\n}\n\n/* Forced colours replace backgrounds with Canvas, which would hide a tick\n painted as a background; draw it in the forced text colour instead. */\n@media (forced-colors: active) {\n .aia-checkbox-KGRhg[data-checked=\"true\"]::after {\n forced-color-adjust: none;\n background: CanvasText;\n }\n}\n\n.aia-checkbox-KGRhg[data-checked=\"true\"] {\n background: var(--aia-confirm-bg, #262626);\n border-color: var(--aia-confirm-bg, #262626);\n color: var(--aia-confirm-color, #ffffff);\n animation: aia-checkPop-CCWRW 160ms ease-out;\n}\n\n@keyframes aia-checkPop-CCWRW {\n 0% {\n transform: scale(0.82);\n }\n 100% {\n transform: scale(1);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-checkbox-KGRhg[data-checked=\"true\"] {\n animation: none;\n }\n}\n\n.aia-item-d4vpD:has(.aia-checkbox-KGRhg[data-checked=\"true\"]) {\n background: var(--aia-option-bg, transparent);\n}\n\n/* Classic options box (optionsStyle: \"classic\"): the panel as it was\n before the floating box: it unfolds out of the input with a stroke, at\n full size. Generated from the values the floating-box changes replaced;\n keep in step across the vanilla, React and Angular copies. */\n:where([data-aia-options-style=\"classic\"]) .aia-item-d4vpD {\n font-size: var(--aia-option-font-size, 16px);\n line-height: 21px;\n border-radius: 8px;\n padding: 8px 10px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-tag-e3Fwe {\n font-size: 11px;\n margin-left: 6px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-parameter-Dt2zF {\n font-size: var(--aia-option-parameter-font-size, 12px);\n line-height: 16px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-icon-Qw938 {\n height: 21px;\n margin-right: 8px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-content-T-Qba:not(:has(.aia-count-IpYbQ)):has(.aia-icon-Qw938) {\n padding-left: calc(1em + 8px);\n text-indent: calc(-1em - 8px);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-content-T-Qba:has(.aia-image-YZAbO) {\n gap: var(--aia-option-image-gap, 12px);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-image-YZAbO {\n width: var(--aia-option-image-size, 40px);\n height: var(--aia-option-image-size, 40px);\n border-radius: var(--aia-option-image-radius, 12px);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-image-YZAbO img {\n border-radius: var(--aia-option-picture-radius, 6px);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-count-IpYbQ {\n padding-left: 12px;\n font-size: var(--aia-option-count-font-size, 12px);\n line-height: 21px;\n}\n:where([data-aia-options-style=\"classic\"]) [data-aia-group]:has(.aia-parameter-Dt2zF) {\n --aia-option-row-height: 53px;\n}\n:where([data-aia-options-style=\"classic\"]) [data-aia-group]:has(.aia-image-YZAbO) {\n --aia-option-row-height: calc(var(--aia-option-image-size, 40px) + 16px);\n}\n:where([data-aia-options-style=\"classic\"])\n [data-aia-group]:has(.aia-image-YZAbO)\n .aia-content-T-Qba:not(:has(.aia-image-YZAbO)) {\n gap: var(--aia-option-image-gap, 12px);\n min-height: var(--aia-option-image-size, 40px);\n}\n:where([data-aia-options-style=\"classic\"])\n [data-aia-group]:has(.aia-image-YZAbO)\n .aia-content-T-Qba:not(:has(.aia-image-YZAbO))\n .aia-icon-Qw938 {\n width: var(--aia-option-image-size, 40px);\n height: var(--aia-option-image-size, 40px);\n}\n:where([data-aia-options-style=\"classic\"]) .aia-content-T-Qba:has(.aia-checkbox-KGRhg) {\n gap: 10px;\n}\n:where([data-aia-options-style=\"classic\"]) .aia-checkbox-KGRhg {\n flex: 0 0 18px;\n width: 18px;\n height: 18px;\n border-radius: 6px;\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"item\":\"aia-item-d4vpD\",\"content\":\"aia-content-T-Qba\",\"riseIn\":\"aia-riseIn-etXZT\",\"fadeIn\":\"aia-fadeIn-I8u35\",\"tappable\":\"aia-tappable-70KcX\",\"nonTappable\":\"aia-nonTappable-xSZM-\",\"highlighted\":\"aia-highlighted-Hb0SU\",\"liveMatch\":\"aia-liveMatch--eYfs\",\"tag\":\"aia-tag-e3Fwe\",\"pressed\":\"aia-pressed-98o-r\",\"scrollHint\":\"aia-scrollHint-xKXPt\",\"loadingOut\":\"aia-loadingOut-hI-qI\",\"parameter\":\"aia-parameter-Dt2zF\",\"match\":\"aia-match-pp-9v\",\"icon\":\"aia-icon-Qw938\",\"count\":\"aia-count-IpYbQ\",\"image\":\"aia-image-YZAbO\",\"text\":\"aia-text-yqoh9\",\"checkbox\":\"aia-checkbox-KGRhg\",\"checkPop\":\"aia-checkPop-CCWRW\"};","import {\n formatTime,\n TIME_WHEEL_COLUMNS,\n TIME_WHEEL_ROW_HEIGHT,\n type TimeView,\n type TimeWheelColumn,\n timeWheelIndex,\n timeWheelIndexFromScroll,\n timeWheelRows,\n withTimeWheelIndex,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { Fragment, useEffect, useLayoutEffect, useRef } from \"react\";\nimport styles from \"./TimeWheel.module.css\";\n\n/** How long a column's scroll must be still before the row it rests on counts. */\nconst SCROLL_SETTLE_MS = 120;\n\nexport interface TimeWheelProps {\n /** The core's `timeView`: the time on the wheels' top rows. */\n view: TimeView;\n /** Accessible name for the wheel (\"Time\"). */\n label: string;\n /** Text of the button that answers with the time (\"Done\"). */\n doneLabel: string;\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 interactive?: boolean;\n /** The user turned a wheel; `minutes` is the whole new time. Commits nothing. */\n onTimeChange: (minutes: number) => void;\n /** Done — answer the pill with the time on the wheels. */\n onTimeCommit: () => void;\n}\n\n/**\n * The dropdown's time body, rendered in place of the options grid when the\n * active parameter is a time. React analogue of vanilla's `renderTimeWheel`:\n * three wheels — hour, minutes in fives, AM/PM — whose top rows read as the\n * time, and a Done button.\n *\n * The wheels hold no time of their own. `view.minutes` is the time; turning a\n * wheel reports the new time and the next render scrolls every wheel to it.\n * That is what lets the keyboard (ArrowUp/ArrowDown in the input, handled by\n * the core) and the pointer move the same time.\n */\nexport function TimeWheel({\n view,\n label,\n doneLabel,\n interactive = true,\n onTimeChange,\n onTimeCommit,\n}: TimeWheelProps) {\n return (\n // biome-ignore lint/a11y/useSemanticElements: a <fieldset> groups form controls; this groups a pointer widget the input drives, and would bring a fieldset's default chrome into the three copies of this stylesheet.\n <div\n className={styles.timeWheel}\n data-aia-time-wheel=\"\"\n role=\"group\"\n aria-label={label}\n onMouseDown={(e) => e.preventDefault()}\n >\n {/* The wheels are a pointer surface; keyboard users move the time from\n the input. So the columns are hidden from AT and the time is\n announced from here instead. */}\n <span className={styles.value} data-aia-time-value=\"\" aria-live=\"polite\">\n {formatTime(view.minutes)}\n </span>\n <div className={styles.columns} aria-hidden=\"true\">\n <div className={styles.band} />\n {TIME_WHEEL_COLUMNS.map((column) => (\n <Fragment key={column}>\n {column === \"minute\" && <span className={styles.separator}>:</span>}\n <WheelColumn\n column={column}\n minutes={view.minutes}\n interactive={interactive}\n onTimeChange={onTimeChange}\n />\n </Fragment>\n ))}\n </div>\n <button\n type=\"button\"\n // Out of the tab order, as the calendar's buttons are: Tab is bound to\n // the dropdown, and Enter in the input already commits a moved wheel.\n tabIndex={-1}\n className={styles.done}\n data-aia-time-done=\"\"\n onClick={() => {\n if (interactive) onTimeCommit();\n }}\n >\n {doneLabel}\n </button>\n </div>\n );\n}\n\ninterface WheelColumnProps {\n column: TimeWheelColumn;\n minutes: number;\n interactive: boolean;\n onTimeChange: (minutes: number) => void;\n}\n\nfunction WheelColumn({ column, minutes, interactive, onTimeChange }: WheelColumnProps) {\n const ref = useRef<HTMLDivElement>(null);\n // The offset this component last scrolled to itself, so the scroll event\n // that echoes it isn't mistaken for the user turning the wheel.\n const syncedTop = useRef<number | null>(null);\n // The pending read of a scroll the user is still making.\n const settle = useRef<ReturnType<typeof setTimeout> | null>(null);\n // Read at settle time, so a scroll that rests after a re-render answers\n // against the current time, not the one it started on.\n const latest = useRef({ minutes, interactive, onTimeChange });\n latest.current = { minutes, interactive, onTimeChange };\n const index = timeWheelIndex(column, minutes);\n\n // Scroll to the row the time puts on top — but never yank a wheel the user\n // is still turning: their scroll settles into a time of its own.\n useLayoutEffect(() => {\n const el = ref.current;\n if (!el || settle.current) return;\n const top = index * TIME_WHEEL_ROW_HEIGHT;\n if (Math.abs(el.scrollTop - top) < 1) return;\n syncedTop.current = top;\n el.scrollTop = top;\n }, [index]);\n\n useEffect(\n () => () => {\n if (settle.current) clearTimeout(settle.current);\n },\n [],\n );\n\n const settleNow = () => {\n settle.current = null;\n const el = ref.current;\n const current = latest.current;\n if (!el || !current.interactive) return;\n const next = timeWheelIndexFromScroll(column, el.scrollTop);\n if (next === timeWheelIndex(column, current.minutes)) return;\n current.onTimeChange(withTimeWheelIndex(column, current.minutes, next));\n };\n\n const onScroll = () => {\n const el = ref.current;\n if (!el) return;\n if (syncedTop.current != null && Math.abs(el.scrollTop - syncedTop.current) < 1) {\n syncedTop.current = null;\n return;\n }\n syncedTop.current = null;\n if (settle.current) clearTimeout(settle.current);\n settle.current = setTimeout(settleNow, SCROLL_SETTLE_MS);\n };\n\n return (\n <div ref={ref} className={styles.column} data-aia-time-column={column} onScroll={onScroll}>\n {timeWheelRows(column).map((row, i) => (\n // biome-ignore lint/a11y/useKeyWithClickEvents: the wheels are aria-hidden; the keyboard moves the time from the input.\n // biome-ignore lint/a11y/noStaticElementInteractions: as above.\n <div\n key={row.label}\n className={i === index ? `${styles.row} ${styles.selected}` : styles.row}\n data-aia-time-row=\"\"\n data-aia-index={i}\n onClick={() => {\n if (latest.current.interactive) {\n onTimeChange(withTimeWheelIndex(column, latest.current.minutes, i));\n }\n }}\n >\n {row.label}\n </div>\n ))}\n </div>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-52a922cb\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-52a922cb\";\n s.textContent = `/* --- Time wheel (replaces the options grid for time suggestions) ---\n\n One of three hand-maintained copies (vanilla styles.css, this file, Angular's\n time-wheel.component.css). Only the class-naming layer differs — the\n declarations must match, and \\`timeWheelParity.test.ts\\` fails the build if\n they drift. See CLAUDE.md's duplicated-stylesheet rule.\n\n Colours go through the same --aia-option-* chain as the option rows and the\n calendar (see DateGrid.module.css for why). The 30px row height is\n load-bearing: the component turns a column's scroll offset into a row as\n \\`scrollTop / 30\\` (TIME_WHEEL_ROW_HEIGHT in the core), so it is not a token. */\n.aia-timeWheel-KdR4A {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n padding: 6px 6px 4px;\n}\n\n/* Announces the time to AT (the wheels themselves are aria-hidden). */\n.aia-value--wqvm {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n\n.aia-columns-TaD-f {\n position: relative;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n gap: 2px;\n width: 100%;\n}\n\n/* The one soft band the chosen time sits in, behind the wheels' top rows. */\n.aia-band-pVy-f {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n height: 30px;\n border-radius: 8px;\n background: var(--aia-time-band-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.08));\n pointer-events: none;\n}\n\n.aia-column-lwtdd {\n position: relative;\n flex: 0 0 auto;\n width: 44px;\n /* Three rows show: the chosen one and the two after it. The bottom padding\n lets the last row scroll up to the top; border-box keeps it inside those\n 90px, where it only adds scroll range, rather than adding 60px of visible\n column below them. */\n height: 90px;\n padding-bottom: 60px;\n box-sizing: border-box;\n overflow-y: auto;\n overscroll-behavior: contain;\n scroll-snap-type: y mandatory;\n scrollbar-width: none;\n -webkit-mask-image: linear-gradient(to bottom, #000 34%, transparent 100%);\n mask-image: linear-gradient(to bottom, #000 34%, transparent 100%);\n}\n\n.aia-column-lwtdd::-webkit-scrollbar {\n display: none;\n}\n\n.aia-row-A3pAx {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 30px;\n scroll-snap-align: start;\n font-family: inherit;\n font-size: var(--aia-time-font-size, 15px);\n font-variant-numeric: tabular-nums;\n font-weight: 450;\n line-height: 20px;\n color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));\n cursor: pointer;\n}\n\n.aia-selected-xgOWY {\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n font-weight: 500;\n}\n\n.aia-separator-kX9WO {\n display: flex;\n align-items: center;\n height: 30px;\n font-size: var(--aia-time-font-size, 15px);\n font-weight: 500;\n line-height: 20px;\n color: var(--aia-option-color-selected, var(--aia-color-text-default, #fff));\n}\n\n.aia-done-llNY5 {\n align-self: stretch;\n height: 44px;\n padding: 0 12px;\n border: none;\n border-radius: 12px;\n background: var(--aia-time-done-bg, var(--aia-done-bg, #e4e8f0));\n font-family: inherit;\n font-size: 15px;\n font-weight: 600;\n line-height: 20px;\n color: var(--aia-time-done-color, var(--aia-done-color, #2a3150));\n cursor: pointer;\n transition: background-color 150ms ease-out;\n}\n\n.aia-done-llNY5:hover {\n background: var(--aia-time-done-bg-hover, var(--aia-done-bg-hover, #d8dde8));\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"timeWheel\":\"aia-timeWheel-KdR4A\",\"value\":\"aia-value--wqvm\",\"columns\":\"aia-columns-TaD-f\",\"band\":\"aia-band-pVy-f\",\"column\":\"aia-column-lwtdd\",\"row\":\"aia-row-A3pAx\",\"selected\":\"aia-selected-xgOWY\",\"separator\":\"aia-separator-kX9WO\",\"done\":\"aia-done-llNY5\"};","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-8414cd5f\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-8414cd5f\";\n s.textContent = `.aia-stack {\n display: flex;\n flex-direction: column;\n gap: var(--aia-stack-space, 0.5rem);\n}\n.aia-stack[data-align=\"start\"] {\n align-items: start;\n}\n.aia-stack[data-align=\"center\"] {\n align-items: center;\n}\n.aia-stack[data-align=\"end\"] {\n align-items: end;\n}\n/* data-align=\"stretch\" is the flex default — no rule needed. */\n`;\n document.head.appendChild(s);\n}\nexport {};","import type { ComponentPropsWithoutRef, CSSProperties, ReactNode } from \"react\";\nimport \"./Stack.css\";\n\ninterface StackProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"className\"> {\n /** Gap between children. Any CSS length. Defaults to `0.5rem`. */\n space?: string;\n /** Cross-axis alignment of children. Defaults to `stretch` (full width). */\n align?: \"start\" | \"center\" | \"end\" | \"stretch\";\n className?: string;\n children: ReactNode;\n}\n\n// Vertical layout primitive — children stack top-to-bottom with `space` gap. Internal.\nexport function Stack({ space, align = \"stretch\", className, children, ...rest }: StackProps) {\n const style = space ? ({ \"--aia-stack-space\": space } as CSSProperties) : undefined;\n return (\n <div\n className={className ? `aia-stack ${className}` : \"aia-stack\"}\n data-align={align}\n style={style}\n {...rest}\n >\n {children}\n </div>\n );\n}\n","import { uiStringsFor } from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport styles from \"./SubmitButton.module.css\";\n\ninterface SubmitButtonProps {\n /** Disabled when there's nothing to submit. */\n disabled?: boolean;\n /** The request is complete: the button lights up to invite the submit. */\n ready?: boolean;\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 busy?: boolean;\n onClick: () => void;\n /** The accessible name. Default: the English word. */\n label?: string;\n}\n\n/**\n * The default circular submit button (up-arrow). Tier 1 renders this when the\n * consumer doesn't supply a custom `submitButton`. Themed via `--aia-submit-*`.\n */\nexport function SubmitButton({\n disabled,\n ready,\n busy = false,\n onClick,\n label = uiStringsFor().submit,\n}: SubmitButtonProps) {\n return (\n <button\n type=\"button\"\n data-aia-submit=\"\"\n className={styles.submitButton}\n disabled={disabled}\n data-aia-ready={ready ? \"\" : undefined}\n data-aia-submit-state={busy ? \"busy\" : undefined}\n aria-busy={busy ? true : undefined}\n onClick={(e) => {\n e.stopPropagation();\n onClick();\n }}\n aria-label={label}\n >\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" role=\"img\" aria-label={label}>\n <path\n d=\"M9 14V4M9 4L4 9M9 4L14 9\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n );\n}\n","if (typeof document !== \"undefined\" && !document.getElementById(\"ac-style-fdee06e6\")) {\n const s = document.createElement(\"style\");\n s.id = \"ac-style-fdee06e6\";\n s.textContent = `.aia-submitButton-otz7H {\n flex-shrink: 0;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n border: none;\n background: var(--aia-submit-bg, var(--aia-color-text-default, #fff));\n color: var(--aia-submit-color, var(--aia-color-bg-default, #000));\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n transition:\n opacity 0.2s ease,\n background-color 250ms ease,\n transform 250ms ease;\n}\n\n/* Size and paint by class as well as by attribute: a presentation attribute\n has no specificity, so a page's \\`svg { width: 100%; fill: currentColor }\\`\n would otherwise resize the arrow and fill it solid — the consumer-isolation\n reset leaves inline SVG alone. A class rule outranks any type selector. */\n.aia-submitButton-otz7H svg {\n width: 18px;\n height: 18px;\n fill: none;\n /* The root draws nothing and the path pins its own stroke, but a page's\n \\`svg { stroke: … }\\` would otherwise still land here; say none, as the\n markup does. */\n stroke: none;\n}\n.aia-submitButton-otz7H svg path {\n fill: none;\n stroke: currentColor;\n}\n\n.aia-submitButton-otz7H:hover {\n opacity: 0.85;\n}\n\n/* Disabled (empty input) keeps the solid themed look by default — the disabled\n tokens fall back to the enabled ones, so a consumer's themed color is never\n washed out. Opt into a faded/dimmed rest state by setting\n --aia-submit-bg-disabled / --aia-submit-color-disabled. */\n.aia-submitButton-otz7H:disabled {\n background: var(\n --aia-submit-bg-disabled,\n var(--aia-submit-bg, var(--aia-color-text-default, #fff))\n );\n color: var(\n --aia-submit-color-disabled,\n var(--aia-submit-color, var(--aia-color-bg-default, #000))\n );\n cursor: default;\n}\n\n/* Ready: the request is complete, so the button lifts slightly and takes its\n ready color (--aia-submit-bg-ready, defaulting to the normal one). The state\n sits in :where() so a theme's own \\`.x .magicx-aia-submit { background }\\`\n still wins. */\n.aia-submitButton-otz7H:where([data-aia-ready]:not(:disabled)) {\n background: var(--aia-submit-bg-ready, var(--aia-submit-bg, var(--aia-color-text-default, #fff)));\n transform: scale(1.08);\n}\n\n/* A submit in progress (Enter, this button, \"See all results\"): the arrow\n gives way to the spinning arc the add-to-cart button shows, in the arrow's\n colour, until the page the submit opens takes over. The button keeps its\n size and stays enabled; a press is ignored. A slower turn under reduced\n motion: it is the only sign the submit took. The state sits in :where(),\n so a page's own rule on the attribute restyles or hides it. */\n.aia-submitButton-otz7H:where([data-aia-submit-state=\"busy\"]) svg {\n display: none;\n}\n\n.aia-submitButton-otz7H:where([data-aia-submit-state=\"busy\"])::after {\n content: \"\";\n box-sizing: border-box;\n width: var(--aia-spinner-size, 16px);\n height: var(--aia-spinner-size, 16px);\n border: var(--aia-spinner-width, 2px) solid var(--aia-submit-spinner-color, currentColor);\n border-right-color: transparent;\n border-radius: 50%;\n animation: aia-submitSpin-0llcF 0.8s linear infinite;\n}\n\n@keyframes aia-submitSpin-0llcF {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-submitButton-otz7H:where([data-aia-submit-state=\"busy\"])::after {\n animation-duration: 2s;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .aia-submitButton-otz7H {\n transition: none;\n }\n}\n`;\n document.head.appendChild(s);\n}\nexport default {\"submitButton\":\"aia-submitButton-otz7H\",\"submitSpin\":\"aia-submitSpin-0llcF\"};","import {\n type AutocompleteResult,\n AIAutocomplete as CoreAIAutocomplete,\n type CoreState,\n dateSelectionFor,\n dropdownPillsFor,\n editingSuggestion,\n HANDOFF_NOT_HANDLED,\n identifiedParamLabel,\n type Product,\n type SelectOptionOptions,\n type Suggestion,\n type SuggestionOption,\n withoutTraditionalAutocomplete,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport {\n type ChangeEvent,\n type KeyboardEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { UseAIAutocompleteOptions, UseAIAutocompleteReturn } from \"../types\";\nimport { useOptionOverridesProxy } from \"./useOptionOverridesProxy\";\nimport { useProductsProxy } from \"./useProductsProxy\";\n\n/** What `getResult()` answers before the core exists. */\nconst EMPTY_RESULT: AutocompleteResult = {\n query: \"\",\n raw_query: \"\",\n completed_params: [],\n identified_params: [],\n is_ready: false,\n};\n\n/**\n * Pre-mount / SSR fallback. Identical shape to the post-mount CoreState so\n * the hook's return is single-shaped — no `if (!instance) return ...` branch.\n * `isLoading: true` matches the historical SSR bail-out: consumers using\n * `isLoading` to render a skeleton see one on the first paint instead of a\n * flash of blank content while the mount effect creates the core instance.\n */\nconst EMPTY_STATE: CoreState = {\n text: \"\",\n composing: null,\n completedParams: [],\n identifiedParams: [],\n skippedParams: [],\n pendingSpan: null,\n suggestions: [],\n // Pre-mount there is no core and therefore no response to read items from.\n products: [],\n traditionalAutocomplete: false,\n customFields: null,\n // …nor an option override being asked.\n optionSearch: null,\n activeDropdownIndex: -1,\n highlightByPointer: false,\n newParamId: null,\n isLoading: true,\n isReady: false,\n error: null,\n segments: [],\n actionableSuggestions: [],\n filteredOptions: [],\n dropdownLoading: true,\n dropdownOptions: [],\n skeletonOptions: null,\n skeletonSuggestion: null,\n skeletonPicked: null,\n dropdownSuggestion: null,\n skeletonRequested: false,\n skeletonExiting: false,\n // Pre-mount there is no active suggestion, so nothing can be a date yet.\n activeFormatType: \"options\",\n dateView: null,\n dateRangeStart: null,\n dateReferences: [],\n dateFloor: null,\n timeView: null,\n multiSelectView: null,\n dropdownMultiSelect: null,\n multiSelectDraft: null,\n locationView: null,\n locationSearch: null,\n locationAutocomplete: true,\n locationFieldFocused: false,\n isSubmitting: false,\n selectingProductId: null,\n placeholderText: \"\",\n leadInText: \"\",\n optionQuery: \"\",\n isSearchingOptions: false,\n isDropdownOpen: false,\n isActivePillSelected: false,\n blockingChips: [],\n filterBase: 0,\n filterInProgress: false,\n pillTapped: false,\n skipNextFetch: false,\n lastRawQuery: \"\",\n isFocused: false,\n dropdownHeld: false,\n editingParam: null,\n editingIdentified: null,\n editingAnchor: null,\n editingTail: null,\n caretOffset: null,\n inSelectionAnimation: false,\n dateViewMonth: null,\n pendingRangeStart: null,\n timeDraft: null,\n};\n\ninterface CoreActions {\n handleTextChange: (value: string) => void;\n handleCompositionText: (value: string) => void;\n handleKeyDown: (e: KeyboardEvent<HTMLElement> | globalThis.KeyboardEvent) => void;\n setFocused: (focused: boolean) => void;\n startEditingParam: (paramId: string) => void;\n removeParam: (paramId: string) => boolean;\n exitEditMode: () => void;\n handleCaretAfterInput: (offset: number | null) => void;\n handleCaretMove: (offset: number | null) => void;\n replaceEditingRange: (replacement: string) => boolean;\n setActivePill: (index: number) => void;\n skipActivePill: () => void;\n removeLastParam: () => void;\n clearNewParamId: () => void;\n reset: () => void;\n refreshProducts: () => void;\n prepareSubmit: () => void;\n getState: () => CoreState;\n getResult: () => AutocompleteResult;\n awaitSubmitResult: () => Promise<AutocompleteResult | null>;\n recordSubmit: (result: AutocompleteResult) => void;\n holdSubmit: (returned?: unknown) => void;\n endSubmitProgress: () => void;\n getSearchId: () => string | undefined;\n getVisitorId: () => string | undefined;\n refreshAnalyticsConsent: () => void;\n selectOption: (option: SuggestionOption, how?: SelectOptionOptions) => void;\n selectProduct: (product: Product) => void;\n addProductToCart: (product: Product) => Promise<void>;\n setActiveDropdownIndex: (index: number) => void;\n /** Clear the highlight if it is still on option `index` — the core's `clearHighlight`. */\n clearHighlight: (index: number) => void;\n showPreviousMonth: () => void;\n showNextMonth: () => void;\n /** Turn the time wheel to `minutes` past midnight. Commits nothing — see the core's `setTime`. */\n setTime: (minutes: number) => void;\n /** Answer the time pill with the time on the wheel — the core's `commitTime`. */\n commitTime: () => void;\n toggleMultiSelectOption: (option: SuggestionOption) => void;\n commitMultiSelect: () => void;\n /** Set the location search field's text — the core's `setLocationQuery`. */\n setLocationQuery: (query: string) => void;\n /** Move the highlight through the location results — the core's `moveLocationHighlight`. */\n moveLocationHighlight: (delta: number) => void;\n /** Answer the location pill — the core's `commitLocation`. */\n commitLocation: (index?: number) => void;\n /** The location field took or let go of focus — the core's `setLocationFieldFocused`. */\n setLocationFieldFocused: (focused: boolean) => void;\n handleFocus: () => void;\n handleBlur: () => void;\n}\n\nexport function useAIAutocomplete({\n onSubmit,\n onResult,\n onError,\n optionOverrides,\n maskCompletedText,\n apiConfig,\n additionalContext,\n language,\n currency,\n productId,\n visitorId,\n analyticsConsent,\n columns = 2,\n dropdownTrigger,\n optionsPosition,\n closeDropdownOnBlur,\n focusInputOnSelect,\n startingState,\n prependPlaceholder,\n allOption,\n showNonTappableOptions,\n locationSearch,\n showOptionIcons,\n showOptionImages,\n showOptionCounts,\n showSkipButton,\n showProducts,\n submitProgress,\n awaitAnswerOnSubmit,\n submitAnswerTimeoutMs,\n productImageFallback = \"image\",\n showProductVendor = true,\n onFocus,\n onBlur,\n value: controlledValue,\n completedParams: controlledParams,\n onChange: onChangeProp,\n onParamsChange,\n products,\n mapProducts,\n onProductSelect,\n onProductAddToCart,\n source,\n setCursor,\n}: UseAIAutocompleteOptions): UseAIAutocompleteReturn {\n const instanceRef = useRef<CoreAIAutocomplete | null>(null);\n const [coreState, setCoreState] = useState<CoreState | null>(null);\n\n // Refs for caller-supplied callbacks. The CoreAIAutocomplete instance is\n // mount-only (created once); these refs let the stable proxy callbacks\n // inside it pick up the latest props on every render.\n const onSubmitRef = useRef(onSubmit);\n onSubmitRef.current = onSubmit;\n const onResultRef = useRef(onResult);\n onResultRef.current = onResult;\n const onErrorRef = useRef(onError);\n onErrorRef.current = onError;\n const onChangeRef = useRef(onChangeProp);\n onChangeRef.current = onChangeProp;\n const onParamsChangeRef = useRef(onParamsChange);\n onParamsChangeRef.current = onParamsChange;\n const onFocusRef = useRef(onFocus);\n onFocusRef.current = onFocus;\n const onBlurRef = useRef(onBlur);\n onBlurRef.current = onBlur;\n const setCursorRef = useRef(setCursor);\n setCursorRef.current = setCursor;\n const onProductSelectRef = useRef(onProductSelect);\n onProductSelectRef.current = onProductSelect;\n const onProductAddToCartRef = useRef(onProductAddToCart);\n onProductAddToCartRef.current = onProductAddToCart;\n // The core gets one stable resolver reading the latest prop, so an inline\n // `visitorId={() => readCookie()}` is not a changed option on every render.\n // A resolver is only called once the server has funnel telemetry on.\n const visitorIdRef = useRef(visitorId);\n visitorIdRef.current = visitorId;\n const resolveVisitorId = useRef(() => {\n const v = visitorIdRef.current;\n return typeof v === \"function\" ? v() : v;\n }).current;\n // Only a host that passes visitorId gets the resolver: without one, the\n // core keeps its own id (analyticsConsent), which a resolver standing in\n // for a missing prop would block.\n const hasVisitorId = visitorId !== undefined;\n // Same treatment for the consent: one stable reader of the latest prop. A\n // missing prop reads as unanswered, which touches no cookie.\n const analyticsConsentRef = useRef(analyticsConsent);\n analyticsConsentRef.current = analyticsConsent;\n const readAnalyticsConsent = useRef(() => {\n const c = analyticsConsentRef.current;\n return typeof c === \"function\" ? c() : c;\n }).current;\n\n // Stable proxy so an inline `products={{ … }}` doesn't read as a swapped\n // integration on every render — see useProductsProxy for the full rationale.\n const productsProxy = useProductsProxy(products);\n const mapperRef = useRef(mapProducts);\n mapperRef.current = mapProducts;\n const forwardMapper = useRef<NonNullable<UseAIAutocompleteOptions[\"mapProducts\"]>>(\n (cards, items) => {\n const mapper = mapperRef.current;\n return mapper ? mapper(cards, items) : cards;\n },\n ).current;\n const mapperProxy = mapProducts ? forwardMapper : undefined;\n // Same treatment for `optionOverrides`: the core would read a fresh inline\n // record as a swap and re-ask the pill on screen — see useOptionOverridesProxy.\n const overridesProxy = useOptionOverridesProxy(optionOverrides);\n\n // Create, subscribe, and destroy the core instance in one mount-only effect.\n // Keeping creation out of render (and pairing it with the cleanup) is what\n // makes this StrictMode-safe — otherwise cleanup nulls the ref, render\n // re-creates, and the store subscription drives an infinite setState loop.\n // biome-ignore lint/correctness/useExhaustiveDependencies: initial-opts snapshot; later changes are synced by the update-effect below\n useEffect(() => {\n if (typeof document === \"undefined\") return;\n const instance = new CoreAIAutocomplete(document.createElement(\"div\"), {\n renderMode: \"headless\",\n apiConfig,\n additionalContext,\n language,\n currency,\n productId,\n visitorId: hasVisitorId ? resolveVisitorId : undefined,\n analyticsConsent: readAnalyticsConsent,\n optionOverrides: overridesProxy.overrides,\n maskCompletedText,\n columns,\n dropdownTrigger,\n optionsPosition,\n closeDropdownOnBlur,\n focusInputOnSelect,\n startingState,\n prependPlaceholder,\n allOption,\n showNonTappableOptions,\n locationSearch,\n showProducts,\n submitProgress,\n awaitAnswerOnSubmit,\n submitAnswerTimeoutMs,\n source,\n value: controlledValue,\n completedParams: controlledParams,\n onSubmit: (...args) => onSubmitRef.current?.(...args),\n onResult: (...args) => onResultRef.current?.(...args),\n onError: (...args) => onErrorRef.current?.(...args),\n onChange: (...args) => onChangeRef.current?.(...args),\n onParamsChange: (...args) => onParamsChangeRef.current?.(...args),\n onFocus: () => onFocusRef.current?.(),\n onBlur: () => onBlurRef.current?.(),\n // Registered whatever the consumer passed (the listener set is fixed\n // at construction), so say when there is no handler behind it: a tap\n // that opens nothing must not be marked in progress.\n onProductSelect: (product) =>\n onProductSelectRef.current\n ? onProductSelectRef.current(product)\n : (HANDOFF_NOT_HANDLED as unknown as undefined),\n // Always a forwarder, so a handler added after mount still reaches the\n // core. Whether cards draw the button follows the prop itself (see\n // `dropdownProps`), and `addProductToCart` below skips the core while\n // no handler is set.\n onProductAddToCart: (product) => onProductAddToCartRef.current?.(product),\n setCursor: (offset) => setCursorRef.current?.(offset),\n products: productsProxy.config,\n mapProducts: mapperProxy,\n });\n instanceRef.current = instance;\n setCoreState(instance.getState());\n const unsub = instance.subscribe((state) => setCoreState(state));\n return () => {\n unsub();\n instance.destroy();\n if (instanceRef.current === instance) instanceRef.current = null;\n };\n }, []);\n\n // A visitorId added or removed after mount moves the id between the host\n // and the core. The consent goes with it, so a core taking the id back\n // reads the answer at once (a declined one removes a stored id).\n const mountedVisitorIdRef = useRef(hasVisitorId);\n useEffect(() => {\n if (mountedVisitorIdRef.current === hasVisitorId) return;\n mountedVisitorIdRef.current = hasVisitorId;\n instanceRef.current?.update({\n visitorId: hasVisitorId ? resolveVisitorId : undefined,\n analyticsConsent: readAnalyticsConsent,\n });\n }, [hasVisitorId, resolveVisitorId, readAnalyticsConsent]);\n\n // A changed answer applies at once (a declined one removes the stored id).\n // A function is read when needed, so only a changed value is a change here.\n const consentKey = typeof analyticsConsent === \"function\" ? \"function\" : analyticsConsent;\n const mountedConsentKeyRef = useRef(consentKey);\n useEffect(() => {\n if (mountedConsentKeyRef.current === consentKey) return;\n mountedConsentKeyRef.current = consentKey;\n instanceRef.current?.refreshAnalyticsConsent();\n }, [consentKey]);\n\n // Sync controlled value\n useEffect(() => {\n if (controlledValue !== undefined) instanceRef.current?.setValue(controlledValue);\n }, [controlledValue]);\n\n // Sync controlled params\n useEffect(() => {\n if (controlledParams !== undefined) instanceRef.current?.setCompletedParams(controlledParams);\n }, [controlledParams]);\n\n // Sync apiConfig/optionOverrides/dropdownTrigger when values change\n const apiConfigJson = JSON.stringify(apiConfig ?? null);\n // Unlike apiConfig (a narrow typed shape), additionalContext is consumer-supplied\n // free-form JSON — a circular reference or a BigInt would throw here, which runs\n // during render. Fall back to a constant so a bad value is silently dropped\n // (never synced to the core) instead of crashing the render.\n let additionalContextJson: string;\n try {\n additionalContextJson = JSON.stringify(additionalContext ?? null);\n } catch {\n additionalContextJson = \"[unstringifiable]\";\n }\n // biome-ignore lint/correctness/useExhaustiveDependencies: overridesProxy.key tracks override changes. Currency fields track currency changes. The proxy reads callbacks live.\n useEffect(() => {\n instanceRef.current?.update({\n apiConfig,\n additionalContext,\n language,\n currency,\n productId,\n optionOverrides: overridesProxy.overrides,\n dropdownTrigger,\n optionsPosition,\n closeDropdownOnBlur,\n focusInputOnSelect,\n startingState,\n prependPlaceholder,\n allOption,\n showNonTappableOptions,\n locationSearch,\n showProducts,\n submitProgress,\n awaitAnswerOnSubmit,\n submitAnswerTimeoutMs,\n });\n }, [\n apiConfigJson,\n additionalContextJson,\n language,\n currency?.code,\n currency?.rate,\n currency?.country,\n productId,\n overridesProxy.key,\n dropdownTrigger,\n optionsPosition,\n closeDropdownOnBlur,\n focusInputOnSelect,\n startingState,\n prependPlaceholder,\n allOption,\n showNonTappableOptions,\n locationSearch,\n showProducts,\n submitProgress,\n awaitAnswerOnSubmit,\n submitAnswerTimeoutMs,\n ]);\n\n // Toggling the strip on or off is the only products change the core needs to\n // hear about — the proxy handles everything else — and it deliberately\n // clears the cards on the way out. Skips the mount pass: the constructor\n // above already applied the initial value, and a redundant update() here\n // would clear a strip the first fetch had populated.\n //\n // `productsProxy.config` is intentionally not a dependency: its identity is\n // stable by construction, so `enabled` is the only thing that can change.\n const productsMountedRef = useRef(false);\n // biome-ignore lint/correctness/useExhaustiveDependencies: config is stable by construction; `enabled` is the only real change\n useEffect(() => {\n if (!productsMountedRef.current) {\n productsMountedRef.current = true;\n return;\n }\n instanceRef.current?.update({ products: productsProxy.config });\n }, [productsProxy.enabled]);\n\n useEffect(() => {\n instanceRef.current?.update({ mapProducts: mapperProxy });\n }, [mapperProxy]);\n\n // Single stable action surface. Built once via the useRef-with-null-init\n // pattern (the idiomatic \"create once, never recreate\" idiom in React — see\n // https://react.dev/reference/react/useRef). Every entry forwards to the\n // current core instance via `instanceRef.current` so the closure picks up\n // the live instance even though the actions object itself never changes.\n const actionsRef = useRef<CoreActions | null>(null);\n if (actionsRef.current === null) {\n actionsRef.current = {\n handleTextChange: (value) => instanceRef.current?.handleTextChange(value),\n handleCompositionText: (value) => instanceRef.current?.handleCompositionText(value),\n handleKeyDown: (e) => {\n const native = \"nativeEvent\" in e ? e.nativeEvent : e;\n instanceRef.current?.handleKeyDown(native);\n },\n setFocused: (focused) => instanceRef.current?.setFocused(focused),\n startEditingParam: (paramId) => instanceRef.current?.startEditingParam(paramId),\n removeParam: (paramId) => instanceRef.current?.removeParam(paramId) ?? false,\n exitEditMode: () => instanceRef.current?.exitEditMode(),\n handleCaretAfterInput: (offset) => instanceRef.current?.handleCaretAfterInput(offset),\n handleCaretMove: (offset) => instanceRef.current?.handleCaretMove(offset),\n replaceEditingRange: (replacement) =>\n instanceRef.current?.replaceEditingRange(replacement) ?? false,\n setActivePill: (index) => instanceRef.current?.setActivePill(index),\n skipActivePill: () => instanceRef.current?.skipActivePill(),\n removeLastParam: () => instanceRef.current?.removeLastParam(),\n clearNewParamId: () => instanceRef.current?.clearNewParamId(),\n reset: () => instanceRef.current?.reset(),\n refreshProducts: () => instanceRef.current?.refreshProducts(),\n prepareSubmit: () => instanceRef.current?.prepareSubmit(),\n getState: () => instanceRef.current?.getState() ?? EMPTY_STATE,\n getResult: () => instanceRef.current?.getResult() ?? EMPTY_RESULT,\n awaitSubmitResult: () => instanceRef.current?.awaitSubmitResult() ?? Promise.resolve(null),\n recordSubmit: (result) => instanceRef.current?.recordSubmit(result),\n holdSubmit: (returned) => instanceRef.current?.holdSubmit(returned),\n endSubmitProgress: () => instanceRef.current?.endSubmitProgress(),\n getSearchId: () => instanceRef.current?.getSearchId(),\n getVisitorId: () => instanceRef.current?.getVisitorId(),\n refreshAnalyticsConsent: () => instanceRef.current?.refreshAnalyticsConsent(),\n selectOption: (option, how) => instanceRef.current?.selectOption(option, how),\n selectProduct: (product) => instanceRef.current?.selectProduct(product),\n addProductToCart: (product) => {\n const instance = instanceRef.current;\n if (!instance || !onProductAddToCartRef.current) return Promise.resolve();\n return instance.addProductToCart(product);\n },\n setActiveDropdownIndex: (index) => instanceRef.current?.setActiveDropdownIndex(index),\n clearHighlight: (index) => instanceRef.current?.clearHighlight(index),\n showPreviousMonth: () => instanceRef.current?.showPreviousMonth(),\n showNextMonth: () => instanceRef.current?.showNextMonth(),\n setTime: (minutes) => instanceRef.current?.setTime(minutes),\n commitTime: () => instanceRef.current?.commitTime(),\n toggleMultiSelectOption: (option) => instanceRef.current?.toggleMultiSelectOption(option),\n commitMultiSelect: () => instanceRef.current?.commitMultiSelect(),\n setLocationQuery: (query) => instanceRef.current?.setLocationQuery(query),\n moveLocationHighlight: (delta) => instanceRef.current?.moveLocationHighlight(delta),\n commitLocation: (index) => instanceRef.current?.commitLocation(index),\n setLocationFieldFocused: (focused) => instanceRef.current?.setLocationFieldFocused(focused),\n handleFocus: () => instanceRef.current?.setFocused(true),\n handleBlur: () => instanceRef.current?.setFocused(false),\n };\n }\n const actions = actionsRef.current;\n\n // textarea-specific adapter — capitalizes the first character on first\n // keystroke. Kept separate from `actions.handleTextChange` because the\n // capitalization rule belongs to the textarea host, not the core.\n const handleChange = useCallback((e: ChangeEvent<HTMLTextAreaElement>) => {\n const raw = e.target.value;\n const shouldCapitalize =\n raw.length > 0 &&\n !(e.nativeEvent as InputEvent)?.isComposing &&\n raw[0] !== raw[0].toUpperCase();\n const newValue = shouldCapitalize ? raw[0].toUpperCase() + raw.slice(1) : raw;\n instanceRef.current?.handleTextChange(newValue);\n }, []);\n\n const handleKeyDownTextarea = useCallback((e: KeyboardEvent<HTMLTextAreaElement>) => {\n instanceRef.current?.handleKeyDown(e.nativeEvent);\n }, []);\n\n // Snapshot the live instance + state for this render.\n const instance = instanceRef.current;\n const state = coreState ?? EMPTY_STATE;\n const text = controlledValue !== undefined ? controlledValue : state.text;\n const completedParams = controlledParams !== undefined ? controlledParams : state.completedParams;\n\n const actionableSuggestions = state.actionableSuggestions;\n const activeSuggestion: Suggestion | undefined = actionableSuggestions[0];\n // The traditional autocomplete suggestion is never a pill.\n // Memoized so consumers that depend on the pills (the empty box's hint)\n // only re-run when the suggestions change.\n const pillSuggestions = useMemo(\n () => withoutTraditionalAutocomplete(actionableSuggestions),\n [actionableSuggestions],\n );\n const listboxId = instance?.listboxId ?? \"\";\n\n const activeDescendantId =\n state.activeDropdownIndex >= 0 && instance\n ? `${listboxId}-option-${state.activeDropdownIndex}`\n : undefined;\n\n // In re-edit mode, the dropdown's pill bar shows a synthetic pill built\n // from the edited param's cached suggestion metadata. The options grid\n // shows the cached options regardless of the latest server response.\n const editingParam = state.editingParam;\n const editingIdentified = state.editingIdentified;\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 = state.dropdownSuggestion ?? dropdownPill ?? activeSuggestion;\n const dropdownPills = dropdownPillsFor(\n state.dropdownSuggestion,\n dropdownPill,\n actionableSuggestions,\n );\n\n // UI-visible loading — the core's `dropdownLoading` (see its docs). Pre-mount\n // we report loading=true so SSR / first-paint consumers render a skeleton\n // instead of a flash of blank content while the mount effect runs.\n const dateSelection = dateSelectionFor(state);\n\n const uiLoading = !instance || state.dropdownLoading;\n\n return {\n completedParams,\n multiSelectView: state.multiSelectView,\n toggleMultiSelectOption: actions.toggleMultiSelectOption,\n commitMultiSelect: actions.commitMultiSelect,\n skippedParams: state.skippedParams,\n identifiedParams: state.identifiedParams,\n suggestionPills: pillSuggestions,\n setActivePill: actions.setActivePill,\n skipActivePill: actions.skipActivePill,\n removeLastParam: actions.removeLastParam,\n segments: state.segments,\n newParamId: state.newParamId,\n clearNewParamId: actions.clearNewParamId,\n suggestions: state.suggestions,\n activeIndex: state.activeDropdownIndex,\n isReady: state.isReady,\n isLoading: uiLoading,\n isFocused: state.isFocused,\n isDropdownOpen: state.isDropdownOpen,\n isActivePillSelected: state.isActivePillSelected,\n blockingChips: state.blockingChips,\n placeholderText: state.placeholderText,\n listboxId,\n error: state.error,\n products: state.products,\n customFields: state.customFields,\n selectProduct: actions.selectProduct,\n addProductToCart: actions.addProductToCart,\n handleTextChange: actions.handleTextChange,\n handleCompositionText: actions.handleCompositionText,\n handleKeyDown: actions.handleKeyDown,\n setFocused: actions.setFocused,\n editingParam,\n editingIdentified,\n editingAnchor: state.editingAnchor,\n caretOffset: state.caretOffset,\n startEditingParam: actions.startEditingParam,\n removeParam: actions.removeParam,\n exitEditMode: actions.exitEditMode,\n handleCaretAfterInput: actions.handleCaretAfterInput,\n handleCaretMove: actions.handleCaretMove,\n replaceEditingRange: actions.replaceEditingRange,\n inputProps: {\n value: text,\n placeholder: state.placeholderText || undefined,\n onChange: handleChange,\n onKeyDown: handleKeyDownTextarea,\n onFocus: actions.handleFocus,\n onBlur: actions.handleBlur,\n role: \"combobox\" as const,\n \"aria-expanded\": state.isDropdownOpen,\n \"aria-activedescendant\": activeDescendantId,\n \"aria-autocomplete\": \"list\" as const,\n \"aria-controls\": listboxId,\n },\n reset: actions.reset,\n refreshProducts: actions.refreshProducts,\n prepareSubmit: actions.prepareSubmit,\n getState: actions.getState,\n getResult: actions.getResult,\n awaitSubmitResult: actions.awaitSubmitResult,\n recordSubmit: actions.recordSubmit,\n holdSubmit: actions.holdSubmit,\n endSubmitProgress: actions.endSubmitProgress,\n getSearchId: actions.getSearchId,\n getVisitorId: actions.getVisitorId,\n refreshAnalyticsConsent: actions.refreshAnalyticsConsent,\n isSubmitting: state.isSubmitting,\n selectingProductId: state.selectingProductId,\n dropdownProps: {\n suggestions: dropdownActivePill\n ? [{ ...dropdownActivePill, options: state.dropdownOptions }]\n : [],\n activeIndex: state.activeDropdownIndex,\n onSelect: actions.selectOption,\n onHighlight: actions.setActiveDropdownIndex,\n onUnhighlight: actions.clearHighlight,\n isOpen: state.isDropdownOpen,\n id: listboxId,\n pills: dropdownPills,\n activeSelected: state.isActivePillSelected,\n onPillClick: actions.setActivePill,\n onSkip: actions.skipActivePill,\n // Hidden while re-editing: the bar then shows the param being re-edited,\n // and an already answered param isn't skippable.\n showSkipButton: (showSkipButton ?? true) && !editingParam && !editingIdentified,\n showOptionIcons: showOptionIcons ?? true,\n showOptionImages: showOptionImages ?? true,\n showOptionCounts: showOptionCounts ?? true,\n // uiLoading is suppressed during the selection animation, but\n // skipActivePill no-ops in that window — mirror the guard visually.\n skipDisabled: state.inSelectionAnimation,\n isLoading: uiLoading,\n skeletonExiting: state.skeletonExiting,\n isInputEmpty: text.trim().length === 0,\n language,\n products: state.products,\n productImageFallback,\n showProductVendor,\n onProductSelect: actions.selectProduct,\n busyProductId: state.selectingProductId,\n seeAllBusy: state.isSubmitting,\n // Only with a handler: the prop's presence is what draws the buttons.\n onProductAddToCart: onProductAddToCart ? actions.addProductToCart : undefined,\n // A card taking focus blurs the input, which would otherwise close the\n // panel out from under the card the user just tabbed to.\n onProductFocusChange: actions.setFocused,\n // Datepicker. `filteredOptions` above already carries the visible month's\n // cells rather than the suggestion's own options when this is \"date\" —\n // the core swapped them in its derive layer, so the dropdown only has to\n // know which body to draw.\n formatType: state.activeFormatType,\n dateView: state.dateView,\n selectedDateIso: dateSelection.selectedIso,\n selectedDateRange: dateSelection.selectedRange,\n dateRangeStart: dateSelection.rangeStart,\n dateReferences: dateSelection.references,\n onPreviousMonth: actions.showPreviousMonth,\n onNextMonth: actions.showNextMonth,\n // Time wheel. As for a calendar, `filteredOptions` is empty — the wheel\n // is drawn from `timeView`, not from the suggestion's options.\n timeView: state.timeView,\n multiSelectView: state.dropdownMultiSelect,\n onMultiSelectCommit: actions.commitMultiSelect,\n onTimeChange: actions.setTime,\n onTimeCommit: actions.commitTime,\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: state.locationView,\n isReediting: state.editingParam != null,\n onLocationQuery: actions.setLocationQuery,\n onLocationMove: actions.moveLocationHighlight,\n onLocationCommit: actions.commitLocation,\n onLocationFocusChange: actions.setLocationFieldFocused,\n isFocused: state.isFocused || state.locationFieldFocused,\n // Flow the configured position into the dropdown so a headless consumer\n // who spreads `dropdownProps` gets above/below placement + layout reversal\n // automatically — no wrapper attribute or hand-copied CSS required.\n optionsPosition: optionsPosition ?? \"below\",\n },\n };\n}\n","import type { OptionOverride, OptionOverrides } from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { useRef } from \"react\";\n\nexport interface OptionOverridesProxy {\n /**\n * Stable record to hand the core. Its identity changes only when the SET of\n * overridden types changes, so `update()` sees a swap — and re-asks the pill\n * on screen — for a real change, never for a re-render.\n */\n overrides: OptionOverrides | undefined;\n /** The overridden types, joined — the only change worth an `update()` call. */\n key: string;\n}\n\n/**\n * Forwards `optionOverrides` to the core through a **stable proxy**.\n *\n * Consumers write the record inline, so the object and every function in it\n * get a fresh identity on each render. Handing that to the core would look\n * like a swapped record on every render, and the core answers a swap by\n * abandoning the ask in flight and asking again — with an inline record that\n * is a re-ask per render, and each answer re-renders. So calls go through a\n * ref instead, exactly as the hook's `on*` callbacks and `products` do: the\n * function the core calls is always the latest one rendered.\n *\n * The proxy is rebuilt only when the set of types changes, which is the one\n * change the core has to hear about (a pill of a newly overridden type may be\n * on screen).\n */\nexport function useOptionOverridesProxy(\n optionOverrides: OptionOverrides | undefined,\n): OptionOverridesProxy {\n const liveRef = useRef(optionOverrides);\n liveRef.current = optionOverrides;\n\n const key = Object.keys(optionOverrides ?? {})\n .sort()\n .join(\"\\u0000\");\n const proxyRef = useRef<{ key: string; overrides: OptionOverrides | undefined }>({\n key: \"\\u0001\",\n overrides: undefined,\n });\n if (proxyRef.current.key !== key) {\n const overrides: OptionOverrides = {};\n for (const type of Object.keys(optionOverrides ?? {})) {\n const forward: OptionOverride = (query, signal, suggestion) => {\n const fn = liveRef.current?.[type];\n // Unreachable while the type is overridden; an empty answer keeps a\n // torn-down entry on the path the core already treats as \"no options\".\n return fn ? fn(query, signal, suggestion) : [];\n };\n overrides[type] = forward;\n }\n proxyRef.current = { key, overrides: optionOverrides ? overrides : undefined };\n }\n return { overrides: proxyRef.current.overrides, key };\n}\n","import type { ProductsConfig } from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport { useRef } from \"react\";\n\nexport interface ProductsProxy {\n /**\n * Stable object to hand the core. Identity never changes for the lifetime of\n * the hook, so `update()` never mistakes a re-render for a swapped\n * integration. `undefined` while the consumer hasn't configured `products` —\n * the core must see exactly that to stay completely inert.\n */\n config: ProductsConfig | undefined;\n /**\n * Whether `products` is configured. The only products change worth an\n * `update()` call, and therefore the only sane effect dependency: everything\n * else is picked up live through the proxy.\n */\n enabled: boolean;\n}\n\n/**\n * Forwards a `products` config to the core through a **stable proxy**.\n *\n * Consumers write the config inline (`products={{ fetch, transform }}`), so the\n * object and its function members get a fresh identity on every render. Handing\n * that straight to the core would look like a swapped integration on each\n * keystroke and clear the strip — so calls are forwarded through a ref instead,\n * exactly as the hook's `on*` callbacks already are. `limit` is a **getter**\n * because it's a value rather than a function: without one it would freeze at\n * whatever the first render passed.\n *\n * Note the trade this makes deliberately: identity can no longer distinguish\n * \"same integration, new object literal\" from \"genuinely different\n * integration\", so swapping one live config for another does NOT clear the\n * previous integration's cards — they're replaced when the next request lands.\n * Documented on the `products` prop.\n */\nexport function useProductsProxy(products: ProductsConfig | undefined): ProductsProxy {\n const productsRef = useRef(products);\n productsRef.current = products;\n\n const proxyRef = useRef<ProductsConfig | null>(null);\n if (proxyRef.current === null) {\n proxyRef.current = {\n fetch: (query, signal) => {\n const config = productsRef.current;\n // Unreachable while configured; a rejected promise (rather than a\n // throw) keeps the failure on the path the core already treats as\n // \"silent failure\" if the config is torn down mid-flight.\n if (!config) return Promise.reject(new Error(\"products config removed\"));\n return config.fetch(query, signal);\n },\n transform: (raw) => productsRef.current?.transform(raw) ?? [],\n get limit() {\n return productsRef.current?.limit;\n },\n };\n }\n\n const enabled = products !== undefined;\n return { config: enabled ? proxyRef.current : undefined, enabled };\n}\n","import {\n attachChipRemove,\n type CompletedParamState,\n cancelStartingHint,\n chipIdFromTap,\n extractPlainText,\n type FocusInputOnSelect,\n focusesInputOnSelect,\n getCursorOffset,\n keepCaretOnChip,\n plainTextLength,\n renderEditableContent,\n type Segment,\n type Suggestion,\n setCursorOffset,\n settlePickFocus,\n startingHintOptions,\n} from \"@magicx-eng/ai-autocomplete-vanilla\";\nimport {\n type ClipboardEvent as ReactClipboardEvent,\n type KeyboardEvent as ReactKeyboardEvent,\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n} from \"react\";\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\nexport interface UseContentEditableEditorOptions {\n /** Derived segments (text + bold completed-param runs) for the editor body. */\n segments: readonly Segment[];\n /** The most recently promoted param — shimmer + post-promote refocus key. */\n newParamId: string | null;\n /** The bold param currently being re-edited (or null). */\n editingParam: CompletedParamState | null;\n /** Set while picking a date for a span the server identified as one. */\n editingIdentified: { id: string } | null;\n /** Plain-text offset where re-edit started; caret parks here on entry. */\n editingAnchor: number | null;\n /** Live caret offset within the editor, used by post-promote refocus. */\n caretOffset: number | null;\n /** Server-suggested placeholder (rendered via ::before when empty). */\n placeholderText: string;\n /** The suggestions whose first question's options the empty box's hint\n * cycles through (\"Find a jacket\" → \"Find a gift idea\"). */\n hintSuggestions?: readonly Suggestion[];\n /** Whether the editor currently has focus — passes through to segment renderer. */\n isFocused: boolean;\n /** ARIA `aria-expanded` value for the input. */\n isDropdownOpen: boolean;\n /** ARIA `aria-controls` value pointing at the listbox. */\n listboxId: string;\n /** ARIA `aria-activedescendant` value pointing at the highlighted option (or undefined). */\n activeDescendantId: string | undefined;\n /** Focus the editor on mount (Tier 1 default). */\n autoFocus: boolean;\n /** Forwarded to the core whenever the plain-text content changes. */\n handleTextChange: (value: string) => void;\n /** Forwarded to the core while an IME composes, in place of `handleTextChange`. */\n handleCompositionText: (value: string) => void;\n /** Forwarded to the core for keyboard handling. */\n handleKeyDown: (e: ReactKeyboardEvent<HTMLElement> | globalThis.KeyboardEvent) => void;\n /** Forwarded to the core after each input event (extends edit tail, etc.). */\n handleCaretAfterInput: (offset: number | null) => void;\n /** Forwarded to the core on selectionchange (exits re-edit when caret leaves). */\n handleCaretMove: (offset: number | null) => void;\n /** Forwarded to the core when the caret lands inside a bold param's strong. */\n startEditingParam: (id: string) => void;\n /** Forwarded to the core during a `beforeinput` — atomic re-edit replacement. */\n replaceEditingRange: (replacement: string) => boolean;\n /** Forwarded to the core on native focus/blur. */\n setFocused: (focused: boolean) => void;\n /** Whether completed chips draw the icon of the option that answered them. Default: true. */\n showChipIcons?: boolean;\n /** Whether completed chips draw the picture of the option that answered them, in place of the icon. Default: true. */\n showChipImages?: boolean;\n /** Whether chips (completed and identified) end in a faint \"×\" that removes them. Default: false. */\n showChipRemove?: boolean;\n /** Chips whose removal finds items when the search found none. */\n blockingParamIds?: readonly string[];\n /** Whether a pick puts focus in the editor. Default: \"auto\" (not on a touch device). */\n focusInputOnSelect?: FocusInputOnSelect;\n /** Forwarded to the core when a chip's \"×\" is pressed. */\n removeParam?: (id: string) => void;\n}\n\nexport interface UseContentEditableEditorReturn {\n inputRef: React.RefObject<HTMLDivElement>;\n // Spread onto the contentEditable element; consumer supplies className.\n editorProps: {\n ref: React.RefObject<HTMLDivElement>;\n contentEditable: boolean;\n suppressContentEditableWarning: true;\n tabIndex: 0;\n role: \"combobox\";\n \"aria-autocomplete\": \"list\";\n \"aria-haspopup\": \"listbox\";\n \"aria-controls\": string;\n \"aria-expanded\": boolean;\n \"aria-activedescendant\": string | undefined;\n spellCheck: true;\n enterKeyHint: \"send\";\n onInput: () => void;\n onKeyDown: (e: ReactKeyboardEvent<HTMLDivElement>) => void;\n onCompositionStart: () => void;\n onCompositionEnd: () => void;\n onPaste: (e: ReactClipboardEvent<HTMLDivElement>) => void;\n onFocus: () => void;\n onBlur: () => void;\n };\n /** Current plain-text content of the editor (used by submit). */\n getPlainText: () => string;\n /** Imperative focus / blur (used by the parent's imperative handle). */\n focus: () => void;\n blur: () => void;\n}\n\n/**\n * Owns every concern that's specific to running the autocomplete on top of a\n * contentEditable host: composition state, caret tracking, selectionchange,\n * `beforeinput` interception, paste sanitization, plaintext-only feature\n * detection, segment rendering, post-promote refocus, and re-edit caret park.\n *\n * The hook stays React-agnostic above the contentEditable adapter — see\n * `core/render/renderEditable.ts` for the underlying DOM mutations. Callers\n * spread `editorProps` onto a `<div>` (className is theirs to provide).\n */\nexport function useContentEditableEditor(\n opts: UseContentEditableEditorOptions,\n): UseContentEditableEditorReturn {\n const {\n segments,\n showChipIcons = true,\n showChipImages = true,\n showChipRemove = false,\n blockingParamIds,\n focusInputOnSelect,\n removeParam,\n newParamId,\n editingParam,\n editingIdentified,\n editingAnchor,\n caretOffset,\n placeholderText,\n hintSuggestions,\n isFocused,\n isDropdownOpen,\n listboxId,\n activeDescendantId,\n autoFocus,\n handleTextChange,\n handleCompositionText,\n handleKeyDown,\n handleCaretAfterInput,\n handleCaretMove,\n startEditingParam,\n replaceEditingRange,\n setFocused,\n } = opts;\n\n const inputRef = useRef<HTMLDivElement>(null);\n const composingRef = useRef(false);\n const lastSeenParamIdRef = useRef(\"\");\n const lastEditingIdRef = useRef(\"\");\n const caretOffsetRef = useRef<number | null>(null);\n // Set in the input event handler; selectionchange suppresses post-input\n // caret-move tracking within this window so typing doesn't get treated\n // as navigation.\n const lastInputAtRef = useRef(0);\n\n caretOffsetRef.current = caretOffset;\n const focusModeRef = useRef(focusInputOnSelect);\n focusModeRef.current = focusInputOnSelect;\n\n // Auto-focus on mount once the host element is mounted.\n useEffect(() => {\n if (!autoFocus) return;\n const el = inputRef.current;\n if (!el) return;\n if (document.activeElement === el) {\n setFocused(true);\n } else {\n el.focus();\n }\n // Focusing an empty contentEditable doesn't always create a selection\n // Range, so no caret blinks until the user clicks. Place a collapsed caret\n // at the start so the field is visibly ready immediately. Skip if the caret\n // already sits inside the editor (e.g. the user clicked before this ran).\n const doc = el.ownerDocument ?? document;\n const sel = doc.getSelection();\n const caretInside = sel && sel.rangeCount > 0 && el.contains(sel.anchorNode);\n if (sel && !caretInside) {\n const range = doc.createRange();\n range.selectNodeContents(el);\n range.collapse(true);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n }, [autoFocus, setFocused]);\n\n // `selectionchange` is the canonical signal for \"caret moved\" in\n // contentEditable land. Anchored inside the editor: a caret that lands\n // inside a `<strong>` triggers re-edit mode; a caret that leaves the\n // current editing region exits it.\n useEffect(() => {\n const el = inputRef.current;\n if (!el) return;\n const doc = el.ownerDocument ?? document;\n const onSelectionChange = () => {\n const sel = doc.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 range\n // selection (Cmd+A, shift-arrow, drag) anchors at its start, which lands\n // inside the first `<strong>` whenever the input begins with a chip —\n // starting re-edit there parks the caret on that chip and destroys the\n // 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 const enclosing = strong?.dataset.paramId ?? null;\n // Either kind counts as \"already open on this chip\" — without the\n // identified id here, every caret tick inside a date span would re-enter\n // the pick it is already in.\n const openChipId = editingParam?.id ?? editingIdentified?.id ?? null;\n if (enclosing && enclosing !== openChipId) {\n startEditingParam(enclosing);\n return;\n }\n if (performance.now() - lastInputAtRef.current < 50) return;\n handleCaretMove(getCursorOffset(el));\n };\n doc.addEventListener(\"selectionchange\", onSelectionChange);\n return () => doc.removeEventListener(\"selectionchange\", onSelectionChange);\n }, [editingParam, editingIdentified, startEditingParam, handleCaretMove]);\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 above can miss the tapped chip or\n // open the wrong one. The click target is the element actually hit and\n // overrides it; `keepCaretOnChip` then pulls a stray caret onto the tapped\n // chip so the next selectionchange doesn't close or redirect what the tap\n // opened.\n useEffect(() => {\n const el = inputRef.current;\n if (!el) return;\n const onClick = (e: MouseEvent) => {\n const id = chipIdFromTap(el, e.target);\n if (!id) return;\n startEditingParam(id);\n keepCaretOnChip(el, id);\n };\n el.addEventListener(\"click\", onClick);\n return () => el.removeEventListener(\"click\", onClick);\n }, [startEditingParam]);\n\n // The chips' \"×\": the listeners shared with the vanilla and Angular editors,\n // attached only while the option is on or a chip that empties the search\n // draws one (the listeners include a non-passive touchstart).\n const listensForChipRemove = showChipRemove || (blockingParamIds?.length ?? 0) > 0;\n useEffect(() => {\n const el = inputRef.current;\n if (!el || !removeParam || !listensForChipRemove) return;\n return attachChipRemove(el, removeParam);\n }, [removeParam, listensForChipRemove]);\n\n // Render segments imperatively into the contentEditable. useLayoutEffect\n // runs before paint so the caret is restored without a one-frame flicker.\n // MUST run before the post-promote refocus + re-edit caret park effects\n // below — keep this declaration order.\n useLayoutEffect(() => {\n const el = inputRef.current;\n if (!el) return;\n renderEditableContent({\n input: el,\n segments: segments as Segment[],\n newParamId,\n editingParamId: editingParam?.id ?? null,\n placeholderText: placeholderText ?? \"\",\n isFocused,\n showChipIcons,\n showChipImages,\n showChipRemove,\n blockingParamIds,\n hintOptions: startingHintOptions(hintSuggestions ?? []),\n });\n }, [\n segments,\n newParamId,\n editingParam,\n placeholderText,\n hintSuggestions,\n isFocused,\n showChipIcons,\n showChipImages,\n showChipRemove,\n blockingParamIds,\n ]);\n\n // The empty box's hint keeps a timer; drop it with the editor.\n useEffect(() => {\n const el = inputRef.current;\n return () => {\n if (el) cancelStartingHint(el);\n };\n }, []);\n\n // After a fresh option selection (newParamId changed), refocus the editor\n // and place the caret at the end of the just-promoted segment. Mirrors the\n // vanilla core's `justSelected` logic in renderInput.ts, including where a\n // pick leaves the editor unfocused (a touch device by default,\n // `focusInputOnSelect`): see `settlePickFocus`.\n useLayoutEffect(() => {\n const previous = lastSeenParamIdRef.current;\n const current = newParamId ?? \"\";\n lastSeenParamIdRef.current = current;\n if (!current || current === previous) return;\n const el = inputRef.current;\n if (!el) return;\n // Every promote path stamps `caretOffset` with the position right after\n // the new param's trailing space, so use it. Read via ref so the effect\n // stays gated on newParamId (not every caret-move).\n const desired = caretOffsetRef.current ?? plainTextLength(el);\n settlePickFocus(el, desired, focusesInputOnSelect(focusModeRef.current));\n }, [newParamId]);\n\n // On re-edit-mode entry, park the caret just BEFORE the bold strong so\n // typing/backspace via the `beforeinput` intercept replaces the param\n // cleanly (instead of inserting mid-letter inside the bold span).\n useLayoutEffect(() => {\n const previous = lastEditingIdRef.current;\n const current = editingParam?.id ?? \"\";\n lastEditingIdRef.current = current;\n if (!current || current === previous || editingAnchor == null) return;\n const el = inputRef.current;\n if (!el) return;\n setCursorOffset(el, editingAnchor);\n }, [editingParam, editingAnchor]);\n\n const fireInput = useCallback(() => {\n const el = inputRef.current;\n if (!el) return;\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 (composingRef.current) {\n handleCompositionText(next);\n return;\n }\n handleTextChange(next);\n }, [handleTextChange, handleCompositionText]);\n\n const handleInputEvent = useCallback(() => {\n lastInputAtRef.current = performance.now();\n fireInput();\n const el = inputRef.current;\n if (el) handleCaretAfterInput(getCursorOffset(el));\n }, [fireInput, handleCaretAfterInput]);\n\n // React's synthetic `onBeforeInput` is wired to the legacy `textInput`\n // event and doesn't reliably fire for `delete*` input types, so we attach\n // a native `beforeinput` listener directly on the editor.\n useEffect(() => {\n const el = inputRef.current;\n if (!el) return;\n const onBeforeInput = (e: Event) => {\n const inputEvent = e as InputEvent;\n const t = inputEvent.inputType;\n if (t === \"insertParagraph\" || t === \"insertLineBreak\" || t === \"insertFromDrop\") {\n e.preventDefault();\n return;\n }\n if (t.startsWith(\"insert\") || t.startsWith(\"delete\")) {\n const replacement = t.startsWith(\"delete\") ? \"\" : (inputEvent.data ?? \"\");\n if (replaceEditingRange(replacement)) {\n e.preventDefault();\n }\n }\n };\n el.addEventListener(\"beforeinput\", onBeforeInput);\n return () => el.removeEventListener(\"beforeinput\", onBeforeInput);\n }, [replaceEditingRange]);\n\n const handleCompositionStart = useCallback(() => {\n composingRef.current = true;\n inputRef.current?.setAttribute(\"data-aia-composing\", \"true\");\n }, []);\n\n const handleCompositionEnd = useCallback(() => {\n composingRef.current = false;\n inputRef.current?.removeAttribute(\"data-aia-composing\");\n fireInput();\n }, [fireInput]);\n\n const handlePaste = useCallback(\n (e: ReactClipboardEvent<HTMLDivElement>) => {\n e.preventDefault();\n const el = inputRef.current;\n if (!el) return;\n const text = (e.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 fireInput();\n },\n [fireInput],\n );\n\n const handleKeyDownReact = useCallback(\n (e: ReactKeyboardEvent<HTMLDivElement>) => handleKeyDown(e),\n [handleKeyDown],\n );\n\n const handleFocus = useCallback(() => setFocused(true), [setFocused]);\n const handleBlur = useCallback(() => setFocused(false), [setFocused]);\n\n const focus = useCallback(() => inputRef.current?.focus(), []);\n const blur = useCallback(() => inputRef.current?.blur(), []);\n const getPlainText = useCallback(() => {\n const el = inputRef.current;\n return el ? extractPlainText(el) : \"\";\n }, []);\n\n const ceMode = supportsPlaintextOnly() ? \"plaintext-only\" : \"true\";\n\n return {\n inputRef,\n editorProps: {\n ref: inputRef,\n contentEditable: ceMode as unknown as boolean,\n suppressContentEditableWarning: true,\n tabIndex: 0,\n role: \"combobox\",\n \"aria-autocomplete\": \"list\",\n \"aria-haspopup\": \"listbox\",\n \"aria-controls\": listboxId,\n \"aria-expanded\": isDropdownOpen,\n \"aria-activedescendant\": activeDescendantId,\n spellCheck: true,\n enterKeyHint: \"send\",\n onInput: handleInputEvent,\n onKeyDown: handleKeyDownReact,\n onCompositionStart: handleCompositionStart,\n onCompositionEnd: handleCompositionEnd,\n onPaste: handlePaste,\n onFocus: handleFocus,\n onBlur: handleBlur,\n },\n getPlainText,\n focus,\n blur,\n };\n}\n"],"mappings":"AACA,OACE,qBAAAA,GAGA,WAAAC,GACA,WAAAC,GAGA,uBAAAC,GACA,yBAAAC,GAGA,6BAAAC,GAEA,iBAAAC,GAGA,wBAAAC,GACA,cAAAC,GACA,mBAAAC,GACA,qBAAAC,GACA,eAAAC,GAGA,cAAAC,GACA,WAAAC,GACA,kBAAAC,GAGA,qBAAAC,GACA,cAAAC,GACA,oBAAAC,GACA,kBAAAC,GACA,sBAAAC,GACA,kBAAAC,GAEA,eAAAC,GACA,6BAAAC,GACA,uBAAAC,GACA,aAAAC,GACA,kBAAAC,GACA,uBAAAC,GACA,aAAAC,GAGA,0BAAAC,GACA,uBAAAC,GACA,4BAAAC,GACA,yBAAAC,GACA,oBAAAC,GACA,iBAAAC,GACA,oBAAAC,GACA,kBAAAC,GACA,qBAAAC,OACK,sCCvDP,OACE,cAAAC,GACA,eAAAC,GACA,aAAAC,GACA,uBAAAC,GACA,mBAAAC,GACA,WAAAC,GACA,UAAAC,OACK,QCRP,GAAI,OAAO,SAAa,KAAe,CAAC,SAAS,eAAe,mBAAmB,EAAG,CACpF,IAAMC,EAAI,SAAS,cAAc,OAAO,EACxCA,EAAE,GAAK,oBACPA,EAAE,YAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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UAAWqD,GACX,eAAgBlH,GAChB,qBAAsBC,GACtB,kBAAmBC,GACnB,gBAAiB0G,GAAcC,GAAsB,OACrD,UAAW7F,GACb,EAGA1D,GAAC,OAAI,UAAW6J,GAAO,aAAc,yBAAuB,GAAG,QAASL,GACtE,UAAAxJ,GAAC,OAAI,IAAK+D,GAAe,UAAW8F,GAAO,WAAY,kBAAgB,GACrE,UAAA9J,GAAC,OAAK,GAAG8H,GAAa,UAAWgC,GAAO,MAAO,iBAAe,GAAG,EAChEF,KAAoBrE,IAAaX,GAAgB,OAAS,IACzD5E,GAAC,QACC,IAAK+D,GACL,UAAW+F,GAAO,kBAClB,+BAA6B,GAE7B,SAAA9J,GAACgK,GAAA,CACC,MAAOpF,GACP,gBAAiB,EACjB,eAAgBS,EAChB,aAAcR,GACd,QAASU,GACX,EACF,GAEJ,EACC9B,IAAiB,KAAO,KAAOA,IAAiB,OAC/CzD,GAACiK,GAAA,CACC,SAAU,CAAClB,GACX,MAAOA,IAAavD,GACpB,KAAM6B,GACN,QAASiC,GACT,MAAOY,GAAapJ,CAAQ,EAAE,OAChC,EAIAd,GAAC,QACC,kBAAgB,GAChB,uBAAqB,GAGrB,wBAAuBqH,GAAe,OAAS,OAC/C,YAAWA,GAAe,GAAO,OACjC,UAAWyC,GAAO,WAClB,QAAUJ,GAAM,CACTX,KACLW,EAAE,gBAAgB,EAClBJ,GAAmB,EACrB,EAEC,SAAA7F,EACH,GAEJ,GACF,CAEJ,CACF","names":["buildSubmitResult","cellDay","cellIso","DATE_RANGE_META_END","DATE_RANGE_META_START","DEFAULT_OPTION_COUNT_UNIT","dateCellMarks","focusesInputOnSelect","formatDate","formatDateRange","formatOptionCount","formatPlace","formatTime","isoDate","isTouchPrimary","LOCATION_META_KEY","monthLabel","optionCountLabel","optionHasImage","optionImageSources","optionImageSrc","optionLabel","optionsShowLeadingVisuals","PRODUCT_PATH_PREFIX","parseDate","parseLooseDate","parseLooseDateRange","parseTime","productFromMatchedItem","productImageSources","productsFromCustomFields","sanitizeOptionIconSvg","selectedRangeFor","TIME_META_KEY","visibleDateRange","WEEKDAY_LABELS","withSkippedParams","forwardRef","useCallback","useEffect","useImperativeHandle","useLayoutEffect","useMemo","useRef","s","AIAutocomplete_module_css_default","attachScrollArrow","attachViewportFit","containScroll","dateFloorFor","destroyPanelMorph","findMultiSelectDone","fitMultiSelectDone","hasSkippablePill","isCalendarFormat","labelTraditionalAutocomplete","panelMorphKey","queryLive","settlePanelMorph","syncPanelHug","uiStringsFor","useEffect","useLayoutEffect","useRef","useState","s","s","AIAutocompleteDropdown_module_css_default","cellDay","cellIso","dateCellMarks","isDimmedDay","isoDate","monthLabel","visibleDateRange","WEEKDAY_LABELS","useState","s","DateGrid_module_css_default","jsx","jsxs","WEEKDAY_KEYS","DateGrid","options","activeIndex","listboxId","view","selection","onSelect","onHighlight","onUnhighlight","onPreviousMonth","onNextMonth","today","isoDate","range","visibleDateRange","cellIso","DateGrid_module_css_default","e","monthLabel","WEEKDAY_LABELS","label","i","option","DateCell","isDimmedDay","dateCellMarks","id","index","isHighlighted","isToday","isPast","marks","pressed","setPressed","useState","day","cellDay","handleSelect","className","ATTRIBUTION_URL","buildAttributionUrl","getFooterHint","uiStringsFor","useEffect","useState","s","jsx","Cluster","gap","align","justify","noWrap","inline","className","children","rest","style","props","s","DropdownFooter_module_css_default","jsx","jsxs","DropdownFooter","isOptionHighlighted","isInputEmpty","strings","uiStringsFor","key","hint","getFooterHint","brandHref","setBrandHref","useState","ATTRIBUTION_URL","useEffect","buildAttributionUrl","DropdownFooter_module_css_default","Cluster","useEffect","useLayoutEffect","useRef","s","LocationField_module_css_default","jsx","jsxs","fieldSeq","activeElementFor","node","selectionFor","captureCaret","el","selection","range","focusWithCaret","target","saved","PIN","LocationField_module_css_default","SEARCH","LocationField","view","searchLabel","noResultsLabel","useTypedLabel","widgetFocused","reediting","visible","interactive","onQuery","onMove","onCommit","onFocusChange","inputRef","useRef","rootRef","fieldRef","returnTo","returnRange","returning","declined","wasReediting","claimed","widgetFocusedRef","onFocusChangeRef","reportFocus","focused","hasFocus","input","rememberReturn","root","active","rememberKeyboardReturn","from","fieldId","rowIdPrefix","useEffect","handBack","useLayoutEffect","answered","trimmed","highlightedId","body","place","index","e","isSmartSuggestion","isTraditionalAutocompleteSuggestion","SMART_SUGGESTION_SPARKLE_SVG","s","ParamPill_module_css_default","Fragment","jsx","jsxs","PARAM_PILL_OPACITY","ParamPill","label","state","active","rounded","loading","smartSuggestion","completionHeader","onClick","className","ParamPill_module_css_default","e","SMART_SUGGESTION_SPARKLE_SVG","s","PillList_module_css_default","jsx","FALLBACK_SKELETON_WIDTHS","pillStateForIndex","index","PillList","pills","activePillIndex","onSelectPill","activeSelected","rounded","loading","PillList_module_css_default","w","i","ParamPill_module_css_default","PARAM_PILL_OPACITY","pill","selected","ParamPill","isSmartSuggestion","isTraditionalAutocompleteSuggestion","attachProductRowWheel","productImageSources","productImageSrc","productInitial","productPhotoFill","uiStringsFor","useEffect","useRef","useState","s","ProductStrip_module_css_default","jsx","jsxs","ProductStrip","products","listboxId","onSelect","busyProductId","onAddToCart","onFocusChange","focusable","loading","layout","imageFallback","showVendor","strings","uiStringsFor","hasProducts","rowRef","useRef","useEffect","row","attachProductRowWheel","labelId","ProductStrip_module_css_default","product","i","ProductCard","id","busy","soldOut","addToCart","hasCart","photoFill","setPhotoFill","useState","handleBlur","e","handleClick","ProductMedia","productImageSources","productImageSrc","CartButton","cartIdentity","field","label","onFocus","onBlur","state","setState","stateRef","productRef","mounted","set","next","press","pending","error","sources","title","fallback","onPhotoFill","failed","setFailed","src","hasImage","loadedSrc","setLoadedSrc","showInitial","productPhotoFill","count","productInitial","isOptionsGridMobileViewport","measureOptionsGrid","needsOptionsGridMeasurement","OPTIONS_GRID_MOBILE_QUERY","optionEnterDelayMs","optionsShowLeadingVisuals","planOptionsGrid","pointerMayHighlight","releasePanelHug","sameOptionRows","syncHighlightScroll","syncPanelHug","useEffect","useLayoutEffect","useRef","useState","optionsGridTemplateColumns","useLayoutEffect","useRef","s","jsx","Grid","min","max","gap","scroll","maxHeight","scrollResetKey","cols","template","innerRef","className","children","rest","gridRef","useRef","useLayoutEffect","el","style","optionsGridTemplateColumns","clearPanelMorphPressLook","formatOptionCount","highlightParts","isMultiSelectToggleTap","OPTION_ENTER_DELAY_VAR","optionImageSources","optionLabel","sanitizeOptionIconSvg","useEffect","useMemo","useRef","useState","s","SuggestionItem_module_css_default","Fragment","jsx","jsxs","PRESS_HOLD_MS","REPEAT_PICK_MS","SuggestionItem","option","isHighlighted","checked","onSelect","onHighlight","onUnhighlight","id","loading","showIcon","showImage","showCount","scrollHint","enterDelayMs","enterDelay","useState","pressed","setPressed","imageSources","optionImageSources","imageSrc","failedSrcs","setFailedSrcs","shownSrc","src","collage","url","collageLoaded","setCollageLoaded","loadedSrc","setLoadedSrc","iconHtml","useMemo","sanitizeOptionIconSvg","countLabel","formatOptionCount","timerRef","useRef","rowRef","lastPickRef","useEffect","handleSelect","event","row","commit","isMultiSelectToggleTap","tick","now","clearPanelMorphPressLook","className","SuggestionItem_module_css_default","OPTION_ENTER_DELAY_VAR","e","failed","highlightParts","optionLabel","part","index","jsx","useIsMobile","isMobile","setIsMobile","useState","isOptionsGridMobileViewport","useEffect","mq","OPTIONS_GRID_MOBILE_QUERY","onChange","SuggestionGrid","options","activeIndex","picked","onSelect","onHighlight","onUnhighlight","listboxId","loading","groupKey","optionsPosition","showIcons","showImages","showCounts","gridEl","useRef","measuredPlan","setMeasuredPlan","measuredRows","useLayoutEffect","sameOptionRows","el","shouldMeasure","needsOptionsGridMeasurement","panel","releasePanelHug","measured","measureOptionsGrid","planOptionsGrid","plan","syncPanelHug","shownIndex","syncHighlightScroll","leadingVisuals","optionsShowLeadingVisuals","Grid","option","i","SuggestionItem","event","pointerMayHighlight","optionEnterDelayMs","formatTime","TIME_WHEEL_COLUMNS","TIME_WHEEL_ROW_HEIGHT","timeWheelIndex","timeWheelIndexFromScroll","timeWheelRows","withTimeWheelIndex","Fragment","useEffect","useLayoutEffect","useRef","s","TimeWheel_module_css_default","jsx","jsxs","SCROLL_SETTLE_MS","TimeWheel","view","label","doneLabel","interactive","onTimeChange","onTimeCommit","TimeWheel_module_css_default","e","formatTime","TIME_WHEEL_COLUMNS","column","Fragment","WheelColumn","minutes","ref","useRef","syncedTop","settle","latest","index","timeWheelIndex","useLayoutEffect","el","top","TIME_WHEEL_ROW_HEIGHT","useEffect","settleNow","current","next","timeWheelIndexFromScroll","withTimeWheelIndex","onScroll","timeWheelRows","row","i","s","jsx","Stack","space","align","className","children","rest","style","jsx","jsxs","useIsoLayoutEffect","useEffect","useLayoutEffect","FALLBACK_SKELETON_BAR_WIDTHS","NOOP_PRODUCT_SELECT","NOOP_MONTH","NOOP_TIME_CHANGE","_minutes","NOOP_TIME_COMMIT","NOOP_LOCATION_QUERY","_query","NOOP_LOCATION_MOVE","_delta","NOOP_LOCATION_COMMIT","_index","NOOP_LOCATION_FOCUS","_focused","useResolvedMode","mode","prefersDark","systemDark","setSystemDark","useState","mq","onChange","useScrollArrow","rootRef","buttonRef","boundRef","useRef","root","button","grid","queryLive","attachScrollArrow","useViewportFit","isVisible","visibleRef","fitRef","attachViewportFit","AIAutocompleteDropdown","suggestions","activeIndex","onSelect","onHighlight","onUnhighlight","isOpen","id","className","pills","onPillClick","showPills","onSkip","showSkipButton","showOptionIcons","showOptionImages","showOptionCounts","skipDisabled","activeSelected","isLoading","skeletonExiting","isInputEmpty","language","products","onProductSelect","onProductAddToCart","onProductFocusChange","productsLayout","productImageFallback","showProductVendor","formatType","dateView","selectedDateIso","selectedDateRange","dateRangeStart","dateReferences","onPreviousMonth","onNextMonth","timeView","multiSelectView","onMultiSelectCommit","onSeeAllResults","seeAllBusy","busyProductId","fullWidth","onTimeChange","onTimeCommit","locationView","isReediting","onLocationQuery","onLocationMove","onLocationCommit","onLocationFocusChange","isFocused","optionsPosition","resolvedMode","selfScope","scrollArrowRef","containScroll","liveOptions","liveHasRealPills","liveHasProducts","liveHasTimeWheel","liveHasLocationField","fitMultiSelectDone","findMultiSelectDone","syncPanelHug","snapshot","lastVisibleRef","content","strings","uiStringsFor","activeSuggestion","options","isOptionHighlighted","shownPills","labelTraditionalAutocomplete","hasRealPills","showsRealPills","showsLoadingPills","showsPillBar","showsSkip","hasSkippablePill","activePillLabel","isDate","isCalendarFormat","showsOptions","showsDateGrid","showsTimeWheel","showsLocationField","showsFallbackSkeleton","stripProducts","morphKey","panelMorphKey","settlePanelMorph","el","destroyPanelMorph","AIAutocompleteDropdown_module_css_default","e","Stack","Cluster","PillList","SuggestionGrid","event","DateGrid","dateFloorFor","TimeWheel","LocationField","w","ProductStrip","DropdownFooter","buildSubmitResult","focusEditorFromTap","ModeController","setCursorOffset","uiStringsFor","watchEditorHeight","uiStringsFor","s","SubmitButton_module_css_default","jsx","SubmitButton","disabled","ready","busy","onClick","label","uiStringsFor","SubmitButton_module_css_default","e","CoreAIAutocomplete","dateSelectionFor","dropdownPillsFor","editingSuggestion","HANDOFF_NOT_HANDLED","identifiedParamLabel","withoutTraditionalAutocomplete","useCallback","useEffect","useMemo","useRef","useState","useRef","useOptionOverridesProxy","optionOverrides","liveRef","key","proxyRef","overrides","type","forward","query","signal","suggestion","fn","useRef","useProductsProxy","products","productsRef","proxyRef","query","signal","config","raw","enabled","EMPTY_RESULT","EMPTY_STATE","useAIAutocomplete","onSubmit","onResult","onError","optionOverrides","maskCompletedText","apiConfig","additionalContext","language","currency","productId","visitorId","analyticsConsent","columns","dropdownTrigger","optionsPosition","closeDropdownOnBlur","focusInputOnSelect","startingState","prependPlaceholder","allOption","showNonTappableOptions","locationSearch","showOptionIcons","showOptionImages","showOptionCounts","showSkipButton","showProducts","submitProgress","awaitAnswerOnSubmit","submitAnswerTimeoutMs","productImageFallback","showProductVendor","onFocus","onBlur","controlledValue","controlledParams","onChangeProp","onParamsChange","products","mapProducts","onProductSelect","onProductAddToCart","source","setCursor","instanceRef","useRef","coreState","setCoreState","useState","onSubmitRef","onResultRef","onErrorRef","onChangeRef","onParamsChangeRef","onFocusRef","onBlurRef","setCursorRef","onProductSelectRef","onProductAddToCartRef","visitorIdRef","resolveVisitorId","v","hasVisitorId","analyticsConsentRef","readAnalyticsConsent","c","productsProxy","useProductsProxy","mapperRef","forwardMapper","cards","items","mapper","mapperProxy","overridesProxy","useOptionOverridesProxy","useEffect","instance","CoreAIAutocomplete","args","product","HANDOFF_NOT_HANDLED","offset","unsub","state","mountedVisitorIdRef","consentKey","mountedConsentKeyRef","apiConfigJson","additionalContextJson","productsMountedRef","actionsRef","value","e","native","focused","paramId","replacement","index","result","returned","option","how","minutes","query","delta","actions","handleChange","useCallback","raw","newValue","handleKeyDownTextarea","text","completedParams","actionableSuggestions","activeSuggestion","pillSuggestions","useMemo","withoutTraditionalAutocomplete","listboxId","activeDescendantId","editingParam","editingIdentified","dropdownPill","editingSuggestion","identifiedParamLabel","dropdownActivePill","dropdownPills","dropdownPillsFor","dateSelection","dateSelectionFor","uiLoading","attachChipRemove","cancelStartingHint","chipIdFromTap","extractPlainText","focusesInputOnSelect","getCursorOffset","keepCaretOnChip","plainTextLength","renderEditableContent","setCursorOffset","settlePickFocus","startingHintOptions","useCallback","useEffect","useLayoutEffect","useRef","plaintextOnlyCache","supportsPlaintextOnly","probe","useContentEditableEditor","opts","segments","showChipIcons","showChipImages","showChipRemove","blockingParamIds","focusInputOnSelect","removeParam","newParamId","editingParam","editingIdentified","editingAnchor","caretOffset","placeholderText","hintSuggestions","isFocused","isDropdownOpen","listboxId","activeDescendantId","autoFocus","handleTextChange","handleCompositionText","handleKeyDown","handleCaretAfterInput","handleCaretMove","startEditingParam","replaceEditingRange","setFocused","inputRef","composingRef","lastSeenParamIdRef","lastEditingIdRef","caretOffsetRef","lastInputAtRef","focusModeRef","el","doc","sel","caretInside","range","onSelectionChange","anchor","startEl","enclosing","openChipId","onClick","e","id","listensForChipRemove","previous","current","desired","fireInput","raw","next","handleInputEvent","onBeforeInput","inputEvent","t","replacement","handleCompositionStart","handleCompositionEnd","handlePaste","text","node","handleKeyDownReact","handleFocus","handleBlur","focus","blur","getPlainText","ceMode","jsx","jsxs","resolveInitialMode","mode","AIAutocomplete","forwardRef","onSubmit","onResult","onError","optionOverrides","maskCompletedText","className","apiConfig","additionalContext","language","currency","productId","visitorId","analyticsConsent","columns","pillPlacement","optionsPosition","animations","optionsStyle","dropdownTrigger","closeDropdownOnBlur","focusInputOnSelect","startingState","prependPlaceholder","allOption","showNonTappableOptions","locationSearch","showOptionIcons","showChipIcons","showChipImages","showChipRemove","showOptionImages","showOptionCounts","showSkipButton","showProducts","submitProgress","awaitAnswerOnSubmit","submitAnswerTimeoutMs","productsLayout","productImageFallback","showProductVendor","autoFocus","onFocus","onBlur","value","controlledParams","onChangeProp","onParamsChange","products","mapProducts","onProductSelect","onProductAddToCart","submitButton","resetOnSubmit","seeAllResults","ref","containerRef","useRef","pillContainerRef","editorAreaRef","handleSubmitRef","modeControllerRef","editorInputRefHolder","useEffect","el","ModeController","handleSetCursor","useCallback","offset","setCursorOffset","completedParams","suggestionPills","setActivePill","skipActivePill","segments","newParamId","clearNewParamId","placeholderText","isFocused","isDropdownOpen","isActivePillSelected","blockingChips","isLoading","isReady","activeIndex","listboxId","handleTextChange","handleCompositionText","handleKeyDown","setFocused","editingParam","editingIdentified","editingAnchor","caretOffset","startEditingParam","removeParam","handleCaretAfterInput","handleCaretMove","replaceEditingRange","dropdownProps","reset","refreshProducts","prepareSubmit","getState","getResult","awaitSubmitResult","recordSubmit","holdSubmit","endSubmitProgress","getSearchId","getVisitorId","refreshAnalyticsConsent","isSubmitting","useAIAutocomplete","result","t","blockingParamIds","useMemo","chip","activeDescendantId","inputRef","editorProps","focus","blur","getPlainText","useContentEditableEditor","useLayoutEffect","container","editor","update","inner","cRect","eRect","ro","area","watchEditorHeight","useImperativeHandle","m","canSubmit","deliverSubmit","fromButton","answered","state","buildSubmitResult","returned","handleButtonSubmit","showsSeeAll","handleSeeAllResults","handleWrapperClick","e","focusEditorFromTap","showInlinePills","showDropdownPills","AIAutocomplete_module_css_default","AIAutocompleteDropdown","PillList","SubmitButton","uiStringsFor"]}