Files
2026-07-28 01:06:53 +03:00

633 lines
30 KiB
TypeScript

/* Metro module 9088; source: modules/channel_permissions/ChannelPermissionsUtils.tsx; dependencies: [1383, 1422, 1939, 1945, 1878, 8120, 661, 1940, 1244, 483, 21, 3995, 1360, 3789, 9089, 1909, 4800, 2] */
import SnowflakeUtils from '../../utils/SnowflakeUtils.tsx'; /* Metro dependency 21 */
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import GuildMemberStore from '../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as BigFlagUtilsModule from '../../external/discord_common/js/shared/utils/BigFlagUtils.tsx'; /* Metro dependency 483 */
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as GlobalUtilsModule from '../../utils/GlobalUtils.tsx'; /* Metro dependency 1360 */
import * as ChannelRecordModule from '../../records/ChannelRecord.tsx'; /* Metro dependency 1383 */
import * as GuildRecordModule from '../../records/GuildRecord.tsx'; /* Metro dependency 1422 */
import * as GuildRoleRecordModule from '../../records/GuildRoleRecord.tsx'; /* Metro dependency 1939 */
import * as ChannelPermissionsConstantsModule from './ChannelPermissionsConstants.tsx'; /* Metro dependency 8120 */
import * as ChannelSettingsPermissionsActionCreatorsModule from '../../actions/ChannelSettingsPermissionsActionCreators.tsx'; /* Metro dependency 9089 */
function _fun71018(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#71018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:6, offset: 0x01d12556, size: 675 bytes, params: 8, frame: 26
let env0_0 = require;
const isAdmin = function(a0) {
return hasPermission(a0, Permissions.ADMINISTRATOR);
};
const getRoleRowData2 = getRoleRowData;
const sortRoles2 = sortRoles;
const getNoRolesRow2 = getNoRolesRow;
const closure4 = function(a0, a1, a2, a3, a4) {
var env0_0 = a2;
var env0_1 = a3;
var env0_2 = a4;
return a1.filter(_fun71025);
};
const closure5 = function(a0, a1, a2, a3, a4) {
var env0_0 = a2;
var env0_1 = a3;
var env0_2 = a4;
return a1.filter(_fun71027);
};
const isDefaultMember = function(a0, a1) {
return isGuildOwner(a1, a0);
};
const sortMembers = function(a0, a1) {
var r0;
var value;
var property = a0.rowType;
if (property !== a1.rowType) {
r0 = a0.rowType - a1.rowType;
} else {
property = a0.name;
value = property.toLocaleLowerCase();
property = a1.name;
value = value.localeCompare(property.toLocaleLowerCase());
r0 = value;
}
return r0;
};
const getExistingMembers2 = getExistingMembers;
const flipEveryonePermission2 = flipEveryonePermission;
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = GuildRoleRecordModule;
const env0_6 = value.hasPermission;
const env0_7 = value.isEveryoneRole;
value = require(661) /* metro dependency 661: Constants */;
const env0_11 = value.Permissions;
const env0_12 = value.ChannelTypes;
const env0_13 = value.DEFAULT_ROLE_COLOR_HEX;
(FileImportTrackerModule).fileFinishedImporting('modules/channel_permissions/ChannelPermissionsUtils.tsx');
exports.getRoleRowData = getRoleRowData2;
exports.sortRoles = sortRoles2;
exports.getNoRolesRow = getNoRolesRow2;
exports.isEveryoneRoleId = isEveryoneRoleId;
exports.getRolesRows = function(a0, a1, a2, a3) {
var value = a4;
var env0_0 = a2;
var env0_1 = a3;
var env0_2 = value !== undefined ? value : _fun71037;
value = a1.filter(_fun71038);
value = value.sort(sortRoles);
return value.map(_fun71039);
};
exports.getRolesRowsWithPermissionDisabled = function(a0, a1, a2, a3) {
var value = a4;
var env0_0 = a2;
var env0_1 = a3;
var env0_2 = value !== undefined ? value : _fun71041;
value = a1.filter(_fun71042);
value = value.sort(sortRoles);
return value.map(_fun71043);
};
exports.getExistingRoles = closure4;
exports.getAllExistingRolesWithPermission = closure5;
exports.getExistingRolesRows = getExistingRolesRows;
exports.getExistingRolesRowWithPermissionDisabled = getExistingRolesRowWithPermissionDisabled;
exports.getMembersRows = getMembersRows;
exports.getExistingMembers = getExistingMembers2;
exports.getExistingMembersRows = function(a0, a1, a2, a3, a4) {
var env0_0 = a2;
return getExistingMembers(a0, a1, a2, a3, a4).map(_fun71053).sort(sortMembers);
};
exports.getRowTypeLabel = getRowTypeLabel;
exports.getRemoveTooltipHint = getRemoveTooltipHint;
exports.flipEveryonePermission = flipEveryonePermission2;
exports.toggleChannelEveryonePermission = toggleChannelEveryonePermission;
exports.grantUserChannelAccess = grantUserChannelAccess;
exports.isPrivateGuildChannel = isPrivateGuildChannel;
exports.isPrivateTextChannel = isPrivateTextChannel;
exports.canCreatePrivateChannel = function(a0, a1, a2) {
var r1;
var r0;
var value = a1;
if (a0 === ChannelTypes.GUILD_TEXT) {
r0 = value;
} else if (a0 === ChannelTypes.GUILD_ANNOUNCEMENT) {
r0 = value;
} else {
r1 = !isGuildVocalChannelType(a0) && a0 !== ChannelTypes.GUILD_CATEGORY;
r1 = !r1 ? value && a2 : r1;
r0 = r1;
}
return r0;
};
exports.getPrivateChannelHintText = getPrivateChannelHintText;
exports.extractPermissionOverwrites = function(a0, a1) {
var env0_0 = a1;
var Object = global.Object;
Object.values(a0).forEach(_fun71063);
return [];
};
function getRoleRowData(a0) { // fn#71020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:357, offset: 0x01d12817, size: 162 bytes, params: 2, frame: 18
const value = a1;
const r3 = value !== undefined ? value : false;
const r6 = isAdmin(a0) ? RowType.ADMINISTRATOR : RowType.ROLE;
const object = {rowType: r6};
object.colorString = a0.colorString ?? DEFAULT_ROLE_COLOR_HEX;
object.name = a0.name;
object.id = a0.id;
object.disabled = isAdmin(a0) || r3;
object.key = '' + r6 + ':' + a0.id;
object.tags = a0.tags;
return object;
}
function sortRoles(a0, a1) { // fn#71021, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:601, offset: 0x01d128b9, size: 89 bytes, params: 3, frame: 17
var r0;
var value;
const isAdmin2 = isAdmin(a0);
const value2 = 1;
const r1 = isAdmin2 ? 0 : value2;
const r2 = isAdmin(a1) ? 0 : value2;
if (r1 !== r2) {
r0 = r1 - r2;
} else {
value = require(1940) /* metro dependency 1940: GuildRoleUtils */;
value = value.compareGuildRoles(a0, a1);
r0 = value;
}
return r0;
}
function getNoRolesRow() { // fn#71022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:711, offset: 0x01d12912, size: 126 bytes, params: 1, frame: 15
var r0;
var intl;
const value = a0;
if (value !== undefined) {
r0 = value;
} else {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['gnsna/']);
}
const EMPTY_STATE = RowType.EMPTY_STATE;
return [{rowType: EMPTY_STATE, colorString: DEFAULT_ROLE_COLOR_HEX, name: r0, disabled: true, id: 'EMPTY_STATE'}];
}
function canAddPermissionInChannel(a0, a1, a2, a3) { // fn#71023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:860, offset: 0x01d12990, size: 135 bytes, params: 5, frame: 18
var r2;
var value;
const currentUser = UserStore.getCurrentUser();
if (currentUser == null) {
return false;
}
if (a0 == null) {
return currentUser.id !== a1;
}
const r3 = a3?.[a1] == null ? a0.permissionOverwrites[a1] : a3[a1];
const value4 = r3 == null;
if (value4) {
r2 = value4;
} else {
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
value = !value.has(r3.allow, a2);
r2 = value;
}
return r2;
}
function getExistingRoles(a0, a1, a2, a3, a4) { // fn#71024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:1087, offset: 0x01d12a17, size: 45 bytes, params: 6, frame: 11
const env0_0 = a2;
const env0_1 = a3;
const env0_2 = a4;
return a1.filter(_fun71025);
function _fun71025(a0) { // fn#71025, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:1141, offset: 0x01d12a44, size: 73 bytes, params: 2, frame: 20
const value = environment.__proto__;
return isAdmin(a0) || !canAddPermissionInChannel(importDefault, a0.id, importAll, env0_2) && !isEveryoneRole(a0);
}
}
function getAllExistingRolesWithPermission(a0, a1, a2, a3, a4) { // fn#71026, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:1204, offset: 0x01d12a8d, size: 45 bytes, params: 6, frame: 11
const env0_0 = a2;
const env0_1 = a3;
const env0_2 = a4;
return a1.filter(_fun71027);
function _fun71027(a0) { // fn#71027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:1275, offset: 0x01d12aba, size: 177 bytes, params: 2, frame: 21
var has;
var moduleValue;
var combine;
var permissions;
var property;
let value = environment.__proto__;
const isAdminBinding = isAdmin;
const value2 = undefined;
let r0 = isAdminBinding(a0) || !canAddPermissionInChannel(importDefault, a0.id, importAll,
env0_2) && !isEveryoneRole(a0);
if (!r0) {
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
has = value.has;
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
combine = moduleValue.combine;
permissions = a0.permissions;
property = importDefault.permissionOverwrites[a0.id];
value = Reflect.apply(has, value, [Reflect.apply(combine, moduleValue, [permissions,
property == null ? value2 : property.allow]), importAll]);
r0 = value;
}
return r0;
}
}
function getDisplayName_71028(a0, {id}) { // fn#71028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:1456, offset: 0x01d12b6b, size: 76 bytes, params: 3, frame: 15
var r0;
var value;
const nick = GuildMemberStore.getNick(id, a0.id);
if (nick != null) {
r0 = nick;
} else {
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
value = value.getName(a0);
r0 = value;
}
return r0;
}
function getMemberRowData(a0, a1) { // fn#71030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:1595, offset: 0x01d12bce, size: 212 bytes, params: 3, frame: 19
const r5 = isGuildOwner(a1, a0) ? RowType.OWNER : RowType.MEMBER;
const object = {rowType: r5};
object.name = getDisplayName_71028(a0, a1);
object.username = (importDefault(3995) /* metro dependency 3995: UserUtils */).getUserTag(a0);
object.id = a0.id;
object.avatarURL = a0.getAvatarURL(a1.id, 24);
object.bot = a0.bot;
object.verifiedBot = a0.isVerifiedBot();
object.disabled = isDefaultMember(a0, a1);
object.key = '' + r5 + ':' + a0.id;
return object;
}
function getExistingMembers(a0, a1, a2, a3, a4) { // fn#71032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:2050, offset: 0x01d12cf5, size: 113 bytes, params: 6, frame: 14
const env0_0 = a1;
const env0_1 = a2;
const env0_2 = a3;
const env0_3 = a4;
const map = a0.map;
const getUser = UserStore.getUser;
const value2 = Reflect.apply(map, a0, [getUser]);
return value2.filter((GlobalUtilsModule).isNotNullish).filter(_fun71033);
function _fun71033(a0) { // fn#71033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:2151, offset: 0x01d12d66, size: 60 bytes, params: 2, frame: 20
const value = environment.__proto__;
const canAddPermissionInChannel2 = canAddPermissionInChannel(require, a0.id, importAll, env0_3);
return canAddPermissionInChannel2 ? isDefaultMember(a0, importDefault) : !canAddPermissionInChannel2;
}
}
function flipEveryonePermission(a0, a1, a2) { // fn#71034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:2217, offset: 0x01d12da2, size: 210 bytes, params: 4, frame: 19
var r1;
var value;
const property = a0.permissionOverwrites[a0.guild_id];
if (property != null) {
r1 = property;
} else {
value = importAll(3789) /* metro dependency 3789: PermissionUtils */;
value = value.makeEveryoneOverwrite(a0.guild_id);
r1 = value;
}
const object = {};
copyDataProperties(object, r1, undefined);
object.deny = BigFlagUtilsModule.remove(object.deny, a1);
object.allow = BigFlagUtilsModule.remove(object.allow, a1);
if (!a2) {
value = BigFlagUtilsModule;
object.deny = value.add(object.deny, a1);
}
return object;
}
function isEveryoneRoleId(a0, a1) { // fn#71035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:2672, offset: 0x01d12e74, size: 48 bytes, params: 3, frame: 11
let value = SnowflakeUtils;
value = value.castGuildIdAsEveryoneGuildRoleId(a0);
return value === a1;
}
function getRolesRows(a0, a1, a2, a3) { // fn#71036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:2775, offset: 0x01d12ea4, size: 93 bytes, params: 5, frame: 12
let value = a4;
const env0_0 = a2;
const env0_1 = a3;
const env0_2 = value !== undefined ? value : function() {
return true;
};
value = Reflect.apply(a1.filter(_fun71038).sort, value, [sortRoles]);
return value.map(function(a0) {
return getRoleRowData(a0);
});
function _fun71038(a0) { // fn#71038, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:2832, offset: 0x01d12f01, size: 87 bytes, params: 2, frame: 18
const value = environment.__proto__;
return !isAdmin(a0) && canAddPermissionInChannel(importDefault, a0.id,
importAll) && !isEveryoneRole(a0) && env0_2(a0.name);
}
function _fun71039(a0) { // fn#71039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:2925, offset: 0x00eed705, size: 19 bytes, params: 2, frame: 11
return getRoleRowData(a0);
}
}
function getRolesRowsWithPermissionDisabled(a0, a1, a2, a3) { // fn#71040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:2986, offset: 0x01d12f58, size: 93 bytes, params: 5, frame: 12
let value = a4;
const env0_0 = a2;
const env0_1 = a3;
const env0_2 = value !== undefined ? value : function() {
return true;
};
value = Reflect.apply(a1.filter(_fun71042).sort, value, [sortRoles]);
return value.map(function(a0) {
return getRoleRowData(a0, hasPermission(a0, importAll));
});
function _fun71042(a0) { // fn#71042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:3065, offset: 0x01d12f01, size: 87 bytes, params: 2, frame: 18
const value = environment.__proto__;
return !isAdmin(a0) && canAddPermissionInChannel(importDefault, a0.id,
importAll) && !isEveryoneRole(a0) && env0_2(a0.name);
}
function _fun71043(a0) { // fn#71043, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:3158, offset: 0x01d12fb5, size: 37 bytes, params: 2, frame: 14
return getRoleRowData(a0, hasPermission(a0, importAll));
}
}
function getExistingRolesRows(a0, a1, a2, a3, a4) { // fn#71044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:3318, offset: 0x01d12fda, size: 140 bytes, params: 6, frame: 20
var r0;
var getNoRolesRowBinding;
var intl;
const existingRoles = getExistingRoles(0, a1, a2, a3, a4);
const value4 = existingRoles.sort(sortRoles).map(function(a0) {
return getRoleRowData(a0);
});
if (value4.length !== 0) {
r0 = value4;
} else {
getNoRolesRowBinding = getNoRolesRow;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = getNoRolesRowBinding(intl.string((require(1244) /* metro dependency 1244: indexNative */).t.nZfHsf));
}
return r0;
}
function getExistingRolesRowWithPermissionDisabled(a0, a1, a2, a3, a4) { // fn#71046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:3559, offset: 0x01d13066, size: 147 bytes, params: 6, frame: 21
var r0;
var getNoRolesRowBinding;
var intl;
const env0_0 = a3;
const allExistingRolesWithPermission = getAllExistingRolesWithPermission(0, a1, a2, a3, a4);
const value4 = allExistingRolesWithPermission.sort(sortRoles).map(function(a0) {
return getRoleRowData(a0, hasPermission(a0, importAll));
});
if (value4.length !== 0) {
r0 = value4;
} else {
getNoRolesRowBinding = getNoRolesRow;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = getNoRolesRowBinding(intl.string((require(1244) /* metro dependency 1244: indexNative */).t.nZfHsf));
}
return r0;
}
function getMembersRows(a0, a1, a2, a3) { // fn#71048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:3818, offset: 0x01d1311e, size: 156 bytes, params: 5, frame: 16
const value = a4;
const env0_0 = a1;
const env0_1 = a2;
const env0_2 = a3;
const env0_3 = value !== undefined ? value : function() {
return true;
};
const map = a0.map;
const getUser = UserStore.getUser;
const value2 = Reflect.apply(map, a0, [getUser]);
const value5 = value2.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish).filter(_fun71050).map(function(a0) {
return getMemberRowData(a0, importDefault);
});
return value5.sort(sortMembers);
function _fun71050(a0) { // fn#71050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:3922, offset: 0x01d131ba, size: 122 bytes, params: 2, frame: 19
var r1;
const value = environment.__proto__;
let r0 = !isGuildOwner(importDefault, a0) && canAddPermissionInChannel(require, a0.id, importAll);
if (r0) {
r1 = env0_3(getDisplayName_71028(a0, importDefault)) || env0_3(a0.username);
r1 = !r1 ? env0_3(a0.discriminator) : r1;
r0 = r1;
}
return r0;
}
}
function getExistingMembersRows(a0, a1, a2, a3, a4) { // fn#71052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:4149, offset: 0x01d1324f, size: 71 bytes, params: 6, frame: 21
const env0_0 = a2;
const value3 = getExistingMembers(a0, a1, a2, a3, a4).map(function(a0) {
return getMemberRowData(a0, importDefault);
});
return value3.sort(sortMembers);
function _fun71053(a0) { // fn#71053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:4234, offset: 0x01d13296, size: 27 bytes, params: 2, frame: 13
return getMemberRowData(a0, importDefault);
}
}
function getRowTypeLabel(a0, a1) { // fn#71054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:4298, offset: 0x01d132b1, size: 498 bytes, params: 3, frame: 16
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const ROLE = RowType.ROLE;
if (ROLE === a0) {
return intl.string(t.ZxoFOG);
}
const OWNER = RowType.OWNER;
if (OWNER === a0) {
return intl.string(t.NWhYJg);
}
const ADMINISTRATOR = RowType.ADMINISTRATOR;
if (ADMINISTRATOR === a0) {
return intl.string(t['dwlcc+']);
}
const MEMBER = RowType.MEMBER;
if (MEMBER === a0) {
return a1 ? intl.string(t.UAJxZi) : null;
}
const USER = RowType.USER;
if (USER === a0) {
return intl.string(t.KD6OJJ);
}
const GUILD = RowType.GUILD;
if (GUILD === a0) {
return intl.string(t['5qyruI']);
}
const EMPTY_STATE = RowType.EMPTY_STATE;
if (EMPTY_STATE === a0) {
return null;
}
}
function getRemoveTooltipHint(a0) { // fn#71055, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:4762, offset: 0x01d134a3, size: 318 bytes, params: 2, frame: 15
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const ROLE = RowType.ROLE;
if (ROLE === a0) {
return intl.string(t['Gzc/a8']);
}
const OWNER = RowType.OWNER;
if (OWNER === a0) {
return intl.string(t.icuNBM);
}
const ADMINISTRATOR = RowType.ADMINISTRATOR;
if (ADMINISTRATOR === a0) {
return intl.string(t.eTmN5a);
}
const MEMBER = RowType.MEMBER;
if (MEMBER === a0) {
return intl.string(t['Gzc/a8']);
}
RowType.EMPTY_STATE;
return null;
}
function toggleChannelEveryonePermission(a0, a1, a2) { // fn#71056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:5174, offset: 0x01d135e1, size: 80 bytes, params: 4, frame: 18
const value2 = flipEveryonePermission(a0, a1, a2);
ChannelSettingsPermissionsActionCreatorsModule.updatePermission(a0, value2.id, value2.allow, value2.deny);
}
function grantUserChannelAccess(a0, a1) { // fn#71057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:5333, offset: 0x01d13631, size: 296 bytes, params: 3, frame: 22
var permissionOverwrites;
var id;
var property;
var allow;
var deny;
var add;
var value3;
var updatePermission;
var object;
var NONE;
var savePermissionUpdates;
var value;
const currentUser = UserStore.getCurrentUser();
if (currentUser != null) {
permissionOverwrites = a0.permissionOverwrites;
id = currentUser.id;
property = permissionOverwrites[id];
if (property == null) {
object = {};
id = currentUser.id;
object.id = id;
object.type = (require(1909) /* metro dependency 1909: Server */).PermissionOverwriteType.MEMBER;
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
add = value.add;
NONE = (importAll(3789) /* metro dependency 3789: PermissionUtils */).NONE;
object.allow = Reflect.apply(add, value, [NONE, a1]);
NONE = (importAll(3789) /* metro dependency 3789: PermissionUtils */).NONE;
object.deny = NONE;
value = require(9089) /* metro dependency 9089: ChannelSettingsPermissionsActionCreators */;
savePermissionUpdates = value.savePermissionUpdates;
id = a0.id;
return Reflect.apply(savePermissionUpdates, value, [id, [object], true]);
}
allow = property.allow;
deny = property.deny;
value3 = (importAll(483) /* metro dependency 483: BigFlagUtils */).add(allow, a1);
value = require(9089) /* metro dependency 9089: ChannelSettingsPermissionsActionCreators */;
updatePermission = value.updatePermission;
id = property.id;
return Reflect.apply(updatePermission, value, [a0, id, value3, deny]);
}
}
function isPrivateGuildChannel(a0, a1) { // fn#71058, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:5737, offset: 0x01d13759, size: 119 bytes, params: 3, frame: 16
var r0;
if (a0 == null) {
return false;
}
const property = a0.permissionOverwrites[a0.guild_id];
let value = undefined;
const r2 = (a1 == null ? value : a1[a0.guild_id]) == null ? property : a1[a0.guild_id];
const value2 = r2 != null;
if (value2) {
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
value = value.has(r2.deny, a0.accessPermissions);
r0 = value;
} else {
r0 = value2;
}
return r0;
}
function isPrivateTextChannel(a0) { // fn#71059, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:5971, offset: 0x01d137d0, size: 106 bytes, params: 2, frame: 15
var moduleValue;
const property = a0.permissionOverwrites[a0.guild_id];
let r0 = property != null && a0.type === ChannelTypes.GUILD_TEXT;
if (r0) {
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
r0 = moduleValue.has(property.deny, Permissions.VIEW_CHANNEL);
}
return r0;
}
function getPrivateChannelHintText(a0) { // fn#71061, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:6302, offset: 0x01d1389b, size: 264 bytes, params: 2, frame: 16
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const GUILD_TEXT = ChannelTypes.GUILD_TEXT;
if (GUILD_TEXT === a0) {
return intl.format(t.ZDtA0T, {});
}
const GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
if (GUILD_ANNOUNCEMENT === a0) {
return intl.format(t.ZDtA0T, {});
}
const GUILD_VOICE = ChannelTypes.GUILD_VOICE;
if (GUILD_VOICE === a0) {
return intl.format(t.iZAMty, {});
}
const GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
if (GUILD_CATEGORY === a0) {
return intl.format(t.PhnARV, {});
}
return null;
}
function extractPermissionOverwrites(a0, a1) { // fn#71062, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:6631, offset: 0x01d139a3, size: 57 bytes, params: 3, frame: 13
const env0_0 = a1;
const Object = global.Object;
Object.values(a0).forEach(_fun71063);
return [];
function _fun71063({row}) { // fn#71063, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:6715, offset: 0x01d139dc, size: 214 bytes, params: 2, frame: 17
var rowType;
var binding;
var push;
let value = row.id != null;
if (value && row.id !== '') {
rowType = row.rowType;
value = environment.__proto__;
if (rowType === RowType.ROLE) {
binding = env0_1;
push = binding.push;
value = require(4800) /* metro dependency 4800: ChannelUtils */;
Reflect.apply(push, binding, [value.permissionOverwriteForRole(row.id, require)]);
} else if (row.rowType === RowType.MEMBER) {
binding = env0_1;
push = binding.push;
value = require(4800) /* metro dependency 4800: ChannelUtils */;
Reflect.apply(push, binding, [value.permissionOverwriteForUser(row.id, require)]);
}
}
}
}
}
function getRolesRowsA() { // fn#71037, owner: getRolesRows.a, offset: 0x00c4c231, size: 4 bytes, params: 1, frame: 1
return true;
}
function getRolesRowsWithPermissionDisabledU() { // fn#71041, owner: getRolesRowsWithPermissionDisabled.u, offset: 0x00c4c231, size: 4 bytes, params: 1, frame: 1
return true;
}
global.__d(_fun71018, 9088, [1383, 1422, 1939, 1945, 1878, 8120, 661, 1940, 1244, 483, 21, 3995, 1360, 3789, 9089,
1909, 4800,
2]) /* metro module 9088, dependencies: [1383, 1422, 1939, 1945, 1878, 8120, 661, 1940, 1244, 483, 21, 3995, 1360, 3789, 9089, 1909, 4800, 2] */;