@magicx-eng/ai-autocomplete-react 0.51.0 → 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/REFERENCE.md CHANGED
@@ -484,7 +484,8 @@ other option list (a store's branches, say), and the search never runs.
484
484
 
485
485
  | Input | Result |
486
486
  |---|---|
487
- | The pill coming up while the user is typing | Focus moves into the search field, so the place is typed straight into it |
487
+ | The pill coming up while the user is typing | The caret stays in the input; a click (or <kbd>Shift</kbd>+<kbd>Tab</kbd>) moves it into the search field |
488
+ | Tapping a place already chosen | Re-opens the field focused, its answer selected |
488
489
  | Typing in the field | Searches after a short pause (2 characters or more) |
489
490
  | <kbd>↓</kbd> / <kbd>↑</kbd> | Moves through the places found |
490
491
  | <kbd>Enter</kbd> or a tap on a place | Commits it. With nothing found, Enter commits the typed text as written. So does Enter pressed before the search answers (within the 250ms pause): nothing is highlighted yet |
@@ -591,7 +592,8 @@ The full input also accepts `--aia-input-radius` and `--aia-written-text-font-we
591
592
  | `--aia-multi-done-width` | as wide as the widest option | same | Width of the multi-select Done button; set `100%` for full width. |
592
593
  | `--aia-multi-done-min-width` | `120px` | `120px` | Narrowest the multi-select Done button gets. |
593
594
  | `--aia-time-done-bg` / `--aia-time-done-bg-hover` / `--aia-time-done-color` | `--aia-done-*` | `--aia-done-*` | Override the time wheel's Done button alone. |
594
- | `--aia-location-field-bg` | `--aia-streak-rgb` at 6% (indigo) | `--aia-streak-rgb` at 6% (white) | The location search field. |
595
+ | `--aia-location-field-bg-idle` | `transparent` | `transparent` | The location search field at rest. |
596
+ | `--aia-location-field-bg` | `--aia-streak-rgb` at 6% (indigo) | `--aia-streak-rgb` at 6% (white) | The location search field on hover or focus. |
595
597
  | `--aia-location-field-radius` | `10px` | `10px` | Corner radius of the location search field. |
596
598
  | `--aia-location-font-size` | `15px` | `15px` | The location field's text and the place names. |
597
599
  | `--aia-location-row-bg-highlighted` | `--aia-streak-rgb` at 8% (indigo) | `--aia-streak-rgb` at 8% (white) | The highlighted (or hovered) place. |
package/dist/index.d.mts CHANGED
@@ -690,6 +690,8 @@ interface AIAutocompleteDropdownProps {
690
690
  onTimeCommit?: () => void;
691
691
  /** What the location search field shows. Null unless `formatType` is `"location"`. Provided by `dropdownProps` from the hook. */
692
692
  locationView?: LocationView | null;
693
+ /** True while a saved answer is being re-edited; a location field then takes focus with it selected. Provided by `dropdownProps` from the hook. */
694
+ isReediting?: boolean;
693
695
  /** The location field's text changed. Provided by `dropdownProps` from the hook. */
694
696
  onLocationQuery?: (query: string) => void;
695
697
  /** ArrowDown / ArrowUp in the location field. Provided by `dropdownProps` from the hook. */
@@ -718,7 +720,7 @@ interface AIAutocompleteDropdownProps {
718
720
 
719
721
  declare const AIAutocomplete: react.ForwardRefExoticComponent<AIAutocompleteProps & react.RefAttributes<AIAutocompleteHandle>>;
720
722
 
721
- declare function 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, formatType, dateView, selectedDateIso, selectedDateRange, dateRangeStart, onPreviousMonth, onNextMonth, timeView, multiSelectView, onMultiSelectCommit, onTimeChange, onTimeCommit, locationView, onLocationQuery, onLocationMove, onLocationCommit, onLocationFocusChange, isFocused, optionsPosition, mode, }: AIAutocompleteDropdownProps): react_jsx_runtime.JSX.Element;
723
+ declare function 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, formatType, dateView, selectedDateIso, selectedDateRange, dateRangeStart, onPreviousMonth, onNextMonth, timeView, multiSelectView, onMultiSelectCommit, onTimeChange, onTimeCommit, locationView, isReediting, onLocationQuery, onLocationMove, onLocationCommit, onLocationFocusChange, isFocused, optionsPosition, mode, }: AIAutocompleteDropdownProps): react_jsx_runtime.JSX.Element;
722
724
 
723
725
  declare function useAIAutocomplete({ onSubmit, onResult, onError, optionOverrides, maskCompletedText, apiConfig, additionalContext, language, currency, productId, visitorId, columns, dropdownTrigger, optionsPosition, closeDropdownOnBlur, prependPlaceholder, showNonTappableOptions, locationSearch, showOptionIcons, showOptionImages, showOptionCounts, showSkipButton, showProducts, productImageFallback, onFocus, onBlur, value: controlledValue, completedParams: controlledParams, onChange: onChangeProp, onParamsChange, products, mapProducts, onProductSelect, onProductAddToCart, source, setCursor, }: UseAIAutocompleteOptions): UseAIAutocompleteReturn;
724
726
 
package/dist/index.d.ts CHANGED
@@ -690,6 +690,8 @@ interface AIAutocompleteDropdownProps {
690
690
  onTimeCommit?: () => void;
691
691
  /** What the location search field shows. Null unless `formatType` is `"location"`. Provided by `dropdownProps` from the hook. */
692
692
  locationView?: LocationView | null;
693
+ /** True while a saved answer is being re-edited; a location field then takes focus with it selected. Provided by `dropdownProps` from the hook. */
694
+ isReediting?: boolean;
693
695
  /** The location field's text changed. Provided by `dropdownProps` from the hook. */
694
696
  onLocationQuery?: (query: string) => void;
695
697
  /** ArrowDown / ArrowUp in the location field. Provided by `dropdownProps` from the hook. */
@@ -718,7 +720,7 @@ interface AIAutocompleteDropdownProps {
718
720
 
719
721
  declare const AIAutocomplete: react.ForwardRefExoticComponent<AIAutocompleteProps & react.RefAttributes<AIAutocompleteHandle>>;
720
722
 
721
- declare function 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, formatType, dateView, selectedDateIso, selectedDateRange, dateRangeStart, onPreviousMonth, onNextMonth, timeView, multiSelectView, onMultiSelectCommit, onTimeChange, onTimeCommit, locationView, onLocationQuery, onLocationMove, onLocationCommit, onLocationFocusChange, isFocused, optionsPosition, mode, }: AIAutocompleteDropdownProps): react_jsx_runtime.JSX.Element;
723
+ declare function 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, formatType, dateView, selectedDateIso, selectedDateRange, dateRangeStart, onPreviousMonth, onNextMonth, timeView, multiSelectView, onMultiSelectCommit, onTimeChange, onTimeCommit, locationView, isReediting, onLocationQuery, onLocationMove, onLocationCommit, onLocationFocusChange, isFocused, optionsPosition, mode, }: AIAutocompleteDropdownProps): react_jsx_runtime.JSX.Element;
722
724
 
723
725
  declare function useAIAutocomplete({ onSubmit, onResult, onError, optionOverrides, maskCompletedText, apiConfig, additionalContext, language, currency, productId, visitorId, columns, dropdownTrigger, optionsPosition, closeDropdownOnBlur, prependPlaceholder, showNonTappableOptions, locationSearch, showOptionIcons, showOptionImages, showOptionCounts, showSkipButton, showProducts, productImageFallback, onFocus, onBlur, value: controlledValue, completedParams: controlledParams, onChange: onChangeProp, onParamsChange, products, mapProducts, onProductSelect, onProductAddToCart, source, setCursor, }: UseAIAutocompleteOptions): UseAIAutocompleteReturn;
724
726
 
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Ot=Object.defineProperty;var Sa=Object.getOwnPropertyDescriptor;var Ta=Object.getOwnPropertyNames;var Pa=Object.prototype.hasOwnProperty;var Ia=(e,i)=>{for(var a in i)Ot(e,a,{get:i[a],enumerable:!0})},Ea=(e,i,a,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of Ta(i))!Pa.call(e,n)&&n!==a&&Ot(e,n,{get:()=>i[n],enumerable:!(o=Sa(i,n))||o.enumerable});return e};var Aa=e=>Ea(Ot({},"__esModule",{value:!0}),e);var oi={};Ia(oi,{AIAutocomplete:()=>fa,AIAutocompleteDropdown:()=>Tt,DATE_RANGE_META_END:()=>l.DATE_RANGE_META_END,DATE_RANGE_META_START:()=>l.DATE_RANGE_META_START,DEFAULT_OPTION_COUNT_UNIT:()=>l.DEFAULT_OPTION_COUNT_UNIT,LOCATION_META_KEY:()=>l.LOCATION_META_KEY,PRODUCT_PATH_PREFIX:()=>l.PRODUCT_PATH_PREFIX,TIME_META_KEY:()=>l.TIME_META_KEY,WEEKDAY_LABELS:()=>l.WEEKDAY_LABELS,buildSubmitResult:()=>l.buildSubmitResult,cellDay:()=>l.cellDay,cellIso:()=>l.cellIso,dateCellMarks:()=>l.dateCellMarks,formatDate:()=>l.formatDate,formatDateRange:()=>l.formatDateRange,formatOptionCount:()=>l.formatOptionCount,formatPlace:()=>l.formatPlace,formatTime:()=>l.formatTime,isoDate:()=>l.isoDate,monthLabel:()=>l.monthLabel,optionCountLabel:()=>l.optionCountLabel,optionHasImage:()=>l.optionHasImage,optionImageSources:()=>l.optionImageSources,optionImageSrc:()=>l.optionImageSrc,optionLabel:()=>l.optionLabel,optionsShowLeadingVisuals:()=>l.optionsShowLeadingVisuals,parseDate:()=>l.parseDate,parseLooseDate:()=>l.parseLooseDate,parseLooseDateRange:()=>l.parseLooseDateRange,parseTime:()=>l.parseTime,productFromMatchedItem:()=>l.productFromMatchedItem,productImageSources:()=>l.productImageSources,productsFromCustomFields:()=>l.productsFromCustomFields,sanitizeOptionIconSvg:()=>l.sanitizeOptionIconSvg,selectedRangeFor:()=>l.selectedRangeFor,useAIAutocomplete:()=>It,visibleDateRange:()=>l.visibleDateRange,withSkippedParams:()=>l.withSkippedParams});module.exports=Aa(oi);var l=require("@magicx-eng/ai-autocomplete-vanilla");var V=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-67791514")){let e=document.createElement("style");e.id="ac-style-67791514",e.textContent=`.aia-container-KKjFU {
1
+ "use strict";var Lt=Object.defineProperty;var Ta=Object.getOwnPropertyDescriptor;var Pa=Object.getOwnPropertyNames;var Ia=Object.prototype.hasOwnProperty;var Ea=(e,a)=>{for(var t in a)Lt(e,t,{get:a[t],enumerable:!0})},Aa=(e,a,t,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let o of Pa(a))!Ia.call(e,o)&&o!==t&&Lt(e,o,{get:()=>a[o],enumerable:!(i=Ta(a,o))||i.enumerable});return e};var Ra=e=>Aa(Lt({},"__esModule",{value:!0}),e);var oi={};Ea(oi,{AIAutocomplete:()=>ba,AIAutocompleteDropdown:()=>Tt,DATE_RANGE_META_END:()=>l.DATE_RANGE_META_END,DATE_RANGE_META_START:()=>l.DATE_RANGE_META_START,DEFAULT_OPTION_COUNT_UNIT:()=>l.DEFAULT_OPTION_COUNT_UNIT,LOCATION_META_KEY:()=>l.LOCATION_META_KEY,PRODUCT_PATH_PREFIX:()=>l.PRODUCT_PATH_PREFIX,TIME_META_KEY:()=>l.TIME_META_KEY,WEEKDAY_LABELS:()=>l.WEEKDAY_LABELS,buildSubmitResult:()=>l.buildSubmitResult,cellDay:()=>l.cellDay,cellIso:()=>l.cellIso,dateCellMarks:()=>l.dateCellMarks,formatDate:()=>l.formatDate,formatDateRange:()=>l.formatDateRange,formatOptionCount:()=>l.formatOptionCount,formatPlace:()=>l.formatPlace,formatTime:()=>l.formatTime,isoDate:()=>l.isoDate,monthLabel:()=>l.monthLabel,optionCountLabel:()=>l.optionCountLabel,optionHasImage:()=>l.optionHasImage,optionImageSources:()=>l.optionImageSources,optionImageSrc:()=>l.optionImageSrc,optionLabel:()=>l.optionLabel,optionsShowLeadingVisuals:()=>l.optionsShowLeadingVisuals,parseDate:()=>l.parseDate,parseLooseDate:()=>l.parseLooseDate,parseLooseDateRange:()=>l.parseLooseDateRange,parseTime:()=>l.parseTime,productFromMatchedItem:()=>l.productFromMatchedItem,productImageSources:()=>l.productImageSources,productsFromCustomFields:()=>l.productsFromCustomFields,sanitizeOptionIconSvg:()=>l.sanitizeOptionIconSvg,selectedRangeFor:()=>l.selectedRangeFor,useAIAutocomplete:()=>It,visibleDateRange:()=>l.visibleDateRange,withSkippedParams:()=>l.withSkippedParams});module.exports=Ra(oi);var l=require("@magicx-eng/ai-autocomplete-vanilla");var U=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-67791514")){let e=document.createElement("style");e.id="ac-style-67791514",e.textContent=`.aia-container-KKjFU {
2
2
  position: relative;
3
3
  /* Inherits the host page's font by default. Consumers can pin a specific
4
4
  font on the library via \`--aia-font-family: 'Custom Font'\` without
@@ -346,7 +346,7 @@
346
346
  transition: none;
347
347
  }
348
348
  }
349
- `,document.head.appendChild(e)}var rt={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"};var z=require("@magicx-eng/ai-autocomplete-vanilla"),_=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-0ae03977")){let e=document.createElement("style");e.id="ac-style-0ae03977",e.textContent=`/*
349
+ `,document.head.appendChild(e)}var nt={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"};var M=require("@magicx-eng/ai-autocomplete-vanilla"),V=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-0ae03977")){let e=document.createElement("style");e.id="ac-style-0ae03977",e.textContent=`/*
350
350
  * Built-in appearance defaults \u2014 zero specificity via :where().
351
351
  * Consumer CSS always wins without !important.
352
352
  *
@@ -1402,7 +1402,7 @@
1402
1402
  /* biome-ignore lint/complexity/noImportantStyles: a row's own pointer-events: auto must not make the leaving copy catch taps */
1403
1403
  pointer-events: none !important;
1404
1404
  }
1405
- `,document.head.appendChild(e)}var Oe={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",skeletonBarsIn:"aia-skeletonBarsIn-BdPrL",skeletonBarsOut:"aia-skeletonBarsOut-TqKeD",skeletonBar:"aia-skeletonBar-O3xIx",aiaSkeletonPulse:"aia-aiaSkeletonPulse-G8W7q",multiDone:"aia-multiDone-y12U7"};var Y=require("@magicx-eng/ai-autocomplete-vanilla"),_t=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-f687bd03")){let e=document.createElement("style");e.id="ac-style-f687bd03",e.textContent=`/* --- Datepicker (replaces the options grid for date suggestions) ---
1405
+ `,document.head.appendChild(e)}var Fe={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",skeletonBarsIn:"aia-skeletonBarsIn-BdPrL",skeletonBarsOut:"aia-skeletonBarsOut-TqKeD",skeletonBar:"aia-skeletonBar-O3xIx",aiaSkeletonPulse:"aia-aiaSkeletonPulse-G8W7q",multiDone:"aia-multiDone-y12U7"};var $=require("@magicx-eng/ai-autocomplete-vanilla"),_t=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-f687bd03")){let e=document.createElement("style");e.id="ac-style-f687bd03",e.textContent=`/* --- Datepicker (replaces the options grid for date suggestions) ---
1406
1406
 
1407
1407
  One of three hand-maintained copies (vanilla styles.css, this file, Angular's
1408
1408
  date-grid.component.css). Only the class-naming layer differs \u2014 the
@@ -1589,7 +1589,7 @@
1589
1589
  opacity: 0.8;
1590
1590
  background: rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);
1591
1591
  }
1592
- `,document.head.appendChild(e)}var Q={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",pressed:"aia-pressed-bEyyN"};var fe=require("react/jsx-runtime"),La=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function Vt({options:e,activeIndex:i,listboxId:a,view:o,selection:n,onSelect:s,onHighlight:r,onUnhighlight:d,onPreviousMonth:g,onNextMonth:w}){let y=(0,Y.isoDate)(new Date),m=(0,Y.visibleDateRange)({pendingStart:n.rangeStart,highlightedIso:(0,Y.cellIso)(e[i]),selected:n.selectedRange,floor:n.floor});return(0,fe.jsxs)("div",{className:Q.datepicker,"data-aia-datepicker":"",children:[(0,fe.jsxs)("div",{className:Q.header,children:[(0,fe.jsx)("button",{type:"button",tabIndex:-1,className:Q.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:p=>p.preventDefault(),onClick:g,children:"\u2039"}),(0,fe.jsx)("span",{className:Q.month,"data-aia-date-month":"","aria-live":"polite",children:(0,Y.monthLabel)(o)}),(0,fe.jsx)("button",{type:"button",tabIndex:-1,className:Q.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:p=>p.preventDefault(),onClick:w,children:"\u203A"})]}),(0,fe.jsx)("div",{className:Q.weekdays,"aria-hidden":"true",children:Y.WEEKDAY_LABELS.map((p,h)=>(0,fe.jsx)("span",{className:Q.weekday,children:p},La[h]))}),(0,fe.jsx)("div",{className:Q.grid,"data-aia-date-grid":"",children:e.map((p,h)=>(0,fe.jsx)(Oa,{option:p,id:`${a}-option-${h}`,index:h,isHighlighted:h===i&&p.is_tappable,isToday:(0,Y.cellIso)(p)===y,isPast:(0,Y.isDimmedDay)((0,Y.cellIso)(p),y,n.floor),marks:(0,Y.dateCellMarks)((0,Y.cellIso)(p),{selectedIso:n.selectedIso,range:m}),onSelect:s,onHighlight:r,onUnhighlight:d},(0,Y.cellIso)(p)??`pad-${h}`))})]})}function Oa({option:e,id:i,index:a,isHighlighted:o,isToday:n,isPast:s,marks:r,onSelect:d,onHighlight:g,onUnhighlight:w}){let[y,m]=(0,_t.useState)(!1),p=(0,Y.cellDay)(e);if(p==null)return(0,fe.jsx)("div",{id:i,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${Q.cell} ${Q.blank}`});let h=()=>{m(!0),d(e),setTimeout(()=>m(!1),170)},x=[Q.cell,Q.day,s?Q.past:"",o?Q.highlighted:"",n?Q.today:"",r.inRange?Q.inRange:"",r.selected?Q.selected:"",y?Q.pressed:""].filter(Boolean).join(" ");return(0,fe.jsx)("div",{id:i,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":o,"aria-label":e.text,tabIndex:0,className:x,onClick:h,onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),h())},onMouseEnter:()=>g(a),onMouseLeave:w?()=>w(a):void 0,children:(0,fe.jsx)("span",{className:Q.number,children:p})})}var $e=require("@magicx-eng/ai-autocomplete-vanilla"),yt=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-5259a217")){let e=document.createElement("style");e.id="ac-style-5259a217",e.textContent=`.aia-cluster {
1592
+ `,document.head.appendChild(e)}var j={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",pressed:"aia-pressed-bEyyN"};var be=require("react/jsx-runtime"),La=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function Vt({options:e,activeIndex:a,listboxId:t,view:i,selection:o,onSelect:s,onHighlight:r,onUnhighlight:d,onPreviousMonth:g,onNextMonth:v}){let y=(0,$.isoDate)(new Date),f=(0,$.visibleDateRange)({pendingStart:o.rangeStart,highlightedIso:(0,$.cellIso)(e[a]),selected:o.selectedRange,floor:o.floor});return(0,be.jsxs)("div",{className:j.datepicker,"data-aia-datepicker":"",children:[(0,be.jsxs)("div",{className:j.header,children:[(0,be.jsx)("button",{type:"button",tabIndex:-1,className:j.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:p=>p.preventDefault(),onClick:g,children:"\u2039"}),(0,be.jsx)("span",{className:j.month,"data-aia-date-month":"","aria-live":"polite",children:(0,$.monthLabel)(i)}),(0,be.jsx)("button",{type:"button",tabIndex:-1,className:j.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:p=>p.preventDefault(),onClick:v,children:"\u203A"})]}),(0,be.jsx)("div",{className:j.weekdays,"aria-hidden":"true",children:$.WEEKDAY_LABELS.map((p,u)=>(0,be.jsx)("span",{className:j.weekday,children:p},La[u]))}),(0,be.jsx)("div",{className:j.grid,"data-aia-date-grid":"",children:e.map((p,u)=>(0,be.jsx)(Oa,{option:p,id:`${t}-option-${u}`,index:u,isHighlighted:u===a&&p.is_tappable,isToday:(0,$.cellIso)(p)===y,isPast:(0,$.isDimmedDay)((0,$.cellIso)(p),y,o.floor),marks:(0,$.dateCellMarks)((0,$.cellIso)(p),{selectedIso:o.selectedIso,range:f}),onSelect:s,onHighlight:r,onUnhighlight:d},(0,$.cellIso)(p)??`pad-${u}`))})]})}function Oa({option:e,id:a,index:t,isHighlighted:i,isToday:o,isPast:s,marks:r,onSelect:d,onHighlight:g,onUnhighlight:v}){let[y,f]=(0,_t.useState)(!1),p=(0,$.cellDay)(e);if(p==null)return(0,be.jsx)("div",{id:a,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${j.cell} ${j.blank}`});let u=()=>{f(!0),d(e),setTimeout(()=>f(!1),170)},x=[j.cell,j.day,s?j.past:"",i?j.highlighted:"",o?j.today:"",r.inRange?j.inRange:"",r.selected?j.selected:"",y?j.pressed:""].filter(Boolean).join(" ");return(0,be.jsx)("div",{id:a,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":i,"aria-label":e.text,tabIndex:0,className:x,onClick:u,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),u())},onMouseEnter:()=>g(t),onMouseLeave:v?()=>v(t):void 0,children:(0,be.jsx)("span",{className:j.number,children:p})})}var Xe=require("@magicx-eng/ai-autocomplete-vanilla"),yt=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-5259a217")){let e=document.createElement("style");e.id="ac-style-5259a217",e.textContent=`.aia-cluster {
1593
1593
  display: flex;
1594
1594
  flex-wrap: wrap;
1595
1595
  gap: var(--aia-cluster-gap, 0.5rem);
@@ -1629,7 +1629,7 @@
1629
1629
  .aia-cluster[data-justify="around"] {
1630
1630
  justify-content: space-around;
1631
1631
  }
1632
- `,document.head.appendChild(e)}var Rt=require("react/jsx-runtime");function ft({gap:e,align:i="center",justify:a="start",noWrap:o=!1,inline:n=!1,className:s,children:r,...d}){let g=e?{"--aia-cluster-gap":e}:void 0,w={className:s?`aia-cluster ${s}`:"aia-cluster","data-align":i,"data-justify":a,"data-nowrap":o||void 0,"data-inline":n||void 0,style:g,...d};return n?(0,Rt.jsx)("span",{...w,children:r}):(0,Rt.jsx)("div",{...w,children:r})}if(typeof document<"u"&&!document.getElementById("ac-style-56b0c577")){let e=document.createElement("style");e.id="ac-style-56b0c577",e.textContent=`/* The footer adds its own 8px horizontal inset so it stays clear of the
1632
+ `,document.head.appendChild(e)}var Ot=require("react/jsx-runtime");function ft({gap:e,align:a="center",justify:t="start",noWrap:i=!1,inline:o=!1,className:s,children:r,...d}){let g=e?{"--aia-cluster-gap":e}:void 0,v={className:s?`aia-cluster ${s}`:"aia-cluster","data-align":a,"data-justify":t,"data-nowrap":i||void 0,"data-inline":o||void 0,style:g,...d};return o?(0,Ot.jsx)("span",{...v,children:r}):(0,Ot.jsx)("div",{...v,children:r})}if(typeof document<"u"&&!document.getElementById("ac-style-56b0c577")){let e=document.createElement("style");e.id="ac-style-56b0c577",e.textContent=`/* The footer adds its own 8px horizontal inset so it stays clear of the
1633
1633
  dropdown's rounded edges. The top inset (--aia-footer-gap) adds breathing
1634
1634
  room above the hint/branding row so the footer doesn't butt against the last
1635
1635
  option row \u2014 additive to the dropdown's 8px section gap. */
@@ -1776,7 +1776,7 @@
1776
1776
  justify-content: flex-end;
1777
1777
  }
1778
1778
  }
1779
- `,document.head.appendChild(e)}var qe={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"};var Re=require("react/jsx-runtime");function Ut({isOptionHighlighted:e=!1,isInputEmpty:i=!1,strings:a=(0,$e.uiStringsFor)()}){let{key:o,hint:n}=(0,$e.getFooterHint)(e,i,a),[s,r]=(0,yt.useState)($e.ATTRIBUTION_URL);return(0,yt.useEffect)(()=>{r((0,$e.buildAttributionUrl)())},[]),(0,Re.jsx)("footer",{className:qe.footer,"data-aia-footer":"",children:(0,Re.jsxs)(ft,{justify:"between",noWrap:!0,className:qe.row,children:[(0,Re.jsxs)(ft,{gap:"5px",className:qe.hintGroup,children:[(0,Re.jsx)("kbd",{className:qe.key,children:o}),(0,Re.jsx)("span",{className:qe.hint,children:n})]}),(0,Re.jsxs)("a",{className:qe.brandLink,href:s,target:"_blank",rel:"noopener noreferrer",children:[(0,Re.jsx)("span",{className:qe.brand,children:"AI"}),(0,Re.jsx)("span",{className:qe.badge,children:"Autocomplete"})]})]})})}var ne=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-2feec02e")){let e=document.createElement("style");e.id="ac-style-2feec02e",e.textContent=`/* Location search \u2014 React copy of the vanilla rules in styles.css (and of the
1779
+ `,document.head.appendChild(e)}var Ue={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"};var He=require("react/jsx-runtime");function Ut({isOptionHighlighted:e=!1,isInputEmpty:a=!1,strings:t=(0,Xe.uiStringsFor)()}){let{key:i,hint:o}=(0,Xe.getFooterHint)(e,a,t),[s,r]=(0,yt.useState)(Xe.ATTRIBUTION_URL);return(0,yt.useEffect)(()=>{r((0,Xe.buildAttributionUrl)())},[]),(0,He.jsx)("footer",{className:Ue.footer,"data-aia-footer":"",children:(0,He.jsxs)(ft,{justify:"between",noWrap:!0,className:Ue.row,children:[(0,He.jsxs)(ft,{gap:"5px",className:Ue.hintGroup,children:[(0,He.jsx)("kbd",{className:Ue.key,children:i}),(0,He.jsx)("span",{className:Ue.hint,children:o})]}),(0,He.jsxs)("a",{className:Ue.brandLink,href:s,target:"_blank",rel:"noopener noreferrer",children:[(0,He.jsx)("span",{className:Ue.brand,children:"AI"}),(0,He.jsx)("span",{className:Ue.badge,children:"Autocomplete"})]})]})})}var ie=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-2feec02e")){let e=document.createElement("style");e.id="ac-style-2feec02e",e.textContent=`/* Location search \u2014 React copy of the vanilla rules in styles.css (and of the
1780
1780
  Angular copy). The three are kept identical by
1781
1781
  packages/vanilla/tests/render/locationFieldParity.test.ts. */
1782
1782
  .aia-location-6-fsr {
@@ -1792,9 +1792,15 @@
1792
1792
  gap: 8px;
1793
1793
  padding: 8px 10px;
1794
1794
  border-radius: var(--aia-location-field-radius, 10px);
1795
- background: var(--aia-location-field-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06));
1795
+ background: var(--aia-location-field-bg-idle, transparent);
1796
1796
  color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
1797
1797
  cursor: text;
1798
+ transition: background-color 120ms ease;
1799
+ }
1800
+
1801
+ .aia-field-xEzwi:hover,
1802
+ .aia-field-xEzwi:focus-within {
1803
+ background: var(--aia-location-field-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06));
1798
1804
  }
1799
1805
 
1800
1806
  .aia-icon-czx6C {
@@ -1818,6 +1824,7 @@
1818
1824
 
1819
1825
  .aia-input-Yi9V-::placeholder {
1820
1826
  color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
1827
+ font-weight: 300;
1821
1828
  opacity: 0.7;
1822
1829
  }
1823
1830
 
@@ -1903,7 +1910,7 @@
1903
1910
  .aia-loadingBar-OLCr4:nth-child(3) {
1904
1911
  width: 60%;
1905
1912
  }
1906
- `,document.head.appendChild(e)}var j={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"};var W=require("react/jsx-runtime"),Ra=0;function bt(e){return e.getRootNode().activeElement??null}function Yt(e){return e.getRootNode().getSelection?.()??document.getSelection()}function Da(e){if(!e.isContentEditable)return null;let i=Yt(e);if(!i||i.rangeCount===0)return null;let a=i.getRangeAt(0);return e.contains(a.startContainer)?a.cloneRange():null}function Qt(e,i){if(e.focus({preventScroll:!0}),!e.isContentEditable)return;let a=Yt(e);if(!a)return;let o=i;(!o||!o.startContainer.isConnected||!e.contains(o.startContainer))&&(o=document.createRange(),o.selectNodeContents(e),o.collapse(!1)),a.removeAllRanges(),a.addRange(o)}var Ma=(0,W.jsxs)("svg",{className:j.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,W.jsx)("path",{d:"M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z"}),(0,W.jsx)("circle",{cx:"12",cy:"9.5",r:"2.5"})]}),za=(0,W.jsxs)("svg",{className:j.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,W.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,W.jsx)("path",{d:"m20 20-3.5-3.5"})]});function jt({view:e,searchLabel:i,noResultsLabel:a,useTypedLabel:o,widgetFocused:n,visible:s=!0,interactive:r=!0,onQuery:d,onMove:g,onCommit:w,onFocusChange:y}){let m=(0,ne.useRef)(null),p=(0,ne.useRef)(null),h=(0,ne.useRef)(null),x=(0,ne.useRef)(null),O=(0,ne.useRef)(null),G=(0,ne.useRef)(!1),R=(0,ne.useRef)(!1),U=(0,ne.useRef)(!1),X=(0,ne.useRef)(n);X.current=n;let D=(0,ne.useRef)(y);D.current=y;let A=u=>{U.current=u,y(u)},C=()=>{let u=m.current;return u!=null&&bt(u)===u},de=()=>{let u=p.current;if(!u)return;let I=bt(u);I instanceof HTMLElement&&I!==m.current&&I!==document.body&&!u.contains(I)&&(x.current=I,O.current=Da(I))},ee=(0,ne.useRef)(null);ee.current===null&&(ee.current=`aia-location-${++Ra}`);let ce=`${ee.current}-row-`;(0,ne.useEffect)(()=>{let u=m.current;u&&u.value!==e.query&&bt(u)!==u&&(u.value=e.query)},[e.query]),(0,ne.useEffect)(()=>{let u=m.current;if(u){if(!s&&C()){R.current=!0,K();return}if(!n){setTimeout(()=>{if(X.current)return;let I=x.current;I&&bt(I)===I||(R.current=!1)},0);return}if(!(R.current||!r||C())){if(de(),A(!0),u.focus({preventScroll:!0}),!C()){R.current=!0,A(!1);return}u.value&&u.select()}}}),(0,ne.useLayoutEffect)(()=>()=>{if(!U.current)return;let u=m.current,I=x.current;I?.isConnected&&u&&bt(u)===u&&(G.current=!0,Qt(I,O.current),G.current=!1),U.current=!1,D.current(!1)},[]);let K=(u=!1)=>{u&&(R.current=!0);let I=x.current;I?.isConnected&&C()&&(G.current=!0,Qt(I,O.current),G.current=!1),A(!1)},te=e.query.trim(),P=e.highlighted>=0&&e.highlighted<e.places.length?`${ce}${e.highlighted}`:void 0,Z=null;return e.places.length>0?Z=e.places.map((u,I)=>(0,W.jsxs)("div",{id:`${ce}${I}`,role:"option","aria-selected":I===e.highlighted,className:I===e.highlighted?`${j.row} ${j.highlighted}`:j.row,"data-aia-location-row":"","data-aia-index":I,onClick:()=>{r&&(K(!0),w(I))},children:[(0,W.jsx)("span",{className:j.pin,children:Ma}),(0,W.jsxs)("span",{className:j.text,children:[(0,W.jsx)("span",{className:j.name,children:u.name}),u.secondary&&(0,W.jsx)("span",{className:j.secondary,children:u.secondary})]})]},u.id)):e.status==="loading"?Z=(0,W.jsxs)("div",{className:j.loading,"data-aia-location-loading":"",children:[(0,W.jsx)("span",{className:j.loadingBar}),(0,W.jsx)("span",{className:j.loadingBar}),(0,W.jsx)("span",{className:j.loadingBar})]}):te&&(Z=(0,W.jsxs)("div",{className:j.note,"data-aia-location-note":"",children:[e.status==="done"&&(0,W.jsx)("span",{className:j.empty,children:a}),(0,W.jsx)("span",{children:o})]})),(0,W.jsxs)("div",{ref:p,className:j.location,"data-aia-location":"",onMouseDown:u=>{!(u.target instanceof Node)||!h.current?.contains(u.target)||(u.stopPropagation(),de(),A(!0))},children:[(0,W.jsxs)("label",{ref:h,className:j.field,children:[za,(0,W.jsx)("input",{ref:m,type:"text",className:j.input,"data-aia-location-input":"",defaultValue:e.query,placeholder:i,"aria-label":i,"aria-activedescendant":P,autoComplete:"off",autoCapitalize:"words",enterKeyHint:"done",spellCheck:!1,tabIndex:s?0:-1,onChange:u=>d(u.target.value),onFocus:()=>A(!0),onBlur:()=>{G.current||(R.current=!0,A(!1))},onKeyDown:u=>{if(!u.nativeEvent.isComposing)switch(u.key){case"ArrowDown":case"ArrowUp":u.preventDefault(),g(u.key==="ArrowDown"?1:-1);return;case"Enter":if(u.preventDefault(),!r)return;K(!0),w();return;case"Escape":u.preventDefault(),u.stopPropagation(),R.current=!0,K();return;case"Backspace":if(u.currentTarget.value!=="")return;u.preventDefault(),R.current=!0,K();return}}})]}),(0,W.jsx)("div",{className:j.results,"data-aia-location-results":"","aria-live":"polite",children:Z})]})}var kt=require("@magicx-eng/ai-autocomplete-vanilla");var $t=require("@magicx-eng/ai-autocomplete-vanilla");if(typeof document<"u"&&!document.getElementById("ac-style-199d0432")){let e=document.createElement("style");e.id="ac-style-199d0432",e.textContent=`/* ParamPill (Figma "ParamPill") \u2014 unfilled suggestion pill: transparent fill,
1913
+ `,document.head.appendChild(e)}var Z={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"};var G=require("react/jsx-runtime"),Da=0;function bt(e){return e.getRootNode().activeElement??null}function jt(e){return e.getRootNode().getSelection?.()??document.getSelection()}function Qt(e){if(!e.isContentEditable)return null;let a=jt(e);if(!a||a.rangeCount===0)return null;let t=a.getRangeAt(0);return e.contains(t.startContainer)?t.cloneRange():null}function Yt(e,a){if(e.focus({preventScroll:!0}),!e.isContentEditable)return;let t=jt(e);if(!t)return;let i=a;(!i||!i.startContainer.isConnected||!e.contains(i.startContainer))&&(i=document.createRange(),i.selectNodeContents(e),i.collapse(!1)),t.removeAllRanges(),t.addRange(i)}var Ma=(0,G.jsxs)("svg",{className:Z.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,G.jsx)("path",{d:"M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z"}),(0,G.jsx)("circle",{cx:"12",cy:"9.5",r:"2.5"})]}),za=(0,G.jsxs)("svg",{className:Z.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,G.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,G.jsx)("path",{d:"m20 20-3.5-3.5"})]});function $t({view:e,searchLabel:a,noResultsLabel:t,useTypedLabel:i,widgetFocused:o,reediting:s=!1,visible:r=!0,interactive:d=!0,onQuery:g,onMove:v,onCommit:y,onFocusChange:f}){let p=(0,ie.useRef)(null),u=(0,ie.useRef)(null),x=(0,ie.useRef)(null),A=(0,ie.useRef)(null),q=(0,ie.useRef)(null),H=(0,ie.useRef)(!1),N=(0,ie.useRef)(!1),te=(0,ie.useRef)(!1),O=(0,ie.useRef)(!1),F=(0,ie.useRef)(o);F.current=o;let T=(0,ie.useRef)(f);T.current=f;let Q=c=>{O.current=c,f(c)},ae=()=>{let c=p.current;return c!=null&&bt(c)===c},de=()=>{let c=u.current;if(!c)return;let E=bt(c);E instanceof HTMLElement&&E!==p.current&&E!==document.body&&!c.contains(E)&&(A.current=E,q.current=Qt(E))},J=c=>{let E=u.current;!E||!(c instanceof HTMLElement)||c===A.current||c===document.body||E.contains(c)||(A.current=c,q.current=Qt(c))},ee=(0,ie.useRef)(null);ee.current===null&&(ee.current=`aia-location-${++Da}`);let P=`${ee.current}-row-`;(0,ie.useEffect)(()=>{let c=p.current;c&&c.value!==e.query&&bt(c)!==c&&(c.value=e.query)},[e.query]),(0,ie.useEffect)(()=>{o&&(s&&!te.current&&(N.current=!1),te.current=s);let c=p.current;if(c){if(!r&&ae()){N.current=!0,Y();return}if(!o){setTimeout(()=>{if(F.current)return;let E=A.current;E&&bt(E)===E||(N.current=!1)},0);return}if(!(!s||N.current||!d||ae())){if(de(),Q(!0),c.focus({preventScroll:!0}),!ae()){N.current=!0,Q(!1);return}c.value&&c.select()}}}),(0,ie.useLayoutEffect)(()=>()=>{if(!O.current)return;let c=p.current,E=A.current;E?.isConnected&&c&&bt(c)===c&&(H.current=!0,Yt(E,q.current),H.current=!1),O.current=!1,T.current(!1)},[]);let Y=(c=!1)=>{c&&(N.current=!0);let E=A.current;E?.isConnected&&ae()&&(H.current=!0,Yt(E,q.current),H.current=!1),Q(!1)},Ae=e.query.trim(),ke=e.highlighted>=0&&e.highlighted<e.places.length?`${P}${e.highlighted}`:void 0,ve=null;return e.places.length>0?ve=e.places.map((c,E)=>(0,G.jsxs)("div",{id:`${P}${E}`,role:"option","aria-selected":E===e.highlighted,className:E===e.highlighted?`${Z.row} ${Z.highlighted}`:Z.row,"data-aia-location-row":"","data-aia-index":E,onClick:()=>{d&&(Y(!0),y(E))},children:[(0,G.jsx)("span",{className:Z.pin,children:Ma}),(0,G.jsxs)("span",{className:Z.text,children:[(0,G.jsx)("span",{className:Z.name,children:c.name}),c.secondary&&(0,G.jsx)("span",{className:Z.secondary,children:c.secondary})]})]},c.id)):e.status==="loading"?ve=(0,G.jsxs)("div",{className:Z.loading,"data-aia-location-loading":"",children:[(0,G.jsx)("span",{className:Z.loadingBar}),(0,G.jsx)("span",{className:Z.loadingBar}),(0,G.jsx)("span",{className:Z.loadingBar})]}):Ae&&(ve=(0,G.jsxs)("div",{className:Z.note,"data-aia-location-note":"",children:[e.status==="done"&&(0,G.jsx)("span",{className:Z.empty,children:t}),(0,G.jsx)("span",{children:i})]})),(0,G.jsxs)("div",{ref:u,className:Z.location,"data-aia-location":"",onMouseDown:c=>{!(c.target instanceof Node)||!x.current?.contains(c.target)||(c.stopPropagation(),de(),Q(!0))},children:[(0,G.jsxs)("label",{ref:x,className:Z.field,children:[za,(0,G.jsx)("input",{ref:p,type:"text",className:Z.input,"data-aia-location-input":"",defaultValue:e.query,placeholder:a,"aria-label":a,"aria-activedescendant":ke,autoComplete:"off",autoCapitalize:"words",enterKeyHint:"done",spellCheck:!1,tabIndex:r?0:-1,onChange:c=>g(c.target.value),onFocus:c=>{J(c.relatedTarget),Q(!0)},onBlur:()=>{H.current||(N.current=!0,Q(!1))},onKeyDown:c=>{if(!c.nativeEvent.isComposing)switch(c.key){case"ArrowDown":case"ArrowUp":c.preventDefault(),v(c.key==="ArrowDown"?1:-1);return;case"Enter":if(c.preventDefault(),!d)return;Y(!0),y();return;case"Escape":c.preventDefault(),c.stopPropagation(),N.current=!0,Y();return;case"Backspace":if(c.currentTarget.value!=="")return;c.preventDefault(),N.current=!0,Y();return}}})]}),(0,G.jsx)("div",{className:Z.results,"data-aia-location-results":"","aria-live":"polite",children:ve})]})}var kt=require("@magicx-eng/ai-autocomplete-vanilla");var Zt=require("@magicx-eng/ai-autocomplete-vanilla");if(typeof document<"u"&&!document.getElementById("ac-style-199d0432")){let e=document.createElement("style");e.id="ac-style-199d0432",e.textContent=`/* ParamPill (Figma "ParamPill") \u2014 unfilled suggestion pill: transparent fill,
1907
1914
  no outline. ~28px via 6px padding + 14px text + the 1px border (border-box).
1908
1915
  The border is kept as a 1px transparent line so the box stays the same size
1909
1916
  as it was when the outline was dashed. */
@@ -2086,7 +2093,7 @@
2086
2093
  opacity: 0;
2087
2094
  }
2088
2095
  }
2089
- `,document.head.appendChild(e)}var De={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",skeletonIn:"aia-skeletonIn-54kMv",skeletonPulse:"aia-skeletonPulse-xGcUy",skeletonOut:"aia-skeletonOut-1sJ-r"};var Ze=require("react/jsx-runtime"),Dt={selected:1,first:.7,next:.4,last:.2};function Zt({label:e,state:i,active:a,rounded:o,loading:n,smartSuggestion:s,completionHeader:r,onClick:d}){let g=[De.pill,o?De.rounded:"",n?De.skeleton:""].filter(Boolean).join(" ");return(0,Ze.jsx)("button",{type:"button","data-aia-pill":"","data-aia-pill-active":a?"":void 0,"data-aia-loading":n?"":void 0,"data-aia-smart-suggestion":s?r?"header":"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:g,style:{"--aia-pill-opacity":Dt[i]},onMouseDown:w=>w.preventDefault(),onClick:n?void 0:d,disabled:n,children:s?(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsx)("span",{className:`${De.smartText} magicx-aia-smart-suggestion-text`,children:e}),(0,Ze.jsx)("span",{className:`${De.smartSparkle} magicx-aia-smart-suggestion-sparkle`,dangerouslySetInnerHTML:{__html:$t.SMART_SUGGESTION_SPARKLE_SVG}})]}):e})}if(typeof document<"u"&&!document.getElementById("ac-style-0fcb7940")){let e=document.createElement("style");e.id="ac-style-0fcb7940",e.textContent=`.aia-list-qvLqO {
2096
+ `,document.head.appendChild(e)}var Be={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",skeletonIn:"aia-skeletonIn-54kMv",skeletonPulse:"aia-skeletonPulse-xGcUy",skeletonOut:"aia-skeletonOut-1sJ-r"};var Je=require("react/jsx-runtime"),Dt={selected:1,first:.7,next:.4,last:.2};function Xt({label:e,state:a,active:t,rounded:i,loading:o,smartSuggestion:s,completionHeader:r,onClick:d}){let g=[Be.pill,i?Be.rounded:"",o?Be.skeleton:""].filter(Boolean).join(" ");return(0,Je.jsx)("button",{type:"button","data-aia-pill":"","data-aia-pill-active":t?"":void 0,"data-aia-loading":o?"":void 0,"data-aia-smart-suggestion":s?r?"header":"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:g,style:{"--aia-pill-opacity":Dt[a]},onMouseDown:v=>v.preventDefault(),onClick:o?void 0:d,disabled:o,children:s?(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("span",{className:`${Be.smartText} magicx-aia-smart-suggestion-text`,children:e}),(0,Je.jsx)("span",{className:`${Be.smartSparkle} magicx-aia-smart-suggestion-sparkle`,dangerouslySetInnerHTML:{__html:Zt.SMART_SUGGESTION_SPARKLE_SVG}})]}):e})}if(typeof document<"u"&&!document.getElementById("ac-style-0fcb7940")){let e=document.createElement("style");e.id="ac-style-0fcb7940",e.textContent=`.aia-list-qvLqO {
2090
2097
  position: relative;
2091
2098
  z-index: 1;
2092
2099
  pointer-events: auto;
@@ -2096,7 +2103,7 @@
2096
2103
  align-items: center;
2097
2104
  vertical-align: middle;
2098
2105
  }
2099
- `,document.head.appendChild(e)}var Mt={list:"aia-list-qvLqO"};var wt=require("react/jsx-runtime"),Na=[125,69];function Xt(e){return e===0?"first":e===1?"next":"last"}function Ct({pills:e,activePillIndex:i,onSelectPill:a,activeSelected:o,rounded:n,loading:s}){return s&&e.length===0?(0,wt.jsx)("span",{className:Mt.list,"data-aia-pill-list-loading":"",children:Na.map((r,d)=>(0,wt.jsx)("span",{"data-aia-pill-skeleton":"",className:`${De.pill} ${n?De.rounded:""} ${De.skeleton}`,style:{width:r,"--aia-pill-opacity":Dt[Xt(d)]}},`skel-${r}`))}):(0,wt.jsx)("span",{className:Mt.list,"data-aia-pill-list-loading":s?"":void 0,children:e.map((r,d)=>{let g=!!o&&d===i;return(0,wt.jsx)(Zt,{label:r.text,state:g?"selected":Xt(d),selected:g,active:d===i,rounded:n,loading:s,smartSuggestion:(0,kt.isSmartSuggestion)(r),completionHeader:(0,kt.isTraditionalAutocompleteSuggestion)(r),onClick:()=>a(d)},`${r.parameter}-${r.text}`)})})}var we=require("@magicx-eng/ai-autocomplete-vanilla"),be=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-fef1688d")){let e=document.createElement("style");e.id="ac-style-fef1688d",e.textContent=`/* Product strip \u2014 the React counterpart of the vanilla core's strip rules
2106
+ `,document.head.appendChild(e)}var Mt={list:"aia-list-qvLqO"};var wt=require("react/jsx-runtime"),Na=[125,69];function Jt(e){return e===0?"first":e===1?"next":"last"}function Ct({pills:e,activePillIndex:a,onSelectPill:t,activeSelected:i,rounded:o,loading:s}){return s&&e.length===0?(0,wt.jsx)("span",{className:Mt.list,"data-aia-pill-list-loading":"",children:Na.map((r,d)=>(0,wt.jsx)("span",{"data-aia-pill-skeleton":"",className:`${Be.pill} ${o?Be.rounded:""} ${Be.skeleton}`,style:{width:r,"--aia-pill-opacity":Dt[Jt(d)]}},`skel-${r}`))}):(0,wt.jsx)("span",{className:Mt.list,"data-aia-pill-list-loading":s?"":void 0,children:e.map((r,d)=>{let g=!!i&&d===a;return(0,wt.jsx)(Xt,{label:r.text,state:g?"selected":Jt(d),selected:g,active:d===a,rounded:o,loading:s,smartSuggestion:(0,kt.isSmartSuggestion)(r),completionHeader:(0,kt.isTraditionalAutocompleteSuggestion)(r),onClick:()=>t(d)},`${r.parameter}-${r.text}`)})})}var xe=require("@magicx-eng/ai-autocomplete-vanilla"),we=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-fef1688d")){let e=document.createElement("style");e.id="ac-style-fef1688d",e.textContent=`/* Product strip \u2014 the React counterpart of the vanilla core's strip rules
2100
2107
  (packages/vanilla/src/styles.css). Same tokens, same defaults, so a consumer
2101
2108
  theming one package sees the same result in the other.
2102
2109
 
@@ -2552,7 +2559,7 @@
2552
2559
  .aia-section-Hugfg[data-aia-products-layout="list"] .aia-card-JBGYT[data-aia-product-has-cart] {
2553
2560
  padding-right: calc(var(--aia-product-cart-size, 19.6px) + 11.2px);
2554
2561
  }
2555
- `,document.head.appendChild(e)}var $={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"};var H=require("react/jsx-runtime");function Jt({products:e,listboxId:i,onSelect:a,onAddToCart:o,onFocusChange:n,focusable:s=!0,layout:r="row",imageFallback:d="image",strings:g=(0,we.uiStringsFor)()}){let w=e.length>0,y=(0,be.useRef)(null);if((0,be.useEffect)(()=>{let p=y.current;if(!(!w||!p))return(0,we.attachProductRowWheel)(p)},[w]),!w)return null;let m=`${i}-products-label`;return(0,H.jsxs)("section",{className:$.section,"data-aia-products":"","data-aia-products-layout":r,role:"group","aria-labelledby":m,children:[(0,H.jsx)("div",{className:$.label,id:m,"data-aia-products-label":"",children:g.products}),(0,H.jsx)("div",{ref:y,className:$.row,"data-aia-products-row":"",children:e.map((p,h)=>(0,H.jsx)(Fa,{product:p,id:`${i}-product-${h}`,onSelect:a,onAddToCart:o,onFocusChange:n,focusable:s,imageFallback:d,soldOut:g.soldOut,addToCart:g.addToCart},p.id))})]})}function Fa({product:e,id:i,onSelect:a,onAddToCart:o,onFocusChange:n,focusable:s,imageFallback:r,soldOut:d,addToCart:g}){let w=!!o&&e.available!==!1,[y,m]=(0,be.useState)(null),p=x=>{x.relatedTarget?.closest("[data-aia-dropdown]")||n?.(!1)},h=x=>{x.metaKey||x.ctrlKey||x.shiftKey||x.altKey||x.button!==0||(x.preventDefault(),a(e))};return(0,H.jsxs)("a",{id:i,className:$.card,"data-aia-product":"","data-aia-product-sold-out":e.available===!1?"":void 0,"data-aia-product-has-cart":w?"":void 0,role:"option","aria-selected":!1,style:y?{"--aia-product-photo-fill-x":String(y.x),"--aia-product-photo-fill-y":String(y.y)}:void 0,href:e.url,tabIndex:s?0:-1,onClick:h,onKeyDown:x=>{x.key!=="Enter"&&x.key!==" "||(x.preventDefault(),a(e))},onFocus:()=>n?.(!0),onBlur:p,children:[(0,H.jsx)(Wa,{sources:(0,we.productImageSources)(e.imageUrl),title:e.title,fallback:r,onPhotoFill:m},(0,we.productImageSrc)(e.imageUrl)??""),(0,H.jsxs)("span",{className:$.body,children:[e.vendor?(0,H.jsx)("span",{className:$.vendor,children:e.vendor}):null,(0,H.jsx)("span",{className:$.title,children:e.title}),e.price?(0,H.jsxs)("span",{className:$.price,children:[e.price,e.compareAtPrice?(0,H.jsx)("s",{className:$.compareAt,children:e.compareAtPrice}):null]}):null,e.available===!1?(0,H.jsx)("span",{className:$.badge,children:d}):null]}),w&&o?(0,H.jsx)(Ba,{product:e,label:`${g}: ${e.title}`,focusable:s,onAddToCart:o,onFocus:()=>n?.(!0),onBlur:p},Ha(e)):null]})}function Ha(e){return[e.id,e.title,e.url,e.imageUrl,e.vendor].map(i=>i??"").join("\0")}function Ba({product:e,label:i,focusable:a,onAddToCart:o,onFocus:n,onBlur:s}){let[r,d]=(0,be.useState)(null),g=(0,be.useRef)(null),w=(0,be.useRef)(e);w.current=e;let y=(0,be.useRef)(!0);(0,be.useEffect)(()=>(y.current=!0,()=>{y.current=!1}),[]);let m=h=>{g.current=h,y.current&&d(h)},p=h=>{if(h.preventDefault(),h.stopPropagation(),g.current==="adding")return;m("adding");let x;try{x=Promise.resolve(o(w.current))}catch(O){x=Promise.reject(O)}x.then(()=>m("added"),()=>m(null))};return(0,H.jsx)("span",{className:$.cart,"data-aia-product-cart":"","data-aia-cart-state":r??void 0,"aria-busy":r==="adding"?!0:void 0,role:"button","aria-label":i,tabIndex:a?0:-1,onClick:p,onKeyDown:h=>{h.key!=="Enter"&&h.key!==" "||p(h)},onFocus:h=>{h.stopPropagation(),n()},onBlur:h=>{h.stopPropagation(),s(h)},children:(0,H.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,H.jsx)("path",{className:$.cartGlyph,d:"M2 3h2.2l2.4 11.2a2 2 0 0 0 2 1.6h8.9a2 2 0 0 0 1.9-1.5L21 8H6"}),(0,H.jsx)("path",{className:$.cartGlyph,d:"M13.5 6.5v-4M11.5 4.5h4"}),(0,H.jsx)("path",{className:$.cartCheck,d:"M5 12.5l4.5 4.5L19 7.5"}),(0,H.jsx)("path",{className:$.cartSpinner,d:"M12 4a8 8 0 1 0 8 8"}),(0,H.jsx)("circle",{className:$.cartGlyph,cx:"9",cy:"20",r:"1.3"}),(0,H.jsx)("circle",{className:$.cartGlyph,cx:"17.5",cy:"20",r:"1.3"})]})})}function Wa({sources:e,title:i,fallback:a,onPhotoFill:o}){let[n,s]=(0,be.useState)(0),r=e[n],d=!!r,[g,w]=(0,be.useState)(null),y=!d&&a==="initial";return(0,be.useEffect)(()=>()=>o(null),[o]),(0,H.jsxs)("span",{className:$.media,"aria-hidden":"true","data-aia-product-placeholder":!d&&!y?"":void 0,"data-aia-product-initial":y?"":void 0,"data-aia-image-loaded":d&&g===r?"":void 0,children:[d?(0,H.jsx)("img",{className:$.image,src:r,alt:"",loading:"lazy",decoding:"async",onLoad:m=>{w(r),o((0,we.productPhotoFill)(m.currentTarget.naturalWidth,m.currentTarget.naturalHeight))},onError:()=>{n+1>=e.length&&o(null),s(m=>m+1)}}):null,y?(0,we.productInitial)(i):null]})}var se=require("@magicx-eng/ai-autocomplete-vanilla"),Me=require("react");var ea=require("@magicx-eng/ai-autocomplete-vanilla"),St=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-948e58da")){let e=document.createElement("style");e.id="ac-style-948e58da",e.textContent=`.aia-grid {
2562
+ `,document.head.appendChild(e)}var X={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"};var K=require("react/jsx-runtime");function ea({products:e,listboxId:a,onSelect:t,onAddToCart:i,onFocusChange:o,focusable:s=!0,layout:r="row",imageFallback:d="image",strings:g=(0,xe.uiStringsFor)()}){let v=e.length>0,y=(0,we.useRef)(null);if((0,we.useEffect)(()=>{let p=y.current;if(!(!v||!p))return(0,xe.attachProductRowWheel)(p)},[v]),!v)return null;let f=`${a}-products-label`;return(0,K.jsxs)("section",{className:X.section,"data-aia-products":"","data-aia-products-layout":r,role:"group","aria-labelledby":f,children:[(0,K.jsx)("div",{className:X.label,id:f,"data-aia-products-label":"",children:g.products}),(0,K.jsx)("div",{ref:y,className:X.row,"data-aia-products-row":"",children:e.map((p,u)=>(0,K.jsx)(Fa,{product:p,id:`${a}-product-${u}`,onSelect:t,onAddToCart:i,onFocusChange:o,focusable:s,imageFallback:d,soldOut:g.soldOut,addToCart:g.addToCart},p.id))})]})}function Fa({product:e,id:a,onSelect:t,onAddToCart:i,onFocusChange:o,focusable:s,imageFallback:r,soldOut:d,addToCart:g}){let v=!!i&&e.available!==!1,[y,f]=(0,we.useState)(null),p=x=>{x.relatedTarget?.closest("[data-aia-dropdown]")||o?.(!1)},u=x=>{x.metaKey||x.ctrlKey||x.shiftKey||x.altKey||x.button!==0||(x.preventDefault(),t(e))};return(0,K.jsxs)("a",{id:a,className:X.card,"data-aia-product":"","data-aia-product-sold-out":e.available===!1?"":void 0,"data-aia-product-has-cart":v?"":void 0,role:"option","aria-selected":!1,style:y?{"--aia-product-photo-fill-x":String(y.x),"--aia-product-photo-fill-y":String(y.y)}:void 0,href:e.url,tabIndex:s?0:-1,onClick:u,onKeyDown:x=>{x.key!=="Enter"&&x.key!==" "||(x.preventDefault(),t(e))},onFocus:()=>o?.(!0),onBlur:p,children:[(0,K.jsx)(Wa,{sources:(0,xe.productImageSources)(e.imageUrl),title:e.title,fallback:r,onPhotoFill:f},(0,xe.productImageSrc)(e.imageUrl)??""),(0,K.jsxs)("span",{className:X.body,children:[e.vendor?(0,K.jsx)("span",{className:X.vendor,children:e.vendor}):null,(0,K.jsx)("span",{className:X.title,children:e.title}),e.price?(0,K.jsxs)("span",{className:X.price,children:[e.price,e.compareAtPrice?(0,K.jsx)("s",{className:X.compareAt,children:e.compareAtPrice}):null]}):null,e.available===!1?(0,K.jsx)("span",{className:X.badge,children:d}):null]}),v&&i?(0,K.jsx)(Ba,{product:e,label:`${g}: ${e.title}`,focusable:s,onAddToCart:i,onFocus:()=>o?.(!0),onBlur:p},Ha(e)):null]})}function Ha(e){return[e.id,e.title,e.url,e.imageUrl,e.vendor].map(a=>a??"").join("\0")}function Ba({product:e,label:a,focusable:t,onAddToCart:i,onFocus:o,onBlur:s}){let[r,d]=(0,we.useState)(null),g=(0,we.useRef)(null),v=(0,we.useRef)(e);v.current=e;let y=(0,we.useRef)(!0);(0,we.useEffect)(()=>(y.current=!0,()=>{y.current=!1}),[]);let f=u=>{g.current=u,y.current&&d(u)},p=u=>{if(u.preventDefault(),u.stopPropagation(),g.current==="adding")return;f("adding");let x;try{x=Promise.resolve(i(v.current))}catch(A){x=Promise.reject(A)}x.then(()=>f("added"),()=>f(null))};return(0,K.jsx)("span",{className:X.cart,"data-aia-product-cart":"","data-aia-cart-state":r??void 0,"aria-busy":r==="adding"?!0:void 0,role:"button","aria-label":a,tabIndex:t?0:-1,onClick:p,onKeyDown:u=>{u.key!=="Enter"&&u.key!==" "||p(u)},onFocus:u=>{u.stopPropagation(),o()},onBlur:u=>{u.stopPropagation(),s(u)},children:(0,K.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,K.jsx)("path",{className:X.cartGlyph,d:"M2 3h2.2l2.4 11.2a2 2 0 0 0 2 1.6h8.9a2 2 0 0 0 1.9-1.5L21 8H6"}),(0,K.jsx)("path",{className:X.cartGlyph,d:"M13.5 6.5v-4M11.5 4.5h4"}),(0,K.jsx)("path",{className:X.cartCheck,d:"M5 12.5l4.5 4.5L19 7.5"}),(0,K.jsx)("path",{className:X.cartSpinner,d:"M12 4a8 8 0 1 0 8 8"}),(0,K.jsx)("circle",{className:X.cartGlyph,cx:"9",cy:"20",r:"1.3"}),(0,K.jsx)("circle",{className:X.cartGlyph,cx:"17.5",cy:"20",r:"1.3"})]})})}function Wa({sources:e,title:a,fallback:t,onPhotoFill:i}){let[o,s]=(0,we.useState)(0),r=e[o],d=!!r,[g,v]=(0,we.useState)(null),y=!d&&t==="initial";return(0,we.useEffect)(()=>()=>i(null),[i]),(0,K.jsxs)("span",{className:X.media,"aria-hidden":"true","data-aia-product-placeholder":!d&&!y?"":void 0,"data-aia-product-initial":y?"":void 0,"data-aia-image-loaded":d&&g===r?"":void 0,children:[d?(0,K.jsx)("img",{className:X.image,src:r,alt:"",loading:"lazy",decoding:"async",onLoad:f=>{v(r),i((0,xe.productPhotoFill)(f.currentTarget.naturalWidth,f.currentTarget.naturalHeight))},onError:()=>{o+1>=e.length&&i(null),s(f=>f+1)}}):null,y?(0,xe.productInitial)(a):null]})}var se=require("@magicx-eng/ai-autocomplete-vanilla"),We=require("react");var ta=require("@magicx-eng/ai-autocomplete-vanilla"),St=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-948e58da")){let e=document.createElement("style");e.id="ac-style-948e58da",e.textContent=`.aia-grid {
2556
2563
  display: grid;
2557
2564
  grid-template-columns: repeat(
2558
2565
  auto-fit,
@@ -2588,7 +2595,7 @@
2588
2595
  .aia-grid[data-scroll]::-webkit-scrollbar {
2589
2596
  display: none;
2590
2597
  }
2591
- `,document.head.appendChild(e)}var aa=require("react/jsx-runtime");function ta({min:e="16rem",max:i,gap:a,scroll:o=!1,maxHeight:n,scrollResetKey:s,cols:r,template:d,innerRef:g,className:w,children:y,...m}){let p=(0,St.useRef)(null);(0,St.useLayoutEffect)(()=>{if(s===void 0)return;let x=p.current;x&&(x.scrollTop=0)},[s]);let h={"--aia-grid-min":e};return i&&(h["--aia-grid-max"]=i),a&&(h["--aia-grid-gap"]=a),n&&(h["--aia-grid-max-height"]=n),r&&(h.gridTemplateColumns=(0,ea.optionsGridTemplateColumns)(r)),d&&(h.gridTemplateColumns=d),(0,aa.jsx)("div",{ref:x=>{p.current=x,g?.(x)},className:w?`aia-grid ${w}`:"aia-grid","data-scroll":o||void 0,style:h,...m,children:y})}var ue=require("@magicx-eng/ai-autocomplete-vanilla"),Se=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-82820da7")){let e=document.createElement("style");e.id="ac-style-82820da7",e.textContent=`.aia-item-d4vpD {
2598
+ `,document.head.appendChild(e)}var ia=require("react/jsx-runtime");function aa({min:e="16rem",max:a,gap:t,scroll:i=!1,maxHeight:o,scrollResetKey:s,cols:r,template:d,innerRef:g,className:v,children:y,...f}){let p=(0,St.useRef)(null);(0,St.useLayoutEffect)(()=>{if(s===void 0)return;let x=p.current;x&&(x.scrollTop=0)},[s]);let u={"--aia-grid-min":e};return a&&(u["--aia-grid-max"]=a),t&&(u["--aia-grid-gap"]=t),o&&(u["--aia-grid-max-height"]=o),r&&(u.gridTemplateColumns=(0,ta.optionsGridTemplateColumns)(r)),d&&(u.gridTemplateColumns=d),(0,ia.jsx)("div",{ref:x=>{p.current=x,g?.(x)},className:v?`aia-grid ${v}`:"aia-grid","data-scroll":i||void 0,style:u,...f,children:y})}var me=require("@magicx-eng/ai-autocomplete-vanilla"),Te=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-82820da7")){let e=document.createElement("style");e.id="ac-style-82820da7",e.textContent=`.aia-item-d4vpD {
2592
2599
  position: relative;
2593
2600
  /* Clip, not visible: the entrance rise below runs on the inner content,
2594
2601
  and a transformed box extends its scroll container's scrollable area.
@@ -3114,7 +3121,7 @@
3114
3121
  .aia-item-d4vpD:has(.aia-checkbox-KGRhg[data-checked="true"]) {
3115
3122
  background: var(--aia-option-bg, transparent);
3116
3123
  }
3117
- `,document.head.appendChild(e)}var re={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",pressCompress:"aia-pressCompress-ICV3q",scrollHint:"aia-scrollHint-xKXPt",skeletonPulse:"aia-skeletonPulse-plvdD",text:"aia-text-yqoh9",skeletonBarIn:"aia-skeletonBarIn-ZlEM0",parameter:"aia-parameter-Dt2zF",match:"aia-match-pp-9v",icon:"aia-icon-Qw938",count:"aia-count-IpYbQ",image:"aia-image-YZAbO",skeletonOut:"aia-skeletonOut-x6NRd",checkbox:"aia-checkbox-KGRhg"};var pe=require("react/jsx-runtime");function ia({option:e,isHighlighted:i,checked:a,onSelect:o,onHighlight:n,onUnhighlight:s,id:r,loading:d,showIcon:g=!0,showImage:w=!0,showCount:y=!0,scrollHint:m,enterDelayMs:p=0}){let[h]=(0,Se.useState)(p),[x,O]=(0,Se.useState)(!1),G=w?(0,ue.optionImageSources)(e.image_url):[],R=G[0]??null,[U,X]=(0,Se.useState)([]),D=G.find(P=>!U.includes(P))??null,[A,C]=(0,Se.useState)(null),de=(0,Se.useMemo)(()=>!R&&g&&e.icon_svg?(0,ue.sanitizeOptionIconSvg)(e.icon_svg):null,[R,g,e.icon_svg]),ee=y?(0,ue.formatOptionCount)(e.item_count):null,ce=(0,Se.useRef)(void 0);(0,Se.useEffect)(()=>()=>clearTimeout(ce.current),[]);let K=P=>{if(d||!e.is_tappable||x&&a===void 0)return;O(!0);let Z=P?.currentTarget;a!==void 0&&Z!==void 0&&P!==void 0&&!(0,ue.isMultiSelectToggleTap)(Z,Z.querySelector("[data-aia-checkbox]"),P)?o(e,{commit:!0}):o(e),clearTimeout(ce.current),ce.current=setTimeout(()=>O(!1),170)},te=[re.item,i&&!d?re.highlighted:"",e.liveMatch&&!d?re.liveMatch:"",e.is_tappable?re.tappable:re.nonTappable,x?re.pressed:"",m?re.scrollHint:""].filter(Boolean).join(" ");return(0,pe.jsx)("div",{id:r,role:"option","data-aia-option":"","data-aia-loading":d?"":void 0,"data-aia-icon":de&&e.icon?e.icon:void 0,"data-aia-image":R?"":void 0,"data-aia-item-count":ee!==null?e.item_count:void 0,"aria-selected":a??i,className:te,style:{[ue.OPTION_ENTER_DELAY_VAR]:`${h}ms`},tabIndex:d||!e.is_tappable?-1:0,onClick:K,onKeyDown:P=>{!d&&e.is_tappable&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),K())},onMouseEnter:!d&&e.is_tappable?n:void 0,onMouseLeave:s,children:(0,pe.jsxs)("span",{className:re.content,children:[a!==void 0&&e.is_tappable&&(0,pe.jsx)("span",{className:re.checkbox,"aria-hidden":"true","data-aia-checkbox":"","data-checked":a,children:a?"\u2713":""}),R&&(0,pe.jsx)("span",{className:`${re.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-image-loaded":D!==null&&A===D?"":void 0,children:(0,pe.jsx)("img",{src:D??R,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:D===null,onLoad:()=>C(D),onError:()=>{D!==null&&X(P=>[...P,D])}})}),de&&(0,pe.jsx)("span",{className:`${re.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:de}}),(0,pe.jsxs)("span",{className:re.text,children:[e.matchedText?(0,ue.highlightParts)((0,ue.optionLabel)(e),e.matchedText).map((P,Z)=>P.bold?(0,pe.jsx)("strong",{className:`${re.match} magicx-aia-option-match`,children:P.text},Z):P.text):(0,ue.optionLabel)(e),e.parameterLabel&&(0,pe.jsxs)(pe.Fragment,{children:[" ",(0,pe.jsx)("span",{className:`${re.parameter} magicx-aia-option-parameter`,children:e.parameterLabel})]})]}),e.tag&&(0,pe.jsx)("span",{className:re.tag,children:e.tag}),ee!==null&&(0,pe.jsx)("span",{className:`${re.count} magicx-aia-option-count`,children:ee})]})})}var zt=require("react/jsx-runtime");function Ka(){let[e,i]=(0,Me.useState)(se.isOptionsGridMobileViewport);return(0,Me.useEffect)(()=>{if(typeof window>"u"||!window.matchMedia)return;let a=window.matchMedia(se.OPTIONS_GRID_MOBILE_QUERY),o=()=>i(a.matches);return o(),a.addEventListener("change",o),()=>a.removeEventListener("change",o)},[]),e}function oa({options:e,activeIndex:i,picked:a,onSelect:o,onHighlight:n,onUnhighlight:s,listboxId:r,loading:d,groupKey:g="",optionsPosition:w="below",showIcons:y=!0,showImages:m=!0,showCounts:p=!0}){let h=Ka(),x=(0,Me.useRef)(null),[O,G]=(0,Me.useState)(null),R=(0,Me.useRef)(null);(0,Me.useLayoutEffect)(()=>{if(d&&(0,se.sameOptionRows)(R.current,e))return;R.current=d?null:e;let D=x.current,C=D&&!d&&(0,se.needsOptionsGridMeasurement)(e.length,h)?(0,se.measureOptionsGrid)(D):null;G(C?(0,se.planOptionsGrid)(e.length,h,C.rowWidths,C.gridWidth):null)},[e,h,d]);let U=O??(0,se.planOptionsGrid)(e.length,h,null,null),X=(0,se.optionsShowLeadingVisuals)(e,y,m);return(0,zt.jsx)(ta,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:g,template:U.template,maxHeight:U.maxHeight,innerRef:D=>{x.current=D},"data-aia-group":g,children:e.map((D,A)=>(0,zt.jsx)(ia,{option:D,isHighlighted:A===i,checked:a?a.includes(D.text):void 0,onSelect:o,onHighlight:()=>n(A),onUnhighlight:s?()=>s(A):void 0,id:`${r}-option-${A}`,loading:d,showIcon:y&&X,showImage:m&&X,showCount:p,scrollHint:!d&&U.scrollHintIndices.includes(A),enterDelayMs:d?0:(0,se.optionEnterDelayMs)(A,U.cols,e.length,w)},`${g}\0${D.text}`))})}var he=require("@magicx-eng/ai-autocomplete-vanilla"),Pe=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-52a922cb")){let e=document.createElement("style");e.id="ac-style-52a922cb",e.textContent=`/* --- Time wheel (replaces the options grid for time suggestions) ---
3124
+ `,document.head.appendChild(e)}var re={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",pressCompress:"aia-pressCompress-ICV3q",scrollHint:"aia-scrollHint-xKXPt",skeletonPulse:"aia-skeletonPulse-plvdD",text:"aia-text-yqoh9",skeletonBarIn:"aia-skeletonBarIn-ZlEM0",parameter:"aia-parameter-Dt2zF",match:"aia-match-pp-9v",icon:"aia-icon-Qw938",count:"aia-count-IpYbQ",image:"aia-image-YZAbO",skeletonOut:"aia-skeletonOut-x6NRd",checkbox:"aia-checkbox-KGRhg"};var he=require("react/jsx-runtime");function oa({option:e,isHighlighted:a,checked:t,onSelect:i,onHighlight:o,onUnhighlight:s,id:r,loading:d,showIcon:g=!0,showImage:v=!0,showCount:y=!0,scrollHint:f,enterDelayMs:p=0}){let[u]=(0,Te.useState)(p),[x,A]=(0,Te.useState)(!1),q=v?(0,me.optionImageSources)(e.image_url):[],H=q[0]??null,[N,te]=(0,Te.useState)([]),O=q.find(P=>!N.includes(P))??null,[F,T]=(0,Te.useState)(null),Q=(0,Te.useMemo)(()=>!H&&g&&e.icon_svg?(0,me.sanitizeOptionIconSvg)(e.icon_svg):null,[H,g,e.icon_svg]),ae=y?(0,me.formatOptionCount)(e.item_count):null,de=(0,Te.useRef)(void 0);(0,Te.useEffect)(()=>()=>clearTimeout(de.current),[]);let J=P=>{if(d||!e.is_tappable||x&&t===void 0)return;A(!0);let Y=P?.currentTarget;t!==void 0&&Y!==void 0&&P!==void 0&&!(0,me.isMultiSelectToggleTap)(Y,Y.querySelector("[data-aia-checkbox]"),P)?i(e,{commit:!0}):i(e),clearTimeout(de.current),de.current=setTimeout(()=>A(!1),170)},ee=[re.item,a&&!d?re.highlighted:"",e.liveMatch&&!d?re.liveMatch:"",e.is_tappable?re.tappable:re.nonTappable,x?re.pressed:"",f?re.scrollHint:""].filter(Boolean).join(" ");return(0,he.jsx)("div",{id:r,role:"option","data-aia-option":"","data-aia-loading":d?"":void 0,"data-aia-icon":Q&&e.icon?e.icon:void 0,"data-aia-image":H?"":void 0,"data-aia-item-count":ae!==null?e.item_count:void 0,"aria-selected":t??a,className:ee,style:{[me.OPTION_ENTER_DELAY_VAR]:`${u}ms`},tabIndex:d||!e.is_tappable?-1:0,onClick:J,onKeyDown:P=>{!d&&e.is_tappable&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),J())},onMouseEnter:!d&&e.is_tappable?o:void 0,onMouseLeave:s,children:(0,he.jsxs)("span",{className:re.content,children:[t!==void 0&&e.is_tappable&&(0,he.jsx)("span",{className:re.checkbox,"aria-hidden":"true","data-aia-checkbox":"","data-checked":t,children:t?"\u2713":""}),H&&(0,he.jsx)("span",{className:`${re.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-image-loaded":O!==null&&F===O?"":void 0,children:(0,he.jsx)("img",{src:O??H,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:O===null,onLoad:()=>T(O),onError:()=>{O!==null&&te(P=>[...P,O])}})}),Q&&(0,he.jsx)("span",{className:`${re.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:Q}}),(0,he.jsxs)("span",{className:re.text,children:[e.matchedText?(0,me.highlightParts)((0,me.optionLabel)(e),e.matchedText).map((P,Y)=>P.bold?(0,he.jsx)("strong",{className:`${re.match} magicx-aia-option-match`,children:P.text},Y):P.text):(0,me.optionLabel)(e),e.parameterLabel&&(0,he.jsxs)(he.Fragment,{children:[" ",(0,he.jsx)("span",{className:`${re.parameter} magicx-aia-option-parameter`,children:e.parameterLabel})]})]}),e.tag&&(0,he.jsx)("span",{className:re.tag,children:e.tag}),ae!==null&&(0,he.jsx)("span",{className:`${re.count} magicx-aia-option-count`,children:ae})]})})}var zt=require("react/jsx-runtime");function Ka(){let[e,a]=(0,We.useState)(se.isOptionsGridMobileViewport);return(0,We.useEffect)(()=>{if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia(se.OPTIONS_GRID_MOBILE_QUERY),i=()=>a(t.matches);return i(),t.addEventListener("change",i),()=>t.removeEventListener("change",i)},[]),e}function na({options:e,activeIndex:a,picked:t,onSelect:i,onHighlight:o,onUnhighlight:s,listboxId:r,loading:d,groupKey:g="",optionsPosition:v="below",showIcons:y=!0,showImages:f=!0,showCounts:p=!0}){let u=Ka(),x=(0,We.useRef)(null),[A,q]=(0,We.useState)(null),H=(0,We.useRef)(null);(0,We.useLayoutEffect)(()=>{if(d&&(0,se.sameOptionRows)(H.current,e))return;H.current=d?null:e;let O=x.current,T=O&&!d&&(0,se.needsOptionsGridMeasurement)(e.length,u)?(0,se.measureOptionsGrid)(O):null;q(T?(0,se.planOptionsGrid)(e.length,u,T.rowWidths,T.gridWidth):null)},[e,u,d]);let N=A??(0,se.planOptionsGrid)(e.length,u,null,null),te=(0,se.optionsShowLeadingVisuals)(e,y,f);return(0,zt.jsx)(aa,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:g,template:N.template,maxHeight:N.maxHeight,innerRef:O=>{x.current=O},"data-aia-group":g,children:e.map((O,F)=>(0,zt.jsx)(oa,{option:O,isHighlighted:F===a,checked:t?t.includes(O.text):void 0,onSelect:i,onHighlight:()=>o(F),onUnhighlight:s?()=>s(F):void 0,id:`${r}-option-${F}`,loading:d,showIcon:y&&te,showImage:f&&te,showCount:p,scrollHint:!d&&N.scrollHintIndices.includes(F),enterDelayMs:d?0:(0,se.optionEnterDelayMs)(F,N.cols,e.length,v)},`${g}\0${O.text}`))})}var ue=require("@magicx-eng/ai-autocomplete-vanilla"),Ie=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-52a922cb")){let e=document.createElement("style");e.id="ac-style-52a922cb",e.textContent=`/* --- Time wheel (replaces the options grid for time suggestions) ---
3118
3125
 
3119
3126
  One of three hand-maintained copies (vanilla styles.css, this file, Angular's
3120
3127
  time-wheel.component.css). Only the class-naming layer differs \u2014 the
@@ -3236,7 +3243,7 @@
3236
3243
  .aia-done-llNY5:hover {
3237
3244
  background: var(--aia-time-done-bg-hover, var(--aia-done-bg-hover, #d8dde8));
3238
3245
  }
3239
- `,document.head.appendChild(e)}var Te={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"};var ve=require("react/jsx-runtime"),Ga=120;function na({view:e,label:i,doneLabel:a,interactive:o=!0,onTimeChange:n,onTimeCommit:s}){return(0,ve.jsxs)("div",{className:Te.timeWheel,"data-aia-time-wheel":"",role:"group","aria-label":i,onMouseDown:r=>r.preventDefault(),children:[(0,ve.jsx)("span",{className:Te.value,"data-aia-time-value":"","aria-live":"polite",children:(0,he.formatTime)(e.minutes)}),(0,ve.jsxs)("div",{className:Te.columns,"aria-hidden":"true",children:[(0,ve.jsx)("div",{className:Te.band}),he.TIME_WHEEL_COLUMNS.map(r=>(0,ve.jsxs)(Pe.Fragment,{children:[r==="minute"&&(0,ve.jsx)("span",{className:Te.separator,children:":"}),(0,ve.jsx)(qa,{column:r,minutes:e.minutes,interactive:o,onTimeChange:n})]},r))]}),(0,ve.jsx)("button",{type:"button",tabIndex:-1,className:Te.done,"data-aia-time-done":"",onClick:()=>{o&&s()},children:a})]})}function qa({column:e,minutes:i,interactive:a,onTimeChange:o}){let n=(0,Pe.useRef)(null),s=(0,Pe.useRef)(null),r=(0,Pe.useRef)(null),d=(0,Pe.useRef)({minutes:i,interactive:a,onTimeChange:o});d.current={minutes:i,interactive:a,onTimeChange:o};let g=(0,he.timeWheelIndex)(e,i);(0,Pe.useLayoutEffect)(()=>{let m=n.current;if(!m||r.current)return;let p=g*he.TIME_WHEEL_ROW_HEIGHT;Math.abs(m.scrollTop-p)<1||(s.current=p,m.scrollTop=p)},[g]),(0,Pe.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);let w=()=>{r.current=null;let m=n.current,p=d.current;if(!m||!p.interactive)return;let h=(0,he.timeWheelIndexFromScroll)(e,m.scrollTop);h!==(0,he.timeWheelIndex)(e,p.minutes)&&p.onTimeChange((0,he.withTimeWheelIndex)(e,p.minutes,h))},y=()=>{let m=n.current;if(m){if(s.current!=null&&Math.abs(m.scrollTop-s.current)<1){s.current=null;return}s.current=null,r.current&&clearTimeout(r.current),r.current=setTimeout(w,Ga)}};return(0,ve.jsx)("div",{ref:n,className:Te.column,"data-aia-time-column":e,onScroll:y,children:(0,he.timeWheelRows)(e).map((m,p)=>(0,ve.jsx)("div",{className:p===g?`${Te.row} ${Te.selected}`:Te.row,"data-aia-time-row":"","data-aia-index":p,onClick:()=>{d.current.interactive&&o((0,he.withTimeWheelIndex)(e,d.current.minutes,p))},children:m.label},m.label))})}if(typeof document<"u"&&!document.getElementById("ac-style-8414cd5f")){let e=document.createElement("style");e.id="ac-style-8414cd5f",e.textContent=`.aia-stack {
3246
+ `,document.head.appendChild(e)}var Pe={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"};var ye=require("react/jsx-runtime"),Ga=120;function ra({view:e,label:a,doneLabel:t,interactive:i=!0,onTimeChange:o,onTimeCommit:s}){return(0,ye.jsxs)("div",{className:Pe.timeWheel,"data-aia-time-wheel":"",role:"group","aria-label":a,onMouseDown:r=>r.preventDefault(),children:[(0,ye.jsx)("span",{className:Pe.value,"data-aia-time-value":"","aria-live":"polite",children:(0,ue.formatTime)(e.minutes)}),(0,ye.jsxs)("div",{className:Pe.columns,"aria-hidden":"true",children:[(0,ye.jsx)("div",{className:Pe.band}),ue.TIME_WHEEL_COLUMNS.map(r=>(0,ye.jsxs)(Ie.Fragment,{children:[r==="minute"&&(0,ye.jsx)("span",{className:Pe.separator,children:":"}),(0,ye.jsx)(qa,{column:r,minutes:e.minutes,interactive:i,onTimeChange:o})]},r))]}),(0,ye.jsx)("button",{type:"button",tabIndex:-1,className:Pe.done,"data-aia-time-done":"",onClick:()=>{i&&s()},children:t})]})}function qa({column:e,minutes:a,interactive:t,onTimeChange:i}){let o=(0,Ie.useRef)(null),s=(0,Ie.useRef)(null),r=(0,Ie.useRef)(null),d=(0,Ie.useRef)({minutes:a,interactive:t,onTimeChange:i});d.current={minutes:a,interactive:t,onTimeChange:i};let g=(0,ue.timeWheelIndex)(e,a);(0,Ie.useLayoutEffect)(()=>{let f=o.current;if(!f||r.current)return;let p=g*ue.TIME_WHEEL_ROW_HEIGHT;Math.abs(f.scrollTop-p)<1||(s.current=p,f.scrollTop=p)},[g]),(0,Ie.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);let v=()=>{r.current=null;let f=o.current,p=d.current;if(!f||!p.interactive)return;let u=(0,ue.timeWheelIndexFromScroll)(e,f.scrollTop);u!==(0,ue.timeWheelIndex)(e,p.minutes)&&p.onTimeChange((0,ue.withTimeWheelIndex)(e,p.minutes,u))},y=()=>{let f=o.current;if(f){if(s.current!=null&&Math.abs(f.scrollTop-s.current)<1){s.current=null;return}s.current=null,r.current&&clearTimeout(r.current),r.current=setTimeout(v,Ga)}};return(0,ye.jsx)("div",{ref:o,className:Pe.column,"data-aia-time-column":e,onScroll:y,children:(0,ue.timeWheelRows)(e).map((f,p)=>(0,ye.jsx)("div",{className:p===g?`${Pe.row} ${Pe.selected}`:Pe.row,"data-aia-time-row":"","data-aia-index":p,onClick:()=>{d.current.interactive&&i((0,ue.withTimeWheelIndex)(e,d.current.minutes,p))},children:f.label},f.label))})}if(typeof document<"u"&&!document.getElementById("ac-style-8414cd5f")){let e=document.createElement("style");e.id="ac-style-8414cd5f",e.textContent=`.aia-stack {
3240
3247
  display: flex;
3241
3248
  flex-direction: column;
3242
3249
  gap: var(--aia-stack-space, 0.5rem);
@@ -3251,7 +3258,7 @@
3251
3258
  align-items: end;
3252
3259
  }
3253
3260
  /* data-align="stretch" is the flex default \u2014 no rule needed. */
3254
- `,document.head.appendChild(e)}var sa=require("react/jsx-runtime");function ra({space:e,align:i="stretch",className:a,children:o,...n}){let s=e?{"--aia-stack-space":e}:void 0;return(0,sa.jsx)("div",{className:a?`aia-stack ${a}`:"aia-stack","data-align":i,style:s,...n,children:o})}var q=require("react/jsx-runtime"),_a=typeof window>"u"?_.useEffect:_.useLayoutEffect,Va=[159,119,164],Ua=()=>{},la=()=>{},Qa=e=>{},Ya=()=>{},ja=e=>{},$a=e=>{},Za=e=>{},Xa=e=>{};function Ja(e){let i=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[a,o]=(0,_.useState)(i);if((0,_.useEffect)(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let n=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>o(n.matches);return n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[e]),e!==void 0)return e==="auto"?a?"dark":"light":e}function ei(e,i){let a=(0,_.useRef)(null);(0,_.useEffect)(()=>{let o=e.current,n=i.current;if(!o||!n)return;let s=(0,z.queryLive)(o,".aia-grid[data-scroll]");if(a.current&&a.current.grid!==s&&(a.current.controller.destroy(),a.current=null),s&&!a.current){a.current={grid:s,controller:(0,z.attachScrollArrow)({dropdown:o,grid:s,button:n})};return}a.current?.controller.update()}),(0,_.useEffect)(()=>()=>{a.current?.controller.destroy(),a.current=null},[])}function ti(e,i){let a=(0,_.useRef)(i);a.current=i;let o=(0,_.useRef)(null);(0,_.useLayoutEffect)(()=>{let n=e.current;if(n){if(!o.current){o.current=(0,z.attachViewportFit)({dropdown:n,isOpen:()=>a.current});return}o.current.update()}}),(0,_.useEffect)(()=>()=>{o.current?.destroy(),o.current=null},[])}function Tt({suggestions:e,activeIndex:i,onSelect:a,onHighlight:o,onUnhighlight:n,isOpen:s,id:r,className:d,pills:g,onPillClick:w,showPills:y=!0,onSkip:m,showSkipButton:p=!0,showOptionIcons:h=!0,showOptionImages:x=!0,showOptionCounts:O=!0,skipDisabled:G=!1,activeSelected:R=!1,isLoading:U=!1,skeletonExiting:X=!1,isInputEmpty:D=!1,language:A,products:C,onProductSelect:de,onProductAddToCart:ee,onProductFocusChange:ce,productsLayout:K="row",productImageFallback:te="image",formatType:P="options",dateView:Z=null,selectedDateIso:u=null,selectedDateRange:I=null,dateRangeStart:_e=null,onPreviousMonth:Ne,onNextMonth:Je,timeView:Fe=null,multiSelectView:f=null,onMultiSelectCommit:et,onTimeChange:Ve,onTimeCommit:Ue,locationView:b=null,onLocationQuery:S,onLocationMove:T,onLocationCommit:E,onLocationFocusChange:M,isFocused:ae=!1,optionsPosition:me="below",mode:xe}){let ye=Ja(xe),tt=ye!==void 0,J=(0,_.useRef)(null),He=(0,_.useRef)(null);ei(J,He),(0,_.useEffect)(()=>{if(J.current)return(0,z.containScroll)(J.current)},[]);let st=e[0]?.options??[],ht=!!(g&&g.length>0&&w),Be=!!(C&&C.length>0),at=P==="time"&&Fe!=null,lt=P==="location"&&b!=null,ie=s&&(st.length>0||y&&ht||U||Be||at||lt);ti(J,ie),_a(()=>{let k=J.current;k&&(0,z.fitMultiSelectDone)(k,(0,z.findMultiSelectDone)(k))});let Ee={suggestions:e,activeIndex:i,pills:g,showPills:y,showSkipButton:p,showOptionIcons:h,showOptionImages:x,showOptionCounts:O,skipDisabled:G,activeSelected:R,isLoading:U,skeletonExiting:X,isInputEmpty:D,products:C,formatType:P,dateView:Z,selectedDateIso:u,selectedDateRange:I,dateRangeStart:_e,timeView:Fe,multiSelectView:f,locationView:b},We=(0,_.useRef)(Ee);ie&&(We.current=Ee);let t=ie?Ee:We.current,oe=(0,z.uiStringsFor)(A),Qe=t.suggestions[0],ke=Qe?.options??[],v=t.activeIndex>=0&&!!ke[t.activeIndex]?.is_tappable,Ae=(0,z.labelTraditionalAutocomplete)(t.pills??[],oe.keepTyping),Ye=!!(Ae.length>0&&w),Ke=t.showPills&&Ye,ut=t.showPills&&!Ye&&t.isLoading,dt=Ke||ut,Ge=Ye&&(0,z.hasSkippablePill)(Ae)&&t.showSkipButton&&!t.isInputEmpty&&!!m,ct=Ae[0]?.text,Ce=(0,z.isCalendarFormat)(t.formatType)&&t.dateView!=null,Le=ke.length>0&&!Ce,je=ke.length>0&&Ce&&!t.isLoading,it=t.formatType==="time"&&t.timeView!=null&&!t.isLoading,pt=t.formatType==="location"&&t.locationView!=null&&!t.isLoading,ot=t.isLoading&&!Le&&!je&&!it&&!pt,nt=t.products??[],c=(0,z.panelMorphKey)(Ke?Ae:[]);return(0,_.useLayoutEffect)(()=>{J.current&&(0,z.settlePanelMorph)(J.current,c,{visible:ie,anchorBottom:me==="above"})},[c,ie,me,t.suggestions,t.pills,t.isLoading,t.skeletonExiting,t.isInputEmpty,t.products,t.formatType,t.dateView,t.selectedDateIso,t.selectedDateRange,t.dateRangeStart,t.timeView,t.multiSelectView,t.locationView,t.showPills,t.showSkipButton,t.showOptionIcons,t.showOptionImages,t.showOptionCounts,K,A]),(0,_.useEffect)(()=>{let k=J.current;return()=>{k&&(0,z.destroyPanelMorph)(k)}},[]),(0,q.jsxs)("div",{ref:J,id:r,role:"listbox","aria-multiselectable":!!t.multiSelectView,"data-aia-dropdown":"","data-options-position":me,"data-mode":ye,"data-aia-loading":t.isLoading?"":void 0,"data-aia-skeleton-exiting":t.skeletonExiting?"":void 0,"data-aia-has-products":nt.length>0?"":void 0,className:`${tt?"magicx-aia ":""}${Oe.dropdown} ${ie?Oe.visible:""} ${d??""}`,onMouseDown:k=>k.preventDefault(),children:[(0,q.jsxs)(ra,{space:"8px",children:[(dt||Ge)&&(0,q.jsxs)(ft,{noWrap:!0,className:Oe.pillBar,"data-aia-pillbar":"",children:[dt&&(0,q.jsx)("span",{className:Oe.pillScroll,"data-aia-pill-scroll":"",children:(0,q.jsx)(Ct,{pills:Ae,activePillIndex:0,activeSelected:t.activeSelected,onSelectPill:w??(()=>{}),rounded:!0,loading:t.isLoading})}),Ge&&(0,q.jsx)("button",{type:"button",tabIndex:-1,className:Oe.skip,"data-aia-skip":"",disabled:t.isLoading||t.skipDisabled,"aria-label":ct?`${oe.skipLabel} ${ct}`:oe.skipLabel,onClick:m,children:oe.skip})]}),Le&&(0,q.jsx)(oa,{options:ke,activeIndex:t.activeIndex,onSelect:a,onHighlight:o,onUnhighlight:n,listboxId:r,loading:t.isLoading,groupKey:Qe?`${Qe.parameter} ${Qe.text}`:"",optionsPosition:me,showIcons:t.showOptionIcons,showImages:t.showOptionImages,showCounts:t.showOptionCounts,picked:t.isLoading?void 0:t.multiSelectView?.picked}),t.multiSelectView&&!t.isLoading&&(0,q.jsx)("div",{onClick:k=>{k.target.closest("[data-aia-multi-done]")&&!t.skipDisabled&&et?.()},children:(0,q.jsx)("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-multi-done":"",className:Oe.multiDone,ref:k=>{k&&(k.disabled=!0,k.offsetHeight,k.disabled=t.skipDisabled)},children:oe.done})}),je&&t.dateView&&(0,q.jsx)(Vt,{options:ke,activeIndex:t.activeIndex,listboxId:r,view:t.dateView,selection:{selectedIso:t.selectedDateIso??null,selectedRange:t.selectedDateRange??null,rangeStart:t.dateRangeStart??null,floor:(0,z.dateFloorFor)(t.formatType,t.dateRangeStart)},onSelect:a,onHighlight:o,onUnhighlight:n,onPreviousMonth:Ne??la,onNextMonth:Je??la}),it&&t.timeView&&(0,q.jsx)(na,{view:t.timeView,label:oe.timeLabel,doneLabel:oe.done,interactive:!t.skipDisabled,onTimeChange:Ve??Qa,onTimeCommit:Ue??Ya}),pt&&t.locationView&&(0,q.jsx)(jt,{view:t.locationView,searchLabel:oe.locationSearch,noResultsLabel:oe.locationNoResults,useTypedLabel:oe.locationUseTyped,widgetFocused:ae&&ie,visible:ie,interactive:!t.skipDisabled,onQuery:S??ja,onMove:T??$a,onCommit:E??Za,onFocusChange:M??Xa}),ot&&(0,q.jsx)("div",{className:Oe.skeletonBars,"data-aia-skeleton-bars":"",children:Va.map(k=>(0,q.jsx)("span",{className:Oe.skeletonBar,style:{width:k}},`bar-${k}`))}),(0,q.jsx)(Jt,{products:nt,listboxId:r,onSelect:de??Ua,onAddToCart:ee,onFocusChange:ce,focusable:ie,layout:K,imageFallback:te,strings:oe}),(0,q.jsx)(Ut,{isOptionHighlighted:v,isInputEmpty:t.isInputEmpty,strings:oe})]}),(0,q.jsx)("button",{ref:He,type:"button",tabIndex:-1,className:Oe.scrollArrow,"data-aia-scroll-arrow":"","aria-label":oe.scrollArrow,"aria-hidden":"true",children:(0,q.jsx)("svg",{viewBox:"0 0 16 16",width:"18",height:"18",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:(0,q.jsx)("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}var ze=require("@magicx-eng/ai-autocomplete-vanilla");var ca=require("@magicx-eng/ai-autocomplete-vanilla");if(typeof document<"u"&&!document.getElementById("ac-style-fdee06e6")){let e=document.createElement("style");e.id="ac-style-fdee06e6",e.textContent=`.aia-submitButton-otz7H {
3261
+ `,document.head.appendChild(e)}var la=require("react/jsx-runtime");function sa({space:e,align:a="stretch",className:t,children:i,...o}){let s=e?{"--aia-stack-space":e}:void 0;return(0,la.jsx)("div",{className:t?`aia-stack ${t}`:"aia-stack","data-align":a,style:s,...o,children:i})}var _=require("react/jsx-runtime"),_a=typeof window>"u"?V.useEffect:V.useLayoutEffect,Va=[159,119,164],Ua=()=>{},da=()=>{},Qa=e=>{},Ya=()=>{},ja=e=>{},$a=e=>{},Za=e=>{},Xa=e=>{};function Ja(e){let a=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[t,i]=(0,V.useState)(a);if((0,V.useEffect)(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let o=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>i(o.matches);return o.addEventListener("change",s),()=>o.removeEventListener("change",s)},[e]),e!==void 0)return e==="auto"?t?"dark":"light":e}function ei(e,a){let t=(0,V.useRef)(null);(0,V.useEffect)(()=>{let i=e.current,o=a.current;if(!i||!o)return;let s=(0,M.queryLive)(i,".aia-grid[data-scroll]");if(t.current&&t.current.grid!==s&&(t.current.controller.destroy(),t.current=null),s&&!t.current){t.current={grid:s,controller:(0,M.attachScrollArrow)({dropdown:i,grid:s,button:o})};return}t.current?.controller.update()}),(0,V.useEffect)(()=>()=>{t.current?.controller.destroy(),t.current=null},[])}function ti(e,a){let t=(0,V.useRef)(a);t.current=a;let i=(0,V.useRef)(null);(0,V.useLayoutEffect)(()=>{let o=e.current;if(o){if(!i.current){i.current=(0,M.attachViewportFit)({dropdown:o,isOpen:()=>t.current});return}i.current.update()}}),(0,V.useEffect)(()=>()=>{i.current?.destroy(),i.current=null},[])}function Tt({suggestions:e,activeIndex:a,onSelect:t,onHighlight:i,onUnhighlight:o,isOpen:s,id:r,className:d,pills:g,onPillClick:v,showPills:y=!0,onSkip:f,showSkipButton:p=!0,showOptionIcons:u=!0,showOptionImages:x=!0,showOptionCounts:A=!0,skipDisabled:q=!1,activeSelected:H=!1,isLoading:N=!1,skeletonExiting:te=!1,isInputEmpty:O=!1,language:F,products:T,onProductSelect:Q,onProductAddToCart:ae,onProductFocusChange:de,productsLayout:J="row",productImageFallback:ee="image",formatType:P="options",dateView:Y=null,selectedDateIso:Ae=null,selectedDateRange:ke=null,dateRangeStart:ve=null,onPreviousMonth:c,onNextMonth:E,timeView:Ge=null,multiSelectView:b=null,onMultiSelectCommit:tt,onTimeChange:Qe,onTimeCommit:Ye,locationView:w=null,isReediting:S=!1,onLocationQuery:I,onLocationMove:R,onLocationCommit:D,onLocationFocusChange:oe,isFocused:Ce=!1,optionsPosition:ge="below",mode:Re}){let je=Ja(Re),Le=je!==void 0,ce=(0,V.useRef)(null),at=(0,V.useRef)(null);ei(ce,at),(0,V.useEffect)(()=>{if(ce.current)return(0,M.containScroll)(ce.current)},[]);let ht=e[0]?.options??[],qe=!!(g&&g.length>0&&v),it=!!(T&&T.length>0),rt=P==="time"&&Ge!=null,_e=P==="location"&&w!=null,pe=s&&(ht.length>0||y&&qe||N||it||rt||_e);ti(ce,pe),_a(()=>{let C=ce.current;C&&(0,M.fitMultiSelectDone)(C,(0,M.findMultiSelectDone)(C))});let Oe={suggestions:e,activeIndex:a,pills:g,showPills:y,showSkipButton:p,showOptionIcons:u,showOptionImages:x,showOptionCounts:A,skipDisabled:q,activeSelected:H,isLoading:N,skeletonExiting:te,isInputEmpty:O,products:T,formatType:P,dateView:Y,selectedDateIso:Ae,selectedDateRange:ke,dateRangeStart:ve,timeView:Ge,multiSelectView:b,locationView:w,isReediting:S},k=(0,V.useRef)(Oe);pe&&(k.current=Oe);let n=pe?Oe:k.current,ne=(0,M.uiStringsFor)(F),De=n.suggestions[0],m=De?.options??[],st=n.activeIndex>=0&&!!m[n.activeIndex]?.is_tappable,Me=(0,M.labelTraditionalAutocomplete)(n.pills??[],ne.keepTyping),ze=!!(Me.length>0&&v),lt=n.showPills&&ze,ut=n.showPills&&!ze&&n.isLoading,Ve=lt||ut,dt=ze&&(0,M.hasSkippablePill)(Me)&&n.showSkipButton&&!n.isInputEmpty&&!!f,Se=Me[0]?.text,Ne=(0,M.isCalendarFormat)(n.formatType)&&n.dateView!=null,$e=m.length>0&&!Ne,ot=m.length>0&&Ne&&!n.isLoading,ct=n.formatType==="time"&&n.timeView!=null&&!n.isLoading,Ze=n.formatType==="location"&&n.locationView!=null&&!n.isLoading,pt=n.isLoading&&!$e&&!ot&&!ct&&!Ze,h=n.products??[],B=(0,M.panelMorphKey)(lt?Me:[]);return(0,V.useLayoutEffect)(()=>{ce.current&&(0,M.settlePanelMorph)(ce.current,B,{visible:pe,anchorBottom:ge==="above"})},[B,pe,ge,n.suggestions,n.pills,n.isLoading,n.skeletonExiting,n.isInputEmpty,n.products,n.formatType,n.dateView,n.selectedDateIso,n.selectedDateRange,n.dateRangeStart,n.timeView,n.multiSelectView,n.locationView,n.showPills,n.showSkipButton,n.showOptionIcons,n.showOptionImages,n.showOptionCounts,J,F]),(0,V.useEffect)(()=>{let C=ce.current;return()=>{C&&(0,M.destroyPanelMorph)(C)}},[]),(0,_.jsxs)("div",{ref:ce,id:r,role:"listbox","aria-multiselectable":!!n.multiSelectView,"data-aia-dropdown":"","data-options-position":ge,"data-mode":je,"data-aia-loading":n.isLoading?"":void 0,"data-aia-skeleton-exiting":n.skeletonExiting?"":void 0,"data-aia-has-products":h.length>0?"":void 0,className:`${Le?"magicx-aia ":""}${Fe.dropdown} ${pe?Fe.visible:""} ${d??""}`,onMouseDown:C=>C.preventDefault(),children:[(0,_.jsxs)(sa,{space:"8px",children:[(Ve||dt)&&(0,_.jsxs)(ft,{noWrap:!0,className:Fe.pillBar,"data-aia-pillbar":"",children:[Ve&&(0,_.jsx)("span",{className:Fe.pillScroll,"data-aia-pill-scroll":"",children:(0,_.jsx)(Ct,{pills:Me,activePillIndex:0,activeSelected:n.activeSelected,onSelectPill:v??(()=>{}),rounded:!0,loading:n.isLoading})}),dt&&(0,_.jsx)("button",{type:"button",tabIndex:-1,className:Fe.skip,"data-aia-skip":"",disabled:n.isLoading||n.skipDisabled,"aria-label":Se?`${ne.skipLabel} ${Se}`:ne.skipLabel,onClick:f,children:ne.skip})]}),$e&&(0,_.jsx)(na,{options:m,activeIndex:n.activeIndex,onSelect:t,onHighlight:i,onUnhighlight:o,listboxId:r,loading:n.isLoading,groupKey:De?`${De.parameter} ${De.text}`:"",optionsPosition:ge,showIcons:n.showOptionIcons,showImages:n.showOptionImages,showCounts:n.showOptionCounts,picked:n.isLoading?void 0:n.multiSelectView?.picked}),n.multiSelectView&&!n.isLoading&&(0,_.jsx)("div",{onClick:C=>{C.target.closest("[data-aia-multi-done]")&&!n.skipDisabled&&tt?.()},children:(0,_.jsx)("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-multi-done":"",className:Fe.multiDone,ref:C=>{C&&(C.disabled=!0,C.offsetHeight,C.disabled=n.skipDisabled)},children:ne.done})}),ot&&n.dateView&&(0,_.jsx)(Vt,{options:m,activeIndex:n.activeIndex,listboxId:r,view:n.dateView,selection:{selectedIso:n.selectedDateIso??null,selectedRange:n.selectedDateRange??null,rangeStart:n.dateRangeStart??null,floor:(0,M.dateFloorFor)(n.formatType,n.dateRangeStart)},onSelect:t,onHighlight:i,onUnhighlight:o,onPreviousMonth:c??da,onNextMonth:E??da}),ct&&n.timeView&&(0,_.jsx)(ra,{view:n.timeView,label:ne.timeLabel,doneLabel:ne.done,interactive:!n.skipDisabled,onTimeChange:Qe??Qa,onTimeCommit:Ye??Ya}),Ze&&n.locationView&&(0,_.jsx)($t,{view:n.locationView,searchLabel:ne.locationSearch,noResultsLabel:ne.locationNoResults,useTypedLabel:ne.locationUseTyped,widgetFocused:Ce&&pe,reediting:n.isReediting,visible:pe,interactive:!n.skipDisabled,onQuery:I??ja,onMove:R??$a,onCommit:D??Za,onFocusChange:oe??Xa}),pt&&(0,_.jsx)("div",{className:Fe.skeletonBars,"data-aia-skeleton-bars":"",children:Va.map(C=>(0,_.jsx)("span",{className:Fe.skeletonBar,style:{width:C}},`bar-${C}`))}),(0,_.jsx)(ea,{products:h,listboxId:r,onSelect:Q??Ua,onAddToCart:ae,onFocusChange:de,focusable:pe,layout:J,imageFallback:ee,strings:ne}),(0,_.jsx)(Ut,{isOptionHighlighted:st,isInputEmpty:n.isInputEmpty,strings:ne})]}),(0,_.jsx)("button",{ref:at,type:"button",tabIndex:-1,className:Fe.scrollArrow,"data-aia-scroll-arrow":"","aria-label":ne.scrollArrow,"aria-hidden":"true",children:(0,_.jsx)("svg",{viewBox:"0 0 16 16",width:"18",height:"18",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:(0,_.jsx)("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}var Ke=require("@magicx-eng/ai-autocomplete-vanilla");var pa=require("@magicx-eng/ai-autocomplete-vanilla");if(typeof document<"u"&&!document.getElementById("ac-style-fdee06e6")){let e=document.createElement("style");e.id="ac-style-fdee06e6",e.textContent=`.aia-submitButton-otz7H {
3255
3262
  flex-shrink: 0;
3256
3263
  width: 32px;
3257
3264
  height: 32px;
@@ -3322,5 +3329,5 @@
3322
3329
  transition: none;
3323
3330
  }
3324
3331
  }
3325
- `,document.head.appendChild(e)}var da={submitButton:"aia-submitButton-otz7H"};var Pt=require("react/jsx-runtime");function pa({disabled:e,ready:i,onClick:a,label:o=(0,ca.uiStringsFor)().submit}){return(0,Pt.jsx)("button",{type:"button","data-aia-submit":"",className:da.submitButton,disabled:e,"data-aia-ready":i?"":void 0,onClick:n=>{n.stopPropagation(),a()},"aria-label":o,children:(0,Pt.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":o,children:(0,Pt.jsx)("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}var Xe=require("@magicx-eng/ai-autocomplete-vanilla"),L=require("react");var Nt=require("react");function ha(e){let i=(0,Nt.useRef)(e);i.current=e;let a=Object.keys(e??{}).sort().join("\0"),o=(0,Nt.useRef)({key:"",overrides:void 0});if(o.current.key!==a){let n={};for(let s of Object.keys(e??{})){let r=(d,g,w)=>{let y=i.current?.[s];return y?y(d,g,w):[]};n[s]=r}o.current={key:a,overrides:e?n:void 0}}return{overrides:o.current.overrides,key:a}}var Ft=require("react");function ua(e){let i=(0,Ft.useRef)(e);i.current=e;let a=(0,Ft.useRef)(null);a.current===null&&(a.current={fetch:(n,s)=>{let r=i.current;return r?r.fetch(n,s):Promise.reject(new Error("products config removed"))},transform:n=>i.current?.transform(n)??[],get limit(){return i.current?.limit}});let o=e!==void 0;return{config:o?a.current:void 0,enabled:o}}var ma={text:"",completedParams:[],identifiedParams:[],skippedParams:[],pendingSpan:null,suggestions:[],products:[],traditionalAutocomplete:!1,customFields:null,optionSearch:null,activeDropdownIndex:-1,newParamId:null,isLoading:!0,isReady:!1,error:null,segments:[],actionableSuggestions:[],filteredOptions:[],dropdownLoading:!0,dropdownOptions:[],skeletonOptions:null,skeletonSuggestion:null,dropdownSuggestion:null,skeletonRequested:!1,skeletonExiting:!1,activeFormatType:"options",dateView:null,dateRangeStart:null,dateFloor:null,timeView:null,multiSelectView:null,multiSelectDraft:null,locationView:null,locationSearch:null,locationAutocomplete:!0,locationFieldFocused:!1,placeholderText:"",leadInText:"",optionQuery:"",isSearchingOptions:!1,isDropdownOpen:!1,isActivePillSelected:!1,filterBase:0,filterInProgress:!1,pillTapped:!1,skipNextFetch:!1,lastRawQuery:"",isFocused:!1,dropdownHeld:!1,editingParam:null,editingIdentified:null,editingAnchor:null,editingTail:null,caretOffset:null,inSelectionAnimation:!1,dateViewMonth:null,pendingRangeStart:null,timeDraft:null};function It({onSubmit:e,onResult:i,onError:a,optionOverrides:o,maskCompletedText:n,apiConfig:s,additionalContext:r,language:d,currency:g,productId:w,visitorId:y,columns:m=2,dropdownTrigger:p,optionsPosition:h,closeDropdownOnBlur:x,prependPlaceholder:O,showNonTappableOptions:G,locationSearch:R,showOptionIcons:U,showOptionImages:X,showOptionCounts:D,showSkipButton:A,showProducts:C,productImageFallback:de="image",onFocus:ee,onBlur:ce,value:K,completedParams:te,onChange:P,onParamsChange:Z,products:u,mapProducts:I,onProductSelect:_e,onProductAddToCart:Ne,source:Je,setCursor:Fe}){let f=(0,L.useRef)(null),[et,Ve]=(0,L.useState)(null),Ue=(0,L.useRef)(e);Ue.current=e;let b=(0,L.useRef)(i);b.current=i;let S=(0,L.useRef)(a);S.current=a;let T=(0,L.useRef)(P);T.current=P;let E=(0,L.useRef)(Z);E.current=Z;let M=(0,L.useRef)(ee);M.current=ee;let ae=(0,L.useRef)(ce);ae.current=ce;let me=(0,L.useRef)(Fe);me.current=Fe;let xe=(0,L.useRef)(_e);xe.current=_e;let ye=(0,L.useRef)(Ne);ye.current=Ne;let tt=(0,L.useRef)(y);tt.current=y;let J=(0,L.useRef)(()=>{let c=tt.current;return typeof c=="function"?c():c}).current,He=ua(u),st=(0,L.useRef)(I);st.current=I;let ht=(0,L.useRef)((c,k)=>{let B=st.current;return B?B(c,k):c}).current,Be=I?ht:void 0,at=ha(o);(0,L.useEffect)(()=>{if(typeof document>"u")return;let c=new Xe.AIAutocomplete(document.createElement("div"),{renderMode:"headless",apiConfig:s,additionalContext:r,language:d,currency:g,productId:w,visitorId:J,optionOverrides:at.overrides,maskCompletedText:n,columns:m,dropdownTrigger:p,optionsPosition:h,closeDropdownOnBlur:x,prependPlaceholder:O,showNonTappableOptions:G,locationSearch:R,showProducts:C,source:Je,value:K,completedParams:te,onSubmit:(...B)=>Ue.current?.(...B),onResult:(...B)=>b.current?.(...B),onError:(...B)=>S.current?.(...B),onChange:(...B)=>T.current?.(...B),onParamsChange:(...B)=>E.current?.(...B),onFocus:()=>M.current?.(),onBlur:()=>ae.current?.(),onProductSelect:B=>xe.current?.(B),onProductAddToCart:B=>ye.current?.(B),setCursor:B=>me.current?.(B),products:He.config,mapProducts:Be});f.current=c,Ve(c.getState());let k=c.subscribe(B=>Ve(B));return()=>{k(),c.destroy(),f.current===c&&(f.current=null)}},[]),(0,L.useEffect)(()=>{K!==void 0&&f.current?.setValue(K)},[K]),(0,L.useEffect)(()=>{te!==void 0&&f.current?.setCompletedParams(te)},[te]);let lt=JSON.stringify(s??null),ie;try{ie=JSON.stringify(r??null)}catch{ie="[unstringifiable]"}(0,L.useEffect)(()=>{f.current?.update({apiConfig:s,additionalContext:r,language:d,currency:g,productId:w,optionOverrides:at.overrides,dropdownTrigger:p,optionsPosition:h,closeDropdownOnBlur:x,prependPlaceholder:O,showNonTappableOptions:G,locationSearch:R,showProducts:C})},[lt,ie,d,g?.code,g?.rate,g?.country,w,at.key,p,h,x,O,G,R,C]);let Ee=(0,L.useRef)(!1);(0,L.useEffect)(()=>{if(!Ee.current){Ee.current=!0;return}f.current?.update({products:He.config})},[He.enabled]),(0,L.useEffect)(()=>{f.current?.update({mapProducts:Be})},[Be]);let We=(0,L.useRef)(null);We.current===null&&(We.current={handleTextChange:c=>f.current?.handleTextChange(c),handleKeyDown:c=>{let k="nativeEvent"in c?c.nativeEvent:c;f.current?.handleKeyDown(k)},setFocused:c=>f.current?.setFocused(c),startEditingParam:c=>f.current?.startEditingParam(c),exitEditMode:()=>f.current?.exitEditMode(),handleCaretAfterInput:c=>f.current?.handleCaretAfterInput(c),handleCaretMove:c=>f.current?.handleCaretMove(c),replaceEditingRange:c=>f.current?.replaceEditingRange(c)??!1,setActivePill:c=>f.current?.setActivePill(c),skipActivePill:()=>f.current?.skipActivePill(),removeLastParam:()=>f.current?.removeLastParam(),clearNewParamId:()=>f.current?.clearNewParamId(),reset:()=>f.current?.reset(),refreshProducts:()=>f.current?.refreshProducts(),prepareSubmit:()=>f.current?.prepareSubmit(),getState:()=>f.current?.getState()??ma,recordSubmit:c=>f.current?.recordSubmit(c),selectOption:(c,k)=>f.current?.selectOption(c,k),selectProduct:c=>f.current?.selectProduct(c),addProductToCart:c=>{let k=f.current;return!k||!ye.current?Promise.resolve():k.addProductToCart(c)},setActiveDropdownIndex:c=>f.current?.setActiveDropdownIndex(c),clearHighlight:c=>f.current?.clearHighlight(c),showPreviousMonth:()=>f.current?.showPreviousMonth(),showNextMonth:()=>f.current?.showNextMonth(),setTime:c=>f.current?.setTime(c),commitTime:()=>f.current?.commitTime(),toggleMultiSelectOption:c=>f.current?.toggleMultiSelectOption(c),commitMultiSelect:()=>f.current?.commitMultiSelect(),setLocationQuery:c=>f.current?.setLocationQuery(c),moveLocationHighlight:c=>f.current?.moveLocationHighlight(c),commitLocation:c=>f.current?.commitLocation(c),setLocationFieldFocused:c=>f.current?.setLocationFieldFocused(c),handleFocus:()=>f.current?.setFocused(!0),handleBlur:()=>f.current?.setFocused(!1)});let t=We.current,oe=(0,L.useCallback)(c=>{let k=c.target.value,vt=k.length>0&&!c.nativeEvent?.isComposing&&k[0]!==k[0].toUpperCase()?k[0].toUpperCase()+k.slice(1):k;f.current?.handleTextChange(vt)},[]),Qe=(0,L.useCallback)(c=>{f.current?.handleKeyDown(c.nativeEvent)},[]),ke=f.current,v=et??ma,Ae=K!==void 0?K:v.text,Ye=te!==void 0?te:v.completedParams,Ke=v.actionableSuggestions,ut=Ke[0],dt=(0,Xe.withoutTraditionalAutocomplete)(Ke),Ge=ke?.listboxId??"",ct=v.activeDropdownIndex>=0&&ke?`${Ge}-option-${v.activeDropdownIndex}`:void 0,Ce=v.editingParam,Le=v.editingIdentified,je=Ce?{parameter:Ce.suggestionParameter,text:Ce.suggestionPlaceholder,required:!0,options:Ce.options}:Le?{parameter:Le.parameter,text:(0,Xe.identifiedParamLabel)(Le.parameter),required:!0,options:[]}:null,it=v.dropdownSuggestion??je??ut,pt=je?[je]:Ke,ot=(0,Xe.dateSelectionFor)(v),nt=!ke||v.dropdownLoading;return{completedParams:Ye,multiSelectView:v.multiSelectView,toggleMultiSelectOption:t.toggleMultiSelectOption,commitMultiSelect:t.commitMultiSelect,skippedParams:v.skippedParams,identifiedParams:v.identifiedParams,suggestionPills:dt,setActivePill:t.setActivePill,skipActivePill:t.skipActivePill,removeLastParam:t.removeLastParam,segments:v.segments,newParamId:v.newParamId,clearNewParamId:t.clearNewParamId,suggestions:v.suggestions,activeIndex:v.activeDropdownIndex,isReady:v.isReady,isLoading:nt,isFocused:v.isFocused,isDropdownOpen:v.isDropdownOpen,isActivePillSelected:v.isActivePillSelected,placeholderText:v.placeholderText,listboxId:Ge,error:v.error,products:v.products,customFields:v.customFields,selectProduct:t.selectProduct,addProductToCart:t.addProductToCart,handleTextChange:t.handleTextChange,handleKeyDown:t.handleKeyDown,setFocused:t.setFocused,editingParam:Ce,editingIdentified:Le,editingAnchor:v.editingAnchor,caretOffset:v.caretOffset,startEditingParam:t.startEditingParam,exitEditMode:t.exitEditMode,handleCaretAfterInput:t.handleCaretAfterInput,handleCaretMove:t.handleCaretMove,replaceEditingRange:t.replaceEditingRange,inputProps:{value:Ae,placeholder:v.placeholderText||void 0,onChange:oe,onKeyDown:Qe,onFocus:t.handleFocus,onBlur:t.handleBlur,role:"combobox","aria-expanded":v.isDropdownOpen,"aria-activedescendant":ct,"aria-autocomplete":"list","aria-controls":Ge},reset:t.reset,refreshProducts:t.refreshProducts,prepareSubmit:t.prepareSubmit,getState:t.getState,recordSubmit:t.recordSubmit,dropdownProps:{suggestions:it?[{...it,options:v.dropdownOptions}]:[],activeIndex:v.activeDropdownIndex,onSelect:t.selectOption,onHighlight:t.setActiveDropdownIndex,onUnhighlight:t.clearHighlight,isOpen:v.isDropdownOpen,id:Ge,pills:pt,activeSelected:v.isActivePillSelected,onPillClick:t.setActivePill,onSkip:t.skipActivePill,showSkipButton:(A??!0)&&!Ce&&!Le,showOptionIcons:U??!0,showOptionImages:X??!0,showOptionCounts:D??!0,skipDisabled:v.inSelectionAnimation,isLoading:nt,skeletonExiting:v.skeletonExiting,isInputEmpty:Ae.trim().length===0,language:d,products:v.products,productImageFallback:de,onProductSelect:t.selectProduct,onProductAddToCart:Ne?t.addProductToCart:void 0,onProductFocusChange:t.setFocused,formatType:v.activeFormatType,dateView:v.dateView,selectedDateIso:ot.selectedIso,selectedDateRange:ot.selectedRange,dateRangeStart:ot.rangeStart,onPreviousMonth:t.showPreviousMonth,onNextMonth:t.showNextMonth,timeView:v.timeView,multiSelectView:v.multiSelectView,onMultiSelectCommit:t.commitMultiSelect,onTimeChange:t.setTime,onTimeCommit:t.commitTime,locationView:v.locationView,onLocationQuery:t.setLocationQuery,onLocationMove:t.moveLocationHighlight,onLocationCommit:t.commitLocation,onLocationFocusChange:t.setLocationFieldFocused,isFocused:v.isFocused||v.locationFieldFocused,optionsPosition:h??"below"}}}var le=require("@magicx-eng/ai-autocomplete-vanilla"),N=require("react"),Et;function ai(){if(Et!==void 0)return Et;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),Et=e.contentEditable==="plaintext-only",Et}function ga(e){let{segments:i,showChipIcons:a=!0,showChipImages:o=!0,newParamId:n,editingParam:s,editingIdentified:r,editingAnchor:d,caretOffset:g,placeholderText:w,isFocused:y,isDropdownOpen:m,listboxId:p,activeDescendantId:h,autoFocus:x,handleTextChange:O,handleKeyDown:G,handleCaretAfterInput:R,handleCaretMove:U,startEditingParam:X,replaceEditingRange:D,setFocused:A}=e,C=(0,N.useRef)(null),de=(0,N.useRef)(!1),ee=(0,N.useRef)(""),ce=(0,N.useRef)(""),K=(0,N.useRef)(null),te=(0,N.useRef)(0);K.current=g,(0,N.useEffect)(()=>{if(!x)return;let b=C.current;if(!b)return;document.activeElement===b?A(!0):b.focus();let S=b.ownerDocument??document,T=S.getSelection(),E=T&&T.rangeCount>0&&b.contains(T.anchorNode);if(T&&!E){let M=S.createRange();M.selectNodeContents(b),M.collapse(!0),T.removeAllRanges(),T.addRange(M)}},[x,A]),(0,N.useEffect)(()=>{let b=C.current;if(!b)return;let S=b.ownerDocument??document,T=()=>{let E=S.getSelection();if(!E||E.rangeCount===0||!E.anchorNode||!b.contains(E.anchorNode))return;let M=E.anchorNode,ae=M.nodeType===Node.ELEMENT_NODE?M:M.parentElement,xe=(E.isCollapsed?ae?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,ye=s?.id??r?.id??null;if(xe&&xe!==ye){X(xe);return}performance.now()-te.current<50||U((0,le.getCursorOffset)(b))};return S.addEventListener("selectionchange",T),()=>S.removeEventListener("selectionchange",T)},[s,r,X,U]),(0,N.useEffect)(()=>{let b=C.current;if(!b)return;let S=T=>{let E=(0,le.chipIdFromTap)(b,T.target);E&&(X(E),(0,le.keepCaretOnChip)(b,E))};return b.addEventListener("click",S),()=>b.removeEventListener("click",S)},[X]),(0,N.useLayoutEffect)(()=>{let b=C.current;b&&(0,le.renderEditableContent)({input:b,segments:i,newParamId:n,editingParamId:s?.id??null,placeholderText:w??"",isFocused:y,showChipIcons:a,showChipImages:o})},[i,n,s,w,y,a,o]),(0,N.useLayoutEffect)(()=>{let b=ee.current,S=n??"";if(ee.current=S,!S||S===b)return;let T=C.current;if(!T)return;T.focus();let E=K.current??(0,le.plainTextLength)(T);(0,le.setCursorOffset)(T,E)},[n]),(0,N.useLayoutEffect)(()=>{let b=ce.current,S=s?.id??"";if(ce.current=S,!S||S===b||d==null)return;let T=C.current;T&&(0,le.setCursorOffset)(T,d)},[s,d]);let P=(0,N.useCallback)(()=>{if(de.current)return;let b=C.current;if(!b)return;let S=(0,le.extractPlainText)(b),E=S.length>0&&S[0]!==S[0].toUpperCase()?S[0].toUpperCase()+S.slice(1):S;O(E)},[O]),Z=(0,N.useCallback)(()=>{te.current=performance.now(),P();let b=C.current;b&&R((0,le.getCursorOffset)(b))},[P,R]);(0,N.useEffect)(()=>{let b=C.current;if(!b)return;let S=T=>{let E=T,M=E.inputType;if(M==="insertParagraph"||M==="insertLineBreak"||M==="insertFromDrop"){T.preventDefault();return}if(M.startsWith("insert")||M.startsWith("delete")){let ae=M.startsWith("delete")?"":E.data??"";D(ae)&&T.preventDefault()}};return b.addEventListener("beforeinput",S),()=>b.removeEventListener("beforeinput",S)},[D]);let u=(0,N.useCallback)(()=>{de.current=!0,C.current?.setAttribute("data-aia-composing","true")},[]),I=(0,N.useCallback)(()=>{de.current=!1,C.current?.removeAttribute("data-aia-composing"),P()},[P]),_e=(0,N.useCallback)(b=>{b.preventDefault();let S=C.current;if(!S)return;let T=(b.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!T)return;let E=S.ownerDocument??document,M=E.getSelection();if(!M||M.rangeCount===0)return;let ae=M.getRangeAt(0);if(!S.contains(ae.startContainer))return;ae.deleteContents();let me=E.createTextNode(T);ae.insertNode(me),ae.setStartAfter(me),ae.collapse(!0),M.removeAllRanges(),M.addRange(ae),P()},[P]),Ne=(0,N.useCallback)(b=>G(b),[G]),Je=(0,N.useCallback)(()=>A(!0),[A]),Fe=(0,N.useCallback)(()=>A(!1),[A]),f=(0,N.useCallback)(()=>C.current?.focus(),[]),et=(0,N.useCallback)(()=>C.current?.blur(),[]),Ve=(0,N.useCallback)(()=>{let b=C.current;return b?(0,le.extractPlainText)(b):""},[]),Ue=ai()?"plaintext-only":"true";return{inputRef:C,editorProps:{ref:C,contentEditable:Ue,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":p,"aria-expanded":m,"aria-activedescendant":h,spellCheck:!0,enterKeyHint:"send",onInput:Z,onKeyDown:Ne,onCompositionStart:u,onCompositionEnd:I,onPaste:_e,onFocus:Je,onBlur:Fe},getPlainText:Ve,focus:f,blur:et}}var Ie=require("react/jsx-runtime");function ii(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var fa=(0,V.forwardRef)(function({onSubmit:i,onResult:a,onError:o,optionOverrides:n,maskCompletedText:s,className:r,apiConfig:d,additionalContext:g,language:w,currency:y,productId:m,visitorId:p,columns:h,pillPlacement:x="dropdown",mode:O="auto",optionsPosition:G="below",animations:R=!0,dropdownTrigger:U,closeDropdownOnBlur:X,prependPlaceholder:D,showNonTappableOptions:A,locationSearch:C,showOptionIcons:de=!0,showChipIcons:ee=!0,showChipImages:ce=!0,showOptionImages:K=!0,showOptionCounts:te=!0,showSkipButton:P,showProducts:Z,productsLayout:u,productImageFallback:I,autoFocus:_e=!0,onFocus:Ne,onBlur:Je,value:Fe,completedParams:f,onChange:et,onParamsChange:Ve,products:Ue,mapProducts:b,onProductSelect:S,onProductAddToCart:T,submitButton:E,resetOnSubmit:M=!0},ae){let me=(0,V.useRef)(null),xe=(0,V.useRef)(null),ye=(0,V.useRef)(null),tt=(0,V.useRef)(()=>{}),J=(0,V.useRef)(null),He=(0,V.useRef)(null);(0,V.useEffect)(()=>{let F=me.current;if(F)return J.current?J.current.setMode(O):J.current=new ze.ModeController(F,O),()=>{J.current?.destroy(),J.current=null}},[O]);let st=(0,V.useCallback)(F=>{let ge=He.current?.current;ge&&(ge.focus(),(0,ze.setCursorOffset)(ge,F))},[]),{completedParams:ht,suggestionPills:Be,setActivePill:at,skipActivePill:lt,segments:ie,newParamId:Ee,clearNewParamId:We,placeholderText:t,isFocused:oe,isDropdownOpen:Qe,isActivePillSelected:ke,isLoading:v,isReady:Ae,activeIndex:Ye,listboxId:Ke,handleTextChange:ut,handleKeyDown:dt,setFocused:Ge,editingParam:ct,editingIdentified:Ce,editingAnchor:Le,caretOffset:je,startEditingParam:it,handleCaretAfterInput:pt,handleCaretMove:ot,replaceEditingRange:nt,dropdownProps:c,reset:k,refreshProducts:B,prepareSubmit:vt,getState:Ht,recordSubmit:Bt}=It({onSubmit:F=>tt.current(F),onResult:a,onError:o,optionOverrides:n,maskCompletedText:s,apiConfig:d,additionalContext:g,language:w,currency:y,productId:m,visitorId:p,columns:h,dropdownTrigger:U,optionsPosition:G,closeDropdownOnBlur:X,prependPlaceholder:D,showNonTappableOptions:A,locationSearch:C,showOptionIcons:de,showOptionImages:K,showOptionCounts:te,showSkipButton:P,showProducts:Z,onFocus:Ne,onBlur:Je,value:Fe,completedParams:f,onChange:et,onParamsChange:Ve,products:Ue,mapProducts:b,onProductSelect:S,onProductAddToCart:T,source:"full-sdk",setCursor:st});(0,V.useEffect)(()=>{if(!Ee)return;let F=window.setTimeout(()=>We(),650);return()=>window.clearTimeout(F)},[Ee,We]);let ba=Ye>=0?`${Ke}-option-${Ye}`:void 0,{inputRef:At,editorProps:wa,focus:xt,blur:Wt,getPlainText:Kt}=ga({segments:ie,newParamId:Ee,editingParam:ct,editingIdentified:Ce,editingAnchor:Le,caretOffset:je,placeholderText:t,isFocused:oe,showChipIcons:ee,showChipImages:ce,isDropdownOpen:Qe,listboxId:Ke,activeDescendantId:ba,autoFocus:_e,handleTextChange:ut,handleKeyDown:dt,handleCaretAfterInput:pt,handleCaretMove:ot,startEditingParam:it,replaceEditingRange:nt,setFocused:Ge});He.current=At,(0,V.useLayoutEffect)(()=>{let F=xe.current,ge=At.current;if(!F||!ge)return;let gt=()=>{let qt=F.firstElementChild;if(!qt)return;let ka=qt.getBoundingClientRect(),Ca=ge.getBoundingClientRect();ka.top>=Ca.bottom-2?F.setAttribute("data-aia-pill-wrapped",""):F.removeAttribute("data-aia-pill-wrapped")};gt();let Gt=new ResizeObserver(gt);return Gt.observe(ge),()=>Gt.disconnect()},[ie,Be.length,v,At]),(0,V.useEffect)(()=>{let F=ye.current;if(F)return(0,ze.watchEditorHeight)(F)},[]),(0,V.useImperativeHandle)(ae,()=>({focus:xt,blur:Wt,reset:k,refreshProducts:B,setMode:F=>J.current?.setMode(F),skipActivePill:lt}),[xt,Wt,k,B,lt]);let mt=!!ie.length||ht.length>0,Lt=(0,V.useCallback)(F=>{if(!mt)return;F&&vt();let ge=Ht(),gt=(0,ze.buildSubmitResult)(Kt(),ge.completedParams,ge.skippedParams,{identifiedParams:ge.identifiedParams,isReady:ge.isReady,customFields:ge.customFields});F&&Bt(gt),i(gt),M&&k()},[Bt,M,mt,vt,Ht,i,k,Kt]);tt.current=()=>Lt(!1);let va=(0,V.useCallback)(F=>{F.target?.closest("[data-aia-pill]")||document.activeElement?.closest("[data-aia-location]")||xt()},[xt]),xa=x==="inline",ya=x==="dropdown";return(0,Ie.jsxs)("div",{ref:me,className:`magicx-aia ${rt.container} ${r??""}`,"data-pill-placement":x,"data-options-position":G,"data-animations":R?"on":"off","data-mode":ii(O),children:[(0,Ie.jsx)(Tt,{...c,showPills:ya,productsLayout:u,productImageFallback:I}),(0,Ie.jsxs)("div",{className:rt.inputWrapper,"data-aia-input-wrapper":"",onClick:va,children:[(0,Ie.jsxs)("div",{ref:ye,className:rt.editorArea,"data-aia-editor":"",children:[(0,Ie.jsx)("div",{...wa,className:rt.input,"data-aia-input":""}),xa&&(v||Be.length>0)&&(0,Ie.jsx)("span",{ref:xe,className:rt.pillListContainer,"data-aia-pill-list-container":"",children:(0,Ie.jsx)(Ct,{pills:Be,activePillIndex:0,activeSelected:ke,onSelectPill:at,loading:v})})]}),E===null?null:E===void 0?(0,Ie.jsx)(pa,{disabled:!mt,ready:mt&&Ae,onClick:()=>Lt(!0),label:(0,ze.uiStringsFor)(w).submit}):(0,Ie.jsx)("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:rt.submitSlot,onClick:F=>{mt&&(F.stopPropagation(),Lt(!0))},children:E})]})]})});0&&(module.exports={AIAutocomplete,AIAutocompleteDropdown,DATE_RANGE_META_END,DATE_RANGE_META_START,DEFAULT_OPTION_COUNT_UNIT,LOCATION_META_KEY,PRODUCT_PATH_PREFIX,TIME_META_KEY,WEEKDAY_LABELS,buildSubmitResult,cellDay,cellIso,dateCellMarks,formatDate,formatDateRange,formatOptionCount,formatPlace,formatTime,isoDate,monthLabel,optionCountLabel,optionHasImage,optionImageSources,optionImageSrc,optionLabel,optionsShowLeadingVisuals,parseDate,parseLooseDate,parseLooseDateRange,parseTime,productFromMatchedItem,productImageSources,productsFromCustomFields,sanitizeOptionIconSvg,selectedRangeFor,useAIAutocomplete,visibleDateRange,withSkippedParams});
3332
+ `,document.head.appendChild(e)}var ca={submitButton:"aia-submitButton-otz7H"};var Pt=require("react/jsx-runtime");function ha({disabled:e,ready:a,onClick:t,label:i=(0,pa.uiStringsFor)().submit}){return(0,Pt.jsx)("button",{type:"button","data-aia-submit":"",className:ca.submitButton,disabled:e,"data-aia-ready":a?"":void 0,onClick:o=>{o.stopPropagation(),t()},"aria-label":i,children:(0,Pt.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":i,children:(0,Pt.jsx)("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}var et=require("@magicx-eng/ai-autocomplete-vanilla"),L=require("react");var Nt=require("react");function ua(e){let a=(0,Nt.useRef)(e);a.current=e;let t=Object.keys(e??{}).sort().join("\0"),i=(0,Nt.useRef)({key:"",overrides:void 0});if(i.current.key!==t){let o={};for(let s of Object.keys(e??{})){let r=(d,g,v)=>{let y=a.current?.[s];return y?y(d,g,v):[]};o[s]=r}i.current={key:t,overrides:e?o:void 0}}return{overrides:i.current.overrides,key:t}}var Ft=require("react");function ma(e){let a=(0,Ft.useRef)(e);a.current=e;let t=(0,Ft.useRef)(null);t.current===null&&(t.current={fetch:(o,s)=>{let r=a.current;return r?r.fetch(o,s):Promise.reject(new Error("products config removed"))},transform:o=>a.current?.transform(o)??[],get limit(){return a.current?.limit}});let i=e!==void 0;return{config:i?t.current:void 0,enabled:i}}var ga={text:"",completedParams:[],identifiedParams:[],skippedParams:[],pendingSpan:null,suggestions:[],products:[],traditionalAutocomplete:!1,customFields:null,optionSearch:null,activeDropdownIndex:-1,newParamId:null,isLoading:!0,isReady:!1,error:null,segments:[],actionableSuggestions:[],filteredOptions:[],dropdownLoading:!0,dropdownOptions:[],skeletonOptions:null,skeletonSuggestion:null,dropdownSuggestion:null,skeletonRequested:!1,skeletonExiting:!1,activeFormatType:"options",dateView:null,dateRangeStart:null,dateFloor:null,timeView:null,multiSelectView:null,multiSelectDraft:null,locationView:null,locationSearch:null,locationAutocomplete:!0,locationFieldFocused:!1,placeholderText:"",leadInText:"",optionQuery:"",isSearchingOptions:!1,isDropdownOpen:!1,isActivePillSelected:!1,filterBase:0,filterInProgress:!1,pillTapped:!1,skipNextFetch:!1,lastRawQuery:"",isFocused:!1,dropdownHeld:!1,editingParam:null,editingIdentified:null,editingAnchor:null,editingTail:null,caretOffset:null,inSelectionAnimation:!1,dateViewMonth:null,pendingRangeStart:null,timeDraft:null};function It({onSubmit:e,onResult:a,onError:t,optionOverrides:i,maskCompletedText:o,apiConfig:s,additionalContext:r,language:d,currency:g,productId:v,visitorId:y,columns:f=2,dropdownTrigger:p,optionsPosition:u,closeDropdownOnBlur:x,prependPlaceholder:A,showNonTappableOptions:q,locationSearch:H,showOptionIcons:N,showOptionImages:te,showOptionCounts:O,showSkipButton:F,showProducts:T,productImageFallback:Q="image",onFocus:ae,onBlur:de,value:J,completedParams:ee,onChange:P,onParamsChange:Y,products:Ae,mapProducts:ke,onProductSelect:ve,onProductAddToCart:c,source:E,setCursor:Ge}){let b=(0,L.useRef)(null),[tt,Qe]=(0,L.useState)(null),Ye=(0,L.useRef)(e);Ye.current=e;let w=(0,L.useRef)(a);w.current=a;let S=(0,L.useRef)(t);S.current=t;let I=(0,L.useRef)(P);I.current=P;let R=(0,L.useRef)(Y);R.current=Y;let D=(0,L.useRef)(ae);D.current=ae;let oe=(0,L.useRef)(de);oe.current=de;let Ce=(0,L.useRef)(Ge);Ce.current=Ge;let ge=(0,L.useRef)(ve);ge.current=ve;let Re=(0,L.useRef)(c);Re.current=c;let je=(0,L.useRef)(y);je.current=y;let Le=(0,L.useRef)(()=>{let h=je.current;return typeof h=="function"?h():h}).current,ce=ma(Ae),at=(0,L.useRef)(ke);at.current=ke;let ht=(0,L.useRef)((h,B)=>{let C=at.current;return C?C(h,B):h}).current,qe=ke?ht:void 0,it=ua(i);(0,L.useEffect)(()=>{if(typeof document>"u")return;let h=new et.AIAutocomplete(document.createElement("div"),{renderMode:"headless",apiConfig:s,additionalContext:r,language:d,currency:g,productId:v,visitorId:Le,optionOverrides:it.overrides,maskCompletedText:o,columns:f,dropdownTrigger:p,optionsPosition:u,closeDropdownOnBlur:x,prependPlaceholder:A,showNonTappableOptions:q,locationSearch:H,showProducts:T,source:E,value:J,completedParams:ee,onSubmit:(...C)=>Ye.current?.(...C),onResult:(...C)=>w.current?.(...C),onError:(...C)=>S.current?.(...C),onChange:(...C)=>I.current?.(...C),onParamsChange:(...C)=>R.current?.(...C),onFocus:()=>D.current?.(),onBlur:()=>oe.current?.(),onProductSelect:C=>ge.current?.(C),onProductAddToCart:C=>Re.current?.(C),setCursor:C=>Ce.current?.(C),products:ce.config,mapProducts:qe});b.current=h,Qe(h.getState());let B=h.subscribe(C=>Qe(C));return()=>{B(),h.destroy(),b.current===h&&(b.current=null)}},[]),(0,L.useEffect)(()=>{J!==void 0&&b.current?.setValue(J)},[J]),(0,L.useEffect)(()=>{ee!==void 0&&b.current?.setCompletedParams(ee)},[ee]);let rt=JSON.stringify(s??null),_e;try{_e=JSON.stringify(r??null)}catch{_e="[unstringifiable]"}(0,L.useEffect)(()=>{b.current?.update({apiConfig:s,additionalContext:r,language:d,currency:g,productId:v,optionOverrides:it.overrides,dropdownTrigger:p,optionsPosition:u,closeDropdownOnBlur:x,prependPlaceholder:A,showNonTappableOptions:q,locationSearch:H,showProducts:T})},[rt,_e,d,g?.code,g?.rate,g?.country,v,it.key,p,u,x,A,q,H,T]);let pe=(0,L.useRef)(!1);(0,L.useEffect)(()=>{if(!pe.current){pe.current=!0;return}b.current?.update({products:ce.config})},[ce.enabled]),(0,L.useEffect)(()=>{b.current?.update({mapProducts:qe})},[qe]);let Oe=(0,L.useRef)(null);Oe.current===null&&(Oe.current={handleTextChange:h=>b.current?.handleTextChange(h),handleKeyDown:h=>{let B="nativeEvent"in h?h.nativeEvent:h;b.current?.handleKeyDown(B)},setFocused:h=>b.current?.setFocused(h),startEditingParam:h=>b.current?.startEditingParam(h),exitEditMode:()=>b.current?.exitEditMode(),handleCaretAfterInput:h=>b.current?.handleCaretAfterInput(h),handleCaretMove:h=>b.current?.handleCaretMove(h),replaceEditingRange:h=>b.current?.replaceEditingRange(h)??!1,setActivePill:h=>b.current?.setActivePill(h),skipActivePill:()=>b.current?.skipActivePill(),removeLastParam:()=>b.current?.removeLastParam(),clearNewParamId:()=>b.current?.clearNewParamId(),reset:()=>b.current?.reset(),refreshProducts:()=>b.current?.refreshProducts(),prepareSubmit:()=>b.current?.prepareSubmit(),getState:()=>b.current?.getState()??ga,recordSubmit:h=>b.current?.recordSubmit(h),selectOption:(h,B)=>b.current?.selectOption(h,B),selectProduct:h=>b.current?.selectProduct(h),addProductToCart:h=>{let B=b.current;return!B||!Re.current?Promise.resolve():B.addProductToCart(h)},setActiveDropdownIndex:h=>b.current?.setActiveDropdownIndex(h),clearHighlight:h=>b.current?.clearHighlight(h),showPreviousMonth:()=>b.current?.showPreviousMonth(),showNextMonth:()=>b.current?.showNextMonth(),setTime:h=>b.current?.setTime(h),commitTime:()=>b.current?.commitTime(),toggleMultiSelectOption:h=>b.current?.toggleMultiSelectOption(h),commitMultiSelect:()=>b.current?.commitMultiSelect(),setLocationQuery:h=>b.current?.setLocationQuery(h),moveLocationHighlight:h=>b.current?.moveLocationHighlight(h),commitLocation:h=>b.current?.commitLocation(h),setLocationFieldFocused:h=>b.current?.setLocationFieldFocused(h),handleFocus:()=>b.current?.setFocused(!0),handleBlur:()=>b.current?.setFocused(!1)});let k=Oe.current,n=(0,L.useCallback)(h=>{let B=h.target.value,vt=B.length>0&&!h.nativeEvent?.isComposing&&B[0]!==B[0].toUpperCase()?B[0].toUpperCase()+B.slice(1):B;b.current?.handleTextChange(vt)},[]),ne=(0,L.useCallback)(h=>{b.current?.handleKeyDown(h.nativeEvent)},[]),De=b.current,m=tt??ga,st=J!==void 0?J:m.text,Me=ee!==void 0?ee:m.completedParams,ze=m.actionableSuggestions,lt=ze[0],ut=(0,et.withoutTraditionalAutocomplete)(ze),Ve=De?.listboxId??"",dt=m.activeDropdownIndex>=0&&De?`${Ve}-option-${m.activeDropdownIndex}`:void 0,Se=m.editingParam,Ne=m.editingIdentified,$e=Se?{parameter:Se.suggestionParameter,text:Se.suggestionPlaceholder,required:!0,options:Se.options}:Ne?{parameter:Ne.parameter,text:(0,et.identifiedParamLabel)(Ne.parameter),required:!0,options:[]}:null,ot=m.dropdownSuggestion??$e??lt,ct=$e?[$e]:ze,Ze=(0,et.dateSelectionFor)(m),pt=!De||m.dropdownLoading;return{completedParams:Me,multiSelectView:m.multiSelectView,toggleMultiSelectOption:k.toggleMultiSelectOption,commitMultiSelect:k.commitMultiSelect,skippedParams:m.skippedParams,identifiedParams:m.identifiedParams,suggestionPills:ut,setActivePill:k.setActivePill,skipActivePill:k.skipActivePill,removeLastParam:k.removeLastParam,segments:m.segments,newParamId:m.newParamId,clearNewParamId:k.clearNewParamId,suggestions:m.suggestions,activeIndex:m.activeDropdownIndex,isReady:m.isReady,isLoading:pt,isFocused:m.isFocused,isDropdownOpen:m.isDropdownOpen,isActivePillSelected:m.isActivePillSelected,placeholderText:m.placeholderText,listboxId:Ve,error:m.error,products:m.products,customFields:m.customFields,selectProduct:k.selectProduct,addProductToCart:k.addProductToCart,handleTextChange:k.handleTextChange,handleKeyDown:k.handleKeyDown,setFocused:k.setFocused,editingParam:Se,editingIdentified:Ne,editingAnchor:m.editingAnchor,caretOffset:m.caretOffset,startEditingParam:k.startEditingParam,exitEditMode:k.exitEditMode,handleCaretAfterInput:k.handleCaretAfterInput,handleCaretMove:k.handleCaretMove,replaceEditingRange:k.replaceEditingRange,inputProps:{value:st,placeholder:m.placeholderText||void 0,onChange:n,onKeyDown:ne,onFocus:k.handleFocus,onBlur:k.handleBlur,role:"combobox","aria-expanded":m.isDropdownOpen,"aria-activedescendant":dt,"aria-autocomplete":"list","aria-controls":Ve},reset:k.reset,refreshProducts:k.refreshProducts,prepareSubmit:k.prepareSubmit,getState:k.getState,recordSubmit:k.recordSubmit,dropdownProps:{suggestions:ot?[{...ot,options:m.dropdownOptions}]:[],activeIndex:m.activeDropdownIndex,onSelect:k.selectOption,onHighlight:k.setActiveDropdownIndex,onUnhighlight:k.clearHighlight,isOpen:m.isDropdownOpen,id:Ve,pills:ct,activeSelected:m.isActivePillSelected,onPillClick:k.setActivePill,onSkip:k.skipActivePill,showSkipButton:(F??!0)&&!Se&&!Ne,showOptionIcons:N??!0,showOptionImages:te??!0,showOptionCounts:O??!0,skipDisabled:m.inSelectionAnimation,isLoading:pt,skeletonExiting:m.skeletonExiting,isInputEmpty:st.trim().length===0,language:d,products:m.products,productImageFallback:Q,onProductSelect:k.selectProduct,onProductAddToCart:c?k.addProductToCart:void 0,onProductFocusChange:k.setFocused,formatType:m.activeFormatType,dateView:m.dateView,selectedDateIso:Ze.selectedIso,selectedDateRange:Ze.selectedRange,dateRangeStart:Ze.rangeStart,onPreviousMonth:k.showPreviousMonth,onNextMonth:k.showNextMonth,timeView:m.timeView,multiSelectView:m.multiSelectView,onMultiSelectCommit:k.commitMultiSelect,onTimeChange:k.setTime,onTimeCommit:k.commitTime,locationView:m.locationView,isReediting:m.editingParam!=null,onLocationQuery:k.setLocationQuery,onLocationMove:k.moveLocationHighlight,onLocationCommit:k.commitLocation,onLocationFocusChange:k.setLocationFieldFocused,isFocused:m.isFocused||m.locationFieldFocused,optionsPosition:u??"below"}}}var le=require("@magicx-eng/ai-autocomplete-vanilla"),z=require("react"),Et;function ai(){if(Et!==void 0)return Et;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),Et=e.contentEditable==="plaintext-only",Et}function fa(e){let{segments:a,showChipIcons:t=!0,showChipImages:i=!0,newParamId:o,editingParam:s,editingIdentified:r,editingAnchor:d,caretOffset:g,placeholderText:v,isFocused:y,isDropdownOpen:f,listboxId:p,activeDescendantId:u,autoFocus:x,handleTextChange:A,handleKeyDown:q,handleCaretAfterInput:H,handleCaretMove:N,startEditingParam:te,replaceEditingRange:O,setFocused:F}=e,T=(0,z.useRef)(null),Q=(0,z.useRef)(!1),ae=(0,z.useRef)(""),de=(0,z.useRef)(""),J=(0,z.useRef)(null),ee=(0,z.useRef)(0);J.current=g,(0,z.useEffect)(()=>{if(!x)return;let w=T.current;if(!w)return;document.activeElement===w?F(!0):w.focus();let S=w.ownerDocument??document,I=S.getSelection(),R=I&&I.rangeCount>0&&w.contains(I.anchorNode);if(I&&!R){let D=S.createRange();D.selectNodeContents(w),D.collapse(!0),I.removeAllRanges(),I.addRange(D)}},[x,F]),(0,z.useEffect)(()=>{let w=T.current;if(!w)return;let S=w.ownerDocument??document,I=()=>{let R=S.getSelection();if(!R||R.rangeCount===0||!R.anchorNode||!w.contains(R.anchorNode))return;let D=R.anchorNode,oe=D.nodeType===Node.ELEMENT_NODE?D:D.parentElement,ge=(R.isCollapsed?oe?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,Re=s?.id??r?.id??null;if(ge&&ge!==Re){te(ge);return}performance.now()-ee.current<50||N((0,le.getCursorOffset)(w))};return S.addEventListener("selectionchange",I),()=>S.removeEventListener("selectionchange",I)},[s,r,te,N]),(0,z.useEffect)(()=>{let w=T.current;if(!w)return;let S=I=>{let R=(0,le.chipIdFromTap)(w,I.target);R&&(te(R),(0,le.keepCaretOnChip)(w,R))};return w.addEventListener("click",S),()=>w.removeEventListener("click",S)},[te]),(0,z.useLayoutEffect)(()=>{let w=T.current;w&&(0,le.renderEditableContent)({input:w,segments:a,newParamId:o,editingParamId:s?.id??null,placeholderText:v??"",isFocused:y,showChipIcons:t,showChipImages:i})},[a,o,s,v,y,t,i]),(0,z.useLayoutEffect)(()=>{let w=ae.current,S=o??"";if(ae.current=S,!S||S===w)return;let I=T.current;if(!I)return;I.focus();let R=J.current??(0,le.plainTextLength)(I);(0,le.setCursorOffset)(I,R)},[o]),(0,z.useLayoutEffect)(()=>{let w=de.current,S=s?.id??"";if(de.current=S,!S||S===w||d==null)return;let I=T.current;I&&(0,le.setCursorOffset)(I,d)},[s,d]);let P=(0,z.useCallback)(()=>{if(Q.current)return;let w=T.current;if(!w)return;let S=(0,le.extractPlainText)(w),R=S.length>0&&S[0]!==S[0].toUpperCase()?S[0].toUpperCase()+S.slice(1):S;A(R)},[A]),Y=(0,z.useCallback)(()=>{ee.current=performance.now(),P();let w=T.current;w&&H((0,le.getCursorOffset)(w))},[P,H]);(0,z.useEffect)(()=>{let w=T.current;if(!w)return;let S=I=>{let R=I,D=R.inputType;if(D==="insertParagraph"||D==="insertLineBreak"||D==="insertFromDrop"){I.preventDefault();return}if(D.startsWith("insert")||D.startsWith("delete")){let oe=D.startsWith("delete")?"":R.data??"";O(oe)&&I.preventDefault()}};return w.addEventListener("beforeinput",S),()=>w.removeEventListener("beforeinput",S)},[O]);let Ae=(0,z.useCallback)(()=>{Q.current=!0,T.current?.setAttribute("data-aia-composing","true")},[]),ke=(0,z.useCallback)(()=>{Q.current=!1,T.current?.removeAttribute("data-aia-composing"),P()},[P]),ve=(0,z.useCallback)(w=>{w.preventDefault();let S=T.current;if(!S)return;let I=(w.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!I)return;let R=S.ownerDocument??document,D=R.getSelection();if(!D||D.rangeCount===0)return;let oe=D.getRangeAt(0);if(!S.contains(oe.startContainer))return;oe.deleteContents();let Ce=R.createTextNode(I);oe.insertNode(Ce),oe.setStartAfter(Ce),oe.collapse(!0),D.removeAllRanges(),D.addRange(oe),P()},[P]),c=(0,z.useCallback)(w=>q(w),[q]),E=(0,z.useCallback)(()=>F(!0),[F]),Ge=(0,z.useCallback)(()=>F(!1),[F]),b=(0,z.useCallback)(()=>T.current?.focus(),[]),tt=(0,z.useCallback)(()=>T.current?.blur(),[]),Qe=(0,z.useCallback)(()=>{let w=T.current;return w?(0,le.extractPlainText)(w):""},[]),Ye=ai()?"plaintext-only":"true";return{inputRef:T,editorProps:{ref:T,contentEditable:Ye,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":p,"aria-expanded":f,"aria-activedescendant":u,spellCheck:!0,enterKeyHint:"send",onInput:Y,onKeyDown:c,onCompositionStart:Ae,onCompositionEnd:ke,onPaste:ve,onFocus:E,onBlur:Ge},getPlainText:Qe,focus:b,blur:tt}}var Ee=require("react/jsx-runtime");function ii(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var ba=(0,U.forwardRef)(function({onSubmit:a,onResult:t,onError:i,optionOverrides:o,maskCompletedText:s,className:r,apiConfig:d,additionalContext:g,language:v,currency:y,productId:f,visitorId:p,columns:u,pillPlacement:x="dropdown",mode:A="auto",optionsPosition:q="below",animations:H=!0,dropdownTrigger:N,closeDropdownOnBlur:te,prependPlaceholder:O,showNonTappableOptions:F,locationSearch:T,showOptionIcons:Q=!0,showChipIcons:ae=!0,showChipImages:de=!0,showOptionImages:J=!0,showOptionCounts:ee=!0,showSkipButton:P,showProducts:Y,productsLayout:Ae,productImageFallback:ke,autoFocus:ve=!0,onFocus:c,onBlur:E,value:Ge,completedParams:b,onChange:tt,onParamsChange:Qe,products:Ye,mapProducts:w,onProductSelect:S,onProductAddToCart:I,submitButton:R,resetOnSubmit:D=!0},oe){let Ce=(0,U.useRef)(null),ge=(0,U.useRef)(null),Re=(0,U.useRef)(null),je=(0,U.useRef)(()=>{}),Le=(0,U.useRef)(null),ce=(0,U.useRef)(null);(0,U.useEffect)(()=>{let W=Ce.current;if(W)return Le.current?Le.current.setMode(A):Le.current=new Ke.ModeController(W,A),()=>{Le.current?.destroy(),Le.current=null}},[A]);let at=(0,U.useCallback)(W=>{let fe=ce.current?.current;fe&&(fe.focus(),(0,Ke.setCursorOffset)(fe,W))},[]),{completedParams:ht,suggestionPills:qe,setActivePill:it,skipActivePill:rt,segments:_e,newParamId:pe,clearNewParamId:Oe,placeholderText:k,isFocused:n,isDropdownOpen:ne,isActivePillSelected:De,isLoading:m,isReady:st,activeIndex:Me,listboxId:ze,handleTextChange:lt,handleKeyDown:ut,setFocused:Ve,editingParam:dt,editingIdentified:Se,editingAnchor:Ne,caretOffset:$e,startEditingParam:ot,handleCaretAfterInput:ct,handleCaretMove:Ze,replaceEditingRange:pt,dropdownProps:h,reset:B,refreshProducts:C,prepareSubmit:vt,getState:Ht,recordSubmit:Bt}=It({onSubmit:W=>je.current(W),onResult:t,onError:i,optionOverrides:o,maskCompletedText:s,apiConfig:d,additionalContext:g,language:v,currency:y,productId:f,visitorId:p,columns:u,dropdownTrigger:N,optionsPosition:q,closeDropdownOnBlur:te,prependPlaceholder:O,showNonTappableOptions:F,locationSearch:T,showOptionIcons:Q,showOptionImages:J,showOptionCounts:ee,showSkipButton:P,showProducts:Y,onFocus:c,onBlur:E,value:Ge,completedParams:b,onChange:tt,onParamsChange:Qe,products:Ye,mapProducts:w,onProductSelect:S,onProductAddToCart:I,source:"full-sdk",setCursor:at});(0,U.useEffect)(()=>{if(!pe)return;let W=window.setTimeout(()=>Oe(),650);return()=>window.clearTimeout(W)},[pe,Oe]);let wa=Me>=0?`${ze}-option-${Me}`:void 0,{inputRef:At,editorProps:va,focus:xt,blur:Wt,getPlainText:Kt}=fa({segments:_e,newParamId:pe,editingParam:dt,editingIdentified:Se,editingAnchor:Ne,caretOffset:$e,placeholderText:k,isFocused:n,showChipIcons:ae,showChipImages:de,isDropdownOpen:ne,listboxId:ze,activeDescendantId:wa,autoFocus:ve,handleTextChange:lt,handleKeyDown:ut,handleCaretAfterInput:ct,handleCaretMove:Ze,startEditingParam:ot,replaceEditingRange:pt,setFocused:Ve});ce.current=At,(0,U.useLayoutEffect)(()=>{let W=ge.current,fe=At.current;if(!W||!fe)return;let gt=()=>{let qt=W.firstElementChild;if(!qt)return;let Ca=qt.getBoundingClientRect(),Sa=fe.getBoundingClientRect();Ca.top>=Sa.bottom-2?W.setAttribute("data-aia-pill-wrapped",""):W.removeAttribute("data-aia-pill-wrapped")};gt();let Gt=new ResizeObserver(gt);return Gt.observe(fe),()=>Gt.disconnect()},[_e,qe.length,m,At]),(0,U.useEffect)(()=>{let W=Re.current;if(W)return(0,Ke.watchEditorHeight)(W)},[]),(0,U.useImperativeHandle)(oe,()=>({focus:xt,blur:Wt,reset:B,refreshProducts:C,setMode:W=>Le.current?.setMode(W),skipActivePill:rt}),[xt,Wt,B,C,rt]);let mt=!!_e.length||ht.length>0,Rt=(0,U.useCallback)(W=>{if(!mt)return;W&&vt();let fe=Ht(),gt=(0,Ke.buildSubmitResult)(Kt(),fe.completedParams,fe.skippedParams,{identifiedParams:fe.identifiedParams,isReady:fe.isReady,customFields:fe.customFields});W&&Bt(gt),a(gt),D&&B()},[Bt,D,mt,vt,Ht,a,B,Kt]);je.current=()=>Rt(!1);let xa=(0,U.useCallback)(W=>{W.target?.closest("[data-aia-pill]")||document.activeElement?.closest("[data-aia-location]")||xt()},[xt]),ya=x==="inline",ka=x==="dropdown";return(0,Ee.jsxs)("div",{ref:Ce,className:`magicx-aia ${nt.container} ${r??""}`,"data-pill-placement":x,"data-options-position":q,"data-animations":H?"on":"off","data-mode":ii(A),children:[(0,Ee.jsx)(Tt,{...h,showPills:ka,productsLayout:Ae,productImageFallback:ke}),(0,Ee.jsxs)("div",{className:nt.inputWrapper,"data-aia-input-wrapper":"",onClick:xa,children:[(0,Ee.jsxs)("div",{ref:Re,className:nt.editorArea,"data-aia-editor":"",children:[(0,Ee.jsx)("div",{...va,className:nt.input,"data-aia-input":""}),ya&&(m||qe.length>0)&&(0,Ee.jsx)("span",{ref:ge,className:nt.pillListContainer,"data-aia-pill-list-container":"",children:(0,Ee.jsx)(Ct,{pills:qe,activePillIndex:0,activeSelected:De,onSelectPill:it,loading:m})})]}),R===null?null:R===void 0?(0,Ee.jsx)(ha,{disabled:!mt,ready:mt&&st,onClick:()=>Rt(!0),label:(0,Ke.uiStringsFor)(v).submit}):(0,Ee.jsx)("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:nt.submitSlot,onClick:W=>{mt&&(W.stopPropagation(),Rt(!0))},children:R})]})]})});0&&(module.exports={AIAutocomplete,AIAutocompleteDropdown,DATE_RANGE_META_END,DATE_RANGE_META_START,DEFAULT_OPTION_COUNT_UNIT,LOCATION_META_KEY,PRODUCT_PATH_PREFIX,TIME_META_KEY,WEEKDAY_LABELS,buildSubmitResult,cellDay,cellIso,dateCellMarks,formatDate,formatDateRange,formatOptionCount,formatPlace,formatTime,isoDate,monthLabel,optionCountLabel,optionHasImage,optionImageSources,optionImageSrc,optionLabel,optionsShowLeadingVisuals,parseDate,parseLooseDate,parseLooseDateRange,parseTime,productFromMatchedItem,productImageSources,productsFromCustomFields,sanitizeOptionIconSvg,selectedRangeFor,useAIAutocomplete,visibleDateRange,withSkippedParams});
3326
3333
  //# sourceMappingURL=index.js.map