import { _ as __assign } from '../../chunks/bundle-7oF7KbGv.js';
import React__default from 'react';
import { g as getSuggestedReplies } from '../../chunks/bundle-BWCGFXhj.js';
import { M as MessageInputWrapperView } from '../../chunks/bundle-Ci146LvO.js';
import { useChannelContext } from '../context.js';
import { useSendbirdStateContext } from '../../useSendbirdStateContext.js';
import '@sendbird/chat/groupChannel';
import '../../utils/message/getOutgoingMessageState.js';
import '../../chunks/bundle-BvG71y_P.js';
import '../../chunks/bundle-Bx5vhTbU.js';
import '../../chunks/bundle-C8im5l9B.js';
import '../../chunks/bundle-C1ds4cil.js';
import '../../GroupChannel/components/SuggestedMentionList.js';
import '../../chunks/bundle-DlfN5GTa.js';
import '../../chunks/bundle-LYAWKk4n.js';
import '../../ui/Icon.js';
import '../../chunks/bundle-ByvmbZD0.js';
import '../../chunks/bundle-CNJMLyGJ.js';
import '../../ui/ImageRenderer.js';
import '../../chunks/bundle-CT8ZXUi2.js';
import '../../chunks/bundle-BJ46V6XQ.js';
import '../../chunks/bundle-BOSnopxk.js';
import '../../chunks/bundle-QxUVt4Ms.js';
import '../../Message/hooks/useDirtyGetMentions.js';
import '../../ui/QuoteMessageInput.js';
import '../../chunks/bundle-DDhhxSv0.js';
import '../../VoicePlayer/useVoicePlayer.js';
import '../../chunks/bundle-CIwVkd-E.js';
import '../../chunks/bundle-CD9AzC6s.js';
import '../../chunks/bundle-C4Z-NWqF.js';
import 'react-dom';
import '../../chunks/bundle-Diqj6For.js';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '@sendbird/uikit-tools';
import '../../withSendbird.js';
import 'css-vars-ponyfill';
import '@sendbird/chat';
import '@sendbird/chat/openChannel';
import '../../chunks/bundle-BbWD2VuS.js';
import '../../VoiceRecorder/useVoiceRecorder.js';
import '../../chunks/bundle-BZd5IHBF.js';
import '../../ui/PlaybackTime.js';
import '../../ui/ProgressBar.js';
import '../../ui/TextButton.js';
import '../../chunks/bundle-HoQqraNc.js';
import '../../ui/MessageInput.js';
import '../../chunks/bundle-DO1vNias.js';
import 'dompurify';
import '../../chunks/bundle-B5N2u5f-.js';
import '../../chunks/bundle-DSOf9RKe.js';
import '../../chunks/bundle-DQ2q-zNM.js';
import '../../chunks/bundle-DpGWywZ5.js';
import '../../chunks/bundle-3amhHjNa.js';
import '../../chunks/bundle-B7barEsR.js';
import '../../chunks/bundle-DDkUg3Os.js';
import '@sendbird/chat/message';
import '../../chunks/bundle-Jir4hfa9.js';
import '../../chunks/bundle-C040958G.js';
import '../../chunks/bundle-C_Vyt_ii.js';
import '../../chunks/bundle-BKho3Uub.js';
import '../../chunks/bundle-BTkRy0wv.js';
import '../../chunks/bundle-dC3DwujZ.js';
import '../../chunks/bundle-BWuyd0AD.js';
import '../../chunks/bundle-oCSRGy9i.js';
import '../../chunks/bundle-BtY8jyVv.js';
import '../../chunks/bundle-DaAoUDJk.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
