Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useCreateMessageContext = void 0;
var _react = require("react");
var _utils = require("../../../utils/utils");
var useCreateMessageContext = exports.useCreateMessageContext = function useCreateMessageContext(_ref) {
  var _message$quoted_messa;
  var actionsEnabled = _ref.actionsEnabled,
    alignment = _ref.alignment,
    channel = _ref.channel,
    dismissOverlay = _ref.dismissOverlay,
    files = _ref.files,
    goToMessage = _ref.goToMessage,
    groupStyles = _ref.groupStyles,
    handleAction = _ref.handleAction,
    handleReaction = _ref.handleReaction,
    handleToggleReaction = _ref.handleToggleReaction,
    hasReactions = _ref.hasReactions,
    images = _ref.images,
    isEditedMessageOpen = _ref.isEditedMessageOpen,
    isMessageAIGenerated = _ref.isMessageAIGenerated,
    isMyMessage = _ref.isMyMessage,
    lastGroupMessage = _ref.lastGroupMessage,
    lastReceivedId = _ref.lastReceivedId,
    members = _ref.members,
    message = _ref.message,
    messageContentOrder = _ref.messageContentOrder,
    myMessageTheme = _ref.myMessageTheme,
    onLongPress = _ref.onLongPress,
    onlyEmojis = _ref.onlyEmojis,
    onOpenThread = _ref.onOpenThread,
    onPress = _ref.onPress,
    onPressIn = _ref.onPressIn,
    otherAttachments = _ref.otherAttachments,
    preventPress = _ref.preventPress,
    reactions = _ref.reactions,
    readBy = _ref.readBy,
    setIsEditedMessageOpen = _ref.setIsEditedMessageOpen,
    showAvatar = _ref.showAvatar,
    showMessageOverlay = _ref.showMessageOverlay,
    showMessageStatus = _ref.showMessageStatus,
    threadList = _ref.threadList,
    videos = _ref.videos;
  var groupStylesLength = groupStyles.length;
  var reactionsValue = reactions.map(function (_ref2) {
    var count = _ref2.count,
      own = _ref2.own,
      type = _ref2.type;
    return "".concat(own).concat(type).concat(count);
  }).join();
  var stringifiedMessage = (0, _utils.stringifyMessage)(message);
  var membersValue = JSON.stringify(members);
  var myMessageThemeString = (0, _react.useMemo)(function () {
    return JSON.stringify(myMessageTheme);
  }, [myMessageTheme]);
  var quotedMessageDeletedValue = (_message$quoted_messa = message.quoted_message) == null ? void 0 : _message$quoted_messa.deleted_at;
  var messageContext = (0, _react.useMemo)(function () {
    return {
      actionsEnabled: actionsEnabled,
      alignment: alignment,
      channel: channel,
      dismissOverlay: dismissOverlay,
      files: files,
      goToMessage: goToMessage,
      groupStyles: groupStyles,
      handleAction: handleAction,
      handleReaction: handleReaction,
      handleToggleReaction: handleToggleReaction,
      hasReactions: hasReactions,
      images: images,
      isEditedMessageOpen: isEditedMessageOpen,
      isMessageAIGenerated: isMessageAIGenerated,
      isMyMessage: isMyMessage,
      lastGroupMessage: lastGroupMessage,
      lastReceivedId: lastReceivedId,
      members: members,
      message: message,
      messageContentOrder: messageContentOrder,
      myMessageTheme: myMessageTheme,
      onLongPress: onLongPress,
      onlyEmojis: onlyEmojis,
      onOpenThread: onOpenThread,
      onPress: onPress,
      onPressIn: onPressIn,
      otherAttachments: otherAttachments,
      preventPress: preventPress,
      reactions: reactions,
      readBy: readBy,
      setIsEditedMessageOpen: setIsEditedMessageOpen,
      showAvatar: showAvatar,
      showMessageOverlay: showMessageOverlay,
      showMessageStatus: showMessageStatus,
      threadList: threadList,
      videos: videos
    };
  }, [actionsEnabled, quotedMessageDeletedValue, alignment, goToMessage, groupStylesLength, hasReactions, isEditedMessageOpen, lastGroupMessage, lastReceivedId, membersValue, stringifiedMessage, myMessageThemeString, reactionsValue, readBy, showAvatar, showMessageStatus, threadList]);
  return messageContext;
};
//# sourceMappingURL=useCreateMessageContext.js.map