import { localizeWithPath } from '../../../../nls.js';
import { RawContextKey, ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';
import { TerminalSettingId } from '../../../../platform/terminal/common/terminal.js';
import { TERMINAL_VIEW_ID } from './terminal.js';
const _moduleId = "vs/workbench/contrib/terminal/common/terminalContextKey";
var TerminalContextKeyStrings;
( ((function(TerminalContextKeyStrings) {
    TerminalContextKeyStrings["IsOpen"] = "terminalIsOpen";
    TerminalContextKeyStrings["Count"] = "terminalCount";
    TerminalContextKeyStrings["GroupCount"] = "terminalGroupCount";
    TerminalContextKeyStrings["TabsNarrow"] = "isTerminalTabsNarrow";
    TerminalContextKeyStrings["HasFixedWidth"] = "terminalHasFixedWidth";
    TerminalContextKeyStrings["ProcessSupported"] = "terminalProcessSupported";
    TerminalContextKeyStrings["Focus"] = "terminalFocus";
    TerminalContextKeyStrings["FocusInAny"] = "terminalFocusInAny";
    TerminalContextKeyStrings["AccessibleBufferFocus"] = "terminalAccessibleBufferFocus";
    TerminalContextKeyStrings["AccessibleBufferOnLastLine"] = "terminalAccessibleBufferOnLastLine";
    TerminalContextKeyStrings["EditorFocus"] = "terminalEditorFocus";
    TerminalContextKeyStrings["TabsFocus"] = "terminalTabsFocus";
    TerminalContextKeyStrings["WebExtensionContributedProfile"] = "terminalWebExtensionContributedProfile";
    TerminalContextKeyStrings["TerminalHasBeenCreated"] = "terminalHasBeenCreated";
    TerminalContextKeyStrings["TerminalEditorActive"] = "terminalEditorActive";
    TerminalContextKeyStrings["TabsMouse"] = "terminalTabsMouse";
    TerminalContextKeyStrings["AltBufferActive"] = "terminalAltBufferActive";
    TerminalContextKeyStrings["SuggestWidgetVisible"] = "terminalSuggestWidgetVisible";
    TerminalContextKeyStrings["A11yTreeFocus"] = "terminalA11yTreeFocus";
    TerminalContextKeyStrings["ViewShowing"] = "terminalViewShowing";
    TerminalContextKeyStrings["TextSelected"] = "terminalTextSelected";
    TerminalContextKeyStrings["TextSelectedInFocused"] = "terminalTextSelectedInFocused";
    TerminalContextKeyStrings["FindVisible"] = "terminalFindVisible";
    TerminalContextKeyStrings["FindInputFocused"] = "terminalFindInputFocused";
    TerminalContextKeyStrings["FindFocused"] = "terminalFindFocused";
    TerminalContextKeyStrings["TabsSingularSelection"] = "terminalTabsSingularSelection";
    TerminalContextKeyStrings["SplitTerminal"] = "terminalSplitTerminal";
    TerminalContextKeyStrings["ShellType"] = "terminalShellType";
    TerminalContextKeyStrings["InTerminalRunCommandPicker"] = "inTerminalRunCommandPicker";
    TerminalContextKeyStrings["TerminalShellIntegrationEnabled"] = "terminalShellIntegrationEnabled";
})(TerminalContextKeyStrings || (TerminalContextKeyStrings = {}))));
var TerminalContextKeys;
( ((function(TerminalContextKeys) {
    TerminalContextKeys.isOpen = ( (new RawContextKey(TerminalContextKeyStrings.IsOpen, false, true)));
    TerminalContextKeys.focus = ( (new RawContextKey(TerminalContextKeyStrings.Focus, false, ( localizeWithPath(_moduleId, 0, "Whether the terminal is focused.")))));
    TerminalContextKeys.focusInAny = ( (new RawContextKey(TerminalContextKeyStrings.FocusInAny, false, ( localizeWithPath(
        _moduleId,
        1,
        "Whether any terminal is focused, including detached terminals used in other UI."
    )))));
    TerminalContextKeys.editorFocus = ( (new RawContextKey(TerminalContextKeyStrings.EditorFocus, false, ( localizeWithPath(_moduleId, 2, "Whether a terminal in the editor area is focused.")))));
    TerminalContextKeys.count = ( (new RawContextKey(TerminalContextKeyStrings.Count, 0, ( localizeWithPath(_moduleId, 3, "The current number of terminals.")))));
    TerminalContextKeys.groupCount = ( (new RawContextKey(TerminalContextKeyStrings.GroupCount, 0, true)));
    TerminalContextKeys.tabsNarrow = ( (new RawContextKey(TerminalContextKeyStrings.TabsNarrow, false, true)));
    TerminalContextKeys.terminalHasFixedWidth = ( (new RawContextKey(TerminalContextKeyStrings.HasFixedWidth, false, true)));
    TerminalContextKeys.tabsFocus = ( (new RawContextKey(TerminalContextKeyStrings.TabsFocus, false, ( localizeWithPath(_moduleId, 4, "Whether the terminal tabs widget is focused.")))));
    TerminalContextKeys.webExtensionContributedProfile = ( (new RawContextKey(TerminalContextKeyStrings.WebExtensionContributedProfile, false, true)));
    TerminalContextKeys.terminalHasBeenCreated = ( (new RawContextKey(TerminalContextKeyStrings.TerminalHasBeenCreated, false, true)));
    TerminalContextKeys.terminalEditorActive = ( (new RawContextKey(TerminalContextKeyStrings.TerminalEditorActive, false, true)));
    TerminalContextKeys.tabsMouse = ( (new RawContextKey(TerminalContextKeyStrings.TabsMouse, false, true)));
    TerminalContextKeys.shellType = ( (new RawContextKey(
        TerminalContextKeyStrings.ShellType,
        undefined,
        { type: 'string', description: ( localizeWithPath(
            _moduleId,
            5,
            "The shell type of the active terminal, this is set to the last known value when no terminals exist."
        )) }
    )));
    TerminalContextKeys.altBufferActive = ( (new RawContextKey(TerminalContextKeyStrings.AltBufferActive, false, ( localizeWithPath(_moduleId, 6, "Whether the terminal's alt buffer is active.")))));
    TerminalContextKeys.suggestWidgetVisible = ( (new RawContextKey(TerminalContextKeyStrings.SuggestWidgetVisible, false, ( localizeWithPath(_moduleId, 7, "Whether the terminal's suggest widget is visible.")))));
    TerminalContextKeys.notFocus = ( (TerminalContextKeys.focus.toNegated()));
    TerminalContextKeys.viewShowing = ( (new RawContextKey(TerminalContextKeyStrings.ViewShowing, false, ( localizeWithPath(_moduleId, 8, "Whether the terminal view is showing")))));
    TerminalContextKeys.textSelected = ( (new RawContextKey(TerminalContextKeyStrings.TextSelected, false, ( localizeWithPath(_moduleId, 9, "Whether text is selected in the active terminal.")))));
    TerminalContextKeys.textSelectedInFocused = ( (new RawContextKey(TerminalContextKeyStrings.TextSelectedInFocused, false, ( localizeWithPath(_moduleId, 10, "Whether text is selected in a focused terminal.")))));
    TerminalContextKeys.notTextSelected = ( (TerminalContextKeys.textSelected.toNegated()));
    TerminalContextKeys.findVisible = ( (new RawContextKey(TerminalContextKeyStrings.FindVisible, false, true)));
    TerminalContextKeys.notFindVisible = ( (TerminalContextKeys.findVisible.toNegated()));
    TerminalContextKeys.findInputFocus = ( (new RawContextKey(TerminalContextKeyStrings.FindInputFocused, false, true)));
    TerminalContextKeys.findFocus = ( (new RawContextKey(TerminalContextKeyStrings.FindFocused, false, true)));
    TerminalContextKeys.notFindFocus = ( (TerminalContextKeys.findInputFocus.toNegated()));
    TerminalContextKeys.processSupported = ( (new RawContextKey(TerminalContextKeyStrings.ProcessSupported, false, ( localizeWithPath(
        _moduleId,
        11,
        "Whether terminal processes can be launched in the current workspace."
    )))));
    TerminalContextKeys.tabsSingularSelection = ( (new RawContextKey(TerminalContextKeyStrings.TabsSingularSelection, false, ( localizeWithPath(
        _moduleId,
        12,
        "Whether one terminal is selected in the terminal tabs list."
    )))));
    TerminalContextKeys.splitTerminal = ( (new RawContextKey(TerminalContextKeyStrings.SplitTerminal, false, ( localizeWithPath(_moduleId, 13, "Whether the focused tab's terminal is a split terminal.")))));
    TerminalContextKeys.inTerminalRunCommandPicker = ( (new RawContextKey(
        TerminalContextKeyStrings.InTerminalRunCommandPicker,
        false,
        ( localizeWithPath(
            _moduleId,
            14,
            "Whether the terminal run command picker is currently open."
        ))
    )));
    TerminalContextKeys.terminalShellIntegrationEnabled = ( (new RawContextKey(
        TerminalContextKeyStrings.TerminalShellIntegrationEnabled,
        false,
        ( localizeWithPath(
            _moduleId,
            15,
            "Whether shell integration is enabled in the active terminal"
        ))
    )));
    TerminalContextKeys.shouldShowViewInlineActions = ( (ContextKeyExpr.and(
         (ContextKeyExpr.equals('view', TERMINAL_VIEW_ID)),
         (ContextKeyExpr.notEquals(`config.${TerminalSettingId.TabsHideCondition}`, 'never')),
         (ContextKeyExpr.or(
            ContextKeyExpr.not(`config.${TerminalSettingId.TabsEnabled}`),
             (ContextKeyExpr.and(
                 (ContextKeyExpr.equals(`config.${TerminalSettingId.TabsShowActions}`, 'singleTerminal')),
                 (ContextKeyExpr.equals(TerminalContextKeyStrings.GroupCount, 1))
            )),
             (ContextKeyExpr.and(
                 (ContextKeyExpr.equals(`config.${TerminalSettingId.TabsShowActions}`, 'singleTerminalOrNarrow')),
                 (ContextKeyExpr.or(
                     (ContextKeyExpr.equals(TerminalContextKeyStrings.GroupCount, 1)),
                     (ContextKeyExpr.has(TerminalContextKeyStrings.TabsNarrow))
                ))
            )),
             (ContextKeyExpr.and(
                 (ContextKeyExpr.equals(`config.${TerminalSettingId.TabsShowActions}`, 'singleGroup')),
                 (ContextKeyExpr.equals(TerminalContextKeyStrings.GroupCount, 1))
            )),
             (ContextKeyExpr.equals(`config.${TerminalSettingId.TabsShowActions}`, 'always'))
        ))
    )));
})(TerminalContextKeys || (TerminalContextKeys = {}))));
export { TerminalContextKeyStrings, TerminalContextKeys };
