decord/beta/source/modules/channel_settings/useGetOrFetchChannelOverwriteUsers.tsx

212 lines
6.3 KiB
TypeScript
Raw Permalink Normal View History

2026-10-12 16:32:48 +00:00
// Module ID: 17589
// Function ID: 17590
// Name: useGetOrFetchChannelOverwriteUsers
2026-10-12 16:32:48 +00:00
// Dependencies: [32, 19, 2125, 1390, 1998, 558, 576, 504, 17590, 6098, 1388, 2]
2026-10-12 16:32:48 +00:00
// Module 17589 (useGetOrFetchChannelOverwriteUsers)
import GlobalUtils from "GlobalUtils" /* 1388 */;
import GuildActionCreatorsDefault from "GuildActionCreators" /* 6098 */;
import createAggregatorDefault from "createAggregator" /* 17590 */;
2026-10-02 13:37:24 +00:00
import _slicedToArray_mod from "_slicedToArray" /* 32 */;
2026-10-01 14:13:23 +00:00
import react_mod from "react" /* 19 */;
2026-10-12 16:32:48 +00:00
import GuildMemberStore from "GuildMemberStore" /* 2125 */;
import UserStore from "UserStore" /* 1390 */;
2026-10-02 13:37:24 +00:00
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
2026-10-01 14:13:23 +00:00
import size from "module_2" /* 2 */;
const require = globalThis.__r;
2026-10-01 14:13:23 +00:00
let _require;
2026-10-12 16:32:48 +00:00
const f130636 = (id) => id.id;
2026-10-02 13:37:24 +00:00
let _slicedToArray = _slicedToArray_mod;
2026-10-01 14:13:23 +00:00
let react = react_mod;
2026-10-12 16:32:48 +00:00
let tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useGetOrFetchChannelOverwriteUsers(arg0, arg1) {
2026-10-02 13:37:24 +00:00
let closure_0;
let first;
let first1;
2026-10-12 16:32:48 +00:00
let items5;
2026-10-02 13:37:24 +00:00
let length;
let tmp10;
let tmp6;
let tmp7;
_require = arg0;
let tmp = _require;
let tmp2 = first1;
let obj = require("react");
const cResult = obj.c(17);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [GuildMemberStore];
cResult[0] = items;
first = items;
} else {
first = cResult[0];
}
if (cResult[1] !== arg0) {
const fn = function f() {
return GuildMemberStore.getMemberIds(closure_0);
};
const items1 = [arg0];
cResult[1] = arg0;
cResult[2] = fn;
cResult[3] = items1;
tmp7 = items1;
tmp6 = fn;
} else {
tmp6 = cResult[2];
tmp7 = cResult[3];
}
const tmpResult = tmp(tmp2[7]);
const stateFromStoresArray = tmpResult.useStateFromStoresArray(first, tmp6, tmp7);
if (cResult[4] === stateFromStoresArray) {
let tmp9;
if (cResult[5] === arg1) {
tmp9 = cResult[6];
}
2026-10-12 16:32:48 +00:00
const tmp14 = _slicedToArray(tmp9, 2);
first1 = tmp14[0];
_slicedToArray = tmp16;
2026-10-02 13:37:24 +00:00
if (cResult[9] === arg0) {
2026-10-12 16:32:48 +00:00
let tmp17;
2026-10-02 13:37:24 +00:00
let tmp18;
2026-10-12 16:32:48 +00:00
let tmp21;
let tmp23;
2026-10-02 13:37:24 +00:00
let tmp24;
2026-10-12 16:32:48 +00:00
if (cResult[10] === tmp14[1]) {
tmp17 = cResult[11];
tmp18 = cResult[12];
2026-10-02 13:37:24 +00:00
}
2026-10-12 16:32:48 +00:00
const effect = react.useEffect(tmp17, tmp18);
2026-10-02 13:37:24 +00:00
const _Symbol = Symbol;
if (cResult[13] === Symbol.for("react.memo_cache_sentinel")) {
const items2 = [UserStore];
cResult[13] = items2;
2026-10-12 16:32:48 +00:00
tmp21 = items2;
2026-10-02 13:37:24 +00:00
} else {
2026-10-12 16:32:48 +00:00
tmp21 = cResult[13];
2026-10-02 13:37:24 +00:00
}
if (cResult[14] !== first1) {
2026-10-12 16:32:48 +00:00
const fn3 = function p() {
const mapped = first1.map(UserStore.getUser);
return mapped.filter(GlobalUtils.isNotNullish);
};
2026-10-02 13:37:24 +00:00
const items3 = [first1];
cResult[14] = first1;
2026-10-12 16:32:48 +00:00
cResult[15] = fn3;
2026-10-02 13:37:24 +00:00
cResult[16] = items3;
2026-10-12 16:32:48 +00:00
class S {
2026-10-02 13:37:24 +00:00
constructor() {
let tmp2 = length.length > 0;
const tmp = length;
if (tmp2) {
tmp2 = null != closure_0;
}
if (tmp2) {
const obj = GuildActionCreatorsDefault;
const membersById = obj.requestMembersById(closure_0, tmp, false);
}
}
}
2026-10-12 16:32:48 +00:00
tmp23 = fn3;
2026-10-02 13:37:24 +00:00
} else {
2026-10-12 16:32:48 +00:00
tmp23 = cResult[15];
tmp24 = cResult[16];
2026-10-02 13:37:24 +00:00
}
const tmpResult2 = tmp(tmp2[7]);
2026-10-12 16:32:48 +00:00
return tmpResult2.useStateFromStoresArray(tmp21, tmp23, tmp24);
2026-10-02 13:37:24 +00:00
}
2026-10-12 16:32:48 +00:00
class S {
2026-10-02 13:37:24 +00:00
constructor() {
let tmp2 = length.length > 0;
const tmp = length;
if (tmp2) {
tmp2 = null != closure_0;
}
if (tmp2) {
const obj = GuildActionCreatorsDefault;
const membersById = obj.requestMembersById(closure_0, tmp, false);
}
}
}
2026-10-12 16:32:48 +00:00
const items4 = [tmp14[1], arg0];
2026-10-02 13:37:24 +00:00
cResult[9] = arg0;
2026-10-12 16:32:48 +00:00
cResult[10] = tmp14[1];
cResult[11] = S;
2026-10-02 13:37:24 +00:00
cResult[12] = items4;
2026-10-12 16:32:48 +00:00
tmp18 = items4;
tmp17 = S;
2026-10-02 13:37:24 +00:00
}
if (cResult[7] !== stateFromStoresArray) {
2026-10-12 16:32:48 +00:00
const fn2 = function y(arg0) {
return stateFromStoresArray.includes(arg0);
};
2026-10-02 13:37:24 +00:00
cResult[7] = stateFromStoresArray;
2026-10-12 16:32:48 +00:00
cResult[8] = fn2;
tmp10 = fn2;
2026-10-02 13:37:24 +00:00
} else {
2026-10-12 16:32:48 +00:00
tmp10 = cResult[8];
2026-10-02 13:37:24 +00:00
}
const tmp11 = stateFromStoresArray(tmp2[8]);
if (null == arg1) {
2026-10-12 16:32:48 +00:00
items5 = [];
2026-10-02 13:37:24 +00:00
} else {
2026-10-12 16:32:48 +00:00
const _Object = Object;
2026-10-02 13:37:24 +00:00
const values = Object.values(arg1);
const found = values.filter((type) => type.type === closure_1_0(stateFromStoresArray[4]).PermissionOverwriteType.MEMBER);
2026-10-12 16:32:48 +00:00
items5 = found.map(f130636);
2026-10-02 13:37:24 +00:00
}
2026-10-12 16:32:48 +00:00
const tmp11Result = tmp11(items5, tmp10);
2026-10-02 13:37:24 +00:00
cResult[4] = stateFromStoresArray;
cResult[5] = arg1;
cResult[6] = tmp11Result;
tmp9 = tmp11Result;
2026-10-12 16:32:48 +00:00
}) : (function useGetOrFetchChannelOverwriteUsers(arg0, arg1) {
2026-10-01 14:13:23 +00:00
let closure_0;
let first;
let length;
let stateFromStoresArray;
_require = arg0;
2026-10-01 14:13:23 +00:00
let closure_1 = arg1;
let obj = require("get initialized");
let items = [GuildMemberStore];
const items1 = [arg0];
2026-10-01 14:13:23 +00:00
stateFromStoresArray = obj.useStateFromStoresArray(items, () => GuildMemberStore.getMemberIds(closure_0), items1);
const items2 = [arg1, stateFromStoresArray];
2026-10-01 14:13:23 +00:00
let tmp2 = first(react.useMemo(() => {
let items;
const tmp = createAggregatorDefault;
if (null == closure_1) {
2026-10-01 14:13:23 +00:00
items = [];
} else {
const _Object = Object;
const values = Object.values(tmp2);
const found = values.filter((type) => type.type === closure_1_0(stateFromStoresArray[4]).PermissionOverwriteType.MEMBER);
2026-10-12 16:32:48 +00:00
items = found.map(f130636);
}
2026-10-01 14:13:23 +00:00
return tmp(items, (arg0) => stateFromStoresArray.includes(arg0));
}, items2), 2);
first = tmp2[0];
2026-10-01 14:13:23 +00:00
react = tmp4;
const items3 = [tmp4, arg0];
const effect = react.useEffect(() => {
let tmp2 = length.length > 0;
2026-10-01 14:13:23 +00:00
const tmp = length;
if (tmp2) {
tmp2 = null != closure_0;
}
if (tmp2) {
2026-10-01 14:13:23 +00:00
const obj = GuildActionCreatorsDefault;
const membersById = obj.requestMembersById(closure_0, tmp, false);
}
}, items3);
const items4 = [UserStore];
const items5 = [first];
2026-10-01 14:13:23 +00:00
const obj2 = require("get initialized");
return obj2.useStateFromStoresArray(items4, () => {
const mapped = first.map(UserStore.getUser);
return mapped.filter(GlobalUtils.isNotNullish);
}, items5);
2026-10-02 13:37:24 +00:00
});
const result = size.fileFinishedImporting("modules/channel_settings/useGetOrFetchChannelOverwriteUsers.tsx");
export default tmp2;