{"version":3,"file":"ChannelMembersView.utils.mjs","names":[],"sources":["../../../../../../src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersView.utils.ts"],"sourcesContent":["import { type Channel, type ChannelMemberResponse, type UserResponse } from 'stream-chat';\n\nexport const CHANNEL_MEMBERS_QUERY_LIMIT = 100;\n\nexport const getMemberDisplayName = (member: ChannelMemberResponse) =>\n  getUserDisplayName(member.user) || member.user_id || '';\n\nexport const getMemberUserId = (member: ChannelMemberResponse) =>\n  member.user?.id || member.user_id;\n\nexport const getUserDisplayName = (user?: UserResponse) =>\n  user?.name ||\n  (user?.custom as { username?: string } | undefined)?.username ||\n  user?.id ||\n  '';\n\nexport const getChannelMemberUserIds = (channel: Channel) =>\n  Object.values(channel.state?.members ?? {})\n    .map((member) => member.user?.id || member.user_id)\n    .filter((userId): userId is string => !!userId);\n\nexport const canUpdateChannelMembers = (channel: Channel) =>\n  channel.data?.own_capabilities?.includes('update-channel-members') ?? false;\n"],"mappings":";;AAIA,IAAa,wBAAwB,WACnC,mBAAmB,OAAO,IAAI,KAAK,OAAO,WAAW;AAEvD,IAAa,mBAAmB,WAC9B,OAAO,MAAM,MAAM,OAAO;AAE5B,IAAa,sBAAsB,SACjC,MAAM,SACL,MAAM,OAAA,EAA8C,YACrD,MAAM,MACN;AAEF,IAAa,2BAA2B,YACtC,OAAO,OAAO,QAAQ,OAAO,WAAW,CAAC,CAAC,CAAC,CACxC,KAAK,WAAW,OAAO,MAAM,MAAM,OAAO,OAAO,CAAC,CAClD,QAAQ,WAA6B,CAAC,CAAC,MAAM;AAElD,IAAa,2BAA2B,YACtC,QAAQ,MAAM,kBAAkB,SAAS,wBAAwB,KAAK"}