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

900 lines
42 KiB
TypeScript

/* Metro module 16251; source: modules/libdiscore/DispatcherBridge.tsx; dependencies: [6, 7, 4649, 6542, 6584, 10329, 1226, 1938, 1867, 661, 3, 1872, 1870, 683, 694, 7030, 1216, 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 SentryUtilsNative from '../../utils/SentryUtils.native.tsx'; /* Metro dependency 1216 */
import AuthenticationStore from '../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
import GuildStore from '../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import GuildRoleStore from '../../stores/GuildRoleStore.tsx'; /* Metro dependency 1938 */
import DevSettingsStore from '../devtools/dev_settings/DevSettingsStore.tsx'; /* Metro dependency 4649 */
import RawGuildEmojiStore from '../emojis/RawGuildEmojiStore.tsx'; /* Metro dependency 6542 */
import GuildStickersStore from '../stickers/GuildStickersStore.tsx'; /* Metro dependency 6584 */
import NoteStore from '../user_profile/notes/NoteStore.tsx'; /* Metro dependency 10329 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as LibdiscoreExperimentsModule from './libdiscoreExperiments.tsx'; /* Metro dependency 1870 */
function _fun125574(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#125574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:6, offset: 0x025dd1e7, size: 478 bytes, params: 8, frame: 24
const env0_0 = require;
const _arrayLikeToArray_125577 = 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});
let value = RawGuildEmojiStore;
const value8 = new (Logger)('DispatcherBridge');
items2 = [NoteStore, GuildStore, GuildRoleStore, value, GuildStickersStore];
const env0_9 = {GUILD_MEMBER_ADD: GUILD_MEMBER_ADD_125578, CONNECTION_OPEN: function(a0) {
return {guilds: a0.guilds, unavailableGuilds: a0.unavailableGuilds};
}, CACHE_LOADED: function(a0) {
return {guilds: a0.guilds};
}, CACHE_LOADED_LAZY: function(a0) {
return {guilds: a0.guilds};
}, BACKGROUND_SYNC: function(a0) {
return {guilds: a0.guilds};
}};
value = _fun125583();
const Set = global.Set;
const set = new Set(['libdiscore', 'typescript-libdiscore-dual-read']);
value = new value(((a0) => a0.filter(_fun125606))(items2));
(FileImportTrackerModule).fileFinishedImporting('modules/libdiscore/DispatcherBridge.tsx');
exports.default = value;
function _createForOfIteratorHelperLoose_125575(a0, a1) { // fn#125575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:216, offset: 0x025dd3c5, 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 _fun125576;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_125577(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_125577(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_125577(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun125576;
}
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 _fun125576() { // fn#125576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:787, 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 GUILD_MEMBER_ADD_125578(a0) { // fn#125578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:1200, offset: 0x025dd539, size: 40 bytes, params: 2, frame: 12
const object = {};
copyDataProperties(object, a0, undefined);
object['currentUserId'] = AuthenticationStore.getId();
return object;
}
function _fun125583() { // fn#125583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:1432, offset: 0x025dd590, size: 140 bytes, params: 1, frame: 15
return CreateClass(DispatcherBridge, [{key: 'handleFatalError', value: value_125601}, {key: 'handleStoreError',
value: value_125602}, {key: 'withStoreToken', value: value_125603}, {key: 'hasAnyAuthoritativeStore',
value: value_125604}]);
function DispatcherBridge(a0) { // fn#125584, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:1453, offset: 0x025dd61c, size: 681 bytes, params: 2, frame: 33
var r12;
var FLUX_API;
var info;
var items2;
var value5;
var value6;
var done;
var value7;
var name;
var value9;
var tokenToStore;
var push;
var mode;
var value11;
var value12;
var value13;
var value14;
var registeredActionTypes;
var value16;
var value17;
var closure;
var property;
var defaultImport;
var register;
var Object;
var fromEntries;
var value18;
var value19;
var moduleValue;
var DispatchBand;
var Database;
var moduleValue2;
var error;
let binding = env1_3;
binding(this, DispatcherBridge);
const Map = global.Map;
const value3 = Object.create(Map.prototype, {constructor: {value: Map}});
const map = new Map();
this.tokenToStore = map instanceof Object ? map : value3;
this.disabledFromFatalError = false;
let length = a0.length;
if (length !== 0) {
FLUX_API = require(dependencyMap[11]).FLUX_API;
if (FLUX_API != null) {
try {
items2 = [];
value5 = _createForOfIteratorHelperLoose_125575(a0);
value6 = value5();
done = value6.done;
if (!done) {
r12 = value6;
while (true) {
value7 = r12.value;
name = value7.getName();
value9 = value7.connectWithLibdiscore(FLUX_API);
tokenToStore = this.tokenToStore;
tokenToStore.set(value9, value7);
push = items2.push;
mode = value7.getMode();
value11 = '' + name + ' => [token: ' + value9 + ', mode: ' + mode + ']';
Reflect.apply(push, items2, [value11]);
value12 = value5();
done = value12.done;
if (done) {
break;
}
r12 = value12;
continue;
}
}
binding = env1_8;
info = binding.info;
length = a0.length;
value13 = items2.join(', ');
value14 = 'Connected ' + length + ' store(s), mapping: ' + value13 + '.';
Reflect.apply(info, binding, [value14]);
registeredActionTypes = FLUX_API.getRegisteredActionTypes();
info = binding.info;
length = registeredActionTypes.length;
value16 = registeredActionTypes.join(', ');
value17 = 'Registering ' + length + ' bridged action(s): ' + value16 + '.';
Reflect.apply(info, binding, [value17]);
closure = actionHandler;
var actionHandler = closure;
property = dependencyMap[14];
defaultImport = importDefault(property);
register = defaultImport.register;
Object = global.Object;
fromEntries = Object.fromEntries;
closure = function(a0) {
return [a0, actionHandler];
};
value18 = registeredActionTypes.map(closure);
value19 = Reflect.apply(fromEntries, Object, [value18]);
property = dependencyMap[14];
moduleValue = require(property);
DispatchBand = moduleValue.DispatchBand;
Database = DispatchBand.Database;
closure = _fun125598;
Reflect.apply(register, defaultImport, ['LibDiscoreDispatcherBridge', value19, closure, Database]);
property = dependencyMap[15];
moduleValue2 = require(property);
property = moduleValue2.default;
var env0_4 = property;
closure = _fun125599;
property.addChangeListener(closure);
} catch (error) {
binding = env1_8;
binding.error('Failed to initialize the dispatcher bridge', error);
}
} else {
env1_8.info('Not initializing DispatcherBridge, because kvStoreApi is unavailable.');
}
}
function actionHandler(a0) { // fn#125585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:2029, owner: DispatcherBridge.actionHandler, offset: 0x025dd8c5, size: 997 bytes, params: 2, frame: 31
var environment;
var r12;
var r15;
var value2;
var binding;
var type;
var property;
var performance;
var now;
var value3;
var JSON;
var stringify;
var value4;
var object;
var value5;
const TelemetryExperiment = (LibdiscoreExperimentsModule).TelemetryExperiment;
var shouldCollectMetrics;
var shouldCollectMetrics2;
var dispatchAction;
var value6;
var ok;
var handleFatalError;
var error;
var value7;
var value8;
var metrics;
var items4;
var _createForOfIteratorHelperLoose_125575Binding;
var storeResults;
var value9;
var value10;
var done;
var value11;
var push;
var handleStoreError;
var value12;
var actionHandler_loop2;
var length;
var value13;
var value14;
var withStoreToken;
var storeToken;
var value15;
var items2;
var timings;
var devSettingsStoreBinding;
var get;
var map;
var join;
var items3;
var mutations;
var memory;
var filter;
var info;
var HermesInternal;
var concat;
var track;
var LIBDISCORE_DISPATCH_BRIDGE_TELEMETRY;
var didEmit;
const env0_0 = a0;
let value = environment;
reducibleJoin20: while (true) {
if (env0_0.disabledFromFatalError) {
break reducibleJoin20;
}
value2 = environment.__proto__.__proto__;
binding = env2_9;
type = a0.type;
property = binding[type];
performance = global.performance;
now = performance.now;
value3 = Reflect.apply(now, performance, []);
if (property != null) {
JSON = global.JSON;
stringify = JSON.stringify;
object = {};
type = a0.type;
object.type = type;
copyDataProperties(object, property(a0), undefined);
value5 = Reflect.apply(stringify, JSON, [object]);
r12 = value5;
} else {
JSON = global.JSON;
stringify = JSON.stringify;
value4 = Reflect.apply(stringify, JSON, [a0]);
r12 = value4;
}
object = {kind: 'json_stringify_action'};
performance = global.performance;
now = performance.now;
object.durationMillis = Reflect.apply(now, performance, []) - value3;
shouldCollectMetrics = TelemetryExperiment.shouldCollectMetrics;
shouldCollectMetrics2 = Reflect.apply(shouldCollectMetrics, TelemetryExperiment, []);
dispatchAction = FLUX_API.dispatchAction;
value6 = Reflect.apply(dispatchAction, FLUX_API, [r12, shouldCollectMetrics2]);
ok = value6.ok;
if (ok) {
performance = global.performance;
now = performance.now;
value7 = Reflect.apply(now, performance, []) - value3;
value8 = value6.value;
metrics = value8.metrics;
items4 = [];
_createForOfIteratorHelperLoose_125575Binding = _createForOfIteratorHelperLoose_125575;
storeResults = value8.storeResults;
value9 = _createForOfIteratorHelperLoose_125575Binding(storeResults);
value10 = value9();
done = value10.done;
if (!done) {
r12 = value10;
reducibleLoop7: while (true) {
value11 = r12.value;
error = value11.error;
if (error != null) {
binding = env0_0;
handleStoreError = binding.handleStoreError;
type = a0.type;
Reflect.apply(handleStoreError, binding, [value11, type]);
} else {
push = items4.push;
Reflect.apply(push, items4, [value11]);
}
value12 = value9();
done = value12.done;
if (done) {
break reducibleLoop7;
}
r12 = value12;
continue reducibleLoop7;
}
}
actionHandler_loop2 = actionHandler_loop;
length = items4.length;
value13 = 0;
if (value13 < length) {
r15 = value13;
reducibleLoop12: while (true) {
actionHandler_loop2(items4[r15]);
value14 = typeof r15 === 'bigint' ? r15 + 1n : +r15 + 1;
length = items4.length;
if (value14 < length) {
r15 = value14;
continue reducibleLoop12;
}
break reducibleLoop12;
}
}
length = items4.length;
if (value13 < length) {
r12 = value13;
reducibleLoop14: while (true) {
property = items4[r12];
binding = env0_0;
withStoreToken = binding.withStoreToken;
storeToken = property.storeToken;
type = a0.type;
Reflect.apply(withStoreToken, binding, [storeToken, type, _fun125588]);
value15 = typeof r12 === 'bigint' ? r12 + 1n : +r12 + 1;
length = items4.length;
if (value15 < length) {
r12 = value15;
continue reducibleLoop14;
}
break reducibleLoop14;
}
}
if (metrics == null) {
break reducibleJoin20;
}
if (shouldCollectMetrics2) {
items2 = [object];
timings = metrics.timings;
arraySpread(items2, timings, 1, undefined);
devSettingsStoreBinding = DevSettingsStore;
get = devSettingsStoreBinding.get;
reducibleJoin19: while (true) {
if (Reflect.apply(get, devSettingsStoreBinding, ['libdiscore_verbose_telemetry_logging'])) {
map = items2.map;
value = Reflect.apply(map, items2, [function({kind, durationMillis}) {
return ' - ' + kind + ': ' + durationMillis + 'ms';
}]);
join = value.join;
value = Reflect.apply(join, value, ['\n']);
items3 = [['Timings', value]];
mutations = metrics.mutations;
map = mutations.map;
value = Reflect.apply(map, mutations, [_fun125590]);
join = value.join;
value = Reflect.apply(join, value, ['\n']);
items3[1] = ['Mutations', value];
memory = metrics.memory;
map = memory.map;
value = Reflect.apply(map, memory, [_fun125593]);
join = value.join;
value = Reflect.apply(join, value, ['\n']);
items3[2] = ['Memory Usage', value];
filter = items3.filter;
value = Reflect.apply(filter, items3, [_fun125595]);
map = value.map;
value = Reflect.apply(map, value, [_fun125596]);
join = value.join;
value = Reflect.apply(join, value, ['\n\n']);
binding = env2_8;
info = binding.info;
type = a0.type;
HermesInternal = global.HermesInternal;
concat = HermesInternal.concat;
Reflect.apply(info, binding, ['Handling action ' + type + ' took ' + value7 + 'ms\n' + value]);
break reducibleJoin19;
}
break reducibleJoin19;
}
value = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = value.track;
LIBDISCORE_DISPATCH_BRIDGE_TELEMETRY = AnalyticEvents.LIBDISCORE_DISPATCH_BRIDGE_TELEMETRY;
object = {};
type = a0.type;
object.action_type = type;
object.total_duration_millis = value7;
JSON = global.JSON;
stringify = JSON.stringify;
object.timings = Reflect.apply(stringify, JSON, [items2]);
JSON = global.JSON;
stringify = JSON.stringify;
mutations = metrics.mutations;
object.mutations = Reflect.apply(stringify, JSON, [mutations]);
JSON = global.JSON;
stringify = JSON.stringify;
memory = metrics.memory;
object.memory_usage = Reflect.apply(stringify, JSON, [memory]);
Reflect.apply(track, value, [LIBDISCORE_DISPATCH_BRIDGE_TELEMETRY, object]);
didEmit = TelemetryExperiment.didEmit;
Reflect.apply(didEmit, TelemetryExperiment, []);
break reducibleJoin20;
}
break reducibleJoin20;
}
binding = env0_0;
handleFatalError = binding.handleFatalError;
error = value6.error;
type = a0.type;
Reflect.apply(handleFatalError, binding, [error, type]);
break reducibleJoin20;
}
function actionHandler_loop(a0) { // fn#125586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:2539, owner: DispatcherBridge.actionHandler._loop, offset: 0x025ddcaa, size: 58 bytes, params: 2, frame: 15
const env0_0 = a0;
const binding = env1_1;
binding.withStoreToken(a0.storeToken, env0_0.type, _fun125587);
function _fun125587(a0) { // fn#125587, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:2589, offset: 0x025ddce4, size: 33 bytes, params: 2, frame: 11
a0.applyChanges(env0_0.databaseChanges);
}
}
function _fun125588(a0) { // fn#125588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:2751, offset: 0x025ddd05, size: 25 bytes, params: 2, frame: 11
a0.doEmitChanges(env0_0);
}
function _fun125590({recordType, metrics}) { // fn#125590, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:2985, offset: 0x025ddd4f, size: 110 bytes, params: 2, frame: 16
const Object = global.Object;
let value = Object.entries(metrics);
value = value.filter(function(a0) {
var r0;
var r1;
var r2;
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;
if (value2) {
r0 = item2;
r1 = value;
r2 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value;
r2 = value3;
} else {
r0 = item3;
r1 = item;
r2 = value3;
}
}
if (!r2) {
r0.return();
}
return r1 !== 0;
});
value = value.map(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 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) {
r0.return();
}
return ' - ' + r4 + ': ' + r3;
});
value = value.join('\n');
return ' * Record Type: ' + recordType + '\n' + value;
}
function _fun125593({recordType, statistics}) { // fn#125593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:3170, offset: 0x025dde5d, size: 95 bytes, params: 2, frame: 15
const Object = global.Object;
let value = Object.entries(statistics);
value = value.map(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 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) {
r0.return();
}
var JSON = global.JSON;
return ' - ' + r4 + ': ' + JSON.stringify(r3);
});
value = value.join('\n');
return ' * Record Type: ' + recordType + '\n' + value;
}
}
function _fun125599() { // fn#125599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:3918, offset: 0x025de004, size: 91 bytes, params: 1, frame: 12
var value;
if (env0_4.getState() !== 'active') {
var env0_0 = global.Date.now();
value = FLUX_API.flushReplicationStates();
if (value != null) {
value.then(_fun125600);
}
}
function _fun125600(a0) { // fn#125600, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:4016, offset: 0x025de05f, size: 83 bytes, params: 2, frame: 15
var value;
var binding;
var info;
if (a0) {
value = environment.__proto__.__proto__.__proto__;
binding = env3_8;
info = binding.info;
value = global.Date.now();
value -= env0_0;
Reflect.apply(info, binding, ['Successfully flushed replication states in ' + value + 'ms']);
}
}
}
}
function value_125601(a0, a1) { // fn#125601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:4285, offset: 0x025de0b2, size: 294 bytes, params: 3, frame: 22
var r4;
var value4;
var disableDualReadValidation;
var value5;
const Error = global.Error;
let error = new Error(a0);
const hasAnyAuthoritativeStore2 = this.hasAnyAuthoritativeStore();
env1_8.error('Fatal dispatch error for action', a1, 'hasAuthoritativeStore:', hasAnyAuthoritativeStore2, error);
(SentryUtilsNative).captureException(error,
{extra: {actionType: a1, hasAuthoritativeStore: hasAnyAuthoritativeStore2}, tags: {'source': 'libdiscore',
'errorKind': 'fatal_dispatch'}});
if (hasAnyAuthoritativeStore2) {
(require(1870) /* metro dependency 1870: libdiscoreExperiments */).clearLibdiscoreExperimentCache();
throw error;
}
env1_8.warn('Disabling DispatcherBridge until restart');
this.disabledFromFatalError = true;
const _createForOfIteratorHelperLoose_125575Binding = _createForOfIteratorHelperLoose_125575;
const tokenToStore = this.tokenToStore;
error = _createForOfIteratorHelperLoose_125575Binding(tokenToStore.values());
const value3 = error();
let done = value3.done;
if (!done) {
r4 = value3;
reducibleLoop2: while (true) {
value4 = r4.value;
disableDualReadValidation = value4.disableDualReadValidation;
Reflect.apply(disableDualReadValidation, value4, []);
value5 = error();
done = value5.done;
if (done) {
break reducibleLoop2;
}
r4 = value5;
continue reducibleLoop2;
}
}
}
function value_125602(a0, a1) { // fn#125602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:4868, offset: 0x025de1d8, size: 462 bytes, params: 3, frame: 28
var r0;
const value = this.tokenToStore.get(a0.storeToken);
const value2 = undefined;
let r8 = value == null ? value2 : value.getName();
r8 = r8 ?? 'unknown(token:' + a0.storeToken + ')';
const r7 = value == null ? value2 : value.getMode();
const Error = global.Error;
let error = a0.error;
error = new Error(error ?? 'unknown store error');
env1_8.error('Store', r8, 'failed to handle action', a1, 'mode:', r7, error);
(SentryUtilsNative).captureException(error,
{extra: {actionType: a1, storeName: r8, storeMode: r7}, tags: {'source': 'libdiscore',
'errorKind': 'store_dispatch'}});
if (r7 !== 'typescript-libdiscore-dual-read') {
if (r7 === 'libdiscore') {
(require(1870) /* metro dependency 1870: libdiscoreExperiments */).clearLibdiscoreExperimentCache();
r0 = error;
} else {
r0 = new global.Error("unexpected storeMode '" + r7 + "' for store " + r8);
}
throw r0;
}
env1_8.warn('Store: ' + r8 + ' had unexpected error in Rust implementation, disabling moving forward');
if (value != null) {
value.disableDualReadValidation();
}
return value2;
}
function value_125603(a0, a1, a2) { // fn#125603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:5619, offset: 0x025de3a6, size: 87 bytes, params: 4, frame: 19
let value = this.tokenToStore.get(a0);
if (value == null) {
value = environment.__proto__;
env1_8.warn('When dispatching action', a1, 'we got a store token', a0, 'that is unknown');
} else {
a2(value);
}
}
function value_125604() { // fn#125604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:5813, offset: 0x025de3fd, size: 94 bytes, params: 1, frame: 14
var value3;
var getMode;
var value4;
let value = environment.__proto__;
const _createForOfIteratorHelperLoose_125575Binding = _createForOfIteratorHelperLoose_125575;
value = this.tokenToStore.values();
value = _createForOfIteratorHelperLoose_125575Binding(value);
const value2 = value();
let done = value2.done;
if (done) {
return false;
}
let r1 = value2;
loopExit1: while (true) {
value3 = r1.value;
getMode = value3.getMode;
if (Reflect.apply(getMode, value3, []) === 'libdiscore') {
break loopExit1;
}
value4 = value();
done = value4.done;
if (done) {
return false;
}
r1 = value4;
continue;
}
return true;
}
}
function filterStores(a0) { // fn#125605, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:6070, offset: 0x025de45b, size: 24 bytes, params: 2, frame: 11
return a0.filter(_fun125606);
function _fun125606(a0) { // fn#125606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:6112, offset: 0x025de473, size: 32 bytes, params: 2, frame: 12
const binding = env1_10;
const has = binding.has;
const getMode = a0.getMode;
return Reflect.apply(has, binding, [Reflect.apply(getMode, a0, [])]);
}
}
}
function _fun125595(a0) { // fn#125595, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:3328, offset: 0x025ddf2e, size: 95 bytes, params: 2, frame: 10
var r1;
var r2;
var r4;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
const value = undefined;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value2 = item2 === value;
if (value2) {
}
if (value2) {
r1 = item2;
r2 = value2;
r4 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r1 = item3;
r2 = value3;
r4 = value;
} else {
r1 = item3;
r2 = value3;
r4 = item;
}
}
if (!r2) {
r1.return();
}
return r4.length > 0;
}
function _fun125596(a0) { // fn#125596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16459:3354, offset: 0x025ddf8d, size: 95 bytes, params: 2, frame: 17
var r0;
var r1;
var r3;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const 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) {
r0.return();
}
return '' + r4 + ':\n' + r3;
}
function _fun125598() { // fn#125598, offset: 0x00c37b63, size: 4 bytes, params: 1, frame: 1
}
global.__d(_fun125574, 16251, [6, 7, 4649, 6542, 6584, 10329, 1226, 1938, 1867, 661, 3, 1872, 1870, 683, 694, 7030,
1216,
2]) /* metro module 16251, dependencies: [6, 7, 4649, 6542, 6584, 10329, 1226, 1938, 1867, 661, 3, 1872, 1870, 683, 694, 7030, 1216, 2] */;