28 lines
937 B
TypeScript
28 lines
937 B
TypeScript
// Metro module 15058 (f15059).
|
|
import RelationshipStore from "../../../stores/RelationshipStore";
|
|
export default function findActivityWithMostParticipants(a0) {
|
|
const length2 = a0.length;
|
|
return length2 !== 0 ? length2 === 1 ? a0[0] : a0.reduce((acc, item) => acc.userIds.size < item.userIds.size ? item : acc, a0[0]) : null;
|
|
};
|
|
export function findActivityWithMostNonBlockedOrIgnoredParticipants(a0) {
|
|
const length2 = a0.length;
|
|
if (length2 === 0) {
|
|
return null;
|
|
}
|
|
if (length2 === 1) {
|
|
return a0[0];
|
|
}
|
|
let c21631_0, length;
|
|
const r5 = [a0[0], [...a0[0].userIds].map((item) => !RelationshipStore.isBlockedOrIgnored(item)).length];
|
|
c21631_0 = r5[0];
|
|
length = r5[1];
|
|
a0.forEach((item) => {
|
|
const length2 = [...item.userIds].filter((item) => !RelationshipStore.isBlockedOrIgnored(item)).length;
|
|
if (length2 > length) {
|
|
length = length2;
|
|
c21631_0 = item;
|
|
}
|
|
});
|
|
return c21631_0;
|
|
}
|