import "./services/main.mjs";
import { roomService } from "./services/roomService.mjs";
import logger from "./utils/common/logger/index.mjs";
import "./locales/index.mjs";
import "@tencentcloud/tuiroom-engine-js";
import "mitt";
import "./services/manager/roomActionManager.mjs";
import "@tencentcloud/tui-core";
import { toTargetTheme } from "./utils/common.mjs";
var RoomEvent = /* @__PURE__ */ ((RoomEvent2) => {
  RoomEvent2["ROOM_START"] = "RoomStart";
  RoomEvent2["ROOM_JOIN"] = "RoomJoin";
  RoomEvent2["ROOM_LEAVE"] = "RoomLeave";
  RoomEvent2["ROOM_DISMISS"] = "RoomDestroy";
  RoomEvent2["ROOM_ERROR"] = "RoomError";
  RoomEvent2["KICKED_OUT"] = "KickedOut";
  RoomEvent2["KICKED_OFFLINE"] = "KickedOffline";
  RoomEvent2["USER_SIG_EXPIRED"] = "UserSigExpired";
  RoomEvent2["USER_LOGOUT"] = "UserLogout";
  RoomEvent2["LANGUAGE_CHANGED"] = "LanguageChanged";
  RoomEvent2["THEME_CHANGED"] = "ThemeChanged";
  return RoomEvent2;
})(RoomEvent || {});
var FeatureButton = /* @__PURE__ */ ((FeatureButton2) => {
  FeatureButton2["SwitchTheme"] = "SwitchTheme";
  FeatureButton2["SwitchLayout"] = "LayoutControl";
  FeatureButton2["SwitchLanguage"] = "Language";
  FeatureButton2["FullScreen"] = "FullScreen";
  FeatureButton2["Invitation"] = "InviteControl";
  return FeatureButton2;
})(FeatureButton || {});
class Conference {
  login(params) {
    return roomService.initRoomKit(params);
  }
  async logout() {
    return roomService.logOut();
  }
  getRoomEngine() {
    const roomEngine = roomService.roomEngine.instance;
    if (!roomEngine) {
      logger.warn("getRoomEngine failed, roomEngine is not exist");
    }
    return roomService.roomEngine.instance;
  }
  on(eventType, callback) {
    roomService.on(eventType, callback);
  }
  off(eventType, callback) {
    roomService.off(eventType, callback);
  }
  async start(roomId, params) {
    return await roomService.start(roomId, params);
  }
  async join(roomId, params) {
    return await roomService.join(roomId, params);
  }
  async leave() {
    return await roomService.leaveRoom();
  }
  async dismiss() {
    return await roomService.dismissRoom();
  }
  setSelfInfo(options) {
    return roomService.setSelfInfo(options);
  }
  setLanguage(language) {
    return roomService.setLanguage(language);
  }
  setTheme(theme) {
    return roomService.setTheme(toTargetTheme(theme));
  }
  disableTextMessaging() {
    roomService.setComponentConfig({ ChatControl: { visible: false } });
  }
  disableScreenSharing() {
    roomService.setComponentConfig({ ScreenShare: { visible: false } });
  }
  enableWatermark() {
    roomService.waterMark.toggleWatermark(true);
  }
  enableVirtualBackground() {
    roomService.setComponentConfig({ VirtualBackground: { visible: true } });
  }
  enableBasicBeauty() {
    roomService.setComponentConfig({ BasicBeauty: { visible: true } });
  }
  hideFeatureButton(name) {
    roomService.setComponentConfig({ [name]: { visible: false } });
  }
  replaceFriendList(userList) {
    return roomService.scheduleConferenceManager.replaceFriendList(userList);
  }
}
const conference = new Conference();
export {
  FeatureButton,
  RoomEvent,
  conference
};
