"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const vue = require("vue");
const uikitBaseComponentVue3 = require("@tencentcloud/uikit-base-component-vue3");
const room = require("tuikit-atomicx-vue3/room");
const useCopy = require("../../hooks/useCopy.js");
const utils = require("../../utils/utils.js");
const _hoisted_1 = { class: "room-info" };
const _hoisted_2 = { class: "room-info-item" };
const _hoisted_3 = { class: "room-info-title" };
const _hoisted_4 = { class: "room-info-item" };
const _hoisted_5 = { class: "room-info-label" };
const _hoisted_6 = { class: "room-info-value" };
const _hoisted_7 = { class: "room-info-item" };
const _hoisted_8 = { class: "room-info-label" };
const _hoisted_9 = { class: "room-info-value" };
const _hoisted_10 = {
  key: 0,
  class: "room-info-item"
};
const _hoisted_11 = { class: "room-info-label" };
const _hoisted_12 = { class: "room-info-value" };
const _hoisted_13 = { class: "room-info-item" };
const _hoisted_14 = { class: "room-info-label" };
const _hoisted_15 = { class: "room-info-value" };
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  __name: "CurrentRoomInfo",
  setup(__props) {
    const { t } = uikitBaseComponentVue3.useUIKit();
    const { currentRoom } = room.useRoomState();
    const { copy } = useCopy.useCopy();
    const roomLink = vue.computed(() => {
      var _a;
      if (!((_a = currentRoom.value) == null ? void 0 : _a.roomId)) {
        return "";
      }
      return utils.generateRoomLink(currentRoom.value.roomId, currentRoom.value.password, currentRoom.value.roomType);
    });
    return (_ctx, _cache) => {
      var _a, _b, _c, _d, _e, _f, _g;
      return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
        vue.createElementVNode("div", _hoisted_2, [
          vue.createElementVNode("div", _hoisted_3, vue.toDisplayString(((_a = vue.unref(currentRoom)) == null ? void 0 : _a.roomName) || ((_b = vue.unref(currentRoom)) == null ? void 0 : _b.roomId)), 1)
        ]),
        vue.createElementVNode("div", _hoisted_4, [
          vue.createElementVNode("div", _hoisted_5, vue.toDisplayString(vue.unref(t)("CurrentRoomInfo.Host")), 1),
          vue.createElementVNode("div", _hoisted_6, vue.toDisplayString(((_c = vue.unref(currentRoom)) == null ? void 0 : _c.roomOwner.userName) || ((_d = vue.unref(currentRoom)) == null ? void 0 : _d.roomOwner.userId)), 1)
        ]),
        vue.createElementVNode("div", _hoisted_7, [
          vue.createElementVNode("div", _hoisted_8, vue.toDisplayString(vue.unref(t)("CurrentRoomInfo.RoomId")), 1),
          vue.createElementVNode("div", _hoisted_9, vue.toDisplayString((_e = vue.unref(currentRoom)) == null ? void 0 : _e.roomId), 1),
          vue.createElementVNode("div", {
            class: "room-info-copy",
            onClick: _cache[0] || (_cache[0] = () => {
              var _a2;
              return vue.unref(copy)(((_a2 = vue.unref(currentRoom)) == null ? void 0 : _a2.roomId) || "");
            })
          }, [
            vue.createVNode(vue.unref(uikitBaseComponentVue3.IconCopy), { class: "copy-icon" }),
            vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(t)("CurrentRoomInfo.Copy")), 1)
          ])
        ]),
        ((_f = vue.unref(currentRoom)) == null ? void 0 : _f.password) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
          vue.createElementVNode("div", _hoisted_11, vue.toDisplayString(vue.unref(t)("CurrentRoomInfo.PasswordH5")), 1),
          vue.createElementVNode("div", _hoisted_12, vue.toDisplayString((_g = vue.unref(currentRoom)) == null ? void 0 : _g.password), 1),
          vue.createElementVNode("div", {
            class: "room-info-copy",
            onClick: _cache[1] || (_cache[1] = () => {
              var _a2;
              return vue.unref(copy)(((_a2 = vue.unref(currentRoom)) == null ? void 0 : _a2.password) || "");
            })
          }, [
            vue.createVNode(vue.unref(uikitBaseComponentVue3.IconCopy), { class: "copy-icon" }),
            vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(t)("CurrentRoomInfo.Copy")), 1)
          ])
        ])) : vue.createCommentVNode("", true),
        vue.createElementVNode("div", _hoisted_13, [
          vue.createElementVNode("div", _hoisted_14, vue.toDisplayString(vue.unref(t)("CurrentRoomInfo.RoomLink")), 1),
          vue.createElementVNode("div", _hoisted_15, vue.toDisplayString(roomLink.value), 1),
          vue.createElementVNode("div", {
            class: "room-info-copy",
            onClick: _cache[2] || (_cache[2] = () => vue.unref(copy)(roomLink.value))
          }, [
            vue.createVNode(vue.unref(uikitBaseComponentVue3.IconCopy), { class: "copy-icon" }),
            vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(t)("CurrentRoomInfo.Copy")), 1)
          ])
        ])
      ]);
    };
  }
});
exports.default = _sfc_main;
