import{j as e,O as j,g as u,P as p,v as b}from"./vendor-laZsiqLO.js";import{S as a}from"./skeleton-uyR1XZG9.js";import{S as N}from"./separator-DMopkgTA.js";import{A as f}from"./AdSlot-HY9FvbmL.js";import{R as v}from"./RightSidebarFooter-BO77c1r9.js";import{u as _}from"./useTranslation-BW0o-tkY.js";import"./utils-RgT4yCq8.js";function T({loading:l,sidebarData:r,post:g,ads:o}){const{t}=_(),d=o?.article_sidebar_top,c=o?.article_sidebar_bottom,n=s=>s&&s.is_active,i=s=>new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric"}),m=s=>`https://ui-avatars.com/api/?name=${encodeURIComponent(s)}&background=random&color=fff&size=200`,x=l||r.you_may_like&&r.you_may_like.length>0,h=l||r.same_category&&r.same_category.length>0;return e.jsxs("aside",{className:"lg:col-span-4 hidden lg:block h-full ps-6 border-s border-border relative",children:[e.jsxs("div",{className:"space-y-8 mb-8",children:[n(d)&&e.jsx("div",{className:"bg-card border rounded-lg shadow-sm p-4 flex justify-center",children:e.jsxs("div",{className:"w-full",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground text-center mb-2 uppercase tracking-widest",children:t("_advertisement","Advertisement")}),e.jsx(f,{ad:d,className:"w-full"})]})}),x&&e.jsxs("div",{children:[e.jsxs("h3",{className:"font-bold text-lg border-s-4 border-red-500 ps-3 mb-4 flex items-center gap-2",children:[e.jsx(j,{className:"w-4 h-4 text-red-500"})," ",t("_you_may_like","You May Like")]}),e.jsx("div",{className:"flex flex-col gap-5",children:l?[1,2,3].map(s=>e.jsxs("div",{className:"flex gap-3 animate-pulse",children:[e.jsx(a,{className:"w-24 h-16 rounded-md"}),e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(a,{className:"h-4 w-full"}),e.jsx(a,{className:"h-3 w-1/2"})]})]},s)):r.you_may_like.map(s=>e.jsxs(u,{href:s.route_url,prefetch:!0,className:"group flex gap-3 items-start",children:[e.jsx("div",{className:"w-24 h-16 shrink-0 bg-muted rounded-md overflow-hidden border border-border",children:e.jsx("img",{src:s.image_path||m(s.title),className:"w-full h-full object-cover group-hover:scale-105 transition-transform",alt:s.title})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold leading-snug group-hover:text-red-600 transition-colors line-clamp-2",children:s.title}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-muted-foreground mt-1",children:[e.jsx(p,{className:"w-3 h-3"})," ",i(s.created_at)]})]})]},`trending-${s.id}`))})]}),x&&h&&e.jsx(N,{}),h&&e.jsxs("div",{children:[e.jsxs("h3",{className:"font-bold text-lg border-s-4 border-blue-500 ps-3 mb-4 flex items-center gap-2",children:[e.jsx(b,{className:"w-4 h-4 text-blue-500"})," ",t("_more_in","More in")," ",g.category?.name||t("_news_title","News")]}),e.jsx("div",{className:"flex flex-col gap-5",children:l?[1,2,3].map(s=>e.jsxs("div",{className:"flex gap-3 animate-pulse",children:[e.jsx(a,{className:"w-24 h-16 rounded-md"}),e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(a,{className:"h-4 w-full"}),e.jsx(a,{className:"h-3 w-1/2"})]})]},s)):r.same_category.map(s=>e.jsxs(u,{href:s.route_url,prefetch:!0,className:"group flex gap-3 items-start",children:[e.jsx("div",{className:"w-24 h-16 shrink-0 bg-muted rounded-md overflow-hidden border border-border",children:e.jsx("img",{src:s.image_path||m(s.title),className:"w-full h-full object-cover group-hover:scale-105 transition-transform",alt:s.title})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold leading-snug group-hover:text-blue-600 transition-colors line-clamp-3",children:s.title}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-muted-foreground mt-1",children:[e.jsx(p,{className:"w-3 h-3"})," ",i(s.created_at)]})]})]},`cat-${s.id}`))})]})]}),e.jsxs("div",{className:"space-y-4 pb-6 pt-6 bg-gradient-to-t from-background via-background to-background/95 backdrop-blur-sm border-t border-border/50",children:[n(c)&&e.jsx("div",{className:"bg-card border rounded-lg p-2 shadow-sm flex justify-center mx-1",children:e.jsxs("div",{className:"w-full",children:[e.jsx("p",{className:"text-[9px] text-muted-foreground text-center mb-1 uppercase tracking-widest",children:t("_advertisement","Advertisement")}),e.jsx(f,{ad:c,className:"w-full"})]})}),e.jsx("div",{className:"-mt-6",children:e.jsx(v,{})})]})]})}export{T as default};
