'use strict';

var _tslib = require('../../chunks/bundle-HGbi-rCv.js');
var React = require('react');
var useSendbirdStateContext = require('../../useSendbirdStateContext.js');
var Channel_context = require('../context.js');
var index = require('../../chunks/bundle-wl1uuzU7.js');
var utils = require('../../chunks/bundle-CE6bFQmu.js');
var MessageView = require('../../chunks/bundle-ByyccRIt.js');
var Channel_components_FileViewer = require('./FileViewer.js');
var Channel_components_RemoveMessageModal = require('./RemoveMessageModal.js');
require('../../withSendbird.js');
require('../../chunks/bundle-CAUMYdVU.js');
require('../../chunks/bundle-CR04Yhbr.js');
require('../../chunks/bundle-Dww6fCVQ.js');
require('../../chunks/bundle-DAj-1QVM.js');
require('../../chunks/bundle-BWGOXLHb.js');
require('@sendbird/chat/message');
require('../../chunks/bundle-T4lp5F85.js');
require('../../chunks/bundle-DRy7eNJ0.js');
require('../../chunks/bundle-7UHC8ujA.js');
require('../../chunks/bundle-DfcEln0Z.js');
require('@sendbird/chat/groupChannel');
require('../../chunks/bundle-1XtsxT8L.js');
require('../../chunks/bundle-_ekaw3iI.js');
require('../../chunks/bundle-Dehhi1FZ.js');
require('../../chunks/bundle-BaQc9oOW.js');
require('../../chunks/bundle-BjgfoBVC.js');
require('../../chunks/bundle-BXEGf4g2.js');
require('../../utils/message/getOutgoingMessageState.js');
require('../../chunks/bundle-oeWNUdCB.js');
require('../../chunks/bundle-gtkPlUrw.js');
require('../../chunks/bundle-DQy218lT.js');
require('../../Message/hooks/useDirtyGetMentions.js');
require('../../ui/DateSeparator.js');
require('../../chunks/bundle-DAxedY0T.js');
require('../../chunks/bundle-5_kPn4wU.js');
require('../../ui/MessageInput.js');
require('../../chunks/bundle-CmpLg1_S.js');
require('../../ui/IconButton.js');
require('../../ui/Button.js');
require('../../chunks/bundle-BLc7P6Sp.js');
require('dompurify');
require('../../chunks/bundle-D4aDRH9m.js');
require('../../chunks/bundle-8VyIP0TE.js');
require('../../chunks/bundle-DdxJqNSP.js');
require('../../ui/Icon.js');
require('../../chunks/bundle-BoLhr7Ko.js');
require('../../chunks/bundle-CLOaQmX9.js');
require('../../ui/MessageContent.js');
require('../../chunks/bundle-N_CwOE5a.js');
require('../../ui/Loader.js');
require('../../chunks/bundle-B_51Svr9.js');
require('../../chunks/bundle-wMKhbE3c.js');
require('../../ui/MessageItemMenu.js');
require('../../ui/ContextMenu.js');
require('../../chunks/bundle-BTU876jx.js');
require('react-dom');
require('@sendbird/chat');
require('@sendbird/chat/openChannel');
require('../../ui/SortByRow.js');
require('../../chunks/bundle-BaAUvjl9.js');
require('../../ui/MessageItemReactionMenu.js');
require('../../ui/ImageRenderer.js');
require('../../ui/ReactionButton.js');
require('../../chunks/bundle-miB6ue8g.js');
require('../../chunks/bundle-BwQ4BJif.js');
require('../../ui/EmojiReactions.js');
require('../../ui/ReactionBadge.js');
require('../../ui/BottomSheet.js');
require('../../chunks/bundle-CZfcXYaX.js');
require('@sendbird/uikit-tools');
require('css-vars-ponyfill');
require('../../chunks/bundle-L3FEqZsK.js');
require('../../ui/UserListItem.js');
require('../../chunks/bundle-DxSB9NRz.js');
require('../../chunks/bundle-C93-onMF.js');
require('../../ui/MutedAvatarOverlay.js');
require('../../ui/Checkbox.js');
require('../../ui/UserProfile.js');
require('../../sendbirdSelectors.js');
require('../../ui/Tooltip.js');
require('../../ui/TooltipWrapper.js');
require('../../Message/context.js');
require('../../ui/AdminMessage.js');
require('../../ui/QuoteMessage.js');
require('../../chunks/bundle-DcSTnNI0.js');
require('../../chunks/bundle-Cgl5e8xs.js');
require('../../ui/ThreadReplies.js');
require('../../ui/OGMessageItemBody.js');
require('../../chunks/bundle-C3DKUT4Q.js');
require('../../ui/MentionLabel.js');
require('../../ui/LinkLabel.js');
require('../../ui/TextMessageItemBody.js');
require('../../ui/FileMessageItemBody.js');
require('../../ui/TextButton.js');
require('../../chunks/bundle-DTCz0BH1.js');
require('../../chunks/bundle-C6a-umLQ.js');
require('../../chunks/bundle-bqRlVm3u.js');
require('../../ui/VoiceMessageItemBody.js');
require('../../ui/ProgressBar.js');
require('../../VoicePlayer/useVoicePlayer.js');
require('../../ui/PlaybackTime.js');
require('../../ui/ThumbnailMessageItemBody.js');
require('../../ui/UnknownMessageItemBody.js');
require('../../ui/TemplateMessageItemBody.js');
require('../../chunks/bundle-CDIVI7bT.js');
require('../../ui/FallbackTemplateMessageItemBody.tsx.js');
require('../../ui/LoadingTemplateMessageItemBody.tsx.js');
require('../../ui/FeedbackIconButton.js');
require('../../ui/MobileFeedbackMenu.js');
require('../../ui/MessageFeedbackModal.js');
require('../../ui/Input.js');
require('../../ui/MessageFeedbackFailedModal.js');
require('../../GroupChannel/components/SuggestedReplies.js');
require('../../chunks/bundle-BaM5Ed34.js');
require('../../chunks/bundle-X03vJTEw.js');
require('../../chunks/bundle-BBoPpUMg.js');
require('../../chunks/bundle-D8gia2Hg.js');

var Message = function (props) {
    var _a, _b, _c;
    var config = useSendbirdStateContext.useSendbirdStateContext().config;
    var _d = Channel_context.useChannelContext(), initialized = _d.initialized, currentGroupChannel = _d.currentGroupChannel, animatedMessageId = _d.animatedMessageId, setAnimatedMessageId = _d.setAnimatedMessageId, updateMessage = _d.updateMessage, scrollToMessage = _d.scrollToMessage, replyType = _d.replyType, threadReplySelectType = _d.threadReplySelectType, isReactionEnabled = _d.isReactionEnabled, toggleReaction = _d.toggleReaction, emojiContainer = _d.emojiContainer, nicknamesMap = _d.nicknamesMap, setQuoteMessage = _d.setQuoteMessage, resendMessage = _d.resendMessage, deleteMessage = _d.deleteMessage, renderUserMentionItem = _d.renderUserMentionItem, onReplyInThread = _d.onReplyInThread, onQuoteMessageClick = _d.onQuoteMessageClick, onMessageAnimated = _d.onMessageAnimated, sendMessage = _d.sendMessage, localMessages = _d.localMessages;
    var message = props.message;
    return (React.createElement(MessageView.MessageView, _tslib.__assign({}, props, { channel: currentGroupChannel, emojiContainer: emojiContainer, editInputDisabled: !initialized || utils.isDisabledBecauseFrozen(currentGroupChannel) || utils.isDisabledBecauseMuted(currentGroupChannel) || !config.isOnline, shouldRenderSuggestedReplies: ((_a = config === null || config === void 0 ? void 0 : config.groupChannel) === null || _a === void 0 ? void 0 : _a.enableSuggestedReplies)
            && (((_b = config === null || config === void 0 ? void 0 : config.groupChannel) === null || _b === void 0 ? void 0 : _b.showSuggestedRepliesFor) === 'all_messages'
                ? true
                : message.messageId === ((_c = currentGroupChannel === null || currentGroupChannel === void 0 ? void 0 : currentGroupChannel.lastMessage) === null || _c === void 0 ? void 0 : _c.messageId))
            // the options should appear only when there's no failed or pending messages
            && (localMessages === null || localMessages === void 0 ? void 0 : localMessages.length) === 0
            && index.getSuggestedReplies(message).length > 0, isReactionEnabled: isReactionEnabled, replyType: replyType, threadReplySelectType: threadReplySelectType, nicknamesMap: nicknamesMap, renderUserMentionItem: renderUserMentionItem, scrollToMessage: scrollToMessage, toggleReaction: toggleReaction, setQuoteMessage: setQuoteMessage, onQuoteMessageClick: onQuoteMessageClick, onReplyInThreadClick: onReplyInThread, sendUserMessage: function (params) {
            sendMessage({
                message: params.message,
                mentionedUsers: params.mentionedUsers,
                mentionTemplate: params.mentionedMessageTemplate,
            });
        }, updateUserMessage: function (messageId, params) {
            updateMessage({
                messageId: messageId,
                message: params.message,
                mentionedUsers: params.mentionedUsers,
                mentionTemplate: params.mentionedMessageTemplate,
            });
        }, resendMessage: resendMessage, deleteMessage: deleteMessage, animatedMessageId: animatedMessageId, setAnimatedMessageId: setAnimatedMessageId, onMessageAnimated: onMessageAnimated, renderFileViewer: function (props) { return React.createElement(Channel_components_FileViewer.FileViewer, _tslib.__assign({}, props)); }, renderRemoveMessageModal: function (props) { return React.createElement(Channel_components_RemoveMessageModal, _tslib.__assign({}, props)); } })));
};

module.exports = Message;
//# sourceMappingURL=Message.js.map
