/* Metro module 4482; source: modules/game_detection/GameAnalyticsUtils.tsx; dependencies: [4267, 4483, 477, 2] */ import DetectableGameStore from '../../stores/DetectableGameStore.tsx'; /* Metro dependency 4267 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as PlatformUtilsModule from '../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */ function _fun38202(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#38202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4660:6, offset: 0x010b9a40, size: 149 bytes, params: 8, frame: 19 const env0_0 = require; const normalizePath_38203 = function(a0) { var r0; var value = a0.toLowerCase(); if (value.endsWith('/')) { value = value.slice(0, -1); r0 = value; } else { r0 = value; } return r0; }; const removeExecutablePathPrefix2 = removeExecutablePathPrefix; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('modules/game_detection/GameAnalyticsUtils.tsx'); exports.removeExecutablePathPrefix = removeExecutablePathPrefix2; exports.getRunningGameAnalytics = getRunningGameAnalytics; exports.isVerifiedGameExecutable = isVerifiedGameExecutable; function removeExecutablePathPrefix(a0) { // fn#38204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4660:193, offset: 0x010b9b0c, size: 59 bytes, params: 2, frame: 12 let value = normalizePath_38203(a0); value = value.split('/'); value = value.slice(-2); return value.join('/'); } function getRunningGameAnalytics(a0) { // fn#38205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4660:448, offset: 0x010b9b47, size: 374 bytes, params: 2, frame: 18 var r2; if (a0 == null) { return {gameName: undefined, gameId: undefined, exe: undefined, distributor: undefined, sku: undefined, gameMetadata: undefined, rawExePath: undefined}; } const r1 = 'exePath' in a0 ? a0.exePath : a0.exe; const id = a0.id; let value = undefined; const name = a0.name; const value2 = ''; const game = DetectableGameStore.findGame({id: id ?? value, name: name ?? value, exePath: r1 ?? value2, cmdLine: r1 ?? value2, lastFocused: 0}); const object = {}; object.gameName = a0.name ?? value; object.gameId = a0.id ?? (game == null ? value : game.id) ?? value; object.exe = r1 != null ? removeExecutablePathPrefix(r1) : value; object.distributor = a0.distributor ?? value; object.sku = a0.sku ?? value; if (a0 != null) { value = require(4483) /* metro dependency 4483: RobloxSubgameUtils */; value = value.getSubgameMetadata(a0); r2 = value; } else { r2 = value; } object.gameMetadata = r2; object.rawExePath = r1; return object; } function isVerifiedGameExecutable(a0, a1) { // fn#38206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4660:1128, offset: 0x010b9cbd, size: 92 bytes, params: 3, frame: 14 if (a0 == null) { return false; } if (a1 == null) { return false; } const env0_0 = normalizePath_38203(a0); const env0_1 = (PlatformUtilsModule).getPlatformName(); return a1.some(_fun38207); function _fun38207(a0) { // fn#38207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4660:1262, offset: 0x010b9d19, size: 63 bytes, params: 2, frame: 13 return a0.os === env0_1 && env0_0?.endsWith(a0.name); } } } global.__d(_fun38202, 4482, [4267, 4483, 477, 2]) /* metro module 4482, dependencies: [4267, 4483, 477, 2] */;