2026-09-28 16:18:32 +00:00
|
|
|
// Module ID: 11522
|
|
|
|
|
// Function ID: 11523
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: useActivityShelfData
|
2026-09-28 16:18:32 +00:00
|
|
|
// Dependencies: [19, 1372, 8322, 2044, 504, 6589, 1370, 8713, 1364, 8709, 2]
|
2026-09-26 17:57:22 +00:00
|
|
|
// Exports: useActivityShelfData
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-09-28 16:18:32 +00:00
|
|
|
// Module 11522 (useActivityShelfData)
|
2026-09-26 17:57:22 +00:00
|
|
|
import GlobalUtils from "GlobalUtils" /* 1370 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import react from "react" /* 19 */;
|
|
|
|
|
import UserStore_mod from "UserStore" /* 1372 */;
|
2026-09-28 16:18:32 +00:00
|
|
|
import TestModeStore from "TestModeStore" /* 8322 */;
|
|
|
|
|
import EmbeddedActivitiesStore from "EmbeddedActivitiesStore" /* 2044 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
|
|
|
|
const require = globalThis.__r;
|
2026-10-01 14:13:23 +00:00
|
|
|
let _require, application;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
let UserStore = UserStore_mod;
|
2026-09-18 19:45:33 +00:00
|
|
|
const result = size.fileFinishedImporting("modules/activities/useActivityShelfData.tsx");
|
|
|
|
|
|
2026-09-26 17:57:22 +00:00
|
|
|
export const useActivityShelfData = function useActivityShelfData(guildId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let closure_4;
|
|
|
|
|
let memo;
|
|
|
|
|
let memo1;
|
|
|
|
|
let stateFromStoresArray;
|
2026-09-26 17:57:22 +00:00
|
|
|
_require = guildId;
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp2 = stateFromStoresArray;
|
|
|
|
|
let obj = require("get initialized");
|
2026-09-18 19:45:33 +00:00
|
|
|
let items = [UserStore];
|
2026-10-01 14:13:23 +00:00
|
|
|
const stateFromStores = obj.useStateFromStores(items, UserStore.getCurrentUser);
|
2026-09-18 19:45:33 +00:00
|
|
|
const items1 = [memo1];
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj2 = require("get initialized");
|
|
|
|
|
stateFromStoresArray = obj2.useStateFromStoresArray(items1, () => EmbeddedActivitiesStore.getShelfActivities(guildId));
|
2026-09-18 19:45:33 +00:00
|
|
|
const items2 = [memo];
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj3 = require("get initialized");
|
|
|
|
|
const stateFromStores1 = obj3.useStateFromStores(items2, () => memo.testModeEmbeddedApplicationId);
|
2026-09-18 19:45:33 +00:00
|
|
|
let mapped = stateFromStoresArray.map((application_id) => application_id.application_id);
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp6 = mapped;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != stateFromStores1) {
|
|
|
|
|
const items3 = [stateFromStores1];
|
2026-10-01 14:13:23 +00:00
|
|
|
HermesBuiltin.arraySpread(items3, mapped, 1);
|
|
|
|
|
tmp6 = items3;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const tmp10 = stateFromStores(tmp2[5])(tmp6);
|
|
|
|
|
UserStore = tmp10;
|
|
|
|
|
const items4 = [tmp10];
|
2026-09-18 19:45:33 +00:00
|
|
|
memo = stateFromStores1.useMemo(() => closure_4.filter(GlobalUtils.isNotNullish), items4);
|
|
|
|
|
const items5 = [memo, stateFromStores1];
|
|
|
|
|
memo1 = stateFromStores1.useMemo(() => {
|
|
|
|
|
if (null != stateFromStores1) {
|
|
|
|
|
if (memo.length > 0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
if (memo[0].id === tmp) {
|
|
|
|
|
if (null != memo[0].embeddedActivityConfig) {
|
|
|
|
|
const items = [{ activity: memo[0].embeddedActivityConfig, application: memo[0] }];
|
|
|
|
|
const obj = { activity: memo[0].embeddedActivityConfig, application: memo[0] };
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, items5);
|
|
|
|
|
const items6 = [stateFromStoresArray, memo];
|
|
|
|
|
const memo2 = stateFromStores1.useMemo(() => {
|
|
|
|
|
const mapped = stateFromStoresArray.map((activity) => {
|
2026-10-01 14:13:23 +00:00
|
|
|
let closure_0 = activity;
|
|
|
|
|
const found = memo.find((id) => id.id === application_id.application_id);
|
2026-09-18 19:45:33 +00:00
|
|
|
let tmp2 = null;
|
|
|
|
|
if (null != found) {
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp2 = { activity, application: found };
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj = { activity, application: found };
|
|
|
|
|
}
|
|
|
|
|
return tmp2;
|
|
|
|
|
});
|
|
|
|
|
return mapped.filter(GlobalUtils.isNotNullish);
|
|
|
|
|
}, items6);
|
|
|
|
|
let nsfwAllowed;
|
2026-10-01 14:13:23 +00:00
|
|
|
const useMemo = stateFromStores1.useMemo;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (stateFromStores != null) {
|
|
|
|
|
nsfwAllowed = stateFromStores.nsfwAllowed;
|
|
|
|
|
}
|
|
|
|
|
const items7 = [nsfwAllowed, memo2, memo1];
|
2026-10-01 14:13:23 +00:00
|
|
|
return useMemo(() => {
|
2026-09-18 19:45:33 +00:00
|
|
|
const items = [...memo2];
|
|
|
|
|
const found = items.filter((activity) => {
|
|
|
|
|
let supported_platforms = activity.activity.supported_platforms;
|
|
|
|
|
if (supported_platforms == null) {
|
|
|
|
|
supported_platforms = [];
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const includes = supported_platforms.includes;
|
|
|
|
|
const tmp = stateFromStores(stateFromStoresArray[7]);
|
|
|
|
|
const obj = guildId(stateFromStoresArray[8]);
|
|
|
|
|
return includes(tmp(obj.getOS()));
|
2026-09-18 19:45:33 +00:00
|
|
|
});
|
|
|
|
|
const found1 = found.filter((activity) => {
|
|
|
|
|
const requires_age_gate = activity.activity.requires_age_gate;
|
|
|
|
|
let tmp = !requires_age_gate;
|
|
|
|
|
if (requires_age_gate) {
|
|
|
|
|
nsfwAllowed = undefined;
|
|
|
|
|
if (stateFromStores != null) {
|
|
|
|
|
nsfwAllowed = stateFromStores.nsfwAllowed;
|
|
|
|
|
}
|
|
|
|
|
tmp = true === nsfwAllowed;
|
|
|
|
|
}
|
|
|
|
|
if (!tmp) {
|
|
|
|
|
let nsfwAllowed1;
|
|
|
|
|
if (stateFromStores != null) {
|
|
|
|
|
nsfwAllowed1 = stateFromStores.nsfwAllowed;
|
|
|
|
|
}
|
|
|
|
|
tmp = null == nsfwAllowed1;
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
});
|
|
|
|
|
return found1.filter((application) => {
|
|
|
|
|
nsfwAllowed = undefined;
|
2026-10-01 14:13:23 +00:00
|
|
|
application = application.application;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (nsfwAllowed != null) {
|
|
|
|
|
nsfwAllowed = nsfwAllowed.nsfwAllowed;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const tmp2 = false === nsfwAllowed && stateFromStores(stateFromStoresArray[9])(application.id);
|
2026-09-18 19:45:33 +00:00
|
|
|
return !tmp2;
|
|
|
|
|
});
|
|
|
|
|
}, items7);
|
2026-09-26 17:57:22 +00:00
|
|
|
};
|