import { defineComponent, openBlock, createElementBlock, withDirectives, createVNode, unref } from "vue";
import SvgIcon from "../../common/base/SvgIcon.vue.mjs";
import { useBasicStore } from "../../../stores/basic.mjs";
import MirrorIcon from "../../common/icons/MirrorIcon.vue.mjs";
import useGetRoomEngine from "../../../hooks/useRoomEngine.mjs";
import { TRTCVideoMirrorType, TRTCVideoRotation, TRTCVideoFillMode } from "@tencentcloud/tuiroom-engine-js";
import vTap from "../../../directives/vTap.mjs";
const _hoisted_1 = { class: "mirror-icon" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "SwitchMirror",
  setup(__props) {
    const roomEngine = useGetRoomEngine();
    const basicStore = useBasicStore();
    function toogleMirrorStatus() {
      var _a;
      const trtcCloud = (_a = roomEngine.instance) == null ? void 0 : _a.getTRTCCloud();
      trtcCloud == null ? void 0 : trtcCloud.setLocalRenderParams({
        mirrorType: basicStore.isLocalStreamMirror ? TRTCVideoMirrorType.TRTCVideoMirrorType_Enable : TRTCVideoMirrorType.TRTCVideoMirrorType_Disable,
        rotation: TRTCVideoRotation.TRTCVideoRotation0,
        fillMode: TRTCVideoFillMode.TRTCVideoFillMode_Fill
      });
      basicStore.setIsLocalStreamMirror(basicStore.isLocalStreamMirror);
      basicStore.isLocalStreamMirror = !basicStore.isLocalStreamMirror;
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        withDirectives(createVNode(SvgIcon, {
          icon: MirrorIcon,
          "custom-style": { backgroundSize: "50%" }
        }, null, 512), [
          [unref(vTap), toogleMirrorStatus]
        ])
      ]);
    };
  }
});
export {
  _sfc_main as default
};
