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