@magicx-eng/ai-autocomplete-react 0.50.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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Rt=Object.defineProperty;var Sa=Object.getOwnPropertyDescriptor;var Ta=Object.getOwnPropertyNames;var Pa=Object.prototype.hasOwnProperty;var Ia=(e,o)=>{for(var t in o)Rt(e,t,{get:o[t],enumerable:!0})},Ea=(e,o,t,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of Ta(o))!Pa.call(e,n)&&n!==t&&Rt(e,n,{get:()=>o[n],enumerable:!(i=Sa(o,n))||i.enumerable});return e};var Aa=e=>Ea(Rt({},"__esModule",{value:!0}),e);var ii={};Ia(ii,{AIAutocomplete:()=>fa,AIAutocompleteDropdown:()=>Tt,DATE_RANGE_META_END:()=>d.DATE_RANGE_META_END,DATE_RANGE_META_START:()=>d.DATE_RANGE_META_START,DEFAULT_OPTION_COUNT_UNIT:()=>d.DEFAULT_OPTION_COUNT_UNIT,LOCATION_META_KEY:()=>d.LOCATION_META_KEY,PRODUCT_PATH_PREFIX:()=>d.PRODUCT_PATH_PREFIX,TIME_META_KEY:()=>d.TIME_META_KEY,WEEKDAY_LABELS:()=>d.WEEKDAY_LABELS,buildSubmitResult:()=>d.buildSubmitResult,cellDay:()=>d.cellDay,cellIso:()=>d.cellIso,dateCellMarks:()=>d.dateCellMarks,formatDate:()=>d.formatDate,formatDateRange:()=>d.formatDateRange,formatOptionCount:()=>d.formatOptionCount,formatPlace:()=>d.formatPlace,formatTime:()=>d.formatTime,isoDate:()=>d.isoDate,monthLabel:()=>d.monthLabel,optionCountLabel:()=>d.optionCountLabel,optionHasImage:()=>d.optionHasImage,optionImageSources:()=>d.optionImageSources,optionImageSrc:()=>d.optionImageSrc,optionLabel:()=>d.optionLabel,optionsShowLeadingVisuals:()=>d.optionsShowLeadingVisuals,parseDate:()=>d.parseDate,parseLooseDate:()=>d.parseLooseDate,parseLooseDateRange:()=>d.parseLooseDateRange,parseTime:()=>d.parseTime,productFromMatchedItem:()=>d.productFromMatchedItem,productImageSources:()=>d.productImageSources,productsFromCustomFields:()=>d.productsFromCustomFields,sanitizeOptionIconSvg:()=>d.sanitizeOptionIconSvg,selectedRangeFor:()=>d.selectedRangeFor,useAIAutocomplete:()=>It,visibleDateRange:()=>d.visibleDateRange,withSkippedParams:()=>d.withSkippedParams});module.exports=Aa(ii);var d=require("@magicx-eng/ai-autocomplete-vanilla");var q=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 ce=require("@magicx-eng/ai-autocomplete-vanilla"),de=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
  *
@@ -538,7 +538,7 @@
538
538
  /* Half-strength stroke: neutral-900 (was #e5e7eb \u2014 snapped to palette,
539
539
  \u03942) at 50% alpha over the surface, so the hairline lands exactly
540
540
  halfway between its old value and the white behind it. */
541
- --aia-dropdown-border: var(--aia-primitive-neutral-900-a50);
541
+ --aia-dropdown-border: transparent; /* no stroke by default */
542
542
  --aia-dropdown-shadow: none; /* flat by default */
543
543
  /* Suggestion pills (Figma "ParamPill"): transparent fill, no visible border;
544
544
  per-pill opacity via getPillOpacity. */
@@ -561,11 +561,11 @@
561
561
  /* Options read bigger + darker than the small-caps param labels above them. */
562
562
  --aia-option-color: var(--aia-primitive-neutral-150);
563
563
  --aia-option-color-selected: var(--aia-primitive-neutral-0);
564
- --aia-option-font-size: 16px;
564
+ --aia-option-font-size: 11.2px;
565
565
 
566
566
  --aia-written-text-color: var(--aia-primitive-neutral-0);
567
- /* Match the option size so the typed query never reads smaller than the
568
- choices below it. */
567
+ /* The typed query keeps its full size; only the options box below it is
568
+ scaled down, so the query reads larger than the choices. */
569
569
  --aia-written-text-font-size: 16px;
570
570
  --aia-caret-color: var(--aia-written-text-color, #000000);
571
571
 
@@ -584,6 +584,12 @@
584
584
  --aia-confirm-bg: #262626;
585
585
  --aia-confirm-bg-hover: #404040;
586
586
  --aia-confirm-color: #ffffff;
587
+ /* The pickers' Done buttons: a soft blue-gray under dark navy text, the
588
+ Real-time One playground's Done (the ticked checkbox keeps the solid
589
+ confirm fill above). */
590
+ --aia-done-bg: #e4e8f0;
591
+ --aia-done-bg-hover: #d8dde8;
592
+ --aia-done-color: #2a3150;
587
593
 
588
594
  --aia-footer-hint-color: var(--aia-primitive-neutral-500);
589
595
  --aia-footer-brand-color: var(--aia-primitive-neutral-700);
@@ -599,7 +605,7 @@
599
605
  --aia-shadow: none;
600
606
  /* Half-strength stroke \u2014 neutral-400 (was #484848 \u2014 snapped to palette,
601
607
  \u03942) at 50% alpha; see the light-mode note above. */
602
- --aia-dropdown-border: var(--aia-primitive-neutral-400-a50);
608
+ --aia-dropdown-border: transparent; /* no stroke by default */
603
609
  --aia-dropdown-shadow: none; /* flat by default */
604
610
  /* Suggestion pills (Figma "ParamPill"): transparent fill, no visible border. */
605
611
  --aia-pill-bg: var(--aia-primitive-neutral-750);
@@ -623,7 +629,7 @@
623
629
  /* Options read bigger + darker/brighter than the small-caps param labels. */
624
630
  --aia-option-color: var(--aia-primitive-neutral-900);
625
631
  --aia-option-color-selected: var(--aia-primitive-neutral-1000);
626
- --aia-option-font-size: 16px;
632
+ --aia-option-font-size: 11.2px;
627
633
 
628
634
  --aia-written-text-color: var(--aia-primitive-neutral-1000);
629
635
  --aia-written-text-font-size: 16px;
@@ -644,6 +650,10 @@
644
650
  --aia-confirm-bg: #a6a6a6;
645
651
  --aia-confirm-bg-hover: #b8b8b8;
646
652
  --aia-confirm-color: #000000;
653
+ /* Done keeps the dark theme's confirm colors. */
654
+ --aia-done-bg: var(--aia-confirm-bg);
655
+ --aia-done-bg-hover: var(--aia-confirm-bg-hover);
656
+ --aia-done-color: var(--aia-confirm-color);
647
657
 
648
658
  --aia-footer-hint-color: var(--aia-primitive-neutral-700);
649
659
  --aia-footer-brand-color: var(--aia-primitive-neutral-500);
@@ -701,6 +711,7 @@
701
711
  justify-content: flex-start;
702
712
  border-inline-width: 0;
703
713
  padding-inline: 0;
714
+ padding-block: 3.5px;
704
715
  }
705
716
 
706
717
  /* The reserved band the footer overlaps. Declared here, apart from the grid
@@ -767,9 +778,6 @@
767
778
  --aia-grid-scroll-top: var(--aia-footer-band);
768
779
  --aia-grid-overlap-top: calc(-1 * (var(--aia-footer-band) + 8px));
769
780
  --aia-footer-fade-inset: 0 0 calc(-1 * var(--aia-footer-fade-lead));
770
- /* The unfold flips with the stack: the collapsed sliver sits at the panel's
771
- bottom edge (against the input) and expands upward out of it. */
772
- transform-origin: 50% 100%;
773
781
  top: auto;
774
782
  bottom: 100%;
775
783
  margin-top: 0;
@@ -829,6 +837,8 @@
829
837
  :where(.magicx-aia[data-animations="off"]) *::after {
830
838
  animation-duration: 0s !important;
831
839
  transition-duration: 0s !important;
840
+ /* biome-ignore lint/complexity/noImportantStyles: a delayed close must not linger with animations off */
841
+ transition-delay: 0s !important;
832
842
  }
833
843
 
834
844
  /* Desktop footer is opaque: the option list clips at the footer's edge instead
@@ -930,7 +940,7 @@
930
940
  the third row. The planned cap (--aia-grid-max-height) still wins when it
931
941
  is smaller: fewer than three rows of options. */
932
942
  [data-aia-dropdown][aria-multiselectable="true"] .aia-grid[data-scroll] {
933
- max-height: min(var(--aia-grid-max-height, 120px), calc(3 * var(--aia-option-row-height, 37px)));
943
+ max-height: min(var(--aia-grid-max-height, 84px), calc(3 * var(--aia-option-row-height, 25.9px)));
934
944
  }
935
945
 
936
946
  /* Fitted to the viewport, every other grid hands its scrolling to the panel,
@@ -939,10 +949,89 @@
939
949
  so Done stays in view. */
940
950
  [data-aia-dropdown][data-aia-fit][aria-multiselectable="true"] .aia-grid[data-scroll] {
941
951
  flex-shrink: 1;
942
- min-height: var(--aia-option-row-height, 37px);
943
- max-height: min(var(--aia-grid-max-height, 120px), calc(3 * var(--aia-option-row-height, 37px)));
952
+ min-height: var(--aia-option-row-height, 25.9px);
953
+ max-height: min(var(--aia-grid-max-height, 84px), calc(3 * var(--aia-option-row-height, 25.9px)));
944
954
  overflow-y: auto;
945
955
  }
956
+
957
+ /* Floating options box (2026-11). The panel reads as a light sheet under the
958
+ text: no footer, only the parameter being asked (sentence case), and "skip"
959
+ right after it behind a thin rule \u2014 "Gender | skip". With no footer there is
960
+ no band for the rows to slide under, so it is zeroed in every layout.
961
+ Declared last so it follows every rule that sets the band. Mirrored in all
962
+ four appearance copies; floatingOptionsParity.test.ts pins them together. */
963
+ [data-aia-dropdown] [data-aia-footer] {
964
+ display: none;
965
+ }
966
+ /* Doubled attribute: ties the above-position rule's specificity and wins on
967
+ source order, so both edges are zeroed whichever side the panel opens on. */
968
+ [data-aia-dropdown][data-aia-dropdown] {
969
+ --aia-grid-scroll-bottom: 0px;
970
+ --aia-grid-overlap-bottom: 0px;
971
+ --aia-grid-scroll-top: 0px;
972
+ --aia-grid-overlap-top: 0px;
973
+ --aia-footer-fade-lead: 0px;
974
+ --aia-footer-row-min-height: 0px;
975
+ }
976
+ [data-aia-dropdown] [data-aia-pillbar] [data-aia-pill]:not([data-aia-pill-active]) {
977
+ display: none;
978
+ }
979
+ /* One label, one placeholder: the loading skeletons carry no data-aia-pill, so
980
+ the rule above leaves them alone. Keep the first and hide the rest. */
981
+ [data-aia-dropdown] [data-aia-pillbar] [data-aia-pill-skeleton] ~ [data-aia-pill-skeleton] {
982
+ display: none;
983
+ }
984
+ [data-aia-dropdown] [data-aia-pillbar] [data-aia-pill-scroll] {
985
+ flex: 0 1 auto;
986
+ mask-image: none;
987
+ -webkit-mask-image: none;
988
+ }
989
+ /* The live label reads at full strength. The pill's positional opacity ramp
990
+ is a custom property the pill's own rule reads, so this plain declaration
991
+ wins by specificity, and the pill's entrance fade and a loading chip's
992
+ skeleton fades still animate over it. */
993
+ [data-aia-dropdown] [data-aia-pillbar] [data-aia-pill][data-aia-pill-active] {
994
+ text-transform: none;
995
+ letter-spacing: normal;
996
+ font-size: var(--aia-param-label-font-size, 9.45px);
997
+ font-weight: 500;
998
+ opacity: 1;
999
+ }
1000
+ /* A flex container has no ::first-letter; the label is plain text, so an
1001
+ inline block lays it out the same and lets it take a capital. A Smart
1002
+ Suggestion header keeps its flex layout: its gap and centring hold the
1003
+ sparkle beside the text. */
1004
+ [data-aia-dropdown]
1005
+ [data-aia-pillbar]
1006
+ [data-aia-pill][data-aia-pill-active]:not([data-aia-smart-suggestion]) {
1007
+ display: inline-block;
1008
+ }
1009
+ [data-aia-dropdown]
1010
+ [data-aia-pillbar]
1011
+ [data-aia-pill][data-aia-pill-active]:not([data-aia-smart-suggestion])::first-letter {
1012
+ text-transform: uppercase;
1013
+ }
1014
+ [data-aia-dropdown] [data-aia-pillbar] [data-aia-skip] {
1015
+ padding-inline: 5.6px;
1016
+ font-size: var(--aia-skip-font-size, 9.45px);
1017
+ }
1018
+ /* After the label, skip sits right beside it ("Gender | skip"). A skip-only
1019
+ row (pills shown in the input, so the bar has no label) keeps the base
1020
+ auto margin and stays pinned at the trailing edge, with no rule. */
1021
+ [data-aia-dropdown] [data-aia-pillbar] [data-aia-pill-scroll] + [data-aia-skip] {
1022
+ margin-inline-start: 0;
1023
+ }
1024
+ [data-aia-dropdown] [data-aia-pillbar] [data-aia-pill-scroll] + [data-aia-skip]::before {
1025
+ content: "";
1026
+ align-self: center;
1027
+ width: 1px;
1028
+ height: 0.9em;
1029
+ margin-inline-end: 5.6px;
1030
+ margin-inline-start: -2.8px;
1031
+ background: currentColor;
1032
+ opacity: 0.45;
1033
+ }
1034
+ /* End floating options box. */
946
1035
  `,document.head.appendChild(e)}if(typeof document<"u"&&!document.getElementById("ac-style-3819c762")){let e=document.createElement("style");e.id="ac-style-3819c762",e.textContent=`.aia-dropdown-yz2KC {
947
1036
  position: absolute;
948
1037
  left: 0;
@@ -968,21 +1057,32 @@
968
1057
  z-index: 10;
969
1058
  opacity: 0;
970
1059
  pointer-events: none;
971
- /* Closed, the panel rests as a near-zero-height sliver at the input's edge
972
- (scaleY only \u2014 full width), so opening unfolds it top-to-bottom out of the
973
- input. The origin flips to the bottom edge for optionsPosition="above" \u2014
974
- see appearance.css. The transform "transition" on THIS side is a delayed
975
- snap: while closing, the panel holds its full size for the whole 400ms
976
- fade and only then collapses, ready for the next open. */
977
- transform-origin: 50% 0;
978
- transform: scaleY(var(--aia-dropdown-reveal-scale, 0.02));
1060
+ /* Closed, the panel rests in place, transparent and softly blurred, so it
1061
+ floats in as a dissolve rather than dropping down (the Real-time One
1062
+ motion, 2026-11): out is 280ms on a soft ease back to opacity 0 and a 2px
1063
+ blur. */
1064
+ filter: blur(2px);
1065
+ /* The 220ms beat before closing covers the gap between a keystroke that
1066
+ filters every option away and the next response, so typing never blinks
1067
+ the panel out and back. */
1068
+ /* Closed, the panel keeps its full size (the floating box does not collapse
1069
+ it), so pointer-events: none alone would still leave an invisible box
1070
+ over the page: a descendant that sets pointer-events: auto (the pill row,
1071
+ the scroll arrow) takes taps through it, and it stays in the tab order.
1072
+ visibility: hidden once the fade has run removes it from hit testing and
1073
+ focus; the 0s visibility transition waits out the beat and the fade
1074
+ (220ms + 280ms), so the dissolve still plays. */
1075
+ visibility: hidden;
979
1076
  transition:
980
- opacity 400ms cubic-bezier(0.4, 0, 0.2, 1),
981
- transform 0s 400ms;
1077
+ opacity 280ms cubic-bezier(0.25, 0.1, 0.25, 1) 220ms,
1078
+ filter 280ms cubic-bezier(0.25, 0.1, 0.25, 1) 220ms,
1079
+ visibility 0s linear 500ms;
982
1080
  /* Solid surface is the default (matches the Figma components). Opt into the
983
1081
  frosted-glass look with data-aia-surface="glass". */
984
1082
  background: var(--aia-surface, #ffffff);
985
- border: 1px solid var(--aia-dropdown-border, rgba(231, 231, 231, 0.5));
1083
+ /* No stroke by default: the 1px border stays (transparent) so the
1084
+ geometry does not move; set --aia-dropdown-border to draw one. */
1085
+ border: 1px solid var(--aia-dropdown-border, transparent);
986
1086
  border-radius: 9px;
987
1087
  /* Flat by default; consumers can set --aia-dropdown-shadow for elevation. */
988
1088
  box-shadow: var(--aia-dropdown-shadow, none);
@@ -1017,20 +1117,18 @@
1017
1117
  backdrop-filter: blur(30px);
1018
1118
  }
1019
1119
 
1020
- /* Opening: the panel unfolds top-to-bottom out of the input with a single
1021
- spring settle while the option rows cascade in on top of it. Closing keeps
1022
- the longer fade so a populated panel dissolves as one (the base rule above
1023
- delays the transform snap until that fade has finished). */
1120
+ /* Opening: the panel dissolves in where it sits \u2014 opacity and the 2px blur
1121
+ resolve together over 320ms after a 40ms beat \u2014 while the option rows
1122
+ cascade in on top of it. */
1024
1123
  .aia-visible-QCoXj {
1025
1124
  opacity: 1;
1026
1125
  pointer-events: auto;
1027
- transform: scaleY(1);
1028
- /* Spring: the easing overshoots full height by a few percent and settles
1029
- once (P1y = 1.28 \u2014 one spring, no bounce). Opacity resolves almost
1030
- immediately so the unfold, not a fade, is what reads. */
1126
+ filter: none;
1127
+ visibility: visible;
1031
1128
  transition:
1032
- opacity 100ms cubic-bezier(0.4, 0, 0.2, 1),
1033
- transform 320ms cubic-bezier(0.22, 1.28, 0.36, 1);
1129
+ opacity 320ms cubic-bezier(0.25, 0.1, 0.25, 1) 40ms,
1130
+ filter 320ms cubic-bezier(0.25, 0.1, 0.25, 1) 40ms,
1131
+ visibility 0s;
1034
1132
  }
1035
1133
 
1036
1134
  /* "More below" scroll arrow \u2014 see the core's render/scrollArrow.ts.
@@ -1129,6 +1227,7 @@
1129
1227
  animation-duration: 0s;
1130
1228
  animation-delay: 0s;
1131
1229
  transition-duration: 0s;
1230
+ transition-delay: 0s;
1132
1231
  }
1133
1232
  }
1134
1233
 
@@ -1175,15 +1274,15 @@
1175
1274
  align-items: center;
1176
1275
  margin-inline-start: auto;
1177
1276
  flex-shrink: 0;
1178
- padding: 5px 8px;
1277
+ padding: 3.5px 5.6px;
1179
1278
  border: none;
1180
1279
  /* Matches the completed-param chip radius, so the hover fill reads as a
1181
1280
  soft rectangle rather than a capsule. */
1182
- border-radius: 6px;
1281
+ border-radius: 4.2px;
1183
1282
  background: transparent;
1184
1283
  font-family: inherit;
1185
- font-size: var(--aia-skip-font-size, 10px);
1186
- line-height: 18px;
1284
+ font-size: var(--aia-skip-font-size, 9.45px);
1285
+ line-height: 12.6px;
1187
1286
  color: var(--aia-skip-color, var(--aia-footer-hint-color, #505050));
1188
1287
  cursor: pointer;
1189
1288
  white-space: nowrap;
@@ -1266,28 +1365,44 @@
1266
1365
  display: none;
1267
1366
  }
1268
1367
 
1269
- /* The multi-select Done button: the time wheel's Done, full width and solid. */
1368
+ /* The multi-select Done button: the time wheel's Done, full width. */
1270
1369
  .aia-multiDone-y12U7 {
1271
1370
  display: block;
1272
- width: 100%;
1273
- height: 36px;
1371
+ /* As wide as the widest option (set by fitMultiSelectDone), never
1372
+ narrower than the minimum nor wider than the panel. */
1373
+ width: var(--aia-multi-done-width, var(--aia-multi-done-fit, 100%));
1374
+ min-width: min(var(--aia-multi-done-min-width, 120px), 100%);
1375
+ max-width: 100%;
1376
+ height: 44px;
1274
1377
  padding: 0 12px;
1275
1378
  border: none;
1276
- border-radius: 8px;
1277
- background: var(--aia-multi-done-bg, var(--aia-confirm-bg, #262626));
1278
- color: var(--aia-multi-done-color, var(--aia-confirm-color, #ffffff));
1379
+ border-radius: 12px;
1380
+ background: var(--aia-multi-done-bg, var(--aia-done-bg, #e4e8f0));
1381
+ color: var(--aia-multi-done-color, var(--aia-done-color, #2a3150));
1279
1382
  font-family: inherit;
1280
- font-size: 13px;
1281
- font-weight: 500;
1383
+ font-size: 15px;
1384
+ font-weight: 600;
1282
1385
  line-height: 20px;
1283
1386
  cursor: pointer;
1284
1387
  transition: background-color 150ms ease-out;
1285
1388
  }
1286
1389
 
1287
1390
  .aia-multiDone-y12U7:hover {
1288
- background: var(--aia-multi-done-bg-hover, var(--aia-confirm-bg-hover, #404040));
1391
+ background: var(--aia-multi-done-bg-hover, var(--aia-done-bg-hover, #d8dde8));
1392
+ }
1393
+
1394
+ /* The open panel's leaving ghost (panelMorph.ts) is a frozen copy of the
1395
+ last step: the rows' own entrance must not replay in it while it fades. */
1396
+ .aia-dropdown-yz2KC .magicx-aia-panel-ghost,
1397
+ .aia-dropdown-yz2KC .magicx-aia-panel-ghost * {
1398
+ /* biome-ignore lint/complexity/noImportantStyles: the copy must not replay the rows' own motion */
1399
+ animation: none !important;
1400
+ /* biome-ignore lint/complexity/noImportantStyles: the copy must not replay the rows' own motion */
1401
+ transition: none !important;
1402
+ /* biome-ignore lint/complexity/noImportantStyles: a row's own pointer-events: auto must not make the leaving copy catch taps */
1403
+ pointer-events: none !important;
1289
1404
  }
1290
- `,document.head.appendChild(e)}var Le={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 V=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) ---
1291
1406
 
1292
1407
  One of three hand-maintained copies (vanilla styles.css, this file, Angular's
1293
1408
  date-grid.component.css). Only the class-naming layer differs \u2014 the
@@ -1474,7 +1589,7 @@
1474
1589
  opacity: 0.8;
1475
1590
  background: rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);
1476
1591
  }
1477
- `,document.head.appendChild(e)}var U={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 ge=require("react/jsx-runtime"),La=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function Ut({options:e,activeIndex:o,listboxId:t,view:i,selection:n,onSelect:l,onHighlight:r,onUnhighlight:c,onPreviousMonth:g,onNextMonth:x}){let y=(0,V.isoDate)(new Date),m=(0,V.visibleDateRange)({pendingStart:n.rangeStart,highlightedIso:(0,V.cellIso)(e[o]),selected:n.selectedRange,floor:n.floor});return(0,ge.jsxs)("div",{className:U.datepicker,"data-aia-datepicker":"",children:[(0,ge.jsxs)("div",{className:U.header,children:[(0,ge.jsx)("button",{type:"button",tabIndex:-1,className:U.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:p=>p.preventDefault(),onClick:g,children:"\u2039"}),(0,ge.jsx)("span",{className:U.month,"data-aia-date-month":"","aria-live":"polite",children:(0,V.monthLabel)(i)}),(0,ge.jsx)("button",{type:"button",tabIndex:-1,className:U.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:p=>p.preventDefault(),onClick:x,children:"\u203A"})]}),(0,ge.jsx)("div",{className:U.weekdays,"aria-hidden":"true",children:V.WEEKDAY_LABELS.map((p,h)=>(0,ge.jsx)("span",{className:U.weekday,children:p},La[h]))}),(0,ge.jsx)("div",{className:U.grid,"data-aia-date-grid":"",children:e.map((p,h)=>(0,ge.jsx)(Ra,{option:p,id:`${t}-option-${h}`,index:h,isHighlighted:h===o&&p.is_tappable,isToday:(0,V.cellIso)(p)===y,isPast:(0,V.isDimmedDay)((0,V.cellIso)(p),y,n.floor),marks:(0,V.dateCellMarks)((0,V.cellIso)(p),{selectedIso:n.selectedIso,range:m}),onSelect:l,onHighlight:r,onUnhighlight:c},(0,V.cellIso)(p)??`pad-${h}`))})]})}function Ra({option:e,id:o,index:t,isHighlighted:i,isToday:n,isPast:l,marks:r,onSelect:c,onHighlight:g,onUnhighlight:x}){let[y,m]=(0,_t.useState)(!1),p=(0,V.cellDay)(e);if(p==null)return(0,ge.jsx)("div",{id:o,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${U.cell} ${U.blank}`});let h=()=>{m(!0),c(e),setTimeout(()=>m(!1),170)},v=[U.cell,U.day,l?U.past:"",i?U.highlighted:"",n?U.today:"",r.inRange?U.inRange:"",r.selected?U.selected:"",y?U.pressed:""].filter(Boolean).join(" ");return(0,ge.jsx)("div",{id:o,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":i,"aria-label":e.text,tabIndex:0,className:v,onClick:h,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),h())},onMouseEnter:()=>g(t),onMouseLeave:x?()=>x(t):void 0,children:(0,ge.jsx)("span",{className:U.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 {
1478
1593
  display: flex;
1479
1594
  flex-wrap: wrap;
1480
1595
  gap: var(--aia-cluster-gap, 0.5rem);
@@ -1514,7 +1629,7 @@
1514
1629
  .aia-cluster[data-justify="around"] {
1515
1630
  justify-content: space-around;
1516
1631
  }
1517
- `,document.head.appendChild(e)}var Ot=require("react/jsx-runtime");function ft({gap:e,align:o="center",justify:t="start",noWrap:i=!1,inline:n=!1,className:l,children:r,...c}){let g=e?{"--aia-cluster-gap":e}:void 0,x={className:l?`aia-cluster ${l}`:"aia-cluster","data-align":o,"data-justify":t,"data-nowrap":i||void 0,"data-inline":n||void 0,style:g,...c};return n?(0,Ot.jsx)("span",{...x,children:r}):(0,Ot.jsx)("div",{...x,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
1518
1633
  dropdown's rounded edges. The top inset (--aia-footer-gap) adds breathing
1519
1634
  room above the hint/branding row so the footer doesn't butt against the last
1520
1635
  option row \u2014 additive to the dropdown's 8px section gap. */
@@ -1661,7 +1776,7 @@
1661
1776
  justify-content: flex-end;
1662
1777
  }
1663
1778
  }
1664
- `,document.head.appendChild(e)}var Ke={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 Vt({isOptionHighlighted:e=!1,isInputEmpty:o=!1,strings:t=(0,$e.uiStringsFor)()}){let{key:i,hint:n}=(0,$e.getFooterHint)(e,o,t),[l,r]=(0,yt.useState)($e.ATTRIBUTION_URL);return(0,yt.useEffect)(()=>{r((0,$e.buildAttributionUrl)())},[]),(0,Re.jsx)("footer",{className:Ke.footer,"data-aia-footer":"",children:(0,Re.jsxs)(ft,{justify:"between",noWrap:!0,className:Ke.row,children:[(0,Re.jsxs)(ft,{gap:"5px",className:Ke.hintGroup,children:[(0,Re.jsx)("kbd",{className:Ke.key,children:i}),(0,Re.jsx)("span",{className:Ke.hint,children:n})]}),(0,Re.jsxs)("a",{className:Ke.brandLink,href:l,target:"_blank",rel:"noopener noreferrer",children:[(0,Re.jsx)("span",{className:Ke.brand,children:"AI"}),(0,Re.jsx)("span",{className:Ke.badge,children:"Autocomplete"})]})]})})}var te=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
1665
1780
  Angular copy). The three are kept identical by
1666
1781
  packages/vanilla/tests/render/locationFieldParity.test.ts. */
1667
1782
  .aia-location-6-fsr {
@@ -1677,9 +1792,15 @@
1677
1792
  gap: 8px;
1678
1793
  padding: 8px 10px;
1679
1794
  border-radius: var(--aia-location-field-radius, 10px);
1680
- 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);
1681
1796
  color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
1682
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));
1683
1804
  }
1684
1805
 
1685
1806
  .aia-icon-czx6C {
@@ -1703,6 +1824,7 @@
1703
1824
 
1704
1825
  .aia-input-Yi9V-::placeholder {
1705
1826
  color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
1827
+ font-weight: 300;
1706
1828
  opacity: 0.7;
1707
1829
  }
1708
1830
 
@@ -1788,7 +1910,7 @@
1788
1910
  .aia-loadingBar-OLCr4:nth-child(3) {
1789
1911
  width: 60%;
1790
1912
  }
1791
- `,document.head.appendChild(e)}var Q={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 H=require("react/jsx-runtime"),Oa=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 o=Yt(e);if(!o||o.rangeCount===0)return null;let t=o.getRangeAt(0);return e.contains(t.startContainer)?t.cloneRange():null}function Qt(e,o){if(e.focus({preventScroll:!0}),!e.isContentEditable)return;let t=Yt(e);if(!t)return;let i=o;(!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,H.jsxs)("svg",{className:Q.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,H.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,H.jsx)("circle",{cx:"12",cy:"9.5",r:"2.5"})]}),za=(0,H.jsxs)("svg",{className:Q.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,H.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,H.jsx)("path",{d:"m20 20-3.5-3.5"})]});function jt({view:e,searchLabel:o,noResultsLabel:t,useTypedLabel:i,widgetFocused:n,visible:l=!0,interactive:r=!0,onQuery:c,onMove:g,onCommit:x,onFocusChange:y}){let m=(0,te.useRef)(null),p=(0,te.useRef)(null),h=(0,te.useRef)(null),v=(0,te.useRef)(null),A=(0,te.useRef)(null),B=(0,te.useRef)(!1),R=(0,te.useRef)(!1),_=(0,te.useRef)(!1),$=(0,te.useRef)(n);$.current=n;let O=(0,te.useRef)(y);O.current=y;let L=u=>{_.current=u,y(u)},k=()=>{let u=m.current;return u!=null&&bt(u)===u},ne=()=>{let u=p.current;if(!u)return;let P=bt(u);P instanceof HTMLElement&&P!==m.current&&P!==document.body&&!u.contains(P)&&(v.current=P,A.current=Da(P))},Z=(0,te.useRef)(null);Z.current===null&&(Z.current=`aia-location-${++Oa}`);let re=`${Z.current}-row-`;(0,te.useEffect)(()=>{let u=m.current;u&&u.value!==e.query&&bt(u)!==u&&(u.value=e.query)},[e.query]),(0,te.useEffect)(()=>{let u=m.current;if(u){if(!l&&k()){R.current=!0,W();return}if(!n){setTimeout(()=>{if($.current)return;let P=v.current;P&&bt(P)===P||(R.current=!1)},0);return}if(!(R.current||!r||k())){if(ne(),L(!0),u.focus({preventScroll:!0}),!k()){R.current=!0,L(!1);return}u.value&&u.select()}}}),(0,te.useLayoutEffect)(()=>()=>{if(!_.current)return;let u=m.current,P=v.current;P?.isConnected&&u&&bt(u)===u&&(B.current=!0,Qt(P,A.current),B.current=!1),_.current=!1,O.current(!1)},[]);let W=(u=!1)=>{u&&(R.current=!0);let P=v.current;P?.isConnected&&k()&&(B.current=!0,Qt(P,A.current),B.current=!1),L(!1)},X=e.query.trim(),T=e.highlighted>=0&&e.highlighted<e.places.length?`${re}${e.highlighted}`:void 0,j=null;return e.places.length>0?j=e.places.map((u,P)=>(0,H.jsxs)("div",{id:`${re}${P}`,role:"option","aria-selected":P===e.highlighted,className:P===e.highlighted?`${Q.row} ${Q.highlighted}`:Q.row,"data-aia-location-row":"","data-aia-index":P,onClick:()=>{r&&(W(!0),x(P))},children:[(0,H.jsx)("span",{className:Q.pin,children:Ma}),(0,H.jsxs)("span",{className:Q.text,children:[(0,H.jsx)("span",{className:Q.name,children:u.name}),u.secondary&&(0,H.jsx)("span",{className:Q.secondary,children:u.secondary})]})]},u.id)):e.status==="loading"?j=(0,H.jsxs)("div",{className:Q.loading,"data-aia-location-loading":"",children:[(0,H.jsx)("span",{className:Q.loadingBar}),(0,H.jsx)("span",{className:Q.loadingBar}),(0,H.jsx)("span",{className:Q.loadingBar})]}):X&&(j=(0,H.jsxs)("div",{className:Q.note,"data-aia-location-note":"",children:[e.status==="done"&&(0,H.jsx)("span",{className:Q.empty,children:t}),(0,H.jsx)("span",{children:i})]})),(0,H.jsxs)("div",{ref:p,className:Q.location,"data-aia-location":"",onMouseDown:u=>{!(u.target instanceof Node)||!h.current?.contains(u.target)||(u.stopPropagation(),ne(),L(!0))},children:[(0,H.jsxs)("label",{ref:h,className:Q.field,children:[za,(0,H.jsx)("input",{ref:m,type:"text",className:Q.input,"data-aia-location-input":"",defaultValue:e.query,placeholder:o,"aria-label":o,"aria-activedescendant":T,autoComplete:"off",autoCapitalize:"words",enterKeyHint:"done",spellCheck:!1,tabIndex:l?0:-1,onChange:u=>c(u.target.value),onFocus:()=>L(!0),onBlur:()=>{B.current||(R.current=!0,L(!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;W(!0),x();return;case"Escape":u.preventDefault(),u.stopPropagation(),R.current=!0,W();return;case"Backspace":if(u.currentTarget.value!=="")return;u.preventDefault(),R.current=!0,W();return}}})]}),(0,H.jsx)("div",{className:Q.results,"data-aia-location-results":"","aria-live":"polite",children:j})]})}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,
1792
1914
  no outline. ~28px via 6px padding + 14px text + the 1px border (border-box).
1793
1915
  The border is kept as a 1px transparent line so the box stays the same size
1794
1916
  as it was when the outline was dashed. */
@@ -1811,6 +1933,9 @@
1811
1933
  letter-spacing: 0.06em;
1812
1934
  cursor: pointer;
1813
1935
  white-space: nowrap;
1936
+ /* The positional opacity ramp, set inline per pill as a custom property so
1937
+ a rule can read the live label at full strength without !important. */
1938
+ opacity: var(--aia-pill-opacity, 1);
1814
1939
  animation: aia-fadeIn-Ux4eQ 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
1815
1940
  }
1816
1941
 
@@ -1968,7 +2093,7 @@
1968
2093
  opacity: 0;
1969
2094
  }
1970
2095
  }
1971
- `,document.head.appendChild(e)}var Oe={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:o,rounded:t,loading:i,smartSuggestion:n,completionHeader:l,onClick:r}){let c=[Oe.pill,t?Oe.rounded:"",i?Oe.skeleton:""].filter(Boolean).join(" ");return(0,Ze.jsx)("button",{type:"button","data-aia-pill":"","data-aia-loading":i?"":void 0,"data-aia-smart-suggestion":n?l?"header":"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:c,style:{opacity:Dt[o]},onMouseDown:g=>g.preventDefault(),onClick:i?void 0:r,disabled:i,children:n?(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsx)("span",{className:`${Oe.smartText} magicx-aia-smart-suggestion-text`,children:e}),(0,Ze.jsx)("span",{className:`${Oe.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 {
1972
2097
  position: relative;
1973
2098
  z-index: 1;
1974
2099
  pointer-events: auto;
@@ -1978,7 +2103,7 @@
1978
2103
  align-items: center;
1979
2104
  vertical-align: middle;
1980
2105
  }
1981
- `,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:o,onSelectPill:t,activeSelected:i,rounded:n,loading:l}){return l&&e.length===0?(0,wt.jsx)("span",{className:Mt.list,"data-aia-pill-list-loading":"",children:Na.map((r,c)=>(0,wt.jsx)("span",{"data-aia-pill-skeleton":"",className:`${Oe.pill} ${n?Oe.rounded:""} ${Oe.skeleton}`,style:{width:r,opacity:Dt[Xt(c)]}},`skel-${r}`))}):(0,wt.jsx)("span",{className:Mt.list,"data-aia-pill-list-loading":l?"":void 0,children:e.map((r,c)=>{let g=!!i&&c===o;return(0,wt.jsx)(Zt,{label:r.text,state:g?"selected":Xt(c),selected:g,rounded:n,loading:l,smartSuggestion:(0,kt.isSmartSuggestion)(r),completionHeader:(0,kt.isTraditionalAutocompleteSuggestion)(r),onClick:()=>t(c)},`${r.parameter}-${r.text}`)})})}var we=require("@magicx-eng/ai-autocomplete-vanilla"),fe=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
1982
2107
  (packages/vanilla/src/styles.css). Same tokens, same defaults, so a consumer
1983
2108
  theming one package sees the same result in the other.
1984
2109
 
@@ -1991,7 +2116,7 @@
1991
2116
  .aia-section-Hugfg {
1992
2117
  display: flex;
1993
2118
  flex-direction: column;
1994
- gap: 6px;
2119
+ gap: 4.2px;
1995
2120
  /* The option text sits 10px inside the dropdown's padding edge (the
1996
2121
  option's own padding), so the section carries the same 10px and its
1997
2122
  label lands on the option text's left edge \u2014 which the dropdown in turn
@@ -2002,9 +2127,9 @@
2002
2127
 
2003
2128
  .aia-label-nuc93 {
2004
2129
  font-family: inherit;
2005
- font-size: var(--aia-products-label-font-size, 11px);
2130
+ font-size: var(--aia-products-label-font-size, 7.7px);
2006
2131
  font-weight: 500;
2007
- line-height: 18px;
2132
+ line-height: 12.6px;
2008
2133
  letter-spacing: 0.02em;
2009
2134
  color: var(
2010
2135
  --aia-products-label-color,
@@ -2018,16 +2143,16 @@
2018
2143
  a trackpad fling at either end from chaining out to the page. */
2019
2144
  .aia-row-WDVBX {
2020
2145
  display: flex;
2021
- gap: var(--aia-product-gap, 8px);
2146
+ gap: var(--aia-product-gap, 5.6px);
2022
2147
  min-width: 0;
2023
2148
  overflow-x: auto;
2024
2149
  overflow-y: hidden;
2025
2150
  overscroll-behavior-x: contain;
2026
- padding-bottom: 2px;
2151
+ padding-bottom: 1.4px;
2027
2152
  /* Pull the row out by the card's own 6px padding so the first card's
2028
2153
  image tile \u2014 not its hover fill \u2014 starts on the label's left edge, the
2029
2154
  same way the option's highlight fill hangs outside its text. */
2030
- margin-inline: -6px;
2155
+ margin-inline: -4.2px;
2031
2156
  /* Hide the scrollbar chrome across all three engines while leaving the box
2032
2157
  scrollable by trackpad, touch and keyboard. A mouse wheel is vertical and
2033
2158
  would otherwise have no way through a row with no scrollbar to grab, so
@@ -2045,10 +2170,10 @@
2045
2170
  flex: 0 0 auto;
2046
2171
  display: flex;
2047
2172
  flex-direction: column;
2048
- gap: 6px;
2049
- width: var(--aia-product-card-width, 116px);
2050
- padding: 6px;
2051
- border-radius: 10px;
2173
+ gap: 4.2px;
2174
+ width: var(--aia-product-card-width, 81.2px);
2175
+ padding: 4.2px;
2176
+ border-radius: 7px;
2052
2177
  background: var(--aia-product-bg, transparent);
2053
2178
  /* Explicit, never inherited \u2014 see the file header. */
2054
2179
  color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
@@ -2081,7 +2206,7 @@
2081
2206
  position: relative;
2082
2207
  width: 100%;
2083
2208
  aspect-ratio: 1 / 1;
2084
- border-radius: 8px;
2209
+ border-radius: 5.6px;
2085
2210
  overflow: hidden;
2086
2211
  background: var(--aia-product-media-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.25)));
2087
2212
  }
@@ -2106,7 +2231,7 @@
2106
2231
  max-width: 100%;
2107
2232
  height: 100%;
2108
2233
  margin: 0 auto;
2109
- border-radius: var(--aia-product-image-radius, 8px);
2234
+ border-radius: var(--aia-product-image-radius, 5.6px);
2110
2235
  object-fit: contain;
2111
2236
  }
2112
2237
 
@@ -2119,7 +2244,7 @@
2119
2244
  align-items: center;
2120
2245
  justify-content: center;
2121
2246
  color: var(--aia-product-title-color, var(--aia-option-color-selected, currentColor));
2122
- font-size: 24px;
2247
+ font-size: 16.8px;
2123
2248
  font-weight: 600;
2124
2249
  line-height: 1;
2125
2250
  }
@@ -2142,14 +2267,14 @@
2142
2267
  .aia-body-ly032 {
2143
2268
  display: flex;
2144
2269
  flex-direction: column;
2145
- gap: 2px;
2270
+ gap: 1.4px;
2146
2271
  min-width: 0;
2147
2272
  }
2148
2273
 
2149
2274
  .aia-vendor-Gvu7G {
2150
2275
  font-family: inherit;
2151
- font-size: var(--aia-product-vendor-font-size, 10px);
2152
- line-height: 14px;
2276
+ font-size: var(--aia-product-vendor-font-size, 7px);
2277
+ line-height: 9.8px;
2153
2278
  color: var(
2154
2279
  --aia-product-vendor-color,
2155
2280
  var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb))
@@ -2163,9 +2288,9 @@
2163
2288
 
2164
2289
  .aia-title-gCNmq {
2165
2290
  font-family: inherit;
2166
- font-size: var(--aia-product-title-font-size, 12px);
2291
+ font-size: var(--aia-product-title-font-size, 8.4px);
2167
2292
  font-weight: 400;
2168
- line-height: 16px;
2293
+ line-height: 11.2px;
2169
2294
  /* The card's most prominent text uses the same token the *highlighted*
2170
2295
  option text does, so it stays legible on any --aia-surface a consumer
2171
2296
  sets \u2014 light or dark \u2014 without a second theming control. */
@@ -2182,9 +2307,9 @@
2182
2307
 
2183
2308
  .aia-price-gULcE {
2184
2309
  font-family: inherit;
2185
- font-size: var(--aia-product-price-font-size, 11px);
2310
+ font-size: var(--aia-product-price-font-size, 7.7px);
2186
2311
  font-weight: 500;
2187
- line-height: 15px;
2312
+ line-height: 10.5px;
2188
2313
  color: var(
2189
2314
  --aia-product-price-color,
2190
2315
  var(--aia-option-color-selected, var(--aia-color-text-default, #fff))
@@ -2195,7 +2320,7 @@
2195
2320
  display: flex;
2196
2321
  flex-wrap: wrap;
2197
2322
  align-items: baseline;
2198
- column-gap: 4px;
2323
+ column-gap: 2.8px;
2199
2324
  }
2200
2325
 
2201
2326
  /* The price before a markdown, struck through after the price, on the same
@@ -2213,10 +2338,10 @@
2213
2338
  reads on any photo, light or dark, and on either panel surface. */
2214
2339
  .aia-badge-j9Hcd {
2215
2340
  position: absolute;
2216
- top: var(--aia-product-badge-inset, 12px);
2217
- left: var(--aia-product-badge-inset, 12px);
2218
- padding: 3px 6px;
2219
- border-radius: 4px;
2341
+ top: var(--aia-product-badge-inset, 8.4px);
2342
+ left: var(--aia-product-badge-inset, 8.4px);
2343
+ padding: 2.1px 4.2px;
2344
+ border-radius: 2.8px;
2220
2345
  background: var(--aia-product-badge-bg, rgba(255, 255, 255, 0.94));
2221
2346
  color: var(--aia-product-badge-color, #1f2328);
2222
2347
  /* A hairline ring keeps the chip's edge on a pale image or a light panel. */
@@ -2224,7 +2349,7 @@
2224
2349
  0 0 0 1px rgba(0, 0, 0, 0.08),
2225
2350
  0 1px 2px rgba(0, 0, 0, 0.18);
2226
2351
  font-family: inherit;
2227
- font-size: var(--aia-product-badge-font-size, 9px);
2352
+ font-size: var(--aia-product-badge-font-size, 6.3px);
2228
2353
  font-weight: 600;
2229
2354
  line-height: 1;
2230
2355
  letter-spacing: 0.08em;
@@ -2246,24 +2371,24 @@
2246
2371
  fill the square (--aia-product-photo-fill-x / -y, set on the card when
2247
2372
  the photo loads; 1, the tile's own corner, until then). */
2248
2373
  top: calc(
2249
- var(--aia-product-card-width, 116px) -
2250
- 12px -
2251
- var(--aia-product-cart-size, 28px) -
2252
- (var(--aia-product-card-width, 116px) - 12px) *
2374
+ var(--aia-product-card-width, 81.2px) -
2375
+ 8.4px -
2376
+ var(--aia-product-cart-size, 19.6px) -
2377
+ (var(--aia-product-card-width, 81.2px) - 8.4px) *
2253
2378
  (1 - var(--aia-product-photo-fill-y, 1)) /
2254
2379
  2
2255
2380
  );
2256
2381
  right: calc(
2257
- 12px +
2258
- (var(--aia-product-card-width, 116px) - 12px) *
2382
+ 8.4px +
2383
+ (var(--aia-product-card-width, 81.2px) - 8.4px) *
2259
2384
  (1 - var(--aia-product-photo-fill-x, 1)) /
2260
2385
  2
2261
2386
  );
2262
2387
  display: flex;
2263
2388
  align-items: center;
2264
2389
  justify-content: center;
2265
- width: var(--aia-product-cart-size, 28px);
2266
- height: var(--aia-product-cart-size, 28px);
2390
+ width: var(--aia-product-cart-size, 19.6px);
2391
+ height: var(--aia-product-cart-size, 19.6px);
2267
2392
  border-radius: 999px;
2268
2393
  background: var(--aia-product-cart-bg, rgba(255, 255, 255, 0.94));
2269
2394
  color: var(--aia-product-cart-color, #1f2328);
@@ -2287,8 +2412,8 @@
2287
2412
 
2288
2413
  .aia-cart-kSlqU svg {
2289
2414
  display: block;
2290
- width: 16px;
2291
- height: 16px;
2415
+ width: 11.2px;
2416
+ height: 11.2px;
2292
2417
  fill: none;
2293
2418
  stroke: currentColor;
2294
2419
  stroke-width: 2;
@@ -2371,8 +2496,8 @@
2371
2496
  occurrence, and these selectors contain the base selectors. */
2372
2497
  .aia-section-Hugfg[data-aia-products-layout="list"] .aia-row-WDVBX {
2373
2498
  flex-direction: column;
2374
- gap: var(--aia-product-list-gap, 2px);
2375
- max-height: var(--aia-product-list-max-height, 320px);
2499
+ gap: var(--aia-product-list-gap, 1.4px);
2500
+ max-height: var(--aia-product-list-max-height, 224px);
2376
2501
  overflow-x: hidden;
2377
2502
  overflow-y: auto;
2378
2503
  overscroll-behavior-y: contain;
@@ -2381,17 +2506,17 @@
2381
2506
  .aia-section-Hugfg[data-aia-products-layout="list"] .aia-card-JBGYT {
2382
2507
  flex-direction: row;
2383
2508
  align-items: center;
2384
- gap: 10px;
2509
+ gap: 7px;
2385
2510
  width: auto;
2386
- padding: 6px 8px;
2511
+ padding: 4.2px 5.6px;
2387
2512
  }
2388
2513
 
2389
2514
  /* A fixed square thumbnail: width and height together, so the row's height
2390
2515
  is the tile's, not the card width's. */
2391
2516
  .aia-section-Hugfg[data-aia-products-layout="list"] .aia-media-RrbGe {
2392
2517
  flex: 0 0 auto;
2393
- width: var(--aia-product-list-media-size, 44px);
2394
- height: var(--aia-product-list-media-size, 44px);
2518
+ width: var(--aia-product-list-media-size, 30.8px);
2519
+ height: var(--aia-product-list-media-size, 30.8px);
2395
2520
  }
2396
2521
 
2397
2522
  .aia-section-Hugfg[data-aia-products-layout="list"] .aia-body-ly032 {
@@ -2403,18 +2528,18 @@
2403
2528
  match, so its bottom edge is half a thumbnail below the card's centre; its
2404
2529
  left edge is the card's 8px inline padding. */
2405
2530
  .aia-section-Hugfg[data-aia-products-layout="list"] .aia-badge-j9Hcd {
2406
- top: calc(50% + var(--aia-product-list-media-size, 44px) / 2);
2407
- left: 8px;
2408
- width: var(--aia-product-list-media-size, 44px);
2531
+ top: calc(50% + var(--aia-product-list-media-size, 30.8px) / 2);
2532
+ left: 5.6px;
2533
+ width: var(--aia-product-list-media-size, 30.8px);
2409
2534
  transform: translateY(-100%);
2410
- padding: 2px 0;
2411
- border-radius: 0 0 8px 8px;
2535
+ padding: 1.4px 0;
2536
+ border-radius: 0 0 5.6px 5.6px;
2412
2537
  /* A dark scrim rather than the light chip: a light banner at a tile's edge
2413
2538
  merges with a light panel and reads as a cropped photo. */
2414
2539
  background: var(--aia-product-badge-list-bg, rgba(17, 17, 17, 0.72));
2415
2540
  color: var(--aia-product-badge-list-color, #fff);
2416
2541
  box-shadow: none;
2417
- font-size: var(--aia-product-badge-list-font-size, 7px);
2542
+ font-size: var(--aia-product-badge-list-font-size, 4.9px);
2418
2543
  letter-spacing: 0.02em;
2419
2544
  text-align: center;
2420
2545
  }
@@ -2423,7 +2548,7 @@
2423
2548
  column stops short of it. */
2424
2549
  .aia-section-Hugfg[data-aia-products-layout="list"] .aia-cart-kSlqU {
2425
2550
  top: 50%;
2426
- right: 8px;
2551
+ right: 5.6px;
2427
2552
  transform: translateY(-50%);
2428
2553
  }
2429
2554
 
@@ -2432,9 +2557,9 @@
2432
2557
  }
2433
2558
 
2434
2559
  .aia-section-Hugfg[data-aia-products-layout="list"] .aia-card-JBGYT[data-aia-product-has-cart] {
2435
- padding-right: calc(var(--aia-product-cart-size, 28px) + 16px);
2560
+ padding-right: calc(var(--aia-product-cart-size, 19.6px) + 11.2px);
2436
2561
  }
2437
- `,document.head.appendChild(e)}var Y={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 N=require("react/jsx-runtime");function Jt({products:e,listboxId:o,onSelect:t,onAddToCart:i,onFocusChange:n,focusable:l=!0,layout:r="row",imageFallback:c="image",strings:g=(0,we.uiStringsFor)()}){let x=e.length>0,y=(0,fe.useRef)(null);if((0,fe.useEffect)(()=>{let p=y.current;if(!(!x||!p))return(0,we.attachProductRowWheel)(p)},[x]),!x)return null;let m=`${o}-products-label`;return(0,N.jsxs)("section",{className:Y.section,"data-aia-products":"","data-aia-products-layout":r,role:"group","aria-labelledby":m,children:[(0,N.jsx)("div",{className:Y.label,id:m,"data-aia-products-label":"",children:g.products}),(0,N.jsx)("div",{ref:y,className:Y.row,"data-aia-products-row":"",children:e.map((p,h)=>(0,N.jsx)(Fa,{product:p,id:`${o}-product-${h}`,onSelect:t,onAddToCart:i,onFocusChange:n,focusable:l,imageFallback:c,soldOut:g.soldOut,addToCart:g.addToCart},p.id))})]})}function Fa({product:e,id:o,onSelect:t,onAddToCart:i,onFocusChange:n,focusable:l,imageFallback:r,soldOut:c,addToCart:g}){let x=!!i&&e.available!==!1,[y,m]=(0,fe.useState)(null),p=v=>{v.relatedTarget?.closest("[data-aia-dropdown]")||n?.(!1)},h=v=>{v.metaKey||v.ctrlKey||v.shiftKey||v.altKey||v.button!==0||(v.preventDefault(),t(e))};return(0,N.jsxs)("a",{id:o,className:Y.card,"data-aia-product":"","data-aia-product-sold-out":e.available===!1?"":void 0,"data-aia-product-has-cart":x?"":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:l?0:-1,onClick:h,onKeyDown:v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),t(e))},onFocus:()=>n?.(!0),onBlur:p,children:[(0,N.jsx)(Wa,{sources:(0,we.productImageSources)(e.imageUrl),title:e.title,fallback:r,onPhotoFill:m},(0,we.productImageSrc)(e.imageUrl)??""),(0,N.jsxs)("span",{className:Y.body,children:[e.vendor?(0,N.jsx)("span",{className:Y.vendor,children:e.vendor}):null,(0,N.jsx)("span",{className:Y.title,children:e.title}),e.price?(0,N.jsxs)("span",{className:Y.price,children:[e.price,e.compareAtPrice?(0,N.jsx)("s",{className:Y.compareAt,children:e.compareAtPrice}):null]}):null,e.available===!1?(0,N.jsx)("span",{className:Y.badge,children:c}):null]}),x&&i?(0,N.jsx)(Ba,{product:e,label:`${g}: ${e.title}`,focusable:l,onAddToCart:i,onFocus:()=>n?.(!0),onBlur:p},Ha(e)):null]})}function Ha(e){return[e.id,e.title,e.url,e.imageUrl,e.vendor].map(o=>o??"").join("\0")}function Ba({product:e,label:o,focusable:t,onAddToCart:i,onFocus:n,onBlur:l}){let[r,c]=(0,fe.useState)(null),g=(0,fe.useRef)(null),x=(0,fe.useRef)(e);x.current=e;let y=(0,fe.useRef)(!0);(0,fe.useEffect)(()=>(y.current=!0,()=>{y.current=!1}),[]);let m=h=>{g.current=h,y.current&&c(h)},p=h=>{if(h.preventDefault(),h.stopPropagation(),g.current==="adding")return;m("adding");let v;try{v=Promise.resolve(i(x.current))}catch(A){v=Promise.reject(A)}v.then(()=>m("added"),()=>m(null))};return(0,N.jsx)("span",{className:Y.cart,"data-aia-product-cart":"","data-aia-cart-state":r??void 0,"aria-busy":r==="adding"?!0:void 0,role:"button","aria-label":o,tabIndex:t?0:-1,onClick:p,onKeyDown:h=>{h.key!=="Enter"&&h.key!==" "||p(h)},onFocus:h=>{h.stopPropagation(),n()},onBlur:h=>{h.stopPropagation(),l(h)},children:(0,N.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,N.jsx)("path",{className:Y.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,N.jsx)("path",{className:Y.cartGlyph,d:"M13.5 6.5v-4M11.5 4.5h4"}),(0,N.jsx)("path",{className:Y.cartCheck,d:"M5 12.5l4.5 4.5L19 7.5"}),(0,N.jsx)("path",{className:Y.cartSpinner,d:"M12 4a8 8 0 1 0 8 8"}),(0,N.jsx)("circle",{className:Y.cartGlyph,cx:"9",cy:"20",r:"1.3"}),(0,N.jsx)("circle",{className:Y.cartGlyph,cx:"17.5",cy:"20",r:"1.3"})]})})}function Wa({sources:e,title:o,fallback:t,onPhotoFill:i}){let[n,l]=(0,fe.useState)(0),r=e[n],c=!!r,[g,x]=(0,fe.useState)(null),y=!c&&t==="initial";return(0,fe.useEffect)(()=>()=>i(null),[i]),(0,N.jsxs)("span",{className:Y.media,"aria-hidden":"true","data-aia-product-placeholder":!c&&!y?"":void 0,"data-aia-product-initial":y?"":void 0,"data-aia-image-loaded":c&&g===r?"":void 0,children:[c?(0,N.jsx)("img",{className:Y.image,src:r,alt:"",loading:"lazy",decoding:"async",onLoad:m=>{x(r),i((0,we.productPhotoFill)(m.currentTarget.naturalWidth,m.currentTarget.naturalHeight))},onError:()=>{n+1>=e.length&&i(null),l(m=>m+1)}}):null,y?(0,we.productInitial)(o):null]})}var ie=require("@magicx-eng/ai-autocomplete-vanilla"),De=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 {
2438
2563
  display: grid;
2439
2564
  grid-template-columns: repeat(
2440
2565
  auto-fit,
@@ -2462,7 +2587,7 @@
2462
2587
  /* The scroll box's reserved band (--aia-grid-scroll-* / --aia-grid-overlap-*)
2463
2588
  is deliberately NOT declared here \u2014 see the rule in
2464
2589
  appearance.css for why. */
2465
- max-height: var(--aia-grid-max-height, 120px);
2590
+ max-height: var(--aia-grid-max-height, 84px);
2466
2591
  overflow-y: auto;
2467
2592
  overscroll-behavior: contain;
2468
2593
  scrollbar-width: none;
@@ -2470,7 +2595,7 @@
2470
2595
  .aia-grid[data-scroll]::-webkit-scrollbar {
2471
2596
  display: none;
2472
2597
  }
2473
- `,document.head.appendChild(e)}var aa=require("react/jsx-runtime");function ta({min:e="16rem",max:o,gap:t,scroll:i=!1,maxHeight:n,scrollResetKey:l,cols:r,template:c,innerRef:g,className:x,children:y,...m}){let p=(0,St.useRef)(null);(0,St.useLayoutEffect)(()=>{if(l===void 0)return;let v=p.current;v&&(v.scrollTop=0)},[l]);let h={"--aia-grid-min":e};return o&&(h["--aia-grid-max"]=o),t&&(h["--aia-grid-gap"]=t),n&&(h["--aia-grid-max-height"]=n),r&&(h.gridTemplateColumns=(0,ea.optionsGridTemplateColumns)(r)),c&&(h.gridTemplateColumns=c),(0,aa.jsx)("div",{ref:v=>{p.current=v,g?.(v)},className:x?`aia-grid ${x}`:"aia-grid","data-scroll":i||void 0,style:h,...m,children:y})}var he=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 {
2474
2599
  position: relative;
2475
2600
  /* Clip, not visible: the entrance rise below runs on the inner content,
2476
2601
  and a transformed box extends its scroll container's scrollable area.
@@ -2488,16 +2613,16 @@
2488
2613
  the same baseline at the top edge of the cell. */
2489
2614
  align-items: flex-start;
2490
2615
  font-family: inherit;
2491
- font-size: var(--aia-option-font-size, 16px);
2616
+ font-size: var(--aia-option-font-size, 11.2px);
2492
2617
  font-weight: 450;
2493
- line-height: 21px;
2618
+ line-height: 14.7px;
2494
2619
  color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
2495
2620
  white-space: normal;
2496
2621
  word-break: break-word;
2497
- /* 8px radius on the highlighted fill (--aia-option-bg), matching the Figma
2498
- SuggestionItem selection. The 9px/10px inset is the item's own padding. */
2499
- border-radius: 8px;
2500
- padding: 8px 10px;
2622
+ /* 5.6px radius on the highlighted fill (--aia-option-bg), matching the Figma
2623
+ SuggestionItem selection at 70%. The 5.6px/10px inset is the item's own padding. */
2624
+ border-radius: 5.6px;
2625
+ padding: 5.6px 10px;
2501
2626
  /* No entrance animation on the row itself \u2014 deliberately. The row is the
2502
2627
  tappable element, and iOS Safari drops a tap on a scripted-clickable
2503
2628
  element (a div with a click handler; a native button is exempt) whose
@@ -2583,8 +2708,8 @@
2583
2708
  }
2584
2709
 
2585
2710
  .aia-tag-e3Fwe {
2586
- font-size: 11px;
2587
- margin-left: 6px;
2711
+ font-size: 7.7px;
2712
+ margin-left: 4.2px;
2588
2713
  opacity: 0.5;
2589
2714
  }
2590
2715
 
@@ -2663,9 +2788,9 @@
2663
2788
  text box, so a hanging indent never moves it; a skeleton row drops it. */
2664
2789
  .aia-parameter-Dt2zF {
2665
2790
  display: block;
2666
- font-size: var(--aia-option-parameter-font-size, 12px);
2791
+ font-size: var(--aia-option-parameter-font-size, 8.4px);
2667
2792
  font-weight: 400;
2668
- line-height: 16px;
2793
+ line-height: 11.2px;
2669
2794
  text-indent: 0;
2670
2795
  color: var(--aia-option-parameter-color, inherit);
2671
2796
  opacity: var(--aia-option-parameter-opacity, 0.6);
@@ -2689,8 +2814,8 @@
2689
2814
  .aia-icon-Qw938 {
2690
2815
  display: inline-flex;
2691
2816
  align-items: center;
2692
- height: 21px; /* = the option's line-height */
2693
- margin-right: 8px;
2817
+ height: 14.7px; /* = the option's line-height */
2818
+ margin-right: 5.6px;
2694
2819
  vertical-align: top;
2695
2820
  /* Own compositing layer. The row (entrance) and the chip (promotion fade)
2696
2821
  animate on a layer WebKit drops when the animation ends; content drawn at
@@ -2721,8 +2846,8 @@
2721
2846
  (blockified), so text-indent applies to it directly. Skeleton rows keep
2722
2847
  it too: their icon is hidden but still occupies its column. */
2723
2848
  .aia-content-T-Qba:not(:has(.aia-count-IpYbQ)):has(.aia-icon-Qw938) {
2724
- padding-left: calc(1em + 8px);
2725
- text-indent: calc(-1em - 8px);
2849
+ padding-left: calc(1em + 5.6px);
2850
+ text-indent: calc(-1em - 5.6px);
2726
2851
  }
2727
2852
 
2728
2853
  /* --- Option pictures and counts ---
@@ -2764,15 +2889,15 @@
2764
2889
  loads) and stays if it never does. */
2765
2890
  .aia-content-T-Qba:has(.aia-image-YZAbO) {
2766
2891
  align-items: center;
2767
- gap: var(--aia-option-image-gap, 12px);
2892
+ gap: var(--aia-option-image-gap, 8.4px);
2768
2893
  }
2769
2894
 
2770
2895
  .aia-image-YZAbO {
2771
2896
  flex: 0 0 auto;
2772
2897
  display: block;
2773
- width: var(--aia-option-image-size, 40px);
2774
- height: var(--aia-option-image-size, 40px);
2775
- border-radius: var(--aia-option-image-radius, 12px);
2898
+ width: var(--aia-option-image-size, 28px);
2899
+ height: var(--aia-option-image-size, 28px);
2900
+ border-radius: var(--aia-option-image-radius, 8.4px);
2776
2901
  overflow: hidden;
2777
2902
  background: var(--aia-option-image-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.083)));
2778
2903
  }
@@ -2797,7 +2922,7 @@
2797
2922
  max-width: 100%;
2798
2923
  height: 100%;
2799
2924
  margin: 0 auto;
2800
- border-radius: var(--aia-option-picture-radius, 6px);
2925
+ border-radius: var(--aia-option-picture-radius, 4.2px);
2801
2926
  object-fit: contain;
2802
2927
  }
2803
2928
 
@@ -2814,10 +2939,10 @@
2814
2939
  .aia-count-IpYbQ {
2815
2940
  flex: 0 0 auto;
2816
2941
  margin-left: auto;
2817
- padding-left: 12px;
2818
- font-size: var(--aia-option-count-font-size, 12px);
2942
+ padding-left: 8.4px;
2943
+ font-size: var(--aia-option-count-font-size, 8.4px);
2819
2944
  font-weight: 400;
2820
- line-height: 21px; /* = the option's line-height */
2945
+ line-height: 14.7px; /* = the option's line-height */
2821
2946
  font-variant-numeric: tabular-nums;
2822
2947
  white-space: nowrap;
2823
2948
  color: var(--aia-option-count-color, inherit);
@@ -2853,12 +2978,12 @@
2853
2978
  display: none;
2854
2979
  }
2855
2980
 
2856
- /* A grid of rows with a parameter line is taller per row: the row's 21px text
2857
- line and 16px padding plus the 16px parameter line, so the visible-rows cap
2981
+ /* A grid of rows with a parameter line is taller per row: the row's text
2982
+ line and padding plus the parameter line, so the visible-rows cap
2858
2983
  (\`--aia-grid-max-height\`) does not cut the last row. Before the picture rule,
2859
2984
  which wins when a group has both. */
2860
2985
  [data-aia-group]:has(.aia-parameter-Dt2zF) {
2861
- --aia-option-row-height: 53px;
2986
+ --aia-option-row-height: 37.1px;
2862
2987
  }
2863
2988
 
2864
2989
  /* A grid of picture rows is taller per row: the visible-rows cap
@@ -2866,7 +2991,7 @@
2866
2991
  planOptionsGrid) follows the tile's height plus the row's padding, so the
2867
2992
  same number of rows shows before the list scrolls. */
2868
2993
  [data-aia-group]:has(.aia-image-YZAbO) {
2869
- --aia-option-row-height: calc(var(--aia-option-image-size, 40px) + 16px);
2994
+ --aia-option-row-height: calc(var(--aia-option-image-size, 28px) + 11.2px);
2870
2995
  }
2871
2996
 
2872
2997
  /* A row without a picture, in a grid where other rows have one, lines up
@@ -2881,9 +3006,9 @@
2881
3006
  display: flex;
2882
3007
  flex: 1 1 auto;
2883
3008
  align-items: center;
2884
- gap: var(--aia-option-image-gap, 12px);
3009
+ gap: var(--aia-option-image-gap, 8.4px);
2885
3010
  min-width: 0;
2886
- min-height: var(--aia-option-image-size, 40px);
3011
+ min-height: var(--aia-option-image-size, 28px);
2887
3012
  padding-left: 0;
2888
3013
  text-indent: 0;
2889
3014
  }
@@ -2891,8 +3016,8 @@
2891
3016
  [data-aia-group]:has(.aia-image-YZAbO) .aia-content-T-Qba:not(:has(.aia-image-YZAbO)) .aia-icon-Qw938 {
2892
3017
  flex: 0 0 auto;
2893
3018
  justify-content: center;
2894
- width: var(--aia-option-image-size, 40px);
2895
- height: var(--aia-option-image-size, 40px);
3019
+ width: var(--aia-option-image-size, 28px);
3020
+ height: var(--aia-option-image-size, 28px);
2896
3021
  margin-right: 0;
2897
3022
  }
2898
3023
 
@@ -2952,7 +3077,7 @@
2952
3077
  .aia-content-T-Qba:has(.aia-checkbox-KGRhg) {
2953
3078
  display: flex;
2954
3079
  align-items: center;
2955
- gap: 10px;
3080
+ gap: 7px;
2956
3081
  }
2957
3082
 
2958
3083
  /* A checkbox row is a flex row, so its icon is a flex item beside the text,
@@ -2976,14 +3101,14 @@
2976
3101
  /* The mark is text centred in the box. An indent inherited from the row
2977
3102
  (an icon row hangs its text with one) would slide it out of the box. */
2978
3103
  text-indent: 0;
2979
- flex: 0 0 18px;
2980
- width: 18px;
2981
- height: 18px;
3104
+ flex: 0 0 12.6px;
3105
+ width: 12.6px;
3106
+ height: 12.6px;
2982
3107
  border: 1px solid var(--aia-border);
2983
- border-radius: 6px;
3108
+ border-radius: 4.2px;
2984
3109
  background: var(--aia-surface);
2985
3110
  color: transparent;
2986
- font-size: 11px;
3111
+ font-size: 7.7px;
2987
3112
  line-height: 1;
2988
3113
  }
2989
3114
 
@@ -2996,7 +3121,7 @@
2996
3121
  .aia-item-d4vpD:has(.aia-checkbox-KGRhg[data-checked="true"]) {
2997
3122
  background: var(--aia-option-bg, transparent);
2998
3123
  }
2999
- `,document.head.appendChild(e)}var ae={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 se=require("react/jsx-runtime");function ia({option:e,isHighlighted:o,checked:t,onSelect:i,onHighlight:n,onUnhighlight:l,id:r,loading:c,showIcon:g=!0,showImage:x=!0,showCount:y=!0,scrollHint:m,enterDelayMs:p=0}){let[h]=(0,Se.useState)(p),[v,A]=(0,Se.useState)(!1),B=x?(0,he.optionImageSources)(e.image_url):[],R=B[0]??null,[_,$]=(0,Se.useState)([]),O=B.find(T=>!_.includes(T))??null,[L,k]=(0,Se.useState)(null),ne=(0,Se.useMemo)(()=>!R&&g&&e.icon_svg?(0,he.sanitizeOptionIconSvg)(e.icon_svg):null,[R,g,e.icon_svg]),Z=y?(0,he.formatOptionCount)(e.item_count):null,re=(0,Se.useRef)(void 0);(0,Se.useEffect)(()=>()=>clearTimeout(re.current),[]);let W=T=>{if(c||!e.is_tappable||v&&t===void 0)return;A(!0);let j=T?.currentTarget;t!==void 0&&j!==void 0&&T!==void 0&&!(0,he.isMultiSelectToggleTap)(j,j.querySelector("[data-aia-checkbox]"),T)?i(e,{commit:!0}):i(e),clearTimeout(re.current),re.current=setTimeout(()=>A(!1),170)},X=[ae.item,o&&!c?ae.highlighted:"",e.liveMatch&&!c?ae.liveMatch:"",e.is_tappable?ae.tappable:ae.nonTappable,v?ae.pressed:"",m?ae.scrollHint:""].filter(Boolean).join(" ");return(0,se.jsx)("div",{id:r,role:"option","data-aia-option":"","data-aia-loading":c?"":void 0,"data-aia-icon":ne&&e.icon?e.icon:void 0,"data-aia-image":R?"":void 0,"data-aia-item-count":Z!==null?e.item_count:void 0,"aria-selected":t??o,className:X,style:{[he.OPTION_ENTER_DELAY_VAR]:`${h}ms`},tabIndex:c||!e.is_tappable?-1:0,onClick:W,onKeyDown:T=>{!c&&e.is_tappable&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),W())},onMouseEnter:!c&&e.is_tappable?n:void 0,onMouseLeave:l,children:(0,se.jsxs)("span",{className:ae.content,children:[t!==void 0&&e.is_tappable&&(0,se.jsx)("span",{className:ae.checkbox,"aria-hidden":"true","data-aia-checkbox":"","data-checked":t,children:t?"\u2713":""}),R&&(0,se.jsx)("span",{className:`${ae.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-image-loaded":O!==null&&L===O?"":void 0,children:(0,se.jsx)("img",{src:O??R,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:O===null,onLoad:()=>k(O),onError:()=>{O!==null&&$(T=>[...T,O])}})}),ne&&(0,se.jsx)("span",{className:`${ae.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:ne}}),(0,se.jsxs)("span",{className:ae.text,children:[e.matchedText?(0,he.highlightParts)((0,he.optionLabel)(e),e.matchedText).map((T,j)=>T.bold?(0,se.jsx)("strong",{className:`${ae.match} magicx-aia-option-match`,children:T.text},j):T.text):(0,he.optionLabel)(e),e.parameterLabel&&(0,se.jsxs)(se.Fragment,{children:[" ",(0,se.jsx)("span",{className:`${ae.parameter} magicx-aia-option-parameter`,children:e.parameterLabel})]})]}),e.tag&&(0,se.jsx)("span",{className:ae.tag,children:e.tag}),Z!==null&&(0,se.jsx)("span",{className:`${ae.count} magicx-aia-option-count`,children:Z})]})})}var zt=require("react/jsx-runtime");function Ga(){let[e,o]=(0,De.useState)(ie.isOptionsGridMobileViewport);return(0,De.useEffect)(()=>{if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia(ie.OPTIONS_GRID_MOBILE_QUERY),i=()=>o(t.matches);return i(),t.addEventListener("change",i),()=>t.removeEventListener("change",i)},[]),e}function oa({options:e,activeIndex:o,picked:t,onSelect:i,onHighlight:n,onUnhighlight:l,listboxId:r,loading:c,groupKey:g="",optionsPosition:x="below",showIcons:y=!0,showImages:m=!0,showCounts:p=!0}){let h=Ga(),v=(0,De.useRef)(null),[A,B]=(0,De.useState)(null),R=(0,De.useRef)(null);(0,De.useLayoutEffect)(()=>{if(c&&(0,ie.sameOptionRows)(R.current,e))return;R.current=c?null:e;let O=v.current,k=O&&!c&&(0,ie.needsOptionsGridMeasurement)(e.length,h)?(0,ie.measureOptionsGrid)(O):null;B(k?(0,ie.planOptionsGrid)(e.length,h,k.rowWidths,k.gridWidth):null)},[e,h,c]);let _=A??(0,ie.planOptionsGrid)(e.length,h,null,null),$=(0,ie.optionsShowLeadingVisuals)(e,y,m);return(0,zt.jsx)(ta,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:g,template:_.template,maxHeight:_.maxHeight,innerRef:O=>{v.current=O},"data-aia-group":g,children:e.map((O,L)=>(0,zt.jsx)(ia,{option:O,isHighlighted:L===o,checked:t?t.includes(O.text):void 0,onSelect:i,onHighlight:()=>n(L),onUnhighlight:l?()=>l(L):void 0,id:`${r}-option-${L}`,loading:c,showIcon:y&&$,showImage:m&&$,showCount:p,scrollHint:!c&&_.scrollHintIndices.includes(L),enterDelayMs:c?0:(0,ie.optionEnterDelayMs)(L,_.cols,e.length,x)},`${g}\0${O.text}`))})}var le=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) ---
3000
3125
 
3001
3126
  One of three hand-maintained copies (vanilla styles.css, this file, Angular's
3002
3127
  time-wheel.component.css). Only the class-naming layer differs \u2014 the
@@ -3101,24 +3226,24 @@
3101
3226
 
3102
3227
  .aia-done-llNY5 {
3103
3228
  align-self: stretch;
3104
- height: 36px;
3229
+ height: 44px;
3105
3230
  padding: 0 12px;
3106
3231
  border: none;
3107
- border-radius: 8px;
3108
- background: var(--aia-time-done-bg, var(--aia-confirm-bg, #262626));
3232
+ border-radius: 12px;
3233
+ background: var(--aia-time-done-bg, var(--aia-done-bg, #e4e8f0));
3109
3234
  font-family: inherit;
3110
- font-size: 13px;
3111
- font-weight: 500;
3235
+ font-size: 15px;
3236
+ font-weight: 600;
3112
3237
  line-height: 20px;
3113
- color: var(--aia-time-done-color, var(--aia-confirm-color, #ffffff));
3238
+ color: var(--aia-time-done-color, var(--aia-done-color, #2a3150));
3114
3239
  cursor: pointer;
3115
3240
  transition: background-color 150ms ease-out;
3116
3241
  }
3117
3242
 
3118
3243
  .aia-done-llNY5:hover {
3119
- background: var(--aia-time-done-bg-hover, var(--aia-confirm-bg-hover, #404040));
3244
+ background: var(--aia-time-done-bg-hover, var(--aia-done-bg-hover, #d8dde8));
3120
3245
  }
3121
- `,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"),Ka=120;function na({view:e,label:o,doneLabel:t,interactive:i=!0,onTimeChange:n,onTimeCommit:l}){return(0,ve.jsxs)("div",{className:Te.timeWheel,"data-aia-time-wheel":"",role:"group","aria-label":o,onMouseDown:r=>r.preventDefault(),children:[(0,ve.jsx)("span",{className:Te.value,"data-aia-time-value":"","aria-live":"polite",children:(0,le.formatTime)(e.minutes)}),(0,ve.jsxs)("div",{className:Te.columns,"aria-hidden":"true",children:[(0,ve.jsx)("div",{className:Te.band}),le.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:i,onTimeChange:n})]},r))]}),(0,ve.jsx)("button",{type:"button",tabIndex:-1,className:Te.done,"data-aia-time-done":"",onClick:()=>{i&&l()},children:t})]})}function qa({column:e,minutes:o,interactive:t,onTimeChange:i}){let n=(0,Pe.useRef)(null),l=(0,Pe.useRef)(null),r=(0,Pe.useRef)(null),c=(0,Pe.useRef)({minutes:o,interactive:t,onTimeChange:i});c.current={minutes:o,interactive:t,onTimeChange:i};let g=(0,le.timeWheelIndex)(e,o);(0,Pe.useLayoutEffect)(()=>{let m=n.current;if(!m||r.current)return;let p=g*le.TIME_WHEEL_ROW_HEIGHT;Math.abs(m.scrollTop-p)<1||(l.current=p,m.scrollTop=p)},[g]),(0,Pe.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);let x=()=>{r.current=null;let m=n.current,p=c.current;if(!m||!p.interactive)return;let h=(0,le.timeWheelIndexFromScroll)(e,m.scrollTop);h!==(0,le.timeWheelIndex)(e,p.minutes)&&p.onTimeChange((0,le.withTimeWheelIndex)(e,p.minutes,h))},y=()=>{let m=n.current;if(m){if(l.current!=null&&Math.abs(m.scrollTop-l.current)<1){l.current=null;return}l.current=null,r.current&&clearTimeout(r.current),r.current=setTimeout(x,Ka)}};return(0,ve.jsx)("div",{ref:n,className:Te.column,"data-aia-time-column":e,onScroll:y,children:(0,le.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:()=>{c.current.interactive&&i((0,le.withTimeWheelIndex)(e,c.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 {
3122
3247
  display: flex;
3123
3248
  flex-direction: column;
3124
3249
  gap: var(--aia-stack-space, 0.5rem);
@@ -3133,7 +3258,7 @@
3133
3258
  align-items: end;
3134
3259
  }
3135
3260
  /* data-align="stretch" is the flex default \u2014 no rule needed. */
3136
- `,document.head.appendChild(e)}var sa=require("react/jsx-runtime");function ra({space:e,align:o="stretch",className:t,children:i,...n}){let l=e?{"--aia-stack-space":e}:void 0;return(0,sa.jsx)("div",{className:t?`aia-stack ${t}`:"aia-stack","data-align":o,style:l,...n,children:i})}var K=require("react/jsx-runtime"),_a=[159,119,164],Ua=()=>{},la=()=>{},Va=e=>{},Qa=()=>{},Ya=e=>{},ja=e=>{},$a=e=>{},Za=e=>{};function Xa(e){let o=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[t,i]=(0,de.useState)(o);if((0,de.useEffect)(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let n=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>i(n.matches);return n.addEventListener("change",l),()=>n.removeEventListener("change",l)},[e]),e!==void 0)return e==="auto"?t?"dark":"light":e}function Ja(e,o){let t=(0,de.useRef)(null);(0,de.useEffect)(()=>{let i=e.current,n=o.current;if(!i||!n)return;let l=i.querySelector(".aia-grid[data-scroll]");if(t.current&&t.current.grid!==l&&(t.current.controller.destroy(),t.current=null),l&&!t.current){t.current={grid:l,controller:(0,ce.attachScrollArrow)({dropdown:i,grid:l,button:n})};return}t.current?.controller.update()}),(0,de.useEffect)(()=>()=>{t.current?.controller.destroy(),t.current=null},[])}function ei(e,o){let t=(0,de.useRef)(o);t.current=o;let i=(0,de.useRef)(null);(0,de.useEffect)(()=>{let n=e.current;if(n){if(!i.current){i.current=(0,ce.attachViewportFit)({dropdown:n,isOpen:()=>t.current});return}i.current.update()}}),(0,de.useEffect)(()=>()=>{i.current?.destroy(),i.current=null},[])}function Tt({suggestions:e,activeIndex:o,onSelect:t,onHighlight:i,onUnhighlight:n,isOpen:l,id:r,className:c,pills:g,onPillClick:x,showPills:y=!0,onSkip:m,showSkipButton:p=!0,showOptionIcons:h=!0,showOptionImages:v=!0,showOptionCounts:A=!0,skipDisabled:B=!1,activeSelected:R=!1,isLoading:_=!1,skeletonExiting:$=!1,isInputEmpty:O=!1,language:L,products:k,onProductSelect:ne,onProductAddToCart:Z,onProductFocusChange:re,productsLayout:W="row",productImageFallback:X="image",formatType:T="options",dateView:j=null,selectedDateIso:u=null,selectedDateRange:P=null,dateRangeStart:qe=null,onPreviousMonth:ze,onNextMonth:Je,timeView:Ne=null,multiSelectView:f=null,onMultiSelectCommit:et,onTimeChange:_e,onTimeCommit:Ue,locationView:b=null,onLocationQuery:C,onLocationMove:S,onLocationCommit:I,onLocationFocusChange:D,isFocused:J=!1,optionsPosition:be="below",mode:xe}){let ye=Xa(xe),tt=ye!==void 0,ue=(0,de.useRef)(null),Fe=(0,de.useRef)(null);Ja(ue,Fe),(0,de.useEffect)(()=>{if(ue.current)return(0,ce.containScroll)(ue.current)},[]);let st=e[0]?.options??[],ht=!!(g&&g.length>0&&x),He=!!(k&&k.length>0),at=T==="time"&&Ne!=null,lt=T==="location"&&b!=null,pe=l&&(st.length>0||y&&ht||_||He||at||lt);ei(ue,pe);let Ee={suggestions:e,activeIndex:o,pills:g,showPills:y,showSkipButton:p,showOptionIcons:h,showOptionImages:v,showOptionCounts:A,skipDisabled:B,activeSelected:R,isLoading:_,skeletonExiting:$,isInputEmpty:O,products:k,formatType:T,dateView:j,selectedDateIso:u,selectedDateRange:P,dateRangeStart:qe,timeView:Ne,multiSelectView:f,locationView:b},Be=(0,de.useRef)(Ee);pe&&(Be.current=Ee);let a=pe?Ee:Be.current,ee=(0,ce.uiStringsFor)(L),Ve=a.suggestions[0],ke=Ve?.options??[],w=a.activeIndex>=0&&!!ke[a.activeIndex]?.is_tappable,We=(0,ce.labelTraditionalAutocomplete)(a.pills??[],ee.keepTyping),Qe=!!(We.length>0&&x),Ye=a.showPills&&Qe,ut=a.showPills&&!Qe&&a.isLoading,dt=Ye||ut,Ge=Qe&&(0,ce.hasSkippablePill)(We)&&a.showSkipButton&&!a.isInputEmpty&&!!m,ct=We[0]?.text,Ce=(0,ce.isCalendarFormat)(a.formatType)&&a.dateView!=null,Ae=ke.length>0&&!Ce,je=ke.length>0&&Ce&&!a.isLoading,it=a.formatType==="time"&&a.timeView!=null&&!a.isLoading,pt=a.formatType==="location"&&a.locationView!=null&&!a.isLoading,ot=a.isLoading&&!Ae&&!je&&!it&&!pt,nt=a.products??[];return(0,K.jsxs)("div",{ref:ue,id:r,role:"listbox","aria-multiselectable":!!a.multiSelectView,"data-aia-dropdown":"","data-options-position":be,"data-mode":ye,"data-aia-loading":a.isLoading?"":void 0,"data-aia-skeleton-exiting":a.skeletonExiting?"":void 0,"data-aia-has-products":nt.length>0?"":void 0,className:`${tt?"magicx-aia ":""}${Le.dropdown} ${pe?Le.visible:""} ${c??""}`,onMouseDown:s=>s.preventDefault(),children:[(0,K.jsxs)(ra,{space:"8px",children:[(dt||Ge)&&(0,K.jsxs)(ft,{noWrap:!0,className:Le.pillBar,"data-aia-pillbar":"",children:[dt&&(0,K.jsx)("span",{className:Le.pillScroll,"data-aia-pill-scroll":"",children:(0,K.jsx)(Ct,{pills:We,activePillIndex:0,activeSelected:a.activeSelected,onSelectPill:x??(()=>{}),rounded:!0,loading:a.isLoading})}),Ge&&(0,K.jsx)("button",{type:"button",tabIndex:-1,className:Le.skip,"data-aia-skip":"",disabled:a.isLoading||a.skipDisabled,"aria-label":ct?`${ee.skipLabel} ${ct}`:ee.skipLabel,onClick:m,children:ee.skip})]}),Ae&&(0,K.jsx)(oa,{options:ke,activeIndex:a.activeIndex,onSelect:t,onHighlight:i,onUnhighlight:n,listboxId:r,loading:a.isLoading,groupKey:Ve?`${Ve.parameter} ${Ve.text}`:"",optionsPosition:be,showIcons:a.showOptionIcons,showImages:a.showOptionImages,showCounts:a.showOptionCounts,picked:a.isLoading?void 0:a.multiSelectView?.picked}),a.multiSelectView&&!a.isLoading&&(0,K.jsx)("div",{onClick:s=>{s.target.closest("[data-aia-multi-done]")&&!a.skipDisabled&&et?.()},children:(0,K.jsx)("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-multi-done":"",className:Le.multiDone,ref:s=>{s&&(s.disabled=!0,s.offsetHeight,s.disabled=a.skipDisabled)},children:ee.done})}),je&&a.dateView&&(0,K.jsx)(Ut,{options:ke,activeIndex:a.activeIndex,listboxId:r,view:a.dateView,selection:{selectedIso:a.selectedDateIso??null,selectedRange:a.selectedDateRange??null,rangeStart:a.dateRangeStart??null,floor:(0,ce.dateFloorFor)(a.formatType,a.dateRangeStart)},onSelect:t,onHighlight:i,onUnhighlight:n,onPreviousMonth:ze??la,onNextMonth:Je??la}),it&&a.timeView&&(0,K.jsx)(na,{view:a.timeView,label:ee.timeLabel,doneLabel:ee.done,interactive:!a.skipDisabled,onTimeChange:_e??Va,onTimeCommit:Ue??Qa}),pt&&a.locationView&&(0,K.jsx)(jt,{view:a.locationView,searchLabel:ee.locationSearch,noResultsLabel:ee.locationNoResults,useTypedLabel:ee.locationUseTyped,widgetFocused:J&&pe,visible:pe,interactive:!a.skipDisabled,onQuery:C??Ya,onMove:S??ja,onCommit:I??$a,onFocusChange:D??Za}),ot&&(0,K.jsx)("div",{className:Le.skeletonBars,"data-aia-skeleton-bars":"",children:_a.map(s=>(0,K.jsx)("span",{className:Le.skeletonBar,style:{width:s}},`bar-${s}`))}),(0,K.jsx)(Jt,{products:nt,listboxId:r,onSelect:ne??Ua,onAddToCart:Z,onFocusChange:re,focusable:pe,layout:W,imageFallback:X,strings:ee}),(0,K.jsx)(Vt,{isOptionHighlighted:w,isInputEmpty:a.isInputEmpty,strings:ee})]}),(0,K.jsx)("button",{ref:Fe,type:"button",tabIndex:-1,className:Le.scrollArrow,"data-aia-scroll-arrow":"","aria-label":ee.scrollArrow,"aria-hidden":"true",children:(0,K.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,K.jsx)("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}var Me=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 {
3137
3262
  flex-shrink: 0;
3138
3263
  width: 32px;
3139
3264
  height: 32px;
@@ -3204,5 +3329,5 @@
3204
3329
  transition: none;
3205
3330
  }
3206
3331
  }
3207
- `,document.head.appendChild(e)}var da={submitButton:"aia-submitButton-otz7H"};var Pt=require("react/jsx-runtime");function pa({disabled:e,ready:o,onClick:t,label:i=(0,ca.uiStringsFor)().submit}){return(0,Pt.jsx)("button",{type:"button","data-aia-submit":"",className:da.submitButton,disabled:e,"data-aia-ready":o?"":void 0,onClick:n=>{n.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 Xe=require("@magicx-eng/ai-autocomplete-vanilla"),E=require("react");var Nt=require("react");function ha(e){let o=(0,Nt.useRef)(e);o.current=e;let t=Object.keys(e??{}).sort().join("\0"),i=(0,Nt.useRef)({key:"",overrides:void 0});if(i.current.key!==t){let n={};for(let l of Object.keys(e??{})){let r=(c,g,x)=>{let y=o.current?.[l];return y?y(c,g,x):[]};n[l]=r}i.current={key:t,overrides:e?n:void 0}}return{overrides:i.current.overrides,key:t}}var Ft=require("react");function ua(e){let o=(0,Ft.useRef)(e);o.current=e;let t=(0,Ft.useRef)(null);t.current===null&&(t.current={fetch:(n,l)=>{let r=o.current;return r?r.fetch(n,l):Promise.reject(new Error("products config removed"))},transform:n=>o.current?.transform(n)??[],get limit(){return o.current?.limit}});let i=e!==void 0;return{config:i?t.current:void 0,enabled:i}}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:o,onError:t,optionOverrides:i,maskCompletedText:n,apiConfig:l,additionalContext:r,language:c,currency:g,productId:x,visitorId:y,columns:m=2,dropdownTrigger:p,optionsPosition:h,closeDropdownOnBlur:v,prependPlaceholder:A,showNonTappableOptions:B,locationSearch:R,showOptionIcons:_,showOptionImages:$,showOptionCounts:O,showSkipButton:L,showProducts:k,productImageFallback:ne="image",onFocus:Z,onBlur:re,value:W,completedParams:X,onChange:T,onParamsChange:j,products:u,mapProducts:P,onProductSelect:qe,onProductAddToCart:ze,source:Je,setCursor:Ne}){let f=(0,E.useRef)(null),[et,_e]=(0,E.useState)(null),Ue=(0,E.useRef)(e);Ue.current=e;let b=(0,E.useRef)(o);b.current=o;let C=(0,E.useRef)(t);C.current=t;let S=(0,E.useRef)(T);S.current=T;let I=(0,E.useRef)(j);I.current=j;let D=(0,E.useRef)(Z);D.current=Z;let J=(0,E.useRef)(re);J.current=re;let be=(0,E.useRef)(Ne);be.current=Ne;let xe=(0,E.useRef)(qe);xe.current=qe;let ye=(0,E.useRef)(ze);ye.current=ze;let tt=(0,E.useRef)(y);tt.current=y;let ue=(0,E.useRef)(()=>{let s=tt.current;return typeof s=="function"?s():s}).current,Fe=ua(u),st=(0,E.useRef)(P);st.current=P;let ht=(0,E.useRef)((s,G)=>{let F=st.current;return F?F(s,G):s}).current,He=P?ht:void 0,at=ha(i);(0,E.useEffect)(()=>{if(typeof document>"u")return;let s=new Xe.AIAutocomplete(document.createElement("div"),{renderMode:"headless",apiConfig:l,additionalContext:r,language:c,currency:g,productId:x,visitorId:ue,optionOverrides:at.overrides,maskCompletedText:n,columns:m,dropdownTrigger:p,optionsPosition:h,closeDropdownOnBlur:v,prependPlaceholder:A,showNonTappableOptions:B,locationSearch:R,showProducts:k,source:Je,value:W,completedParams:X,onSubmit:(...F)=>Ue.current?.(...F),onResult:(...F)=>b.current?.(...F),onError:(...F)=>C.current?.(...F),onChange:(...F)=>S.current?.(...F),onParamsChange:(...F)=>I.current?.(...F),onFocus:()=>D.current?.(),onBlur:()=>J.current?.(),onProductSelect:F=>xe.current?.(F),onProductAddToCart:F=>ye.current?.(F),setCursor:F=>be.current?.(F),products:Fe.config,mapProducts:He});f.current=s,_e(s.getState());let G=s.subscribe(F=>_e(F));return()=>{G(),s.destroy(),f.current===s&&(f.current=null)}},[]),(0,E.useEffect)(()=>{W!==void 0&&f.current?.setValue(W)},[W]),(0,E.useEffect)(()=>{X!==void 0&&f.current?.setCompletedParams(X)},[X]);let lt=JSON.stringify(l??null),pe;try{pe=JSON.stringify(r??null)}catch{pe="[unstringifiable]"}(0,E.useEffect)(()=>{f.current?.update({apiConfig:l,additionalContext:r,language:c,currency:g,productId:x,optionOverrides:at.overrides,dropdownTrigger:p,optionsPosition:h,closeDropdownOnBlur:v,prependPlaceholder:A,showNonTappableOptions:B,locationSearch:R,showProducts:k})},[lt,pe,c,g?.code,g?.rate,g?.country,x,at.key,p,h,v,A,B,R,k]);let Ee=(0,E.useRef)(!1);(0,E.useEffect)(()=>{if(!Ee.current){Ee.current=!0;return}f.current?.update({products:Fe.config})},[Fe.enabled]),(0,E.useEffect)(()=>{f.current?.update({mapProducts:He})},[He]);let Be=(0,E.useRef)(null);Be.current===null&&(Be.current={handleTextChange:s=>f.current?.handleTextChange(s),handleKeyDown:s=>{let G="nativeEvent"in s?s.nativeEvent:s;f.current?.handleKeyDown(G)},setFocused:s=>f.current?.setFocused(s),startEditingParam:s=>f.current?.startEditingParam(s),exitEditMode:()=>f.current?.exitEditMode(),handleCaretAfterInput:s=>f.current?.handleCaretAfterInput(s),handleCaretMove:s=>f.current?.handleCaretMove(s),replaceEditingRange:s=>f.current?.replaceEditingRange(s)??!1,setActivePill:s=>f.current?.setActivePill(s),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:s=>f.current?.recordSubmit(s),selectOption:(s,G)=>f.current?.selectOption(s,G),selectProduct:s=>f.current?.selectProduct(s),addProductToCart:s=>{let G=f.current;return!G||!ye.current?Promise.resolve():G.addProductToCart(s)},setActiveDropdownIndex:s=>f.current?.setActiveDropdownIndex(s),clearHighlight:s=>f.current?.clearHighlight(s),showPreviousMonth:()=>f.current?.showPreviousMonth(),showNextMonth:()=>f.current?.showNextMonth(),setTime:s=>f.current?.setTime(s),commitTime:()=>f.current?.commitTime(),toggleMultiSelectOption:s=>f.current?.toggleMultiSelectOption(s),commitMultiSelect:()=>f.current?.commitMultiSelect(),setLocationQuery:s=>f.current?.setLocationQuery(s),moveLocationHighlight:s=>f.current?.moveLocationHighlight(s),commitLocation:s=>f.current?.commitLocation(s),setLocationFieldFocused:s=>f.current?.setLocationFieldFocused(s),handleFocus:()=>f.current?.setFocused(!0),handleBlur:()=>f.current?.setFocused(!1)});let a=Be.current,ee=(0,E.useCallback)(s=>{let G=s.target.value,vt=G.length>0&&!s.nativeEvent?.isComposing&&G[0]!==G[0].toUpperCase()?G[0].toUpperCase()+G.slice(1):G;f.current?.handleTextChange(vt)},[]),Ve=(0,E.useCallback)(s=>{f.current?.handleKeyDown(s.nativeEvent)},[]),ke=f.current,w=et??ma,We=W!==void 0?W:w.text,Qe=X!==void 0?X:w.completedParams,Ye=w.actionableSuggestions,ut=Ye[0],dt=(0,Xe.withoutTraditionalAutocomplete)(Ye),Ge=ke?.listboxId??"",ct=w.activeDropdownIndex>=0&&ke?`${Ge}-option-${w.activeDropdownIndex}`:void 0,Ce=w.editingParam,Ae=w.editingIdentified,je=Ce?{parameter:Ce.suggestionParameter,text:Ce.suggestionPlaceholder,required:!0,options:Ce.options}:Ae?{parameter:Ae.parameter,text:(0,Xe.identifiedParamLabel)(Ae.parameter),required:!0,options:[]}:null,it=w.dropdownSuggestion??je??ut,pt=je?[je]:Ye,ot=(0,Xe.dateSelectionFor)(w),nt=!ke||w.dropdownLoading;return{completedParams:Qe,multiSelectView:w.multiSelectView,toggleMultiSelectOption:a.toggleMultiSelectOption,commitMultiSelect:a.commitMultiSelect,skippedParams:w.skippedParams,identifiedParams:w.identifiedParams,suggestionPills:dt,setActivePill:a.setActivePill,skipActivePill:a.skipActivePill,removeLastParam:a.removeLastParam,segments:w.segments,newParamId:w.newParamId,clearNewParamId:a.clearNewParamId,suggestions:w.suggestions,activeIndex:w.activeDropdownIndex,isReady:w.isReady,isLoading:nt,isFocused:w.isFocused,isDropdownOpen:w.isDropdownOpen,isActivePillSelected:w.isActivePillSelected,placeholderText:w.placeholderText,listboxId:Ge,error:w.error,products:w.products,customFields:w.customFields,selectProduct:a.selectProduct,addProductToCart:a.addProductToCart,handleTextChange:a.handleTextChange,handleKeyDown:a.handleKeyDown,setFocused:a.setFocused,editingParam:Ce,editingIdentified:Ae,editingAnchor:w.editingAnchor,caretOffset:w.caretOffset,startEditingParam:a.startEditingParam,exitEditMode:a.exitEditMode,handleCaretAfterInput:a.handleCaretAfterInput,handleCaretMove:a.handleCaretMove,replaceEditingRange:a.replaceEditingRange,inputProps:{value:We,placeholder:w.placeholderText||void 0,onChange:ee,onKeyDown:Ve,onFocus:a.handleFocus,onBlur:a.handleBlur,role:"combobox","aria-expanded":w.isDropdownOpen,"aria-activedescendant":ct,"aria-autocomplete":"list","aria-controls":Ge},reset:a.reset,refreshProducts:a.refreshProducts,prepareSubmit:a.prepareSubmit,getState:a.getState,recordSubmit:a.recordSubmit,dropdownProps:{suggestions:it?[{...it,options:w.dropdownOptions}]:[],activeIndex:w.activeDropdownIndex,onSelect:a.selectOption,onHighlight:a.setActiveDropdownIndex,onUnhighlight:a.clearHighlight,isOpen:w.isDropdownOpen,id:Ge,pills:pt,activeSelected:w.isActivePillSelected,onPillClick:a.setActivePill,onSkip:a.skipActivePill,showSkipButton:(L??!0)&&!Ce&&!Ae,showOptionIcons:_??!0,showOptionImages:$??!0,showOptionCounts:O??!0,skipDisabled:w.inSelectionAnimation,isLoading:nt,skeletonExiting:w.skeletonExiting,isInputEmpty:We.trim().length===0,language:c,products:w.products,productImageFallback:ne,onProductSelect:a.selectProduct,onProductAddToCart:ze?a.addProductToCart:void 0,onProductFocusChange:a.setFocused,formatType:w.activeFormatType,dateView:w.dateView,selectedDateIso:ot.selectedIso,selectedDateRange:ot.selectedRange,dateRangeStart:ot.rangeStart,onPreviousMonth:a.showPreviousMonth,onNextMonth:a.showNextMonth,timeView:w.timeView,multiSelectView:w.multiSelectView,onMultiSelectCommit:a.commitMultiSelect,onTimeChange:a.setTime,onTimeCommit:a.commitTime,locationView:w.locationView,onLocationQuery:a.setLocationQuery,onLocationMove:a.moveLocationHighlight,onLocationCommit:a.commitLocation,onLocationFocusChange:a.setLocationFieldFocused,isFocused:w.isFocused||w.locationFieldFocused,optionsPosition:h??"below"}}}var oe=require("@magicx-eng/ai-autocomplete-vanilla"),M=require("react"),Et;function ti(){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:o,showChipIcons:t=!0,showChipImages:i=!0,newParamId:n,editingParam:l,editingIdentified:r,editingAnchor:c,caretOffset:g,placeholderText:x,isFocused:y,isDropdownOpen:m,listboxId:p,activeDescendantId:h,autoFocus:v,handleTextChange:A,handleKeyDown:B,handleCaretAfterInput:R,handleCaretMove:_,startEditingParam:$,replaceEditingRange:O,setFocused:L}=e,k=(0,M.useRef)(null),ne=(0,M.useRef)(!1),Z=(0,M.useRef)(""),re=(0,M.useRef)(""),W=(0,M.useRef)(null),X=(0,M.useRef)(0);W.current=g,(0,M.useEffect)(()=>{if(!v)return;let b=k.current;if(!b)return;document.activeElement===b?L(!0):b.focus();let C=b.ownerDocument??document,S=C.getSelection(),I=S&&S.rangeCount>0&&b.contains(S.anchorNode);if(S&&!I){let D=C.createRange();D.selectNodeContents(b),D.collapse(!0),S.removeAllRanges(),S.addRange(D)}},[v,L]),(0,M.useEffect)(()=>{let b=k.current;if(!b)return;let C=b.ownerDocument??document,S=()=>{let I=C.getSelection();if(!I||I.rangeCount===0||!I.anchorNode||!b.contains(I.anchorNode))return;let D=I.anchorNode,J=D.nodeType===Node.ELEMENT_NODE?D:D.parentElement,xe=(I.isCollapsed?J?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,ye=l?.id??r?.id??null;if(xe&&xe!==ye){$(xe);return}performance.now()-X.current<50||_((0,oe.getCursorOffset)(b))};return C.addEventListener("selectionchange",S),()=>C.removeEventListener("selectionchange",S)},[l,r,$,_]),(0,M.useEffect)(()=>{let b=k.current;if(!b)return;let C=S=>{let I=(0,oe.chipIdFromTap)(b,S.target);I&&($(I),(0,oe.keepCaretOnChip)(b,I))};return b.addEventListener("click",C),()=>b.removeEventListener("click",C)},[$]),(0,M.useLayoutEffect)(()=>{let b=k.current;b&&(0,oe.renderEditableContent)({input:b,segments:o,newParamId:n,editingParamId:l?.id??null,placeholderText:x??"",isFocused:y,showChipIcons:t,showChipImages:i})},[o,n,l,x,y,t,i]),(0,M.useLayoutEffect)(()=>{let b=Z.current,C=n??"";if(Z.current=C,!C||C===b)return;let S=k.current;if(!S)return;S.focus();let I=W.current??(0,oe.plainTextLength)(S);(0,oe.setCursorOffset)(S,I)},[n]),(0,M.useLayoutEffect)(()=>{let b=re.current,C=l?.id??"";if(re.current=C,!C||C===b||c==null)return;let S=k.current;S&&(0,oe.setCursorOffset)(S,c)},[l,c]);let T=(0,M.useCallback)(()=>{if(ne.current)return;let b=k.current;if(!b)return;let C=(0,oe.extractPlainText)(b),I=C.length>0&&C[0]!==C[0].toUpperCase()?C[0].toUpperCase()+C.slice(1):C;A(I)},[A]),j=(0,M.useCallback)(()=>{X.current=performance.now(),T();let b=k.current;b&&R((0,oe.getCursorOffset)(b))},[T,R]);(0,M.useEffect)(()=>{let b=k.current;if(!b)return;let C=S=>{let I=S,D=I.inputType;if(D==="insertParagraph"||D==="insertLineBreak"||D==="insertFromDrop"){S.preventDefault();return}if(D.startsWith("insert")||D.startsWith("delete")){let J=D.startsWith("delete")?"":I.data??"";O(J)&&S.preventDefault()}};return b.addEventListener("beforeinput",C),()=>b.removeEventListener("beforeinput",C)},[O]);let u=(0,M.useCallback)(()=>{ne.current=!0,k.current?.setAttribute("data-aia-composing","true")},[]),P=(0,M.useCallback)(()=>{ne.current=!1,k.current?.removeAttribute("data-aia-composing"),T()},[T]),qe=(0,M.useCallback)(b=>{b.preventDefault();let C=k.current;if(!C)return;let S=(b.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!S)return;let I=C.ownerDocument??document,D=I.getSelection();if(!D||D.rangeCount===0)return;let J=D.getRangeAt(0);if(!C.contains(J.startContainer))return;J.deleteContents();let be=I.createTextNode(S);J.insertNode(be),J.setStartAfter(be),J.collapse(!0),D.removeAllRanges(),D.addRange(J),T()},[T]),ze=(0,M.useCallback)(b=>B(b),[B]),Je=(0,M.useCallback)(()=>L(!0),[L]),Ne=(0,M.useCallback)(()=>L(!1),[L]),f=(0,M.useCallback)(()=>k.current?.focus(),[]),et=(0,M.useCallback)(()=>k.current?.blur(),[]),_e=(0,M.useCallback)(()=>{let b=k.current;return b?(0,oe.extractPlainText)(b):""},[]),Ue=ti()?"plaintext-only":"true";return{inputRef:k,editorProps:{ref:k,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:j,onKeyDown:ze,onCompositionStart:u,onCompositionEnd:P,onPaste:qe,onFocus:Je,onBlur:Ne},getPlainText:_e,focus:f,blur:et}}var Ie=require("react/jsx-runtime");function ai(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var fa=(0,q.forwardRef)(function({onSubmit:o,onResult:t,onError:i,optionOverrides:n,maskCompletedText:l,className:r,apiConfig:c,additionalContext:g,language:x,currency:y,productId:m,visitorId:p,columns:h,pillPlacement:v="dropdown",mode:A="auto",optionsPosition:B="below",animations:R=!0,dropdownTrigger:_,closeDropdownOnBlur:$,prependPlaceholder:O,showNonTappableOptions:L,locationSearch:k,showOptionIcons:ne=!0,showChipIcons:Z=!0,showChipImages:re=!0,showOptionImages:W=!0,showOptionCounts:X=!0,showSkipButton:T,showProducts:j,productsLayout:u,productImageFallback:P,autoFocus:qe=!0,onFocus:ze,onBlur:Je,value:Ne,completedParams:f,onChange:et,onParamsChange:_e,products:Ue,mapProducts:b,onProductSelect:C,onProductAddToCart:S,submitButton:I,resetOnSubmit:D=!0},J){let be=(0,q.useRef)(null),xe=(0,q.useRef)(null),ye=(0,q.useRef)(null),tt=(0,q.useRef)(()=>{}),ue=(0,q.useRef)(null),Fe=(0,q.useRef)(null);(0,q.useEffect)(()=>{let z=be.current;if(z)return ue.current?ue.current.setMode(A):ue.current=new Me.ModeController(z,A),()=>{ue.current?.destroy(),ue.current=null}},[A]);let st=(0,q.useCallback)(z=>{let me=Fe.current?.current;me&&(me.focus(),(0,Me.setCursorOffset)(me,z))},[]),{completedParams:ht,suggestionPills:He,setActivePill:at,skipActivePill:lt,segments:pe,newParamId:Ee,clearNewParamId:Be,placeholderText:a,isFocused:ee,isDropdownOpen:Ve,isActivePillSelected:ke,isLoading:w,isReady:We,activeIndex:Qe,listboxId:Ye,handleTextChange:ut,handleKeyDown:dt,setFocused:Ge,editingParam:ct,editingIdentified:Ce,editingAnchor:Ae,caretOffset:je,startEditingParam:it,handleCaretAfterInput:pt,handleCaretMove:ot,replaceEditingRange:nt,dropdownProps:s,reset:G,refreshProducts:F,prepareSubmit:vt,getState:Ht,recordSubmit:Bt}=It({onSubmit:z=>tt.current(z),onResult:t,onError:i,optionOverrides:n,maskCompletedText:l,apiConfig:c,additionalContext:g,language:x,currency:y,productId:m,visitorId:p,columns:h,dropdownTrigger:_,optionsPosition:B,closeDropdownOnBlur:$,prependPlaceholder:O,showNonTappableOptions:L,locationSearch:k,showOptionIcons:ne,showOptionImages:W,showOptionCounts:X,showSkipButton:T,showProducts:j,onFocus:ze,onBlur:Je,value:Ne,completedParams:f,onChange:et,onParamsChange:_e,products:Ue,mapProducts:b,onProductSelect:C,onProductAddToCart:S,source:"full-sdk",setCursor:st});(0,q.useEffect)(()=>{if(!Ee)return;let z=window.setTimeout(()=>Be(),650);return()=>window.clearTimeout(z)},[Ee,Be]);let ba=Qe>=0?`${Ye}-option-${Qe}`:void 0,{inputRef:At,editorProps:wa,focus:xt,blur:Wt,getPlainText:Gt}=ga({segments:pe,newParamId:Ee,editingParam:ct,editingIdentified:Ce,editingAnchor:Ae,caretOffset:je,placeholderText:a,isFocused:ee,showChipIcons:Z,showChipImages:re,isDropdownOpen:Ve,listboxId:Ye,activeDescendantId:ba,autoFocus:qe,handleTextChange:ut,handleKeyDown:dt,handleCaretAfterInput:pt,handleCaretMove:ot,startEditingParam:it,replaceEditingRange:nt,setFocused:Ge});Fe.current=At,(0,q.useLayoutEffect)(()=>{let z=xe.current,me=At.current;if(!z||!me)return;let gt=()=>{let qt=z.firstElementChild;if(!qt)return;let ka=qt.getBoundingClientRect(),Ca=me.getBoundingClientRect();ka.top>=Ca.bottom-2?z.setAttribute("data-aia-pill-wrapped",""):z.removeAttribute("data-aia-pill-wrapped")};gt();let Kt=new ResizeObserver(gt);return Kt.observe(me),()=>Kt.disconnect()},[pe,He.length,w,At]),(0,q.useEffect)(()=>{let z=ye.current;if(z)return(0,Me.watchEditorHeight)(z)},[]),(0,q.useImperativeHandle)(J,()=>({focus:xt,blur:Wt,reset:G,refreshProducts:F,setMode:z=>ue.current?.setMode(z),skipActivePill:lt}),[xt,Wt,G,F,lt]);let mt=!!pe.length||ht.length>0,Lt=(0,q.useCallback)(z=>{if(!mt)return;z&&vt();let me=Ht(),gt=(0,Me.buildSubmitResult)(Gt(),me.completedParams,me.skippedParams,{identifiedParams:me.identifiedParams,isReady:me.isReady,customFields:me.customFields});z&&Bt(gt),o(gt),D&&G()},[Bt,D,mt,vt,Ht,o,G,Gt]);tt.current=()=>Lt(!1);let va=(0,q.useCallback)(z=>{z.target?.closest("[data-aia-pill]")||document.activeElement?.closest("[data-aia-location]")||xt()},[xt]),xa=v==="inline",ya=v==="dropdown";return(0,Ie.jsxs)("div",{ref:be,className:`magicx-aia ${rt.container} ${r??""}`,"data-pill-placement":v,"data-options-position":B,"data-animations":R?"on":"off","data-mode":ai(A),children:[(0,Ie.jsx)(Tt,{...s,showPills:ya,productsLayout:u,productImageFallback:P}),(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&&(w||He.length>0)&&(0,Ie.jsx)("span",{ref:xe,className:rt.pillListContainer,"data-aia-pill-list-container":"",children:(0,Ie.jsx)(Ct,{pills:He,activePillIndex:0,activeSelected:ke,onSelectPill:at,loading:w})})]}),I===null?null:I===void 0?(0,Ie.jsx)(pa,{disabled:!mt,ready:mt&&We,onClick:()=>Lt(!0),label:(0,Me.uiStringsFor)(x).submit}):(0,Ie.jsx)("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:rt.submitSlot,onClick:z=>{mt&&(z.stopPropagation(),Lt(!0))},children:I})]})]})});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});
3208
3333
  //# sourceMappingURL=index.js.map