import { _ as __assign } from '../../chunks/bundle-KIf79auh.js';
import React__default from 'react';
import { g as getSuggestedReplies } from '../../chunks/bundle-LTiCF37t.js';
import { M as MessageInputWrapperView } from '../../chunks/bundle-DbZW44FD.js';
import { useChannelContext } from '../context.js';
import { useSendbirdStateContext } from '../../useSendbirdStateContext.js';
import '@sendbird/chat/groupChannel';
import '../../utils/message/getOutgoingMessageState.js';
import '../../chunks/bundle-0QDb7-Y_.js';
import '../../chunks/bundle-39Y3yv8j.js';
import '../../chunks/bundle-wpc1Fted.js';
import '../../chunks/bundle-XDy3Cf54.js';
import '../../chunks/bundle-wWnN6K3w.js';
import '../../GroupChannel/components/SuggestedMentionList.js';
import '../../chunks/bundle-NntyZyeL.js';
import '../../chunks/bundle-9c5vLDe9.js';
import '../../ui/Icon.js';
import '../../chunks/bundle-DHw1C5gJ.js';
import '../../chunks/bundle-b2jLXyrm.js';
import '../../ui/ImageRenderer.js';
import '../../chunks/bundle-Sl-oiala.js';
import '../../chunks/bundle-hjFxrcMW.js';
import '../../chunks/bundle-yIputEl7.js';
import '../../chunks/bundle-AaDwp4eU.js';
import '../../Message/hooks/useDirtyGetMentions.js';
import '../../ui/QuoteMessageInput.js';
import '../../chunks/bundle-2AR3a1T9.js';
import '../../VoicePlayer/useVoicePlayer.js';
import '../../chunks/bundle-bg3dRlK7.js';
import '../../chunks/bundle-xC7o7NLR.js';
import '../../VoiceRecorder/context.js';
import '../../chunks/bundle-22Jw6ztq.js';
import 'react-dom';
import '../../chunks/bundle-Y3ZVN9yF.js';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '../../withSendbird.js';
import '../../VoiceRecorder/useVoiceRecorder.js';
import '../../chunks/bundle-NwEKq2eQ.js';
import '../../ui/PlaybackTime.js';
import '../../ui/ProgressBar.js';
import '../../ui/TextButton.js';
import '../../chunks/bundle-n2BmCgGV.js';
import '../../ui/MessageInput.js';
import '../../chunks/bundle-zy69cX9t.js';
import 'dompurify';
import '../../chunks/bundle-9C7b_-hs.js';
import '../../chunks/bundle-0Vur_TKy.js';
import '../../chunks/bundle-4gcxTdvH.js';
import '../../chunks/bundle-Sm0-7tTm.js';
import '../../hooks/useModal.js';
import '../../chunks/bundle-y909vBn9.js';
import '../../chunks/bundle-_hGurAcC.js';
import '../../chunks/bundle-NQDEdVJA.js';
import '@sendbird/chat/message';
import '../../chunks/bundle-Drmg8_dh.js';
import '../../chunks/bundle-eC1SRuX3.js';
import '../../chunks/bundle-6yzuMtzi.js';
import '../../chunks/bundle-C-Q3OKQW.js';
import '../../chunks/bundle-nXMckOlK.js';
import '../../chunks/bundle-LjoHDFFW.js';
import '../../chunks/bundle-3E-IANjq.js';
import '../../chunks/bundle-npMrmwG6.js';
import '../../chunks/bundle-9QigDxkR.js';
import '../../chunks/bundle--GxLwo7q.js';

var MessageInputWrapper = function (props) {
    var _a, _b;
    var config = useSendbirdStateContext().config;
    var context = useChannelContext();
    var quoteMessage = context.quoteMessage, localMessages = context.localMessages, currentGroupChannel = context.currentGroupChannel, sendMessage = context.sendMessage, sendFileMessage = context.sendFileMessage, sendVoiceMessage = context.sendVoiceMessage, sendMultipleFilesMessage = context.sendMultipleFilesMessage;
    var lastMessage = currentGroupChannel === null || currentGroupChannel === void 0 ? void 0 : currentGroupChannel.lastMessage;
    var isLastMessageSuggestedRepliesEnabled = ((_a = config === null || config === void 0 ? void 0 : config.groupChannel) === null || _a === void 0 ? void 0 : _a.enableSuggestedReplies)
        && getSuggestedReplies(lastMessage).length > 0
        && (localMessages === null || localMessages === void 0 ? void 0 : localMessages.length) === 0;
    var disableMessageInput = props.disabled
        || isLastMessageSuggestedRepliesEnabled && !!((_b = lastMessage.extendedMessagePayload) === null || _b === void 0 ? void 0 : _b['disable_chat_input']);
    return (React__default.createElement(MessageInputWrapperView, __assign({}, props, context, { disabled: disableMessageInput, currentChannel: currentGroupChannel, sendUserMessage: function (params) {
            return sendMessage({
                message: params.message,
                mentionTemplate: params.mentionedMessageTemplate,
                mentionedUsers: params.mentionedUsers,
                quoteMessage: quoteMessage,
            });
        }, sendFileMessage: function (params) {
            return sendFileMessage(params.file, quoteMessage);
        }, sendVoiceMessage: function (_a, duration) {
            var file = _a.file;
            return sendVoiceMessage(file, duration, quoteMessage);
        }, sendMultipleFilesMessage: function (_a) {
            var fileInfoList = _a.fileInfoList;
            return sendMultipleFilesMessage(fileInfoList.map(function (fileInfo) { return fileInfo.file; }), quoteMessage);
        } })));
};

export { MessageInputWrapper, MessageInputWrapper as default };
//# sourceMappingURL=MessageInput.js.map
