2026-07-21 06:55:02 +00:00
// Module ID: 16417
// Function ID: 126776
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
// Dependencies: []
2026-07-21 06:55:02 +00:00
// Module 16417 (_createForOfIteratorHelperLoose)
2026-07-20 16:05:17 +00:00
let GO_LIVE_NOTIFY_FRIENDS_MIN_MEMBER_COUNT ;
let STREAM_NOTIFY_GUILD_MAX_SIZE ;
function _createForOfIteratorHelperLoose ( @ @iterator ) {
let arg1 = Symbol_iterator ;
@ @iterator = "undefined" !== typeof Symbol ;
if ( Symbol_iterator ) {
const _Symbol = Symbol ;
@ @iterator = Symbol_iterator [ Symbol . iterator ] ;
}
if ( ! Symbol_iterator ) {
@ @iterator = Symbol_iterator [ Symbol . iterator ] ;
}
if ( Symbol_iterator ) {
const iter = Symbol_iterator . call ( Symbol_iterator ) ;
const next = iter . next ;
return next . bind ( iter ) ;
} else {
const _Array = Array ;
let tmp = Symbol_iterator ;
if ( ! Array . isArray ( Symbol_iterator ) ) {
let tmp2 ;
if ( Symbol_iterator ) {
if ( "string" === typeof Symbol_iterator ) {
tmp2 = _arrayLikeToArray ( Symbol_iterator , undefined ) ;
} else {
const toString = { } . toString ;
const substr = toString . call ( Symbol_iterator ) . slice ( 8 , - 1 ) ;
let name = substr ;
if ( tmp3 ) {
name = Symbol_iterator . constructor . name ;
}
if ( "Map" !== name ) {
if ( "Set" !== name ) {
if ( "Arguments" === name ) {
let arr = _arrayLikeToArray ( Symbol_iterator , undefined ) ;
} else {
const obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ ;
}
}
tmp2 = arr ;
}
const _Array2 = Array ;
arr = Array . from ( Symbol_iterator ) ;
const callResult = toString . call ( Symbol_iterator ) ;
const tmp3 = "Object" === substr && Symbol_iterator . constructor ;
}
}
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 ) {
arg1 = tmp ;
}
let closure_1 = 0 ;
return ( ) = > {
if ( closure_1 >= tmp . length ) {
let obj = { done : true } ;
} else {
obj = { done : false } ;
closure_1 = tmp3 + 1 ;
obj . value = tmp [ + closure_1 ] ;
}
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 _isNativeReflectConstruct() {
let closure_0 = ! valueOf . call ( Reflect . construct ( Boolean , [ ] , ( ) = > {
} ) ) ;
function _isNativeReflectConstruct() {
return closure_0 ;
}
const result = _isNativeReflectConstruct ( ) ;
}
2026-07-21 06:55:02 +00:00
function pruneShownFullStreamModals() {
const item = set . forEach ( ( arg0 ) = > {
if ( ! streamMarkedFull . isStreamMarkedFull ( arg0 ) ) {
set . delete ( arg0 ) ;
}
} ) ;
}
2026-07-20 16:05:17 +00:00
function clearSpectatorReconnectionTimer ( arg0 ) {
if ( null != closure_17 [ arg0 ] ) {
obj . stop ( ) ;
}
delete r0 [ r1 ] ;
}
function clearConnectTimeout ( arg0 ) {
if ( null != closure_18 [ arg0 ] ) {
obj . stop ( ) ;
}
delete r0 [ r1 ] ;
}
function maybeAutowatchStream ( channelId ) {
if ( voiceChannelId . getVoiceChannelId ( ) !== channelId ) {
return false ;
} else {
const channel = channel . getChannel ( channelId ) ;
if ( null == channel ) {
return false ;
} else {
if ( ! channel . isDM ( ) ) {
if ( ! channel . isGuildStageVoice ( ) ) {
return false ;
}
}
if ( null != authStore . getActiveStreamForUser ( arg1 , channel . getGuildId ( ) ) ) {
return false ;
} else {
const streamForUser = authStore . getStreamForUser ( arg1 , channel . getGuildId ( ) ) ;
if ( null == streamForUser ) {
return false ;
} else {
let obj = arg1 ( dependencyMap [ 18 ] ) ;
const encodeStreamKeyResult = obj . encodeStreamKey ( streamForUser ) ;
2026-07-21 06:55:02 +00:00
let tmp6 = encodeStreamKeyResult !== closure_22 ;
if ( tmp6 ) {
let flag2 = ! authStore . isStreamMarkedFull ( encodeStreamKeyResult ) ;
if ( flag2 ) {
closure_22 = encodeStreamKeyResult ;
obj = { noFocus : true } ;
arg1 ( dependencyMap [ 16 ] ) . watchStream ( streamForUser , obj ) ;
flag2 = true ;
const obj2 = arg1 ( dependencyMap [ 16 ] ) ;
}
tmp6 = flag2 ;
2026-07-20 16:05:17 +00:00
}
2026-07-21 06:55:02 +00:00
return tmp6 ;
2026-07-20 16:05:17 +00:00
}
}
}
}
}
function updateRegion ( first , preferredRegion ) {
if ( null == preferredRegion ) {
preferredRegion = store . getPreferredRegion ( ) ;
}
let tmp3 = null != preferredRegion ;
if ( tmp3 ) {
tmp3 = preferredRegion !== store . getRegion ( store2 . getHostname ( first ) ) ;
}
if ( tmp3 ) {
preferredRegion ( dependencyMap [ 16 ] ) . changeStreamRegion ( first , preferredRegion ) ;
const obj = preferredRegion ( dependencyMap [ 16 ] ) ;
}
}
function maybeStartConnectTimeout ( arg0 , arg1 ) {
arg1 = arg0 ;
const allActiveStreamKeys = store2 . getAllActiveStreamKeys ( ) ;
if ( ! allActiveStreamKeys . includes ( arg0 ) ) {
let timeout = closure_18 [ arg0 ] ;
if ( null == timeout ) {
const Timeout = arg1 ( dependencyMap [ 19 ] ) . Timeout ;
const prototype = Timeout . prototype ;
timeout = new Timeout ( ) ;
}
closure_18 [ arg0 ] = timeout ;
timeout . start ( arg1 ? closure_21 : closure_20 , ( ) = > {
let obj = callback ( closure_2 [ 20 ] ) ;
obj = { type : "STREAM_TIMED_OUT" , streamKey : arg0 } ;
obj . dispatch ( obj ) ;
} ) ;
}
}
let closure_3 = importDefault ( dependencyMap [ 0 ] ) ;
let closure_4 = importDefault ( dependencyMap [ 1 ] ) ;
let closure_5 = importDefault ( dependencyMap [ 2 ] ) ;
let closure_6 = importDefault ( dependencyMap [ 3 ] ) ;
let closure_7 = importDefault ( dependencyMap [ 4 ] ) ;
let closure_8 = importDefault ( dependencyMap [ 5 ] ) ;
let closure_9 = importDefault ( dependencyMap [ 6 ] ) ;
let closure_10 = importDefault ( dependencyMap [ 7 ] ) ;
let closure_11 = importDefault ( dependencyMap [ 8 ] ) ;
let closure_12 = importDefault ( dependencyMap [ 9 ] ) ;
let closure_13 = importDefault ( dependencyMap [ 10 ] ) ;
let closure_14 = importDefault ( dependencyMap [ 11 ] ) ;
importDefault ( dependencyMap [ 12 ] ) ;
( { GO_LIVE_NOTIFY_FRIENDS_MIN_MEMBER_COUNT , STREAM_NOTIFY_GUILD_MAX_SIZE } = arg1 ( dependencyMap [ 13 ] ) ) ;
const tmp3 = arg1 ( dependencyMap [ 13 ] ) ;
( { ApplicationStreamDeleteReasons : closure_15 , ApplicationStreamStates : closure_16 } = arg1 ( dependencyMap [ 14 ] ) ) ;
const tmp4 = arg1 ( dependencyMap [ 14 ] ) ;
arg1 ( dependencyMap [ 15 ] ) . debounce ( arg1 ( dependencyMap [ 16 ] ) . notifyStreamStart , 1000 ) ;
let closure_17 = { } ;
let closure_18 = { } ;
let closure_19 = 3 * importDefault ( dependencyMap [ 17 ] ) . Millis . MINUTE ;
let closure_20 = 5 * importDefault ( dependencyMap [ 17 ] ) . Millis . SECOND ;
let closure_21 = 12 * importDefault ( dependencyMap [ 17 ] ) . Millis . SECOND ;
let closure_22 = null ;
2026-07-21 06:55:02 +00:00
const set = new Set ( ) ;
2026-07-20 16:05:17 +00:00
const obj = arg1 ( dependencyMap [ 15 ] ) ;
2026-07-21 06:55:02 +00:00
const tmp7 = ( arg0 ) = > {
2026-07-20 16:05:17 +00:00
class BaseApplicationStreamingManager {
constructor ( arg0 ) {
self = this ;
items = [ . . . arguments ] ;
tmp = closure_4 ( this , BaseApplicationStreamingManager ) ;
items1 = [ . . . items ] ;
obj = closure_6 ( BaseApplicationStreamingManager ) ;
tmp2 = closure_5 ;
2026-07-21 06:55:02 +00:00
if ( closure_26 ( ) ) {
2026-07-20 16:05:17 +00:00
tmp4 = globalThis ;
_Reflect = Reflect ;
tmp5 = closure_6 ;
constructResult = Reflect . construct ( obj , items1 , closure_6 ( self ) . constructor ) ;
} else {
constructResult = obj . apply ( self , items1 ) ;
}
tmp2Result = tmp2 ( self , constructResult ) ;
BaseApplicationStreamingManager = tmp2Result ;
tmp2Result . handleStreamWatch = ( streamKey ) = > {
streamKey = streamKey . streamKey ;
const channel = store . getChannel ( streamKey ( closure_2 [ 18 ] ) . decodeStreamKey ( streamKey ) . channelId ) ;
let isGuildStageVoiceResult ;
if ( null != channel ) {
isGuildStageVoiceResult = channel . isGuildStageVoice ( ) ;
}
2026-07-21 06:55:02 +00:00
closure_32 ( streamKey , isGuildStageVoiceResult ) ;
callback3 ( streamKey ) ;
2026-07-20 16:05:17 +00:00
if ( ! streamKey . allowMultiple ) {
const allActiveStreams = authStore . getAllActiveStreams ( ) ;
const item = allActiveStreams . forEach ( ( ownerId ) = > {
const encodeStreamKeyResult = streamKey ( closure_2 [ 18 ] ) . encodeStreamKey ( ownerId ) ;
let tmp2 = ownerId . ownerId !== id . getId ( ) ;
if ( tmp2 ) {
tmp2 = encodeStreamKeyResult !== streamKey ;
}
if ( tmp2 ) {
streamKey ( closure_2 [ 16 ] ) . stopStream ( encodeStreamKeyResult , false ) ;
const obj2 = streamKey ( closure_2 [ 16 ] ) ;
}
} ) ;
}
} ;
tmp2Result . handleStreamStart = ( channelId ) = > {
let guildId ;
let streamType ;
channelId = channelId . channelId ;
( { streamType , guildId } = channelId ) ;
const channel = store . getChannel ( channelId ) ;
const obj2 = tmp2Result ( closure_2 [ 18 ] ) ;
2026-07-21 06:55:02 +00:00
const tmp = closure_32 ;
2026-07-20 16:05:17 +00:00
let isGuildStageVoiceResult ;
const obj = { streamType , guildId , channelId , ownerId : id.getId ( ) } ;
if ( null != channel ) {
isGuildStageVoiceResult = channel . isGuildStageVoice ( ) ;
}
tmp ( obj2 . encodeStreamKey ( { streamType , guildId , channelId , ownerId : id.getId ( ) } ) , isGuildStageVoiceResult ) ;
const result = tmp2Result . platformHandleStreamStart ( channelId ) ;
} ;
tmp2Result . handleStreamCreate = ( streamKey ) = > {
streamKey = streamKey . streamKey ;
2026-07-21 06:55:02 +00:00
callback4 ( streamKey ) ;
callback2 ( ) ;
2026-07-20 16:05:17 +00:00
const obj = tmp2Result ( closure_2 [ 18 ] ) ;
const memberCount = memberCount . getMemberCount ( tmp2Result ( closure_2 [ 18 ] ) . decodeStreamKey ( streamKey ) . guildId ) ;
} ;
tmp2Result . handleStreamUpdate = ( streamKey ) = > {
2026-07-21 06:55:02 +00:00
callback4 ( streamKey . streamKey ) ;
callback2 ( ) ;
2026-07-20 16:05:17 +00:00
} ;
tmp2Result . handleStreamDelete = ( streamKey ) = > {
streamKey = streamKey . streamKey ;
2026-07-21 06:55:02 +00:00
callback4 ( streamKey ) ;
2026-07-20 16:05:17 +00:00
if ( streamKey . reason === constants . STREAM_FULL ) {
let obj = tmp2Result ( closure_2 [ 21 ] ) ;
obj = { type : tmp2Result ( closure_2 [ 21 ] ) . AVError . STREAM_FULL } ;
const merged = Object . assign ( tmp2Result ( closure_2 [ 22 ] ) . getStreamErrorContext ( streamKey ) ) ;
obj . reportAVError ( obj ) ;
2026-07-21 06:55:02 +00:00
if ( ! set . has ( streamKey ) ) {
set . add ( streamKey ) ;
const result = tmp2Result . platformShowStreamFull ( ) ;
}
2026-07-20 16:05:17 +00:00
const obj3 = tmp2Result ( closure_2 [ 22 ] ) ;
}
} ;
tmp2Result . handleStreamClose = ( streamKey ) = > {
streamKey = streamKey . streamKey ;
callback3 ( streamKey ) ;
2026-07-21 06:55:02 +00:00
callback4 ( streamKey ) ;
2026-07-20 16:05:17 +00:00
} ;
tmp2Result . handleVoiceChannelSelect = ( channelId ) = > {
channelId = channelId . channelId ;
if ( null != channelId ) {
let closure_22 = null ;
2026-07-21 06:55:02 +00:00
callback2 ( ) ;
2026-07-20 16:05:17 +00:00
const allApplicationStreamsForChannel = authStore . getAllApplicationStreamsForChannel ( channelId ) ;
2026-07-21 06:55:02 +00:00
const found = allApplicationStreamsForChannel . find ( ( ownerId ) = > {
let tmp = ownerId . ownerId !== id . getId ( ) ;
if ( tmp ) {
tmp = ! streamMarkedFull . isStreamMarkedFull ( callback ( closure_2 [ 18 ] ) . encodeStreamKey ( ownerId ) ) ;
const obj = callback ( closure_2 [ 18 ] ) ;
}
return tmp ;
} ) ;
if ( null != found ) {
callback5 ( channelId , found . ownerId ) ;
2026-07-20 16:05:17 +00:00
}
}
} ;
tmp2Result . handleVoiceStateUpdates = ( voiceStates ) = > {
voiceStates = voiceStates . voiceStates ;
const item = voiceStates . forEach ( ( arg0 ) = > {
let channelId ;
let guildId ;
let selfStream ;
let userId ;
( { userId , channelId , guildId , selfStream } = arg0 ) ;
const result = encodeStreamKeyResult . platformHandleVoiceStateUpdate ( arg0 ) ;
if ( userId !== id . getId ( ) ) {
2026-07-21 06:55:02 +00:00
let tmp3 = ! selfStream ;
if ( ! tmp3 ) {
tmp3 = null == channelId ;
}
if ( tmp3 ) {
tmp3 = size . size > 0 ;
}
if ( tmp3 ) {
callback ( ) ;
}
2026-07-20 16:05:17 +00:00
if ( null != channelId ) {
const activeStreamForUser = authStore . getActiveStreamForUser ( userId , guildId ) ;
if ( null != activeStreamForUser ) {
if ( activeStreamForUser . channelId === channelId ) {
if ( ! selfStream ) {
if ( activeStreamForUser . state !== constants . ENDED ) {
const encodeStreamKeyResult = encodeStreamKeyResult ( closure_2 [ 18 ] ) . encodeStreamKey ( activeStreamForUser ) ;
let timeout = closure_17 [ encodeStreamKeyResult ] ;
if ( null == timeout ) {
const Timeout = encodeStreamKeyResult ( closure_2 [ 19 ] ) . Timeout ;
const prototype = Timeout . prototype ;
timeout = new Timeout ( ) ;
}
timeout . start ( closure_19 , ( ) = > encodeStreamKeyResult ( closure_2 [ 16 ] ) . closeStream ( encodeStreamKeyResult , false ) ) ;
closure_17 [ encodeStreamKeyResult ] = timeout ;
const obj4 = encodeStreamKeyResult ( closure_2 [ 18 ] ) ;
}
}
if ( selfStream ) {
if ( activeStreamForUser . state === constants . ENDED ) {
2026-07-21 06:55:02 +00:00
callback2 ( encodeStreamKeyResult ( closure_2 [ 18 ] ) . encodeStreamKey ( activeStreamForUser ) ) ;
2026-07-20 16:05:17 +00:00
const streamForUser = authStore . getStreamForUser ( userId , guildId ) ;
if ( null != streamForUser ) {
2026-07-21 06:55:02 +00:00
if ( ! authStore . isStreamMarkedFull ( obj2 . encodeStreamKey ( streamForUser ) ) ) {
encodeStreamKeyResult ( closure_2 [ 16 ] ) . watchStream ( streamForUser ) ;
const obj3 = encodeStreamKeyResult ( closure_2 [ 16 ] ) ;
}
const obj2 = encodeStreamKeyResult ( closure_2 [ 18 ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-21 06:55:02 +00:00
const obj5 = encodeStreamKeyResult ( closure_2 [ 18 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
}
}
}
}
} ) ;
} ;
tmp2Result . handleCallUpdate = ( arg0 ) = > {
let channelId ;
let region ;
( { channelId , region } = arg0 ) ;
const currentUserActiveStream = authStore . getCurrentUserActiveStream ( ) ;
channelId = undefined ;
if ( null != currentUserActiveStream ) {
channelId = currentUserActiveStream . channelId ;
}
if ( channelId === channelId ) {
2026-07-21 06:55:02 +00:00
callback6 ( tmp2Result ( closure_2 [ 18 ] ) . encodeStreamKey ( currentUserActiveStream ) , region ) ;
2026-07-20 16:05:17 +00:00
const obj = tmp2Result ( closure_2 [ 18 ] ) ;
}
} ;
tmp2Result . handleChannelUpdates = ( channels ) = > {
let iter2 ;
const currentUserActiveStream = authStore . getCurrentUserActiveStream ( ) ;
if ( null != currentUserActiveStream ) {
const tmp3 = callback ( channels . channels ) ;
let iter = tmp3 ( ) ;
if ( ! iter . done ) {
do {
let value = iter . value ;
if ( currentUserActiveStream . channelId === value . id ) {
2026-07-21 06:55:02 +00:00
let tmp4 = closure_31 ;
2026-07-20 16:05:17 +00:00
let tmp5 = closure_0 ;
let tmp6 = closure_2 ;
let obj = closure_0 ( closure_2 [ 18 ] ) ;
2026-07-21 06:55:02 +00:00
let tmp7 = closure_31 ( obj . encodeStreamKey ( currentUserActiveStream ) , value . rtcRegion ) ;
2026-07-20 16:05:17 +00:00
}
iter2 = tmp3 ( ) ;
iter = iter2 ;
} while ( ! iter2 . done ) ;
}
}
} ;
2026-07-21 06:55:02 +00:00
tmp2Result . handleSessionReset = ( ) = > {
set . clear ( ) ;
} ;
tmp2Result . actions = { STREAM_WATCH : tmp2Result.handleStreamWatch , STREAM_START : tmp2Result.handleStreamStart , STREAM_CREATE : tmp2Result.handleStreamCreate , STREAM_UPDATE : tmp2Result.handleStreamUpdate , STREAM_DELETE : tmp2Result.handleStreamDelete , STREAM_CLOSE : tmp2Result.handleStreamClose , CALL_UPDATE : tmp2Result.handleCallUpdate , CHANNEL_UPDATES : tmp2Result.handleChannelUpdates , VOICE_CHANNEL_SELECT : tmp2Result.handleVoiceChannelSelect , VOICE_STATE_UPDATES : tmp2Result.handleVoiceStateUpdates , CONNECTION_CLOSED : tmp2Result.handleSessionReset , LOGOUT : tmp2Result.handleSessionReset } ;
2026-07-20 16:05:17 +00:00
return tmp2Result ;
}
}
const arg1 = BaseApplicationStreamingManager ;
callback2 ( BaseApplicationStreamingManager , arg0 ) ;
return callback ( BaseApplicationStreamingManager ) ;
} ( importDefault ( dependencyMap [ 23 ] ) ) ;
const result = arg1 ( dependencyMap [ 24 ] ) . fileFinishedImporting ( "modules/go_live/ApplicationStreamingManager.tsx" ) ;
2026-07-21 06:55:02 +00:00
export default tmp7 ;