1import{V as x,u as w,e as F,aU as B,c as u,b2 as V,at as q,a as m,v as i,b as e,j as o,k as a,n as z,F as b,y as A,q as v,U as I,b6 as j,o as c,c1 as N,_ as T,m as U,B as $,dd as E,z as Q,H as D,Q as H}from"./DvgxvNL0.js";import{O as K}from"./DTes6T7R.js";import"./APhiMcq2.js";import"./DDNmsp7z.js";import"./B0nhbelq.js";import"./DG1csYqL.js";import"./C0jx6QEY.js";import"./BYO7PYqm.js";import"./m7MBEAIv.js";import"./BuVIxg8d.js";import"./DQSAL0As.js";const L={class:"universal-card"},P={class:"header__row"},S={class:"header__title text-2xl"},G={class:"input-group"},J={key:0,class:"orgs-grid"},R={class:"details"},W={class:"title"},X={class:"description"},Y={class:"stat-bar"},Z={class:"stats"},aa={__name:"organizations",async setup(ea){let l,h;const{formatMessage:n}=w(),r=I({organizationsTitle:{id:"dashboard.organizations.title",defaultMessage:"Organizations"},createOrganization:{id:"dashboard.organizations.button.create",defaultMessage:"Create organization"},memberCount:{id:"dashboard.organizations.member-count",defaultMessage:"{count} {count, plural, one {member} other {members}}"},makeOrganization:{id:"dashboard.organizations.empty.cta",defaultMessage:"Make an organization!"},fetchOrganizationsFailed:{id:"dashboard.organizations.error.fetch",defaultMessage:"Failed to fetch organizations"}}),p=H(null),y=([l,h]=F(()=>j()),l=await l,h(),l),M=B(),_=u(()=>y.value.user?.id||null),{data:g,error:O}=V({queryKey:u(()=>["user",_.value,"organizations"]),queryFn:()=>M.labrinth.users_v2.getOrganizations(_.value),enabled:u(()=>!!_.value)}),k=u(()=>g.value?[...g.value].sort((s,d)=>s.name.localeCompare(d.name)):[]),f=s=>s.filter(d=>d?.accepted);O.value&&q({statusCode:500,message:n(r.fetchOrganizationsFailed)});const C=s=>{p.value?.show(s)};return(s,d)=>(c(),m("div",null,[i(K,{ref_key:"createOrgModal",ref:p},null,512),e("section",L,[e("div",P,[e("h2",S,o(a(n)(a(r).organizationsTitle)),1),e("div",G,[i(a(T),{type:"colored",color:"brand",onClick:C},{default:z(()=>[i(a(N),{"aria-hidden":"true"}),v(" "+o(a(n)(a(r).createOrganization)),1)]),_:1})])]),a(g)?.length>0?(c(),m("div",J,[(c(!0),m(b,null,A(a(k),t=>(c(),U(a(D),{key:t.id,type:"quiet",interaction:"none",to:`/organization/${t.slug}`,class:Q(["universal-card recessed org !h-auto !w-full !shrink !items-stretch !justify-start !whitespace-normal !p-[var(--spacing-card-bg)]",{"is-disabled":f(t.members).length===0}])},{default:z(()=>[i(a($),{src:t.icon_url,alt:t.name,class:"icon"},null,8,["src","alt"]),e("div",R,[e("div",W,o(t.name),1),e("div",X,o(t.description),1),e("span",Y,[e("div",Z,[i(a(E),{"aria-hidden":"true"}),e("span",null,o(a(n)(a(r).memberCount,{count:f(t.members).length})),1)])])])]),_:2},1032,["to","class"]))),128))])):(c(),m(b,{key:1},[v(o(a(n)(a(r).makeOrganization)),1)],64))])]))}},_a=x(aa,[["__scopeId","data-v-535e4116"]]);export{_a as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.