Files
discord-decomp/sources/components_native/chat/ChatBeginningRow.tsx
T
2026-07-27 16:20:00 +03:00

1156 lines
68 KiB
TypeScript

/* Metro module 11926; source: components_native/chat/ChatBeginningRow.tsx; dependencies: [57, 5, 31, 27, 4502, 1378, 6865, 9113, 5189, 1383, 1422, 5109, 1379, 1935, 1945, 1867, 3784, 3793, 4864, 1878, 661, 1386, 11927, 11899, 8781, 33, 4501, 697, 6682, 1244, 6684, 6689, 6691, 4559, 4573, 3853, 3860, 5278, 11392, 1305, 11928, 8148, 9646, 566, 3995, 8206, 4020, 4805, 9088, 6863, 11089, 4048, 6622, 11929, 11930, 44, 21, 11932, 3856, 9112, 4660, 11936, 5586, 9151, 5930, 1948, 11937, 11940, 8153, 4603, 4578, 11944, 4497, 11945, 6779, 8092, 683, 10630, 8194, 6613, 6610, 3857, 4080, 11947, 1962, 6771, 11948, 8491, 8743, 6797, 8822, 8515, 6947, 5080, 8863, 6819, 8783, 8800, 8796, 8794, 10348, 7975, 4007, 8879, 3968, 1365, 11388, 5225, 9719, 10859, 4056, 11949, 11953, 2] */
function _fun91451(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#91451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:6, offset: 0x02064c66, size: 1569 bytes, params: 8, frame: 28
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importDefault(5) /* metro dependency 5 */;
const env0_5 = importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_6 = value.ActivityIndicator;
const env0_7 = value.View;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const embeddedActivitiesStore = importDefault(1378) /* metro dependency 1378: EmbeddedActivitiesStore */;
const forumPostMessagesStore = importDefault(6865) /* metro dependency 6865: ForumPostMessagesStore */;
const guildSettingsStore = importDefault(9113) /* metro dependency 9113: GuildSettingsStore */;
const userProfileStore = importDefault(5189) /* metro dependency 5189: UserProfileStore */;
const env0_13 = (require(1383) /* metro dependency 1383: ChannelRecord */).THREAD_CHANNEL_TYPES;
const env0_14 = (require(1422) /* metro dependency 1422: GuildRecord */).isGuildOwner;
const authorizedAppsStore = importDefault(5109) /* metro dependency 5109: AuthorizedAppsStore */;
const env0_16 = (require(5109) /* metro dependency 5109: AuthorizedAppsStore */).FetchState;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildChannelStore = importDefault(1935) /* metro dependency 1935: GuildChannelStore */;
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
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 userGuildSettingsStore = importDefault(4864) /* metro dependency 4864: UserGuildSettingsStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
value = require(661) /* metro dependency 661: Constants */;
const env0_25 = value.AnalyticEvents;
const env0_26 = value.AnalyticsPages;
const env0_27 = value.AnalyticsSections;
const env0_28 = value.ChannelSettingsSections;
const env0_29 = value.EMPTY_STRING_SNOWFLAKE_ID;
const env0_30 = value.GuildSettingsSections;
const env0_31 = value.HelpdeskArticles;
const env0_32 = value.InstantInviteSources;
const env0_33 = value.Permissions;
const env0_34 = value.RelationshipTypes;
const env0_35 = value.UPLOAD_MEDIUM_SIZE;
const env0_36 = value.WELCOME_OLD_GUILD_AGE_THRESHOLD;
const env0_37 = (require(1386) /* metro dependency 1386: ChannelConstants */).ChannelFlags;
value = require(11927) /* metro dependency 11927: GuildProgressConstants */;
const env0_38 = value.AnalyticsActions;
const env0_39 = value.AnalyticsSetupTypes;
const env0_40 = (require(11899) /* metro dependency 11899: MessageRequestConstants */).MOBILE_MESSAGE_REQUESTS_MODAL_KEY;
const env0_41 = (require(8781) /* metro dependency 8781: RestrictionConfirmationConstants */).BLOCK_CONFIRMATION_ACTION_SHEET_KEY;
value = require(33) /* metro dependency 33 */;
const env0_42 = value.jsx;
const env0_43 = value.Fragment;
const env0_44 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {container: {'position': 'absolute', 'paddingVertical': 8, 'paddingHorizontal': 12, 'width': '100%'}};
object2.title = {marginTop: 16};
object2.subtitle = {'marginBottom': 16, 'lineHeight': 20};
const object5 = {'borderRadius': null, 'marginTop': 16, 'width': '100%'};
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object2.gdmInviteFriends = object5;
const object6 = {'borderRadius': null, 'marginTop': 8, 'width': '100%'};
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object2.gdmShareInviteLink = object6;
object2.gdmShareInviteLinkNoRelationships = {marginTop: 16};
object2.ctaLabel = {marginLeft: 8};
object2.ctaContainer = {'flexDirection': 'row', 'flexWrap': 'wrap'};
object2.ctaButton = {'flexDirection': 'row', 'alignItems': 'center'};
object2.ctaAddRoles = {paddingRight: 24};
object2.avatar = {marginBottom: 16};
object2.avatarRedesign = {marginBottom: 16};
object2.centerHeader = {'paddingHorizontal': 8, 'alignItems': 'center'};
object2.gdmText = {textAlign: 'center'};
object2.dmTitle = {'marginBottom': 8, 'textAlign': 'center'};
object2.dmBeginningMessage = {marginTop: 8};
object2.provisionalAccountExplainer = {marginTop: 12};
object2.mutualGuildsLabel = {'marginTop': 8, 'marginLeft': 8, 'height': 26};
object2.mutualGuildsContainer = {'flexDirection': 'row', 'alignItems': 'center', 'marginTop': 6};
const object7 = {'width': 64, 'height': 64, 'borderRadius': null, 'backgroundColor': null,
'justifyContent': 'center', 'alignItems': 'center'};
object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xxl;
const BACKGROUND_MOD_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_MUTED;
object7.backgroundColor = BACKGROUND_MOD_MUTED;
object2.iconContainer = object7;
object2.threadDetails = {lineHeight: 20};
object2.threadCreatorRoleDot = {'paddingRight': 4, 'paddingTop': 2};
object2.tagContainer = {'marginTop': 8, 'display': 'flex', 'flexDirection': 'row', 'flexWrap': 'wrap'};
const object8 = {'borderRadius': null, 'backgroundColor': null, 'height': 24, 'width': 24, 'padding': 4,
'alignContent': 'center'};
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
const STATUS_POSITIVE = (importDefault(697) /* metro dependency 697: native */).colors.STATUS_POSITIVE;
object8.backgroundColor = STATUS_POSITIVE;
object2.unmutedNotificationContainer = object8;
object2.unmutedNotification = {'width': 16, 'height': 16};
object2.dmButtonRow = {'marginTop': 16, 'flexDirection': 'row', 'flexWrap': 'wrap', 'alignItems': 'center',
'gap': 8};
object2.pendingIncoming = {'flexDirection': 'column', 'gap': 8};
object2.pendingIncomingButtons = {'flexDirection': 'row', 'flexWrap': 'wrap', 'gap': 8};
object2.appDMButtonIcon = {marginRight: 2};
object2.formCtaIcon = {'width': 32, 'height': 32};
const env0_45 = Reflect.apply(createStyles, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/chat/ChatBeginningRow.tsx');
exports.default = ChatBeginningRow;
}
function ChatBeginningRowIcon(a0) { // fn#91452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:2625, offset: 0x02065287, size: 383 bytes, params: 2, frame: 20
const isPrivate = a0.isPrivate;
const isThread = a0.isThread;
a0.isNSFW;
const isForumPost = a0.isForumPost;
const styles = useStyles();
const object2 = {};
if (isForumPost) {
object2.IconComponent = (require(6682) /* metro dependency 6682: ChatIcon */).ChatIcon;
object2.label = (require(1244) /* metro dependency 1244: indexNative */).t.Y4REmB;
} else if (isThread) {
object2.IconComponent = (require(6684) /* metro dependency 6684: ThreadIcon */).ThreadIcon;
object2.label = (require(1244) /* metro dependency 1244: indexNative */).t['7Xm5QI'];
} else if (isPrivate) {
object2.IconComponent = (require(6689) /* metro dependency 6689: TextLockIcon */).TextLockIcon;
object2.label = (require(1244) /* metro dependency 1244: indexNative */).t.GK18KJ;
} else {
object2.IconComponent = (require(6691) /* metro dependency 6691: TextIcon */).TextIcon;
object2.label = (require(1244) /* metro dependency 1244: indexNative */).t.GK18KJ;
}
const IconComponent = object2.IconComponent;
return (
<View style={styles.iconContainer}>
<IconComponent
size="lg"
color="icon-strong"
accessibilityLabel={(require(1244) /* metro dependency 1244: indexNative */).intl.string(object2.label)}
/>
</View>
);
}
function ChatBeginningRowHeader({title, subtitle, isPrivate, isThread, isNSFW, isForumPost, subtitleLink}) { // fn#91453, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:3116, offset: 0x02065406, size: 371 bytes, params: 2, frame: 29
var r11;
var r5;
var object;
const styles = useStyles();
const r13 = subtitleLink != null && (require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */).useIsScreenReaderEnabled();
const jsxRuntimeEnv0_43Binding = jsxRuntimeEnv0_43;
const items2 = [<ChatBeginningRowIcon isNSFW={isNSFW} isPrivate={isPrivate} isThread={isThread} isForumPost={isForumPost} />];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
items2[1] = <Text style={[styles.title,
{marginBottom: isForumPost ? 0 : 8}]} accessibilityRole="header" variant="heading-xl/extrabold" color="mobile-text-heading-primary">{title}</Text>;
const value8 = subtitle != null;
if (value8) {
object = {};
r11 = r13 ? 'link' : undefined;
object.accessibilityRole = r11;
r11 = r13 ? _fun91454 : undefined;
object.onPress = r11;
object.style = styles.subtitle;
object.variant = 'text-md/medium';
object.color = 'text-default';
r5 = <Text {...object}>{subtitle}</Text>;
} else {
r5 = value8;
}
items2[2] = r5;
return (
<>
{items2}
</>
);
}
function LinkManageButtons({canManageRoles, canEdit, isPrivate, channel, theme}) { // fn#91455, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:3727, offset: 0x020655a6, size: 730 bytes, params: 2, frame: 31
var r5;
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
var object2;
var items2;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var object5;
var items6;
const styles = useStyles();
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
const useToken = useTokenModule.useToken;
const TEXT_LINK = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_LINK;
const value2 = Reflect.apply(useToken, useTokenModule, [TEXT_LINK, theme]);
let r6 = isPrivate && canManageRoles;
if (r6) {
var pressableOpacityProps = {accessibilityRole: 'button', onPress: onPress_91456, style: [styles.ctaButton,
styles.subtitle]};
items2 = [((Icon) => <Icon source={importDefault(11928) /* metro dependency 11928 */} size={(require(1305) /* metro dependency 1305: native */).IconSizes.REFRESH_SMALL_16} color={value2} />)((require(1305) /* metro dependency 1305: native */).Icon)];
items2[1] = <Text style={[styles.ctaLabel,
styles.ctaAddRoles]} variant="text-sm/medium" color="text-link">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.dMJ3Y6)}</Text>;
r6 = <PressableOpacity {...pressableOpacityProps}>{items2}</PressableOpacity>;
}
if (canEdit) {
var pressableOpacityProps = {accessibilityRole: 'button', onPress: onPress_91457, style: [styles.ctaButton,
styles.subtitle]};
items6 = [((PencilIcon) => <PencilIcon size="xs" color={value2} />)((require(9646) /* metro dependency 9646: PencilIcon */).PencilIcon)];
items6[1] = <Text style={[styles.ctaLabel]} variant="text-sm/medium" color="text-link">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.GE1Tlo)}</Text>;
r5 = <PressableOpacity {...pressableOpacityProps}>{items6}</PressableOpacity>;
} else {
r5 = canEdit;
}
return (
<View style={styles.ctaContainer}>
{r6}
{r5}
</View>
);
}
function ThreadOwner({userId, guildId}) { // fn#91458, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:4645, offset: 0x020658fd, size: 667 bytes, params: 2, frame: 28
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
var value;
const styles = useStyles();
const user = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getUser(userId);
});
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildMemberStore], _fun91460);
const roleStyle = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.roleStyle;
});
let r2 = value3?.nick ?? (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
const r4 = r2 ?? '???';
r2 = value3?.colorString ?? null;
let r5 = value3?.colorStrings ?? null;
const value7 = (require(8206) /* metro dependency 8206: EnhancedRoleColorUtils */).useProcessColorStringsArray(r5);
const enhancedRoleColorUtilsModule = require(8206) /* metro dependency 8206: EnhancedRoleColorUtils */;
const useIsRoleStyleAndRoleColorsEligibleForERC = enhancedRoleColorUtilsModule.useIsRoleStyleAndRoleColorsEligibleForERC;
if (roleStyle === 'username') {
r5 = r2 != null ? {color: r2} : undefined;
value = require(4020) /* metro dependency 4020: FabricUtils */;
return (
<Text
experimental_useNativeText={!value.isFabric()}
gradientColors={Reflect.apply(useIsRoleStyleAndRoleColorsEligibleForERC, enhancedRoleColorUtilsModule,
[guildId, user?.id, roleStyle, value7]) ? value7 : undefined}
style={r5}
variant="text-md/semibold"
color="text-default"
>
{r4}
</Text>
);
}
return (
<>
{roleStyle === 'dot' && r2 != null && ((RoleDot) => <RoleDot color={r2} colors={r5} containerStyles={styles.threadCreatorRoleDot} />)((require(1305) /* metro dependency 1305: native */).RoleDot)}
<Text variant="text-md/semibold" color="text-default">
{r4}
</Text>
</>
);
}
function ChatBeginningRowThread({channel}) { // fn#91462, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:5595, offset: 0x02065bef, size: 635 bytes, params: 2, frame: 30
var r6;
var r0;
var jsxRuntimeEnv0_43Binding;
var isForumPost;
var items2;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const styles = useStyles();
const value2 = (importDefault(4805) /* metro dependency 4805: useChannelName */)(channel);
const isPrivateGuildChannel2 = (require(9088) /* metro dependency 9088: ChannelPermissionsUtils */).isPrivateGuildChannel(channel);
const value3 = (require(6863) /* metro dependency 6863: ForumTagHooks */).useAppliedTags(channel);
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStoresObject = fluxModule.useStateFromStoresObject;
if (channel.threadMetadata == null) {
r0 = null;
} else {
jsxRuntimeEnv0_43Binding = jsxRuntimeEnv0_43;
items2 = [<ChatBeginningRowHeader isNSFW={channel.isNSFW()} title={value2} isPrivate={isPrivateGuildChannel2} isThread isForumPost={channel.isForumPost()} />];
isForumPost = channel.isForumPost;
r6 = Reflect.apply(isForumPost, channel,
[]) && value3.length > 0 ? <View style={styles.tagContainer}>{value3.map(_fun91464)}</View> : null;
items2[1] = r6;
r6 = !channel.isForumPost() && <Text style={styles.threadDetails} variant="text-md/medium" color="text-default">{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.imPXd5,
{usernameHook: usernameHook_91465})}</Text>;
items2[2] = r6;
isForumPost = channel.isForumPost;
r6 = Reflect.apply(isForumPost, channel, []) && Reflect.apply(useStateFromStoresObject, fluxModule,
[[ForumPostMessagesStore], function() {
return ForumPostMessagesStore.getMessage(channel.id);
}]).firstMessage == null ? <Text style={styles.threadDetails} variant="text-md/medium" color="text-default">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.mE3KJN)}</Text> : null;
items2[3] = r6;
r0 = <>{items2}</>;
}
return r0;
}
function ChatBeginningRowGuildNonDefaultChannel({guild, channel}) { // fn#91466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:6491, offset: 0x02065ef9, size: 571 bytes, params: 2, frame: 29
var r5;
var value;
const value2 = (importDefault(4805) /* metro dependency 4805: useChannelName */)(channel, true);
const value3 = (importDefault(4805) /* metro dependency 4805: useChannelName */)(channel, false);
let can = PermissionStore.can;
const MANAGE_CHANNELS = Permissions.MANAGE_CHANNELS;
const value4 = Reflect.apply(can, PermissionStore, [MANAGE_CHANNELS, channel]);
can = PermissionStore.can;
const MANAGE_ROLES = Permissions.MANAGE_ROLES;
const value5 = Reflect.apply(can, PermissionStore, [MANAGE_ROLES, channel]);
can = PermissionStore.can;
const READ_MESSAGE_HISTORY = Permissions.READ_MESSAGE_HISTORY;
const value6 = Reflect.apply(can, PermissionStore, [READ_MESSAGE_HISTORY, channel]);
const isPrivateGuildChannel2 = (require(9088) /* metro dependency 9088: ChannelPermissionsUtils */).isPrivateGuildChannel(channel);
const value7 = (importDefault(4048) /* metro dependency 4048: useTheme */)();
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const value8 = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.q0tgLe,
{channelName: value2});
const r12 = isPrivateGuildChannel2 ? intl.format((require(1244) /* metro dependency 1244: indexNative */).t.QuwqjG,
{channelName: value2,
topicHook: topicHook}) : value6 ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.JHKUGB,
{channelName: value2}) : intl.format((require(1244) /* metro dependency 1244: indexNative */).t.hPVEQG,
{channelName: value3});
const jsxRuntimeEnv0_43Binding = jsxRuntimeEnv0_43;
const items2 = [<ChatBeginningRowHeader title={value8} subtitle={r12} isPrivate={isPrivateGuildChannel2} />];
items2[1] = <LinkManageButtons canManageRoles={value5} canEdit={value4} isPrivate={isPrivateGuildChannel2} channel={channel} theme={value7} />;
if (isPrivateGuildChannel2) {
if (value4) {
value = importDefault(11929) /* metro dependency 11929: ChannelAccessInfo */;
value = ((Component) => <Component channel={channel} guild={guild} />)(value);
r5 = value;
} else {
r5 = null;
}
} else {
r5 = null;
}
items2[2] = r5;
return (
<>
{items2}
</>
);
}
function ChatBeginningRowGuild({guild, channel}) { // fn#91468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:7263, offset: 0x02066176, size: 180 bytes, params: 2, frame: 18
const defaultChannel = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildChannelStore],
function() {
return GuildChannelStore.getDefaultChannel(guild.id);
});
const can = PermissionStore.can;
const READ_MESSAGE_HISTORY = Permissions.READ_MESSAGE_HISTORY;
return Reflect.apply(can, PermissionStore, [READ_MESSAGE_HISTORY,
channel]) && defaultChannel?.id === channel.id ? <ChatBeginningRowGuildDefaultChannel guild={guild} channel={channel} /> : <ChatBeginningRowGuildNonDefaultChannel guild={guild} channel={channel} />;
}
function DMSpamButton({channel, user, showingSpamBanner}) { // fn#91470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:9802, offset: 0x0206624a, size: 247 bytes, params: 2, frame: 22
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const value2 = (require(11940) /* metro dependency 11940: useDMMessageToReport */).useDMMessageToReport(channel,
user.id, user.bot === true);
const message = value2.message;
if (!showingSpamBanner) {
if (value2.isReportable) {
if (message != null) {
return (
<Button
size="sm"
variant="destructive"
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.HHZmDn)}
disabled={message == null}
onPress={onPress_91471}
/>
);
}
if (value2.isLoaded) {
return null;
}
return (
<Button
size="sm"
variant="destructive"
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.HHZmDn)}
disabled={message == null}
onPress={onPress_91471}
/>
);
}
}
return null;
}
function ManageAppButton({user, application, channel, oauth2Token}) { // fn#91473, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:10223, offset: 0x020663b9, size: 341 bytes, params: 2, frame: 23
var r0;
var Button;
var intl;
const styles = useStyles();
const env0_3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([EmbeddedActivitiesStore],
function() {
return EmbeddedActivitiesStore.getSelfEmbeddedActivities();
});
if (user.bot) {
if (application != null) {
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = <Button size="sm" variant="secondary" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5S3sQF'])} icon={((Icon) => <Icon size={(require(1305) /* metro dependency 1305: native */).Icon.Sizes.SMALL} source={importDefault(11944) /* metro dependency 11944 */} style={styles.appDMButtonIcon} />)((require(1305) /* metro dependency 1305: native */).Icon)} onPress={onPress_91475} />;
} else {
r0 = null;
}
} else {
r0 = null;
}
return r0;
}
function MuteAppButton({channel, user}) { // fn#91477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:10938, offset: 0x02066658, size: 411 bytes, params: 2, frame: 25
var r6;
var r0;
var Button;
var intl;
var string;
var t;
var Icon;
const styles = useStyles();
const moduleValue = require(dependencyMap[43]);
const useStateFromStores = moduleValue.useStateFromStores;
let object = [UserGuildSettingsStore];
const value3 = Reflect.apply(useStateFromStores, moduleValue, [object, function() {
return UserGuildSettingsStore.isChannelMuted(null, channel.id);
}]);
if (user.bot) {
Button = require(dependencyMap[70]).Button;
object = {size: 'sm'};
r6 = value3 ? 'secondary' : 'destructive';
object.variant = r6;
intl = require(dependencyMap[29]).intl;
string = intl.string;
t = require(dependencyMap[29]).t;
r6 = value3 ? Reflect.apply(string, intl, [t.YqAjXy]) : Reflect.apply(string, intl, [t.w4m945]);
object.text = r6;
Icon = require(dependencyMap[39]).Icon;
object.icon = <Icon size={require(dependencyMap[39]).Icon.Sizes.SMALL} source={importDefault(value3 ? dependencyMap[77] : dependencyMap[78])} color={value3 ? undefined : importDefault(dependencyMap[27]).unsafe_rawColors.WHITE} style={styles.appDMButtonIcon} />;
object.onPress = onPress_91479;
r0 = <Button {...object} />;
} else {
r0 = null;
}
return r0;
}
function ChatBeginningRowDM({channel, showingSpamBanner}) { // fn#91481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:11851, offset: 0x020669be, size: 1557 bytes, params: 2, frame: 40
var r6;
var object6;
const closure = onPress_91482;
const styles = useStyles();
const env0_2 = (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations;
const user = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getUser(channel.getRecipientId());
});
const value4 = (importDefault(11948) /* metro dependency 11948: getApplicationFromBotUserId */)(user?.id ?? EMPTY_STRING_SNOWFLAKE_ID);
const {authorizedAppToken,
authorizedAppsFetchState} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([AuthorizedAppsStore],
_fun91484);
const env0_5 = authorizedAppsFetchState;
const env0_6 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserProfileStore], _fun91485,
[user]);
const isSystemDM2 = channel.isSystemDM();
env0_5.useEffect(_fun91486, [user, channel]);
env0_5.useEffect(_fun91487, [user?.bot, authorizedAppToken, authorizedAppsFetchState]);
if (user == null) {
return null;
}
const userTag = (importDefault(3995) /* metro dependency 3995: UserUtils */).getUserTag(user,
{'decoration': 'never', 'identifiable': 'always'});
const name = (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const Rzvnig = (require(1244) /* metro dependency 1244: indexNative */).t.Rzvnig;
const r11 = isSystemDM2 ? Reflect.apply(string, intl,
[Rzvnig]) : intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.Q56TRC,
{username: name});
const dMSpamButton = <DMSpamButton channel={channel} user={user} showingSpamBanner={showingSpamBanner} />;
const jsxRuntimeEnv0_43Binding = jsxRuntimeEnv0_43;
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
const pressableOpacityProps = {accessibilityRole: 'button', onPress: onPress_91499,
accessibilityLabel: intl.string((require(1244) /* metro dependency 1244: indexNative */).t.iXAna6)};
const Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
const guild_id = channel.guild_id;
const AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
const XXLARGE = AvatarSizes.XXLARGE;
const items2 = [<PressableOpacity {...pressableOpacityProps}><Avatar style={styles.avatar} user={user} guildId={guild_id} size={XXLARGE} avatarDecoration={user.avatarDecoration} /></PressableOpacity>];
string = intl.string;
const y5MwJy = (require(1244) /* metro dependency 1244: indexNative */).t.y5MwJy;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
items2[1] = <PressableOpacity accessibilityRole="button" onPress={closure} accessibilityHint={Reflect.apply(string,
intl,
[y5MwJy])}><Text variant="heading-xxl/extrabold" color="mobile-text-heading-primary">{name}</Text></PressableOpacity>;
if (user.isProvisional) {
r6 = null;
} else {
r6 = <PressableOpacity accessibilityRole="button" onPress={closure} accessibilityHint={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.y5MwJy)}><Text variant="heading-lg/medium" color="text-default">{userTag}</Text></PressableOpacity>;
}
items2[2] = r6;
items2[3] = <Text style={styles.dmBeginningMessage} variant="text-md/medium" color="text-default">{r11}</Text>;
items2[4] = user.isProvisional ? ((ChatProvisionalAccountExplainerCard) => <ChatProvisionalAccountExplainerCard style={styles.provisionalAccountExplainer} userId={user.id} iconSize={14} />)((require(10348) /* metro dependency 10348: ProvisionalAccountExplainer */).ChatProvisionalAccountExplainerCard) : null;
items2[5] = _fun91500();
items2[6] = <View style={styles.dmButtonRow}>{user.isNonUserBot() ? null : user.bot ? <>{authorizedAppToken != null && value4 != null ? <><MuteAppButton channel={channel} user={user} /><ManageAppButton user={user} application={value4} channel={channel} oauth2Token={authorizedAppToken} /></> : null}{dMSpamButton}</> : <RelationshipButtons reportButton={dMSpamButton} />}</View>;
return (
<>
{items2}
</>
);
}
function ChatBeginningRowButton({title, subtitle, IconComponent, iconVariant, style, onPress, trailing}) { // fn#91503, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:17302, offset: 0x02067bfe, size: 172 bytes, params: 2, frame: 26
const RowButton = (require(7975) /* metro dependency 7975: RowButtonNative */).RowButton;
const RowButton2 = (require(7975) /* metro dependency 7975: RowButtonNative */).RowButton;
const Icon = RowButton2.Icon;
return (
<View style={style}>
<RowButton
onPress={onPress}
icon={<Icon IconComponent={IconComponent} variant={iconVariant} />}
label={title}
subLabel={subtitle}
trailing={trailing}
/>
</View>
);
}
function ChatBeginningRowGroupDM({channel}) { // fn#91504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:17572, offset: 0x02067caa, size: 1145 bytes, params: 2, frame: 34
var r12;
var r10;
var r5;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var jsxRuntimeEnv0_43Binding;
var items2;
var object8;
var value;
const styles = useStyles();
const value2 = (importDefault(4805) /* metro dependency 4805: useChannelName */)(channel);
const [property, property2] = env0_3(env0_5.useState(false), 2);
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStores([RelationshipStore], _fun91505);
const value6 = env0_5.useCallback(function() {
require(dependencyMap[102]).navigateToNewGroupDM(channel.id, AnalyticsSections.CHANNEL_TEXT_AREA);
}, [channel]);
const value8 = env0_5.useCallback(env0_4(_fun91508), [channel, property, property2]);
const value9 = env0_5.useCallback(_fun91509, [value6]);
const value10 = env0_5.useCallback(_fun91510, [value8]);
const id = channel.id;
const FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID = (require(5225) /* metro dependency 5225: FakePlaceholderPrivateChannel */).FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID;
const value11 = id === FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID;
const GroupDMAvatar = importDefault(9719) /* metro dependency 9719: GroupDMAvatar */;
const AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
const XXLARGE = AvatarSizes.XXLARGE;
const items3 = [<GroupDMAvatar style={styles.avatarRedesign} channel={channel} size={XXLARGE} accessible={false} />];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
items3[1] = <Text style={styles.dmTitle} variant={value2 != null && value2.length > 40 ? 'heading-lg/extrabold' : 'heading-xxl/extrabold'} color="mobile-text-heading-primary">{value2}</Text>;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
items3[2] = <Text style={styles.gdmText} variant="text-md/medium" color="text-default">{value11 ? intl.format((require(1244) /* metro dependency 1244: indexNative */).t.MFwcqO,
{name: value2}) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['0Q7uk0'])}</Text>;
if (value11) {
r5 = null;
} else {
jsxRuntimeEnv0_43Binding = jsxRuntimeEnv0_43;
if (value5) {
r12 = <ChatBeginningRowButton style={styles.gdmInviteFriends} onPress={value9} IconComponent={(require(10859) /* metro dependency 10859: GroupPlusIcon */).GroupPlusIcon} iconVariant="default" title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['LR+Ptf'])} />;
} else {
r12 = null;
}
items2 = [r12];
items2[1] = <ChatBeginningRowButton style={[styles.gdmShareInviteLink,
value5 ? null : styles.gdmShareInviteLinkNoRelationships]} onPress={value10} IconComponent={(require(4056) /* metro dependency 4056: LinkIcon */).LinkIcon} title={intl.string(t['3XVNyt'])} subtitle={intl.string(t.qa9CQu)} trailing={property ? <ActivityIndicator /> : null} />;
if (channel.hasFlag(ChannelFlags.IS_JOIN_REQUEST_INTERVIEW_CHANNEL)) {
value = importDefault(11949) /* metro dependency 11949: ChatBeginningRowJoinApplication */;
value = ((Component) => <Component channelId={channel.id} />)(value);
r10 = value;
} else {
r10 = null;
}
items2[2] = r10;
value = <>{items2}</>;
r5 = value;
}
items3[3] = r5;
return (
<View style={styles.centerHeader}>
{items3}
</View>
);
}
function ChatBeginningRowGuildDefaultChannel({guild, channel}) { // fn#91511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:7616, offset: 0x0206831f, size: 1290 bytes, params: 2, frame: 32
var r11;
var r12;
var ProgressItem;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var ProgressItem2;
const env0_2 = guild.id;
const styles = useStyles();
const {guildPopulated,
guildPersonalized} = (require(11930) /* metro dependency 11930: GuildProgressHooks */).useCompletedStates(guild);
const {canInvite,
canManageGuild} = (require(11930) /* metro dependency 11930: GuildProgressHooks */).usePermissions(channel,
guild);
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
(importDefault(44) /* metro dependency 44 */)(currentUser != null,
'ChatBeginningRowGuildDefaultChannel: currentUser cannot be undefined');
const isGuildOwner2 = isGuildOwner(guild, currentUser);
const defaultImport2 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
const value6 = defaultImport2.extractTimestamp(guild.id);
const Date = global.Date;
const value8 = value6 < Date.now() - WELCOME_OLD_GUILD_AGE_THRESHOLD;
const isPrivateGuildChannel2 = (require(9088) /* metro dependency 9088: ChannelPermissionsUtils */).isPrivateGuildChannel(channel);
const value9 = (require(11932) /* metro dependency 11932: GuildProgressUtils */).useIsEligibleForGuildProgress(guild);
env0_5.useLayoutEffect(_fun91519,
[(require(566) /* metro dependency 566: flux */).useStateFromStoresObject([GuildSettingsStore], function() {
return GuildSettingsStore.getErrors();
}).message]);
if (canManageGuild) {
ProgressItem = importDefault(11936) /* metro dependency 11936: ProgressItem */;
r11 = <ProgressItem onPress={function() {
return _addServerIcon.apply(this, arguments);
}} source={{uri: importDefault(5586) /* metro dependency 5586: BrushIllocon2xPng */}} iconStyle={styles.formCtaIcon} title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['Yhi9/N'])} isCompleted={guildPersonalized} analyticsSetupType={AnalyticsSetupTypes.CHANNEL_WELCOME} analyticsAction={AnalyticsActions.PERSONALIZE_SERVER} />;
} else {
r11 = undefined;
}
if (canInvite) {
ProgressItem2 = importDefault(11936) /* metro dependency 11936: ProgressItem */;
r12 = <ProgressItem2 onPress={onPress_91516} source={{uri: importDefault(5930) /* metro dependency 5930: MailboxIllocon2xPng */}} iconStyle={styles.formCtaIcon} title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.q9n0Ta)} isCompleted={guildPopulated} analyticsSetupType={AnalyticsSetupTypes.CHANNEL_WELCOME} analyticsAction={AnalyticsActions.INVITE} />;
} else {
r12 = undefined;
}
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const r8 = value8 ? Reflect.apply(string, intl, [t['gwyU/J']]) : isGuildOwner2 ? Reflect.apply(string, intl,
[t['1ach9C']]) : Reflect.apply(string, intl, [t['ezm+/j']]);
const r14 = !value9 && (r12 != null || r11 != null);
const defaultImport5 = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
const getArticleURL = defaultImport5.getArticleURL;
const GUILD_GETTING_STARTED = HelpdeskArticles.GUILD_GETTING_STARTED;
const value20 = '' + Reflect.apply(getArticleURL, defaultImport5,
[GUILD_GETTING_STARTED]) + '?utm_source=discord&utm_medium=blog&utm_campaign=2020-06_help-new-user&utm_content=--t%3Apm';
const fragment = <>{r8}{r14 ? <>{' '}{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.UOtD32,
{guideURL: value20})}</> : null}</>;
const Fragment = env0_5.Fragment;
return (
<Fragment>
<ChatBeginningRowHeader
title={intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['j59F/c'],
{guildName: guild.name})}
subtitle={fragment}
isPrivate={isPrivateGuildChannel2}
subtitleLink={r14 ? value20 : undefined}
/>
{value9 ? ((Component) => <Component guild={guild} />)(importDefault(11937) /* metro dependency 11937: GuildProgressItem */) : <>{r12}{r11}</>}
</Fragment>
);
}
function ChatBeginningRow({channelId, guildId, shouldRender, showingSpamBanner}) { // fn#91520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:19405, offset: 0x02068a14, size: 358 bytes, params: 2, frame: 22
const styles = useStyles();
const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
return ChannelStore.getChannel(channelId);
});
const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
return GuildStore.getGuild(guildId);
});
return ((Component) => <Component style={styles.container}>{shouldRender && channel != null ? THREAD_CHANNEL_TYPES.has(channel.type) ? <ChatBeginningRowThread channel={channel} /> : channel.isDM() ? <ChatBeginningRowDM channel={channel} showingSpamBanner={showingSpamBanner} /> : channel.isGroupDM() ? <ChatBeginningRowGroupDM channel={channel} /> : guild != null ? <ChatBeginningRowGuild guild={guild} channel={channel} /> : null : null}</Component>)(importDefault(11953) /* metro dependency 11953: PortalAccessibilityWorkaroundView */);
}
function _fun91454() { // fn#91454, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:3617, offset: 0x02065579, size: 45 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = importDefault(3853) /* metro dependency 3853: Linking */;
return value.openURL(subtitleLink);
}
function LinkManageButtonsOnPress() { // fn#91456, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:3986, owner: LinkManageButtons.onPress, offset: 0x02065880, size: 45 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = require(11392) /* metro dependency 11392: ChannelPermissionsUtils */;
return value.openAddMembersActionSheet(channel);
}
function LinkManageButtonsOnPress_91457() { // fn#91457, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:4367, owner: LinkManageButtons.onPress, offset: 0x020658ad, size: 80 bytes, params: 1, frame: 15
let value = environment.__proto__;
const defaultImport = importDefault(8148) /* metro dependency 8148: ChannelSettingsActionCreators */;
const setSection = defaultImport.setSection;
const OVERVIEW = ChannelSettingsSections.OVERVIEW;
Reflect.apply(setSection, defaultImport, [OVERVIEW]);
value = defaultImport;
value.open(channel.id);
}
function _fun91460() { // fn#91460, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:4795, offset: 0x02065bb3, size: 45 bytes, params: 1, frame: 14
const userIdBinding = userId;
const value2 = null;
return value2 != userIdBinding ? GuildMemberStore.getMember(guildId, userId) : value2;
}
function _fun91464(a0) { // fn#91464, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:6034, offset: 0x02065e8a, size: 58 bytes, params: 2, frame: 16
const AppliedForumTagPill = (require(11089) /* metro dependency 11089: AppliedForumTag */).AppliedForumTagPill;
return <AppliedForumTagPill tag={a0} key={a0.id} />;
}
function ChatBeginningRowThreadUsernameHook(a0, a1) { // fn#91465, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:6256, owner: ChatBeginningRowThread.usernameHook, offset: 0x02065ec4, size: 53 bytes, params: 3, frame: 15
const channelBinding = channel;
return (
<ThreadOwner
userId={channelBinding.ownerId}
guildId={channelBinding.guild_id}
key={a1}
/>
);
}
function topicHook() { // fn#91467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:6875, owner: ChatBeginningRowGuildNonDefaultChannel.topicHook, offset: 0x02066134, size: 66 bytes, params: 1, frame: 15
let value = environment.__proto__;
value = importDefault(6622) /* metro dependency 6622: MarkupUtils */;
const parseTopic = value.parseTopic;
const channelBinding = channel;
return Reflect.apply(parseTopic, value, [channelBinding.topic, true, {channelId: channelBinding.id}]);
}
function DMSpamButtonOnPress() { // fn#91471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:10122, owner: DMSpamButton.onPress, offset: 0x02066341, size: 67 bytes, params: 1, frame: 13
var environment;
var value2;
var moduleValue;
if (message != null) {
value2 = environment.__proto__;
moduleValue = require(8153) /* metro dependency 8153: ReportModals */;
moduleValue.showReportModalForFirstDM(message, _fun91472);
}
}
function ManageAppButtonOnPress() { // fn#91475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:10599, owner: ManageAppButton.onPress, offset: 0x02066521, size: 181 bytes, params: 1, frame: 21
const useAlertStoreNativeModule = require(4497) /* metro dependency 4497: useAlertStoreNative */;
const openAlert = useAlertStoreNativeModule.openAlert;
const UserSettingsAuthedAppDeleteWarningModal = importDefault(11945) /* metro dependency 11945: UserSettingsAuthedAppDeleteWarningModal */;
const applicationBinding = application;
Reflect.apply(openAlert, useAlertStoreNativeModule, ['confirm-delete-authed-app',
<UserSettingsAuthedAppDeleteWarningModal application={applicationBinding} scopes={oauth2Token.scopes} onDelete={onDelete_91476} />]);
const defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport2.track;
const APP_MANAGE_CTA_CLICKED = AnalyticEvents.APP_MANAGE_CTA_CLICKED;
const channelBinding = channel;
Reflect.apply(track, defaultImport2, [APP_MANAGE_CTA_CLICKED, {application_id: applicationBinding.id,
channel_id: channelBinding.id, channel_type: channelBinding.type}]);
}
function MuteAppButtonOnPress() { // fn#91479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:11383, owner: MuteAppButton.onPress, offset: 0x02066816, size: 286 bytes, params: 1, frame: 21
var defaultImport;
var object2;
var defaultImport2;
var open;
var intl;
var defaultImport3;
if (env0_2) {
defaultImport2 = importDefault(dependencyMap[79]);
defaultImport2.updateChannelOverrideSettings(null, channel.id, {muted: false},
require(dependencyMap[80]).NotificationLabels.Unmuted);
defaultImport3 = importDefault(dependencyMap[81]);
open = defaultImport3.open;
object2 = {key: 'NOTIFICATIONS_UNMUTED'};
intl = require(dependencyMap[29]).intl;
object2.content = intl.string(require(dependencyMap[29]).t['/6kulz']);
object2.icon = icon_91480;
Reflect.apply(open, defaultImport3, [object2]);
} else {
defaultImport = importDefault(dependencyMap[82]);
defaultImport.openLazy(require(dependencyMap[84])(dependencyMap[83], dependencyMap.paths),
'MessageNotificationChannelActionSheet', {channel: channel});
}
}
function ChatBeginningRowDMOnPress() { // fn#91482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:12740, owner: ChatBeginningRowDM.onPress, offset: 0x02066fd3, size: 67 bytes, params: 1, frame: 14
const value = environment.__proto__;
(require(6797) /* metro dependency 6797: ClipboardUtilsNative */).copy(env0_7);
(require(3856) /* metro dependency 3856: ToastUtils */).presentUsernameCopied();
}
function _fun91484() { // fn#91484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:12114, offset: 0x0206703b, size: 73 bytes, params: 1, frame: 15
const object2 = {};
object2.authorizedAppToken = AuthorizedAppsStore.getNewestTokenForApplication(env0_4?.id);
object2.authorizedAppsFetchState = AuthorizedAppsStore.getFetchState();
return object2;
}
function _fun91485() { // fn#91485, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:12325, offset: 0x02067084, size: 45 bytes, params: 1, frame: 12
const userBinding = user;
const value2 = null;
return value2 != userBinding ? UserProfileStore.getMutualGuilds(user.id) : value2;
}
function _fun91486() { // fn#91486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:12405, offset: 0x020670b1, size: 109 bytes, params: 1, frame: 18
var value2;
var value3;
var defaultImport;
let userBinding = user;
if (userBinding != null) {
value2 = environment.__proto__;
value3 = undefined;
defaultImport = importDefault(8491) /* metro dependency 8491: maybeFetchUserProfile */;
userBinding = user;
defaultImport(userBinding.id, userBinding.getAvatarURL(channel == null ? value3 : channel.guild_id, 80),
{'withMutualGuilds': true, 'dispatchWait': true});
}
}
function _fun91487() { // fn#91487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:12539, offset: 0x0206711e, size: 92 bytes, params: 1, frame: 11
var authorizedAppsFetchStateBinding;
var value;
let r0 = user != null && user.bot;
if (r0) {
authorizedAppsFetchStateBinding = authorizedAppsFetchState;
value = environment.__proto__;
value = authorizedAppsFetchStateBinding === FetchState.NOT_FETCHED;
r0 = value;
}
if (r0) {
value = environment.__proto__;
value = importDefault(6779) /* metro dependency 6779: AuthorizedAppsActionCreators */;
value.fetch();
}
}
function handleOpenMutualGuilds() { // fn#91488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:12965, owner: ChatBeginningRowDM.handleOpenMutualGuilds, offset: 0x0206717a, size: 107 bytes, params: 1, frame: 16
var environment;
let value = environment.__proto__;
const defaultImport = importDefault(dependencyMap[82]);
const openLazy = defaultImport.openLazy;
value = require(dependencyMap[84]);
value = value(dependencyMap[90], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'MutualGuildsActionSheet', {user: user,
onPressMutualGuild: onPressMutualGuild_91489}]);
}
function RelationshipButtons({reportButton}) { // fn#91490, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:13236, owner: ChatBeginningRowDM.RelationshipButtons, offset: 0x02067266, size: 1315 bytes, params: 2, frame: 32
var environment;
var stylesBinding;
var Text;
var format;
var uIomXw;
var defaultImport;
var items2;
var items3;
const value = environment.__proto__;
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
let object = [RelationshipStore];
const relationshipType = Reflect.apply(useStateFromStores, fluxModule, [object, function() {
return RelationshipStore.getRelationshipType(user.id);
}]);
const closure = function() {
importDefault(dependencyMap[82]).openLazy(require(dependencyMap[84])(dependencyMap[99], dependencyMap.paths),
BLOCK_CONFIRMATION_ACTION_SHEET_KEY, {userId: user.id, channelId: channel.id});
};
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const button = <Button text={Reflect.apply(string, intl,
[t.l4Emac])} size="sm" variant="secondary" onPress={closure} />;
const PENDING_INCOMING = RelationshipTypes.PENDING_INCOMING;
if (relationshipType === PENDING_INCOMING) {
object = {};
stylesBinding = styles;
object.style = stylesBinding.pendingIncoming;
Text = (require(4573) /* metro dependency 4573: Text */).Text;
format = intl.format;
uIomXw = t.uIomXw;
defaultImport = importDefault(3995) /* metro dependency 3995: UserUtils */;
items2 = [<Text variant="text-sm/normal" color="text-default">{Reflect.apply(format, intl, [uIomXw,
{username: defaultImport.getName(user)}])}</Text>];
var viewBinding2Props = {style: stylesBinding.pendingIncomingButtons};
string = intl.string;
items3 = [<Button text={Reflect.apply(string, intl,
[t['+WbSn5']])} size="sm" variant="active" onPress={function() {
importDefault(dependencyMap[97]).maybeConfirmFriendRequestAccept({userId: user.id,
location: AnalyticsPages.DM_CHANNEL});
}} />];
string = intl.string;
items3[1] = <Button text={Reflect.apply(string, intl,
[t.rQSndv])} size="sm" variant="secondary" onPress={onPress_91498} />;
string = intl.string;
items3[2] = <Button text={Reflect.apply(string, intl,
[t.l4Emac])} size="sm" variant="secondary" onPress={closure} />;
items3[3] = reportButton;
items2[1] = <View {...viewBinding2Props}>{items3}</View>;
return (
<View {...object}>
{items2}
</View>
);
}
const jsxRuntimeEnv1_43Binding = jsxRuntimeEnv1_43;
const NONE = RelationshipTypes.NONE;
const r5 = NONE === relationshipType ? user == null ? <Button text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['PMsq/b'])} size="sm" variant="active" onPress={function() {
importDefault(dependencyMap[96]).addRelationship({userId: user.id,
context: {location: AnalyticsPages.DM_CHANNEL}});
}} /> : user.bot ? null : <Button text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['PMsq/b'])} size="sm" variant="active" onPress={onPress_91492} /> : RelationshipTypes.FRIEND === relationshipType ? <Button text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cvSt1J)} size="sm" variant="secondary" onPress={onPress_91493} /> : RelationshipTypes.BLOCKED === relationshipType ? <Button text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.XyHpKH)} size="sm" variant="secondary" onPress={onPress_91496} /> : RelationshipTypes.PENDING_OUTGOING !== relationshipType ? null : <Button text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.xMH6vD)} size="sm" variant="active" disabled onPress={undefined} />;
const BLOCKED = RelationshipTypes.BLOCKED;
return (
<>
{r5}
{relationshipType === BLOCKED ? null : button}
{reportButton}
</>
);
}
function ChatBeginningRowDMOnPress_91499() { // fn#91499, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:15459, owner: ChatBeginningRowDM.onPress, offset: 0x020679ce, size: 72 bytes, params: 1, frame: 13
const value = environment.__proto__;
(importDefault(8743) /* metro dependency 8743: showUserProfileActionSheet */)({userId: user.id,
channelId: channel.id, sourceAnalyticsLocations: analyticsLocations});
}
function _fun91500() { // fn#91500, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:16469, offset: 0x02067a16, size: 387 bytes, params: 1, frame: 25
if (env0_6 == null) {
return undefined;
}
let length = env0_6.length;
if (length < 1) {
return undefined;
}
length = env0_6.length;
const binding = env0_6;
const value2 = 5;
const value4 = binding.slice(0, length > value2 ? 4 : value2);
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
const handleOpenMutualGuildsBinding = handleOpenMutualGuilds;
const stylesBinding = styles;
const mutualGuildsContainer = stylesBinding.mutualGuildsContainer;
const GuildIconPile = (require(8863) /* metro dependency 8863: GuildIconPileNative */).GuildIconPile;
const GuildIconSizes = (require(6819) /* metro dependency 6819: GuildIcon */).GuildIconSizes;
const SMALL = GuildIconSizes.SMALL;
const guildIconPile = <GuildIconPile size={SMALL} names={value4.map(function(a0) {
return a0.guild.name;
})} totalCount={length}>{value4.map(_fun91502)}</GuildIconPile>;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const mutualGuildsLabel = stylesBinding.mutualGuildsLabel;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return (
<PressableOpacity
accessibilityRole="button"
onPress={handleOpenMutualGuildsBinding}
style={mutualGuildsContainer}
>
{guildIconPile}
<Text
style={mutualGuildsLabel}
variant="text-sm/medium"
color="text-default"
>
{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.eE3oep, {count: length})}
</Text>
</PressableOpacity>
);
}
function _fun91505() { // fn#91505, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:17717, offset: 0x02068123, size: 25 bytes, params: 1, frame: 9
const value = environment.__proto__;
return RelationshipStore.getRelationshipCount() > 0;
}
function* _fun91508() { // fn#91508, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:17855, offset: 0x02068184, size: 177 bytes, params: 1, frame: 20
var value7;
if (true) {
value = environment.__proto__;
if (!importDefault) {
dependencyMap(true);
var value4 = env2_1(env2_2[103]);
var mobileCreateInvite = value4.mobileCreateInvite;
var GROUP_DM = env2_32.GROUP_DM;
yield Reflect.apply(mobileCreateInvite, value4, [require, GROUP_DM]);
var value5 = undefined;
if (false) {
return value5;
}
if (value5 != null) {
value7 = env2_0(env2_2[63]);
value7.handleCopy(value5, require, env2_32.GROUP_DM, false);
}
dependencyMap(false);
}
}
}
function _fun91509() { // fn#91509, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:18019, offset: 0x02068235, size: 117 bytes, params: 1, frame: 15
const value = environment.__proto__;
const dismissibleContentUnsafeUtilsModule = require(3968) /* metro dependency 3968: DismissibleContentUnsafeUtils */;
const UNSAFE_isDismissibleContentDismissed = dismissibleContentUnsafeUtilsModule.UNSAFE_isDismissibleContentDismissed;
const DismissibleContent = (require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent;
const GDM_INVITE_REMINDER = DismissibleContent.GDM_INVITE_REMINDER;
if (Reflect.apply(UNSAFE_isDismissibleContentDismissed, dismissibleContentUnsafeUtilsModule,
[GDM_INVITE_REMINDER])) {
env0_3();
} else {
(importDefault(11388) /* metro dependency 11388: showChatGDMUpsellActionSheet */)({onClick: env0_3});
}
}
function _fun91510() { // fn#91510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:18172, offset: 0x020682aa, size: 117 bytes, params: 1, frame: 15
const value = environment.__proto__;
const dismissibleContentUnsafeUtilsModule = require(3968) /* metro dependency 3968: DismissibleContentUnsafeUtils */;
const UNSAFE_isDismissibleContentDismissed = dismissibleContentUnsafeUtilsModule.UNSAFE_isDismissibleContentDismissed;
const DismissibleContent = (require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent;
const GDM_INVITE_REMINDER = DismissibleContent.GDM_INVITE_REMINDER;
if (Reflect.apply(UNSAFE_isDismissibleContentDismissed, dismissibleContentUnsafeUtilsModule,
[GDM_INVITE_REMINDER])) {
env0_4();
} else {
(importDefault(11388) /* metro dependency 11388: showChatGDMUpsellActionSheet */)({onClick: env0_4});
}
}
function _addServerIcon() { // fn#91513, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:8315, owner: ChatBeginningRowGuildDefaultChannel._addServerIcon, offset: 0x02068829, size: 53 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
return env1_4(_fun91515).apply(this, arguments);
}
function ChatBeginningRowGuildDefaultChannelOnPress_91516() { // fn#91516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:8767, owner: ChatBeginningRowGuildDefaultChannel.onPress, offset: 0x02068922, size: 138 bytes, params: 1, frame: 16
var value2;
var moduleValue;
var value3;
var moduleValue2;
if (guild.vanityURLCode != null) {
value3 = environment.__proto__;
moduleValue2 = require(9151) /* metro dependency 9151: InstantInviteUtils */;
moduleValue2.showVanityUrlInviteActionSheet(guild, channel, InstantInviteSources.WELCOME_MESSAGE);
} else {
value2 = environment.__proto__;
moduleValue = require(9151) /* metro dependency 9151: InstantInviteUtils */;
moduleValue.showInstantInviteActionSheet(channel, {source: InstantInviteSources.WELCOME_MESSAGE});
}
}
function _fun91519() { // fn#91519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:8173, offset: 0x020689d1, size: 67 bytes, params: 1, frame: 12
var value2;
var moduleValue;
if (env0_3.message != null) {
value2 = environment.__proto__;
moduleValue = require(3856) /* metro dependency 3856: ToastUtils */;
moduleValue.presentError(env0_3.message);
}
}
function _fun91472() { // fn#91472, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:10174, offset: 0x02066384, size: 53 bytes, params: 1, frame: 14
let value = environment.__proto__.__proto__;
value = importDefault(4603) /* metro dependency 4603: ChannelActionCreators */;
value.closePrivateChannel(channel.id, true);
}
function onPressOnDelete() { // fn#91476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:10702, owner: ManageAppButton.onPress.onDelete, offset: 0x020665d6, size: 130 bytes, params: 1, frame: 16
let value = environment.__proto__.__proto__;
value = undefined;
(importDefault(6779) /* metro dependency 6779: AuthorizedAppsActionCreators */).delete(oauth2Token.id);
const value3 = selfEmbeddedActivities.get(application.id);
(importDefault(8092) /* metro dependency 8092: EmbeddedActivitiesNativeManager */).leaveActivity({location: value3 == null ? value : value3.location,
applicationId: application.id});
return value;
}
function onPressIcon_91480() { // fn#91480, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:11587, owner: MuteAppButton.onPress.icon, offset: 0x02066934, size: 138 bytes, params: 1, frame: 20
const stylesBinding = styles;
const unmutedNotificationContainer = stylesBinding.unmutedNotificationContainer;
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
const iconProps = {source: importDefault(8194) /* metro dependency 8194 */};
const WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
iconProps.color = WHITE;
iconProps.style = stylesBinding.unmutedNotification;
return (
<View style={unmutedNotificationContainer}>
<Icon {...iconProps} />
</View>
);
}
function handleOpenMutualGuildsOnPressMutualGuild(a0) { // fn#91489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:13065, owner: ChatBeginningRowDM.handleOpenMutualGuilds.onPressMutualGuild, offset: 0x020671e5, size: 129 bytes, params: 2, frame: 16
(require(8515) /* metro dependency 8515: UserProfileAnalyticsUtils */).trackUserProfileAction({action: 'PRESS_MUTUAL_GUILD'});
(require(6947) /* metro dependency 6947: transitionToGuildNative */).transitionToGuild(a0);
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).popWithKey(MOBILE_MESSAGE_REQUESTS_MODAL_KEY);
}
function RelationshipButtonsOnPress() { // fn#91492, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:13346, owner: ChatBeginningRowDM.RelationshipButtons.onPress, offset: 0x020677a9, size: 76 bytes, params: 1, frame: 14
const defaultImport = importDefault(8783) /* metro dependency 8783: RelationshipActionCreators */;
const addRelationship = defaultImport.addRelationship;
const DM_CHANNEL = AnalyticsPages.DM_CHANNEL;
Reflect.apply(addRelationship, defaultImport, [{userId: user.id, context: {location: DM_CHANNEL}}]);
}
function RelationshipButtonsOnPress_91493() { // fn#91493, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:13443, owner: ChatBeginningRowDM.RelationshipButtons.onPress, offset: 0x020677f5, size: 93 bytes, params: 1, frame: 15
var environment;
let value = environment.__proto__.__proto__;
const userProfileAlertUtilsModule = require(8796) /* metro dependency 8796: UserProfileAlertUtils */;
const confirmRemoveFriend = userProfileAlertUtilsModule.confirmRemoveFriend;
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
const getName = value.getName;
Reflect.apply(confirmRemoveFriend, userProfileAlertUtilsModule, [{userDisplayName: Reflect.apply(getName, value,
[user]), onConfirm: function() {
importDefault(dependencyMap[96]).removeFriend(user.id, {location: AnalyticsPages.DM_CHANNEL});
}}]);
}
function RelationshipButtonsOnPress_91496() { // fn#91496, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:13691, owner: ChatBeginningRowDM.RelationshipButtons.onPress, offset: 0x02067902, size: 67 bytes, params: 1, frame: 15
const defaultImport = importDefault(8783) /* metro dependency 8783: RelationshipActionCreators */;
const unblockUser = defaultImport.unblockUser;
const id = user.id;
const DM_CHANNEL = AnalyticsPages.DM_CHANNEL;
Reflect.apply(unblockUser, defaultImport, [id, {location: DM_CHANNEL}]);
}
function RelationshipButtonsOnPress_91498() { // fn#91498, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:14419, owner: ChatBeginningRowDM.RelationshipButtons.onPress, offset: 0x0206798b, size: 67 bytes, params: 1, frame: 15
const defaultImport = importDefault(8783) /* metro dependency 8783: RelationshipActionCreators */;
const cancelFriendRequest = defaultImport.cancelFriendRequest;
const id = user.id;
const DM_CHANNEL = AnalyticsPages.DM_CHANNEL;
Reflect.apply(cancelFriendRequest, defaultImport, [id, {location: DM_CHANNEL}]);
}
function _fun91502({guild}) { // fn#91502, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:16796, offset: 0x02067ba8, size: 86 bytes, params: 2, frame: 19
const GuildIcon = importDefault(6819) /* metro dependency 6819: GuildIcon */;
const GuildIconSizes = (require(6819) /* metro dependency 6819: GuildIcon */).GuildIconSizes;
const SMALL = GuildIconSizes.SMALL;
return (
<GuildIcon
guild={guild}
size={SMALL}
key={guild.id}
/>
);
}
function* _fun91515() { // fn#91515, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12112:8366, offset: 0x02068869, size: 185 bytes, params: 1, frame: 21
var binding3;
var value9;
if (true) {
value = environment.__proto__.__proto__.__proto__;
var binding = env3_1;
var binding2 = env3_2;
binding(binding2[59]).init(dependencyMap);
var value5 = binding(binding2[60]);
yield value5.openImagePicker({size: env3_35});
var value6 = undefined;
if (false) {
return value6;
}
var base64 = value6.base64;
if (base64 != null) {
binding = env3_1;
binding3 = env3_2;
binding(binding3[59]).updateIcon(dependencyMap, base64);
value9 = binding(binding3[59]);
value9.open(dependencyMap, env3_30.LANDING);
}
}
}