import { _ as __assign } from '../../chunks/bundle-0vtSUcHY.js';
import React__default from 'react';
import { g as getSuggestedReplies } from '../../chunks/bundle-hrqkDKRD.js';
import { M as MessageInputWrapperView } from '../../chunks/bundle-Edp-TIC7.js';
import { useChannelContext } from '../context.js';
import { useSendbirdStateContext } from '../../useSendbirdStateContext.js';
import '@sendbird/chat/groupChannel';
import '../../utils/message/getOutgoingMessageState.js';
import '../../chunks/bundle-9wFvMqxF.js';
import '../../chunks/bundle-pffuo01q.js';
import '../../chunks/bundle-zOkaSZl3.js';
import '../../chunks/bundle-_NUeDv_m.js';
import '../../chunks/bundle-YOec1wfw.js';
import '../../chunks/bundle-Xy9OskjJ.js';
import '../../chunks/bundle-RzWTDZDo.js';
import '../../ui/Icon.js';
import '../../chunks/bundle-4ab6nIKe.js';
import '../../chunks/bundle-7RyEqo9-.js';
import '../../ui/ImageRenderer.js';
import '../../chunks/bundle-TEGbbRiE.js';
import '../../chunks/bundle-brky8TnE.js';
import '../../chunks/bundle-K3gy6I7U.js';
import '../../Message/hooks/useDirtyGetMentions.js';
import '../../ui/QuoteMessageInput.js';
import '../../chunks/bundle-bAvA5Udb.js';
import '../../VoicePlayer/useVoicePlayer.js';
import '../../chunks/bundle-KNG-9gh9.js';
import '../../chunks/bundle-e5lT4U6_.js';
import '../../VoiceRecorder/context.js';
import '../../chunks/bundle-92kzAxsw.js';
import 'react-dom';
import '../../chunks/bundle-1XQGq5tE.js';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '../../withSendbird.js';
import '../../VoiceRecorder/useVoiceRecorder.js';
import '../../chunks/bundle-1kYamWYQ.js';
import '../../ui/PlaybackTime.js';
import '../../ui/ProgressBar.js';
import '../../ui/TextButton.js';
import '../../chunks/bundle-3hGhEhNx.js';
import '../../ui/MessageInput.js';
import '../../chunks/bundle-QUJKjMCy.js';
import '../../chunks/bundle-fNYexgBr.js';
import 'dompurify';
import '../../chunks/bundle-72sPkBu4.js';
import '../../chunks/bundle-5x-SH0ln.js';
import '../../chunks/bundle--M9av9I5.js';
import '../../chunks/bundle-2xEG_fol.js';
import '../../hooks/useModal.js';
import '../../chunks/bundle-Y0R5tada.js';
import '../../chunks/bundle-U_0F9z8c.js';
import '../../chunks/bundle-QWYghVSN.js';
import '@sendbird/chat/message';
import '../../chunks/bundle-5cvB_UbP.js';
import '../../chunks/bundle-IKRolu9P.js';
import '../../chunks/bundle-SI8TVXcF.js';
import '../../chunks/bundle-TlXrstq8.js';
import '../hooks/useInitialMessagesFetch.js';
import '../../chunks/bundle-T7ZknK5s.js';
import '../../chunks/bundle-KwnXXB-s.js';
import '../../chunks/bundle-b9LCaMtu.js';
import '../../chunks/bundle-eGLEfc7r.js';
import '../../chunks/bundle-X1ee5Xag.js';

var MessageInputWrapper = function (props) {
    var _a, _b;
    var config = useSendbirdStateContext().config;
    var context = useChannelContext();
    var currentGroupChannel = context.currentGroupChannel, localMessages = context.localMessages, 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, { disabled: disableMessageInput }, context, { currentChannel: currentGroupChannel, quoteMessage: context.quoteMessage, sendUserMessage: function (params) { return (sendMessage(__assign(__assign({}, params), { quoteMessage: { messageId: params.parentMessageId } }))); }, sendFileMessage: function (params) { return (sendFileMessage(params.file, { messageId: params.parentMessageId })); }, sendVoiceMessage: function (_a, duration) {
            var file = _a.file, parentMessageId = _a.parentMessageId;
            return (sendVoiceMessage(file, duration, { parentMessageId: parentMessageId }));
        }, sendMultipleFilesMessage: function (_a) {
            var fileInfoList = _a.fileInfoList, parentMessageId = _a.parentMessageId;
            return (sendMultipleFilesMessage(fileInfoList.map(function (fileInfo) { return fileInfo.file; }), { parentMessageId: parentMessageId }));
        } })));
};

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