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

724 lines
35 KiB
TypeScript

/* Metro module 5220; source: modules/reply_nudge/ReplyNudgeStore.tsx; dependencies: [6, 7, 15, 17, 18, 57, 1220, 5221, 1348, 1226, 1379, 4605, 3793, 1934, 4864, 5223, 661, 3, 5219, 1962, 683, 5224, 3829, 566, 694, 2] */
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 PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import AnalyticsUtils from '../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
import ApexExperimentStore from '../experiments/apex/ApexExperimentStore.tsx'; /* Metro dependency 1220 */
import AuthenticationStore from '../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
import UserSettingsProtoStore from '../user_settings/UserSettingsProtoStore.tsx'; /* Metro dependency 1348 */
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import SelectedChannelStore from '../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
import RelationshipStore from '../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
import ReadStateStore from '../../stores/ReadStateStore.tsx'; /* Metro dependency 4605 */
import UserGuildSettingsStore from '../../stores/UserGuildSettingsStore.tsx'; /* Metro dependency 4864 */
import UserAffinitiesV2Store from '../user_affinities/UserAffinitiesV2Store.tsx'; /* Metro dependency 5221 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as UserSettingsModule from '../user_settings/UserSettings.tsx'; /* Metro dependency 3829 */
import * as ReplyNudgeConstantsModule from './ReplyNudgeConstants.tsx'; /* Metro dependency 5223 */
import * as ReplyNudgeExperimentModule from './ReplyNudgeExperiment.tsx'; /* Metro dependency 5224 */
function _fun46177(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#46177, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:6, offset: 0x011a1930, size: 713 bytes, params: 8, frame: 20
const env0_0 = require;
const _arrayLikeToArray_46183 = 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 = ReplyNudgeConstantsModule;
const env0_18 = value.MAX_LATEST_MESSAGE_AGE_MS;
const env0_19 = value.NUDGE_TIMESTAMP_OFFSET_MS;
value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('ReplyNudgeStore');
let env0_24 = {};
let Set = global.Set;
let set = new Set();
const PersistedStore = (Flux).PersistedStore;
set = _fun46195(PersistedStore);
set.displayName = 'ReplyNudgeStore';
set.persistKey = 'ReplyNudgeStore';
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {REPLY_NUDGE_SET: REPLY_NUDGE_SET_46204,
REPLY_NUDGE_CLEAR: function({channelId}) {
return maybeDismissNudge(channelId, 'manual');
}, REPLY_NUDGES_INITIALIZED: REPLY_NUDGES_INITIALIZED, MESSAGE_CREATE: function({message}) {
return maybeDismissNudge(message.channel_id, 'message_sent');
}, MESSAGE_REACTION_ADD: MESSAGE_REACTION_ADD_46209, CHANNEL_SELECT: CHANNEL_SELECT_46210,
CHANNEL_DELETE: function(a0) {
return maybeDismissNudge(a0.channel.id, 'channel_deleted');
}, LOGOUT: function() {
env0_24 = {};
var Set = global.Set;
var value3 = new Set();
env0_22 = false;
env0_23 = false;
}});
(FileImportTrackerModule).fileFinishedImporting('modules/reply_nudge/ReplyNudgeStore.tsx');
exports.default = set;
function _isNativeReflectConstruct_46178() { // fn#46178, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:354, offset: 0x011a1bf9, 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_46178_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_46181(a0, a1) { // fn#46181, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:547, offset: 0x011a1c57, 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 _fun46182;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_46183(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_46183(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_46183(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun46182;
}
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 _fun46182() { // fn#46182, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:1118, 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 pruneExpiredNudges(a0, {maxNudgeAge, maxNudgeCount}) { // fn#46184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:1521, offset: 0x011a1dc9, size: 286 bytes, params: 3, frame: 26
var r5;
var property;
var value4;
var property2;
var timestamp;
var isActive;
var lastMessageId;
var affinity;
var authorId;
var value5;
var env0_5;
var env0_6;
const Date = global.Date;
const env0_2 = Date.now();
const object = {};
let Object = global.Object;
const value = Object.entries(a0);
value.sort(function(a0, a1) {
return a1[1].timestamp - a0[1].timestamp;
});
const pruneExpiredNudges_loop2 = pruneExpiredNudges_loop;
let length = value.length;
if (0 < length) {
for (r5 = 0; true; r5 = value5) {
property = value[r5];
value4 = Module00057(property, 2);
property = value4[0];
property2 = value4[1];
timestamp = property2.timestamp;
env0_5 = timestamp;
isActive = property2.isActive;
env0_6 = isActive;
lastMessageId = property2.lastMessageId;
affinity = property2.affinity;
authorId = property2.authorId;
pruneExpiredNudges_loop2(property, lastMessageId, affinity, authorId);
value5 = typeof r5 === 'bigint' ? r5 + 1n : +r5 + 1;
length = value.length;
if (!(value5 < length)) {
break;
}
}
}
const binding = env0_21;
const info = binding.info;
length = value.length;
Object = global.Object;
Reflect.apply(info, binding, ['Pruned ' + (length - Object.keys(object).length) + ' expired nudges']);
return object;
function pruneExpiredNudges_loop(a0, a1, a2, a3) { // fn#46186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:1691, owner: pruneExpiredNudges._loop, offset: 0x011a1f0a, size: 356 bytes, params: 5, frame: 22
var environment;
var r10;
var r6;
var r4;
var r3;
var binding;
var value2;
var value3;
var value4;
var value5;
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const env0_3 = a3;
var value;
if (timestamp != null) {
binding = env0_2;
value2 = binding - timestamp;
value3 = environment.__proto__;
if (value2 < MAX_LATEST_MESSAGE_AGE_MS) {
binding = env0_2;
value4 = binding - timestamp;
var env0_4 = value4;
value5 = ReadStateStore.lastMessageId(a0);
r10 = isActive && value4 >= maxNudgeAge;
r6 = isActive && env0_4 >= maxNudgeCount;
r4 = isActive && value5 !== a1;
r3 = isActive && !r10;
r3 = r3 && !r6;
r3 = r3 && !r4;
if (!r10) {
if (!r6) {
if (r4) {
}
}
}
binding = env0_3;
binding[a0] = {timestamp: timestamp, isActive: r3, lastMessageId: a1, affinity: a2, authorId: a3};
if (r3) {
binding = env0_4;
env0_4 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
} else if (isActive) {
var env0_6 = ChannelStore.getChannel(a0);
value = require(dependencyMap[19]);
value = value(dependencyMap[18], dependencyMap.paths);
value.then(_fun46187);
}
}
}
function _fun46187({default: property}) { // fn#46187, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:2022, offset: 0x011a206e, size: 219 bytes, params: 2, frame: 20
const value = environment.__proto__.__proto__;
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const REPLY_NUDGE_DISMISSED = AnalyticEvents.REPLY_NUDGE_DISMISSED;
const object = {};
object.channel_id = env0_0;
object.channel_type = env0_6?.type;
object.guild_id = env0_6?.guild_id;
object.dismiss_method = env0_5;
object.nudge_age_ms = env0_4;
object.nudge_author_affinity = importDefault;
object.nudge_author_id = importAll;
object.nudge_author_is_friend = RelationshipStore.isFriend(importAll);
object.nudge_message_id = require;
object.channel_dm_list_index = property.getPrivateChannelIds().indexOf(env0_0);
Reflect.apply(track, defaultImport, [REPLY_NUDGE_DISMISSED, object]);
}
}
}
function maybeDismissNudge(a0, a1) { // fn#46188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:2564, offset: 0x011a2149, size: 183 bytes, params: 3, frame: 15
var property;
const env0_0 = a0;
const env0_1 = a1;
var value;
if (a0 in env0_24) {
property = env0_24[a0];
if (property.isActive) {
var env0_3 = global.Date.now() - property.timestamp;
env0_24[a0].isActive = false;
var env0_4 = ChannelStore.getChannel(a0);
value = require(dependencyMap[19]);
property = dependencyMap[18];
value = value(property, dependencyMap.paths);
value.then(_fun46189);
return true;
}
}
return false;
function _fun46189({default: property}) { // fn#46189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:2759, offset: 0x011a2200, size: 247 bytes, params: 2, frame: 20
const value = environment.__proto__;
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const REPLY_NUDGE_DISMISSED = AnalyticEvents.REPLY_NUDGE_DISMISSED;
const object = {};
object.channel_id = env0_0;
object.channel_type = env0_4?.type;
object.guild_id = env0_4?.guild_id;
object.dismiss_method = require;
object.nudge_age_ms = env0_3;
object.nudge_author_affinity = env0_2.affinity;
object.nudge_author_id = env0_2.authorId;
object.nudge_message_id = env0_2.lastMessageId;
const relationshipStoreBinding = RelationshipStore;
object.nudge_author_is_friend = relationshipStoreBinding.isFriend(env0_2.authorId);
object.channel_dm_list_index = property.getPrivateChannelIds().indexOf(env0_0);
Reflect.apply(track, defaultImport, [REPLY_NUDGE_DISMISSED, object]);
}
}
function getActiveNudgeChannelIds() { // fn#46190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:3135, offset: 0x011a22f7, size: 109 bytes, params: 1, frame: 19
var r2;
var property;
var value4;
var isActive;
var value5;
const items2 = [];
const Object = global.Object;
const value2 = Object.entries(env0_24);
let length = value2.length;
const value3 = 0;
if (value3 < length) {
r2 = value3;
while (true) {
property = value2[r2];
value4 = Module00057(property, 2);
property = value4[value3];
isActive = value4[1].isActive;
if (isActive) {
items2.push(property);
}
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
length = value2.length;
if (value5 < length) {
r2 = value5;
continue;
}
break;
}
}
return items2;
}
function handleNudgeVisibilityChange() { // fn#46191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:3285, offset: 0x011a2364, size: 279 bytes, params: 1, frame: 18
var Set;
var value5;
var set;
const ReplyNudgeExperiment = (ReplyNudgeExperimentModule).ReplyNudgeExperiment;
const {displayNudges, maxNudgeAge,
maxNudgeCount} = ReplyNudgeExperiment.getConfig({location: 'handleNudgeVisibilityChange'});
const EnableDmReplyNudgeReminders = (UserSettingsModule).EnableDmReplyNudgeReminders;
let getSetting = EnableDmReplyNudgeReminders.getSetting;
const r2 = Reflect.apply(getSetting, EnableDmReplyNudgeReminders, []) !== false && displayNudges;
if (env0_22 === r2) {
return false;
}
if (r2) {
env0_24 = pruneExpiredNudges(env0_24, {maxNudgeAge: maxNudgeAge, maxNudgeCount: maxNudgeCount});
Set = global.Set;
value5 = getActiveNudgeChannelIds();
set = new Set();
}
getSetting = EnableDmReplyNudgeReminders.getSetting;
if (Reflect.apply(getSetting, EnableDmReplyNudgeReminders, []) === false) {
env0_24 = {};
set = new global.Set();
}
}
function handleUserGuildSettingsUpdate_46192() { // fn#46192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:3721, offset: 0x011a247b, size: 81 bytes, params: 1, frame: 14
var r3;
var value3;
const env0_0 = false;
const handleUserGuildSettingsUpdate_46192_loop22 = handleUserGuildSettingsUpdate_46192_loop2;
const Object = global.Object;
const value = Object.keys(env0_24);
let length = value.length;
const value2 = 0;
if (value2 < length) {
for (r3 = value2; true; r3 = value3) {
handleUserGuildSettingsUpdate_46192_loop22(value[r3]);
value3 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1;
length = value.length;
if (!(value3 < length)) {
break;
}
}
}
return env0_0;
function handleUserGuildSettingsUpdate_46192_loop2(a0) { // fn#46193, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:3782, owner: handleUserGuildSettingsUpdate_46192._loop2, offset: 0x011a24cc, size: 152 bytes, params: 2, frame: 16
var property;
const env0_0 = a0;
const userGuildSettingsStoreBinding = UserGuildSettingsStore;
if (userGuildSettingsStoreBinding.isChannelMuted(null, a0)) {
property = env1_24[a0];
if (property != null) {
if (property.isActive) {
var env0_2 = ChannelStore.getChannel(a0);
require(dependencyMap[19])(dependencyMap[18], dependencyMap.paths).then(_fun46194);
}
}
delete env1_24[a0];
}
function _fun46194({default: property}) { // fn#46194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:3911, offset: 0x011a2564, size: 276 bytes, params: 2, frame: 20
const value = environment.__proto__.__proto__;
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const REPLY_NUDGE_DISMISSED = AnalyticEvents.REPLY_NUDGE_DISMISSED;
const object = {};
object.channel_id = env0_0;
object.channel_type = env0_2?.type;
object.guild_id = env0_2?.guild_id;
object.dismiss_method = 'channel_muted';
const Date = global.Date;
object.nudge_age_ms = Date.now() - env0_1.timestamp;
object.nudge_author_affinity = env0_1.affinity;
object.nudge_author_id = env0_1.authorId;
object.nudge_message_id = env0_1.lastMessageId;
const relationshipStoreBinding = RelationshipStore;
object.nudge_author_is_friend = relationshipStoreBinding.isFriend(env0_1.authorId);
object.channel_dm_list_index = property.getPrivateChannelIds().indexOf(env0_0);
Reflect.apply(track, defaultImport, [REPLY_NUDGE_DISMISSED, object]);
}
}
}
function _fun46195(a0) { // fn#46195, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:4403, offset: 0x011a2678, size: 210 bytes, params: 2, frame: 16
const ReplyNudgeStore2 = ReplyNudgeStore;
Inherits(ReplyNudgeStore2, a0);
return CreateClass(ReplyNudgeStore2, [{key: 'initialize', value: value_46197}, {key: 'getState', value: value_46198},
{key: 'getNudgeTimestamp', value: value_46199}, {key: 'getNudgeDMTimestamp', value: value_46200},
{key: 'isChannelNudged', value: value_46201}, {key: 'getChannelNudge', value: value_46202},
{key: 'isNudgesInitialized', value: value_46203}]);
function ReplyNudgeStore() { // fn#46196, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:4415, offset: 0x011a274a, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_3(this, ReplyNudgeStore);
const value3 = env1_6(ReplyNudgeStore);
return env1_5(this, _isNativeReflectConstruct_46178() ? global.Reflect.construct(value3, arguments,
env1_6(this).constructor) : value3.apply(this, arguments));
}
function value_46197(a0) { // fn#46197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:4708, offset: 0x011a27bb, size: 151 bytes, params: 2, frame: 29
const value = undefined;
env1_24 = (a0 == null ? value : a0.nudgedChannels) ?? ({});
const waitFor = this.waitFor;
const apexExperimentStoreBinding = ApexExperimentStore;
const authenticationStoreBinding = AuthenticationStore;
const channelStoreBinding = ChannelStore;
const readStateStoreBinding = ReadStateStore;
const relationshipStoreBinding = RelationshipStore;
const selectedChannelStoreBinding = SelectedChannelStore;
const userAffinitiesV2StoreBinding = UserAffinitiesV2Store;
const userGuildSettingsStoreBinding = UserGuildSettingsStore;
const userSettingsProtoStoreBinding = UserSettingsProtoStore;
Reflect.apply(waitFor, this, [apexExperimentStoreBinding, authenticationStoreBinding, channelStoreBinding,
readStateStoreBinding, relationshipStoreBinding, selectedChannelStoreBinding, userAffinitiesV2StoreBinding,
userGuildSettingsStoreBinding, userSettingsProtoStoreBinding]);
this.syncWith([userSettingsProtoStoreBinding, apexExperimentStoreBinding], handleNudgeVisibilityChange);
this.syncWith([UserGuildSettingsStore], handleUserGuildSettingsUpdate_46192);
return value;
}
function value_46198() { // fn#46198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:4940, offset: 0x011a2852, size: 16 bytes, params: 1, frame: 2
return {nudgedChannels: env1_24};
}
function value_46199(a0) { // fn#46199, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:5018, offset: 0x011a2862, size: 93 bytes, params: 2, frame: 14
var property;
const value2 = null;
if (env1_22) {
property = env1_24[a0];
return value2 == property ? value2 : (property.isActive || env1_25.has(a0)) && value2 != env1_24[a0].timestamp ? env1_24[a0].timestamp : value2;
}
return value2;
}
function value_46200(a0) { // fn#46200, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:5190, offset: 0x011a28bf, size: 39 bytes, params: 2, frame: 11
var r0;
var value3;
let value = this.getNudgeTimestamp(a0);
const value2 = null;
if (value2 == value) {
r0 = value2;
} else {
value3 = environment.__proto__;
value += NUDGE_TIMESTAMP_OFFSET_MS;
r0 = value;
}
return r0;
}
function value_46201(a0) { // fn#46201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:5309, offset: 0x011a28e6, size: 81 bytes, params: 2, frame: 5
let value = a1;
const value2 = undefined;
let includeInvisible = (value !== value2 ? value : {}).includeInvisible;
includeInvisible = !(includeInvisible === value2) && includeInvisible;
value = environment.__proto__;
return !(!env1_22 && !includeInvisible) && (env1_24[a0] == null ? value2 : env1_24[a0].isActive) === true;
}
function value_46202(a0) { // fn#46202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:5458, offset: 0x011a2937, size: 65 bytes, params: 2, frame: 4
let value = a1;
let includeInvisible = (value !== undefined ? value : {}).includeInvisible;
includeInvisible = !(includeInvisible === undefined) && includeInvisible;
value = environment.__proto__;
return env1_22 || includeInvisible ? env1_24[a0] ?? null : null;
}
function value_46203() { // fn#46203, offset: 0x00df3ac4, size: 9 bytes, params: 1, frame: 1
return env1_23;
}
}
function REPLY_NUDGE_SET_46204({channelId, timestamp, lastMessageId, affinity, authorId}) { // fn#46204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:5761, offset: 0x011a2978, size: 597 bytes, params: 2, frame: 30
var r12;
var r13;
var r14;
var r10;
var r16;
var r17;
var r4;
var r6;
var value5;
var value6;
var value7;
var done;
var value8;
var value9;
var property;
var affinity2;
var affinity3;
var value10;
var env0_0;
var env0_2;
const userGuildSettingsStoreBinding = UserGuildSettingsStore;
if (userGuildSettingsStoreBinding.isChannelMuted(null, channelId)) {
return false;
}
const ReplyNudgeExperiment = require(dependencyMap[21]).ReplyNudgeExperiment;
const {maxNudgeAge, maxNudgeCount} = ReplyNudgeExperiment.getConfig({location: 'handleReplyNudgeSet'});
const pruneExpiredNudgesBinding = pruneExpiredNudges;
let binding = env0_24;
const value3 = pruneExpiredNudgesBinding(binding, {maxNudgeAge: maxNudgeAge, maxNudgeCount: maxNudgeCount});
env0_24 = value3;
if (channelId in value3) {
return false;
}
const activeNudgeChannelIds = getActiveNudgeChannelIds();
if (activeNudgeChannelIds.length >= maxNudgeCount) {
value5 = activeNudgeChannelIds.at(-1);
value6 = _createForOfIteratorHelperLoose_46181(activeNudgeChannelIds);
value7 = value6();
done = value7.done;
value8 = Infinity;
if (done) {
r4 = value8;
r6 = value5;
} else {
r12 = value8;
r13 = value5;
r14 = value7;
while (true) {
value9 = r14.value;
property = env0_24[value9];
if (property == null) {
r16 = r12;
r17 = r13;
} else {
affinity2 = property.affinity;
if (!(affinity2 < r12)) {
r10 = r12;
continue;
}
affinity3 = property.affinity;
env0_0 = value9;
r10 = affinity3;
r13 = value9;
r16 = r10;
r17 = r13;
}
value10 = value6();
done = value10.done;
if (done) {
r4 = r16;
r6 = r17;
break;
}
r12 = r16;
r13 = r17;
r14 = value10;
continue;
}
}
if (affinity < r4) {
binding = env0_21;
binding.info('handleReplyNudgeSet: New nudge is lower than the lowest affinity. No space to nudge.',
{channelId: channelId, lowestAffinity: r4, newNudgeAffinity: affinity});
return false;
}
binding = env0_21;
binding.info('handleReplyNudgeSet: Evicting nudge with lowest affinity', {channelId: channelId,
lowestAffinity: r4,
newNudgeAffinity: affinity});
property = env0_24[r6];
if (property != null) {
if (property.isActive) {
env0_2 = ChannelStore.getChannel(r6);
require(dependencyMap[19])(dependencyMap[18], dependencyMap.paths).then(_fun46205);
}
}
delete env0_24[r6];
binding = env0_24;
binding[channelId] = {timestamp: timestamp, isActive: true, lastMessageId: lastMessageId, affinity: affinity,
authorId: authorId};
binding = env0_25;
binding.add(channelId);
} else {
binding = env0_24;
binding[channelId] = {timestamp: timestamp, isActive: true, lastMessageId: lastMessageId, affinity: affinity,
authorId: authorId};
binding = env0_25;
binding.add(channelId);
}
function _fun46205({default: property}) { // fn#46205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:6642, offset: 0x011a2bcd, size: 276 bytes, params: 2, frame: 20
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const REPLY_NUDGE_DISMISSED = AnalyticEvents.REPLY_NUDGE_DISMISSED;
const object = {};
object.channel_id = value;
object.channel_type = env0_2?.type;
object.guild_id = env0_2?.guild_id;
object.dismiss_method = 'evicted_affinity';
const Date = global.Date;
object.nudge_age_ms = Date.now() - env0_1.timestamp;
object.nudge_author_affinity = env0_1.affinity;
object.nudge_author_id = env0_1.authorId;
object.nudge_message_id = env0_1.lastMessageId;
const relationshipStoreBinding = RelationshipStore;
object.nudge_author_is_friend = relationshipStoreBinding.isFriend(env0_1.authorId);
const privateChannelIds = property.getPrivateChannelIds();
object.channel_dm_list_index = privateChannelIds.indexOf(value);
Reflect.apply(track, defaultImport, [REPLY_NUDGE_DISMISSED, object]);
}
}
function REPLY_NUDGES_INITIALIZED() { // fn#46207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:7271, offset: 0x011a2cfe, size: 115 bytes, params: 1, frame: 16
if (env0_23) {
return false;
}
const ReplyNudgeExperiment = (ReplyNudgeExperimentModule).ReplyNudgeExperiment;
const config = ReplyNudgeExperiment.getConfig({location: 'handleNudgesInitialized'});
env0_24 = pruneExpiredNudges(env0_24, {maxNudgeAge: config.maxNudgeAge, maxNudgeCount: config.maxNudgeCount});
}
function MESSAGE_REACTION_ADD_46209({channelId, userId}) { // fn#46209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:7634, offset: 0x011a2d95, size: 57 bytes, params: 2, frame: 14
const authenticationStoreBinding = AuthenticationStore;
const getId = authenticationStoreBinding.getId;
return userId === Reflect.apply(getId, authenticationStoreBinding, []) && maybeDismissNudge(channelId,
'reaction_added');
}
function CHANNEL_SELECT_46210({guildId, channelId}) { // fn#46210, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:7768, offset: 0x011a2dce, size: 55 bytes, params: 2, frame: 15
return channelId != null && (guildId == null && maybeDismissNudge(channelId, 'channel_opened'));
}
}
global.__d(_fun46177, 5220, [6, 7, 15, 17, 18, 57, 1220, 5221, 1348, 1226, 1379, 4605, 3793, 1934, 4864, 5223, 661,
3, 5219, 1962, 683, 5224, 3829, 566, 694,
2]) /* metro module 5220, dependencies: [6, 7, 15, 17, 18, 57, 1220, 5221, 1348, 1226, 1379, 4605, 3793, 1934, 4864, 5223, 661, 3, 5219, 1962, 683, 5224, 3829, 566, 694, 2] */;