Files
discord-decomp/sources/modules/icymi/native/ICYMICardInteractionRow.tsx
T
2026-07-28 01:06:53 +03:00

864 lines
51 KiB
TypeScript

/* Metro module 14862; source: modules/icymi/native/ICYMICardInteractionRow.tsx; dependencies: [57, 31, 27, 6898, 1379, 4798, 3784, 661, 1881, 33, 3795, 7151, 4501, 697, 477, 4000, 566, 4603, 7067, 8529, 5278, 1244, 7950, 4573, 9841, 673, 1423, 9835, 8852, 11252, 9600, 11209, 14854, 6682, 7152, 11419, 9797, 9580, 9591, 11004, 3860, 4589, 674, 6818, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import PermissionStore from '../../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import GuildVerificationStore from '../../../stores/GuildVerificationStore.tsx'; /* Metro dependency 4798 */
import ThreadMessageStore from '../../threads/ThreadMessageStore.tsx'; /* Metro dependency 6898 */
import ForwardingIcon from '../../forwarding/native/ForwardingIcon.tsx'; /* Metro dependency 9600 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as EmojiConstantsModule from '../../emojis/EmojiConstants.tsx'; /* Metro dependency 1881 */
import * as UseTokenModule from '../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */
import * as ColorUtilsModule from '../../../utils/ColorUtils.tsx'; /* Metro dependency 4000 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
import * as MessageReactionsTypesModule from '../../messages/MessageReactionsTypes.tsx'; /* Metro dependency 7152 */
import * as ReactionIconModule from '../../../design/components/Icon/native/redesign/generated/ReactionIcon.tsx'; /* Metro dependency 7950 */
import * as OpenEmojiPickerActionSheetModule from '../../emoji_picker/native/openEmojiPickerActionSheet.tsx'; /* Metro dependency 8529 */
import * as ForwardModalUtilsModule from '../../forwarding/native/ForwardModalUtils.tsx'; /* Metro dependency 9591 */
import * as CanForwardMessageModule from '../../forwarding/canForwardMessage.tsx'; /* Metro dependency 9797 */
import * as PendingReplyActionCreatorsModule from '../../replies/PendingReplyActionCreators.tsx'; /* Metro dependency 11004 */
import * as ArrowAngleLeftUpIconModule from '../../../design/components/Icon/native/redesign/generated/ArrowAngleLeftUpIcon.tsx'; /* Metro dependency 11209 */
import * as ICYMISharedModule from './ICYMIShared.tsx'; /* Metro dependency 14854 */
function _fun112372(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#112372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:6, offset: 0x023c81df, size: 479 bytes, params: 8, frame: 21
const env0_0 = require;
const onAddReaction2 = onAddReaction;
const useThread_1123742 = useThread_112374;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_5 = value.View;
const env0_6 = value.Image;
const env0_7 = value.ScrollView;
value = require(661) /* metro dependency 661: Constants */;
const env0_12 = value.MessageFlags;
const env0_13 = value.Permissions;
const env0_14 = value.HorizontalGradient;
value = require(33) /* metro dependency 33 */;
const env0_16 = value.jsx;
const env0_17 = value.jsxs;
const env0_18 = value.Fragment;
const env0_20 = (CreateStylesModule).createStyles(_fun112388);
(FileImportTrackerModule).fileFinishedImporting('modules/icymi/native/ICYMICardInteractionRow.tsx');
exports.default = ICYMICardInteractionRow;
exports.onAddReaction = onAddReaction2;
exports.useThread = useThread_1123742;
function onAddReaction(a0, a1, a2, a3) { // fn#112373, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:336, offset: 0x023c83be, size: 114 bytes, params: 5, frame: 19
var value;
var moduleValue;
if (a2 != null) {
value = require(3795) /* metro dependency 3795: ReactionUtils */;
value = value.toReactionEmoji(a2);
moduleValue = require(7151) /* metro dependency 7151: ReactionActionCreators */;
moduleValue.addReaction(a0, a1, value,
(require(7151) /* metro dependency 7151: ReactionActionCreators */).ReactionLocations.MESSAGE, {burst: a3});
}
}
function useThread_112374(a0, a1, a2) { // fn#112374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:2212, offset: 0x023c8430, size: 180 bytes, params: 4, frame: 20
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const value2 = undefined;
const {thread, messageCount,
mostRecentMessage} = (FluxModule).useStateFromStoresObject([ChannelStore,
ThreadMessageStore], _fun112375);
ReactModule.useEffect(_fun112376, [a0 == null ? value2 : a0.id, a2, a1, a0]);
return {thread: thread, messageCount: messageCount, mostRecentMessage: mostRecentMessage};
function _fun112375() { // fn#112375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:2285, offset: 0x023c84e4, size: 157 bytes, params: 1, frame: 15
var r0;
var object;
var value3;
var channelStoreBinding;
var getChannel;
var id;
var value4;
var threadMessageStoreBinding;
var getCount;
var value5;
var getMostRecentMessage;
const value2 = null;
if (value2 == require) {
r0 = {'thread': null, 'messageCount': 0, 'mostRecentMessage': null};
} else if (value2 == env0_0) {
r0 = {'thread': null, 'messageCount': 0, 'mostRecentMessage': null};
} else {
object = {};
value3 = environment.__proto__;
channelStoreBinding = ChannelStore;
getChannel = channelStoreBinding.getChannel;
id = require.id;
value4 = Reflect.apply(getChannel, channelStoreBinding, [id]);
object.thread = value2 != value4 ? value4 : value2;
threadMessageStoreBinding = ThreadMessageStore;
getCount = threadMessageStoreBinding.getCount;
id = require.id;
value5 = Reflect.apply(getCount, threadMessageStoreBinding, [id]);
object.messageCount = value2 != value5 ? value5 : 0;
threadMessageStoreBinding = ThreadMessageStore;
getMostRecentMessage = threadMessageStoreBinding.getMostRecentMessage;
id = require.id;
object.mostRecentMessage = Reflect.apply(getMostRecentMessage, threadMessageStoreBinding, [id]);
r0 = object;
}
return r0;
}
function _fun112376() { // fn#112376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:2583, offset: 0x023c8581, size: 209 bytes, params: 1, frame: 17
var id;
var value7;
var defaultImport;
var preload;
var fetchMessages;
var value;
if (require != null && env0_0 != null && (require.hasFlag(MessageFlags.HAS_THREAD) || importDefault) && ThreadMessageStore.getMostRecentMessage(require.id) == null) {
value7 = environment.__proto__;
defaultImport = importDefault(4603) /* metro dependency 4603: ChannelActionCreators */;
preload = defaultImport.preload;
id = env0_0.id;
Reflect.apply(preload, defaultImport, [id, require.id]);
value = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
fetchMessages = value.fetchMessages;
id = require.id;
Reflect.apply(fetchMessages, value, [{'channelId': null, 'isPreload': true, 'limit': 25, channelId: id}]);
}
}
}
function AddEmojiButton({channel, onPressEmoji, showText, disabled, handleItemInteracted}) { // fn#112377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:2842, offset: 0x023c8652, size: 409 bytes, params: 2, frame: 23
const styles = useStyles();
const value2 = ReactModule.useCallback(_fun112378, [channel, onPressEmoji, handleItemInteracted]);
const PressableOpacity = (PressablesModule).PressableOpacity;
const pressableOpacityProps = {onPress: value2, style: [styles.emojiContainer, styles.addEmojiContainer,
disabled ? styles.disabled : null], accessible: true};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
pressableOpacityProps.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.lfIHs4);
pressableOpacityProps.disabled = disabled;
const ReactionIcon = (ReactionIconModule).ReactionIcon;
return (
<PressableOpacity {...pressableOpacityProps}>
<ReactionIcon size="sm" />
{showText && ((Text) => <Text variant="text-sm/semibold" color="redesign-button-tertiary-text">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.m9O1gd)}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}
</PressableOpacity>
);
function _fun112378() { // fn#112378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:2966, offset: 0x023c87eb, size: 142 bytes, params: 1, frame: 17
const handleItemInteractedBinding = handleItemInteracted;
const value2 = undefined;
handleItemInteractedBinding('press_reaction_picker', {'actionGestureType': 'press',
'actionTargetElement': 'reaction_picker_button', 'actionIntentType': 'open', 'actionDestinationType': null});
const openEmojiPickerActionSheet = OpenEmojiPickerActionSheetModule.openEmojiPickerActionSheet;
const REACTION = EmojiIntention.REACTION;
const channelBinding = channel;
Reflect.apply(openEmojiPickerActionSheet, OpenEmojiPickerActionSheetModule, [{'pickerIntention': null,
'autoFocus': false, 'startExpanded': false, pickerIntention: REACTION, onPressEmoji: onPressEmoji,
channel: channelBinding, guildId: channelBinding == null ? value2 : channel.guild_id}]);
return value2;
}
}
function EmojiReaction({messageId, channel, reaction, count, isBurstReaction, handleItemInteracted}) { // fn#112379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:3667, offset: 0x023c8879, size: 975 bytes, params: 2, frame: 32
var r1;
var moduleValue2;
const handleItemInteracted2 = handleItemInteracted;
const styles = useStyles();
const value4 = (require(9841) /* metro dependency 9841: useEmojiColorPalette */).useEmojiColorPalette(reaction.burst_colors ?? []);
const object = {};
const value5 = '';
if (value4 != null) {
moduleValue2 = require(673) /* metro dependency 673: ColorUtils */;
r1 = moduleValue2.hex2rgb(value4?.backgroundColor, value4?.opacity ?? 0.15) ?? value5;
} else {
r1 = value5;
}
object.backgroundColor = r1;
object.borderColor = value4?.backgroundColor;
const r12 = value4?.accentColor != null ? {color: value4.accentColor} : null;
const emoji = reaction.emoji;
let r10 = isBurstReaction ? reaction.me_burst : reaction.me;
const selected = r10 ? styles.selected : undefined;
const value8 = (FluxModule).useStateFromStores([GuildVerificationStore],
_fun112380);
const value9 = handleItemInteracted2.useMemo(_fun112381, [emoji]);
const value10 = handleItemInteracted2.useCallback(function() {
handleItemInteracted('press_reaction', {'actionGestureType': 'press',
'actionTargetElement': 'toggle_existing_reaction_button', 'actionIntentType': 'react',
'actionDestinationType': null});
require(dependencyMap[27]).handleAddOrRemoveReaction(messageId, channel, reaction, isBurstReaction,
require(dependencyMap[11]).ReactionLocations.MESSAGE);
}, [channel, isBurstReaction, messageId, reaction, handleItemInteracted]);
const PressableOpacity = (PressablesModule).PressableOpacity;
const pressableOpacityProps = {style: [styles.emojiContainer, selected, isBurstReaction && object],
onPress: value10, accessible: true, accessibilityLabel: emoji.name, disabled: !value8};
const view = (
<View style={[styles.innerEmojiContainer, r10 && styles.selectedInnerEmojiContainer]}>
{
emoji.id == null
? ((Text) => <Text variant="text-md/medium" color="interactive-text-default" style={[styles.defaultEmoji,
styles.emojiText]} allowFontScaling={false}>{emoji.name}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)
: (
(require(477) /* metro dependency 477: PlatformUtils */).isAndroid()
? (
<Image style={[styles.defaultEmoji, styles.emojiImage]} source={value9} />
)
: ((Component) => <Component emoji={emoji} size={env0_19} style={styles.defaultEmoji} animate />)(importDefault(8852) /* metro dependency 8852: ActivityEmoji */)
)
}
</View>
);
r10 = r10 && styles.selectedInnerTextContainer;
return (
<PressableOpacity {...pressableOpacityProps}>
{view}
<View style={[styles.innerTextContainer, r10]}>
{((Component) => <Component animate count={count} textStyle={isBurstReaction ? r12 : null} textVariant="text-md/semibold" />)(importDefault(11252) /* metro dependency 11252: AnimatedCounter */)}
</View>
</PressableOpacity>
);
function _fun112380() { // fn#112380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:4188, offset: 0x023c8c48, size: 50 bytes, params: 1, frame: 12
return channel.guild_id != null && GuildVerificationStore.canChatInGuild(channel.guild_id);
}
function _fun112381() { // fn#112381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:4254, offset: 0x023c8c7a, size: 107 bytes, params: 1, frame: 15
var r0;
var value3;
var defaultImport;
if (emoji.id != null) {
value3 = environment.__proto__;
defaultImport = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
r0 = {uri: defaultImport.getEmojiURL({id: emoji.id, animated: emoji.animated, size: 48})};
} else {
r0 = undefined;
}
return r0;
}
}
function ForwardButton({onPress, disabled}) { // fn#112383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:5293, offset: 0x023c8d59, size: 223 bytes, params: 2, frame: 19
const styles = useStyles();
const PressableOpacity = (PressablesModule).PressableOpacity;
const items2 = [styles.emojiContainer];
items2[1] = styles.addEmojiContainer;
items2[2] = disabled ? styles.disabled : null;
const intl = (IndexNativeModule).intl;
return (
<PressableOpacity
onPress={onPress}
style={items2}
accessible
disabled={disabled}
accessibilityLabel={intl.string((IndexNativeModule).t.xIUfJS)}
>
{((Component) => <Component size="sm" />)(ForwardingIcon)}
</PressableOpacity>
);
}
function ReplyButton({onPress, disabled}) { // fn#112384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:5578, offset: 0x023c8e38, size: 225 bytes, params: 2, frame: 19
const styles = useStyles();
const PressableOpacity = (PressablesModule).PressableOpacity;
const pressableOpacityProps = {onPress: onPress, style: [styles.emojiContainer, styles.addEmojiContainer,
disabled ? styles.disabled : null], accessible: true, disabled: disabled};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
pressableOpacityProps.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5NwaNY']);
const ArrowAngleLeftUpIcon = (ArrowAngleLeftUpIconModule).ArrowAngleLeftUpIcon;
return (
<PressableOpacity {...pressableOpacityProps}>
<ArrowAngleLeftUpIcon size="sm" />
</PressableOpacity>
);
}
function ThreadAsCommentsButton({parentMessage, threadData, style, handleItemInteracted}) { // fn#112385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:5885, offset: 0x023c8f19, size: 562 bytes, params: 2, frame: 25
var messageCount;
const styles = useStyles();
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], function() {
var permissionStoreBinding = PermissionStore;
var VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
return permissionStoreBinding.canWithPartialContext(VIEW_CHANNEL, {channelId: parentMessage.id});
});
const value3 = ReactModule.useCallback(_fun112387, [parentMessage, threadData.thread, handleItemInteracted]);
if (value2) {
messageCount = threadData.messageCount;
if (messageCount === 0) {
return null;
}
if (threadData.thread == null) {
const PressableHighlight = (require(5278) /* metro dependency 5278: Pressables */).PressableHighlight;
return (
<PressableHighlight style={[styles.comments, style]} onPress={value3}>
<View style={styles.commentCount}>
{((ChatIcon) => <ChatIcon style={styles.commentsIcon} />)((require(6682) /* metro dependency 6682: ChatIcon */).ChatIcon)}
</View>
</PressableHighlight>
);
}
if (threadData.mostRecentMessage != null) {
messageCount = threadData.messageCount;
messageCount = messageCount > 9 ? '9+' : threadData.messageCount;
const PressableHighlight2 = (require(5278) /* metro dependency 5278: Pressables */).PressableHighlight;
return (
<PressableHighlight2 style={[styles.comments, style]} onPress={value3}>
<View style={styles.commentCount}>
{((ChatIcon) => <ChatIcon style={styles.commentsIcon} />)((require(6682) /* metro dependency 6682: ChatIcon */).ChatIcon)}
{((Text) => <Text variant="text-md/semibold" color="text-strong">{messageCount}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}
</View>
</PressableHighlight2>
);
}
const PressableHighlight3 = (require(5278) /* metro dependency 5278: Pressables */).PressableHighlight;
return (
<PressableHighlight3 style={[styles.comments, style]} onPress={value3}>
<View style={styles.commentCount}>
{((ChatIcon) => <ChatIcon style={styles.commentsIcon} />)((require(6682) /* metro dependency 6682: ChatIcon */).ChatIcon)}
</View>
</PressableHighlight3>
);
}
return null;
function _fun112387() { // fn#112387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:6105, offset: 0x023c917c, size: 137 bytes, params: 1, frame: 16
var value4;
var moduleValue;
var navigateToPost;
handleItemInteracted('press_comments', {'actionGestureType': 'press',
'actionTargetElement': 'thread_comments_button', 'actionIntentType': 'navigate',
'actionDestinationType': 'channel'});
if (parentMessage != null && threadData.thread != null) {
value4 = environment.__proto__;
moduleValue = require(14854) /* metro dependency 14854: ICYMIShared */;
navigateToPost = moduleValue.navigateToPost;
parentMessageBinding = parentMessage;
Reflect.apply(navigateToPost, moduleValue, [parentMessageBinding.getChannelId(), threadData.thread.guild_id,
parentMessageBinding.id]);
}
}
}
function _fun112388() { // fn#112388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:517, offset: 0x023c9205, size: 674 bytes, params: 1, frame: 19
const object = {container: {'flexDirection': 'row', 'alignItems': 'center', 'flexWrap': 'wrap',
'justifyContent': 'space-between'}, replyForwardButtonContainer: {'flexDirection': 'row',
'alignItems': 'center', 'flexWrap': 'wrap', 'gap': 6}, emojisRowContainer: {'position': 'relative',
'flexDirection': 'row', 'alignItems': 'center', 'flexWrap': 'wrap', 'gap': 6},
emojisContainer: {'position': 'relative', 'flexDirection': 'row', 'alignItems': 'center', 'flexWrap': 'wrap',
'gap': 6}};
const object2 = {'flexDirection': 'row', 'backgroundColor': null, 'borderRadius': null, 'flexShrink': 3,
'paddingHorizontal': 8, 'gap': 6};
let REDESIGN_BUTTON_TERTIARY_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.REDESIGN_BUTTON_TERTIARY_BACKGROUND;
object2.backgroundColor = REDESIGN_BUTTON_TERTIARY_BACKGROUND;
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object.emojiContainer = object2;
object.innerEmojiContainer = {paddingVertical: 5};
object.selectedInnerEmojiContainer = {paddingVertical: 4};
object.addEmojiContainer = {'minHeight': 30, 'alignItems': 'center'};
object.disabled = {opacity: 0.4};
object.defaultEmoji = {width: env0_19, height: env0_19};
const object7 = {'lineHeight': null, 'fontSize': 16, 'textAlign': 'center', 'paddingTop': 2};
object7.lineHeight = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 16 : env0_19;
object.emojiText = object7;
object.selectedInnerTextContainer = {paddingBottom: 3.5};
object.innerTextContainer = {'alignSelf': 'flex-end', 'paddingBottom': 4.5};
object.emojiImage = {resizeMode: 'contain', width: env0_19, height: env0_19};
const object9 = {'borderColor': null, 'borderWidth': 1, 'paddingHorizontal': 7};
const BRAND_560 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BRAND_560;
object9.borderColor = BRAND_560;
const hexWithOpacity = ColorUtilsModule.hexWithOpacity;
const BRAND_500 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BRAND_500;
object9.backgroundColor = Reflect.apply(hexWithOpacity, ColorUtilsModule, [BRAND_500, 0.3]);
object.selected = object9;
object.gradient = {'position': 'absolute', 'right': 0, 'top': 0, 'bottom': 0, 'width': 48};
object.overflowChevron = {'position': 'absolute', 'right': 0};
const object10 = {'paddingVertical': 6, 'paddingHorizontal': 8, 'backgroundColor': null, 'borderRadius': null,
'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'gap': 8};
REDESIGN_BUTTON_TERTIARY_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.REDESIGN_BUTTON_TERTIARY_BACKGROUND;
object10.backgroundColor = REDESIGN_BUTTON_TERTIARY_BACKGROUND;
object10.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object.comments = object10;
object.commentCount = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'gap': 4,
'justifySelf': 'end'};
const INTERACTIVE_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT;
object.commentsIcon = {'width': 20, 'height': 20, tintColor: INTERACTIVE_TEXT_DEFAULT};
return object;
}
function ICYMICardInteractionRow({message, channel, guild, hideAdditionalButtons, isKeyMessage, inForum, backgroundVariant, id, itemType}) { // fn#112389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:6994, offset: 0x023c94a7, size: 1429 bytes, params: 2, frame: 54
var r20;
var r8;
var r0;
var items2;
var items4;
var value25;
var items5;
hideAdditionalButtons = !(hideAdditionalButtons === undefined) && hideAdditionalButtons;
isKeyMessage = !(isKeyMessage === undefined) && isKeyMessage;
const isKeyMessage2 = isKeyMessage;
inForum = !(inForum === undefined) && inForum;
backgroundVariant = backgroundVariant === undefined ? 'primary' : backgroundVariant;
const backgroundVariant2 = backgroundVariant;
const styles = useStyles();
const value2 = useThread_112374(guild, message, inForum);
let binding = backgroundVariant2;
let useMemo = binding.useMemo;
const value3 = Reflect.apply(useMemo, binding, [function() {
message.reactions.forEach(_fun112391);
return [];
}, [message.reactions]]);
const value4 = backgroundVariant2.useMemo(_fun112392, [channel]);
const value5 = (CanForwardMessageModule).useCanForwardMessage(message);
const value6 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], function() {
var permissionStoreBinding = PermissionStore;
var SEND_MESSAGES = Permissions.SEND_MESSAGES;
return permissionStoreBinding.can(SEND_MESSAGES, channel);
});
const {hasOverflow, showReplyForwardButtons, showThreadAsComments} = backgroundVariant2.useMemo(_fun112394,
[hideAdditionalButtons, value2.messageCount, value3.length, value6, value5]);
const value8 = backgroundVariant2.useCallback(_fun112395, [id, itemType]);
const value9 = backgroundVariant2.useCallback(_fun112396, [channel.id, message.id, value8]);
const value10 = backgroundVariant2.useCallback(_fun112397, [message, value8]);
const value11 = backgroundVariant2.useCallback(_fun112398, [channel, message, value8]);
binding = backgroundVariant2;
useMemo = binding.useMemo;
const value13 = (UseTokenModule).useToken(Reflect.apply(useMemo, binding,
[_fun112399, [backgroundVariant, isKeyMessage]]));
const [property, env0_12] = isKeyMessage2(backgroundVariant2.useState(true), 2);
const value16 = backgroundVariant2.useCallback(_fun112400, []);
const value17 = backgroundVariant2.useCallback(_fun112401, [value8]);
if (value3.length !== 0) {
var viewBindingProps = {style: styles.container};
var viewBinding2Props = {style: styles.emojisRowContainer};
if (value3.length > 0) {
var viewBinding3Props = {style: [styles.emojisContainer]};
var scrollViewBindingProps = {horizontal: true, scrollEnabled: hasOverflow, contentContainerStyle: {gap: 6},
onScroll: value16, onScrollEndDrag: value17, showsHorizontalScrollIndicator: false};
r20 = !hideAdditionalButtons && (showReplyForwardButtons || showThreadAsComments);
if (r20) {
var viewBinding4Props = {style: styles.replyForwardButtonContainer};
items2 = [
showThreadAsComments && <ThreadAsCommentsButton threadData={value2} parentMessage={message} handleItemInteracted={value8} />,
];
items2[1] = showReplyForwardButtons && <><ReplyButton onPress={value11} disabled={!value6} /><ForwardButton onPress={value10} disabled={!value5} /></>;
r20 = (
<View {...viewBinding4Props}>
{items2}
</View>
);
}
items4 = [r20];
items4[1] = value3.map(_fun112402);
value25 = null;
r20 = (
hideAdditionalButtons
? value25
: (
value4
? (
<AddEmojiButton
channel={channel}
onPressEmoji={value9}
handleItemInteracted={value8}
/>
)
: value25
)
);
items4[2] = r20;
items5 = [
<ScrollView {...scrollViewBindingProps}>
{items4}
</ScrollView>,
];
items5[1] = (
hasOverflow && property
? (
<>
{((Component) => <Component style={styles.gradient} start={HorizontalGradient.START} end={HorizontalGradient.END} colors={[(importDefault(674) /* metro dependency 674 */)(value13).alpha(0).hex(),
value13, value13]} locations={[0, 0.8,
1]} />)(importDefault(4589) /* metro dependency 4589 */)}
{((ChevronSmallRightIcon) => <ChevronSmallRightIcon style={[styles.overflowChevron]} size="xs" color="icon-muted" />)((require(6818) /* metro dependency 6818: ChevronSmallRightIcon */).ChevronSmallRightIcon)}
</>
)
: value25
);
r8 = (
<View {...viewBinding3Props}>
{items5}
</View>
);
} else if (value4) {
var viewBinding3Props = {style: [styles.emojisContainer]};
var scrollViewBindingProps = {horizontal: true, scrollEnabled: hasOverflow, contentContainerStyle: {gap: 6},
onScroll: value16, onScrollEndDrag: value17, showsHorizontalScrollIndicator: false};
r20 = !hideAdditionalButtons && (showReplyForwardButtons || showThreadAsComments);
if (r20) {
var viewBinding4Props = {style: styles.replyForwardButtonContainer};
items2 = [
showThreadAsComments && <ThreadAsCommentsButton threadData={value2} parentMessage={message} handleItemInteracted={value8} />,
];
items2[1] = showReplyForwardButtons && <><ReplyButton onPress={value11} disabled={!value6} /><ForwardButton onPress={value10} disabled={!value5} /></>;
r20 = (
<View {...viewBinding4Props}>
{items2}
</View>
);
}
items4 = [r20];
items4[1] = value3.map(_fun112402);
value25 = null;
r20 = (
hideAdditionalButtons
? value25
: (
value4
? (
<AddEmojiButton
channel={channel}
onPressEmoji={value9}
handleItemInteracted={value8}
/>
)
: value25
)
);
items4[2] = r20;
items5 = [
<ScrollView {...scrollViewBindingProps}>
{items4}
</ScrollView>,
];
items5[1] = (
hasOverflow && property
? (
<>
{((Component) => <Component style={styles.gradient} start={HorizontalGradient.START} end={HorizontalGradient.END} colors={[(importDefault(674) /* metro dependency 674 */)(value13).alpha(0).hex(),
value13, value13]} locations={[0, 0.8,
1]} />)(importDefault(4589) /* metro dependency 4589 */)}
{((ChevronSmallRightIcon) => <ChevronSmallRightIcon style={[styles.overflowChevron]} size="xs" color="icon-muted" />)((require(6818) /* metro dependency 6818: ChevronSmallRightIcon */).ChevronSmallRightIcon)}
</>
)
: value25
);
r8 = (
<View {...viewBinding3Props}>
{items5}
</View>
);
} else {
r8 = null;
}
r0 = (
<View {...viewBindingProps}>
<View {...viewBinding2Props}>
{r8}
</View>
</View>
);
} else if (hideAdditionalButtons) {
r0 = null;
} else {
var viewBindingProps = {style: styles.container};
var viewBinding2Props = {style: styles.emojisRowContainer};
if (value3.length > 0) {
var viewBinding3Props = {style: [styles.emojisContainer]};
var scrollViewBindingProps = {horizontal: true, scrollEnabled: hasOverflow, contentContainerStyle: {gap: 6},
onScroll: value16, onScrollEndDrag: value17, showsHorizontalScrollIndicator: false};
r20 = !hideAdditionalButtons && (showReplyForwardButtons || showThreadAsComments);
if (r20) {
var viewBinding4Props = {style: styles.replyForwardButtonContainer};
items2 = [
showThreadAsComments && <ThreadAsCommentsButton threadData={value2} parentMessage={message} handleItemInteracted={value8} />,
];
items2[1] = showReplyForwardButtons && <><ReplyButton onPress={value11} disabled={!value6} /><ForwardButton onPress={value10} disabled={!value5} /></>;
r20 = (
<View {...viewBinding4Props}>
{items2}
</View>
);
}
items4 = [r20];
items4[1] = value3.map(_fun112402);
value25 = null;
r20 = (
hideAdditionalButtons
? value25
: (
value4
? (
<AddEmojiButton
channel={channel}
onPressEmoji={value9}
handleItemInteracted={value8}
/>
)
: value25
)
);
items4[2] = r20;
items5 = [
<ScrollView {...scrollViewBindingProps}>
{items4}
</ScrollView>,
];
items5[1] = (
hasOverflow && property
? (
<>
{((Component) => <Component style={styles.gradient} start={HorizontalGradient.START} end={HorizontalGradient.END} colors={[(importDefault(674) /* metro dependency 674 */)(value13).alpha(0).hex(),
value13, value13]} locations={[0, 0.8,
1]} />)(importDefault(4589) /* metro dependency 4589 */)}
{((ChevronSmallRightIcon) => <ChevronSmallRightIcon style={[styles.overflowChevron]} size="xs" color="icon-muted" />)((require(6818) /* metro dependency 6818: ChevronSmallRightIcon */).ChevronSmallRightIcon)}
</>
)
: value25
);
r8 = (
<View {...viewBinding3Props}>
{items5}
</View>
);
} else if (value4) {
var viewBinding3Props = {style: [styles.emojisContainer]};
var scrollViewBindingProps = {horizontal: true, scrollEnabled: hasOverflow, contentContainerStyle: {gap: 6},
onScroll: value16, onScrollEndDrag: value17, showsHorizontalScrollIndicator: false};
r20 = !hideAdditionalButtons && (showReplyForwardButtons || showThreadAsComments);
if (r20) {
var viewBinding4Props = {style: styles.replyForwardButtonContainer};
items2 = [
showThreadAsComments && <ThreadAsCommentsButton threadData={value2} parentMessage={message} handleItemInteracted={value8} />,
];
items2[1] = showReplyForwardButtons && <><ReplyButton onPress={value11} disabled={!value6} /><ForwardButton onPress={value10} disabled={!value5} /></>;
r20 = (
<View {...viewBinding4Props}>
{items2}
</View>
);
}
items4 = [r20];
items4[1] = value3.map(_fun112402);
value25 = null;
r20 = (
hideAdditionalButtons
? value25
: (
value4
? (
<AddEmojiButton
channel={channel}
onPressEmoji={value9}
handleItemInteracted={value8}
/>
)
: value25
)
);
items4[2] = r20;
items5 = [
<ScrollView {...scrollViewBindingProps}>
{items4}
</ScrollView>,
];
items5[1] = (
hasOverflow && property
? (
<>
{((Component) => <Component style={styles.gradient} start={HorizontalGradient.START} end={HorizontalGradient.END} colors={[(importDefault(674) /* metro dependency 674 */)(value13).alpha(0).hex(),
value13, value13]} locations={[0, 0.8,
1]} />)(importDefault(4589) /* metro dependency 4589 */)}
{((ChevronSmallRightIcon) => <ChevronSmallRightIcon style={[styles.overflowChevron]} size="xs" color="icon-muted" />)((require(6818) /* metro dependency 6818: ChevronSmallRightIcon */).ChevronSmallRightIcon)}
</>
)
: value25
);
r8 = (
<View {...viewBinding3Props}>
{items5}
</View>
);
} else {
r8 = null;
}
r0 = (
<View {...viewBindingProps}>
<View {...viewBinding2Props}>
{r8}
</View>
</View>
);
}
return r0;
function _fun112390() { // fn#112390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:7204, offset: 0x023c9a3c, size: 42 bytes, params: 1, frame: 12
message.reactions.forEach(_fun112391);
return [];
function _fun112391(a0) { // fn#112391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:7246, offset: 0x023c9a66, size: 193 bytes, params: 2, frame: 17
var r7;
var value;
var binding;
var push;
var object;
const ReactionTypes = (MessageReactionsTypesModule).ReactionTypes;
if (a0.me_vote == null) {
if (a0.burst_count > 0) {
binding = env0_0;
push = binding.push;
object = {};
copyDataProperties(object, a0, r7);
value = environment.__proto__.__proto__;
object['type'] = ReactionTypes.BURST;
Reflect.apply(push, binding, [object]);
r7 = require;
}
if (a0.count > 0) {
binding = env0_0;
push = binding.push;
object = {};
copyDataProperties(object, a0, r7);
value = environment.__proto__.__proto__;
object['type'] = ReactionTypes.NORMAL;
Reflect.apply(push, binding, [object]);
}
}
}
}
function _fun112392() { // fn#112392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:7431, offset: 0x023c9b27, size: 52 bytes, params: 1, frame: 13
return channel != null && (importDefault(11419) /* metro dependency 11419: canAddNewReactions */)(channel);
}
function _fun112394() { // fn#112394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:7576, offset: 0x023c9b81, size: 134 bytes, params: 1, frame: 6
const r2 = hideAdditionalButtons ? 6 : 4;
const messageCount = env0_7.messageCount;
const value4 = 0;
const r1 = messageCount > value4 ? r2 - 1 : r2;
return {hasOverflow: (env0_8.length > r1 ? env0_8.length - r1 : value4) > value4,
showReplyForwardButtons: !hideAdditionalButtons && (env0_10 || env0_9),
showThreadAsComments: env0_7.messageCount > value4};
}
function _fun112395(a0, a1) { // fn#112395, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:7870, offset: 0x023c9c07, size: 94 bytes, params: 3, frame: 19
let value = environment.__proto__;
value = importDefault(9580) /* metro dependency 9580: ICYMIActionCreators */;
const itemInteracted = value.itemInteracted;
const idBinding = id;
const itemTypeBinding = itemType;
Reflect.apply(itemInteracted, value, [idBinding, itemTypeBinding, a0]);
value = importDefault(9580) /* metro dependency 9580: ICYMIActionCreators */;
value.feedItemActioned({itemId: idBinding, itemType: itemTypeBinding, actionParameters: a1});
}
function _fun112396(a0, a1) { // fn#112396, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:8003, offset: 0x023c9c65, size: 74 bytes, params: 3, frame: 17
env0_11('press_reaction', {'actionGestureType': 'press', 'actionTargetElement': 'add_new_reaction_button',
'actionIntentType': 'open', 'actionDestinationType': null});
onAddReaction(channel.id, message.id, a0, a1);
}
function _fun112397() { // fn#112397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:8219, offset: 0x023c9caf, size: 91 bytes, params: 1, frame: 14
env0_11('press_forward', {'actionGestureType': 'press', 'actionTargetElement': 'forward_button',
'actionIntentType': 'share', 'actionDestinationType': 'channel'});
(ForwardModalUtilsModule).openForwardModal({message: message,
source: 'icymi-tab'});
}
function _fun112398() { // fn#112398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:8449, offset: 0x023c9d0a, size: 141 bytes, params: 1, frame: 20
env0_11('press_reply', {'actionGestureType': 'press', 'actionTargetElement': 'reply_button',
'actionIntentType': 'reply', 'actionDestinationType': 'channel'});
const navigateToPost = ICYMISharedModule.navigateToPost;
const channelBinding = channel;
const id = channelBinding.id;
const guild_id = channelBinding.guild_id;
const messageBinding = message;
Reflect.apply(navigateToPost, ICYMISharedModule, [id, guild_id, messageBinding.id]);
PendingReplyActionCreatorsModule.createPendingReply({channel: channelBinding, message: messageBinding, shouldMention: true,
showMentionToggle: true});
}
function _fun112399() { // fn#112399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:8750, offset: 0x023c9d97, size: 197 bytes, params: 1, frame: 11
if (isKeyMessage) {
value = environment.__proto__;
return (importDefault(697) /* metro dependency 697: native */).colors.MESSAGE_HIGHLIGHT_BACKGROUND_DEFAULT;
}
const backgroundVariantBinding = backgroundVariant;
if (backgroundVariantBinding === 'primary') {
value = environment.__proto__;
return (importDefault(697) /* metro dependency 697: native */).colors.CARD_BACKGROUND_DEFAULT;
}
if (backgroundVariantBinding === 'secondary') {
value = environment.__proto__;
return (importDefault(697) /* metro dependency 697: native */).colors.CARD_SECONDARY_BG;
}
if (backgroundVariantBinding === 'base') {
value = environment.__proto__;
return (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
}
}
function _fun112400({nativeEvent}) { // fn#112400, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:9092, offset: 0x023c9e5c, size: 69 bytes, params: 2, frame: 12
env0_12(!(nativeEvent.contentOffset.x + nativeEvent.layoutMeasurement.width >= nativeEvent.contentSize.width));
}
function _fun112401() { // fn#112401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:9222, offset: 0x023c9ea1, size: 37 bytes, params: 1, frame: 13
env0_11('scroll_reaction_row', {'actionGestureType': 'swipe', 'actionTargetElement': 'reaction_row_container',
'actionIntentType': 'scroll', 'actionDestinationType': null});
}
function _fun112402(a0, a1) { // fn#112402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15059:9936, offset: 0x023c9ec6, size: 209 bytes, params: 3, frame: 23
const id = message.id;
const channelBinding = channel;
let type = a0.type;
const ReactionTypes = (MessageReactionsTypesModule).ReactionTypes;
let BURST = ReactionTypes.BURST;
const r9 = type === BURST ? a0.burst_count : a0.count;
type = a0.type;
BURST = ReactionTypes.BURST;
return (
<View key={'reaction-' + a1}>
<EmojiReaction
messageId={id}
channel={channelBinding}
reaction={a0}
count={r9}
isBurstReaction={type === BURST}
handleItemInteracted={env0_11}
/>
</View>
);
}
}
}
global.__d(_fun112372, 14862, [57, 31, 27, 6898, 1379, 4798, 3784, 661, 1881, 33, 3795, 7151, 4501, 697, 477, 4000,
566, 4603, 7067, 8529, 5278, 1244, 7950, 4573, 9841, 673, 1423, 9835, 8852, 11252, 9600, 11209, 14854, 6682,
7152, 11419, 9797, 9580, 9591, 11004, 3860, 4589, 674, 6818,
2]) /* metro module 14862, dependencies: [57, 31, 27, 6898, 1379, 4798, 3784, 661, 1881, 33, 3795, 7151, 4501, 697, 477, 4000, 566, 4603, 7067, 8529, 5278, 1244, 7950, 4573, 9841, 673, 1423, 9835, 8852, 11252, 9600, 11209, 14854, 6682, 7152, 11419, 9797, 9580, 9591, 11004, 3860, 4589, 674, 6818, 2] */;