"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 AudioSettingTab = require("../common/AudioSettingTab.vue.js");
const VideoSettingTab = require("../common/VideoSettingTab.vue.js");
const basic = require("../../stores/basic.js");
const pinia = require("pinia");
const render = require("../../constants/render.js");
const index = require("../../locales/index.js");
const CloseIcon = require("../common/icons/CloseIcon.vue.js");
const _hoisted_1 = { class: "setting-container" };
const _hoisted_2 = { class: "setting-header" };
const _hoisted_3 = { class: "setting-title" };
const _hoisted_4 = { class: "setting-body" };
const _hoisted_5 = { class: "setting-tabs" };
const _hoisted_6 = ["onClick"];
const _hoisted_7 = { class: "setting-content" };
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
  __name: "index",
  setup(__props) {
    const { t } = index.useI18n();
    const basicStore = basic.useBasicStore();
    const { showSettingDialog, activeSettingTab } = pinia.storeToRefs(basicStore);
    const settingTabsTitleList = Vue.computed(() => [
      { label: t("Audio settings"), value: "audio" },
      { label: t("Camera settings"), value: "video" }
    ]);
    function handleUpdateActiveTab(tabTitle) {
      basicStore.setActiveSettingTab(tabTitle);
    }
    function handleCloseSettingDialog() {
      basicStore.setShowSettingDialog(false);
    }
    function handleOverlayClick(event) {
      if (event.target !== event.currentTarget) {
        return;
      }
      handleCloseSettingDialog();
    }
    return (_ctx, _cache) => {
      return Vue.unref(showSettingDialog) ? (Vue.openBlock(), Vue.createElementBlock("div", {
        key: 0,
        class: "overlay-container overlay",
        onClick: handleOverlayClick
      }, [
        Vue.createElementVNode("div", _hoisted_1, [
          Vue.createElementVNode("div", _hoisted_2, [
            Vue.createElementVNode("span", _hoisted_3, Vue.toDisplayString(Vue.unref(t)("Settings")), 1),
            Vue.createVNode(SvgIcon.default, {
              class: "close-icon",
              icon: CloseIcon.default,
              onClick: handleCloseSettingDialog
            })
          ]),
          Vue.createElementVNode("div", _hoisted_4, [
            Vue.createElementVNode("div", _hoisted_5, [
              (Vue.openBlock(true), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(settingTabsTitleList.value, (item, index2) => {
                return Vue.openBlock(), Vue.createElementBlock("div", {
                  key: index2,
                  class: Vue.normalizeClass([
                    "tabs-title",
                    `${Vue.unref(activeSettingTab) === item.value ? "active" : ""}`
                  ]),
                  onClick: ($event) => handleUpdateActiveTab(item.value)
                }, Vue.toDisplayString(item.label), 11, _hoisted_6);
              }), 128))
            ]),
            _cache[0] || (_cache[0] = Vue.createElementVNode("div", { class: "divide-line" }, null, -1)),
            Vue.createElementVNode("div", _hoisted_7, [
              Vue.unref(activeSettingTab) === "audio" ? (Vue.openBlock(), Vue.createBlock(AudioSettingTab.default, {
                key: 0,
                class: "setting-tab",
                mode: Vue.unref(render.SettingMode).DETAIL,
                theme: "white"
              }, null, 8, ["mode"])) : Vue.unref(activeSettingTab) === "video" ? (Vue.openBlock(), Vue.createBlock(VideoSettingTab.default, {
                key: 1,
                class: "setting-tab",
                "with-preview": true,
                theme: "white"
              })) : Vue.createCommentVNode("", true)
            ])
          ])
        ])
      ])) : Vue.createCommentVNode("", true);
    };
  }
});
exports.default = _sfc_main;
