"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const aria = require("../../../../base/browser/ui/aria/aria.js");
const tabFocus = require("../../../browser/config/tabFocus.js");
const editorExtensions = require("../../../browser/editorExtensions.js");
const nls = require("../../../../nls.js");
class ToggleTabFocusModeAction extends editorExtensions.EditorAction {
  constructor() {
    super({
      id: ToggleTabFocusModeAction.ID,
      label: nls.localize({ key: "toggle.tabMovesFocus", comment: ["Turn on/off use of tab key for moving focus around VS Code"] }, "Toggle Tab Key Moves Focus"),
      alias: "Toggle Tab Key Moves Focus",
      precondition: void 0,
      kbOpts: {
        kbExpr: null,
        primary: 2048 | 43,
        mac: {
          primary: 256 | 1024 | 43
          /* KeyM */
        },
        weight: 100
        /* EditorContrib */
      }
    });
  }
  run(accessor, editor) {
    const oldValue = tabFocus.TabFocus.getTabFocusMode();
    const newValue = !oldValue;
    tabFocus.TabFocus.setTabFocusMode(newValue);
    if (newValue) {
      aria.alert(nls.localize("toggle.tabMovesFocus.on", "Pressing Tab will now move focus to the next focusable element"));
    } else {
      aria.alert(nls.localize("toggle.tabMovesFocus.off", "Pressing Tab will now insert the tab character"));
    }
  }
}
ToggleTabFocusModeAction.ID = "editor.action.toggleTabFocusMode";
editorExtensions.registerEditorAction(ToggleTabFocusModeAction);
exports.ToggleTabFocusModeAction = ToggleTabFocusModeAction;
