/* Metro module 14858; source: modules/icymi/native/ICYMIMessageRow.tsx; dependencies: [31, 27, 1379, 1945, 1867, 3793, 4864, 1878, 14853, 661, 33, 697, 14815, 477, 14816, 9546, 7230, 566, 14859, 14860, 4573, 1244, 1305, 4617, 6593, 9579, 9580, 12129, 11401, 14854, 14856, 21, 5278, 9122, 14862, 2] */ import SnowflakeUtils from '../../../utils/SnowflakeUtils.tsx'; /* Metro dependency 21 */ import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */ import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */ import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */ import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */ import GuildMemberStore from '../../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */ import RelationshipStore from '../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */ import UserGuildSettingsStore from '../../../stores/UserGuildSettingsStore.tsx'; /* Metro dependency 4864 */ import GetChannelA11yLabel from '../../channel/getChannelA11yLabel.tsx'; /* Metro dependency 9122 */ import ICYMIActionCreators from '../ICYMIActionCreators.tsx'; /* Metro dependency 9580 */ import ICYMICardInCard from './ICYMICardInCard.tsx'; /* Metro dependency 14856 */ import ICYMICardInteractionRow from './ICYMICardInteractionRow.tsx'; /* Metro dependency 14862 */ 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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */ import * as PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */ import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */ import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */ import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */ import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */ import * as ICYMITypesModule from '../ICYMITypes.tsx'; /* Metro dependency 7230 */ import * as GetChannelA11yLabelModule from '../../channel/getChannelA11yLabel.tsx'; /* Metro dependency 9122 */ import * as MediaSourceUtilModule from '../../media_viewer/native/MediaSourceUtil.tsx'; /* Metro dependency 9546 */ import * as ICYMIUtilsModule from '../ICYMIUtils.tsx'; /* Metro dependency 9579 */ import * as ShowLongPressMessageActionSheetModule from '../../messages/native/long_press/showLongPressMessageActionSheet.tsx'; /* Metro dependency 11401 */ import * as CreateICYMIStylesModule from './createICYMIStyles.tsx'; /* Metro dependency 14815 */ import * as ICYMIContextModule from './ICYMIContext.tsx'; /* Metro dependency 14816 */ import * as DesignConstantsModule from './DesignConstants.tsx'; /* Metro dependency 14853 */ function _fun112296(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#112296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15055:6, offset: 0x023c4268, size: 455 bytes, params: 8, frame: 20 const env0_0 = require; const MessageRowContent2 = MessageRowContent; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_18 = (CreateICYMIStylesModule).createICYMIStyles(_fun112304); const env0_19 = ReactModule.memo(_fun112305); (FileImportTrackerModule).fileFinishedImporting('modules/icymi/native/ICYMIMessageRow.tsx'); exports.default = MessageRowWrapper; exports.MessageRowContent = MessageRowContent2; function MessageRowContent({message, channel, lineClamp, nested, visible}) { // fn#112297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15055:997, offset: 0x023c442f, size: 728 bytes, params: 2, frame: 31 var r11; var r6; var MessageRowPreview; var object2; lineClamp = lineClamp === undefined ? 3 : lineClamp; nested = !(nested === undefined) && nested; visible = !(visible === undefined) && visible; const value6 = env0_18(); const binding = env0_3; const useContext = binding.useContext; const ICYMIContext = (ICYMIContextModule).ICYMIContext; const value7 = Reflect.apply(useContext, binding, [ICYMIContext]); const extractMediaSourcesFromMessage = MediaSourceUtilModule.extractMediaSourcesFromMessage; const guild_id = channel.guild_id; const GRAVITY_VALID_EMBED_TYPES = (ICYMITypesModule).GRAVITY_VALID_EMBED_TYPES; const value8 = Reflect.apply(extractMediaSourcesFromMessage, MediaSourceUtilModule, [message, message, guild_id, GRAVITY_VALID_EMBED_TYPES]); const value9 = (FluxModule).useStateFromStores([UserGuildSettingsStore], _fun112298); const value10 = env0_3.useMemo(_fun112299, [message.attachments.length, message.content, message.embeds]); const value11 = message.attachments.every(function({content_type}) { return content_type?.startsWith('audio/'); }); const items3 = [value6.messagePreview]; items3[1] = nested ? null : {paddingLeft: value7.margin}; if (value10) { r6 = !value10; } else { MessageRowPreview = (require(14859) /* metro dependency 14859: ICYMIMessageRowPreview */).MessageRowPreview; object2 = {message: message, muted: value9, lineClamp: lineClamp}; r11 = value8.length !== 0 ? undefined : message.attachments.length > 0 ? message.embeds.length !== 0 ? undefined : {renderAttachments: true} : undefined; object2.messageOptions = r11; r11 = value11 ? 'auto' : 'none'; object2.pointerEvents = r11; r6 = ; } const items2 = [r6]; items2[1] = value8.length > 0 && {((Component) => )(importDefault(14860) /* metro dependency 14860: ICYMIMediaMosaic */)}; items2[2] = value8.length === 0 && message.embeds.length > 0 && {((NonMediaEmbedsRowPreview) => )((require(14859) /* metro dependency 14859: ICYMIMessageRowPreview */).NonMediaEmbedsRowPreview)}; return ( {items2} ); function _fun112298() { // fn#112298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15055:1262, offset: 0x023c4707, size: 43 bytes, params: 1, frame: 13 const value = environment.__proto__; const userGuildSettingsStoreBinding = UserGuildSettingsStore; const isChannelMuted = userGuildSettingsStoreBinding.isChannelMuted; const channelBinding = channel; return Reflect.apply(isChannelMuted, userGuildSettingsStoreBinding, [channelBinding.getGuildId(), channelBinding.id]); } function _fun112299() { // fn#112299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15055:1319, offset: 0x023c4732, size: 129 bytes, params: 1, frame: 5 return !(message.embeds.length !== 1 || message.attachments.length > 0) && (message.embeds[0].type === MessageEmbedTypes.GIFV && message.embeds[0].url === message.content); } } function ReplyMessageContent({message, channel, guild}) { // fn#112301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15055:2076, offset: 0x023c47da, size: 847 bytes, params: 2, frame: 42 var r0; const Text = (TextModule).Text; var intl; var items4; var Avatar; var id; var items2; var object2; var inset; var moduleValue3; var getName; var items3; var Provider; const value3 = env0_18(); let binding = env0_3; let useContext = binding.useContext; const ICYMIContext = (require(14816) /* metro dependency 14816: ICYMIContext */).ICYMIContext; const value4 = Reflect.apply(useContext, binding, [ICYMIContext]); const user = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() { return UserStore.getUser(message.author.id); }); const r28 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildMemberStore], function() { return GuildMemberStore.getMember(guild.id, message.author.id); })?.colorString ?? DEFAULT_ROLE_COLOR_HEX; binding = env0_3; useContext = binding.useContext; const width = Reflect.apply(useContext, binding, [ICYMIContext]).width; if (user == null) { r0 = null; } else { var viewBindingProps = {style: value3.replyPreview}; intl = (require(1244) /* metro dependency 1244: indexNative */).intl; items4 = [ {intl.string((require(1244) /* metro dependency 1244: indexNative */).t.mPPcez)} , ]; var viewBinding2Props = {style: value3.replyInner}; Avatar = (require(1305) /* metro dependency 1305: native */).Avatar; id = guild.id; items2 = [ , ]; object2 = {}; inset = value4.inset; object2.style = {gap: 4, width: width - inset - 2 * ITEM_PADDING - 2 * PX_12 - 30 - PX_8 - 2}; var textProps2 = {'variant': 'text-md/semibold', 'style': null, 'lineClamp': 1, style: {color: r28}}; moduleValue3 = require(4617) /* metro dependency 4617: NicknameUtils */; getName = moduleValue3.getName; id = guild.id; items3 = [ {Reflect.apply(getName, moduleValue3, [id, channel.id, user])} , ]; Provider = (require(14816) /* metro dependency 14816: ICYMIContext */).ICYMIContext.Provider; inset = value4.inset; items3[1] = ( ); items2[1] = ( {items3} ); items4[1] = ( {items2} ); r0 = ( {items4} ); } return r0; } function _fun112304(a0) { // fn#112304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15055:366, offset: 0x023c4b7f, size: 439 bytes, params: 2, frame: 19 const object = {}; const object2 = {flex: 1}; object2.paddingLeft = a0.inset; const PX_82 = (importDefault(697) /* metro dependency 697: native */).space.PX_8; object2.gap = PX_82; object.pressable = object2; const object3 = {}; const isAndroid2 = (PlatformUtilsModule).isAndroid(); const value2 = 0; object3.marginTop = isAndroid2 ? -2 : value2; object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md; object3.gap = value2; object.messagePreview = object3; const object4 = {}; const PX_83 = (importDefault(697) /* metro dependency 697: native */).space.PX_8; object4.gap = PX_83; object4.marginHorizontal = a0.margin; object4.padding = PX_12; object4.overflow = 'hidden'; object4.borderWidth = 1; const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE; object4.borderColor = BORDER_SUBTLE; object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg; object4.maxHeight = 132; object.replyPreview = object4; object.replyInner = {'flexDirection': 'row', 'gap': null, 'overflow': 'hidden', gap: PX_8}; object.afterMessage = {paddingLeft: a0.inset, paddingBottom: a0.margin}; object.media = {marginRight: a0.margin}; const object8 = {}; const PX_84 = (importDefault(697) /* metro dependency 697: native */).space.PX_8; object8.marginTop = PX_84; object8.marginBottom = a0.margin; const PX_85 = (importDefault(697) /* metro dependency 697: native */).space.PX_8; object8.gap = PX_85; object8.paddingHorizontal = a0.margin; object8.marginLeft = a0.inset; object.footer = object8; return object; } function _fun112305({message, channel, guild, visible, messageContext}) { // fn#112305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15055:3084, offset: 0x023c4d36, size: 941 bytes, params: 2, frame: 33 const value3 = (FluxModule).useStateFromStores([UserGuildSettingsStore], _fun112306); env0_3.useEffect(_fun112307, [guild?.id, message.author.id]); const value5 = (require(9579) /* metro dependency 9579: ICYMIUtils */).useICYMIMessage(channel.id, messageContext?.reply_message_id); const value6 = (require(9579) /* metro dependency 9579: ICYMIUtils */).useICYMIMessage(channel.id, messageContext?.before_message_id); const value7 = env0_18(); const value8 = env0_3.useCallback(_fun112308, [channel.id, message]); const value9 = env0_3.useCallback(_fun112309, [channel, message]); const value10 = env0_3.useCallback(_fun112310, [channel.id, guild.id, message.id]); object = {}; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; object.actionLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.hMFMY9); object.id = message.id; object.interactionType = 'message'; object.channelId = channel.id; const defaultImport2 = SnowflakeUtils; object.timestamp = defaultImport2.extractTimestamp(message.id); object.onHeaderPress = value10; object.onHeaderLongPress = value8; object.message = message; object.shouldFeatureUser = true; const PressableHighlight = (PressablesModule).PressableHighlight; const pressableHighlightProps = {onPress: value10, onLongPress: value9, unstable_pressDelay: 130, accessibilityRole: 'button', accessibilityLabel: (GetChannelA11yLabel)({channel: channel}), accessibilityHint: (GetChannelA11yLabelModule).getChannelA11yHint({channel: channel, muted: value3}), style: value7.pressable}; const items2 = [ value6 != null ? ( ) : null, ]; items2[1] = ( ); items2[2] = ( value5 != null ? ( ) : null ); return ( {items2} {((Component) => )(ICYMICardInteractionRow)} ); function _fun112306() { // fn#112306, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15055:3190, offset: 0x023c4707, size: 43 bytes, params: 1, frame: 13 const value = environment.__proto__; const userGuildSettingsStoreBinding = UserGuildSettingsStore; const isChannelMuted = userGuildSettingsStoreBinding.isChannelMuted; const channelBinding = channel; return Reflect.apply(isChannelMuted, userGuildSettingsStoreBinding, [channelBinding.getGuildId(), channelBinding.id]); } function _fun112307() { // fn#112307, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15055:3247, offset: 0x023c50e3, size: 107 bytes, params: 1, frame: 15 var value3; var defaultImport; const guildBinding = guild; const value2 = undefined; if ((guildBinding == null ? value2 : guild.id) != null) { value3 = environment.__proto__; defaultImport = importDefault(6593) /* metro dependency 6593: GuildActionCreators */; defaultImport.requestMembersById(guild == null ? value2 : guild.id, message.author.id); } return value2; } function _fun112308() { // fn#112308, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15055:3541, offset: 0x023c514e, size: 154 bytes, params: 1, frame: 22 let value = environment.__proto__; const defaultImport = ICYMIActionCreators; const itemInteracted = defaultImport.itemInteracted; const messageBinding = message; Reflect.apply(itemInteracted, defaultImport, [messageBinding.id, 'message', 'long_press_channel']); defaultImport.feedItemActioned({itemId: messageBinding.id, itemType: 'message', actionParameters: {'actionGestureType': 'long_press', 'actionTargetElement': 'item_header', 'actionIntentType': 'open', 'actionDestinationType': null}}); value = require(12129) /* metro dependency 12129: openChannelLongPressActionSheet */; value.openChannelLongPressActionSheet(channel.id); } function _fun112309() { // fn#112309, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15055:3878, offset: 0x023c51e8, size: 189 bytes, params: 1, frame: 22 const defaultImport = ICYMIActionCreators; const itemInteracted = defaultImport.itemInteracted; const messageBinding = message; Reflect.apply(itemInteracted, defaultImport, [messageBinding.id, 'message', 'long_press_message']); defaultImport.feedItemActioned({itemId: messageBinding.id, itemType: 'message', actionParameters: {'actionGestureType': 'long_press', 'actionTargetElement': 'item_body', 'actionIntentType': 'open', 'actionDestinationType': null}}); const showLongPressMessageActionSheet = ShowLongPressMessageActionSheetModule.showLongPressMessageActionSheet; const userStoreBinding = UserStore; const getUser = userStoreBinding.getUser; Reflect.apply(showLongPressMessageActionSheet, ShowLongPressMessageActionSheetModule, [{channel: channel, message: messageBinding, user: Reflect.apply(getUser, userStoreBinding, [messageBinding.author.id])}]); } function _fun112310() { // fn#112310, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15055:4255, offset: 0x023c52a5, size: 170 bytes, params: 1, frame: 22 let value = environment.__proto__; const defaultImport = ICYMIActionCreators; const itemInteracted = defaultImport.itemInteracted; const messageBinding = message; Reflect.apply(itemInteracted, defaultImport, [messageBinding.id, 'message', 'press_message']); defaultImport.feedItemActioned({itemId: messageBinding.id, itemType: 'message', actionParameters: {'actionGestureType': 'press', 'actionTargetElement': 'item_container', 'actionIntentType': 'navigate', 'actionDestinationType': 'channel'}}); value = require(14854) /* metro dependency 14854: ICYMIShared */; value.navigateToPost(channel.id, guild.id, messageBinding.id); } } function MessageRowWrapper({message, messageContext, visible}) { // fn#112311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15055:5479, offset: 0x023c534f, size: 251 bytes, params: 2, frame: 23 const value2 = (ICYMIUtilsModule).useGravityMessage(message); const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], _fun112312); const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() { return GuildStore.getGuild(channel?.guild_id); }); return ( channel == null || guild == null || (require(566) /* metro dependency 566: flux */).useStateFromStores([RelationshipStore], _fun112314) ? null : ((Component) => )(env0_19) ); function _fun112312() { // fn#112312, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15055:5617, offset: 0x023c0bbf, size: 36 bytes, params: 1, frame: 12 const channelStoreBinding = ChannelStore; const getChannel = channelStoreBinding.getChannel; const binding = env0_0; const getChannelId = binding.getChannelId; return Reflect.apply(getChannel, channelStoreBinding, [Reflect.apply(getChannelId, binding, [])]); } function _fun112314() { // fn#112314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15055:5768, offset: 0x023c5479, size: 38 bytes, params: 1, frame: 11 const relationshipStoreBinding = RelationshipStore; return relationshipStoreBinding.isBlockedOrIgnored(env0_0.author.id); } } } global.__d(_fun112296, 14858, [31, 27, 1379, 1945, 1867, 3793, 4864, 1878, 14853, 661, 33, 697, 14815, 477, 14816, 9546, 7230, 566, 14859, 14860, 4573, 1244, 1305, 4617, 6593, 9579, 9580, 12129, 11401, 14854, 14856, 21, 5278, 9122, 14862, 2]) /* metro module 14858, dependencies: [31, 27, 1379, 1945, 1867, 3793, 4864, 1878, 14853, 661, 33, 697, 14815, 477, 14816, 9546, 7230, 566, 14859, 14860, 4573, 1244, 1305, 4617, 6593, 9579, 9580, 12129, 11401, 14854, 14856, 21, 5278, 9122, 14862, 2] */;