/* Metro module 12115; source: modules/voice_calls/native/CallStateHooks.tsx; dependencies: [4606, 1226, 4258, 4294, 661, 4299, 566, 9325, 2] */ function _fun93007(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#93007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12301:6, offset: 0x020a2a7e, size: 318 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const channelRTCStore = importDefault(4606) /* metro dependency 4606: ChannelRTCStore */; const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */; const callStore = importDefault(4258) /* metro dependency 4258: CallStore */; const rtcConnectionStore = importDefault(4294) /* metro dependency 4294: RTCConnectionStore */; const constantsModule = require(661) /* metro dependency 661: Constants */; const env0_7 = constantsModule.EMPTY_STRING_SNOWFLAKE_ID; const env0_8 = constantsModule.RTCConnectionStates; const env0_9 = (require(4299) /* metro dependency 4299: CallConstants */).ParticipantTypes; copyDataProperties({}, {initialized: false, callId: undefined}, undefined); (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/voice_calls/native/CallStateHooks.tsx'); exports.default = _default_93008; exports.CallStates = {DISCONNECTED: 'disconneted', DISCONNECTING: 'disconnecting', CONNECTING: 'connecting', RINGING: 'ringing', CONNECTED: 'connected'}; } function _default_93008() { // fn#93008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12301:433, offset: 0x020a2bbc, size: 452 bytes, params: 1, frame: 28 const value = a0; const value2 = a1; const value3 = a2; const r10 = value !== undefined ? value : EMPTY_STRING_SNOWFLAKE_ID; const r6 = value2 !== undefined ? value2 : false; const r7 = value3 !== undefined ? value3 : false; const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([CallStore], _fun93009, [r10, AuthenticationStore.getId()]); const value7 = ChannelRTCStore.getParticipants(r10).filter(_fun93011); const value8 = (importDefault(9325) /* metro dependency 9325: useVoiceStateForRemoteSession */)(); const fluxModule = require(566) /* metro dependency 566: flux */; const useStateFromStores = fluxModule.useStateFromStores; const getRTCConnectionId = RTCConnectionStore.getRTCConnectionId; const value10 = fluxModule.useStateFromStores([RTCConnectionStore], _fun93012, [Reflect.apply(useStateFromStores, fluxModule, [[RTCConnectionStore], getRTCConnectionId, []]), value8, r10]); const binding = env0_10; let initialized = binding.initialized; binding.initialized = initialized || r7; const CONNECTING = env0_11.CONNECTING; initialized = env0_10.initialized; return {state: r6 ? env0_11.DISCONNECTING : initialized && value10 === RTCConnectionStates.DISCONNECTED ? env0_11.DISCONNECTED : value5.length > 0 && value7.length === value5.length ? env0_11.RINGING : value10 !== RTCConnectionStates.RTC_CONNECTED ? CONNECTING : env0_11.CONNECTED, initialized: initialized}; } function _fun93009() { // fn#93009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12301:506, offset: 0x020a2d80, size: 94 bytes, params: 1, frame: 13 var environment; const value = environment.__proto__; const call = CallStore.getCall(env0_0); const r0 = call != null ? call.ringing.filter(_fun93010) : []; const binding = env1_10; binding.initialized = binding.initialized || r0.length > 0; return r0; } function _fun93011(a0) { // fn#93011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12301:661, offset: 0x020a2dee, size: 51 bytes, params: 2, frame: 3 const type = a0.type; const value = environment.__proto__; const ACTIVITY = ParticipantTypes.ACTIVITY; return type !== ACTIVITY && a0.user.id !== env0_1; } function _fun93012() { // fn#93012, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12301:805, offset: 0x020a2e21, size: 191 bytes, params: 1, frame: 13 var value; if (env0_2?.channelId === env0_0) { value = environment.__proto__; env1_10.initialized = true; return RTCConnectionStates.RTC_CONNECTED; } if (!(env0_3 != null && env1_10.callId === env0_3)) { env1_10.initialized = false; } const binding = env1_10; binding.callId = env0_3; value = RTCConnectionStore.getState(); binding.initialized = binding.initialized || value !== RTCConnectionStates.DISCONNECTED && value !== RTCConnectionStates.RTC_DISCONNECTED; return value; }