try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`161a4201-4e6a-42e1-b080-dee074165475`,e._sentryDebugIdIdentifier=`sentry-dbid-161a4201-4e6a-42e1-b080-dee074165475`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{$i as t,Ag as n,Hm as r,Oi as i,Qh as a,Zm as o,_r as s,jg as c,mp as l,ng as u,op as d}from"./entry.client-mpghtlrl.js";import{t as f}from"./useDeferRestore-dphp89mz.js";import{t as p}from"./HorizontalSocialItem-locb7qz2.js";import{t as m}from"./HorizontalSocialItemLoading-lf95egyh.js";import{t as h}from"./ContainerVirtualGrid-gc40b5uu.js";import{t as g}from"./guideRouterEnvironmentHooks-h2xlfina.js";import{t as _}from"./useChatStrings-f6vrmnim.js";import{t as v}from"./GuidePageLayout-eh7novzv.js";import{t as y}from"./GuideIllustration-pex5y7xc.js";import{t as b}from"./GuideL2Header-a2pogkf0.js";var x=n(),S=e(c(),1),C=u(),w=e=>{let n=(0,x.c)(19),{members:i,ownerXuid:a,isLoading:o,onPress:s}=e,{locGenericErrorSubheading:c}=r(),{locGroupMembersLoadFailure:l}=_();if(f(o),t(o),i){let e;n[0]===a?e=n[1]:(e=(e,t)=>{if(e.xuid===a)return-1;if(t.xuid===a)return 1;let n=e.presence?.presenceState===`online`,r=t.presence?.presenceState===`online`;return n&&!r?-1:!n&&r?1:e.gamertag.uniqueGamertag.localeCompare(t.gamertag.uniqueGamertag)},n[0]=a,n[1]=e);let t=e,r;n[2]!==i||n[3]!==t?(r=[...i].sort(t),n[2]=i,n[3]=t,n[4]=r):r=n[4];let o=r,c;n[5]!==s||n[6]!==a?(c=e=>(0,C.jsx)(p,{xuid:e.xuid,onPress:()=>s(e.xuid),version:e.xuid===a?`groupOwner`:`noSuffix`,background:`invisible`},e.xuid),n[5]=s,n[6]=a,n[7]=c):c=n[7];let l;return n[8]!==o||n[9]!==c?(l=(0,C.jsx)(h,{items:o,renderItem:c,columns:1,overscan:5,gapSize:`var(--V225)`}),n[8]=o,n[9]=c,n[10]=l):l=n[10],l}else if(o){let e;return n[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,C.jsx)(`div`,{className:`flex max-h-full flex-col gap-layout-vertical-group-of-items-tight overflow-y-hidden`,children:Array.from({length:15},D)}),n[11]=e):e=n[11],e}else{let e;n[12]===l?e=n[13]:(e=l(),n[12]=l,n[13]=e);let t;n[14]===c?t=n[15]:(t=c(),n[14]=c,n[15]=t);let r;return n[16]!==e||n[17]!==t?(r=(0,C.jsx)(y,{title:e,subtitle:t,illustrationType:`error`}),n[16]=e,n[17]=t,n[18]=r):r=n[18],r}},T=s(w,()=>{let{conversation:e,profile:t}=o(),{groupId:n}=l({from:d.dialog.guide.chat.groupMembers.id}),{data:r,isLoading:i,isError:s}=a(e.queries.group.getActiveUserQuery().getOptions({groupId:n})),{data:c,isLoading:u,isError:f}=a({...t.queries.people.getActiveUserQuery().getOptions({xuids:r?.participantXuids??[]}),enabled:!!r}),p=g(),m=(0,S.useCallback)(e=>{p({to:d.dialog.guide.people.profileCard.fullPath,params:{xuid:e}})},[p]);return{members:c,ownerXuid:r?.ownerXuid,onPress:m,isLoading:i||u,isError:s||f}}),E=i(()=>(0,C.jsx)(T.useComponent(),{}),`GroupMembersList`);function D(e,t){return(0,C.jsx)(m,{includeContainer:!0},t)}var O=i(()=>{let{locGroupMembersHeader:e}=_();return(0,C.jsx)(v,{id:`guide-group-members`,header:(0,C.jsx)(b,{title:e()}),contentClassName:`gap-layout-vertical-related-content-in-a-section-tight`,children:(0,C.jsx)(E,{})})},`GroupMembersPage`);export{O as GroupMembersPage,O as default,w as t};