import{_ as p,b as h,d as x,o as a,c as o,a as t,t as l,F as u,l as g,h as d,w as c,i as b,j as f,I as v,e as k,p as w,r as y}from"./app-B-4i4xU3.js";const C={class:"main-container pt-8 pb-12"},$={class:"text-slate-800 dark:text-slate-100 text-lg lg:text-xl font-bold"},N={class:"mt-6 grid grid-cols-1 md:grid-cols-2 2xl:grid-cols-3 gap-4 lg:gap-6 items-start"},j={class:"flex items-start justify-between gap-4 p-4 sm:p-5 border-b border-slate-100 dark:border-slate-700"},V={class:"category-card-circle relative flex items-center justify-center w-14 h-14 sm:w-16 sm:h-16 rounded-full overflow-hidden shrink-0"},B=["src","alt"],q={class:"min-w-0"},F={class:"text-base sm:text-lg font-semibold text-slate-800 dark:text-slate-100 group-hover:text-primary transition-colors line-clamp-1"},z={class:"text-xs sm:text-sm text-slate-500 mt-0.5 line-clamp-2"},A={key:0,class:"p-4 sm:p-5 grid grid-cols-1 xs:grid-cols-2 gap-3"},I=["src","alt"],T={class:"min-w-0 text-sm font-medium text-slate-700 dark:text-slate-300 group-hover:text-primary truncate"},D={key:1,class:"p-4 sm:p-5 text-sm text-slate-500"},E={key:0,class:"text-slate-950 dark:text-white text-xl font-medium leading-7 md:col-span-2 2xl:col-span-3"},L={__name:"Category",setup(M){const i=y([]);h(()=>{_(),window.scrollTo(0,0)});const _=async()=>{axios.get("/categories").then(r=>{i.value=r.data.data.categories})};return(r,S)=>{const n=x("router-link");return a(),o("div",C,[t("div",$,l(r.$t("All Categories")),1),t("div",N,[(a(!0),o(u,null,g(i.value,e=>{var m;return a(),o("div",{key:e.id,class:"category-grid-card rounded-2xl bg-white dark:bg-slate-800 border border-slate-100 dark:border-slate-700 overflow-hidden h-full"},[t("div",j,[d(n,{to:{name:"products",query:{category_slug:e.slug}},class:"flex items-center gap-3 min-w-0 group flex-1"},{default:c(()=>{var s;return[t("div",V,[t("img",{src:e.icon||e.thumbnail,alt:e.name,class:"w-8 h-8 sm:w-9 sm:h-9 object-contain",loading:"lazy"},null,8,B)]),t("div",q,[t("div",F,l(e.name),1),t("div",z,l(e.description?e.description:`${((s=e.sub_categories)==null?void 0:s.length)||0} ${r.$t("subcategories available")}`),1)])]}),_:2},1032,["to"]),d(n,{to:{name:"products",query:{category_slug:e.slug}},class:"inline-flex items-center gap-1 text-sm font-medium text-primary hover:text-primary-700 transition shrink-0"},{default:c(()=>[b(l(r.$t("View All"))+" ",1),d(f(v),{class:"w-4 h-4"})]),_:1},8,["to"])]),(m=e.sub_categories)!=null&&m.length?(a(),o("div",A,[(a(!0),o(u,null,g(e.sub_categories,s=>(a(),k(n,{key:s.id,to:{name:"products",query:{category_slug:e.slug,sub_category_slug:s.slug}},class:"group p-3 rounded-xl border border-slate-100 dark:border-slate-700 hover:border-primary hover:bg-primary-50/40 transition-all duration-200 flex items-center gap-3"},{default:c(()=>[t("img",{src:s.thumbnail,alt:s.name,class:"w-10 h-10 rounded-lg object-cover border border-slate-100 dark:border-slate-700 bg-white dark:bg-slate-800 shrink-0",loading:"lazy"},null,8,I),t("div",T,l(s.name),1)]),_:2},1032,["to"]))),128))])):(a(),o("div",D,l(r.$t("No subcategories found for this category.")),1))])}),128)),i.value.length==0?(a(),o("div",E,l(r.$t("No Categories Found")),1)):w("",!0)])])}}},H=p(L,[["__scopeId","data-v-4654cf78"]]);export{H as default};
