import{$ as e,C as t,D as n,E as r,I as i,J as a,L as o,O as s,S as c,U as l,W as u,X as d,Z as f,et as p,i as m,m as h,r as g,v as _,w as v,x as y}from"./app-BbZPoF8j.js";import{t as b}from"./i18n-CsLl9BZK.js";import{n as x,t as S}from"./AppLayout-DtGQn8-v.js";var C={class:`mx-auto max-w-[var(--c-container)]`},w={class:`mb-5 flex flex-wrap items-center gap-3`},T={class:`text-2xl font-extrabold tracking-tight`},E={class:`text-sm text-ink-muted`},D={class:`ml-auto flex items-center gap-2 rounded-full border border-line bg-surface px-4 py-2`},O=[`placeholder`],k=[`value`],A={value:`newest`},j={value:`name`},M={value:`posts`},N={key:0,class:`rounded-c border border-dashed border-line bg-surface p-12 text-center text-ink-muted`},P={key:1,class:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4`},F={class:`mt-3 flex items-center gap-1.5`},I={class:`font-bold`},L={key:0,class:`rounded bg-primary/15 px-1.5 py-0.5 text-[10px] font-semibold uppercase text-primary`},R={key:0,class:`mt-1 line-clamp-2 text-xs text-ink-2`},z={class:`mt-3 flex items-center gap-3 text-xs text-ink-muted`},B={key:2,class:`py-6 text-center`},V=s({__name:`Index`,props:{q:{},sort:{},members:{},total:{}},setup(s){let V=s,H=a(V.q),U=null;function W(){clearTimeout(U),U=setTimeout(()=>p.get(`/members`,{q:H.value,sort:V.sort},{preserveState:!0,replace:!0}),300)}function G(e){p.get(`/members`,{q:H.value,sort:e.target.value},{preserveState:!0})}return(a,p)=>(i(),v(_,null,[n(d(g),{title:d(b)(`Members`)},null,8,[`title`]),n(S,null,{default:l(()=>[y(`div`,C,[y(`div`,w,[y(`div`,null,[y(`h1`,T,e(d(b)(`Members`)),1),y(`p`,E,e(s.total)+` `+e(s.total===1?d(b)(`member`):d(b)(`members`)),1)]),y(`div`,D,[p[1]||=y(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,class:`text-ink-muted`},[y(`circle`,{cx:`11`,cy:`11`,r:`7`}),y(`path`,{d:`m21 21-4.3-4.3`})],-1),u(y(`input`,{"onUpdate:modelValue":p[0]||=e=>H.value=e,onInput:W,type:`search`,placeholder:d(b)(`Find a member…`),class:`w-44 border-0 bg-transparent p-0 text-sm text-ink placeholder:text-ink-muted focus:ring-0`},null,40,O),[[h,H.value]])]),y(`select`,{value:s.sort,onChange:G,class:`rounded-lg border-line bg-surface py-1.5 text-[13px] font-semibold text-ink-2 shadow-sm focus:ring-primary`},[y(`option`,A,e(d(b)(`Newest`)),1),y(`option`,j,e(d(b)(`Name (A–Z)`)),1),y(`option`,M,e(d(b)(`Most posts`)),1)],40,k)]),s.members.data.length?(i(),v(`div`,P,[(i(!0),v(_,null,o(s.members.data,r=>(i(),c(d(m),{key:r.id,href:r.url,class:`flex flex-col items-center rounded-c border border-line bg-surface p-6 text-center shadow-sm transition hover:-translate-y-0.5 hover:shadow-md`},{default:l(()=>[n(x,{avatar:r,size:88},null,8,[`avatar`]),y(`div`,F,[y(`span`,I,e(r.name),1),r.isAdmin?(i(),v(`span`,L,e(d(b)(`Admin`)),1)):r.trust?(i(),v(`span`,{key:1,class:f([`rounded px-1.5 py-0.5 text-[10px] font-semibold`,r.trust.level>=4?`bg-amber-400/20 text-amber-500`:r.trust.level>=1?`bg-primary/15 text-primary`:`bg-ink/10 text-ink-muted`])},e(r.trust.level>=4?`★ `:``)+e(d(b)(r.trust.label)),3)):t(``,!0)]),r.bio?(i(),v(`p`,R,e(r.bio),1)):t(``,!0),y(`div`,z,[y(`span`,null,e(d(b)(`{n} posts`,{n:r.posts})),1),p[2]||=y(`span`,null,`·`,-1),y(`span`,null,e(d(b)(`Joined {date}`,{date:r.joined})),1)])]),_:2},1032,[`href`]))),128))])):(i(),v(`div`,N,e(d(b)(`No members found.`)),1)),s.members.next?(i(),v(`div`,B,[n(d(m),{href:s.members.next,class:`rounded-c border border-line bg-surface px-5 py-2.5 text-sm font-semibold hover:bg-surface-2`},{default:l(()=>[r(e(d(b)(`Load more`)),1)]),_:1},8,[`href`])])):t(``,!0)])]),_:1})],64))}});export{V as default};