138 lines
7.1 KiB
TypeScript
138 lines
7.1 KiB
TypeScript
/* Metro module 14708; source: modules/guild_sidebar/SectionFooterHelpers.tsx; dependencies: [5090, 3784, 5101, 661, 1417, 5092, 2] */
|
|
import PermissionStore from '../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
|
|
import CategoryCollapseStore from '../../stores/CategoryCollapseStore.tsx'; /* Metro dependency 5090 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as FavoritesConstantsModule from '../favorites/FavoritesConstants.tsx'; /* Metro dependency 1417 */
|
|
import * as GuildSidebarConstantsModule from './GuildSidebarConstants.tsx'; /* Metro dependency 5101 */
|
|
|
|
function _fun110963(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14905:6, offset: 0x0238dc68, size: 250 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const getSectionFooterActiveVoiceChannels2 = getSectionFooterActiveVoiceChannels;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_sidebar/SectionFooterHelpers.tsx');
|
|
exports.getSectionFooterConfig = function(a0, a1, a2) {
|
|
var object = {};
|
|
object.hasDivider = isSectionFooterWithDivider(a0, a1, a2);
|
|
object.canHaveVoiceSummary = isSectionFooterVoiceSummaryEligible(a0, a2);
|
|
return object;
|
|
};
|
|
exports.getSectionFooterActiveVoiceChannels = getSectionFooterActiveVoiceChannels2;
|
|
exports.isSectionFooterWithActiveVoiceChannels = function({category, voiceStates, selectedChannelId,
|
|
selectedVoiceChannelId}) {
|
|
category = getSectionFooterActiveVoiceChannels({category: category, selectedChannelId: selectedChannelId,
|
|
selectedVoiceChannelId: selectedVoiceChannelId, voiceStates: voiceStates}).length;
|
|
return category > 0;
|
|
};
|
|
function isSectionFooterWithDivider(a0, a1, a2) { // fn#110964, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14905:207, offset: 0x0238dd62, size: 343 bytes, params: 4, frame: 18
|
|
var r1;
|
|
var r0;
|
|
var r7;
|
|
var r5;
|
|
var r3;
|
|
var r2;
|
|
var rows;
|
|
var value9;
|
|
var value10;
|
|
var value;
|
|
const SECTION_INDEX_GUILD_ACTIONS = (require(5092) /* metro dependency 5092: ChannelListState */).SECTION_INDEX_GUILD_ACTIONS;
|
|
if (a2 === SECTION_INDEX_GUILD_ACTIONS) {
|
|
rows = a0.getGuildActionSection().getRows();
|
|
r1 = rows.length === 1 && rows[0] === ChannelListGuildActionRow.GUILD_PREMIUM_PROGRESS_BAR;
|
|
r1 = !r1 ? a0.getGuildActionSection().isEmpty() : r1;
|
|
r0 = r1;
|
|
} else {
|
|
r0 = a0.getSections(false)[a2] === 0;
|
|
}
|
|
if (r0) {
|
|
r0 = !r0;
|
|
} else {
|
|
value9 = a2 === SECTION_INDEX_GUILD_ACTIONS;
|
|
if (value9) {
|
|
r1 = value9;
|
|
} else {
|
|
if (a0.id === FAVORITES_RAW_GUILD_ID) {
|
|
r2 = a2 !== a0.getSections(false).length - 1;
|
|
} else {
|
|
value10 = a2 === (require(5092) /* metro dependency 5092: ChannelListState */).SECTION_INDEX_FAVORITES;
|
|
if (value10) {
|
|
r2 = value10;
|
|
} else {
|
|
if (a1) {
|
|
value = a2 !== (require(5092) /* metro dependency 5092: ChannelListState */).SECTION_INDEX_UNCATEGORIZED_CHANNELS;
|
|
if (value) {
|
|
value = a2 === a0.recentsSectionNumber;
|
|
if (value) {
|
|
r7 = value;
|
|
} else {
|
|
a0.voiceChannelsSectionNumber;
|
|
r7 = false;
|
|
}
|
|
r5 = r7;
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
r3 = r5;
|
|
} else {
|
|
r3 = !!a1;
|
|
}
|
|
r2 = r3;
|
|
}
|
|
}
|
|
r1 = r2;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function isSectionFooterVoiceSummaryEligible(a0, a1) { // fn#110965, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14905:748, offset: 0x0238deb9, size: 132 bytes, params: 3, frame: 16
|
|
const SECTION_INDEX_GUILD_ACTIONS = (require(5092) /* metro dependency 5092: ChannelListState */).SECTION_INDEX_GUILD_ACTIONS;
|
|
let r0 = a1 === SECTION_INDEX_GUILD_ACTIONS || a1 === (require(5092) /* metro dependency 5092: ChannelListState */).SECTION_INDEX_FAVORITES;
|
|
r0 = !r0 ? a1 === (require(5092) /* metro dependency 5092: ChannelListState */).SECTION_INDEX_UNCATEGORIZED_CHANNELS : r0;
|
|
r0 = !r0 ? a1 === a0.recentsSectionNumber : r0;
|
|
r0 = !r0 ? a1 === a0.voiceChannelsSectionNumber : r0;
|
|
return !r0;
|
|
}
|
|
|
|
function getSectionFooterActiveVoiceChannels({category, voiceStates, selectedChannelId, selectedVoiceChannelId}) { // fn#110966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14905:996, offset: 0x0238df3d, size: 110 bytes, params: 2, frame: 13
|
|
var r0;
|
|
const categoryCollapseStoreBinding = CategoryCollapseStore;
|
|
let value = categoryCollapseStoreBinding.isCollapsed(category.record.id);
|
|
if (value !== true) {
|
|
r0 = [];
|
|
} else {
|
|
value = category.getChannelRecords();
|
|
value = value.filter(_fun110967);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
function _fun110967(a0) { // fn#110967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14905:1185, offset: 0x0238dfab, size: 110 bytes, params: 2, frame: 14
|
|
var r1;
|
|
var r0;
|
|
var voiceStatesBinding;
|
|
var id;
|
|
const value = environment.__proto__;
|
|
const permissionStoreBinding = PermissionStore;
|
|
const can = permissionStoreBinding.can;
|
|
const VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
|
|
if (Reflect.apply(can, permissionStoreBinding, [VIEW_CHANNEL, a0])) {
|
|
voiceStatesBinding = voiceStates;
|
|
id = a0.id;
|
|
r1 = voiceStatesBinding[id] ?? [];
|
|
id = a0.id;
|
|
r0 = id !== selectedVoiceChannelId && a0.id !== selectedChannelId;
|
|
r0 = r0 && r1.length > 0;
|
|
return r0;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun110963, 14708, [5090, 3784, 5101, 661, 1417, 5092,
|
|
2]) /* metro module 14708, dependencies: [5090, 3784, 5101, 661, 1417, 5092, 2] */;
|