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

292 lines
13 KiB
TypeScript

/* Metro module 15835; source: modules/threads/ThreadManager.tsx; dependencies: [6, 7, 15, 17, 18, 1226, 1379, 566, 694, 9621, 4860, 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 AuthenticationStore from '../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import AutomaticLifecycleManager from '../../lib/AutomaticLifecycleManager.tsx'; /* Metro dependency 4860 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun121750(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:6, offset: 0x02550503, size: 280 bytes, params: 8, frame: 18
const _arrayLikeToArray_121753 = 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 = AutomaticLifecycleManager;
value = _fun121757(value);
value = new value();
(FileImportTrackerModule).fileFinishedImporting('modules/threads/ThreadManager.tsx');
exports.default = value;
function _createForOfIteratorHelperLoose_121751(a0, a1) { // fn#121751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:170, offset: 0x0255061b, size: 372 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun121752;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_121753(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_121753(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_121753(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun121752;
}
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 _fun121752() { // fn#121752, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:741, 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 _isNativeReflectConstruct_121754() { // fn#121754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:1080, offset: 0x0255078f, size: 98 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_121754_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun121757(a0) { // fn#121757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:1283, offset: 0x025507f1, size: 122 bytes, params: 2, frame: 16
const ThreadManager2 = ThreadManager;
Inherits(ThreadManager2, a0);
return CreateClass(ThreadManager2, [{key: 'handleChannelDelete', value: value_121759}, {key: 'handleMessageCreate',
value: value_121761}, {key: 'handleGuildDelete', value: value_121762}]);
function ThreadManager(a0) { // fn#121758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:1295, offset: 0x0255086b, size: 167 bytes, params: 2, frame: 19
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let binding = env1_2;
binding(this, ThreadManager);
const items2 = [];
arraySpread(items2, value, 0, items2);
value = env1_5(ThreadManager);
binding = env1_4;
if (_isNativeReflectConstruct_121754()) {
Reflect = global.Reflect;
value = Reflect.construct(value, items2, env1_5(this).constructor);
r0 = value;
} else {
value = value.apply(this, items2);
r0 = value;
}
value = binding(this, r0);
value.actions = {CHANNEL_DELETE: value.handleChannelDelete, MESSAGE_CREATE: value.handleMessageCreate,
GUILD_DELETE: value.handleGuildDelete};
return value;
}
function value_121759({channel}) { // fn#121759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:1717, offset: 0x02550912, size: 111 bytes, params: 2, frame: 14
var environment;
var value;
var channelStoreBinding;
if (channel.guild_id != null) {
value = environment.__proto__;
channelStoreBinding = ChannelStore;
if (channelStoreBinding.getAllThreadsForParent(channel.id).length > 0) {
(importDefault(566) /* metro dependency 566: flux */).Emitter.batched(_fun121760);
}
}
function _fun121760() { // fn#121760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:1834, offset: 0x02550981, size: 99 bytes, params: 1, frame: 19
var r2;
var value5;
var defaultImport;
var value6;
const value3 = _createForOfIteratorHelperLoose_121751(env0_0);
const value4 = value3();
let done = value4.done;
if (!done) {
for (r2 = value4; true; r2 = value6) {
value5 = r2.value;
defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
defaultImport.dispatch({type: 'THREAD_DELETE', channel: value5});
value6 = value3();
done = value6.done;
if (done) {
break;
}
}
}
}
}
function value_121761({channelId, message}) { // fn#121761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:2007, offset: 0x025509e4, size: 240 bytes, params: 2, frame: 17
var r4;
var Date;
var value5;
var date;
var time;
let value = environment.__proto__;
const channel = ChannelStore.getChannel(channelId);
const id = message.author?.id;
const authenticationStoreBinding = AuthenticationStore;
const getId = authenticationStoreBinding.getId;
if (id === Reflect.apply(getId, authenticationStoreBinding, [])) {
if (channel != null) {
if (channel.isActiveThread()) {
Date = global.Date;
r4 = channel.threadMetadata?.archiveTimestamp ?? 0;
value5 = Object.create(Date.prototype, {constructor: {value: Date}});
date = new Date();
time = (date instanceof Object ? date : value5).getTime();
Date = global.Date;
if (Date.now() - time < 5000) {
value = importDefault(9621) /* metro dependency 9621: ForumActionCreators */;
value.resort(channel.parent_id);
}
}
}
}
}
function value_121762({guild}) { // fn#121762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:2320, offset: 0x02550ad4, size: 109 bytes, params: 2, frame: 14
var environment;
var value;
var channelStoreBinding;
if (!guild.unavailable) {
value = environment.__proto__;
channelStoreBinding = ChannelStore;
if (channelStoreBinding.getAllThreadsForGuild(guild.id).length !== 0) {
(importDefault(566) /* metro dependency 566: flux */).Emitter.batched(_fun121763);
}
}
function _fun121763() { // fn#121763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:2434, offset: 0x02550981, size: 99 bytes, params: 1, frame: 19
var r2;
var value5;
var defaultImport;
var value6;
const value3 = _createForOfIteratorHelperLoose_121751(env0_0);
const value4 = value3();
let done = value4.done;
if (!done) {
for (r2 = value4; true; r2 = value6) {
value5 = r2.value;
defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
defaultImport.dispatch({type: 'THREAD_DELETE', channel: value5});
value6 = value3();
done = value6.done;
if (done) {
break;
}
}
}
}
}
}
}
global.__d(_fun121750, 15835, [6, 7, 15, 17, 18, 1226, 1379, 566, 694, 9621, 4860,
2]) /* metro module 15835, dependencies: [6, 7, 15, 17, 18, 1226, 1379, 566, 694, 9621, 4860, 2] */;