"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const vue = require("vue");
const chat = require("tuikit-atomicx-vue3/chat");
const room = require("tuikit-atomicx-vue3/room");
const _hoisted_1 = { class: "custom-message-container" };
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  __name: "CustomMessage",
  props: {
    message: {}
  },
  setup(__props) {
    const props = __props;
    const { participantList } = room.useRoomParticipantState();
    const userName = vue.computed(() => {
      const participant = participantList.value.find(
        (p) => p.userId === props.message.from
      );
      return (participant == null ? void 0 : participant.nameCard) || (participant == null ? void 0 : participant.userName) || (participant == null ? void 0 : participant.userId) || props.message.nick || props.message.from;
    });
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
        vue.createVNode(vue.unref(chat.Message), vue.mergeProps(_ctx.$attrs, {
          nick: userName.value,
          message: __props.message,
          "is-hidden-message-avatar": true,
          "is-hidden-message-meta": props.message.flow !== "out"
        }), null, 16, ["nick", "message", "is-hidden-message-meta"])
      ]);
    };
  }
});
exports.default = _sfc_main;
