"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const pinia = require("pinia");
const index = require("./MemberItem/index.js");
const SvgIcon = require("../common/base/SvgIcon.vue.js");
const SearchIcon = require("../common/icons/SearchIcon.vue.js");
const ApplyTipsIcon = require("../common/icons/ApplyTipsIcon.vue.js");
const index$1 = require("../common/base/Dialog/index.js");
const room = require("../../stores/room.js");
const useIndexHooks = require("./useIndexHooks.js");
const Button = require("../common/base/Button.vue.js");
const ArrowUpIcon = require("../common/icons/ArrowUpIcon.vue.js");
const vClickOutside = require("../../directives/vClickOutside.js");
const room$1 = require("../../constants/room.js");
const _hoisted_1 = { class: "manage-member-container" };
const _hoisted_2 = { class: "manage-member-header" };
const _hoisted_3 = { class: "search-container" };
const _hoisted_4 = ["placeholder"];
const _hoisted_5 = { class: "apply-count" };
const _hoisted_6 = { class: "user-status" };
const _hoisted_7 = ["onClick"];
const _hoisted_8 = { class: "apply-staged" };
const _hoisted_9 = {
  key: 0,
  class: "apply-on-stage-info"
};
const _hoisted_10 = { class: "apply-info" };
const _hoisted_11 = {
  id: "memberListContainer",
  class: "member-list-container"
};
const _hoisted_12 = {
  key: 1,
  class: "global-setting"
};
const _hoisted_13 = { class: "more-container" };
const _hoisted_14 = {
  class: /* @__PURE__ */ Vue.normalizeClass(["tui-theme-white", "drop-down"])
};
const _hoisted_15 = ["onClick"];
const _hoisted_16 = { class: "operate-text" };
const _hoisted_17 = {
  key: 2,
  class: "global-setting"
};
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
  __name: "indexPC",
  setup(__props) {
    const roomStore = room.useRoomStore();
    const { applyToAnchorList, isGeneralUser } = pinia.storeToRefs(roomStore);
    const {
      t,
      searchText,
      showApplyUserList,
      showManageAllUserDialog,
      dialogTitle,
      dialogContent,
      toggleManageAllMember,
      doToggleManageAllMember,
      ManageControlType,
      handleToggleStaged,
      applyToAnchorUserContent,
      audioManageInfo,
      videoManageInfo,
      toggleClickMoreBtn,
      showMoreControl,
      moreControlList,
      userStatusList,
      currentActiveTabName,
      filteredUserStatusList,
      handleCallAllInvitee
    } = useIndexHooks.default();
    const handleShowMoreControl = () => {
      if (showMoreControl.value) {
        showMoreControl.value = false;
      }
    };
    return (_ctx, _cache) => {
      return Vue.openBlock(), Vue.createElementBlock("div", _hoisted_1, [
        Vue.createElementVNode("div", _hoisted_2, [
          Vue.createElementVNode("div", _hoisted_3, [
            Vue.createVNode(SvgIcon.default, { icon: SearchIcon.default }),
            Vue.withDirectives(Vue.createElementVNode("input", {
              "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => Vue.isRef(searchText) ? searchText.value = $event : null),
              class: "search-input",
              placeholder: Vue.unref(t)("Search Member")
            }, null, 8, _hoisted_4), [
              [Vue.vModelText, Vue.unref(searchText)]
            ])
          ])
        ]),
        Vue.createElementVNode("div", _hoisted_5, [
          Vue.createElementVNode("div", _hoisted_6, [
            (Vue.openBlock(true), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(Vue.unref(userStatusList), (item, index2) => {
              return Vue.openBlock(), Vue.createElementBlock("div", {
                class: Vue.normalizeClass([
                  "user-status-container",
                  {
                    "apply-count-active": item.status === Vue.unref(currentActiveTabName)
                  }
                ]),
                key: index2,
                onClick: ($event) => Vue.unref(handleToggleStaged)(item)
              }, [
                Vue.createElementVNode("span", _hoisted_8, Vue.toDisplayString(item.title), 1)
              ], 10, _hoisted_7);
            }), 128))
          ])
        ]),
        Vue.unref(applyToAnchorList).length > 0 && !Vue.unref(isGeneralUser) ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_9, [
          Vue.createVNode(SvgIcon.default, {
            icon: ApplyTipsIcon.default,
            class: "apply-icon"
          }),
          Vue.createElementVNode("div", _hoisted_10, Vue.toDisplayString(Vue.unref(applyToAnchorUserContent)), 1),
          Vue.createElementVNode("div", {
            class: "apply-check",
            onClick: _cache[1] || (_cache[1] = //@ts-ignore
            (...args) => Vue.unref(showApplyUserList) && Vue.unref(showApplyUserList)(...args))
          }, Vue.toDisplayString(Vue.unref(t)("Check")), 1)
        ])) : Vue.createCommentVNode("", true),
        Vue.createElementVNode("div", _hoisted_11, [
          (Vue.openBlock(true), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(Vue.unref(filteredUserStatusList), (userInfo) => {
            return Vue.openBlock(), Vue.createBlock(Vue.unref(index.default), {
              key: userInfo.userId,
              "user-info": userInfo,
              "user-current-status": Vue.unref(currentActiveTabName)
            }, null, 8, ["user-info", "user-current-status"]);
          }), 128))
        ]),
        !Vue.unref(isGeneralUser) && Vue.unref(currentActiveTabName) !== Vue.unref(room$1.USERS_STATUS).NOT_ENTER ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_12, [
          Vue.createVNode(Button.default, {
            class: "button",
            size: "default",
            onClick: _cache[2] || (_cache[2] = ($event) => Vue.unref(toggleManageAllMember)(Vue.unref(ManageControlType).AUDIO))
          }, {
            default: Vue.withCtx(() => [
              Vue.createTextVNode(Vue.toDisplayString(Vue.unref(audioManageInfo)), 1)
            ]),
            _: 1
          }),
          Vue.createVNode(Button.default, {
            class: "button",
            size: "default",
            onClick: _cache[3] || (_cache[3] = ($event) => Vue.unref(toggleManageAllMember)(Vue.unref(ManageControlType).VIDEO))
          }, {
            default: Vue.withCtx(() => [
              Vue.createTextVNode(Vue.toDisplayString(Vue.unref(videoManageInfo)), 1)
            ]),
            _: 1
          }),
          Vue.withDirectives((Vue.openBlock(), Vue.createElementBlock("div", _hoisted_13, [
            Vue.createVNode(Button.default, {
              class: "button",
              size: "default",
              onClick: Vue.unref(toggleClickMoreBtn)
            }, {
              default: Vue.withCtx(() => [
                Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("More")) + " ", 1),
                Vue.createVNode(SvgIcon.default, {
                  size: "12",
                  class: Vue.normalizeClass(["more-arrow", Vue.unref(showMoreControl) ? "up" : "down"]),
                  icon: ArrowUpIcon.default
                }, null, 8, ["class"])
              ]),
              _: 1
            }, 8, ["onClick"]),
            Vue.withDirectives(Vue.createElementVNode("div", _hoisted_14, [
              (Vue.openBlock(true), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(Vue.unref(moreControlList), (item) => {
                return Vue.openBlock(), Vue.createElementBlock("div", {
                  key: item.type,
                  class: "user-operate-item",
                  onClick: ($event) => item.func(item.type)
                }, [
                  Vue.createVNode(SvgIcon.default, {
                    icon: item.icon
                  }, null, 8, ["icon"]),
                  Vue.createElementVNode("span", _hoisted_16, Vue.toDisplayString(item.title), 1)
                ], 8, _hoisted_15);
              }), 128))
            ], 512), [
              [Vue.vShow, Vue.unref(showMoreControl)]
            ])
          ])), [
            [Vue.unref(vClickOutside.default), handleShowMoreControl]
          ])
        ])) : Vue.createCommentVNode("", true),
        Vue.unref(currentActiveTabName) === Vue.unref(room$1.USERS_STATUS).NOT_ENTER ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_17, [
          Vue.unref(filteredUserStatusList).length > 0 ? (Vue.openBlock(), Vue.createBlock(Button.default, {
            key: 0,
            class: "button-bottom",
            size: "default",
            onClick: Vue.unref(handleCallAllInvitee)
          }, {
            default: Vue.withCtx(() => [
              Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("Call all")), 1)
            ]),
            _: 1
          }, 8, ["onClick"])) : Vue.createCommentVNode("", true)
        ])) : Vue.createCommentVNode("", true),
        Vue.createVNode(Vue.unref(index$1.default), {
          modelValue: Vue.unref(showManageAllUserDialog),
          "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => Vue.isRef(showManageAllUserDialog) ? showManageAllUserDialog.value = $event : null),
          title: Vue.unref(dialogTitle),
          width: "480px",
          modal: true,
          "append-to-room-container": true
        }, {
          footer: Vue.withCtx(() => [
            Vue.createVNode(Button.default, {
              size: "default",
              onClick: Vue.unref(doToggleManageAllMember)
            }, {
              default: Vue.withCtx(() => [
                Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("Confirm")), 1)
              ]),
              _: 1
            }, 8, ["onClick"]),
            Vue.createVNode(Button.default, {
              class: "cancel-button",
              size: "default",
              type: "primary",
              onClick: _cache[4] || (_cache[4] = ($event) => showManageAllUserDialog.value = false)
            }, {
              default: Vue.withCtx(() => [
                Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("Cancel")), 1)
              ]),
              _: 1
            })
          ]),
          default: Vue.withCtx(() => [
            Vue.createElementVNode("span", null, Vue.toDisplayString(Vue.unref(dialogContent)), 1)
          ]),
          _: 1
        }, 8, ["modelValue", "title"])
      ]);
    };
  }
});
exports.default = _sfc_main;
