"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const useRoomInfoHooks = require("../RoomHeader/RoomInfo/useRoomInfoHooks.js");
const CopyIcon = require("../common/icons/CopyIcon.vue.js");
const SvgIcon = require("../common/base/SvgIcon.vue.js");
const environment = require("../../utils/environment.js");
const index = require("../../locales/index.js");
const utils = require("../../utils/utils.js");
const _hoisted_1 = { class: "invite-member-title" };
const _hoisted_2 = ["title"];
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
  __name: "InvitePanel",
  props: {
    scheduleInviteList: {},
    shareLinkData: {}
  },
  setup(__props) {
    const { t } = index.useI18n();
    const props = __props;
    const { onCopy } = useRoomInfoHooks.default();
    const scheduleInviteList = Vue.computed(() => {
      var _a;
      const roomId = (_a = props == null ? void 0 : props.shareLinkData) == null ? void 0 : _a.roomId;
      if (!roomId) return props.scheduleInviteList;
      return [
        {
          title: `${t("Room ID")}`,
          content: roomId,
          isShowCopyIcon: true,
          isVisible: true
        },
        {
          title: `${t("Room Link")}`,
          content: utils.getUrlWithRoomId(roomId),
          isShowCopyIcon: true,
          isVisible: !environment.isWeChat
        }
      ];
    });
    return (_ctx, _cache) => {
      return Vue.openBlock(), Vue.createElementBlock("div", {
        class: Vue.normalizeClass(["invite-member", Vue.unref(environment.isMobile) ? "h5" : ""])
      }, [
        (Vue.openBlock(true), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(scheduleInviteList.value, (item, index2) => {
          return Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, null, [
            item.isVisible ? (Vue.openBlock(), Vue.createElementBlock("div", {
              class: "invite-member-container",
              key: index2
            }, [
              Vue.createElementVNode("span", _hoisted_1, Vue.toDisplayString(Vue.unref(t)(item.title)), 1),
              Vue.createElementVNode("span", {
                class: "invite-member-content",
                title: item.content
              }, Vue.toDisplayString(item.content), 9, _hoisted_2),
              item.isShowCopyIcon ? (Vue.openBlock(), Vue.createBlock(SvgIcon.default, {
                key: 0,
                class: "copy",
                icon: CopyIcon.default,
                onClick: ($event) => Vue.unref(onCopy)(item.content)
              }, null, 8, ["onClick"])) : Vue.createCommentVNode("", true)
            ])) : Vue.createCommentVNode("", true)
          ], 64);
        }), 256))
      ], 2);
    };
  }
});
exports.default = _sfc_main;
