991 lines
42 KiB
TypeScript
991 lines
42 KiB
TypeScript
/* Metro module 12497; source: modules/gateway/GatewaySocketDispatcher.tsx; dependencies: [6, 7, 57, 12498, 3, 12499, 12502, 12501, 12503, 566, 12504, 2] */
|
|
import Logger from '../debug/Logger.tsx'; /* Metro dependency 3 */
|
|
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 Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import ActionBatcher from './ActionBatcher.tsx'; /* Metro dependency 12504 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as DispatcherWorkConstantsModule from './DispatcherWorkConstants.tsx'; /* Metro dependency 12498 */
|
|
|
|
function _fun95177(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#95177, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:6, offset: 0x02134352, size: 465 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_95180 = 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_5 = Module00057;
|
|
let value = Logger;
|
|
value = new value('GatewaySocket');
|
|
let Set = global.Set;
|
|
let set = new Set(['INITIAL_GUILD', 'READY']);
|
|
Set = global.Set;
|
|
set = new Set(['READY', 'INITIAL_GUILD']);
|
|
Set = global.Set;
|
|
set = new Set(['READY', 'READY_SUPPLEMENTAL', 'RESUMED']);
|
|
Set = global.Set;
|
|
set = new Set(['READY', 'INITIAL_GUILD', 'READY_SUPPLEMENTAL', 'RESUMED', 'VOICE_CHANNEL_SELECT',
|
|
'VOICE_STATE_UPDATE', 'VOICE_SERVER_UPDATE', 'RTC_CONNECTION_STATE', 'RTC_CONNECTION_VIDEO',
|
|
'RTC_CONNECTION_CLIENT_CONNECT', 'RTC_CONNECTION_PING', 'MEDIA_SESSION_JOINED', 'MEDIA_ENGINE_PERMISSION',
|
|
'SESSIONS_REPLACE', 'STREAM_CREATE', 'STREAM_SERVER_UPDATE', 'STREAM_DELETE', 'STREAM_UPDATE']);
|
|
object = {NotStarted: 0};
|
|
object[0] = 'NotStarted';
|
|
object.Loading = 1;
|
|
object[1] = 'Loading';
|
|
object.Loaded = 2;
|
|
object[2] = 'Loaded';
|
|
const env0_13 = {};
|
|
set = _fun95182();
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/gateway/GatewaySocketDispatcher.tsx');
|
|
exports.default = set;
|
|
function _createForOfIteratorHelperLoose_95178(a0, a1) { // fn#95178, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:176, offset: 0x02134523, 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 _fun95179;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_95180(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_95180(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_95180(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun95179;
|
|
}
|
|
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 _fun95179() { // fn#95179, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:747, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function _fun95182() { // fn#95182, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:1965, offset: 0x0213471d, size: 400 bytes, params: 1, frame: 15
|
|
return CreateClass(GatewaySocketDispatcher, [{key: 'hasStuffToDispatchNow', value: value_95185},
|
|
{key: 'processFirstQueuedDispatch', value: value_95186}, {key: 'unpauseDispatchQueue', value: value_95187},
|
|
{key: 'receiveDispatch', value: value_95188}, {key: 'maybePreload', value: value_95189}, {key: 'scheduleFlush',
|
|
value: value_95192}, {key: 'getDispatchTimings', value: value_95193}, {key: 'getSchedulerTelemetry',
|
|
value: function() {
|
|
return this.scheduler.telemetry;
|
|
}}, {key: 'getIsSchedulerBackgrounded', value: function() {
|
|
return this.scheduler.isBackgrounded;
|
|
}}, {key: 'toggleRequestIdleCallback', value: function(a0) {
|
|
this.scheduler.toggleRequestIdleCallback(a0);
|
|
}}, {key: 'getIsRequestIdleCallbackEnabled', value: function() {
|
|
return this.scheduler.isRequestIdleCallbackEnabled;
|
|
}}, {key: 'dispatchMultiple', value: value_95198}, {key: 'dispatchOne', value: value_95200}, {key: 'clear',
|
|
value: function() {
|
|
this.paused = false;
|
|
this.queue.length = 0;
|
|
}}]);
|
|
function GatewaySocketDispatcher(a0) { // fn#95183, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:1986, offset: 0x021348ad, size: 145 bytes, params: 2, frame: 16
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
env1_3(this, GatewaySocketDispatcher);
|
|
this.socket = a0;
|
|
value = require(12499) /* metro dependency 12499: DispatcherWorkSchedulerNative */;
|
|
this.scheduler = value.createDispatcherWorkScheduler();
|
|
this.queue = [];
|
|
this.paused = true;
|
|
value = require(12502) /* metro dependency 12502: GatewaySocketAnalytics */;
|
|
this.resumeAnalytics = value.createResumeAnalytics();
|
|
this.getDispatchHandler = null;
|
|
this.flush = flush_95184;
|
|
function GatewaySocketDispatcherFlush(a0) { // fn#95184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:2247, owner: GatewaySocketDispatcher.flush, offset: 0x0213493e, size: 382 bytes, params: 2, frame: 21
|
|
var r6;
|
|
var r5;
|
|
var status;
|
|
var value4;
|
|
var Loaded;
|
|
var value5;
|
|
var telemetry;
|
|
var timeEnd;
|
|
var value;
|
|
if (env0_0.paused) {
|
|
return true;
|
|
}
|
|
let performance = global.performance;
|
|
const value2 = performance.now();
|
|
let queue = env0_0.queue;
|
|
let length = queue.length;
|
|
const value3 = 0;
|
|
if (value3 < length) {
|
|
queue = env0_0.queue;
|
|
status = queue[value3].status;
|
|
value4 = environment.__proto__.__proto__;
|
|
Loaded = env2_12.Loaded;
|
|
if (status !== Loaded) {
|
|
r5 = value3;
|
|
} else {
|
|
r6 = value3;
|
|
while (true) {
|
|
value5 = typeof r6 === 'bigint' ? r6 + 1n : +r6 + 1;
|
|
queue = env0_0.queue;
|
|
length = queue.length;
|
|
if (!(value5 < length)) {
|
|
r5 = value5;
|
|
break;
|
|
}
|
|
queue = env0_0.queue;
|
|
status = queue[value5].status;
|
|
Loaded = env2_12.Loaded;
|
|
if (status === Loaded) {
|
|
r6 = value5;
|
|
continue;
|
|
}
|
|
r5 = value5;
|
|
break;
|
|
}
|
|
}
|
|
} else {
|
|
r5 = value3;
|
|
}
|
|
if (value3 === r5) {
|
|
return true;
|
|
}
|
|
let binding = env0_0;
|
|
const value6 = binding.queue.splice(value3, r5);
|
|
const value7 = binding.dispatchMultiple(value6, a0);
|
|
if (value7) {
|
|
telemetry = env0_0.scheduler.telemetry;
|
|
timeEnd = telemetry.timeEnd;
|
|
value = environment.__proto__.__proto__;
|
|
Reflect.apply(timeEnd, telemetry,
|
|
[(require(12501) /* metro dependency 12501: WorkSchedulerTelemetry */).WorkSchedulerTelemetryTiming.TIME_TO_QUEUE_EMPTY]);
|
|
}
|
|
performance = global.performance;
|
|
value = performance.now() - value2;
|
|
if (value > DISPATCHER_IDEAL_TIME_LIMIT_MS && !value7) {
|
|
binding = env2_7;
|
|
binding.log('Dispatched ' + value6.length + ' messages in ' + value + 'ms');
|
|
}
|
|
return value7;
|
|
}
|
|
|
|
}
|
|
|
|
function value_95185() { // fn#95185, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:2670, offset: 0x02134abc, size: 57 bytes, params: 1, frame: 4
|
|
var r0;
|
|
var status;
|
|
let value = this.queue.length > 0;
|
|
if (value) {
|
|
status = this.queue[0].status;
|
|
value = environment.__proto__;
|
|
value = status === env1_12.Loaded;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_95186(a0) { // fn#95186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:2783, offset: 0x02134af5, size: 206 bytes, params: 2, frame: 16
|
|
var has;
|
|
var type;
|
|
var status;
|
|
var value;
|
|
var Loaded;
|
|
var push;
|
|
var shift;
|
|
const items2 = [];
|
|
let queue = this.queue;
|
|
let length = queue.length;
|
|
if (length > 0) {
|
|
has = a0.has;
|
|
queue = this.queue;
|
|
type = queue[0].type;
|
|
if (Reflect.apply(has, a0, [type])) {
|
|
queue = this.queue;
|
|
status = queue[0].status;
|
|
value = environment.__proto__;
|
|
Loaded = env1_12.Loaded;
|
|
if (status === Loaded) {
|
|
while (true) {
|
|
push = items2.push;
|
|
queue = this.queue;
|
|
shift = queue.shift;
|
|
Reflect.apply(push, items2, [Reflect.apply(shift, queue, [])]);
|
|
queue = this.queue;
|
|
length = queue.length;
|
|
if (!(length > 0)) {
|
|
break;
|
|
}
|
|
has = a0.has;
|
|
queue = this.queue;
|
|
type = queue[0].type;
|
|
if (Reflect.apply(has, a0, [type])) {
|
|
queue = this.queue;
|
|
status = queue[0].status;
|
|
Loaded = env1_12.Loaded;
|
|
if (status === Loaded) {
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.dispatchMultiple(items2);
|
|
}
|
|
|
|
function value_95187() { // fn#95187, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:2977, offset: 0x02134bc3, size: 86 bytes, params: 1, frame: 14
|
|
var r3;
|
|
var value3;
|
|
var value4;
|
|
this.paused = false;
|
|
let value = environment.__proto__;
|
|
value = _createForOfIteratorHelperLoose_95178(this.queue);
|
|
const value2 = value();
|
|
let done = value2.done;
|
|
if (!done) {
|
|
for (r3 = value2; true; r3 = value4) {
|
|
value3 = r3.value;
|
|
this.maybePreload(value3);
|
|
value4 = value();
|
|
done = value4.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
this.flush();
|
|
}
|
|
|
|
function value_95188(a0, a1, a2) { // fn#95188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:3154, offset: 0x02134c19, size: 134 bytes, params: 4, frame: 13
|
|
const getDispatchHandler = this.getDispatchHandler;
|
|
if (getDispatchHandler == null) {
|
|
throw global.Error('getDispatchHandler needs to be passed in first!');
|
|
}
|
|
const object = {data: a0, type: a1, compressionAnalytics: a2};
|
|
const NotStarted = env1_12.NotStarted;
|
|
object.status = NotStarted;
|
|
object.preloadPromise = null;
|
|
object.preloadedData = null;
|
|
this.queue.push(object);
|
|
if (!this.maybePreload(object)) {
|
|
this.scheduleFlush(a1);
|
|
}
|
|
}
|
|
|
|
function value_95189(a0) { // fn#95189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:3461, offset: 0x02134c9f, size: 204 bytes, params: 2, frame: 16
|
|
var environment;
|
|
var r3;
|
|
var value;
|
|
var binding;
|
|
var status;
|
|
const env0_1 = a0;
|
|
if (this.paused) {
|
|
value = environment.__proto__;
|
|
binding = env1_8;
|
|
if (binding.has(a0.type)) {
|
|
status = a0.status;
|
|
value = environment.__proto__;
|
|
if (status !== env1_12.NotStarted) {
|
|
return false;
|
|
}
|
|
r3 = this.getDispatchHandler(a0.type)?.preload(a0.data);
|
|
a0.status = r3 == null ? env1_12.Loaded : env1_12.Loading;
|
|
a0.preloadPromise = r3;
|
|
if (r3 != null) {
|
|
r3.then(_fun95190).catch(_fun95191);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
} else {
|
|
status = a0.status;
|
|
value = environment.__proto__;
|
|
if (status !== env1_12.NotStarted) {
|
|
return false;
|
|
}
|
|
r3 = this.getDispatchHandler(a0.type)?.preload(a0.data);
|
|
a0.status = r3 == null ? env1_12.Loaded : env1_12.Loading;
|
|
a0.preloadPromise = r3;
|
|
if (r3 != null) {
|
|
r3.then(_fun95190).catch(_fun95191);
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
function _fun95190(a0) { // fn#95190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:3697, offset: 0x02134d6b, size: 59 bytes, params: 2, frame: 11
|
|
const binding = env0_1;
|
|
binding.preloadedData = a0;
|
|
const Loaded = env2_12.Loaded;
|
|
binding.status = Loaded;
|
|
const binding2 = env0_0;
|
|
binding2.scheduleFlush(binding.type);
|
|
}
|
|
|
|
function _fun95191(a0) { // fn#95191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:3774, offset: 0x02134da6, size: 48 bytes, params: 2, frame: 13
|
|
return env0_0.socket.resetSocketOnDispatchError({error: a0, action: env0_1.type});
|
|
}
|
|
|
|
}
|
|
|
|
function value_95192(a0) { // fn#95192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:3884, offset: 0x02134dd6, size: 134 bytes, params: 2, frame: 15
|
|
var value;
|
|
var binding;
|
|
var value2;
|
|
var scheduler;
|
|
if (!this.paused) {
|
|
value = environment.__proto__;
|
|
binding = env1_9;
|
|
value2 = binding.has(a0);
|
|
scheduler = this.scheduler;
|
|
if (value2) {
|
|
scheduler.clearWorkTimeout();
|
|
this.flush();
|
|
} else if (!scheduler.hasWorkScheduled) {
|
|
scheduler = this.scheduler;
|
|
scheduler.requestWorkTimeout(this.flush);
|
|
}
|
|
binding = env1_11;
|
|
if (binding.has(a0)) {
|
|
this.scheduler.markCriticalWorkScheduled();
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_95193() { // fn#95193, offset: 0x00e2f9d5, size: 9 bytes, params: 1, frame: 1
|
|
return env1_13;
|
|
}
|
|
|
|
function value_95198(a0, a1) { // fn#95198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:4563, offset: 0x02134eb0, size: 489 bytes, params: 3, frame: 22
|
|
var environment;
|
|
var items2;
|
|
var socket;
|
|
var connectionState;
|
|
var property;
|
|
var defaultImport;
|
|
var RESUMING;
|
|
var value2;
|
|
var defaultImport2;
|
|
var Emitter;
|
|
var pause;
|
|
var defaultImport3;
|
|
var batched;
|
|
var closure;
|
|
var binding;
|
|
var defaultImport4;
|
|
var resume;
|
|
var value3;
|
|
var COUNT_DISPATCHES_LEFT_AFTER_YIELD;
|
|
var queue;
|
|
var unshift;
|
|
var requestWorkTimeout;
|
|
var flush;
|
|
var error;
|
|
var resetSocketOnDispatchError;
|
|
const env0_1 = a0;
|
|
const env0_2 = a1;
|
|
let length = a0.length;
|
|
if (length !== 0) {
|
|
var env0_3 = 'none';
|
|
var env0_4 = false;
|
|
var scheduler = this.scheduler;
|
|
var telemetry = scheduler.telemetry;
|
|
var measure = telemetry.measure;
|
|
var value = environment.__proto__;
|
|
var WorkSchedulerTelemetryMeasurement = require(dependencyMap[7]).WorkSchedulerTelemetryMeasurement;
|
|
var COUNT_INITIAL_DISPATCHS_LENGTH = WorkSchedulerTelemetryMeasurement.COUNT_INITIAL_DISPATCHS_LENGTH;
|
|
length = a0.length;
|
|
Reflect.apply(measure, telemetry, [COUNT_INITIAL_DISPATCHS_LENGTH, length]);
|
|
reducibleJoin3: while (true) {
|
|
reduciblePort71: while (true) {
|
|
exceptionLanding70: while (true) {
|
|
try {
|
|
items2 = [];
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
break reducibleJoin3;
|
|
}
|
|
socket = this.socket;
|
|
resetSocketOnDispatchError = socket.resetSocketOnDispatchError;
|
|
Reflect.apply(resetSocketOnDispatchError, socket, [{error: error, action: env0_3}]);
|
|
break reduciblePort71;
|
|
}
|
|
return true;
|
|
}
|
|
try {
|
|
var object2 = items2;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
socket = this.socket;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
connectionState = socket.connectionState;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
property = dependencyMap[8];
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
defaultImport = importDefault(property);
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
RESUMING = defaultImport.RESUMING;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
value2 = connectionState !== RESUMING;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
reducibleJoin22: while (true) {
|
|
if (value2) {
|
|
break reducibleJoin22;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
property = dependencyMap[9];
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
defaultImport2 = importDefault(property);
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
Emitter = defaultImport2.Emitter;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
pause = Emitter.pause;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
Reflect.apply(pause, Emitter, [150]);
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
break reducibleJoin22;
|
|
}
|
|
try {
|
|
var env0_6 = 0;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
property = dependencyMap[9];
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
defaultImport3 = importDefault(property);
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
Emitter = defaultImport3.Emitter;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
batched = Emitter.batched;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
closure = _fun95199;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
Reflect.apply(batched, Emitter, [closure]);
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
binding = env0_4;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
reducibleJoin41: while (true) {
|
|
if (binding) {
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
property = dependencyMap[9];
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
defaultImport4 = importDefault(property);
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
Emitter = defaultImport4.Emitter;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
resume = Emitter.resume;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
Reflect.apply(resume, Emitter, []);
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
break reducibleJoin41;
|
|
}
|
|
break reducibleJoin41;
|
|
}
|
|
try {
|
|
binding = object2;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
length = binding.length;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
value3 = length > 0;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
if (value3) {
|
|
try {
|
|
scheduler = this.scheduler;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
telemetry = scheduler.telemetry;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
measure = telemetry.measure;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
property = dependencyMap[7];
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
value = require(property);
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
WorkSchedulerTelemetryMeasurement = value.WorkSchedulerTelemetryMeasurement;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
COUNT_DISPATCHES_LEFT_AFTER_YIELD = WorkSchedulerTelemetryMeasurement.COUNT_DISPATCHES_LEFT_AFTER_YIELD;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
binding = object2;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
length = binding.length;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
Reflect.apply(measure, telemetry, [COUNT_DISPATCHES_LEFT_AFTER_YIELD, length]);
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
queue = this.queue;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
unshift = queue.unshift;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
binding = object2;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
items2 = [];
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
arraySpread(items2, binding, 0, require);
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
apply(unshift, items2, queue, require);
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
scheduler = this.scheduler;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
requestWorkTimeout = scheduler.requestWorkTimeout;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
flush = this.flush;
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
try {
|
|
Reflect.apply(requestWorkTimeout, scheduler, [flush, true]);
|
|
} catch (error) {
|
|
break exceptionLanding70;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
function _fun95199() { // fn#95199, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:4864, offset: 0x02135099, size: 437 bytes, params: 1, frame: 25
|
|
var r9;
|
|
var r7;
|
|
var r3;
|
|
var property;
|
|
var type;
|
|
var binding;
|
|
var value4;
|
|
var performance;
|
|
var now;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var property2;
|
|
var value8;
|
|
var value9;
|
|
var _shouldYieldToBrowserBinding;
|
|
var value10;
|
|
var value11;
|
|
var value12;
|
|
var timeRemaining;
|
|
var value13;
|
|
var scheduler;
|
|
var telemetry;
|
|
var timeTrack;
|
|
var WorkSchedulerTelemetryTiming;
|
|
var TIME_OVER_DEADLINE;
|
|
var timeSinceExpiration;
|
|
let length = env0_1.length;
|
|
const value2 = 0;
|
|
if (value2 < length) {
|
|
r9 = value2;
|
|
while (true) {
|
|
property = env0_1[r9];
|
|
type = property.type;
|
|
env0_3 = type;
|
|
binding = env0_4;
|
|
if (binding) {
|
|
r7 = binding;
|
|
} else {
|
|
value4 = env2_10.has(property.type);
|
|
r7 = value4;
|
|
}
|
|
env0_4 = r7;
|
|
performance = global.performance;
|
|
value5 = performance.now();
|
|
binding = env0_0;
|
|
binding.dispatchOne(property);
|
|
performance = global.performance;
|
|
now = performance.now;
|
|
value6 = Reflect.apply(now, performance, []) - value5;
|
|
env0_6 = value6;
|
|
type = property.type;
|
|
property = env2_13[type];
|
|
if (property != null) {
|
|
r7 = property;
|
|
continue;
|
|
}
|
|
value7 = env2_5([0, 0], 2);
|
|
property = value7[value2];
|
|
property2 = value7[1];
|
|
binding = env2_13;
|
|
value8 = property * property2 + value6;
|
|
value9 = value8 / (property2 + 1);
|
|
binding[type] = [value9, property2 + 1];
|
|
_shouldYieldToBrowserBinding = _shouldYieldToBrowser;
|
|
binding = env0_1;
|
|
value10 = _shouldYieldToBrowserBinding(binding, r9, require);
|
|
binding = env0_1;
|
|
if (value10) {
|
|
env0_5 = binding.slice(r9 + 1);
|
|
value12 = require != null;
|
|
if (!value12) {
|
|
r3 = value12;
|
|
continue;
|
|
}
|
|
timeRemaining = require.timeRemaining;
|
|
value13 = Reflect.apply(timeRemaining, require, []) <= value2;
|
|
r3 = value13;
|
|
if (r3) {
|
|
scheduler = env0_0.scheduler;
|
|
telemetry = scheduler.telemetry;
|
|
timeTrack = telemetry.timeTrack;
|
|
WorkSchedulerTelemetryTiming = (require(12501) /* metro dependency 12501: WorkSchedulerTelemetry */).WorkSchedulerTelemetryTiming;
|
|
TIME_OVER_DEADLINE = WorkSchedulerTelemetryTiming.TIME_OVER_DEADLINE;
|
|
timeSinceExpiration = require.timeSinceExpiration;
|
|
Reflect.apply(timeTrack, telemetry, [TIME_OVER_DEADLINE, timeSinceExpiration]);
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
value11 = typeof r9 === 'bigint' ? r9 + 1n : +r9 + 1;
|
|
length = binding.length;
|
|
if (value11 < length) {
|
|
r9 = value11;
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
(ActionBatcher).flush();
|
|
}
|
|
|
|
}
|
|
|
|
function value_95200({data, type, compressionAnalytics, preloadedData}) { // fn#95200, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:5721, offset: 0x0213524e, size: 619 bytes, params: 2, frame: 28
|
|
var resumeAnalytics;
|
|
var value3;
|
|
var numEvents;
|
|
var dispatchHandler;
|
|
var dispatchHandler2;
|
|
var moduleValue;
|
|
var moduleValue2;
|
|
var readyPayloadByteSizeAnalytics;
|
|
var dispatchHandler3;
|
|
var moduleValue4;
|
|
var dispatchTime;
|
|
let performance = global.performance;
|
|
const value = performance.now();
|
|
let connectionState = this.socket.connectionState;
|
|
let RESUMING = (importDefault(12503) /* metro dependency 12503: ConnectionState */).RESUMING;
|
|
if (connectionState === RESUMING) {
|
|
resumeAnalytics = this.resumeAnalytics;
|
|
value3 = value - resumeAnalytics.lastUpdateTime;
|
|
resumeAnalytics = this.resumeAnalytics;
|
|
numEvents = resumeAnalytics.numEvents;
|
|
if (numEvents === 0) {
|
|
this.resumeAnalytics.initialWaitTime = value3;
|
|
} else if (value3 > this.resumeAnalytics.largestWaitTime) {
|
|
this.resumeAnalytics.largestWaitTime = value3;
|
|
}
|
|
resumeAnalytics = this.resumeAnalytics;
|
|
resumeAnalytics.totalWaitTime = resumeAnalytics.totalWaitTime + value3;
|
|
resumeAnalytics = this.resumeAnalytics;
|
|
resumeAnalytics.lastUpdateTime = value;
|
|
resumeAnalytics = this.resumeAnalytics;
|
|
numEvents = resumeAnalytics.numEvents;
|
|
resumeAnalytics.numEvents = numEvents + 1;
|
|
}
|
|
(ActionBatcher).flush(type, data);
|
|
if (type === 'READY') {
|
|
readyPayloadByteSizeAnalytics = (require(12502) /* metro dependency 12502: GatewaySocketAnalytics */).getReadyPayloadByteSizeAnalytics(data);
|
|
dispatchHandler3 = this.getDispatchHandler(type);
|
|
if (dispatchHandler3 != null) {
|
|
dispatchHandler3.dispatch(data, type, preloadedData);
|
|
}
|
|
moduleValue4 = require(12502) /* metro dependency 12502: GatewaySocketAnalytics */;
|
|
moduleValue4.logReadyPayloadReceived(this.socket, data, value, compressionAnalytics,
|
|
readyPayloadByteSizeAnalytics);
|
|
} else if (type === 'RESUMED') {
|
|
dispatchHandler2 = this.getDispatchHandler(type);
|
|
if (dispatchHandler2 != null) {
|
|
dispatchHandler2.dispatch(data, type, preloadedData);
|
|
}
|
|
moduleValue = require(12502) /* metro dependency 12502: GatewaySocketAnalytics */;
|
|
moduleValue.logResumeAnalytics(this.resumeAnalytics);
|
|
this.socket.handleResumeDispatched();
|
|
moduleValue2 = require(12502) /* metro dependency 12502: GatewaySocketAnalytics */;
|
|
this.resumeAnalytics = moduleValue2.createResumeAnalytics();
|
|
} else {
|
|
dispatchHandler = this.getDispatchHandler(type);
|
|
if (dispatchHandler != null) {
|
|
dispatchHandler.dispatch(data, type, preloadedData);
|
|
}
|
|
}
|
|
connectionState = this.socket.connectionState;
|
|
RESUMING = (importDefault(12503) /* metro dependency 12503: ConnectionState */).RESUMING;
|
|
if (connectionState === RESUMING) {
|
|
resumeAnalytics = this.resumeAnalytics;
|
|
dispatchTime = resumeAnalytics.dispatchTime;
|
|
performance = global.performance;
|
|
resumeAnalytics.dispatchTime = dispatchTime + (performance.now() - value);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _shouldYieldToBrowser(a0, a1, a2) { // fn#95181, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12687:1737, offset: 0x02134697, size: 134 bytes, params: 4, frame: 18
|
|
let value = null;
|
|
if (value == a2) {
|
|
return false;
|
|
}
|
|
const property = a0[a1];
|
|
const value2 = a0.length - 1;
|
|
const r8 = a1 < value2 ? a0[a1 + 1] : value;
|
|
const value3 = undefined;
|
|
const r9 = value == a2 ? value3 : a2.timeRemaining();
|
|
const value5 = 0;
|
|
const r5 = value != r9 ? r9 : value5;
|
|
const type2 = property.type;
|
|
const type = value == r8 ? value3 : r8.type;
|
|
value = value != a2;
|
|
return value && r5 <= value5 && !(type2 === type) && a1 !== value2;
|
|
}
|
|
|
|
global.__d(_fun95177, 12497, [6, 7, 57, 12498, 3, 12499, 12502, 12501, 12503, 566, 12504,
|
|
2]) /* metro module 12497, dependencies: [6, 7, 57, 12498, 3, 12499, 12502, 12501, 12503, 566, 12504, 2] */;
|