/* Metro module 15662; source: modules/app_analytics/AppAnalyticsManager.tsx; dependencies: [6, 7, 15, 17, 18, 4266, 4259, 4294, 6876, 4607, 4300, 661, 672, 4041, 4863, 15128, 4483, 4860, 2] */ import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */ import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */ import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */ import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */ import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */ import Durations from '../../utils/Durations.tsx'; /* Metro dependency 672 */ import MediaEngineStore from '../../stores/MediaEngineStore.tsx'; /* Metro dependency 4259 */ import RunningGameStoreNative from '../game_detection/RunningGameStore.native.tsx'; /* Metro dependency 4266 */ import RTCConnectionStore from '../../stores/RTCConnectionStore.tsx'; /* Metro dependency 4294 */ import SortedVoiceStateStore from '../../stores/views/SortedVoiceStateStore.tsx'; /* Metro dependency 4300 */ import SpeakingStore from '../../stores/SpeakingStore.tsx'; /* Metro dependency 4607 */ import SelfPresenceStore from '../../stores/SelfPresenceStore.tsx'; /* Metro dependency 6876 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */ function _fun120065(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#120065, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15870:6, offset: 0x0251fe22, size: 390 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ConstantsModule; const env0_14 = value.AnalyticEvents; const env0_15 = value.ActivityTypes; const Millis = (Durations).Millis; const MINUTE = Millis.MINUTE; const env0_16 = 1 * MINUTE; value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */; value = _fun120069(value); value = new value(); (FileImportTrackerModule).fileFinishedImporting('modules/app_analytics/AppAnalyticsManager.tsx'); exports.default = value; function _isNativeReflectConstruct_120066() { // fn#120066, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15870:257, offset: 0x0251ffa8, size: 98 bytes, params: 1, frame: 18 var Boolean; var prototype; var valueOf; var call; var Reflect; var construct; var closure; var value; var error; try { Boolean = global.Boolean; prototype = Boolean.prototype; valueOf = prototype.valueOf; call = valueOf.call; Reflect = global.Reflect; construct = Reflect.construct; Boolean = global.Boolean; closure = function() { }; value = Reflect.apply(construct, Reflect, [Boolean, [], closure]); value = Reflect.apply(call, valueOf, [value]); var result = !value; } catch (error) { } return (_isNativeReflectConstruct_120066_isNativeReflectConstruct = function() { return !!result; })(); } function _fun120069(a0) { // fn#120069, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15870:487, offset: 0x0252000a, size: 197 bytes, params: 2, frame: 16 const AppAnalyticsManager2 = AppAnalyticsManager; Inherits(AppAnalyticsManager2, a0); return CreateClass(AppAnalyticsManager2, [{key: '_initialize', value: function() { var env0_0 = this; var Map = global.Map; var value2 = new Map(); value2 = value2.set(SpeakingStore, _fun120075); this.stores = value2.set(RTCConnectionStore, _fun120076); this._reset(); }}, {key: '_reset', value: function() { this._currentUserSpeaking = false; this._anyoneElseSpeaking = false; if (this._reportInterval != null) { this._reportInterval.stop(); this._reportInterval = null; } }}, {key: '_trackStartSpeaking', value: value_120078}, {key: '_trackStartListening', value: value_120079}, {key: '_terminate', value: function() { this._reset(); SpeakingStore.removeChangeListener(this._handleSpeakingStoreChanged); RTCConnectionStore.removeChangeListener(this._handleRTCConnectionStoreChanged); }}, {key: 'getGameMetadata', value: value_120081}]); function AppAnalyticsManager(a0) { // fn#120070, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15870:499, offset: 0x025200cf, size: 172 bytes, params: 2, frame: 20 var r0; var Reflect; let value = copyRestArgs(0, undefined); let binding = env1_3; binding(this, AppAnalyticsManager); const items2 = []; arraySpread(items2, value, 0, items2); value = env1_6(AppAnalyticsManager); binding = env1_5; if (_isNativeReflectConstruct_120066()) { Reflect = global.Reflect; value = Reflect.construct(value, items2, env1_6(this).constructor); r0 = value; } else { value = value.apply(this, items2); r0 = value; } value = binding(this, r0); value._currentUserSpeaking = false; value._anyoneElseSpeaking = false; value._handleRTCConnectionStoreChanged = _handleRTCConnectionStoreChanged; value._handleSpeakingStoreChanged = _handleSpeakingStoreChanged; return value; function _handleRTCConnectionStoreChanged() { // fn#120071, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15870:828, owner: AppAnalyticsManager._handleRTCConnectionStoreChanged, offset: 0x0252017b, size: 175 bytes, params: 1, frame: 14 var binding; var _reportInterval; var Interval; var value4; var interval; var start; const channelId = RTCConnectionStore.getChannelId(); if (env0_0._voiceChannelId !== channelId) { env0_0._voiceChannelId = channelId; if (channelId != null) { _reportInterval = env0_0._reportInterval; if (_reportInterval == null) { binding = env0_0; Interval = (require(4041) /* metro dependency 4041: Timers */).Interval; value4 = Object.create(Interval.prototype, {constructor: {value: Interval}}); interval = new Interval(); binding._reportInterval = interval instanceof Object ? interval : value4; _reportInterval = binding._reportInterval; start = _reportInterval.start; binding = env2_16; Reflect.apply(start, _reportInterval, [binding, _fun120072]); } } else { env0_0._reset(); } } function _fun120072() { // fn#120072, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15870:1002, offset: 0x0252022a, size: 31 bytes, params: 1, frame: 9 const binding = env1_0; binding._trackStartSpeaking(); binding._trackStartListening(); } } function _handleSpeakingStoreChanged() { // fn#120073, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15870:1103, owner: AppAnalyticsManager._handleSpeakingStoreChanged, offset: 0x02520249, size: 108 bytes, params: 1, frame: 11 var binding; let value = environment.__proto__.__proto__; const isCurrentUserSpeaking2 = SpeakingStore.isCurrentUserSpeaking(); if (env0_0._currentUserSpeaking !== isCurrentUserSpeaking2) { binding = env0_0; binding._currentUserSpeaking = isCurrentUserSpeaking2; binding._trackStartSpeaking(); } value = SpeakingStore.isAnyoneElseSpeaking(); if (env0_0._anyoneElseSpeaking !== value) { binding = env0_0; binding._anyoneElseSpeaking = value; binding._trackStartListening(); } } } function value_120074() { // fn#120074, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15870:1411, offset: 0x025202b5, size: 104 bytes, params: 1, frame: 16 const Map = global.Map; let map = new Map(); map = map.set(SpeakingStore, _fun120075); this.stores = map.set(RTCConnectionStore, _fun120076); this._reset(); function _fun120075() { // fn#120075, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15870:1451, offset: 0x0252031d, size: 19 bytes, params: 1, frame: 9 return env0_0._handleSpeakingStoreChanged(); } function _fun120076() { // fn#120076, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15870:1499, offset: 0x02520330, size: 19 bytes, params: 1, frame: 9 return env0_0._handleRTCConnectionStoreChanged(); } } function value_120078() { // fn#120078, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15870:1768, offset: 0x0252037a, size: 238 bytes, params: 1, frame: 20 var value; var rtcConnectionStoreBinding; var channelId; var guildId; var moduleValue; var trackWithMetadata; var START_SPEAKING; var object; var speakingStoreBinding; var sortedVoiceStateStoreBinding; if (this._currentUserSpeaking) { value = environment.__proto__; rtcConnectionStoreBinding = RTCConnectionStore; channelId = rtcConnectionStoreBinding.getChannelId(); guildId = rtcConnectionStoreBinding.getGuildId(); moduleValue = require(4863) /* metro dependency 4863: AppAnalyticsUtils */; trackWithMetadata = moduleValue.trackWithMetadata; START_SPEAKING = AnalyticEvents.START_SPEAKING; object = {}; object.mode = MediaEngineStore.getMode(); speakingStoreBinding = SpeakingStore; object.priority = speakingStoreBinding.isCurrentUserPrioritySpeaking(); object.channel = channelId; object.server = guildId; object.channel_id = channelId; object.guild_id = guildId; object.rtc_connection_id = rtcConnectionStoreBinding.getRTCConnectionId(); object.media_session_id = rtcConnectionStoreBinding.getMediaSessionId(); sortedVoiceStateStoreBinding = SortedVoiceStateStore; object.voice_state_count = sortedVoiceStateStoreBinding.countVoiceStatesForChannel(this._voiceChannelId); copyDataProperties(object, this.getGameMetadata(), speakingStoreBinding); copyDataProperties(object, rtcConnectionStoreBinding.getPacketStats(), speakingStoreBinding); Reflect.apply(trackWithMetadata, moduleValue, [START_SPEAKING, object]); } } function value_120079() { // fn#120079, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15870:2233, offset: 0x02520468, size: 244 bytes, params: 1, frame: 20 var rtcConnectionStoreBinding; var channelId; var guildId; var moduleValue; var trackWithMetadata; var START_LISTENING; var object; var speakingStoreBinding; var sortedVoiceStateStoreBinding; const mediaEngineStoreBinding = MediaEngineStore; if (!mediaEngineStoreBinding.isDeaf()) { if (this._anyoneElseSpeaking) { rtcConnectionStoreBinding = RTCConnectionStore; channelId = rtcConnectionStoreBinding.getChannelId(); guildId = rtcConnectionStoreBinding.getGuildId(); moduleValue = require(4863) /* metro dependency 4863: AppAnalyticsUtils */; trackWithMetadata = moduleValue.trackWithMetadata; START_LISTENING = AnalyticEvents.START_LISTENING; object = {}; object.mute = MediaEngineStore.isMute(); speakingStoreBinding = SpeakingStore; object.anyone_priority = speakingStoreBinding.isAnyonePrioritySpeaking(); object.channel = channelId; object.server = guildId; object.channel_id = channelId; object.guild_id = guildId; object.rtc_connection_id = rtcConnectionStoreBinding.getRTCConnectionId(); object.media_session_id = rtcConnectionStoreBinding.getMediaSessionId(); sortedVoiceStateStoreBinding = SortedVoiceStateStore; object.voice_state_count = sortedVoiceStateStoreBinding.countVoiceStatesForChannel(this._voiceChannelId); copyDataProperties(object, this.getGameMetadata(), speakingStoreBinding); Reflect.apply(trackWithMetadata, moduleValue, [START_LISTENING, object]); } } } function value_120081() { // fn#120081, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15870:2855, offset: 0x0252059a, size: 231 bytes, params: 1, frame: 16 var environment; var r1; let value = environment.__proto__; const activity = SelfPresenceStore.findActivity(function({type}) { return type === ActivityTypes.PLAYING; }); const currentGameForAnalytics = RunningGameStoreNative.getCurrentGameForAnalytics(); const object = {}; object.game_platform = (importDefault(15128) /* metro dependency 15128: getGamePlatform */)(activity); const value3 = null; object.game_name = value3 != activity ? activity.name : value3; object.game_exe_name = value3 != currentGameForAnalytics ? currentGameForAnalytics.exeName : value3; object.game_id = value3 != activity ? activity.application_id : value3; object.game_distributor = value3 != currentGameForAnalytics ? currentGameForAnalytics.distributor : value3; object.game_distributor_game_id = value3 != currentGameForAnalytics ? currentGameForAnalytics.sku : value3; if (value3 != currentGameForAnalytics) { value = require(4483) /* metro dependency 4483: RobloxSubgameUtils */; value = value.getSubgameMetadata(currentGameForAnalytics); r1 = value; } else { r1 = value3; } object.game_metadata = r1; return object; } } } global.__d(_fun120065, 15662, [6, 7, 15, 17, 18, 4266, 4259, 4294, 6876, 4607, 4300, 661, 672, 4041, 4863, 15128, 4483, 4860, 2]) /* metro module 15662, dependencies: [6, 7, 15, 17, 18, 4266, 4259, 4294, 6876, 4607, 4300, 661, 672, 4041, 4863, 15128, 4483, 4860, 2] */;