"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ChatMessage = void 0;
var _react = _interopRequireWildcard(require("react"));
var _chatMessageHeader = require("./chat-message-header");
var _chatMessageBody = require("./chat-message-body");
var _constants = require("./constants");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
function ChatMessageBase({
  itemKey,
  username,
  avatarUrl,
  timestamp,
  textBoxAriaLabel,
  onChange,
  onSubmit,
  onMention,
  onBlur,
  maxLength,
  getCharactersCounterString,
  mentions,
  options,
  actions,
  onSelect,
  isInEditMode,
  onActionBtnClick,
  optionsTriggerAriaLabel,
  mentionsPropmptText,
  autoFocus,
  value = _constants.DEFAULT_VALUE
}) {
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
    className: "chat-item",
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_chatMessageHeader.ChatMessageHeader, {
      timestamp: timestamp,
      username: username,
      avatarUrl: avatarUrl,
      options: options,
      itemKey: itemKey,
      onSelect: onSelect,
      optionsTriggerAriaLabel: optionsTriggerAriaLabel
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_chatMessageBody.ChatMessageBody, {
      itemKey: itemKey,
      value: value,
      onChange: onChange,
      onSubmit: onSubmit,
      readOnly: !isInEditMode,
      maxLength: maxLength,
      getCharactersCounterString: getCharactersCounterString,
      mentions: mentions,
      actions: actions,
      onActionBtnClick: onActionBtnClick,
      onMention: onMention,
      onBlur: onBlur,
      textBoxAriaLabel: textBoxAriaLabel,
      mentionsPropmptText: mentionsPropmptText,
      autoFocus: autoFocus
    })]
  });
}
ChatMessageBase.displayName = 'ChatMessage';
const ChatMessage = exports.ChatMessage = /*#__PURE__*/(0, _react.memo)(ChatMessageBase);