import { defineComponent, openBlock, createElementBlock, createElementVNode, unref, normalizeClass, toDisplayString, createCommentVNode, createVNode, createTextVNode, Fragment, renderList, createBlock, withDirectives, vShow, isRef, withCtx } from "vue";
import index from "./MemberItem/index.mjs";
import Dialog from "../common/base/Dialog/index.mjs";
import useIndex from "./useIndexHooks.mjs";
import { storeToRefs } from "pinia";
import { useRoomStore } from "../../stores/room.mjs";
import SvgIcon from "../common/base/SvgIcon.vue.mjs";
import ApplyTipsIcon from "../common/icons/ApplyTipsIcon.vue.mjs";
const _hoisted_1 = { class: "manage-member-container" };
const _hoisted_2 = { class: "manage-member-header" };
const _hoisted_3 = {
  key: 1,
  class: "apply-on-stage-info"
};
const _hoisted_4 = { class: "apply-info" };
const _hoisted_5 = { class: "member-list-container" };
const _hoisted_6 = { class: "member-list-header" };
const _hoisted_7 = { class: "member-count" };
const _hoisted_8 = { class: "member-list-container" };
const _hoisted_9 = {
  key: 0,
  class: "manage-member-bottom"
};
const _hoisted_10 = { class: "more-control-container" };
const _hoisted_11 = { class: "more-control-container-main" };
const _hoisted_12 = ["onTouchstart"];
const _hoisted_13 = { class: "operate-text" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "indexH5",
  setup(__props) {
    const roomStore = useRoomStore();
    const {
      userNumber,
      applyToAnchorList,
      isMicrophoneDisableForAllUser,
      isCameraDisableForAllUser,
      isGeneralUser
    } = storeToRefs(roomStore);
    const {
      audioManageInfo,
      videoManageInfo,
      showManageAllUserDialog,
      dialogTitle,
      dialogContent,
      ManageControlType,
      toggleManageAllMember,
      doToggleManageAllMember,
      t,
      alreadyStaged,
      notStaged,
      filteredUserList,
      isOnStateTabActive,
      handleToggleStaged,
      applyToAnchorUserContent,
      showApplyUserList,
      showMoreControl,
      moreControlList,
      toggleClickMoreBtn
    } = useIndex();
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createElementVNode("div", _hoisted_2, [
          unref(roomStore).isSpeakAfterTakingSeatMode ? (openBlock(), createElementBlock("div", {
            key: 0,
            class: "apply-count",
            onClick: _cache[0] || (_cache[0] = //@ts-ignore
            (...args) => unref(handleToggleStaged) && unref(handleToggleStaged)(...args))
          }, [
            createElementVNode("span", {
              class: normalizeClass([
                "apply-staged",
                { "apply-count-active": unref(isOnStateTabActive) }
              ])
            }, toDisplayString(unref(alreadyStaged)), 3),
            createElementVNode("span", {
              class: normalizeClass([
                "apply-not-stage",
                { "apply-count-active": !unref(isOnStateTabActive) }
              ])
            }, toDisplayString(unref(notStaged)), 3)
          ])) : createCommentVNode("", true),
          unref(applyToAnchorList).length > 0 && !unref(isGeneralUser) ? (openBlock(), createElementBlock("div", _hoisted_3, [
            createVNode(SvgIcon, {
              icon: ApplyTipsIcon,
              class: "apply-icon"
            }),
            createElementVNode("div", _hoisted_4, toDisplayString(unref(applyToAnchorUserContent)), 1),
            createElementVNode("div", {
              class: "apply-check",
              onClick: _cache[1] || (_cache[1] = //@ts-ignore
              (...args) => unref(showApplyUserList) && unref(showApplyUserList)(...args))
            }, toDisplayString(unref(t)("Check")), 1)
          ])) : createCommentVNode("", true)
        ]),
        createElementVNode("div", _hoisted_5, [
          createElementVNode("div", _hoisted_6, [
            createTextVNode(toDisplayString(unref(t)("Member List")) + " ", 1),
            createElementVNode("span", _hoisted_7, "(" + toDisplayString(unref(userNumber)) + toDisplayString(unref(t)("members")) + ")", 1)
          ]),
          createElementVNode("div", _hoisted_8, [
            (openBlock(true), createElementBlock(Fragment, null, renderList(unref(filteredUserList), (userInfo) => {
              return openBlock(), createBlock(unref(index), {
                key: userInfo.userId,
                "user-info": userInfo
              }, null, 8, ["user-info"]);
            }), 128))
          ])
        ]),
        !unref(isGeneralUser) ? (openBlock(), createElementBlock("div", _hoisted_9, [
          createElementVNode("div", {
            class: normalizeClass(["manage-member-button", unref(isMicrophoneDisableForAllUser) ? "lift-all" : ""]),
            onTouchstart: _cache[2] || (_cache[2] = ($event) => unref(toggleManageAllMember)(unref(ManageControlType).AUDIO))
          }, toDisplayString(unref(audioManageInfo)), 35),
          createElementVNode("div", {
            class: normalizeClass(["manage-member-button", unref(isCameraDisableForAllUser) ? "lift-all" : ""]),
            onTouchstart: _cache[3] || (_cache[3] = ($event) => unref(toggleManageAllMember)(unref(ManageControlType).VIDEO))
          }, toDisplayString(unref(videoManageInfo)), 35),
          createElementVNode("div", {
            class: "manage-member-button",
            onTouchstart: _cache[4] || (_cache[4] = //@ts-ignore
            (...args) => unref(toggleClickMoreBtn) && unref(toggleClickMoreBtn)(...args))
          }, [
            createTextVNode(toDisplayString(unref(t)("More")) + " ", 1),
            withDirectives(createElementVNode("div", _hoisted_10, [
              createElementVNode("div", _hoisted_11, [
                (openBlock(true), createElementBlock(Fragment, null, renderList(unref(moreControlList), (item) => {
                  return openBlock(), createElementBlock("div", {
                    key: item.type,
                    class: "user-operate-item",
                    onTouchstart: ($event) => item.func(item.type)
                  }, [
                    createVNode(SvgIcon, {
                      icon: item.icon
                    }, null, 8, ["icon"]),
                    createElementVNode("span", _hoisted_13, toDisplayString(item.title), 1)
                  ], 40, _hoisted_12);
                }), 128))
              ])
            ], 512), [
              [vShow, unref(showMoreControl)]
            ])
          ], 32)
        ])) : createCommentVNode("", true),
        createVNode(unref(Dialog), {
          modelValue: unref(showManageAllUserDialog),
          "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => isRef(showManageAllUserDialog) ? showManageAllUserDialog.value = $event : null),
          title: unref(dialogTitle),
          width: "480px",
          modal: true,
          "append-to-room-container": true,
          "confirm-button": unref(t)("Confirm"),
          "cancel-button": unref(t)("Cancel"),
          onConfirm: unref(doToggleManageAllMember),
          onCancel: _cache[6] || (_cache[6] = ($event) => showManageAllUserDialog.value = false)
        }, {
          default: withCtx(() => [
            createElementVNode("span", null, toDisplayString(unref(dialogContent)), 1)
          ]),
          _: 1
        }, 8, ["modelValue", "title", "confirm-button", "cancel-button", "onConfirm"])
      ]);
    };
  }
});
export {
  _sfc_main as default
};
