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-Cdq6f5zq.js";import{n as y,t as b}from"./AppLayout-7wQeNOuS.js";var x={class:`mx-auto max-w-[var(--c-container)]`},S={class:`mb-5 flex flex-wrap items-center gap-3`},C={class:`text-sm text-ink-muted`},w={class:`ml-auto flex items-center gap-2 rounded-full border border-line bg-surface px-4 py-2`},T=[`value`],E={key:0,class:`rounded-c border border-dashed border-line bg-surface p-12 text-center text-ink-muted`},D={key:1,class:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4`},O={class:`mt-3 flex items-center gap-1.5`},k={class:`font-bold`},A={key:0,class:`rounded bg-primary/15 px-1.5 py-0.5 text-[10px] font-semibold uppercase text-primary`},j={key:0,class:`mt-1 line-clamp-2 text-xs text-ink-2`},M={class:`mt-3 flex items-center gap-3 text-xs text-ink-muted`},N={key:2,class:`py-6 text-center`},P=n({__name:`Index`,props:{q:{},sort:{},members:{},total:{}},setup(n){let P=n,F=g(P.q),I=null;function L(){clearTimeout(I),I=setTimeout(()=>e.get(`/members`,{q:F.value,sort:P.sort},{preserveState:!0,replace:!0}),300)}function R(t){e.get(`/members`,{q:F.value,sort:t.target.value},{preserveState:!0})}return(e,g)=>(i(),t(f,null,[r(d(m),{title:`Members`}),r(b,null,{default:a(()=>[p(`div`,x,[p(`div`,S,[p(`div`,null,[g[1]||=p(`h1`,{class:`text-2xl font-extrabold tracking-tight`},`Members`,-1),p(`p`,C,s(n.total)+` `+s(n.total===1?`member`:`members`),1)]),p(`div`,w,[g[2]||=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=>F.value=e,onInput:L,type:`search`,placeholder:`Find a member…`,class:`w-44 border-0 bg-transparent p-0 text-sm text-ink placeholder:text-ink-muted focus:ring-0`},null,544),[[h,F.value]])]),p(`select`,{value:n.sort,onChange:R,class:`rounded-lg border-line bg-surface py-1.5 text-[13px] font-semibold text-ink-2 shadow-sm focus:ring-primary`},[...g[3]||=[p(`option`,{value:`newest`},`Newest`,-1),p(`option`,{value:`name`},`Name (A–Z)`,-1),p(`option`,{value:`posts`},`Most posts`,-1)]],40,T)]),n.members.data.length?(i(),t(`div`,D,[(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(y,{avatar:e,size:72},null,8,[`avatar`]),p(`div`,O,[p(`span`,k,s(e.name),1),e.isAdmin?(i(),t(`span`,A,`Admin`)):c(``,!0)]),e.bio?(i(),t(`p`,j,s(e.bio),1)):c(``,!0),p(`div`,M,[p(`span`,null,s(e.posts)+` posts`,1),g[4]||=p(`span`,null,`·`,-1),p(`span`,null,`Joined `+s(e.joined),1)])]),_:2},1032,[`href`]))),128))])):(i(),t(`div`,E,` No members found. `)),n.members.next?(i(),t(`div`,N,[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(()=>[...g[5]||=[l(`Load more`,-1)]]),_:1},8,[`href`])])):c(``,!0)])]),_:1})],64))}});export{P as default};