2026-07-25 08:10:48 +00:00
// Module ID: 4313
// Function ID: 37792
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-25 08:10:48 +00:00
// Dependencies: [1352, 1348, 1908, 3759, 1907, 4204, 653, 1852, 3764, 483, 1882, 4314, 4315, 1212, 3970, 4316, 21, 2, 4323]
2026-07-20 16:05:17 +00:00
// Exports: channelTypeString, computeSummarizedVoiceUsers, denyChannelAccessForNonPaidUsers, getBitrateLimit, getChannelAnalyticsPage, getChannelLinkToCopy, getMentionIconType, getPrivateChannelUserTagsString, isAnyVoiceStateStage, isChannelFull, permissionOverwriteForRole, permissionOverwriteForUser, permissionOverwritesForAnnouncement, permissionOverwritesForRoles, previousTextChannelRouteForGuild
2026-07-25 08:10:48 +00:00
// Module 4313 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import _callSuper from "_callSuper" ;
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import closure_8 from "_isNativeReflectConstruct" ;
import closure_9 from "_isNativeReflectConstruct" ;
import closure_10 from "_isNativeReflectConstruct" ;
import closure_11 from "_isNativeReflectConstruct" ;
import ME from "ME" ;
import { BoostedGuildFeatures } from "GuildFeatures" ;
let closure_13 ;
let closure_14 ;
let closure_15 ;
let closure_16 ;
let closure_17 ;
let closure_18 ;
let closure_19 ;
let closure_21 ;
let closure_22 ;
let closure_23 ;
let closure_4 ;
let closure_5 ;
let closure_6 ;
function _createForOfIteratorHelperLoose ( iterable ) {
let closure_0 = iterable ;
iterable = "undefined" !== typeof Symbol ;
if ( iterable ) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol ;
2026-07-23 10:11:24 +00:00
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( ! iterable ) {
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( iterable ) {
const iter = iterable . call ( iterable ) ;
2026-07-20 16:05:17 +00:00
const next = iter . next ;
return next . bind ( iter ) ;
} else {
const _Array = Array ;
2026-07-23 10:11:24 +00:00
let tmp = iterable ;
if ( ! Array . isArray ( iterable ) ) {
2026-07-20 16:05:17 +00:00
let tmp2 ;
2026-07-23 10:11:24 +00:00
if ( iterable ) {
if ( "string" === typeof iterable ) {
tmp2 = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
const toString = { } . toString ;
2026-07-23 10:11:24 +00:00
const substr = toString . call ( iterable ) . slice ( 8 , - 1 ) ;
2026-07-20 16:05:17 +00:00
let name = substr ;
if ( tmp3 ) {
2026-07-23 10:11:24 +00:00
name = iterable . constructor . name ;
2026-07-20 16:05:17 +00:00
}
if ( "Map" !== name ) {
if ( "Set" !== name ) {
if ( "Arguments" === name ) {
2026-07-23 10:11:24 +00:00
let arr = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ ;
2026-07-20 16:05:17 +00:00
}
}
tmp2 = arr ;
}
const _Array2 = Array ;
2026-07-23 10:11:24 +00:00
arr = Array . from ( iterable ) ;
const callResult = toString . call ( iterable ) ;
tmp3 = "Object" === substr && iterable . constructor ;
2026-07-20 16:05:17 +00:00
}
}
tmp = tmp2 ;
if ( ! tmp2 ) {
const _TypeError = TypeError ;
const typeError = new TypeError ( "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
throw typeError ;
}
}
if ( tmp ) {
2026-07-23 10:11:24 +00:00
closure_0 = tmp ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = 0 ;
2026-07-20 16:05:17 +00:00
return ( ) = > {
2026-07-23 10:11:24 +00:00
if ( closure_1 >= length . length ) {
2026-07-20 16:05:17 +00:00
let obj = { done : true } ;
} else {
obj = { done : false } ;
closure_1 = tmp3 + 1 ;
2026-07-23 10:11:24 +00:00
obj . value = length [ + closure_1 ] ;
2026-07-20 16:05:17 +00:00
}
return obj ;
} ;
}
}
function _arrayLikeToArray ( arg0 , arg1 ) {
let length ;
if ( tmp ) {
length = arg0 . length ;
}
const ArrayResult = Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
ArrayResult [ num ] = arg0 [ num ] ;
}
return ArrayResult ;
}
function isTypeOrCategory ( channelType , closure_21 ) {
let tmp = channelType === closure_21 ;
if ( ! tmp ) {
tmp = channelType === closure_22 ;
}
return tmp ;
}
function allowChannelAccess ( id , channelType , MEMBER ) {
2026-07-25 08:10:48 +00:00
const NONE = importAll ( 3764 ) . NONE ;
2026-07-20 16:05:17 +00:00
let tmp = callback ( channelType ) ;
if ( ! tmp ) {
tmp = channelType === closure_22 ;
}
let addResult = NONE ;
if ( tmp ) {
2026-07-23 10:11:24 +00:00
let obj = importAll ( 483 ) ;
2026-07-20 16:05:17 +00:00
addResult = obj . add ( NONE , constants . VIEW_CHANNEL ) ;
}
let tmp7 = isTypeOrCategory ( channelType , closure_21 ) ;
if ( ! tmp7 ) {
tmp7 = isTypeOrCategory ( channelType , closure_23 ) ;
}
let addResult2 = addResult ;
if ( tmp7 ) {
2026-07-23 10:11:24 +00:00
const obj2 = importAll ( 483 ) ;
const addResult1 = importAll ( 483 ) . add ( addResult , constants . VIEW_CHANNEL ) ;
addResult2 = importAll ( 483 ) . add ( addResult1 , constants . CONNECT ) ;
const obj3 = importAll ( 483 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-25 08:10:48 +00:00
obj = { id , type : MEMBER , deny : importAll ( 3764 ) . NONE , allow : addResult2 } ;
2026-07-20 16:05:17 +00:00
return obj ;
}
function computeSummarizedVoiceStates ( arg0 ) {
let channels ;
2026-07-23 10:11:24 +00:00
let importAll ;
let importDefault ;
let require ;
( { channels , selectedChannelId : require , selectedVoiceChannelId : importDefault , voiceStates : importAll } = arg0 ) ;
2026-07-20 16:05:17 +00:00
const items = [ ] ;
2026-07-23 10:11:24 +00:00
let item = channels . forEach ( ( id ) = > {
2026-07-20 16:05:17 +00:00
if ( id . id !== closure_1 ) {
if ( id . id !== closure_0 ) {
2026-07-23 10:11:24 +00:00
if ( null != table [ id . id ] ) {
2026-07-20 16:05:17 +00:00
const forEach = arr . forEach ;
if ( id . isGuildStageVoice ( ) ) {
const item = forEach ( ( voiceState ) = > {
2026-07-23 10:11:24 +00:00
const audienceRequestToSpeakState = outer2_0 ( items [ 12 ] ) . getAudienceRequestToSpeakState ( voiceState . voiceState ) ;
if ( audienceRequestToSpeakState === outer2_0 ( items [ 12 ] ) . RequestToSpeakStates . ON_STAGE ) {
outer1_3 . push ( voiceState ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
} else {
2026-07-23 10:11:24 +00:00
const item1 = forEach ( ( arg0 ) = > outer1_3 . push ( arg0 ) ) ;
2026-07-20 16:05:17 +00:00
}
}
}
}
} ) ;
return items ;
}
function getChannelPermalink ( guild_id , id , id2 , id3 ) {
let str = "" ;
if ( null != id3 ) {
const _HermesInternal = HermesInternal ;
str = "?summaryId=" + id3 ;
}
return "" + location . protocol + "//" + location . host + closure_18 . CHANNEL ( guild_id , id , id2 ) + str ;
}
function getChannelThreadPermalink ( guildId , id , id2 , id2 ) {
if ( null != guildId ) {
if ( null != id ) {
if ( null != id2 ) {
const _location = location ;
const _location2 = location ;
const _HermesInternal = HermesInternal ;
let combined = "" + protocol + "//" + host + closure_18 . CHANNEL_THREAD_VIEW ( guildId , id , id2 , id2 ) ;
}
return combined ;
}
}
combined = getChannelPermalink ( guildId , id , id2 ) ;
}
2026-07-23 10:11:24 +00:00
( { isGuildSelectableChannelType : closure_4 , TEXT_CHANNEL_TYPES : closure_5 , THREAD_CHANNEL_TYPES : closure_6 } = _callSuper ) ;
const ChannelTypes = ME . ChannelTypes ;
( { Permissions : closure_13 , GuildFeatures : closure_14 , BoostedGuildTiers : closure_15 , BITRATE_MAX : closure_16 , BITRATE_DEFAULT : closure_17 , Routes : closure_18 , AnalyticsPages : closure_19 } = ME ) ;
2026-07-20 16:05:17 +00:00
( { GUILD_VOICE : closure_21 , GUILD_CATEGORY : closure_22 , GUILD_STAGE_VOICE : closure_23 } = ChannelTypes ) ;
2026-07-23 10:11:24 +00:00
let result = require ( "_isNativeReflectConstruct" ) . fileFinishedImporting ( "utils/ChannelUtils.tsx" ) ;
2026-07-20 16:05:17 +00:00
export const denyChannelAccessForNonPaidUsers = function denyChannelAccessForNonPaidUsers ( id ) {
if ( arg1 === ChannelTypes . GUILD_STAGE_VOICE ) {
2026-07-23 10:11:24 +00:00
let obj = importAll ( 483 ) ;
2026-07-25 08:10:48 +00:00
obj = { id , type : require ( 1882 ) /* PermissionOverwriteType */ . PermissionOverwriteType . ROLE , allow : importAll ( 3764 ) . NONE } ;
obj . deny = obj . add ( importAll ( 3764 ) . NONE , constants . CONNECT ) ;
2026-07-20 16:05:17 +00:00
return obj ;
} else {
const _Error = Error ;
const _HermesInternal = HermesInternal ;
const error = new Error ( "Premium channel feature not supported for channel type " + arg1 ) ;
throw error ;
}
} ;
export { allowChannelAccess } ;
export const permissionOverwritesForRoles = function permissionOverwritesForRoles ( guildId , channelType , arr , arg3 ) {
let flag = arg3 ;
2026-07-23 10:11:24 +00:00
const _require = channelType ;
2026-07-20 16:05:17 +00:00
if ( arg3 === undefined ) {
flag = false ;
}
const items = [ ] ;
if ( tmp ) {
2026-07-25 08:10:48 +00:00
const NONE = importAll ( 3764 ) . NONE ;
2026-07-20 16:05:17 +00:00
let tmp6 = callback ( channelType ) ;
if ( ! tmp6 ) {
tmp6 = channelType === closure_22 ;
}
let addResult = NONE ;
if ( tmp6 ) {
2026-07-23 10:11:24 +00:00
let obj = importAll ( 483 ) ;
2026-07-20 16:05:17 +00:00
addResult = obj . add ( NONE , constants . VIEW_CHANNEL ) ;
}
let addResult2 = addResult ;
if ( isTypeOrCategory ( channelType , closure_21 ) ) {
2026-07-23 10:11:24 +00:00
const obj2 = importAll ( 483 ) ;
const addResult1 = importAll ( 483 ) . add ( addResult , constants . VIEW_CHANNEL ) ;
addResult2 = importAll ( 483 ) . add ( addResult1 , constants . CONNECT ) ;
const obj3 = importAll ( 483 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-25 08:10:48 +00:00
obj = { id : guildId , type : _require ( 1882 ) . PermissionOverwriteType . ROLE , allow : importAll ( 3764 ) . NONE , deny : addResult2 } ;
2026-07-20 16:05:17 +00:00
items . push ( obj ) ;
}
const item = arr . forEach ( ( arg0 ) = > {
2026-07-23 10:11:24 +00:00
items . push ( outer1_27 ( arg0 , channelType , channelType ( outer1_3 [ 10 ] ) . PermissionOverwriteType . ROLE ) ) ;
2026-07-20 16:05:17 +00:00
} ) ;
return items ;
} ;
export const permissionOverwriteForUser = function permissionOverwriteForUser ( id , channelType ) {
2026-07-25 08:10:48 +00:00
return allowChannelAccess ( id , channelType , require ( 1882 ) /* PermissionOverwriteType */ . PermissionOverwriteType . MEMBER ) ;
2026-07-20 16:05:17 +00:00
} ;
export const permissionOverwriteForRole = function permissionOverwriteForRole ( id , channelType ) {
2026-07-25 08:10:48 +00:00
return allowChannelAccess ( id , channelType , require ( 1882 ) /* PermissionOverwriteType */ . PermissionOverwriteType . ROLE ) ;
2026-07-20 16:05:17 +00:00
} ;
export const permissionOverwritesForAnnouncement = function permissionOverwritesForAnnouncement ( id ) {
2026-07-25 08:10:48 +00:00
const items = [ { id , type : require ( 1882 ) /* PermissionOverwriteType */ . PermissionOverwriteType . ROLE , deny : constants.SEND_MESSAGES , allow : importAll ( 3764 ) . NONE } ] ;
2026-07-20 16:05:17 +00:00
return items ;
} ;
2026-07-23 10:11:24 +00:00
export const isChannelFull = function isChannelFull ( channel , stateFromStores3 , stateFromStores1 ) {
2026-07-20 16:05:17 +00:00
const guildId = channel . getGuildId ( ) ;
2026-07-23 10:11:24 +00:00
const guild = stateFromStores1 . getGuild ( guildId ) ;
2026-07-20 16:05:17 +00:00
let maxVideoChannelUsers ;
if ( null != guild ) {
maxVideoChannelUsers = guild . maxVideoChannelUsers ;
}
let num = - 1 ;
let num2 = - 1 ;
if ( null != maxVideoChannelUsers ) {
num2 = maxVideoChannelUsers ;
}
let prop ;
if ( null != guild ) {
prop = guild . maxStageVideoChannelUsers ;
}
if ( null != prop ) {
num = prop ;
}
const result = closure_11 . countVoiceStatesForChannel ( channel . id ) ;
const voiceStatesForChannel = closure_11 . getVoiceStatesForChannel ( channel ) ;
let canResult = closure_9 . can ( constants . MOVE_MEMBERS , channel ) ;
if ( canResult ) {
canResult = closure_9 . can ( constants . CONNECT , channel ) ;
}
if ( channel . type === closure_23 ) {
let tmp11 = null != guildId ;
if ( tmp11 ) {
2026-07-23 10:11:24 +00:00
let hasVideoResult = stateFromStores3 . hasVideo ( channel . id ) ;
2026-07-20 16:05:17 +00:00
if ( ! hasVideoResult ) {
2026-07-25 08:10:48 +00:00
hasVideoResult = require ( 4314 ) /* hasStream */ . hasStream ( voiceStatesForChannel ) ;
const obj = require ( 4314 ) /* hasStream */ ;
2026-07-20 16:05:17 +00:00
}
tmp11 = hasVideoResult ;
}
if ( tmp11 ) {
tmp11 = num > 0 ;
}
if ( tmp11 ) {
tmp11 = result >= num ;
}
let tmp10 = tmp11 ;
} else {
2026-07-23 10:11:24 +00:00
tmp10 = null != guildId && stateFromStores3 . hasVideo ( channel . id ) ;
2026-07-20 16:05:17 +00:00
if ( tmp10 ) {
tmp10 = num2 > 0 ;
}
if ( tmp10 ) {
let num4 = 0 ;
if ( canResult ) {
num4 = 1 ;
}
tmp10 = result >= num2 + num4 ;
}
}
let tmp15 = channel . userLimit > 0 && result >= channel . userLimit ;
if ( ! tmp10 ) {
if ( tmp15 ) {
tmp15 = ! canResult ;
}
tmp10 = tmp15 ;
}
return tmp10 ;
} ;
2026-07-23 10:11:24 +00:00
export const sanitizeGuildTextChannelName = require ( "sanitizeGuildTextChannelName" ) ;
2026-07-20 16:05:17 +00:00
export const getBitrateLimit = function getBitrateLimit ( guild , channel ) {
if ( channel . isGuildStageVoice ( ) ) {
let bound = closure_17 ;
} else if ( null == guild ) {
bound = closure_16 ;
} else {
const features = guild . features ;
if ( features . has ( constants2 . VIP_REGIONS ) ) {
2026-07-23 10:11:24 +00:00
let bitrate = BoostedGuildFeatures [ TIER_3 . TIER_3 ] . limits . bitrate ;
2026-07-20 16:05:17 +00:00
} else {
bitrate = closure_16 ;
}
bound = Math . max ( bitrate , BoostedGuildFeatures [ guild . premiumTier ] . limits . bitrate ) ;
}
return bound ;
} ;
export { computeSummarizedVoiceStates } ;
export const computeSummarizedVoiceUsers = function computeSummarizedVoiceUsers ( channels ) {
return computeSummarizedVoiceStates ( { channels : channels.channels , selectedChannelId : channels.selectedChannelId , selectedVoiceChannelId : channels.selectedVoiceChannelId , voiceStates : channels.voiceStates } ) . map ( ( user ) = > user . user ) ;
} ;
2026-07-23 10:11:24 +00:00
export const isAnyVoiceStateStage = function isAnyVoiceStateStage ( channels , stateFromStores , closure_1 ) {
2026-07-20 16:05:17 +00:00
const tmp = _createForOfIteratorHelperLoose ( channels ) ;
const iter = tmp ( ) ;
let iter2 = iter ;
if ( ! iter . done ) {
while ( true ) {
let value = iter2 . value ;
let tmp4 = tmp2 ;
let tmp5 = tmp3 ;
if ( value . id !== stateFromStores ) {
2026-07-23 10:11:24 +00:00
let tmp13 = closure_1 [ value . id ] ;
2026-07-20 16:05:17 +00:00
let tmp14 = tmp13 ;
tmp4 = tmp2 ;
tmp5 = tmp3 ;
if ( null != tmp13 ) {
let tmp15 = tmp13 ;
tmp4 = tmp2 ;
tmp5 = tmp3 ;
if ( value . isGuildStageVoice ( ) ) {
let tmp6 = _createForOfIteratorHelperLoose ;
let tmp7 = _createForOfIteratorHelperLoose ( tmp13 ) ;
let iter3 = tmp7 ( ) ;
let iter4 = iter3 ;
let tmp8 = tmp13 ;
tmp4 = iter3 ;
tmp5 = tmp7 ;
if ( ! iter3 . done ) {
let tmp9 = require ;
let tmp10 = dependencyMap ;
2026-07-25 08:10:48 +00:00
let obj = require ( 4315 ) /* getAudienceRequestToSpeakState */ ;
2026-07-20 16:05:17 +00:00
let audienceRequestToSpeakState = obj . getAudienceRequestToSpeakState ( iter4 . value . voiceState ) ;
2026-07-25 08:10:48 +00:00
while ( audienceRequestToSpeakState !== require ( 4315 ) /* getAudienceRequestToSpeakState */ . RequestToSpeakStates . ON_STAGE ) {
2026-07-20 16:05:17 +00:00
let iter5 = tmp7 ( ) ;
iter4 = iter5 ;
let tmp12 = tmp13 ;
tmp4 = iter5 ;
tmp5 = tmp7 ;
continue ;
}
let flag = true ;
return true ;
}
}
}
}
let iter6 = tmp ( ) ;
2026-07-23 10:11:24 +00:00
tmp2 = tmp4 ;
tmp3 = tmp5 ;
2026-07-20 16:05:17 +00:00
iter2 = iter6 ;
}
}
return false ;
} ;
export const channelTypeString = function channelTypeString ( channel ) {
const type = channel . type ;
if ( ChannelTypes . DM === type ) {
2026-07-23 10:11:24 +00:00
const intl10 = require ( 1212 ) /* getSystemLocale */ . intl ;
return intl10 . string ( require ( 1212 ) /* getSystemLocale */ . t . jN2DfZ ) ;
2026-07-20 16:05:17 +00:00
} else if ( ChannelTypes . GROUP_DM === type ) {
2026-07-23 10:11:24 +00:00
const intl9 = require ( 1212 ) /* getSystemLocale */ . intl ;
return intl9 . string ( require ( 1212 ) /* getSystemLocale */ . t [ "e5y+gm" ] ) ;
2026-07-20 16:05:17 +00:00
} else if ( ChannelTypes . GUILD_TEXT === type ) {
2026-07-23 10:11:24 +00:00
const intl8 = require ( 1212 ) /* getSystemLocale */ . intl ;
return intl8 . string ( require ( 1212 ) /* getSystemLocale */ . t . Pnajj0 ) ;
2026-07-20 16:05:17 +00:00
} else if ( ChannelTypes . GUILD_FORUM === type ) {
2026-07-23 10:11:24 +00:00
const intl7 = require ( 1212 ) /* getSystemLocale */ . intl ;
return intl7 . string ( require ( 1212 ) /* getSystemLocale */ . t . GbryDd ) ;
2026-07-20 16:05:17 +00:00
} else if ( ChannelTypes . GUILD_MEDIA === type ) {
2026-07-23 10:11:24 +00:00
const intl6 = require ( 1212 ) /* getSystemLocale */ . intl ;
return intl6 . string ( require ( 1212 ) /* getSystemLocale */ . t . seKITE ) ;
2026-07-20 16:05:17 +00:00
} else if ( ChannelTypes . GUILD_VOICE === type ) {
2026-07-23 10:11:24 +00:00
const intl5 = require ( 1212 ) /* getSystemLocale */ . intl ;
return intl5 . string ( require ( 1212 ) /* getSystemLocale */ . t . BVZqJl ) ;
2026-07-20 16:05:17 +00:00
} else if ( ChannelTypes . GUILD_STAGE_VOICE === type ) {
2026-07-23 10:11:24 +00:00
const intl4 = require ( 1212 ) /* getSystemLocale */ . intl ;
return intl4 . string ( require ( 1212 ) /* getSystemLocale */ . t . EErMzA ) ;
2026-07-20 16:05:17 +00:00
} else if ( ChannelTypes . GUILD_ANNOUNCEMENT === type ) {
2026-07-23 10:11:24 +00:00
const intl3 = require ( 1212 ) /* getSystemLocale */ . intl ;
return intl3 . string ( require ( 1212 ) /* getSystemLocale */ . t . l1dkSD ) ;
2026-07-20 16:05:17 +00:00
} else if ( ChannelTypes . GUILD_STORE === type ) {
2026-07-23 10:11:24 +00:00
const intl2 = require ( 1212 ) /* getSystemLocale */ . intl ;
return intl2 . string ( require ( 1212 ) /* getSystemLocale */ . t [ "P1/Erq" ] ) ;
2026-07-20 16:05:17 +00:00
} else if ( ChannelTypes . GUILD_CATEGORY === type ) {
2026-07-23 10:11:24 +00:00
const intl = require ( 1212 ) /* getSystemLocale */ . intl ;
return intl . string ( require ( 1212 ) /* getSystemLocale */ . t . vHCZwr ) ;
2026-07-20 16:05:17 +00:00
} else {
return null ;
}
} ;
2026-07-23 10:11:24 +00:00
export const getPrivateChannelUserTagsString = function getPrivateChannelUserTagsString ( recipients , outer1_7 ) {
2026-07-20 16:05:17 +00:00
let iter ;
if ( null == recipients ) {
return null ;
} else {
2026-07-23 10:11:24 +00:00
const currentUser = outer1_7 . getCurrentUser ( ) ;
2026-07-20 16:05:17 +00:00
let id ;
if ( null != currentUser ) {
id = currentUser . id ;
}
if ( null == id ) {
return null ;
} else {
const items = [ ] ;
const tmp8 = _createForOfIteratorHelperLoose ( recipients ) ;
const iter3 = tmp8 ( ) ;
let iter2 = iter3 ;
if ( ! iter3 . done ) {
do {
let value = iter2 . value ;
if ( id !== value ) {
2026-07-23 10:11:24 +00:00
let user = outer1_7 . getUser ( value ) ;
2026-07-20 16:05:17 +00:00
let tmp3 = user ;
if ( null != user ) {
let arr = items . push ( user ) ;
let tmp5 = user ;
}
}
iter = tmp8 ( ) ;
iter2 = iter ;
} while ( ! iter . done ) ;
}
if ( 0 === items . length ) {
return null ;
} else {
const substr = items . slice ( 0 , 2 ) ;
const mapped = substr . map ( ( isProvisional ) = > {
2026-07-23 10:11:24 +00:00
const obj = outer1_1 ( outer1_3 [ 14 ] ) ;
2026-07-20 16:05:17 +00:00
if ( isProvisional . isProvisional ) {
let name = obj . getName ( isProvisional ) ;
} else {
name = obj . getUserTag ( isProvisional ) ;
}
return name ;
} ) ;
2026-07-23 10:11:24 +00:00
const intl = require ( 1212 ) /* getSystemLocale */ . intl ;
let obj = { users : items.length , user1 : mapped [ 0 ] , user2 : mapped [ 1 ] , extras : items.length - mapped . length } ;
return intl . formatToPlainString ( require ( 1212 ) /* getSystemLocale */ . t . BXG0Eh , obj ) ;
2026-07-20 16:05:17 +00:00
}
}
}
} ;
export const getMentionIconType = function getMentionIconType ( channel ) {
if ( null == channel ) {
return "text" ;
} else {
const isNSFWResult = channel . isNSFW ( ) ;
const isSpoilerChannelResult = channel . isSpoilerChannel ( ) ;
if ( channel . type === ChannelTypes . GUILD_VOICE ) {
let str11 = "voice-locked" ;
if ( closure_9 . can ( constants . CONNECT , channel ) ) {
let str12 = "voice-nsfw" ;
if ( ! isNSFWResult ) {
let str13 = "voice" ;
if ( isSpoilerChannelResult ) {
str13 = "voice-spoiler" ;
}
str12 = str13 ;
}
str11 = str12 ;
}
let tmp4 = str11 ;
} else if ( channel . type === ChannelTypes . GUILD_STAGE_VOICE ) {
let str10 = "stage-locked" ;
if ( closure_9 . can ( constants . CONNECT , channel ) ) {
str10 = "stage" ;
}
tmp4 = str10 ;
} else if ( set2 . has ( channel . type ) ) {
let str9 = "thread" ;
if ( channel . isForumPost ( ) ) {
str9 = "post" ;
}
tmp4 = str9 ;
} else if ( channel . type === ChannelTypes . GUILD_FORUM ) {
if ( tmp12 ) {
let str8 = "media" ;
if ( isNSFWResult ) {
str8 = "media-nsfw" ;
}
let str6 = str8 ;
} else {
str6 = "forum-nsfw" ;
if ( ! isNSFWResult ) {
let str7 = "forum" ;
if ( isSpoilerChannelResult ) {
str7 = "forum-spoiler" ;
}
str6 = str7 ;
}
}
} else if ( channel . type === ChannelTypes . GUILD_MEDIA ) {
let str5 = "media" ;
if ( isNSFWResult ) {
str5 = "media-nsfw" ;
}
tmp4 = str5 ;
} else if ( channel . type === ChannelTypes . GUILD_ANNOUNCEMENT ) {
let str3 = "announcement-nsfw" ;
if ( ! isNSFWResult ) {
let str4 = "announcement" ;
if ( isSpoilerChannelResult ) {
str4 = "announcement-spoiler" ;
}
str3 = str4 ;
}
tmp4 = str3 ;
} else if ( set . has ( channel . type ) ) {
let str = "text-nsfw" ;
if ( ! isNSFWResult ) {
let str2 = "text" ;
if ( isSpoilerChannelResult ) {
str2 = "text-spoiler" ;
}
str = str2 ;
}
tmp4 = str ;
}
return tmp4 ;
}
} ;
export const previousTextChannelRouteForGuild = function previousTextChannelRouteForGuild ( arg0 ) {
2026-07-23 10:11:24 +00:00
channel = channel . getChannel ( lastSelectedChannelId . getLastSelectedChannelId ( ) ) ;
2026-07-20 16:05:17 +00:00
if ( null != channel ) {
if ( channel . getGuildId ( ) === arg0 ) {
if ( channel . type === ChannelTypes . GUILD_TEXT ) {
let id = channel . id ;
}
return closure_18 . CHANNEL ( arg0 , id ) ;
}
}
2026-07-23 10:11:24 +00:00
defaultChannel = defaultChannel . getDefaultChannel ( arg0 ) ;
2026-07-20 16:05:17 +00:00
id = null ;
if ( null != defaultChannel ) {
id = defaultChannel . id ;
}
} ;
export { getChannelPermalink } ;
export { getChannelThreadPermalink } ;
export const getChannelLinkToCopy = function getChannelLinkToCopy ( channel , channel1 , id2 ) {
let tmp = arg3 ;
const guildId = channel . getGuildId ( ) ;
if ( null != channel1 ) {
if ( obj . canUseMediaPostEmbed ( guildId , channel1 ) ) {
2026-07-23 10:11:24 +00:00
tmp = getChannelThreadPermalink ( guildId , channel1 . id , channel . id , importDefault ( 21 ) . castChannelIdAsMessageId ( channel . id ) ) ;
const obj2 = importDefault ( 21 ) ;
2026-07-20 16:05:17 +00:00
}
return tmp ;
}
if ( null == tmp ) {
tmp = getChannelPermalink ( guildId , channel . id , id2 ) ;
}
} ;
export const getChannelAnalyticsPage = function getChannelAnalyticsPage ( type ) {
if ( null == type ) {
return null ;
} else {
type = type . type ;
if ( ChannelTypes . GUILD_ANNOUNCEMENT !== type ) {
if ( ChannelTypes . GUILD_TEXT !== type ) {
if ( ChannelTypes . GUILD_FORUM !== type ) {
if ( ChannelTypes . GUILD_MEDIA !== type ) {
if ( ChannelTypes . GROUP_DM !== type ) {
if ( ChannelTypes . DM !== type ) {
return null ;
}
}
return constants3 . DM_CHANNEL ;
}
}
}
}
return constants3 . GUILD_CHANNEL ;
}
} ;