import { alert } from '../../../../base/browser/ui/aria/aria.js';
import { TabFocus } from '../../../browser/config/tabFocus.js';
import { localize2WithPath, localizeWithPath } from '../../../../nls.js';
import { Action2, registerAction2 } from '../../../../platform/actions/common/actions.js';
class ToggleTabFocusModeAction extends Action2 {
    static { this.ID = 'editor.action.toggleTabFocusMode'; }
    constructor() {
        super({
            id: ToggleTabFocusModeAction.ID,
            title: ( localize2WithPath(
                'vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode',
                { key: 'toggle.tabMovesFocus', comment: ['Turn on/off use of tab key for moving focus around VS Code'] },
                'Toggle Tab Key Moves Focus'
            )),
            precondition: undefined,
            keybinding: {
                primary: 2048  | 43 ,
                mac: { primary: 256  | 1024  | 43  },
                weight: 100
            },
            f1: true
        });
    }
    run() {
        const oldValue = TabFocus.getTabFocusMode();
        const newValue = !oldValue;
        TabFocus.setTabFocusMode(newValue);
        if (newValue) {
            alert(( localizeWithPath(
                'vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode',
                'toggle.tabMovesFocus.on',
                "Pressing Tab will now move focus to the next focusable element"
            )));
        }
        else {
            alert(( localizeWithPath(
                'vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode',
                'toggle.tabMovesFocus.off',
                "Pressing Tab will now insert the tab character"
            )));
        }
    }
}
registerAction2(ToggleTabFocusModeAction);
export { ToggleTabFocusModeAction };
