decord/source/modules/guild_onboarding/GuildOnboardingUtils.tsx

555 lines
19 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 5290
// Function ID: 5291
2026-07-29 08:29:29 +00:00
// Name: isChattableChannel
2026-08-24 06:08:38 +00:00
// Dependencies: [1391, 5226, 1981, 1910, 4024, 5291, 676, 4012, 589, 1403, 5292, 5293, 4029, 1370, 643, 1903, 5294, 2]
2026-07-20 16:05:17 +00:00
// Exports: getApplicationConnectionState, getChannelCoverageForOnboarding, getChattableDefaultChannels, getMinimumSetOfDefaultChannelIds, getProviderConnectionState, getSelectedChannelIds, getSelectedRoleIds, isBlockedByOnboarding, isChattableChannelId, isGuildOnboardingSettingsAvailable, showRulesInOnboarding, useChannelCoverageForOnboarding, useChattableDefaultChannels, useGuildOnboardingSettingsAvailable, useIsChattableChannel
2026-08-24 06:08:38 +00:00
// Module 5290 (isChattableChannel)
import shallowEqualDefault from "shallowEqual" /* 643 */;
import isDiscordFrontendDevelopment from "isDiscordFrontendDevelopment" /* 1370 */;
import hasFlagAll from "hasFlag" /* 1403 */;
import applyOverwritesAll from "applyOverwrites" /* 4029 */;
import useCanChannelBeDefault from "useCanChannelBeDefault" /* 5293 */;
import closure_4 from "ensureGuildLoaded" /* 1391 */;
import closure_5 from "set" /* 5226 */;
import closure_6 from "comparator" /* 1981 */;
import { GUILD_SELECTABLE_CHANNELS_KEY as closure_7 } from "comparator" /* 1981 */;
import closure_8 from "createGuildRecordFromRust" /* 1910 */;
import closure_9 from "getUncachedChannelPermissions" /* 4024 */;
import { OnboardingConnectionType } from "serverPromptToClientPrompt" /* 5291 */;
import ME from "ME" /* 676 */;
import { GuildMemberFlags } from "GuildMemberFlags" /* 4012 */;
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 isChattableChannel(guild_id) {
let tmp = null != guild_id;
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-08-24 06:08:38 +00:00
const canChannelBeDefaultResult = useCanChannelBeDefault.canChannelBeDefault(guild_id.guild_id, guild_id.id);
2026-07-29 08:29:29 +00:00
if (!canChannelBeDefaultResult) {
tmp = canChannelBeDefaultResult;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const isForumChannelResult = guild_id.isForumChannel();
2026-08-24 06:08:38 +00:00
const canEveryoneRole = applyOverwritesAll.canEveryoneRole;
2026-07-20 16:05:17 +00:00
let SEND_MESSAGES_IN_THREADS = closure_12;
if (isForumChannelResult) {
SEND_MESSAGES_IN_THREADS = SEND_MESSAGES_IN_THREADS.SEND_MESSAGES_IN_THREADS;
2026-07-29 08:29:29 +00:00
let canEveryoneRoleResult = canEveryoneRole(SEND_MESSAGES_IN_THREADS, guild_id);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
canEveryoneRoleResult = canEveryoneRole(SEND_MESSAGES_IN_THREADS.SEND_MESSAGES, guild_id);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const tmp7 = applyOverwritesAll;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const obj = useCanChannelBeDefault;
2026-07-20 16:05:17 +00:00
}
return tmp;
}
2026-07-29 08:29:29 +00:00
function getFlattenedDefaultChannels(closure_0, arr, arg2, fn) {
2026-07-20 16:05:17 +00:00
fn = arg2;
if (arg2 === undefined) {
2026-07-29 08:29:29 +00:00
fn = function u(arg0) {
return arg0;
2026-07-20 16:05:17 +00:00
};
}
2026-07-29 08:29:29 +00:00
let fn2 = fn;
if (fn === undefined) {
fn2 = function s(fnResult) {
2026-07-20 16:05:17 +00:00
return true;
};
}
const items = [];
2026-07-29 08:29:29 +00:00
const iter = store.getChannels(closure_0)[closure_7][Symbol.iterator]();
while (iter !== undefined) {
let channel = iter.next().channel;
let obj = channel;
let tmp = require;
let tmp2 = dependencyMap;
2026-08-24 06:08:38 +00:00
let obj2 = useCanChannelBeDefault;
2026-07-29 08:29:29 +00:00
if (obj2.canChannelBeDefault(channel.guild_id, channel.id)) {
let tmp3 = channel;
if (!arr.includes(obj.id)) {
let tmp5 = channel;
if (!obj.isThread()) {
let tmp6 = channel;
if (null != obj.parent_id) {
let tmp7 = channel;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
} else {
let tmp4 = channel;
}
let tmp8 = channel;
let fnResult = fn(obj);
let tmp10 = fnResult;
if (fn2(fnResult)) {
let tmp11 = fnResult;
arr = items.push(tmp10);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
continue;
2026-07-20 16:05:17 +00:00
}
return items;
}
function areStatesEqual(arg0, arg1) {
2026-07-29 08:29:29 +00:00
let tmp = arg0[0].length === arg1[0].length && arg0[1].length === arg1[1].length;
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-08-24 06:08:38 +00:00
tmp = shallowEqualDefault(arg0[0], arg1[0]) && shallowEqualDefault(arg0[1], arg1[1]);
2026-07-29 08:29:29 +00:00
const tmp2 = importDefault;
2026-08-24 06:08:38 +00:00
const tmp4 = shallowEqualDefault(arg0[0], arg1[0]) && shallowEqualDefault(arg0[1], arg1[1]);
2026-07-20 16:05:17 +00:00
}
return tmp;
}
2026-07-29 08:29:29 +00:00
({ GuildFeatures: unpackModuleId, Permissions: closure_12 } = ME);
2026-07-23 10:11:24 +00:00
let date = new Date(1682488800000);
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/guild_onboarding/GuildOnboardingUtils.tsx");
2026-07-20 16:05:17 +00:00
export const ONBOARDING_EPOCH = date;
export const useGuildOnboardingSettingsAvailable = function useGuildOnboardingSettingsAvailable(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
const items = [closure_8, closure_9];
2026-07-29 08:29:29 +00:00
return _require(589).useStateFromStores(items, () => {
2026-08-24 06:08:38 +00:00
const guild = closure_1_8.getGuild(closure_0);
2026-07-29 08:29:29 +00:00
let hasItem;
if (guild != null) {
2026-07-20 16:05:17 +00:00
const features = guild.features;
2026-08-24 06:08:38 +00:00
hasItem = features.has(closure_1_11.COMMUNITY);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp4 = hasItem;
2026-08-24 06:08:38 +00:00
const canResult = closure_1_9.can(closure_1_12.MANAGE_GUILD, guild);
2026-07-29 08:29:29 +00:00
if (tmp4) {
2026-07-20 16:05:17 +00:00
tmp4 = canResult;
}
if (tmp4) {
tmp4 = canResult1;
}
return tmp4;
});
};
2026-07-29 08:29:29 +00:00
export const isGuildOnboardingSettingsAvailable = function isGuildOnboardingSettingsAvailable(id) {
guild = guild.getGuild(id);
let hasItem;
if (guild != null) {
2026-07-20 16:05:17 +00:00
const features = guild.features;
2026-07-29 08:29:29 +00:00
hasItem = features.has(constants.COMMUNITY);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp4 = hasItem;
2026-08-24 06:08:38 +00:00
const canResult = closure_9.can(constants2.MANAGE_GUILD, guild);
2026-07-29 08:29:29 +00:00
if (tmp4) {
2026-07-20 16:05:17 +00:00
tmp4 = canResult;
}
if (tmp4) {
tmp4 = canResult1;
}
return tmp4;
};
export const isBlockedByOnboarding = function isBlockedByOnboarding(guild, selfMember) {
if (null != guild) {
const features = guild.features;
if (features.has(constants.GUILD_ONBOARDING)) {
if (null != selfMember) {
if (null != selfMember.joinedAt) {
const _Date = Date;
2026-08-24 06:08:38 +00:00
date = new Date(selfMember.joinedAt);
2026-07-20 16:05:17 +00:00
if (date < date) {
return false;
} else {
2026-07-29 08:29:29 +00:00
let num = selfMember.flags;
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
let hasFlagResult = hasFlagAll.hasFlag(num, GuildMemberFlags.STARTED_ONBOARDING);
2026-07-20 16:05:17 +00:00
if (hasFlagResult) {
2026-08-24 06:08:38 +00:00
hasFlagResult = !hasFlagAll.hasFlag(num, GuildMemberFlags.COMPLETED_ONBOARDING);
const tmp2Result = hasFlagAll;
2026-07-20 16:05:17 +00:00
}
return hasFlagResult;
}
}
}
return false;
}
}
return false;
};
export const showRulesInOnboarding = function showRulesInOnboarding(stateFromStores2, stateFromStores) {
let hasItem = null != stateFromStores2;
if (hasItem) {
const features = stateFromStores2.features;
hasItem = features.has(constants.MEMBER_VERIFICATION_MANUAL_APPROVAL);
}
if (hasItem) {
const features2 = stateFromStores2.features;
hasItem = features2.has(constants.MEMBER_VERIFICATION_GATE_ENABLED);
}
let tmp4 = !hasItem;
2026-07-29 08:29:29 +00:00
if (!hasItem) {
2026-07-20 16:05:17 +00:00
tmp4 = null != stateFromStores;
}
return tmp4;
};
2026-07-29 08:29:29 +00:00
export const getChannelCoverageForOnboarding = function getChannelCoverageForOnboarding(guildId, arr, defaultChannelIds) {
const mapped = store.getChannels(guildId)[closure_7].map((channel) => channel.channel);
let set;
set = new Set();
const item = arr.forEach((options) => {
options = options.options;
let item = options.forEach((channelIds) => {
if (channelIds != null) {
channelIds = channelIds.channelIds;
if (channelIds != null) {
const item = channelIds.forEach((arg0) => {
set.add(arg0);
});
}
}
});
});
const item1 = defaultChannelIds.forEach((arg0) => set.add(arg0));
const found = mapped.filter((isCategory) => {
const isCategoryResult = isCategory.isCategory();
let tmp2 = !isCategoryResult;
if (!isCategoryResult) {
tmp2 = !isCategory.isThread();
}
if (tmp2) {
tmp2 = !callback(table[10])(isCategory);
}
return tmp2;
});
const items = [
found.filter((id) => {
let hasItem = set.has(id.id);
if (!hasItem) {
hasItem = null != id.parent_id && set.has(id.parent_id);
const tmp3 = null != id.parent_id && set.has(id.parent_id);
}
return hasItem;
}),
found.filter((id) => {
let hasItem = set.has(id.id);
if (!hasItem) {
hasItem = null != id.parent_id && set.has(id.parent_id);
const tmp3 = null != id.parent_id && set.has(id.parent_id);
}
return !hasItem;
})
];
return items;
2026-07-20 16:05:17 +00:00
};
export const useChannelCoverageForOnboarding = function useChannelCoverageForOnboarding(arg0, arr, arr2) {
2026-07-29 08:29:29 +00:00
let set = arg0;
2026-08-24 06:08:38 +00:00
const items = [closure_6];
2026-07-29 08:29:29 +00:00
const obj = set(589);
2026-08-24 06:08:38 +00:00
const mapped = set(589).useStateFromStores(items, () => closure_1_6.getChannels(set))[closure_7].map((channel) => channel.channel);
2026-07-29 08:29:29 +00:00
set = undefined;
set = new Set();
let item = arr.forEach((options) => {
options = options.options;
let item = options.forEach((channelIds) => {
if (channelIds != null) {
channelIds = channelIds.channelIds;
if (channelIds != null) {
const item = channelIds.forEach((arg0) => {
set.add(arg0);
});
}
}
});
});
const item1 = arr2.forEach((arg0) => set.add(arg0));
const found = mapped.filter((isCategory) => {
const isCategoryResult = isCategory.isCategory();
let tmp2 = !isCategoryResult;
if (!isCategoryResult) {
tmp2 = !isCategory.isThread();
}
if (tmp2) {
tmp2 = !callback(table[10])(isCategory);
}
return tmp2;
});
const items1 = [
found.filter((id) => {
let hasItem = set.has(id.id);
if (!hasItem) {
hasItem = null != id.parent_id && set.has(id.parent_id);
const tmp3 = null != id.parent_id && set.has(id.parent_id);
}
return hasItem;
}),
found.filter((id) => {
let hasItem = set.has(id.id);
if (!hasItem) {
hasItem = null != id.parent_id && set.has(id.parent_id);
const tmp3 = null != id.parent_id && set.has(id.parent_id);
}
return !hasItem;
})
];
return items1;
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const isChattableChannelId = function isChattableChannelId(arg0) {
channel = channel.getChannel(arg0);
let tmp = null != channel;
if (tmp) {
2026-08-24 06:08:38 +00:00
const canChannelBeDefaultResult = useCanChannelBeDefault.canChannelBeDefault(channel.guild_id, channel.id);
2026-07-29 08:29:29 +00:00
if (!canChannelBeDefaultResult) {
tmp = canChannelBeDefaultResult;
} else {
const isForumChannelResult = channel.isForumChannel();
2026-08-24 06:08:38 +00:00
const canEveryoneRole = applyOverwritesAll.canEveryoneRole;
2026-07-29 08:29:29 +00:00
let SEND_MESSAGES_IN_THREADS = closure_12;
if (isForumChannelResult) {
SEND_MESSAGES_IN_THREADS = SEND_MESSAGES_IN_THREADS.SEND_MESSAGES_IN_THREADS;
let canEveryoneRoleResult = canEveryoneRole(SEND_MESSAGES_IN_THREADS, channel);
} else {
canEveryoneRoleResult = canEveryoneRole(SEND_MESSAGES_IN_THREADS.SEND_MESSAGES, channel);
}
2026-08-24 06:08:38 +00:00
const tmp7 = applyOverwritesAll;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
const obj2 = useCanChannelBeDefault;
2026-07-29 08:29:29 +00:00
}
return tmp;
2026-07-20 16:05:17 +00:00
};
export { isChattableChannel };
export const useIsChattableChannel = function useIsChattableChannel(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
const items = [closure_4];
2026-07-29 08:29:29 +00:00
return _require(589).useStateFromStores(items, () => {
2026-08-24 06:08:38 +00:00
const channel = closure_1_4.getChannel(callback);
let isNotNullishResult = callback(closure_1_3[13]).isNotNullish(channel);
2026-07-20 16:05:17 +00:00
if (isNotNullishResult) {
2026-07-29 08:29:29 +00:00
let tmp5 = null != channel;
if (tmp5) {
const canChannelBeDefaultResult = callback(tmp2[11]).canChannelBeDefault(channel.guild_id, channel.id);
if (!canChannelBeDefaultResult) {
tmp5 = canChannelBeDefaultResult;
} else {
const isForumChannelResult = channel.isForumChannel();
2026-08-24 06:08:38 +00:00
const canEveryoneRole = closure_1_2(tmp2[12]).canEveryoneRole;
let SEND_MESSAGES_IN_THREADS = closure_1_12;
2026-07-29 08:29:29 +00:00
if (isForumChannelResult) {
SEND_MESSAGES_IN_THREADS = SEND_MESSAGES_IN_THREADS.SEND_MESSAGES_IN_THREADS;
let canEveryoneRoleResult = canEveryoneRole(SEND_MESSAGES_IN_THREADS, channel);
} else {
canEveryoneRoleResult = canEveryoneRole(SEND_MESSAGES_IN_THREADS.SEND_MESSAGES, channel);
}
2026-08-24 06:08:38 +00:00
const tmp9 = closure_1_2(tmp2[12]);
2026-07-29 08:29:29 +00:00
}
const tmpResult = callback(tmp2[11]);
}
isNotNullishResult = tmp5;
2026-07-20 16:05:17 +00:00
}
return isNotNullishResult;
});
};
2026-08-24 06:08:38 +00:00
export const getMinimumSetOfDefaultChannelIds = function getMinimumSetOfDefaultChannelIds(closure_0, closure_1_4, onboardingPromptsForOnboarding, arg3) {
2026-07-20 16:05:17 +00:00
let fn = arg3;
if (arg3 === undefined) {
2026-07-29 08:29:29 +00:00
fn = function o() {
2026-07-20 16:05:17 +00:00
return true;
};
}
2026-08-24 06:08:38 +00:00
closure_2 = undefined;
let tmp = getFlattenedDefaultChannels(closure_0, closure_1_4, (id) => id.id, fn);
closure_2 = tmp;
const item = onboardingPromptsForOnboarding.forEach((required) => {
2026-07-20 16:05:17 +00:00
if (required.required) {
const first = required.options[0];
let channelIds;
2026-07-29 08:29:29 +00:00
if (first != null) {
2026-07-20 16:05:17 +00:00
channelIds = first.channelIds;
}
2026-07-29 08:29:29 +00:00
if (channelIds == null) {
2026-07-20 16:05:17 +00:00
channelIds = [];
}
const options = required.options;
2026-08-24 06:08:38 +00:00
const push = navigation.push;
2026-07-20 16:05:17 +00:00
const items = [];
HermesBuiltin.arraySpread(options.reduce((arg0, channelIds) => {
if (null == channelIds.channelIds) {
return [];
} else {
2026-07-29 08:29:29 +00:00
let tmp = arg0;
2026-08-24 06:08:38 +00:00
const arr = closure_1_16(closure_0, channelIds.channelIds, (id) => id.id, (arg0) => {
2026-07-29 08:29:29 +00:00
let tmp = callback(arg0);
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-29 08:29:29 +00:00
tmp = !closure_2.includes(arg0);
2026-07-20 16:05:17 +00:00
}
return tmp;
});
2026-07-29 08:29:29 +00:00
if (arr.length < arg0.length) {
tmp = arr;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
}, closure_1_16(closure_0, channelIds, (id) => id.id)), 0);
HermesBuiltin.apply(items, navigation);
let tmp = closure_1_16;
2026-07-23 10:11:24 +00:00
const tmp2 = closure_0;
2026-07-20 16:05:17 +00:00
}
});
return tmp;
};
2026-07-29 08:29:29 +00:00
export const getChattableDefaultChannels = function getChattableDefaultChannels(closure_0, arr) {
arr = getFlattenedDefaultChannels(closure_0, arr);
let obj = {};
for (const item10015 of tmp) {
obj[item10015.channel.id] = item10015;
continue;
2026-07-20 16:05:17 +00:00
}
const items = [
2026-07-23 10:11:24 +00:00
(function filterChattableChannels(arr, arg1) {
2026-08-24 06:08:38 +00:00
closure_0 = arg1;
2026-07-20 16:05:17 +00:00
return arr.filter((arg0) => {
let channel;
2026-07-29 08:29:29 +00:00
if (dependencyMap[arg0] != null) {
channel = tmp.channel;
}
let tmp3 = null != channel;
if (tmp3) {
2026-08-24 06:08:38 +00:00
const canChannelBeDefaultResult = dependencyMap(closure_1_3[11]).canChannelBeDefault(channel.guild_id, channel.id);
2026-07-29 08:29:29 +00:00
if (!canChannelBeDefaultResult) {
tmp3 = canChannelBeDefaultResult;
} else {
const isForumChannelResult = channel.isForumChannel();
2026-08-24 06:08:38 +00:00
const canEveryoneRole = closure_1_2(tmp5[12]).canEveryoneRole;
let SEND_MESSAGES_IN_THREADS = closure_1_12;
2026-07-29 08:29:29 +00:00
if (isForumChannelResult) {
SEND_MESSAGES_IN_THREADS = SEND_MESSAGES_IN_THREADS.SEND_MESSAGES_IN_THREADS;
let canEveryoneRoleResult = canEveryoneRole(SEND_MESSAGES_IN_THREADS, channel);
} else {
canEveryoneRoleResult = canEveryoneRole(SEND_MESSAGES_IN_THREADS.SEND_MESSAGES, channel);
}
2026-08-24 06:08:38 +00:00
const tmp9 = closure_1_2(tmp5[12]);
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
const obj = dependencyMap(closure_1_3[11]);
tmp5 = closure_1_3;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp3;
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
})(arr.map((id) => id.id), obj),
2026-07-20 16:05:17 +00:00
arr
];
return items;
};
export const useChattableDefaultChannels = function useChattableDefaultChannels(arg0, arg1) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
closure_1 = arg1;
let items = [closure_6];
2026-07-23 10:11:24 +00:00
let items1 = [arg0, arg1];
2026-07-29 08:29:29 +00:00
return _require(589).useStateFromStores(items, () => {
2026-07-20 16:05:17 +00:00
const items = [];
const items1 = [];
2026-08-24 06:08:38 +00:00
const iter = closure_1_6.getChannels(callback)[closure_1_7][Symbol.iterator]();
2026-07-29 08:29:29 +00:00
const nextResult = iter.next();
while (iter !== undefined) {
let tmp2 = nextResult;
let tmp3 = callback;
2026-08-24 06:08:38 +00:00
let tmp4 = closure_1_3;
let obj = callback(closure_1_3[11]);
2026-07-29 08:29:29 +00:00
let canChannelBeDefaultResult = obj.canChannelBeDefault(nextResult.channel.guild_id, nextResult.channel.id);
if (canChannelBeDefaultResult) {
let obj2 = set;
let tmp6 = nextResult;
let hasItem = set.has(tmp2.channel.id);
if (hasItem) {
let tmp8 = nextResult;
let channel = tmp2.channel;
hasItem = !channel.isCategory();
}
if (!hasItem) {
let tmp9 = nextResult;
let channel2 = tmp2.channel;
let isThreadResult = channel2.isThread();
let hasItem1 = !isThreadResult;
if (!isThreadResult) {
let tmp12 = nextResult;
hasItem1 = null != tmp2.channel.parent_id;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (hasItem1) {
let tmp13 = nextResult;
hasItem1 = obj2.has(tmp2.channel.parent_id);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
hasItem = hasItem1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
canChannelBeDefaultResult = hasItem;
}
if (canChannelBeDefaultResult) {
let tmp14 = nextResult;
{}[tmp2.channel.id] = tmp2;
let arr = items.push(tmp2.channel);
2026-08-24 06:08:38 +00:00
let tmp16 = closure_1_15;
if (closure_1_15(tmp2.channel)) {
2026-07-29 08:29:29 +00:00
let tmp17 = nextResult;
arr = items1.push(tmp2.channel.id);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
continue;
2026-07-20 16:05:17 +00:00
}
const items2 = [items1, items];
return items2;
}, items1, areStatesEqual);
};
2026-07-29 08:29:29 +00:00
export const getSelectedRoleIds = function getSelectedRoleIds(selectedOptions) {
const mapped = selectedOptions.map((roleIds) => roleIds.roleIds);
2026-07-20 16:05:17 +00:00
const flatResult = mapped.flat();
2026-08-24 06:08:38 +00:00
return new Set(mapped.flat().filter(isDiscordFrontendDevelopment.isNotNullish));
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const getSelectedChannelIds = function getSelectedChannelIds(selectedOptions) {
const mapped = selectedOptions.map((channelIds) => channelIds.channelIds);
2026-07-20 16:05:17 +00:00
const flatResult = mapped.flat();
2026-08-24 06:08:38 +00:00
return new Set(mapped.flat().filter(isDiscordFrontendDevelopment.isNotNullish));
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const getProviderConnectionState = function getProviderConnectionState(connections) {
const found = connections.filter((connection_type) => {
let BooleanResult = connection_type.connection_type === constants.PROVIDER_CONNECTED_ACCOUNT;
if (BooleanResult) {
const _Boolean = Boolean;
BooleanResult = Boolean(connection_type.provider_id);
}
return BooleanResult;
});
2026-07-20 16:05:17 +00:00
const connected = [];
const notConnected = [];
const item = found.forEach((provider_id) => {
provider_id = provider_id.provider_id;
if (!obj.isNullOrEmpty(provider_id)) {
2026-08-24 06:08:38 +00:00
const account = closure_1_5.getAccount(null, provider_id);
2026-07-20 16:05:17 +00:00
if (null != account) {
if (!account.revoked) {
connected.push(provider_id);
}
}
notConnected.push(provider_id);
}
});
return { connected, notConnected };
};
2026-07-29 08:29:29 +00:00
export const getApplicationConnectionState = function getApplicationConnectionState(connections) {
const found = connections.filter((connection_type) => {
let BooleanResult = connection_type.connection_type === constants.APPLICATION;
if (BooleanResult) {
const _Boolean = Boolean;
BooleanResult = Boolean(connection_type.application_id);
}
return BooleanResult;
});
2026-07-20 16:05:17 +00:00
const connected = [];
const notConnected = [];
2026-08-24 06:08:38 +00:00
closure_2 = connected(FetchState[16]).default;
2026-07-23 10:11:24 +00:00
FetchState = connected(FetchState[16]).FetchState;
2026-07-20 16:05:17 +00:00
const item = found.forEach((application_id) => {
application_id = application_id.application_id;
if (!obj.isNullOrEmpty(application_id)) {
const newestTokenForApplication = authStore.getNewestTokenForApplication(application_id);
if (authStore.getFetchStateForApplication(application_id) === FetchState.FETCHED) {
if (null != newestTokenForApplication) {
connected.push(application_id);
}
}
notConnected.push(application_id);
}
});
return { connected, notConnected };
};