
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
import { localize } from '../../../../nls.js';
import { ConfigurationScope, Extensions } from '../../../../platform/configuration/common/configurationRegistry.js';
import { Registry } from '../../../../platform/registry/common/platform.js';
import { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
import { workbenchConfigurationNodeBase, Extensions as Extensions$1 } from '../../../common/configuration.js';
import { AccessibilitySignal } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js';
import { AccessibilityVoiceSettingId, SPEECH_LANGUAGES } from '../../speech/common/speechService.js';
import { ISpeechService } from '../../speech/common/speechService.service.js';
import { Disposable } from '../../../../base/common/lifecycle.js';
import { Event } from '../../../../base/common/event.js';
import { isDefined } from '../../../../base/common/types.js';
import { IProductService } from '../../../../platform/product/common/productService.service.js';

const accessibilityHelpIsShown = ( new RawContextKey('accessibilityHelpIsShown', false, true));
const accessibleViewIsShown = ( new RawContextKey('accessibleViewIsShown', false, true));
const accessibleViewSupportsNavigation = ( new RawContextKey('accessibleViewSupportsNavigation', false, true));
const accessibleViewVerbosityEnabled = ( new RawContextKey('accessibleViewVerbosityEnabled', false, true));
const accessibleViewGoToSymbolSupported = ( new RawContextKey('accessibleViewGoToSymbolSupported', false, true));
const accessibleViewOnLastLine = ( new RawContextKey('accessibleViewOnLastLine', false, true));
const accessibleViewCurrentProviderId = ( new RawContextKey('accessibleViewCurrentProviderId', undefined, undefined));
const accessibleViewInCodeBlock = ( new RawContextKey('accessibleViewInCodeBlock', undefined, undefined));
const accessibleViewContainsCodeBlocks = ( new RawContextKey('accessibleViewContainsCodeBlocks', undefined, undefined));
const accessibleViewHasUnassignedKeybindings = ( new RawContextKey('accessibleViewHasUnassignedKeybindings', undefined, undefined));
const accessibleViewHasAssignedKeybindings = ( new RawContextKey('accessibleViewHasAssignedKeybindings', undefined, undefined));
var AccessibilityWorkbenchSettingId;
(function (AccessibilityWorkbenchSettingId) {
    AccessibilityWorkbenchSettingId["DimUnfocusedEnabled"] = "accessibility.dimUnfocused.enabled";
    AccessibilityWorkbenchSettingId["DimUnfocusedOpacity"] = "accessibility.dimUnfocused.opacity";
    AccessibilityWorkbenchSettingId["HideAccessibleView"] = "accessibility.hideAccessibleView";
    AccessibilityWorkbenchSettingId["AccessibleViewCloseOnKeyPress"] = "accessibility.accessibleView.closeOnKeyPress";
})(AccessibilityWorkbenchSettingId || (AccessibilityWorkbenchSettingId = {}));
var ViewDimUnfocusedOpacityProperties;
(function (ViewDimUnfocusedOpacityProperties) {
    ViewDimUnfocusedOpacityProperties[ViewDimUnfocusedOpacityProperties["Default"] = 0.75] = "Default";
    ViewDimUnfocusedOpacityProperties[ViewDimUnfocusedOpacityProperties["Minimum"] = 0.2] = "Minimum";
    ViewDimUnfocusedOpacityProperties[ViewDimUnfocusedOpacityProperties["Maximum"] = 1] = "Maximum";
})(ViewDimUnfocusedOpacityProperties || (ViewDimUnfocusedOpacityProperties = {}));
var AccessibilityVerbositySettingId;
(function (AccessibilityVerbositySettingId) {
    AccessibilityVerbositySettingId["Terminal"] = "accessibility.verbosity.terminal";
    AccessibilityVerbositySettingId["DiffEditor"] = "accessibility.verbosity.diffEditor";
    AccessibilityVerbositySettingId["Chat"] = "accessibility.verbosity.panelChat";
    AccessibilityVerbositySettingId["InlineChat"] = "accessibility.verbosity.inlineChat";
    AccessibilityVerbositySettingId["TerminalChat"] = "accessibility.verbosity.terminalChat";
    AccessibilityVerbositySettingId["InlineCompletions"] = "accessibility.verbosity.inlineCompletions";
    AccessibilityVerbositySettingId["KeybindingsEditor"] = "accessibility.verbosity.keybindingsEditor";
    AccessibilityVerbositySettingId["Notebook"] = "accessibility.verbosity.notebook";
    AccessibilityVerbositySettingId["Editor"] = "accessibility.verbosity.editor";
    AccessibilityVerbositySettingId["Hover"] = "accessibility.verbosity.hover";
    AccessibilityVerbositySettingId["Notification"] = "accessibility.verbosity.notification";
    AccessibilityVerbositySettingId["EmptyEditorHint"] = "accessibility.verbosity.emptyEditorHint";
    AccessibilityVerbositySettingId["ReplEditor"] = "accessibility.verbosity.replEditor";
    AccessibilityVerbositySettingId["Comments"] = "accessibility.verbosity.comments";
    AccessibilityVerbositySettingId["DiffEditorActive"] = "accessibility.verbosity.diffEditorActive";
    AccessibilityVerbositySettingId["Debug"] = "accessibility.verbosity.debug";
    AccessibilityVerbositySettingId["Walkthrough"] = "accessibility.verbosity.walkthrough";
})(AccessibilityVerbositySettingId || (AccessibilityVerbositySettingId = {}));
const baseVerbosityProperty = {
    type: 'boolean',
    default: true,
    tags: ['accessibility']
};
const accessibilityConfigurationNodeBase = ( Object.freeze({
    id: 'accessibility',
    title: ( localize(3886, "Accessibility")),
    type: 'object'
}));
const soundFeatureBase = {
    'type': 'string',
    'enum': ['auto', 'on', 'off'],
    'default': 'auto',
    'enumDescriptions': [
        ( localize(3887, "Enable sound when a screen reader is attached.")),
        ( localize(3888, "Enable sound.")),
        ( localize(3889, "Disable sound."))
    ],
    tags: ['accessibility'],
};
const signalFeatureBase = {
    'type': 'object',
    'tags': ['accessibility'],
    additionalProperties: false,
    default: {
        sound: 'auto',
        announcement: 'auto'
    }
};
const announcementFeatureBase = {
    'type': 'string',
    'enum': ['auto', 'off'],
    'default': 'auto',
    'enumDescriptions': [
        ( localize(
        3890,
        "Enable announcement, will only play when in screen reader optimized mode."
    )),
        ( localize(3891, "Disable announcement."))
    ],
    tags: ['accessibility'],
};
const defaultNoAnnouncement = {
    'type': 'object',
    'tags': ['accessibility'],
    additionalProperties: false,
    'default': {
        'sound': 'auto',
    }
};
const configuration = {
    ...accessibilityConfigurationNodeBase,
    scope: ConfigurationScope.RESOURCE,
    properties: {
        [AccessibilityVerbositySettingId.Terminal]: {
            description: ( localize(
                3892,
                'Provide information about how to access the terminal accessibility help menu when the terminal is focused.'
            )),
            ...baseVerbosityProperty
        },
        [AccessibilityVerbositySettingId.DiffEditor]: {
            description: ( localize(
                3893,
                'Provide information about how to navigate changes in the diff editor when it is focused.'
            )),
            ...baseVerbosityProperty
        },
        [AccessibilityVerbositySettingId.Chat]: {
            description: ( localize(
                3894,
                'Provide information about how to access the chat help menu when the chat input is focused.'
            )),
            ...baseVerbosityProperty
        },
        [AccessibilityVerbositySettingId.InlineChat]: {
            description: ( localize(
                3895,
                'Provide information about how to access the inline editor chat accessibility help menu and alert with hints that describe how to use the feature when the input is focused.'
            )),
            ...baseVerbosityProperty
        },
        [AccessibilityVerbositySettingId.InlineCompletions]: {
            description: ( localize(
                3896,
                'Provide information about how to access the inline completions hover and Accessible View.'
            )),
            ...baseVerbosityProperty
        },
        [AccessibilityVerbositySettingId.KeybindingsEditor]: {
            description: ( localize(
                3897,
                'Provide information about how to change a keybinding in the keybindings editor when a row is focused.'
            )),
            ...baseVerbosityProperty
        },
        [AccessibilityVerbositySettingId.Notebook]: {
            description: ( localize(
                3898,
                'Provide information about how to focus the cell container or inner editor when a notebook cell is focused.'
            )),
            ...baseVerbosityProperty
        },
        [AccessibilityVerbositySettingId.Hover]: {
            description: ( localize(
                3899,
                'Provide information about how to open the hover in an Accessible View.'
            )),
            ...baseVerbosityProperty
        },
        [AccessibilityVerbositySettingId.Notification]: {
            description: ( localize(
                3900,
                'Provide information about how to open the notification in an Accessible View.'
            )),
            ...baseVerbosityProperty
        },
        [AccessibilityVerbositySettingId.EmptyEditorHint]: {
            description: ( localize(
                3901,
                'Provide information about relevant actions in an empty text editor.'
            )),
            ...baseVerbosityProperty
        },
        [AccessibilityVerbositySettingId.ReplEditor]: {
            description: ( localize(
                3902,
                'Provide information about how to access the REPL editor accessibility help menu when the REPL editor is focused.'
            )),
            ...baseVerbosityProperty
        },
        [AccessibilityVerbositySettingId.Comments]: {
            description: ( localize(
                3903,
                'Provide information about actions that can be taken in the comment widget or in a file which contains comments.'
            )),
            ...baseVerbosityProperty
        },
        [AccessibilityVerbositySettingId.DiffEditorActive]: {
            description: ( localize(3904, 'Indicate when a diff editor becomes the active editor.')),
            ...baseVerbosityProperty
        },
        [AccessibilityVerbositySettingId.Debug]: {
            description: ( localize(
                3905,
                'Provide information about how to access the debug console accessibility help dialog when the debug console or run and debug viewlet is focused. Note that a reload of the window is required for this to take effect.'
            )),
            ...baseVerbosityProperty
        },
        [AccessibilityVerbositySettingId.Walkthrough]: {
            description: ( localize(
                3906,
                'Provide information about how to open the walkthrough in an Accessible View.'
            )),
            ...baseVerbosityProperty
        },
        [AccessibilityWorkbenchSettingId.AccessibleViewCloseOnKeyPress]: {
            markdownDescription: ( localize(
                3907,
                "On keypress, close the Accessible View and focus the element from which it was invoked."
            )),
            type: 'boolean',
            default: true
        },
        'accessibility.signalOptions.volume': {
            'description': ( localize(3908, "The volume of the sounds in percent (0-100).")),
            'type': 'number',
            'minimum': 0,
            'maximum': 100,
            'default': 70,
            'tags': ['accessibility']
        },
        'accessibility.signalOptions.debouncePositionChanges': {
            'description': ( localize(3909, "Whether or not position changes should be debounced")),
            'type': 'boolean',
            'default': false,
            'tags': ['accessibility']
        },
        'accessibility.signalOptions.experimental.delays.general': {
            'type': 'object',
            'description': 'Delays for all signals besides error and warning at position',
            'additionalProperties': false,
            'properties': {
                'announcement': {
                    'description': ( localize(3910, "The delay in milliseconds before an announcement is made.")),
                    'type': 'number',
                    'minimum': 0,
                    'default': 3000
                },
                'sound': {
                    'description': ( localize(3911, "The delay in milliseconds before a sound is played.")),
                    'type': 'number',
                    'minimum': 0,
                    'default': 400
                }
            },
            'tags': ['accessibility']
        },
        'accessibility.signalOptions.experimental.delays.warningAtPosition': {
            'type': 'object',
            'additionalProperties': false,
            'properties': {
                'announcement': {
                    'description': ( localize(
                        3912,
                        "The delay in milliseconds before an announcement is made when there's a warning at the position."
                    )),
                    'type': 'number',
                    'minimum': 0,
                    'default': 3000
                },
                'sound': {
                    'description': ( localize(
                        3913,
                        "The delay in milliseconds before a sound is played when there's a warning at the position."
                    )),
                    'type': 'number',
                    'minimum': 0,
                    'default': 1000
                }
            },
            'tags': ['accessibility']
        },
        'accessibility.signalOptions.experimental.delays.errorAtPosition': {
            'type': 'object',
            'additionalProperties': false,
            'properties': {
                'announcement': {
                    'description': ( localize(
                        3914,
                        "The delay in milliseconds before an announcement is made when there's an error at the position."
                    )),
                    'type': 'number',
                    'minimum': 0,
                    'default': 3000
                },
                'sound': {
                    'description': ( localize(
                        3915,
                        "The delay in milliseconds before a sound is played when there's an error at the position."
                    )),
                    'type': 'number',
                    'minimum': 0,
                    'default': 1000
                }
            },
            'tags': ['accessibility']
        },
        'accessibility.signals.lineHasBreakpoint': {
            ...signalFeatureBase,
            'description': ( localize(
                3916,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a breakpoint."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(3917, "Plays a sound when the active line has a breakpoint.")),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(3918, "Announces when the active line has a breakpoint.")),
                    ...announcementFeatureBase
                },
            },
        },
        'accessibility.signals.lineHasInlineSuggestion': {
            ...defaultNoAnnouncement,
            'description': ( localize(
                3919,
                "Plays a sound / audio cue when the active line has an inline suggestion."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(3920, "Plays a sound when the active line has an inline suggestion.")),
                    ...soundFeatureBase,
                    'default': 'off'
                }
            }
        },
        'accessibility.signals.lineHasError': {
            ...signalFeatureBase,
            'description': ( localize(
                3921,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has an error."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(3922, "Plays a sound when the active line has an error.")),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(3923, "Announces when the active line has an error.")),
                    ...announcementFeatureBase,
                    default: 'off'
                },
            },
        },
        'accessibility.signals.lineHasFoldedArea': {
            ...signalFeatureBase,
            'description': ( localize(
                3924,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - the active line has a folded area that can be unfolded."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(
                        3925,
                        "Plays a sound when the active line has a folded area that can be unfolded."
                    )),
                    ...soundFeatureBase,
                    default: 'off'
                },
                'announcement': {
                    'description': ( localize(
                        3926,
                        "Announces when the active line has a folded area that can be unfolded."
                    )),
                    ...announcementFeatureBase
                },
            }
        },
        'accessibility.signals.lineHasWarning': {
            ...signalFeatureBase,
            'description': ( localize(
                3927,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(3928, "Plays a sound when the active line has a warning.")),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(3929, "Announces when the active line has a warning.")),
                    ...announcementFeatureBase,
                    default: 'off'
                },
            },
        },
        'accessibility.signals.positionHasError': {
            ...signalFeatureBase,
            'description': ( localize(
                3930,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(3931, "Plays a sound when the active line has a warning.")),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(3932, "Announces when the active line has a warning.")),
                    ...announcementFeatureBase,
                    default: 'on'
                },
            },
        },
        'accessibility.signals.positionHasWarning': {
            ...signalFeatureBase,
            'description': ( localize(
                3933,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(3934, "Plays a sound when the active line has a warning.")),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(3935, "Announces when the active line has a warning.")),
                    ...announcementFeatureBase,
                    default: 'on'
                },
            },
        },
        'accessibility.signals.onDebugBreak': {
            ...signalFeatureBase,
            'description': ( localize(
                3936,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when the debugger stopped on a breakpoint."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(3937, "Plays a sound when the debugger stopped on a breakpoint.")),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(3938, "Announces when the debugger stopped on a breakpoint.")),
                    ...announcementFeatureBase
                },
            }
        },
        'accessibility.signals.noInlayHints': {
            ...signalFeatureBase,
            'description': ( localize(
                3939,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when trying to read a line with inlay hints that has no inlay hints."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(
                        3940,
                        "Plays a sound when trying to read a line with inlay hints that has no inlay hints."
                    )),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(
                        3941,
                        "Announces when trying to read a line with inlay hints that has no inlay hints."
                    )),
                    ...announcementFeatureBase
                },
            }
        },
        'accessibility.signals.taskCompleted': {
            ...signalFeatureBase,
            'description': ( localize(
                3942,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when a task is completed."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(3943, "Plays a sound when a task is completed.")),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(3944, "Announces when a task is completed.")),
                    ...announcementFeatureBase
                },
            }
        },
        'accessibility.signals.taskFailed': {
            ...signalFeatureBase,
            'description': ( localize(
                3945,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when a task fails (non-zero exit code)."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(3946, "Plays a sound when a task fails (non-zero exit code).")),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(3947, "Announces when a task fails (non-zero exit code).")),
                    ...announcementFeatureBase
                },
            }
        },
        'accessibility.signals.terminalCommandFailed': {
            ...signalFeatureBase,
            'description': ( localize(
                3948,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(
                        3949,
                        "Plays a sound when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."
                    )),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(
                        3950,
                        "Announces when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."
                    )),
                    ...announcementFeatureBase
                },
            }
        },
        'accessibility.signals.terminalCommandSucceeded': {
            ...signalFeatureBase,
            'description': ( localize(
                3951,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(
                        3952,
                        "Plays a sound when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."
                    )),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(
                        3953,
                        "Announces when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."
                    )),
                    ...announcementFeatureBase
                },
            }
        },
        'accessibility.signals.terminalQuickFix': {
            ...signalFeatureBase,
            'description': ( localize(
                3954,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when terminal Quick Fixes are available."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(3955, "Plays a sound when terminal Quick Fixes are available.")),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(3956, "Announces when terminal Quick Fixes are available.")),
                    ...announcementFeatureBase
                },
            }
        },
        'accessibility.signals.terminalBell': {
            ...signalFeatureBase,
            'description': ( localize(
                3957,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when the terminal bell is ringing."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(3958, "Plays a sound when the terminal bell is ringing.")),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(3959, "Announces when the terminal bell is ringing.")),
                    ...announcementFeatureBase
                },
            }
        },
        'accessibility.signals.diffLineInserted': {
            ...defaultNoAnnouncement,
            'description': ( localize(
                3960,
                "Plays a sound / audio cue when the focus moves to an inserted line in Accessible Diff Viewer mode or to the next/previous change."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(
                        3961,
                        "Plays a sound when the focus moves to an inserted line in Accessible Diff Viewer mode or to the next/previous change."
                    )),
                    ...soundFeatureBase
                }
            }
        },
        'accessibility.signals.diffLineModified': {
            ...defaultNoAnnouncement,
            'description': ( localize(
                3962,
                "Plays a sound / audio cue when the focus moves to an modified line in Accessible Diff Viewer mode or to the next/previous change."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(
                        3963,
                        "Plays a sound when the focus moves to a modified line in Accessible Diff Viewer mode or to the next/previous change."
                    )),
                    ...soundFeatureBase
                }
            }
        },
        'accessibility.signals.diffLineDeleted': {
            ...defaultNoAnnouncement,
            'description': ( localize(
                3964,
                "Plays a sound / audio cue when the focus moves to an deleted line in Accessible Diff Viewer mode or to the next/previous change."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(
                        3965,
                        "Plays a sound when the focus moves to an deleted line in Accessible Diff Viewer mode or to the next/previous change."
                    )),
                    ...soundFeatureBase
                }
            }
        },
        'accessibility.signals.notebookCellCompleted': {
            ...signalFeatureBase,
            'description': ( localize(
                3966,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when a notebook cell execution is successfully completed."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(
                        3967,
                        "Plays a sound when a notebook cell execution is successfully completed."
                    )),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(
                        3968,
                        "Announces when a notebook cell execution is successfully completed."
                    )),
                    ...announcementFeatureBase
                },
            }
        },
        'accessibility.signals.notebookCellFailed': {
            ...signalFeatureBase,
            'description': ( localize(
                3969,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when a notebook cell execution fails."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(3970, "Plays a sound when a notebook cell execution fails.")),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(3971, "Announces when a notebook cell execution fails.")),
                    ...announcementFeatureBase
                },
            }
        },
        'accessibility.signals.progress': {
            ...signalFeatureBase,
            'description': ( localize(
                3972,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - on loop while progress is occurring."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(3973, "Plays a sound on loop while progress is occurring.")),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(3974, "Alerts on loop while progress is occurring.")),
                    ...announcementFeatureBase
                },
            },
        },
        'accessibility.signals.chatRequestSent': {
            ...signalFeatureBase,
            'description': ( localize(
                3975,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when a chat request is made."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(3976, "Plays a sound when a chat request is made.")),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(3977, "Announces when a chat request is made.")),
                    ...announcementFeatureBase
                },
            }
        },
        'accessibility.signals.chatResponseReceived': {
            ...defaultNoAnnouncement,
            'description': ( localize(3978, "Plays a sound / audio cue when the response has been received.")),
            'properties': {
                'sound': {
                    'description': ( localize(3979, "Plays a sound on when the response has been received.")),
                    ...soundFeatureBase
                },
            }
        },
        'accessibility.signals.codeActionTriggered': {
            ...defaultNoAnnouncement,
            'description': ( localize(3980, "Plays a sound / audio cue - when a code action has been triggered.")),
            'properties': {
                'sound': {
                    'description': ( localize(3981, "Plays a sound when a code action has been triggered.")),
                    ...soundFeatureBase
                }
            }
        },
        'accessibility.signals.codeActionApplied': {
            ...defaultNoAnnouncement,
            'description': ( localize(3982, "Plays a sound / audio cue when the code action has been applied.")),
            'properties': {
                'sound': {
                    'description': ( localize(3983, "Plays a sound when the code action has been applied.")),
                    ...soundFeatureBase
                },
            }
        },
        'accessibility.signals.voiceRecordingStarted': {
            ...defaultNoAnnouncement,
            'description': ( localize(3984, "Plays a sound / audio cue when the voice recording has started.")),
            'properties': {
                'sound': {
                    'description': ( localize(3985, "Plays a sound when the voice recording has started.")),
                    ...soundFeatureBase,
                },
            },
            'default': {
                'sound': 'on'
            }
        },
        'accessibility.signals.voiceRecordingStopped': {
            ...defaultNoAnnouncement,
            'description': ( localize(3986, "Plays a sound / audio cue when the voice recording has stopped.")),
            'properties': {
                'sound': {
                    'description': ( localize(3987, "Plays a sound when the voice recording has stopped.")),
                    ...soundFeatureBase,
                    default: 'off'
                },
            }
        },
        'accessibility.signals.clear': {
            ...signalFeatureBase,
            'description': ( localize(
                3988,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when a feature is cleared (for example, the terminal, Debug Console, or Output channel)."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(3989, "Plays a sound when a feature is cleared.")),
                    ...soundFeatureBase
                },
                'announcement': {
                    'description': ( localize(3990, "Announces when a feature is cleared.")),
                    ...announcementFeatureBase
                },
            },
        },
        'accessibility.signals.save': {
            'type': 'object',
            'tags': ['accessibility'],
            additionalProperties: false,
            'markdownDescription': ( localize(
                3991,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when a file is saved."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(3992, "Plays a sound when a file is saved.")),
                    'type': 'string',
                    'enum': ['userGesture', 'always', 'never'],
                    'default': 'never',
                    'enumDescriptions': [
                        ( localize(3993, "Plays the sound when a user explicitly saves a file.")),
                        ( localize(3994, "Plays the sound whenever a file is saved, including auto save.")),
                        ( localize(3995, "Never plays the sound."))
                    ],
                },
                'announcement': {
                    'description': ( localize(3996, "Announces when a file is saved.")),
                    'type': 'string',
                    'enum': ['userGesture', 'always', 'never'],
                    'default': 'never',
                    'enumDescriptions': [
                        ( localize(3997, "Announces when a user explicitly saves a file.")),
                        ( localize(3998, "Announces whenever a file is saved, including auto save.")),
                        ( localize(3999, "Never plays the announcement."))
                    ],
                },
            },
            default: {
                'sound': 'never',
                'announcement': 'never'
            }
        },
        'accessibility.signals.format': {
            'type': 'object',
            'tags': ['accessibility'],
            additionalProperties: false,
            'markdownDescription': ( localize(
                4000,
                "Plays a signal - sound (audio cue) and/or announcement (alert) - when a file or notebook is formatted."
            )),
            'properties': {
                'sound': {
                    'description': ( localize(4001, "Plays a sound when a file or notebook is formatted.")),
                    'type': 'string',
                    'enum': ['userGesture', 'always', 'never'],
                    'default': 'never',
                    'enumDescriptions': [
                        ( localize(4002, "Plays the sound when a user explicitly formats a file.")),
                        ( localize(
                        4003,
                        "Plays the sound whenever a file is formatted, including if it is set to format on save, type, or, paste, or run of a cell."
                    )),
                        ( localize(4004, "Never plays the sound."))
                    ],
                },
                'announcement': {
                    'description': ( localize(4005, "Announces when a file or notebook is formatted.")),
                    'type': 'string',
                    'enum': ['userGesture', 'always', 'never'],
                    'default': 'never',
                    'enumDescriptions': [
                        ( localize(4006, "Announces when a user explicitly formats a file.")),
                        ( localize(
                        4007,
                        "Announces whenever a file is formatted, including if it is set to format on save, type, or, paste, or run of a cell."
                    )),
                        ( localize(4008, "Never announces."))
                    ],
                },
            },
            default: {
                'sound': 'never',
                'announcement': 'never'
            }
        },
        'accessibility.underlineLinks': {
            'type': 'boolean',
            'description': ( localize(4009, "Controls whether links should be underlined in the workbench.")),
            'default': false,
        },
        'accessibility.debugWatchVariableAnnouncements': {
            'type': 'boolean',
            'description': ( localize(
                4010,
                "Controls whether variable changes should be announced in the debug watch view."
            )),
            'default': true,
        },
        'accessibility.replEditor.readLastExecutionOutput': {
            'type': 'boolean',
            'description': ( localize(
                4011,
                "Controls whether the output from an execution in the native REPL will be announced."
            )),
            'default': true,
        },
        'accessibility.replEditor.autoFocusReplExecution': {
            type: 'string',
            enum: ['none', 'input', 'lastExecution'],
            default: 'input',
            description: ( localize(
                4012,
                "Control whether focus should automatically be sent to the REPL when code is executed."
            )),
        }
    }
};
function registerAccessibilityConfiguration() {
    const registry = ( Registry.as(Extensions.Configuration));
    registry.registerConfiguration(configuration);
    registry.registerConfiguration({
        ...workbenchConfigurationNodeBase,
        properties: {
            [AccessibilityWorkbenchSettingId.DimUnfocusedEnabled]: {
                description: ( localize(
                    4013,
                    'Whether to dim unfocused editors and terminals, which makes it more clear where typed input will go to. This works with the majority of editors with the notable exceptions of those that utilize iframes like notebooks and extension webview editors.'
                )),
                type: 'boolean',
                default: false,
                tags: ['accessibility'],
                scope: ConfigurationScope.APPLICATION,
            },
            [AccessibilityWorkbenchSettingId.DimUnfocusedOpacity]: {
                markdownDescription: ( localize(
                    4014,
                    'The opacity fraction (0.2 to 1.0) to use for unfocused editors and terminals. This will only take effect when {0} is enabled.',
                    `\`#${AccessibilityWorkbenchSettingId.DimUnfocusedEnabled}#\``
                )),
                type: 'number',
                minimum: ViewDimUnfocusedOpacityProperties.Minimum,
                maximum: ViewDimUnfocusedOpacityProperties.Maximum,
                default: ViewDimUnfocusedOpacityProperties.Default,
                tags: ['accessibility'],
                scope: ConfigurationScope.APPLICATION,
            },
            [AccessibilityWorkbenchSettingId.HideAccessibleView]: {
                description: ( localize(4015, "Controls whether the Accessible View is hidden.")),
                type: 'boolean',
                default: false,
                tags: ['accessibility']
            }
        }
    });
}
const SpeechTimeoutDefault = 1200;
let DynamicSpeechAccessibilityConfiguration = class DynamicSpeechAccessibilityConfiguration extends Disposable {
    static { this.ID = 'workbench.contrib.dynamicSpeechAccessibilityConfiguration'; }
    constructor(speechService, productService) {
        super();
        this.speechService = speechService;
        this.productService = productService;
        this._register(Event.runAndSubscribe(speechService.onDidChangeHasSpeechProvider, () => this.updateConfiguration()));
    }
    updateConfiguration() {
        if (!this.speechService.hasSpeechProvider) {
            return;
        }
        const languages = this.getLanguages();
        const languagesSorted = ( Object.keys(languages)).sort((langA, langB) => {
            return languages[langA].name.localeCompare(languages[langB].name);
        });
        const registry = ( Registry.as(Extensions.Configuration));
        registry.registerConfiguration({
            ...accessibilityConfigurationNodeBase,
            properties: {
                [AccessibilityVoiceSettingId.SpeechTimeout]: {
                    'markdownDescription': ( localize(
                        4016,
                        "The duration in milliseconds that voice speech recognition remains active after you stop speaking. For example in a chat session, the transcribed text is submitted automatically after the timeout is met. Set to `0` to disable this feature."
                    )),
                    'type': 'number',
                    'default': SpeechTimeoutDefault,
                    'minimum': 0,
                    'tags': ['accessibility']
                },
                [AccessibilityVoiceSettingId.SpeechLanguage]: {
                    'markdownDescription': ( localize(
                        4017,
                        "The language that text-to-speech and speech-to-text should use. Select `auto` to use the configured display language if possible. Note that not all display languages maybe supported by speech recognition and synthesizers."
                    )),
                    'type': 'string',
                    'enum': languagesSorted,
                    'default': 'auto',
                    'tags': ['accessibility'],
                    'enumDescriptions': ( languagesSorted.map(key => languages[key].name)),
                    'enumItemLabels': ( languagesSorted.map(key => languages[key].name))
                },
                [AccessibilityVoiceSettingId.AutoSynthesize]: {
                    'type': 'string',
                    'enum': ['on', 'off', 'auto'],
                    'enumDescriptions': [
                        ( localize(
                        4018,
                        "Enable the feature. When a screen reader is enabled, note that this will disable aria updates."
                    )),
                        ( localize(4019, "Disable the feature.")),
                        ( localize(
                        4020,
                        "When a screen reader is detected, disable the feature. Otherwise, enable the feature."
                    ))
                    ],
                    'markdownDescription': ( localize(
                        4021,
                        "Whether a textual response should automatically be read out aloud when speech was used as input. For example in a chat session, a response is automatically synthesized when voice was used as chat request."
                    )),
                    'default': this.productService.quality !== 'stable' ? 'auto' : 'off',
                    'tags': ['accessibility']
                }
            }
        });
    }
    getLanguages() {
        return {
            ['auto']: {
                name: ( localize(4022, "Auto (Use Display Language)"))
            },
            ...SPEECH_LANGUAGES
        };
    }
};
DynamicSpeechAccessibilityConfiguration = ( __decorate([
    ( __param(0, ISpeechService)),
    ( __param(1, IProductService))
], DynamicSpeechAccessibilityConfiguration));
( Registry.as(Extensions$1.ConfigurationMigration))
    .registerConfigurationMigrations([{
        key: 'audioCues.volume',
        migrateFn: (value, accessor) => {
            return [
                ['accessibility.signalOptions.volume', { value }],
                ['audioCues.volume', { value: undefined }]
            ];
        }
    }]);
( Registry.as(Extensions$1.ConfigurationMigration))
    .registerConfigurationMigrations([{
        key: 'audioCues.debouncePositionChanges',
        migrateFn: (value) => {
            return [
                ['accessibility.signalOptions.debouncePositionChanges', { value }],
                ['audioCues.debouncePositionChanges', { value: undefined }]
            ];
        }
    }]);
( Registry.as(Extensions$1.ConfigurationMigration))
    .registerConfigurationMigrations([{
        key: 'accessibility.signalOptions',
        migrateFn: (value, accessor) => {
            const delayGeneral = getDelaysFromConfig(accessor, 'general');
            const delayError = getDelaysFromConfig(accessor, 'errorAtPosition');
            const delayWarning = getDelaysFromConfig(accessor, 'warningAtPosition');
            const volume = getVolumeFromConfig(accessor);
            const debouncePositionChanges = getDebouncePositionChangesFromConfig(accessor);
            const result = [];
            if (!!volume) {
                result.push(['accessibility.signalOptions.volume', { value: volume }]);
            }
            if (!!delayGeneral) {
                result.push(['accessibility.signalOptions.experimental.delays.general', { value: delayGeneral }]);
            }
            if (!!delayError) {
                result.push(['accessibility.signalOptions.experimental.delays.errorAtPosition', { value: delayError }]);
            }
            if (!!delayWarning) {
                result.push(['accessibility.signalOptions.experimental.delays.warningAtPosition', { value: delayWarning }]);
            }
            if (!!debouncePositionChanges) {
                result.push(['accessibility.signalOptions.debouncePositionChanges', { value: debouncePositionChanges }]);
            }
            result.push(['accessibility.signalOptions', { value: undefined }]);
            return result;
        }
    }]);
( Registry.as(Extensions$1.ConfigurationMigration))
    .registerConfigurationMigrations([{
        key: 'accessibility.signals.sounds.volume',
        migrateFn: (value) => {
            return [
                ['accessibility.signalOptions.volume', { value }],
                ['accessibility.signals.sounds.volume', { value: undefined }]
            ];
        }
    }]);
( Registry.as(Extensions$1.ConfigurationMigration))
    .registerConfigurationMigrations([{
        key: 'accessibility.signals.debouncePositionChanges',
        migrateFn: (value) => {
            return [
                ['accessibility.signalOptions.debouncePositionChanges', { value }],
                ['accessibility.signals.debouncePositionChanges', { value: undefined }]
            ];
        }
    }]);
function getDelaysFromConfig(accessor, type) {
    return accessor(`accessibility.signalOptions.experimental.delays.${type}`) || accessor('accessibility.signalOptions')?.['experimental.delays']?.[`${type}`] || accessor('accessibility.signalOptions')?.['delays']?.[`${type}`];
}
function getVolumeFromConfig(accessor) {
    return accessor('accessibility.signalOptions.volume') || accessor('accessibility.signalOptions')?.volume || accessor('accessibility.signals.sounds.volume') || accessor('audioCues.volume');
}
function getDebouncePositionChangesFromConfig(accessor) {
    return accessor('accessibility.signalOptions.debouncePositionChanges') || accessor('accessibility.signalOptions')?.debouncePositionChanges || accessor('accessibility.signals.debouncePositionChanges') || accessor('audioCues.debouncePositionChanges');
}
( Registry.as(Extensions$1.ConfigurationMigration))
    .registerConfigurationMigrations([{
        key: AccessibilityVoiceSettingId.AutoSynthesize,
        migrateFn: (value) => {
            let newValue;
            if (value === true) {
                newValue = 'on';
            }
            else if (value === false) {
                newValue = 'off';
            }
            else {
                return [];
            }
            return [
                [AccessibilityVoiceSettingId.AutoSynthesize, { value: newValue }],
            ];
        }
    }]);
( Registry.as(Extensions$1.ConfigurationMigration))
    .registerConfigurationMigrations([{
        key: 'accessibility.signals.chatResponsePending',
        migrateFn: (value, accessor) => {
            return [
                ['accessibility.signals.progress', { value }],
                ['accessibility.signals.chatResponsePending', { value: undefined }],
            ];
        }
    }]);
( Registry.as(Extensions$1.ConfigurationMigration))
    .registerConfigurationMigrations(( AccessibilitySignal.allAccessibilitySignals.map(item => item.legacySoundSettingsKey ? ({
    key: item.legacySoundSettingsKey,
    migrateFn: (sound, accessor) => {
        const configurationKeyValuePairs = [];
        const legacyAnnouncementSettingsKey = item.legacyAnnouncementSettingsKey;
        let announcement;
        if (legacyAnnouncementSettingsKey) {
            announcement = accessor(legacyAnnouncementSettingsKey) ?? undefined;
            if (announcement !== undefined && typeof announcement !== 'string') {
                announcement = announcement ? 'auto' : 'off';
            }
        }
        configurationKeyValuePairs.push([`${item.legacySoundSettingsKey}`, { value: undefined }]);
        configurationKeyValuePairs.push([`${item.settingsKey}`, { value: announcement !== undefined ? { announcement, sound } : { sound } }]);
        return configurationKeyValuePairs;
    }
}) : undefined)).filter(isDefined));
( Registry.as(Extensions$1.ConfigurationMigration))
    .registerConfigurationMigrations(( AccessibilitySignal.allAccessibilitySignals.filter(i => !!i.legacyAnnouncementSettingsKey && !!i.legacySoundSettingsKey).map(item => ({
    key: item.legacyAnnouncementSettingsKey,
    migrateFn: (announcement, accessor) => {
        const configurationKeyValuePairs = [];
        const sound = accessor(item.settingsKey)?.sound || accessor(item.legacySoundSettingsKey);
        if (announcement !== undefined && typeof announcement !== 'string') {
            announcement = announcement ? 'auto' : 'off';
        }
        configurationKeyValuePairs.push([`${item.settingsKey}`, { value: announcement !== undefined ? { announcement, sound } : { sound } }]);
        configurationKeyValuePairs.push([`${item.legacyAnnouncementSettingsKey}`, { value: undefined }]);
        configurationKeyValuePairs.push([`${item.legacySoundSettingsKey}`, { value: undefined }]);
        return configurationKeyValuePairs;
    }
}))));

export { AccessibilityVerbositySettingId, AccessibilityVoiceSettingId, AccessibilityWorkbenchSettingId, DynamicSpeechAccessibilityConfiguration, SpeechTimeoutDefault, ViewDimUnfocusedOpacityProperties, accessibilityConfigurationNodeBase, accessibilityHelpIsShown, accessibleViewContainsCodeBlocks, accessibleViewCurrentProviderId, accessibleViewGoToSymbolSupported, accessibleViewHasAssignedKeybindings, accessibleViewHasUnassignedKeybindings, accessibleViewInCodeBlock, accessibleViewIsShown, accessibleViewOnLastLine, accessibleViewSupportsNavigation, accessibleViewVerbosityEnabled, announcementFeatureBase, registerAccessibilityConfiguration, soundFeatureBase };
