
import { localize } 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';
import { TerminalContribContextKeyStrings } from '../terminalContribExports.js';

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["SplitPaneActive"] = "terminalSplitPaneActive";
    TerminalContextKeyStrings["ShellType"] = "terminalShellType";
    TerminalContextKeyStrings["InTerminalRunCommandPicker"] = "inTerminalRunCommandPicker";
    TerminalContextKeyStrings["TerminalShellIntegrationEnabled"] = "terminalShellIntegrationEnabled";
    TerminalContextKeyStrings["DictationInProgress"] = "terminalDictationInProgress";
})(TerminalContextKeyStrings || (TerminalContextKeyStrings = {}));
var TerminalContextKeys;
(function(TerminalContextKeys) {
    TerminalContextKeys.isOpen = ( new RawContextKey(TerminalContextKeyStrings.IsOpen, false, true));
    TerminalContextKeys.focus = ( new RawContextKey(TerminalContextKeyStrings.Focus, false, ( localize(13674, "Whether the terminal is focused."))));
    TerminalContextKeys.focusInAny = ( new RawContextKey(TerminalContextKeyStrings.FocusInAny, false, ( localize(
        13675,
        "Whether any terminal is focused, including detached terminals used in other UI."
    ))));
    TerminalContextKeys.editorFocus = ( new RawContextKey(TerminalContextKeyStrings.EditorFocus, false, ( localize(13676, "Whether a terminal in the editor area is focused."))));
    TerminalContextKeys.count = ( new RawContextKey(TerminalContextKeyStrings.Count, 0, ( localize(13677, "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, ( localize(13678, "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: ( localize(
            13679,
            "The shell type of the active terminal, this is set if the type can be detected."
        ))
    }));
    TerminalContextKeys.altBufferActive = ( new RawContextKey(TerminalContextKeyStrings.AltBufferActive, false, ( localize(13680, "Whether the terminal's alt buffer is active."))));
    TerminalContextKeys.suggestWidgetVisible = ( new RawContextKey(TerminalContextKeyStrings.SuggestWidgetVisible, false, ( localize(13681, "Whether the terminal's suggest widget is visible."))));
    TerminalContextKeys.notFocus = ( TerminalContextKeys.focus.toNegated());
    TerminalContextKeys.viewShowing = ( new RawContextKey(TerminalContextKeyStrings.ViewShowing, false, ( localize(13682, "Whether the terminal view is showing"))));
    TerminalContextKeys.textSelected = ( new RawContextKey(TerminalContextKeyStrings.TextSelected, false, ( localize(13683, "Whether text is selected in the active terminal."))));
    TerminalContextKeys.textSelectedInFocused = ( new RawContextKey(TerminalContextKeyStrings.TextSelectedInFocused, false, ( localize(13684, "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, ( localize(
        13685,
        "Whether terminal processes can be launched in the current workspace."
    ))));
    TerminalContextKeys.tabsSingularSelection = ( new RawContextKey(TerminalContextKeyStrings.TabsSingularSelection, false, ( localize(13686, "Whether one terminal is selected in the terminal tabs list."))));
    TerminalContextKeys.splitTerminalTabFocused = ( new RawContextKey(TerminalContextKeyStrings.SplitTerminal, false, ( localize(13687, "Whether the focused tab's terminal is a split terminal."))));
    TerminalContextKeys.splitTerminalActive = ( new RawContextKey(TerminalContextKeyStrings.SplitPaneActive, false, ( localize(13688, "Whether the active terminal is a split pane."))));
    TerminalContextKeys.inTerminalRunCommandPicker = ( new RawContextKey(
        TerminalContextKeyStrings.InTerminalRunCommandPicker,
        false,
        ( localize(13689, "Whether the terminal run command picker is currently open."))
    ));
    TerminalContextKeys.terminalShellIntegrationEnabled = ( new RawContextKey(
        TerminalContextKeyStrings.TerminalShellIntegrationEnabled,
        false,
        ( localize(13690, "Whether shell integration is enabled in the active terminal"))
    ));
    TerminalContextKeys.terminalDictationInProgress = ( new RawContextKey(TerminalContextKeyStrings.DictationInProgress, false));
    TerminalContextKeys.shouldShowViewInlineActions = ( ContextKeyExpr.and(( ContextKeyExpr.equals("view", TERMINAL_VIEW_ID)), ( ContextKeyExpr.notEquals(`config.${TerminalSettingId.TabsHideCondition}`, "never")), ContextKeyExpr.not(TerminalContribContextKeyStrings.ChatHasHiddenTerminals), ( 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 };
