"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const IconButton = require("./base/IconButton.vue.js");
const SwitchThemeIcon = require("./icons/SwitchThemeIcon.vue.js");
const room = require("../../constants/room.js");
const basic = require("../../stores/basic.js");
const index = require("../../locales/index.js");
require("../../services/main.js");
const roomService = require("../../services/roomService.js");
require("@tencentcloud/tuiroom-engine-js");
require("mitt");
require("../../services/manager/roomActionManager.js");
require("@tencentcloud/tui-core");
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
  __name: "SwitchTheme",
  props: {
    visible: { type: Boolean, default: true }
  },
  setup(__props) {
    const basicStore = basic.useBasicStore();
    const { t } = index.useI18n();
    const switchThemeConfig = roomService.roomService.getComponentConfig("SwitchTheme");
    function handleSwitchTheme() {
      roomService.roomService.setTheme(basicStore.defaultTheme === "white" ? "black" : "white");
    }
    return (_ctx, _cache) => {
      return _ctx.visible && Vue.unref(switchThemeConfig).visible ? (Vue.openBlock(), Vue.createBlock(IconButton.default, {
        key: 0,
        title: Vue.unref(t)("Switch Theme"),
        layout: Vue.unref(room.IconButtonLayout).HORIZONTAL,
        icon: SwitchThemeIcon.default,
        onClickIcon: handleSwitchTheme
      }, null, 8, ["title", "layout"])) : Vue.createCommentVNode("", true);
    };
  }
});
exports.default = _sfc_main;
