/* Metro module 11273; source: modules/chat/native/ChatView.tsx; dependencies: [31, 27, 4257, 1383, 1379, 4814, 661, 33, 4501, 697, 4015, 566, 1244, 5072, 5087, 6518, 11274, 11275, 4884, 6904, 9864, 5097, 11277, 11289, 11321, 11525, 11926, 477, 11954, 11955, 11790, 11959, 11962, 11340, 11965, 7704, 14, 8581, 11980, 1305, 11982, 11984, 11985, 12056, 2] */
function _fun86088(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#86088, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11459:6, offset: 0x01f87236, size: 423 bytes, params: 8, frame: 23
var object3;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const StyleSheet = (require(27) /* metro dependency 27 */).StyleSheet;
const gatewayConnectionStore = importDefault(4257) /* metro dependency 4257: GatewayConnectionStore */;
const env0_5 = (require(1383) /* metro dependency 1383: ChannelRecord */).createChannelRecord;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
const env0_8 = (require(661) /* metro dependency 661: Constants */).ChannelTypes;
const value2 = require(33) /* metro dependency 33 */;
const env0_9 = value2.jsx;
const env0_10 = value2.jsxs;
const env0_11 = value2.Fragment;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object3 = {};
const object4 = {flex: 1};
object4.borderTopWidth = StyleSheet.hairlineWidth;
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
object4.borderTopColor = BORDER_SUBTLE;
object3.empty = object4;
object3.messages = {'flex': 1, 'overflow': 'hidden'};
const CHANNEL_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CHANNEL_BACKGROUND_DEFAULT;
object3.chat = {'backgroundColor': null, 'justifyContent': 'flex-start', 'overflow': 'hidden', 'flex': 1,
backgroundColor: CHANNEL_BACKGROUND_DEFAULT};
const env0_12 = Reflect.apply(createStyles, createStylesModule, [object3]);
value = value.memo(ChatView);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/chat/native/ChatView.tsx');
exports.default = value;
}
function ChatView({alwaysRespectKeyboard, channelId, chatInputRef, disableGradient, guildId, HACK_fixModalInteraction, screenIndex, secondaryTextFieldRef, setNoExtractUI}) { // fn#86089, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11459:536, offset: 0x01f873dd, size: 1484 bytes, params: 2, frame: 34
var r7;
var r5;
const EmptyState = (require(1305) /* metro dependency 1305: native */).EmptyState;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
alwaysRespectKeyboard = !(alwaysRespectKeyboard === undefined) && alwaysRespectKeyboard;
disableGradient = !(disableGradient === undefined) && disableGradient;
var value;
const styles = useStyles();
let binding = HACK_fixModalInteraction;
binding.useEffect(_fun86090, [channelId, alwaysRespectKeyboard]);
const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
return ChannelStore.getChannel(channelId);
});
const value2 = binding.useMemo(_fun86092, [channel, channelId]);
const channelIsLoading = value2.channelIsLoading;
const channel2 = value2.channel;
const value3 = (require(5072) /* metro dependency 5072: AgeGateUtils */).useIsChannelContentGated(channel2);
const value5 = (require(5087) /* metro dependency 5087: SpoilerChannelUtils */).useGetSpoilerGatingChannelId(channel ?? null);
binding = HACK_fixModalInteraction;
const env0_10 = binding.useRef(channelId);
const value6 = binding.useRef(null);
const env0_12 = binding.useRef(null);
const env0_13 = (importDefault(6518) /* metro dependency 6518: useInitialValue */)(_fun86093);
const value8 = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([MessageStore], _fun86094,
[channelId, (importDefault(11275) /* metro dependency 11275: useIsSelectedResourceChannel */)(channelId)]);
const env0_15 = value8.shouldRenderPlaceholder;
const env0_16 = value8.shouldRenderBegginingRow;
let closure = _fun86095;
const env0_17 = binding.useCallback(closure, []);
const env0_18 = binding.useCallback(function(a0) {
var keyCommand = a0.nativeEvent.keyCommand;
var current = chatInputRef.current;
if (current != null) {
current.handlePressKey(keyCommand);
}
}, [chatInputRef]);
const env0_19 = binding.useCallback(_fun86097, [value6]);
const env0_20 = binding.useCallback(_fun86098, [value6]);
binding.useLayoutEffect(_fun86099, []);
binding.useEffect(_fun86100, [channelId]);
binding.useEffect(_fun86101, [channel2.id]);
binding.useEffect(function() {
return _fun86103;
}, []);
closure = renderMessagesWrapper;
const StartupProfiler = importDefault(11340) /* metro dependency 11340: StartupProfiler */;
const Profiles = (require(11340) /* metro dependency 11340: StartupProfiler */).Profiles;
const ChatView = Profiles.ChatView;
const value9 = ((Component) => )(importDefault(11965) /* metro dependency 11965: ChatViewPopups */);
const r8 = disableGradient ? null : ((Component) => )(importDefault(7704) /* metro dependency 7704: ThemedGradient */);
const closure2 = ChatViewV;
const ageGateUtilsModule = require(8581) /* metro dependency 8581: AgeGateUtils */;
if (ageGateUtilsModule.shouldNSFWGateGuild(guildId)) {
value = importDefault(11980) /* metro dependency 11980: NsfwGateChat */;
value = ((Component) => )(value);
closure2(value, 'NsfwGateChat');
r5 = value;
} else if (channelIsLoading) {
if (GatewayConnectionStore.isConnected()) {
if (channelIsLoading) {
value = ;
closure2(value, 'EmptyState');
r7 = value;
} else if (value3) {
value = importDefault(11982) /* metro dependency 11982: GuildNSFW */;
value = ((Component) => )(value);
closure2(value, 'GuildNSFW');
r7 = value;
} else if (value5 == null) {
if (channel2.isDirectory()) {
value = importDefault(11985) /* metro dependency 11985: GuildDirectory */;
value = ((Component) => )(value);
closure2(value, 'GuildDirectory');
r7 = value;
} else if (channel2.isForumLikeChannel()) {
value = importDefault(12056) /* metro dependency 12056: ForumChannel */;
value = ((Component) => )(value);
closure2(value, 'ForumChannel');
r7 = value;
} else {
r7 = closure();
}
} else if (value5 != null) {
value = importDefault(11984) /* metro dependency 11984: ChannelSpoiler */;
value = ((Component) => )(value);
closure2(value, 'ChannelSpoiler');
r7 = value;
} else if (channel2.isDirectory()) {
value = importDefault(11985) /* metro dependency 11985: GuildDirectory */;
value = ((Component) => )(value);
closure2(value, 'GuildDirectory');
r7 = value;
} else if (channel2.isForumLikeChannel()) {
value = importDefault(12056) /* metro dependency 12056: ForumChannel */;
value = ((Component) => )(value);
closure2(value, 'ForumChannel');
r7 = value;
} else {
r7 = closure();
}
r5 = r7;
} else {
r5 = closure();
}
} else {
if (channelIsLoading) {
value = ;
closure2(value, 'EmptyState');
r7 = value;
} else if (value3) {
value = importDefault(11982) /* metro dependency 11982: GuildNSFW */;
value = ((Component) => )(value);
closure2(value, 'GuildNSFW');
r7 = value;
} else if (value5 == null) {
if (channel2.isDirectory()) {
value = importDefault(11985) /* metro dependency 11985: GuildDirectory */;
value = ((Component) => )(value);
closure2(value, 'GuildDirectory');
r7 = value;
} else if (channel2.isForumLikeChannel()) {
value = importDefault(12056) /* metro dependency 12056: ForumChannel */;
value = ((Component) => )(value);
closure2(value, 'ForumChannel');
r7 = value;
} else {
r7 = closure();
}
} else if (value5 != null) {
value = importDefault(11984) /* metro dependency 11984: ChannelSpoiler */;
value = ((Component) => )(value);
closure2(value, 'ChannelSpoiler');
r7 = value;
} else if (channel2.isDirectory()) {
value = importDefault(11985) /* metro dependency 11985: GuildDirectory */;
value = ((Component) => )(value);
closure2(value, 'GuildDirectory');
r7 = value;
} else if (channel2.isForumLikeChannel()) {
value = importDefault(12056) /* metro dependency 12056: ForumChannel */;
value = ((Component) => )(value);
closure2(value, 'ForumChannel');
r7 = value;
} else {
r7 = closure();
}
r5 = r7;
}
return (
{value9}
{r8}
{r5}
);
}
function _fun86090() { // fn#86090, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11459:747, offset: 0x01f879a9, size: 49 bytes, params: 1, frame: 11
var value;
if (!alwaysRespectKeyboard) {
value = environment.__proto__;
value = require(4015) /* metro dependency 4015: ChatInputUtils */;
value.dismissKeyboard();
}
}
function _fun86092() { // fn#86092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11459:865, offset: 0x01f879da, size: 137 bytes, params: 1, frame: 20
var r3;
var value2;
var createChannelRecordBinding;
var object;
var intl;
if (channel == null) {
value2 = environment.__proto__;
createChannelRecordBinding = createChannelRecord;
object = {};
object.id = channelId;
object.type = ChannelTypes.GUILD_TEXT;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object.name = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ZTNur7);
r3 = createChannelRecordBinding(object);
} else {
r3 = channel;
}
return {channel: r3, channelIsLoading: channel == null};
}
function _fun86094() { // fn#86094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11459:1260, offset: 0x01f87a92, size: 93 bytes, params: 1, frame: 14
const value = environment.__proto__;
const messages = MessageStore.getMessages(channelId);
return {shouldRenderPlaceholder: messages.length === 0 && (messages.loadingMore || !messages.ready),
shouldRenderBegginingRow: !messages.hasMoreBefore && !env0_14};
}
function _fun86095(a0) { // fn#86095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11459:1489, offset: 0x01f87aef, size: 36 bytes, params: 2, frame: 11
const current = env0_12.current;
if (current != null) {
current.onChatViewScrolled(a0);
}
}
function _fun86097() { // fn#86097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11459:1671, offset: 0x01f87b45, size: 32 bytes, params: 1, frame: 9
const current = env0_11.current;
if (current != null) {
current.scrollToNewMessages();
}
}
function _fun86098() { // fn#86098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11459:1751, offset: 0x01f87b65, size: 32 bytes, params: 1, frame: 9
const current = env0_11.current;
if (current != null) {
current.jumpToPresent();
}
}
function _fun86099() { // fn#86099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11459:1827, offset: 0x01f87b85, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
return (require(4884) /* metro dependency 4884: TTIAnalyticsUtils */).trackAppUIViewed();
}
function _fun86100() { // fn#86100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11459:1877, offset: 0x01f87baa, size: 72 bytes, params: 1, frame: 14
const value = environment.__proto__;
const defaultImport = importDefault(6904) /* metro dependency 6904: LazyLoadedThreadManager */;
const loadThread = defaultImport.loadThread;
const channelIdBinding = channelId;
Reflect.apply(loadThread, defaultImport, [channelIdBinding]);
(require(9864) /* metro dependency 9864: SummaryActionCreators */).fetchSummaries(channelIdBinding);
}
function _fun86101() { // fn#86101, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11459:1952, offset: 0x01f87bf2, size: 26 bytes, params: 1, frame: 2
env0_10.current = channel.id;
}
function _fun86102() { // fn#86102, offset: 0x01f87c0c, size: 11 bytes, params: 1, frame: 1
return _fun86103;
}
function renderMessagesWrapper() { // fn#86104, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11459:2085, owner: ChatView.renderMessagesWrapper, offset: 0x01f87c49, size: 725 bytes, params: 1, frame: 27
let value = environment.__proto__;
const jsxRuntimeEnv1_11Binding = jsxRuntimeEnv1_11;
const ChatViewWrapper = importDefault(11277) /* metro dependency 11277: ChatViewWrapper */;
const defaultImportProps = {style: styles.messages};
let channelIdBinding = channelId;
defaultImportProps.channelId = channelIdBinding;
defaultImportProps.stickyHeader = ((Component) => )(importDefault(11289) /* metro dependency 11289: ChatViewStickyHeader */);
const Messages = importDefault(11321) /* metro dependency 11321: Messages */;
const screenIndexBinding = screenIndex;
const chatInputRefBinding = chatInputRef;
const items2 = [{((Component) => )(importDefault(11525) /* metro dependency 11525: ChatInput */)}{((Component) => )(importDefault(11926) /* metro dependency 11926: ChatBeginningRow */)}];
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
const isAndroid2 = platformUtilsModule.isAndroid();
const value5 = null;
items2[1] = isAndroid2 ? value5 : ((Component) => )(importDefault(11954) /* metro dependency 11954: PortalKeyboardInlineComponentIos */);
items2[2] = shouldRenderPlaceholder ? ((Component) => )(importDefault(11955) /* metro dependency 11955: ChatPlaceholder */) : value5;
const moduleValue2 = platformUtilsModule;
items2[3] = moduleValue2.isAndroid() ? ((Component) => )(importDefault(11790) /* metro dependency 11790: JumpToPresentButton */) : value5;
const items3 = [{items2}];
value = importDefault(11959) /* metro dependency 11959: ChannelSafeAreaBottomAndroid */;
channelIdBinding = channelId;
items3[1] = ((Component) => )(value);
items3[2] = ((Component) => )(importDefault(11962) /* metro dependency 11962: VoiceMessageOverlay */);
return (
<>
{items3}
>
);
}
function ChatViewV(a0, a1) { // fn#86105, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11459:2998, owner: ChatView.V, offset: 0x01f87f1e, size: 44 bytes, params: 3, frame: 11
const value = environment.__proto__;
(importDefault(14) /* metro dependency 14: TTITracker */).setInterstitial(a1);
return a0;
}
function _fun86103() { // fn#86103, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11459:1999, offset: 0x01f87c17, size: 50 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = require(5097) /* metro dependency 5097: ReadStateActionCreators */;
value.clearOldestUnreadMessageId(env1_10.current);
}