"use strict";
const common_vendor = require("../../../common/vendor.js");
const TUIKit_plugins_pluginComponents_messageCustomer_index = require("./message-customer/index.js");
const TUIKit_utils_typeCheck = require("../../utils/type-check.js");
function isCallMessage(message) {
  var _a;
  const payloadData = TUIKit_utils_typeCheck.JSONToObject((_a = message == null ? void 0 : message.payload) == null ? void 0 : _a.data);
  if ((payloadData == null ? void 0 : payloadData.businessID) === 1 && (payloadData == null ? void 0 : payloadData.data)) {
    const payloadDataData = TUIKit_utils_typeCheck.JSONToObject(payloadData.data);
    if (payloadDataData.businessID === "av_call") {
      return true;
    }
  }
  return false;
}
function isRoomSignalingMessage(message) {
  var _a;
  const payloadData = TUIKit_utils_typeCheck.JSONToObject((_a = message == null ? void 0 : message.payload) == null ? void 0 : _a.data);
  return (payloadData == null ? void 0 : payloadData.businessID) === "ROOM_INVITE_ACTION" || (payloadData == null ? void 0 : payloadData.businessID) === "tuikit_engine_room";
}
function isRoomCardMessage(message) {
  var _a;
  const payloadData = TUIKit_utils_typeCheck.JSONToObject((_a = message == null ? void 0 : message.payload) == null ? void 0 : _a.data);
  return (payloadData == null ? void 0 : payloadData.businessID) === "group_room_message";
}
function isPluginMessage(message) {
  return message.type === common_vendor.qt.TYPES.MSG_CUSTOM && (isCallMessage(message) || TUIKit_plugins_pluginComponents_messageCustomer_index.isCustomerServicePluginMessage(message) || isRoomCardMessage(message) || isRoomSignalingMessage(message));
}
exports.isCallMessage = isCallMessage;
exports.isPluginMessage = isPluginMessage;
exports.isRoomCardMessage = isRoomCardMessage;
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/TUIKit/plugins/plugin-components/index.js.map
