2026-07-25 08:10:48 +00:00
// Module ID: 12730
// Function ID: 99067
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-25 08:10:48 +00:00
// Dependencies: [6, 7, 15, 17, 18, 4151, 1316, 1194, 4163, 4166, 4203, 1907, 653, 664, 587, 4175, 10418, 4016, 4301, 566, 686, 2]
2026-07-20 16:05:17 +00:00
2026-07-25 08:10:48 +00:00
// Module 12730 (_isNativeReflectConstruct)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import closure_4 from "_isNativeReflectConstruct" ;
import convertToTransitionState from "convertToTransitionState" ;
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose" ;
import normalizePath from "normalizePath" ;
import closure_8 from "_isNativeReflectConstruct" ;
import closure_9 from "_isNativeReflectConstruct" ;
import closure_10 from "_isNativeReflectConstruct" ;
import closure_11 from "_isNativeReflectConstruct" ;
import closure_12 from "_isNativeReflectConstruct" ;
import closure_13 from "_isNativeReflectConstruct" ;
import closure_14 from "_isNativeReflectConstruct" ;
import { Distributors } from "ME" ;
import { Storage } from "Storage" ;
const require = arg1 ;
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = ! valueOf . call ( Reflect . construct ( Boolean , [ ] , ( ) = > {
} ) ) ;
function _isNativeReflectConstruct() {
return closure_0 ;
}
const result = _isNativeReflectConstruct ( ) ;
}
2026-07-23 10:11:24 +00:00
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 ;
}
function stopActivity ( applicationId , flag ) {
if ( flag === undefined ) {
flag = true ;
}
if ( flag ) {
updateActivity ( applicationId , true ) ;
}
2026-07-23 10:11:24 +00:00
if ( null != dependencyMap [ applicationId . applicationId ] ) {
2026-07-20 16:05:17 +00:00
obj . stop ( ) ;
applicationId = applicationId . applicationId ;
2026-07-23 10:11:24 +00:00
delete tmp3 [ tmp2 ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
delete tmp2 [ tmp ] ;
const Storage = require ( 587 ) /* Storage */ . Storage ;
const result = Storage . set ( ActivityTrackingStore , obj ) ;
2026-07-20 16:05:17 +00:00
}
function updateActivity ( applicationId ) {
let flag = arg1 ;
2026-07-23 10:11:24 +00:00
const _require = applicationId ;
2026-07-20 16:05:17 +00:00
if ( arg1 === undefined ) {
flag = false ;
}
const timestamp = Date . now ( ) ;
let num = 0 ;
if ( null != applicationId . updatedAt ) {
num = timestamp - applicationId . updatedAt ;
}
if ( num > closure_17 + closure_18 ) {
num = 0 ;
}
2026-07-25 08:10:48 +00:00
let obj = _require ( 4175 ) ;
2026-07-20 16:05:17 +00:00
const result = obj . shouldShareApplicationActivity ( applicationId . applicationId , closure_12 ) ;
2026-07-23 10:11:24 +00:00
voiceChannelId = voiceChannelId . getVoiceChannelId ( ) ;
sessionId = sessionId . getSessionId ( ) ;
mediaSessionId = mediaSessionId . getMediaSessionId ( ) ;
2026-07-20 16:05:17 +00:00
obj = { applicationId : applicationId.applicationId } ;
if ( applicationId . isDiscordApplication ) {
let distributor = Distributors . DISCORD ;
} else {
distributor = applicationId . distributor ;
}
obj . distributor = distributor ;
obj . shareActivity = result ;
obj . token = applicationId . token ;
obj . duration = Math . floor ( num / 1000 ) ;
obj . closed = flag ;
obj . exePath = applicationId . exePath ;
obj . voiceChannelId = voiceChannelId ;
obj . sessionId = sessionId ;
obj . mediaSessionId = mediaSessionId ;
2026-07-25 08:10:48 +00:00
importDefault ( 10418 ) . updateActivity ( obj ) ;
2026-07-20 16:05:17 +00:00
applicationId . updatedAt = timestamp ;
2026-07-23 10:11:24 +00:00
if ( null == dependencyMap [ applicationId . applicationId ] ) {
2026-07-25 08:10:48 +00:00
const Interval = _require ( 4016 ) . Interval ;
2026-07-20 16:05:17 +00:00
const prototype = Interval . prototype ;
const interval = new Interval ( ) ;
2026-07-23 10:11:24 +00:00
dependencyMap [ applicationId . applicationId ] = interval ;
2026-07-20 16:05:17 +00:00
interval . start ( closure_17 , ( ) = > {
2026-07-23 10:11:24 +00:00
outer1_26 ( closure_0 ) ;
2026-07-20 16:05:17 +00:00
} ) ;
}
if ( ! flag ) {
obj [ applicationId . applicationId ] = applicationId ;
2026-07-23 10:11:24 +00:00
const Storage = _require ( 587 ) . Storage ;
const result1 = Storage . set ( ActivityTrackingStore , obj ) ;
2026-07-20 16:05:17 +00:00
}
}
function handleRunningGamesChange ( flag ) {
let iter3 ;
let obj ;
if ( flag === undefined ) {
flag = true ;
}
2026-07-23 10:11:24 +00:00
visibleRunningGames = visibleRunningGames . getVisibleRunningGames ( ) ;
2026-07-20 16:05:17 +00:00
const set = new Set ( ) ;
const tmp2 = _createForOfIteratorHelperLoose ( visibleRunningGames ) ;
const iter = tmp2 ( ) ;
let iter2 = iter ;
if ( ! iter . done ) {
do {
let value = iter2 . value ;
let tmp4 = closure_11 ;
let findGameResult = closure_11 . findGame ( value ) ;
let tmp6 = tmp3 ;
if ( null != findGameResult ) {
let addResult = set . add ( findGameResult . id ) ;
2026-07-23 10:11:24 +00:00
let tmp16 = obj ;
if ( ! ( findGameResult . id in obj ) ) {
2026-07-20 16:05:17 +00:00
obj = { applicationId : findGameResult.id } ;
let _Date = Date ;
2026-07-23 10:11:24 +00:00
let tmp7 = updateActivity ;
2026-07-20 16:05:17 +00:00
obj . updatedAt = Date . now ( ) ;
obj . distributor = value . distributor ;
2026-07-23 10:11:24 +00:00
let tmp8 = require ;
let tmp9 = dependencyMap ;
2026-07-25 08:10:48 +00:00
let obj3 = require ( 4301 ) /* normalizePath */ ;
2026-07-20 16:05:17 +00:00
let exePath = value . exePath ;
let str = "" ;
if ( null != exePath ) {
str = exePath ;
}
obj . exePath = obj3 . removeExecutablePathPrefix ( str ) ;
let tmp7Result = tmp7 ( obj ) ;
2026-07-23 10:11:24 +00:00
tmp3 = exePath ;
2026-07-20 16:05:17 +00:00
}
tmp6 = tmp3 ;
}
iter3 = tmp2 ( ) ;
tmp3 = tmp6 ;
iter2 = iter3 ;
} while ( ! iter3 . done ) ;
}
const keys = Object . keys ( obj ) ;
for ( let num = 0 ; num < keys . length ; num = num + 1 ) {
let tmp11 = keys [ num ] ;
if ( ! set . has ( tmp11 ) ) {
let tmp12 = stopActivity ;
let tmp13 = obj ;
let tmp14 = stopActivity ( obj [ tmp11 ] , flag ) ;
}
}
}
function handleLogout() {
let length ;
const keys = Object . keys ( obj ) ;
let num = 0 ;
if ( 0 < keys . length ) {
do {
2026-07-23 10:11:24 +00:00
let tmp = stopActivity ;
let tmp2 = obj ;
let tmp3 = stopActivity ( obj [ keys [ num ] ] ) ;
2026-07-20 16:05:17 +00:00
num = num + 1 ;
length = keys . length ;
} while ( num < length ) ;
}
2026-07-23 10:11:24 +00:00
let c21 = false ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const ActivityTrackingStore = "ActivityTrackingStore" ;
let closure_17 = 30 * require ( "set" ) . Millis . MINUTE ;
let closure_18 = 5 * require ( "set" ) . Millis . MINUTE ;
2026-07-20 16:05:17 +00:00
let obj = Storage . get ( "ActivityTrackingStore" ) ;
if ( null == obj ) {
obj = { } ;
}
let closure_20 = { } ;
2026-07-23 10:11:24 +00:00
let c21 = false ;
let tmp2 = ( ( Store ) = > {
2026-07-20 16:05:17 +00:00
class ActivityTrackingStore {
constructor ( ) {
self = this ;
2026-07-23 10:11:24 +00:00
tmp = outer1_3 ( this , ActivityTrackingStore ) ;
obj = outer1_6 ( ActivityTrackingStore ) ;
tmp2 = outer1_5 ;
if ( outer1_22 ( ) ) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis ;
_Reflect = Reflect ;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_6 ;
2026-07-20 16:05:17 +00:00
tmp8 = arguments ;
2026-07-23 10:11:24 +00:00
constructResult = Reflect . construct ( obj , arguments , outer1_6 ( self ) . constructor ) ;
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments ;
tmp4 = arguments ;
constructResult = obj ( . . . arguments ) ;
}
return tmp2 ( self , constructResult ) ;
}
}
callback2 ( ActivityTrackingStore , Store ) ;
let obj = {
key : "initialize" ,
value() {
2026-07-23 10:11:24 +00:00
this . waitFor ( outer1_10 , outer1_11 , outer1_12 , outer1_13 , outer1_8 , outer1_14 , outer1_9 ) ;
const items = [ outer1_9 ] ;
this . syncWith ( items , outer1_27 ) ;
2026-07-20 16:05:17 +00:00
}
} ;
2026-07-23 10:11:24 +00:00
let items = [ obj , ] ;
2026-07-20 16:05:17 +00:00
obj = {
key : "getActivities" ,
value() {
2026-07-23 10:11:24 +00:00
return outer1_19 ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 1 ] = obj ;
return callback ( ActivityTrackingStore , items ) ;
2026-07-23 10:11:24 +00:00
} ) ( require ( "initialize" ) . Store ) ;
2026-07-20 16:05:17 +00:00
tmp2 . displayName = "ActivityTrackingStore" ;
obj = {
RUNNING_GAMES_CHANGE() {
handleRunningGamesChange ( ) ;
} ,
CONNECTION_OPEN : function handleConnectionOpen() {
let length ;
2026-07-23 10:11:24 +00:00
if ( c21 ) {
2026-07-20 16:05:17 +00:00
return false ;
} else {
const _Object = Object ;
const keys = Object . keys ( obj ) ;
let num = 0 ;
if ( 0 < keys . length ) {
do {
2026-07-23 10:11:24 +00:00
let tmp3 = updateActivity ;
let tmp4 = obj ;
let tmp5 = updateActivity ( obj [ keys [ num ] ] ) ;
2026-07-20 16:05:17 +00:00
num = num + 1 ;
length = keys . length ;
} while ( num < length ) ;
}
handleRunningGamesChange ( false ) ;
2026-07-23 10:11:24 +00:00
c21 = true ;
2026-07-20 16:05:17 +00:00
}
} ,
CONNECTION_CLOSED : function handleConnectionClosed ( code ) {
if ( 4004 === code . code ) {
handleLogout ( ) ;
}
} ,
LOGOUT : handleLogout ,
ACTIVITY_UPDATE_SUCCESS : function handleActivityUpdate ( arg0 ) {
if ( null == obj [ arg0 . applicationId ] ) {
return false ;
} else {
tmp2 . token = tmp ;
2026-07-23 10:11:24 +00:00
const Storage = require ( 587 ) /* Storage */ . Storage ;
const result = Storage . set ( ActivityTrackingStore , obj ) ;
2026-07-20 16:05:17 +00:00
}
} ,
ACTIVITY_UPDATE_FAIL : function handleActivityUpdateFail ( arg0 ) {
if ( null == obj [ arg0 . applicationId ] ) {
return false ;
} else {
tmp . token = null ;
tmp . updatedAt = null ;
2026-07-23 10:11:24 +00:00
const Storage = require ( 587 ) /* Storage */ . Storage ;
const result = Storage . set ( ActivityTrackingStore , obj ) ;
2026-07-20 16:05:17 +00:00
}
}
} ;
2026-07-23 10:11:24 +00:00
tmp2 = new tmp2 ( require ( "dispatcher" ) , obj ) ;
let result = require ( "_possibleConstructorReturn" ) . fileFinishedImporting ( "stores/ActivityTrackingStore.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default tmp2 ;