2026-07-24 07:16:23 +00:00
// Module ID: 6966
// Function ID: 55725
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-23 10:11:24 +00:00
// Dependencies: [4144, 1352, 1907, 1838, 3758, 4146, 653, 4949, 1212, 4312, 4345, 566, 2]
2026-07-20 16:05:17 +00:00
// Exports: getStreamCTAAriaLabel, getStreamCTAString, getStreamEligibleChannels, useCanWatchStream
2026-07-24 07:16:23 +00:00
// Module 6966 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import { ChannelRecordBase } from "_callSuper" ;
import { GUILD_VOCAL_CHANNELS_KEY } from "_isNativeReflectConstruct" ;
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose" ;
import closure_7 from "_isNativeReflectConstruct" ;
import closure_8 from "_isNativeReflectConstruct" ;
import { Permissions } from "ME" ;
const require = arg1 ;
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 ;
}
2026-07-23 10:11:24 +00:00
function canStreamInChannel ( channel , closure_2 , _isNativeReflectConstruct , arg3 ) {
2026-07-20 16:05:17 +00:00
let flag = arg3 ;
if ( arg3 === undefined ) {
flag = true ;
}
if ( channel . isPrivate ( ) ) {
return true ;
} else {
const guild = closure_2 . getGuild ( channel . getGuildId ( ) ) ;
let prop ;
if ( null != guild ) {
prop = guild . maxStageVideoChannelUsers ;
}
let num2 = 0 ;
if ( null != prop ) {
num2 = prop ;
}
let tmp5 = ! ( channel . isGuildStageVoice ( ) && num2 <= 0 ) ;
if ( tmp5 ) {
if ( flag ) {
2026-07-23 10:11:24 +00:00
flag = ! importDefault ( 4949 ) ( channel , _isNativeReflectConstruct ) ;
2026-07-20 16:05:17 +00:00
}
let tmp8 = ! flag ;
if ( tmp8 ) {
2026-07-23 10:11:24 +00:00
const tmp10 = ! _isNativeReflectConstruct . can ( Permissions . STREAM , channel ) ;
2026-07-20 16:05:17 +00:00
let tmp11 = ! tmp10 ;
if ( ! tmp10 ) {
tmp11 = null != guild && guild . afkChannelId !== channel . id ;
const tmp12 = null != guild && guild . afkChannelId !== channel . id ;
}
tmp8 = tmp11 ;
}
tmp5 = tmp8 ;
}
return tmp5 ;
}
}
function canWatchStream ( basicChannel , closure_21 , closure_16 , closure_18 , closure_12 ) {
if ( null == basicChannel ) {
const items = [ false , obj . NO_PERMISSION ] ;
return items ;
} else {
let isInChannelResult = closure_21 . isInChannel ( basicChannel . id ) ;
let isChannelFullResult = basicChannel instanceof ChannelRecordBase ;
if ( isChannelFullResult ) {
2026-07-23 10:11:24 +00:00
obj = require ( 4312 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
isChannelFullResult = obj . isChannelFull ( basicChannel , closure_21 , closure_16 ) ;
}
2026-07-23 10:11:24 +00:00
let tmp8 = importDefault ( 4949 ) ( basicChannel , closure_18 ) ;
2026-07-20 16:05:17 +00:00
const tmp9 = null != closure_12 . getAwaitingRemoteSessionInfo ( ) || null != closure_12 . getRemoteSessionId ( ) ;
2026-07-23 10:11:24 +00:00
let result = require ( 4345 ) /* shouldAgeVerifyForAgeGate */ . shouldAgeVerifyForAgeGate ( ) ;
2026-07-20 16:05:17 +00:00
if ( result ) {
2026-07-23 10:11:24 +00:00
result = require ( 4345 ) /* shouldAgeVerifyForAgeGate */ . shouldShowAgeGateForChannelId ( basicChannel . id ) ;
const obj3 = require ( 4345 ) /* shouldAgeVerifyForAgeGate */ ;
2026-07-20 16:05:17 +00:00
}
if ( tmp9 ) {
let CHANNEL_FULL = obj . REMOTE_MODE ;
} else if ( result ) {
CHANNEL_FULL = obj . AGE_RESTRICTED ;
} else {
if ( ! tmp8 ) {
if ( ! isInChannelResult ) {
CHANNEL_FULL = obj . NO_PERMISSION ;
}
}
let tmp16 = isChannelFullResult ;
if ( isChannelFullResult ) {
tmp16 = ! isInChannelResult ;
}
if ( tmp16 ) {
CHANNEL_FULL = obj . CHANNEL_FULL ;
}
}
let tmp20 = ! tmp9 ;
if ( ! tmp9 ) {
tmp20 = ! result ;
}
if ( tmp20 ) {
if ( ! isInChannelResult ) {
if ( tmp8 ) {
tmp8 = ! isChannelFullResult ;
}
isInChannelResult = tmp8 ;
}
tmp20 = isInChannelResult ;
}
const items1 = [ tmp20 , CHANNEL_FULL ] ;
return items1 ;
}
}
2026-07-23 10:11:24 +00:00
let obj = { REMOTE_MODE : 0 , [ 0 ] : "REMOTE_MODE" , CHANNEL_FULL : 1 , [ 1 ] : "CHANNEL_FULL" , NO_PERMISSION : 2 , [ 2 ] : "NO_PERMISSION" , AGE_RESTRICTED : 3 , [ 3 ] : "AGE_RESTRICTED" } ;
let result = require ( "_isNativeReflectConstruct" ) . fileFinishedImporting ( "modules/go_live/utils/StreamPermissionUtils.tsx" ) ;
2026-07-20 16:05:17 +00:00
export { canStreamInChannel } ;
export const getStreamCTAString = function getStreamCTAString ( arg0 ) {
if ( obj . REMOTE_MODE === arg0 ) {
2026-07-23 10:11:24 +00:00
const intl5 = require ( 1212 ) /* getSystemLocale */ . intl ;
return intl5 . string ( require ( 1212 ) /* getSystemLocale */ . t [ "1i3tSY" ] ) ;
2026-07-20 16:05:17 +00:00
} else if ( obj . CHANNEL_FULL === arg0 ) {
2026-07-23 10:11:24 +00:00
const intl4 = require ( 1212 ) /* getSystemLocale */ . intl ;
return intl4 . string ( require ( 1212 ) /* getSystemLocale */ . t . elyVbv ) ;
2026-07-20 16:05:17 +00:00
} else if ( obj . NO_PERMISSION === arg0 ) {
2026-07-23 10:11:24 +00:00
const intl3 = require ( 1212 ) /* getSystemLocale */ . intl ;
return intl3 . string ( require ( 1212 ) /* getSystemLocale */ . t . pgUTZC ) ;
2026-07-20 16:05:17 +00:00
} else if ( obj . AGE_RESTRICTED === arg0 ) {
2026-07-23 10:11:24 +00:00
const intl2 = require ( 1212 ) /* getSystemLocale */ . intl ;
return intl2 . string ( require ( 1212 ) /* getSystemLocale */ . t . b5FqhF ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
const intl = require ( 1212 ) /* getSystemLocale */ . intl ;
return intl . string ( require ( 1212 ) /* getSystemLocale */ . t [ "7Xq/nV" ] ) ;
2026-07-20 16:05:17 +00:00
}
} ;
export const getStreamCTAAriaLabel = function getStreamCTAAriaLabel ( arg0 ) {
if ( obj . REMOTE_MODE === arg0 ) {
2026-07-23 10:11:24 +00:00
const intl7 = require ( 1212 ) /* getSystemLocale */ . intl ;
const intl8 = require ( 1212 ) /* getSystemLocale */ . intl ;
2026-07-20 16:05:17 +00:00
const _HermesInternal4 = HermesInternal ;
2026-07-23 10:11:24 +00:00
return "" + intl7 . string ( require ( 1212 ) /* getSystemLocale */ . t [ "7Xq/nV" ] ) + ": " + intl8 . string ( require ( 1212 ) /* getSystemLocale */ . t [ "1i3tSY" ] ) ;
2026-07-20 16:05:17 +00:00
} else if ( obj . CHANNEL_FULL === arg0 ) {
2026-07-23 10:11:24 +00:00
const intl5 = require ( 1212 ) /* getSystemLocale */ . intl ;
const intl6 = require ( 1212 ) /* getSystemLocale */ . intl ;
2026-07-20 16:05:17 +00:00
const _HermesInternal3 = HermesInternal ;
2026-07-23 10:11:24 +00:00
return "" + intl5 . string ( require ( 1212 ) /* getSystemLocale */ . t [ "7Xq/nV" ] ) + ": " + intl6 . string ( require ( 1212 ) /* getSystemLocale */ . t . elyVbv ) ;
2026-07-20 16:05:17 +00:00
} else if ( obj . NO_PERMISSION === arg0 ) {
2026-07-23 10:11:24 +00:00
const intl3 = require ( 1212 ) /* getSystemLocale */ . intl ;
const intl4 = require ( 1212 ) /* getSystemLocale */ . intl ;
2026-07-20 16:05:17 +00:00
const _HermesInternal2 = HermesInternal ;
2026-07-23 10:11:24 +00:00
return "" + intl3 . string ( require ( 1212 ) /* getSystemLocale */ . t [ "7Xq/nV" ] ) + ": " + intl4 . string ( require ( 1212 ) /* getSystemLocale */ . t . pgUTZC ) ;
2026-07-20 16:05:17 +00:00
} else if ( obj . AGE_RESTRICTED === arg0 ) {
2026-07-23 10:11:24 +00:00
const intl = require ( 1212 ) /* getSystemLocale */ . intl ;
const intl2 = require ( 1212 ) /* getSystemLocale */ . intl ;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal ;
2026-07-23 10:11:24 +00:00
return "" + intl . string ( require ( 1212 ) /* getSystemLocale */ . t [ "7Xq/nV" ] ) + ": " + intl2 . string ( require ( 1212 ) /* getSystemLocale */ . t . b5FqhF ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
const intl9 = require ( 1212 ) /* getSystemLocale */ . intl ;
const intl10 = require ( 1212 ) /* getSystemLocale */ . intl ;
2026-07-20 16:05:17 +00:00
const _HermesInternal5 = HermesInternal ;
2026-07-23 10:11:24 +00:00
return "" + intl9 . string ( require ( 1212 ) /* getSystemLocale */ . t [ "7Xq/nV" ] ) + ": " + intl10 . string ( require ( 1212 ) /* getSystemLocale */ . t [ "9C444m" ] ) ;
2026-07-20 16:05:17 +00:00
}
} ;
export const StreamUnavailableReasons = obj ;
export { canWatchStream } ;
export const useCanWatchStream = function useCanWatchStream ( stateFromStores ) {
2026-07-23 10:11:24 +00:00
const _require = stateFromStores ;
const items = [ closure_8 , _createForOfIteratorHelperLoose , closure_7 , _isNativeReflectConstruct ] ;
return _require ( 566 ) . useStateFromStoresArray ( items , ( ) = > outer1_14 ( closure_0 , outer1_8 , outer1_6 , outer1_7 , outer1_3 ) ) ;
2026-07-20 16:05:17 +00:00
} ;
2026-07-23 10:11:24 +00:00
export const getStreamEligibleChannels = function getStreamEligibleChannels ( arg0 , closure_2 , _isNativeReflectConstruct ) {
2026-07-20 16:05:17 +00:00
let iter2 ;
const items = [ ] ;
2026-07-23 10:11:24 +00:00
const tmp = _createForOfIteratorHelperLoose ( arg0 [ GUILD_VOCAL_CHANNELS_KEY ] ) ;
2026-07-20 16:05:17 +00:00
let iter = tmp ( ) ;
if ( ! iter . done ) {
do {
let channel = iter . value . channel ;
2026-07-23 10:11:24 +00:00
let tmp2 = canStreamInChannel ;
if ( canStreamInChannel ( channel , closure_2 , _isNativeReflectConstruct ) ) {
2026-07-20 16:05:17 +00:00
let arr = items . push ( channel ) ;
}
iter2 = tmp ( ) ;
iter = iter2 ;
} while ( ! iter2 . done ) ;
}
return items ;
} ;