import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
import { ctxCommentEditorFocused } from './simpleCommentEditor.js';
import { CommentContextKeys } from '../common/commentContextKeys.js';
import { localizeWithPath } from '../../../../nls.js';
import { AccessibilityVerbositySettingId } from '../../accessibility/browser/accessibilityConfiguration.js';
import { CommentCommandId } from '../common/commentCommandIds.js';
import { ToggleTabFocusModeAction } from '../../../../editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js';
import { AccessibleViewType, AccessibleViewProviderId } from '../../../../platform/accessibility/browser/accessibleView.js';
const _moduleId = "vs/workbench/contrib/comments/browser/commentsAccessibility";
var CommentAccessibilityHelpNLS;
( ((function(CommentAccessibilityHelpNLS) {
    CommentAccessibilityHelpNLS.intro = ( localizeWithPath(
        _moduleId,
        0,
        "The editor contains commentable range(s). Some useful commands include:"
    ));
    CommentAccessibilityHelpNLS.tabFocus = ( localizeWithPath(
        _moduleId,
        1,
        "This widget contains a text area, for composition of new comments, and actions, that can be tabbed to once tab moves focus mode has been enabled with the command Toggle Tab Key Moves Focus{0}",
        `<keybinding:${ToggleTabFocusModeAction.ID}>`
    ));
    CommentAccessibilityHelpNLS.commentCommands = ( localizeWithPath(_moduleId, 2, "Some useful comment commands include:"));
    CommentAccessibilityHelpNLS.escape = ( localizeWithPath(_moduleId, 3, "- Dismiss Comment (Escape)"));
    CommentAccessibilityHelpNLS.nextRange = ( localizeWithPath(
        _moduleId,
        4,
        "- Go to Next Commenting Range{0}",
        `<keybinding:${CommentCommandId.NextRange}>`
    ));
    CommentAccessibilityHelpNLS.previousRange = ( localizeWithPath(
        _moduleId,
        5,
        "- Go to Previous Commenting Range{0}",
        `<keybinding:${CommentCommandId.PreviousRange}>`
    ));
    CommentAccessibilityHelpNLS.nextCommentThread = ( localizeWithPath(
        _moduleId,
        6,
        "- Go to Next Comment Thread{0}",
        `<keybinding:${CommentCommandId.NextThread}>`
    ));
    CommentAccessibilityHelpNLS.previousCommentThread = ( localizeWithPath(
        _moduleId,
        7,
        "- Go to Previous Comment Thread{0}",
        `<keybinding:${CommentCommandId.PreviousThread}>`
    ));
    CommentAccessibilityHelpNLS.addComment = ( localizeWithPath(
        _moduleId,
        8,
        "- Add Comment on Current Selection{0}",
        `<keybinding:${CommentCommandId.Add}>`
    ));
    CommentAccessibilityHelpNLS.submitComment = ( localizeWithPath(
        _moduleId,
        9,
        "- Submit Comment{0}",
        `<keybinding:${CommentCommandId.Submit}>`
    ));
})(CommentAccessibilityHelpNLS || (CommentAccessibilityHelpNLS = {}))));
class CommentsAccessibilityHelpProvider {
    constructor() {
        this.id = AccessibleViewProviderId.Comments;
        this.verbositySettingKey = AccessibilityVerbositySettingId.Comments;
        this.options = { type: AccessibleViewType.Help };
    }
    provideContent() {
        return [CommentAccessibilityHelpNLS.tabFocus, CommentAccessibilityHelpNLS.commentCommands, CommentAccessibilityHelpNLS.escape, CommentAccessibilityHelpNLS.addComment, CommentAccessibilityHelpNLS.submitComment, CommentAccessibilityHelpNLS.nextRange, CommentAccessibilityHelpNLS.previousRange].join('\n');
    }
    onClose() {
        this._element?.focus();
    }
}
class CommentsAccessibilityHelp {
    constructor() {
        this.priority = 110;
        this.name = 'comments';
        this.type = AccessibleViewType.Help;
        this.when = ( (ContextKeyExpr.or(ctxCommentEditorFocused, CommentContextKeys.commentFocused)));
    }
    getProvider(accessor) {
        return accessor.get(IInstantiationService).createInstance(CommentsAccessibilityHelpProvider);
    }
    dispose() { }
}
export { CommentAccessibilityHelpNLS, CommentsAccessibilityHelp, CommentsAccessibilityHelpProvider };
