import{$ as e,C as t,D as n,E as r,L as i,Q as a,R as o,S as s,W as c,Z as l,b as u,et as d,i as f,k as p,o as m,r as h,v as g,w as _,x as v}from"./app-ae3zsclI.js";import{t as y}from"./i18n-M94zPSoE.js";import{t as b}from"./MarketingLayout-DZGgzvFt.js";var x={class:`mx-auto max-w-6xl px-6 py-16`},S={key:0,class:`mb-8 rounded-xl border border-emerald-500/30 bg-emerald-500/10 px-4 py-3 text-sm font-medium text-emerald-700 dark:text-emerald-300`},C={class:`mb-10 flex flex-wrap items-end justify-between gap-4`},w={class:`max-w-2xl`},T={class:`text-4xl font-black tracking-tight`},E={class:`mt-3 text-lg text-ink-2`},D={class:`flex shrink-0 items-center gap-2`},O={key:1,class:`rounded-2xl border border-dashed border-line p-16 text-center text-ink-muted`},k={key:2,class:`grid gap-5 sm:grid-cols-2 lg:grid-cols-3`},A=[`src`,`alt`],j={class:`text-5xl font-black uppercase opacity-90 drop-shadow-sm`},M={class:`flex flex-1 flex-col p-6`},N={class:`flex items-center gap-2`},P={class:`truncate font-bold group-hover:text-primary`},F={class:`ml-auto shrink-0 text-xs font-semibold uppercase tracking-wide text-ink-muted`},I={class:`mt-3 line-clamp-2 text-sm text-ink-2`},L={key:0,class:`mt-3`},R={class:`mt-4 flex flex-1 items-end justify-between border-t border-line pt-4`},z={class:`text-sm font-semibold text-primary group-hover:underline`},B=p({__name:`Index`,props:{products:{}},setup(p){let B=u(()=>m().props.flash?.status),V=u(()=>!!m().props.auth?.user),H=[[`#f472b6`,`#db2777`],[`#60a5fa`,`#2563eb`],[`#34d399`,`#059669`],[`#fbbf24`,`#d97706`],[`#a78bfa`,`#7c3aed`],[`#22d3ee`,`#0891b2`],[`#fb7185`,`#e11d48`],[`#818cf8`,`#4f46e5`]];function U(e){let t=String(e.id??e.slug??e.name??``),n=0;for(let e=0;e<t.length;e++)n=n*31+t.charCodeAt(e)>>>0;return n%H.length}function W(e){let[t,n]=H[U(e)];return`linear-gradient(135deg,${t},${n})`}function G(e){let[,t]=H[U(e)];return{background:t+`0d`,borderColor:t+`47`}}function K(e){return e?.rating===`safe`?{t:y(`✓ Reviewed safe`),c:`bg-emerald-500/15 text-emerald-600 dark:text-emerald-400`}:e?.rating===`caution`?{t:y(`⚠ Review: caution`),c:`bg-amber-500/15 text-amber-600 dark:text-amber-400`}:e?.rating===`unsafe`?{t:y(`⛔ Review: unsafe`),c:`bg-red-500/15 text-red-600 dark:text-red-400`}:null}return(u,m)=>(i(),_(g,null,[n(l(h),{title:l(y)(`Extensions & themes — {brand}`,{brand:`Convoro`})},null,8,[`title`]),n(b,null,{default:c(()=>[v(`section`,x,[B.value?(i(),_(`div`,S,d(B.value),1)):t(``,!0),v(`div`,C,[v(`div`,w,[v(`h1`,T,d(l(y)(`Extensions & themes`)),1),v(`p`,E,d(l(y)(`Browse the directory of Convoro extensions and themes. Free add-ons install in one click; premium ones are purchased on their detail page — you get a license key to install on any of your sites.`)),1)]),v(`div`,D,[V.value?(i(),s(l(f),{key:0,href:`/extensions/manage`,class:`inline-flex items-center gap-2 rounded-c border border-line px-4 py-2.5 text-sm font-bold text-ink-2 hover:bg-surface-2`},{default:c(()=>[r(d(l(y)(`Manage yours`)),1)]),_:1})):t(``,!0),n(l(f),{href:`/extensions/submit`,class:`inline-flex items-center gap-2 rounded-c bg-primary px-5 py-2.5 text-sm font-bold text-white hover:bg-primary-600`},{default:c(()=>[m[0]||=v(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[v(`path`,{d:`M12 5v14M5 12h14`})],-1),r(` `+d(l(y)(`Submit your extension`)),1)]),_:1})])]),p.products.length?(i(),_(`div`,k,[(i(!0),_(g,null,o(p.products,n=>(i(),s(l(f),{key:n.slug,href:`/extensions/${n.slug}`,style:e(G(n)),class:`group flex flex-col overflow-hidden rounded-2xl border transition hover:-translate-y-0.5 hover:shadow-lg`},{default:c(()=>[n.image?(i(),_(`img`,{key:0,src:n.image,alt:n.name,loading:`lazy`,class:`aspect-[2/1] w-full object-cover`},null,8,A)):(i(),_(`div`,{key:1,class:`grid aspect-[2/1] w-full place-items-center text-4xl text-white/95`,style:e({background:W(n)})},[v(`span`,j,d((n.name||`?`).slice(0,2)),1)],4)),v(`div`,M,[v(`div`,N,[v(`h3`,P,d(n.name),1),v(`span`,F,d(n.type),1)]),v(`p`,I,d(n.description),1),K(n.review)?(i(),_(`div`,L,[v(`span`,{class:a([`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-bold`,K(n.review).c])},d(K(n.review).t),3)])):t(``,!0),v(`div`,R,[v(`span`,{class:a([`font-extrabold`,n.free?`text-ink-muted`:`text-primary`])},d(n.price),3),v(`span`,z,d(l(y)(`View →`)),1)])])]),_:2},1032,[`href`,`style`]))),128))])):(i(),_(`div`,O,d(l(y)(`New premium add-ons are on the way. Check back soon.`)),1))])]),_:1})],64))}});export{B as default};