Files
discord-decomp/sources/stores/GuildReadStateStore.tsx
T
2026-07-27 16:20:00 +03:00

2022 lines
90 KiB
TypeScript

/* Metro module 5214; source: stores/GuildReadStateStore.tsx; dependencies: [6, 7, 15, 17, 18, 4623, 5215, 5071, 3786, 1383, 1226, 1379, 1867, 1228, 3784, 4605, 1934, 4864, 1878, 661, 1386, 4865, 5102, 21, 22, 3791, 2] */
function _fun45987(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#45987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:6, offset: 0x0119d445, size: 1018 bytes, params: 8, frame: 22
const env0_0 = require;
const _arrayLikeToArray_45993 = 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 sanitizeGuildId = function(a0) {
if (NULL_STRING_GUILD_ID === a0) {
return null;
}
if (a0 === null) {
return null;
}
if (a0 === undefined) {
return null;
}
return a0;
};
const updateGuildUnread = function(a0) {
var Object = global.Object;
a0.unread = Object.entries(a0.unreadByType).some(_fun46004);
return a0;
};
const handleOverlayInitialize_46014 = function({guilds}) {
var r3;
var property;
var value6;
env0_28 = {};
var value2 = 0;
env0_30 = value2;
var Set = global.Set;
var value4 = new Set();
recountGuild(null);
var length = guilds.length;
if (value2 < length) {
r3 = value2;
while (true) {
property = guilds[r3];
if (property != null) {
recountGuild(property.properties.id);
}
value6 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1;
if (value6 < length) {
r3 = value6;
continue;
}
break;
}
}
};
const recomputeAllGuilds = function() {
var r2;
var value7;
env0_28 = {};
var value3 = new global.Set();
recountGuild(null);
var value5 = global.Object.values(GuildStore.getGuildIds());
var value6 = 0;
if (value6 < value5.length) {
for (r2 = value6; true; r2 = value7) {
recountGuild(value5[r2]);
value7 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (!(value7 < value5.length)) {
break;
}
}
}
};
const handleGuildCreate_46018 = function({guild}) {
return recountGuild(guild.id);
};
const handleChannelDelete_46020 = function({channel}) {
var id = channel.id;
channel = channel.guild_id;
return recountChannels(channel, [id]);
};
const handleGuildEventUpdate = function({guildScheduledEvent}) {
var updateNonChannelBinding = updateNonChannel;
guildScheduledEvent = guildScheduledEvent.guild_id;
return updateNonChannelBinding(guildScheduledEvent, ReadStateTypes.GUILD_EVENT);
};
const handleGuildEventDelete = function({guildScheduledEvent}) {
var updateNonChannelBinding = updateNonChannel;
guildScheduledEvent = guildScheduledEvent.guild_id;
return updateNonChannelBinding(guildScheduledEvent, ReadStateTypes.GUILD_EVENT);
};
const handleGuildFeatureAck = function({id, ackType}) {
return updateNonChannel(id, ackType);
};
const handleThreadMemberUpdate = function({id, guildId}) {
return recountChannels(guildId, [id]);
};
const handleMarkGuildAsRead = function({guildId}) {
return recountGuild(guildId);
};
const handleGuildUpdate = function({guildId}) {
return recountGuild(guildId);
};
const handleUserGuildSettingsUpdate = function({guildId}) {
return recountGuild(guildId);
};
const handleRecentMentionsSuccess = function({messages}) {
var Set = global.Set;
var value = messages.map(_fun46055);
value = new Set(value);
value.forEach(_fun46056);
};
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(7) /* metro dependency 7 */;
const env0_5 = importDefault(15) /* metro dependency 15 */;
const env0_6 = importDefault(17) /* metro dependency 17 */;
const env0_7 = importDefault(18) /* metro dependency 18 */;
const notificationCenterItemsStore = importDefault(4623) /* metro dependency 4623: NotificationCenterItemsStore */;
const recentMentionsStore = importDefault(5215) /* metro dependency 5215: RecentMentionsStore */;
const activeJoinedThreadsStore = importDefault(5071) /* metro dependency 5071: ActiveJoinedThreadsStore */;
const joinedThreadsStore = importDefault(3786) /* metro dependency 3786: JoinedThreadsStore */;
let value = require(1383) /* metro dependency 1383: ChannelRecord */;
const env0_12 = value.getBasicAccessPermissions;
const env0_13 = value.isGuildVocalChannelType;
const env0_14 = value.isThread;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
value = importDefault(1228) /* metro dependency 1228: MobileCacheSnapshotStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const readStateStore = importDefault(4605) /* metro dependency 4605: ReadStateStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
const userGuildSettingsStore = importDefault(4864) /* metro dependency 4864: UserGuildSettingsStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_23 = constantsModule.FAVORITES;
const NULL_STRING_GUILD_ID = constantsModule.NULL_STRING_GUILD_ID;
const env0_24 = (require(1386) /* metro dependency 1386: ChannelConstants */).ChannelFlags;
const readStateConstantsModule = require(4865) /* metro dependency 4865: ReadStateConstants */;
const env0_25 = readStateConstantsModule.ReadStateTypes;
const env0_26 = readStateConstantsModule.UnreadSetting;
let env0_28 = {};
let Set = global.Set;
const set = new Set();
value = _fun46057(value);
value.displayName = 'GuildReadStateStore';
value.LATEST_SNAPSHOT_VERSION = 1;
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/GuildReadStateStore.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_45988() { // fn#45988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:534, offset: 0x0119d83f, 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_45988_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_45991(a0, a1) { // fn#45991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:727, offset: 0x0119d89d, size: 370 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun45992;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_45993(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_45993(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_45993(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun45992;
}
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 createGuildState(a0) { // fn#45994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:1664, offset: 0x0119da0f, size: 88 bytes, params: 2, frame: 6
return {'unread': false, 'unreadByType': null, 'unreadChannelId': null, 'lowImportanceMentionCount': 0,
'highImportanceMentionCount': 0, 'mentionCounts': null, 'ncMentionCount': 0, unreadByType: {},
mentionCounts: {}, sentinel: env0_28[a0 ?? NULL_STRING_GUILD_ID]?.sentinel ?? 0};
}
function getOrCreateGuildState(a0) { // fn#45995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:1911, offset: 0x0119da67, size: 63 bytes, params: 2, frame: 16
let value = a0;
const binding = env0_28;
const r1 = value ?? NULL_STRING_GUILD_ID;
const binding2 = env0_28;
let r0 = value ?? NULL_STRING_GUILD_ID;
const property = binding2[r0];
if (property != null) {
r0 = property;
} else {
value = createGuildState(value);
r0 = value;
}
binding[r1] = r0;
return r0;
}
function updateGuildUnreadSentinel(a0) { // fn#45996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:2020, offset: 0x0119daa6, size: 45 bytes, params: 2, frame: 12
const orCreateGuildState = getOrCreateGuildState(a0);
const sentinel = orCreateGuildState.sentinel;
orCreateGuildState.sentinel = typeof sentinel === 'bigint' ? sentinel + 1n : +sentinel + 1;
const binding = env0_30;
env0_30 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
}
function disableUnreadForOptInChannel(a0, a1, a2) { // fn#45997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:2098, offset: 0x0119dad3, size: 80 bytes, params: 4, frame: 15
var r1;
var r0;
const value = a2;
const value2 = a0.guild_id != null;
if (value2) {
r1 = value && !(isThread(a0.type) || UserGuildSettingsStore.isChannelRecordOrParentOptedIn(a0));
r1 = r1 && a1 === 0;
r0 = r1;
} else {
r0 = value2;
}
return r0;
}
function isCountableChannel(a0) { // fn#45998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:2230, offset: 0x0119db23, size: 343 bytes, params: 2, frame: 21
var disableUnreadForOptInChannelBinding;
var moduleValue;
const value = a1;
const value2 = a2;
const r2 = value !== undefined ? value : 0;
const r3 = value2 !== undefined ? value2 : false;
if (a0 != null) {
if (a0.isGuildVocal()) {
if (r2 === 0) {
return false;
}
if (a0.hasFlag(ChannelFlags.IS_GUILD_RESOURCE_CHANNEL)) {
return false;
}
if (r2 === 0) {
if (a0.isThread() ? JoinedThreadsStore.isMuted(a0.id) || UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(a0.guild_id,
a0.parent_id) : UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(a0.guild_id, a0.id)) {
return false;
}
if (a0.isPrivate()) {
return r2 > 0 || UserGuildSettingsStore.resolveUnreadSetting(a0) === UnreadSetting.ALL_MESSAGES;
}
disableUnreadForOptInChannelBinding = disableUnreadForOptInChannel;
moduleValue = require(5102) /* metro dependency 5102: isOptInEnabled */;
if (disableUnreadForOptInChannelBinding(a0, r2, moduleValue.isOptInEnabledForGuild(a0.guild_id))) {
return false;
}
if (PermissionStore.can(a0.accessPermissions, a0)) {
return r2 > 0 || UserGuildSettingsStore.resolveUnreadSetting(a0) === UnreadSetting.ALL_MESSAGES;
}
return false;
}
if (r3) {
if (a0.isThread() ? JoinedThreadsStore.isMuted(a0.id) || UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(a0.guild_id,
a0.parent_id) : UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(a0.guild_id, a0.id)) {
return false;
}
if (a0.isPrivate()) {
return r2 > 0 || UserGuildSettingsStore.resolveUnreadSetting(a0) === UnreadSetting.ALL_MESSAGES;
}
disableUnreadForOptInChannelBinding = disableUnreadForOptInChannel;
moduleValue = require(5102) /* metro dependency 5102: isOptInEnabled */;
if (disableUnreadForOptInChannelBinding(a0, r2, moduleValue.isOptInEnabledForGuild(a0.guild_id))) {
return false;
}
if (PermissionStore.can(a0.accessPermissions, a0)) {
return r2 > 0 || UserGuildSettingsStore.resolveUnreadSetting(a0) === UnreadSetting.ALL_MESSAGES;
}
return false;
}
if (a0.isPrivate()) {
return r2 > 0 || UserGuildSettingsStore.resolveUnreadSetting(a0) === UnreadSetting.ALL_MESSAGES;
}
disableUnreadForOptInChannelBinding = disableUnreadForOptInChannel;
moduleValue = require(5102) /* metro dependency 5102: isOptInEnabled */;
if (disableUnreadForOptInChannelBinding(a0, r2, moduleValue.isOptInEnabledForGuild(a0.guild_id))) {
return false;
}
if (PermissionStore.can(a0.accessPermissions, a0)) {
return r2 > 0 || UserGuildSettingsStore.resolveUnreadSetting(a0) === UnreadSetting.ALL_MESSAGES;
}
return false;
}
if (a0.hasFlag(ChannelFlags.IS_GUILD_RESOURCE_CHANNEL)) {
return false;
}
if (r2 === 0) {
if (a0.isThread() ? JoinedThreadsStore.isMuted(a0.id) || UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(a0.guild_id,
a0.parent_id) : UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(a0.guild_id, a0.id)) {
return false;
}
if (a0.isPrivate()) {
return r2 > 0 || UserGuildSettingsStore.resolveUnreadSetting(a0) === UnreadSetting.ALL_MESSAGES;
}
disableUnreadForOptInChannelBinding = disableUnreadForOptInChannel;
moduleValue = require(5102) /* metro dependency 5102: isOptInEnabled */;
if (disableUnreadForOptInChannelBinding(a0, r2, moduleValue.isOptInEnabledForGuild(a0.guild_id))) {
return false;
}
if (PermissionStore.can(a0.accessPermissions, a0)) {
return r2 > 0 || UserGuildSettingsStore.resolveUnreadSetting(a0) === UnreadSetting.ALL_MESSAGES;
}
return false;
}
if (r3) {
if (a0.isThread() ? JoinedThreadsStore.isMuted(a0.id) || UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(a0.guild_id,
a0.parent_id) : UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(a0.guild_id, a0.id)) {
return false;
}
if (a0.isPrivate()) {
return r2 > 0 || UserGuildSettingsStore.resolveUnreadSetting(a0) === UnreadSetting.ALL_MESSAGES;
}
disableUnreadForOptInChannelBinding = disableUnreadForOptInChannel;
moduleValue = require(5102) /* metro dependency 5102: isOptInEnabled */;
if (disableUnreadForOptInChannelBinding(a0, r2, moduleValue.isOptInEnabledForGuild(a0.guild_id))) {
return false;
}
if (PermissionStore.can(a0.accessPermissions, a0)) {
return r2 > 0 || UserGuildSettingsStore.resolveUnreadSetting(a0) === UnreadSetting.ALL_MESSAGES;
}
return false;
}
if (a0.isPrivate()) {
return r2 > 0 || UserGuildSettingsStore.resolveUnreadSetting(a0) === UnreadSetting.ALL_MESSAGES;
}
disableUnreadForOptInChannelBinding = disableUnreadForOptInChannel;
moduleValue = require(5102) /* metro dependency 5102: isOptInEnabled */;
if (disableUnreadForOptInChannelBinding(a0, r2, moduleValue.isOptInEnabledForGuild(a0.guild_id))) {
return false;
}
if (PermissionStore.can(a0.accessPermissions, a0)) {
return r2 > 0 || UserGuildSettingsStore.resolveUnreadSetting(a0) === UnreadSetting.ALL_MESSAGES;
}
}
return false;
}
function computeIsCountableGuildChannel(a0, a1, a2) { // fn#45999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:2749, offset: 0x0119dc7a, size: 195 bytes, params: 4, frame: 19
var r3;
var r2;
var r1;
var canBasicChannel2;
var value5;
var value7;
const isGuildVocalChannelType2 = isGuildVocalChannelType(a0.type);
let r0 = isGuildVocalChannelType2 ? a1 !== 0 : !isGuildVocalChannelType2;
if (r0) {
canBasicChannel2 = PermissionStore.canBasicChannel(getBasicAccessPermissions(a0.type), a0);
if (canBasicChannel2) {
value5 = disableUnreadForOptInChannel(a0, a1, a2);
if (value5) {
r2 = !value5;
} else {
value7 = 'flags' in a0;
r3 = value7 ? !a0.hasFlag(ChannelFlags.IS_GUILD_RESOURCE_CHANNEL) : !value7;
r3 = r3 && (a1 > 0 || UserGuildSettingsStore.resolveUnreadSetting(a0) === UnreadSetting.ALL_MESSAGES);
r2 = r3;
}
r1 = r2;
} else {
r1 = !!canBasicChannel2;
}
r0 = r1;
}
return r0;
}
function isNonChannelUnread(a0, a1) { // fn#46001, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:3143, offset: 0x0119dd5d, size: 95 bytes, params: 3, frame: 15
const hasUnread2 = ReadStateStore.hasUnread(a0, a1);
const GUILD_EVENT = ReadStateTypes.GUILD_EVENT;
return a1 !== GUILD_EVENT ? hasUnread2 : !UserGuildSettingsStore.isMuted(a0) && (!UserGuildSettingsStore.isMuteScheduledEventsEnabled(a0) && hasUnread2);
}
function createNewStateFrom(a0, {mentionCounts, unreadByType}) { // fn#46002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:3281, offset: 0x0119ddbc, size: 64 bytes, params: 3, frame: 13
const createGuildStateBinding = createGuildState;
const guildStateBinding = createGuildStateBinding(a0);
let object2 = {};
const value2 = copyDataProperties(object2, mentionCounts, createGuildStateBinding);
guildStateBinding.mentionCounts = object2;
object2 = {};
copyDataProperties(object2, unreadByType, value2);
guildStateBinding.unreadByType = object2;
return guildStateBinding;
}
function updateGuildUnread(a0) { // fn#46003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:3421, offset: 0x0119ddfc, size: 54 bytes, params: 2, frame: 12
const Object = global.Object;
let value = Object.entries(a0.unreadByType);
a0.unread = value.some(function(a0) {
var r0;
var r1;
var r4;
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;
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();
}
value = (0, global.Number)(r2);
value = value !== ReadStateTypes.GUILD_EVENT;
return value && r1;
});
return a0;
}
function updateNotificationCenterMentions(a0, a1) { // fn#46005, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:3546, offset: 0x0119de97, size: 104 bytes, params: 3, frame: 18
var ncMentionCount;
var getGuildNotifCenterMentionCountBinding;
var guildNotifCenterMentionCountBinding;
var guildNotifCenterMentionCountBinding2;
var Math;
var max;
var value;
if (!NotificationCenterItemsStore.tabFocused) {
getGuildNotifCenterMentionCountBinding = getGuildNotifCenterMentionCount;
value = undefined;
guildNotifCenterMentionCountBinding = getGuildNotifCenterMentionCountBinding(a0);
guildNotifCenterMentionCountBinding2 = getGuildNotifCenterMentionCountBinding(a1);
Math = global.Math;
max = Math.max;
ncMentionCount = a1 == null ? value : a1.ncMentionCount;
value = 0;
a0.ncMentionCount = Reflect.apply(max, Math,
[(ncMentionCount ?? value) + (guildNotifCenterMentionCountBinding - guildNotifCenterMentionCountBinding2),
value]);
}
}
function getGuildNotifCenterMentionCount(a0) { // fn#46006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:3779, offset: 0x0119deff, size: 141 bytes, params: 2, frame: 17
const env0_0 = a0;
const env0_1 = 0;
var value;
const currentUser = UserStore.getCurrentUser();
if (!(a0 == null || (currentUser == null ? undefined : ReadStateStore.getNotifCenterReadState(currentUser.id)) == null)) {
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.keys(a0.mentionCounts);
value.forEach(_fun46007);
}
return env0_1;
}
function aggregateGuildState(a0, a1, a2) { // fn#46008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:4129, offset: 0x0119dff7, size: 244 bytes, params: 4, frame: 19
var binding;
let value = a0;
const env0_0 = a1;
updateGuildUnread(a1);
a1.lowImportanceMentionCount = 0;
a1.highImportanceMentionCount = 0;
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
defaultImport.forEach(a1.mentionCounts, function({count, isMentionLowImportance}) {
if (isMentionLowImportance) {
require.lowImportanceMentionCount += count;
} else {
require.highImportanceMentionCount += count;
}
});
let unread = a1.unread;
let r0 = unread !== a2.unread || a1.lowImportanceMentionCount !== a2.lowImportanceMentionCount;
r0 = !r0 ? a1.highImportanceMentionCount !== a2.highImportanceMentionCount : r0;
if (r0) {
binding = env0_28;
binding[value ?? NULL_STRING_GUILD_ID] = a1;
if (value != null) {
unread = a1.unread;
binding = env0_29;
if (unread) {
binding.add(value);
} else {
binding.delete(value);
}
}
binding = env0_30;
env0_30 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
updateGuildUnreadSentinel(value ?? NULL_STRING_GUILD_ID);
updateNotificationCenterMentions(a1, a2);
value = true;
r0 = value;
}
return r0;
}
function recountChannels(a0, a1) { // fn#46010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:4684, offset: 0x0119e129, size: 312 bytes, params: 3, frame: 20
const value2 = sanitizeGuildId(a0);
const orCreateGuildState = getOrCreateGuildState(value2);
const newStateFrom = createNewStateFrom(value2, orCreateGuildState);
const env0_2 = false;
a1.forEach(_fun46011);
let unreadByType = newStateFrom.unreadByType;
let CHANNEL = ReadStateTypes.CHANNEL;
unreadByType[CHANNEL] = env0_2;
unreadByType = newStateFrom.unreadByType;
CHANNEL = ReadStateTypes.CHANNEL;
const property = unreadByType[CHANNEL];
unreadByType = orCreateGuildState.unreadByType;
CHANNEL = ReadStateTypes.CHANNEL;
if (property === unreadByType[CHANNEL]) {
return aggregateGuildState(value2, newStateFrom, orCreateGuildState);
}
unreadByType = newStateFrom.unreadByType;
CHANNEL = ReadStateTypes.CHANNEL;
if (unreadByType[CHANNEL]) {
return aggregateGuildState(value2, newStateFrom, orCreateGuildState);
}
const channel = ChannelStore.getChannel(orCreateGuildState.unreadChannelId);
if (channel != null) {
if (a1.includes(channel.id)) {
return recountGuild(value2);
}
if (ReadStateStore.hasUnread(channel.id)) {
if (isCountableChannel(channel)) {
if (value2 != null) {
env0_29.add(value2);
}
newStateFrom.unreadByType[ReadStateTypes.CHANNEL] = true;
return aggregateGuildState(value2, newStateFrom, orCreateGuildState);
}
return recountGuild(value2);
}
}
return recountGuild(value2);
}
function updateNonChannel(a0, a1) { // fn#46012, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:5495, offset: 0x0119e366, size: 83 bytes, params: 3, frame: 19
var orCreateGuildState;
var newStateFrom;
if (a0 != null) {
orCreateGuildState = getOrCreateGuildState(a0);
newStateFrom = createNewStateFrom(a0, orCreateGuildState);
newStateFrom.unreadByType[ReadStateTypes.GUILD_EVENT] = isNonChannelUnread(a0, a1);
return aggregateGuildState(a0, newStateFrom, orCreateGuildState);
}
}
function recountGuild(a0, a1) { // fn#46013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:5684, offset: 0x0119e3b9, size: 1179 bytes, params: 3, frame: 41
var r10;
var r26;
var r17;
var r12;
var r23;
var r2;
var r9;
var r14;
var r0;
var r6;
var r5;
var isMuted;
var isMuted2;
var getMutedChannels;
var value3;
var getChannelOverrides;
var value4;
var moduleValue;
var isOptInEnabledForGuild;
var isOptInEnabledForGuild2;
var getMutableBasicGuildChannelsForGuild;
var value5;
var properties;
var properties2;
var properties3;
var propertyName;
var propertyName2;
var property;
var has;
var value6;
var parent_id;
var value7;
var value8;
var unreadByType;
var CHANNEL;
var property2;
var getGuildChannelUnreadState;
var value9;
var mentionCount;
var unread;
var isMentionLowImportance;
var value10;
var value11;
var value12;
var highImportanceMentionCount;
var lowImportanceMentionCount;
var mentionCounts;
var id;
var getActiveJoinedThreadsForGuild;
var value13;
var properties4;
var properties5;
var propertyName3;
var properties6;
var properties7;
var properties8;
var propertyName4;
var property3;
var hasUnread;
var value14;
var isMuted3;
var getMentionCount;
var value15;
var getIsMentionLowImportance;
var value16;
var GUILD_EVENT;
var value17;
var isNonChannelUnreadBinding;
var isNonChannelUnread2;
var mutablePrivateChannels;
var properties9;
var properties10;
var propertyName5;
var value19;
var value20;
var isCountableChannel2;
var highImportanceMentionCount2;
var value23;
var lowImportanceMentionCount2;
var value24;
var binding;
var add;
var updateGuildUnreadSentinelBinding;
let value = environment;
const value2 = sanitizeGuildId(a0);
const guildState = createGuildState(value2);
if (value2 == null) {
mutablePrivateChannels = ChannelStore.getMutablePrivateChannels();
properties = Object.keys(mutablePrivateChannels);
properties9 = 0;
properties10 = properties.length;
if (properties !== undefined) {
r9 = properties9;
reducibleLoop49: while (true) {
propertyName = properties[r9];
propertyName5 = r9 + 1;
if (propertyName === undefined) {
break reducibleLoop49;
}
property = mutablePrivateChannels[propertyName];
getMentionCount = ReadStateStore.getMentionCount;
value19 = Reflect.apply(getMentionCount, ReadStateStore, [propertyName]);
value20 = value19 > 0;
reducibleJoin52: while (true) {
if (value20) {
isCountableChannel2 = isCountableChannel(property, value19);
r14 = isCountableChannel2;
break reducibleJoin52;
}
r14 = value20;
break reducibleJoin52;
}
if (r14) {
highImportanceMentionCount = guildState.highImportanceMentionCount;
guildState.highImportanceMentionCount = highImportanceMentionCount + value19;
mentionCounts = guildState.mentionCounts;
id = property.id;
mentionCounts[id] = {count: value19, isMentionLowImportance: false};
r9 = propertyName5;
continue reducibleLoop49;
}
r9 = propertyName5;
continue reducibleLoop49;
}
}
} else {
isMuted2 = UserGuildSettingsStore.isMuted(value2);
reducibleJoin54: while (true) {
reducibleJoin45: while (true) {
if (isMuted2) {
if (a1 === false) {
return false;
}
value3 = UserGuildSettingsStore.getMutedChannels(value2);
value4 = UserGuildSettingsStore.getChannelOverrides(value2);
moduleValue = require(5102) /* metro dependency 5102: isOptInEnabled */;
isOptInEnabledForGuild2 = moduleValue.isOptInEnabledForGuild(value2);
value5 = ChannelStore.getMutableBasicGuildChannelsForGuild(value2);
properties = Object.keys(value5);
properties2 = 0;
properties3 = properties.length;
if (properties !== undefined) {
r10 = properties2;
reducibleLoop4: while (true) {
propertyName = properties[r10];
propertyName2 = r10 + 1;
if (propertyName === undefined) {
break reducibleLoop4;
}
property = value5[propertyName];
reducibleJoin7: while (true) {
if (isMuted2) {
r26 = isMuted2;
break reducibleJoin7;
}
has = value3.has;
value6 = Reflect.apply(has, value3, [propertyName]);
r26 = value6;
break reducibleJoin7;
}
reducibleJoin11: while (true) {
if (r26) {
break reducibleJoin11;
}
parent_id = property.parent_id;
value7 = parent_id != null;
reducibleJoin10: while (true) {
if (value7) {
has = value3.has;
parent_id = property.parent_id;
value8 = Reflect.apply(has, value3, [parent_id]);
r17 = value8;
break reducibleJoin10;
}
r17 = value7;
break reducibleJoin10;
}
r26 = r17;
break reducibleJoin11;
}
unreadByType = guildState.unreadByType;
CHANNEL = ReadStateTypes.CHANNEL;
property2 = unreadByType[CHANNEL];
getGuildChannelUnreadState = ReadStateStore.getGuildChannelUnreadState;
value9 = Reflect.apply(getGuildChannelUnreadState, ReadStateStore, [property,
isOptInEnabledForGuild2,
value4,
r26,
property2]);
mentionCount = value9.mentionCount;
unread = value9.unread;
isMentionLowImportance = value9.isMentionLowImportance;
value10 = mentionCount > 0;
if (!value10) {
reducibleJoin13: while (true) {
if (r26) {
r10 = propertyName2;
continue reducibleLoop4;
}
break reducibleJoin13;
}
}
value11 = !property2;
reducibleJoin16: while (true) {
if (property2) {
r17 = value11;
break reducibleJoin16;
}
value12 = !r26;
r26 = r26 ? value10 : value12;
r17 = r26;
break reducibleJoin16;
}
if (r17) {
r17 = unread;
}
if (!r17) {
reducibleJoin19: while (true) {
if (value10) {
break reducibleJoin19;
}
r10 = propertyName2;
continue reducibleLoop4;
}
}
if (computeIsCountableGuildChannel(property, mentionCount, isOptInEnabledForGuild2)) {
reducibleJoin22: while (true) {
if (r17) {
unreadByType = guildState.unreadByType;
CHANNEL = ReadStateTypes.CHANNEL;
unreadByType[CHANNEL] = true;
guildState.unreadChannelId = propertyName;
break reducibleJoin22;
}
break reducibleJoin22;
}
if (value10) {
if (isMentionLowImportance) {
lowImportanceMentionCount = guildState.lowImportanceMentionCount;
guildState.lowImportanceMentionCount = lowImportanceMentionCount + mentionCount;
} else {
highImportanceMentionCount = guildState.highImportanceMentionCount;
guildState.highImportanceMentionCount = highImportanceMentionCount + mentionCount;
}
mentionCounts = guildState.mentionCounts;
id = property.id;
mentionCounts[id] = {count: mentionCount,
isMentionLowImportance: isMentionLowImportance};
r10 = propertyName2;
continue reducibleLoop4;
}
r10 = propertyName2;
continue reducibleLoop4;
}
r10 = propertyName2;
continue reducibleLoop4;
}
}
value13 = ActiveJoinedThreadsStore.getActiveJoinedThreadsForGuild(value2);
properties = Object.keys(value13);
properties4 = 0;
properties5 = properties.length;
if (properties !== undefined) {
r17 = properties4;
reducibleLoop28: while (true) {
propertyName = properties[r17];
propertyName3 = r17 + 1;
if (propertyName === undefined) {
break reducibleLoop28;
}
property = value13[propertyName];
properties6 = Object.keys(property);
properties7 = 0;
properties8 = properties6.length;
if (properties6 === undefined) {
r17 = propertyName3;
continue reducibleLoop28;
}
r12 = properties7;
reducibleLoop30: while (true) {
propertyName = properties6[r12];
propertyName4 = r12 + 1;
if (propertyName === undefined) {
r17 = propertyName3;
continue reducibleLoop28;
}
unreadByType = guildState.unreadByType;
CHANNEL = ReadStateTypes.CHANNEL;
property3 = unreadByType[CHANNEL];
reducibleJoin33: while (true) {
if (property3) {
r23 = property3;
break reducibleJoin33;
}
hasUnread = ReadStateStore.hasUnread;
value14 = !Reflect.apply(hasUnread, ReadStateStore, [propertyName]);
r23 = value14;
break reducibleJoin33;
}
reducibleJoin35: while (true) {
if (r23) {
break reducibleJoin35;
}
isMuted = JoinedThreadsStore.isMuted;
isMuted3 = Reflect.apply(isMuted, JoinedThreadsStore, [propertyName]);
r23 = isMuted3;
break reducibleJoin35;
}
if (!r23) {
r23 = isMuted2;
}
reducibleJoin38: while (true) {
if (r23) {
break reducibleJoin38;
}
unreadByType = guildState.unreadByType;
CHANNEL = ReadStateTypes.CHANNEL;
unreadByType[CHANNEL] = true;
guildState.unreadChannelId = propertyName;
break reducibleJoin38;
}
getMentionCount = ReadStateStore.getMentionCount;
value15 = Reflect.apply(getMentionCount, ReadStateStore, [propertyName]);
getIsMentionLowImportance = ReadStateStore.getIsMentionLowImportance;
value16 = Reflect.apply(getIsMentionLowImportance, ReadStateStore, [propertyName]);
if (value15 > 0) {
if (value16) {
lowImportanceMentionCount = guildState.lowImportanceMentionCount;
guildState.lowImportanceMentionCount = lowImportanceMentionCount + value15;
} else {
highImportanceMentionCount = guildState.highImportanceMentionCount;
guildState.highImportanceMentionCount = highImportanceMentionCount + value15;
}
mentionCounts = guildState.mentionCounts;
mentionCounts[propertyName] = {count: value15, isMentionLowImportance: value16};
r12 = propertyName4;
continue reducibleLoop30;
}
r12 = propertyName4;
continue reducibleLoop30;
}
continue reducibleLoop28;
}
}
unreadByType = guildState.unreadByType;
GUILD_EVENT = ReadStateTypes.GUILD_EVENT;
property = unreadByType[GUILD_EVENT];
if (property) {
r2 = !property;
break reducibleJoin45;
}
isNonChannelUnreadBinding = isNonChannelUnread;
GUILD_EVENT = ReadStateTypes.GUILD_EVENT;
r2 = isNonChannelUnreadBinding(value2, GUILD_EVENT);
break reducibleJoin45;
}
getMutedChannels = UserGuildSettingsStore.getMutedChannels;
value3 = Reflect.apply(getMutedChannels, UserGuildSettingsStore, [value2]);
getChannelOverrides = UserGuildSettingsStore.getChannelOverrides;
value4 = Reflect.apply(getChannelOverrides, UserGuildSettingsStore, [value2]);
moduleValue = require(5102) /* metro dependency 5102: isOptInEnabled */;
isOptInEnabledForGuild = moduleValue.isOptInEnabledForGuild;
isOptInEnabledForGuild2 = Reflect.apply(isOptInEnabledForGuild, moduleValue, [value2]);
getMutableBasicGuildChannelsForGuild = ChannelStore.getMutableBasicGuildChannelsForGuild;
value5 = Reflect.apply(getMutableBasicGuildChannelsForGuild, ChannelStore, [value2]);
properties = Object.keys(value5);
properties2 = 0;
properties3 = properties.length;
if (properties !== undefined) {
r10 = properties2;
reducibleLoop4: while (true) {
propertyName = properties[r10];
propertyName2 = r10 + 1;
if (propertyName === undefined) {
break reducibleLoop4;
}
property = value5[propertyName];
reducibleJoin7: while (true) {
if (isMuted2) {
r26 = isMuted2;
break reducibleJoin7;
}
has = value3.has;
value6 = Reflect.apply(has, value3, [propertyName]);
r26 = value6;
break reducibleJoin7;
}
reducibleJoin11: while (true) {
if (r26) {
break reducibleJoin11;
}
parent_id = property.parent_id;
value7 = parent_id != null;
reducibleJoin10: while (true) {
if (value7) {
has = value3.has;
parent_id = property.parent_id;
value8 = Reflect.apply(has, value3, [parent_id]);
r17 = value8;
break reducibleJoin10;
}
r17 = value7;
break reducibleJoin10;
}
r26 = r17;
break reducibleJoin11;
}
unreadByType = guildState.unreadByType;
CHANNEL = ReadStateTypes.CHANNEL;
property2 = unreadByType[CHANNEL];
getGuildChannelUnreadState = ReadStateStore.getGuildChannelUnreadState;
value9 = Reflect.apply(getGuildChannelUnreadState, ReadStateStore, [property,
isOptInEnabledForGuild2,
value4,
r26,
property2]);
mentionCount = value9.mentionCount;
unread = value9.unread;
isMentionLowImportance = value9.isMentionLowImportance;
value10 = mentionCount > 0;
if (!value10) {
reducibleJoin13: while (true) {
if (r26) {
r10 = propertyName2;
continue reducibleLoop4;
}
break reducibleJoin13;
}
}
value11 = !property2;
reducibleJoin16: while (true) {
if (property2) {
r17 = value11;
break reducibleJoin16;
}
value12 = !r26;
r26 = r26 ? value10 : value12;
r17 = r26;
break reducibleJoin16;
}
if (r17) {
r17 = unread;
}
if (!r17) {
reducibleJoin19: while (true) {
if (value10) {
break reducibleJoin19;
}
r10 = propertyName2;
continue reducibleLoop4;
}
}
if (computeIsCountableGuildChannel(property, mentionCount, isOptInEnabledForGuild2)) {
reducibleJoin22: while (true) {
if (r17) {
unreadByType = guildState.unreadByType;
CHANNEL = ReadStateTypes.CHANNEL;
unreadByType[CHANNEL] = true;
guildState.unreadChannelId = propertyName;
break reducibleJoin22;
}
break reducibleJoin22;
}
if (value10) {
if (isMentionLowImportance) {
lowImportanceMentionCount = guildState.lowImportanceMentionCount;
guildState.lowImportanceMentionCount = lowImportanceMentionCount + mentionCount;
} else {
highImportanceMentionCount = guildState.highImportanceMentionCount;
guildState.highImportanceMentionCount = highImportanceMentionCount + mentionCount;
}
mentionCounts = guildState.mentionCounts;
id = property.id;
mentionCounts[id] = {count: mentionCount,
isMentionLowImportance: isMentionLowImportance};
r10 = propertyName2;
continue reducibleLoop4;
}
r10 = propertyName2;
continue reducibleLoop4;
}
r10 = propertyName2;
continue reducibleLoop4;
}
}
getActiveJoinedThreadsForGuild = ActiveJoinedThreadsStore.getActiveJoinedThreadsForGuild;
value13 = Reflect.apply(getActiveJoinedThreadsForGuild, ActiveJoinedThreadsStore, [value2]);
properties = Object.keys(value13);
properties4 = 0;
properties5 = properties.length;
if (properties !== undefined) {
r17 = properties4;
reducibleLoop28: while (true) {
propertyName = properties[r17];
propertyName3 = r17 + 1;
if (propertyName === undefined) {
break reducibleLoop28;
}
property = value13[propertyName];
properties6 = Object.keys(property);
properties7 = 0;
properties8 = properties6.length;
if (properties6 === undefined) {
r17 = propertyName3;
continue reducibleLoop28;
}
r12 = properties7;
reducibleLoop30: while (true) {
propertyName = properties6[r12];
propertyName4 = r12 + 1;
if (propertyName === undefined) {
r17 = propertyName3;
continue reducibleLoop28;
}
unreadByType = guildState.unreadByType;
CHANNEL = ReadStateTypes.CHANNEL;
property3 = unreadByType[CHANNEL];
reducibleJoin33: while (true) {
if (property3) {
r23 = property3;
break reducibleJoin33;
}
hasUnread = ReadStateStore.hasUnread;
value14 = !Reflect.apply(hasUnread, ReadStateStore, [propertyName]);
r23 = value14;
break reducibleJoin33;
}
reducibleJoin35: while (true) {
if (r23) {
break reducibleJoin35;
}
isMuted = JoinedThreadsStore.isMuted;
isMuted3 = Reflect.apply(isMuted, JoinedThreadsStore, [propertyName]);
r23 = isMuted3;
break reducibleJoin35;
}
if (!r23) {
r23 = isMuted2;
}
reducibleJoin38: while (true) {
if (r23) {
break reducibleJoin38;
}
unreadByType = guildState.unreadByType;
CHANNEL = ReadStateTypes.CHANNEL;
unreadByType[CHANNEL] = true;
guildState.unreadChannelId = propertyName;
break reducibleJoin38;
}
getMentionCount = ReadStateStore.getMentionCount;
value15 = Reflect.apply(getMentionCount, ReadStateStore, [propertyName]);
getIsMentionLowImportance = ReadStateStore.getIsMentionLowImportance;
value16 = Reflect.apply(getIsMentionLowImportance, ReadStateStore, [propertyName]);
if (value15 > 0) {
if (value16) {
lowImportanceMentionCount = guildState.lowImportanceMentionCount;
guildState.lowImportanceMentionCount = lowImportanceMentionCount + value15;
} else {
highImportanceMentionCount = guildState.highImportanceMentionCount;
guildState.highImportanceMentionCount = highImportanceMentionCount + value15;
}
mentionCounts = guildState.mentionCounts;
mentionCounts[propertyName] = {count: value15, isMentionLowImportance: value16};
r12 = propertyName4;
continue reducibleLoop30;
}
r12 = propertyName4;
continue reducibleLoop30;
}
continue reducibleLoop28;
}
}
unreadByType = guildState.unreadByType;
GUILD_EVENT = ReadStateTypes.GUILD_EVENT;
property = unreadByType[GUILD_EVENT];
value17 = !property;
if (property) {
r2 = value17;
break reducibleJoin45;
}
isNonChannelUnreadBinding = isNonChannelUnread;
GUILD_EVENT = ReadStateTypes.GUILD_EVENT;
isNonChannelUnread2 = isNonChannelUnreadBinding(value2, GUILD_EVENT);
r2 = isNonChannelUnread2;
break reducibleJoin45;
}
if (r2) {
unreadByType = guildState.unreadByType;
GUILD_EVENT = ReadStateTypes.GUILD_EVENT;
unreadByType[GUILD_EVENT] = true;
break reducibleJoin54;
}
break reducibleJoin54;
}
}
updateGuildUnread(guildState);
const orCreateGuildState = getOrCreateGuildState(value2);
const value22 = guildState.unread !== orCreateGuildState.unread;
reducibleJoin56: while (true) {
if (value22) {
r0 = value22;
break reducibleJoin56;
}
highImportanceMentionCount = guildState.highImportanceMentionCount;
highImportanceMentionCount2 = orCreateGuildState.highImportanceMentionCount;
value23 = highImportanceMentionCount !== highImportanceMentionCount2;
r0 = value23;
break reducibleJoin56;
}
reducibleJoin58: while (true) {
if (r0) {
break reducibleJoin58;
}
lowImportanceMentionCount = guildState.lowImportanceMentionCount;
lowImportanceMentionCount2 = orCreateGuildState.lowImportanceMentionCount;
value24 = lowImportanceMentionCount !== lowImportanceMentionCount2;
r0 = value24;
break reducibleJoin58;
}
reducibleJoin68: while (true) {
if (r0) {
binding = env0_28;
reducibleJoin61: while (true) {
if (value2 != null) {
r6 = value2;
break reducibleJoin61;
}
r6 = NULL_STRING_GUILD_ID;
break reducibleJoin61;
}
binding[r6] = guildState;
reducibleJoin65: while (true) {
if (value2 == null) {
break reducibleJoin65;
}
unread = guildState.unread;
binding = env0_29;
if (unread) {
add = binding.add;
Reflect.apply(add, binding, [value2]);
break reducibleJoin65;
}
binding.delete(value2);
break reducibleJoin65;
}
binding = env0_30;
env0_30 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
updateGuildUnreadSentinelBinding = updateGuildUnreadSentinel;
reducibleJoin67: while (true) {
if (value2 != null) {
r5 = value2;
break reducibleJoin67;
}
r5 = NULL_STRING_GUILD_ID;
break reducibleJoin67;
}
updateGuildUnreadSentinelBinding(r5);
updateNotificationCenterMentions(guildState, orCreateGuildState);
value = true;
r0 = value;
break reducibleJoin68;
}
break reducibleJoin68;
}
return r0;
}
function handleConnectionOpen_46015({guilds, readState}) { // fn#46015, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:7624, offset: 0x0119e8ca, size: 230 bytes, params: 2, frame: 20
var r2;
var r1;
var value10;
var id;
var has;
var id2;
var value11;
var value12;
env0_28 = {};
let Set = global.Set;
let set = new Set();
const value4 = readState.entries.length < 500;
Set = global.Set;
set = new Set();
if (value4) {
readState.entries.forEach(_fun46016);
}
recountGuild(null);
const value8 = _createForOfIteratorHelperLoose_45991(guilds);
const value9 = value8();
let done = value9.done;
if (!done) {
r2 = value9;
while (true) {
value10 = r2.value;
recountGuildBinding = recountGuild;
id = value10.id;
if (value4) {
has = set.has;
id2 = value10.id;
value11 = Reflect.apply(has, set, [id2]);
r1 = value11;
} else {
r1 = undefined;
}
recountGuildBinding(id, r1);
value12 = value8();
done = value12.done;
if (done) {
break;
}
r2 = value12;
continue;
}
}
}
function handleGuildDelete_46019({guild}) { // fn#46019, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:8280, offset: 0x0119eadd, size: 80 bytes, params: 2, frame: 13
var r0;
let binding = env0_28;
let id = guild.id;
const value2 = binding[id] != null;
if (value2) {
binding = env0_28;
id = guild.id;
delete binding[id];
binding = env0_29;
id = guild.id;
binding.delete(id);
binding = env0_30;
env0_30 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
r0 = true;
} else {
r0 = value2;
}
return r0;
}
function handleWindowFocus_46021() { // fn#46021, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:8467, offset: 0x0119eb58, size: 77 bytes, params: 1, frame: 14
var r0;
var recountChannelsBinding;
var value;
const getChannel = ChannelStore.getChannel;
const getChannelId = SelectedChannelStore.getChannelId;
const value2 = Reflect.apply(getChannel, ChannelStore, [Reflect.apply(getChannelId, SelectedChannelStore, [])]);
const value3 = value2 != null;
if (value3) {
recountChannelsBinding = recountChannels;
value = value2.getGuildId();
value = recountChannelsBinding(value, [value2.id]);
r0 = value;
} else {
r0 = value3;
}
return r0;
}
function handleGuildMemberUpdate({user, guildId}) { // fn#46022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:8588, offset: 0x0119eba5, size: 55 bytes, params: 2, frame: 13
const id = user.id;
const getId = AuthenticationStore.getId;
return id === Reflect.apply(getId, AuthenticationStore, []) && recountGuild(guildId);
}
function handleGenericUpdate({channelId}) { // fn#46023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:8682, offset: 0x0119ebdc, size: 71 bytes, params: 2, frame: 14
var r0;
var recountChannelsBinding;
var value;
const channel = ChannelStore.getChannel(channelId);
const value3 = channel != null;
if (value3) {
recountChannelsBinding = recountChannels;
value = channel.getGuildId();
value = recountChannelsBinding(value, [channel.id]);
r0 = value;
} else {
r0 = value3;
}
return r0;
}
function handleMessageCreate_46024({channelId}) { // fn#46024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:8803, offset: 0x0119ec23, size: 244 bytes, params: 2, frame: 18
const channel = ChannelStore.getChannel(channelId);
if (channel == null) {
return false;
}
if (channel.guild_id != null) {
var orCreateGuildState = getOrCreateGuildState(channel.guild_id);
if (channel.isThread() ? JoinedThreadsStore.hasJoined(channel.id) ? JoinedThreadsStore.isMuted(channel.id) : !JoinedThreadsStore.hasJoined(channel.id) : UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(channel.guild_id,
channel.id)) {
if (ReadStateStore.getMentionCount(channelId) === 0) {
return false;
}
return recountChannels(channel.getGuildId(), [channel.id]);
}
var unreadByType = orCreateGuildState.unreadByType;
var CHANNEL = ReadStateTypes.CHANNEL;
if (unreadByType[CHANNEL]) {
if (ReadStateStore.getMentionCount(channelId) === 0) {
return false;
}
return recountChannels(channel.getGuildId(), [channel.id]);
}
}
return recountChannels(channel.getGuildId(), [channel.id]);
}
function handleChannelSelect_46025({channelId, guildId}) { // fn#46025, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:9165, offset: 0x0119ed17, size: 61 bytes, params: 2, frame: 15
return guildId !== FAVORITES && (channelId != null && recountChannels(guildId, [channelId]));
}
function handleChannelUpdate_46026({channel}) { // fn#46026, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:9267, offset: 0x0119ed54, size: 48 bytes, params: 2, frame: 13
return recountChannels(channel.getGuildId(), [channel.id]);
}
function handleChannelUpdates_46027({channels}) { // fn#46027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:9355, offset: 0x0119ed84, size: 78 bytes, params: 2, frame: 14
let value = (importDefault(22) /* metro dependency 22 */)(channels);
value = value.groupBy(function(a0) {
return a0.getGuildId();
});
return value.reduce(function(a0, a1, a2) {
return recountChannels(a2, a1.map(_fun46030)) || a0;
}, false);
}
function handleBulkAck({channels}) { // fn#46031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:9510, offset: 0x0119ee12, size: 108 bytes, params: 2, frame: 14
let value = (importDefault(22) /* metro dependency 22 */)(channels);
value = value.map(function(a0) {
return a0.channelId;
});
value = value.filter(_fun46033);
value = value.groupBy(_fun46034);
return value.reduce(function(a0, a1, a2) {
return recountChannels(a2, a1) || a0;
}, false);
}
function handleThreadUpdate_46036({channel}) { // fn#46036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:9752, offset: 0x0119eeef, size: 58 bytes, params: 2, frame: 14
return recountChannels(channel.getGuildId(), [channel.id, channel.parent_id]);
}
function handleThreadMembersUpdate_46041(a0) { // fn#46041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:10225, offset: 0x0119ef97, size: 72 bytes, params: 2, frame: 15
return (require(3791) /* metro dependency 3791: ThreadActionUtils */).doesThreadMembersActionAffectMe(a0) && recountChannels(a0.guildId,
[a0.id]);
}
function handleThreadListSync_46042({threads, guildId}) { // fn#46042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:10350, offset: 0x0119efdf, size: 63 bytes, params: 2, frame: 15
const recountChannelsBinding = recountChannels;
let value = threads.filter(function(a0) {
return JoinedThreadsStore.hasJoined(a0.id);
});
value = value.map(function(a0) {
return a0.id;
});
return recountChannelsBinding(guildId, value);
}
function handlePassiveUpdateV2_46045(a0) { // fn#46045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:10477, offset: 0x0119f03a, size: 68 bytes, params: 2, frame: 15
var r0;
var recountChannelsBinding;
var guildId;
let value = a0.channels.length > 0;
if (value) {
recountChannelsBinding = recountChannels;
guildId = a0.guildId;
value = a0.channels.map(function(a0) {
return a0.id;
});
value = recountChannelsBinding(guildId, value);
r0 = value;
} else {
r0 = value;
}
return r0;
}
function handleUserGuildSettingsFullUpdate({userGuildSettings}) { // fn#46049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:10722, offset: 0x0119f096, size: 118 bytes, params: 2, frame: 14
const Set = global.Set;
const set = new Set(userGuildSettings.map(function({guild_id}) {
return guild_id ?? NULL_STRING_GUILD_ID;
}));
return (importDefault(21) /* metro dependency 21: SnowflakeUtils */).keys(env0_28).reduce(_fun46051, false);
}
function handleClearNotifCenterGuildMentions() { // fn#46052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:10930, offset: 0x0119f153, size: 49 bytes, params: 1, frame: 9
var propertyName;
for (propertyName in env0_28) {
env0_28[propertyName].ncMentionCount = 0;
}
}
function handleRecentMentionsSuccess({messages}) { // fn#46054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:11091, offset: 0x0119f184, size: 73 bytes, params: 2, frame: 13
const Set = global.Set;
const value = messages.map(function(a0) {
return a0.channel_id;
});
const value2 = Object.create(Set.prototype, {constructor: {value: Set}});
const set = new Set(value);
(set instanceof Object ? set : value2).forEach(_fun46056);
}
function _fun46057(a0) { // fn#46057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:11265, offset: 0x0119f209, size: 450 bytes, params: 2, frame: 16
const closure = GuildReadStateStore;
env0_7(closure, a0);
return env0_4(closure, [{key: 'initialize', value: function() {
this.waitFor(ChannelStore, SelectedChannelStore, ReadStateStore, PermissionStore, AuthenticationStore,
UserStore,
UserGuildSettingsStore, ActiveJoinedThreadsStore, JoinedThreadsStore, RecentMentionsStore);
}}, {key: 'loadCache', value: value_46061}, {key: 'takeSnapshot', value: value_46062}, {key: 'hasAnyUnread',
value: value_46063}, {key: 'getStoreChangeSentinel', value: value_46064}, {key: 'getMutableUnreadGuilds',
value: value_46065}, {key: 'getMutableGuildStates', value: value_46066}, {key: 'shouldCountChannelUnread',
value: value_46067}, {key: 'hasUnread', value: value_46068}, {key: 'getMentionCount', value: value_46069},
{key: 'getIsMentionLowImportance', value: function(a0) {
return getOrCreateGuildState(a0).highImportanceMentionCount === 0;
}}, {key: 'getGuildHasUnreadIgnoreMuted', value: value_46071}, {key: 'getTotalMentionCount', value: value_46072},
{key: 'getTotalNotificationsMentionCount', value: value_46073}, {key: 'getPrivateChannelMentionCount',
value: value_46074}, {key: 'getMentionCountForPrivateChannel', value: value_46075},
{key: 'getGuildChangeSentinel', value: function(a0) {
return getOrCreateGuildState(a0).sentinel;
}}]);
}
function _fun46007(a0) { // fn#46007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:4020, offset: 0x0119df8c, size: 107 bytes, params: 2, frame: 16
let value = environment.__proto__;
const value2 = ReadStateStore.lastMessageId(a0);
const _ackMessageId = env0_2._ackMessageId;
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.compare(value2, _ackMessageId);
if (value > 0) {
env0_1 = env0_1 + env0_0.mentionCounts[a0].count;
}
}
function _fun46011(a0) { // fn#46011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:4811, offset: 0x0119e261, size: 261 bytes, params: 2, frame: 19
var r2;
var mentionCounts;
var mentionCount;
var id;
var object2;
const channel = ChannelStore.getChannel(a0);
if (channel != null) {
if (channel.getGuildId() === env0_0) {
mentionCount = ReadStateStore.getMentionCount(a0);
r2 = env0_0 !== null && !env0_2;
r2 = r2 && ReadStateStore.hasUnread(channel.id);
r2 = r2 && isCountableChannel(channel, mentionCount, true);
if (r2) {
env0_1.unreadChannelId = channel.id;
}
if (mentionCount > 0) {
if (isCountableChannel(channel, mentionCount)) {
mentionCounts = env0_1.mentionCounts;
id = channel.id;
object2 = {count: mentionCount};
object2.isMentionLowImportance = ReadStateStore.getIsMentionLowImportance(a0);
mentionCounts[id] = object2;
} else {
delete env0_1.mentionCounts[channel.id];
}
} else {
delete env0_1.mentionCounts[channel.id];
}
}
} else {
delete env0_1.mentionCounts[a0];
}
}
function _fun46016(a0) { // fn#46016, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:7756, offset: 0x0119e9b0, size: 147 bytes, params: 2, frame: 14
var read_state_type;
var binding;
var add;
let value = a0.mention_count != null;
if (value && a0.mention_count > 0) {
read_state_type = a0.read_state_type;
if (read_state_type == null) {
binding = env0_0;
add = binding.add;
value = environment.__proto__;
value = ChannelStore.getChannel(a0.id);
Reflect.apply(add, binding, [value?.guild_id]);
} else {
read_state_type = a0.read_state_type;
value = environment.__proto__;
if (read_state_type === ReadStateTypes.CHANNEL) {
binding = env0_0;
add = binding.add;
value = environment.__proto__;
value = ChannelStore.getChannel(a0.id);
Reflect.apply(add, binding, [value?.guild_id]);
} else {
binding = env0_0;
binding.add(a0.id);
}
}
}
}
function _fun46029(a0, a1, a2) { // fn#46029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:9457, offset: 0x0119ede1, size: 49 bytes, params: 4, frame: 14
return recountChannels(a2, a1.map(function(a0) {
return a0.id;
})) || a0;
}
function _fun46033(a0) { // fn#46033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:9602, offset: 0x0119ee88, size: 28 bytes, params: 2, frame: 11
const value = environment.__proto__;
return ChannelStore.getChannel(a0) != null;
}
function _fun46034(a0) { // fn#46034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:9638, offset: 0x0119eea4, size: 43 bytes, params: 2, frame: 11
var r0;
let value = environment.__proto__;
value = ChannelStore.getChannel(a0);
if (value == null) {
r0 = undefined;
} else {
value = value.getGuildId();
r0 = value;
}
return r0;
}
function _fun46051(a0, a1) { // fn#46051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:10889, offset: 0x0119f123, size: 48 bytes, params: 3, frame: 13
const value = a0;
let r0 = env0_0.has(a1) && recountGuild(a1);
r0 = !r0 ? value : r0;
return r0;
}
function _fun46056(a0) { // fn#46056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:11185, offset: 0x0119f1cd, size: 60 bytes, params: 2, frame: 13
const value = environment.__proto__;
const channel = ChannelStore.getChannel(a0);
if (channel != null) {
recountChannels(channel.getGuildId(), [a0]);
}
}
function GuildReadStateStore() { // fn#46058, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:11277, offset: 0x0119f3cb, size: 476 bytes, params: 1, frame: 20
var environment;
const value = environment.__proto__;
env1_3(this, GuildReadStateStore);
const handleGenericUpdateBinding = handleGenericUpdate;
const handleGuildUpdateBinding = handleGuildUpdate;
const handleThreadUpdate_46036Binding = handleThreadUpdate_46036;
const handleUserGuildSettingsUpdateBinding = handleUserGuildSettingsUpdate;
const handleGuildEventUpdateBinding = handleGuildEventUpdate;
const recomputeAllGuildsBinding = recomputeAllGuilds;
const items2 = [{CONNECTION_OPEN: handleConnectionOpen_46015, OVERLAY_INITIALIZE: handleOverlayInitialize_46014,
CACHE_LOADED_LAZY: CACHE_LOADED_LAZY_46059, GUILD_CREATE: handleGuildCreate_46018,
GUILD_DELETE: handleGuildDelete_46019, MESSAGE_CREATE: handleMessageCreate_46024,
MESSAGE_ACK: handleGenericUpdateBinding, BULK_ACK: handleBulkAck,
UPDATE_CHANNEL_DIMENSIONS: handleGenericUpdateBinding, CHANNEL_SELECT: handleChannelSelect_46025,
CHANNEL_DELETE: handleChannelDelete_46020, WINDOW_FOCUS: handleWindowFocus_46021,
GUILD_ACK: handleMarkGuildAsRead, GUILD_ROLE_CREATE: handleGuildUpdateBinding,
GUILD_ROLE_DELETE: handleGuildUpdateBinding, GUILD_ROLE_UPDATE: handleGuildUpdateBinding,
CHANNEL_CREATE: handleChannelUpdate_46026, CHANNEL_UPDATES: handleChannelUpdates_46027,
THREAD_CREATE: handleThreadUpdate_46036Binding, THREAD_UPDATE: handleThreadUpdate_46036Binding,
THREAD_DELETE: handleThreadUpdate_46036Binding, THREAD_LIST_SYNC: handleThreadListSync_46042,
THREAD_MEMBER_UPDATE: handleThreadMemberUpdate, THREAD_MEMBERS_UPDATE: handleThreadMembersUpdate_46041,
PASSIVE_UPDATE_V2: handlePassiveUpdateV2_46045, GUILD_MEMBER_UPDATE: handleGuildMemberUpdate,
USER_GUILD_SETTINGS_FULL_UPDATE: handleUserGuildSettingsFullUpdate,
USER_GUILD_SETTINGS_CHANNEL_UPDATE: handleUserGuildSettingsUpdateBinding,
USER_GUILD_SETTINGS_CHANNEL_UPDATE_BULK: handleUserGuildSettingsUpdateBinding,
USER_GUILD_SETTINGS_GUILD_UPDATE: handleUserGuildSettingsUpdateBinding,
USER_GUILD_SETTINGS_GUILD_AND_CHANNELS_UPDATE: handleUserGuildSettingsUpdateBinding,
GUILD_FEATURE_ACK: handleGuildFeatureAck, GUILD_SCHEDULED_EVENT_CREATE: handleGuildEventUpdateBinding,
GUILD_SCHEDULED_EVENT_UPDATE: handleGuildEventUpdateBinding,
GUILD_SCHEDULED_EVENT_DELETE: handleGuildEventDelete, CHANNEL_RTC_UPDATE_CHAT_OPEN: handleGenericUpdateBinding,
LOAD_MESSAGES_SUCCESS: handleGenericUpdateBinding, CHANNEL_ACK: handleGenericUpdateBinding,
CHANNEL_LOCAL_ACK: handleGenericUpdateBinding, NOTIFICATION_SETTINGS_UPDATE: recomputeAllGuildsBinding,
RECOMPUTE_READ_STATES: recomputeAllGuildsBinding, VOICE_CHANNEL_SELECT: handleGenericUpdateBinding,
ENABLE_AUTOMATIC_ACK: handleGenericUpdateBinding, RESORT_THREADS: handleGenericUpdateBinding,
NOTIFICATION_CENTER_CLEAR_GUILD_MENTIONS: handleClearNotifCenterGuildMentions,
TRY_ACK: handleGenericUpdateBinding, LOAD_RECENT_MENTIONS_SUCCESS: handleRecentMentionsSuccess}];
const value3 = env1_6(GuildReadStateStore);
return env1_5(this, _isNativeReflectConstruct_45988() ? global.Reflect.construct(value3, items2,
env1_6(this).constructor) : value3.apply(this, items2));
}
function value_46061() { // fn#46061, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:13669, offset: 0x0119f5e6, size: 88 bytes, params: 1, frame: 12
var guilds;
var value2;
var Set;
var unreadGuilds;
var set;
const readSnapshot = this.readSnapshot;
const LATEST_SNAPSHOT_VERSION = GuildReadStateStore.LATEST_SNAPSHOT_VERSION;
const value = Reflect.apply(readSnapshot, this, [LATEST_SNAPSHOT_VERSION]);
if (value != null) {
guilds = value.guilds;
value2 = environment.__proto__;
Set = global.Set;
unreadGuilds = value.unreadGuilds;
set = new Set();
}
}
function value_46062() { // fn#46062, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:13825, offset: 0x0119f63e, size: 67 bytes, params: 1, frame: 13
const object3 = {};
const LATEST_SNAPSHOT_VERSION = GuildReadStateStore.LATEST_SNAPSHOT_VERSION;
object3.version = LATEST_SNAPSHOT_VERSION;
const object4 = {};
object4.guilds = env1_28;
const Array = global.Array;
object4.unreadGuilds = Array.from(env1_29);
object3.data = object4;
return object3;
}
function value_46063() { // fn#46063, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:13967, offset: 0x0119f681, size: 20 bytes, params: 1, frame: 2
return env1_29.size > 0;
}
function value_46067(a0) { // fn#46067, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:14207, offset: 0x0119f695, size: 32 bytes, params: 2, frame: 15
let value = a1;
const r4 = value !== undefined ? value : 0;
value = environment.__proto__;
return isCountableChannel(a0, r4, true);
}
function value_46068(a0) { // fn#46068, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:14282, offset: 0x0119f6b5, size: 22 bytes, params: 2, frame: 11
return env1_29.has(a0);
}
function value_46069(a0) { // fn#46069, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:14341, offset: 0x0119f6cb, size: 35 bytes, params: 2, frame: 11
let value = environment.__proto__;
value = getOrCreateGuildState(a0);
return value.highImportanceMentionCount + value.lowImportanceMentionCount;
}
function value_46071(a0) { // fn#46071, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:14608, offset: 0x0119f70d, size: 271 bytes, params: 2, frame: 26
var r6;
var r10;
var r5;
var propertyName;
var propertyName2;
var property;
var isGuildVocal;
var getMentionCount;
var can;
var accessPermissions;
var hasUnreadOrMentions;
var propertyName3;
var getChannel;
var properties6;
var properties7;
var properties8;
var propertyName4;
const mutableGuildChannelsForGuild = ChannelStore.getMutableGuildChannelsForGuild(a0);
let properties = Object.keys(mutableGuildChannelsForGuild);
const properties2 = 0;
const properties3 = properties.length;
if (properties !== undefined) {
r6 = properties2;
reducibleLoop1: while (true) {
propertyName = properties[r6];
propertyName2 = r6 + 1;
if (propertyName === undefined) {
break reducibleLoop1;
}
property = mutableGuildChannelsForGuild[propertyName];
if (property == null) {
r6 = propertyName2;
continue reducibleLoop1;
}
isGuildVocal = property.isGuildVocal;
if (Reflect.apply(isGuildVocal, property, [])) {
getMentionCount = ReadStateStore.getMentionCount;
reducibleJoin5: while (true) {
if (Reflect.apply(getMentionCount, ReadStateStore, [propertyName]) === 0) {
r6 = propertyName2;
continue reducibleLoop1;
}
break reducibleJoin5;
}
}
can = PermissionStore.can;
accessPermissions = property.accessPermissions;
if (Reflect.apply(can, PermissionStore, [accessPermissions, property])) {
hasUnreadOrMentions = ReadStateStore.hasUnreadOrMentions;
if (Reflect.apply(hasUnreadOrMentions, ReadStateStore, [propertyName])) {
return true;
}
r6 = propertyName2;
continue reducibleLoop1;
}
r6 = propertyName2;
continue reducibleLoop1;
}
}
const activeJoinedThreadsForGuild = ActiveJoinedThreadsStore.getActiveJoinedThreadsForGuild(a0);
properties = Object.keys(activeJoinedThreadsForGuild);
const properties4 = 0;
const properties5 = properties.length;
if (properties !== undefined) {
r10 = properties4;
reducibleLoop9: while (true) {
propertyName = properties[r10];
propertyName3 = r10 + 1;
if (propertyName === undefined) {
return !!ReadStateStore.hasUnreadOrMentions(a0, ReadStateTypes.GUILD_EVENT);
}
getChannel = ChannelStore.getChannel;
if (Reflect.apply(getChannel, ChannelStore, [propertyName]) == null) {
r10 = propertyName3;
continue reducibleLoop9;
}
property = activeJoinedThreadsForGuild[propertyName];
properties6 = Object.keys(property);
properties7 = 0;
properties8 = properties6.length;
if (properties6 === undefined) {
r10 = propertyName3;
continue reducibleLoop9;
}
r5 = properties7;
reducibleLoop12: while (true) {
propertyName = properties6[r5];
propertyName4 = r5 + 1;
if (propertyName === undefined) {
r10 = propertyName3;
continue reducibleLoop9;
}
hasUnreadOrMentions = ReadStateStore.hasUnreadOrMentions;
if (Reflect.apply(hasUnreadOrMentions, ReadStateStore, [propertyName])) {
return true;
}
r5 = propertyName4;
continue reducibleLoop12;
}
continue reducibleLoop9;
}
}
hasUnreadOrMentions = ReadStateStore.hasUnreadOrMentions;
const GUILD_EVENT = ReadStateTypes.GUILD_EVENT;
return !!Reflect.apply(hasUnreadOrMentions, ReadStateStore, [a0, GUILD_EVENT]);
}
function value_46072(a0) { // fn#46072, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:15036, offset: 0x0119f81c, size: 88 bytes, params: 2, frame: 14
var r1;
var r6;
var r11;
var r0;
var propertyName;
var propertyName2;
var property;
var value4;
var highImportanceMentionCount;
var value5;
const binding = env1_28;
const value2 = a0 === true;
const value3 = 0;
const properties = Object.keys(binding);
const properties2 = 0;
const properties3 = properties.length;
if (properties === undefined) {
r0 = value3;
} else {
r1 = value3;
r6 = properties2;
while (true) {
propertyName = properties[r6];
propertyName2 = r6 + 1;
if (propertyName === undefined) {
r0 = r1;
break;
}
property = env1_28[propertyName];
if (!value2) {
r11 = value2;
continue;
}
value4 = propertyName === NULL_STRING_GUILD_ID;
r11 = value4;
if (r11) {
r6 = propertyName2;
continue;
}
highImportanceMentionCount = property.highImportanceMentionCount;
value5 = r1 + highImportanceMentionCount;
r1 = value5;
r6 = propertyName2;
}
}
return r0;
}
function value_46073(a0) { // fn#46073, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:15190, offset: 0x0119f874, size: 88 bytes, params: 2, frame: 14
var r1;
var r6;
var r11;
var r0;
var propertyName;
var propertyName2;
var property;
var value4;
var ncMentionCount;
var value5;
const binding = env1_28;
const value2 = a0 === true;
const value3 = 0;
const properties = Object.keys(binding);
const properties2 = 0;
const properties3 = properties.length;
if (properties === undefined) {
r0 = value3;
} else {
r1 = value3;
r6 = properties2;
while (true) {
propertyName = properties[r6];
propertyName2 = r6 + 1;
if (propertyName === undefined) {
r0 = r1;
break;
}
property = env1_28[propertyName];
if (!value2) {
r11 = value2;
continue;
}
value4 = propertyName === NULL_STRING_GUILD_ID;
r11 = value4;
if (r11) {
r6 = propertyName2;
continue;
}
ncMentionCount = property.ncMentionCount;
value5 = r1 + ncMentionCount;
r1 = value5;
r6 = propertyName2;
}
}
return r0;
}
function value_46074() { // fn#46074, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:15328, offset: 0x0119f8cc, size: 46 bytes, params: 1, frame: 4
const value = environment.__proto__;
return env1_28[NULL_STRING_GUILD_ID]?.highImportanceMentionCount ?? 0;
}
function value_46075(a0) { // fn#46075, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5392:15465, offset: 0x0119f8fa, size: 53 bytes, params: 2, frame: 4
const value = environment.__proto__;
const property = env1_28[NULL_STRING_GUILD_ID];
return (property == null ? undefined : property.mentionCounts[a0]) ?? 0;
}