import { _ as __assign } from '../../chunks/bundle-CMZSpHeh.js';
import React__default from 'react';
import { M as MessageInputWrapperView } from '../../chunks/bundle-E2vRu-P9.js';
export { V as VoiceMessageInputWrapper } from '../../chunks/bundle-E2vRu-P9.js';
import { useGroupChannelContext } from '../context.js';
import { useIIFE } from '@sendbird/uikit-tools';
import { g as getSuggestedReplies, e as isSendableMessage } from '../../chunks/bundle-BdOcjdmg.js';
import { useSendbirdStateContext } from '../../useSendbirdStateContext.js';
import '../../chunks/bundle-DseK7HAq.js';
import '../../chunks/bundle-Aca68v_Z.js';
import '../../chunks/bundle-XCQLW6rR.js';
import '../../chunks/bundle-eddZycld.js';
import './SuggestedMentionList.js';
import '../../chunks/bundle-Dxzrjw7N.js';
import '../../chunks/bundle-CIcpyYvw.js';
import '../../ui/Icon.js';
import '../../chunks/bundle-DRN8Ufbc.js';
import '../../chunks/bundle-BlN1UcdM.js';
import '../../ui/ImageRenderer.js';
import '../../chunks/bundle-Bzds2Ucm.js';
import '../../chunks/bundle-GCGSXAv2.js';
import '../../chunks/bundle-DBqo_XXO.js';
import '../../chunks/bundle-B2uB4TXG.js';
import '../../withSendbird.js';
import '../../Message/hooks/useDirtyGetMentions.js';
import '../../ui/QuoteMessageInput.js';
import '../../chunks/bundle-DhKZXsZz.js';
import '../../chunks/bundle-DI-PfZ0q.js';
import '../../VoicePlayer/useVoicePlayer.js';
import '../../chunks/bundle-BHpijKgj.js';
import '../../chunks/bundle-Csv255vx.js';
import '../../VoiceRecorder/context.js';
import '../../chunks/bundle-DYAiU0qn.js';
import 'react-dom';
import '../../chunks/bundle-CAdHlM56.js';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '../../VoiceRecorder/useVoiceRecorder.js';
import '../../chunks/bundle-ShfUz6vN.js';
import '../../ui/PlaybackTime.js';
import '../../ui/ProgressBar.js';
import '../../ui/TextButton.js';
import '../../chunks/bundle-DrCrimot.js';
import '../../ui/MessageInput.js';
import '../../chunks/bundle-CRA9P1Ar.js';
import 'dompurify';
import '../../chunks/bundle-BI7jBgEO.js';
import '../../chunks/bundle-C6a7C-OU.js';
import '../../chunks/bundle-Dorruixf.js';
import '../../chunks/bundle-CawmTzdt.js';
import '../../hooks/useModal.js';
import '../../chunks/bundle-jpdMhsoB.js';
import '@sendbird/chat/message';
import '@sendbird/chat/groupChannel';
import '../../chunks/bundle-BH6pGtIL.js';
import '../../chunks/bundle-DoMztHB5.js';
import '../../chunks/bundle-BOnWRs_F.js';
import '../../chunks/bundle-C6iM_9qC.js';
import '../../chunks/bundle-9-bZdwX6.js';
import '../../chunks/bundle-DehMr9Ib.js';
import '../../chunks/bundle-5Yi0S6u0.js';
import '../../chunks/bundle-DQ2TqmPV.js';
import '../../chunks/bundle-DWLEk8wY.js';
import '../../utils/message/getOutgoingMessageState.js';

var MessageInputWrapper = function (props) {
    var _a;
    var config = useSendbirdStateContext().config;
    var context = useGroupChannelContext();
    var messages = context.messages, currentChannel = context.currentChannel;
    var lastMessage = currentChannel === null || currentChannel === void 0 ? void 0 : currentChannel.lastMessage;
    var isLastMessageSuggestedRepliesEnabled = useIIFE(function () {
        var _a;
        if (!((_a = config === null || config === void 0 ? void 0 : config.groupChannel) === null || _a === void 0 ? void 0 : _a.enableSuggestedReplies))
            return false;
        if (getSuggestedReplies(lastMessage).length === 0)
            return false;
        var lastMessageInContext = messages[messages.length - 1];
        if (isSendableMessage(lastMessageInContext) && lastMessageInContext.sendingStatus !== 'succeeded')
            return false;
        return true;
    });
    var disableMessageInput = props.disabled
        || isLastMessageSuggestedRepliesEnabled && !!((_a = lastMessage.extendedMessagePayload) === null || _a === void 0 ? void 0 : _a['disable_chat_input']);
    return (React__default.createElement(MessageInputWrapperView, __assign({}, props, context, { disabled: disableMessageInput })));
};

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