Files
2026-07-28 01:06:53 +03:00

601 lines
32 KiB
TypeScript

/* Metro module 13070; source: modules/rpc/RPCServer.tsx; dependencies: [5, 6, 7, 4135, 661, 22, 8082, 8076, 13050, 683, 44, 672, 2] */
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import Module00022 from '../../by-id/module-00022.js'; /* Metro dependency 22 */
import Durations from '../../utils/Durations.tsx'; /* Metro dependency 672 */
import AnalyticsUtils from '../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as ConstantsModule2 from './Constants.tsx'; /* Metro dependency 4135 */
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});
let value = ConstantsModule;
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();
(FileImportTrackerModule).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 CreateClass(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 _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 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 object = {};
object.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;
object.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, object);
} else {
var currentUser = this.getCurrentUser();
if (currentUser == null) {
a0.close(RPCCloseCodes.CLOSE_NORMAL, 'User logged out');
return undefined;
}
object.user = (importDefault(8082) /* metro dependency 8082: transformUser */)(currentUser);
this.dispatch(a0, null, RPCCommands.DISPATCH, RPCEvents.READY, object);
}
}
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 _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 object;
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;
object = {command: cmd};
object.scope = typeof property.scope === 'object' ? global.JSON.stringify(property.scope) : property.scope;
binding = env0_1;
object.application_id = binding.application.id;
object.socket_scope = binding.authorization.scopes.toString();
Reflect.apply(track, defaultImport2, [RPC_COMMAND_SENT, object]);
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 _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* _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());
}
}
}
function _fun99818() { // fn#99818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:2239, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
}
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 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 _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 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 = 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 _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 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 _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 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 _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 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 _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 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 object;
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;
object = {update: r10, dispatch: value2};
if (r10) {
value = r10({prevState: value, dispatch: value2});
r8 = value;
} else {
r8 = value;
}
object.prevState = r8;
object.socket = a0;
object.evt = a1;
object.args = a2;
Reflect.apply(push, subscriptions, [object]);
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 _fun99839(a0) { // fn#99839, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:4055, 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 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 _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 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 _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 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 = (Module00022).uniqueId();
const Promise = global.Promise;
return new Promise(_fun99848).then(function(a0) {
removeSubscription();
return a0;
});
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 = (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 _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 _fun99830(a0) { // fn#99830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:3257, offset: 0x00c78604, size: 11 bytes, params: 2, frame: 9
return a0();
}
function _fun99845(a0) { // fn#99845, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13260:4816, offset: 0x021d72bd, size: 33 bytes, params: 2, frame: 10
if (a0.update) {
a0.prevState = a0.update(a0);
}
}
global.__d(_fun99799, 13070, [5, 6, 7, 4135, 661, 22, 8082, 8076, 13050, 683, 44, 672,
2]) /* metro module 13070, dependencies: [5, 6, 7, 4135, 661, 22, 8082, 8076, 13050, 683, 44, 672, 2] */;