1import{o as e,t}from"./jsx-runtime-DVpe7PXp.js";import{t as n}from"./react-Dps3yNUO.js";import{t as r}from"./link-Db4-0UfO.js";import{t as i}from"./useQuery-Db6iwXxR.js";import{r as a}from"./image-variants-DQneMKZt.js";import{t as o}from"./badge-check-sU_jPErW.js";import{n as s,t as c}from"./ReviewForm-a6x9a8Tm.js";import{t as l}from"./loader-circle-Ct2IS7zP.js";import{t as u}from"./pencil-BiPXiu9k.js";import{t as d}from"./quote-Bmnq1WqT.js";import{t as f}from"./shield-check-BNauuyBK.js";import{t as p}from"./star-D59omTLC.js";import{t as m}from"./x-D0cLKEmi.js";import{i as h,r as g,t as _}from"./format-CyJDCyBI.js";import{t as v}from"./useBodyScrollLock-MnrtYNdp.js";import{i as y,n as b,o as x,r as S,t as C}from"./dialog-zd8Blmjs.js";import{Ht as w,Ut as T,bn as E,zt as D}from"./index-BSFZB8_q.js";var O=e(n(),1),k=t();function A({open:e,onOpenChange:t,context:n}){let r=(0,O.useRef)(null);return(0,O.useEffect)(()=>{if(!e)return;let t=v(),n=e=>!r.current||!e?!1:r.current.contains(e),i=e=>{n(e.target)||e.preventDefault()},a=e=>{[`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `].includes(e.key)&&(n(e.target)||e.preventDefault())};return window.addEventListener(`wheel`,i,{passive:!1}),window.addEventListener(`touchmove`,i,{passive:!1}),window.addEventListener(`keydown`,a,{passive:!1}),()=>{t(),window.removeEventListener(`wheel`,i),window.removeEventListener(`touchmove`,i),window.removeEventListener(`keydown`,a)}},[e]),(0,k.jsx)(C,{open:e,onOpenChange:t,children:(0,k.jsxs)(S,{className:`max-w-md p-0 gap-0 rounded-xl sm:rounded-2xl border-0 shadow-2xl w-[calc(100%-1.5rem)] sm:w-full`,hideClose:!0,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,k.jsx)(x,{className:`sr-only`,children:`Napsat recenzi`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:`absolute top-3 right-3 z-10 rounded-lg bg-transparent text-foreground size-8 flex items-center justify-center cursor-pointer transition hover:opacity-70`,"aria-label":`ZavÅÃt`,children:(0,k.jsx)(m,{className:`size-5`,strokeWidth:2.5})}),(0,k.jsx)(`div`,{ref:r,className:`overflow-y-auto max-h-[100dvh] overscroll-contain`,children:(0,k.jsx)(c,{resetKey:e,context:n,scrollRef:r,inModal:!0})})]})})}var j=`(min-width: 1440px) 160px, 11vw`,M=`(min-width: 1280px) 42vw, 45vw`,N=`(min-width: 1440px) 96px, (min-width: 1024px) 6.5vw, 25vw`,P=`(min-width: 1024px) 18.5vw, (min-width: 768px) 31vw, (min-width: 640px) 50vw, 82vw`,F=`(min-width: 1158px) 555px, (min-width: 768px) calc((100vw - 48px) / 2), calc(100vw - 48px)`,I=50;function L(e){return e.split(` `).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()).join(``)}function R({review:e,reviews:t,onNavigate:n,onOpenChange:i}){let a=!!e?.image,o=(0,O.useRef)(null),[c,l]=(0,O.useState)(0),u=(0,O.useCallback)(r=>{if(!t||!n||!e)return;let i=t.findIndex(t=>t.id===e.id);if(i===-1)return;let a=t[i+r];a&&(l(r),n(a),setTimeout(()=>l(0),300))},[t,n,e]);return t&&e&&t.findIndex(t=>t.id===e.id),t&&e&&(t.findIndex(t=>t.id===e.id),t.length-1),(0,k.jsx)(C,{open:!!e,onOpenChange:i,children:(0,k.jsxs)(S,{hideClose:!0,className:`isolate gap-0 w-[calc(100%-2rem)] overflow-hidden rounded-[24px] border-0 bg-transparent p-0 shadow-none outline-none [clip-path:inset(0_round_24px)] md:shadow-2xl ${a?`max-w-[880px]`:`max-w-[560px]`}`,children:[(0,k.jsx)(x,{className:`sr-only`,children:`Detail recenze`}),(0,k.jsx)(y,{className:`sr-only`,children:`Detail zákaznické recenze vÄetnÄ hodnocenÃ, autora a pÅÃpadné fotografie.`}),e&&(0,k.jsx)(`div`,{onTouchStart:e=>{o.current={x:e.touches[0].clientX,y:e.touches[0].clientY}},onTouchEnd:e=>{if(!o.current)return;let t=e.changedTouches[0].clientX-o.current.x,n=e.changedTouches[0].clientY-o.current.y;o.current=null,!(Math.abs(t)<I||Math.abs(t)<Math.abs(n))&&u(t<0?1:-1)},style:c===0?void 0:{animation:c===1?`review-swipe-in-left 280ms ease-out both`:`review-swipe-in-right 280ms ease-out both`},children:(0,k.jsx)(`div`,{className:`max-h-[88vh] overflow-y-auto overscroll-contain`,children:(0,k.jsxs)(`div`,{className:`relative ${a?`grid md:grid-cols-[1.05fr_1fr]`:``}`,children:[(0,k.jsxs)(b,{className:`absolute right-4 top-4 z-20 inline-flex size-9 cursor-pointer items-center justify-center rounded-full bg-black/45 text-white/85 backdrop-blur-sm transition-colors hover:bg-black/70 hover:text-white`,children:[(0,k.jsx)(m,{className:`size-4`}),(0,k.jsx)(`span`,{className:`sr-only`,children:`ZavÅÃt`})]}),a&&(0,k.jsxs)(`div`,{className:`relative min-h-[240px] bg-muted md:min-
1h-[420px]`,children:[(0,k.jsx)(`img`,{src:e.image,alt:e.productName??e.author,loading:`eager`,decoding:`async`,className:`absolute inset-0 size-full object-cover`}),(0,k.jsxs)(`span`,{className:`absolute left-4 top-4 inline-flex items-center gap-1.5 rounded-full bg-black/55 px-2.5 py-1 text-[10px] font-bold uppercase tracking-[0.12em] text-white backdrop-blur-sm`,children:[(0,k.jsx)(s,{className:`size-3`}),` Foto zákaznÃka`]})]}),(0,k.jsxs)(`div`,{className:`flex flex-col bg-background p-4 md:p-6`,children:[(0,k.jsxs)(`div`,{className:`relative overflow-hidden rounded-[18px] bg-[#111112] p-4 text-left md:p-6`,children:[(0,k.jsx)(`div`,{className:`pointer-events-none absolute -right-20 -top-24 size-64 rounded-full bg-primary/25 blur-3xl`}),(0,k.jsxs)(`div`,{className:`relative flex flex-wrap items-center gap-2`,children:[e.verified&&(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full bg-white/10 px-2.5 py-1 text-[10px] font-bold uppercase tracking-[0.14em] text-white/80`,children:[(0,k.jsx)(f,{className:`size-3`}),` OvÄÅená recenze`]}),(0,k.jsx)(`div`,{className:`flex gap-0.5`,children:[0,1,2,3,4].map(t=>(0,k.jsx)(p,{className:t<Math.round(e.rating)?`size-[15px] fill-[#EDB600] text-[#EDB600]`:`size-[15px] text-white/25`},t))})]}),(0,k.jsx)(`p`,{className:`relative mt-3 text-[14px] font-medium leading-[1.5] tracking-[-0.01em] text-balance text-white md:mt-4 md:text-[20px]`,children:e.body})]}),(0,k.jsxs)(`div`,{className:`flex flex-1 flex-col justify-between text-left`,children:[(0,k.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,k.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-full bg-muted text-[12px] font-bold text-primary ring-1 ring-border`,children:L(e.author)}),(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`span`,{className:`block truncate text-[15px] font-semibold tracking-tight`,children:e.author}),(0,k.jsxs)(`span`,{className:`mt-0.5 block text-[11px] text-muted-foreground`,children:[e.productName,e.productName&&e.date?` · `:``,e.date?_(e.date):``]})]})]}),e.productSlug&&(0,k.jsxs)(r,{to:`/$category`,params:{category:e.productSlug},onClick:()=>i(!1),className:`group mt-5 flex cursor-pointer items-center justify-between rounded-2xl border border-border bg-muted/40 px-4 py-3 transition-colors hover:border-primary/40 hover:bg-primary/5`,children:[(0,k.jsx)(`span`,{className:`truncate text-sm font-semibold tracking-tight`,children:e.productName??`Zobrazit produkt`}),(0,k.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1.5 text-xs font-bold text-primary`,children:[`Koupit`,(0,k.jsx)(E,{className:`size-3.5 transition-transform group-hover:translate-x-1`})]})]})]})]})]})})})]})})}var z=P;function B(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:`${t.getDate()}. ${t.getMonth()+1}. ${t.getFullYear()}`}function V({rating:e,dim:t=!1}){return(0,k.jsx)(`span`,{className:`flex gap-0.5`,children:[0,1,2,3,4].map(n=>(0,k.jsx)(p,{className:n<e?`size-3.5 fill-[#EDB600] text-[#EDB600]`:t?`size-3.5 text-white/25`:`size-3.5 text-neutral-200`},n))})}function H({tone:e=`light`}){return(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] font-semibold ${e===`dark`?`text-white/70`:`text-muted-foreground`}`,children:[(0,k.jsx)(o,{className:`size-3 text-[#17B26A]`}),`OvÄÅený nákup`]})}function U({name:e,tone:t=`light`}){let n=e.split(` `).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()).join(``);return(0,k.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-full text-[10px] font-bold ${t===`dark`?`bg-white/15 text-white`:`bg-brand/12 text-brand`}`,children:n})}function W({review:e,tall:t,fixed:n,priority:r,onOpen:i}){return(0,k.jsx)(`button`,{type:`button`,onClick:i,className:`group block w-full cursor-pointer text-left ${n?`h-full`:``}`,children:(0,k.jsxs)(`span`,{className:`overflow-hidden rounded-[16px] bg-card shadow-[0_1px_2px_rgba(16,24,40,0.06)] ring-1 ring-black/5 transition-[box-shadow,--tw-ring-color] duration-300 group-hover:shadow-[0_18px_40px_-26px_rgba(16,24,40,0.45)] group-hover:ring-brand/40 ${n?`flex h-full flex-col`:`block`}`,children:[(0,k.jsxs)(`span`,{className:`relative block overflow-hidden bg-muted ${n?`h-[240px] shrink-0`:`aspect-[4/3] ${t?`sm:aspect-[3/4]`:``}`}`,children:[(0,k.jsx)(`img`,{...a(e.image,e.imageVariants,320,z,{width:e.imageWidth}),alt:e.author,loading:r?`eager`:`lazy`,...r?{fetchPriority:`high`}:{},decoding:`async`,...e.imageWidth&&e.imageHeight?{width:e.imageWidth,height:e.imageHeight}:{},className:`size-full object-cover [image-rendering:auto]`}),(0,k.jsxs)(`span`,{className:`absolute left-2 top-2 inline-flex items-center gap-1 rounded-full bg-black/55 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-white backdrop-blur-sm`,children:[(0,k.jsx)(s,{className:`size-2.5`}),` Foto zákaznÃka`]})]}),(0,k.jsxs)(`span`,{className:`p-3 ${n?`flex min-h-0 flex-1 flex-col`:`block`}`,children:[(0,k.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(U,{name:e.author}),(0,k.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`span`,{className:`block truncate text-[13px] font-semibold leading-tight`,children:e.author}),(0,k.jsx)(`span`,{className:`block text-[10px] text-muted-foreground`,children:B(e.date)})]}),(0,k.jsx)(V,{rating:e.rating})]}),(0,k.jsx)(`span`,{className:`mt-2 block min-h-0 flex-1 overflow-hidden text-[13px] leading-5 text-foreground
1/85`,children:(0,k.jsx)(`span`,{className:`line-clamp-3 block`,children:e.body})}),(0,k.jsxs)(`span`,{className:`flex shrink-0 items-center justify-between gap-3 border-t border-border pt-2 mt-3`,children:[e.verified?(0,k.jsx)(H,{}):(0,k.jsx)(`span`,{}),(0,k.jsx)(`span`,{className:`text-[11px] font-semibold text-brand opacity-0 transition-opacity duration-300 group-hover:opacity-100`,children:`OtevÅÃt â`})]})]})]})})}function G({review:e,variant:t,fixed:n,onOpen:r}){let i=t===`ink`;return(0,k.jsx)(`button`,{type:`button`,onClick:r,className:`group block w-full cursor-pointer text-left [transform:translateZ(0)] ${n?`h-full`:``}`,children:(0,k.jsxs)(`span`,{className:`overflow-hidden rounded-[16px] p-2.5 transition-[box-shadow,--tw-ring-color,background-color] duration-300 ${i?`bg-ink text-white shadow-[0_1px_2px_rgba(16,24,40,0.06)] group-hover:shadow-[0_18px_40px_-26px_rgba(16,24,40,0.6)]`:t===`tint`?`bg-brand/8 ring-1 ring-brand/20 group-hover:ring-brand/45`:`bg-card ring-1 ring-black/5 shadow-[0_1px_2px_rgba(16,24,40,0.06)] group-hover:ring-brand/40 group-hover:shadow-[0_18px_40px_-30px_rgba(16,24,40,0.4)]`} ${n?`flex h-full flex-col`:`block`}`,children:[(0,k.jsxs)(`span`,{className:`flex items-start justify-between gap-2`,children:[(0,k.jsx)(V,{rating:e.rating,dim:i}),(0,k.jsx)(d,{className:`size-4 shrink-0 ${i?`text-white/20`:`text-brand/25`}`})]}),(0,k.jsx)(`span`,{className:`mt-2 block font-medium tracking-tight text-[12px] leading-5 ${i?`text-white`:`text-foreground/90`} ${n?`min-h-0 flex-1 overflow-hidden`:``}`,children:(0,k.jsx)(`span`,{className:`line-clamp-5 block`,children:e.body})}),(0,k.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 border-t pt-2 ${i?`border-white/12`:`border-black/8`} ${n?`mt-auto`:`mt-2.5`}`,children:[(0,k.jsx)(U,{name:e.author,tone:i?`dark`:`light`}),(0,k.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`span`,{className:`block truncate text-[11px] font-semibold ${i?`text-white`:``}`,children:e.author}),e.verified&&(0,k.jsx)(H,{tone:i?`dark`:`light`})]})]})]})})}function K(){return(0,k.jsxs)(`div`,{className:`h-[440px] animate-pulse rounded-2xl border border-border bg-card p-4`,children:[(0,k.jsx)(`div`,{className:`mb-4 h-40 rounded-xl bg-muted`}),(0,k.jsxs)(`div`,{className:`mb-3 flex items-center gap-3`,children:[(0,k.jsx)(`div`,{className:`size-9 rounded-full bg-muted`}),(0,k.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,k.jsx)(`div`,{className:`h-3 w-24 rounded bg-muted`}),(0,k.jsx)(`div`,{className:`h-2.5 w-16 rounded bg-muted`})]})]}),(0,k.jsxs)(`div`,{className:`space-y-2`,children:[(0,k.jsx)(`div`,{className:`h-2.5 w-full rounded bg-muted`}),(0,k.jsx)(`div`,{className:`h-2.5 w-11/12 rounded bg-muted`}),(0,k.jsx)(`div`,{className:`h-2.5 w-9/12 rounded bg-muted`}),(0,k.jsx)(`div`,{className:`h-2.5 w-10/12 rounded bg-muted`})]})]})}function q({amount:e,count:t,className:n}){let r=Array.from({length:t},()=>[]);for(let n=0;n<e;n+=1)r[n%t]?.push(n);return(0,k.jsx)(`div`,{className:n,"aria-hidden":!0,children:r.map((e,t)=>(0,k.jsx)(`div`,{className:`min-w-0 space-y-3`,children:e.map(e=>(0,k.jsx)(K,{},e))},t))})}function J({reviews:e,onOpen:t}){let n=(0,O.useRef)(null),[r,i]=(0,O.useState)(!1),[o,s]=(0,O.useState)(!1),c=(0,O.useCallback)(()=>{let t=n.current;if(!t||(i(t.scrollLeft>4),s(t.scrollLeft+t.clientWidth<t.scrollWidth-4),!window.matchMedia(`(max-width: 639px)`).matches))return;let r=t.querySelector(`[data-review-card]`),o=r?r.offsetWidth+12:t.clientWidth*.8,c=Math.max(0,Math.round(t.scrollLeft/o));for(let t=c+1;t<=c+3&&t<e.length;t++){let n=e[t];if(!n?.image)continue;let r=a(n.image,n.imageVariants,320,z,{width:n.imageWidth}),i=new Image;i.decoding=`async`,r.srcSet&&(i.sizes=r.sizes??z,i.srcset=r.srcSet),r.src&&(i.src=r.src)}},[e]);(0,O.useEffect)(()=>{let e=n.current;if(e)return e.addEventListener(`scroll`,c,{passive:!0}),c(),()=>e.removeEventListener(`scroll`,c)},[c]),(0,O.useEffect)(()=>{c()},[c]);let l=(0,O.useCallback)(()=>{let e=n.current;if(!e)return 0;let t=Array.from(e.querySelectorAll(`[data-review-card]`));if(!t.length)return 0;let r=e.scrollLeft+e.clientWidth/2,i=0,a=1/0;return t.forEach((e,t)=>{let n=e.offsetLeft+e.offsetWidth/2,o=Math.abs(n-r);o<a&&(a=o,i=t)}),i},[]),u=e=>{let t=n.current;if(!t)return;let r=t.querySelectorAll(`[data-review-card]`),i=Math.max(0,Math.min(r.length-1,l(
1)+e)),a=r[i];if(!a)return;let o=i===0?0:a.offsetLeft-(t.clientWidth-a.offsetWidth)/2;t.scrollTo({left:Math.max(0,o),behavior:`smooth`})};return(0,k.jsxs)(`div`,{className:`relative -mx-4 overflow-x-clip sm:mx-0 sm:overflow-x-visible`,children:[(0,k.jsx)(`div`,{ref:n,className:`flex gap-3 overflow-x-auto overscroll-x-contain px-4 pb-6 pt-3 scrollbar-hide select-none [touch-action:pan-x_pan-y] sm:grid sm:grid-cols-2 sm:overflow-visible sm:p-0 sm:select-auto sm:[touch-action:auto] md:grid-cols-3 lg:grid-cols-5`,style:{scrollBehavior:`auto`,WebkitOverflowScrolling:`touch`},children:e.map((e,n)=>(0,k.jsx)(`div`,{"data-review-card":!0,className:`h-[440px] w-[82vw] max-w-[320px] min-w-0 shrink-0 sm:w-auto sm:max-w-none`,children:e.image?(0,k.jsx)(W,{review:e,tall:!1,fixed:!0,priority:!1,onOpen:()=>t(e)}):(0,k.jsx)(G,{review:e,variant:n%7==3?`ink`:n%5==2?`tint`:`plain`,fixed:!0,onOpen:()=>t(e)})},e.id))}),(0,k.jsx)(`button`,{type:`button`,"aria-label":`PÅedchozÃ`,onClick:()=>u(-1),tabIndex:r?0:-1,"aria-hidden":!r,className:`cursor-pointer flex sm:hidden absolute left-0 top-1/2 -translate-y-1/2 z-10 h-12 w-9 items-center justify-center rounded-r-lg bg-brand/80 hover:bg-brand shadow-[0_2px_6px_rgba(0,0,0,0.15)] backdrop-blur-sm transition-[transform,opacity] duration-300 ease-in-out pointer-events-auto ${r?`translate-x-0 opacity-100`:`-translate-x-full opacity-0 pointer-events-none`}`,children:(0,k.jsx)(`svg`,{className:`w-2.5 h-auto`,viewBox:`0 0 10 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,k.jsx)(`path`,{d:`M8 14L2 8L8 2`,stroke:`black`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),(0,k.jsx)(`button`,{type:`button`,"aria-label":`DalÅ¡Ã`,onClick:()=>u(1),tabIndex:o?0:-1,"aria-hidden":!o,className:`cursor-pointer flex sm:hidden absolute right-0 top-1/2 -translate-y-1/2 z-10 h-12 w-9 items-center justify-center rounded-l-lg bg-brand/80 hover:bg-brand shadow-[0_2px_6px_rgba(0,0,0,0.15)] backdrop-blur-sm transition-[transform,opacity] duration-300 ease-in-out pointer-events-auto ${o?`translate-x-0 opacity-100`:`translate-x-full opacity-0 pointer-events-none`}`,children:(0,k.jsx)(`svg`,{className:`w-2.5 h-auto`,viewBox:`0 0 10 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,k.jsx)(`path`,{d:`M2 14L8 8L2 2`,stroke:`black`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]})}function Y({reviews:e,onWriteReview:t,total:n,filteredTotal:r,hasMore:i,isLoadingMore:a,isFiltering:o,onLoadMore:s,pageSize:c=10,photoCount:d,topics:f=[],filter:p,onFilterChange:m}){let[h,g]=(0,O.useState)(null),_=f.slice(0,5),v=(0,O.useMemo)(()=>[...e].sort((e,t)=>Number(!!t.image)-Number(!!e.image)),[e]),y=n??v.length,b=p===`all`?r??y:r??v.length,x=!!i,S=Math.min(100,Math.round(v.length/Math.max(1,b)*100)),C=e=>{e!==p&&m(e)},w=[{key:`all`,label:`VÅ¡echny (${y})`},{key:`photo`,label:d===void 0?`S fotkou`:`S fotkou (${d})`},{key:`top`,label:`Jen 5â
`}];return(0,k.jsxs)(k.Fragment,{children:[_.length>0&&(0,k.jsxs)(`div`,{className:`mb-5 space-y-3`,children:[(0,k.jsx)(`p`,{className:`px-1 text-[11px] font-bold tracking-wider text-muted-foreground uppercase`,children:`Äasto zmiÅujete`}),(0,k.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-1 sm:flex-wrap sm:overflow-visible [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:_.map(e=>(0,k.jsxs)(`span`,{className:`inline-flex shrink-0 items-center rounded-full border border-brand/20 bg-brand/10 px-4 py-2 text-[13px] font-medium text-foreground`,children:[e.label,(0,k.jsx)(`span`,{className:`ml-2 rounded-full bg-brand px-1.5 py-0.5 text-[10px] font-bold text-white`,children:e.amount})]},e.code))})]}),(0,k.jsxs)(`div`,{className:`mb-5 flex flex-col gap-4 border-b border-border pb-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,k.jsx)(`div`,{className:`flex items-center gap-2 overflow-x-auto pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:w.map(e=>(0,k.jsx)(`button`,{type:`button`,onClick:()=>C(e.key),className:`shrink-0 cursor-pointer rounded-full px-3 py-1.5 text-[12px] font-semibold transition-colors ${p===e.ke
1y?`bg-ink text-white`:`bg-muted text-muted-foreground hover:bg-muted/70 hover:text-foreground`}`,children:e.label},e.key))}),(0,k.jsx)(`p`,{className:`text-[12px] text-muted-foreground`,children:`Reálné fotky a slova zákaznÃků. Nic neupravujeme.`})]}),o?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`flex gap-3 overflow-hidden sm:hidden`,children:Array.from({length:Math.min(2,c)},(e,t)=>(0,k.jsx)(`div`,{className:`w-[78vw] shrink-0`,children:(0,k.jsx)(K,{})},t))}),(0,k.jsx)(q,{amount:c,count:2,className:`hidden grid-cols-2 gap-3 sm:grid md:hidden`}),(0,k.jsx)(q,{amount:c,count:3,className:`hidden grid-cols-3 gap-3 md:grid lg:hidden`}),(0,k.jsx)(q,{amount:c,count:5,className:`hidden grid-cols-5 gap-3 lg:grid`})]}):(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(J,{reviews:v,onOpen:g})}),a&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`mt-3 flex gap-3 overflow-hidden sm:hidden`,children:Array.from({length:Math.min(2,c)},(e,t)=>(0,k.jsx)(`div`,{className:`w-[78vw] shrink-0`,children:(0,k.jsx)(K,{})},t))}),(0,k.jsx)(q,{amount:c,count:2,className:`mt-3 hidden grid-cols-2 gap-3 sm:grid md:hidden`}),(0,k.jsx)(q,{amount:c,count:3,className:`mt-3 hidden grid-cols-3 gap-3 md:grid lg:hidden`}),(0,k.jsx)(q,{amount:c,count:5,className:`mt-3 hidden grid-cols-5 gap-3 lg:grid`})]}),(0,k.jsxs)(`div`,{className:`mt-6 mb-8 flex flex-col items-center gap-4`,children:[(0,k.jsx)(`div`,{className:`h-1 w-40 overflow-hidden rounded-full bg-muted`,children:(0,k.jsx)(`div`,{className:`h-full rounded-full bg-brand transition-all duration-500`,style:{width:`${S}%`}})}),(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[v.length,` z `,b,` recenzÃ`]}),x?(0,k.jsx)(`button`,{type:`button`,disabled:!!a,onClick:()=>s?.(),className:`inline-flex cursor-pointer items-center gap-2 rounded-full bg-ink px-7 py-3.5 text-sm font-bold text-white transition-transform hover:scale-[1.02] disabled:cursor-not-allowed disabled:opacity-60`,children:a?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(l,{className:`size-4 animate-spin`}),` NaÄÃtámâ¦`]}):`NaÄÃst dalšà recenze`}):t&&(0,k.jsxs)(`button`,{type:`button`,onClick:t,className:`inline-flex cursor-pointer items-center gap-2 rounded-full border border-border bg-background px-7 py-3.5 text-sm font-bold transition-colors hover:border-brand hover:text-brand`,children:[(0,k.jsx)(u,{className:`size-4`}),` Napsat vlastnà recenzi`]})]}),(0,k.jsx)(R,{review:h,reviews:v,onNavigate:e=>g(e),onOpenChange:e=>!e&&g(null)})]})}var X=`/assets/zbozi1-dark-k10cQG60.svg`;function Z({filled:e,className:t=``}){return(0,k.jsx)(p,{className:e?`size-3.5 fill-[#EDB600] text-[#EDB600] ${t}`:`size-3.5 text-neutral-200 ${t}`})}function Q({stats:e}){let t=e.total,n=Number(e.average)||0,r=n.toFixed(1).replace(`.`,`,`),a=e.counts,{data:o,isLoading:s}=i(w),c=T(o,`heureka`),l=T(o,`zbozi`);return(0,k.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 py-5 md:grid-cols-12 md:items-center md:gap-6 md:py-6`,children:[(0,k.jsxs)(`div`,{className:`flex flex-col items-center gap-2 border-b border-border pb-5 text-center md:col-span-3 md:flex-col md:items-start md:gap-2 md:border-b-0 md:border-r md:pb-0 md:pr-6 md:text-left`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-center gap-2 md:flex-col md:items-start md:gap-2`,children:[(0,k.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,k.jsx)(`span`,{className:`text-3xl font-extrabold leading-none tracking-tight md:text-4xl`,children:r}),(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground md:text-sm`,children:`z 5`})]}),(0,k.jsx)(`span`,{className:`flex gap-0.5`,children:[0,1,2,3,4].map(e=>(0,k.jsx)(Z,{filled:e<Math.round(n)},e))})]}),(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[t.toLocaleString(`cs-CZ`),` recenzÃ`]})]}),(0,k.jsx)(`div`,{className:`border-b border-border pb-5 md:col-span-5 md:border-b-0 md:pb-0`,children:(0,k.jsx)(`div`,{className:`flex flex-col gap-2`,children:[5,4,3,2,1].map(e=>{let n=a[e]??0,r=t?n/t*100:0;return(0,k.jsxs)(`div`,{className:`flex items-center gap-3 text-[13px]`,children:[(0,k.jsxs)(`div`,{className:`flex w-5 shrink-0 items-center gap-1`,children:[(0,k.jsx)(`span`,{className:`font-semibold tabular-nums`,children:e}),(0,k.jsx)(Z,{filled:n>0,className:`!size-3`})]}),(0,k.jsx)(`div`,{className:`h-2 flex-1 overflow-hidden rounded-full bg-muted`,children:(0,k.jsx)(`div`,{className:`h-full min-w-[8px] rounded-full bg-[#2F9510] transition-all duration-500`,style:{width:`${r}%`}})}),(0,k.jsx)(`span`,{className:`w-10 shrink-0 text-right tabular-nums text-muted-foreground`,children:n})]},e)})})}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-5 md:col-span-4 md:gap-6 md:border-l md:pl-6`,children:[(0,k.jsx)($,{rating:c,isLoading:s,fallbackUrl:`https://obchody.heureka.cz/citronek-com/recenze/`,logo:D,name:`Heureka`,fallbackLabel:`OvÄÅeno zákaznÃky`}),(0,k.jsx)($,{rating:l,isLoading:s,fallbackUrl:`https://www.zbozi.cz/obchod/158257/`,logo:X,name:`ZbožÃ.cz`,fallbackLabel:`Hodnocenà obchodu`})]})]})}function $({rating:e,isLoading:t,fallbackUrl:n,logo:r,name:i,fallbackLabel:a}){let o=e?g(e.rating):null;return(0,k.jsxs)(`a`,{href:e?.url||n,target:`_blank`,rel:`noreferrer`,className:`group flex cursor-pointer items-start justify-between gap-3`,"aria-label":`Hodnocenà Citronek na ${e?.name||i}`,children:[(0,k.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`span`,{className:`text-2xl font-extrabold leading-none tracking-tight text-foreground`,children:t&&!o?(0,k.jsx)(`span`,{className:`inline-block h-6 w-10 animate-pulse rounded bg-muted align-middle`,"aria-hidden":!0}):o??`â`}
1),(0,k.jsx)(`span`,{className:`flex gap-0.5`,"aria-hidden":!0,children:[0,1,2,3,4].map(t=>(0,k.jsx)(Z,{filled:e?t<Math.round(e.rating):!1},t))}),e&&e.review_count>0?(0,k.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[h(e.review_count),` hodnocenÃ`]}):null]}),(0,k.jsxs)(`span`,{className:`flex flex-col items-end gap-1 text-right`,children:[(0,k.jsx)(`img`,{src:r,alt:e?.name||i,className:`h-6 w-auto`,loading:`lazy`}),(0,k.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wider text-muted-foreground`,children:e?.label||a})]})]})}export{M as a,N as i,Y as n,j as o,F as r,A as s,Q as t};
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.