"use strict";
var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const index = require("../../locales/index.js");
const types = require("../types.js");
const THEME = {
  LIGHT: "white",
  DARK: "black"
};
class ConfigManager {
  constructor(service) {
    __publicField(this, "service");
    this.service = service;
  }
  setTheme(theme) {
    const isDarkTheme = theme === THEME.DARK;
    document.body.classList.toggle(`tui-theme-${THEME.DARK}`, isDarkTheme);
    document.body.classList.toggle(`tui-theme-${THEME.LIGHT}`, !isDarkTheme);
    this.service.basicStore.setDefaultTheme(
      isDarkTheme ? THEME.DARK : THEME.LIGHT
    );
    this.service.emit(
      types.EventType.THEME_CHANGED,
      isDarkTheme ? THEME.DARK : THEME.LIGHT
    );
  }
  setLanguage(language) {
    index.default.global.locale.value = language;
    this.service.basicStore.setLang(language);
    this.service.emit(types.EventType.LANGUAGE_CHANGED, language);
  }
}
exports.ConfigManager = ConfigManager;
