@magicx-eng/ai-autocomplete-react 0.67.2 → 0.67.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{buildSubmitResult as Ks,cellDay as qs,cellIso as _s,DATE_RANGE_META_END as Vs,DATE_RANGE_META_START as Us,DEFAULT_OPTION_COUNT_UNIT as Qs,dateCellMarks as Ys,focusesInputOnSelect as js,formatDate as $s,formatDateRange as Zs,formatOptionCount as Xs,formatPlace as Js,formatTime as el,isoDate as tl,isTouchPrimary as al,LOCATION_META_KEY as il,monthLabel as ol,optionCountLabel as nl,optionHasImage as rl,optionImageSources as sl,optionImageSrc as ll,optionLabel as dl,optionsShowLeadingVisuals as cl,PRODUCT_PATH_PREFIX as pl,parseDate as hl,parseLooseDate as ul,parseLooseDateRange as ml,parseTime as gl,productFromMatchedItem as fl,productImageSources as bl,productsFromCustomFields as wl,sanitizeOptionIconSvg as vl,selectedRangeFor as xl,TIME_META_KEY as yl,visibleDateRange as kl,WEEKDAY_LABELS as Sl,withSkippedParams as Cl}from"@magicx-eng/ai-autocomplete-vanilla";import{forwardRef as Tn,useCallback as Mt,useEffect as Jt,useImperativeHandle as Pn,useLayoutEffect as In,useMemo as An,useRef as gt}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-
|
|
1
|
+
import{buildSubmitResult as Ks,cellDay as qs,cellIso as _s,DATE_RANGE_META_END as Vs,DATE_RANGE_META_START as Us,DEFAULT_OPTION_COUNT_UNIT as Qs,dateCellMarks as Ys,focusesInputOnSelect as js,formatDate as $s,formatDateRange as Zs,formatOptionCount as Xs,formatPlace as Js,formatTime as el,isoDate as tl,isTouchPrimary as al,LOCATION_META_KEY as il,monthLabel as ol,optionCountLabel as nl,optionHasImage as rl,optionImageSources as sl,optionImageSrc as ll,optionLabel as dl,optionsShowLeadingVisuals as cl,PRODUCT_PATH_PREFIX as pl,parseDate as hl,parseLooseDate as ul,parseLooseDateRange as ml,parseTime as gl,productFromMatchedItem as fl,productImageSources as bl,productsFromCustomFields as wl,sanitizeOptionIconSvg as vl,selectedRangeFor as xl,TIME_META_KEY as yl,visibleDateRange as kl,WEEKDAY_LABELS as Sl,withSkippedParams as Cl}from"@magicx-eng/ai-autocomplete-vanilla";import{forwardRef as Tn,useCallback as Mt,useEffect as Jt,useImperativeHandle as Pn,useLayoutEffect as In,useMemo as An,useRef as gt}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-16d653d7")){let e=document.createElement("style");e.id="ac-style-16d653d7",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
|
|
@@ -463,7 +463,7 @@ import{buildSubmitResult as Ks,cellDay as qs,cellIso as _s,DATE_RANGE_META_END a
|
|
|
463
463
|
transition: none;
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
`,document.head.appendChild(e)}var Je={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 Ao,attachViewportFit as Eo,containScroll as Ro,dateFloorFor as zo,destroyPanelMorph as Lo,findMultiSelectDone as Oo,fitMultiSelectDone as Do,hasSkippablePill as Mo,isCalendarFormat as No,labelTraditionalAutocomplete as Fo,panelMorphKey as Ho,queryLive as Bo,settlePanelMorph as Wo,syncPanelHug as Go,uiStringsFor as Ko}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as tt,useLayoutEffect as Yt,useRef as ut,useState as qo}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-
|
|
466
|
+
`,document.head.appendChild(e)}var Je={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 Ao,attachViewportFit as Eo,containScroll as Ro,dateFloorFor as zo,destroyPanelMorph as Lo,findMultiSelectDone as Oo,fitMultiSelectDone as Do,hasSkippablePill as Mo,isCalendarFormat as No,labelTraditionalAutocomplete as Fo,panelMorphKey as Ho,queryLive as Bo,settlePanelMorph as Wo,syncPanelHug as Go,uiStringsFor as Ko}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as tt,useLayoutEffect as Yt,useRef as ut,useState as qo}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-a59da7e4")){let e=document.createElement("style");e.id="ac-style-a59da7e4",e.textContent=`/*
|
|
467
467
|
* Built-in appearance defaults \u2014 zero specificity via :where().
|
|
468
468
|
* Consumer CSS always wins without !important.
|
|
469
469
|
*
|
|
@@ -1334,7 +1334,7 @@ import{buildSubmitResult as Ks,cellDay as qs,cellIso as _s,DATE_RANGE_META_END a
|
|
|
1334
1334
|
padding-inline: 8px;
|
|
1335
1335
|
font-size: var(--aia-skip-font-size, 13.5px);
|
|
1336
1336
|
}
|
|
1337
|
-
`,document.head.appendChild(e)}if(typeof document<"u"&&!document.getElementById("ac-style-
|
|
1337
|
+
`,document.head.appendChild(e)}if(typeof document<"u"&&!document.getElementById("ac-style-7265c9a6")){let e=document.createElement("style");e.id="ac-style-7265c9a6",e.textContent=`.aia-dropdown-yz2KC {
|
|
1338
1338
|
position: absolute;
|
|
1339
1339
|
left: 0;
|
|
1340
1340
|
right: 0;
|
|
@@ -1837,7 +1837,7 @@ import{buildSubmitResult as Ks,cellDay as qs,cellIso as _s,DATE_RANGE_META_END a
|
|
|
1837
1837
|
opacity: 1;
|
|
1838
1838
|
}
|
|
1839
1839
|
}
|
|
1840
|
-
`,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",skeletonBar:"aia-skeletonBar-O3xIx",multiDone:"aia-multiDone-y12U7",seeAllRow:"aia-seeAllRow-icrau",seeAll:"aia-seeAll-0Zbgc",seeAllSpin:"aia-seeAllSpin-jlsZP",multiActionsLoadingOut:"aia-multiActionsLoadingOut-lSdMh",multiActionsFadeIn:"aia-multiActionsFadeIn-zbGTG",seeAllLoadingOut:"aia-seeAllLoadingOut-THnrl",seeAllFadeIn:"aia-seeAllFadeIn-1GWpl"};import{cellDay as si,cellIso as vt,dateCellMarks as li,isDimmedDay as di,isoDate as ci,monthLabel as pi,visibleDateRange as hi,WEEKDAY_LABELS as ui}from"@magicx-eng/ai-autocomplete-vanilla";import{useState as mi}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-
|
|
1840
|
+
`,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",skeletonBar:"aia-skeletonBar-O3xIx",multiDone:"aia-multiDone-y12U7",seeAllRow:"aia-seeAllRow-icrau",seeAll:"aia-seeAll-0Zbgc",seeAllSpin:"aia-seeAllSpin-jlsZP",multiActionsLoadingOut:"aia-multiActionsLoadingOut-lSdMh",multiActionsFadeIn:"aia-multiActionsFadeIn-zbGTG",seeAllLoadingOut:"aia-seeAllLoadingOut-THnrl",seeAllFadeIn:"aia-seeAllFadeIn-1GWpl"};import{cellDay as si,cellIso as vt,dateCellMarks as li,isDimmedDay as di,isoDate as ci,monthLabel as pi,visibleDateRange as hi,WEEKDAY_LABELS as ui}from"@magicx-eng/ai-autocomplete-vanilla";import{useState as mi}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-6f248982")){let e=document.createElement("style");e.id="ac-style-6f248982",e.textContent=`/* --- Datepicker (replaces the options grid for date suggestions) ---
|
|
1841
1841
|
|
|
1842
1842
|
One of three hand-maintained copies (vanilla styles.css, this file, Angular's
|
|
1843
1843
|
date-grid.component.css). Only the class-naming layer differs \u2014 the
|
|
@@ -2034,7 +2034,7 @@ import{buildSubmitResult as Ks,cellDay as qs,cellIso as _s,DATE_RANGE_META_END a
|
|
|
2034
2034
|
opacity: 0.8;
|
|
2035
2035
|
background: rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);
|
|
2036
2036
|
}
|
|
2037
|
-
`,document.head.appendChild(e)}var _={datepicker:"aia-datepicker-6RrTs",header:"aia-header-z4LRk",month:"aia-month-urB2T",nav:"aia-nav-ap4AN",weekdays:"aia-weekdays-3EA3q",grid:"aia-grid-mQCgw",weekday:"aia-weekday-3lF4B",cell:"aia-cell-59k0y",number:"aia-number-aoT01",day:"aia-day-cB3u9",blank:"aia-blank-ivgRC",past:"aia-past-CEZsj",highlighted:"aia-highlighted-YIdtK",today:"aia-today-iI3ME",inRange:"aia-inRange-r9S2q",selected:"aia-selected-28KDn",reference:"aia-reference-Q5bXf",pressed:"aia-pressed-bEyyN"};import{jsx as Te,jsxs as ha}from"react/jsx-runtime";var gi=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function ua({options:e,activeIndex:r,listboxId:t,view:o,selection:n,onSelect:l,onHighlight:s,onUnhighlight:c,onPreviousMonth:w,onNextMonth:v}){let y=ci(new Date),m=hi({pendingStart:n.rangeStart,highlightedIso:vt(e[r]),selected:n.selectedRange,floor:n.floor});return ha("div",{className:_.datepicker,"data-aia-datepicker":"",children:[ha("div",{className:_.header,children:[Te("button",{type:"button",tabIndex:-1,className:_.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:u=>u.preventDefault(),onClick:w,children:"\u2039"}),Te("span",{className:_.month,"data-aia-date-month":"","aria-live":"polite",children:pi(o)}),Te("button",{type:"button",tabIndex:-1,className:_.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:u=>u.preventDefault(),onClick:v,children:"\u203A"})]}),Te("div",{className:_.weekdays,"aria-hidden":"true",children:ui.map((u,p)=>Te("span",{className:_.weekday,children:u},gi[p]))}),Te("div",{className:_.grid,"data-aia-date-grid":"",children:e.map((u,p)=>Te(fi,{option:u,id:`${t}-option-${p}`,index:p,isHighlighted:p===r&&u.is_tappable,isToday:vt(u)===y,isPast:di(vt(u),y,n.floor),marks:li(vt(u),{selectedIso:n.selectedIso,range:m,references:n.references}),onSelect:l,onHighlight:s,onUnhighlight:c},vt(u)??`pad-${p}`))})]})}function fi({option:e,id:r,index:t,isHighlighted:o,isToday:n,isPast:l,marks:s,onSelect:c,onHighlight:w,onUnhighlight:v}){let[y,m]=mi(!1),u=si(e);if(u==null)return Te("div",{id:r,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${_.cell} ${_.blank}`});let p=()=>{m(!0),c(e),setTimeout(()=>m(!1),170)},k=[_.cell,_.day,l?_.past:"",o?_.highlighted:"",n?_.today:"",s.inRange?_.inRange:"",s.selected?_.selected:"",s.reference?_.reference:"",y?_.pressed:""].filter(Boolean).join(" ");return Te("div",{id:r,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":o,"aria-label":e.text,tabIndex:0,className:k,onClick:p,onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),p())},onMouseEnter:()=>w(t),onMouseLeave:v?()=>v(t):void 0,children:Te("span",{className:_.number,children:u})})}import{ATTRIBUTION_URL as bi,buildAttributionUrl as wi,getFooterHint as vi,uiStringsFor as xi}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as yi,useState as ki}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-
|
|
2037
|
+
`,document.head.appendChild(e)}var _={datepicker:"aia-datepicker-6RrTs",header:"aia-header-z4LRk",month:"aia-month-urB2T",nav:"aia-nav-ap4AN",weekdays:"aia-weekdays-3EA3q",grid:"aia-grid-mQCgw",weekday:"aia-weekday-3lF4B",cell:"aia-cell-59k0y",number:"aia-number-aoT01",day:"aia-day-cB3u9",blank:"aia-blank-ivgRC",past:"aia-past-CEZsj",highlighted:"aia-highlighted-YIdtK",today:"aia-today-iI3ME",inRange:"aia-inRange-r9S2q",selected:"aia-selected-28KDn",reference:"aia-reference-Q5bXf",pressed:"aia-pressed-bEyyN"};import{jsx as Te,jsxs as ha}from"react/jsx-runtime";var gi=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function ua({options:e,activeIndex:r,listboxId:t,view:o,selection:n,onSelect:l,onHighlight:s,onUnhighlight:c,onPreviousMonth:w,onNextMonth:v}){let y=ci(new Date),m=hi({pendingStart:n.rangeStart,highlightedIso:vt(e[r]),selected:n.selectedRange,floor:n.floor});return ha("div",{className:_.datepicker,"data-aia-datepicker":"",children:[ha("div",{className:_.header,children:[Te("button",{type:"button",tabIndex:-1,className:_.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:u=>u.preventDefault(),onClick:w,children:"\u2039"}),Te("span",{className:_.month,"data-aia-date-month":"","aria-live":"polite",children:pi(o)}),Te("button",{type:"button",tabIndex:-1,className:_.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:u=>u.preventDefault(),onClick:v,children:"\u203A"})]}),Te("div",{className:_.weekdays,"aria-hidden":"true",children:ui.map((u,p)=>Te("span",{className:_.weekday,children:u},gi[p]))}),Te("div",{className:_.grid,"data-aia-date-grid":"",children:e.map((u,p)=>Te(fi,{option:u,id:`${t}-option-${p}`,index:p,isHighlighted:p===r&&u.is_tappable,isToday:vt(u)===y,isPast:di(vt(u),y,n.floor),marks:li(vt(u),{selectedIso:n.selectedIso,range:m,references:n.references}),onSelect:l,onHighlight:s,onUnhighlight:c},vt(u)??`pad-${p}`))})]})}function fi({option:e,id:r,index:t,isHighlighted:o,isToday:n,isPast:l,marks:s,onSelect:c,onHighlight:w,onUnhighlight:v}){let[y,m]=mi(!1),u=si(e);if(u==null)return Te("div",{id:r,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${_.cell} ${_.blank}`});let p=()=>{m(!0),c(e),setTimeout(()=>m(!1),170)},k=[_.cell,_.day,l?_.past:"",o?_.highlighted:"",n?_.today:"",s.inRange?_.inRange:"",s.selected?_.selected:"",s.reference?_.reference:"",y?_.pressed:""].filter(Boolean).join(" ");return Te("div",{id:r,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":o,"aria-label":e.text,tabIndex:0,className:k,onClick:p,onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),p())},onMouseEnter:()=>w(t),onMouseLeave:v?()=>v(t):void 0,children:Te("span",{className:_.number,children:u})})}import{ATTRIBUTION_URL as bi,buildAttributionUrl as wi,getFooterHint as vi,uiStringsFor as xi}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as yi,useState as ki}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-8f881ad8")){let e=document.createElement("style");e.id="ac-style-8f881ad8",e.textContent=`.aia-cluster {
|
|
2038
2038
|
display: flex;
|
|
2039
2039
|
flex-wrap: wrap;
|
|
2040
2040
|
gap: var(--aia-cluster-gap, 0.5rem);
|
|
@@ -2074,7 +2074,7 @@ import{buildSubmitResult as Ks,cellDay as qs,cellIso as _s,DATE_RANGE_META_END a
|
|
|
2074
2074
|
.aia-cluster[data-justify="around"] {
|
|
2075
2075
|
justify-content: space-around;
|
|
2076
2076
|
}
|
|
2077
|
-
`,document.head.appendChild(e)}import{jsx as ma}from"react/jsx-runtime";function xt({gap:e,align:r="center",justify:t="start",noWrap:o=!1,inline:n=!1,className:l,children:s,...c}){let w=e?{"--aia-cluster-gap":e}:void 0,v={className:l?`aia-cluster ${l}`:"aia-cluster","data-align":r,"data-justify":t,"data-nowrap":o||void 0,"data-inline":n||void 0,style:w,...c};return n?ma("span",{...v,children:s}):ma("div",{...v,children:s})}if(typeof document<"u"&&!document.getElementById("ac-style-
|
|
2077
|
+
`,document.head.appendChild(e)}import{jsx as ma}from"react/jsx-runtime";function xt({gap:e,align:r="center",justify:t="start",noWrap:o=!1,inline:n=!1,className:l,children:s,...c}){let w=e?{"--aia-cluster-gap":e}:void 0,v={className:l?`aia-cluster ${l}`:"aia-cluster","data-align":r,"data-justify":t,"data-nowrap":o||void 0,"data-inline":n||void 0,style:w,...c};return n?ma("span",{...v,children:s}):ma("div",{...v,children:s})}if(typeof document<"u"&&!document.getElementById("ac-style-f45d7ffa")){let e=document.createElement("style");e.id="ac-style-f45d7ffa",e.textContent=`/* The footer adds its own 8px horizontal inset so it stays clear of the
|
|
2078
2078
|
dropdown's rounded edges. The top inset (--aia-footer-gap) adds breathing
|
|
2079
2079
|
room above the hint/branding row so the footer doesn't butt against the last
|
|
2080
2080
|
option row \u2014 additive to the dropdown's 8px section gap. */
|
|
@@ -2222,7 +2222,7 @@ import{buildSubmitResult as Ks,cellDay as qs,cellIso as _s,DATE_RANGE_META_END a
|
|
|
2222
2222
|
justify-content: flex-end;
|
|
2223
2223
|
}
|
|
2224
2224
|
}
|
|
2225
|
-
`,document.head.appendChild(e)}var Me={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 pt,jsxs as ga}from"react/jsx-runtime";function fa({isOptionHighlighted:e=!1,isInputEmpty:r=!1,strings:t=xi()}){let{key:o,hint:n}=vi(e,r,t),[l,s]=ki(bi);return yi(()=>{s(wi())},[]),pt("footer",{className:Me.footer,"data-aia-footer":"",children:ga(xt,{justify:"between",noWrap:!0,className:Me.row,children:[ga(xt,{gap:"5px",className:Me.hintGroup,children:[pt("kbd",{className:Me.key,children:o}),pt("span",{className:Me.hint,children:n})]}),pt("a",{className:Me.brandLink,href:l,target:"_blank",rel:"noopener noreferrer",children:pt("span",{className:Me.badge,children:pt("span",{className:Me.brand,children:"Powered by Intent-1"})})})]})})}import{useEffect as ba,useLayoutEffect as Si,useRef as ge}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-
|
|
2225
|
+
`,document.head.appendChild(e)}var Me={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 pt,jsxs as ga}from"react/jsx-runtime";function fa({isOptionHighlighted:e=!1,isInputEmpty:r=!1,strings:t=xi()}){let{key:o,hint:n}=vi(e,r,t),[l,s]=ki(bi);return yi(()=>{s(wi())},[]),pt("footer",{className:Me.footer,"data-aia-footer":"",children:ga(xt,{justify:"between",noWrap:!0,className:Me.row,children:[ga(xt,{gap:"5px",className:Me.hintGroup,children:[pt("kbd",{className:Me.key,children:o}),pt("span",{className:Me.hint,children:n})]}),pt("a",{className:Me.brandLink,href:l,target:"_blank",rel:"noopener noreferrer",children:pt("span",{className:Me.badge,children:pt("span",{className:Me.brand,children:"Powered by Intent-1"})})})]})})}import{useEffect as ba,useLayoutEffect as Si,useRef as ge}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-6cbc3cf2")){let e=document.createElement("style");e.id="ac-style-6cbc3cf2",e.textContent=`/* Location search \u2014 React copy of the vanilla rules in styles.css (and of the
|
|
2226
2226
|
Angular copy). The three are kept identical by
|
|
2227
2227
|
packages/vanilla/tests/render/locationFieldParity.test.ts. */
|
|
2228
2228
|
.aia-location-6-fsr {
|
|
@@ -2356,7 +2356,7 @@ import{buildSubmitResult as Ks,cellDay as qs,cellIso as _s,DATE_RANGE_META_END a
|
|
|
2356
2356
|
.aia-loadingBar-OLCr4:nth-child(3) {
|
|
2357
2357
|
width: 60%;
|
|
2358
2358
|
}
|
|
2359
|
-
`,document.head.appendChild(e)}var U={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 re,jsxs as _e}from"react/jsx-runtime";var Ci=0;function yt(e){return e.getRootNode().activeElement??null}function xa(e){return e.getRootNode().getSelection?.()??document.getSelection()}function wa(e){if(!e.isContentEditable)return null;let r=xa(e);if(!r||r.rangeCount===0)return null;let t=r.getRangeAt(0);return e.contains(t.startContainer)?t.cloneRange():null}function va(e,r){if(e.focus({preventScroll:!0}),!e.isContentEditable)return;let t=xa(e);if(!t)return;let o=r;(!o||!o.startContainer.isConnected||!e.contains(o.startContainer))&&(o=document.createRange(),o.selectNodeContents(e),o.collapse(!1)),t.removeAllRanges(),t.addRange(o)}var Ti=_e("svg",{className:U.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[re("path",{d:"M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z"}),re("circle",{cx:"12",cy:"9.5",r:"2.5"})]}),Pi=_e("svg",{className:U.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[re("circle",{cx:"11",cy:"11",r:"7"}),re("path",{d:"m20 20-3.5-3.5"})]});function ya({view:e,searchLabel:r,noResultsLabel:t,useTypedLabel:o,widgetFocused:n,reediting:l=!1,visible:s=!0,interactive:c=!0,onQuery:w,onMove:v,onCommit:y,onFocusChange:m}){let u=ge(null),p=ge(null),k=ge(null),S=ge(null),T=ge(null),O=ge(!1),L=ge(!1),j=ge(!1),N=ge(!1),A=ge(n);A.current=n;let D=ge(m);D.current=m;let F=a=>{N.current=a,m(a)},Y=()=>{let a=u.current;return a!=null&&yt(a)===a},ie=()=>{let a=p.current;if(!a)return;let x=yt(a);x instanceof HTMLElement&&x!==u.current&&x!==document.body&&!a.contains(x)&&(S.current=x,T.current=wa(x))},X=a=>{let x=p.current;!x||!(a instanceof HTMLElement)||a===S.current||a===document.body||x.contains(a)||(S.current=a,T.current=wa(a))},W=ge(null);W.current===null&&(W.current=`aia-location-${++Ci}`);let I=`${W.current}-row-`;ba(()=>{let a=u.current;a&&a.value!==e.query&&yt(a)!==a&&(a.value=e.query)},[e.query]),ba(()=>{n&&(l&&!j.current&&(L.current=!1),j.current=l);let a=u.current;if(a){if(!s&&Y()){L.current=!0,G();return}if(!n){setTimeout(()=>{if(A.current)return;let x=S.current;x&&yt(x)===x||(L.current=!1)},0);return}if(!(!l||L.current||!c||Y())){if(ie(),F(!0),a.focus({preventScroll:!0}),!Y()){L.current=!0,F(!1);return}a.value&&a.select()}}}),Si(()=>()=>{if(!N.current)return;let a=u.current,x=S.current;x?.isConnected&&a&&yt(a)===a&&(O.current=!0,va(x,T.current),O.current=!1),N.current=!1,D.current(!1)},[]);let G=(a=!1)=>{a&&(L.current=!0);let x=S.current;x?.isConnected&&Y()&&(O.current=!0,va(x,T.current),O.current=!1),F(!1)},se=e.query.trim(),le=e.highlighted>=0&&e.highlighted<e.places.length?`${I}${e.highlighted}`:void 0,ee=null;return e.places.length>0?ee=e.places.map((a,x)=>_e("div",{id:`${I}${x}`,role:"option","aria-selected":x===e.highlighted,className:x===e.highlighted?`${U.row} ${U.highlighted}`:U.row,"data-aia-location-row":"","data-aia-index":x,onClick:()=>{c&&(G(!0),y(x))},children:[re("span",{className:U.pin,children:Ti}),_e("span",{className:U.text,children:[re("span",{className:U.name,children:a.name}),a.secondary&&re("span",{className:U.secondary,children:a.secondary})]})]},a.id)):e.status==="loading"?ee=_e("div",{className:U.loading,"data-aia-location-loading":"",children:[re("span",{className:U.loadingBar}),re("span",{className:U.loadingBar}),re("span",{className:U.loadingBar})]}):se&&(ee=_e("div",{className:U.note,"data-aia-location-note":"",children:[e.status==="done"&&re("span",{className:U.empty,children:t}),re("span",{children:o})]})),_e("div",{ref:p,className:U.location,"data-aia-location":"",onMouseDown:a=>{!(a.target instanceof Node)||!k.current?.contains(a.target)||(a.stopPropagation(),ie(),F(!0))},children:[_e("label",{ref:k,className:U.field,children:[Pi,re("input",{ref:u,type:"text",className:U.input,"data-aia-location-input":"",defaultValue:e.query,placeholder:r,"aria-label":r,"aria-activedescendant":le,autoComplete:"off",autoCapitalize:"words",enterKeyHint:"done",spellCheck:!1,tabIndex:s?0:-1,onChange:a=>w(a.target.value),onFocus:a=>{X(a.relatedTarget),F(!0)},onBlur:()=>{O.current||(L.current=!0,F(!1))},onKeyDown:a=>{if(!a.nativeEvent.isComposing)switch(a.key){case"ArrowDown":case"ArrowUp":a.preventDefault(),v(a.key==="ArrowDown"?1:-1);return;case"Enter":if(a.preventDefault(),!c)return;G(!0),y();return;case"Escape":a.preventDefault(),a.stopPropagation(),L.current=!0,G();return;case"Backspace":if(a.currentTarget.value!=="")return;a.preventDefault(),L.current=!0,G();return}}})]}),re("div",{className:U.results,"data-aia-location-results":"","aria-live":"polite",children:ee})]})}import{isSmartSuggestion as Ri,isTraditionalAutocompleteSuggestion as zi}from"@magicx-eng/ai-autocomplete-vanilla";import{SMART_SUGGESTION_SPARKLE_SVG as Ii}from"@magicx-eng/ai-autocomplete-vanilla";if(typeof document<"u"&&!document.getElementById("ac-style-
|
|
2359
|
+
`,document.head.appendChild(e)}var U={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 re,jsxs as _e}from"react/jsx-runtime";var Ci=0;function yt(e){return e.getRootNode().activeElement??null}function xa(e){return e.getRootNode().getSelection?.()??document.getSelection()}function wa(e){if(!e.isContentEditable)return null;let r=xa(e);if(!r||r.rangeCount===0)return null;let t=r.getRangeAt(0);return e.contains(t.startContainer)?t.cloneRange():null}function va(e,r){if(e.focus({preventScroll:!0}),!e.isContentEditable)return;let t=xa(e);if(!t)return;let o=r;(!o||!o.startContainer.isConnected||!e.contains(o.startContainer))&&(o=document.createRange(),o.selectNodeContents(e),o.collapse(!1)),t.removeAllRanges(),t.addRange(o)}var Ti=_e("svg",{className:U.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[re("path",{d:"M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z"}),re("circle",{cx:"12",cy:"9.5",r:"2.5"})]}),Pi=_e("svg",{className:U.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[re("circle",{cx:"11",cy:"11",r:"7"}),re("path",{d:"m20 20-3.5-3.5"})]});function ya({view:e,searchLabel:r,noResultsLabel:t,useTypedLabel:o,widgetFocused:n,reediting:l=!1,visible:s=!0,interactive:c=!0,onQuery:w,onMove:v,onCommit:y,onFocusChange:m}){let u=ge(null),p=ge(null),k=ge(null),S=ge(null),T=ge(null),O=ge(!1),L=ge(!1),j=ge(!1),N=ge(!1),A=ge(n);A.current=n;let D=ge(m);D.current=m;let F=a=>{N.current=a,m(a)},Y=()=>{let a=u.current;return a!=null&&yt(a)===a},ie=()=>{let a=p.current;if(!a)return;let x=yt(a);x instanceof HTMLElement&&x!==u.current&&x!==document.body&&!a.contains(x)&&(S.current=x,T.current=wa(x))},X=a=>{let x=p.current;!x||!(a instanceof HTMLElement)||a===S.current||a===document.body||x.contains(a)||(S.current=a,T.current=wa(a))},W=ge(null);W.current===null&&(W.current=`aia-location-${++Ci}`);let I=`${W.current}-row-`;ba(()=>{let a=u.current;a&&a.value!==e.query&&yt(a)!==a&&(a.value=e.query)},[e.query]),ba(()=>{n&&(l&&!j.current&&(L.current=!1),j.current=l);let a=u.current;if(a){if(!s&&Y()){L.current=!0,G();return}if(!n){setTimeout(()=>{if(A.current)return;let x=S.current;x&&yt(x)===x||(L.current=!1)},0);return}if(!(!l||L.current||!c||Y())){if(ie(),F(!0),a.focus({preventScroll:!0}),!Y()){L.current=!0,F(!1);return}a.value&&a.select()}}}),Si(()=>()=>{if(!N.current)return;let a=u.current,x=S.current;x?.isConnected&&a&&yt(a)===a&&(O.current=!0,va(x,T.current),O.current=!1),N.current=!1,D.current(!1)},[]);let G=(a=!1)=>{a&&(L.current=!0);let x=S.current;x?.isConnected&&Y()&&(O.current=!0,va(x,T.current),O.current=!1),F(!1)},se=e.query.trim(),le=e.highlighted>=0&&e.highlighted<e.places.length?`${I}${e.highlighted}`:void 0,ee=null;return e.places.length>0?ee=e.places.map((a,x)=>_e("div",{id:`${I}${x}`,role:"option","aria-selected":x===e.highlighted,className:x===e.highlighted?`${U.row} ${U.highlighted}`:U.row,"data-aia-location-row":"","data-aia-index":x,onClick:()=>{c&&(G(!0),y(x))},children:[re("span",{className:U.pin,children:Ti}),_e("span",{className:U.text,children:[re("span",{className:U.name,children:a.name}),a.secondary&&re("span",{className:U.secondary,children:a.secondary})]})]},a.id)):e.status==="loading"?ee=_e("div",{className:U.loading,"data-aia-location-loading":"",children:[re("span",{className:U.loadingBar}),re("span",{className:U.loadingBar}),re("span",{className:U.loadingBar})]}):se&&(ee=_e("div",{className:U.note,"data-aia-location-note":"",children:[e.status==="done"&&re("span",{className:U.empty,children:t}),re("span",{children:o})]})),_e("div",{ref:p,className:U.location,"data-aia-location":"",onMouseDown:a=>{!(a.target instanceof Node)||!k.current?.contains(a.target)||(a.stopPropagation(),ie(),F(!0))},children:[_e("label",{ref:k,className:U.field,children:[Pi,re("input",{ref:u,type:"text",className:U.input,"data-aia-location-input":"",defaultValue:e.query,placeholder:r,"aria-label":r,"aria-activedescendant":le,autoComplete:"off",autoCapitalize:"words",enterKeyHint:"done",spellCheck:!1,tabIndex:s?0:-1,onChange:a=>w(a.target.value),onFocus:a=>{X(a.relatedTarget),F(!0)},onBlur:()=>{O.current||(L.current=!0,F(!1))},onKeyDown:a=>{if(!a.nativeEvent.isComposing)switch(a.key){case"ArrowDown":case"ArrowUp":a.preventDefault(),v(a.key==="ArrowDown"?1:-1);return;case"Enter":if(a.preventDefault(),!c)return;G(!0),y();return;case"Escape":a.preventDefault(),a.stopPropagation(),L.current=!0,G();return;case"Backspace":if(a.currentTarget.value!=="")return;a.preventDefault(),L.current=!0,G();return}}})]}),re("div",{className:U.results,"data-aia-location-results":"","aria-live":"polite",children:ee})]})}import{isSmartSuggestion as Ri,isTraditionalAutocompleteSuggestion as zi}from"@magicx-eng/ai-autocomplete-vanilla";import{SMART_SUGGESTION_SPARKLE_SVG as Ii}from"@magicx-eng/ai-autocomplete-vanilla";if(typeof document<"u"&&!document.getElementById("ac-style-dd56ca0c")){let e=document.createElement("style");e.id="ac-style-dd56ca0c",e.textContent=`/* ParamPill (Figma "ParamPill") \u2014 unfilled suggestion pill: transparent fill,
|
|
2360
2360
|
no outline. ~28px via 6px padding + 14px text + the 1px border (border-box).
|
|
2361
2361
|
The border is kept as a 1px transparent line so the box stays the same size
|
|
2362
2362
|
as it was when the outline was dashed. */
|
|
@@ -2514,7 +2514,7 @@ import{buildSubmitResult as Ks,cellDay as qs,cellIso as _s,DATE_RANGE_META_END a
|
|
|
2514
2514
|
opacity: 0;
|
|
2515
2515
|
}
|
|
2516
2516
|
}
|
|
2517
|
-
`,document.head.appendChild(e)}var Pe={pill:"aia-pill-6Ga7S",fadeIn:"aia-fadeIn-Ux4eQ",rounded:"aia-rounded-y7xA9",smartText:"aia-smartText-R0cfw","smartSuggestion-shimmer":"aia-smartSuggestion-shimmer-F-yoD",smartSparkle:"aia-smartSparkle-IVabG","smartSuggestion-sparkle":"aia-smartSuggestion-sparkle-Wfj-4","smartSuggestion-sparkle-small":"aia-smartSuggestion-sparkle-small-3VsWJ",skeleton:"aia-skeleton-57P0T",loadingOut:"aia-loadingOut-Aj9xO"};import{Fragment as Ai,jsx as Bt,jsxs as Ei}from"react/jsx-runtime";var Wt={selected:1,first:.7,next:.4,last:.2};function ka({label:e,state:r,active:t,rounded:o,loading:n,smartSuggestion:l,completionHeader:s,onClick:c}){let w=[Pe.pill,o?Pe.rounded:"",n?Pe.skeleton:""].filter(Boolean).join(" ");return Bt("button",{type:"button","data-aia-pill":"","data-aia-pill-active":t?"":void 0,"data-aia-loading":n?"":void 0,"data-aia-smart-suggestion":l?s?"header":"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:w,style:{"--aia-pill-opacity":Wt[r]},onMouseDown:v=>v.preventDefault(),onClick:n?void 0:c,disabled:n,children:l?Ei(Ai,{children:[Bt("span",{className:`${Pe.smartText} magicx-aia-smart-suggestion-text`,children:e}),Bt("span",{className:`${Pe.smartSparkle} magicx-aia-smart-suggestion-sparkle`,dangerouslySetInnerHTML:{__html:Ii}})]}):e})}if(typeof document<"u"&&!document.getElementById("ac-style-
|
|
2517
|
+
`,document.head.appendChild(e)}var Pe={pill:"aia-pill-6Ga7S",fadeIn:"aia-fadeIn-Ux4eQ",rounded:"aia-rounded-y7xA9",smartText:"aia-smartText-R0cfw","smartSuggestion-shimmer":"aia-smartSuggestion-shimmer-F-yoD",smartSparkle:"aia-smartSparkle-IVabG","smartSuggestion-sparkle":"aia-smartSuggestion-sparkle-Wfj-4","smartSuggestion-sparkle-small":"aia-smartSuggestion-sparkle-small-3VsWJ",skeleton:"aia-skeleton-57P0T",loadingOut:"aia-loadingOut-Aj9xO"};import{Fragment as Ai,jsx as Bt,jsxs as Ei}from"react/jsx-runtime";var Wt={selected:1,first:.7,next:.4,last:.2};function ka({label:e,state:r,active:t,rounded:o,loading:n,smartSuggestion:l,completionHeader:s,onClick:c}){let w=[Pe.pill,o?Pe.rounded:"",n?Pe.skeleton:""].filter(Boolean).join(" ");return Bt("button",{type:"button","data-aia-pill":"","data-aia-pill-active":t?"":void 0,"data-aia-loading":n?"":void 0,"data-aia-smart-suggestion":l?s?"header":"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:w,style:{"--aia-pill-opacity":Wt[r]},onMouseDown:v=>v.preventDefault(),onClick:n?void 0:c,disabled:n,children:l?Ei(Ai,{children:[Bt("span",{className:`${Pe.smartText} magicx-aia-smart-suggestion-text`,children:e}),Bt("span",{className:`${Pe.smartSparkle} magicx-aia-smart-suggestion-sparkle`,dangerouslySetInnerHTML:{__html:Ii}})]}):e})}if(typeof document<"u"&&!document.getElementById("ac-style-1ea52c62")){let e=document.createElement("style");e.id="ac-style-1ea52c62",e.textContent=`.aia-list-qvLqO {
|
|
2518
2518
|
position: relative;
|
|
2519
2519
|
z-index: 1;
|
|
2520
2520
|
pointer-events: auto;
|
|
@@ -2524,7 +2524,7 @@ import{buildSubmitResult as Ks,cellDay as qs,cellIso as _s,DATE_RANGE_META_END a
|
|
|
2524
2524
|
align-items: center;
|
|
2525
2525
|
vertical-align: middle;
|
|
2526
2526
|
}
|
|
2527
|
-
`,document.head.appendChild(e)}var Gt={list:"aia-list-qvLqO"};import{jsx as Et}from"react/jsx-runtime";var Li=[125,69];function Sa(e){return e===0?"first":e===1?"next":"last"}function Rt({pills:e,activePillIndex:r,onSelectPill:t,activeSelected:o,rounded:n,loading:l}){return l&&e.length===0?Et("span",{className:Gt.list,"data-aia-pill-list-loading":"",children:Li.map((s,c)=>Et("span",{"data-aia-pill-skeleton":"",className:`${Pe.pill} ${n?Pe.rounded:""} ${Pe.skeleton}`,style:{width:s,"--aia-pill-opacity":Wt[Sa(c)]}},`skel-${s}`))}):Et("span",{className:Gt.list,"data-aia-pill-list-loading":l?"":void 0,children:e.map((s,c)=>{let w=!!o&&c===r;return Et(ka,{label:s.text,state:w?"selected":Sa(c),selected:w,active:c===r,rounded:n,loading:l,smartSuggestion:Ri(s),completionHeader:zi(s),onClick:()=>t(c)},`${s.parameter}-${s.text}`)})})}import{attachProductRowWheel as Oi,productImageSources as Di,productImageSrc as Mi,productInitial as Ni,productPhotoFill as Fi,uiStringsFor as Hi}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Kt,useRef as zt,useState as Lt}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-
|
|
2527
|
+
`,document.head.appendChild(e)}var Gt={list:"aia-list-qvLqO"};import{jsx as Et}from"react/jsx-runtime";var Li=[125,69];function Sa(e){return e===0?"first":e===1?"next":"last"}function Rt({pills:e,activePillIndex:r,onSelectPill:t,activeSelected:o,rounded:n,loading:l}){return l&&e.length===0?Et("span",{className:Gt.list,"data-aia-pill-list-loading":"",children:Li.map((s,c)=>Et("span",{"data-aia-pill-skeleton":"",className:`${Pe.pill} ${n?Pe.rounded:""} ${Pe.skeleton}`,style:{width:s,"--aia-pill-opacity":Wt[Sa(c)]}},`skel-${s}`))}):Et("span",{className:Gt.list,"data-aia-pill-list-loading":l?"":void 0,children:e.map((s,c)=>{let w=!!o&&c===r;return Et(ka,{label:s.text,state:w?"selected":Sa(c),selected:w,active:c===r,rounded:n,loading:l,smartSuggestion:Ri(s),completionHeader:zi(s),onClick:()=>t(c)},`${s.parameter}-${s.text}`)})})}import{attachProductRowWheel as Oi,productImageSources as Di,productImageSrc as Mi,productInitial as Ni,productPhotoFill as Fi,uiStringsFor as Hi}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Kt,useRef as zt,useState as Lt}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-4ec71cc0")){let e=document.createElement("style");e.id="ac-style-4ec71cc0",e.textContent=`/* Product strip \u2014 the React counterpart of the vanilla core's strip rules
|
|
2528
2528
|
(packages/vanilla/src/styles.css). Same tokens, same defaults, so a consumer
|
|
2529
2529
|
theming one package sees the same result in the other.
|
|
2530
2530
|
|
|
@@ -3151,7 +3151,7 @@ import{buildSubmitResult as Ks,cellDay as qs,cellIso as _s,DATE_RANGE_META_END a
|
|
|
3151
3151
|
opacity: 0.01;
|
|
3152
3152
|
}
|
|
3153
3153
|
}
|
|
3154
|
-
`,document.head.appendChild(e)}var Q={section:"aia-section-Hugfg",label:"aia-label-nuc93",row:"aia-row-WDVBX",card:"aia-card-JBGYT",media:"aia-media-RrbGe",image:"aia-image-5pNL7",body:"aia-body-ly032",vendor:"aia-vendor-Gvu7G",title:"aia-title-gCNmq",price:"aia-price-gULcE",compareAt:"aia-compareAt-ewE54",badge:"aia-badge-j9Hcd",cart:"aia-cart-kSlqU",cartCheck:"aia-cartCheck-YTTQ6",cartGlyph:"aia-cartGlyph-cmqAk",cartSpinner:"aia-cartSpinner-442rc","magicx-aia-product-cart-spin":"aia-magicx-aia-product-cart-spin-x8mgr",stripLoadingOut:"aia-stripLoadingOut-0jOOQ",stripFadeIn:"aia-stripFadeIn-0p9qx"};import{jsx as J,jsxs as ht}from"react/jsx-runtime";function Ca({products:e,listboxId:r,onSelect:t,busyProductId:o=null,onAddToCart:n,onFocusChange:l,focusable:s=!0,loading:c=!1,layout:w="row",imageFallback:v="image",showVendor:y=!0,strings:m=Hi()}){let u=e.length>0,p=zt(null);if(Kt(()=>{let S=p.current;if(!(!u||!S))return Oi(S)},[u]),!u)return null;let k=`${r}-products-label`;return ht("section",{className:Q.section,"data-aia-products":"","data-aia-loading":c?"":void 0,"data-aia-products-layout":w,role:"group","aria-labelledby":k,children:[J("div",{className:Q.label,id:k,"data-aia-products-label":"",children:m.products}),J("div",{ref:p,className:Q.row,"data-aia-products-row":"",children:e.map((S,T)=>J(Bi,{product:S,id:`${r}-product-${T}`,onSelect:t,busy:S.id===o,onAddToCart:n,onFocusChange:l,focusable:s,imageFallback:v,showVendor:y,soldOut:m.soldOut,addToCart:m.addToCart},S.id))})]})}function Bi({product:e,id:r,onSelect:t,busy:o,onAddToCart:n,onFocusChange:l,focusable:s,imageFallback:c,showVendor:w,soldOut:v,addToCart:y}){let m=!!n&&e.available!==!1,[u,p]=Lt(null),k=T=>{T.relatedTarget?.closest("[data-aia-dropdown]")||l?.(!1)},S=T=>{T.metaKey||T.ctrlKey||T.shiftKey||T.altKey||T.button!==0||(T.preventDefault(),t(e))};return ht("a",{id:r,className:Q.card,"data-aia-product":"","data-aia-product-sold-out":e.available===!1?"":void 0,"data-aia-product-has-cart":m?"":void 0,"data-aia-product-state":o?"busy":void 0,"aria-busy":o?!0:void 0,role:"option","aria-selected":!1,style:u?{"--aia-product-photo-fill-x":String(u.x),"--aia-product-photo-fill-y":String(u.y)}:void 0,href:e.url,tabIndex:s?0:-1,onClick:S,onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),t(e))},onFocus:()=>l?.(!0),onBlur:k,children:[J(Ki,{sources:Di(e.imageUrl),title:e.title,fallback:c,onPhotoFill:p},Mi(e.imageUrl)??""),ht("span",{className:Q.body,children:[w&&e.vendor?J("span",{className:Q.vendor,children:e.vendor}):null,J("span",{className:Q.title,children:e.title}),e.price?ht("span",{className:Q.price,children:[e.price,e.compareAtPrice?J("s",{className:Q.compareAt,children:e.compareAtPrice}):null]}):null,e.available===!1?J("span",{className:Q.badge,children:v}):null]}),m&&n?J(Gi,{product:e,label:`${y}: ${e.title}`,focusable:s,onAddToCart:n,onFocus:()=>l?.(!0),onBlur:k},Wi(e)):null]})}function Wi(e){return[e.id,e.title,e.url,e.imageUrl,e.vendor].map(r=>r??"").join("\0")}function Gi({product:e,label:r,focusable:t,onAddToCart:o,onFocus:n,onBlur:l}){let[s,c]=Lt(null),w=zt(null),v=zt(e);v.current=e;let y=zt(!0);Kt(()=>(y.current=!0,()=>{y.current=!1}),[]);let m=p=>{w.current=p,y.current&&c(p)},u=p=>{if(p.preventDefault(),p.stopPropagation(),w.current==="adding")return;m("adding");let k;try{k=Promise.resolve(o(v.current))}catch(S){k=Promise.reject(S)}k.then(()=>m("added"),()=>m(null))};return J("span",{className:Q.cart,"data-aia-product-cart":"","data-aia-cart-state":s??void 0,"aria-busy":s==="adding"?!0:void 0,role:"button","aria-label":r,tabIndex:t?0:-1,onClick:u,onKeyDown:p=>{p.key!=="Enter"&&p.key!==" "||u(p)},onFocus:p=>{p.stopPropagation(),n()},onBlur:p=>{p.stopPropagation(),l(p)},children:ht("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[J("path",{className:Q.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:Q.cartGlyph,d:"M13.5 6.5v-4M11.5 4.5h4"}),J("path",{className:Q.cartCheck,d:"M5 12.5l4.5 4.5L19 7.5"}),J("path",{className:Q.cartSpinner,d:"M12 4a8 8 0 1 0 8 8"}),J("circle",{className:Q.cartGlyph,cx:"9",cy:"20",r:"1.3"}),J("circle",{className:Q.cartGlyph,cx:"17.5",cy:"20",r:"1.3"})]})})}function Ki({sources:e,title:r,fallback:t,onPhotoFill:o}){let[n,l]=Lt(0),s=e[n],c=!!s,[w,v]=Lt(null),y=!c&&t==="initial";return Kt(()=>()=>o(null),[o]),ht("span",{className:Q.media,"data-aia-product-media":"","aria-hidden":"true","data-aia-product-placeholder":!c&&!y?"":void 0,"data-aia-product-initial":y?"":void 0,"data-aia-image-loaded":c&&w===s?"":void 0,children:[c?J("img",{className:Q.image,src:s,alt:"",loading:"lazy",decoding:"async",onLoad:m=>{v(s),o(Fi(m.currentTarget.naturalWidth,m.currentTarget.naturalHeight))},onError:()=>{n+1>=e.length&&o(null),l(m=>m+1)}}):null,y?Ni(r):null]})}import{isOptionsGridMobileViewport as oo,measureOptionsGrid as no,needsOptionsGridMeasurement as ro,OPTIONS_GRID_MOBILE_QUERY as so,optionEnterDelayMs as lo,optionsShowLeadingVisuals as co,planOptionsGrid as Ea,pointerMayHighlight as Ra,releasePanelHug as po,sameOptionRows as ho,syncHighlightScroll as uo,syncPanelHug as mo}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as go,useLayoutEffect as Vt,useRef as za,useState as Oa}from"react";import{optionsGridTemplateColumns as qi}from"@magicx-eng/ai-autocomplete-vanilla";import{useLayoutEffect as _i,useRef as Vi}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-
|
|
3154
|
+
`,document.head.appendChild(e)}var Q={section:"aia-section-Hugfg",label:"aia-label-nuc93",row:"aia-row-WDVBX",card:"aia-card-JBGYT",media:"aia-media-RrbGe",image:"aia-image-5pNL7",body:"aia-body-ly032",vendor:"aia-vendor-Gvu7G",title:"aia-title-gCNmq",price:"aia-price-gULcE",compareAt:"aia-compareAt-ewE54",badge:"aia-badge-j9Hcd",cart:"aia-cart-kSlqU",cartCheck:"aia-cartCheck-YTTQ6",cartGlyph:"aia-cartGlyph-cmqAk",cartSpinner:"aia-cartSpinner-442rc","magicx-aia-product-cart-spin":"aia-magicx-aia-product-cart-spin-x8mgr",stripLoadingOut:"aia-stripLoadingOut-0jOOQ",stripFadeIn:"aia-stripFadeIn-0p9qx"};import{jsx as J,jsxs as ht}from"react/jsx-runtime";function Ca({products:e,listboxId:r,onSelect:t,busyProductId:o=null,onAddToCart:n,onFocusChange:l,focusable:s=!0,loading:c=!1,layout:w="row",imageFallback:v="image",showVendor:y=!0,strings:m=Hi()}){let u=e.length>0,p=zt(null);if(Kt(()=>{let S=p.current;if(!(!u||!S))return Oi(S)},[u]),!u)return null;let k=`${r}-products-label`;return ht("section",{className:Q.section,"data-aia-products":"","data-aia-loading":c?"":void 0,"data-aia-products-layout":w,role:"group","aria-labelledby":k,children:[J("div",{className:Q.label,id:k,"data-aia-products-label":"",children:m.products}),J("div",{ref:p,className:Q.row,"data-aia-products-row":"",children:e.map((S,T)=>J(Bi,{product:S,id:`${r}-product-${T}`,onSelect:t,busy:S.id===o,onAddToCart:n,onFocusChange:l,focusable:s,imageFallback:v,showVendor:y,soldOut:m.soldOut,addToCart:m.addToCart},S.id))})]})}function Bi({product:e,id:r,onSelect:t,busy:o,onAddToCart:n,onFocusChange:l,focusable:s,imageFallback:c,showVendor:w,soldOut:v,addToCart:y}){let m=!!n&&e.available!==!1,[u,p]=Lt(null),k=T=>{T.relatedTarget?.closest("[data-aia-dropdown]")||l?.(!1)},S=T=>{T.metaKey||T.ctrlKey||T.shiftKey||T.altKey||T.button!==0||(T.preventDefault(),t(e))};return ht("a",{id:r,className:Q.card,"data-aia-product":"","data-aia-product-sold-out":e.available===!1?"":void 0,"data-aia-product-has-cart":m?"":void 0,"data-aia-product-state":o?"busy":void 0,"aria-busy":o?!0:void 0,role:"option","aria-selected":!1,style:u?{"--aia-product-photo-fill-x":String(u.x),"--aia-product-photo-fill-y":String(u.y)}:void 0,href:e.url,tabIndex:s?0:-1,onClick:S,onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),t(e))},onFocus:()=>l?.(!0),onBlur:k,children:[J(Ki,{sources:Di(e.imageUrl),title:e.title,fallback:c,onPhotoFill:p},Mi(e.imageUrl)??""),ht("span",{className:Q.body,children:[w&&e.vendor?J("span",{className:Q.vendor,children:e.vendor}):null,J("span",{className:Q.title,children:e.title}),e.price?ht("span",{className:Q.price,children:[e.price,e.compareAtPrice?J("s",{className:Q.compareAt,children:e.compareAtPrice}):null]}):null,e.available===!1?J("span",{className:Q.badge,children:v}):null]}),m&&n?J(Gi,{product:e,label:`${y}: ${e.title}`,focusable:s,onAddToCart:n,onFocus:()=>l?.(!0),onBlur:k},Wi(e)):null]})}function Wi(e){return[e.id,e.title,e.url,e.imageUrl,e.vendor].map(r=>r??"").join("\0")}function Gi({product:e,label:r,focusable:t,onAddToCart:o,onFocus:n,onBlur:l}){let[s,c]=Lt(null),w=zt(null),v=zt(e);v.current=e;let y=zt(!0);Kt(()=>(y.current=!0,()=>{y.current=!1}),[]);let m=p=>{w.current=p,y.current&&c(p)},u=p=>{if(p.preventDefault(),p.stopPropagation(),w.current==="adding")return;m("adding");let k;try{k=Promise.resolve(o(v.current))}catch(S){k=Promise.reject(S)}k.then(()=>m("added"),()=>m(null))};return J("span",{className:Q.cart,"data-aia-product-cart":"","data-aia-cart-state":s??void 0,"aria-busy":s==="adding"?!0:void 0,role:"button","aria-label":r,tabIndex:t?0:-1,onClick:u,onKeyDown:p=>{p.key!=="Enter"&&p.key!==" "||u(p)},onFocus:p=>{p.stopPropagation(),n()},onBlur:p=>{p.stopPropagation(),l(p)},children:ht("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[J("path",{className:Q.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:Q.cartGlyph,d:"M13.5 6.5v-4M11.5 4.5h4"}),J("path",{className:Q.cartCheck,d:"M5 12.5l4.5 4.5L19 7.5"}),J("path",{className:Q.cartSpinner,d:"M12 4a8 8 0 1 0 8 8"}),J("circle",{className:Q.cartGlyph,cx:"9",cy:"20",r:"1.3"}),J("circle",{className:Q.cartGlyph,cx:"17.5",cy:"20",r:"1.3"})]})})}function Ki({sources:e,title:r,fallback:t,onPhotoFill:o}){let[n,l]=Lt(0),s=e[n],c=!!s,[w,v]=Lt(null),y=!c&&t==="initial";return Kt(()=>()=>o(null),[o]),ht("span",{className:Q.media,"data-aia-product-media":"","aria-hidden":"true","data-aia-product-placeholder":!c&&!y?"":void 0,"data-aia-product-initial":y?"":void 0,"data-aia-image-loaded":c&&w===s?"":void 0,children:[c?J("img",{className:Q.image,src:s,alt:"",loading:"lazy",decoding:"async",onLoad:m=>{v(s),o(Fi(m.currentTarget.naturalWidth,m.currentTarget.naturalHeight))},onError:()=>{n+1>=e.length&&o(null),l(m=>m+1)}}):null,y?Ni(r):null]})}import{isOptionsGridMobileViewport as oo,measureOptionsGrid as no,needsOptionsGridMeasurement as ro,OPTIONS_GRID_MOBILE_QUERY as so,optionEnterDelayMs as lo,optionsShowLeadingVisuals as co,planOptionsGrid as Ea,pointerMayHighlight as Ra,releasePanelHug as po,sameOptionRows as ho,syncHighlightScroll as uo,syncPanelHug as mo}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as go,useLayoutEffect as Vt,useRef as za,useState as Oa}from"react";import{optionsGridTemplateColumns as qi}from"@magicx-eng/ai-autocomplete-vanilla";import{useLayoutEffect as _i,useRef as Vi}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-238f77c4")){let e=document.createElement("style");e.id="ac-style-238f77c4",e.textContent=`.aia-grid {
|
|
3155
3155
|
display: grid;
|
|
3156
3156
|
grid-template-columns: repeat(
|
|
3157
3157
|
auto-fit,
|
|
@@ -3195,7 +3195,7 @@ import{buildSubmitResult as Ks,cellDay as qs,cellIso as _s,DATE_RANGE_META_END a
|
|
|
3195
3195
|
:where([data-aia-options-style="classic"]) .aia-grid[data-scroll] {
|
|
3196
3196
|
max-height: var(--aia-grid-max-height, 120px);
|
|
3197
3197
|
}
|
|
3198
|
-
`,document.head.appendChild(e)}import{jsx as Ui}from"react/jsx-runtime";function Ta({min:e="16rem",max:r,gap:t,scroll:o=!1,maxHeight:n,scrollResetKey:l,cols:s,template:c,innerRef:w,className:v,children:y,...m}){let u=Vi(null);_i(()=>{if(l===void 0)return;let k=u.current;k&&(k.scrollTop=0)},[l]);let p={"--aia-grid-min":e};return r&&(p["--aia-grid-max"]=r),t&&(p["--aia-grid-gap"]=t),n&&(p["--aia-grid-max-height"]=n),s&&(p.gridTemplateColumns=qi(s)),c&&(p.gridTemplateColumns=c),Ui("div",{ref:k=>{u.current=k,w?.(k)},className:v?`aia-grid ${v}`:"aia-grid","data-scroll":o||void 0,style:p,...m,children:y})}import{clearPanelMorphPressLook as Qi,formatOptionCount as Yi,highlightParts as ji,isMultiSelectToggleTap as $i,OPTION_ENTER_DELAY_VAR as Zi,optionImageSources as Pa,optionLabel as Ia,sanitizeOptionIconSvg as Xi}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Ji,useMemo as eo,useRef as qt,useState as kt}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-
|
|
3198
|
+
`,document.head.appendChild(e)}import{jsx as Ui}from"react/jsx-runtime";function Ta({min:e="16rem",max:r,gap:t,scroll:o=!1,maxHeight:n,scrollResetKey:l,cols:s,template:c,innerRef:w,className:v,children:y,...m}){let u=Vi(null);_i(()=>{if(l===void 0)return;let k=u.current;k&&(k.scrollTop=0)},[l]);let p={"--aia-grid-min":e};return r&&(p["--aia-grid-max"]=r),t&&(p["--aia-grid-gap"]=t),n&&(p["--aia-grid-max-height"]=n),s&&(p.gridTemplateColumns=qi(s)),c&&(p.gridTemplateColumns=c),Ui("div",{ref:k=>{u.current=k,w?.(k)},className:v?`aia-grid ${v}`:"aia-grid","data-scroll":o||void 0,style:p,...m,children:y})}import{clearPanelMorphPressLook as Qi,formatOptionCount as Yi,highlightParts as ji,isMultiSelectToggleTap as $i,OPTION_ENTER_DELAY_VAR as Zi,optionImageSources as Pa,optionLabel as Ia,sanitizeOptionIconSvg as Xi}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Ji,useMemo as eo,useRef as qt,useState as kt}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-182585c2")){let e=document.createElement("style");e.id="ac-style-182585c2",e.textContent=`.aia-item-d4vpD {
|
|
3199
3199
|
position: relative;
|
|
3200
3200
|
/* Clip, not visible: the entrance rise below runs on the inner content,
|
|
3201
3201
|
and a transformed box extends its scroll container's scrollable area.
|
|
@@ -3758,7 +3758,7 @@ import{buildSubmitResult as Ks,cellDay as qs,cellIso as _s,DATE_RANGE_META_END a
|
|
|
3758
3758
|
height: 18px;
|
|
3759
3759
|
border-radius: 6px;
|
|
3760
3760
|
}
|
|
3761
|
-
`,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",scrollHint:"aia-scrollHint-xKXPt",loadingOut:"aia-loadingOut-hI-qI",parameter:"aia-parameter-Dt2zF",match:"aia-match-pp-9v",icon:"aia-icon-Qw938",count:"aia-count-IpYbQ",image:"aia-image-YZAbO",text:"aia-text-yqoh9",checkbox:"aia-checkbox-KGRhg",checkPop:"aia-checkPop-CCWRW"};import{Fragment as io,jsx as xe,jsxs as _t}from"react/jsx-runtime";var to=2e3,ao=170;function Aa({option:e,isHighlighted:r,checked:t,onSelect:o,onHighlight:n,onUnhighlight:l,id:s,loading:c,showIcon:w=!0,showImage:v=!0,showCount:y=!0,scrollHint:m,enterDelayMs:u=0}){let[p]=kt(u),[k,S]=kt(!1),T=v?Pa(e.image_url):[],O=T[0]??null,[L,j]=kt([]),N=T.find(a=>!L.includes(a))??null,A=v?(e.imageCollage??[]).map(a=>Pa(a)[0]).filter(a=>a!==void 0):[],[D,F]=kt(!1),[Y,ie]=kt(null),X=eo(()=>!O&&w&&e.icon_svg?Xi(e.icon_svg):null,[O,w,e.icon_svg]),W=y?Yi(e.item_count):null,I=qt(void 0),G=qt(null),se=qt(Number.NEGATIVE_INFINITY);Ji(()=>()=>clearTimeout(I.current),[]);let le=a=>{if(c||!e.is_tappable)return;let x=a?.currentTarget,te=t!==void 0&&x!==void 0&&a!==void 0&&!$i(x,x.querySelector("[data-aia-checkbox]"),a),ae=t!==void 0&&!te;if(!ae){let ne=performance.now();if(ne-se.current<ao)return;se.current=ne}te?o(e,{commit:!0}):o(e),!ae&&(S(!0),clearTimeout(I.current),I.current=setTimeout(()=>{S(!1),Qi(G.current?.closest("[data-aia-dropdown]"))},to))},ee=[$.item,r&&!c?$.highlighted:"",e.liveMatch&&!c?$.liveMatch:"",e.is_tappable?$.tappable:$.nonTappable,k?$.pressed:"",m?$.scrollHint:""].filter(Boolean).join(" ");return xe("div",{ref:G,id:s,role:"option","data-aia-option":"","data-aia-loading":c?"":void 0,"data-aia-icon":X&&e.icon?e.icon:void 0,"data-aia-image":O?"":void 0,"data-aia-item-count":W!==null?e.item_count:void 0,"aria-selected":t??r,className:ee,style:{[Zi]:`${p}ms`},tabIndex:c||!e.is_tappable?-1:0,onClick:le,onKeyDown:a=>{!c&&e.is_tappable&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),le())},onMouseEnter:!c&&e.is_tappable?n:void 0,onMouseLeave:l,children:_t("span",{className:$.content,children:[t!==void 0&&e.is_tappable&&xe("span",{className:$.checkbox,"aria-hidden":"true","data-aia-checkbox":"","data-checked":t}),O&&A.length>1&&xe("span",{className:`${$.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-collage":A.length,"data-aia-image-loaded":D?"":void 0,children:A.map(a=>xe("img",{src:a,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,onLoad:()=>F(!0),onError:x=>{x.currentTarget.hidden=!0}},a))}),O&&A.length<=1&&xe("span",{className:`${$.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-image-loaded":N!==null&&Y===N?"":void 0,children:xe("img",{src:N??O,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:N===null,onLoad:()=>ie(N),onError:()=>{N!==null&&j(a=>[...a,N])}})}),X&&xe("span",{className:`${$.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:X}}),_t("span",{className:$.text,children:[e.matchedText?ji(Ia(e),e.matchedText).map((a,x)=>a.bold?xe("strong",{className:`${$.match} magicx-aia-option-match`,"data-aia-match-partial":a.partial?"":void 0,children:a.text},x):a.text):Ia(e),e.parameterLabel&&_t(io,{children:[" ",xe("span",{className:`${$.parameter} magicx-aia-option-parameter`,children:e.parameterLabel})]})]}),e.tag&&xe("span",{className:$.tag,children:e.tag}),W!==null&&xe("span",{className:`${$.count} magicx-aia-option-count`,children:W})]})})}import{jsx as La}from"react/jsx-runtime";function fo(){let[e,r]=Oa(oo);return go(()=>{if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia(so),o=()=>r(t.matches);return o(),t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[]),e}function Da({options:e,activeIndex:r,picked:t,onSelect:o,onHighlight:n,onUnhighlight:l,listboxId:s,loading:c,groupKey:w="",optionsPosition:v="below",showIcons:y=!0,showImages:m=!0,showCounts:u=!0}){let p=fo(),k=za(null),[S,T]=Oa(null),O=za(null);Vt(()=>{if(c&&ho(O.current,e))return;O.current=c?null:e;let A=k.current,D=A&&!c&&ro(e.length,p),F=A?.closest("[data-aia-dropdown]");D&&F&&po(F);let Y=D?no(A):null;T(Y?Ea(e.length,p,Y.rowWidths,Y.gridWidth):null)},[e,p,c]);let L=S??Ea(e.length,p,null,null);Vt(()=>{let A=k.current?.closest("[data-aia-dropdown]");A&&mo(A)},[L.template,p]);let j=c?-1:r;Vt(()=>{k.current&&uo(k.current,j)},[j]);let N=co(e,y,m);return La(Ta,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:w,template:L.template,maxHeight:L.maxHeight,innerRef:A=>{k.current=A},"data-aia-group":w,children:e.map((A,D)=>La(Aa,{option:A,isHighlighted:D===r,checked:t?t.includes(A.text):void 0,onSelect:o,onHighlight:F=>{Ra(k.current,D,F)&&n(D)},onUnhighlight:l?F=>{Ra(k.current,-1,F)&&l(D)}:void 0,id:`${s}-option-${D}`,loading:c,showIcon:y&&N,showImage:m&&N,showCount:u,scrollHint:!c&&L.scrollHintIndices.includes(D),enterDelayMs:c?0:lo(D,L.cols,e.length,v)},`${w}\0${A.parameter??""}\0${A.text}`))})}import{formatTime as bo,TIME_WHEEL_COLUMNS as wo,TIME_WHEEL_ROW_HEIGHT as vo,timeWheelIndex as Ma,timeWheelIndexFromScroll as xo,timeWheelRows as yo,withTimeWheelIndex as Na}from"@magicx-eng/ai-autocomplete-vanilla";import{Fragment as ko,useEffect as So,useLayoutEffect as Co,useRef as Ot}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-
|
|
3761
|
+
`,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",scrollHint:"aia-scrollHint-xKXPt",loadingOut:"aia-loadingOut-hI-qI",parameter:"aia-parameter-Dt2zF",match:"aia-match-pp-9v",icon:"aia-icon-Qw938",count:"aia-count-IpYbQ",image:"aia-image-YZAbO",text:"aia-text-yqoh9",checkbox:"aia-checkbox-KGRhg",checkPop:"aia-checkPop-CCWRW"};import{Fragment as io,jsx as xe,jsxs as _t}from"react/jsx-runtime";var to=2e3,ao=170;function Aa({option:e,isHighlighted:r,checked:t,onSelect:o,onHighlight:n,onUnhighlight:l,id:s,loading:c,showIcon:w=!0,showImage:v=!0,showCount:y=!0,scrollHint:m,enterDelayMs:u=0}){let[p]=kt(u),[k,S]=kt(!1),T=v?Pa(e.image_url):[],O=T[0]??null,[L,j]=kt([]),N=T.find(a=>!L.includes(a))??null,A=v?(e.imageCollage??[]).map(a=>Pa(a)[0]).filter(a=>a!==void 0):[],[D,F]=kt(!1),[Y,ie]=kt(null),X=eo(()=>!O&&w&&e.icon_svg?Xi(e.icon_svg):null,[O,w,e.icon_svg]),W=y?Yi(e.item_count):null,I=qt(void 0),G=qt(null),se=qt(Number.NEGATIVE_INFINITY);Ji(()=>()=>clearTimeout(I.current),[]);let le=a=>{if(c||!e.is_tappable)return;let x=a?.currentTarget,te=t!==void 0&&x!==void 0&&a!==void 0&&!$i(x,x.querySelector("[data-aia-checkbox]"),a),ae=t!==void 0&&!te;if(!ae){let ne=performance.now();if(ne-se.current<ao)return;se.current=ne}te?o(e,{commit:!0}):o(e),!ae&&(S(!0),clearTimeout(I.current),I.current=setTimeout(()=>{S(!1),Qi(G.current?.closest("[data-aia-dropdown]"))},to))},ee=[$.item,r&&!c?$.highlighted:"",e.liveMatch&&!c?$.liveMatch:"",e.is_tappable?$.tappable:$.nonTappable,k?$.pressed:"",m?$.scrollHint:""].filter(Boolean).join(" ");return xe("div",{ref:G,id:s,role:"option","data-aia-option":"","data-aia-loading":c?"":void 0,"data-aia-icon":X&&e.icon?e.icon:void 0,"data-aia-image":O?"":void 0,"data-aia-item-count":W!==null?e.item_count:void 0,"aria-selected":t??r,className:ee,style:{[Zi]:`${p}ms`},tabIndex:c||!e.is_tappable?-1:0,onClick:le,onKeyDown:a=>{!c&&e.is_tappable&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),le())},onMouseEnter:!c&&e.is_tappable?n:void 0,onMouseLeave:l,children:_t("span",{className:$.content,children:[t!==void 0&&e.is_tappable&&xe("span",{className:$.checkbox,"aria-hidden":"true","data-aia-checkbox":"","data-checked":t}),O&&A.length>1&&xe("span",{className:`${$.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-collage":A.length,"data-aia-image-loaded":D?"":void 0,children:A.map(a=>xe("img",{src:a,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,onLoad:()=>F(!0),onError:x=>{x.currentTarget.hidden=!0}},a))}),O&&A.length<=1&&xe("span",{className:`${$.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-image-loaded":N!==null&&Y===N?"":void 0,children:xe("img",{src:N??O,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:N===null,onLoad:()=>ie(N),onError:()=>{N!==null&&j(a=>[...a,N])}})}),X&&xe("span",{className:`${$.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:X}}),_t("span",{className:$.text,children:[e.matchedText?ji(Ia(e),e.matchedText).map((a,x)=>a.bold?xe("strong",{className:`${$.match} magicx-aia-option-match`,"data-aia-match-partial":a.partial?"":void 0,children:a.text},x):a.text):Ia(e),e.parameterLabel&&_t(io,{children:[" ",xe("span",{className:`${$.parameter} magicx-aia-option-parameter`,children:e.parameterLabel})]})]}),e.tag&&xe("span",{className:$.tag,children:e.tag}),W!==null&&xe("span",{className:`${$.count} magicx-aia-option-count`,children:W})]})})}import{jsx as La}from"react/jsx-runtime";function fo(){let[e,r]=Oa(oo);return go(()=>{if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia(so),o=()=>r(t.matches);return o(),t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[]),e}function Da({options:e,activeIndex:r,picked:t,onSelect:o,onHighlight:n,onUnhighlight:l,listboxId:s,loading:c,groupKey:w="",optionsPosition:v="below",showIcons:y=!0,showImages:m=!0,showCounts:u=!0}){let p=fo(),k=za(null),[S,T]=Oa(null),O=za(null);Vt(()=>{if(c&&ho(O.current,e))return;O.current=c?null:e;let A=k.current,D=A&&!c&&ro(e.length,p),F=A?.closest("[data-aia-dropdown]");D&&F&&po(F);let Y=D?no(A):null;T(Y?Ea(e.length,p,Y.rowWidths,Y.gridWidth):null)},[e,p,c]);let L=S??Ea(e.length,p,null,null);Vt(()=>{let A=k.current?.closest("[data-aia-dropdown]");A&&mo(A)},[L.template,p]);let j=c?-1:r;Vt(()=>{k.current&&uo(k.current,j)},[j]);let N=co(e,y,m);return La(Ta,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:w,template:L.template,maxHeight:L.maxHeight,innerRef:A=>{k.current=A},"data-aia-group":w,children:e.map((A,D)=>La(Aa,{option:A,isHighlighted:D===r,checked:t?t.includes(A.text):void 0,onSelect:o,onHighlight:F=>{Ra(k.current,D,F)&&n(D)},onUnhighlight:l?F=>{Ra(k.current,-1,F)&&l(D)}:void 0,id:`${s}-option-${D}`,loading:c,showIcon:y&&N,showImage:m&&N,showCount:u,scrollHint:!c&&L.scrollHintIndices.includes(D),enterDelayMs:c?0:lo(D,L.cols,e.length,v)},`${w}\0${A.parameter??""}\0${A.text}`))})}import{formatTime as bo,TIME_WHEEL_COLUMNS as wo,TIME_WHEEL_ROW_HEIGHT as vo,timeWheelIndex as Ma,timeWheelIndexFromScroll as xo,timeWheelRows as yo,withTimeWheelIndex as Na}from"@magicx-eng/ai-autocomplete-vanilla";import{Fragment as ko,useEffect as So,useLayoutEffect as Co,useRef as Ot}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-0d5bb290")){let e=document.createElement("style");e.id="ac-style-0d5bb290",e.textContent=`/* --- Time wheel (replaces the options grid for time suggestions) ---
|
|
3762
3762
|
|
|
3763
3763
|
One of three hand-maintained copies (vanilla styles.css, this file, Angular's
|
|
3764
3764
|
time-wheel.component.css). Only the class-naming layer differs \u2014 the
|
|
@@ -3880,7 +3880,7 @@ import{buildSubmitResult as Ks,cellDay as qs,cellIso as _s,DATE_RANGE_META_END a
|
|
|
3880
3880
|
.aia-done-llNY5:hover {
|
|
3881
3881
|
background: var(--aia-time-done-bg-hover, var(--aia-done-bg-hover, #d8dde8));
|
|
3882
3882
|
}
|
|
3883
|
-
`,document.head.appendChild(e)}var ye={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 et,jsxs as Ut}from"react/jsx-runtime";var To=120;function Fa({view:e,label:r,doneLabel:t,interactive:o=!0,onTimeChange:n,onTimeCommit:l}){return Ut("div",{className:ye.timeWheel,"data-aia-time-wheel":"",role:"group","aria-label":r,onMouseDown:s=>s.preventDefault(),children:[et("span",{className:ye.value,"data-aia-time-value":"","aria-live":"polite",children:bo(e.minutes)}),Ut("div",{className:ye.columns,"aria-hidden":"true",children:[et("div",{className:ye.band}),wo.map(s=>Ut(ko,{children:[s==="minute"&&et("span",{className:ye.separator,children:":"}),et(Po,{column:s,minutes:e.minutes,interactive:o,onTimeChange:n})]},s))]}),et("button",{type:"button",tabIndex:-1,className:ye.done,"data-aia-time-done":"",onClick:()=>{o&&l()},children:t})]})}function Po({column:e,minutes:r,interactive:t,onTimeChange:o}){let n=Ot(null),l=Ot(null),s=Ot(null),c=Ot({minutes:r,interactive:t,onTimeChange:o});c.current={minutes:r,interactive:t,onTimeChange:o};let w=Ma(e,r);Co(()=>{let m=n.current;if(!m||s.current)return;let u=w*vo;Math.abs(m.scrollTop-u)<1||(l.current=u,m.scrollTop=u)},[w]),So(()=>()=>{s.current&&clearTimeout(s.current)},[]);let v=()=>{s.current=null;let m=n.current,u=c.current;if(!m||!u.interactive)return;let p=xo(e,m.scrollTop);p!==Ma(e,u.minutes)&&u.onTimeChange(Na(e,u.minutes,p))},y=()=>{let m=n.current;if(m){if(l.current!=null&&Math.abs(m.scrollTop-l.current)<1){l.current=null;return}l.current=null,s.current&&clearTimeout(s.current),s.current=setTimeout(v,To)}};return et("div",{ref:n,className:ye.column,"data-aia-time-column":e,onScroll:y,children:yo(e).map((m,u)=>et("div",{className:u===w?`${ye.row} ${ye.selected}`:ye.row,"data-aia-time-row":"","data-aia-index":u,onClick:()=>{c.current.interactive&&o(Na(e,c.current.minutes,u))},children:m.label},m.label))})}if(typeof document<"u"&&!document.getElementById("ac-style-
|
|
3883
|
+
`,document.head.appendChild(e)}var ye={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 et,jsxs as Ut}from"react/jsx-runtime";var To=120;function Fa({view:e,label:r,doneLabel:t,interactive:o=!0,onTimeChange:n,onTimeCommit:l}){return Ut("div",{className:ye.timeWheel,"data-aia-time-wheel":"",role:"group","aria-label":r,onMouseDown:s=>s.preventDefault(),children:[et("span",{className:ye.value,"data-aia-time-value":"","aria-live":"polite",children:bo(e.minutes)}),Ut("div",{className:ye.columns,"aria-hidden":"true",children:[et("div",{className:ye.band}),wo.map(s=>Ut(ko,{children:[s==="minute"&&et("span",{className:ye.separator,children:":"}),et(Po,{column:s,minutes:e.minutes,interactive:o,onTimeChange:n})]},s))]}),et("button",{type:"button",tabIndex:-1,className:ye.done,"data-aia-time-done":"",onClick:()=>{o&&l()},children:t})]})}function Po({column:e,minutes:r,interactive:t,onTimeChange:o}){let n=Ot(null),l=Ot(null),s=Ot(null),c=Ot({minutes:r,interactive:t,onTimeChange:o});c.current={minutes:r,interactive:t,onTimeChange:o};let w=Ma(e,r);Co(()=>{let m=n.current;if(!m||s.current)return;let u=w*vo;Math.abs(m.scrollTop-u)<1||(l.current=u,m.scrollTop=u)},[w]),So(()=>()=>{s.current&&clearTimeout(s.current)},[]);let v=()=>{s.current=null;let m=n.current,u=c.current;if(!m||!u.interactive)return;let p=xo(e,m.scrollTop);p!==Ma(e,u.minutes)&&u.onTimeChange(Na(e,u.minutes,p))},y=()=>{let m=n.current;if(m){if(l.current!=null&&Math.abs(m.scrollTop-l.current)<1){l.current=null;return}l.current=null,s.current&&clearTimeout(s.current),s.current=setTimeout(v,To)}};return et("div",{ref:n,className:ye.column,"data-aia-time-column":e,onScroll:y,children:yo(e).map((m,u)=>et("div",{className:u===w?`${ye.row} ${ye.selected}`:ye.row,"data-aia-time-row":"","data-aia-index":u,onClick:()=>{c.current.interactive&&o(Na(e,c.current.minutes,u))},children:m.label},m.label))})}if(typeof document<"u"&&!document.getElementById("ac-style-df577469")){let e=document.createElement("style");e.id="ac-style-df577469",e.textContent=`.aia-stack {
|
|
3884
3884
|
display: flex;
|
|
3885
3885
|
flex-direction: column;
|
|
3886
3886
|
gap: var(--aia-stack-space, 0.5rem);
|
|
@@ -3895,7 +3895,7 @@ import{buildSubmitResult as Ks,cellDay as qs,cellIso as _s,DATE_RANGE_META_END a
|
|
|
3895
3895
|
align-items: end;
|
|
3896
3896
|
}
|
|
3897
3897
|
/* data-align="stretch" is the flex default \u2014 no rule needed. */
|
|
3898
|
-
`,document.head.appendChild(e)}import{jsx as Io}from"react/jsx-runtime";function Ha({space:e,align:r="stretch",className:t,children:o,...n}){let l=e?{"--aia-stack-space":e}:void 0;return Io("div",{className:t?`aia-stack ${t}`:"aia-stack","data-align":r,style:l,...n,children:o})}import{jsx as Z,jsxs as Qt}from"react/jsx-runtime";var _o=typeof window>"u"?tt:Yt,Vo=[159,119,164],Uo=()=>{},Ba=()=>{},Qo=e=>{},Yo=()=>{},jo=e=>{},$o=e=>{},Zo=e=>{},Xo=e=>{};function Jo(e){let r=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[t,o]=qo(r);if(tt(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let n=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>o(n.matches);return n.addEventListener("change",l),()=>n.removeEventListener("change",l)},[e]),e!==void 0)return e==="auto"?t?"dark":"light":e}function en(e,r){let t=ut(null);tt(()=>{let o=e.current,n=r.current;if(!o||!n)return;let l=Bo(o,".aia-grid[data-scroll]");if(t.current&&t.current.grid!==l&&(t.current.controller.destroy(),t.current=null),l&&!t.current){t.current={grid:l,controller:Ao({dropdown:o,grid:l,button:n})};return}t.current?.controller.update()}),tt(()=>()=>{t.current?.controller.destroy(),t.current=null},[])}function tn(e,r){let t=ut(r);t.current=r;let o=ut(null);Yt(()=>{let n=e.current;if(n){if(!o.current){o.current=Eo({dropdown:n,isOpen:()=>t.current});return}o.current.update()}}),tt(()=>()=>{o.current?.destroy(),o.current=null},[])}function jt({suggestions:e,activeIndex:r,onSelect:t,onHighlight:o,onUnhighlight:n,isOpen:l,id:s,className:c,pills:w,onPillClick:v,showPills:y=!0,onSkip:m,showSkipButton:u=!0,showOptionIcons:p=!0,showOptionImages:k=!0,showOptionCounts:S=!0,skipDisabled:T=!1,activeSelected:O=!1,isLoading:L=!1,skeletonExiting:j=!1,isInputEmpty:N=!1,language:A,products:D,onProductSelect:F,onProductAddToCart:Y,onProductFocusChange:ie,productsLayout:X="row",productImageFallback:W="image",showProductVendor:I=!0,formatType:G="options",dateView:se=null,selectedDateIso:le=null,selectedDateRange:ee=null,dateRangeStart:a=null,dateReferences:x,onPreviousMonth:te,onNextMonth:ae,timeView:ne=null,multiSelectView:Ue=null,onMultiSelectCommit:Ie,onSeeAllResults:Ae,seeAllBusy:fe=!1,busyProductId:Qe=null,fullWidth:Ne=!1,onTimeChange:h,onTimeCommit:Ye,locationView:Ee=null,isReediting:Fe=!1,onLocationQuery:f,onLocationMove:C,onLocationCommit:E,onLocationFocusChange:z,isFocused:M=!1,optionsPosition:K="below",mode:pe}){let de=Jo(pe),Re=de!==void 0,oe=ut(null),ze=ut(null);en(oe,ze),tt(()=>{if(oe.current)return Ro(oe.current)},[]);let be=e[0]?.options??[],je=!!(w&&w.length>0&&v),he=!!(D&&D.length>0),He=G==="time"&&ne!=null,it=G==="location"&&Ee!=null,ce=l&&(be.length>0||y&&je||L||he||He||it);tn(oe,ce),_o(()=>{let P=oe.current;P&&(Do(P,Oo(P)),Go(P))});let ue={suggestions:e,activeIndex:r,pills:w,showPills:y,showSkipButton:u,showOptionIcons:p,showOptionImages:k,showOptionCounts:S,skipDisabled:T,activeSelected:O,isLoading:L,skeletonExiting:j,isInputEmpty:N,products:D,formatType:G,dateView:se,selectedDateIso:le,selectedDateRange:ee,dateRangeStart:a,dateReferences:x,timeView:ne,multiSelectView:Ue,locationView:Ee,isReediting:Fe,showsSeeAll:!!Ae},Be=ut(ue);ce&&(Be.current=ue);let i=ce?ue:Be.current,B=Ko(A),we=i.suggestions[0],Se=we?.options??[],$e=i.activeIndex>=0&&!!Se[i.activeIndex]?.is_tappable,Ce=Fo(i.pills??[],B.keepTyping),Le=!!(Ce.length>0&&v),b=i.showPills&&Le,ot=i.showPills&&!Le&&i.isLoading,We=b||ot,Ge=Le&&Mo(Ce)&&i.showSkipButton&&!i.isInputEmpty&&!!m,g=Ce[0]?.text,Ke=No(i.formatType)&&i.dateView!=null,nt=Se.length>0&&!Ke,Oe=Se.length>0&&Ke&&!i.isLoading,rt=i.formatType==="time"&&i.timeView!=null&&!i.isLoading,st=i.formatType==="location"&&i.locationView!=null&&!i.isLoading,qe=i.isLoading&&!nt&&!Oe&&!rt&&!st,lt=i.products??[],De=Ho(b?Ce:[]);return Yt(()=>{oe.current&&Wo(oe.current,De,{visible:ce,anchorBottom:K==="above"})},[De,ce,K,i.suggestions,i.pills,i.isLoading,i.skeletonExiting,i.isInputEmpty,i.products,i.formatType,i.dateView,i.selectedDateIso,i.selectedDateRange,i.dateRangeStart,i.dateReferences,i.timeView,i.multiSelectView,i.locationView,i.showPills,i.showSkipButton,i.showOptionIcons,i.showOptionImages,i.showOptionCounts,i.showsSeeAll,X,A]),tt(()=>{let P=oe.current;return()=>{P&&Lo(P)}},[]),Qt("div",{ref:oe,id:s,role:"listbox","aria-multiselectable":!!i.multiSelectView,"data-aia-dropdown":"","data-options-position":K,"data-mode":de,"data-aia-loading":i.isLoading?"":void 0,"data-aia-skeleton-exiting":i.skeletonExiting?"":void 0,"data-aia-has-products":lt.length>0?"":void 0,"data-aia-full-width":Ne?"":void 0,className:`${Re?"magicx-aia ":""}${me.dropdown} ${ce?me.visible:""} ${c??""}`,onMouseDown:P=>P.preventDefault(),children:[Qt(Ha,{space:"8px",children:[(We||Ge)&&Qt(xt,{noWrap:!0,className:me.pillBar,"data-aia-pillbar":"",children:[We&&Z("span",{className:me.pillScroll,"data-aia-pill-scroll":"",children:Z(Rt,{pills:Ce,activePillIndex:0,activeSelected:i.activeSelected,onSelectPill:v??(()=>{}),rounded:!0,loading:i.isLoading})}),Ge&&Z("button",{type:"button",tabIndex:-1,className:me.skip,"data-aia-skip":"",disabled:i.isLoading||i.skipDisabled,"aria-label":g?`${B.skipLabel} ${g}`:B.skipLabel,onClick:m,children:B.skip})]}),nt&&Z(Da,{options:Se,activeIndex:i.activeIndex,onSelect:t,onHighlight:o,onUnhighlight:n,listboxId:s,loading:i.isLoading,groupKey:we?`${we.parameter} ${we.text}`:"",optionsPosition:K,showIcons:i.showOptionIcons,showImages:i.showOptionImages,showCounts:i.showOptionCounts,picked:i.multiSelectView?.picked}),i.multiSelectView&&Z("div",{"data-aia-multi-actions":"",onClick:P=>{P.target.closest("[data-aia-multi-done]")&&!i.skipDisabled&&!i.isLoading&&Ie?.()},children:Z("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-multi-done":"",className:me.multiDone,ref:P=>{P&&(P.disabled=!0,P.offsetHeight,P.disabled=i.skipDisabled||i.isLoading)},children:B.done})}),Oe&&i.dateView&&Z(ua,{options:Se,activeIndex:i.activeIndex,listboxId:s,view:i.dateView,selection:{selectedIso:i.selectedDateIso??null,selectedRange:i.selectedDateRange??null,rangeStart:i.dateRangeStart??null,floor:zo(i.formatType,i.dateRangeStart),references:i.dateReferences??[]},onSelect:t,onHighlight:o,onUnhighlight:n,onPreviousMonth:te??Ba,onNextMonth:ae??Ba}),rt&&i.timeView&&Z(Fa,{view:i.timeView,label:B.timeLabel,doneLabel:B.done,interactive:!i.skipDisabled,onTimeChange:h??Qo,onTimeCommit:Ye??Yo}),st&&i.locationView&&Z(ya,{view:i.locationView,searchLabel:B.locationSearch,noResultsLabel:B.locationNoResults,useTypedLabel:B.locationUseTyped,widgetFocused:M&&ce,reediting:i.isReediting,visible:ce,interactive:!i.skipDisabled,onQuery:f??jo,onMove:C??$o,onCommit:E??Zo,onFocusChange:z??Xo}),qe&&Z("div",{className:me.skeletonBars,"data-aia-skeleton-bars":"",children:Vo.map(P=>Z("span",{className:me.skeletonBar,style:{width:P}},`bar-${P}`))}),Z(Ca,{products:lt,listboxId:s,onSelect:F??Uo,busyProductId:Qe,onAddToCart:Y,onFocusChange:ie,focusable:ce&&!i.isLoading,loading:i.isLoading,layout:X,imageFallback:W,showVendor:I,strings:B}),i.showsSeeAll&&Z("div",{className:me.seeAllRow,"data-aia-see-all":"",onClick:P=>{P.target.closest("[data-aia-see-all-button]")&&(P.stopPropagation(),!(i.isLoading||fe)&&Ae?.())},children:Z("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-see-all-button":"","data-aia-see-all-state":fe?"busy":void 0,"aria-busy":fe?!0:void 0,className:me.seeAll,ref:P=>{P&&(P.disabled=!0,P.offsetHeight,P.disabled=i.isLoading)},children:B.seeAllResults})}),Z(fa,{isOptionHighlighted:$e,isInputEmpty:i.isInputEmpty,strings:B})]}),Z("button",{ref:ze,type:"button",tabIndex:-1,className:me.scrollArrow,"data-aia-scroll-arrow":"","aria-label":B.scrollArrow,"aria-hidden":"true",children:Z("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:Z("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}import{buildSubmitResult as En,focusEditorFromTap as Rn,ModeController as zn,setCursorOffset as Ln,uiStringsFor as On,watchEditorHeight as Dn}from"@magicx-eng/ai-autocomplete-vanilla";import{uiStringsFor as an}from"@magicx-eng/ai-autocomplete-vanilla";if(typeof document<"u"&&!document.getElementById("ac-style-
|
|
3898
|
+
`,document.head.appendChild(e)}import{jsx as Io}from"react/jsx-runtime";function Ha({space:e,align:r="stretch",className:t,children:o,...n}){let l=e?{"--aia-stack-space":e}:void 0;return Io("div",{className:t?`aia-stack ${t}`:"aia-stack","data-align":r,style:l,...n,children:o})}import{jsx as Z,jsxs as Qt}from"react/jsx-runtime";var _o=typeof window>"u"?tt:Yt,Vo=[159,119,164],Uo=()=>{},Ba=()=>{},Qo=e=>{},Yo=()=>{},jo=e=>{},$o=e=>{},Zo=e=>{},Xo=e=>{};function Jo(e){let r=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[t,o]=qo(r);if(tt(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let n=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>o(n.matches);return n.addEventListener("change",l),()=>n.removeEventListener("change",l)},[e]),e!==void 0)return e==="auto"?t?"dark":"light":e}function en(e,r){let t=ut(null);tt(()=>{let o=e.current,n=r.current;if(!o||!n)return;let l=Bo(o,".aia-grid[data-scroll]");if(t.current&&t.current.grid!==l&&(t.current.controller.destroy(),t.current=null),l&&!t.current){t.current={grid:l,controller:Ao({dropdown:o,grid:l,button:n})};return}t.current?.controller.update()}),tt(()=>()=>{t.current?.controller.destroy(),t.current=null},[])}function tn(e,r){let t=ut(r);t.current=r;let o=ut(null);Yt(()=>{let n=e.current;if(n){if(!o.current){o.current=Eo({dropdown:n,isOpen:()=>t.current});return}o.current.update()}}),tt(()=>()=>{o.current?.destroy(),o.current=null},[])}function jt({suggestions:e,activeIndex:r,onSelect:t,onHighlight:o,onUnhighlight:n,isOpen:l,id:s,className:c,pills:w,onPillClick:v,showPills:y=!0,onSkip:m,showSkipButton:u=!0,showOptionIcons:p=!0,showOptionImages:k=!0,showOptionCounts:S=!0,skipDisabled:T=!1,activeSelected:O=!1,isLoading:L=!1,skeletonExiting:j=!1,isInputEmpty:N=!1,language:A,products:D,onProductSelect:F,onProductAddToCart:Y,onProductFocusChange:ie,productsLayout:X="row",productImageFallback:W="image",showProductVendor:I=!0,formatType:G="options",dateView:se=null,selectedDateIso:le=null,selectedDateRange:ee=null,dateRangeStart:a=null,dateReferences:x,onPreviousMonth:te,onNextMonth:ae,timeView:ne=null,multiSelectView:Ue=null,onMultiSelectCommit:Ie,onSeeAllResults:Ae,seeAllBusy:fe=!1,busyProductId:Qe=null,fullWidth:Ne=!1,onTimeChange:h,onTimeCommit:Ye,locationView:Ee=null,isReediting:Fe=!1,onLocationQuery:f,onLocationMove:C,onLocationCommit:E,onLocationFocusChange:z,isFocused:M=!1,optionsPosition:K="below",mode:pe}){let de=Jo(pe),Re=de!==void 0,oe=ut(null),ze=ut(null);en(oe,ze),tt(()=>{if(oe.current)return Ro(oe.current)},[]);let be=e[0]?.options??[],je=!!(w&&w.length>0&&v),he=!!(D&&D.length>0),He=G==="time"&&ne!=null,it=G==="location"&&Ee!=null,ce=l&&(be.length>0||y&&je||L||he||He||it);tn(oe,ce),_o(()=>{let P=oe.current;P&&(Do(P,Oo(P)),Go(P))});let ue={suggestions:e,activeIndex:r,pills:w,showPills:y,showSkipButton:u,showOptionIcons:p,showOptionImages:k,showOptionCounts:S,skipDisabled:T,activeSelected:O,isLoading:L,skeletonExiting:j,isInputEmpty:N,products:D,formatType:G,dateView:se,selectedDateIso:le,selectedDateRange:ee,dateRangeStart:a,dateReferences:x,timeView:ne,multiSelectView:Ue,locationView:Ee,isReediting:Fe,showsSeeAll:!!Ae},Be=ut(ue);ce&&(Be.current=ue);let i=ce?ue:Be.current,B=Ko(A),we=i.suggestions[0],Se=we?.options??[],$e=i.activeIndex>=0&&!!Se[i.activeIndex]?.is_tappable,Ce=Fo(i.pills??[],B.keepTyping),Le=!!(Ce.length>0&&v),b=i.showPills&&Le,ot=i.showPills&&!Le&&i.isLoading,We=b||ot,Ge=Le&&Mo(Ce)&&i.showSkipButton&&!i.isInputEmpty&&!!m,g=Ce[0]?.text,Ke=No(i.formatType)&&i.dateView!=null,nt=Se.length>0&&!Ke,Oe=Se.length>0&&Ke&&!i.isLoading,rt=i.formatType==="time"&&i.timeView!=null&&!i.isLoading,st=i.formatType==="location"&&i.locationView!=null&&!i.isLoading,qe=i.isLoading&&!nt&&!Oe&&!rt&&!st,lt=i.products??[],De=Ho(b?Ce:[]);return Yt(()=>{oe.current&&Wo(oe.current,De,{visible:ce,anchorBottom:K==="above"})},[De,ce,K,i.suggestions,i.pills,i.isLoading,i.skeletonExiting,i.isInputEmpty,i.products,i.formatType,i.dateView,i.selectedDateIso,i.selectedDateRange,i.dateRangeStart,i.dateReferences,i.timeView,i.multiSelectView,i.locationView,i.showPills,i.showSkipButton,i.showOptionIcons,i.showOptionImages,i.showOptionCounts,i.showsSeeAll,X,A]),tt(()=>{let P=oe.current;return()=>{P&&Lo(P)}},[]),Qt("div",{ref:oe,id:s,role:"listbox","aria-multiselectable":!!i.multiSelectView,"data-aia-dropdown":"","data-options-position":K,"data-mode":de,"data-aia-loading":i.isLoading?"":void 0,"data-aia-skeleton-exiting":i.skeletonExiting?"":void 0,"data-aia-has-products":lt.length>0?"":void 0,"data-aia-full-width":Ne?"":void 0,className:`${Re?"magicx-aia ":""}${me.dropdown} ${ce?me.visible:""} ${c??""}`,onMouseDown:P=>P.preventDefault(),children:[Qt(Ha,{space:"8px",children:[(We||Ge)&&Qt(xt,{noWrap:!0,className:me.pillBar,"data-aia-pillbar":"",children:[We&&Z("span",{className:me.pillScroll,"data-aia-pill-scroll":"",children:Z(Rt,{pills:Ce,activePillIndex:0,activeSelected:i.activeSelected,onSelectPill:v??(()=>{}),rounded:!0,loading:i.isLoading})}),Ge&&Z("button",{type:"button",tabIndex:-1,className:me.skip,"data-aia-skip":"",disabled:i.isLoading||i.skipDisabled,"aria-label":g?`${B.skipLabel} ${g}`:B.skipLabel,onClick:m,children:B.skip})]}),nt&&Z(Da,{options:Se,activeIndex:i.activeIndex,onSelect:t,onHighlight:o,onUnhighlight:n,listboxId:s,loading:i.isLoading,groupKey:we?`${we.parameter} ${we.text}`:"",optionsPosition:K,showIcons:i.showOptionIcons,showImages:i.showOptionImages,showCounts:i.showOptionCounts,picked:i.multiSelectView?.picked}),i.multiSelectView&&Z("div",{"data-aia-multi-actions":"",onClick:P=>{P.target.closest("[data-aia-multi-done]")&&!i.skipDisabled&&!i.isLoading&&Ie?.()},children:Z("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-multi-done":"",className:me.multiDone,ref:P=>{P&&(P.disabled=!0,P.offsetHeight,P.disabled=i.skipDisabled||i.isLoading)},children:B.done})}),Oe&&i.dateView&&Z(ua,{options:Se,activeIndex:i.activeIndex,listboxId:s,view:i.dateView,selection:{selectedIso:i.selectedDateIso??null,selectedRange:i.selectedDateRange??null,rangeStart:i.dateRangeStart??null,floor:zo(i.formatType,i.dateRangeStart),references:i.dateReferences??[]},onSelect:t,onHighlight:o,onUnhighlight:n,onPreviousMonth:te??Ba,onNextMonth:ae??Ba}),rt&&i.timeView&&Z(Fa,{view:i.timeView,label:B.timeLabel,doneLabel:B.done,interactive:!i.skipDisabled,onTimeChange:h??Qo,onTimeCommit:Ye??Yo}),st&&i.locationView&&Z(ya,{view:i.locationView,searchLabel:B.locationSearch,noResultsLabel:B.locationNoResults,useTypedLabel:B.locationUseTyped,widgetFocused:M&&ce,reediting:i.isReediting,visible:ce,interactive:!i.skipDisabled,onQuery:f??jo,onMove:C??$o,onCommit:E??Zo,onFocusChange:z??Xo}),qe&&Z("div",{className:me.skeletonBars,"data-aia-skeleton-bars":"",children:Vo.map(P=>Z("span",{className:me.skeletonBar,style:{width:P}},`bar-${P}`))}),Z(Ca,{products:lt,listboxId:s,onSelect:F??Uo,busyProductId:Qe,onAddToCart:Y,onFocusChange:ie,focusable:ce&&!i.isLoading,loading:i.isLoading,layout:X,imageFallback:W,showVendor:I,strings:B}),i.showsSeeAll&&Z("div",{className:me.seeAllRow,"data-aia-see-all":"",onClick:P=>{P.target.closest("[data-aia-see-all-button]")&&(P.stopPropagation(),!(i.isLoading||fe)&&Ae?.())},children:Z("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-see-all-button":"","data-aia-see-all-state":fe?"busy":void 0,"aria-busy":fe?!0:void 0,className:me.seeAll,ref:P=>{P&&(P.disabled=!0,P.offsetHeight,P.disabled=i.isLoading)},children:B.seeAllResults})}),Z(fa,{isOptionHighlighted:$e,isInputEmpty:i.isInputEmpty,strings:B})]}),Z("button",{ref:ze,type:"button",tabIndex:-1,className:me.scrollArrow,"data-aia-scroll-arrow":"","aria-label":B.scrollArrow,"aria-hidden":"true",children:Z("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:Z("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}import{buildSubmitResult as En,focusEditorFromTap as Rn,ModeController as zn,setCursorOffset as Ln,uiStringsFor as On,watchEditorHeight as Dn}from"@magicx-eng/ai-autocomplete-vanilla";import{uiStringsFor as an}from"@magicx-eng/ai-autocomplete-vanilla";if(typeof document<"u"&&!document.getElementById("ac-style-5cd72098")){let e=document.createElement("style");e.id="ac-style-5cd72098",e.textContent=`.aia-submitButton-otz7H {
|
|
3899
3899
|
flex-shrink: 0;
|
|
3900
3900
|
width: 32px;
|
|
3901
3901
|
height: 32px;
|