decord/source/modules/icymi/useICYMIItems.tsx

224 lines
7.6 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 15811
// Function ID: 15812
2026-07-20 16:05:17 +00:00
// Name: createItem
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 9081, 7627, 589, 9094, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 15811 (createItem)
import MessageEmbedTypes from "MessageEmbedTypes" /* 7627 */;
import closure_3 from "noop" /* 19 */;
import closure_4 from "filterStaffGuild" /* 9081 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
function createItem(id, type, arg2) {
2026-07-20 16:05:17 +00:00
type = type.type;
2026-08-24 06:08:38 +00:00
if (MessageEmbedTypes.ICYMIItemTypes.MESSAGE === type) {
2026-07-20 16:05:17 +00:00
if (type.message.id === type.message.channel_id) {
if (null != type.threadChannel) {
2026-07-29 08:29:29 +00:00
let obj = { id: null, timestamp: null, channelType: null, data: null, score: null, debugScore: null, unread: null };
obj[0] = id.id;
2026-07-20 16:05:17 +00:00
const _Date5 = Date;
2026-07-29 08:29:29 +00:00
obj[1] = Date.now();
obj[2] = id.data.channel_type;
obj = { kind: "forumThread", message: null, threadChannel: null };
({ message: obj9[1], threadChannel: obj9[2] } = type);
obj[3] = obj;
obj[4] = id.score;
2026-07-20 16:05:17 +00:00
const _JSON5 = JSON;
2026-07-29 08:29:29 +00:00
obj[5] = JSON.stringify(id.score_components);
obj[6] = arg2;
2026-08-24 06:08:38 +00:00
obj1 = obj;
2026-07-20 16:05:17 +00:00
}
return obj1;
}
2026-07-29 08:29:29 +00:00
obj1 = { id: null, timestamp: null, channelType: null, data: null, score: null, debugScore: null, unread: null };
obj1[0] = id.id;
2026-07-20 16:05:17 +00:00
const _Date4 = Date;
2026-07-29 08:29:29 +00:00
obj1[1] = Date.now();
obj1[2] = id.data.channel_type;
const obj2 = { kind: "message", message: null, mentioned: null, messageContext: null };
obj2[1] = type.message;
obj2[2] = id.data.has_mention;
obj2[3] = id.data.message_context;
obj1[3] = obj2;
obj1[4] = id.score;
2026-07-20 16:05:17 +00:00
const _JSON4 = JSON;
2026-07-29 08:29:29 +00:00
obj1[5] = JSON.stringify(id.score_components);
obj1[6] = arg2;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
if (tmp(7627).ICYMIItemTypes.ACTIVITY !== type) {
if (tmp(7627).ICYMIItemTypes.CUSTOM_STATUS !== type) {
if (tmp(7627).ICYMIItemTypes.GUILD_EVENT === type) {
2026-07-29 08:29:29 +00:00
const obj3 = { id: null, timestamp: null, data: null, score: null, debugScore: null, unread: null };
obj3[0] = id.id;
2026-07-20 16:05:17 +00:00
const _Date2 = Date;
2026-07-29 08:29:29 +00:00
obj3[1] = Date.now();
const obj4 = { kind: "guildEvent", eventId: null };
obj4[1] = type.event_id;
obj3[2] = obj4;
obj3[3] = id.score;
2026-07-20 16:05:17 +00:00
const _JSON2 = JSON;
2026-07-29 08:29:29 +00:00
obj3[4] = JSON.stringify(id.score_components);
obj3[5] = arg2;
2026-07-20 16:05:17 +00:00
return obj3;
2026-08-24 06:08:38 +00:00
} else if (tmp(7627).ICYMIItemTypes.RECOMMENDED_GUILDS === type) {
2026-07-29 08:29:29 +00:00
obj = { id: null, timestamp: null, data: null, score: null, debugScore: null, unread: null };
obj[0] = id.id;
2026-07-20 16:05:17 +00:00
const _Date = Date;
2026-07-29 08:29:29 +00:00
obj[1] = Date.now();
obj[2] = { kind: "recommendedGuilds" };
obj[3] = id.score;
2026-07-20 16:05:17 +00:00
const _JSON = JSON;
2026-07-29 08:29:29 +00:00
obj[4] = JSON.stringify(id.score_components);
obj[5] = arg2;
2026-07-20 16:05:17 +00:00
return obj;
} else {
return null;
}
}
}
2026-07-29 08:29:29 +00:00
const obj5 = { id: null, timestamp: null, data: null, score: null, debugScore: null, unread: null };
obj5[0] = id.id;
2026-07-20 16:05:17 +00:00
const _Date3 = Date;
2026-07-29 08:29:29 +00:00
obj5[1] = Date.now();
const obj6 = { kind: "contentInventory", content: null };
obj6[1] = type.activity;
obj5[2] = obj6;
obj5[3] = id.score;
2026-07-20 16:05:17 +00:00
const _JSON3 = JSON;
2026-07-29 08:29:29 +00:00
obj5[4] = JSON.stringify(id.score_components);
obj5[5] = arg2;
return obj5;
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/icymi/useICYMIItems.tsx");
2026-07-20 16:05:17 +00:00
export default function useICYMIItems() {
2026-07-29 08:29:29 +00:00
let obj = stateFromStores1(589);
2026-08-24 06:08:38 +00:00
const items = [closure_4];
2026-07-29 08:29:29 +00:00
const stateFromStores = obj.useStateFromStores(items, () => store.getUnreadDisplayItems());
2026-08-24 06:08:38 +00:00
const items1 = [closure_4];
2026-07-29 08:29:29 +00:00
stateFromStores1 = stateFromStores1(589).useStateFromStores(items1, () => store.getReadDisplayItems());
const obj2 = stateFromStores1(589);
2026-08-24 06:08:38 +00:00
const items2 = [closure_4];
2026-07-29 08:29:29 +00:00
const stateFromStores2 = stateFromStores1(589).useStateFromStores(items2, () => store.getNextIndexToHydrate());
const obj3 = stateFromStores1(589);
2026-08-24 06:08:38 +00:00
const items3 = [closure_4];
2026-07-29 08:29:29 +00:00
const stateFromStoresObject = stateFromStores1(589).useStateFromStoresObject(items3, () => store.getHydratedItems());
const obj4 = stateFromStores1(589);
2026-08-24 06:08:38 +00:00
const items4 = [closure_4];
2026-07-29 08:29:29 +00:00
const stateFromStores3 = stateFromStores1(589).useStateFromStores(items4, () => store.getMissingItems());
2026-07-20 16:05:17 +00:00
const items5 = [stateFromStores1];
const effect = React.useEffect(() => {
2026-07-23 10:11:24 +00:00
stateFromStores1 = Date.now() + stateFromStores1.length;
2026-08-24 06:08:38 +00:00
closure_1_1(closure_1_2[4]).ackGravityItems(stateFromStores1.map((id) => {
closure_0 = tmp - 1;
2026-07-20 16:05:17 +00:00
return { id: id.id, timestamp: +closure_0 };
}, true));
}, items5);
const items6 = [];
let num = 0;
if (0 < stateFromStores.length) {
2026-07-29 08:29:29 +00:00
let num3 = 0;
let num4 = 0;
num = 0;
if (0 < stateFromStores2) {
while (true) {
let tmp6 = stateFromStores[num3];
let tmp7 = num3;
let tmp8 = num4;
if (!stateFromStores3[tmp6.id]) {
let tmp9 = stateFromStoresObject[tmp6.id];
let tmp10 = null == tmp9;
if (tmp10) {
let tmp11 = stateFromStores1;
let tmp12 = dependencyMap;
2026-08-24 06:08:38 +00:00
tmp10 = tmp6.type === stateFromStores1(7627).ICYMIItemTypes.MESSAGE;
2026-07-29 08:29:29 +00:00
}
if (tmp10) {
let message_context = tmp6.data.message_context;
let reference_message_id;
if (message_context != null) {
reference_message_id = message_context.reference_message_id;
}
tmp10 = null != reference_message_id;
}
if (tmp10) {
tmp9 = stateFromStoresObject[tmp6.data.message_id];
}
if (null != tmp9) {
let tmp14 = createItem;
let tmp15 = createItem(tmp6, tmp9, true);
if (null != tmp15) {
let arr = items6.push(tmp15);
}
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
let sum = num4 + 1;
let sum1 = num3 + 1;
num = sum;
if (sum1 >= stateFromStores.length) {
break;
} else {
num3 = sum1;
num4 = sum;
num = sum;
if (sum >= stateFromStores2) {
break;
2026-07-20 16:05:17 +00:00
}
}
}
}
}
2026-07-29 08:29:29 +00:00
const items7 = [];
2026-07-20 16:05:17 +00:00
if (0 < stateFromStores1.length) {
2026-07-29 08:29:29 +00:00
let num5 = 0;
if (num < stateFromStores2) {
while (true) {
let tmp19 = stateFromStores1[num5];
let tmp20 = num5;
let tmp21 = num;
if (!stateFromStores3[tmp19.id]) {
let tmp22 = stateFromStoresObject[tmp19.id];
let tmp23 = null == tmp22;
if (tmp23) {
let tmp24 = stateFromStores1;
let tmp25 = dependencyMap;
2026-08-24 06:08:38 +00:00
tmp23 = tmp19.type === stateFromStores1(7627).ICYMIItemTypes.MESSAGE;
2026-07-29 08:29:29 +00:00
}
if (tmp23) {
let message_context2 = tmp19.data.message_context;
let reference_message_id1;
if (message_context2 != null) {
reference_message_id1 = message_context2.reference_message_id;
}
tmp23 = null != reference_message_id1;
}
if (tmp23) {
tmp22 = stateFromStoresObject[tmp19.data.message_id];
}
if (null != tmp22) {
let tmp27 = createItem;
let tmp28 = createItem(tmp19, tmp22, false);
if (null != tmp28) {
arr = items7.push(tmp28);
}
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
let sum2 = num5 + 1;
if (sum2 >= stateFromStores1.length) {
break;
} else {
num = num + 1;
num5 = sum2;
if (num >= stateFromStores2) {
break;
2026-07-20 16:05:17 +00:00
}
}
}
}
}
obj = { unreadItems: items6, readItems: items7, allUnreadItemsHydrated: stateFromStores2 >= stateFromStores.length };
return obj;
};