"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const SvgIcon = require("../../common/base/SvgIcon.vue.js");
const ArrowStrokeSelectDownIcon = require("../../common/icons/ArrowStrokeSelectDownIcon.vue.js");
const useUserInfoHooks = require("./useUserInfoHooks.js");
const Avatar = require("../../common/Avatar.vue.js");
require("../../../services/main.js");
const roomService = require("../../../services/roomService.js");
require("../../../locales/index.js");
require("@tencentcloud/tuiroom-engine-js");
require("mitt");
require("../../../services/manager/roomActionManager.js");
require("@tencentcloud/tui-core");
const basic = require("../../../stores/basic.js");
const room = require("../../../stores/room.js");
const _hoisted_1 = { class: "name" };
const _hoisted_2 = {
  key: 0,
  class: "user-control-container"
};
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
  __name: "UserInfoPC",
  props: {
    userId: {},
    userName: {},
    avatarUrl: {}
  },
  emits: ["log-out", "update-user-name"],
  setup(__props, { emit: __emit }) {
    const userInfoConfig = roomService.roomService.getComponentConfig("UserInfo");
    basic.useBasicStore();
    room.useRoomStore();
    const {
      t,
      showUserControl,
      userInfoRef,
      handleUserControl,
      closeEditUserNameDialog
    } = useUserInfoHooks.default();
    return (_ctx, _cache) => {
      return Vue.unref(userInfoConfig).visible ? (Vue.openBlock(), Vue.createElementBlock("div", {
        key: 0,
        ref_key: "userInfoRef",
        ref: userInfoRef,
        class: "user-info-container"
      }, [
        Vue.createElementVNode("div", {
          class: "user-info-content",
          onClick: _cache[0] || (_cache[0] = //@ts-ignore
          (...args) => Vue.unref(handleUserControl) && Vue.unref(handleUserControl)(...args))
        }, [
          Vue.createVNode(Avatar.default, {
            class: "avatar",
            "img-src": _ctx.avatarUrl
          }, null, 8, ["img-src"]),
          Vue.createElementVNode("div", _hoisted_1, Vue.toDisplayString(_ctx.userName || _ctx.userId), 1),
          Vue.createVNode(SvgIcon.default, {
            class: Vue.normalizeClass([Vue.unref(showUserControl) ? "up-icon" : "down-icon"]),
            icon: ArrowStrokeSelectDownIcon.default
          }, null, 8, ["class"])
        ]),
        Vue.unref(showUserControl) ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_2, [
          Vue.createElementVNode("div", {
            class: "user-control-item-foot",
            onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("log-out"))
          }, Vue.toDisplayString(Vue.unref(t)("Log out")), 1)
        ])) : Vue.createCommentVNode("", true)
      ], 512)) : Vue.createCommentVNode("", true);
    };
  }
});
exports.default = _sfc_main;
