Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

+122
View File
@@ -0,0 +1,122 @@
/* Metro module 4135; source: modules/rpc/Constants.tsx; dependencies: [2] */
function _fun34336(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#34336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4306:6, offset: 0x01053020, size: 986 bytes, params: 8, frame: 21
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const object = {APPLICATION_NOT_FOUND: 101};
object[101] = 'APPLICATION_NOT_FOUND';
object.DISK_LOW = 2022;
object[2022] = 'DISK_LOW';
object.DISK_PERMISSION_DENIED = 2025;
object[2025] = 'DISK_PERMISSION_DENIED';
object.POST_INSTALL_FAILED = 2025;
object[2025] = 'POST_INSTALL_FAILED';
object.REDISTRIBUTABLE_INSTALL_FAILED = 2026;
object[2026] = 'REDISTRIBUTABLE_INSTALL_FAILED';
object.APPLICATION_LOAD_FAILED = 2034;
object[2034] = 'APPLICATION_LOAD_FAILED';
object.DESERIALIZATION_FAILED = 2047;
object[2047] = 'DESERIALIZATION_FAILED';
object.INTERRUPTED = 2055;
object[2055] = 'INTERRUPTED';
object.MAX_REQUEST_RETRIES_EXCEEDED = 2058;
object[2058] = 'MAX_REQUEST_RETRIES_EXCEEDED';
object.AUTHENTICATION_FAILED = 2063;
object[2063] = 'AUTHENTICATION_FAILED';
object.IO_PERMISSION_DENIED = 2064;
object[2064] = 'IO_PERMISSION_DENIED';
object.NO_MANIFESTS = 2065;
object[2065] = 'NO_MANIFESTS';
object.POST_INSTALL_CANCELLED = 2066;
object[2066] = 'POST_INSTALL_CANCELLED';
object.API_ERROR = 2069;
object[2069] = 'API_ERROR';
object.FILE_NAME_TOO_LONG = 2072;
object[2072] = 'FILE_NAME_TOO_LONG';
object.NOT_ENTITLED = 2073;
object[2073] = 'NOT_ENTITLED';
object.APPLICATION_LOCK_FAILED = 2076;
object[2076] = 'APPLICATION_LOCK_FAILED';
object.NOT_DIRECTORY = 2077;
object[2077] = 'NOT_DIRECTORY';
object.INVALID_DRIVE = 2078;
object[2078] = 'INVALID_DRIVE';
object.DISK_FULL = 2080;
object[2080] = 'DISK_FULL';
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/Constants.tsx');
exports.RPC_SCOPE_CONFIG = {ANY: '$any', ALL: '$all'};
exports.RPC_PRIVATE_SCOPE = 'RPC_PRIVATE_SCOPE';
exports.RPC_PRIVATE_LIMITED_SCOPE = 'RPC_PRIVATE_LIMITED_SCOPE';
exports.RPC_LOCAL_SCOPE = 'RPC_LOCAL_SCOPE';
exports.RPC_AUTHENTICATED_SCOPE = 'RPC_AUTHENTICATED_SCOPE';
exports.RPC_EMBEDDED_APP_SCOPE = 'RPC_EMBEDDED_APP_SCOPE';
exports.RPCDeepLinks = {USER_SETTINGS: 'USER_SETTINGS', CHANGELOG: 'CHANGELOG', LIBRARY: 'LIBRARY',
STORE_HOME: 'STORE_HOME', STORE_LISTING: 'STORE_LISTING', CHANNEL: 'CHANNEL', GAME_SHOP: 'GAME_SHOP',
PICK_GUILD_SETTINGS: 'PICK_GUILD_SETTINGS', QUEST_HOME: 'QUEST_HOME',
DISCOVERY_GAME_RESULTS: 'DISCOVERY_GAME_RESULTS', OAUTH2: 'OAUTH2', FEATURES: 'FEATURES', SHOP: 'SHOP',
ACTIVITIES: 'ACTIVITIES', QUEST_PREVIEW_TOOL: 'QUEST_PREVIEW_TOOL', ONE_TIME_LOGIN: 'ONE_TIME_LOGIN',
PLAYGROUND: 'PLAYGROUND'};
exports.DynamicLinkType = {SETTINGS: 'settings', CHANGELOG: 'changelog', LIBRARY: 'library', STORE: 'store',
INVITE: 'invite', CHANNEL: 'channel', GUILD_SETTINGS: 'guild_settings', QUEST_HOME: 'quest_home',
DISCOVERY_GAME: 'discovery_game', SHOP: 'shop', ACTIVITIES: 'activities',
QUEST_PREVIEW_TOOL: 'quest_preview_tool', PLAYGROUND: 'playground'};
exports.getDynamicLinkType = getDynamicLinkType;
exports.DispatchErrorCodes = object;
exports.TransportTypes = {IPC: 'ipc', WEBSOCKET: 'ws', HTTP: 'http', POST_MESSAGE: 'post_message'};
}
function getDynamicLinkType(a0) { // fn#34337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4306:2504, offset: 0x010533fa, size: 358 bytes, params: 2, frame: 3
const USER_SETTINGS = env0_0.USER_SETTINGS;
if (USER_SETTINGS === a0) {
return env0_1.SETTINGS;
}
const CHANGELOG = env0_0.CHANGELOG;
if (CHANGELOG === a0) {
return env0_1.CHANGELOG;
}
const LIBRARY = env0_0.LIBRARY;
if (LIBRARY === a0) {
return env0_1.LIBRARY;
}
const STORE_HOME = env0_0.STORE_HOME;
if (STORE_HOME === a0) {
return env0_1.STORE;
}
const STORE_LISTING = env0_0.STORE_LISTING;
if (STORE_LISTING === a0) {
return env0_1.STORE;
}
const CHANNEL = env0_0.CHANNEL;
if (CHANNEL === a0) {
return env0_1.CHANNEL;
}
const PICK_GUILD_SETTINGS = env0_0.PICK_GUILD_SETTINGS;
if (PICK_GUILD_SETTINGS === a0) {
return env0_1.GUILD_SETTINGS;
}
const QUEST_HOME = env0_0.QUEST_HOME;
if (QUEST_HOME === a0) {
return env0_1.QUEST_HOME;
}
const QUEST_PREVIEW_TOOL = env0_0.QUEST_PREVIEW_TOOL;
if (QUEST_PREVIEW_TOOL === a0) {
return env0_1.QUEST_PREVIEW_TOOL;
}
const DISCOVERY_GAME_RESULTS = env0_0.DISCOVERY_GAME_RESULTS;
if (DISCOVERY_GAME_RESULTS === a0) {
return env0_1.DISCOVERY_GAME;
}
const SHOP = env0_0.SHOP;
if (SHOP === a0) {
return env0_1.SHOP;
}
const ACTIVITIES = env0_0.ACTIVITIES;
if (ACTIVITIES === a0) {
return env0_1.ACTIVITIES;
}
const PLAYGROUND = env0_0.PLAYGROUND;
if (PLAYGROUND === a0) {
return env0_1.PLAYGROUND;
}
return a0;
}
+9
View File
@@ -0,0 +1,9 @@
/* Metro module 8076; source: modules/rpc/RPCError.tsx; dependencies: [2, 8077] */
function _fun64107(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#64107, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8254:6, offset: 0x01b9be81, size: 96 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/RPCError.tsx');
const RPCError = (require(8077) /* metro dependency 8077: RPCError */).RPCError;
exports.default = RPCError;
}
+658
View File
@@ -0,0 +1,658 @@
/* Metro module 8081; source: modules/rpc/RPCHelpers.tsx; dependencies: [5, 4234, 4235, 1383, 1885, 1379, 1867, 4259, 4814, 4396, 1878, 4297, 4135, 661, 1471, 4100, 672, 22, 7067, 6622, 4634, 8082, 4617, 1473, 4122, 507, 8076, 8067, 8083, 2] */
function _fun64757(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#64757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:6, offset: 0x01bb43b5, size: 1047 bytes, params: 8, frame: 31
var value7;
var property2;
var regexp;
var RegExp;
const env0_0 = require;
const closure = function(a0) {
var r0;
var protocol;
var host;
var value2;
var value3;
var value = a0;
if (RegExp('^http', '').test(value)) {
r0 = value;
} else {
protocol = global.location.protocol;
host = global.location.host;
value2 = value.charAt(0);
value3 = '/';
value = '' + protocol + '//' + host + (value3 !== value2 ? value3 : '') + value;
r0 = value;
}
return r0;
};
const closure2 = function(a0) {
var value = a1;
return (value !== undefined ? value : []).indexOf(a0) > -1;
};
const closure3 = transformInternalTextMessage;
const closure4 = transformVoiceState;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = undefined;
const env0_3 = importDefault(5) /* metro dependency 5 */;
const applicationStore = importDefault(4234) /* metro dependency 4234: ApplicationStore */;
const applicationRecord = importDefault(4235) /* metro dependency 4235: ApplicationRecord */;
const env0_6 = (require(1383) /* metro dependency 1383: ChannelRecord */).GUILD_VOCAL_CHANNEL_TYPES;
const userRecord = importDefault(1885) /* metro dependency 1885: UserRecord */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const mediaEngineStore = importDefault(4259) /* metro dependency 4259: MediaEngineStore */;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
const presenceStore = importDefault(4396) /* metro dependency 4396: PresenceStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const voiceStateStore = importDefault(4297) /* metro dependency 4297: VoiceStateStore */;
const constantsModule = require(4135) /* metro dependency 4135: Constants */;
const env0_15 = constantsModule.RPC_LOCAL_SCOPE;
const env0_16 = constantsModule.TransportTypes;
const constantsModule2 = require(661) /* metro dependency 661: Constants */;
const env0_17 = constantsModule2.ActivityActionTypes;
const env0_18 = constantsModule2.ChannelTypes;
const env0_19 = constantsModule2.Endpoints;
const env0_20 = constantsModule2.MAX_MESSAGES_PER_CHANNEL;
const env0_21 = constantsModule2.RPCCloseCodes;
const env0_22 = constantsModule2.RPCErrors;
const env0_23 = constantsModule2.RTCConnectionStates;
const urlUtils = importDefault(1471) /* metro dependency 1471: URLUtils */;
const toURLSafe = urlUtils.toURLSafe;
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const API_ENDPOINT = GLOBAL_ENV.API_ENDPOINT;
const value5 = Reflect.apply(toURLSafe, urlUtils, [API_ENDPOINT]);
let r16 = (value5 == null ? value : value5.host) ?? 'localhost';
const property = r16.split(':')[0];
if (property.includes('.')) {
value7 = property.split('.');
property2 = value7[value7.length - 1];
regexp = RegExp('^\\d+$', '');
r16 = regexp.test(property2) ? property : value7.slice(-2).join('.');
} else {
r16 = property;
}
RegExp = global.RegExp;
const regExp = new RegExp('^' + (importDefault(4100) /* metro dependency 4100: RegexUtils */).escape('https://') + '(?:[a-z]+\\.)?(' + (importDefault(4100) /* metro dependency 4100: RegexUtils */).escape(r16) + '|discordapp.com|discord.com)$');
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
const MINUTE = Millis.MINUTE;
const value17 = 1 * MINUTE;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/RPCHelpers.tsx');
exports.VALIDATE_SOCKET_CALLS_PER_PERIOD_LOW = 2;
exports.VALIDATE_SOCKET_CALLS_PER_PERIOD_HIGH = 60;
exports.VALIDATE_SOCKET_PERIOD_MS = value17;
exports.VALIDATE_SOCKET_THROTTLERS = {};
exports.getRemoteIconURL = closure;
exports.containsSameValues = containsSameValues;
exports.validateOrigin = closure2;
exports.transformChannel = transformChannel;
exports.transformInternalTextMessage = closure3;
exports.transformVoiceState = closure4;
exports.transformBaseRelationship = function(a0, a1) {
var object = {type: a0};
object.user = importDefault(dependencyMap[21])(a1);
var object2 = {};
object2.status = PresenceStore.getStatus(a1.id, null);
object2.activity = null;
object.presence = object2;
return object;
};
exports.transformApplicationRelationship = transformApplicationRelationship;
exports.isMatchingOrigin = isMatchingOrigin;
exports.hasMessageReadPermission = hasMessageReadPermission;
exports.getVoiceConnectionState = function(a0) {
if (RTCConnectionStates.RTC_CONNECTED === a0) {
return a0.replace(RegExp('^RTC_', ''), 'VOICE_');
}
if (RTCConnectionStates.RTC_CONNECTING === a0) {
return a0.replace(RegExp('^RTC_', ''), 'VOICE_');
}
if (RTCConnectionStates.RTC_DISCONNECTED === a0) {
return a0.replace(RegExp('^RTC_', ''), 'VOICE_');
}
return a0;
};
exports.validateActivityInvite = validateActivityInvite;
exports.validateSocketApplication = function() {
return _validateSocketApplication.apply(this, arguments);
};
exports.processSocketThrottlers = function() {
return _processSocketThrottlers.apply(this, arguments);
};
exports.validateOriginAndUpdateSocket = validateOriginAndUpdateSocket;
exports.getDeprecatedVoiceSettingsWithShortcut = getDeprecatedVoiceSettingsWithShortcut;
exports.getVoiceSettingsWithShortcut = getVoiceSettingsWithShortcut;
exports.validatePostMessageTransport = validatePostMessageTransport;
exports.validateApplication = validateApplication;
return value;
}
function recurseReplaceContentTree(a0) { // fn#64758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:891, offset: 0x01bb47cc, size: 133 bytes, params: 2, frame: 12
if (a0.type === 'customEmoji') {
a0.type = 'emoji';
}
if (a0.type === 'emoji' && a0.src) {
a0.src = getRemoteIconURL(a0.src);
}
const Array = global.Array;
const isArray = Array.isArray;
let content = a0.content;
if (Reflect.apply(isArray, Array, [content])) {
content = a0.content;
a0.content = content.map(recurseReplaceContentTree);
}
return a0;
}
function transformInternalTextMessage(a0) { // fn#64761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:1294, offset: 0x01bb48f3, size: 466 bytes, params: 2, frame: 21
var object2;
var r4;
var userRecord;
const value2 = undefined;
const defaultImport = importDefault(6622) /* metro dependency 6622: MarkupUtils */;
const toAST = defaultImport.parseToAST(a0.content, true, {channelId: a0.channel_id});
const value3 = toAST.map(recurseReplaceContentTree);
const channel = ChannelStore.getChannel(a0.channel_id);
if (a0.author != null) {
userRecord = new UserRecord(a0.author);
} else {
r4 = value2;
}
const r7 = a0.author != null ? (require(4634) /* metro dependency 4634: useMessageAuthor */).getUserAuthor(r4,
channel) : value2;
object2 = {};
object2.id = a0.id;
object2.blocked = a0.blocked;
object2.bot = a0.bot;
object2.content = a0.content;
object2.content_parsed = value3.length ? value3 : value2;
object2.nick = r7 == null ? value2 : r7.nick;
object2.author_color = r7 == null ? value2 : r7.colorString;
object2.edited_timestamp = a0.edited_timestamp || a0.editedTimestamp;
object2.timestamp = a0.timestamp;
object2.tts = a0.tts;
object2.mentions = a0.mentions;
object2.mention_everyone = a0.mention_everyone || a0.mentionEveryone;
object2.mention_roles = a0.mention_roles || a0.mentionRoles;
object2.embeds = a0.embeds;
object2.attachments = a0.attachments;
object2.author = r4 != null ? (importDefault(8082) /* metro dependency 8082: transformUser */)(r4) : value2;
object2.pinned = a0.pinned;
object2.type = a0.type;
return object2;
}
function transformVoiceState(a0, a1, {mute, deaf, selfMute, selfDeaf, suppress, userId}) { // fn#64762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:2031, offset: 0x01bb4ac5, size: 299 bytes, params: 4, frame: 26
var Error;
var value;
const user = UserStore.getUser(userId);
if (user == null) {
Error = global.Error;
value = 'Invalid user id: ' + userId;
throw new Error();
}
const object2 = {};
object2.nick = (importDefault(4617) /* metro dependency 4617: NicknameUtils */).getName(a0, a1, user);
object2.mute = MediaEngineStore.isLocalMute(user.id);
object2.volume = MediaEngineStore.getLocalVolume(user.id);
object2.pan = MediaEngineStore.getLocalPan(user.id);
object2.voice_state = {mute: mute, deaf: deaf, self_mute: selfMute, self_deaf: selfDeaf, suppress: suppress};
object2.user = (importDefault(8082) /* metro dependency 8082: transformUser */)(user);
return object2;
}
function fetchApplicationRPC(a0) { // fn#64763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:2392, offset: 0x01bb4bf0, size: 103 bytes, params: 2, frame: 16
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
const get = HTTP.get;
const object2 = {'url': null, 'oldFormErrors': true, 'retries': 3, 'rejectWithError': true};
object2.url = Endpoints.APPLICATION_RPC(a0);
return Reflect.apply(get, HTTP, [object2]).then(function(a0) {
return a0.body;
}, _fun64765);
}
function _validateSocketApplication() { // fn#64766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:2627, offset: 0x01bb4ca0, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun64768).apply(this, arguments);
}
function _processSocketThrottlers() { // fn#64769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:3316, offset: 0x01bb4e9e, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun64771).apply(this, arguments);
}
function containsSameValues(a0, a1) { // fn#64772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:3881, offset: 0x01bb4fae, size: 84 bytes, params: 3, frame: 16
const value = importDefault(22) /* metro dependency 22 */;
const isEqual = value.isEqual;
const defaultImport = importDefault(22) /* metro dependency 22 */;
const pick = defaultImport.pick;
const Object = global.Object;
return Reflect.apply(isEqual, value, [a0, Reflect.apply(pick, defaultImport, [a1, Object.keys(a0)])]);
}
function transformChannel(a0, a1) { // fn#64773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:4029, offset: 0x01bb5002, size: 166 bytes, params: 3, frame: 16
const env0_0 = a0;
const env0_1 = a1;
const items3 = [];
const env0_2 = a0.getGuildId();
const GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
const items2 = [GUILD_CATEGORY];
arraySpread(items2, GUILD_VOCAL_CHANNEL_TYPES, 1, GUILD_CATEGORY);
if (!items2.includes(a0.type)) {
items3.push(new global.Promise(function(a0) {
var binding = a0;
MessageStore.whenReady(binding.id, _fun64775);
importDefault(dependencyMap[18]).fetchMessages({channelId: binding.id, limit: MAX_MESSAGES_PER_CHANNEL});
}));
}
const Promise = global.Promise;
return Promise.all(items3).then(_fun64776);
}
function transformApplicationRelationship(a0, a1) { // fn#64779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:4960, offset: 0x01bb529b, size: 106 bytes, params: 3, frame: 17
var r0;
var object3;
var object4;
let value = a0;
const value2 = null;
if (value2 == a1) {
r0 = value;
} else {
object3 = {};
copyDataProperties(object3, value, a1);
object4 = {};
copyDataProperties(object4, value.presence, a1);
value = PresenceStore.getApplicationActivity(value.user.id, a1);
object4['activity'] = value2 != value ? value : value2;
object3['presence'] = object4;
r0 = object3;
}
return r0;
}
function isMatchingOrigin(a0) { // fn#64780, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:5147, offset: 0x01bb5305, size: 237 bytes, params: 2, frame: 18
var r0;
var value;
var property;
var defaultImport;
var value2;
var hostname;
var value5;
var value6;
var error;
if (a0 == null) {
return false;
}
const origin = global.window.location.origin;
if (a0 === origin) {
return true;
}
try {
value = environment;
property = dependencyMap[23];
defaultImport = importDefault(property);
value2 = defaultImport.parse(a0);
hostname = value2.hostname;
} catch (error) {
return false;
}
let r1 = global.window.location.hostname === hostname && hostname === 'localhost';
if (r1) {
r0 = r1;
} else {
value5 = a0.match('staging') == null;
if (value5) {
value6 = env0_24.test(a0);
r1 = !(value6 ? !env0_24.test(origin) : !value6);
} else {
r1 = value5;
}
r0 = r1;
}
return r0;
}
function hasMessageReadPermission(a0, a1, a2) { // fn#64781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:5432, offset: 0x01bb53f2, size: 125 bytes, params: 4, frame: 14
var r0;
var value;
const getGuild = GuildStore.getGuild;
const getGuildId = a0.getGuildId;
const value2 = Reflect.apply(getGuild, GuildStore, [Reflect.apply(getGuildId, a0, [])]);
const value4 = (value2 != null ? value2.application_id : a0.getApplicationId()) === a1;
if (value4) {
r0 = value4;
} else {
value = a2.indexOf((require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes.MESSAGES_READ);
value = value > -1;
r0 = value;
}
return r0;
}
function validateActivityInvite(a0, a1, a2) { // fn#64783, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:5837, offset: 0x01bb54c2, size: 64 bytes, params: 4, frame: 5
var r1;
var r0;
const JOIN = ActivityActionTypes.JOIN;
const value = a0 === JOIN;
if (value) {
r1 = a1 != null && a1.id != null;
r1 = r1 && a2.join != null;
r0 = r1;
} else {
r0 = value;
}
return r0;
}
function validateOriginAndUpdateSocket(a0, a1) { // fn#64786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:6205, offset: 0x01bb5502, size: 43 bytes, params: 3, frame: 3
if (a1 == null) {
a0.authorization.scopes = [RPC_LOCAL_SCOPE];
}
}
function getDeprecatedVoiceSettingsWithShortcut(a0) { // fn#64787, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:6330, offset: 0x01bb552d, size: 296 bytes, params: 2, frame: 17
const settings = MediaEngineStore.getSettings();
const closure = function(a0) {
var Object = global.Object;
var value = Object.values(a0);
value = value.sort(_fun64789);
return value.map(_fun64790);
};
const value3 = a0(settings);
const object4 = {};
const object5 = {};
const getInputDevices = MediaEngineStore.getInputDevices;
object5.available_devices = closure(Reflect.apply(getInputDevices, MediaEngineStore, []));
object5.device_id = settings.inputDeviceId;
object5.volume = settings.inputVolume;
object4.input = object5;
const object6 = {};
const getOutputDevices = MediaEngineStore.getOutputDevices;
object6.available_devices = closure(Reflect.apply(getOutputDevices, MediaEngineStore, []));
object6.device_id = settings.outputDeviceId;
object6.volume = settings.outputVolume;
object4.output = object6;
object4.mode = {type: settings.mode, auto_threshold: settings.modeOptions.autoThreshold,
threshold: settings.modeOptions.threshold, shortcut: value3, delay: settings.modeOptions.delay};
object4.automatic_gain_control = settings.automaticGainControl;
object4.echo_cancellation = settings.echoCancellation;
object4.noise_suppression = settings.noiseSuppression;
object4.qos = settings.qos;
object4.silence_warning = settings.silenceWarning;
object4.deaf = settings.deaf;
object4.mute = settings.mute;
return object4;
}
function getVoiceSettingsWithShortcut(a0, a1) { // fn#64791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:7090, offset: 0x01bb56bc, size: 124 bytes, params: 3, frame: 13
const settings = MediaEngineStore.getSettings(a0);
const value2 = a1(settings);
const Object = global.Object;
return {input_mode: {type: settings.mode, shortcut: value2}, local_mutes: Object.keys(settings.localMutes),
local_volumes: settings.localVolumes, self_mute: settings.mute, self_deaf: settings.deaf};
}
function validatePostMessageTransport(a0) { // fn#64792, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:7341, offset: 0x01bb5738, size: 119 bytes, params: 2, frame: 15
var defaultImport;
var value;
const POST_MESSAGE = TransportTypes.POST_MESSAGE;
if (a0 !== POST_MESSAGE) {
defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_COMMAND;
value = 'command not available from "' + a0 + ' transport';
value = new defaultImport();
throw value;
}
}
function validateApplication(a0) { // fn#64793, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:7525, offset: 0x01bb57af, size: 94 bytes, params: 2, frame: 13
if (a0.id == null) {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_COMMAND},
'Invalid application');
}
return a0.id;
}
function _fun64765() { // fn#64765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:2546, offset: 0x01bb4c57, size: 73 bytes, params: 1, frame: 13
const value = environment.__proto__;
const defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
const INVALID_CLIENTID = RPCCloseCodes.INVALID_CLIENTID;
throw new defaultImport({closeCode: INVALID_CLIENTID}, 'Invalid Client ID');
}
function* _fun64768(a0, a1, a2) { // fn#64768, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:2702, offset: 0x01bb4cd9, size: 453 bytes, params: 4, frame: 21
var r3;
var createFromServer;
var value8;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_4;
const application = binding.getApplication(a1);
if (typeof a2 !== 'string') {
r3 = application;
if (r3 != null) {
a0.application = {id: r3.id, parentId: r3.parentId, name: r3.name, icon: r3.icon, coverImage: r3.coverImage,
flags: r3.flags};
return undefined;
}
binding = env2_5;
createFromServer = binding.createFromServer;
yield env2_32(a1);
value = undefined;
if (false) {
return value;
}
value = Reflect.apply(createFromServer, binding, [value]);
r3 = value;
a0.application = {id: r3.id, parentId: r3.parentId, name: r3.name, icon: r3.icon, coverImage: r3.coverImage,
flags: r3.flags};
return undefined;
}
const transport = a0.transport;
const POST_MESSAGE = env2_16.POST_MESSAGE;
if (transport === POST_MESSAGE) {
binding = env2_1;
value8 = binding(env2_2[27])(a1);
if (value8 == null) {
throw new env2_1(env2_2[26])({closeCode: env2_21.INVALID_ORIGIN}, 'Invalid Origin');
}
binding = env2_29;
if (binding(a2, [value8])) {
r3 = application;
if (r3 != null) {
a0.application = {id: r3.id, parentId: r3.parentId, name: r3.name, icon: r3.icon,
coverImage: r3.coverImage,
flags: r3.flags};
return undefined;
}
binding = env2_5;
createFromServer = binding.createFromServer;
yield env2_32(a1);
value = undefined;
if (false) {
return value;
}
value = Reflect.apply(createFromServer, binding, [value]);
r3 = value;
a0.application = {id: r3.id, parentId: r3.parentId, name: r3.name, icon: r3.icon, coverImage: r3.coverImage,
flags: r3.flags};
return undefined;
}
binding = env2_1;
throw new binding(env2_2[26])({closeCode: env2_21.INVALID_ORIGIN}, 'Invalid Origin');
}
yield env2_32(a1);
const value4 = undefined;
if (false) {
return value4;
}
const fromServer = env2_5.createFromServer(value4);
binding = env2_29;
if (binding(a2, value4.rpc_origins)) {
r3 = fromServer;
if (r3 != null) {
a0.application = {id: r3.id, parentId: r3.parentId, name: r3.name, icon: r3.icon, coverImage: r3.coverImage,
flags: r3.flags};
return undefined;
}
binding = env2_5;
createFromServer = binding.createFromServer;
yield env2_32(a1);
value = undefined;
if (false) {
return value;
}
value = Reflect.apply(createFromServer, binding, [value]);
r3 = value;
a0.application = {id: r3.id, parentId: r3.parentId, name: r3.name, icon: r3.icon, coverImage: r3.coverImage,
flags: r3.flags};
return undefined;
}
const value6 = env2_1(env2_2[26]);
const INVALID_ORIGIN = env2_21.INVALID_ORIGIN;
throw new value6({closeCode: INVALID_ORIGIN}, 'Invalid Origin');
}
function* _fun64771(a0, a1, a2) { // fn#64771, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:3387, offset: 0x01bb4ed7, size: 215 bytes, params: 4, frame: 19
var r9;
var r3;
var binding;
var value5;
var prototype;
var value6;
var value7;
var value8;
var process;
var value9;
var value10;
var value11;
var error;
var value12;
var object2;
var CLOSE_ABNORMAL;
var value13;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
const property = env2_26[a0];
if (property == null) {
r9 = a1 ? 2 : 60;
binding = env2_1;
value5 = binding(env2_2[28]);
binding = env2_25;
prototype = value5.prototype;
value6 = Object.create(prototype, {constructor: {value: value5}});
value7 = new value5();
value8 = value7 instanceof Object ? value7 : value6;
env2_26[a0] = value8;
r3 = value8;
} else {
r3 = property;
}
try {
process = r3.process;
} catch (error) {
binding = env2_1;
value12 = binding(env2_2[26]);
object2 = {};
CLOSE_ABNORMAL = env2_21.CLOSE_ABNORMAL;
object2.closeCode = CLOSE_ABNORMAL;
prototype = value12.prototype;
value = Object.create(prototype, {constructor: {value: value12}});
value13 = new value12(object2, 'Socket closed during throttle');
value = value13 instanceof Object ? value13 : value;
throw value;
}
try {
value9 = Reflect.apply(process, r3, [a2]);
} catch (error) {
binding = env2_1;
value12 = binding(env2_2[26]);
object2 = {};
CLOSE_ABNORMAL = env2_21.CLOSE_ABNORMAL;
object2.closeCode = CLOSE_ABNORMAL;
prototype = value12.prototype;
value = Object.create(prototype, {constructor: {value: value12}});
value13 = new value12(object2, 'Socket closed during throttle');
value = value13 instanceof Object ? value13 : value;
throw value;
}
yield value9;
try {
value10 = undefined;
value11 = false;
} catch (error) {
binding = env2_1;
value12 = binding(env2_2[26]);
object2 = {};
CLOSE_ABNORMAL = env2_21.CLOSE_ABNORMAL;
object2.closeCode = CLOSE_ABNORMAL;
prototype = value12.prototype;
value = Object.create(prototype, {constructor: {value: value12}});
value13 = new value12(object2, 'Socket closed during throttle');
value = value13 instanceof Object ? value13 : value;
throw value;
}
return value11 ? value10 : undefined;
}
function _fun64774(a0) { // fn#64774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:4154, offset: 0x01bb50a8, size: 99 bytes, params: 2, frame: 15
const env0_0 = a0;
const whenReady = MessageStore.whenReady;
const binding = env0_0;
Reflect.apply(whenReady, MessageStore, [binding.id, _fun64775]);
(importDefault(7067) /* metro dependency 7067: MessageActionCreators */).fetchMessages({channelId: binding.id,
limit: MAX_MESSAGES_PER_CHANNEL});
}
function _fun64776() { // fn#64776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:4261, offset: 0x01bb510b, size: 276 bytes, params: 1, frame: 16
var environment;
var r2;
var value2;
var value5;
var value7;
let binding = env0_0;
if (binding.isNSFW()) {
value2 = environment.__proto__;
if (UserStore.getCurrentUser()?.nsfwAllowed !== true) {
r2 = [];
} else if (require) {
value5 = environment.__proto__;
value7 = MessageStore.getMessages(env0_0.id).toArray();
r2 = value7.map(transformInternalTextMessage);
} else {
r2 = [];
}
} else if (require) {
value5 = environment.__proto__;
value7 = MessageStore.getMessages(env0_0.id).toArray();
r2 = value7.map(transformInternalTextMessage);
} else {
r2 = [];
}
const Object = global.Object;
const values = Object.values;
const getVoiceStatesForChannel = VoiceStateStore.getVoiceStatesForChannel;
binding = env0_0;
const value11 = Reflect.apply(values, Object, [Reflect.apply(getVoiceStatesForChannel, VoiceStateStore,
[binding.id])]).map(_fun64777);
const userLimit = binding.userLimit;
return {id: binding.id, name: binding.name, type: binding.type, topic: binding.topic, bitrate: binding.bitrate,
user_limit: userLimit, guild_id: env0_2, position: binding.position, messages: r2, voice_states: value11};
}
function formatDevices(a0) { // fn#64788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:6417, owner: getDeprecatedVoiceSettingsWithShortcut.formatDevices, offset: 0x01bb5655, size: 56 bytes, params: 2, frame: 12
const Object = global.Object;
let value = Object.values(a0);
value = value.sort(function({index}, a1) {
return index - a1.index;
});
return value.map(function(a0) {
return {id: a0.id, name: a0.name};
});
}
function _fun64777(a0) { // fn#64777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8266:4471, offset: 0x01bb521f, size: 37 bytes, params: 2, frame: 15
return transformVoiceState(env1_2, env1_0.id, a0);
}
+8
View File
@@ -0,0 +1,8 @@
/* Metro module 8075; source: modules/rpc/RPCOpcodes.tsx; dependencies: [2] */
function _fun64106(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#64106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8253:6, offset: 0x01b9be25, size: 92 bytes, params: 8, frame: 15
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/RPCOpcodes.tsx');
exports.default = {'HANDSHAKE': 0, 'FRAME': 1, 'CLOSE': 2, 'HELLO': 3};
}
+566
View File
@@ -0,0 +1,566 @@
/* Metro module 13070; source: modules/rpc/RPCServer.tsx; dependencies: [5, 6, 7, 4135, 661, 22, 8082, 8076, 13050, 683, 44, 672, 2] */
function _fun99799(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99799, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:6, offset: 0x021d61de, size: 242 bytes, params: 8, frame: 19
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(5) /* metro dependency 5 */;
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(7) /* metro dependency 7 */;
const env0_5 = (require(4135) /* metro dependency 4135: Constants */).TransportTypes;
let value = require(661) /* metro dependency 661: Constants */;
const env0_6 = value.AnalyticEvents;
const env0_7 = value.RPCCloseCodes;
const env0_8 = value.RPCCommands;
const env0_9 = value.RPCErrors;
const env0_10 = value.RPCEvents;
const env0_11 = [];
value = _fun99800();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/RPCServer.tsx');
exports.default = value;
}
function _fun99800() { // fn#99800, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:282, offset: 0x021d62d0, size: 529 bytes, params: 1, frame: 15
return env0_4(RPCServer, [{key: 'registerTransport', value: function(a0) {
var env0_0 = this;
a0.on('connect', _fun99806);
a0.on('request', _fun99807);
a0.on('disconnect', _fun99808);
}}, {key: 'handleConnect', value: value_99809}, {key: 'handleDisconnect', value: function(a0, a1) {
a0.abortController.abort('DISCONNECTED');
this.removeSubscriptions(a0);
this.sockets.delete(a0);
this.onDisconnect(a0, a1);
}}, {key: 'handleRequest', value: value_99811}, {key: 'setCommandHandler', value: function(a0, a1) {
this.commands[a0] = a1;
}}, {key: 'setEventHandler', value: function(a0, a1) {
this.events[a0] = a1;
}}, {key: 'dispatch', value: function(a0) {
var value = a1;
var value2 = a2;
var value3 = a3;
var value4 = a4;
a0.send({cmd: value2 !== undefined ? value2 : RPCCommands.DISPATCH, data: value4 !== undefined ? value4 : null,
evt: value3 !== undefined ? value3 : null, nonce: value !== undefined ? value : null});
}}, {key: 'error', value: value_99826}, {key: 'listenIsSubscribed', value: function(a0) {
var env0_0 = this;
var env0_1 = a0;
this.isSubscribedListeners.add(a0);
return _fun99828;
}}, {key: 'dispatchIsSubscribedUpdate', value: function() {
this.isSubscribedListeners.forEach(_fun99830);
}}, {key: 'isSubscribed', value: function(a0, a1) {
var env0_0 = a0;
var env0_1 = a1;
return this.subscriptions.find(_fun99832) !== undefined;
}}, {key: 'isChildSubscribed', value: function(a0, a1) {
var r0;
var env0_0 = a0;
var env0_1 = a1;
var value = a0 != null;
if (value) {
value = this.subscriptions.find(_fun99834);
value = value !== undefined;
r0 = value;
} else {
r0 = value;
}
return r0;
}}, {key: 'getSubscription', value: function(a0, a1, a2) {
var env0_0 = a0;
var env0_1 = a1;
var env0_2 = a2;
return this.subscriptions.find(_fun99836);
}}, {key: 'addSubscription', value: value_99837}, {key: 'removeSubscription', value: value_99838},
{key: 'removeSubscriptions', value: value_99840}, {key: 'dispatchToSubscriptions', value: value_99842},
{key: 'updateSubscriptions', value: function() {
this.subscriptions.forEach(_fun99845);
}}, {key: 'storeWait', value: value_99846}]);
}
function RPCServer(a0) { // fn#99801, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:303, offset: 0x021d64e1, size: 169 bytes, params: 2, frame: 14
var environment;
const value = environment.__proto__;
env1_3(this, RPCServer);
this.getCurrentUser = function() {
return null;
};
this.onConnect = function() {
};
this.onDisconnect = function() {
};
this.events = {};
this.commands = {};
let Set = global.Set;
this.sockets = new Set();
this.subscriptions = [];
Set = global.Set;
this.isSubscribedListeners = new Set();
this.getJoi = a0;
}
function value_99805(a0) { // fn#99805, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:577, offset: 0x021d658a, size: 85 bytes, params: 2, frame: 14
a0.on('connect', _fun99806);
a0.on('request', _fun99807);
a0.on('disconnect', _fun99808);
}
function value_99809(a0) { // fn#99809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:765, offset: 0x021d6630, size: 260 bytes, params: 2, frame: 20
this.sockets.add(a0);
this.onConnect(a0);
const object2 = {};
object2.v = a0.version;
let GLOBAL_ENV = global.window.GLOBAL_ENV;
const CDN_HOST = GLOBAL_ENV.CDN_HOST;
GLOBAL_ENV = global.window.GLOBAL_ENV;
const API_ENDPOINT = GLOBAL_ENV.API_ENDPOINT;
object2.config = {cdn_host: CDN_HOST, api_endpoint: API_ENDPOINT, environment: 'production'};
const transport = a0.transport;
const IPC = TransportTypes.IPC;
if (transport !== IPC) {
this.dispatch(a0, null, RPCCommands.DISPATCH, RPCEvents.READY, object2);
} else {
var currentUser = this.getCurrentUser();
if (currentUser == null) {
a0.close(RPCCloseCodes.CLOSE_NORMAL, 'User logged out');
return undefined;
}
object2.user = (importDefault(8082) /* metro dependency 8082: transformUser */)(currentUser);
this.dispatch(a0, null, RPCCommands.DISPATCH, RPCEvents.READY, object2);
}
}
function value_99811(a0, a1) { // fn#99811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:1317, offset: 0x021d677f, size: 135 bytes, params: 3, frame: 12
const env0_1 = a0;
const env0_2 = a1;
let Promise = global.Promise;
let promise = new Promise(_fun99812);
promise = promise.then(function(a0) {
var env0_0 = a0;
var Promise = global.Promise;
var value = _fun99814();
var value2 = Object.create(Promise.prototype, {constructor: {value: Promise}});
value = new Promise(value);
return value instanceof Object ? value : value2;
});
promise = promise.then(_fun99819);
promise = promise.then(_fun99821);
promise.catch(_fun99822);
}
function value_99826(a0) { // fn#99826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:2851, offset: 0x021d6d3e, size: 172 bytes, params: 2, frame: 24
let value = a1;
const value2 = a2;
const value3 = a3;
const value4 = a4;
const r7 = value !== undefined ? value : null;
const r6 = value2 !== undefined ? value2 : RPCCommands.DISPATCH;
const r8 = value3 !== undefined ? value3 : RPCErrors.UNKNOWN_ERROR;
const r1 = value4 !== undefined ? value4 : 'Unknown Error';
value = environment.__proto__;
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const RPC_SERVER_ERROR_CAUGHT = AnalyticEvents.RPC_SERVER_ERROR_CAUGHT;
Reflect.apply(track, defaultImport, [RPC_SERVER_ERROR_CAUGHT, {command: r6, code: r8, message: r1}]);
const dispatch = this.dispatch;
const ERROR = RPCEvents.ERROR;
Reflect.apply(dispatch, this, [a0, r7, r6, ERROR, {code: r8, message: r1}]);
}
function value_99827(a0) { // fn#99827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:3072, offset: 0x021d6dea, size: 41 bytes, params: 2, frame: 12
const env0_1 = a0;
this.isSubscribedListeners.add(a0);
return _fun99828;
}
function value_99829() { // fn#99829, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:3210, offset: 0x021d6e32, size: 32 bytes, params: 1, frame: 11
this.isSubscribedListeners.forEach(function(a0) {
return a0();
});
}
function value_99831(a0, a1) { // fn#99831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:3294, offset: 0x021d6e52, size: 51 bytes, params: 3, frame: 11
const env0_0 = a0;
const env0_1 = a1;
return this.subscriptions.find(_fun99832) !== undefined;
}
function value_99833(a0, a1) { // fn#99833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:3426, offset: 0x021d6eb6, size: 60 bytes, params: 3, frame: 12
var r0;
const env0_0 = a0;
const env0_1 = a1;
let value = a0 != null;
if (value) {
value = this.subscriptions.find(_fun99834);
value = value !== undefined;
r0 = value;
} else {
r0 = value;
}
return r0;
}
function value_99835(a0, a1, a2) { // fn#99835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:3571, offset: 0x021d6f24, size: 52 bytes, params: 4, frame: 11
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
return this.subscriptions.find(_fun99836);
}
function value_99837(a0, a1, a2) { // fn#99837, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:3707, offset: 0x021d6fb1, size: 165 bytes, params: 4, frame: 25
var r8;
var subscriptions;
var push;
var object2;
let value = a3;
const r10 = value !== undefined ? value : null;
const dispatch = this.dispatch;
const bind = dispatch.bind;
value = environment.__proto__;
const DISPATCH = RPCCommands.DISPATCH;
const value2 = Reflect.apply(bind, dispatch, [this, a0, null, DISPATCH, a1]);
const getSubscription = this.getSubscription;
if (value == Reflect.apply(getSubscription, this, [a0, a1, a2])) {
subscriptions = this.subscriptions;
push = subscriptions.push;
object2 = {update: r10, dispatch: value2};
if (r10) {
value = r10({prevState: value, dispatch: value2});
r8 = value;
} else {
r8 = value;
}
object2.prevState = r8;
object2.socket = a0;
object2.evt = a1;
object2.args = a2;
Reflect.apply(push, subscriptions, [object2]);
this.dispatchIsSubscribedUpdate();
}
}
function value_99838(a0, a1, a2) { // fn#99838, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:4003, offset: 0x021d7056, size: 88 bytes, params: 4, frame: 15
var environment;
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
let value = environment.__proto__;
value = importDefault(22) /* metro dependency 22 */;
value.remove(this.subscriptions, _fun99839);
this.dispatchIsSubscribedUpdate();
}
function value_99840(a0) { // fn#99840, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:4181, offset: 0x021d70ae, size: 74 bytes, params: 2, frame: 15
var environment;
const env0_0 = a0;
let value = environment.__proto__;
value = importDefault(22) /* metro dependency 22 */;
value.remove(this.subscriptions, _fun99841);
this.dispatchIsSubscribedUpdate();
}
function value_99842(a0, a1, a2, a3) { // fn#99842, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:4320, offset: 0x021d710e, size: 143 bytes, params: 5, frame: 15
var environment;
var r3;
var binding;
var value2;
const env0_1 = a0;
const env0_2 = a1;
const env0_3 = a2;
let r2 = a3 != null && a3 !== '';
if (r2) {
value = environment.__proto__;
binding = env1_11;
value2 = binding.includes(a3);
if (value2) {
r3 = !!value2;
} else {
binding = env1_11;
binding.unshift(a3);
binding.splice(50);
r3 = false;
}
r2 = r3;
}
if (!r2) {
this.subscriptions.forEach(_fun99843);
}
}
function value_99844() { // fn#99844, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:4777, offset: 0x021d729d, size: 32 bytes, params: 1, frame: 11
this.subscriptions.forEach(function(a0) {
if (a0.update) {
a0.prevState = a0.update(a0);
}
});
}
function value_99846(a0, a1, a2) { // fn#99846, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:4884, offset: 0x021d72de, size: 167 bytes, params: 4, frame: 14
var environment;
const env0_1 = a0;
const env0_2 = a1;
const env0_3 = a2;
let value = a1();
if (value) {
return global.Promise.resolve(value);
}
if (a2 === 0) {
return global.Promise.resolve(value);
}
value = environment.__proto__;
const env0_4 = (importDefault(22) /* metro dependency 22 */).uniqueId();
const Promise = global.Promise;
return new Promise(_fun99848).then(function(a0) {
removeSubscription();
return a0;
});
}
function _fun99806(a0) { // fn#99806, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:605, offset: 0x021d65df, size: 25 bytes, params: 2, frame: 11
return env0_0.handleConnect(a0);
}
function _fun99807(a0, a1) { // fn#99807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:648, offset: 0x021d65f8, size: 29 bytes, params: 3, frame: 13
return env0_0.handleRequest(a0, a1);
}
function _fun99808(a0, a1) { // fn#99808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:700, offset: 0x021d6615, size: 27 bytes, params: 3, frame: 13
return env0_0.handleDisconnect(a0, a1);
}
function _fun99812(a0) { // fn#99812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:1355, offset: 0x021d6806, size: 522 bytes, params: 2, frame: 20
var object2;
var defaultImport2;
var track;
var RPC_COMMAND_SENT;
var binding;
var value6;
var defaultImport3;
var value;
if (require.nonce == null) {
value = environment.__proto__.__proto__;
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_PAYLOAD},
'Payload requires a nonce');
}
if (require.nonce === '') {
value = environment.__proto__.__proto__;
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_PAYLOAD},
'Payload requires a nonce');
}
const cmd = require.cmd;
const property = env0_0.commands[cmd];
if (property == null) {
value6 = environment.__proto__.__proto__;
defaultImport3 = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_COMMAND;
value = 'Invalid command: ' + require.cmd;
value = new defaultImport3();
throw value;
}
if ((importDefault(13050) /* metro dependency 13050: validateScope */)(env0_1.authorization.scopes,
property.scope)) {
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport2.track;
RPC_COMMAND_SENT = AnalyticEvents.RPC_COMMAND_SENT;
object2 = {command: cmd};
object2.scope = typeof property.scope === 'object' ? global.JSON.stringify(property.scope) : property.scope;
binding = env0_1;
object2.application_id = binding.application.id;
object2.socket_scope = binding.authorization.scopes.toString();
Reflect.apply(track, defaultImport2, [RPC_COMMAND_SENT, object2]);
a0(property);
return undefined;
}
value = importDefault(8076) /* metro dependency 8076: RPCError */;
const INVALID_PERMISSIONS = RPCErrors.INVALID_PERMISSIONS;
value = new value({errorCode: INVALID_PERMISSIONS}, 'Not authenticated or invalid scope');
throw value;
}
function _fun99813(a0) { // fn#99813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:1929, offset: 0x021d6a10, size: 52 bytes, params: 2, frame: 11
const env0_0 = a0;
const Promise = global.Promise;
const value = _fun99814();
const value2 = Object.create(Promise.prototype, {constructor: {value: Promise}});
const promise = new Promise(value);
return promise instanceof Object ? promise : value2;
}
function _fun99819(a0) { // fn#99819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:2294, offset: 0x021d6bb7, size: 130 bytes, params: 2, frame: 14
return a0.handler({socket: env0_1, server: env0_0, cmd: require.cmd, evt: require.evt, nonce: require.nonce,
args: require.args ?? ({}), isSocketConnected: isSocketConnected, signal: env0_1.abortController.signal});
}
function _fun99821(a0) { // fn#99821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:2489, offset: 0x021d6c56, size: 46 bytes, params: 2, frame: 19
const binding = env0_0;
return binding.dispatch(env0_1, require.nonce, require.cmd, null, a0);
}
function _fun99822({code, message}) { // fn#99822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:2539, offset: 0x021d6c84, size: 54 bytes, params: 2, frame: 19
const binding = env0_0;
return binding.error(env0_1, require.nonce, require.cmd, code, message);
}
function _fun99828() { // fn#99828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:3125, offset: 0x021d6e13, size: 31 bytes, params: 1, frame: 11
env0_0.isSubscribedListeners.delete(env0_1);
}
function _fun99832(a0) { // fn#99832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:3349, offset: 0x021d6e85, size: 49 bytes, params: 2, frame: 4
return a0.socket.application.id === env0_0 && a0.evt === require;
}
function _fun99834(a0) { // fn#99834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:3490, offset: 0x021d6ef2, size: 50 bytes, params: 2, frame: 4
return a0.socket.application.parentId === env0_0 && a0.evt === require;
}
function _fun99836(a0) { // fn#99836, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:3619, offset: 0x021d6f58, size: 89 bytes, params: 2, frame: 15
var value4;
var defaultImport;
let r0 = a0.socket === env0_0 && a0.evt === require;
if (r0) {
value4 = environment.__proto__.__proto__;
defaultImport = importDefault(22) /* metro dependency 22 */;
r0 = defaultImport.isEqual(a0.args, importDefault);
}
return r0;
}
function _fun99841({socket}) { // fn#99841, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:4229, offset: 0x021d70f8, size: 22 bytes, params: 2, frame: 2
return socket === env0_0;
}
function _fun99843(a0) { // fn#99843, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:4466, offset: 0x021d719d, size: 256 bytes, params: 2, frame: 25
var r2;
var r11;
var r4;
var value4;
var value5;
var defaultImport;
var isEqual;
var defaultImport2;
var pick;
var Object;
var binding;
var dispatch;
var socket;
var value7;
if (a0.evt === env0_1) {
r2 = typeof require === 'function' && !require(a0);
if (!r2) {
value4 = typeof require === 'object';
if (value4) {
r11 = a0.args ?? ({});
value5 = environment.__proto__.__proto__;
defaultImport = importDefault(22) /* metro dependency 22 */;
isEqual = defaultImport.isEqual;
defaultImport2 = importDefault(22) /* metro dependency 22 */;
pick = defaultImport2.pick;
Object = global.Object;
r4 = !Reflect.apply(isEqual, defaultImport, [require, Reflect.apply(pick, defaultImport2, [r11,
Object.keys(require)])]);
} else {
r4 = value4;
}
r2 = r4;
}
if (!r2) {
if (typeof importDefault === 'function') {
env0_3 = importDefault(a0);
}
binding = env0_0;
dispatch = binding.dispatch;
socket = a0.socket;
value7 = environment.__proto__.__proto__;
Reflect.apply(dispatch, binding, [socket, null, RPCCommands.DISPATCH, a0.evt, importDefault]);
}
}
}
function removeSubscription() { // fn#99847, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:4993, owner: value_99846.removeSubscription, offset: 0x021d7385, size: 43 bytes, params: 1, frame: 15
const binding = env0_0;
return binding.removeSubscription(env0_1, 'RPC_STORE_WAIT', {uniqueId: env0_4});
}
function _fun99848(a0, a1) { // fn#99848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:5059, offset: 0x021d73b0, size: 139 bytes, params: 3, frame: 18
const env0_0 = a0;
const env0_1 = a1;
const setTimeout = global.setTimeout;
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
const SECOND = Millis.SECOND;
const env0_2 = setTimeout(_fun99849, importDefault * SECOND);
const binding = env0_0;
binding.addSubscription(env0_1, 'RPC_STORE_WAIT', {uniqueId: env0_4}, _fun99850);
}
function _fun99814() { // fn#99814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:1944, offset: 0x021d6a44, size: 36 bytes, params: 1, frame: 12
const env0_0 = env3_2(_fun99816);
return _fun99818;
}
function isSocketConnected() { // fn#99820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:2422, offset: 0x021d6c39, size: 29 bytes, params: 1, frame: 11
return env1_0.sockets.has(env1_1);
}
function _fun99849() { // fn#99849, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:5085, offset: 0x021d743b, size: 59 bytes, params: 1, frame: 13
const value = environment.__proto__;
removeSubscription();
const Error = global.Error;
require(new Error('timeout'));
}
function _fun99850() { // fn#99850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:5203, offset: 0x021d7476, size: 47 bytes, params: 1, frame: 13
let value = environment.__proto__;
value = require();
if (value) {
global.clearTimeout(env0_2);
env0_0(value);
}
}
function* _fun99816(a0, a1) { // fn#99816, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:1964, offset: 0x021d6a73, size: 206 bytes, params: 3, frame: 20
var environment;
var value3;
var binding;
var value4;
var value6;
var value7;
if (true) {
var env0_0 = a0;
var env0_1 = a1;
value = environment.__proto__.__proto__;
if (env2_0.validation != null) {
value3 = environment.__proto__.__proto__.__proto__;
binding = env3_3;
yield binding.getJoi();
value4 = undefined;
if (false) {
return value4;
}
value6 = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
binding = env5_0;
value7 = binding(env5_1[10]);
binding = env2_0;
value7(binding.validation != null, 'command.validation must not be null');
value4.validate(env3_2.args, binding.validation(value4), {convert: false}, _fun99817);
} else {
a0(env2_0);
}
}
}
function _fun99817(a0) { // fn#99817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:2141, offset: 0x021d6b41, size: 118 bytes, params: 2, frame: 15
var value;
var binding;
var value2;
var message;
if (a0 == null) {
binding = env0_0;
value = environment.__proto__.__proto__.__proto__;
binding(env3_0);
} else {
value = environment.__proto__.__proto__.__proto__.__proto__.__proto__.__proto__;
value2 = env6_0(env6_1[7]);
({}).errorCode = env6_9.INVALID_PAYLOAD;
message = a0.message;
require(new value2());
}
}
@@ -0,0 +1,69 @@
/* Metro module 13014; source: modules/rpc/helpers/activityInstanceConnectedParticipants.tsx; dependencies: [1378, 1878, 4135, 3774, 4617, 8082, 1360, 22, 2] */
function _fun99364(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13204:6, offset: 0x021c5858, size: 214 bytes, params: 8, frame: 20
var object3;
const env0_0 = require;
const closure = activityInstanceConnectedParticipants;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const embeddedActivitiesStore = importDefault(1378) /* metro dependency 1378: EmbeddedActivitiesStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const {RPC_AUTHENTICATED_SCOPE, RPC_SCOPE_CONFIG} = require(4135) /* metro dependency 4135: Constants */;
object3 = {};
const ANY = RPC_SCOPE_CONFIG.ANY;
object3[ANY] = [RPC_AUTHENTICATED_SCOPE];
const object4 = {scope: object3, handler: function() {
return _fun99368;
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/helpers/activityInstanceConnectedParticipants.tsx');
exports.activityInstanceConnectedParticipants = closure;
exports.activityInstanceConnectedParticipantsScope = object3;
exports.activityInstanceConnectedParticipantsUpdateEvent = object4;
}
function activityInstanceConnectedParticipants() { // fn#99365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13204:175, offset: 0x021c592e, size: 181 bytes, params: 1, frame: 18
const currentEmbeddedActivity = EmbeddedActivitiesStore.getCurrentEmbeddedActivity();
if (currentEmbeddedActivity == null) {
return {participants: []};
}
const env0_0 = (require(3774) /* metro dependency 3774: embeddedActivityLocationUtils */).getEmbeddedActivityLocationGuildId(currentEmbeddedActivity.location);
const env0_1 = (require(3774) /* metro dependency 3774: embeddedActivityLocationUtils */).getEmbeddedActivityLocationChannelId(currentEmbeddedActivity.location);
const object2 = {};
const Array = global.Array;
const from = Array.from;
const userIds = currentEmbeddedActivity.userIds;
const value = Reflect.apply(from, Array, [userIds, _fun99366]);
object2.participants = value.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
return object2;
}
function handler() { // fn#99367, offset: 0x021c5a63, size: 11 bytes, params: 1, frame: 1
return _fun99368;
}
function _fun99366(a0) { // fn#99366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13204:458, offset: 0x021c59e3, size: 128 bytes, params: 2, frame: 19
var value3;
var moduleValue;
var value5;
var object2;
const user = UserStore.getUser(a0);
if (user != null) {
value3 = undefined;
moduleValue = require(4617) /* metro dependency 4617: NicknameUtils */;
value5 = moduleValue.getNickname(env0_0, env0_1, user);
object2 = {};
copyDataProperties(object2, (importDefault(8082) /* metro dependency 8082: transformUser */)(user), undefined);
object2['nickname'] = value5 ?? value3;
return object2;
}
}
function _fun99368({prevState, dispatch}) { // fn#99368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13204:651, offset: 0x021c5a6e, size: 69 bytes, params: 2, frame: 16
let value = environment.__proto__;
const value2 = activityInstanceConnectedParticipants();
value = importDefault(22) /* metro dependency 22 */;
if (!value.isEqual(value2, prevState)) {
dispatch(value2);
}
return value2;
}
@@ -0,0 +1,10 @@
/* Metro module 8079; source: modules/rpc/helpers/createRpcJoiSchemaObject.tsx; dependencies: [2] */
function _fun64746(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#64746, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8264:6, offset: 0x01bb40fe, size: 85 bytes, params: 8, frame: 15
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/helpers/createRpcJoiSchemaObject.tsx');
exports.default = function(a0) {
return a0.object().unknown(true);
};
}
@@ -0,0 +1,12 @@
/* Metro module 13018; source: modules/rpc/helpers/getCurrentEmbeddedActivityChannel.tsx; dependencies: [1378, 1379, 2] */
function _fun99377(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13208:6, offset: 0x021c61c9, size: 122 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const embeddedActivitiesStore = importDefault(1378) /* metro dependency 1378: EmbeddedActivitiesStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/helpers/getCurrentEmbeddedActivityChannel.tsx');
exports.default = function() {
return ChannelStore.getChannel(EmbeddedActivitiesStore.getConnectedActivityChannelId());
};
}
@@ -0,0 +1,14 @@
/* Metro module 6980; source: modules/rpc/helpers/getCurrentVoiceChannel.tsx; dependencies: [1226, 1379, 4297, 2] */
function _fun55360(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7158:6, offset: 0x013a46d7, size: 136 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const voiceStateStore = importDefault(4297) /* metro dependency 4297: VoiceStateStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/helpers/getCurrentVoiceChannel.tsx');
exports.default = function() {
return ChannelStore.getChannel(VoiceStateStore.getVoiceStateForSession(AuthenticationStore.getId(),
AuthenticationStore.getSessionId())?.channelId);
};
}
@@ -0,0 +1,83 @@
/* Metro module 8073; source: modules/rpc/helpers/stripSensitiveLoggingData.tsx; dependencies: [661, 2] */
function _fun64079(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#64079, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8251:6, offset: 0x01b9ab10, size: 107 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = (require(661) /* metro dependency 661: Constants */).RPCCommands;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/helpers/stripSensitiveLoggingData.tsx');
exports.default = stripSensitiveLoggingData;
}
function stripSensitiveLoggingData(a0) { // fn#64080, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8251:225, offset: 0x01b9ab7b, size: 310 bytes, params: 2, frame: 16
var r6;
var r3;
var cmd;
var object6;
var object7;
var object8;
var object9;
let object10 = {};
copyDataProperties(object10, a0, r6);
let value = typeof object10.args === 'object';
let r0 = value && typeof object10.cmd === 'string';
if (r0) {
cmd = object10.cmd;
if (RPCCommands.AUTHENTICATE === cmd) {
object7 = {};
copyDataProperties(object7, object10, r6);
object8 = {};
copyDataProperties(object8, object10.args, r6);
value = '<removed>';
object8['access_token'] = value;
object7['args'] = object8;
r0 = object7;
r6 = value;
} else if (RPCCommands.GET_PROVIDER_ACCESS_TOKEN === cmd) {
object7 = {};
copyDataProperties(object7, object10, r6);
object8 = {};
copyDataProperties(object8, object10.args, r6);
value = '<removed>';
object8['access_token'] = value;
object7['args'] = object8;
r0 = object7;
r6 = value;
} else {
object6 = {};
copyDataProperties(object6, object10, r6);
r0 = object6;
}
r3 = r0;
} else {
r3 = object10;
}
let r1 = typeof r3.data === 'object' && typeof r3.cmd === 'string';
if (r1) {
cmd = r3.cmd;
if (RPCCommands.AUTHENTICATE === cmd) {
object10 = {};
copyDataProperties(object10, r3, r6);
object9 = {};
copyDataProperties(object9, r3.data, r6);
object9['access_token'] = '<removed>';
object10['data'] = object9;
r1 = object10;
} else if (RPCCommands.GET_PROVIDER_ACCESS_TOKEN === cmd) {
object10 = {};
copyDataProperties(object10, r3, r6);
object9 = {};
copyDataProperties(object9, r3.data, r6);
object9['access_token'] = '<removed>';
object10['data'] = object9;
r1 = object10;
} else {
object10 = {};
copyDataProperties(object10, r3, r6);
r1 = object10;
}
r0 = r1;
} else {
r0 = r3;
}
return r0;
}
@@ -0,0 +1,10 @@
/* Metro module 13066; source: modules/rpc/helpers/transformApplication.tsx; dependencies: [2] */
function _fun99788(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13256:6, offset: 0x021d5df8, size: 87 bytes, params: 8, frame: 15
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/helpers/transformApplication.tsx');
exports.default = function(a0) {
return {name: a0.name, id: a0.id, icon: a0.icon, cover_image: a0.coverImage, type: a0.type};
};
}
@@ -0,0 +1,19 @@
/* Metro module 13065; source: modules/rpc/helpers/transformGuildMember.tsx; dependencies: [1857, 2] */
function _fun99786(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13255:6, offset: 0x021d5d0c, size: 96 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/helpers/transformGuildMember.tsx');
exports.default = transformGuildMember;
}
function transformGuildMember({userId, nick, guildId, avatar, avatarDecoration, banner, bio, pronouns, colorString}) { // fn#99787, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13255:180, offset: 0x021d5d6c, size: 140 bytes, params: 2, frame: 18
const object2 = {user_id: userId, nick: nick, guild_id: guildId, avatar: avatar};
object2.avatar_decoration_data = (require(1857) /* metro dependency 1857: AvatarDecorationUtils */).parseAvatarDecorationData(avatarDecoration);
object2.banner = banner;
object2.bio = bio;
object2.pronouns = pronouns;
object2.color_string = colorString;
return object2;
}
@@ -0,0 +1,18 @@
/* Metro module 8082; source: modules/rpc/helpers/transformUser.tsx; dependencies: [1857, 2] */
function _fun64794(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#64794, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8267:6, offset: 0x01bb580d, size: 94 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/helpers/transformUser.tsx');
exports.default = transformUser_64795;
}
function transformUser_64795({id, username, discriminator, globalName, avatar, avatarDecoration, bot, flags, premiumType}) { // fn#64795, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8267:173, offset: 0x01bb586b, size: 149 bytes, params: 2, frame: 18
const object2 = {id: id, username: username, discriminator: discriminator, global_name: globalName, avatar: avatar};
object2.avatar_decoration_data = (require(1857) /* metro dependency 1857: AvatarDecorationUtils */).parseAvatarDecorationData(avatarDecoration);
object2.bot = bot;
object2.flags = flags;
object2.premium_type = premiumType ?? 0;
return object2;
}
@@ -0,0 +1,29 @@
/* Metro module 13063; source: modules/rpc/helpers/unavailableCommand.tsx; dependencies: [661, 8076, 2] */
function _fun99731(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13253:6, offset: 0x021d44e3, size: 147 bytes, params: 8, frame: 18
var object3;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = (require(661) /* metro dependency 661: Constants */).RPCErrors;
object3 = {handler: handler_99732};
const object4 = {handler: handler_99733};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/helpers/unavailableCommand.tsx');
exports.unsupportedCommand = object3;
exports.deprecatedCommand = object4;
}
function handler_99732({cmd}) { // fn#99732, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13253:119, offset: 0x021d4576, size: 100 bytes, params: 2, frame: 14
const defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
const INVALID_COMMAND = RPCErrors.INVALID_COMMAND;
let value = 'Unsupported command: ' + cmd;
value = new defaultImport({errorCode: INVALID_COMMAND}, value);
throw value;
}
function handler_99733({cmd}) { // fn#99733, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13253:217, offset: 0x021d45da, size: 100 bytes, params: 2, frame: 14
const defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
const INVALID_COMMAND = RPCErrors.INVALID_COMMAND;
let value = 'Deprecated command: ' + cmd;
value = new defaultImport({errorCode: INVALID_COMMAND}, value);
throw value;
}
@@ -0,0 +1,48 @@
/* Metro module 13029; source: modules/rpc/helpers/validateOpenInviteDialog.tsx; dependencies: [8065, 1867, 3784, 661, 13018, 8076, 9050, 2] */
function _fun99460(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99460, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13219:6, offset: 0x021c99a9, size: 172 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const framesStore = importDefault(8065) /* metro dependency 8065: FramesStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const env0_6 = (require(661) /* metro dependency 661: Constants */).RPCErrors;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/helpers/validateOpenInviteDialog.tsx');
exports.validateOpenInviteDialog = validateOpenInviteDialog;
}
function validateOpenInviteDialog() { // fn#99461, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13219:255, offset: 0x021c9a55, size: 422 bytes, params: 1, frame: 20
var defaultImport2;
var value;
const connectedFrame = FramesStore.getConnectedFrame();
if (connectedFrame != null) {
return {frame: connectedFrame, channel: undefined, guild: undefined};
}
const value3 = (importDefault(13018) /* metro dependency 13018: getCurrentEmbeddedActivityChannel */)();
if (value3 == null) {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_CHANNEL},
'Invalid channel');
}
const getGuild = GuildStore.getGuild;
const getGuildId = value3.getGuildId;
const value4 = Reflect.apply(getGuild, GuildStore, [Reflect.apply(getGuildId, value3, [])]);
if (value4 == null) {
defaultImport2 = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_CHANNEL;
value = value3.getGuildId();
value = 'Invalid guild ' + value;
value = new defaultImport2();
throw value;
}
const canViewInviteModalModule = require(9050) /* metro dependency 9050: canViewInviteModal */;
if (canViewInviteModalModule.canViewInviteModal(PermissionStore, value4, value3)) {
return {frame: undefined, channel: value3, guild: value4};
}
const defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
const object2 = {};
const INVALID_PERMISSIONS = RPCErrors.INVALID_PERMISSIONS;
object2.errorCode = INVALID_PERMISSIONS;
value = 'No invite permissions for ' + value3.id;
throw new defaultImport();
}
@@ -0,0 +1,40 @@
/* Metro module 13050; source: modules/rpc/helpers/validateScope.tsx; dependencies: [4135, 2] */
function _fun99665(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99665, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13240:6, offset: 0x021d0aba, size: 109 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = (require(4135) /* metro dependency 4135: Constants */).RPC_SCOPE_CONFIG;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/helpers/validateScope.tsx');
exports.default = validateScope;
}
function validateScope(a0, a1) { // fn#99666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13240:204, offset: 0x021d0b27, size: 192 bytes, params: 3, frame: 17
var r0;
const env0_0 = a0;
if (a1 == null) {
return true;
}
let value = typeof a1;
if (value === 'string') {
return a0.includes(a1);
}
if (value !== 'object') {
return false;
}
const ANY = RPC_SCOPE_CONFIG.ANY;
const property = a1[ANY];
const ALL = RPC_SCOPE_CONFIG.ALL;
const property2 = a1[ALL];
const Array = global.Array;
value = Array.isArray(property);
const r5 = value ? !property.some(_fun99667) : !value;
value = !r5;
if (r5) {
value = global.Array.isArray(property2);
value = !(value ? !property2.every(_fun99668) : !value);
r0 = value;
} else {
r0 = value;
}
return r0;
}
@@ -0,0 +1,22 @@
/* Metro module 13044; source: modules/rpc/helpers/validateTransportType.tsx; dependencies: [4135, 661, 8076, 2] */
function _fun99606(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13234:6, offset: 0x021cef2d, size: 142 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = (require(4135) /* metro dependency 4135: Constants */).TransportTypes;
const env0_3 = (require(661) /* metro dependency 661: Constants */).RPCErrors;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/helpers/validateTransportType.tsx');
exports.validateTransportType = validateTransportType;
}
function validateTransportType(a0) { // fn#99607, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13234:244, offset: 0x021cefbb, size: 108 bytes, params: 2, frame: 13
const IPC = TransportTypes.IPC;
if (IPC !== a0) {
var POST_MESSAGE = TransportTypes.POST_MESSAGE;
if (POST_MESSAGE !== a0) {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_COMMAND},
'Invalid transport.');
}
}
}
@@ -0,0 +1,26 @@
/* Metro module 13015; source: modules/rpc/native/NativeRPCImplementation.tsx; dependencies: [13016, 13058, 13059, 13061, 13062, 13064, 13067, 13069, 8072, 2] */
function _fun99369(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13205:6, offset: 0x021c5ab3, size: 307 bytes, params: 8, frame: 19
var object4;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object4 = {};
copyDataProperties(object4,
(require(13016) /* metro dependency 13016: crossPlatformRPCCommands */).crossPlatformCommands, undefined);
copyDataProperties(object4, importDefault(13058) /* metro dependency 13058: activities */, undefined);
copyDataProperties(object4, importDefault(13059) /* metro dependency 13059: auth */, undefined);
copyDataProperties(object4, importDefault(13061) /* metro dependency 13061: voiceSettings */, undefined);
copyDataProperties(object4, importDefault(13062) /* metro dependency 13062: unsupported */, undefined);
const object5 = {};
copyDataProperties(object5, importDefault(13064) /* metro dependency 13064: crossPlatformRPCEventHandlers */,
undefined);
copyDataProperties(object5,
(require(13067) /* metro dependency 13067: voiceSettingsEventHandlers */).voiceSettingsEventHandlers, undefined);
const object6 = {server: importDefault(13069) /* metro dependency 13069: NativeRPCServer */, commands: object4,
events: object5, stores: []};
object6.transports = [importDefault(8072) /* metro dependency 8072: WebViewPostMessageTransport */];
object6.registerTransportsForEmbeddedPlatform = function() {
};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/native/NativeRPCImplementation.tsx');
exports.default = object6;
}
@@ -0,0 +1,14 @@
/* Metro module 13069; source: modules/rpc/native/NativeRPCServer.tsx; dependencies: [8078, 13070, 2] */
function _fun99797(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99797, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13259:6, offset: 0x021d612f, size: 131 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importDefault(13070) /* metro dependency 13070: RPCServer */;
value = new value(function() {
var Promise = global.Promise;
return Promise.resolve(require(dependencyMap[0]));
});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/native/NativeRPCServer.tsx');
exports.default = value;
}
@@ -0,0 +1,12 @@
/* Metro module 13067; source: modules/rpc/native/events/voiceSettingsEventHandlers.tsx; dependencies: [13068, 8080, 2] */
function _fun99790(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13257:6, offset: 0x021d5e85, size: 132 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importDefault(13068) /* metro dependency 13068: VoiceSettingsEventsFactory */;
const getDeprecatedVoiceSettings = (require(8080) /* metro dependency 8080: NativeRPCHelpers */).getDeprecatedVoiceSettings;
const getVoiceSettings = (require(8080) /* metro dependency 8080: NativeRPCHelpers */).getVoiceSettings;
value = value(getDeprecatedVoiceSettings, getVoiceSettings);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/native/events/voiceSettingsEventHandlers.tsx');
exports.voiceSettingsEventHandlers = value;
}
@@ -0,0 +1,53 @@
/* Metro module 8080; source: modules/rpc/native/server/NativeRPCHelpers.tsx; dependencies: [5, 4135, 661, 8081, 8076, 2] */
function _fun64748(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#64748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8265:6, offset: 0x01bb416f, size: 186 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const env0_4 = (require(4135) /* metro dependency 4135: Constants */).TransportTypes;
const env0_5 = (require(661) /* metro dependency 661: Constants */).RPCCloseCodes;
const value = _fun64749();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/native/server/NativeRPCHelpers.tsx');
exports.validateSocketClient = value;
exports.getDeprecatedVoiceSettings = getDeprecatedVoiceSettings;
exports.getVoiceSettings = getVoiceSettings;
}
function _fun64749() { // fn#64749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8265:157, offset: 0x01bb4229, size: 32 bytes, params: 1, frame: 12
const env0_0 = env0_3(_fun64751);
return _fun64752;
}
function getDeprecatedVoiceSettings() { // fn#64753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8265:682, offset: 0x01bb4357, size: 45 bytes, params: 1, frame: 11
return (require(8081) /* metro dependency 8081: RPCHelpers */).getDeprecatedVoiceSettingsWithShortcut(function() {
return [];
});
}
function getVoiceSettings(a0) { // fn#64755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8265:762, offset: 0x01bb4384, size: 49 bytes, params: 2, frame: 13
return (require(8081) /* metro dependency 8081: RPCHelpers */).getVoiceSettingsWithShortcut(a0, function() {
return '';
});
}
function* _fun64751(a0, a1, a2) { // fn#64751, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8265:177, offset: 0x01bb4252, size: 261 bytes, params: 4, frame: 22
var Promise;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
env2_0(env2_2[3]).validateOriginAndUpdateSocket(a0, a1);
if (a2 == null) {
Promise = global.Promise;
return Promise.reject(new env2_1(env2_2[4])({closeCode: env2_5.INVALID_CLIENTID}, 'No Client ID Specified'));
}
const transport = a0.transport;
const POST_MESSAGE = env2_4.POST_MESSAGE;
const value4 = env2_0(env2_2[3]);
yield value4.processSocketThrottlers(a2, transport !== POST_MESSAGE, a0.abortController.signal);
if (false) {
return undefined;
}
return env2_0(env2_2[3]).validateSocketApplication(a0, a2, a1);
}
@@ -0,0 +1,10 @@
/* Metro module 13012; source: modules/rpc/native/server/NativeRPCServerManager.tsx; dependencies: [13013, 13015, 2] */
function _fun99301(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13202:6, offset: 0x021c362f, size: 125 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importDefault(13013) /* metro dependency 13013: RPCServerManager */;
value = new value(importDefault(13015) /* metro dependency 13015: NativeRPCImplementation */);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/native/server/NativeRPCServerManager.tsx');
exports.default = value;
}
@@ -0,0 +1,152 @@
/* Metro module 13058; source: modules/rpc/native/server/commands/activities.tsx; dependencies: [5, 4135, 661, 4661, 4122, 13029, 8076, 9151, 13018, 4662, 4673, 7860, 4132, 2] */
function _fun99698(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99698, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13248:6, offset: 0x021d2019, size: 366 bytes, params: 8, frame: 27
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
let value = require(4135) /* metro dependency 4135: Constants */;
const RPC_AUTHENTICATED_SCOPE = value.RPC_AUTHENTICATED_SCOPE;
const RPC_LOCAL_SCOPE = value.RPC_LOCAL_SCOPE;
const RPC_SCOPE_CONFIG = value.RPC_SCOPE_CONFIG;
value = require(661) /* metro dependency 661: Constants */;
const env0_4 = value.InstantInviteSources;
const RPCCommands = value.RPCCommands;
const env0_5 = value.RPCErrors;
const env0_6 = (require(4661) /* metro dependency 4661: NativePermissionConstants */).NativePermissionTypes;
object2 = {};
const OPEN_INVITE_DIALOG = RPCCommands.OPEN_INVITE_DIALOG;
let ANY = RPC_SCOPE_CONFIG.ANY;
const OAuth2Scopes = (require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes;
let RPC = OAuth2Scopes.RPC;
object2[OPEN_INVITE_DIALOG] = {scope: {[ANY]: [RPC, RPC_LOCAL_SCOPE, RPC_AUTHENTICATED_SCOPE]},
handler: handler_99699};
const INITIATE_IMAGE_UPLOAD = RPCCommands.INITIATE_IMAGE_UPLOAD;
ANY = RPC_SCOPE_CONFIG.ANY;
RPC = OAuth2Scopes.RPC;
object2[INITIATE_IMAGE_UPLOAD] = {scope: {[ANY]: [RPC, RPC_LOCAL_SCOPE, RPC_AUTHENTICATED_SCOPE]},
handler: handler_99700};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/native/server/commands/activities.tsx');
exports.default = object2;
}
function handler_99699({socket}) { // fn#99699, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13248:356, offset: 0x021d2187, size: 206 bytes, params: 2, frame: 18
const value3 = (require(13029) /* metro dependency 13029: validateOpenInviteDialog */).validateOpenInviteDialog();
const channel = value3.channel;
if (value3.frame != null) {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.UNKNOWN_ERROR},
'Cannot support frames (yet)');
}
const instantInviteUtilsModule = require(9151) /* metro dependency 9151: InstantInviteUtils */;
const showInstantInviteActionSheet = instantInviteUtilsModule.showInstantInviteActionSheet;
const ACTIVITY_INVITE = InstantInviteSources.ACTIVITY_INVITE;
Reflect.apply(showInstantInviteActionSheet, instantInviteUtilsModule, [channel, {source: ACTIVITY_INVITE,
targetApplicationId: socket.application.id ?? undefined}]);
}
function handler_99700({socket}) { // fn#99700, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13248:733, offset: 0x021d2255, size: 42 bytes, params: 2, frame: 11
return env0_3(_fun99702)();
}
function* _fun99702() { // fn#99702, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13248:750, offset: 0x021d228a, size: 733 bytes, params: 1, frame: 23
var environment;
var object2;
var value11;
var value12;
var property;
var value14;
var uploadImageAttachment;
var value15;
var url;
var value17;
if (false) {
return undefined;
}
value = environment.__proto__;
const id2 = require.application.id;
if (id2 == null) {
value = environment.__proto__.__proto__;
throw new env2_1(env2_2[6])({errorCode: env2_5.INVALID_COMMAND}, 'No application.');
}
value = environment.__proto__.__proto__;
let binding = env2_1;
const value3 = undefined;
const value4 = binding(env2_2[8])();
const id = value4 == null ? value3 : value4.id;
if (id == null) {
throw new env2_1(env2_2[6])({errorCode: env2_5.UNKNOWN_ERROR}, 'Unable to find selected channel');
}
const value5 = env2_1(env2_2[9]);
const requestPermission = value5.requestPermission;
const PHOTOS = env2_6.PHOTOS;
yield Reflect.apply(requestPermission, value5, [PHOTOS]).catch(_fun99703);
const value7 = undefined;
if (false) {
return value7;
}
binding = env2_1;
const binding2 = env2_2;
if (value7) {
value11 = binding(binding2[10]);
yield value11.launchImageLibraryAsync({'mediaType': 'photo', 'includeBase64': false, 'selectionLimit': 1});
value12 = undefined;
if (false) {
return value12;
}
property = value12.assets[0];
if (property == null) {
throw new env2_1(env2_2[6])({errorCode: env2_5.UNKNOWN_ERROR}, 'No image selected');
}
binding = env2_0;
value14 = binding(env2_2[11]);
uploadImageAttachment = value14.uploadImageAttachment;
object2 = {};
object2.name = property.fileName;
object2.type = property.type;
object2.uri = property.uri;
yield Reflect.apply(uploadImageAttachment, value14, [id2, id, object2]);
value15 = undefined;
if (false) {
return value15;
}
if (value15 == null) {
value17 = env2_1(env2_2[6]);
object2 = {};
object2.errorCode = env2_5.UNKNOWN_ERROR;
value = global.JSON.stringify(value15);
value = new value17(object2, value);
throw value;
}
url = value15.url;
if (url == null) {
value17 = env2_1(env2_2[6]);
object2 = {};
object2.errorCode = env2_5.UNKNOWN_ERROR;
value = global.JSON.stringify(value15);
value = new value17(object2, value);
throw value;
}
binding = env2_1;
if (value15 instanceof binding(env2_2[12])) {
value17 = env2_1(env2_2[6]);
object2 = {};
object2.errorCode = env2_5.UNKNOWN_ERROR;
value = global.JSON.stringify(value15);
value = new value17(object2, value);
throw value;
}
url = value15.url;
return {image_url: url};
}
const value9 = binding(binding2[6]);
const UNKNOWN_ERROR = env2_5.UNKNOWN_ERROR;
throw new value9({errorCode: UNKNOWN_ERROR}, 'Missing photo permissions');
}
function _fun99703() { // fn#99703, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13248:1051, offset: 0x021d2567, size: 73 bytes, params: 1, frame: 13
const value = environment.__proto__.__proto__.__proto__;
const value2 = env3_1(env3_2[6]);
const UNKNOWN_ERROR = env3_5.UNKNOWN_ERROR;
throw new value2({errorCode: UNKNOWN_ERROR}, 'Failed requesting photo permissions');
}
@@ -0,0 +1,70 @@
/* Metro module 13059; source: modules/rpc/native/server/commands/auth.tsx; dependencies: [4234, 661, 8076, 7504, 1239, 13060, 2] */
function _fun99704(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99704, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13249:6, offset: 0x021d25b0, size: 185 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const applicationStore = importDefault(4234) /* metro dependency 4234: ApplicationStore */;
let value = require(661) /* metro dependency 661: Constants */;
const env0_4 = value.ComponentActions;
const env0_5 = value.ApplicationFlags;
const env0_6 = value.RPCErrors;
value = importDefault(13060) /* metro dependency 13060: AuthCommandsFactory */;
value = value(_fun99705, function() {
});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/native/server/commands/auth.tsx');
exports.default = value;
}
function _fun99705({clientId, authorizations, scopes, parsedPermissions, responseType, redirectUri, codeChallenge, codeChallengeMethod, state, guildId, channelId, prompt, disableGuildSelect, disclosures, integrationType}) { // fn#99705, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13249:187, offset: 0x021d2669, size: 189 bytes, params: 2, frame: 11
const Promise = global.Promise;
const value = Object.create(Promise.prototype, {constructor: {value: Promise}});
const promise = new Promise(_fun99706);
return promise instanceof Object ? promise : value;
}
function _fun99706(a0, a1) { // fn#99706, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13249:421, offset: 0x021d2726, size: 390 bytes, params: 3, frame: 19
const env0_0 = a0;
const env0_1 = a1;
const integrationTypeBinding = integrationType;
const value2 = undefined;
const r3 = integrationTypeBinding != null ? authorizations == null ? value2 : authorizations.get(integrationType) : value2;
const r9 = (r3 == null ? value2 : r3.application) ?? ApplicationStore.getApplication(clientId);
const object2 = {};
object2.clientId = clientId;
object2.scopes = scopes ?? [];
object2.responseType = responseType;
object2.redirectUri = redirectUri;
object2.codeChallenge = codeChallenge;
object2.codeChallengeMethod = codeChallengeMethod;
object2.state = state;
object2.guildId = guildId;
object2.channelId = channelId;
object2.permissions = parsedPermissions;
object2.prompt = prompt;
object2.disableGuildSelect = typeof disableGuildSelect === 'boolean' ? disableGuildSelect : disableGuildSelect === 'true';
object2.showLogout = false;
object2.callback = callback_99707;
const applicationFlagUtilsModule = require(7504) /* metro dependency 7504: ApplicationFlagUtils */;
const hasApplicationFlag = applicationFlagUtilsModule.hasApplicationFlag;
const EMBEDDED = ApplicationFlags.EMBEDDED;
object2.isEmbeddedFlow = Reflect.apply(hasApplicationFlag, applicationFlagUtilsModule, [r9, EMBEDDED]);
object2.disclosures = disclosures;
object2.integrationType = integrationType;
const ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch;
const dispatch = ComponentDispatch.dispatch;
const SHOW_OAUTH2_MODAL = ComponentActions.SHOW_OAUTH2_MODAL;
Reflect.apply(dispatch, ComponentDispatch, [SHOW_OAUTH2_MODAL, object2]);
return value2;
}
function callback_99707(a0) { // fn#99707, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13249:768, offset: 0x021d28ac, size: 122 bytes, params: 2, frame: 16
var value;
if (a0.location != null) {
env0_0(a0.location);
} else {
value = environment.__proto__.__proto__;
require(new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.OAUTH2_ERROR},
'User cancelled authorization'));
}
}
@@ -0,0 +1,80 @@
/* Metro module 13062; source: modules/rpc/native/server/commands/unsupported.tsx; dependencies: [661, 13063, 2] */
function _fun99730(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99730, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13252:6, offset: 0x021d410a, size: 985 bytes, params: 8, frame: 19
var object2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const RPCCommands = (require(661) /* metro dependency 661: Constants */).RPCCommands;
object2 = {};
const SET_USER_VOICE_SETTINGS = RPCCommands.SET_USER_VOICE_SETTINGS;
const unsupportedCommand = (require(13063) /* metro dependency 13063: unavailableCommand */).unsupportedCommand;
object2[SET_USER_VOICE_SETTINGS] = unsupportedCommand;
const SET_USER_VOICE_SETTINGS_2 = RPCCommands.SET_USER_VOICE_SETTINGS_2;
object2[SET_USER_VOICE_SETTINGS_2] = unsupportedCommand;
const PUSH_TO_TALK = RPCCommands.PUSH_TO_TALK;
object2[PUSH_TO_TALK] = unsupportedCommand;
const SET_VOICE_SETTINGS_2 = RPCCommands.SET_VOICE_SETTINGS_2;
object2[SET_VOICE_SETTINGS_2] = unsupportedCommand;
const SET_VOICE_SETTINGS = RPCCommands.SET_VOICE_SETTINGS;
object2[SET_VOICE_SETTINGS] = unsupportedCommand;
const SEND_ACTIVITY_JOIN_INVITE = RPCCommands.SEND_ACTIVITY_JOIN_INVITE;
object2[SEND_ACTIVITY_JOIN_INVITE] = unsupportedCommand;
const CLOSE_ACTIVITY_JOIN_REQUEST = RPCCommands.CLOSE_ACTIVITY_JOIN_REQUEST;
object2[CLOSE_ACTIVITY_JOIN_REQUEST] = unsupportedCommand;
const ACTIVITY_INVITE_USER = RPCCommands.ACTIVITY_INVITE_USER;
object2[ACTIVITY_INVITE_USER] = unsupportedCommand;
const ACCEPT_ACTIVITY_INVITE = RPCCommands.ACCEPT_ACTIVITY_INVITE;
object2[ACCEPT_ACTIVITY_INVITE] = unsupportedCommand;
const OPEN_SHARE_MOMENT_DIALOG = RPCCommands.OPEN_SHARE_MOMENT_DIALOG;
object2[OPEN_SHARE_MOMENT_DIALOG] = unsupportedCommand;
const INVITE_BROWSER = RPCCommands.INVITE_BROWSER;
object2[INVITE_BROWSER] = unsupportedCommand;
const DEEP_LINK = RPCCommands.DEEP_LINK;
object2[DEEP_LINK] = unsupportedCommand;
const CONNECTIONS_CALLBACK = RPCCommands.CONNECTIONS_CALLBACK;
object2[CONNECTIONS_CALLBACK] = unsupportedCommand;
const BILLING_POPUP_BRIDGE_CALLBACK = RPCCommands.BILLING_POPUP_BRIDGE_CALLBACK;
object2[BILLING_POPUP_BRIDGE_CALLBACK] = unsupportedCommand;
const BRAINTREE_POPUP_BRIDGE_CALLBACK = RPCCommands.BRAINTREE_POPUP_BRIDGE_CALLBACK;
object2[BRAINTREE_POPUP_BRIDGE_CALLBACK] = unsupportedCommand;
const GIFT_CODE_BROWSER = RPCCommands.GIFT_CODE_BROWSER;
object2[GIFT_CODE_BROWSER] = unsupportedCommand;
const GUILD_TEMPLATE_BROWSER = RPCCommands.GUILD_TEMPLATE_BROWSER;
object2[GUILD_TEMPLATE_BROWSER] = unsupportedCommand;
const BROWSER_HANDOFF = RPCCommands.BROWSER_HANDOFF;
object2[BROWSER_HANDOFF] = unsupportedCommand;
const SET_OVERLAY_LOCKED = RPCCommands.SET_OVERLAY_LOCKED;
object2[SET_OVERLAY_LOCKED] = unsupportedCommand;
const OPEN_OVERLAY_ACTIVITY_INVITE = RPCCommands.OPEN_OVERLAY_ACTIVITY_INVITE;
object2[OPEN_OVERLAY_ACTIVITY_INVITE] = unsupportedCommand;
const OPEN_OVERLAY_GUILD_INVITE = RPCCommands.OPEN_OVERLAY_GUILD_INVITE;
object2[OPEN_OVERLAY_GUILD_INVITE] = unsupportedCommand;
const OPEN_OVERLAY_VOICE_SETTINGS = RPCCommands.OPEN_OVERLAY_VOICE_SETTINGS;
object2[OPEN_OVERLAY_VOICE_SETTINGS] = unsupportedCommand;
const VALIDATE_APPLICATION = RPCCommands.VALIDATE_APPLICATION;
object2[VALIDATE_APPLICATION] = unsupportedCommand;
const GET_ENTITLEMENT_TICKET = RPCCommands.GET_ENTITLEMENT_TICKET;
object2[GET_ENTITLEMENT_TICKET] = unsupportedCommand;
const START_PURCHASE = RPCCommands.START_PURCHASE;
object2[START_PURCHASE] = unsupportedCommand;
const START_PREMIUM_PURCHASE = RPCCommands.START_PREMIUM_PURCHASE;
object2[START_PREMIUM_PURCHASE] = unsupportedCommand;
const ENCOURAGE_HW_ACCELERATION = RPCCommands.ENCOURAGE_HW_ACCELERATION;
object2[ENCOURAGE_HW_ACCELERATION] = unsupportedCommand;
const TOGGLE_VIDEO = RPCCommands.TOGGLE_VIDEO;
object2[TOGGLE_VIDEO] = unsupportedCommand;
const TOGGLE_SCREENSHARE = RPCCommands.TOGGLE_SCREENSHARE;
object2[TOGGLE_SCREENSHARE] = unsupportedCommand;
const SEND_GENERIC_EVENT = RPCCommands.SEND_GENERIC_EVENT;
object2[SEND_GENERIC_EVENT] = (require(13063) /* metro dependency 13063: unavailableCommand */).deprecatedCommand;
const OPEN_MESSAGE = RPCCommands.OPEN_MESSAGE;
object2[OPEN_MESSAGE] = unsupportedCommand;
const OPEN_INVITE = RPCCommands.OPEN_INVITE;
object2[OPEN_INVITE] = unsupportedCommand;
const SHARE_INTERACTION = RPCCommands.SHARE_INTERACTION;
object2[SHARE_INTERACTION] = unsupportedCommand;
const SET_SUPPRESS_NOTIFICATIONS = RPCCommands.SET_SUPPRESS_NOTIFICATIONS;
object2[SET_SUPPRESS_NOTIFICATIONS] = unsupportedCommand;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/native/server/commands/unsupported.tsx');
exports.default = object2;
}
@@ -0,0 +1,21 @@
/* Metro module 13061; source: modules/rpc/native/server/commands/voiceSettings.tsx; dependencies: [4135, 661, 4122, 8080, 2] */
function _fun99728(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13251:6, offset: 0x021d4003, size: 226 bytes, params: 8, frame: 23
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const RPC_SCOPE_CONFIG = (require(4135) /* metro dependency 4135: Constants */).RPC_SCOPE_CONFIG;
const RPCCommands = (require(661) /* metro dependency 661: Constants */).RPCCommands;
object2 = {};
const GET_VOICE_SETTINGS = RPCCommands.GET_VOICE_SETTINGS;
const ANY = RPC_SCOPE_CONFIG.ANY;
const {RPC, RPC_VOICE_READ} = (require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes;
object2[GET_VOICE_SETTINGS] = {scope: {[ANY]: [RPC, RPC_VOICE_READ]}, handler: handler_99729};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/native/server/commands/voiceSettings.tsx');
exports.default = object2;
}
function handler_99729() { // fn#99729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13251:259, offset: 0x021d40e5, size: 37 bytes, params: 1, frame: 11
return (require(8080) /* metro dependency 8080: NativeRPCHelpers */).getDeprecatedVoiceSettings();
}
@@ -0,0 +1,15 @@
/* Metro module 8072; source: modules/rpc/native/server/transports/WebViewPostMessageTransport.tsx; dependencies: [3, 8073, 8074, 8080, 8084, 2] */
function _fun64077(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#64077, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8250:6, offset: 0x01b9a9f7, size: 199 bytes, params: 8, frame: 21
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('RPCServer:PostMessage');
value = new (importDefault(8074) /* metro dependency 8074: PostMessageTransport */)((require(8080) /* metro dependency 8080: NativeRPCHelpers */).validateSocketClient,
value, importDefault(8084) /* metro dependency 8084: WebViewWindowProxySocketFactory */, function(a0, a1,
{id}) {
a1.info('Socket Message: ' + id, importDefault(dependencyMap[1])(a0));
});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/native/server/transports/WebViewPostMessageTransport.tsx');
exports.default = value;
}
@@ -0,0 +1,23 @@
/* Metro module 8084; source: modules/rpc/native/server/transports/WebViewWindowProxySocketFactory.tsx; dependencies: [8085, 8073, 2] */
function _fun64806(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#64806, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8269:6, offset: 0x01bb5ccf, size: 97 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/native/server/transports/WebViewWindowProxySocketFactory.tsx');
exports.default = _default_64807;
}
function _default_64807({origin, postMessageToRPCClient, frameId, version, encoding, logger, postClose}) { // fn#64807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8269:105, offset: 0x01bb5d30, size: 147 bytes, params: 2, frame: 19
let value = importDefault(8085) /* metro dependency 8085: PostMessageProxySocket */;
const object2 = {origin: origin, postMessageToRPCClient: postMessageToRPCClient, frameId: frameId, version: version,
encoding: encoding, logger: logger, postClose: postClose, onSendingToRPCClient: onSendingToRPCClient};
const value2 = Object.create(value.prototype, {constructor: {value: value}});
value = new value(object2);
return value instanceof Object ? value : value2;
}
function onSendingToRPCClient(a0, a1) { // fn#64808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8269:317, owner: _default_64807.onSendingToRPCClient, offset: 0x01bb5dc3, size: 81 bytes, params: 3, frame: 15
const loggerBinding = logger;
loggerBinding.info('Socket Emit: ' + a1,
(importDefault(8073) /* metro dependency 8073: stripSensitiveLoggingData */)(a0));
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,246 @@
/* Metro module 13056; source: modules/rpc/server/commands/activities.tsx; dependencies: [5, 661, 13026, 13014, 8081, 7504, 8076, 13018, 7860, 2] */
function _fun99687(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99687, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13246:6, offset: 0x021d16e1, size: 301 bytes, params: 8, frame: 25
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
let value = require(661) /* metro dependency 661: Constants */;
const RPCCommands = value.RPCCommands;
const env0_4 = value.RPCErrors;
const env0_5 = value.ApplicationFlags;
object2 = {};
const GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS = RPCCommands.GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS;
value = require(13026) /* metro dependency 13026: rpcSchema */;
let createRPCCommand = value.createRPCCommand;
const GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS2 = RPCCommands.GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS;
const activityInstanceConnectedParticipantsScope = (require(13014) /* metro dependency 13014: activityInstanceConnectedParticipants */).activityInstanceConnectedParticipantsScope;
object2[GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS] = Reflect.apply(createRPCCommand, value,
[GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS2, {scope: activityInstanceConnectedParticipantsScope,
handler: handler_99688}]);
const REQUEST_PROXY_TICKET_REFRESH = RPCCommands.REQUEST_PROXY_TICKET_REFRESH;
value = require(13026) /* metro dependency 13026: rpcSchema */;
createRPCCommand = value.createRPCCommand;
const REQUEST_PROXY_TICKET_REFRESH2 = RPCCommands.REQUEST_PROXY_TICKET_REFRESH;
object2[REQUEST_PROXY_TICKET_REFRESH] = Reflect.apply(createRPCCommand, value, [REQUEST_PROXY_TICKET_REFRESH2,
{scope: activityInstanceConnectedParticipantsScope, handler: handler_99689}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/activities.tsx');
exports.default = object2;
}
function handler_99688({socket}) { // fn#99688, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13246:357, offset: 0x021d180e, size: 75 bytes, params: 2, frame: 14
const rpcHelpersModule = require(8081) /* metro dependency 8081: RPCHelpers */;
rpcHelpersModule.validatePostMessageTransport(socket.transport);
return (require(13014) /* metro dependency 13014: activityInstanceConnectedParticipants */).activityInstanceConnectedParticipants();
}
function handler_99689({socket}) { // fn#99689, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13246:628, offset: 0x021d1859, size: 42 bytes, params: 2, frame: 11
return env0_3(_fun99691)();
}
function* _fun99691() { // fn#99691, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13246:645, offset: 0x021d188e, size: 364 bytes, params: 1, frame: 21
var id;
var object2;
var prototype;
var binding4;
var property;
var value11;
var createProxyTicket;
var value12;
var proxyTicket;
var value13;
var value14;
var error;
var UNKNOWN_ERROR;
var value15;
if (false) {
return undefined;
}
value = undefined;
let binding = env2_0;
const binding2 = env2_2;
const value4 = binding(binding2[4]);
value4.validatePostMessageTransport(require.transport);
const value6 = binding(binding2[4]);
const validateApplication = value6.validateApplication;
let application = require.application;
const value7 = Reflect.apply(validateApplication, value6, [application]);
const value8 = binding(binding2[5]);
const hasApplicationFlag = value8.hasApplicationFlag;
application = require.application;
const EMBEDDED = env2_5.EMBEDDED;
const hasApplicationFlag2 = Reflect.apply(hasApplicationFlag, value8, [application, EMBEDDED]);
binding = env2_1;
const binding3 = env2_2;
if (!hasApplicationFlag2) {
value = binding(binding3[6]);
value = new value({errorCode: env2_4.UNAUTHORIZED_FOR_APPLICATION}, 'This application cannot access this API');
throw value;
}
const value10 = binding(binding3[7])();
try {
object2 = {};
} catch (error) {
binding = env2_1;
value = binding(env2_2[6]);
object2 = {};
UNKNOWN_ERROR = env2_4.UNKNOWN_ERROR;
object2.errorCode = UNKNOWN_ERROR;
prototype = value.prototype;
value15 = Object.create(prototype, {constructor: {value: value}});
value = new value(object2, 'Failed to create proxy ticket');
value = value instanceof Object ? value : value15;
throw value;
}
try {
binding = env2_0;
} catch (error) {
binding = env2_1;
value = binding(env2_2[6]);
object2 = {};
UNKNOWN_ERROR = env2_4.UNKNOWN_ERROR;
object2.errorCode = UNKNOWN_ERROR;
prototype = value.prototype;
value15 = Object.create(prototype, {constructor: {value: value}});
value = new value(object2, 'Failed to create proxy ticket');
value = value instanceof Object ? value : value15;
throw value;
}
try {
binding4 = env2_2;
} catch (error) {
binding = env2_1;
value = binding(env2_2[6]);
object2 = {};
UNKNOWN_ERROR = env2_4.UNKNOWN_ERROR;
object2.errorCode = UNKNOWN_ERROR;
prototype = value.prototype;
value15 = Object.create(prototype, {constructor: {value: value}});
value = new value(object2, 'Failed to create proxy ticket');
value = value instanceof Object ? value : value15;
throw value;
}
try {
property = binding4[8];
} catch (error) {
binding = env2_1;
value = binding(env2_2[6]);
object2 = {};
UNKNOWN_ERROR = env2_4.UNKNOWN_ERROR;
object2.errorCode = UNKNOWN_ERROR;
prototype = value.prototype;
value15 = Object.create(prototype, {constructor: {value: value}});
value = new value(object2, 'Failed to create proxy ticket');
value = value instanceof Object ? value : value15;
throw value;
}
try {
value11 = binding(property);
} catch (error) {
binding = env2_1;
value = binding(env2_2[6]);
object2 = {};
UNKNOWN_ERROR = env2_4.UNKNOWN_ERROR;
object2.errorCode = UNKNOWN_ERROR;
prototype = value.prototype;
value15 = Object.create(prototype, {constructor: {value: value}});
value = new value(object2, 'Failed to create proxy ticket');
value = value instanceof Object ? value : value15;
throw value;
}
try {
createProxyTicket = value11.createProxyTicket;
} catch (error) {
binding = env2_1;
value = binding(env2_2[6]);
object2 = {};
UNKNOWN_ERROR = env2_4.UNKNOWN_ERROR;
object2.errorCode = UNKNOWN_ERROR;
prototype = value.prototype;
value15 = Object.create(prototype, {constructor: {value: value}});
value = new value(object2, 'Failed to create proxy ticket');
value = value instanceof Object ? value : value15;
throw value;
}
try {
value12 = value10 == null;
} catch (error) {
binding = env2_1;
value = binding(env2_2[6]);
object2 = {};
UNKNOWN_ERROR = env2_4.UNKNOWN_ERROR;
object2.errorCode = UNKNOWN_ERROR;
prototype = value.prototype;
value15 = Object.create(prototype, {constructor: {value: value}});
value = new value(object2, 'Failed to create proxy ticket');
value = value instanceof Object ? value : value15;
throw value;
}
if (value12) {
id = value;
} else {
try {
id = value10.id;
} catch (error) {
binding = env2_1;
value = binding(env2_2[6]);
object2 = {};
UNKNOWN_ERROR = env2_4.UNKNOWN_ERROR;
object2.errorCode = UNKNOWN_ERROR;
prototype = value.prototype;
value15 = Object.create(prototype, {constructor: {value: value}});
value = new value(object2, 'Failed to create proxy ticket');
value = value instanceof Object ? value : value15;
throw value;
}
}
try {
proxyTicket = Reflect.apply(createProxyTicket, value11, [value7, id]);
} catch (error) {
binding = env2_1;
value = binding(env2_2[6]);
object2 = {};
UNKNOWN_ERROR = env2_4.UNKNOWN_ERROR;
object2.errorCode = UNKNOWN_ERROR;
prototype = value.prototype;
value15 = Object.create(prototype, {constructor: {value: value}});
value = new value(object2, 'Failed to create proxy ticket');
value = value instanceof Object ? value : value15;
throw value;
}
yield proxyTicket;
try {
value13 = undefined;
value14 = false;
} catch (error) {
binding = env2_1;
value = binding(env2_2[6]);
object2 = {};
UNKNOWN_ERROR = env2_4.UNKNOWN_ERROR;
object2.errorCode = UNKNOWN_ERROR;
prototype = value.prototype;
value15 = Object.create(prototype, {constructor: {value: value}});
value = new value(object2, 'Failed to create proxy ticket');
value = value instanceof Object ? value : value15;
throw value;
}
if (value14) {
return value13;
}
try {
object2.ticket = value13;
} catch (error) {
binding = env2_1;
value = binding(env2_2[6]);
object2 = {};
UNKNOWN_ERROR = env2_4.UNKNOWN_ERROR;
object2.errorCode = UNKNOWN_ERROR;
prototype = value.prototype;
value15 = Object.create(prototype, {constructor: {value: value}});
value = new value(object2, 'Failed to create proxy ticket');
value = value instanceof Object ? value : value15;
throw value;
}
return object2;
}
@@ -0,0 +1,88 @@
/* Metro module 13017; source: modules/rpc/server/commands/application.tsx; dependencies: [4234, 4135, 661, 8079, 8081, 13018, 7504, 8076, 8097, 683, 507, 7502, 2] */
function _fun99372(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13207:6, offset: 0x021c5ddb, size: 246 bytes, params: 8, frame: 21
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const applicationStore = importDefault(4234) /* metro dependency 4234: ApplicationStore */;
const RPC_LOCAL_SCOPE = (require(4135) /* metro dependency 4135: Constants */).RPC_LOCAL_SCOPE;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_4 = constantsModule.ApplicationFlags;
const env0_5 = constantsModule.Endpoints;
const RPCCommands = constantsModule.RPCCommands;
const env0_6 = constantsModule.RPCErrors;
object2 = {};
const SEND_ANALYTICS_EVENT = RPCCommands.SEND_ANALYTICS_EVENT;
object2[SEND_ANALYTICS_EVENT] = {validation: validation, handler: handler_99374};
const GET_APPLICATION_TICKET = RPCCommands.GET_APPLICATION_TICKET;
object2[GET_APPLICATION_TICKET] = {scope: RPC_LOCAL_SCOPE, handler: handler_99375};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/application.tsx');
exports.default = object2;
}
function validation(a0) { // fn#99373, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13207:247, offset: 0x021c5ed1, size: 110 bytes, params: 2, frame: 18
let value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
value = value.required();
const keys = value.keys;
const object2 = {};
object2.event_name = a0.string().required();
object2.event_properties = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0).required();
return Reflect.apply(keys, value, [object2]);
}
function handler_99374({socket, args}) { // fn#99374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13207:352, offset: 0x021c5f3f, size: 416 bytes, params: 2, frame: 21
var object3;
var activeAnalyticsSessionIDs;
var track;
var object4;
const event_name = args.event_name;
const event_properties = args.event_properties;
var value;
const rpcHelpersModule = require(8081) /* metro dependency 8081: RPCHelpers */;
rpcHelpersModule.validatePostMessageTransport(socket.transport);
const moduleValue2 = rpcHelpersModule;
moduleValue2.validateApplication(socket.application);
const id = socket.application.id;
const value3 = (importDefault(13018) /* metro dependency 13018: getCurrentEmbeddedActivityChannel */)();
const guildId = value3?.getGuildId();
const application = ApplicationStore.getApplication(id);
const applicationFlagUtilsModule = require(7504) /* metro dependency 7504: ApplicationFlagUtils */;
const hasApplicationFlag = applicationFlagUtilsModule.hasApplicationFlag;
const EMBEDDED_FIRST_PARTY = ApplicationFlags.EMBEDDED_FIRST_PARTY;
if (Reflect.apply(hasApplicationFlag, applicationFlagUtilsModule, [application, EMBEDDED_FIRST_PARTY])) {
activeAnalyticsSessionIDs = (require(8097) /* metro dependency 8097: EmbeddedActivitiesManager */).getActiveAnalyticsSessionIDs(id);
object3 = {activity_application_id: id};
object3.activity_channel_type = value3?.type;
object3.activity_guild_id = guildId;
object3.activity_user_session_id = activeAnalyticsSessionIDs?.activityUserSessionId;
value = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = value.track;
object4 = {};
copyDataProperties(object4, object3, application);
copyDataProperties(object4, event_properties, application);
Reflect.apply(track, value, [event_name, object4]);
return undefined;
}
const defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
const INVALID_COMMAND = RPCErrors.INVALID_COMMAND;
throw new defaultImport({errorCode: INVALID_COMMAND}, 'This application cannot access this API');
}
function handler_99375({socket}) { // fn#99375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13207:1013, offset: 0x021c60df, size: 234 bytes, params: 2, frame: 18
const id = socket.application.id;
if (id == null) {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_COMMAND},
'No application.');
}
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
const post = HTTP.post;
const object3 = {'url': null, 'body': null, 'retries': 3, 'oldFormErrors': true, 'rejectWithError': false};
object3.url = Endpoints.APPLICATION_TICKET(id);
const object4 = {};
object4.test_mode = (require(7502) /* metro dependency 7502: TestModeUtils */).isTestModeForApplication(id);
object3.body = object4;
return Reflect.apply(post, HTTP, [object3]).then(function(a0) {
return a0.body;
});
}
@@ -0,0 +1,107 @@
/* Metro module 13019; source: modules/rpc/server/commands/certifiedDevices.tsx; dependencies: [4135, 661, 4291, 4122, 8079, 8076, 13020, 2] */
function _fun99379(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13209:6, offset: 0x021c6264, size: 262 bytes, params: 8, frame: 23
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = require(4135) /* metro dependency 4135: Constants */;
const RPC_LOCAL_SCOPE = value.RPC_LOCAL_SCOPE;
const RPC_SCOPE_CONFIG = value.RPC_SCOPE_CONFIG;
value = require(661) /* metro dependency 661: Constants */;
const RPCCommands = value.RPCCommands;
const env0_3 = value.RPCErrors;
const env0_4 = (require(4291) /* metro dependency 4291: Constants */).DeviceTypes;
object2 = {};
const SET_CERTIFIED_DEVICES = RPCCommands.SET_CERTIFIED_DEVICES;
const ANY = RPC_SCOPE_CONFIG.ANY;
const OAuth2Scopes = (require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes;
const RPC = OAuth2Scopes.RPC;
object2[SET_CERTIFIED_DEVICES] = {scope: {[ANY]: [RPC, RPC_LOCAL_SCOPE]}, validation: validation_99380,
handler: handler_99381};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/certifiedDevices.tsx');
exports.default = object2;
}
function validation_99380(a0) { // fn#99380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13209:295, offset: 0x021c636a, size: 496 bytes, params: 2, frame: 27
const value3 = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0).required();
const keys = value3.keys;
const value4 = a0.array();
const items2 = value4.items;
const value5 = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
const keys2 = value5.keys;
const object = {};
const value7 = a0.string().required();
const valid = value7.valid;
const AUDIO_INPUT = DeviceTypes.AUDIO_INPUT;
const AUDIO_OUTPUT = DeviceTypes.AUDIO_OUTPUT;
const VIDEO_INPUT = DeviceTypes.VIDEO_INPUT;
object.type = Reflect.apply(valid, value7, [[AUDIO_INPUT, AUDIO_OUTPUT, VIDEO_INPUT]]);
let value = a0.string();
value = value.required();
object.id = value.min(1);
value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
value = value.required();
const keys3 = value.keys;
const object5 = {};
object5.name = a0.string().min(1);
object5.url = a0.string().min(1);
object.vendor = Reflect.apply(keys3, value, [object5]);
value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
value = value.required();
const keys4 = value.keys;
const object6 = {};
object6.name = a0.string().min(1);
object6.url = a0.string().min(1);
object.model = Reflect.apply(keys4, value, [object6]);
value = a0.array();
const items3 = value.items;
const value12 = a0.string();
object.related = Reflect.apply(items3, value, [value12.min(1)]);
object.echo_cancellation = a0.boolean();
object.noise_suppression = a0.boolean();
object.automatic_gain_control = a0.boolean();
object.hardware_mute = a0.boolean();
return Reflect.apply(keys, value3, [{devices: Reflect.apply(items2, value4, [Reflect.apply(keys2, value5,
[object])])}]);
}
function handler_99381({socket, args}) { // fn#99381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13209:810, offset: 0x021c655a, size: 182 bytes, params: 2, frame: 16
const devices = args.devices;
if (socket.application.id == null) {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_COMMAND},
'No application.');
}
const value = require(13020) /* metro dependency 13020: CertifiedDeviceActionCreators */;
value.setCertifiedDevices(socket.application.id, devices.map(function(a0) {
var object = {type: a0.type, id: a0.id, vendor: a0.vendor, model: a0.model};
object.related = a0.related.filter(_fun99383);
object.echoCancellation = a0.echo_cancellation;
object.noiseSuppression = a0.noise_suppression;
object.automaticGainControl = a0.automatic_gain_control;
object.hardwareMute = a0.hardware_mute;
return object;
}));
}
function _fun99382({type, id, vendor, model, related, echo_cancellation, noise_suppression, automatic_gain_control, hardware_mute}) { // fn#99382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13209:993, offset: 0x021c6610, size: 121 bytes, params: 2, frame: 13
const object2 = {};
object2.type = type;
object2.id = id;
object2.vendor = vendor;
object2.model = model;
object2.related = related.filter(function(a0) {
var env0_0 = a0;
return devices.some(_fun99384);
});
object2.echoCancellation = echo_cancellation;
object2.noiseSuppression = noise_suppression;
object2.automaticGainControl = automatic_gain_control;
object2.hardwareMute = hardware_mute;
return object2;
}
function _fun99383(a0) { // fn#99383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13209:1074, offset: 0x021c6689, size: 36 bytes, params: 2, frame: 11
const env0_0 = a0;
return devices.some(_fun99384);
}
@@ -0,0 +1,515 @@
/* Metro module 13021; source: modules/rpc/server/commands/channels.tsx; dependencies: [1383, 1379, 1867, 3784, 1934, 4297, 4135, 661, 4122, 8076, 8081, 22, 13018, 8079, 4796, 4800, 1230, 8879, 2] */
function _fun99387(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:6, offset: 0x021c674d, size: 822 bytes, params: 8, frame: 25
var object2;
let env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = require(1383) /* metro dependency 1383: ChannelRecord */;
const env0_3 = value.isVoiceChannel;
const env0_4 = value.isTextChannel;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
const voiceStateStore = importDefault(4297) /* metro dependency 4297: VoiceStateStore */;
const RPC_SCOPE_CONFIG = (require(4135) /* metro dependency 4135: Constants */).RPC_SCOPE_CONFIG;
value = require(661) /* metro dependency 661: Constants */;
const env0_10 = value.Routes;
const env0_11 = value.Permissions;
const RPCCommands = value.RPCCommands;
const env0_12 = value.RPCErrors;
object2 = {};
const GET_CHANNEL = RPCCommands.GET_CHANNEL;
let ANY = RPC_SCOPE_CONFIG.ANY;
const OAuth2Scopes = (require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes;
let RPC = OAuth2Scopes.RPC;
const GUILDS = OAuth2Scopes.GUILDS;
let GUILDS_CHANNELS_READ = OAuth2Scopes.GUILDS_CHANNELS_READ;
object2[GET_CHANNEL] = {scope: {[ANY]: [RPC, GUILDS, GUILDS_CHANNELS_READ]}, handler: handler_99388};
const GET_CHANNELS = RPCCommands.GET_CHANNELS;
RPC = OAuth2Scopes.RPC;
object2[GET_CHANNELS] = {scope: RPC, handler: handler_99389};
const GET_CHANNEL_PERMISSIONS = RPCCommands.GET_CHANNEL_PERMISSIONS;
ANY = RPC_SCOPE_CONFIG.ANY;
const GUILDS_MEMBERS_READ = OAuth2Scopes.GUILDS_MEMBERS_READ;
GUILDS_CHANNELS_READ = OAuth2Scopes.GUILDS_CHANNELS_READ;
object2[GET_CHANNEL_PERMISSIONS] = {scope: {[ANY]: [GUILDS_MEMBERS_READ, GUILDS_CHANNELS_READ]},
handler: handler_99393};
const SELECT_VOICE_CHANNEL = RPCCommands.SELECT_VOICE_CHANNEL;
RPC = OAuth2Scopes.RPC;
object2[SELECT_VOICE_CHANNEL] = {scope: RPC, validation: validation_99394, handler: handler_99395};
const GET_SELECTED_VOICE_CHANNEL = RPCCommands.GET_SELECTED_VOICE_CHANNEL;
ANY = RPC_SCOPE_CONFIG.ANY;
RPC = OAuth2Scopes.RPC;
const RPC_VOICE_READ = OAuth2Scopes.RPC_VOICE_READ;
object2[GET_SELECTED_VOICE_CHANNEL] = {scope: {[ANY]: [RPC, RPC_VOICE_READ]}, handler: handler_99400};
const SELECT_TEXT_CHANNEL = RPCCommands.SELECT_TEXT_CHANNEL;
RPC = OAuth2Scopes.RPC;
object2[SELECT_TEXT_CHANNEL] = {scope: RPC, validation: validation_99401, handler: handler_99402};
const CREATE_CHANNEL_INVITE = RPCCommands.CREATE_CHANNEL_INVITE;
RPC = OAuth2Scopes.RPC;
object2[CREATE_CHANNEL_INVITE] = {scope: RPC, handler: function({args}) {
var channel_id = args.channel_id;
var env0_0 = channel_id;
var value = Object.create(null);
value.channel_id = 0;
value = copyDataProperties({}, args, value, channel_id);
value = importDefault(dependencyMap[17]).createInvite(channel_id, value, 'RPC');
return value.catch(_fun99408);
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/channels.tsx');
exports.default = object2;
}
function handler_99388({args, socket}) { // fn#99388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:420, offset: 0x021c6a83, size: 399 bytes, params: 2, frame: 20
var scopes;
var includes;
const OAuth2Scopes = (require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes;
var transformChannel;
var moduleValue;
var defaultImport2;
const channel_id = args.channel_id;
var value;
const channel = ChannelStore.getChannel(channel_id);
if (channel == null) {
defaultImport2 = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_CHANNEL;
value = 'Invalid channel id: ' + channel_id;
value = new defaultImport2();
throw value;
}
if (channel.isPrivate()) {
scopes = socket.authorization.scopes;
includes = scopes.includes;
if (Reflect.apply(includes, scopes, [OAuth2Scopes.RPC])) {
value = require(8081) /* metro dependency 8081: RPCHelpers */;
transformChannel = value.transformChannel;
moduleValue = require(8081) /* metro dependency 8081: RPCHelpers */;
return Reflect.apply(transformChannel, value, [channel, moduleValue.hasMessageReadPermission(channel,
socket.application.id, socket.authorization.scopes)]);
}
includes = scopes.includes;
if (Reflect.apply(includes, scopes, [OAuth2Scopes.DM_CHANNELS_READ])) {
value = require(8081) /* metro dependency 8081: RPCHelpers */;
transformChannel = value.transformChannel;
moduleValue = require(8081) /* metro dependency 8081: RPCHelpers */;
return Reflect.apply(transformChannel, value, [channel, moduleValue.hasMessageReadPermission(channel,
socket.application.id, socket.authorization.scopes)]);
}
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_PERMISSIONS},
'Invalid scope');
}
value = require(8081) /* metro dependency 8081: RPCHelpers */;
transformChannel = value.transformChannel;
moduleValue = require(8081) /* metro dependency 8081: RPCHelpers */;
return Reflect.apply(transformChannel, value, [channel, moduleValue.hasMessageReadPermission(channel,
socket.application.id, socket.authorization.scopes)]);
}
function handler_99389({args}) { // fn#99389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:944, offset: 0x021c6c12, size: 246 bytes, params: 2, frame: 17
var r7;
var object2;
var defaultImport2;
const guild_id = args.guild_id;
var value;
const defaultImport = importDefault(22) /* metro dependency 22 */;
const value2 = defaultImport.values(ChannelStore.loadAllGuildAndPrivateChannelsFromDisk());
if (guild_id) {
if (GuildStore.getGuild(guild_id) == null) {
defaultImport2 = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_GUILD;
value = 'Invalid guild id: ' + guild_id;
value = new defaultImport2();
throw value;
}
value = value2.filter(_fun99390);
r7 = value;
object2 = {};
value = r7.filter(function(a0) {
return PermissionStore.can(Permissions.VIEW_CHANNEL, a0);
});
object2.channels = value.map(_fun99392);
} else {
r7 = value2;
object2 = {};
object2.channels = r7.filter(function(a0) {
return PermissionStore.can(Permissions.VIEW_CHANNEL, a0);
}).map(function({id, name, type}) {
return {id: id, name: name, type: type};
});
}
return object2;
}
function handler_99393() { // fn#99393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:1430, offset: 0x021c6d66, size: 127 bytes, params: 1, frame: 15
const value2 = (importDefault(13018) /* metro dependency 13018: getCurrentEmbeddedActivityChannel */)();
if (value2 == null) {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_CHANNEL},
'Invalid channel');
}
const object2 = {};
object2.permissions = PermissionStore.computePermissions(value2);
return object2;
}
function validation_99394(a0) { // fn#99394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:1650, offset: 0x021c6de5, size: 153 bytes, params: 2, frame: 15
let value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
value = value.required();
const keys = value.keys;
const object2 = {};
object2.channel_id = a0.string().allow(null);
object2.timeout = a0.number().min(0).max(60);
object2.force = a0.boolean();
object2.navigate = a0.boolean();
return Reflect.apply(keys, value, [object2]);
}
function handler_99395({server, socket, args}) { // fn#99395, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:1791, offset: 0x021c6e7e, size: 291 bytes, params: 2, frame: 21
var value;
var voiceChannelId;
const channel_id = args.channel_id;
let timeout = args.timeout;
timeout = timeout === undefined ? 0 : timeout;
let force = args.force;
force = !(force === undefined) && force;
if (args.navigate !== undefined) {
}
if (channel_id) {
voiceChannelId = SelectedChannelStore.getVoiceChannelId();
if (voiceChannelId == null) {
value = server.storeWait(socket, function() {
return ChannelStore.getChannel(channel_id);
}, timeout);
value = value.catch(_fun99397);
value = value.then(_fun99398);
return value.then(_fun99399);
}
if (voiceChannelId === channel_id) {
value = server.storeWait(socket, _fun99396, timeout);
value = value.catch(_fun99397);
value = value.then(_fun99398);
return value.then(_fun99399);
}
if (force === false) {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.SELECT_VOICE_FORCE_REQUIRED},
'User is already joined to a voice channel.');
}
value = server.storeWait(socket, _fun99396, timeout);
value = value.catch(_fun99397);
value = value.then(_fun99398);
return value.then(_fun99399);
}
(importDefault(4796) /* metro dependency 4796: SelectedChannelActionCreators */).selectVoiceChannel(null);
return null;
}
function handler_99400({socket}) { // fn#99400, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:3066, offset: 0x021c72c3, size: 140 bytes, params: 2, frame: 19
var r0;
var transformChannel;
var moduleValue;
var value;
const voiceChannelId = SelectedChannelStore.getVoiceChannelId();
const r4 = voiceChannelId != null ? ChannelStore.getChannel(voiceChannelId) : null;
if (r4 != null) {
value = require(8081) /* metro dependency 8081: RPCHelpers */;
transformChannel = value.transformChannel;
moduleValue = require(8081) /* metro dependency 8081: RPCHelpers */;
value = Reflect.apply(transformChannel, value, [r4, moduleValue.hasMessageReadPermission(r4,
socket.application.id,
socket.authorization.scopes)]);
r0 = value;
} else {
r0 = null;
}
return r0;
}
function validation_99401(a0) { // fn#99401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:3340, offset: 0x021c734f, size: 123 bytes, params: 2, frame: 15
let value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
value = value.required();
const keys = value.keys;
const object2 = {};
object2.channel_id = a0.string().allow(null);
object2.timeout = a0.number().min(0).max(60);
return Reflect.apply(keys, value, [object2]);
}
function handler_99402({server, socket, args}) { // fn#99402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:3450, offset: 0x021c73ca, size: 175 bytes, params: 2, frame: 19
var r0;
var value;
var moduleValue;
const channel_id = args.channel_id;
let timeout = args.timeout;
timeout = timeout === undefined ? 0 : timeout;
if (channel_id) {
value = server.storeWait(socket, function() {
return ChannelStore.getChannel(channel_id);
}, timeout);
value = value.catch(_fun99404);
value = value.then(_fun99405);
value = value.then(_fun99406);
r0 = value;
} else {
moduleValue = require(1230) /* metro dependency 1230: router_utils */;
moduleValue.transitionTo(Routes.ME);
r0 = null;
}
return r0;
}
function handler_99407({args}) { // fn#99407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:4355, offset: 0x021c7725, size: 105 bytes, params: 2, frame: 16
const channel_id = args.channel_id;
let value = Object.create(null);
value.channel_id = 0;
value = copyDataProperties({}, args, value, channel_id);
value = (importDefault(8879) /* metro dependency 8879: InstantInviteActionCreators */).createInvite(channel_id,
value, 'RPC');
return value.catch(_fun99408);
}
function _fun99390({guild_id}) { // fn#99390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:1161, offset: 0x021c6d08, size: 26 bytes, params: 2, frame: 2
return guild_id === env0_0.id;
}
function _fun99392({id, name, type}) { // fn#99392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:1248, offset: 0x021c6d44, size: 34 bytes, params: 2, frame: 4
return {id: id, name: name, type: type};
}
function _fun99397() { // fn#99397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:2143, offset: 0x021c6fa1, size: 73 bytes, params: 1, frame: 13
const value = environment.__proto__;
const defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
const SELECT_CHANNEL_TIMED_OUT = RPCErrors.SELECT_CHANNEL_TIMED_OUT;
throw new defaultImport({errorCode: SELECT_CHANNEL_TIMED_OUT}, 'Request to select voice channel timed out.');
}
function _fun99398(a0) { // fn#99398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:2261, offset: 0x021c6fea, size: 332 bytes, params: 2, frame: 20
var value;
var items;
var Promise;
var all;
var transformChannel;
var moduleValue;
var hasMessageReadPermission;
var socketBinding;
var defaultImport2;
if (a0 == null) {
value = environment.__proto__;
defaultImport2 = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_CHANNEL;
value = 'Invalid channel id: ' + channel_id;
value = new defaultImport2();
throw value;
}
value = environment.__proto__;
if (isVoiceChannel(a0.type)) {
Promise = global.Promise;
all = Promise.all;
items = [global.Promise.resolve(a0)];
value = require(8081) /* metro dependency 8081: RPCHelpers */;
transformChannel = value.transformChannel;
moduleValue = require(8081) /* metro dependency 8081: RPCHelpers */;
hasMessageReadPermission = moduleValue.hasMessageReadPermission;
socketBinding = socket;
items[1] = Reflect.apply(transformChannel, value, [a0, Reflect.apply(hasMessageReadPermission, moduleValue, [a0,
socketBinding.application.id, socketBinding.authorization.scopes])]);
return Reflect.apply(all, Promise, [items]);
}
const defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
const INVALID_CHANNEL = RPCErrors.INVALID_CHANNEL;
throw new defaultImport({errorCode: INVALID_CHANNEL}, 'Channel is not a voice channel');
}
function _fun99399(a0) { // fn#99399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:2606, offset: 0x021c7136, size: 397 bytes, params: 2, frame: 19
var r0;
var r1;
var r4;
var item3;
var value3;
var value4;
var moduleValue;
var value6;
var defaultImport;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
let value = undefined;
const value2 = item2 === value;
const r2 = value2 ? value : item;
if (value2) {
r0 = item2;
r1 = value;
r4 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value;
r4 = value3;
} else {
r0 = item3;
r1 = item;
r4 = value3;
}
}
if (!r4) {
r0.return();
}
if (r1.guild_id) {
value4 = environment.__proto__;
moduleValue = require(4800) /* metro dependency 4800: ChannelUtils */;
if (moduleValue.isChannelFull(r2, VoiceStateStore, GuildStore)) {
value = importDefault(8076) /* metro dependency 8076: RPCError */;
value = new value({errorCode: RPCErrors.INVALID_CHANNEL}, 'Channel is full');
throw value;
}
if (PermissionStore.can(Permissions.CONNECT, r2)) {
value6 = environment.__proto__;
defaultImport = importDefault(4796) /* metro dependency 4796: SelectedChannelActionCreators */;
defaultImport.selectVoiceChannel(r2.id);
if (navigate) {
value = require(1230) /* metro dependency 1230: router_utils */;
value.replaceWith(Routes.CHANNEL(r2.guild_id, r2.id));
}
return r1;
}
value = importDefault(8076) /* metro dependency 8076: RPCError */;
value = new value({errorCode: RPCErrors.INVALID_PERMISSIONS}, 'Connect permission required to join channel');
throw value;
}
defaultImport = importDefault(4796) /* metro dependency 4796: SelectedChannelActionCreators */;
defaultImport.selectVoiceChannel(r2.id);
if (navigate) {
value = require(1230) /* metro dependency 1230: router_utils */;
value.replaceWith(Routes.CHANNEL(r2.guild_id, r2.id));
}
return r1;
}
function _fun99404() { // fn#99404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:3553, offset: 0x021c7479, size: 73 bytes, params: 1, frame: 13
const value = environment.__proto__;
const defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
const SELECT_CHANNEL_TIMED_OUT = RPCErrors.SELECT_CHANNEL_TIMED_OUT;
throw new defaultImport({errorCode: SELECT_CHANNEL_TIMED_OUT}, 'Request to select text channel timed out.');
}
function _fun99405(a0) { // fn#99405, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:3670, offset: 0x021c74c2, size: 332 bytes, params: 2, frame: 20
var value;
var items;
var Promise;
var all;
var transformChannel;
var moduleValue;
var hasMessageReadPermission;
var socketBinding;
var defaultImport2;
if (a0 == null) {
value = environment.__proto__;
defaultImport2 = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_CHANNEL;
value = 'Invalid channel id: ' + channel_id;
value = new defaultImport2();
throw value;
}
value = environment.__proto__;
if (isTextChannel(a0.type)) {
Promise = global.Promise;
all = Promise.all;
items = [global.Promise.resolve(a0)];
value = require(8081) /* metro dependency 8081: RPCHelpers */;
transformChannel = value.transformChannel;
moduleValue = require(8081) /* metro dependency 8081: RPCHelpers */;
hasMessageReadPermission = moduleValue.hasMessageReadPermission;
socketBinding = socket;
items[1] = Reflect.apply(transformChannel, value, [a0, Reflect.apply(hasMessageReadPermission, moduleValue, [a0,
socketBinding.application.id, socketBinding.authorization.scopes])]);
return Reflect.apply(all, Promise, [items]);
}
const defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
const INVALID_CHANNEL = RPCErrors.INVALID_CHANNEL;
throw new defaultImport({errorCode: INVALID_CHANNEL}, 'Channel is not a text channel');
}
function _fun99406(a0) { // fn#99406, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:4014, offset: 0x021c760e, size: 279 bytes, params: 2, frame: 17
var r0;
var r2;
var r3;
var item3;
var value3;
var value4;
var value6;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
let value = undefined;
const value2 = item2 === value;
const r1 = value2 ? value : item;
if (value2) {
r0 = value;
r2 = item2;
r3 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = value;
r2 = item3;
r3 = value3;
} else {
r0 = item;
r2 = item3;
r3 = value3;
}
}
if (!r3) {
r2.return();
}
let guild_id = r0.guild_id;
if (guild_id) {
value4 = environment.__proto__;
if (PermissionStore.can(Permissions.VIEW_CHANNEL, r1)) {
guild_id = r0.guild_id;
value6 = environment.__proto__;
if (guild_id) {
value = require(1230) /* metro dependency 1230: router_utils */;
value.replaceWith(Routes.CHANNEL(r0.guild_id, r1.id));
} else {
value = importDefault(4796) /* metro dependency 4796: SelectedChannelActionCreators */;
value.selectPrivateChannel(r1.id);
}
return r0;
}
value = importDefault(8076) /* metro dependency 8076: RPCError */;
value = new value({errorCode: RPCErrors.INVALID_CHANNEL}, 'No permission to see channel');
throw value;
}
if (r0.guild_id) {
value = require(1230) /* metro dependency 1230: router_utils */;
value.replaceWith(Routes.CHANNEL(r0.guild_id, r1.id));
} else {
value = importDefault(4796) /* metro dependency 4796: SelectedChannelActionCreators */;
value.selectPrivateChannel(r1.id);
}
return r0;
}
function _fun99408() { // fn#99408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13211:4425, offset: 0x021c778e, size: 105 bytes, params: 1, frame: 15
let value = environment.__proto__;
const defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
const INVALID_PERMISSIONS = RPCErrors.INVALID_PERMISSIONS;
value = 'Unable to generate an invite for ' + channel_id + '. Does this user have permissions?';
value = new defaultImport({errorCode: INVALID_PERMISSIONS}, value);
throw value;
}
@@ -0,0 +1,50 @@
/* Metro module 13022; source: modules/rpc/server/commands/config.tsx; dependencies: [4135, 661, 8079, 8076, 694, 2] */
function _fun99409(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99409, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13212:6, offset: 0x021c77f7, size: 191 bytes, params: 8, frame: 19
var object2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = require(4135) /* metro dependency 4135: Constants */;
const env0_2 = value.TransportTypes;
const RPC_AUTHENTICATED_SCOPE = value.RPC_AUTHENTICATED_SCOPE;
value = require(661) /* metro dependency 661: Constants */;
const RPCCommands = value.RPCCommands;
const env0_3 = value.RPCErrors;
object2 = {};
const SET_CONFIG = RPCCommands.SET_CONFIG;
object2[SET_CONFIG] = {scope: RPC_AUTHENTICATED_SCOPE, validation: validation_99410, handler: handler_99411};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/config.tsx');
exports.default = object2;
}
function validation_99410(a0) { // fn#99410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13212:231, offset: 0x021c78b6, size: 72 bytes, params: 2, frame: 13
let value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
value = value.required();
const keys = value.keys;
const object2 = {};
object2.use_interactive_pip = a0.boolean();
return Reflect.apply(keys, value, [object2]);
}
function handler_99411({socket, args}) { // fn#99411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13212:296, offset: 0x021c78fe, size: 333 bytes, params: 2, frame: 17
var defaultImport2;
const use_interactive_pip = args.use_interactive_pip;
const transport = socket.transport;
var value;
const POST_MESSAGE = TransportTypes.POST_MESSAGE;
if (transport !== POST_MESSAGE) {
defaultImport2 = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_COMMAND;
value = 'command not available from "' + socket.transport + ' transport';
value = new defaultImport2();
throw value;
}
if (socket.application.id == null) {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_COMMAND},
'invalid application');
}
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'EMBEDDED_ACTIVITY_SET_CONFIG',
applicationId: socket.application.id, config: {useInteractivePIP: use_interactive_pip}});
const Promise = global.Promise;
return Promise.resolve({use_interactive_pip: use_interactive_pip});
}
@@ -0,0 +1,32 @@
/* Metro module 13016; source: modules/rpc/server/commands/crossPlatformRPCCommands.tsx; dependencies: [13017, 13019, 13021, 13022, 13023, 13024, 13025, 13030, 13036, 13037, 13038, 13039, 13040, 13041, 13042, 13049, 13052, 13053, 13054, 13055, 13056, 13057, 2] */
function _fun99371(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13206:6, offset: 0x021c5be6, size: 501 bytes, params: 8, frame: 17
var object2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object2 = {};
copyDataProperties(object2, importDefault(13017) /* metro dependency 13017: application */, undefined);
copyDataProperties(object2, importDefault(13019) /* metro dependency 13019: certifiedDevices */, undefined);
copyDataProperties(object2, importDefault(13021) /* metro dependency 13021: channels */, undefined);
copyDataProperties(object2, importDefault(13022) /* metro dependency 13022: config */, undefined);
copyDataProperties(object2, importDefault(13023) /* metro dependency 13023: guilds */, undefined);
copyDataProperties(object2, importDefault(13024) /* metro dependency 13024: images */, undefined);
copyDataProperties(object2, importDefault(13025) /* metro dependency 13025: invites */, undefined);
copyDataProperties(object2, importDefault(13030) /* metro dependency 13030: links */, undefined);
copyDataProperties(object2, importDefault(13036) /* metro dependency 13036: logs */, undefined);
copyDataProperties(object2, importDefault(13037) /* metro dependency 13037: networking */, undefined);
copyDataProperties(object2, importDefault(13038) /* metro dependency 13038: providers */, undefined);
copyDataProperties(object2, importDefault(13039) /* metro dependency 13039: relationships */, undefined);
copyDataProperties(object2, importDefault(13040) /* metro dependency 13040: setActivity */, undefined);
copyDataProperties(object2, importDefault(13041) /* metro dependency 13041: setOrientationLockState */, undefined);
copyDataProperties(object2, importDefault(13042) /* metro dependency 13042: store */, undefined);
copyDataProperties(object2, importDefault(13049) /* metro dependency 13049: subscriptions */, undefined);
copyDataProperties(object2, importDefault(13052) /* metro dependency 13052: users */, undefined);
copyDataProperties(object2, importDefault(13053) /* metro dependency 13053: userSettings */, undefined);
copyDataProperties(object2, importDefault(13054) /* metro dependency 13054: platformBehaviors */, undefined);
copyDataProperties(object2, importDefault(13055) /* metro dependency 13055: soundboard */, undefined);
copyDataProperties(object2, importDefault(13056) /* metro dependency 13056: activities */, undefined);
copyDataProperties(object2, importDefault(13057) /* metro dependency 13057: quests */, undefined);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/crossPlatformRPCCommands.tsx');
exports.crossPlatformCommands = object2;
}
@@ -0,0 +1,94 @@
/* Metro module 13023; source: modules/rpc/server/commands/guilds.tsx; dependencies: [1422, 1867, 661, 4122, 8079, 8076, 2] */
function _fun99412(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13213:6, offset: 0x021c7a4b, size: 276 bytes, params: 8, frame: 21
var object2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = (require(1422) /* metro dependency 1422: GuildRecord */).getGuildIconURL;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const RPCCommands = constantsModule.RPCCommands;
const env0_4 = constantsModule.RPCErrors;
object2 = {};
const GET_GUILD = RPCCommands.GET_GUILD;
const OAuth2Scopes = (require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes;
let RPC = OAuth2Scopes.RPC;
object2[GET_GUILD] = {scope: RPC, validation: validation_99413, handler: function({socket, server, args}) {
var value;
var env0_0 = args.guild_id;
var timeout = args.timeout;
value = server.storeWait(socket, _fun99415, timeout !== undefined ? timeout : 0);
value = value.catch(_fun99416);
return value.then(_fun99417);
}};
const GET_GUILDS = RPCCommands.GET_GUILDS;
RPC = OAuth2Scopes.RPC;
object2[GET_GUILDS] = {scope: RPC, handler: handler_99418};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/guilds.tsx');
exports.default = object2;
}
function validation_99413(a0) { // fn#99413, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13213:232, offset: 0x021c7b5f, size: 110 bytes, params: 2, frame: 14
let value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
value = value.required();
const keys = value.keys;
const object2 = {};
object2.guild_id = a0.string();
object2.timeout = a0.number().min(0).max(60);
return Reflect.apply(keys, value, [object2]);
}
function handler_99414({socket, server, args}) { // fn#99414, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13213:327, offset: 0x021c7bcd, size: 103 bytes, params: 2, frame: 16
const env0_0 = args.guild_id;
let timeout = args.timeout;
timeout = timeout === undefined ? 0 : timeout;
let value = server.storeWait(socket, function() {
return GuildStore.getGuild(guild_id);
}, timeout);
value = value.catch(_fun99416);
return value.then(_fun99417);
}
function handler_99418() { // fn#99418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13213:785, offset: 0x021c7d35, size: 45 bytes, params: 1, frame: 12
const object2 = {};
object2.guilds = GuildStore.getGuildsArray().map(_fun99419);
return object2;
}
function _fun99416() { // fn#99416, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13213:424, offset: 0x021c7c34, size: 73 bytes, params: 1, frame: 13
const value = environment.__proto__;
const defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
const GET_GUILD_TIMED_OUT = RPCErrors.GET_GUILD_TIMED_OUT;
throw new defaultImport({errorCode: GET_GUILD_TIMED_OUT}, 'Request to get guild timed out.');
}
function _fun99417(a0) { // fn#99417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13213:526, offset: 0x021c7c7d, size: 184 bytes, params: 2, frame: 15
var defaultImport;
let value = null;
if (value == a0) {
value = environment.__proto__;
defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
value = 'Invalid guild id: ' + guild_id;
value = new defaultImport({errorCode: RPCErrors.INVALID_GUILD}, value);
throw value;
}
const object2 = {};
object2.id = a0.id;
object2.name = a0.name;
const guildIconURL = getGuildIconURL(a0, 128);
object2.icon_url = value != guildIconURL ? guildIconURL : value;
object2.members = [];
object2.vanity_url_code = a0.vanityURLCode;
return object2;
}
function _fun99419(a0) { // fn#99419, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13213:822, offset: 0x021c7d62, size: 60 bytes, params: 2, frame: 14
const object2 = {};
object2.id = a0.id;
object2.name = a0.name;
let value = environment.__proto__;
value = getGuildIconURL(a0, 128);
const value2 = null;
object2.icon_url = value2 != value ? value : value2;
return object2;
}
@@ -0,0 +1,91 @@
/* Metro module 13024; source: modules/rpc/server/commands/images.tsx; dependencies: [1878, 4135, 661, 8079, 1423, 8076, 1475, 2] */
function _fun99420(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13214:6, offset: 0x021c7d9e, size: 201 bytes, params: 8, frame: 19
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const RPC_LOCAL_SCOPE = (require(4135) /* metro dependency 4135: Constants */).RPC_LOCAL_SCOPE;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const RPCCommands = constantsModule.RPCCommands;
const env0_4 = constantsModule.RPCErrors;
object2 = {};
const GET_IMAGE = RPCCommands.GET_IMAGE;
object2[GET_IMAGE] = {scope: RPC_LOCAL_SCOPE, validation: validation_99421, handler: handler_99422};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/images.tsx');
exports.default = object2;
}
function validation_99421(a0) { // fn#99421, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13214:212, offset: 0x021c7e67, size: 213 bytes, params: 2, frame: 15
let value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
value = value.required();
const keys = value.keys;
const object2 = {};
object2.type = a0.string().required().valid(['user']);
object2.id = a0.string().required();
object2.format = a0.string().required().valid(['png', 'webp', 'jpg']);
object2.size = a0.number().required().valid([16, 32, 64, 128, 256, 512, 1024]);
return Reflect.apply(keys, value, [object2]);
}
function handler_99422({args}) { // fn#99422, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13214:432, offset: 0x021c7f3c, size: 425 bytes, params: 2, frame: 23
var r5;
var value13;
const type = args.type;
const id = args.id;
let format = args.format;
let value = undefined;
format = format === value ? 'png' : format;
let size = args.size;
size = size === value ? 128 : size;
if (type !== 'user') {
r5 = value;
if (r5 == null) {
value = importDefault(8076) /* metro dependency 8076: RPCError */;
value = new value({errorCode: RPCErrors.INVALID_COMMAND}, 'No valid type.');
throw value;
}
value = global.fetch(r5);
value = value.then(function(a0) {
return a0.blob();
});
value = value.then(_fun99424);
return value.then(_fun99425);
}
const user = UserStore.getUser(id);
if (user == null) {
value = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_USER;
value13 = 'Invalid user id: ' + id;
value = new value();
throw value;
}
const userAvatarURL = (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getUserAvatarURL(user, false,
size, format);
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const CDN_HOST = GLOBAL_ENV.CDN_HOST;
r5 = CDN_HOST != null && userAvatarURL.indexOf(CDN_HOST) !== -1 ? userAvatarURL + '&_=' : userAvatarURL;
if (r5 == null) {
value = importDefault(8076) /* metro dependency 8076: RPCError */;
value = new value({errorCode: RPCErrors.INVALID_COMMAND}, 'No valid type.');
throw value;
}
value = global.fetch(r5);
value = value.then(function(a0) {
return a0.blob();
});
value = value.then(_fun99424);
return value.then(function(a0) {
return {data_url: a0};
});
}
function _fun99424(a0) { // fn#99424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13214:839, offset: 0x021c80f4, size: 41 bytes, params: 2, frame: 11
const value = environment.__proto__;
return (require(1475) /* metro dependency 1475: ImageUtils */).readFileAsBase64(a0);
}
function _fun99425(a0) { // fn#99425, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13214:879, offset: 0x021c811d, size: 14 bytes, params: 2, frame: 2
return {data_url: a0};
}
@@ -0,0 +1,417 @@
/* Metro module 13025; source: modules/rpc/server/commands/invites.tsx; dependencies: [5, 1378, 1379, 4135, 661, 482, 13026, 4122, 8077, 10647, 13029, 677, 7860, 2] */
function _fun99426(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99426, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13215:6, offset: 0x021c812b, size: 339 bytes, params: 8, frame: 26
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(5) /* metro dependency 5 */;
const embeddedActivitiesStore = importDefault(1378) /* metro dependency 1378: EmbeddedActivitiesStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const RPC_SCOPE_CONFIG = (require(4135) /* metro dependency 4135: Constants */).RPC_SCOPE_CONFIG;
const env0_5 = (require(661) /* metro dependency 661: Constants */).InstantInviteSources;
let value = require(482) /* metro dependency 482: Constants */;
const RPCCommands = value.RPCCommands;
const env0_6 = value.RPCErrors;
object2 = {};
const INVITE_USER_EMBEDDED = RPCCommands.INVITE_USER_EMBEDDED;
value = require(13026) /* metro dependency 13026: rpcSchema */;
const createRPCCommand = value.createRPCCommand;
const INVITE_USER_EMBEDDED2 = RPCCommands.INVITE_USER_EMBEDDED;
const ANY = RPC_SCOPE_CONFIG.ANY;
const {DM_CHANNELS_MESSAGES_WRITE,
ACTIVITIES_INVITES_WRITE} = (require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes;
object2[INVITE_USER_EMBEDDED] = Reflect.apply(createRPCCommand, value, [INVITE_USER_EMBEDDED2,
{scope: {[ANY]: [DM_CHANNELS_MESSAGES_WRITE, ACTIVITIES_INVITES_WRITE]}, handler: function({socket, args}) {
var env0_1 = args.user_id;
return args.content(_fun99428)();
}}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/invites.tsx');
exports.default = object2;
}
function handler_99427({socket, args}) { // fn#99427, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13215:421, offset: 0x021c827e, size: 67 bytes, params: 2, frame: 11
const env0_1 = args.user_id;
return args.content(_fun99429)();
}
function* _fun99429() { // fn#99429, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13215:465, offset: 0x021c82cc, size: 887 bytes, params: 1, frame: 21
var r8;
var binding;
var RPCError;
var object3;
var prototype;
var rPCError;
var value5;
var type;
var value6;
var binding2;
var property;
var value7;
var sendEmbeddedActivityInviteUser;
var id2;
var object4;
var ACTIVITY_INVITE;
var value8;
var error;
var UNKNOWN_ERROR;
if (false) {
return undefined;
}
value = environment.__proto__;
const id = require.application.id;
if (id == null) {
value = environment.__proto__.__proto__;
throw new env2_0(env2_1[8]).RPCError({errorCode: env2_6.INVALID_COMMAND}, 'No application.');
}
const connectedActivityLocation = env2_3.getConnectedActivityLocation();
if (connectedActivityLocation == null) {
throw new env2_0(env2_1[8]).RPCError({errorCode: env2_6.NO_ELIGIBLE_ACTIVITY},
'No eligible activity for application. Ensure an activity was set using setActivity.');
}
const kind = connectedActivityLocation.kind;
const EmbeddedActivityLocationKind = env2_0(env2_1[9]).EmbeddedActivityLocationKind;
const GUILD_CHANNEL = EmbeddedActivityLocationKind.GUILD_CHANNEL;
if (GUILD_CHANNEL === kind) {
binding = env2_0;
value6 = binding(env2_1[10]);
r8 = value6.validateOpenInviteDialog().channel;
} else {
binding = env2_0;
if (binding(env2_1[9]).EmbeddedActivityLocationKind.GUILD_CHANNEL_MESSAGE === kind) {
binding = env2_0;
value6 = binding(env2_1[10]);
r8 = value6.validateOpenInviteDialog().channel;
} else {
binding = env2_0;
if (binding(env2_1[9]).EmbeddedActivityLocationKind.PRIVATE_CHANNEL === kind) {
binding = env2_4;
value5 = binding.getChannel(connectedActivityLocation.channel_id);
if (value5 == null) {
throw new env2_0(env2_1[8]).RPCError({errorCode: env2_6.INVALID_CHANNEL}, 'Invalid channel');
}
type = value5.type;
binding = env2_0;
if (type === binding(env2_1[11]).ChannelTypes.DM) {
throw new env2_0(env2_1[8]).RPCError({errorCode: env2_6.INVALID_CHANNEL},
'Cannot send invite to a DM');
}
r8 = value5;
} else {
binding = env2_0;
if (binding(env2_1[9]).EmbeddedActivityLocationKind.PRIVATE_CHANNEL_MESSAGE !== kind) {
throw new env2_0(env2_1[8]).RPCError({errorCode: env2_6.NO_ELIGIBLE_ACTIVITY},
'Unsupported activity location');
}
binding = env2_4;
value5 = binding.getChannel(connectedActivityLocation.channel_id);
if (value5 == null) {
throw new env2_0(env2_1[8]).RPCError({errorCode: env2_6.INVALID_CHANNEL}, 'Invalid channel');
}
type = value5.type;
binding = env2_0;
if (type === binding(env2_1[11]).ChannelTypes.DM) {
throw new env2_0(env2_1[8]).RPCError({errorCode: env2_6.INVALID_CHANNEL},
'Cannot send invite to a DM');
}
r8 = value5;
}
}
}
try {
binding = env2_0;
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
binding2 = env2_1;
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
property = binding2[12];
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
value7 = binding(property);
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
sendEmbeddedActivityInviteUser = value7.sendEmbeddedActivityInviteUser;
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
object3 = {};
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
id2 = r8.id;
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
object3.channelId = id2;
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
object3.applicationId = id;
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
object3.userId = dependencyMap;
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
binding = env1_2;
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
object3.prefixedContent = binding;
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
object3.location = 'RPC_ACTIVITY_INVITE_USER';
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
object4 = {};
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
binding = env2_5;
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
ACTIVITY_INVITE = binding.ACTIVITY_INVITE;
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
object4.source = ACTIVITY_INVITE;
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
object3.inviteAnalyticsMetadata = object4;
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
try {
value = Reflect.apply(sendEmbeddedActivityInviteUser, value7, [object3]);
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
yield value;
try {
value = undefined;
value8 = false;
} catch (error) {
binding = env2_0;
RPCError = binding(env2_1[8]).RPCError;
object3 = {};
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
object3.errorCode = UNKNOWN_ERROR;
prototype = RPCError.prototype;
value = Object.create(prototype, {constructor: {value: RPCError}});
rPCError = new RPCError(object3, 'Failed to invite user');
value = rPCError instanceof Object ? rPCError : value;
throw value;
}
return value8 ? value : undefined;
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,47 @@
/* Metro module 13036; source: modules/rpc/server/commands/logs.tsx; dependencies: [661, 3, 8079, 8081, 2] */
function _fun99507(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13226:6, offset: 0x021cb5db, size: 197 bytes, params: 8, frame: 19
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = require(661) /* metro dependency 661: Constants */;
const RPCCommands = value.RPCCommands;
const RPC_APPLICATION_LOGGING_CATEGORY = value.RPC_APPLICATION_LOGGING_CATEGORY;
value = importDefault(3) /* metro dependency 3: Logger */;
value = new value(RPC_APPLICATION_LOGGING_CATEGORY);
object2 = {};
const CAPTURE_LOG = RPCCommands.CAPTURE_LOG;
object2[CAPTURE_LOG] = {validation: validation_99508, handler: handler_99509};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/logs.tsx');
exports.default = object2;
}
function validation_99508(a0) { // fn#99508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13226:208, offset: 0x021cb6a0, size: 133 bytes, params: 2, frame: 15
let value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
value = value.required();
const keys = value.keys;
const object2 = {};
object2.level = a0.string().max(10).required();
object2.message = a0.string().max(1000).required();
return Reflect.apply(keys, value, [object2]);
}
function handler_99509({socket, args}) { // fn#99509, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13226:316, offset: 0x021cb725, size: 231 bytes, params: 2, frame: 18
const level = args.level;
const message = args.message;
const rpcHelpersModule = require(8081) /* metro dependency 8081: RPCHelpers */;
rpcHelpersModule.validatePostMessageTransport(socket.transport);
const value2 = '' + socket.application.id + ' - ' + message;
if (level === 'log') {
env0_3.log(value2);
} else if (level === 'warn') {
env0_3.warn(value2);
} else if (level === 'debug') {
env0_3.verbose(value2);
} else if (level === 'info') {
env0_3.info(value2);
} else if (level === 'error') {
env0_3.error(value2);
}
}
@@ -0,0 +1,100 @@
/* Metro module 13037; source: modules/rpc/server/commands/networking.tsx; dependencies: [4135, 661, 507, 683, 2] */
function _fun99510(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13227:6, offset: 0x021cb80c, size: 273 bytes, params: 8, frame: 21
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const RPC_LOCAL_SCOPE = (require(4135) /* metro dependency 4135: Constants */).RPC_LOCAL_SCOPE;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_3 = constantsModule.Endpoints;
const env0_4 = constantsModule.AnalyticEvents;
const RPCCommands = constantsModule.RPCCommands;
object2 = {};
const GET_NETWORKING_CONFIG = RPCCommands.GET_NETWORKING_CONFIG;
object2[GET_NETWORKING_CONFIG] = {scope: RPC_LOCAL_SCOPE, handler: handler_99511};
const NETWORKING_SYSTEM_METRICS = RPCCommands.NETWORKING_SYSTEM_METRICS;
object2[NETWORKING_SYSTEM_METRICS] = {scope: RPC_LOCAL_SCOPE, handler: function({socket, args}) {
args.application_id = socket.application.id;
importDefault(dependencyMap[3]).track(AnalyticEvents.NETWORKING_SYSTEM_METRICS, args);
}};
const NETWORKING_PEER_METRICS = RPCCommands.NETWORKING_PEER_METRICS;
object2[NETWORKING_PEER_METRICS] = {scope: RPC_LOCAL_SCOPE, handler: function({socket, args}) {
args.application_id = socket.application.id;
importDefault(dependencyMap[3]).track(AnalyticEvents.NETWORKING_PEER_METRICS, args);
}};
const NETWORKING_CREATE_TOKEN = RPCCommands.NETWORKING_CREATE_TOKEN;
object2[NETWORKING_CREATE_TOKEN] = {scope: RPC_LOCAL_SCOPE, handler: handler_99517};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/networking.tsx');
exports.default = object2;
}
function handler_99511() { // fn#99511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13227:230, offset: 0x021cb91d, size: 235 bytes, params: 1, frame: 21
const Promise = global.Promise;
const all = Promise.all;
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
const get = HTTP.get;
const protocol = global.location.protocol;
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const NETWORKING_ENDPOINT = GLOBAL_ENV.NETWORKING_ENDPOINT;
let value2 = Reflect.apply(get, HTTP, [{'url': null, 'retries': 3, 'rejectWithError': false,
url: protocol + NETWORKING_ENDPOINT}]);
items = [value2.then(function(a0) {
return a0.body.address;
})];
const post = HTTP.post;
const NETWORKING_TOKEN = Endpoints.NETWORKING_TOKEN;
let value = Reflect.apply(post, HTTP, [{'url': null, 'retries': 3, 'oldFormErrors': true, 'rejectWithError': false,
url: NETWORKING_TOKEN}]);
items[1] = value.then(function(a0) {
return a0.body.token;
});
return Reflect.apply(all, Promise, [items]).then(function(a0) {
var r0;
var r1;
var r3;
var item3;
var value3;
var iterator = a0[Symbol.iterator]();
var iterator2 = iterator.next;
var item2 = Reflect.apply(iterator2, iterator, []);
var item = item2.value;
item2 = item2.done ? undefined : iterator;
var value = undefined;
var value2 = item2 === value;
var r2 = value2 ? value : item;
if (value2) {
r0 = item2;
r1 = value;
r3 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value;
r3 = value3;
} else {
r0 = item3;
r1 = item;
r3 = value3;
}
}
if (!r3) {
r0.return();
}
return {address: r2, token: r1};
});
}
function handler_99517() { // fn#99517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13227:889, offset: 0x021cbb13, size: 92 bytes, params: 1, frame: 12
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
const post = HTTP.post;
const NETWORKING_TOKEN = Endpoints.NETWORKING_TOKEN;
return Reflect.apply(post, HTTP, [{'url': null, 'retries': 1, 'oldFormErrors': true, 'rejectWithError': false,
url: NETWORKING_TOKEN}]).then(function(a0) {
return a0.body;
});
}
@@ -0,0 +1,15 @@
/* Metro module 13054; source: modules/rpc/server/commands/platformBehaviors.tsx; dependencies: [482, 2] */
function _fun99675(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99675, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13244:6, offset: 0x021d1174, size: 125 bytes, params: 8, frame: 18
var object2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const RPCCommands = (require(482) /* metro dependency 482: Constants */).RPCCommands;
object2 = {};
const GET_PLATFORM_BEHAVIORS = RPCCommands.GET_PLATFORM_BEHAVIORS;
object2[GET_PLATFORM_BEHAVIORS] = {handler: function() {
return {iosKeyboardResizesView: true};
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/platformBehaviors.tsx');
exports.default = object2;
}
@@ -0,0 +1,434 @@
/* Metro module 13038; source: modules/rpc/server/commands/providers.tsx; dependencies: [5, 5040, 4135, 661, 4237, 482, 8079, 8081, 4915, 8076, 694, 1239, 9354, 5042, 2] */
function _fun99519(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13228:6, offset: 0x021cbb6f, size: 434 bytes, params: 8, frame: 26
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = importDefault(5) /* metro dependency 5 */;
const connectedAccountsStore = importDefault(5040) /* metro dependency 5040: ConnectedAccountsStore */;
const {RPC_AUTHENTICATED_SCOPE, RPC_SCOPE_CONFIG} = require(4135) /* metro dependency 4135: Constants */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_6 = constantsModule.AnalyticsLocations;
const env0_7 = constantsModule.ComponentActions;
const env0_8 = constantsModule.PlatformTypes;
const {AM_HARMONY_PRD_APPLICATION_ID,
AM_HARMONY_STG_APPLICATION_ID} = require(4237) /* metro dependency 4237: Constants */;
const constantsModule2 = require(482) /* metro dependency 482: Constants */;
const RPCCommands = constantsModule2.RPCCommands;
const env0_9 = constantsModule2.RPCErrors;
const Set = global.Set;
const set = new Set([AM_HARMONY_PRD_APPLICATION_ID, AM_HARMONY_STG_APPLICATION_ID]);
object2 = {};
const GET_PROVIDER_ACCESS_TOKEN = RPCCommands.GET_PROVIDER_ACCESS_TOKEN;
let ANY = RPC_SCOPE_CONFIG.ANY;
object2[GET_PROVIDER_ACCESS_TOKEN] = {scope: {[ANY]: [RPC_AUTHENTICATED_SCOPE]}, validation: validation_99520,
handler: handler_99521};
const MAYBE_GET_PROVIDER_ACCESS_TOKEN = RPCCommands.MAYBE_GET_PROVIDER_ACCESS_TOKEN;
const object3 = {};
ANY = RPC_SCOPE_CONFIG.ANY;
object3.scope = {[ANY]: [RPC_AUTHENTICATED_SCOPE]};
object3.validation = validation_99534;
const env0_3 = value(_fun99536);
object3.handler = handler_99537;
object2[MAYBE_GET_PROVIDER_ACCESS_TOKEN] = object3;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/providers.tsx');
exports.default = object2;
}
function validation_99520(a0) { // fn#99520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13228:449, offset: 0x021cbd21, size: 95 bytes, params: 2, frame: 14
let value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
value = value.required();
const keys = value.keys;
const object2 = {};
object2.provider = a0.string().required();
object2.connection_redirect = a0.string();
return Reflect.apply(keys, value, [object2]);
}
function handler_99521({socket, args}) { // fn#99521, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13228:552, offset: 0x021cbd80, size: 445 bytes, params: 2, frame: 20
var Promise;
var value5;
var promise;
var defaultImport4;
const provider = args.provider;
const env0_1 = args.connection_redirect;
var value;
const rpcHelpersModule = require(8081) /* metro dependency 8081: RPCHelpers */;
rpcHelpersModule.validatePostMessageTransport(socket.transport);
const moduleValue2 = rpcHelpersModule;
const value2 = moduleValue2.validateApplication(socket.application);
if ((importDefault(4915) /* metro dependency 4915: Platforms */).get(provider) == null) {
defaultImport4 = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_PROVIDER;
value = 'Platform not found for provider "' + provider + '"';
value = new defaultImport4();
throw value;
}
const AMAZON_MUSIC = PlatformTypes.AMAZON_MUSIC;
if (provider !== AMAZON_MUSIC) {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.UNAUTHORIZED_FOR_APPLICATION},
'Command not available for this application');
}
const binding = env0_10;
if (binding.has(value2)) {
Promise = global.Promise;
value = _fun99522();
value5 = Object.create(Promise.prototype, {constructor: {value: Promise}});
promise = new Promise();
return promise instanceof Object ? promise : value5;
}
const defaultImport2 = importDefault(8076) /* metro dependency 8076: RPCError */;
const UNAUTHORIZED_FOR_APPLICATION = RPCErrors.UNAUTHORIZED_FOR_APPLICATION;
throw new defaultImport2({errorCode: UNAUTHORIZED_FOR_APPLICATION}, 'Command not available for this application');
}
function validation_99534(a0) { // fn#99534, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13228:2265, offset: 0x021cc3dd, size: 81 bytes, params: 2, frame: 13
let value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
value = value.required();
const keys = value.keys;
const object2 = {};
object2.provider = a0.string().required();
return Reflect.apply(keys, value, [object2]);
}
async function _fun99536({socket, args}) { // fn#99536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13228:2343, offset: 0x021cc442, size: 641 bytes, params: 2, frame: 21
var account;
var value12;
var value13;
var value21;
if (false) {
return undefined;
}
const provider = args.provider;
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__;
let binding = env1_0;
const binding2 = env1_2;
const value4 = binding(binding2[7]);
value4.validatePostMessageTransport(socket.transport);
const value5 = binding(binding2[7]);
const value6 = value5.validateApplication(socket.application);
const value8 = env1_1(binding2[8]).get(provider);
if (value8 == null) {
value21 = env1_1(env1_2[9]);
value = 'Platform not found for provider "' + provider + '"';
value = new value21({errorCode: env1_9.INVALID_PROVIDER}, value);
throw value;
}
const AMAZON_MUSIC = env1_8.AMAZON_MUSIC;
if (provider !== AMAZON_MUSIC) {
throw new env1_1(env1_2[9])({errorCode: env1_9.UNAUTHORIZED_FOR_APPLICATION},
'Command not available for this application');
}
if (Reflect.apply(env1_10.has, binding, [value6])) {
binding = env1_5;
account = binding.getAccount(null, provider);
if (account == null) {
throw new env1_1(env1_2[9])({errorCode: env1_9.NO_CONNECTION_FOUND}, 'No connection found');
}
binding = env1_1;
value12 = binding(env1_2[13]);
await value12.refreshAccessToken(value8.type, account.id);
value13 = undefined;
if (false) {
return value13;
}
if (value13 == null) {
throw new env1_1(env1_2[9])({errorCode: env1_9.OAUTH2_ERROR},
'Refreshing access token did not return a new access token');
}
return {access_token: value13};
}
const value9 = env1_1(env1_2[9]);
const UNAUTHORIZED_FOR_APPLICATION = env1_9.UNAUTHORIZED_FOR_APPLICATION;
throw new value9({errorCode: UNAUTHORIZED_FOR_APPLICATION}, 'Command not available for this application');
}
function _fun99522() { // fn#99522, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13228:1096, offset: 0x021cbf3d, size: 36 bytes, params: 1, frame: 12
const env0_0 = env1_4(_fun99523);
return _fun99533;
}
function* _fun99523(a0, a1) { // fn#99523, offset: 0x021cbf61, size: 44 bytes, params: 3, frame: 2
const cleanupPromise = function() {
importDefault(dependencyMap[10]).unsubscribe('USER_CONNECTIONS_UPDATE', handleConnectionsUpdate);
var ComponentDispatch = require(dependencyMap[11]).ComponentDispatch;
var CONNECTIONS_CALLBACK_ERROR = ComponentActions.CONNECTIONS_CALLBACK_ERROR;
ComponentDispatch.unsubscribe(CONNECTIONS_CALLBACK_ERROR, handleConnectionsCallbackError);
};
return _fun99524;
}
function* _fun99524(a0, a1) { // fn#99524, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13228:1116, offset: 0x021cbf8d, size: 417 bytes, params: 3, frame: 23
var environment;
var closure;
var closure2;
var getAccount;
var value3;
var value4;
var property;
var defaultImport;
var refreshAccessToken;
var binding;
var type;
var id;
var value5;
var value6;
var value7;
var value8;
var object2;
var defaultImport2;
var OAUTH2_ERROR;
var prototype;
var defaultImport22;
var error;
var defaultImport3;
var subscribe;
var ComponentDispatch;
var CONNECTIONS_CALLBACK_ERROR;
var defaultImport4;
var ACTIVITY_RPC;
let value = undefined;
if (false) {
return value;
}
reduciblePort39: while (true) {
exceptionLanding37: while (true) {
var env0_0 = a0;
var env0_1 = a1;
closure = handleConnectionsUpdate_99525;
var handleConnectionsUpdate_99525 = closure;
closure2 = function() {
var defaultImport = importDefault(dependencyMap[9]);
var object = {};
object.errorCode = RPCErrors.OAUTH2_ERROR;
var value4 = 'OAuth2 setup for "' + provider + '" failed';
var value5 = Object.create(defaultImport.prototype, {constructor: {value: defaultImport}});
var value6 = new defaultImport(object, value4);
require(value6 instanceof Object ? value6 : value5);
cleanupPromise_99528();
};
var handleConnectionsCallbackError_99527 = closure2;
var cleanupPromise_99528Binding = cleanupPromise_99528;
value = environment.__proto__.__proto__.__proto__;
getAccount = ConnectedAccountsStore.getAccount;
value3 = environment.__proto__.__proto__;
value4 = Reflect.apply(getAccount, ConnectedAccountsStore, [null, provider]);
if (value4 == null) {
defaultImport3 = importDefault(dependencyMap[10]);
subscribe = defaultImport3.subscribe;
Reflect.apply(subscribe, defaultImport3, ['USER_CONNECTIONS_UPDATE', closure]);
ComponentDispatch = require(dependencyMap[11]).ComponentDispatch;
subscribe = ComponentDispatch.subscribe;
CONNECTIONS_CALLBACK_ERROR = ComponentActions.CONNECTIONS_CALLBACK_ERROR;
Reflect.apply(subscribe, ComponentDispatch, [CONNECTIONS_CALLBACK_ERROR, closure2]);
defaultImport4 = importDefault(dependencyMap[12]);
type = env2_2.type;
ACTIVITY_RPC = AnalyticsLocations.ACTIVITY_RPC;
defaultImport4({platformType: type, location: ACTIVITY_RPC, successRedirect: connection_redirect});
break reduciblePort39;
}
try {
} catch (error) {
break exceptionLanding37;
}
try {
} catch (error) {
break exceptionLanding37;
}
try {
property = dependencyMap[13];
} catch (error) {
break exceptionLanding37;
}
try {
defaultImport = importDefault(property);
} catch (error) {
break exceptionLanding37;
}
try {
refreshAccessToken = defaultImport.refreshAccessToken;
} catch (error) {
break exceptionLanding37;
}
try {
binding = env2_2;
} catch (error) {
break exceptionLanding37;
}
try {
type = binding.type;
} catch (error) {
break exceptionLanding37;
}
try {
id = value4.id;
} catch (error) {
break exceptionLanding37;
}
try {
value5 = Reflect.apply(refreshAccessToken, defaultImport, [type, id]);
} catch (error) {
break exceptionLanding37;
}
yield value5;
try {
value6 = undefined;
value7 = false;
} catch (error) {
break exceptionLanding37;
}
if (value7) {
return value6;
}
try {
value8 = value6 == null;
} catch (error) {
break exceptionLanding37;
}
if (!value8) {
try {
object2 = {};
} catch (error) {
break exceptionLanding37;
}
try {
object2.access_token = value6;
} catch (error) {
break exceptionLanding37;
}
try {
a0(object2);
} catch (error) {
break exceptionLanding37;
}
break reduciblePort39;
}
try {
} catch (error) {
break exceptionLanding37;
}
try {
} catch (error) {
break exceptionLanding37;
}
try {
property = dependencyMap[9];
} catch (error) {
break exceptionLanding37;
}
try {
defaultImport2 = importDefault(property);
} catch (error) {
break exceptionLanding37;
}
try {
object2 = {};
} catch (error) {
break exceptionLanding37;
}
try {
} catch (error) {
break exceptionLanding37;
}
try {
OAUTH2_ERROR = RPCErrors.OAUTH2_ERROR;
} catch (error) {
break exceptionLanding37;
}
try {
object2.errorCode = OAUTH2_ERROR;
} catch (error) {
break exceptionLanding37;
}
try {
prototype = defaultImport2.prototype;
} catch (error) {
break exceptionLanding37;
}
try {
} catch (error) {
break exceptionLanding37;
}
try {
defaultImport22 = new defaultImport2(object2,
'Refreshing access token did not return a new access token');
} catch (error) {
break exceptionLanding37;
}
try {
value = defaultImport22 instanceof Object ? defaultImport22 : value;
} catch (error) {
break exceptionLanding37;
}
try {
throw value;
} catch (error) {
break exceptionLanding37;
}
}
a1(error);
break reduciblePort39;
}
}
function handleConnectionsUpdate(a0) { // fn#99529, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13228:1170, offset: 0x021cc284, size: 96 bytes, params: 2, frame: 12
var environment;
var value2;
let value = environment.__proto__.__proto__;
if (env2_2 != null) {
value = (a0.accounts ?? []).find(_fun99530);
if (value != null) {
value2 = environment.__proto__;
env1_0({access_token: value.access_token});
cleanupPromise();
}
}
}
function handleConnectionsCallbackError() { // fn#99531, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13228:1347, offset: 0x021cc2fe, size: 125 bytes, params: 1, frame: 17
let value = environment.__proto__.__proto__.__proto__;
const binding = env3_4;
const defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
const OAUTH2_ERROR = RPCErrors.OAUTH2_ERROR;
value = environment.__proto__.__proto__;
value = 'OAuth2 setup for "' + provider + '" failed';
value = new defaultImport({errorCode: OAUTH2_ERROR}, value);
binding(value);
cleanupPromise();
}
function handleConnectionsUpdate_99525(a0) { // fn#99525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13228:1170, offset: 0x021cc12e, size: 93 bytes, params: 2, frame: 12
var environment;
let value = environment.__proto__.__proto__.__proto__;
if (env3_2 != null) {
value = (a0.accounts ?? []).find(_fun99526);
if (value != null) {
env0_0({access_token: value.access_token});
cleanupPromise_99528();
}
}
}
function cleanupPromise_99528() { // fn#99528, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13228:1483, offset: 0x021cc222, size: 98 bytes, params: 1, frame: 17
const defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
let unsubscribe = defaultImport.unsubscribe;
Reflect.apply(unsubscribe, defaultImport, ['USER_CONNECTIONS_UPDATE', handleConnectionsUpdate_99525]);
const ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch;
unsubscribe = ComponentDispatch.unsubscribe;
const CONNECTIONS_CALLBACK_ERROR = ComponentActions.CONNECTIONS_CALLBACK_ERROR;
Reflect.apply(unsubscribe, ComponentDispatch, [CONNECTIONS_CALLBACK_ERROR, handleConnectionsCallbackError_99527]);
}
function _fun99530({type}) { // fn#99530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13228:1264, offset: 0x021cc2e4, size: 26 bytes, params: 2, frame: 2
return type === env3_2.type;
}
function _fun99526({type}) { // fn#99526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13228:1264, offset: 0x021cc18b, size: 26 bytes, params: 2, frame: 2
return type === env4_2.type;
}
@@ -0,0 +1,216 @@
/* Metro module 13057; source: modules/rpc/server/commands/quests.tsx; dependencies: [7093, 661, 4122, 8081, 7116, 8076, 683, 694, 9524, 2] */
function _fun99692(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99692, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13247:6, offset: 0x021d19fa, size: 307 bytes, params: 8, frame: 21
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const questStore = importDefault(7093) /* metro dependency 7093: QuestStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const RPCCommands = constantsModule.RPCCommands;
const env0_4 = constantsModule.RPCErrors;
const env0_5 = constantsModule.AnalyticEvents;
object2 = {};
const GET_QUEST_ENROLLMENT_STATUS = RPCCommands.GET_QUEST_ENROLLMENT_STATUS;
const OAuth2Scopes = (require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes;
let IDENTIFY = OAuth2Scopes.IDENTIFY;
object2[GET_QUEST_ENROLLMENT_STATUS] = {scope: IDENTIFY, handler: handler_99693};
const QUEST_START_TIMER = RPCCommands.QUEST_START_TIMER;
IDENTIFY = OAuth2Scopes.IDENTIFY;
object2[QUEST_START_TIMER] = {scope: IDENTIFY, handler: handler_99694};
const GET_QUEST = RPCCommands.GET_QUEST;
IDENTIFY = OAuth2Scopes.IDENTIFY;
object2[GET_QUEST] = {scope: IDENTIFY, handler: handler_99695};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/quests.tsx');
exports.default = object2;
}
function handler_99693({socket, args}) { // fn#99693, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13247:238, offset: 0x021d1b2d, size: 303 bytes, params: 2, frame: 19
var defaultImport;
const quest_id = args.quest_id;
var value;
const rpcHelpersModule = require(8081) /* metro dependency 8081: RPCHelpers */;
rpcHelpersModule.validatePostMessageTransport(socket.transport);
const moduleValue2 = rpcHelpersModule;
const value3 = moduleValue2.validateApplication(socket.application);
const quest = QuestStore.getQuest(quest_id);
const activityApplicationId = (require(7116) /* metro dependency 7116: QuestTaskUtils */).getActivityApplicationId(quest);
if (quest == null) {
defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_COMMAND;
value = 'Quest not found: ' + quest_id;
value = new defaultImport();
throw value;
}
if (activityApplicationId == null) {
defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_COMMAND;
value = 'Quest not found: ' + quest_id;
value = new defaultImport();
throw value;
}
if (activityApplicationId !== value3) {
defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_COMMAND;
value = 'Quest not found: ' + quest_id;
value = new defaultImport();
throw value;
}
const object2 = {quest_id: quest_id};
let userStatus = quest.userStatus;
object2.is_enrolled = userStatus?.enrolledAt != null;
userStatus = quest.userStatus;
object2.enrolled_at = userStatus?.enrolledAt ?? null;
return object2;
}
function handler_99694({socket, args}) { // fn#99694, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13247:755, offset: 0x021d1c5c, size: 435 bytes, params: 2, frame: 20
var defaultImport3;
const quest_id = args.quest_id;
var value;
const rpcHelpersModule = require(8081) /* metro dependency 8081: RPCHelpers */;
rpcHelpersModule.validatePostMessageTransport(socket.transport);
const moduleValue2 = rpcHelpersModule;
const value3 = moduleValue2.validateApplication(socket.application);
const quest = QuestStore.getQuest(quest_id);
const playActivityApplicationId = (require(7116) /* metro dependency 7116: QuestTaskUtils */).getPlayActivityApplicationId(quest);
if (quest == null) {
defaultImport3 = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_COMMAND;
value = 'Quest not found: ' + quest_id;
value = new defaultImport3();
throw value;
}
if (playActivityApplicationId == null) {
defaultImport3 = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_COMMAND;
value = 'Quest not found: ' + quest_id;
value = new defaultImport3();
throw value;
}
if (playActivityApplicationId !== value3) {
defaultImport3 = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_COMMAND;
value = 'Quest not found: ' + quest_id;
value = new defaultImport3();
throw value;
}
const userStatus = quest.userStatus;
if (userStatus?.enrolledAt == null) {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_COMMAND},
'User is not enrolled in quest');
}
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const RPC_QUEST_START_TIMER_CALLED = AnalyticEvents.RPC_QUEST_START_TIMER_CALLED;
Reflect.apply(track, defaultImport, [RPC_QUEST_START_TIMER_CALLED, {application_id: value3, quest_id: quest_id}]);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.dispatch({type: 'QUEST_APPLICATION_START_TIMER', questId: quest_id, applicationId: value3});
return {success: true};
}
function handler_99695({socket}) { // fn#99695, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13247:1425, offset: 0x021d1e0f, size: 235 bytes, params: 2, frame: 20
const rpcHelpersModule = require(8081) /* metro dependency 8081: RPCHelpers */;
rpcHelpersModule.validatePostMessageTransport(socket.transport);
const moduleValue2 = rpcHelpersModule;
const eligibleQuestsForApplicationId = (require(9524) /* metro dependency 9524: QuestMatchingUtils */).getEligibleQuestsForApplicationId(QuestStore.quests,
moduleValue2.validateApplication(socket.application), true);
if (eligibleQuestsForApplicationId.length === 0) {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_COMMAND},
'No eligible quests found');
}
let value = eligibleQuestsForApplicationId.map(function(a0) {
var r5;
var r3;
var property = a0.userStatus;
var value = null;
var value2 = undefined;
r5 = value == property ? value2 : property.enrolledAt;
property = a0.userStatus;
r3 = value == property ? value2 : property.completedAt;
return {quest_id: a0.id, enrolled_at: value != r5 ? r5 : value, completed_at: value != r3 ? r3 : value,
external_cta_url: a0.config.ctaConfig.link};
});
return value.sort(_fun99697)[0];
}
function _fun99697(a0, a1) { // fn#99697, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13247:1944, offset: 0x021d1f70, size: 169 bytes, params: 3, frame: 16
var r2;
var r1;
var r0;
var value;
var Date;
var prototype;
var date;
var value2;
var value3;
let enrolled_at = a0.enrolled_at;
if (enrolled_at != null) {
enrolled_at = a0.enrolled_at;
value = 1;
if (enrolled_at == null) {
r1 = value;
} else {
enrolled_at = a1.enrolled_at;
value = -1;
if (enrolled_at == null) {
r2 = value;
} else {
Date = global.Date;
enrolled_at = a0.enrolled_at;
prototype = Date.prototype;
value = Object.create(prototype, {constructor: {value: Date}});
date = new Date(enrolled_at);
value = date instanceof Object ? date : value;
value = value.getTime();
Date = global.Date;
enrolled_at = a1.enrolled_at;
prototype = Date.prototype;
value2 = Object.create(prototype, {constructor: {value: Date}});
date = new Date(enrolled_at);
value3 = date instanceof Object ? date : value2;
value -= value3.getTime();
r2 = value;
}
r1 = r2;
}
r0 = r1;
} else {
enrolled_at = a1.enrolled_at;
value = 0;
if (enrolled_at == null) {
r0 = value;
} else {
enrolled_at = a0.enrolled_at;
value = 1;
if (enrolled_at == null) {
r1 = value;
} else {
enrolled_at = a1.enrolled_at;
value = -1;
if (enrolled_at == null) {
r2 = value;
} else {
Date = global.Date;
enrolled_at = a0.enrolled_at;
prototype = Date.prototype;
value = Object.create(prototype, {constructor: {value: Date}});
date = new Date(enrolled_at);
value = date instanceof Object ? date : value;
value = value.getTime();
Date = global.Date;
enrolled_at = a1.enrolled_at;
prototype = Date.prototype;
value2 = Object.create(prototype, {constructor: {value: Date}});
date = new Date(enrolled_at);
value3 = date instanceof Object ? date : value2;
value -= value3.getTime();
r2 = value;
}
r1 = r2;
}
r0 = r1;
}
}
return r0;
}
@@ -0,0 +1,208 @@
/* Metro module 13039; source: modules/rpc/server/commands/relationships.tsx; dependencies: [57, 3793, 1878, 4135, 661, 13026, 4122, 483, 8076, 8081, 2] */
function _fun99538(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13229:6, offset: 0x021cc6c3, size: 345 bytes, params: 8, frame: 25
var object2;
const env0_0 = require;
const _arrayLikeToArray_99541 = 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 Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importDefault(57) /* metro dependency 57 */;
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const RPC_SCOPE_CONFIG = (require(4135) /* metro dependency 4135: Constants */).RPC_SCOPE_CONFIG;
let value = require(661) /* metro dependency 661: Constants */;
const env0_7 = value.ApplicationFlags;
const env0_8 = value.RelationshipTypes;
const RPCCommands = value.RPCCommands;
const env0_9 = value.RPCErrors;
object2 = {};
const GET_RELATIONSHIPS = RPCCommands.GET_RELATIONSHIPS;
value = require(13026) /* metro dependency 13026: rpcSchema */;
const createRPCCommand = value.createRPCCommand;
const GET_RELATIONSHIPS2 = RPCCommands.GET_RELATIONSHIPS;
const ANY = RPC_SCOPE_CONFIG.ANY;
const OAuth2Scopes = (require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes;
const RELATIONSHIPS_READ = OAuth2Scopes.RELATIONSHIPS_READ;
object2[GET_RELATIONSHIPS] = Reflect.apply(createRPCCommand, value, [GET_RELATIONSHIPS2,
{scope: {[ANY]: [RELATIONSHIPS_READ]}, handler: handler_99542}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/relationships.tsx');
exports.default = object2;
}
function _createForOfIteratorHelperLoose_99539(a0, a1) { // fn#99539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13229:242, offset: 0x021cc81c, size: 372 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 _fun99540;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_99541(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_99541(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_99541(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun99540;
}
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 handler_99542(a0) { // fn#99542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13229:1287, offset: 0x021cc990, size: 434 bytes, params: 2, frame: 27
var r5;
var value7;
var value8;
var property;
var property2;
var NONE;
var user;
var moduleValue4;
var value10;
var push;
var moduleValue5;
var transformApplicationRelationship;
var id;
var value11;
const bigFlagUtilsModule = importAll(483) /* metro dependency 483: BigFlagUtils */;
const has = bigFlagUtilsModule.has;
const moduleValue2 = bigFlagUtilsModule;
let deserialize = moduleValue2.deserialize;
let socket = a0.socket;
let application = socket.application;
const flags = application.flags;
const value2 = 0;
const value3 = Reflect.apply(deserialize, moduleValue2, [flags ?? value2]);
const moduleValue3 = bigFlagUtilsModule;
deserialize = moduleValue3.deserialize;
const DISABLE_RELATIONSHIPS_ACCESS = ApplicationFlags.DISABLE_RELATIONSHIPS_ACCESS;
if (Reflect.apply(has, bigFlagUtilsModule, [value3, Reflect.apply(deserialize, moduleValue3,
[DISABLE_RELATIONSHIPS_ACCESS])])) {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_PERMISSIONS},
'Missing Permissions');
}
const items = [];
const _createForOfIteratorHelperLoose_99539Binding = _createForOfIteratorHelperLoose_99539;
const mutableRelationships = RelationshipStore.getMutableRelationships();
const value5 = _createForOfIteratorHelperLoose_99539Binding(mutableRelationships.entries());
const value6 = value5();
let done = value6.done;
if (!done) {
r5 = value6;
while (true) {
value7 = r5.value;
value8 = env0_4(value7, 2);
property = value8[value2];
property2 = value8[1];
NONE = RelationshipTypes.NONE;
if (property2 !== NONE) {
user = UserStore.getUser(property);
if (user == null) {
break;
}
moduleValue4 = require(8081) /* metro dependency 8081: RPCHelpers */;
value10 = moduleValue4.transformBaseRelationship(property2, user);
push = items.push;
moduleValue5 = require(8081) /* metro dependency 8081: RPCHelpers */;
transformApplicationRelationship = moduleValue5.transformApplicationRelationship;
socket = a0.socket;
application = socket.application;
id = application.id;
Reflect.apply(push, items, [Reflect.apply(transformApplicationRelationship, moduleValue5, [value10,
id])]);
break;
}
value11 = value5();
done = value11.done;
if (done) {
break;
}
r5 = value11;
continue;
}
}
return {relationships: items};
}
@@ -0,0 +1,548 @@
/* Metro module 13040; source: modules/rpc/server/commands/setActivity.tsx; dependencies: [4234, 4135, 661, 4122, 8079, 8844, 8076, 694, 6884, 8045, 22, 672, 6873, 683, 2] */
function _fun99543(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99543, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13230:6, offset: 0x021ccb42, size: 345 bytes, params: 8, frame: 24
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const applicationStore = importDefault(4234) /* metro dependency 4234: ApplicationStore */;
let value = require(4135) /* metro dependency 4135: Constants */;
const RPC_SCOPE_CONFIG = value.RPC_SCOPE_CONFIG;
const RPC_LOCAL_SCOPE = value.RPC_LOCAL_SCOPE;
const env0_4 = value.TransportTypes;
value = require(661) /* metro dependency 661: Constants */;
const env0_5 = value.ActivityGamePlatforms;
const env0_6 = value.ActivityPartyPrivacy;
const env0_7 = value.ActivityTypes;
const env0_8 = value.AnalyticEvents;
const RPCCommands = value.RPCCommands;
const env0_9 = value.RPCErrors;
const env0_10 = ['1402418171662569542'];
object2 = {};
const SET_ACTIVITY = RPCCommands.SET_ACTIVITY;
const ANY = RPC_SCOPE_CONFIG.ANY;
const {RPC, RPC_ACTIVITIES_WRITE} = (require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes;
object2[SET_ACTIVITY] = {scope: {[ANY]: [RPC, RPC_ACTIVITIES_WRITE, RPC_LOCAL_SCOPE]}, validation: validation_99544,
handler: handler_99545};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/setActivity.tsx');
exports.default = object2;
}
function validation_99544(a0) { // fn#99544, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13230:449, offset: 0x021ccc9b, size: 1470 bytes, params: 2, frame: 34
const value3 = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0).required();
const keys = value3.keys;
const object8 = {};
const value4 = a0.number();
object8.pid = value4.min(0);
const value5 = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
const keys2 = value5.keys;
const object9 = {};
const value7 = a0.string().min(1);
object9.name = value7.max(128);
object9.state = a0.string().min(2).max(128);
object9.state_url = a0.string().uri().min(1).max(256);
object9.details = a0.string().min(2).max(128);
object9.details_url = a0.string().uri().min(1).max(256);
const value18 = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
const keys3 = value18.keys;
const object10 = {};
object10.start = a0.number().min(1);
object10.end = a0.number().min(1);
object9.timestamps = Reflect.apply(keys3, value18, [object10]);
const value21 = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
const keys4 = value21.keys;
const object11 = {};
object11.large_image = a0.string().min(1).max(300);
object11.large_text = a0.string().min(2).max(128);
object11.large_url = a0.string().uri().min(1).max(256);
object11.small_image = a0.string().min(1).max(300);
object11.small_text = a0.string().min(2).max(128);
object11.small_url = a0.string().uri().min(1).max(256);
object11.invite_cover_image = a0.string().min(1).max(300);
object9.assets = Reflect.apply(keys4, value21, [object11]);
const value38 = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
const keys5 = value38.keys;
const object12 = {};
object12.id = a0.string().min(2).max(128);
const value41 = a0.array();
let items2 = value41.items;
const value42 = a0.number();
object12.size = Reflect.apply(items2, value41, [value42.min(0)]).length(2);
const value44 = a0.number();
let PRIVATE = ActivityPartyPrivacy.PRIVATE;
const value45 = value44.default(PRIVATE);
let valid = value45.valid;
PRIVATE = ActivityPartyPrivacy.PRIVATE;
const PUBLIC = ActivityPartyPrivacy.PUBLIC;
object12.privacy = Reflect.apply(valid, value45, [[PRIVATE, PUBLIC]]);
object9.party = Reflect.apply(keys5, value38, [object12]);
const value46 = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
const keys6 = value46.keys;
const object13 = {};
object13.match = a0.string().min(2).max(128);
object13.join = a0.string().min(2).max(128);
object13.spectate = a0.string().min(2).max(128);
object9.secrets = Reflect.apply(keys6, value46, [object13]);
const value53 = a0.array();
items2 = value53.items;
const value54 = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
const keys7 = value54.keys;
const object14 = {};
object14.label = a0.string().min(1).max(32).required();
object14.url = a0.string().uri().min(1).max(512).required();
object9.buttons = Reflect.apply(items2, value53, [Reflect.apply(keys7, value54, [object14])]).min(1).max(2);
object9.instance = a0.boolean();
const value64 = a0.array();
items2 = value64.items;
const value66 = a0.string().min(1);
object9.supported_platforms = Reflect.apply(items2, value64, [value66.max(32)]).min(1).max(10);
const value69 = a0.number();
let PLAYING = ActivityTypes.PLAYING;
const value70 = value69.default(PLAYING);
valid = value70.valid;
PLAYING = ActivityTypes.PLAYING;
const LISTENING = ActivityTypes.LISTENING;
const WATCHING = ActivityTypes.WATCHING;
const COMPETING = ActivityTypes.COMPETING;
object9.type = Reflect.apply(valid, value70, [PLAYING, LISTENING, WATCHING, COMPETING]);
const value72 = a0.number().optional();
valid = value72.valid;
const {NAME, STATE, DETAILS} = (require(8844) /* metro dependency 8844: StatusDisplayTypes */).StatusDisplayTypes;
object9.status_display_type = Reflect.apply(valid, value72, [NAME, STATE, DETAILS]);
object8.activity = Reflect.apply(keys2, value5, [object9]).allow(null);
return Reflect.apply(keys, value3, [object8]);
}
function handler_99545({socket, args, isSocketConnected}) { // fn#99545, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13230:1903, offset: 0x021cd259, size: 1551 bytes, params: 2, frame: 32
var r8;
var r12;
var privacy;
var r14;
var r5;
var prototype;
var name;
var application;
var id;
var value5;
var getApplication;
var value6;
var instance;
var party;
var moduleValue;
var computeActivityFlags;
var value8;
var moduleValue2;
var canLaunchFrame;
var canLaunchFrame2;
var activityFlags;
var value9;
var assets;
var secrets;
var timestamps;
var buttons;
var PLAYING;
var value11;
var defaultImport2;
var intersection;
var length;
var binding;
var defaultImport3;
var uniq;
var length2;
var map;
var Object;
var keys;
var value13;
var property;
var Date;
var now;
var value14;
var toString;
var property2;
var length3;
var Math;
var floor;
var property3;
var Millis;
var SECOND;
var value15;
var fetchAssetIds;
var large_image;
var small_image;
var invite_cover_image;
var Error;
var error;
const pid = args.pid;
const activity = args.activity;
let value = undefined;
const IPC = TransportTypes.IPC;
let object = [IPC];
const WEBSOCKET = TransportTypes.WEBSOCKET;
object[1] = WEBSOCKET;
const POST_MESSAGE = TransportTypes.POST_MESSAGE;
object[2] = POST_MESSAGE;
let includes = object.includes;
if (Reflect.apply(includes, object, [socket.transport])) {
if (pid == null) {
reducibleJoin4: while (true) {
if (TransportTypes.IPC === socket.transport) {
value = importDefault(8076) /* metro dependency 8076: RPCError */;
value = new value({errorCode: RPCErrors.INVALID_COMMAND}, 'nonzero pid required');
throw value;
}
break reducibleJoin4;
}
}
if (activity == null) {
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'LOCAL_ACTIVITY_UPDATE',
socketId: socket.id, pid: pid, activity: activity});
return global.Promise.resolve(activity);
}
object = {};
name = activity.name;
reducibleJoin7: while (true) {
if (name) {
break reducibleJoin7;
}
application = socket.application;
name = application.name;
activity.name = name;
break reducibleJoin7;
}
application = socket.application;
id = application.id;
activity.application_id = id;
value5 = socket.transport === TransportTypes.POST_MESSAGE;
r8 = value5 ? ActivityGamePlatforms.EMBEDDED : ActivityGamePlatforms.DESKTOP;
activity.platform = r8;
getApplication = ApplicationStore.getApplication;
r8 = id ?? value;
value6 = Reflect.apply(getApplication, ApplicationStore, [r8]);
instance = activity.instance;
r12 = instance != null && instance;
party = activity.party;
reducibleJoin14: while (true) {
if (party == null) {
privacy = value;
break reducibleJoin14;
}
privacy = party.privacy;
break reducibleJoin14;
}
delete activity.instance;
party = activity.party;
reducibleJoin16: while (true) {
if (party == null) {
break reducibleJoin16;
}
delete party.privacy;
break reducibleJoin16;
}
moduleValue = require(6884) /* metro dependency 6884: ActivityFlagUtils */;
computeActivityFlags = moduleValue.computeActivityFlags;
value8 = value6 != null;
reducibleJoin18: while (true) {
if (value8) {
moduleValue2 = require(8045) /* metro dependency 8045: canLaunchFrame */;
canLaunchFrame = moduleValue2.canLaunchFrame;
canLaunchFrame2 = Reflect.apply(canLaunchFrame, moduleValue2, [value6]);
r8 = canLaunchFrame2;
break reducibleJoin18;
}
r8 = value8;
break reducibleJoin18;
}
r8 = r8 && value5;
activityFlags = Reflect.apply(computeActivityFlags, moduleValue, [activity, r12, value5, r8, privacy]);
value9 = 0;
reducibleJoin21: while (true) {
if (activityFlags > value9) {
activity.flags = activityFlags;
break reducibleJoin21;
}
break reducibleJoin21;
}
assets = activity.assets;
party = activity.party;
secrets = activity.secrets;
timestamps = activity.timestamps;
buttons = activity.buttons;
reducibleJoin23: while (true) {
if (activity.type != null) {
break reducibleJoin23;
}
PLAYING = ActivityTypes.PLAYING;
activity.type = PLAYING;
break reducibleJoin23;
}
if (secrets != null) {
value11 = (importDefault(22) /* metro dependency 22 */).values(secrets).filter(function(a0) {
return !!a0;
});
reducibleJoin30: while (true) {
reducibleJoin28: while (true) {
if (party == null) {
break reducibleJoin28;
}
defaultImport2 = importDefault(22) /* metro dependency 22 */;
intersection = defaultImport2.intersection;
id = party.id;
length = Reflect.apply(intersection, defaultImport2, [value11, [id]]).length;
if (length > value9) {
binding = env0_10;
includes = binding.includes;
application = socket.application;
id = application.id;
if (!Reflect.apply(includes, binding, [id])) {
value = importDefault(8076) /* metro dependency 8076: RPCError */;
value = new value({errorCode: RPCErrors.INVALID_ACTIVITY_SECRET},
'secrets cannot match the party id');
throw value;
}
break reducibleJoin28;
}
break reducibleJoin28;
}
defaultImport3 = importDefault(22) /* metro dependency 22 */;
uniq = defaultImport3.uniq;
length = Reflect.apply(uniq, defaultImport3, [value11]).length;
length2 = value11.length;
if (length < length2) {
value = importDefault(8076) /* metro dependency 8076: RPCError */;
value = new value({errorCode: RPCErrors.INVALID_ACTIVITY_SECRET}, 'secrets must be unique');
throw value;
}
if (buttons != null) {
value = importDefault(8076) /* metro dependency 8076: RPCError */;
value = new value({errorCode: RPCErrors.INVALID_ACTIVITY_SECRET},
'secrets cannot currently be sent with buttons');
throw value;
}
break reducibleJoin30;
}
}
reducibleJoin32: while (true) {
if (buttons == null) {
break reducibleJoin32;
}
map = buttons.map;
object.button_urls = Reflect.apply(map, buttons, [_fun99547]);
map = buttons.map;
activity.buttons = Reflect.apply(map, buttons, [_fun99548]);
break reducibleJoin32;
}
activity.metadata = object;
reducibleJoin37: while (true) {
if (timestamps == null) {
break reducibleJoin37;
}
Object = global.Object;
keys = Object.keys;
value13 = Reflect.apply(keys, Object, [timestamps]);
length = value13.length;
if (!(value9 < length)) {
break reducibleJoin37;
}
r14 = value9;
reducibleLoop34: while (true) {
property = value13[r14];
Date = global.Date;
now = Date.now;
value14 = Reflect.apply(now, Date, []);
toString = value14.toString;
length = Reflect.apply(toString, value14, []).length;
property2 = timestamps[property];
toString = property2.toString;
length3 = Reflect.apply(toString, property2, []).length;
reducibleJoin36: while (true) {
if (length - length3 > 2) {
Math = global.Math;
floor = Math.floor;
property3 = timestamps[property];
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
SECOND = Millis.SECOND;
timestamps[property] = Reflect.apply(floor, Math, [property3 * SECOND]);
break reducibleJoin36;
}
break reducibleJoin36;
}
value15 = typeof r14 === 'bigint' ? r14 + 1n : +r14 + 1;
length = value13.length;
if (value15 < length) {
r14 = value15;
continue reducibleLoop34;
}
break reducibleJoin37;
}
}
if (assets == null) {
r5 = global.Promise.resolve([]);
} else {
application = socket.application;
reducibleJoin43: while (true) {
reducibleJoin41: while (true) {
if (application == null) {
break reducibleJoin41;
}
application = socket.application;
id = application.id;
if (id == null) {
break reducibleJoin41;
}
value = require(6873) /* metro dependency 6873: ApplicationAssetUtils */;
fetchAssetIds = value.fetchAssetIds;
application = socket.application;
id = application.id;
large_image = assets.large_image;
small_image = assets.small_image;
invite_cover_image = assets.invite_cover_image;
value = Reflect.apply(fetchAssetIds, value, [id, [large_image, small_image, invite_cover_image]]);
r5 = value;
break reducibleJoin43;
}
Error = global.Error;
prototype = Error.prototype;
value = Object.create(prototype, {constructor: {value: Error}});
error = new Error();
value = error instanceof Object ? error : value;
throw value;
}
}
return r5.then(_fun99549);
}
value = importDefault(8076) /* metro dependency 8076: RPCError */;
const INVALID_COMMAND = RPCErrors.INVALID_COMMAND;
value = new value({errorCode: INVALID_COMMAND}, 'command not available from "' + socket.transport + '" transport');
throw value;
}
function _fun99549(a0) { // fn#99549, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13230:3811, offset: 0x021cd868, size: 704 bytes, params: 2, frame: 20
var r0;
var r1;
var r3;
var r2;
var r7;
var item3;
var value3;
var item4;
var value4;
var value6;
var defaultImport;
var dispatch;
var object2;
var socketBinding;
var id;
var activityBinding;
var secrets;
var party;
var details;
var value7;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
let value = undefined;
const value2 = item2 === value;
const r4 = value2 ? value : item;
if (value2) {
r0 = item2;
r1 = value2;
r3 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value3;
r3 = value;
} else {
r0 = item3;
r1 = value3;
r3 = item;
}
}
if (r1) {
r2 = value;
} else {
item4 = Reflect.apply(iterator2, r0, []);
item = item4.value;
item4 = item4.done ? undefined : r0;
value4 = item4 === value;
if (value4) {
r0 = item4;
r1 = value4;
r2 = value;
} else {
r0 = item4;
r1 = value4;
r2 = item;
}
}
if (!r1) {
r0.return();
}
if (assets != null) {
if (r4 != null) {
assets.large_image = r4;
} else {
delete assets.large_image;
}
if (r3 != null) {
assets.small_image = r3;
} else {
delete assets.small_image;
}
if (r2 != null) {
assets.invite_cover_image = r2;
} else {
delete assets.invite_cover_image;
}
}
if (isSocketConnected()) {
value6 = environment.__proto__;
defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
dispatch = defaultImport.dispatch;
socketBinding = socket;
id = socketBinding.id;
activityBinding = activity;
Reflect.apply(dispatch, defaultImport, [{type: 'LOCAL_ACTIVITY_UPDATE', socketId: id, pid: pid,
activity: activityBinding, partyPrivacy: privacy}]);
secrets = activityBinding.secrets;
party = activityBinding.party;
object2 = {};
id = socketBinding.application.id;
object2.application_id = id;
object2.type = activityBinding.type;
object2.name = activityBinding.name;
object2.status_display_type = activityBinding.status_display_type;
details = activityBinding.details;
value7 = '';
object2.details = details ?? value7;
r7 = activity.state ?? value7;
object2.state = r7;
r7 = activity.state_url != null || activity.details_url != null;
r7 = !r7 ? (activity.assets == null ? value : activity.assets.large_url) != null : r7;
r7 = !r7 ? (activity.assets == null ? value : activity.assets.small_url) != null : r7;
object2.has_urls = r7;
if (secrets != null) {
object2.has_match_secret = !!secrets.match;
object2.has_join_secret = !!secrets.join;
}
if (assets != null) {
r3 = assets.large_image || assets.small_image;
r3 = !r3 ? assets.invite_cover_image : r3;
object2.has_images = !!r3;
}
if (party != null) {
object2.party_max = party.size != null && party.size[1] > 0 ? party.size[1] : value;
object2.party_id = party.id;
}
value = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
value.track(AnalyticEvents.ACTIVITY_UPDATED, object2);
return activity;
}
return value;
}
@@ -0,0 +1,61 @@
/* Metro module 13041; source: modules/rpc/server/commands/setOrientationLockState.tsx; dependencies: [4237, 482, 8079, 694, 8076, 2] */
function _fun99550(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99550, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13231:6, offset: 0x021cdb28, size: 180 bytes, params: 8, frame: 19
var object2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = (require(4237) /* metro dependency 4237: Constants */).OrientationLockState;
const constantsModule = require(482) /* metro dependency 482: Constants */;
const RPCCommands = constantsModule.RPCCommands;
const env0_3 = constantsModule.RPCErrors;
object2 = {};
const SET_ORIENTATION_LOCK_STATE = RPCCommands.SET_ORIENTATION_LOCK_STATE;
object2[SET_ORIENTATION_LOCK_STATE] = {validation: validation_99551, handler: handler_99552};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/setOrientationLockState.tsx');
exports.default = object2;
}
function validation_99551(a0) { // fn#99551, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13231:213, offset: 0x021cdbdc, size: 253 bytes, params: 2, frame: 20
var value;
const value3 = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0).required();
const keys = value3.keys;
const object2 = {};
const value4 = a0.number();
let valid = value4.valid;
let UNLOCKED = OrientationLockState.UNLOCKED;
let PORTRAIT = OrientationLockState.PORTRAIT;
let LANDSCAPE = OrientationLockState.LANDSCAPE;
object2.lock_state = Reflect.apply(valid, value4, [UNLOCKED, PORTRAIT, LANDSCAPE]).required();
valid = a0.number().valid;
UNLOCKED = OrientationLockState.UNLOCKED;
PORTRAIT = OrientationLockState.PORTRAIT;
LANDSCAPE = OrientationLockState.LANDSCAPE;
value = Reflect.apply(valid, value, [UNLOCKED, PORTRAIT, LANDSCAPE]);
value = value.allow(null);
object2.picture_in_picture_lock_state = value.optional();
valid = a0.number().valid;
UNLOCKED = OrientationLockState.UNLOCKED;
PORTRAIT = OrientationLockState.PORTRAIT;
LANDSCAPE = OrientationLockState.LANDSCAPE;
value = Reflect.apply(valid, value, [UNLOCKED, PORTRAIT, LANDSCAPE]);
value = value.allow(null);
object2.grid_lock_state = value.optional();
return Reflect.apply(keys, value3, [object2]);
}
function handler_99552({socket, args}) { // fn#99552, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13231:516, offset: 0x021cdcd9, size: 235 bytes, params: 2, frame: 21
const lock_state = args.lock_state;
const picture_in_picture_lock_state = args.picture_in_picture_lock_state;
const grid_lock_state = args.grid_lock_state;
const id = socket.application.id;
if (id == null) {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_COMMAND},
'No application.');
}
let value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.dispatch({type: 'FRAME_SET_ORIENTATION_LOCK_STATE', applicationId: id, lockState: lock_state,
pictureInPictureLockState: picture_in_picture_lock_state});
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.dispatch({type: 'EMBEDDED_ACTIVITY_SET_ORIENTATION_LOCK_STATE', applicationId: id, lockState: lock_state,
pictureInPictureLockState: picture_in_picture_lock_state, gridLockState: grid_lock_state});
}
@@ -0,0 +1,127 @@
/* Metro module 13055; source: modules/rpc/server/commands/soundboard.tsx; dependencies: [5, 4613, 1878, 4135, 482, 4122, 6944, 6639, 8079, 6980, 6951, 8076, 6982, 6789, 2] */
function _fun99677(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99677, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13245:6, offset: 0x021d11fe, size: 385 bytes, params: 8, frame: 26
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const soundboardStore = importDefault(4613) /* metro dependency 4613: SoundboardStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
let value = require(4135) /* metro dependency 4135: Constants */;
const RPC_LOCAL_SCOPE = value.RPC_LOCAL_SCOPE;
const RPC_SCOPE_CONFIG = value.RPC_SCOPE_CONFIG;
value = require(482) /* metro dependency 482: Constants */;
const RPCCommands = value.RPCCommands;
const env0_6 = value.RPCErrors;
object2 = {};
const GET_SOUNDBOARD_SOUNDS = RPCCommands.GET_SOUNDBOARD_SOUNDS;
const ANY = RPC_SCOPE_CONFIG.ANY;
const OAuth2Scopes = (require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes;
let RPC = OAuth2Scopes.RPC;
object2[GET_SOUNDBOARD_SOUNDS] = {scope: {[ANY]: [RPC, RPC_LOCAL_SCOPE]}, handler: handler_99678};
const PLAY_SOUNDBOARD_SOUND = RPCCommands.PLAY_SOUNDBOARD_SOUND;
const ALL = RPC_SCOPE_CONFIG.ALL;
RPC = OAuth2Scopes.RPC;
const RPC_VOICE_WRITE = OAuth2Scopes.RPC_VOICE_WRITE;
object2[PLAY_SOUNDBOARD_SOUND] = {scope: {[ALL]: [RPC, RPC_VOICE_WRITE]}, validation: validation_99683,
handler: handler_99684};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/soundboard.tsx');
exports.default = object2;
}
function handler_99678() { // fn#99678, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13245:300, offset: 0x021d137f, size: 29 bytes, params: 1, frame: 11
return env0_3(_fun99680)();
}
function validation_99683(a0) { // fn#99683, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13245:592, offset: 0x021d1463, size: 84 bytes, params: 2, frame: 13
let value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
value = value.required();
const keys = value.keys;
const object2 = {};
object2.guild_id = a0.string();
object2.sound_id = a0.string();
return Reflect.apply(keys, value, [object2]);
}
function handler_99684({args}) { // fn#99684, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13245:673, offset: 0x021d14b7, size: 57 bytes, params: 2, frame: 11
const env0_0 = args.guild_id;
const env0_1 = args.sound_id;
return env0_3(_fun99686)();
}
function* _fun99680() { // fn#99680, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13245:307, offset: 0x021d13a7, size: 106 bytes, params: 1, frame: 15
var environment;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
const value3 = env2_0(env2_2[6]);
yield value3.maybeFetchSoundboardSounds();
if (false) {
return undefined;
}
env2_4.getSounds().forEach(function(a0) {
return a0.forEach(_fun99682);
});
return [];
}
function* _fun99686() { // fn#99686, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13245:710, offset: 0x021d14fb, size: 486 bytes, params: 1, frame: 23
var binding3;
var value17;
var playSound;
var id;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_0;
const value3 = binding(env2_2[6]);
yield value3.maybeFetchSoundboardSounds();
if (false) {
return undefined;
}
const currentUser = env2_5.getCurrentUser();
const sound = env2_4.getSound(require, importDefault);
const value9 = env2_1(env2_2[9])();
const r6 = sound != null && currentUser != null && env2_0(env2_2[10]).canUseSoundboardSound(currentUser, sound,
value9);
if (value9 == null) {
throw new env2_1(env2_2[11])({errorCode: env2_6.INVALID_CHANNEL}, 'Invalid Channel.');
}
binding = env2_1;
const binding2 = env2_2;
if (r6) {
if (binding(binding2[12])(value9)) {
if (sound != null) {
binding = env2_0;
binding3 = env2_2;
value17 = binding(binding3[10]);
playSound = value17.playSound;
id = value9.id;
binding = env2_1;
Reflect.apply(playSound, value17, [sound, id, [binding(binding3[13]).RPC]]);
}
return undefined;
}
binding = env2_1;
throw new binding(env2_2[11])({errorCode: env2_6.INVALID_PERMISSIONS}, 'Invalid Permissions.');
}
const value13 = binding(binding2[11]);
const INVALID_SOUND = env2_6.INVALID_SOUND;
throw new value13({errorCode: INVALID_SOUND}, 'Invalid Sound.');
}
function _fun99681(a0) { // fn#99681, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13245:405, offset: 0x021d1411, size: 24 bytes, params: 2, frame: 11
return a0.forEach(_fun99682);
}
function _fun99682(a0) { // fn#99682, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13245:419, offset: 0x021d1429, size: 58 bytes, params: 2, frame: 13
let value = environment.__proto__;
const binding = env1_0;
const push = binding.push;
value = environment.__proto__.__proto__.__proto__.__proto__;
value = env4_0(env4_2[7]);
return Reflect.apply(push, binding, [value.soundboardSoundToAPI(a0)]);
}
@@ -0,0 +1,280 @@
/* Metro module 13042; source: modules/rpc/server/commands/store.tsx; dependencies: [5, 4135, 661, 13043, 13044, 8076, 7502, 7500, 13045, 5182, 2] */
function _fun99553(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:6, offset: 0x021cddc4, size: 435 bytes, params: 8, frame: 27
var object2;
const env0_0 = require;
const getSubscriptionSkusViaListings = function() {
return _getSubscriptionSkusViaListings.apply(this, arguments);
};
const closure = function() {
return _getSkusHandler.apply(this, arguments);
};
const closure2 = getEntitlementsHandler;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importDefault(5) /* metro dependency 5 */;
let value = require(4135) /* metro dependency 4135: Constants */;
const RPC_AUTHENTICATED_SCOPE = value.RPC_AUTHENTICATED_SCOPE;
const RPC_LOCAL_SCOPE = value.RPC_LOCAL_SCOPE;
const RPC_SCOPE_CONFIG = value.RPC_SCOPE_CONFIG;
value = require(661) /* metro dependency 661: Constants */;
const env0_5 = value.CurrencyCodes;
const RPCCommands = value.RPCCommands;
const env0_6 = value.RPCErrors;
const env0_7 = value.SKUTypes;
object2 = {};
const GET_SKUS = RPCCommands.GET_SKUS;
let ANY = RPC_SCOPE_CONFIG.ANY;
object2[GET_SKUS] = {[ANY]: [RPC_AUTHENTICATED_SCOPE, RPC_LOCAL_SCOPE], ['handler']: closure};
const GET_ENTITLEMENTS = RPCCommands.GET_ENTITLEMENTS;
ANY = RPC_SCOPE_CONFIG.ANY;
object2[GET_ENTITLEMENTS] = {[ANY]: [RPC_AUTHENTICATED_SCOPE, RPC_LOCAL_SCOPE], ['handler']: closure2};
const GET_SKUS_EMBEDDED = RPCCommands.GET_SKUS_EMBEDDED;
ANY = RPC_SCOPE_CONFIG.ANY;
object2[GET_SKUS_EMBEDDED] = {[ANY]: [RPC_AUTHENTICATED_SCOPE, RPC_LOCAL_SCOPE], ['handler']: handler_99579};
const GET_ENTITLEMENTS_EMBEDDED = RPCCommands.GET_ENTITLEMENTS_EMBEDDED;
ANY = RPC_SCOPE_CONFIG.ANY;
object2[GET_ENTITLEMENTS_EMBEDDED] = {[ANY]: [RPC_AUTHENTICATED_SCOPE, RPC_LOCAL_SCOPE], ['handler']: handler_99582};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/store.tsx');
exports.default = object2;
}
function _getSubscriptionSkusViaListings() { // fn#99555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:359, offset: 0x021cdf77, size: 50 bytes, params: 1, frame: 14
return env0_4(_fun99557).apply(this, arguments);
}
function _getSkusHandler() { // fn#99570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:1329, offset: 0x021ce253, size: 50 bytes, params: 1, frame: 14
return env0_4(_fun99572).apply(this, arguments);
}
function getEntitlementsHandler({socket}) { // fn#99578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:1981, offset: 0x021ce4a6, size: 168 bytes, params: 2, frame: 15
const validateTransportTypeModule = require(13044) /* metro dependency 13044: validateTransportType */;
validateTransportTypeModule.validateTransportType(socket.transport);
const id = socket.application.id;
if (id == null) {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_COMMAND},
'No application.');
}
return (importAll(5182) /* metro dependency 5182: EntitlementActionCreators */).fetchUserEntitlementsForApplication(id);
}
function handler_99579(a0) { // fn#99579, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:2396, offset: 0x021ce54e, size: 36 bytes, params: 2, frame: 11
const env0_0 = a0;
return env0_4(_fun99581)();
}
function handler_99582(a0) { // fn#99582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:2510, offset: 0x021ce5b3, size: 36 bytes, params: 2, frame: 11
const env0_0 = a0;
return env0_4(_fun99584)();
}
function* _fun99557(a0, a1) { // fn#99557, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:444, offset: 0x021cdfb4, size: 130 bytes, params: 3, frame: 16
if (false) {
return undefined;
}
const env0_0 = a0;
const env0_1 = a1;
value = a1.filter(_fun99558);
const Promise = global.Promise;
yield Promise.all(value.map(_fun99559()));
value = undefined;
if (false) {
return value;
}
value.forEach(function(a0) {
if (a0 == null) {
return null;
}
var subscription_listings = a0.subscription_listings;
if (subscription_listings == null) {
return null;
}
subscription_listings.forEach(_fun99564);
[].filter(_fun99567).forEach(_fun99568);
});
return [];
}
async function _fun99572({socket}) { // fn#99572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:1382, offset: 0x021ce299, size: 475 bytes, params: 2, frame: 24
var environment;
var items;
var value14;
var value15;
var value18;
if (false) {
return undefined;
}
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_0;
const value4 = binding(env2_3[4]);
value4.validateTransportType(socket.transport);
const id = socket.application.id;
if (id == null) {
throw new env2_1(env2_3[5])({errorCode: env2_6.INVALID_COMMAND}, 'No application.');
}
const isTestModeForApplication2 = env2_0(env2_3[6]).isTestModeForApplication(id);
binding = env2_2;
const binding2 = env2_3;
if (isTestModeForApplication2) {
value14 = binding(binding2[7]);
await value14.fetchTestSKUsForApplication(id, false);
value15 = undefined;
if (false) {
return value15;
}
await env2_8(id, value15);
value = undefined;
if (false) {
return value;
}
value18 = value15.filter(function(a0) {
return a0.price != null;
});
items = [];
arraySpread(items, value, arraySpread(items, value18, 0, undefined), undefined);
} else {
var value6 = binding(binding2[8]);
await value6.fetchAllStoreListingsForApplication(id);
if (false) {
return undefined;
}
var value9 = undefined.filter(_fun99574);
var map = value9.map;
var value11 = Reflect.apply(map, value9, [function(a0) {
return a0.sku;
}]).filter(function(a0) {
return a0.price != null;
});
items = [];
var value12 = arraySpread(items, value11, 0, undefined);
binding = env2_8;
map = undefined.map;
await binding(id, Reflect.apply(map, undefined, [function(a0) {
return a0.sku;
}]));
value = undefined;
if (false) {
return value;
}
arraySpread(items, value, value12, map);
}
return items;
}
function* _fun99581() { // fn#99581, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:2402, offset: 0x021ce57d, size: 54 bytes, params: 1, frame: 13
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
const binding = env2_10;
value = environment.__proto__;
yield binding(require);
value = undefined;
if (false) {
return value;
}
return {skus: value};
}
function* _fun99584() { // fn#99584, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:2516, offset: 0x021ce5e2, size: 54 bytes, params: 1, frame: 13
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
const binding = env2_12;
value = environment.__proto__;
yield binding(require);
value = undefined;
if (false) {
return value;
}
return {entitlements: value};
}
function _fun99558({type}) { // fn#99558, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:475, offset: 0x021ce036, size: 27 bytes, params: 2, frame: 2
const SUBSCRIPTION_GROUP = env3_7.SUBSCRIPTION_GROUP;
return type === SUBSCRIPTION_GROUP;
}
function _fun99559() { // fn#99559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:536, offset: 0x021ce051, size: 36 bytes, params: 1, frame: 12
const env0_0 = env3_4(_fun99561);
return _fun99562;
}
function _fun99563(a0) { // fn#99563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:726, offset: 0x021ce0ce, size: 88 bytes, params: 2, frame: 14
if (a0 == null) {
return null;
}
const subscription_listings = a0.subscription_listings;
if (subscription_listings == null) {
return null;
}
subscription_listings.forEach(function(a0) {
var env0_0 = a0;
a0.subscription_plans.forEach(_fun99565);
});
[].filter(function(a0) {
return a0?.price != null;
}).forEach(_fun99568);
}
function _fun99574({sku}) { // fn#99574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:1811, offset: 0x021ce485, size: 33 bytes, params: 2, frame: 2
const type = sku.type;
const SUBSCRIPTION_GROUP = env3_7.SUBSCRIPTION_GROUP;
return type !== SUBSCRIPTION_GROUP;
}
function* _fun99561({id}) { // fn#99561, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:556, offset: 0x021ce080, size: 78 bytes, params: 2, frame: 14
if (true) {
value = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
value = env5_0(env5_3[3]);
yield value.fetchAllSubscriptionListingsDataForApplication(env2_0, id);
}
}
function _fun99564(a0) { // fn#99564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:826, offset: 0x021ce126, size: 36 bytes, params: 2, frame: 11
const env0_0 = a0;
a0.subscription_plans.forEach(_fun99565);
}
function _fun99568(a0) { // fn#99568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:1181, offset: 0x021ce23d, size: 22 bytes, params: 2, frame: 11
return env1_2.push(a0);
}
function _fun99565(a0) { // fn#99565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:860, offset: 0x021ce14a, size: 190 bytes, params: 2, frame: 15
var environment;
var object2;
var value5;
var binding;
var release_date;
const env0_0 = a0;
let value = null;
const value2 = undefined;
const price = value == a0 ? value2 : a0.price;
const value4 = require.find(_fun99566);
if (value != value4) {
object2 = {};
object2.id = a0.sku_id;
object2.name = value4.name;
object2.type = value4.type;
value5 = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
object2.price = {amount: price, currency: env5_5.USD};
binding = env0_0;
object2.application_id = binding.application_id;
object2.flags = binding.sku_flags;
release_date = value4.release_date;
object2.release_date = value != release_date ? release_date : value;
value = environment.__proto__;
binding = env1_0;
binding.push(object2);
}
return value2;
}
function _fun99566({id}) { // fn#99566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13232:905, offset: 0x021ce208, size: 27 bytes, params: 2, frame: 2
return id === env0_0.sku_id;
}
@@ -0,0 +1,137 @@
/* Metro module 13049; source: modules/rpc/server/commands/subscriptions.tsx; dependencies: [5, 661, 8076, 13050, 683, 13051, 2] */
function _fun99657(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99657, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13239:6, offset: 0x021d05b1, size: 201 bytes, params: 8, frame: 20
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_4 = constantsModule.AnalyticEvents;
const RPCCommands = constantsModule.RPCCommands;
const env0_5 = constantsModule.RPCErrors;
object2 = {};
const SUBSCRIBE = RPCCommands.SUBSCRIBE;
object2[SUBSCRIBE] = {handler: function({server, socket, evt, args}) {
return args(_fun99659)();
}};
const UNSUBSCRIBE = RPCCommands.UNSUBSCRIBE;
object2[UNSUBSCRIBE] = {handler: handler_99664};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/subscriptions.tsx');
exports.default = object2;
}
function handler_99658({server, socket, evt, args}) { // fn#99658, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13239:191, offset: 0x021d067a, size: 72 bytes, params: 2, frame: 11
return args(_fun99660)();
}
function handler_99664({server, socket, evt, args}) { // fn#99664, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13239:1125, offset: 0x021d0a1e, size: 156 bytes, params: 2, frame: 16
var value;
var defaultImport;
if (server.events[evt] == null) {
defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_EVENT;
value = 'Invalid event: ' + evt;
value = new defaultImport();
throw value;
}
server.removeSubscription(socket, evt, args);
return {evt: evt};
}
function* _fun99660() { // fn#99660, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13239:230, offset: 0x021d06cd, size: 682 bytes, params: 1, frame: 25
var environment;
var object2;
var value7;
var track;
var RPC_SUBSCRIPTION_REQUESTED;
var value9;
var validate;
var value11;
var handler;
var Promise;
var promise;
var value14;
var value15;
if (false) {
return undefined;
}
var env0_0;
var env0_1;
value = environment.__proto__;
const property = require.events[dependencyMap];
if (property == null) {
value14 = environment.__proto__.__proto__;
value15 = env2_1(env2_2[2]);
value = 'Invalid event: ' + dependencyMap;
value = new value15({errorCode: env2_5.INVALID_EVENT}, value);
throw value;
}
const value5 = env2_1(env2_2[3])(importDefault.authorization.scopes, property.scope);
let binding = env2_1;
const binding2 = env2_2;
if (value5) {
value7 = binding(binding2[4]);
track = value7.track;
RPC_SUBSCRIPTION_REQUESTED = env2_4.RPC_SUBSCRIPTION_REQUESTED;
object2 = {};
object2.event = dependencyMap;
object2.scope = typeof property.scope === 'object' ? global.JSON.stringify(property.scope) : property.scope;
object2.application_id = importDefault.application.id;
object2.socket_scope = importDefault.authorization.scopes.toString();
Reflect.apply(track, value7, [RPC_SUBSCRIPTION_REQUESTED, object2]);
if (property.validation == null) {
handler = property.handler;
binding = env1_3;
env0_0 = Reflect.apply(handler, property, [{args: binding, socket: importDefault}]);
env0_1 = env2_0(env2_2[5]).getInitialSubscriptionPayload(importDefault, dependencyMap, binding);
Promise = global.Promise;
value = Object.create(Promise.prototype, {constructor: {value: Promise}});
promise = new Promise(function(a0) {
global.setImmediate(_fun99662);
a0({evt: dependencyMap});
});
return promise instanceof Object ? promise : value;
}
yield require.getJoi();
value9 = undefined;
if (false) {
return value9;
}
validate = value9.validate;
binding = env1_3;
value11 = property.validation(value9);
object2 = {convert: false};
if (Reflect.apply(validate, value9, [binding, value11, object2]).error != null) {
value = env2_1(env2_2[2]);
value = new value({errorCode: env2_5.INVALID_PAYLOAD}, 'Invalid subscription parameters provided');
throw value;
}
handler = property.handler;
binding = env1_3;
env0_0 = Reflect.apply(handler, property, [{args: binding, socket: importDefault}]);
env0_1 = env2_0(env2_2[5]).getInitialSubscriptionPayload(importDefault, dependencyMap, binding);
Promise = global.Promise;
value = Object.create(Promise.prototype, {constructor: {value: Promise}});
promise = new Promise(_fun99661);
return promise instanceof Object ? promise : value;
}
value = binding(binding2[2]);
const INVALID_PERMISSIONS = env2_5.INVALID_PERMISSIONS;
value = new value({errorCode: INVALID_PERMISSIONS}, 'Not authenticated or invalid scope');
throw value;
}
function _fun99661(a0) { // fn#99661, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13239:971, offset: 0x021d0977, size: 48 bytes, params: 2, frame: 11
global.setImmediate(_fun99662);
a0({evt: dependencyMap});
}
function _fun99662() { // fn#99662, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13239:989, offset: 0x021d09a7, size: 87 bytes, params: 1, frame: 19
require.addSubscription(importDefault, dependencyMap, env3_3, env1_0);
if (env1_1 != null) {
require.dispatchToSubscriptions(dependencyMap, function(a0) {
return a0.socket.id === importDefault.id;
}, env1_1);
}
}
@@ -0,0 +1,18 @@
/* Metro module 13053; source: modules/rpc/server/commands/userSettings.tsx; dependencies: [1949, 661, 4122, 2] */
function _fun99673(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99673, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13243:6, offset: 0x021d10b1, size: 173 bytes, params: 8, frame: 19
var object2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const localeStore = importDefault(1949) /* metro dependency 1949: LocaleStore */;
const RPCCommands = (require(661) /* metro dependency 661: Constants */).RPCCommands;
object2 = {};
const USER_SETTINGS_GET_LOCALE = RPCCommands.USER_SETTINGS_GET_LOCALE;
const OAuth2Scopes = (require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes;
const IDENTIFY = OAuth2Scopes.IDENTIFY;
object2[USER_SETTINGS_GET_LOCALE] = {scope: IDENTIFY, handler: function() {
return {locale: LocaleStore.locale};
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/userSettings.tsx');
exports.default = object2;
}
@@ -0,0 +1,28 @@
/* Metro module 13052; source: modules/rpc/server/commands/users.tsx; dependencies: [1878, 4135, 661, 13026, 8082, 2] */
function _fun99671(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99671, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13242:6, offset: 0x021d0f79, size: 242 bytes, params: 8, frame: 26
var object2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
let value = require(4135) /* metro dependency 4135: Constants */;
const RPC_EMBEDDED_APP_SCOPE = value.RPC_EMBEDDED_APP_SCOPE;
const RPC_LOCAL_SCOPE = value.RPC_LOCAL_SCOPE;
const RPC_SCOPE_CONFIG = value.RPC_SCOPE_CONFIG;
const RPCCommands = (require(661) /* metro dependency 661: Constants */).RPCCommands;
object2 = {};
const GET_USER = RPCCommands.GET_USER;
value = require(13026) /* metro dependency 13026: rpcSchema */;
const createRPCCommand = value.createRPCCommand;
const GET_USER2 = RPCCommands.GET_USER;
const ANY = RPC_SCOPE_CONFIG.ANY;
object2[GET_USER] = Reflect.apply(createRPCCommand, value, [GET_USER2, {scope: {[ANY]: [RPC_EMBEDDED_APP_SCOPE,
RPC_LOCAL_SCOPE]}, handler: handler_99672}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/users.tsx');
exports.default = object2;
}
function handler_99672({args}) { // fn#99672, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13242:281, offset: 0x021d106b, size: 70 bytes, params: 2, frame: 13
const user = UserStore.getUser(args.id);
return user == null ? null : (importDefault(8082) /* metro dependency 8082: transformUser */)(user);
}
@@ -0,0 +1,57 @@
/* Metro module 13068; source: modules/rpc/server/events/VoiceSettingsEventsFactory.tsx; dependencies: [4135, 661, 4122, 22, 2] */
function _fun99791(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13258:6, offset: 0x021d5f09, size: 156 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const constantsModule = require(4135) /* metro dependency 4135: Constants */;
const env0_3 = constantsModule.RPC_SCOPE_CONFIG;
const env0_4 = constantsModule.RPC_LOCAL_SCOPE;
const env0_5 = (require(661) /* metro dependency 661: Constants */).RPCEvents;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/events/VoiceSettingsEventsFactory.tsx');
exports.default = createVoiceSettingsEventHandlers;
}
function createVoiceSettingsEventHandlers(a0, a1) { // fn#99792, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13258:267, offset: 0x021d5fa5, size: 175 bytes, params: 3, frame: 22
const env0_0 = a0;
const env0_1 = a1;
const VOICE_SETTINGS_UPDATE = RPCEvents.VOICE_SETTINGS_UPDATE;
const ANY = RPC_SCOPE_CONFIG.ANY;
const {RPC, RPC_VOICE_READ} = (require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes;
const VOICE_SETTINGS_UPDATE_2 = RPCEvents.VOICE_SETTINGS_UPDATE_2;
return {[VOICE_SETTINGS_UPDATE]: {scope: {[ANY]: [RPC, RPC_VOICE_READ]}, handler: function() {
return _fun99794;
}}, [VOICE_SETTINGS_UPDATE_2]: {scope: RPC_LOCAL_SCOPE, handler: function({socket}) {
return _fun99796;
}}};
}
function createVoiceSettingsEventHandlersHandler() { // fn#99793, owner: createVoiceSettingsEventHandlers.handler, offset: 0x021d6054, size: 11 bytes, params: 1, frame: 1
return _fun99794;
}
function createVoiceSettingsEventHandlersHandler_99795({socket}) { // fn#99795, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13258:561, owner: createVoiceSettingsEventHandlers.handler, offset: 0x021d60a7, size: 24 bytes, params: 2, frame: 2
return _fun99796;
}
function _fun99794({prevState, dispatch}) { // fn#99794, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13258:439, offset: 0x021d605f, size: 72 bytes, params: 2, frame: 16
let value = environment.__proto__;
value = env1_0();
const defaultImport = importDefault(22) /* metro dependency 22 */;
if (!defaultImport.isEqual(value, prevState)) {
dispatch(value);
}
return value;
}
function _fun99796({prevState, dispatch}) { // fn#99796, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13258:575, offset: 0x021d60bf, size: 112 bytes, params: 2, frame: 16
if (socket.application.id == null) {
return prevState;
}
const moduleValue = require(socket.application.id);
const defaultImport = importDefault(22) /* metro dependency 22 */;
if (!defaultImport.isEqual(moduleValue, prevState)) {
dispatch(moduleValue);
}
return moduleValue;
}
@@ -0,0 +1,526 @@
/* Metro module 13064; source: modules/rpc/server/events/crossPlatformRPCEventHandlers.tsx; dependencies: [4234, 4266, 1422, 4492, 1379, 1945, 1867, 4259, 4294, 1878, 4297, 4135, 661, 8079, 8081, 8076, 5072, 4122, 22, 13014, 483, 628, 8082, 13065, 13066, 2] */
function _fun99734(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99734, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:6, offset: 0x021d463e, size: 2668 bytes, params: 8, frame: 31
var object2;
let env0_0 = require;
const closure = handler_99735;
const closure2 = handler_99736;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const applicationStore = importDefault(4234) /* metro dependency 4234: ApplicationStore */;
const runningGameStoreNative = importDefault(4266) /* metro dependency 4266: RunningGameStoreNative */;
const env0_6 = (require(1422) /* metro dependency 1422: GuildRecord */).getGuildIconURL;
const applicationStreamingStore = importDefault(4492) /* metro dependency 4492: ApplicationStreamingStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const mediaEngineStore = importDefault(4259) /* metro dependency 4259: MediaEngineStore */;
const rtcConnectionStore = importDefault(4294) /* metro dependency 4294: RTCConnectionStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const voiceStateStore = importDefault(4297) /* metro dependency 4297: VoiceStateStore */;
let value = require(4135) /* metro dependency 4135: Constants */;
const RPC_AUTHENTICATED_SCOPE = value.RPC_AUTHENTICATED_SCOPE;
const RPC_LOCAL_SCOPE = value.RPC_LOCAL_SCOPE;
const RPC_SCOPE_CONFIG = value.RPC_SCOPE_CONFIG;
value = require(661) /* metro dependency 661: Constants */;
const env0_15 = value.ApplicationFlags;
const env0_16 = value.RPCErrors;
const RPCEvents = value.RPCEvents;
const closure3 = validation_99737;
const closure4 = validation_99738;
object2 = {};
const GUILD_STATUS = RPCEvents.GUILD_STATUS;
const OAuth2Scopes = (require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes;
let RPC = OAuth2Scopes.RPC;
object2[GUILD_STATUS] = {scope: RPC, validation: validation_99739, handler: handler_99740};
const VOICE_STATE_CREATE = RPCEvents.VOICE_STATE_CREATE;
let ANY = RPC_SCOPE_CONFIG.ANY;
RPC = OAuth2Scopes.RPC;
let RPC_VOICE_READ = OAuth2Scopes.RPC_VOICE_READ;
object2[VOICE_STATE_CREATE] = {scope: {[ANY]: [RPC, RPC_VOICE_READ]}, validation: validation_99742,
handler: handler_99743};
const VOICE_STATE_DELETE = RPCEvents.VOICE_STATE_DELETE;
ANY = RPC_SCOPE_CONFIG.ANY;
RPC = OAuth2Scopes.RPC;
RPC_VOICE_READ = OAuth2Scopes.RPC_VOICE_READ;
object2[VOICE_STATE_DELETE] = {scope: {[ANY]: [RPC, RPC_VOICE_READ]}, validation: validation_99747,
handler: handler_99748};
const VOICE_STATE_UPDATE = RPCEvents.VOICE_STATE_UPDATE;
ANY = RPC_SCOPE_CONFIG.ANY;
RPC = OAuth2Scopes.RPC;
RPC_VOICE_READ = OAuth2Scopes.RPC_VOICE_READ;
object2[VOICE_STATE_UPDATE] = {scope: {[ANY]: [RPC, RPC_VOICE_READ]}, validation: validation_99752,
handler: handler_99753};
const VOICE_CONNECTION_STATUS = RPCEvents.VOICE_CONNECTION_STATUS;
ANY = RPC_SCOPE_CONFIG.ANY;
RPC = OAuth2Scopes.RPC;
RPC_VOICE_READ = OAuth2Scopes.RPC_VOICE_READ;
object2[VOICE_CONNECTION_STATUS] = {scope: {[ANY]: [RPC, RPC_VOICE_READ]}, handler: function() {
return _fun99758;
}};
const MESSAGE_CREATE = RPCEvents.MESSAGE_CREATE;
RPC = OAuth2Scopes.RPC;
object2[MESSAGE_CREATE] = {scope: RPC, validation: closure3, handler: closure};
const MESSAGE_UPDATE = RPCEvents.MESSAGE_UPDATE;
RPC = OAuth2Scopes.RPC;
object2[MESSAGE_UPDATE] = {scope: RPC, validation: closure3, handler: closure};
const MESSAGE_DELETE = RPCEvents.MESSAGE_DELETE;
RPC = OAuth2Scopes.RPC;
object2[MESSAGE_DELETE] = {scope: RPC, validation: closure3, handler: closure};
const SPEAKING_START = RPCEvents.SPEAKING_START;
ANY = RPC_SCOPE_CONFIG.ANY;
RPC = OAuth2Scopes.RPC;
RPC_VOICE_READ = OAuth2Scopes.RPC_VOICE_READ;
object2[SPEAKING_START] = {scope: {[ANY]: [RPC, RPC_VOICE_READ, RPC_LOCAL_SCOPE]}, validation: closure4,
handler: closure2};
const SPEAKING_STOP = RPCEvents.SPEAKING_STOP;
ANY = RPC_SCOPE_CONFIG.ANY;
RPC = OAuth2Scopes.RPC;
RPC_VOICE_READ = OAuth2Scopes.RPC_VOICE_READ;
object2[SPEAKING_STOP] = {scope: {[ANY]: [RPC, RPC_VOICE_READ, RPC_LOCAL_SCOPE]}, validation: closure4,
handler: closure2};
const GUILD_CREATE = RPCEvents.GUILD_CREATE;
RPC = OAuth2Scopes.RPC;
object2[GUILD_CREATE] = {scope: RPC, handler: function() {
}};
const CHANNEL_CREATE = RPCEvents.CHANNEL_CREATE;
RPC = OAuth2Scopes.RPC;
object2[CHANNEL_CREATE] = {scope: RPC, handler: function() {
}};
const GAME_JOIN = RPCEvents.GAME_JOIN;
ANY = RPC_SCOPE_CONFIG.ANY;
RPC = OAuth2Scopes.RPC;
object2[GAME_JOIN] = {scope: {[ANY]: [RPC, RPC_LOCAL_SCOPE]}, handler: function() {
}};
const GAME_SPECTATE = RPCEvents.GAME_SPECTATE;
ANY = RPC_SCOPE_CONFIG.ANY;
RPC = OAuth2Scopes.RPC;
object2[GAME_SPECTATE] = {scope: {[ANY]: [RPC, RPC_LOCAL_SCOPE]}, handler: function() {
}};
const ACTIVITY_JOIN = RPCEvents.ACTIVITY_JOIN;
ANY = RPC_SCOPE_CONFIG.ANY;
RPC = OAuth2Scopes.RPC;
object2[ACTIVITY_JOIN] = {scope: {[ANY]: [RPC, RPC_AUTHENTICATED_SCOPE, RPC_LOCAL_SCOPE]}, handler: function() {
}};
const ACTIVITY_JOIN_REQUEST = RPCEvents.ACTIVITY_JOIN_REQUEST;
ANY = RPC_SCOPE_CONFIG.ANY;
RPC = OAuth2Scopes.RPC;
object2[ACTIVITY_JOIN_REQUEST] = {scope: {[ANY]: [RPC, RPC_LOCAL_SCOPE]}, handler: function() {
}};
const ACTIVITY_SPECTATE = RPCEvents.ACTIVITY_SPECTATE;
ANY = RPC_SCOPE_CONFIG.ANY;
RPC = OAuth2Scopes.RPC;
object2[ACTIVITY_SPECTATE] = {scope: {[ANY]: [RPC, RPC_AUTHENTICATED_SCOPE, RPC_LOCAL_SCOPE]}, handler: function() {
}};
const ACTIVITY_INVITE = RPCEvents.ACTIVITY_INVITE;
ANY = RPC_SCOPE_CONFIG.ANY;
RPC = OAuth2Scopes.RPC;
object2[ACTIVITY_INVITE] = {scope: {[ANY]: [RPC, RPC_LOCAL_SCOPE]}, handler: function() {
}};
const ACTIVITY_PIP_MODE_UPDATE = RPCEvents.ACTIVITY_PIP_MODE_UPDATE;
object2[ACTIVITY_PIP_MODE_UPDATE] = {scope: undefined, handler: function() {
}};
const ACTIVITY_LAYOUT_MODE_UPDATE = RPCEvents.ACTIVITY_LAYOUT_MODE_UPDATE;
object2[ACTIVITY_LAYOUT_MODE_UPDATE] = {scope: undefined, handler: function() {
}};
const FRAME_LAYOUT_MODE_UPDATE = RPCEvents.FRAME_LAYOUT_MODE_UPDATE;
object2[FRAME_LAYOUT_MODE_UPDATE] = {scope: undefined, handler: function() {
}};
const ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE = RPCEvents.ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE;
object2[ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE] = (require(13014) /* metro dependency 13014: activityInstanceConnectedParticipants */).activityInstanceConnectedParticipantsUpdateEvent;
const THERMAL_STATE_UPDATE = RPCEvents.THERMAL_STATE_UPDATE;
ANY = RPC_SCOPE_CONFIG.ANY;
object2[THERMAL_STATE_UPDATE] = {scope: {[ANY]: [RPC_AUTHENTICATED_SCOPE]}, handler: function() {
}};
const ORIENTATION_UPDATE = RPCEvents.ORIENTATION_UPDATE;
ANY = RPC_SCOPE_CONFIG.ANY;
object2[ORIENTATION_UPDATE] = {scope: {[ANY]: [RPC_AUTHENTICATED_SCOPE]}, handler: function() {
}};
const VOICE_CHANNEL_SELECT = RPCEvents.VOICE_CHANNEL_SELECT;
RPC = OAuth2Scopes.RPC;
object2[VOICE_CHANNEL_SELECT] = {scope: RPC, handler: function() {
}};
const NOTIFICATION_CREATE = RPCEvents.NOTIFICATION_CREATE;
let ALL = RPC_SCOPE_CONFIG.ALL;
RPC = OAuth2Scopes.RPC;
const RPC_NOTIFICATIONS_READ = OAuth2Scopes.RPC_NOTIFICATIONS_READ;
object2[NOTIFICATION_CREATE] = {scope: {[ALL]: [RPC, RPC_NOTIFICATIONS_READ]}, handler: function() {
}};
const RELATIONSHIP_UPDATE = RPCEvents.RELATIONSHIP_UPDATE;
const RELATIONSHIPS_READ = OAuth2Scopes.RELATIONSHIPS_READ;
object2[RELATIONSHIP_UPDATE] = {scope: RELATIONSHIPS_READ, handler: handler_99774};
const CURRENT_USER_UPDATE = RPCEvents.CURRENT_USER_UPDATE;
ANY = RPC_SCOPE_CONFIG.ANY;
let IDENTIFY = OAuth2Scopes.IDENTIFY;
object2[CURRENT_USER_UPDATE] = {scope: {[ANY]: [RPC_LOCAL_SCOPE, IDENTIFY]}, handler: function() {
return _fun99776;
}};
const CURRENT_GUILD_MEMBER_UPDATE = RPCEvents.CURRENT_GUILD_MEMBER_UPDATE;
ALL = RPC_SCOPE_CONFIG.ALL;
IDENTIFY = OAuth2Scopes.IDENTIFY;
const GUILDS_MEMBERS_READ = OAuth2Scopes.GUILDS_MEMBERS_READ;
object2[CURRENT_GUILD_MEMBER_UPDATE] = {scope: {[ALL]: [IDENTIFY, GUILDS_MEMBERS_READ]}, handler: function(a0) {
var env0_0 = a0.args.guild_id;
return _fun99778;
}};
const ENTITLEMENT_CREATE = RPCEvents.ENTITLEMENT_CREATE;
ANY = RPC_SCOPE_CONFIG.ANY;
object2[ENTITLEMENT_CREATE] = {scope: {[ANY]: [RPC_LOCAL_SCOPE, RPC_AUTHENTICATED_SCOPE]}, handler: function() {
}};
const ENTITLEMENT_DELETE = RPCEvents.ENTITLEMENT_DELETE;
ANY = RPC_SCOPE_CONFIG.ANY;
object2[ENTITLEMENT_DELETE] = {scope: {[ANY]: [RPC_LOCAL_SCOPE, RPC_AUTHENTICATED_SCOPE]}, handler: function() {
}};
const SCREENSHARE_STATE_UPDATE = RPCEvents.SCREENSHARE_STATE_UPDATE;
ALL = RPC_SCOPE_CONFIG.ALL;
const RPC_SCREENSHARE_READ = OAuth2Scopes.RPC_SCREENSHARE_READ;
object2[SCREENSHARE_STATE_UPDATE] = {scope: {[ALL]: [RPC_LOCAL_SCOPE, RPC_SCREENSHARE_READ]}, handler: function() {
return _fun99782;
}};
const VIDEO_STATE_UPDATE = RPCEvents.VIDEO_STATE_UPDATE;
ALL = RPC_SCOPE_CONFIG.ALL;
const RPC_VIDEO_READ = OAuth2Scopes.RPC_VIDEO_READ;
object2[VIDEO_STATE_UPDATE] = {scope: {[ALL]: [RPC_LOCAL_SCOPE, RPC_VIDEO_READ]}, handler: function() {
return _fun99784;
}};
const AUTHORIZE_REQUEST = RPCEvents.AUTHORIZE_REQUEST;
object2[AUTHORIZE_REQUEST] = {scope: undefined, handler: function() {
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/events/crossPlatformRPCEventHandlers.tsx');
exports.default = object2;
}
function handler_99735({args, socket}) { // fn#99735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:454, offset: 0x021d50aa, size: 324 bytes, params: 2, frame: 18
var moduleValue2;
var defaultImport;
var defaultImport2;
const channel_id = args.channel_id;
var value;
const channel = ChannelStore.getChannel(channel_id);
if (channel == null) {
defaultImport2 = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_CHANNEL;
value = 'Invalid channel id: ' + channel_id;
value = new defaultImport2();
throw value;
}
const rpcHelpersModule = require(8081) /* metro dependency 8081: RPCHelpers */;
if (rpcHelpersModule.hasMessageReadPermission(channel, socket.application.id, socket.authorization.scopes)) {
moduleValue2 = require(5072) /* metro dependency 5072: AgeGateUtils */;
if (moduleValue2.userCannotSeeNSFWContent(channel)) {
defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_CHANNEL;
value = 'Invalid nsfw channel id: ' + channel.id;
value = new defaultImport();
throw value;
}
return undefined;
}
defaultImport2 = importDefault(8076) /* metro dependency 8076: RPCError */;
const object2 = {};
const INVALID_CHANNEL = RPCErrors.INVALID_CHANNEL;
object2.errorCode = INVALID_CHANNEL;
value = 'Invalid channel id: ' + channel_id;
throw new defaultImport2();
}
function handler_99736({args}) { // fn#99736, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:911, offset: 0x021d51ee, size: 133 bytes, params: 2, frame: 14
var defaultImport;
const channel_id = args.channel_id;
if (channel_id != null) {
var value;
var getChannel = ChannelStore.getChannel;
if (Reflect.apply(getChannel, ChannelStore, [channel_id]) == null) {
defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_CHANNEL;
value = 'Invalid channel id: ' + channel_id;
value = new defaultImport();
throw value;
}
}
}
function validation_99737(a0) { // fn#99737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:387, offset: 0x021d5273, size: 80 bytes, params: 2, frame: 13
let value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
value = value.required();
const keys = value.keys;
const object2 = {};
object2.channel_id = a0.string().required();
return Reflect.apply(keys, value, [object2]);
}
function validation_99738(a0) { // fn#99738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:854, offset: 0x021d52c3, size: 73 bytes, params: 2, frame: 14
const value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
const keys = value.keys;
const object2 = {};
object2.channel_id = a0.string().allow(null);
return Reflect.apply(keys, value, [object2]);
}
function validation_99739(a0) { // fn#99739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:1138, offset: 0x021d530c, size: 80 bytes, params: 2, frame: 13
let value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
value = value.required();
const keys = value.keys;
const object2 = {};
object2.guild_id = a0.string().required();
return Reflect.apply(keys, value, [object2]);
}
function handler_99740({args}) { // fn#99740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:1203, offset: 0x021d535c, size: 141 bytes, params: 2, frame: 14
var defaultImport;
const guild_id = args.guild_id;
var value;
if (GuildStore.getGuild(guild_id) == null) {
defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_GUILD;
value = 'Invalid guild id: ' + guild_id;
value = new defaultImport();
throw value;
}
return _fun99741;
}
function handler_99743({args}) { // fn#99743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:1702, offset: 0x021d5485, size: 140 bytes, params: 2, frame: 14
var defaultImport;
const channel_id = args.channel_id;
var value;
if (ChannelStore.getChannel(channel_id) == null) {
defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_CHANNEL;
value = 'Invalid channel id: ' + channel_id;
value = new defaultImport();
throw value;
}
return _fun99744;
}
function handler_99748({args}) { // fn#99748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:2278, offset: 0x021d5605, size: 140 bytes, params: 2, frame: 14
var defaultImport;
const channel_id = args.channel_id;
var value;
if (ChannelStore.getChannel(channel_id) == null) {
defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_CHANNEL;
value = 'Invalid channel id: ' + channel_id;
value = new defaultImport();
throw value;
}
return _fun99749;
}
function handler_99753({args}) { // fn#99753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:2849, offset: 0x021d573e, size: 140 bytes, params: 2, frame: 14
var defaultImport;
const channel_id = args.channel_id;
var value;
if (ChannelStore.getChannel(channel_id) == null) {
defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).errorCode = RPCErrors.INVALID_CHANNEL;
value = 'Invalid channel id: ' + channel_id;
value = new defaultImport();
throw value;
}
return _fun99754;
}
function handler_99757() { // fn#99757, offset: 0x021d58cb, size: 11 bytes, params: 1, frame: 1
return _fun99758;
}
function handler_99774({socket}) { // fn#99774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:5525, offset: 0x021d5982, size: 200 bytes, params: 2, frame: 19
const bigFlagUtilsModule = importAll(483) /* metro dependency 483: BigFlagUtils */;
const has = bigFlagUtilsModule.has;
const moduleValue2 = bigFlagUtilsModule;
let deserialize = moduleValue2.deserialize;
const value3 = Reflect.apply(deserialize, moduleValue2, [socket.application.flags ?? 0]);
const moduleValue3 = bigFlagUtilsModule;
deserialize = moduleValue3.deserialize;
const DISABLE_RELATIONSHIPS_ACCESS = ApplicationFlags.DISABLE_RELATIONSHIPS_ACCESS;
if (Reflect.apply(has, bigFlagUtilsModule, [value3, Reflect.apply(deserialize, moduleValue3,
[DISABLE_RELATIONSHIPS_ACCESS])])) {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_PERMISSIONS},
'Missing Permissions');
}
}
function handler_99775() { // fn#99775, offset: 0x021d5a4a, size: 11 bytes, params: 1, frame: 1
return _fun99776;
}
function handler_99777({args}) { // fn#99777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:6127, offset: 0x021d5ada, size: 29 bytes, params: 2, frame: 2
const env0_0 = args.guild_id;
return _fun99778;
}
function handler_99781() { // fn#99781, offset: 0x021d5b85, size: 11 bytes, params: 1, frame: 1
return _fun99782;
}
function handler_99783() { // fn#99783, offset: 0x021d5caf, size: 11 bytes, params: 1, frame: 1
return _fun99784;
}
function _fun99741({prevState, dispatch}) { // fn#99741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:1335, offset: 0x021d53e9, size: 156 bytes, params: 2, frame: 19
var object3;
var object4;
let value = environment.__proto__;
const guild = GuildStore.getGuild(guild_id);
if (guild != null) {
object3 = {};
object4 = {};
object4.id = guild.id;
object4.name = guild.name;
object4.icon_url = getGuildIconURL(guild, 128) ?? null;
object3.guild = object4;
object3.online = 0;
value = importDefault(22) /* metro dependency 22 */;
if (!value.isEqual(prevState, object3)) {
dispatch(object3);
}
return object3;
}
}
function _fun99744({prevState, dispatch}) { // fn#99744, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:1842, offset: 0x021d5511, size: 176 bytes, params: 2, frame: 19
var environment;
var Object;
var value4;
var env0_2;
let value = environment.__proto__;
const channel = ChannelStore.getChannel(channel_id);
if (channel != null) {
env0_2 = channel.getGuildId();
Object = global.Object;
value4 = Object.values(VoiceStateStore.getVoiceStatesForChannel(channel.id));
if (prevState) {
value = importDefault(22) /* metro dependency 22 */;
value = value.differenceBy(value4, prevState, function(a0) {
return a0.userId;
});
value.forEach(_fun99746);
}
return value4;
}
}
function _fun99749({prevState, dispatch}) { // fn#99749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:2418, offset: 0x021d5691, size: 173 bytes, params: 2, frame: 19
var environment;
var Object;
var value4;
var env0_2;
let value = environment.__proto__;
const channel = ChannelStore.getChannel(channel_id);
if (channel != null) {
env0_2 = channel.getGuildId();
Object = global.Object;
value4 = Object.values(VoiceStateStore.getVoiceStatesForChannel(channel.id));
value = importDefault(22) /* metro dependency 22 */;
value = value.differenceBy(prevState, value4, function(a0) {
return a0.userId;
});
value.forEach(_fun99751);
return value4;
}
}
function _fun99754({prevState, dispatch}) { // fn#99754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:2989, offset: 0x021d57ca, size: 198 bytes, params: 2, frame: 19
var environment;
var Object;
var value5;
var env0_2;
let value = environment.__proto__;
const channel = ChannelStore.getChannel(channel_id);
if (channel != null) {
env0_2 = channel.getGuildId();
Object = global.Object;
value5 = Object.values(VoiceStateStore.getVoiceStatesForChannel(channel.id)).map(_fun99755);
value = importDefault(22) /* metro dependency 22 */;
value = value.differenceWith(value5, prevState, (importDefault(22) /* metro dependency 22 */).isEqual);
value.forEach(function(a0) {
return dispatch(a0);
});
return value5;
}
}
function _fun99758({prevState, dispatch}) { // fn#99758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:3372, offset: 0x021d58d6, size: 172 bytes, params: 2, frame: 19
const object2 = {};
let value = environment.__proto__;
const rpcHelpersModule = require(8081) /* metro dependency 8081: RPCHelpers */;
const getVoiceConnectionState = rpcHelpersModule.getVoiceConnectionState;
const getState = RTCConnectionStore.getState;
object2.state = Reflect.apply(getVoiceConnectionState, rpcHelpersModule, [Reflect.apply(getState,
RTCConnectionStore, [])]);
object2.hostname = RTCConnectionStore.getHostname();
object2.pings = RTCConnectionStore.getPings();
object2.average_ping = RTCConnectionStore.getAveragePing();
object2.last_ping = RTCConnectionStore.getLastPing();
value = importDefault(22) /* metro dependency 22 */;
if (!value.isEqual(object2, prevState)) {
dispatch(object2);
}
return object2;
}
function _fun99776({prevState, dispatch}) { // fn#99776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:5844, offset: 0x021d5a55, size: 133 bytes, params: 2, frame: 18
const object2 = {};
const value = environment.__proto__;
object2.currentUser = UserStore.getCurrentUser();
const currentUser = object2.currentUser;
if (!(currentUser == null || prevState != null && (importDefault(628) /* metro dependency 628: shallowEqual */)(object2,
prevState))) {
dispatch((importDefault(8082) /* metro dependency 8082: transformUser */)(object2.currentUser));
}
return object2;
}
function _fun99778({prevState, dispatch}) { // fn#99778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:6150, offset: 0x021d5af7, size: 142 bytes, params: 2, frame: 18
const object2 = {};
const value = environment.__proto__;
object2.currentGuildMember = GuildMemberStore.getSelfMember(guild_id);
if (!(object2.currentGuildMember == null || prevState != null && (importDefault(628) /* metro dependency 628: shallowEqual */)(object2,
prevState))) {
dispatch((importDefault(13065) /* metro dependency 13065: transformGuildMember */)(object2.currentGuildMember));
}
return object2;
}
function _fun99782({prevState, dispatch}) { // fn#99782, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:6545, offset: 0x021d5b90, size: 287 bytes, params: 2, frame: 20
let value = environment.__proto__;
const streamerActiveStreamMetadata = ApplicationStreamingStore.getStreamerActiveStreamMetadata();
const r0 = streamerActiveStreamMetadata?.pid != null ? RunningGameStoreNative.getGameForPID(streamerActiveStreamMetadata.pid) : null;
const r7 = r0?.id != null ? ApplicationStore.getApplication(r0.id) : null;
const r6 = r7 != null ? (importDefault(13066) /* metro dependency 13066: transformApplication */)(r7) : null;
const sourceName = streamerActiveStreamMetadata?.sourceName;
const object2 = {active: streamerActiveStreamMetadata != null};
object2.pid = streamerActiveStreamMetadata?.pid ?? null;
object2.application = r6 != null ?? sourceName != null ? {name: sourceName} : null;
value = importDefault(22) /* metro dependency 22 */;
if (!value.isEqual(object2, prevState)) {
dispatch(object2);
}
return object2;
}
function _fun99784({prevState, dispatch}) { // fn#99784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:7043, offset: 0x021d5cba, size: 82 bytes, params: 2, frame: 15
const object2 = {};
let value = environment.__proto__;
object2.active = MediaEngineStore.isVideoEnabled();
value = importDefault(22) /* metro dependency 22 */;
if (!value.isEqual(object2, prevState)) {
dispatch(object2);
}
return object2;
}
function _fun99746(a0) { // fn#99746, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:2035, offset: 0x021d55c1, size: 68 bytes, params: 2, frame: 17
const dispatchBinding = dispatch;
const rpcHelpersModule = require(8081) /* metro dependency 8081: RPCHelpers */;
return dispatchBinding(rpcHelpersModule.transformVoiceState(env0_2, env0_1.id, a0));
}
function _fun99755(a0) { // fn#99755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13254:3128, offset: 0x021d5890, size: 59 bytes, params: 2, frame: 15
let value = environment.__proto__.__proto__;
value = require(8081) /* metro dependency 8081: RPCHelpers */;
return value.transformVoiceState(env0_2, env0_1.id, a0);
}
@@ -0,0 +1,112 @@
/* Metro module 13051; source: modules/rpc/server/events/subscriptionHelpers.tsx; dependencies: [1378, 8065, 7093, 661, 4237, 8095, 8750, 13014, 7116, 2] */
function _fun99669(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99669, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13241:6, offset: 0x021d0be7, size: 200 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const embeddedActivitiesStore = importDefault(1378) /* metro dependency 1378: EmbeddedActivitiesStore */;
const framesStore = importDefault(8065) /* metro dependency 8065: FramesStore */;
const questStore = importDefault(7093) /* metro dependency 7093: QuestStore */;
const env0_5 = (require(661) /* metro dependency 661: Constants */).RPCEvents;
const constantsModule = require(4237) /* metro dependency 4237: Constants */;
const env0_6 = constantsModule.ActivityLayoutMode;
const env0_7 = constantsModule.ActivityScreenOrientation;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/events/subscriptionHelpers.tsx');
exports.getInitialSubscriptionPayload = getInitialSubscriptionPayload;
}
function getInitialSubscriptionPayload(a0, a1, a2) { // fn#99670, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13241:324, offset: 0x021d0caf, size: 714 bytes, params: 4, frame: 19
var id;
var enrolledAt;
var r4;
var r1;
var r3;
var quest_id;
var quest;
var activityApplicationId;
var value4;
var application;
var object2;
var userStatus;
var value7;
var value8;
var value9;
var value11;
var value;
const ACTIVITY_PIP_MODE_UPDATE = RPCEvents.ACTIVITY_PIP_MODE_UPDATE;
if (ACTIVITY_PIP_MODE_UPDATE === a1) {
application = a0.application;
value11 = null;
id = value11 == application ? undefined : application.id;
r3 = value11 != id ? EmbeddedActivitiesStore.getLayoutModeForApp(id) : value11;
return value11 != r3 ? {is_pip_mode: r3 !== ActivityLayoutMode.FOCUSED} : value11;
}
const ACTIVITY_LAYOUT_MODE_UPDATE = RPCEvents.ACTIVITY_LAYOUT_MODE_UPDATE;
if (ACTIVITY_LAYOUT_MODE_UPDATE === a1) {
application = a0.application;
value9 = null;
id = value9 == application ? undefined : application.id;
r4 = value9 != id ? EmbeddedActivitiesStore.getLayoutModeForApp(id) : value9;
return value9 != r4 ? {layout_mode: r4} : value9;
}
const FRAME_LAYOUT_MODE_UPDATE = RPCEvents.FRAME_LAYOUT_MODE_UPDATE;
if (FRAME_LAYOUT_MODE_UPDATE === a1) {
application = a0.application;
value7 = null;
value8 = undefined;
if (value7 != (value7 == application ? value8 : application.id)) {
value = FramesStore.getConnectedFrame();
r4 = value7 == value ? value8 : value.layoutMode;
} else {
r4 = value7;
}
return value7 != r4 ? {layout_mode: r4} : value7;
}
const THERMAL_STATE_UPDATE = RPCEvents.THERMAL_STATE_UPDATE;
if (THERMAL_STATE_UPDATE === a1) {
value = require(8095) /* metro dependency 8095: useThermalState */;
value = value.getThermalState();
return value === (require(8095) /* metro dependency 8095: useThermalState */).ThermalStates.UNHANDLED ? null : {thermal_state: value};
}
const ORIENTATION_UPDATE = RPCEvents.ORIENTATION_UPDATE;
if (ORIENTATION_UPDATE === a1) {
object2 = {};
object2.screen_orientation = (require(8750) /* metro dependency 8750: useIsScreenLandscapeNative */).getIsScreenLandscape() ? ActivityScreenOrientation.LANDSCAPE : ActivityScreenOrientation.PORTRAIT;
return object2;
}
const ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE = RPCEvents.ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE;
if (ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE === a1) {
return (require(13014) /* metro dependency 13014: activityInstanceConnectedParticipants */).activityInstanceConnectedParticipants();
}
const QUEST_ENROLLMENT_STATUS_UPDATE = RPCEvents.QUEST_ENROLLMENT_STATUS_UPDATE;
if (QUEST_ENROLLMENT_STATUS_UPDATE === a1) {
quest_id = a2.quest_id;
if (quest_id) {
quest = QuestStore.getQuest(quest_id);
value = undefined;
activityApplicationId = (require(7116) /* metro dependency 7116: QuestTaskUtils */).getActivityApplicationId(quest);
value4 = null;
if (value4 == quest) {
r1 = value4;
} else if (value4 == activityApplicationId) {
r1 = value4;
} else {
application = a0.application;
if (activityApplicationId !== (value4 == application ? value : application.id)) {
r1 = value4;
} else {
object2 = {quest_id: quest_id};
userStatus = quest.userStatus;
enrolledAt = value4 == userStatus ? value : userStatus.enrolledAt;
object2.is_enrolled = value4 != enrolledAt;
userStatus = quest.userStatus;
enrolledAt = value4 == userStatus ? value : userStatus.enrolledAt;
object2.enrolled_at = value4 != enrolledAt ? enrolledAt : value4;
r1 = object2;
}
}
return r1;
}
}
return null;
}
@@ -0,0 +1,64 @@
/* Metro module 8086; source: modules/rpc/transports/BaseSocket.tsx; dependencies: [6, 7, 661, 22, 8076, 2] */
function _fun64817(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#64817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8271:6, offset: 0x01bb620d, size: 164 bytes, params: 8, frame: 19
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
let value = require(661) /* metro dependency 661: Constants */;
const env0_4 = value.RPC_VERSION;
const env0_5 = value.RPCCloseCodes;
value = _fun64818();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/transports/BaseSocket.tsx');
exports.default = value;
}
function _fun64818() { // fn#64818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8271:162, offset: 0x01bb62b1, size: 57 bytes, params: 1, frame: 14
return env0_3(BaseSocket, [{key: 'checkRpcVersion', value: value_64820}]);
}
function BaseSocket(a0, a1, a2) { // fn#64819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8271:183, offset: 0x01bb62ea, size: 220 bytes, params: 4, frame: 17
let value = environment.__proto__;
env1_2(this, BaseSocket);
this.transport = a0;
this.version = a1;
this.encoding = a2;
value = importDefault(22) /* metro dependency 22 */;
this.id = value.uniqueId();
const Date = global.Date;
this.authorization = {'authing': false, 'scopes': null, 'accessToken': null, scopes: [], expires: new Date(0)};
this.application = {'id': null, 'name': null, 'icon': null};
const AbortController = global.AbortController;
this.abortController = new AbortController();
this.checkRpcVersion(a1);
}
function value_64820(a0) { // fn#64820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8271:527, offset: 0x01bb63c6, size: 122 bytes, params: 2, frame: 14
var value;
var defaultImport;
if (a0 == null) {
value = environment.__proto__;
defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).closeCode = RPCCloseCodes.INVALID_VERSION;
value = 'Invalid Version: ' + a0;
value = new defaultImport();
throw value;
}
value = environment.__proto__;
if (a0 > RPC_VERSION) {
value = environment.__proto__;
defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).closeCode = RPCCloseCodes.INVALID_VERSION;
value = 'Invalid Version: ' + a0;
value = new defaultImport();
throw value;
}
if (a0 < 1) {
value = environment.__proto__;
defaultImport = importDefault(8076) /* metro dependency 8076: RPCError */;
({}).closeCode = RPCCloseCodes.INVALID_VERSION;
value = 'Invalid Version: ' + a0;
value = new defaultImport();
throw value;
}
}
@@ -0,0 +1,94 @@
/* Metro module 8085; source: modules/rpc/transports/PostMessageProxySocket.tsx; dependencies: [6, 7, 15, 17, 18, 4135, 661, 8076, 8075, 8086, 2] */
function _fun64809(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#64809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8270:6, offset: 0x01bb5e14, size: 246 bytes, params: 8, frame: 19
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
const env0_4 = importDefault(15) /* metro dependency 15 */;
const env0_5 = importDefault(17) /* metro dependency 17 */;
const env0_6 = importDefault(18) /* metro dependency 18 */;
const env0_7 = (require(4135) /* metro dependency 4135: Constants */).TransportTypes;
const env0_8 = (require(661) /* metro dependency 661: Constants */).RPCCloseCodes;
let value = importDefault(8086) /* metro dependency 8086: BaseSocket */;
value = _fun64813(value);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/transports/PostMessageProxySocket.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_64810() { // fn#64810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8270:197, offset: 0x01bb5f0a, 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_64810_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun64813(a0) { // fn#64813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8270:396, offset: 0x01bb5f68, size: 91 bytes, params: 2, frame: 16
const closure = WindowProxySocket;
env0_6(closure, a0);
return env0_3(closure, [{key: 'send', value: function(a0) {
var property = this.onSendingToRPCClient;
if (property != null) {
property.call(this, a0, this.id);
}
this.postMessageToRPCClient([importDefault(dependencyMap[8]).FRAME, a0], this.origin);
}}, {key: 'close', value: function(a0, a1) {
if (!this.closed) {
this.postClose(this.origin, {code: a0, message: a1}, this.postMessageToRPCClient);
}
this.closed = true;
}}]);
}
function WindowProxySocket({origin, postMessageToRPCClient, frameId, version, encoding, logger, postClose, onSendingToRPCClient}) { // fn#64814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8270:408, offset: 0x01bb5fc3, size: 423 bytes, params: 2, frame: 27
var defaultImport2;
let value = environment.__proto__;
env1_2(this, WindowProxySocket);
const POST_MESSAGE = TransportTypes.POST_MESSAGE;
const items = [POST_MESSAGE, version, encoding];
const value3 = env1_5(WindowProxySocket);
const value6 = env1_4(this, _isNativeReflectConstruct_64810() ? global.Reflect.construct(value3, items,
env1_5(this).constructor) : value3.apply(this, items));
if (['etf', 'json'].indexOf(encoding) === -1) {
defaultImport2 = importDefault(8076) /* metro dependency 8076: RPCError */;
value = 'Invalid Encoding: ' + encoding;
value = new defaultImport2({closeCode: RPCCloseCodes.INVALID_ENCODING}, value);
throw value;
}
if (encoding === 'etf') {
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({closeCode: RPCCloseCodes.INVALID_ENCODING},
'Erlpack cannot be used on this client');
}
value6.origin = origin;
value6.postMessageToRPCClient = postMessageToRPCClient;
value6.frameId = frameId;
value6.logger = logger;
value6.postClose = postClose;
value6.onSendingToRPCClient = onSendingToRPCClient;
value6.closed = false;
return value6;
}
File diff suppressed because it is too large. Load diff