import { registerEditorAction, EditorAction } from "../../../browser/editorExtensions.mjs";
import { IStandaloneThemeService } from "../../common/standaloneTheme.mjs";
import { ToggleHighContrastNLS } from "../../../common/standaloneStrings.mjs";
class ToggleHighContrast extends EditorAction {
  constructor() {
    super({
      id: "editor.action.toggleHighContrast",
      label: ToggleHighContrastNLS.toggleHighContrast,
      alias: "Toggle High Contrast Theme",
      precondition: void 0
    });
    this._originalThemeName = null;
  }
  run(accessor, editor) {
    const standaloneThemeService = accessor.get(IStandaloneThemeService);
    if (this._originalThemeName) {
      standaloneThemeService.setTheme(this._originalThemeName);
      this._originalThemeName = null;
    } else {
      this._originalThemeName = standaloneThemeService.getColorTheme().themeName;
      standaloneThemeService.setTheme("hc-black");
    }
  }
}
registerEditorAction(ToggleHighContrast);
