import{r as e,j as s}from"./vendor-react-Dp9pL_Wn.js";import{R as a,U as r}from"./c6eedc03a-CsEFTfjy.js";import{a0 as l,a2 as n,a3 as i,a4 as c,a5 as o,a6 as t,a7 as m,a8 as d,a9 as p}from"./index-CBEPphRm.js";import{P as x,S as u}from"./c9bc02337-DAknS3Mi.js";const f=e.memo(function({product:f,widgetType:h,disableAnalytics:j,onLearnMore:g,onDomainClick:b,onSourcesInfoOpen:w}){const N=a(f.url),k=e.useCallback(()=>g?.(),[g]),v=e.useMemo(()=>function(e){const s=(e??[]).map(e=>({img:e,src:a(e.thumbnail_url)})).filter(e=>!!e.src);return s.length>=3?s.slice(0,3):null}(f.images),[f.images]);return s.jsxs("div",{className:"relative flex min-w-0 flex-col overflow-hidden bg-surface-2",style:{borderRadius:l},children:[v&&s.jsx("div",{className:"px-sm pt-sm",children:s.jsx("div",{className:"grid h-56 w-full grid-cols-[3fr_2fr] grid-rows-2",style:{gap:n},children:v.map(({img:e,src:a},r)=>s.jsx(i,{src:a,widgetType:h,disableAnalytics:j,alt:e.title||"",radius:o("hero-left",r),className:0===r?"row-span-2":"",children:s.jsx(c,{source:e.source,pageUrl:e.page_url,onDomainClick:b?()=>b(e):void 0})},e.id||r))})}),s.jsxs("div",{className:"flex flex-1 flex-col px-lg pb-lg pt-lg",children:[N?s.jsx("span",{className:"flex",children:s.jsx(r,{href:N,linkTarget:"_blank",target:"_blank",onLinkClick:k,className:`min-w-0 break-words decoration-transparent hover:decoration-current focus-visible:decoration-current ${t}`,children:f.name})}):s.jsx("span",{className:`break-words ${t}`,children:f.name}),f.blurb&&s.jsx("span",{className:`break-words ${m} ${d}`,children:f.blurb}),N?s.jsx("span",{className:"mt-auto pt-md",children:s.jsx(x,{safeHref:N,price:f.price,onSourceClick:k,onSourcesInfoOpen:w})}):f.price||v?s.jsx("span",{className:"mt-auto pt-md",children:s.jsxs("span",{className:"flex h-4 min-w-0 items-center justify-between gap-sm text-footnote leading-none text-muted",children:[s.jsx("span",{className:"min-w-0 overflow-x-clip text-ellipsis whitespace-nowrap",children:f.price}),v&&s.jsx(u,{variant:"short",onOpen:w})]})}):null]}),s.jsx(p,{})]})});export{f as P};
