import { defineComponent, ref, watch, createBlock, openBlock } from "vue";
import { useRoomState, RoomType } from "tuikit-atomicx-vue3/room";
import StandardLeave from "./StandardLeave.vue2.mjs";
import WebinarLeave from "./WebinarLeave.vue2.mjs";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  emits: ["leave", "end"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    const { currentRoom } = useRoomState();
    const frozenIsWebinar = ref(null);
    watch(
      () => {
        var _a;
        return (_a = currentRoom.value) == null ? void 0 : _a.roomType;
      },
      (roomType) => {
        if (frozenIsWebinar.value === null && roomType !== void 0) {
          frozenIsWebinar.value = roomType === RoomType.Webinar;
        }
      },
      { immediate: true }
    );
    return (_ctx, _cache) => {
      return !frozenIsWebinar.value ? (openBlock(), createBlock(StandardLeave, {
        key: 0,
        emitFunction: emit
      })) : (openBlock(), createBlock(WebinarLeave, {
        key: 1,
        "emit-function": emit
      }));
    };
  }
});
export {
  _sfc_main as default
};
