decord/alpha/source/modules/activities/utils/findActivityWithMostParticipants.tsx

57 lines
1.9 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 16406
// Function ID: 16407
2026-07-20 16:05:17 +00:00
// Name: findActivityWithMostParticipants
2026-10-09 10:00:15 +00:00
// Dependencies: [4719, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, findActivityWithMostNonBlockedOrIgnoredParticipants
2026-10-09 10:00:15 +00:00
// Module 16406 (findActivityWithMostParticipants)
import RelationshipStore_mod from "RelationshipStore" /* 4719 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
let RelationshipStore = RelationshipStore_mod;
const result = size.fileFinishedImporting("modules/activities/utils/findActivityWithMostParticipants.tsx");
2026-07-20 16:05:17 +00:00
export default function findActivityWithMostParticipants(arr) {
2026-10-03 08:58:59 +00:00
let tmp = null;
if (0 !== arr.length) {
let first;
if (1 === arr.length) {
first = arr[0];
} else {
first = arr.reduce((userIds, userIds2) => {
let tmp = userIds;
if (userIds.userIds.size < userIds2.userIds.size) {
tmp = userIds2;
}
return tmp;
}, arr[0]);
}
tmp = first;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
return tmp;
2026-07-20 16:05:17 +00:00
};
export const findActivityWithMostNonBlockedOrIgnoredParticipants = function findActivityWithMostNonBlockedOrIgnoredParticipants(embeddedActivitiesForChannel) {
2026-10-03 08:58:59 +00:00
let blockedOrIgnored;
let length;
length = embeddedActivitiesForChannel.length;
if (0 === length) {
2026-07-20 16:05:17 +00:00
return null;
} else if (1 === length) {
return embeddedActivitiesForChannel[0];
} else {
2026-07-23 10:11:24 +00:00
let items = [embeddedActivitiesForChannel[0], ];
2026-07-20 16:05:17 +00:00
const items1 = [];
2026-10-03 08:58:59 +00:00
HermesBuiltin.arraySpread(items1, embeddedActivitiesForChannel[0].userIds, 0);
items[1] = items1.map((item) => !RelationshipStore.isBlockedOrIgnored(item)).length;
[RelationshipStore, length] = items;
2026-07-20 16:05:17 +00:00
const item = embeddedActivitiesForChannel.forEach((userIds) => {
const items = [...userIds.userIds];
length = items.filter((item) => !blockedOrIgnored.isBlockedOrIgnored(item)).length;
2026-07-23 10:11:24 +00:00
if (length > length) {
2026-10-03 08:58:59 +00:00
RelationshipStore = userIds;
2026-07-23 10:11:24 +00:00
}
2026-07-20 16:05:17 +00:00
});
2026-10-03 08:58:59 +00:00
return RelationshipStore;
2026-07-20 16:05:17 +00:00
}
};