1530 lines
83 KiB
TypeScript
1530 lines
83 KiB
TypeScript
/* Metro module 1378; source: modules/activities/EmbeddedActivitiesStore.tsx; dependencies: [57, 6, 7, 15, 17, 18, 1226, 1379, 1934, 1878, 4237, 8044, 661, 8067, 3774, 12711, 1239, 8110, 694, 8102, 8049, 477, 1909, 5068, 566, 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 Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import Dispatcher from '../../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import AuthenticationStore from '../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
|
|
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import SelectedChannelStore from '../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
|
|
import GetPlatform from './utils/getPlatform.tsx'; /* Metro dependency 8049 */
|
|
import GetURLForApplication from './getURLForApplication.tsx'; /* Metro dependency 8067 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as PlatformUtilsModule from '../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
|
|
import * as ComponentDispatchUtilsModule from '../../utils/ComponentDispatchUtils.tsx'; /* Metro dependency 1239 */
|
|
import * as ConstantsModule from './Constants.tsx'; /* Metro dependency 4237 */
|
|
import * as ApplicationCommandTypesModule from '../application_commands/ApplicationCommandTypes.tsx'; /* Metro dependency 5068 */
|
|
import * as ActivityPanelConstantsModule from './panel/ActivityPanelConstants.tsx'; /* Metro dependency 8044 */
|
|
import * as IsActivityParticipantCurrentUserCurrentSessionModule from './isActivityParticipantCurrentUserCurrentSession.tsx'; /* Metro dependency 12711 */
|
|
|
|
function _fun15850(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#15850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:6, offset: 0x00e40f22, size: 1487 bytes, params: 8, frame: 25
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_15853 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const getLaunchStatesKey = function(a0, a1) {
|
|
return '' + a1 + ':' + a0;
|
|
};
|
|
const getNormalizedGuildId = function(a0) {
|
|
return a0 ?? '0';
|
|
};
|
|
const updateEmbeddedActivitiesForGuild = function({activity_instances}) {
|
|
if (activity_instances != null) {
|
|
activity_instances.forEach(_fun15873);
|
|
}
|
|
};
|
|
const getActivityKey = function(a0, a1) {
|
|
return '' + a0 + ':' + a1;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const ActivityPopoutWindowLayouts = (ConstantsModule).ActivityPopoutWindowLayouts;
|
|
let value = ActivityPanelConstantsModule;
|
|
const ActivityPanelModes = value.ActivityPanelModes;
|
|
const FocusedActivityLayouts = value.FocusedActivityLayouts;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_15 = value.ComponentActions;
|
|
const env0_16 = value.PopoutWindowKeys;
|
|
let Set = global.Set;
|
|
let set = new Set([]);
|
|
object = {};
|
|
Set = global.Set;
|
|
let value2 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
set = new Set();
|
|
object.everLaunchedActivities = set instanceof Object ? set : value2;
|
|
object.seenNewActivities = {};
|
|
object.seenUpdatedActivities = {};
|
|
object.lastCheckedForBadgeableActivities = null;
|
|
object.dateRangesForSurfaces = {};
|
|
let Map = global.Map;
|
|
let map = new Map();
|
|
Map = global.Map;
|
|
map = new Map();
|
|
Map = global.Map;
|
|
map = new Map();
|
|
Map = global.Map;
|
|
map = new Map();
|
|
Map = global.Map;
|
|
map = new Map();
|
|
Map = global.Map;
|
|
map = new Map();
|
|
Set = global.Set;
|
|
set = new Set();
|
|
Map = global.Map;
|
|
map = new Map();
|
|
Map = global.Map;
|
|
map = new Map();
|
|
Map = global.Map;
|
|
map = new Map();
|
|
Map = global.Map;
|
|
map = new Map();
|
|
Map = global.Map;
|
|
map = new Map();
|
|
Map = global.Map;
|
|
map = new Map();
|
|
Map = global.Map;
|
|
map = new Map();
|
|
let env0_35 = ActivityPanelModes.DISCONNECTED;
|
|
let env0_36 = FocusedActivityLayouts.RESIZABLE;
|
|
let env0_37 = ActivityPopoutWindowLayouts.NORMAL;
|
|
const PersistedStore = (Flux).PersistedStore;
|
|
const value32 = _fun15878(PersistedStore);
|
|
value32.displayName = 'EmbeddedActivitiesStore';
|
|
value32.persistKey = 'EmbeddedActivities';
|
|
value32.migrations = [function(a0) {
|
|
var r2;
|
|
var object = {};
|
|
copyDataProperties(object, a0, r2);
|
|
object['seenFeaturedActivities'] = [];
|
|
object['shouldShowNewActivityIndicator'] = false;
|
|
return object;
|
|
}, function(a0) {
|
|
delete a0.seenFeaturedActivities;
|
|
var object = {};
|
|
copyDataProperties(object, a0, a0);
|
|
return object;
|
|
}, function(a0) {
|
|
delete a0.seenActivities;
|
|
var object = {};
|
|
copyDataProperties(object, a0, a0);
|
|
return object;
|
|
}, function(a0) {
|
|
delete a0.currentFreeActivity;
|
|
delete a0.lastFreeActivityRotationTimestampMs;
|
|
delete a0.freePeriodActivities;
|
|
delete a0.shouldShowFreeActivityIndicator;
|
|
var object = {};
|
|
copyDataProperties(object, a0, a0);
|
|
return object;
|
|
}, function(a0) {
|
|
var r2;
|
|
var object = {};
|
|
copyDataProperties(object, a0, r2);
|
|
object['seenNewActivities'] = {};
|
|
object['seenUpdatedActivities'] = {};
|
|
return object;
|
|
}, function(a0) {
|
|
var r0;
|
|
var object;
|
|
var Set = global.Set;
|
|
r0 = a0.everLaunchedActivities ?? [];
|
|
var value2 = new Set();
|
|
object = {};
|
|
copyDataProperties(object, a0, Set);
|
|
object['everLaunchedActivities'] = value2;
|
|
return object;
|
|
}, function(a0) {
|
|
delete a0.usersHavePlayedByApp;
|
|
var object = {};
|
|
copyDataProperties(object, a0, a0);
|
|
return object;
|
|
}, _fun15919, function(a0) {
|
|
var r2;
|
|
var object = {};
|
|
copyDataProperties(object, a0, r2);
|
|
object['lastCheckedForBadgeableActivities'] = null;
|
|
return object;
|
|
}, function(a0) {
|
|
var r2;
|
|
delete a0.surfacesToShowNewActivityIndicator;
|
|
var object = {};
|
|
copyDataProperties(object, a0, r2);
|
|
object['dateRangesForSurfaces'] = {};
|
|
return object;
|
|
}];
|
|
const value35 = new value32(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{ACTIVITY_LAYOUT_MODE_UPDATE: ACTIVITY_LAYOUT_MODE_UPDATE,
|
|
CONNECTION_OPEN_SUPPLEMENTAL: CONNECTION_OPEN_SUPPLEMENTAL, GUILD_CREATE: function({guild}) {
|
|
updateEmbeddedActivitiesForGuild(guild);
|
|
}, CHANNEL_DELETE: CHANNEL_DELETE, EMBEDDED_ACTIVITY_LAUNCH_START: EMBEDDED_ACTIVITY_LAUNCH_START,
|
|
EMBEDDED_ACTIVITY_LAUNCH_SET_PROXY_TICKET: EMBEDDED_ACTIVITY_LAUNCH_SET_PROXY_TICKET,
|
|
EMBEDDED_ACTIVITY_UPDATE_CONNECTED_PROXY_TICKET: EMBEDDED_ACTIVITY_UPDATE_CONNECTED_PROXY_TICKET,
|
|
EMBEDDED_ACTIVITY_SET_PROXY_TICKET_REFRESHING: EMBEDDED_ACTIVITY_SET_PROXY_TICKET_REFRESHING,
|
|
EMBEDDED_ACTIVITY_LAUNCH_SUCCESS: EMBEDDED_ACTIVITY_LAUNCH_SUCCESS,
|
|
EMBEDDED_ACTIVITY_LAUNCH_FAIL: EMBEDDED_ACTIVITY_LAUNCH_FAIL,
|
|
EMBEDDED_ACTIVITY_LAUNCH_CANCEL: EMBEDDED_ACTIVITY_LAUNCH_CANCEL,
|
|
EMBEDDED_ACTIVITY_CLOSE: EMBEDDED_ACTIVITY_CLOSE, EMBEDDED_ACTIVITY_UPDATE_POPOUT_WINDOW_LAYOUT: function(a0) {
|
|
env0_37 = a0.layout;
|
|
}, EMBEDDED_ACTIVITY_UPDATE_V2: EMBEDDED_ACTIVITY_UPDATE_V2, LOCAL_ACTIVITY_UPDATE: LOCAL_ACTIVITY_UPDATE,
|
|
EMBEDDED_ACTIVITY_SET_CONFIG: EMBEDDED_ACTIVITY_SET_CONFIG,
|
|
EMBEDDED_ACTIVITY_FETCH_SHELF: EMBEDDED_ACTIVITY_FETCH_SHELF,
|
|
EMBEDDED_ACTIVITY_FETCH_SHELF_SUCCESS: EMBEDDED_ACTIVITY_FETCH_SHELF_SUCCESS,
|
|
EMBEDDED_ACTIVITY_FETCH_SHELF_FAIL: EMBEDDED_ACTIVITY_FETCH_SHELF_FAIL,
|
|
EMBEDDED_ACTIVITY_SET_ORIENTATION_LOCK_STATE: EMBEDDED_ACTIVITY_SET_ORIENTATION_LOCK_STATE,
|
|
EMBEDDED_ACTIVITY_SET_PANEL_MODE: function(a0) {
|
|
env0_35 = a0.activityPanelMode;
|
|
}, EMBEDDED_ACTIVITY_SET_FOCUSED_LAYOUT: function(a0) {
|
|
env0_36 = a0.focusedActivityLayout;
|
|
}, CHANNEL_SELECT: CHANNEL_SELECT, POPOUT_WINDOW_CLOSE: function({key}) {
|
|
if (key === PopoutWindowKeys.ACTIVITY_POPOUT) {
|
|
env0_35 = ActivityPanelModes.PIP;
|
|
}
|
|
}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/activities/EmbeddedActivitiesStore.tsx');
|
|
exports.default = value35;
|
|
exports.FEATURED_ACTIVITY_IDS = set;
|
|
exports.NO_ACTIVITIES = [];
|
|
exports.NO_ACTIVITY_CONFIGS = [];
|
|
exports.ACTIVITIES_GUILD_ID_SENTINEL_FOR_PRIVATE_CHANNELS = '0';
|
|
function _createForOfIteratorHelperLoose_15851(a0, a1) { // fn#15851, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:356, offset: 0x00e414f1, size: 370 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun15852;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_15853(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_15853(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_15853(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun15852;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
function _fun15852() { // fn#15852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:927, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function _isNativeReflectConstruct_15854() { // fn#15854, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:1266, offset: 0x00e41663, size: 94 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_15854_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function updateEmbeddedActivities({location, applicationId, launchId, compositeInstanceId, participants, proxyTicket}) { // fn#15859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:1932, offset: 0x00e416fc, size: 1117 bytes, params: 2, frame: 37
|
|
var r2;
|
|
var r14;
|
|
var r8;
|
|
var sessionId;
|
|
var launchParams;
|
|
var r23;
|
|
var r10;
|
|
var embeddedActivityLocationChannelId;
|
|
var binding;
|
|
var get;
|
|
var id;
|
|
var value10;
|
|
var value11;
|
|
var authenticationStoreBinding;
|
|
var value12;
|
|
var value14;
|
|
var value15;
|
|
var value16;
|
|
var object;
|
|
var Set;
|
|
var value17;
|
|
var set;
|
|
var applicationId2;
|
|
var object2;
|
|
var Array;
|
|
var value19;
|
|
var value20;
|
|
var value22;
|
|
var getNormalizedGuildIdBinding;
|
|
var moduleValue2;
|
|
var normalizedGuildIdBinding;
|
|
var value25;
|
|
var env0_2;
|
|
const value3 = (GetURLForApplication)(applicationId);
|
|
if (value3 != null) {
|
|
embeddedActivityLocationChannelId = (require(3774) /* metro dependency 3774: embeddedActivityLocationUtils */).getEmbeddedActivityLocationChannelId(location);
|
|
r2 = embeddedActivityLocationChannelId == null ? env0_18 : env0_22.get(embeddedActivityLocationChannelId) ?? env0_18;
|
|
r14 = r2 != null && r2.length === 0;
|
|
binding = env0_24;
|
|
get = binding.get;
|
|
id = location.id;
|
|
r8 = Reflect.apply(get, binding, [id]) ?? env0_18;
|
|
value10 = r8.find(function({applicationId}) {
|
|
return applicationId === applicationId;
|
|
});
|
|
value11 = participants.map(_fun15861);
|
|
env0_2 = AuthenticationStore.getId();
|
|
value12 = value11.some(_fun15862);
|
|
sessionId = participants.find(_fun15863)?.sessionId;
|
|
value14 = participants.some(_fun15864);
|
|
binding = env0_20;
|
|
value15 = binding.get(applicationId);
|
|
binding = env0_25;
|
|
value16 = binding.get(getLaunchStatesKey(embeddedActivityLocationChannelId ?? null, applicationId));
|
|
launchParams = value16?.launchParams;
|
|
object = {applicationId: applicationId, location: location, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId, url: value3};
|
|
Set = global.Set;
|
|
value17 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
set = new Set();
|
|
object.userIds = set instanceof Object ? set : value17;
|
|
object.participants = participants;
|
|
r23 = value15?.referrerId ?? launchParams?.referrerId;
|
|
object.referrerId = r23;
|
|
r23 = value15?.customId ?? launchParams?.customId;
|
|
object.customId = r23;
|
|
object.proxyTicket = proxyTicket;
|
|
if (value12) {
|
|
if (value15 != null) {
|
|
binding = env0_20;
|
|
set = binding.set;
|
|
applicationId2 = value15.applicationId;
|
|
object2 = {};
|
|
copyDataProperties(object2, value15, undefined);
|
|
copyDataProperties(object2, object, undefined);
|
|
proxyTicket = object.proxyTicket;
|
|
proxyTicket = proxyTicket ?? value15.proxyTicket;
|
|
object2['proxyTicket'] = proxyTicket;
|
|
Reflect.apply(set, binding, [applicationId2, object2]);
|
|
}
|
|
}
|
|
if (value15 == null) {
|
|
if (value12) {
|
|
if (value15 == null) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
if (sessionId === authenticationStoreBinding.getSessionId()) {
|
|
openActivity({applicationId: applicationId, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId,
|
|
location: location, participants: participants, isFirstActivityInChannel: r14,
|
|
isStart: value10 == null,
|
|
referrerId: object.referrerId, customId: object.customId,
|
|
inviterUserId: value16?.inviterUserId,
|
|
proxyTicket: object.proxyTicket});
|
|
}
|
|
handleEmbeddedActivityLaunchEnd({channelId: embeddedActivityLocationChannelId ?? null,
|
|
applicationId: applicationId});
|
|
} else if (value15.applicationId !== applicationId) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
if (sessionId === authenticationStoreBinding.getSessionId()) {
|
|
openActivity({applicationId: applicationId, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId,
|
|
location: location, participants: participants, isFirstActivityInChannel: r14,
|
|
isStart: value10 == null,
|
|
referrerId: object.referrerId, customId: object.customId,
|
|
inviterUserId: value16?.inviterUserId,
|
|
proxyTicket: object.proxyTicket});
|
|
}
|
|
handleEmbeddedActivityLaunchEnd({channelId: embeddedActivityLocationChannelId ?? null,
|
|
applicationId: applicationId});
|
|
} else if (value15.location.id !== location.id) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
if (sessionId === authenticationStoreBinding.getSessionId()) {
|
|
openActivity({applicationId: applicationId, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId,
|
|
location: location, participants: participants, isFirstActivityInChannel: r14,
|
|
isStart: value10 == null,
|
|
referrerId: object.referrerId, customId: object.customId,
|
|
inviterUserId: value16?.inviterUserId,
|
|
proxyTicket: object.proxyTicket});
|
|
}
|
|
handleEmbeddedActivityLaunchEnd({channelId: embeddedActivityLocationChannelId ?? null,
|
|
applicationId: applicationId});
|
|
}
|
|
}
|
|
} else if (location.id !== value15.location.id) {
|
|
if (value12) {
|
|
if (value15 == null) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
if (sessionId === authenticationStoreBinding.getSessionId()) {
|
|
openActivity({applicationId: applicationId, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId,
|
|
location: location, participants: participants, isFirstActivityInChannel: r14,
|
|
isStart: value10 == null,
|
|
referrerId: object.referrerId, customId: object.customId,
|
|
inviterUserId: value16?.inviterUserId,
|
|
proxyTicket: object.proxyTicket});
|
|
}
|
|
handleEmbeddedActivityLaunchEnd({channelId: embeddedActivityLocationChannelId ?? null,
|
|
applicationId: applicationId});
|
|
} else if (value15.applicationId !== applicationId) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
if (sessionId === authenticationStoreBinding.getSessionId()) {
|
|
openActivity({applicationId: applicationId, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId,
|
|
location: location, participants: participants, isFirstActivityInChannel: r14,
|
|
isStart: value10 == null,
|
|
referrerId: object.referrerId, customId: object.customId,
|
|
inviterUserId: value16?.inviterUserId,
|
|
proxyTicket: object.proxyTicket});
|
|
}
|
|
handleEmbeddedActivityLaunchEnd({channelId: embeddedActivityLocationChannelId ?? null,
|
|
applicationId: applicationId});
|
|
} else if (value15.location.id !== location.id) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
if (sessionId === authenticationStoreBinding.getSessionId()) {
|
|
openActivity({applicationId: applicationId, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId,
|
|
location: location, participants: participants, isFirstActivityInChannel: r14,
|
|
isStart: value10 == null,
|
|
referrerId: object.referrerId, customId: object.customId,
|
|
inviterUserId: value16?.inviterUserId,
|
|
proxyTicket: object.proxyTicket});
|
|
}
|
|
handleEmbeddedActivityLaunchEnd({channelId: embeddedActivityLocationChannelId ?? null,
|
|
applicationId: applicationId});
|
|
}
|
|
}
|
|
} else if (applicationId !== value15.applicationId) {
|
|
if (value12) {
|
|
if (value15 == null) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
if (sessionId === authenticationStoreBinding.getSessionId()) {
|
|
openActivity({applicationId: applicationId, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId,
|
|
location: location, participants: participants, isFirstActivityInChannel: r14,
|
|
isStart: value10 == null,
|
|
referrerId: object.referrerId, customId: object.customId,
|
|
inviterUserId: value16?.inviterUserId,
|
|
proxyTicket: object.proxyTicket});
|
|
}
|
|
handleEmbeddedActivityLaunchEnd({channelId: embeddedActivityLocationChannelId ?? null,
|
|
applicationId: applicationId});
|
|
} else if (value15.applicationId !== applicationId) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
if (sessionId === authenticationStoreBinding.getSessionId()) {
|
|
openActivity({applicationId: applicationId, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId,
|
|
location: location, participants: participants, isFirstActivityInChannel: r14,
|
|
isStart: value10 == null,
|
|
referrerId: object.referrerId, customId: object.customId,
|
|
inviterUserId: value16?.inviterUserId,
|
|
proxyTicket: object.proxyTicket});
|
|
}
|
|
handleEmbeddedActivityLaunchEnd({channelId: embeddedActivityLocationChannelId ?? null,
|
|
applicationId: applicationId});
|
|
} else if (value15.location.id !== location.id) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
if (sessionId === authenticationStoreBinding.getSessionId()) {
|
|
openActivity({applicationId: applicationId, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId,
|
|
location: location, participants: participants, isFirstActivityInChannel: r14,
|
|
isStart: value10 == null,
|
|
referrerId: object.referrerId, customId: object.customId,
|
|
inviterUserId: value16?.inviterUserId,
|
|
proxyTicket: object.proxyTicket});
|
|
}
|
|
handleEmbeddedActivityLaunchEnd({channelId: embeddedActivityLocationChannelId ?? null,
|
|
applicationId: applicationId});
|
|
}
|
|
}
|
|
} else if (value12) {
|
|
if (value14) {
|
|
if (value12) {
|
|
if (value15 == null) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
if (sessionId === authenticationStoreBinding.getSessionId()) {
|
|
openActivity({applicationId: applicationId, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId,
|
|
location: location, participants: participants, isFirstActivityInChannel: r14,
|
|
isStart: value10 == null,
|
|
referrerId: object.referrerId, customId: object.customId,
|
|
inviterUserId: value16?.inviterUserId,
|
|
proxyTicket: object.proxyTicket});
|
|
}
|
|
handleEmbeddedActivityLaunchEnd({channelId: embeddedActivityLocationChannelId ?? null,
|
|
applicationId: applicationId});
|
|
} else if (value15.applicationId !== applicationId) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
if (sessionId === authenticationStoreBinding.getSessionId()) {
|
|
openActivity({applicationId: applicationId, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId,
|
|
location: location, participants: participants, isFirstActivityInChannel: r14,
|
|
isStart: value10 == null,
|
|
referrerId: object.referrerId, customId: object.customId,
|
|
inviterUserId: value16?.inviterUserId,
|
|
proxyTicket: object.proxyTicket});
|
|
}
|
|
handleEmbeddedActivityLaunchEnd({channelId: embeddedActivityLocationChannelId ?? null,
|
|
applicationId: applicationId});
|
|
} else if (value15.location.id !== location.id) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
if (sessionId === authenticationStoreBinding.getSessionId()) {
|
|
openActivity({applicationId: applicationId, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId,
|
|
location: location, participants: participants, isFirstActivityInChannel: r14,
|
|
isStart: value10 == null,
|
|
referrerId: object.referrerId, customId: object.customId,
|
|
inviterUserId: value16?.inviterUserId,
|
|
proxyTicket: object.proxyTicket});
|
|
}
|
|
handleEmbeddedActivityLaunchEnd({channelId: embeddedActivityLocationChannelId ?? null,
|
|
applicationId: applicationId});
|
|
}
|
|
}
|
|
} else {
|
|
disconnectEmbeddedActivity(value15);
|
|
}
|
|
} else {
|
|
Array = global.Array;
|
|
value19 = Array.from(value15.userIds);
|
|
if (value19.some(_fun15865)) {
|
|
disconnectEmbeddedActivity(value15);
|
|
} else if (value14) {
|
|
if (value12) {
|
|
if (value15 == null) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
if (sessionId === authenticationStoreBinding.getSessionId()) {
|
|
openActivity({applicationId: applicationId, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId,
|
|
location: location, participants: participants, isFirstActivityInChannel: r14,
|
|
isStart: value10 == null,
|
|
referrerId: object.referrerId, customId: object.customId,
|
|
inviterUserId: value16?.inviterUserId,
|
|
proxyTicket: object.proxyTicket});
|
|
}
|
|
handleEmbeddedActivityLaunchEnd({channelId: embeddedActivityLocationChannelId ?? null,
|
|
applicationId: applicationId});
|
|
} else if (value15.applicationId !== applicationId) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
if (sessionId === authenticationStoreBinding.getSessionId()) {
|
|
openActivity({applicationId: applicationId, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId,
|
|
location: location, participants: participants, isFirstActivityInChannel: r14,
|
|
isStart: value10 == null,
|
|
referrerId: object.referrerId, customId: object.customId,
|
|
inviterUserId: value16?.inviterUserId,
|
|
proxyTicket: object.proxyTicket});
|
|
}
|
|
handleEmbeddedActivityLaunchEnd({channelId: embeddedActivityLocationChannelId ?? null,
|
|
applicationId: applicationId});
|
|
} else if (value15.location.id !== location.id) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
if (sessionId === authenticationStoreBinding.getSessionId()) {
|
|
openActivity({applicationId: applicationId, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId,
|
|
location: location, participants: participants, isFirstActivityInChannel: r14,
|
|
isStart: value10 == null,
|
|
referrerId: object.referrerId, customId: object.customId,
|
|
inviterUserId: value16?.inviterUserId,
|
|
proxyTicket: object.proxyTicket});
|
|
}
|
|
handleEmbeddedActivityLaunchEnd({channelId: embeddedActivityLocationChannelId ?? null,
|
|
applicationId: applicationId});
|
|
}
|
|
}
|
|
} else {
|
|
disconnectEmbeddedActivity(value15);
|
|
}
|
|
}
|
|
value20 = r8.filter(_fun15869);
|
|
if (value11.length > 0) {
|
|
value20.push(object);
|
|
}
|
|
binding = env0_24;
|
|
set = binding.set;
|
|
id = location.id;
|
|
Reflect.apply(set, binding, [id, value20]);
|
|
if (embeddedActivityLocationChannelId != null) {
|
|
binding = env0_22;
|
|
r10 = binding.get(embeddedActivityLocationChannelId) ?? [];
|
|
value22 = r10.filter(_fun15870);
|
|
getNormalizedGuildIdBinding = getNormalizedGuildId;
|
|
moduleValue2 = require(3774) /* metro dependency 3774: embeddedActivityLocationUtils */;
|
|
normalizedGuildIdBinding = getNormalizedGuildIdBinding(moduleValue2.getEmbeddedActivityLocationGuildId(location));
|
|
binding = env0_21;
|
|
r10 = binding.get(normalizedGuildIdBinding) ?? [];
|
|
value25 = r10.filter(_fun15871);
|
|
if (value11.length > 0) {
|
|
value22.push(object);
|
|
value25.push(object);
|
|
}
|
|
binding = env0_22;
|
|
binding.set(embeddedActivityLocationChannelId, value22);
|
|
binding = env0_21;
|
|
binding.set(normalizedGuildIdBinding, value25);
|
|
}
|
|
}
|
|
function _fun15862(a0) { // fn#15862, offset: 0x00e41b78, size: 16 bytes, params: 2, frame: 2
|
|
return a0 === env0_2;
|
|
}
|
|
|
|
function _fun15863({userId}) { // fn#15863, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:2352, offset: 0x00e41b88, size: 21 bytes, params: 2, frame: 2
|
|
return userId === env0_2;
|
|
}
|
|
|
|
function _fun15864(a0) { // fn#15864, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:2400, offset: 0x00e41b9d, size: 41 bytes, params: 2, frame: 11
|
|
const value = environment.__proto__;
|
|
return (IsActivityParticipantCurrentUserCurrentSessionModule).isActivityParticipantCurrentUserCurrentSession(a0);
|
|
}
|
|
|
|
function _fun15865(a0) { // fn#15865, offset: 0x00e41b78, size: 16 bytes, params: 2, frame: 2
|
|
return a0 === env0_2;
|
|
}
|
|
|
|
function openActivity({applicationId, launchId, compositeInstanceId, location, participants, isFirstActivityInChannel, isStart, referrerId, customId, inviterUserId, proxyTicket}) { // fn#15866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:3111, owner: updateEmbeddedActivities.openActivity, offset: 0x00e41bc6, size: 719 bytes, params: 2, frame: 30
|
|
var environment;
|
|
var r12;
|
|
var r4;
|
|
var value9;
|
|
var object;
|
|
var Set;
|
|
var value10;
|
|
var set;
|
|
var Date;
|
|
const ComponentDispatch = (ComponentDispatchUtilsModule).ComponentDispatch;
|
|
var moduleValue2;
|
|
var selectedChannelStoreBinding;
|
|
var ACTIVITY_POPOUT_WINDOW;
|
|
let value = environment.__proto__;
|
|
const value3 = (GetURLForApplication)(applicationId);
|
|
if (value3 != null) {
|
|
if (AuthenticationStore.getSessionId() == null) {
|
|
return false;
|
|
}
|
|
var binding = env1_20;
|
|
var value5 = binding.get(applicationId);
|
|
if ((value5 == null ? undefined : value5.location.id) === location.id) {
|
|
return false;
|
|
}
|
|
var embeddedActivityLocationChannelId = (require(3774) /* metro dependency 3774: embeddedActivityLocationUtils */).getEmbeddedActivityLocationChannelId(location);
|
|
var channel = ChannelStore.getChannel(embeddedActivityLocationChannelId);
|
|
r12 = channel?.getGuildId();
|
|
var userStoreBinding = UserStore;
|
|
var getCurrentUser = userStoreBinding.getCurrentUser;
|
|
if (Reflect.apply(getCurrentUser, userStoreBinding, []) == null) {
|
|
return false;
|
|
}
|
|
if (r12 != null) {
|
|
value9 = participants.map(function(a0) {
|
|
return a0.userId;
|
|
});
|
|
object = {applicationId: applicationId, url: value3};
|
|
Set = global.Set;
|
|
value10 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
set = new Set();
|
|
object.userIds = set instanceof Object ? set : value10;
|
|
object.participants = participants;
|
|
Date = global.Date;
|
|
object.connectedSince = Date.now();
|
|
object.launchId = launchId;
|
|
object.compositeInstanceId = compositeInstanceId;
|
|
object.location = location;
|
|
object.referrerId = referrerId;
|
|
object.customId = customId;
|
|
object.proxyTicket = proxyTicket;
|
|
binding = env1_20;
|
|
binding.set(applicationId, object);
|
|
ComponentDispatch.dispatch(ComponentActions.OPEN_EMBEDDED_ACTIVITY, {location: location,
|
|
applicationId: applicationId, isFirstActivityInChannel: isFirstActivityInChannel, isStart: isStart,
|
|
participants: participants, embeddedActivity: object, inviterUserId: inviterUserId});
|
|
moduleValue2 = require(8110) /* metro dependency 8110: ActivityPopoutUtilsNative */;
|
|
if (moduleValue2.shouldOpenActivityInPopoutWindow()) {
|
|
ACTIVITY_POPOUT_WINDOW = ActivityPanelModes.ACTIVITY_POPOUT_WINDOW;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).wait(_fun15868);
|
|
} else {
|
|
selectedChannelStoreBinding = SelectedChannelStore;
|
|
r4 = embeddedActivityLocationChannelId !== selectedChannelStoreBinding.getChannelId() || (importDefault(8102) /* metro dependency 8102: isVoiceEmbeddedActivity */)(embeddedActivityLocationChannelId) ? ActivityPanelModes.PIP : ActivityPanelModes.PANEL;
|
|
}
|
|
binding = env1_33;
|
|
set = binding.set;
|
|
value = getActivityKey(location.id, applicationId);
|
|
Date = global.Date;
|
|
Reflect.apply(set, binding, [value, Date.now()]);
|
|
return undefined;
|
|
}
|
|
r12 = channel?.isPrivate();
|
|
if (r12 == null) {
|
|
return false;
|
|
}
|
|
if (r12) {
|
|
value9 = participants.map(function(a0) {
|
|
return a0.userId;
|
|
});
|
|
object = {applicationId: applicationId, url: value3};
|
|
Set = global.Set;
|
|
value10 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
set = new Set();
|
|
object.userIds = set instanceof Object ? set : value10;
|
|
object.participants = participants;
|
|
Date = global.Date;
|
|
object.connectedSince = Date.now();
|
|
object.launchId = launchId;
|
|
object.compositeInstanceId = compositeInstanceId;
|
|
object.location = location;
|
|
object.referrerId = referrerId;
|
|
object.customId = customId;
|
|
object.proxyTicket = proxyTicket;
|
|
binding = env1_20;
|
|
binding.set(applicationId, object);
|
|
ComponentDispatch.dispatch(ComponentActions.OPEN_EMBEDDED_ACTIVITY, {location: location,
|
|
applicationId: applicationId, isFirstActivityInChannel: isFirstActivityInChannel, isStart: isStart,
|
|
participants: participants, embeddedActivity: object, inviterUserId: inviterUserId});
|
|
moduleValue2 = require(8110) /* metro dependency 8110: ActivityPopoutUtilsNative */;
|
|
if (moduleValue2.shouldOpenActivityInPopoutWindow()) {
|
|
ACTIVITY_POPOUT_WINDOW = ActivityPanelModes.ACTIVITY_POPOUT_WINDOW;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).wait(_fun15868);
|
|
} else {
|
|
selectedChannelStoreBinding = SelectedChannelStore;
|
|
r4 = embeddedActivityLocationChannelId !== selectedChannelStoreBinding.getChannelId() || (importDefault(8102) /* metro dependency 8102: isVoiceEmbeddedActivity */)(embeddedActivityLocationChannelId) ? ActivityPanelModes.PIP : ActivityPanelModes.PANEL;
|
|
}
|
|
binding = env1_33;
|
|
set = binding.set;
|
|
value = getActivityKey(location.id, applicationId);
|
|
Date = global.Date;
|
|
Reflect.apply(set, binding, [value, Date.now()]);
|
|
return undefined;
|
|
}
|
|
}
|
|
return false;
|
|
function _fun15868() { // fn#15868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:4119, offset: 0x00e41e95, size: 49 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__.__proto__;
|
|
(Dispatcher).dispatch({type: 'ACTIVITY_POPOUT_WINDOW_OPEN'});
|
|
}
|
|
|
|
}
|
|
|
|
function _fun15869({applicationId}) { // fn#15869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:4640, offset: 0x00e41ec6, size: 21 bytes, params: 2, frame: 2
|
|
return applicationId !== applicationId;
|
|
}
|
|
|
|
function _fun15870({applicationId}) { // fn#15870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:4757, offset: 0x00e41ec6, size: 21 bytes, params: 2, frame: 2
|
|
return applicationId !== applicationId;
|
|
}
|
|
|
|
function _fun15871(a0) { // fn#15871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:4890, offset: 0x00e41edb, size: 50 bytes, params: 2, frame: 4
|
|
return !(a0.applicationId === applicationId && a0.location.id === location.id);
|
|
}
|
|
|
|
}
|
|
|
|
function updateEmbeddedActivitiesForGuild({activity_instances}) { // fn#15872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:4998, offset: 0x00e41f0d, size: 36 bytes, params: 2, frame: 11
|
|
if (activity_instances != null) {
|
|
activity_instances.forEach(function({location, application_id, launch_id, composite_instance_id,
|
|
participants}) {
|
|
updateEmbeddedActivities({location: location, applicationId: application_id, launchId: launch_id,
|
|
compositeInstanceId: composite_instance_id, participants: participants.map(_fun15874)});
|
|
});
|
|
}
|
|
function _fun15873({location, application_id, launch_id, composite_instance_id, participants}) { // fn#15873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:5090, offset: 0x00e41f31, size: 90 bytes, params: 2, frame: 15
|
|
const updateEmbeddedActivitiesBinding = updateEmbeddedActivities;
|
|
const object = {location: location, applicationId: application_id, launchId: launch_id,
|
|
compositeInstanceId: composite_instance_id};
|
|
object.participants = participants.map(function(a0) {
|
|
return {userId: a0.user_id, sessionId: a0.session_id, nonce: a0.nonce};
|
|
});
|
|
updateEmbeddedActivitiesBinding(object);
|
|
}
|
|
|
|
}
|
|
|
|
function disconnectEmbeddedActivity({applicationId}) { // fn#15875, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:5349, offset: 0x00e41fb2, size: 75 bytes, params: 2, frame: 12
|
|
env0_20.delete(applicationId);
|
|
const ComponentDispatch = (ComponentDispatchUtilsModule).ComponentDispatch;
|
|
const dispatch = ComponentDispatch.dispatch;
|
|
const RELEASE_ACTIVITY_WEB_VIEW = ComponentActions.RELEASE_ACTIVITY_WEB_VIEW;
|
|
Reflect.apply(dispatch, ComponentDispatch, [RELEASE_ACTIVITY_WEB_VIEW]);
|
|
}
|
|
|
|
function handleEmbeddedActivityLaunchEnd({applicationId, channelId}) { // fn#15876, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:5480, offset: 0x00e41ffd, size: 44 bytes, params: 2, frame: 15
|
|
env0_25.delete(getLaunchStatesKey(channelId, applicationId));
|
|
}
|
|
|
|
function _fun15878(a0) { // fn#15878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:5639, offset: 0x00e4204d, size: 759 bytes, params: 2, frame: 16
|
|
const EmbeddedActivitiesStoreClass2 = EmbeddedActivitiesStoreClass;
|
|
Inherits(EmbeddedActivitiesStoreClass2, a0);
|
|
return CreateClass(EmbeddedActivitiesStoreClass2, [{key: 'initialize', value: function(a0) {
|
|
var r4;
|
|
var object;
|
|
var authenticationStoreBinding = AuthenticationStore;
|
|
var channelStoreBinding = ChannelStore;
|
|
var selectedChannelStoreBinding = SelectedChannelStore;
|
|
this.waitFor(authenticationStoreBinding, channelStoreBinding, selectedChannelStoreBinding, UserStore);
|
|
var Set = global.Set;
|
|
var value2 = undefined;
|
|
r4 = a0 == null ? value2 : a0.everLaunchedActivities;
|
|
r4 = r4 ?? [];
|
|
var value3 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
var value4 = new Set();
|
|
if (a0 != null) {
|
|
object = {};
|
|
copyDataProperties(object, a0, selectedChannelStoreBinding);
|
|
object['everLaunchedActivities'] = value4 instanceof Object ? value4 : value3;
|
|
env1_17 = object;
|
|
}
|
|
return value2;
|
|
}}, {key: 'getState', value: value_15881}, {key: 'getSelfEmbeddedActivityForChannel', value: value_15882},
|
|
{key: 'getSelfEmbeddedActivityForLocation', value: value_15884}, {key: 'getSelfEmbeddedActivities',
|
|
value: value_15886}, {key: 'getEmbeddedActivitiesForGuild', value: value_15887},
|
|
{key: 'getEmbeddedActivitiesForChannel', value: value_15888}, {key: 'getEmbeddedActivitiesForLocation',
|
|
value: value_15889}, {key: 'getEmbeddedActivitiesForStartingChannel', value: value_15890},
|
|
{key: 'getEmbeddedActivitiesByChannel', value: value_15891}, {key: 'getEmbeddedActivityDurationMs',
|
|
value: value_15892}, {key: 'isLaunchingActivity', value: value_15893}, {key: 'getShelfActivities',
|
|
value: value_15894}, {key: 'getShelfFetchStatus', value: value_15895}, {key: 'shouldFetchShelf',
|
|
value: value_15896}, {key: 'getOrientationLockStateForApp', value: value_15897},
|
|
{key: 'getPipOrientationLockStateForApp', value: value_15898}, {key: 'getGridOrientationLockStateForApp',
|
|
value: value_15899}, {key: 'getLayoutModeForApp', value: value_15900}, {key: 'getConnectedActivityChannelId',
|
|
value: value_15901}, {key: 'getConnectedActivityLocation', value: value_15902}, {key: 'getActivityPanelMode',
|
|
value: function() {
|
|
return DISCONNECTED;
|
|
}}, {key: 'getFocusedLayout', value: function() {
|
|
return RESIZABLE;
|
|
}}, {key: 'getCurrentEmbeddedActivity', value: function() {
|
|
var value = this.getConnectedActivityLocation();
|
|
value = this.getSelfEmbeddedActivityForLocation(value);
|
|
return value ?? undefined;
|
|
}}, {key: 'isProxyTicketRefreshing', value: value_15906}, {key: 'getEmbeddedActivityForUserId', value: value_15907},
|
|
{key: 'hasActivityEverBeenLaunched', value: value_15908}, {key: 'getLaunchState', value: value_15909},
|
|
{key: 'getLaunchStates', value: value_15910}, {key: 'getActivityPopoutWindowLayout', value: function() {
|
|
return NORMAL;
|
|
}}]);
|
|
function EmbeddedActivitiesStoreClass() { // fn#15879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:5651, offset: 0x00e42344, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_4(this, EmbeddedActivitiesStoreClass);
|
|
const value3 = env1_7(EmbeddedActivitiesStoreClass);
|
|
return env1_6(this, _isNativeReflectConstruct_15854() ? global.Reflect.construct(value3, arguments,
|
|
env1_7(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_15881() { // fn#15881, offset: 0x00e07553, size: 9 bytes, params: 1, frame: 1
|
|
return env1_17;
|
|
}
|
|
|
|
function value_15882(a0) { // fn#15882, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:6277, offset: 0x00e42434, size: 87 bytes, params: 2, frame: 15
|
|
var environment;
|
|
var r0;
|
|
var Array;
|
|
var from;
|
|
var value2;
|
|
var binding;
|
|
var value4;
|
|
const env0_0 = a0;
|
|
const value = null;
|
|
if (value == a0) {
|
|
r0 = value;
|
|
} else {
|
|
Array = global.Array;
|
|
from = Array.from;
|
|
value2 = environment.__proto__;
|
|
binding = env1_20;
|
|
value4 = Reflect.apply(from, Array, [binding.values()]).find(_fun15883);
|
|
r0 = value != value4 ? value4 : value;
|
|
}
|
|
return r0;
|
|
function _fun15883({location}) { // fn#15883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:6387, offset: 0x00e4248b, size: 57 bytes, params: 2, frame: 11
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(3774) /* metro dependency 3774: embeddedActivityLocationUtils */;
|
|
value = value.getEmbeddedActivityLocationChannelId(location);
|
|
return value === env0_0;
|
|
}
|
|
|
|
}
|
|
|
|
function value_15884(a0) { // fn#15884, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:6513, offset: 0x00e424c4, size: 87 bytes, params: 2, frame: 15
|
|
var environment;
|
|
var r0;
|
|
var Array;
|
|
var from;
|
|
var value2;
|
|
var binding;
|
|
var value4;
|
|
const env0_0 = a0;
|
|
const value = null;
|
|
if (value == a0) {
|
|
r0 = value;
|
|
} else {
|
|
Array = global.Array;
|
|
from = Array.from;
|
|
value2 = environment.__proto__;
|
|
binding = env1_20;
|
|
value4 = Reflect.apply(from, Array, [binding.values()]).find(_fun15885);
|
|
r0 = value != value4 ? value4 : value;
|
|
}
|
|
return r0;
|
|
function _fun15885({location}) { // fn#15885, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:6624, offset: 0x00e4251b, size: 31 bytes, params: 2, frame: 2
|
|
return location.id === env0_0.id;
|
|
}
|
|
|
|
}
|
|
|
|
function value_15886() { // fn#15886, offset: 0x00e4253a, size: 9 bytes, params: 1, frame: 1
|
|
return env1_20;
|
|
}
|
|
|
|
function value_15887(a0) { // fn#15887, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:6790, offset: 0x00e42543, size: 32 bytes, params: 2, frame: 12
|
|
return env1_21.get(a0) ?? env1_18;
|
|
}
|
|
|
|
function value_15888(a0) { // fn#15888, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:6915, offset: 0x00e42563, size: 32 bytes, params: 2, frame: 12
|
|
return env1_22.get(a0) ?? env1_18;
|
|
}
|
|
|
|
function value_15889({id}) { // fn#15889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:7043, offset: 0x00e42583, size: 37 bytes, params: 2, frame: 12
|
|
return env1_24.get(id) ?? env1_18;
|
|
}
|
|
|
|
function value_15890(a0) { // fn#15890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:7182, offset: 0x00e425a8, size: 32 bytes, params: 2, frame: 12
|
|
return env1_23.get(a0) ?? env1_18;
|
|
}
|
|
|
|
function value_15891() { // fn#15891, offset: 0x00e425c8, size: 9 bytes, params: 1, frame: 1
|
|
return env1_22;
|
|
}
|
|
|
|
function value_15892(a0, a1) { // fn#15892, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:7412, offset: 0x00e425d1, size: 67 bytes, params: 3, frame: 15
|
|
let value = environment.__proto__;
|
|
value = env1_33.get(getActivityKey(a0, a1));
|
|
const value2 = null;
|
|
return value2 == value ? value2 : global.Date.now() - value;
|
|
}
|
|
|
|
function value_15893() { // fn#15893, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:7557, offset: 0x00e42614, size: 20 bytes, params: 1, frame: 2
|
|
return env1_25.size > 0;
|
|
}
|
|
|
|
function value_15894(a0) { // fn#15894, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:7638, offset: 0x00e42628, size: 43 bytes, params: 2, frame: 12
|
|
return env1_27.get(getNormalizedGuildId(a0)) ?? env1_19;
|
|
}
|
|
|
|
function value_15895(a0) { // fn#15895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:7766, offset: 0x00e42653, size: 33 bytes, params: 2, frame: 12
|
|
return env1_28.get(getNormalizedGuildId(a0));
|
|
}
|
|
|
|
function value_15896(a0) { // fn#15896, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:7876, offset: 0x00e42674, size: 131 bytes, params: 2, frame: 14
|
|
let value = environment.__proto__;
|
|
const getNormalizedGuildIdBinding = getNormalizedGuildId;
|
|
const value2 = undefined;
|
|
const r2 = env1_28.get(getNormalizedGuildIdBinding(a0)) ?? ({isFetching: false});
|
|
const Date = global.Date;
|
|
value = Date.now();
|
|
value = value - ((r2 == null ? value2 : r2.lastFetchTimestampMs) ?? 0) > 21600000;
|
|
let r0 = r2 != null && r2.isFetching;
|
|
r0 = !r0 && value;
|
|
return r0;
|
|
}
|
|
|
|
function value_15897(a0) { // fn#15897, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:8130, offset: 0x00e426f7, size: 22 bytes, params: 2, frame: 11
|
|
return env1_29.get(a0);
|
|
}
|
|
|
|
function value_15898(a0) { // fn#15898, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:8236, offset: 0x00e4270d, size: 42 bytes, params: 2, frame: 12
|
|
const value = environment.__proto__;
|
|
return env1_30.get(a0) ?? this.getOrientationLockStateForApp(a0);
|
|
}
|
|
|
|
function value_15899(a0) { // fn#15899, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:8402, offset: 0x00e42737, size: 60 bytes, params: 2, frame: 14
|
|
const value = environment.__proto__;
|
|
let r0 = env1_31.get(a0) ?? env1_30.get(a0);
|
|
r0 = r0 ?? this.getOrientationLockStateForApp(a0);
|
|
return r0;
|
|
}
|
|
|
|
function value_15900(a0) { // fn#15900, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:8578, offset: 0x00e42773, size: 22 bytes, params: 2, frame: 11
|
|
return env1_32.get(a0);
|
|
}
|
|
|
|
function value_15901() { // fn#15901, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:8671, offset: 0x00e42789, size: 56 bytes, params: 1, frame: 12
|
|
if (env1_34 != null) {
|
|
return (require(3774) /* metro dependency 3774: embeddedActivityLocationUtils */).getEmbeddedActivityLocationChannelId(env1_34);
|
|
}
|
|
}
|
|
|
|
function value_15902() { // fn#15902, offset: 0x00df3b9e, size: 9 bytes, params: 1, frame: 1
|
|
return env1_34;
|
|
}
|
|
|
|
function value_15906(a0) { // fn#15906, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:9251, offset: 0x00e427fb, size: 22 bytes, params: 2, frame: 11
|
|
return env1_26.has(a0);
|
|
}
|
|
|
|
function value_15907(a0, a1) { // fn#15907, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:9347, offset: 0x00e42811, size: 174 bytes, params: 3, frame: 25
|
|
var r3;
|
|
var r12;
|
|
var r0;
|
|
var value2;
|
|
var value3;
|
|
var value4;
|
|
var done;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var value8;
|
|
var value9;
|
|
var applicationId;
|
|
var userIds;
|
|
var has;
|
|
var value10;
|
|
var value11;
|
|
const value = undefined;
|
|
if (value !== a1) {
|
|
value2 = environment.__proto__;
|
|
value3 = _createForOfIteratorHelperLoose_15851(env1_24);
|
|
value4 = value3();
|
|
done = value4.done;
|
|
if (done) {
|
|
r0 = value;
|
|
} else {
|
|
r3 = value4;
|
|
reducibleLoop3: while (true) {
|
|
value5 = r3.value;
|
|
value6 = env1_3(value5, 2);
|
|
value6[0];
|
|
value7 = _createForOfIteratorHelperLoose_15851(value6[1]);
|
|
value8 = value7();
|
|
done = value8.done;
|
|
if (!done) {
|
|
r12 = value8;
|
|
reducibleLoop4: while (true) {
|
|
value9 = r12.value;
|
|
applicationId = value9.applicationId;
|
|
if (applicationId === a1) {
|
|
userIds = value9.userIds;
|
|
has = userIds.has;
|
|
reducibleJoin6: while (true) {
|
|
if (Reflect.apply(has, userIds, [a0])) {
|
|
r0 = value9;
|
|
break reducibleLoop3;
|
|
}
|
|
break reducibleJoin6;
|
|
}
|
|
}
|
|
value10 = value7();
|
|
done = value10.done;
|
|
if (done) {
|
|
value11 = value3();
|
|
done = value11.done;
|
|
if (done) {
|
|
r0 = value;
|
|
break reducibleLoop3;
|
|
}
|
|
r3 = value11;
|
|
continue reducibleLoop3;
|
|
}
|
|
r12 = value10;
|
|
continue reducibleLoop4;
|
|
}
|
|
}
|
|
value11 = value3();
|
|
done = value11.done;
|
|
if (done) {
|
|
r0 = value;
|
|
break reducibleLoop3;
|
|
}
|
|
r3 = value11;
|
|
continue reducibleLoop3;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function value_15908(a0) { // fn#15908, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:9696, offset: 0x00e428bf, size: 28 bytes, params: 2, frame: 11
|
|
return env1_17.everLaunchedActivities.has(a0);
|
|
}
|
|
|
|
function value_15909(a0, a1) { // fn#15909, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:9805, offset: 0x00e428db, size: 59 bytes, params: 3, frame: 16
|
|
var value3;
|
|
var binding;
|
|
const value = a1;
|
|
const value2 = null;
|
|
if (value2 != a0) {
|
|
value3 = environment.__proto__;
|
|
binding = env1_25;
|
|
return binding.get(getLaunchStatesKey(value2 != value ? value : value2, a0));
|
|
}
|
|
}
|
|
|
|
function value_15910() { // fn#15910, offset: 0x00df3ad6, size: 9 bytes, params: 1, frame: 1
|
|
return env1_25;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun15919(a0) { // fn#15919, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:10685, offset: 0x00e42a2d, size: 118 bytes, params: 2, frame: 15
|
|
var r5;
|
|
var surfacesToShowNewActivityIndicator;
|
|
const Set = global.Set;
|
|
a0.surfacesToShowNewActivityIndicator = new Set();
|
|
if (a0.shouldShowNewActivityIndicator) {
|
|
surfacesToShowNewActivityIndicator = a0.surfacesToShowNewActivityIndicator;
|
|
surfacesToShowNewActivityIndicator.add((require(1909) /* metro dependency 1909: Server */).EmbeddedActivitySurfaces.VOICE_LAUNCHER);
|
|
r5 = require;
|
|
}
|
|
delete a0.shouldShowNewActivityIndicator;
|
|
const object = {};
|
|
copyDataProperties(object, a0, r5);
|
|
return object;
|
|
}
|
|
|
|
function ACTIVITY_LAYOUT_MODE_UPDATE({applicationId, layoutMode}) { // fn#15922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:11091, offset: 0x00e42add, size: 36 bytes, params: 2, frame: 13
|
|
env0_32.set(applicationId, layoutMode);
|
|
}
|
|
|
|
function CONNECTION_OPEN_SUPPLEMENTAL({guilds}) { // fn#15923, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:11204, offset: 0x00e42b01, size: 178 bytes, params: 2, frame: 13
|
|
var r2;
|
|
var value3;
|
|
let binding = env0_22;
|
|
binding.clear();
|
|
env0_21.clear();
|
|
env0_24.clear();
|
|
env0_23.clear();
|
|
guilds.forEach(function(a0) {
|
|
updateEmbeddedActivitiesForGuild(a0);
|
|
});
|
|
const env0_0 = AuthenticationStore.getId();
|
|
const CONNECTION_OPEN_SUPPLEMENTAL_loop2 = CONNECTION_OPEN_SUPPLEMENTAL_loop;
|
|
const Array = global.Array;
|
|
const from = Array.from;
|
|
binding = env0_20;
|
|
const value = Reflect.apply(from, Array, [binding.values()]);
|
|
let length = value.length;
|
|
if (0 < length) {
|
|
for (r2 = 0; true; r2 = value3) {
|
|
CONNECTION_OPEN_SUPPLEMENTAL_loop2(value[r2]);
|
|
value3 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
length = value.length;
|
|
if (!(value3 < length)) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
function CONNECTION_OPEN_SUPPLEMENTAL_loop(a0) { // fn#15925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:11364, owner: CONNECTION_OPEN_SUPPLEMENTAL._loop, offset: 0x00e42bc6, size: 68 bytes, params: 2, frame: 14
|
|
const env0_0 = a0;
|
|
const embeddedActivitiesForLocation = env1_38.getEmbeddedActivitiesForLocation(a0.location);
|
|
if (!embeddedActivitiesForLocation.some(_fun15926)) {
|
|
disconnectEmbeddedActivity(a0);
|
|
}
|
|
function _fun15926(a0) { // fn#15926, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:11429, offset: 0x00e42c0a, size: 75 bytes, params: 2, frame: 12
|
|
var userIds;
|
|
var has;
|
|
const applicationId = a0.applicationId;
|
|
var value;
|
|
let r0 = applicationId === env0_0.applicationId && a0.launchId === env0_0.launchId;
|
|
if (r0) {
|
|
userIds = a0.userIds;
|
|
has = userIds.has;
|
|
value = environment.__proto__;
|
|
value = Reflect.apply(has, userIds, [env1_0]);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function CHANNEL_DELETE({channel}) { // fn#15928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:11705, offset: 0x00e42c6d, size: 179 bytes, params: 2, frame: 18
|
|
let binding = env0_22;
|
|
const r5 = binding.get(channel.id) ?? [];
|
|
binding = env0_22;
|
|
binding.set(channel.id, []);
|
|
const normalizedGuildId = getNormalizedGuildId(channel.guild_id);
|
|
env0_21.set(normalizedGuildId, (env0_21.get(normalizedGuildId) ?? []).filter(_fun15929));
|
|
r5.forEach(_fun15930);
|
|
binding = env0_23;
|
|
binding.set(channel.id, []);
|
|
function _fun15929({location}) { // fn#15929, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:11874, offset: 0x00e42d20, size: 62 bytes, params: 2, frame: 11
|
|
let value = environment.__proto__;
|
|
value = require(3774) /* metro dependency 3774: embeddedActivityLocationUtils */;
|
|
value = value.getEmbeddedActivityLocationChannelId(location);
|
|
return value !== channel.id;
|
|
}
|
|
|
|
function _fun15930({location}) { // fn#15930, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:11967, offset: 0x00e42d5e, size: 34 bytes, params: 2, frame: 11
|
|
env1_24.delete(location.id);
|
|
}
|
|
|
|
}
|
|
|
|
function EMBEDDED_ACTIVITY_LAUNCH_START({applicationId, componentId, commandOrigin, launchParams, channelId, inviterUserId}) { // fn#15931, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:12045, offset: 0x00e42d80, size: 155 bytes, params: 2, frame: 20
|
|
const binding = env0_25;
|
|
binding.set(getLaunchStatesKey(channelId, applicationId), {isLaunching: true, componentId: componentId,
|
|
inviterUserId: inviterUserId, launchParams: launchParams});
|
|
const CommandOrigin = (ApplicationCommandTypesModule).CommandOrigin;
|
|
const APP_DMS_ENTRY_POINT_COMMAND_BUTTON = CommandOrigin.APP_DMS_ENTRY_POINT_COMMAND_BUTTON;
|
|
env0_36 = commandOrigin === APP_DMS_ENTRY_POINT_COMMAND_BUTTON ? FocusedActivityLayouts.NO_CHAT : FocusedActivityLayouts.RESIZABLE;
|
|
}
|
|
|
|
function EMBEDDED_ACTIVITY_LAUNCH_SET_PROXY_TICKET({applicationId, channelId, proxyTicket}) { // fn#15932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:12403, offset: 0x00e42e1b, size: 92 bytes, params: 2, frame: 16
|
|
var set;
|
|
var object;
|
|
const launchStatesKey = getLaunchStatesKey(channelId, applicationId);
|
|
let binding = env0_25;
|
|
const value3 = binding.get(launchStatesKey);
|
|
if (value3 != null) {
|
|
binding = env0_25;
|
|
set = binding.set;
|
|
object = {};
|
|
copyDataProperties(object, value3, proxyTicket);
|
|
object['proxyTicket'] = proxyTicket;
|
|
Reflect.apply(set, binding, [launchStatesKey, object]);
|
|
}
|
|
}
|
|
|
|
function EMBEDDED_ACTIVITY_UPDATE_CONNECTED_PROXY_TICKET({applicationId, proxyTicket}) { // fn#15933, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:12629, offset: 0x00e42e77, size: 81 bytes, params: 2, frame: 15
|
|
let binding = env0_20;
|
|
const value2 = binding.get(applicationId);
|
|
if (value2 == null) {
|
|
return false;
|
|
}
|
|
binding = env0_20;
|
|
const set = binding.set;
|
|
const object = {};
|
|
copyDataProperties(object, value2, proxyTicket);
|
|
object['proxyTicket'] = proxyTicket;
|
|
Reflect.apply(set, binding, [applicationId, object]);
|
|
}
|
|
|
|
function EMBEDDED_ACTIVITY_SET_PROXY_TICKET_REFRESHING({applicationId, refreshing}) { // fn#15934, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:12832, offset: 0x00e42ec8, size: 50 bytes, params: 2, frame: 11
|
|
const binding = env0_26;
|
|
if (refreshing) {
|
|
binding.add(applicationId);
|
|
} else {
|
|
binding.delete(applicationId);
|
|
}
|
|
}
|
|
|
|
function EMBEDDED_ACTIVITY_LAUNCH_SUCCESS({applicationId}) { // fn#15935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:12977, offset: 0x00e42efa, size: 35 bytes, params: 2, frame: 11
|
|
env0_17.everLaunchedActivities.add(applicationId);
|
|
}
|
|
|
|
function EMBEDDED_ACTIVITY_LAUNCH_FAIL({applicationId, channelId}) { // fn#15936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:13104, offset: 0x00e42f1d, size: 53 bytes, params: 2, frame: 14
|
|
handleEmbeddedActivityLaunchEnd({applicationId: applicationId, channelId: channelId});
|
|
env0_26.delete(applicationId);
|
|
}
|
|
|
|
function EMBEDDED_ACTIVITY_LAUNCH_CANCEL({applicationId, channelId}) { // fn#15937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:13285, offset: 0x00e42f1d, size: 53 bytes, params: 2, frame: 14
|
|
handleEmbeddedActivityLaunchEnd({applicationId: applicationId, channelId: channelId});
|
|
env0_26.delete(applicationId);
|
|
}
|
|
|
|
function EMBEDDED_ACTIVITY_CLOSE({applicationId}) { // fn#15938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:13460, offset: 0x00e42f52, size: 90 bytes, params: 2, frame: 14
|
|
const value2 = env0_20.get(applicationId);
|
|
env0_20.delete(applicationId);
|
|
if ((value2 == null ? undefined : value2.location.id) !== env0_34?.id) {
|
|
}
|
|
}
|
|
|
|
function EMBEDDED_ACTIVITY_UPDATE_V2({applicationId, launchId, compositeInstanceId, location, participants}) { // fn#15940, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:13748, offset: 0x00e42fc0, size: 178 bytes, params: 2, frame: 23
|
|
const value5 = env0_25.get(getLaunchStatesKey((require(3774) /* metro dependency 3774: embeddedActivityLocationUtils */).getEmbeddedActivityLocationChannelId(location) ?? null,
|
|
applicationId));
|
|
const updateEmbeddedActivitiesBinding = updateEmbeddedActivities;
|
|
const object = {location: location, applicationId: applicationId, launchId: launchId,
|
|
compositeInstanceId: compositeInstanceId};
|
|
object.participants = participants.map(function(a0) {
|
|
return {userId: a0.user_id, sessionId: a0.session_id, nonce: a0.nonce};
|
|
});
|
|
object.proxyTicket = value5?.proxyTicket;
|
|
updateEmbeddedActivitiesBinding(object);
|
|
}
|
|
|
|
function LOCAL_ACTIVITY_UPDATE({activity}) { // fn#15942, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:14203, offset: 0x00e43072, size: 100 bytes, params: 2, frame: 16
|
|
if (activity == null) {
|
|
return false;
|
|
}
|
|
let binding = env0_20;
|
|
const get = binding.get;
|
|
const application_id = activity.application_id;
|
|
const value2 = application_id != null;
|
|
const value4 = Reflect.apply(get, binding, [value2 ? application_id : '']);
|
|
if (value4 == null) {
|
|
return false;
|
|
}
|
|
binding = env0_20;
|
|
const set = binding.set;
|
|
const applicationId = value4.applicationId;
|
|
const object = {};
|
|
copyDataProperties(object, value4, value2);
|
|
Reflect.apply(set, binding, [applicationId, object]);
|
|
}
|
|
|
|
function EMBEDDED_ACTIVITY_SET_CONFIG({applicationId, config}) { // fn#15943, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:14403, offset: 0x00e430d6, size: 82 bytes, params: 2, frame: 15
|
|
var set;
|
|
var object;
|
|
let binding = env0_20;
|
|
const value2 = binding.get(applicationId);
|
|
if (value2 != null) {
|
|
binding = env0_20;
|
|
set = binding.set;
|
|
applicationId = value2.applicationId;
|
|
object = {};
|
|
copyDataProperties(object, value2, config);
|
|
object['config'] = config;
|
|
Reflect.apply(set, binding, [applicationId, object]);
|
|
}
|
|
}
|
|
|
|
function EMBEDDED_ACTIVITY_FETCH_SHELF({guildId}) { // fn#15944, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:14570, offset: 0x00e43128, size: 143 bytes, params: 2, frame: 18
|
|
const normalizedGuildId = getNormalizedGuildId(guildId);
|
|
let binding = env0_28;
|
|
binding.set(normalizedGuildId, {isFetching: true,
|
|
lastFetchTimestampMs: binding.get(normalizedGuildId)?.lastFetchTimestampMs});
|
|
binding = env0_17;
|
|
const Date = global.Date;
|
|
const Date2 = global.Date;
|
|
const value = Date2.now();
|
|
const value5 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
const date = new Date(value);
|
|
binding.lastCheckedForBadgeableActivities = (date instanceof Object ? date : value5).toISOString();
|
|
}
|
|
|
|
function EMBEDDED_ACTIVITY_FETCH_SHELF_SUCCESS({guildId, activities}) { // fn#15945, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:14860, offset: 0x00e431b7, size: 114 bytes, params: 2, frame: 16
|
|
const normalizedGuildId = getNormalizedGuildId(guildId);
|
|
let binding = env0_27;
|
|
binding.set(normalizedGuildId, activities);
|
|
const Date = global.Date;
|
|
const value3 = Date.now();
|
|
handleShowingNewActivityIndicator({activities: activities, now: value3});
|
|
binding = env0_28;
|
|
binding.set(normalizedGuildId, {isFetching: false, lastFetchTimestampMs: value3});
|
|
function handleShowingNewActivityIndicator({activities, now}) { // fn#15946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:14994, owner: EMBEDDED_ACTIVITY_FETCH_SHELF_SUCCESS.handleShowingNewActivityIndicator, offset: 0x00e43229, size: 111 bytes, params: 2, frame: 17
|
|
const defaultImport = GetPlatform;
|
|
const getOS = PlatformUtilsModule.getOS;
|
|
const env0_1 = defaultImport(Reflect.apply(getOS, PlatformUtilsModule, []));
|
|
env1_17.dateRangesForSurfaces = activities.reduce(_fun15947, {});
|
|
function _fun15947(a0, {client_platform_config}) { // fn#15947, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:15105, offset: 0x00e43298, size: 282 bytes, params: 3, frame: 16
|
|
var environment;
|
|
var Object;
|
|
var values;
|
|
const env0_0 = a0;
|
|
var value;
|
|
const property = client_platform_config[env0_1];
|
|
let label_from = property.label_from;
|
|
if (label_from != null) {
|
|
var label_until = property.label_until;
|
|
if (label_until == null) {
|
|
return a0;
|
|
}
|
|
var object = {};
|
|
label_from = property.label_from;
|
|
object.fromDate = label_from;
|
|
label_until = property.label_until;
|
|
object.untilDate = label_until;
|
|
var Date = global.Date;
|
|
label_from = property.label_from;
|
|
var prototype = Date.prototype;
|
|
var value2 = Object.create(prototype, {constructor: {value: Date}});
|
|
var date = new Date(label_from);
|
|
var time = (date instanceof Object ? date : value2).getTime();
|
|
Date = global.Date;
|
|
label_until = property.label_until;
|
|
prototype = Date.prototype;
|
|
var value5 = Object.create(prototype, {constructor: {value: Date}});
|
|
date = new Date(label_until);
|
|
if (!(time > now || (date instanceof Object ? date : value5).getTime() < now)) {
|
|
Object = global.Object;
|
|
values = Object.values;
|
|
value = environment.__proto__.__proto__;
|
|
value = Reflect.apply(values, Object,
|
|
[(require(1909) /* metro dependency 1909: Server */).EmbeddedActivitySurfaces]);
|
|
value = value.filter(_fun15948);
|
|
value.forEach(_fun15949);
|
|
}
|
|
}
|
|
return a0;
|
|
function _fun15948(a0) { // fn#15948, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:15399, offset: 0x00e433b2, size: 31 bytes, params: 2, frame: 11
|
|
const omit_badge_from_surfaces = env0_1.omit_badge_from_surfaces;
|
|
return !omit_badge_from_surfaces.includes(a0);
|
|
}
|
|
|
|
function _fun15949(a0) { // fn#15949, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:15453, offset: 0x00e433d1, size: 94 bytes, params: 2, frame: 14
|
|
var r1;
|
|
var Date;
|
|
var fromDate;
|
|
var value3;
|
|
var date;
|
|
const property = env0_0[a0];
|
|
const value2 = property == null;
|
|
if (value2) {
|
|
r1 = value2;
|
|
} else {
|
|
Date = global.Date;
|
|
fromDate = property.fromDate;
|
|
value3 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
r1 = (date instanceof Object ? date : value3).getTime() < Module00057;
|
|
}
|
|
if (r1) {
|
|
env0_0[a0] = env0_2;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function EMBEDDED_ACTIVITY_FETCH_SHELF_FAIL({guildId}) { // fn#15950, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:15666, offset: 0x00e4342f, size: 80 bytes, params: 2, frame: 17
|
|
const normalizedGuildId = getNormalizedGuildId(guildId);
|
|
const binding = env0_28;
|
|
binding.set(normalizedGuildId, {isFetching: false,
|
|
lastFetchTimestampMs: binding.get(normalizedGuildId)?.lastFetchTimestampMs});
|
|
}
|
|
|
|
function EMBEDDED_ACTIVITY_SET_ORIENTATION_LOCK_STATE({applicationId, lockState, pictureInPictureLockState, gridLockState}) { // fn#15951, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:15896, offset: 0x00e4347f, size: 167 bytes, params: 2, frame: 16
|
|
if (lockState == null) {
|
|
env0_29.delete(applicationId);
|
|
} else {
|
|
env0_29.set(applicationId, lockState);
|
|
}
|
|
if (pictureInPictureLockState === null) {
|
|
env0_30.delete(applicationId);
|
|
} else if (pictureInPictureLockState !== undefined) {
|
|
env0_30.set(applicationId, pictureInPictureLockState);
|
|
}
|
|
if (gridLockState === null) {
|
|
env0_31.delete(applicationId);
|
|
} else if (gridLockState !== undefined) {
|
|
env0_31.set(applicationId, gridLockState);
|
|
}
|
|
}
|
|
|
|
function CHANNEL_SELECT({channelId}) { // fn#15954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:16332, offset: 0x00e4354e, size: 111 bytes, params: 2, frame: 14
|
|
var r0;
|
|
var embeddedActivityLocationChannelId;
|
|
var PIP;
|
|
if (env0_34 != null) {
|
|
embeddedActivityLocationChannelId = (require(3774) /* metro dependency 3774: embeddedActivityLocationUtils */).getEmbeddedActivityLocationChannelId(env0_34);
|
|
r0 = embeddedActivityLocationChannelId != null && embeddedActivityLocationChannelId !== channelId;
|
|
r0 = r0 && DISCONNECTED === ActivityPanelModes.PANEL;
|
|
if (r0) {
|
|
PIP = ActivityPanelModes.PIP;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun15861(a0) { // fn#15861, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:2286, offset: 0x00e41b6e, size: 10 bytes, params: 2, frame: 1
|
|
return a0.userId;
|
|
}
|
|
|
|
function _fun15874({user_id, session_id, nonce}) { // fn#15874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1505:5281, offset: 0x00e41f8b, size: 39 bytes, params: 2, frame: 3
|
|
return {userId: user_id, sessionId: session_id, nonce: nonce};
|
|
}
|
|
|
|
global.__d(_fun15850, 1378, [57, 6, 7, 15, 17, 18, 1226, 1379, 1934, 1878, 4237, 8044, 661, 8067, 3774, 12711, 1239,
|
|
8110, 694, 8102, 8049, 477, 1909, 5068, 566,
|
|
2]) /* metro module 1378, dependencies: [57, 6, 7, 15, 17, 18, 1226, 1379, 1934, 1878, 4237, 8044, 661, 8067, 3774, 12711, 1239, 8110, 694, 8102, 8049, 477, 1909, 5068, 566, 2] */;
|