import { defineComponent, ref, createElementBlock, openBlock, createVNode, unref, withCtx, createElementVNode } from "vue";
import { useUIKit, IconBasicBeauty, TUIDialog, TUIToast } from "@tencentcloud/uikit-base-component-vue3";
import { useDeviceState, FreeBeautyPanel } from "tuikit-atomicx-vue3/room";
import IconButton from "../base/IconButton.vue2.mjs";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  setup(__props) {
    const { t } = useUIKit();
    const { cameraList } = useDeviceState();
    const basicBeautyVisible = ref(false);
    const handleClick = () => {
      if (cameraList.value.length === 0) {
        TUIToast.error({ message: t("BasicBeauty.NoCamera") });
        return;
      }
      basicBeautyVisible.value = true;
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", null, [
        createVNode(IconButton, {
          title: unref(t)("BasicBeauty.Title"),
          disabled: unref(cameraList).length === 0,
          onClick: handleClick
        }, {
          default: withCtx(() => [
            createVNode(unref(IconBasicBeauty), { size: 24 })
          ]),
          _: 1
        }, 8, ["title", "disabled"]),
        createVNode(unref(TUIDialog), {
          visible: basicBeautyVisible.value,
          "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => basicBeautyVisible.value = $event),
          title: unref(t)("BasicBeauty.Title"),
          "custom-classes": ["basic-beauty-dialog"],
          appendTo: "#roomPage"
        }, {
          footer: withCtx(() => [..._cache[2] || (_cache[2] = [
            createElementVNode("div", null, null, -1)
          ])]),
          default: withCtx(() => [
            createVNode(unref(FreeBeautyPanel), {
              onClose: _cache[0] || (_cache[0] = ($event) => basicBeautyVisible.value = false)
            })
          ]),
          _: 1
        }, 8, ["visible", "title"])
      ]);
    };
  }
});
export {
  _sfc_main as default
};
