import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createVNode, withDirectives, createElementVNode, isRef, withKeys, vModelText } from "vue";
import emojiPC from "../EditorTools/emojiPC.vue.mjs";
import useChatEditor from "./useChatEditor.mjs";
const _hoisted_1 = ["disabled", "placeholder"];
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "ChatEditorPC",
  setup(__props) {
    const {
      t,
      editorInputEle,
      sendMsg,
      isMessageDisabled,
      sendMessage,
      handleChooseEmoji
    } = useChatEditor();
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["chat-editor", { disable: unref(isMessageDisabled) }])
      }, [
        createVNode(unref(emojiPC), {
          class: "chat-emoji",
          onChooseEmoji: unref(handleChooseEmoji)
        }, null, 8, ["onChooseEmoji"]),
        withDirectives(createElementVNode("textarea", {
          ref_key: "editorInputEle",
          ref: editorInputEle,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(sendMsg) ? sendMsg.value = $event : null),
          disabled: unref(isMessageDisabled),
          class: "content-bottom-input",
          placeholder: unref(isMessageDisabled) ? unref(t)("Muted by the moderator") : unref(t)("Type a message"),
          onKeyup: _cache[1] || (_cache[1] = withKeys(
            //@ts-ignore
            (...args) => unref(sendMessage) && unref(sendMessage)(...args),
            ["enter"]
          ))
        }, null, 40, _hoisted_1), [
          [vModelText, unref(sendMsg)]
        ])
      ], 2);
    };
  }
});
export {
  _sfc_main as default
};
