1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64686],{9247:(e,t,a)=>{a.d(t,{C:()=>i,L:()=>n});let i=e=>"number"==typeof e&&Number.isInteger(e)&&e>0,n=({hasRenderableAnswerContent:e,isProductListRevealPending:t,isTextFromVoss:a})=>e&&!t&&!a},64686:(e,t,a)=>{a.d(t,{jN:()=>ee,Ay:()=>et});var i=a(95155),n=a(73321),l=a(39268),s=a(63327),r=a(12115),d=a(81901),o=a(69287),c=a(32460),u=a(7686),m=a(33210),h=a(29874),p=a(35011),v=a(25422),g=a(2726),b=a(95085),x=a(67817),y=a(62478),f=a(10765),w=a(55315),k=a(32671),j=a(7546),N=a(1309),C=a(95148),P=a(97879),R=a(31044),I=a(54420),A=a(17876),S=a(10791),T=a(1002),D=a(74063),M=a(59873),_=a(75856),U=a(69964),W=a(33575),L=a(9083),F=a(76883),O=a(97463);function Q(e){let{wine:t,wineTitle:a,wineUrl:n,searchId:l,isRejected:s,imageSavePercent:r,displayPrice:d,strikethroughPrice:o,onWineDetail:u}=e,m=f.vu.copilot.wineCardSaveBadge(l,t.id),h=f.vu.copilot.wineCardImage(l,t.id),p=f.vu.copilot.wineCardImageLink(l,t.id),v=f.vu.copilot.wineCardPrice(l,t.id),g=(0,i.jsxs)("div",{className:"relative flex h-[112px] w-[88px] items-center justify-center overflow-hidden rounded-vd-s bg-vd-beige px-2 py-1.5",children:[(0,i.jsx)("div",{className:"absolute h-[86%] w-[58%] rounded-full bg-vd-white opacity-70 blur-[18px]"}),(0,i.jsx)(F.p,{src:t.image,alt:a,width:52,height:104,className:(0,c.cn)("relative max-h-[104px] max-w-[64px] object-contain mix-blend-multiply",s?"grayscale opacity-35":"transition-transform group-hover:scale-105"),placeholderComponent:(0,i.jsx)(L.A,{width:52,height:104,type:"small",showText:!1}),"data-testid":h}),null!=r&&r>0&&!s?(0,i.jsx)("div",{className:"absolute left-0 top-1/2 z-10 -translate-y-1/2",children:(0,i.jsx)(O.Z,{percentage:r,size:"small","data-testid":m})}):null]});return(0,i.jsxs)("div",{className:"relative flex w-[88px] shrink-0 flex-col items-stretch gap-1",children:[s?(0,i.jsx)("div",{className:"flex w-full items-center justify-center rounded-vd-s",children:g}):(0,i.jsx)("a",{href:n,onClick:u,"data-testid":p,className:"flex w-full items-center justify-center rounded-vd-s",children:g}),null==d||s?null:(0,i.jsx)(W.u,{price:d,strikethroughPrice:null!=d&&null!=o&&o>d?o:void 0,size:"small",layout:"stacked",className:"items-center gap-0.5 whitespace-nowrap text-center","data-testid":v})]})}function z(e){let{wine:t,recommendationMessageId:a,recommendationRank:l,searchId:d,modelVersion:o,promptVersion:c,onMoreLikeThis:u,onDislikeSubmitted:m,isReadOnly:p=!1}=e,f=function({wine:e,recommendationMessageId:t,recommendationRank:a,searchId:i,modelVersion:l,promptVersion:d,onMoreLikeThis:o,onDislikeSubmitted:c}){let u=(0,n.useRouter)(),{enqueueSnackbar:m}=(0,h.dh)(),{setCopilotVisible:p}=(0,N.A)(),{activeSessionId:f}=(0,A.A)(),{isDesktop:W}=(0,w.k)(),{addToCart:L,isAddingCart:F}=(0,P.A)(),{onUpdateCartQuantity:O}=(0,R.U)(),{setAddedWine:Q}=(0,T.A)(),{addWineCellarVintage:z,removeWineCellarVintage:V,setWineCellarStatistic:q,wineCellarVintages:K}=(0,D.A)(),{isUS:$}=(0,S.A)(),{belongToShoppingCartId:E,belongToShoppingLineItemId:Y,existingCountInCart:B,winePrice:X}=(0,I.A)(e),Z=(0,n.usePathname)(),G=(0,g.yw)(),{isLoggedIn:H}=(0,C.A)(),J=(0,x.vY)(e.vintageYear,void 0),ee=J?`${e.title} ${J}`:e.title,[et,ea]=(0,r.useState)(!1),[ei,en]=(0,r.useState)(e.preference?.isInWineCellar?"like":null),[el]=(0,r.useState)(!!e.preference?.isInWineCellar),[es,er]=(0,r.useState)(!1),[ed,eo]=(0,r.useState)(null),[ec,eu]=(0,r.useState)(!1),[em,eh]=(0,r.useState)(!1),[ep,ev]=(0,r.useState)([]),[eg,eb]=(0,r.useState)(""),ex=(0,s.p)(`${y.Ksj}/${e.wineSlug||e.slug}`,{year:e.vintageYear,source:"vossai"}),ey=e.shoppingPrices?.[0],ef=(0,k.eO)(e.shoppingPrices),ew=ey?.minimumOrderQuantity??(0,k.Zx)(ef),ek=(0,k.WY)(ew,ey?.defaultQuantity??y.TC1),ej=B||ew,eN=ef?.some(e=>ej>=e.minQuantity)?ef:null,eC=eN?(0,k.pl)(eN,ej):null,eP=eN?(0,j.ss)(eN,ej):null,eR=e.price??ey?.priceAmount??X??null,eI=ek>y.TC1,eA=(0,k.hL)(eR,e.shoppingPrices),eS=eI?eR:eA.purchasePrice,{strikethroughPrice:eT}=eA,eD=eC??(eT?eS:eR),eM=eC?eT??eP??null:eT,e_=null!=eM&&null!=eD&&eM>eD?eM:null,eU=(0,k._W)(eD??null,e_),eW=!f||!t,eL=ep.length>0||!!eg.trim(),eF=!!(ey&&$()),eO=e=>{e.preventDefault(),e.stopPropagation()},eQ=async i=>
1{if(eO(i),!ec)try{if(eo("like"),eu(!0),"like"===ei){let t=H&&es;if(t){await (0,b.ge)(e.id),V(e.id);let t=await (0,b.rX)();q(t),er(!1)}en(null),eh(!1),ev([]),eb(""),m(t?"Removed from your wine cellar.":"Selection cleared.",{variant:"success"});return}if(!f||!t)return void m("We were unable to send feedback for this recommendation. Please try again.",{variant:"error"});if(await (0,b.kD)(e.id,{sessionId:f,messageId:t,comment:"",recommendationRank:a}),H&&K&&!K.some(t=>"vintage"===t.dataType&&t.data.id===e.id)&&z({data:e,dataType:"vintage"}),H){let e=await (0,b.rX)();q(e),er(!el)}en("like"),eh(!1),ev([]),eb(""),m(H?"Added to your wine cellar.":"Thanks for the feedback.",{variant:"success"})}catch{m(H?"We were unable to update your wine cellar. Please try again.":"We were unable to send feedback for this recommendation. Please try again.",{variant:"error"})}finally{eo(null),eu(!1)}},ez=async i=>{eO(i);let n=[...ep,eg.trim()].filter(Boolean).join(", ");if(n){if(!f||!t)return void m("We were unable to send feedback for this recommendation. Please try again.",{variant:"error"});try{eo("dislike"),eu(!0);let i=H&&"like"===ei&&es;if(await (0,b.Eq)(e.id,{sessionId:f,messageId:t,comment:n,recommendationRank:a}),i){await (0,b.ge)(e.id),V(e.id);let t=await (0,b.rX)();q(t),er(!1)}en("dislike"),eh(!1),ev([]),eb(""),m("Thanks for the feedback.",{variant:"success"}),c?.({wineId:e.id,wineTitle:ee,reason:n,messageId:t,recommendationRank:a})}catch{m("We were unable to send feedback for this recommendation. Please try again.",{variant:"error"})}finally{eo(null),eu(!1)}}},eV=async t=>{let n;if(eO(t),!ey)return;(0,M._)();let s={source:"voss_ai",chat_session_id:(n={chatSessionId:f,searchId:i,vintageId:e.id,recommendationRank:a,modelVersion:l,promptVersion:d}).chatSessionId||null,search_id:n.searchId||null,vintage_id:n.vintageId||null,recommendation_rank:n.recommendationRank??null,model_version:n.modelVersion||null,prompt_version:n.promptVersion||null},r=await L(ey.variantId,ey.vendorId,ek,s);if(!r){(0,M.o)(),m("We were unable to add the item to the cart. Please try again.",{variant:"error"});return}Q({...e,price:X}),(0,v.UN)(e,ey,ek,Z,r,{...G,list_id:G.list_id??"vossai_recommendation"},"copilot_card"),(0,U.M)(e,ey,ek,H,Z),(0,_.Uu)(_.qM.ADD_TO_CART,{contentIds:e.id,value:ey.priceAmount},r)};return{wineTitle:ee,recommendationFeedback:ei,isRejected:"dislike"===ei,pendingRecommendationFeedback:ed,isDislikePromptOpen:em,selectedDislikeReasons:ep,dislikeMessage:eg,setDislikeMessage:eb,isSubmittingRecommendationFeedback:ec,isUpdatingCartQuantity:et,isAddingCart:F,wineUrl:ex,shoppingPrice:ey,displayPrice:eD,strikethroughPrice:e_,imageSavePercent:eU,isRecommendationFeedbackUnavailable:eW,existingCountInCart:B,canSubmitDislike:eL,showCartAction:eF,handleWineDetail:e=>{e.defaultPrevented||0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),u.push(ex),W||p(!1))},handleMoreLikeThis:e=>{eO(e),o?.(ee)},handleLike:eQ,handleDislike:e=>{eO(e),ec||eW||eh(e=>{let t=!e;return t||(ev([]),eb("")),t})},handleToggleDislikeReason:e=>{ev(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},handleCancelDislike:e=>{eO(e),eh(!1),ev([]),eb("")},handleSubmitDislike:ez,handleAddToCart:eV,handleUpdateCartQuantity:async(e,t)=>{if(eO(e),!E||!Y)return;ea(!0);let{success:a,removeSuccess:i,superseded:n}=await O(E,Y,t,{shouldShowInventoryError:!1});ea(!1),!n&&(a||i||m("We were unable to update the cart. Please try again.",{variant:"error"}))}}}({wine:t,recommendationMessageId:a,recommendationRank:l,searchId:d,modelVersion:o,promptVersion:c,onMoreLikeThis:u,onDislikeSubmitted:m});return(0,i.jsxs)("div",{className:"w-full whitespace-normal",children:[(0,i.jsx)($,{wine:t,wineTitle:f.wineTitle,wineUrl:f.wineUrl,recommendationRank:l,searchId:d,recommendationFeedback:f.recommendationFeedback,pendingRecommendationFeedback:f.pendingRecommendationFeedback,isDislikePromptOpen:f.isDislikePromptOpen,isRejected:f.isRejected,isSubmittingRecommendationFeedback:f.isSubmittingRecommendationFeedback,displayPrice:f.displayPrice,strikethroughPrice:f.strikethroughPrice,shoppingPrice:f.shoppingPrice,existingCountInCart:f.existingCountInCart,isUpdatingCartQuantity:f.isUpdatingCartQuantity,isAddingCart:f.isAddingCart,showCartAction:f.showCartAction,isReadOnly:p,imageSavePercent:f.imageSavePercent,isRecommendationFeedbackUnavailable:f.isRecommendationFeedbackUnavailable,onLike:f.handleLike,onDislike:f.handleDislike,onWineDetail:f.handleWineDetail,onAddToCart:f.handleAddToCart,onUpdateCartQuantity:f.handleUpdate
1CartQuantity,onMoreLikeThis:f.handleMoreLikeThis}),f.isDislikePromptOpen?(0,i.jsx)(G,{selectedReasons:f.selectedDislikeReasons,message:f.dislikeMessage,isSubmitting:f.isSubmittingRecommendationFeedback,canSubmit:f.canSubmitDislike,onReasonToggle:f.handleToggleDislikeReason,onMessageChange:f.setDislikeMessage,onCancel:f.handleCancelDislike,onSubmit:f.handleSubmitDislike}):null]})}let V=["Too pricey","Wrong style","Wrong grape","Already tried","Not my taste"],q=/^(?:[vV]|[ââ])\s+/,K="flex size-8 items-center justify-center rounded-full border border-vd-separator-1 bg-vd-white text-vd-typography-tertiary shadow-sm transition-colors hover:border-vd-typography-tertiary hover:bg-vd-white hover:text-vd-typography-primary disabled:cursor-not-allowed disabled:opacity-60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-vd-black focus-visible:ring-offset-2";function $(e){let{wine:t,wineTitle:a,wineUrl:n,recommendationRank:l,searchId:s,recommendationFeedback:r,pendingRecommendationFeedback:d,isDislikePromptOpen:o,isRejected:u,isSubmittingRecommendationFeedback:m,imageSavePercent:h,isRecommendationFeedbackUnavailable:p,displayPrice:v,strikethroughPrice:g,shoppingPrice:b,existingCountInCart:x,isUpdatingCartQuantity:y,isAddingCart:f,showCartAction:w,isReadOnly:k,onLike:j,onDislike:N,onWineDetail:C,onAddToCart:P,onUpdateCartQuantity:R,onMoreLikeThis:I}=e;return(0,i.jsxs)("div",{className:(0,c.cn)("group relative flex min-h-[148px] w-full gap-3 overflow-hidden rounded-2xl border p-3 transition-colors",u?"cursor-default border-vd-separator-2 bg-vd-light-gray":"cursor-pointer border-neutral-200 bg-white"),onClick:u?void 0:C,"aria-label":u?`${a}
1 removed. Voss will adjust.`:void 0,children:[u||k?null:(0,i.jsx)(E,{recommendationFeedback:r,pendingRecommendationFeedback:d,isDislikePromptOpen:o,isSubmitting:m,isFeedbackUnavailable:p,onLike:j,onDislike:N}),(0,i.jsx)(Q,{wine:t,wineTitle:a,wineUrl:n,searchId:s,isRejected:u,imageSavePercent:h,displayPrice:v,strikethroughPrice:g,onWineDetail:C}),(0,i.jsx)(Y,{wine:t,wineTitle:a,wineUrl:n,isRejected:u,recommendationRank:l,shoppingPrice:b,existingCountInCart:x,isUpdatingCartQuantity:y,isAddingCart:f,showCartAction:w,isReadOnly:k,onWineDetail:C,onAddToCart:P,onUpdateCartQuantity:R,onMoreLikeThis:I})]})}function E(e){let{recommendationFeedback:t,pendingRecommendationFeedback:a,isDislikePromptOpen:n,isSubmitting:l,isFeedbackUnavailable:s,onLike:r,onDislike:d}=e,o="like"===t,h="dislike"===t,p="like"===a,v="dislike"===a,g=!v&&(n||h),b="border-vd-separator-1 bg-vd-separator-2 text-vd-typography-tertiary opacity-100 disabled:opacity-100 disabled:text-vd-typography-tertiary";return(0,i.jsxs)("div",{role:"group","aria-label":"Recommendation feedback",className:"absolute right-3 top-3 z-20 flex flex-col gap-2",children:[(0,i.jsx)("button",{type:"button","aria-label":o?"Clear selected like for this recommendation":"Like this recommendation","aria-pressed":o,onClick:r,disabled:l||!o&&s,className:(0,c.cn)(K,o&&"border-vd-black bg-vd-black text-vd-white opacity-100 hover:bg-vd-black hover:text-vd-white disabled:opacity-100 disabled:text-vd-white",p&&b),"data-active":o&&!p,children:(0,i.jsx)(u.A,{className:"size-4"})}),(0,i.jsx)("button",{type:"button","aria-label":h?"Clear selected dislike for this recommendation":"Dislike this recommendation","aria-expanded":n,"aria-pressed":g,onClick:d,disabled:l||!h&&s,className:(0,c.cn)(K,g&&"border-vd-black bg-vd-black text-vd-white opacity-100 hover:bg-vd-black hover:text-vd-white disabled:opacity-100 disabled:text-vd-white",v&&b),"data-active":g&&!v,children:(0,i.jsx)(m.A,{className:"size-4"})})]})}function Y(e){let t,{wine:a,wineTitle:n,wineUrl:l,isRejected:s,recommendationRank:r,shoppingPrice:u,existingCountInCart:m,isUpdatingCartQuantity:h,isAddingCart:p,showCartAction:v,isReadOnly:g,onWineDetail:b,onAddToCart:x,onUpdateCartQuantity:y,onMoreLikeThis:w}=e,k=(t=(a.matchReason??a.match_reason)?.trim(),t?.replace(q,"").trim()),j=v?u:void 0,N=f.vu.copilot.wineCardAddToCart(r??a.id),C=(0,i.jsxs)("div",{className:(0,c.cn)("min-w-0 space-y-1",!s&&!g&&"pr-10"),children:[(0,i.jsx)("p",{title:n,className:(0,c.cn)((0,o.M)({variant:"body-small",weight:"semibold"}),"line-clamp-2 whitespace-normal",s?"text-vd-typography-disabled line-through":"text-vd-black"),children:n}),!s&&a.overPrice?(0,i.jsx)("div",{className:"inline-flex self-start rounded-full bg-vd-health-error/[0.08] px-vd-s py-vd-xxs",children:(0,i.jsx)("span",{className:(0,c.cn)((0,o.M)({variant:"caption-large",weight:"semibold"}),"text-vd-health-error"),children:"Over budget"})}):null,s?(0,i.jsx)("p",{className:(0,c.cn)((0,o.M)({variant:"body-small",weight:"regular"}),"text-vd-typography-disabled"),children:"Removed - Voss will adju
1st"}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:(0,c.cn)((0,o.M)({variant:"caption-large",weight:"regular"}),"flex min-w-0 items-center gap-1 text-vd-typography-secondary"),children:(0,i.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[(0,i.jsx)(d.In,{icon:"solar:star-bold",className:"size-3.5 shrink-0 text-vd-black"}),null!=a.userRating?a.userRating.toFixed(1):"N/A",null!=a.userRatingCount?(0,i.jsxs)("span",{className:"truncate text-vd-typography-tertiary",children:["(",a.userRatingCount,")"]}):null]})}),(0,i.jsx)("p",{className:(0,c.cn)((0,o.M)({variant:"caption-large",weight:"regular"}),"line-clamp-1 min-w-0 text-vd-typography-tertiary"),children:[a.country,a.region].filter(Boolean).join(" \xb7 ")})]})]});return(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[s?(0,i.jsx)("div",{className:"min-w-0",children:C}):(0,i.jsx)("a",{href:l,onClick:b,className:"min-w-0 text-black no-underline",children:C}),(0,i.jsxs)("div",{className:(0,c.cn)("flex flex-1 flex-col gap-2",s&&"opacity-35 grayscale"),children:[k?(0,i.jsx)(X,{reason:k,isMuted:s}):null,g?null:(0,i.jsxs)("div",{className:"mt-auto grid w-full grid-cols-2 items-center gap-2",children:[j?(0,i.jsx)(Z,{shoppingPrice:j,addToCartTestId:N,existingCountInCart:m,isUpdatingCartQuantity:h,isAddingCart:p,isDisabled:s,onAddToCart:x,onUpdateCartQuantity:y}):u?null:(0,i.jsx)(B,{}),(0,i.jsx)("button",{type:"button",onClick:w,disabled:s,className:(0,c.cn)((0,o.M)({variant:"caption-large",weight:"semibold"}),"flex h-8 min-w-0 items-center justify-center whitespace-nowrap rounded-full bg-vd-black px-vd-s text-vd-white disabled:cursor-not-allowed disabled:bg-vd-light-gray disabled:text-vd-typography-disabled"),children:"More like this"})]})]})]})}function B(){return(0,i.jsx)("button",{type:"button","aria-disabled":"true",tabIndex:-1,onClick:e=>{e.preventDefault(),e.stopPropagation()},className:"flex h-8 min-w-0 cursor-default items-center justify-center whitespace-nowrap rounded-full bg-vd-light-gray px-vd-s",children:(0,i.jsx)("span",{className:(0,c.cn)((0,o.M)({variant:"caption-large",weight:"semibold"}),"text-vd-typography-secondary"),children:"Not available"})})}function X({reason:e,isMuted:t=!1}){return(0,i.jsx)("div",{className:(0,c.cn)((0,o.M)({variant:"body-small",weight:"medium"}),"min-h-[22px]",t?"text-vd-typography-disabled":"text-vd-health-good"),children:(0,i.jsx)("span",{className:"line-clamp-2 min-w-0 italic",children:e})})}function Z(e){let{shoppingPrice:t,addToCartTestId:a,existingCountInCart:n,isUpdatingCartQuantity:l,isAddingCart:s,isDisabled:r=!1,onAddToCart:d,onUpdateCartQuantity:u}=e;return n>0?(0,i.jsxs)("div",{className:(0,c.cn)((0,o.M)({variant:"caption-large",weight:"semibold"}),"flex h-8 min-w-0 items-center justify-center rounded-full border border-neutral-200 bg-white text-vd-black"),children:[(0,i.jsx)("button",{type:"button","aria-label":"Decrease quantity",onClick:e=>u(e,n-1),disabled:r||l,className:"flex h-full flex-1 items-center justify-center rounded-l-full disabled:text-neutral-300",children:"-"}),(0,i.jsx)("span",{className:"min-w-8 text-center",children:l?"...":n}),(0,i.jsx)("button",{type:"button","aria-label":"Increase quantity",onClick:e=>u(e,n+1),disabled:r||l||n>=(t.stockQuantity??1/0),className:"flex h-full flex-1 items-center justify-center rounded-r-full disabled:text-neutral-300",children:"+"})]}):(0,i.jsx)("button",{type:"button","data-testid":a,onClick:d,disabled:r||s,className:(0,c.cn)((0,o.M)({variant:"caption-large",weight:"semibold"}),"flex h-8 min-w-0 items-center justify-center whitespace-nowrap rounded-full bg-vd-black px-vd-s text-vd-white disabled:bg-neutral-200 disabled:text-neutral-500"),children:s?(0,i.jsx)(p.A,{color:"white",loading:!0,size:14,"aria-label":"Loading Spinner"}):"Add to cart"})}function G(e){let{selectedReasons:t,message:a,isSubmitting:n,canSubmit:l,onReasonToggle:s,onMessageChange:r,onCancel:d,onSubmit:u}=e;return(0,i.jsxs)("div",{className:"mt-vd-xs rounded-vd-s border border-vd-separator-1 bg-vd-white p-vd-sm",onMouseDown:e=>e.stopPropagation(),onClick:e=>
1e.stopPropagation(),children:[(0,i.jsx)("p",{className:(0,c.cn)((0,o.M)({variant:"body-small",weight:"semibold"}),"text-vd-black"),children:"Why not this wine?"}),(0,i.jsx)("div",{className:"mt-vd-xs flex flex-wrap gap-vd-xxs",children:V.map(e=>{let a=t.includes(e);return(0,i.jsx)("button",{type:"button",onClick:()=>s(e),className:(0,c.cn)((0,o.M)({variant:"body-small",weight:"regular"}),"rounded-full border px-vd-s py-[3px] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-vd-black focus-visible:ring-offset-2",a?"border-vd-black bg-vd-black text-vd-white":"border-vd-separator-1 bg-vd-white text-vd-typography-secondary hover:border-vd-typography-tertiary"),children:e},e)})}),(0,i.jsx)("textarea",{value:a,onChange:e=>r(e.target.value),"aria-label":"Tell us why this recommendation was not a fit",placeholder:"Tell us more (optional)",rows:3,maxLength:300,className:(0,c.cn)((0,o.M)({variant:"body-small",weight:"regular"}),"mt-vd-s w-full resize-none rounded-vd-s border border-vd-separator-1 bg-vd-white px-vd-s py-vd-xs text-vd-typography-primary outline-none placeholder:text-vd-typography-tertiary focus:border-vd-typography-tertiary")}),(0,i.jsxs)("div",{className:"mt-vd-xs flex items-center gap-vd-xs",children:[(0,i.jsxs)("span",{className:(0,c.cn)((0,o.M)({variant:"body-small",weight:"medium"}),"mr-auto text-vd-typography-tertiary"),children:[a.length,"/",300]}),(0,i.jsx)("button",{type:"button",onClick:d,disabled:n,className:(0,c.cn)((0,o.M)({variant:"body-small",weight:"medium"}),"flex h-vd-height-lg items-center justify-center rounded-vd-s border border-vd-separator-1 bg-vd-white px-vd-m text-vd-typography-secondary hover:border-vd-typography-tertiary disabled:cursor-not-allowed disabled:opacity-60"),children:"Cancel"}),(0,i.jsx)("button",{type:"button",onClick:u,disabled:n||!l,className:(0,c.cn)((0,o.M)({variant:"body-small",weight:"semibold"}),"flex h-vd-height-lg items-center justify-center rounded-vd-s bg-vd-black px-vd-m text-vd-white disabled:cursor-not-allowed disabled:bg-vd-separator-2 disabled:text-vd-typography-tertiary"),children:n?"Sending":"Send"})]})]})}var H=a(9247);let J=["first","second","third"],ee=()=>(0,i.jsx)("div",{"aria-hidden":!0,className:"relative space-y-3",children:(0,i.jsx)("div",{className:"flex flex-col gap-2",children:J.map(e=>(0,i.jsxs)("div",{className:"relative flex min-h-[134px] w-full animate-pulse gap-3 rounded-2xl border border-neutral-200 bg-white p-3 pr-12",children:[(0,i.jsx)("div",{className:"h-[clamp(5.75rem,27vw,6.25rem)] w-[clamp(3.5rem,18vw,4rem)] shrink-0 rounded bg-neutral-200"}),(0,i.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,i.jsx)("div",{className:"h-4 w-3/4 rounded bg-neutral-200"}),(0,i.jsx)("div",{className:"h-5 w-1/2 rounded bg-neutral-200"}),(0,i.jsx)("div",{className:"h-3 w-4/5 rounded bg-neutral-200"}),(0,i.jsx)("div",{className:"h-8 w-full rounded bg-neutral-200"}),(0,i.jsxs)("div",{className:"flex gap-1.5",children:[(0,i.jsx)("div",{className:"h-8 w-20 rounded-full bg-neutral-200"}),(0,i.jsx)("div",{className:"h-8 w-24 rounded-full bg-neutral-200"})]})]}),(0,i.jsxs)("div",{className:"absolute right-3 top-3 flex flex-col gap-2",children:[(0,i.jsx)("div",{className:"size-8 rounded-full bg-neutral-200"}),(0,i.jsx)("div",{className:"size-8 rounded-full bg-neutral-200"})]})]},e))})}),et=({message:e,onMoreLikeThis:t,onDislikeSubmitted:a,isReadOnly:r=!1})=>{let d=(0,n.useRouter)(),o=(e.tag===l.Af.PRODUCT_LIST?e.content.wines?.slice(0,3)??[]:[]).map((e,t)=>({wine:e,recommendationRank:t+1}));if(e.tag!==l.Af.PRODUCT_LIST)return null;let c=(0,H.C)(e.content.messageId)?e.content.messageId:void 0,u="vintage_detail"===e.content.responseScope,m=e=>{a?.(e)};return(0,i.jsxs)("div",{className:"relative space-y-3",children:[u?null:(0,i.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,i.jsx)("p",{className:"text-sm font-semibold text-black",children:"Suggested Wines"}),e.content.searchId&&!r?(0,i.jsx)("button",{type:"button",onClick:()=>{d.push((0,s.p)("/search",{q:e.content.query,smart_somm_search_id:e.content.searchId}))},className:"text-sm font-semibold text-black",children:"View All Results â"}):null]}),(0,i.jsx)("div",{role:"list","aria-label":"Suggested wines",className:"flex flex-col gap-2",children:o.map(({wine:a,recommendationRank:n})=>(0,i.jsx)("div",{role:"listitem",className:"w-full",children:(0,i.jsx)(z,{wine:a,recommendationMessageId:c,recommendationRank:n,searchId:e.content.searchId,modelVersion:e.content.modelVersion,promptVersion:e.content.promptVersion,onMoreLikeThis:t,onDislikeSubmitted:m,isReadOnly:r})},a.id))})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.