1import{l as h,r as u,j as t,L as l,ap as d,v as g}from"./index-CV3Wh3hK.js";const c=["from-red-600 to-rose-700","from-blue-700 to-indigo-800","from-amber-500 to-orange-600","from-emerald-600 to-teal-700","from-violet-600 to-purple-800","from-cyan-600 to-blue-700","from-pink-600 to-rose-700","from-slate-700 to-gray-900","from-orange-600 to-red-700","from-fuchsia-600 to-pink-700","from-lime-600 to-green-700","from-sky-600 to-blue-800"];function m(e){const a=String(e||"?");let n=0;for(let s=0;s<a.length;s++)n=n*31+a.charCodeAt(s)>>>0;return c[n%c.length]}function f(){const{data:e=[]}=h({queryKey:["brands-carousel"],queryFn:()=>g.entities.Brand.list("sort_order",200)}),a=u.useMemo(()=>{const r=e.filter(i=>i.active!==!1&&i.name),o=r.filter(i=>i.featured);return o.length>0?o:r},[e]),n=a.length>0?[...a,...a]:[],s=Math.max(25,Math.round(a.length*168/30));return t.jsxs("section",{className:"max-w-7xl mx-auto px-3 md:px-6 py-8",children:[t.jsxs("div",{className:"text-center mb-6",children:[t.jsxs("h2",{className:"text-xl md:text-2xl font-bold text-gray-800 uppercase tracking-wide",children:["Thương hiá»u phân phá»i ",t.jsx("span",{className:"text-primary",children:"chÃnh hãng"})]}),t.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Hợp tác cùng các thương hiá»u âm thanh hà ng Äầu thế giá»i"})]}),t.jsx("div",{className:"group/marquee relative overflow-hidden bg-white border-2 border-primary/20 rounded-2xl py-6",children:t.jsxs("div",{className:`du-marquee-track flex items-center w-max will-change-transform 2 group-hover/marquee:[animation-play-state:paused]`,style:{animationName:n.length?"du-marquee":"none",animationDuration:`${s}s`,animationTimingFunction:"linear",animationIterationCount:"infinite"},children:[n.map((r,o)=>t.jsx(x,{brand:r},`${r.id||r.name}-${o}`)),n.length===0&&t.jsx("div",{className:"px-8 text-sm text-gray-400 italic",children:"Chưa có thương hiá»u nà o ÄÆ°á»£c thêm."})]})})]})}function x({brand:e}){const a=`/san-pham?brand=${encodeURIComponent(e.name)}`;return e.logo_url?t.jsx(l,{to:a,className:"flex-shrink-0 mr-6 h-16 w-36 flex items-center justify-center grayscale hover:grayscale-0 opacity-80 hover:opacity-100 transition-all hover:scale-105",title:e.name,children:t.jsx("img",{src:d(e.logo_url,"thumb"),alt:e.name,className:"max-h-12 max-w-32 object-contain pointer-events-none",loading:"lazy",draggable:!1,onError:s=>{const r=s.target.parentNode;r.innerHTML=`<div class="w-full h-full rounded-lg bg-gradient-to-br ${m(e.name)} flex items-center justify-center px-3"><span class="font-black text-white text-sm tracking-wide uppercase truncate">${e.name}</span></div>`}})}):t.jsx(l,{to:a,className:"flex-shrink-0 mr-6 h-16 w-36 group",title:e.name,children:t.jsx("div",{className:`w-full h-full rounded-lg bg-gradient-to-br ${m(e.name)} flex items-center justify-center px-3 shadow-sm transition-transform group-hover:scale-105`,children:t.jsx("span",{className:"font-black text-white text-sm tracking-wide uppercase truncate text-center leading-tight",children:e.name})})})}export{f as default};
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.