@magicx-eng/ai-autocomplete-react 0.49.2 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/REFERENCE.md +21 -17
- package/dist/index.d.mts +10 -7
- package/dist/index.d.ts +10 -7
- package/dist/index.js +273 -155
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +273 -155
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{buildSubmitResult as
|
|
1
|
+
import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END as Jr,DATE_RANGE_META_START as es,DEFAULT_OPTION_COUNT_UNIT as ts,dateCellMarks as as,formatDate as is,formatDateRange as os,formatOptionCount as ns,formatPlace as rs,formatTime as ss,isoDate as ls,LOCATION_META_KEY as ds,monthLabel as cs,optionCountLabel as ps,optionHasImage as hs,optionImageSources as us,optionImageSrc as ms,optionLabel as gs,optionsShowLeadingVisuals as fs,PRODUCT_PATH_PREFIX as bs,parseDate as ws,parseLooseDate as vs,parseLooseDateRange as xs,parseTime as ys,productFromMatchedItem as ks,productImageSources as Cs,productsFromCustomFields as Ss,sanitizeOptionIconSvg as Ts,selectedRangeFor as Ps,TIME_META_KEY as Is,visibleDateRange as Es,WEEKDAY_LABELS as As,withSkippedParams as Ls}from"@magicx-eng/ai-autocomplete-vanilla";import{forwardRef as Mo,useCallback as Dt,useEffect as Mt,useImperativeHandle as zo,useLayoutEffect as No,useRef as Xe}from"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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
346
346
|
transition: none;
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
`,document.head.appendChild(e)}var
|
|
349
|
+
`,document.head.appendChild(e)}var We={container:"aia-container-KKjFU",inputWrapper:"aia-inputWrapper-FLq1b",editorArea:"aia-editorArea-7rBWq",input:"aia-input-IW-P-",pillListContainer:"aia-pillListContainer-h92IA",submitSlot:"aia-submitSlot-GhuCM",aiaChipForm:"aia-aiaChipForm-tKbNc",aiaTileGrow:"aia-aiaTileGrow-j9Pat",aiaTileSpring:"aia-aiaTileSpring-FEwNg",aiaTileFade:"aia-aiaTileFade-H1LDQ",aiaImageGrow:"aia-aiaImageGrow-i9yw8"};import{attachScrollArrow as ji,attachViewportFit as $i,containScroll as Zi,dateFloorFor as Xi,destroyPanelMorph as Ji,findMultiSelectDone as eo,fitMultiSelectDone as to,hasSkippablePill as ao,isCalendarFormat as io,labelTraditionalAutocomplete as oo,panelMorphKey as no,queryLive as ro,settlePanelMorph as so,uiStringsFor as lo}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Ge,useLayoutEffect as Et,useRef as je,useState as co}from"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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
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:
|
|
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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
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:
|
|
564
|
+
--aia-option-font-size: 11.2px;
|
|
565
565
|
|
|
566
566
|
--aia-written-text-color: var(--aia-primitive-neutral-0);
|
|
567
|
-
/*
|
|
568
|
-
|
|
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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
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:
|
|
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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
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:
|
|
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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
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,
|
|
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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
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,
|
|
943
|
-
max-height: min(var(--aia-grid-max-height,
|
|
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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
968
1057
|
z-index: 10;
|
|
969
1058
|
opacity: 0;
|
|
970
1059
|
pointer-events: none;
|
|
971
|
-
/* Closed, the panel rests
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
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
|
|
981
|
-
|
|
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
|
-
|
|
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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
1017
1117
|
backdrop-filter: blur(30px);
|
|
1018
1118
|
}
|
|
1019
1119
|
|
|
1020
|
-
/* Opening: the panel
|
|
1021
|
-
|
|
1022
|
-
|
|
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
|
-
|
|
1028
|
-
|
|
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
|
|
1033
|
-
|
|
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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
1175
1274
|
align-items: center;
|
|
1176
1275
|
margin-inline-start: auto;
|
|
1177
1276
|
flex-shrink: 0;
|
|
1178
|
-
padding: 5px
|
|
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:
|
|
1281
|
+
border-radius: 4.2px;
|
|
1183
1282
|
background: transparent;
|
|
1184
1283
|
font-family: inherit;
|
|
1185
|
-
font-size: var(--aia-skip-font-size,
|
|
1186
|
-
line-height:
|
|
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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
1266
1365
|
display: none;
|
|
1267
1366
|
}
|
|
1268
1367
|
|
|
1269
|
-
/* The multi-select Done button: the time wheel's Done, full width
|
|
1368
|
+
/* The multi-select Done button: the time wheel's Done, full width. */
|
|
1270
1369
|
.aia-multiDone-y12U7 {
|
|
1271
1370
|
display: block;
|
|
1272
|
-
|
|
1273
|
-
|
|
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:
|
|
1277
|
-
background: var(--aia-multi-done-bg, var(--aia-
|
|
1278
|
-
color: var(--aia-multi-done-color, var(--aia-
|
|
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:
|
|
1281
|
-
font-weight:
|
|
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-
|
|
1391
|
+
background: var(--aia-multi-done-bg-hover, var(--aia-done-bg-hover, #d8dde8));
|
|
1289
1392
|
}
|
|
1290
|
-
|
|
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;
|
|
1404
|
+
}
|
|
1405
|
+
`,document.head.appendChild(e)}var me={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"};import{cellDay as Oa,cellIso as ot,dateCellMarks as Ra,isDimmedDay as Da,isoDate as Ma,monthLabel as za,visibleDateRange as Na,WEEKDAY_LABELS as Fa}from"@magicx-eng/ai-autocomplete-vanilla";import{useState as Ha}from"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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
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
|
|
1592
|
+
`,document.head.appendChild(e)}var H={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"};import{jsx as ge,jsxs as Gt}from"react/jsx-runtime";var Ba=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function qt({options:e,activeIndex:o,listboxId:a,view:i,selection:n,onSelect:s,onHighlight:r,onUnhighlight:l,onPreviousMonth:m,onNextMonth:b}){let x=Ma(new Date),u=Na({pendingStart:n.rangeStart,highlightedIso:ot(e[o]),selected:n.selectedRange,floor:n.floor});return Gt("div",{className:H.datepicker,"data-aia-datepicker":"",children:[Gt("div",{className:H.header,children:[ge("button",{type:"button",tabIndex:-1,className:H.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:c=>c.preventDefault(),onClick:m,children:"\u2039"}),ge("span",{className:H.month,"data-aia-date-month":"","aria-live":"polite",children:za(i)}),ge("button",{type:"button",tabIndex:-1,className:H.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:c=>c.preventDefault(),onClick:b,children:"\u203A"})]}),ge("div",{className:H.weekdays,"aria-hidden":"true",children:Fa.map((c,p)=>ge("span",{className:H.weekday,children:c},Ba[p]))}),ge("div",{className:H.grid,"data-aia-date-grid":"",children:e.map((c,p)=>ge(Wa,{option:c,id:`${a}-option-${p}`,index:p,isHighlighted:p===o&&c.is_tappable,isToday:ot(c)===x,isPast:Da(ot(c),x,n.floor),marks:Ra(ot(c),{selectedIso:n.selectedIso,range:u}),onSelect:s,onHighlight:r,onUnhighlight:l},ot(c)??`pad-${p}`))})]})}function Wa({option:e,id:o,index:a,isHighlighted:i,isToday:n,isPast:s,marks:r,onSelect:l,onHighlight:m,onUnhighlight:b}){let[x,u]=Ha(!1),c=Oa(e);if(c==null)return ge("div",{id:o,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${H.cell} ${H.blank}`});let p=()=>{u(!0),l(e),setTimeout(()=>u(!1),170)},v=[H.cell,H.day,s?H.past:"",i?H.highlighted:"",n?H.today:"",r.inRange?H.inRange:"",r.selected?H.selected:"",x?H.pressed:""].filter(Boolean).join(" ");return ge("div",{id:o,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":i,"aria-label":e.text,tabIndex:0,className:v,onClick:p,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),p())},onMouseEnter:()=>m(a),onMouseLeave:b?()=>b(a):void 0,children:ge("span",{className:H.number,children:c})})}import{ATTRIBUTION_URL as Ka,buildAttributionUrl as Ga,getFooterHint as qa,uiStringsFor as _a}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Va,useState as Ua}from"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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
1514
1629
|
.aia-cluster[data-justify="around"] {
|
|
1515
1630
|
justify-content: space-around;
|
|
1516
1631
|
}
|
|
1517
|
-
`,document.head.appendChild(e)}import{jsx as
|
|
1632
|
+
`,document.head.appendChild(e)}import{jsx as _t}from"react/jsx-runtime";function nt({gap:e,align:o="center",justify:a="start",noWrap:i=!1,inline:n=!1,className:s,children:r,...l}){let m=e?{"--aia-cluster-gap":e}:void 0,b={className:s?`aia-cluster ${s}`:"aia-cluster","data-align":o,"data-justify":a,"data-nowrap":i||void 0,"data-inline":n||void 0,style:m,...l};return n?_t("span",{...b,children:r}):_t("div",{...b,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 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
1661
1776
|
justify-content: flex-end;
|
|
1662
1777
|
}
|
|
1663
1778
|
}
|
|
1664
|
-
`,document.head.appendChild(e)}var Se={footer:"aia-footer-qQQ7x",row:"aia-row-BgZ6Q",hintGroup:"aia-hintGroup-ZzbPf",brandLink:"aia-brandLink-r4f3R",key:"aia-key-Bz1H-",hint:"aia-hint-GKEOH",brand:"aia-brand-Al-lR",badge:"aia-badge-Fk9vg"};import{jsx as
|
|
1779
|
+
`,document.head.appendChild(e)}var Se={footer:"aia-footer-qQQ7x",row:"aia-row-BgZ6Q",hintGroup:"aia-hintGroup-ZzbPf",brandLink:"aia-brandLink-r4f3R",key:"aia-key-Bz1H-",hint:"aia-hint-GKEOH",brand:"aia-brand-Al-lR",badge:"aia-badge-Fk9vg"};import{jsx as rt,jsxs as xt}from"react/jsx-runtime";function Vt({isOptionHighlighted:e=!1,isInputEmpty:o=!1,strings:a=_a()}){let{key:i,hint:n}=qa(e,o,a),[s,r]=Ua(Ka);return Va(()=>{r(Ga())},[]),rt("footer",{className:Se.footer,"data-aia-footer":"",children:xt(nt,{justify:"between",noWrap:!0,className:Se.row,children:[xt(nt,{gap:"5px",className:Se.hintGroup,children:[rt("kbd",{className:Se.key,children:i}),rt("span",{className:Se.hint,children:n})]}),xt("a",{className:Se.brandLink,href:s,target:"_blank",rel:"noopener noreferrer",children:[rt("span",{className:Se.brand,children:"AI"}),rt("span",{className:Se.badge,children:"Autocomplete"})]})]})})}import{useEffect as Ut,useLayoutEffect as Qa,useRef as le}from"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 {
|
|
@@ -1788,7 +1903,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
1788
1903
|
.aia-loadingBar-OLCr4:nth-child(3) {
|
|
1789
1904
|
width: 60%;
|
|
1790
1905
|
}
|
|
1791
|
-
`,document.head.appendChild(e)}var
|
|
1906
|
+
`,document.head.appendChild(e)}var B={location:"aia-location-6-fsr",field:"aia-field-xEzwi",icon:"aia-icon-czx6C",input:"aia-input-Yi9V-",results:"aia-results-C3O0V",row:"aia-row-Q9y8g",highlighted:"aia-highlighted-RJjPx",pin:"aia-pin-OjabL",text:"aia-text-Xs84O",name:"aia-name-Z-WJR",secondary:"aia-secondary-4sCT1",note:"aia-note-xCSvY",empty:"aia-empty-SYBzi",loading:"aia-loading-Ih1gi",loadingBar:"aia-loadingBar-OLCr4"};import{jsx as ie,jsxs as Re}from"react/jsx-runtime";var Ya=0;function st(e){return e.getRootNode().activeElement??null}function Yt(e){return e.getRootNode().getSelection?.()??document.getSelection()}function ja(e){if(!e.isContentEditable)return null;let o=Yt(e);if(!o||o.rangeCount===0)return null;let a=o.getRangeAt(0);return e.contains(a.startContainer)?a.cloneRange():null}function Qt(e,o){if(e.focus({preventScroll:!0}),!e.isContentEditable)return;let a=Yt(e);if(!a)return;let i=o;(!i||!i.startContainer.isConnected||!e.contains(i.startContainer))&&(i=document.createRange(),i.selectNodeContents(e),i.collapse(!1)),a.removeAllRanges(),a.addRange(i)}var $a=Re("svg",{className:B.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[ie("path",{d:"M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z"}),ie("circle",{cx:"12",cy:"9.5",r:"2.5"})]}),Za=Re("svg",{className:B.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[ie("circle",{cx:"11",cy:"11",r:"7"}),ie("path",{d:"m20 20-3.5-3.5"})]});function jt({view:e,searchLabel:o,noResultsLabel:a,useTypedLabel:i,widgetFocused:n,visible:s=!0,interactive:r=!0,onQuery:l,onMove:m,onCommit:b,onFocusChange:x}){let u=le(null),c=le(null),p=le(null),v=le(null),A=le(null),N=le(!1),L=le(!1),F=le(!1),G=le(n);G.current=n;let O=le(x);O.current=x;let E=h=>{F.current=h,x(h)},k=()=>{let h=u.current;return h!=null&&st(h)===h},X=()=>{let h=c.current;if(!h)return;let P=st(h);P instanceof HTMLElement&&P!==u.current&&P!==document.body&&!h.contains(P)&&(v.current=P,A.current=ja(P))},_=le(null);_.current===null&&(_.current=`aia-location-${++Ya}`);let J=`${_.current}-row-`;Ut(()=>{let h=u.current;h&&h.value!==e.query&&st(h)!==h&&(h.value=e.query)},[e.query]),Ut(()=>{let h=u.current;if(h){if(!s&&k()){L.current=!0,z();return}if(!n){setTimeout(()=>{if(G.current)return;let P=v.current;P&&st(P)===P||(L.current=!1)},0);return}if(!(L.current||!r||k())){if(X(),E(!0),h.focus({preventScroll:!0}),!k()){L.current=!0,E(!1);return}h.value&&h.select()}}}),Qa(()=>()=>{if(!F.current)return;let h=u.current,P=v.current;P?.isConnected&&h&&st(h)===h&&(N.current=!0,Qt(P,A.current),N.current=!1),F.current=!1,O.current(!1)},[]);let z=(h=!1)=>{h&&(L.current=!0);let P=v.current;P?.isConnected&&k()&&(N.current=!0,Qt(P,A.current),N.current=!1),E(!1)},V=e.query.trim(),T=e.highlighted>=0&&e.highlighted<e.places.length?`${J}${e.highlighted}`:void 0,K=null;return e.places.length>0?K=e.places.map((h,P)=>Re("div",{id:`${J}${P}`,role:"option","aria-selected":P===e.highlighted,className:P===e.highlighted?`${B.row} ${B.highlighted}`:B.row,"data-aia-location-row":"","data-aia-index":P,onClick:()=>{r&&(z(!0),b(P))},children:[ie("span",{className:B.pin,children:$a}),Re("span",{className:B.text,children:[ie("span",{className:B.name,children:h.name}),h.secondary&&ie("span",{className:B.secondary,children:h.secondary})]})]},h.id)):e.status==="loading"?K=Re("div",{className:B.loading,"data-aia-location-loading":"",children:[ie("span",{className:B.loadingBar}),ie("span",{className:B.loadingBar}),ie("span",{className:B.loadingBar})]}):V&&(K=Re("div",{className:B.note,"data-aia-location-note":"",children:[e.status==="done"&&ie("span",{className:B.empty,children:a}),ie("span",{children:i})]})),Re("div",{ref:c,className:B.location,"data-aia-location":"",onMouseDown:h=>{!(h.target instanceof Node)||!p.current?.contains(h.target)||(h.stopPropagation(),X(),E(!0))},children:[Re("label",{ref:p,className:B.field,children:[Za,ie("input",{ref:u,type:"text",className:B.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:s?0:-1,onChange:h=>l(h.target.value),onFocus:()=>E(!0),onBlur:()=>{N.current||(L.current=!0,E(!1))},onKeyDown:h=>{if(!h.nativeEvent.isComposing)switch(h.key){case"ArrowDown":case"ArrowUp":h.preventDefault(),m(h.key==="ArrowDown"?1:-1);return;case"Enter":if(h.preventDefault(),!r)return;z(!0),b();return;case"Escape":h.preventDefault(),h.stopPropagation(),L.current=!0,z();return;case"Backspace":if(h.currentTarget.value!=="")return;h.preventDefault(),L.current=!0,z();return}}})]}),ie("div",{className:B.results,"data-aia-location-results":"","aria-live":"polite",children:K})]})}import{isSmartSuggestion as ti,isTraditionalAutocompleteSuggestion as ai}from"@magicx-eng/ai-autocomplete-vanilla";import{SMART_SUGGESTION_SPARKLE_SVG as Xa}from"@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
1907
|
no outline. ~28px via 6px padding + 14px text + the 1px border (border-box).
|
|
1793
1908
|
The border is kept as a 1px transparent line so the box stays the same size
|
|
1794
1909
|
as it was when the outline was dashed. */
|
|
@@ -1811,6 +1926,9 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
1811
1926
|
letter-spacing: 0.06em;
|
|
1812
1927
|
cursor: pointer;
|
|
1813
1928
|
white-space: nowrap;
|
|
1929
|
+
/* The positional opacity ramp, set inline per pill as a custom property so
|
|
1930
|
+
a rule can read the live label at full strength without !important. */
|
|
1931
|
+
opacity: var(--aia-pill-opacity, 1);
|
|
1814
1932
|
animation: aia-fadeIn-Ux4eQ 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
|
|
1815
1933
|
}
|
|
1816
1934
|
|
|
@@ -1968,7 +2086,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
1968
2086
|
opacity: 0;
|
|
1969
2087
|
}
|
|
1970
2088
|
}
|
|
1971
|
-
`,document.head.appendChild(e)}var
|
|
2089
|
+
`,document.head.appendChild(e)}var fe={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"};import{Fragment as Ja,jsx as yt,jsxs as ei}from"react/jsx-runtime";var kt={selected:1,first:.7,next:.4,last:.2};function $t({label:e,state:o,active:a,rounded:i,loading:n,smartSuggestion:s,completionHeader:r,onClick:l}){let m=[fe.pill,i?fe.rounded:"",n?fe.skeleton:""].filter(Boolean).join(" ");return yt("button",{type:"button","data-aia-pill":"","data-aia-pill-active":a?"":void 0,"data-aia-loading":n?"":void 0,"data-aia-smart-suggestion":s?r?"header":"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:m,style:{"--aia-pill-opacity":kt[o]},onMouseDown:b=>b.preventDefault(),onClick:n?void 0:l,disabled:n,children:s?ei(Ja,{children:[yt("span",{className:`${fe.smartText} magicx-aia-smart-suggestion-text`,children:e}),yt("span",{className:`${fe.smartSparkle} magicx-aia-smart-suggestion-sparkle`,dangerouslySetInnerHTML:{__html:Xa}})]}):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
2090
|
position: relative;
|
|
1973
2091
|
z-index: 1;
|
|
1974
2092
|
pointer-events: auto;
|
|
@@ -1978,7 +2096,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
1978
2096
|
align-items: center;
|
|
1979
2097
|
vertical-align: middle;
|
|
1980
2098
|
}
|
|
1981
|
-
`,document.head.appendChild(e)}var
|
|
2099
|
+
`,document.head.appendChild(e)}var Ct={list:"aia-list-qvLqO"};import{jsx as ct}from"react/jsx-runtime";var ii=[125,69];function Zt(e){return e===0?"first":e===1?"next":"last"}function pt({pills:e,activePillIndex:o,onSelectPill:a,activeSelected:i,rounded:n,loading:s}){return s&&e.length===0?ct("span",{className:Ct.list,"data-aia-pill-list-loading":"",children:ii.map((r,l)=>ct("span",{"data-aia-pill-skeleton":"",className:`${fe.pill} ${n?fe.rounded:""} ${fe.skeleton}`,style:{width:r,"--aia-pill-opacity":kt[Zt(l)]}},`skel-${r}`))}):ct("span",{className:Ct.list,"data-aia-pill-list-loading":s?"":void 0,children:e.map((r,l)=>{let m=!!i&&l===o;return ct($t,{label:r.text,state:m?"selected":Zt(l),selected:m,active:l===o,rounded:n,loading:s,smartSuggestion:ti(r),completionHeader:ai(r),onClick:()=>a(l)},`${r.parameter}-${r.text}`)})})}import{attachProductRowWheel as oi,productImageSources as ni,productImageSrc as ri,productInitial as si,productPhotoFill as li,uiStringsFor as di}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as St,useRef as ht,useState as ut}from"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
2100
|
(packages/vanilla/src/styles.css). Same tokens, same defaults, so a consumer
|
|
1983
2101
|
theming one package sees the same result in the other.
|
|
1984
2102
|
|
|
@@ -1991,7 +2109,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
1991
2109
|
.aia-section-Hugfg {
|
|
1992
2110
|
display: flex;
|
|
1993
2111
|
flex-direction: column;
|
|
1994
|
-
gap:
|
|
2112
|
+
gap: 4.2px;
|
|
1995
2113
|
/* The option text sits 10px inside the dropdown's padding edge (the
|
|
1996
2114
|
option's own padding), so the section carries the same 10px and its
|
|
1997
2115
|
label lands on the option text's left edge \u2014 which the dropdown in turn
|
|
@@ -2002,9 +2120,9 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2002
2120
|
|
|
2003
2121
|
.aia-label-nuc93 {
|
|
2004
2122
|
font-family: inherit;
|
|
2005
|
-
font-size: var(--aia-products-label-font-size,
|
|
2123
|
+
font-size: var(--aia-products-label-font-size, 7.7px);
|
|
2006
2124
|
font-weight: 500;
|
|
2007
|
-
line-height:
|
|
2125
|
+
line-height: 12.6px;
|
|
2008
2126
|
letter-spacing: 0.02em;
|
|
2009
2127
|
color: var(
|
|
2010
2128
|
--aia-products-label-color,
|
|
@@ -2018,16 +2136,16 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2018
2136
|
a trackpad fling at either end from chaining out to the page. */
|
|
2019
2137
|
.aia-row-WDVBX {
|
|
2020
2138
|
display: flex;
|
|
2021
|
-
gap: var(--aia-product-gap,
|
|
2139
|
+
gap: var(--aia-product-gap, 5.6px);
|
|
2022
2140
|
min-width: 0;
|
|
2023
2141
|
overflow-x: auto;
|
|
2024
2142
|
overflow-y: hidden;
|
|
2025
2143
|
overscroll-behavior-x: contain;
|
|
2026
|
-
padding-bottom:
|
|
2144
|
+
padding-bottom: 1.4px;
|
|
2027
2145
|
/* Pull the row out by the card's own 6px padding so the first card's
|
|
2028
2146
|
image tile \u2014 not its hover fill \u2014 starts on the label's left edge, the
|
|
2029
2147
|
same way the option's highlight fill hangs outside its text. */
|
|
2030
|
-
margin-inline: -
|
|
2148
|
+
margin-inline: -4.2px;
|
|
2031
2149
|
/* Hide the scrollbar chrome across all three engines while leaving the box
|
|
2032
2150
|
scrollable by trackpad, touch and keyboard. A mouse wheel is vertical and
|
|
2033
2151
|
would otherwise have no way through a row with no scrollbar to grab, so
|
|
@@ -2045,10 +2163,10 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2045
2163
|
flex: 0 0 auto;
|
|
2046
2164
|
display: flex;
|
|
2047
2165
|
flex-direction: column;
|
|
2048
|
-
gap:
|
|
2049
|
-
width: var(--aia-product-card-width,
|
|
2050
|
-
padding:
|
|
2051
|
-
border-radius:
|
|
2166
|
+
gap: 4.2px;
|
|
2167
|
+
width: var(--aia-product-card-width, 81.2px);
|
|
2168
|
+
padding: 4.2px;
|
|
2169
|
+
border-radius: 7px;
|
|
2052
2170
|
background: var(--aia-product-bg, transparent);
|
|
2053
2171
|
/* Explicit, never inherited \u2014 see the file header. */
|
|
2054
2172
|
color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
|
|
@@ -2081,7 +2199,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2081
2199
|
position: relative;
|
|
2082
2200
|
width: 100%;
|
|
2083
2201
|
aspect-ratio: 1 / 1;
|
|
2084
|
-
border-radius:
|
|
2202
|
+
border-radius: 5.6px;
|
|
2085
2203
|
overflow: hidden;
|
|
2086
2204
|
background: var(--aia-product-media-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.25)));
|
|
2087
2205
|
}
|
|
@@ -2106,7 +2224,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2106
2224
|
max-width: 100%;
|
|
2107
2225
|
height: 100%;
|
|
2108
2226
|
margin: 0 auto;
|
|
2109
|
-
border-radius: var(--aia-product-image-radius,
|
|
2227
|
+
border-radius: var(--aia-product-image-radius, 5.6px);
|
|
2110
2228
|
object-fit: contain;
|
|
2111
2229
|
}
|
|
2112
2230
|
|
|
@@ -2119,7 +2237,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2119
2237
|
align-items: center;
|
|
2120
2238
|
justify-content: center;
|
|
2121
2239
|
color: var(--aia-product-title-color, var(--aia-option-color-selected, currentColor));
|
|
2122
|
-
font-size:
|
|
2240
|
+
font-size: 16.8px;
|
|
2123
2241
|
font-weight: 600;
|
|
2124
2242
|
line-height: 1;
|
|
2125
2243
|
}
|
|
@@ -2142,14 +2260,14 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2142
2260
|
.aia-body-ly032 {
|
|
2143
2261
|
display: flex;
|
|
2144
2262
|
flex-direction: column;
|
|
2145
|
-
gap:
|
|
2263
|
+
gap: 1.4px;
|
|
2146
2264
|
min-width: 0;
|
|
2147
2265
|
}
|
|
2148
2266
|
|
|
2149
2267
|
.aia-vendor-Gvu7G {
|
|
2150
2268
|
font-family: inherit;
|
|
2151
|
-
font-size: var(--aia-product-vendor-font-size,
|
|
2152
|
-
line-height:
|
|
2269
|
+
font-size: var(--aia-product-vendor-font-size, 7px);
|
|
2270
|
+
line-height: 9.8px;
|
|
2153
2271
|
color: var(
|
|
2154
2272
|
--aia-product-vendor-color,
|
|
2155
2273
|
var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb))
|
|
@@ -2163,9 +2281,9 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2163
2281
|
|
|
2164
2282
|
.aia-title-gCNmq {
|
|
2165
2283
|
font-family: inherit;
|
|
2166
|
-
font-size: var(--aia-product-title-font-size,
|
|
2284
|
+
font-size: var(--aia-product-title-font-size, 8.4px);
|
|
2167
2285
|
font-weight: 400;
|
|
2168
|
-
line-height:
|
|
2286
|
+
line-height: 11.2px;
|
|
2169
2287
|
/* The card's most prominent text uses the same token the *highlighted*
|
|
2170
2288
|
option text does, so it stays legible on any --aia-surface a consumer
|
|
2171
2289
|
sets \u2014 light or dark \u2014 without a second theming control. */
|
|
@@ -2182,9 +2300,9 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2182
2300
|
|
|
2183
2301
|
.aia-price-gULcE {
|
|
2184
2302
|
font-family: inherit;
|
|
2185
|
-
font-size: var(--aia-product-price-font-size,
|
|
2303
|
+
font-size: var(--aia-product-price-font-size, 7.7px);
|
|
2186
2304
|
font-weight: 500;
|
|
2187
|
-
line-height:
|
|
2305
|
+
line-height: 10.5px;
|
|
2188
2306
|
color: var(
|
|
2189
2307
|
--aia-product-price-color,
|
|
2190
2308
|
var(--aia-option-color-selected, var(--aia-color-text-default, #fff))
|
|
@@ -2195,7 +2313,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2195
2313
|
display: flex;
|
|
2196
2314
|
flex-wrap: wrap;
|
|
2197
2315
|
align-items: baseline;
|
|
2198
|
-
column-gap:
|
|
2316
|
+
column-gap: 2.8px;
|
|
2199
2317
|
}
|
|
2200
2318
|
|
|
2201
2319
|
/* The price before a markdown, struck through after the price, on the same
|
|
@@ -2213,10 +2331,10 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2213
2331
|
reads on any photo, light or dark, and on either panel surface. */
|
|
2214
2332
|
.aia-badge-j9Hcd {
|
|
2215
2333
|
position: absolute;
|
|
2216
|
-
top: var(--aia-product-badge-inset,
|
|
2217
|
-
left: var(--aia-product-badge-inset,
|
|
2218
|
-
padding:
|
|
2219
|
-
border-radius:
|
|
2334
|
+
top: var(--aia-product-badge-inset, 8.4px);
|
|
2335
|
+
left: var(--aia-product-badge-inset, 8.4px);
|
|
2336
|
+
padding: 2.1px 4.2px;
|
|
2337
|
+
border-radius: 2.8px;
|
|
2220
2338
|
background: var(--aia-product-badge-bg, rgba(255, 255, 255, 0.94));
|
|
2221
2339
|
color: var(--aia-product-badge-color, #1f2328);
|
|
2222
2340
|
/* A hairline ring keeps the chip's edge on a pale image or a light panel. */
|
|
@@ -2224,7 +2342,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2224
2342
|
0 0 0 1px rgba(0, 0, 0, 0.08),
|
|
2225
2343
|
0 1px 2px rgba(0, 0, 0, 0.18);
|
|
2226
2344
|
font-family: inherit;
|
|
2227
|
-
font-size: var(--aia-product-badge-font-size,
|
|
2345
|
+
font-size: var(--aia-product-badge-font-size, 6.3px);
|
|
2228
2346
|
font-weight: 600;
|
|
2229
2347
|
line-height: 1;
|
|
2230
2348
|
letter-spacing: 0.08em;
|
|
@@ -2246,24 +2364,24 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2246
2364
|
fill the square (--aia-product-photo-fill-x / -y, set on the card when
|
|
2247
2365
|
the photo loads; 1, the tile's own corner, until then). */
|
|
2248
2366
|
top: calc(
|
|
2249
|
-
var(--aia-product-card-width,
|
|
2250
|
-
|
|
2251
|
-
var(--aia-product-cart-size,
|
|
2252
|
-
(var(--aia-product-card-width,
|
|
2367
|
+
var(--aia-product-card-width, 81.2px) -
|
|
2368
|
+
8.4px -
|
|
2369
|
+
var(--aia-product-cart-size, 19.6px) -
|
|
2370
|
+
(var(--aia-product-card-width, 81.2px) - 8.4px) *
|
|
2253
2371
|
(1 - var(--aia-product-photo-fill-y, 1)) /
|
|
2254
2372
|
2
|
|
2255
2373
|
);
|
|
2256
2374
|
right: calc(
|
|
2257
|
-
|
|
2258
|
-
(var(--aia-product-card-width,
|
|
2375
|
+
8.4px +
|
|
2376
|
+
(var(--aia-product-card-width, 81.2px) - 8.4px) *
|
|
2259
2377
|
(1 - var(--aia-product-photo-fill-x, 1)) /
|
|
2260
2378
|
2
|
|
2261
2379
|
);
|
|
2262
2380
|
display: flex;
|
|
2263
2381
|
align-items: center;
|
|
2264
2382
|
justify-content: center;
|
|
2265
|
-
width: var(--aia-product-cart-size,
|
|
2266
|
-
height: var(--aia-product-cart-size,
|
|
2383
|
+
width: var(--aia-product-cart-size, 19.6px);
|
|
2384
|
+
height: var(--aia-product-cart-size, 19.6px);
|
|
2267
2385
|
border-radius: 999px;
|
|
2268
2386
|
background: var(--aia-product-cart-bg, rgba(255, 255, 255, 0.94));
|
|
2269
2387
|
color: var(--aia-product-cart-color, #1f2328);
|
|
@@ -2287,8 +2405,8 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2287
2405
|
|
|
2288
2406
|
.aia-cart-kSlqU svg {
|
|
2289
2407
|
display: block;
|
|
2290
|
-
width:
|
|
2291
|
-
height:
|
|
2408
|
+
width: 11.2px;
|
|
2409
|
+
height: 11.2px;
|
|
2292
2410
|
fill: none;
|
|
2293
2411
|
stroke: currentColor;
|
|
2294
2412
|
stroke-width: 2;
|
|
@@ -2371,8 +2489,8 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2371
2489
|
occurrence, and these selectors contain the base selectors. */
|
|
2372
2490
|
.aia-section-Hugfg[data-aia-products-layout="list"] .aia-row-WDVBX {
|
|
2373
2491
|
flex-direction: column;
|
|
2374
|
-
gap: var(--aia-product-list-gap,
|
|
2375
|
-
max-height: var(--aia-product-list-max-height,
|
|
2492
|
+
gap: var(--aia-product-list-gap, 1.4px);
|
|
2493
|
+
max-height: var(--aia-product-list-max-height, 224px);
|
|
2376
2494
|
overflow-x: hidden;
|
|
2377
2495
|
overflow-y: auto;
|
|
2378
2496
|
overscroll-behavior-y: contain;
|
|
@@ -2381,17 +2499,17 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2381
2499
|
.aia-section-Hugfg[data-aia-products-layout="list"] .aia-card-JBGYT {
|
|
2382
2500
|
flex-direction: row;
|
|
2383
2501
|
align-items: center;
|
|
2384
|
-
gap:
|
|
2502
|
+
gap: 7px;
|
|
2385
2503
|
width: auto;
|
|
2386
|
-
padding: 6px
|
|
2504
|
+
padding: 4.2px 5.6px;
|
|
2387
2505
|
}
|
|
2388
2506
|
|
|
2389
2507
|
/* A fixed square thumbnail: width and height together, so the row's height
|
|
2390
2508
|
is the tile's, not the card width's. */
|
|
2391
2509
|
.aia-section-Hugfg[data-aia-products-layout="list"] .aia-media-RrbGe {
|
|
2392
2510
|
flex: 0 0 auto;
|
|
2393
|
-
width: var(--aia-product-list-media-size,
|
|
2394
|
-
height: var(--aia-product-list-media-size,
|
|
2511
|
+
width: var(--aia-product-list-media-size, 30.8px);
|
|
2512
|
+
height: var(--aia-product-list-media-size, 30.8px);
|
|
2395
2513
|
}
|
|
2396
2514
|
|
|
2397
2515
|
.aia-section-Hugfg[data-aia-products-layout="list"] .aia-body-ly032 {
|
|
@@ -2403,18 +2521,18 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2403
2521
|
match, so its bottom edge is half a thumbnail below the card's centre; its
|
|
2404
2522
|
left edge is the card's 8px inline padding. */
|
|
2405
2523
|
.aia-section-Hugfg[data-aia-products-layout="list"] .aia-badge-j9Hcd {
|
|
2406
|
-
top: calc(50% + var(--aia-product-list-media-size,
|
|
2407
|
-
left:
|
|
2408
|
-
width: var(--aia-product-list-media-size,
|
|
2524
|
+
top: calc(50% + var(--aia-product-list-media-size, 30.8px) / 2);
|
|
2525
|
+
left: 5.6px;
|
|
2526
|
+
width: var(--aia-product-list-media-size, 30.8px);
|
|
2409
2527
|
transform: translateY(-100%);
|
|
2410
|
-
padding:
|
|
2411
|
-
border-radius: 0 0
|
|
2528
|
+
padding: 1.4px 0;
|
|
2529
|
+
border-radius: 0 0 5.6px 5.6px;
|
|
2412
2530
|
/* A dark scrim rather than the light chip: a light banner at a tile's edge
|
|
2413
2531
|
merges with a light panel and reads as a cropped photo. */
|
|
2414
2532
|
background: var(--aia-product-badge-list-bg, rgba(17, 17, 17, 0.72));
|
|
2415
2533
|
color: var(--aia-product-badge-list-color, #fff);
|
|
2416
2534
|
box-shadow: none;
|
|
2417
|
-
font-size: var(--aia-product-badge-list-font-size,
|
|
2535
|
+
font-size: var(--aia-product-badge-list-font-size, 4.9px);
|
|
2418
2536
|
letter-spacing: 0.02em;
|
|
2419
2537
|
text-align: center;
|
|
2420
2538
|
}
|
|
@@ -2423,7 +2541,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2423
2541
|
column stops short of it. */
|
|
2424
2542
|
.aia-section-Hugfg[data-aia-products-layout="list"] .aia-cart-kSlqU {
|
|
2425
2543
|
top: 50%;
|
|
2426
|
-
right:
|
|
2544
|
+
right: 5.6px;
|
|
2427
2545
|
transform: translateY(-50%);
|
|
2428
2546
|
}
|
|
2429
2547
|
|
|
@@ -2432,9 +2550,9 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2432
2550
|
}
|
|
2433
2551
|
|
|
2434
2552
|
.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,
|
|
2553
|
+
padding-right: calc(var(--aia-product-cart-size, 19.6px) + 11.2px);
|
|
2436
2554
|
}
|
|
2437
|
-
`,document.head.appendChild(e)}var
|
|
2555
|
+
`,document.head.appendChild(e)}var W={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"};import{jsx as j,jsxs as Ye}from"react/jsx-runtime";function Xt({products:e,listboxId:o,onSelect:a,onAddToCart:i,onFocusChange:n,focusable:s=!0,layout:r="row",imageFallback:l="image",strings:m=di()}){let b=e.length>0,x=ht(null);if(St(()=>{let c=x.current;if(!(!b||!c))return oi(c)},[b]),!b)return null;let u=`${o}-products-label`;return Ye("section",{className:W.section,"data-aia-products":"","data-aia-products-layout":r,role:"group","aria-labelledby":u,children:[j("div",{className:W.label,id:u,"data-aia-products-label":"",children:m.products}),j("div",{ref:x,className:W.row,"data-aia-products-row":"",children:e.map((c,p)=>j(ci,{product:c,id:`${o}-product-${p}`,onSelect:a,onAddToCart:i,onFocusChange:n,focusable:s,imageFallback:l,soldOut:m.soldOut,addToCart:m.addToCart},c.id))})]})}function ci({product:e,id:o,onSelect:a,onAddToCart:i,onFocusChange:n,focusable:s,imageFallback:r,soldOut:l,addToCart:m}){let b=!!i&&e.available!==!1,[x,u]=ut(null),c=v=>{v.relatedTarget?.closest("[data-aia-dropdown]")||n?.(!1)},p=v=>{v.metaKey||v.ctrlKey||v.shiftKey||v.altKey||v.button!==0||(v.preventDefault(),a(e))};return Ye("a",{id:o,className:W.card,"data-aia-product":"","data-aia-product-sold-out":e.available===!1?"":void 0,"data-aia-product-has-cart":b?"":void 0,role:"option","aria-selected":!1,style:x?{"--aia-product-photo-fill-x":String(x.x),"--aia-product-photo-fill-y":String(x.y)}:void 0,href:e.url,tabIndex:s?0:-1,onClick:p,onKeyDown:v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),a(e))},onFocus:()=>n?.(!0),onBlur:c,children:[j(ui,{sources:ni(e.imageUrl),title:e.title,fallback:r,onPhotoFill:u},ri(e.imageUrl)??""),Ye("span",{className:W.body,children:[e.vendor?j("span",{className:W.vendor,children:e.vendor}):null,j("span",{className:W.title,children:e.title}),e.price?Ye("span",{className:W.price,children:[e.price,e.compareAtPrice?j("s",{className:W.compareAt,children:e.compareAtPrice}):null]}):null,e.available===!1?j("span",{className:W.badge,children:l}):null]}),b&&i?j(hi,{product:e,label:`${m}: ${e.title}`,focusable:s,onAddToCart:i,onFocus:()=>n?.(!0),onBlur:c},pi(e)):null]})}function pi(e){return[e.id,e.title,e.url,e.imageUrl,e.vendor].map(o=>o??"").join("\0")}function hi({product:e,label:o,focusable:a,onAddToCart:i,onFocus:n,onBlur:s}){let[r,l]=ut(null),m=ht(null),b=ht(e);b.current=e;let x=ht(!0);St(()=>(x.current=!0,()=>{x.current=!1}),[]);let u=p=>{m.current=p,x.current&&l(p)},c=p=>{if(p.preventDefault(),p.stopPropagation(),m.current==="adding")return;u("adding");let v;try{v=Promise.resolve(i(b.current))}catch(A){v=Promise.reject(A)}v.then(()=>u("added"),()=>u(null))};return j("span",{className:W.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:a?0:-1,onClick:c,onKeyDown:p=>{p.key!=="Enter"&&p.key!==" "||c(p)},onFocus:p=>{p.stopPropagation(),n()},onBlur:p=>{p.stopPropagation(),s(p)},children:Ye("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[j("path",{className:W.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"}),j("path",{className:W.cartGlyph,d:"M13.5 6.5v-4M11.5 4.5h4"}),j("path",{className:W.cartCheck,d:"M5 12.5l4.5 4.5L19 7.5"}),j("path",{className:W.cartSpinner,d:"M12 4a8 8 0 1 0 8 8"}),j("circle",{className:W.cartGlyph,cx:"9",cy:"20",r:"1.3"}),j("circle",{className:W.cartGlyph,cx:"17.5",cy:"20",r:"1.3"})]})})}function ui({sources:e,title:o,fallback:a,onPhotoFill:i}){let[n,s]=ut(0),r=e[n],l=!!r,[m,b]=ut(null),x=!l&&a==="initial";return St(()=>()=>i(null),[i]),Ye("span",{className:W.media,"aria-hidden":"true","data-aia-product-placeholder":!l&&!x?"":void 0,"data-aia-product-initial":x?"":void 0,"data-aia-image-loaded":l&&m===r?"":void 0,children:[l?j("img",{className:W.image,src:r,alt:"",loading:"lazy",decoding:"async",onLoad:u=>{b(r),i(li(u.currentTarget.naturalWidth,u.currentTarget.naturalHeight))},onError:()=>{n+1>=e.length&&i(null),s(u=>u+1)}}):null,x?si(o):null]})}import{isOptionsGridMobileViewport as Ei,measureOptionsGrid as Ai,needsOptionsGridMeasurement as Li,OPTIONS_GRID_MOBILE_QUERY as Oi,optionEnterDelayMs as Ri,optionsShowLeadingVisuals as Di,planOptionsGrid as aa,sameOptionRows as Mi}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as zi,useLayoutEffect as Ni,useRef as ia,useState as na}from"react";import{optionsGridTemplateColumns as mi}from"@magicx-eng/ai-autocomplete-vanilla";import{useLayoutEffect as gi,useRef as fi}from"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
2556
|
display: grid;
|
|
2439
2557
|
grid-template-columns: repeat(
|
|
2440
2558
|
auto-fit,
|
|
@@ -2462,7 +2580,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2462
2580
|
/* The scroll box's reserved band (--aia-grid-scroll-* / --aia-grid-overlap-*)
|
|
2463
2581
|
is deliberately NOT declared here \u2014 see the rule in
|
|
2464
2582
|
appearance.css for why. */
|
|
2465
|
-
max-height: var(--aia-grid-max-height,
|
|
2583
|
+
max-height: var(--aia-grid-max-height, 84px);
|
|
2466
2584
|
overflow-y: auto;
|
|
2467
2585
|
overscroll-behavior: contain;
|
|
2468
2586
|
scrollbar-width: none;
|
|
@@ -2470,7 +2588,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2470
2588
|
.aia-grid[data-scroll]::-webkit-scrollbar {
|
|
2471
2589
|
display: none;
|
|
2472
2590
|
}
|
|
2473
|
-
`,document.head.appendChild(e)}import{jsx as
|
|
2591
|
+
`,document.head.appendChild(e)}import{jsx as bi}from"react/jsx-runtime";function Jt({min:e="16rem",max:o,gap:a,scroll:i=!1,maxHeight:n,scrollResetKey:s,cols:r,template:l,innerRef:m,className:b,children:x,...u}){let c=fi(null);gi(()=>{if(s===void 0)return;let v=c.current;v&&(v.scrollTop=0)},[s]);let p={"--aia-grid-min":e};return o&&(p["--aia-grid-max"]=o),a&&(p["--aia-grid-gap"]=a),n&&(p["--aia-grid-max-height"]=n),r&&(p.gridTemplateColumns=mi(r)),l&&(p.gridTemplateColumns=l),bi("div",{ref:v=>{c.current=v,m?.(v)},className:b?`aia-grid ${b}`:"aia-grid","data-scroll":i||void 0,style:p,...u,children:x})}import{formatOptionCount as wi,highlightParts as vi,isMultiSelectToggleTap as xi,OPTION_ENTER_DELAY_VAR as yi,optionImageSources as ki,optionLabel as ea,sanitizeOptionIconSvg as Ci}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Si,useMemo as Ti,useRef as Pi,useState as mt}from"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
2592
|
position: relative;
|
|
2475
2593
|
/* Clip, not visible: the entrance rise below runs on the inner content,
|
|
2476
2594
|
and a transformed box extends its scroll container's scrollable area.
|
|
@@ -2488,16 +2606,16 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2488
2606
|
the same baseline at the top edge of the cell. */
|
|
2489
2607
|
align-items: flex-start;
|
|
2490
2608
|
font-family: inherit;
|
|
2491
|
-
font-size: var(--aia-option-font-size,
|
|
2609
|
+
font-size: var(--aia-option-font-size, 11.2px);
|
|
2492
2610
|
font-weight: 450;
|
|
2493
|
-
line-height:
|
|
2611
|
+
line-height: 14.7px;
|
|
2494
2612
|
color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
|
|
2495
2613
|
white-space: normal;
|
|
2496
2614
|
word-break: break-word;
|
|
2497
|
-
/*
|
|
2498
|
-
SuggestionItem selection
|
|
2499
|
-
border-radius:
|
|
2500
|
-
padding:
|
|
2615
|
+
/* 5.6px radius on the highlighted fill (--aia-option-bg), matching the Figma
|
|
2616
|
+
SuggestionItem selection at 70%. The 5.6px/10px inset is the item's own padding. */
|
|
2617
|
+
border-radius: 5.6px;
|
|
2618
|
+
padding: 5.6px 10px;
|
|
2501
2619
|
/* No entrance animation on the row itself \u2014 deliberately. The row is the
|
|
2502
2620
|
tappable element, and iOS Safari drops a tap on a scripted-clickable
|
|
2503
2621
|
element (a div with a click handler; a native button is exempt) whose
|
|
@@ -2583,8 +2701,8 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2583
2701
|
}
|
|
2584
2702
|
|
|
2585
2703
|
.aia-tag-e3Fwe {
|
|
2586
|
-
font-size:
|
|
2587
|
-
margin-left:
|
|
2704
|
+
font-size: 7.7px;
|
|
2705
|
+
margin-left: 4.2px;
|
|
2588
2706
|
opacity: 0.5;
|
|
2589
2707
|
}
|
|
2590
2708
|
|
|
@@ -2663,9 +2781,9 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2663
2781
|
text box, so a hanging indent never moves it; a skeleton row drops it. */
|
|
2664
2782
|
.aia-parameter-Dt2zF {
|
|
2665
2783
|
display: block;
|
|
2666
|
-
font-size: var(--aia-option-parameter-font-size,
|
|
2784
|
+
font-size: var(--aia-option-parameter-font-size, 8.4px);
|
|
2667
2785
|
font-weight: 400;
|
|
2668
|
-
line-height:
|
|
2786
|
+
line-height: 11.2px;
|
|
2669
2787
|
text-indent: 0;
|
|
2670
2788
|
color: var(--aia-option-parameter-color, inherit);
|
|
2671
2789
|
opacity: var(--aia-option-parameter-opacity, 0.6);
|
|
@@ -2689,8 +2807,8 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2689
2807
|
.aia-icon-Qw938 {
|
|
2690
2808
|
display: inline-flex;
|
|
2691
2809
|
align-items: center;
|
|
2692
|
-
height:
|
|
2693
|
-
margin-right:
|
|
2810
|
+
height: 14.7px; /* = the option's line-height */
|
|
2811
|
+
margin-right: 5.6px;
|
|
2694
2812
|
vertical-align: top;
|
|
2695
2813
|
/* Own compositing layer. The row (entrance) and the chip (promotion fade)
|
|
2696
2814
|
animate on a layer WebKit drops when the animation ends; content drawn at
|
|
@@ -2721,8 +2839,8 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2721
2839
|
(blockified), so text-indent applies to it directly. Skeleton rows keep
|
|
2722
2840
|
it too: their icon is hidden but still occupies its column. */
|
|
2723
2841
|
.aia-content-T-Qba:not(:has(.aia-count-IpYbQ)):has(.aia-icon-Qw938) {
|
|
2724
|
-
padding-left: calc(1em +
|
|
2725
|
-
text-indent: calc(-1em -
|
|
2842
|
+
padding-left: calc(1em + 5.6px);
|
|
2843
|
+
text-indent: calc(-1em - 5.6px);
|
|
2726
2844
|
}
|
|
2727
2845
|
|
|
2728
2846
|
/* --- Option pictures and counts ---
|
|
@@ -2764,15 +2882,15 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2764
2882
|
loads) and stays if it never does. */
|
|
2765
2883
|
.aia-content-T-Qba:has(.aia-image-YZAbO) {
|
|
2766
2884
|
align-items: center;
|
|
2767
|
-
gap: var(--aia-option-image-gap,
|
|
2885
|
+
gap: var(--aia-option-image-gap, 8.4px);
|
|
2768
2886
|
}
|
|
2769
2887
|
|
|
2770
2888
|
.aia-image-YZAbO {
|
|
2771
2889
|
flex: 0 0 auto;
|
|
2772
2890
|
display: block;
|
|
2773
|
-
width: var(--aia-option-image-size,
|
|
2774
|
-
height: var(--aia-option-image-size,
|
|
2775
|
-
border-radius: var(--aia-option-image-radius,
|
|
2891
|
+
width: var(--aia-option-image-size, 28px);
|
|
2892
|
+
height: var(--aia-option-image-size, 28px);
|
|
2893
|
+
border-radius: var(--aia-option-image-radius, 8.4px);
|
|
2776
2894
|
overflow: hidden;
|
|
2777
2895
|
background: var(--aia-option-image-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.083)));
|
|
2778
2896
|
}
|
|
@@ -2797,7 +2915,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2797
2915
|
max-width: 100%;
|
|
2798
2916
|
height: 100%;
|
|
2799
2917
|
margin: 0 auto;
|
|
2800
|
-
border-radius: var(--aia-option-picture-radius,
|
|
2918
|
+
border-radius: var(--aia-option-picture-radius, 4.2px);
|
|
2801
2919
|
object-fit: contain;
|
|
2802
2920
|
}
|
|
2803
2921
|
|
|
@@ -2814,10 +2932,10 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2814
2932
|
.aia-count-IpYbQ {
|
|
2815
2933
|
flex: 0 0 auto;
|
|
2816
2934
|
margin-left: auto;
|
|
2817
|
-
padding-left:
|
|
2818
|
-
font-size: var(--aia-option-count-font-size,
|
|
2935
|
+
padding-left: 8.4px;
|
|
2936
|
+
font-size: var(--aia-option-count-font-size, 8.4px);
|
|
2819
2937
|
font-weight: 400;
|
|
2820
|
-
line-height:
|
|
2938
|
+
line-height: 14.7px; /* = the option's line-height */
|
|
2821
2939
|
font-variant-numeric: tabular-nums;
|
|
2822
2940
|
white-space: nowrap;
|
|
2823
2941
|
color: var(--aia-option-count-color, inherit);
|
|
@@ -2853,12 +2971,12 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2853
2971
|
display: none;
|
|
2854
2972
|
}
|
|
2855
2973
|
|
|
2856
|
-
/* A grid of rows with a parameter line is taller per row: the row's
|
|
2857
|
-
line and
|
|
2974
|
+
/* A grid of rows with a parameter line is taller per row: the row's text
|
|
2975
|
+
line and padding plus the parameter line, so the visible-rows cap
|
|
2858
2976
|
(\`--aia-grid-max-height\`) does not cut the last row. Before the picture rule,
|
|
2859
2977
|
which wins when a group has both. */
|
|
2860
2978
|
[data-aia-group]:has(.aia-parameter-Dt2zF) {
|
|
2861
|
-
--aia-option-row-height:
|
|
2979
|
+
--aia-option-row-height: 37.1px;
|
|
2862
2980
|
}
|
|
2863
2981
|
|
|
2864
2982
|
/* A grid of picture rows is taller per row: the visible-rows cap
|
|
@@ -2866,7 +2984,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2866
2984
|
planOptionsGrid) follows the tile's height plus the row's padding, so the
|
|
2867
2985
|
same number of rows shows before the list scrolls. */
|
|
2868
2986
|
[data-aia-group]:has(.aia-image-YZAbO) {
|
|
2869
|
-
--aia-option-row-height: calc(var(--aia-option-image-size,
|
|
2987
|
+
--aia-option-row-height: calc(var(--aia-option-image-size, 28px) + 11.2px);
|
|
2870
2988
|
}
|
|
2871
2989
|
|
|
2872
2990
|
/* A row without a picture, in a grid where other rows have one, lines up
|
|
@@ -2881,9 +2999,9 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2881
2999
|
display: flex;
|
|
2882
3000
|
flex: 1 1 auto;
|
|
2883
3001
|
align-items: center;
|
|
2884
|
-
gap: var(--aia-option-image-gap,
|
|
3002
|
+
gap: var(--aia-option-image-gap, 8.4px);
|
|
2885
3003
|
min-width: 0;
|
|
2886
|
-
min-height: var(--aia-option-image-size,
|
|
3004
|
+
min-height: var(--aia-option-image-size, 28px);
|
|
2887
3005
|
padding-left: 0;
|
|
2888
3006
|
text-indent: 0;
|
|
2889
3007
|
}
|
|
@@ -2891,8 +3009,8 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2891
3009
|
[data-aia-group]:has(.aia-image-YZAbO) .aia-content-T-Qba:not(:has(.aia-image-YZAbO)) .aia-icon-Qw938 {
|
|
2892
3010
|
flex: 0 0 auto;
|
|
2893
3011
|
justify-content: center;
|
|
2894
|
-
width: var(--aia-option-image-size,
|
|
2895
|
-
height: var(--aia-option-image-size,
|
|
3012
|
+
width: var(--aia-option-image-size, 28px);
|
|
3013
|
+
height: var(--aia-option-image-size, 28px);
|
|
2896
3014
|
margin-right: 0;
|
|
2897
3015
|
}
|
|
2898
3016
|
|
|
@@ -2952,7 +3070,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2952
3070
|
.aia-content-T-Qba:has(.aia-checkbox-KGRhg) {
|
|
2953
3071
|
display: flex;
|
|
2954
3072
|
align-items: center;
|
|
2955
|
-
gap:
|
|
3073
|
+
gap: 7px;
|
|
2956
3074
|
}
|
|
2957
3075
|
|
|
2958
3076
|
/* A checkbox row is a flex row, so its icon is a flex item beside the text,
|
|
@@ -2976,14 +3094,14 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2976
3094
|
/* The mark is text centred in the box. An indent inherited from the row
|
|
2977
3095
|
(an icon row hangs its text with one) would slide it out of the box. */
|
|
2978
3096
|
text-indent: 0;
|
|
2979
|
-
flex: 0 0
|
|
2980
|
-
width:
|
|
2981
|
-
height:
|
|
3097
|
+
flex: 0 0 12.6px;
|
|
3098
|
+
width: 12.6px;
|
|
3099
|
+
height: 12.6px;
|
|
2982
3100
|
border: 1px solid var(--aia-border);
|
|
2983
|
-
border-radius:
|
|
3101
|
+
border-radius: 4.2px;
|
|
2984
3102
|
background: var(--aia-surface);
|
|
2985
3103
|
color: transparent;
|
|
2986
|
-
font-size:
|
|
3104
|
+
font-size: 7.7px;
|
|
2987
3105
|
line-height: 1;
|
|
2988
3106
|
}
|
|
2989
3107
|
|
|
@@ -2996,7 +3114,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
2996
3114
|
.aia-item-d4vpD:has(.aia-checkbox-KGRhg[data-checked="true"]) {
|
|
2997
3115
|
background: var(--aia-option-bg, transparent);
|
|
2998
3116
|
}
|
|
2999
|
-
`,document.head.appendChild(e)}var $={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"};import{Fragment as
|
|
3117
|
+
`,document.head.appendChild(e)}var $={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"};import{Fragment as Ii,jsx as Te,jsxs as Tt}from"react/jsx-runtime";function ta({option:e,isHighlighted:o,checked:a,onSelect:i,onHighlight:n,onUnhighlight:s,id:r,loading:l,showIcon:m=!0,showImage:b=!0,showCount:x=!0,scrollHint:u,enterDelayMs:c=0}){let[p]=mt(c),[v,A]=mt(!1),N=b?ki(e.image_url):[],L=N[0]??null,[F,G]=mt([]),O=N.find(T=>!F.includes(T))??null,[E,k]=mt(null),X=Ti(()=>!L&&m&&e.icon_svg?Ci(e.icon_svg):null,[L,m,e.icon_svg]),_=x?wi(e.item_count):null,J=Pi(void 0);Si(()=>()=>clearTimeout(J.current),[]);let z=T=>{if(l||!e.is_tappable||v&&a===void 0)return;A(!0);let K=T?.currentTarget;a!==void 0&&K!==void 0&&T!==void 0&&!xi(K,K.querySelector("[data-aia-checkbox]"),T)?i(e,{commit:!0}):i(e),clearTimeout(J.current),J.current=setTimeout(()=>A(!1),170)},V=[$.item,o&&!l?$.highlighted:"",e.liveMatch&&!l?$.liveMatch:"",e.is_tappable?$.tappable:$.nonTappable,v?$.pressed:"",u?$.scrollHint:""].filter(Boolean).join(" ");return Te("div",{id:r,role:"option","data-aia-option":"","data-aia-loading":l?"":void 0,"data-aia-icon":X&&e.icon?e.icon:void 0,"data-aia-image":L?"":void 0,"data-aia-item-count":_!==null?e.item_count:void 0,"aria-selected":a??o,className:V,style:{[yi]:`${p}ms`},tabIndex:l||!e.is_tappable?-1:0,onClick:z,onKeyDown:T=>{!l&&e.is_tappable&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),z())},onMouseEnter:!l&&e.is_tappable?n:void 0,onMouseLeave:s,children:Tt("span",{className:$.content,children:[a!==void 0&&e.is_tappable&&Te("span",{className:$.checkbox,"aria-hidden":"true","data-aia-checkbox":"","data-checked":a,children:a?"\u2713":""}),L&&Te("span",{className:`${$.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-image-loaded":O!==null&&E===O?"":void 0,children:Te("img",{src:O??L,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:O===null,onLoad:()=>k(O),onError:()=>{O!==null&&G(T=>[...T,O])}})}),X&&Te("span",{className:`${$.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:X}}),Tt("span",{className:$.text,children:[e.matchedText?vi(ea(e),e.matchedText).map((T,K)=>T.bold?Te("strong",{className:`${$.match} magicx-aia-option-match`,children:T.text},K):T.text):ea(e),e.parameterLabel&&Tt(Ii,{children:[" ",Te("span",{className:`${$.parameter} magicx-aia-option-parameter`,children:e.parameterLabel})]})]}),e.tag&&Te("span",{className:$.tag,children:e.tag}),_!==null&&Te("span",{className:`${$.count} magicx-aia-option-count`,children:_})]})})}import{jsx as oa}from"react/jsx-runtime";function Fi(){let[e,o]=na(Ei);return zi(()=>{if(typeof window>"u"||!window.matchMedia)return;let a=window.matchMedia(Oi),i=()=>o(a.matches);return i(),a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[]),e}function ra({options:e,activeIndex:o,picked:a,onSelect:i,onHighlight:n,onUnhighlight:s,listboxId:r,loading:l,groupKey:m="",optionsPosition:b="below",showIcons:x=!0,showImages:u=!0,showCounts:c=!0}){let p=Fi(),v=ia(null),[A,N]=na(null),L=ia(null);Ni(()=>{if(l&&Mi(L.current,e))return;L.current=l?null:e;let O=v.current,k=O&&!l&&Li(e.length,p)?Ai(O):null;N(k?aa(e.length,p,k.rowWidths,k.gridWidth):null)},[e,p,l]);let F=A??aa(e.length,p,null,null),G=Di(e,x,u);return oa(Jt,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:m,template:F.template,maxHeight:F.maxHeight,innerRef:O=>{v.current=O},"data-aia-group":m,children:e.map((O,E)=>oa(ta,{option:O,isHighlighted:E===o,checked:a?a.includes(O.text):void 0,onSelect:i,onHighlight:()=>n(E),onUnhighlight:s?()=>s(E):void 0,id:`${r}-option-${E}`,loading:l,showIcon:x&&G,showImage:u&&G,showCount:c,scrollHint:!l&&F.scrollHintIndices.includes(E),enterDelayMs:l?0:Ri(E,F.cols,e.length,b)},`${m}\0${O.text}`))})}import{formatTime as Hi,TIME_WHEEL_COLUMNS as Bi,TIME_WHEEL_ROW_HEIGHT as Wi,timeWheelIndex as sa,timeWheelIndexFromScroll as Ki,timeWheelRows as Gi,withTimeWheelIndex as la}from"@magicx-eng/ai-autocomplete-vanilla";import{Fragment as qi,useEffect as _i,useLayoutEffect as Vi,useRef as gt}from"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
3118
|
|
|
3001
3119
|
One of three hand-maintained copies (vanilla styles.css, this file, Angular's
|
|
3002
3120
|
time-wheel.component.css). Only the class-naming layer differs \u2014 the
|
|
@@ -3101,24 +3219,24 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
3101
3219
|
|
|
3102
3220
|
.aia-done-llNY5 {
|
|
3103
3221
|
align-self: stretch;
|
|
3104
|
-
height:
|
|
3222
|
+
height: 44px;
|
|
3105
3223
|
padding: 0 12px;
|
|
3106
3224
|
border: none;
|
|
3107
|
-
border-radius:
|
|
3108
|
-
background: var(--aia-time-done-bg, var(--aia-
|
|
3225
|
+
border-radius: 12px;
|
|
3226
|
+
background: var(--aia-time-done-bg, var(--aia-done-bg, #e4e8f0));
|
|
3109
3227
|
font-family: inherit;
|
|
3110
|
-
font-size:
|
|
3111
|
-
font-weight:
|
|
3228
|
+
font-size: 15px;
|
|
3229
|
+
font-weight: 600;
|
|
3112
3230
|
line-height: 20px;
|
|
3113
|
-
color: var(--aia-time-done-color, var(--aia-
|
|
3231
|
+
color: var(--aia-time-done-color, var(--aia-done-color, #2a3150));
|
|
3114
3232
|
cursor: pointer;
|
|
3115
3233
|
transition: background-color 150ms ease-out;
|
|
3116
3234
|
}
|
|
3117
3235
|
|
|
3118
3236
|
.aia-done-llNY5:hover {
|
|
3119
|
-
background: var(--aia-time-done-bg-hover, var(--aia-
|
|
3237
|
+
background: var(--aia-time-done-bg-hover, var(--aia-done-bg-hover, #d8dde8));
|
|
3120
3238
|
}
|
|
3121
|
-
`,document.head.appendChild(e)}var
|
|
3239
|
+
`,document.head.appendChild(e)}var de={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"};import{jsx as Ke,jsxs as Pt}from"react/jsx-runtime";var Ui=120;function da({view:e,label:o,doneLabel:a,interactive:i=!0,onTimeChange:n,onTimeCommit:s}){return Pt("div",{className:de.timeWheel,"data-aia-time-wheel":"",role:"group","aria-label":o,onMouseDown:r=>r.preventDefault(),children:[Ke("span",{className:de.value,"data-aia-time-value":"","aria-live":"polite",children:Hi(e.minutes)}),Pt("div",{className:de.columns,"aria-hidden":"true",children:[Ke("div",{className:de.band}),Bi.map(r=>Pt(qi,{children:[r==="minute"&&Ke("span",{className:de.separator,children:":"}),Ke(Qi,{column:r,minutes:e.minutes,interactive:i,onTimeChange:n})]},r))]}),Ke("button",{type:"button",tabIndex:-1,className:de.done,"data-aia-time-done":"",onClick:()=>{i&&s()},children:a})]})}function Qi({column:e,minutes:o,interactive:a,onTimeChange:i}){let n=gt(null),s=gt(null),r=gt(null),l=gt({minutes:o,interactive:a,onTimeChange:i});l.current={minutes:o,interactive:a,onTimeChange:i};let m=sa(e,o);Vi(()=>{let u=n.current;if(!u||r.current)return;let c=m*Wi;Math.abs(u.scrollTop-c)<1||(s.current=c,u.scrollTop=c)},[m]),_i(()=>()=>{r.current&&clearTimeout(r.current)},[]);let b=()=>{r.current=null;let u=n.current,c=l.current;if(!u||!c.interactive)return;let p=Ki(e,u.scrollTop);p!==sa(e,c.minutes)&&c.onTimeChange(la(e,c.minutes,p))},x=()=>{let u=n.current;if(u){if(s.current!=null&&Math.abs(u.scrollTop-s.current)<1){s.current=null;return}s.current=null,r.current&&clearTimeout(r.current),r.current=setTimeout(b,Ui)}};return Ke("div",{ref:n,className:de.column,"data-aia-time-column":e,onScroll:x,children:Gi(e).map((u,c)=>Ke("div",{className:c===m?`${de.row} ${de.selected}`:de.row,"data-aia-time-row":"","data-aia-index":c,onClick:()=>{l.current.interactive&&i(la(e,l.current.minutes,c))},children:u.label},u.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
3240
|
display: flex;
|
|
3123
3241
|
flex-direction: column;
|
|
3124
3242
|
gap: var(--aia-stack-space, 0.5rem);
|
|
@@ -3133,7 +3251,7 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
3133
3251
|
align-items: end;
|
|
3134
3252
|
}
|
|
3135
3253
|
/* data-align="stretch" is the flex default \u2014 no rule needed. */
|
|
3136
|
-
`,document.head.appendChild(e)}import{jsx as
|
|
3254
|
+
`,document.head.appendChild(e)}import{jsx as Yi}from"react/jsx-runtime";function ca({space:e,align:o="stretch",className:a,children:i,...n}){let s=e?{"--aia-stack-space":e}:void 0;return Yi("div",{className:a?`aia-stack ${a}`:"aia-stack","data-align":o,style:s,...n,children:i})}import{jsx as ee,jsxs as It}from"react/jsx-runtime";var po=typeof window>"u"?Ge:Et,ho=[159,119,164],uo=()=>{},pa=()=>{},mo=e=>{},go=()=>{},fo=e=>{},bo=e=>{},wo=e=>{},vo=e=>{};function xo(e){let o=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[a,i]=co(o);if(Ge(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let n=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>i(n.matches);return n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[e]),e!==void 0)return e==="auto"?a?"dark":"light":e}function yo(e,o){let a=je(null);Ge(()=>{let i=e.current,n=o.current;if(!i||!n)return;let s=ro(i,".aia-grid[data-scroll]");if(a.current&&a.current.grid!==s&&(a.current.controller.destroy(),a.current=null),s&&!a.current){a.current={grid:s,controller:ji({dropdown:i,grid:s,button:n})};return}a.current?.controller.update()}),Ge(()=>()=>{a.current?.controller.destroy(),a.current=null},[])}function ko(e,o){let a=je(o);a.current=o;let i=je(null);Et(()=>{let n=e.current;if(n){if(!i.current){i.current=$i({dropdown:n,isOpen:()=>a.current});return}i.current.update()}}),Ge(()=>()=>{i.current?.destroy(),i.current=null},[])}function At({suggestions:e,activeIndex:o,onSelect:a,onHighlight:i,onUnhighlight:n,isOpen:s,id:r,className:l,pills:m,onPillClick:b,showPills:x=!0,onSkip:u,showSkipButton:c=!0,showOptionIcons:p=!0,showOptionImages:v=!0,showOptionCounts:A=!0,skipDisabled:N=!1,activeSelected:L=!1,isLoading:F=!1,skeletonExiting:G=!1,isInputEmpty:O=!1,language:E,products:k,onProductSelect:X,onProductAddToCart:_,onProductFocusChange:J,productsLayout:z="row",productImageFallback:V="image",formatType:T="options",dateView:K=null,selectedDateIso:h=null,selectedDateRange:P=null,dateRangeStart:Pe=null,onPreviousMonth:be,onNextMonth:De,timeView:we=null,multiSelectView:g=null,onMultiSelectCommit:Me,onTimeChange:Ie,onTimeCommit:Ee,locationView:f=null,onLocationQuery:C,onLocationMove:S,onLocationCommit:I,onLocationFocusChange:R,isFocused:U=!1,optionsPosition:te="below",mode:oe}){let ne=xo(oe),ze=ne!==void 0,q=je(null),ve=je(null);yo(q,ve),Ge(()=>{if(q.current)return Zi(q.current)},[]);let qe=e[0]?.options??[],et=!!(m&&m.length>0&&b),xe=!!(k&&k.length>0),Ne=T==="time"&&we!=null,_e=T==="location"&&f!=null,Q=s&&(qe.length>0||x&&et||F||xe||Ne||_e);ko(q,Q),po(()=>{let y=q.current;y&&to(y,eo(y))});let pe={suggestions:e,activeIndex:o,pills:m,showPills:x,showSkipButton:c,showOptionIcons:p,showOptionImages:v,showOptionCounts:A,skipDisabled:N,activeSelected:L,isLoading:F,skeletonExiting:G,isInputEmpty:O,products:k,formatType:T,dateView:K,selectedDateIso:h,selectedDateRange:P,dateRangeStart:Pe,timeView:we,multiSelectView:g,locationView:f},ye=je(pe);Q&&(ye.current=pe);let t=Q?pe:ye.current,Y=lo(E),Ae=t.suggestions[0],re=Ae?.options??[],w=t.activeIndex>=0&&!!re[t.activeIndex]?.is_tappable,he=oo(t.pills??[],Y.keepTyping),Le=!!(he.length>0&&b),ke=t.showPills&&Le,tt=t.showPills&&!Le&&t.isLoading,Ve=ke||tt,Ce=Le&&ao(he)&&t.showSkipButton&&!t.isInputEmpty&&!!u,Ue=he[0]?.text,se=io(t.formatType)&&t.dateView!=null,ue=re.length>0&&!se,Oe=re.length>0&&se&&!t.isLoading,Fe=t.formatType==="time"&&t.timeView!=null&&!t.isLoading,Qe=t.formatType==="location"&&t.locationView!=null&&!t.isLoading,He=t.isLoading&&!ue&&!Oe&&!Fe&&!Qe,Be=t.products??[],d=no(ke?he:[]);return Et(()=>{q.current&&so(q.current,d,{visible:Q,anchorBottom:te==="above"})},[d,Q,te,t.suggestions,t.pills,t.isLoading,t.skeletonExiting,t.isInputEmpty,t.products,t.formatType,t.dateView,t.selectedDateIso,t.selectedDateRange,t.dateRangeStart,t.timeView,t.multiSelectView,t.locationView,t.showPills,t.showSkipButton,t.showOptionIcons,t.showOptionImages,t.showOptionCounts,z,E]),Ge(()=>{let y=q.current;return()=>{y&&Ji(y)}},[]),It("div",{ref:q,id:r,role:"listbox","aria-multiselectable":!!t.multiSelectView,"data-aia-dropdown":"","data-options-position":te,"data-mode":ne,"data-aia-loading":t.isLoading?"":void 0,"data-aia-skeleton-exiting":t.skeletonExiting?"":void 0,"data-aia-has-products":Be.length>0?"":void 0,className:`${ze?"magicx-aia ":""}${me.dropdown} ${Q?me.visible:""} ${l??""}`,onMouseDown:y=>y.preventDefault(),children:[It(ca,{space:"8px",children:[(Ve||Ce)&&It(nt,{noWrap:!0,className:me.pillBar,"data-aia-pillbar":"",children:[Ve&&ee("span",{className:me.pillScroll,"data-aia-pill-scroll":"",children:ee(pt,{pills:he,activePillIndex:0,activeSelected:t.activeSelected,onSelectPill:b??(()=>{}),rounded:!0,loading:t.isLoading})}),Ce&&ee("button",{type:"button",tabIndex:-1,className:me.skip,"data-aia-skip":"",disabled:t.isLoading||t.skipDisabled,"aria-label":Ue?`${Y.skipLabel} ${Ue}`:Y.skipLabel,onClick:u,children:Y.skip})]}),ue&&ee(ra,{options:re,activeIndex:t.activeIndex,onSelect:a,onHighlight:i,onUnhighlight:n,listboxId:r,loading:t.isLoading,groupKey:Ae?`${Ae.parameter} ${Ae.text}`:"",optionsPosition:te,showIcons:t.showOptionIcons,showImages:t.showOptionImages,showCounts:t.showOptionCounts,picked:t.isLoading?void 0:t.multiSelectView?.picked}),t.multiSelectView&&!t.isLoading&&ee("div",{onClick:y=>{y.target.closest("[data-aia-multi-done]")&&!t.skipDisabled&&Me?.()},children:ee("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-multi-done":"",className:me.multiDone,ref:y=>{y&&(y.disabled=!0,y.offsetHeight,y.disabled=t.skipDisabled)},children:Y.done})}),Oe&&t.dateView&&ee(qt,{options:re,activeIndex:t.activeIndex,listboxId:r,view:t.dateView,selection:{selectedIso:t.selectedDateIso??null,selectedRange:t.selectedDateRange??null,rangeStart:t.dateRangeStart??null,floor:Xi(t.formatType,t.dateRangeStart)},onSelect:a,onHighlight:i,onUnhighlight:n,onPreviousMonth:be??pa,onNextMonth:De??pa}),Fe&&t.timeView&&ee(da,{view:t.timeView,label:Y.timeLabel,doneLabel:Y.done,interactive:!t.skipDisabled,onTimeChange:Ie??mo,onTimeCommit:Ee??go}),Qe&&t.locationView&&ee(jt,{view:t.locationView,searchLabel:Y.locationSearch,noResultsLabel:Y.locationNoResults,useTypedLabel:Y.locationUseTyped,widgetFocused:U&&Q,visible:Q,interactive:!t.skipDisabled,onQuery:C??fo,onMove:S??bo,onCommit:I??wo,onFocusChange:R??vo}),He&&ee("div",{className:me.skeletonBars,"data-aia-skeleton-bars":"",children:ho.map(y=>ee("span",{className:me.skeletonBar,style:{width:y}},`bar-${y}`))}),ee(Xt,{products:Be,listboxId:r,onSelect:X??uo,onAddToCart:_,onFocusChange:J,focusable:Q,layout:z,imageFallback:V,strings:Y}),ee(Vt,{isOptionHighlighted:w,isInputEmpty:t.isInputEmpty,strings:Y})]}),ee("button",{ref:ve,type:"button",tabIndex:-1,className:me.scrollArrow,"data-aia-scroll-arrow":"","aria-label":Y.scrollArrow,"aria-hidden":"true",children:ee("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:ee("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}import{buildSubmitResult as Fo,ModeController as Ho,setCursorOffset as Bo,uiStringsFor as Wo,watchEditorHeight as Ko}from"@magicx-eng/ai-autocomplete-vanilla";import{uiStringsFor as Co}from"@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
3255
|
flex-shrink: 0;
|
|
3138
3256
|
width: 32px;
|
|
3139
3257
|
height: 32px;
|
|
@@ -3204,5 +3322,5 @@ import{buildSubmitResult as Gr,cellDay as Kr,cellIso as qr,DATE_RANGE_META_END a
|
|
|
3204
3322
|
transition: none;
|
|
3205
3323
|
}
|
|
3206
3324
|
}
|
|
3207
|
-
`,document.head.appendChild(e)}var ca={submitButton:"aia-submitButton-otz7H"};import{jsx as Et}from"react/jsx-runtime";function pa({disabled:e,ready:i,onClick:t,label:a=mo().submit}){return Et("button",{type:"button","data-aia-submit":"",className:ca.submitButton,disabled:e,"data-aia-ready":i?"":void 0,onClick:o=>{o.stopPropagation(),t()},"aria-label":a,children:Et("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":a,children:Et("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}import{AIAutocomplete as go,dateSelectionFor as fo,identifiedParamLabel as bo,withoutTraditionalAutocomplete as wo}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as fa,useEffect as Ye,useRef as Z,useState as vo}from"react";import{useRef as ha}from"react";function ua(e){let i=ha(e);i.current=e;let t=Object.keys(e??{}).sort().join("\0"),a=ha({key:"",overrides:void 0});if(a.current.key!==t){let o={};for(let r of Object.keys(e??{})){let n=(s,g,v)=>{let x=i.current?.[r];return x?x(s,g,v):[]};o[r]=n}a.current={key:t,overrides:e?o:void 0}}return{overrides:a.current.overrides,key:t}}import{useRef as ma}from"react";function ga(e){let i=ma(e);i.current=e;let t=ma(null);t.current===null&&(t.current={fetch:(o,r)=>{let n=i.current;return n?n.fetch(o,r):Promise.reject(new Error("products config removed"))},transform:o=>i.current?.transform(o)??[],get limit(){return i.current?.limit}});let a=e!==void 0;return{config:a?t.current:void 0,enabled:a}}var ba={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:"",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 At({onSubmit:e,onResult:i,onError:t,optionOverrides:a,maskCompletedText:o,apiConfig:r,additionalContext:n,language:s,currency:g,productId:v,visitorId:x,columns:u=2,dropdownTrigger:d,optionsPosition:c,closeDropdownOnBlur:w,showNonTappableOptions:L,locationSearch:N,showOptionIcons:D,showOptionImages:H,showOptionCounts:q,showSkipButton:R,showProducts:I,productImageFallback:C="image",onFocus:V,onBlur:Q,value:B,completedParams:F,onChange:ae,onParamsChange:P,products:_,mapProducts:p,onProductSelect:E,onProductAddToCart:ve,source:De,setCursor:Pe}){let f=Z(null),[Me,Ie]=vo(null),Ee=Z(e);Ee.current=e;let Ae=Z(i);Ae.current=i;let b=Z(t);b.current=t;let k=Z(ae);k.current=ae;let S=Z(P);S.current=P;let A=Z(V);A.current=V;let O=Z(Q);O.current=Q;let U=Z(Pe);U.current=Pe;let ie=Z(E);ie.current=E;let oe=Z(ve);oe.current=ve;let ce=Z(x);ce.current=x;let pe=Z(()=>{let l=ce.current;return typeof l=="function"?l():l}).current,ne=ga(_),ze=Z(p);ze.current=p;let Xe=Z((l,T)=>{let z=ze.current;return z?z(l,T):l}).current,xe=p?Xe:void 0,Ne=ua(a);Ye(()=>{if(typeof document>"u")return;let l=new go(document.createElement("div"),{renderMode:"headless",apiConfig:r,additionalContext:n,language:s,currency:g,productId:v,visitorId:pe,optionOverrides:Ne.overrides,maskCompletedText:o,columns:u,dropdownTrigger:d,optionsPosition:c,closeDropdownOnBlur:w,showNonTappableOptions:L,locationSearch:N,showProducts:I,source:De,value:B,completedParams:F,onSubmit:(...z)=>Ee.current?.(...z),onResult:(...z)=>Ae.current?.(...z),onError:(...z)=>b.current?.(...z),onChange:(...z)=>k.current?.(...z),onParamsChange:(...z)=>S.current?.(...z),onFocus:()=>A.current?.(),onBlur:()=>O.current?.(),onProductSelect:z=>ie.current?.(z),onProductAddToCart:z=>oe.current?.(z),setCursor:z=>U.current?.(z),products:ne.config,mapProducts:xe});f.current=l,Ie(l.getState());let T=l.subscribe(z=>Ie(z));return()=>{T(),l.destroy(),f.current===l&&(f.current=null)}},[]),Ye(()=>{B!==void 0&&f.current?.setValue(B)},[B]),Ye(()=>{F!==void 0&&f.current?.setCompletedParams(F)},[F]);let We=JSON.stringify(r??null),ye;try{ye=JSON.stringify(n??null)}catch{ye="[unstringifiable]"}Ye(()=>{f.current?.update({apiConfig:r,additionalContext:n,language:s,currency:g,productId:v,optionOverrides:Ne.overrides,dropdownTrigger:d,optionsPosition:c,closeDropdownOnBlur:w,showNonTappableOptions:L,locationSearch:N,showProducts:I})},[We,ye,s,g?.code,g?.rate,g?.country,v,Ne.key,d,c,w,L,N,I]);let J=Z(!1);Ye(()=>{if(!J.current){J.current=!0;return}f.current?.update({products:ne.config})},[ne.enabled]),Ye(()=>{f.current?.update({mapProducts:xe})},[xe]);let he=Z(null);he.current===null&&(he.current={handleTextChange:l=>f.current?.handleTextChange(l),handleKeyDown:l=>{let T="nativeEvent"in l?l.nativeEvent:l;f.current?.handleKeyDown(T)},setFocused:l=>f.current?.setFocused(l),startEditingParam:l=>f.current?.startEditingParam(l),exitEditMode:()=>f.current?.exitEditMode(),handleCaretAfterInput:l=>f.current?.handleCaretAfterInput(l),handleCaretMove:l=>f.current?.handleCaretMove(l),replaceEditingRange:l=>f.current?.replaceEditingRange(l)??!1,setActivePill:l=>f.current?.setActivePill(l),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()??ba,recordSubmit:l=>f.current?.recordSubmit(l),selectOption:(l,T)=>f.current?.selectOption(l,T),selectProduct:l=>f.current?.selectProduct(l),addProductToCart:l=>{let T=f.current;return!T||!oe.current?Promise.resolve():T.addProductToCart(l)},setActiveDropdownIndex:l=>f.current?.setActiveDropdownIndex(l),clearHighlight:l=>f.current?.clearHighlight(l),showPreviousMonth:()=>f.current?.showPreviousMonth(),showNextMonth:()=>f.current?.showNextMonth(),setTime:l=>f.current?.setTime(l),commitTime:()=>f.current?.commitTime(),toggleMultiSelectOption:l=>f.current?.toggleMultiSelectOption(l),commitMultiSelect:()=>f.current?.commitMultiSelect(),setLocationQuery:l=>f.current?.setLocationQuery(l),moveLocationHighlight:l=>f.current?.moveLocationHighlight(l),commitLocation:l=>f.current?.commitLocation(l),setLocationFieldFocused:l=>f.current?.setLocationFieldFocused(l),handleFocus:()=>f.current?.setFocused(!0),handleBlur:()=>f.current?.setFocused(!1)});let y=he.current,h=fa(l=>{let T=l.target.value,st=T.length>0&&!l.nativeEvent?.isComposing&&T[0]!==T[0].toUpperCase()?T[0].toUpperCase()+T.slice(1):T;f.current?.handleTextChange(st)},[]),Y=fa(l=>{f.current?.handleKeyDown(l.nativeEvent)},[]),ue=f.current,m=Me??ba,Ge=B!==void 0?B:m.text,ke=F!==void 0?F:m.completedParams,me=m.actionableSuggestions,Je=me[0],et=wo(me),Ce=ue?.listboxId??"",Ke=m.activeDropdownIndex>=0&&ue?`${Ce}-option-${m.activeDropdownIndex}`:void 0,re=m.editingParam,ge=m.editingIdentified,Le=re?{parameter:re.suggestionParameter,text:re.suggestionPlaceholder,required:!0,options:re.options}:ge?{parameter:ge.parameter,text:bo(ge.parameter),required:!0,options:[]}:null,Fe=m.dropdownSuggestion??Le??Je,qe=Le?[Le]:me,Re=fo(m),_e=!ue||m.dropdownLoading;return{completedParams:ke,multiSelectView:m.multiSelectView,toggleMultiSelectOption:y.toggleMultiSelectOption,commitMultiSelect:y.commitMultiSelect,skippedParams:m.skippedParams,identifiedParams:m.identifiedParams,suggestionPills:et,setActivePill:y.setActivePill,skipActivePill:y.skipActivePill,removeLastParam:y.removeLastParam,segments:m.segments,newParamId:m.newParamId,clearNewParamId:y.clearNewParamId,suggestions:m.suggestions,activeIndex:m.activeDropdownIndex,isReady:m.isReady,isLoading:_e,isFocused:m.isFocused,isDropdownOpen:m.isDropdownOpen,isActivePillSelected:m.isActivePillSelected,placeholderText:m.placeholderText,listboxId:Ce,error:m.error,products:m.products,customFields:m.customFields,selectProduct:y.selectProduct,addProductToCart:y.addProductToCart,handleTextChange:y.handleTextChange,handleKeyDown:y.handleKeyDown,setFocused:y.setFocused,editingParam:re,editingIdentified:ge,editingAnchor:m.editingAnchor,caretOffset:m.caretOffset,startEditingParam:y.startEditingParam,exitEditMode:y.exitEditMode,handleCaretAfterInput:y.handleCaretAfterInput,handleCaretMove:y.handleCaretMove,replaceEditingRange:y.replaceEditingRange,inputProps:{value:Ge,placeholder:m.placeholderText||void 0,onChange:h,onKeyDown:Y,onFocus:y.handleFocus,onBlur:y.handleBlur,role:"combobox","aria-expanded":m.isDropdownOpen,"aria-activedescendant":Ke,"aria-autocomplete":"list","aria-controls":Ce},reset:y.reset,refreshProducts:y.refreshProducts,prepareSubmit:y.prepareSubmit,getState:y.getState,recordSubmit:y.recordSubmit,dropdownProps:{suggestions:Fe?[{...Fe,options:m.dropdownOptions}]:[],activeIndex:m.activeDropdownIndex,onSelect:y.selectOption,onHighlight:y.setActiveDropdownIndex,onUnhighlight:y.clearHighlight,isOpen:m.isDropdownOpen,id:Ce,pills:qe,activeSelected:m.isActivePillSelected,onPillClick:y.setActivePill,onSkip:y.skipActivePill,showSkipButton:(R??!0)&&!re&&!ge,showOptionIcons:D??!0,showOptionImages:H??!0,showOptionCounts:q??!0,skipDisabled:m.inSelectionAnimation,isLoading:_e,skeletonExiting:m.skeletonExiting,isInputEmpty:Ge.trim().length===0,language:s,products:m.products,productImageFallback:C,onProductSelect:y.selectProduct,onProductAddToCart:ve?y.addProductToCart:void 0,onProductFocusChange:y.setFocused,formatType:m.activeFormatType,dateView:m.dateView,selectedDateIso:Re.selectedIso,selectedDateRange:Re.selectedRange,dateRangeStart:Re.rangeStart,onPreviousMonth:y.showPreviousMonth,onNextMonth:y.showNextMonth,timeView:m.timeView,multiSelectView:m.multiSelectView,onMultiSelectCommit:y.commitMultiSelect,onTimeChange:y.setTime,onTimeCommit:y.commitTime,locationView:m.locationView,onLocationQuery:y.setLocationQuery,onLocationMove:y.moveLocationHighlight,onLocationCommit:y.commitLocation,onLocationFocusChange:y.setLocationFieldFocused,isFocused:m.isFocused||m.locationFieldFocused,optionsPosition:c??"below"}}}import{chipIdFromTap as xo,extractPlainText as wa,getCursorOffset as va,keepCaretOnChip as yo,plainTextLength as ko,renderEditableContent as Co,setCursorOffset as xa}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as de,useEffect as gt,useLayoutEffect as Lt,useRef as je}from"react";var ft;function So(){if(ft!==void 0)return ft;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),ft=e.contentEditable==="plaintext-only",ft}function ya(e){let{segments:i,showChipIcons:t=!0,showChipImages:a=!0,newParamId:o,editingParam:r,editingIdentified:n,editingAnchor:s,caretOffset:g,placeholderText:v,isFocused:x,isDropdownOpen:u,listboxId:d,activeDescendantId:c,autoFocus:w,handleTextChange:L,handleKeyDown:N,handleCaretAfterInput:D,handleCaretMove:H,startEditingParam:q,replaceEditingRange:R,setFocused:I}=e,C=je(null),V=je(!1),Q=je(""),B=je(""),F=je(null),ae=je(0);F.current=g,gt(()=>{if(!w)return;let b=C.current;if(!b)return;document.activeElement===b?I(!0):b.focus();let k=b.ownerDocument??document,S=k.getSelection(),A=S&&S.rangeCount>0&&b.contains(S.anchorNode);if(S&&!A){let O=k.createRange();O.selectNodeContents(b),O.collapse(!0),S.removeAllRanges(),S.addRange(O)}},[w,I]),gt(()=>{let b=C.current;if(!b)return;let k=b.ownerDocument??document,S=()=>{let A=k.getSelection();if(!A||A.rangeCount===0||!A.anchorNode||!b.contains(A.anchorNode))return;let O=A.anchorNode,U=O.nodeType===Node.ELEMENT_NODE?O:O.parentElement,oe=(A.isCollapsed?U?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,ce=r?.id??n?.id??null;if(oe&&oe!==ce){q(oe);return}performance.now()-ae.current<50||H(va(b))};return k.addEventListener("selectionchange",S),()=>k.removeEventListener("selectionchange",S)},[r,n,q,H]),gt(()=>{let b=C.current;if(!b)return;let k=S=>{let A=xo(b,S.target);A&&(q(A),yo(b,A))};return b.addEventListener("click",k),()=>b.removeEventListener("click",k)},[q]),Lt(()=>{let b=C.current;b&&Co({input:b,segments:i,newParamId:o,editingParamId:r?.id??null,placeholderText:v??"",isFocused:x,showChipIcons:t,showChipImages:a})},[i,o,r,v,x,t,a]),Lt(()=>{let b=Q.current,k=o??"";if(Q.current=k,!k||k===b)return;let S=C.current;if(!S)return;S.focus();let A=F.current??ko(S);xa(S,A)},[o]),Lt(()=>{let b=B.current,k=r?.id??"";if(B.current=k,!k||k===b||s==null)return;let S=C.current;S&&xa(S,s)},[r,s]);let P=de(()=>{if(V.current)return;let b=C.current;if(!b)return;let k=wa(b),A=k.length>0&&k[0]!==k[0].toUpperCase()?k[0].toUpperCase()+k.slice(1):k;L(A)},[L]),_=de(()=>{ae.current=performance.now(),P();let b=C.current;b&&D(va(b))},[P,D]);gt(()=>{let b=C.current;if(!b)return;let k=S=>{let A=S,O=A.inputType;if(O==="insertParagraph"||O==="insertLineBreak"||O==="insertFromDrop"){S.preventDefault();return}if(O.startsWith("insert")||O.startsWith("delete")){let U=O.startsWith("delete")?"":A.data??"";R(U)&&S.preventDefault()}};return b.addEventListener("beforeinput",k),()=>b.removeEventListener("beforeinput",k)},[R]);let p=de(()=>{V.current=!0,C.current?.setAttribute("data-aia-composing","true")},[]),E=de(()=>{V.current=!1,C.current?.removeAttribute("data-aia-composing"),P()},[P]),ve=de(b=>{b.preventDefault();let k=C.current;if(!k)return;let S=(b.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!S)return;let A=k.ownerDocument??document,O=A.getSelection();if(!O||O.rangeCount===0)return;let U=O.getRangeAt(0);if(!k.contains(U.startContainer))return;U.deleteContents();let ie=A.createTextNode(S);U.insertNode(ie),U.setStartAfter(ie),U.collapse(!0),O.removeAllRanges(),O.addRange(U),P()},[P]),De=de(b=>N(b),[N]),Pe=de(()=>I(!0),[I]),f=de(()=>I(!1),[I]),Me=de(()=>C.current?.focus(),[]),Ie=de(()=>C.current?.blur(),[]),Ee=de(()=>{let b=C.current;return b?wa(b):""},[]),Ae=So()?"plaintext-only":"true";return{inputRef:C,editorProps:{ref:C,contentEditable:Ae,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":d,"aria-expanded":u,"aria-activedescendant":c,spellCheck:!0,enterKeyHint:"send",onInput:_,onKeyDown:De,onCompositionStart:p,onCompositionEnd:E,onPaste:ve,onFocus:Pe,onBlur:f},getPlainText:Ee,focus:Me,blur:Ie}}import{jsx as Ze,jsxs as Dt}from"react/jsx-runtime";function Do(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Mo=To(function({onSubmit:i,onResult:t,onError:a,optionOverrides:o,maskCompletedText:r,className:n,apiConfig:s,additionalContext:g,language:v,currency:x,productId:u,visitorId:d,columns:c,pillPlacement:w="dropdown",mode:L="auto",optionsPosition:N="below",animations:D=!0,dropdownTrigger:H,closeDropdownOnBlur:q,showNonTappableOptions:R,locationSearch:I,showOptionIcons:C=!0,showChipIcons:V=!0,showChipImages:Q=!0,showOptionImages:B=!0,showOptionCounts:F=!0,showSkipButton:ae,showProducts:P,productsLayout:_,productImageFallback:p,autoFocus:E=!0,onFocus:ve,onBlur:De,value:Pe,completedParams:f,onChange:Me,onParamsChange:Ie,products:Ee,mapProducts:Ae,onProductSelect:b,onProductAddToCart:k,submitButton:S,resetOnSubmit:A=!0},O){let U=$e(null),ie=$e(null),oe=$e(null),ce=$e(()=>{}),pe=$e(null),ne=$e(null);Ot(()=>{let M=U.current;if(M)return pe.current?pe.current.setMode(L):pe.current=new Ao(M,L),()=>{pe.current?.destroy(),pe.current=null}},[L]);let ze=Rt(M=>{let ee=ne.current?.current;ee&&(ee.focus(),Lo(ee,M))},[]),{completedParams:Xe,suggestionPills:xe,setActivePill:Ne,skipActivePill:We,segments:ye,newParamId:J,clearNewParamId:he,placeholderText:y,isFocused:h,isDropdownOpen:Y,isActivePillSelected:ue,isLoading:m,isReady:Ge,activeIndex:ke,listboxId:me,handleTextChange:Je,handleKeyDown:et,setFocused:Ce,editingParam:Ke,editingIdentified:re,editingAnchor:ge,caretOffset:Le,startEditingParam:Fe,handleCaretAfterInput:qe,handleCaretMove:Re,replaceEditingRange:_e,dropdownProps:l,reset:T,refreshProducts:z,prepareSubmit:st,getState:Mt,recordSubmit:zt}=At({onSubmit:M=>ce.current(M),onResult:t,onError:a,optionOverrides:o,maskCompletedText:r,apiConfig:s,additionalContext:g,language:v,currency:x,productId:u,visitorId:d,columns:c,dropdownTrigger:H,optionsPosition:N,closeDropdownOnBlur:q,showNonTappableOptions:R,locationSearch:I,showOptionIcons:C,showOptionImages:B,showOptionCounts:F,showSkipButton:ae,showProducts:P,onFocus:ve,onBlur:De,value:Pe,completedParams:f,onChange:Me,onParamsChange:Ie,products:Ee,mapProducts:Ae,onProductSelect:b,onProductAddToCart:k,source:"full-sdk",setCursor:ze});Ot(()=>{if(!J)return;let M=window.setTimeout(()=>he(),650);return()=>window.clearTimeout(M)},[J,he]);let ka=ke>=0?`${me}-option-${ke}`:void 0,{inputRef:bt,editorProps:Ca,focus:lt,blur:Nt,getPlainText:Ft}=ya({segments:ye,newParamId:J,editingParam:Ke,editingIdentified:re,editingAnchor:ge,caretOffset:Le,placeholderText:y,isFocused:h,showChipIcons:V,showChipImages:Q,isDropdownOpen:Y,listboxId:me,activeDescendantId:ka,autoFocus:E,handleTextChange:Je,handleKeyDown:et,handleCaretAfterInput:qe,handleCaretMove:Re,startEditingParam:Fe,replaceEditingRange:_e,setFocused:Ce});ne.current=bt,Io(()=>{let M=ie.current,ee=bt.current;if(!M||!ee)return;let at=()=>{let Bt=M.firstElementChild;if(!Bt)return;let Ia=Bt.getBoundingClientRect(),Ea=ee.getBoundingClientRect();Ia.top>=Ea.bottom-2?M.setAttribute("data-aia-pill-wrapped",""):M.removeAttribute("data-aia-pill-wrapped")};at();let Ht=new ResizeObserver(at);return Ht.observe(ee),()=>Ht.disconnect()},[ye,xe.length,m,bt]),Ot(()=>{let M=oe.current;if(M)return Oo(M)},[]),Po(O,()=>({focus:lt,blur:Nt,reset:T,refreshProducts:z,setMode:M=>pe.current?.setMode(M),skipActivePill:We}),[lt,Nt,T,z,We]);let tt=!!ye.length||Xe.length>0,wt=Rt(M=>{if(!tt)return;M&&st();let ee=Mt(),at=Eo(Ft(),ee.completedParams,ee.skippedParams,{identifiedParams:ee.identifiedParams,isReady:ee.isReady,customFields:ee.customFields});M&&zt(at),i(at),A&&T()},[zt,A,tt,st,Mt,i,T,Ft]);ce.current=()=>wt(!1);let Sa=Rt(M=>{M.target?.closest("[data-aia-pill]")||document.activeElement?.closest("[data-aia-location]")||lt()},[lt]),Ta=w==="inline",Pa=w==="dropdown";return Dt("div",{ref:U,className:`magicx-aia ${He.container} ${n??""}`,"data-pill-placement":w,"data-options-position":N,"data-animations":D?"on":"off","data-mode":Do(L),children:[Ze(It,{...l,showPills:Pa,productsLayout:_,productImageFallback:p}),Dt("div",{className:He.inputWrapper,"data-aia-input-wrapper":"",onClick:Sa,children:[Dt("div",{ref:oe,className:He.editorArea,"data-aia-editor":"",children:[Ze("div",{...Ca,className:He.input,"data-aia-input":""}),Ta&&(m||xe.length>0)&&Ze("span",{ref:ie,className:He.pillListContainer,"data-aia-pill-list-container":"",children:Ze(ct,{pills:xe,activePillIndex:0,activeSelected:ue,onSelectPill:Ne,loading:m})})]}),S===null?null:S===void 0?Ze(pa,{disabled:!tt,ready:tt&&Ge,onClick:()=>wt(!0),label:Ro(v).submit}):Ze("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:He.submitSlot,onClick:M=>{tt&&(M.stopPropagation(),wt(!0))},children:S})]})]})});export{Mo as AIAutocomplete,It as AIAutocompleteDropdown,_r as DATE_RANGE_META_END,Ur as DATE_RANGE_META_START,Vr as DEFAULT_OPTION_COUNT_UNIT,es as LOCATION_META_KEY,ls as PRODUCT_PATH_PREFIX,ws as TIME_META_KEY,xs as WEEKDAY_LABELS,Gr as buildSubmitResult,Kr as cellDay,qr as cellIso,Qr as dateCellMarks,Yr as formatDate,jr as formatDateRange,$r as formatOptionCount,Zr as formatPlace,Xr as formatTime,Jr as isoDate,ts as monthLabel,as as optionCountLabel,is as optionHasImage,os as optionImageSources,ns as optionImageSrc,rs as optionLabel,ss as optionsShowLeadingVisuals,ds as parseDate,cs as parseLooseDate,ps as parseLooseDateRange,hs as parseTime,us as productFromMatchedItem,ms as productImageSources,gs as productsFromCustomFields,fs as sanitizeOptionIconSvg,bs as selectedRangeFor,At as useAIAutocomplete,vs as visibleDateRange,ys as withSkippedParams};
|
|
3325
|
+
`,document.head.appendChild(e)}var ha={submitButton:"aia-submitButton-otz7H"};import{jsx as Lt}from"react/jsx-runtime";function ua({disabled:e,ready:o,onClick:a,label:i=Co().submit}){return Lt("button",{type:"button","data-aia-submit":"",className:ha.submitButton,disabled:e,"data-aia-ready":o?"":void 0,onClick:n=>{n.stopPropagation(),a()},"aria-label":i,children:Lt("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":i,children:Lt("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}import{AIAutocomplete as So,dateSelectionFor as To,identifiedParamLabel as Po,withoutTraditionalAutocomplete as Io}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as wa,useEffect as $e,useRef as Z,useState as Eo}from"react";import{useRef as ma}from"react";function ga(e){let o=ma(e);o.current=e;let a=Object.keys(e??{}).sort().join("\0"),i=ma({key:"",overrides:void 0});if(i.current.key!==a){let n={};for(let s of Object.keys(e??{})){let r=(l,m,b)=>{let x=o.current?.[s];return x?x(l,m,b):[]};n[s]=r}i.current={key:a,overrides:e?n:void 0}}return{overrides:i.current.overrides,key:a}}import{useRef as fa}from"react";function ba(e){let o=fa(e);o.current=e;let a=fa(null);a.current===null&&(a.current={fetch:(n,s)=>{let r=o.current;return r?r.fetch(n,s):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?a.current:void 0,enabled:i}}var va={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 Ot({onSubmit:e,onResult:o,onError:a,optionOverrides:i,maskCompletedText:n,apiConfig:s,additionalContext:r,language:l,currency:m,productId:b,visitorId:x,columns:u=2,dropdownTrigger:c,optionsPosition:p,closeDropdownOnBlur:v,prependPlaceholder:A,showNonTappableOptions:N,locationSearch:L,showOptionIcons:F,showOptionImages:G,showOptionCounts:O,showSkipButton:E,showProducts:k,productImageFallback:X="image",onFocus:_,onBlur:J,value:z,completedParams:V,onChange:T,onParamsChange:K,products:h,mapProducts:P,onProductSelect:Pe,onProductAddToCart:be,source:De,setCursor:we}){let g=Z(null),[Me,Ie]=Eo(null),Ee=Z(e);Ee.current=e;let f=Z(o);f.current=o;let C=Z(a);C.current=a;let S=Z(T);S.current=T;let I=Z(K);I.current=K;let R=Z(_);R.current=_;let U=Z(J);U.current=J;let te=Z(we);te.current=we;let oe=Z(Pe);oe.current=Pe;let ne=Z(be);ne.current=be;let ze=Z(x);ze.current=x;let q=Z(()=>{let d=ze.current;return typeof d=="function"?d():d}).current,ve=ba(h),qe=Z(P);qe.current=P;let et=Z((d,y)=>{let M=qe.current;return M?M(d,y):d}).current,xe=P?et:void 0,Ne=ga(i);$e(()=>{if(typeof document>"u")return;let d=new So(document.createElement("div"),{renderMode:"headless",apiConfig:s,additionalContext:r,language:l,currency:m,productId:b,visitorId:q,optionOverrides:Ne.overrides,maskCompletedText:n,columns:u,dropdownTrigger:c,optionsPosition:p,closeDropdownOnBlur:v,prependPlaceholder:A,showNonTappableOptions:N,locationSearch:L,showProducts:k,source:De,value:z,completedParams:V,onSubmit:(...M)=>Ee.current?.(...M),onResult:(...M)=>f.current?.(...M),onError:(...M)=>C.current?.(...M),onChange:(...M)=>S.current?.(...M),onParamsChange:(...M)=>I.current?.(...M),onFocus:()=>R.current?.(),onBlur:()=>U.current?.(),onProductSelect:M=>oe.current?.(M),onProductAddToCart:M=>ne.current?.(M),setCursor:M=>te.current?.(M),products:ve.config,mapProducts:xe});g.current=d,Ie(d.getState());let y=d.subscribe(M=>Ie(M));return()=>{y(),d.destroy(),g.current===d&&(g.current=null)}},[]),$e(()=>{z!==void 0&&g.current?.setValue(z)},[z]),$e(()=>{V!==void 0&&g.current?.setCompletedParams(V)},[V]);let _e=JSON.stringify(s??null),Q;try{Q=JSON.stringify(r??null)}catch{Q="[unstringifiable]"}$e(()=>{g.current?.update({apiConfig:s,additionalContext:r,language:l,currency:m,productId:b,optionOverrides:Ne.overrides,dropdownTrigger:c,optionsPosition:p,closeDropdownOnBlur:v,prependPlaceholder:A,showNonTappableOptions:N,locationSearch:L,showProducts:k})},[_e,Q,l,m?.code,m?.rate,m?.country,b,Ne.key,c,p,v,A,N,L,k]);let pe=Z(!1);$e(()=>{if(!pe.current){pe.current=!0;return}g.current?.update({products:ve.config})},[ve.enabled]),$e(()=>{g.current?.update({mapProducts:xe})},[xe]);let ye=Z(null);ye.current===null&&(ye.current={handleTextChange:d=>g.current?.handleTextChange(d),handleKeyDown:d=>{let y="nativeEvent"in d?d.nativeEvent:d;g.current?.handleKeyDown(y)},setFocused:d=>g.current?.setFocused(d),startEditingParam:d=>g.current?.startEditingParam(d),exitEditMode:()=>g.current?.exitEditMode(),handleCaretAfterInput:d=>g.current?.handleCaretAfterInput(d),handleCaretMove:d=>g.current?.handleCaretMove(d),replaceEditingRange:d=>g.current?.replaceEditingRange(d)??!1,setActivePill:d=>g.current?.setActivePill(d),skipActivePill:()=>g.current?.skipActivePill(),removeLastParam:()=>g.current?.removeLastParam(),clearNewParamId:()=>g.current?.clearNewParamId(),reset:()=>g.current?.reset(),refreshProducts:()=>g.current?.refreshProducts(),prepareSubmit:()=>g.current?.prepareSubmit(),getState:()=>g.current?.getState()??va,recordSubmit:d=>g.current?.recordSubmit(d),selectOption:(d,y)=>g.current?.selectOption(d,y),selectProduct:d=>g.current?.selectProduct(d),addProductToCart:d=>{let y=g.current;return!y||!ne.current?Promise.resolve():y.addProductToCart(d)},setActiveDropdownIndex:d=>g.current?.setActiveDropdownIndex(d),clearHighlight:d=>g.current?.clearHighlight(d),showPreviousMonth:()=>g.current?.showPreviousMonth(),showNextMonth:()=>g.current?.showNextMonth(),setTime:d=>g.current?.setTime(d),commitTime:()=>g.current?.commitTime(),toggleMultiSelectOption:d=>g.current?.toggleMultiSelectOption(d),commitMultiSelect:()=>g.current?.commitMultiSelect(),setLocationQuery:d=>g.current?.setLocationQuery(d),moveLocationHighlight:d=>g.current?.moveLocationHighlight(d),commitLocation:d=>g.current?.commitLocation(d),setLocationFieldFocused:d=>g.current?.setLocationFieldFocused(d),handleFocus:()=>g.current?.setFocused(!0),handleBlur:()=>g.current?.setFocused(!1)});let t=ye.current,Y=wa(d=>{let y=d.target.value,lt=y.length>0&&!d.nativeEvent?.isComposing&&y[0]!==y[0].toUpperCase()?y[0].toUpperCase()+y.slice(1):y;g.current?.handleTextChange(lt)},[]),Ae=wa(d=>{g.current?.handleKeyDown(d.nativeEvent)},[]),re=g.current,w=Me??va,he=z!==void 0?z:w.text,Le=V!==void 0?V:w.completedParams,ke=w.actionableSuggestions,tt=ke[0],Ve=Io(ke),Ce=re?.listboxId??"",Ue=w.activeDropdownIndex>=0&&re?`${Ce}-option-${w.activeDropdownIndex}`:void 0,se=w.editingParam,ue=w.editingIdentified,Oe=se?{parameter:se.suggestionParameter,text:se.suggestionPlaceholder,required:!0,options:se.options}:ue?{parameter:ue.parameter,text:Po(ue.parameter),required:!0,options:[]}:null,Fe=w.dropdownSuggestion??Oe??tt,Qe=Oe?[Oe]:ke,He=To(w),Be=!re||w.dropdownLoading;return{completedParams:Le,multiSelectView:w.multiSelectView,toggleMultiSelectOption:t.toggleMultiSelectOption,commitMultiSelect:t.commitMultiSelect,skippedParams:w.skippedParams,identifiedParams:w.identifiedParams,suggestionPills:Ve,setActivePill:t.setActivePill,skipActivePill:t.skipActivePill,removeLastParam:t.removeLastParam,segments:w.segments,newParamId:w.newParamId,clearNewParamId:t.clearNewParamId,suggestions:w.suggestions,activeIndex:w.activeDropdownIndex,isReady:w.isReady,isLoading:Be,isFocused:w.isFocused,isDropdownOpen:w.isDropdownOpen,isActivePillSelected:w.isActivePillSelected,placeholderText:w.placeholderText,listboxId:Ce,error:w.error,products:w.products,customFields:w.customFields,selectProduct:t.selectProduct,addProductToCart:t.addProductToCart,handleTextChange:t.handleTextChange,handleKeyDown:t.handleKeyDown,setFocused:t.setFocused,editingParam:se,editingIdentified:ue,editingAnchor:w.editingAnchor,caretOffset:w.caretOffset,startEditingParam:t.startEditingParam,exitEditMode:t.exitEditMode,handleCaretAfterInput:t.handleCaretAfterInput,handleCaretMove:t.handleCaretMove,replaceEditingRange:t.replaceEditingRange,inputProps:{value:he,placeholder:w.placeholderText||void 0,onChange:Y,onKeyDown:Ae,onFocus:t.handleFocus,onBlur:t.handleBlur,role:"combobox","aria-expanded":w.isDropdownOpen,"aria-activedescendant":Ue,"aria-autocomplete":"list","aria-controls":Ce},reset:t.reset,refreshProducts:t.refreshProducts,prepareSubmit:t.prepareSubmit,getState:t.getState,recordSubmit:t.recordSubmit,dropdownProps:{suggestions:Fe?[{...Fe,options:w.dropdownOptions}]:[],activeIndex:w.activeDropdownIndex,onSelect:t.selectOption,onHighlight:t.setActiveDropdownIndex,onUnhighlight:t.clearHighlight,isOpen:w.isDropdownOpen,id:Ce,pills:Qe,activeSelected:w.isActivePillSelected,onPillClick:t.setActivePill,onSkip:t.skipActivePill,showSkipButton:(E??!0)&&!se&&!ue,showOptionIcons:F??!0,showOptionImages:G??!0,showOptionCounts:O??!0,skipDisabled:w.inSelectionAnimation,isLoading:Be,skeletonExiting:w.skeletonExiting,isInputEmpty:he.trim().length===0,language:l,products:w.products,productImageFallback:X,onProductSelect:t.selectProduct,onProductAddToCart:be?t.addProductToCart:void 0,onProductFocusChange:t.setFocused,formatType:w.activeFormatType,dateView:w.dateView,selectedDateIso:He.selectedIso,selectedDateRange:He.selectedRange,dateRangeStart:He.rangeStart,onPreviousMonth:t.showPreviousMonth,onNextMonth:t.showNextMonth,timeView:w.timeView,multiSelectView:w.multiSelectView,onMultiSelectCommit:t.commitMultiSelect,onTimeChange:t.setTime,onTimeCommit:t.commitTime,locationView:w.locationView,onLocationQuery:t.setLocationQuery,onLocationMove:t.moveLocationHighlight,onLocationCommit:t.commitLocation,onLocationFocusChange:t.setLocationFieldFocused,isFocused:w.isFocused||w.locationFieldFocused,optionsPosition:p??"below"}}}import{chipIdFromTap as Ao,extractPlainText as xa,getCursorOffset as ya,keepCaretOnChip as Lo,plainTextLength as Oo,renderEditableContent as Ro,setCursorOffset as ka}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as ce,useEffect as ft,useLayoutEffect as Rt,useRef as Ze}from"react";var bt;function Do(){if(bt!==void 0)return bt;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),bt=e.contentEditable==="plaintext-only",bt}function Ca(e){let{segments:o,showChipIcons:a=!0,showChipImages:i=!0,newParamId:n,editingParam:s,editingIdentified:r,editingAnchor:l,caretOffset:m,placeholderText:b,isFocused:x,isDropdownOpen:u,listboxId:c,activeDescendantId:p,autoFocus:v,handleTextChange:A,handleKeyDown:N,handleCaretAfterInput:L,handleCaretMove:F,startEditingParam:G,replaceEditingRange:O,setFocused:E}=e,k=Ze(null),X=Ze(!1),_=Ze(""),J=Ze(""),z=Ze(null),V=Ze(0);z.current=m,ft(()=>{if(!v)return;let f=k.current;if(!f)return;document.activeElement===f?E(!0):f.focus();let C=f.ownerDocument??document,S=C.getSelection(),I=S&&S.rangeCount>0&&f.contains(S.anchorNode);if(S&&!I){let R=C.createRange();R.selectNodeContents(f),R.collapse(!0),S.removeAllRanges(),S.addRange(R)}},[v,E]),ft(()=>{let f=k.current;if(!f)return;let C=f.ownerDocument??document,S=()=>{let I=C.getSelection();if(!I||I.rangeCount===0||!I.anchorNode||!f.contains(I.anchorNode))return;let R=I.anchorNode,U=R.nodeType===Node.ELEMENT_NODE?R:R.parentElement,oe=(I.isCollapsed?U?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,ne=s?.id??r?.id??null;if(oe&&oe!==ne){G(oe);return}performance.now()-V.current<50||F(ya(f))};return C.addEventListener("selectionchange",S),()=>C.removeEventListener("selectionchange",S)},[s,r,G,F]),ft(()=>{let f=k.current;if(!f)return;let C=S=>{let I=Ao(f,S.target);I&&(G(I),Lo(f,I))};return f.addEventListener("click",C),()=>f.removeEventListener("click",C)},[G]),Rt(()=>{let f=k.current;f&&Ro({input:f,segments:o,newParamId:n,editingParamId:s?.id??null,placeholderText:b??"",isFocused:x,showChipIcons:a,showChipImages:i})},[o,n,s,b,x,a,i]),Rt(()=>{let f=_.current,C=n??"";if(_.current=C,!C||C===f)return;let S=k.current;if(!S)return;S.focus();let I=z.current??Oo(S);ka(S,I)},[n]),Rt(()=>{let f=J.current,C=s?.id??"";if(J.current=C,!C||C===f||l==null)return;let S=k.current;S&&ka(S,l)},[s,l]);let T=ce(()=>{if(X.current)return;let f=k.current;if(!f)return;let C=xa(f),I=C.length>0&&C[0]!==C[0].toUpperCase()?C[0].toUpperCase()+C.slice(1):C;A(I)},[A]),K=ce(()=>{V.current=performance.now(),T();let f=k.current;f&&L(ya(f))},[T,L]);ft(()=>{let f=k.current;if(!f)return;let C=S=>{let I=S,R=I.inputType;if(R==="insertParagraph"||R==="insertLineBreak"||R==="insertFromDrop"){S.preventDefault();return}if(R.startsWith("insert")||R.startsWith("delete")){let U=R.startsWith("delete")?"":I.data??"";O(U)&&S.preventDefault()}};return f.addEventListener("beforeinput",C),()=>f.removeEventListener("beforeinput",C)},[O]);let h=ce(()=>{X.current=!0,k.current?.setAttribute("data-aia-composing","true")},[]),P=ce(()=>{X.current=!1,k.current?.removeAttribute("data-aia-composing"),T()},[T]),Pe=ce(f=>{f.preventDefault();let C=k.current;if(!C)return;let S=(f.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!S)return;let I=C.ownerDocument??document,R=I.getSelection();if(!R||R.rangeCount===0)return;let U=R.getRangeAt(0);if(!C.contains(U.startContainer))return;U.deleteContents();let te=I.createTextNode(S);U.insertNode(te),U.setStartAfter(te),U.collapse(!0),R.removeAllRanges(),R.addRange(U),T()},[T]),be=ce(f=>N(f),[N]),De=ce(()=>E(!0),[E]),we=ce(()=>E(!1),[E]),g=ce(()=>k.current?.focus(),[]),Me=ce(()=>k.current?.blur(),[]),Ie=ce(()=>{let f=k.current;return f?xa(f):""},[]),Ee=Do()?"plaintext-only":"true";return{inputRef:k,editorProps:{ref:k,contentEditable:Ee,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":c,"aria-expanded":u,"aria-activedescendant":p,spellCheck:!0,enterKeyHint:"send",onInput:K,onKeyDown:be,onCompositionStart:h,onCompositionEnd:P,onPaste:Pe,onFocus:De,onBlur:we},getPlainText:Ie,focus:g,blur:Me}}import{jsx as Je,jsxs as zt}from"react/jsx-runtime";function Go(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var qo=Mo(function({onSubmit:o,onResult:a,onError:i,optionOverrides:n,maskCompletedText:s,className:r,apiConfig:l,additionalContext:m,language:b,currency:x,productId:u,visitorId:c,columns:p,pillPlacement:v="dropdown",mode:A="auto",optionsPosition:N="below",animations:L=!0,dropdownTrigger:F,closeDropdownOnBlur:G,prependPlaceholder:O,showNonTappableOptions:E,locationSearch:k,showOptionIcons:X=!0,showChipIcons:_=!0,showChipImages:J=!0,showOptionImages:z=!0,showOptionCounts:V=!0,showSkipButton:T,showProducts:K,productsLayout:h,productImageFallback:P,autoFocus:Pe=!0,onFocus:be,onBlur:De,value:we,completedParams:g,onChange:Me,onParamsChange:Ie,products:Ee,mapProducts:f,onProductSelect:C,onProductAddToCart:S,submitButton:I,resetOnSubmit:R=!0},U){let te=Xe(null),oe=Xe(null),ne=Xe(null),ze=Xe(()=>{}),q=Xe(null),ve=Xe(null);Mt(()=>{let D=te.current;if(D)return q.current?q.current.setMode(A):q.current=new Ho(D,A),()=>{q.current?.destroy(),q.current=null}},[A]);let qe=Dt(D=>{let ae=ve.current?.current;ae&&(ae.focus(),Bo(ae,D))},[]),{completedParams:et,suggestionPills:xe,setActivePill:Ne,skipActivePill:_e,segments:Q,newParamId:pe,clearNewParamId:ye,placeholderText:t,isFocused:Y,isDropdownOpen:Ae,isActivePillSelected:re,isLoading:w,isReady:he,activeIndex:Le,listboxId:ke,handleTextChange:tt,handleKeyDown:Ve,setFocused:Ce,editingParam:Ue,editingIdentified:se,editingAnchor:ue,caretOffset:Oe,startEditingParam:Fe,handleCaretAfterInput:Qe,handleCaretMove:He,replaceEditingRange:Be,dropdownProps:d,reset:y,refreshProducts:M,prepareSubmit:lt,getState:Nt,recordSubmit:Ft}=Ot({onSubmit:D=>ze.current(D),onResult:a,onError:i,optionOverrides:n,maskCompletedText:s,apiConfig:l,additionalContext:m,language:b,currency:x,productId:u,visitorId:c,columns:p,dropdownTrigger:F,optionsPosition:N,closeDropdownOnBlur:G,prependPlaceholder:O,showNonTappableOptions:E,locationSearch:k,showOptionIcons:X,showOptionImages:z,showOptionCounts:V,showSkipButton:T,showProducts:K,onFocus:be,onBlur:De,value:we,completedParams:g,onChange:Me,onParamsChange:Ie,products:Ee,mapProducts:f,onProductSelect:C,onProductAddToCart:S,source:"full-sdk",setCursor:qe});Mt(()=>{if(!pe)return;let D=window.setTimeout(()=>ye(),650);return()=>window.clearTimeout(D)},[pe,ye]);let Sa=Le>=0?`${ke}-option-${Le}`:void 0,{inputRef:wt,editorProps:Ta,focus:dt,blur:Ht,getPlainText:Bt}=Ca({segments:Q,newParamId:pe,editingParam:Ue,editingIdentified:se,editingAnchor:ue,caretOffset:Oe,placeholderText:t,isFocused:Y,showChipIcons:_,showChipImages:J,isDropdownOpen:Ae,listboxId:ke,activeDescendantId:Sa,autoFocus:Pe,handleTextChange:tt,handleKeyDown:Ve,handleCaretAfterInput:Qe,handleCaretMove:He,startEditingParam:Fe,replaceEditingRange:Be,setFocused:Ce});ve.current=wt,No(()=>{let D=oe.current,ae=wt.current;if(!D||!ae)return;let it=()=>{let Kt=D.firstElementChild;if(!Kt)return;let Aa=Kt.getBoundingClientRect(),La=ae.getBoundingClientRect();Aa.top>=La.bottom-2?D.setAttribute("data-aia-pill-wrapped",""):D.removeAttribute("data-aia-pill-wrapped")};it();let Wt=new ResizeObserver(it);return Wt.observe(ae),()=>Wt.disconnect()},[Q,xe.length,w,wt]),Mt(()=>{let D=ne.current;if(D)return Ko(D)},[]),zo(U,()=>({focus:dt,blur:Ht,reset:y,refreshProducts:M,setMode:D=>q.current?.setMode(D),skipActivePill:_e}),[dt,Ht,y,M,_e]);let at=!!Q.length||et.length>0,vt=Dt(D=>{if(!at)return;D&<();let ae=Nt(),it=Fo(Bt(),ae.completedParams,ae.skippedParams,{identifiedParams:ae.identifiedParams,isReady:ae.isReady,customFields:ae.customFields});D&&Ft(it),o(it),R&&y()},[Ft,R,at,lt,Nt,o,y,Bt]);ze.current=()=>vt(!1);let Pa=Dt(D=>{D.target?.closest("[data-aia-pill]")||document.activeElement?.closest("[data-aia-location]")||dt()},[dt]),Ia=v==="inline",Ea=v==="dropdown";return zt("div",{ref:te,className:`magicx-aia ${We.container} ${r??""}`,"data-pill-placement":v,"data-options-position":N,"data-animations":L?"on":"off","data-mode":Go(A),children:[Je(At,{...d,showPills:Ea,productsLayout:h,productImageFallback:P}),zt("div",{className:We.inputWrapper,"data-aia-input-wrapper":"",onClick:Pa,children:[zt("div",{ref:ne,className:We.editorArea,"data-aia-editor":"",children:[Je("div",{...Ta,className:We.input,"data-aia-input":""}),Ia&&(w||xe.length>0)&&Je("span",{ref:oe,className:We.pillListContainer,"data-aia-pill-list-container":"",children:Je(pt,{pills:xe,activePillIndex:0,activeSelected:re,onSelectPill:Ne,loading:w})})]}),I===null?null:I===void 0?Je(ua,{disabled:!at,ready:at&&he,onClick:()=>vt(!0),label:Wo(b).submit}):Je("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:We.submitSlot,onClick:D=>{at&&(D.stopPropagation(),vt(!0))},children:I})]})]})});export{qo as AIAutocomplete,At as AIAutocompleteDropdown,Jr as DATE_RANGE_META_END,es as DATE_RANGE_META_START,ts as DEFAULT_OPTION_COUNT_UNIT,ds as LOCATION_META_KEY,bs as PRODUCT_PATH_PREFIX,Is as TIME_META_KEY,As as WEEKDAY_LABELS,$r as buildSubmitResult,Zr as cellDay,Xr as cellIso,as as dateCellMarks,is as formatDate,os as formatDateRange,ns as formatOptionCount,rs as formatPlace,ss as formatTime,ls as isoDate,cs as monthLabel,ps as optionCountLabel,hs as optionHasImage,us as optionImageSources,ms as optionImageSrc,gs as optionLabel,fs as optionsShowLeadingVisuals,ws as parseDate,vs as parseLooseDate,xs as parseLooseDateRange,ys as parseTime,ks as productFromMatchedItem,Cs as productImageSources,Ss as productsFromCustomFields,Ts as sanitizeOptionIconSvg,Ps as selectedRangeFor,Ot as useAIAutocomplete,Es as visibleDateRange,Ls as withSkippedParams};
|
|
3208
3326
|
//# sourceMappingURL=index.mjs.map
|