754 lines
39 KiB
TypeScript
754 lines
39 KiB
TypeScript
/* Metro module 9083; source: components_native/CreateChannelModal.tsx; dependencies: [57, 31, 27, 1383, 1422, 1379, 1867, 3784, 3793, 1878, 661, 8120, 33, 4501, 697, 6691, 6698, 6711, 6707, 6704, 6697, 6689, 6696, 6708, 6706, 6703, 1244, 4573, 6766, 1948, 3874, 6238, 7989, 7972, 1305, 5463, 566, 44, 4805, 4807, 9084, 1484, 9085, 4863, 5282, 9087, 5277, 9088, 22, 4800, 4572, 7682, 6985, 6231, 9091, 6808, 6705, 9095, 480, 9108, 6518, 5280, 2] */
|
|
function _fun70971(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#70971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:6, offset: 0x01d0f497, size: 1058 bytes, params: 8, frame: 25
|
|
var object2;
|
|
const env0_0 = require;
|
|
const closure = CreateChannel;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_5 = value.ScrollView;
|
|
const env0_6 = value.View;
|
|
value = require(1383) /* metro dependency 1383: ChannelRecord */;
|
|
const env0_7 = value.CREATEABLE_NON_VOCAL_CHANNEL_NAME_TYPES;
|
|
const env0_8 = value.isGuildVocalChannelType;
|
|
const env0_9 = (require(1422) /* metro dependency 1422: GuildRecord */).isGuildOwner;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
|
|
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const ChannelTypes = value.ChannelTypes;
|
|
const env0_16 = value.GuildFeatures;
|
|
const env0_17 = value.Permissions;
|
|
const env0_18 = value.AnalyticEvents;
|
|
const env0_19 = value.HelpdeskArticles;
|
|
const env0_20 = (require(8120) /* metro dependency 8120: ChannelPermissionsConstants */).RowType;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_21 = value.jsx;
|
|
const env0_22 = value.Fragment;
|
|
const env0_23 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
const env0_24 = Reflect.apply(createStyles, value, [{addMembersContainer: {backgroundColor: BACKGROUND_BASE_LOW,
|
|
flex: 1}, errorMessage: {marginBottom: 0}, flexRow: {'flexDirection': 'row', 'alignItems': 'center'},
|
|
horizontalContainer: {'flex': 1, 'flexDirection': 'row'}}]);
|
|
object2 = {};
|
|
let GUILD_TEXT = ChannelTypes.GUILD_TEXT;
|
|
const TextIcon = (require(6691) /* metro dependency 6691: TextIcon */).TextIcon;
|
|
object2[GUILD_TEXT] = {IconComponent: TextIcon};
|
|
let GUILD_FORUM = ChannelTypes.GUILD_FORUM;
|
|
const ForumIcon = (require(6698) /* metro dependency 6698: ForumIcon */).ForumIcon;
|
|
object2[GUILD_FORUM] = {IconComponent: ForumIcon};
|
|
let GUILD_VOICE = ChannelTypes.GUILD_VOICE;
|
|
const VoiceNormalIcon = (require(6711) /* metro dependency 6711: VoiceNormalIcon */).VoiceNormalIcon;
|
|
object2[GUILD_VOICE] = {IconComponent: VoiceNormalIcon};
|
|
let GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
|
|
const StageIcon = (require(6707) /* metro dependency 6707: StageIcon */).StageIcon;
|
|
object2[GUILD_STAGE_VOICE] = {IconComponent: StageIcon};
|
|
let GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
|
|
const AnnouncementsIcon = (require(6704) /* metro dependency 6704: AnnouncementsIcon */).AnnouncementsIcon;
|
|
object2[GUILD_ANNOUNCEMENT] = {IconComponent: AnnouncementsIcon};
|
|
let GUILD_MEDIA = ChannelTypes.GUILD_MEDIA;
|
|
const ImageIcon = (require(6697) /* metro dependency 6697: ImageIcon */).ImageIcon;
|
|
object2[GUILD_MEDIA] = {IconComponent: ImageIcon};
|
|
object2 = {};
|
|
GUILD_TEXT = ChannelTypes.GUILD_TEXT;
|
|
const TextLockIcon = (require(6689) /* metro dependency 6689: TextLockIcon */).TextLockIcon;
|
|
object2[GUILD_TEXT] = {IconComponent: TextLockIcon};
|
|
GUILD_FORUM = ChannelTypes.GUILD_FORUM;
|
|
const ForumLockIcon = (require(6696) /* metro dependency 6696: ForumLockIcon */).ForumLockIcon;
|
|
object2[GUILD_FORUM] = {IconComponent: ForumLockIcon};
|
|
GUILD_VOICE = ChannelTypes.GUILD_VOICE;
|
|
const VoiceLockIcon = (require(6708) /* metro dependency 6708: VoiceLockIcon */).VoiceLockIcon;
|
|
object2[GUILD_VOICE] = {IconComponent: VoiceLockIcon};
|
|
GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
|
|
const StageLockIcon = (require(6706) /* metro dependency 6706: StageLockIcon */).StageLockIcon;
|
|
object2[GUILD_STAGE_VOICE] = {IconComponent: StageLockIcon};
|
|
GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
|
|
const AnnouncementsLockIcon = (require(6703) /* metro dependency 6703: AnnouncementsLockIcon */).AnnouncementsLockIcon;
|
|
object2[GUILD_ANNOUNCEMENT] = {IconComponent: AnnouncementsLockIcon};
|
|
GUILD_MEDIA = ChannelTypes.GUILD_MEDIA;
|
|
object2[GUILD_MEDIA] = {IconComponent: ImageIcon};
|
|
object2 = {CREATE_CHANNEL: 'CREATE_CHANNEL', ADD_MEMBERS: 'ADD_MEMBERS', ADD_MODERATORS: 'ADD_MODERATORS'};
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/CreateChannelModal.tsx');
|
|
exports.default = CreateChannelModal;
|
|
exports.CreateChannel = closure;
|
|
}
|
|
|
|
function ChannelTypeRow({selected, channelType, isPrivate, isBeta, onPress}) { // fn#70972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:1388, offset: 0x01d0f8b9, size: 1482 bytes, params: 2, frame: 34
|
|
var r0;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var jsxRuntimeEnv0_22Binding;
|
|
var items2;
|
|
var TextWithIOSLinkWorkaround;
|
|
var format;
|
|
var property;
|
|
var defaultImport;
|
|
const styles = useStyles();
|
|
const useA11yRolesNativeModule = require(3874) /* metro dependency 3874: useA11yRolesNative */;
|
|
const useRadioA11yNative = useA11yRolesNativeModule.useRadioA11yNative;
|
|
let object2 = {selected: selected};
|
|
const {accessibilityRole, accessibilityState} = Reflect.apply(useRadioA11yNative, useA11yRolesNativeModule,
|
|
[object2]);
|
|
const IconComponent = (isPrivate ? env0_26 : env0_25)[channelType].IconComponent;
|
|
const GUILD_TEXT = ChannelTypes.GUILD_TEXT;
|
|
if (GUILD_TEXT === channelType) {
|
|
object2 = {};
|
|
object2.label = intl.string(t.pnuRXC);
|
|
object2.description = intl.string(t.oG6WsM);
|
|
r0 = object2;
|
|
} else if (ChannelTypes.GUILD_VOICE === channelType) {
|
|
object2 = {};
|
|
object2.label = intl.string(t.Sx55Oh);
|
|
object2.description = intl.string(t.pqfkoF);
|
|
r0 = object2;
|
|
} else if (ChannelTypes.GUILD_FORUM === channelType) {
|
|
object2 = {};
|
|
object2.label = intl.string(t.eAVID5);
|
|
object2.description = intl.string(t.iZ5pgg);
|
|
r0 = object2;
|
|
} else if (ChannelTypes.GUILD_ANNOUNCEMENT === channelType) {
|
|
object2 = {};
|
|
object2.label = intl.string(t.qr9dEP);
|
|
object2.description = intl.string(t.gBkfzu);
|
|
r0 = object2;
|
|
} else if (ChannelTypes.GUILD_STAGE_VOICE === channelType) {
|
|
object2 = {};
|
|
object2.label = intl.string(t.pNWst0);
|
|
object2.description = intl.string(t.VPAwgo);
|
|
r0 = object2;
|
|
} else if (ChannelTypes.GUILD_MEDIA !== channelType) {
|
|
r0 = undefined;
|
|
} else {
|
|
object2 = {};
|
|
object2.label = intl.string(t['6x6fVg']);
|
|
jsxRuntimeEnv0_22Binding = jsxRuntimeEnv0_22;
|
|
items2 = [((Text) => <Text variant="text-xs/normal" color="text-muted">{intl.string(t.JyCrwS)}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)];
|
|
TextWithIOSLinkWorkaround = (require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround;
|
|
format = intl.format;
|
|
property = t['2Sapx1'];
|
|
defaultImport = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
|
|
items2[1] = <TextWithIOSLinkWorkaround variant="text-xs/normal">{Reflect.apply(format, intl, [property,
|
|
{hcArticleUrl: defaultImport.getCreatorSupportArticleURL(HelpdeskArticles.MEDIA_CHANNEL)}])}</TextWithIOSLinkWorkaround>;
|
|
object2.description = <>{items2}</>;
|
|
r0 = object2;
|
|
}
|
|
const label = r0.label;
|
|
const description = r0.description;
|
|
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
const tableRowProps = {onPress: function() {
|
|
if (!selected) {
|
|
onPress(channelType);
|
|
}
|
|
}, accessibilityRole: accessibilityRole, accessibilityState: accessibilityState,
|
|
icon: <View style={styles.flexRow}><IconComponent /></View>};
|
|
const FormRadio = (require(7989) /* metro dependency 7989: FormRadioNative */).FormRadio;
|
|
tableRowProps.trailing = <FormRadio selected={selected} />;
|
|
tableRowProps.label = isBeta !== true ? label : <View style={styles.horizontalContainer}>{((FormLabel) => <FormLabel text={label} />)((require(7972) /* metro dependency 7972: native */).FormLabel)}{((BetaTag) => <BetaTag size={(require(1305) /* metro dependency 1305: native */).BetaSizes.SMALL} />)((require(1305) /* metro dependency 1305: native */).BetaTag)}</View>;
|
|
tableRowProps.subLabel = description;
|
|
return <TableRow {...tableRowProps} />;
|
|
}
|
|
|
|
function CreateChannel({categoryId, channelType, cloneChannelId, createMode, guildId, onChannelCreated}) { // fn#70974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:3051, offset: 0x01d0fea3, size: 3073 bytes, params: 2, frame: 49
|
|
var r14;
|
|
var r28;
|
|
var r17;
|
|
var r22;
|
|
var r9;
|
|
var GUILD_TEXT;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var string;
|
|
var t;
|
|
var format;
|
|
var s2ZzZZ;
|
|
var moduleValue6;
|
|
var jsxRuntimeEnv0_22Binding;
|
|
const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup;
|
|
var object8;
|
|
var object;
|
|
var items2;
|
|
var object3;
|
|
var GUILD_VOICE;
|
|
var object5;
|
|
var object6;
|
|
var GUILD_MEDIA;
|
|
var object7;
|
|
var GUILD_ANNOUNCEMENT;
|
|
var object15;
|
|
var GUILD_STAGE_VOICE;
|
|
var items3;
|
|
var jsxRuntimeEnv0_22Binding2;
|
|
var object16;
|
|
var isGuildVocalChannelType2;
|
|
var TableSwitchRow;
|
|
var items4;
|
|
var moduleValue7;
|
|
const env0_3 = guildId;
|
|
const env0_4 = onChannelCreated;
|
|
const closure = onPress_70976;
|
|
const styles = useStyles();
|
|
const insets = (importDefault(5463) /* metro dependency 5463: useSafeAreaInsetsKeyboardAwareNative */)().insets;
|
|
const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
|
|
return GuildStore.getGuild(guildId);
|
|
});
|
|
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], _fun70978);
|
|
const r32 = guild != null && guild.features.has(GuildFeatures.COMMUNITY);
|
|
let can = PermissionStore.can;
|
|
const VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
|
|
const value7 = Reflect.apply(can, PermissionStore, [VIEW_CHANNEL, guild]);
|
|
can = PermissionStore.can;
|
|
const CONNECT = Permissions.CONNECT;
|
|
const value8 = Reflect.apply(can, PermissionStore, [CONNECT, guild]);
|
|
(importDefault(44) /* metro dependency 44 */)(UserStore.getCurrentUser() != null,
|
|
'CreateChannel: user cannot be undefined');
|
|
const value10 = (importDefault(4805) /* metro dependency 4805: useChannelName */)(value3);
|
|
let binding = env0_4;
|
|
let useState = binding.useState;
|
|
const value13 = env0_3(Reflect.apply(useState, binding, [value10 ?? '']), 2);
|
|
const property = value13[0];
|
|
const env0_9 = value13[1];
|
|
binding = env0_4;
|
|
useState = binding.useState;
|
|
const value15 = env0_3(Reflect.apply(useState, binding, [channelType ?? ChannelTypes.GUILD_TEXT]), 2);
|
|
const property2 = value15[0];
|
|
const env0_11 = value15[1];
|
|
const value16 = (require(4807) /* metro dependency 4807: StageChannelPermissionUtils */).useCanCreateStageChannelByGuild(guildId);
|
|
const value17 = (require(9084) /* metro dependency 9084: MediaChannelExperimentUtils */).useGuildEligibleForMediaChannels(guild);
|
|
const value18 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const value20 = env0_3((importDefault(9085) /* metro dependency 9085: useCreateChannelSubmit */)(onChannelCreated),
|
|
3);
|
|
const property3 = value20[0];
|
|
const property4 = value20[1];
|
|
const property5 = value20[2];
|
|
const [property6, env0_16] = env0_3(env0_4.useState(false), 2);
|
|
env0_4.useEffect(function() {
|
|
var defaultImport = importDefault(dependencyMap[43]);
|
|
var OPEN_MODAL = AnalyticEvents.OPEN_MODAL;
|
|
defaultImport.trackWithMetadata(OPEN_MODAL, {type: 'Create Channel'});
|
|
}, []);
|
|
env0_4.useEffect(_fun70980, [value18, property2, value3, value7, value8, property6, property, property3, guildId,
|
|
property5, categoryId, createMode, onChannelCreated]);
|
|
const object18 = {};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object18.padding = PX_16;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object18.paddingBottom = PX_16 + insets.bottom;
|
|
const Stack = (require(4572) /* metro dependency 4572: StackNative */).Stack;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
const Input = (require(7682) /* metro dependency 7682: InputNative */).Input;
|
|
const object19 = {};
|
|
let GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
|
|
object19.label = property2 === GUILD_CATEGORY ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.OCAkGP) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.PVbHDl);
|
|
object19.errorMessage = property4.name?.[0];
|
|
let GUILD_FORUM = ChannelTypes.GUILD_FORUM;
|
|
if (property2 === GUILD_FORUM) {
|
|
r14 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.qBvLY4);
|
|
} else if (value3 != null) {
|
|
format = intl.format;
|
|
s2ZzZZ = (require(1244) /* metro dependency 1244: indexNative */).t.s2ZzZZ;
|
|
moduleValue6 = require(4805) /* metro dependency 4805: useChannelName */;
|
|
r14 = Reflect.apply(format, intl, [s2ZzZZ, {name: moduleValue6.computeChannelName(value3, UserStore,
|
|
RelationshipStore, true)}]);
|
|
} else {
|
|
r14 = undefined;
|
|
}
|
|
object19.description = r14;
|
|
const TextField = (require(6985) /* metro dependency 6985: TextFieldNative */).TextField;
|
|
GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
|
|
const input = <Input {...object19}><TextField autoFocus enableAndroidSanitizedInputWorkaround value={property} onChange={onChange_70983} placeholder={property2 === GUILD_CATEGORY ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.eTVbtx) : property2 === ChannelTypes.GUILD_FORUM ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5z1Xat']) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['bw/b8E'])} /></Input>;
|
|
if (value3 == null) {
|
|
jsxRuntimeEnv0_22Binding = jsxRuntimeEnv0_22;
|
|
GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
|
|
if (property2 === GUILD_CATEGORY) {
|
|
r17 = null;
|
|
} else {
|
|
var tableRowGroupProps = {title: intl.string((require(1244) /* metro dependency 1244: indexNative */).t['7ZcXG2']),
|
|
|
|
|
|
hasIcons: true};
|
|
object = {};
|
|
GUILD_TEXT = ChannelTypes.GUILD_TEXT;
|
|
object.channelType = GUILD_TEXT;
|
|
GUILD_TEXT = ChannelTypes.GUILD_TEXT;
|
|
object.selected = property2 === GUILD_TEXT;
|
|
object.isPrivate = property6;
|
|
object.onPress = closure;
|
|
items2 = [<ChannelTypeRow {...object} />];
|
|
object3 = {};
|
|
GUILD_VOICE = ChannelTypes.GUILD_VOICE;
|
|
object3.channelType = GUILD_VOICE;
|
|
GUILD_VOICE = ChannelTypes.GUILD_VOICE;
|
|
object3.selected = property2 === GUILD_VOICE;
|
|
object3.isPrivate = property6;
|
|
object3.onPress = closure;
|
|
items2[1] = <ChannelTypeRow {...object3} />;
|
|
object5 = {};
|
|
GUILD_FORUM = ChannelTypes.GUILD_FORUM;
|
|
object5.channelType = GUILD_FORUM;
|
|
GUILD_FORUM = ChannelTypes.GUILD_FORUM;
|
|
object5.selected = property2 === GUILD_FORUM;
|
|
object5.isPrivate = property6;
|
|
object5.onPress = closure;
|
|
items2[2] = <ChannelTypeRow {...object5} />;
|
|
if (value17) {
|
|
object6 = {};
|
|
GUILD_MEDIA = ChannelTypes.GUILD_MEDIA;
|
|
object6.channelType = GUILD_MEDIA;
|
|
GUILD_MEDIA = ChannelTypes.GUILD_MEDIA;
|
|
object6.selected = property2 === GUILD_MEDIA;
|
|
object6.isPrivate = property6;
|
|
object6.isBeta = true;
|
|
object6.onPress = closure;
|
|
r28 = <ChannelTypeRow {...object6} />;
|
|
} else {
|
|
r28 = null;
|
|
}
|
|
items2[3] = r28;
|
|
if (r32) {
|
|
if (createMode === (require(9085) /* metro dependency 9085: useCreateChannelSubmit */).CreateChannelMode.PREMIUM_CHANNEL) {
|
|
r28 = null;
|
|
} else {
|
|
object7 = {};
|
|
GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
|
|
object7.channelType = GUILD_ANNOUNCEMENT;
|
|
GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
|
|
object7.selected = property2 === GUILD_ANNOUNCEMENT;
|
|
object7.isPrivate = property6;
|
|
object7.onPress = closure;
|
|
r28 = <ChannelTypeRow {...object7} />;
|
|
}
|
|
} else {
|
|
r28 = null;
|
|
}
|
|
items2[4] = r28;
|
|
if (value16) {
|
|
if (property6) {
|
|
r28 = null;
|
|
} else {
|
|
object15 = {};
|
|
GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
|
|
object15.channelType = GUILD_STAGE_VOICE;
|
|
GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
|
|
object15.selected = property2 === GUILD_STAGE_VOICE;
|
|
object15.isPrivate = property6;
|
|
object15.onPress = closure;
|
|
r28 = <ChannelTypeRow {...object15} />;
|
|
}
|
|
} else {
|
|
r28 = null;
|
|
}
|
|
items2[5] = r28;
|
|
r17 = <TableRowGroup {...tableRowGroupProps}>{items2}</TableRowGroup>;
|
|
}
|
|
items3 = [r17];
|
|
items3[1] = ((Component) => <Component guildId={guildId} channelType={property2} />)(importDefault(9091) /* metro dependency 9091: CreateChannelTypeDescription */);
|
|
GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
|
|
if (property2 === GUILD_STAGE_VOICE) {
|
|
r17 = null;
|
|
} else if (createMode === (require(9085) /* metro dependency 9085: useCreateChannelSubmit */).CreateChannelMode.PREMIUM_CHANNEL) {
|
|
r17 = null;
|
|
} else {
|
|
jsxRuntimeEnv0_22Binding2 = jsxRuntimeEnv0_22;
|
|
object16 = {};
|
|
GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
|
|
if (property2 === GUILD_CATEGORY) {
|
|
r28 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.RQUk61);
|
|
} else {
|
|
isGuildVocalChannelType2 = isGuildVocalChannelType(property2);
|
|
string = intl.string;
|
|
t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
r28 = isGuildVocalChannelType2 ? Reflect.apply(string, intl, [t.cLjvKg]) : Reflect.apply(string, intl,
|
|
[t.hfbjIH]);
|
|
}
|
|
object16.description = r28;
|
|
object16.hasIcons = true;
|
|
TableSwitchRow = (require(6808) /* metro dependency 6808: TableSwitchRowNative */).TableSwitchRow;
|
|
GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
|
|
items4 = [<TableRowGroup {...object16}><TableSwitchRow label={property2 === GUILD_CATEGORY ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.lEPAZ5) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.aUI70g)} icon={((LockIcon) => <LockIcon />)((require(6705) /* metro dependency 6705: LockIcon */).LockIcon)} value={property6} onValueChange={onValueChange_70984} /></TableRowGroup>];
|
|
if (property6) {
|
|
moduleValue7 = require(9088) /* metro dependency 9088: ChannelPermissionsUtils */;
|
|
r22 = moduleValue7.canCreatePrivateChannel(property2, value7,
|
|
value8) ? null : <View style={styles.errorMessage}>{((HelpMessage) => <HelpMessage messageType={(require(1305) /* metro dependency 1305: native */).HelpMessageTypes.ERROR}>{(require(9088) /* metro dependency 9088: ChannelPermissionsUtils */).getPrivateChannelHintText(property2)}</HelpMessage>)((require(1305) /* metro dependency 1305: native */).HelpMessage)}</View>;
|
|
} else {
|
|
r22 = null;
|
|
}
|
|
items4[1] = r22;
|
|
r17 = <>{items4}</>;
|
|
}
|
|
items3[2] = r17;
|
|
r9 = <>{items3}</>;
|
|
} else {
|
|
r9 = null;
|
|
}
|
|
return (
|
|
<ScrollView keyboardShouldPersistTaps="always" contentContainerStyle={object18}>
|
|
<Stack spacing={PX_16}>
|
|
{input}
|
|
{r9}
|
|
{property4.message != null ? <View style={styles.errorMessage}>{((HelpMessage) => <HelpMessage messageType={(require(1305) /* metro dependency 1305: native */).HelpMessageTypes.ERROR}>{property4.message}</HelpMessage>)((require(1305) /* metro dependency 1305: native */).HelpMessage)}</View> : null}
|
|
</Stack>
|
|
</ScrollView>
|
|
);
|
|
}
|
|
|
|
function AddMembers(a0) { // fn#70985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:7558, offset: 0x01d10ec2, size: 671 bytes, params: 2, frame: 29
|
|
const env0_0 = a0;
|
|
const styles = useStyles();
|
|
let binding = env0_4;
|
|
const env0_1 = binding.useRef(a0);
|
|
const value2 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const guild = GuildStore.getGuild(a0.guildId);
|
|
const defaultImport = importDefault(44) /* metro dependency 44 */;
|
|
const value4 = null;
|
|
defaultImport(value4 != guild, 'Guild must not be null');
|
|
const currentUser = UserStore.getCurrentUser();
|
|
const env0_3 = currentUser;
|
|
defaultImport(value4 != currentUser, 'AddMembers: user cannot be undefined');
|
|
const can = PermissionStore.can;
|
|
const ADMINISTRATOR = Permissions.ADMINISTRATOR;
|
|
const value6 = Reflect.apply(can, PermissionStore, [ADMINISTRATOR, guild]);
|
|
var env0_4 = value6;
|
|
const isGuildOwner2 = isGuildOwner(guild, currentUser);
|
|
const [property, property2] = env0_3(env0_4.useState({}), 2);
|
|
const value10 = env0_3((importDefault(9085) /* metro dependency 9085: useCreateChannelSubmit */)(a0.onChannelCreated),
|
|
3);
|
|
const property3 = value10[0];
|
|
const property4 = value10[1];
|
|
const property5 = value10[2];
|
|
env0_4.useEffect(_fun70986);
|
|
binding = env0_4;
|
|
const useCallback = binding.useCallback;
|
|
env0_4.useLayoutEffect(_fun70989, [value2, property, property3, Reflect.apply(useCallback, binding, [_fun70987,
|
|
[value6, isGuildOwner2, value2, property5, property, currentUser.id]])]);
|
|
const r6 = value4 != property4.message ? property4.message === '' ? value4 : <View style={styles.errorMessage}>{((HelpMessage) => <HelpMessage messageType={(require(1305) /* metro dependency 1305: native */).HelpMessageTypes.ERROR}>{property4.message}</HelpMessage>)((require(1305) /* metro dependency 1305: native */).HelpMessage)}</View> : value4;
|
|
const AddMembersBody = (require(9095) /* metro dependency 9095: AddMembersActionSheet */).AddMembersBody;
|
|
return (
|
|
<View style={styles.addMembersContainer}>
|
|
{r6}
|
|
<AddMembersBody
|
|
channel={value4}
|
|
guild={guild}
|
|
pendingAdditions={property}
|
|
setPendingAdditions={property2}
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function getSceneTitle(a0, a1) { // fn#70992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:9262, offset: 0x01d11507, size: 376 bytes, params: 3, frame: 14
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
if (a1 != null) {
|
|
return intl.string(t.dEaPc4);
|
|
}
|
|
if (a0 === null) {
|
|
return intl.string(t['fUYU+j']);
|
|
}
|
|
const GUILD_TEXT = ChannelTypes.GUILD_TEXT;
|
|
if (GUILD_TEXT === a0) {
|
|
return intl.string(t['fUYU+j']);
|
|
}
|
|
const GUILD_VOICE = ChannelTypes.GUILD_VOICE;
|
|
if (GUILD_VOICE === a0) {
|
|
return intl.string(t['fUYU+j']);
|
|
}
|
|
const GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
|
|
if (GUILD_STAGE_VOICE === a0) {
|
|
return intl.string(t['fUYU+j']);
|
|
}
|
|
const GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
|
|
if (GUILD_ANNOUNCEMENT === a0) {
|
|
return intl.string(t['fUYU+j']);
|
|
}
|
|
const GUILD_FORUM = ChannelTypes.GUILD_FORUM;
|
|
if (GUILD_FORUM === a0) {
|
|
return intl.string(t['fUYU+j']);
|
|
}
|
|
const GUILD_MEDIA = ChannelTypes.GUILD_MEDIA;
|
|
if (GUILD_MEDIA === a0) {
|
|
return intl.string(t['fUYU+j']);
|
|
}
|
|
const GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
|
|
if (GUILD_CATEGORY === a0) {
|
|
return intl.string(t['ISN+NM']);
|
|
}
|
|
const Error = global.Error;
|
|
const value = 'Unsupported channelType: ' + a0;
|
|
const value2 = Object.create(Error.prototype, {constructor: {value: Error}});
|
|
const error = new Error();
|
|
throw error instanceof Object ? error : value2;
|
|
}
|
|
|
|
function CreateChannelModal(a0) { // fn#70993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:9890, offset: 0x01d1167f, size: 104 bytes, params: 2, frame: 16
|
|
const env0_0 = a0;
|
|
const {screens, initialStack} = (importDefault(6518) /* metro dependency 6518: useInitialValue */)(_fun70994);
|
|
const Navigator = (require(5280) /* metro dependency 5280: NavigatorNative */).Navigator;
|
|
return <Navigator screens={screens} initialRouteStack={initialStack} />;
|
|
}
|
|
|
|
function updateName(a0, a1) { // fn#70975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:3835, owner: CreateChannel.updateName, offset: 0x01d10aa4, size: 78 bytes, params: 3, frame: 14
|
|
var r1;
|
|
let value = a0;
|
|
const binding = env0_9;
|
|
if (CREATEABLE_NON_VOCAL_CHANNEL_NAME_TYPES.has(a1)) {
|
|
value = (require(4800) /* metro dependency 4800: ChannelUtils */).sanitizeGuildTextChannelName(value);
|
|
r1 = value;
|
|
} else {
|
|
r1 = value;
|
|
}
|
|
binding(r1);
|
|
}
|
|
|
|
function CreateChannelOnPress(a0) { // fn#70976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:3915, owner: CreateChannel.onPress, offset: 0x01d10af2, size: 33 bytes, params: 2, frame: 13
|
|
env0_11(a0);
|
|
updateName(env0_8, a0);
|
|
}
|
|
|
|
function _fun70978() { // fn#70978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:3285, offset: 0x01d10b2e, size: 39 bytes, params: 1, frame: 12
|
|
const cloneChannelIdBinding = cloneChannelId;
|
|
const value2 = null;
|
|
return value2 != cloneChannelIdBinding ? ChannelStore.getChannel(cloneChannelId) : value2;
|
|
}
|
|
|
|
function _fun70980() { // fn#70980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:4074, offset: 0x01d10b92, size: 122 bytes, params: 1, frame: 20
|
|
const binding = env0_12;
|
|
const setOptions = binding.setOptions;
|
|
const object2 = {};
|
|
object2.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton((importDefault(9087) /* metro dependency 9087: CreateChannelModalActionCreators */).close);
|
|
object2.headerRight = headerRight_70981;
|
|
object2.headerTitle = getSceneTitle(env0_10, env0_5);
|
|
Reflect.apply(setOptions, binding, [object2]);
|
|
}
|
|
|
|
function CreateChannelOnChange(a0) { // fn#70983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:5505, owner: CreateChannel.onChange, offset: 0x01d10e8d, size: 34 bytes, params: 2, frame: 13
|
|
if (env0_8 !== a0) {
|
|
updateName(a0, env0_10);
|
|
}
|
|
}
|
|
|
|
function CreateChannelOnValueChange(a0) { // fn#70984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:7161, owner: CreateChannel.onValueChange, offset: 0x01d10eaf, size: 19 bytes, params: 2, frame: 11
|
|
env0_16(a0);
|
|
}
|
|
|
|
function _fun70987() { // fn#70987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:7976, offset: 0x01d11161, size: 317 bytes, params: 1, frame: 26
|
|
var push;
|
|
var moduleValue2;
|
|
var ADD_MODERATORS;
|
|
var object3;
|
|
const {guildId, channelType, name, categoryId, onChannelCreated, flags} = env0_1.current;
|
|
const channelUtilsModule = require(4800) /* metro dependency 4800: ChannelUtils */;
|
|
const items2 = [];
|
|
const value3 = channelUtilsModule.permissionOverwritesForRoles(guildId, channelType, items2, true);
|
|
const Object = global.Object;
|
|
Object.values(env0_6).forEach(_fun70988);
|
|
let binding = env0_4;
|
|
if (!(binding || env0_5)) {
|
|
push = value3.push;
|
|
moduleValue2 = channelUtilsModule;
|
|
Reflect.apply(push, value3, [moduleValue2.permissionOverwriteForUser(env0_3.id, channelType)]);
|
|
}
|
|
const object4 = {overwrites: value3, guildId: guildId, channelType: channelType, name: name, categoryId: categoryId,
|
|
flags: flags};
|
|
const GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
|
|
if (channelType === GUILD_STAGE_VOICE) {
|
|
binding = env0_2;
|
|
push = binding.push;
|
|
ADD_MODERATORS = env1_27.ADD_MODERATORS;
|
|
object3 = {};
|
|
copyDataProperties(object3, object4, items2);
|
|
object3['guildId'] = guildId;
|
|
object3['onChannelCreated'] = onChannelCreated;
|
|
Reflect.apply(push, binding, [ADD_MODERATORS, object3]);
|
|
} else {
|
|
env0_8(object4);
|
|
}
|
|
}
|
|
|
|
function _fun70989() { // fn#70989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:8609, offset: 0x01d11374, size: 291 bytes, params: 1, frame: 18
|
|
var value3;
|
|
var value4;
|
|
const channelType = env0_1.current.channelType;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const env0_0 = Reflect.apply(string, intl, [t['5Wxrcd']]);
|
|
const Object = global.Object;
|
|
if (Object.keys(env0_6).length > 0) {
|
|
if (channelType === ChannelTypes.GUILD_STAGE_VOICE) {
|
|
value4 = intl.string(t.PDTjLN);
|
|
} else {
|
|
value3 = intl.string(t.CumH4u);
|
|
}
|
|
}
|
|
env0_2.setOptions({headerRight: env0_7 ? _fun70990 : _fun70991});
|
|
}
|
|
|
|
function _fun70994() { // fn#70994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:9937, offset: 0x01d116e7, size: 385 bytes, params: 1, frame: 24
|
|
const object5 = {};
|
|
let CREATE_CHANNEL = env1_27.CREATE_CHANNEL;
|
|
object5.name = CREATE_CHANNEL;
|
|
const object6 = {};
|
|
copyDataProperties(object6, env0_0, undefined);
|
|
object5.params = object6;
|
|
const items2 = [object5];
|
|
const object7 = {};
|
|
CREATE_CHANNEL = env1_27.CREATE_CHANNEL;
|
|
const object8 = {};
|
|
const ImpressionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionNames;
|
|
const CHANNEL_ADD_INFO = ImpressionNames.CHANNEL_ADD_INFO;
|
|
object8.impressionName = CHANNEL_ADD_INFO;
|
|
const ImpressionGroups = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionGroups;
|
|
let CHANNEL_ADD_FLOW = ImpressionGroups.CHANNEL_ADD_FLOW;
|
|
object8.impressionProperties = {impression_group: CHANNEL_ADD_FLOW};
|
|
object8.render = render_70995;
|
|
object7[CREATE_CHANNEL] = object8;
|
|
const ADD_MEMBERS = env1_27.ADD_MEMBERS;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const CHANNEL_ADD_MEMBERS = ImpressionNames.CHANNEL_ADD_MEMBERS;
|
|
CHANNEL_ADD_FLOW = ImpressionGroups.CHANNEL_ADD_FLOW;
|
|
object7[ADD_MEMBERS] = {headerTitle: Reflect.apply(string, intl, [t.dMJ3Y6]), impressionName: CHANNEL_ADD_MEMBERS,
|
|
impressionProperties: {impression_group: CHANNEL_ADD_FLOW}, render: render_70996};
|
|
const ADD_MODERATORS = env1_27.ADD_MODERATORS;
|
|
object7[ADD_MODERATORS] = {headerTitle: intl.string(t.n3bcy8), render: render_70997};
|
|
return {screens: object7, initialStack: items2};
|
|
}
|
|
|
|
function headerRight_70981() { // fn#70981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:4162, offset: 0x01d10c0c, size: 319 bytes, params: 1, frame: 24
|
|
var environment;
|
|
var r6;
|
|
var r7;
|
|
var r0;
|
|
var HeaderActionButton;
|
|
var object2;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var value5;
|
|
var moduleValue;
|
|
const value = environment.__proto__;
|
|
let binding = env1_13;
|
|
if (binding) {
|
|
const HeaderSubmittingIndicator = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).HeaderSubmittingIndicator;
|
|
r0 = <HeaderSubmittingIndicator />;
|
|
} else {
|
|
HeaderActionButton = (require(5277) /* metro dependency 5277: HeaderActionButtonNative */).HeaderActionButton;
|
|
object2 = {};
|
|
r6 = env1_15 || env1_10 === ChannelTypes.GUILD_STAGE_VOICE ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.PDTjLN) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.CumH4u);
|
|
object2.text = r6;
|
|
value5 = env1_8 === '';
|
|
if (value5) {
|
|
r6 = value5;
|
|
} else {
|
|
binding = env1_15;
|
|
if (binding) {
|
|
moduleValue = require(9088) /* metro dependency 9088: ChannelPermissionsUtils */;
|
|
r7 = !moduleValue.canCreatePrivateChannel(env1_10, env1_6, env1_7);
|
|
} else {
|
|
r7 = binding;
|
|
}
|
|
r6 = r7;
|
|
}
|
|
object2.disabled = r6;
|
|
object2.onPress = onPress_70982;
|
|
r0 = <HeaderActionButton {...object2} />;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun70988({row}) { // fn#70988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:8157, offset: 0x01d1129e, 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__.__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, channelType)]);
|
|
} 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, channelType)]);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun70990() { // fn#70990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:8848, offset: 0x01d11497, size: 45 bytes, params: 1, frame: 13
|
|
const HeaderSubmittingIndicator = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).HeaderSubmittingIndicator;
|
|
return <HeaderSubmittingIndicator />;
|
|
}
|
|
|
|
function _fun70991() { // fn#70991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:8893, offset: 0x01d114c4, size: 67 bytes, params: 1, frame: 14
|
|
const HeaderActionButton = (require(5277) /* metro dependency 5277: HeaderActionButtonNative */).HeaderActionButton;
|
|
return <HeaderActionButton text={env0_0} onPress={env1_9} />;
|
|
}
|
|
|
|
function render_70995(a0) { // fn#70995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:10171, offset: 0x01d11868, size: 33 bytes, params: 2, frame: 13
|
|
return <CreateChannel {...a0} />;
|
|
}
|
|
|
|
function render_70996(a0) { // fn#70996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:10418, offset: 0x01d11889, size: 33 bytes, params: 2, frame: 13
|
|
return <AddMembers {...a0} />;
|
|
}
|
|
|
|
function render_70997(a0) { // fn#70997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:10522, offset: 0x01d118aa, size: 49 bytes, params: 2, frame: 14
|
|
const value = environment.__proto__.__proto__;
|
|
return ((Component) => <Component {...a0} />)(importDefault(9108) /* metro dependency 9108: AddModerators */);
|
|
}
|
|
|
|
function headerRight_70981OnPress() { // fn#70982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:4424, owner: headerRight_70981.onPress, offset: 0x01d10d4b, size: 322 bytes, params: 1, frame: 16
|
|
var r0;
|
|
var value2;
|
|
var defaultImport;
|
|
var binding;
|
|
var value5;
|
|
var push;
|
|
var value6;
|
|
const object2 = {};
|
|
if (env2_5 != null) {
|
|
value2 = environment.__proto__.__proto__.__proto__;
|
|
defaultImport = importDefault(22) /* metro dependency 22 */;
|
|
r0 = defaultImport.values(env2_5.permissionOverwrites);
|
|
} else {
|
|
r0 = [];
|
|
}
|
|
object2.overwrites = r0;
|
|
const value4 = undefined;
|
|
object2.bitrate = env2_5 == null ? value4 : env2_5.bitrate;
|
|
const userLimit = env2_5 == null ? value4 : env2_5.userLimit;
|
|
object2.userLimit = userLimit;
|
|
object2.createMode = createMode;
|
|
object2.guildId = guildId;
|
|
object2.name = env2_8;
|
|
object2.channelType = env2_10;
|
|
object2.categoryId = categoryId;
|
|
object2.onChannelCreated = onChannelCreated;
|
|
if (env2_15) {
|
|
binding = env2_12;
|
|
push = binding.push;
|
|
value6 = environment.__proto__.__proto__.__proto__;
|
|
Reflect.apply(push, binding, [env3_27.ADD_MEMBERS, {guildId: guildId, channelType: env2_10, name: env2_8,
|
|
categoryId: categoryId, onChannelCreated: onChannelCreated}]);
|
|
} else {
|
|
binding = env2_10;
|
|
value5 = environment.__proto__.__proto__.__proto__;
|
|
if (binding === ChannelTypes.GUILD_STAGE_VOICE) {
|
|
binding = env2_12;
|
|
binding.push(env3_27.ADD_MODERATORS, object2);
|
|
} else {
|
|
env2_14(object2);
|
|
}
|
|
}
|
|
return value4;
|
|
}
|
|
|